idx
int64
func
string
target
int64
205,231
void SetIdealBoundsFromPositions(const std::vector<int>& positions) { if (static_cast<size_t>(GetTabCount()) != positions.size()) return; for (int i = 0; i < GetTabCount(); ++i) { gfx::Rect bounds(ideal_bounds(i)); bounds.set_x(positions[i]); tab_strip_->tabs_.set_ideal_bounds(i, bounds); } }
0
459,545
dissect_kafka_offsets_response_topic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, kafka_api_version_t api_version) { proto_item *ti; proto_tree *subtree; subtree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_kafka_topic, &ti, "Topic"); offset = dissect_kafka_string(subtree, hf_kafka_topic_name, tvb, pinfo, offset, 0, NULL, NULL); offset = dissect_kafka_array(subtree, tvb, pinfo, offset, 0, api_version, &dissect_kafka_offsets_response_partition, NULL); proto_item_set_end(ti, tvb, offset); return offset; }
0
347,292
void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum) { struct map_struct *buf; OFF_T i, len = st_p->st_size; md_context m; int32 remainder; int fd; memset(sum, 0, MAX_DIGEST_LEN); fd = do_open(fname, O_RDONLY, 0); if (fd == -1) return; buf = map_file(fd, len, MAX_MAP_SIZE, CSUM_CHUNK); switch (checksum_type) { case CSUM_MD5: md5_begin(&m); for (i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK) { md5_update(&m, (uchar *)map_ptr(buf, i, CSUM_CHUNK), CSUM_CHUNK); } remainder = (int32)(len - i); if (remainder > 0) md5_update(&m, (uchar *)map_ptr(buf, i, remainder), remainder); md5_result(&m, (uchar *)sum); break; case CSUM_MD4: case CSUM_MD4_OLD: case CSUM_MD4_BUSTED: mdfour_begin(&m); for (i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK) { mdfour_update(&m, (uchar *)map_ptr(buf, i, CSUM_CHUNK), CSUM_CHUNK); } /* Prior to version 27 an incorrect MD4 checksum was computed * by failing to call mdfour_tail() for block sizes that * are multiples of 64. This is fixed by calling mdfour_update() * even when there are no more bytes. */ remainder = (int32)(len - i); if (remainder > 0 || checksum_type != CSUM_MD4_BUSTED) mdfour_update(&m, (uchar *)map_ptr(buf, i, remainder), remainder); mdfour_result(&m, (uchar *)sum); break; default: rprintf(FERROR, "invalid checksum-choice for the --checksum option (%d)\n", checksum_type); exit_cleanup(RERR_UNSUPPORTED); } close(fd); unmap_file(buf); }
1
375,020
generateClonedIndexStmt(CreateStmtContext *cxt, Relation source_idx, const AttrNumber *attmap, int attmap_length) { Oid source_relid = RelationGetRelid(source_idx); Form_pg_attribute *attrs = RelationGetDescr(source_idx)->attrs; HeapTuple ht_idxrel; HeapTuple ht_idx; Form_pg_class idxrelrec; Form_pg_index idxrec; Form_pg_am amrec; oidvector *indcollation; oidvector *indclass; IndexStmt *index; List *indexprs; ListCell *indexpr_item; Oid indrelid; int keyno; Oid keycoltype; Datum datum; bool isnull; /* * Fetch pg_class tuple of source index. We can't use the copy in the * relcache entry because it doesn't include optional fields. */ ht_idxrel = SearchSysCache1(RELOID, ObjectIdGetDatum(source_relid)); if (!HeapTupleIsValid(ht_idxrel)) elog(ERROR, "cache lookup failed for relation %u", source_relid); idxrelrec = (Form_pg_class) GETSTRUCT(ht_idxrel); /* Fetch pg_index tuple for source index from relcache entry */ ht_idx = source_idx->rd_indextuple; idxrec = (Form_pg_index) GETSTRUCT(ht_idx); indrelid = idxrec->indrelid; /* Fetch pg_am tuple for source index from relcache entry */ amrec = source_idx->rd_am; /* Extract indcollation from the pg_index tuple */ datum = SysCacheGetAttr(INDEXRELID, ht_idx, Anum_pg_index_indcollation, &isnull); Assert(!isnull); indcollation = (oidvector *) DatumGetPointer(datum); /* Extract indclass from the pg_index tuple */ datum = SysCacheGetAttr(INDEXRELID, ht_idx, Anum_pg_index_indclass, &isnull); Assert(!isnull); indclass = (oidvector *) DatumGetPointer(datum); /* Begin building the IndexStmt */ index = makeNode(IndexStmt); index->relation = cxt->relation; index->accessMethod = pstrdup(NameStr(amrec->amname)); if (OidIsValid(idxrelrec->reltablespace)) index->tableSpace = get_tablespace_name(idxrelrec->reltablespace); else index->tableSpace = NULL; index->excludeOpNames = NIL; index->idxcomment = NULL; index->indexOid = InvalidOid; index->oldNode = InvalidOid; index->unique = idxrec->indisunique; index->primary = idxrec->indisprimary; index->concurrent = false; /* * We don't try to preserve the name of the source index; instead, just * let DefineIndex() choose a reasonable name. */ index->idxname = NULL; /* * If the index is marked PRIMARY or has an exclusion condition, it's * certainly from a constraint; else, if it's not marked UNIQUE, it * certainly isn't. If it is or might be from a constraint, we have to * fetch the pg_constraint record. */ if (index->primary || index->unique || idxrec->indisexclusion) { Oid constraintId = get_index_constraint(source_relid); if (OidIsValid(constraintId)) { HeapTuple ht_constr; Form_pg_constraint conrec; ht_constr = SearchSysCache1(CONSTROID, ObjectIdGetDatum(constraintId)); if (!HeapTupleIsValid(ht_constr)) elog(ERROR, "cache lookup failed for constraint %u", constraintId); conrec = (Form_pg_constraint) GETSTRUCT(ht_constr); index->isconstraint = true; index->deferrable = conrec->condeferrable; index->initdeferred = conrec->condeferred; /* If it's an exclusion constraint, we need the operator names */ if (idxrec->indisexclusion) { Datum *elems; int nElems; int i; Assert(conrec->contype == CONSTRAINT_EXCLUSION); /* Extract operator OIDs from the pg_constraint tuple */ datum = SysCacheGetAttr(CONSTROID, ht_constr, Anum_pg_constraint_conexclop, &isnull); if (isnull) elog(ERROR, "null conexclop for constraint %u", constraintId); deconstruct_array(DatumGetArrayTypeP(datum), OIDOID, sizeof(Oid), true, 'i', &elems, NULL, &nElems); for (i = 0; i < nElems; i++) { Oid operid = DatumGetObjectId(elems[i]); HeapTuple opertup; Form_pg_operator operform; char *oprname; char *nspname; List *namelist; opertup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operid)); if (!HeapTupleIsValid(opertup)) elog(ERROR, "cache lookup failed for operator %u", operid); operform = (Form_pg_operator) GETSTRUCT(opertup); oprname = pstrdup(NameStr(operform->oprname)); /* For simplicity we always schema-qualify the op name */ nspname = get_namespace_name(operform->oprnamespace); namelist = list_make2(makeString(nspname), makeString(oprname)); index->excludeOpNames = lappend(index->excludeOpNames, namelist); ReleaseSysCache(opertup); } } ReleaseSysCache(ht_constr); } else index->isconstraint = false; } else index->isconstraint = false; /* Get the index expressions, if any */ datum = SysCacheGetAttr(INDEXRELID, ht_idx, Anum_pg_index_indexprs, &isnull); if (!isnull) { char *exprsString; exprsString = TextDatumGetCString(datum); indexprs = (List *) stringToNode(exprsString); } else indexprs = NIL; /* Build the list of IndexElem */ index->indexParams = NIL; indexpr_item = list_head(indexprs); for (keyno = 0; keyno < idxrec->indnatts; keyno++) { IndexElem *iparam; AttrNumber attnum = idxrec->indkey.values[keyno]; int16 opt = source_idx->rd_indoption[keyno]; iparam = makeNode(IndexElem); if (AttributeNumberIsValid(attnum)) { /* Simple index column */ char *attname; attname = get_relid_attribute_name(indrelid, attnum); keycoltype = get_atttype(indrelid, attnum); iparam->name = attname; iparam->expr = NULL; } else { /* Expressional index */ Node *indexkey; bool found_whole_row; if (indexpr_item == NULL) elog(ERROR, "too few entries in indexprs list"); indexkey = (Node *) lfirst(indexpr_item); indexpr_item = lnext(indexpr_item); /* Adjust Vars to match new table's column numbering */ indexkey = map_variable_attnos(indexkey, 1, 0, attmap, attmap_length, &found_whole_row); /* As in transformTableLikeClause, reject whole-row variables */ if (found_whole_row) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot convert whole-row table reference"), errdetail("Index \"%s\" contains a whole-row table reference.", RelationGetRelationName(source_idx)))); iparam->name = NULL; iparam->expr = indexkey; keycoltype = exprType(indexkey); } /* Copy the original index column name */ iparam->indexcolname = pstrdup(NameStr(attrs[keyno]->attname)); /* Add the collation name, if non-default */ iparam->collation = get_collation(indcollation->values[keyno], keycoltype); /* Add the operator class name, if non-default */ iparam->opclass = get_opclass(indclass->values[keyno], keycoltype); iparam->ordering = SORTBY_DEFAULT; iparam->nulls_ordering = SORTBY_NULLS_DEFAULT; /* Adjust options if necessary */ if (amrec->amcanorder) { /* * If it supports sort ordering, copy DESC and NULLS opts. Don't * set non-default settings unnecessarily, though, so as to * improve the chance of recognizing equivalence to constraint * indexes. */ if (opt & INDOPTION_DESC) { iparam->ordering = SORTBY_DESC; if ((opt & INDOPTION_NULLS_FIRST) == 0) iparam->nulls_ordering = SORTBY_NULLS_LAST; } else { if (opt & INDOPTION_NULLS_FIRST) iparam->nulls_ordering = SORTBY_NULLS_FIRST; } } index->indexParams = lappend(index->indexParams, iparam); } /* Copy reloptions if any */ datum = SysCacheGetAttr(RELOID, ht_idxrel, Anum_pg_class_reloptions, &isnull); if (!isnull) index->options = untransformRelOptions(datum); /* If it's a partial index, decompile and append the predicate */ datum = SysCacheGetAttr(INDEXRELID, ht_idx, Anum_pg_index_indpred, &isnull); if (!isnull) { char *pred_str; Node *pred_tree; bool found_whole_row; /* Convert text string to node tree */ pred_str = TextDatumGetCString(datum); pred_tree = (Node *) stringToNode(pred_str); /* Adjust Vars to match new table's column numbering */ pred_tree = map_variable_attnos(pred_tree, 1, 0, attmap, attmap_length, &found_whole_row); /* As in transformTableLikeClause, reject whole-row variables */ if (found_whole_row) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot convert whole-row table reference"), errdetail("Index \"%s\" contains a whole-row table reference.", RelationGetRelationName(source_idx)))); index->whereClause = pred_tree; } /* Clean up */ ReleaseSysCache(ht_idxrel); return index; }
0
199,158
static int t_fromb64(unsigned char *a, const char *src) { char *loc; int i, j; int size; while (*src && (*src == ' ' || *src == '\t' || *src == '\n')) ++src; size = strlen(src); i = 0; while (i < size) { loc = strchr(b64table, src[i]); if (loc == (char *)0) break; else a[i] = loc - b64table; ++i; } /* if nothing valid to process we have a zero length response */ if (i == 0) return 0; size = i; i = size - 1; j = size; while (1) { a[j] = a[i]; if (--i < 0) break; a[j] |= (a[i] & 3) << 6; --j; a[j] = (unsigned char)((a[i] & 0x3c) >> 2); if (--i < 0) break; a[j] |= (a[i] & 0xf) << 4; --j; a[j] = (unsigned char)((a[i] & 0x30) >> 4); if (--i < 0) break; a[j] |= (a[i] << 2); a[--j] = 0; if (--i < 0) break; } while (a[j] == 0 && j <= size) ++j; i = 0; while (j <= size) a[i++] = a[j++]; return i; }
0
316,143
void HTMLMediaElement::DidMoveToNewDocument(Document& old_document) { BLINK_MEDIA_LOG << "didMoveToNewDocument(" << (void*)this << ")"; load_timer_.MoveToNewTaskRunner( GetDocument().GetTaskRunner(TaskType::kInternalMedia)); progress_event_timer_.MoveToNewTaskRunner( GetDocument().GetTaskRunner(TaskType::kInternalMedia)); playback_progress_timer_.MoveToNewTaskRunner( GetDocument().GetTaskRunner(TaskType::kInternalMedia)); audio_tracks_timer_.MoveToNewTaskRunner( GetDocument().GetTaskRunner(TaskType::kInternalMedia)); if (viewport_intersection_observer_) { ActivateViewportIntersectionMonitoring(false); ActivateViewportIntersectionMonitoring(true); } deferred_load_timer_.MoveToNewTaskRunner( GetDocument().GetTaskRunner(TaskType::kInternalMedia)); removed_from_document_timer_.MoveToNewTaskRunner( GetDocument().GetTaskRunner(TaskType::kInternalMedia)); autoplay_policy_->DidMoveToNewDocument(old_document); if (should_delay_load_event_) { GetDocument().IncrementLoadEventDelayCount(); } else { old_document.IncrementLoadEventDelayCount(); } RemoveElementFromDocumentMap(this, &old_document); AddElementToDocumentMap(this, &GetDocument()); ignore_preload_none_ = false; InvokeLoadAlgorithm(); old_document.DecrementLoadEventDelayCount(); PausableObject::DidMoveToNewExecutionContext(&GetDocument()); HTMLElement::DidMoveToNewDocument(old_document); }
0
75,706
CString CAuthBase::GetRemoteIP() const { if (m_pSock) return m_pSock->GetRemoteIP(); return ""; }
0
206,353
void webViewEnterFullscreen(WebKitWebView* webView, Node* node) { if (!node->hasTagName(HTMLNames::videoTag)) return; #if ENABLE(VIDEO) HTMLMediaElement* videoElement = static_cast<HTMLMediaElement*>(node); WebKitWebViewPrivate* priv = webView->priv; if (priv->fullscreenVideoController) priv->fullscreenVideoController->exitFullscreen(); priv->fullscreenVideoController = new FullscreenVideoController; priv->fullscreenVideoController->setMediaElement(videoElement); priv->fullscreenVideoController->enterFullscreen(); #endif }
0
325,041
static void xen_pci_passthrough_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); k->realize = xen_pt_realize; k->exit = xen_pt_unregister_device; k->config_read = xen_pt_pci_read_config; k->config_write = xen_pt_pci_write_config; set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->desc = "Assign an host PCI device with Xen"; dc->props = xen_pci_passthrough_properties; };
1
95,357
uint32_t millis(void) { return (((uint32_t)TIM6->CNT) + (__90_ms * 90)); }
0
360,677
_g_key_file_save_to_gfile (GKeyFile *key_file, GFile *file, GError **error) { char *data; gsize len; data = g_key_file_to_data (key_file, &len, error); if (data == NULL) { return FALSE; } if (!g_file_replace_contents (file, data, len, NULL, FALSE, G_FILE_CREATE_NONE, NULL, NULL, error)) { g_free (data); return FALSE; } g_free (data); return TRUE; }
0
341,887
static void RENAME(yuv2rgb565_1)(SwsContext *c, const int16_t *buf0, const int16_t *ubuf[2], const int16_t *bguf[2], const int16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int y) { const int16_t *ubuf0 = ubuf[0], *ubuf1 = ubuf[1]; const int16_t *buf1= buf0; //FIXME needed for RGB1/BGR1 if (uvalpha < 2048) { // note this is not correct (shifts chrominance by 0.5 pixels) but it is a bit faster __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2RGB1(%%REGBP, %5) "pxor %%mm7, %%mm7 \n\t" /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ #ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%5), %%mm2 \n\t" "paddusb "GREEN_DITHER"(%5), %%mm4 \n\t" "paddusb "RED_DITHER"(%5), %%mm5 \n\t" #endif WRITERGB16(%%REGb, 8280(%5), %%REGBP) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest), "a" (&c->redDither) ); } else { __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2RGB1b(%%REGBP, %5) "pxor %%mm7, %%mm7 \n\t" /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ #ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%5), %%mm2 \n\t" "paddusb "GREEN_DITHER"(%5), %%mm4 \n\t" "paddusb "RED_DITHER"(%5), %%mm5 \n\t" #endif WRITERGB16(%%REGb, 8280(%5), %%REGBP) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest), "a" (&c->redDither) ); } }
1
499,292
static int acl_check_spn(TALLOC_CTX *mem_ctx, struct ldb_module *module, struct ldb_request *req, const struct ldb_message_element *el, struct security_descriptor *sd, struct dom_sid *sid, const struct dsdb_attribute *attr, const struct dsdb_class *objectclass) { int ret; unsigned int i; TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); struct ldb_context *ldb = ldb_module_get_ctx(module); struct ldb_result *acl_res; struct ldb_result *netbios_res; struct ldb_dn *partitions_dn = samdb_partitions_dn(ldb, tmp_ctx); uint32_t userAccountControl; const char *samAccountName; const char *dnsHostName; const char *netbios_name; struct GUID ntds; char *ntds_guid = NULL; static const char *acl_attrs[] = { "samAccountName", "dnsHostName", "userAccountControl", NULL }; static const char *netbios_attrs[] = { "nETBIOSName", NULL }; /* if we have wp, we can do whatever we like */ if (acl_check_access_on_attribute(module, tmp_ctx, sd, sid, SEC_ADS_WRITE_PROP, attr, objectclass) == LDB_SUCCESS) { talloc_free(tmp_ctx); return LDB_SUCCESS; } ret = acl_check_extended_right(tmp_ctx, module, req, objectclass, sd, acl_user_token(module), GUID_DRS_VALIDATE_SPN, SEC_ADS_SELF_WRITE, sid); if (ret != LDB_SUCCESS) { dsdb_acl_debug(sd, acl_user_token(module), req->op.mod.message->dn, true, 10); talloc_free(tmp_ctx); return ret; } /* * If we have "validated write spn", allow delete of any * existing value (this keeps constrained delete to the same * rules as unconstrained) */ if (req->operation == LDB_MODIFY) { /* * If not add or replace (eg delete), * return success */ if (LDB_FLAG_MOD_TYPE(el->flags) != LDB_FLAG_MOD_ADD && LDB_FLAG_MOD_TYPE(el->flags) != LDB_FLAG_MOD_REPLACE) { talloc_free(tmp_ctx); return LDB_SUCCESS; } } ret = dsdb_module_search_dn(module, tmp_ctx, &acl_res, req->op.mod.message->dn, acl_attrs, DSDB_FLAG_NEXT_MODULE | DSDB_FLAG_AS_SYSTEM | DSDB_SEARCH_SHOW_RECYCLED, req); if (ret != LDB_SUCCESS) { talloc_free(tmp_ctx); return ret; } userAccountControl = ldb_msg_find_attr_as_uint(acl_res->msgs[0], "userAccountControl", 0); dnsHostName = ldb_msg_find_attr_as_string(acl_res->msgs[0], "dnsHostName", NULL); samAccountName = ldb_msg_find_attr_as_string(acl_res->msgs[0], "samAccountName", NULL); ret = dsdb_module_search(module, tmp_ctx, &netbios_res, partitions_dn, LDB_SCOPE_ONELEVEL, netbios_attrs, DSDB_FLAG_NEXT_MODULE | DSDB_FLAG_AS_SYSTEM, req, "(ncName=%s)", ldb_dn_get_linearized(ldb_get_default_basedn(ldb))); netbios_name = ldb_msg_find_attr_as_string(netbios_res->msgs[0], "nETBIOSName", NULL); /* NTDSDSA objectGuid of object we are checking SPN for */ if (userAccountControl & (UF_SERVER_TRUST_ACCOUNT | UF_PARTIAL_SECRETS_ACCOUNT)) { ret = dsdb_module_find_ntdsguid_for_computer(module, tmp_ctx, req->op.mod.message->dn, &ntds, req); if (ret != LDB_SUCCESS) { ldb_asprintf_errstring(ldb, "Failed to find NTDSDSA objectGuid for %s: %s", ldb_dn_get_linearized(req->op.mod.message->dn), ldb_strerror(ret)); talloc_free(tmp_ctx); return LDB_ERR_OPERATIONS_ERROR; } ntds_guid = GUID_string(tmp_ctx, &ntds); } for (i=0; i < el->num_values; i++) { ret = acl_validate_spn_value(tmp_ctx, ldb, (char *)el->values[i].data, userAccountControl, samAccountName, dnsHostName, netbios_name, ntds_guid); if (ret != LDB_SUCCESS) { talloc_free(tmp_ctx); return ret; } } talloc_free(tmp_ctx); return LDB_SUCCESS; }
0
32,879
void fuse_queue_forget(struct fuse_conn *fc, struct fuse_forget_link *forget, u64 nodeid, u64 nlookup) { struct fuse_iqueue *fiq = &fc->iq; forget->forget_one.nodeid = nodeid; forget->forget_one.nlookup = nlookup; spin_lock(&fiq->waitq.lock); if (fiq->connected) { fiq->forget_list_tail->next = forget; fiq->forget_list_tail = forget; wake_up_locked(&fiq->waitq); kill_fasync(&fiq->fasync, SIGIO, POLL_IN); } else { kfree(forget); } spin_unlock(&fiq->waitq.lock); }
0
8,822
static void jsiDumpInstr(Jsi_Interp *interp, jsi_Pstate *ps, Jsi_Value *_this, jsi_TryList *trylist, jsi_OpCode *ip, Jsi_OpCodes *opcodes) { int i; char buf[200]; jsi_code_decode(interp, ip, ip - opcodes->codes, buf, sizeof(buf)); Jsi_Printf(interp, jsi_Stderr, "%p: %-30.200s : THIS=%s, STACK=[", ip, buf, jsi_evalprint(_this)); for (i = 0; i < interp->framePtr->Sp; ++i) { Jsi_Printf(interp, jsi_Stderr, "%s%s", (i>0?", ":""), jsi_evalprint(_jsi_STACKIDX(i))); } Jsi_Printf(interp, jsi_Stderr, "]"); if (ip->fname) { const char *fn = ip->fname, *cp = Jsi_Strrchr(fn, '/'); if (cp) fn = cp+1; Jsi_Printf(interp, jsi_Stderr, ", %s:%d", fn, ip->Line); } Jsi_Printf(interp, jsi_Stderr, "\n"); jsi_TryList *tlt = trylist; for (i = 0; tlt; tlt = tlt->next) i++; if (ps->last_exception) Jsi_Printf(interp, jsi_Stderr, "TL: %d, excpt: %s\n", i, jsi_evalprint(ps->last_exception)); }
1
299,111
validate_keywords(asdl_seq *keywords) { Py_ssize_t i; for (i = 0; i < asdl_seq_LEN(keywords); i++) if (!validate_expr(((keyword_ty)asdl_seq_GET(keywords, i))->value, Load)) return 0; return 1; }
0
190,871
WebPluginDelegatePepper::~WebPluginDelegatePepper() { DestroyInstance(); }
0
371,403
ZrtpPacketCommit* ZRtp::prepareCommit(ZrtpPacketHello *hello, uint32_t* errMsg) { // Save data before detailed checks - may aid in analysing problems peerClientId.assign((char*)hello->getClientId(), ZRTP_WORD_SIZE * 4); memcpy(peerHelloVersion, hello->getVersion(), ZRTP_WORD_SIZE); peerHelloVersion[ZRTP_WORD_SIZE] = 0; // Save our peer's (presumably the Responder) ZRTP id memcpy(peerZid, hello->getZid(), ZID_SIZE); if (memcmp(peerZid, ownZid, ZID_SIZE) == 0) { // peers have same ZID???? *errMsg = EqualZIDHello; return NULL; } memcpy(peerH3, hello->getH3(), HASH_IMAGE_SIZE); int32_t helloLen = hello->getLength() * ZRTP_WORD_SIZE; // calculate hash over the received Hello packet - is peer's hello hash. // Use implicit hash algorithm hashFunctionImpl((unsigned char*)hello->getHeaderBase(), helloLen, peerHelloHash); sendInfo(Info, InfoHelloReceived); /* * The Following section extracts the algorithm from the peer's Hello * packet. Always the preferend offered algorithms are * used. If the received Hello does not contain algo specifiers * or offers only unsupported optional algos then replace * these with mandatory algos and put them into the Commit packet. * Refer to the findBest*() functions. * If this is a MultiStream ZRTP object then do not get the cipher, * authentication from hello packet but use the pre-initialized values * as proposed by the standard. If we switch to responder mode the * commit packet may contain other algos - see function * prepareConfirm2MultiStream(...). */ sasType = findBestSASType(hello); if (!multiStream) { pubKey = findBestPubkey(hello); // Check for public key algorithm first, sets 'hash' as well if (hash == NULL) { *errMsg = UnsuppHashType; return NULL; } if (cipher == NULL) // public key selection may have set the cipher already cipher = findBestCipher(hello, pubKey); authLength = findBestAuthLen(hello); multiStreamAvailable = checkMultiStream(hello); } else { if (checkMultiStream(hello)) { return prepareCommitMultiStream(hello); } else { // we are in multi-stream but peer does not offer multi-stream // return error code to other party - unsupported PK, must be Mult *errMsg = UnsuppPKExchange; return NULL; } } setNegotiatedHash(hash); // Modify here when introducing new DH key agreement, for example // elliptic curves. dhContext = new ZrtpDH(pubKey->getName()); dhContext->generatePublicKey(); dhContext->getPubKeyBytes(pubKeyBytes); sendInfo(Info, InfoCommitDHGenerated); // Prepare IV data that we will use during confirm packet encryption. randomZRTP(randomIV, sizeof(randomIV)); /* * Prepare our DHPart2 packet here. Required to compute HVI. If we stay * in Initiator role then we reuse this packet later in prepareDHPart2(). * To create this DH packet we have to compute the retained secret ids, * thus get our peer's retained secret data first. */ zidRec = getZidCacheInstance()->getRecord(peerZid); //Compute the Initator's and Responder's retained secret ids. computeSharedSecretSet(zidRec); // Check if a PBX application set the MitM flag. mitmSeen = hello->isMitmMode(); signSasSeen = hello->isSasSign(); // Construct a DHPart2 message (Initiator's DH message). This packet // is required to compute the HVI (Hash Value Initiator), refer to // chapter 5.4.1.1. // Fill the values in the DHPart2 packet zrtpDH2.setPubKeyType(pubKey->getName()); zrtpDH2.setMessageType((uint8_t*)DHPart2Msg); zrtpDH2.setRs1Id(rs1IDi); zrtpDH2.setRs2Id(rs2IDi); zrtpDH2.setAuxSecretId(auxSecretIDi); zrtpDH2.setPbxSecretId(pbxSecretIDi); zrtpDH2.setPv(pubKeyBytes); zrtpDH2.setH1(H1); int32_t len = zrtpDH2.getLength() * ZRTP_WORD_SIZE; // Compute HMAC over DH2, excluding the HMAC field (HMAC_SIZE) // and store in DH2. Key to HMAC is H0, use HASH_IMAGE_SIZE bytes only. // Must use implicit HMAC functions. uint8_t hmac[IMPL_MAX_DIGEST_LENGTH]; uint32_t macLen; hmacFunctionImpl(H0, HASH_IMAGE_SIZE, (uint8_t*)zrtpDH2.getHeaderBase(), len-(HMAC_SIZE), hmac, &macLen); zrtpDH2.setHMAC(hmac); // Compute the HVI, refer to chapter 5.4.1.1 of the specification computeHvi(&zrtpDH2, hello); zrtpCommit.setZid(ownZid); zrtpCommit.setHashType((uint8_t*)hash->getName()); zrtpCommit.setCipherType((uint8_t*)cipher->getName()); zrtpCommit.setAuthLen((uint8_t*)authLength->getName()); zrtpCommit.setPubKeyType((uint8_t*)pubKey->getName()); zrtpCommit.setSasType((uint8_t*)sasType->getName()); zrtpCommit.setHvi(hvi); zrtpCommit.setH2(H2); len = zrtpCommit.getLength() * ZRTP_WORD_SIZE; // Compute HMAC over Commit, excluding the HMAC field (HMAC_SIZE) // and store in Hello. Key to HMAC is H1, use HASH_IMAGE_SIZE bytes only. // Must use implicit HMAC functions. hmacFunctionImpl(H1, HASH_IMAGE_SIZE, (uint8_t*)zrtpCommit.getHeaderBase(), len-(HMAC_SIZE), hmac, &macLen); zrtpCommit.setHMAC(hmac); // hash first messages to produce overall message hash // First the Responder's Hello message, second the Commit (always Initator's). // Must use negotiated hash. msgShaContext = createHashCtx(); hashCtxFunction(msgShaContext, (unsigned char*)hello->getHeaderBase(), helloLen); hashCtxFunction(msgShaContext, (unsigned char*)zrtpCommit.getHeaderBase(), len); // store Hello data temporarily until we can check HMAC after receiving Commit as // Responder or DHPart1 as Initiator storeMsgTemp(hello); return &zrtpCommit; }
0
66,492
template<typename t> CImg<T>& solve(const CImg<t>& A) { if (_depth!=1 || _spectrum!=1 || _height!=A._height || A._depth!=1 || A._spectrum!=1) throw CImgArgumentException(_cimg_instance "solve(): Instance and specified matrix (%u,%u,%u,%u,%p) have " "incompatible dimensions.", cimg_instance, A._width,A._height,A._depth,A._spectrum,A._data); typedef _cimg_Ttfloat Ttfloat; if (A.size()==1) return (*this)/=A[0]; if (A._width==2 && A._height==2 && _height==2) { const double a = (double)A[0], b = (double)A[1], c = (double)A[2], d = (double)A[3], fa = std::fabs(a), fb = std::fabs(b), fc = std::fabs(c), fd = std::fabs(d), det = a*d - b*c, fM = cimg::max(fa,fb,fc,fd); if (fM==fa) cimg_forX(*this,k) { const double u = (double)(*this)(k,0), v = (double)(*this)(k,1), y = (a*v - c*u)/det; (*this)(k,0) = (T)((u - b*y)/a); (*this)(k,1) = (T)y; } else if (fM==fc) cimg_forX(*this,k) { const double u = (double)(*this)(k,0), v = (double)(*this)(k,1), y = (a*v - c*u)/det; (*this)(k,0) = (T)((v - d*y)/c); (*this)(k,1) = (T)y; } else if (fM==fb) cimg_forX(*this,k) { const double u = (double)(*this)(k,0), v = (double)(*this)(k,1), x = (d*u - b*v)/det; (*this)(k,0) = (T)x; (*this)(k,1) = (T)((u - a*x)/b); } else cimg_forX(*this,k) { const double u = (double)(*this)(k,0), v = (double)(*this)(k,1), x = (d*u - b*v)/det; (*this)(k,0) = (T)x; (*this)(k,1) = (T)((v - c*x)/d); } return *this; } if (_width!=1) { // Process column-by-column CImg<T> res(_width,A._width); cimg_forX(*this,i) res.draw_image(i,get_column(i).solve(A)); return res.move_to(*this); } if (A._width==A._height) { // Square linear system #ifdef cimg_use_lapack char TRANS = 'N'; int INFO, N = _height, LWORK = 4*N, *const IPIV = new int[N]; Ttfloat *const lapA = new Ttfloat[N*N], *const lapB = new Ttfloat[N], *const WORK = new Ttfloat[LWORK]; cimg_forXY(A,k,l) lapA[k*N + l] = (Ttfloat)(A(k,l)); cimg_forY(*this,i) lapB[i] = (Ttfloat)((*this)(i)); cimg::getrf(N,lapA,IPIV,INFO); if (INFO) cimg::warn(_cimg_instance "solve(): LAPACK library function dgetrf_() returned error code %d.", cimg_instance, INFO); if (!INFO) { cimg::getrs(TRANS,N,lapA,IPIV,lapB,INFO); if (INFO) cimg::warn(_cimg_instance "solve(): LAPACK library function dgetrs_() returned error code %d.", cimg_instance, INFO); } if (!INFO) cimg_forY(*this,i) (*this)(i) = (T)(lapB[i]); else fill(0); delete[] IPIV; delete[] lapA; delete[] lapB; delete[] WORK; #else CImg<Ttfloat> lu(A,false); CImg<Ttfloat> indx; bool d; lu._LU(indx,d); _solve(lu,indx); #endif } else { // Least-square solution for non-square systems #ifdef cimg_use_lapack char TRANS = 'N'; int INFO, N = A._width, M = A._height, LWORK = -1, LDA = M, LDB = M, NRHS = _width; Ttfloat WORK_QUERY; Ttfloat * const lapA = new Ttfloat[M*N], * const lapB = new Ttfloat[M*NRHS]; cimg::sgels(TRANS, M, N, NRHS, lapA, LDA, lapB, LDB, &WORK_QUERY, LWORK, INFO); LWORK = (int) WORK_QUERY; Ttfloat *const WORK = new Ttfloat[LWORK]; cimg_forXY(A,k,l) lapA[k*M + l] = (Ttfloat)(A(k,l)); cimg_forXY(*this,k,l) lapB[k*M + l] = (Ttfloat)((*this)(k,l)); cimg::sgels(TRANS, M, N, NRHS, lapA, LDA, lapB, LDB, WORK, LWORK, INFO); if (INFO != 0) cimg::warn(_cimg_instance "solve(): LAPACK library function sgels() returned error code %d.", cimg_instance, INFO); assign(NRHS, N); if (!INFO) cimg_forXY(*this,k,l) (*this)(k,l) = (T)lapB[k*M + l]; else assign(A.get_pseudoinvert()*(*this)); delete[] lapA; delete[] lapB; delete[] WORK; #else assign(A.get_pseudoinvert()*(*this)); #endif } return *this;
0
92,378
static struct snd_seq_client_port *get_client_port(struct snd_seq_addr *addr, struct snd_seq_client **cp) { struct snd_seq_client_port *p; *cp = snd_seq_client_use_ptr(addr->client); if (*cp) { p = snd_seq_port_use_ptr(*cp, addr->port); if (! p) { snd_seq_client_unlock(*cp); *cp = NULL; } return p; } return NULL; }
0
125,967
TEST_F(TestDelegate, TestCopyFromBuffer) { delegate_ = std::unique_ptr<SimpleDelegate>(new SimpleDelegate({0, 1, 2})); TfLiteDelegate* delegate = delegate_->get_tf_lite_delegate(); interpreter_->ModifyGraphWithDelegate(delegate); constexpr int kOutputTensorIndex = 3; TfLiteTensor* tensor = interpreter_->tensor(kOutputTensorIndex); std::vector<float> floats = {1.0f, 2.0f, 3.0f}; memcpy(interpreter_->typed_tensor<float>(0), floats.data(), floats.size() * sizeof(float)); memcpy(interpreter_->typed_tensor<float>(1), floats.data(), floats.size() * sizeof(float)); // Before setting the buffer handle, the tensor's `delegate` is already set // because it will be written by the delegate. ASSERT_EQ(tensor->delegate, delegate); ASSERT_EQ(tensor->buffer_handle, kTfLiteNullBufferHandle); TfLiteBufferHandle handle = AllocateBufferHandle(); TfLiteStatus status = interpreter_->SetBufferHandle(kOutputTensorIndex, handle, delegate); interpreter_->Invoke(); ASSERT_EQ(status, kTfLiteOk); EXPECT_EQ(tensor->delegate, delegate); EXPECT_EQ(tensor->buffer_handle, handle); for (int i = 0; i < tensor->dims->data[0]; ++i) { ASSERT_EQ(tensor->data.f[i], 6.0f); } }
0
390,208
Parameters& Security::use_parms() { return parms_; }
0
448,659
tiff_set_cmyk_fields(gx_device_printer *pdev, TIFF *tif, short bits_per_sample, uint16 compression, long max_strip_size) { TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bits_per_sample); TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_SEPARATED); TIFFSetField(tif, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB); TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 4); tiff_set_compression(pdev, tif, compression, max_strip_size); }
0
407,720
ldns_rdf2buffer_str_period(ldns_buffer *output, const ldns_rdf *rdf) { /* period is the number of seconds */ if (ldns_rdf_size(rdf) != 4) { return LDNS_STATUS_WIRE_RDATA_ERR; } ldns_buffer_printf(output, "%u", ldns_read_uint32(ldns_rdf_data(rdf))); return ldns_buffer_status(output); }
0
293,160
static int qrtr_tun_send(struct qrtr_endpoint *ep, struct sk_buff *skb) { struct qrtr_tun *tun = container_of(ep, struct qrtr_tun, ep); skb_queue_tail(&tun->queue, skb); /* wake up any blocking processes, waiting for new data */ wake_up_interruptible(&tun->readq); return 0; }
0
133,430
void jbd2_journal_lock_updates(journal_t *journal) { jbd2_might_wait_for_commit(journal); write_lock(&journal->j_state_lock); ++journal->j_barrier_count; /* Wait until there are no reserved handles */ if (atomic_read(&journal->j_reserved_credits)) { write_unlock(&journal->j_state_lock); wait_event(journal->j_wait_reserved, atomic_read(&journal->j_reserved_credits) == 0); write_lock(&journal->j_state_lock); } /* Wait until there are no running t_updates */ jbd2_journal_wait_updates(journal); write_unlock(&journal->j_state_lock); /* * We have now established a barrier against other normal updates, but * we also need to barrier against other jbd2_journal_lock_updates() calls * to make sure that we serialise special journal-locked operations * too. */ mutex_lock(&journal->j_barrier); }
0
322,531
static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size, AVSubtitle *sub) { DVBSubContext *ctx = avctx->priv_data; DVBSubDisplayDefinition *display_def = ctx->display_definition; DVBSubRegion *region; DVBSubRegionDisplay *display; AVSubtitleRect *rect; DVBSubCLUT *clut; uint32_t *clut_table; int i; int offset_x=0, offset_y=0; sub->rects = NULL; sub->start_display_time = 0; sub->end_display_time = ctx->time_out * 1000; sub->format = 0; if (display_def) { offset_x = display_def->x; offset_y = display_def->y; } sub->num_rects = ctx->display_list_size; if (sub->num_rects <= 0) return AVERROR_INVALIDDATA; sub->rects = av_mallocz_array(sub->num_rects * sub->num_rects, sizeof(*sub->rects)); if (!sub->rects) return AVERROR(ENOMEM); i = 0; for (display = ctx->display_list; display; display = display->next) { region = get_region(ctx, display->region_id); rect = sub->rects[i]; if (!region) continue; rect->x = display->x_pos + offset_x; rect->y = display->y_pos + offset_y; rect->w = region->width; rect->h = region->height; rect->nb_colors = 16; rect->type = SUBTITLE_BITMAP; rect->linesize[0] = region->width; clut = get_clut(ctx, region->clut); if (!clut) clut = &default_clut; switch (region->depth) { case 2: clut_table = clut->clut4; break; case 8: clut_table = clut->clut256; break; case 4: default: clut_table = clut->clut16; break; } rect->data[1] = av_mallocz(AVPALETTE_SIZE); if (!rect->data[1]) { av_free(sub->rects); return AVERROR(ENOMEM); } memcpy(rect->data[1], clut_table, (1 << region->depth) * sizeof(uint32_t)); rect->data[0] = av_malloc(region->buf_size); if (!rect->data[0]) { av_free(rect->data[1]); av_free(sub->rects); return AVERROR(ENOMEM); } memcpy(rect->data[0], region->pbuf, region->buf_size); #if FF_API_AVPICTURE FF_DISABLE_DEPRECATION_WARNINGS { int j; for (j = 0; j < 4; j++) { rect->pict.data[j] = rect->data[j]; rect->pict.linesize[j] = rect->linesize[j]; } } FF_ENABLE_DEPRECATION_WARNINGS #endif i++; } sub->num_rects = i; #ifdef DEBUG save_display_set(ctx); #endif return 1; }
1
492,034
int LibRaw::unpack(void) { CHECK_ORDER_HIGH(LIBRAW_PROGRESS_LOAD_RAW); CHECK_ORDER_LOW(LIBRAW_PROGRESS_IDENTIFY); try { if(!libraw_internal_data.internal_data.input) return LIBRAW_INPUT_CLOSED; RUN_CALLBACK(LIBRAW_PROGRESS_LOAD_RAW,0,2); if (O.shot_select >= P1.raw_count) return LIBRAW_REQUEST_FOR_NONEXISTENT_IMAGE; if(!load_raw) return LIBRAW_UNSPECIFIED_ERROR; // already allocated ? if(imgdata.image) { free(imgdata.image); imgdata.image = 0; } if(imgdata.rawdata.raw_alloc) { free(imgdata.rawdata.raw_alloc); imgdata.rawdata.raw_alloc = 0; } if (libraw_internal_data.unpacker_data.meta_length) { libraw_internal_data.internal_data.meta_data = (char *) malloc (libraw_internal_data.unpacker_data.meta_length); merror (libraw_internal_data.internal_data.meta_data, "LibRaw::unpack()"); } libraw_decoder_info_t decoder_info; get_decoder_info(&decoder_info); int save_iwidth = S.iwidth, save_iheight = S.iheight, save_shrink = IO.shrink; int rwidth = S.raw_width, rheight = S.raw_height; if( !IO.fuji_width) { // adjust non-Fuji allocation if(rwidth < S.width + S.left_margin) rwidth = S.width + S.left_margin; if(rheight < S.height + S.top_margin) rheight = S.height + S.top_margin; } imgdata.rawdata.raw_image = 0; imgdata.rawdata.color4_image = 0; imgdata.rawdata.color3_image = 0; imgdata.rawdata.float_image = 0; imgdata.rawdata.float3_image = 0; #ifdef USE_DNGSDK if(imgdata.idata.dng_version && dnghost && valid_for_dngsdk() && load_raw != &LibRaw::pentax_4shot_load_raw) { int rr = try_dngsdk(); } #endif #ifdef USE_RAWSPEED if(!raw_was_read()) { int rawspeed_enabled = 1; if(imgdata.idata.dng_version && libraw_internal_data.unpacker_data.tiff_samples == 2) rawspeed_enabled = 0; if(imgdata.idata.raw_count > 1) rawspeed_enabled = 0; // Disable rawspeed for double-sized Oly files if(!strncasecmp(imgdata.idata.make,"Olympus",7) && ( ( imgdata.sizes.raw_width > 6000) || !strncasecmp(imgdata.idata.model,"SH-2",4) || !strncasecmp(imgdata.idata.model,"SH-3",4) || !strncasecmp(imgdata.idata.model,"TG-4",4)) ) rawspeed_enabled = 0; if(imgdata.idata.dng_version && imgdata.idata.filters==0 && libraw_internal_data.unpacker_data.tiff_bps == 8) // Disable for 8 bit rawspeed_enabled = 0; if(load_raw == &LibRaw::packed_load_raw && !strncasecmp(imgdata.idata.make,"Nikon",5) && !strncasecmp(imgdata.idata.model,"E",1) ) rawspeed_enabled = 0; // RawSpeed Supported, if(O.use_rawspeed && rawspeed_enabled && !(is_sraw() && (O.raw_processing_options & (LIBRAW_PROCESSING_SRAW_NO_RGB | LIBRAW_PROCESSING_SRAW_NO_INTERPOLATE))) && (decoder_info.decoder_flags & LIBRAW_DECODER_TRYRAWSPEED) && _rawspeed_camerameta) { int rr = try_rawspeed(); } } #endif if(!raw_was_read()) //RawSpeed failed or not run { // Not allocated on RawSpeed call, try call LibRaow int zero_rawimage = 0; if(decoder_info.decoder_flags & LIBRAW_DECODER_OWNALLOC) { // x3f foveon decoder and DNG float // Do nothing! Decoder will allocate data internally } else if(imgdata.idata.filters || P1.colors == 1) // Bayer image or single color -> decode to raw_image { imgdata.rawdata.raw_alloc = malloc(rwidth*(rheight+8)*sizeof(imgdata.rawdata.raw_image[0])); imgdata.rawdata.raw_image = (ushort*) imgdata.rawdata.raw_alloc; if(!S.raw_pitch) S.raw_pitch = S.raw_width*2; // Bayer case, not set before } else // NO LEGACY FLAG if (decoder_info.decoder_flags & LIBRAW_DECODER_LEGACY) { // sRAW and old Foveon decoders only, so extra buffer size is just 1/4 S.iwidth = S.width; S.iheight= S.height; IO.shrink = 0; if(!S.raw_pitch) S.raw_pitch = (decoder_info.decoder_flags & LIBRAW_DECODER_LEGACY_WITH_MARGINS) ? S.raw_width*8 : S.width*8; // allocate image as temporary buffer, size imgdata.rawdata.raw_alloc = 0; imgdata.image = (ushort (*)[4]) calloc(unsigned(MAX(S.width,S.raw_width))*unsigned(MAX(S.height,S.raw_height)),sizeof(*imgdata.image)); if(!(decoder_info.decoder_flags & LIBRAW_DECODER_ADOBECOPYPIXEL)) { imgdata.rawdata.raw_image = (ushort*) imgdata.image ; zero_rawimage = 1; } } ID.input->seek(libraw_internal_data.unpacker_data.data_offset, SEEK_SET); unsigned m_save = C.maximum; if(load_raw == &LibRaw::unpacked_load_raw && !strcasecmp(imgdata.idata.make,"Nikon")) C.maximum=65535; (this->*load_raw)(); if(zero_rawimage) imgdata.rawdata.raw_image = 0; if(load_raw == &LibRaw::unpacked_load_raw && !strcasecmp(imgdata.idata.make,"Nikon")) C.maximum = m_save; if(decoder_info.decoder_flags & LIBRAW_DECODER_OWNALLOC) { // x3f foveon decoder only: do nothing } else if (!(imgdata.idata.filters || P1.colors == 1) ) // legacy decoder, ownalloc handled above { // successfully decoded legacy image, attach image to raw_alloc imgdata.rawdata.raw_alloc = imgdata.image; imgdata.rawdata.color4_image = (ushort (*)[4]) imgdata.rawdata.raw_alloc; imgdata.image = 0; // Restore saved values. Note: Foveon have masked frame // Other 4-color legacy data: no borders if(!(libraw_internal_data.unpacker_data.load_flags & 256)) { S.raw_width = S.width; S.left_margin = 0; S.raw_height = S.height; S.top_margin = 0; } } } if(imgdata.rawdata.raw_image) crop_masked_pixels(); // calculate black levels // recover image sizes S.iwidth = save_iwidth; S.iheight = save_iheight; IO.shrink = save_shrink; // adjust black to possible maximum unsigned int i = C.cblack[3]; unsigned int c; for(c=0;c<3;c++) if (i > C.cblack[c]) i = C.cblack[c]; for (c=0;c<4;c++) C.cblack[c] -= i; C.black += i; // Save color,sizes and internal data into raw_image fields memmove(&imgdata.rawdata.color,&imgdata.color,sizeof(imgdata.color)); memmove(&imgdata.rawdata.sizes,&imgdata.sizes,sizeof(imgdata.sizes)); memmove(&imgdata.rawdata.iparams,&imgdata.idata,sizeof(imgdata.idata)); memmove(&imgdata.rawdata.ioparams,&libraw_internal_data.internal_output_params,sizeof(libraw_internal_data.internal_output_params)); SET_PROC_FLAG(LIBRAW_PROGRESS_LOAD_RAW); RUN_CALLBACK(LIBRAW_PROGRESS_LOAD_RAW,1,2); return 0; } catch ( LibRaw_exceptions err) { EXCEPTION_HANDLER(err); } catch (std::exception ee) { EXCEPTION_HANDLER(LIBRAW_EXCEPTION_IO_CORRUPT); } }
0
392,585
gdAlphaOverlayColor( int src, int dst, int max ) { /* this function implements the algorithm * * for dst[rgb] < 0.5, * c[rgb] = 2.src[rgb].dst[rgb] * and for dst[rgb] > 0.5, * c[rgb] = -2.src[rgb].dst[rgb] + 2.dst[rgb] + 2.src[rgb] - 1 * */ dst = dst << 1; if( dst > max ) { /* in the "light" zone */ return dst + (src << 1) - (dst * src / max) - max; } else { /* in the "dark" zone */ return dst * src / max; } }
0
47,316
static Jsi_RC CDataInfoCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, Jsi_Value **ret, Jsi_Func *funcPtr) { UdcGet(cd, _this, funcPtr); Jsi_StructSpec *sl = cd->sl; Jsi_DString dStr= {}; const char *sptr = Jsi_DSPrintf(&dStr, "{struct:\"%s\", label:\"%s\"}", sl->name, cd->help?cd->help:""); Jsi_RC rc = JSI_ERROR; if (!sptr) return Jsi_LogError("format failed"); else rc = Jsi_JSONParse(interp, sptr, ret, 0); Jsi_DSFree(&dStr); if (rc != JSI_OK) return rc; Jsi_Obj *sobj; Jsi_Value *svalue; if (cd->sf) { sobj = Jsi_ObjNewType(interp, JSI_OT_ARRAY); svalue = Jsi_ValueMakeObject(interp, NULL, sobj); jsi_DumpOptionSpecs(interp, sobj,(Jsi_OptionSpec*) cd->sf); sobj = (*ret)->d.obj; Jsi_ObjInsert(interp, sobj, "spec", svalue, 0); } if (cd->slKey) { sobj = Jsi_ObjNewType(interp, JSI_OT_ARRAY); svalue = Jsi_ValueMakeObject(interp, NULL, sobj); jsi_DumpOptionSpecs(interp, sobj, (Jsi_OptionSpec*)cd->slKey); sobj = (*ret)->d.obj; Jsi_ObjInsert(interp, sobj, "keySpec", svalue, 0); } return JSI_OK; }
0
434,840
filter_show_space(fz_context *ctx, pdf_filter_processor *p, float tadj) { filter_gstate *gstate = p->gstate; pdf_font_desc *fontdesc = gstate->pending.text.font; if (fontdesc->wmode == 0) p->tos.tm = fz_pre_translate(p->tos.tm, tadj * gstate->pending.text.scale, 0); else p->tos.tm = fz_pre_translate(p->tos.tm, 0, tadj); }
0
367,161
static int cap_inode_getxattr(struct dentry *dentry, const char *name) { return 0; }
0
458,554
zone_limit_update(struct conntrack *ct, int32_t zone, uint32_t limit) { int err = 0; ovs_mutex_lock(&ct->ct_lock); struct zone_limit *zl = zone_limit_lookup(ct, zone); if (zl) { zl->czl.limit = limit; VLOG_INFO("Changed zone limit of %u for zone %d", limit, zone); } else { err = zone_limit_create(ct, zone, limit); if (!err) { VLOG_INFO("Created zone limit of %u for zone %d", limit, zone); } else { VLOG_WARN("Request to create zone limit for invalid zone %d", zone); } } ovs_mutex_unlock(&ct->ct_lock); return err; }
0
188,717
ProcFreeGC(ClientPtr client) { GC *pGC; int rc; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupGC(&pGC, stuff->id, client, DixDestroyAccess); if (rc != Success) return rc; FreeResource(stuff->id, RT_NONE); return Success; }
0
237,332
bool HTMLButtonElement::isInteractiveContent() const { return true; }
0
220,630
explicit InterceptAndCancelDidCommitProvisionalLoad(WebContents* web_contents) : DidCommitProvisionalLoadInterceptor(web_contents) {}
0
321,422
xilinx_axienet_data_stream_push(StreamSlave *obj, uint8_t *buf, size_t size, uint32_t *hdr) { XilinxAXIEnetStreamSlave *ds = XILINX_AXI_ENET_DATA_STREAM(obj); XilinxAXIEnet *s = ds->enet; /* TX enable ? */ if (!(s->tc & TC_TX)) { return size; } /* Jumbo or vlan sizes ? */ if (!(s->tc & TC_JUM)) { if (size > 1518 && size <= 1522 && !(s->tc & TC_VLAN)) { return size; } } if (hdr[0] & 1) { unsigned int start_off = hdr[1] >> 16; unsigned int write_off = hdr[1] & 0xffff; uint32_t tmp_csum; uint16_t csum; tmp_csum = net_checksum_add(size - start_off, (uint8_t *)buf + start_off); /* Accumulate the seed. */ tmp_csum += hdr[2] & 0xffff; /* Fold the 32bit partial checksum. */ csum = net_checksum_finish(tmp_csum); /* Writeback. */ buf[write_off] = csum >> 8; buf[write_off + 1] = csum & 0xff; } qemu_send_packet(qemu_get_queue(s->nic), buf, size); s->stats.tx_bytes += size; s->regs[R_IS] |= IS_TX_COMPLETE; enet_update_irq(s); return size; }
0
62,471
eexec_line(unsigned char *line, int line_len) { int cs_start_len = strlen(cs_start); int pos; int first_space; int digits; int cut_newline = 0; /* append this data to the end of `save' if necessary */ if (save_len) { append_save(line, line_len); line = save; line_len = save_len; save_len = 0; } if (!line_len) return 0; /* Look for charstring start */ /* skip first word */ for (pos = 0; pos < line_len && isspace(line[pos]); pos++) ; while (pos < line_len && !isspace(line[pos])) pos++; if (pos >= line_len) goto not_charstring; /* skip spaces */ first_space = pos; while (pos < line_len && isspace(line[pos])) pos++; if (pos >= line_len || !isdigit(line[pos])) goto not_charstring; /* skip number */ digits = pos; while (pos < line_len && isdigit(line[pos])) pos++; /* check for subr (another number) */ if (pos < line_len - 1 && isspace(line[pos]) && isdigit(line[pos+1])) { first_space = pos; digits = pos + 1; for (pos = digits; pos < line_len && isdigit(line[pos]); pos++) ; } /* check for charstring start */ if (pos + 2 + cs_start_len < line_len && pos > digits && line[pos] == ' ' && strncmp((const char *)(line + pos + 1), cs_start, cs_start_len) == 0 && line[pos + 1 + cs_start_len] == ' ') { /* check if charstring is long enough */ int cs_len = atoi((const char *)(line + digits)); if (pos + 2 + cs_start_len + cs_len < line_len) { /* long enough! */ if (line[line_len - 1] == '\r') { line[line_len - 1] = '\n'; cut_newline = 1; } fprintf(ofp, "%.*s {\n", first_space, line); decrypt_charstring(line + pos + 2 + cs_start_len, cs_len); pos += 2 + cs_start_len + cs_len; fprintf(ofp, "\t}%.*s", line_len - pos, line + pos); return cut_newline; } else { /* not long enough! */ append_save(line, line_len); return 0; } } /* otherwise, just output the line */ not_charstring: /* 6.Oct.2003 - Werner Lemberg reports a stupid Omega font that behaves badly: a charstring definition follows "/Charstrings ... begin", ON THE SAME LINE. */ { const char *CharStrings = (const char *) oog_memstr(line, line_len, "/CharStrings ", 13); int crap, n; char should_be_slash = 0; if (CharStrings && sscanf(CharStrings + 12, " %d dict dup begin %c%n", &crap, &should_be_slash, &n) >= 2 && should_be_slash == '/') { int len = (CharStrings + 12 + n - 1) - (char *) line; fprintf(ofp, "%.*s\n", len, line); return eexec_line((unsigned char *) (CharStrings + 12 + n - 1), line_len - len); } } if (line[line_len - 1] == '\r') { line[line_len - 1] = '\n'; cut_newline = 1; } set_lenIV((char *)line); set_cs_start((char *)line); fprintf(ofp, "%.*s", line_len, line); /* look for `currentfile closefile' to see if we should stop decrypting */ if (oog_memstr(line, line_len, "currentfile closefile", 21) != 0) in_eexec = -1; return cut_newline; }
0
262,821
static void yam_set_uart(struct net_device *dev) { struct yam_port *yp = netdev_priv(dev); int divisor = 115200 / yp->baudrate; outb(0, IER(dev->base_addr)); outb(LCR_DLAB | LCR_BIT8, LCR(dev->base_addr)); outb(divisor, DLL(dev->base_addr)); outb(0, DLM(dev->base_addr)); outb(LCR_BIT8, LCR(dev->base_addr)); outb(PTT_OFF, MCR(dev->base_addr)); outb(0x00, FCR(dev->base_addr)); /* Flush pending irq */ inb(RBR(dev->base_addr)); inb(MSR(dev->base_addr)); /* Enable rx irq */ outb(ENABLE_RTXINT, IER(dev->base_addr)); }
0
123,175
static Jsi_RC freeFuncsTbl(Jsi_Interp *interp, Jsi_HashEntry *hPtr, void *ptr) { Jsi_Func *func = (Jsi_Func *)ptr; if (!func) return JSI_OK; SIGASSERT(func,FUNC); func->hPtr = NULL; jsi_FuncFree(interp, func); return JSI_OK; }
0
81,299
static uint get_table_structure(char *table, char *db, char *table_type, char *ignore_flag) { my_bool init=0, write_data, complete_insert; my_ulonglong num_fields; char *result_table, *opt_quoted_table; const char *insert_option; char name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3]; char table_buff2[NAME_LEN*2+3], query_buff[QUERY_LENGTH]; const char *show_fields_stmt= "SELECT `COLUMN_NAME` AS `Field`, " "`COLUMN_TYPE` AS `Type`, " "`IS_NULLABLE` AS `Null`, " "`COLUMN_KEY` AS `Key`, " "`COLUMN_DEFAULT` AS `Default`, " "`EXTRA` AS `Extra`, " "`COLUMN_COMMENT` AS `Comment` " "FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE " "TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'"; FILE *sql_file= md_result_file; int len; my_bool is_log_table; MYSQL_RES *result; MYSQL_ROW row; DBUG_ENTER("get_table_structure"); DBUG_PRINT("enter", ("db: %s table: %s", db, table)); *ignore_flag= check_if_ignore_table(table, table_type); complete_insert= 0; if ((write_data= !(*ignore_flag & IGNORE_DATA))) { complete_insert= opt_complete_insert; if (!insert_pat_inited) { insert_pat_inited= 1; init_dynamic_string_checked(&insert_pat, "", 1024, 1024); } else dynstr_set_checked(&insert_pat, ""); } insert_option= (opt_ignore ? " IGNORE " : ""); verbose_msg("-- Retrieving table structure for table %s...\n", table); len= my_snprintf(query_buff, sizeof(query_buff), "SET SQL_QUOTE_SHOW_CREATE=%d", (opt_quoted || opt_keywords)); if (!create_options) my_stpcpy(query_buff+len, "/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */"); result_table= quote_name(table, table_buff, 1); opt_quoted_table= quote_name(table, table_buff2, 0); if (opt_order_by_primary) order_by= primary_key_fields(result_table); if (!opt_xml && !mysql_query_with_error_report(mysql, 0, query_buff)) { /* using SHOW CREATE statement */ if (!opt_no_create_info) { /* Make an sql-file, if path was given iow. option -T was given */ char buff[20+FN_REFLEN]; MYSQL_FIELD *field; my_snprintf(buff, sizeof(buff), "show create table %s", result_table); if (switch_character_set_results(mysql, "binary") || mysql_query_with_error_report(mysql, &result, buff) || switch_character_set_results(mysql, default_charset)) DBUG_RETURN(0); if (path) { if (!(sql_file= open_sql_file_for_table(table, O_WRONLY))) DBUG_RETURN(0); write_header(sql_file, db); } if (strcmp (table_type, "VIEW") == 0) /* view */ print_comment(sql_file, 0, "\n--\n-- Temporary table structure for view %s\n--\n\n", result_table); else print_comment(sql_file, 0, "\n--\n-- Table structure for table %s\n--\n\n", result_table); if (opt_drop) { /* Even if the "table" is a view, we do a DROP TABLE here. The view-specific code below fills in the DROP VIEW. We will skip the DROP TABLE for general_log and slow_log, since those stmts will fail, in case we apply dump by enabling logging. */ if (!general_log_or_slow_log_tables(db, table)) fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n", opt_quoted_table); check_io(sql_file); } field= mysql_fetch_field_direct(result, 0); if (strcmp(field->name, "View") == 0) { char *scv_buff= NULL; my_ulonglong n_cols; verbose_msg("-- It's a view, create dummy table for view\n"); /* save "show create" statement for later */ if ((row= mysql_fetch_row(result)) && (scv_buff=row[1])) scv_buff= my_strdup(PSI_NOT_INSTRUMENTED, scv_buff, MYF(0)); mysql_free_result(result); /* Create a table with the same name as the view and with columns of the same name in order to satisfy views that depend on this view. The table will be removed when the actual view is created. The properties of each column, are not preserved in this temporary table, because they are not necessary. This will not be necessary once we can determine dependencies between views and can simply dump them in the appropriate order. */ my_snprintf(query_buff, sizeof(query_buff), "SHOW FIELDS FROM %s", result_table); if (switch_character_set_results(mysql, "binary") || mysql_query_with_error_report(mysql, &result, query_buff) || switch_character_set_results(mysql, default_charset)) { /* View references invalid or privileged table/col/fun (err 1356), so we cannot create a stand-in table. Be defensive and dump a comment with the view's 'show create' statement. (Bug #17371) */ if (mysql_errno(mysql) == ER_VIEW_INVALID) fprintf(sql_file, "\n-- failed on view %s: %s\n\n", result_table, scv_buff ? scv_buff : ""); my_free(scv_buff); DBUG_RETURN(0); } else my_free(scv_buff); n_cols= mysql_num_rows(result); if (0 != n_cols) { /* The actual formula is based on the column names and how the .FRM files are stored and is too volatile to be repeated here. Thus we simply warn the user if the columns exceed a limit we know works most of the time. */ if (n_cols >= 1000) fprintf(stderr, "-- Warning: Creating a stand-in table for view %s may" " fail when replaying the dump file produced because " "of the number of columns exceeding 1000. Exercise " "caution when replaying the produced dump file.\n", table); if (opt_drop) { /* We have already dropped any table of the same name above, so here we just drop the view. */ fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n", opt_quoted_table); check_io(sql_file); } fprintf(sql_file, "SET @saved_cs_client = @@character_set_client;\n" "SET character_set_client = utf8;\n" "/*!50001 CREATE TABLE %s (\n", result_table); /* Get first row, following loop will prepend comma - keeps from having to know if the row being printed is last to determine if there should be a _trailing_ comma. */ row= mysql_fetch_row(result); /* The actual column type doesn't matter anyway, since the table will be dropped at run time. We do tinyint to avoid hitting the row size limit. */ fprintf(sql_file, " %s tinyint NOT NULL", quote_name(row[0], name_buff, 0)); while((row= mysql_fetch_row(result))) { /* col name, col type */ fprintf(sql_file, ",\n %s tinyint NOT NULL", quote_name(row[0], name_buff, 0)); } /* Stand-in tables are always MyISAM tables as the default engine might have a column-limit that's lower than the number of columns in the view, and MyISAM support is guaranteed to be in the server anyway. */ fprintf(sql_file, "\n) ENGINE=MyISAM */;\n" "SET character_set_client = @saved_cs_client;\n"); check_io(sql_file); } mysql_free_result(result); if (path) my_fclose(sql_file, MYF(MY_WME)); seen_views= 1; DBUG_RETURN(0); } row= mysql_fetch_row(result); is_log_table= general_log_or_slow_log_tables(db, table); if (is_log_table) row[1]+= 13; /* strlen("CREATE TABLE ")= 13 */ if (opt_compatible_mode & 3) { fprintf(sql_file, is_log_table ? "CREATE TABLE IF NOT EXISTS %s;\n" : "%s;\n", row[1]); } else { fprintf(sql_file, "/*!40101 SET @saved_cs_client = @@character_set_client */;\n" "/*!40101 SET character_set_client = utf8 */;\n" "%s%s;\n" "/*!40101 SET character_set_client = @saved_cs_client */;\n", is_log_table ? "CREATE TABLE IF NOT EXISTS " : "", row[1]); } check_io(sql_file); mysql_free_result(result); } my_snprintf(query_buff, sizeof(query_buff), "show fields from %s", result_table); if (mysql_query_with_error_report(mysql, &result, query_buff)) { if (path) my_fclose(sql_file, MYF(MY_WME)); DBUG_RETURN(0); } /* If write_data is true, then we build up insert statements for the table's data. Note: in subsequent lines of code, this test will have to be performed each time we are appending to insert_pat. */ if (write_data) { if (opt_replace_into) dynstr_append_checked(&insert_pat, "REPLACE "); else dynstr_append_checked(&insert_pat, "INSERT "); dynstr_append_checked(&insert_pat, insert_option); dynstr_append_checked(&insert_pat, "INTO "); dynstr_append_checked(&insert_pat, opt_quoted_table); if (complete_insert) { dynstr_append_checked(&insert_pat, " ("); } else { dynstr_append_checked(&insert_pat, " VALUES "); if (!extended_insert) dynstr_append_checked(&insert_pat, "("); } } while ((row= mysql_fetch_row(result))) { if (complete_insert) { if (init) { dynstr_append_checked(&insert_pat, ", "); } init=1; dynstr_append_checked(&insert_pat, quote_name(row[SHOW_FIELDNAME], name_buff, 0)); } } num_fields= mysql_num_rows(result); mysql_free_result(result); } else { verbose_msg("%s: Warning: Can't set SQL_QUOTE_SHOW_CREATE option (%s)\n", my_progname, mysql_error(mysql)); my_snprintf(query_buff, sizeof(query_buff), show_fields_stmt, db, table); if (mysql_query_with_error_report(mysql, &result, query_buff)) DBUG_RETURN(0); /* Make an sql-file, if path was given iow. option -T was given */ if (!opt_no_create_info) { if (path) { if (!(sql_file= open_sql_file_for_table(table, O_WRONLY))) DBUG_RETURN(0); write_header(sql_file, db); } print_comment(sql_file, 0, "\n--\n-- Table structure for table %s\n--\n\n", result_table); if (opt_drop) fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n", result_table); if (!opt_xml) fprintf(sql_file, "CREATE TABLE %s (\n", result_table); else print_xml_tag(sql_file, "\t", "\n", "table_structure", "name=", table, NullS); check_io(sql_file); } if (write_data) { if (opt_replace_into) dynstr_append_checked(&insert_pat, "REPLACE "); else dynstr_append_checked(&insert_pat, "INSERT "); dynstr_append_checked(&insert_pat, insert_option); dynstr_append_checked(&insert_pat, "INTO "); dynstr_append_checked(&insert_pat, result_table); if (complete_insert) dynstr_append_checked(&insert_pat, " ("); else { dynstr_append_checked(&insert_pat, " VALUES "); if (!extended_insert) dynstr_append_checked(&insert_pat, "("); } } while ((row= mysql_fetch_row(result))) { ulong *lengths= mysql_fetch_lengths(result); if (init) { if (!opt_xml && !opt_no_create_info) { fputs(",\n",sql_file); check_io(sql_file); } if (complete_insert) dynstr_append_checked(&insert_pat, ", "); } init=1; if (complete_insert) dynstr_append_checked(&insert_pat, quote_name(row[SHOW_FIELDNAME], name_buff, 0)); if (!opt_no_create_info) { if (opt_xml) { print_xml_row(sql_file, "field", result, &row, NullS); continue; } if (opt_keywords) fprintf(sql_file, " %s.%s %s", result_table, quote_name(row[SHOW_FIELDNAME],name_buff, 0), row[SHOW_TYPE]); else fprintf(sql_file, " %s %s", quote_name(row[SHOW_FIELDNAME], name_buff, 0), row[SHOW_TYPE]); if (row[SHOW_DEFAULT]) { fputs(" DEFAULT ", sql_file); unescape(sql_file, row[SHOW_DEFAULT], lengths[SHOW_DEFAULT]); } if (!row[SHOW_NULL][0]) fputs(" NOT NULL", sql_file); if (row[SHOW_EXTRA][0]) fprintf(sql_file, " %s",row[SHOW_EXTRA]); check_io(sql_file); } } num_fields= mysql_num_rows(result); mysql_free_result(result); if (!opt_no_create_info) { /* Make an sql-file, if path was given iow. option -T was given */ char buff[20+FN_REFLEN]; uint keynr,primary_key; my_snprintf(buff, sizeof(buff), "show keys from %s", result_table); if (mysql_query_with_error_report(mysql, &result, buff)) { if (mysql_errno(mysql) == ER_WRONG_OBJECT) { /* it is VIEW */ fputs("\t\t<options Comment=\"view\" />\n", sql_file); goto continue_xml; } fprintf(stderr, "%s: Can't get keys for table %s (%s)\n", my_progname, result_table, mysql_error(mysql)); if (path) my_fclose(sql_file, MYF(MY_WME)); DBUG_RETURN(0); } /* Find first which key is primary key */ keynr=0; primary_key=INT_MAX; while ((row= mysql_fetch_row(result))) { if (atoi(row[3]) == 1) { keynr++; if (!strcmp(row[2],"PRIMARY")) { primary_key=keynr; break; } } } mysql_data_seek(result,0); keynr=0; while ((row= mysql_fetch_row(result))) { if (opt_xml) { print_xml_row(sql_file, "key", result, &row, NullS); continue; } if (atoi(row[3]) == 1) { if (keynr++) putc(')', sql_file); if (atoi(row[1])) /* Test if duplicate key */ /* Duplicate allowed */ fprintf(sql_file, ",\n KEY %s (",quote_name(row[2],name_buff,0)); else if (keynr == primary_key) fputs(",\n PRIMARY KEY (",sql_file); /* First UNIQUE is primary */ else fprintf(sql_file, ",\n UNIQUE %s (",quote_name(row[2],name_buff, 0)); } else putc(',', sql_file); fputs(quote_name(row[4], name_buff, 0), sql_file); if (row[7]) fprintf(sql_file, " (%s)",row[7]); /* Sub key */ check_io(sql_file); } mysql_free_result(result); if (!opt_xml) { if (keynr) putc(')', sql_file); fputs("\n)",sql_file); check_io(sql_file); } /* Get MySQL specific create options */ if (create_options) { char show_name_buff[NAME_LEN*2+2+24]; /* Check memory for quote_for_like() */ my_snprintf(buff, sizeof(buff), "show table status like %s", quote_for_like(table, show_name_buff)); if (mysql_query_with_error_report(mysql, &result, buff)) { if (mysql_errno(mysql) != ER_PARSE_ERROR) { /* If old MySQL version */ verbose_msg("-- Warning: Couldn't get status information for " \ "table %s (%s)\n", result_table,mysql_error(mysql)); } } else if (!(row= mysql_fetch_row(result))) { fprintf(stderr, "Error: Couldn't read status information for table %s (%s)\n", result_table,mysql_error(mysql)); } else { if (opt_xml) print_xml_row(sql_file, "options", result, &row, NullS); else { fputs("/*!",sql_file); print_value(sql_file,result,row,"engine=","Engine",0); print_value(sql_file,result,row,"","Create_options",0); print_value(sql_file,result,row,"comment=","Comment",1); fputs(" */",sql_file); check_io(sql_file); } } mysql_free_result(result); /* Is always safe to free */ } continue_xml: if (!opt_xml) fputs(";\n", sql_file); else fputs("\t</table_structure>\n", sql_file); check_io(sql_file); } } if (complete_insert) { dynstr_append_checked(&insert_pat, ") VALUES "); if (!extended_insert) dynstr_append_checked(&insert_pat, "("); } if (sql_file != md_result_file) { fputs("\n", sql_file); write_footer(sql_file); my_fclose(sql_file, MYF(MY_WME)); } DBUG_RETURN((uint) num_fields); } /* get_table_structure */
0
5,965
void ACSequentialScan::DecodeBlock(LONG *block, LONG &prevdc,LONG &prevdiff, UBYTE small,UBYTE large,UBYTE kx,UBYTE dc,UBYTE ac) { // DC coding if (m_ucScanStart == 0 && m_bResidual == false) { LONG diff; struct QMContextSet::DCContextZeroSet &cz = m_Context[dc].Classify(prevdiff,small,large); // Check whether the difference is nonzero. if (m_Coder.Get(cz.S0)) { LONG sz; bool sign = m_Coder.Get(cz.SS); // sign coding, is true for negative. // // // Positive and negative are encoded in different contexts. // Decode the magnitude cathegory. if (m_Coder.Get((sign)?(cz.SN):(cz.SP))) { int i = 0; LONG m = 2; while(m_Coder.Get(m_Context[dc].DCMagnitude.X[i])) { m <<= 1; i++; if (m == 0) JPG_THROW(MALFORMED_STREAM,"ACSequentialScan::DecodeBlock", "QMDecoder is out of sync"); } // // Get the MSB to decode. m >>= 1; sz = m; // // Refinement coding of remaining bits. while((m >>= 1)) { if (m_Coder.Get(m_Context[dc].DCMagnitude.M[i])) { sz |= m; } } } else { sz = 0; } // // Done, finally, include the sign and the offset. if (sign) { diff = -sz - 1; } else { diff = sz + 1; } } else { // Difference is zero. diff = 0; } prevdiff = diff; if (m_bDifferential) { prevdc = diff; } else { prevdc += diff; } block[0] = prevdc << m_ucLowBit; // point transformation } if (m_ucScanStop) { // AC coding. No block skipping used here. int k = (m_ucScanStart)?(m_ucScanStart):((m_bResidual)?0:1); // // EOB decoding. while(k <= m_ucScanStop && !m_Coder.Get(m_Context[ac].ACZero[k-1].SE)) { LONG sz; bool sign; // // Not yet EOB. Run coding in S0: Skip over zeros. while(!m_Coder.Get(m_Context[ac].ACZero[k-1].S0)) { k++; if (k > m_ucScanStop) JPG_THROW(MALFORMED_STREAM,"ACSequentialScan::DecodeBlock", "QMDecoder is out of sync"); } // // Now decode the sign of the coefficient. // This happens in the uniform context. sign = m_Coder.Get(m_Context[ac].Uniform); // // Decode the magnitude. if (m_Coder.Get(m_Context[ac].ACZero[k-1].SP)) { // X1 coding, identical to SN and SP. if (m_Coder.Get(m_Context[ac].ACZero[k-1].SP)) { int i = 0; LONG m = 4; struct QMContextSet::ACContextMagnitudeSet &acm = (k > kx)?(m_Context[ac].ACMagnitudeHigh):(m_Context[ac].ACMagnitudeLow); while(m_Coder.Get(acm.X[i])) { m <<= 1; i++; if (m == 0) JPG_THROW(MALFORMED_STREAM,"ACSequentialScan::DecodeBlock", "QMDecoder is out of sync"); } // // Get the MSB to decode m >>= 1; sz = m; // // Proceed to refinement. while((m >>= 1)) { if (m_Coder.Get(acm.M[i])) { sz |= m; } } } else { sz = 1; } } else { sz = 0; } // // Done. Finally, include sign and offset. sz++; if (sign) sz = -sz; block[DCT::ScanOrder[k]] = sz << m_ucLowBit; // // Proceed to the next block. k++; } } }
1
487,632
void ElectronRenderFrameObserver::CreateIsolatedWorldContext() { auto* frame = render_frame_->GetWebFrame(); blink::WebIsolatedWorldInfo info; // This maps to the name shown in the context combo box in the Console tab // of the dev tools. info.human_readable_name = blink::WebString::FromUTF8("Electron Isolated Context"); // Setup document's origin policy in isolated world info.security_origin = frame->GetDocument().GetSecurityOrigin(); blink::SetIsolatedWorldInfo(WorldIDs::ISOLATED_WORLD_ID, info); // Create initial script context in isolated world blink::WebScriptSource source("void 0"); frame->ExecuteScriptInIsolatedWorld( WorldIDs::ISOLATED_WORLD_ID, source, blink::BackForwardCacheAware::kPossiblyDisallow); }
0
170,211
on_error(void *user_data, Evas_Object *webview, void *event_info) { Eina_Strbuf* buffer; const Ewk_Error *error = (const Ewk_Error *)event_info; /* This is a cancellation, do not display the error page */ if (ewk_error_cancellation_get(error)) return; buffer = eina_strbuf_new(); eina_strbuf_append_printf(buffer, "<html><body><div style=\"color:#ff0000\">ERROR!</div><br><div>Code: %d<br>Description: %s<br>URL: %s</div></body</html>", ewk_error_code_get(error), ewk_error_description_get(error), ewk_error_url_get(error)); ewk_view_html_string_load(webview, eina_strbuf_string_get(buffer), 0, ewk_error_url_get(error)); eina_strbuf_free(buffer); }
0
142,495
static int pix_abs16_y2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int s, i; uint8_t *pix3 = pix2 + line_size; s = 0; for(i=0;i<h;i++) { s += abs(pix1[0] - avg2(pix2[0], pix3[0])); s += abs(pix1[1] - avg2(pix2[1], pix3[1])); s += abs(pix1[2] - avg2(pix2[2], pix3[2])); s += abs(pix1[3] - avg2(pix2[3], pix3[3])); s += abs(pix1[4] - avg2(pix2[4], pix3[4])); s += abs(pix1[5] - avg2(pix2[5], pix3[5])); s += abs(pix1[6] - avg2(pix2[6], pix3[6])); s += abs(pix1[7] - avg2(pix2[7], pix3[7])); s += abs(pix1[8] - avg2(pix2[8], pix3[8])); s += abs(pix1[9] - avg2(pix2[9], pix3[9])); s += abs(pix1[10] - avg2(pix2[10], pix3[10])); s += abs(pix1[11] - avg2(pix2[11], pix3[11])); s += abs(pix1[12] - avg2(pix2[12], pix3[12])); s += abs(pix1[13] - avg2(pix2[13], pix3[13])); s += abs(pix1[14] - avg2(pix2[14], pix3[14])); s += abs(pix1[15] - avg2(pix2[15], pix3[15])); pix1 += line_size; pix2 += line_size; pix3 += line_size; } return s; }
0
489,327
GF_Err dmax_box_dump(GF_Box *a, FILE * trace) { GF_DMAXBox *p; p = (GF_DMAXBox *)a; gf_isom_box_dump_start(a, "MaxPacketDurationBox", trace); gf_fprintf(trace, "MaximumDuration=\"%d\">\n", p->maxDur); gf_isom_box_dump_done("MaxPacketDurationBox", a, trace); return GF_OK; }
0
168,625
void FakeCentral::IsNotifying(const std::string& characteristic_id, const std::string& service_id, const std::string& peripheral_address, IsNotifyingCallback callback) { FakeRemoteGattCharacteristic* fake_remote_gatt_characteristic = GetFakeRemoteGattCharacteristic(peripheral_address, service_id, characteristic_id); if (!fake_remote_gatt_characteristic) { std::move(callback).Run(false, false); } std::move(callback).Run(true, fake_remote_gatt_characteristic->IsNotifying()); }
0
496,991
TF_LITE_MICRO_TEST(GatherNd_BatchedIndexingIntoRank3Tensor4) { // For input_dims[], index_dims[], or output_dims[], element 0 is the // number of dimensions in that array, not the actual dimension data. int input_dims[] = {3, 3, 2, 3}; int index_dims[] = {3, 2, 2, 3}; const int32_t index_data[] = {0, 0, 1, 1, 0, 1, 1, 1, 2, 2, 1, 2}; const float input_data[] = {1.1, -1.2, 1.3, -2.1, 2.2, 2.3, // 3.1, 3.2, -3.3, -4.1, -4.2, 4.3, // 5.1, -5.2, 5.3, 6.1, -6.2, 6.3}; const float golden_data[] = {-1.2, 3.2, 4.3, 6.3}; float output_data[4]; int output_dims[] = {2, 0, 0}; tflite::testing::TestGatherNd<float, int32_t>( input_dims, input_data, index_dims, index_data, output_dims, output_data, golden_data); }
0
369,326
static char *sanitize_path(const char *path) { char *p; if (!path) return NULL; p = canonicalize_path_restricted(path); if (!p) err(MOUNT_EX_USAGE, "%s", path); return p; }
0
35,838
pixGetOuterBorderPta(PIX *pixs, BOX *box) { l_int32 allzero, x, y; BOX *boxt; CCBORD *ccb; PTA *ptaloc, *ptad; PROCNAME("pixGetOuterBorderPta"); if (!pixs) return (PTA *)ERROR_PTR("pixs not defined", procName, NULL); if (pixGetDepth(pixs) != 1) return (PTA *)ERROR_PTR("pixs not binary", procName, NULL); pixZero(pixs, &allzero); if (allzero) return (PTA *)ERROR_PTR("pixs all 0", procName, NULL); if ((ccb = ccbCreate(pixs)) == NULL) return (PTA *)ERROR_PTR("ccb not made", procName, NULL); if (!box) boxt = boxCreate(0, 0, pixGetWidth(pixs), pixGetHeight(pixs)); else boxt = boxClone(box); /* Get the exterior border in local coords */ pixGetOuterBorder(ccb, pixs, boxt); if ((ptaloc = ptaaGetPta(ccb->local, 0, L_CLONE)) == NULL) { ccbDestroy(&ccb); boxDestroy(&boxt); return (PTA *)ERROR_PTR("ptaloc not made", procName, NULL); } /* Transform to global coordinates, if they are given */ if (box) { boxGetGeometry(box, &x, &y, NULL, NULL); ptad = ptaTransform(ptaloc, x, y, 1.0, 1.0); } else { ptad = ptaClone(ptaloc); } ptaDestroy(&ptaloc); boxDestroy(&boxt); ccbDestroy(&ccb); return ptad; }
0
208,135
void WebContentsImpl::RendererUnresponsive( RenderWidgetHostImpl* render_widget_host, base::RepeatingClosure hang_monitor_restarter) { for (auto& observer : observers_) observer.OnRendererUnresponsive(render_widget_host->GetProcess()); if (ShouldIgnoreUnresponsiveRenderer()) return; if (!render_widget_host->renderer_initialized()) return; if (delegate_) delegate_->RendererUnresponsive(this, render_widget_host, std::move(hang_monitor_restarter)); }
0
399,645
static void mark_work_canceling(struct work_struct *work) { unsigned long pool_id = get_work_pool_id(work); pool_id <<= WORK_OFFQ_POOL_SHIFT; set_work_data(work, pool_id | WORK_OFFQ_CANCELING, WORK_STRUCT_PENDING); }
0
296,640
BOOL security_encrypt(BYTE* data, int length, rdpRdp* rdp) { if (rdp->encrypt_use_count >= 4096) { security_key_update(rdp->encrypt_key, rdp->encrypt_update_key, rdp->rc4_key_len); crypto_rc4_free(rdp->rc4_encrypt_key); rdp->rc4_encrypt_key = crypto_rc4_init(rdp->encrypt_key, rdp->rc4_key_len); rdp->encrypt_use_count = 0; } crypto_rc4(rdp->rc4_encrypt_key, length, data, data); rdp->encrypt_use_count++; rdp->encrypt_checksum_use_count++; return TRUE; }
0
264,710
static void jas_icclut16_destroy(jas_iccattrval_t *attrval) { jas_icclut16_t *lut16 = &attrval->data.lut16; if (lut16->clut) { jas_free(lut16->clut); lut16->clut = 0; } if (lut16->intabs) { jas_free(lut16->intabs); lut16->intabs = 0; } if (lut16->intabsbuf) { jas_free(lut16->intabsbuf); lut16->intabsbuf = 0; } if (lut16->outtabs) { jas_free(lut16->outtabs); lut16->outtabs = 0; } if (lut16->outtabsbuf) { jas_free(lut16->outtabsbuf); lut16->outtabsbuf = 0; } }
0
3,768
bumpserialno(void) { ++serialno; }
1
156,026
cmp_func_intel (const void *elem1, const void *elem2) { return cmp_func ((const unsigned char *) elem1, (const unsigned char *) elem2, EXIF_BYTE_ORDER_INTEL); }
0
517,247
double val_real() { return (double)val_int(); }
0
216,261
bool RenderViewImpl::IsEditableNode(const WebNode& node) const { if (node.isNull()) return false; if (node.isContentEditable()) return true; if (node.isElementNode()) { const WebElement& element = node.toConst<WebElement>(); if (element.isTextFormControlElement()) return true; for (unsigned i = 0; i < element.attributeCount(); ++i) { if (LowerCaseEqualsASCII(element.attributeLocalName(i), "role")) { if (LowerCaseEqualsASCII(element.attributeValue(i), "textbox")) return true; break; } } } return false; }
0
300,288
one_function_arg( char_u *arg, garray_T *newargs, garray_T *argtypes, int types_optional, evalarg_T *evalarg, int is_vararg, int skip) { char_u *p = arg; char_u *arg_copy = NULL; int is_underscore = FALSE; while (ASCII_ISALNUM(*p) || *p == '_') ++p; if (arg == p || isdigit(*arg) || (argtypes == NULL && ((p - arg == 9 && STRNCMP(arg, "firstline", 9) == 0) || (p - arg == 8 && STRNCMP(arg, "lastline", 8) == 0)))) { if (!skip) semsg(_(e_illegal_argument_str), arg); return arg; } // Vim9 script: cannot use script var name for argument. In function: also // check local vars and arguments. if (!skip && argtypes != NULL && check_defined(arg, p - arg, evalarg == NULL ? NULL : evalarg->eval_cctx, TRUE) == FAIL) return arg; if (newargs != NULL && ga_grow(newargs, 1) == FAIL) return arg; if (newargs != NULL) { int c; int i; c = *p; *p = NUL; arg_copy = vim_strsave(arg); if (arg_copy == NULL) { *p = c; return arg; } is_underscore = arg_copy[0] == '_' && arg_copy[1] == NUL; if (argtypes == NULL || !is_underscore) // Check for duplicate argument name. for (i = 0; i < newargs->ga_len; ++i) if (STRCMP(((char_u **)(newargs->ga_data))[i], arg_copy) == 0) { semsg(_(e_duplicate_argument_name_str), arg_copy); vim_free(arg_copy); return arg; } ((char_u **)(newargs->ga_data))[newargs->ga_len] = arg_copy; newargs->ga_len++; *p = c; } // get any type from "arg: type" if (argtypes != NULL && (skip || ga_grow(argtypes, 1) == OK)) { char_u *type = NULL; if (VIM_ISWHITE(*p) && *skipwhite(p) == ':') { semsg(_(e_no_white_space_allowed_before_colon_str), arg_copy == NULL ? arg : arg_copy); p = skipwhite(p); } if (*p == ':') { ++p; if (!skip && !VIM_ISWHITE(*p)) { semsg(_(e_white_space_required_after_str_str), ":", p - 1); return arg; } type = skipwhite(p); p = skip_type(type, TRUE); if (!skip) type = vim_strnsave(type, p - type); } else if (*skipwhite(p) != '=' && !types_optional && !is_underscore) { semsg(_(e_missing_argument_type_for_str), arg_copy == NULL ? arg : arg_copy); return arg; } if (!skip) { if (type == NULL && types_optional) // lambda arguments default to "any" type type = vim_strsave((char_u *) (is_vararg ? "list<any>" : "any")); ((char_u **)argtypes->ga_data)[argtypes->ga_len++] = type; } } return p; }
0
230,343
virtual void DoSetUp() { RenderViewImplTest::SetUp(); }
0
424,675
addToLibpath(const char *dir, BOOLEAN isPrepend) { #if defined(AIXPPC) || defined(J9ZOS390) char *oldPath, *newPath; int rc, newSize; #if defined(J9ZOS390) char *putenvPath; int putenvSize; #endif oldPath = getenv("LIBPATH"); #ifdef DEBUG printf("\nLIBPATH before = %s\n", oldPath ? oldPath : "<empty>"); #endif newSize = (oldPath ? strlen(oldPath) : 0) + strlen(dir) + 2; /* 1 for :, 1 for \0 terminator */ newPath = malloc(newSize); if(!newPath) { fprintf(stderr, "addToLibpath malloc(%d) 1 failed, aborting\n", newSize); abort(); } #if defined(AIXPPC) if (oldPath) { if (isPrepend) { strcpy(newPath, dir); strcat(newPath, ":"); strcat(newPath, oldPath); } else { strcpy(newPath, oldPath); strcat(newPath, ":"); strcat(newPath, dir); } } else { strcpy(newPath, dir); } #else /* ZOS doesn't like it when we pre-pend to LIBPATH */ if (oldPath) { strcpy(newPath, oldPath); strcat(newPath, ":"); } else { newPath[0] = '\0'; } strcat(newPath, dir); #endif #if defined(J9ZOS390) putenvSize = newSize + strlen("LIBPATH="); putenvPath = malloc(putenvSize); if(!putenvPath) { fprintf(stderr, "addToLibpath malloc(%d) 2 failed, aborting\n", putenvSize); abort(); } strcpy(putenvPath,"LIBPATH="); strcat(putenvPath, newPath); rc = putenv(putenvPath); free(putenvPath); #else rc = setenv("LIBPATH", newPath, 1); #endif #ifdef DEBUG printf("\nLIBPATH after = %s\n", getenv("LIBPATH")); #endif free(newPath); #endif }
0
50,548
inline void writeS8( S8 s) { writeU8((U8)s); }
0
517,156
bool agg_arg_charsets_for_comparison(CHARSET_INFO **cs, Item **a, Item **b) { DTCollation tmp; if (tmp.set((*a)->collation, (*b)->collation, MY_COLL_CMP_CONV) || tmp.derivation == DERIVATION_NONE) { my_error(ER_CANT_AGGREGATE_2COLLATIONS,MYF(0), (*a)->collation.collation->name, (*a)->collation.derivation_name(), (*b)->collation.collation->name, (*b)->collation.derivation_name(), func_name()); return true; } if (agg_item_set_converter(tmp, func_name(), a, 1, MY_COLL_CMP_CONV, 1) || agg_item_set_converter(tmp, func_name(), b, 1, MY_COLL_CMP_CONV, 1)) return true; *cs= tmp.collation; return false; }
0
155,462
inline void BroadcastAddFivefold(const ArithmeticParams& params, const RuntimeShape& unswitched_input1_shape, const float* unswitched_input1_data, const RuntimeShape& unswitched_input2_shape, const float* unswitched_input2_data, const RuntimeShape& output_shape, float* output_data) { BroadcastAddDispatch(params, unswitched_input1_shape, unswitched_input1_data, unswitched_input2_shape, unswitched_input2_data, output_shape, output_data); }
0
362,914
static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_early) { __skb_unlink(skb, &sk->sk_receive_queue); __kfree_skb(skb); }
0
178,329
static int ecp_check_pubkey_sw( const mbedtls_ecp_group *grp, const mbedtls_ecp_point *pt ) { int ret; mbedtls_mpi YY, RHS; /* pt coordinates must be normalized for our checks */ if( mbedtls_mpi_cmp_int( &pt->X, 0 ) < 0 || mbedtls_mpi_cmp_int( &pt->Y, 0 ) < 0 || mbedtls_mpi_cmp_mpi( &pt->X, &grp->P ) >= 0 || mbedtls_mpi_cmp_mpi( &pt->Y, &grp->P ) >= 0 ) return( MBEDTLS_ERR_ECP_INVALID_KEY ); mbedtls_mpi_init( &YY ); mbedtls_mpi_init( &RHS ); /* * YY = Y^2 * RHS = X (X^2 + A) + B = X^3 + A X + B */ MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &YY, &pt->Y, &pt->Y ) ); MOD_MUL( YY ); MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &RHS, &pt->X, &pt->X ) ); MOD_MUL( RHS ); /* Special case for A = -3 */ if( grp->A.p == NULL ) { MBEDTLS_MPI_CHK( mbedtls_mpi_sub_int( &RHS, &RHS, 3 ) ); MOD_SUB( RHS ); } else { MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &RHS, &RHS, &grp->A ) ); MOD_ADD( RHS ); } MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &RHS, &RHS, &pt->X ) ); MOD_MUL( RHS ); MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &RHS, &RHS, &grp->B ) ); MOD_ADD( RHS ); if( mbedtls_mpi_cmp_mpi( &YY, &RHS ) != 0 ) ret = MBEDTLS_ERR_ECP_INVALID_KEY; cleanup: mbedtls_mpi_free( &YY ); mbedtls_mpi_free( &RHS ); return( ret ); }
0
345,534
htmlParseComment(htmlParserCtxtPtr ctxt) { xmlChar *buf = NULL; int len; int size = HTML_PARSER_BUFFER_SIZE; int q, ql; int r, rl; int cur, l; xmlParserInputState state; /* * Check that there is a comment right here. */ if ((RAW != '<') || (NXT(1) != '!') || (NXT(2) != '-') || (NXT(3) != '-')) return; state = ctxt->instate; ctxt->instate = XML_PARSER_COMMENT; SHRINK; SKIP(4); buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar)); if (buf == NULL) { htmlErrMemory(ctxt, "buffer allocation failed\n"); ctxt->instate = state; return; } q = CUR_CHAR(ql); NEXTL(ql); r = CUR_CHAR(rl); NEXTL(rl); cur = CUR_CHAR(l); len = 0; while (IS_CHAR(cur) && ((cur != '>') || (r != '-') || (q != '-'))) { if (len + 5 >= size) { xmlChar *tmp; size *= 2; tmp = (xmlChar *) xmlRealloc(buf, size * sizeof(xmlChar)); if (tmp == NULL) { xmlFree(buf); htmlErrMemory(ctxt, "growing buffer failed\n"); ctxt->instate = state; return; } buf = tmp; } COPY_BUF(ql,buf,len,q); q = r; ql = rl; r = cur; rl = l; NEXTL(l); cur = CUR_CHAR(l); if (cur == 0) { SHRINK; GROW; cur = CUR_CHAR(l); } } buf[len] = 0; if (!IS_CHAR(cur)) { htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED, "Comment not terminated \n<!--%.50s\n", buf, NULL); xmlFree(buf); } else { NEXT; if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) && (!ctxt->disableSAX)) ctxt->sax->comment(ctxt->userData, buf); xmlFree(buf); } ctxt->instate = state; }
1
289,416
void raw6_icmp_error ( struct sk_buff * skb , int nexthdr , u8 type , u8 code , int inner_offset , __be32 info ) { struct sock * sk ; int hash ; struct in6_addr * saddr , * daddr ; struct net * net ; hash = nexthdr & ( RAW_HTABLE_SIZE - 1 ) ; read_lock ( & raw_v6_hashinfo . lock ) ; sk = sk_head ( & raw_v6_hashinfo . ht [ hash ] ) ; if ( sk != NULL ) { struct ipv6hdr * ip6h = ( struct ipv6hdr * ) skb -> data ; saddr = & ip6h -> saddr ; daddr = & ip6h -> daddr ; net = dev_net ( skb -> dev ) ; while ( ( sk = __raw_v6_lookup ( net , sk , nexthdr , saddr , daddr , IP6CB ( skb ) -> iif ) ) ) { rawv6_err ( sk , skb , NULL , type , code , inner_offset , info ) ; sk = sk_next ( sk ) ; } } read_unlock ( & raw_v6_hashinfo . lock ) ; }
0
512,506
int setup_tests(void) { app_data_index = RAND_DRBG_get_ex_new_index(0L, NULL, NULL, NULL, NULL); ADD_ALL_TESTS(test_kats, OSSL_NELEM(drbg_test)); ADD_ALL_TESTS(test_error_checks, OSSL_NELEM(drbg_test)); ADD_TEST(test_rand_drbg_reseed); ADD_TEST(test_rand_seed); ADD_TEST(test_rand_add); #if defined(OPENSSL_THREADS) ADD_TEST(test_multi_thread); #endif return 1; }
0
162,162
explicit C_handle_write(AsyncConnectionRef c): conn(c) {}
0
345,035
_asn1_get_octet_string (asn1_node node, const unsigned char *der, unsigned der_len, int *len) { int len2, len3, counter, tot_len, indefinite; counter = 0; if (*(der - 1) & ASN1_CLASS_STRUCTURED) { tot_len = 0; indefinite = asn1_get_length_der (der, der_len, &len3); if (indefinite < -1) return ASN1_DER_ERROR; counter += len3; if (indefinite >= 0) indefinite += len3; while (1) { if (counter > der_len) return ASN1_DER_ERROR; if (indefinite == -1) { if ((der[counter] == 0) && (der[counter + 1] == 0)) { counter += 2; break; } } else if (counter >= indefinite) break; if (der[counter] != ASN1_TAG_OCTET_STRING) return ASN1_DER_ERROR; counter++; len2 = asn1_get_length_der (der + counter, der_len - counter, &len3); if (len2 <= 0) return ASN1_DER_ERROR; counter += len3 + len2; tot_len += len2; } /* copy */ if (node) { unsigned char temp[ASN1_MAX_LENGTH_SIZE]; int ret; len2 = sizeof (temp); asn1_length_der (tot_len, temp, &len2); _asn1_set_value (node, temp, len2); ret = _asn1_extract_der_octet (node, der, der_len); if (ret != ASN1_SUCCESS) return ret; } } else { /* NOT STRUCTURED */ len2 = asn1_get_length_der (der, der_len, &len3); if (len2 < 0) return ASN1_DER_ERROR; counter = len3 + len2; if (node) _asn1_set_value (node, der, counter); } *len = counter; return ASN1_SUCCESS; }
1
347,468
static void sig_chatnet_read(IRC_CHATNET_REC *rec, CONFIG_NODE *node) { if (!IS_IRC_CHATNET(rec)) return; rec->usermode = g_strdup(config_node_get_str(node, "usermode", NULL)); rec->max_cmds_at_once = config_node_get_int(node, "cmdmax", 0); rec->cmd_queue_speed = config_node_get_int(node, "cmdspeed", 0); rec->max_query_chans = config_node_get_int(node, "max_query_chans", 0); rec->max_kicks = config_node_get_int(node, "max_kicks", 0); rec->max_msgs = config_node_get_int(node, "max_msgs", 0); rec->max_modes = config_node_get_int(node, "max_modes", 0); rec->max_whois = config_node_get_int(node, "max_whois", 0); }
1
170,359
xsltGetKey(xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *nameURI, const xmlChar *value) { xmlNodeSetPtr ret; xsltKeyTablePtr table; int init_table = 0; if ((ctxt == NULL) || (name == NULL) || (value == NULL) || (ctxt->document == NULL)) return(NULL); #ifdef WITH_XSLT_DEBUG_KEYS xsltGenericDebug(xsltGenericDebugContext, "Get key %s, value %s\n", name, value); #endif /* * keys are computed only on-demand on first key access for a document */ if ((ctxt->document->nbKeysComputed < ctxt->nbKeys) && (ctxt->keyInitLevel == 0)) { /* * If non-recursive behaviour, just try to initialize all keys */ if (xsltInitAllDocKeys(ctxt)) return(NULL); } retry: table = (xsltKeyTablePtr) ctxt->document->keys; while (table != NULL) { if (((nameURI != NULL) == (table->nameURI != NULL)) && xmlStrEqual(table->name, name) && xmlStrEqual(table->nameURI, nameURI)) { ret = (xmlNodeSetPtr)xmlHashLookup(table->keys, value); return(ret); } table = table->next; } if ((ctxt->keyInitLevel != 0) && (init_table == 0)) { /* * Apparently one key is recursive and this one is needed, * initialize just it, that time and retry */ xsltInitDocKeyTable(ctxt, name, nameURI); init_table = 1; goto retry; } return(NULL); }
0
94,889
static void nfs4_state_start_reclaim_reboot(struct nfs_client *clp) { /* Mark all delegations for reclaim */ nfs_delegation_mark_reclaim(clp); nfs4_state_mark_reclaim_helper(clp, nfs4_state_mark_reclaim_reboot); }
0
123,393
void address_space_destroy(AddressSpace *as) { MemoryRegion *root = as->root; /* Flush out anything from MemoryListeners listening in on this */ memory_region_transaction_begin(); as->root = NULL; memory_region_transaction_commit(root); QTAILQ_REMOVE(&as->uc->address_spaces, as, address_spaces_link); /* At this point, as->dispatch and as->current_map are dummy * entries that the guest should never use. Wait for the old * values to expire before freeing the data. */ as->root = root; flatview_unref(as->current_map); }
0
77,601
static void xen_machine_power_off(void) { do_kernel_power_off(); xen_reboot(SHUTDOWN_poweroff); }
0
230,562
transit_hash_alloc (void *p) { /* Transit structure is already allocated. */ return p; }
0
195,417
bool RenderWidgetHostViewAura::HasHitTestMask() const { return false; }
0
71,012
void nntp_hcache_update(struct NntpData *nntp_data, header_cache_t *hc) { char buf[16]; bool old = false; void *hdata = NULL; anum_t first = 0, last = 0; if (!hc) return; /* fetch previous values of first and last */ hdata = mutt_hcache_fetch_raw(hc, "index", 5); if (hdata) { mutt_debug(2, "mutt_hcache_fetch index: %s\n", (char *) hdata); if (sscanf(hdata, ANUM " " ANUM, &first, &last) == 2) { old = true; nntp_data->last_cached = last; /* clean removed headers from cache */ for (anum_t current = first; current <= last; current++) { if (current >= nntp_data->first_message && current <= nntp_data->last_message) continue; snprintf(buf, sizeof(buf), "%u", current); mutt_debug(2, "mutt_hcache_delete %s\n", buf); mutt_hcache_delete(hc, buf, strlen(buf)); } } mutt_hcache_free(hc, &hdata); } /* store current values of first and last */ if (!old || nntp_data->first_message != first || nntp_data->last_message != last) { snprintf(buf, sizeof(buf), "%u %u", nntp_data->first_message, nntp_data->last_message); mutt_debug(2, "mutt_hcache_store index: %s\n", buf); mutt_hcache_store_raw(hc, "index", 5, buf, strlen(buf)); } }
0
318,207
error::Error GLES2DecoderImpl::HandleDestroyStreamTextureCHROMIUM( uint32 immediate_data_size, const gles2::DestroyStreamTextureCHROMIUM& c) { GLuint client_id = c.texture; TextureManager::TextureInfo* info = texture_manager()->GetTextureInfo(client_id); if (info && info->IsStreamTexture()) { if (!stream_texture_manager_) return error::kInvalidArguments; stream_texture_manager_->DestroyStreamTexture(info->service_id()); info->SetStreamTexture(false); texture_manager()->SetInfoTarget(info, 0); } else { SetGLError(GL_INVALID_VALUE, "glDestroyStreamTextureCHROMIUM", "bad texture id."); } return error::kNoError; }
0
200,121
bool WebView::shouldInitializeTrackPointHack() { static bool shouldCreateScrollbars; static bool hasRunTrackPointCheck; if (hasRunTrackPointCheck) return shouldCreateScrollbars; hasRunTrackPointCheck = true; const wchar_t* trackPointKeys[] = { L"Software\\Lenovo\\TrackPoint", L"Software\\Lenovo\\UltraNav", L"Software\\Alps\\Apoint\\TrackPoint", L"Software\\Synaptics\\SynTPEnh\\UltraNavUSB", L"Software\\Synaptics\\SynTPEnh\\UltraNavPS2" }; for (size_t i = 0; i < WTF_ARRAY_LENGTH(trackPointKeys); ++i) { HKEY trackPointKey; int readKeyResult = ::RegOpenKeyExW(HKEY_CURRENT_USER, trackPointKeys[i], 0, KEY_READ, &trackPointKey); ::RegCloseKey(trackPointKey); if (readKeyResult == ERROR_SUCCESS) { shouldCreateScrollbars = true; return shouldCreateScrollbars; } } return shouldCreateScrollbars; }
0
378,917
int LZ4_loadDict (void* LZ4_dict, const char* dictionary, int dictSize) { LZ4_stream_t_internal* dict = (LZ4_stream_t_internal*) LZ4_dict; const BYTE* p = (const BYTE*)dictionary; const BYTE* const dictEnd = p + dictSize; const BYTE* base; LZ4_STATIC_ASSERT(LZ4_STREAMSIZE >= sizeof(LZ4_stream_t_internal)); /* A compilation error here means LZ4_STREAMSIZE is not large enough */ if (dict->initCheck) MEM_INIT(dict, 0, sizeof(LZ4_stream_t_internal)); /* Uninitialized structure detected */ if (dictSize < MINMATCH) { dict->dictionary = NULL; dict->dictSize = 0; return 1; } if (p <= dictEnd - 64 KB) p = dictEnd - 64 KB; base = p - dict->currentOffset; dict->dictionary = p; dict->dictSize = (U32)(dictEnd - p); dict->currentOffset += dict->dictSize; while (p <= dictEnd-MINMATCH) { LZ4_putPosition(p, dict, byU32, base); p+=3; } return 1; }
0
519,120
void Field_num::make_send_field(Send_field *field) { Field::make_send_field(field); field->decimals= dec; }
0
435,309
static int ws_echo(struct buf *inbuf, struct buf *outbuf, struct buf *logbuf __attribute__((unused)), void **rock __attribute__((unused))) { buf_init_ro(outbuf, buf_base(inbuf), buf_len(inbuf)); return 0; }
0
323,767
static void sd_set_status(SDState *sd) { switch (sd->state) { case sd_inactive_state: sd->mode = sd_inactive; break; case sd_idle_state: case sd_ready_state: case sd_identification_state: sd->mode = sd_card_identification_mode; break; case sd_standby_state: case sd_transfer_state: case sd_sendingdata_state: case sd_receivingdata_state: case sd_programming_state: case sd_disconnect_state: sd->mode = sd_data_transfer_mode; break; } sd->card_status &= ~CURRENT_STATE; sd->card_status |= sd->state << 9; }
0
358,299
static void fixup_rmode_irq(struct vcpu_vmx *vmx) { vmx->rmode.irq.pending = 0; if (kvm_rip_read(&vmx->vcpu) + 1 != vmx->rmode.irq.rip) return; kvm_rip_write(&vmx->vcpu, vmx->rmode.irq.rip); if (vmx->idt_vectoring_info & VECTORING_INFO_VALID_MASK) { vmx->idt_vectoring_info &= ~VECTORING_INFO_TYPE_MASK; vmx->idt_vectoring_info |= INTR_TYPE_EXT_INTR; return; } vmx->idt_vectoring_info = VECTORING_INFO_VALID_MASK | INTR_TYPE_EXT_INTR | vmx->rmode.irq.vector; }
0
349,041
static int report_block(struct dquot *dquot, unsigned int blk, char *bitmap, int (*process_dquot) (struct dquot *, void *), void *data) { struct qtree_mem_dqinfo *info = &dquot->dq_h->qh_info.u.v2_mdqi.dqi_qtree; dqbuf_t buf = getdqbuf(); struct qt_disk_dqdbheader *dh; char *ddata; int entries, i; if (!buf) return 0; set_bit(bitmap, blk); read_blk(dquot->dq_h, blk, buf); dh = (struct qt_disk_dqdbheader *)buf; ddata = buf + sizeof(struct qt_disk_dqdbheader); entries = ext2fs_le16_to_cpu(dh->dqdh_entries); for (i = 0; i < qtree_dqstr_in_blk(info); i++, ddata += info->dqi_entry_size) if (!qtree_entry_unused(info, ddata)) { dquot->dq_dqb.u.v2_mdqb.dqb_off = (blk << QT_BLKSIZE_BITS) + sizeof(struct qt_disk_dqdbheader) + i * info->dqi_entry_size; info->dqi_ops->disk2mem_dqblk(dquot, ddata); if (process_dquot(dquot, data) < 0) break; } freedqbuf(buf); return entries; }
1
86,742
cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */ { const char *hostname; /* Hostname of client */ char name[256]; /* Hostname of client */ int count; /* Count of connections on a host */ cupsd_client_t *con, /* New client pointer */ *tempcon; /* Temporary client pointer */ socklen_t addrlen; /* Length of address */ http_addr_t temp; /* Temporary address variable */ static time_t last_dos = 0; /* Time of last DoS attack */ #ifdef HAVE_TCPD_H struct request_info wrap_req; /* TCP wrappers request information */ #endif /* HAVE_TCPD_H */ cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdAcceptClient(lis=%p(%d)) Clients=%d", lis, lis->fd, cupsArrayCount(Clients)); /* * Make sure we don't have a full set of clients already... */ if (cupsArrayCount(Clients) == MaxClients) return; /* * Get a pointer to the next available client... */ if (!Clients) Clients = cupsArrayNew(NULL, NULL); if (!Clients) { cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to allocate memory for clients array!"); cupsdPauseListening(); return; } if (!ActiveClients) ActiveClients = cupsArrayNew((cups_array_func_t)compare_clients, NULL); if (!ActiveClients) { cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to allocate memory for active clients array!"); cupsdPauseListening(); return; } if ((con = calloc(1, sizeof(cupsd_client_t))) == NULL) { cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to allocate memory for client!"); cupsdPauseListening(); return; } /* * Accept the client and get the remote address... */ con->number = ++ LastClientNumber; con->file = -1; if ((con->http = httpAcceptConnection(lis->fd, 0)) == NULL) { if (errno == ENFILE || errno == EMFILE) cupsdPauseListening(); cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to accept client connection - %s.", strerror(errno)); free(con); return; } /* * Save the connected address and port number... */ addrlen = sizeof(con->clientaddr); if (getsockname(httpGetFd(con->http), (struct sockaddr *)&con->clientaddr, &addrlen) || addrlen == 0) con->clientaddr = lis->address; cupsdLogClient(con, CUPSD_LOG_DEBUG, "Server address is \"%s\".", httpAddrString(&con->clientaddr, name, sizeof(name))); /* * Check the number of clients on the same address... */ for (count = 0, tempcon = (cupsd_client_t *)cupsArrayFirst(Clients); tempcon; tempcon = (cupsd_client_t *)cupsArrayNext(Clients)) if (httpAddrEqual(httpGetAddress(tempcon->http), httpGetAddress(con->http))) { count ++; if (count >= MaxClientsPerHost) break; } if (count >= MaxClientsPerHost) { if ((time(NULL) - last_dos) >= 60) { last_dos = time(NULL); cupsdLogMessage(CUPSD_LOG_WARN, "Possible DoS attack - more than %d clients connecting " "from %s.", MaxClientsPerHost, httpGetHostname(con->http, name, sizeof(name))); } httpClose(con->http); free(con); return; } /* * Get the hostname or format the IP address as needed... */ if (HostNameLookups) hostname = httpResolveHostname(con->http, NULL, 0); else hostname = httpGetHostname(con->http, NULL, 0); if (hostname == NULL && HostNameLookups == 2) { /* * Can't have an unresolved IP address with double-lookups enabled... */ httpClose(con->http); cupsdLogClient(con, CUPSD_LOG_WARN, "Name lookup failed - connection from %s closed!", httpGetHostname(con->http, NULL, 0)); free(con); return; } if (HostNameLookups == 2) { /* * Do double lookups as needed... */ http_addrlist_t *addrlist, /* List of addresses */ *addr; /* Current address */ if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, NULL)) != NULL) { /* * See if the hostname maps to the same IP address... */ for (addr = addrlist; addr; addr = addr->next) if (httpAddrEqual(httpGetAddress(con->http), &(addr->addr))) break; } else addr = NULL; httpAddrFreeList(addrlist); if (!addr) { /* * Can't have a hostname that doesn't resolve to the same IP address * with double-lookups enabled... */ httpClose(con->http); cupsdLogClient(con, CUPSD_LOG_WARN, "IP lookup failed - connection from %s closed!", httpGetHostname(con->http, NULL, 0)); free(con); return; } } #ifdef HAVE_TCPD_H /* * See if the connection is denied by TCP wrappers... */ request_init(&wrap_req, RQ_DAEMON, "cupsd", RQ_FILE, httpGetFd(con->http), NULL); fromhost(&wrap_req); if (!hosts_access(&wrap_req)) { httpClose(con->http); cupsdLogClient(con, CUPSD_LOG_WARN, "Connection from %s refused by /etc/hosts.allow and " "/etc/hosts.deny rules.", httpGetHostname(con->http, NULL, 0)); free(con); return; } #endif /* HAVE_TCPD_H */ #ifdef AF_LOCAL if (httpAddrFamily(httpGetAddress(con->http)) == AF_LOCAL) { # ifdef __APPLE__ socklen_t peersize; /* Size of peer credentials */ pid_t peerpid; /* Peer process ID */ char peername[256]; /* Name of process */ peersize = sizeof(peerpid); if (!getsockopt(httpGetFd(con->http), SOL_LOCAL, LOCAL_PEERPID, &peerpid, &peersize)) { if (!proc_name((int)peerpid, peername, sizeof(peername))) cupsdLogClient(con, CUPSD_LOG_DEBUG, "Accepted from %s (Domain ???[%d])", httpGetHostname(con->http, NULL, 0), (int)peerpid); else cupsdLogClient(con, CUPSD_LOG_DEBUG, "Accepted from %s (Domain %s[%d])", httpGetHostname(con->http, NULL, 0), peername, (int)peerpid); } else # endif /* __APPLE__ */ cupsdLogClient(con, CUPSD_LOG_DEBUG, "Accepted from %s (Domain)", httpGetHostname(con->http, NULL, 0)); } else #endif /* AF_LOCAL */ cupsdLogClient(con, CUPSD_LOG_DEBUG, "Accepted from %s:%d (IPv%d)", httpGetHostname(con->http, NULL, 0), httpAddrPort(httpGetAddress(con->http)), httpAddrFamily(httpGetAddress(con->http)) == AF_INET ? 4 : 6); /* * Get the local address the client connected to... */ addrlen = sizeof(temp); if (getsockname(httpGetFd(con->http), (struct sockaddr *)&temp, &addrlen)) { cupsdLogClient(con, CUPSD_LOG_ERROR, "Unable to get local address - %s", strerror(errno)); strlcpy(con->servername, "localhost", sizeof(con->servername)); con->serverport = LocalPort; } #ifdef AF_LOCAL else if (httpAddrFamily(&temp) == AF_LOCAL) { strlcpy(con->servername, "localhost", sizeof(con->servername)); con->serverport = LocalPort; } #endif /* AF_LOCAL */ else { if (httpAddrLocalhost(&temp)) strlcpy(con->servername, "localhost", sizeof(con->servername)); else if (HostNameLookups) httpAddrLookup(&temp, con->servername, sizeof(con->servername)); else httpAddrString(&temp, con->servername, sizeof(con->servername)); con->serverport = httpAddrPort(&(lis->address)); } /* * Add the connection to the array of active clients... */ cupsArrayAdd(Clients, con); /* * Add the socket to the server select. */ cupsdAddSelect(httpGetFd(con->http), (cupsd_selfunc_t)cupsdReadClient, NULL, con); cupsdLogClient(con, CUPSD_LOG_DEBUG, "Waiting for request."); /* * Temporarily suspend accept()'s until we lose a client... */ if (cupsArrayCount(Clients) == MaxClients) cupsdPauseListening(); #ifdef HAVE_SSL /* * See if we are connecting on a secure port... */ if (lis->encryption == HTTP_ENCRYPTION_ALWAYS) { /* * https connection; go secure... */ if (cupsd_start_tls(con, HTTP_ENCRYPTION_ALWAYS)) cupsdCloseClient(con); } else con->auto_ssl = 1; #endif /* HAVE_SSL */ }
0
260,930
static unsigned long get_seg_limit(struct pt_regs *regs, int seg_reg_idx) { struct desc_struct desc; unsigned long limit; short sel; sel = get_segment_selector(regs, seg_reg_idx); if (sel < 0) return 0; if (user_64bit_mode(regs) || v8086_mode(regs)) return -1L; if (!sel) return 0; if (!get_desc(&desc, sel)) return 0; /* * If the granularity bit is set, the limit is given in multiples * of 4096. This also means that the 12 least significant bits are * not tested when checking the segment limits. In practice, * this means that the segment ends in (limit << 12) + 0xfff. */ limit = get_desc_limit(&desc); if (desc.g) limit = (limit << 12) + 0xfff; return limit; }
0
242,069
BrowserTabStripController::BrowserTabStripController(Browser* browser, TabStripModel* model) : model_(model), tabstrip_(NULL), browser_(browser), hover_tab_selector_(model) { model_->AddObserver(this); local_pref_registrar_.Init(g_browser_process->local_state()); local_pref_registrar_.Add(prefs::kTabStripLayoutType, this); }
0
469,356
__be16 xfrm_flowi_dport(const struct flowi *fl, const union flowi_uli *uli) { __be16 port; switch(fl->flowi_proto) { case IPPROTO_TCP: case IPPROTO_UDP: case IPPROTO_UDPLITE: case IPPROTO_SCTP: port = uli->ports.dport; break; case IPPROTO_ICMP: case IPPROTO_ICMPV6: port = htons(uli->icmpt.code); break; case IPPROTO_GRE: port = htons(ntohl(uli->gre_key) & 0xffff); break; default: port = 0; /*XXX*/ } return port; }
0
263,849
wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se) { s64 gran, vdiff = curr->vruntime - se->vruntime; if (vdiff <= 0) return -1; gran = wakeup_gran(se); if (vdiff > gran) return 1; return 0; }
0
26,468
static int remaining_bits ( WMAProDecodeCtx * s , GetBitContext * gb ) { return s -> buf_bit_size - get_bits_count ( gb ) ; }
0
301,066
static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) { struct vcpu_svm *svm = to_svm(vcpu); #ifdef CONFIG_X86_64 if (vcpu->arch.efer & EFER_LME) { if (!is_paging(vcpu) && (cr0 & X86_CR0_PG)) { vcpu->arch.efer |= EFER_LMA; svm->vmcb->save.efer |= EFER_LMA | EFER_LME; } if (is_paging(vcpu) && !(cr0 & X86_CR0_PG)) { vcpu->arch.efer &= ~EFER_LMA; svm->vmcb->save.efer &= ~(EFER_LMA | EFER_LME); } } #endif vcpu->arch.cr0 = cr0; if (!npt_enabled) cr0 |= X86_CR0_PG | X86_CR0_WP; if (!vcpu->fpu_active) cr0 |= X86_CR0_TS; /* * re-enable caching here because the QEMU bios * does not do it - this results in some delay at * reboot */ cr0 &= ~(X86_CR0_CD | X86_CR0_NW); svm->vmcb->save.cr0 = cr0; mark_dirty(svm->vmcb, VMCB_CR); update_cr0_intercept(svm); }
0
28,385
static void update_unicast_addr ( unicast_addr_t * req_addr , unicast_addr_t * ack_addr ) { if ( ack_addr -> addr . type != AT_NONE && ack_addr -> port != 0 ) { memcpy ( req_addr -> addr_buf , ack_addr -> addr_buf , sizeof ( req_addr -> addr_buf ) ) ; SET_ADDRESS ( & req_addr -> addr , ack_addr -> addr . type , ack_addr -> addr . len , req_addr -> addr_buf ) ; req_addr -> port = ack_addr -> port ; } }
0
398,205
lib_eventloop_main_core(args) VALUE args; { struct evloop_params *params = (struct evloop_params *)args; check_rootwidget_flag = params->check_root; Tcl_CreateEventSource(rbtk_EventSetupProc, rbtk_EventCheckProc, (ClientData)args); if (lib_eventloop_core(params->check_root, params->update_flag, params->check_var, params->interp)) { return Qtrue; } else { return Qfalse; } }
0
174,496
bool PaintController::CacheIsAllInvalid() const { DCHECK(!RuntimeEnabledFeatures::SlimmingPaintV2Enabled()); return current_paint_artifact_.IsEmpty() && current_cache_generation_.GetPaintInvalidationReason() != PaintInvalidationReason::kNone; }
0
521,334
my_bool mark_changed(int, const struct my_option *opt, char *) { if (opt->app_type) { sys_var *var= (sys_var*) opt->app_type; var->value_origin= sys_var::CONFIG; } return 0; }
0
36,197
GF_Err edts_box_read(GF_Box *s, GF_BitStream *bs) { return gf_isom_box_array_read(s, bs); }
0
331,055
static SocketAddressLegacy *sd_server_config(QDict *options, Error **errp) { QDict *server = NULL; QObject *crumpled_server = NULL; Visitor *iv = NULL; SocketAddress *saddr_flat = NULL; SocketAddressLegacy *saddr = NULL; Error *local_err = NULL; qdict_extract_subqdict(options, &server, "server."); crumpled_server = qdict_crumple(server, errp); if (!crumpled_server) { goto done; } /* * FIXME .numeric, .to, .ipv4 or .ipv6 don't work with -drive * server.type=inet. .to doesn't matter, it's ignored anyway. * That's because when @options come from -blockdev or * blockdev_add, members are typed according to the QAPI schema, * but when they come from -drive, they're all QString. The * visitor expects the former. */ iv = qobject_input_visitor_new(crumpled_server); visit_type_SocketAddress(iv, NULL, &saddr_flat, &local_err); if (local_err) { error_propagate(errp, local_err); goto done; } saddr = socket_address_crumple(saddr_flat); done: qapi_free_SocketAddress(saddr_flat); visit_free(iv); qobject_decref(crumpled_server); QDECREF(server); return saddr; }
0