hash
int64 -9,197,960,073,880,366,000
9,199,363,627B
| project
stringclasses 2
values | size
int64 2
5.68k
| label
int64 0
1
| functionSource
stringlengths 31
235k
|
---|---|---|---|---|
8,445,816,931,248,660,000 | debian | 3 | 0 | static long spl_ptr_llist_count ( spl_ptr_llist * llist ) {
return ( long ) llist -> count ;
} |
1,312,888,211,311,687,000 | debian | 3 | 0 | int lbmpdm_get_minimum_length ( void ) {
return ( L_LBMPDM_MSG_HDR_T ) ;
} |
3,584,320,764,213,684,000 | debian | 21 | 0 | static int parse_CAggregSet ( tvbuff_t * tvb , int offset , proto_tree * parent_tree , proto_tree * pad_tree , const char * fmt , ... ) {
guint32 cCount , i ;
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_CAggregSet , & item , txt ) ;
cCount = tvb_get_letohl ( tvb , offset ) ;
proto_tree_add_uint ( tree , hf_mswsp_caggregset_count , tvb , offset , 4 , cCount ) ;
offset += 4 ;
for ( i = 0 ;
i < cCount ;
i ++ ) {
offset = parse_CAggregSpec ( tvb , offset , tree , pad_tree , "AggregSpecs[%u]" , i ) ;
}
proto_item_set_end ( item , tvb , offset ) ;
return offset ;
} |
5,357,882,892,791,796,000 | debian | 15 | 0 | static inline void e1000e_write_rx_descr ( E1000ECore * core , uint8_t * desc , struct NetRxPkt * pkt , const E1000E_RSSInfo * rss_info , size_t ps_hdr_len , uint16_t ( * written ) [ MAX_PS_BUFFERS ] ) {
if ( e1000e_rx_use_legacy_descriptor ( core ) ) {
assert ( ps_hdr_len == 0 ) ;
e1000e_write_lgcy_rx_descr ( core , desc , pkt , rss_info , ( * written ) [ 0 ] ) ;
}
else {
if ( core -> mac [ RCTL ] & E1000_RCTL_DTYP_PS ) {
e1000e_write_ps_rx_descr ( core , desc , pkt , rss_info , ps_hdr_len , written ) ;
}
else {
assert ( ps_hdr_len == 0 ) ;
e1000e_write_ext_rx_descr ( core , desc , pkt , rss_info , ( * written ) [ 0 ] ) ;
}
}
} |
-7,553,540,414,561,819,000 | debian | 49 | 0 | int test_gf2m_mod_inv ( BIO * bp , BN_CTX * ctx ) {
BIGNUM * a , * b [ 2 ] , * c , * d ;
int i , j , ret = 0 ;
int p0 [ ] = {
163 , 7 , 6 , 3 , 0 , - 1 }
;
int p1 [ ] = {
193 , 15 , 0 , - 1 }
;
a = BN_new ( ) ;
b [ 0 ] = BN_new ( ) ;
b [ 1 ] = BN_new ( ) ;
c = BN_new ( ) ;
d = BN_new ( ) ;
BN_GF2m_arr2poly ( p0 , b [ 0 ] ) ;
BN_GF2m_arr2poly ( p1 , b [ 1 ] ) ;
for ( i = 0 ;
i < num0 ;
i ++ ) {
BN_bntest_rand ( a , 512 , 0 , 0 ) ;
for ( j = 0 ;
j < 2 ;
j ++ ) {
BN_GF2m_mod_inv ( c , a , b [ j ] , ctx ) ;
BN_GF2m_mod_mul ( d , a , c , b [ j ] , ctx ) ;
# if 0 if ( bp != NULL ) {
if ( ! results ) {
BN_print ( bp , a ) ;
BIO_puts ( bp , " * " ) ;
BN_print ( bp , c ) ;
BIO_puts ( bp , " - 1 % " ) ;
BN_print ( bp , b [ j ] ) ;
BIO_puts ( bp , "\n" ) ;
}
}
# endif if ( ! BN_is_one ( d ) ) {
fprintf ( stderr , "GF(2^m) modular inversion test failed!\n" ) ;
goto err ;
}
}
}
ret = 1 ;
err : BN_free ( a ) ;
BN_free ( b [ 0 ] ) ;
BN_free ( b [ 1 ] ) ;
BN_free ( c ) ;
BN_free ( d ) ;
return ret ;
} |
-5,082,285,935,423,529,000 | debian | 15 | 0 | static int dissect_rsl_ie_ch_no ( tvbuff_t * tvb , packet_info * pinfo _U_ , proto_tree * tree , int offset , gboolean is_mandatory ) {
proto_tree * ie_tree ;
guint8 ie_id ;
if ( is_mandatory == FALSE ) {
ie_id = tvb_get_guint8 ( tvb , offset ) ;
if ( ie_id != RSL_IE_CH_NO ) return offset ;
}
ie_tree = proto_tree_add_subtree ( tree , tvb , offset , 2 , ett_ie_ch_no , NULL , "Channel number IE " ) ;
proto_tree_add_item ( ie_tree , hf_rsl_ie_id , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( ie_tree , hf_rsl_ch_no_Cbits , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( ie_tree , hf_rsl_ch_no_TN , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
return offset ;
} |
-954,364,585,377,557,200 | debian | 13 | 0 | static void decode_pitch_vector ( AMRContext * p , const AMRNBSubframe * amr_subframe , const int subframe ) {
int pitch_lag_int , pitch_lag_frac ;
enum Mode mode = p -> cur_frame_mode ;
if ( p -> cur_frame_mode == MODE_12k2 ) {
decode_pitch_lag_1_6 ( & pitch_lag_int , & pitch_lag_frac , amr_subframe -> p_lag , p -> pitch_lag_int , subframe ) ;
}
else ff_decode_pitch_lag ( & pitch_lag_int , & pitch_lag_frac , amr_subframe -> p_lag , p -> pitch_lag_int , subframe , mode != MODE_4k75 && mode != MODE_5k15 , mode <= MODE_6k7 ? 4 : ( mode == MODE_7k95 ? 5 : 6 ) ) ;
p -> pitch_lag_int = pitch_lag_int ;
pitch_lag_frac <<= ( p -> cur_frame_mode != MODE_12k2 ) ;
pitch_lag_int += pitch_lag_frac > 0 ;
ff_acelp_interpolatef ( p -> excitation , p -> excitation + 1 - pitch_lag_int , ff_b60_sinc , 6 , pitch_lag_frac + 6 - 6 * ( pitch_lag_frac > 0 ) , 10 , AMR_SUBFRAME_SIZE ) ;
memcpy ( p -> pitch_vector , p -> excitation , AMR_SUBFRAME_SIZE * sizeof ( float ) ) ;
} |
2,636,502,839,178,711,600 | debian | 11 | 0 | static void dissect_coap_opt_proxy_scheme ( tvbuff_t * tvb , proto_item * head_item , proto_tree * subtree , gint offset , gint opt_length , int hf ) {
const guint8 * str = NULL ;
if ( opt_length == 0 ) {
str = nullstr ;
}
else {
str = tvb_get_string_enc ( wmem_packet_scope ( ) , tvb , offset , opt_length , ENC_ASCII ) ;
}
proto_tree_add_string ( subtree , hf , tvb , offset , opt_length , str ) ;
proto_item_append_text ( head_item , ": %s" , str ) ;
} |
3,246,343,243,711,264,300 | debian | 46 | 0 | static int read_dns ( int fd , int tun_fd , struct query * q ) {
struct sockaddr_in from ;
socklen_t addrlen ;
char packet [ 64 * 1024 ] ;
int r ;
# ifndef WINDOWS32 char address [ 96 ] ;
struct msghdr msg ;
struct iovec iov ;
struct cmsghdr * cmsg ;
addrlen = sizeof ( struct sockaddr ) ;
iov . iov_base = packet ;
iov . iov_len = sizeof ( packet ) ;
msg . msg_name = ( caddr_t ) & from ;
msg . msg_namelen = ( unsigned ) addrlen ;
msg . msg_iov = & iov ;
msg . msg_iovlen = 1 ;
msg . msg_control = address ;
msg . msg_controllen = sizeof ( address ) ;
msg . msg_flags = 0 ;
r = recvmsg ( fd , & msg , 0 ) ;
# else addrlen = sizeof ( struct sockaddr ) ;
r = recvfrom ( fd , packet , sizeof ( packet ) , 0 , ( struct sockaddr * ) & from , & addrlen ) ;
# endif if ( r > 0 ) {
memcpy ( ( struct sockaddr * ) & q -> from , ( struct sockaddr * ) & from , addrlen ) ;
q -> fromlen = addrlen ;
if ( raw_decode ( packet , r , q , fd , tun_fd ) ) {
return 0 ;
}
if ( dns_decode ( NULL , 0 , q , QR_QUERY , packet , r ) < 0 ) {
return 0 ;
}
# ifndef WINDOWS32 for ( cmsg = CMSG_FIRSTHDR ( & msg ) ;
cmsg != NULL ;
cmsg = CMSG_NXTHDR ( & msg , cmsg ) ) {
if ( cmsg -> cmsg_level == IPPROTO_IP && cmsg -> cmsg_type == DSTADDR_SOCKOPT ) {
q -> destination = * dstaddr ( cmsg ) ;
break ;
}
}
# endif return strlen ( q -> name ) ;
}
else if ( r < 0 ) {
warn ( "read dns" ) ;
}
return 0 ;
} |
-3,053,641,395,158,209,000 | debian | 57 | 0 | static int x ( struct vcache * avc , int afun , struct vrequest * areq , \ struct afs_pdata * ain , struct afs_pdata * aout , \ afs_ucred_t * * acred ) DECL_PIOCTL ( PGetFID ) ;
DECL_PIOCTL ( PSetAcl ) ;
DECL_PIOCTL ( PStoreBehind ) ;
DECL_PIOCTL ( PGCPAGs ) ;
DECL_PIOCTL ( PGetAcl ) ;
DECL_PIOCTL ( PNoop ) ;
DECL_PIOCTL ( PBogus ) ;
DECL_PIOCTL ( PGetFileCell ) ;
DECL_PIOCTL ( PGetWSCell ) ;
DECL_PIOCTL ( PGetUserCell ) ;
DECL_PIOCTL ( PSetTokens ) ;
DECL_PIOCTL ( PGetVolumeStatus ) ;
DECL_PIOCTL ( PSetVolumeStatus ) ;
DECL_PIOCTL ( PFlush ) ;
DECL_PIOCTL ( PNewStatMount ) ;
DECL_PIOCTL ( PGetTokens ) ;
DECL_PIOCTL ( PUnlog ) ;
DECL_PIOCTL ( PMariner ) ;
DECL_PIOCTL ( PCheckServers ) ;
DECL_PIOCTL ( PCheckVolNames ) ;
DECL_PIOCTL ( PCheckAuth ) ;
DECL_PIOCTL ( PFindVolume ) ;
DECL_PIOCTL ( PViceAccess ) ;
DECL_PIOCTL ( PSetCacheSize ) ;
DECL_PIOCTL ( PGetCacheSize ) ;
DECL_PIOCTL ( PRemoveCallBack ) ;
DECL_PIOCTL ( PNewCell ) ;
DECL_PIOCTL ( PNewAlias ) ;
DECL_PIOCTL ( PListCells ) ;
DECL_PIOCTL ( PListAliases ) ;
DECL_PIOCTL ( PRemoveMount ) ;
DECL_PIOCTL ( PGetCellStatus ) ;
DECL_PIOCTL ( PSetCellStatus ) ;
DECL_PIOCTL ( PFlushVolumeData ) ;
DECL_PIOCTL ( PFlushAllVolumeData ) ;
DECL_PIOCTL ( PGetVnodeXStatus ) ;
DECL_PIOCTL ( PGetVnodeXStatus2 ) ;
DECL_PIOCTL ( PSetSysName ) ;
DECL_PIOCTL ( PSetSPrefs ) ;
DECL_PIOCTL ( PSetSPrefs33 ) ;
DECL_PIOCTL ( PGetSPrefs ) ;
DECL_PIOCTL ( PExportAfs ) ;
DECL_PIOCTL ( PGag ) ;
DECL_PIOCTL ( PTwiddleRx ) ;
DECL_PIOCTL ( PGetInitParams ) ;
DECL_PIOCTL ( PGetRxkcrypt ) ;
DECL_PIOCTL ( PSetRxkcrypt ) ;
DECL_PIOCTL ( PGetCPrefs ) ;
DECL_PIOCTL ( PSetCPrefs ) ;
DECL_PIOCTL ( PFlushMount ) ;
DECL_PIOCTL ( PRxStatProc ) ;
DECL_PIOCTL ( PRxStatPeer ) ;
DECL_PIOCTL ( PPrefetchFromTape ) ;
DECL_PIOCTL ( PFsCmd ) ;
DECL_PIOCTL ( PCallBackAddr ) ;
DECL_PIOCTL ( PDiscon ) ;
DECL_PIOCTL ( PNFSNukeCreds ) |
-8,054,970,867,770,516,000 | debian | 27 | 0 | static void compressed_sl_print ( netdissect_options * ndo , const u_char * chdr , const struct ip * ip , u_int length , int dir ) {
register const u_char * cp = chdr ;
register u_int flags , hlen ;
flags = * cp ++ ;
if ( flags & NEW_C ) {
lastconn = * cp ++ ;
ND_PRINT ( ( ndo , "ctcp %d" , lastconn ) ) ;
}
else ND_PRINT ( ( ndo , "ctcp *" ) ) ;
cp += 2 ;
switch ( flags & SPECIALS_MASK ) {
case SPECIAL_I : ND_PRINT ( ( ndo , " *SA+%d" , lastlen [ dir ] [ lastconn ] ) ) ;
break ;
case SPECIAL_D : ND_PRINT ( ( ndo , " *S+%d" , lastlen [ dir ] [ lastconn ] ) ) ;
break ;
default : if ( flags & NEW_U ) cp = print_sl_change ( ndo , "U=" , cp ) ;
if ( flags & NEW_W ) cp = print_sl_winchange ( ndo , cp ) ;
if ( flags & NEW_A ) cp = print_sl_change ( ndo , "A+" , cp ) ;
if ( flags & NEW_S ) cp = print_sl_change ( ndo , "S+" , cp ) ;
break ;
}
if ( flags & NEW_I ) cp = print_sl_change ( ndo , "I+" , cp ) ;
hlen = IP_HL ( ip ) ;
hlen += TH_OFF ( ( const struct tcphdr * ) & ( ( const int32_t * ) ip ) [ hlen ] ) ;
lastlen [ dir ] [ lastconn ] = length - ( hlen << 2 ) ;
ND_PRINT ( ( ndo , " %d (%ld)" , lastlen [ dir ] [ lastconn ] , ( long ) ( cp - chdr ) ) ) ;
} |
6,336,384,260,629,386,000 | debian | 11 | 0 | static void dissect_zcl_ota_upgradeendrsp ( tvbuff_t * tvb , proto_tree * tree , guint * offset ) {
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_current_time , tvb , * offset , 4 , ENC_LITTLE_ENDIAN ) ;
* offset += 4 ;
proto_tree_add_item ( tree , hf_zbee_zcl_ota_upgrade_time , tvb , * offset , 4 , ENC_LITTLE_ENDIAN ) ;
* offset += 4 ;
} |
-6,252,714,751,027,238,000 | debian | 33 | 0 | static byte * gs_heap_alloc_bytes ( gs_memory_t * mem , uint size , client_name_t cname ) {
gs_malloc_memory_t * mmem = ( gs_malloc_memory_t * ) mem ;
byte * ptr = 0 ;
# ifdef DEBUG const char * msg ;
static const char * const ok_msg = "OK" ;
# define set_msg ( str ) ( msg = ( str ) ) # else # define set_msg ( str ) DO_NOTHING # endif if ( mmem -> monitor ) gx_monitor_enter ( mmem -> monitor ) ;
if ( size > mmem -> limit - sizeof ( gs_malloc_block_t ) ) {
set_msg ( "exceeded limit" ) ;
}
else {
uint added = size + sizeof ( gs_malloc_block_t ) ;
if ( added <= size || mmem -> limit - added < mmem -> used ) set_msg ( "exceeded limit" ) ;
else if ( ( ptr = ( byte * ) Memento_label ( malloc ( added ) , cname ) ) == 0 ) set_msg ( "failed" ) ;
else {
gs_malloc_block_t * bp = ( gs_malloc_block_t * ) ptr ;
set_msg ( ok_msg ) ;
if ( mmem -> allocated ) mmem -> allocated -> prev = bp ;
bp -> next = mmem -> allocated ;
bp -> prev = 0 ;
bp -> size = size ;
bp -> type = & st_bytes ;
bp -> cname = cname ;
mmem -> allocated = bp ;
ptr = ( byte * ) ( bp + 1 ) ;
mmem -> used += size + sizeof ( gs_malloc_block_t ) ;
if ( mmem -> used > mmem -> max_used ) mmem -> max_used = mmem -> used ;
}
}
if ( mmem -> monitor ) gx_monitor_leave ( mmem -> monitor ) ;
if ( ptr ) gs_alloc_fill ( ptr , gs_alloc_fill_alloc , size ) ;
# ifdef DEBUG if ( gs_debug_c ( 'a' ) || msg != ok_msg ) dmlprintf6 ( mem , "[a+]gs_malloc(%s)(%u) = 0x%lx: %s, used=%ld, max=%ld\n" , client_name_string ( cname ) , size , ( ulong ) ptr , msg , mmem -> used , mmem -> max_used ) ;
# endif return ptr ;
# undef set_msg } |
-8,028,756,826,159,774,000 | debian | 23 | 0 | void StartRestoreBlob ( ArchiveHandle * AH , Oid oid , bool drop ) {
bool old_blob_style = ( AH -> version < K_VERS_1_12 ) ;
Oid loOid ;
AH -> blobCount ++ ;
AH -> lo_buf_used = 0 ;
ahlog ( AH , 1 , "restoring large object with OID %u\n" , oid ) ;
if ( old_blob_style && drop ) DropBlobIfExists ( AH , oid ) ;
if ( AH -> connection ) {
if ( old_blob_style ) {
loOid = lo_create ( AH -> connection , oid ) ;
if ( loOid == 0 || loOid != oid ) exit_horribly ( modulename , "could not create large object %u: %s" , oid , PQerrorMessage ( AH -> connection ) ) ;
}
AH -> loFd = lo_open ( AH -> connection , oid , INV_WRITE ) ;
if ( AH -> loFd == - 1 ) exit_horribly ( modulename , "could not open large object %u: %s" , oid , PQerrorMessage ( AH -> connection ) ) ;
}
else {
if ( old_blob_style ) ahprintf ( AH , "SELECT pg_catalog.lo_open(pg_catalog.lo_create('%u'), %d);
\n" , oid , INV_WRITE ) ;
else ahprintf ( AH , "SELECT pg_catalog.lo_open('%u', %d);
\n" , oid , INV_WRITE ) ;
}
AH -> writingBlob = 1 ;
} |
1,805,246,168,069,113,300 | debian | 24 | 0 | static inline void update_vlc_state ( VlcState * const state , const int v ) {
int drift = state -> drift ;
int count = state -> count ;
state -> error_sum += FFABS ( v ) ;
drift += v ;
if ( count == 128 ) {
count >>= 1 ;
drift >>= 1 ;
state -> error_sum >>= 1 ;
}
count ++ ;
if ( drift <= - count ) {
if ( state -> bias > - 128 ) state -> bias -- ;
drift += count ;
if ( drift <= - count ) drift = - count + 1 ;
}
else if ( drift > 0 ) {
if ( state -> bias < 127 ) state -> bias ++ ;
drift -= count ;
if ( drift > 0 ) drift = 0 ;
}
state -> drift = drift ;
state -> count = count ;
} |
1,760,449,185,745,615,400 | debian | 8 | 0 | TSAction TSCacheRemove ( TSCont contp , TSCacheKey key ) {
sdk_assert ( sdk_sanity_check_iocore_structure ( contp ) == TS_SUCCESS ) ;
sdk_assert ( sdk_sanity_check_cachekey ( key ) == TS_SUCCESS ) ;
FORCE_PLUGIN_SCOPED_MUTEX ( contp ) ;
CacheInfo * info = ( CacheInfo * ) key ;
INKContInternal * i = ( INKContInternal * ) contp ;
return ( TSAction ) cacheProcessor . remove ( i , & info -> cache_key , true , info -> frag_type , info -> hostname , info -> len ) ;
} |
-4,527,380,754,569,408,000 | chrome | 60 | 1 | 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 ) ;
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 ) static hb_feature_t * feature_reference ( hb_feature_t * g ) {
hb_feature_t * c = ( hb_feature_t * ) calloc ( 1 , sizeof ( hb_feature_t ) ) ;
if ( unlikely ( ! c ) ) return NULL ;
* c = * g ;
return c ;
}
static void feature_destroy ( hb_feature_t * g ) {
free ( g ) ;
}
HB_DEFINE_BOXED_TYPE ( feature , feature_reference , feature_destroy ) static hb_glyph_info_t * glyph_info_reference ( hb_glyph_info_t * g ) {
hb_glyph_info_t * c = ( hb_glyph_info_t * ) calloc ( 1 , sizeof ( hb_glyph_info_t ) ) ;
if ( unlikely ( ! c ) ) return NULL ;
* c = * g ;
return c ;
}
static void glyph_info_destroy ( hb_glyph_info_t * g ) {
free ( g ) ;
}
HB_DEFINE_BOXED_TYPE ( glyph_info , glyph_info_reference , glyph_info_destroy ) static hb_glyph_position_t * glyph_position_reference ( hb_glyph_position_t * g ) {
hb_glyph_position_t * c = ( hb_glyph_position_t * ) calloc ( 1 , sizeof ( hb_glyph_position_t ) ) ;
if ( unlikely ( ! c ) ) return NULL ;
* c = * g ;
return c ;
}
static void glyph_position_destroy ( hb_glyph_position_t * g ) {
free ( g ) ;
}
HB_DEFINE_BOXED_TYPE ( glyph_position , glyph_position_reference , glyph_position_destroy ) static hb_segment_properties_t * segment_properties_reference ( hb_segment_properties_t * g ) {
hb_segment_properties_t * c = ( hb_segment_properties_t * ) calloc ( 1 , sizeof ( hb_segment_properties_t ) ) ;
if ( unlikely ( ! c ) ) return NULL ;
* c = * g ;
return c ;
}
static void segment_properties_destroy ( hb_segment_properties_t * g ) {
free ( g ) ;
}
HB_DEFINE_BOXED_TYPE ( segment_properties , segment_properties_reference , segment_properties_destroy ) static hb_user_data_key_t user_data_key_reference ( hb_user_data_key_t l ) {
return l ;
}
static void user_data_key_destroy ( hb_user_data_key_t l ) {
}
HB_DEFINE_BOXED_TYPE ( user_data_key , user_data_key_reference , user_data_key_destroy ) static hb_language_t * language_reference ( hb_language_t * l ) {
hb_language_t * c = ( hb_language_t * ) calloc ( 1 , sizeof ( hb_language_t ) ) ;
if ( unlikely ( ! c ) ) return NULL ;
* c = * l ;
return c ;
}
static void language_destroy ( hb_language_t * l ) {
free ( l ) ;
}
HB_DEFINE_BOXED_TYPE ( language , language_reference , language_destroy ) |
847,431,771,831,526,000 | debian | 23 | 0 | static size_t b_encoder ( char * str , const char * buf , size_t buflen , const char * tocode ) {
char * s0 = str ;
memcpy ( str , "=?" , 2 ) ;
str += 2 ;
memcpy ( str , tocode , strlen ( tocode ) ) ;
str += strlen ( tocode ) ;
memcpy ( str , "?B?" , 3 ) ;
str += 3 ;
while ( buflen ) {
char encoded [ 11 ] ;
size_t ret ;
size_t in_len = MIN ( 3 , buflen ) ;
ret = mutt_b64_encode ( encoded , buf , in_len , sizeof ( encoded ) ) ;
for ( size_t i = 0 ;
i < ret ;
i ++ ) * str ++ = encoded [ i ] ;
buflen -= in_len ;
buf += in_len ;
}
memcpy ( str , "?=" , 2 ) ;
str += 2 ;
return ( str - s0 ) ;
} |
6,453,796,474,132,806,000 | chrome | 185 | 0 | static void U_CALLCONV _IMAPToUnicodeWithOffsets ( UConverterToUnicodeArgs * pArgs , UErrorCode * pErrorCode ) {
UConverter * cnv ;
const uint8_t * source , * sourceLimit ;
UChar * target ;
const UChar * targetLimit ;
int32_t * offsets ;
uint8_t * bytes ;
uint8_t byteIndex ;
int32_t length , targetCapacity ;
uint16_t bits ;
int8_t base64Counter ;
UBool inDirectMode ;
int8_t base64Value ;
int32_t sourceIndex , nextSourceIndex ;
UChar c ;
uint8_t b ;
cnv = pArgs -> converter ;
source = ( const uint8_t * ) pArgs -> source ;
sourceLimit = ( const uint8_t * ) pArgs -> sourceLimit ;
target = pArgs -> target ;
targetLimit = pArgs -> targetLimit ;
offsets = pArgs -> offsets ;
{
uint32_t status = cnv -> toUnicodeStatus ;
inDirectMode = ( UBool ) ( ( status >> 24 ) & 1 ) ;
base64Counter = ( int8_t ) ( status >> 16 ) ;
bits = ( uint16_t ) status ;
}
bytes = cnv -> toUBytes ;
byteIndex = cnv -> toULength ;
sourceIndex = byteIndex == 0 ? 0 : - 1 ;
nextSourceIndex = 0 ;
if ( inDirectMode ) {
directMode : byteIndex = 0 ;
length = ( int32_t ) ( sourceLimit - source ) ;
targetCapacity = ( int32_t ) ( targetLimit - target ) ;
if ( length > targetCapacity ) {
length = targetCapacity ;
}
while ( length > 0 ) {
b = * source ++ ;
if ( ! isLegalIMAP ( b ) ) {
bytes [ 0 ] = b ;
byteIndex = 1 ;
* pErrorCode = U_ILLEGAL_CHAR_FOUND ;
break ;
}
else if ( b != AMPERSAND ) {
* target ++ = b ;
if ( offsets != NULL ) {
* offsets ++ = sourceIndex ++ ;
}
}
else {
nextSourceIndex = ++ sourceIndex ;
inDirectMode = FALSE ;
byteIndex = 0 ;
bits = 0 ;
base64Counter = - 1 ;
goto unicodeMode ;
}
-- length ;
}
if ( source < sourceLimit && target >= targetLimit ) {
* pErrorCode = U_BUFFER_OVERFLOW_ERROR ;
}
}
else {
unicodeMode : while ( source < sourceLimit ) {
if ( target < targetLimit ) {
bytes [ byteIndex ++ ] = b = * source ++ ;
++ nextSourceIndex ;
if ( b > 0x7e ) {
inDirectMode = TRUE ;
* pErrorCode = U_ILLEGAL_CHAR_FOUND ;
break ;
}
else if ( ( base64Value = FROM_BASE64_IMAP ( b ) ) >= 0 ) {
switch ( base64Counter ) {
case - 1 : case 0 : bits = base64Value ;
base64Counter = 1 ;
break ;
case 1 : case 3 : case 4 : case 6 : bits = ( uint16_t ) ( ( bits << 6 ) | base64Value ) ;
++ base64Counter ;
break ;
case 2 : c = ( UChar ) ( ( bits << 4 ) | ( base64Value >> 2 ) ) ;
if ( isLegalIMAP ( c ) ) {
inDirectMode = TRUE ;
* pErrorCode = U_ILLEGAL_CHAR_FOUND ;
goto endloop ;
}
* target ++ = c ;
if ( offsets != NULL ) {
* offsets ++ = sourceIndex ;
sourceIndex = nextSourceIndex - 1 ;
}
bytes [ 0 ] = b ;
byteIndex = 1 ;
bits = ( uint16_t ) ( base64Value & 3 ) ;
base64Counter = 3 ;
break ;
case 5 : c = ( UChar ) ( ( bits << 2 ) | ( base64Value >> 4 ) ) ;
if ( isLegalIMAP ( c ) ) {
inDirectMode = TRUE ;
* pErrorCode = U_ILLEGAL_CHAR_FOUND ;
goto endloop ;
}
* target ++ = c ;
if ( offsets != NULL ) {
* offsets ++ = sourceIndex ;
sourceIndex = nextSourceIndex - 1 ;
}
bytes [ 0 ] = b ;
byteIndex = 1 ;
bits = ( uint16_t ) ( base64Value & 15 ) ;
base64Counter = 6 ;
break ;
case 7 : c = ( UChar ) ( ( bits << 6 ) | base64Value ) ;
if ( isLegalIMAP ( c ) ) {
inDirectMode = TRUE ;
* pErrorCode = U_ILLEGAL_CHAR_FOUND ;
goto endloop ;
}
* target ++ = c ;
if ( offsets != NULL ) {
* offsets ++ = sourceIndex ;
sourceIndex = nextSourceIndex ;
}
byteIndex = 0 ;
bits = 0 ;
base64Counter = 0 ;
break ;
default : break ;
}
}
else if ( base64Value == - 2 ) {
inDirectMode = TRUE ;
if ( base64Counter == - 1 ) {
* target ++ = AMPERSAND ;
if ( offsets != NULL ) {
* offsets ++ = sourceIndex - 1 ;
}
}
else {
if ( bits != 0 || ( base64Counter != 0 && base64Counter != 3 && base64Counter != 6 ) ) {
* pErrorCode = U_ILLEGAL_CHAR_FOUND ;
break ;
}
}
sourceIndex = nextSourceIndex ;
goto directMode ;
}
else {
if ( base64Counter == - 1 ) {
-- sourceIndex ;
bytes [ 0 ] = AMPERSAND ;
bytes [ 1 ] = b ;
byteIndex = 2 ;
}
inDirectMode = TRUE ;
* pErrorCode = U_ILLEGAL_CHAR_FOUND ;
break ;
}
}
else {
* pErrorCode = U_BUFFER_OVERFLOW_ERROR ;
break ;
}
}
}
endloop : if ( U_SUCCESS ( * pErrorCode ) && ! inDirectMode && byteIndex == 0 && pArgs -> flush && source >= sourceLimit ) {
if ( base64Counter == - 1 ) {
bytes [ 0 ] = AMPERSAND ;
byteIndex = 1 ;
}
inDirectMode = TRUE ;
* pErrorCode = U_TRUNCATED_CHAR_FOUND ;
}
cnv -> toUnicodeStatus = ( ( uint32_t ) inDirectMode << 24 ) | ( ( uint32_t ) ( ( uint8_t ) base64Counter ) << 16 ) | ( uint32_t ) bits ;
cnv -> toULength = byteIndex ;
pArgs -> source = ( const char * ) source ;
pArgs -> target = target ;
pArgs -> offsets = offsets ;
return ;
} |
1,182,028,467,273,265,000 | debian | 46 | 0 | void eval_expr ( VAR * v , const char * p , const char * * p_end , bool open_end , bool do_eval ) {
DBUG_ENTER ( "eval_expr" ) ;
DBUG_PRINT ( "enter" , ( "p: '%s'" , p ) ) ;
if ( ! do_eval ) goto NO_EVAL ;
if ( * p == '$' ) {
VAR * vp ;
const char * expected_end = * p_end ;
if ( ( vp = var_get ( p , p_end , 0 , 0 ) ) ) var_copy ( v , vp ) ;
v -> str_val [ v -> str_val_len ] = 0 ;
const char * end = * p_end + 1 ;
if ( end < expected_end && ! open_end ) die ( "Found junk '%.*s' after $variable in expression" , ( int ) ( expected_end - end - 1 ) , end ) ;
DBUG_VOID_RETURN ;
}
if ( * p == '`' ) {
var_query_set ( v , p , p_end ) ;
DBUG_VOID_RETURN ;
}
{
const char * get_value_str = "query_get_value" ;
const size_t len = strlen ( get_value_str ) ;
if ( strncmp ( p , get_value_str , len ) == 0 ) {
struct st_command command ;
memset ( & command , 0 , sizeof ( command ) ) ;
command . query = ( char * ) p ;
command . first_word_len = len ;
command . first_argument = command . query + len ;
command . end = ( char * ) * p_end ;
command . abort_on_error = 1 ;
var_set_query_get_value ( & command , v ) ;
DBUG_VOID_RETURN ;
}
}
NO_EVAL : {
int new_val_len = ( p_end && * p_end ) ? ( int ) ( * p_end - p ) : ( int ) strlen ( p ) ;
if ( new_val_len + 1 >= v -> alloced_len ) {
static int MIN_VAR_ALLOC = 32 ;
v -> alloced_len = ( new_val_len < MIN_VAR_ALLOC - 1 ) ? MIN_VAR_ALLOC : new_val_len + 1 ;
if ( ! ( v -> str_val = v -> str_val ? ( char * ) my_realloc ( v -> str_val , v -> alloced_len + 1 , MYF ( MY_WME ) ) : ( char * ) my_malloc ( v -> alloced_len + 1 , MYF ( MY_WME ) ) ) ) die ( "Out of memory" ) ;
}
v -> str_val_len = new_val_len ;
memcpy ( v -> str_val , p , new_val_len ) ;
v -> str_val [ new_val_len ] = 0 ;
var_check_int ( v ) ;
}
DBUG_VOID_RETURN ;
} |
378,220,832,151,730,900 | debian | 31 | 0 | static int qemuMonitorTextParseBlockJob ( const char * text , const char * device , virDomainBlockJobInfoPtr info ) {
const char * next = NULL ;
int ret = 0 ;
if ( strstr ( text , "Device '" ) && strstr ( text , "' not found" ) ) {
qemuReportError ( VIR_ERR_OPERATION_INVALID , "%s" , _ ( "Device not found" ) ) ;
return - 1 ;
}
if ( strstr ( text , "Device '" ) && strstr ( text , "' is in use" ) ) {
qemuReportError ( VIR_ERR_OPERATION_FAILED , _ ( "Device %s in use" ) , device ) ;
return - 1 ;
}
if ( strstr ( text , "has not been activated" ) ) {
qemuReportError ( VIR_ERR_OPERATION_INVALID , \ _ ( "No active operation on device: %s" ) , device ) ;
return - 1 ;
}
if ( strstr ( text , "No active jobs" ) ) {
return 0 ;
}
if ( strstr ( text , "Operation is not supported" ) ) {
qemuReportError ( VIR_ERR_OPERATION_INVALID , _ ( "Operation is not supported for device: %s" ) , device ) ;
return - 1 ;
}
if ( STREQ ( text , "" ) ) return 0 ;
do {
ret = qemuMonitorTextParseBlockJobOne ( text , device , info , & next ) ;
text = next ;
}
while ( text && ret == - EAGAIN ) ;
if ( ret < 0 ) return - 1 ;
return ret ;
} |
6,755,873,269,946,788,000 | debian | 20 | 0 | static gboolean pk_transaction_obtain_authorization ( PkTransaction * transaction , PkRoleEnum role , GError * * error ) {
g_autoptr ( GPtrArray ) actions = NULL ;
PkTransactionPrivate * priv = transaction -> priv ;
g_autofree gchar * package_ids = NULL ;
g_autoptr ( PolkitDetails ) details = NULL ;
g_autoptr ( GString ) string = NULL ;
g_return_val_if_fail ( priv -> sender != NULL , FALSE ) ;
if ( pk_bitfield_contain ( transaction -> priv -> cached_transaction_flags , PK_TRANSACTION_FLAG_ENUM_ONLY_DOWNLOAD ) || pk_bitfield_contain ( transaction -> priv -> cached_transaction_flags , PK_TRANSACTION_FLAG_ENUM_SIMULATE ) || priv -> skip_auth_check == TRUE ) {
g_debug ( "No authentication required" ) ;
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_READY ) ;
return TRUE ;
}
if ( priv -> subject == NULL ) {
g_set_error ( error , PK_TRANSACTION_ERROR , PK_TRANSACTION_ERROR_REFUSED_BY_POLICY , "subject %s not found" , priv -> sender ) ;
return FALSE ;
}
actions = pk_transaction_role_to_actions ( role , priv -> cached_transaction_flags ) ;
if ( actions == NULL ) return FALSE ;
return pk_transaction_authorize_actions ( transaction , role , actions ) ;
} |
4,180,964,683,905,831,000 | debian | 81 | 0 | static int selinux_setprocattr ( struct task_struct * p , char * name , void * value , size_t size ) {
struct task_security_struct * tsec ;
struct cred * new ;
u32 sid = 0 , ptsid ;
int error ;
char * str = value ;
if ( current != p ) {
return - EACCES ;
}
if ( ! strcmp ( name , "exec" ) ) error = current_has_perm ( p , PROCESS__SETEXEC ) ;
else if ( ! strcmp ( name , "fscreate" ) ) error = current_has_perm ( p , PROCESS__SETFSCREATE ) ;
else if ( ! strcmp ( name , "keycreate" ) ) error = current_has_perm ( p , PROCESS__SETKEYCREATE ) ;
else if ( ! strcmp ( name , "sockcreate" ) ) error = current_has_perm ( p , PROCESS__SETSOCKCREATE ) ;
else if ( ! strcmp ( name , "current" ) ) error = current_has_perm ( p , PROCESS__SETCURRENT ) ;
else error = - EINVAL ;
if ( error ) return error ;
if ( size && str [ 0 ] && str [ 0 ] != '\n' ) {
if ( str [ size - 1 ] == '\n' ) {
str [ size - 1 ] = 0 ;
size -- ;
}
error = security_context_to_sid ( value , size , & sid , GFP_KERNEL ) ;
if ( error == - EINVAL && ! strcmp ( name , "fscreate" ) ) {
if ( ! capable ( CAP_MAC_ADMIN ) ) {
struct audit_buffer * ab ;
size_t audit_size ;
if ( str [ size - 1 ] == '\0' ) audit_size = size - 1 ;
else audit_size = size ;
ab = audit_log_start ( current -> audit_context , GFP_ATOMIC , AUDIT_SELINUX_ERR ) ;
audit_log_format ( ab , "op=fscreate invalid_context=" ) ;
audit_log_n_untrustedstring ( ab , value , audit_size ) ;
audit_log_end ( ab ) ;
return error ;
}
error = security_context_to_sid_force ( value , size , & sid ) ;
}
if ( error ) return error ;
}
new = prepare_creds ( ) ;
if ( ! new ) return - ENOMEM ;
tsec = new -> security ;
if ( ! strcmp ( name , "exec" ) ) {
tsec -> exec_sid = sid ;
}
else if ( ! strcmp ( name , "fscreate" ) ) {
tsec -> create_sid = sid ;
}
else if ( ! strcmp ( name , "keycreate" ) ) {
error = may_create_key ( sid , p ) ;
if ( error ) goto abort_change ;
tsec -> keycreate_sid = sid ;
}
else if ( ! strcmp ( name , "sockcreate" ) ) {
tsec -> sockcreate_sid = sid ;
}
else if ( ! strcmp ( name , "current" ) ) {
error = - EINVAL ;
if ( sid == 0 ) goto abort_change ;
error = - EPERM ;
if ( ! current_is_single_threaded ( ) ) {
error = security_bounded_transition ( tsec -> sid , sid ) ;
if ( error ) goto abort_change ;
}
error = avc_has_perm ( tsec -> sid , sid , SECCLASS_PROCESS , PROCESS__DYNTRANSITION , NULL ) ;
if ( error ) goto abort_change ;
ptsid = ptrace_parent_sid ( p ) ;
if ( ptsid != 0 ) {
error = avc_has_perm ( ptsid , sid , SECCLASS_PROCESS , PROCESS__PTRACE , NULL ) ;
if ( error ) goto abort_change ;
}
tsec -> sid = sid ;
}
else {
error = - EINVAL ;
goto abort_change ;
}
commit_creds ( new ) ;
return size ;
abort_change : abort_creds ( new ) ;
return error ;
} |
-5,025,430,721,469,044,000 | debian | 656 | 0 | static void dl_main ( const ElfW ( Phdr ) * phdr , ElfW ( Word ) phnum , ElfW ( Addr ) * user_entry , ElfW ( auxv_t ) * auxv ) {
const ElfW ( Phdr ) * ph ;
enum mode mode ;
struct link_map * main_map ;
size_t file_size ;
char * file ;
bool has_interp = false ;
unsigned int i ;
bool prelinked = false ;
bool rtld_is_main = false ;
# ifndef HP_TIMING_NONAVAIL hp_timing_t start ;
hp_timing_t stop ;
hp_timing_t diff ;
# endif void * tcbp = NULL ;
# ifdef _LIBC_REENTRANT GL ( dl_error_catch_tsd ) = & _dl_initial_error_catch_tsd ;
# endif GL ( dl_init_static_tls ) = & _dl_nothread_init_static_tls ;
# if defined SHARED && defined _LIBC_REENTRANT && defined __rtld_lock_default_lock_recursive GL ( dl_rtld_lock_recursive ) = rtld_lock_default_lock_recursive ;
GL ( dl_rtld_unlock_recursive ) = rtld_lock_default_unlock_recursive ;
# endif GL ( dl_make_stack_executable_hook ) = & _dl_make_stack_executable ;
process_envvars ( & mode ) ;
# ifndef HAVE_INLINED_SYSCALLS _dl_starting_up = 1 ;
# endif if ( * user_entry == ( ElfW ( Addr ) ) ENTRY_POINT ) {
rtld_is_main = true ;
GL ( dl_rtld_map ) . l_name = rtld_progname ;
while ( _dl_argc > 1 ) if ( ! strcmp ( _dl_argv [ 1 ] , "--list" ) ) {
mode = list ;
GLRO ( dl_lazy ) = - 1 ;
++ _dl_skip_args ;
-- _dl_argc ;
++ _dl_argv ;
}
else if ( ! strcmp ( _dl_argv [ 1 ] , "--verify" ) ) {
mode = verify ;
++ _dl_skip_args ;
-- _dl_argc ;
++ _dl_argv ;
}
else if ( ! strcmp ( _dl_argv [ 1 ] , "--inhibit-cache" ) ) {
GLRO ( dl_inhibit_cache ) = 1 ;
++ _dl_skip_args ;
-- _dl_argc ;
++ _dl_argv ;
}
else if ( ! strcmp ( _dl_argv [ 1 ] , "--library-path" ) && _dl_argc > 2 ) {
library_path = _dl_argv [ 2 ] ;
_dl_skip_args += 2 ;
_dl_argc -= 2 ;
_dl_argv += 2 ;
}
else if ( ! strcmp ( _dl_argv [ 1 ] , "--inhibit-rpath" ) && _dl_argc > 2 ) {
GLRO ( dl_inhibit_rpath ) = _dl_argv [ 2 ] ;
_dl_skip_args += 2 ;
_dl_argc -= 2 ;
_dl_argv += 2 ;
}
else if ( ! strcmp ( _dl_argv [ 1 ] , "--audit" ) && _dl_argc > 2 ) {
process_dl_audit ( _dl_argv [ 2 ] ) ;
_dl_skip_args += 2 ;
_dl_argc -= 2 ;
_dl_argv += 2 ;
}
else break ;
if ( _dl_argc < 2 ) _dl_fatal_printf ( "\ Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]\n\ You have invoked `ld.so', the helper program for shared library executables.\n\ This program usually lives in the file `/lib/ld.so', and special directives\n\ in executable files using ELF shared libraries tell the system's program\n\ loader to load the helper program from this file. This helper program loads\n\ the shared libraries needed by the program executable, prepares the program\n\ to run, and runs it. You may invoke this helper program directly from the\n\ command line to load and run an ELF executable file;
this is like executing\n\ that file itself, but always uses this helper program from the file you\n\ specified, instead of the helper program file specified in the executable\n\ file you run. This is mostly of use for maintainers to test new versions\n\ of this helper program;
chances are you did not intend to run this program.\n\ \n\ --list list all dependencies and how they are resolved\n\ --verify verify that given object really is a dynamically linked\n\ object we can handle\n\ --inhibit-cache Do not use " LD_SO_CACHE "\n\ --library-path PATH use given PATH instead of content of the environment\n\ variable LD_LIBRARY_PATH\n\ --inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\ in LIST\n\ --audit LIST use objects named in LIST as auditors\n" ) ;
++ _dl_skip_args ;
-- _dl_argc ;
++ _dl_argv ;
for ( ph = phdr ;
ph < & phdr [ phnum ] ;
++ ph ) if ( ph -> p_type == PT_GNU_STACK ) {
GL ( dl_stack_flags ) = ph -> p_flags ;
break ;
}
if ( __builtin_expect ( mode , normal ) == verify ) {
const char * objname ;
const char * err_str = NULL ;
struct map_args args ;
bool malloced ;
args . str = rtld_progname ;
args . loader = NULL ;
args . mode = __RTLD_OPENEXEC ;
( void ) _dl_catch_error ( & objname , & err_str , & malloced , map_doit , & args ) ;
if ( __glibc_unlikely ( err_str != NULL ) ) _exit ( EXIT_FAILURE ) ;
}
else {
HP_TIMING_NOW ( start ) ;
_dl_map_object ( NULL , rtld_progname , lt_executable , 0 , __RTLD_OPENEXEC , LM_ID_BASE ) ;
HP_TIMING_NOW ( stop ) ;
HP_TIMING_DIFF ( load_time , start , stop ) ;
}
main_map = GL ( dl_ns ) [ LM_ID_BASE ] . _ns_loaded ;
if ( __builtin_expect ( mode , normal ) == normal && GL ( dl_rtld_map ) . l_info [ DT_SONAME ] != NULL && main_map -> l_info [ DT_SONAME ] != NULL && strcmp ( ( const char * ) D_PTR ( & GL ( dl_rtld_map ) , l_info [ DT_STRTAB ] ) + GL ( dl_rtld_map ) . l_info [ DT_SONAME ] -> d_un . d_val , ( const char * ) D_PTR ( main_map , l_info [ DT_STRTAB ] ) + main_map -> l_info [ DT_SONAME ] -> d_un . d_val ) == 0 ) _dl_fatal_printf ( "loader cannot load itself\n" ) ;
phdr = main_map -> l_phdr ;
phnum = main_map -> l_phnum ;
main_map -> l_name = ( char * ) "" ;
* user_entry = main_map -> l_entry ;
# ifdef HAVE_AUX_VECTOR for ( ElfW ( auxv_t ) * av = auxv ;
av -> a_type != AT_NULL ;
av ++ ) switch ( av -> a_type ) {
case AT_PHDR : av -> a_un . a_val = ( uintptr_t ) phdr ;
break ;
case AT_PHNUM : av -> a_un . a_val = phnum ;
break ;
case AT_ENTRY : av -> a_un . a_val = * user_entry ;
break ;
case AT_EXECFN : av -> a_un . a_val = ( uintptr_t ) _dl_argv [ 0 ] ;
break ;
}
# endif }
else {
main_map = _dl_new_object ( ( char * ) "" , "" , lt_executable , NULL , __RTLD_OPENEXEC , LM_ID_BASE ) ;
assert ( main_map != NULL ) ;
main_map -> l_phdr = phdr ;
main_map -> l_phnum = phnum ;
main_map -> l_entry = * user_entry ;
_dl_add_to_namespace_list ( main_map , LM_ID_BASE ) ;
assert ( main_map == GL ( dl_ns ) [ LM_ID_BASE ] . _ns_loaded ) ;
}
main_map -> l_map_end = 0 ;
main_map -> l_text_end = 0 ;
main_map -> l_map_start = ~ 0 ;
++ main_map -> l_direct_opencount ;
for ( ph = phdr ;
ph < & phdr [ phnum ] ;
++ ph ) switch ( ph -> p_type ) {
case PT_PHDR : main_map -> l_addr = ( ElfW ( Addr ) ) phdr - ph -> p_vaddr ;
break ;
case PT_DYNAMIC : main_map -> l_ld = ( void * ) main_map -> l_addr + ph -> p_vaddr ;
break ;
case PT_INTERP : _dl_rtld_libname . name = ( ( const char * ) main_map -> l_addr + ph -> p_vaddr ) ;
GL ( dl_rtld_map ) . l_libname = & _dl_rtld_libname ;
if ( GL ( dl_rtld_map ) . l_ld == NULL ) {
const char * p = NULL ;
const char * cp = _dl_rtld_libname . name ;
while ( * cp != '\0' ) if ( * cp ++ == '/' ) p = cp ;
if ( p != NULL ) {
_dl_rtld_libname2 . name = p ;
_dl_rtld_libname . next = & _dl_rtld_libname2 ;
}
}
has_interp = true ;
break ;
case PT_LOAD : {
ElfW ( Addr ) mapstart ;
ElfW ( Addr ) allocend ;
mapstart = ( main_map -> l_addr + ( ph -> p_vaddr & ~ ( GLRO ( dl_pagesize ) - 1 ) ) ) ;
if ( main_map -> l_map_start > mapstart ) main_map -> l_map_start = mapstart ;
allocend = main_map -> l_addr + ph -> p_vaddr + ph -> p_memsz ;
if ( main_map -> l_map_end < allocend ) main_map -> l_map_end = allocend ;
if ( ( ph -> p_flags & PF_X ) && allocend > main_map -> l_text_end ) main_map -> l_text_end = allocend ;
}
break ;
case PT_TLS : if ( ph -> p_memsz > 0 ) {
main_map -> l_tls_blocksize = ph -> p_memsz ;
main_map -> l_tls_align = ph -> p_align ;
if ( ph -> p_align == 0 ) main_map -> l_tls_firstbyte_offset = 0 ;
else main_map -> l_tls_firstbyte_offset = ( ph -> p_vaddr & ( ph -> p_align - 1 ) ) ;
main_map -> l_tls_initimage_size = ph -> p_filesz ;
main_map -> l_tls_initimage = ( void * ) ph -> p_vaddr ;
GL ( dl_tls_max_dtv_idx ) = main_map -> l_tls_modid = 1 ;
}
break ;
case PT_GNU_STACK : GL ( dl_stack_flags ) = ph -> p_flags ;
break ;
case PT_GNU_RELRO : main_map -> l_relro_addr = ph -> p_vaddr ;
main_map -> l_relro_size = ph -> p_memsz ;
break ;
}
if ( main_map -> l_tls_initimage != NULL ) main_map -> l_tls_initimage = ( char * ) main_map -> l_tls_initimage + main_map -> l_addr ;
if ( ! main_map -> l_map_end ) main_map -> l_map_end = ~ 0 ;
if ( ! main_map -> l_text_end ) main_map -> l_text_end = ~ 0 ;
if ( ! GL ( dl_rtld_map ) . l_libname && GL ( dl_rtld_map ) . l_name ) {
_dl_rtld_libname . name = GL ( dl_rtld_map ) . l_name ;
GL ( dl_rtld_map ) . l_libname = & _dl_rtld_libname ;
}
else assert ( GL ( dl_rtld_map ) . l_libname ) ;
if ( GL ( dl_rtld_map ) . l_info [ DT_SONAME ] != NULL && strcmp ( GL ( dl_rtld_map ) . l_libname -> name , ( const char * ) D_PTR ( & GL ( dl_rtld_map ) , l_info [ DT_STRTAB ] ) + GL ( dl_rtld_map ) . l_info [ DT_SONAME ] -> d_un . d_val ) != 0 ) {
static struct libname_list newname ;
newname . name = ( ( char * ) D_PTR ( & GL ( dl_rtld_map ) , l_info [ DT_STRTAB ] ) + GL ( dl_rtld_map ) . l_info [ DT_SONAME ] -> d_un . d_ptr ) ;
newname . next = NULL ;
newname . dont_free = 1 ;
assert ( GL ( dl_rtld_map ) . l_libname -> next == NULL ) ;
GL ( dl_rtld_map ) . l_libname -> next = & newname ;
}
assert ( GL ( dl_rtld_map ) . l_relocated ) ;
if ( ! rtld_is_main ) {
elf_get_dynamic_info ( main_map , NULL ) ;
_dl_setup_hash ( main_map ) ;
}
if ( __builtin_expect ( mode , normal ) == verify ) {
if ( main_map -> l_ld == NULL ) _exit ( 1 ) ;
# ifdef DISTINGUISH_LIB_VERSIONS DISTINGUISH_LIB_VERSIONS ;
# endif _exit ( has_interp ? 0 : 2 ) ;
}
struct link_map * * first_preload = & GL ( dl_rtld_map ) . l_next ;
setup_vdso ( main_map , & first_preload ) ;
# ifdef DL_SYSDEP_OSCHECK DL_SYSDEP_OSCHECK ( _dl_fatal_printf ) ;
# endif _dl_init_paths ( library_path ) ;
struct r_debug * r = _dl_debug_initialize ( GL ( dl_rtld_map ) . l_addr , LM_ID_BASE ) ;
r -> r_state = RT_CONSISTENT ;
if ( ! GL ( dl_rtld_map ) . l_name ) GL ( dl_rtld_map ) . l_name = ( char * ) GL ( dl_rtld_map ) . l_libname -> name ;
GL ( dl_rtld_map ) . l_type = lt_library ;
main_map -> l_next = & GL ( dl_rtld_map ) ;
GL ( dl_rtld_map ) . l_prev = main_map ;
++ GL ( dl_ns ) [ LM_ID_BASE ] . _ns_nloaded ;
++ GL ( dl_load_adds ) ;
if ( GLRO ( dl_use_load_bias ) == ( ElfW ( Addr ) ) - 2 ) GLRO ( dl_use_load_bias ) = main_map -> l_addr == 0 ? - 1 : 0 ;
const ElfW ( Ehdr ) * rtld_ehdr ;
# ifdef HAVE_EHDR_START extern const ElfW ( Ehdr ) __ehdr_start __attribute__ ( ( visibility ( "hidden" ) ) ) ;
rtld_ehdr = & __ehdr_start ;
# else rtld_ehdr = ( void * ) GL ( dl_rtld_map ) . l_map_start ;
# endif assert ( rtld_ehdr -> e_ehsize == sizeof * rtld_ehdr ) ;
assert ( rtld_ehdr -> e_phentsize == sizeof ( ElfW ( Phdr ) ) ) ;
const ElfW ( Phdr ) * rtld_phdr = ( const void * ) rtld_ehdr + rtld_ehdr -> e_phoff ;
GL ( dl_rtld_map ) . l_phdr = rtld_phdr ;
GL ( dl_rtld_map ) . l_phnum = rtld_ehdr -> e_phnum ;
size_t cnt = rtld_ehdr -> e_phnum ;
while ( cnt -- > 0 ) if ( rtld_phdr [ cnt ] . p_type == PT_GNU_RELRO ) {
GL ( dl_rtld_map ) . l_relro_addr = rtld_phdr [ cnt ] . p_vaddr ;
GL ( dl_rtld_map ) . l_relro_size = rtld_phdr [ cnt ] . p_memsz ;
break ;
}
if ( GL ( dl_rtld_map ) . l_tls_blocksize != 0 ) GL ( dl_rtld_map ) . l_tls_modid = _dl_next_tls_modid ( ) ;
if ( __glibc_unlikely ( audit_list != NULL ) ) {
struct audit_ifaces * last_audit = NULL ;
struct audit_list * al = audit_list -> next ;
tcbp = init_tls ( ) ;
security_init ( ) ;
do {
int tls_idx = GL ( dl_tls_max_dtv_idx ) ;
struct dlmopen_args dlmargs ;
dlmargs . fname = al -> name ;
dlmargs . map = NULL ;
const char * objname ;
const char * err_str = NULL ;
bool malloced ;
( void ) _dl_catch_error ( & objname , & err_str , & malloced , dlmopen_doit , & dlmargs ) ;
if ( __glibc_unlikely ( err_str != NULL ) ) {
not_loaded : _dl_error_printf ( "\ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s;
ignored.\n" , al -> name , err_str ) ;
if ( malloced ) free ( ( char * ) err_str ) ;
}
else {
struct lookup_args largs ;
largs . name = "la_version" ;
largs . map = dlmargs . map ;
( void ) _dl_catch_error ( & objname , & err_str , & malloced , lookup_doit , & largs ) ;
unsigned int ( * laversion ) ( unsigned int ) ;
unsigned int lav ;
if ( err_str == NULL && ( laversion = largs . result ) != NULL && ( lav = laversion ( LAV_CURRENT ) ) > 0 && lav <= LAV_CURRENT ) {
union {
struct audit_ifaces ifaces ;
# define naudit_ifaces 8 void ( * fptr [ naudit_ifaces ] ) ( void ) ;
}
* newp = malloc ( sizeof ( * newp ) ) ;
static const char audit_iface_names [ ] = "la_activity\0" "la_objsearch\0" "la_objopen\0" "la_preinit\0" # if __ELF_NATIVE_CLASS == 32 "la_symbind32\0" # elif __ELF_NATIVE_CLASS == 64 "la_symbind64\0" # else # error "__ELF_NATIVE_CLASS must be defined" # endif # define STRING ( s ) __STRING ( s ) "la_" STRING ( ARCH_LA_PLTENTER ) "\0" "la_" STRING ( ARCH_LA_PLTEXIT ) "\0" "la_objclose\0" ;
unsigned int cnt = 0 ;
const char * cp = audit_iface_names ;
do {
largs . name = cp ;
( void ) _dl_catch_error ( & objname , & err_str , & malloced , lookup_doit , & largs ) ;
if ( err_str == NULL && largs . result != NULL ) {
newp -> fptr [ cnt ] = largs . result ;
GL ( dl_rtld_map ) . l_audit [ cnt ] . cookie = ( intptr_t ) & GL ( dl_rtld_map ) ;
}
else newp -> fptr [ cnt ] = NULL ;
++ cnt ;
cp = ( char * ) rawmemchr ( cp , '\0' ) + 1 ;
}
while ( * cp != '\0' ) ;
assert ( cnt == naudit_ifaces ) ;
newp -> ifaces . next = NULL ;
if ( last_audit == NULL ) last_audit = GLRO ( dl_audit ) = & newp -> ifaces ;
else last_audit = last_audit -> next = & newp -> ifaces ;
++ GLRO ( dl_naudit ) ;
dlmargs . map -> l_auditing = 1 ;
}
else {
# ifndef NDEBUG Lmid_t ns = dlmargs . map -> l_ns ;
# endif _dl_close ( dlmargs . map ) ;
assert ( GL ( dl_ns ) [ ns ] . _ns_loaded == NULL ) ;
assert ( GL ( dl_ns ) [ ns ] . _ns_nloaded == 0 ) ;
GL ( dl_tls_max_dtv_idx ) = tls_idx ;
goto not_loaded ;
}
}
al = al -> next ;
}
while ( al != audit_list -> next ) ;
if ( __glibc_unlikely ( GLRO ( dl_naudit ) > 0 ) ) {
struct link_map * ls [ 2 ] = {
main_map , & GL ( dl_rtld_map ) }
;
for ( unsigned int outer = 0 ;
outer < 2 ;
++ outer ) {
struct audit_ifaces * afct = GLRO ( dl_audit ) ;
for ( unsigned int cnt = 0 ;
cnt < GLRO ( dl_naudit ) ;
++ cnt ) {
if ( afct -> objopen != NULL ) {
ls [ outer ] -> l_audit [ cnt ] . bindflags = afct -> objopen ( ls [ outer ] , LM_ID_BASE , & ls [ outer ] -> l_audit [ cnt ] . cookie ) ;
ls [ outer ] -> l_audit_any_plt |= ls [ outer ] -> l_audit [ cnt ] . bindflags != 0 ;
}
afct = afct -> next ;
}
}
}
}
size_t count_modids = _dl_count_modids ( ) ;
# ifdef ELF_MACHINE_DEBUG_SETUP ELF_MACHINE_DEBUG_SETUP ( main_map , r ) ;
ELF_MACHINE_DEBUG_SETUP ( & GL ( dl_rtld_map ) , r ) ;
# else if ( main_map -> l_info [ DT_DEBUG ] != NULL ) main_map -> l_info [ DT_DEBUG ] -> d_un . d_ptr = ( ElfW ( Addr ) ) r ;
if ( GL ( dl_rtld_map ) . l_info [ DT_DEBUG ] != NULL ) GL ( dl_rtld_map ) . l_info [ DT_DEBUG ] -> d_un . d_ptr = ( ElfW ( Addr ) ) r ;
# endif r -> r_state = RT_ADD ;
_dl_debug_state ( ) ;
LIBC_PROBE ( init_start , 2 , LM_ID_BASE , r ) ;
if ( __glibc_unlikely ( GLRO ( dl_naudit ) > 0 ) ) {
struct audit_ifaces * afct = GLRO ( dl_audit ) ;
for ( unsigned int cnt = 0 ;
cnt < GLRO ( dl_naudit ) ;
++ cnt ) {
if ( afct -> activity != NULL ) afct -> activity ( & main_map -> l_audit [ cnt ] . cookie , LA_ACT_ADD ) ;
afct = afct -> next ;
}
}
assert ( * first_preload == NULL ) ;
struct link_map * * preloads = NULL ;
unsigned int npreloads = 0 ;
if ( __glibc_unlikely ( preloadlist != NULL ) ) {
char * list = strdupa ( preloadlist ) ;
char * p ;
HP_TIMING_NOW ( start ) ;
while ( ( p = ( strsep ) ( & list , " :" ) ) != NULL ) if ( p [ 0 ] != '\0' && ( __builtin_expect ( ! __libc_enable_secure , 1 ) || strchr ( p , '/' ) == NULL ) ) npreloads += do_preload ( p , main_map , "LD_PRELOAD" ) ;
HP_TIMING_NOW ( stop ) ;
HP_TIMING_DIFF ( diff , start , stop ) ;
HP_TIMING_ACCUM_NT ( load_time , diff ) ;
}
static const char preload_file [ ] = "/etc/ld.so.preload" ;
if ( __glibc_unlikely ( __access ( preload_file , R_OK ) == 0 ) ) {
file = _dl_sysdep_read_whole_file ( preload_file , & file_size , PROT_READ | PROT_WRITE ) ;
if ( __glibc_unlikely ( file != MAP_FAILED ) ) {
char * problem ;
char * runp ;
size_t rest ;
runp = file ;
rest = file_size ;
while ( rest > 0 ) {
char * comment = memchr ( runp , '#' , rest ) ;
if ( comment == NULL ) break ;
rest -= comment - runp ;
do * comment = ' ' ;
while ( -- rest > 0 && * ++ comment != '\n' ) ;
}
if ( file [ file_size - 1 ] != ' ' && file [ file_size - 1 ] != '\t' && file [ file_size - 1 ] != '\n' && file [ file_size - 1 ] != ':' ) {
problem = & file [ file_size ] ;
while ( problem > file && problem [ - 1 ] != ' ' && problem [ - 1 ] != '\t' && problem [ - 1 ] != '\n' && problem [ - 1 ] != ':' ) -- problem ;
if ( problem > file ) problem [ - 1 ] = '\0' ;
}
else {
problem = NULL ;
file [ file_size - 1 ] = '\0' ;
}
HP_TIMING_NOW ( start ) ;
if ( file != problem ) {
char * p ;
runp = file ;
while ( ( p = strsep ( & runp , ": \t\n" ) ) != NULL ) if ( p [ 0 ] != '\0' ) npreloads += do_preload ( p , main_map , preload_file ) ;
}
if ( problem != NULL ) {
char * p = strndupa ( problem , file_size - ( problem - file ) ) ;
npreloads += do_preload ( p , main_map , preload_file ) ;
}
HP_TIMING_NOW ( stop ) ;
HP_TIMING_DIFF ( diff , start , stop ) ;
HP_TIMING_ACCUM_NT ( load_time , diff ) ;
__munmap ( file , file_size ) ;
}
}
if ( __glibc_unlikely ( * first_preload != NULL ) ) {
struct link_map * l = * first_preload ;
preloads = __alloca ( npreloads * sizeof preloads [ 0 ] ) ;
i = 0 ;
do {
preloads [ i ++ ] = l ;
l = l -> l_next ;
}
while ( l ) ;
assert ( i == npreloads ) ;
}
HP_TIMING_NOW ( start ) ;
_dl_map_object_deps ( main_map , preloads , npreloads , mode == trace , 0 ) ;
HP_TIMING_NOW ( stop ) ;
HP_TIMING_DIFF ( diff , start , stop ) ;
HP_TIMING_ACCUM_NT ( load_time , diff ) ;
for ( i = main_map -> l_searchlist . r_nlist ;
i > 0 ;
) main_map -> l_searchlist . r_list [ -- i ] -> l_global = 1 ;
GL ( dl_rtld_map ) . l_prev -> l_next = GL ( dl_rtld_map ) . l_next ;
if ( GL ( dl_rtld_map ) . l_next != NULL ) GL ( dl_rtld_map ) . l_next -> l_prev = GL ( dl_rtld_map ) . l_prev ;
for ( i = 1 ;
i < main_map -> l_searchlist . r_nlist ;
++ i ) if ( main_map -> l_searchlist . r_list [ i ] == & GL ( dl_rtld_map ) ) break ;
bool rtld_multiple_ref = false ;
if ( __glibc_likely ( i < main_map -> l_searchlist . r_nlist ) ) {
rtld_multiple_ref = true ;
GL ( dl_rtld_map ) . l_prev = main_map -> l_searchlist . r_list [ i - 1 ] ;
if ( __builtin_expect ( mode , normal ) == normal ) {
GL ( dl_rtld_map ) . l_next = ( i + 1 < main_map -> l_searchlist . r_nlist ? main_map -> l_searchlist . r_list [ i + 1 ] : NULL ) ;
# ifdef NEED_DL_SYSINFO_DSO if ( GLRO ( dl_sysinfo_map ) != NULL && GL ( dl_rtld_map ) . l_prev -> l_next == GLRO ( dl_sysinfo_map ) && GL ( dl_rtld_map ) . l_next != GLRO ( dl_sysinfo_map ) ) GL ( dl_rtld_map ) . l_prev = GLRO ( dl_sysinfo_map ) ;
# endif }
else GL ( dl_rtld_map ) . l_next = GL ( dl_rtld_map ) . l_prev -> l_next ;
assert ( GL ( dl_rtld_map ) . l_prev -> l_next == GL ( dl_rtld_map ) . l_next ) ;
GL ( dl_rtld_map ) . l_prev -> l_next = & GL ( dl_rtld_map ) ;
if ( GL ( dl_rtld_map ) . l_next != NULL ) {
assert ( GL ( dl_rtld_map ) . l_next -> l_prev == GL ( dl_rtld_map ) . l_prev ) ;
GL ( dl_rtld_map ) . l_next -> l_prev = & GL ( dl_rtld_map ) ;
}
}
{
struct version_check_args args ;
args . doexit = mode == normal ;
args . dotrace = mode == trace ;
_dl_receive_error ( print_missing_version , version_check_doit , & args ) ;
}
bool was_tls_init_tp_called = tls_init_tp_called ;
if ( tcbp == NULL ) tcbp = init_tls ( ) ;
if ( __glibc_likely ( audit_list == NULL ) ) security_init ( ) ;
if ( __builtin_expect ( mode , normal ) != normal ) {
struct link_map * l ;
if ( GLRO ( dl_debug_mask ) & DL_DEBUG_PRELINK ) {
struct r_scope_elem * scope = & main_map -> l_searchlist ;
for ( i = 0 ;
i < scope -> r_nlist ;
i ++ ) {
l = scope -> r_list [ i ] ;
if ( l -> l_faked ) {
_dl_printf ( "\t%s => not found\n" , l -> l_libname -> name ) ;
continue ;
}
if ( _dl_name_match_p ( GLRO ( dl_trace_prelink ) , l ) ) GLRO ( dl_trace_prelink_map ) = l ;
_dl_printf ( "\t%s => %s (0x%0*Zx, 0x%0*Zx)" , DSO_FILENAME ( l -> l_libname -> name ) , DSO_FILENAME ( l -> l_name ) , ( int ) sizeof l -> l_map_start * 2 , ( size_t ) l -> l_map_start , ( int ) sizeof l -> l_addr * 2 , ( size_t ) l -> l_addr ) ;
if ( l -> l_tls_modid ) _dl_printf ( " TLS(0x%Zx, 0x%0*Zx)\n" , l -> l_tls_modid , ( int ) sizeof l -> l_tls_offset * 2 , ( size_t ) l -> l_tls_offset ) ;
else _dl_printf ( "\n" ) ;
}
}
else if ( GLRO ( dl_debug_mask ) & DL_DEBUG_UNUSED ) {
struct link_map * l = main_map ;
struct relocate_args args = {
. l = l , . reloc_mode = ( ( GLRO ( dl_lazy ) ? RTLD_LAZY : 0 ) | __RTLD_NOIFUNC ) }
;
_dl_receive_error ( print_unresolved , relocate_doit , & args ) ;
ElfW ( Dyn ) * dyn = main_map -> l_ld ;
bool first = true ;
while ( dyn -> d_tag != DT_NULL ) {
if ( dyn -> d_tag == DT_NEEDED ) {
l = l -> l_next ;
# ifdef NEED_DL_SYSINFO_DSO if ( l == GLRO ( dl_sysinfo_map ) ) l = l -> l_next ;
# endif if ( ! l -> l_used ) {
if ( first ) {
_dl_printf ( "Unused direct dependencies:\n" ) ;
first = false ;
}
_dl_printf ( "\t%s\n" , l -> l_name ) ;
}
}
++ dyn ;
}
_exit ( first != true ) ;
}
else if ( ! main_map -> l_info [ DT_NEEDED ] ) _dl_printf ( "\tstatically linked\n" ) ;
else {
for ( l = main_map -> l_next ;
l ;
l = l -> l_next ) if ( l -> l_faked ) _dl_printf ( "\t%s => not found\n" , l -> l_libname -> name ) ;
else if ( strcmp ( l -> l_libname -> name , l -> l_name ) == 0 ) _dl_printf ( "\t%s (0x%0*Zx)\n" , l -> l_libname -> name , ( int ) sizeof l -> l_map_start * 2 , ( size_t ) l -> l_map_start ) ;
else _dl_printf ( "\t%s => %s (0x%0*Zx)\n" , l -> l_libname -> name , l -> l_name , ( int ) sizeof l -> l_map_start * 2 , ( size_t ) l -> l_map_start ) ;
}
if ( __builtin_expect ( mode , trace ) != trace ) for ( i = 1 ;
i < ( unsigned int ) _dl_argc ;
++ i ) {
const ElfW ( Sym ) * ref = NULL ;
ElfW ( Addr ) loadbase ;
lookup_t result ;
result = _dl_lookup_symbol_x ( _dl_argv [ i ] , main_map , & ref , main_map -> l_scope , NULL , ELF_RTYPE_CLASS_PLT , DL_LOOKUP_ADD_DEPENDENCY , NULL ) ;
loadbase = LOOKUP_VALUE_ADDRESS ( result ) ;
_dl_printf ( "%s found at 0x%0*Zd in object at 0x%0*Zd\n" , _dl_argv [ i ] , ( int ) sizeof ref -> st_value * 2 , ( size_t ) ref -> st_value , ( int ) sizeof loadbase * 2 , ( size_t ) loadbase ) ;
}
else {
if ( GLRO ( dl_lazy ) >= 0 && GLRO ( dl_verbose ) ) {
struct relocate_args args ;
unsigned int i ;
args . reloc_mode = ( ( GLRO ( dl_lazy ) ? RTLD_LAZY : 0 ) | __RTLD_NOIFUNC ) ;
i = main_map -> l_searchlist . r_nlist ;
while ( i -- > 0 ) {
struct link_map * l = main_map -> l_initfini [ i ] ;
if ( l != & GL ( dl_rtld_map ) && ! l -> l_faked ) {
args . l = l ;
_dl_receive_error ( print_unresolved , relocate_doit , & args ) ;
}
}
if ( ( GLRO ( dl_debug_mask ) & DL_DEBUG_PRELINK ) && rtld_multiple_ref ) {
GL ( dl_rtld_map ) . l_relocated = 0 ;
_dl_relocate_object ( & GL ( dl_rtld_map ) , main_map -> l_scope , __RTLD_NOIFUNC , 0 ) ;
}
}
# define VERNEEDTAG ( DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX ( DT_VERNEED ) ) if ( version_info ) {
int first = 1 ;
struct link_map * map ;
for ( map = main_map ;
map != NULL ;
map = map -> l_next ) {
const char * strtab ;
ElfW ( Dyn ) * dyn = map -> l_info [ VERNEEDTAG ] ;
ElfW ( Verneed ) * ent ;
if ( dyn == NULL ) continue ;
strtab = ( const void * ) D_PTR ( map , l_info [ DT_STRTAB ] ) ;
ent = ( ElfW ( Verneed ) * ) ( map -> l_addr + dyn -> d_un . d_ptr ) ;
if ( first ) {
_dl_printf ( "\n\tVersion information:\n" ) ;
first = 0 ;
}
_dl_printf ( "\t%s:\n" , DSO_FILENAME ( map -> l_name ) ) ;
while ( 1 ) {
ElfW ( Vernaux ) * aux ;
struct link_map * needed ;
needed = find_needed ( strtab + ent -> vn_file ) ;
aux = ( ElfW ( Vernaux ) * ) ( ( char * ) ent + ent -> vn_aux ) ;
while ( 1 ) {
const char * fname = NULL ;
if ( needed != NULL && match_version ( strtab + aux -> vna_name , needed ) ) fname = needed -> l_name ;
_dl_printf ( "\t\t%s (%s) %s=> %s\n" , strtab + ent -> vn_file , strtab + aux -> vna_name , aux -> vna_flags & VER_FLG_WEAK ? "[WEAK] " : "" , fname ? : "not found" ) ;
if ( aux -> vna_next == 0 ) break ;
aux = ( ElfW ( Vernaux ) * ) ( ( char * ) aux + aux -> vna_next ) ;
}
if ( ent -> vn_next == 0 ) break ;
ent = ( ElfW ( Verneed ) * ) ( ( char * ) ent + ent -> vn_next ) ;
}
}
}
}
_exit ( 0 ) ;
}
if ( main_map -> l_info [ ADDRIDX ( DT_GNU_LIBLIST ) ] && ! __builtin_expect ( GLRO ( dl_profile ) != NULL , 0 ) && ! __builtin_expect ( GLRO ( dl_dynamic_weak ) , 0 ) ) {
ElfW ( Lib ) * liblist , * liblistend ;
struct link_map * * r_list , * * r_listend , * l ;
const char * strtab = ( const void * ) D_PTR ( main_map , l_info [ DT_STRTAB ] ) ;
assert ( main_map -> l_info [ VALIDX ( DT_GNU_LIBLISTSZ ) ] != NULL ) ;
liblist = ( ElfW ( Lib ) * ) main_map -> l_info [ ADDRIDX ( DT_GNU_LIBLIST ) ] -> d_un . d_ptr ;
liblistend = ( ElfW ( Lib ) * ) ( ( char * ) liblist + main_map -> l_info [ VALIDX ( DT_GNU_LIBLISTSZ ) ] -> d_un . d_val ) ;
r_list = main_map -> l_searchlist . r_list ;
r_listend = r_list + main_map -> l_searchlist . r_nlist ;
for ( ;
r_list < r_listend && liblist < liblistend ;
r_list ++ ) {
l = * r_list ;
if ( l == main_map ) continue ;
if ( l -> l_addr ) break ;
if ( l -> l_info [ VALIDX ( DT_CHECKSUM ) ] == NULL || l -> l_info [ VALIDX ( DT_CHECKSUM ) ] -> d_un . d_val != liblist -> l_checksum ) break ;
if ( l -> l_info [ VALIDX ( DT_GNU_PRELINKED ) ] == NULL || l -> l_info [ VALIDX ( DT_GNU_PRELINKED ) ] -> d_un . d_val != liblist -> l_time_stamp ) break ;
if ( ! _dl_name_match_p ( strtab + liblist -> l_name , l ) ) break ;
++ liblist ;
}
if ( r_list == r_listend && liblist == liblistend ) prelinked = true ;
if ( __glibc_unlikely ( GLRO ( dl_debug_mask ) & DL_DEBUG_LIBS ) ) _dl_debug_printf ( "\nprelink checking: %s\n" , prelinked ? "ok" : "failed" ) ;
}
GL ( dl_ns ) [ LM_ID_BASE ] . _ns_main_searchlist = & main_map -> l_searchlist ;
GLRO ( dl_initial_searchlist ) = * GL ( dl_ns ) [ LM_ID_BASE ] . _ns_main_searchlist ;
GLRO ( dl_init_all_dirs ) = GL ( dl_all_dirs ) ;
if ( __glibc_unlikely ( GLRO ( dl_debug_mask ) & DL_DEBUG_SCOPES ) ) {
_dl_debug_printf ( "\nInitial object scopes\n" ) ;
for ( struct link_map * l = main_map ;
l != NULL ;
l = l -> l_next ) _dl_show_scope ( l , 0 ) ;
}
if ( prelinked ) {
if ( main_map -> l_info [ ADDRIDX ( DT_GNU_CONFLICT ) ] != NULL ) {
ElfW ( Rela ) * conflict , * conflictend ;
# ifndef HP_TIMING_NONAVAIL hp_timing_t start ;
hp_timing_t stop ;
# endif HP_TIMING_NOW ( start ) ;
assert ( main_map -> l_info [ VALIDX ( DT_GNU_CONFLICTSZ ) ] != NULL ) ;
conflict = ( ElfW ( Rela ) * ) main_map -> l_info [ ADDRIDX ( DT_GNU_CONFLICT ) ] -> d_un . d_ptr ;
conflictend = ( ElfW ( Rela ) * ) ( ( char * ) conflict + main_map -> l_info [ VALIDX ( DT_GNU_CONFLICTSZ ) ] -> d_un . d_val ) ;
_dl_resolve_conflicts ( main_map , conflict , conflictend ) ;
HP_TIMING_NOW ( stop ) ;
HP_TIMING_DIFF ( relocate_time , start , stop ) ;
}
for ( struct link_map * l = main_map ;
l != NULL ;
l = l -> l_next ) {
l -> l_relocated = 1 ;
if ( l -> l_relro_size ) _dl_protect_relro ( l ) ;
if ( l -> l_tls_blocksize != 0 && tls_init_tp_called ) _dl_add_to_slotinfo ( l ) ;
}
}
else {
int consider_profiling = GLRO ( dl_profile ) != NULL ;
# ifndef HP_TIMING_NONAVAIL hp_timing_t start ;
hp_timing_t stop ;
# endif GLRO ( dl_lazy ) |= consider_profiling ;
HP_TIMING_NOW ( start ) ;
unsigned i = main_map -> l_searchlist . r_nlist ;
while ( i -- > 0 ) {
struct link_map * l = main_map -> l_initfini [ i ] ;
struct libname_list * lnp = l -> l_libname -> next ;
while ( __builtin_expect ( lnp != NULL , 0 ) ) {
lnp -> dont_free = 1 ;
lnp = lnp -> next ;
}
l -> l_free_initfini = 0 ;
if ( l != & GL ( dl_rtld_map ) ) _dl_relocate_object ( l , l -> l_scope , GLRO ( dl_lazy ) ? RTLD_LAZY : 0 , consider_profiling ) ;
if ( l -> l_tls_blocksize != 0 && tls_init_tp_called ) _dl_add_to_slotinfo ( l ) ;
}
HP_TIMING_NOW ( stop ) ;
HP_TIMING_DIFF ( relocate_time , start , stop ) ;
if ( __glibc_unlikely ( GL ( dl_profile_map ) != NULL ) ) _dl_start_profile ( ) ;
}
if ( ( ! was_tls_init_tp_called && GL ( dl_tls_max_dtv_idx ) > 0 ) || count_modids != _dl_count_modids ( ) ) ++ GL ( dl_tls_generation ) ;
_dl_allocate_tls_init ( tcbp ) ;
if ( ! tls_init_tp_called ) {
const char * lossage = TLS_INIT_TP ( tcbp ) ;
if ( __glibc_unlikely ( lossage != NULL ) ) _dl_fatal_printf ( "cannot set up thread-local storage: %s\n" , lossage ) ;
}
assert ( GLRO ( dl_init_all_dirs ) == GL ( dl_all_dirs ) ) ;
if ( ! prelinked && rtld_multiple_ref ) {
# ifndef HP_TIMING_NONAVAIL hp_timing_t start ;
hp_timing_t stop ;
hp_timing_t add ;
# endif HP_TIMING_NOW ( start ) ;
GL ( dl_rtld_map ) . l_relocated = 0 ;
_dl_relocate_object ( & GL ( dl_rtld_map ) , main_map -> l_scope , 0 , 0 ) ;
HP_TIMING_NOW ( stop ) ;
HP_TIMING_DIFF ( add , start , stop ) ;
HP_TIMING_ACCUM_NT ( relocate_time , add ) ;
}
_dl_sysdep_start_cleanup ( ) ;
# ifdef SHARED if ( __glibc_unlikely ( GLRO ( dl_naudit ) > 0 ) ) {
struct link_map * head = GL ( dl_ns ) [ LM_ID_BASE ] . _ns_loaded ;
if ( head -> l_auditing == 0 ) {
struct audit_ifaces * afct = GLRO ( dl_audit ) ;
for ( unsigned int cnt = 0 ;
cnt < GLRO ( dl_naudit ) ;
++ cnt ) {
if ( afct -> activity != NULL ) afct -> activity ( & head -> l_audit [ cnt ] . cookie , LA_ACT_CONSISTENT ) ;
afct = afct -> next ;
}
}
}
# endif r = _dl_debug_initialize ( 0 , LM_ID_BASE ) ;
r -> r_state = RT_CONSISTENT ;
_dl_debug_state ( ) ;
LIBC_PROBE ( init_complete , 2 , LM_ID_BASE , r ) ;
# if defined USE_LDCONFIG && ! defined MAP_COPY _dl_unload_cache ( ) ;
# endif } |
1,245,821,301,839,614,700 | debian | 17 | 0 | static gboolean test_dir_is_parent ( GFile * child , GFile * root ) {
GFile * f , * tmp ;
f = g_file_dup ( child ) ;
while ( f ) {
if ( g_file_equal ( f , root ) ) {
g_object_unref ( f ) ;
return TRUE ;
}
tmp = f ;
f = g_file_get_parent ( f ) ;
g_object_unref ( tmp ) ;
}
if ( f ) {
g_object_unref ( f ) ;
}
return FALSE ;
} |
2,390,790,920,103,114,000 | debian | 3 | 0 | static int rcancelrequested ( void ) {
return InterruptPending && ( QueryCancelPending || ProcDiePending ) ;
} |
-1,283,648,210,945,038,800 | chrome | 50 | 1 | void vp9_fwht4x4_c ( const int16_t * input , int16_t * output , int stride ) {
int i ;
int a1 , b1 , c1 , d1 , e1 ;
const int16_t * ip = input ;
int16_t * op = output ;
for ( i = 0 ;
i < 4 ;
i ++ ) {
a1 = ip [ 0 * stride ] ;
b1 = ip [ 1 * stride ] ;
c1 = ip [ 2 * stride ] ;
d1 = ip [ 3 * stride ] ;
a1 += b1 ;
d1 = d1 - c1 ;
e1 = ( a1 - d1 ) >> 1 ;
b1 = e1 - b1 ;
c1 = e1 - c1 ;
a1 -= c1 ;
d1 += b1 ;
op [ 0 ] = a1 ;
op [ 4 ] = c1 ;
op [ 8 ] = d1 ;
op [ 12 ] = b1 ;
ip ++ ;
op ++ ;
}
ip = output ;
op = output ;
for ( i = 0 ;
i < 4 ;
i ++ ) {
a1 = ip [ 0 ] ;
b1 = ip [ 1 ] ;
c1 = ip [ 2 ] ;
d1 = ip [ 3 ] ;
a1 += b1 ;
d1 -= c1 ;
e1 = ( a1 - d1 ) >> 1 ;
b1 = e1 - b1 ;
c1 = e1 - c1 ;
a1 -= c1 ;
d1 += b1 ;
op [ 0 ] = a1 * UNIT_QUANT_FACTOR ;
op [ 1 ] = c1 * UNIT_QUANT_FACTOR ;
op [ 2 ] = d1 * UNIT_QUANT_FACTOR ;
op [ 3 ] = b1 * UNIT_QUANT_FACTOR ;
ip += 4 ;
op += 4 ;
}
} |
-1,335,877,942,018,854,400 | chrome | 15 | 0 | IN_PROC_BROWSER_TEST_F ( UnloadTest , BrowserListCloseBeforeUnloadCancel ) {
NavigateToDataURL ( BEFORE_UNLOAD_HTML , "beforeunload" ) ;
UnloadResults unload_results ;
BrowserList : : CloseAllBrowsersWithProfile ( browser ( ) -> profile ( ) , base : : Bind ( & UnloadResults : : AddSuccess , base : : Unretained ( & unload_results ) ) , base : : Bind ( & UnloadResults : : AddAbort , base : : Unretained ( & unload_results ) ) , false ) ;
base : : string16 expected_title = base : : ASCIIToUTF16 ( "cancelled" ) ;
content : : TitleWatcher title_watcher ( browser ( ) -> tab_strip_model ( ) -> GetActiveWebContents ( ) , expected_title ) ;
ClickModalDialogButton ( false ) ;
ASSERT_EQ ( expected_title , title_watcher . WaitAndGetTitle ( ) ) ;
EXPECT_EQ ( 0 , unload_results . get_successes ( ) ) ;
EXPECT_EQ ( 1 , unload_results . get_aborts ( ) ) ;
content : : WindowedNotificationObserver window_observer ( chrome : : NOTIFICATION_BROWSER_CLOSED , content : : NotificationService : : AllSources ( ) ) ;
chrome : : CloseWindow ( browser ( ) ) ;
ClickModalDialogButton ( true ) ;
window_observer . Wait ( ) ;
} |
2,776,415,072,272,421,400 | debian | 15 | 1 | static void draw_char ( AVCodecContext * avctx , int c ) {
AnsiContext * s = avctx -> priv_data ;
int fg = s -> fg ;
int bg = s -> bg ;
if ( ( s -> attributes & ATTR_BOLD ) ) fg += 8 ;
if ( ( s -> attributes & ATTR_BLINK ) ) bg += 8 ;
if ( ( s -> attributes & ATTR_REVERSE ) ) FFSWAP ( int , fg , bg ) ;
if ( ( s -> attributes & ATTR_CONCEALED ) ) fg = bg ;
ff_draw_pc_font ( s -> frame . data [ 0 ] + s -> y * s -> frame . linesize [ 0 ] + s -> x , s -> frame . linesize [ 0 ] , s -> font , s -> font_height , c , fg , bg ) ;
s -> x += FONT_WIDTH ;
if ( s -> x >= avctx -> width ) {
s -> x = 0 ;
hscroll ( avctx ) ;
}
} |
4,980,785,414,205,851,000 | chrome | 14 | 0 | IN_PROC_BROWSER_TEST_F ( FramebustBlockBrowserTest , SimpleFramebust_Blocked ) {
ui_test_utils : : NavigateToURL ( browser ( ) , embedded_test_server ( ) -> GetURL ( "/iframe.html" ) ) ;
GURL child_url = embedded_test_server ( ) -> GetURL ( "a.com" , "/title1.html" ) ;
NavigateIframeToUrlWithoutGesture ( GetWebContents ( ) , "test" , child_url ) ;
content : : RenderFrameHost * child = content : : ChildFrameAt ( GetWebContents ( ) -> GetMainFrame ( ) , 0 ) ;
EXPECT_EQ ( child_url , child -> GetLastCommittedURL ( ) ) ;
GURL redirect_url = embedded_test_server ( ) -> GetURL ( "b.com" , "/title1.html" ) ;
base : : RunLoop block_waiter ;
blocked_url_added_closure_ = block_waiter . QuitClosure ( ) ;
child -> ExecuteJavaScriptForTests ( base : : ASCIIToUTF16 ( base : : StringPrintf ( "window.top.location = '%s';
" , redirect_url . spec ( ) . c_str ( ) ) ) ) ;
block_waiter . Run ( ) ;
EXPECT_TRUE ( base : : ContainsValue ( GetFramebustTabHelper ( ) -> blocked_urls ( ) , redirect_url ) ) ;
} |
-2,423,144,171,479,607,000 | debian | 22 | 0 | static void pdf_show_text ( fz_context * ctx , pdf_run_processor * pr , pdf_obj * text ) {
pdf_gstate * gstate = pr -> gstate + pr -> gtop ;
pdf_font_desc * fontdesc = gstate -> text . font ;
int i ;
if ( ! fontdesc ) {
fz_warn ( ctx , "cannot draw text since font and size not set" ) ;
return ;
}
if ( pdf_is_array ( ctx , text ) ) {
int n = pdf_array_len ( ctx , text ) ;
for ( i = 0 ;
i < n ;
i ++ ) {
pdf_obj * item = pdf_array_get ( ctx , text , i ) ;
if ( pdf_is_string ( ctx , item ) ) show_string ( ctx , pr , ( unsigned char * ) pdf_to_str_buf ( ctx , item ) , pdf_to_str_len ( ctx , item ) ) ;
else pdf_show_space ( ctx , pr , - pdf_to_real ( ctx , item ) * gstate -> text . size * 0.001f ) ;
}
}
else if ( pdf_is_string ( ctx , text ) ) {
pdf_show_string ( ctx , pr , ( unsigned char * ) pdf_to_str_buf ( ctx , text ) , pdf_to_str_len ( ctx , text ) ) ;
}
} |
-2,908,211,205,972,632,000 | debian | 6 | 0 | static MAIN_WINDOW_REC * mainwindows_find_left_upper ( MAIN_WINDOW_REC * window ) {
MAIN_WINDOW_REC * best ;
best = mainwindows_find_left ( window , FALSE ) ;
if ( best == NULL ) best = mainwindows_find_left ( mainwindows_find_upper ( window ) , TRUE ) ;
return best ;
} |
9,046,191,708,840,219,000 | debian | 9 | 0 | int tipc_netlink_compat_start ( void ) {
int res ;
res = genl_register_family_with_ops ( & tipc_genl_compat_family , tipc_genl_compat_ops ) ;
if ( res ) {
pr_err ( "Failed to register legacy compat interface\n" ) ;
return res ;
}
return 0 ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_BEnhancementParameters ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_BEnhancementParameters , BEnhancementParameters_sequence ) ;
return offset ;
} |
-6,379,515,734,957,310,000 | debian | 3 | 0 | ATF_TC_HEAD ( option_refcnt , tc ) {
atf_tc_set_md_var ( tc , "descr" , "Verify option reference count does not overflow." ) ;
} |
-6,552,851,419,396,579,000 | debian | 10 | 0 | static int dissect_DRIVER_INFO_101 ( tvbuff_t * tvb , int offset , packet_info * pinfo , proto_tree * tree , dcerpc_info * di , guint8 * drep ) {
proto_tree * subtree ;
int struct_start = offset ;
subtree = proto_tree_add_subtree ( tree , tvb , offset , 0 , ett_DRIVER_INFO_101 , NULL , "Driver info level 101" ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , subtree , di , drep , hf_driverinfo_cversion , NULL ) ;
offset = dissect_spoolss_relstr ( tvb , offset , pinfo , subtree , di , drep , hf_drivername , struct_start , NULL ) ;
offset = dissect_spoolss_relstr ( tvb , offset , pinfo , subtree , di , drep , hf_environment , struct_start , NULL ) ;
proto_tree_add_expert ( subtree , pinfo , & ei_unknown_data , tvb , offset , 0 ) ;
return offset ;
} |
1,182,028,467,273,265,000 | debian | 11 | 0 | void close_statements ( ) {
struct st_connection * con ;
DBUG_ENTER ( "close_statements" ) ;
for ( con = connections ;
con < next_con ;
con ++ ) {
if ( con -> stmt ) mysql_stmt_close ( con -> stmt ) ;
con -> stmt = 0 ;
}
DBUG_VOID_RETURN ;
} |
-1,929,262,071,302,712,000 | debian | 4 | 0 | static void Type_Dictionary_Free ( struct _cms_typehandler_struct * self , void * Ptr ) {
cmsDictFree ( ( cmsHANDLE ) Ptr ) ;
cmsUNUSED_PARAMETER ( self ) ;
} |
1,245,821,301,839,614,700 | debian | 11 | 0 | static void copy_file_progress_callback ( goffset current_num_bytes , goffset total_num_bytes , gpointer user_data ) {
ProgressData * pdata ;
goffset new_size ;
pdata = user_data ;
new_size = current_num_bytes - pdata -> last_size ;
if ( new_size > 0 ) {
pdata -> transfer_info -> num_bytes += new_size ;
pdata -> last_size = current_num_bytes ;
report_copy_progress ( pdata -> job , pdata -> source_info , pdata -> transfer_info ) ;
}
} |
-6,068,976,579,504,841,000 | debian | 13 | 0 | static void ctl_error ( u_char errcode ) {
int maclen ;
numctlerrors ++ ;
DPRINTF ( 3 , ( "sending control error %u\n" , errcode ) ) ;
rpkt . r_m_e_op = ( u_char ) CTL_RESPONSE | CTL_ERROR | ( res_opcode & CTL_OP_MASK ) ;
rpkt . status = htons ( ( u_short ) ( errcode << 8 ) & 0xff00 ) ;
rpkt . count = 0 ;
if ( res_authenticate && sys_authenticate ) {
maclen = authencrypt ( res_keyid , ( u_int32 * ) & rpkt , CTL_HEADER_LEN ) ;
sendpkt ( rmt_addr , lcl_inter , - 2 , ( void * ) & rpkt , CTL_HEADER_LEN + maclen ) ;
}
else sendpkt ( rmt_addr , lcl_inter , - 3 , ( void * ) & rpkt , CTL_HEADER_LEN ) ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_VCCapability ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_VCCapability , VCCapability_sequence ) ;
return offset ;
} |
3,034,544,629,554,697,700 | debian | 3 | 0 | static void mips_fulong2e_machine_init ( void ) {
qemu_register_machine ( & mips_fulong2e_machine ) ;
} |
8,460,430,819,945,784,000 | debian | 16 | 0 | int load_kernel ( const char * filename , uint8_t * addr , uint8_t * real_addr ) {
int fd , size ;
int setup_sects ;
fd = open ( filename , O_RDONLY ) ;
if ( fd < 0 ) return - 1 ;
if ( read ( fd , real_addr , 512 ) != 512 ) goto fail ;
setup_sects = real_addr [ 0x1F1 ] ;
if ( ! setup_sects ) setup_sects = 4 ;
if ( read ( fd , real_addr + 512 , setup_sects * 512 ) != setup_sects * 512 ) goto fail ;
size = read ( fd , addr , 16 * 1024 * 1024 ) ;
if ( size < 0 ) goto fail ;
close ( fd ) ;
return size ;
fail : close ( fd ) ;
return - 1 ;
} |
-5,268,859,819,325,808,000 | debian | 12 | 0 | static gboolean monitor_includes_file ( const Monitor * monitor , NautilusFile * file ) {
if ( monitor -> file == file ) {
return TRUE ;
}
if ( monitor -> file != NULL ) {
return FALSE ;
}
if ( file == file -> details -> directory -> details -> as_file ) {
return FALSE ;
}
return nautilus_file_should_show ( file , monitor -> monitor_hidden_files , TRUE ) ;
} |
-866,921,002,076,081,900 | debian | 35 | 0 | static char * convert_mime_hdr_to_string ( TSMBuffer bufp , TSMLoc hdr_loc ) {
TSIOBuffer output_buffer ;
TSIOBufferReader reader ;
int64_t total_avail ;
TSIOBufferBlock block ;
const char * block_start ;
int64_t block_avail ;
char * output_string ;
int output_len ;
output_buffer = TSIOBufferCreate ( ) ;
if ( ! output_buffer ) {
TSError ( "[InkAPITest] couldn't allocate IOBuffer" ) ;
}
reader = TSIOBufferReaderAlloc ( output_buffer ) ;
TSMimeHdrPrint ( bufp , hdr_loc , output_buffer ) ;
total_avail = TSIOBufferReaderAvail ( reader ) ;
output_string = ( char * ) TSmalloc ( total_avail + 1 ) ;
output_len = 0 ;
block = TSIOBufferReaderStart ( reader ) ;
while ( block ) {
block_start = TSIOBufferBlockReadStart ( block , reader , & block_avail ) ;
if ( block_avail == 0 ) {
break ;
}
memcpy ( output_string + output_len , block_start , block_avail ) ;
output_len += block_avail ;
TSIOBufferReaderConsume ( reader , block_avail ) ;
block = TSIOBufferReaderStart ( reader ) ;
}
output_string [ output_len ] = '\0' ;
output_len ++ ;
TSIOBufferReaderFree ( reader ) ;
TSIOBufferDestroy ( output_buffer ) ;
return output_string ;
} |
-2,386,031,673,786,599,400 | debian | 7 | 0 | static gpgme_error_t gpgsm_set_colon_line_handler ( void * engine , engine_colon_line_handler_t fnc , void * fnc_value ) {
engine_gpgsm_t gpgsm = engine ;
gpgsm -> colon . fnc = fnc ;
gpgsm -> colon . fnc_value = fnc_value ;
gpgsm -> colon . any = 0 ;
return 0 ;
} |
-8,028,756,826,159,774,000 | debian | 42 | 0 | void WriteToc ( ArchiveHandle * AH ) {
TocEntry * te ;
char workbuf [ 32 ] ;
int tocCount ;
int i ;
tocCount = 0 ;
for ( te = AH -> toc -> next ;
te != AH -> toc ;
te = te -> next ) {
if ( ( te -> reqs & ( REQ_SCHEMA | REQ_DATA | REQ_SPECIAL ) ) != 0 ) tocCount ++ ;
}
WriteInt ( AH , tocCount ) ;
for ( te = AH -> toc -> next ;
te != AH -> toc ;
te = te -> next ) {
if ( ( te -> reqs & ( REQ_SCHEMA | REQ_DATA | REQ_SPECIAL ) ) == 0 ) continue ;
WriteInt ( AH , te -> dumpId ) ;
WriteInt ( AH , te -> dataDumper ? 1 : 0 ) ;
sprintf ( workbuf , "%u" , te -> catalogId . tableoid ) ;
WriteStr ( AH , workbuf ) ;
sprintf ( workbuf , "%u" , te -> catalogId . oid ) ;
WriteStr ( AH , workbuf ) ;
WriteStr ( AH , te -> tag ) ;
WriteStr ( AH , te -> desc ) ;
WriteInt ( AH , te -> section ) ;
WriteStr ( AH , te -> defn ) ;
WriteStr ( AH , te -> dropStmt ) ;
WriteStr ( AH , te -> copyStmt ) ;
WriteStr ( AH , te -> namespace ) ;
WriteStr ( AH , te -> tablespace ) ;
WriteStr ( AH , te -> owner ) ;
WriteStr ( AH , te -> withOids ? "true" : "false" ) ;
for ( i = 0 ;
i < te -> nDeps ;
i ++ ) {
sprintf ( workbuf , "%d" , te -> dependencies [ i ] ) ;
WriteStr ( AH , workbuf ) ;
}
WriteStr ( AH , NULL ) ;
if ( AH -> WriteExtraTocPtr ) ( * AH -> WriteExtraTocPtr ) ( AH , te ) ;
}
} |
1,700,977,331,036,764,400 | debian | 3 | 0 | EVP_CIPHER_CTX * EVP_CIPHER_CTX_new ( void ) {
return OPENSSL_zalloc ( sizeof ( EVP_CIPHER_CTX ) ) ;
} |
-5,279,853,345,356,125,000 | debian | 66 | 0 | void cisco_autorp_print ( netdissect_options * ndo , register const u_char * bp , register u_int len ) {
int type ;
int numrps ;
int hold ;
ND_TCHECK ( bp [ 0 ] ) ;
ND_PRINT ( ( ndo , " auto-rp " ) ) ;
type = bp [ 0 ] ;
switch ( type ) {
case 0x11 : ND_PRINT ( ( ndo , "candidate-advert" ) ) ;
break ;
case 0x12 : ND_PRINT ( ( ndo , "mapping" ) ) ;
break ;
default : ND_PRINT ( ( ndo , "type-0x%02x" , type ) ) ;
break ;
}
ND_TCHECK ( bp [ 1 ] ) ;
numrps = bp [ 1 ] ;
ND_TCHECK2 ( bp [ 2 ] , 2 ) ;
ND_PRINT ( ( ndo , " Hold " ) ) ;
hold = EXTRACT_16BITS ( & bp [ 2 ] ) ;
if ( hold ) unsigned_relts_print ( ndo , EXTRACT_16BITS ( & bp [ 2 ] ) ) ;
else ND_PRINT ( ( ndo , "FOREVER" ) ) ;
bp += 8 ;
len -= 8 ;
while ( numrps -- ) {
int nentries ;
char s ;
ND_TCHECK2 ( bp [ 0 ] , 4 ) ;
ND_PRINT ( ( ndo , " RP %s" , ipaddr_string ( ndo , bp ) ) ) ;
ND_TCHECK ( bp [ 4 ] ) ;
switch ( bp [ 4 ] & 0x3 ) {
case 0 : ND_PRINT ( ( ndo , " PIMv?" ) ) ;
break ;
case 1 : ND_PRINT ( ( ndo , " PIMv1" ) ) ;
break ;
case 2 : ND_PRINT ( ( ndo , " PIMv2" ) ) ;
break ;
case 3 : ND_PRINT ( ( ndo , " PIMv1+2" ) ) ;
break ;
}
if ( bp [ 4 ] & 0xfc ) ND_PRINT ( ( ndo , " [rsvd=0x%02x]" , bp [ 4 ] & 0xfc ) ) ;
ND_TCHECK ( bp [ 5 ] ) ;
nentries = bp [ 5 ] ;
bp += 6 ;
len -= 6 ;
s = ' ' ;
for ( ;
nentries ;
nentries -- ) {
ND_TCHECK2 ( bp [ 0 ] , 6 ) ;
ND_PRINT ( ( ndo , "%c%s%s/%d" , s , bp [ 0 ] & 1 ? "!" : "" , ipaddr_string ( ndo , & bp [ 2 ] ) , bp [ 1 ] ) ) ;
if ( bp [ 0 ] & 0x02 ) {
ND_PRINT ( ( ndo , " bidir" ) ) ;
}
if ( bp [ 0 ] & 0xfc ) {
ND_PRINT ( ( ndo , "[rsvd=0x%02x]" , bp [ 0 ] & 0xfc ) ) ;
}
s = ',' ;
bp += 6 ;
len -= 6 ;
}
}
return ;
trunc : ND_PRINT ( ( ndo , "[|autorp]" ) ) ;
return ;
} |
2,390,790,920,103,114,000 | debian | 119 | 0 | int pg_regcomp ( regex_t * re , const chr * string , size_t len , int flags , Oid collation ) {
struct vars var ;
struct vars * v = & var ;
struct guts * g ;
int i ;
size_t j ;
# ifdef REG_DEBUG FILE * debug = ( flags & REG_PROGRESS ) ? stdout : ( FILE * ) NULL ;
# else FILE * debug = ( FILE * ) NULL ;
# endif # define CNOERR ( ) {
if ( ISERR ( ) ) return freev ( v , v -> err ) ;
}
if ( re == NULL || string == NULL ) return REG_INVARG ;
if ( ( flags & REG_QUOTE ) && ( flags & ( REG_ADVANCED | REG_EXPANDED | REG_NEWLINE ) ) ) return REG_INVARG ;
if ( ! ( flags & REG_EXTENDED ) && ( flags & REG_ADVF ) ) return REG_INVARG ;
pg_set_regex_collation ( collation ) ;
v -> re = re ;
v -> now = string ;
v -> stop = v -> now + len ;
v -> savenow = v -> savestop = NULL ;
v -> err = 0 ;
v -> cflags = flags ;
v -> nsubexp = 0 ;
v -> subs = v -> sub10 ;
v -> nsubs = 10 ;
for ( j = 0 ;
j < v -> nsubs ;
j ++ ) v -> subs [ j ] = NULL ;
v -> nfa = NULL ;
v -> cm = NULL ;
v -> nlcolor = COLORLESS ;
v -> wordchrs = NULL ;
v -> tree = NULL ;
v -> treechain = NULL ;
v -> treefree = NULL ;
v -> cv = NULL ;
v -> cv2 = NULL ;
v -> lacons = NULL ;
v -> nlacons = 0 ;
v -> spaceused = 0 ;
re -> re_magic = REMAGIC ;
re -> re_info = 0 ;
re -> re_csize = sizeof ( chr ) ;
re -> re_collation = collation ;
re -> re_guts = NULL ;
re -> re_fns = VS ( & functions ) ;
re -> re_guts = VS ( MALLOC ( sizeof ( struct guts ) ) ) ;
if ( re -> re_guts == NULL ) return freev ( v , REG_ESPACE ) ;
g = ( struct guts * ) re -> re_guts ;
g -> tree = NULL ;
initcm ( v , & g -> cmap ) ;
v -> cm = & g -> cmap ;
g -> lacons = NULL ;
g -> nlacons = 0 ;
ZAPCNFA ( g -> search ) ;
v -> nfa = newnfa ( v , v -> cm , ( struct nfa * ) NULL ) ;
CNOERR ( ) ;
v -> cv = newcvec ( 100 , 20 ) ;
if ( v -> cv == NULL ) return freev ( v , REG_ESPACE ) ;
lexstart ( v ) ;
if ( ( v -> cflags & REG_NLSTOP ) || ( v -> cflags & REG_NLANCH ) ) {
v -> nlcolor = subcolor ( v -> cm , newline ( ) ) ;
okcolors ( v -> nfa , v -> cm ) ;
}
CNOERR ( ) ;
v -> tree = parse ( v , EOS , PLAIN , v -> nfa -> init , v -> nfa -> final ) ;
assert ( SEE ( EOS ) ) ;
CNOERR ( ) ;
assert ( v -> tree != NULL ) ;
specialcolors ( v -> nfa ) ;
CNOERR ( ) ;
# ifdef REG_DEBUG if ( debug != NULL ) {
fprintf ( debug , "\n\n\n========= RAW ==========\n" ) ;
dumpnfa ( v -> nfa , debug ) ;
dumpst ( v -> tree , debug , 1 ) ;
}
# endif optst ( v , v -> tree ) ;
v -> ntree = numst ( v -> tree , 1 ) ;
markst ( v -> tree ) ;
cleanst ( v ) ;
# ifdef REG_DEBUG if ( debug != NULL ) {
fprintf ( debug , "\n\n\n========= TREE FIXED ==========\n" ) ;
dumpst ( v -> tree , debug , 1 ) ;
}
# endif re -> re_info |= nfatree ( v , v -> tree , debug ) ;
CNOERR ( ) ;
assert ( v -> nlacons == 0 || v -> lacons != NULL ) ;
for ( i = 1 ;
i < v -> nlacons ;
i ++ ) {
struct subre * lasub = & v -> lacons [ i ] ;
# ifdef REG_DEBUG if ( debug != NULL ) fprintf ( debug , "\n\n\n========= LA%d ==========\n" , i ) ;
# endif nfanode ( v , lasub , ! LATYPE_IS_AHEAD ( lasub -> subno ) , debug ) ;
}
CNOERR ( ) ;
if ( v -> tree -> flags & SHORTER ) NOTE ( REG_USHORTEST ) ;
# ifdef REG_DEBUG if ( debug != NULL ) fprintf ( debug , "\n\n\n========= SEARCH ==========\n" ) ;
# endif ( DISCARD ) optimize ( v -> nfa , debug ) ;
CNOERR ( ) ;
makesearch ( v , v -> nfa ) ;
CNOERR ( ) ;
compact ( v -> nfa , & g -> search ) ;
CNOERR ( ) ;
re -> re_nsub = v -> nsubexp ;
v -> re = NULL ;
g -> magic = GUTSMAGIC ;
g -> cflags = v -> cflags ;
g -> info = re -> re_info ;
g -> nsub = re -> re_nsub ;
g -> tree = v -> tree ;
v -> tree = NULL ;
g -> ntree = v -> ntree ;
g -> compare = ( v -> cflags & REG_ICASE ) ? casecmp : cmp ;
g -> lacons = v -> lacons ;
v -> lacons = NULL ;
g -> nlacons = v -> nlacons ;
# ifdef REG_DEBUG if ( flags & REG_DUMP ) dump ( re , stdout ) ;
# endif assert ( v -> err == 0 ) ;
return freev ( v , 0 ) ;
} |
-8,962,831,256,613,788,000 | debian | 19 | 0 | static gint dissect_ac_if_input_terminal ( tvbuff_t * tvb , gint offset , packet_info * pinfo _U_ , proto_tree * tree , usb_conv_info_t * usb_conv_info _U_ ) {
gint offset_start ;
offset_start = offset ;
proto_tree_add_item ( tree , hf_ac_if_input_terminalid , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset += 1 ;
proto_tree_add_item ( tree , hf_ac_if_input_terminaltype , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ;
offset += 2 ;
proto_tree_add_item ( tree , hf_ac_if_input_assocterminal , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset += 1 ;
proto_tree_add_item ( tree , hf_ac_if_input_nrchannels , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset += 1 ;
proto_tree_add_item ( tree , hf_ac_if_input_channelconfig , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ;
offset += 2 ;
proto_tree_add_item ( tree , hf_ac_if_input_channelnames , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset += 1 ;
proto_tree_add_item ( tree , hf_ac_if_input_terminal , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset += 1 ;
return offset - offset_start ;
} |
583,170,025,160,259,800 | debian | 6 | 0 | static void net_slirp_cleanup ( NetClientState * nc ) {
SlirpState * s = DO_UPCAST ( SlirpState , nc , nc ) ;
slirp_cleanup ( s -> slirp ) ;
slirp_smb_cleanup ( s ) ;
QTAILQ_REMOVE ( & slirp_stacks , s , entry ) ;
} |
-1,710,554,222,303,887,400 | chrome | 30 | 0 | void vp9_idct16x16_1_add_sse2 ( const int16_t * input , uint8_t * dest , int stride ) {
__m128i dc_value ;
const __m128i zero = _mm_setzero_si128 ( ) ;
int a , i ;
a = dct_const_round_shift ( input [ 0 ] * cospi_16_64 ) ;
a = dct_const_round_shift ( a * cospi_16_64 ) ;
a = ROUND_POWER_OF_TWO ( a , 6 ) ;
dc_value = _mm_set1_epi16 ( a ) ;
for ( i = 0 ;
i < 2 ;
++ i ) {
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
dest += 8 - ( stride * 16 ) ;
}
} |
-5,615,323,818,347,734,000 | debian | 54 | 0 | static int fix_paths ( void ) {
char buff [ FN_REFLEN ] , * pos ;
DBUG_ENTER ( "fix_paths" ) ;
convert_dirname ( mysql_home , mysql_home , NullS ) ;
my_realpath ( mysql_home , mysql_home , MYF ( 0 ) ) ;
pos = strend ( mysql_home ) ;
if ( pos [ - 1 ] != FN_LIBCHAR ) {
pos [ 0 ] = FN_LIBCHAR ;
pos [ 1 ] = 0 ;
}
convert_dirname ( lc_messages_dir , lc_messages_dir , NullS ) ;
convert_dirname ( mysql_real_data_home , mysql_real_data_home , NullS ) ;
( void ) my_load_path ( mysql_home , mysql_home , "" ) ;
( void ) my_load_path ( mysql_real_data_home , mysql_real_data_home , mysql_home ) ;
( void ) my_load_path ( pidfile_name , pidfile_name_ptr , mysql_real_data_home ) ;
convert_dirname ( opt_plugin_dir , opt_plugin_dir_ptr ? opt_plugin_dir_ptr : get_relative_path ( PLUGINDIR ) , NullS ) ;
( void ) my_load_path ( opt_plugin_dir , opt_plugin_dir , mysql_home ) ;
opt_plugin_dir_ptr = opt_plugin_dir ;
pidfile_name_ptr = pidfile_name ;
my_realpath ( mysql_unpacked_real_data_home , mysql_real_data_home , MYF ( 0 ) ) ;
mysql_unpacked_real_data_home_len = ( int ) strlen ( mysql_unpacked_real_data_home ) ;
if ( mysql_unpacked_real_data_home [ mysql_unpacked_real_data_home_len - 1 ] == FN_LIBCHAR ) -- mysql_unpacked_real_data_home_len ;
char * sharedir = get_relative_path ( SHAREDIR ) ;
if ( test_if_hard_path ( sharedir ) ) strmake_buf ( buff , sharedir ) ;
else strxnmov ( buff , sizeof ( buff ) - 1 , mysql_home , sharedir , NullS ) ;
convert_dirname ( buff , buff , NullS ) ;
( void ) my_load_path ( lc_messages_dir , lc_messages_dir , buff ) ;
if ( charsets_dir ) strmake_buf ( mysql_charsets_dir , charsets_dir ) ;
else strxnmov ( mysql_charsets_dir , sizeof ( mysql_charsets_dir ) - 1 , buff , CHARSET_DIR , NullS ) ;
( void ) my_load_path ( mysql_charsets_dir , mysql_charsets_dir , buff ) ;
convert_dirname ( mysql_charsets_dir , mysql_charsets_dir , NullS ) ;
charsets_dir = mysql_charsets_dir ;
if ( init_tmpdir ( & mysql_tmpdir_list , opt_mysql_tmpdir ) ) DBUG_RETURN ( 1 ) ;
if ( ! opt_mysql_tmpdir ) opt_mysql_tmpdir = mysql_tmpdir ;
# ifdef HAVE_REPLICATION if ( ! slave_load_tmpdir ) slave_load_tmpdir = mysql_tmpdir ;
# endif if ( opt_secure_file_priv ) {
if ( * opt_secure_file_priv == 0 ) {
my_free ( opt_secure_file_priv ) ;
opt_secure_file_priv = 0 ;
}
else {
if ( strlen ( opt_secure_file_priv ) >= FN_REFLEN ) opt_secure_file_priv [ FN_REFLEN - 1 ] = '\0' ;
if ( my_realpath ( buff , opt_secure_file_priv , 0 ) ) {
sql_print_warning ( "Failed to normalize the argument for --secure-file-priv." ) ;
DBUG_RETURN ( 1 ) ;
}
char * secure_file_real_path = ( char * ) my_malloc ( FN_REFLEN , MYF ( MY_FAE ) ) ;
convert_dirname ( secure_file_real_path , buff , NullS ) ;
my_free ( opt_secure_file_priv ) ;
opt_secure_file_priv = secure_file_real_path ;
}
}
DBUG_RETURN ( 0 ) ;
} |
-2,222,463,888,415,250,000 | chrome | 3 | 0 | int vp9_get_quantizer ( VP9_COMP * cpi ) {
return cpi -> common . base_qindex ;
} |
8,206,514,580,434,226,000 | chrome | 13 | 0 | IN_PROC_BROWSER_TEST_F ( HttpsEngagementPageLoadMetricsBrowserTest , ClosedWhileHidden_Http ) {
StartHttpServer ( ) ;
base : : TimeDelta upper_bound = NavigateInForegroundAndCloseInBackgroundWithTiming ( http_test_server_ -> GetURL ( "/simple.html" ) ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHttpEngagementHistogram , 1 ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHttpsEngagementHistogram , 0 ) ;
int32_t bucket_min = histogram_tester_ . GetAllSamples ( internal : : kHttpEngagementHistogram ) [ 0 ] . min ;
EXPECT_GE ( upper_bound . InMilliseconds ( ) , bucket_min ) ;
EXPECT_LT ( 0 , bucket_min ) ;
FakeUserMetricsUpload ( ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHttpsEngagementSessionPercentage , 1 ) ;
int32_t ratio_bucket = histogram_tester_ . GetAllSamples ( internal : : kHttpsEngagementSessionPercentage ) [ 0 ] . min ;
EXPECT_EQ ( 0 , ratio_bucket ) ;
} |
1,760,449,185,745,615,400 | debian | 5 | 0 | int64_t TSHttpTxnServerRespBodyBytesGet ( TSHttpTxn txnp ) {
sdk_assert ( sdk_sanity_check_txn ( txnp ) == TS_SUCCESS ) ;
HttpSM * sm = ( HttpSM * ) txnp ;
return sm -> server_response_body_bytes ;
} |
-7,899,851,216,763,490,000 | chrome | 4 | 0 | static UBool hasCESU8Data ( const UConverter * cnv ) {
# if UCONFIG_ONLY_HTML_CONVERSION return FALSE ;
# else return ( UBool ) ( cnv -> sharedData == & _CESU8Data ) ;
# endif } |
-6,068,976,579,504,841,000 | debian | 61 | 0 | static const struct ctl_var * ctl_getitem ( const struct ctl_var * var_list , char * * data ) {
static const struct ctl_var eol = {
0 , EOV , NULL }
;
static char buf [ 128 ] ;
static u_long quiet_until ;
const struct ctl_var * v ;
const char * pch ;
char * cp ;
char * tp ;
while ( reqpt < reqend && ( * reqpt == ',' || isspace ( ( unsigned char ) * reqpt ) ) ) reqpt ++ ;
if ( reqpt >= reqend ) return NULL ;
if ( NULL == var_list ) return & eol ;
cp = reqpt ;
for ( v = var_list ;
! ( EOV & v -> flags ) ;
v ++ ) {
if ( ! ( PADDING & v -> flags ) && * cp == * ( v -> text ) ) {
pch = v -> text ;
while ( '\0' != * pch && '=' != * pch && cp < reqend && * cp == * pch ) {
cp ++ ;
pch ++ ;
}
if ( '\0' == * pch || '=' == * pch ) {
while ( cp < reqend && isspace ( ( u_char ) * cp ) ) cp ++ ;
if ( cp == reqend || ',' == * cp ) {
buf [ 0 ] = '\0' ;
* data = buf ;
if ( cp < reqend ) cp ++ ;
reqpt = cp ;
return v ;
}
if ( '=' == * cp ) {
cp ++ ;
tp = buf ;
while ( cp < reqend && isspace ( ( u_char ) * cp ) ) cp ++ ;
while ( cp < reqend && * cp != ',' ) {
* tp ++ = * cp ++ ;
if ( ( size_t ) ( tp - buf ) >= sizeof ( buf ) ) {
ctl_error ( CERR_BADFMT ) ;
numctlbadpkts ++ ;
NLOG ( NLOG_SYSEVENT ) if ( quiet_until <= current_time ) {
quiet_until = current_time + 300 ;
msyslog ( LOG_WARNING , "Possible 'ntpdx' exploit from %s#%u (possibly spoofed)" , stoa ( rmt_addr ) , SRCPORT ( rmt_addr ) ) ;
}
return NULL ;
}
}
if ( cp < reqend ) cp ++ ;
* tp -- = '\0' ;
while ( tp >= buf && isspace ( ( u_char ) * tp ) ) * tp -- = '\0' ;
reqpt = cp ;
* data = buf ;
return v ;
}
}
cp = reqpt ;
}
}
return v ;
} |
8,849,962,823,026,424,000 | debian | 8 | 0 | static gchar * qio_channel_websock_date_str ( void ) {
struct tm tm ;
time_t now = time ( NULL ) ;
char datebuf [ 128 ] ;
gmtime_r ( & now , & tm ) ;
strftime ( datebuf , sizeof ( datebuf ) , "%a, %d %b %Y %H:%M:%S GMT" , & tm ) ;
return g_strdup ( datebuf ) ;
} |
-4,885,528,830,177,757,000 | debian | 16 | 0 | static SORT_KEY_BLOCKS * alloc_key_blocks ( MI_CHECK * param , uint blocks , uint buffer_length ) {
reg1 uint i ;
SORT_KEY_BLOCKS * block ;
DBUG_ENTER ( "alloc_key_blocks" ) ;
if ( ! ( block = ( SORT_KEY_BLOCKS * ) my_malloc ( ( sizeof ( SORT_KEY_BLOCKS ) + buffer_length + IO_SIZE ) * blocks , MYF ( 0 ) ) ) ) {
mi_check_print_error ( param , "Not enough memory for sort-key-blocks" ) ;
return ( 0 ) ;
}
for ( i = 0 ;
i < blocks ;
i ++ ) {
block [ i ] . inited = 0 ;
block [ i ] . buff = ( uchar * ) ( block + blocks ) + ( buffer_length + IO_SIZE ) * i ;
}
DBUG_RETURN ( block ) ;
} |
-7,892,989,539,740,546,000 | debian | 40 | 0 | static int pcm_bluray_parse_header ( AVCodecContext * avctx , const uint8_t * header ) {
static const uint8_t bits_per_samples [ 4 ] = {
0 , 16 , 20 , 24 }
;
static const uint32_t channel_layouts [ 16 ] = {
0 , AV_CH_LAYOUT_MONO , 0 , AV_CH_LAYOUT_STEREO , AV_CH_LAYOUT_SURROUND , AV_CH_LAYOUT_2_1 , AV_CH_LAYOUT_4POINT0 , AV_CH_LAYOUT_2_2 , AV_CH_LAYOUT_5POINT0 , AV_CH_LAYOUT_5POINT1 , AV_CH_LAYOUT_7POINT0 , AV_CH_LAYOUT_7POINT1 , 0 , 0 , 0 , 0 }
;
static const uint8_t channels [ 16 ] = {
0 , 1 , 0 , 2 , 3 , 3 , 4 , 4 , 5 , 6 , 7 , 8 , 0 , 0 , 0 , 0 }
;
uint8_t channel_layout = header [ 2 ] >> 4 ;
if ( avctx -> debug & FF_DEBUG_PICT_INFO ) av_dlog ( avctx , "pcm_bluray_parse_header: header = %02x%02x%02x%02x\n" , header [ 0 ] , header [ 1 ] , header [ 2 ] , header [ 3 ] ) ;
avctx -> bits_per_coded_sample = bits_per_samples [ header [ 3 ] >> 6 ] ;
if ( ! avctx -> bits_per_coded_sample ) {
av_log ( avctx , AV_LOG_ERROR , "reserved sample depth (0)\n" ) ;
return - 1 ;
}
avctx -> sample_fmt = avctx -> bits_per_coded_sample == 16 ? AV_SAMPLE_FMT_S16 : AV_SAMPLE_FMT_S32 ;
avctx -> bits_per_raw_sample = avctx -> bits_per_coded_sample ;
switch ( header [ 2 ] & 0x0f ) {
case 1 : avctx -> sample_rate = 48000 ;
break ;
case 4 : avctx -> sample_rate = 96000 ;
break ;
case 5 : avctx -> sample_rate = 192000 ;
break ;
default : avctx -> sample_rate = 0 ;
av_log ( avctx , AV_LOG_ERROR , "reserved sample rate (%d)\n" , header [ 2 ] & 0x0f ) ;
return - 1 ;
}
avctx -> channel_layout = channel_layouts [ channel_layout ] ;
avctx -> channels = channels [ channel_layout ] ;
if ( ! avctx -> channels ) {
av_log ( avctx , AV_LOG_ERROR , "reserved channel configuration (%d)\n" , channel_layout ) ;
return - 1 ;
}
avctx -> bit_rate = FFALIGN ( avctx -> channels , 2 ) * avctx -> sample_rate * avctx -> bits_per_coded_sample ;
if ( avctx -> debug & FF_DEBUG_PICT_INFO ) av_dlog ( avctx , "pcm_bluray_parse_header: %d channels, %d bits per sample, %d Hz, %d bit/s\n" , avctx -> channels , avctx -> bits_per_coded_sample , avctx -> sample_rate , avctx -> bit_rate ) ;
return 0 ;
} |
6,458,694,302,493,204,000 | debian | 5 | 0 | static Datum ExecEvalCaseTestExpr ( ExprState * exprstate , ExprContext * econtext , bool * isNull , ExprDoneCond * isDone ) {
if ( isDone ) * isDone = ExprSingleResult ;
* isNull = econtext -> caseValue_isNull ;
return econtext -> caseValue_datum ;
} |
1,760,449,185,745,615,400 | debian | 22 | 0 | TSReturnCode TSHttpTxnInfoIntGet ( TSHttpTxn txnp , TSHttpTxnInfoKey key , TSMgmtInt * value ) {
sdk_assert ( sdk_sanity_check_txn ( txnp ) == TS_SUCCESS ) ;
sdk_assert ( sdk_sanity_check_null_ptr ( ( void * ) value ) == TS_SUCCESS ) ;
HttpSM * s = reinterpret_cast < HttpSM * > ( txnp ) ;
HttpCacheSM * c_sm = & ( s -> get_cache_sm ( ) ) ;
switch ( key ) {
case TS_TXN_INFO_CACHE_HIT_RAM : * value = ( static_cast < TSMgmtInt > ( c_sm -> is_ram_cache_hit ( ) ) ) ;
break ;
case TS_TXN_INFO_CACHE_COMPRESSED_IN_RAM : * value = ( static_cast < TSMgmtInt > ( c_sm -> is_compressed_in_ram ( ) ) ) ;
break ;
case TS_TXN_INFO_CACHE_HIT_RWW : * value = ( static_cast < TSMgmtInt > ( c_sm -> is_readwhilewrite_inprogress ( ) ) ) ;
break ;
case TS_TXN_INFO_CACHE_OPEN_READ_TRIES : * value = ( static_cast < TSMgmtInt > ( c_sm -> get_open_read_tries ( ) ) ) ;
break ;
case TS_TXN_INFO_CACHE_OPEN_WRITE_TRIES : * value = ( static_cast < TSMgmtInt > ( c_sm -> get_open_write_tries ( ) ) ) ;
break ;
case TS_TXN_INFO_CACHE_VOLUME : * value = ( static_cast < TSMgmtInt > ( c_sm -> get_volume_number ( ) ) ) ;
break ;
default : return TS_ERROR ;
}
return TS_SUCCESS ;
} |
5,991,533,509,192,664,000 | debian | 50 | 0 | mbfl_string * mbfl_html_numeric_entity ( mbfl_string * string , mbfl_string * result , int * convmap , int mapsize , int type ) {
struct collector_htmlnumericentity_data pc ;
mbfl_memory_device device ;
mbfl_convert_filter * encoder ;
int n ;
unsigned char * p ;
if ( string == NULL || result == NULL ) {
return NULL ;
}
mbfl_string_init ( result ) ;
result -> no_language = string -> no_language ;
result -> no_encoding = string -> no_encoding ;
mbfl_memory_device_init ( & device , string -> len , 0 ) ;
pc . decoder = mbfl_convert_filter_new ( mbfl_no_encoding_wchar , string -> no_encoding , mbfl_memory_device_output , 0 , & device ) ;
if ( type == 0 ) {
encoder = mbfl_convert_filter_new ( string -> no_encoding , mbfl_no_encoding_wchar , collector_encode_htmlnumericentity , 0 , & pc ) ;
}
else if ( type == 2 ) {
encoder = mbfl_convert_filter_new ( string -> no_encoding , mbfl_no_encoding_wchar , collector_encode_hex_htmlnumericentity , 0 , & pc ) ;
}
else {
encoder = mbfl_convert_filter_new ( string -> no_encoding , mbfl_no_encoding_wchar , collector_decode_htmlnumericentity , ( int ( * ) ( void * ) ) mbfl_filt_decode_htmlnumericentity_flush , & pc ) ;
}
if ( pc . decoder == NULL || encoder == NULL ) {
mbfl_convert_filter_delete ( encoder ) ;
mbfl_convert_filter_delete ( pc . decoder ) ;
return NULL ;
}
pc . status = 0 ;
pc . cache = 0 ;
pc . digit = 0 ;
pc . convmap = convmap ;
pc . mapsize = mapsize ;
p = string -> val ;
n = string -> len ;
if ( p != NULL ) {
while ( n > 0 ) {
if ( ( * encoder -> filter_function ) ( * p ++ , encoder ) < 0 ) {
break ;
}
n -- ;
}
}
mbfl_convert_filter_flush ( encoder ) ;
mbfl_convert_filter_flush ( pc . decoder ) ;
result = mbfl_memory_device_result ( & device , result ) ;
mbfl_convert_filter_delete ( encoder ) ;
mbfl_convert_filter_delete ( pc . decoder ) ;
return result ;
} |
-3,740,862,514,502,467,000 | debian | 50 | 0 | static void redoos2 ( struct alltabs * at ) {
int i ;
at -> os2f = tmpfile ( ) ;
putshort ( at -> os2f , at -> os2 . version ) ;
putshort ( at -> os2f , at -> os2 . avgCharWid ) ;
putshort ( at -> os2f , at -> os2 . weightClass ) ;
putshort ( at -> os2f , at -> os2 . widthClass ) ;
putshort ( at -> os2f , at -> os2 . fstype ) ;
putshort ( at -> os2f , at -> os2 . ysubXSize ) ;
putshort ( at -> os2f , at -> os2 . ysubYSize ) ;
putshort ( at -> os2f , at -> os2 . ysubXOff ) ;
putshort ( at -> os2f , at -> os2 . ysubYOff ) ;
putshort ( at -> os2f , at -> os2 . ysupXSize ) ;
putshort ( at -> os2f , at -> os2 . ysupYSize ) ;
putshort ( at -> os2f , at -> os2 . ysupXOff ) ;
putshort ( at -> os2f , at -> os2 . ysupYOff ) ;
putshort ( at -> os2f , at -> os2 . yStrikeoutSize ) ;
putshort ( at -> os2f , at -> os2 . yStrikeoutPos ) ;
putshort ( at -> os2f , at -> os2 . sFamilyClass ) ;
for ( i = 0 ;
i < 10 ;
++ i ) putc ( at -> os2 . panose [ i ] , at -> os2f ) ;
for ( i = 0 ;
i < 4 ;
++ i ) putlong ( at -> os2f , at -> os2 . unicoderange [ i ] ) ;
for ( i = 0 ;
i < 4 ;
++ i ) putc ( at -> os2 . achVendID [ i ] , at -> os2f ) ;
putshort ( at -> os2f , at -> os2 . fsSel ) ;
putshort ( at -> os2f , at -> os2 . firstcharindex ) ;
putshort ( at -> os2f , at -> os2 . lastcharindex ) ;
putshort ( at -> os2f , at -> os2 . ascender ) ;
putshort ( at -> os2f , at -> os2 . descender ) ;
putshort ( at -> os2f , at -> os2 . linegap ) ;
putshort ( at -> os2f , at -> os2 . winascent ) ;
putshort ( at -> os2f , at -> os2 . windescent ) ;
if ( at -> os2 . version >= 1 ) {
putlong ( at -> os2f , at -> os2 . ulCodePage [ 0 ] ) ;
putlong ( at -> os2f , at -> os2 . ulCodePage [ 1 ] ) ;
}
if ( at -> os2 . version >= 2 ) {
putshort ( at -> os2f , at -> os2 . xHeight ) ;
putshort ( at -> os2f , at -> os2 . capHeight ) ;
putshort ( at -> os2f , at -> os2 . defChar ) ;
putshort ( at -> os2f , at -> os2 . breakChar ) ;
putshort ( at -> os2f , at -> os2 . maxContext ) ;
}
at -> os2len = ftell ( at -> os2f ) ;
if ( ( at -> os2len & 2 ) != 0 ) putshort ( at -> os2f , 0 ) ;
} |
-3,740,862,514,502,467,000 | debian | 37 | 0 | static void FigureFullMetricsEnd ( SplineFont * sf , struct glyphinfo * gi , int istt ) {
int i , lasti , lastv , lastdefault = istt ? 3 : 1 ;
int width , vwidth ;
lasti = lastv = gi -> gcnt - 1 ;
for ( i = gi -> gcnt - 1 ;
i > lastdefault && gi -> bygid [ i ] == - 1 ;
-- i ) ;
if ( i >= lastdefault ) {
width = sf -> glyphs [ gi -> bygid [ i ] ] -> width ;
vwidth = sf -> glyphs [ gi -> bygid [ i ] ] -> vwidth ;
lasti = lastv = i ;
for ( i = lasti - 1 ;
i >= lastdefault ;
-- i ) {
if ( SCWorthOutputting ( sf -> glyphs [ gi -> bygid [ i ] ] ) ) {
if ( sf -> glyphs [ gi -> bygid [ i ] ] -> width != width ) break ;
else lasti = i ;
}
}
gi -> lasthwidth = lasti ;
if ( sf -> hasvmetrics ) {
for ( i = lastv - 1 ;
i >= lastdefault ;
-- i ) {
if ( SCWorthOutputting ( sf -> glyphs [ gi -> bygid [ i ] ] ) ) {
if ( sf -> glyphs [ gi -> bygid [ i ] ] -> vwidth != vwidth ) break ;
else lastv = i ;
}
}
gi -> lastvwidth = lastv ;
}
}
else {
gi -> lasthwidth = 0 ;
gi -> lastvwidth = 0 ;
}
} |
3,935,234,056,444,097,500 | debian | 24 | 0 | static int rtp_packetize_mpa ( sout_stream_id_sys_t * id , block_t * in ) {
int i_max = rtp_mtu ( id ) - 4 ;
int i_count = ( in -> i_buffer + i_max - 1 ) / i_max ;
uint8_t * p_data = in -> p_buffer ;
int i_data = in -> i_buffer ;
int i ;
for ( i = 0 ;
i < i_count ;
i ++ ) {
int i_payload = __MIN ( i_max , i_data ) ;
block_t * out = block_Alloc ( 16 + i_payload ) ;
rtp_packetize_common ( id , out , ( i == i_count - 1 ) ? 1 : 0 , in -> i_pts ) ;
SetWBE ( out -> p_buffer + 12 , 0 ) ;
SetWBE ( out -> p_buffer + 14 , i * i_max ) ;
memcpy ( & out -> p_buffer [ 16 ] , p_data , i_payload ) ;
out -> i_dts = in -> i_dts + i * in -> i_length / i_count ;
out -> i_length = in -> i_length / i_count ;
rtp_packetize_send ( id , out ) ;
p_data += i_payload ;
i_data -= i_payload ;
}
block_Release ( in ) ;
return VLC_SUCCESS ;
} |
1,743,019,814,289,113,000 | debian | 39 | 0 | void ff_h264_direct_ref_list_init ( H264Context * const h ) {
Picture * const ref1 = & h -> ref_list [ 1 ] [ 0 ] ;
Picture * const cur = h -> cur_pic_ptr ;
int list , j , field ;
int sidx = ( h -> picture_structure & 1 ) ^ 1 ;
int ref1sidx = ( ref1 -> reference & 1 ) ^ 1 ;
for ( list = 0 ;
list < 2 ;
list ++ ) {
cur -> ref_count [ sidx ] [ list ] = h -> ref_count [ list ] ;
for ( j = 0 ;
j < h -> ref_count [ list ] ;
j ++ ) cur -> ref_poc [ sidx ] [ list ] [ j ] = 4 * h -> ref_list [ list ] [ j ] . frame_num + ( h -> ref_list [ list ] [ j ] . reference & 3 ) ;
}
if ( h -> picture_structure == PICT_FRAME ) {
memcpy ( cur -> ref_count [ 1 ] , cur -> ref_count [ 0 ] , sizeof ( cur -> ref_count [ 0 ] ) ) ;
memcpy ( cur -> ref_poc [ 1 ] , cur -> ref_poc [ 0 ] , sizeof ( cur -> ref_poc [ 0 ] ) ) ;
}
cur -> mbaff = FRAME_MBAFF ;
h -> col_fieldoff = 0 ;
if ( h -> picture_structure == PICT_FRAME ) {
int cur_poc = h -> cur_pic_ptr -> poc ;
int * col_poc = h -> ref_list [ 1 ] -> field_poc ;
h -> col_parity = ( FFABS ( col_poc [ 0 ] - cur_poc ) >= FFABS ( col_poc [ 1 ] - cur_poc ) ) ;
ref1sidx = sidx = h -> col_parity ;
}
else if ( ! ( h -> picture_structure & h -> ref_list [ 1 ] [ 0 ] . reference ) && ! h -> ref_list [ 1 ] [ 0 ] . mbaff ) {
h -> col_fieldoff = 2 * h -> ref_list [ 1 ] [ 0 ] . reference - 3 ;
}
if ( h -> slice_type_nos != AV_PICTURE_TYPE_B || h -> direct_spatial_mv_pred ) return ;
for ( list = 0 ;
list < 2 ;
list ++ ) {
fill_colmap ( h , h -> map_col_to_list0 , list , sidx , ref1sidx , 0 ) ;
if ( FRAME_MBAFF ) for ( field = 0 ;
field < 2 ;
field ++ ) fill_colmap ( h , h -> map_col_to_list0_field [ field ] , list , field , field , 1 ) ;
}
} |
-769,658,847,024,738,700 | debian | 28 | 0 | static gpgme_error_t _uiserver_decrypt ( void * engine , int verify , gpgme_data_t ciph , gpgme_data_t plain ) {
engine_uiserver_t uiserver = engine ;
gpgme_error_t err ;
const char * protocol ;
char * cmd ;
if ( ! uiserver ) return gpg_error ( GPG_ERR_INV_VALUE ) ;
if ( uiserver -> protocol == GPGME_PROTOCOL_DEFAULT ) protocol = "" ;
else if ( uiserver -> protocol == GPGME_PROTOCOL_OpenPGP ) protocol = " --protocol=OpenPGP" ;
else if ( uiserver -> protocol == GPGME_PROTOCOL_CMS ) protocol = " --protocol=CMS" ;
else return gpgme_error ( GPG_ERR_UNSUPPORTED_PROTOCOL ) ;
if ( asprintf ( & cmd , "DECRYPT%s%s" , protocol , verify ? "" : " --no-verify" ) < 0 ) return gpg_error_from_syserror ( ) ;
uiserver -> input_cb . data = ciph ;
err = uiserver_set_fd ( uiserver , INPUT_FD , map_data_enc ( uiserver -> input_cb . data ) ) ;
if ( err ) {
free ( cmd ) ;
return gpg_error ( GPG_ERR_GENERAL ) ;
}
uiserver -> output_cb . data = plain ;
err = uiserver_set_fd ( uiserver , OUTPUT_FD , 0 ) ;
if ( err ) {
free ( cmd ) ;
return gpg_error ( GPG_ERR_GENERAL ) ;
}
uiserver -> inline_data = NULL ;
err = start ( engine , cmd ) ;
free ( cmd ) ;
return err ;
} |
-6,024,601,983,167,899,000 | debian | 19 | 0 | GAppInfo * nautilus_mime_get_default_application_for_file ( NautilusFile * file ) {
GAppInfo * app ;
char * mime_type ;
char * uri_scheme ;
if ( ! nautilus_mime_actions_check_if_required_attributes_ready ( file ) ) {
return NULL ;
}
mime_type = nautilus_file_get_mime_type ( file ) ;
app = g_app_info_get_default_for_type ( mime_type , ! nautilus_file_is_local_or_fuse ( file ) ) ;
g_free ( mime_type ) ;
if ( app == NULL ) {
uri_scheme = nautilus_file_get_uri_scheme ( file ) ;
if ( uri_scheme != NULL ) {
app = g_app_info_get_default_for_uri_scheme ( uri_scheme ) ;
g_free ( uri_scheme ) ;
}
}
return app ;
} |
-7,855,974,557,509,681,000 | debian | 12 | 0 | int32 get_atttypmod ( Oid relid , AttrNumber attnum ) {
HeapTuple tp ;
tp = SearchSysCache2 ( ATTNUM , ObjectIdGetDatum ( relid ) , Int16GetDatum ( attnum ) ) ;
if ( HeapTupleIsValid ( tp ) ) {
Form_pg_attribute att_tup = ( Form_pg_attribute ) GETSTRUCT ( tp ) ;
int32 result ;
result = att_tup -> atttypmod ;
ReleaseSysCache ( tp ) ;
return result ;
}
else return - 1 ;
} |
3,599,206,110,384,554,500 | debian | 36 | 1 | 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 ) |
-341,028,540,041,678,100 | debian | 6 | 0 | static void __attribute__ ( ( __format__ ( __printf__ , 1 , 0 ) ) ) vwarning ( const char * fmt , va_list ap ) {
int serrno = errno ;
( void ) fprintf ( stderr , "%s: " , progname ) ;
vfprintf ( stderr , fmt , ap ) ;
( void ) fprintf ( stderr , ": %s" , strerror ( serrno ) ) ;
} |
-182,831,737,838,159,100 | chrome | 11 | 0 | IN_PROC_BROWSER_TEST_F ( ContentFaviconDriverTest , AssociateIconWithInitialPageDespiteMetaRefreshTag ) {
ASSERT_TRUE ( embedded_test_server ( ) -> Start ( ) ) ;
GURL url = embedded_test_server ( ) -> GetURL ( "/favicon/page_with_meta_refresh_tag.html" ) ;
GURL landing_url = embedded_test_server ( ) -> GetURL ( "/favicon/page_with_favicon.html" ) ;
PendingTaskWaiter waiter ( web_contents ( ) ) ;
waiter . AlsoRequireUrl ( landing_url ) ;
ui_test_utils : : NavigateToURLWithDisposition ( browser ( ) , url , WindowOpenDisposition : : CURRENT_TAB , ui_test_utils : : BROWSER_TEST_NONE ) ;
waiter . Wait ( ) ;
EXPECT_NE ( nullptr , GetFaviconForPageURL ( url , favicon_base : : IconType : : kFavicon ) . bitmap_data ) ;
EXPECT_NE ( nullptr , GetFaviconForPageURL ( landing_url , favicon_base : : IconType : : kFavicon ) . bitmap_data ) ;
} |
-3,384,986,069,176,965,600 | chrome | 5 | 0 | static void enable_segmentation ( VP8_COMP * cpi ) {
cpi -> mb . e_mbd . segmentation_enabled = 1 ;
cpi -> mb . e_mbd . update_mb_segmentation_map = 1 ;
cpi -> mb . e_mbd . update_mb_segmentation_data = 1 ;
} |
-7,724,655,445,309,868,000 | debian | 12 | 0 | static inline tcg_target_ulong cpu_tb_exec ( CPUState * cpu , uint8_t * tb_ptr ) {
CPUArchState * env = cpu -> env_ptr ;
tcg_target_ulong next_tb = tcg_qemu_tb_exec ( env , tb_ptr ) ;
if ( ( next_tb & TB_EXIT_MASK ) > TB_EXIT_IDX1 ) {
TranslationBlock * tb = ( TranslationBlock * ) ( next_tb & ~ TB_EXIT_MASK ) ;
cpu_pc_from_tb ( env , tb ) ;
}
if ( ( next_tb & TB_EXIT_MASK ) == TB_EXIT_REQUESTED ) {
cpu -> tcg_exit_req = 0 ;
}
return next_tb ;
} |
3,599,206,110,384,554,500 | debian | 29 | 0 | int PEM_write_ ## name ( FILE * fp , type * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cb , void * u ) ;
# endif # define DECLARE_PEM_read_bio ( name , type ) type * PEM_read_bio_ ## name ( BIO * bp , type * * x , pem_password_cb * cb , void * u ) ;
# define DECLARE_PEM_write_bio ( name , type ) int PEM_write_bio_ ## name ( BIO * bp , type * x ) ;
# define DECLARE_PEM_write_bio_const ( name , type ) int PEM_write_bio_ ## name ( BIO * bp , const type * x ) ;
# define DECLARE_PEM_write_cb_bio ( name , type ) int PEM_write_bio_ ## name ( BIO * bp , type * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cb , void * u ) ;
# define DECLARE_PEM_write ( name , type ) DECLARE_PEM_write_bio ( name , type ) DECLARE_PEM_write_fp ( name , type ) # define DECLARE_PEM_write_const ( name , type ) DECLARE_PEM_write_bio_const ( name , type ) DECLARE_PEM_write_fp_const ( name , type ) # define DECLARE_PEM_write_cb ( name , type ) DECLARE_PEM_write_cb_bio ( name , type ) DECLARE_PEM_write_cb_fp ( name , type ) # define DECLARE_PEM_read ( name , type ) DECLARE_PEM_read_bio ( name , type ) DECLARE_PEM_read_fp ( name , type ) # define DECLARE_PEM_rw ( name , type ) DECLARE_PEM_read ( name , type ) DECLARE_PEM_write ( name , type ) # define DECLARE_PEM_rw_const ( name , type ) DECLARE_PEM_read ( name , type ) DECLARE_PEM_write_const ( name , type ) # define DECLARE_PEM_rw_cb ( name , type ) DECLARE_PEM_read ( name , type ) DECLARE_PEM_write_cb ( name , type ) typedef int pem_password_cb ( char * buf , int size , int rwflag , void * userdata ) ;
int PEM_get_EVP_CIPHER_INFO ( char * header , EVP_CIPHER_INFO * cipher ) ;
int PEM_do_header ( EVP_CIPHER_INFO * cipher , unsigned char * data , long * len , pem_password_cb * callback , void * u ) ;
int PEM_read_bio ( BIO * bp , char * * name , char * * header , unsigned char * * data , long * len ) ;
# define PEM_FLAG_SECURE 0x1 # define PEM_FLAG_EAY_COMPATIBLE 0x2 # define PEM_FLAG_ONLY_B64 0x4 int PEM_read_bio_ex ( BIO * bp , char * * name , char * * header , unsigned char * * data , long * len , unsigned int flags ) ;
int PEM_bytes_read_bio_secmem ( unsigned char * * pdata , long * plen , char * * pnm , const char * name , BIO * bp , pem_password_cb * cb , void * u ) ;
int PEM_write_bio ( BIO * bp , const char * name , const char * hdr , const unsigned char * data , long len ) ;
int PEM_bytes_read_bio ( unsigned char * * pdata , long * plen , char * * pnm , const char * name , BIO * bp , pem_password_cb * cb , void * u ) ;
void * PEM_ASN1_read_bio ( d2i_of_void * d2i , const char * name , BIO * bp , void * * x , pem_password_cb * cb , void * u ) ;
int PEM_ASN1_write_bio ( i2d_of_void * i2d , const char * name , BIO * bp , void * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cb , void * u ) ;
STACK_OF ( X509_INFO ) * PEM_X509_INFO_read_bio ( BIO * bp , STACK_OF ( X509_INFO ) * sk , pem_password_cb * cb , void * u ) ;
int PEM_X509_INFO_write_bio ( BIO * bp , X509_INFO * xi , EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cd , void * u ) ;
# ifndef OPENSSL_NO_STDIO int PEM_read ( FILE * fp , char * * name , char * * header , unsigned char * * data , long * len ) ;
int PEM_write ( FILE * fp , const char * name , const char * hdr , const unsigned char * data , long len ) ;
void * PEM_ASN1_read ( d2i_of_void * d2i , const char * name , FILE * fp , void * * x , pem_password_cb * cb , void * u ) ;
int PEM_ASN1_write ( i2d_of_void * i2d , const char * name , FILE * fp , void * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * callback , void * u ) ;
STACK_OF ( X509_INFO ) * PEM_X509_INFO_read ( FILE * fp , STACK_OF ( X509_INFO ) * sk , pem_password_cb * cb , void * u ) ;
# endif int PEM_SignInit ( EVP_MD_CTX * ctx , EVP_MD * type ) ;
int PEM_SignUpdate ( EVP_MD_CTX * ctx , unsigned char * d , unsigned int cnt ) ;
int PEM_SignFinal ( EVP_MD_CTX * ctx , unsigned char * sigret , unsigned int * siglen , EVP_PKEY * pkey ) ;
int PEM_def_callback ( char * buf , int num , int rwflag , void * userdata ) ;
void PEM_proc_type ( char * buf , int type ) ;
void PEM_dek_info ( char * buf , const char * type , int len , char * str ) ;
# include < openssl / symhacks . h > DECLARE_PEM_rw ( X509 , X509 ) DECLARE_PEM_rw ( X509_AUX , X509 ) DECLARE_PEM_rw ( X509_REQ , X509_REQ ) DECLARE_PEM_write ( X509_REQ_NEW , X509_REQ ) DECLARE_PEM_rw ( X509_CRL , X509_CRL ) DECLARE_PEM_rw ( PKCS7 , PKCS7 ) DECLARE_PEM_rw ( NETSCAPE_CERT_SEQUENCE , NETSCAPE_CERT_SEQUENCE ) DECLARE_PEM_rw ( PKCS8 , X509_SIG ) DECLARE_PEM_rw ( PKCS8_PRIV_KEY_INFO , PKCS8_PRIV_KEY_INFO ) # ifndef OPENSSL_NO_RSA DECLARE_PEM_rw_cb ( RSAPrivateKey , RSA ) DECLARE_PEM_rw_const ( RSAPublicKey , RSA ) DECLARE_PEM_rw ( RSA_PUBKEY , RSA ) # endif # ifndef OPENSSL_NO_DSA DECLARE_PEM_rw_cb ( DSAPrivateKey , DSA ) DECLARE_PEM_rw ( DSA_PUBKEY , DSA ) DECLARE_PEM_rw_const ( DSAparams , DSA ) # endif # ifndef OPENSSL_NO_EC DECLARE_PEM_rw_const ( ECPKParameters , EC_GROUP ) DECLARE_PEM_rw_cb ( ECPrivateKey , EC_KEY ) |
4,180,964,683,905,831,000 | debian | 4 | 0 | static int selinux_file_receive ( struct file * file ) {
const struct cred * cred = current_cred ( ) ;
return file_has_perm ( cred , file , file_to_av ( file ) ) ;
} |
-560,820,000,732,125,060 | chrome | 15 | 0 | static void exsltMathConstantFunction ( xmlXPathParserContextPtr ctxt , int nargs ) {
double ret ;
xmlChar * name ;
if ( nargs != 2 ) {
xmlXPathSetArityError ( ctxt ) ;
return ;
}
ret = xmlXPathPopNumber ( ctxt ) ;
if ( xmlXPathCheckError ( ctxt ) ) return ;
name = xmlXPathPopString ( ctxt ) ;
if ( xmlXPathCheckError ( ctxt ) ) return ;
ret = exsltMathConstant ( name , ret ) ;
if ( name != NULL ) xmlFree ( name ) ;
xmlXPathReturnNumber ( ctxt , ret ) ;
} |
8,460,430,819,945,784,000 | debian | 65 | 0 | void ppc_prep_init ( int ram_size , int vga_ram_size , int boot_device , DisplayState * ds , const char * * fd_filename , int snapshot , const char * kernel_filename , const char * kernel_cmdline , const char * initrd_filename ) {
char buf [ 1024 ] ;
int PPC_io_memory ;
int ret , linux_boot , initrd_size , i , nb_nics1 , fd ;
linux_boot = ( kernel_filename != NULL ) ;
cpu_register_physical_memory ( 0 , ram_size , 0 ) ;
isa_mem_base = 0xc0000000 ;
if ( linux_boot ) {
ret = load_image ( kernel_filename , phys_ram_base + KERNEL_LOAD_ADDR ) ;
if ( ret < 0 ) {
fprintf ( stderr , "qemu: could not load kernel '%s'\n" , kernel_filename ) ;
exit ( 1 ) ;
}
initrd_size = 0 ;
# if 0 if ( initrd_filename ) {
initrd_size = load_image ( initrd_filename , phys_ram_base + INITRD_LOAD_ADDR ) ;
if ( initrd_size < 0 ) {
fprintf ( stderr , "qemu: could not load initial ram disk '%s'\n" , initrd_filename ) ;
exit ( 1 ) ;
}
}
# endif PPC_init_hw ( ram_size , KERNEL_LOAD_ADDR , ret , KERNEL_STACK_ADDR , boot_device , initrd_filename ) ;
}
else {
snprintf ( buf , sizeof ( buf ) , "%s" , BIOS_FILENAME ) ;
printf ( "load BIOS at %p\n" , phys_ram_base + 0x000f0000 ) ;
ret = load_image ( buf , phys_ram_base + 0x000f0000 ) ;
if ( ret != 0x10000 ) {
fprintf ( stderr , "qemu: could not load PPC bios '%s' (%d)\n%m\n" , buf , ret ) ;
exit ( 1 ) ;
}
}
vga_initialize ( ds , phys_ram_base + ram_size , ram_size , vga_ram_size ) ;
rtc_init ( 0x70 , 8 ) ;
pic_init ( ) ;
fd = serial_open_device ( ) ;
serial_init ( 0x3f8 , 4 , fd ) ;
# if 1 nb_nics1 = nb_nics ;
if ( nb_nics1 > NE2000_NB_MAX ) nb_nics1 = NE2000_NB_MAX ;
for ( i = 0 ;
i < nb_nics1 ;
i ++ ) {
isa_ne2000_init ( ne2000_io [ i ] , ne2000_irq [ i ] , & nd_table [ i ] ) ;
}
# endif for ( i = 0 ;
i < 2 ;
i ++ ) {
isa_ide_init ( ide_iobase [ i ] , ide_iobase2 [ i ] , ide_irq [ i ] , bs_table [ 2 * i ] , bs_table [ 2 * i + 1 ] ) ;
}
kbd_init ( ) ;
AUD_init ( ) ;
DMA_init ( ) ;
fdctrl_init ( 6 , 2 , 0 , 0x3f0 , fd_table ) ;
PPC_io_memory = cpu_register_io_memory ( 0 , PPC_io_read , PPC_io_write ) ;
cpu_register_physical_memory ( 0x80000000 , 0x10000 , PPC_io_memory ) ;
register_ioport_read ( 0x398 , 2 , 1 , & PREP_io_read , NULL ) ;
register_ioport_write ( 0x398 , 2 , 1 , & PREP_io_write , NULL ) ;
register_ioport_write ( 0x0092 , 0x1 , 1 , & PREP_io_800_writeb , NULL ) ;
register_ioport_read ( 0x0800 , 0x52 , 1 , & PREP_io_800_readb , NULL ) ;
register_ioport_write ( 0x0800 , 0x52 , 1 , & PREP_io_800_writeb , NULL ) ;
PPC_io_memory = cpu_register_io_memory ( 0 , PPC_ioB_read , PPC_ioB_write ) ;
cpu_register_physical_memory ( 0xBFFFFFF0 , 0x4 , PPC_io_memory ) ;
prep_NVRAM_init ( ) ;
PPC_end_init ( ) ;
} |
-6,704,066,512,670,389,000 | debian | 35 | 0 | static const char * lookup_name ( struct cpio * cpio , struct name_cache * * name_cache_variable , int ( * lookup_fn ) ( struct cpio * , const char * * , id_t ) , id_t id ) {
char asnum [ 16 ] ;
struct name_cache * cache ;
const char * name ;
int slot ;
if ( * name_cache_variable == NULL ) {
* name_cache_variable = malloc ( sizeof ( struct name_cache ) ) ;
if ( * name_cache_variable == NULL ) lafe_errc ( 1 , ENOMEM , "No more memory" ) ;
memset ( * name_cache_variable , 0 , sizeof ( struct name_cache ) ) ;
( * name_cache_variable ) -> size = name_cache_size ;
}
cache = * name_cache_variable ;
cache -> probes ++ ;
slot = id % cache -> size ;
if ( cache -> cache [ slot ] . name != NULL ) {
if ( cache -> cache [ slot ] . id == id ) {
cache -> hits ++ ;
return ( cache -> cache [ slot ] . name ) ;
}
free ( cache -> cache [ slot ] . name ) ;
cache -> cache [ slot ] . name = NULL ;
}
if ( lookup_fn ( cpio , & name , id ) == 0 ) {
if ( name == NULL || name [ 0 ] == '\0' ) {
snprintf ( asnum , sizeof ( asnum ) , "%u" , ( unsigned ) id ) ;
name = asnum ;
}
cache -> cache [ slot ] . name = strdup ( name ) ;
if ( cache -> cache [ slot ] . name != NULL ) {
cache -> cache [ slot ] . id = id ;
return ( cache -> cache [ slot ] . name ) ;
}
}
return ( NULL ) ;
} |
-7,434,014,980,763,121,000 | debian | 3 | 0 | int dissect_ber_set_of ( gboolean implicit_tag , asn1_ctx_t * actx , proto_tree * parent_tree , tvbuff_t * tvb , int offset , const ber_sequence_t * seq , gint hf_id , gint ett_id ) {
return dissect_ber_sq_of ( implicit_tag , BER_UNI_TAG_SET , actx , parent_tree , tvb , offset , NO_BOUND , NO_BOUND , seq , hf_id , ett_id ) ;
} |
-5,082,285,935,423,529,000 | debian | 14 | 0 | static int dissect_rsl_ie_message_id ( tvbuff_t * tvb , packet_info * pinfo _U_ , proto_tree * tree , int offset , gboolean is_mandatory ) {
proto_tree * ie_tree ;
guint8 ie_id ;
if ( is_mandatory == FALSE ) {
ie_id = tvb_get_guint8 ( tvb , offset ) ;
if ( ie_id != RSL_IE_MESSAGE_ID ) return offset ;
}
ie_tree = proto_tree_add_subtree ( tree , tvb , offset , 0 , ett_ie_message_id , NULL , "Message Identifier IE" ) ;
proto_tree_add_item ( ie_tree , hf_rsl_ie_id , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( tree , hf_rsl_msg_type , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
return offset ;
} |
2,419,147,764,757,351,400 | debian | 5 | 0 | static void virtio_s390_notify ( void * opaque , uint16_t vector ) {
VirtIOS390Device * dev = ( VirtIOS390Device * ) opaque ;
uint64_t token = s390_virtio_device_vq_token ( dev , vector ) ;
kvm_s390_virtio_irq ( s390_cpu_addr2state ( 0 ) , 0 , token ) ;
} |
7,191,899,184,788,440,000 | debian | 12 | 0 | static void init_username ( ) {
my_free ( full_username ) ;
my_free ( part_username ) ;
MYSQL_RES * result ;
LINT_INIT ( result ) ;
if ( ! mysql_query ( & mysql , "select USER()" ) && ( result = mysql_use_result ( & mysql ) ) ) {
MYSQL_ROW cur = mysql_fetch_row ( result ) ;
full_username = my_strdup ( cur [ 0 ] , MYF ( MY_WME ) ) ;
part_username = my_strdup ( strtok ( cur [ 0 ] , "@" ) , MYF ( MY_WME ) ) ;
( void ) mysql_fetch_row ( result ) ;
}
} |
9,176,142,195,250,516,000 | debian | 6 | 0 | static char * purple_get_account_prpl_id ( account_t * acc ) {
if ( g_strcmp0 ( acc -> prpl -> name , "oscar" ) == 0 ) {
return ( g_ascii_isdigit ( acc -> user [ 0 ] ) ) ? "prpl-icq" : "prpl-aim" ;
}
return acc -> prpl -> data ;
} |
2,895,622,461,494,525,400 | debian | 31 | 0 | static void test_rename ( ) {
MYSQL_STMT * stmt ;
const char * query = "rename table t1 to t2, t3 to t4" ;
int rc ;
myheader ( "test_table_rename" ) ;
rc = mysql_query ( mysql , "DROP TABLE IF EXISTS t1, t2, t3, t4" ) ;
myquery ( rc ) ;
stmt = mysql_simple_prepare ( mysql , query ) ;
check_stmt ( stmt ) ;
rc = mysql_query ( mysql , "create table t1 (a int)" ) ;
myquery ( rc ) ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute_r ( stmt , rc ) ;
if ( ! opt_silent ) fprintf ( stdout , "rename without t3\n" ) ;
rc = mysql_query ( mysql , "create table t3 (a int)" ) ;
myquery ( rc ) ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute ( stmt , rc ) ;
if ( ! opt_silent ) fprintf ( stdout , "rename with t3\n" ) ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute_r ( stmt , rc ) ;
if ( ! opt_silent ) fprintf ( stdout , "rename renamed\n" ) ;
rc = mysql_query ( mysql , "rename table t2 to t1, t4 to t3" ) ;
myquery ( rc ) ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute ( stmt , rc ) ;
if ( ! opt_silent ) fprintf ( stdout , "rename reverted\n" ) ;
mysql_stmt_close ( stmt ) ;
rc = mysql_query ( mysql , "DROP TABLE t2, t4" ) ;
myquery ( rc ) ;
} |
4,423,867,112,908,499,000 | chrome | 25 | 0 | void vp9_quantize_fp_c ( const tran_low_t * coeff_ptr , intptr_t n_coeffs , int skip_block , const int16_t * zbin_ptr , const int16_t * round_ptr , const int16_t * quant_ptr , const int16_t * quant_shift_ptr , tran_low_t * qcoeff_ptr , tran_low_t * dqcoeff_ptr , const int16_t * dequant_ptr , int zbin_oq_value , uint16_t * eob_ptr , const int16_t * scan , const int16_t * iscan ) {
int i , eob = - 1 ;
( void ) zbin_ptr ;
( void ) quant_shift_ptr ;
( void ) zbin_oq_value ;
( void ) iscan ;
vpx_memset ( qcoeff_ptr , 0 , n_coeffs * sizeof ( * qcoeff_ptr ) ) ;
vpx_memset ( dqcoeff_ptr , 0 , n_coeffs * sizeof ( * dqcoeff_ptr ) ) ;
if ( ! skip_block ) {
for ( i = 0 ;
i < n_coeffs ;
i ++ ) {
const int rc = scan [ i ] ;
const int coeff = coeff_ptr [ rc ] ;
const int coeff_sign = ( coeff >> 31 ) ;
const int abs_coeff = ( coeff ^ coeff_sign ) - coeff_sign ;
int tmp = clamp ( abs_coeff + round_ptr [ rc != 0 ] , INT16_MIN , INT16_MAX ) ;
tmp = ( tmp * quant_ptr [ rc != 0 ] ) >> 16 ;
qcoeff_ptr [ rc ] = ( tmp ^ coeff_sign ) - coeff_sign ;
dqcoeff_ptr [ rc ] = qcoeff_ptr [ rc ] * dequant_ptr [ rc != 0 ] ;
if ( tmp ) eob = i ;
}
}
* eob_ptr = eob + 1 ;
} |
-3,384,986,069,176,965,600 | chrome | 15 | 0 | static void set_default_lf_deltas ( VP8_COMP * cpi ) {
cpi -> mb . e_mbd . mode_ref_lf_delta_enabled = 1 ;
cpi -> mb . e_mbd . mode_ref_lf_delta_update = 1 ;
vpx_memset ( cpi -> mb . e_mbd . ref_lf_deltas , 0 , sizeof ( cpi -> mb . e_mbd . ref_lf_deltas ) ) ;
vpx_memset ( cpi -> mb . e_mbd . mode_lf_deltas , 0 , sizeof ( cpi -> mb . e_mbd . mode_lf_deltas ) ) ;
cpi -> mb . e_mbd . ref_lf_deltas [ INTRA_FRAME ] = 2 ;
cpi -> mb . e_mbd . ref_lf_deltas [ LAST_FRAME ] = 0 ;
cpi -> mb . e_mbd . ref_lf_deltas [ GOLDEN_FRAME ] = - 2 ;
cpi -> mb . e_mbd . ref_lf_deltas [ ALTREF_FRAME ] = - 2 ;
cpi -> mb . e_mbd . mode_lf_deltas [ 0 ] = 4 ;
if ( cpi -> oxcf . Mode == MODE_REALTIME ) cpi -> mb . e_mbd . mode_lf_deltas [ 1 ] = - 12 ;
else cpi -> mb . e_mbd . mode_lf_deltas [ 1 ] = - 2 ;
cpi -> mb . e_mbd . mode_lf_deltas [ 2 ] = 2 ;
cpi -> mb . e_mbd . mode_lf_deltas [ 3 ] = 4 ;
} |
2,636,502,839,178,711,600 | debian | 20 | 0 | static void dissect_coap_opt_block ( tvbuff_t * tvb , proto_item * head_item , proto_tree * subtree , gint offset , gint opt_length , coap_info * coinfo , coap_common_dissect_t * dissect_hf ) {
guint8 val = 0 ;
guint encoded_block_size ;
guint block_esize ;
if ( opt_length == 0 ) {
coinfo -> block_number = 0 ;
val = 0 ;
}
else {
coinfo -> block_number = coap_get_opt_uint ( tvb , offset , opt_length ) >> 4 ;
val = tvb_get_guint8 ( tvb , offset + opt_length - 1 ) & 0x0f ;
}
proto_tree_add_uint ( subtree , dissect_hf -> hf . opt_block_number , tvb , offset , opt_length , coinfo -> block_number ) ;
coinfo -> block_mflag = ( val & COAP_BLOCK_MFLAG_MASK ) >> 3 ;
proto_tree_add_uint ( subtree , dissect_hf -> hf . opt_block_mflag , tvb , offset + opt_length - 1 , 1 , coinfo -> block_mflag ) ;
encoded_block_size = val & COAP_BLOCK_SIZE_MASK ;
block_esize = 1 << ( encoded_block_size + 4 ) ;
proto_tree_add_uint_format ( subtree , dissect_hf -> hf . opt_block_size , tvb , offset + opt_length - 1 , 1 , encoded_block_size , "Block Size: %u (%u encoded)" , block_esize , encoded_block_size ) ;
proto_item_append_text ( head_item , ": NUM:%u, M:%u, SZX:%u" , coinfo -> block_number , coinfo -> block_mflag , block_esize ) ;
} |
-5,082,285,935,423,529,000 | debian | 10 | 0 | void proto_reg_handoff_rsl ( void ) {
dissector_handle_t rsl_handle ;
rsl_handle = create_dissector_handle ( dissect_rsl , proto_rsl ) ;
dissector_add_uint ( "lapd.gsm.sapi" , LAPD_GSM_SAPI_RA_SIG_PROC , rsl_handle ) ;
gsm_cbch_handle = find_dissector ( "gsm_cbch" ) ;
gsm_cbs_handle = find_dissector ( "gsm_cbs" ) ;
gsm_a_ccch_handle = find_dissector ( "gsm_a_ccch" ) ;
gsm_a_dtap_handle = find_dissector ( "gsm_a_dtap" ) ;
gsm_a_sacch_handle = find_dissector ( "gsm_a_sacch" ) ;
} |
-6,435,087,038,712,483,000 | debian | 29 | 0 | static int mpeg_decode_frame ( AVCodecContext * avctx , void * data , int * got_output , AVPacket * avpkt ) {
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
Mpeg1Context * s = avctx -> priv_data ;
AVFrame * picture = data ;
MpegEncContext * s2 = & s -> mpeg_enc_ctx ;
av_dlog ( avctx , "fill_buffer\n" ) ;
if ( buf_size == 0 || ( buf_size == 4 && AV_RB32 ( buf ) == SEQ_END_CODE ) ) {
if ( s2 -> low_delay == 0 && s2 -> next_picture_ptr ) {
int ret = av_frame_ref ( picture , & s2 -> next_picture_ptr -> f ) ;
if ( ret < 0 ) return ret ;
s2 -> next_picture_ptr = NULL ;
* got_output = 1 ;
}
return buf_size ;
}
if ( s2 -> flags & CODEC_FLAG_TRUNCATED ) {
int next = ff_mpeg1_find_frame_end ( & s2 -> parse_context , buf , buf_size , NULL ) ;
if ( ff_combine_frame ( & s2 -> parse_context , next , ( const uint8_t * * ) & buf , & buf_size ) < 0 ) return buf_size ;
}
if ( s -> mpeg_enc_ctx_allocated == 0 && avctx -> codec_tag == AV_RL32 ( "VCR2" ) ) vcr2_init_sequence ( avctx ) ;
s -> slice_count = 0 ;
if ( avctx -> extradata && ! s -> extradata_decoded ) {
int ret = decode_chunks ( avctx , picture , got_output , avctx -> extradata , avctx -> extradata_size ) ;
s -> extradata_decoded = 1 ;
if ( ret < 0 && ( avctx -> err_recognition & AV_EF_EXPLODE ) ) return ret ;
}
return decode_chunks ( avctx , picture , got_output , buf , buf_size ) ;
} |
-3,569,070,884,878,445,600 | debian | 53 | 0 | static inline int svq3_decode_block ( GetBitContext * gb , int16_t * block , int index , const int type ) {
static const uint8_t * const scan_patterns [ 4 ] = {
luma_dc_zigzag_scan , zigzag_scan , svq3_scan , chroma_dc_scan }
;
int run , level , limit ;
unsigned vlc ;
const int intra = 3 * type >> 2 ;
const uint8_t * const scan = scan_patterns [ type ] ;
for ( limit = ( 16 >> intra ) ;
index < 16 ;
index = limit , limit += 8 ) {
for ( ;
( vlc = svq3_get_ue_golomb ( gb ) ) != 0 ;
index ++ ) {
int sign = ( vlc & 1 ) ? 0 : - 1 ;
vlc = vlc + 1 >> 1 ;
if ( type == 3 ) {
if ( vlc < 3 ) {
run = 0 ;
level = vlc ;
}
else if ( vlc < 4 ) {
run = 1 ;
level = 1 ;
}
else {
run = vlc & 0x3 ;
level = ( vlc + 9 >> 2 ) - run ;
}
}
else {
if ( vlc < 16 ) {
run = svq3_dct_tables [ intra ] [ vlc ] . run ;
level = svq3_dct_tables [ intra ] [ vlc ] . level ;
}
else if ( intra ) {
run = vlc & 0x7 ;
level = ( vlc >> 3 ) + ( ( run == 0 ) ? 8 : ( ( run < 2 ) ? 2 : ( ( run < 5 ) ? 0 : - 1 ) ) ) ;
}
else {
run = vlc & 0xF ;
level = ( vlc >> 4 ) + ( ( run == 0 ) ? 4 : ( ( run < 3 ) ? 2 : ( ( run < 10 ) ? 1 : 0 ) ) ) ;
}
}
if ( ( index += run ) >= limit ) return - 1 ;
block [ scan [ index ] ] = ( level ^ sign ) - sign ;
}
if ( type != 2 ) {
break ;
}
}
return 0 ;
} |
4,489,017,523,191,997,000 | debian | 6 | 0 | int dissect_h225_TunnelledProtocol ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
# line 760 "./asn1/h225/h225.cnf" tpOID = "" ;
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h225_TunnelledProtocol , TunnelledProtocol_sequence ) ;
# line 762 "./asn1/h225/h225.cnf" tp_handle = dissector_get_string_handle ( tp_dissector_table , tpOID ) ;
return offset ;
} |
4,489,017,523,191,997,000 | debian | 4 | 0 | static int dissect_h225_TBCD_STRING_SIZE_15_16 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_size_constrained_type ( tvb , offset , actx , tree , hf_index , dissect_h225_TBCD_STRING , "TBCD_STRING" , 15 , 16 , FALSE ) ;
return offset ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_IV16 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_octet_string ( tvb , offset , actx , tree , hf_index , 16 , 16 , FALSE , NULL ) ;
return offset ;
} |
1,614,547,608,286,395,100 | debian | 44 | 0 | bool handle_new_meta_connection ( int sock ) {
static const int max_accept_burst = 10 ;
static int last_accept_burst ;
static int last_accept_time ;
connection_t * c ;
sockaddr_t sa ;
int fd ;
socklen_t len = sizeof ( sa ) ;
fd = accept ( sock , & sa . sa , & len ) ;
if ( fd < 0 ) {
logger ( LOG_ERR , "Accepting a new connection failed: %s" , sockstrerror ( sockerrno ) ) ;
return false ;
}
if ( last_accept_time == now ) {
last_accept_burst ++ ;
if ( last_accept_burst >= max_accept_burst ) {
if ( last_accept_burst == max_accept_burst ) {
ifdebug ( CONNECTIONS ) logger ( LOG_WARNING , "Throttling incoming connections" ) ;
}
tarpit ( fd ) ;
return false ;
}
}
else {
last_accept_burst = 0 ;
last_accept_time = now ;
}
sockaddrunmap ( & sa ) ;
c = new_connection ( ) ;
c -> name = xstrdup ( "<unknown>" ) ;
c -> outcipher = myself -> connection -> outcipher ;
c -> outdigest = myself -> connection -> outdigest ;
c -> outmaclength = myself -> connection -> outmaclength ;
c -> outcompression = myself -> connection -> outcompression ;
c -> address = sa ;
c -> hostname = sockaddr2hostname ( & sa ) ;
c -> socket = fd ;
c -> last_ping_time = now ;
ifdebug ( CONNECTIONS ) logger ( LOG_NOTICE , "Connection from %s" , c -> hostname ) ;
configure_tcp ( c ) ;
connection_add ( c ) ;
c -> allow_request = ID ;
return true ;
} |
-8,933,711,118,846,966,000 | debian | 24 | 0 | static void vga_draw_cursor_line ( uint8_t * d1 , const uint8_t * src1 , int poffset , int w , unsigned int color0 , unsigned int color1 , unsigned int color_xor ) {
const uint8_t * plane0 , * plane1 ;
int x , b0 , b1 ;
uint8_t * d ;
d = d1 ;
plane0 = src1 ;
plane1 = src1 + poffset ;
for ( x = 0 ;
x < w ;
x ++ ) {
b0 = ( plane0 [ x >> 3 ] >> ( 7 - ( x & 7 ) ) ) & 1 ;
b1 = ( plane1 [ x >> 3 ] >> ( 7 - ( x & 7 ) ) ) & 1 ;
switch ( b0 | ( b1 << 1 ) ) {
case 0 : break ;
case 1 : ( ( uint32_t * ) d ) [ 0 ] ^= color_xor ;
break ;
case 2 : ( ( uint32_t * ) d ) [ 0 ] = color0 ;
break ;
case 3 : ( ( uint32_t * ) d ) [ 0 ] = color1 ;
break ;
}
d += 4 ;
}
} |
-755,883,256,379,441,900 | chrome | 305 | 0 | void vp9_ ## type ## _predictor_ ## size ## x ## size ## _c ( uint8_t * dst , ptrdiff_t stride , const uint8_t * above , const uint8_t * left ) {
type ## _predictor ( dst , stride , size , above , left ) ;
}
# if CONFIG_VP9_HIGHBITDEPTH # define intra_pred_high_sized ( type , size ) void vp9_high_ ## type ## _predictor_ ## size ## x ## size ## _c ( uint16_t * dst , ptrdiff_t stride , const uint16_t * above , const uint16_t * left , int bd ) {
high_ ## type ## _predictor ( dst , stride , size , above , left , bd ) ;
}
# define intra_pred_allsizes ( type ) intra_pred_sized ( type , 4 ) intra_pred_sized ( type , 8 ) intra_pred_sized ( type , 16 ) intra_pred_sized ( type , 32 ) intra_pred_high_sized ( type , 4 ) intra_pred_high_sized ( type , 8 ) intra_pred_high_sized ( type , 16 ) intra_pred_high_sized ( type , 32 ) # else # define intra_pred_allsizes ( type ) intra_pred_sized ( type , 4 ) intra_pred_sized ( type , 8 ) intra_pred_sized ( type , 16 ) intra_pred_sized ( type , 32 ) # endif # if CONFIG_VP9_HIGHBITDEPTH static INLINE void high_d207_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) above ;
( void ) bd ;
for ( r = 0 ;
r < bs - 1 ;
++ r ) {
dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r ] + left [ r + 1 ] , 1 ) ;
}
dst [ ( bs - 1 ) * stride ] = left [ bs - 1 ] ;
dst ++ ;
for ( r = 0 ;
r < bs - 2 ;
++ r ) {
dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r ] + left [ r + 1 ] * 2 + left [ r + 2 ] , 2 ) ;
}
dst [ ( bs - 2 ) * stride ] = ROUND_POWER_OF_TWO ( left [ bs - 2 ] + left [ bs - 1 ] * 3 , 2 ) ;
dst [ ( bs - 1 ) * stride ] = left [ bs - 1 ] ;
dst ++ ;
for ( c = 0 ;
c < bs - 2 ;
++ c ) dst [ ( bs - 1 ) * stride + c ] = left [ bs - 1 ] ;
for ( r = bs - 2 ;
r >= 0 ;
-- r ) {
for ( c = 0 ;
c < bs - 2 ;
++ c ) dst [ r * stride + c ] = dst [ ( r + 1 ) * stride + c - 2 ] ;
}
}
static INLINE void high_d63_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) left ;
( void ) bd ;
for ( r = 0 ;
r < bs ;
++ r ) {
for ( c = 0 ;
c < bs ;
++ c ) {
dst [ c ] = r & 1 ? ROUND_POWER_OF_TWO ( above [ r / 2 + c ] + above [ r / 2 + c + 1 ] * 2 + above [ r / 2 + c + 2 ] , 2 ) : ROUND_POWER_OF_TWO ( above [ r / 2 + c ] + above [ r / 2 + c + 1 ] , 1 ) ;
}
dst += stride ;
}
}
static INLINE void high_d45_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) left ;
( void ) bd ;
for ( r = 0 ;
r < bs ;
++ r ) {
for ( c = 0 ;
c < bs ;
++ c ) {
dst [ c ] = r + c + 2 < bs * 2 ? ROUND_POWER_OF_TWO ( above [ r + c ] + above [ r + c + 1 ] * 2 + above [ r + c + 2 ] , 2 ) : above [ bs * 2 - 1 ] ;
}
dst += stride ;
}
}
static INLINE void high_d117_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) bd ;
for ( c = 0 ;
c < bs ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 1 ] + above [ c ] , 1 ) ;
dst += stride ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( left [ 0 ] + above [ - 1 ] * 2 + above [ 0 ] , 2 ) ;
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 2 ] + above [ c - 1 ] * 2 + above [ c ] , 2 ) ;
dst += stride ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] * 2 + left [ 1 ] , 2 ) ;
for ( r = 3 ;
r < bs ;
++ r ) dst [ ( r - 2 ) * stride ] = ROUND_POWER_OF_TWO ( left [ r - 3 ] + left [ r - 2 ] * 2 + left [ r - 1 ] , 2 ) ;
for ( r = 2 ;
r < bs ;
++ r ) {
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = dst [ - 2 * stride + c - 1 ] ;
dst += stride ;
}
}
static INLINE void high_d135_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) bd ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( left [ 0 ] + above [ - 1 ] * 2 + above [ 0 ] , 2 ) ;
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 2 ] + above [ c - 1 ] * 2 + above [ c ] , 2 ) ;
dst [ stride ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] * 2 + left [ 1 ] , 2 ) ;
for ( r = 2 ;
r < bs ;
++ r ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r - 2 ] + left [ r - 1 ] * 2 + left [ r ] , 2 ) ;
dst += stride ;
for ( r = 1 ;
r < bs ;
++ r ) {
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = dst [ - stride + c - 1 ] ;
dst += stride ;
}
}
static INLINE void high_d153_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) bd ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] , 1 ) ;
for ( r = 1 ;
r < bs ;
r ++ ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r - 1 ] + left [ r ] , 1 ) ;
dst ++ ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( left [ 0 ] + above [ - 1 ] * 2 + above [ 0 ] , 2 ) ;
dst [ stride ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] * 2 + left [ 1 ] , 2 ) ;
for ( r = 2 ;
r < bs ;
r ++ ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r - 2 ] + left [ r - 1 ] * 2 + left [ r ] , 2 ) ;
dst ++ ;
for ( c = 0 ;
c < bs - 2 ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 1 ] + above [ c ] * 2 + above [ c + 1 ] , 2 ) ;
dst += stride ;
for ( r = 1 ;
r < bs ;
++ r ) {
for ( c = 0 ;
c < bs - 2 ;
c ++ ) dst [ c ] = dst [ - stride + c - 2 ] ;
dst += stride ;
}
}
static INLINE void high_v_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r ;
( void ) left ;
( void ) bd ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memcpy ( dst , above , bs * sizeof ( uint16_t ) ) ;
dst += stride ;
}
}
static INLINE void high_h_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r ;
( void ) above ;
( void ) bd ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset16 ( dst , left [ r ] , bs ) ;
dst += stride ;
}
}
static INLINE void high_tm_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
int ytop_left = above [ - 1 ] ;
( void ) bd ;
for ( r = 0 ;
r < bs ;
r ++ ) {
for ( c = 0 ;
c < bs ;
c ++ ) dst [ c ] = clip_pixel_high ( left [ r ] + above [ c ] - ytop_left , bd ) ;
dst += stride ;
}
}
static INLINE void high_dc_128_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r ;
( void ) above ;
( void ) left ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset16 ( dst , 128 << ( bd - 8 ) , bs ) ;
dst += stride ;
}
}
static INLINE void high_dc_left_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int i , r , expected_dc , sum = 0 ;
( void ) above ;
( void ) bd ;
for ( i = 0 ;
i < bs ;
i ++ ) sum += left [ i ] ;
expected_dc = ( sum + ( bs >> 1 ) ) / bs ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset16 ( dst , expected_dc , bs ) ;
dst += stride ;
}
}
static INLINE void high_dc_top_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int i , r , expected_dc , sum = 0 ;
( void ) left ;
( void ) bd ;
for ( i = 0 ;
i < bs ;
i ++ ) sum += above [ i ] ;
expected_dc = ( sum + ( bs >> 1 ) ) / bs ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset16 ( dst , expected_dc , bs ) ;
dst += stride ;
}
}
static INLINE void high_dc_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int i , r , expected_dc , sum = 0 ;
const int count = 2 * bs ;
( void ) bd ;
for ( i = 0 ;
i < bs ;
i ++ ) {
sum += above [ i ] ;
sum += left [ i ] ;
}
expected_dc = ( sum + ( count >> 1 ) ) / count ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset16 ( dst , expected_dc , bs ) ;
dst += stride ;
}
}
# endif static INLINE void d207_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int r , c ;
( void ) above ;
for ( r = 0 ;
r < bs - 1 ;
++ r ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r ] + left [ r + 1 ] , 1 ) ;
dst [ ( bs - 1 ) * stride ] = left [ bs - 1 ] ;
dst ++ ;
for ( r = 0 ;
r < bs - 2 ;
++ r ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r ] + left [ r + 1 ] * 2 + left [ r + 2 ] , 2 ) ;
dst [ ( bs - 2 ) * stride ] = ROUND_POWER_OF_TWO ( left [ bs - 2 ] + left [ bs - 1 ] * 3 , 2 ) ;
dst [ ( bs - 1 ) * stride ] = left [ bs - 1 ] ;
dst ++ ;
for ( c = 0 ;
c < bs - 2 ;
++ c ) dst [ ( bs - 1 ) * stride + c ] = left [ bs - 1 ] ;
for ( r = bs - 2 ;
r >= 0 ;
-- r ) for ( c = 0 ;
c < bs - 2 ;
++ c ) dst [ r * stride + c ] = dst [ ( r + 1 ) * stride + c - 2 ] ;
}
intra_pred_allsizes ( d207 ) static INLINE void d63_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int r , c ;
( void ) left ;
for ( r = 0 ;
r < bs ;
++ r ) {
for ( c = 0 ;
c < bs ;
++ c ) dst [ c ] = r & 1 ? ROUND_POWER_OF_TWO ( above [ r / 2 + c ] + above [ r / 2 + c + 1 ] * 2 + above [ r / 2 + c + 2 ] , 2 ) : ROUND_POWER_OF_TWO ( above [ r / 2 + c ] + above [ r / 2 + c + 1 ] , 1 ) ;
dst += stride ;
}
}
intra_pred_allsizes ( d63 ) static INLINE void d45_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int r , c ;
( void ) left ;
for ( r = 0 ;
r < bs ;
++ r ) {
for ( c = 0 ;
c < bs ;
++ c ) dst [ c ] = r + c + 2 < bs * 2 ? ROUND_POWER_OF_TWO ( above [ r + c ] + above [ r + c + 1 ] * 2 + above [ r + c + 2 ] , 2 ) : above [ bs * 2 - 1 ] ;
dst += stride ;
}
}
intra_pred_allsizes ( d45 ) static INLINE void d117_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int r , c ;
for ( c = 0 ;
c < bs ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 1 ] + above [ c ] , 1 ) ;
dst += stride ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( left [ 0 ] + above [ - 1 ] * 2 + above [ 0 ] , 2 ) ;
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 2 ] + above [ c - 1 ] * 2 + above [ c ] , 2 ) ;
dst += stride ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] * 2 + left [ 1 ] , 2 ) ;
for ( r = 3 ;
r < bs ;
++ r ) dst [ ( r - 2 ) * stride ] = ROUND_POWER_OF_TWO ( left [ r - 3 ] + left [ r - 2 ] * 2 + left [ r - 1 ] , 2 ) ;
for ( r = 2 ;
r < bs ;
++ r ) {
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = dst [ - 2 * stride + c - 1 ] ;
dst += stride ;
}
}
intra_pred_allsizes ( d117 ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.