unique_id
int64 13
189k
| target
int64 0
1
| code
stringlengths 20
241k
| __index_level_0__
int64 0
18.9k
|
---|---|---|---|
73,752 | 0 | smb_ofile_delete(void *arg)
{
smb_tree_t *tree;
smb_ofile_t *of = (smb_ofile_t *)arg;
SMB_OFILE_VALID(of);
ASSERT(of->f_refcnt == 0);
ASSERT(of->f_state == SMB_OFILE_STATE_CLOSED);
ASSERT(!SMB_OFILE_OPLOCK_GRANTED(of));
tree = of->f_tree;
smb_llist_enter(&tree->t_ofile_list, RW_WRITER);
smb_llist_remove(&tree->t_ofile_list, of);
smb_idpool_free(&tree->t_fid_pool, of->f_fid);
atomic_dec_32(&tree->t_session->s_file_cnt);
smb_llist_exit(&tree->t_ofile_list);
mutex_enter(&of->f_mutex);
mutex_exit(&of->f_mutex);
switch (of->f_ftype) {
case SMB_FTYPE_BYTE_PIPE:
case SMB_FTYPE_MESG_PIPE:
smb_opipe_dealloc(of->f_pipe);
of->f_pipe = NULL;
break;
case SMB_FTYPE_DISK:
if (of->f_odir != NULL)
smb_odir_release(of->f_odir);
smb_node_rem_ofile(of->f_node, of);
smb_node_release(of->f_node);
break;
default:
ASSERT(!"f_ftype");
break;
}
of->f_magic = (uint32_t)~SMB_OFILE_MAGIC;
mutex_destroy(&of->f_mutex);
crfree(of->f_cr);
smb_user_release(of->f_user);
kmem_cache_free(smb_cache_ofile, of);
}
| 0 |
54,196 | 0 | static inline int acm_set_control(struct acm *acm, int control)
{
if (acm->quirks & QUIRK_CONTROL_LINE_STATE)
return -EOPNOTSUPP;
return acm_ctrl_msg(acm, USB_CDC_REQ_SET_CONTROL_LINE_STATE,
control, NULL, 0);
}
| 1 |
169,124 | 0 | HTMLTreeBuilderSimulator::State HTMLTreeBuilderSimulator::StateFor(
HTMLTreeBuilder* tree_builder) {
DCHECK(IsMainThread());
State namespace_stack;
for (HTMLElementStack::ElementRecord* record =
tree_builder->OpenElements()->TopRecord();
record; record = record->Next()) {
Namespace current_namespace = HTML;
if (record->NamespaceURI() == SVGNames::svgNamespaceURI)
current_namespace = SVG;
else if (record->NamespaceURI() == MathMLNames::mathmlNamespaceURI)
current_namespace = kMathML;
if (namespace_stack.IsEmpty() ||
namespace_stack.back() != current_namespace)
namespace_stack.push_back(current_namespace);
}
namespace_stack.Reverse();
return namespace_stack;
}
| 2 |
109,551 | 0 | int PrintWebViewHelper::PrintPreviewContext::total_page_count() const {
DCHECK(state_ != UNINITIALIZED);
return total_page_count_;
}
| 3 |
78,906 | 0 | static int yurex_open(struct inode *inode, struct file *file)
{
struct usb_yurex *dev;
struct usb_interface *interface;
int subminor;
int retval = 0;
subminor = iminor(inode);
interface = usb_find_interface(&yurex_driver, subminor);
if (!interface) {
printk(KERN_ERR "%s - error, can't find device for minor %d",
__func__, subminor);
retval = -ENODEV;
goto exit;
}
dev = usb_get_intfdata(interface);
if (!dev) {
retval = -ENODEV;
goto exit;
}
/* increment our usage count for the device */
kref_get(&dev->kref);
/* save our object in the file's private structure */
mutex_lock(&dev->io_mutex);
file->private_data = dev;
mutex_unlock(&dev->io_mutex);
exit:
return retval;
}
| 4 |
169,746 | 0 | exsltCryptoMd5Function (xmlXPathParserContextPtr ctxt, int nargs) {
int str_len = 0;
xmlChar *str = NULL, *ret = NULL;
unsigned char hash[HASH_DIGEST_LENGTH];
unsigned char hex[MD5_DIGEST_LENGTH * 2 + 1];
str_len = exsltCryptoPopString (ctxt, nargs, &str);
if (str_len == 0) {
xmlXPathReturnEmptyString (ctxt);
xmlFree (str);
return;
}
PLATFORM_HASH (ctxt, PLATFORM_MD5, (const char *) str, str_len,
(char *) hash);
exsltCryptoBin2Hex (hash, sizeof (hash) - 1, hex, sizeof (hex) - 1);
ret = xmlStrdup ((xmlChar *) hex);
xmlXPathReturnString (ctxt, ret);
if (str != NULL)
xmlFree (str);
}
| 5 |
145,939 | 0 | void DragEnd() {
resizer_->CompleteDrag();
resizer_.reset();
}
| 6 |
154,252 | 0 | error::Error GLES2DecoderImpl::HandleGetUniformuiv(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
if (!feature_info_->IsWebGL2OrES3Context())
return error::kUnknownCommand;
const volatile gles2::cmds::GetUniformuiv& c =
*static_cast<const volatile gles2::cmds::GetUniformuiv*>(cmd_data);
GLuint program = c.program;
GLint fake_location = c.location;
GLuint service_id;
GLenum result_type;
GLsizei result_size;
GLint real_location = -1;
Error error;
cmds::GetUniformuiv::Result* result;
if (GetUniformSetup<GLuint>(program, fake_location, c.params_shm_id,
c.params_shm_offset, &error, &real_location,
&service_id, &result, &result_type,
&result_size)) {
api()->glGetUniformuivFn(service_id, real_location, result->GetData());
}
return error;
}
| 7 |
38,512 | 0 | static int cma_rep_recv(struct rdma_id_private *id_priv)
{
int ret;
ret = cma_modify_qp_rtr(id_priv, NULL);
if (ret)
goto reject;
ret = cma_modify_qp_rts(id_priv, NULL);
if (ret)
goto reject;
ret = ib_send_cm_rtu(id_priv->cm_id.ib, NULL, 0);
if (ret)
goto reject;
return 0;
reject:
cma_modify_qp_err(id_priv);
ib_send_cm_rej(id_priv->cm_id.ib, IB_CM_REJ_CONSUMER_DEFINED,
NULL, 0, NULL, 0);
return ret;
}
| 8 |
96,336 | 0 | bool CNB::ScheduleBuildSGListForTx()
{
ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
return NdisMAllocateNetBufferSGList(m_Context->DmaHandle, m_NB, this,
NDIS_SG_LIST_WRITE_TO_DEVICE, nullptr, 0) == NDIS_STATUS_SUCCESS;
}
| 9 |
123,788 | 0 | TestConnectionHelper(base::TaskRunner* runner,
QuicClock* clock,
MockUDPClientSocket* socket)
: QuicConnectionHelper(runner, clock, socket) {
}
| 10 |
185,961 | 1 | static void CloudPrintInfoCallback(bool enabled,
const std::string& email,
const std::string& proxy_id) {
QuitMessageLoop();
}
| 11 |
158,921 | 0 | void PDFiumEngine::FinishPaint(int progressive_index,
pp::ImageData* image_data) {
DCHECK_GE(progressive_index, 0);
DCHECK_LT(static_cast<size_t>(progressive_index), progressive_paints_.size());
DCHECK(image_data);
int page_index = progressive_paints_[progressive_index].page_index;
const pp::Rect& dirty_in_screen = progressive_paints_[progressive_index].rect;
FPDF_BITMAP bitmap = progressive_paints_[progressive_index].bitmap;
int start_x, start_y, size_x, size_y;
GetPDFiumRect(page_index, dirty_in_screen, &start_x, &start_y, &size_x,
&size_y);
FPDF_FFLDraw(form_, bitmap, pages_[page_index]->GetPage(), start_x, start_y,
size_x, size_y, current_rotation_, GetRenderingFlags());
FillPageSides(progressive_index);
PaintPageShadow(progressive_index, image_data);
DrawSelections(progressive_index, image_data);
FPDF_RenderPage_Close(pages_[page_index]->GetPage());
FPDFBitmap_Destroy(bitmap);
progressive_paints_.erase(progressive_paints_.begin() + progressive_index);
client_->DocumentPaintOccurred();
}
| 12 |
28,508 | 0 | static void qeth_configure_blkt_default(struct qeth_card *card, char *prcd)
{
QETH_DBF_TEXT(SETUP, 2, "cfgblkt");
if (prcd[74] == 0xF0 && prcd[75] == 0xF0 &&
prcd[76] >= 0xF1 && prcd[76] <= 0xF4) {
card->info.blkt.time_total = 0;
card->info.blkt.inter_packet = 0;
card->info.blkt.inter_packet_jumbo = 0;
} else {
card->info.blkt.time_total = 250;
card->info.blkt.inter_packet = 5;
card->info.blkt.inter_packet_jumbo = 15;
}
}
| 13 |
83,192 | 0 | mrb_yield_with_class(mrb_state *mrb, mrb_value b, mrb_int argc, const mrb_value *argv, mrb_value self, struct RClass *c)
{
struct RProc *p;
mrb_sym mid = mrb->c->ci->mid;
mrb_callinfo *ci;
int n = mrb->c->ci->nregs;
mrb_value val;
if (mrb_nil_p(b)) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "no block given");
}
if (mrb->c->ci - mrb->c->cibase > MRB_FUNCALL_DEPTH_MAX) {
mrb_exc_raise(mrb, mrb_obj_value(mrb->stack_err));
}
p = mrb_proc_ptr(b);
ci = cipush(mrb);
ci->mid = mid;
ci->proc = p;
ci->stackent = mrb->c->stack;
ci->argc = (int)argc;
ci->target_class = c;
ci->acc = CI_ACC_SKIP;
mrb->c->stack = mrb->c->stack + n;
ci->nregs = MRB_PROC_CFUNC_P(p) ? (int)(argc+2) : p->body.irep->nregs;
stack_extend(mrb, ci->nregs);
mrb->c->stack[0] = self;
if (argc > 0) {
stack_copy(mrb->c->stack+1, argv, argc);
}
mrb->c->stack[argc+1] = mrb_nil_value();
if (MRB_PROC_CFUNC_P(p)) {
val = MRB_PROC_CFUNC(p)(mrb, self);
mrb->c->stack = mrb->c->ci->stackent;
cipop(mrb);
}
else {
val = mrb_run(mrb, p, self);
}
return val;
}
| 14 |
111,482 | 0 | static VirtualKeyboardType keyboardTypeAttribute(const WebCore::Element* element)
{
DEFINE_STATIC_LOCAL(QualifiedName, keyboardTypeAttr, (nullAtom, "data-blackberry-virtual-keyboard-type", nullAtom));
if (element->fastHasAttribute(keyboardTypeAttr)) {
AtomicString attributeString = element->fastGetAttribute(keyboardTypeAttr);
return convertStringToKeyboardType(attributeString);
}
if (element->isFormControlElement()) {
const HTMLFormControlElement* formElement = static_cast<const HTMLFormControlElement*>(element);
if (formElement->form() && formElement->form()->fastHasAttribute(keyboardTypeAttr)) {
AtomicString attributeString = formElement->form()->fastGetAttribute(keyboardTypeAttr);
return convertStringToKeyboardType(attributeString);
}
}
return VKBTypeNotSet;
}
| 15 |
35,780 | 0 | int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
struct kvm_sregs *sregs)
{
struct msr_data apic_base_msr;
int mmu_reset_needed = 0;
int pending_vec, max_bits, idx;
struct desc_ptr dt;
if (!guest_cpuid_has_xsave(vcpu) && (sregs->cr4 & X86_CR4_OSXSAVE))
return -EINVAL;
dt.size = sregs->idt.limit;
dt.address = sregs->idt.base;
kvm_x86_ops->set_idt(vcpu, &dt);
dt.size = sregs->gdt.limit;
dt.address = sregs->gdt.base;
kvm_x86_ops->set_gdt(vcpu, &dt);
vcpu->arch.cr2 = sregs->cr2;
mmu_reset_needed |= kvm_read_cr3(vcpu) != sregs->cr3;
vcpu->arch.cr3 = sregs->cr3;
__set_bit(VCPU_EXREG_CR3, (ulong *)&vcpu->arch.regs_avail);
kvm_set_cr8(vcpu, sregs->cr8);
mmu_reset_needed |= vcpu->arch.efer != sregs->efer;
kvm_x86_ops->set_efer(vcpu, sregs->efer);
apic_base_msr.data = sregs->apic_base;
apic_base_msr.host_initiated = true;
kvm_set_apic_base(vcpu, &apic_base_msr);
mmu_reset_needed |= kvm_read_cr0(vcpu) != sregs->cr0;
kvm_x86_ops->set_cr0(vcpu, sregs->cr0);
vcpu->arch.cr0 = sregs->cr0;
mmu_reset_needed |= kvm_read_cr4(vcpu) != sregs->cr4;
kvm_x86_ops->set_cr4(vcpu, sregs->cr4);
if (sregs->cr4 & X86_CR4_OSXSAVE)
kvm_update_cpuid(vcpu);
idx = srcu_read_lock(&vcpu->kvm->srcu);
if (!is_long_mode(vcpu) && is_pae(vcpu)) {
load_pdptrs(vcpu, vcpu->arch.walk_mmu, kvm_read_cr3(vcpu));
mmu_reset_needed = 1;
}
srcu_read_unlock(&vcpu->kvm->srcu, idx);
if (mmu_reset_needed)
kvm_mmu_reset_context(vcpu);
max_bits = KVM_NR_INTERRUPTS;
pending_vec = find_first_bit(
(const unsigned long *)sregs->interrupt_bitmap, max_bits);
if (pending_vec < max_bits) {
kvm_queue_interrupt(vcpu, pending_vec, false);
pr_debug("Set back pending irq %d\n", pending_vec);
}
kvm_set_segment(vcpu, &sregs->cs, VCPU_SREG_CS);
kvm_set_segment(vcpu, &sregs->ds, VCPU_SREG_DS);
kvm_set_segment(vcpu, &sregs->es, VCPU_SREG_ES);
kvm_set_segment(vcpu, &sregs->fs, VCPU_SREG_FS);
kvm_set_segment(vcpu, &sregs->gs, VCPU_SREG_GS);
kvm_set_segment(vcpu, &sregs->ss, VCPU_SREG_SS);
kvm_set_segment(vcpu, &sregs->tr, VCPU_SREG_TR);
kvm_set_segment(vcpu, &sregs->ldt, VCPU_SREG_LDTR);
update_cr8_intercept(vcpu);
/* Older userspace won't unhalt the vcpu on reset. */
if (kvm_vcpu_is_bsp(vcpu) && kvm_rip_read(vcpu) == 0xfff0 &&
sregs->cs.selector == 0xf000 && sregs->cs.base == 0xffff0000 &&
!is_protmode(vcpu))
vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
kvm_make_request(KVM_REQ_EVENT, vcpu);
return 0;
}
| 16 |
137,451 | 0 | Closure MessageLoop::QuitWhenIdleClosure() {
return Bind(&RunLoop::QuitCurrentWhenIdleDeprecated);
}
| 17 |
145,716 | 0 | void ApiTestEnvironment::RunPromisesAgain() {
env()->isolate()->RunMicrotasks();
base::MessageLoop::current()->PostTask(
FROM_HERE, base::Bind(&ApiTestEnvironment::RunPromisesAgain,
base::Unretained(this)));
}
| 18 |
113,535 | 0 | static void alterCurrentValue(PlatformUIElement element, int factor)
{
if (!element || !ATK_IS_VALUE(element))
return;
GValue currentValue = G_VALUE_INIT;
atk_value_get_current_value(ATK_VALUE(element), ¤tValue);
GValue increment = G_VALUE_INIT;
atk_value_get_minimum_increment(ATK_VALUE(element), &increment);
GValue newValue = G_VALUE_INIT;
g_value_init(&newValue, G_TYPE_DOUBLE);
g_value_set_float(&newValue, g_value_get_float(¤tValue) + factor * g_value_get_float(&increment));
atk_value_set_current_value(ATK_VALUE(element), &newValue);
g_value_unset(&newValue);
g_value_unset(&increment);
g_value_unset(¤tValue);
}
| 19 |
163,328 | 0 | scoped_refptr<base::TaskRunner> RenderThreadImpl::GetFileThreadTaskRunner() {
return blink_platform_impl_->BaseFileTaskRunner();
}
| 20 |
10,336 | 0 | psh_hint_align( PSH_Hint hint,
PSH_Globals globals,
FT_Int dimension,
PSH_Glyph glyph )
{
PSH_Dimension dim = &globals->dimension[dimension];
FT_Fixed scale = dim->scale_mult;
FT_Fixed delta = dim->scale_delta;
if ( !psh_hint_is_fitted( hint ) )
{
FT_Pos pos = FT_MulFix( hint->org_pos, scale ) + delta;
FT_Pos len = FT_MulFix( hint->org_len, scale );
FT_Int do_snapping;
FT_Pos fit_len;
PSH_AlignmentRec align;
/* ignore stem alignments when requested through the hint flags */
if ( ( dimension == 0 && !glyph->do_horz_hints ) ||
( dimension == 1 && !glyph->do_vert_hints ) )
{
hint->cur_pos = pos;
hint->cur_len = len;
psh_hint_set_fitted( hint );
return;
}
/* perform stem snapping when requested - this is necessary
* for monochrome and LCD hinting modes only
*/
do_snapping = ( dimension == 0 && glyph->do_horz_snapping ) ||
( dimension == 1 && glyph->do_vert_snapping );
hint->cur_len = fit_len = len;
/* check blue zones for horizontal stems */
align.align = PSH_BLUE_ALIGN_NONE;
align.align_bot = align.align_top = 0;
if ( dimension == 1 )
psh_blues_snap_stem( &globals->blues,
hint->org_pos + hint->org_len,
hint->org_pos,
&align );
switch ( align.align )
{
case PSH_BLUE_ALIGN_TOP:
/* the top of the stem is aligned against a blue zone */
hint->cur_pos = align.align_top - fit_len;
break;
case PSH_BLUE_ALIGN_BOT:
/* the bottom of the stem is aligned against a blue zone */
hint->cur_pos = align.align_bot;
break;
case PSH_BLUE_ALIGN_TOP | PSH_BLUE_ALIGN_BOT:
/* both edges of the stem are aligned against blue zones */
hint->cur_pos = align.align_bot;
hint->cur_len = align.align_top - align.align_bot;
break;
default:
{
PSH_Hint parent = hint->parent;
if ( parent )
{
FT_Pos par_org_center, par_cur_center;
FT_Pos cur_org_center, cur_delta;
/* ensure that parent is already fitted */
if ( !psh_hint_is_fitted( parent ) )
psh_hint_align( parent, globals, dimension, glyph );
/* keep original relation between hints, this is, use the */
/* scaled distance between the centers of the hints to */
/* compute the new position */
par_org_center = parent->org_pos + ( parent->org_len >> 1 );
par_cur_center = parent->cur_pos + ( parent->cur_len >> 1 );
cur_org_center = hint->org_pos + ( hint->org_len >> 1 );
cur_delta = FT_MulFix( cur_org_center - par_org_center, scale );
pos = par_cur_center + cur_delta - ( len >> 1 );
}
hint->cur_pos = pos;
hint->cur_len = fit_len;
/* Stem adjustment tries to snap stem widths to standard
* ones. This is important to prevent unpleasant rounding
* artefacts.
*/
if ( glyph->do_stem_adjust )
{
if ( len <= 64 )
{
/* the stem is less than one pixel; we will center it
* around the nearest pixel center
*/
if ( len >= 32 )
{
/* This is a special case where we also widen the stem
* and align it to the pixel grid.
*
* stem_center = pos + (len/2)
* nearest_pixel_center = FT_ROUND(stem_center-32)+32
* new_pos = nearest_pixel_center-32
* = FT_ROUND(stem_center-32)
* = FT_FLOOR(stem_center-32+32)
* = FT_FLOOR(stem_center)
* new_len = 64
*/
pos = FT_PIX_FLOOR( pos + ( len >> 1 ) );
len = 64;
}
else if ( len > 0 )
{
/* This is a very small stem; we simply align it to the
* pixel grid, trying to find the minimal displacement.
*
* left = pos
* right = pos + len
* left_nearest_edge = ROUND(pos)
* right_nearest_edge = ROUND(right)
*
* if ( ABS(left_nearest_edge - left) <=
* ABS(right_nearest_edge - right) )
* new_pos = left
* else
* new_pos = right
*/
FT_Pos left_nearest = FT_PIX_ROUND( pos );
FT_Pos right_nearest = FT_PIX_ROUND( pos + len );
FT_Pos left_disp = left_nearest - pos;
FT_Pos right_disp = right_nearest - ( pos + len );
if ( left_disp < 0 )
left_disp = -left_disp;
if ( right_disp < 0 )
right_disp = -right_disp;
if ( left_disp <= right_disp )
pos = left_nearest;
else
pos = right_nearest;
}
else
{
/* this is a ghost stem; we simply round it */
pos = FT_PIX_ROUND( pos );
}
}
else
{
len = psh_dimension_quantize_len( dim, len, 0 );
}
}
/* now that we have a good hinted stem width, try to position */
/* the stem along a pixel grid integer coordinate */
hint->cur_pos = pos + psh_hint_snap_stem_side_delta( pos, len );
hint->cur_len = len;
}
}
if ( do_snapping )
{
pos = hint->cur_pos;
len = hint->cur_len;
if ( len < 64 )
len = 64;
else
len = FT_PIX_ROUND( len );
switch ( align.align )
{
case PSH_BLUE_ALIGN_TOP:
hint->cur_pos = align.align_top - len;
hint->cur_len = len;
break;
case PSH_BLUE_ALIGN_BOT:
hint->cur_len = len;
break;
case PSH_BLUE_ALIGN_BOT | PSH_BLUE_ALIGN_TOP:
/* don't touch */
break;
default:
hint->cur_len = len;
if ( len & 64 )
pos = FT_PIX_FLOOR( pos + ( len >> 1 ) ) + 32;
else
pos = FT_PIX_ROUND( pos + ( len >> 1 ) );
hint->cur_pos = pos - ( len >> 1 );
hint->cur_len = len;
}
}
psh_hint_set_fitted( hint );
#ifdef DEBUG_HINTER
if ( ps_debug_hint_func )
ps_debug_hint_func( hint, dimension );
#endif
}
}
| 21 |
99,329 | 0 | void ResourceMessageFilter::OnRendererTcmalloc(base::ProcessId pid,
const std::string& output) {
ChromeThread::PostTask(
ChromeThread::UI, FROM_HERE,
NewRunnableFunction(AboutTcmallocRendererCallback, pid, output));
}
| 22 |
120,922 | 0 | void SocketStream::Close() {
DCHECK(base::MessageLoop::current())
<< "The current base::MessageLoop must exist";
DCHECK_EQ(base::MessageLoop::TYPE_IO, base::MessageLoop::current()->type())
<< "The current base::MessageLoop must be TYPE_IO";
if (next_state_ == STATE_NONE)
return;
base::MessageLoop::current()->PostTask(
FROM_HERE, base::Bind(&SocketStream::DoClose, this));
}
| 23 |
146,584 | 0 | void WebGLRenderingContextBase::uniformMatrix4fv(
const WebGLUniformLocation* location,
GLboolean transpose,
MaybeShared<DOMFloat32Array> v) {
if (isContextLost() ||
!ValidateUniformMatrixParameters("uniformMatrix4fv", location, transpose,
v.View(), 16, 0, v.View()->length()))
return;
ContextGL()->UniformMatrix4fv(location->Location(), v.View()->length() >> 4,
transpose, v.View()->DataMaybeShared());
}
| 24 |
164,683 | 0 | bool RenderFrameHostImpl::CanCommitURL(const GURL& url) {
if (IsRendererDebugURL(url))
return false;
if (!frame_tree_node()->IsMainFrame()) {
bool is_in_mhtml = frame_tree_node_->frame_tree()
->root()
->current_frame_host()
->is_mhtml_document();
if (is_in_mhtml) {
return IsSameSiteInstance(
frame_tree_node()->parent()->current_frame_host());
}
}
if (!GetContentClient()->browser()->CanCommitURL(GetProcess(), url))
return false;
return true;
}
| 25 |
146,404 | 0 | bool WebGLRenderingContextBase::ValidateCopyTexFormat(const char* function_name,
GLenum internalformat) {
if (!is_web_gl2_internal_formats_copy_tex_image_added_ &&
IsWebGL2OrHigher()) {
ADD_VALUES_TO_SET(supported_internal_formats_copy_tex_image_,
kSupportedInternalFormatsES3);
is_web_gl2_internal_formats_copy_tex_image_added_ = true;
}
if (!is_ext_color_buffer_float_formats_added_ &&
ExtensionEnabled(kEXTColorBufferFloatName)) {
ADD_VALUES_TO_SET(supported_internal_formats_copy_tex_image_,
kSupportedInternalFormatsCopyTexImageFloatES3);
is_ext_color_buffer_float_formats_added_ = true;
}
if (supported_internal_formats_copy_tex_image_.find(internalformat) ==
supported_internal_formats_copy_tex_image_.end()) {
SynthesizeGLError(GL_INVALID_ENUM, function_name, "invalid internalformat");
return false;
}
return true;
}
| 26 |
25,240 | 0 | armv6_pmcr_has_overflowed(unsigned long pmcr)
{
return pmcr & ARMV6_PMCR_OVERFLOWED_MASK;
}
| 27 |
157,744 | 0 | void WebContentsImpl::Cut() {
RenderFrameHostImpl* focused_frame = GetFocusedFrame();
if (!focused_frame)
return;
focused_frame->GetFrameInputHandler()->Cut();
RecordAction(base::UserMetricsAction("Cut"));
}
| 28 |
122,434 | 0 | bool HTMLTextAreaElement::isKeyboardFocusable() const
{
return isFocusable();
}
| 29 |
111,495 | 0 | void InputHandler::removeAttributedTextMarker()
{
if (m_currentFocusElement && m_currentFocusElement->document())
m_currentFocusElement->document()->markers()->removeMarkers(DocumentMarker::AttributeText);
m_composingTextStart = 0;
m_composingTextEnd = 0;
}
| 30 |
63,007 | 0 | static int nested_vmx_get_vmptr(struct kvm_vcpu *vcpu, gpa_t *vmpointer)
{
gva_t gva;
struct x86_exception e;
if (get_vmx_mem_address(vcpu, vmcs_readl(EXIT_QUALIFICATION),
vmcs_read32(VMX_INSTRUCTION_INFO), false, &gva))
return 1;
if (kvm_read_guest_virt(&vcpu->arch.emulate_ctxt, gva, vmpointer,
sizeof(*vmpointer), &e)) {
kvm_inject_page_fault(vcpu, &e);
return 1;
}
return 0;
}
| 31 |
104,976 | 0 | void GraphicsContext::scale(const FloatSize& scale)
{
#if USE(WXGC)
if (m_data->context) {
wxGraphicsContext* gc = m_data->context->GetGraphicsContext();
gc->Scale(scale.width(), scale.height());
}
#endif
}
| 32 |
157,963 | 0 | void RenderViewImpl::OnUpdateTargetURLAck() {
if (target_url_status_ == TARGET_PENDING)
Send(new ViewHostMsg_UpdateTargetURL(GetRoutingID(), pending_target_url_));
target_url_status_ = TARGET_NONE;
}
| 33 |
119,849 | 0 | bool WebContentsImpl::CreateRenderViewForRenderManager(
RenderViewHost* render_view_host, int opener_route_id) {
TRACE_EVENT0("browser", "WebContentsImpl::CreateRenderViewForRenderManager");
RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(render_view_host);
if (rwh_view)
rwh_view->SetSize(GetSizeForNewRenderView());
UpdateMaxPageIDIfNecessary(render_view_host);
int32 max_page_id =
GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance());
if (!static_cast<RenderViewHostImpl*>(
render_view_host)->CreateRenderView(string16(),
opener_route_id,
max_page_id)) {
return false;
}
#if defined(OS_LINUX) || defined(OS_OPENBSD)
if (rwh_view) {
if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost())
render_widget_host->WasResized();
}
#endif
return true;
}
| 34 |
154,658 | 0 | error::Error GLES2DecoderPassthroughImpl::DoFramebufferTexture2DMultisampleEXT(
GLenum target,
GLenum attachment,
GLenum textarget,
GLuint texture,
GLint level,
GLsizei samples) {
NOTREACHED();
return error::kNoError;
}
| 35 |
150,349 | 0 | void Block(aura::Window* window) {
window_ = window;
Register(window);
}
| 36 |
81,848 | 0 | static int wc_ecc_alloc_async(ecc_key* key)
{
int err = wc_ecc_alloc_mpint(key, &key->r);
if (err == 0)
err = wc_ecc_alloc_mpint(key, &key->s);
return err;
}
| 37 |
27,200 | 0 | int id_lookup_value(void *ptr)
{
return g_hash_table_find(g_ids, id_match_value, &ptr) ? (uintptr_t)ptr : -1;
}
| 38 |
84,129 | 0 | void blkcg_print_blkgs(struct seq_file *sf, struct blkcg *blkcg,
u64 (*prfill)(struct seq_file *,
struct blkg_policy_data *, int),
const struct blkcg_policy *pol, int data,
bool show_total)
{
struct blkcg_gq *blkg;
u64 total = 0;
rcu_read_lock();
hlist_for_each_entry_rcu(blkg, &blkcg->blkg_list, blkcg_node) {
spin_lock_irq(blkg->q->queue_lock);
if (blkcg_policy_enabled(blkg->q, pol))
total += prfill(sf, blkg->pd[pol->plid], data);
spin_unlock_irq(blkg->q->queue_lock);
}
rcu_read_unlock();
if (show_total)
seq_printf(sf, "Total %llu\n", (unsigned long long)total);
}
| 39 |
58,019 | 0 | static int nft_deltable(struct nft_ctx *ctx)
{
int err;
err = nft_trans_table_add(ctx, NFT_MSG_DELTABLE);
if (err < 0)
return err;
list_del_rcu(&ctx->table->list);
return err;
}
| 40 |
88,033 | 0 | static int ctrl_fill_mcgrp_info(const struct genl_family *family,
const struct genl_multicast_group *grp,
int grp_id, u32 portid, u32 seq, u32 flags,
struct sk_buff *skb, u8 cmd)
{
void *hdr;
struct nlattr *nla_grps;
struct nlattr *nest;
hdr = genlmsg_put(skb, portid, seq, &genl_ctrl, flags, cmd);
if (hdr == NULL)
return -1;
if (nla_put_string(skb, CTRL_ATTR_FAMILY_NAME, family->name) ||
nla_put_u16(skb, CTRL_ATTR_FAMILY_ID, family->id))
goto nla_put_failure;
nla_grps = nla_nest_start(skb, CTRL_ATTR_MCAST_GROUPS);
if (nla_grps == NULL)
goto nla_put_failure;
nest = nla_nest_start(skb, 1);
if (nest == NULL)
goto nla_put_failure;
if (nla_put_u32(skb, CTRL_ATTR_MCAST_GRP_ID, grp_id) ||
nla_put_string(skb, CTRL_ATTR_MCAST_GRP_NAME,
grp->name))
goto nla_put_failure;
nla_nest_end(skb, nest);
nla_nest_end(skb, nla_grps);
genlmsg_end(skb, hdr);
return 0;
nla_put_failure:
genlmsg_cancel(skb, hdr);
return -EMSGSIZE;
}
| 41 |
64,809 | 0 | int skcipher_walk_aead_decrypt(struct skcipher_walk *walk,
struct aead_request *req, bool atomic)
{
struct crypto_aead *tfm = crypto_aead_reqtfm(req);
walk->total = req->cryptlen - crypto_aead_authsize(tfm);
return skcipher_walk_aead_common(walk, req, atomic);
}
| 42 |
6,158 | 0 | static int tls1_check_cert_param(SSL *s, X509 *x, int set_ee_md)
{
unsigned char comp_id, curve_id[2];
EVP_PKEY *pkey;
int rv;
pkey = X509_get_pubkey(x);
if (!pkey)
return 0;
/* If not EC nothing to do */
if (pkey->type != EVP_PKEY_EC) {
EVP_PKEY_free(pkey);
return 1;
}
rv = tls1_set_ec_id(curve_id, &comp_id, pkey->pkey.ec);
EVP_PKEY_free(pkey);
if (!rv)
return 0;
/*
* Can't check curve_id for client certs as we don't have a supported
* curves extension.
*/
rv = tls1_check_ec_key(s, s->server ? curve_id : NULL, &comp_id);
if (!rv)
return 0;
/*
* Special case for suite B. We *MUST* sign using SHA256+P-256 or
* SHA384+P-384, adjust digest if necessary.
*/
if (set_ee_md && tls1_suiteb(s)) {
int check_md;
size_t i;
CERT *c = s->cert;
if (curve_id[0])
return 0;
/* Check to see we have necessary signing algorithm */
if (curve_id[1] == TLSEXT_curve_P_256)
check_md = NID_ecdsa_with_SHA256;
else if (curve_id[1] == TLSEXT_curve_P_384)
check_md = NID_ecdsa_with_SHA384;
else
return 0; /* Should never happen */
for (i = 0; i < c->shared_sigalgslen; i++)
if (check_md == c->shared_sigalgs[i].signandhash_nid)
break;
if (i == c->shared_sigalgslen)
return 0;
if (set_ee_md == 2) {
if (check_md == NID_ecdsa_with_SHA256)
c->pkeys[SSL_PKEY_ECC].digest = EVP_sha256();
else
c->pkeys[SSL_PKEY_ECC].digest = EVP_sha384();
}
}
return rv;
}
| 43 |
127,755 | 0 | void RemoveMockTransaction(const MockTransaction* trans) {
mock_transactions.erase(GURL(trans->url).spec());
}
| 44 |
73,161 | 0 | chunk_copy(const chunk_t *in_chunk)
{
chunk_t *newch = tor_memdup(in_chunk, CHUNK_ALLOC_SIZE(in_chunk->memlen));
total_bytes_allocated_in_chunks += CHUNK_ALLOC_SIZE(in_chunk->memlen);
#ifdef DEBUG_CHUNK_ALLOC
newch->DBG_alloc = CHUNK_ALLOC_SIZE(in_chunk->memlen);
#endif
newch->next = NULL;
if (in_chunk->data) {
off_t offset = in_chunk->data - in_chunk->mem;
newch->data = newch->mem + offset;
}
return newch;
}
| 45 |
1,981 | 0 | SPICE_GNUC_VISIBLE int spice_server_set_listen_socket_fd(SpiceServer *s, int listen_fd)
{
spice_assert(reds == s);
spice_listen_socket_fd = listen_fd;
return 0;
}
| 46 |
45,141 | 0 | static const char *req_method_field(request_rec *r)
{
return r->method;
}
| 47 |
4,741 | 0 | user_get_user_name (User *user)
{
return accounts_user_get_user_name (ACCOUNTS_USER (user));
}
| 48 |
1,591 | 0 | aspath_left_confed_check (struct aspath *aspath)
{
if ( !(aspath && aspath->segments) )
return 0;
if ( (aspath->segments->type == AS_CONFED_SEQUENCE)
|| (aspath->segments->type == AS_CONFED_SET) )
return 1;
return 0;
}
| 49 |
147,185 | 0 | static void ActivityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::ToImpl(holder);
V8SetReturnValueInt(info, impl->activityLoggingGetterPerWorldBindingsLongAttribute());
}
| 50 |
86,705 | 0 | static void blk_mq_freeze_queue_wait(struct request_queue *q)
{
wait_event(q->mq_freeze_wq, percpu_ref_is_zero(&q->mq_usage_counter));
}
| 51 |
46,166 | 0 | int filp_close(struct file *filp, fl_owner_t id)
{
int retval = 0;
if (!file_count(filp)) {
printk(KERN_ERR "VFS: Close: file count is 0\n");
return 0;
}
if (filp->f_op->flush)
retval = filp->f_op->flush(filp, id);
if (likely(!(filp->f_mode & FMODE_PATH))) {
dnotify_flush(filp, id);
locks_remove_posix(filp, id);
}
fput(filp);
return retval;
}
| 52 |
28,360 | 0 | static void ping_clear_saddr(struct sock *sk, int dif)
{
sk->sk_bound_dev_if = dif;
if (sk->sk_family == AF_INET) {
struct inet_sock *isk = inet_sk(sk);
isk->inet_rcv_saddr = isk->inet_saddr = 0;
#if IS_ENABLED(CONFIG_IPV6)
} else if (sk->sk_family == AF_INET6) {
struct ipv6_pinfo *np = inet6_sk(sk);
memset(&sk->sk_v6_rcv_saddr, 0, sizeof(sk->sk_v6_rcv_saddr));
memset(&np->saddr, 0, sizeof(np->saddr));
#endif
}
}
| 53 |
85,178 | 0 | void f2fs_submit_merged_bio(struct f2fs_sb_info *sbi, enum page_type type,
int rw)
{
__f2fs_submit_merged_bio(sbi, NULL, NULL, 0, type, rw);
}
| 54 |
107,759 | 0 | bool FrameLoader::PrepareForCommit() {
PluginScriptForbiddenScope forbid_plugin_destructor_scripting;
DocumentLoader* pdl = provisional_document_loader_;
if (frame_->GetDocument()) {
unsigned node_count = 0;
for (Frame* frame = frame_; frame; frame = frame->Tree().TraverseNext()) {
if (auto* local_frame = DynamicTo<LocalFrame>(frame))
node_count += local_frame->GetDocument()->NodeCount();
}
unsigned total_node_count =
InstanceCounters::CounterValue(InstanceCounters::kNodeCounter);
float ratio = static_cast<float>(node_count) / total_node_count;
ThreadState::Current()->SchedulePageNavigationGCIfNeeded(ratio);
}
FrameNavigationDisabler navigation_disabler(*frame_);
SubframeLoadingDisabler disabler(frame_->GetDocument());
IgnoreOpensDuringUnloadCountIncrementer ignore_opens_during_unload(
frame_->GetDocument());
if (document_loader_) {
Client()->DispatchWillCommitProvisionalLoad();
DispatchUnloadEvent();
}
frame_->DetachChildren();
if (pdl != provisional_document_loader_)
return false;
if (document_loader_) {
base::AutoReset<bool> in_detach_document_loader(
&protect_provisional_loader_, true);
DetachDocumentLoader(document_loader_, true);
}
if (!frame_->Client())
return false;
DCHECK_EQ(provisional_document_loader_, pdl);
if (frame_->GetDocument())
frame_->GetDocument()->Shutdown();
document_loader_ = provisional_document_loader_.Release();
if (document_loader_)
document_loader_->MarkAsCommitted();
TakeObjectSnapshot();
return true;
}
| 55 |
75,324 | 0 | int stb_vorbis_seek_frame(stb_vorbis *f, unsigned int sample_number)
{
uint32 max_frame_samples;
if (IS_PUSH_MODE(f)) return error(f, VORBIS_invalid_api_mixing);
if (!seek_to_sample_coarse(f, sample_number))
return 0;
assert(f->current_loc_valid);
assert(f->current_loc <= sample_number);
max_frame_samples = (f->blocksize_1*3 - f->blocksize_0) >> 2;
while (f->current_loc < sample_number) {
int left_start, left_end, right_start, right_end, mode, frame_samples;
if (!peek_decode_initial(f, &left_start, &left_end, &right_start, &right_end, &mode))
return error(f, VORBIS_seek_failed);
frame_samples = right_start - left_start;
if (f->current_loc + frame_samples > sample_number) {
return 1; // the next frame will contain the sample
} else if (f->current_loc + frame_samples + max_frame_samples > sample_number) {
vorbis_pump_first_frame(f);
} else {
f->current_loc += frame_samples;
f->previous_length = 0;
maybe_start_packet(f);
flush_packet(f);
}
}
assert(f->current_loc == sample_number);
return 1;
}
| 56 |
74,494 | 0 | static void regulator_dev_release(struct device *dev)
{
struct regulator_dev *rdev = dev_get_drvdata(dev);
kfree(rdev);
}
| 57 |
126,819 | 0 | virtual void Layout() {
if (parent()) {
gfx::Size ps = GetPreferredSize();
SetBounds(parent()->width() - ps.width(),
parent()->height() - ps.height(), ps.width(), ps.height());
}
}
| 58 |
61,734 | 0 | bool tcp_alloc_md5sig_pool(void)
{
if (unlikely(!tcp_md5sig_pool_populated)) {
mutex_lock(&tcp_md5sig_mutex);
if (!tcp_md5sig_pool_populated)
__tcp_alloc_md5sig_pool();
mutex_unlock(&tcp_md5sig_mutex);
}
return tcp_md5sig_pool_populated;
}
| 59 |
41,293 | 0 | void do_become_nonbusy(struct comedi_device *dev, struct comedi_subdevice *s)
{
struct comedi_async *async = s->async;
comedi_set_subdevice_runflags(s, SRF_RUNNING, 0);
if (async) {
comedi_reset_async_buf(async);
async->inttrig = NULL;
} else {
printk(KERN_ERR
"BUG: (?) do_become_nonbusy called with async=0\n");
}
s->busy = NULL;
}
| 60 |
9,175 | 0 | void qemu_put_virtqueue_element(QEMUFile *f, VirtQueueElement *elem)
{
VirtQueueElementOld data;
int i;
memset(&data, 0, sizeof(data));
data.index = elem->index;
data.in_num = elem->in_num;
data.out_num = elem->out_num;
for (i = 0; i < elem->in_num; i++) {
data.in_addr[i] = elem->in_addr[i];
}
for (i = 0; i < elem->out_num; i++) {
data.out_addr[i] = elem->out_addr[i];
}
for (i = 0; i < elem->in_num; i++) {
/* Base is overwritten by virtqueue_map when loading. Do not
* save it, as it would leak the QEMU address space layout. */
data.in_sg[i].iov_len = elem->in_sg[i].iov_len;
}
for (i = 0; i < elem->out_num; i++) {
/* Do not save iov_base as above. */
data.out_sg[i].iov_len = elem->out_sg[i].iov_len;
}
qemu_put_buffer(f, (uint8_t *)&data, sizeof(VirtQueueElementOld));
}
| 61 |
43,891 | 0 | _archive_write_disk_free(struct archive *_a)
{
struct archive_write_disk *a;
int ret;
if (_a == NULL)
return (ARCHIVE_OK);
archive_check_magic(_a, ARCHIVE_WRITE_DISK_MAGIC,
ARCHIVE_STATE_ANY | ARCHIVE_STATE_FATAL, "archive_write_disk_free");
a = (struct archive_write_disk *)_a;
ret = _archive_write_disk_close(&a->archive);
archive_write_disk_set_group_lookup(&a->archive, NULL, NULL, NULL);
archive_write_disk_set_user_lookup(&a->archive, NULL, NULL, NULL);
if (a->entry)
archive_entry_free(a->entry);
archive_string_free(&a->_name_data);
archive_string_free(&a->archive.error_string);
archive_string_free(&a->path_safe);
a->archive.magic = 0;
__archive_clean(&a->archive);
free(a->decmpfs_header_p);
free(a->resource_fork);
free(a->compressed_buffer);
free(a->uncompressed_buffer);
#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\
&& defined(HAVE_ZLIB_H)
if (a->stream_valid) {
switch (deflateEnd(&a->stream)) {
case Z_OK:
break;
default:
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Failed to clean up compressor");
ret = ARCHIVE_FATAL;
break;
}
}
#endif
free(a);
return (ret);
}
| 62 |
121,151 | 0 | Decimal HTMLInputElement::findClosestTickMarkValue(const Decimal& value)
{
return m_inputType->findClosestTickMarkValue(value);
}
| 63 |
177,532 | 0 | void show_rate_histogram(struct rate_hist *hist,
const vpx_codec_enc_cfg_t *cfg, int max_buckets) {
int i, scale;
int buckets = 0;
for (i = 0; i < RATE_BINS; i++) {
if (hist->bucket[i].low == INT_MAX)
continue;
hist->bucket[buckets++] = hist->bucket[i];
}
fprintf(stderr, "\nRate (over %dms window):\n", cfg->rc_buf_sz);
scale = merge_hist_buckets(hist->bucket, max_buckets, &buckets);
show_histogram(hist->bucket, buckets, hist->total, scale);
}
| 64 |
18,009 | 0 | jbig2_error(Jbig2Ctx *ctx, Jbig2Severity severity, int32_t segment_number, const char *fmt, ...)
{
char buf[1024];
va_list ap;
int n;
int code;
va_start(ap, fmt);
n = vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
if (n < 0 || n == sizeof(buf))
strncpy(buf, "jbig2_error: error in generating error string", sizeof(buf));
code = ctx->error_callback(ctx->error_callback_data, buf, severity, segment_number);
if (severity == JBIG2_SEVERITY_FATAL)
code = -1;
return code;
}
| 65 |
178,042 | 1 | static char *ps_files_path_create(char *buf, size_t buflen, ps_files *data, const char *key)
{
{
size_t len;
const char *p;
char c;
int ret = 1;
for (p = key; (c = *p); p++) {
/* valid characters are a..z,A..Z,0..9 */
if (!((c >= 'a' && c <= 'z')
|| (c >= 'A' && c <= 'Z')
|| (c >= '0' && c <= '9')
|| c == ','
|| c == '-')) {
ret = 0;
break;
}
}
len = p - key;
/* Somewhat arbitrary length limit here, but should be way more than
anyone needs and avoids file-level warnings later on if we exceed MAX_PATH */
if (len == 0 || len > 128) {
ret = 0;
}
return ret;
}
static char *ps_files_path_create(char *buf, size_t buflen, ps_files *data, const char *key)
{
size_t key_len;
const char *p;
int i;
int n;
key_len = strlen(key);
if (key_len <= data->dirdepth ||
buflen < (strlen(data->basedir) + 2 * data->dirdepth + key_len + 5 + sizeof(FILE_PREFIX))) {
return NULL;
}
p = key;
memcpy(buf, data->basedir, data->basedir_len);
n = data->basedir_len;
buf[n++] = PHP_DIR_SEPARATOR;
for (i = 0; i < (int)data->dirdepth; i++) {
buf[n++] = *p++;
buf[n++] = PHP_DIR_SEPARATOR;
}
memcpy(buf + n, FILE_PREFIX, sizeof(FILE_PREFIX) - 1);
n += sizeof(FILE_PREFIX) - 1;
memcpy(buf + n, key, key_len);
n += key_len;
ps_files_close(data);
if (!ps_files_valid_key(key)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,'");
PS(invalid_session_id) = 1;
return;
}
if (!ps_files_path_create(buf, sizeof(buf), data, key)) {
return;
}
if (data->fd != -1) {
#ifdef PHP_WIN32
/* On Win32 locked files that are closed without being explicitly unlocked
will be unlocked only when "system resources become available". */
flock(data->fd, LOCK_UN);
#endif
close(data->fd);
data->fd = -1;
}
}
static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
{
char buf[MAXPATHLEN];
if (data->fd < 0 || !data->lastkey || strcmp(key, data->lastkey)) {
if (data->lastkey) {
efree(data->lastkey);
data->lastkey = NULL;
}
ps_files_close(data);
if (!ps_files_valid_key(key)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,'");
PS(invalid_session_id) = 1;
return;
}
if (!ps_files_path_create(buf, sizeof(buf), data, key)) {
return;
}
data->lastkey = estrdup(key);
data->fd = VCWD_OPEN_MODE(buf, O_CREAT | O_RDWR | O_BINARY, data->filemode);
if (data->fd != -1) {
#ifndef PHP_WIN32
/* check to make sure that the opened file is not a symlink, linking to data outside of allowable dirs */
if (PG(open_basedir)) {
struct stat sbuf;
if (fstat(data->fd, &sbuf)) {
close(data->fd);
return;
}
if (S_ISLNK(sbuf.st_mode) && php_check_open_basedir(buf TSRMLS_CC)) {
close(data->fd);
return;
}
}
#endif
flock(data->fd, LOCK_EX);
#ifdef F_SETFD
# ifndef FD_CLOEXEC
# define FD_CLOEXEC 1
# endif
if (fcntl(data->fd, F_SETFD, FD_CLOEXEC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "fcntl(%d, F_SETFD, FD_CLOEXEC) failed: %s (%d)", data->fd, strerror(errno), errno);
}
#endif
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf, strerror(errno), errno);
}
}
}
static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
{
DIR *dir;
char dentry[sizeof(struct dirent) + MAXPATHLEN];
struct dirent *entry = (struct dirent *) &dentry;
struct stat sbuf;
char buf[MAXPATHLEN];
time_t now;
int nrdels = 0;
size_t dirname_len;
dir = opendir(dirname);
if (!dir) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)", dirname, strerror(errno), errno);
return (0);
}
time(&now);
return (nrdels);
}
#define PS_FILES_DATA ps_files *data = PS_GET_MOD_DATA()
PS_OPEN_FUNC(files)
(now - sbuf.st_mtime) > maxlifetime) {
VCWD_UNLINK(buf);
nrdels++;
}
}
| 66 |
106,273 | 0 | EncodedJSValue JSC_HOST_CALL jsTestSerializedScriptValueInterfacePrototypeFunctionMultiTransferList(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSTestSerializedScriptValueInterface::s_info))
return throwVMTypeError(exec);
JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestSerializedScriptValueInterface::s_info);
TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
size_t argsCount = exec->argumentCount();
if (argsCount <= 0) {
impl->multiTransferList();
return JSValue::encode(jsUndefined());
}
RefPtr<SerializedScriptValue> first(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
if (argsCount <= 1) {
impl->multiTransferList(first);
return JSValue::encode(jsUndefined());
}
Array* tx(toArray(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
if (argsCount <= 2) {
impl->multiTransferList(first, tx);
return JSValue::encode(jsUndefined());
}
RefPtr<SerializedScriptValue> second(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
if (argsCount <= 3) {
impl->multiTransferList(first, tx, second);
return JSValue::encode(jsUndefined());
}
Array* txx(toArray(MAYBE_MISSING_PARAMETER(exec, 3, DefaultIsUndefined)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
impl->multiTransferList(first, tx, second, txx);
return JSValue::encode(jsUndefined());
}
| 67 |
83,077 | 0 | void git_delta_index_free(git_delta_index *index)
{
git__free(index);
}
| 68 |
163,614 | 0 | htmlParseCharData(htmlParserCtxtPtr ctxt) {
htmlParseCharDataInternal(ctxt, 0);
}
| 69 |
49,957 | 0 | void php_mysqlnd_rset_header_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
{
MYSQLND_PACKET_RSET_HEADER *p= (MYSQLND_PACKET_RSET_HEADER *) _packet;
DBG_ENTER("php_mysqlnd_rset_header_free_mem");
if (p->info_or_local_file) {
mnd_efree(p->info_or_local_file);
p->info_or_local_file = NULL;
}
if (!stack_allocation) {
mnd_pefree(p, p->header.persistent);
}
DBG_VOID_RETURN;
}
| 70 |
176,065 | 0 | void mca_ccb_ll_open(tMCA_CCB* p_ccb, tMCA_CCB_EVT* p_data) {
tMCA_CTRL evt_data;
p_ccb->cong = false;
evt_data.connect_ind.mtu = p_data->open.peer_mtu;
evt_data.connect_ind.bd_addr = p_ccb->peer_addr;
mca_ccb_report_event(p_ccb, MCA_CONNECT_IND_EVT, &evt_data);
}
| 71 |
119,177 | 0 | const AtomicString& XMLHttpRequest::interfaceName() const
{
return eventNames().interfaceForXMLHttpRequest;
}
| 72 |
94,694 | 0 | int i2d_X509_bio(BIO *bp, X509 *x509)
{
return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509), bp, x509);
}
| 73 |
62,371 | 0 | wb_preq(netdissect_options *ndo,
const struct pkt_preq *preq, u_int len)
{
ND_PRINT((ndo, " wb-preq:"));
if (len < sizeof(*preq) || !ND_TTEST(*preq))
return (-1);
ND_PRINT((ndo, " need %u/%s:%u",
EXTRACT_32BITS(&preq->pp_low),
ipaddr_string(ndo, &preq->pp_page.p_sid),
EXTRACT_32BITS(&preq->pp_page.p_uid)));
return (0);
}
| 74 |
71,547 | 0 | static void ColorTwistMultiply(FPXColorTwistMatrix first,
FPXColorTwistMatrix second,FPXColorTwistMatrix *color_twist)
{
/*
Matrix multiply.
*/
assert(color_twist != (FPXColorTwistMatrix *) NULL);
color_twist->byy=(first.byy*second.byy)+(first.byc1*second.bc1y)+
(first.byc2*second.bc2y)+(first.dummy1_zero*second.dummy4_zero);
color_twist->byc1=(first.byy*second.byc1)+(first.byc1*second.bc1c1)+
(first.byc2*second.bc2c1)+(first.dummy1_zero*second.dummy5_zero);
color_twist->byc2=(first.byy*second.byc2)+(first.byc1*second.bc1c2)+
(first.byc2*second.bc2c2)+(first.dummy1_zero*second.dummy6_zero);
color_twist->dummy1_zero=(first.byy*second.dummy1_zero)+
(first.byc1*second.dummy2_zero)+(first.byc2*second.dummy3_zero)+
(first.dummy1_zero*second.dummy7_one);
color_twist->bc1y=(first.bc1y*second.byy)+(first.bc1c1*second.bc1y)+
(first.bc1c2*second.bc2y)+(first.dummy2_zero*second.dummy4_zero);
color_twist->bc1c1=(first.bc1y*second.byc1)+(first.bc1c1*second.bc1c1)+
(first.bc1c2*second.bc2c1)+(first.dummy2_zero*second.dummy5_zero);
color_twist->bc1c2=(first.bc1y*second.byc2)+(first.bc1c1*second.bc1c2)+
(first.bc1c2*second.bc2c2)+(first.dummy2_zero*second.dummy6_zero);
color_twist->dummy2_zero=(first.bc1y*second.dummy1_zero)+
(first.bc1c1*second.dummy2_zero)+(first.bc1c2*second.dummy3_zero)+
(first.dummy2_zero*second.dummy7_one);
color_twist->bc2y=(first.bc2y*second.byy)+(first.bc2c1*second.bc1y)+
(first.bc2c2*second.bc2y)+(first.dummy3_zero*second.dummy4_zero);
color_twist->bc2c1=(first.bc2y*second.byc1)+(first.bc2c1*second.bc1c1)+
(first.bc2c2*second.bc2c1)+(first.dummy3_zero*second.dummy5_zero);
color_twist->bc2c2=(first.bc2y*second.byc2)+(first.bc2c1*second.bc1c2)+
(first.bc2c2*second.bc2c2)+(first.dummy3_zero*second.dummy6_zero);
color_twist->dummy3_zero=(first.bc2y*second.dummy1_zero)+
(first.bc2c1*second.dummy2_zero)+(first.bc2c2*second.dummy3_zero)+
(first.dummy3_zero*second.dummy7_one);
color_twist->dummy4_zero=(first.dummy4_zero*second.byy)+
(first.dummy5_zero*second.bc1y)+(first.dummy6_zero*second.bc2y)+
(first.dummy7_one*second.dummy4_zero);
color_twist->dummy5_zero=(first.dummy4_zero*second.byc1)+
(first.dummy5_zero*second.bc1c1)+(first.dummy6_zero*second.bc2c1)+
(first.dummy7_one*second.dummy5_zero);
color_twist->dummy6_zero=(first.dummy4_zero*second.byc2)+
(first.dummy5_zero*second.bc1c2)+(first.dummy6_zero*second.bc2c2)+
(first.dummy7_one*second.dummy6_zero);
color_twist->dummy7_one=(first.dummy4_zero*second.dummy1_zero)+
(first.dummy5_zero*second.dummy2_zero)+
(first.dummy6_zero*second.dummy3_zero)+(first.dummy7_one*second.dummy7_one);
}
| 75 |
159,936 | 0 | void SetTopSites(const MostVisitedURLList& new_top_sites) {
top_sites()->SetTopSites(new_top_sites,
TopSitesImpl::CALL_LOCATION_FROM_OTHER_PLACES);
}
| 76 |
135,596 | 0 | String Editor::SelectionStartCSSPropertyValue(CSSPropertyID property_id) {
EditingStyle* selection_style =
EditingStyleUtilities::CreateStyleAtSelectionStart(
GetFrame().Selection().ComputeVisibleSelectionInDOMTreeDeprecated(),
property_id == CSSPropertyBackgroundColor);
if (!selection_style || !selection_style->Style())
return String();
if (property_id == CSSPropertyFontSize)
return String::Number(
selection_style->LegacyFontSize(GetFrame().GetDocument()));
return selection_style->Style()->GetPropertyValue(property_id);
}
| 77 |
126,303 | 0 | Profile* BrowserCommandController::profile() {
return browser_->profile();
}
| 78 |
45,165 | 0 | int dtls1_dispatch_alert(SSL *s)
{
int i,j;
void (*cb)(const SSL *ssl,int type,int val)=NULL;
unsigned char buf[DTLS1_AL_HEADER_LENGTH];
unsigned char *ptr = &buf[0];
s->s3->alert_dispatch=0;
memset(buf, 0x00, sizeof(buf));
*ptr++ = s->s3->send_alert[0];
*ptr++ = s->s3->send_alert[1];
#ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE
if (s->s3->send_alert[1] == DTLS1_AD_MISSING_HANDSHAKE_MESSAGE)
{
s2n(s->d1->handshake_read_seq, ptr);
#if 0
if ( s->d1->r_msg_hdr.frag_off == 0) /* waiting for a new msg */
else
s2n(s->d1->r_msg_hdr.seq, ptr); /* partial msg read */
#endif
#if 0
fprintf(stderr, "s->d1->handshake_read_seq = %d, s->d1->r_msg_hdr.seq = %d\n",s->d1->handshake_read_seq,s->d1->r_msg_hdr.seq);
#endif
l2n3(s->d1->r_msg_hdr.frag_off, ptr);
}
#endif
i = do_dtls1_write(s, SSL3_RT_ALERT, &buf[0], sizeof(buf), 0);
if (i <= 0)
{
s->s3->alert_dispatch=1;
/* fprintf( stderr, "not done with alert\n" ); */
}
else
{
if (s->s3->send_alert[0] == SSL3_AL_FATAL
#ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE
|| s->s3->send_alert[1] == DTLS1_AD_MISSING_HANDSHAKE_MESSAGE
#endif
)
(void)BIO_flush(s->wbio);
if (s->msg_callback)
s->msg_callback(1, s->version, SSL3_RT_ALERT, s->s3->send_alert,
2, s, s->msg_callback_arg);
if (s->info_callback != NULL)
cb=s->info_callback;
else if (s->ctx->info_callback != NULL)
cb=s->ctx->info_callback;
if (cb != NULL)
{
j=(s->s3->send_alert[0]<<8)|s->s3->send_alert[1];
cb(s,SSL_CB_WRITE_ALERT,j);
}
}
return(i);
}
| 79 |
15,796 | 0 | unsigned long ssl3_output_cert_chain(SSL *s, X509 *x)
{
unsigned char *p;
int i;
unsigned long l=7;
BUF_MEM *buf;
int no_chain;
if ((s->mode & SSL_MODE_NO_AUTO_CHAIN) || s->ctx->extra_certs)
no_chain = 1;
else
no_chain = 0;
/* TLSv1 sends a chain with nothing in it, instead of an alert */
buf=s->init_buf;
if (!BUF_MEM_grow_clean(buf,10))
{
SSLerr(SSL_F_SSL3_OUTPUT_CERT_CHAIN,ERR_R_BUF_LIB);
return(0);
}
if (x != NULL)
{
if (no_chain)
{
if (ssl3_add_cert_to_buf(buf, &l, x))
return(0);
}
else
{
X509_STORE_CTX xs_ctx;
if (!X509_STORE_CTX_init(&xs_ctx,s->ctx->cert_store,x,NULL))
{
SSLerr(SSL_F_SSL3_OUTPUT_CERT_CHAIN,ERR_R_X509_LIB);
return(0);
}
X509_verify_cert(&xs_ctx);
/* Don't leave errors in the queue */
ERR_clear_error();
for (i=0; i < sk_X509_num(xs_ctx.chain); i++)
{
x = sk_X509_value(xs_ctx.chain, i);
if (ssl3_add_cert_to_buf(buf, &l, x))
{
X509_STORE_CTX_cleanup(&xs_ctx);
return 0;
}
}
X509_STORE_CTX_cleanup(&xs_ctx);
}
}
/* Thawte special :-) */
for (i=0; i<sk_X509_num(s->ctx->extra_certs); i++)
{
x=sk_X509_value(s->ctx->extra_certs,i);
if (ssl3_add_cert_to_buf(buf, &l, x))
return(0);
}
l-=7;
p=(unsigned char *)&(buf->data[4]);
l2n3(l,p);
l+=3;
p=(unsigned char *)&(buf->data[0]);
*(p++)=SSL3_MT_CERTIFICATE;
l2n3(l,p);
l+=4;
return(l);
}
| 80 |
72,037 | 0 | static struct kioctx *ioctx_alloc(unsigned nr_events)
{
struct mm_struct *mm = current->mm;
struct kioctx *ctx;
int err = -ENOMEM;
/*
* We keep track of the number of available ringbuffer slots, to prevent
* overflow (reqs_available), and we also use percpu counters for this.
*
* So since up to half the slots might be on other cpu's percpu counters
* and unavailable, double nr_events so userspace sees what they
* expected: additionally, we move req_batch slots to/from percpu
* counters at a time, so make sure that isn't 0:
*/
nr_events = max(nr_events, num_possible_cpus() * 4);
nr_events *= 2;
/* Prevent overflows */
if (nr_events > (0x10000000U / sizeof(struct io_event))) {
pr_debug("ENOMEM: nr_events too high\n");
return ERR_PTR(-EINVAL);
}
if (!nr_events || (unsigned long)nr_events > (aio_max_nr * 2UL))
return ERR_PTR(-EAGAIN);
ctx = kmem_cache_zalloc(kioctx_cachep, GFP_KERNEL);
if (!ctx)
return ERR_PTR(-ENOMEM);
ctx->max_reqs = nr_events;
spin_lock_init(&ctx->ctx_lock);
spin_lock_init(&ctx->completion_lock);
mutex_init(&ctx->ring_lock);
/* Protect against page migration throughout kiotx setup by keeping
* the ring_lock mutex held until setup is complete. */
mutex_lock(&ctx->ring_lock);
init_waitqueue_head(&ctx->wait);
INIT_LIST_HEAD(&ctx->active_reqs);
if (percpu_ref_init(&ctx->users, free_ioctx_users, 0, GFP_KERNEL))
goto err;
if (percpu_ref_init(&ctx->reqs, free_ioctx_reqs, 0, GFP_KERNEL))
goto err;
ctx->cpu = alloc_percpu(struct kioctx_cpu);
if (!ctx->cpu)
goto err;
err = aio_setup_ring(ctx);
if (err < 0)
goto err;
atomic_set(&ctx->reqs_available, ctx->nr_events - 1);
ctx->req_batch = (ctx->nr_events - 1) / (num_possible_cpus() * 4);
if (ctx->req_batch < 1)
ctx->req_batch = 1;
/* limit the number of system wide aios */
spin_lock(&aio_nr_lock);
if (aio_nr + nr_events > (aio_max_nr * 2UL) ||
aio_nr + nr_events < aio_nr) {
spin_unlock(&aio_nr_lock);
err = -EAGAIN;
goto err_ctx;
}
aio_nr += ctx->max_reqs;
spin_unlock(&aio_nr_lock);
percpu_ref_get(&ctx->users); /* io_setup() will drop this ref */
percpu_ref_get(&ctx->reqs); /* free_ioctx_users() will drop this */
err = ioctx_add_table(ctx, mm);
if (err)
goto err_cleanup;
/* Release the ring_lock mutex now that all setup is complete. */
mutex_unlock(&ctx->ring_lock);
pr_debug("allocated ioctx %p[%ld]: mm=%p mask=0x%x\n",
ctx, ctx->user_id, mm, ctx->nr_events);
return ctx;
err_cleanup:
aio_nr_sub(ctx->max_reqs);
err_ctx:
atomic_set(&ctx->dead, 1);
if (ctx->mmap_size)
vm_munmap(ctx->mmap_base, ctx->mmap_size);
aio_free_ring(ctx);
err:
mutex_unlock(&ctx->ring_lock);
free_percpu(ctx->cpu);
percpu_ref_exit(&ctx->reqs);
percpu_ref_exit(&ctx->users);
kmem_cache_free(kioctx_cachep, ctx);
pr_debug("error allocating ioctx %d\n", err);
return ERR_PTR(err);
}
| 81 |
45,159 | 0 | static const char *req_user_field(request_rec *r)
{
return r->user;
}
| 82 |
147,939 | 0 | void V8TestObject::TreatNullAsEmptyStringStringAttributeAttributeSetterCallback(
const v8::FunctionCallbackInfo<v8::Value>& info) {
RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_treatNullAsEmptyStringStringAttribute_Setter");
v8::Local<v8::Value> v8_value = info[0];
test_object_v8_internal::TreatNullAsEmptyStringStringAttributeAttributeSetter(v8_value, info);
}
| 83 |
152,033 | 0 | void RenderFrameHostImpl::OnExitFullscreen() {
delegate_->ExitFullscreenMode(/* will_cause_resize */ true);
render_view_host_->GetWidget()->SynchronizeVisualProperties();
}
| 84 |
13,686 | 0 | void ssl3_clear(SSL *s)
{
unsigned char *rp, *wp;
size_t rlen, wlen;
int init_extra;
#ifdef TLSEXT_TYPE_opaque_prf_input
if (s->s3->client_opaque_prf_input != NULL)
OPENSSL_free(s->s3->client_opaque_prf_input);
s->s3->client_opaque_prf_input = NULL;
if (s->s3->server_opaque_prf_input != NULL)
OPENSSL_free(s->s3->server_opaque_prf_input);
s->s3->server_opaque_prf_input = NULL;
#endif
ssl3_cleanup_key_block(s);
if (s->s3->tmp.ca_names != NULL)
sk_X509_NAME_pop_free(s->s3->tmp.ca_names, X509_NAME_free);
if (s->s3->rrec.comp != NULL) {
OPENSSL_free(s->s3->rrec.comp);
s->s3->rrec.comp = NULL;
}
#ifndef OPENSSL_NO_DH
if (s->s3->tmp.dh != NULL) {
DH_free(s->s3->tmp.dh);
s->s3->tmp.dh = NULL;
}
#endif
#ifndef OPENSSL_NO_ECDH
if (s->s3->tmp.ecdh != NULL) {
EC_KEY_free(s->s3->tmp.ecdh);
s->s3->tmp.ecdh = NULL;
}
#endif
#ifndef OPENSSL_NO_TLSEXT
# ifndef OPENSSL_NO_EC
s->s3->is_probably_safari = 0;
# endif /* !OPENSSL_NO_EC */
#endif /* !OPENSSL_NO_TLSEXT */
rp = s->s3->rbuf.buf;
wp = s->s3->wbuf.buf;
rlen = s->s3->rbuf.len;
wlen = s->s3->wbuf.len;
init_extra = s->s3->init_extra;
if (s->s3->handshake_buffer) {
BIO_free(s->s3->handshake_buffer);
s->s3->handshake_buffer = NULL;
}
if (s->s3->handshake_dgst) {
ssl3_free_digest_list(s);
}
#if !defined(OPENSSL_NO_TLSEXT)
if (s->s3->alpn_selected) {
OPENSSL_free(s->s3->alpn_selected);
s->s3->alpn_selected = NULL;
}
#endif
memset(s->s3, 0, sizeof *s->s3);
s->s3->rbuf.buf = rp;
s->s3->wbuf.buf = wp;
s->s3->rbuf.len = rlen;
s->s3->wbuf.len = wlen;
s->s3->init_extra = init_extra;
ssl_free_wbio_buffer(s);
s->packet_length = 0;
s->s3->renegotiate = 0;
s->s3->total_renegotiations = 0;
s->s3->num_renegotiations = 0;
s->s3->in_read_app_data = 0;
s->version = SSL3_VERSION;
#if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG)
if (s->next_proto_negotiated) {
OPENSSL_free(s->next_proto_negotiated);
s->next_proto_negotiated = NULL;
s->next_proto_negotiated_len = 0;
}
#endif
}
| 85 |
30,596 | 0 | static inline int iucv_below_msglim(struct sock *sk)
{
struct iucv_sock *iucv = iucv_sk(sk);
if (sk->sk_state != IUCV_CONNECTED)
return 1;
if (iucv->transport == AF_IUCV_TRANS_IUCV)
return (skb_queue_len(&iucv->send_skb_q) < iucv->path->msglim);
else
return ((atomic_read(&iucv->msg_sent) < iucv->msglimit_peer) &&
(atomic_read(&iucv->pendings) <= 0));
}
| 86 |
30,653 | 0 | static int irda_open_tsap(struct irda_sock *self, __u8 tsap_sel, char *name)
{
notify_t notify;
if (self->tsap) {
IRDA_DEBUG(0, "%s: busy!\n", __func__);
return -EBUSY;
}
/* Initialize callbacks to be used by the IrDA stack */
irda_notify_init(¬ify);
notify.connect_confirm = irda_connect_confirm;
notify.connect_indication = irda_connect_indication;
notify.disconnect_indication = irda_disconnect_indication;
notify.data_indication = irda_data_indication;
notify.udata_indication = irda_data_indication;
notify.flow_indication = irda_flow_indication;
notify.instance = self;
strncpy(notify.name, name, NOTIFY_MAX_NAME);
self->tsap = irttp_open_tsap(tsap_sel, DEFAULT_INITIAL_CREDIT,
¬ify);
if (self->tsap == NULL) {
IRDA_DEBUG(0, "%s(), Unable to allocate TSAP!\n",
__func__);
return -ENOMEM;
}
/* Remember which TSAP selector we actually got */
self->stsap_sel = self->tsap->stsap_sel;
return 0;
}
| 87 |
105,762 | 0 | void SplitStringAlongWhitespace(const std::string& str,
std::vector<std::string>* result) {
SplitStringAlongWhitespaceT(str, result);
}
| 88 |
89,422 | 0 | static void sig_server_setup_fill_reconn(IRC_SERVER_CONNECT_REC *conn,
IRC_SERVER_SETUP_REC *sserver)
{
if (!IS_IRC_SERVER_CONNECT(conn) ||
!IS_IRC_SERVER_SETUP(sserver))
return;
if (sserver->cmd_queue_speed > 0)
conn->cmd_queue_speed = sserver->cmd_queue_speed;
if (sserver->max_cmds_at_once > 0)
conn->max_cmds_at_once = sserver->max_cmds_at_once;
if (sserver->max_query_chans > 0)
conn->max_query_chans = sserver->max_query_chans;
}
| 89 |
98,687 | 0 | NPError WebPluginDelegatePepper::Device2DFlushContext(
NPP id,
NPDeviceContext2D* context,
NPDeviceFlushContextCallbackPtr callback,
void* user_data) {
if (!context)
return NPERR_INVALID_PARAM;
Graphics2DDeviceContext* ctx = graphic2d_contexts_.Lookup(
reinterpret_cast<intptr_t>(context->reserved));
if (!ctx)
return NPERR_INVALID_PARAM; // TODO(brettw) call callback.
return ctx->Flush(&committed_bitmap_, context, callback, id, user_data);
}
| 90 |
42,350 | 0 | int vfs_unlink(struct inode *dir, struct dentry *dentry, struct inode **delegated_inode)
{
struct inode *target = dentry->d_inode;
int error = may_delete(dir, dentry, 0);
if (error)
return error;
if (!dir->i_op->unlink)
return -EPERM;
mutex_lock(&target->i_mutex);
if (is_local_mountpoint(dentry))
error = -EBUSY;
else {
error = security_inode_unlink(dir, dentry);
if (!error) {
error = try_break_deleg(target, delegated_inode);
if (error)
goto out;
error = dir->i_op->unlink(dir, dentry);
if (!error) {
dont_mount(dentry);
detach_mounts(dentry);
}
}
}
out:
mutex_unlock(&target->i_mutex);
/* We don't d_delete() NFS sillyrenamed files--they still exist. */
if (!error && !(dentry->d_flags & DCACHE_NFSFS_RENAMED)) {
fsnotify_link_count(target);
d_delete(dentry);
}
return error;
}
| 91 |
131,791 | 0 | static void testInterfacePythonAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
TestObjectPythonV8Internal::testInterfacePythonAttributeAttributeSetter(jsValue, info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
| 92 |
123,470 | 0 | ImageBitmapFactories& WorkerGlobalScopeImageBitmapFactories::fromInternal(WorkerGlobalScope& object)
{
WorkerGlobalScopeImageBitmapFactories* supplement = static_cast<WorkerGlobalScopeImageBitmapFactories*>(WillBeHeapSupplement<WorkerGlobalScope>::from(object, ImageBitmapFactories::supplementName()));
if (!supplement) {
supplement = new WorkerGlobalScopeImageBitmapFactories();
WillBeHeapSupplement<WorkerGlobalScope>::provideTo(object, ImageBitmapFactories::supplementName(), adoptPtrWillBeNoop(supplement));
}
return *supplement;
}
| 93 |
99,991 | 0 | void WebPluginImpl::HandleHttpMultipartResponse(
const WebURLResponse& response, WebPluginResourceClient* client) {
std::string multipart_boundary;
if (!MultipartResponseDelegate::ReadMultipartBoundary(
response, &multipart_boundary)) {
NOTREACHED();
return;
}
if (page_delegate_)
page_delegate_->DidStartLoadingForPlugin();
MultiPartResponseClient* multi_part_response_client =
new MultiPartResponseClient(client);
MultipartResponseDelegate* multi_part_response_handler =
new MultipartResponseDelegate(multi_part_response_client, NULL,
response,
multipart_boundary);
multi_part_response_map_[client] = multi_part_response_handler;
}
| 94 |
104,283 | 0 | RTCPeerConnectionHandlerChromium::RTCPeerConnectionHandlerChromium(RTCPeerConnectionHandlerClient* client)
: m_client(client)
{
ASSERT(m_client);
}
| 95 |
147,147 | 0 | static void ActivityLoggingAccessForAllWorldsMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestObject* impl = V8TestObject::ToImpl(info.Holder());
impl->activityLoggingAccessForAllWorldsMethod();
}
| 96 |
141,449 | 0 | static LayoutRect LocalToAbsolute(const LayoutBox& box, LayoutRect rect) {
return LayoutRect(
box.LocalToAbsoluteQuad(FloatQuad(FloatRect(rect)), kUseTransforms)
.BoundingBox());
}
| 97 |
200 | 0 | phar_entry_info *phar_get_link_source(phar_entry_info *entry TSRMLS_DC) /* {{{ */
{
phar_entry_info *link_entry;
char *link;
if (!entry->link) {
return entry;
}
link = phar_get_link_location(entry TSRMLS_CC);
if (SUCCESS == zend_hash_find(&(entry->phar->manifest), entry->link, strlen(entry->link), (void **)&link_entry) ||
SUCCESS == zend_hash_find(&(entry->phar->manifest), link, strlen(link), (void **)&link_entry)) {
if (link != entry->link) {
efree(link);
}
return phar_get_link_source(link_entry TSRMLS_CC);
} else {
if (link != entry->link) {
efree(link);
}
return NULL;
}
}
/* }}} */
| 98 |
183,429 | 1 | xmlXPathNextPrecedingInternal(xmlXPathParserContextPtr ctxt,
xmlNodePtr cur)
{
if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
(ctxt->context->node->type == XML_NAMESPACE_DECL))
return(NULL);
if (cur == NULL) {
cur = ctxt->context->node;
if (cur == NULL)
return (NULL);
ctxt->ancestor = cur->parent;
}
if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE))
cur = cur->prev;
while (cur->prev == NULL) {
cur = cur->parent;
if (cur == NULL)
return (NULL);
if (cur == ctxt->context->doc->children)
return (NULL);
if (cur != ctxt->ancestor)
return (cur);
ctxt->ancestor = cur->parent;
}
cur = cur->prev;
while (cur->last != NULL)
cur = cur->last;
return (cur);
}
| 99 |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
- Downloads last month
- 57