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
|
---|---|---|---|---|
-6,068,976,579,504,841,000 | debian | 59 | 0 | static void write_variables ( struct recvbuf * rbufp , int restrict_mask ) {
const struct ctl_var * v ;
int ext_var ;
char * valuep ;
long val ;
size_t octets ;
char * vareqv ;
const char * t ;
char * tt ;
val = 0 ;
if ( res_associd != 0 ) {
ctl_error ( CERR_PERMISSION ) ;
return ;
}
rpkt . status = htons ( ctlsysstatus ( ) ) ;
while ( ( v = ctl_getitem ( sys_var , & valuep ) ) != 0 ) {
ext_var = 0 ;
if ( v -> flags & EOV ) {
if ( ( v = ctl_getitem ( ext_sys_var , & valuep ) ) != 0 ) {
if ( v -> flags & EOV ) {
ctl_error ( CERR_UNKNOWNVAR ) ;
return ;
}
ext_var = 1 ;
}
else {
break ;
}
}
if ( ! ( v -> flags & CAN_WRITE ) ) {
ctl_error ( CERR_PERMISSION ) ;
return ;
}
if ( ! ext_var && ( * valuep == '\0' || ! atoint ( valuep , & val ) ) ) {
ctl_error ( CERR_BADFMT ) ;
return ;
}
if ( ! ext_var && ( val & ~ LEAP_NOTINSYNC ) != 0 ) {
ctl_error ( CERR_BADVALUE ) ;
return ;
}
if ( ext_var ) {
octets = strlen ( v -> text ) + strlen ( valuep ) + 2 ;
vareqv = emalloc ( octets ) ;
tt = vareqv ;
t = v -> text ;
while ( * t && * t != '=' ) * tt ++ = * t ++ ;
* tt ++ = '=' ;
memcpy ( tt , valuep , 1 + strlen ( valuep ) ) ;
set_sys_var ( vareqv , 1 + strlen ( vareqv ) , v -> flags ) ;
free ( vareqv ) ;
}
else {
ctl_error ( CERR_UNSPEC ) ;
return ;
}
}
ctl_flushpkt ( 0 ) ;
} |
-4,106,680,724,983,639,000 | chrome | 20 | 0 | static void sbr_chirp ( SpectralBandReplication * sbr , SBRData * ch_data ) {
int i ;
float new_bw ;
static const float bw_tab [ ] = {
0.0f , 0.75f , 0.9f , 0.98f }
;
for ( i = 0 ;
i < sbr -> n_q ;
i ++ ) {
if ( ch_data -> bs_invf_mode [ 0 ] [ i ] + ch_data -> bs_invf_mode [ 1 ] [ i ] == 1 ) {
new_bw = 0.6f ;
}
else new_bw = bw_tab [ ch_data -> bs_invf_mode [ 0 ] [ i ] ] ;
if ( new_bw < ch_data -> bw_array [ i ] ) {
new_bw = 0.75f * new_bw + 0.25f * ch_data -> bw_array [ i ] ;
}
else new_bw = 0.90625f * new_bw + 0.09375f * ch_data -> bw_array [ i ] ;
ch_data -> bw_array [ i ] = new_bw < 0.015625f ? 0.0f : new_bw ;
}
} |
7,039,307,292,471,245,000 | debian | 9 | 0 | static void dtap_bcc_get_status ( tvbuff_t * tvb , proto_tree * tree , packet_info * pinfo _U_ , guint32 offset , guint len ) {
guint32 curr_offset ;
guint32 consumed ;
guint curr_len ;
curr_offset = offset ;
curr_len = len ;
ELEM_OPT_TLV ( 0x17 , GSM_A_PDU_TYPE_COMMON , DE_MID , NULL ) ;
EXTRANEOUS_DATA_CHECK ( curr_len , 0 , pinfo , & ei_gsm_a_dtap_extraneous_data ) ;
} |
-4,552,633,429,382,740,500 | debian | 3 | 0 | unsigned int mpi_get_flags ( MPI a ) {
return a -> flags ;
} |
-4,055,702,019,813,177,000 | debian | 31 | 1 | static void iax2_add_ts_fields ( packet_info * pinfo , proto_tree * iax2_tree , iax_packet_data * iax_packet , guint16 shortts ) {
guint32 longts = shortts ;
nstime_t ts ;
proto_item * item ;
if ( iax_packet -> call_data == NULL ) {
return ;
}
if ( iax_packet -> abstime . secs == - 1 ) {
time_t start_secs = iax_packet -> call_data -> start_time . secs ;
time_t abs_secs = start_secs + longts / 1000 ;
while ( abs_secs < pinfo -> fd -> abs_ts . secs - 16 ) {
longts += 32768 ;
abs_secs = start_secs + longts / 1000 ;
}
iax_packet -> abstime . secs = abs_secs ;
iax_packet -> abstime . nsecs = iax_packet -> call_data -> start_time . nsecs + ( longts % 1000 ) * 1000000 ;
if ( iax_packet -> abstime . nsecs >= 1000000000 ) {
iax_packet -> abstime . nsecs -= 1000000000 ;
iax_packet -> abstime . secs ++ ;
}
}
iax2_info -> timestamp = longts ;
if ( iax2_tree ) {
item = proto_tree_add_time ( iax2_tree , hf_iax2_absts , NULL , 0 , 0 , & iax_packet -> abstime ) ;
PROTO_ITEM_SET_GENERATED ( item ) ;
ts = pinfo -> fd -> abs_ts ;
nstime_delta ( & ts , & ts , & iax_packet -> abstime ) ;
item = proto_tree_add_time ( iax2_tree , hf_iax2_lateness , NULL , 0 , 0 , & ts ) ;
PROTO_ITEM_SET_GENERATED ( item ) ;
}
} |
252,275,190,935,145,020 | debian | 8 | 0 | static void read_switchable_interp_probs ( FRAME_CONTEXT * fc , vp9_reader * r ) {
int i , j ;
for ( j = 0 ;
j < SWITCHABLE_FILTER_CONTEXTS ;
++ j ) for ( i = 0 ;
i < SWITCHABLE_FILTERS - 1 ;
++ i ) vp9_diff_update_prob ( r , & fc -> switchable_interp_prob [ j ] [ i ] ) ;
} |
4,180,964,683,905,831,000 | debian | 11 | 0 | static int selinux_binder_transaction ( struct task_struct * from , struct task_struct * to ) {
u32 mysid = current_sid ( ) ;
u32 fromsid = task_sid ( from ) ;
u32 tosid = task_sid ( to ) ;
int rc ;
if ( mysid != fromsid ) {
rc = avc_has_perm ( mysid , fromsid , SECCLASS_BINDER , BINDER__IMPERSONATE , NULL ) ;
if ( rc ) return rc ;
}
return avc_has_perm ( fromsid , tosid , SECCLASS_BINDER , BINDER__CALL , NULL ) ;
} |
9,046,191,708,840,219,000 | debian | 8 | 0 | static int __tipc_add_link_prop ( struct sk_buff * skb , struct tipc_nl_compat_msg * msg , struct tipc_link_config * lc ) {
switch ( msg -> cmd ) {
case TIPC_CMD_SET_LINK_PRI : return nla_put_u32 ( skb , TIPC_NLA_PROP_PRIO , ntohl ( lc -> value ) ) ;
case TIPC_CMD_SET_LINK_TOL : return nla_put_u32 ( skb , TIPC_NLA_PROP_TOL , ntohl ( lc -> value ) ) ;
case TIPC_CMD_SET_LINK_WINDOW : return nla_put_u32 ( skb , TIPC_NLA_PROP_WIN , ntohl ( lc -> value ) ) ;
}
return - EINVAL ;
} |
2,820,551,931,453,396,000 | debian | 6 | 0 | static void jas_image_cmpt_destroy ( jas_image_cmpt_t * cmpt ) {
if ( cmpt -> stream_ ) {
jas_stream_close ( cmpt -> stream_ ) ;
}
jas_free ( cmpt ) ;
} |
-5,546,171,973,191,408,000 | chrome | 4 | 0 | void usage_exit ( ) {
fprintf ( stderr , "Usage: %s <width> <height> <infile> <outfile(s)> <output psnr?>\n" , exec_name ) ;
exit ( EXIT_FAILURE ) ;
} |
-7,253,276,028,511,611,000 | debian | 76 | 0 | static int calc_slice_sizes ( VC2EncContext * s ) {
int i , j , slice_x , slice_y , bytes_left = 0 ;
int bytes_top [ SLICE_REDIST_TOTAL ] = {
0 }
;
int64_t total_bytes_needed = 0 ;
int slice_redist_range = FFMIN ( SLICE_REDIST_TOTAL , s -> num_x * s -> num_y ) ;
SliceArgs * enc_args = s -> slice_args ;
SliceArgs * top_loc [ SLICE_REDIST_TOTAL ] = {
NULL }
;
init_quant_matrix ( s ) ;
for ( slice_y = 0 ;
slice_y < s -> num_y ;
slice_y ++ ) {
for ( slice_x = 0 ;
slice_x < s -> num_x ;
slice_x ++ ) {
SliceArgs * args = & enc_args [ s -> num_x * slice_y + slice_x ] ;
args -> ctx = s ;
args -> x = slice_x ;
args -> y = slice_y ;
args -> bits_ceil = s -> slice_max_bytes << 3 ;
args -> bits_floor = s -> slice_min_bytes << 3 ;
memset ( args -> cache , 0 , s -> q_ceil * sizeof ( * args -> cache ) ) ;
}
}
s -> avctx -> execute ( s -> avctx , rate_control , enc_args , NULL , s -> num_x * s -> num_y , sizeof ( SliceArgs ) ) ;
for ( i = 0 ;
i < s -> num_x * s -> num_y ;
i ++ ) {
SliceArgs * args = & enc_args [ i ] ;
bytes_left += s -> slice_max_bytes - args -> bytes ;
for ( j = 0 ;
j < slice_redist_range ;
j ++ ) {
if ( args -> bytes > bytes_top [ j ] ) {
bytes_top [ j ] = args -> bytes ;
top_loc [ j ] = args ;
break ;
}
}
}
while ( 1 ) {
int distributed = 0 ;
for ( i = 0 ;
i < slice_redist_range ;
i ++ ) {
SliceArgs * args ;
int bits , bytes , diff , prev_bytes , new_idx ;
if ( bytes_left <= 0 ) break ;
if ( ! top_loc [ i ] || ! top_loc [ i ] -> quant_idx ) break ;
args = top_loc [ i ] ;
prev_bytes = args -> bytes ;
new_idx = FFMAX ( args -> quant_idx - 1 , 0 ) ;
bits = count_hq_slice ( args , new_idx ) ;
bytes = SSIZE_ROUND ( bits >> 3 ) ;
diff = bytes - prev_bytes ;
if ( ( bytes_left - diff ) > 0 ) {
args -> quant_idx = new_idx ;
args -> bytes = bytes ;
bytes_left -= diff ;
distributed ++ ;
}
}
if ( ! distributed ) break ;
}
for ( i = 0 ;
i < s -> num_x * s -> num_y ;
i ++ ) {
SliceArgs * args = & enc_args [ i ] ;
total_bytes_needed += args -> bytes ;
s -> q_avg = ( s -> q_avg + args -> quant_idx ) / 2 ;
}
return total_bytes_needed ;
} |
3,557,739,556,029,059,000 | chrome | 7 | 0 | void vp9_sad ## m ## x ## n ## x4d_c ( const uint8_t * src , int src_stride , const uint8_t * const refs [ ] , int ref_stride , unsigned int * sads ) {
int i ;
for ( i = 0 ;
i < 4 ;
++ i ) sads [ i ] = vp9_sad ## m ## x ## n ## _c ( src , src_stride , refs [ i ] , ref_stride ) ;
\ }
sadMxN ( 64 , 64 ) sadMxNxK ( 64 , 64 , 3 ) sadMxNxK ( 64 , 64 , 8 ) sadMxNx4D ( 64 , 64 ) sadMxN ( 64 , 32 ) sadMxNx4D ( 64 , 32 ) sadMxN ( 32 , 64 ) sadMxNx4D ( 32 , 64 ) sadMxN ( 32 , 32 ) sadMxNxK ( 32 , 32 , 3 ) sadMxNxK ( 32 , 32 , 8 ) sadMxNx4D ( 32 , 32 ) sadMxN ( 32 , 16 ) sadMxNx4D ( 32 , 16 ) |
-877,789,201,846,276,100 | chrome | 33 | 0 | TEST_F ( WebUsbDetectorTest , TwoUsbDevicesWereThereBeforeAndThenRemovedAndNewUsbDeviceAdded ) {
base : : string16 product_name_1 = base : : UTF8ToUTF16 ( kProductName_1 ) ;
GURL landing_page_1 ( kLandingPage_1 ) ;
scoped_refptr < device : : MockUsbDevice > device_1 ( new device : : MockUsbDevice ( 0 , 1 , "Google" , kProductName_1 , "002" , landing_page_1 ) ) ;
std : : string guid_1 = device_1 -> guid ( ) ;
base : : string16 product_name_2 = base : : UTF8ToUTF16 ( kProductName_2 ) ;
GURL landing_page_2 ( kLandingPage_2 ) ;
scoped_refptr < device : : MockUsbDevice > device_2 ( new device : : MockUsbDevice ( 3 , 4 , "Google" , kProductName_2 , "005" , landing_page_2 ) ) ;
std : : string guid_2 = device_2 -> guid ( ) ;
base : : string16 product_name_3 = base : : UTF8ToUTF16 ( kProductName_3 ) ;
GURL landing_page_3 ( kLandingPage_3 ) ;
scoped_refptr < device : : MockUsbDevice > device_3 ( new device : : MockUsbDevice ( 6 , 7 , "Google" , kProductName_3 , "008" , landing_page_3 ) ) ;
std : : string guid_3 = device_3 -> guid ( ) ;
device_client_ . usb_service ( ) -> AddDevice ( device_1 ) ;
EXPECT_TRUE ( message_center_ -> FindVisibleNotificationById ( guid_1 ) == nullptr ) ;
device_client_ . usb_service ( ) -> AddDevice ( device_3 ) ;
EXPECT_TRUE ( message_center_ -> FindVisibleNotificationById ( guid_3 ) == nullptr ) ;
Initialize ( ) ;
device_client_ . usb_service ( ) -> RemoveDevice ( device_1 ) ;
EXPECT_TRUE ( message_center_ -> FindVisibleNotificationById ( guid_1 ) == nullptr ) ;
device_client_ . usb_service ( ) -> AddDevice ( device_2 ) ;
message_center : : Notification * notification = message_center_ -> FindVisibleNotificationById ( guid_2 ) ;
ASSERT_TRUE ( notification != nullptr ) ;
base : : string16 expected_title = base : : ASCIIToUTF16 ( "Google Product B detected" ) ;
EXPECT_EQ ( expected_title , notification -> title ( ) ) ;
base : : string16 expected_message = base : : ASCIIToUTF16 ( "Go to www.google.com to connect." ) ;
EXPECT_EQ ( expected_message , notification -> message ( ) ) ;
EXPECT_TRUE ( notification -> delegate ( ) != nullptr ) ;
device_client_ . usb_service ( ) -> RemoveDevice ( device_3 ) ;
EXPECT_TRUE ( message_center_ -> FindVisibleNotificationById ( guid_3 ) == nullptr ) ;
device_client_ . usb_service ( ) -> RemoveDevice ( device_2 ) ;
EXPECT_TRUE ( message_center_ -> FindVisibleNotificationById ( guid_2 ) == nullptr ) ;
} |
-5,268,859,819,325,808,000 | debian | 14 | 0 | static void mount_stop ( NautilusDirectory * directory ) {
NautilusFile * file ;
if ( directory -> details -> mount_state != NULL ) {
file = directory -> details -> mount_state -> file ;
if ( file != NULL ) {
g_assert ( NAUTILUS_IS_FILE ( file ) ) ;
g_assert ( file -> details -> directory == directory ) ;
if ( is_needy ( file , lacks_mount , REQUEST_MOUNT ) ) {
return ;
}
}
mount_cancel ( directory ) ;
}
} |
369,115,599,810,341,100 | debian | 14 | 0 | static void vga_draw_line32_be ( VGACommonState * vga , uint8_t * d , uint32_t addr , int width ) {
int w ;
uint32_t r , g , b ;
w = width ;
do {
r = vga_read_byte ( vga , addr + 1 ) ;
g = vga_read_byte ( vga , addr + 2 ) ;
b = vga_read_byte ( vga , addr + 3 ) ;
( ( uint32_t * ) d ) [ 0 ] = rgb_to_pixel32 ( r , g , b ) ;
addr += 4 ;
d += 4 ;
}
while ( -- w != 0 ) ;
} |
6,336,384,260,629,386,000 | debian | 6 | 0 | void proto_reg_handoff_zbee_zcl_identify ( void ) {
dissector_handle_t identify_handle ;
identify_handle = find_dissector ( ZBEE_PROTOABBREV_ZCL_IDENTIFY ) ;
dissector_add_uint ( "zbee.zcl.cluster" , ZBEE_ZCL_CID_IDENTIFY , identify_handle ) ;
zbee_zcl_init_cluster ( proto_zbee_zcl_identify , ett_zbee_zcl_identify , ZBEE_ZCL_CID_IDENTIFY , hf_zbee_zcl_identify_attr_id , hf_zbee_zcl_identify_srv_rx_cmd_id , hf_zbee_zcl_identify_srv_tx_cmd_id , ( zbee_zcl_fn_attr_data ) dissect_zcl_identify_attr_data ) ;
} |
9,165,901,716,987,135,000 | chrome | 22 | 0 | TEST_F ( ImmersiveModeControllerAshTest , TabAndBrowserFullscreen ) {
AddTab ( browser ( ) , GURL ( "about:blank" ) ) ;
ash : : ShelfLayoutManager * shelf = ash : : Shell : : GetPrimaryRootWindowController ( ) -> GetShelfLayoutManager ( ) ;
ASSERT_EQ ( ash : : SHELF_VISIBLE , shelf -> visibility_state ( ) ) ;
ToggleFullscreen ( ) ;
ASSERT_TRUE ( controller ( ) -> IsEnabled ( ) ) ;
EXPECT_EQ ( ash : : SHELF_AUTO_HIDE , shelf -> visibility_state ( ) ) ;
EXPECT_FALSE ( controller ( ) -> ShouldHideTabIndicators ( ) ) ;
SetTabFullscreen ( true ) ;
ASSERT_TRUE ( controller ( ) -> IsEnabled ( ) ) ;
EXPECT_EQ ( ash : : SHELF_HIDDEN , shelf -> visibility_state ( ) ) ;
EXPECT_TRUE ( controller ( ) -> ShouldHideTabIndicators ( ) ) ;
SetTabFullscreen ( false ) ;
ASSERT_TRUE ( controller ( ) -> IsEnabled ( ) ) ;
EXPECT_EQ ( ash : : SHELF_AUTO_HIDE , shelf -> visibility_state ( ) ) ;
EXPECT_FALSE ( controller ( ) -> ShouldHideTabIndicators ( ) ) ;
SetTabFullscreen ( true ) ;
ToggleFullscreen ( ) ;
ASSERT_FALSE ( controller ( ) -> IsEnabled ( ) ) ;
EXPECT_EQ ( ash : : SHELF_VISIBLE , shelf -> visibility_state ( ) ) ;
EXPECT_TRUE ( controller ( ) -> ShouldHideTabIndicators ( ) ) ;
} |
3,584,320,764,213,684,000 | debian | 19 | 1 | int parse_CCategorizationSpec ( tvbuff_t * tvb , int offset , proto_tree * parent_tree , proto_tree * pad_tree , const char * fmt , ... ) {
proto_item * item ;
proto_tree * tree ;
const char * txt ;
va_list ap ;
va_start ( ap , fmt ) ;
txt = wmem_strdup_vprintf ( wmem_packet_scope ( ) , fmt , ap ) ;
va_end ( ap ) ;
tree = proto_tree_add_subtree ( parent_tree , tvb , offset , 0 , ett_CCategorizationSpec , & item , txt ) ;
offset = parse_CColumnSet ( tvb , offset , tree , "csColumns" ) ;
offset = parse_CCategSpec ( tvb , offset , tree , pad_tree , "Spec" ) ;
offset = parse_CAggregSet ( tvb , offset , tree , pad_tree , "AggregSet" ) ;
offset = parse_CSortAggregSet ( tvb , offset , tree , pad_tree , "SortAggregSet" ) ;
offset = parse_CInGroupSortAggregSets ( tvb , offset , tree , pad_tree , "InGroupSortAggregSets" ) ;
proto_tree_add_item ( tree , hf_mswsp_categorizationspec_cmaxres , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
proto_item_set_end ( item , tvb , offset ) ;
return offset ;
} |
1,107,540,818,972,464,800 | chrome | 10 | 1 | IN_PROC_BROWSER_TEST_F ( RegisterProtocolHandlerBrowserTest , ContextMenuEntryAppearsForHandledUrls ) {
scoped_ptr < TestRenderViewContextMenu > menu ( CreateContextMenu ( GURL ( "http://www.google.com/" ) ) ) ;
ASSERT_FALSE ( menu -> IsItemPresent ( IDC_CONTENT_CONTEXT_OPENLINKWITH ) ) ;
AddProtocolHandler ( std : : string ( "web+search" ) , GURL ( "http://www.google.com/%s" ) , base : : UTF8ToUTF16 ( std : : string ( "Test handler" ) ) ) ;
GURL url ( "web+search:testing" ) ;
ProtocolHandlerRegistry * registry = ProtocolHandlerRegistryFactory : : GetForProfile ( browser ( ) -> profile ( ) ) ;
ASSERT_EQ ( 1u , registry -> GetHandlersFor ( url . scheme ( ) ) . size ( ) ) ;
menu . reset ( CreateContextMenu ( url ) ) ;
ASSERT_TRUE ( menu -> IsItemPresent ( IDC_CONTENT_CONTEXT_OPENLINKWITH ) ) ;
} |
7,424,930,167,238,098,000 | debian | 5 | 0 | static int proc_claiminterface ( struct usb_dev_state * ps , void __user * arg ) {
unsigned int ifnum ;
if ( get_user ( ifnum , ( unsigned int __user * ) arg ) ) return - EFAULT ;
return claimintf ( ps , ifnum ) ;
} |
1,223,258,652,239,369,200 | debian | 65 | 0 | static HashTable * spl_filesystem_object_get_debug_info ( zval * obj , int * is_temp TSRMLS_DC ) {
spl_filesystem_object * intern = ( spl_filesystem_object * ) zend_object_store_get_object ( obj TSRMLS_CC ) ;
HashTable * rv ;
zval * tmp , zrv ;
char * pnstr , * path ;
int pnlen , path_len ;
char stmp [ 2 ] ;
* is_temp = 1 ;
if ( ! intern -> std . properties ) {
rebuild_object_properties ( & intern -> std ) ;
}
ALLOC_HASHTABLE ( rv ) ;
ZEND_INIT_SYMTABLE_EX ( rv , zend_hash_num_elements ( intern -> std . properties ) + 3 , 0 ) ;
INIT_PZVAL ( & zrv ) ;
Z_ARRVAL ( zrv ) = rv ;
zend_hash_copy ( rv , intern -> std . properties , ( copy_ctor_func_t ) zval_add_ref , ( void * ) & tmp , sizeof ( zval * ) ) ;
pnstr = spl_gen_private_prop_name ( spl_ce_SplFileInfo , "pathName" , sizeof ( "pathName" ) - 1 , & pnlen TSRMLS_CC ) ;
path = spl_filesystem_object_get_pathname ( intern , & path_len TSRMLS_CC ) ;
add_assoc_stringl_ex ( & zrv , pnstr , pnlen + 1 , path , path_len , 1 ) ;
efree ( pnstr ) ;
if ( intern -> file_name ) {
pnstr = spl_gen_private_prop_name ( spl_ce_SplFileInfo , "fileName" , sizeof ( "fileName" ) - 1 , & pnlen TSRMLS_CC ) ;
spl_filesystem_object_get_path ( intern , & path_len TSRMLS_CC ) ;
if ( path_len && path_len < intern -> file_name_len ) {
add_assoc_stringl_ex ( & zrv , pnstr , pnlen + 1 , intern -> file_name + path_len + 1 , intern -> file_name_len - ( path_len + 1 ) , 1 ) ;
}
else {
add_assoc_stringl_ex ( & zrv , pnstr , pnlen + 1 , intern -> file_name , intern -> file_name_len , 1 ) ;
}
efree ( pnstr ) ;
}
if ( intern -> type == SPL_FS_DIR ) {
# ifdef HAVE_GLOB pnstr = spl_gen_private_prop_name ( spl_ce_DirectoryIterator , "glob" , sizeof ( "glob" ) - 1 , & pnlen TSRMLS_CC ) ;
if ( php_stream_is ( intern -> u . dir . dirp , & php_glob_stream_ops ) ) {
add_assoc_stringl_ex ( & zrv , pnstr , pnlen + 1 , intern -> _path , intern -> _path_len , 1 ) ;
}
else {
add_assoc_bool_ex ( & zrv , pnstr , pnlen + 1 , 0 ) ;
}
efree ( pnstr ) ;
# endif pnstr = spl_gen_private_prop_name ( spl_ce_RecursiveDirectoryIterator , "subPathName" , sizeof ( "subPathName" ) - 1 , & pnlen TSRMLS_CC ) ;
if ( intern -> u . dir . sub_path ) {
add_assoc_stringl_ex ( & zrv , pnstr , pnlen + 1 , intern -> u . dir . sub_path , intern -> u . dir . sub_path_len , 1 ) ;
}
else {
add_assoc_stringl_ex ( & zrv , pnstr , pnlen + 1 , "" , 0 , 1 ) ;
}
efree ( pnstr ) ;
}
if ( intern -> type == SPL_FS_FILE ) {
pnstr = spl_gen_private_prop_name ( spl_ce_SplFileObject , "openMode" , sizeof ( "openMode" ) - 1 , & pnlen TSRMLS_CC ) ;
add_assoc_stringl_ex ( & zrv , pnstr , pnlen + 1 , intern -> u . file . open_mode , intern -> u . file . open_mode_len , 1 ) ;
efree ( pnstr ) ;
stmp [ 1 ] = '\0' ;
stmp [ 0 ] = intern -> u . file . delimiter ;
pnstr = spl_gen_private_prop_name ( spl_ce_SplFileObject , "delimiter" , sizeof ( "delimiter" ) - 1 , & pnlen TSRMLS_CC ) ;
add_assoc_stringl_ex ( & zrv , pnstr , pnlen + 1 , stmp , 1 , 1 ) ;
efree ( pnstr ) ;
stmp [ 0 ] = intern -> u . file . enclosure ;
pnstr = spl_gen_private_prop_name ( spl_ce_SplFileObject , "enclosure" , sizeof ( "enclosure" ) - 1 , & pnlen TSRMLS_CC ) ;
add_assoc_stringl_ex ( & zrv , pnstr , pnlen + 1 , stmp , 1 , 1 ) ;
efree ( pnstr ) ;
}
return rv ;
} |
-2,064,332,158,282,087,200 | debian | 6 | 0 | static void stream_add_data ( struct attachment_istream * astream , const void * data , size_t size ) {
if ( size > 0 ) {
memcpy ( i_stream_alloc ( & astream -> istream , size ) , data , size ) ;
astream -> istream . pos += size ;
}
} |
-8,054,970,867,770,516,000 | debian | 25 | 0 | u_int sl_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 || length < SLIP_HDRLEN ) {
ND_PRINT ( ( ndo , "%s" , tstr ) ) ;
return ( caplen ) ;
}
caplen -= SLIP_HDRLEN ;
length -= SLIP_HDRLEN ;
ip = ( const struct ip * ) ( p + SLIP_HDRLEN ) ;
if ( ndo -> ndo_eflag ) sliplink_print ( ndo , p , ip , length ) ;
if ( caplen < 1 || length < 1 ) {
ND_PRINT ( ( ndo , "%s" , tstr ) ) ;
return ( caplen + SLIP_HDRLEN ) ;
}
switch ( IP_V ( ip ) ) {
case 4 : ip_print ( ndo , ( const u_char * ) ip , length ) ;
break ;
case 6 : ip6_print ( ndo , ( const u_char * ) ip , length ) ;
break ;
default : ND_PRINT ( ( ndo , "ip v%d" , IP_V ( ip ) ) ) ;
}
return ( SLIP_HDRLEN ) ;
} |
-7,434,014,980,763,121,000 | debian | 13 | 0 | void ber_set_filename ( gchar * filename ) {
gchar * ptr ;
if ( ber_filename ) {
g_free ( ber_filename ) ;
ber_filename = NULL ;
}
if ( filename ) {
ber_filename = g_strdup ( filename ) ;
if ( ( ptr = strrchr ( ber_filename , '.' ) ) != NULL ) {
ber_decode_as ( get_ber_oid_syntax ( ptr ) ) ;
}
}
} |
7,072,059,544,915,634,000 | chrome | 404 | 0 | static void U_CALLCONV _LMBCSOpen ## n ( UConverter * _this , UConverterLoadArgs * pArgs , UErrorCode * err ) \ {
_LMBCSOpenWorker ( _this , pArgs , err , n ) ;
}
static void _LMBCSOpenWorker ( UConverter * _this , UConverterLoadArgs * pArgs , UErrorCode * err , ulmbcs_byte_t OptGroup ) {
UConverterDataLMBCS * extraInfo = ( UConverterDataLMBCS * ) uprv_malloc ( sizeof ( UConverterDataLMBCS ) ) ;
_this -> extraInfo = extraInfo ;
if ( extraInfo != NULL ) {
UConverterNamePieces stackPieces ;
UConverterLoadArgs stackArgs = UCNV_LOAD_ARGS_INITIALIZER ;
ulmbcs_byte_t i ;
uprv_memset ( extraInfo , 0 , sizeof ( UConverterDataLMBCS ) ) ;
stackArgs . onlyTestIsLoadable = pArgs -> onlyTestIsLoadable ;
for ( i = 0 ;
i <= ULMBCS_GRP_LAST && U_SUCCESS ( * err ) ;
i ++ ) {
if ( OptGroupByteToCPName [ i ] != NULL ) {
extraInfo -> OptGrpConverter [ i ] = ucnv_loadSharedData ( OptGroupByteToCPName [ i ] , & stackPieces , & stackArgs , err ) ;
}
}
if ( U_FAILURE ( * err ) || pArgs -> onlyTestIsLoadable ) {
_LMBCSClose ( _this ) ;
return ;
}
extraInfo -> OptGroup = OptGroup ;
extraInfo -> localeConverterIndex = FindLMBCSLocale ( pArgs -> locale ) ;
}
else {
* err = U_MEMORY_ALLOCATION_ERROR ;
}
}
U_CDECL_BEGIN static void U_CALLCONV _LMBCSClose ( UConverter * _this ) {
if ( _this -> extraInfo != NULL ) {
ulmbcs_byte_t Ix ;
UConverterDataLMBCS * extraInfo = ( UConverterDataLMBCS * ) _this -> extraInfo ;
for ( Ix = 0 ;
Ix <= ULMBCS_GRP_LAST ;
Ix ++ ) {
if ( extraInfo -> OptGrpConverter [ Ix ] != NULL ) ucnv_unloadSharedDataIfReady ( extraInfo -> OptGrpConverter [ Ix ] ) ;
}
if ( ! _this -> isExtraLocal ) {
uprv_free ( _this -> extraInfo ) ;
_this -> extraInfo = NULL ;
}
}
}
typedef struct LMBCSClone {
UConverter cnv ;
UConverterDataLMBCS lmbcs ;
}
LMBCSClone ;
static UConverter * U_CALLCONV _LMBCSSafeClone ( const UConverter * cnv , void * stackBuffer , int32_t * pBufferSize , UErrorCode * status ) {
( void ) status ;
LMBCSClone * newLMBCS ;
UConverterDataLMBCS * extraInfo ;
int32_t i ;
if ( * pBufferSize <= 0 ) {
* pBufferSize = ( int32_t ) sizeof ( LMBCSClone ) ;
return NULL ;
}
extraInfo = ( UConverterDataLMBCS * ) cnv -> extraInfo ;
newLMBCS = ( LMBCSClone * ) stackBuffer ;
uprv_memcpy ( & newLMBCS -> lmbcs , extraInfo , sizeof ( UConverterDataLMBCS ) ) ;
for ( i = 0 ;
i <= ULMBCS_GRP_LAST ;
++ i ) {
if ( extraInfo -> OptGrpConverter [ i ] != NULL ) {
ucnv_incrementRefCount ( extraInfo -> OptGrpConverter [ i ] ) ;
}
}
newLMBCS -> cnv . extraInfo = & newLMBCS -> lmbcs ;
newLMBCS -> cnv . isExtraLocal = TRUE ;
return & newLMBCS -> cnv ;
}
static size_t LMBCSConversionWorker ( UConverterDataLMBCS * extraInfo , ulmbcs_byte_t group , ulmbcs_byte_t * pStartLMBCS , UChar * pUniChar , ulmbcs_byte_t * lastConverterIndex , UBool * groups_tried ) {
ulmbcs_byte_t * pLMBCS = pStartLMBCS ;
UConverterSharedData * xcnv = extraInfo -> OptGrpConverter [ group ] ;
int bytesConverted ;
uint32_t value ;
ulmbcs_byte_t firstByte ;
U_ASSERT ( xcnv ) ;
U_ASSERT ( group < ULMBCS_GRP_UNICODE ) ;
bytesConverted = ucnv_MBCSFromUChar32 ( xcnv , * pUniChar , & value , FALSE ) ;
if ( bytesConverted > 0 ) {
firstByte = ( ulmbcs_byte_t ) ( value >> ( ( bytesConverted - 1 ) * 8 ) ) ;
}
else {
groups_tried [ group ] = TRUE ;
return 0 ;
}
* lastConverterIndex = group ;
U_ASSERT ( ( firstByte <= ULMBCS_C0END ) || ( firstByte >= ULMBCS_C1START ) || ( group == ULMBCS_GRP_EXCEPT ) ) ;
if ( group != ULMBCS_GRP_EXCEPT && extraInfo -> OptGroup != group ) {
* pLMBCS ++ = group ;
if ( bytesConverted == 1 && group >= ULMBCS_DOUBLEOPTGROUP_START ) {
* pLMBCS ++ = group ;
}
}
if ( bytesConverted == 1 && firstByte < 0x20 ) return 0 ;
switch ( bytesConverted ) {
case 4 : * pLMBCS ++ = ( ulmbcs_byte_t ) ( value >> 24 ) ;
U_FALLTHROUGH ;
case 3 : * pLMBCS ++ = ( ulmbcs_byte_t ) ( value >> 16 ) ;
U_FALLTHROUGH ;
case 2 : * pLMBCS ++ = ( ulmbcs_byte_t ) ( value >> 8 ) ;
U_FALLTHROUGH ;
case 1 : * pLMBCS ++ = ( ulmbcs_byte_t ) value ;
U_FALLTHROUGH ;
default : break ;
}
return ( pLMBCS - pStartLMBCS ) ;
}
static size_t LMBCSConvertUni ( ulmbcs_byte_t * pLMBCS , UChar uniChar ) {
uint8_t LowCh = ( uint8_t ) ( uniChar & 0x00FF ) ;
uint8_t HighCh = ( uint8_t ) ( uniChar >> 8 ) ;
* pLMBCS ++ = ULMBCS_GRP_UNICODE ;
if ( LowCh == 0 ) {
* pLMBCS ++ = ULMBCS_UNICOMPATZERO ;
* pLMBCS ++ = HighCh ;
}
else {
* pLMBCS ++ = HighCh ;
* pLMBCS ++ = LowCh ;
}
return ULMBCS_UNICODE_SIZE ;
}
static void U_CALLCONV _LMBCSFromUnicode ( UConverterFromUnicodeArgs * args , UErrorCode * err ) {
ulmbcs_byte_t lastConverterIndex = 0 ;
UChar uniChar ;
ulmbcs_byte_t LMBCS [ ULMBCS_CHARSIZE_MAX ] ;
ulmbcs_byte_t * pLMBCS ;
int32_t bytes_written ;
UBool groups_tried [ ULMBCS_GRP_LAST + 1 ] ;
UConverterDataLMBCS * extraInfo = ( UConverterDataLMBCS * ) args -> converter -> extraInfo ;
int sourceIndex = 0 ;
ulmbcs_byte_t OldConverterIndex = 0 ;
while ( args -> source < args -> sourceLimit && ! U_FAILURE ( * err ) ) {
OldConverterIndex = extraInfo -> localeConverterIndex ;
if ( args -> target >= args -> targetLimit ) {
* err = U_BUFFER_OVERFLOW_ERROR ;
break ;
}
uniChar = * ( args -> source ) ;
bytes_written = 0 ;
pLMBCS = LMBCS ;
if ( ( uniChar >= 0x80 ) && ( uniChar <= 0xff ) && ( uniChar != 0xB1 ) && ( uniChar != 0xD7 ) && ( uniChar != 0xF7 ) && ( uniChar != 0xB0 ) && ( uniChar != 0xB4 ) && ( uniChar != 0xB6 ) && ( uniChar != 0xA7 ) && ( uniChar != 0xA8 ) ) {
extraInfo -> localeConverterIndex = ULMBCS_GRP_L1 ;
}
if ( ( ( uniChar > ULMBCS_C0END ) && ( uniChar < ULMBCS_C1START ) ) || uniChar == 0 || uniChar == ULMBCS_HT || uniChar == ULMBCS_CR || uniChar == ULMBCS_LF || uniChar == ULMBCS_123SYSTEMRANGE ) {
* pLMBCS ++ = ( ulmbcs_byte_t ) uniChar ;
bytes_written = 1 ;
}
if ( ! bytes_written ) {
ulmbcs_byte_t group = FindLMBCSUniRange ( uniChar ) ;
if ( group == ULMBCS_GRP_UNICODE ) {
pLMBCS += LMBCSConvertUni ( pLMBCS , uniChar ) ;
bytes_written = ( int32_t ) ( pLMBCS - LMBCS ) ;
}
else if ( group == ULMBCS_GRP_CTRL ) {
if ( uniChar <= ULMBCS_C0END ) {
* pLMBCS ++ = ULMBCS_GRP_CTRL ;
* pLMBCS ++ = ( ulmbcs_byte_t ) ( ULMBCS_CTRLOFFSET + uniChar ) ;
}
else if ( uniChar >= ULMBCS_C1START && uniChar <= ULMBCS_C1START + ULMBCS_CTRLOFFSET ) {
* pLMBCS ++ = ULMBCS_GRP_CTRL ;
* pLMBCS ++ = ( ulmbcs_byte_t ) ( uniChar & 0x00FF ) ;
}
bytes_written = ( int32_t ) ( pLMBCS - LMBCS ) ;
}
else if ( group < ULMBCS_GRP_UNICODE ) {
bytes_written = ( int32_t ) LMBCSConversionWorker ( extraInfo , group , pLMBCS , & uniChar , & lastConverterIndex , groups_tried ) ;
}
if ( ! bytes_written ) {
uprv_memset ( groups_tried , 0 , sizeof ( groups_tried ) ) ;
if ( ( extraInfo -> OptGroup != 1 ) && ( ULMBCS_AMBIGUOUS_MATCH ( group , extraInfo -> OptGroup ) ) ) {
if ( extraInfo -> localeConverterIndex < ULMBCS_DOUBLEOPTGROUP_START ) {
bytes_written = LMBCSConversionWorker ( extraInfo , ULMBCS_GRP_L1 , pLMBCS , & uniChar , & lastConverterIndex , groups_tried ) ;
if ( ! bytes_written ) {
bytes_written = LMBCSConversionWorker ( extraInfo , ULMBCS_GRP_EXCEPT , pLMBCS , & uniChar , & lastConverterIndex , groups_tried ) ;
}
if ( ! bytes_written ) {
bytes_written = LMBCSConversionWorker ( extraInfo , extraInfo -> localeConverterIndex , pLMBCS , & uniChar , & lastConverterIndex , groups_tried ) ;
}
}
else {
bytes_written = LMBCSConversionWorker ( extraInfo , extraInfo -> localeConverterIndex , pLMBCS , & uniChar , & lastConverterIndex , groups_tried ) ;
}
}
if ( ! bytes_written && ( extraInfo -> localeConverterIndex ) && ( ULMBCS_AMBIGUOUS_MATCH ( group , extraInfo -> localeConverterIndex ) ) ) {
bytes_written = ( int32_t ) LMBCSConversionWorker ( extraInfo , extraInfo -> localeConverterIndex , pLMBCS , & uniChar , & lastConverterIndex , groups_tried ) ;
}
if ( ! bytes_written && ( lastConverterIndex ) && ( ULMBCS_AMBIGUOUS_MATCH ( group , lastConverterIndex ) ) ) {
bytes_written = ( int32_t ) LMBCSConversionWorker ( extraInfo , lastConverterIndex , pLMBCS , & uniChar , & lastConverterIndex , groups_tried ) ;
}
if ( ! bytes_written ) {
ulmbcs_byte_t grp_start ;
ulmbcs_byte_t grp_end ;
ulmbcs_byte_t grp_ix ;
grp_start = ( ulmbcs_byte_t ) ( ( group == ULMBCS_AMBIGUOUS_MBCS ) ? ULMBCS_DOUBLEOPTGROUP_START : ULMBCS_GRP_L1 ) ;
grp_end = ( ulmbcs_byte_t ) ( ( group == ULMBCS_AMBIGUOUS_MBCS ) ? ULMBCS_GRP_LAST : ULMBCS_GRP_TH ) ;
if ( group == ULMBCS_AMBIGUOUS_ALL ) {
grp_start = ULMBCS_GRP_L1 ;
grp_end = ULMBCS_GRP_LAST ;
}
for ( grp_ix = grp_start ;
grp_ix <= grp_end && ! bytes_written ;
grp_ix ++ ) {
if ( extraInfo -> OptGrpConverter [ grp_ix ] && ! groups_tried [ grp_ix ] ) {
bytes_written = ( int32_t ) LMBCSConversionWorker ( extraInfo , grp_ix , pLMBCS , & uniChar , & lastConverterIndex , groups_tried ) ;
}
}
if ( ! bytes_written && grp_start == ULMBCS_GRP_L1 ) {
bytes_written = ( int32_t ) LMBCSConversionWorker ( extraInfo , ULMBCS_GRP_EXCEPT , pLMBCS , & uniChar , & lastConverterIndex , groups_tried ) ;
}
}
if ( ! bytes_written ) {
pLMBCS += LMBCSConvertUni ( pLMBCS , uniChar ) ;
bytes_written = ( int32_t ) ( pLMBCS - LMBCS ) ;
}
}
}
args -> source ++ ;
pLMBCS = LMBCS ;
while ( args -> target < args -> targetLimit && bytes_written -- ) {
* ( args -> target ) ++ = * pLMBCS ++ ;
if ( args -> offsets ) {
* ( args -> offsets ) ++ = sourceIndex ;
}
}
sourceIndex ++ ;
if ( bytes_written > 0 ) {
uint8_t * pErrorBuffer = args -> converter -> charErrorBuffer ;
* err = U_BUFFER_OVERFLOW_ERROR ;
args -> converter -> charErrorBufferLength = ( int8_t ) bytes_written ;
while ( bytes_written -- ) {
* pErrorBuffer ++ = * pLMBCS ++ ;
}
}
extraInfo -> localeConverterIndex = OldConverterIndex ;
}
}
static UChar GetUniFromLMBCSUni ( char const * * ppLMBCSin ) {
uint8_t HighCh = * ( * ppLMBCSin ) ++ ;
uint8_t LowCh = * ( * ppLMBCSin ) ++ ;
if ( HighCh == ULMBCS_UNICOMPATZERO ) {
HighCh = LowCh ;
LowCh = 0 ;
}
return ( UChar ) ( ( HighCh << 8 ) | LowCh ) ;
}
# define CHECK_SOURCE_LIMIT ( index ) if ( args -> source + index > args -> sourceLimit ) {
* err = U_TRUNCATED_CHAR_FOUND ;
args -> source = args -> sourceLimit ;
return 0xffff ;
}
static UChar32 U_CALLCONV _LMBCSGetNextUCharWorker ( UConverterToUnicodeArgs * args , UErrorCode * err ) {
UChar32 uniChar = 0 ;
ulmbcs_byte_t CurByte ;
if ( args -> source >= args -> sourceLimit ) {
* err = U_ILLEGAL_ARGUMENT_ERROR ;
return 0xffff ;
}
CurByte = * ( ( ulmbcs_byte_t * ) ( args -> source ++ ) ) ;
if ( ( ( CurByte > ULMBCS_C0END ) && ( CurByte < ULMBCS_C1START ) ) || ( CurByte == 0 ) || CurByte == ULMBCS_HT || CurByte == ULMBCS_CR || CurByte == ULMBCS_LF || CurByte == ULMBCS_123SYSTEMRANGE ) {
uniChar = CurByte ;
}
else {
UConverterDataLMBCS * extraInfo ;
ulmbcs_byte_t group ;
UConverterSharedData * cnv ;
if ( CurByte == ULMBCS_GRP_CTRL ) {
ulmbcs_byte_t C0C1byte ;
CHECK_SOURCE_LIMIT ( 1 ) ;
C0C1byte = * ( args -> source ) ++ ;
uniChar = ( C0C1byte < ULMBCS_C1START ) ? C0C1byte - ULMBCS_CTRLOFFSET : C0C1byte ;
}
else if ( CurByte == ULMBCS_GRP_UNICODE ) {
CHECK_SOURCE_LIMIT ( 2 ) ;
return GetUniFromLMBCSUni ( & ( args -> source ) ) ;
}
else if ( CurByte <= ULMBCS_CTRLOFFSET ) {
group = CurByte ;
extraInfo = ( UConverterDataLMBCS * ) args -> converter -> extraInfo ;
if ( group > ULMBCS_GRP_LAST || ( cnv = extraInfo -> OptGrpConverter [ group ] ) == NULL ) {
* err = U_INVALID_CHAR_FOUND ;
}
else if ( group >= ULMBCS_DOUBLEOPTGROUP_START ) {
CHECK_SOURCE_LIMIT ( 2 ) ;
if ( * args -> source == group ) {
++ args -> source ;
uniChar = ucnv_MBCSSimpleGetNextUChar ( cnv , args -> source , 1 , FALSE ) ;
++ args -> source ;
}
else {
uniChar = ucnv_MBCSSimpleGetNextUChar ( cnv , args -> source , 2 , FALSE ) ;
args -> source += 2 ;
}
}
else {
CHECK_SOURCE_LIMIT ( 1 ) ;
CurByte = * ( args -> source ) ++ ;
if ( CurByte >= ULMBCS_C1START ) {
uniChar = _MBCS_SINGLE_SIMPLE_GET_NEXT_BMP ( cnv , CurByte ) ;
}
else {
char bytes [ 2 ] ;
extraInfo = ( UConverterDataLMBCS * ) args -> converter -> extraInfo ;
cnv = extraInfo -> OptGrpConverter [ ULMBCS_GRP_EXCEPT ] ;
bytes [ 0 ] = group ;
bytes [ 1 ] = CurByte ;
uniChar = ucnv_MBCSSimpleGetNextUChar ( cnv , bytes , 2 , FALSE ) ;
}
}
}
else if ( CurByte >= ULMBCS_C1START ) {
extraInfo = ( UConverterDataLMBCS * ) args -> converter -> extraInfo ;
group = extraInfo -> OptGroup ;
cnv = extraInfo -> OptGrpConverter [ group ] ;
if ( group >= ULMBCS_DOUBLEOPTGROUP_START ) {
if ( ! ucnv_MBCSIsLeadByte ( cnv , CurByte ) ) {
CHECK_SOURCE_LIMIT ( 0 ) ;
uniChar = ucnv_MBCSSimpleGetNextUChar ( cnv , args -> source - 1 , 1 , FALSE ) ;
}
else {
CHECK_SOURCE_LIMIT ( 1 ) ;
uniChar = ucnv_MBCSSimpleGetNextUChar ( cnv , args -> source - 1 , 2 , FALSE ) ;
++ args -> source ;
}
}
else {
uniChar = _MBCS_SINGLE_SIMPLE_GET_NEXT_BMP ( cnv , CurByte ) ;
}
}
}
return uniChar ;
}
static void U_CALLCONV _LMBCSToUnicodeWithOffsets ( UConverterToUnicodeArgs * args , UErrorCode * err ) {
char LMBCS [ ULMBCS_CHARSIZE_MAX ] ;
UChar uniChar ;
const char * saveSource ;
const char * pStartLMBCS = args -> source ;
const char * errSource = NULL ;
int8_t savebytes = 0 ;
while ( U_SUCCESS ( * err ) && args -> sourceLimit > args -> source && args -> targetLimit > args -> target ) {
saveSource = args -> source ;
if ( args -> converter -> toULength ) {
const char * saveSourceLimit ;
size_t size_old = args -> converter -> toULength ;
size_t size_new_maybe_1 = sizeof ( LMBCS ) - size_old ;
size_t size_new_maybe_2 = args -> sourceLimit - args -> source ;
size_t size_new = ( size_new_maybe_1 < size_new_maybe_2 ) ? size_new_maybe_1 : size_new_maybe_2 ;
uprv_memcpy ( LMBCS , args -> converter -> toUBytes , size_old ) ;
uprv_memcpy ( LMBCS + size_old , args -> source , size_new ) ;
saveSourceLimit = args -> sourceLimit ;
args -> source = errSource = LMBCS ;
args -> sourceLimit = LMBCS + size_old + size_new ;
savebytes = ( int8_t ) ( size_old + size_new ) ;
uniChar = ( UChar ) _LMBCSGetNextUCharWorker ( args , err ) ;
args -> source = saveSource + ( ( args -> source - LMBCS ) - size_old ) ;
args -> sourceLimit = saveSourceLimit ;
if ( * err == U_TRUNCATED_CHAR_FOUND ) {
args -> converter -> toULength = savebytes ;
uprv_memcpy ( args -> converter -> toUBytes , LMBCS , savebytes ) ;
args -> source = args -> sourceLimit ;
* err = U_ZERO_ERROR ;
return ;
}
else {
args -> converter -> toULength = 0 ;
}
}
else {
errSource = saveSource ;
uniChar = ( UChar ) _LMBCSGetNextUCharWorker ( args , err ) ;
savebytes = ( int8_t ) ( args -> source - saveSource ) ;
}
if ( U_SUCCESS ( * err ) ) {
if ( uniChar < 0xfffe ) {
* ( args -> target ) ++ = uniChar ;
if ( args -> offsets ) {
* ( args -> offsets ) ++ = ( int32_t ) ( saveSource - pStartLMBCS ) ;
}
}
else if ( uniChar == 0xfffe ) {
* err = U_INVALID_CHAR_FOUND ;
}
else {
* err = U_ILLEGAL_CHAR_FOUND ;
}
}
}
if ( U_SUCCESS ( * err ) && args -> sourceLimit > args -> source && args -> targetLimit <= args -> target ) {
* err = U_BUFFER_OVERFLOW_ERROR ;
}
else if ( U_FAILURE ( * err ) ) {
args -> converter -> toULength = savebytes ;
if ( savebytes > 0 ) {
uprv_memcpy ( args -> converter -> toUBytes , errSource , savebytes ) ;
}
if ( * err == U_TRUNCATED_CHAR_FOUND ) {
* err = U_ZERO_ERROR ;
}
}
}
DEFINE_LMBCS_OPEN ( 1 ) DEFINE_LMBCS_OPEN ( 2 ) DEFINE_LMBCS_OPEN ( 3 ) DEFINE_LMBCS_OPEN ( 4 ) DEFINE_LMBCS_OPEN ( 5 ) DEFINE_LMBCS_OPEN ( 6 ) |
-1,055,531,103,257,174,900 | debian | 8 | 0 | static void last_msg_dec_owns ( GSList * list ) {
LAST_MSG_REC * rec ;
while ( list != NULL ) {
rec = list -> data ;
if ( rec -> own ) rec -> own -- ;
list = list -> next ;
}
} |
4,489,017,523,191,997,000 | debian | 4 | 0 | static int dissect_h225_T_ipSourceRoute ( 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_h225_T_ipSourceRoute , T_ipSourceRoute_sequence ) ;
return offset ;
} |
-6,580,451,576,689,963,000 | debian | 15 | 0 | static char * wv_csp13_opaque_literal_tag ( tvbuff_t * tvb , guint32 offset , const char * token , guint8 codepage _U_ , guint32 * length ) {
guint32 data_len = tvb_get_guintvar ( tvb , offset , length ) ;
char * str = NULL ;
if ( token && ( ( strcmp ( token , "Code" ) == 0 ) || ( strcmp ( token , "ContentSize" ) == 0 ) || ( strcmp ( token , "MessageCount" ) == 0 ) || ( strcmp ( token , "Validity" ) == 0 ) || ( strcmp ( token , "KeepAliveTime" ) == 0 ) || ( strcmp ( token , "TimeToLive" ) == 0 ) || ( strcmp ( token , "AcceptedContentLength" ) == 0 ) || ( strcmp ( token , "MultiTrans" ) == 0 ) || ( strcmp ( token , "ParserSize" ) == 0 ) || ( strcmp ( token , "ServerPollMin" ) == 0 ) || ( strcmp ( token , "TCPPort" ) == 0 ) || ( strcmp ( token , "UDPPort" ) == 0 ) || ( strcmp ( token , "HistoryPeriod" ) == 0 ) || ( strcmp ( token , "MaxWatcherList" ) == 0 ) || ( strcmp ( token , "SearchFindings" ) == 0 ) || ( strcmp ( token , "SearchID" ) == 0 ) || ( strcmp ( token , "SearchIndex" ) == 0 ) || ( strcmp ( token , "SearchLimit" ) == 0 ) || ( strcmp ( token , "AcceptedPullLength" ) == 0 ) || ( strcmp ( token , "AcceptedPushLength" ) == 0 ) || ( strcmp ( token , "AcceptedRichContentLength" ) == 0 ) || ( strcmp ( token , "AcceptedTextContentLength" ) == 0 ) || ( strcmp ( token , "SessionPriority" ) == 0 ) || ( strcmp ( token , "UserSessionLimit" ) == 0 ) || ( strcmp ( token , "MultiTransPerMessage" ) == 0 ) || ( strcmp ( token , "ContentPolicyLimit" ) == 0 ) || ( strcmp ( token , "AnswerOptionID" ) == 0 ) || ( strcmp ( token , "SegmentCount" ) == 0 ) || ( strcmp ( token , "SegmentReference" ) == 0 ) || ( strcmp ( token , "TryAgainTimeout" ) == 0 ) || ( strcmp ( token , "GroupContentLimit" ) == 0 ) || ( strcmp ( token , "MessageTotalCount" ) == 0 ) || ( strcmp ( token , "PairID" ) == 0 ) ) ) {
str = wv_integer_from_opaque ( tvb , offset + * length , data_len ) ;
}
else if ( token && ( ( strcmp ( token , "DateTime" ) == 0 ) || ( strcmp ( token , "DeliveryTime" ) == 0 ) ) ) {
str = wv_datetime_from_opaque ( tvb , offset + * length , data_len ) ;
}
if ( str == NULL ) {
str = wmem_strdup_printf ( wmem_packet_scope ( ) , "(%d bytes of unparsed opaque data)" , data_len ) ;
}
* length += data_len ;
return str ;
} |
5,524,055,408,114,021,000 | debian | 13 | 0 | int ssl3_do_write ( SSL * s , int type ) {
int ret ;
ret = ssl3_write_bytes ( s , type , & s -> init_buf -> data [ s -> init_off ] , s -> init_num ) ;
if ( ret < 0 ) return ( - 1 ) ;
if ( type == SSL3_RT_HANDSHAKE ) ssl3_finish_mac ( s , ( unsigned char * ) & s -> init_buf -> data [ s -> init_off ] , ret ) ;
if ( ret == s -> init_num ) {
if ( s -> msg_callback ) s -> msg_callback ( 1 , s -> version , type , s -> init_buf -> data , ( size_t ) ( s -> init_off + s -> init_num ) , s , s -> msg_callback_arg ) ;
return ( 1 ) ;
}
s -> init_off += ret ;
s -> init_num -= ret ;
return ( 0 ) ;
} |
-1,929,262,071,302,712,000 | debian | 5 | 0 | static cmsTagTypeSignature DecideXYZtype ( cmsFloat64Number ICCVersion , const void * Data ) {
return cmsSigXYZType ;
cmsUNUSED_PARAMETER ( ICCVersion ) ;
cmsUNUSED_PARAMETER ( Data ) ;
} |
-2,423,144,171,479,607,000 | debian | 5 | 0 | static void pdf_run_SC_color ( fz_context * ctx , pdf_processor * proc , int n , float * color ) {
pdf_run_processor * pr = ( pdf_run_processor * ) proc ;
pr -> dev -> flags &= ~ FZ_DEVFLAG_STROKECOLOR_UNDEFINED ;
pdf_set_color ( ctx , pr , PDF_STROKE , color ) ;
} |
8,849,962,823,026,424,000 | debian | 17 | 0 | static void qio_channel_websock_set_watch ( QIOChannelWebsock * ioc ) {
GIOCondition cond = 0 ;
qio_channel_websock_unset_watch ( ioc ) ;
if ( ioc -> io_err ) {
return ;
}
if ( ioc -> encoutput . offset || ioc -> ping_reply . offset ) {
cond |= G_IO_OUT ;
}
if ( ioc -> encinput . offset < QIO_CHANNEL_WEBSOCK_MAX_BUFFER && ! ioc -> io_eof ) {
cond |= G_IO_IN ;
}
if ( cond ) {
object_ref ( OBJECT ( ioc ) ) ;
ioc -> io_tag = qio_channel_add_watch ( ioc -> master , cond , qio_channel_websock_flush , ioc , qio_channel_websock_flush_free ) ;
}
} |
5,347,874,611,477,979,000 | chrome | 8 | 0 | static void test_evbuffer ( void ) {
struct evbuffer * evb = evbuffer_new ( ) ;
setup_test ( "Testing Evbuffer: " ) ;
evbuffer_add_printf ( evb , "%s/%d" , "hello" , 1 ) ;
if ( EVBUFFER_LENGTH ( evb ) == 7 && strcmp ( ( char * ) EVBUFFER_DATA ( evb ) , "hello/1" ) == 0 ) test_ok = 1 ;
evbuffer_free ( evb ) ;
cleanup_test ( ) ;
} |
8,218,188,955,508,624,000 | debian | 98 | 0 | static int read_restart_header ( MLPDecodeContext * m , GetBitContext * gbp , const uint8_t * buf , unsigned int substr ) {
SubStream * s = & m -> substream [ substr ] ;
unsigned int ch ;
int sync_word , tmp ;
uint8_t checksum ;
uint8_t lossless_check ;
int start_count = get_bits_count ( gbp ) ;
const int max_matrix_channel = m -> avctx -> codec_id == AV_CODEC_ID_MLP ? MAX_MATRIX_CHANNEL_MLP : MAX_MATRIX_CHANNEL_TRUEHD ;
sync_word = get_bits ( gbp , 13 ) ;
if ( sync_word != 0x31ea >> 1 ) {
av_log ( m -> avctx , AV_LOG_ERROR , "restart header sync incorrect (got 0x%04x)\n" , sync_word ) ;
return AVERROR_INVALIDDATA ;
}
s -> noise_type = get_bits1 ( gbp ) ;
if ( m -> avctx -> codec_id == AV_CODEC_ID_MLP && s -> noise_type ) {
av_log ( m -> avctx , AV_LOG_ERROR , "MLP must have 0x31ea sync word.\n" ) ;
return AVERROR_INVALIDDATA ;
}
skip_bits ( gbp , 16 ) ;
s -> min_channel = get_bits ( gbp , 4 ) ;
s -> max_channel = get_bits ( gbp , 4 ) ;
s -> max_matrix_channel = get_bits ( gbp , 4 ) ;
if ( s -> max_matrix_channel > max_matrix_channel ) {
av_log ( m -> avctx , AV_LOG_ERROR , "Max matrix channel cannot be greater than %d.\n" , max_matrix_channel ) ;
return AVERROR_INVALIDDATA ;
}
if ( s -> max_channel != s -> max_matrix_channel ) {
av_log ( m -> avctx , AV_LOG_ERROR , "Max channel must be equal max matrix channel.\n" ) ;
return AVERROR_INVALIDDATA ;
}
if ( s -> max_channel > MAX_MATRIX_CHANNEL_MLP && ! s -> noise_type ) {
av_log_ask_for_sample ( m -> avctx , "Number of channels %d is larger than the maximum supported " "by the decoder.\n" , s -> max_channel + 2 ) ;
return AVERROR_PATCHWELCOME ;
}
if ( s -> min_channel > s -> max_channel ) {
av_log ( m -> avctx , AV_LOG_ERROR , "Substream min channel cannot be greater than max channel.\n" ) ;
return AVERROR_INVALIDDATA ;
}
# if FF_API_REQUEST_CHANNELS if ( m -> avctx -> request_channels > 0 && m -> avctx -> request_channels <= s -> max_channel + 1 && m -> max_decoded_substream > substr ) {
av_log ( m -> avctx , AV_LOG_DEBUG , "Extracting %d-channel downmix from substream %d. " "Further substreams will be skipped.\n" , s -> max_channel + 1 , substr ) ;
m -> max_decoded_substream = substr ;
}
else # endif if ( m -> avctx -> request_channel_layout == s -> ch_layout && m -> max_decoded_substream > substr ) {
av_log ( m -> avctx , AV_LOG_DEBUG , "Extracting %d-channel downmix (0x%" PRIx64 ") from substream %d. " "Further substreams will be skipped.\n" , s -> max_channel + 1 , s -> ch_layout , substr ) ;
m -> max_decoded_substream = substr ;
}
s -> noise_shift = get_bits ( gbp , 4 ) ;
s -> noisegen_seed = get_bits ( gbp , 23 ) ;
skip_bits ( gbp , 19 ) ;
s -> data_check_present = get_bits1 ( gbp ) ;
lossless_check = get_bits ( gbp , 8 ) ;
if ( substr == m -> max_decoded_substream && s -> lossless_check_data != 0xffffffff ) {
tmp = xor_32_to_8 ( s -> lossless_check_data ) ;
if ( tmp != lossless_check ) av_log ( m -> avctx , AV_LOG_WARNING , "Lossless check failed - expected %02x, calculated %02x.\n" , lossless_check , tmp ) ;
}
skip_bits ( gbp , 16 ) ;
memset ( s -> ch_assign , 0 , sizeof ( s -> ch_assign ) ) ;
for ( ch = 0 ;
ch <= s -> max_matrix_channel ;
ch ++ ) {
int ch_assign = get_bits ( gbp , 6 ) ;
if ( m -> avctx -> codec_id == AV_CODEC_ID_TRUEHD ) {
uint64_t channel = thd_channel_layout_extract_channel ( s -> ch_layout , ch_assign ) ;
ch_assign = av_get_channel_layout_channel_index ( s -> ch_layout , channel ) ;
}
if ( ch_assign > s -> max_matrix_channel ) {
av_log_ask_for_sample ( m -> avctx , "Assignment of matrix channel %d to invalid output channel %d.\n" , ch , ch_assign ) ;
return AVERROR_PATCHWELCOME ;
}
s -> ch_assign [ ch_assign ] = ch ;
}
checksum = ff_mlp_restart_checksum ( buf , get_bits_count ( gbp ) - start_count ) ;
if ( checksum != get_bits ( gbp , 8 ) ) av_log ( m -> avctx , AV_LOG_ERROR , "restart header checksum error\n" ) ;
s -> param_presence_flags = 0xff ;
s -> num_primitive_matrices = 0 ;
s -> blocksize = 8 ;
s -> lossless_check_data = 0 ;
memset ( s -> output_shift , 0 , sizeof ( s -> output_shift ) ) ;
memset ( s -> quant_step_size , 0 , sizeof ( s -> quant_step_size ) ) ;
for ( ch = s -> min_channel ;
ch <= s -> max_channel ;
ch ++ ) {
ChannelParams * cp = & s -> channel_params [ ch ] ;
cp -> filter_params [ FIR ] . order = 0 ;
cp -> filter_params [ IIR ] . order = 0 ;
cp -> filter_params [ FIR ] . shift = 0 ;
cp -> filter_params [ IIR ] . shift = 0 ;
cp -> huff_offset = 0 ;
cp -> sign_huff_offset = ( - 1 ) << 23 ;
cp -> codebook = 0 ;
cp -> huff_lsbs = 24 ;
}
if ( substr == m -> max_decoded_substream ) {
m -> avctx -> channels = s -> max_matrix_channel + 1 ;
m -> avctx -> channel_layout = s -> ch_layout ;
}
return 0 ;
} |
2,687,336,064,028,423,000 | chrome | 3 | 0 | void evdns_search_clear ( void ) {
search_postfix_clear ( ) ;
} |
-650,231,346,353,974,300 | debian | 23 | 1 | void appendConnStrVal ( PQExpBuffer buf , const char * str ) {
const char * s ;
bool needquotes ;
needquotes = false ;
for ( s = str ;
* s ;
s ++ ) {
if ( ! ( ( * s >= 'a' && * s <= 'z' ) || ( * s >= 'A' && * s <= 'Z' ) || ( * s >= '0' && * s <= '9' ) || * s == '_' || * s == '.' ) ) {
needquotes = true ;
break ;
}
}
if ( needquotes ) {
appendPQExpBufferChar ( buf , '\'' ) ;
while ( * str ) {
if ( * str == '\'' || * str == '\\' ) appendPQExpBufferChar ( buf , '\\' ) ;
appendPQExpBufferChar ( buf , * str ) ;
str ++ ;
}
appendPQExpBufferChar ( buf , '\'' ) ;
}
else appendPQExpBufferStr ( buf , str ) ;
} |
1,676,654,288,894,940,700 | debian | 9 | 0 | static void kadmin_modprinc_usage ( ) {
fprintf ( stderr , _ ( "usage: modify_principal [options] principal\n" ) ) ;
fprintf ( stderr , _ ( "\toptions are:\n" ) ) ;
fprintf ( stderr , _ ( "\t\t[-x db_princ_args]* [-expire expdate] " "[-pwexpire pwexpdate] [-maxlife maxtixlife]\n" "\t\t[-kvno kvno] [-policy policy] [-clearpolicy]\n" "\t\t[-maxrenewlife maxrenewlife] [-unlock] " "[{
+|-}
attribute]\n" ) ) ;
fprintf ( stderr , "\tattributes are:\n" ) ;
fprintf ( stderr , _ ( "\t\tallow_postdated allow_forwardable allow_tgs_req " "allow_renewable\n" "\t\tallow_proxiable allow_dup_skey allow_tix " "requires_preauth\n" "\t\trequires_hwauth needchange allow_svr " "password_changing_service\n" "\t\tok_as_delegate ok_to_auth_as_delegate " "no_auth_data_required\n" "\nwhere,\n\t[-x db_princ_args]* - any number of database " "specific arguments.\n" "\t\t\tLook at each database documentation for supported " "arguments\n" ) ) ;
} |
2,388,171,415,474,876,000 | debian | 12 | 0 | static void dissect_rsvp_time_values ( proto_item * ti , proto_tree * rsvp_object_tree , tvbuff_t * tvb , int offset , int obj_length , int rsvp_class _U_ , int type ) {
int offset2 = offset + 4 ;
switch ( type ) {
case 1 : proto_tree_add_uint ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , type ) ;
proto_tree_add_uint_format_value ( rsvp_object_tree , hf_rsvp_refresh_interval , tvb , offset2 , 4 , tvb_get_ntohl ( tvb , offset2 ) , "%u ms (%u seconds)" , tvb_get_ntohl ( tvb , offset2 ) , tvb_get_ntohl ( tvb , offset2 ) / 1000 ) ;
proto_item_set_text ( ti , "TIME VALUES: %d ms" , tvb_get_ntohl ( tvb , offset2 ) ) ;
break ;
default : proto_tree_add_uint_format_value ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , type , "Unknown (%u)" , type ) ;
proto_tree_add_item ( rsvp_object_tree , hf_rsvp_time_values_data , tvb , offset2 , obj_length - 4 , ENC_NA ) ;
break ;
}
} |
-1,672,864,273,235,910,400 | debian | 9 | 0 | static void _kill_job_on_msg_fail ( uint32_t job_id ) {
slurmctld_lock_t job_write_lock = {
NO_LOCK , WRITE_LOCK , WRITE_LOCK , NO_LOCK , READ_LOCK }
;
error ( "Job allocate response msg send failure, killing JobId=%u" , job_id ) ;
lock_slurmctld ( job_write_lock ) ;
job_complete ( job_id , slurmctld_conf . slurm_user_id , false , false , SIGTERM ) ;
unlock_slurmctld ( job_write_lock ) ;
} |
927,123,821,003,322,000 | chrome | 13 | 0 | IN_PROC_BROWSER_TEST_F ( PageLoadMetricsBrowserTest , NoPaintForEmptyDocument ) {
ASSERT_TRUE ( embedded_test_server ( ) -> Start ( ) ) ;
auto waiter = CreatePageLoadMetricsWaiter ( ) ;
waiter -> AddPageExpectation ( TimingField : : FIRST_LAYOUT ) ;
waiter -> AddPageExpectation ( TimingField : : LOAD_EVENT ) ;
ui_test_utils : : NavigateToURL ( browser ( ) , embedded_test_server ( ) -> GetURL ( "/empty.html" ) ) ;
waiter -> Wait ( ) ;
EXPECT_FALSE ( waiter -> DidObserveInPage ( TimingField : : FIRST_PAINT ) ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramFirstLayout , 1 ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramLoad , 1 ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramFirstPaint , 0 ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramFirstContentfulPaint , 0 ) ;
} |
2,578,089,348,587,614,000 | debian | 3 | 0 | RSA * d2i_RSA_PUBKEY_bio ( BIO * bp , RSA * * rsa ) {
return ASN1_d2i_bio_of ( RSA , RSA_new , d2i_RSA_PUBKEY , bp , rsa ) ;
} |
8,572,106,347,813,672,000 | debian | 106 | 0 | static int pfkey_xfrm_policy2msg ( struct sk_buff * skb , const struct xfrm_policy * xp , int dir ) {
struct sadb_msg * hdr ;
struct sadb_address * addr ;
struct sadb_lifetime * lifetime ;
struct sadb_x_policy * pol ;
struct sadb_x_sec_ctx * sec_ctx ;
struct xfrm_sec_ctx * xfrm_ctx ;
int i ;
int size ;
int sockaddr_size = pfkey_sockaddr_size ( xp -> family ) ;
int socklen = pfkey_sockaddr_len ( xp -> family ) ;
size = pfkey_xfrm_policy2msg_size ( xp ) ;
hdr = ( struct sadb_msg * ) skb_put ( skb , sizeof ( struct sadb_msg ) ) ;
memset ( hdr , 0 , size ) ;
addr = ( struct sadb_address * ) skb_put ( skb , sizeof ( struct sadb_address ) + sockaddr_size ) ;
addr -> sadb_address_len = ( sizeof ( struct sadb_address ) + sockaddr_size ) / sizeof ( uint64_t ) ;
addr -> sadb_address_exttype = SADB_EXT_ADDRESS_SRC ;
addr -> sadb_address_proto = pfkey_proto_from_xfrm ( xp -> selector . proto ) ;
addr -> sadb_address_prefixlen = xp -> selector . prefixlen_s ;
addr -> sadb_address_reserved = 0 ;
if ( ! pfkey_sockaddr_fill ( & xp -> selector . saddr , xp -> selector . sport , ( struct sockaddr * ) ( addr + 1 ) , xp -> family ) ) BUG ( ) ;
addr = ( struct sadb_address * ) skb_put ( skb , sizeof ( struct sadb_address ) + sockaddr_size ) ;
addr -> sadb_address_len = ( sizeof ( struct sadb_address ) + sockaddr_size ) / sizeof ( uint64_t ) ;
addr -> sadb_address_exttype = SADB_EXT_ADDRESS_DST ;
addr -> sadb_address_proto = pfkey_proto_from_xfrm ( xp -> selector . proto ) ;
addr -> sadb_address_prefixlen = xp -> selector . prefixlen_d ;
addr -> sadb_address_reserved = 0 ;
pfkey_sockaddr_fill ( & xp -> selector . daddr , xp -> selector . dport , ( struct sockaddr * ) ( addr + 1 ) , xp -> family ) ;
lifetime = ( struct sadb_lifetime * ) skb_put ( skb , sizeof ( struct sadb_lifetime ) ) ;
lifetime -> sadb_lifetime_len = sizeof ( struct sadb_lifetime ) / sizeof ( uint64_t ) ;
lifetime -> sadb_lifetime_exttype = SADB_EXT_LIFETIME_HARD ;
lifetime -> sadb_lifetime_allocations = _X2KEY ( xp -> lft . hard_packet_limit ) ;
lifetime -> sadb_lifetime_bytes = _X2KEY ( xp -> lft . hard_byte_limit ) ;
lifetime -> sadb_lifetime_addtime = xp -> lft . hard_add_expires_seconds ;
lifetime -> sadb_lifetime_usetime = xp -> lft . hard_use_expires_seconds ;
lifetime = ( struct sadb_lifetime * ) skb_put ( skb , sizeof ( struct sadb_lifetime ) ) ;
lifetime -> sadb_lifetime_len = sizeof ( struct sadb_lifetime ) / sizeof ( uint64_t ) ;
lifetime -> sadb_lifetime_exttype = SADB_EXT_LIFETIME_SOFT ;
lifetime -> sadb_lifetime_allocations = _X2KEY ( xp -> lft . soft_packet_limit ) ;
lifetime -> sadb_lifetime_bytes = _X2KEY ( xp -> lft . soft_byte_limit ) ;
lifetime -> sadb_lifetime_addtime = xp -> lft . soft_add_expires_seconds ;
lifetime -> sadb_lifetime_usetime = xp -> lft . soft_use_expires_seconds ;
lifetime = ( struct sadb_lifetime * ) skb_put ( skb , sizeof ( struct sadb_lifetime ) ) ;
lifetime -> sadb_lifetime_len = sizeof ( struct sadb_lifetime ) / sizeof ( uint64_t ) ;
lifetime -> sadb_lifetime_exttype = SADB_EXT_LIFETIME_CURRENT ;
lifetime -> sadb_lifetime_allocations = xp -> curlft . packets ;
lifetime -> sadb_lifetime_bytes = xp -> curlft . bytes ;
lifetime -> sadb_lifetime_addtime = xp -> curlft . add_time ;
lifetime -> sadb_lifetime_usetime = xp -> curlft . use_time ;
pol = ( struct sadb_x_policy * ) skb_put ( skb , sizeof ( struct sadb_x_policy ) ) ;
pol -> sadb_x_policy_len = sizeof ( struct sadb_x_policy ) / sizeof ( uint64_t ) ;
pol -> sadb_x_policy_exttype = SADB_X_EXT_POLICY ;
pol -> sadb_x_policy_type = IPSEC_POLICY_DISCARD ;
if ( xp -> action == XFRM_POLICY_ALLOW ) {
if ( xp -> xfrm_nr ) pol -> sadb_x_policy_type = IPSEC_POLICY_IPSEC ;
else pol -> sadb_x_policy_type = IPSEC_POLICY_NONE ;
}
pol -> sadb_x_policy_dir = dir + 1 ;
pol -> sadb_x_policy_id = xp -> index ;
pol -> sadb_x_policy_priority = xp -> priority ;
for ( i = 0 ;
i < xp -> xfrm_nr ;
i ++ ) {
const struct xfrm_tmpl * t = xp -> xfrm_vec + i ;
struct sadb_x_ipsecrequest * rq ;
int req_size ;
int mode ;
req_size = sizeof ( struct sadb_x_ipsecrequest ) ;
if ( t -> mode == XFRM_MODE_TUNNEL ) {
socklen = pfkey_sockaddr_len ( t -> encap_family ) ;
req_size += socklen * 2 ;
}
else {
size -= 2 * socklen ;
}
rq = ( void * ) skb_put ( skb , req_size ) ;
pol -> sadb_x_policy_len += req_size / 8 ;
memset ( rq , 0 , sizeof ( * rq ) ) ;
rq -> sadb_x_ipsecrequest_len = req_size ;
rq -> sadb_x_ipsecrequest_proto = t -> id . proto ;
if ( ( mode = pfkey_mode_from_xfrm ( t -> mode ) ) < 0 ) return - EINVAL ;
rq -> sadb_x_ipsecrequest_mode = mode ;
rq -> sadb_x_ipsecrequest_level = IPSEC_LEVEL_REQUIRE ;
if ( t -> reqid ) rq -> sadb_x_ipsecrequest_level = IPSEC_LEVEL_UNIQUE ;
if ( t -> optional ) rq -> sadb_x_ipsecrequest_level = IPSEC_LEVEL_USE ;
rq -> sadb_x_ipsecrequest_reqid = t -> reqid ;
if ( t -> mode == XFRM_MODE_TUNNEL ) {
u8 * sa = ( void * ) ( rq + 1 ) ;
pfkey_sockaddr_fill ( & t -> saddr , 0 , ( struct sockaddr * ) sa , t -> encap_family ) ;
pfkey_sockaddr_fill ( & t -> id . daddr , 0 , ( struct sockaddr * ) ( sa + socklen ) , t -> encap_family ) ;
}
}
if ( ( xfrm_ctx = xp -> security ) ) {
int ctx_size = pfkey_xfrm_policy2sec_ctx_size ( xp ) ;
sec_ctx = ( struct sadb_x_sec_ctx * ) skb_put ( skb , ctx_size ) ;
sec_ctx -> sadb_x_sec_len = ctx_size / sizeof ( uint64_t ) ;
sec_ctx -> sadb_x_sec_exttype = SADB_X_EXT_SEC_CTX ;
sec_ctx -> sadb_x_ctx_doi = xfrm_ctx -> ctx_doi ;
sec_ctx -> sadb_x_ctx_alg = xfrm_ctx -> ctx_alg ;
sec_ctx -> sadb_x_ctx_len = xfrm_ctx -> ctx_len ;
memcpy ( sec_ctx + 1 , xfrm_ctx -> ctx_str , xfrm_ctx -> ctx_len ) ;
}
hdr -> sadb_msg_len = size / sizeof ( uint64_t ) ;
hdr -> sadb_msg_reserved = atomic_read ( & xp -> refcnt ) ;
return 0 ;
} |
2,578,089,348,587,614,000 | debian | 4 | 0 | int X509_CRL_sign_ctx ( X509_CRL * x , EVP_MD_CTX * ctx ) {
x -> crl -> enc . modified = 1 ;
return ASN1_item_sign_ctx ( ASN1_ITEM_rptr ( X509_CRL_INFO ) , x -> crl -> sig_alg , x -> sig_alg , x -> signature , x -> crl , ctx ) ;
} |
-1,672,864,273,235,910,400 | debian | 14 | 0 | static int _process_persist_conn ( void * arg , persist_msg_t * persist_msg , Buf * out_buffer , uint32_t * uid ) {
slurm_msg_t msg ;
slurm_persist_conn_t * persist_conn = arg ;
if ( * uid == NO_VAL ) * uid = g_slurm_auth_get_uid ( persist_conn -> auth_cred , slurmctld_config . auth_info ) ;
* out_buffer = NULL ;
slurm_msg_t_init ( & msg ) ;
msg . auth_cred = persist_conn -> auth_cred ;
msg . conn = persist_conn ;
msg . conn_fd = persist_conn -> fd ;
msg . msg_type = persist_msg -> msg_type ;
msg . data = persist_msg -> data ;
slurmctld_req ( & msg , NULL ) ;
return SLURM_SUCCESS ;
} |
6,393,050,609,822,898,000 | debian | 24 | 0 | static TRBCCode xhci_stop_ep ( XHCIState * xhci , unsigned int slotid , unsigned int epid ) {
XHCISlot * slot ;
XHCIEPContext * epctx ;
trace_usb_xhci_ep_stop ( slotid , epid ) ;
assert ( slotid >= 1 && slotid <= xhci -> numslots ) ;
if ( epid < 1 || epid > 31 ) {
DPRINTF ( "xhci: bad ep %d\n" , epid ) ;
return CC_TRB_ERROR ;
}
slot = & xhci -> slots [ slotid - 1 ] ;
if ( ! slot -> eps [ epid - 1 ] ) {
DPRINTF ( "xhci: slot %d ep %d not enabled\n" , slotid , epid ) ;
return CC_EP_NOT_ENABLED_ERROR ;
}
if ( xhci_ep_nuke_xfers ( xhci , slotid , epid , CC_STOPPED ) > 0 ) {
DPRINTF ( "xhci: FIXME: endpoint stopped w/ xfers running, " "data might be lost\n" ) ;
}
epctx = slot -> eps [ epid - 1 ] ;
xhci_set_ep_state ( xhci , epctx , NULL , EP_STOPPED ) ;
if ( epctx -> nr_pstreams ) {
xhci_reset_streams ( epctx ) ;
}
return CC_SUCCESS ;
} |
-5,260,094,338,219,890,000 | debian | 14 | 0 | static void stroke_purge ( private_stroke_socket_t * this , stroke_msg_t * msg , FILE * out ) {
if ( msg -> purge . flags & PURGE_OCSP ) {
lib -> credmgr -> flush_cache ( lib -> credmgr , CERT_X509_OCSP_RESPONSE ) ;
}
if ( msg -> purge . flags & PURGE_CRLS ) {
lib -> credmgr -> flush_cache ( lib -> credmgr , CERT_X509_CRL ) ;
}
if ( msg -> purge . flags & PURGE_CERTS ) {
lib -> credmgr -> flush_cache ( lib -> credmgr , CERT_X509 ) ;
}
if ( msg -> purge . flags & PURGE_IKE ) {
this -> control -> purge_ike ( this -> control , msg , out ) ;
}
} |
-1,315,695,702,746,584,300 | debian | 8 | 0 | proto_item * proto_item_get_parent_nth ( proto_item * ti , int gen ) {
if ( ! ti ) return NULL ;
while ( gen -- ) {
ti = ti -> parent ;
if ( ! ti ) return NULL ;
}
return ti ;
} |
-1,514,879,141,119,470,800 | chrome | 3 | 0 | void min_heap_dtor ( min_heap_t * s ) {
if ( s -> p ) free ( s -> p ) ;
} |
-1,315,695,702,746,584,300 | debian | 4 | 0 | proto_item * proto_tree_get_parent ( proto_tree * tree ) {
if ( ! tree ) return NULL ;
return ( proto_item * ) tree ;
} |
6,458,694,302,493,204,000 | debian | 29 | 0 | static Datum ExecEvalArrayCoerceExpr ( ArrayCoerceExprState * astate , ExprContext * econtext , bool * isNull , ExprDoneCond * isDone ) {
ArrayCoerceExpr * acoerce = ( ArrayCoerceExpr * ) astate -> xprstate . expr ;
Datum result ;
FunctionCallInfoData locfcinfo ;
result = ExecEvalExpr ( astate -> arg , econtext , isNull , isDone ) ;
if ( isDone && * isDone == ExprEndResult ) return result ;
if ( * isNull ) return result ;
if ( ! OidIsValid ( acoerce -> elemfuncid ) ) {
ArrayType * array = DatumGetArrayTypePCopy ( result ) ;
ARR_ELEMTYPE ( array ) = astate -> resultelemtype ;
PG_RETURN_ARRAYTYPE_P ( array ) ;
}
if ( astate -> elemfunc . fn_oid == InvalidOid ) {
AclResult aclresult ;
aclresult = pg_proc_aclcheck ( acoerce -> elemfuncid , GetUserId ( ) , ACL_EXECUTE ) ;
if ( aclresult != ACLCHECK_OK ) aclcheck_error ( aclresult , ACL_KIND_PROC , get_func_name ( acoerce -> elemfuncid ) ) ;
InvokeFunctionExecuteHook ( acoerce -> elemfuncid ) ;
fmgr_info_cxt ( acoerce -> elemfuncid , & ( astate -> elemfunc ) , econtext -> ecxt_per_query_memory ) ;
fmgr_info_set_expr ( ( Node * ) acoerce , & ( astate -> elemfunc ) ) ;
}
InitFunctionCallInfoData ( locfcinfo , & ( astate -> elemfunc ) , 3 , InvalidOid , NULL , NULL ) ;
locfcinfo . arg [ 0 ] = result ;
locfcinfo . arg [ 1 ] = Int32GetDatum ( acoerce -> resulttypmod ) ;
locfcinfo . arg [ 2 ] = BoolGetDatum ( acoerce -> isExplicit ) ;
locfcinfo . argnull [ 0 ] = false ;
locfcinfo . argnull [ 1 ] = false ;
locfcinfo . argnull [ 2 ] = false ;
return array_map ( & locfcinfo , astate -> resultelemtype , astate -> amstate ) ;
} |
7,783,404,437,431,407,000 | debian | 3 | 0 | static handler * myisam_create_handler ( handlerton * hton , TABLE_SHARE * table , MEM_ROOT * mem_root ) {
return new ( mem_root ) ha_myisam ( hton , table ) ;
} |
-3,740,862,514,502,467,000 | debian | 135 | 0 | static FILE * NeedsUCS2Table ( SplineFont * sf , int * ucs2len , EncMap * map , int issymbol ) {
uint32 * avail = malloc ( 65536 * sizeof ( uint32 ) ) ;
int i , j , l ;
int segcnt , cnt = 0 , delta , rpos ;
struct cmapseg {
uint16 start , end ;
uint16 delta ;
uint16 rangeoff ;
}
* cmapseg ;
uint16 * ranges ;
SplineChar * sc ;
FILE * format4 = tmpfile ( ) ;
memset ( avail , 0xff , 65536 * sizeof ( uint32 ) ) ;
if ( map -> enc -> is_unicodebmp || map -> enc -> is_unicodefull ) {
int gid ;
for ( i = 0 ;
i < 65536 && i < map -> enccount ;
++ i ) if ( ( gid = map -> map [ i ] ) != - 1 && sf -> glyphs [ gid ] != NULL && sf -> glyphs [ gid ] -> ttf_glyph != - 1 ) {
avail [ i ] = gid ;
++ cnt ;
}
}
else {
struct altuni * altuni ;
for ( i = 0 ;
i < sf -> glyphcnt ;
++ i ) {
if ( ( sc = sf -> glyphs [ i ] ) != NULL && sc -> ttf_glyph != - 1 ) {
if ( sc -> unicodeenc >= 0 && sc -> unicodeenc <= 0xffff ) {
avail [ sc -> unicodeenc ] = i ;
++ cnt ;
}
for ( altuni = sc -> altuni ;
altuni != NULL ;
altuni = altuni -> next ) {
if ( altuni -> unienc <= 0xffff && altuni -> vs == - 1 && altuni -> fid == 0 ) {
avail [ altuni -> unienc ] = i ;
++ cnt ;
}
}
}
}
}
if ( issymbol ) {
memset ( avail , 0xff , 0xf020 * sizeof ( uint32 ) ) ;
memset ( avail + 0xf100 , 0xff , 0x0eff * sizeof ( uint32 ) ) ;
}
j = - 1 ;
for ( i = segcnt = 0 ;
i < 65536 ;
++ i ) {
if ( avail [ i ] != 0xffffffff && j == - 1 ) {
j = i ;
++ segcnt ;
}
else if ( j != - 1 && avail [ i ] == 0xffffffff ) j = - 1 ;
}
cmapseg = calloc ( segcnt + 1 , sizeof ( struct cmapseg ) ) ;
ranges = malloc ( cnt * sizeof ( int16 ) ) ;
j = - 1 ;
for ( i = segcnt = 0 ;
i < 65536 ;
++ i ) {
if ( avail [ i ] != 0xffffffff && j == - 1 ) {
j = i ;
cmapseg [ segcnt ] . start = j ;
++ segcnt ;
}
else if ( j != - 1 && avail [ i ] == 0xffffffff ) {
cmapseg [ segcnt - 1 ] . end = i - 1 ;
j = - 1 ;
}
}
if ( j != - 1 ) cmapseg [ segcnt - 1 ] . end = i - 1 ;
cmapseg [ segcnt ] . start = cmapseg [ segcnt ] . end = 0xffff ;
cmapseg [ segcnt ++ ] . delta = 1 ;
rpos = 0 ;
for ( i = 0 ;
i < segcnt - 1 ;
++ i ) {
l = avail [ cmapseg [ i ] . start ] ;
sc = sf -> glyphs [ l ] ;
delta = sc -> ttf_glyph - cmapseg [ i ] . start ;
for ( j = cmapseg [ i ] . start ;
j <= cmapseg [ i ] . end ;
++ j ) {
l = avail [ j ] ;
sc = sf -> glyphs [ l ] ;
if ( delta != sc -> ttf_glyph - j ) break ;
}
if ( j > cmapseg [ i ] . end ) cmapseg [ i ] . delta = delta ;
else {
cmapseg [ i ] . rangeoff = ( rpos + ( segcnt - i ) ) * sizeof ( int16 ) ;
for ( j = cmapseg [ i ] . start ;
j <= cmapseg [ i ] . end ;
++ j ) {
l = avail [ j ] ;
sc = sf -> glyphs [ l ] ;
ranges [ rpos ++ ] = sc -> ttf_glyph ;
}
}
}
free ( avail ) ;
putshort ( format4 , 4 ) ;
putshort ( format4 , ( 8 + 4 * segcnt + rpos ) * sizeof ( int16 ) ) ;
putshort ( format4 , 0 ) ;
putshort ( format4 , 2 * segcnt ) ;
for ( j = 0 , i = 1 ;
i <= segcnt ;
i <<= 1 , ++ j ) ;
putshort ( format4 , i ) ;
putshort ( format4 , j - 1 ) ;
putshort ( format4 , 2 * segcnt - i ) ;
for ( i = 0 ;
i < segcnt ;
++ i ) putshort ( format4 , cmapseg [ i ] . end ) ;
putshort ( format4 , 0 ) ;
for ( i = 0 ;
i < segcnt ;
++ i ) putshort ( format4 , cmapseg [ i ] . start ) ;
for ( i = 0 ;
i < segcnt ;
++ i ) putshort ( format4 , cmapseg [ i ] . delta ) ;
for ( i = 0 ;
i < segcnt ;
++ i ) putshort ( format4 , cmapseg [ i ] . rangeoff ) ;
for ( i = 0 ;
i < rpos ;
++ i ) putshort ( format4 , ranges [ i ] ) ;
free ( ranges ) ;
free ( cmapseg ) ;
* ucs2len = ftell ( format4 ) ;
return ( format4 ) ;
} |
-3,819,889,754,140,204,000 | debian | 3 | 0 | METHOD ( certificate_t , get_issuer , identification_t * , private_x509_cert_t * this ) {
return this -> issuer ;
} |
4,511,225,370,772,574,700 | debian | 17 | 0 | PHP_FUNCTION ( uwsgi_cache_set ) {
char * key = NULL ;
int keylen ;
char * value = NULL ;
int vallen ;
uint64_t expires = 0 ;
char * cache = NULL ;
int cachelen = 0 ;
if ( ! uwsgi . caches ) RETURN_NULL ( ) ;
if ( zend_parse_parameters ( ZEND_NUM_ARGS ( ) TSRMLS_CC , "ss|ls" , & key , & keylen , & value , & vallen , & expires , & cache , & cachelen ) == FAILURE ) {
RETURN_NULL ( ) ;
}
if ( ! uwsgi_cache_magic_set ( key , keylen , value , vallen , expires , 0 , cache ) ) {
RETURN_TRUE ;
}
RETURN_NULL ( ) ;
} |
-2,222,463,888,415,250,000 | chrome | 31 | 0 | static void scale_and_extend_frame_nonnormative ( const YV12_BUFFER_CONFIG * src , YV12_BUFFER_CONFIG * dst ) {
int i ;
const uint8_t * const srcs [ 3 ] = {
src -> y_buffer , src -> u_buffer , src -> v_buffer }
;
const int src_strides [ 3 ] = {
src -> y_stride , src -> uv_stride , src -> uv_stride }
;
const int src_widths [ 3 ] = {
src -> y_crop_width , src -> uv_crop_width , src -> uv_crop_width }
;
const int src_heights [ 3 ] = {
src -> y_crop_height , src -> uv_crop_height , src -> uv_crop_height }
;
uint8_t * const dsts [ 3 ] = {
dst -> y_buffer , dst -> u_buffer , dst -> v_buffer }
;
const int dst_strides [ 3 ] = {
dst -> y_stride , dst -> uv_stride , dst -> uv_stride }
;
const int dst_widths [ 3 ] = {
dst -> y_crop_width , dst -> uv_crop_width , dst -> uv_crop_width }
;
const int dst_heights [ 3 ] = {
dst -> y_crop_height , dst -> uv_crop_height , dst -> uv_crop_height }
;
for ( i = 0 ;
i < MAX_MB_PLANE ;
++ i ) vp9_resize_plane ( srcs [ i ] , src_heights [ i ] , src_widths [ i ] , src_strides [ i ] , dsts [ i ] , dst_heights [ i ] , dst_widths [ i ] , dst_strides [ i ] ) ;
vp9_extend_frame_borders ( dst ) ;
} |
1,760,449,185,745,615,400 | debian | 4 | 0 | TSMLoc TSFetchRespHdrMLocGet ( TSFetchSM fetch_sm ) {
sdk_assert ( sdk_sanity_check_fetch_sm ( fetch_sm ) == TS_SUCCESS ) ;
return ( ( FetchSM * ) fetch_sm ) -> resp_hdr_mloc ( ) ;
} |
8,572,106,347,813,672,000 | debian | 3 | 0 | static inline struct pfkey_sock * pfkey_sk ( struct sock * sk ) {
return ( struct pfkey_sock * ) sk ;
} |
-4,555,950,263,653,671,000 | debian | 16 | 0 | static PyObject * string_split ( PyStringObject * self , PyObject * args ) {
Py_ssize_t len = PyString_GET_SIZE ( self ) , n ;
Py_ssize_t maxsplit = - 1 ;
const char * s = PyString_AS_STRING ( self ) , * sub ;
PyObject * subobj = Py_None ;
if ( ! PyArg_ParseTuple ( args , "|On:split" , & subobj , & maxsplit ) ) return NULL ;
if ( maxsplit < 0 ) maxsplit = PY_SSIZE_T_MAX ;
if ( subobj == Py_None ) return stringlib_split_whitespace ( ( PyObject * ) self , s , len , maxsplit ) ;
if ( PyString_Check ( subobj ) ) {
sub = PyString_AS_STRING ( subobj ) ;
n = PyString_GET_SIZE ( subobj ) ;
}
# ifdef Py_USING_UNICODE else if ( PyUnicode_Check ( subobj ) ) return PyUnicode_Split ( ( PyObject * ) self , subobj , maxsplit ) ;
# endif else if ( PyObject_AsCharBuffer ( subobj , & sub , & n ) ) return NULL ;
return stringlib_split ( ( PyObject * ) self , s , len , sub , n , maxsplit ) ;
} |
-7,670,127,399,145,951,000 | debian | 6 | 0 | int gs_main_run_file ( gs_main_instance * minst , const char * file_name , int user_errors , int * pexit_code , ref * perror_object ) {
ref initial_file ;
int code = gs_main_run_file_open ( minst , file_name , & initial_file ) ;
if ( code < 0 ) return code ;
return gs_main_interpret ( minst , & initial_file , user_errors , pexit_code , perror_object ) ;
} |
-1,335,877,942,018,854,400 | chrome | 13 | 0 | IN_PROC_BROWSER_TEST_F ( UnloadTest , BrowserCloseTabWhenOtherTabHasListener ) {
NavigateToDataURL ( CLOSE_TAB_WHEN_OTHER_TAB_HAS_LISTENER , "only_one_unload" ) ;
content : : WindowedNotificationObserver observer ( chrome : : NOTIFICATION_TAB_ADDED , content : : NotificationService : : AllSources ( ) ) ;
content : : WindowedNotificationObserver load_stop_observer ( content : : NOTIFICATION_LOAD_STOP , content : : NotificationService : : AllSources ( ) ) ;
content : : SimulateMouseClick ( browser ( ) -> tab_strip_model ( ) -> GetActiveWebContents ( ) , 0 , blink : : WebMouseEvent : : Button : : Left ) ;
observer . Wait ( ) ;
load_stop_observer . Wait ( ) ;
CheckTitle ( "popup" ) ;
content : : WebContentsDestroyedWatcher destroyed_watcher ( browser ( ) -> tab_strip_model ( ) -> GetActiveWebContents ( ) ) ;
chrome : : CloseTab ( browser ( ) ) ;
destroyed_watcher . Wait ( ) ;
CheckTitle ( "only_one_unload" ) ;
} |
-9,028,269,206,303,313,000 | debian | 16 | 0 | static void xps_sample_gradient_stops ( fz_shade * shade , struct stop * stops , int count ) {
float offset , d ;
int i , k ;
k = 0 ;
for ( i = 0 ;
i < 256 ;
i ++ ) {
offset = i / 255.0f ;
while ( k + 1 < count && offset > stops [ k + 1 ] . offset ) k ++ ;
d = ( offset - stops [ k ] . offset ) / ( stops [ k + 1 ] . offset - stops [ k ] . offset ) ;
shade -> function [ i ] [ 0 ] = lerp ( stops [ k ] . r , stops [ k + 1 ] . r , d ) ;
shade -> function [ i ] [ 1 ] = lerp ( stops [ k ] . g , stops [ k + 1 ] . g , d ) ;
shade -> function [ i ] [ 2 ] = lerp ( stops [ k ] . b , stops [ k + 1 ] . b , d ) ;
shade -> function [ i ] [ 3 ] = lerp ( stops [ k ] . a , stops [ k + 1 ] . a , d ) ;
}
} |
3,599,206,110,384,554,500 | debian | 61 | 1 | static ossl_inline int sk_ ## t1 ## _reserve ( STACK_OF ( t1 ) * sk , int n ) {
return OPENSSL_sk_reserve ( ( OPENSSL_STACK * ) sk , n ) ;
}
static ossl_inline void sk_ ## t1 ## _free ( STACK_OF ( t1 ) * sk ) {
OPENSSL_sk_free ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline void sk_ ## t1 ## _zero ( STACK_OF ( t1 ) * sk ) {
OPENSSL_sk_zero ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline t2 * sk_ ## t1 ## _delete ( STACK_OF ( t1 ) * sk , int i ) {
return ( t2 * ) OPENSSL_sk_delete ( ( OPENSSL_STACK * ) sk , i ) ;
}
static ossl_inline t2 * sk_ ## t1 ## _delete_ptr ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return ( t2 * ) OPENSSL_sk_delete_ptr ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline int sk_ ## t1 ## _push ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return OPENSSL_sk_push ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline int sk_ ## t1 ## _unshift ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return OPENSSL_sk_unshift ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline t2 * sk_ ## t1 ## _pop ( STACK_OF ( t1 ) * sk ) {
return ( t2 * ) OPENSSL_sk_pop ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline t2 * sk_ ## t1 ## _shift ( STACK_OF ( t1 ) * sk ) {
return ( t2 * ) OPENSSL_sk_shift ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline void sk_ ## t1 ## _pop_free ( STACK_OF ( t1 ) * sk , sk_ ## t1 ## _freefunc freefunc ) {
OPENSSL_sk_pop_free ( ( OPENSSL_STACK * ) sk , ( OPENSSL_sk_freefunc ) freefunc ) ;
}
static ossl_inline int sk_ ## t1 ## _insert ( STACK_OF ( t1 ) * sk , t2 * ptr , int idx ) {
return OPENSSL_sk_insert ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr , idx ) ;
}
static ossl_inline t2 * sk_ ## t1 ## _set ( STACK_OF ( t1 ) * sk , int idx , t2 * ptr ) {
return ( t2 * ) OPENSSL_sk_set ( ( OPENSSL_STACK * ) sk , idx , ( const void * ) ptr ) ;
}
static ossl_inline int sk_ ## t1 ## _find ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return OPENSSL_sk_find ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline int sk_ ## t1 ## _find_ex ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return OPENSSL_sk_find_ex ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline void sk_ ## t1 ## _sort ( STACK_OF ( t1 ) * sk ) {
OPENSSL_sk_sort ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline int sk_ ## t1 ## _is_sorted ( const STACK_OF ( t1 ) * sk ) {
return OPENSSL_sk_is_sorted ( ( const OPENSSL_STACK * ) sk ) ;
}
static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _dup ( const STACK_OF ( t1 ) * sk ) {
return ( STACK_OF ( t1 ) * ) OPENSSL_sk_dup ( ( const OPENSSL_STACK * ) sk ) ;
}
static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _deep_copy ( const STACK_OF ( t1 ) * sk , sk_ ## t1 ## _copyfunc copyfunc , sk_ ## t1 ## _freefunc freefunc ) {
return ( STACK_OF ( t1 ) * ) OPENSSL_sk_deep_copy ( ( const OPENSSL_STACK * ) sk , ( OPENSSL_sk_copyfunc ) copyfunc , ( OPENSSL_sk_freefunc ) freefunc ) ;
}
static ossl_inline sk_ ## t1 ## _compfunc sk_ ## t1 ## _set_cmp_func ( STACK_OF ( t1 ) * sk , sk_ ## t1 ## _compfunc compare ) {
return ( sk_ ## t1 ## _compfunc ) OPENSSL_sk_set_cmp_func ( ( OPENSSL_STACK * ) sk , ( OPENSSL_sk_compfunc ) compare ) ;
}
# define DEFINE_SPECIAL_STACK_OF ( t1 , t2 ) SKM_DEFINE_STACK_OF ( t1 , t2 , t2 ) # define DEFINE_STACK_OF ( t ) SKM_DEFINE_STACK_OF ( t , t , t ) # define DEFINE_SPECIAL_STACK_OF_CONST ( t1 , t2 ) SKM_DEFINE_STACK_OF ( t1 , const t2 , t2 ) # define DEFINE_STACK_OF_CONST ( t ) SKM_DEFINE_STACK_OF ( t , const t , t ) typedef char * OPENSSL_STRING ;
typedef const char * OPENSSL_CSTRING ;
DEFINE_SPECIAL_STACK_OF ( OPENSSL_STRING , char ) DEFINE_SPECIAL_STACK_OF_CONST ( OPENSSL_CSTRING , char ) typedef void * OPENSSL_BLOCK ;
DEFINE_SPECIAL_STACK_OF ( OPENSSL_BLOCK , void ) |
-192,019,917,869,801,250 | debian | 228 | 0 | void proto_register_steam_ihs_discovery ( void ) {
module_t * steam_ihs_discovery_module ;
expert_module_t * expert_steam_ihs_discovery ;
static hf_register_info hf [ ] = {
{
& hf_steam_ihs_discovery_signature , {
"Signature" , "steam_ihs_discovery.signature" , FT_UINT64 , BASE_HEX , NULL , 0 , "Every packet of the Steam In-Home Streaming Discovery Protocol begins with this signature." , HFILL }
}
, {
& hf_steam_ihs_discovery_header_length , {
"Header Length" , "steam_ihs_discovery.header_length" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_length , {
"Body Length" , "steam_ihs_discovery.body_length" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_unknown_data , {
"Unknown Data" , "steam_ihs_discovery.unknown_data" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_unknown_number , {
"Unknown Number" , "steam_ihs_discovery.unknown_number" , FT_UINT64 , BASE_DEC_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_header_clientid , {
"Client ID" , "steam_ihs_discovery.header_client_id" , FT_UINT64 , BASE_DEC_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_header_msgtype , {
"Message Type" , "steam_ihs_discovery.header_msg_type" , FT_UINT64 , BASE_DEC | BASE_VAL64_STRING , VALS64 ( hf_steam_ihs_discovery_header_msgtype_strings ) , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_header_instanceid , {
"Instance ID" , "steam_ihs_discovery.header_instance_id" , FT_UINT64 , BASE_DEC_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_discovery_seqnum , {
"Sequence Number" , "steam_ihs_discovery.body_discovery_seqnum" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_discovery_clientids , {
"Client IDs" , "steam_ihs_discovery.body_discovery_clientids" , FT_UINT64 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_status_version , {
"Version" , "steam_ihs_discovery.body_status_version" , FT_INT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_status_minversion , {
"Minimum Version" , "steam_ihs_discovery.body_status_minversion" , FT_INT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_status_connectport , {
"Connect Port" , "steam_ihs_discovery.body_status_connectport" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_status_hostname , {
"Hostname" , "steam_ihs_discovery.body_status_hostname" , FT_STRING , STR_UNICODE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_status_enabledservices , {
"Enabled Services" , "steam_ihs_discovery.body_status_enabledservices" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_status_ostype , {
"OS Type" , "steam_ihs_discovery.body_status_ostype" , FT_INT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_status_is64bit , {
"Is 64 Bit" , "steam_ihs_discovery.body_status_is64bit" , FT_BOOLEAN , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_status_euniverse , {
"EUniverse" , "steam_ihs_discovery.body_status_euniverse" , FT_INT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_status_timestamp , {
"Timestamp" , "steam_ihs_discovery.body_status_timestamp" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_LOCAL , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_status_screenlocked , {
"Screen Locked" , "steam_ihs_discovery.body_status_screenlocked" , FT_BOOLEAN , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_status_gamesrunning , {
"Games Running" , "steam_ihs_discovery.body_status_gamesrunning" , FT_BOOLEAN , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_status_macaddresses , {
"MAC Addresses" , "steam_ihs_discovery.body_status_macaddresses" , FT_STRING , STR_ASCII , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_status_user_steamid , {
"Steam ID" , "steam_ihs_discovery.body_status_user_steamid" , FT_UINT64 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_status_user_authkeyid , {
"Auth Key ID" , "steam_ihs_discovery.body_status_user_authkeyid" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_authrequest_devicetoken , {
"Device Token" , "steam_ihs_discovery.body_authrequest_devicetoken" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_authrequest_devicename , {
"Device Name" , "steam_ihs_discovery.body_authrequest_devicename" , FT_STRING , STR_UNICODE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_authrequest_encryptedrequest , {
"Encrypted Request" , "steam_ihs_discovery.body_authrequest_encryptedrequest" , FT_BYTES , BASE_NO_DISPLAY_VALUE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_authresponse_authresult , {
"Result" , "steam_ihs_discovery.body_authresponse_authresult" , FT_UINT64 , BASE_DEC | BASE_VAL64_STRING , VALS64 ( hf_steam_ihs_discovery_body_authresponse_authresult_strings ) , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingrequest_requestid , {
"Request ID" , "steam_ihs_discovery.body_streamingrequest_requestid" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingrequest_maximumresolutionx , {
"Maximum Resolution X" , "steam_ihs_discovery.body_streamingrequest_maximumresolutionx" , FT_INT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingrequest_maximumresolutiony , {
"Maximum Resolution Y" , "steam_ihs_discovery.body_streamingrequest_maximumresolutiony" , FT_INT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingrequest_audiochannelcount , {
"Audio Channel Count" , "steam_ihs_discovery.body_streamingrequest_audiochannelcount" , FT_INT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingrequest_deviceversion , {
"Device Version" , "steam_ihs_discovery.body_streamingrequest_deviceversion" , FT_STRING , STR_UNICODE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingrequest_streamdesktop , {
"Stream Desktop" , "steam_ihs_discovery.body_streamingrequest_streamdesktop" , FT_BOOLEAN , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingrequest_devicetoken , {
"Device Token" , "steam_ihs_discovery.body_streamingrequest_devicetoken" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingrequest_pin , {
"PIN" , "steam_ihs_discovery.body_streamingrequest_pin" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingrequest_enablevideostreaming , {
"Enable Video Streaming" , "steam_ihs_discovery.body_streamingrequest_enablevideostreaming" , FT_BOOLEAN , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingrequest_enableaudiostreaming , {
"Enable Audio Streaming" , "steam_ihs_discovery.body_streamingrequest_enableaudiostreaming" , FT_BOOLEAN , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingrequest_enableinputstreaming , {
"Enable Input Streaming" , "steam_ihs_discovery.body_streamingrequest_enableinputstreaming" , FT_BOOLEAN , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingcancelrequest_requestid , {
"Request ID" , "steam_ihs_discovery.body_streamingcancelrequest_requestid" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingresponse_requestid , {
"Request ID" , "steam_ihs_discovery.body_streamingresponse_requestid" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingresponse_result , {
"Result" , "steam_ihs_discovery.body_streamingresponse_result" , FT_UINT64 , BASE_DEC | BASE_VAL64_STRING , VALS64 ( hf_steam_ihs_discovery_body_streamingresponse_result_strings ) , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingresponse_port , {
"Port" , "steam_ihs_discovery.body_streamingresponse_port" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingresponse_encryptedsessionkey , {
"Encrypted Session Key" , "steam_ihs_discovery.body_streamingresponse_encryptedsessionkey" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_streamingresponse_virtualherelicenseddevicecount , {
"VirtualHere Licensed Device Count" , "steam_ihs_discovery.body_streamingresponse_virtualherelicenseddevicecount" , FT_INT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_proofrequest_challenge , {
"Challenge" , "steam_ihs_discovery.body_proofrequest_challenge" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_steam_ihs_discovery_body_proofresponse_response , {
"Response" , "steam_ihs_discovery.body_proofresponse_response" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
}
;
static gint * ett [ ] = {
& ett_steam_ihs_discovery , & ett_steam_ihs_discovery_body_status_user }
;
static ei_register_info ei [ ] = {
{
& ei_steam_ihs_discovery_unknown_data , {
"steam_ihs_discovery.unknowndata" , PI_UNDECODED , PI_WARN , "Unknown data section" , EXPFILL }
}
, {
& ei_steam_ihs_discovery_unknown_number , {
"steam_ihs_discovery.unknownnumber" , PI_UNDECODED , PI_WARN , "Unknown numeric protobuf field" , EXPFILL }
}
, {
& ei_steam_ihs_discovery_unknown_lengthdelimited , {
"steam_ihs_discovery.unknownlengthdelimited" , PI_UNDECODED , PI_WARN , "Unknown length-delimited protobuf field" , EXPFILL }
}
, {
& ei_steam_ihs_discovery_invalid_wiretype , {
"steam_ihs_discovery.invalid_wiretype" , PI_MALFORMED , PI_ERROR , "Unexpected wire type" , EXPFILL }
}
, {
& ei_steam_ihs_discovery_invalid_length , {
"steam_ihs_discovery.invalid_length" , PI_MALFORMED , PI_ERROR , "Length-delimited field has invalid length" , EXPFILL }
}
}
;
proto_steam_ihs_discovery = proto_register_protocol ( "Steam In-Home Streaming Discovery Protocol" , "Steam IHS Discovery" , "steam_ihs_discovery" ) ;
proto_register_field_array ( proto_steam_ihs_discovery , hf , array_length ( hf ) ) ;
proto_register_subtree_array ( ett , array_length ( ett ) ) ;
expert_steam_ihs_discovery = expert_register_protocol ( proto_steam_ihs_discovery ) ;
expert_register_field_array ( expert_steam_ihs_discovery , ei , array_length ( ei ) ) ;
steam_ihs_discovery_module = prefs_register_protocol ( proto_steam_ihs_discovery , proto_reg_handoff_steam_ihs_discovery ) ;
prefs_register_uint_preference ( steam_ihs_discovery_module , "udp.port" , "steam_ihs_discovery UDP Port" , " Steam IHS Discovery UDP port if other than the default" , 10 , & udp_port_pref ) ;
} |
3,887,066,622,454,352,400 | chrome | 24 | 1 | static int check_best_zero_mv ( const VP9_COMP * cpi , const uint8_t mode_context [ MAX_REF_FRAMES ] , int_mv frame_mv [ MB_MODE_COUNT ] [ MAX_REF_FRAMES ] , int inter_mode_mask , int this_mode , const MV_REFERENCE_FRAME ref_frames [ 2 ] ) {
if ( ( inter_mode_mask & ( 1 << ZEROMV ) ) && ( this_mode == NEARMV || this_mode == NEARESTMV || this_mode == ZEROMV ) && frame_mv [ this_mode ] [ ref_frames [ 0 ] ] . as_int == 0 && ( ref_frames [ 1 ] == NONE || frame_mv [ this_mode ] [ ref_frames [ 1 ] ] . as_int == 0 ) ) {
int rfc = mode_context [ ref_frames [ 0 ] ] ;
int c1 = cost_mv_ref ( cpi , NEARMV , rfc ) ;
int c2 = cost_mv_ref ( cpi , NEARESTMV , rfc ) ;
int c3 = cost_mv_ref ( cpi , ZEROMV , rfc ) ;
if ( this_mode == NEARMV ) {
if ( c1 > c3 ) return 0 ;
}
else if ( this_mode == NEARESTMV ) {
if ( c2 > c3 ) return 0 ;
}
else {
assert ( this_mode == ZEROMV ) ;
if ( ref_frames [ 1 ] == NONE ) {
if ( ( c3 >= c2 && frame_mv [ NEARESTMV ] [ ref_frames [ 0 ] ] . as_int == 0 ) || ( c3 >= c1 && frame_mv [ NEARMV ] [ ref_frames [ 0 ] ] . as_int == 0 ) ) return 0 ;
}
else {
if ( ( c3 >= c2 && frame_mv [ NEARESTMV ] [ ref_frames [ 0 ] ] . as_int == 0 && frame_mv [ NEARESTMV ] [ ref_frames [ 1 ] ] . as_int == 0 ) || ( c3 >= c1 && frame_mv [ NEARMV ] [ ref_frames [ 0 ] ] . as_int == 0 && frame_mv [ NEARMV ] [ ref_frames [ 1 ] ] . as_int == 0 ) ) return 0 ;
}
}
}
return 1 ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_INTEGER_1_15 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_constrained_integer ( tvb , offset , actx , tree , hf_index , 1U , 15U , NULL , FALSE ) ;
return offset ;
} |
6,755,873,269,946,788,000 | debian | 33 | 0 | static void pk_transaction_get_details ( PkTransaction * transaction , GVariant * params , GDBusMethodInvocation * context ) {
gboolean ret ;
guint length ;
g_autofree gchar * * package_ids = NULL ;
g_autoptr ( GError ) error = NULL ;
g_autofree gchar * package_ids_temp = NULL ;
g_return_if_fail ( PK_IS_TRANSACTION ( transaction ) ) ;
g_return_if_fail ( transaction -> priv -> tid != NULL ) ;
g_variant_get ( params , "(^a&s)" , & package_ids ) ;
package_ids_temp = pk_package_ids_to_string ( package_ids ) ;
g_debug ( "GetDetails method called: %s" , package_ids_temp ) ;
if ( ! pk_backend_is_implemented ( transaction -> priv -> backend , PK_ROLE_ENUM_GET_DETAILS ) ) {
g_set_error ( & error , PK_TRANSACTION_ERROR , PK_TRANSACTION_ERROR_NOT_SUPPORTED , "GetDetails not supported by backend" ) ;
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_ERROR ) ;
goto out ;
}
length = g_strv_length ( package_ids ) ;
if ( length > PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS ) {
g_set_error ( & error , PK_TRANSACTION_ERROR , PK_TRANSACTION_ERROR_NUMBER_OF_PACKAGES_INVALID , "Too many packages to process (%i/%i)" , length , PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS ) ;
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_ERROR ) ;
goto out ;
}
ret = pk_package_ids_check ( package_ids ) ;
if ( ! ret ) {
g_set_error ( & error , PK_TRANSACTION_ERROR , PK_TRANSACTION_ERROR_PACKAGE_ID_INVALID , "The package id's '%s' are not valid" , package_ids_temp ) ;
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_ERROR ) ;
goto out ;
}
transaction -> priv -> cached_package_ids = g_strdupv ( package_ids ) ;
pk_transaction_set_role ( transaction , PK_ROLE_ENUM_GET_DETAILS ) ;
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_READY ) ;
out : pk_transaction_dbus_return ( context , error ) ;
} |
8,572,106,347,813,672,000 | debian | 9 | 0 | static int present_and_same_family ( const struct sadb_address * src , const struct sadb_address * dst ) {
const struct sockaddr * s_addr , * d_addr ;
if ( ! src || ! dst ) return 0 ;
s_addr = ( const struct sockaddr * ) ( src + 1 ) ;
d_addr = ( const struct sockaddr * ) ( dst + 1 ) ;
if ( s_addr -> sa_family != d_addr -> sa_family ) return 0 ;
if ( s_addr -> sa_family != AF_INET # if IS_ENABLED ( CONFIG_IPV6 ) && s_addr -> sa_family != AF_INET6 # endif ) return 0 ;
return 1 ;
} |
-1,315,695,702,746,584,300 | debian | 8 | 0 | void ptvcursor_pop_subtree ( ptvcursor_t * ptvc ) {
subtree_lvl * subtree ;
if ( ptvc -> pushed_tree_index <= 0 ) return ;
ptvc -> pushed_tree_index -- ;
subtree = ptvc -> pushed_tree + ptvc -> pushed_tree_index ;
if ( subtree -> it != NULL ) proto_item_set_len ( subtree -> it , ptvcursor_current_offset ( ptvc ) - subtree -> cursor_offset ) ;
ptvc -> tree = subtree -> tree ;
} |
-7,434,014,980,763,121,000 | debian | 3 | 0 | int dissect_unknown_ber ( packet_info * pinfo , tvbuff_t * tvb , int offset , proto_tree * tree ) {
return try_dissect_unknown_ber ( pinfo , tvb , offset , tree , 1 ) ;
} |
313,627,013,719,508,800 | debian | 11 | 0 | static inline MagickRealType GetPixelInfoChannel ( const PixelInfo * restrict pixel_info , const PixelChannel channel ) {
switch ( channel ) {
case RedPixelChannel : return ( pixel_info -> red ) ;
case GreenPixelChannel : return ( pixel_info -> green ) ;
case BluePixelChannel : return ( pixel_info -> blue ) ;
case BlackPixelChannel : return ( pixel_info -> black ) ;
case AlphaPixelChannel : return ( pixel_info -> alpha ) ;
case IndexPixelChannel : return ( pixel_info -> index ) ;
default : return ( ( MagickRealType ) 0.0 ) ;
}
} |
3,035,587,999,006,680,600 | debian | 18 | 0 | int dtls1_retransmit_buffered_messages ( SSL * s ) {
pqueue sent = s -> d1 -> sent_messages ;
piterator iter ;
pitem * item ;
hm_fragment * frag ;
int found = 0 ;
iter = pqueue_iterator ( sent ) ;
for ( item = pqueue_next ( & iter ) ;
item != NULL ;
item = pqueue_next ( & iter ) ) {
frag = ( hm_fragment * ) item -> data ;
if ( dtls1_retransmit_message ( s , ( unsigned short ) dtls1_get_queue_priority ( frag -> msg_header . seq , frag -> msg_header . is_ccs ) , 0 , & found ) <= 0 && found ) {
fprintf ( stderr , "dtls1_retransmit_message() failed\n" ) ;
return - 1 ;
}
}
return 1 ;
} |
1,760,449,185,745,615,400 | debian | 9 | 0 | TSReturnCode TSUuidStringParse ( TSUuid uuid , const char * str ) {
sdk_assert ( sdk_sanity_check_null_ptr ( ( void * ) uuid ) == TS_SUCCESS ) ;
sdk_assert ( sdk_sanity_check_null_ptr ( ( void * ) str ) == TS_SUCCESS ) ;
ATSUuid * u = ( ATSUuid * ) uuid ;
if ( u -> parseString ( str ) ) {
return TS_SUCCESS ;
}
return TS_ERROR ;
} |
-1,102,844,685,921,778,700 | debian | 21 | 0 | int archive_mstring_update_utf8 ( struct archive * a , struct archive_mstring * aes , const char * utf8 ) {
struct archive_string_conv * sc ;
int r ;
if ( utf8 == NULL ) {
aes -> aes_set = 0 ;
return ( 0 ) ;
}
archive_strcpy ( & ( aes -> aes_utf8 ) , utf8 ) ;
archive_string_empty ( & ( aes -> aes_mbs ) ) ;
archive_wstring_empty ( & ( aes -> aes_wcs ) ) ;
aes -> aes_set = AES_SET_UTF8 ;
sc = archive_string_conversion_from_charset ( a , "UTF-8" , 1 ) ;
if ( sc == NULL ) return ( - 1 ) ;
r = archive_strcpy_l ( & ( aes -> aes_mbs ) , utf8 , sc ) ;
if ( a == NULL ) free_sconv_object ( sc ) ;
if ( r != 0 ) return ( - 1 ) ;
aes -> aes_set = AES_SET_UTF8 | AES_SET_MBS ;
if ( archive_wstring_append_from_mbs ( & ( aes -> aes_wcs ) , aes -> aes_mbs . s , aes -> aes_mbs . length ) ) return ( - 1 ) ;
aes -> aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS ;
return ( 0 ) ;
} |
-4,527,380,754,569,408,000 | chrome | 20 | 0 | GType hb_gobject_ ## name ## _get_type ( void ) \ {
static gsize type_id = 0 ;
if ( g_once_init_enter ( & type_id ) ) {
GType id = g_boxed_type_register_static ( g_intern_static_string ( "hb_" # name "_t" ) , ( GBoxedCopyFunc ) copy_func , ( GBoxedFreeFunc ) free_func ) ;
g_once_init_leave ( & type_id , id ) ;
}
return type_id ;
\ }
# define HB_DEFINE_OBJECT_TYPE ( name ) HB_DEFINE_BOXED_TYPE ( name , hb_ ## name ## _reference , hb_ ## name ## _destroy ) ;
# define HB_DEFINE_VALUE_TYPE ( name ) static hb_ ## name ## _t * _hb_ ## name ## _reference ( const hb_ ## name ## _t * l ) {
hb_ ## name ## _t * c = ( hb_ ## name ## _t * ) calloc ( 1 , sizeof ( hb_ ## name ## _t ) ) ;
if ( unlikely ( ! c ) ) return NULL ;
* c = * l ;
return c ;
}
static void _hb_ ## name ## _destroy ( hb_ ## name ## _t * l ) {
free ( l ) ;
}
HB_DEFINE_BOXED_TYPE ( name , _hb_ ## name ## _reference , _hb_ ## name ## _destroy ) ;
HB_DEFINE_OBJECT_TYPE ( buffer ) HB_DEFINE_OBJECT_TYPE ( blob ) HB_DEFINE_OBJECT_TYPE ( face ) HB_DEFINE_OBJECT_TYPE ( font ) HB_DEFINE_OBJECT_TYPE ( font_funcs ) HB_DEFINE_OBJECT_TYPE ( set ) HB_DEFINE_OBJECT_TYPE ( shape_plan ) HB_DEFINE_OBJECT_TYPE ( unicode_funcs ) HB_DEFINE_VALUE_TYPE ( feature ) |
-3,740,862,514,502,467,000 | debian | 41 | 0 | static int dumpcff ( struct alltabs * at , SplineFont * sf , enum fontformat format , FILE * cff ) {
int ret ;
if ( format == ff_cff ) {
AssignTTFGlyph ( & at -> gi , sf , at -> map , true ) ;
ret = dumptype2glyphs ( sf , at ) ;
}
else {
SFDummyUpCIDs ( & at -> gi , sf ) ;
ret = dumpcidglyphs ( sf , at ) ;
free ( sf -> glyphs ) ;
sf -> glyphs = NULL ;
sf -> glyphcnt = sf -> glyphmax = 0 ;
}
free ( at -> gi . bygid ) ;
if ( ! ret ) at -> error = true ;
else if ( at -> gi . flags & ps_flag_nocffsugar ) {
if ( ! ttfcopyfile ( cff , at -> cfff , 0 , "CFF" ) ) at -> error = true ;
}
else {
long len ;
char buffer [ 80 ] ;
fprintf ( cff , "%%!PS-Adobe-3.0 Resource-FontSet\n" ) ;
fprintf ( cff , "%%%%DocumentNeedResources:ProcSet (FontSetInit)\n" ) ;
fprintf ( cff , "%%%%Title: (FontSet/%s)\n" , sf -> fontname ) ;
fprintf ( cff , "%%%%EndComments\n" ) ;
fprintf ( cff , "%%%%IncludeResource: ProcSet(FontSetInit)\n" ) ;
fprintf ( cff , "%%%%BeginResource: FontSet(%s)\n" , sf -> fontname ) ;
fprintf ( cff , "/FontSetInit /ProcSet findresource begin\n" ) ;
fseek ( at -> cfff , 0 , SEEK_END ) ;
len = ftell ( at -> cfff ) ;
rewind ( at -> cfff ) ;
sprintf ( buffer , "/%s %ld StartData\n" , sf -> fontname , len ) ;
fprintf ( cff , "%%%%BeginData: %ld Binary Bytes\n" , ( long ) ( len + strlen ( buffer ) ) ) ;
fputs ( buffer , cff ) ;
if ( ! ttfcopyfile ( cff , at -> cfff , ftell ( cff ) , "CFF" ) ) at -> error = true ;
fprintf ( cff , "\n%%%%EndData\n" ) ;
fprintf ( cff , "%%%%EndResource\n" ) ;
fprintf ( cff , "%%%%EOF\n" ) ;
}
return ( ! at -> error ) ;
} |
6,571,662,888,192,810,000 | debian | 4 | 0 | inline HTTPStatus http_hdr_status_get ( HTTPHdrImpl * hh ) {
ink_assert ( hh -> m_polarity == HTTP_TYPE_RESPONSE ) ;
return ( HTTPStatus ) hh -> u . resp . m_status ;
} |
355,220,887,711,506,900 | debian | 38 | 0 | Datum scalarltsel ( PG_FUNCTION_ARGS ) {
PlannerInfo * root = ( PlannerInfo * ) PG_GETARG_POINTER ( 0 ) ;
Oid operator = PG_GETARG_OID ( 1 ) ;
List * args = ( List * ) PG_GETARG_POINTER ( 2 ) ;
int varRelid = PG_GETARG_INT32 ( 3 ) ;
VariableStatData vardata ;
Node * other ;
bool varonleft ;
Datum constval ;
Oid consttype ;
bool isgt ;
double selec ;
if ( ! get_restriction_variable ( root , args , varRelid , & vardata , & other , & varonleft ) ) PG_RETURN_FLOAT8 ( DEFAULT_INEQ_SEL ) ;
if ( ! IsA ( other , Const ) ) {
ReleaseVariableStats ( vardata ) ;
PG_RETURN_FLOAT8 ( DEFAULT_INEQ_SEL ) ;
}
if ( ( ( Const * ) other ) -> constisnull ) {
ReleaseVariableStats ( vardata ) ;
PG_RETURN_FLOAT8 ( 0.0 ) ;
}
constval = ( ( Const * ) other ) -> constvalue ;
consttype = ( ( Const * ) other ) -> consttype ;
if ( varonleft ) {
isgt = false ;
}
else {
operator = get_commutator ( operator ) ;
if ( ! operator ) {
ReleaseVariableStats ( vardata ) ;
PG_RETURN_FLOAT8 ( DEFAULT_INEQ_SEL ) ;
}
isgt = true ;
}
selec = scalarineqsel ( root , operator , isgt , & vardata , constval , consttype ) ;
ReleaseVariableStats ( vardata ) ;
PG_RETURN_FLOAT8 ( ( float8 ) selec ) ;
} |
-5,717,349,108,307,170,000 | debian | 97 | 1 | static int mss4_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) {
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
MSS4Context * c = avctx -> priv_data ;
GetBitContext gb ;
GetByteContext bc ;
uint8_t * dst [ 3 ] ;
int width , height , quality , frame_type ;
int x , y , i , mb_width , mb_height , blk_type ;
int ret ;
if ( buf_size < HEADER_SIZE ) {
av_log ( avctx , AV_LOG_ERROR , "Frame should have at least %d bytes, got %d instead\n" , HEADER_SIZE , buf_size ) ;
return AVERROR_INVALIDDATA ;
}
bytestream2_init ( & bc , buf , buf_size ) ;
width = bytestream2_get_be16 ( & bc ) ;
height = bytestream2_get_be16 ( & bc ) ;
bytestream2_skip ( & bc , 2 ) ;
quality = bytestream2_get_byte ( & bc ) ;
frame_type = bytestream2_get_byte ( & bc ) ;
if ( width > avctx -> width || height != avctx -> height ) {
av_log ( avctx , AV_LOG_ERROR , "Invalid frame dimensions %dx%d\n" , width , height ) ;
return AVERROR_INVALIDDATA ;
}
if ( quality < 1 || quality > 100 ) {
av_log ( avctx , AV_LOG_ERROR , "Invalid quality setting %d\n" , quality ) ;
return AVERROR_INVALIDDATA ;
}
if ( ( frame_type & ~ 3 ) || frame_type == 3 ) {
av_log ( avctx , AV_LOG_ERROR , "Invalid frame type %d\n" , frame_type ) ;
return AVERROR_INVALIDDATA ;
}
if ( frame_type != SKIP_FRAME && ! bytestream2_get_bytes_left ( & bc ) ) {
av_log ( avctx , AV_LOG_ERROR , "Empty frame found but it is not a skip frame.\n" ) ;
return AVERROR_INVALIDDATA ;
}
c -> pic . reference = 3 ;
c -> pic . buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE ;
if ( ( ret = avctx -> reget_buffer ( avctx , & c -> pic ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "reget_buffer() failed\n" ) ;
return ret ;
}
c -> pic . key_frame = ( frame_type == INTRA_FRAME ) ;
c -> pic . pict_type = ( frame_type == INTRA_FRAME ) ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P ;
if ( frame_type == SKIP_FRAME ) {
* got_frame = 1 ;
* ( AVFrame * ) data = c -> pic ;
return buf_size ;
}
if ( c -> quality != quality ) {
c -> quality = quality ;
for ( i = 0 ;
i < 2 ;
i ++ ) ff_mss34_gen_quant_mat ( c -> quant_mat [ i ] , quality , ! i ) ;
}
init_get_bits ( & gb , buf + HEADER_SIZE , ( buf_size - HEADER_SIZE ) * 8 ) ;
mb_width = FFALIGN ( width , 16 ) >> 4 ;
mb_height = FFALIGN ( height , 16 ) >> 4 ;
dst [ 0 ] = c -> pic . data [ 0 ] ;
dst [ 1 ] = c -> pic . data [ 1 ] ;
dst [ 2 ] = c -> pic . data [ 2 ] ;
memset ( c -> prev_vec , 0 , sizeof ( c -> prev_vec ) ) ;
for ( y = 0 ;
y < mb_height ;
y ++ ) {
memset ( c -> dc_cache , 0 , sizeof ( c -> dc_cache ) ) ;
for ( x = 0 ;
x < mb_width ;
x ++ ) {
blk_type = decode012 ( & gb ) ;
switch ( blk_type ) {
case DCT_BLOCK : if ( mss4_decode_dct_block ( c , & gb , dst , x , y ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "Error decoding DCT block %d,%d\n" , x , y ) ;
return AVERROR_INVALIDDATA ;
}
break ;
case IMAGE_BLOCK : if ( mss4_decode_image_block ( c , & gb , dst , x , y ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "Error decoding VQ block %d,%d\n" , x , y ) ;
return AVERROR_INVALIDDATA ;
}
break ;
case SKIP_BLOCK : if ( frame_type == INTRA_FRAME ) {
av_log ( avctx , AV_LOG_ERROR , "Skip block in intra frame\n" ) ;
return AVERROR_INVALIDDATA ;
}
break ;
}
if ( blk_type != DCT_BLOCK ) mss4_update_dc_cache ( c , x ) ;
}
dst [ 0 ] += c -> pic . linesize [ 0 ] * 16 ;
dst [ 1 ] += c -> pic . linesize [ 1 ] * 16 ;
dst [ 2 ] += c -> pic . linesize [ 2 ] * 16 ;
}
* got_frame = 1 ;
* ( AVFrame * ) data = c -> pic ;
return buf_size ;
} |
7,549,435,794,356,072,000 | debian | 12 | 0 | static VALUE decode_int ( unsigned char * der , long length ) {
ASN1_INTEGER * ai ;
const unsigned char * p ;
VALUE ret ;
int status = 0 ;
p = der ;
if ( ! ( ai = d2i_ASN1_INTEGER ( NULL , & p , length ) ) ) ossl_raise ( eASN1Error , NULL ) ;
ret = rb_protect ( ( VALUE ( * ) ( VALUE ) ) asn1integer_to_num , ( VALUE ) ai , & status ) ;
ASN1_INTEGER_free ( ai ) ;
if ( status ) rb_jump_tag ( status ) ;
return ret ;
} |
2,820,551,931,453,396,000 | debian | 24 | 0 | int jas_image_writecmpt2 ( jas_image_t * image , int cmptno , jas_image_coord_t x , jas_image_coord_t y , jas_image_coord_t width , jas_image_coord_t height , long * buf ) {
jas_image_cmpt_t * cmpt ;
jas_image_coord_t i ;
jas_image_coord_t j ;
long v ;
long * bufptr ;
if ( cmptno < 0 || cmptno >= image -> numcmpts_ ) goto error ;
cmpt = image -> cmpts_ [ cmptno ] ;
if ( x < 0 || x >= cmpt -> width_ || y < 0 || y >= cmpt -> height_ || width < 0 || height < 0 || x + width > cmpt -> width_ || y + height > cmpt -> height_ ) goto error ;
bufptr = buf ;
for ( i = 0 ;
i < height ;
++ i ) {
if ( jas_stream_seek ( cmpt -> stream_ , ( cmpt -> width_ * ( y + i ) + x ) * cmpt -> cps_ , SEEK_SET ) < 0 ) goto error ;
for ( j = 0 ;
j < width ;
++ j ) {
v = * bufptr ++ ;
if ( putint ( cmpt -> stream_ , cmpt -> sgnd_ , cmpt -> prec_ , v ) ) goto error ;
}
}
return 0 ;
error : return - 1 ;
} |
8,139,827,869,427,660,000 | debian | 11 | 0 | int gdev_pdf_put_params ( gx_device * dev , gs_param_list * plist ) {
int code ;
gx_device_pdf * pdev = ( gx_device_pdf * ) dev ;
gs_memory_t * mem = gs_memory_stable ( pdev -> memory ) ;
gx_device_pdf * save_dev = gs_malloc ( mem , sizeof ( gx_device_pdf ) , 1 , "saved gx_device_pdf" ) ;
if ( ! save_dev ) return_error ( gs_error_VMerror ) ;
memcpy ( save_dev , pdev , sizeof ( gx_device_pdf ) ) ;
code = gdev_pdf_put_params_impl ( dev , save_dev , plist ) ;
gs_free ( mem , save_dev , sizeof ( gx_device_pdf ) , 1 , "saved gx_device_pdf" ) ;
return code ;
} |
3,309,252,579,593,081,300 | debian | 5 | 0 | static int nntp_connect_error ( struct NntpServer * nserv ) {
nserv -> status = NNTP_NONE ;
mutt_error ( _ ( "Server closed connection!" ) ) ;
return - 1 ;
} |
8,472,707,559,856,743,000 | debian | 105 | 1 | static int truemotion1_decode_header ( TrueMotion1Context * s ) {
int i , ret ;
int width_shift = 0 ;
int new_pix_fmt ;
struct frame_header header ;
uint8_t header_buffer [ 128 ] = {
0 }
;
const uint8_t * sel_vector_table ;
header . header_size = ( ( s -> buf [ 0 ] >> 5 ) | ( s -> buf [ 0 ] << 3 ) ) & 0x7f ;
if ( s -> buf [ 0 ] < 0x10 ) {
av_log ( s -> avctx , AV_LOG_ERROR , "invalid header size (%d)\n" , s -> buf [ 0 ] ) ;
return AVERROR_INVALIDDATA ;
}
for ( i = 1 ;
i < header . header_size ;
i ++ ) header_buffer [ i - 1 ] = s -> buf [ i ] ^ s -> buf [ i + 1 ] ;
header . compression = header_buffer [ 0 ] ;
header . deltaset = header_buffer [ 1 ] ;
header . vectable = header_buffer [ 2 ] ;
header . ysize = AV_RL16 ( & header_buffer [ 3 ] ) ;
header . xsize = AV_RL16 ( & header_buffer [ 5 ] ) ;
header . checksum = AV_RL16 ( & header_buffer [ 7 ] ) ;
header . version = header_buffer [ 9 ] ;
header . header_type = header_buffer [ 10 ] ;
header . flags = header_buffer [ 11 ] ;
header . control = header_buffer [ 12 ] ;
if ( header . version >= 2 ) {
if ( header . header_type > 3 ) {
av_log ( s -> avctx , AV_LOG_ERROR , "invalid header type (%d)\n" , header . header_type ) ;
return AVERROR_INVALIDDATA ;
}
else if ( ( header . header_type == 2 ) || ( header . header_type == 3 ) ) {
s -> flags = header . flags ;
if ( ! ( s -> flags & FLAG_INTERFRAME ) ) s -> flags |= FLAG_KEYFRAME ;
}
else s -> flags = FLAG_KEYFRAME ;
}
else s -> flags = FLAG_KEYFRAME ;
if ( s -> flags & FLAG_SPRITE ) {
av_log_ask_for_sample ( s -> avctx , "SPRITE frame found.\n" ) ;
return AVERROR_PATCHWELCOME ;
}
else {
s -> w = header . xsize ;
s -> h = header . ysize ;
if ( header . header_type < 2 ) {
if ( ( s -> w < 213 ) && ( s -> h >= 176 ) ) {
s -> flags |= FLAG_INTERPOLATED ;
av_log_ask_for_sample ( s -> avctx , "INTERPOLATION selected.\n" ) ;
}
}
}
if ( header . compression >= 17 ) {
av_log ( s -> avctx , AV_LOG_ERROR , "invalid compression type (%d)\n" , header . compression ) ;
return AVERROR_INVALIDDATA ;
}
if ( ( header . deltaset != s -> last_deltaset ) || ( header . vectable != s -> last_vectable ) ) select_delta_tables ( s , header . deltaset ) ;
if ( ( header . compression & 1 ) && header . header_type ) sel_vector_table = pc_tbl2 ;
else {
if ( header . vectable > 0 && header . vectable < 4 ) sel_vector_table = tables [ header . vectable - 1 ] ;
else {
av_log ( s -> avctx , AV_LOG_ERROR , "invalid vector table id (%d)\n" , header . vectable ) ;
return AVERROR_INVALIDDATA ;
}
}
if ( compression_types [ header . compression ] . algorithm == ALGO_RGB24H ) {
new_pix_fmt = AV_PIX_FMT_RGB32 ;
width_shift = 1 ;
}
else new_pix_fmt = AV_PIX_FMT_RGB555 ;
s -> w >>= width_shift ;
if ( ( ret = av_image_check_size ( s -> w , s -> h , 0 , s -> avctx ) ) < 0 ) return ret ;
if ( s -> w != s -> avctx -> width || s -> h != s -> avctx -> height || new_pix_fmt != s -> avctx -> pix_fmt ) {
if ( s -> frame . data [ 0 ] ) s -> avctx -> release_buffer ( s -> avctx , & s -> frame ) ;
s -> avctx -> sample_aspect_ratio = ( AVRational ) {
1 << width_shift , 1 }
;
s -> avctx -> pix_fmt = new_pix_fmt ;
avcodec_set_dimensions ( s -> avctx , s -> w , s -> h ) ;
av_fast_malloc ( & s -> vert_pred , & s -> vert_pred_size , s -> avctx -> width * sizeof ( unsigned int ) ) ;
}
s -> mb_change_bits_row_size = ( ( s -> avctx -> width >> ( 2 - width_shift ) ) + 7 ) >> 3 ;
if ( ( header . deltaset != s -> last_deltaset ) || ( header . vectable != s -> last_vectable ) ) {
if ( compression_types [ header . compression ] . algorithm == ALGO_RGB24H ) gen_vector_table24 ( s , sel_vector_table ) ;
else if ( s -> avctx -> pix_fmt == AV_PIX_FMT_RGB555 ) gen_vector_table15 ( s , sel_vector_table ) ;
else gen_vector_table16 ( s , sel_vector_table ) ;
}
s -> mb_change_bits = s -> buf + header . header_size ;
if ( s -> flags & FLAG_KEYFRAME ) {
s -> index_stream = s -> mb_change_bits ;
}
else {
s -> index_stream = s -> mb_change_bits + ( s -> mb_change_bits_row_size * ( s -> avctx -> height >> 2 ) ) ;
}
s -> index_stream_size = s -> size - ( s -> index_stream - s -> buf ) ;
s -> last_deltaset = header . deltaset ;
s -> last_vectable = header . vectable ;
s -> compression = header . compression ;
s -> block_width = compression_types [ header . compression ] . block_width ;
s -> block_height = compression_types [ header . compression ] . block_height ;
s -> block_type = compression_types [ header . compression ] . block_type ;
if ( s -> avctx -> debug & FF_DEBUG_PICT_INFO ) av_log ( s -> avctx , AV_LOG_INFO , "tables: %d / %d c:%d %dx%d t:%d %s%s%s%s\n" , s -> last_deltaset , s -> last_vectable , s -> compression , s -> block_width , s -> block_height , s -> block_type , s -> flags & FLAG_KEYFRAME ? " KEY" : "" , s -> flags & FLAG_INTERFRAME ? " INTER" : "" , s -> flags & FLAG_SPRITE ? " SPRITE" : "" , s -> flags & FLAG_INTERPOLATED ? " INTERPOL" : "" ) ;
return header . header_size ;
} |
6,336,384,260,629,386,000 | debian | 7 | 0 | static void dissect_zcl_ota_file_version_field ( tvbuff_t * tvb , proto_tree * tree , guint * offset ) {
static const int * file_version [ ] = {
& hf_zbee_zcl_ota_file_version_appl_release , & hf_zbee_zcl_ota_file_version_appl_build , & hf_zbee_zcl_ota_file_version_stack_release , & hf_zbee_zcl_ota_file_version_stack_build , NULL }
;
proto_tree_add_bitmask ( tree , tvb , * offset , hf_zbee_zcl_ota_file_version , ett_zbee_zcl_ota_file_version , file_version , ENC_BIG_ENDIAN ) ;
* offset += 4 ;
} |
-5,082,285,935,423,529,000 | debian | 21 | 0 | static int dissect_rsl_ie_grp_call_ref ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , int offset , gboolean is_mandatory ) {
proto_item * ti ;
proto_tree * ie_tree ;
guint length ;
guint8 ie_id ;
if ( is_mandatory == FALSE ) {
ie_id = tvb_get_guint8 ( tvb , offset ) ;
if ( ie_id != RSL_IE_GRP_CALL_REF ) return offset ;
}
ie_tree = proto_tree_add_subtree ( tree , tvb , offset , 0 , ett_ie_grp_call_ref , & ti , "Group call reference IE" ) ;
proto_tree_add_item ( ie_tree , hf_rsl_ie_id , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
length = tvb_get_guint8 ( tvb , offset ) ;
proto_item_set_len ( ti , length + 2 ) ;
proto_tree_add_item ( ie_tree , hf_rsl_ie_length , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( ie_tree , hf_rsl_descriptive_group_or_broadcast_call_reference , tvb , offset , length , ENC_NA ) ;
de_d_gb_call_ref ( tvb , ie_tree , pinfo , offset , length , NULL , 0 ) ;
offset = offset + length ;
return offset ;
} |
-7,795,592,811,940,875,000 | debian | 131 | 0 | static gcry_err_code_t sexp_to_enc ( gcry_sexp_t sexp , gcry_mpi_t * * retarray , gcry_module_t * retalgo , int * ret_modern , int * flags , struct pk_encoding_ctx * ctx ) {
gcry_err_code_t err = 0 ;
gcry_sexp_t list = NULL , l2 = NULL ;
gcry_pk_spec_t * pubkey = NULL ;
gcry_module_t module = NULL ;
char * name = NULL ;
size_t n ;
int parsed_flags = 0 ;
const char * elems ;
gcry_mpi_t * array = NULL ;
* ret_modern = 0 ;
list = gcry_sexp_find_token ( sexp , "enc-val" , 0 ) ;
if ( ! list ) {
err = GPG_ERR_INV_OBJ ;
goto leave ;
}
l2 = gcry_sexp_nth ( list , 1 ) ;
if ( ! l2 ) {
err = GPG_ERR_NO_OBJ ;
goto leave ;
}
name = _gcry_sexp_nth_string ( l2 , 0 ) ;
if ( ! name ) {
err = GPG_ERR_INV_OBJ ;
goto leave ;
}
if ( ! strcmp ( name , "flags" ) ) {
const char * s ;
int i ;
* ret_modern = 1 ;
for ( i = gcry_sexp_length ( l2 ) - 1 ;
i > 0 ;
i -- ) {
s = gcry_sexp_nth_data ( l2 , i , & n ) ;
if ( ! s ) ;
else if ( n == 3 && ! memcmp ( s , "raw" , 3 ) && ctx -> encoding == PUBKEY_ENC_UNKNOWN ) ctx -> encoding = PUBKEY_ENC_RAW ;
else if ( n == 5 && ! memcmp ( s , "pkcs1" , 5 ) && ctx -> encoding == PUBKEY_ENC_UNKNOWN ) ctx -> encoding = PUBKEY_ENC_PKCS1 ;
else if ( n == 4 && ! memcmp ( s , "oaep" , 4 ) && ctx -> encoding == PUBKEY_ENC_UNKNOWN ) ctx -> encoding = PUBKEY_ENC_OAEP ;
else if ( n == 3 && ! memcmp ( s , "pss" , 3 ) && ctx -> encoding == PUBKEY_ENC_UNKNOWN ) {
err = GPG_ERR_CONFLICT ;
goto leave ;
}
else if ( n == 11 && ! memcmp ( s , "no-blinding" , 11 ) ) parsed_flags |= PUBKEY_FLAG_NO_BLINDING ;
else {
err = GPG_ERR_INV_FLAG ;
goto leave ;
}
}
gcry_sexp_release ( l2 ) ;
if ( ctx -> encoding == PUBKEY_ENC_OAEP ) {
l2 = gcry_sexp_find_token ( list , "hash-algo" , 0 ) ;
if ( l2 ) {
s = gcry_sexp_nth_data ( l2 , 1 , & n ) ;
if ( ! s ) err = GPG_ERR_NO_OBJ ;
else {
ctx -> hash_algo = get_hash_algo ( s , n ) ;
if ( ! ctx -> hash_algo ) err = GPG_ERR_DIGEST_ALGO ;
}
gcry_sexp_release ( l2 ) ;
if ( err ) goto leave ;
}
l2 = gcry_sexp_find_token ( list , "label" , 0 ) ;
if ( l2 ) {
s = gcry_sexp_nth_data ( l2 , 1 , & n ) ;
if ( ! s ) err = GPG_ERR_NO_OBJ ;
else if ( n > 0 ) {
ctx -> label = gcry_malloc ( n ) ;
if ( ! ctx -> label ) err = gpg_err_code_from_syserror ( ) ;
else {
memcpy ( ctx -> label , s , n ) ;
ctx -> labellen = n ;
}
}
gcry_sexp_release ( l2 ) ;
if ( err ) goto leave ;
}
}
for ( i = 2 ;
( l2 = gcry_sexp_nth ( list , i ) ) != NULL ;
i ++ ) {
s = gcry_sexp_nth_data ( l2 , 0 , & n ) ;
if ( ! ( n == 9 && ! memcmp ( s , "hash-algo" , 9 ) ) && ! ( n == 5 && ! memcmp ( s , "label" , 5 ) ) && ! ( n == 15 && ! memcmp ( s , "random-override" , 15 ) ) ) break ;
gcry_sexp_release ( l2 ) ;
}
if ( ! l2 ) {
err = GPG_ERR_NO_OBJ ;
goto leave ;
}
gcry_free ( name ) ;
name = _gcry_sexp_nth_string ( l2 , 0 ) ;
if ( ! name ) {
err = GPG_ERR_INV_OBJ ;
goto leave ;
}
gcry_sexp_release ( list ) ;
list = l2 ;
l2 = NULL ;
}
ath_mutex_lock ( & pubkeys_registered_lock ) ;
module = gcry_pk_lookup_name ( name ) ;
ath_mutex_unlock ( & pubkeys_registered_lock ) ;
if ( ! module ) {
err = GPG_ERR_PUBKEY_ALGO ;
goto leave ;
}
pubkey = ( gcry_pk_spec_t * ) module -> spec ;
elems = pubkey -> elements_enc ;
array = gcry_calloc ( strlen ( elems ) + 1 , sizeof ( * array ) ) ;
if ( ! array ) {
err = gpg_err_code_from_syserror ( ) ;
goto leave ;
}
err = sexp_elements_extract ( list , elems , array , NULL , 0 ) ;
leave : gcry_sexp_release ( list ) ;
gcry_sexp_release ( l2 ) ;
gcry_free ( name ) ;
if ( err ) {
ath_mutex_lock ( & pubkeys_registered_lock ) ;
_gcry_module_release ( module ) ;
ath_mutex_unlock ( & pubkeys_registered_lock ) ;
gcry_free ( array ) ;
gcry_free ( ctx -> label ) ;
ctx -> label = NULL ;
}
else {
* retarray = array ;
* retalgo = module ;
* flags = parsed_flags ;
}
return err ;
} |
7,909,110,399,479,437,000 | chrome | 3 | 0 | hb_bool_t hb_set_next_range ( const hb_set_t * set , hb_codepoint_t * first , hb_codepoint_t * last ) {
return set -> next_range ( first , last ) ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_OpenLogicalChannelRejectCause ( 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_OpenLogicalChannelRejectCause , OpenLogicalChannelRejectCause_choice , NULL ) ;
return offset ;
} |
8,484,475,213,808,847,000 | debian | 10 | 0 | static void qbus_list_bus ( DeviceState * dev , char * dest , int len ) {
BusState * child ;
const char * sep = " " ;
int pos = 0 ;
pos += snprintf ( dest + pos , len - pos , "child busses at \"%s\":" , dev -> id ? dev -> id : dev -> info -> name ) ;
QLIST_FOREACH ( child , & dev -> child_bus , sibling ) {
pos += snprintf ( dest + pos , len - pos , "%s\"%s\"" , sep , child -> name ) ;
sep = ", " ;
}
} |
6,336,384,260,629,386,000 | debian | 15 | 0 | static void dissect_zcl_ota_querynextimagersp ( tvbuff_t * tvb , proto_tree * tree , guint * offset ) {
guint8 status ;
status = tvb_get_guint8 ( tvb , * offset ) ;
proto_tree_add_item ( tree , hf_zbee_zcl_ota_status , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
if ( status == ZBEE_ZCL_STAT_SUCCESS ) {
proto_tree_add_item ( tree , hf_zbee_zcl_ota_manufacturer_code , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
proto_tree_add_item ( tree , hf_zbee_zcl_ota_image_type , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
dissect_zcl_ota_file_version_field ( tvb , tree , offset ) ;
proto_tree_add_item ( tree , hf_zbee_zcl_ota_image_size , tvb , * offset , 4 , ENC_LITTLE_ENDIAN ) ;
* offset += 4 ;
}
} |
5,400,542,917,484,464,000 | chrome | 60 | 0 | vpx_codec_err_t vpx_svc_init ( SvcContext * svc_ctx , vpx_codec_ctx_t * codec_ctx , vpx_codec_iface_t * iface , vpx_codec_enc_cfg_t * enc_cfg ) {
vpx_codec_err_t res ;
int i ;
SvcInternal * const si = get_svc_internal ( svc_ctx ) ;
if ( svc_ctx == NULL || codec_ctx == NULL || iface == NULL || enc_cfg == NULL ) {
return VPX_CODEC_INVALID_PARAM ;
}
if ( si == NULL ) return VPX_CODEC_MEM_ERROR ;
si -> codec_ctx = codec_ctx ;
si -> width = enc_cfg -> g_w ;
si -> height = enc_cfg -> g_h ;
if ( enc_cfg -> kf_max_dist < 2 ) {
svc_log ( svc_ctx , SVC_LOG_ERROR , "key frame distance too small: %d\n" , enc_cfg -> kf_max_dist ) ;
return VPX_CODEC_INVALID_PARAM ;
}
si -> kf_dist = enc_cfg -> kf_max_dist ;
if ( svc_ctx -> spatial_layers == 0 ) svc_ctx -> spatial_layers = VPX_SS_DEFAULT_LAYERS ;
if ( svc_ctx -> spatial_layers < 1 || svc_ctx -> spatial_layers > VPX_SS_MAX_LAYERS ) {
svc_log ( svc_ctx , SVC_LOG_ERROR , "spatial layers: invalid value: %d\n" , svc_ctx -> spatial_layers ) ;
return VPX_CODEC_INVALID_PARAM ;
}
for ( i = 0 ;
i < VPX_SS_MAX_LAYERS ;
++ i ) {
si -> svc_params . max_quantizers [ i ] = MAX_QUANTIZER ;
si -> svc_params . min_quantizers [ i ] = 0 ;
si -> svc_params . scaling_factor_num [ i ] = DEFAULT_SCALE_FACTORS_NUM [ i ] ;
si -> svc_params . scaling_factor_den [ i ] = DEFAULT_SCALE_FACTORS_DEN [ i ] ;
}
res = parse_options ( svc_ctx , si -> options ) ;
if ( res != VPX_CODEC_OK ) return res ;
if ( svc_ctx -> spatial_layers < 1 ) svc_ctx -> spatial_layers = 1 ;
if ( svc_ctx -> spatial_layers > VPX_SS_MAX_LAYERS ) svc_ctx -> spatial_layers = VPX_SS_MAX_LAYERS ;
if ( svc_ctx -> temporal_layers < 1 ) svc_ctx -> temporal_layers = 1 ;
if ( svc_ctx -> temporal_layers > VPX_TS_MAX_LAYERS ) svc_ctx -> temporal_layers = VPX_TS_MAX_LAYERS ;
assign_layer_bitrates ( svc_ctx , enc_cfg ) ;
# if CONFIG_SPATIAL_SVC for ( i = 0 ;
i < svc_ctx -> spatial_layers ;
++ i ) enc_cfg -> ss_enable_auto_alt_ref [ i ] = si -> enable_auto_alt_ref [ i ] ;
# endif if ( svc_ctx -> temporal_layers > 1 ) {
int i ;
for ( i = 0 ;
i < svc_ctx -> temporal_layers ;
++ i ) {
enc_cfg -> ts_target_bitrate [ i ] = enc_cfg -> rc_target_bitrate / svc_ctx -> temporal_layers ;
enc_cfg -> ts_rate_decimator [ i ] = 1 << ( svc_ctx -> temporal_layers - 1 - i ) ;
}
}
enc_cfg -> ss_number_layers = svc_ctx -> spatial_layers ;
enc_cfg -> ts_number_layers = svc_ctx -> temporal_layers ;
if ( enc_cfg -> g_error_resilient == 0 && si -> use_multiple_frame_contexts == 0 ) enc_cfg -> g_error_resilient = 1 ;
res = vpx_codec_enc_init ( codec_ctx , iface , enc_cfg , VPX_CODEC_USE_PSNR ) ;
if ( res != VPX_CODEC_OK ) {
svc_log ( svc_ctx , SVC_LOG_ERROR , "svc_enc_init error\n" ) ;
return res ;
}
vpx_codec_control ( codec_ctx , VP9E_SET_SVC , 1 ) ;
vpx_codec_control ( codec_ctx , VP9E_SET_SVC_PARAMETERS , & si -> svc_params ) ;
return VPX_CODEC_OK ;
} |
3,557,739,556,029,059,000 | chrome | 13 | 0 | void vp9_sad ## m ## x ## n ## x ## k ## _c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sads ) {
int i ;
for ( i = 0 ;
i < k ;
++ i ) sads [ i ] = vp9_sad ## m ## x ## n ## _c ( src , src_stride , & ref [ i ] , ref_stride ) ;
\ }
# define sadMxNx4D ( m , n ) void vp9_sad ## m ## x ## n ## x4d_c ( const uint8_t * src , int src_stride , const uint8_t * const refs [ ] , int ref_stride , unsigned int * sads ) {
int i ;
for ( i = 0 ;
i < 4 ;
++ i ) sads [ i ] = vp9_sad ## m ## x ## n ## _c ( src , src_stride , refs [ i ] , ref_stride ) ;
\ }
sadMxN ( 64 , 64 ) sadMxNxK ( 64 , 64 , 3 ) sadMxNxK ( 64 , 64 , 8 ) sadMxNx4D ( 64 , 64 ) sadMxN ( 64 , 32 ) sadMxNx4D ( 64 , 32 ) sadMxN ( 32 , 64 ) sadMxNx4D ( 32 , 64 ) sadMxN ( 32 , 32 ) sadMxNxK ( 32 , 32 , 3 ) sadMxNxK ( 32 , 32 , 8 ) sadMxNx4D ( 32 , 32 ) sadMxN ( 32 , 16 ) sadMxNx4D ( 32 , 16 ) sadMxN ( 16 , 32 ) sadMxNx4D ( 16 , 32 ) sadMxN ( 16 , 16 ) sadMxNxK ( 16 , 16 , 3 ) sadMxNxK ( 16 , 16 , 8 ) sadMxNx4D ( 16 , 16 ) sadMxN ( 16 , 8 ) sadMxNxK ( 16 , 8 , 3 ) |
1,667,027,354,487,746,000 | chrome | 36 | 1 | hb_shape_plan_t * hb_shape_plan_create_cached ( hb_face_t * face , const hb_segment_properties_t * props , const hb_feature_t * user_features , unsigned int num_user_features , const char * const * shaper_list ) {
DEBUG_MSG_FUNC ( SHAPE_PLAN , NULL , "face=%p num_features=%d shaper_list=%p" , face , num_user_features , shaper_list ) ;
hb_shape_plan_proposal_t proposal = {
* props , shaper_list , user_features , num_user_features , NULL }
;
if ( shaper_list ) {
for ( const char * const * shaper_item = shaper_list ;
* shaper_item ;
shaper_item ++ ) if ( 0 ) ;
# define HB_SHAPER_IMPLEMENT ( shaper ) else if ( 0 == strcmp ( * shaper_item , # shaper ) && hb_ ## shaper ## _shaper_face_data_ensure ( face ) ) {
proposal . shaper_func = _hb_ ## shaper ## _shape ;
break ;
}
# include "hb-shaper-list.hh" # undef HB_SHAPER_IMPLEMENT if ( unlikely ( ! proposal . shaper_func ) ) return hb_shape_plan_get_empty ( ) ;
}
retry : hb_face_t : : plan_node_t * cached_plan_nodes = ( hb_face_t : : plan_node_t * ) hb_atomic_ptr_get ( & face -> shape_plans ) ;
for ( hb_face_t : : plan_node_t * node = cached_plan_nodes ;
node ;
node = node -> next ) if ( hb_shape_plan_matches ( node -> shape_plan , & proposal ) ) {
DEBUG_MSG_FUNC ( SHAPE_PLAN , node -> shape_plan , "fulfilled from cache" ) ;
return hb_shape_plan_reference ( node -> shape_plan ) ;
}
hb_shape_plan_t * shape_plan = hb_shape_plan_create ( face , props , user_features , num_user_features , shaper_list ) ;
if ( hb_non_global_user_features_present ( user_features , num_user_features ) ) return shape_plan ;
hb_face_t : : plan_node_t * node = ( hb_face_t : : plan_node_t * ) calloc ( 1 , sizeof ( hb_face_t : : plan_node_t ) ) ;
if ( unlikely ( ! node ) ) return shape_plan ;
node -> shape_plan = shape_plan ;
node -> next = cached_plan_nodes ;
if ( ! hb_atomic_ptr_cmpexch ( & face -> shape_plans , cached_plan_nodes , node ) ) {
hb_shape_plan_destroy ( shape_plan ) ;
free ( node ) ;
goto retry ;
}
DEBUG_MSG_FUNC ( SHAPE_PLAN , shape_plan , "inserted into cache" ) ;
return hb_shape_plan_reference ( shape_plan ) ;
} |
-789,251,383,577,298,300 | debian | 7 | 0 | int BIO_vsnprintf ( char * buf , size_t n , const char * format , va_list args ) {
size_t retlen ;
int truncated ;
if ( ! _dopr ( & buf , NULL , & n , & retlen , & truncated , format , args ) ) return - 1 ;
if ( truncated ) return - 1 ;
else return ( retlen <= INT_MAX ) ? ( int ) retlen : - 1 ;
} |
4,180,964,683,905,831,000 | debian | 6 | 0 | static void selinux_inet_csk_clone ( struct sock * newsk , const struct request_sock * req ) {
struct sk_security_struct * newsksec = newsk -> sk_security ;
newsksec -> sid = req -> secid ;
newsksec -> peer_sid = req -> peer_secid ;
selinux_netlbl_inet_csk_clone ( newsk , req -> rsk_ops -> family ) ;
} |
4,491,846,291,755,990,500 | chrome | 59 | 1 | static void TestHeapFunctions ( ) {
UErrorCode status = U_ZERO_ERROR ;
UResourceBundle * rb = NULL ;
char * icuDataDir ;
UVersionInfo unicodeVersion = {
0 , 0 , 0 , 0 }
;
icuDataDir = safeGetICUDataDirectory ( ) ;
ctest_resetICU ( ) ;
u_setMemoryFunctions ( & gContext , myMemAlloc , myMemRealloc , myMemFree , & status ) ;
TEST_STATUS ( status , U_INVALID_STATE_ERROR ) ;
u_cleanup ( ) ;
status = U_ZERO_ERROR ;
u_setMemoryFunctions ( & gContext , NULL , myMemRealloc , myMemFree , & status ) ;
TEST_STATUS ( status , U_ILLEGAL_ARGUMENT_ERROR ) ;
status = U_ZERO_ERROR ;
u_setMemoryFunctions ( & gContext , myMemAlloc , NULL , myMemFree , & status ) ;
TEST_STATUS ( status , U_ILLEGAL_ARGUMENT_ERROR ) ;
status = U_ZERO_ERROR ;
u_setMemoryFunctions ( & gContext , myMemAlloc , myMemRealloc , NULL , & status ) ;
TEST_STATUS ( status , U_ILLEGAL_ARGUMENT_ERROR ) ;
status = U_ZERO_ERROR ;
u_setMemoryFunctions ( NULL , myMemAlloc , myMemRealloc , myMemFree , & status ) ;
TEST_STATUS ( status , U_ZERO_ERROR ) ;
u_setMemoryFunctions ( & gContext , myMemAlloc , myMemRealloc , myMemFree , & status ) ;
TEST_STATUS ( status , U_ZERO_ERROR ) ;
status = U_ZERO_ERROR ;
u_setDataDirectory ( icuDataDir ) ;
u_init ( & status ) ;
TEST_STATUS ( status , U_ZERO_ERROR ) ;
u_setMemoryFunctions ( NULL , myMemAlloc , myMemRealloc , myMemFree , & status ) ;
TEST_STATUS ( status , U_INVALID_STATE_ERROR ) ;
gBlockCount = 0 ;
status = U_ZERO_ERROR ;
rb = ures_open ( NULL , "es" , & status ) ;
TEST_STATUS ( status , U_ZERO_ERROR ) ;
if ( gBlockCount == 0 ) {
log_err ( "Heap functions are not being called from ICU.\n" ) ;
}
ures_close ( rb ) ;
ctest_resetICU ( ) ;
u_getUnicodeVersion ( unicodeVersion ) ;
if ( unicodeVersion [ 0 ] <= 0 ) {
log_err ( "Properties doesn't reinitialize without u_init.\n" ) ;
}
status = U_ZERO_ERROR ;
u_init ( & status ) ;
TEST_STATUS ( status , U_ZERO_ERROR ) ;
gBlockCount = 0 ;
status = U_ZERO_ERROR ;
rb = ures_open ( NULL , "fr" , & status ) ;
TEST_STATUS ( status , U_ZERO_ERROR ) ;
if ( gBlockCount != 0 ) {
log_err ( "Heap functions did not reset after u_cleanup.\n" ) ;
}
ures_close ( rb ) ;
free ( icuDataDir ) ;
ctest_resetICU ( ) ;
} |
5,976,900,907,644,301,000 | debian | 73 | 0 | static void dissect_applemidi_common ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , guint16 command ) {
guint16 seq_num ;
guint8 count ;
guint8 * name ;
gint offset = 0 ;
gint len ;
gint string_size ;
proto_tree * applemidi_tree ;
proto_tree * applemidi_tree_seq_num ;
col_set_str ( pinfo -> cinfo , COL_PROTOCOL , APPLEMIDI_DISSECTOR_SHORTNAME ) ;
col_add_fstr ( pinfo -> cinfo , COL_INFO , "%s" , val_to_str ( command , applemidi_commands , applemidi_unknown_command ) ) ;
if ( tree ) {
proto_item * ti ;
ti = proto_tree_add_item ( tree , proto_applemidi , tvb , 0 , - 1 , ENC_NA ) ;
applemidi_tree = proto_item_add_subtree ( ti , ett_applemidi ) ;
proto_tree_add_item ( applemidi_tree , hf_applemidi_signature , tvb , offset , 2 , ENC_BIG_ENDIAN ) ;
offset += 2 ;
proto_tree_add_item ( applemidi_tree , hf_applemidi_command , tvb , offset , 2 , ENC_BIG_ENDIAN ) ;
offset += 2 ;
if ( ( APPLEMIDI_COMMAND_INVITATION == command ) || ( APPLEMIDI_COMMAND_INVITATION_REJECTED == command ) || ( APLLEMIDI_COMMAND_INVITATION_ACCEPTED == command ) || ( APPLEMIDI_COMMAND_ENDSESSION == command ) ) {
proto_tree_add_item ( applemidi_tree , hf_applemidi_protocol_version , tvb , offset , 4 , ENC_BIG_ENDIAN ) ;
offset += 4 ;
proto_tree_add_item ( applemidi_tree , hf_applemidi_token , tvb , offset , 4 , ENC_BIG_ENDIAN ) ;
offset += 4 ;
proto_tree_add_item ( applemidi_tree , hf_applemidi_ssrc , tvb , offset , 4 , ENC_BIG_ENDIAN ) ;
offset += 4 ;
len = tvb_reported_length ( tvb ) - offset ;
if ( len > 0 ) {
name = tvb_get_string_enc ( wmem_packet_scope ( ) , tvb , offset , len , ENC_UTF_8 | ENC_NA ) ;
string_size = ( gint ) ( strlen ( name ) + 1 ) ;
proto_tree_add_item ( applemidi_tree , hf_applemidi_name , tvb , offset , string_size , ENC_UTF_8 | ENC_NA ) ;
col_append_fstr ( pinfo -> cinfo , COL_INFO , ": peer = \"%s\"" , name ) ;
offset += string_size ;
}
}
else if ( APPLEMIDI_COMMAND_SYNCHRONIZATION == command ) {
proto_tree_add_item ( applemidi_tree , hf_applemidi_ssrc , tvb , offset , 4 , ENC_BIG_ENDIAN ) ;
offset += 4 ;
count = tvb_get_guint8 ( tvb , offset ) ;
proto_tree_add_item ( applemidi_tree , hf_applemidi_count , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
col_append_fstr ( pinfo -> cinfo , COL_INFO , ": count = %u" , count ) ;
offset += 1 ;
proto_tree_add_item ( applemidi_tree , hf_applemidi_padding , tvb , offset , 3 , ENC_BIG_ENDIAN ) ;
offset += 3 ;
proto_tree_add_item ( applemidi_tree , hf_applemidi_timestamp1 , tvb , offset , 8 , ENC_BIG_ENDIAN ) ;
offset += 8 ;
proto_tree_add_item ( applemidi_tree , hf_applemidi_timestamp2 , tvb , offset , 8 , ENC_BIG_ENDIAN ) ;
offset += 8 ;
proto_tree_add_item ( applemidi_tree , hf_applemidi_timestamp3 , tvb , offset , 8 , ENC_BIG_ENDIAN ) ;
offset += 8 ;
}
else if ( APPLEMIDI_COMMAND_RECEIVER_FEEDBACK == command ) {
proto_tree_add_item ( applemidi_tree , hf_applemidi_ssrc , tvb , offset , 4 , ENC_BIG_ENDIAN ) ;
offset += 4 ;
ti = proto_tree_add_item ( applemidi_tree , hf_applemidi_sequence_num , tvb , offset , 4 , ENC_BIG_ENDIAN ) ;
applemidi_tree_seq_num = proto_item_add_subtree ( ti , ett_applemidi_seq_num ) ;
seq_num = tvb_get_ntohs ( tvb , offset ) ;
proto_tree_add_uint ( applemidi_tree_seq_num , hf_applemidi_rtp_sequence_num , tvb , offset , 2 , seq_num ) ;
offset += 4 ;
col_append_fstr ( pinfo -> cinfo , COL_INFO , ": seq = %u" , seq_num ) ;
}
else if ( APPLEMIDI_COMMAND_BITRATE_RECEIVE_LIMIT == command ) {
proto_tree_add_item ( applemidi_tree , hf_applemidi_ssrc , tvb , offset , 4 , ENC_BIG_ENDIAN ) ;
offset += 4 ;
proto_tree_add_item ( applemidi_tree , hf_applemidi_rtp_bitrate_limit , tvb , offset , 4 , ENC_BIG_ENDIAN ) ;
offset += 4 ;
}
len = tvb_length_remaining ( tvb , offset ) ;
if ( len > 0 ) {
proto_tree_add_item ( applemidi_tree , hf_applemidi_unknown_data , tvb , offset , len , ENC_NA ) ;
}
}
} |
1,760,449,185,745,615,400 | debian | 4 | 0 | TSUuid TSUuidCreate ( void ) {
ATSUuid * uuid = new ATSUuid ( ) ;
return ( TSUuid ) uuid ;
} |
-4,558,261,210,024,070,700 | chrome | 4 | 0 | int xmlListEmpty ( xmlListPtr l ) {
if ( l == NULL ) return ( - 1 ) ;
return ( l -> sentinel -> next == l -> sentinel ) ;
} |
594,127,775,011,357,000 | debian | 96 | 0 | static void ImportBlackQuantum ( const Image * image , QuantumInfo * quantum_info , const MagickSizeType number_pixels , const unsigned char * magick_restrict p , Quantum * magick_restrict q , ExceptionInfo * exception ) {
QuantumAny range ;
register ssize_t x ;
unsigned int pixel ;
if ( image -> colorspace != CMYKColorspace ) {
( void ) ThrowMagickException ( exception , GetMagickModule ( ) , ImageError , "ColorSeparatedImageRequired" , "`%s'" , image -> filename ) ;
return ;
}
switch ( quantum_info -> depth ) {
case 8 : {
unsigned char pixel ;
for ( x = 0 ;
x < ( ssize_t ) number_pixels ;
x ++ ) {
p = PushCharPixel ( p , & pixel ) ;
SetPixelBlack ( image , ScaleCharToQuantum ( pixel ) , q ) ;
p += quantum_info -> pad ;
q += GetPixelChannels ( image ) ;
}
break ;
}
case 16 : {
unsigned short pixel ;
if ( quantum_info -> format == FloatingPointQuantumFormat ) {
for ( x = 0 ;
x < ( ssize_t ) number_pixels ;
x ++ ) {
p = PushShortPixel ( quantum_info -> endian , p , & pixel ) ;
SetPixelBlack ( image , ClampToQuantum ( QuantumRange * HalfToSinglePrecision ( pixel ) ) , q ) ;
p += quantum_info -> pad ;
q += GetPixelChannels ( image ) ;
}
break ;
}
for ( x = 0 ;
x < ( ssize_t ) number_pixels ;
x ++ ) {
p = PushShortPixel ( quantum_info -> endian , p , & pixel ) ;
SetPixelBlack ( image , ScaleShortToQuantum ( pixel ) , q ) ;
p += quantum_info -> pad ;
q += GetPixelChannels ( image ) ;
}
break ;
}
case 32 : {
unsigned int pixel ;
if ( quantum_info -> format == FloatingPointQuantumFormat ) {
float pixel ;
for ( x = 0 ;
x < ( ssize_t ) number_pixels ;
x ++ ) {
p = PushFloatPixel ( quantum_info , p , & pixel ) ;
SetPixelBlack ( image , ClampToQuantum ( pixel ) , q ) ;
p += quantum_info -> pad ;
q += GetPixelChannels ( image ) ;
}
break ;
}
for ( x = 0 ;
x < ( ssize_t ) number_pixels ;
x ++ ) {
p = PushLongPixel ( quantum_info -> endian , p , & pixel ) ;
SetPixelBlack ( image , ScaleLongToQuantum ( pixel ) , q ) ;
p += quantum_info -> pad ;
q += GetPixelChannels ( image ) ;
}
break ;
}
case 64 : {
if ( quantum_info -> format == FloatingPointQuantumFormat ) {
double pixel ;
for ( x = 0 ;
x < ( ssize_t ) number_pixels ;
x ++ ) {
p = PushDoublePixel ( quantum_info , p , & pixel ) ;
SetPixelBlack ( image , ClampToQuantum ( pixel ) , q ) ;
p += quantum_info -> pad ;
q += GetPixelChannels ( image ) ;
}
break ;
}
}
default : {
range = GetQuantumRange ( quantum_info -> depth ) ;
for ( x = 0 ;
x < ( ssize_t ) number_pixels ;
x ++ ) {
p = PushQuantumPixel ( quantum_info , p , & pixel ) ;
SetPixelBlack ( image , ScaleAnyToQuantum ( pixel , range ) , q ) ;
p += quantum_info -> pad ;
q += GetPixelChannels ( image ) ;
}
break ;
}
}
} |