idx
int64 | func
string | target
int64 |
|---|---|---|
492,956
|
static int ssl_parse_inner_plaintext( unsigned char const *content,
size_t *content_size,
uint8_t *rec_type )
{
size_t remaining = *content_size;
/* Determine length of padding by skipping zeroes from the back. */
do
{
if( remaining == 0 )
return( -1 );
remaining--;
} while( content[ remaining ] == 0 );
*content_size = remaining;
*rec_type = content[ remaining ];
return( 0 );
}
| 0
|
292,546
|
static void iwl_fwrt_dump_txf(struct iwl_fw_runtime *fwrt,
struct iwl_fw_error_dump_data **dump_data,
int size, u32 offset, int fifo_num)
{
struct iwl_fw_error_dump_fifo *fifo_hdr;
u32 *fifo_data;
u32 fifo_len;
int i;
fifo_hdr = (void *)(*dump_data)->data;
fifo_data = (void *)fifo_hdr->data;
fifo_len = size;
/* No need to try to read the data if the length is 0 */
if (fifo_len == 0)
return;
/* Add a TLV for the FIFO */
(*dump_data)->type = cpu_to_le32(IWL_FW_ERROR_DUMP_TXF);
(*dump_data)->len = cpu_to_le32(fifo_len + sizeof(*fifo_hdr));
fifo_hdr->fifo_num = cpu_to_le32(fifo_num);
fifo_hdr->available_bytes =
cpu_to_le32(iwl_trans_read_prph(fwrt->trans,
TXF_FIFO_ITEM_CNT + offset));
fifo_hdr->wr_ptr =
cpu_to_le32(iwl_trans_read_prph(fwrt->trans,
TXF_WR_PTR + offset));
fifo_hdr->rd_ptr =
cpu_to_le32(iwl_trans_read_prph(fwrt->trans,
TXF_RD_PTR + offset));
fifo_hdr->fence_ptr =
cpu_to_le32(iwl_trans_read_prph(fwrt->trans,
TXF_FENCE_PTR + offset));
fifo_hdr->fence_mode =
cpu_to_le32(iwl_trans_read_prph(fwrt->trans,
TXF_LOCK_FENCE + offset));
/* Set the TXF_READ_MODIFY_ADDR to TXF_WR_PTR */
iwl_trans_write_prph(fwrt->trans, TXF_READ_MODIFY_ADDR + offset,
TXF_WR_PTR + offset);
/* Dummy-read to advance the read pointer to the head */
iwl_trans_read_prph(fwrt->trans, TXF_READ_MODIFY_DATA + offset);
/* Read FIFO */
fifo_len /= sizeof(u32); /* Size in DWORDS */
for (i = 0; i < fifo_len; i++)
fifo_data[i] = iwl_trans_read_prph(fwrt->trans,
TXF_READ_MODIFY_DATA +
offset);
*dump_data = iwl_fw_error_next_data(*dump_data);
}
| 0
|
26,576
|
IN_PROC_BROWSER_TEST_F ( ExtensionPreferenceApiTest , PersistentIncognito ) {
PrefService * prefs = profile_ -> GetPrefs ( ) ;
prefs -> SetBoolean ( prefs : : kBlockThirdPartyCookies , false ) ;
EXPECT_TRUE ( RunExtensionTestIncognito ( "preference/persistent_incognito" ) ) << message_ ;
EXPECT_FALSE ( profile_ -> HasOffTheRecordProfile ( ) ) ;
PrefService * otr_prefs = profile_ -> GetOffTheRecordProfile ( ) -> GetPrefs ( ) ;
const PrefService : : Preference * pref = otr_prefs -> FindPreference ( prefs : : kBlockThirdPartyCookies ) ;
ASSERT_TRUE ( pref ) ;
EXPECT_TRUE ( pref -> IsExtensionControlled ( ) ) ;
EXPECT_TRUE ( otr_prefs -> GetBoolean ( prefs : : kBlockThirdPartyCookies ) ) ;
pref = prefs -> FindPreference ( prefs : : kBlockThirdPartyCookies ) ;
ASSERT_TRUE ( pref ) ;
EXPECT_FALSE ( pref -> IsExtensionControlled ( ) ) ;
EXPECT_FALSE ( prefs -> GetBoolean ( prefs : : kBlockThirdPartyCookies ) ) ;
}
| 0
|
358,198
|
static int nfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
{
struct iattr attr;
int error;
dfprintk(VFS, "NFS: mkdir(%s/%ld), %s\n",
dir->i_sb->s_id, dir->i_ino, dentry->d_name.name);
attr.ia_valid = ATTR_MODE;
attr.ia_mode = mode | S_IFDIR;
lock_kernel();
nfs_begin_data_update(dir);
error = NFS_PROTO(dir)->mkdir(dir, dentry, &attr);
nfs_end_data_update(dir);
if (error != 0)
goto out_err;
nfs_renew_times(dentry);
nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
unlock_kernel();
return 0;
out_err:
d_drop(dentry);
unlock_kernel();
return error;
}
| 0
|
256,357
|
static void serial_update_parameters(SerialState *s)
{
int speed, parity, data_bits, stop_bits, frame_size;
QEMUSerialSetParams ssp;
if (s->divider == 0)
return;
/* Start bit. */
frame_size = 1;
/* Parity bit. */
frame_size++;
if (s->lcr & 0x10)
parity = 'E';
else
parity = 'O';
} else {
parity = 'N';
}
| 1
|
168,107
|
void LocalFrameClientImpl::DispatchDidReceiveResponse(
const ResourceResponse& response) {
if (web_frame_->Client()) {
WrappedResourceResponse webresp(response);
web_frame_->Client()->DidReceiveResponse(webresp);
}
}
| 0
|
7,231
|
int net_get(int s, void *arg, int *len)
{
struct net_hdr nh;
int plen;
if (net_read_exact(s, &nh, sizeof(nh)) == -1)
{
return -1;
}
plen = ntohl(nh.nh_len);
if (!(plen <= *len))
printf("PLEN %d type %d len %d\n",
plen, nh.nh_type, *len);
assert(plen <= *len); /* XXX */
*len = plen;
if ((*len) && (net_read_exact(s, arg, *len) == -1))
{
return -1;
}
return nh.nh_type;
}
| 1
|
469,846
|
icmp_match(const struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
const struct xt_match *match,
const void *matchinfo,
int offset,
unsigned int protoff,
int *hotdrop)
{
struct icmphdr _icmph, *ic;
const struct ipt_icmp *icmpinfo = matchinfo;
/* Must not be a fragment. */
if (offset)
return 0;
ic = skb_header_pointer(skb, protoff, sizeof(_icmph), &_icmph);
if (ic == NULL) {
/* We've been asked to examine this packet, and we
* can't. Hence, no choice but to drop.
*/
duprintf("Dropping evil ICMP tinygram.\n");
*hotdrop = 1;
return 0;
}
return icmp_type_code_match(icmpinfo->type,
icmpinfo->code[0],
icmpinfo->code[1],
ic->type, ic->code,
!!(icmpinfo->invflags&IPT_ICMP_INV));
}
| 0
|
192,557
|
Eina_Bool ewk_view_back(Evas_Object* ewkView)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
return ewk_frame_back(smartData->main_frame);
}
| 0
|
173,545
|
void LayoutBlockFlow::checkForPaginationLogicalHeightChange(LayoutUnit& pageLogicalHeight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight)
{
if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) {
LayoutUnit columnHeight;
if (hasDefiniteLogicalHeight() || isLayoutView()) {
LogicalExtentComputedValues computedValues;
computeLogicalHeight(LayoutUnit(), logicalTop(), computedValues);
columnHeight = computedValues.m_extent - borderAndPaddingLogicalHeight() - scrollbarLogicalHeight();
}
pageLogicalHeightChanged = columnHeight != flowThread->columnHeightAvailable();
flowThread->setColumnHeightAvailable(std::max(columnHeight, LayoutUnit()));
} else if (isLayoutFlowThread()) {
LayoutFlowThread* flowThread = toLayoutFlowThread(this);
pageLogicalHeight = flowThread->isPageLogicalHeightKnown() ? LayoutUnit(1) : LayoutUnit();
pageLogicalHeightChanged = flowThread->pageLogicalSizeChanged();
}
}
| 0
|
70,219
|
static int pragmaVtabEof(sqlite3_vtab_cursor *pVtabCursor){
PragmaVtabCursor *pCsr = (PragmaVtabCursor*)pVtabCursor;
return (pCsr->pPragma==0);
}
| 0
|
57,269
|
void fmtutil_get_bmp_compression_name(u32 code, char *s, size_t s_len,
int is_os2v2)
{
const char *name1 = "?";
switch(code) {
case 0: name1 = "BI_RGB, uncompressed"; break;
case 1: name1 = "BI_RLE8"; break;
case 2: name1 = "BI_RLE4"; break;
case 3:
if(is_os2v2)
name1 = "Huffman 1D";
else
name1 = "BI_BITFIELDS, uncompressed";
break;
case 4:
if(is_os2v2)
name1 = "RLE24";
else
name1 = "BI_JPEG";
break;
case 5: name1 = "BI_PNG"; break;
}
de_strlcpy(s, name1, s_len);
}
| 0
|
190,638
|
msg_fifo_pop (struct msg_fifo *fifo)
{
struct msg *msg;
msg = fifo->head;
if (msg)
{
fifo->head = msg->next;
if (fifo->head == NULL)
fifo->tail = NULL;
fifo->count--;
}
return msg;
}
| 0
|
1
|
unsigned long # define BN_LONG long # define BN_BITS 128 # define BN_BYTES 8 # define BN_BITS2 64 # define BN_BITS4 32 # define BN_MASK ( 0xffffffffffffffffffffffffffffffffLL ) # define BN_MASK2 ( 0xffffffffffffffffL ) # define BN_MASK2l ( 0xffffffffL ) # define BN_MASK2h ( 0xffffffff00000000L ) # define BN_MASK2h1 ( 0xffffffff80000000L ) # define BN_TBIT ( 0x8000000000000000L ) # define BN_DEC_CONV ( 10000000000000000000UL ) # define BN_DEC_FMT1 "%lu" # define BN_DEC_FMT2 "%019lu" # define BN_DEC_NUM 19 # define BN_HEX_FMT1 "%lX" # define BN_HEX_FMT2 "%016lX" # endif # ifdef SIXTY_FOUR_BIT # undef BN_LLONG # undef BN_ULLONG # define BN_ULONG unsigned long long # define BN_LONG long long # define BN_BITS 128 # define BN_BYTES 8 # define BN_BITS2 64 # define BN_BITS4 32 # define BN_MASK2 ( 0xffffffffffffffffLL ) # define BN_MASK2l ( 0xffffffffL ) # define BN_MASK2h ( 0xffffffff00000000LL ) # define BN_MASK2h1 ( 0xffffffff80000000LL ) # define BN_TBIT ( 0x8000000000000000LL ) # define BN_DEC_CONV ( 10000000000000000000ULL ) # define BN_DEC_FMT1 "%llu" # define BN_DEC_FMT2 "%019llu" # define BN_DEC_NUM 19 # define BN_HEX_FMT1 "%llX" # define BN_HEX_FMT2 "%016llX" # endif # ifdef THIRTY_TWO_BIT # ifdef BN_LLONG # if defined ( _WIN32 ) && ! defined ( __GNUC__ ) # define BN_ULLONG unsigned __int64 # define BN_MASK ( 0xffffffffffffffffI64 ) # else # define BN_ULLONG unsigned long long # define BN_MASK ( 0xffffffffffffffffLL ) # endif # endif # define BN_ULONG unsigned int # define BN_LONG int # define BN_BITS 64 # define BN_BYTES 4 # define BN_BITS2 32 # define BN_BITS4 16 # define BN_MASK2 ( 0xffffffffL ) # define BN_MASK2l ( 0xffff ) # define BN_MASK2h1 ( 0xffff8000L ) # define BN_MASK2h ( 0xffff0000L ) # define BN_TBIT ( 0x80000000L ) # define BN_DEC_CONV ( 1000000000L ) # define BN_DEC_FMT1 "%u" # define BN_DEC_FMT2 "%09u" # define BN_DEC_NUM 9 # define BN_HEX_FMT1 "%X" # define BN_HEX_FMT2 "%08X" # endif # define BN_DEFAULT_BITS 1280 # define BN_FLG_MALLOCED 0x01 # define BN_FLG_STATIC_DATA 0x02 # define BN_FLG_CONSTTIME 0x04 # ifndef OPENSSL_NO_DEPRECATED # define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME # endif # ifndef OPENSSL_NO_DEPRECATED # define BN_FLG_FREE 0x8000 # endif # define BN_set_flags ( b , n ) ( ( b ) -> flags |= ( n ) ) # define BN_get_flags ( b , n ) ( ( b ) -> flags & ( n ) ) # define BN_with_flags ( dest , b , n ) ( ( dest ) -> d = ( b ) -> d , \ ( dest ) -> top = ( b ) -> top , \ ( dest ) -> dmax = ( b ) -> dmax , \ ( dest ) -> neg = ( b ) -> neg , \ ( dest ) -> flags = ( ( ( dest ) -> flags & BN_FLG_MALLOCED ) \ | ( ( b ) -> flags & ~ BN_FLG_MALLOCED ) \ | BN_FLG_STATIC_DATA \ | ( n ) ) ) # if 0 typedef struct bignum_st BIGNUM ;
typedef struct bignum_ctx BN_CTX ;
typedef struct bn_blinding_st BN_BLINDING ;
typedef struct bn_mont_ctx_st BN_MONT_CTX ;
typedef struct bn_recp_ctx_st BN_RECP_CTX ;
typedef struct bn_gencb_st BN_GENCB ;
# endif struct bignum_st {
BN_ULONG * d ;
int top ;
int dmax ;
int neg ;
int flags ;
}
;
struct bn_mont_ctx_st {
int ri ;
BIGNUM RR ;
BIGNUM N ;
BIGNUM Ni ;
BN_ULONG n0 [ 2 ] ;
int flags ;
}
;
struct bn_recp_ctx_st {
BIGNUM N ;
BIGNUM Nr ;
int num_bits ;
int shift ;
int flags ;
}
;
struct bn_gencb_st {
unsigned int ver ;
void * arg ;
union {
void ( * cb_1 ) ( int , int , void * ) ;
int ( * cb_2 ) ( int , int , BN_GENCB * ) ;
}
cb ;
}
;
int BN_GENCB_call ( BN_GENCB * cb , int a , int b ) ;
# define BN_GENCB_set_old ( gencb , callback , cb_arg ) {
\ BN_GENCB * tmp_gencb = ( gencb ) ;
\ tmp_gencb -> ver = 1 ;
\ tmp_gencb -> arg = ( cb_arg ) ;
\ tmp_gencb -> cb . cb_1 = ( callback ) ;
}
# define BN_GENCB_set ( gencb , callback , cb_arg ) {
\ BN_GENCB * tmp_gencb = ( gencb ) ;
\ tmp_gencb -> ver = 2 ;
\ tmp_gencb -> arg = ( cb_arg ) ;
\ tmp_gencb -> cb . cb_2 = ( callback ) ;
}
# define BN_prime_checks 0 # define BN_prime_checks_for_size ( b ) ( ( b ) >= 1300 ? 2 : \ ( b ) >= 850 ? 3 : \ ( b ) >= 650 ? 4 : \ ( b ) >= 550 ? 5 : \ ( b ) >= 450 ? 6 : \ ( b ) >= 400 ? 7 : \ ( b ) >= 350 ? 8 : \ ( b ) >= 300 ? 9 : \ ( b ) >= 250 ? 12 : \ ( b ) >= 200 ? 15 : \ ( b ) >= 150 ? 18 : \ 27 ) # define BN_num_bytes ( a ) ( ( BN_num_bits ( a ) + 7 ) / 8 ) # define BN_abs_is_word ( a , w ) ( ( ( ( a ) -> top == 1 ) && ( ( a ) -> d [ 0 ] == ( BN_ULONG ) ( w ) ) ) || \ ( ( ( w ) == 0 ) && ( ( a ) -> top == 0 ) ) ) # define BN_is_zero ( a ) ( ( a ) -> top == 0 ) # define BN_is_one ( a ) ( BN_abs_is_word ( ( a ) , 1 ) && ! ( a ) -> neg ) # define BN_is_word ( a , w ) ( BN_abs_is_word ( ( a ) , ( w ) ) && ( ! ( w ) || ! ( a ) -> neg ) ) # define BN_is_odd ( a ) ( ( ( a ) -> top > 0 ) && ( ( a ) -> d [ 0 ] & 1 ) ) # define BN_one ( a ) ( BN_set_word ( ( a ) , 1 ) ) # define BN_zero_ex ( a ) \ do {
\ BIGNUM * _tmp_bn = ( a ) ;
\ _tmp_bn -> top = 0 ;
\ _tmp_bn -> neg = 0 ;
\ }
while ( 0 ) # ifdef OPENSSL_NO_DEPRECATED # define BN_zero ( a ) BN_zero_ex ( a ) # else # define BN_zero ( a ) ( BN_set_word ( ( a ) , 0 ) ) # endif const BIGNUM * BN_value_one ( void ) ;
char * BN_options ( void ) ;
BN_CTX * BN_CTX_new ( void ) ;
# ifndef OPENSSL_NO_DEPRECATED void BN_CTX_init ( BN_CTX * c ) ;
# endif void BN_CTX_free ( BN_CTX * c ) ;
void BN_CTX_start ( BN_CTX * ctx ) ;
BIGNUM * BN_CTX_get ( BN_CTX * ctx ) ;
void BN_CTX_end ( BN_CTX * ctx ) ;
int BN_rand ( BIGNUM * rnd , int bits , int top , int bottom ) ;
int BN_pseudo_rand ( BIGNUM * rnd , int bits , int top , int bottom ) ;
int BN_rand_range ( BIGNUM * rnd , const BIGNUM * range ) ;
int BN_pseudo_rand_range ( BIGNUM * rnd , const BIGNUM * range ) ;
int BN_num_bits ( const BIGNUM * a ) ;
int BN_num_bits_word ( BN_ULONG l ) ;
BIGNUM * BN_new ( void ) ;
void BN_init ( BIGNUM * ) ;
void BN_clear_free ( BIGNUM * a ) ;
BIGNUM * BN_copy ( BIGNUM * a , const BIGNUM * b ) ;
void BN_swap ( BIGNUM * a , BIGNUM * b ) ;
BIGNUM * BN_bin2bn ( const unsigned char * s , int len , BIGNUM * ret ) ;
int BN_bn2bin ( const BIGNUM * a , unsigned char * to ) ;
BIGNUM * BN_mpi2bn ( const unsigned char * s , int len , BIGNUM * ret ) ;
int BN_bn2mpi ( const BIGNUM * a , unsigned char * to ) ;
int BN_sub ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b ) ;
int BN_usub ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b ) ;
int BN_uadd ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b ) ;
int BN_add ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b ) ;
int BN_mul ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , BN_CTX * ctx ) ;
int BN_sqr ( BIGNUM * r , const BIGNUM * a , BN_CTX * ctx ) ;
void BN_set_negative ( BIGNUM * b , int n ) ;
# define BN_is_negative ( a ) ( ( a ) -> neg != 0 ) int BN_div ( BIGNUM * dv , BIGNUM * rem , const BIGNUM * m , const BIGNUM * d , BN_CTX * ctx ) ;
# define BN_mod ( rem , m , d , ctx ) BN_div ( NULL , ( rem ) , ( m ) , ( d ) , ( ctx ) ) int BN_nnmod ( BIGNUM * r , const BIGNUM * m , const BIGNUM * d , BN_CTX * ctx ) ;
int BN_mod_add ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mod_add_quick ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * m ) ;
int BN_mod_sub ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mod_sub_quick ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * m ) ;
int BN_mod_mul ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mod_sqr ( BIGNUM * r , const BIGNUM * a , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mod_lshift1 ( BIGNUM * r , const BIGNUM * a , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mod_lshift1_quick ( BIGNUM * r , const BIGNUM * a , const BIGNUM * m ) ;
int BN_mod_lshift ( BIGNUM * r , const BIGNUM * a , int n , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mod_lshift_quick ( BIGNUM * r , const BIGNUM * a , int n , const BIGNUM * m ) ;
BN_ULONG BN_mod_word ( const BIGNUM * a , BN_ULONG w ) ;
BN_ULONG BN_div_word ( BIGNUM * a , BN_ULONG w ) ;
int BN_mul_word ( BIGNUM * a , BN_ULONG w ) ;
int BN_add_word ( BIGNUM * a , BN_ULONG w ) ;
int BN_sub_word ( BIGNUM * a , BN_ULONG w ) ;
int BN_set_word ( BIGNUM * a , BN_ULONG w ) ;
BN_ULONG BN_get_word ( const BIGNUM * a ) ;
int BN_cmp ( const BIGNUM * a , const BIGNUM * b ) ;
void BN_free ( BIGNUM * a ) ;
int BN_is_bit_set ( const BIGNUM * a , int n ) ;
int BN_lshift ( BIGNUM * r , const BIGNUM * a , int n ) ;
int BN_lshift1 ( BIGNUM * r , const BIGNUM * a ) ;
int BN_exp ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_mod_exp ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mod_exp_mont ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , const BIGNUM * m , BN_CTX * ctx , BN_MONT_CTX * m_ctx ) ;
int BN_mod_exp_mont_consttime ( BIGNUM * rr , const BIGNUM * a , const BIGNUM * p , const BIGNUM * m , BN_CTX * ctx , BN_MONT_CTX * in_mont ) ;
int BN_mod_exp_mont_word ( BIGNUM * r , BN_ULONG a , const BIGNUM * p , const BIGNUM * m , BN_CTX * ctx , BN_MONT_CTX * m_ctx ) ;
int BN_mod_exp2_mont ( BIGNUM * r , const BIGNUM * a1 , const BIGNUM * p1 , const BIGNUM * a2 , const BIGNUM * p2 , const BIGNUM * m , BN_CTX * ctx , BN_MONT_CTX * m_ctx ) ;
int BN_mod_exp_simple ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mask_bits ( BIGNUM * a , int n ) ;
# ifndef OPENSSL_NO_FP_API int BN_print_fp ( FILE * fp , const BIGNUM * a ) ;
# endif # ifdef HEADER_BIO_H int BN_print ( BIO * fp , const BIGNUM * a ) ;
# else int BN_print ( void * fp , const BIGNUM * a ) ;
# endif int BN_reciprocal ( BIGNUM * r , const BIGNUM * m , int len , BN_CTX * ctx ) ;
int BN_rshift ( BIGNUM * r , const BIGNUM * a , int n ) ;
int BN_rshift1 ( BIGNUM * r , const BIGNUM * a ) ;
void BN_clear ( BIGNUM * a ) ;
BIGNUM * BN_dup ( const BIGNUM * a ) ;
int BN_ucmp ( const BIGNUM * a , const BIGNUM * b ) ;
int BN_set_bit ( BIGNUM * a , int n ) ;
int BN_clear_bit ( BIGNUM * a , int n ) ;
char * BN_bn2hex ( const BIGNUM * a ) ;
char * BN_bn2dec ( const BIGNUM * a ) ;
int BN_hex2bn ( BIGNUM * * a , const char * str ) ;
int BN_dec2bn ( BIGNUM * * a , const char * str ) ;
int BN_asc2bn ( BIGNUM * * a , const char * str ) ;
int BN_gcd ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , BN_CTX * ctx ) ;
int BN_kronecker ( const BIGNUM * a , const BIGNUM * b , BN_CTX * ctx ) ;
BIGNUM * BN_mod_inverse ( BIGNUM * ret , const BIGNUM * a , const BIGNUM * n , BN_CTX * ctx ) ;
BIGNUM * BN_mod_sqrt ( BIGNUM * ret , const BIGNUM * a , const BIGNUM * n , BN_CTX * ctx ) ;
# ifndef OPENSSL_NO_DEPRECATED BIGNUM * BN_generate_prime ( BIGNUM * ret , int bits , int safe , const BIGNUM * add , const BIGNUM * rem , void ( * callback ) ( int , int , void * ) , void * cb_arg ) ;
int BN_is_prime ( const BIGNUM * p , int nchecks , void ( * callback ) ( int , int , void * ) , BN_CTX * ctx , void * cb_arg ) ;
int BN_is_prime_fasttest ( const BIGNUM * p , int nchecks , void ( * callback ) ( int , int , void * ) , BN_CTX * ctx , void * cb_arg , int do_trial_division ) ;
# endif int BN_generate_prime_ex ( BIGNUM * ret , int bits , int safe , const BIGNUM * add , const BIGNUM * rem , BN_GENCB * cb ) ;
int BN_is_prime_ex ( const BIGNUM * p , int nchecks , BN_CTX * ctx , BN_GENCB * cb ) ;
int BN_is_prime_fasttest_ex ( const BIGNUM * p , int nchecks , BN_CTX * ctx , int do_trial_division , BN_GENCB * cb ) ;
int BN_X931_generate_Xpq ( BIGNUM * Xp , BIGNUM * Xq , int nbits , BN_CTX * ctx ) ;
int BN_X931_derive_prime_ex ( BIGNUM * p , BIGNUM * p1 , BIGNUM * p2 , const BIGNUM * Xp , const BIGNUM * Xp1 , const BIGNUM * Xp2 , const BIGNUM * e , BN_CTX * ctx , BN_GENCB * cb ) ;
int BN_X931_generate_prime_ex ( BIGNUM * p , BIGNUM * p1 , BIGNUM * p2 , BIGNUM * Xp1 , BIGNUM * Xp2 , const BIGNUM * Xp , const BIGNUM * e , BN_CTX * ctx , BN_GENCB * cb ) ;
BN_MONT_CTX * BN_MONT_CTX_new ( void ) ;
void BN_MONT_CTX_init ( BN_MONT_CTX * ctx ) ;
int BN_mod_mul_montgomery ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , BN_MONT_CTX * mont , BN_CTX * ctx ) ;
# define BN_to_montgomery ( r , a , mont , ctx ) BN_mod_mul_montgomery ( \ ( r ) , ( a ) , & ( ( mont ) -> RR ) , ( mont ) , ( ctx ) ) int BN_from_montgomery ( BIGNUM * r , const BIGNUM * a , BN_MONT_CTX * mont , BN_CTX * ctx ) ;
void BN_MONT_CTX_free ( BN_MONT_CTX * mont ) ;
int BN_MONT_CTX_set ( BN_MONT_CTX * mont , const BIGNUM * mod , BN_CTX * ctx ) ;
BN_MONT_CTX * BN_MONT_CTX_copy ( BN_MONT_CTX * to , BN_MONT_CTX * from ) ;
BN_MONT_CTX * BN_MONT_CTX_set_locked ( BN_MONT_CTX * * pmont , int lock , const BIGNUM * mod , BN_CTX * ctx ) ;
# define BN_BLINDING_NO_UPDATE 0x00000001 # define BN_BLINDING_NO_RECREATE 0x00000002 BN_BLINDING * BN_BLINDING_new ( const BIGNUM * A , const BIGNUM * Ai , BIGNUM * mod ) ;
void BN_BLINDING_free ( BN_BLINDING * b ) ;
int BN_BLINDING_update ( BN_BLINDING * b , BN_CTX * ctx ) ;
int BN_BLINDING_convert ( BIGNUM * n , BN_BLINDING * b , BN_CTX * ctx ) ;
int BN_BLINDING_invert ( BIGNUM * n , BN_BLINDING * b , BN_CTX * ctx ) ;
int BN_BLINDING_convert_ex ( BIGNUM * n , BIGNUM * r , BN_BLINDING * b , BN_CTX * ) ;
int BN_BLINDING_invert_ex ( BIGNUM * n , const BIGNUM * r , BN_BLINDING * b , BN_CTX * ) ;
# ifndef OPENSSL_NO_DEPRECATED unsigned long BN_BLINDING_get_thread_id ( const BN_BLINDING * ) ;
void BN_BLINDING_set_thread_id ( BN_BLINDING * , unsigned long ) ;
# endif CRYPTO_THREADID * BN_BLINDING_thread_id ( BN_BLINDING * ) ;
unsigned long BN_BLINDING_get_flags ( const BN_BLINDING * ) ;
void BN_BLINDING_set_flags ( BN_BLINDING * , unsigned long ) ;
BN_BLINDING * BN_BLINDING_create_param ( BN_BLINDING * b , const BIGNUM * e , BIGNUM * m , BN_CTX * ctx , int ( * bn_mod_exp ) ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , const BIGNUM * m , BN_CTX * ctx , BN_MONT_CTX * m_ctx ) , BN_MONT_CTX * m_ctx ) ;
# ifndef OPENSSL_NO_DEPRECATED void BN_set_params ( int mul , int high , int low , int mont ) ;
int BN_get_params ( int which ) ;
# endif void BN_RECP_CTX_init ( BN_RECP_CTX * recp ) ;
BN_RECP_CTX * BN_RECP_CTX_new ( void ) ;
void BN_RECP_CTX_free ( BN_RECP_CTX * recp ) ;
int BN_RECP_CTX_set ( BN_RECP_CTX * recp , const BIGNUM * rdiv , BN_CTX * ctx ) ;
int BN_mod_mul_reciprocal ( BIGNUM * r , const BIGNUM * x , const BIGNUM * y , BN_RECP_CTX * recp , BN_CTX * ctx ) ;
int BN_mod_exp_recp ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_div_recp ( BIGNUM * dv , BIGNUM * rem , const BIGNUM * m , BN_RECP_CTX * recp , BN_CTX * ctx ) ;
# ifndef OPENSSL_NO_EC2M int BN_GF2m_add ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b ) ;
# define BN_GF2m_sub ( r , a , b ) BN_GF2m_add ( r , a , b ) int BN_GF2m_mod ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p ) ;
int BN_GF2m_mod_mul ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_GF2m_mod_sqr ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_GF2m_mod_inv ( BIGNUM * r , const BIGNUM * b , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_GF2m_mod_div ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_GF2m_mod_exp ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_GF2m_mod_sqrt ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_GF2m_mod_solve_quad ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
# define BN_GF2m_cmp ( a , b ) BN_ucmp ( ( a ) , ( b ) ) int BN_GF2m_mod_arr ( BIGNUM * r , const BIGNUM * a , const int p [ ] ) ;
int BN_GF2m_mod_mul_arr ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const int p [ ] , BN_CTX * ctx ) ;
int BN_GF2m_mod_sqr_arr ( BIGNUM * r , const BIGNUM * a , const int p [ ] , BN_CTX * ctx ) ;
int BN_GF2m_mod_inv_arr ( BIGNUM * r , const BIGNUM * b , const int p [ ] , BN_CTX * ctx ) ;
int BN_GF2m_mod_div_arr ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const int p [ ] , BN_CTX * ctx ) ;
int BN_GF2m_mod_exp_arr ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const int p [ ] , BN_CTX * ctx ) ;
int BN_GF2m_mod_sqrt_arr ( BIGNUM * r , const BIGNUM * a , const int p [ ] , BN_CTX * ctx ) ;
int BN_GF2m_mod_solve_quad_arr ( BIGNUM * r , const BIGNUM * a , const int p [ ] , BN_CTX * ctx ) ;
int BN_GF2m_poly2arr ( const BIGNUM * a , int p [ ] , int max ) ;
int BN_GF2m_arr2poly ( const int p [ ] , BIGNUM * a ) ;
# endif int BN_nist_mod_192 ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_nist_mod_224 ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_nist_mod_256 ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_nist_mod_384 ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_nist_mod_521 ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
const BIGNUM * BN_get0_nist_prime_192 ( void ) ;
const BIGNUM * BN_get0_nist_prime_224 ( void ) ;
const BIGNUM * BN_get0_nist_prime_256 ( void ) ;
const BIGNUM * BN_get0_nist_prime_384 ( void ) ;
const BIGNUM * BN_get0_nist_prime_521 ( void ) ;
int ( * BN_nist_mod_func ( const BIGNUM * p ) ) ( BIGNUM * r , const BIGNUM * a , const BIGNUM * field , BN_CTX * ctx ) ;
int BN_generate_dsa_nonce ( BIGNUM * out , const BIGNUM * range , const BIGNUM * priv , const unsigned char * message , size_t message_len , BN_CTX * ctx ) ;
# define bn_expand ( a , bits ) ( ( ( ( ( ( bits + BN_BITS2 - 1 ) ) / BN_BITS2 ) ) <= ( a ) -> dmax ) ? \ ( a ) : bn_expand2 ( ( a ) , ( bits + BN_BITS2 - 1 ) / BN_BITS2 ) ) # define bn_wexpand ( a , words ) ( ( ( words ) <= ( a ) -> dmax ) ? ( a ) : bn_expand2 ( ( a ) , ( words ) ) ) BIGNUM * bn_expand2 ( BIGNUM * a , int words ) ;
# ifndef OPENSSL_NO_DEPRECATED BIGNUM * bn_dup_expand ( const BIGNUM * a , int words ) ;
# endif # ifdef BN_DEBUG # include < assert . h > # ifdef BN_DEBUG_RAND # ifndef RAND_pseudo_bytes int RAND_pseudo_bytes ( unsigned char * buf , int num ) ;
# define BN_DEBUG_TRIX # endif # define bn_pollute ( a ) \ do {
\ const BIGNUM * _bnum1 = ( a ) ;
\ if ( _bnum1 -> top < _bnum1 -> dmax ) {
\ unsigned char _tmp_char ;
\ \ BN_ULONG * _not_const ;
\ memcpy ( & _not_const , & _bnum1 -> d , sizeof ( BN_ULONG * ) ) ;
\ RAND_pseudo_bytes ( & _tmp_char , 1 ) ;
\ memset ( ( unsigned char * ) ( _not_const + _bnum1 -> top ) , _tmp_char , \ ( _bnum1 -> dmax - _bnum1 -> top ) * sizeof ( BN_ULONG ) ) ;
\ }
\ }
while ( 0 ) # ifdef BN_DEBUG_TRIX # undef RAND_pseudo_bytes # endif # else # define bn_pollute ( a ) # endif # define bn_check_top ( a ) \ do {
\ const BIGNUM * _bnum2 = ( a ) ;
\ if ( _bnum2 != NULL ) {
\ assert ( ( _bnum2 -> top == 0 ) || \ ( _bnum2 -> d [ _bnum2 -> top - 1 ] != 0 ) ) ;
\ bn_pollute ( _bnum2 ) ;
\ }
\ }
while ( 0 ) # define bn_fix_top ( a ) bn_check_top ( a ) # else # define bn_pollute ( a ) # define bn_check_top ( a ) # define bn_fix_top ( a ) bn_correct_top ( a ) # endif # define bn_correct_top ( a ) \ {
\ BN_ULONG * ftl ;
\ int tmp_top = ( a ) -> top ;
\ if ( tmp_top > 0 ) \ {
\ for ( ftl = & ( ( a ) -> d [ tmp_top - 1 ] ) ;
tmp_top > 0 ;
tmp_top -- ) \ if ( * ( ftl -- ) ) break ;
\ ( a ) -> top = tmp_top ;
\ }
\ bn_pollute ( a ) ;
\ }
BN_ULONG bn_mul_add_words ( BN_ULONG * rp , const BN_ULONG * ap , int num , BN_ULONG w ) ;
BN_ULONG bn_mul_words ( BN_ULONG * rp , const BN_ULONG * ap , int num , BN_ULONG w ) ;
void bn_sqr_words ( BN_ULONG * rp , const BN_ULONG * ap , int num ) ;
BN_ULONG bn_div_words ( BN_ULONG h , BN_ULONG l , BN_ULONG d ) ;
BN_ULONG bn_add_words ( BN_ULONG * rp , const BN_ULONG * ap , const BN_ULONG * bp , int num ) ;
BN_ULONG bn_sub_words ( BN_ULONG * rp , const BN_ULONG * ap , const BN_ULONG * bp , int num )
| 1
|
299,528
|
AP4_AtomFactory::CreateAtomsFromStream(AP4_ByteStream& stream,
AP4_LargeSize bytes_available,
AP4_AtomParent& atoms)
{
AP4_Result result;
do {
AP4_Atom* atom = NULL;
result = CreateAtomFromStream(stream, bytes_available, atom);
if (AP4_SUCCEEDED(result) && atom != NULL) {
atoms.AddChild(atom);
}
} while (AP4_SUCCEEDED(result));
return AP4_SUCCESS;
}
| 0
|
608
|
const xmlChar * xsltEvalStaticAttrValueTemplate ( xsltStylesheetPtr style , xmlNodePtr inst , const xmlChar * name , const xmlChar * ns , int * found ) {
const xmlChar * ret ;
xmlChar * expr ;
if ( ( style == NULL ) || ( inst == NULL ) || ( name == NULL ) ) return ( NULL ) ;
expr = xsltGetNsProp ( inst , name , ns ) ;
if ( expr == NULL ) {
* found = 0 ;
return ( NULL ) ;
}
* found = 1 ;
ret = xmlStrchr ( expr , '{
' ) ;
if ( ret != NULL ) {
xmlFree ( expr ) ;
return ( NULL ) ;
}
ret = xmlDictLookup ( style -> dict , expr , - 1 ) ;
xmlFree ( expr ) ;
return ( ret ) ;
}
| 1
|
247,494
|
static void vnc_set_share_mode(VncState *vs, VncShareMode mode)
{
#ifdef _VNC_DEBUG
static const char *mn[] = {
[0] = "undefined",
[VNC_SHARE_MODE_CONNECTING] = "connecting",
[VNC_SHARE_MODE_SHARED] = "shared",
[VNC_SHARE_MODE_EXCLUSIVE] = "exclusive",
[VNC_SHARE_MODE_DISCONNECTED] = "disconnected",
};
fprintf(stderr, "%s/%d: %s -> %s\n", __func__,
vs->csock, mn[vs->share_mode], mn[mode]);
#endif
if (vs->share_mode == VNC_SHARE_MODE_EXCLUSIVE) {
vs->vd->num_exclusive--;
}
vs->share_mode = mode;
if (vs->share_mode == VNC_SHARE_MODE_EXCLUSIVE) {
vs->vd->num_exclusive++;
}
}
| 0
|
147,854
|
dataiterator_match(Dataiterator *di, Datamatcher *ma)
{
const char *str;
if (!(str = repodata_stringify(di->pool, di->data, di->key, &di->kv, di->flags)))
return 0;
return ma ? datamatcher_match(ma, str) : 1;
}
| 0
|
209,586
|
void DevToolsUIBindings::SendPortForwardingStatus(const base::Value& status) {
CallClientFunction("DevToolsAPI.devicesPortForwardingStatusChanged", &status,
nullptr, nullptr);
}
| 0
|
489,191
|
void qjs_module_init_gpaccore(JSContext *ctx)
{
JSModuleDef *m;
m = JS_NewCModule(ctx, "gpaccore", js_gpaccore_init);
if (!m) return;
JS_AddModuleExport(ctx, m, "Sys");
JS_AddModuleExport(ctx, m, "Bitstream");
JS_AddModuleExport(ctx, m, "SHA1");
JS_AddModuleExport(ctx, m, "File");
JS_AddModuleExport(ctx, m, "FileIO");
JS_AddModuleExport(ctx, m, "AudioMixer");
return;
| 0
|
87,401
|
static inline void updateIntersectMapHelper(const req::ptr<c_Map>& mp,
const Cell c,
int pos,
TypedValue* strTv,
bool convertIntLikeStrs) {
if (c.m_type == KindOfInt64) {
auto val = mp->get(c.m_data.num);
if (val && val->m_data.num == pos) {
assert(val->m_type == KindOfInt64);
++val->m_data.num;
}
} else {
StringData* s;
if (LIKELY(isStringType(c.m_type))) {
s = c.m_data.pstr;
} else {
s = tvCastToString(&c);
decRefStr(strTv->m_data.pstr);
strTv->m_data.pstr = s;
}
int64_t n;
if (convertIntLikeStrs && s->isStrictlyInteger(n)) {
auto val = mp->get(n);
if (val && val->m_data.num == pos) {
assert(val->m_type == KindOfInt64);
++val->m_data.num;
}
} else {
auto val = mp->get(s);
if (val && val->m_data.num == pos) {
assert(val->m_type == KindOfInt64);
++val->m_data.num;
}
}
}
}
| 0
|
41,842
|
Error Box_clap::parse(BitstreamRange& range)
{
//parse_full_box_header(range);
m_clean_aperture_width.numerator = range.read32();
m_clean_aperture_width.denominator = range.read32();
m_clean_aperture_height.numerator = range.read32();
m_clean_aperture_height.denominator = range.read32();
m_horizontal_offset.numerator = range.read32();
m_horizontal_offset.denominator = range.read32();
m_vertical_offset.numerator = range.read32();
m_vertical_offset.denominator = range.read32();
if (!m_clean_aperture_width.is_valid() || !m_clean_aperture_height.is_valid() ||
!m_horizontal_offset.is_valid() || !m_vertical_offset.is_valid()) {
return Error(heif_error_Invalid_input,
heif_suberror_Invalid_fractional_number);
}
return range.get_error();
}
| 0
|
339,548
|
static void ogg_free(AVFormatContext *s)
{
int i;
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
OGGStreamContext *oggstream = st->priv_data;
if (st->codecpar->codec_id == AV_CODEC_ID_FLAC ||
st->codecpar->codec_id == AV_CODEC_ID_SPEEX ||
st->codecpar->codec_id == AV_CODEC_ID_OPUS ||
st->codecpar->codec_id == AV_CODEC_ID_VP8) {
av_freep(&oggstream->header[0]);
}
av_freep(&oggstream->header[1]);
av_freep(&st->priv_data);
}
}
| 1
|
478,203
|
CImg<t>& move_to(CImg<t>& img) {
img.assign(*this);
assign();
return img;
}
| 0
|
306,014
|
static inline int sctp_v6_addr_match_len(union sctp_addr *s1,
union sctp_addr *s2)
{
return ipv6_addr_diff(&s1->v6.sin6_addr, &s2->v6.sin6_addr);
}
| 0
|
337,953
|
static int pix_norm1_c(uint8_t * pix, int line_size)
{
int s, i, j;
uint32_t *sq = ff_squareTbl + 256;
s = 0;
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j += 8) {
#if 0
s += sq[pix[0]];
s += sq[pix[1]];
s += sq[pix[2]];
s += sq[pix[3]];
s += sq[pix[4]];
s += sq[pix[5]];
s += sq[pix[6]];
s += sq[pix[7]];
#else
#if LONG_MAX > 2147483647
register uint64_t x=*(uint64_t*)pix;
s += sq[x&0xff];
s += sq[(x>>8)&0xff];
s += sq[(x>>16)&0xff];
s += sq[(x>>24)&0xff];
s += sq[(x>>32)&0xff];
s += sq[(x>>40)&0xff];
s += sq[(x>>48)&0xff];
s += sq[(x>>56)&0xff];
#else
register uint32_t x=*(uint32_t*)pix;
s += sq[x&0xff];
s += sq[(x>>8)&0xff];
s += sq[(x>>16)&0xff];
s += sq[(x>>24)&0xff];
x=*(uint32_t*)(pix+4);
s += sq[x&0xff];
s += sq[(x>>8)&0xff];
s += sq[(x>>16)&0xff];
s += sq[(x>>24)&0xff];
#endif
#endif
pix += 8;
}
pix += line_size - 16;
}
return s;
}
| 0
|
118,976
|
SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr,
int, addrlen)
{
return __sys_connect(fd, uservaddr, addrlen);
}
| 0
|
77,226
|
SCTP_STATIC void sctp_shutdown(struct sock *sk, int how)
{
struct net *net = sock_net(sk);
struct sctp_endpoint *ep;
struct sctp_association *asoc;
if (!sctp_style(sk, TCP))
return;
if (how & SEND_SHUTDOWN) {
ep = sctp_sk(sk)->ep;
if (!list_empty(&ep->asocs)) {
asoc = list_entry(ep->asocs.next,
struct sctp_association, asocs);
sctp_primitive_SHUTDOWN(net, asoc, NULL);
}
}
}
| 0
|
89,640
|
point_add(PG_FUNCTION_ARGS)
{
Point *p1 = PG_GETARG_POINT_P(0);
Point *p2 = PG_GETARG_POINT_P(1);
Point *result;
result = (Point *) palloc(sizeof(Point));
result->x = (p1->x + p2->x);
result->y = (p1->y + p2->y);
PG_RETURN_POINT_P(result);
}
| 0
|
334,013
|
static void gdb_set_cpu_pc(GDBState *s, target_ulong pc)
{
#if defined(TARGET_I386)
cpu_synchronize_state(s->c_cpu);
s->c_cpu->eip = pc;
#elif defined (TARGET_PPC)
s->c_cpu->nip = pc;
#elif defined (TARGET_SPARC)
s->c_cpu->pc = pc;
s->c_cpu->npc = pc + 4;
#elif defined (TARGET_ARM)
s->c_cpu->regs[15] = pc;
#elif defined (TARGET_SH4)
s->c_cpu->pc = pc;
#elif defined (TARGET_MIPS)
s->c_cpu->active_tc.PC = pc;
#elif defined (TARGET_MICROBLAZE)
s->c_cpu->sregs[SR_PC] = pc;
#elif defined (TARGET_CRIS)
s->c_cpu->pc = pc;
#elif defined (TARGET_ALPHA)
s->c_cpu->pc = pc;
#elif defined (TARGET_S390X)
cpu_synchronize_state(s->c_cpu);
s->c_cpu->psw.addr = pc;
#endif
}
| 0
|
123,552
|
pw_error(char *name, int err, int eval)
{
if (err) {
if (name)
warn("%s: ", name);
else
warn(NULL);
}
warnx(_("%s unchanged"), orig_file);
unlink(tmp_file);
ulckpwdf();
exit(eval);
}
| 0
|
29,442
|
static inline void uprv_arrayCopy ( const int8_t * src , int8_t * dst , int32_t count ) {
uprv_memcpy ( dst , src , ( size_t ) count * sizeof ( * src ) ) ;
}
| 0
|
90,471
|
static int trusted_update(struct key *key, struct key_preparsed_payload *prep)
{
struct trusted_key_payload *p;
struct trusted_key_payload *new_p;
struct trusted_key_options *new_o;
size_t datalen = prep->datalen;
char *datablob;
int ret = 0;
if (test_bit(KEY_FLAG_NEGATIVE, &key->flags))
return -ENOKEY;
p = key->payload.data[0];
if (!p->migratable)
return -EPERM;
if (datalen <= 0 || datalen > 32767 || !prep->data)
return -EINVAL;
datablob = kmalloc(datalen + 1, GFP_KERNEL);
if (!datablob)
return -ENOMEM;
new_o = trusted_options_alloc();
if (!new_o) {
ret = -ENOMEM;
goto out;
}
new_p = trusted_payload_alloc(key);
if (!new_p) {
ret = -ENOMEM;
goto out;
}
memcpy(datablob, prep->data, datalen);
datablob[datalen] = '\0';
ret = datablob_parse(datablob, new_p, new_o);
if (ret != Opt_update) {
ret = -EINVAL;
kfree(new_p);
goto out;
}
if (!new_o->keyhandle) {
ret = -EINVAL;
kfree(new_p);
goto out;
}
/* copy old key values, and reseal with new pcrs */
new_p->migratable = p->migratable;
new_p->key_len = p->key_len;
memcpy(new_p->key, p->key, p->key_len);
dump_payload(p);
dump_payload(new_p);
ret = key_seal(new_p, new_o);
if (ret < 0) {
pr_info("trusted_key: key_seal failed (%d)\n", ret);
kfree(new_p);
goto out;
}
if (new_o->pcrlock) {
ret = pcrlock(new_o->pcrlock);
if (ret < 0) {
pr_info("trusted_key: pcrlock failed (%d)\n", ret);
kfree(new_p);
goto out;
}
}
rcu_assign_keypointer(key, new_p);
call_rcu(&p->rcu, trusted_rcu_free);
out:
kfree(datablob);
kfree(new_o);
return ret;
}
| 0
|
410,788
|
static void cmd_window_hide(const char *data)
{
WINDOW_REC *window;
if (mainwindows->next == NULL) {
printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
TXT_CANT_HIDE_LAST);
return;
}
if (*data == '\0')
window = active_win;
else if (is_numeric(data, 0)) {
window = window_find_refnum(atoi(data));
if (window == NULL) {
printformat_window(active_win, MSGLEVEL_CLIENTERROR,
TXT_REFNUM_NOT_FOUND, data);
}
} else {
window = window_find_item(active_win->active_server, data);
}
if (window == NULL || !is_window_visible(window))
return;
if (WINDOW_MAIN(window)->sticky_windows) {
if (!settings_get_bool("autounstick_windows")) {
printformat_window(active_win, MSGLEVEL_CLIENTERROR,
TXT_CANT_HIDE_STICKY_WINDOWS);
return;
}
}
mainwindow_destroy(WINDOW_MAIN(window));
if (active_mainwin == NULL) {
active_mainwin = WINDOW_MAIN(active_win);
window_set_active(active_mainwin->active);
}
}
| 0
|
390,092
|
static void cli_flush_use_result(MYSQL *mysql, my_bool flush_all_results)
{
/* Clear the current execution status */
DBUG_ENTER("cli_flush_use_result");
DBUG_PRINT("warning",("Not all packets read, clearing them"));
if (flush_one_result(mysql))
DBUG_VOID_RETURN; /* An error occurred */
if (! flush_all_results)
DBUG_VOID_RETURN;
while (mysql->server_status & SERVER_MORE_RESULTS_EXISTS)
{
my_bool is_ok_packet;
if (opt_flush_ok_packet(mysql, &is_ok_packet))
DBUG_VOID_RETURN; /* An error occurred. */
if (is_ok_packet)
{
/*
Indeed what we got from network was an OK packet, and we
know that OK is the last one in a multi-result-set, so
just return.
*/
DBUG_VOID_RETURN;
}
/*
It's a result set, not an OK packet. A result set contains
of two result set subsequences: field metadata, terminated
with EOF packet, and result set data, again terminated with
EOF packet. Read and flush them.
*/
if (flush_one_result(mysql) || flush_one_result(mysql))
DBUG_VOID_RETURN; /* An error occurred. */
}
DBUG_VOID_RETURN;
}
| 0
|
424,530
|
distance_add(OnigDistance d1, OnigDistance d2)
{
if (d1 == ONIG_INFINITE_DISTANCE || d2 == ONIG_INFINITE_DISTANCE)
return ONIG_INFINITE_DISTANCE;
else {
if (d1 <= ONIG_INFINITE_DISTANCE - d2) return d1 + d2;
else return ONIG_INFINITE_DISTANCE;
}
}
| 0
|
353,819
|
param_expand (string, sindex, quoted, expanded_something,
contains_dollar_at, quoted_dollar_at_p, had_quoted_null_p,
pflags)
char *string;
int *sindex, quoted, *expanded_something, *contains_dollar_at;
int *quoted_dollar_at_p, *had_quoted_null_p, pflags;
{
char *temp, *temp1, uerror[3], *savecmd;
int zindex, t_index, expok;
unsigned char c;
intmax_t number;
SHELL_VAR *var;
WORD_LIST *list;
WORD_DESC *tdesc, *ret;
int tflag;
/*itrace("param_expand: `%s' pflags = %d", string+*sindex, pflags);*/
zindex = *sindex;
c = string[++zindex];
temp = (char *)NULL;
ret = tdesc = (WORD_DESC *)NULL;
tflag = 0;
/* Do simple cases first. Switch on what follows '$'. */
switch (c)
{
/* $0 .. $9? */
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
temp1 = dollar_vars[TODIGIT (c)];
if (unbound_vars_is_error && temp1 == (char *)NULL)
{
uerror[0] = '$';
uerror[1] = c;
uerror[2] = '\0';
last_command_exit_value = EXECUTION_FAILURE;
err_unboundvar (uerror);
return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal);
}
if (temp1)
temp = (*temp1 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)))
? quote_string (temp1)
: quote_escapes (temp1);
else
temp = (char *)NULL;
break;
/* $$ -- pid of the invoking shell. */
case '$':
temp = itos (dollar_dollar_pid);
break;
/* $# -- number of positional parameters. */
case '#':
temp = itos (number_of_args ());
break;
/* $? -- return value of the last synchronous command. */
case '?':
temp = itos (last_command_exit_value);
break;
/* $- -- flags supplied to the shell on invocation or by `set'. */
case '-':
temp = which_set_flags ();
break;
/* $! -- Pid of the last asynchronous command. */
case '!':
/* If no asynchronous pids have been created, expand to nothing.
If `set -u' has been executed, and no async processes have
been created, this is an expansion error. */
if (last_asynchronous_pid == NO_PID)
{
if (expanded_something)
*expanded_something = 0;
temp = (char *)NULL;
if (unbound_vars_is_error)
{
uerror[0] = '$';
uerror[1] = c;
uerror[2] = '\0';
last_command_exit_value = EXECUTION_FAILURE;
err_unboundvar (uerror);
return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal);
}
}
else
temp = itos (last_asynchronous_pid);
break;
/* The only difference between this and $@ is when the arg is quoted. */
case '*': /* `$*' */
list = list_rest_of_args ();
#if 0
/* According to austin-group posix proposal by Geoff Clare in
<20090505091501.GA10097@squonk.masqnet> of 5 May 2009:
"The shell shall write a message to standard error and
immediately exit when it tries to expand an unset parameter
other than the '@' and '*' special parameters."
*/
if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0)
{
uerror[0] = '$';
uerror[1] = '*';
uerror[2] = '\0';
last_command_exit_value = EXECUTION_FAILURE;
err_unboundvar (uerror);
return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal);
}
#endif
/* If there are no command-line arguments, this should just
disappear if there are other characters in the expansion,
even if it's quoted. */
if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && list == 0)
temp = (char *)NULL;
else if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES|Q_PATQUOTE))
{
/* If we have "$*" we want to make a string of the positional
parameters, separated by the first character of $IFS, and
quote the whole string, including the separators. If IFS
is unset, the parameters are separated by ' '; if $IFS is
null, the parameters are concatenated. */
temp = (quoted & (Q_DOUBLE_QUOTES|Q_PATQUOTE)) ? string_list_dollar_star (list) : string_list (list);
if (temp)
{
temp1 = (quoted & Q_DOUBLE_QUOTES) ? quote_string (temp) : temp;
if (*temp == 0)
tflag |= W_HASQUOTEDNULL;
if (temp != temp1)
free (temp);
temp = temp1;
}
}
else
{
/* We check whether or not we're eventually going to split $* here,
for example when IFS is empty and we are processing the rhs of
an assignment statement. In that case, we don't separate the
arguments at all. Otherwise, if the $* is not quoted it is
identical to $@ */
# if defined (HANDLE_MULTIBYTE)
if (expand_no_split_dollar_star && ifs_firstc[0] == 0)
# else
if (expand_no_split_dollar_star && ifs_firstc == 0)
# endif
temp = string_list_dollar_star (list);
else
{
temp = string_list_dollar_at (list, quoted, 0);
if (quoted == 0 && (ifs_is_set == 0 || ifs_is_null))
tflag |= W_SPLITSPACE;
/* If we're not quoted but we still don't want word splitting, make
we quote the IFS characters to protect them from splitting (e.g.,
when $@ is in the string as well). */
else if (quoted == 0 && ifs_is_set && (pflags & PF_ASSIGNRHS))
{
temp1 = quote_string (temp);
free (temp);
temp = temp1;
}
}
if (expand_no_split_dollar_star == 0 && contains_dollar_at)
*contains_dollar_at = 1;
}
dispose_words (list);
break;
/* When we have "$@" what we want is "$1" "$2" "$3" ... This
means that we have to turn quoting off after we split into
the individually quoted arguments so that the final split
on the first character of $IFS is still done. */
case '@': /* `$@' */
list = list_rest_of_args ();
#if 0
/* According to austin-group posix proposal by Geoff Clare in
<20090505091501.GA10097@squonk.masqnet> of 5 May 2009:
"The shell shall write a message to standard error and
immediately exit when it tries to expand an unset parameter
other than the '@' and '*' special parameters."
*/
if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0)
{
uerror[0] = '$';
uerror[1] = '@';
uerror[2] = '\0';
last_command_exit_value = EXECUTION_FAILURE;
err_unboundvar (uerror);
return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal);
}
#endif
/* We want to flag the fact that we saw this. We can't turn
off quoting entirely, because other characters in the
string might need it (consider "\"$@\""), but we need some
way to signal that the final split on the first character
of $IFS should be done, even though QUOTED is 1. */
/* XXX - should this test include Q_PATQUOTE? */
if (quoted_dollar_at_p && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)))
*quoted_dollar_at_p = 1;
if (contains_dollar_at)
*contains_dollar_at = 1;
/* We want to separate the positional parameters with the first
character of $IFS in case $IFS is something other than a space.
We also want to make sure that splitting is done no matter what --
according to POSIX.2, this expands to a list of the positional
parameters no matter what IFS is set to. */
/* XXX - what to do when in a context where word splitting is not
performed? Even when IFS is not the default, posix seems to imply
that we behave like unquoted $* ? Maybe we should use PF_NOSPLIT2
here. */
temp = string_list_dollar_at (list, (pflags & PF_ASSIGNRHS) ? (quoted|Q_DOUBLE_QUOTES) : quoted, 0);
tflag |= W_DOLLARAT;
dispose_words (list);
break;
case LBRACE:
tdesc = parameter_brace_expand (string, &zindex, quoted, pflags,
quoted_dollar_at_p,
contains_dollar_at);
if (tdesc == &expand_wdesc_error || tdesc == &expand_wdesc_fatal)
return (tdesc);
temp = tdesc ? tdesc->word : (char *)0;
/* XXX */
/* Quoted nulls should be removed if there is anything else
in the string. */
/* Note that we saw the quoted null so we can add one back at
the end of this function if there are no other characters
in the string, discard TEMP, and go on. The exception to
this is when we have "${@}" and $1 is '', since $@ needs
special handling. */
if (tdesc && tdesc->word && (tdesc->flags & W_HASQUOTEDNULL) && QUOTED_NULL (temp))
{
if (had_quoted_null_p)
*had_quoted_null_p = 1;
if (*quoted_dollar_at_p == 0)
{
free (temp);
tdesc->word = temp = (char *)NULL;
}
}
ret = tdesc;
goto return0;
/* Do command or arithmetic substitution. */
case LPAREN:
/* We have to extract the contents of this paren substitution. */
t_index = zindex + 1;
temp = extract_command_subst (string, &t_index, 0);
zindex = t_index;
/* For Posix.2-style `$(( ))' arithmetic substitution,
extract the expression and pass it to the evaluator. */
if (temp && *temp == LPAREN)
{
char *temp2;
temp1 = temp + 1;
temp2 = savestring (temp1);
t_index = strlen (temp2) - 1;
if (temp2[t_index] != RPAREN)
{
free (temp2);
goto comsub;
}
/* Cut off ending `)' */
temp2[t_index] = '\0';
if (chk_arithsub (temp2, t_index) == 0)
{
free (temp2);
#if 0
internal_warning (_("future versions of the shell will force evaluation as an arithmetic substitution"));
#endif
goto comsub;
}
/* Expand variables found inside the expression. */
temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES|Q_ARITH);
free (temp2);
arithsub:
/* No error messages. */
savecmd = this_command_name;
this_command_name = (char *)NULL;
number = evalexp (temp1, &expok);
this_command_name = savecmd;
free (temp);
free (temp1);
if (expok == 0)
{
if (interactive_shell == 0 && posixly_correct)
{
last_command_exit_value = EXECUTION_FAILURE;
return (&expand_wdesc_fatal);
}
else
return (&expand_wdesc_error);
}
temp = itos (number);
break;
}
comsub:
if (pflags & PF_NOCOMSUB)
/* we need zindex+1 because string[zindex] == RPAREN */
temp1 = substring (string, *sindex, zindex+1);
else
{
tdesc = command_substitute (temp, quoted);
temp1 = tdesc ? tdesc->word : (char *)NULL;
if (tdesc)
dispose_word_desc (tdesc);
}
FREE (temp);
temp = temp1;
break;
/* Do POSIX.2d9-style arithmetic substitution. This will probably go
away in a future bash release. */
case '[':
/* Extract the contents of this arithmetic substitution. */
t_index = zindex + 1;
temp = extract_arithmetic_subst (string, &t_index);
zindex = t_index;
if (temp == 0)
{
temp = savestring (string);
if (expanded_something)
*expanded_something = 0;
goto return0;
}
/* Do initial variable expansion. */
temp1 = expand_arith_string (temp, Q_DOUBLE_QUOTES|Q_ARITH);
goto arithsub;
default:
/* Find the variable in VARIABLE_LIST. */
temp = (char *)NULL;
for (t_index = zindex; (c = string[zindex]) && legal_variable_char (c); zindex++)
;
temp1 = (zindex > t_index) ? substring (string, t_index, zindex) : (char *)NULL;
/* If this isn't a variable name, then just output the `$'. */
if (temp1 == 0 || *temp1 == '\0')
{
FREE (temp1);
temp = (char *)xmalloc (2);
temp[0] = '$';
temp[1] = '\0';
if (expanded_something)
*expanded_something = 0;
goto return0;
}
/* If the variable exists, return its value cell. */
var = find_variable (temp1);
if (var && invisible_p (var) == 0 && var_isset (var))
{
#if defined (ARRAY_VARS)
if (assoc_p (var) || array_p (var))
{
temp = array_p (var) ? array_reference (array_cell (var), 0)
: assoc_reference (assoc_cell (var), "0");
if (temp)
temp = (*temp && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)))
? quote_string (temp)
: quote_escapes (temp);
else if (unbound_vars_is_error)
goto unbound_variable;
}
else
#endif
{
temp = value_cell (var);
temp = (*temp && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)))
? quote_string (temp)
: quote_escapes (temp);
}
free (temp1);
goto return0;
}
else if (var && (invisible_p (var) || var_isset (var) == 0))
temp = (char *)NULL;
else if ((var = find_variable_last_nameref (temp1, 0)) && var_isset (var) && invisible_p (var) == 0)
{
temp = nameref_cell (var);
#if defined (ARRAY_VARS)
if (temp && *temp && valid_array_reference (temp, 0))
{
tdesc = parameter_brace_expand_word (temp, SPECIAL_VAR (temp, 0), quoted, pflags, (arrayind_t *)NULL);
if (tdesc == &expand_wdesc_error || tdesc == &expand_wdesc_fatal)
return (tdesc);
ret = tdesc;
goto return0;
}
else
#endif
/* y=2 ; typeset -n x=y; echo $x is not the same as echo $2 in ksh */
if (temp && *temp && legal_identifier (temp) == 0)
{
last_command_exit_value = EXECUTION_FAILURE;
report_error (_("%s: invalid variable name for name reference"), temp);
return (&expand_wdesc_error); /* XXX */
}
else
temp = (char *)NULL;
}
temp = (char *)NULL;
unbound_variable:
if (unbound_vars_is_error)
{
last_command_exit_value = EXECUTION_FAILURE;
err_unboundvar (temp1);
}
else
{
free (temp1);
goto return0;
}
free (temp1);
last_command_exit_value = EXECUTION_FAILURE;
return ((unbound_vars_is_error && interactive_shell == 0)
? &expand_wdesc_fatal
: &expand_wdesc_error);
}
if (string[zindex])
zindex++;
return0:
*sindex = zindex;
if (ret == 0)
{
ret = alloc_word_desc ();
ret->flags = tflag; /* XXX */
ret->word = temp;
}
return ret;
}
| 1
|
242,056
|
void HTMLTextAreaElement::setSuggestedValue(const String& value)
{
m_suggestedValue = value;
setInnerTextValue(m_suggestedValue);
updatePlaceholderVisibility(false);
setNeedsStyleRecalc();
setFormControlValueMatchesRenderer(true);
}
| 0
|
309,205
|
bool LayoutBlockFlow::containsFloat(LayoutBox* layoutBox) const
{
return m_floatingObjects && m_floatingObjects->set().contains<FloatingObjectHashTranslator>(layoutBox);
}
| 0
|
493,303
|
int av_get_exact_bits_per_sample(enum AVCodecID codec_id)
{
switch (codec_id) {
case AV_CODEC_ID_8SVX_EXP:
case AV_CODEC_ID_8SVX_FIB:
case AV_CODEC_ID_ADPCM_CT:
case AV_CODEC_ID_ADPCM_IMA_APC:
case AV_CODEC_ID_ADPCM_IMA_EA_SEAD:
case AV_CODEC_ID_ADPCM_IMA_OKI:
case AV_CODEC_ID_ADPCM_IMA_WS:
case AV_CODEC_ID_ADPCM_G722:
case AV_CODEC_ID_ADPCM_YAMAHA:
return 4;
case AV_CODEC_ID_PCM_ALAW:
case AV_CODEC_ID_PCM_MULAW:
case AV_CODEC_ID_PCM_S8:
case AV_CODEC_ID_PCM_S8_PLANAR:
case AV_CODEC_ID_PCM_U8:
case AV_CODEC_ID_PCM_ZORK:
return 8;
case AV_CODEC_ID_PCM_S16BE:
case AV_CODEC_ID_PCM_S16BE_PLANAR:
case AV_CODEC_ID_PCM_S16LE:
case AV_CODEC_ID_PCM_S16LE_PLANAR:
case AV_CODEC_ID_PCM_U16BE:
case AV_CODEC_ID_PCM_U16LE:
return 16;
case AV_CODEC_ID_PCM_S24DAUD:
case AV_CODEC_ID_PCM_S24BE:
case AV_CODEC_ID_PCM_S24LE:
case AV_CODEC_ID_PCM_S24LE_PLANAR:
case AV_CODEC_ID_PCM_U24BE:
case AV_CODEC_ID_PCM_U24LE:
return 24;
case AV_CODEC_ID_PCM_S32BE:
case AV_CODEC_ID_PCM_S32LE:
case AV_CODEC_ID_PCM_S32LE_PLANAR:
case AV_CODEC_ID_PCM_U32BE:
case AV_CODEC_ID_PCM_U32LE:
case AV_CODEC_ID_PCM_F32BE:
case AV_CODEC_ID_PCM_F32LE:
return 32;
case AV_CODEC_ID_PCM_F64BE:
case AV_CODEC_ID_PCM_F64LE:
return 64;
default:
return 0;
}
}
| 0
|
244,968
|
void Document::setBgColor(const AtomicString& value) {
if (!IsFrameSet())
SetBodyAttribute(kBgcolorAttr, value);
}
| 0
|
173,219
|
static void spl_heap_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
{
zval *object = (zval*)((zend_user_iterator *)iter)->it.data;
spl_heap_it *iterator = (spl_heap_it *)iter;
spl_ptr_heap_element elem;
if (iterator->object->heap->flags & SPL_HEAP_CORRUPTED) {
zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
return;
}
elem = spl_ptr_heap_delete_top(iterator->object->heap, object TSRMLS_CC);
if (elem != NULL) {
zval_ptr_dtor((zval **)&elem);
}
zend_user_it_invalidate_current(iter TSRMLS_CC);
}
/* }}} */
| 0
|
32,410
|
static bool list_key_handler(int ch)
{
struct le *le;
(void) ch;
output("Conversation list");
if (conv_data.archived)
output(" with archive");
output(" (%u entries)", list_count(&conv_data.convl));
output(":\n");
LIST_FOREACH(&conv_data.convl, le) {
struct engine_conv *conv = le->data;
if (conv->archived && !conv_data.archived)
continue;
print_conv_list_entry(conv);
}
output("EOL\n");
return true;
}
| 0
|
377,915
|
int tcf_hash_search(struct tc_action *a, u32 index)
{
struct tcf_hashinfo *hinfo = a->ops->hinfo;
struct tcf_common *p = tcf_hash_lookup(index, hinfo);
if (p) {
a->priv = p;
return 1;
}
return 0;
}
| 0
|
209,104
|
PHP_FUNCTION(stream_socket_get_name)
{
php_stream *stream;
zval *zstream;
zend_bool want_peer;
char *name = NULL;
int name_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &zstream, &want_peer) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(stream, &zstream);
if (0 != php_stream_xport_get_name(stream, want_peer,
&name,
&name_len,
NULL, NULL
TSRMLS_CC)) {
RETURN_FALSE;
}
RETURN_STRINGL(name, name_len, 0);
}
| 0
|
363,347
|
xsltSystemPropertyFunction(xmlXPathParserContextPtr ctxt, int nargs){
xmlXPathObjectPtr obj;
xmlChar *prefix, *name;
const xmlChar *nsURI = NULL;
if (nargs != 1) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"system-property() : expects one string arg\n");
ctxt->error = XPATH_INVALID_ARITY;
return;
}
if ((ctxt->value == NULL) || (ctxt->value->type != XPATH_STRING)) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"system-property() : invalid arg expecting a string\n");
ctxt->error = XPATH_INVALID_TYPE;
return;
}
obj = valuePop(ctxt);
if (obj->stringval == NULL) {
valuePush(ctxt, xmlXPathNewString((const xmlChar *)""));
} else {
name = xmlSplitQName2(obj->stringval, &prefix);
if (name == NULL) {
name = xmlStrdup(obj->stringval);
} else {
nsURI = xmlXPathNsLookup(ctxt->context, prefix);
if (nsURI == NULL) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"system-property() : prefix %s is not bound\n", prefix);
}
}
if (xmlStrEqual(nsURI, XSLT_NAMESPACE)) {
#ifdef DOCBOOK_XSL_HACK
if (xmlStrEqual(name, (const xmlChar *)"vendor")) {
xsltStylesheetPtr sheet;
xsltTransformContextPtr tctxt;
tctxt = xsltXPathGetTransformContext(ctxt);
if ((tctxt != NULL) && (tctxt->inst != NULL) &&
(xmlStrEqual(tctxt->inst->name, BAD_CAST "variable")) &&
(tctxt->inst->parent != NULL) &&
(xmlStrEqual(tctxt->inst->parent->name,
BAD_CAST "template")))
sheet = tctxt->style;
else
sheet = NULL;
if ((sheet != NULL) && (sheet->doc != NULL) &&
(sheet->doc->URL != NULL) &&
(xmlStrstr(sheet->doc->URL,
(const xmlChar *)"chunk") != NULL)) {
valuePush(ctxt, xmlXPathNewString(
(const xmlChar *)"libxslt (SAXON 6.2 compatible)"));
} else {
valuePush(ctxt, xmlXPathNewString(
(const xmlChar *)XSLT_DEFAULT_VENDOR));
}
} else
#else
if (xmlStrEqual(name, (const xmlChar *)"vendor")) {
valuePush(ctxt, xmlXPathNewString(
(const xmlChar *)XSLT_DEFAULT_VENDOR));
} else
#endif
if (xmlStrEqual(name, (const xmlChar *)"version")) {
valuePush(ctxt, xmlXPathNewString(
(const xmlChar *)XSLT_DEFAULT_VERSION));
} else if (xmlStrEqual(name, (const xmlChar *)"vendor-url")) {
valuePush(ctxt, xmlXPathNewString(
(const xmlChar *)XSLT_DEFAULT_URL));
} else {
valuePush(ctxt, xmlXPathNewString((const xmlChar *)""));
}
}
if (name != NULL)
xmlFree(name);
if (prefix != NULL)
xmlFree(prefix);
}
xmlXPathFreeObject(obj);
}
| 0
|
296,035
|
bool IsSupported(const NodeDef* node) const override {
return IsAnySparseSegmentReduction(*node);
}
| 0
|
6,898
|
void set_fat(DOS_FS * fs, uint32_t cluster, int32_t new)
{
unsigned char *data = NULL;
int size;
loff_t offs;
if (new == -1)
new = FAT_EOF(fs);
else if ((long)new == -2)
new = FAT_BAD(fs);
switch (fs->fat_bits) {
case 12:
data = fs->fat + cluster * 3 / 2;
offs = fs->fat_start + cluster * 3 / 2;
if (cluster & 1) {
FAT_ENTRY prevEntry;
get_fat(&prevEntry, fs->fat, cluster - 1, fs);
data[0] = ((new & 0xf) << 4) | (prevEntry.value >> 8);
data[1] = new >> 4;
} else {
FAT_ENTRY subseqEntry;
if (cluster != fs->clusters - 1)
get_fat(&subseqEntry, fs->fat, cluster + 1, fs);
else
subseqEntry.value = 0;
data[0] = new & 0xff;
data[1] = (new >> 8) | ((0xff & subseqEntry.value) << 4);
}
size = 2;
break;
case 16:
data = fs->fat + cluster * 2;
offs = fs->fat_start + cluster * 2;
*(unsigned short *)data = htole16(new);
size = 2;
break;
case 32:
{
FAT_ENTRY curEntry;
get_fat(&curEntry, fs->fat, cluster, fs);
data = fs->fat + cluster * 4;
offs = fs->fat_start + cluster * 4;
/* According to M$, the high 4 bits of a FAT32 entry are reserved and
* are not part of the cluster number. So we never touch them. */
*(uint32_t *)data = htole32((new & 0xfffffff) |
(curEntry.reserved << 28));
size = 4;
}
break;
default:
die("Bad FAT entry size: %d bits.", fs->fat_bits);
}
fs_write(offs, size, data);
if (fs->nfats > 1) {
fs_write(offs + fs->fat_size, size, data);
}
}
| 1
|
165,936
|
ofputil_append_table_features_reply(const struct ofputil_table_features *tf,
struct ovs_list *replies)
{
struct ofpbuf *reply = ofpbuf_from_list(ovs_list_back(replies));
enum ofp_version version = ofpmp_version(replies);
size_t start_ofs = reply->size;
struct ofp13_table_features *otf;
otf = ofpbuf_put_zeros(reply, sizeof *otf);
otf->table_id = tf->table_id;
ovs_strlcpy(otf->name, tf->name, sizeof otf->name);
otf->metadata_match = tf->metadata_match;
otf->metadata_write = tf->metadata_write;
if (version >= OFP14_VERSION) {
if (tf->supports_eviction) {
otf->capabilities |= htonl(OFPTC14_EVICTION);
}
if (tf->supports_vacancy_events) {
otf->capabilities |= htonl(OFPTC14_VACANCY_EVENTS);
}
}
otf->max_entries = htonl(tf->max_entries);
put_table_instruction_features(reply, &tf->nonmiss, 0, version);
put_table_instruction_features(reply, &tf->miss, 1, version);
put_fields_property(reply, &tf->match, &tf->mask,
OFPTFPT13_MATCH, version);
put_fields_property(reply, &tf->wildcard, NULL,
OFPTFPT13_WILDCARDS, version);
otf = ofpbuf_at_assert(reply, start_ofs, sizeof *otf);
otf->length = htons(reply->size - start_ofs);
ofpmp_postappend(replies, start_ofs);
}
| 0
|
110,567
|
string dotConcat(const std::string& a, const std::string &b)
{
if(a.empty() || b.empty())
return a+b;
else
return a+"."+b;
}
| 0
|
316,213
|
sp<MetaData> MyOggExtractor::getFormat() const {
return mMeta;
}
| 0
|
213,788
|
static int spl_ptr_heap_cmp_cb_helper(zval *object, spl_heap_object *heap_object, zval *a, zval *b, long *result TSRMLS_DC) { /* {{{ */
zval *result_p = NULL;
zend_call_method_with_2_params(&object, heap_object->std.ce, &heap_object->fptr_cmp, "compare", &result_p, a, b);
if (EG(exception)) {
return FAILURE;
}
convert_to_long(result_p);
*result = Z_LVAL_P(result_p);
zval_ptr_dtor(&result_p);
return SUCCESS;
}
/* }}} */
| 0
|
352,168
|
static int check_ld_imm(struct bpf_verifier_env *env, struct bpf_insn *insn)
{
struct bpf_insn_aux_data *aux = cur_aux(env);
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *dst_reg;
struct bpf_map *map;
int err;
if (BPF_SIZE(insn->code) != BPF_DW) {
verbose(env, "invalid BPF_LD_IMM insn\n");
return -EINVAL;
}
if (insn->off != 0) {
verbose(env, "BPF_LD_IMM64 uses reserved fields\n");
return -EINVAL;
}
err = check_reg_arg(env, insn->dst_reg, DST_OP);
if (err)
return err;
dst_reg = ®s[insn->dst_reg];
if (insn->src_reg == 0) {
u64 imm = ((u64)(insn + 1)->imm << 32) | (u32)insn->imm;
dst_reg->type = SCALAR_VALUE;
__mark_reg_known(®s[insn->dst_reg], imm);
return 0;
}
if (insn->src_reg == BPF_PSEUDO_BTF_ID) {
mark_reg_known_zero(env, regs, insn->dst_reg);
dst_reg->type = aux->btf_var.reg_type;
switch (dst_reg->type) {
case PTR_TO_MEM:
dst_reg->mem_size = aux->btf_var.mem_size;
break;
case PTR_TO_BTF_ID:
case PTR_TO_PERCPU_BTF_ID:
dst_reg->btf = aux->btf_var.btf;
dst_reg->btf_id = aux->btf_var.btf_id;
break;
default:
verbose(env, "bpf verifier is misconfigured\n");
return -EFAULT;
}
return 0;
}
if (insn->src_reg == BPF_PSEUDO_FUNC) {
struct bpf_prog_aux *aux = env->prog->aux;
u32 subprogno = find_subprog(env,
env->insn_idx + insn->imm + 1);
if (!aux->func_info) {
verbose(env, "missing btf func_info\n");
return -EINVAL;
}
if (aux->func_info_aux[subprogno].linkage != BTF_FUNC_STATIC) {
verbose(env, "callback function not static\n");
return -EINVAL;
}
dst_reg->type = PTR_TO_FUNC;
dst_reg->subprogno = subprogno;
return 0;
}
map = env->used_maps[aux->map_index];
mark_reg_known_zero(env, regs, insn->dst_reg);
dst_reg->map_ptr = map;
if (insn->src_reg == BPF_PSEUDO_MAP_VALUE ||
insn->src_reg == BPF_PSEUDO_MAP_IDX_VALUE) {
dst_reg->type = PTR_TO_MAP_VALUE;
dst_reg->off = aux->map_off;
if (map_value_has_spin_lock(map))
dst_reg->id = ++env->id_gen;
} else if (insn->src_reg == BPF_PSEUDO_MAP_FD ||
insn->src_reg == BPF_PSEUDO_MAP_IDX) {
dst_reg->type = CONST_PTR_TO_MAP;
} else {
verbose(env, "bpf verifier is misconfigured\n");
return -EINVAL;
}
return 0;
}
| 1
|
263,228
|
static GF_Err DumpLSRActivate(GF_SceneDumper *sdump, GF_Command *com)
{
char szID[1024];
char *lsrns = sd_get_lsr_namespace(com->in_scene);
DUMP_IND(sdump);
if (com->tag==GF_SG_LSR_ACTIVATE) {
gf_fprintf(sdump->trace, "<%sActivate ref=\"%s\" />\n", lsrns, lsr_format_node_id(com->node, com->RouteID, szID));
} else {
gf_fprintf(sdump->trace, "<%sDeactivate ref=\"%s\" />\n", lsrns, lsr_format_node_id(com->node, com->RouteID, szID));
}
return GF_OK;
}
| 0
|
339,815
|
void cpu_exec_init(CPUState *env)
{
CPUState **penv;
int cpu_index;
#if defined(CONFIG_USER_ONLY)
cpu_list_lock();
#endif
env->next_cpu = NULL;
penv = &first_cpu;
cpu_index = 0;
while (*penv != NULL) {
penv = &(*penv)->next_cpu;
cpu_index++;
}
env->cpu_index = cpu_index;
env->numa_node = 0;
TAILQ_INIT(&env->breakpoints);
TAILQ_INIT(&env->watchpoints);
*penv = env;
#if defined(CONFIG_USER_ONLY)
cpu_list_unlock();
#endif
#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
vmstate_register(cpu_index, &vmstate_cpu_common, env);
register_savevm("cpu", cpu_index, CPU_SAVE_VERSION,
cpu_save, cpu_load, env);
#endif
}
| 0
|
76,686
|
hexval(char c)
{
if (c >= 'A' && c <= 'F')
return c - 'A' + 10;
else if (c >= 'a' && c <= 'f')
return c - 'a' + 10;
else if (c >= '0' && c <= '9')
return c - '0';
else
return 0;
}
| 0
|
339,429
|
MAKE_ACCESSORS(AVVDPAUContext, vdpau_hwaccel, AVVDPAU_Render2, render2)
int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile,
int level)
{
VDPAUHWContext *hwctx = avctx->hwaccel_context;
VDPAUContext *vdctx = avctx->internal->hwaccel_priv_data;
VdpVideoSurfaceQueryCapabilities *surface_query_caps;
VdpDecoderQueryCapabilities *decoder_query_caps;
VdpDecoderCreate *create;
void *func;
VdpStatus status;
VdpBool supported;
uint32_t max_level, max_mb, max_width, max_height;
/* See vdpau/vdpau.h for alignment constraints. */
uint32_t width = (avctx->coded_width + 1) & ~1;
uint32_t height = (avctx->coded_height + 3) & ~3;
vdctx->width = UINT32_MAX;
vdctx->height = UINT32_MAX;
hwctx->reset = 0;
if (!hwctx) {
vdctx->device = VDP_INVALID_HANDLE;
av_log(avctx, AV_LOG_WARNING, "hwaccel_context has not been setup by the user application, cannot initialize\n");
return 0;
}
if (hwctx->context.decoder != VDP_INVALID_HANDLE) {
vdctx->decoder = hwctx->context.decoder;
vdctx->render = hwctx->context.render;
vdctx->device = VDP_INVALID_HANDLE;
return 0; /* Decoder created by user */
}
vdctx->device = hwctx->device;
vdctx->get_proc_address = hwctx->get_proc_address;
if (level < 0)
return AVERROR(ENOTSUP);
status = vdctx->get_proc_address(vdctx->device,
VDP_FUNC_ID_VIDEO_SURFACE_QUERY_CAPABILITIES,
&func);
if (status != VDP_STATUS_OK)
return vdpau_error(status);
else
surface_query_caps = func;
status = surface_query_caps(vdctx->device, VDP_CHROMA_TYPE_420, &supported,
&max_width, &max_height);
if (status != VDP_STATUS_OK)
return vdpau_error(status);
if (supported != VDP_TRUE ||
max_width < width || max_height < height)
return AVERROR(ENOTSUP);
status = vdctx->get_proc_address(vdctx->device,
VDP_FUNC_ID_DECODER_QUERY_CAPABILITIES,
&func);
if (status != VDP_STATUS_OK)
return vdpau_error(status);
else
decoder_query_caps = func;
status = decoder_query_caps(vdctx->device, profile, &supported, &max_level,
&max_mb, &max_width, &max_height);
if (status != VDP_STATUS_OK)
return vdpau_error(status);
if (supported != VDP_TRUE || max_level < level ||
max_width < width || max_height < height)
return AVERROR(ENOTSUP);
status = vdctx->get_proc_address(vdctx->device, VDP_FUNC_ID_DECODER_CREATE,
&func);
if (status != VDP_STATUS_OK)
return vdpau_error(status);
else
create = func;
status = vdctx->get_proc_address(vdctx->device, VDP_FUNC_ID_DECODER_RENDER,
&func);
if (status != VDP_STATUS_OK)
return vdpau_error(status);
else
vdctx->render = func;
status = create(vdctx->device, profile, width, height, avctx->refs,
&vdctx->decoder);
if (status == VDP_STATUS_OK) {
vdctx->width = avctx->coded_width;
vdctx->height = avctx->coded_height;
}
return vdpau_error(status);
}
| 0
|
166,104
|
void BrowserActionsContainer::BubbleBrowserWindowClosing(
BrowserBubble* bubble) {
HidePopup();
}
| 0
|
234,772
|
static void activityLoggingSetterForAllWorldsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
TestObjectPythonV8Internal::activityLoggingSetterForAllWorldsLongAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
| 0
|
103,299
|
rb_iter_head_event(struct ring_buffer_iter *iter)
{
return __rb_page_index(iter->head_page, iter->head);
}
| 0
|
262,055
|
const envoy::config::listener::v3::Listener& listener() const { return listener_; }
| 0
|
496,237
|
field_deprecation_reason(agooErr err, gqlDoc doc, gqlCobj obj, gqlField field, gqlSel sel, gqlValue result, int depth) {
const char *reason = deprecation_reason(((gqlField)obj->ptr)->dir);
const char *key = sel->name;
gqlValue rv;
if (NULL != sel->alias) {
key = sel->alias;
}
if (NULL == reason) {
rv = gql_null_create(err);
} else {
rv = gql_string_create(err, reason, -1);
}
return gql_object_set(err, result, key, rv);
}
| 0
|
360,374
|
link_info_stop (NautilusDirectory *directory)
{
NautilusFile *file;
if (directory->details->link_info_read_state != NULL) {
file = directory->details->link_info_read_state->file;
if (file != NULL) {
g_assert (NAUTILUS_IS_FILE (file));
g_assert (file->details->directory == directory);
if (is_needy (file,
lacks_link_info,
REQUEST_LINK_INFO)) {
return;
}
}
/* The link info is not wanted, so stop it. */
link_info_cancel (directory);
}
}
| 0
|
115,636
|
static int invlpg_interception(struct vcpu_svm *svm)
{
if (!static_cpu_has(X86_FEATURE_DECODEASSISTS))
return emulate_instruction(&svm->vcpu, 0) == EMULATE_DONE;
kvm_mmu_invlpg(&svm->vcpu, svm->vmcb->control.exit_info_1);
skip_emulated_instruction(&svm->vcpu);
return 1;
}
| 0
|
428,018
|
EXPORTED void write_body(long code, struct transaction_t *txn,
const char *buf, unsigned len)
{
unsigned is_dynamic = code ? (txn->flags.te & TE_CHUNKED) : 1;
unsigned outlen = len, offset = 0;
int do_md5 = config_getswitch(IMAPOPT_HTTPCONTENTMD5);
static MD5_CTX ctx;
static unsigned char md5[MD5_DIGEST_LENGTH];
if (!is_dynamic && len < GZIP_MIN_LEN) {
/* Don't compress small static content */
txn->resp_body.enc = CE_IDENTITY;
txn->flags.te = TE_NONE;
}
/* Compress data */
if (txn->resp_body.enc || txn->flags.te & ~TE_CHUNKED) {
#ifdef HAVE_ZLIB
/* Only flush for static content or on last (zero-length) chunk */
unsigned flush = (is_dynamic && len) ? Z_NO_FLUSH : Z_FINISH;
if (code) deflateReset(&txn->zstrm);
txn->zstrm.next_in = (Bytef *) buf;
txn->zstrm.avail_in = len;
buf_reset(&txn->zbuf);
do {
buf_ensure(&txn->zbuf,
deflateBound(&txn->zstrm, txn->zstrm.avail_in));
txn->zstrm.next_out = (Bytef *) txn->zbuf.s + txn->zbuf.len;
txn->zstrm.avail_out = txn->zbuf.alloc - txn->zbuf.len;
deflate(&txn->zstrm, flush);
txn->zbuf.len = txn->zbuf.alloc - txn->zstrm.avail_out;
} while (!txn->zstrm.avail_out);
buf = txn->zbuf.s;
outlen = txn->zbuf.len;
#else
/* XXX should never get here */
fatal("Compression requested, but no zlib", EC_SOFTWARE);
#endif /* HAVE_ZLIB */
}
if (code) {
/* Initial call - prepare response header based on CE, TE and version */
if (do_md5) MD5Init(&ctx);
if (txn->flags.te & ~TE_CHUNKED) {
/* Transfer-Encoded content MUST be chunked */
txn->flags.te |= TE_CHUNKED;
if (!is_dynamic) {
/* Handle static content as last chunk */
len = 0;
}
}
if (!(txn->flags.te & TE_CHUNKED)) {
/* Full/partial body (no encoding).
*
* In all cases, 'resp_body.len' is used to specify complete-length
* In the case of a 206 or 416 response, Content-Length will be
* set accordingly in response_header().
*/
txn->resp_body.len = outlen;
if (code == HTTP_PARTIAL) {
/* check_precond() tells us that this is a range request */
code = parse_ranges(*spool_getheader(txn->req_hdrs, "Range"),
outlen, &txn->resp_body.range);
switch (code) {
case HTTP_OK:
/* Full body (unknown range-unit) */
break;
case HTTP_PARTIAL:
/* One or more range request(s) */
txn->resp_body.len = outlen;
if (txn->resp_body.range->next) {
/* Multiple ranges */
multipart_byteranges(txn, buf);
return;
}
else {
/* Single range - set data parameters accordingly */
offset += txn->resp_body.range->first;
outlen = txn->resp_body.range->last -
txn->resp_body.range->first + 1;
}
break;
case HTTP_UNSAT_RANGE:
/* No valid ranges */
outlen = 0;
break;
}
}
if (outlen && do_md5) {
MD5Update(&ctx, buf+offset, outlen);
MD5Final(md5, &ctx);
txn->resp_body.md5 = md5;
}
}
else if (txn->flags.ver1_0) {
/* HTTP/1.0 doesn't support chunked - close-delimit the body */
txn->flags.conn = CONN_CLOSE;
}
else if (do_md5) txn->flags.trailer = TRAILER_CMD5;
response_header(code, txn);
/* MUST NOT send a body for 1xx/204/304 response or any HEAD response */
switch (code) {
case HTTP_CONTINUE:
case HTTP_SWITCH_PROT:
case HTTP_PROCESSING:
case HTTP_NO_CONTENT:
case HTTP_NOT_MODIFIED:
return;
default:
if (txn->meth == METH_HEAD) return;
}
}
/* Output data */
if ((txn->flags.te & TE_CHUNKED) && !txn->flags.ver1_0) {
/* HTTP/1.1 chunk */
if (outlen) {
prot_printf(httpd_out, "%x\r\n", outlen);
prot_write(httpd_out, buf, outlen);
prot_puts(httpd_out, "\r\n");
if (do_md5) MD5Update(&ctx, buf, outlen);
}
if (!len) {
/* Terminate the HTTP/1.1 body with a zero-length chunk */
prot_puts(httpd_out, "0\r\n");
/* Trailer */
if (do_md5) {
MD5Final(md5, &ctx);
Content_MD5(md5);
}
prot_puts(httpd_out, "\r\n");
}
}
else {
/* Full body or HTTP/1.0 close-delimited body */
prot_write(httpd_out, buf + offset, outlen);
}
}
| 0
|
171,025
|
void ProfileSyncService::OnExperimentsChanged(
const browser_sync::Experiments& experiments) {
if (current_experiments.Matches(experiments))
return;
if (migrator_.get() &&
migrator_->state() != browser_sync::BackendMigrator::IDLE) {
DVLOG(1) << "Dropping OnExperimentsChanged due to migrator busy.";
return;
}
const syncable::ModelTypeSet registered_types = GetRegisteredDataTypes();
syncable::ModelTypeSet to_add;
const syncable::ModelTypeSet to_register =
Difference(to_add, registered_types);
DVLOG(2) << "OnExperimentsChanged called with types: "
<< syncable::ModelTypeSetToString(to_add);
DVLOG(2) << "Enabling types: " << syncable::ModelTypeSetToString(to_register);
for (syncable::ModelTypeSet::Iterator it = to_register.First();
it.Good(); it.Inc()) {
RegisterNewDataType(it.Get());
#if !defined(OS_ANDROID)
std::string experiment_name = GetExperimentNameForDataType(it.Get());
if (experiment_name.empty())
continue;
about_flags::SetExperimentEnabled(g_browser_process->local_state(),
experiment_name,
true);
#endif // !defined(OS_ANDROID)
}
if (sync_prefs_.HasKeepEverythingSynced()) {
sync_prefs_.SetPreferredDataTypes(registered_types, registered_types);
if (!to_register.Empty() && HasSyncSetupCompleted() && migrator_.get()) {
DVLOG(1) << "Dynamically enabling new datatypes: "
<< syncable::ModelTypeSetToString(to_register);
OnMigrationNeededForTypes(to_register);
}
}
if (experiments.sync_tab_favicons) {
DVLOG(1) << "Enabling syncing of tab favicons.";
about_flags::SetExperimentEnabled(g_browser_process->local_state(),
"sync-tab-favicons",
true);
}
current_experiments = experiments;
}
| 0
|
403,247
|
krb5_ticket_get_authorization_data_type(krb5_context context,
krb5_ticket *ticket,
int type,
krb5_data *data)
{
AuthorizationData *ad;
krb5_error_code ret;
krb5_boolean found = FALSE;
krb5_data_zero(data);
ad = ticket->ticket.authorization_data;
if (ticket->ticket.authorization_data == NULL) {
krb5_set_error_message(context, ENOENT,
N_("Ticket have not authorization data", ""));
return ENOENT; /* XXX */
}
ret = find_type_in_ad(context, type, data, &found, TRUE,
&ticket->ticket.key, ad, 0);
if (ret)
return ret;
if (!found) {
krb5_set_error_message(context, ENOENT,
N_("Ticket have not "
"authorization data of type %d", ""),
type);
return ENOENT; /* XXX */
}
return 0;
}
| 0
|
472,632
|
static uint16_t nvme_dsm(NvmeCtrl *n, NvmeRequest *req)
{
NvmeNamespace *ns = req->ns;
NvmeDsmCmd *dsm = (NvmeDsmCmd *) &req->cmd;
uint32_t attr = le32_to_cpu(dsm->attributes);
uint32_t nr = (le32_to_cpu(dsm->nr) & 0xff) + 1;
uint16_t status = NVME_SUCCESS;
trace_pci_nvme_dsm(nr, attr);
if (attr & NVME_DSMGMT_AD) {
NvmeDSMAIOCB *iocb = blk_aio_get(&nvme_dsm_aiocb_info, ns->blkconf.blk,
nvme_misc_cb, req);
iocb->req = req;
iocb->bh = qemu_bh_new(nvme_dsm_bh, iocb);
iocb->ret = 0;
iocb->range = g_new(NvmeDsmRange, nr);
iocb->nr = nr;
iocb->idx = 0;
status = nvme_h2c(n, (uint8_t *)iocb->range, sizeof(NvmeDsmRange) * nr,
req);
if (status) {
return status;
}
req->aiocb = &iocb->common;
nvme_dsm_cb(iocb, 0);
return NVME_NO_COMPLETE;
}
return status;
}
| 0
|
466,363
|
TEST_F(HttpConnectionManagerImplTest, DateHeaderPresent) {
setup(false, "");
setUpEncoderAndDecoder(false, false);
sendRequestHeadersAndData();
const std::string expected_date{"Tue, 15 Nov 1994 08:12:31 GMT"};
const auto* modified_headers =
sendResponseHeaders(ResponseHeaderMapPtr{new TestResponseHeaderMapImpl{
{":status", "200"}, {"server", "foo"}, {"date", expected_date.c_str()}}});
ASSERT_TRUE(modified_headers);
ASSERT_TRUE(modified_headers->Date());
EXPECT_EQ(expected_date, modified_headers->getDateValue());
doRemoteClose();
}
| 0
|
79,659
|
static int http_stream_write_single(
git_smart_subtransport_stream *stream,
const char *buffer,
size_t len)
{
http_stream *s = (http_stream *)stream;
http_subtransport *t = OWNING_SUBTRANSPORT(s);
git_buf request = GIT_BUF_INIT;
assert(t->connected);
if (s->sent_request) {
giterr_set(GITERR_NET, "Subtransport configured for only one write");
return -1;
}
clear_parser_state(t);
if (gen_request(&request, s, len) < 0)
return -1;
if (git_stream_write(t->io, request.ptr, request.size, 0) < 0)
goto on_error;
if (len && git_stream_write(t->io, buffer, len, 0) < 0)
goto on_error;
git_buf_free(&request);
s->sent_request = 1;
return 0;
on_error:
git_buf_free(&request);
return -1;
}
| 0
|
270,061
|
void ZipFile::Builder::addEntry (InputStream* stream, int compression, const String& path, Time time)
{
jassert (stream != nullptr); // must not be null!
jassert (path.isNotEmpty());
items.add (new Item ({}, stream, compression, path, time));
}
| 0
|
490,207
|
static int piv_is_object_present(sc_card_t *card, u8 *ptr)
{
piv_private_data_t * priv = PIV_DATA(card);
int r = 0;
int enumtag;
enumtag = piv_find_obj_by_containerid(card, ptr);
if (enumtag >= 0 && priv->obj_cache[enumtag].flags & PIV_OBJ_CACHE_NOT_PRESENT)
r = 1;
LOG_FUNC_RETURN(card->ctx, r);
}
| 0
|
484,223
|
mlx5_rxq_initialize(struct mlx5_rxq_data *rxq)
{
const unsigned int wqe_n = 1 << rxq->elts_n;
unsigned int i;
for (i = 0; (i != wqe_n); ++i) {
volatile struct mlx5_wqe_data_seg *scat;
uintptr_t addr;
uint32_t byte_count;
if (mlx5_rxq_mprq_enabled(rxq)) {
struct mlx5_mprq_buf *buf = (*rxq->mprq_bufs)[i];
scat = &((volatile struct mlx5_wqe_mprq *)
rxq->wqes)[i].dseg;
addr = (uintptr_t)mlx5_mprq_buf_addr
(buf, (1 << rxq->log_strd_num));
byte_count = (1 << rxq->log_strd_sz) *
(1 << rxq->log_strd_num);
} else {
struct rte_mbuf *buf = (*rxq->elts)[i];
scat = &((volatile struct mlx5_wqe_data_seg *)
rxq->wqes)[i];
addr = rte_pktmbuf_mtod(buf, uintptr_t);
byte_count = DATA_LEN(buf);
}
/* scat->addr must be able to store a pointer. */
assert(sizeof(scat->addr) >= sizeof(uintptr_t));
*scat = (struct mlx5_wqe_data_seg){
.addr = rte_cpu_to_be_64(addr),
.byte_count = rte_cpu_to_be_32(byte_count),
.lkey = mlx5_rx_addr2mr(rxq, addr),
};
}
rxq->consumed_strd = 0;
rxq->decompressed = 0;
rxq->rq_pi = 0;
rxq->zip = (struct rxq_zip){
.ai = 0,
};
/* Update doorbell counter. */
rxq->rq_ci = wqe_n >> rxq->sges_n;
rte_cio_wmb();
*rxq->rq_db = rte_cpu_to_be_32(rxq->rq_ci);
}
| 0
|
433,818
|
ec_mulm_25519 (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, mpi_ec_t ctx)
{
mpi_ptr_t wp, up, vp;
mpi_size_t wsize = LIMB_SIZE_25519;
mpi_limb_t n[LIMB_SIZE_25519*2];
mpi_limb_t m[LIMB_SIZE_25519+1];
mpi_limb_t cy;
int msb;
(void)ctx;
if (w->nlimbs != wsize || u->nlimbs != wsize || v->nlimbs != wsize)
log_bug ("mulm_25519: different sizes\n");
up = u->d;
vp = v->d;
wp = w->d;
_gcry_mpih_mul_n (n, up, vp, wsize);
memcpy (wp, n, wsize * BYTES_PER_MPI_LIMB);
wp[LIMB_SIZE_25519-1] &= ~((mpi_limb_t)1 << (255 % BITS_PER_MPI_LIMB));
memcpy (m, n+LIMB_SIZE_25519-1, (wsize+1) * BYTES_PER_MPI_LIMB);
_gcry_mpih_rshift (m, m, LIMB_SIZE_25519+1, (255 % BITS_PER_MPI_LIMB));
memcpy (n, m, wsize * BYTES_PER_MPI_LIMB);
cy = _gcry_mpih_lshift (m, m, LIMB_SIZE_25519, 4);
m[LIMB_SIZE_25519] = cy;
cy = _gcry_mpih_add_n (m, m, n, wsize);
m[LIMB_SIZE_25519] += cy;
cy = _gcry_mpih_add_n (m, m, n, wsize);
m[LIMB_SIZE_25519] += cy;
cy = _gcry_mpih_add_n (m, m, n, wsize);
m[LIMB_SIZE_25519] += cy;
cy = _gcry_mpih_add_n (wp, wp, m, wsize);
m[LIMB_SIZE_25519] += cy;
memset (m, 0, wsize * BYTES_PER_MPI_LIMB);
msb = (wp[LIMB_SIZE_25519-1] >> (255 % BITS_PER_MPI_LIMB));
m[0] = (m[LIMB_SIZE_25519] * 2 + msb) * 19;
wp[LIMB_SIZE_25519-1] &= ~((mpi_limb_t)1 << (255 % BITS_PER_MPI_LIMB));
_gcry_mpih_add_n (wp, wp, m, wsize);
m[0] = 0;
cy = _gcry_mpih_sub_n (wp, wp, ctx->p->d, wsize);
mpih_set_cond (m, ctx->p->d, wsize, (cy != 0UL));
_gcry_mpih_add_n (wp, wp, m, wsize);
}
| 0
|
50,094
|
static size_t NumElements(const TensorProto& proto) {
return proto.variant_val().size();
}
| 0
|
363,468
|
gdm_session_settings_new (void)
{
GdmSessionSettings *settings;
settings = g_object_new (GDM_TYPE_SESSION_SETTINGS,
NULL);
return settings;
}
| 0
|
246,058
|
bool DownloadRequestLimiter::TabDownloadState::is_showing_prompt() const {
return factory_.HasWeakPtrs();
}
| 0
|
393,872
|
dissect_80211n_mac(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, int data_len, gboolean add_subtree, guint32 *n_mac_flags, guint32 *ampdu_id, struct ieee_802_11_phdr *phdr)
{
proto_tree *ftree = tree;
ptvcursor_t *csr;
int subtree_off = add_subtree ? 4 : 0;
guint32 flags;
phdr->phy = PHDR_802_11_PHY_11N;
*n_mac_flags = tvb_get_letohl(tvb, offset + subtree_off);
*ampdu_id = tvb_get_letohl(tvb, offset + 4 + subtree_off);
if (add_subtree) {
ftree = proto_tree_add_subtree(tree, tvb, offset, data_len, ett_dot11n_mac, NULL, "802.11n MAC");
add_ppi_field_header(tvb, ftree, &offset);
data_len -= 4; /* Subtract field header length */
}
if (data_len != PPI_80211N_MAC_LEN) {
proto_tree_add_expert_format(ftree, pinfo, &ei_ppi_invalid_length, tvb, offset, data_len, "Invalid length: %u", data_len);
THROW(ReportedBoundsError);
}
csr = ptvcursor_new(ftree, tvb, offset);
flags = tvb_get_letohl(tvb, ptvcursor_current_offset(csr));
phdr->phy_info.info_11n.presence_flags = PHDR_802_11N_HAS_SHORT_GI|PHDR_802_11N_HAS_GREENFIELD;
phdr->phy_info.info_11n.short_gi = ((flags & DOT11N_FLAG_SHORT_GI) != 0);
phdr->phy_info.info_11n.greenfield = ((flags & DOT11N_FLAG_GREENFIELD) != 0);
ptvcursor_add_with_subtree(csr, hf_80211n_mac_flags, 4, ENC_LITTLE_ENDIAN,
ett_dot11n_mac_flags);
ptvcursor_add_no_advance(csr, hf_80211n_mac_flags_greenfield, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add_no_advance(csr, hf_80211n_mac_flags_ht20_40, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add_no_advance(csr, hf_80211n_mac_flags_rx_guard_interval, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add_no_advance(csr, hf_80211n_mac_flags_duplicate_rx, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add_no_advance(csr, hf_80211n_mac_flags_aggregate, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add_no_advance(csr, hf_80211n_mac_flags_more_aggregates, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add(csr, hf_80211n_mac_flags_delimiter_crc_after, 4, ENC_LITTLE_ENDIAN); /* Last */
ptvcursor_pop_subtree(csr);
ptvcursor_add(csr, hf_80211n_mac_ampdu_id, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add(csr, hf_80211n_mac_num_delimiters, 1, ENC_LITTLE_ENDIAN);
if (add_subtree) {
ptvcursor_add(csr, hf_80211n_mac_reserved, 3, ENC_LITTLE_ENDIAN);
}
ptvcursor_free(csr);
}
| 0
|
358,063
|
static int create_watch(struct inotify_device *dev, struct inode *inode,
u32 mask)
{
struct inotify_user_watch *watch;
int ret;
if (atomic_read(&dev->user->inotify_watches) >=
inotify_max_user_watches)
return -ENOSPC;
watch = kmem_cache_alloc(watch_cachep, GFP_KERNEL);
if (unlikely(!watch))
return -ENOMEM;
/* save a reference to device and bump the count to make it official */
get_inotify_dev(dev);
watch->dev = dev;
atomic_inc(&dev->user->inotify_watches);
inotify_init_watch(&watch->wdata);
ret = inotify_add_watch(dev->ih, &watch->wdata, inode, mask);
if (ret < 0)
free_inotify_user_watch(&watch->wdata);
return ret;
}
| 0
|
1,690
|
static char * * create_argv_command ( struct rule * rule , struct process * process , struct iovec * * argv ) {
size_t count , i , j , stdin_arg ;
char * * req_argv = NULL ;
const char * program ;
for ( count = 0 ;
argv [ count ] != NULL ;
count ++ ) ;
if ( rule -> sudo_user == NULL ) req_argv = xcalloc ( count + 1 , sizeof ( char * ) ) ;
else req_argv = xcalloc ( count + 5 , sizeof ( char * ) ) ;
if ( rule -> sudo_user != NULL ) {
req_argv [ 0 ] = xstrdup ( PATH_SUDO ) ;
req_argv [ 1 ] = xstrdup ( "-u" ) ;
req_argv [ 2 ] = xstrdup ( rule -> sudo_user ) ;
req_argv [ 3 ] = xstrdup ( "--" ) ;
req_argv [ 4 ] = rule -> program ;
j = 5 ;
}
else {
program = strrchr ( rule -> program , '/' ) ;
if ( program == NULL ) program = rule -> program ;
else program ++ ;
req_argv [ 0 ] = xstrdup ( program ) ;
j = 1 ;
}
if ( rule -> stdin_arg == - 1 ) stdin_arg = count - 1 ;
else stdin_arg = ( size_t ) rule -> stdin_arg ;
for ( i = 1 ;
i < count ;
i ++ ) {
const char * data = argv [ i ] -> iov_base ;
size_t length = argv [ i ] -> iov_len ;
if ( i == stdin_arg ) {
process -> input = evbuffer_new ( ) ;
if ( process -> input == NULL ) die ( "internal error: cannot create input buffer" ) ;
if ( evbuffer_add ( process -> input , data , length ) < 0 ) die ( "internal error: cannot add data to input buffer" ) ;
continue ;
}
if ( length == 0 ) req_argv [ j ] = xstrdup ( "" ) ;
else req_argv [ j ] = xstrndup ( data , length ) ;
j ++ ;
}
req_argv [ j ] = NULL ;
return req_argv ;
}
| 1
|
491,872
|
static int mxf_set_audio_pts(MXFContext *mxf, AVCodecContext *codec,
AVPacket *pkt)
{
MXFTrack *track = mxf->fc->streams[pkt->stream_index]->priv_data;
int64_t bits_per_sample = codec->bits_per_coded_sample;
if (!bits_per_sample)
bits_per_sample = av_get_bits_per_sample(codec->codec_id);
pkt->pts = track->sample_count;
if ( codec->channels <= 0
|| bits_per_sample <= 0
|| codec->channels * (int64_t)bits_per_sample < 8)
return AVERROR(EINVAL);
track->sample_count += pkt->size / (codec->channels * (int64_t)bits_per_sample / 8);
return 0;
}
| 0
|
398,569
|
static plist_t parse_bin_node(struct bplist_data *bplist, const char** object)
{
uint16_t type = 0;
uint64_t size = 0;
if (!object)
return NULL;
type = (**object) & BPLIST_MASK;
size = (**object) & BPLIST_FILL;
(*object)++;
switch (type)
{
case BPLIST_NULL:
switch (size)
{
case BPLIST_TRUE:
{
plist_data_t data = plist_new_plist_data();
data->type = PLIST_BOOLEAN;
data->boolval = TRUE;
data->length = 1;
return node_create(NULL, data);
}
case BPLIST_FALSE:
{
plist_data_t data = plist_new_plist_data();
data->type = PLIST_BOOLEAN;
data->boolval = FALSE;
data->length = 1;
return node_create(NULL, data);
}
case BPLIST_NULL:
default:
return NULL;
}
case BPLIST_UINT:
if (*object - bplist->data + (uint64_t)(1 << size) >= bplist->size)
return NULL;
return parse_uint_node(object, size);
case BPLIST_REAL:
if (*object - bplist->data + (uint64_t)(1 << size) >= bplist->size)
return NULL;
return parse_real_node(object, size);
case BPLIST_DATE:
if (3 != size)
return NULL;
if (*object - bplist->data + (uint64_t)(1 << size) >= bplist->size)
return NULL;
return parse_date_node(object, size);
case BPLIST_DATA:
if (BPLIST_FILL == size) {
uint8_t next_size = **object & BPLIST_FILL;
if ((**object & BPLIST_MASK) != BPLIST_UINT)
return NULL;
(*object)++;
size = UINT_TO_HOST(*object, (1 << next_size));
(*object) += (1 << next_size);
}
if (*object - bplist->data + size >= bplist->size)
return NULL;
return parse_data_node(object, size);
case BPLIST_STRING:
if (BPLIST_FILL == size) {
uint8_t next_size = **object & BPLIST_FILL;
if ((**object & BPLIST_MASK) != BPLIST_UINT)
return NULL;
(*object)++;
size = UINT_TO_HOST(*object, (1 << next_size));
(*object) += (1 << next_size);
}
if (*object - bplist->data + size >= bplist->size)
return NULL;
return parse_string_node(object, size);
case BPLIST_UNICODE:
if (BPLIST_FILL == size) {
uint8_t next_size = **object & BPLIST_FILL;
if ((**object & BPLIST_MASK) != BPLIST_UINT)
return NULL;
(*object)++;
size = UINT_TO_HOST(*object, (1 << next_size));
(*object) += (1 << next_size);
}
if (*object - bplist->data + size * 2 >= bplist->size)
return NULL;
return parse_unicode_node(object, size);
case BPLIST_SET:
case BPLIST_ARRAY:
if (BPLIST_FILL == size) {
uint8_t next_size = **object & BPLIST_FILL;
if ((**object & BPLIST_MASK) != BPLIST_UINT)
return NULL;
(*object)++;
size = UINT_TO_HOST(*object, (1 << next_size));
(*object) += (1 << next_size);
}
if (*object - bplist->data + size >= bplist->size)
return NULL;
return parse_array_node(bplist, object, size);
case BPLIST_UID:
return parse_uid_node(object, size);
case BPLIST_DICT:
if (BPLIST_FILL == size) {
uint8_t next_size = **object & BPLIST_FILL;
if ((**object & BPLIST_MASK) != BPLIST_UINT)
return NULL;
(*object)++;
size = UINT_TO_HOST(*object, (1 << next_size));
(*object) += (1 << next_size);
}
if (*object - bplist->data + size >= bplist->size)
return NULL;
return parse_dict_node(bplist, object, size);
default:
return NULL;
}
return NULL;
}
| 0
|
360,863
|
window_map_event_cb (GSWindow *window,
GdkEvent *event,
GSManager *manager)
{
gs_debug ("Handling window map_event event");
manager_maybe_grab_window (manager, window);
manager_maybe_start_job_for_window (manager, window);
return FALSE;
}
| 0
|
483,348
|
static void cgroup_apply_control_disable(struct cgroup *cgrp)
{
struct cgroup *dsct;
struct cgroup_subsys_state *d_css;
struct cgroup_subsys *ss;
int ssid;
cgroup_for_each_live_descendant_post(dsct, d_css, cgrp) {
for_each_subsys(ss, ssid) {
struct cgroup_subsys_state *css = cgroup_css(dsct, ss);
if (!css)
continue;
WARN_ON_ONCE(percpu_ref_is_dying(&css->refcnt));
if (css->parent &&
!(cgroup_ss_mask(dsct) & (1 << ss->id))) {
kill_css(css);
} else if (!css_visible(css)) {
css_clear_dir(css);
if (ss->css_reset)
ss->css_reset(css);
}
}
}
}
| 0
|
412,917
|
PHP_FUNCTION(iconv_get_encoding)
{
char *type = "all";
int type_len = sizeof("all")-1;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &type, &type_len) == FAILURE)
return;
if (!strcasecmp("all", type)) {
array_init(return_value);
add_assoc_string(return_value, "input_encoding", get_input_encoding(TSRMLS_C), 1);
add_assoc_string(return_value, "output_encoding", get_output_encoding(TSRMLS_C), 1);
add_assoc_string(return_value, "internal_encoding", get_internal_encoding(TSRMLS_C), 1);
} else if (!strcasecmp("input_encoding", type)) {
RETVAL_STRING(get_input_encoding(TSRMLS_C), 1);
} else if (!strcasecmp("output_encoding", type)) {
RETVAL_STRING(get_output_encoding(TSRMLS_C), 1);
} else if (!strcasecmp("internal_encoding", type)) {
RETVAL_STRING(get_internal_encoding(TSRMLS_C), 1);
} else {
RETURN_FALSE;
}
}
| 0
|
389,250
|
set_wildcard_reuse(
u_short family,
int on
)
{
struct interface *any;
SOCKET fd = INVALID_SOCKET;
any = ANY_INTERFACE_BYFAM(family);
if (any != NULL)
fd = any->fd;
if (fd != INVALID_SOCKET) {
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
(char *)&on, sizeof(on)))
msyslog(LOG_ERR,
"set_wildcard_reuse: setsockopt(SO_REUSEADDR, %s) failed: %m",
on ? "on" : "off");
DPRINTF(4, ("set SO_REUSEADDR to %s on %s\n",
on ? "on" : "off",
stoa(&any->sin)));
}
}
| 0
|
24,748
|
static int mem_read ( jas_stream_obj_t * obj , char * buf , int cnt ) {
int n ;
assert ( cnt >= 0 ) ;
assert ( buf ) ;
jas_stream_memobj_t * m = ( jas_stream_memobj_t * ) obj ;
n = m -> len_ - m -> pos_ ;
cnt = JAS_MIN ( n , cnt ) ;
memcpy ( buf , & m -> buf_ [ m -> pos_ ] , cnt ) ;
m -> pos_ += cnt ;
return cnt ;
}
| 0
|
440,201
|
onig_regset_search(OnigRegSet* set, const UChar* str, const UChar* end,
const UChar* start, const UChar* range,
OnigRegSetLead lead, OnigOptionType option, int* rmatch_pos)
{
int r;
int i;
OnigMatchParam* mp;
OnigMatchParam** mps;
mps = (OnigMatchParam** )xmalloc((sizeof(OnigMatchParam*) + sizeof(OnigMatchParam)) * set->n);
CHECK_NULL_RETURN_MEMERR(mps);
mp = (OnigMatchParam* )(mps + set->n);
for (i = 0; i < set->n; i++) {
onig_initialize_match_param(mp + i);
mps[i] = mp + i;
}
r = onig_regset_search_with_param(set, str, end, start, range, lead, option, mps,
rmatch_pos);
for (i = 0; i < set->n; i++)
onig_free_match_param_content(mp + i);
xfree(mps);
return r;
}
| 0
|
342,999
|
static int acpi_pcihp_get_bsel(PCIBus *bus)
{
QObject *o = object_property_get_qobject(OBJECT(bus),
ACPI_PCIHP_PROP_BSEL, NULL);
int64_t bsel = -1;
if (o) {
bsel = qint_get_int(qobject_to_qint(o));
}
if (bsel < 0) {
return -1;
}
return bsel;
}
| 1
|
163,182
|
static void treatNullAsNullStringStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
v8SetReturnValueString(info, imp->treatNullAsNullStringStringAttribute(), info.GetIsolate());
}
| 0
|
144,908
|
count_more_files_callback (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
DirectoryCountState *state;
NautilusDirectory *directory;
GError *error;
GList *files;
state = user_data;
directory = state->directory;
if (g_cancellable_is_cancelled (state->cancellable))
{
/* Operation was cancelled. Bail out */
async_job_end (directory, "directory count");
nautilus_directory_async_state_changed (directory);
directory_count_state_free (state);
return;
}
g_assert (directory->details->count_in_progress != NULL);
g_assert (directory->details->count_in_progress == state);
error = NULL;
files = g_file_enumerator_next_files_finish (state->enumerator,
res, &error);
state->file_count += count_non_skipped_files (files);
if (files == NULL)
{
count_children_done (directory, state->count_file,
TRUE, state->file_count);
directory_count_state_free (state);
}
else
{
g_file_enumerator_next_files_async (state->enumerator,
DIRECTORY_LOAD_ITEMS_PER_CALLBACK,
G_PRIORITY_DEFAULT,
state->cancellable,
count_more_files_callback,
state);
}
g_list_free_full (files, g_object_unref);
if (error)
{
g_error_free (error);
}
}
| 0
|
378,118
|
int apparmor_bprm_secureexec(struct linux_binprm *bprm)
{
int ret = cap_bprm_secureexec(bprm);
/* the decision to use secure exec is computed in set_creds
* and stored in bprm->unsafe.
*/
if (!ret && (bprm->unsafe & AA_SECURE_X_NEEDED))
ret = 1;
return ret;
}
| 0
|
182,562
|
static void nfs_set_fh(struct inode *inode, struct nfs_fh *fh)
{
struct nfs_inode *ninode = nfsi(inode);
ninode->fh = *fh;
}
| 0
|
499,343
|
TEST_F(RouterTest, UpstreamPerTryTimeout) {
NiceMock<Http::MockRequestEncoder> encoder;
Http::ResponseDecoder* response_decoder = nullptr;
EXPECT_CALL(cm_.thread_local_cluster_.conn_pool_, newStream(_, _))
.WillOnce(Invoke(
[&](Http::ResponseDecoder& decoder,
Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* {
response_decoder = &decoder;
callbacks.onPoolReady(encoder, cm_.thread_local_cluster_.conn_pool_.host_,
upstream_stream_info_, Http::Protocol::Http10);
return nullptr;
}));
EXPECT_CALL(callbacks_.stream_info_, onUpstreamHostSelected(_))
.WillOnce(Invoke([&](const Upstream::HostDescriptionConstSharedPtr host) -> void {
EXPECT_EQ(host_address_, host->address());
}));
Http::TestRequestHeaderMapImpl headers{{"x-envoy-internal", "true"},
{"x-envoy-upstream-rq-per-try-timeout-ms", "5"}};
HttpTestUtility::addDefaultHeaders(headers);
router_.decodeHeaders(headers, false);
// We verify that both timeouts are started after decodeData(_, true) is called. This
// verifies that we are not starting the initial per try timeout on the first onPoolReady.
expectPerTryTimerCreate();
expectResponseTimerCreate();
Buffer::OwnedImpl data;
router_.decodeData(data, true);
EXPECT_EQ(1U,
callbacks_.route_->route_entry_.virtual_cluster_.stats().upstream_rq_total_.value());
EXPECT_CALL(callbacks_.stream_info_,
setResponseFlag(StreamInfo::ResponseFlag::UpstreamRequestTimeout));
EXPECT_CALL(encoder.stream_, resetStream(Http::StreamResetReason::LocalReset));
Http::TestResponseHeaderMapImpl response_headers{
{":status", "504"}, {"content-length", "24"}, {"content-type", "text/plain"}};
EXPECT_CALL(callbacks_, encodeHeaders_(HeaderMapEqualRef(&response_headers), false));
EXPECT_CALL(callbacks_, encodeData(_, true));
EXPECT_CALL(
cm_.thread_local_cluster_.conn_pool_.host_->outlier_detector_,
putResult(Upstream::Outlier::Result::LocalOriginTimeout, absl::optional<uint64_t>(504)));
per_try_timeout_->invokeCallback();
EXPECT_EQ(1U, cm_.thread_local_cluster_.cluster_.info_->stats_store_
.counter("upstream_rq_per_try_timeout")
.value());
EXPECT_EQ(1UL, cm_.thread_local_cluster_.conn_pool_.host_->stats().rq_timeout_.value());
EXPECT_TRUE(verifyHostUpstreamStats(0, 1));
}
| 0
|
509,588
|
static void test_fetch_column()
{
MYSQL_STMT *stmt;
MYSQL_BIND my_bind[2];
char c2[20], bc2[20];
ulong l1, l2, bl1, bl2;
int rc, c1, bc1;
myheader("test_fetch_column");
rc= mysql_query(mysql, "drop table if exists t1");
myquery(rc);
rc= mysql_query(mysql, "create table t1(c1 int primary key auto_increment, c2 char(10))");
myquery(rc);
rc= mysql_query(mysql, "insert into t1(c2) values('venu'), ('mysql')");
myquery(rc);
stmt= mysql_simple_prepare(mysql, "select * from t1 order by c2 desc");
check_stmt(stmt);
bzero((char*) my_bind, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *)&bc1;
my_bind[0].buffer_length= 0;
my_bind[0].is_null= 0;
my_bind[0].length= &bl1;
my_bind[1].buffer_type= MYSQL_TYPE_STRING;
my_bind[1].buffer= (void *)bc2;
my_bind[1].buffer_length= 7;
my_bind[1].is_null= 0;
my_bind[1].length= &bl2;
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
rc= mysql_stmt_bind_result(stmt, my_bind);
check_execute(stmt, rc);
rc= mysql_stmt_store_result(stmt);
check_execute(stmt, rc);
rc= mysql_stmt_fetch_column(stmt, my_bind, 1, 0); /* No-op at this point */
check_execute_r(stmt, rc);
rc= mysql_stmt_fetch(stmt);
check_execute(stmt, rc);
if (!opt_silent)
fprintf(stdout, "\n row 0: %d, %s", bc1, bc2);
c2[0]= '\0'; l2= 0;
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= (void *)c2;
my_bind[0].buffer_length= 7;
my_bind[0].is_null= 0;
my_bind[0].length= &l2;
rc= mysql_stmt_fetch_column(stmt, my_bind, 1, 0);
check_execute(stmt, rc);
if (!opt_silent)
fprintf(stdout, "\n col 1: %s(%ld)", c2, l2);
DIE_UNLESS(strncmp(c2, "venu", 4) == 0 && l2 == 4);
c2[0]= '\0'; l2= 0;
rc= mysql_stmt_fetch_column(stmt, my_bind, 1, 0);
check_execute(stmt, rc);
if (!opt_silent)
fprintf(stdout, "\n col 1: %s(%ld)", c2, l2);
DIE_UNLESS(strcmp(c2, "venu") == 0 && l2 == 4);
c1= 0;
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *)&c1;
my_bind[0].buffer_length= 0;
my_bind[0].is_null= 0;
my_bind[0].length= &l1;
rc= mysql_stmt_fetch_column(stmt, my_bind, 0, 0);
check_execute(stmt, rc);
if (!opt_silent)
fprintf(stdout, "\n col 0: %d(%ld)", c1, l1);
DIE_UNLESS(c1 == 1 && l1 == 4);
rc= mysql_stmt_fetch(stmt);
check_execute(stmt, rc);
if (!opt_silent)
fprintf(stdout, "\n row 1: %d, %s", bc1, bc2);
c2[0]= '\0'; l2= 0;
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= (void *)c2;
my_bind[0].buffer_length= 7;
my_bind[0].is_null= 0;
my_bind[0].length= &l2;
rc= mysql_stmt_fetch_column(stmt, my_bind, 1, 0);
check_execute(stmt, rc);
if (!opt_silent)
fprintf(stdout, "\n col 1: %s(%ld)", c2, l2);
DIE_UNLESS(strncmp(c2, "mysq", 4) == 0 && l2 == 5);
c2[0]= '\0'; l2= 0;
rc= mysql_stmt_fetch_column(stmt, my_bind, 1, 0);
check_execute(stmt, rc);
if (!opt_silent)
fprintf(stdout, "\n col 1: %si(%ld)", c2, l2);
DIE_UNLESS(strcmp(c2, "mysql") == 0 && l2 == 5);
c1= 0;
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *)&c1;
my_bind[0].buffer_length= 0;
my_bind[0].is_null= 0;
my_bind[0].length= &l1;
rc= mysql_stmt_fetch_column(stmt, my_bind, 0, 0);
check_execute(stmt, rc);
if (!opt_silent)
fprintf(stdout, "\n col 0: %d(%ld)", c1, l1);
DIE_UNLESS(c1 == 2 && l1 == 4);
rc= mysql_stmt_fetch(stmt);
DIE_UNLESS(rc == MYSQL_NO_DATA);
rc= mysql_stmt_fetch_column(stmt, my_bind, 1, 0);
check_execute_r(stmt, rc);
mysql_stmt_close(stmt);
myquery(mysql_query(mysql, "drop table t1"));
}
| 0
|
510,263
|
my_decimal *Item_null::val_decimal(my_decimal *decimal_value)
{
return 0;
}
| 0
|
257,214
|
TSReturnCode sdk_sanity_check_mime_hdr_handle ( TSMLoc field ) {
if ( field == TS_NULL_MLOC ) {
return TS_ERROR ;
}
MIMEFieldSDKHandle * field_handle = ( MIMEFieldSDKHandle * ) field ;
if ( field_handle -> m_type != HDR_HEAP_OBJ_MIME_HEADER ) {
return TS_ERROR ;
}
return TS_SUCCESS ;
}
| 0
|
327,400
|
static void create_gic(VirtBoardInfo *vbi, qemu_irq *pic, int type, bool secure)
{
/* We create a standalone GIC */
DeviceState *gicdev;
SysBusDevice *gicbusdev;
const char *gictype;
int i;
gictype = (type == 3) ? gicv3_class_name() : gic_class_name();
gicdev = qdev_create(NULL, gictype);
qdev_prop_set_uint32(gicdev, "revision", type);
qdev_prop_set_uint32(gicdev, "num-cpu", smp_cpus);
/* Note that the num-irq property counts both internal and external
* interrupts; there are always 32 of the former (mandated by GIC spec).
*/
qdev_prop_set_uint32(gicdev, "num-irq", NUM_IRQS + 32);
if (!kvm_irqchip_in_kernel()) {
qdev_prop_set_bit(gicdev, "has-security-extensions", secure);
}
qdev_init_nofail(gicdev);
gicbusdev = SYS_BUS_DEVICE(gicdev);
sysbus_mmio_map(gicbusdev, 0, vbi->memmap[VIRT_GIC_DIST].base);
if (type == 3) {
sysbus_mmio_map(gicbusdev, 1, vbi->memmap[VIRT_GIC_REDIST].base);
} else {
sysbus_mmio_map(gicbusdev, 1, vbi->memmap[VIRT_GIC_CPU].base);
}
/* Wire the outputs from each CPU's generic timer to the
* appropriate GIC PPI inputs, and the GIC's IRQ output to
* the CPU's IRQ input.
*/
for (i = 0; i < smp_cpus; i++) {
DeviceState *cpudev = DEVICE(qemu_get_cpu(i));
int ppibase = NUM_IRQS + i * GIC_INTERNAL + GIC_NR_SGIS;
int irq;
/* Mapping from the output timer irq lines from the CPU to the
* GIC PPI inputs we use for the virt board.
*/
const int timer_irq[] = {
[GTIMER_PHYS] = ARCH_TIMER_NS_EL1_IRQ,
[GTIMER_VIRT] = ARCH_TIMER_VIRT_IRQ,
[GTIMER_HYP] = ARCH_TIMER_NS_EL2_IRQ,
[GTIMER_SEC] = ARCH_TIMER_S_EL1_IRQ,
};
for (irq = 0; irq < ARRAY_SIZE(timer_irq); irq++) {
qdev_connect_gpio_out(cpudev, irq,
qdev_get_gpio_in(gicdev,
ppibase + timer_irq[irq]));
}
sysbus_connect_irq(gicbusdev, i, qdev_get_gpio_in(cpudev, ARM_CPU_IRQ));
sysbus_connect_irq(gicbusdev, i + smp_cpus,
qdev_get_gpio_in(cpudev, ARM_CPU_FIQ));
}
for (i = 0; i < NUM_IRQS; i++) {
pic[i] = qdev_get_gpio_in(gicdev, i);
}
fdt_add_gic_node(vbi, type);
if (type == 3) {
create_its(vbi, gicdev);
} else {
create_v2m(vbi, pic);
}
}
| 0
|
504,694
|
kssl_krb5_kt_default(krb5_context con,
krb5_keytab * kt)
{
if (!krb5_loaded)
load_krb5_dll();
if ( p_krb5_kt_default )
return(p_krb5_kt_default(con,kt));
else
return KRB5KRB_ERR_GENERIC;
}
| 0
|
441,988
|
static void create_power_zone_common_attributes(
struct powercap_zone *power_zone)
{
int count = 0;
power_zone->zone_dev_attrs[count++] = &dev_attr_name.attr;
if (power_zone->ops->get_max_energy_range_uj)
power_zone->zone_dev_attrs[count++] =
&dev_attr_max_energy_range_uj.attr;
if (power_zone->ops->get_energy_uj) {
if (power_zone->ops->reset_energy_uj)
dev_attr_energy_uj.attr.mode = S_IWUSR | S_IRUSR;
else
dev_attr_energy_uj.attr.mode = S_IRUSR;
power_zone->zone_dev_attrs[count++] =
&dev_attr_energy_uj.attr;
}
if (power_zone->ops->get_power_uw)
power_zone->zone_dev_attrs[count++] =
&dev_attr_power_uw.attr;
if (power_zone->ops->get_max_power_range_uw)
power_zone->zone_dev_attrs[count++] =
&dev_attr_max_power_range_uw.attr;
power_zone->zone_dev_attrs[count] = NULL;
power_zone->zone_attr_count = count;
}
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.