unique_id int64 13 189k | target int64 0 1 | code stringlengths 20 241k | __index_level_0__ int64 0 18.9k |
|---|---|---|---|
72,597 | 0 | bool ring_buffer_empty(struct ring_buffer *buffer)
{
struct ring_buffer_per_cpu *cpu_buffer;
unsigned long flags;
bool dolock;
int cpu;
int ret;
/* yes this is racy, but if you don't like the race, lock the buffer */
for_each_buffer_cpu(buffer, cpu) {
cpu_buffer = buffer->buffers[cpu];
local_irq_save(flags)... | 18,800 |
183,009 | 1 | start_input_bmp(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
{
bmp_source_ptr source = (bmp_source_ptr)sinfo;
U_CHAR bmpfileheader[14];
U_CHAR bmpinfoheader[64];
#define GET_2B(array, offset) \
((unsigned short)UCH(array[offset]) + \
(((unsigned short)UCH(array[offset + 1])) << 8))
#define GET_4B(array, of... | 18,801 |
82,401 | 0 | void jsvGetArrayItems(JsVar *arr, unsigned int itemCount, JsVar **itemPtr) {
JsvObjectIterator it;
jsvObjectIteratorNew(&it, arr);
unsigned int i = 0;
while (jsvObjectIteratorHasValue(&it)) {
if (i<itemCount)
itemPtr[i++] = jsvObjectIteratorGetValue(&it);
jsvObjectIteratorNext(&it);
}
jsvObjec... | 18,802 |
133,403 | 0 | bool ShellDelegateImpl::IsMultiProfilesEnabled() const {
return false;
}
| 18,803 |
174,727 | 0 | UWORD32 ih264d_uev(UWORD32 *pu4_bitstrm_ofst, UWORD32 *pu4_bitstrm_buf)
{
UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
UWORD32 u4_word, u4_ldz;
/***************************************************************/
/* Find leading zeros in next 32 bits */
/***************************... | 18,804 |
16,656 | 0 | ReadUserLogFileState::getFileEventNum( int64_t &num ) const
{
if ( NULL == m_ro_state ) {
return false;
}
num = m_ro_state->internal.m_event_num.asint;
return true;
}
| 18,805 |
141,743 | 0 | void V8Debugger::handleV8DebugEvent(const v8::Debug::EventDetails& eventDetails)
{
if (!enabled())
return;
v8::DebugEvent event = eventDetails.GetEvent();
if (event != v8::AsyncTaskEvent && event != v8::Break && event != v8::Exception && event != v8::AfterCompile && event != v8::BeforeCompile && eve... | 18,806 |
169,993 | 0 | xsltDebugTraceCodes xsltDebugGetDefaultTrace() {
return xsltDefaultTrace;
}
| 18,807 |
29,927 | 0 | static inline struct ipv6_rt_hdr *ip6_rthdr_dup(struct ipv6_rt_hdr *src,
gfp_t gfp)
{
return src ? kmemdup(src, (src->hdrlen + 1) * 8, gfp) : NULL;
}
| 18,808 |
78,309 | 0 | coolkey_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data, int *tries_left)
{
int r;
coolkey_private_data_t * priv = COOLKEY_DATA(card);
size_t rbuflen;
u8 *rbuf;
/* COOLKEY uses a separate pin from the card pin, managed by the applet.
* if we successfully log into coolkey, we will get a nonce, which we app... | 18,809 |
148,709 | 0 | bool V4L2JpegEncodeAccelerator::EncodedInstanceDmaBuf::EnqueueInputRecord() {
DCHECK(parent_->encoder_task_runner_->BelongsToCurrentThread());
DCHECK(!input_job_queue_.empty());
DCHECK(!free_input_buffers_.empty());
std::unique_ptr<JobRecord> job_record = std::move(input_job_queue_.front());
input_job_queue_... | 18,810 |
65,579 | 0 | nfsd4_delegreturn(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
struct nfsd4_delegreturn *dr)
{
struct nfs4_delegation *dp;
stateid_t *stateid = &dr->dr_stateid;
struct nfs4_stid *s;
__be32 status;
struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
if ((status = fh_verify(rqstp, &... | 18,811 |
99,080 | 0 | int ResourceDispatcherHost::GetOutstandingRequestsMemoryCost(
int child_id) const {
OutstandingRequestsMemoryCostMap::const_iterator entry =
outstanding_requests_memory_cost_map_.find(child_id);
return (entry == outstanding_requests_memory_cost_map_.end()) ?
0 : entry->second;
}
| 18,812 |
178,653 | 1 | static int php_stream_temp_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC)
{
php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
int ret;
assert(ts != NULL);
if (!ts->innerstream) {
*newoffs = -1;
return -1;
}
ret = php_stream_seek(ts->innerstream, offset,... | 18,813 |
145,178 | 0 | void GpuProcessHost::RequestGPUInfo(RequestGPUInfoCallback request_cb) {
if (status_ == SUCCESS || status_ == FAILURE) {
std::move(request_cb).Run(GpuDataManagerImpl::GetInstance()->GetGPUInfo());
return;
}
request_gpu_info_callbacks_.push_back(std::move(request_cb));
}
| 18,814 |
88,007 | 0 | static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo)
{
struct pf_unit *pf = bdev->bd_disk->private_data;
sector_t capacity = get_capacity(pf->disk);
if (capacity < PF_FD_MAX) {
geo->cylinders = sector_div(capacity, PF_FD_HDS * PF_FD_SPT);
geo->heads = PF_FD_HDS;
geo->sectors = PF_FD_SPT;
... | 18,815 |
76,779 | 0 | swapReplace(int start, int end, const TranslationTableHeader *table,
const InString *input, OutString *output, int *posMapping,
const widechar *passInstructions, int passIC) {
TranslationTableOffset swapRuleOffset;
TranslationTableRule *swapRule;
widechar *replacements;
int p;
swapRuleOffset = (passInstruction... | 18,816 |
107,355 | 0 | void Browser::TabDetachedAtImpl(TabContentsWrapper* contents, int index,
DetachType type) {
if (type == DETACH_TYPE_DETACH) {
if (contents == GetSelectedTabContentsWrapper())
window_->GetLocationBar()->SaveStateToContents(contents->tab_contents());
if (!tab_handler_->Get... | 18,817 |
107,905 | 0 | void BeforeTranslateInfoBar::RunMenu(views::View* source,
const gfx::Point& pt) {
if (source == language_menu_button_) {
if (!languages_menu_.get())
languages_menu_.reset(new views::Menu2(&languages_menu_model_));
languages_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TO... | 18,818 |
132,586 | 0 | void WebKitTestController::OnResetDone() {
if (is_leak_detection_enabled_) {
if (main_window_ && main_window_->web_contents()) {
RenderViewHost* render_view_host =
main_window_->web_contents()->GetRenderViewHost();
render_view_host->Send(
new ShellViewMsg_TryLeakDetection(render_vi... | 18,819 |
110,291 | 0 | pp::Var Plugin::GetInstanceObject() {
PLUGIN_PRINTF(("Plugin::GetInstanceObject (this=%p)\n",
static_cast<void*>(this)));
ScriptablePlugin* handle =
static_cast<ScriptablePlugin*>(scriptable_plugin()->AddRef());
pp::Var* handle_var = handle->var();
PLUGIN_PRINTF(("Plugin::GetInstanceObjec... | 18,820 |
152,459 | 0 | void RenderFrameImpl::OnSwapOut(
int proxy_routing_id,
bool is_loading,
const FrameReplicationState& replicated_frame_state) {
TRACE_EVENT1("navigation,rail", "RenderFrameImpl::OnSwapOut",
"id", routing_id_);
SendUpdateState();
CHECK_NE(proxy_routing_id, MSG_ROUTING_NONE);
RenderFra... | 18,821 |
184,586 | 1 | virtual void SetUpCommandLine(CommandLine* command_line) {
GpuFeatureTest::SetUpCommandLine(command_line);
command_line->AppendSwitch(switches::kEnableThreadedCompositing);
}
| 18,822 |
118,042 | 0 | v8::Handle<v8::Value> V8WebGLRenderingContext::uniform2fvCallback(const v8::Arguments& args)
{
INC_STATS("DOM.WebGLRenderingContext.uniform2fv()");
return vertexAttribAndUniformHelperf(args, kUniform2v);
}
| 18,823 |
129,859 | 0 | static bool IsKeyValueInDict(const JsonKeyValue* key_value,
DictionaryValue* dict) {
Value* value = NULL;
std::string value_str;
if (dict->Get(key_value->key, &value) &&
value->GetAsString(&value_str) &&
CompareJsonValues(value_str, key_value->value, key_value->op))
re... | 18,824 |
126,540 | 0 | bool TabStripGtk::IsTabPinned(const TabGtk* tab) const {
if (tab->closing())
return false;
return model_->IsTabPinned(GetIndexOfTab(tab));
}
| 18,825 |
152,308 | 0 | void FillMiscNavigationParams(const CommonNavigationParams& common_params,
const CommitNavigationParams& commit_params,
blink::WebNavigationParams* navigation_params) {
navigation_params->navigation_timings = BuildNavigationTimings(
common_params.navig... | 18,826 |
116,724 | 0 | bool MockRenderProcess::UseInProcessPlugins() const {
return true;
}
| 18,827 |
131,040 | 0 | static void reflectedURLAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TestObject* imp = V8TestObject::toNative(info.Holder());
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
CustomElementCallbackDispatcher::CallbackDeliveryScope... | 18,828 |
35,998 | 0 | create_reconnect_durable_buf(struct cifs_fid *fid)
{
struct create_durable *buf;
buf = kzalloc(sizeof(struct create_durable), GFP_KERNEL);
if (!buf)
return NULL;
buf->ccontext.DataOffset = cpu_to_le16(offsetof
(struct create_durable, Data));
buf->ccontext.DataLength = cpu_to_le32(16);
buf->ccontext.NameO... | 18,829 |
71,392 | 0 | static void MSLPushImage(MSLInfo *msl_info,Image *image)
{
ssize_t
n;
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(msl_info != (MSLInfo *) NULL);
msl_info->n++;
n=msl_info->n;
msl_info->image_info=(ImageInfo **) ResizeQuantumMemory(msl_info->image_info,
(n+1),siz... | 18,830 |
128,721 | 0 | bool TemplateURL::ReplaceSearchTermsInURL(
const GURL& url,
const TemplateURLRef::SearchTermsArgs& search_terms_args,
const SearchTermsData& search_terms_data,
GURL* result) {
url::Parsed::ComponentType search_term_component;
url::Component search_terms_position;
base::string16 search_terms;
if ... | 18,831 |
27,022 | 0 | static int create_window(PluginInstance *plugin, NPWindow *window)
{
if (plugin->is_windowless) {
destroy_window_attributes(plugin->window.ws_info);
plugin->window.ws_info = NULL;
}
assert(plugin->window.ws_info == NULL);
NPSetWindowCallbackStruct *ws_info;
if ((ws_info = NPW_MemClone(NPSetWindowCallbackSt... | 18,832 |
37,383 | 0 | static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write,
int map_writable, int level, gfn_t gfn, pfn_t pfn,
bool prefault)
{
struct kvm_shadow_walk_iterator iterator;
struct kvm_mmu_page *sp;
int emulate = 0;
gfn_t pseudo_gfn;
for_each_shadow_entry(vcpu, (u64)gfn << PAGE_SHIFT, iterator) {
if (i... | 18,833 |
169,911 | 0 | xsltFreeKeyDefList(xsltKeyDefPtr keyd) {
xsltKeyDefPtr cur;
while (keyd != NULL) {
cur = keyd;
keyd = keyd->next;
xsltFreeKeyDef(cur);
}
}
| 18,834 |
131,665 | 0 | static void reflectTestInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
TestObjectPythonV8In... | 18,835 |
63,493 | 0 | void test_for()
{
assert_true_rule(
"rule test { \
strings: \
$a = \"ssi\" \
condition: \
for all i in (1..#a) : (@a[i] >= 2 and @a[i] <= 5) \
}",
"mississippi");
assert_true_rule(
"rule test { \
strings: \
$a = \"ssi\" \
$b = ... | 18,836 |
63,682 | 0 | static void nicklist_destroy(CHANNEL_REC *channel, NICK_REC *nick)
{
signal_emit("nicklist remove", 2, channel, nick);
if (channel->ownnick == nick)
channel->ownnick = NULL;
/*MODULE_DATA_DEINIT(nick);*/
g_free(nick->nick);
g_free_not_null(nick->realname);
g_free_not_null(nick->host);
g_... | 18,837 |
100,795 | 0 | bool HttpResponseHeaders::GetLastModifiedValue(Time* result) const {
return GetTimeValuedHeader("Last-Modified", result);
}
| 18,838 |
85,781 | 0 | static int madvise_inject_error(int behavior,
unsigned long start, unsigned long end)
{
struct page *page;
struct zone *zone;
unsigned int order;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
for (; start < end; start += PAGE_SIZE << order) {
int ret;
ret = get_user_pages_fast(start, 1, 0, &page);
if (... | 18,839 |
94,521 | 0 | static int l2cap_sock_create(struct net *net, struct socket *sock, int protocol,
int kern)
{
struct sock *sk;
BT_DBG("sock %p", sock);
sock->state = SS_UNCONNECTED;
if (sock->type != SOCK_SEQPACKET && sock->type != SOCK_STREAM &&
sock->type != SOCK_DGRAM && sock->type != SOCK_RAW)
return -ESOCKTNOSU... | 18,840 |
77,798 | 0 | static bool is_ASCII_name(const char *hostname)
{
const unsigned char *ch = (const unsigned char *)hostname;
while(*ch) {
if(*ch++ & 0x80)
return FALSE;
}
return TRUE;
}
| 18,841 |
136,003 | 0 | bool ChildProcessSecurityPolicyImpl::CanReadFileSystem(
int child_id, const std::string& filesystem_id) {
return HasPermissionsForFileSystem(child_id, filesystem_id, READ_FILE_GRANT);
}
| 18,842 |
139,237 | 0 | RenderProcessHostImpl::~RenderProcessHostImpl() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
#ifndef NDEBUG
DCHECK(is_self_deleted_)
<< "RenderProcessHostImpl is destroyed by something other than itself";
#endif
in_process_renderer_.reset();
ChildProcessSecurityPolicyImpl::GetInstance()->Remove(GetID());
... | 18,843 |
9,577 | 0 | CACHE_LIMITER_FUNC(nocache) /* {{{ */
{
ADD_HEADER("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
/* For HTTP/1.1 conforming clients and the rest (MSIE 5) */
ADD_HEADER("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
/* For HTTP/1.0 conforming clients */
ADD_HEADER("Pragma: no-cache... | 18,844 |
64,612 | 0 | lexer_construct_regexp_object (parser_context_t *context_p, /**< context */
bool parse_only) /**< parse only */
{
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
const uint8_t *source_p = context_p->source_p;
const uint8_t *regex_start_p = context_p->source_p;
const uint8_t *regex_end_p = reg... | 18,845 |
116,626 | 0 | WebPreferences& RenderViewImpl::GetWebkitPreferences() {
return webkit_preferences_;
}
| 18,846 |
14,774 | 0 | static void _free_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
pgsql_result_handle *pg_result = (pgsql_result_handle *)rsrc->ptr;
PQclear(pg_result->result);
efree(pg_result);
}
| 18,847 |
165,510 | 0 | void ContentSecurityPolicy::DispatchViolationEvents(
const SecurityPolicyViolationEventInit* violation_data,
Element* element) {
if (execution_context_->IsWorkletGlobalScope())
return;
SecurityPolicyViolationEvent& event = *SecurityPolicyViolationEvent::Create(
event_type_names::kSecuritypolicyvi... | 18,848 |
125,806 | 0 | bool ParamTraits<base::FileDescriptor>::Read(const Message* m,
PickleIterator* iter,
param_type* r) {
bool valid;
if (!ReadParam(m, iter, &valid))
return false;
if (!valid) {
r->fd = -1;
r->auto_close = false;
... | 18,849 |
3,393 | 0 | static apr_status_t php_server_context_cleanup(void *data_)
{
void **data = data_;
*data = NULL;
return APR_SUCCESS;
}
| 18,850 |
146,612 | 0 | void DrawingBuffer::ClearFramebuffers(GLbitfield clear_mask) {
ScopedStateRestorer scoped_state_restorer(this);
ClearFramebuffersInternal(clear_mask);
}
| 18,851 |
12,702 | 0 | int tls1_enc(SSL *s, SSL3_RECORD *recs, unsigned int n_recs, int send)
{
EVP_CIPHER_CTX *ds;
size_t reclen[SSL_MAX_PIPELINES];
unsigned char buf[SSL_MAX_PIPELINES][EVP_AEAD_TLS1_AAD_LEN];
int bs, i, j, k, pad = 0, ret, mac_size = 0;
const EVP_CIPHER *enc;
unsigned int ctr;
if (send) {
... | 18,852 |
49,777 | 0 | static void arcmsr_hbaB_postqueue_isr(struct AdapterControlBlock *acb)
{
uint32_t index;
uint32_t flag_ccb;
struct MessageUnit_B *reg = acb->pmuB;
struct ARCMSR_CDB *pARCMSR_CDB;
struct CommandControlBlock *pCCB;
bool error;
index = reg->doneq_index;
while ((flag_ccb = reg->done_qbuffer[index]) != 0) {
reg->d... | 18,853 |
61,057 | 0 | extract_string_until (const char *original,
const char *until_substring)
{
char *result;
g_assert ((int) strlen (original) >= until_substring - original);
g_assert (until_substring - original >= 0);
result = g_malloc (until_substring - original + 1);
strncpy (result, original... | 18,854 |
28,302 | 0 | static ssize_t portio_type_show(struct kobject *kobj, struct attribute *attr,
char *buf)
{
struct uio_portio *portio = to_portio(kobj);
struct uio_port *port = portio->port;
struct portio_sysfs_entry *entry;
entry = container_of(attr, struct portio_sysfs_entry, attr);
if (!entry->show)
return -EIO;
r... | 18,855 |
29,049 | 0 | static void ssl_update_checksum_start( ssl_context *ssl, unsigned char *buf,
size_t len )
{
md5_update( &ssl->handshake->fin_md5 , buf, len );
sha1_update( &ssl->handshake->fin_sha1, buf, len );
sha2_update( &ssl->handshake->fin_sha2, buf, len );
#if defined(POLARSSL_... | 18,856 |
120,794 | 0 | void BluetoothAdapterChromeOS::StartDiscovering(
const base::Closure& callback,
const ErrorCallback& error_callback) {
DBusThreadManager::Get()->GetBluetoothAdapterClient()->
StartDiscovery(
object_path_,
base::Bind(&BluetoothAdapterChromeOS::OnStartDiscovery,
we... | 18,857 |
130,998 | 0 | static void reflectedCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
TestObjectV8Internal::refle... | 18,858 |
85,088 | 0 | DisplayNameValueList(char * buffer, int bufsize)
{
struct NameValueParserData pdata;
struct NameValue * nv;
ParseNameValue(buffer, bufsize, &pdata);
for(nv = pdata.l_head;
nv != NULL;
nv = nv->l_next)
{
printf("%s = %s\n", nv->name, nv->value);
}
ClearNameValueList(&p... | 18,859 |
58,393 | 0 | asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
struct pt_regs *regs)
{
const struct fault_info *inf = fault_info + (esr & 63);
struct siginfo info;
if (!inf->fn(addr, esr, regs))
return;
pr_alert("Unhandled fault: %s (0x%08x) at 0x%016lx\n",
inf->name, esr, addr);
info... | 18,860 |
117,385 | 0 | BookmarkManagerView* BookmarkManagerView::current() {
return manager;
}
| 18,861 |
169,150 | 0 | bool RenderFrameHostImpl::DidCommitNavigationInternal(
FrameHostMsg_DidCommitProvisionalLoad_Params* validated_params,
bool is_same_document_navigation) {
DCHECK_EQ(ui::PageTransitionIsMainFrame(validated_params->transition),
!GetParent());
UMACommitReport(validated_params->report_type,
... | 18,862 |
135,635 | 0 | void FrameSelection::FocusedOrActiveStateChanged() {
bool active_and_focused = FrameIsFocusedAndActive();
if (Element* element = GetDocument().FocusedElement())
element->FocusStateChanged();
GetDocument().UpdateStyleAndLayoutTree();
LayoutViewItem view = GetDocument().GetLayoutViewItem();
if (!view.IsN... | 18,863 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.