idx
int64
func
string
target
int64
406,006
ofputil_queue_stats_from_ofp11(struct ofputil_queue_stats *oqs, const struct ofp11_queue_stats *qs11) { enum ofperr error; error = ofputil_port_from_ofp11(qs11->port_no, &oqs->port_no); if (error) { return error; } oqs->queue_id = ntohl(qs11->queue_id); oqs->tx_bytes = ntohll(qs11->tx_bytes); oqs->tx_packets = ntohll(qs11->tx_packets); oqs->tx_errors = ntohll(qs11->tx_errors); oqs->duration_sec = oqs->duration_nsec = UINT32_MAX; return 0; }
0
378,351
int sys_pclose(int fd) { int wstatus; popen_list **ptr = &popen_chain; popen_list *entry = NULL; pid_t wait_pid; int status = -1; /* Unlink from popen_chain. */ for ( ; *ptr != NULL; ptr = &(*ptr)->next) { if ((*ptr)->fd == fd) { entry = *ptr; *ptr = (*ptr)->next; status = 0; break; } } if (status < 0 || close(entry->fd) < 0) return -1; /* * As Samba is catching and eating child process * exits we don't really care about the child exit * code, a -1 with errno = ECHILD will do fine for us. */ do { wait_pid = sys_waitpid (entry->child_pid, &wstatus, 0); } while (wait_pid == -1 && errno == EINTR); SAFE_FREE(entry); if (wait_pid == -1) return -1; return wstatus; }
0
426,915
ModuleExport void UnregisterTIFFImage(void) { (void) UnregisterMagickInfo("TIFF64"); (void) UnregisterMagickInfo("TIFF"); (void) UnregisterMagickInfo("TIF"); (void) UnregisterMagickInfo("PTIF"); if (tiff_semaphore == (SemaphoreInfo *) NULL) ActivateSemaphoreInfo(&tiff_semaphore); LockSemaphoreInfo(tiff_semaphore); if (instantiate_key != MagickFalse) { if (DeleteMagickThreadKey(tiff_exception) == MagickFalse) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); #if defined(MAGICKCORE_HAVE_TIFFMERGEFIELDINFO) && defined(MAGICKCORE_HAVE_TIFFSETTAGEXTENDER) if (tag_extender == (TIFFExtendProc) NULL) (void) TIFFSetTagExtender(tag_extender); #endif (void) TIFFSetWarningHandler(warning_handler); (void) TIFFSetErrorHandler(error_handler); instantiate_key=MagickFalse; } UnlockSemaphoreInfo(tiff_semaphore); DestroySemaphoreInfo(&tiff_semaphore); }
0
31,608
QPDF::replaceReserved(QPDFObjectHandle reserved, QPDFObjectHandle replacement) { QTC::TC("qpdf", "QPDF replaceReserved"); reserved.assertReserved(); replaceObject(reserved.getObjGen(), replacement); }
0
202,547
bool FrameworkListener::onDataAvailable(SocketClient *c) { char buffer[CMD_BUF_SIZE]; int len; len = TEMP_FAILURE_RETRY(read(c->getSocket(), buffer, sizeof(buffer))); if (len < 0) { SLOGE("read() failed (%s)", strerror(errno)); return false; } else if (!len) { return false; } else if (buffer[len-1] != '\0') { SLOGW("String is not zero-terminated"); android_errorWriteLog(0x534e4554, "29831647"); c->sendMsg(500, "Command too large for buffer", false); mSkipToNextNullByte = true; return false; } int offset = 0; int i; for (i = 0; i < len; i++) { if (buffer[i] == '\0') { /* IMPORTANT: dispatchCommand() expects a zero-terminated string */ if (mSkipToNextNullByte) { mSkipToNextNullByte = false; } else { dispatchCommand(c, buffer + offset); } offset = i + 1; } } mSkipToNextNullByte = false; return true; }
0
21,179
static int dissect_h245_ME_finiteRepeatCount ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { # line 116 "../../asn1/h245/h245.cnf" guint32 value ; offset = dissect_per_constrained_integer ( tvb , offset , actx , tree , hf_index , 1U , 65535U , & value , FALSE ) ; h223_me -> repeat_count = value & 0xffff ; return offset ; }
0
335,805
static void quantize_and_encode_band_cost_ZERO_mips(struct AACEncContext *s, PutBitContext *pb, const float *in, float *out, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, int *bits, const float ROUNDING) { int i; if (bits) *bits = 0; if (out) { for (i = 0; i < size; i += 4) { out[i ] = 0.0f; out[i+1] = 0.0f; out[i+2] = 0.0f; out[i+3] = 0.0f; } } }
1
318,887
static void rtl8139_write_buffer(RTL8139State *s, const void *buf, int size) { if (s->RxBufAddr + size > s->RxBufferSize) { int wrapped = MOD2(s->RxBufAddr + size, s->RxBufferSize); /* write packet data */ if (wrapped && s->RxBufferSize < 65536 && !rtl8139_RxWrap(s)) { DEBUG_PRINT((">>> RTL8139: rx packet wrapped in buffer at %d\n", size-wrapped)); if (size > wrapped) { cpu_physical_memory_write( s->RxBuf + s->RxBufAddr, buf, size-wrapped ); } /* reset buffer pointer */ s->RxBufAddr = 0; cpu_physical_memory_write( s->RxBuf + s->RxBufAddr, buf + (size-wrapped), wrapped ); s->RxBufAddr = wrapped; return; } } /* non-wrapping path or overwrapping enabled */ cpu_physical_memory_write( s->RxBuf + s->RxBufAddr, buf, size ); s->RxBufAddr += size; }
0
216,339
void DisplayItemList::appendToWebDisplayItemList(WebDisplayItemList* list) { for (const DisplayItem& item : m_currentDisplayItems) item.appendToWebDisplayItemList(list); }
0
347,762
static int init_dumping(char *database, int init_func(char*)) { if (mysql_select_db(mysql, database)) { DB_error(mysql, "when selecting the database"); return 1; /* If --force */ } if (!path && !opt_xml) { if (opt_databases || opt_alldbs) { /* length of table name * 2 (if name contains quotes), 2 quotes and 0 */ char quoted_database_buf[NAME_LEN*2+3]; char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted); print_comment(md_result_file, 0, "\n--\n-- Current Database: %s\n--\n", fix_identifier_with_newline(qdatabase)); /* Call the view or table specific function */ init_func(qdatabase); fprintf(md_result_file,"\nUSE %s;\n", qdatabase); check_io(md_result_file); } } if (extended_insert) init_dynamic_string_checked(&extended_row, "", 1024, 1024); return 0; } /* init_dumping */
1
280,060
OffscreenCanvasSurfaceImpl::~OffscreenCanvasSurfaceImpl() {
0
117,062
mailimf_sender_parse(const char * message, size_t length, size_t * indx, struct mailimf_sender ** result) { struct mailimf_mailbox * mb; struct mailimf_sender * sender; size_t cur_token; int r; int res; cur_token = * indx; r = mailimf_token_case_insensitive_parse(message, length, &cur_token, "Sender"); if (r != MAILIMF_NO_ERROR) { res = r; goto err; } r = mailimf_colon_parse(message, length, &cur_token); if (r != MAILIMF_NO_ERROR) { res = r; goto err; } r = mailimf_mailbox_parse(message, length, &cur_token, &mb); if (r != MAILIMF_NO_ERROR) { res = r; goto err; } r = mailimf_unstrict_crlf_parse(message, length, &cur_token); if (r != MAILIMF_NO_ERROR) { res = r; goto free_mb; } sender = mailimf_sender_new(mb); if (sender == NULL) { res = MAILIMF_ERROR_MEMORY; goto free_mb; } * result = sender; * indx = cur_token; return MAILIMF_NO_ERROR; free_mb: mailimf_mailbox_free(mb); err: return res; }
0
44,010
static void __account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec) { /* dock delta_exec before expiring quota (as it could span periods) */ cfs_rq->runtime_remaining -= delta_exec; expire_cfs_rq_runtime(cfs_rq); if (likely(cfs_rq->runtime_remaining > 0)) return; /* * if we're unable to extend our runtime we resched so that the active * hierarchy can be throttled */ if (!assign_cfs_rq_runtime(cfs_rq) && likely(cfs_rq->curr)) resched_curr(rq_of(cfs_rq)); }
0
72,562
static void launch(OpKernelContext* context, const Tensor& tensor_in, const std::array<int64, 3>& window, const std::array<int64, 3>& stride, const std::array<int64, 3>& padding, TensorFormat data_format, Padding padding_type, Tensor* output) { DnnPooling3dOp<T>::Compute(context, se::dnn::PoolingMode::kMaximum, window, stride, padding, data_format, tensor_in, output); }
0
162,256
DEFINE_TEST(test_read_format_rar5_multiarchive_solid_skip_all_but_first) { const char* reffiles[] = { "test_read_format_rar5_multiarchive_solid.part01.rar", "test_read_format_rar5_multiarchive_solid.part02.rar", "test_read_format_rar5_multiarchive_solid.part03.rar", "test_read_format_rar5_multiarchive_solid.part04.rar", NULL }; PROLOGUE_MULTI(reffiles); assertA(0 == archive_read_next_header(a, &ae)); assertEqualString("cebula.txt", archive_entry_pathname(ae)); assertA(0 == extract_one(a, ae, 0x7E5EC49E)); assertA(0 == archive_read_next_header(a, &ae)); assertEqualString("test.bin", archive_entry_pathname(ae)); assertA(0 == archive_read_next_header(a, &ae)); assertEqualString("test1.bin", archive_entry_pathname(ae)); assertA(0 == archive_read_next_header(a, &ae)); assertEqualString("test2.bin", archive_entry_pathname(ae)); assertA(0 == archive_read_next_header(a, &ae)); assertEqualString("test3.bin", archive_entry_pathname(ae)); assertA(0 == archive_read_next_header(a, &ae)); assertEqualString("test4.bin", archive_entry_pathname(ae)); assertA(0 == archive_read_next_header(a, &ae)); assertEqualString("test5.bin", archive_entry_pathname(ae)); assertA(0 == archive_read_next_header(a, &ae)); assertEqualString("test6.bin", archive_entry_pathname(ae)); assertA(0 == archive_read_next_header(a, &ae)); assertEqualString("elf-Linux-ARMv7-ls", archive_entry_pathname(ae)); assertA(ARCHIVE_EOF == archive_read_next_header(a, &ae)); EPILOGUE(); }
0
512,032
sv_mail (name) char *name; { /* If the time interval for checking the files has changed, then reset the mail timer. Otherwise, one of the pathname vars to the users mailbox has changed, so rebuild the array of filenames. */ if (name[4] == 'C') /* if (strcmp (name, "MAILCHECK") == 0) */ reset_mail_timer (); else { free_mail_files (); remember_mail_dates (); } }
0
389,353
int set_zval_xmlrpc_type(zval* value, XMLRPC_VALUE_TYPE newtype) /* {{{ */ { int bSuccess = FAILURE; /* we only really care about strings because they can represent * base64 and datetime. all other types have corresponding php types */ if (Z_TYPE_P(value) == IS_STRING) { if (newtype == xmlrpc_base64 || newtype == xmlrpc_datetime) { const char* typestr = xmlrpc_type_as_str(newtype, xmlrpc_vector_none); zval type; ZVAL_STRING(&type, typestr); if (newtype == xmlrpc_datetime) { XMLRPC_VALUE v = XMLRPC_CreateValueDateTime_ISO8601(NULL, Z_STRVAL_P(value)); if (v) { time_t timestamp = (time_t) php_parse_date((char *)XMLRPC_GetValueDateTime_ISO8601(v), NULL); if (timestamp != -1) { zval ztimestamp; ZVAL_LONG(&ztimestamp, timestamp); convert_to_object(value); if (zend_hash_str_update(Z_OBJPROP_P(value), OBJECT_TYPE_ATTR, sizeof(OBJECT_TYPE_ATTR) - 1, &type)) { bSuccess = (zend_hash_str_update(Z_OBJPROP_P(value), OBJECT_VALUE_TS_ATTR, sizeof(OBJECT_VALUE_TS_ATTR) - 1, &ztimestamp) != NULL)? SUCCESS : FAILURE; } } else { zval_ptr_dtor(&type); } XMLRPC_CleanupValue(v); } else { zval_ptr_dtor(&type); } } else { convert_to_object(value); bSuccess = (zend_hash_str_update(Z_OBJPROP_P(value), OBJECT_TYPE_ATTR, sizeof(OBJECT_TYPE_ATTR) - 1, &type) != NULL)? SUCCESS : FAILURE; } } } return bSuccess; }
0
179,148
aspath_finish (void) { hash_clean (ashash, (void (*)(void *))aspath_free); hash_free (ashash); ashash = NULL; if (snmp_stream) stream_free (snmp_stream); }
0
40,902
void blk_mq_tag_busy_iter(struct blk_mq_hw_ctx *hctx, busy_iter_fn *fn, void *priv) { struct blk_mq_tags *tags = hctx->tags; if (tags->nr_reserved_tags) bt_for_each(hctx, &tags->breserved_tags, 0, fn, priv, true); bt_for_each(hctx, &tags->bitmap_tags, tags->nr_reserved_tags, fn, priv, false); }
0
476,018
time_t base64totime_t(char* s, database* db, const char* field_name){ if(strcmp(s,"0")==0){ return 0; } byte* b=decode_base64(s,strlen(s),NULL); char* endp; if (b==NULL) { /* Should we print error here? */ return 0; } else { time_t t = strtol((char *)b,&endp,10); if (endp[0]!='\0') { LOG_DB_FORMAT_LINE(LOG_LEVEL_WARNING, could not read '%s' from database: strtoll failed for '%s' (base64 encoded value: '%s'), field_name, b, s) free(b); return 0; } log_msg(LOG_LEVEL_DEBUG, "base64totime_t: converted '%s': '%s' to %lld (base64 encoded value '%s')", field_name, b, (long long) t, s); free(b); return t; } }
0
26,865
static int dsa_copy_parameters ( EVP_PKEY * to , const EVP_PKEY * from ) { BIGNUM * a ; if ( to -> pkey . dsa == NULL ) { to -> pkey . dsa = DSA_new ( ) ; if ( to -> pkey . dsa == NULL ) return 0 ; } if ( ( a = BN_dup ( from -> pkey . dsa -> p ) ) == NULL ) return 0 ; BN_free ( to -> pkey . dsa -> p ) ; to -> pkey . dsa -> p = a ; if ( ( a = BN_dup ( from -> pkey . dsa -> q ) ) == NULL ) return 0 ; BN_free ( to -> pkey . dsa -> q ) ; to -> pkey . dsa -> q = a ; if ( ( a = BN_dup ( from -> pkey . dsa -> g ) ) == NULL ) return 0 ; BN_free ( to -> pkey . dsa -> g ) ; to -> pkey . dsa -> g = a ; return 1 ; }
0
252,094
oftable_set_name(struct oftable *table, const char *name) { if (name && name[0]) { int len = strnlen(name, OFP_MAX_TABLE_NAME_LEN); if (!table->name || strncmp(name, table->name, len)) { free(table->name); table->name = xmemdup0(name, len); } } else { free(table->name); table->name = NULL; } }
0
262,813
static void nalu_merge_ps(GF_BitStream *ps_bs, Bool rewrite_start_codes, u32 nal_unit_size_field, GF_MPEGVisualSampleEntryBox *entry, Bool is_hevc) { u32 i, count; if (is_hevc) { if (entry->hevc_config) { count = gf_list_count(entry->hevc_config->config->param_array); for (i=0; i<count; i++) { GF_HEVCParamArray *ar = (GF_HEVCParamArray*)gf_list_get(entry->hevc_config->config->param_array, i); rewrite_nalus_list(ar->nalus, ps_bs, rewrite_start_codes, nal_unit_size_field); } } if (entry->lhvc_config) { count = gf_list_count(entry->lhvc_config->config->param_array); for (i=0; i<count; i++) { GF_HEVCParamArray *ar = (GF_HEVCParamArray*)gf_list_get(entry->lhvc_config->config->param_array, i); rewrite_nalus_list(ar->nalus, ps_bs, rewrite_start_codes, nal_unit_size_field); } } } else { if (entry->avc_config) { rewrite_nalus_list(entry->avc_config->config->sequenceParameterSets, ps_bs, rewrite_start_codes, nal_unit_size_field); rewrite_nalus_list(entry->avc_config->config->sequenceParameterSetExtensions, ps_bs, rewrite_start_codes, nal_unit_size_field); rewrite_nalus_list(entry->avc_config->config->pictureParameterSets, ps_bs, rewrite_start_codes, nal_unit_size_field); } /*add svc config */ if (entry->svc_config) { rewrite_nalus_list(entry->svc_config->config->sequenceParameterSets, ps_bs, rewrite_start_codes, nal_unit_size_field); rewrite_nalus_list(entry->svc_config->config->pictureParameterSets, ps_bs, rewrite_start_codes, nal_unit_size_field); } /*add mvc config */ if (entry->mvc_config) { rewrite_nalus_list(entry->mvc_config->config->sequenceParameterSets, ps_bs, rewrite_start_codes, nal_unit_size_field); rewrite_nalus_list(entry->mvc_config->config->pictureParameterSets, ps_bs, rewrite_start_codes, nal_unit_size_field); } } }
0
472,117
static void stbi__vertical_flip_slices(void *image, int w, int h, int z, int bytes_per_pixel) { int slice; int slice_size = w * h * bytes_per_pixel; stbi_uc *bytes = (stbi_uc *)image; for (slice = 0; slice < z; ++slice) { stbi__vertical_flip(bytes, w, h, bytes_per_pixel); bytes += slice_size; } }
0
241,033
PHP_FUNCTION(pg_lo_unlink) { zval *pgsql_link = NULL; long oid_long; char *oid_string, *end_ptr; int oid_strlen; PGconn *pgsql; Oid oid; int id = -1; int argc = ZEND_NUM_ARGS(); /* accept string type since Oid type is unsigned int */ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "rs", &pgsql_link, &oid_string, &oid_strlen) == SUCCESS) { oid = (Oid)strtoul(oid_string, &end_ptr, 10); if ((oid_string+oid_strlen) != end_ptr) { /* wrong integer format */ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); RETURN_FALSE; } } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "rl", &pgsql_link, &oid_long) == SUCCESS) { if (oid_long <= InvalidOid) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified"); RETURN_FALSE; } oid = (Oid)oid_long; } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "s", &oid_string, &oid_strlen) == SUCCESS) { oid = (Oid)strtoul(oid_string, &end_ptr, 10); if ((oid_string+oid_strlen) != end_ptr) { /* wrong integer format */ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); RETURN_FALSE; } id = PGG(default_link); CHECK_DEFAULT_LINK(id); } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "l", &oid_long) == SUCCESS) { if (oid_long <= InvalidOid) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID is specified"); RETURN_FALSE; } oid = (Oid)oid_long; id = PGG(default_link); CHECK_DEFAULT_LINK(id); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 1 or 2 arguments"); RETURN_FALSE; } if (pgsql_link == NULL && id == -1) { RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); if (lo_unlink(pgsql, oid) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to delete PostgreSQL large object %u", oid); RETURN_FALSE; } RETURN_TRUE; }
0
299,469
static int compat_mtw_from_user(struct compat_ebt_entry_mwt *mwt, enum compat_mwt compat_mwt, struct ebt_entries_buf_state *state, const unsigned char *base) { char name[EBT_FUNCTION_MAXNAMELEN]; struct xt_match *match; struct xt_target *wt; void *dst = NULL; int off, pad = 0; unsigned int size_kern, match_size = mwt->match_size; strlcpy(name, mwt->u.name, sizeof(name)); if (state->buf_kern_start) dst = state->buf_kern_start + state->buf_kern_offset; switch (compat_mwt) { case EBT_COMPAT_MATCH: match = xt_request_find_match(NFPROTO_BRIDGE, name, 0); if (IS_ERR(match)) return PTR_ERR(match); off = ebt_compat_match_offset(match, match_size); if (dst) { if (match->compat_from_user) match->compat_from_user(dst, mwt->data); else memcpy(dst, mwt->data, match_size); } size_kern = match->matchsize; if (unlikely(size_kern == -1)) size_kern = match_size; module_put(match->me); break; case EBT_COMPAT_WATCHER: /* fallthrough */ case EBT_COMPAT_TARGET: wt = xt_request_find_target(NFPROTO_BRIDGE, name, 0); if (IS_ERR(wt)) return PTR_ERR(wt); off = xt_compat_target_offset(wt); if (dst) { if (wt->compat_from_user) wt->compat_from_user(dst, mwt->data); else memcpy(dst, mwt->data, match_size); } size_kern = wt->targetsize; module_put(wt->me); break; default: return -EINVAL; } state->buf_kern_offset += match_size + off; state->buf_user_offset += match_size; pad = XT_ALIGN(size_kern) - size_kern; if (pad > 0 && dst) { if (WARN_ON(state->buf_kern_len <= pad)) return -EINVAL; if (WARN_ON(state->buf_kern_offset - (match_size + off) + size_kern > state->buf_kern_len - pad)) return -EINVAL; memset(dst + size_kern, 0, pad); } return off + match_size; }
0
295,858
bool HHVM_FUNCTION(imageantialias, const Resource& image, bool on) { gdImagePtr im = get_valid_image_resource(image); if (!im) return false; SetAntiAliased(im, on); return true; }
0
110,448
static void AttachPSDLayers(Image *image,LayerInfo *layer_info, ssize_t number_layers) { register ssize_t i; ssize_t j; for (i=0; i < number_layers; i++) { if (layer_info[i].image == (Image *) NULL) { for (j=i; j < number_layers - 1; j++) layer_info[j] = layer_info[j+1]; number_layers--; i--; } } if (number_layers == 0) { layer_info=(LayerInfo *) RelinquishMagickMemory(layer_info); return; } for (i=0; i < number_layers; i++) { if (i > 0) layer_info[i].image->previous=layer_info[i-1].image; if (i < (number_layers-1)) layer_info[i].image->next=layer_info[i+1].image; layer_info[i].image->page=layer_info[i].page; } image->next=layer_info[0].image; layer_info[0].image->previous=image; layer_info=(LayerInfo *) RelinquishMagickMemory(layer_info); }
0
14,430
TabStyle::TabColors GM2TabStyle::CalculateColors() const { const ui::ThemeProvider* theme_provider = tab_->GetThemeProvider(); constexpr float kMinimumActiveContrastRatio = 6.05f; constexpr float kMinimumInactiveContrastRatio = 4.61f; constexpr float kMinimumHoveredContrastRatio = 5.02f; constexpr float kMinimumPressedContrastRatio = 4.41f; float expected_opacity = 0.0f; if (tab_->IsActive()) { expected_opacity = 1.0f; } else if (tab_->IsSelected()) { expected_opacity = kSelectedTabOpacity; } else if (tab_->mouse_hovered()) { expected_opacity = GetHoverOpacity(); } const SkColor bg_color = color_utils::AlphaBlend( tab_->controller()->GetTabBackgroundColor(TAB_ACTIVE), tab_->controller()->GetTabBackgroundColor(TAB_INACTIVE), expected_opacity); SkColor title_color = tab_->controller()->GetTabForegroundColor( expected_opacity > 0.5f ? TAB_ACTIVE : TAB_INACTIVE, bg_color); title_color = color_utils::GetColorWithMinimumContrast(title_color, bg_color); const SkColor base_hovered_color = theme_provider->GetColor( ThemeProperties::COLOR_TAB_CLOSE_BUTTON_BACKGROUND_HOVER); const SkColor base_pressed_color = theme_provider->GetColor( ThemeProperties::COLOR_TAB_CLOSE_BUTTON_BACKGROUND_PRESSED); const auto get_color_for_contrast_ratio = [](SkColor fg_color, SkColor bg_color, float contrast_ratio) { const SkAlpha blend_alpha = color_utils::GetBlendValueWithMinimumContrast( bg_color, fg_color, bg_color, contrast_ratio); return color_utils::AlphaBlend(fg_color, bg_color, blend_alpha); }; const SkColor generated_icon_color = get_color_for_contrast_ratio( title_color, bg_color, tab_->IsActive() ? kMinimumActiveContrastRatio : kMinimumInactiveContrastRatio); const SkColor generated_hovered_color = get_color_for_contrast_ratio( base_hovered_color, bg_color, kMinimumHoveredContrastRatio); const SkColor generated_pressed_color = get_color_for_contrast_ratio( base_pressed_color, bg_color, kMinimumPressedContrastRatio); const SkColor generated_hovered_icon_color = color_utils::GetColorWithMinimumContrast(title_color, generated_hovered_color); const SkColor generated_pressed_icon_color = color_utils::GetColorWithMinimumContrast(title_color, generated_pressed_color); return {bg_color, title_color, generated_icon_color, generated_hovered_icon_color, generated_pressed_icon_color, generated_hovered_color, generated_pressed_color}; }
1
178,447
int parse_qvalue(const char *qvalue, const char **end) { int q = 1000; if (!isdigit((unsigned char)*qvalue)) goto out; q = (*qvalue++ - '0') * 1000; if (*qvalue++ != '.') goto out; if (!isdigit((unsigned char)*qvalue)) goto out; q += (*qvalue++ - '0') * 100; if (!isdigit((unsigned char)*qvalue)) goto out; q += (*qvalue++ - '0') * 10; if (!isdigit((unsigned char)*qvalue)) goto out; q += (*qvalue++ - '0') * 1; out: if (q > 1000) q = 1000; if (end) *end = qvalue; return q; }
0
77,372
void ceph_release_acls_info(struct ceph_acls_info *info) { posix_acl_release(info->acl); posix_acl_release(info->default_acl); if (info->pagelist) ceph_pagelist_release(info->pagelist); }
0
443,674
static int selinux_is_genfs_special_handling(struct super_block *sb) { /* Special handling. Genfs but also in-core setxattr handler */ return !strcmp(sb->s_type->name, "sysfs") || !strcmp(sb->s_type->name, "pstore") || !strcmp(sb->s_type->name, "debugfs") || !strcmp(sb->s_type->name, "tracefs") || !strcmp(sb->s_type->name, "rootfs") || (selinux_policycap_cgroupseclabel() && (!strcmp(sb->s_type->name, "cgroup") || !strcmp(sb->s_type->name, "cgroup2"))); }
0
210,083
static u8 process_acl_entry(sc_file_t *in, unsigned int method, unsigned int in_def) { u8 def = (u8)in_def; const sc_acl_entry_t *entry = sc_file_get_acl_entry(in, method); if (!entry) { return def; } else if (entry->method & SC_AC_CHV) { unsigned int key_ref = entry->key_ref; if (key_ref == SC_AC_KEY_REF_NONE) return def; else return ENTERSAFE_AC_ALWAYS&0x04; } else if (entry->method & SC_AC_NEVER) { return ENTERSAFE_AC_NEVER; } else { return def; } }
0
122,539
ex_change(exarg_T *eap) { linenr_T lnum; #ifdef FEAT_EVAL if (not_in_vim9(eap) == FAIL) return; #endif if (eap->line2 >= eap->line1 && u_save(eap->line1 - 1, eap->line2 + 1) == FAIL) return; // the ! flag toggles autoindent if (eap->forceit ? !curbuf->b_p_ai : curbuf->b_p_ai) append_indent = get_indent_lnum(eap->line1); for (lnum = eap->line2; lnum >= eap->line1; --lnum) { if (curbuf->b_ml.ml_flags & ML_EMPTY) // nothing to delete break; ml_delete(eap->line1); } // make sure the cursor is not beyond the end of the file now check_cursor_lnum(); deleted_lines_mark(eap->line1, (long)(eap->line2 - lnum)); // ":append" on the line above the deleted lines. eap->line2 = eap->line1; ex_append(eap); }
0
141,814
psf_d2s_array (const double *src, short *dest, int count, int normalize) { double normfact ; normfact = normalize ? (1.0 * 0x7FFF) : 1.0 ; while (--count >= 0) dest [count] = lrint (src [count] * normfact) ; return ; } /* psf_f2s_array */
0
275,034
GBool StreamPredictor::getNextLine() { int curPred; Guchar upLeftBuf[gfxColorMaxComps * 2 + 1]; int left, up, upLeft, p, pa, pb, pc; int c; Gulong inBuf, outBuf, bitMask; int inBits, outBits; int i, j, k, kk; if (predictor >= 10) { if ((curPred = str->getRawChar()) == EOF) { return gFalse; } curPred += 10; } else { curPred = predictor; } int *rawCharLine = new int[rowBytes - pixBytes]; str->getRawChars(rowBytes - pixBytes, rawCharLine); memset(upLeftBuf, 0, pixBytes + 1); for (i = pixBytes; i < rowBytes; ++i) { for (j = pixBytes; j > 0; --j) { upLeftBuf[j] = upLeftBuf[j-1]; } upLeftBuf[0] = predLine[i]; if ((c = rawCharLine[i - pixBytes]) == EOF) { if (i > pixBytes) { break; } delete[] rawCharLine; return gFalse; } switch (curPred) { case 11: // PNG sub predLine[i] = predLine[i - pixBytes] + (Guchar)c; break; case 12: // PNG up predLine[i] = predLine[i] + (Guchar)c; break; case 13: // PNG average predLine[i] = ((predLine[i - pixBytes] + predLine[i]) >> 1) + (Guchar)c; break; case 14: // PNG Paeth left = predLine[i - pixBytes]; up = predLine[i]; upLeft = upLeftBuf[pixBytes]; p = left + up - upLeft; if ((pa = p - left) < 0) pa = -pa; if ((pb = p - up) < 0) pb = -pb; if ((pc = p - upLeft) < 0) pc = -pc; if (pa <= pb && pa <= pc) predLine[i] = left + (Guchar)c; else if (pb <= pc) predLine[i] = up + (Guchar)c; else predLine[i] = upLeft + (Guchar)c; break; case 10: // PNG none default: // no predictor or TIFF predictor predLine[i] = (Guchar)c; break; } } delete[] rawCharLine; if (predictor == 2) { if (nBits == 1) { inBuf = predLine[pixBytes - 1]; for (i = pixBytes; i < rowBytes; i += 8) { inBuf = (inBuf << 8) | predLine[i]; predLine[i] ^= inBuf >> nComps; } } else if (nBits == 8) { for (i = pixBytes; i < rowBytes; ++i) { predLine[i] += predLine[i - nComps]; } } else { memset(upLeftBuf, 0, nComps + 1); bitMask = (1 << nBits) - 1; inBuf = outBuf = 0; inBits = outBits = 0; j = k = pixBytes; for (i = 0; i < width; ++i) { for (kk = 0; kk < nComps; ++kk) { if (inBits < nBits) { inBuf = (inBuf << 8) | (predLine[j++] & 0xff); inBits += 8; } upLeftBuf[kk] = (Guchar)((upLeftBuf[kk] + (inBuf >> (inBits - nBits))) & bitMask); inBits -= nBits; outBuf = (outBuf << nBits) | upLeftBuf[kk]; outBits += nBits; if (outBits >= 8) { predLine[k++] = (Guchar)(outBuf >> (outBits - 8)); outBits -= 8; } } } if (outBits > 0) { predLine[k++] = (Guchar)((outBuf << (8 - outBits)) + (inBuf & ((1 << (8 - outBits)) - 1))); } } } predIdx = pixBytes; return gTrue; }
0
65,531
static inline void ext4_xattr_hash_entry(struct ext4_xattr_header *header, struct ext4_xattr_entry *entry) { __u32 hash = 0; char *name = entry->e_name; int n; for (n = 0; n < entry->e_name_len; n++) { hash = (hash << NAME_HASH_SHIFT) ^ (hash >> (8*sizeof(hash) - NAME_HASH_SHIFT)) ^ *name++; } if (entry->e_value_block == 0 && entry->e_value_size != 0) { __le32 *value = (__le32 *)((char *)header + le16_to_cpu(entry->e_value_offs)); for (n = (le32_to_cpu(entry->e_value_size) + EXT4_XATTR_ROUND) >> EXT4_XATTR_PAD_BITS; n; n--) { hash = (hash << VALUE_HASH_SHIFT) ^ (hash >> (8*sizeof(hash) - VALUE_HASH_SHIFT)) ^ le32_to_cpu(*value++); } } entry->e_hash = cpu_to_le32(hash); }
0
345,121
PHP_FUNCTION(readfile) { char *filename; int filename_len; int size = 0; zend_bool use_include_path = 0; zval *zcontext = NULL; php_stream *stream; php_stream_context *context = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) { RETURN_FALSE; } context = php_stream_context_from_zval(zcontext, 0); stream = php_stream_open_wrapper_ex(filename, "rb", (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context); if (stream) { size = php_stream_passthru(stream); php_stream_close(stream); RETURN_LONG(size); } RETURN_FALSE; }
1
36,368
flatpak_bwrap_steal_fds (FlatpakBwrap *bwrap, gsize *len_out) { gsize len = bwrap->fds->len; int *res = (int *) g_array_free (bwrap->fds, FALSE); bwrap->fds = g_array_new (FALSE, TRUE, sizeof (int)); *len_out = len; return res; }
0
452,579
CtPtr ProtocolV1::read_message_front() { ldout(cct, 20) << __func__ << dendl; unsigned front_len = current_header.front_len; if (front_len) { if (!front.length()) { front.push_back(buffer::create(front_len)); } return READB(front_len, front.c_str(), handle_message_front); } return read_message_middle(); }
0
258,714
template<typename T> inline T& temporary(const T&) { static T temp; return temp;
0
325,803
static void change_parent_backing_link(BlockDriverState *from, BlockDriverState *to) { BdrvChild *c, *next, *to_c; QLIST_FOREACH_SAFE(c, &from->parents, next_parent, next) { if (c->role->stay_at_node) { continue; } if (c->role == &child_backing) { /* @from is generally not allowed to be a backing file, except for * when @to is the overlay. In that case, @from may not be replaced * by @to as @to's backing node. */ QLIST_FOREACH(to_c, &to->children, next) { if (to_c == c) { break; } } if (to_c) { continue; } } assert(c->role != &child_backing); bdrv_ref(to); /* FIXME Are we sure that bdrv_replace_child() can't run into * &error_abort because of permissions? */ bdrv_replace_child(c, to, true); bdrv_unref(from); } }
0
221,179
void ContentSecurityPolicy::ReportMissingReportURI(const String& policy) { LogToConsole("The Content Security Policy '" + policy + "' was delivered in report-only mode, but does not specify a " "'report-uri'; the policy will have no effect. Please either " "add a 'report-uri' directive, or deliver the policy via the " "'Content-Security-Policy' header."); }
0
437,863
static void set_default_ppflags(vp8_postproc_cfg_t *cfg) { cfg->post_proc_flag = VP8_DEBLOCK | VP8_DEMACROBLOCK; cfg->deblocking_level = 4; cfg->noise_level = 0; }
0
245,502
void RenderFrameHostImpl::FrameSizeChanged(const gfx::Size& frame_size) { frame_size_ = frame_size; }
0
345,977
int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr, char *buf, int *len_ptr) { int len, iflags = 0; struct file_list *flist; uchar fnamecmp_type = FNAMECMP_FNAME; int ndx; read_loop: while (1) { ndx = read_ndx(f_in); if (ndx >= 0) break; if (ndx == NDX_DONE) return ndx; if (ndx == NDX_DEL_STATS) { read_del_stats(f_in); if (am_sender && am_server) write_del_stats(f_out); continue; } if (!inc_recurse || am_sender) { int last; if (first_flist) last = first_flist->prev->ndx_start + first_flist->prev->used - 1; else last = -1; rprintf(FERROR, "Invalid file index: %d (%d - %d) [%s]\n", ndx, NDX_DONE, last, who_am_i()); exit_cleanup(RERR_PROTOCOL); } if (ndx == NDX_FLIST_EOF) { flist_eof = 1; if (DEBUG_GTE(FLIST, 3)) rprintf(FINFO, "[%s] flist_eof=1\n", who_am_i()); write_int(f_out, NDX_FLIST_EOF); continue; } ndx = NDX_FLIST_OFFSET - ndx; if (ndx < 0 || ndx >= dir_flist->used) { ndx = NDX_FLIST_OFFSET - ndx; rprintf(FERROR, "Invalid dir index: %d (%d - %d) [%s]\n", ndx, NDX_FLIST_OFFSET, NDX_FLIST_OFFSET - dir_flist->used + 1, who_am_i()); exit_cleanup(RERR_PROTOCOL); } if (DEBUG_GTE(FLIST, 2)) { rprintf(FINFO, "[%s] receiving flist for dir %d\n", who_am_i(), ndx); } /* Send all the data we read for this flist to the generator. */ start_flist_forward(ndx); flist = recv_file_list(f_in); flist->parent_ndx = ndx; stop_flist_forward(); } iflags = protocol_version >= 29 ? read_shortint(f_in) : ITEM_TRANSFER | ITEM_MISSING_DATA; /* Support the protocol-29 keep-alive style. */ if (protocol_version < 30 && ndx == cur_flist->used && iflags == ITEM_IS_NEW) { if (am_sender) maybe_send_keepalive(time(NULL), MSK_ALLOW_FLUSH); goto read_loop; } flist = flist_for_ndx(ndx, "read_ndx_and_attrs"); if (flist != cur_flist) { cur_flist = flist; if (am_sender) { file_old_total = cur_flist->used; for (flist = first_flist; flist != cur_flist; flist = flist->next) file_old_total += flist->used; } } if (iflags & ITEM_BASIS_TYPE_FOLLOWS) fnamecmp_type = read_byte(f_in); *type_ptr = fnamecmp_type; if (iflags & ITEM_XNAME_FOLLOWS) { if ((len = read_vstring(f_in, buf, MAXPATHLEN)) < 0) exit_cleanup(RERR_PROTOCOL); } else { *buf = '\0'; len = -1; } *len_ptr = len; if (iflags & ITEM_TRANSFER) { int i = ndx - cur_flist->ndx_start; if (i < 0 || !S_ISREG(cur_flist->files[i]->mode)) { rprintf(FERROR, "received request to transfer non-regular file: %d [%s]\n", ndx, who_am_i()); exit_cleanup(RERR_PROTOCOL); } } *iflag_ptr = iflags; return ndx; }
1
314,964
static std::string selectionAsString(WebFrame* frame) { return frame->selectionAsText().utf8(); }
0
273,995
ikev1_hash_print(netdissect_options *ndo, u_char tpay _U_, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, uint32_t phase _U_, uint32_t doi _U_, uint32_t proto _U_, int depth _U_) { struct isakmp_gen e; ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_HASH))); ND_TCHECK(*ext); UNALIGNED_MEMCPY(&e, ext, sizeof(e)); ND_PRINT((ndo," len=%d", ntohs(e.len) - 4)); if (2 < ndo->ndo_vflag && 4 < ntohs(e.len)) { /* Print the entire payload in hex */ ND_PRINT((ndo," ")); if (!rawprint(ndo, (const uint8_t *)(ext + 1), ntohs(e.len) - 4)) goto trunc; } return (const u_char *)ext + ntohs(e.len); trunc: ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_HASH))); return NULL; }
0
266,407
sg_new_write(Sg_fd *sfp, struct file *file, const char __user *buf, size_t count, int blocking, int read_only, int sg_io_owned, Sg_request **o_srp) { int k; Sg_request *srp; sg_io_hdr_t *hp; unsigned char cmnd[SG_MAX_CDB_SIZE]; int timeout; unsigned long ul_timeout; if (count < SZ_SG_IO_HDR) return -EINVAL; if (!access_ok(VERIFY_READ, buf, count)) return -EFAULT; /* protects following copy_from_user()s + get_user()s */ sfp->cmd_q = 1; /* when sg_io_hdr seen, set command queuing on */ if (!(srp = sg_add_request(sfp))) { SCSI_LOG_TIMEOUT(1, sg_printk(KERN_INFO, sfp->parentdp, "sg_new_write: queue full\n")); return -EDOM; } srp->sg_io_owned = sg_io_owned; hp = &srp->header; if (__copy_from_user(hp, buf, SZ_SG_IO_HDR)) { sg_remove_request(sfp, srp); return -EFAULT; } if (hp->interface_id != 'S') { sg_remove_request(sfp, srp); return -ENOSYS; } if (hp->flags & SG_FLAG_MMAP_IO) { if (hp->dxfer_len > sfp->reserve.bufflen) { sg_remove_request(sfp, srp); return -ENOMEM; /* MMAP_IO size must fit in reserve buffer */ } if (hp->flags & SG_FLAG_DIRECT_IO) { sg_remove_request(sfp, srp); return -EINVAL; /* either MMAP_IO or DIRECT_IO (not both) */ } if (sfp->res_in_use) { sg_remove_request(sfp, srp); return -EBUSY; /* reserve buffer already being used */ } } ul_timeout = msecs_to_jiffies(srp->header.timeout); timeout = (ul_timeout < INT_MAX) ? ul_timeout : INT_MAX; if ((!hp->cmdp) || (hp->cmd_len < 6) || (hp->cmd_len > sizeof (cmnd))) { sg_remove_request(sfp, srp); return -EMSGSIZE; } if (!access_ok(VERIFY_READ, hp->cmdp, hp->cmd_len)) { sg_remove_request(sfp, srp); return -EFAULT; /* protects following copy_from_user()s + get_user()s */ } if (__copy_from_user(cmnd, hp->cmdp, hp->cmd_len)) { sg_remove_request(sfp, srp); return -EFAULT; } if (read_only && sg_allow_access(file, cmnd)) { sg_remove_request(sfp, srp); return -EPERM; } k = sg_common_write(sfp, srp, cmnd, timeout, blocking); if (k < 0) return k; if (o_srp) *o_srp = srp; return count; }
0
196,987
DEFINE_TRACE(Document) { #if ENABLE(OILPAN) visitor->trace(m_importsController); visitor->trace(m_docType); visitor->trace(m_implementation); visitor->trace(m_autofocusElement); visitor->trace(m_focusedElement); visitor->trace(m_hoverNode); visitor->trace(m_activeHoverElement); visitor->trace(m_documentElement); visitor->trace(m_titleElement); visitor->trace(m_axObjectCache); visitor->trace(m_markers); visitor->trace(m_cssTarget); visitor->trace(m_currentScriptStack); visitor->trace(m_scriptRunner); visitor->trace(m_listsInvalidatedAtDocument); for (int i = 0; i < numNodeListInvalidationTypes; ++i) visitor->trace(m_nodeLists[i]); visitor->trace(m_topLayerElements); visitor->trace(m_elemSheet); visitor->trace(m_nodeIterators); visitor->trace(m_ranges); visitor->trace(m_styleEngine); visitor->trace(m_formController); visitor->trace(m_visitedLinkState); visitor->trace(m_frame); visitor->trace(m_domWindow); visitor->trace(m_fetcher); visitor->trace(m_parser); visitor->trace(m_contextFeatures); visitor->trace(m_styleSheetList); visitor->trace(m_documentTiming); visitor->trace(m_mediaQueryMatcher); visitor->trace(m_scriptedAnimationController); visitor->trace(m_scriptedIdleTaskController); visitor->trace(m_taskRunner); visitor->trace(m_textAutosizer); visitor->trace(m_registrationContext); visitor->trace(m_customElementMicrotaskRunQueue); visitor->trace(m_elementDataCache); visitor->trace(m_associatedFormControls); visitor->trace(m_useElementsNeedingUpdate); visitor->trace(m_layerUpdateSVGFilterElements); visitor->trace(m_timers); visitor->trace(m_templateDocument); visitor->trace(m_templateDocumentHost); visitor->trace(m_visibilityObservers); visitor->trace(m_userActionElements); visitor->trace(m_svgExtensions); visitor->trace(m_timeline); visitor->trace(m_compositorPendingAnimations); visitor->trace(m_contextDocument); visitor->trace(m_canvasFontCache); visitor->trace(m_intersectionObserverController); visitor->trace(m_intersectionObserverData); WillBeHeapSupplementable<Document>::trace(visitor); #endif TreeScope::trace(visitor); ContainerNode::trace(visitor); ExecutionContext::trace(visitor); DocumentLifecycleNotifier::trace(visitor); SecurityContext::trace(visitor); }
0
117,699
list_item_verbose(struct cpio *cpio, struct archive_entry *entry) { char size[32]; char date[32]; char uids[16], gids[16]; const char *uname, *gname; FILE *out = stdout; const char *fmt; time_t mtime; static time_t now; if (!now) time(&now); if (cpio->option_numeric_uid_gid) { /* Format numeric uid/gid for display. */ strcpy(uids, cpio_i64toa(archive_entry_uid(entry))); uname = uids; strcpy(gids, cpio_i64toa(archive_entry_gid(entry))); gname = gids; } else { /* Use uname if it's present, else lookup name from uid. */ uname = archive_entry_uname(entry); if (uname == NULL) uname = lookup_uname(cpio, (uid_t)archive_entry_uid(entry)); /* Use gname if it's present, else lookup name from gid. */ gname = archive_entry_gname(entry); if (gname == NULL) gname = lookup_gname(cpio, (uid_t)archive_entry_gid(entry)); } /* Print device number or file size. */ if (archive_entry_filetype(entry) == AE_IFCHR || archive_entry_filetype(entry) == AE_IFBLK) { snprintf(size, sizeof(size), "%lu,%lu", (unsigned long)archive_entry_rdevmajor(entry), (unsigned long)archive_entry_rdevminor(entry)); } else { strcpy(size, cpio_i64toa(archive_entry_size(entry))); } /* Format the time using 'ls -l' conventions. */ mtime = archive_entry_mtime(entry); #if defined(_WIN32) && !defined(__CYGWIN__) /* Windows' strftime function does not support %e format. */ if (mtime - now > 365*86400/2 || mtime - now < -365*86400/2) fmt = cpio->day_first ? "%d %b %Y" : "%b %d %Y"; else fmt = cpio->day_first ? "%d %b %H:%M" : "%b %d %H:%M"; #else if (mtime - now > 365*86400/2 || mtime - now < -365*86400/2) fmt = cpio->day_first ? "%e %b %Y" : "%b %e %Y"; else fmt = cpio->day_first ? "%e %b %H:%M" : "%b %e %H:%M"; #endif strftime(date, sizeof(date), fmt, localtime(&mtime)); fprintf(out, "%s%3d %-8s %-8s %8s %12s %s", archive_entry_strmode(entry), archive_entry_nlink(entry), uname, gname, size, date, archive_entry_pathname(entry)); /* Extra information for links. */ if (archive_entry_hardlink(entry)) /* Hard link */ fprintf(out, " link to %s", archive_entry_hardlink(entry)); else if (archive_entry_symlink(entry)) /* Symbolic link */ fprintf(out, " -> %s", archive_entry_symlink(entry)); fprintf(out, "\n"); }
0
431,947
static int xfrm_get_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh, struct nlattr **attrs) { struct net *net = sock_net(skb->sk); struct sk_buff *r_skb; u32 *flags = nlmsg_data(nlh); u32 sportid = NETLINK_CB(skb).portid; u32 seq = nlh->nlmsg_seq; int err; r_skb = nlmsg_new(xfrm_spdinfo_msgsize(), GFP_ATOMIC); if (r_skb == NULL) return -ENOMEM; err = build_spdinfo(r_skb, net, sportid, seq, *flags); BUG_ON(err < 0); return nlmsg_unicast(net->xfrm.nlsk, r_skb, sportid); }
0
391,365
unsigned int cl_retflevel(void) { return CL_FLEVEL; }
0
135,918
void VectorAddition(OpKernelContext* context, const quint8* x_data, float min_x, float max_x, const quint8* y_data, float min_y, float max_y, int64 num_elements, float output_min, float output_max, qint32* output) { const float x_0_float = QuantizedToFloat<quint8>(0, min_x, max_x); const float x_1_float = QuantizedToFloat<quint8>(1, min_x, max_x); const int64 x_0_int64 = FloatToQuantizedUnclamped<qint32>(x_0_float, output_min, output_max); const int64 x_1_int64 = FloatToQuantizedUnclamped<qint32>(x_1_float, output_min, output_max); const int32 x_mult_int32 = x_1_int64 - x_0_int64; const float y_0_float = QuantizedToFloat<quint8>(0, min_y, max_y); const float y_1_float = QuantizedToFloat<quint8>(1, min_y, max_y); const int64 y_0_int64 = FloatToQuantizedUnclamped<qint32>(y_0_float, output_min, output_max); const int64 y_1_int64 = FloatToQuantizedUnclamped<qint32>(y_1_float, output_min, output_max); const int32 y_mult_int32 = y_1_int64 - y_0_int64; const int64 lowest_quantized = static_cast<int64>(Eigen::NumTraits<qint32>::lowest()); const int64 highest_quantized = static_cast<int64>(Eigen::NumTraits<qint32>::highest()); for (int i = 0; i < num_elements; ++i) { const int64 x_value = static_cast<int64>(x_data[i]); int64 x_in_output_range_64 = x_0_int64 + (x_value * x_mult_int32); x_in_output_range_64 = std::max(x_in_output_range_64, lowest_quantized); x_in_output_range_64 = std::min(x_in_output_range_64, highest_quantized); const int32 x_in_output_range = static_cast<int32>(x_in_output_range_64); const int64 y_value = static_cast<int64>(y_data[i]); int64 y_in_output_range_64 = y_0_int64 + (y_value * y_mult_int32); y_in_output_range_64 = std::max(y_in_output_range_64, lowest_quantized); y_in_output_range_64 = std::min(y_in_output_range_64, highest_quantized); const int32 y_in_output_range = static_cast<int32>(y_in_output_range_64); output[i] = x_in_output_range + y_in_output_range; } }
0
490,132
gpk_compute_crycks(sc_card_t *card, sc_apdu_t *apdu, u8 *crycks1) { struct gpk_private_data *priv = DRVDATA(card); u8 in[8], out[8], block[64]; unsigned int len = 0, i; int r = SC_SUCCESS, outl; EVP_CIPHER_CTX *ctx = NULL; ctx = EVP_CIPHER_CTX_new(); if (ctx == NULL) return SC_ERROR_INTERNAL; /* Fill block with 0x00 and then with the data. */ memset(block, 0x00, sizeof(block)); block[len++] = apdu->cla; block[len++] = apdu->ins; block[len++] = apdu->p1; block[len++] = apdu->p2; block[len++] = apdu->lc + 3; if ((i = apdu->datalen) + len > sizeof(block)) i = sizeof(block) - len; memcpy(block+len, apdu->data, i); len += i; /* Set IV */ memset(in, 0x00, 8); EVP_EncryptInit_ex(ctx, EVP_des_ede_cbc(), NULL, priv->key, in); for (i = 0; i < len; i += 8) { if (!EVP_EncryptUpdate(ctx, out, &outl, &block[i], 8)) { r = SC_ERROR_INTERNAL; break; } } EVP_CIPHER_CTX_free(ctx); memcpy((u8 *) (apdu->data + apdu->datalen), out + 5, 3); apdu->datalen += 3; apdu->lc += 3; apdu->le += 3; if (crycks1) memcpy(crycks1, out, 3); sc_mem_clear(in, sizeof(in)); sc_mem_clear(out, sizeof(out)); sc_mem_clear(block, sizeof(block)); return r; }
0
264,839
static inline void setsck(const struct spi_device *spi, int is_on) { struct spi_gpio *spi_gpio = spi_to_spi_gpio(spi); gpiod_set_value_cansleep(spi_gpio->sck, is_on); }
0
314,764
image_transform_png_set_expand_add(image_transform *this, const image_transform **that, png_byte colour_type, png_byte bit_depth) { UNUSED(bit_depth) this->next = *that; *that = this; /* 'expand' should do nothing for RGBA or GA input - no tRNS and the bit * depth is at least 8 already. */ return (colour_type & PNG_COLOR_MASK_ALPHA) == 0; }
0
198,906
void GLES2DecoderPassthroughImpl::ClearAllAttributes() const {}
0
104,188
reset_VIsual_and_resel(void) { if (VIsual_active) { end_visual_mode(); redraw_curbuf_later(INVERTED); // delete the inversion later } VIsual_reselect = FALSE; }
0
75,121
xmlStringDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int what, xmlChar end, xmlChar end2, xmlChar end3) { if ((ctxt == NULL) || (str == NULL)) return(NULL); return(xmlStringLenDecodeEntities(ctxt, str, xmlStrlen(str), what, end, end2, end3)); }
0
85,843
void FS_TouchFile_f( void ) { fileHandle_t f; if ( Cmd_Argc() != 2 ) { Com_Printf( "Usage: touchFile <file>\n" ); return; } FS_FOpenFileRead( Cmd_Argv( 1 ), &f, qfalse ); if ( f ) { FS_FCloseFile( f ); } }
0
333,302
static void rv30_loop_filter(RV34DecContext *r, int row) { MpegEncContext *s = &r->s; int mb_pos, mb_x; int i, j, k; uint8_t *Y, *C; int loc_lim, cur_lim, left_lim = 0, top_lim = 0; mb_pos = row * s->mb_stride; for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){ int mbtype = s->current_picture_ptr->mb_type[mb_pos]; if(IS_INTRA(mbtype) || IS_SEPARATE_DC(mbtype)) r->deblock_coefs[mb_pos] = 0xFFFF; if(IS_INTRA(mbtype)) r->cbp_chroma[mb_pos] = 0xFF; } /* all vertical edges are filtered first * and horizontal edges are filtered on the next iteration */ mb_pos = row * s->mb_stride; for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){ cur_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos]]; if(mb_x) left_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos - 1]]; for(j = 0; j < 16; j += 4){ Y = s->current_picture_ptr->f.data[0] + mb_x*16 + (row*16 + j) * s->linesize + 4 * !mb_x; for(i = !mb_x; i < 4; i++, Y += 4){ int ij = i + j; loc_lim = 0; if(r->deblock_coefs[mb_pos] & (1 << ij)) loc_lim = cur_lim; else if(!i && r->deblock_coefs[mb_pos - 1] & (1 << (ij + 3))) loc_lim = left_lim; else if( i && r->deblock_coefs[mb_pos] & (1 << (ij - 1))) loc_lim = cur_lim; if(loc_lim) rv30_weak_loop_filter(Y, 1, s->linesize, loc_lim); } } for(k = 0; k < 2; k++){ int cur_cbp, left_cbp = 0; cur_cbp = (r->cbp_chroma[mb_pos] >> (k*4)) & 0xF; if(mb_x) left_cbp = (r->cbp_chroma[mb_pos - 1] >> (k*4)) & 0xF; for(j = 0; j < 8; j += 4){ C = s->current_picture_ptr->f.data[k + 1] + mb_x*8 + (row*8 + j) * s->uvlinesize + 4 * !mb_x; for(i = !mb_x; i < 2; i++, C += 4){ int ij = i + (j >> 1); loc_lim = 0; if (cur_cbp & (1 << ij)) loc_lim = cur_lim; else if(!i && left_cbp & (1 << (ij + 1))) loc_lim = left_lim; else if( i && cur_cbp & (1 << (ij - 1))) loc_lim = cur_lim; if(loc_lim) rv30_weak_loop_filter(C, 1, s->uvlinesize, loc_lim); } } } } mb_pos = row * s->mb_stride; for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){ cur_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos]]; if(row) top_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos - s->mb_stride]]; for(j = 4*!row; j < 16; j += 4){ Y = s->current_picture_ptr->f.data[0] + mb_x*16 + (row*16 + j) * s->linesize; for(i = 0; i < 4; i++, Y += 4){ int ij = i + j; loc_lim = 0; if(r->deblock_coefs[mb_pos] & (1 << ij)) loc_lim = cur_lim; else if(!j && r->deblock_coefs[mb_pos - s->mb_stride] & (1 << (ij + 12))) loc_lim = top_lim; else if( j && r->deblock_coefs[mb_pos] & (1 << (ij - 4))) loc_lim = cur_lim; if(loc_lim) rv30_weak_loop_filter(Y, s->linesize, 1, loc_lim); } } for(k = 0; k < 2; k++){ int cur_cbp, top_cbp = 0; cur_cbp = (r->cbp_chroma[mb_pos] >> (k*4)) & 0xF; if(row) top_cbp = (r->cbp_chroma[mb_pos - s->mb_stride] >> (k*4)) & 0xF; for(j = 4*!row; j < 8; j += 4){ C = s->current_picture_ptr->f.data[k+1] + mb_x*8 + (row*8 + j) * s->uvlinesize; for(i = 0; i < 2; i++, C += 4){ int ij = i + (j >> 1); loc_lim = 0; if (r->cbp_chroma[mb_pos] & (1 << ij)) loc_lim = cur_lim; else if(!j && top_cbp & (1 << (ij + 2))) loc_lim = top_lim; else if( j && cur_cbp & (1 << (ij - 2))) loc_lim = cur_lim; if(loc_lim) rv30_weak_loop_filter(C, s->uvlinesize, 1, loc_lim); } } } } }
1
33,968
static int __hrtick_restart(struct rq *rq) { struct hrtimer *timer = &rq->hrtick_timer; ktime_t time = hrtimer_get_softexpires(timer); return __hrtimer_start_range_ns(timer, time, 0, HRTIMER_MODE_ABS_PINNED, 0); }
0
227,499
static void InsertComplexFloatRow(float *p, int y, Image * image, double MinVal, double MaxVal) { ExceptionInfo *exception; double f; int x; register PixelPacket *q; if (MinVal == 0) MinVal = -1; if (MaxVal == 0) MaxVal = 1; exception=(&image->exception); q = QueueAuthenticPixels(image, 0, y, image->columns, 1,exception); if (q == (PixelPacket *) NULL) return; for (x = 0; x < (ssize_t) image->columns; x++) { if (*p > 0) { f = (*p / MaxVal) * (QuantumRange - GetPixelRed(q)); if (f + GetPixelRed(q) > QuantumRange) SetPixelRed(q,QuantumRange); else SetPixelRed(q,GetPixelRed(q)+(int) f); if ((int) f / 2.0 > GetPixelGreen(q)) { SetPixelGreen(q,0); SetPixelBlue(q,0); } else { SetPixelBlue(q,GetPixelBlue(q)-(int) (f/2.0)); SetPixelGreen(q,GetPixelBlue(q)); } } if (*p < 0) { f = (*p / MaxVal) * (QuantumRange - GetPixelBlue(q)); if (f + GetPixelBlue(q) > QuantumRange) SetPixelBlue(q,QuantumRange); else SetPixelBlue(q,GetPixelBlue(q)+(int) f); if ((int) f / 2.0 > q->green) { SetPixelGreen(q,0); SetPixelRed(q,0); } else { SetPixelRed(q,GetPixelRed(q)-(int) (f/2.0)); SetPixelGreen(q,GetPixelRed(q)); } } p++; q++; } if (!SyncAuthenticPixels(image,exception)) return; return; }
0
189,507
PHP_FUNCTION(pg_fetch_row) { php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, PGSQL_NUM, 0); }
0
464,805
static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops, struct file *file, void *fh, void *arg) { struct v4l2_format *p = arg; struct video_device *vfd = video_devdata(file); int ret = check_fmt(file, p->type); unsigned int i; if (ret) return ret; v4l_sanitize_format(p); switch (p->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: if (unlikely(!ops->vidioc_try_fmt_vid_cap)) break; CLEAR_AFTER_FIELD(p, fmt.pix); ret = ops->vidioc_try_fmt_vid_cap(file, fh, arg); /* just in case the driver zeroed it again */ p->fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC; if (vfd->vfl_type == VFL_TYPE_TOUCH) v4l_pix_format_touch(&p->fmt.pix); return ret; case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: if (unlikely(!ops->vidioc_try_fmt_vid_cap_mplane)) break; CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func); for (i = 0; i < p->fmt.pix_mp.num_planes; i++) CLEAR_AFTER_FIELD(&p->fmt.pix_mp.plane_fmt[i], bytesperline); return ops->vidioc_try_fmt_vid_cap_mplane(file, fh, arg); case V4L2_BUF_TYPE_VIDEO_OVERLAY: if (unlikely(!ops->vidioc_try_fmt_vid_overlay)) break; CLEAR_AFTER_FIELD(p, fmt.win); return ops->vidioc_try_fmt_vid_overlay(file, fh, arg); case V4L2_BUF_TYPE_VBI_CAPTURE: if (unlikely(!ops->vidioc_try_fmt_vbi_cap)) break; CLEAR_AFTER_FIELD(p, fmt.vbi.flags); return ops->vidioc_try_fmt_vbi_cap(file, fh, arg); case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: if (unlikely(!ops->vidioc_try_fmt_sliced_vbi_cap)) break; CLEAR_AFTER_FIELD(p, fmt.sliced.io_size); return ops->vidioc_try_fmt_sliced_vbi_cap(file, fh, arg); case V4L2_BUF_TYPE_VIDEO_OUTPUT: if (unlikely(!ops->vidioc_try_fmt_vid_out)) break; CLEAR_AFTER_FIELD(p, fmt.pix); ret = ops->vidioc_try_fmt_vid_out(file, fh, arg); /* just in case the driver zeroed it again */ p->fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC; return ret; case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: if (unlikely(!ops->vidioc_try_fmt_vid_out_mplane)) break; CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func); for (i = 0; i < p->fmt.pix_mp.num_planes; i++) CLEAR_AFTER_FIELD(&p->fmt.pix_mp.plane_fmt[i], bytesperline); return ops->vidioc_try_fmt_vid_out_mplane(file, fh, arg); case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: if (unlikely(!ops->vidioc_try_fmt_vid_out_overlay)) break; CLEAR_AFTER_FIELD(p, fmt.win); return ops->vidioc_try_fmt_vid_out_overlay(file, fh, arg); case V4L2_BUF_TYPE_VBI_OUTPUT: if (unlikely(!ops->vidioc_try_fmt_vbi_out)) break; CLEAR_AFTER_FIELD(p, fmt.vbi.flags); return ops->vidioc_try_fmt_vbi_out(file, fh, arg); case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: if (unlikely(!ops->vidioc_try_fmt_sliced_vbi_out)) break; CLEAR_AFTER_FIELD(p, fmt.sliced.io_size); return ops->vidioc_try_fmt_sliced_vbi_out(file, fh, arg); case V4L2_BUF_TYPE_SDR_CAPTURE: if (unlikely(!ops->vidioc_try_fmt_sdr_cap)) break; CLEAR_AFTER_FIELD(p, fmt.sdr.buffersize); return ops->vidioc_try_fmt_sdr_cap(file, fh, arg); case V4L2_BUF_TYPE_SDR_OUTPUT: if (unlikely(!ops->vidioc_try_fmt_sdr_out)) break; CLEAR_AFTER_FIELD(p, fmt.sdr.buffersize); return ops->vidioc_try_fmt_sdr_out(file, fh, arg); case V4L2_BUF_TYPE_META_CAPTURE: if (unlikely(!ops->vidioc_try_fmt_meta_cap)) break; CLEAR_AFTER_FIELD(p, fmt.meta); return ops->vidioc_try_fmt_meta_cap(file, fh, arg); case V4L2_BUF_TYPE_META_OUTPUT: if (unlikely(!ops->vidioc_try_fmt_meta_out)) break; CLEAR_AFTER_FIELD(p, fmt.meta); return ops->vidioc_try_fmt_meta_out(file, fh, arg); } return -EINVAL; }
0
491,997
void BrotliContext::finalizeOutput(Buffer::Instance& output_buffer) { const size_t n_output = chunk_size_ - avail_out_; if (n_output > 0) { output_buffer.add(static_cast<void*>(chunk_ptr_.get()), n_output); } }
0
413,923
Statement_Ptr Expand::operator()(Return_Ptr r) { error("@return may only be used within a function", r->pstate(), traces); return 0; }
0
515,002
find_seek_offset_time (GstRMDemux * rmdemux, GstClockTime time) { int i, n_stream; gboolean ret = FALSE; GSList *cur; GstClockTime earliest = GST_CLOCK_TIME_NONE; n_stream = 0; for (cur = rmdemux->streams; cur; cur = cur->next, n_stream++) { GstRMDemuxStream *stream = cur->data; /* Search backwards through this stream's index until we find the first * timestamp before our target time */ for (i = stream->index_length - 1; i >= 0; i--) { if (stream->index[i].timestamp <= time) { /* Set the seek_offset for the stream so we don't bother parsing it * until we've passed that point */ stream->seek_offset = stream->index[i].offset; /* If it's also the earliest timestamp we've seen of all streams, then * that's our target! */ if (earliest == GST_CLOCK_TIME_NONE || stream->index[i].timestamp < earliest) { earliest = stream->index[i].timestamp; rmdemux->offset = stream->index[i].offset; GST_DEBUG_OBJECT (rmdemux, "We're looking for %" GST_TIME_FORMAT " and we found that stream %d has the latest index at %" GST_TIME_FORMAT, GST_TIME_ARGS (rmdemux->segment.start), n_stream, GST_TIME_ARGS (earliest)); } ret = TRUE; break; } } stream->discont = TRUE; } return ret; }
0
302,403
static void xemaclite_aligned_read(u32 *src_ptr, u8 *dest_ptr, unsigned length) { u16 *to_u16_ptr, *from_u16_ptr; u32 *from_u32_ptr; u32 align_buffer; from_u32_ptr = src_ptr; to_u16_ptr = (u16 *)dest_ptr; for (; length > 3; length -= 4) { /* Copy each word into the temporary buffer */ align_buffer = *from_u32_ptr++; from_u16_ptr = (u16 *)&align_buffer; /* Read data from source */ *to_u16_ptr++ = *from_u16_ptr++; *to_u16_ptr++ = *from_u16_ptr++; } if (length) { u8 *to_u8_ptr, *from_u8_ptr; /* Set up to read the remaining data */ to_u8_ptr = (u8 *)to_u16_ptr; align_buffer = *from_u32_ptr++; from_u8_ptr = (u8 *)&align_buffer; /* Read the remaining data */ for (; length > 0; length--) *to_u8_ptr = *from_u8_ptr; } }
0
262,598
static void tg3_stop(struct tg3 *tp) { int i; tg3_reset_task_cancel(tp); tg3_netif_stop(tp); tg3_timer_stop(tp); tg3_hwmon_close(tp); tg3_phy_stop(tp); tg3_full_lock(tp, 1); tg3_disable_ints(tp); tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); tg3_free_rings(tp); tg3_flag_clear(tp, INIT_COMPLETE); tg3_full_unlock(tp); for (i = tp->irq_cnt - 1; i >= 0; i--) { struct tg3_napi *tnapi = &tp->napi[i]; free_irq(tnapi->irq_vec, tnapi); } tg3_ints_fini(tp); tg3_napi_fini(tp); tg3_free_consistent(tp); }
0
118,218
Event::Dispatcher& dispatcher() override { return dispatcher_; }
0
12,010
void DistillerNativeJavaScript::AddJavaScriptObjectToFrame( v8::Local<v8::Context> context) { v8::Isolate* isolate = blink::mainThreadIsolate(); v8::HandleScope handle_scope(isolate); if (context.IsEmpty()) return; v8::Context::Scope context_scope(context); v8::Local<v8::Object> distiller_obj = GetOrCreateDistillerObject(isolate, context->Global()); BindFunctionToObject( distiller_obj, "echo", base::Bind( &DistillerNativeJavaScript::DistillerEcho, base::Unretained(this))); BindFunctionToObject( distiller_obj, "sendFeedback", base::Bind( &DistillerNativeJavaScript::DistillerSendFeedback, base::Unretained(this))); BindFunctionToObject( distiller_obj, "closePanel", base::Bind( &DistillerNativeJavaScript::DistillerClosePanel, base::Unretained(this))); }
1
185,885
TestURLFetcher::~TestURLFetcher() { }
0
364,375
static NOINLINE int send_select(uint32_t xid, uint32_t server, uint32_t requested) { struct dhcp_packet packet; struct in_addr addr; /* * RFC 2131 4.3.2 DHCPREQUEST message * ... * If the DHCPREQUEST message contains a 'server identifier' * option, the message is in response to a DHCPOFFER message. * Otherwise, the message is a request to verify or extend an * existing lease. If the client uses a 'client identifier' * in a DHCPREQUEST message, it MUST use that same 'client identifier' * in all subsequent messages. If the client included a list * of requested parameters in a DHCPDISCOVER message, it MUST * include that list in all subsequent messages. */ /* Fill in: op, htype, hlen, cookie, chaddr fields, * random xid field (we override it below), * client-id option (unless -C), message type option: */ init_packet(&packet, DHCPREQUEST); packet.xid = xid; udhcp_add_simple_option(&packet, DHCP_REQUESTED_IP, requested); udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server); /* Add options: maxsize, * optionally: hostname, fqdn, vendorclass, * "param req" option according to -O, and options specified with -x */ add_client_options(&packet); addr.s_addr = requested; bb_info_msg("Sending select for %s...", inet_ntoa(addr)); return raw_bcast_from_client_config_ifindex(&packet); }
0
138,274
template<typename T>
0
240,257
pdf_drop_document_imp(fz_context *ctx, pdf_document *doc) { int i; fz_defer_reap_start(ctx); /* Type3 glyphs in the glyph cache can contain pdf_obj pointers * that we are about to destroy. Simplest solution is to bin the * glyph cache at this point. */ fz_try(ctx) fz_purge_glyph_cache(ctx); fz_catch(ctx) { /* Swallow error, but continue dropping */ } pdf_drop_js(ctx, doc->js); pdf_drop_xref_sections(ctx, doc); fz_free(ctx, doc->xref_index); pdf_drop_obj(ctx, doc->focus_obj); fz_drop_stream(ctx, doc->file); pdf_drop_crypt(ctx, doc->crypt); pdf_drop_obj(ctx, doc->linear_obj); if (doc->linear_page_refs) { for (i=0; i < doc->linear_page_count; i++) pdf_drop_obj(ctx, doc->linear_page_refs[i]); fz_free(ctx, doc->linear_page_refs); } fz_free(ctx, doc->hint_page); fz_free(ctx, doc->hint_shared_ref); fz_free(ctx, doc->hint_shared); fz_free(ctx, doc->hint_obj_offsets); for (i=0; i < doc->num_type3_fonts; i++) { fz_try(ctx) fz_decouple_type3_font(ctx, doc->type3_fonts[i], (void *)doc); fz_always(ctx) fz_drop_font(ctx, doc->type3_fonts[i]); fz_catch(ctx) { /* Swallow error, but continue dropping */ } } fz_free(ctx, doc->type3_fonts); pdf_drop_ocg(ctx, doc); pdf_drop_portfolio(ctx, doc); pdf_empty_store(ctx, doc); pdf_lexbuf_fin(ctx, &doc->lexbuf.base); pdf_drop_resource_tables(ctx, doc); fz_drop_colorspace(ctx, doc->oi); for (i = 0; i < doc->orphans_count; i++) pdf_drop_obj(ctx, doc->orphans[i]); fz_free(ctx, doc->orphans); fz_free(ctx, doc->rev_page_map); fz_defer_reap_end(ctx); }
0
8,035
void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) { global_State *g = G(L); lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); if (keepinvariant(g)) { /* must keep invariant? */ reallymarkobject(g, v); /* restore invariant */ if (isold(o)) { lua_assert(!isold(v)); /* white object could not be old */ setage(v, G_OLD0); /* restore generational invariant */ } } else { /* sweep phase */ lua_assert(issweepphase(g)); makewhite(g, o); /* mark main obj. as white to avoid other barriers */ } }
1
230,288
void Location::setHref(LocalDOMWindow* current_window, LocalDOMWindow* entered_window, const USVStringOrTrustedURL& stringOrUrl, ExceptionState& exception_state) { String url = GetStringFromTrustedURL(stringOrUrl, current_window->document(), exception_state); if (!exception_state.HadException()) { SetLocation(url, current_window, entered_window, &exception_state); } }
0
290,164
static void start_monitoring_file_list ( NautilusDirectory * directory ) { DirectoryLoadState * state ; if ( ! directory -> details -> file_list_monitored ) { g_assert ( ! directory -> details -> directory_load_in_progress ) ; directory -> details -> file_list_monitored = TRUE ; nautilus_file_list_ref ( directory -> details -> file_list ) ; } if ( directory -> details -> directory_loaded || directory -> details -> directory_load_in_progress != NULL ) { return ; } if ( ! async_job_start ( directory , "file list" ) ) { return ; } mark_all_files_unconfirmed ( directory ) ; state = g_new0 ( DirectoryLoadState , 1 ) ; state -> directory = directory ; state -> cancellable = g_cancellable_new ( ) ; state -> load_mime_list_hash = istr_set_new ( ) ; state -> load_file_count = 0 ; g_assert ( directory -> details -> location != NULL ) ; state -> load_directory_file = nautilus_directory_get_corresponding_file ( directory ) ; state -> load_directory_file -> details -> loading_directory = TRUE ; # ifdef DEBUG_LOAD_DIRECTORY g_message ( "load_directory called to monitor file list of %p" , directory -> details -> location ) ; # endif directory -> details -> directory_load_in_progress = state ; g_file_enumerate_children_async ( directory -> details -> location , NAUTILUS_FILE_DEFAULT_ATTRIBUTES , 0 , G_PRIORITY_DEFAULT , state -> cancellable , enumerate_children_callback , state ) ; }
0
310,829
void NEVER_INLINE FreeList::ZapFreedMemory(Address address, size_t size) { for (size_t i = 0; i < size; i++) { if (address[i] != kReuseAllowedZapValue) address[i] = kReuseForbiddenZapValue; } }
0
489,501
ds->request_period_switch = new_period_request ? 2 : 1; return GF_OK; } //done for this stream return dasher_stream_period_changed(filter, ctx, ds, new_period_request); } static void dasher_check_chaining(GF_DasherCtx *ctx, char *scheme_id, char *url) { GF_MPD_Descriptor *d = gf_mpd_get_descriptor(ctx->mpd->supplemental_properties, scheme_id); if (!d && !url) return; if (!url) { gf_list_del_item(ctx->mpd->supplemental_properties, d); gf_mpd_descriptor_free(d); return; } if (d) { gf_free(d->value); d->value = gf_strdup(url); return;
0
355,899
static int __init vdso_init(void) { int i; #ifdef CONFIG_PPC64 /* * Fill up the "systemcfg" stuff for backward compatiblity */ strcpy((char *)vdso_data->eye_catcher, "SYSTEMCFG:PPC64"); vdso_data->version.major = SYSTEMCFG_MAJOR; vdso_data->version.minor = SYSTEMCFG_MINOR; vdso_data->processor = mfspr(SPRN_PVR); /* * Fake the old platform number for pSeries and iSeries and add * in LPAR bit if necessary */ vdso_data->platform = machine_is(iseries) ? 0x200 : 0x100; if (firmware_has_feature(FW_FEATURE_LPAR)) vdso_data->platform |= 1; vdso_data->physicalMemorySize = lmb_phys_mem_size(); vdso_data->dcache_size = ppc64_caches.dsize; vdso_data->dcache_line_size = ppc64_caches.dline_size; vdso_data->icache_size = ppc64_caches.isize; vdso_data->icache_line_size = ppc64_caches.iline_size; /* XXXOJN: Blocks should be added to ppc64_caches and used instead */ vdso_data->dcache_block_size = ppc64_caches.dline_size; vdso_data->icache_block_size = ppc64_caches.iline_size; vdso_data->dcache_log_block_size = ppc64_caches.log_dline_size; vdso_data->icache_log_block_size = ppc64_caches.log_iline_size; /* * Calculate the size of the 64 bits vDSO */ vdso64_pages = (&vdso64_end - &vdso64_start) >> PAGE_SHIFT; DBG("vdso64_kbase: %p, 0x%x pages\n", vdso64_kbase, vdso64_pages); #else vdso_data->dcache_block_size = L1_CACHE_BYTES; vdso_data->dcache_log_block_size = L1_CACHE_SHIFT; vdso_data->icache_block_size = L1_CACHE_BYTES; vdso_data->icache_log_block_size = L1_CACHE_SHIFT; #endif /* CONFIG_PPC64 */ /* * Calculate the size of the 32 bits vDSO */ vdso32_pages = (&vdso32_end - &vdso32_start) >> PAGE_SHIFT; DBG("vdso32_kbase: %p, 0x%x pages\n", vdso32_kbase, vdso32_pages); /* * Setup the syscall map in the vDOS */ vdso_setup_syscall_map(); /* * Initialize the vDSO images in memory, that is do necessary * fixups of vDSO symbols, locate trampolines, etc... */ if (vdso_setup()) { printk(KERN_ERR "vDSO setup failure, not enabled !\n"); vdso32_pages = 0; #ifdef CONFIG_PPC64 vdso64_pages = 0; #endif return 0; } /* Make sure pages are in the correct state */ vdso32_pagelist = kzalloc(sizeof(struct page *) * (vdso32_pages + 2), GFP_KERNEL); BUG_ON(vdso32_pagelist == NULL); for (i = 0; i < vdso32_pages; i++) { struct page *pg = virt_to_page(vdso32_kbase + i*PAGE_SIZE); ClearPageReserved(pg); get_page(pg); vdso32_pagelist[i] = pg; } vdso32_pagelist[i++] = virt_to_page(vdso_data); vdso32_pagelist[i] = NULL; #ifdef CONFIG_PPC64 vdso64_pagelist = kzalloc(sizeof(struct page *) * (vdso64_pages + 2), GFP_KERNEL); BUG_ON(vdso64_pagelist == NULL); for (i = 0; i < vdso64_pages; i++) { struct page *pg = virt_to_page(vdso64_kbase + i*PAGE_SIZE); ClearPageReserved(pg); get_page(pg); vdso64_pagelist[i] = pg; } vdso64_pagelist[i++] = virt_to_page(vdso_data); vdso64_pagelist[i] = NULL; #endif /* CONFIG_PPC64 */ get_page(virt_to_page(vdso_data)); smp_wmb(); vdso_ready = 1; return 0; }
0
120,619
spnego_gss_wrap_aead(OM_uint32 *minor_status, gss_ctx_id_t context_handle, int conf_req_flag, gss_qop_t qop_req, gss_buffer_t input_assoc_buffer, gss_buffer_t input_payload_buffer, int *conf_state, gss_buffer_t output_message_buffer) { OM_uint32 ret; spnego_gss_ctx_id_t sc = (spnego_gss_ctx_id_t)context_handle; if (sc->ctx_handle == GSS_C_NO_CONTEXT) return (GSS_S_NO_CONTEXT); ret = gss_wrap_aead(minor_status, sc->ctx_handle, conf_req_flag, qop_req, input_assoc_buffer, input_payload_buffer, conf_state, output_message_buffer); return (ret); }
0
284,727
pattern_instance_uses_base_space(const gs_pattern_instance_t * pinst) { return pinst->type->procs.uses_base_space( pinst->type->procs.get_pattern(pinst) ); }
0
151,810
bit_read_BS (Bit_Chain *dat) { const unsigned char two_bit_code = bit_read_BB (dat); if (two_bit_code == 0) return bit_read_RS (dat); else if (two_bit_code == 1) return (BITCODE_BS)bit_read_RC (dat) & 0xFF; else if (two_bit_code == 2) return 0; else /* if (two_bit_code == 3) */ return 256; }
0
431,087
bool AuthorizationSessionImpl::isAuthorizedForActionsOnResource(const ResourcePattern& resource, ActionType action) { return isAuthorizedForPrivilege(Privilege(resource, action)); }
0
158,966
bool WebContents::IsGuest() const { return type_ == Type::WEB_VIEW; }
0
25,488
static int config_filter_parser_cmp ( struct config_filter_parser * const * p1 , struct config_filter_parser * const * p2 ) { const struct config_filter * f1 = & ( * p1 ) -> filter , * f2 = & ( * p2 ) -> filter ; if ( f1 -> local_name != NULL && f2 -> local_name == NULL ) return - 1 ; if ( f1 -> local_name == NULL && f2 -> local_name != NULL ) return 1 ; if ( f1 -> local_bits > f2 -> local_bits ) return - 1 ; if ( f1 -> local_bits < f2 -> local_bits ) return 1 ; if ( f1 -> remote_bits > f2 -> remote_bits ) return - 1 ; if ( f1 -> remote_bits < f2 -> remote_bits ) return 1 ; if ( f1 -> service != NULL && f2 -> service == NULL ) return - 1 ; if ( f1 -> service == NULL && f2 -> service != NULL ) return 1 ; return 0 ; }
0
340,700
static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, int srcWidth, int srcHeight, int srcStride, int dstStride) { int x,y; dst[0]= src[0]; // first line for(x=0; x<srcWidth-1; x++){ dst[2*x+1]= (3*src[x] + src[x+1])>>2; dst[2*x+2]= ( src[x] + 3*src[x+1])>>2; } dst[2*srcWidth-1]= src[srcWidth-1]; dst+= dstStride; for(y=1; y<srcHeight; y++){ #if defined (HAVE_MMX2) || defined (HAVE_3DNOW) const long mmxSize= srcWidth&~15; asm volatile( "mov %4, %%"REG_a" \n\t" "1: \n\t" "movq (%0, %%"REG_a"), %%mm0 \n\t" "movq (%1, %%"REG_a"), %%mm1 \n\t" "movq 1(%0, %%"REG_a"), %%mm2 \n\t" "movq 1(%1, %%"REG_a"), %%mm3 \n\t" "movq -1(%0, %%"REG_a"), %%mm4 \n\t" "movq -1(%1, %%"REG_a"), %%mm5 \n\t" PAVGB" %%mm0, %%mm5 \n\t" PAVGB" %%mm0, %%mm3 \n\t" PAVGB" %%mm0, %%mm5 \n\t" PAVGB" %%mm0, %%mm3 \n\t" PAVGB" %%mm1, %%mm4 \n\t" PAVGB" %%mm1, %%mm2 \n\t" PAVGB" %%mm1, %%mm4 \n\t" PAVGB" %%mm1, %%mm2 \n\t" "movq %%mm5, %%mm7 \n\t" "movq %%mm4, %%mm6 \n\t" "punpcklbw %%mm3, %%mm5 \n\t" "punpckhbw %%mm3, %%mm7 \n\t" "punpcklbw %%mm2, %%mm4 \n\t" "punpckhbw %%mm2, %%mm6 \n\t" #if 1 MOVNTQ" %%mm5, (%2, %%"REG_a", 2)\n\t" MOVNTQ" %%mm7, 8(%2, %%"REG_a", 2)\n\t" MOVNTQ" %%mm4, (%3, %%"REG_a", 2)\n\t" MOVNTQ" %%mm6, 8(%3, %%"REG_a", 2)\n\t" #else "movq %%mm5, (%2, %%"REG_a", 2) \n\t" "movq %%mm7, 8(%2, %%"REG_a", 2)\n\t" "movq %%mm4, (%3, %%"REG_a", 2) \n\t" "movq %%mm6, 8(%3, %%"REG_a", 2)\n\t" #endif "add $8, %%"REG_a" \n\t" " js 1b \n\t" :: "r" (src + mmxSize ), "r" (src + srcStride + mmxSize ), "r" (dst + mmxSize*2), "r" (dst + dstStride + mmxSize*2), "g" (-mmxSize) : "%"REG_a ); #else const int mmxSize=1; #endif dst[0 ]= (3*src[0] + src[srcStride])>>2; dst[dstStride]= ( src[0] + 3*src[srcStride])>>2; for(x=mmxSize-1; x<srcWidth-1; x++){ dst[2*x +1]= (3*src[x+0] + src[x+srcStride+1])>>2; dst[2*x+dstStride+2]= ( src[x+0] + 3*src[x+srcStride+1])>>2; dst[2*x+dstStride+1]= ( src[x+1] + 3*src[x+srcStride ])>>2; dst[2*x +2]= (3*src[x+1] + src[x+srcStride ])>>2; } dst[srcWidth*2 -1 ]= (3*src[srcWidth-1] + src[srcWidth-1 + srcStride])>>2; dst[srcWidth*2 -1 + dstStride]= ( src[srcWidth-1] + 3*src[srcWidth-1 + srcStride])>>2; dst+=dstStride*2; src+=srcStride; } // last line #if 1 dst[0]= src[0]; for(x=0; x<srcWidth-1; x++){ dst[2*x+1]= (3*src[x] + src[x+1])>>2; dst[2*x+2]= ( src[x] + 3*src[x+1])>>2; } dst[2*srcWidth-1]= src[srcWidth-1]; #else for(x=0; x<srcWidth; x++){ dst[2*x+0]= dst[2*x+1]= src[x]; } #endif #ifdef HAVE_MMX asm volatile( EMMS" \n\t" SFENCE" \n\t" :::"memory"); #endif }
1
273,817
static int finish_open_channel (lua_State *L, int status, lua_KContext ctx) { ssh_userdata *state = (ssh_userdata *)lua_touserdata(L, 1); LIBSSH2_CHANNEL **channel = (LIBSSH2_CHANNEL **) lua_touserdata(L, 2); while ((*channel = libssh2_channel_open_session(state->session)) == NULL && libssh2_session_last_errno(state->session) == LIBSSH2_ERROR_EAGAIN) { luaL_getmetafield(L, 1, "filter"); lua_pushvalue(L, 1); lua_callk(L, 1, 0, 0, finish_open_channel); } if (channel == NULL) return luaL_error(L, "Opening channel"); return setup_channel(L, 0, 0); }
0
107,814
static int get_appcontext_input_count_offset(void) { #define low_offset offsetof(struct _XtAppStruct, __maxed__nfds) #define high_offset offsetof(struct _XtAppStruct, __maybe__input_max) #define n_offsets_max (high_offset - low_offset)/2 int i, ofs, n_offsets = 0; int offsets[n_offsets_max] = { 0, }; #define n_inputs_max 4 /* number of refinements/input sources */ int fd, id, n_inputs = 0; struct { int fd, id; } inputs[n_inputs_max] = { 0, }; if ((fd = open("/dev/null", O_WRONLY)) < 0) return 0; if ((id = add_appcontext_input(fd, 0)) < 0) { close(fd); return 0; } inputs[n_inputs].fd = fd; inputs[n_inputs].id = id; n_inputs++; for (ofs = low_offset; ofs < high_offset; ofs += 2) { if (get_appcontext_input_count_at(ofs) == 1) offsets[n_offsets++] = ofs; } while (n_inputs < n_inputs_max) { if ((fd = open("/dev/null", O_WRONLY)) < 0) break; if ((id = add_appcontext_input(fd, n_inputs)) < 0) { close(fd); break; } inputs[n_inputs].fd = fd; inputs[n_inputs].id = id; n_inputs++; int n = 0; for (i = 0; i < n_offsets; i++) { if (get_appcontext_input_count_at(offsets[i]) == n_inputs) offsets[n++] = offsets[i]; } for (i = n; i < n_offsets; i++) offsets[i] = 0; n_offsets = n; } for (i = 0; i < n_inputs; i++) { XtRemoveInput(inputs[i].id); close(inputs[i].fd); } if (n_offsets == 1) return offsets[0]; #undef n_fds_max #undef n_offsets_max #undef high_offset #undef low_offset return 0; }
0
457,838
static void io_cancel_defer_files(struct io_ring_ctx *ctx, struct files_struct *files) { struct io_defer_entry *de = NULL; LIST_HEAD(list); spin_lock_irq(&ctx->completion_lock); list_for_each_entry_reverse(de, &ctx->defer_list, list) { if (io_match_link_files(de->req, files)) { list_cut_position(&list, &ctx->defer_list, &de->list); break; } } spin_unlock_irq(&ctx->completion_lock); while (!list_empty(&list)) { de = list_first_entry(&list, struct io_defer_entry, list); list_del_init(&de->list); req_set_fail_links(de->req); io_put_req(de->req); io_req_complete(de->req, -ECANCELED); kfree(de); } }
0
130,584
static int handle_invalid_guest_state(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); enum emulation_result err = EMULATE_DONE; int ret = 1; u32 cpu_exec_ctrl; bool intr_window_requested; unsigned count = 130; cpu_exec_ctrl = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL); intr_window_requested = cpu_exec_ctrl & CPU_BASED_VIRTUAL_INTR_PENDING; while (vmx->emulation_required && count-- != 0) { if (intr_window_requested && vmx_interrupt_allowed(vcpu)) return handle_interrupt_window(&vmx->vcpu); if (kvm_test_request(KVM_REQ_EVENT, vcpu)) return 1; err = emulate_instruction(vcpu, EMULTYPE_NO_REEXECUTE); if (err == EMULATE_USER_EXIT) { ++vcpu->stat.mmio_exits; ret = 0; goto out; } if (err != EMULATE_DONE) { vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION; vcpu->run->internal.ndata = 0; return 0; } if (vcpu->arch.halt_request) { vcpu->arch.halt_request = 0; ret = kvm_vcpu_halt(vcpu); goto out; } if (signal_pending(current)) goto out; if (need_resched()) schedule(); } out: return ret; }
0
417,048
ofputil_decode_ofp10_phy_port(struct ofputil_phy_port *pp, const struct ofp10_phy_port *opp) { pp->port_no = u16_to_ofp(ntohs(opp->port_no)); pp->hw_addr = opp->hw_addr; ovs_strlcpy(pp->name, opp->name, OFP_MAX_PORT_NAME_LEN); pp->config = ntohl(opp->config) & OFPPC10_ALL; pp->state = ntohl(opp->state) & OFPPS10_ALL; pp->curr = netdev_port_features_from_ofp10(opp->curr); pp->advertised = netdev_port_features_from_ofp10(opp->advertised); pp->supported = netdev_port_features_from_ofp10(opp->supported); pp->peer = netdev_port_features_from_ofp10(opp->peer); pp->curr_speed = netdev_features_to_bps(pp->curr, 0) / 1000; pp->max_speed = netdev_features_to_bps(pp->supported, 0) / 1000; return 0; }
0
319,191
bool qemu_clock_expired(QEMUClockType type) { return timerlist_expired( main_loop_tlg.tl[type]); }
0
30,234
void read_embedded_server_arguments ( const char * name ) { char argument [ 1024 ] , buff [ FN_REFLEN ] , * str = 0 ; FILE * file ; if ( ! test_if_hard_path ( name ) ) { strxmov ( buff , opt_basedir , name , NullS ) ; name = buff ; } fn_format ( buff , name , "" , "" , MY_UNPACK_FILENAME ) ; if ( ! embedded_server_arg_count ) { embedded_server_arg_count = 1 ; embedded_server_args [ 0 ] = ( char * ) "" ; } if ( ! ( file = my_fopen ( buff , O_RDONLY | FILE_BINARY , MYF ( MY_WME ) ) ) ) die ( "Failed to open file '%s'" , buff ) ; while ( embedded_server_arg_count < MAX_EMBEDDED_SERVER_ARGS && ( str = fgets ( argument , sizeof ( argument ) , file ) ) ) { * ( strend ( str ) - 1 ) = 0 ; if ( ! ( embedded_server_args [ embedded_server_arg_count ] = ( char * ) my_strdup ( str , MYF ( MY_WME ) ) ) ) { my_fclose ( file , MYF ( 0 ) ) ; die ( "Out of memory" ) ; } embedded_server_arg_count ++ ; } my_fclose ( file , MYF ( 0 ) ) ; if ( str ) die ( "Too many arguments in option file: %s" , name ) ; return ; }
0
413,501
static void _slurm_rpc_resv_delete(slurm_msg_t * msg) { /* init */ int error_code = SLURM_SUCCESS; DEF_TIMERS; reservation_name_msg_t *resv_desc_ptr = (reservation_name_msg_t *) msg->data; /* Locks: read job, write node */ slurmctld_lock_t node_write_lock = { NO_LOCK, READ_LOCK, WRITE_LOCK, NO_LOCK, NO_LOCK }; uid_t uid = g_slurm_auth_get_uid(msg->auth_cred, slurmctld_config.auth_info); START_TIMER; debug2("Processing RPC: REQUEST_DELETE_RESERVATION from uid=%d", uid); if (!validate_operator(uid)) { error_code = ESLURM_USER_ID_MISSING; error("Security violation, DELETE_RESERVATION RPC from uid=%d", uid); } else if (!resv_desc_ptr->name) { error_code = ESLURM_INVALID_PARTITION_NAME; error("Invalid DELETE_RESERVATION RPC from uid=%d, name is null", uid); } if (error_code == SLURM_SUCCESS) { /* do RPC call */ lock_slurmctld(node_write_lock); error_code = delete_resv(resv_desc_ptr); unlock_slurmctld(node_write_lock); END_TIMER2("_slurm_rpc_resv_delete"); } /* return result */ if (error_code) { info("_slurm_rpc_delete_reservation partition=%s: %s", resv_desc_ptr->name, slurm_strerror(error_code)); slurm_send_rc_msg(msg, error_code); } else { info("_slurm_rpc_delete_reservation complete for %s %s", resv_desc_ptr->name, TIME_STR); slurm_send_rc_msg(msg, SLURM_SUCCESS); queue_job_scheduler(); } }
0
101,224
static int packet_dev_mc(struct net_device *dev, struct packet_mclist *i, int what) { switch (i->type) { case PACKET_MR_MULTICAST: if (i->alen != dev->addr_len) return -EINVAL; if (what > 0) return dev_mc_add(dev, i->addr); else return dev_mc_del(dev, i->addr); break; case PACKET_MR_PROMISC: return dev_set_promiscuity(dev, what); case PACKET_MR_ALLMULTI: return dev_set_allmulti(dev, what); case PACKET_MR_UNICAST: if (i->alen != dev->addr_len) return -EINVAL; if (what > 0) return dev_uc_add(dev, i->addr); else return dev_uc_del(dev, i->addr); break; default: break; } return 0; }
0
135,819
static void init_dequant_tables(H264Context *h) { int i, x; init_dequant4_coeff_table(h); if (h->pps.transform_8x8_mode) init_dequant8_coeff_table(h); if (h->sps.transform_bypass) { for (i = 0; i < 6; i++) for (x = 0; x < 16; x++) h->dequant4_coeff[i][0][x] = 1 << 6; if (h->pps.transform_8x8_mode) for (i = 0; i < 6; i++) for (x = 0; x < 64; x++) h->dequant8_coeff[i][0][x] = 1 << 6; } }
0