unique_id
int64 13
189k
| target
int64 0
1
| code
stringlengths 20
241k
| __index_level_0__
int64 0
18.9k
|
---|---|---|---|
144,052 | 0 | png_set_expand(png_structp png_ptr)
{
png_debug(1, "in png_set_expand");
if (png_ptr == NULL)
return;
png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
}
| 8,500 |
64,675 | 0 | onig_region_clear(OnigRegion* region)
{
int i;
for (i = 0; i < region->num_regs; i++) {
region->beg[i] = region->end[i] = ONIG_REGION_NOTPOS;
}
#ifdef USE_CAPTURE_HISTORY
history_root_free(region);
#endif
}
| 8,501 |
49,657 | 0 | int blk_alloc_devt(struct hd_struct *part, dev_t *devt)
{
struct gendisk *disk = part_to_disk(part);
int idx;
/* in consecutive minor range? */
if (part->partno < disk->minors) {
*devt = MKDEV(disk->major, disk->first_minor + part->partno);
return 0;
}
/* allocate ext devt */
idr_preload(GFP_KERNEL);
spin_lock_bh(&ext_devt_lock);
idx = idr_alloc(&ext_devt_idr, part, 0, NR_EXT_DEVT, GFP_NOWAIT);
spin_unlock_bh(&ext_devt_lock);
idr_preload_end();
if (idx < 0)
return idx == -ENOSPC ? -EBUSY : idx;
*devt = MKDEV(BLOCK_EXT_MAJOR, blk_mangle_minor(idx));
return 0;
}
| 8,502 |
37,786 | 0 | static void nested_svm_inject_npf_exit(struct kvm_vcpu *vcpu,
struct x86_exception *fault)
{
struct vcpu_svm *svm = to_svm(vcpu);
if (svm->vmcb->control.exit_code != SVM_EXIT_NPF) {
/*
* TODO: track the cause of the nested page fault, and
* correctly fill in the high bits of exit_info_1.
*/
svm->vmcb->control.exit_code = SVM_EXIT_NPF;
svm->vmcb->control.exit_code_hi = 0;
svm->vmcb->control.exit_info_1 = (1ULL << 32);
svm->vmcb->control.exit_info_2 = fault->address;
}
svm->vmcb->control.exit_info_1 &= ~0xffffffffULL;
svm->vmcb->control.exit_info_1 |= fault->error_code;
/*
* The present bit is always zero for page structure faults on real
* hardware.
*/
if (svm->vmcb->control.exit_info_1 & (2ULL << 32))
svm->vmcb->control.exit_info_1 &= ~1;
nested_svm_vmexit(svm);
}
| 8,503 |
149,957 | 0 | bool LayerTreeHostImpl::InitializeRenderer(
CompositorFrameSink* compositor_frame_sink) {
TRACE_EVENT0("cc", "LayerTreeHostImpl::InitializeRenderer");
ReleaseCompositorFrameSink();
if (!compositor_frame_sink->BindToClient(this)) {
return false;
}
if (!compositor_frame_sink->context_provider())
SetMemoryPolicy(settings_.software_memory_policy);
compositor_frame_sink_ = compositor_frame_sink;
has_valid_compositor_frame_sink_ = true;
resource_provider_ = base::MakeUnique<ResourceProvider>(
compositor_frame_sink_->context_provider(),
compositor_frame_sink_->shared_bitmap_manager(),
compositor_frame_sink_->gpu_memory_buffer_manager(),
task_runner_provider_->blocking_main_thread_task_runner(),
settings_.renderer_settings.texture_id_allocation_chunk_size,
compositor_frame_sink_->capabilities().delegated_sync_points_required,
settings_.renderer_settings.use_gpu_memory_buffer_resources,
settings_.enable_color_correct_rendering,
settings_.renderer_settings.buffer_to_texture_target_map);
UpdateGpuRasterizationStatus();
active_tree_->set_needs_update_draw_properties();
if (pending_tree_)
pending_tree_->set_needs_update_draw_properties();
CreateTileManagerResources();
RecreateTileResources();
client_->OnCanDrawStateChanged(CanDraw());
SetFullViewportDamage();
SetRequiresHighResToDraw();
return true;
}
| 8,504 |
85,863 | 0 | static void close_table_device(struct table_device *td, struct mapped_device *md)
{
if (!td->dm_dev.bdev)
return;
bd_unlink_disk_holder(td->dm_dev.bdev, dm_disk(md));
blkdev_put(td->dm_dev.bdev, td->dm_dev.mode | FMODE_EXCL);
put_dax(td->dm_dev.dax_dev);
td->dm_dev.bdev = NULL;
td->dm_dev.dax_dev = NULL;
}
| 8,505 |
39,020 | 0 | findoprnd_recurse(QueryItem *ptr, uint32 *pos, int nnodes)
{
/* since this function recurses, it could be driven to stack overflow. */
check_stack_depth();
if (*pos >= nnodes)
elog(ERROR, "malformed tsquery: operand not found");
if (ptr[*pos].type == QI_VAL ||
ptr[*pos].type == QI_VALSTOP) /* need to handle VALSTOP here, they
* haven't been cleaned away yet. */
{
(*pos)++;
}
else
{
Assert(ptr[*pos].type == QI_OPR);
if (ptr[*pos].qoperator.oper == OP_NOT)
{
ptr[*pos].qoperator.left = 1;
(*pos)++;
findoprnd_recurse(ptr, pos, nnodes);
}
else
{
QueryOperator *curitem = &ptr[*pos].qoperator;
int tmp = *pos;
Assert(curitem->oper == OP_AND || curitem->oper == OP_OR);
(*pos)++;
findoprnd_recurse(ptr, pos, nnodes);
curitem->left = *pos - tmp;
findoprnd_recurse(ptr, pos, nnodes);
}
}
}
| 8,506 |
33,303 | 0 | static int install_process_keyring(void)
{
struct cred *new;
int ret;
new = prepare_creds();
if (!new)
return -ENOMEM;
ret = install_process_keyring_to_cred(new);
if (ret < 0) {
abort_creds(new);
return ret != -EEXIST ? ret : 0;
}
return commit_creds(new);
}
| 8,507 |
24,562 | 0 | static void op32_tx_suspend(struct b43_dmaring *ring)
{
b43_dma_write(ring, B43_DMA32_TXCTL, b43_dma_read(ring, B43_DMA32_TXCTL)
| B43_DMA32_TXSUSPEND);
}
| 8,508 |
140,918 | 0 | bool PresentationConnection::matches(
const WebPresentationSessionInfo& sessionInfo) const {
return m_url == KURL(sessionInfo.url) && m_id == String(sessionInfo.id);
}
| 8,509 |
67,796 | 0 | static int sig_check_netjoins(void)
{
GSList *tmp, *next;
int diff;
time_t now;
now = time(NULL);
/* first print all netjoins which haven't had any new joins
* for NETJOIN_WAIT_TIME; this may cause them to be removed
* (all users who rejoined, rejoined all channels) */
for (tmp = joinservers; tmp != NULL; tmp = next) {
NETJOIN_SERVER_REC *server = tmp->data;
next = tmp->next;
diff = now-server->last_netjoin;
if (diff <= NETJOIN_WAIT_TIME) {
/* wait for more JOINs */
continue;
}
if (server->netjoins != NULL)
print_netjoins(server, NULL);
}
/* now remove all netjoins which haven't had any new joins
* for NETJOIN_MAX_WAIT (user rejoined some but not all channels
* after split) */
for (tmp = joinservers; tmp != NULL; tmp = next) {
NETJOIN_SERVER_REC *server = tmp->data;
next = tmp->next;
diff = now-server->last_netjoin;
if (diff >= NETJOIN_MAX_WAIT) {
/* waited long enough, forget about the rest */
netjoin_server_remove(server);
}
}
if (joinservers == NULL) {
g_source_remove(join_tag);
signal_remove("print starting", (SIGNAL_FUNC) sig_print_starting);
join_tag = -1;
}
return 1;
}
| 8,510 |
187,347 | 1 | xsltDocumentElem(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNodePtr inst, xsltStylePreCompPtr castedComp)
{
#ifdef XSLT_REFACTORED
xsltStyleItemDocumentPtr comp = (xsltStyleItemDocumentPtr) castedComp;
#else
xsltStylePreCompPtr comp = castedComp;
#endif
xsltStylesheetPtr style = NULL;
int ret;
xmlChar *filename = NULL, *prop, *elements;
xmlChar *element, *end;
xmlDocPtr res = NULL;
xmlDocPtr oldOutput;
xmlNodePtr oldInsert, root;
const char *oldOutputFile;
xsltOutputType oldType;
xmlChar *URL = NULL;
const xmlChar *method;
const xmlChar *doctypePublic;
const xmlChar *doctypeSystem;
const xmlChar *version;
const xmlChar *encoding;
int redirect_write_append = 0;
if ((ctxt == NULL) || (node == NULL) || (inst == NULL) || (comp == NULL))
return;
if (comp->filename == NULL) {
if (xmlStrEqual(inst->name, (const xmlChar *) "output")) {
/*
* The element "output" is in the namespace XSLT_SAXON_NAMESPACE
* (http://icl.com/saxon)
* The @file is in no namespace.
*/
#ifdef WITH_XSLT_DEBUG_EXTRA
xsltGenericDebug(xsltGenericDebugContext,
"Found saxon:output extension\n");
#endif
URL = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *) "file",
XSLT_SAXON_NAMESPACE);
if (URL == NULL)
URL = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *) "href",
XSLT_SAXON_NAMESPACE);
} else if (xmlStrEqual(inst->name, (const xmlChar *) "write")) {
#ifdef WITH_XSLT_DEBUG_EXTRA
xsltGenericDebug(xsltGenericDebugContext,
"Found xalan:write extension\n");
#endif
URL = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *)
"select",
XSLT_XALAN_NAMESPACE);
if (URL != NULL) {
xmlXPathCompExprPtr cmp;
xmlChar *val;
/*
* Trying to handle bug #59212
* The value of the "select" attribute is an
* XPath expression.
* (see http://xml.apache.org/xalan-j/extensionslib.html#redirect)
*/
cmp = xmlXPathCompile(URL);
val = xsltEvalXPathString(ctxt, cmp);
xmlXPathFreeCompExpr(cmp);
xmlFree(URL);
URL = val;
}
if (URL == NULL)
URL = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *)
"file",
XSLT_XALAN_NAMESPACE);
if (URL == NULL)
URL = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *)
"href",
XSLT_XALAN_NAMESPACE);
} else if (xmlStrEqual(inst->name, (const xmlChar *) "document")) {
URL = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *) "href",
NULL);
}
} else {
URL = xmlStrdup(comp->filename);
}
if (URL == NULL) {
xsltTransformError(ctxt, NULL, inst,
"xsltDocumentElem: href/URI-Reference not found\n");
return;
}
/*
* If the computation failed, it's likely that the URL wasn't escaped
*/
filename = xmlBuildURI(URL, (const xmlChar *) ctxt->outputFile);
if (filename == NULL) {
xmlChar *escURL;
escURL=xmlURIEscapeStr(URL, BAD_CAST ":/.?,");
if (escURL != NULL) {
filename = xmlBuildURI(escURL, (const xmlChar *) ctxt->outputFile);
xmlFree(escURL);
}
}
if (filename == NULL) {
xsltTransformError(ctxt, NULL, inst,
"xsltDocumentElem: URL computation failed for %s\n",
URL);
xmlFree(URL);
return;
}
/*
* Security checking: can we write to this resource
*/
if (ctxt->sec != NULL) {
ret = xsltCheckWrite(ctxt->sec, ctxt, filename);
if (ret == 0) {
xsltTransformError(ctxt, NULL, inst,
"xsltDocumentElem: write rights for %s denied\n",
filename);
xmlFree(URL);
xmlFree(filename);
return;
}
}
oldOutputFile = ctxt->outputFile;
oldOutput = ctxt->output;
oldInsert = ctxt->insert;
oldType = ctxt->type;
ctxt->outputFile = (const char *) filename;
style = xsltNewStylesheet();
if (style == NULL) {
xsltTransformError(ctxt, NULL, inst,
"xsltDocumentElem: out of memory\n");
goto error;
}
/*
* Version described in 1.1 draft allows full parameterization
* of the output.
*/
prop = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *) "version",
NULL);
if (prop != NULL) {
if (style->version != NULL)
xmlFree(style->version);
style->version = prop;
}
prop = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *) "encoding",
NULL);
if (prop != NULL) {
if (style->encoding != NULL)
xmlFree(style->encoding);
style->encoding = prop;
}
prop = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *) "method",
NULL);
if (prop != NULL) {
const xmlChar *URI;
if (style->method != NULL)
xmlFree(style->method);
style->method = NULL;
if (style->methodURI != NULL)
xmlFree(style->methodURI);
style->methodURI = NULL;
URI = xsltGetQNameURI(inst, &prop);
if (prop == NULL) {
if (style != NULL) style->errors++;
} else if (URI == NULL) {
if ((xmlStrEqual(prop, (const xmlChar *) "xml")) ||
(xmlStrEqual(prop, (const xmlChar *) "html")) ||
(xmlStrEqual(prop, (const xmlChar *) "text"))) {
style->method = prop;
} else {
xsltTransformError(ctxt, NULL, inst,
"invalid value for method: %s\n", prop);
if (style != NULL) style->warnings++;
}
} else {
style->method = prop;
style->methodURI = xmlStrdup(URI);
}
}
prop = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *)
"doctype-system", NULL);
if (prop != NULL) {
if (style->doctypeSystem != NULL)
xmlFree(style->doctypeSystem);
style->doctypeSystem = prop;
}
prop = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *)
"doctype-public", NULL);
if (prop != NULL) {
if (style->doctypePublic != NULL)
xmlFree(style->doctypePublic);
style->doctypePublic = prop;
}
prop = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *) "standalone",
NULL);
if (prop != NULL) {
if (xmlStrEqual(prop, (const xmlChar *) "yes")) {
style->standalone = 1;
} else if (xmlStrEqual(prop, (const xmlChar *) "no")) {
style->standalone = 0;
} else {
xsltTransformError(ctxt, NULL, inst,
"invalid value for standalone: %s\n",
prop);
if (style != NULL) style->warnings++;
}
xmlFree(prop);
}
prop = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *) "indent",
NULL);
if (prop != NULL) {
if (xmlStrEqual(prop, (const xmlChar *) "yes")) {
style->indent = 1;
} else if (xmlStrEqual(prop, (const xmlChar *) "no")) {
style->indent = 0;
} else {
xsltTransformError(ctxt, NULL, inst,
"invalid value for indent: %s\n", prop);
if (style != NULL) style->warnings++;
}
xmlFree(prop);
}
prop = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *)
"omit-xml-declaration",
NULL);
if (prop != NULL) {
if (xmlStrEqual(prop, (const xmlChar *) "yes")) {
style->omitXmlDeclaration = 1;
} else if (xmlStrEqual(prop, (const xmlChar *) "no")) {
style->omitXmlDeclaration = 0;
} else {
xsltTransformError(ctxt, NULL, inst,
"invalid value for omit-xml-declaration: %s\n",
prop);
if (style != NULL) style->warnings++;
}
xmlFree(prop);
}
elements = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *)
"cdata-section-elements",
NULL);
if (elements != NULL) {
if (style->stripSpaces == NULL)
style->stripSpaces = xmlHashCreate(10);
if (style->stripSpaces == NULL)
return;
element = elements;
while (*element != 0) {
while (IS_BLANK_CH(*element))
element++;
if (*element == 0)
break;
end = element;
while ((*end != 0) && (!IS_BLANK_CH(*end)))
end++;
element = xmlStrndup(element, end - element);
if (element) {
const xmlChar *URI;
#ifdef WITH_XSLT_DEBUG_PARSING
xsltGenericDebug(xsltGenericDebugContext,
"add cdata section output element %s\n",
element);
#endif
URI = xsltGetQNameURI(inst, &element);
xmlHashAddEntry2(style->stripSpaces, element, URI,
(xmlChar *) "cdata");
xmlFree(element);
}
element = end;
}
xmlFree(elements);
}
/*
* Create a new document tree and process the element template
*/
XSLT_GET_IMPORT_PTR(method, style, method)
XSLT_GET_IMPORT_PTR(doctypePublic, style, doctypePublic)
XSLT_GET_IMPORT_PTR(doctypeSystem, style, doctypeSystem)
XSLT_GET_IMPORT_PTR(version, style, version)
XSLT_GET_IMPORT_PTR(encoding, style, encoding)
if ((method != NULL) &&
(!xmlStrEqual(method, (const xmlChar *) "xml"))) {
if (xmlStrEqual(method, (const xmlChar *) "html")) {
ctxt->type = XSLT_OUTPUT_HTML;
if (((doctypePublic != NULL) || (doctypeSystem != NULL)))
res = htmlNewDoc(doctypeSystem, doctypePublic);
else {
if (version != NULL) {
#ifdef XSLT_GENERATE_HTML_DOCTYPE
xsltGetHTMLIDs(version, &doctypePublic, &doctypeSystem);
#endif
}
res = htmlNewDocNoDtD(doctypeSystem, doctypePublic);
}
if (res == NULL)
goto error;
res->dict = ctxt->dict;
xmlDictReference(res->dict);
} else if (xmlStrEqual(method, (const xmlChar *) "xhtml")) {
xsltTransformError(ctxt, NULL, inst,
"xsltDocumentElem: unsupported method xhtml\n",
style->method);
ctxt->type = XSLT_OUTPUT_HTML;
res = htmlNewDocNoDtD(doctypeSystem, doctypePublic);
if (res == NULL)
goto error;
res->dict = ctxt->dict;
xmlDictReference(res->dict);
} else if (xmlStrEqual(method, (const xmlChar *) "text")) {
ctxt->type = XSLT_OUTPUT_TEXT;
res = xmlNewDoc(style->version);
if (res == NULL)
goto error;
res->dict = ctxt->dict;
xmlDictReference(res->dict);
#ifdef WITH_XSLT_DEBUG
xsltGenericDebug(xsltGenericDebugContext,
"reusing transformation dict for output\n");
#endif
} else {
xsltTransformError(ctxt, NULL, inst,
"xsltDocumentElem: unsupported method %s\n",
style->method);
goto error;
}
} else {
ctxt->type = XSLT_OUTPUT_XML;
res = xmlNewDoc(style->version);
if (res == NULL)
goto error;
res->dict = ctxt->dict;
xmlDictReference(res->dict);
#ifdef WITH_XSLT_DEBUG
xsltGenericDebug(xsltGenericDebugContext,
"reusing transformation dict for output\n");
#endif
}
res->charset = XML_CHAR_ENCODING_UTF8;
if (encoding != NULL)
res->encoding = xmlStrdup(encoding);
ctxt->output = res;
ctxt->insert = (xmlNodePtr) res;
xsltApplySequenceConstructor(ctxt, node, inst->children, NULL);
/*
* Do some post processing work depending on the generated output
*/
root = xmlDocGetRootElement(res);
if (root != NULL) {
const xmlChar *doctype = NULL;
if ((root->ns != NULL) && (root->ns->prefix != NULL))
doctype = xmlDictQLookup(ctxt->dict, root->ns->prefix, root->name);
if (doctype == NULL)
doctype = root->name;
/*
* Apply the default selection of the method
*/
if ((method == NULL) &&
(root->ns == NULL) &&
(!xmlStrcasecmp(root->name, (const xmlChar *) "html"))) {
xmlNodePtr tmp;
tmp = res->children;
while ((tmp != NULL) && (tmp != root)) {
if (tmp->type == XML_ELEMENT_NODE)
break;
if ((tmp->type == XML_TEXT_NODE) && (!xmlIsBlankNode(tmp)))
break;
tmp = tmp->next;
}
if (tmp == root) {
ctxt->type = XSLT_OUTPUT_HTML;
res->type = XML_HTML_DOCUMENT_NODE;
if (((doctypePublic != NULL) || (doctypeSystem != NULL))) {
res->intSubset = xmlCreateIntSubset(res, doctype,
doctypePublic,
doctypeSystem);
#ifdef XSLT_GENERATE_HTML_DOCTYPE
} else if (version != NULL) {
xsltGetHTMLIDs(version, &doctypePublic,
&doctypeSystem);
if (((doctypePublic != NULL) || (doctypeSystem != NULL)))
res->intSubset =
xmlCreateIntSubset(res, doctype,
doctypePublic,
doctypeSystem);
#endif
}
}
}
if (ctxt->type == XSLT_OUTPUT_XML) {
XSLT_GET_IMPORT_PTR(doctypePublic, style, doctypePublic)
XSLT_GET_IMPORT_PTR(doctypeSystem, style, doctypeSystem)
if (((doctypePublic != NULL) || (doctypeSystem != NULL)))
res->intSubset = xmlCreateIntSubset(res, doctype,
doctypePublic,
doctypeSystem);
}
}
/*
* Calls to redirect:write also take an optional attribute append.
* Attribute append="true|yes" which will attempt to simply append
* to an existing file instead of always opening a new file. The
* default behavior of always overwriting the file still happens
* if we do not specify append.
* Note that append use will forbid use of remote URI target.
*/
prop = xsltEvalAttrValueTemplate(ctxt, inst, (const xmlChar *)"append",
NULL);
if (prop != NULL) {
if (xmlStrEqual(prop, (const xmlChar *) "true") ||
xmlStrEqual(prop, (const xmlChar *) "yes")) {
style->omitXmlDeclaration = 1;
redirect_write_append = 1;
} else
style->omitXmlDeclaration = 0;
xmlFree(prop);
}
if (redirect_write_append) {
FILE *f;
f = fopen((const char *) filename, "ab");
if (f == NULL) {
ret = -1;
} else {
ret = xsltSaveResultToFile(f, res, style);
fclose(f);
}
} else {
ret = xsltSaveResultToFilename((const char *) filename, res, style, 0);
}
if (ret < 0) {
xsltTransformError(ctxt, NULL, inst,
"xsltDocumentElem: unable to save to %s\n",
filename);
ctxt->state = XSLT_STATE_ERROR;
#ifdef WITH_XSLT_DEBUG_EXTRA
} else {
xsltGenericDebug(xsltGenericDebugContext,
"Wrote %d bytes to %s\n", ret, filename);
#endif
}
error:
ctxt->output = oldOutput;
ctxt->insert = oldInsert;
ctxt->type = oldType;
ctxt->outputFile = oldOutputFile;
if (URL != NULL)
xmlFree(URL);
if (filename != NULL)
xmlFree(filename);
if (style != NULL)
xsltFreeStylesheet(style);
if (res != NULL)
xmlFreeDoc(res);
}
| 8,511 |
45,810 | 0 | int lrw_crypt(struct blkcipher_desc *desc, struct scatterlist *sdst,
struct scatterlist *ssrc, unsigned int nbytes,
struct lrw_crypt_req *req)
{
const unsigned int bsize = LRW_BLOCK_SIZE;
const unsigned int max_blks = req->tbuflen / bsize;
struct lrw_table_ctx *ctx = req->table_ctx;
struct blkcipher_walk walk;
unsigned int nblocks;
be128 *iv, *src, *dst, *t;
be128 *t_buf = req->tbuf;
int err, i;
BUG_ON(max_blks < 1);
blkcipher_walk_init(&walk, sdst, ssrc, nbytes);
err = blkcipher_walk_virt(desc, &walk);
nbytes = walk.nbytes;
if (!nbytes)
return err;
nblocks = min(walk.nbytes / bsize, max_blks);
src = (be128 *)walk.src.virt.addr;
dst = (be128 *)walk.dst.virt.addr;
/* calculate first value of T */
iv = (be128 *)walk.iv;
t_buf[0] = *iv;
/* T <- I*Key2 */
gf128mul_64k_bbe(&t_buf[0], ctx->table);
i = 0;
goto first;
for (;;) {
do {
for (i = 0; i < nblocks; i++) {
/* T <- I*Key2, using the optimization
* discussed in the specification */
be128_xor(&t_buf[i], t,
&ctx->mulinc[get_index128(iv)]);
inc(iv);
first:
t = &t_buf[i];
/* PP <- T xor P */
be128_xor(dst + i, t, src + i);
}
/* CC <- E(Key2,PP) */
req->crypt_fn(req->crypt_ctx, (u8 *)dst,
nblocks * bsize);
/* C <- T xor CC */
for (i = 0; i < nblocks; i++)
be128_xor(dst + i, dst + i, &t_buf[i]);
src += nblocks;
dst += nblocks;
nbytes -= nblocks * bsize;
nblocks = min(nbytes / bsize, max_blks);
} while (nblocks > 0);
err = blkcipher_walk_done(desc, &walk, nbytes);
nbytes = walk.nbytes;
if (!nbytes)
break;
nblocks = min(nbytes / bsize, max_blks);
src = (be128 *)walk.src.virt.addr;
dst = (be128 *)walk.dst.virt.addr;
}
return err;
}
| 8,512 |
90,168 | 0 | static int ext4_ext_truncate_extend_restart(handle_t *handle,
struct inode *inode,
int needed)
{
int err;
if (!ext4_handle_valid(handle))
return 0;
if (handle->h_buffer_credits >= needed)
return 0;
/*
* If we need to extend the journal get a few extra blocks
* while we're at it for efficiency's sake.
*/
needed += 3;
err = ext4_journal_extend(handle, needed - handle->h_buffer_credits);
if (err <= 0)
return err;
err = ext4_truncate_restart_trans(handle, inode, needed);
if (err == 0)
err = -EAGAIN;
return err;
}
| 8,513 |
15,055 | 0 | PHP_FUNCTION(dom_document_save_html)
{
zval *id, *nodep = NULL;
xmlDoc *docp;
xmlNode *node;
xmlBufferPtr buf;
dom_object *intern, *nodeobj;
xmlChar *mem = NULL;
int size = 0, format;
dom_doc_propsptr doc_props;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"O|O!", &id, dom_document_class_entry, &nodep, dom_node_class_entry)
== FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
doc_props = dom_get_doc_props(intern->document);
format = doc_props->formatoutput;
if (nodep != NULL) {
/* Dump contents of Node */
DOM_GET_OBJ(node, nodep, xmlNodePtr, nodeobj);
if (node->doc != docp) {
php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
RETURN_FALSE;
}
buf = xmlBufferCreate();
if (!buf) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch buffer");
RETURN_FALSE;
}
if (node->type == XML_DOCUMENT_FRAG_NODE) {
int one_size;
for (node = node->children; node; node = node->next) {
one_size = htmlNodeDump(buf, docp, node);
if (one_size >= 0) {
size += one_size;
} else {
size = -1;
break;
}
}
} else {
size = htmlNodeDump(buf, docp, node);
}
if (size >= 0) {
mem = (xmlChar*) xmlBufferContent(buf);
if (!mem) {
RETVAL_FALSE;
} else {
RETVAL_STRINGL((const char*) mem, size, 1);
}
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error dumping HTML node");
RETVAL_FALSE;
}
xmlBufferFree(buf);
} else {
#if LIBXML_VERSION >= 20623
htmlDocDumpMemoryFormat(docp, &mem, &size, format);
#else
htmlDocDumpMemory(docp, &mem, &size);
#endif
if (!size) {
RETVAL_FALSE;
} else {
RETVAL_STRINGL((const char*) mem, size, 1);
}
if (mem)
xmlFree(mem);
}
}
| 8,514 |
147,519 | 0 | static void LongLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::ToImpl(holder);
V8SetReturnValue(info, static_cast<double>(impl->longLongAttribute()));
}
| 8,515 |
104,465 | 0 | GLvoid StubGLShaderSource(GLuint shader, GLsizei count, const char** str,
const GLint* length) {
glShaderSource(shader, count, str, length);
}
| 8,516 |
175,934 | 0 | void smp_proc_rand(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
uint8_t* p = p_data->p_data;
SMP_TRACE_DEBUG("%s", __func__);
if (smp_command_has_invalid_parameters(p_cb)) {
tSMP_INT_DATA smp_int_data;
smp_int_data.status = SMP_INVALID_PARAMETERS;
smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp_int_data);
return;
}
/* save the SRand for comparison */
STREAM_TO_ARRAY(p_cb->rrand, p, BT_OCTET16_LEN);
}
| 8,517 |
28,561 | 0 | static inline int qeth_get_initial_mtu_for_card(struct qeth_card *card)
{
switch (card->info.type) {
case QETH_CARD_TYPE_UNKNOWN:
return 1500;
case QETH_CARD_TYPE_IQD:
return card->info.max_mtu;
case QETH_CARD_TYPE_OSD:
switch (card->info.link_type) {
case QETH_LINK_TYPE_HSTR:
case QETH_LINK_TYPE_LANE_TR:
return 2000;
default:
return card->options.layer2 ? 1500 : 1492;
}
case QETH_CARD_TYPE_OSM:
case QETH_CARD_TYPE_OSX:
return card->options.layer2 ? 1500 : 1492;
default:
return 1500;
}
}
| 8,518 |
121,711 | 0 | MediaStreamDevicesController::~MediaStreamDevicesController() {
if (!callback_.is_null()) {
callback_.Run(content::MediaStreamDevices(),
scoped_ptr<content::MediaStreamUI>());
}
}
| 8,519 |
90,777 | 0 | static int hls_transform_tree(HEVCContext *s, int x0, int y0,
int xBase, int yBase, int cb_xBase, int cb_yBase,
int log2_cb_size, int log2_trafo_size,
int trafo_depth, int blk_idx,
const int *base_cbf_cb, const int *base_cbf_cr)
{
HEVCLocalContext *lc = s->HEVClc;
uint8_t split_transform_flag;
int cbf_cb[2];
int cbf_cr[2];
int ret;
cbf_cb[0] = base_cbf_cb[0];
cbf_cb[1] = base_cbf_cb[1];
cbf_cr[0] = base_cbf_cr[0];
cbf_cr[1] = base_cbf_cr[1];
if (lc->cu.intra_split_flag) {
if (trafo_depth == 1) {
lc->tu.intra_pred_mode = lc->pu.intra_pred_mode[blk_idx];
if (s->ps.sps->chroma_format_idc == 3) {
lc->tu.intra_pred_mode_c = lc->pu.intra_pred_mode_c[blk_idx];
lc->tu.chroma_mode_c = lc->pu.chroma_mode_c[blk_idx];
} else {
lc->tu.intra_pred_mode_c = lc->pu.intra_pred_mode_c[0];
lc->tu.chroma_mode_c = lc->pu.chroma_mode_c[0];
}
}
} else {
lc->tu.intra_pred_mode = lc->pu.intra_pred_mode[0];
lc->tu.intra_pred_mode_c = lc->pu.intra_pred_mode_c[0];
lc->tu.chroma_mode_c = lc->pu.chroma_mode_c[0];
}
if (log2_trafo_size <= s->ps.sps->log2_max_trafo_size &&
log2_trafo_size > s->ps.sps->log2_min_tb_size &&
trafo_depth < lc->cu.max_trafo_depth &&
!(lc->cu.intra_split_flag && trafo_depth == 0)) {
split_transform_flag = ff_hevc_split_transform_flag_decode(s, log2_trafo_size);
} else {
int inter_split = s->ps.sps->max_transform_hierarchy_depth_inter == 0 &&
lc->cu.pred_mode == MODE_INTER &&
lc->cu.part_mode != PART_2Nx2N &&
trafo_depth == 0;
split_transform_flag = log2_trafo_size > s->ps.sps->log2_max_trafo_size ||
(lc->cu.intra_split_flag && trafo_depth == 0) ||
inter_split;
}
if (s->ps.sps->chroma_format_idc && (log2_trafo_size > 2 || s->ps.sps->chroma_format_idc == 3)) {
if (trafo_depth == 0 || cbf_cb[0]) {
cbf_cb[0] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
if (s->ps.sps->chroma_format_idc == 2 && (!split_transform_flag || log2_trafo_size == 3)) {
cbf_cb[1] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
}
}
if (trafo_depth == 0 || cbf_cr[0]) {
cbf_cr[0] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
if (s->ps.sps->chroma_format_idc == 2 && (!split_transform_flag || log2_trafo_size == 3)) {
cbf_cr[1] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
}
}
}
if (split_transform_flag) {
const int trafo_size_split = 1 << (log2_trafo_size - 1);
const int x1 = x0 + trafo_size_split;
const int y1 = y0 + trafo_size_split;
#define SUBDIVIDE(x, y, idx) \
do { \
ret = hls_transform_tree(s, x, y, x0, y0, cb_xBase, cb_yBase, log2_cb_size, \
log2_trafo_size - 1, trafo_depth + 1, idx, \
cbf_cb, cbf_cr); \
if (ret < 0) \
return ret; \
} while (0)
SUBDIVIDE(x0, y0, 0);
SUBDIVIDE(x1, y0, 1);
SUBDIVIDE(x0, y1, 2);
SUBDIVIDE(x1, y1, 3);
#undef SUBDIVIDE
} else {
int min_tu_size = 1 << s->ps.sps->log2_min_tb_size;
int log2_min_tu_size = s->ps.sps->log2_min_tb_size;
int min_tu_width = s->ps.sps->min_tb_width;
int cbf_luma = 1;
if (lc->cu.pred_mode == MODE_INTRA || trafo_depth != 0 ||
cbf_cb[0] || cbf_cr[0] ||
(s->ps.sps->chroma_format_idc == 2 && (cbf_cb[1] || cbf_cr[1]))) {
cbf_luma = ff_hevc_cbf_luma_decode(s, trafo_depth);
}
ret = hls_transform_unit(s, x0, y0, xBase, yBase, cb_xBase, cb_yBase,
log2_cb_size, log2_trafo_size,
blk_idx, cbf_luma, cbf_cb, cbf_cr);
if (ret < 0)
return ret;
if (cbf_luma) {
int i, j;
for (i = 0; i < (1 << log2_trafo_size); i += min_tu_size)
for (j = 0; j < (1 << log2_trafo_size); j += min_tu_size) {
int x_tu = (x0 + j) >> log2_min_tu_size;
int y_tu = (y0 + i) >> log2_min_tu_size;
s->cbf_luma[y_tu * min_tu_width + x_tu] = 1;
}
}
if (!s->sh.disable_deblocking_filter_flag) {
ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_trafo_size);
if (s->ps.pps->transquant_bypass_enable_flag &&
lc->cu.cu_transquant_bypass_flag)
set_deblocking_bypass(s, x0, y0, log2_trafo_size);
}
}
return 0;
}
| 8,520 |
154,037 | 0 | void GLES2DecoderImpl::DoLinkProgram(GLuint program_id) {
TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoLinkProgram");
SCOPED_UMA_HISTOGRAM_TIMER("GPU.DoLinkProgramTime");
Program* program = GetProgramInfoNotShader(
program_id, "glLinkProgram");
if (!program) {
return;
}
LogClientServiceForInfo(program, program_id, "glLinkProgram");
if (program->Link(shader_manager(),
workarounds().count_all_in_varyings_packing
? Program::kCountAll
: Program::kCountOnlyStaticallyUsed,
client())) {
if (program == state_.current_program.get()) {
if (workarounds().clear_uniforms_before_first_program_use)
program_manager()->ClearUniforms(program);
}
if (features().webgl_multi_draw || features().webgl_multi_draw_instanced)
program_manager()->UpdateDrawIDUniformLocation(program);
}
ExitCommandProcessingEarly();
}
| 8,521 |
57,375 | 0 | static char *datablob_format(struct encrypted_key_payload *epayload,
size_t asciiblob_len)
{
char *ascii_buf, *bufp;
u8 *iv = epayload->iv;
int len;
int i;
ascii_buf = kmalloc(asciiblob_len + 1, GFP_KERNEL);
if (!ascii_buf)
goto out;
ascii_buf[asciiblob_len] = '\0';
/* copy datablob master_desc and datalen strings */
len = sprintf(ascii_buf, "%s %s %s ", epayload->format,
epayload->master_desc, epayload->datalen);
/* convert the hex encoded iv, encrypted-data and HMAC to ascii */
bufp = &ascii_buf[len];
for (i = 0; i < (asciiblob_len - len) / 2; i++)
bufp = hex_byte_pack(bufp, iv[i]);
out:
return ascii_buf;
}
| 8,522 |
155,760 | 0 | DriveFsHost::~DriveFsHost() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}
| 8,523 |
165,545 | 0 | void ContentSecurityPolicy::ReportInvalidSourceExpression(
const String& directive_name,
const String& source) {
String message = "The source list for Content Security Policy directive '" +
directive_name + "' contains an invalid source: '" + source +
"'. It will be ignored.";
if (EqualIgnoringASCIICase(source, "'none'"))
message = message +
" Note that 'none' has no effect unless it is the only "
"expression in the source list.";
LogToConsole(message);
}
| 8,524 |
144,413 | 0 | CustomScrollableView() {}
| 8,525 |
105,399 | 0 | gboolean webkit_web_view_can_go_back_or_forward(WebKitWebView* webView, gint steps)
{
g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE);
return core(webView)->canGoBackOrForward(steps);
}
| 8,526 |
111,944 | 0 | void ProfileSyncService::TryStart() {
if (!IsSyncEnabledAndLoggedIn())
return;
TokenService* token_service = TokenServiceFactory::GetForProfile(profile_);
if (!token_service)
return;
if (IsSyncTokenAvailable() ||
(!auto_start_enabled_ && token_service->TokensLoadedFromDB())) {
if (HasSyncSetupCompleted() || auto_start_enabled_) {
StartUp();
}
}
}
| 8,527 |
5,558 | 0 | list_proxies_foreach (gpointer key,
gpointer value,
gpointer user_data)
{
DBusGProxyList *list;
GSList **ret;
GSList *tmp;
list = value;
ret = user_data;
tmp = list->proxies;
while (tmp != NULL)
{
DBusGProxy *proxy = DBUS_G_PROXY (tmp->data);
g_object_ref (proxy);
*ret = g_slist_prepend (*ret, proxy);
tmp = tmp->next;
}
}
| 8,528 |
141,658 | 0 | V8InspectorSessionImpl* currentSession()
{
InspectedContext* inspectedContext = ensureInspectedContext();
if (!inspectedContext)
return nullptr;
return inspectedContext->inspector()->sessionForContextGroup(inspectedContext->contextGroupId());
}
| 8,529 |
144,266 | 0 | void UserSelectionScreen::OnUserActivity(const ui::Event* event) {
if (!password_clear_timer_.IsRunning()) {
password_clear_timer_.Start(
FROM_HERE, base::TimeDelta::FromSeconds(kPasswordClearTimeoutSec), this,
&UserSelectionScreen::OnPasswordClearTimerExpired);
}
password_clear_timer_.Reset();
}
| 8,530 |
73,783 | 0 | int32_t messageTypeStringtoInt(uint8_t messageTypeString[8]) {
if (memcmp(messageTypeString, "Hello ", 8) == 0) {
return MSGTYPE_HELLO;
} else if (memcmp(messageTypeString, "HelloACK", 8) == 0) {
return MSGTYPE_HELLOACK;
} else if (memcmp(messageTypeString, "Commit ", 8) == 0) {
return MSGTYPE_COMMIT;
} else if (memcmp(messageTypeString, "DHPart1 ", 8) == 0) {
return MSGTYPE_DHPART1;
} else if (memcmp(messageTypeString, "DHPart2 ", 8) == 0) {
return MSGTYPE_DHPART2;
} else if (memcmp(messageTypeString, "Confirm1", 8) == 0) {
return MSGTYPE_CONFIRM1;
} else if (memcmp(messageTypeString, "Confirm2", 8) == 0) {
return MSGTYPE_CONFIRM2;
} else if (memcmp(messageTypeString, "Conf2ACK", 8) == 0) {
return MSGTYPE_CONF2ACK;
} else if (memcmp(messageTypeString, "Error ", 8) == 0) {
return MSGTYPE_ERROR;
} else if (memcmp(messageTypeString, "ErrorACK", 8) == 0) {
return MSGTYPE_ERRORACK;
} else if (memcmp(messageTypeString, "GoClear ", 8) == 0) {
return MSGTYPE_GOCLEAR;
} else if (memcmp(messageTypeString, "ClearACK", 8) == 0) {
return MSGTYPE_CLEARACK;
} else if (memcmp(messageTypeString, "SASrelay", 8) == 0) {
return MSGTYPE_SASRELAY;
} else if (memcmp(messageTypeString, "RelayACK", 8) == 0) {
return MSGTYPE_RELAYACK;
} else if (memcmp(messageTypeString, "Ping ", 8) == 0) {
return MSGTYPE_PING;
} else if (memcmp(messageTypeString, "PingACK ", 8) == 0) {
return MSGTYPE_PINGACK;
} else {
return MSGTYPE_INVALID;
}
}
| 8,531 |
174,225 | 0 | CameraMetadata Camera3Device::getLatestRequestLocked() {
ALOGV("%s", __FUNCTION__);
CameraMetadata retVal;
if (mRequestThread != NULL) {
retVal = mRequestThread->getLatestRequest();
}
return retVal;
}
| 8,532 |
58,861 | 0 | exim_tvcmp(struct timeval *t1, struct timeval *t2)
{
if (t1->tv_sec > t2->tv_sec) return +1;
if (t1->tv_sec < t2->tv_sec) return -1;
if (t1->tv_usec > t2->tv_usec) return +1;
if (t1->tv_usec < t2->tv_usec) return -1;
return 0;
}
| 8,533 |
48,326 | 0 | TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc)
{
static const char module[] = "TIFFWriteEncodedStrip";
TIFFDirectory *td = &tif->tif_dir;
uint16 sample;
if (!WRITECHECKSTRIPS(tif, module))
return ((tmsize_t) -1);
/*
* Check strip array to make sure there's space.
* We don't support dynamically growing files that
* have data organized in separate bitplanes because
* it's too painful. In that case we require that
* the imagelength be set properly before the first
* write (so that the strips array will be fully
* allocated above).
*/
if (strip >= td->td_nstrips) {
if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
TIFFErrorExt(tif->tif_clientdata, module,
"Can not grow image by strips when using separate planes");
return ((tmsize_t) -1);
}
if (!TIFFGrowStrips(tif, 1, module))
return ((tmsize_t) -1);
td->td_stripsperimage =
TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip);
}
/*
* Handle delayed allocation of data buffer. This
* permits it to be sized according to the directory
* info.
*/
if (!BUFFERCHECK(tif))
return ((tmsize_t) -1);
tif->tif_flags |= TIFF_BUF4WRITE;
tif->tif_curstrip = strip;
if (td->td_stripsperimage == 0) {
TIFFErrorExt(tif->tif_clientdata, module, "Zero strips per image");
return ((tmsize_t) -1);
}
tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip;
if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
if (!(*tif->tif_setupencode)(tif))
return ((tmsize_t) -1);
tif->tif_flags |= TIFF_CODERSETUP;
}
if( td->td_stripbytecount[strip] > 0 )
{
/* Make sure that at the first attempt of rewriting the tile, we will have */
/* more bytes available in the output buffer than the previous byte count, */
/* so that TIFFAppendToStrip() will detect the overflow when it is called the first */
/* time if the new compressed tile is bigger than the older one. (GDAL #4771) */
if( tif->tif_rawdatasize <= (tmsize_t)td->td_stripbytecount[strip] )
{
if( !(TIFFWriteBufferSetup(tif, NULL,
(tmsize_t)TIFFroundup_64((uint64)(td->td_stripbytecount[strip] + 1), 1024))) )
return ((tmsize_t)(-1));
}
/* Force TIFFAppendToStrip() to consider placing data at end
of file. */
tif->tif_curoff = 0;
}
tif->tif_rawcc = 0;
tif->tif_rawcp = tif->tif_rawdata;
tif->tif_flags &= ~TIFF_POSTENCODE;
/* shortcut to avoid an extra memcpy() */
if( td->td_compression == COMPRESSION_NONE )
{
/* swab if needed - note that source buffer will be altered */
tif->tif_postdecode( tif, (uint8*) data, cc );
if (!isFillOrder(tif, td->td_fillorder) &&
(tif->tif_flags & TIFF_NOBITREV) == 0)
TIFFReverseBits((uint8*) data, cc);
if (cc > 0 &&
!TIFFAppendToStrip(tif, strip, (uint8*) data, cc))
return ((tmsize_t) -1);
return (cc);
}
sample = (uint16)(strip / td->td_stripsperimage);
if (!(*tif->tif_preencode)(tif, sample))
return ((tmsize_t) -1);
/* swab if needed - note that source buffer will be altered */
tif->tif_postdecode( tif, (uint8*) data, cc );
if (!(*tif->tif_encodestrip)(tif, (uint8*) data, cc, sample))
return ((tmsize_t) -1);
if (!(*tif->tif_postencode)(tif))
return ((tmsize_t) -1);
if (!isFillOrder(tif, td->td_fillorder) &&
(tif->tif_flags & TIFF_NOBITREV) == 0)
TIFFReverseBits(tif->tif_rawdata, tif->tif_rawcc);
if (tif->tif_rawcc > 0 &&
!TIFFAppendToStrip(tif, strip, tif->tif_rawdata, tif->tif_rawcc))
return ((tmsize_t) -1);
tif->tif_rawcc = 0;
tif->tif_rawcp = tif->tif_rawdata;
return (cc);
}
| 8,534 |
108,662 | 0 | void set_redirect_url(const GURL& url) { redirect_url_ = url; }
| 8,535 |
102,084 | 0 | void SyncBackendHost::Core::NotifyUpdatedToken(const std::string& token) {
if (!host_)
return;
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
TokenAvailableDetails details(GaiaConstants::kSyncService, token);
NotificationService::current()->Notify(
chrome::NOTIFICATION_TOKEN_UPDATED,
Source<Profile>(host_->profile_),
Details<const TokenAvailableDetails>(&details));
}
| 8,536 |
70,177 | 0 | static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedRational(TIFF* tif, TIFFDirEntry* direntry, double* value)
{
UInt64Aligned_t m;
assert(sizeof(double)==8);
assert(sizeof(uint64)==8);
assert(sizeof(uint32)==4);
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
enum TIFFReadDirEntryErr err;
uint32 offset = direntry->tdir_offset.toff_long;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(&offset);
err=TIFFReadDirEntryData(tif,offset,8,m.i);
if (err!=TIFFReadDirEntryErrOk)
return(err);
}
else
m.l = direntry->tdir_offset.toff_long8;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabArrayOfLong(m.i,2);
if (m.i[0]==0)
*value=0.0;
else
*value=(double)m.i[0]/(double)m.i[1];
return(TIFFReadDirEntryErrOk);
}
| 8,537 |
32,951 | 0 | static int ext3_sync_fs(struct super_block *sb, int wait)
{
tid_t target;
trace_ext3_sync_fs(sb, wait);
/*
* Writeback quota in non-journalled quota case - journalled quota has
* no dirty dquots
*/
dquot_writeback_dquots(sb, -1);
if (journal_start_commit(EXT3_SB(sb)->s_journal, &target)) {
if (wait)
log_wait_commit(EXT3_SB(sb)->s_journal, target);
}
return 0;
}
| 8,538 |
38,085 | 0 | static int firm_open(struct usb_serial_port *port)
{
struct whiteheat_simple open_command;
open_command.port = port->port_number + 1;
return firm_send_command(port, WHITEHEAT_OPEN,
(__u8 *)&open_command, sizeof(open_command));
}
| 8,539 |
100,413 | 0 | static void* CreateHistogram(
const char *name, int min, int max, size_t buckets) {
Histogram* histogram = new Histogram(name, min, max, buckets);
if (histogram) {
histogram->SetFlags(kUmaTargetedHistogramFlag);
}
return histogram;
}
| 8,540 |
22,270 | 0 | void free_task(struct task_struct *tsk)
{
prop_local_destroy_single(&tsk->dirties);
account_kernel_stack(tsk->stack, -1);
free_thread_info(tsk->stack);
rt_mutex_debug_task_free(tsk);
ftrace_graph_exit_task(tsk);
free_task_struct(tsk);
}
| 8,541 |
148,333 | 0 | std::unique_ptr<WebUIImpl> WebContentsImpl::CreateWebUIForRenderFrameHost(
const GURL& url) {
return CreateWebUI(url, std::string());
}
| 8,542 |
1,225 | 0 | create_surface_from_thumbnail_data (guchar *data,
gint width,
gint height,
gint rowstride)
{
guchar *cairo_pixels;
cairo_surface_t *surface;
static cairo_user_data_key_t key;
int j;
cairo_pixels = (guchar *)g_malloc (4 * width * height);
surface = cairo_image_surface_create_for_data ((unsigned char *)cairo_pixels,
CAIRO_FORMAT_RGB24,
width, height, 4 * width);
cairo_surface_set_user_data (surface, &key,
cairo_pixels, (cairo_destroy_func_t)g_free);
for (j = height; j; j--) {
guchar *p = data;
guchar *q = cairo_pixels;
guchar *end = p + 3 * width;
while (p < end) {
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
q[0] = p[2];
q[1] = p[1];
q[2] = p[0];
#else
q[1] = p[0];
q[2] = p[1];
q[3] = p[2];
#endif
p += 3;
q += 4;
}
data += rowstride;
cairo_pixels += 4 * width;
}
return surface;
}
| 8,543 |
149,821 | 0 | LayerTreeHost::ReleaseCompositorFrameSink() {
DCHECK(!visible_);
DidLoseCompositorFrameSink();
proxy_->ReleaseCompositorFrameSink();
return std::move(current_compositor_frame_sink_);
}
| 8,544 |
178,923 | 1 | static void sgi_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting)
{
if (timr->it.mmtimer.clock == TIMER_OFF) {
cur_setting->it_interval.tv_nsec = 0;
cur_setting->it_interval.tv_sec = 0;
cur_setting->it_value.tv_nsec = 0;
cur_setting->it_value.tv_sec =0;
return;
}
ns_to_timespec(cur_setting->it_interval, timr->it.mmtimer.incr * sgi_clock_period);
ns_to_timespec(cur_setting->it_value, (timr->it.mmtimer.expires - rtc_time())* sgi_clock_period);
return;
}
| 8,545 |
152,946 | 0 | EnumTraits<media::mojom::VideoFacingMode, media::VideoFacingMode>::ToMojom(
media::VideoFacingMode input) {
switch (input) {
case media::VideoFacingMode::MEDIA_VIDEO_FACING_NONE:
return media::mojom::VideoFacingMode::NONE;
case media::VideoFacingMode::MEDIA_VIDEO_FACING_USER:
return media::mojom::VideoFacingMode::USER;
case media::VideoFacingMode::MEDIA_VIDEO_FACING_ENVIRONMENT:
return media::mojom::VideoFacingMode::ENVIRONMENT;
case media::VideoFacingMode::NUM_MEDIA_VIDEO_FACING_MODES:
NOTREACHED();
return media::mojom::VideoFacingMode::NONE;
}
NOTREACHED();
return media::mojom::VideoFacingMode::NONE;
}
| 8,546 |
134,270 | 0 | bool OmniboxViewViews::IsSelectAll() const {
return text() == GetSelectedText();
}
| 8,547 |
17,758 | 0 | barrier_is_blocking_direction(const struct PointerBarrier * barrier,
int direction)
{
/* Barriers define which way is ok, not which way is blocking */
return (barrier->directions & direction) != direction;
}
| 8,548 |
127,990 | 0 | void AwContents::FindAllAsync(JNIEnv* env, jobject obj, jstring search_string) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
GetFindHelper()->FindAllAsync(ConvertJavaStringToUTF16(env, search_string));
}
| 8,549 |
63,545 | 0 | static int prepare_timeout(const struct timespec __user *u_abs_timeout,
struct timespec *ts)
{
if (copy_from_user(ts, u_abs_timeout, sizeof(struct timespec)))
return -EFAULT;
if (!timespec_valid(ts))
return -EINVAL;
return 0;
}
| 8,550 |
51,386 | 0 | PHP_FUNCTION(mb_ereg_search_getpos)
{
RETVAL_LONG(MBREX(search_pos));
}
| 8,551 |
179,136 | 1 | int wvlan_uil_put_info(struct uilreq *urq, struct wl_private *lp)
{
int result = 0;
ltv_t *pLtv;
bool_t ltvAllocated = FALSE;
ENCSTRCT sEncryption;
#ifdef USE_WDS
hcf_16 hcfPort = HCF_PORT_0;
#endif /* USE_WDS */
/*------------------------------------------------------------------------*/
DBG_FUNC("wvlan_uil_put_info");
DBG_ENTER(DbgInfo);
if (urq->hcfCtx == &(lp->hcfCtx)) {
if (capable(CAP_NET_ADMIN)) {
if ((urq->data != NULL) && (urq->len != 0)) {
/* Make sure that we have at least a command and length to send. */
if (urq->len < (sizeof(hcf_16) * 2)) {
urq->len = sizeof(lp->ltvRecord);
urq->result = UIL_ERR_LEN;
DBG_ERROR(DbgInfo, "No Length/Type in LTV!!!\n");
DBG_ERROR(DbgInfo, "UIL_ERR_LEN\n");
DBG_LEAVE(DbgInfo);
return result;
}
/* Verify the user buffer */
result = verify_area(VERIFY_READ, urq->data, urq->len);
if (result != 0) {
urq->result = UIL_FAILURE;
DBG_ERROR(DbgInfo, "verify_area(), VERIFY_READ FAILED\n");
DBG_LEAVE(DbgInfo);
return result;
}
/* Get only the command and length information. */
copy_from_user(&(lp->ltvRecord), urq->data, sizeof(hcf_16) * 2);
/* Make sure the incoming LTV record length is within the bounds of the
IOCTL length */
if (((lp->ltvRecord.len + 1) * sizeof(hcf_16)) > urq->len) {
urq->len = sizeof(lp->ltvRecord);
urq->result = UIL_ERR_LEN;
DBG_ERROR(DbgInfo, "UIL_ERR_LEN\n");
DBG_LEAVE(DbgInfo);
return result;
}
/* If the requested length is greater than the size of our local
LTV record, try to allocate it from the kernel stack.
Otherwise, we just use our local LTV record. */
if (urq->len > sizeof(lp->ltvRecord)) {
pLtv = kmalloc(urq->len, GFP_KERNEL);
if (pLtv != NULL) {
ltvAllocated = TRUE;
} else {
DBG_ERROR(DbgInfo, "Alloc FAILED\n");
urq->len = sizeof(lp->ltvRecord);
urq->result = UIL_ERR_LEN;
result = -ENOMEM;
DBG_LEAVE(DbgInfo);
return result;
}
} else {
pLtv = &(lp->ltvRecord);
}
/* Copy the data from the user's buffer into the local LTV
record data area. */
copy_from_user(pLtv, urq->data, urq->len);
/* We need to snoop the commands to see if there is anything we
need to store for the purposes of a reset or start/stop
sequence. Perform endian translation as needed */
switch (pLtv->typ) {
case CFG_CNF_PORT_TYPE:
lp->PortType = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_CNF_OWN_MAC_ADDR:
/* TODO: determine if we are going to store anything based on this */
break;
case CFG_CNF_OWN_CHANNEL:
lp->Channel = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
/* CFG_CNF_OWN_SSID currently same as CNF_DESIRED_SSID. Do we
need separate storage for this? */
/* case CFG_CNF_OWN_SSID: */
case CFG_CNF_OWN_ATIM_WINDOW:
lp->atimWindow = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_CNF_SYSTEM_SCALE:
lp->DistanceBetweenAPs = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
case CFG_CNF_MAX_DATA_LEN:
/* TODO: determine if we are going to store anything based
on this */
break;
case CFG_CNF_PM_ENABLED:
lp->PMEnabled = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_CNF_MCAST_RX:
lp->MulticastReceive = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_CNF_MAX_SLEEP_DURATION:
lp->MaxSleepDuration = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_CNF_HOLDOVER_DURATION:
lp->holdoverDuration = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_CNF_OWN_NAME:
memset(lp->StationName, 0, sizeof(lp->StationName));
memcpy((void *)lp->StationName, (void *)&pLtv->u.u8[2], (size_t)pLtv->u.u16[0]);
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_CNF_LOAD_BALANCING:
lp->loadBalancing = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_CNF_MEDIUM_DISTRIBUTION:
lp->mediumDistribution = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
#ifdef WARP
case CFG_CNF_TX_POW_LVL:
lp->txPowLevel = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
/* case CFG_CNF_SHORT_RETRY_LIMIT: */ /* Short Retry Limit */
/* case 0xFC33: */ /* Long Retry Limit */
case CFG_SUPPORTED_RATE_SET_CNTL: /* Supported Rate Set Control */
lp->srsc[0] = pLtv->u.u16[0];
lp->srsc[1] = pLtv->u.u16[1];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
pLtv->u.u16[1] = CNV_INT_TO_LITTLE(pLtv->u.u16[1]);
break;
case CFG_BASIC_RATE_SET_CNTL: /* Basic Rate Set Control */
lp->brsc[0] = pLtv->u.u16[0];
lp->brsc[1] = pLtv->u.u16[1];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
pLtv->u.u16[1] = CNV_INT_TO_LITTLE(pLtv->u.u16[1]);
break;
case CFG_CNF_CONNECTION_CNTL:
lp->connectionControl = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
/* case CFG_PROBE_DATA_RATE: */
#endif /* HERMES25 */
#if 1 /* ;? (HCF_TYPE) & HCF_TYPE_AP */
/* ;?should we restore this to allow smaller memory footprint */
case CFG_CNF_OWN_DTIM_PERIOD:
lp->DTIMPeriod = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
#ifdef WARP
case CFG_CNF_OWN_BEACON_INTERVAL: /* Own Beacon Interval */
lp->ownBeaconInterval = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
#endif /* WARP */
case CFG_COEXISTENSE_BEHAVIOUR: /* Coexistence behavior */
lp->coexistence = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
#ifdef USE_WDS
case CFG_CNF_WDS_ADDR1:
memcpy(&lp->wds_port[0].wdsAddress, &pLtv->u.u8[0], ETH_ALEN);
hcfPort = HCF_PORT_1;
break;
case CFG_CNF_WDS_ADDR2:
memcpy(&lp->wds_port[1].wdsAddress, &pLtv->u.u8[0], ETH_ALEN);
hcfPort = HCF_PORT_2;
break;
case CFG_CNF_WDS_ADDR3:
memcpy(&lp->wds_port[2].wdsAddress, &pLtv->u.u8[0], ETH_ALEN);
hcfPort = HCF_PORT_3;
break;
case CFG_CNF_WDS_ADDR4:
memcpy(&lp->wds_port[3].wdsAddress, &pLtv->u.u8[0], ETH_ALEN);
hcfPort = HCF_PORT_4;
break;
case CFG_CNF_WDS_ADDR5:
memcpy(&lp->wds_port[4].wdsAddress, &pLtv->u.u8[0], ETH_ALEN);
hcfPort = HCF_PORT_5;
break;
case CFG_CNF_WDS_ADDR6:
memcpy(&lp->wds_port[5].wdsAddress, &pLtv->u.u8[0], ETH_ALEN);
hcfPort = HCF_PORT_6;
break;
#endif /* USE_WDS */
case CFG_CNF_MCAST_PM_BUF:
lp->multicastPMBuffering = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_CNF_REJECT_ANY:
lp->RejectAny = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
#endif
case CFG_CNF_ENCRYPTION:
lp->EnableEncryption = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_CNF_AUTHENTICATION:
lp->authentication = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
#if 1 /* ;? (HCF_TYPE) & HCF_TYPE_AP */
/* ;?should we restore this to allow smaller memory footprint */
/* case CFG_CNF_EXCL_UNENCRYPTED:
lp->ExcludeUnencrypted = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break; */
case CFG_CNF_MCAST_RATE:
/* TODO: determine if we are going to store anything based on this */
break;
case CFG_CNF_INTRA_BSS_RELAY:
lp->intraBSSRelay = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
#endif
case CFG_CNF_MICRO_WAVE:
/* TODO: determine if we are going to store anything based on this */
break;
/*case CFG_CNF_LOAD_BALANCING:*/
/* TODO: determine if we are going to store anything based on this */
/* break; */
/* case CFG_CNF_MEDIUM_DISTRIBUTION: */
/* TODO: determine if we are going to store anything based on this */
/* break; */
/* case CFG_CNF_RX_ALL_GROUP_ADDRESS: */
/* TODO: determine if we are going to store anything based on this */
/* break; */
/* case CFG_CNF_COUNTRY_INFO: */
/* TODO: determine if we are going to store anything based on this */
/* break; */
case CFG_CNF_OWN_SSID:
/* case CNF_DESIRED_SSID: */
case CFG_DESIRED_SSID:
memset(lp->NetworkName, 0, sizeof(lp->NetworkName));
memcpy((void *)lp->NetworkName, (void *)&pLtv->u.u8[2], (size_t)pLtv->u.u16[0]);
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
/* take care of the special network name "ANY" case */
if ((strlen(&pLtv->u.u8[2]) == 0) ||
(strcmp(&pLtv->u.u8[2], "ANY") == 0) ||
(strcmp(&pLtv->u.u8[2], "any") == 0)) {
/* set the SSID_STRCT llen field (u16[0]) to zero, and the
effectually null the string u8[2] */
pLtv->u.u16[0] = 0;
pLtv->u.u8[2] = 0;
}
break;
case CFG_GROUP_ADDR:
/* TODO: determine if we are going to store anything based on this */
break;
case CFG_CREATE_IBSS:
lp->CreateIBSS = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_RTS_THRH:
lp->RTSThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_TX_RATE_CNTL:
lp->TxRateControl[0] = pLtv->u.u16[0];
lp->TxRateControl[1] = pLtv->u.u16[1];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
pLtv->u.u16[1] = CNV_INT_TO_LITTLE(pLtv->u.u16[1]);
break;
case CFG_PROMISCUOUS_MODE:
/* TODO: determine if we are going to store anything based on this */
break;
/* case CFG_WAKE_ON_LAN: */
/* TODO: determine if we are going to store anything based on this */
/* break; */
#if 1 /* ;? #if (HCF_TYPE) & HCF_TYPE_AP */
/* ;?should we restore this to allow smaller memory footprint */
case CFG_RTS_THRH0:
lp->RTSThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_TX_RATE_CNTL0:
/*;?no idea what this should be, get going so comment it out lp->TxRateControl = pLtv->u.u16[0];*/
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
#ifdef USE_WDS
case CFG_RTS_THRH1:
lp->wds_port[0].rtsThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
hcfPort = HCF_PORT_1;
break;
case CFG_RTS_THRH2:
lp->wds_port[1].rtsThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
hcfPort = HCF_PORT_2;
break;
case CFG_RTS_THRH3:
lp->wds_port[2].rtsThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
hcfPort = HCF_PORT_3;
break;
case CFG_RTS_THRH4:
lp->wds_port[3].rtsThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
hcfPort = HCF_PORT_4;
break;
case CFG_RTS_THRH5:
lp->wds_port[4].rtsThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
hcfPort = HCF_PORT_5;
break;
case CFG_RTS_THRH6:
lp->wds_port[5].rtsThreshold = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
hcfPort = HCF_PORT_6;
break;
case CFG_TX_RATE_CNTL1:
lp->wds_port[0].txRateCntl = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
hcfPort = HCF_PORT_1;
break;
case CFG_TX_RATE_CNTL2:
lp->wds_port[1].txRateCntl = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
hcfPort = HCF_PORT_2;
break;
case CFG_TX_RATE_CNTL3:
lp->wds_port[2].txRateCntl = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
hcfPort = HCF_PORT_3;
break;
case CFG_TX_RATE_CNTL4:
lp->wds_port[3].txRateCntl = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
hcfPort = HCF_PORT_4;
break;
case CFG_TX_RATE_CNTL5:
lp->wds_port[4].txRateCntl = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
hcfPort = HCF_PORT_5;
break;
case CFG_TX_RATE_CNTL6:
lp->wds_port[5].txRateCntl = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
hcfPort = HCF_PORT_6;
break;
#endif /* USE_WDS */
#endif /* (HCF_TYPE) & HCF_TYPE_AP */
case CFG_DEFAULT_KEYS:
{
CFG_DEFAULT_KEYS_STRCT *pKeys = (CFG_DEFAULT_KEYS_STRCT *)pLtv;
pKeys->key[0].len = CNV_INT_TO_LITTLE(pKeys->key[0].len);
pKeys->key[1].len = CNV_INT_TO_LITTLE(pKeys->key[1].len);
pKeys->key[2].len = CNV_INT_TO_LITTLE(pKeys->key[2].len);
pKeys->key[3].len = CNV_INT_TO_LITTLE(pKeys->key[3].len);
memcpy((void *)&(lp->DefaultKeys), (void *)pKeys,
sizeof(CFG_DEFAULT_KEYS_STRCT));
}
break;
case CFG_TX_KEY_ID:
lp->TransmitKeyID = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_SCAN_SSID:
/* TODO: determine if we are going to store anything based on this */
break;
case CFG_TICK_TIME:
/* TODO: determine if we are going to store anything based on this */
break;
/* these RIDS are Info RIDs, and should they be allowed for puts??? */
case CFG_MAX_LOAD_TIME:
case CFG_DL_BUF:
/* case CFG_HSI_SUP_RANGE: */
case CFG_NIC_SERIAL_NUMBER:
case CFG_NIC_IDENTITY:
case CFG_NIC_MFI_SUP_RANGE:
case CFG_NIC_CFI_SUP_RANGE:
case CFG_NIC_TEMP_TYPE:
case CFG_NIC_PROFILE:
case CFG_FW_IDENTITY:
case CFG_FW_SUP_RANGE:
case CFG_MFI_ACT_RANGES_STA:
case CFG_CFI_ACT_RANGES_STA:
case CFG_PORT_STAT:
case CFG_CUR_SSID:
case CFG_CUR_BSSID:
case CFG_COMMS_QUALITY:
case CFG_CUR_TX_RATE:
case CFG_CUR_BEACON_INTERVAL:
case CFG_CUR_SCALE_THRH:
case CFG_PROTOCOL_RSP_TIME:
case CFG_CUR_SHORT_RETRY_LIMIT:
case CFG_CUR_LONG_RETRY_LIMIT:
case CFG_MAX_TX_LIFETIME:
case CFG_MAX_RX_LIFETIME:
case CFG_CF_POLLABLE:
case CFG_AUTHENTICATION_ALGORITHMS:
case CFG_PRIVACY_OPT_IMPLEMENTED:
/* case CFG_CURRENT_REMOTE_RATES: */
/* case CFG_CURRENT_USED_RATES: */
/* case CFG_CURRENT_SYSTEM_SCALE: */
/* case CFG_CURRENT_TX_RATE1: */
/* case CFG_CURRENT_TX_RATE2: */
/* case CFG_CURRENT_TX_RATE3: */
/* case CFG_CURRENT_TX_RATE4: */
/* case CFG_CURRENT_TX_RATE5: */
/* case CFG_CURRENT_TX_RATE6: */
case CFG_NIC_MAC_ADDR:
case CFG_PCF_INFO:
/* case CFG_CURRENT_COUNTRY_INFO: */
case CFG_PHY_TYPE:
case CFG_CUR_CHANNEL:
/* case CFG_CURRENT_POWER_STATE: */
/* case CFG_CCAMODE: */
case CFG_SUPPORTED_DATA_RATES:
break;
case CFG_AP_MODE:
/*;? lp->DownloadFirmware = (pLtv->u.u16[0]) + 1; */
DBG_ERROR(DbgInfo, "set CFG_AP_MODE no longer supported\n");
break;
case CFG_ENCRYPT_STRING:
/* TODO: ENDIAN TRANSLATION HERE??? */
memset(lp->szEncryption, 0, sizeof(lp->szEncryption));
memcpy((void *)lp->szEncryption, (void *)&pLtv->u.u8[0],
(pLtv->len * sizeof(hcf_16)));
wl_wep_decode(CRYPT_CODE, &sEncryption,
lp->szEncryption);
/* the Linux driver likes to use 1-4 for the key IDs, and then
convert to 0-3 when sending to the card. The Windows code
base used 0-3 in the API DLL, which was ported to Linux. For
the sake of the user experience, we decided to keep 0-3 as the
numbers used in the DLL; and will perform the +1 conversion here.
We could have converted the entire Linux driver, but this is
less obtrusive. This may be a "todo" to convert the whole driver */
lp->TransmitKeyID = sEncryption.wTxKeyID + 1;
lp->EnableEncryption = sEncryption.wEnabled;
memcpy(&lp->DefaultKeys, &sEncryption.EncStr,
sizeof(CFG_DEFAULT_KEYS_STRCT));
break;
/*case CFG_COUNTRY_STRING:
memset(lp->countryString, 0, sizeof(lp->countryString));
memcpy((void *)lp->countryString, (void *)&pLtv->u.u8[2], (size_t)pLtv->u.u16[0]);
break;
*/
case CFG_DRIVER_ENABLE:
lp->driverEnable = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_WOLAS_ENABLE:
lp->wolasEnable = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_SET_WPA_AUTH_KEY_MGMT_SUITE:
lp->AuthKeyMgmtSuite = pLtv->u.u16[0];
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_DISASSOCIATE_ADDR:
pLtv->u.u16[ETH_ALEN / 2] = CNV_INT_TO_LITTLE(pLtv->u.u16[ETH_ALEN / 2]);
break;
case CFG_ADD_TKIP_DEFAULT_KEY:
case CFG_REMOVE_TKIP_DEFAULT_KEY:
/* Endian convert the Tx Key Information */
pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]);
break;
case CFG_ADD_TKIP_MAPPED_KEY:
break;
case CFG_REMOVE_TKIP_MAPPED_KEY:
break;
/* some RIDs just can't be put */
case CFG_MB_INFO:
case CFG_IFB:
default:
break;
}
/* This code will prevent Static Configuration Entities from
being sent to the card, as they require a call to
UIL_ACT_APPLY to take effect. Dynamic Entities will be sent
immediately */
switch (pLtv->typ) {
case CFG_CNF_PORT_TYPE:
case CFG_CNF_OWN_MAC_ADDR:
case CFG_CNF_OWN_CHANNEL:
case CFG_CNF_OWN_SSID:
case CFG_CNF_OWN_ATIM_WINDOW:
case CFG_CNF_SYSTEM_SCALE:
case CFG_CNF_MAX_DATA_LEN:
case CFG_CNF_PM_ENABLED:
case CFG_CNF_MCAST_RX:
case CFG_CNF_MAX_SLEEP_DURATION:
case CFG_CNF_HOLDOVER_DURATION:
case CFG_CNF_OWN_NAME:
case CFG_CNF_LOAD_BALANCING:
case CFG_CNF_MEDIUM_DISTRIBUTION:
#ifdef WARP
case CFG_CNF_TX_POW_LVL:
case CFG_CNF_CONNECTION_CNTL:
/*case CFG_PROBE_DATA_RATE: */
#endif /* HERMES25 */
#if 1 /*;? (HCF_TYPE) & HCF_TYPE_AP */
/*;?should we restore this to allow smaller memory footprint */
case CFG_CNF_OWN_DTIM_PERIOD:
#ifdef WARP
case CFG_CNF_OWN_BEACON_INTERVAL: /* Own Beacon Interval */
#endif /* WARP */
#ifdef USE_WDS
case CFG_CNF_WDS_ADDR1:
case CFG_CNF_WDS_ADDR2:
case CFG_CNF_WDS_ADDR3:
case CFG_CNF_WDS_ADDR4:
case CFG_CNF_WDS_ADDR5:
case CFG_CNF_WDS_ADDR6:
#endif
case CFG_CNF_MCAST_PM_BUF:
case CFG_CNF_REJECT_ANY:
#endif
case CFG_CNF_ENCRYPTION:
case CFG_CNF_AUTHENTICATION:
#if 1 /* ;? (HCF_TYPE) & HCF_TYPE_AP */
/* ;?should we restore this to allow smaller memory footprint */
case CFG_CNF_EXCL_UNENCRYPTED:
case CFG_CNF_MCAST_RATE:
case CFG_CNF_INTRA_BSS_RELAY:
#endif
case CFG_CNF_MICRO_WAVE:
/* case CFG_CNF_LOAD_BALANCING: */
/* case CFG_CNF_MEDIUM_DISTRIBUTION: */
/* case CFG_CNF_RX_ALL_GROUP_ADDRESS: */
/* case CFG_CNF_COUNTRY_INFO: */
/* case CFG_COUNTRY_STRING: */
case CFG_AP_MODE:
case CFG_ENCRYPT_STRING:
/* case CFG_DRIVER_ENABLE: */
case CFG_WOLAS_ENABLE:
case CFG_MB_INFO:
case CFG_IFB:
break;
/* Deal with this dynamic MSF RID, as it's required for WPA */
case CFG_DRIVER_ENABLE:
if (lp->driverEnable) {
hcf_cntl(&(lp->hcfCtx), HCF_CNTL_ENABLE | HCF_PORT_0);
hcf_cntl(&(lp->hcfCtx), HCF_CNTL_CONNECT);
} else {
hcf_cntl(&(lp->hcfCtx), HCF_CNTL_DISABLE | HCF_PORT_0);
hcf_cntl(&(lp->hcfCtx), HCF_CNTL_DISCONNECT);
}
break;
default:
wl_act_int_off(lp);
urq->result = hcf_put_info(&(lp->hcfCtx), (LTVP) pLtv);
wl_act_int_on(lp);
break;
}
if (ltvAllocated)
kfree(pLtv);
} else {
urq->result = UIL_FAILURE;
}
} else {
DBG_ERROR(DbgInfo, "EPERM\n");
urq->result = UIL_FAILURE;
result = -EPERM;
}
} else {
DBG_ERROR(DbgInfo, "UIL_ERR_WRONG_IFB\n");
urq->result = UIL_ERR_WRONG_IFB;
}
DBG_LEAVE(DbgInfo);
return result;
} /* wvlan_uil_put_info */
| 8,552 |
126,612 | 0 | void TabStripModel::AddTabContents(TabContents* contents,
int index,
content::PageTransition transition,
int add_types) {
bool inherit_group = (add_types & ADD_INHERIT_GROUP) == ADD_INHERIT_GROUP;
if (transition == content::PAGE_TRANSITION_LINK &&
(add_types & ADD_FORCE_INDEX) == 0) {
index = order_controller_->DetermineInsertionIndex(
contents, transition, add_types & ADD_ACTIVE);
inherit_group = true;
} else {
if (index < 0 || index > count())
index = order_controller_->DetermineInsertionIndexForAppending();
}
if (transition == content::PAGE_TRANSITION_TYPED && index == count()) {
inherit_group = true;
}
InsertTabContentsAt(
index, contents, add_types | (inherit_group ? ADD_INHERIT_GROUP : 0));
index = GetIndexOfTabContents(contents);
if (inherit_group && transition == content::PAGE_TRANSITION_TYPED)
contents_data_[index]->reset_group_on_select = true;
if (WebContents* old_contents = GetActiveWebContents()) {
if ((add_types & ADD_ACTIVE) == 0) {
contents->web_contents()->GetView()->
SizeContents(old_contents->GetView()->GetContainerSize());
contents->web_contents()->WasHidden();
}
}
}
| 8,553 |
35,036 | 0 | SCTP_STATIC int sctp_seqpacket_listen(struct sock *sk, int backlog)
{
struct sctp_sock *sp = sctp_sk(sk);
struct sctp_endpoint *ep = sp->ep;
/* Only UDP style sockets that are not peeled off are allowed to
* listen().
*/
if (!sctp_style(sk, UDP))
return -EINVAL;
/* If backlog is zero, disable listening. */
if (!backlog) {
if (sctp_sstate(sk, CLOSED))
return 0;
sctp_unhash_endpoint(ep);
sk->sk_state = SCTP_SS_CLOSED;
}
/* Return if we are already listening. */
if (sctp_sstate(sk, LISTENING))
return 0;
/*
* If a bind() or sctp_bindx() is not called prior to a listen()
* call that allows new associations to be accepted, the system
* picks an ephemeral port and will choose an address set equivalent
* to binding with a wildcard address.
*
* This is not currently spelled out in the SCTP sockets
* extensions draft, but follows the practice as seen in TCP
* sockets.
*/
if (!ep->base.bind_addr.port) {
if (sctp_autobind(sk))
return -EAGAIN;
}
sk->sk_state = SCTP_SS_LISTENING;
sctp_hash_endpoint(ep);
return 0;
}
| 8,554 |
174,627 | 0 | static BOOLEAN btm_sec_queue_mx_request (BD_ADDR bd_addr, UINT16 psm, BOOLEAN is_orig,
UINT32 mx_proto_id, UINT32 mx_chan_id,
tBTM_SEC_CALLBACK *p_callback, void *p_ref_data)
{
tBTM_SEC_QUEUE_ENTRY *p_e;
p_e = (tBTM_SEC_QUEUE_ENTRY *)GKI_getbuf (sizeof(tBTM_SEC_QUEUE_ENTRY));
if (p_e)
{
p_e->psm = psm;
p_e->is_orig = is_orig;
p_e->p_callback = p_callback;
p_e->p_ref_data = p_ref_data;
p_e->mx_proto_id = mx_proto_id;
p_e->mx_chan_id = mx_chan_id;
memcpy (p_e->bd_addr, bd_addr, BD_ADDR_LEN);
BTM_TRACE_EVENT ("btm_sec_queue_mx_request() PSM: 0x%04x Is_Orig: %u mx_proto_id: %u mx_chan_id: %u",
psm, is_orig, mx_proto_id, mx_chan_id);
GKI_enqueue (&btm_cb.sec_pending_q, p_e);
return(TRUE);
}
return(FALSE);
}
| 8,555 |
141,662 | 0 | void V8Console::dirCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
ConsoleHelper(info).reportCall(ConsoleAPIType::kDir);
}
| 8,556 |
132,154 | 0 | void RenderViewTest::GoToOffset(int offset, const PageState& state) {
RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
int history_list_length = impl->historyBackListCount() +
impl->historyForwardListCount() + 1;
int pending_offset = offset + impl->history_list_offset_;
CommonNavigationParams common_params(
GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK,
FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(),
FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL());
RequestNavigationParams request_params;
request_params.page_state = state;
request_params.page_id = impl->page_id_ + offset;
request_params.nav_entry_id = pending_offset + 1;
request_params.pending_history_list_offset = pending_offset;
request_params.current_history_list_offset = impl->history_list_offset_;
request_params.current_history_list_length = history_list_length;
TestRenderFrame* frame =
static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
frame->Navigate(common_params, StartNavigationParams(), request_params);
FrameLoadWaiter(frame).Wait();
}
| 8,557 |
176,876 | 0 | static void ssp_request_callback(bt_bdaddr_t *bd_addr, bt_bdname_t *bdname, uint32_t cod,
bt_ssp_variant_t pairing_variant, uint32_t pass_key) {
jbyteArray addr, devname;
if (!checkCallbackThread()) {
ALOGE("Callback: '%s' is not called on the correct thread", __FUNCTION__);
return;
}
if (!bd_addr) {
ALOGE("Address is null in %s", __FUNCTION__);
return;
}
addr = callbackEnv->NewByteArray(sizeof(bt_bdaddr_t));
if (addr == NULL) goto Fail;
callbackEnv->SetByteArrayRegion(addr, 0, sizeof(bt_bdaddr_t), (jbyte *)bd_addr);
devname = callbackEnv->NewByteArray(sizeof(bt_bdname_t));
if (devname == NULL) goto Fail;
callbackEnv->SetByteArrayRegion(devname, 0, sizeof(bt_bdname_t), (jbyte*)bdname);
callbackEnv->CallVoidMethod(sJniCallbacksObj, method_sspRequestCallback, addr, devname, cod,
(jint) pairing_variant, pass_key);
checkAndClearExceptionFromCallback(callbackEnv, __FUNCTION__);
callbackEnv->DeleteLocalRef(addr);
callbackEnv->DeleteLocalRef(devname);
return;
Fail:
if (addr) callbackEnv->DeleteLocalRef(addr);
if (devname) callbackEnv->DeleteLocalRef(devname);
ALOGE("Error while allocating in: %s", __FUNCTION__);
}
| 8,558 |
102,631 | 0 | void CloudPolicyController::DoWork() {
switch (state_) {
case STATE_TOKEN_UNAVAILABLE:
case STATE_TOKEN_ERROR:
FetchToken();
return;
case STATE_TOKEN_VALID:
case STATE_POLICY_VALID:
case STATE_POLICY_ERROR:
case STATE_POLICY_UNAVAILABLE:
SendPolicyRequest();
return;
case STATE_TOKEN_UNMANAGED:
return;
}
NOTREACHED() << "Unhandled state" << state_;
}
| 8,559 |
62,692 | 0 | ModuleExport void UnregisterPALMImage(void)
{
(void) UnregisterMagickInfo("PALM");
}
| 8,560 |
65,397 | 0 | static struct nfsd4_conn *__nfsd4_find_conn(struct svc_xprt *xpt, struct nfsd4_session *s)
{
struct nfsd4_conn *c;
list_for_each_entry(c, &s->se_conns, cn_persession) {
if (c->cn_xprt == xpt) {
return c;
}
}
return NULL;
}
| 8,561 |
175,019 | 0 | void impeg2d_get_bottom_field_buf(yuv_buf_t *ps_src_buf,yuv_buf_t *ps_dst_buf,
UWORD32 u4_width)
{
ps_dst_buf->pu1_y = ps_src_buf->pu1_y + u4_width;
ps_dst_buf->pu1_u = ps_src_buf->pu1_u + (u4_width>>1);
ps_dst_buf->pu1_v = ps_src_buf->pu1_v + (u4_width>>1);
}
| 8,562 |
584 | 0 | pdf_process_contents(fz_context *ctx, pdf_processor *proc, pdf_document *doc, pdf_obj *rdb, pdf_obj *stmobj, fz_cookie *cookie)
{
pdf_csi csi;
pdf_lexbuf buf;
fz_stream *stm = NULL;
if (!stmobj)
return;
fz_var(stm);
pdf_lexbuf_init(ctx, &buf, PDF_LEXBUF_SMALL);
pdf_init_csi(ctx, &csi, doc, rdb, &buf, cookie);
fz_try(ctx)
{
fz_defer_reap_start(ctx);
stm = pdf_open_contents_stream(ctx, doc, stmobj);
pdf_process_stream(ctx, proc, &csi, stm);
pdf_process_end(ctx, proc, &csi);
}
fz_always(ctx)
{
fz_defer_reap_end(ctx);
fz_drop_stream(ctx, stm);
pdf_clear_stack(ctx, &csi);
pdf_lexbuf_fin(ctx, &buf);
}
fz_catch(ctx)
{
fz_rethrow(ctx);
}
}
| 8,563 |
32,576 | 0 | static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *stats)
{
struct tg3 *tp = netdev_priv(dev);
spin_lock_bh(&tp->lock);
if (!tp->hw_stats) {
spin_unlock_bh(&tp->lock);
return &tp->net_stats_prev;
}
tg3_get_nstats(tp, stats);
spin_unlock_bh(&tp->lock);
return stats;
}
| 8,564 |
5,773 | 0 | static EHCIQueue *ehci_alloc_queue(EHCIState *ehci, uint32_t addr, int async)
{
EHCIQueueHead *head = async ? &ehci->aqueues : &ehci->pqueues;
EHCIQueue *q;
q = g_malloc0(sizeof(*q));
q->ehci = ehci;
q->qhaddr = addr;
q->async = async;
QTAILQ_INIT(&q->packets);
QTAILQ_INSERT_HEAD(head, q, next);
trace_usb_ehci_queue_action(q, "alloc");
return q;
}
| 8,565 |
146,459 | 0 | void WebGLRenderingContextBase::clearColor(GLfloat r,
GLfloat g,
GLfloat b,
GLfloat a) {
if (isContextLost())
return;
if (std::isnan(r))
r = 0;
if (std::isnan(g))
g = 0;
if (std::isnan(b))
b = 0;
if (std::isnan(a))
a = 1;
clear_color_[0] = r;
clear_color_[1] = g;
clear_color_[2] = b;
clear_color_[3] = a;
ContextGL()->ClearColor(r, g, b, a);
}
| 8,566 |
131,244 | 0 | static void cachedAttributeAnyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
TestObjectPythonV8Internal::cachedAttributeAnyAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
| 8,567 |
109,700 | 0 | const Vector<IconURL>& Document::iconURLs(int iconTypesMask)
{
m_iconURLs.clear();
if (!head() || !(head()->children()))
return m_iconURLs;
RefPtr<HTMLCollection> children = head()->children();
unsigned int length = children->length();
for (unsigned int i = 0; i < length; ++i) {
Node* child = children->item(i);
if (!child->hasTagName(linkTag))
continue;
HTMLLinkElement* linkElement = toHTMLLinkElement(child);
if (!(linkElement->iconType() & iconTypesMask))
continue;
if (linkElement->href().isEmpty())
continue;
IconURL newURL(linkElement->href(), linkElement->iconSizes(), linkElement->type(), linkElement->iconType());
m_iconURLs.prepend(newURL);
}
return m_iconURLs;
}
| 8,568 |
51,351 | 0 | static inline void spl_filesystem_object_get_file_name(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
{
char slash = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_UNIXPATHS) ? '/' : DEFAULT_SLASH;
switch (intern->type) {
case SPL_FS_INFO:
case SPL_FS_FILE:
if (!intern->file_name) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Object not initialized");
}
break;
case SPL_FS_DIR:
if (intern->file_name) {
efree(intern->file_name);
}
intern->file_name_len = spprintf(&intern->file_name, 0, "%s%c%s",
spl_filesystem_object_get_path(intern, NULL TSRMLS_CC),
slash, intern->u.dir.entry.d_name);
break;
}
} /* }}} */
| 8,569 |
149,705 | 0 | void set_elapsed(base::TimeDelta elapsed) { elapsed_ = elapsed; }
| 8,570 |
93,353 | 0 | static void __netdev_adjacent_dev_unlink_neighbour(struct net_device *dev,
struct net_device *upper_dev)
{
__netdev_adjacent_dev_unlink_lists(dev, upper_dev, 1,
&dev->adj_list.upper,
&upper_dev->adj_list.lower);
}
| 8,571 |
179,788 | 1 | vhost_scsi_send_evt(struct vhost_scsi *vs,
struct vhost_scsi_tpg *tpg,
struct se_lun *lun,
u32 event,
u32 reason)
{
struct vhost_scsi_evt *evt;
evt = vhost_scsi_allocate_evt(vs, event, reason);
if (!evt)
return;
if (tpg && lun) {
/* TODO: share lun setup code with virtio-scsi.ko */
/*
* Note: evt->event is zeroed when we allocate it and
* lun[4-7] need to be zero according to virtio-scsi spec.
*/
evt->event.lun[0] = 0x01;
evt->event.lun[1] = tpg->tport_tpgt & 0xFF;
if (lun->unpacked_lun >= 256)
evt->event.lun[2] = lun->unpacked_lun >> 8 | 0x40 ;
evt->event.lun[3] = lun->unpacked_lun & 0xFF;
}
llist_add(&evt->list, &vs->vs_event_list);
vhost_work_queue(&vs->dev, &vs->vs_event_work);
}
| 8,572 |
94,582 | 0 | static void __dentry_kill(struct dentry *dentry)
{
struct dentry *parent = NULL;
bool can_free = true;
if (!IS_ROOT(dentry))
parent = dentry->d_parent;
/*
* The dentry is now unrecoverably dead to the world.
*/
lockref_mark_dead(&dentry->d_lockref);
/*
* inform the fs via d_prune that this dentry is about to be
* unhashed and destroyed.
*/
if (dentry->d_flags & DCACHE_OP_PRUNE)
dentry->d_op->d_prune(dentry);
if (dentry->d_flags & DCACHE_LRU_LIST) {
if (!(dentry->d_flags & DCACHE_SHRINK_LIST))
d_lru_del(dentry);
}
/* if it was on the hash then remove it */
__d_drop(dentry);
__list_del_entry(&dentry->d_child);
/*
* Inform d_walk() that we are no longer attached to the
* dentry tree
*/
dentry->d_flags |= DCACHE_DENTRY_KILLED;
if (parent)
spin_unlock(&parent->d_lock);
dentry_iput(dentry);
/*
* dentry_iput drops the locks, at which point nobody (except
* transient RCU lookups) can reach this dentry.
*/
BUG_ON(dentry->d_lockref.count > 0);
this_cpu_dec(nr_dentry);
if (dentry->d_op && dentry->d_op->d_release)
dentry->d_op->d_release(dentry);
spin_lock(&dentry->d_lock);
if (dentry->d_flags & DCACHE_SHRINK_LIST) {
dentry->d_flags |= DCACHE_MAY_FREE;
can_free = false;
}
spin_unlock(&dentry->d_lock);
if (likely(can_free))
dentry_free(dentry);
}
| 8,573 |
92,922 | 0 | cliprdr_send_native_format_announce(uint8 * formats_data, uint32 formats_data_length)
{
logger(Clipboard, Debug, "cliprdr_send_native_format_announce()");
cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, formats_data,
formats_data_length);
if (formats_data != last_formats)
{
if (last_formats)
xfree(last_formats);
last_formats = xmalloc(formats_data_length);
memcpy(last_formats, formats_data, formats_data_length);
last_formats_length = formats_data_length;
}
}
| 8,574 |
138,068 | 0 | bool AXNodeObject::isInPageLinkTarget() const {
if (!m_node || !m_node->isElementNode())
return false;
Element* element = toElement(m_node);
if (element->containingShadowRoot())
return false;
if (isHTMLAnchorElement(element)) {
HTMLAnchorElement* htmlElement = toHTMLAnchorElement(element);
return htmlElement->hasName() || htmlElement->hasID();
}
if (element->hasID() && (isLandmarkRelated() || isHTMLDivElement(element)))
return true;
return false;
}
| 8,575 |
49,585 | 0 | static void ffs_data_put(struct ffs_data *ffs)
{
ENTER();
if (unlikely(atomic_dec_and_test(&ffs->ref))) {
pr_info("%s(): freeing\n", __func__);
ffs_data_clear(ffs);
BUG_ON(waitqueue_active(&ffs->ev.waitq) ||
waitqueue_active(&ffs->ep0req_completion.wait));
kfree(ffs->dev_name);
kfree(ffs);
}
}
| 8,576 |
122,101 | 0 | void Buffer::Unmap() {
if (--map_count_ == 0)
shm_.Unmap();
}
| 8,577 |
48,444 | 0 | void big_key_free_preparse(struct key_preparsed_payload *prep)
{
if (prep->datalen > BIG_KEY_FILE_THRESHOLD) {
struct path *path = (struct path *)&prep->payload.data[big_key_path];
path_put(path);
}
kfree(prep->payload.data[big_key_data]);
}
| 8,578 |
31,447 | 0 | int pfkey_sadb_addr2xfrm_addr(const struct sadb_address *addr, xfrm_address_t *xaddr)
{
return pfkey_sockaddr_extract((struct sockaddr *)(addr + 1),
xaddr);
}
| 8,579 |
10,870 | 0 | setup_salt(long salt)
{
uint32 obit,
saltbit;
int i;
if (salt == old_salt)
return;
old_salt = salt;
saltbits = 0L;
saltbit = 1;
obit = 0x800000;
for (i = 0; i < 24; i++)
{
if (salt & saltbit)
saltbits |= obit;
saltbit <<= 1;
obit >>= 1;
}
}
| 8,580 |
31,754 | 0 | void flush_itimer_signals(void)
{
struct task_struct *tsk = current;
unsigned long flags;
spin_lock_irqsave(&tsk->sighand->siglock, flags);
__flush_itimer_signals(&tsk->pending);
__flush_itimer_signals(&tsk->signal->shared_pending);
spin_unlock_irqrestore(&tsk->sighand->siglock, flags);
}
| 8,581 |
75,992 | 0 | vrrp_evip_handler(vector_t *strvec)
{
alloc_value_block(alloc_vrrp_evip, vector_slot(strvec, 0));
}
| 8,582 |
160,017 | 0 | void BackendImpl::CriticalError(int error) {
STRESS_NOTREACHED();
LOG(ERROR) << "Critical error found " << error;
if (disabled_)
return;
stats_.OnEvent(Stats::FATAL_ERROR);
LogStats();
ReportError(error);
data_->header.table_len = 1;
disabled_ = true;
if (!num_refs_)
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&BackendImpl::RestartCache, GetWeakPtr(), true));
}
| 8,583 |
75,448 | 0 | static int opsbb(RAsm *a, ut8 *data, const Opcode *op) {
if (op->operands[1].type & OT_CONSTANT) {
if (op->operands[0].type & OT_GPREG &&
op->operands[0].type & OT_WORD) {
return process_16bit_group_1 (a, data, op, 0x18);
}
if (!is_al_reg (&op->operands[0])) {
return process_group_1 (a, data, op);
}
}
return process_1byte_op (a, data, op, 0x18);
}
| 8,584 |
138,435 | 0 | void Document::processHttpEquiv(const AtomicString& equiv, const AtomicString& content, bool inDocumentHeadElement)
{
ASSERT(!equiv.isNull() && !content.isNull());
if (equalIgnoringCase(equiv, "default-style")) {
processHttpEquivDefaultStyle(content);
} else if (equalIgnoringCase(equiv, "refresh")) {
processHttpEquivRefresh(content);
} else if (equalIgnoringCase(equiv, "set-cookie")) {
processHttpEquivSetCookie(content);
} else if (equalIgnoringCase(equiv, "content-language")) {
setContentLanguage(content);
} else if (equalIgnoringCase(equiv, "x-dns-prefetch-control")) {
parseDNSPrefetchControlHeader(content);
} else if (equalIgnoringCase(equiv, "x-frame-options")) {
processHttpEquivXFrameOptions(content);
} else if (equalIgnoringCase(equiv, "accept-ch")) {
processHttpEquivAcceptCH(content);
} else if (equalIgnoringCase(equiv, "content-security-policy") || equalIgnoringCase(equiv, "content-security-policy-report-only")) {
if (inDocumentHeadElement)
processHttpEquivContentSecurityPolicy(equiv, content);
else
contentSecurityPolicy()->reportMetaOutsideHead(content);
}
}
| 8,585 |
33,746 | 0 | static void hidp_process_hid_control(struct hidp_session *session,
unsigned char param)
{
BT_DBG("session %p param 0x%02x", session, param);
if (param == HIDP_CTRL_VIRTUAL_CABLE_UNPLUG) {
/* Flush the transmit queues */
skb_queue_purge(&session->ctrl_transmit);
skb_queue_purge(&session->intr_transmit);
atomic_inc(&session->terminate);
wake_up_process(current);
}
}
| 8,586 |
41,508 | 0 | static void *dn_socket_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
void *rc;
if (v == SEQ_START_TOKEN) {
rc = dn_socket_get_idx(seq, 0);
goto out;
}
rc = dn_socket_get_next(seq, v);
if (rc)
goto out;
read_unlock_bh(&dn_hash_lock);
out:
++*pos;
return rc;
}
| 8,587 |
144,992 | 0 | void RenderWidgetHostViewAura::UnlockMouse() {
event_handler_->UnlockMouse();
}
| 8,588 |
79,389 | 0 | static int mov_write_rtp_tag(AVIOContext *pb, MOVTrack *track)
{
int64_t pos = avio_tell(pb);
avio_wb32(pb, 0); /* size */
ffio_wfourcc(pb, "rtp ");
avio_wb32(pb, 0); /* Reserved */
avio_wb16(pb, 0); /* Reserved */
avio_wb16(pb, 1); /* Data-reference index */
avio_wb16(pb, 1); /* Hint track version */
avio_wb16(pb, 1); /* Highest compatible version */
avio_wb32(pb, track->max_packet_size); /* Max packet size */
avio_wb32(pb, 12); /* size */
ffio_wfourcc(pb, "tims");
avio_wb32(pb, track->timescale);
return update_size(pb, pos);
}
| 8,589 |
151,559 | 0 | void ResourceFetcher::EnableIsPreloadedForTest() {
if (preloaded_urls_for_test_)
return;
preloaded_urls_for_test_ = WTF::WrapUnique(new HashSet<String>);
for (const auto& pair : preloads_) {
Resource* resource = pair.value;
preloaded_urls_for_test_->insert(resource->Url().GetString());
}
}
| 8,590 |
3,854 | 0 | xmlAttrPtr get_attribute_ex(xmlAttrPtr node, char *name, char *ns)
{
while (node!=NULL) {
if (attr_is_equal_ex(node, name, ns)) {
return node;
}
node = node->next;
}
return NULL;
}
| 8,591 |
79,286 | 0 | static void enable_tracks(AVFormatContext *s)
{
MOVMuxContext *mov = s->priv_data;
int i;
int enabled[AVMEDIA_TYPE_NB];
int first[AVMEDIA_TYPE_NB];
for (i = 0; i < AVMEDIA_TYPE_NB; i++) {
enabled[i] = 0;
first[i] = -1;
}
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
if (st->codecpar->codec_type <= AVMEDIA_TYPE_UNKNOWN ||
st->codecpar->codec_type >= AVMEDIA_TYPE_NB ||
is_cover_image(st))
continue;
if (first[st->codecpar->codec_type] < 0)
first[st->codecpar->codec_type] = i;
if (st->disposition & AV_DISPOSITION_DEFAULT) {
mov->tracks[i].flags |= MOV_TRACK_ENABLED;
enabled[st->codecpar->codec_type]++;
}
}
for (i = 0; i < AVMEDIA_TYPE_NB; i++) {
switch (i) {
case AVMEDIA_TYPE_VIDEO:
case AVMEDIA_TYPE_AUDIO:
case AVMEDIA_TYPE_SUBTITLE:
if (enabled[i] > 1)
mov->per_stream_grouping = 1;
if (!enabled[i] && first[i] >= 0)
mov->tracks[first[i]].flags |= MOV_TRACK_ENABLED;
break;
}
}
}
| 8,592 |
144,822 | 0 | bool IsTabDiscarded(content::WebContents* web_contents) {
return TabLifecycleUnitExternal::FromWebContents(web_contents)->IsDiscarded();
}
| 8,593 |
43,878 | 0 | mode_list(struct cpio *cpio)
{
struct archive *a;
struct archive_entry *entry;
int r;
a = archive_read_new();
if (a == NULL)
lafe_errc(1, 0, "Couldn't allocate archive object");
archive_read_support_filter_all(a);
archive_read_support_format_all(a);
if (cpio->passphrase != NULL)
r = archive_read_add_passphrase(a, cpio->passphrase);
else
r = archive_read_set_passphrase_callback(a, cpio,
&passphrase_callback);
if (r != ARCHIVE_OK)
lafe_errc(1, 0, "%s", archive_error_string(a));
if (archive_read_open_filename(a, cpio->filename,
cpio->bytes_per_block))
lafe_errc(1, archive_errno(a),
"%s", archive_error_string(a));
for (;;) {
r = archive_read_next_header(a, &entry);
if (r == ARCHIVE_EOF)
break;
if (r != ARCHIVE_OK) {
lafe_errc(1, archive_errno(a),
"%s", archive_error_string(a));
}
if (archive_match_path_excluded(cpio->matching, entry))
continue;
if (cpio->verbose)
list_item_verbose(cpio, entry);
else
fprintf(stdout, "%s\n", archive_entry_pathname(entry));
}
r = archive_read_close(a);
if (r != ARCHIVE_OK)
lafe_errc(1, 0, "%s", archive_error_string(a));
if (!cpio->quiet) {
int64_t blocks = (archive_filter_bytes(a, 0) + 511)
/ 512;
fprintf(stderr, "%lu %s\n", (unsigned long)blocks,
blocks == 1 ? "block" : "blocks");
}
archive_read_free(a);
exit(0);
}
| 8,594 |
5,549 | 0 | find_name_in_info (gconstpointer a, gconstpointer b)
{
const DBusGProxyNameOwnerInfo *info = a;
const char *name = b;
return strcmp (info->name, name);
}
| 8,595 |
103,273 | 0 | const AddressList& WebSocketJob::address_list() const {
return addresses_;
}
| 8,596 |
21,271 | 0 | static inline void unmap_mapping_range_list(struct list_head *head,
struct zap_details *details)
{
struct vm_area_struct *vma;
/*
* In nonlinear VMAs there is no correspondence between virtual address
* offset and file offset. So we must perform an exhaustive search
* across *all* the pages in each nonlinear VMA, not just the pages
* whose virtual address lies outside the file truncation point.
*/
list_for_each_entry(vma, head, shared.vm_set.list) {
details->nonlinear_vma = vma;
unmap_mapping_range_vma(vma, vma->vm_start, vma->vm_end, details);
}
}
| 8,597 |
7,297 | 0 | hook_focus_hashtable_map_cb (void *data, struct t_hashtable *hashtable,
const void *key, const void *value)
{
struct t_hashtable *hashtable1;
/* make C compiler happy */
(void) hashtable;
hashtable1 = (struct t_hashtable *)data;
if (hashtable1 && key && value)
hashtable_set (hashtable1, (const char *)key, (const char *)value);
}
| 8,598 |
69,434 | 0 | static void mode_to_access_flags(umode_t mode, umode_t bits_to_use,
__u32 *pace_flags)
{
/* reset access mask */
*pace_flags = 0x0;
/* bits to use are either S_IRWXU or S_IRWXG or S_IRWXO */
mode &= bits_to_use;
/* check for R/W/X UGO since we do not know whose flags
is this but we have cleared all the bits sans RWX for
either user or group or other as per bits_to_use */
if (mode & S_IRUGO)
*pace_flags |= SET_FILE_READ_RIGHTS;
if (mode & S_IWUGO)
*pace_flags |= SET_FILE_WRITE_RIGHTS;
if (mode & S_IXUGO)
*pace_flags |= SET_FILE_EXEC_RIGHTS;
cifs_dbg(NOISY, "mode: 0x%x, access flags now 0x%x\n",
mode, *pace_flags);
return;
}
| 8,599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.