unique_id
int64 13
189k
| target
int64 0
1
| code
stringlengths 20
241k
| __index_level_0__
int64 0
18.9k
|
---|---|---|---|
69,770 | 0 | node_addrs_changed(node_t *node)
{
node->last_reachable = node->last_reachable6 = 0;
node->country = -1;
}
| 16,400 |
41,396 | 0 | static int kvm_vcpu_ioctl_set_cpuid(struct kvm_vcpu *vcpu,
struct kvm_cpuid *cpuid,
struct kvm_cpuid_entry __user *entries)
{
int r, i;
struct kvm_cpuid_entry *cpuid_entries;
r = -E2BIG;
if (cpuid->nent > KVM_MAX_CPUID_ENTRIES)
goto out;
r = -ENOMEM;
cpuid_entries = vmalloc(sizeof(struct kvm_cpuid_entry) * cpuid->nent);
if (!cpuid_entries)
goto out;
r = -EFAULT;
if (copy_from_user(cpuid_entries, entries,
cpuid->nent * sizeof(struct kvm_cpuid_entry)))
goto out_free;
for (i = 0; i < cpuid->nent; i++) {
vcpu->arch.cpuid_entries[i].function = cpuid_entries[i].function;
vcpu->arch.cpuid_entries[i].eax = cpuid_entries[i].eax;
vcpu->arch.cpuid_entries[i].ebx = cpuid_entries[i].ebx;
vcpu->arch.cpuid_entries[i].ecx = cpuid_entries[i].ecx;
vcpu->arch.cpuid_entries[i].edx = cpuid_entries[i].edx;
vcpu->arch.cpuid_entries[i].index = 0;
vcpu->arch.cpuid_entries[i].flags = 0;
vcpu->arch.cpuid_entries[i].padding[0] = 0;
vcpu->arch.cpuid_entries[i].padding[1] = 0;
vcpu->arch.cpuid_entries[i].padding[2] = 0;
}
vcpu->arch.cpuid_nent = cpuid->nent;
cpuid_fix_nx_cap(vcpu);
r = 0;
kvm_apic_set_version(vcpu);
kvm_x86_ops->cpuid_update(vcpu);
update_cpuid(vcpu);
out_free:
vfree(cpuid_entries);
out:
return r;
}
| 16,401 |
11,479 | 0 | fbStore_b2g3r3 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
{
int i;
CARD8 *pixel = ((CARD8 *) bits) + x;
for (i = 0; i < width; ++i) {
Split(READ(values + i));
WRITE(pixel++, ((b ) & 0xe0) |
((g >> 3) & 0x1c) |
((r >> 6) ));
}
}
| 16,402 |
142,674 | 0 | static NavigationType determineNavigationType(FrameLoadType frameLoadType, bool isFormSubmission, bool haveEvent)
{
bool isReload = frameLoadType == FrameLoadTypeReload || frameLoadType == FrameLoadTypeReloadBypassingCache;
bool isBackForward = isBackForwardLoadType(frameLoadType);
if (isFormSubmission)
return (isReload || isBackForward) ? NavigationTypeFormResubmitted : NavigationTypeFormSubmitted;
if (haveEvent)
return NavigationTypeLinkClicked;
if (isReload)
return NavigationTypeReload;
if (isBackForward)
return NavigationTypeBackForward;
return NavigationTypeOther;
}
| 16,403 |
92,101 | 0 | static void destroy_raw_packet_qp_rq(struct mlx5_ib_dev *dev,
struct mlx5_ib_rq *rq)
{
mlx5_core_destroy_rq_tracked(dev->mdev, &rq->base.mqp);
}
| 16,404 |
29,617 | 0 | static struct dst_entry *ip6_sk_dst_check(struct sock *sk,
struct dst_entry *dst,
const struct flowi6 *fl6)
{
struct ipv6_pinfo *np = inet6_sk(sk);
struct rt6_info *rt;
if (!dst)
goto out;
if (dst->ops->family != AF_INET6) {
dst_release(dst);
return NULL;
}
rt = (struct rt6_info *)dst;
/* Yes, checking route validity in not connected
* case is not very simple. Take into account,
* that we do not support routing by source, TOS,
* and MSG_DONTROUTE --ANK (980726)
*
* 1. ip6_rt_check(): If route was host route,
* check that cached destination is current.
* If it is network route, we still may
* check its validity using saved pointer
* to the last used address: daddr_cache.
* We do not want to save whole address now,
* (because main consumer of this service
* is tcp, which has not this problem),
* so that the last trick works only on connected
* sockets.
* 2. oif also should be the same.
*/
if (ip6_rt_check(&rt->rt6i_dst, &fl6->daddr, np->daddr_cache) ||
#ifdef CONFIG_IPV6_SUBTREES
ip6_rt_check(&rt->rt6i_src, &fl6->saddr, np->saddr_cache) ||
#endif
(fl6->flowi6_oif && fl6->flowi6_oif != dst->dev->ifindex)) {
dst_release(dst);
dst = NULL;
}
out:
return dst;
}
| 16,405 |
8,039 | 0 | static int vnc_refresh_lossy_rect(VncDisplay *vd, int x, int y)
{
VncState *vs;
int sty = y / VNC_STAT_RECT;
int stx = x / VNC_STAT_RECT;
int has_dirty = 0;
y = y / VNC_STAT_RECT * VNC_STAT_RECT;
x = x / VNC_STAT_RECT * VNC_STAT_RECT;
QTAILQ_FOREACH(vs, &vd->clients, next) {
int j;
/* kernel send buffers are full -> refresh later */
if (vs->output.offset) {
continue;
}
if (!vs->lossy_rect[sty][stx]) {
continue;
}
vs->lossy_rect[sty][stx] = 0;
for (j = 0; j < VNC_STAT_RECT; ++j) {
bitmap_set(vs->dirty[y + j],
x / VNC_DIRTY_PIXELS_PER_BIT,
VNC_STAT_RECT / VNC_DIRTY_PIXELS_PER_BIT);
}
has_dirty++;
}
return has_dirty;
}
| 16,406 |
9,613 | 0 | PHPAPI ps_module *_php_find_ps_module(char *name TSRMLS_DC) /* {{{ */
{
ps_module *ret = NULL;
ps_module **mod;
int i;
for (i = 0, mod = ps_modules; i < MAX_MODULES; i++, mod++) {
if (*mod && !strcasecmp(name, (*mod)->s_name)) {
ret = *mod;
break;
}
}
return ret;
}
/* }}} */
| 16,407 |
122,957 | 0 | void RenderWidgetHostImpl::Focus() {
Send(new ViewMsg_SetFocus(routing_id_, true));
}
| 16,408 |
23,298 | 0 | static int decode_destroy_session(struct xdr_stream *xdr, void *dummy)
{
return decode_op_hdr(xdr, OP_DESTROY_SESSION);
}
| 16,409 |
110,507 | 0 | void GLES2DecoderImpl::DoTexParameteriv(
GLenum target, GLenum pname, const GLint* params) {
TextureManager::TextureInfo* info = GetTextureInfoForTarget(target);
if (!info) {
SetGLError(GL_INVALID_VALUE, "glTexParameteriv", "unknown texture");
return;
}
if (!texture_manager()->SetParameter(info, pname, *params)) {
SetGLErrorInvalidEnum("glTexParameteriv", pname, "pname");
return;
}
glTexParameteriv(target, pname, params);
}
| 16,410 |
77,524 | 0 | ofputil_decode_ofpst10_flow_request(struct ofputil_flow_stats_request *fsr,
const struct ofp10_flow_stats_request *ofsr,
bool aggregate)
{
fsr->aggregate = aggregate;
ofputil_match_from_ofp10_match(&ofsr->match, &fsr->match);
fsr->out_port = u16_to_ofp(ntohs(ofsr->out_port));
fsr->out_group = OFPG_ANY;
fsr->table_id = ofsr->table_id;
fsr->cookie = fsr->cookie_mask = htonll(0);
return 0;
}
| 16,411 |
91,277 | 0 | int ipmi_get_version(struct ipmi_user *user,
unsigned char *major,
unsigned char *minor)
{
struct ipmi_device_id id;
int rv, index;
user = acquire_ipmi_user(user, &index);
if (!user)
return -ENODEV;
rv = bmc_get_device_id(user->intf, NULL, &id, NULL, NULL);
if (!rv) {
*major = ipmi_version_major(&id);
*minor = ipmi_version_minor(&id);
}
release_ipmi_user(user, index);
return rv;
}
| 16,412 |
53,550 | 0 | free_Folder(struct _7z_folder *f)
{
unsigned i;
if (f->coders) {
for (i = 0; i< f->numCoders; i++) {
free(f->coders[i].properties);
}
free(f->coders);
}
free(f->bindPairs);
free(f->packedStreams);
free(f->unPackSize);
}
| 16,413 |
10,375 | 0 | user_local_get_user_name (User *user)
{
return user->user_name;
}
| 16,414 |
27,210 | 0 | const char *string_of_NPReason(int reason)
{
const char *str;
switch ((NPReason)reason) {
#define _(VAL) case VAL: str = #VAL; break;
_(NPRES_DONE);
_(NPRES_NETWORK_ERR);
_(NPRES_USER_BREAK);
#undef _
default:
str = "<unknown reason>";
break;
}
return str;
}
| 16,415 |
86,357 | 0 | static inline bool gigantic_page_supported(void) { return false; }
| 16,416 |
88,859 | 0 | MagickExport Image *DeconstructImages(const Image *images,
ExceptionInfo *exception)
{
return(CompareImageLayers(images,CompareAnyLayer,exception));
}
| 16,417 |
91,328 | 0 | do_note_freebsd_version(struct magic_set *ms, int swap, void *v)
{
uint32_t desc;
memcpy(&desc, v, sizeof(desc));
desc = elf_getu32(swap, desc);
if (file_printf(ms, ", for FreeBSD") == -1)
return;
/*
* Contents is __FreeBSD_version, whose relation to OS
* versions is defined by a huge table in the Porter's
* Handbook. This is the general scheme:
*
* Releases:
* Mmp000 (before 4.10)
* Mmi0p0 (before 5.0)
* Mmm0p0
*
* Development branches:
* Mmpxxx (before 4.6)
* Mmp1xx (before 4.10)
* Mmi1xx (before 5.0)
* M000xx (pre-M.0)
* Mmm1xx
*
* M = major version
* m = minor version
* i = minor version increment (491000 -> 4.10)
* p = patchlevel
* x = revision
*
* The first release of FreeBSD to use ELF by default
* was version 3.0.
*/
if (desc == 460002) {
if (file_printf(ms, " 4.6.2") == -1)
return;
} else if (desc < 460100) {
if (file_printf(ms, " %d.%d", desc / 100000,
desc / 10000 % 10) == -1)
return;
if (desc / 1000 % 10 > 0)
if (file_printf(ms, ".%d", desc / 1000 % 10) == -1)
return;
if ((desc % 1000 > 0) || (desc % 100000 == 0))
if (file_printf(ms, " (%d)", desc) == -1)
return;
} else if (desc < 500000) {
if (file_printf(ms, " %d.%d", desc / 100000,
desc / 10000 % 10 + desc / 1000 % 10) == -1)
return;
if (desc / 100 % 10 > 0) {
if (file_printf(ms, " (%d)", desc) == -1)
return;
} else if (desc / 10 % 10 > 0) {
if (file_printf(ms, ".%d", desc / 10 % 10) == -1)
return;
}
} else {
if (file_printf(ms, " %d.%d", desc / 100000,
desc / 1000 % 100) == -1)
return;
if ((desc / 100 % 10 > 0) ||
(desc % 100000 / 100 == 0)) {
if (file_printf(ms, " (%d)", desc) == -1)
return;
} else if (desc / 10 % 10 > 0) {
if (file_printf(ms, ".%d", desc / 10 % 10) == -1)
return;
}
}
}
| 16,418 |
83,844 | 0 | static void mac80211_hwsim_get_et_strings(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
u32 sset, u8 *data)
{
if (sset == ETH_SS_STATS)
memcpy(data, *mac80211_hwsim_gstrings_stats,
sizeof(mac80211_hwsim_gstrings_stats));
}
| 16,419 |
8,768 | 0 | static void init_packet(struct dhcp_packet *packet, char type)
{
uint16_t secs;
/* Fill in: op, htype, hlen, cookie fields; message type option: */
udhcp_init_header(packet, type);
packet->xid = random_xid();
client_config.last_secs = monotonic_sec();
if (client_config.first_secs == 0)
client_config.first_secs = client_config.last_secs;
secs = client_config.last_secs - client_config.first_secs;
packet->secs = htons(secs);
memcpy(packet->chaddr, client_config.client_mac, 6);
if (client_config.clientid)
udhcp_add_binary_option(packet, client_config.clientid);
}
| 16,420 |
47,934 | 0 | static bool rtc_irq_check_coalesced(struct kvm_ioapic *ioapic)
{
if (ioapic->rtc_status.pending_eoi > 0)
return true; /* coalesced */
return false;
}
| 16,421 |
72,015 | 0 | static void TraceSquareLinecap(PrimitiveInfo *primitive_info,
const size_t number_vertices,const double offset)
{
double
distance;
register double
dx,
dy;
register ssize_t
i;
ssize_t
j;
dx=0.0;
dy=0.0;
for (i=1; i < (ssize_t) number_vertices; i++)
{
dx=primitive_info[0].point.x-primitive_info[i].point.x;
dy=primitive_info[0].point.y-primitive_info[i].point.y;
if ((fabs((double) dx) >= DrawEpsilon) ||
(fabs((double) dy) >= DrawEpsilon))
break;
}
if (i == (ssize_t) number_vertices)
i=(ssize_t) number_vertices-1L;
distance=hypot((double) dx,(double) dy);
primitive_info[0].point.x=(double) (primitive_info[i].point.x+
dx*(distance+offset)/distance);
primitive_info[0].point.y=(double) (primitive_info[i].point.y+
dy*(distance+offset)/distance);
for (j=(ssize_t) number_vertices-2; j >= 0; j--)
{
dx=primitive_info[number_vertices-1].point.x-primitive_info[j].point.x;
dy=primitive_info[number_vertices-1].point.y-primitive_info[j].point.y;
if ((fabs((double) dx) >= DrawEpsilon) ||
(fabs((double) dy) >= DrawEpsilon))
break;
}
distance=hypot((double) dx,(double) dy);
primitive_info[number_vertices-1].point.x=(double) (primitive_info[j].point.x+
dx*(distance+offset)/distance);
primitive_info[number_vertices-1].point.y=(double) (primitive_info[j].point.y+
dy*(distance+offset)/distance);
}
| 16,422 |
164,045 | 0 | bool DownloadManagerImpl::IsNextIdInitialized() const {
return is_history_download_id_retrieved_ && in_progress_cache_initialized_;
}
| 16,423 |
71,323 | 0 | static int http_close(git_smart_subtransport *subtransport)
{
http_subtransport *t = (http_subtransport *) subtransport;
git_http_auth_context *context;
size_t i;
clear_parser_state(t);
t->connected = 0;
if (t->io) {
git_stream_close(t->io);
git_stream_free(t->io);
t->io = NULL;
}
if (t->cred) {
t->cred->free(t->cred);
t->cred = NULL;
}
if (t->url_cred) {
t->url_cred->free(t->url_cred);
t->url_cred = NULL;
}
git_vector_foreach(&t->auth_contexts, i, context) {
if (context->free)
context->free(context);
}
git_vector_clear(&t->auth_contexts);
gitno_connection_data_free_ptrs(&t->connection_data);
memset(&t->connection_data, 0x0, sizeof(gitno_connection_data));
return 0;
}
| 16,424 |
172,697 | 0 | void MediaRecorder::doCleanUp()
{
ALOGV("doCleanUp");
mIsAudioSourceSet = false;
mIsVideoSourceSet = false;
mIsAudioEncoderSet = false;
mIsVideoEncoderSet = false;
mIsOutputFileSet = false;
}
| 16,425 |
130,574 | 0 | static void activityLoggedAttr2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
if (contextData && contextData->activityLogger()) {
v8::Handle<v8::Value> loggerArg[] = { jsValue };
contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1, &loggerArg[0], "Setter");
}
TestObjectV8Internal::activityLoggedAttr2AttributeSetterForMainWorld(jsValue, info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
| 16,426 |
126,117 | 0 | void BrowserEventRouter::DispatchEvent(
Profile* profile,
const char* event_name,
scoped_ptr<ListValue> args,
EventRouter::UserGestureState user_gesture) {
if (!profile_->IsSameProfile(profile) ||
!extensions::ExtensionSystem::Get(profile)->event_router())
return;
extensions::ExtensionSystem::Get(profile)->event_router()->
DispatchEventToRenderers(event_name, args.Pass(), profile, GURL(),
user_gesture);
}
| 16,427 |
154,691 | 0 | error::Error GLES2DecoderPassthroughImpl::DoGetInternalformativ(GLenum target,
GLenum format,
GLenum pname,
GLsizei bufSize,
GLsizei* length,
GLint* params) {
api()->glGetInternalformativRobustANGLEFn(target, format, pname, bufSize,
length, params);
return error::kNoError;
}
| 16,428 |
90,256 | 0 | static int smi_start_processing(void *send_info,
struct ipmi_smi *intf)
{
struct smi_info *new_smi = send_info;
int enable = 0;
new_smi->intf = intf;
/* Set up the timer that drives the interface. */
timer_setup(&new_smi->si_timer, smi_timeout, 0);
new_smi->timer_can_start = true;
smi_mod_timer(new_smi, jiffies + SI_TIMEOUT_JIFFIES);
/* Try to claim any interrupts. */
if (new_smi->io.irq_setup) {
new_smi->io.irq_handler_data = new_smi;
new_smi->io.irq_setup(&new_smi->io);
}
/*
* Check if the user forcefully enabled the daemon.
*/
if (new_smi->si_num < num_force_kipmid)
enable = force_kipmid[new_smi->si_num];
/*
* The BT interface is efficient enough to not need a thread,
* and there is no need for a thread if we have interrupts.
*/
else if ((new_smi->io.si_type != SI_BT) && (!new_smi->io.irq))
enable = 1;
if (enable) {
new_smi->thread = kthread_run(ipmi_thread, new_smi,
"kipmi%d", new_smi->si_num);
if (IS_ERR(new_smi->thread)) {
dev_notice(new_smi->io.dev, "Could not start"
" kernel thread due to error %ld, only using"
" timers to drive the interface\n",
PTR_ERR(new_smi->thread));
new_smi->thread = NULL;
}
}
return 0;
}
| 16,429 |
44,242 | 0 | static int check_cert(X509_STORE_CTX *ctx)
{
X509_CRL *crl = NULL, *dcrl = NULL;
X509 *x = NULL;
int ok = 0, cnum = 0;
unsigned int last_reasons = 0;
cnum = ctx->error_depth;
x = sk_X509_value(ctx->chain, cnum);
ctx->current_cert = x;
ctx->current_issuer = NULL;
ctx->current_crl_score = 0;
ctx->current_reasons = 0;
while (ctx->current_reasons != CRLDP_ALL_REASONS) {
last_reasons = ctx->current_reasons;
/* Try to retrieve relevant CRL */
if (ctx->get_crl)
ok = ctx->get_crl(ctx, &crl, x);
else
ok = get_crl_delta(ctx, &crl, &dcrl, x);
/*
* If error looking up CRL, nothing we can do except notify callback
*/
if (!ok) {
ctx->error = X509_V_ERR_UNABLE_TO_GET_CRL;
ok = ctx->verify_cb(0, ctx);
goto err;
}
ctx->current_crl = crl;
ok = ctx->check_crl(ctx, crl);
if (!ok)
goto err;
if (dcrl) {
ok = ctx->check_crl(ctx, dcrl);
if (!ok)
goto err;
ok = ctx->cert_crl(ctx, dcrl, x);
if (!ok)
goto err;
} else
ok = 1;
/* Don't look in full CRL if delta reason is removefromCRL */
if (ok != 2) {
ok = ctx->cert_crl(ctx, crl, x);
if (!ok)
goto err;
}
X509_CRL_free(crl);
X509_CRL_free(dcrl);
crl = NULL;
dcrl = NULL;
/*
* If reasons not updated we wont get anywhere by another iteration,
* so exit loop.
*/
if (last_reasons == ctx->current_reasons) {
ctx->error = X509_V_ERR_UNABLE_TO_GET_CRL;
ok = ctx->verify_cb(0, ctx);
goto err;
}
}
err:
X509_CRL_free(crl);
X509_CRL_free(dcrl);
ctx->current_crl = NULL;
return ok;
}
| 16,430 |
66,638 | 0 | static void gs_update_state(struct gs_can *dev, struct can_frame *cf)
{
struct can_device_stats *can_stats = &dev->can.can_stats;
if (cf->can_id & CAN_ERR_RESTARTED) {
dev->can.state = CAN_STATE_ERROR_ACTIVE;
can_stats->restarts++;
} else if (cf->can_id & CAN_ERR_BUSOFF) {
dev->can.state = CAN_STATE_BUS_OFF;
can_stats->bus_off++;
} else if (cf->can_id & CAN_ERR_CRTL) {
if ((cf->data[1] & CAN_ERR_CRTL_TX_WARNING) ||
(cf->data[1] & CAN_ERR_CRTL_RX_WARNING)) {
dev->can.state = CAN_STATE_ERROR_WARNING;
can_stats->error_warning++;
} else if ((cf->data[1] & CAN_ERR_CRTL_TX_PASSIVE) ||
(cf->data[1] & CAN_ERR_CRTL_RX_PASSIVE)) {
dev->can.state = CAN_STATE_ERROR_PASSIVE;
can_stats->error_passive++;
} else {
dev->can.state = CAN_STATE_ERROR_ACTIVE;
}
}
}
| 16,431 |
110,482 | 0 | GLuint GLES2DecoderImpl::DoGetMaxValueInBufferCHROMIUM(
GLuint buffer_id, GLsizei count, GLenum type, GLuint offset) {
GLuint max_vertex_accessed = 0;
BufferManager::BufferInfo* info = GetBufferInfo(buffer_id);
if (!info) {
SetGLError(GL_INVALID_VALUE,
"GetMaxValueInBufferCHROMIUM", "unknown buffer");
} else {
if (!info->GetMaxValueForRange(offset, count, type, &max_vertex_accessed)) {
SetGLError(
GL_INVALID_OPERATION,
"GetMaxValueInBufferCHROMIUM", "range out of bounds for buffer");
}
}
return max_vertex_accessed;
}
| 16,432 |
37,496 | 0 | static void kvm_send_hwpoison_signal(unsigned long address, struct task_struct *tsk)
{
siginfo_t info;
info.si_signo = SIGBUS;
info.si_errno = 0;
info.si_code = BUS_MCEERR_AR;
info.si_addr = (void __user *)address;
info.si_addr_lsb = PAGE_SHIFT;
send_sig_info(SIGBUS, &info, tsk);
}
| 16,433 |
120,442 | 0 | Vector<Animation*>* Element::activeAnimations() const
{
if (!elementRareData())
return 0;
return elementRareData()->activeAnimations();
}
| 16,434 |
37,760 | 0 | static void init_msrpm_offsets(void)
{
int i;
memset(msrpm_offsets, 0xff, sizeof(msrpm_offsets));
for (i = 0; direct_access_msrs[i].index != MSR_INVALID; i++) {
u32 offset;
offset = svm_msrpm_offset(direct_access_msrs[i].index);
BUG_ON(offset == MSR_INVALID);
add_msr_offset(offset);
}
}
| 16,435 |
154,952 | 0 | LRUCanvasResourceProviderCache::GetCanvasResourceProvider(
const IntSize& size) {
wtf_size_t i;
for (i = 0; i < resource_providers_.size(); ++i) {
CanvasResourceProvider* resource_provider = resource_providers_[i].get();
if (!resource_provider)
break;
if (resource_provider->Size() != size)
continue;
BubbleToFront(i);
return resource_provider;
}
std::unique_ptr<CanvasResourceProvider> temp(CanvasResourceProvider::Create(
size, CanvasResourceProvider::kSoftwareResourceUsage,
nullptr, // context_provider_wrapper
0, // msaa_sample_count,
CanvasColorParams(), // TODO: should this use the canvas's colorspace?
CanvasResourceProvider::kDefaultPresentationMode,
nullptr)); // canvas_resource_dispatcher
if (!temp)
return nullptr;
i = std::min(resource_providers_.size() - 1, i);
resource_providers_[i] = std::move(temp);
CanvasResourceProvider* resource_provider = resource_providers_[i].get();
BubbleToFront(i);
return resource_provider;
}
| 16,436 |
160,832 | 0 | void RenderViewImpl::ShowUnhandledTapUIIfNeeded(
const blink::WebTappedInfo& tappedInfo) {
RenderWidget::ShowUnhandledTapUIIfNeeded(tappedInfo);
}
| 16,437 |
179,611 | 1 | fst_get_iface(struct fst_card_info *card, struct fst_port_info *port,
struct ifreq *ifr)
{
sync_serial_settings sync;
int i;
/* First check what line type is set, we'll default to reporting X.21
* if nothing is set as IF_IFACE_SYNC_SERIAL implies it can't be
* changed
*/
switch (port->hwif) {
case E1:
ifr->ifr_settings.type = IF_IFACE_E1;
break;
case T1:
ifr->ifr_settings.type = IF_IFACE_T1;
break;
case V35:
ifr->ifr_settings.type = IF_IFACE_V35;
break;
case V24:
ifr->ifr_settings.type = IF_IFACE_V24;
break;
case X21D:
ifr->ifr_settings.type = IF_IFACE_X21D;
break;
case X21:
default:
ifr->ifr_settings.type = IF_IFACE_X21;
break;
}
if (ifr->ifr_settings.size == 0) {
return 0; /* only type requested */
}
if (ifr->ifr_settings.size < sizeof (sync)) {
return -ENOMEM;
}
i = port->index;
sync.clock_rate = FST_RDL(card, portConfig[i].lineSpeed);
/* Lucky card and linux use same encoding here */
sync.clock_type = FST_RDB(card, portConfig[i].internalClock) ==
INTCLK ? CLOCK_INT : CLOCK_EXT;
sync.loopback = 0;
if (copy_to_user(ifr->ifr_settings.ifs_ifsu.sync, &sync, sizeof (sync))) {
return -EFAULT;
}
ifr->ifr_settings.size = sizeof (sync);
return 0;
}
| 16,438 |
129,260 | 0 | error::Error GLES2DecoderImpl::DoCompressedTexImage2D(
GLenum target,
GLint level,
GLenum internal_format,
GLsizei width,
GLsizei height,
GLint border,
GLsizei image_size,
const void* data) {
if (!validators_->texture_target.IsValid(target)) {
LOCAL_SET_GL_ERROR_INVALID_ENUM(
"glCompressedTexImage2D", target, "target");
return error::kNoError;
}
if (!validators_->compressed_texture_format.IsValid(
internal_format)) {
LOCAL_SET_GL_ERROR_INVALID_ENUM(
"glCompressedTexImage2D", internal_format, "internal_format");
return error::kNoError;
}
if (!texture_manager()->ValidForTarget(target, level, width, height, 1) ||
border != 0) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE,
"glCompressedTexImage2D", "dimensions out of range");
return error::kNoError;
}
TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget(
&state_, target);
if (!texture_ref) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE,
"glCompressedTexImage2D", "unknown texture target");
return error::kNoError;
}
Texture* texture = texture_ref->texture();
if (texture->IsImmutable()) {
LOCAL_SET_GL_ERROR(
GL_INVALID_OPERATION,
"glCompressedTexImage2D", "texture is immutable");
return error::kNoError;
}
if (!ValidateCompressedTexDimensions(
"glCompressedTexImage2D", level, width, height, internal_format) ||
!ValidateCompressedTexFuncData(
"glCompressedTexImage2D", width, height, internal_format, image_size)) {
return error::kNoError;
}
if (!EnsureGPUMemoryAvailable(image_size)) {
LOCAL_SET_GL_ERROR(
GL_OUT_OF_MEMORY, "glCompressedTexImage2D", "out of memory");
return error::kNoError;
}
if (texture->IsAttachedToFramebuffer()) {
framebuffer_state_.clear_state_dirty = true;
}
scoped_ptr<int8[]> zero;
if (!data) {
zero.reset(new int8[image_size]);
memset(zero.get(), 0, image_size);
data = zero.get();
}
LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("glCompressedTexImage2D");
glCompressedTexImage2D(
target, level, internal_format, width, height, border, image_size, data);
GLenum error = LOCAL_PEEK_GL_ERROR("glCompressedTexImage2D");
if (error == GL_NO_ERROR) {
texture_manager()->SetLevelInfo(
texture_ref, target, level, internal_format,
width, height, 1, border, 0, 0, true);
}
return error::kNoError;
}
| 16,439 |
82,090 | 0 | mrb_gc_free_mt(mrb_state *mrb, struct RClass *c)
{
kh_destroy(mt, mrb, c->mt);
}
| 16,440 |
153,862 | 0 | FeatureInfo::FeatureInfo(
const GpuDriverBugWorkarounds& gpu_driver_bug_workarounds,
const GpuFeatureInfo& gpu_feature_info)
: workarounds_(gpu_driver_bug_workarounds) {
InitializeBasicState(base::CommandLine::InitializedForCurrentProcess()
? base::CommandLine::ForCurrentProcess()
: nullptr);
feature_flags_.chromium_raster_transport =
gpu_feature_info.status_values[GPU_FEATURE_TYPE_OOP_RASTERIZATION] ==
gpu::kGpuFeatureStatusEnabled;
feature_flags_.android_surface_control =
gpu_feature_info
.status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] ==
gpu::kGpuFeatureStatusEnabled;
}
| 16,441 |
168,149 | 0 | void AutofillMetricsTest::RecreateMaskedServerCreditCardWithBankName() {
personal_data_->ClearCreditCards();
CreditCard credit_card(CreditCard::MASKED_SERVER_CARD, "server_id");
test::SetCreditCardInfo(&credit_card, "name", "1111" /* Visa */, "01", "2999",
"");
credit_card.set_guid("10000000-0000-0000-0000-000000000002");
credit_card.SetNetworkForMaskedCard(kVisaCard);
credit_card.set_bank_name("Chase");
personal_data_->AddServerCreditCard(credit_card);
personal_data_->Refresh();
}
| 16,442 |
66,293 | 0 | IW_IMPL(void) iw_snprintf(char *buf, size_t buflen, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
iw_vsnprintf(buf,buflen,fmt,ap);
va_end(ap);
}
| 16,443 |
155,289 | 0 | void BindImageAnnotator(image_annotation::mojom::AnnotatorRequest request,
RenderFrameHost* const frame_host) {
content::BrowserContext::GetConnectorFor(
frame_host->GetProcess()->GetBrowserContext())
->BindInterface(image_annotation::mojom::kServiceName,
std::move(request));
}
| 16,444 |
165,743 | 0 | bool ShouldEnableQuicProxiesForHttpsUrls(
const VariationParameters& quic_trial_params) {
return base::LowerCaseEqualsASCII(
GetVariationParam(quic_trial_params,
"enable_quic_proxies_for_https_urls"),
"true");
}
| 16,445 |
109,574 | 0 | void Document::attachNodeIterator(NodeIterator* ni)
{
m_nodeIterators.add(ni);
}
| 16,446 |
136,500 | 0 | const TransformationMatrix& GeometryMapper::SourceToDestinationProjection(
const TransformPaintPropertyNode* source,
const TransformPaintPropertyNode* destination) {
DCHECK(source && destination);
bool success = false;
const auto& result =
SourceToDestinationProjectionInternal(source, destination, success);
return result;
}
| 16,447 |
3,455 | 0 | network_connect_gnutls_handshake_timer_cb (void *arg_hook_connect,
int remaining_calls)
{
struct t_hook *hook_connect;
/* make C compiler happy */
(void) remaining_calls;
hook_connect = (struct t_hook *)arg_hook_connect;
HOOK_CONNECT(hook_connect, handshake_hook_timer) = NULL;
(void) (HOOK_CONNECT(hook_connect, callback))
(hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR,
GNUTLS_E_EXPIRED,
gnutls_strerror (GNUTLS_E_EXPIRED),
HOOK_CONNECT(hook_connect, handshake_ip_address));
unhook (hook_connect);
return WEECHAT_RC_OK;
}
| 16,448 |
91,638 | 0 | struct attr *bgp_attr_intern(struct attr *attr)
{
struct attr *find;
/* Intern referenced strucutre. */
if (attr->aspath) {
if (!attr->aspath->refcnt)
attr->aspath = aspath_intern(attr->aspath);
else
attr->aspath->refcnt++;
}
if (attr->community) {
if (!attr->community->refcnt)
attr->community = community_intern(attr->community);
else
attr->community->refcnt++;
}
if (attr->ecommunity) {
if (!attr->ecommunity->refcnt)
attr->ecommunity = ecommunity_intern(attr->ecommunity);
else
attr->ecommunity->refcnt++;
}
if (attr->lcommunity) {
if (!attr->lcommunity->refcnt)
attr->lcommunity = lcommunity_intern(attr->lcommunity);
else
attr->lcommunity->refcnt++;
}
if (attr->cluster) {
if (!attr->cluster->refcnt)
attr->cluster = cluster_intern(attr->cluster);
else
attr->cluster->refcnt++;
}
if (attr->transit) {
if (!attr->transit->refcnt)
attr->transit = transit_intern(attr->transit);
else
attr->transit->refcnt++;
}
if (attr->encap_subtlvs) {
if (!attr->encap_subtlvs->refcnt)
attr->encap_subtlvs = encap_intern(attr->encap_subtlvs,
ENCAP_SUBTLV_TYPE);
else
attr->encap_subtlvs->refcnt++;
}
#if ENABLE_BGP_VNC
if (attr->vnc_subtlvs) {
if (!attr->vnc_subtlvs->refcnt)
attr->vnc_subtlvs = encap_intern(attr->vnc_subtlvs,
VNC_SUBTLV_TYPE);
else
attr->vnc_subtlvs->refcnt++;
}
#endif
/* At this point, attr only contains intern'd pointers. that means
* if we find it in attrhash, it has all the same pointers and we
* correctly updated the refcounts on these.
* If we don't find it, we need to allocate a one because in all
* cases this returns a new reference to a hashed attr, but the input
* wasn't on hash. */
find = (struct attr *)hash_get(attrhash, attr, bgp_attr_hash_alloc);
find->refcnt++;
return find;
}
| 16,449 |
94,088 | 0 | int iwl_send_add_sta(struct iwl_priv *priv,
struct iwl_addsta_cmd *sta, u8 flags)
{
int ret = 0;
struct iwl_host_cmd cmd = {
.id = REPLY_ADD_STA,
.flags = flags,
.data = { sta, },
.len = { sizeof(*sta), },
};
u8 sta_id __maybe_unused = sta->sta.sta_id;
IWL_DEBUG_INFO(priv, "Adding sta %u (%pM) %ssynchronously\n",
sta_id, sta->sta.addr, flags & CMD_ASYNC ? "a" : "");
if (!(flags & CMD_ASYNC)) {
cmd.flags |= CMD_WANT_SKB;
might_sleep();
}
ret = iwl_trans_send_cmd(trans(priv), &cmd);
if (ret || (flags & CMD_ASYNC))
return ret;
/*else the command was successfully sent in SYNC mode, need to free
* the reply page */
iwl_free_pages(priv->shrd, cmd.reply_page);
if (cmd.handler_status)
IWL_ERR(priv, "%s - error in the CMD response %d", __func__,
cmd.handler_status);
return cmd.handler_status;
}
| 16,450 |
40,550 | 0 | static int netlink_release(struct socket *sock)
{
struct sock *sk = sock->sk;
struct netlink_sock *nlk;
if (!sk)
return 0;
netlink_remove(sk);
sock_orphan(sk);
nlk = nlk_sk(sk);
/*
* OK. Socket is unlinked, any packets that arrive now
* will be purged.
*/
sock->sk = NULL;
wake_up_interruptible_all(&nlk->wait);
skb_queue_purge(&sk->sk_write_queue);
if (nlk->portid) {
struct netlink_notify n = {
.net = sock_net(sk),
.protocol = sk->sk_protocol,
.portid = nlk->portid,
};
atomic_notifier_call_chain(&netlink_chain,
NETLINK_URELEASE, &n);
}
module_put(nlk->module);
netlink_table_grab();
if (netlink_is_kernel(sk)) {
BUG_ON(nl_table[sk->sk_protocol].registered == 0);
if (--nl_table[sk->sk_protocol].registered == 0) {
struct listeners *old;
old = nl_deref_protected(nl_table[sk->sk_protocol].listeners);
RCU_INIT_POINTER(nl_table[sk->sk_protocol].listeners, NULL);
kfree_rcu(old, rcu);
nl_table[sk->sk_protocol].module = NULL;
nl_table[sk->sk_protocol].bind = NULL;
nl_table[sk->sk_protocol].flags = 0;
nl_table[sk->sk_protocol].registered = 0;
}
} else if (nlk->subscriptions) {
netlink_update_listeners(sk);
}
netlink_table_ungrab();
kfree(nlk->groups);
nlk->groups = NULL;
local_bh_disable();
sock_prot_inuse_add(sock_net(sk), &netlink_proto, -1);
local_bh_enable();
sock_put(sk);
return 0;
}
| 16,451 |
51,422 | 0 | int gdImageColorClosest (gdImagePtr im, int r, int g, int b)
{
return gdImageColorClosestAlpha (im, r, g, b, gdAlphaOpaque);
}
| 16,452 |
49,748 | 0 | static void arcmsr_enable_outbound_ints(struct AdapterControlBlock *acb,
u32 intmask_org)
{
u32 mask;
switch (acb->adapter_type) {
case ACB_ADAPTER_TYPE_A: {
struct MessageUnit_A __iomem *reg = acb->pmuA;
mask = intmask_org & ~(ARCMSR_MU_OUTBOUND_POSTQUEUE_INTMASKENABLE |
ARCMSR_MU_OUTBOUND_DOORBELL_INTMASKENABLE|
ARCMSR_MU_OUTBOUND_MESSAGE0_INTMASKENABLE);
writel(mask, ®->outbound_intmask);
acb->outbound_int_enable = ~(intmask_org & mask) & 0x000000ff;
}
break;
case ACB_ADAPTER_TYPE_B: {
struct MessageUnit_B *reg = acb->pmuB;
mask = intmask_org | (ARCMSR_IOP2DRV_DATA_WRITE_OK |
ARCMSR_IOP2DRV_DATA_READ_OK |
ARCMSR_IOP2DRV_CDB_DONE |
ARCMSR_IOP2DRV_MESSAGE_CMD_DONE);
writel(mask, reg->iop2drv_doorbell_mask);
acb->outbound_int_enable = (intmask_org | mask) & 0x0000000f;
}
break;
case ACB_ADAPTER_TYPE_C: {
struct MessageUnit_C __iomem *reg = acb->pmuC;
mask = ~(ARCMSR_HBCMU_UTILITY_A_ISR_MASK | ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR_MASK|ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR_MASK);
writel(intmask_org & mask, ®->host_int_mask);
acb->outbound_int_enable = ~(intmask_org & mask) & 0x0000000f;
}
break;
case ACB_ADAPTER_TYPE_D: {
struct MessageUnit_D *reg = acb->pmuD;
mask = ARCMSR_ARC1214_ALL_INT_ENABLE;
writel(intmask_org | mask, reg->pcief0_int_enable);
break;
}
}
}
| 16,453 |
103,198 | 0 | void Browser::ShowHistoryTab() {
UserMetrics::RecordAction(UserMetricsAction("ShowHistory"), profile_);
ShowSingletonTab(GURL(chrome::kChromeUIHistoryURL));
}
| 16,454 |
3,464 | 0 | irc_server_add_to_infolist (struct t_infolist *infolist,
struct t_irc_server *server)
{
struct t_infolist_item *ptr_item;
if (!infolist || !server)
return 0;
ptr_item = weechat_infolist_new_item (infolist);
if (!ptr_item)
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "name", server->name))
return 0;
if (!weechat_infolist_new_var_pointer (ptr_item, "buffer", server->buffer))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "buffer_name",
(server->buffer) ?
weechat_buffer_get_string (server->buffer, "name") : ""))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "buffer_short_name",
(server->buffer) ?
weechat_buffer_get_string (server->buffer, "short_name") : ""))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "addresses",
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_ADDRESSES)))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "proxy",
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_PROXY)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "ipv6",
IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_IPV6)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "ssl",
IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_SSL)))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "ssl_cert",
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_SSL_CERT)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "ssl_dhkey_size",
IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_SSL_DHKEY_SIZE)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "ssl_verify",
IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_SSL_VERIFY)))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "password",
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_PASSWORD)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "sasl_mechanism",
IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_SASL_MECHANISM)))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "sasl_username",
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_SASL_USERNAME)))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "sasl_password",
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_SASL_PASSWORD)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "autoconnect",
IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_AUTOCONNECT)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "autoreconnect",
IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_AUTORECONNECT)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "autoreconnect_delay",
IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_AUTORECONNECT_DELAY)))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "nicks",
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_NICKS)))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "username",
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_USERNAME)))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "realname",
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_REALNAME)))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "local_hostname",
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_LOCAL_HOSTNAME)))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "command",
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_COMMAND)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "command_delay",
IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_COMMAND_DELAY)))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "autojoin",
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_AUTOJOIN)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "autorejoin",
IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_AUTOREJOIN)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "autorejoin_delay",
IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_AUTOREJOIN_DELAY)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "connection_timeout",
IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_CONNECTION_TIMEOUT)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "anti_flood_prio_high",
IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_ANTI_FLOOD_PRIO_HIGH)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "anti_flood_prio_low",
IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_ANTI_FLOOD_PRIO_LOW)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "away_check",
IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_AWAY_CHECK)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "away_check_max_nicks",
IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_AWAY_CHECK_MAX_NICKS)))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "default_msg_part",
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_DEFAULT_MSG_PART)))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "default_msg_quit",
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_DEFAULT_MSG_QUIT)))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "temp_server", server->temp_server))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "index_current_address", server->index_current_address))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "current_address", server->current_address))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "current_ip", server->current_ip))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "current_port", server->current_port))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "sock", server->sock))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "is_connected", server->is_connected))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "ssl_connected", server->ssl_connected))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "unterminated_message", server->unterminated_message))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "nick", server->nick))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "nick_modes", server->nick_modes))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "isupport", server->isupport))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "prefix_modes", server->prefix_modes))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "prefix_chars", server->prefix_chars))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "reconnect_delay", server->reconnect_delay))
return 0;
if (!weechat_infolist_new_var_time (ptr_item, "reconnect_start", server->reconnect_start))
return 0;
if (!weechat_infolist_new_var_time (ptr_item, "command_time", server->command_time))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "reconnect_join", server->reconnect_join))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "disable_autojoin", server->disable_autojoin))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "is_away", server->is_away))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "away_message", server->away_message))
return 0;
if (!weechat_infolist_new_var_time (ptr_item, "away_time", server->away_time))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "lag", server->lag))
return 0;
if (!weechat_infolist_new_var_buffer (ptr_item, "lag_check_time", &(server->lag_check_time), sizeof (struct timeval)))
return 0;
if (!weechat_infolist_new_var_time (ptr_item, "lag_next_check", server->lag_next_check))
return 0;
if (!weechat_infolist_new_var_time (ptr_item, "lag_last_refresh", server->lag_last_refresh))
return 0;
if (!weechat_infolist_new_var_time (ptr_item, "last_user_message", server->last_user_message))
return 0;
if (!weechat_infolist_new_var_time (ptr_item, "last_away_check", server->last_away_check))
return 0;
return 1;
}
| 16,455 |
116,887 | 0 | WebKit::WebFileUtilities* TestWebKitPlatformSupport::fileUtilities() {
return &file_utilities_;
}
| 16,456 |
930 | 0 | void CairoOutputDev::updateFlatness(GfxState *state) {
}
| 16,457 |
128,778 | 0 | StringCapturingFunction(ScriptState* scriptState, String* value)
: ScriptFunction(scriptState)
, m_value(value)
{
}
| 16,458 |
149,040 | 0 | static void callCollNeeded(sqlite3 *db, int enc, const char *zName){
assert( !db->xCollNeeded || !db->xCollNeeded16 );
if( db->xCollNeeded ){
char *zExternal = sqlite3DbStrDup(db, zName);
if( !zExternal ) return;
db->xCollNeeded(db->pCollNeededArg, db, enc, zExternal);
sqlite3DbFree(db, zExternal);
}
#ifndef SQLITE_OMIT_UTF16
if( db->xCollNeeded16 ){
char const *zExternal;
sqlite3_value *pTmp = sqlite3ValueNew(db);
sqlite3ValueSetStr(pTmp, -1, zName, SQLITE_UTF8, SQLITE_STATIC);
zExternal = sqlite3ValueText(pTmp, SQLITE_UTF16NATIVE);
if( zExternal ){
db->xCollNeeded16(db->pCollNeededArg, db, (int)ENC(db), zExternal);
}
sqlite3ValueFree(pTmp);
}
#endif
}
| 16,459 |
141,889 | 0 | void AutofillPopupItemView::AddSpacerWithSize(int spacer_width,
bool resize,
views::BoxLayout* layout) {
auto* spacer = new views::View;
spacer->SetPreferredSize(gfx::Size(spacer_width, 1));
AddChildView(spacer);
layout->SetFlexForView(spacer,
/*flex=*/resize ? 1 : 0,
/*use_min_size=*/true);
}
| 16,460 |
120,659 | 0 | ShadowRoot* Element::shadowRoot() const
{
ElementShadow* elementShadow = shadow();
if (!elementShadow)
return 0;
ShadowRoot* shadowRoot = elementShadow->youngestShadowRoot();
if (shadowRoot->type() == ShadowRoot::AuthorShadowRoot)
return shadowRoot;
return 0;
}
| 16,461 |
39,523 | 0 | fst_issue_cmd(struct fst_port_info *port, unsigned short cmd)
{
struct fst_card_info *card;
unsigned short mbval;
unsigned long flags;
int safety;
card = port->card;
spin_lock_irqsave(&card->card_lock, flags);
mbval = FST_RDW(card, portMailbox[port->index][0]);
safety = 0;
/* Wait for any previous command to complete */
while (mbval > NAK) {
spin_unlock_irqrestore(&card->card_lock, flags);
schedule_timeout_uninterruptible(1);
spin_lock_irqsave(&card->card_lock, flags);
if (++safety > 2000) {
pr_err("Mailbox safety timeout\n");
break;
}
mbval = FST_RDW(card, portMailbox[port->index][0]);
}
if (safety > 0) {
dbg(DBG_CMD, "Mailbox clear after %d jiffies\n", safety);
}
if (mbval == NAK) {
dbg(DBG_CMD, "issue_cmd: previous command was NAK'd\n");
}
FST_WRW(card, portMailbox[port->index][0], cmd);
if (cmd == ABORTTX || cmd == STARTPORT) {
port->txpos = 0;
port->txipos = 0;
port->start = 0;
}
spin_unlock_irqrestore(&card->card_lock, flags);
}
| 16,462 |
153,027 | 0 | int PDFiumEngine::GetNamedDestinationPage(const std::string& destination) {
FPDF_DEST dest = FPDF_GetNamedDestByName(doc_, destination.c_str());
if (!dest) {
base::string16 destination_wide = base::UTF8ToUTF16(destination);
FPDF_WIDESTRING destination_pdf_wide =
reinterpret_cast<FPDF_WIDESTRING>(destination_wide.c_str());
FPDF_BOOKMARK bookmark = FPDFBookmark_Find(doc_, destination_pdf_wide);
if (!bookmark)
return -1;
dest = FPDFBookmark_GetDest(doc_, bookmark);
}
return dest ? FPDFDest_GetPageIndex(doc_, dest) : -1;
}
| 16,463 |
150,308 | 0 | bool HasPasswordField(const WebLocalFrame& frame) {
static base::NoDestructor<WebString> kPassword("password");
const WebElementCollection elements = frame.GetDocument().All();
for (WebElement element = elements.FirstItem(); !element.IsNull();
element = elements.NextItem()) {
if (element.IsFormControlElement()) {
const WebFormControlElement& control =
element.To<WebFormControlElement>();
if (control.FormControlTypeForAutofill() == *kPassword)
return true;
}
}
return false;
}
| 16,464 |
107,336 | 0 | void Browser::RegisterPrefs(PrefService* prefs) {
prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0);
prefs->RegisterIntegerPref(prefs::kExtensionSidebarWidth, -1);
prefs->RegisterIntegerPref(prefs::kMultipleProfilePrefMigration, 0);
#if defined(GOOGLE_CHROME_BUILD)
prefs->RegisterBooleanPref(prefs::kClearPluginLSODataEnabled, true);
#else
prefs->RegisterBooleanPref(prefs::kClearPluginLSODataEnabled, false);
#endif
}
| 16,465 |
72,665 | 0 | ModuleExport size_t RegisterTXTImage(void)
{
MagickInfo
*entry;
entry=AcquireMagickInfo("TXT","SPARSE-COLOR","Sparse Color");
entry->encoder=(EncodeImageHandler *) WriteTXTImage;
entry->flags|=CoderRawSupportFlag;
entry->flags|=CoderEndianSupportFlag;
(void) RegisterMagickInfo(entry);
entry=AcquireMagickInfo("TXT","TEXT","Text");
entry->decoder=(DecodeImageHandler *) ReadTEXTImage;
entry->format_type=ImplicitFormatType;
entry->flags|=CoderRawSupportFlag;
entry->flags|=CoderEndianSupportFlag;
(void) RegisterMagickInfo(entry);
entry=AcquireMagickInfo("TXT","TXT","Text");
entry->decoder=(DecodeImageHandler *) ReadTXTImage;
entry->encoder=(EncodeImageHandler *) WriteTXTImage;
entry->magick=(IsImageFormatHandler *) IsTXT;
(void) RegisterMagickInfo(entry);
return(MagickImageCoderSignature);
}
| 16,466 |
184,521 | 1 | void FireInvalidateAll() {
invalidation::AckHandle ack_handle("fakedata");
EXPECT_CALL(mock_invalidation_client_, Acknowledge(ack_handle));
client_.InvalidateAll(&mock_invalidation_client_, ack_handle);
}
| 16,467 |
38,963 | 0 | path_n_le(PG_FUNCTION_ARGS)
{
PATH *p1 = PG_GETARG_PATH_P(0);
PATH *p2 = PG_GETARG_PATH_P(1);
PG_RETURN_BOOL(p1->npts <= p2->npts);
}
| 16,468 |
176,337 | 0 | static void ReconfigureImpl(Handle<JSObject> object,
Handle<FixedArrayBase> store, uint32_t entry,
Handle<Object> value,
PropertyAttributes attributes) {
UNREACHABLE();
}
| 16,469 |
167,381 | 0 | std::unique_ptr<KeyedService> TestingDomainReliabilityServiceFactoryFunction(
content::BrowserContext* context) {
const void* kKey = TestingDomainReliabilityServiceFactoryUserData::kKey;
TestingDomainReliabilityServiceFactoryUserData* data =
static_cast<TestingDomainReliabilityServiceFactoryUserData*>(
context->GetUserData(kKey));
EXPECT_TRUE(data);
EXPECT_EQ(data->context, context);
EXPECT_FALSE(data->attached);
data->attached = true;
return base::WrapUnique(data->service);
}
| 16,470 |
40,804 | 0 | int createPostgresTimeCompareSimple(const char *timecol, const char *timestring, char *dest, size_t destsize)
{
int timeresolution = msTimeGetResolution(timestring);
char timeStamp[100];
char *interval;
if (timeresolution < 0)
return MS_FALSE;
postgresTimeStampForTimeString(timestring,timeStamp,100);
switch(timeresolution) {
case TIME_RESOLUTION_YEAR:
interval = "year";
break;
case TIME_RESOLUTION_MONTH:
interval = "month";
break;
case TIME_RESOLUTION_DAY:
interval = "day";
break;
case TIME_RESOLUTION_HOUR:
interval = "hour";
break;
case TIME_RESOLUTION_MINUTE:
interval = "minute";
break;
case TIME_RESOLUTION_SECOND:
interval = "second";
break;
default:
return MS_FAILURE;
}
snprintf(dest, destsize,"(%s >= date_trunc('%s',%s) and %s < date_trunc('%s',%s) + interval '1 %s')",
timecol, interval, timeStamp, timecol, interval, timeStamp, interval);
return MS_SUCCESS;
}
| 16,471 |
54,119 | 0 | static void fib_flush(struct net *net)
{
int flushed = 0;
unsigned int h;
for (h = 0; h < FIB_TABLE_HASHSZ; h++) {
struct hlist_head *head = &net->ipv4.fib_table_hash[h];
struct hlist_node *tmp;
struct fib_table *tb;
hlist_for_each_entry_safe(tb, tmp, head, tb_hlist)
flushed += fib_table_flush(tb);
}
if (flushed)
rt_cache_flush(net);
}
| 16,472 |
165,644 | 0 | std::wstring GetChromeChannelName() {
return InstallDetails::Get().channel();
}
| 16,473 |
63,356 | 0 | val_wrap_iov_args(
OM_uint32 *minor_status,
gss_ctx_id_t context_handle,
int conf_req_flag,
gss_qop_t qop_req,
int *conf_state,
gss_iov_buffer_desc *iov,
int iov_count)
{
/* Initialize outputs. */
if (minor_status != NULL)
*minor_status = 0;
/* Validate arguments. */
if (minor_status == NULL)
return (GSS_S_CALL_INACCESSIBLE_WRITE);
if (context_handle == GSS_C_NO_CONTEXT)
return (GSS_S_CALL_INACCESSIBLE_READ | GSS_S_NO_CONTEXT);
if (iov == GSS_C_NO_IOV_BUFFER)
return (GSS_S_CALL_INACCESSIBLE_READ);
return (GSS_S_COMPLETE);
}
| 16,474 |
92,164 | 0 | static int mlx5_wq_overflow(struct mlx5_ib_wq *wq, int nreq, struct ib_cq *ib_cq)
{
struct mlx5_ib_cq *cq;
unsigned cur;
cur = wq->head - wq->tail;
if (likely(cur + nreq < wq->max_post))
return 0;
cq = to_mcq(ib_cq);
spin_lock(&cq->lock);
cur = wq->head - wq->tail;
spin_unlock(&cq->lock);
return cur + nreq >= wq->max_post;
}
| 16,475 |
122,527 | 0 | void InspectorClientImpl::requestPageScaleFactor(float scale, const IntPoint& origin)
{
m_inspectedWebView->setPageScaleFactor(scale);
m_inspectedWebView->setMainFrameScrollOffset(origin);
}
| 16,476 |
64,100 | 0 | static void snd_msndmidi_free(struct snd_rawmidi *rmidi)
{
struct snd_msndmidi *mpu = rmidi->private_data;
kfree(mpu);
}
| 16,477 |
109,257 | 0 | InspectorOverlay::~InspectorOverlay()
{
}
| 16,478 |
51,098 | 0 | static int common_file_perm(int op, struct file *file, u32 mask)
{
struct aa_file_cxt *fcxt = file->f_security;
struct aa_profile *profile, *fprofile = aa_cred_profile(file->f_cred);
int error = 0;
BUG_ON(!fprofile);
if (!file->f_path.mnt ||
!mediated_filesystem(file->f_path.dentry))
return 0;
profile = __aa_current_profile();
/* revalidate access, if task is unconfined, or the cached cred
* doesn't match or if the request is for more permissions than
* was granted.
*
* Note: the test for !unconfined(fprofile) is to handle file
* delegation from unconfined tasks
*/
if (!unconfined(profile) && !unconfined(fprofile) &&
((fprofile != profile) || (mask & ~fcxt->allow)))
error = aa_file_perm(op, profile, file, mask);
return error;
}
| 16,479 |
132,882 | 0 | void SetupPendingTree(scoped_refptr<RasterSource> raster_source) {
SetupPendingTreeInternal(raster_source, gfx::Size(), Region());
}
| 16,480 |
166,186 | 0 | void OnStreamGenerated(int request_id,
MediaStreamRequestResult result,
const std::string& label,
const MediaStreamDevices& audio_devices,
const MediaStreamDevices& video_devices) {
if (result != MEDIA_DEVICE_OK) {
OnStreamGenerationFailed(request_id, result);
return;
}
OnStreamGenerationSuccess(request_id, audio_devices.size(),
video_devices.size());
OnStreamStarted(label);
base::Closure quit_closure = quit_closures_.front();
quit_closures_.pop();
task_runner_->PostTask(FROM_HERE, base::ResetAndReturn(&quit_closure));
label_ = label;
audio_devices_ = audio_devices;
video_devices_ = video_devices;
}
| 16,481 |
133,532 | 0 | content::ColorChooser* ShowColorChooser(content::WebContents* web_contents,
SkColor initial_color) {
#if defined(USE_ASH)
gfx::NativeView native_view = web_contents->GetView()->GetNativeView();
if (GetHostDesktopTypeForNativeView(native_view) == HOST_DESKTOP_TYPE_ASH)
return ColorChooserAura::Open(web_contents, initial_color);
#endif
return ColorChooserWin::Open(web_contents, initial_color);
}
| 16,482 |
129,291 | 0 | void GLES2DecoderImpl::DoGetTexParameteriv(
GLenum target, GLenum pname, GLint* params) {
InitTextureMaxAnisotropyIfNeeded(target, pname);
glGetTexParameteriv(target, pname, params);
}
| 16,483 |
167,965 | 0 | void LocalFrame::RemoveSpellingMarkersUnderWords(const Vector<String>& words) {
GetSpellChecker().RemoveSpellingMarkersUnderWords(words);
}
| 16,484 |
85,615 | 0 | int hns_rcb_set_coalesce_usecs(
struct rcb_common_cb *rcb_common, u32 port_idx, u32 timeout)
{
u32 old_timeout = hns_rcb_get_coalesce_usecs(rcb_common, port_idx);
if (timeout == old_timeout)
return 0;
if (AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver)) {
if (!HNS_DSAF_IS_DEBUG(rcb_common->dsaf_dev)) {
dev_err(rcb_common->dsaf_dev->dev,
"error: not support coalesce_usecs setting!\n");
return -EINVAL;
}
}
if (timeout > HNS_RCB_MAX_COALESCED_USECS || timeout == 0) {
dev_err(rcb_common->dsaf_dev->dev,
"error: coalesce_usecs setting supports 1~1023us\n");
return -EINVAL;
}
hns_rcb_set_port_timeout(rcb_common, port_idx, timeout);
return 0;
}
| 16,485 |
119,256 | 0 | void HTMLFormElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (name == actionAttr)
m_attributes.parseAction(value);
else if (name == targetAttr)
m_attributes.setTarget(value);
else if (name == methodAttr)
m_attributes.updateMethodType(value);
else if (name == enctypeAttr)
m_attributes.updateEncodingType(value);
else if (name == accept_charsetAttr)
m_attributes.setAcceptCharset(value);
else if (name == onautocompleteAttr)
setAttributeEventListener(eventNames().autocompleteEvent, createAttributeEventListener(this, name, value));
else if (name == onautocompleteerrorAttr)
setAttributeEventListener(eventNames().autocompleteerrorEvent, createAttributeEventListener(this, name, value));
else
HTMLElement::parseAttribute(name, value);
}
| 16,486 |
90,614 | 0 | static inline void vma_rb_insert(struct vm_area_struct *vma,
struct rb_root *root)
{
/* All rb_subtree_gap values must be consistent prior to insertion */
validate_mm_rb(root, NULL);
rb_insert_augmented(&vma->vm_rb, root, &vma_gap_callbacks);
}
| 16,487 |
188,557 | 1 | void DecoderTest::RunLoop(CompressedVideoSource *video) {
vpx_codec_dec_cfg_t dec_cfg = {0};
Decoder* const decoder = codec_->CreateDecoder(dec_cfg, 0);
ASSERT_TRUE(decoder != NULL);
// Decode frames.
for (video->Begin(); video->cxdata(); video->Next()) {
PreDecodeFrameHook(*video, decoder);
vpx_codec_err_t res_dec = decoder->DecodeFrame(video->cxdata(),
video->frame_size());
ASSERT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError();
DxDataIterator dec_iter = decoder->GetDxData();
const vpx_image_t *img = NULL;
// Get decompressed data
while ((img = dec_iter.Next()))
DecompressedFrameHook(*img, video->frame_number());
}
delete decoder;
}
| 16,488 |
133,496 | 0 | content::WebContentsViewDelegate* AwMainDelegate::CreateViewDelegate(
content::WebContents* web_contents) {
return AwWebContentsViewDelegate::Create(web_contents);
}
| 16,489 |
170,244 | 0 | static void MakeRequestFailOnIO(const std::string& host) {
net::URLRequestFilter* filter = net::URLRequestFilter::GetInstance();
filter->AddHostnameInterceptor("http", host,
std::unique_ptr<net::URLRequestInterceptor>(
new FailedJobInterceptor()));
filter->AddHostnameInterceptor("https", host,
std::unique_ptr<net::URLRequestInterceptor>(
new FailedJobInterceptor()));
}
| 16,490 |
70,254 | 0 | Luv24toLuv48(LogLuvState* sp, uint8* op, tmsize_t n)
{
uint32* luv = (uint32*) sp->tbuf;
int16* luv3 = (int16*) op;
while (n-- > 0) {
double u, v;
*luv3++ = (int16)((*luv >> 12 & 0xffd) + 13314);
if (uv_decode(&u, &v, *luv&0x3fff) < 0) {
u = U_NEU;
v = V_NEU;
}
*luv3++ = (int16)(u * (1L<<15));
*luv3++ = (int16)(v * (1L<<15));
luv++;
}
}
| 16,491 |
180,609 | 1 | static enum integrity_status evm_verify_hmac(struct dentry *dentry,
const char *xattr_name,
char *xattr_value,
size_t xattr_value_len,
struct integrity_iint_cache *iint)
{
struct evm_ima_xattr_data *xattr_data = NULL;
struct evm_ima_xattr_data calc;
enum integrity_status evm_status = INTEGRITY_PASS;
int rc, xattr_len;
if (iint && iint->evm_status == INTEGRITY_PASS)
return iint->evm_status;
/* if status is not PASS, try to check again - against -ENOMEM */
/* first need to know the sig type */
rc = vfs_getxattr_alloc(dentry, XATTR_NAME_EVM, (char **)&xattr_data, 0,
GFP_NOFS);
if (rc <= 0) {
evm_status = INTEGRITY_FAIL;
if (rc == -ENODATA) {
rc = evm_find_protected_xattrs(dentry);
if (rc > 0)
evm_status = INTEGRITY_NOLABEL;
else if (rc == 0)
evm_status = INTEGRITY_NOXATTRS; /* new file */
} else if (rc == -EOPNOTSUPP) {
evm_status = INTEGRITY_UNKNOWN;
}
goto out;
}
xattr_len = rc;
/* check value type */
switch (xattr_data->type) {
case EVM_XATTR_HMAC:
rc = evm_calc_hmac(dentry, xattr_name, xattr_value,
xattr_value_len, calc.digest);
if (rc)
break;
rc = memcmp(xattr_data->digest, calc.digest,
sizeof(calc.digest));
if (rc)
rc = -EINVAL;
break;
case EVM_IMA_XATTR_DIGSIG:
rc = evm_calc_hash(dentry, xattr_name, xattr_value,
xattr_value_len, calc.digest);
if (rc)
break;
rc = integrity_digsig_verify(INTEGRITY_KEYRING_EVM,
(const char *)xattr_data, xattr_len,
calc.digest, sizeof(calc.digest));
if (!rc) {
/* Replace RSA with HMAC if not mounted readonly and
* not immutable
*/
if (!IS_RDONLY(d_backing_inode(dentry)) &&
!IS_IMMUTABLE(d_backing_inode(dentry)))
evm_update_evmxattr(dentry, xattr_name,
xattr_value,
xattr_value_len);
}
break;
default:
rc = -EINVAL;
break;
}
if (rc)
evm_status = (rc == -ENODATA) ?
INTEGRITY_NOXATTRS : INTEGRITY_FAIL;
out:
if (iint)
iint->evm_status = evm_status;
kfree(xattr_data);
return evm_status;
}
| 16,492 |
1,545 | 0 | zcurrentoutputdevice(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
gx_device *odev = NULL, *dev = gs_currentdevice(igs);
gs_ref_memory_t *mem = (gs_ref_memory_t *) dev->memory;
int code = dev_proc(dev, dev_spec_op)(dev,
gxdso_current_output_device, (void *)&odev, 0);
if (code < 0)
return code;
push(1);
make_tav(op, t_device,
(mem == 0 ? avm_foreign : imemory_space(mem)) | a_all,
pdevice, odev);
return 0;
}
| 16,493 |
119,084 | 0 | void DemangleSymbols(std::string* text) {
#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
std::string::size_type search_from = 0;
while (search_from < text->size()) {
std::string::size_type mangled_start =
text->find(kMangledSymbolPrefix, search_from);
if (mangled_start == std::string::npos) {
break; // Mangled symbol not found.
}
std::string::size_type mangled_end =
text->find_first_not_of(kSymbolCharacters, mangled_start);
if (mangled_end == std::string::npos) {
mangled_end = text->size();
}
std::string mangled_symbol =
text->substr(mangled_start, mangled_end - mangled_start);
int status = 0;
scoped_ptr<char, base::FreeDeleter> demangled_symbol(
abi::__cxa_demangle(mangled_symbol.c_str(), NULL, 0, &status));
if (status == 0) { // Demangling is successful.
text->erase(mangled_start, mangled_end - mangled_start);
text->insert(mangled_start, demangled_symbol.get());
search_from = mangled_start + strlen(demangled_symbol.get());
} else {
search_from = mangled_start + 2;
}
}
#endif // defined(__GLIBCXX__) && !defined(__UCLIBC__)
}
| 16,494 |
64,683 | 0 | onig_scan(regex_t* reg, const UChar* str, const UChar* end,
OnigRegion* region, OnigOptionType option,
int (*scan_callback)(int, int, OnigRegion*, void*),
void* callback_arg)
{
int r;
int n;
int rs;
const UChar* start;
if (ONIG_IS_OPTION_ON(option, ONIG_OPTION_CHECK_VALIDITY_OF_STRING)) {
if (! ONIGENC_IS_VALID_MBC_STRING(reg->enc, str, end))
return ONIGERR_INVALID_WIDE_CHAR_VALUE;
ONIG_OPTION_OFF(option, ONIG_OPTION_CHECK_VALIDITY_OF_STRING);
}
n = 0;
start = str;
while (1) {
r = onig_search(reg, str, end, start, end, region, option);
if (r >= 0) {
rs = scan_callback(n, r, region, callback_arg);
n++;
if (rs != 0)
return rs;
if (region->end[0] == start - str) {
if (start >= end) break;
start += enclen(reg->enc, start);
}
else
start = str + region->end[0];
if (start > end)
break;
}
else if (r == ONIG_MISMATCH) {
break;
}
else { /* error */
return r;
}
}
return n;
}
| 16,495 |
122,710 | 0 | bool Extension::ProducePEM(const std::string& input, std::string* output) {
DCHECK(output);
return (input.length() == 0) ? false : base::Base64Encode(input, output);
}
| 16,496 |
14,157 | 0 | int __glXDisp_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
{
xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER);
}
| 16,497 |
88,140 | 0 | smb2_validate_and_copy_iov(unsigned int offset, unsigned int buffer_length,
struct kvec *iov, unsigned int minbufsize,
char *data)
{
char *begin_of_buf = offset + (char *)iov->iov_base;
int rc;
if (!data)
return -EINVAL;
rc = smb2_validate_iov(offset, buffer_length, iov, minbufsize);
if (rc)
return rc;
memcpy(data, begin_of_buf, buffer_length);
return 0;
}
| 16,498 |
139,349 | 0 | bool HostCache::Entry::IsStale(base::TimeTicks now, int network_changes) const {
EntryStaleness stale;
stale.expired_by = now - expires_;
stale.network_changes = network_changes - network_changes_;
stale.stale_hits = stale_hits_;
return stale.is_stale();
}
| 16,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.