unique_id
int64
13
189k
target
int64
0
1
code
stringlengths
20
241k
__index_level_0__
int64
0
18.9k
128,145
0
void TrayCast::UpdatePrimaryView() { if (HasCastExtension() == false) { if (default_) default_->SetVisible(false); if (tray_) { base::MessageLoopForUI::current()->PostTask( FROM_HERE, base::Bind(&tray::CastTrayView::SetVisible, tray_->AsWeakPtr(), false)); } } else { if (default_) { if (is_casting_) default_->ActivateCastView(); else default_->ActivateSelectView(); } if (tray_) tray_->SetVisible(is_casting_); } }
2,700
126,628
0
int TabStripModel::GetIndexOfWebContents(const WebContents* contents) const { for (size_t i = 0; i < contents_data_.size(); ++i) { if (contents_data_[i]->contents == contents) return i; } return kNoTab; }
2,701
91,862
0
GF_Err dvcC_Size(GF_Box *s) { GF_DOVIConfigurationBox *ptr = (GF_DOVIConfigurationBox *)s; ptr->size += sizeof(GF_DOVIDecoderConfigurationRecord); return GF_OK; }
2,702
122,116
0
void RenderLayerCompositor::assignLayersToBackingsForReflectionLayer(RenderLayer* reflectionLayer, bool& layersChanged) { if (computeCompositedLayerUpdate(reflectionLayer) != NoCompositingStateChange) { layersChanged = true; allocateOrClearCompositedLayerMapping(reflectionLayer); } updateDirectCompositingReasons(reflectionLayer); if (reflectionLayer->hasCompositedLayerMapping()) reflectionLayer->compositedLayerMapping()->updateGraphicsLayerConfiguration(); }
2,703
7,869
0
static int ram_save_complete(QEMUFile *f, void *opaque) { qemu_mutex_lock_ramlist(); migration_bitmap_sync(); ram_control_before_iterate(f, RAM_CONTROL_FINISH); /* try transferring iterative blocks of memory */ /* flush all remaining blocks regardless of rate limiting */ while (true) { int bytes_sent; bytes_sent = ram_find_and_save_block(f, true); /* no more blocks to sent */ if (bytes_sent == 0) { break; } bytes_transferred += bytes_sent; } ram_control_after_iterate(f, RAM_CONTROL_FINISH); migration_end(); qemu_mutex_unlock_ramlist(); qemu_put_be64(f, RAM_SAVE_FLAG_EOS); return 0; }
2,704
156,392
0
Response PageHandler::Enable() { enabled_ = true; if (GetWebContents() && GetWebContents()->ShowingInterstitialPage()) frontend_->InterstitialShown(); return Response::FallThrough(); }
2,705
132,782
0
void PepperVideoRenderer3D::OnDecodeDone(int32_t result) { DCHECK(decode_pending_); decode_pending_ = false; if (result != PP_OK) { LOG(ERROR) << "VideoDecoder::Decode() returned " << result; event_handler_->OnVideoDecodeError(); return; } delete pending_packets_.front(); pending_packets_.pop_front(); DecodeNextPacket(); GetNextPicture(); }
2,706
83,121
0
do_os_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, int swap, uint32_t namesz, uint32_t descsz, size_t noff, size_t doff, int *flags) { if (namesz == 5 && strcmp((char *)&nbuf[noff], "SuSE") == 0 && type == NT_GNU_VERSION && descsz == 2) { *flags |= FLAGS_DID_OS_NOTE; file_printf(ms, ", for SuSE %d.%d", nbuf[doff], nbuf[doff + 1]); return 1; } if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 && type == NT_GNU_VERSION && descsz == 16) { uint32_t desc[4]; memcpy(desc, &nbuf[doff], sizeof(desc)); *flags |= FLAGS_DID_OS_NOTE; if (file_printf(ms, ", for GNU/") == -1) return 1; switch (elf_getu32(swap, desc[0])) { case GNU_OS_LINUX: if (file_printf(ms, "Linux") == -1) return 1; break; case GNU_OS_HURD: if (file_printf(ms, "Hurd") == -1) return 1; break; case GNU_OS_SOLARIS: if (file_printf(ms, "Solaris") == -1) return 1; break; case GNU_OS_KFREEBSD: if (file_printf(ms, "kFreeBSD") == -1) return 1; break; case GNU_OS_KNETBSD: if (file_printf(ms, "kNetBSD") == -1) return 1; break; default: if (file_printf(ms, "<unknown>") == -1) return 1; } if (file_printf(ms, " %d.%d.%d", elf_getu32(swap, desc[1]), elf_getu32(swap, desc[2]), elf_getu32(swap, desc[3])) == -1) return 1; return 1; } if (namesz == 7 && strcmp((char *)&nbuf[noff], "NetBSD") == 0) { if (type == NT_NETBSD_VERSION && descsz == 4) { *flags |= FLAGS_DID_OS_NOTE; do_note_netbsd_version(ms, swap, &nbuf[doff]); return 1; } } if (namesz == 8 && strcmp((char *)&nbuf[noff], "FreeBSD") == 0) { if (type == NT_FREEBSD_VERSION && descsz == 4) { *flags |= FLAGS_DID_OS_NOTE; do_note_freebsd_version(ms, swap, &nbuf[doff]); return 1; } } if (namesz == 8 && strcmp((char *)&nbuf[noff], "OpenBSD") == 0 && type == NT_OPENBSD_VERSION && descsz == 4) { *flags |= FLAGS_DID_OS_NOTE; if (file_printf(ms, ", for OpenBSD") == -1) return 1; /* Content of note is always 0 */ return 1; } if (namesz == 10 && strcmp((char *)&nbuf[noff], "DragonFly") == 0 && type == NT_DRAGONFLY_VERSION && descsz == 4) { uint32_t desc; *flags |= FLAGS_DID_OS_NOTE; if (file_printf(ms, ", for DragonFly") == -1) return 1; memcpy(&desc, &nbuf[doff], sizeof(desc)); desc = elf_getu32(swap, desc); if (file_printf(ms, " %d.%d.%d", desc / 100000, desc / 10000 % 10, desc % 10000) == -1) return 1; return 1; } return 0; }
2,707
162,756
0
void BaseRenderingContext2D::setCurrentTransform( SVGMatrixTearOff* matrix_tear_off) { const AffineTransform& transform = matrix_tear_off->Value(); setTransform(transform.A(), transform.B(), transform.C(), transform.D(), transform.E(), transform.F()); }
2,708
93,866
0
virDomainMigratePrepare2(virConnectPtr dconn, char **cookie, int *cookielen, const char *uri_in, char **uri_out, unsigned long flags, const char *dname, unsigned long bandwidth, const char *dom_xml) { VIR_DEBUG("dconn=%p, cookie=%p, cookielen=%p, uri_in=%s, uri_out=%p," "flags=%lx, dname=%s, bandwidth=%lu, dom_xml=%s", dconn, cookie, cookielen, NULLSTR(uri_in), uri_out, flags, NULLSTR(dname), bandwidth, NULLSTR(dom_xml)); virResetLastError(); virCheckConnectReturn(dconn, -1); virCheckReadOnlyGoto(dconn->flags, error); if (dconn->driver->domainMigratePrepare2) { int ret; ret = dconn->driver->domainMigratePrepare2(dconn, cookie, cookielen, uri_in, uri_out, flags, dname, bandwidth, dom_xml); if (ret < 0) goto error; return ret; } virReportUnsupportedError(); error: virDispatchError(dconn); return -1; }
2,709
98,911
0
PassRefPtr<Element> HTMLConstructionSite::createHTMLElement(AtomicHTMLToken& token) { QualifiedName tagName(nullAtom, token.name(), xhtmlNamespaceURI); RefPtr<Element> element = HTMLElementFactory::createHTMLElement(tagName, m_document, form(), true); element->setAttributeMap(token.takeAtributes(), m_fragmentScriptingPermission); ASSERT(element->isHTMLElement()); return element.release(); }
2,710
168,848
0
bool TabsGetZoomFunction::RunAsync() { std::unique_ptr<tabs::GetZoom::Params> params( tabs::GetZoom::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); int tab_id = params->tab_id ? *params->tab_id : -1; WebContents* web_contents = GetWebContents(tab_id); if (!web_contents) return false; double zoom_level = ZoomController::FromWebContents(web_contents)->GetZoomLevel(); double zoom_factor = content::ZoomLevelToZoomFactor(zoom_level); results_ = tabs::GetZoom::Results::Create(zoom_factor); SendResponse(true); return true; }
2,711
20,308
0
struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn) { return __gfn_to_memslot(kvm_memslots(kvm), gfn); }
2,712
17,315
0
coproc_reap () { #if MULTIPLE_COPROCS cpl_reap (); #else struct coproc *cp; cp = &sh_coproc; /* XXX - will require changes for multiple coprocs */ if (cp && (cp->c_flags & COPROC_DEAD)) coproc_dispose (cp); #endif }
2,713
69,426
0
exit_cifs_idmap(void) { key_revoke(root_cred->thread_keyring); unregister_key_type(&cifs_idmap_key_type); put_cred(root_cred); cifs_dbg(FYI, "Unregistered %s key type\n", cifs_idmap_key_type.name); }
2,714
159,327
0
WebGLRenderingContextBase::WebGLRenderingContextBase( CanvasRenderingContextHost* host, scoped_refptr<WebTaskRunner> task_runner, std::unique_ptr<WebGraphicsContext3DProvider> context_provider, bool using_gpu_compositing, const CanvasContextCreationAttributes& requested_attributes, unsigned version) : CanvasRenderingContext(host, requested_attributes), context_group_(new WebGLContextGroup()), is_hidden_(false), context_lost_mode_(kNotLostContext), auto_recovery_method_(kManual), dispatch_context_lost_event_timer_( task_runner, this, &WebGLRenderingContextBase::DispatchContextLostEvent), restore_allowed_(false), restore_timer_(task_runner, this, &WebGLRenderingContextBase::MaybeRestoreContext), generated_image_cache_(4), synthesized_errors_to_console_(true), num_gl_errors_to_console_allowed_(kMaxGLErrorsAllowedToConsole), one_plus_max_non_default_texture_unit_(0), is_web_gl2_formats_types_added_(false), is_web_gl2_tex_image_source_formats_types_added_(false), is_web_gl2_internal_formats_copy_tex_image_added_(false), is_oes_texture_float_formats_types_added_(false), is_oes_texture_half_float_formats_types_added_(false), is_web_gl_depth_texture_formats_types_added_(false), is_ext_srgb_formats_types_added_(false), is_ext_color_buffer_float_formats_added_(false), version_(version) { DCHECK(context_provider); context_group_->AddContext(this); max_viewport_dims_[0] = max_viewport_dims_[1] = 0; context_provider->ContextGL()->GetIntegerv(GL_MAX_VIEWPORT_DIMS, max_viewport_dims_); scoped_refptr<DrawingBuffer> buffer; buffer = CreateDrawingBuffer(std::move(context_provider), using_gpu_compositing); if (!buffer) { context_lost_mode_ = kSyntheticLostContext; return; } drawing_buffer_ = std::move(buffer); GetDrawingBuffer()->Bind(GL_FRAMEBUFFER); SetupFlags(); #define ADD_VALUES_TO_SET(set, values) \ for (size_t i = 0; i < WTF_ARRAY_LENGTH(values); ++i) { \ set.insert(values[i]); \ } ADD_VALUES_TO_SET(supported_internal_formats_, kSupportedFormatsES2); ADD_VALUES_TO_SET(supported_tex_image_source_internal_formats_, kSupportedFormatsES2); ADD_VALUES_TO_SET(supported_internal_formats_copy_tex_image_, kSupportedFormatsES2); ADD_VALUES_TO_SET(supported_formats_, kSupportedFormatsES2); ADD_VALUES_TO_SET(supported_tex_image_source_formats_, kSupportedFormatsES2); ADD_VALUES_TO_SET(supported_types_, kSupportedTypesES2); ADD_VALUES_TO_SET(supported_tex_image_source_types_, kSupportedTypesES2); }
2,715
75,377
0
static int opand(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, 0x20); } if (!is_al_reg (&op->operands[0])) { return process_group_1 (a, data, op); } } return process_1byte_op (a, data, op, 0x20); }
2,716
7,822
0
TT_Goto_CodeRange( TT_ExecContext exec, FT_Int range, FT_Long IP ) { TT_CodeRange* coderange; FT_ASSERT( range >= 1 && range <= 3 ); coderange = &exec->codeRangeTable[range - 1]; FT_ASSERT( coderange->base != NULL ); /* NOTE: Because the last instruction of a program may be a CALL */ /* which will return to the first byte *after* the code */ /* range, we test for IP <= Size instead of IP < Size. */ /* */ FT_ASSERT( (FT_ULong)IP <= coderange->size ); exec->code = coderange->base; exec->codeSize = coderange->size; exec->IP = IP; exec->curRange = range; return TT_Err_Ok; }
2,717
131,876
0
static void voidMethodByteArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::voidMethodByteArgMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
2,718
148,390
0
WebContentsImpl* WebContentsImpl::GetFocusedWebContents() { return GetOutermostWebContents()->node_.focused_web_contents(); }
2,719
79,365
0
static int mov_write_itunes_hdlr_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s) { avio_wb32(pb, 33); /* size */ ffio_wfourcc(pb, "hdlr"); avio_wb32(pb, 0); avio_wb32(pb, 0); ffio_wfourcc(pb, "mdir"); ffio_wfourcc(pb, "appl"); avio_wb32(pb, 0); avio_wb32(pb, 0); avio_w8(pb, 0); return 33; }
2,720
105,361
0
void AutofillManager::set_metric_logger( const AutofillMetrics* metric_logger) { metric_logger_.reset(metric_logger); }
2,721
1,056
0
void GfxColorSpace::getGrayLine(Guchar *in, unsigned char *out, int length) { int i, j, n; GfxColor color; GfxGray gray; n = getNComps(); for (i = 0; i < length; i++) { for (j = 0; j < n; j++) color.c[j] = in[i * n + j] * 256; getGray (&color, &gray); out[i] = colToByte(gray); } }
2,722
113,987
0
void NotifyRefreshClock() { ash::ClockObserver* observer = tray_->clock_observer(); if (observer) observer->Refresh(); }
2,723
2,487
0
static size_t smbXcli_padding_helper(uint32_t offset, size_t n) { if ((offset & (n-1)) == 0) return 0; return n - (offset & (n-1)); }
2,724
168,445
0
int PlatformFontSkia::GetStyle() const { return style_; }
2,725
18,608
0
SYSCALL_DEFINE2(listen, int, fd, int, backlog) { struct socket *sock; int err, fput_needed; int somaxconn; sock = sockfd_lookup_light(fd, &err, &fput_needed); if (sock) { somaxconn = sock_net(sock->sk)->core.sysctl_somaxconn; if ((unsigned int)backlog > somaxconn) backlog = somaxconn; err = security_socket_listen(sock, backlog); if (!err) err = sock->ops->listen(sock, backlog); fput_light(sock->file, fput_needed); } return err; }
2,726
171,595
0
int strcmp16(const char16_t *s1, const char16_t *s2) { char16_t ch; int d = 0; while ( 1 ) { d = (int)(ch = *s1++) - (int)*s2++; if ( d || !ch ) break; } return d; }
2,727
158,487
0
OverscrollSource overscroll_source() const { return view_->overscroll_controller()->overscroll_source_; }
2,728
46,174
0
static void __put_super(struct super_block *sb) { if (!--sb->s_count) { list_del_init(&sb->s_list); destroy_super(sb); } }
2,729
71,515
0
static const char *GetImageTransferCharacteristic( const DPXTransferCharacteristic characteristic) { const char *transfer; /* Get the element transfer characteristic. */ switch(characteristic) { case TransferCharacteristicUserDefined: { transfer="UserDefined"; break; } case TransferCharacteristicPrintingDensity: { transfer="PrintingDensity"; break; } case TransferCharacteristicLinear: { transfer="Linear"; break; } case TransferCharacteristicLogarithmic: { transfer="Logarithmic"; break; } case TransferCharacteristicUnspecifiedVideo: { transfer="UnspecifiedVideo"; break; } case TransferCharacteristicSMTPE274M: { transfer="SMTPE274M"; break; } case TransferCharacteristicITU_R709: { transfer="ITU-R709"; break; } case TransferCharacteristicITU_R601_625L: { transfer="ITU-R601-625L"; break; } case TransferCharacteristicITU_R601_525L: { transfer="ITU-R601-525L"; break; } case TransferCharacteristicNTSCCompositeVideo: { transfer="NTSCCompositeVideo"; break; } case TransferCharacteristicPALCompositeVideo: { transfer="PALCompositeVideo"; break; } case TransferCharacteristicZDepthLinear: { transfer="ZDepthLinear"; break; } case TransferCharacteristicZDepthHomogeneous: { transfer="ZDepthHomogeneous"; break; } default: transfer="Reserved"; } return(transfer); }
2,730
159,088
0
bool DownloadItemImpl::AllDataSaved() const { return destination_info_.all_data_saved; }
2,731
162,173
0
void MojoAudioOutputIPC::CloseStream() { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); stream_provider_.reset(); stream_.reset(); binding_.Close(); delegate_ = nullptr; weak_factory_.InvalidateWeakPtrs(); }
2,732
77,110
0
OVS_EXCLUDED(ofproto_mutex) { /* This skips the ofmonitor and flow-removed notifications because the * switch is being deleted and any OpenFlow channels have been or soon will * be killed. */ ovs_mutex_lock(&ofproto_mutex); if (rule->state == RULE_INSERTED) { /* Make sure there is no postponed removal of the rule. */ ovs_assert(cls_rule_visible_in_version(&rule->cr, OVS_VERSION_MAX)); if (!classifier_remove(&rule->ofproto->tables[rule->table_id].cls, &rule->cr)) { OVS_NOT_REACHED(); } ofproto_rule_remove__(rule->ofproto, rule); if (ofproto->ofproto_class->rule_delete) { ofproto->ofproto_class->rule_delete(rule); } /* This may not be the last reference to the rule. */ ofproto_rule_unref(rule); } ovs_mutex_unlock(&ofproto_mutex); }
2,733
179,053
1
static void xfrm6_tunnel_spi_fini(void) { kmem_cache_destroy(xfrm6_tunnel_spi_kmem); }
2,734
42,221
0
static long vhost_get_vring_endian(struct vhost_virtqueue *vq, u32 idx, int __user *argp) { return -ENOIOCTLCMD; }
2,735
168,794
0
void RenderWidgetHostImpl::WasResized(bool scroll_focused_node_into_view) { if (resize_ack_pending_ || !process_->HasConnection() || !view_ || !view_->HasSize() || !renderer_initialized_ || auto_resize_enabled_ || !delegate_) { return; } std::unique_ptr<ResizeParams> params(new ResizeParams); if (!GetResizeParams(params.get())) return; params->scroll_focused_node_into_view = scroll_focused_node_into_view; ScreenInfo screen_info = params->screen_info; bool width_changed = !old_resize_params_ || old_resize_params_->new_size.width() != params->new_size.width(); if (Send(new ViewMsg_Resize(routing_id_, *params))) { resize_ack_pending_ = params->needs_resize_ack; next_resize_needs_resize_ack_ = false; old_resize_params_.swap(params); } if (delegate_) delegate_->RenderWidgetWasResized(this, screen_info, width_changed); }
2,736
186,438
1
String InspectorPageAgent::CachedResourceTypeJson( const Resource& cached_resource) { return ResourceTypeJson(CachedResourceType(cached_resource)); }
2,737
87,901
0
int prompt(int flags, pam_handle_t *pamh, int style, char **response, const char *fmt, ...) { int r; if (PAM_SILENT == (flags & PAM_SILENT) && style != PAM_TEXT_INFO && style != PAM_PROMPT_ECHO_OFF) { /* PAM_SILENT does not override the prompting of the user for passwords * etc., it only stops informative messages from being generated. We * use PAM_TEXT_INFO and PAM_PROMPT_ECHO_OFF exclusively for the * password prompt. */ r = PAM_SUCCESS; } else { va_list args; va_start (args, fmt); if (!response) { char *p = NULL; r = pam_vprompt(pamh, style, &p, fmt, args); free(p); } else { r = pam_vprompt(pamh, style, response, fmt, args); } va_end(args); } return r; }
2,738
5,429
0
static void Ins_RDTG( INS_ARG ) { (void)args; CUR.GS.round_state = TT_Round_Down_To_Grid; CUR.func_round = (TRound_Function)Round_Down_To_Grid; }
2,739
62,449
0
parse_wcc_attr(netdissect_options *ndo, const uint32_t *dp) { /* Our caller has already checked this */ ND_PRINT((ndo, " sz %" PRIu64, EXTRACT_64BITS(&dp[0]))); ND_PRINT((ndo, " mtime %u.%06u ctime %u.%06u", EXTRACT_32BITS(&dp[2]), EXTRACT_32BITS(&dp[3]), EXTRACT_32BITS(&dp[4]), EXTRACT_32BITS(&dp[5]))); return (dp + 6); }
2,740
28,674
0
void lbs_debugfs_init(void) { if (!lbs_dir) lbs_dir = debugfs_create_dir("lbs_wireless", NULL); }
2,741
131,102
0
static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); TestObjectV8Internal::typedArrayAttrAttributeSetter(jsValue, info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
2,742
119,366
0
bool OmniboxEditModel::query_in_progress() const { return !autocomplete_controller()->done(); }
2,743
105,896
0
JSObject* throwSyntaxError(ExecState* exec) { return throwError(exec, createSyntaxError(exec, "Syntax error")); }
2,744
105,342
0
void AutofillManager::OnDidFillAutofillFormData() { NotificationService::current()->Notify( NotificationType::AUTOFILL_DID_FILL_FORM_DATA, Source<RenderViewHost>(tab_contents()->render_view_host()), NotificationService::NoDetails()); }
2,745
131,636
0
static void readonlyDOMTimeStampAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); v8SetReturnValue(info, static_cast<double>(imp->readonlyDOMTimeStampAttribute())); }
2,746
166,124
0
void RenderFrameHostImpl::DidCommitProvisionalLoad( std::unique_ptr<FrameHostMsg_DidCommitProvisionalLoad_Params> validated_params, service_manager::mojom::InterfaceProviderRequest interface_provider_request) { if (GetNavigationHandle()) { main_frame_request_ids_ = {validated_params->request_id, GetNavigationHandle()->GetGlobalRequestID()}; if (deferred_main_frame_load_info_) ResourceLoadComplete(std::move(deferred_main_frame_load_info_)); } ScopedActiveURL scoped_active_url( validated_params->url, frame_tree_node()->frame_tree()->root()->current_origin()); ScopedCommitStateResetter commit_state_resetter(this); RenderProcessHost* process = GetProcess(); TRACE_EVENT2("navigation", "RenderFrameHostImpl::DidCommitProvisionalLoad", "url", validated_params->url.possibly_invalid_spec(), "details", CommitAsTracedValue(validated_params.get())); NotifyResourceSchedulerOfNavigation(process->GetID(), *validated_params); if (is_waiting_for_beforeunload_ack_ && unload_ack_is_for_navigation_ && !GetParent()) { base::TimeTicks approx_renderer_start_time = send_before_unload_start_time_; ProcessBeforeUnloadACK(true /* proceed */, true /* treat_as_final_ack */, approx_renderer_start_time, base::TimeTicks::Now()); } if (is_waiting_for_swapout_ack_) return; DCHECK(document_scoped_interface_provider_binding_.is_bound()); if (interface_provider_request.is_pending()) { auto interface_provider_request_of_previous_document = document_scoped_interface_provider_binding_.Unbind(); dropped_interface_request_logger_ = std::make_unique<DroppedInterfaceRequestLogger>( std::move(interface_provider_request_of_previous_document)); BindInterfaceProviderRequest(std::move(interface_provider_request)); } else { if (frame_tree_node_->has_committed_real_load()) { document_scoped_interface_provider_binding_.Close(); bad_message::ReceivedBadMessage( process, bad_message::RFH_INTERFACE_PROVIDER_MISSING); return; } } if (!DidCommitNavigationInternal(validated_params.get(), false /* is_same_document_navigation */)) return; commit_state_resetter.disable(); if (frame_tree_node_->IsMainFrame() && GetView()) { RenderWidgetHostImpl::From(GetView()->GetRenderWidgetHost()) ->DidNavigate(validated_params->content_source_id); } }
2,747
62,781
0
static int MSLHasInternalSubset(void *context) { MSLInfo *msl_info; /* Does this document has an internal subset? */ (void) LogMagickEvent(CoderEvent,GetMagickModule(), " SAX.MSLHasInternalSubset()"); msl_info=(MSLInfo *) context; return(msl_info->document->intSubset != NULL); }
2,748
13,795
0
ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci TSRMLS_DC, int argc, va_list *argv) /* {{{ */ { int i; zval **arg; if (argc < 0) { return FAILURE; } zend_fcall_info_args_clear(fci, !argc); if (argc) { fci->param_count = argc; fci->params = (zval ***) erealloc(fci->params, fci->param_count * sizeof(zval **)); for (i = 0; i < argc; ++i) { arg = va_arg(*argv, zval **); fci->params[i] = arg; } } return SUCCESS; } /* }}} */
2,749
129,341
0
void GLES2DecoderImpl::DoVertexAttrib3fv(GLuint index, const GLfloat* v) { GLfloat t[4] = { v[0], v[1], v[2], 1.0f, }; if (SetVertexAttribValue("glVertexAttrib3fv", index, t)) { glVertexAttrib3fv(index, v); } }
2,750
178,455
1
do_setup_env(Session *s, const char *shell) { struct ssh *ssh = active_state; /* XXX */ char buf[256]; u_int i, envsize; char **env, *laddr; struct passwd *pw = s->pw; #if !defined (HAVE_LOGIN_CAP) && !defined (HAVE_CYGWIN) char *path = NULL; #endif /* Initialize the environment. */ envsize = 100; env = xcalloc(envsize, sizeof(char *)); env[0] = NULL; #ifdef HAVE_CYGWIN /* * The Windows environment contains some setting which are * important for a running system. They must not be dropped. */ { char **p; p = fetch_windows_environment(); copy_environment(p, &env, &envsize); free_windows_environment(p); } #endif #ifdef GSSAPI /* Allow any GSSAPI methods that we've used to alter * the childs environment as they see fit */ ssh_gssapi_do_child(&env, &envsize); #endif if (!options.use_login) { /* Set basic environment. */ for (i = 0; i < s->num_env; i++) child_set_env(&env, &envsize, s->env[i].name, s->env[i].val); child_set_env(&env, &envsize, "USER", pw->pw_name); child_set_env(&env, &envsize, "LOGNAME", pw->pw_name); #ifdef _AIX child_set_env(&env, &envsize, "LOGIN", pw->pw_name); #endif child_set_env(&env, &envsize, "HOME", pw->pw_dir); #ifdef HAVE_LOGIN_CAP if (setusercontext(lc, pw, pw->pw_uid, LOGIN_SETPATH) < 0) child_set_env(&env, &envsize, "PATH", _PATH_STDPATH); else child_set_env(&env, &envsize, "PATH", getenv("PATH")); #else /* HAVE_LOGIN_CAP */ # ifndef HAVE_CYGWIN /* * There's no standard path on Windows. The path contains * important components pointing to the system directories, * needed for loading shared libraries. So the path better * remains intact here. */ # ifdef HAVE_ETC_DEFAULT_LOGIN read_etc_default_login(&env, &envsize, pw->pw_uid); path = child_get_env(env, "PATH"); # endif /* HAVE_ETC_DEFAULT_LOGIN */ if (path == NULL || *path == '\0') { child_set_env(&env, &envsize, "PATH", s->pw->pw_uid == 0 ? SUPERUSER_PATH : _PATH_STDPATH); } # endif /* HAVE_CYGWIN */ #endif /* HAVE_LOGIN_CAP */ snprintf(buf, sizeof buf, "%.200s/%.50s", _PATH_MAILDIR, pw->pw_name); child_set_env(&env, &envsize, "MAIL", buf); /* Normal systems set SHELL by default. */ child_set_env(&env, &envsize, "SHELL", shell); } if (getenv("TZ")) child_set_env(&env, &envsize, "TZ", getenv("TZ")); /* Set custom environment options from RSA authentication. */ if (!options.use_login) { while (custom_environment) { struct envstring *ce = custom_environment; char *str = ce->s; for (i = 0; str[i] != '=' && str[i]; i++) ; if (str[i] == '=') { str[i] = 0; child_set_env(&env, &envsize, str, str + i + 1); } custom_environment = ce->next; free(ce->s); free(ce); } } /* SSH_CLIENT deprecated */ snprintf(buf, sizeof buf, "%.50s %d %d", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), ssh_local_port(ssh)); child_set_env(&env, &envsize, "SSH_CLIENT", buf); laddr = get_local_ipaddr(packet_get_connection_in()); snprintf(buf, sizeof buf, "%.50s %d %.50s %d", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), laddr, ssh_local_port(ssh)); free(laddr); child_set_env(&env, &envsize, "SSH_CONNECTION", buf); if (s->ttyfd != -1) child_set_env(&env, &envsize, "SSH_TTY", s->tty); if (s->term) child_set_env(&env, &envsize, "TERM", s->term); if (s->display) child_set_env(&env, &envsize, "DISPLAY", s->display); if (original_command) child_set_env(&env, &envsize, "SSH_ORIGINAL_COMMAND", original_command); #ifdef _UNICOS if (cray_tmpdir[0] != '\0') child_set_env(&env, &envsize, "TMPDIR", cray_tmpdir); #endif /* _UNICOS */ /* * Since we clear KRB5CCNAME at startup, if it's set now then it * must have been set by a native authentication method (eg AIX or * SIA), so copy it to the child. */ { char *cp; if ((cp = getenv("KRB5CCNAME")) != NULL) child_set_env(&env, &envsize, "KRB5CCNAME", cp); } #ifdef _AIX { char *cp; if ((cp = getenv("AUTHSTATE")) != NULL) child_set_env(&env, &envsize, "AUTHSTATE", cp); read_environment_file(&env, &envsize, "/etc/environment"); } #endif #ifdef KRB5 if (s->authctxt->krb5_ccname) child_set_env(&env, &envsize, "KRB5CCNAME", s->authctxt->krb5_ccname); #endif #ifdef USE_PAM /* * Pull in any environment variables that may have * been set by PAM. */ if (options.use_pam) { char **p; p = fetch_pam_child_environment(); copy_environment(p, &env, &envsize); free_pam_environment(p); p = fetch_pam_environment(); copy_environment(p, &env, &envsize); free_pam_environment(p); } #endif /* USE_PAM */ if (auth_sock_name != NULL) child_set_env(&env, &envsize, SSH_AUTHSOCKET_ENV_NAME, auth_sock_name); /* read $HOME/.ssh/environment. */ if (options.permit_user_env && !options.use_login) { snprintf(buf, sizeof buf, "%.200s/.ssh/environment", strcmp(pw->pw_dir, "/") ? pw->pw_dir : ""); read_environment_file(&env, &envsize, buf); } if (debug_flag) { /* dump the environment */ fprintf(stderr, "Environment:\n"); for (i = 0; env[i]; i++) fprintf(stderr, " %.200s\n", env[i]); } return env; }
2,751
54,531
0
static int mov_read_meta(MOVContext *c, AVIOContext *pb, MOVAtom atom) { while (atom.size > 8) { uint32_t tag = avio_rl32(pb); atom.size -= 4; if (tag == MKTAG('h','d','l','r')) { avio_seek(pb, -8, SEEK_CUR); atom.size += 8; return mov_read_default(c, pb, atom); } } return 0; }
2,752
53,257
0
static int usbdev_notify(struct notifier_block *self, unsigned long action, void *dev) { switch (action) { case USB_DEVICE_ADD: break; case USB_DEVICE_REMOVE: usbdev_remove(dev); break; } return NOTIFY_OK; }
2,753
171,485
0
WORD32 ih264d_get_buf_info(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op) { dec_struct_t * ps_dec; UWORD8 i = 0; // Default for 420P format UWORD16 pic_wd, pic_ht; ivd_ctl_getbufinfo_op_t *ps_ctl_op = (ivd_ctl_getbufinfo_op_t*)pv_api_op; UNUSED(pv_api_ip); ps_ctl_op->u4_error_code = 0; ps_dec = (dec_struct_t *)(dec_hdl->pv_codec_handle); ps_ctl_op->u4_min_num_in_bufs = MIN_IN_BUFS; if(ps_dec->u1_chroma_format == IV_YUV_420P) ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_420; else if(ps_dec->u1_chroma_format == IV_YUV_422ILE) ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_422ILE; else if(ps_dec->u1_chroma_format == IV_RGB_565) ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_RGB565; else if((ps_dec->u1_chroma_format == IV_YUV_420SP_UV) || (ps_dec->u1_chroma_format == IV_YUV_420SP_VU)) ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_420SP; else { return IV_FAIL; } ps_ctl_op->u4_num_disp_bufs = 1; pic_wd = 0; pic_ht = 0; if(ps_dec->i4_header_decoded == 3) { if(0 == ps_dec->u4_share_disp_buf) { pic_wd = ps_dec->u2_disp_width; pic_ht = ps_dec->u2_disp_height; } else { pic_wd = ps_dec->u2_frm_wd_y; pic_ht = ps_dec->u2_frm_ht_y; } } for(i = 0; i < ps_ctl_op->u4_min_num_in_bufs; i++) { ps_ctl_op->u4_min_in_buf_size[i] = MAX(256000, pic_wd * pic_ht * 3 / 2); } if((WORD32)ps_dec->u4_app_disp_width > pic_wd) pic_wd = ps_dec->u4_app_disp_width; if(0 == ps_dec->u4_share_disp_buf) ps_ctl_op->u4_num_disp_bufs = 1; else { if((NULL != ps_dec->ps_cur_sps) && (1 == (ps_dec->ps_cur_sps->u1_is_valid))) { if((ps_dec->ps_cur_sps->u1_vui_parameters_present_flag == 1) && (1 == ps_dec->ps_cur_sps->s_vui.u1_bitstream_restriction_flag)) { ps_ctl_op->u4_num_disp_bufs = ps_dec->ps_cur_sps->s_vui.u4_num_reorder_frames + 1; } else { /*if VUI is not present assume maximum possible refrence frames for the level, * as max reorder frames*/ ps_ctl_op->u4_num_disp_bufs = ih264d_get_dpb_size(ps_dec->ps_cur_sps); } ps_ctl_op->u4_num_disp_bufs += ps_dec->ps_cur_sps->u1_num_ref_frames + 1; } else { ps_ctl_op->u4_num_disp_bufs = 32; } ps_ctl_op->u4_num_disp_bufs = MAX( ps_ctl_op->u4_num_disp_bufs, 6); ps_ctl_op->u4_num_disp_bufs = MIN( ps_ctl_op->u4_num_disp_bufs, 32); } /*!*/ if(ps_dec->u1_chroma_format == IV_YUV_420P) { ps_ctl_op->u4_min_out_buf_size[0] = (pic_wd * pic_ht); ps_ctl_op->u4_min_out_buf_size[1] = (pic_wd * pic_ht) >> 2; ps_ctl_op->u4_min_out_buf_size[2] = (pic_wd * pic_ht) >> 2; } else if(ps_dec->u1_chroma_format == IV_YUV_422ILE) { ps_ctl_op->u4_min_out_buf_size[0] = (pic_wd * pic_ht) * 2; ps_ctl_op->u4_min_out_buf_size[1] = ps_ctl_op->u4_min_out_buf_size[2] = 0; } else if(ps_dec->u1_chroma_format == IV_RGB_565) { ps_ctl_op->u4_min_out_buf_size[0] = (pic_wd * pic_ht) * 2; ps_ctl_op->u4_min_out_buf_size[1] = ps_ctl_op->u4_min_out_buf_size[2] = 0; } else if((ps_dec->u1_chroma_format == IV_YUV_420SP_UV) || (ps_dec->u1_chroma_format == IV_YUV_420SP_VU)) { ps_ctl_op->u4_min_out_buf_size[0] = (pic_wd * pic_ht); ps_ctl_op->u4_min_out_buf_size[1] = (pic_wd * pic_ht) >> 1; ps_ctl_op->u4_min_out_buf_size[2] = 0; } ps_dec->u4_num_disp_bufs_requested = ps_ctl_op->u4_num_disp_bufs; return IV_SUCCESS; }
2,754
85,947
0
static void end_io_acct(struct dm_io *io) { struct mapped_device *md = io->md; struct bio *bio = io->bio; unsigned long duration = jiffies - io->start_time; int pending; int rw = bio_data_dir(bio); generic_end_io_acct(md->queue, rw, &dm_disk(md)->part0, io->start_time); if (unlikely(dm_stats_used(&md->stats))) dm_stats_account_io(&md->stats, bio_data_dir(bio), bio->bi_iter.bi_sector, bio_sectors(bio), true, duration, &io->stats_aux); /* * After this is decremented the bio must not be touched if it is * a flush. */ pending = atomic_dec_return(&md->pending[rw]); atomic_set(&dm_disk(md)->part0.in_flight[rw], pending); pending += atomic_read(&md->pending[rw^0x1]); /* nudge anyone waiting on suspend queue */ if (!pending) wake_up(&md->wait); }
2,755
76,191
0
static bool new_idmap_permitted(const struct file *file, struct user_namespace *ns, int cap_setid, struct uid_gid_map *new_map) { const struct cred *cred = file->f_cred; /* Don't allow mappings that would allow anything that wouldn't * be allowed without the establishment of unprivileged mappings. */ if ((new_map->nr_extents == 1) && (new_map->extent[0].count == 1) && uid_eq(ns->owner, cred->euid)) { u32 id = new_map->extent[0].lower_first; if (cap_setid == CAP_SETUID) { kuid_t uid = make_kuid(ns->parent, id); if (uid_eq(uid, cred->euid)) return true; } else if (cap_setid == CAP_SETGID) { kgid_t gid = make_kgid(ns->parent, id); if (!(ns->flags & USERNS_SETGROUPS_ALLOWED) && gid_eq(gid, cred->egid)) return true; } } /* Allow anyone to set a mapping that doesn't require privilege */ if (!cap_valid(cap_setid)) return true; /* Allow the specified ids if we have the appropriate capability * (CAP_SETUID or CAP_SETGID) over the parent user namespace. * And the opener of the id file also had the approprpiate capability. */ if (ns_capable(ns->parent, cap_setid) && file_ns_capable(file, ns->parent, cap_setid)) return true; return false; }
2,756
19,236
0
int netlink_has_listeners(struct sock *sk, unsigned int group) { int res = 0; struct listeners *listeners; BUG_ON(!netlink_is_kernel(sk)); rcu_read_lock(); listeners = rcu_dereference(nl_table[sk->sk_protocol].listeners); if (group - 1 < nl_table[sk->sk_protocol].groups) res = test_bit(group - 1, listeners->masks); rcu_read_unlock(); return res; }
2,757
154,013
0
void GLES2DecoderImpl::DoGetIntegerv(GLenum pname, GLint* params, GLsizei params_size) { DCHECK(params); GLsizei num_written = 0; if (state_.GetStateAsGLint(pname, params, &num_written) || GetHelper(pname, params, &num_written)) { DCHECK_EQ(num_written, params_size); return; } NOTREACHED() << "Unhandled enum " << pname; }
2,758
54,682
0
static int snd_seq_client_enqueue_event(struct snd_seq_client *client, struct snd_seq_event *event, struct file *file, int blocking, int atomic, int hop) { struct snd_seq_event_cell *cell; int err; /* special queue values - force direct passing */ if (event->queue == SNDRV_SEQ_ADDRESS_SUBSCRIBERS) { event->dest.client = SNDRV_SEQ_ADDRESS_SUBSCRIBERS; event->queue = SNDRV_SEQ_QUEUE_DIRECT; } else #ifdef SUPPORT_BROADCAST if (event->queue == SNDRV_SEQ_ADDRESS_BROADCAST) { event->dest.client = SNDRV_SEQ_ADDRESS_BROADCAST; event->queue = SNDRV_SEQ_QUEUE_DIRECT; } #endif if (event->dest.client == SNDRV_SEQ_ADDRESS_SUBSCRIBERS) { /* check presence of source port */ struct snd_seq_client_port *src_port = snd_seq_port_use_ptr(client, event->source.port); if (src_port == NULL) return -EINVAL; snd_seq_port_unlock(src_port); } /* direct event processing without enqueued */ if (snd_seq_ev_is_direct(event)) { if (event->type == SNDRV_SEQ_EVENT_NOTE) return -EINVAL; /* this event must be enqueued! */ return snd_seq_deliver_event(client, event, atomic, hop); } /* Not direct, normal queuing */ if (snd_seq_queue_is_used(event->queue, client->number) <= 0) return -EINVAL; /* invalid queue */ if (! snd_seq_write_pool_allocated(client)) return -ENXIO; /* queue is not allocated */ /* allocate an event cell */ err = snd_seq_event_dup(client->pool, event, &cell, !blocking || atomic, file); if (err < 0) return err; /* we got a cell. enqueue it. */ if ((err = snd_seq_enqueue_event(cell, atomic, hop)) < 0) { snd_seq_cell_free(cell); return err; } return 0; }
2,759
81,303
0
static void output_printk(struct trace_event_buffer *fbuffer) { struct trace_event_call *event_call; struct trace_event *event; unsigned long flags; struct trace_iterator *iter = tracepoint_print_iter; /* We should never get here if iter is NULL */ if (WARN_ON_ONCE(!iter)) return; event_call = fbuffer->trace_file->event_call; if (!event_call || !event_call->event.funcs || !event_call->event.funcs->trace) return; event = &fbuffer->trace_file->event_call->event; spin_lock_irqsave(&tracepoint_iter_lock, flags); trace_seq_init(&iter->seq); iter->ent = fbuffer->entry; event_call->event.funcs->trace(iter, 0, event); trace_seq_putc(&iter->seq, 0); printk("%s", iter->seq.buffer); spin_unlock_irqrestore(&tracepoint_iter_lock, flags); }
2,760
70,400
0
jas_matrix_t *jas_seq2d_create(int xstart, int ystart, int xend, int yend) { jas_matrix_t *matrix; assert(xstart <= xend && ystart <= yend); if (!(matrix = jas_matrix_create(yend - ystart, xend - xstart))) { return 0; } matrix->xstart_ = xstart; matrix->ystart_ = ystart; matrix->xend_ = xend; matrix->yend_ = yend; return matrix; }
2,761
178,096
1
XGetModifierMapping(register Display *dpy) { xGetModifierMappingReply rep; register xReq *req; unsigned long nbytes; XModifierKeymap *res; LockDisplay(dpy); GetEmptyReq(GetModifierMapping, req); (void) _XReply (dpy, (xReply *)&rep, 0, xFalse); if (rep.length < (INT_MAX >> 2)) { nbytes = (unsigned long)rep.length << 2; res = Xmalloc(sizeof (XModifierKeymap)); if (res) } else res = NULL; if ((! res) || (! res->modifiermap)) { Xfree(res); res = (XModifierKeymap *) NULL; _XEatDataWords(dpy, rep.length); } else { _XReadPad(dpy, (char *) res->modifiermap, (long) nbytes); res->max_keypermod = rep.numKeyPerModifier; } UnlockDisplay(dpy); SyncHandle(); return (res); }
2,762
133,690
0
static ReflectedXSSDisposition combineXSSProtectionHeaderAndCSP(ReflectedXSSDisposition xssProtection, ReflectedXSSDisposition reflectedXSS) { ReflectedXSSDisposition result = std::max(xssProtection, reflectedXSS); if (result == ReflectedXSSInvalid || result == FilterReflectedXSS || result == ReflectedXSSUnset) return FilterReflectedXSS; return result; }
2,763
157,563
0
HeadlessDevToolsClientCallbackTest() : first_result_received_(false) {}
2,764
18,634
0
static inline int __sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t size) { int err = security_socket_sendmsg(sock, msg, size); return err ?: __sock_sendmsg_nosec(iocb, sock, msg, size); }
2,765
112,256
0
void UrlFetcher::Core::Start(const UrlFetcher::DoneCallback& done_callback) { done_callback_ = done_callback; network_task_runner_ = request_context_getter_->GetNetworkTaskRunner(); DCHECK(network_task_runner_); network_task_runner_->PostTask(FROM_HERE, base::Bind( &UrlFetcher::Core::DoStart, this)); }
2,766
40,529
0
static enum nl_mmap_status netlink_get_status(const struct nl_mmap_hdr *hdr) { smp_rmb(); flush_dcache_page(pgvec_to_page(hdr)); return hdr->nm_status; }
2,767
108,900
0
bool RenderViewImpl::IsBackForwardToStaleEntry( const ViewMsg_Navigate_Params& params, bool is_reload) { bool is_back_forward = !is_reload && !params.state.empty(); if (!is_back_forward || history_list_length_ <= 0) return false; DCHECK_EQ(static_cast<int>(history_page_ids_.size()), history_list_length_); if (params.pending_history_list_offset >= history_list_length_) return true; int expected_page_id = history_page_ids_[params.pending_history_list_offset]; if (expected_page_id > 0 && params.page_id != expected_page_id) { if (params.page_id < expected_page_id) return true; history_page_ids_[params.pending_history_list_offset] = params.page_id; } return false; }
2,768
122,659
0
bool Extension::HasContentScriptAtURL(const GURL& url) const { for (UserScriptList::const_iterator it = content_scripts_.begin(); it != content_scripts_.end(); ++it) { if (it->MatchesURL(url)) return true; } return false; }
2,769
51,561
0
static inline void tcp_init_undo(struct tcp_sock *tp) { tp->undo_marker = tp->snd_una; /* Retransmission still in flight may cause DSACKs later. */ tp->undo_retrans = tp->retrans_out ? : -1; }
2,770
157,069
0
void Initialize(const char* url, bool expected, size_t file_size = kFileSize) { InitializeWithCORS(url, expected, UrlData::CORS_UNSPECIFIED, file_size); }
2,771
80,452
0
GF_Err stri_Size(GF_Box *s) { GF_SubTrackInformationBox *ptr = (GF_SubTrackInformationBox *)s; ptr->size += 8 + 4 * ptr->attribute_count; return GF_OK; }
2,772
87,620
0
static unsigned zlib_compress(unsigned char** out, size_t* outsize, const unsigned char* in, size_t insize, const LodePNGCompressSettings* settings) { if (!settings->custom_zlib) return 87; /*no custom zlib function provided */ return settings->custom_zlib(out, outsize, in, insize, settings); }
2,773
82,735
0
INST_HANDLER (lpm) { // LPM ut16 ins = (((ut16) buf[1]) << 8) | ((ut16) buf[0]); __generic_ld_st ( op, "prog", 'z', // index register Y/Z 1, // use RAMP* registers (ins & 0xfe0f) == 0x9005 ? 1 // post incremented : 0, // no increment 0, // not offset 0); // load operation (!st) ESIL_A ("r%d,=,", (ins == 0x95c8) ? 0 // LPM (r0) : ((buf[0] >> 4) & 0xf) // LPM Rd | ((buf[1] & 0x1) << 4)); }
2,774
7,891
0
static void addlocal(JF, js_Ast *ident, int reuse) { const char *name = ident->string; if (J->strict) { if (!strcmp(name, "arguments")) jsC_error(J, ident, "redefining 'arguments' is not allowed in strict mode"); if (!strcmp(name, "eval")) jsC_error(J, ident, "redefining 'eval' is not allowed in strict mode"); } if (reuse || J->strict) { int i; for (i = 0; i < F->varlen; ++i) { if (!strcmp(F->vartab[i], name)) { if (reuse) return; if (J->strict) jsC_error(J, ident, "duplicate formal parameter '%s'", name); } } } if (F->varlen >= F->varcap) { F->varcap = F->varcap ? F->varcap * 2 : 16; F->vartab = js_realloc(J, F->vartab, F->varcap * sizeof *F->vartab); } F->vartab[F->varlen++] = name; }
2,775
63,310
0
ModuleExport void UnregisterPNGImage(void) { (void) UnregisterMagickInfo("MNG"); (void) UnregisterMagickInfo("PNG"); (void) UnregisterMagickInfo("PNG8"); (void) UnregisterMagickInfo("PNG24"); (void) UnregisterMagickInfo("PNG32"); (void) UnregisterMagickInfo("PNG48"); (void) UnregisterMagickInfo("PNG64"); (void) UnregisterMagickInfo("PNG00"); (void) UnregisterMagickInfo("JNG"); #ifdef IMPNG_SETJMP_NOT_THREAD_SAFE if (ping_semaphore != (SemaphoreInfo *) NULL) RelinquishSemaphoreInfo(&ping_semaphore); #endif }
2,776
50,685
0
static void srpt_queue_response(struct se_cmd *cmd) { struct srpt_rdma_ch *ch; struct srpt_send_ioctx *ioctx; enum srpt_command_state state; unsigned long flags; int ret; enum dma_data_direction dir; int resp_len; u8 srp_tm_status; ioctx = container_of(cmd, struct srpt_send_ioctx, cmd); ch = ioctx->ch; BUG_ON(!ch); spin_lock_irqsave(&ioctx->spinlock, flags); state = ioctx->state; switch (state) { case SRPT_STATE_NEW: case SRPT_STATE_DATA_IN: ioctx->state = SRPT_STATE_CMD_RSP_SENT; break; case SRPT_STATE_MGMT: ioctx->state = SRPT_STATE_MGMT_RSP_SENT; break; default: WARN(true, "ch %p; cmd %d: unexpected command state %d\n", ch, ioctx->ioctx.index, ioctx->state); break; } spin_unlock_irqrestore(&ioctx->spinlock, flags); if (unlikely(transport_check_aborted_status(&ioctx->cmd, false) || WARN_ON_ONCE(state == SRPT_STATE_CMD_RSP_SENT))) { atomic_inc(&ch->req_lim_delta); srpt_abort_cmd(ioctx); return; } dir = ioctx->cmd.data_direction; /* For read commands, transfer the data to the initiator. */ if (dir == DMA_FROM_DEVICE && ioctx->cmd.data_length && !ioctx->queue_status_only) { ret = srpt_xfer_data(ch, ioctx); if (ret) { pr_err("xfer_data failed for tag %llu\n", ioctx->cmd.tag); return; } } if (state != SRPT_STATE_MGMT) resp_len = srpt_build_cmd_rsp(ch, ioctx, ioctx->cmd.tag, cmd->scsi_status); else { srp_tm_status = tcm_to_srp_tsk_mgmt_status(cmd->se_tmr_req->response); resp_len = srpt_build_tskmgmt_rsp(ch, ioctx, srp_tm_status, ioctx->cmd.tag); } ret = srpt_post_send(ch, ioctx, resp_len); if (ret) { pr_err("sending cmd response failed for tag %llu\n", ioctx->cmd.tag); srpt_unmap_sg_to_ib_sge(ch, ioctx); srpt_set_cmd_state(ioctx, SRPT_STATE_DONE); target_put_sess_cmd(&ioctx->cmd); } }
2,777
66,761
0
static int dw2102_probe(struct usb_interface *intf, const struct usb_device_id *id) { p1100 = kmemdup(&s6x0_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); if (!p1100) return -ENOMEM; /* copy default structure */ /* fill only different fields */ p1100->firmware = P1100_FIRMWARE; p1100->devices[0] = d1100; p1100->rc.core.rc_query = prof_rc_query; p1100->rc.core.rc_codes = RC_MAP_TBS_NEC; p1100->adapter->fe[0].frontend_attach = stv0288_frontend_attach; s660 = kmemdup(&s6x0_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); if (!s660) { kfree(p1100); return -ENOMEM; } s660->firmware = S660_FIRMWARE; s660->num_device_descs = 3; s660->devices[0] = d660; s660->devices[1] = d480_1; s660->devices[2] = d480_2; s660->adapter->fe[0].frontend_attach = ds3000_frontend_attach; p7500 = kmemdup(&s6x0_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); if (!p7500) { kfree(p1100); kfree(s660); return -ENOMEM; } p7500->firmware = P7500_FIRMWARE; p7500->devices[0] = d7500; p7500->rc.core.rc_query = prof_rc_query; p7500->rc.core.rc_codes = RC_MAP_TBS_NEC; p7500->adapter->fe[0].frontend_attach = prof_7500_frontend_attach; s421 = kmemdup(&su3000_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); if (!s421) { kfree(p1100); kfree(s660); kfree(p7500); return -ENOMEM; } s421->num_device_descs = 2; s421->devices[0] = d421; s421->devices[1] = d632; s421->adapter->fe[0].frontend_attach = m88rs2000_frontend_attach; if (0 == dvb_usb_device_init(intf, &dw2102_properties, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &dw2104_properties, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &dw3101_properties, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &s6x0_properties, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, p1100, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, s660, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, p7500, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, s421, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &su3000_properties, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &t220_properties, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &tt_s2_4600_properties, THIS_MODULE, NULL, adapter_nr)) return 0; return -ENODEV; }
2,778
61,121
0
parse_previous_duplicate_name (const char *name, char **name_base, const char **suffix, int *count) { const char *tag; g_assert (name[0] != '\0'); *suffix = eel_filename_get_extension_offset (name); if (*suffix == NULL || (*suffix)[1] == '\0') { /* no suffix */ *suffix = ""; } tag = strstr (name, COPY_DUPLICATE_TAG); if (tag != NULL) { if (tag > *suffix) { /* handle case "foo. (copy)" */ *suffix = ""; } *name_base = extract_string_until (name, tag); *count = 1; return; } tag = strstr (name, ANOTHER_COPY_DUPLICATE_TAG); if (tag != NULL) { if (tag > *suffix) { /* handle case "foo. (another copy)" */ *suffix = ""; } *name_base = extract_string_until (name, tag); *count = 2; return; } /* Check to see if we got one of st, nd, rd, th. */ tag = strstr (name, X11TH_COPY_DUPLICATE_TAG); if (tag == NULL) { tag = strstr (name, X12TH_COPY_DUPLICATE_TAG); } if (tag == NULL) { tag = strstr (name, X13TH_COPY_DUPLICATE_TAG); } if (tag == NULL) { tag = strstr (name, ST_COPY_DUPLICATE_TAG); } if (tag == NULL) { tag = strstr (name, ND_COPY_DUPLICATE_TAG); } if (tag == NULL) { tag = strstr (name, RD_COPY_DUPLICATE_TAG); } if (tag == NULL) { tag = strstr (name, TH_COPY_DUPLICATE_TAG); } /* If we got one of st, nd, rd, th, fish out the duplicate number. */ if (tag != NULL) { /* localizers: opening parentheses to match the "th copy)" string */ tag = strstr (name, _(" (")); if (tag != NULL) { if (tag > *suffix) { /* handle case "foo. (22nd copy)" */ *suffix = ""; } *name_base = extract_string_until (name, tag); /* localizers: opening parentheses of the "th copy)" string */ if (sscanf (tag, _(" (%'d"), count) == 1) { if (*count < 1 || *count > 1000000) { /* keep the count within a reasonable range */ *count = 0; } return; } *count = 0; return; } } *count = 0; if (**suffix != '\0') { *name_base = extract_string_until (name, *suffix); } else { *name_base = g_strdup (name); } }
2,779
184,255
1
static void addDataToStreamTask(void* context) { OwnPtr<BlobRegistryContext> blobRegistryContext = adoptPtr(static_cast<BlobRegistryContext*>(context)); blobRegistry().addDataToStream(blobRegistryContext->url, blobRegistryContext->streamData); }
2,780
157,130
0
int64_t ResourceMultiBufferDataProvider::byte_pos() const { int64_t ret = pos_; ret += fifo_.size(); ret = ret << url_data_->multibuffer()->block_size_shift(); if (!fifo_.empty()) { ret += fifo_.back()->data_size() - block_size(); } return ret; }
2,781
24,779
0
static ssize_t cpu_slabs_show(struct kmem_cache *s, char *buf) { return show_slab_objects(s, buf, SO_CPU); }
2,782
64,651
0
bm_search_backward(regex_t* reg, const UChar* target, const UChar* target_end, const UChar* text, const UChar* adjust_text, const UChar* text_end, const UChar* text_start) { const UChar *s, *t, *p; s = text_end - (target_end - target); if (text_start < s) s = text_start; else s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, adjust_text, s); while (s >= text) { p = s; t = target; while (t < target_end && *p == *t) { p++; t++; } if (t == target_end) return (UChar* )s; s -= reg->int_map_backward[*s]; s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, adjust_text, s); } return (UChar* )NULL; }
2,783
125,798
0
void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { l->append("<MSG>"); }
2,784
89,798
0
void free_devices(device_t *devices, const unsigned n_devs) { unsigned i; if (!devices) return; for (i = 0; i < n_devs; i++) { free(devices[i].keyHandle); devices[i].keyHandle = NULL; free(devices[i].publicKey); devices[i].publicKey = NULL; } free(devices); devices = NULL; }
2,785
44,681
0
char *lxc_append_paths(const char *first, const char *second) { size_t len = strlen(first) + strlen(second) + 1; const char *pattern = "%s%s"; char *result = NULL; if (second[0] != '/') { len += 1; pattern = "%s/%s"; } result = calloc(1, len); if (!result) return NULL; snprintf(result, len, pattern, first, second); return result; }
2,786
32,665
0
static int tg3_phy_reset_chanpat(struct tg3 *tp) { int chan; for (chan = 0; chan < 4; chan++) { int i; tg3_writephy(tp, MII_TG3_DSP_ADDRESS, (chan * 0x2000) | 0x0200); tg3_writephy(tp, MII_TG3_DSP_CONTROL, 0x0002); for (i = 0; i < 6; i++) tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x000); tg3_writephy(tp, MII_TG3_DSP_CONTROL, 0x0202); if (tg3_wait_macro_done(tp)) return -EBUSY; } return 0; }
2,787
23,273
0
static int decode_attr_maxwrite(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) { __be32 *p; int status = 0; *res = 1024; if (unlikely(bitmap[0] & (FATTR4_WORD0_MAXWRITE - 1U))) return -EIO; if (likely(bitmap[0] & FATTR4_WORD0_MAXWRITE)) { uint64_t maxwrite; p = xdr_inline_decode(xdr, 8); if (unlikely(!p)) goto out_overflow; xdr_decode_hyper(p, &maxwrite); if (maxwrite > 0x7FFFFFFF) maxwrite = 0x7FFFFFFF; *res = (uint32_t)maxwrite; bitmap[0] &= ~FATTR4_WORD0_MAXWRITE; } dprintk("%s: maxwrite=%lu\n", __func__, (unsigned long)*res); return status; out_overflow: print_overflow_msg(__func__, xdr); return -EIO; }
2,788
135,780
0
bool SelectionController::HandleDoubleClick( const MouseEventWithHitTestResults& event) { TRACE_EVENT0("blink", "SelectionController::handleMousePressEventDoubleClick"); if (!Selection().IsAvailable()) return false; if (!mouse_down_allows_multi_click_) return HandleSingleClick(event); if (event.Event().button != WebPointerProperties::Button::kLeft) return false; if (Selection().ComputeVisibleSelectionInDOMTreeDeprecated().IsRange()) { selection_state_ = SelectionState::kExtendedSelection; return true; } if (!SelectClosestWordFromMouseEvent(event)) return true; if (!Selection().IsHandleVisible()) return true; frame_->GetEventHandler().ShowNonLocatedContextMenu(nullptr, kMenuSourceTouch); return true; }
2,789
88,587
0
static const char *get_type(FILE *fp, int obj_id, const xref_t *xref) { int is_stream; char *c, *obj, *endobj; static char buf[32]; long start; start = ftell(fp); if (!(obj = get_object(fp, obj_id, xref, NULL, &is_stream)) || is_stream || !(endobj = strstr(obj, "endobj"))) { free(obj); fseek(fp, start, SEEK_SET); if (is_stream) return "Stream"; else return "Unknown"; } /* Get the Type value (avoiding font names like Type1) */ c = obj; while ((c = strstr(c, "/Type")) && (c < endobj)) if (isdigit(*(c + strlen("/Type")))) { ++c; continue; } else break; if (!c || (c && (c > endobj))) { free(obj); fseek(fp, start, SEEK_SET); return "Unknown"; } /* Skip to first blank/whitespace */ c += strlen("/Type"); while (isspace(*c) || *c == '/') ++c; /* Return the value by storing it in static mem */ memcpy(buf, c, (((c - obj) < sizeof(buf)) ? c - obj : sizeof(buf))); c = buf; while (!(isspace(*c) || *c=='/' || *c=='>')) ++c; *c = '\0'; free(obj); fseek(fp, start, SEEK_SET); return buf; }
2,790
38,566
0
static inline bool __bss_tim_get(u8 *tim, u16 id) { /* * This format has been mandated by the IEEE specifications, * so this line may not be changed to use the test_bit() format. */ return tim[id / 8] & (1 << (id % 8)); }
2,791
7,500
0
iter_set_sequence (DBusMessageDataIter *iter, int sequence) { _dbus_assert (sequence >= 0); iter->sequence_nos[iter->depth] = sequence; }
2,792
71,652
0
static MagickStatusType ReadPSDChannel(Image *image,const PSDInfo *psd_info, const LayerInfo* layer_info,const size_t channel, const PSDCompressionType compression,ExceptionInfo *exception) { MagickOffsetType offset; MagickStatusType status; if (layer_info->channel_info[channel].type < -1) { /* ignore user supplied layer mask */ SeekBlob(image,layer_info->channel_info[channel].size-2,SEEK_CUR); return(MagickTrue); } offset=TellBlob(image); status=MagickTrue; switch(compression) { case Raw: return(ReadPSDChannelRaw(image,psd_info->channels, layer_info->channel_info[channel].type,exception)); case RLE: { MagickOffsetType *offsets; offsets=ReadPSDRLEOffsets(image,psd_info,image->rows); if (offsets == (MagickOffsetType *) NULL) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); status=ReadPSDChannelRLE(image,psd_info, layer_info->channel_info[channel].type,offsets,exception); offsets=(MagickOffsetType *) RelinquishMagickMemory(offsets); } break; case ZipWithPrediction: case ZipWithoutPrediction: #ifdef MAGICKCORE_ZLIB_DELEGATE status=ReadPSDChannelZip(image,layer_info->channels, layer_info->channel_info[channel].type,compression, layer_info->channel_info[channel].size-2,exception); #else SeekBlob(image,offset+layer_info->channel_info[channel].size-2,SEEK_SET); (void) ThrowMagickException(exception,GetMagickModule(), MissingDelegateWarning,"DelegateLibrarySupportNotBuiltIn", "'%s' (ZLIB)",image->filename); #endif break; default: SeekBlob(image,offset+layer_info->channel_info[channel].size-2,SEEK_SET); (void) ThrowMagickException(exception,GetMagickModule(),TypeWarning, "CompressionNotSupported","'%.20g'",(double) compression); break; } if (status == MagickFalse) SeekBlob(image,offset+layer_info->channel_info[channel].size-2,SEEK_SET); return(status); }
2,793
154,182
0
bool GLES2Decoder::GetServiceTextureId(uint32_t client_texture_id, uint32_t* service_texture_id) { return false; }
2,794
125,905
0
MockConnectionVisitor::~MockConnectionVisitor() { }
2,795
105,485
0
static void webkit_web_view_real_cut_clipboard(WebKitWebView* webView) { Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); frame->editor()->command("Cut").execute(); }
2,796
186,476
1
static sk_sp<SkImage> unPremulSkImageToPremul(SkImage* input) { SkImageInfo info = SkImageInfo::Make(input->width(), input->height(), kN32_SkColorType, kPremul_SkAlphaType); RefPtr<Uint8Array> dstPixels = copySkImageData(input, info); if (!dstPixels) return nullptr; return newSkImageFromRaster( info, std::move(dstPixels), static_cast<size_t>(input->width()) * info.bytesPerPixel()); }
2,797
66,560
0
static int read_eprom_word(pegasus_t *pegasus, __u8 index, __u16 *retdata) { int i; __u8 tmp; __le16 retdatai; int ret; set_register(pegasus, EpromCtrl, 0); set_register(pegasus, EpromOffset, index); set_register(pegasus, EpromCtrl, EPROM_READ); for (i = 0; i < REG_TIMEOUT; i++) { ret = get_registers(pegasus, EpromCtrl, 1, &tmp); if (tmp & EPROM_DONE) break; if (ret == -ESHUTDOWN) goto fail; } if (i >= REG_TIMEOUT) goto fail; ret = get_registers(pegasus, EpromData, 2, &retdatai); *retdata = le16_to_cpu(retdatai); return ret; fail: netif_warn(pegasus, drv, pegasus->net, "%s failed\n", __func__); return -ETIMEDOUT; }
2,798
3,902
0
FileStream::FileStream(FILE *fA, Guint startA, GBool limitedA, Guint lengthA, Object *dictA): BaseStream(dictA, lengthA) { f = fA; start = startA; limited = limitedA; length = lengthA; bufPtr = bufEnd = buf; bufPos = start; savePos = 0; saved = gFalse; }
2,799