unique_id int64 13 189k | target int64 0 1 | code stringlengths 20 241k | __index_level_0__ int64 0 18.9k |
|---|---|---|---|
54,672 | 0 | static void get_client_info(struct snd_seq_client *cptr,
struct snd_seq_client_info *info)
{
info->client = cptr->number;
/* fill the info fields */
info->type = cptr->type;
strcpy(info->name, cptr->name);
info->filter = cptr->filter;
info->event_lost = cptr->event_lost;
memcpy(info->event_filter, cptr->... | 10,800 |
73,099 | 0 | BGD_DECLARE(void) gdSetErrorMethod(gdErrorMethod error_method)
{
gd_error_method = error_method;
}
| 10,801 |
91,360 | 0 | static const char *CompositeOperatorToPSDBlendMode(Image *image)
{
switch (image->compose)
{
case ColorBurnCompositeOp:
return(image->endian == LSBEndian ? "vidi" : "idiv");
case ColorDodgeCompositeOp:
return(image->endian == LSBEndian ? " vid" : "div ");
case ColorizeCompositeOp:
retu... | 10,802 |
93,790 | 0 | virDomainFSThaw(virDomainPtr dom,
const char **mountpoints,
unsigned int nmountpoints,
unsigned int flags)
{
VIR_DOMAIN_DEBUG(dom, "flags=%x", flags);
virResetLastError();
virCheckDomainReturn(dom, -1);
virCheckReadOnlyGoto(dom->conn->flags, error);
... | 10,803 |
13,551 | 0 | static HB_Error GPOS_Do_Glyph_Lookup( GPOS_Instance* gpi,
HB_UShort lookup_index,
HB_Buffer buffer,
HB_UShort context_length,
int nesting_level )
{
HB_Error error = HB_Err_Not_Covered;
HB_UShort i, flags, loo... | 10,804 |
181,092 | 1 | juniper_pppoe_atm_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, register const u_char *p)
{
struct juniper_l2info_t l2info;
uint16_t extracted_ethertype;
l2info.pictype = DLT_JUNIPER_PPPOE_ATM;
if (juniper_parse_header(ndo, p, h, &l2info) == 0)
... | 10,805 |
64,035 | 0 | static int huff_reader_build_canonical(HuffReader *r, int *code_lengths,
int alphabet_size)
{
int len = 0, sym, code = 0, ret;
int max_code_length = 0;
uint16_t *codes;
/* special-case 1 symbol since the vlc reader cannot handle it */
for (sym = 0; sym < alpha... | 10,806 |
66,036 | 0 | int yr_arena_write_string(
YR_ARENA* arena,
const char* string,
char** written_string)
{
return yr_arena_write_data(
arena,
(void*) string,
strlen(string) + 1,
(void**) written_string);
}
| 10,807 |
151,176 | 0 | void Dispose() {
raw_data_ = nullptr;
delete this;
}
| 10,808 |
152,303 | 0 | void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) {
JavaScriptExecuteRequest(javascript, base::DoNothing());
}
| 10,809 |
127,869 | 0 | static bool CheckSrt(const uint8* buffer, int buffer_size) {
RCHECK(buffer_size > 20);
int offset = StartsWith(buffer, buffer_size, UTF8_BYTE_ORDER_MARK) ? 3 : 0;
RCHECK(VerifyNumber(buffer, buffer_size, &offset, 100));
RCHECK(VerifyCharacters(buffer, buffer_size, &offset, '\n', '\r'));
while (VerifyCharact... | 10,810 |
143,761 | 0 | bool quit_called() const { return quit_called_; }
| 10,811 |
140,709 | 0 | bool GLES2DecoderImpl::ClearLevel(
Texture* texture,
unsigned target,
int level,
unsigned internal_format,
unsigned format,
unsigned type,
int width,
int height,
bool is_texture_immutable) {
uint32 channels = GLES2Util::GetChannelsForFormat(format);
if (feature_info_->feature_fla... | 10,812 |
30,182 | 0 | static int ftrace_module_notify_enter(struct notifier_block *self,
unsigned long val, void *data)
{
return 0;
}
| 10,813 |
62,912 | 0 | static bool pmu_write_swinc_el0_disabled(struct kvm_vcpu *vcpu)
{
u64 reg = vcpu_sys_reg(vcpu, PMUSERENR_EL0);
return !((reg & (ARMV8_PMU_USERENR_SW | ARMV8_PMU_USERENR_EN))
|| vcpu_mode_priv(vcpu));
}
| 10,814 |
67,295 | 0 | void d_delete(struct dentry * dentry)
{
struct inode *inode;
int isdir = 0;
/*
* Are we the only user?
*/
again:
spin_lock(&dentry->d_lock);
inode = dentry->d_inode;
isdir = S_ISDIR(inode->i_mode);
if (dentry->d_lockref.count == 1) {
if (!spin_trylock(&inode->i_lock)) {
spin_unlock(&dentry->d_lock);
... | 10,815 |
176,619 | 0 | xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
int id = ctxt->input->id;
SKIP(3);
SKIP_BLANKS;
if (CMP7(CUR_PTR, 'I', 'N', 'C', 'L', 'U', 'D', 'E')) {
SKIP(7);
SKIP_BLANKS;
if (RAW != '[') {
xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
xmlHaltParser(ctxt);
return;
} else {
if (ctxt... | 10,816 |
174,686 | 0 | WORD32 ih264d_ref_idx_reordering(dec_struct_t *ps_dec, UWORD8 uc_lx)
{
dpb_manager_t *ps_dpb_mgr = ps_dec->ps_dpb_mgr;
UWORD16 u4_cur_pic_num = ps_dec->ps_cur_slice->u2_frame_num;
/*< Maximum Picture Number Minus 1 */
UWORD16 ui_max_frame_num =
ps_dec->ps_cur_sps->u2_u4_max_pic_num_minus1 ... | 10,817 |
169,926 | 0 | xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
{
xmlChar *resultPrefix = NULL;
xmlChar *stylePrefix = NULL;
xmlNsPtr literalNs = NULL;
xmlNsPtr targetNs = NULL;
#ifdef XSLT_REFACTORED
xsltNsAliasPtr alias;
if ((style == NULL) || (node == NULL))
return;
/*
* SPEC XSLT 1.... | 10,818 |
174,242 | 0 | void Camera3Device::notifyError(const camera3_error_msg_t &msg,
NotificationListener *listener) {
static const ICameraDeviceCallbacks::CameraErrorCode
halErrorMap[CAMERA3_MSG_NUM_ERRORS] = {
ICameraDeviceCallbacks::ERROR_CAMERA_INVALID_ERROR,
ICameraDeviceCallbacks::ERROR_CAMERA_DEVICE,
ICameraDeviceC... | 10,819 |
145,917 | 0 | aura::Window* CreatePanelWindow(const gfx::Rect& bounds) {
return CreatePanelWindowWithDelegate(nullptr, bounds);
}
| 10,820 |
94,719 | 0 | gdImagePtr gdImageCreateFromWebpPtr (int size, void *data)
{
gdImagePtr im;
gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0);
if (!in)
return 0;
im = gdImageCreateFromWebpCtx(in);
in->gd_free(in);
return im;
}
| 10,821 |
184,972 | 1 | xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
int id = ctxt->input->id;
SKIP(3);
SKIP_BLANKS;
if (CMP7(CUR_PTR, 'I', 'N', 'C', 'L', 'U', 'D', 'E')) {
SKIP(7);
SKIP_BLANKS;
if (RAW != '[') {
xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
} else {
if (ctxt->input->id != id) {
xmlValidityError(ctxt, XML_ERR_ENT... | 10,822 |
67,485 | 0 | static int fsmBackup(rpmfi fi, rpmFileAction action)
{
int rc = 0;
const char *suffix = NULL;
if (!(rpmfiFFlags(fi) & RPMFILE_GHOST)) {
switch (action) {
case FA_SAVE:
suffix = SUFFIX_RPMSAVE;
break;
case FA_BACKUP:
suffix = SUFFIX_RPMORIG;
break;
default:
break;
}
}
... | 10,823 |
153,276 | 0 | Widget::MoveLoopResult DesktopWindowTreeHostX11::RunMoveLoop(
const gfx::Vector2d& drag_offset,
Widget::MoveLoopSource source,
Widget::MoveLoopEscapeBehavior escape_behavior) {
wm::WindowMoveSource window_move_source =
source == Widget::MOVE_LOOP_SOURCE_MOUSE ? wm::WINDOW_MOVE_SOURCE_MOUSE
... | 10,824 |
121,787 | 0 | void UDPSocketWin::DidCompleteRead() {
DWORD num_bytes, flags;
BOOL ok = WSAGetOverlappedResult(socket_, &core_->read_overlapped_,
&num_bytes, FALSE, &flags);
WSAResetEvent(core_->read_overlapped_.hEvent);
int result = ok ? num_bytes : MapSystemError(WSAGetLastError());
if (... | 10,825 |
77,173 | 0 | OVS_REQUIRES(ofproto_mutex)
{
struct rule *rule;
RULE_COLLECTION_FOR_EACH (rule, rules) {
struct oftable *table = &ofproto->tables[rule->table_id];
/* Add rule back to ofproto data structures. */
ofproto_rule_insert__(ofproto, rule);
/* Restore table's rule count. */
... | 10,826 |
62,682 | 0 | static unsigned char *DecodeImage(Image *blob,Image *image,
size_t bytes_per_line,const unsigned int bits_per_pixel,size_t *extent)
{
MagickSizeType
number_pixels;
register ssize_t
i;
register unsigned char
*p,
*q;
size_t
bytes_per_pixel,
length,
row_bytes,
scanline_length,
... | 10,827 |
5,244 | 0 | PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array)
{
zval row;
char *field_name;
size_t num_fields;
int pg_numrows, pg_row;
uint i;
assert(Z_TYPE_P(ret_array) == IS_ARRAY);
if ((pg_numrows = PQntuples(pg_result)) <= 0) {
return FAILURE;
}
for (pg_row = 0; pg_row < pg_numrows; pg... | 10,828 |
11,424 | 0 | fbFetchPixel_r3g3b2 (const FbBits *bits, int offset, miIndexedPtr indexed)
{
CARD32 pixel = READ((CARD8 *) bits + offset);
CARD32 r,g,b;
r = ((pixel & 0xe0) | ((pixel & 0xe0) >> 3) | ((pixel & 0xc0) >> 6)) << 16;
g = ((pixel & 0x1c) | ((pixel & 0x18) >> 3) | ((pixel & 0x1c) << 3)) << 8;
b = (((p... | 10,829 |
71,740 | 0 | static void SVGStartElement(void *context,const xmlChar *name,
const xmlChar **attributes)
{
char
*color,
id[MaxTextExtent],
token[MaxTextExtent],
**tokens,
*units;
const char
*keyword,
*p,
*value;
int
number_tokens;
SVGInfo
*svg_info;
register ssize_t
i,
... | 10,830 |
174,734 | 0 | static int vol_effect_get_descriptor(effect_handle_t self,
effect_descriptor_t *descriptor)
{
vol_listener_context_t *context = (vol_listener_context_t *)self;
ALOGV("%s Called ", __func__);
if (descriptor == NULL) {
ALOGE("%s: descriptor is NULL", __func__);
return -EINVAL;
}
*descriptor = *conte... | 10,831 |
176,087 | 0 | void rfc_send_msc(tRFC_MCB* p_mcb, uint8_t dlci, bool is_command,
tPORT_CTRL* p_pars) {
uint8_t* p_data;
uint8_t signals;
uint8_t break_duration;
uint8_t len;
BT_HDR* p_buf = (BT_HDR*)osi_malloc(RFCOMM_CMD_BUF_SIZE);
signals = p_pars->modem_signal;
break_duration = p_pars->break_signal;
... | 10,832 |
16,799 | 0 | static int alloc_refcount_block(BlockDriverState *bs,
int64_t cluster_index, uint16_t **refcount_block)
{
BDRVQcowState *s = bs->opaque;
unsigned int refcount_table_index;
int ret;
BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_ALLOC);
/* Find the refcount block for the given cluster */
refcount_t... | 10,833 |
154,720 | 0 | error::Error GLES2DecoderPassthroughImpl::DoGetUniformiv(GLuint program,
GLint location,
GLsizei bufsize,
GLsizei* length,
... | 10,834 |
47,522 | 0 | static int ahash_sha1_init(struct ahash_request *req)
{
struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
struct hash_ctx *ctx = crypto_ahash_ctx(tfm);
ctx->config.data_format = HASH_DATA_8_BITS;
ctx->config.algorithm = HASH_ALGO_SHA1;
ctx->config.oper_mode = HASH_OPER_MODE_HASH;
ctx->digestsize = SHA1_DIGEST... | 10,835 |
100,014 | 0 | virtual void didFinishLoading(WebURLLoader*) {}
| 10,836 |
88,919 | 0 | MagickExport MagickBooleanType EvaluateImage(Image *image,
const MagickEvaluateOperator op,const double value,ExceptionInfo *exception)
{
MagickBooleanType
status;
status=EvaluateImageChannel(image,CompositeChannels,op,value,exception);
return(status);
}
| 10,837 |
90,589 | 0 | static int special_mapping_mremap(struct vm_area_struct *new_vma)
{
struct vm_special_mapping *sm = new_vma->vm_private_data;
if (WARN_ON_ONCE(current->mm != new_vma->vm_mm))
return -EFAULT;
if (sm->mremap)
return sm->mremap(sm, new_vma);
return 0;
}
| 10,838 |
184,933 | 1 | void BluetoothDeviceChromeOS::UnregisterAgent() {
if (!agent_.get())
return;
DCHECK(pairing_delegate_);
DCHECK(pincode_callback_.is_null());
DCHECK(passkey_callback_.is_null());
DCHECK(confirmation_callback_.is_null());
pairing_delegate_->DismissDisplayOrConfirm();
pairing_delegate_ = NULL;
agent_.r... | 10,839 |
110,672 | 0 | TextureManager::TextureInfo* TextureManager::GetTextureInfo(
GLuint client_id) {
TextureInfoMap::iterator it = texture_infos_.find(client_id);
return it != texture_infos_.end() ? it->second : NULL;
}
| 10,840 |
33,817 | 0 | static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work,
unsigned seq)
{
int left;
spin_lock_irq(&dev->work_lock);
left = seq - work->done_seq;
spin_unlock_irq(&dev->work_lock);
return left <= 0;
}
| 10,841 |
49,866 | 0 | static void spl_array_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
{
spl_array_it *iterator = (spl_array_it *)iter;
spl_array_object *object = iterator->object;
HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC);
if (object->ar_flags & SPL_ARRAY_... | 10,842 |
15,792 | 0 | static int ssl3_add_cert_to_buf(BUF_MEM *buf, unsigned long *l, X509 *x)
{
int n;
unsigned char *p;
n=i2d_X509(x,NULL);
if (!BUF_MEM_grow_clean(buf,(int)(n+(*l)+3)))
{
SSLerr(SSL_F_SSL3_ADD_CERT_TO_BUF,ERR_R_BUF_LIB);
return(-1);
}
p=(unsigned char *)&(buf->data[*l]);
l2n3(n,p);
i2d_X509(x,&p);
*l+=n+... | 10,843 |
83,361 | 0 | static int ssl_parse_server_ecdh_params( mbedtls_ssl_context *ssl,
unsigned char **p,
unsigned char *end )
{
int ret = MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE;
/*
* Ephemeral ECDH parameters:
*
* struct {
* EC... | 10,844 |
59,046 | 0 | static int open_handlers(void)
{
struct dirent **dirent_list;
int num_handlers;
int num_good = 0;
int i;
num_handlers = scandir(handler_path, &dirent_list, is_handler, alphasort);
if (num_handlers == -1)
return -1;
for (i = 0; i < num_handlers; i++) {
char *path;
void *handle;
int (*handler_init)(void... | 10,845 |
110,282 | 0 | void Plugin::BitcodeDidTranslateContinuation(int32_t pp_error) {
ErrorInfo error_info;
bool was_successful = LoadNaClModuleContinuationIntern(&error_info);
NaClLog(4, "Entered BitcodeDidTranslateContinuation\n");
UNREFERENCED_PARAMETER(pp_error);
if (was_successful) {
ReportLoadSuccess(LENGTH_IS_NOT_COMP... | 10,846 |
187,810 | 1 | OMX_ERRORTYPE omx_vdec::get_config(OMX_IN OMX_HANDLETYPE hComp,
OMX_IN OMX_INDEXTYPE configIndex,
OMX_INOUT OMX_PTR configData)
{
(void) hComp;
OMX_ERRORTYPE eRet = OMX_ErrorNone;
if (m_state == OMX_StateInvalid) {
DEBUG_PRINT_ERROR("Get Config in Invalid State");
return OMX_ErrorInvalidState;
}
switch ((u... | 10,847 |
14,281 | 0 | MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, dtor)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
{
DBG_ENTER("mysqlnd_conn_data::dtor");
DBG_INF_FMT("conn=%llu", conn->thread_id);
conn->m->free_contents(conn TSRMLS_CC);
conn->m->free_options(conn TSRMLS_CC);
if (conn->net) {
mysqlnd_net_free(conn->net, conn->stats, conn->e... | 10,848 |
1,701 | 0 | static RELOC_PTRS_BEGIN(pattern2_instance_reloc_ptrs) {
RELOC_PREFIX(st_pattern_instance);
RELOC_SUPER(gs_pattern2_instance_t, st_pattern2_template, templat);
} RELOC_PTRS_END
| 10,849 |
87,165 | 0 | void *AllocateMemoryWithTimeout (size_t size, int retryDelay, int timeout)
{
LARGE_INTEGER waitInterval;
waitInterval.QuadPart = retryDelay * -10000;
ASSERT (KeGetCurrentIrql() <= APC_LEVEL);
ASSERT (retryDelay > 0 && retryDelay <= timeout);
while (TRUE)
{
void *memory = TCalloc (size);
if (memory)
retur... | 10,850 |
46,975 | 0 | static int ghash_async_final(struct ahash_request *req)
{
struct ahash_request *cryptd_req = ahash_request_ctx(req);
if (!irq_fpu_usable()) {
struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm);
struct cryptd_ahash *cryptd_tfm = ctx->cryptd_tfm;
memcpy(cr... | 10,851 |
170,127 | 0 | void PasswordAutofillAgent::DidStartProvisionalLoad() {
std::unique_ptr<RendererSavePasswordProgressLogger> logger;
if (logging_state_active_) {
logger.reset(new RendererSavePasswordProgressLogger(this, routing_id()));
logger->LogMessage(Logger::STRING_DID_START_PROVISIONAL_LOAD_METHOD);
}
const blink:... | 10,852 |
77,732 | 0 | parse_stack_prop(const struct ofpbuf *property, struct ofpbuf *stack)
{
unsigned int len = ofpbuf_msgsize(property);
if (len > sizeof(union mf_subvalue)) {
VLOG_WARN_RL(&bad_ofmsg_rl, "NXCPT_STACK property has bad length %u",
len);
return OFPERR_OFPBPC_BAD_LEN;
}
nx_... | 10,853 |
1,813 | 0 | static void jffs2_iset_acl(struct inode *inode, struct posix_acl **i_acl, struct posix_acl *acl)
{
spin_lock(&inode->i_lock);
if (*i_acl != JFFS2_ACL_NOT_CACHED)
posix_acl_release(*i_acl);
*i_acl = posix_acl_dup(acl);
spin_unlock(&inode->i_lock);
}
| 10,854 |
136,215 | 0 | bool SerializerMarkupAccumulator::shouldIgnoreAttribute(const Attribute& attribute)
{
PageSerializer::Delegate* delegate = m_serializer->delegate();
if (delegate)
return delegate->shouldIgnoreAttribute(attribute);
return MarkupAccumulator::shouldIgnoreAttribute(attribute);
}
| 10,855 |
81,993 | 0 | static long long ustime(void) {
struct timeval tv;
long long ust;
gettimeofday(&tv, NULL);
ust = ((long long)tv.tv_sec)*1000000;
ust += tv.tv_usec;
return ust;
}
| 10,856 |
119,402 | 0 | void RenderThreadImpl::IdleHandler() {
bool run_in_foreground_tab = (widget_count_ > hidden_widget_count_) &&
GetContentClient()->renderer()->
RunIdleHandlerWhenWidgetsHidden();
if (run_in_foreground_tab) {
IdleHandlerInForegroundTab();
retur... | 10,857 |
71,903 | 0 | static void TIFFReadPhotoshopLayers(Image* image,const ImageInfo *image_info,
ExceptionInfo *exception)
{
const char
*option;
const StringInfo
*layer_info;
Image
*layers;
PSDInfo
info;
register ssize_t
i;
if (GetImageListLength(image) != 1)
return;
if ((image_info->number_sc... | 10,858 |
47,809 | 0 | int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
unsigned int min, unsigned int max)
{
struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints;
struct snd_interval t;
t.min = min;
t.max = max;
t.openmin = t.openmax = 0;
t.integer = 0;
return snd_interval_re... | 10,859 |
99,361 | 0 | PrintingContext::Result PrintingContext::OnError() {
ResetSettings();
return abort_printing_ ? CANCEL : FAILED;
}
| 10,860 |
178,177 | 1 | ft_smooth_render_generic( FT_Renderer render,
FT_GlyphSlot slot,
FT_Render_Mode mode,
const FT_Vector* origin,
FT_Render_Mode required_mode )
{
FT_Error error;
FT_Outline* outline = NULL;
FT_BBox cbox;
FT_UInt width, height, height_org, width_org, pitch;
FT_Bitmap* bitmap;
FT_Memory ... | 10,861 |
172,788 | 0 | sp<IMemory> MetadataRetrieverClient::extractAlbumArt()
{
ALOGV("extractAlbumArt");
Mutex::Autolock lock(mLock);
mAlbumArt.clear();
if (mRetriever == NULL) {
ALOGE("retriever is not initialized");
return NULL;
}
MediaAlbumArt *albumArt = mRetriever->extractAlbumArt();
if (albumArt == NULL) {
... | 10,862 |
96,295 | 0 | nfs_update_shareopts(sa_share_impl_t impl_share, const char *resource,
const char *shareopts)
{
char *shareopts_dup;
boolean_t needs_reshare = B_FALSE;
char *old_shareopts;
FSINFO(impl_share, nfs_fstype)->active =
nfs_is_share_active(impl_share);
old_shareopts = FSINFO(impl_share, nfs_fstype)->shareopts... | 10,863 |
180,825 | 1 | static int raw_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
{
struct inet_sock *inet = inet_sk(sk);
struct net *net = sock_net(sk);
struct ipcm_cookie ipc;
struct rtable *rt = NULL;
struct flowi4 fl4;
int free = 0;
__be32 daddr;
__be32 saddr;
u8 tos;
int err;
struct ip_options_data opt_copy;
struct raw_fra... | 10,864 |
134,420 | 0 | void TabStrip::SetImmersiveStyle(bool enable) {
if (immersive_style_ == enable)
return;
immersive_style_ = enable;
}
| 10,865 |
28,137 | 0 | static void fill_block8_c(uint8_t *block, uint8_t value, int line_size, int h)
{
int i;
for (i = 0; i < h; i++) {
memset(block, value, 8);
block += line_size;
}
}
| 10,866 |
161,803 | 0 | void PlatformSensorProviderLinux::OnDeviceAdded(
mojom::SensorType type,
std::unique_ptr<SensorInfoLinux> sensor_device) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (base::ContainsKey(sensor_devices_by_type_, type)) {
DVLOG(1) << "Sensor ignored. Type " << type
<< ". Node: " << sen... | 10,867 |
63,856 | 0 | static ssize_t f2fs_attr_store(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t len)
{
struct f2fs_sb_info *sbi = container_of(kobj, struct f2fs_sb_info,
s_kobj);
struct f2fs_attr *a = container_of(attr, struct f2fs_attr, attr);
return a->store ? a->store(a, sbi, buf, len) : 0;
}... | 10,868 |
66,064 | 0 | static int omninet_write_room(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
struct usb_serial *serial = port->serial;
struct usb_serial_port *wport = serial->port[1];
int room = 0; /* Default: no room */
if (test_bit(0, &wport->write_urbs_free))
room = wport->bulk_out_size - OMN... | 10,869 |
70,612 | 0 | evdns_getaddrinfo_gotresolve(int result, char type, int count,
int ttl, void *addresses, void *arg)
{
int i;
struct getaddrinfo_subrequest *req = arg;
struct getaddrinfo_subrequest *other_req;
struct evdns_getaddrinfo_request *data;
struct evutil_addrinfo *res;
struct sockaddr_in sin;
struct sockaddr_in6 s... | 10,870 |
96,303 | 0 | CParaNdisTX::CParaNdisTX()
{ }
| 10,871 |
121,243 | 0 | void HTMLInputElement::setCanReceiveDroppedFiles(bool canReceiveDroppedFiles)
{
if (m_canReceiveDroppedFiles == canReceiveDroppedFiles)
return;
m_canReceiveDroppedFiles = canReceiveDroppedFiles;
if (renderer())
renderer()->updateFromElement();
}
| 10,872 |
114,884 | 0 | void TestingAutomationProvider::FindInPage(
Browser* browser,
DictionaryValue* args,
IPC::Message* reply_message) {
std::string error_message;
TabContentsWrapper* tab_contents =
GetTabContentsWrapperFromDict(browser, args, &error_message);
if (!tab_contents) {
AutomationJSONReply(this, reply... | 10,873 |
124,483 | 0 | void RenderBlock::addVisualOverflowFromTheme()
{
if (!style()->hasAppearance())
return;
IntRect inflatedRect = pixelSnappedBorderBoxRect();
RenderTheme::theme().adjustRepaintRect(this, inflatedRect);
addVisualOverflow(inflatedRect);
}
| 10,874 |
34,461 | 0 | int btrfs_add_dead_root(struct btrfs_root *root)
{
spin_lock(&root->fs_info->trans_lock);
list_add(&root->root_list, &root->fs_info->dead_roots);
spin_unlock(&root->fs_info->trans_lock);
return 0;
}
| 10,875 |
23,367 | 0 | static void encode_link(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr)
{
__be32 *p;
p = reserve_space(xdr, 8 + name->len);
*p++ = cpu_to_be32(OP_LINK);
xdr_encode_opaque(p, name->name, name->len);
hdr->nops++;
hdr->replen += decode_link_maxsz;
}
| 10,876 |
58,377 | 0 | static void dump_instr(const char *lvl, struct pt_regs *regs)
{
unsigned long addr = instruction_pointer(regs);
const int thumb = thumb_mode(regs);
const int width = thumb ? 4 : 8;
mm_segment_t fs;
char str[sizeof("00000000 ") * 5 + 2 + 1], *p = str;
int i;
/*
* We need to switch to kernel mode so that we can... | 10,877 |
56,626 | 0 | static int write_end_fn(handle_t *handle, struct buffer_head *bh)
{
int ret;
if (!buffer_mapped(bh) || buffer_freed(bh))
return 0;
set_buffer_uptodate(bh);
ret = ext4_handle_dirty_metadata(handle, NULL, bh);
clear_buffer_meta(bh);
clear_buffer_prio(bh);
return ret;
}
| 10,878 |
43,008 | 0 | static int virtnet_restore(struct virtio_device *vdev)
{
struct virtnet_info *vi = vdev->priv;
int err, i;
err = init_vqs(vi);
if (err)
return err;
virtio_device_ready(vdev);
if (netif_running(vi->dev)) {
for (i = 0; i < vi->curr_queue_pairs; i++)
if (!try_fill_recv(vi, &vi->rq[i], GFP_KERNEL))
sche... | 10,879 |
182,709 | 1 | lmp_print(netdissect_options *ndo,
register const u_char *pptr, register u_int len)
{
const struct lmp_common_header *lmp_com_header;
const struct lmp_object_header *lmp_obj_header;
const u_char *tptr,*obj_tptr;
u_int tlen,lmp_obj_len,lmp_obj_ctype,obj_tlen;
int hexdump, ret;
u_int offset;
u_int link_type;
union { /* ... | 10,880 |
87,894 | 0 | PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t * pamh, int flags, int argc,
const char **argv)
{
/* if the user has been authenticated (precondition of this call), then
* everything is OK. Yes, we explicitly don't want to check CRLs, OCSP or
* exparation of certificates (use pam_pkcs11 for this). */
return PAM_SU... | 10,881 |
151,941 | 0 | void FileSelectionCanceled() {
proxy_ = nullptr;
if (!render_frame_host_)
return;
std::move(callback_).Run(nullptr);
}
| 10,882 |
56,982 | 0 | static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req)
{
struct inode *inode = req->inode;
struct fuse_inode *fi = get_fuse_inode(inode);
struct backing_dev_info *bdi = inode_to_bdi(inode);
int i;
list_del(&req->writepages_entry);
for (i = 0; i < req->num_pages; i++) {
dec_wb_stat(&bdi->... | 10,883 |
61,522 | 0 | static void RemoveResolutionFromResourceBlock(StringInfo *bim_profile)
{
register const unsigned char
*p;
size_t
length;
unsigned char
*datum;
unsigned int
count,
long_sans;
unsigned short
id,
short_sans;
length=GetStringInfoLength(bim_profile);
if (length < 16)
return... | 10,884 |
24,182 | 0 | ar6000_dset_open_req(
void *context,
u32 id,
u32 targHandle,
u32 targReplyFn,
u32 targReplyArg)
{
}
| 10,885 |
123,140 | 0 | void RenderWidgetHostViewAndroid::UnlockMouse() {
NOTIMPLEMENTED();
}
| 10,886 |
175,142 | 0 | void wifi_socket_set_local_port(struct nl_sock *sock, uint32_t port)
{
uint32_t pid = getpid() & 0x3FFFFF;
nl_socket_set_local_port(sock, pid + (port << 22));
}
| 10,887 |
72,740 | 0 | static void jas_icctxtdesc_destroy(jas_iccattrval_t *attrval)
{
jas_icctxtdesc_t *txtdesc = &attrval->data.txtdesc;
if (txtdesc->ascdata) {
jas_free(txtdesc->ascdata);
txtdesc->ascdata = 0;
}
if (txtdesc->ucdata) {
jas_free(txtdesc->ucdata);
txtdesc->ucdata = 0;
}
}
| 10,888 |
47,561 | 0 | static int __init ux500_hash_mod_init(void)
{
klist_init(&driver_data.device_list, NULL, NULL);
/* Initialize the semaphore to 0 devices (locked state) */
sema_init(&driver_data.device_allocation, 0);
return platform_driver_register(&hash_driver);
}
| 10,889 |
58,833 | 0 | void remove_from_page_cache(struct page *page)
{
struct address_space *mapping = page->mapping;
BUG_ON(!PageLocked(page));
write_lock_irq(&mapping->tree_lock);
__remove_from_page_cache(page);
write_unlock_irq(&mapping->tree_lock);
}
| 10,890 |
39,502 | 0 | do_bottom_half_rx(struct fst_card_info *card)
{
struct fst_port_info *port;
int pi;
int rx_count = 0;
/* Check for rx completions on all ports on this card */
dbg(DBG_RX, "do_bottom_half_rx\n");
for (pi = 0, port = card->ports; pi < card->nports; pi++, port++) {
if (!port->run)
continue;
while (!(FST_RDB... | 10,891 |
167,582 | 0 | void SiteInstanceImpl::AddObserver(Observer* observer) {
observers_.AddObserver(observer);
}
| 10,892 |
7,379 | 0 | check_format(struct magic_set *ms, struct magic *m)
{
char *ptr;
for (ptr = m->desc; *ptr; ptr++)
if (*ptr == '%')
break;
if (*ptr == '\0') {
/* No format string; ok */
return 1;
}
assert(file_nformats == file_nnames);
if (m->type >= file_nformats) {
file_magwarn(ms, "Internal error inconsistency be... | 10,893 |
118,886 | 0 | WebContentsImpl* WebContentsImpl::GetCreatedWindow(int route_id) {
PendingContents::iterator iter = pending_contents_.find(route_id);
if (iter == pending_contents_.end()) {
return NULL;
}
WebContentsImpl* new_contents = iter->second;
pending_contents_.erase(route_id);
RemoveDestructionObserver(new_con... | 10,894 |
55,426 | 0 | static void flush_tlb_func(void *info)
{
struct flush_tlb_info *f = info;
inc_irq_stat(irq_tlb_count);
if (f->flush_mm != this_cpu_read(cpu_tlbstate.active_mm))
return;
if (!f->flush_end)
f->flush_end = f->flush_start + PAGE_SIZE;
count_vm_tlb_event(NR_TLB_REMOTE_FLUSH_RECEIVED);
if (this_cpu_read(cpu_tlbs... | 10,895 |
128,395 | 0 | void RenderLayerScrollableArea::destroyScrollbar(ScrollbarOrientation orientation)
{
RefPtr<Scrollbar>& scrollbar = orientation == HorizontalScrollbar ? m_hBar : m_vBar;
if (!scrollbar)
return;
if (!scrollbar->isCustomScrollbar())
willRemoveScrollbar(scrollbar.get(), orientation);
scro... | 10,896 |
53,648 | 0 | static ssize_t ndp_to_end_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len)
{
struct usbnet *dev = netdev_priv(to_net_dev(d));
struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0];
bool enable;
if (strtobool(buf, &enable))
return -EINVAL;
/* no change? */
if (enable ... | 10,897 |
127,507 | 0 | void skip_input_data(j_decompress_ptr jd, long num_bytes)
{
decoder_source_mgr *src = (decoder_source_mgr *)jd->src;
src->decoder->skipBytes(num_bytes);
}
| 10,898 |
92,549 | 0 | static inline enum fbq_type fbq_classify_rq(struct rq *rq)
{
if (rq->nr_running > rq->nr_numa_running)
return regular;
if (rq->nr_running > rq->nr_preferred_running)
return remote;
return all;
}
| 10,899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.