unique_id
int64 13
189k
| target
int64 0
1
| code
stringlengths 20
241k
| __index_level_0__
int64 0
18.9k
|
---|---|---|---|
52,763 | 0 | int vb2_ioctl_querybuf(struct file *file, void *priv, struct v4l2_buffer *p)
{
struct video_device *vdev = video_devdata(file);
/* No need to call vb2_queue_is_busy(), anyone can query buffers. */
return vb2_querybuf(vdev->queue, p);
}
| 9,800 |
101,061 | 0 | UpdateTemporaryGlobalQuotaTask(
QuotaManager* manager,
int64 new_quota,
QuotaCallback* callback)
: DatabaseTaskBase(manager),
new_quota_(new_quota),
callback_(callback) {
DCHECK_GE(new_quota, 0);
}
| 9,801 |
19,110 | 0 | int udp_v4_get_port(struct sock *sk, unsigned short snum)
{
unsigned int hash2_nulladdr =
udp4_portaddr_hash(sock_net(sk), htonl(INADDR_ANY), snum);
unsigned int hash2_partial =
udp4_portaddr_hash(sock_net(sk), inet_sk(sk)->inet_rcv_saddr, 0);
/* precompute partial secondary hash */
udp_sk(sk)->udp_portaddr_hash = hash2_partial;
return udp_lib_get_port(sk, snum, ipv4_rcv_saddr_equal, hash2_nulladdr);
}
| 9,802 |
26,726 | 0 | void nl80211_send_auth_timeout(struct cfg80211_registered_device *rdev,
struct net_device *netdev, const u8 *addr,
gfp_t gfp)
{
nl80211_send_mlme_timeout(rdev, netdev, NL80211_CMD_AUTHENTICATE,
addr, gfp);
}
| 9,803 |
75,078 | 0 | person_get_frame_delay(const person_t* person)
{
return person->anim_frames;
}
| 9,804 |
180,854 | 1 | static int snd_seq_device_dev_free(struct snd_device *device)
{
struct snd_seq_device *dev = device->device_data;
put_device(&dev->dev);
return 0;
}
| 9,805 |
158,914 | 0 | void PDFiumEngine::DrawSelections(int progressive_index,
pp::ImageData* image_data) {
DCHECK_GE(progressive_index, 0);
DCHECK_LT(static_cast<size_t>(progressive_index), progressive_paints_.size());
DCHECK(image_data);
int page_index = progressive_paints_[progressive_index].page_index;
const pp::Rect& dirty_in_screen = progressive_paints_[progressive_index].rect;
void* region = nullptr;
int stride;
GetRegion(dirty_in_screen.point(), image_data, ®ion, &stride);
std::vector<pp::Rect> highlighted_rects;
pp::Rect visible_rect = GetVisibleRect();
for (auto& range : selection_) {
if (range.page_index() != page_index)
continue;
const std::vector<pp::Rect>& rects = range.GetScreenRects(
visible_rect.point(), current_zoom_, current_rotation_);
for (const auto& rect : rects) {
pp::Rect visible_selection = rect.Intersect(dirty_in_screen);
if (visible_selection.IsEmpty())
continue;
visible_selection.Offset(-dirty_in_screen.point().x(),
-dirty_in_screen.point().y());
Highlight(region, stride, visible_selection, &highlighted_rects);
}
}
for (const auto& highlight : form_highlights_) {
pp::Rect visible_selection = highlight.Intersect(dirty_in_screen);
if (visible_selection.IsEmpty())
continue;
visible_selection.Offset(-dirty_in_screen.point().x(),
-dirty_in_screen.point().y());
Highlight(region, stride, visible_selection, &highlighted_rects);
}
form_highlights_.clear();
}
| 9,806 |
108,047 | 0 | TextureManager::TextureInfo* CreateTextureInfo(
GLuint client_id, GLuint service_id) {
return texture_manager()->CreateTextureInfo(client_id, service_id);
}
| 9,807 |
18,328 | 0 | clean_up(void) {
send_event(INSTANCE_EXIT, uzbl.info.pid_str, NULL);
g_free(uzbl.info.pid_str);
g_free(uzbl.state.executable_path);
g_hash_table_destroy(uzbl.behave.commands);
if(uzbl.state.event_buffer)
g_ptr_array_free(uzbl.state.event_buffer, TRUE);
if (uzbl.behave.fifo_dir)
unlink (uzbl.comm.fifo_path);
if (uzbl.behave.socket_dir)
unlink (uzbl.comm.socket_path);
}
| 9,808 |
158,877 | 0 | BrowserTestWithExtensionsDisabled() {}
| 9,809 |
180,353 | 1 | static inline void write_s3row_data(
const entity_stage3_row *r,
unsigned orig_cp,
enum entity_charset charset,
zval *arr)
{
char key[9] = ""; /* two unicode code points in UTF-8 */
char entity[LONGEST_ENTITY_LENGTH + 2] = {'&'};
size_t written_k1;
written_k1 = write_octet_sequence(key, charset, orig_cp);
if (!r->ambiguous) {
size_t l = r->data.ent.entity_len;
memcpy(&entity[1], r->data.ent.entity, l);
entity[l + 1] = ';';
add_assoc_stringl_ex(arr, key, written_k1 + 1, entity, l + 2, 1);
} else {
unsigned i,
num_entries;
const entity_multicodepoint_row *mcpr = r->data.multicodepoint_table;
if (mcpr[0].leading_entry.default_entity != NULL) {
size_t l = mcpr[0].leading_entry.default_entity_len;
memcpy(&entity[1], mcpr[0].leading_entry.default_entity, l);
entity[l + 1] = ';';
add_assoc_stringl_ex(arr, key, written_k1 + 1, entity, l + 2, 1);
}
num_entries = mcpr[0].leading_entry.size;
for (i = 1; i <= num_entries; i++) {
size_t l,
written_k2;
unsigned uni_cp,
spe_cp;
uni_cp = mcpr[i].normal_entry.second_cp;
l = mcpr[i].normal_entry.entity_len;
if (!CHARSET_UNICODE_COMPAT(charset)) {
if (map_from_unicode(uni_cp, charset, &spe_cp) == FAILURE)
continue; /* non representable in this charset */
} else {
spe_cp = uni_cp;
}
written_k2 = write_octet_sequence(&key[written_k1], charset, spe_cp);
memcpy(&entity[1], mcpr[i].normal_entry.entity, l);
entity[l + 1] = ';';
entity[l + 1] = '\0';
add_assoc_stringl_ex(arr, key, written_k1 + written_k2 + 1, entity, l + 1, 1);
}
}
}
| 9,810 |
125,657 | 0 | void RenderViewHostImpl::OnDocumentAvailableInMainFrame() {
delegate_->DocumentAvailableInMainFrame(this);
}
| 9,811 |
41,466 | 0 | static int __dn_setsockopt(struct socket *sock, int level,int optname, char __user *optval, unsigned int optlen, int flags)
{
struct sock *sk = sock->sk;
struct dn_scp *scp = DN_SK(sk);
long timeo;
union {
struct optdata_dn opt;
struct accessdata_dn acc;
int mode;
unsigned long win;
int val;
unsigned char services;
unsigned char info;
} u;
int err;
if (optlen && !optval)
return -EINVAL;
if (optlen > sizeof(u))
return -EINVAL;
if (copy_from_user(&u, optval, optlen))
return -EFAULT;
switch (optname) {
case DSO_CONDATA:
if (sock->state == SS_CONNECTED)
return -EISCONN;
if ((scp->state != DN_O) && (scp->state != DN_CR))
return -EINVAL;
if (optlen != sizeof(struct optdata_dn))
return -EINVAL;
if (le16_to_cpu(u.opt.opt_optl) > 16)
return -EINVAL;
memcpy(&scp->conndata_out, &u.opt, optlen);
break;
case DSO_DISDATA:
if (sock->state != SS_CONNECTED &&
scp->accept_mode == ACC_IMMED)
return -ENOTCONN;
if (optlen != sizeof(struct optdata_dn))
return -EINVAL;
if (le16_to_cpu(u.opt.opt_optl) > 16)
return -EINVAL;
memcpy(&scp->discdata_out, &u.opt, optlen);
break;
case DSO_CONACCESS:
if (sock->state == SS_CONNECTED)
return -EISCONN;
if (scp->state != DN_O)
return -EINVAL;
if (optlen != sizeof(struct accessdata_dn))
return -EINVAL;
if ((u.acc.acc_accl > DN_MAXACCL) ||
(u.acc.acc_passl > DN_MAXACCL) ||
(u.acc.acc_userl > DN_MAXACCL))
return -EINVAL;
memcpy(&scp->accessdata, &u.acc, optlen);
break;
case DSO_ACCEPTMODE:
if (sock->state == SS_CONNECTED)
return -EISCONN;
if (scp->state != DN_O)
return -EINVAL;
if (optlen != sizeof(int))
return -EINVAL;
if ((u.mode != ACC_IMMED) && (u.mode != ACC_DEFER))
return -EINVAL;
scp->accept_mode = (unsigned char)u.mode;
break;
case DSO_CONACCEPT:
if (scp->state != DN_CR)
return -EINVAL;
timeo = sock_rcvtimeo(sk, 0);
err = dn_confirm_accept(sk, &timeo, sk->sk_allocation);
return err;
case DSO_CONREJECT:
if (scp->state != DN_CR)
return -EINVAL;
scp->state = DN_DR;
sk->sk_shutdown = SHUTDOWN_MASK;
dn_nsp_send_disc(sk, 0x38, 0, sk->sk_allocation);
break;
default:
#ifdef CONFIG_NETFILTER
return nf_setsockopt(sk, PF_DECnet, optname, optval, optlen);
#endif
case DSO_LINKINFO:
case DSO_STREAM:
case DSO_SEQPACKET:
return -ENOPROTOOPT;
case DSO_MAXWINDOW:
if (optlen != sizeof(unsigned long))
return -EINVAL;
if (u.win > NSP_MAX_WINDOW)
u.win = NSP_MAX_WINDOW;
if (u.win == 0)
return -EINVAL;
scp->max_window = u.win;
if (scp->snd_window > u.win)
scp->snd_window = u.win;
break;
case DSO_NODELAY:
if (optlen != sizeof(int))
return -EINVAL;
if (scp->nonagle == 2)
return -EINVAL;
scp->nonagle = (u.val == 0) ? 0 : 1;
/* if (scp->nonagle == 1) { Push pending frames } */
break;
case DSO_CORK:
if (optlen != sizeof(int))
return -EINVAL;
if (scp->nonagle == 1)
return -EINVAL;
scp->nonagle = (u.val == 0) ? 0 : 2;
/* if (scp->nonagle == 0) { Push pending frames } */
break;
case DSO_SERVICES:
if (optlen != sizeof(unsigned char))
return -EINVAL;
if ((u.services & ~NSP_FC_MASK) != 0x01)
return -EINVAL;
if ((u.services & NSP_FC_MASK) == NSP_FC_MASK)
return -EINVAL;
scp->services_loc = u.services;
break;
case DSO_INFO:
if (optlen != sizeof(unsigned char))
return -EINVAL;
if (u.info & 0xfc)
return -EINVAL;
scp->info_loc = u.info;
break;
}
return 0;
}
| 9,812 |
68,095 | 0 | static RList *dex_method_signature2(RBinDexObj *bin, int method_idx) {
ut32 proto_id, params_off, list_size;
char *buff = NULL;
ut8 *bufptr;
ut16 type_idx;
int i;
RList *params = r_list_newf (free);
if (!params) {
return NULL;
}
if (method_idx < 0 || method_idx >= bin->header.method_size) {
goto out_error;
}
proto_id = bin->methods[method_idx].proto_id;
if (proto_id >= bin->header.prototypes_size) {
goto out_error;
}
params_off = bin->protos[proto_id].parameters_off;
if (params_off >= bin->size) {
goto out_error;
}
if (!params_off) {
return params;
}
bufptr = bin->b->buf;
list_size = r_read_le32 (bufptr + params_off);
for (i = 0; i < list_size; i++) {
ut64 of = params_off + 4 + (i * 2);
if (of >= bin->size || of < params_off) {
break;
}
type_idx = r_read_le16 (bufptr + of);
if (type_idx >= bin->header.types_size ||
type_idx > bin->size) {
break;
}
buff = getstr (bin, bin->types[type_idx].descriptor_id);
if (!buff) {
break;
}
r_list_append (params, buff);
}
return params;
out_error:
r_list_free (params);
return NULL;
}
| 9,813 |
101,254 | 0 | void ExpectLocalOrderIsByServerId() {
ScopedDirLookup dir(syncdb_.manager(), syncdb_.name());
EXPECT_TRUE(dir.good());
ReadTransaction trans(FROM_HERE, dir);
Id null_id;
Entry low(&trans, GET_BY_ID, low_id_);
Entry mid(&trans, GET_BY_ID, mid_id_);
Entry high(&trans, GET_BY_ID, high_id_);
EXPECT_TRUE(low.good());
EXPECT_TRUE(mid.good());
EXPECT_TRUE(high.good());
EXPECT_TRUE(low.Get(PREV_ID) == null_id);
EXPECT_TRUE(mid.Get(PREV_ID) == low_id_);
EXPECT_TRUE(high.Get(PREV_ID) == mid_id_);
EXPECT_TRUE(high.Get(NEXT_ID) == null_id);
EXPECT_TRUE(mid.Get(NEXT_ID) == high_id_);
EXPECT_TRUE(low.Get(NEXT_ID) == mid_id_);
}
| 9,814 |
61,531 | 0 | static ssize_t WritePSDChannels(const PSDInfo *psd_info,
const ImageInfo *image_info,Image *image,Image *next_image,
MagickOffsetType size_offset,const MagickBooleanType separate)
{
Image
*mask;
MagickOffsetType
rows_offset;
size_t
channels,
count,
length,
offset_length;
unsigned char
*compact_pixels;
count=0;
offset_length=0;
rows_offset=0;
compact_pixels=(unsigned char *) NULL;
if (next_image->compression == RLECompression)
{
compact_pixels=AcquireCompactPixels(next_image);
if (compact_pixels == (unsigned char *) NULL)
return(0);
}
channels=1;
if (separate == MagickFalse)
{
if (next_image->storage_class != PseudoClass)
{
if (IsGrayImage(next_image,&next_image->exception) == MagickFalse)
channels=next_image->colorspace == CMYKColorspace ? 4 : 3;
if (next_image->matte != MagickFalse)
channels++;
}
rows_offset=TellBlob(image)+2;
count+=WriteCompressionStart(psd_info,image,next_image,channels);
offset_length=(next_image->rows*(psd_info->version == 1 ? 2 : 4));
}
size_offset+=2;
if (next_image->storage_class == PseudoClass)
{
length=WritePSDChannel(psd_info,image_info,image,next_image,
IndexQuantum,compact_pixels,rows_offset,separate);
if (separate != MagickFalse)
size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2;
else
rows_offset+=offset_length;
count+=length;
}
else
{
if (IsGrayImage(next_image,&next_image->exception) != MagickFalse)
{
length=WritePSDChannel(psd_info,image_info,image,next_image,
GrayQuantum,compact_pixels,rows_offset,separate);
if (separate != MagickFalse)
size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2;
else
rows_offset+=offset_length;
count+=length;
}
else
{
if (next_image->colorspace == CMYKColorspace)
(void) NegateImage(next_image,MagickFalse);
length=WritePSDChannel(psd_info,image_info,image,next_image,
RedQuantum,compact_pixels,rows_offset,separate);
if (separate != MagickFalse)
size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2;
else
rows_offset+=offset_length;
count+=length;
length=WritePSDChannel(psd_info,image_info,image,next_image,
GreenQuantum,compact_pixels,rows_offset,separate);
if (separate != MagickFalse)
size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2;
else
rows_offset+=offset_length;
count+=length;
length=WritePSDChannel(psd_info,image_info,image,next_image,
BlueQuantum,compact_pixels,rows_offset,separate);
if (separate != MagickFalse)
size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2;
else
rows_offset+=offset_length;
count+=length;
if (next_image->colorspace == CMYKColorspace)
{
length=WritePSDChannel(psd_info,image_info,image,next_image,
BlackQuantum,compact_pixels,rows_offset,separate);
if (separate != MagickFalse)
size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2;
else
rows_offset+=offset_length;
count+=length;
}
}
if (next_image->matte != MagickFalse)
{
length=WritePSDChannel(psd_info,image_info,image,next_image,
AlphaQuantum,compact_pixels,rows_offset,separate);
if (separate != MagickFalse)
size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2;
else
rows_offset+=offset_length;
count+=length;
}
}
compact_pixels=(unsigned char *) RelinquishMagickMemory(compact_pixels);
if (next_image->colorspace == CMYKColorspace)
(void) NegateImage(next_image,MagickFalse);
if (separate != MagickFalse)
{
const char
*property;
property=GetImageArtifact(next_image,"psd:opacity-mask");
if (property != (const char *) NULL)
{
mask=(Image *) GetImageRegistry(ImageRegistryType,property,
&image->exception);
if (mask != (Image *) NULL)
{
if (mask->compression == RLECompression)
{
compact_pixels=AcquireCompactPixels(mask);
if (compact_pixels == (unsigned char *) NULL)
return(0);
}
length=WritePSDChannel(psd_info,image_info,image,mask,
RedQuantum,compact_pixels,rows_offset,MagickTrue);
(void) WritePSDSize(psd_info,image,length,size_offset);
count+=length;
compact_pixels=(unsigned char *) RelinquishMagickMemory(
compact_pixels);
}
}
}
return(count);
}
| 9,815 |
147,007 | 0 | bool WebLocalFrameImpl::HasVisibleContent() const {
LayoutEmbeddedContentItem layout_item = GetFrame()->OwnerLayoutItem();
if (!layout_item.IsNull() &&
layout_item.Style()->Visibility() != EVisibility::kVisible) {
return false;
}
if (LocalFrameView* view = GetFrameView())
return view->VisibleWidth() > 0 && view->VisibleHeight() > 0;
return false;
}
| 9,816 |
130,849 | 0 | static void methodWithCallbackInterfaceAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
TestObjectV8Internal::methodWithCallbackInterfaceAndOptionalArgMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
| 9,817 |
185,741 | 1 | bool MessageLoop::DoDelayedWork(TimeTicks* next_delayed_work_time) {
if (!nestable_tasks_allowed_ ||
!SweepDelayedWorkQueueAndReturnTrueIfStillHasWork()) {
recent_time_ = *next_delayed_work_time = TimeTicks();
return false;
}
// When we "fall behind", there will be a lot of tasks in the delayed work
// queue that are ready to run. To increase efficiency when we fall behind,
// we will only call Time::Now() intermittently, and then process all tasks
// that are ready to run before calling it again. As a result, the more we
// fall behind (and have a lot of ready-to-run delayed tasks), the more
// efficient we'll be at handling the tasks.
TimeTicks next_run_time = delayed_work_queue_.top().delayed_run_time;
if (next_run_time > recent_time_) {
recent_time_ = TimeTicks::Now(); // Get a better view of Now();
if (next_run_time > recent_time_) {
*next_delayed_work_time = next_run_time;
return false;
}
}
PendingTask pending_task =
std::move(const_cast<PendingTask&>(delayed_work_queue_.top()));
delayed_work_queue_.pop();
if (SweepDelayedWorkQueueAndReturnTrueIfStillHasWork())
*next_delayed_work_time = delayed_work_queue_.top().delayed_run_time;
return DeferOrRunPendingTask(std::move(pending_task));
}
| 9,818 |
180,545 | 1 | static bool check_underflow(const struct ip6t_entry *e)
{
const struct xt_entry_target *t;
unsigned int verdict;
if (!unconditional(&e->ipv6))
return false;
t = ip6t_get_target_c(e);
if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0)
return false;
verdict = ((struct xt_standard_target *)t)->verdict;
verdict = -verdict - 1;
return verdict == NF_DROP || verdict == NF_ACCEPT;
}
| 9,819 |
26,857 | 0 | static ssize_t proc_loginuid_write(struct file * file, const char __user * buf,
size_t count, loff_t *ppos)
{
struct inode * inode = file->f_path.dentry->d_inode;
char *page, *tmp;
ssize_t length;
uid_t loginuid;
if (!capable(CAP_AUDIT_CONTROL))
return -EPERM;
rcu_read_lock();
if (current != pid_task(proc_pid(inode), PIDTYPE_PID)) {
rcu_read_unlock();
return -EPERM;
}
rcu_read_unlock();
if (count >= PAGE_SIZE)
count = PAGE_SIZE - 1;
if (*ppos != 0) {
/* No partial writes. */
return -EINVAL;
}
page = (char*)__get_free_page(GFP_TEMPORARY);
if (!page)
return -ENOMEM;
length = -EFAULT;
if (copy_from_user(page, buf, count))
goto out_free_page;
page[count] = '\0';
loginuid = simple_strtoul(page, &tmp, 10);
if (tmp == page) {
length = -EINVAL;
goto out_free_page;
}
length = audit_set_loginuid(current, loginuid);
if (likely(length == 0))
length = count;
out_free_page:
free_page((unsigned long) page);
return length;
}
| 9,820 |
21,304 | 0 | static long do_mbind(unsigned long start, unsigned long len,
unsigned short mode, unsigned short mode_flags,
nodemask_t *nmask, unsigned long flags)
{
struct vm_area_struct *vma;
struct mm_struct *mm = current->mm;
struct mempolicy *new;
unsigned long end;
int err;
LIST_HEAD(pagelist);
if (flags & ~(unsigned long)(MPOL_MF_STRICT |
MPOL_MF_MOVE | MPOL_MF_MOVE_ALL))
return -EINVAL;
if ((flags & MPOL_MF_MOVE_ALL) && !capable(CAP_SYS_NICE))
return -EPERM;
if (start & ~PAGE_MASK)
return -EINVAL;
if (mode == MPOL_DEFAULT)
flags &= ~MPOL_MF_STRICT;
len = (len + PAGE_SIZE - 1) & PAGE_MASK;
end = start + len;
if (end < start)
return -EINVAL;
if (end == start)
return 0;
new = mpol_new(mode, mode_flags, nmask);
if (IS_ERR(new))
return PTR_ERR(new);
/*
* If we are using the default policy then operation
* on discontinuous address spaces is okay after all
*/
if (!new)
flags |= MPOL_MF_DISCONTIG_OK;
pr_debug("mbind %lx-%lx mode:%d flags:%d nodes:%lx\n",
start, start + len, mode, mode_flags,
nmask ? nodes_addr(*nmask)[0] : -1);
if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) {
err = migrate_prep();
if (err)
goto mpol_out;
}
{
NODEMASK_SCRATCH(scratch);
if (scratch) {
down_write(&mm->mmap_sem);
task_lock(current);
err = mpol_set_nodemask(new, nmask, scratch);
task_unlock(current);
if (err)
up_write(&mm->mmap_sem);
} else
err = -ENOMEM;
NODEMASK_SCRATCH_FREE(scratch);
}
if (err)
goto mpol_out;
vma = check_range(mm, start, end, nmask,
flags | MPOL_MF_INVERT, &pagelist);
err = PTR_ERR(vma);
if (!IS_ERR(vma)) {
int nr_failed = 0;
err = mbind_range(mm, start, end, new);
if (!list_empty(&pagelist)) {
nr_failed = migrate_pages(&pagelist, new_vma_page,
(unsigned long)vma,
false, true);
if (nr_failed)
putback_lru_pages(&pagelist);
}
if (!err && nr_failed && (flags & MPOL_MF_STRICT))
err = -EIO;
} else
putback_lru_pages(&pagelist);
up_write(&mm->mmap_sem);
mpol_out:
mpol_put(new);
return err;
}
| 9,821 |
103,612 | 0 | ChromeContentBrowserClient::GetCryptoPasswordDelegate(
const GURL& url) {
return browser::NewCryptoModuleBlockingDialogDelegate(
browser::kCryptoModulePasswordKeygen, url.host());
}
| 9,822 |
109,830 | 0 | void Document::setVisuallyOrdered()
{
m_visuallyOrdered = true;
if (renderer())
renderer()->style()->setRTLOrdering(VisualOrder);
setNeedsStyleRecalc();
}
| 9,823 |
134,704 | 0 | void SynchronousCompositorImpl::UpdateFrameMetaData(
const cc::CompositorFrameMetadata& frame_metadata) {
RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>(
contents_->GetRenderWidgetHostView());
if (rwhv)
rwhv->SynchronousFrameMetadata(frame_metadata);
DeliverMessages();
}
| 9,824 |
178,153 | 1 | PS_SERIALIZER_DECODE_FUNC(php_binary) /* {{{ */
{
const char *p;
char *name;
const char *endptr = val + vallen;
zval *current;
int namelen;
int has_value;
php_unserialize_data_t var_hash;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
for (p = val; p < endptr; ) {
zval **tmp;
namelen = ((unsigned char)(*p)) & (~PS_BIN_UNDEF);
if (namelen < 0 || namelen > PS_BIN_MAX || (p + namelen) >= endptr) {
return FAILURE;
}
name = estrndup(p + 1, namelen);
p += namelen + 1;
if (zend_hash_find(&EG(symbol_table), name, namelen + 1, (void **) &tmp) == SUCCESS) {
if ((Z_TYPE_PP(tmp) == IS_ARRAY && Z_ARRVAL_PP(tmp) == &EG(symbol_table)) || *tmp == PS(http_session_vars)) {
efree(name);
continue;
}
}
if (has_value) {
ALLOC_INIT_ZVAL(current);
if (php_var_unserialize(¤t, (const unsigned char **) &p, (const unsigned char *) endptr, &var_hash TSRMLS_CC)) {
php_set_session_var(name, namelen, current, &var_hash TSRMLS_CC);
} else {
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
return FAILURE;
}
var_push_dtor_no_addref(&var_hash, ¤t);
}
PS_ADD_VARL(name, namelen);
efree(name);
}
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
return SUCCESS;
}
/* }}} */
| 9,825 |
94,717 | 0 | swabHorDiff32(TIFF* tif, uint8* cp0, tmsize_t cc)
{
uint32* wp = (uint32*) cp0;
tmsize_t wc = cc / 4;
if( !horDiff32(tif, cp0, cc) )
return 0;
TIFFSwabArrayOfLong(wp, wc);
return 1;
}
| 9,826 |
21,863 | 0 | int drm_connector_property_set_value(struct drm_connector *connector,
struct drm_property *property, uint64_t value)
{
int i;
for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) {
if (connector->property_ids[i] == property->base.id) {
connector->property_values[i] = value;
break;
}
}
if (i == DRM_CONNECTOR_MAX_PROPERTY)
return -EINVAL;
return 0;
}
| 9,827 |
108,466 | 0 | void AddEntries(StorageType type, UsageTracker* tracker) {
std::map<std::string, int64> host_usage;
tracker->GetCachedHostsUsage(&host_usage);
for (std::map<std::string, int64>::const_iterator iter = host_usage.begin();
iter != host_usage.end();
++iter) {
entries_.push_back(UsageInfo(iter->first, type, iter->second));
}
if (--remaining_trackers_ == 0)
CallCompleted();
}
| 9,828 |
141,332 | 0 | HTMLCollection* Document::forms() {
return EnsureCachedCollection<HTMLCollection>(kDocForms);
}
| 9,829 |
160,055 | 0 | bool BackendImpl::InitStats() {
Addr address(data_->header.stats);
int size = stats_.StorageSize();
if (!address.is_initialized()) {
FileType file_type = Addr::RequiredFileType(size);
DCHECK_NE(file_type, EXTERNAL);
int num_blocks = Addr::RequiredBlocks(size, file_type);
if (!CreateBlock(file_type, num_blocks, &address))
return false;
data_->header.stats = address.value();
return stats_.Init(NULL, 0, address);
}
if (!address.is_block_file()) {
NOTREACHED();
return false;
}
size = address.num_blocks() * address.BlockSize();
MappedFile* file = File(address);
if (!file)
return false;
std::unique_ptr<char[]> data(new char[size]);
size_t offset = address.start_block() * address.BlockSize() +
kBlockHeaderSize;
if (!file->Read(data.get(), size, offset))
return false;
if (!stats_.Init(data.get(), size, address))
return false;
if (cache_type_ == net::DISK_CACHE && ShouldReportAgain())
stats_.InitSizeHistogram();
return true;
}
| 9,830 |
79,260 | 0 | static int StreamTcpTest39 (void)
{
Flow f;
ThreadVars tv;
StreamTcpThread stt;
uint8_t payload[4];
TCPHdr tcph;
PacketQueue pq;
memset (&f, 0, sizeof(Flow));
memset(&tv, 0, sizeof (ThreadVars));
memset(&stt, 0, sizeof (StreamTcpThread));
memset(&tcph, 0, sizeof (TCPHdr));
memset(&pq,0,sizeof(PacketQueue));
Packet *p = SCMalloc(SIZE_OF_PACKET);
if (unlikely(p == NULL))
return 0;
memset(p, 0, SIZE_OF_PACKET);
FLOW_INITIALIZE(&f);
p->flow = &f;
tcph.th_win = htons(5480);
tcph.th_flags = TH_SYN;
p->tcph = &tcph;
p->flowflags = FLOW_PKT_TOSERVER;
int ret = 0;
StreamTcpUTInit(&stt.ra_ctx);
if (StreamTcpPacket(&tv, p, &stt, &pq) == -1) {
printf("failed in processing packet in StreamTcpPacket\n");
goto end;
}
p->tcph->th_ack = htonl(1);
p->tcph->th_flags = TH_SYN | TH_ACK;
p->flowflags = FLOW_PKT_TOCLIENT;
if (StreamTcpPacket(&tv, p, &stt, &pq) == -1) {
printf("failed in processing packet in StreamTcpPacket\n");
goto end;
}
p->tcph->th_ack = htonl(1);
p->tcph->th_seq = htonl(1);
p->tcph->th_flags = TH_ACK;
p->flowflags = FLOW_PKT_TOSERVER;
if (StreamTcpPacket(&tv, p, &stt, &pq) == -1) {
printf("failed in processing packet in StreamTcpPacket\n");
goto end;
}
p->tcph->th_ack = htonl(1);
p->tcph->th_seq = htonl(1);
p->tcph->th_flags = TH_PUSH | TH_ACK;
p->flowflags = FLOW_PKT_TOCLIENT;
StreamTcpCreateTestPacket(payload, 0x41, 3, 4); /*AAA*/
p->payload = payload;
p->payload_len = 3;
if (StreamTcpPacket(&tv, p, &stt, &pq) == -1) {
printf("failed in processing packet in StreamTcpPacket\n");
goto end;
}
if (((TcpSession *)(p->flow->protoctx))->server.next_seq != 4) {
printf("the server.next_seq should be 4, but it is %"PRIu32"\n",
((TcpSession *)(p->flow->protoctx))->server.next_seq);
goto end;
}
p->tcph->th_ack = htonl(4);
p->tcph->th_seq = htonl(2);
p->tcph->th_flags = TH_PUSH | TH_ACK;
p->flowflags = FLOW_PKT_TOSERVER;
StreamTcpCreateTestPacket(payload, 0x41, 3, 4); /*AAA*/
p->payload = payload;
p->payload_len = 3;
if (StreamTcpPacket(&tv, p, &stt, &pq) == -1) {
printf("failed in processing packet in StreamTcpPacket\n");
goto end;
}
/* last_ack value should be 4 as the previous sent ACK value is inside
window */
if (((TcpSession *)(p->flow->protoctx))->server.last_ack != 4) {
printf("the server.last_ack should be 4, but it is %"PRIu32"\n",
((TcpSession *)(p->flow->protoctx))->server.last_ack);
goto end;
}
p->tcph->th_seq = htonl(4);
p->tcph->th_ack = htonl(5);
p->tcph->th_flags = TH_PUSH | TH_ACK;
p->flowflags = FLOW_PKT_TOCLIENT;
StreamTcpCreateTestPacket(payload, 0x41, 3, 4); /*AAA*/
p->payload = payload;
p->payload_len = 3;
if (StreamTcpPacket(&tv, p, &stt, &pq) == -1) {
printf("failed in processing packet in StreamTcpPacket\n");
goto end;
}
/* next_seq value should be 2987 as the previous sent ACK value is inside
window */
if (((TcpSession *)(p->flow->protoctx))->server.next_seq != 7) {
printf("the server.next_seq should be 7, but it is %"PRIu32"\n",
((TcpSession *)(p->flow->protoctx))->server.next_seq);
goto end;
}
ret = 1;
end:
StreamTcpSessionClear(p->flow->protoctx);
SCFree(p);
FLOW_DESTROY(&f);
StreamTcpUTDeinit(stt.ra_ctx);
return ret;
}
| 9,831 |
86,939 | 0 | static int hex(char c)
{
char lc = tolower(c);
if (isdigit(lc))
return lc - '0';
if (isxdigit(lc))
return lc - 'a' + 10;
return -1;
}
| 9,832 |
74,706 | 0 | static int __videobuf_iolock (struct videobuf_queue* q,
struct videobuf_buffer *vb,
struct v4l2_framebuffer *fbuf)
{
int pages;
struct videbuf_vmalloc_memory *mem=vb->priv;
BUG_ON(!mem);
MAGIC_CHECK(mem->magic,MAGIC_VMAL_MEM);
pages = PAGE_ALIGN(vb->size) >> PAGE_SHIFT;
/* Currently, doesn't support V4L2_MEMORY_OVERLAY */
if ((vb->memory != V4L2_MEMORY_MMAP) &&
(vb->memory != V4L2_MEMORY_USERPTR) ) {
printk(KERN_ERR "Method currently unsupported.\n");
return -EINVAL;
}
/* FIXME: should be tested with kernel mmap mem */
mem->vmalloc=vmalloc_user (PAGE_ALIGN(vb->size));
if (NULL == mem->vmalloc) {
printk(KERN_ERR "vmalloc (%d pages) failed\n",pages);
return -ENOMEM;
}
dprintk(1,"vmalloc is at addr 0x%08lx, size=%d\n",
(unsigned long)mem->vmalloc,
pages << PAGE_SHIFT);
/* It seems that some kernel versions need to do remap *after*
the mmap() call
*/
if (mem->vma) {
int retval=remap_vmalloc_range(mem->vma, mem->vmalloc,0);
kfree(mem->vma);
mem->vma=NULL;
if (retval<0) {
dprintk(1,"mmap app bug: remap_vmalloc_range area %p error %d\n",
mem->vmalloc,retval);
return retval;
}
}
return 0;
}
| 9,833 |
69,650 | 0 | service_is_single_onion_poisoned(const rend_service_t *service)
{
char *poison_fname = NULL;
file_status_t fstatus;
/* Passing a NULL service is a bug */
if (BUG(!service)) {
return 0;
}
if (rend_service_is_ephemeral(service)) {
return 0;
}
poison_fname = rend_service_sos_poison_path(service);
fstatus = file_status(poison_fname);
tor_free(poison_fname);
/* If this fname is occupied, the hidden service has been poisoned.
* fstatus can be FN_ERROR if the service directory does not exist, in that
* case, there is obviously no private key. */
if (fstatus == FN_FILE || fstatus == FN_EMPTY) {
return 1;
}
return 0;
}
| 9,834 |
66,534 | 0 | static void __init parse_id(char *id)
{
unsigned int vendor_id = 0, device_id = 0, flags = 0, i = 0;
char *token, *name = NULL;
if ((token = strsep(&id, ":")) != NULL)
name = token;
/* name now points to a null terminated string*/
if ((token = strsep(&id, ":")) != NULL)
vendor_id = simple_strtoul(token, NULL, 16);
if ((token = strsep(&id, ":")) != NULL)
device_id = simple_strtoul(token, NULL, 16);
flags = simple_strtoul(id, NULL, 16);
pr_info("%s: new device %s, vendor ID 0x%04x, device ID 0x%04x, flags: 0x%x\n",
driver_name, name, vendor_id, device_id, flags);
if (vendor_id > 0x10000 || vendor_id == 0)
return;
if (device_id > 0x10000 || device_id == 0)
return;
for (i = 0; usb_dev_id[i].name; i++);
usb_dev_id[i].name = name;
usb_dev_id[i].vendor = vendor_id;
usb_dev_id[i].device = device_id;
usb_dev_id[i].private = flags;
pegasus_ids[i].match_flags = USB_DEVICE_ID_MATCH_DEVICE;
pegasus_ids[i].idVendor = vendor_id;
pegasus_ids[i].idProduct = device_id;
}
| 9,835 |
55,854 | 0 | struct tty_struct *alloc_tty_struct(struct tty_driver *driver, int idx)
{
struct tty_struct *tty;
tty = kzalloc(sizeof(*tty), GFP_KERNEL);
if (!tty)
return NULL;
kref_init(&tty->kref);
tty->magic = TTY_MAGIC;
tty_ldisc_init(tty);
tty->session = NULL;
tty->pgrp = NULL;
mutex_init(&tty->legacy_mutex);
mutex_init(&tty->throttle_mutex);
init_rwsem(&tty->termios_rwsem);
mutex_init(&tty->winsize_mutex);
init_ldsem(&tty->ldisc_sem);
init_waitqueue_head(&tty->write_wait);
init_waitqueue_head(&tty->read_wait);
INIT_WORK(&tty->hangup_work, do_tty_hangup);
mutex_init(&tty->atomic_write_lock);
spin_lock_init(&tty->ctrl_lock);
spin_lock_init(&tty->flow_lock);
INIT_LIST_HEAD(&tty->tty_files);
INIT_WORK(&tty->SAK_work, do_SAK_work);
tty->driver = driver;
tty->ops = driver->ops;
tty->index = idx;
tty_line_name(driver, idx, tty->name);
tty->dev = tty_get_device(tty);
return tty;
}
| 9,836 |
171,913 | 0 | void btif_hl_release_socket(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx){
btif_hl_soc_cb_t *p_scb = NULL;
btif_hl_mdl_cb_t *p_dcb = BTIF_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
BTIF_TRACE_DEBUG("%s", __FUNCTION__);
BTIF_TRACE_DEBUG("app_idx=%d mcl_idx=%d mdl_idx=%d", app_idx, mcl_idx, mdl_idx );
if (p_dcb && p_dcb->p_scb)
{
p_scb = p_dcb->p_scb;
btif_hl_set_socket_state(p_scb, BTIF_HL_SOC_STATE_W4_REL);
p_dcb->p_scb = NULL;
btif_hl_select_close_connected();
}
}
| 9,837 |
146,359 | 0 | void WebGLRenderingContextBase::RestoreEvictedContext(
WebGLRenderingContextBase* context) {
DCHECK(!ForciblyEvictedContexts().Contains(context));
DCHECK(!ActiveContexts().Contains(context));
unsigned max_gl_contexts = CurrentMaxGLContexts();
while (ActiveContexts().size() < max_gl_contexts &&
ForciblyEvictedContexts().size()) {
WebGLRenderingContextBase* evicted_context = OldestEvictedContext();
if (!evicted_context->restore_allowed_) {
ForciblyEvictedContexts().erase(evicted_context);
continue;
}
IntSize desired_size = DrawingBuffer::AdjustSize(
evicted_context->ClampedCanvasSize(), IntSize(),
evicted_context->max_texture_size_);
if (!desired_size.IsEmpty()) {
ForciblyEvictedContexts().erase(evicted_context);
evicted_context->ForceRestoreContext();
}
break;
}
}
| 9,838 |
147,796 | 0 | void V8TestObject::RuntimeCallStatsCounterAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
RUNTIME_CALL_TIMER_SCOPE(info.GetIsolate(), RuntimeCallStats::CounterId::kRuntimeCallStatsCounterAttribute_Getter);
test_object_v8_internal::RuntimeCallStatsCounterAttributeAttributeGetter(info);
}
| 9,839 |
102,006 | 0 | PrintingContext::Result PrintingContextCairo::NewDocument(
const string16& document_name) {
DCHECK(!in_print_job_);
in_print_job_ = true;
#if !defined(OS_CHROMEOS)
document_name_ = document_name;
#endif // !defined(OS_CHROMEOS)
return OK;
}
| 9,840 |
127,289 | 0 | void addResource(const char* url, const char* mime, PassRefPtr<SharedBuffer> data)
{
SerializedResource resource(toKURL(url), mime, data);
m_resources.append(resource);
}
| 9,841 |
115,733 | 0 | ConnectionToClient::ConnectionToClient(base::MessageLoopProxy* message_loop,
protocol::Session* session)
: message_loop_(message_loop),
handler_(NULL),
host_stub_(NULL),
input_stub_(NULL),
session_(session),
control_connected_(false),
input_connected_(false),
video_connected_(false) {
DCHECK(message_loop_);
session_->SetStateChangeCallback(
base::Bind(&ConnectionToClient::OnSessionStateChange,
base::Unretained(this)));
}
| 9,842 |
131,391 | 0 | static void floatArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
TestObjectPythonV8Internal::floatArrayAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
| 9,843 |
99,917 | 0 | void NPN_PluginThreadAsyncCall(NPP id,
void (*func)(void*),
void* user_data) {
scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id);
if (plugin)
plugin->PluginThreadAsyncCall(func, user_data);
}
| 9,844 |
93,244 | 0 | ikev2_sa_print(netdissect_options *ndo, u_char tpay,
const struct isakmp_gen *ext1,
u_int osa_length, const u_char *ep,
uint32_t phase _U_, uint32_t doi _U_,
uint32_t proto _U_, int depth)
{
const struct isakmp_gen *ext;
struct isakmp_gen e;
u_int sa_length;
const u_char *cp;
int i;
int pcount;
u_char np;
u_int item_len;
ND_TCHECK(*ext1);
UNALIGNED_MEMCPY(&e, ext1, sizeof(e));
ikev2_pay_print(ndo, "sa", e.critical);
/*
* ikev2_sub0_print() guarantees that this is >= 4.
*/
osa_length= ntohs(e.len);
sa_length = osa_length - 4;
ND_PRINT((ndo," len=%d", sa_length));
/*
* Print the payloads.
*/
cp = (const u_char *)(ext1 + 1);
pcount = 0;
for (np = ISAKMP_NPTYPE_P; np != 0; np = e.np) {
pcount++;
ext = (const struct isakmp_gen *)cp;
if (sa_length < sizeof(*ext))
goto toolong;
ND_TCHECK(*ext);
UNALIGNED_MEMCPY(&e, ext, sizeof(e));
/*
* Since we can't have a payload length of less than 4 bytes,
* we need to bail out here if the generic header is nonsensical
* or truncated, otherwise we could loop forever processing
* zero-length items or otherwise misdissect the packet.
*/
item_len = ntohs(e.len);
if (item_len <= 4)
goto trunc;
if (sa_length < item_len)
goto toolong;
ND_TCHECK2(*cp, item_len);
depth++;
ND_PRINT((ndo,"\n"));
for (i = 0; i < depth; i++)
ND_PRINT((ndo," "));
ND_PRINT((ndo,"("));
if (np == ISAKMP_NPTYPE_P) {
cp = ikev2_p_print(ndo, np, pcount, ext, item_len,
ep, depth);
if (cp == NULL) {
/* error, already reported */
return NULL;
}
} else {
ND_PRINT((ndo, "%s", NPSTR(np)));
cp += item_len;
}
ND_PRINT((ndo,")"));
depth--;
sa_length -= item_len;
}
return cp;
toolong:
/*
* Skip the rest of the SA.
*/
cp += sa_length;
ND_PRINT((ndo," [|%s]", NPSTR(tpay)));
return cp;
trunc:
ND_PRINT((ndo," [|%s]", NPSTR(tpay)));
return NULL;
}
| 9,845 |
46,343 | 0 | static void gfs2_size_hint(struct file *filep, loff_t offset, size_t size)
{
struct inode *inode = file_inode(filep);
struct gfs2_sbd *sdp = GFS2_SB(inode);
struct gfs2_inode *ip = GFS2_I(inode);
size_t blks = (size + sdp->sd_sb.sb_bsize - 1) >> sdp->sd_sb.sb_bsize_shift;
int hint = min_t(size_t, INT_MAX, blks);
atomic_set(&ip->i_res->rs_sizehint, hint);
}
| 9,846 |
109,050 | 0 | void RenderViewImpl::UpdateTitle(WebFrame* frame,
const string16& title,
WebTextDirection title_direction) {
if (frame->parent())
return;
string16 shortened_title = title.substr(0, content::kMaxTitleChars);
Send(new ViewHostMsg_UpdateTitle(routing_id_, page_id_, shortened_title,
title_direction));
}
| 9,847 |
114,968 | 0 | void TestingAutomationProvider::HandleInspectElementRequest(
int handle, int x, int y, IPC::Message* reply_message) {
WebContents* web_contents = GetWebContentsForHandle(handle, NULL);
if (web_contents) {
DCHECK(!reply_message_);
reply_message_ = reply_message;
DevToolsWindow::InspectElement(web_contents->GetRenderViewHost(), x, y);
} else {
AutomationMsg_InspectElement::WriteReplyParams(reply_message, -1);
Send(reply_message);
}
}
| 9,848 |
8,610 | 0 | static inline uint32_t vmsvga_fifo_read_raw(struct vmsvga_state_s *s)
{
uint32_t cmd = s->fifo[s->fifo_stop >> 2];
s->fifo_stop += 4;
if (s->fifo_stop >= s->fifo_max) {
s->fifo_stop = s->fifo_min;
}
s->fifo[SVGA_FIFO_STOP] = cpu_to_le32(s->fifo_stop);
return cmd;
}
| 9,849 |
122,783 | 0 | void GpuProcessHost::AddFilter(IPC::ChannelProxy::MessageFilter* filter) {
DCHECK(CalledOnValidThread());
process_->GetHost()->AddFilter(filter);
}
| 9,850 |
151,662 | 0 | Browser::CreateParams Browser::CreateParams::CreateForApp(
const std::string& app_name,
bool trusted_source,
const gfx::Rect& window_bounds,
Profile* profile) {
DCHECK(!app_name.empty());
CreateParams params(TYPE_POPUP, profile);
params.app_name = app_name;
params.trusted_source = trusted_source;
params.initial_bounds = window_bounds;
return params;
}
| 9,851 |
88,049 | 0 | static void __net_exit genl_pernet_exit(struct net *net)
{
netlink_kernel_release(net->genl_sock);
net->genl_sock = NULL;
}
| 9,852 |
115,337 | 0 | static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
{
if (!WKFrameIsMainFrame(frame))
return;
webkitWebViewLoadChanged(WEBKIT_WEB_VIEW(clientInfo), WEBKIT_LOAD_FINISHED);
}
| 9,853 |
53,033 | 0 | static int bpf_fill_super(struct super_block *sb, void *data, int silent)
{
static struct tree_descr bpf_rfiles[] = { { "" } };
struct inode *inode;
int ret;
ret = simple_fill_super(sb, BPF_FS_MAGIC, bpf_rfiles);
if (ret)
return ret;
sb->s_op = &bpf_super_ops;
inode = sb->s_root->d_inode;
inode->i_op = &bpf_dir_iops;
inode->i_mode &= ~S_IALLUGO;
inode->i_mode |= S_ISVTX | S_IRWXUGO;
return 0;
}
| 9,854 |
104,619 | 0 | Extension::Type Extension::GetType() const {
if (is_theme())
return TYPE_THEME;
if (converted_from_user_script())
return TYPE_USER_SCRIPT;
if (is_hosted_app())
return TYPE_HOSTED_APP;
if (is_packaged_app())
return TYPE_PACKAGED_APP;
return TYPE_EXTENSION;
}
| 9,855 |
113,695 | 0 | SSLErrorInfo::ErrorType SSLErrorInfo::NetErrorToErrorType(int net_error) {
switch (net_error) {
case net::ERR_CERT_COMMON_NAME_INVALID:
return CERT_COMMON_NAME_INVALID;
case net::ERR_CERT_DATE_INVALID:
return CERT_DATE_INVALID;
case net::ERR_CERT_AUTHORITY_INVALID:
return CERT_AUTHORITY_INVALID;
case net::ERR_CERT_CONTAINS_ERRORS:
return CERT_CONTAINS_ERRORS;
case net::ERR_CERT_NO_REVOCATION_MECHANISM:
return CERT_NO_REVOCATION_MECHANISM;
case net::ERR_CERT_UNABLE_TO_CHECK_REVOCATION:
return CERT_UNABLE_TO_CHECK_REVOCATION;
case net::ERR_CERT_REVOKED:
return CERT_REVOKED;
case net::ERR_CERT_INVALID:
return CERT_INVALID;
case net::ERR_CERT_WEAK_SIGNATURE_ALGORITHM:
return CERT_WEAK_SIGNATURE_ALGORITHM;
case net::ERR_CERT_WEAK_KEY:
return CERT_WEAK_KEY;
default:
NOTREACHED();
return UNKNOWN;
}
}
| 9,856 |
80,295 | 0 | GF_Err npck_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_NPCKBox *ptr = (GF_NPCKBox *)s;
if (ptr == NULL) return GF_BAD_PARAM;
e = gf_isom_box_write_header(s, bs);
if (e) return e;
gf_bs_write_u32(bs, ptr->nbPackets);
return GF_OK;
}
| 9,857 |
156,281 | 0 | const char* RendererSchedulerImpl::UseCaseToString(UseCase use_case) {
switch (use_case) {
case UseCase::kNone:
return "none";
case UseCase::kCompositorGesture:
return "compositor_gesture";
case UseCase::kMainThreadCustomInputHandling:
return "main_thread_custom_input_handling";
case UseCase::kSynchronizedGesture:
return "synchronized_gesture";
case UseCase::kTouchstart:
return "touchstart";
case UseCase::kLoading:
return "loading";
case UseCase::kMainThreadGesture:
return "main_thread_gesture";
default:
NOTREACHED();
return nullptr;
}
}
| 9,858 |
164,321 | 0 | void TabsDetectLanguageFunction::GotLanguage(const std::string& language) {
Respond(OneArgument(std::make_unique<base::Value>(language)));
Release(); // Balanced in Run()
}
| 9,859 |
159,806 | 0 | bool XSSAuditor::FilterObjectToken(const FilterTokenRequest& request) {
DCHECK_EQ(request.token.GetType(), HTMLToken::kStartTag);
DCHECK(HasName(request.token, objectTag));
bool did_block_script = false;
if (IsContainedInRequest(CanonicalizedSnippetForTagName(request))) {
did_block_script |= EraseAttributeIfInjected(
request, dataAttr, BlankURL().GetString(), kSrcLikeAttributeTruncation);
did_block_script |= EraseAttributeIfInjected(request, typeAttr);
did_block_script |= EraseAttributeIfInjected(request, classidAttr);
}
return did_block_script;
}
| 9,860 |
79,617 | 0 | void imap_cachepath(struct ImapData *idata, const char *mailbox, char *dest, size_t dlen)
{
char *s = NULL;
const char *p = mailbox;
for (s = dest; p && *p && dlen; dlen--)
{
if (*p == idata->delim)
{
*s = '/';
/* simple way to avoid collisions with UIDs */
if (*(p + 1) >= '0' && *(p + 1) <= '9')
{
if (--dlen)
*++s = '_';
}
}
else
*s = *p;
p++;
s++;
}
*s = '\0';
}
| 9,861 |
9,368 | 0 | void dtls1_hm_fragment_free(hm_fragment *frag)
{
if (!frag)
return;
if (frag->msg_header.is_ccs) {
EVP_CIPHER_CTX_free(frag->msg_header.
saved_retransmit_state.enc_write_ctx);
EVP_MD_CTX_free(frag->msg_header.saved_retransmit_state.write_hash);
}
OPENSSL_free(frag->fragment);
OPENSSL_free(frag->reassembly);
OPENSSL_free(frag);
}
| 9,862 |
22,200 | 0 | struct sock *rose_find_socket(unsigned int lci, struct rose_neigh *neigh)
{
struct sock *s;
struct hlist_node *node;
spin_lock_bh(&rose_list_lock);
sk_for_each(s, node, &rose_list) {
struct rose_sock *rose = rose_sk(s);
if (rose->lci == lci && rose->neighbour == neigh)
goto found;
}
s = NULL;
found:
spin_unlock_bh(&rose_list_lock);
return s;
}
| 9,863 |
23,519 | 0 | xdr_decode_word(struct xdr_buf *buf, unsigned int base, u32 *obj)
{
__be32 raw;
int status;
status = read_bytes_from_xdr_buf(buf, base, &raw, sizeof(*obj));
if (status)
return status;
*obj = be32_to_cpu(raw);
return 0;
}
| 9,864 |
131,998 | 0 | static void voidMethodXPathNSResolverArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
TestObjectPythonV8Internal::voidMethodXPathNSResolverArgMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
| 9,865 |
71,714 | 0 | static MagickBooleanType IsPoint(const char *point)
{
char
*p;
ssize_t
value;
value=strtol(point,&p,10);
(void) value;
return(p != point ? MagickTrue : MagickFalse);
}
| 9,866 |
134,529 | 0 | void WebContentsViewAura::OverscrollUpdateForWebContentsDelegate(int delta_y) {
if (web_contents_->GetDelegate() && IsScrollEndEffectEnabled())
web_contents_->GetDelegate()->OverscrollUpdate(delta_y);
}
| 9,867 |
136,271 | 0 | void BlockPainter::PaintAllChildPhasesAtomically(
const LayoutBox& child,
const PaintInfo& paint_info,
const LayoutPoint& paint_offset) {
LayoutPoint child_point =
layout_block_.FlipForWritingModeForChildForPaint(&child, paint_offset);
if (!child.HasSelfPaintingLayer() && !child.IsFloating())
ObjectPainter(child).PaintAllPhasesAtomically(paint_info, child_point);
}
| 9,868 |
93,752 | 0 | virConnectGetAllDomainStats(virConnectPtr conn,
unsigned int stats,
virDomainStatsRecordPtr **retStats,
unsigned int flags)
{
int ret = -1;
VIR_DEBUG("conn=%p, stats=0x%x, retStats=%p, flags=0x%x",
conn, stats, retStats, flags);
virResetLastError();
virCheckConnectReturn(conn, -1);
virCheckNonNullArgGoto(retStats, cleanup);
if (!conn->driver->connectGetAllDomainStats) {
virReportUnsupportedError();
goto cleanup;
}
ret = conn->driver->connectGetAllDomainStats(conn, NULL, 0, stats,
retStats, flags);
cleanup:
if (ret < 0)
virDispatchError(conn);
return ret;
}
| 9,869 |
151,444 | 0 | void FrameFetchContext::PopulateResourceRequest(
Resource::Type type,
const ClientHintsPreferences& hints_preferences,
const FetchParameters::ResourceWidth& resource_width,
ResourceRequest& request) {
ModifyRequestForCSP(request);
AddClientHintsIfNecessary(hints_preferences, resource_width, request);
AddCSPHeaderIfNecessary(type, request);
}
| 9,870 |
79,586 | 0 | int imap_create_mailbox(struct ImapData *idata, char *mailbox)
{
char buf[LONG_STRING], mbox[LONG_STRING];
imap_munge_mbox_name(idata, mbox, sizeof(mbox), mailbox);
snprintf(buf, sizeof(buf), "CREATE %s", mbox);
if (imap_exec(idata, buf, 0) != 0)
{
mutt_error(_("CREATE failed: %s"), imap_cmd_trailer(idata));
return -1;
}
return 0;
}
| 9,871 |
28,810 | 0 | static void drop_user_return_notifiers(void *ignore)
{
unsigned int cpu = smp_processor_id();
struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu);
if (smsr->registered)
kvm_on_user_return(&smsr->urn);
}
| 9,872 |
81,633 | 0 | check_password(const char *method,
const char *ha1,
const char *uri,
const char *nonce,
const char *nc,
const char *cnonce,
const char *qop,
const char *response)
{
char ha2[32 + 1], expected_response[32 + 1];
/* Some of the parameters may be NULL */
if ((method == NULL) || (nonce == NULL) || (nc == NULL) || (cnonce == NULL)
|| (qop == NULL) || (response == NULL)) {
return 0;
}
/* NOTE(lsm): due to a bug in MSIE, we do not compare the URI */
if (strlen(response) != 32) {
return 0;
}
mg_md5(ha2, method, ":", uri, NULL);
mg_md5(expected_response,
ha1,
":",
nonce,
":",
nc,
":",
cnonce,
":",
qop,
":",
ha2,
NULL);
return mg_strcasecmp(response, expected_response) == 0;
}
| 9,873 |
122,346 | 0 | void HTMLInputElement::setHeight(unsigned height)
{
setUnsignedIntegralAttribute(heightAttr, height);
}
| 9,874 |
128,543 | 0 | pp::URLLoader Instance::CreateURLLoaderInternal() {
pp::URLLoader loader(this);
const PPB_URLLoaderTrusted* trusted_interface =
reinterpret_cast<const PPB_URLLoaderTrusted*>(
pp::Module::Get()->GetBrowserInterface(
PPB_URLLOADERTRUSTED_INTERFACE));
if (trusted_interface)
trusted_interface->GrantUniversalAccess(loader.pp_resource());
return loader;
}
| 9,875 |
11,321 | 0 | frobnicate_signal_handler (DBusGProxy *proxy,
int val,
void *user_data)
{
n_times_frobnicate_received += 1;
g_assert (val == 42);
g_print ("Got Frobnicate signal\n");
g_main_loop_quit (loop);
g_source_remove (exit_timeout);
}
| 9,876 |
120,597 | 0 | bool Element::rareDataStyleAffectedByEmpty() const
{
ASSERT(hasRareData());
return elementRareData()->styleAffectedByEmpty();
}
| 9,877 |
137,509 | 0 | void ComputeWebKitPrintParamsInDesiredDpi(
const PrintMsg_Print_Params& print_params,
blink::WebPrintParams* webkit_print_params) {
int dpi = GetDPI(&print_params);
webkit_print_params->printerDPI = dpi;
webkit_print_params->printScalingOption = print_params.print_scaling_option;
webkit_print_params->printContentArea.width = ConvertUnit(
print_params.content_size.width(), dpi, print_params.desired_dpi);
webkit_print_params->printContentArea.height = ConvertUnit(
print_params.content_size.height(), dpi, print_params.desired_dpi);
webkit_print_params->printableArea.x = ConvertUnit(
print_params.printable_area.x(), dpi, print_params.desired_dpi);
webkit_print_params->printableArea.y = ConvertUnit(
print_params.printable_area.y(), dpi, print_params.desired_dpi);
webkit_print_params->printableArea.width = ConvertUnit(
print_params.printable_area.width(), dpi, print_params.desired_dpi);
webkit_print_params->printableArea.height = ConvertUnit(
print_params.printable_area.height(), dpi, print_params.desired_dpi);
webkit_print_params->paperSize.width = ConvertUnit(
print_params.page_size.width(), dpi, print_params.desired_dpi);
webkit_print_params->paperSize.height = ConvertUnit(
print_params.page_size.height(), dpi, print_params.desired_dpi);
}
| 9,878 |
77,300 | 0 | ofproto_class_register(const struct ofproto_class *new_class)
{
size_t i;
for (i = 0; i < n_ofproto_classes; i++) {
if (ofproto_classes[i] == new_class) {
return EEXIST;
}
}
if (n_ofproto_classes >= allocated_ofproto_classes) {
ofproto_classes = x2nrealloc(ofproto_classes,
&allocated_ofproto_classes,
sizeof *ofproto_classes);
}
ofproto_classes[n_ofproto_classes++] = new_class;
return 0;
}
| 9,879 |
96,498 | 0 | static void AppLayerProtoDetectProbingParserElementAppend(AppLayerProtoDetectProbingParserElement **head_pe,
AppLayerProtoDetectProbingParserElement *new_pe)
{
SCEnter();
if (*head_pe == NULL) {
*head_pe = new_pe;
goto end;
}
if ((*head_pe)->port == 0) {
if (new_pe->port != 0) {
new_pe->next = *head_pe;
*head_pe = new_pe;
} else {
AppLayerProtoDetectProbingParserElement *temp_pe = *head_pe;
while (temp_pe->next != NULL)
temp_pe = temp_pe->next;
temp_pe->next = new_pe;
}
} else {
AppLayerProtoDetectProbingParserElement *temp_pe = *head_pe;
if (new_pe->port == 0) {
while (temp_pe->next != NULL)
temp_pe = temp_pe->next;
temp_pe->next = new_pe;
} else {
while (temp_pe->next != NULL && temp_pe->next->port != 0)
temp_pe = temp_pe->next;
new_pe->next = temp_pe->next;
temp_pe->next = new_pe;
}
}
end:
SCReturn;
}
| 9,880 |
27,697 | 0 | static inline int ebt_make_matchname(const struct ebt_entry_match *m,
const char *base, char __user *ubase)
{
char __user *hlp = ubase + ((char *)m - base);
if (copy_to_user(hlp, m->u.match->name, EBT_FUNCTION_MAXNAMELEN))
return -EFAULT;
return 0;
}
| 9,881 |
69,521 | 0 | int rxrpc_server_keyring(struct rxrpc_sock *rx, char __user *optval,
int optlen)
{
struct key *key;
char *description;
_enter("");
if (optlen <= 0 || optlen > PAGE_SIZE - 1)
return -EINVAL;
description = kmalloc(optlen + 1, GFP_KERNEL);
if (!description)
return -ENOMEM;
if (copy_from_user(description, optval, optlen)) {
kfree(description);
return -EFAULT;
}
description[optlen] = 0;
key = request_key(&key_type_keyring, description, NULL);
if (IS_ERR(key)) {
kfree(description);
_leave(" = %ld", PTR_ERR(key));
return PTR_ERR(key);
}
rx->securities = key;
kfree(description);
_leave(" = 0 [key %x]", key->serial);
return 0;
}
| 9,882 |
156,268 | 0 | void RendererSchedulerImpl::SetVirtualTimeStopped(bool virtual_time_stopped) {
if (main_thread_only().virtual_time_stopped == virtual_time_stopped)
return;
main_thread_only().virtual_time_stopped = virtual_time_stopped;
if (!main_thread_only().use_virtual_time)
return;
virtual_time_domain_->SetCanAdvanceVirtualTime(!virtual_time_stopped);
if (virtual_time_stopped) {
VirtualTimePaused();
} else {
VirtualTimeResumed();
}
}
| 9,883 |
472 | 0 | static void pdf_run_BT(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->tos.tm = fz_identity;
pr->tos.tlm = fz_identity;
}
| 9,884 |
138,326 | 0 | void fillRelationships(AXObject& axObject,
protocol::Array<AXProperty>& properties) {
AXObject::AXObjectVector results;
axObject.ariaDescribedbyElements(results);
if (!results.isEmpty())
properties.addItem(
createRelatedNodeListProperty(AXRelationshipAttributesEnum::Describedby,
results, aria_describedbyAttr, axObject));
results.clear();
axObject.ariaOwnsElements(results);
if (!results.isEmpty())
properties.addItem(createRelatedNodeListProperty(
AXRelationshipAttributesEnum::Owns, results, aria_ownsAttr, axObject));
results.clear();
}
| 9,885 |
144,493 | 0 | void WebContentsImpl::EnableTreeOnlyAccessibilityMode() {
if (GetAccessibilityMode() != AccessibilityModeOff) {
for (RenderFrameHost* rfh : GetAllFrames())
ResetAccessibility(rfh);
} else {
AddAccessibilityMode(AccessibilityModeTreeOnly);
}
}
| 9,886 |
179,523 | 1 | int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot)
{
gfn_t gfn, end_gfn;
pfn_t pfn;
int r = 0;
struct iommu_domain *domain = kvm->arch.iommu_domain;
int flags;
/* check if iommu exists and in use */
if (!domain)
return 0;
gfn = slot->base_gfn;
end_gfn = gfn + slot->npages;
flags = IOMMU_READ;
if (!(slot->flags & KVM_MEM_READONLY))
flags |= IOMMU_WRITE;
if (!kvm->arch.iommu_noncoherent)
flags |= IOMMU_CACHE;
while (gfn < end_gfn) {
unsigned long page_size;
/* Check if already mapped */
if (iommu_iova_to_phys(domain, gfn_to_gpa(gfn))) {
gfn += 1;
continue;
}
/* Get the page size we could use to map */
page_size = kvm_host_page_size(kvm, gfn);
/* Make sure the page_size does not exceed the memslot */
while ((gfn + (page_size >> PAGE_SHIFT)) > end_gfn)
page_size >>= 1;
/* Make sure gfn is aligned to the page size we want to map */
while ((gfn << PAGE_SHIFT) & (page_size - 1))
page_size >>= 1;
/* Make sure hva is aligned to the page size we want to map */
while (__gfn_to_hva_memslot(slot, gfn) & (page_size - 1))
page_size >>= 1;
/*
* Pin all pages we are about to map in memory. This is
* important because we unmap and unpin in 4kb steps later.
*/
pfn = kvm_pin_pages(slot, gfn, page_size);
if (is_error_noslot_pfn(pfn)) {
gfn += 1;
continue;
}
/* Map into IO address space */
r = iommu_map(domain, gfn_to_gpa(gfn), pfn_to_hpa(pfn),
page_size, flags);
if (r) {
printk(KERN_ERR "kvm_iommu_map_address:"
"iommu failed to map pfn=%llx\n", pfn);
goto unmap_pages;
}
gfn += page_size >> PAGE_SHIFT;
}
return 0;
unmap_pages:
kvm_iommu_put_pages(kvm, slot->base_gfn, gfn);
return r;
}
| 9,887 |
1,681 | 0 | gx_dc_pattern_read_trans_buff(gx_color_tile *ptile, int64_t offset,
const byte *data, uint size, gs_memory_t *mem)
{
const byte *dp = data;
int left = size;
int64_t offset1 = offset;
gx_pattern_trans_t *trans_pat = ptile->ttrans;
int data_size;
data_size = trans_pat->planestride * trans_pat->n_chan;
if (trans_pat->has_tags)
data_size += trans_pat->planestride;
/* Allocate the bytes */
if (trans_pat->transbytes == NULL){
trans_pat->transbytes = gs_alloc_bytes(mem, data_size, "gx_dc_pattern_read_raster");
trans_pat->mem = mem;
if (trans_pat->transbytes == NULL)
return_error(gs_error_VMerror);
}
/* Read transparency buffer */
if (offset1 <= sizeof(gx_dc_serialized_tile_t) + sizeof(tile_trans_clist_info_t) + data_size ) {
int u = min(data_size, left);
byte *save = trans_pat->transbytes;
memcpy( trans_pat->transbytes + offset1 - sizeof(gx_dc_serialized_tile_t) -
sizeof(tile_trans_clist_info_t), dp, u);
trans_pat->transbytes = save;
left -= u;
}
return size - left;
}
| 9,888 |
124,548 | 0 | void RenderBlock::fitBorderToLinesIfNeeded()
{
if (style()->borderFit() == BorderFitBorder || hasOverrideWidth())
return;
LayoutUnit left = LayoutUnit::max();
LayoutUnit right = LayoutUnit::min();
LayoutUnit oldWidth = contentWidth();
adjustForBorderFit(0, left, right);
LayoutUnit leftEdge = borderLeft() + paddingLeft();
LayoutUnit rightEdge = leftEdge + oldWidth;
left = min(rightEdge, max(leftEdge, left));
right = max(left, min(rightEdge, right));
LayoutUnit newContentWidth = right - left;
if (newContentWidth == oldWidth)
return;
setOverrideLogicalContentWidth(newContentWidth);
layoutBlock(false);
clearOverrideLogicalContentWidth();
}
| 9,889 |
8,273 | 0 | XRenderDepthCheckErrorHandler (Display *dpy, XErrorEvent *evt)
{
if (evt->request_code == X_CreatePixmap && evt->error_code == BadValue)
{
DepthCheckPtr d;
_XLockMutex(_Xglobal_lock);
for (d = depthChecks; d; d = d->next)
if (d->dpy == dpy)
{
if ((long) (evt->serial - d->serial) >= 0)
d->missing |= DEPTH_MASK(evt->resourceid);
break;
}
_XUnlockMutex (_Xglobal_lock);
}
return 0;
}
| 9,890 |
121,439 | 0 | bool DevToolsWindow::NeedsToInterceptBeforeUnload(
content::WebContents* contents) {
DevToolsWindow* window =
DevToolsWindow::GetInstanceForInspectedRenderViewHost(
contents->GetRenderViewHost());
return window && !window->intercepted_page_beforeunload_;
}
| 9,891 |
3,939 | 0 | short CCITTFaxStream::getBlackCode() {
short code;
const CCITTCode *p;
int n;
code = 0; // make gcc happy
if (endOfBlock) {
code = lookBits(13);
if (code == EOF) {
return 1;
}
if ((code >> 7) == 0) {
p = &blackTab1[code];
} else if ((code >> 9) == 0 && (code >> 7) != 0) {
p = &blackTab2[(code >> 1) - 64];
} else {
p = &blackTab3[code >> 7];
}
if (p->bits > 0) {
eatBits(p->bits);
return p->n;
}
} else {
for (n = 2; n <= 6; ++n) {
code = lookBits(n);
if (code == EOF) {
return 1;
}
if (n < 6) {
code <<= 6 - n;
}
p = &blackTab3[code];
if (p->bits == n) {
eatBits(n);
return p->n;
}
}
for (n = 7; n <= 12; ++n) {
code = lookBits(n);
if (code == EOF) {
return 1;
}
if (n < 12) {
code <<= 12 - n;
}
if (code >= 64) {
p = &blackTab2[code - 64];
if (p->bits == n) {
eatBits(n);
return p->n;
}
}
}
for (n = 10; n <= 13; ++n) {
code = lookBits(n);
if (code == EOF) {
return 1;
}
if (n < 13) {
code <<= 13 - n;
}
p = &blackTab1[code];
if (p->bits == n) {
eatBits(n);
return p->n;
}
}
}
error(errSyntaxError, getPos(),
"Bad black code ({0:04x}) in CCITTFax stream", code);
eatBits(1);
return 1;
}
| 9,892 |
183,275 | 1 | static ssize_t WritePSDChannels(const PSDInfo *psd_info,
const ImageInfo *image_info,Image *image,Image *next_image,
MagickOffsetType size_offset,const MagickBooleanType separate)
{
Image
*mask;
MagickOffsetType
rows_offset;
size_t
channels,
count,
length,
offset_length;
unsigned char
*compact_pixels;
count=0;
offset_length=0;
rows_offset=0;
compact_pixels=(unsigned char *) NULL;
if (next_image->compression == RLECompression)
{
compact_pixels=AcquireCompactPixels(image);
if (compact_pixels == (unsigned char *) NULL)
return(0);
}
channels=1;
if (separate == MagickFalse)
{
if (next_image->storage_class != PseudoClass)
{
if (IsGrayImage(next_image,&next_image->exception) == MagickFalse)
channels=next_image->colorspace == CMYKColorspace ? 4 : 3;
if (next_image->matte != MagickFalse)
channels++;
}
rows_offset=TellBlob(image)+2;
count+=WriteCompressionStart(psd_info,image,next_image,channels);
offset_length=(next_image->rows*(psd_info->version == 1 ? 2 : 4));
}
size_offset+=2;
if (next_image->storage_class == PseudoClass)
{
length=WritePSDChannel(psd_info,image_info,image,next_image,
IndexQuantum,compact_pixels,rows_offset,separate);
if (separate != MagickFalse)
size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2;
else
rows_offset+=offset_length;
count+=length;
}
else
{
if (IsGrayImage(next_image,&next_image->exception) != MagickFalse)
{
length=WritePSDChannel(psd_info,image_info,image,next_image,
GrayQuantum,compact_pixels,rows_offset,separate);
if (separate != MagickFalse)
size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2;
else
rows_offset+=offset_length;
count+=length;
}
else
{
if (next_image->colorspace == CMYKColorspace)
(void) NegateImage(next_image,MagickFalse);
length=WritePSDChannel(psd_info,image_info,image,next_image,
RedQuantum,compact_pixels,rows_offset,separate);
if (separate != MagickFalse)
size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2;
else
rows_offset+=offset_length;
count+=length;
length=WritePSDChannel(psd_info,image_info,image,next_image,
GreenQuantum,compact_pixels,rows_offset,separate);
if (separate != MagickFalse)
size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2;
else
rows_offset+=offset_length;
count+=length;
length=WritePSDChannel(psd_info,image_info,image,next_image,
BlueQuantum,compact_pixels,rows_offset,separate);
if (separate != MagickFalse)
size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2;
else
rows_offset+=offset_length;
count+=length;
if (next_image->colorspace == CMYKColorspace)
{
length=WritePSDChannel(psd_info,image_info,image,next_image,
BlackQuantum,compact_pixels,rows_offset,separate);
if (separate != MagickFalse)
size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2;
else
rows_offset+=offset_length;
count+=length;
}
}
if (next_image->matte != MagickFalse)
{
length=WritePSDChannel(psd_info,image_info,image,next_image,
AlphaQuantum,compact_pixels,rows_offset,separate);
if (separate != MagickFalse)
size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2;
else
rows_offset+=offset_length;
count+=length;
}
}
compact_pixels=(unsigned char *) RelinquishMagickMemory(compact_pixels);
if (next_image->colorspace == CMYKColorspace)
(void) NegateImage(next_image,MagickFalse);
if (separate != MagickFalse)
{
const char
*property;
property=GetImageArtifact(next_image,"psd:opacity-mask");
if (property != (const char *) NULL)
{
mask=(Image *) GetImageRegistry(ImageRegistryType,property,
&image->exception);
if (mask != (Image *) NULL)
{
if (mask->compression == RLECompression)
{
compact_pixels=AcquireCompactPixels(mask);
if (compact_pixels == (unsigned char *) NULL)
return(0);
}
length=WritePSDChannel(psd_info,image_info,image,mask,
RedQuantum,compact_pixels,rows_offset,MagickTrue);
(void) WritePSDSize(psd_info,image,length,size_offset);
count+=length;
compact_pixels=(unsigned char *) RelinquishMagickMemory(
compact_pixels);
}
}
}
return(count);
}
| 9,893 |
174,452 | 0 | virtual status_t closeSession(Vector<uint8_t> const &sessionId) {
Parcel data, reply;
data.writeInterfaceToken(IDrm::getInterfaceDescriptor());
writeVector(data, sessionId);
status_t status = remote()->transact(CLOSE_SESSION, data, &reply);
if (status != OK) {
return status;
}
return reply.readInt32();
}
| 9,894 |
130,960 | 0 | static void perWorldAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
TestObjectV8Internal::perWorldAttributeAttributeSetter(jsValue, info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
| 9,895 |
75,590 | 0 | static int hwahc_op_urb_dequeue(struct usb_hcd *usb_hcd, struct urb *urb,
int status)
{
struct wusbhc *wusbhc = usb_hcd_to_wusbhc(usb_hcd);
struct hwahc *hwahc = container_of(wusbhc, struct hwahc, wusbhc);
return wa_urb_dequeue(&hwahc->wa, urb, status);
}
| 9,896 |
77,380 | 0 | ofproto_set_extra_in_band_remotes(struct ofproto *ofproto,
const struct sockaddr_in *extras, size_t n)
{
connmgr_set_extra_in_band_remotes(ofproto->connmgr, extras, n);
}
| 9,897 |
176,458 | 0 | static long getDelayMs(GraphicsControlBlock& gcb) {
return gcb.DelayTime * 10;
}
| 9,898 |
66,615 | 0 | static void remove_port_data(struct port *port)
{
struct port_buffer *buf;
spin_lock_irq(&port->inbuf_lock);
/* Remove unused data this port might have received. */
discard_port_data(port);
spin_unlock_irq(&port->inbuf_lock);
/* Remove buffers we queued up for the Host to send us data in. */
do {
spin_lock_irq(&port->inbuf_lock);
buf = virtqueue_detach_unused_buf(port->in_vq);
spin_unlock_irq(&port->inbuf_lock);
if (buf)
free_buf(buf, true);
} while (buf);
spin_lock_irq(&port->outvq_lock);
reclaim_consumed_buffers(port);
spin_unlock_irq(&port->outvq_lock);
/* Free pending buffers from the out-queue. */
do {
spin_lock_irq(&port->outvq_lock);
buf = virtqueue_detach_unused_buf(port->out_vq);
spin_unlock_irq(&port->outvq_lock);
if (buf)
free_buf(buf, true);
} while (buf);
}
| 9,899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.