idx
int64 | func
string | target
int64 |
|---|---|---|
385,903
|
static int load_dh_params(SSL_CTX *ctx, char *file)
{
DH *dh = NULL;
BIO *bio;
if (!file) return 0;
if ((bio = BIO_new_file(file, "r")) == NULL) {
ERROR(LOG_PREFIX ": Unable to open DH file - %s", file);
return -1;
}
dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
BIO_free(bio);
if (!dh) {
WARN(LOG_PREFIX ": Unable to set DH parameters. DH cipher suites may not work!");
WARN(LOG_PREFIX ": Fix this by running the OpenSSL command listed in eap.conf");
return 0;
}
if (SSL_CTX_set_tmp_dh(ctx, dh) < 0) {
ERROR(LOG_PREFIX ": Unable to set DH parameters");
DH_free(dh);
return -1;
}
DH_free(dh);
return 0;
}
| 0
|
330,419
|
static int do_packet_auto_bsf(AVFormatContext *s, AVPacket *pkt) {
AVStream *st = s->streams[pkt->stream_index];
int i, ret;
if (!(s->flags & AVFMT_FLAG_AUTO_BSF))
return 1;
if (s->oformat->check_bitstream) {
if (!st->internal->bitstream_checked) {
if ((ret = s->oformat->check_bitstream(s, pkt)) < 0)
return ret;
else if (ret == 1)
st->internal->bitstream_checked = 1;
}
}
#if FF_API_LAVF_MERGE_SD
FF_DISABLE_DEPRECATION_WARNINGS
if (st->internal->nb_bsfcs) {
ret = av_packet_split_side_data(pkt);
if (ret < 0)
av_log(s, AV_LOG_WARNING, "Failed to split side data before bitstream filter\n");
}
FF_ENABLE_DEPRECATION_WARNINGS
#endif
for (i = 0; i < st->internal->nb_bsfcs; i++) {
AVBSFContext *ctx = st->internal->bsfcs[i];
if (i > 0) {
AVBSFContext* prev_ctx = st->internal->bsfcs[i - 1];
if (prev_ctx->par_out->extradata_size != ctx->par_in->extradata_size) {
if ((ret = avcodec_parameters_copy(ctx->par_in, prev_ctx->par_out)) < 0)
return ret;
}
}
// TODO: when any bitstream filter requires flushing at EOF, we'll need to
// flush each stream's BSF chain on write_trailer.
if ((ret = av_bsf_send_packet(ctx, pkt)) < 0) {
av_log(ctx, AV_LOG_ERROR,
"Failed to send packet to filter %s for stream %d\n",
ctx->filter->name, pkt->stream_index);
return ret;
}
// TODO: when any automatically-added bitstream filter is generating multiple
// output packets for a single input one, we'll need to call this in a loop
// and write each output packet.
if ((ret = av_bsf_receive_packet(ctx, pkt)) < 0) {
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
return 0;
av_log(ctx, AV_LOG_ERROR,
"Failed to send packet to filter %s for stream %d\n",
ctx->filter->name, pkt->stream_index);
return ret;
}
if (i == st->internal->nb_bsfcs - 1) {
if (ctx->par_out->extradata_size != st->codecpar->extradata_size) {
if ((ret = avcodec_parameters_copy(st->codecpar, ctx->par_out)) < 0)
return ret;
}
}
}
return 1;
}
| 0
|
174,143
|
const AtomicString& DocumentLoader::ResponseMIMEType() const {
return response_.MimeType();
}
| 0
|
248,439
|
void LayerTreeHostImpl::AnimateInternal(bool active_tree) {
DCHECK(task_runner_provider_->IsImplThread());
base::TimeTicks monotonic_time = CurrentBeginFrameArgs().frame_time;
bool did_animate = false;
if (input_handler_client_) {
bool ignore_fling =
settings_.ignore_root_layer_flings && IsCurrentlyScrollingViewport();
if (!ignore_fling) {
input_handler_client_->Animate(monotonic_time);
}
}
did_animate |= AnimatePageScale(monotonic_time);
did_animate |= AnimateLayers(monotonic_time);
did_animate |= AnimateScrollbars(monotonic_time);
did_animate |= AnimateBrowserControls(monotonic_time);
if (active_tree) {
did_animate |= Mutate(monotonic_time);
UpdateRootLayerStateForSynchronousInputHandler();
if (did_animate) {
SetNeedsRedraw();
}
}
}
| 0
|
272,622
|
f_str2nr(typval_T *argvars, typval_T *rettv)
{
int base = 10;
char_u *p;
varnumber_T n;
int what;
int isneg;
if (argvars[1].v_type != VAR_UNKNOWN)
{
base = (int)tv_get_number(&argvars[1]);
if (base != 2 && base != 8 && base != 10 && base != 16)
{
emsg(_(e_invarg));
return;
}
}
p = skipwhite(tv_get_string(&argvars[0]));
isneg = (*p == '-');
if (*p == '+' || *p == '-')
p = skipwhite(p + 1);
switch (base)
{
case 2: what = STR2NR_BIN + STR2NR_FORCE; break;
case 8: what = STR2NR_OCT + STR2NR_FORCE; break;
case 16: what = STR2NR_HEX + STR2NR_FORCE; break;
default: what = 0;
}
vim_str2nr(p, NULL, NULL, what, &n, NULL, 0);
if (isneg)
rettv->vval.v_number = -n;
else
rettv->vval.v_number = n;
}
| 0
|
127,804
|
GF_Err dimm_Read(GF_Box *s, GF_BitStream *bs)
{
GF_DIMMBox *ptr = (GF_DIMMBox *)s;
ptr->nbBytes = gf_bs_read_u64(bs);
return GF_OK;
}
| 0
|
314,909
|
WebURLLoaderImpl::WebURLLoaderImpl(WebKitPlatformSupportImpl* platform)
: context_(new Context(this)),
platform_(platform) {
}
| 0
|
259,277
|
static int get_passwd_by_systemd(const char *prompt, char *input, int capacity)
{
int fd[2];
pid_t pid;
int offs = 0;
int rc = 1;
if (pipe(fd) == -1) {
fprintf(stderr, "Failed to create pipe: %s\n", strerror(errno));
return 1;
}
pid = fork();
if (pid == -1) {
fprintf(stderr, "Unable to fork: %s\n", strerror(errno));
close(fd[0]);
close(fd[1]);
return 1;
}
if (pid == 0) {
close(fd[0]);
dup2(fd[1], STDOUT_FILENO);
if (execlp("systemd-ask-password", "systemd-ask-password", prompt, NULL) == -1) {
fprintf(stderr, "Failed to execute systemd-ask-password: %s\n",
strerror(errno));
}
exit(1);
}
close(fd[1]);
for (;;) {
if (offs+1 >= capacity) {
fprintf(stderr, "Password too long.\n");
kill(pid, SIGTERM);
rc = 1;
break;
}
rc = read(fd[0], input + offs, capacity - offs);
if (rc == -1) {
fprintf(stderr, "Failed to read from pipe: %s\n", strerror(errno));
rc = 1;
break;
}
if (!rc)
break;
offs += rc;
input[offs] = '\0';
}
if (wait(&rc) == -1) {
fprintf(stderr, "Failed to wait child: %s\n", strerror(errno));
rc = 1;
goto out;
}
if (!WIFEXITED(rc) || WEXITSTATUS(rc)) {
rc = 1;
goto out;
}
rc = 0;
out:
close(fd[0]);
return rc;
}
| 0
|
41,435
|
struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
unsigned int length, gfp_t gfp_mask)
{
struct sk_buff *skb = NULL;
unsigned int fragsz = SKB_DATA_ALIGN(length + NET_SKB_PAD) +
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
if (fragsz <= PAGE_SIZE && !(gfp_mask & (__GFP_WAIT | GFP_DMA))) {
void *data;
if (sk_memalloc_socks())
gfp_mask |= __GFP_MEMALLOC;
data = __netdev_alloc_frag(fragsz, gfp_mask);
if (likely(data)) {
skb = build_skb(data, fragsz);
if (unlikely(!skb))
put_page(virt_to_head_page(data));
}
} else {
skb = __alloc_skb(length + NET_SKB_PAD, gfp_mask,
SKB_ALLOC_RX, NUMA_NO_NODE);
}
if (likely(skb)) {
skb_reserve(skb, NET_SKB_PAD);
skb->dev = dev;
}
return skb;
}
| 0
|
502,601
|
int HevcSpsUnit::scaling_list_data()
{
for (int sizeId = 0; sizeId < 4; sizeId++)
{
for (int matrixId = 0; matrixId < 6; matrixId += (sizeId == 3) ? 3 : 1)
{
bool flag = m_reader.getBit();
if (!flag)
{
unsigned scaling_list_pred_matrix_id_delta = extractUEGolombCode();
if (scaling_list_pred_matrix_id_delta > 5)
return 1;
}
else
{
int nextCoef = 8;
int coefNum = FFMIN(64, (1 << (4 + (sizeId << 1))));
if (sizeId > 1)
{
int scaling_list_dc_coef_minus8 = extractSEGolombCode();
nextCoef = scaling_list_dc_coef_minus8 + 8;
if (nextCoef < 1 || nextCoef > 255)
return 1;
}
for (int i = 0; i < coefNum; i++)
{
int scaling_list_delta_coef = extractSEGolombCode();
if (scaling_list_delta_coef < -128 || scaling_list_delta_coef > 127)
return 1;
nextCoef = (nextCoef + scaling_list_delta_coef + 256) % 256;
// ScalingList[ sizeId ][ matrixId ][ i ] = nextCoef;
}
}
}
}
return 0;
}
| 0
|
46,829
|
int sqlite3ExprImpliesNonNullRow(Expr *p, int iTab){
Walker w;
p = sqlite3ExprSkipCollateAndLikely(p);
if( p==0 ) return 0;
if( p->op==TK_NOTNULL ){
p = p->pLeft;
}else{
while( p->op==TK_AND ){
if( sqlite3ExprImpliesNonNullRow(p->pLeft, iTab) ) return 1;
p = p->pRight;
}
}
w.xExprCallback = impliesNotNullRow;
w.xSelectCallback = 0;
w.xSelectCallback2 = 0;
w.eCode = 0;
w.u.iCur = iTab;
sqlite3WalkExpr(&w, p);
return w.eCode;
}
| 0
|
483,428
|
bool css_has_online_children(struct cgroup_subsys_state *css)
{
struct cgroup_subsys_state *child;
bool ret = false;
rcu_read_lock();
css_for_each_child(child, css) {
if (child->flags & CSS_ONLINE) {
ret = true;
break;
}
}
rcu_read_unlock();
return ret;
}
| 0
|
174,746
|
RGBGrayEncoder::~RGBGrayEncoder() {
if (str->isEncoder())
delete str;
}
| 0
|
263,044
|
static int copy_from_read_buf(struct tty_struct *tty,
unsigned char __user **b,
size_t *nr)
{
struct n_tty_data *ldata = tty->disc_data;
int retval;
size_t n;
bool is_eof;
size_t tail = ldata->read_tail & (N_TTY_BUF_SIZE - 1);
retval = 0;
n = min(read_cnt(ldata), N_TTY_BUF_SIZE - tail);
n = min(*nr, n);
if (n) {
retval = copy_to_user(*b, read_buf_addr(ldata, tail), n);
n -= retval;
is_eof = n == 1 && read_buf(ldata, tail) == EOF_CHAR(tty);
tty_audit_add_data(tty, read_buf_addr(ldata, tail), n,
ldata->icanon);
ldata->read_tail += n;
/* Turn single EOF into zero-length read */
if (L_EXTPROC(tty) && ldata->icanon && is_eof && !read_cnt(ldata))
n = 0;
*b += n;
*nr -= n;
}
return retval;
}
| 0
|
488,883
|
uint8_t avdtp_error_category(struct avdtp_error *err)
{
return err->category;
}
| 0
|
521,237
|
int Arg_comparator::compare_decimal()
{
VDec val1(*a);
if (!val1.is_null())
{
VDec val2(*b);
if (!val2.is_null())
{
if (set_null)
owner->null_value= 0;
val1.round_self_if_needed((*a)->decimals, HALF_UP);
val2.round_self_if_needed((*b)->decimals, HALF_UP);
return val1.cmp(val2);
}
}
if (set_null)
owner->null_value= 1;
return -1;
}
| 0
|
310,999
|
Browser* browser() { return browser_.get(); }
| 0
|
156,540
|
authDigestNonceLastRequest(digest_nonce_h * nonce)
{
if (!nonce)
return -1;
if (nonce->nc == 99999997) {
debugs(29, 4, "Nonce count about to overflow");
return -1;
}
if (nonce->nc >= static_cast<Auth::Digest::Config*>(Auth::Config::Find("digest"))->noncemaxuses - 1) {
debugs(29, 4, "Nonce count about to hit user limit");
return -1;
}
/* and other tests are possible. */
return 0;
}
| 0
|
97,255
|
static int __init init_f2fs_fs(void)
{
int err;
f2fs_build_trace_ios();
err = init_inodecache();
if (err)
goto fail;
err = create_node_manager_caches();
if (err)
goto free_inodecache;
err = create_segment_manager_caches();
if (err)
goto free_node_manager_caches;
err = create_checkpoint_caches();
if (err)
goto free_segment_manager_caches;
err = create_extent_cache();
if (err)
goto free_checkpoint_caches;
err = f2fs_init_sysfs();
if (err)
goto free_extent_cache;
err = register_shrinker(&f2fs_shrinker_info);
if (err)
goto free_sysfs;
err = register_filesystem(&f2fs_fs_type);
if (err)
goto free_shrinker;
err = f2fs_create_root_stats();
if (err)
goto free_filesystem;
return 0;
free_filesystem:
unregister_filesystem(&f2fs_fs_type);
free_shrinker:
unregister_shrinker(&f2fs_shrinker_info);
free_sysfs:
f2fs_exit_sysfs();
free_extent_cache:
destroy_extent_cache();
free_checkpoint_caches:
destroy_checkpoint_caches();
free_segment_manager_caches:
destroy_segment_manager_caches();
free_node_manager_caches:
destroy_node_manager_caches();
free_inodecache:
destroy_inodecache();
fail:
return err;
}
| 0
|
312,434
|
Node::InsertionNotificationRequest HTMLFormControlElement::insertedInto(ContainerNode* insertionPoint)
{
m_ancestorDisabledState = AncestorDisabledStateUnknown;
m_dataListAncestorState = Unknown;
setNeedsWillValidateCheck();
HTMLElement::insertedInto(insertionPoint);
FormAssociatedElement::insertedInto(insertionPoint);
fieldSetAncestorsSetNeedsValidityCheck(insertionPoint);
if (!formOwner() && insertionPoint->inDocument())
document().didAssociateFormControl(this);
return InsertionDone;
}
| 0
|
283,188
|
ImageResourceFactory(const FetchParameters& fetch_params)
: NonTextResourceFactory(Resource::kImage),
fetch_params_(&fetch_params) {}
| 0
|
438,190
|
bool Segment::QueueFrame(Frame* frame) {
const int32_t new_size = frames_size_ + 1;
if (new_size > frames_capacity_) {
// Add more frames.
const int32_t new_capacity = (!frames_capacity_) ? 2 : frames_capacity_ * 2;
if (new_capacity < 1)
return false;
Frame** const frames = new (std::nothrow) Frame*[new_capacity]; // NOLINT
if (!frames)
return false;
for (int32_t i = 0; i < frames_size_; ++i) {
frames[i] = frames_[i];
}
delete[] frames_;
frames_ = frames;
frames_capacity_ = new_capacity;
}
frames_[frames_size_++] = frame;
return true;
}
| 0
|
360,030
|
filesystem_info_start (NautilusDirectory *directory,
NautilusFile *file,
gboolean *doing_io)
{
GFile *location;
FilesystemInfoState *state;
if (directory->details->filesystem_info_state != NULL) {
*doing_io = TRUE;
return;
}
if (!is_needy (file,
lacks_filesystem_info,
REQUEST_FILESYSTEM_INFO)) {
return;
}
*doing_io = TRUE;
if (!async_job_start (directory, "filesystem info")) {
return;
}
state = g_new0 (FilesystemInfoState, 1);
state->directory = directory;
state->file = file;
state->cancellable = g_cancellable_new ();
location = nautilus_file_get_location (file);
directory->details->filesystem_info_state = state;
g_file_query_filesystem_info_async (location,
G_FILE_ATTRIBUTE_FILESYSTEM_READONLY ","
G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW,
G_PRIORITY_DEFAULT,
state->cancellable,
query_filesystem_info_callback,
state);
g_object_unref (location);
}
| 0
|
515,576
|
static int equal_wildcard(const unsigned char *pattern, size_t pattern_len,
const unsigned char *subject, size_t subject_len,
unsigned int flags)
{
const unsigned char *star = NULL;
/*
* Subject names starting with '.' can only match a wildcard pattern
* via a subject sub-domain pattern suffix match.
*/
if (!(subject_len > 1 && subject[0] == '.'))
star = valid_star(pattern, pattern_len, flags);
if (star == NULL)
return equal_nocase(pattern, pattern_len,
subject, subject_len, flags);
return wildcard_match(pattern, star - pattern,
star + 1, (pattern + pattern_len) - star - 1,
subject, subject_len, flags);
}
| 0
|
46,965
|
f_strtrans(typval_T *argvars, typval_T *rettv)
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = transstr(tv_get_string(&argvars[0]));
}
| 0
|
486,069
|
check_special_mountprog(const char *spec, const char *node, const char *type, int flags,
char *extra_opts, int *status) {
char search_path[] = FS_SEARCH_PATH;
char *path, mountprog[150];
struct stat statbuf;
int res;
if (!external_allowed)
return 0;
if (type == NULL || strcmp(type, "none") == 0)
return 0;
path = strtok(search_path, ":");
while (path) {
int type_opt = 0;
res = snprintf(mountprog, sizeof(mountprog), "%s/mount.%s",
path, type);
path = strtok(NULL, ":");
if (res >= sizeof(mountprog) || res < 0)
continue;
res = stat(mountprog, &statbuf);
if (res == -1 && errno == ENOENT && strchr(type, '.')) {
/* If type ends with ".subtype" try without it */
*strrchr(mountprog, '.') = '\0';
type_opt = 1;
res = stat(mountprog, &statbuf);
}
if (res)
continue;
if (verbose)
fflush(stdout);
switch (fork()) {
case 0: { /* child */
char *oo, *mountargs[12];
int i = 0;
if (setgid(getgid()) < 0)
die(EX_FAIL, _("mount: cannot set group id: %s"), strerror(errno));
if (setuid(getuid()) < 0)
die(EX_FAIL, _("mount: cannot set user id: %s"), strerror(errno));
oo = fix_opts_string (flags, extra_opts, NULL);
mountargs[i++] = mountprog; /* 1 */
mountargs[i++] = (char *) spec; /* 2 */
mountargs[i++] = (char *) node; /* 3 */
if (sloppy && strncmp(type, "nfs", 3) == 0)
mountargs[i++] = "-s"; /* 4 */
if (fake)
mountargs[i++] = "-f"; /* 5 */
if (nomtab)
mountargs[i++] = "-n"; /* 6 */
if (verbose)
mountargs[i++] = "-v"; /* 7 */
if (oo && *oo) {
mountargs[i++] = "-o"; /* 8 */
mountargs[i++] = oo; /* 9 */
}
if (type_opt) {
mountargs[i++] = "-t"; /* 10 */
mountargs[i++] = (char *) type; /* 11 */
}
mountargs[i] = NULL; /* 12 */
if (verbose > 2) {
i = 0;
while (mountargs[i]) {
printf("mount: external mount: argv[%d] = \"%s\"\n",
i, mountargs[i]);
i++;
}
fflush(stdout);
}
execv(mountprog, mountargs);
exit(1); /* exec failed */
}
default: { /* parent */
int st;
wait(&st);
*status = (WIFEXITED(st) ? WEXITSTATUS(st) : EX_SYSERR);
return 1;
}
case -1: { /* error */
int errsv = errno;
error(_("mount: cannot fork: %s"), strerror(errsv));
}
}
}
return 0;
}
| 0
|
516,044
|
save_number(const char *fmt, int number, int len)
{
size_t s_len = (size_t) len + 30 + strlen(fmt);
get_space(s_len + 1);
_nc_SPRINTF(TPS(out_buff) + TPS(out_used),
_nc_SLIMIT(TPS(out_size) - TPS(out_used))
fmt, number);
TPS(out_used) += strlen(TPS(out_buff) + TPS(out_used));
}
| 0
|
126,641
|
static int em_mov(struct x86_emulate_ctxt *ctxt)
{
memcpy(ctxt->dst.valptr, ctxt->src.valptr, sizeof(ctxt->src.valptr));
return X86EMUL_CONTINUE;
}
| 0
|
30,309
|
static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
{
HLSContext *c = s->priv_data;
int ret, i, minvariant = -1;
if (c->first_packet) {
recheck_discard_flags(s, 1);
c->first_packet = 0;
}
start:
c->end_of_segment = 0;
for (i = 0; i < c->n_variants; i++) {
struct variant *var = c->variants[i];
/* Make sure we've got one buffered packet from each open variant
* stream */
if (var->needed && !var->pkt.data) {
while (1) {
int64_t ts_diff;
AVStream *st;
ret = av_read_frame(var->ctx, &var->pkt);
if (ret < 0) {
if (!var->pb.eof_reached)
return ret;
break;
} else {
if (c->first_timestamp == AV_NOPTS_VALUE &&
var->pkt.dts != AV_NOPTS_VALUE)
c->first_timestamp = av_rescale_q(var->pkt.dts,
var->ctx->streams[var->pkt.stream_index]->time_base,
AV_TIME_BASE_Q);
}
if (c->seek_timestamp == AV_NOPTS_VALUE)
break;
if (var->pkt.dts == AV_NOPTS_VALUE) {
c->seek_timestamp = AV_NOPTS_VALUE;
break;
}
st = var->ctx->streams[var->pkt.stream_index];
ts_diff = av_rescale_rnd(var->pkt.dts, AV_TIME_BASE,
st->time_base.den, AV_ROUND_DOWN) -
c->seek_timestamp;
if (ts_diff >= 0 && (c->seek_flags & AVSEEK_FLAG_ANY ||
var->pkt.flags & AV_PKT_FLAG_KEY)) {
c->seek_timestamp = AV_NOPTS_VALUE;
break;
}
}
}
/* Check if this stream still is on an earlier segment number, or
* has the packet with the lowest dts */
if (var->pkt.data) {
struct variant *minvar = c->variants[minvariant];
if (minvariant < 0 || var->cur_seq_no < minvar->cur_seq_no) {
minvariant = i;
} else if (var->cur_seq_no == minvar->cur_seq_no) {
int64_t dts = var->pkt.dts;
int64_t mindts = minvar->pkt.dts;
AVStream *st = var->ctx->streams[var->pkt.stream_index];
AVStream *minst = minvar->ctx->streams[minvar->pkt.stream_index];
if (dts == AV_NOPTS_VALUE) {
minvariant = i;
} else if (mindts != AV_NOPTS_VALUE) {
if (st->start_time != AV_NOPTS_VALUE)
dts -= st->start_time;
if (minst->start_time != AV_NOPTS_VALUE)
mindts -= minst->start_time;
if (av_compare_ts(dts, st->time_base,
mindts, minst->time_base) < 0)
minvariant = i;
}
}
}
}
if (c->end_of_segment) {
if (recheck_discard_flags(s, 0))
goto start;
}
/* If we got a packet, return it */
if (minvariant >= 0) {
*pkt = c->variants[minvariant]->pkt;
pkt->stream_index += c->variants[minvariant]->stream_offset;
reset_packet(&c->variants[minvariant]->pkt);
return 0;
}
return AVERROR_EOF;
}
| 1
|
408,284
|
static void handler_chain(struct uprobe *uprobe, struct pt_regs *regs)
{
struct uprobe_consumer *uc;
int remove = UPROBE_HANDLER_REMOVE;
bool need_prep = false; /* prepare return uprobe, when needed */
down_read(&uprobe->register_rwsem);
for (uc = uprobe->consumers; uc; uc = uc->next) {
int rc = 0;
if (uc->handler) {
rc = uc->handler(uc, regs);
WARN(rc & ~UPROBE_HANDLER_MASK,
"bad rc=0x%x from %pf()\n", rc, uc->handler);
}
if (uc->ret_handler)
need_prep = true;
remove &= rc;
}
if (need_prep && !remove)
prepare_uretprobe(uprobe, regs); /* put bp at return */
if (remove && uprobe->consumers) {
WARN_ON(!uprobe_is_active(uprobe));
unapply_uprobe(uprobe, current->mm);
}
up_read(&uprobe->register_rwsem);
}
| 0
|
165,731
|
static bool parse_args(int argc, char **argv) {
while (1) {
int option_index = 0;
int c = getopt_long_only(argc, argv, "", long_options, &option_index);
if (c != 0)
break;
switch (c) {
case 0:
if (option_index == 0) {
if (!string_to_bdaddr(optarg, &bt_remote_bdaddr)) {
return false;
}
}
if (option_index == 1) {
discover = true;
}
if (option_index == 2) {
discoverable = true;
}
if (option_index == 3) {
timeout_in_sec = atoi(optarg);
}
if (option_index == 4) {
bond = true;
}
if (option_index == 5) {
up = true;
}
if (option_index == 6) {
f_verbose++;
}
if (option_index == 7) {
get_name = true;
}
if (option_index == 8) {
bd_name = (char *)optarg;
set_name = true;
}
if (option_index == 9) {
sco_listen = true;
}
if (option_index == 10) {
sco_connect = true;
}
break;
default:
fprintf(stderr, "?? getopt returned character code 0%o ??\n", c);
}
}
if (optind < argc) {
fprintf(stderr, "non-option ARGV-elements: ");
while (optind < argc)
fprintf(stderr, "%s ", argv[optind++]);
fprintf(stderr, "\n");
return false;
}
return true;
}
| 0
|
155,813
|
pixOctcubeQuantMixedWithGray(PIX *pixs,
l_int32 depth,
l_int32 graylevels,
l_int32 delta)
{
l_int32 w, h, wpls, wpld, i, j, size, octlevels;
l_int32 rval, gval, bval, del, val, midval;
l_int32 *carray, *rarray, *garray, *barray;
l_int32 *tabval;
l_uint32 octindex;
l_uint32 *rtab, *gtab, *btab;
l_uint32 *lines, *lined, *datas, *datad;
PIX *pixd;
PIXCMAP *cmap;
PROCNAME("pixOctcubeQuantMixedWithGray");
if (!pixs)
return (PIX *)ERROR_PTR("pixs not defined", procName, NULL);
if (pixGetDepth(pixs) != 32)
return (PIX *)ERROR_PTR("pixs not 32 bpp", procName, NULL);
if (graylevels < 2)
return (PIX *)ERROR_PTR("invalid graylevels", procName, NULL);
if (depth == 4) {
octlevels = 1;
size = 8; /* 2 ** 3 */
if (graylevels > 8)
return (PIX *)ERROR_PTR("max 8 gray levels", procName, NULL);
} else if (depth == 8) {
octlevels = 2;
size = 64; /* 2 ** 6 */
if (graylevels > 192)
return (PIX *)ERROR_PTR("max 192 gray levels", procName, NULL);
} else {
return (PIX *)ERROR_PTR("output depth not 4 or 8 bpp", procName, NULL);
}
pixd = NULL;
/* Make octcube index tables */
rtab = gtab = btab = NULL;
makeRGBToIndexTables(octlevels, &rtab, >ab, &btab);
/* Make octcube arrays for storing points in each cube */
carray = (l_int32 *)LEPT_CALLOC(size, sizeof(l_int32));
rarray = (l_int32 *)LEPT_CALLOC(size, sizeof(l_int32));
garray = (l_int32 *)LEPT_CALLOC(size, sizeof(l_int32));
barray = (l_int32 *)LEPT_CALLOC(size, sizeof(l_int32));
/* Make lookup table, using computed thresholds */
tabval = makeGrayQuantIndexTable(graylevels);
if (!rtab || !gtab || !btab ||
!carray || !rarray || !garray || !barray || !tabval) {
L_ERROR("calloc fail for an array\n", procName);
goto array_cleanup;
}
/* Make colormapped output pixd */
pixGetDimensions(pixs, &w, &h, NULL);
if ((pixd = pixCreate(w, h, depth)) == NULL) {
L_ERROR("pixd not made\n", procName);
goto array_cleanup;
}
pixCopyResolution(pixd, pixs);
pixCopyInputFormat(pixd, pixs);
cmap = pixcmapCreate(depth);
for (j = 0; j < size; j++) /* reserve octcube colors */
pixcmapAddColor(cmap, 1, 1, 1); /* a color that won't be used */
for (j = 0; j < graylevels; j++) { /* set grayscale colors */
val = (255 * j) / (graylevels - 1);
pixcmapAddColor(cmap, val, val, val);
}
pixSetColormap(pixd, cmap);
wpld = pixGetWpl(pixd);
datad = pixGetData(pixd);
/* Go through src image: assign dest pixels to colormap values
* and compute average colors in each occupied octcube */
datas = pixGetData(pixs);
wpls = pixGetWpl(pixs);
for (i = 0; i < h; i++) {
lines = datas + i * wpls;
lined = datad + i * wpld;
for (j = 0; j < w; j++) {
extractRGBValues(lines[j], &rval, &gval, &bval);
if (rval > gval) {
if (gval > bval) { /* r > g > b */
del = rval - bval;
midval = gval;
} else if (rval > bval) { /* r > b > g */
del = rval - gval;
midval = bval;
} else { /* b > r > g */
del = bval - gval;
midval = rval;
}
} else { /* gval >= rval */
if (rval > bval) { /* g > r > b */
del = gval - bval;
midval = rval;
} else if (gval > bval) { /* g > b > r */
del = gval - rval;
midval = bval;
} else { /* b > g > r */
del = bval - rval;
midval = gval;
}
}
if (del > delta) { /* assign to color */
octindex = rtab[rval] | gtab[gval] | btab[bval];
carray[octindex]++;
rarray[octindex] += rval;
garray[octindex] += gval;
barray[octindex] += bval;
if (depth == 4)
SET_DATA_QBIT(lined, j, octindex);
else /* depth == 8 */
SET_DATA_BYTE(lined, j, octindex);
} else { /* assign to grayscale */
val = size + tabval[midval];
if (depth == 4)
SET_DATA_QBIT(lined, j, val);
else /* depth == 8 */
SET_DATA_BYTE(lined, j, val);
}
}
}
/* Average the colors in each bin and reset the colormap */
for (i = 0; i < size; i++) {
if (carray[i] > 0) {
rarray[i] /= carray[i];
garray[i] /= carray[i];
barray[i] /= carray[i];
pixcmapResetColor(cmap, i, rarray[i], garray[i], barray[i]);
}
}
array_cleanup:
LEPT_FREE(carray);
LEPT_FREE(rarray);
LEPT_FREE(garray);
LEPT_FREE(barray);
LEPT_FREE(rtab);
LEPT_FREE(gtab);
LEPT_FREE(btab);
LEPT_FREE(tabval);
return pixd;
}
| 0
|
227,383
|
eval_number(uschar **sptr, BOOL decimal, uschar **error)
{
register int c;
int_eximarith_t n;
uschar *s = *sptr;
while (isspace(*s)) s++;
c = *s;
if (isdigit(c))
{
int count;
(void)sscanf(CS s, (decimal? SC_EXIM_DEC "%n" : SC_EXIM_ARITH "%n"), &n, &count);
s += count;
switch (tolower(*s))
{
default: break;
case 'k': n *= 1024; s++; break;
case 'm': n *= 1024*1024; s++; break;
case 'g': n *= 1024*1024*1024; s++; break;
}
while (isspace (*s)) s++;
}
else if (c == '(')
{
s++;
n = eval_expr(&s, decimal, error, 1);
}
else
{
*error = US"expecting number or opening parenthesis";
n = 0;
}
*sptr = s;
return n;
}
| 0
|
206,607
|
TemplateURL::AssociatedExtensionInfo::~AssociatedExtensionInfo() {
}
| 0
|
16,614
|
PHP_FUNCTION ( uwsgi_masterpid ) {
if ( uwsgi . master_process ) {
RETURN_LONG ( uwsgi . workers [ 0 ] . pid ) ;
}
RETURN_LONG ( 0 ) ;
}
| 0
|
522,816
|
static COND* substitute_for_best_equal_field(THD *thd, JOIN_TAB *context_tab,
COND *cond,
COND_EQUAL *cond_equal,
void *table_join_idx,
bool do_substitution)
{
Item_equal *item_equal;
COND *org_cond= cond; // Return this in case of fatal error
if (cond->type() == Item::COND_ITEM)
{
List<Item> *cond_list= ((Item_cond*) cond)->argument_list();
bool and_level= ((Item_cond*) cond)->functype() ==
Item_func::COND_AND_FUNC;
if (and_level)
{
cond_equal= &((Item_cond_and *) cond)->m_cond_equal;
cond_list->disjoin((List<Item> *) &cond_equal->current_level);/* remove Item_equal objects from the AND. */
List_iterator_fast<Item_equal> it(cond_equal->current_level);
while ((item_equal= it++))
{
item_equal->sort(&compare_fields_by_table_order, table_join_idx);
}
}
List_iterator<Item> li(*cond_list);
Item *item;
while ((item= li++))
{
Item *new_item= substitute_for_best_equal_field(thd, context_tab,
item, cond_equal,
table_join_idx,
do_substitution);
/*
This works OK with PS/SP re-execution as changes are made to
the arguments of AND/OR items only
*/
if (new_item && new_item != item)
li.replace(new_item);
}
if (and_level)
{
COND *eq_cond= 0;
List_iterator_fast<Item_equal> it(cond_equal->current_level);
bool false_eq_cond= FALSE;
bool all_deleted= true;
while ((item_equal= it++))
{
if (item_equal->get_extraction_flag() == DELETION_FL)
continue;
all_deleted= false;
eq_cond= eliminate_item_equal(thd, eq_cond, cond_equal->upper_levels,
item_equal);
if (!eq_cond)
{
eq_cond= 0;
break;
}
else if (eq_cond->is_bool_literal() && !eq_cond->val_bool())
{
/*
This occurs when eliminate_item_equal() founds that cond is
always false and substitutes it with Item_int 0.
Due to this, value of item_equal will be 0, so just return it.
*/
cond= eq_cond;
false_eq_cond= TRUE;
break;
}
}
if (eq_cond && !false_eq_cond)
{
/* Insert the generated equalities before all other conditions */
if (eq_cond->type() == Item::COND_ITEM)
((Item_cond *) cond)->add_at_head(
((Item_cond *) eq_cond)->argument_list());
else
{
if (cond_list->is_empty())
cond= eq_cond;
else
{
/* Do not add an equality condition if it's always true */
if (!eq_cond->is_bool_literal() &&
cond_list->push_front(eq_cond, thd->mem_root))
eq_cond= 0;
}
}
}
if (!eq_cond && !all_deleted)
{
/*
We are out of memory doing the transformation.
This is a fatal error now. However we bail out by returning the
original condition that we had before we started the transformation.
*/
cond_list->append((List<Item> *) &cond_equal->current_level);
}
}
}
else if (cond->type() == Item::FUNC_ITEM &&
((Item_func*) cond)->functype() == Item_func::MULT_EQUAL_FUNC)
{
item_equal= (Item_equal *) cond;
item_equal->sort(&compare_fields_by_table_order, table_join_idx);
cond_equal= item_equal->upper_levels;
if (cond_equal && cond_equal->current_level.head() == item_equal)
cond_equal= cond_equal->upper_levels;
if (item_equal->get_extraction_flag() == DELETION_FL)
return 0;
cond= eliminate_item_equal(thd, 0, cond_equal, item_equal);
return cond ? cond : org_cond;
}
else if (do_substitution)
{
while (cond_equal)
{
List_iterator_fast<Item_equal> it(cond_equal->current_level);
while((item_equal= it++))
{
REPLACE_EQUAL_FIELD_ARG arg= {item_equal, context_tab};
if (!(cond= cond->transform(thd, &Item::replace_equal_field,
(uchar *) &arg)))
return 0;
}
cond_equal= cond_equal->upper_levels;
}
}
return cond;
}
| 0
|
291,786
|
messageSetMimeType(message *mess, const char *type)
{
#ifdef CL_THREAD_SAFE
static pthread_mutex_t mime_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif
const struct mime_map *m;
int typeval;
static table_t *mime_table;
assert(mess != NULL);
if(type == NULL) {
cli_dbgmsg("Empty content-type field\n");
return 0;
}
cli_dbgmsg("messageSetMimeType: '%s'\n", type);
/* Ignore leading spaces */
while(!isalpha(*type))
if(*type++ == '\0')
return 0;
#ifdef CL_THREAD_SAFE
pthread_mutex_lock(&mime_mutex);
#endif
if(mime_table == NULL) {
mime_table = tableCreate();
if(mime_table == NULL) {
#ifdef CL_THREAD_SAFE
pthread_mutex_unlock(&mime_mutex);
#endif
return 0;
}
for(m = mime_map; m->string; m++)
if(!tableInsert(mime_table, m->string, m->type)) {
tableDestroy(mime_table);
mime_table = NULL;
#ifdef CL_THREAD_SAFE
pthread_mutex_unlock(&mime_mutex);
#endif
return 0;
}
}
#ifdef CL_THREAD_SAFE
pthread_mutex_unlock(&mime_mutex);
#endif
typeval = tableFind(mime_table, type);
if(typeval != -1) {
mess->mimeType = (mime_type)typeval;
return 1;
}
if(mess->mimeType == NOMIME) {
if(strncasecmp(type, "x-", 2) == 0)
mess->mimeType = MEXTENSION;
else {
/*
* Force scanning of strange messages
*/
if(strcasecmp(type, "plain") == 0) {
cli_dbgmsg("Incorrect MIME type: `plain', set to Text\n");
mess->mimeType = TEXT;
} else {
/*
* Don't handle broken e-mail probably sending
* Content-Type: plain/text
* instead of
* Content-Type: text/plain
* as an attachment
*/
int highestSimil = 0, t = -1;
const char *closest = NULL;
for(m = mime_map; m->string; m++) {
const int s = simil(m->string, type);
if(s > highestSimil) {
highestSimil = s;
closest = m->string;
t = m->type;
}
}
if(highestSimil >= 50) {
cli_dbgmsg("Unknown MIME type \"%s\" - guessing as %s (%d%% certainty)\n",
type, closest,
highestSimil);
mess->mimeType = (mime_type)t;
} else {
cli_dbgmsg("Unknown MIME type: `%s', set to Application - if you believe this file contains a virus, submit it to www.clamav.net\n", type);
mess->mimeType = APPLICATION;
}
}
}
return 1;
}
return 0;
}
| 0
|
483,878
|
void unregister_memory_notifier(struct notifier_block *nb)
{
blocking_notifier_chain_unregister(&memory_chain, nb);
}
| 0
|
123,593
|
static inline struct crypto_ahash *crypto_spawn_ahash(
struct crypto_ahash_spawn *spawn)
{
return crypto_spawn_tfm2(&spawn->base);
}
| 0
|
495,037
|
static void snd_pcm_post_reset(struct snd_pcm_substream *substream,
snd_pcm_state_t state)
{
struct snd_pcm_runtime *runtime = substream->runtime;
runtime->control->appl_ptr = runtime->status->hw_ptr;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
runtime->silence_size > 0)
snd_pcm_playback_silence(substream, ULONG_MAX);
}
| 0
|
90,533
|
void _yr_re_print_node(
RE_NODE* re_node)
{
int i;
if (re_node == NULL)
return;
switch(re_node->type)
{
case RE_NODE_ALT:
printf("Alt(");
_yr_re_print_node(re_node->left);
printf(", ");
_yr_re_print_node(re_node->right);
printf(")");
break;
case RE_NODE_CONCAT:
printf("Cat(");
_yr_re_print_node(re_node->left);
printf(", ");
_yr_re_print_node(re_node->right);
printf(")");
break;
case RE_NODE_STAR:
printf("Star(");
_yr_re_print_node(re_node->left);
printf(")");
break;
case RE_NODE_PLUS:
printf("Plus(");
_yr_re_print_node(re_node->left);
printf(")");
break;
case RE_NODE_LITERAL:
printf("Lit(%02X)", re_node->value);
break;
case RE_NODE_MASKED_LITERAL:
printf("MaskedLit(%02X,%02X)", re_node->value, re_node->mask);
break;
case RE_NODE_WORD_CHAR:
printf("WordChar");
break;
case RE_NODE_NON_WORD_CHAR:
printf("NonWordChar");
break;
case RE_NODE_SPACE:
printf("Space");
break;
case RE_NODE_NON_SPACE:
printf("NonSpace");
break;
case RE_NODE_DIGIT:
printf("Digit");
break;
case RE_NODE_NON_DIGIT:
printf("NonDigit");
break;
case RE_NODE_ANY:
printf("Any");
break;
case RE_NODE_RANGE:
printf("Range(%d-%d, ", re_node->start, re_node->end);
_yr_re_print_node(re_node->left);
printf(")");
break;
case RE_NODE_CLASS:
printf("Class(");
for (i = 0; i < 256; i++)
if (CHAR_IN_CLASS(i, re_node->class_vector))
printf("%02X,", i);
printf(")");
break;
default:
printf("???");
break;
}
}
| 0
|
475,748
|
static int nft_set_elem_expr_setup(struct nft_ctx *ctx,
const struct nft_set_ext *ext,
struct nft_expr *expr_array[],
u32 num_exprs)
{
struct nft_set_elem_expr *elem_expr = nft_set_ext_expr(ext);
struct nft_expr *expr;
int i, err;
for (i = 0; i < num_exprs; i++) {
expr = nft_setelem_expr_at(elem_expr, elem_expr->size);
err = nft_expr_clone(expr, expr_array[i]);
if (err < 0)
goto err_elem_expr_setup;
elem_expr->size += expr_array[i]->ops->size;
nft_expr_destroy(ctx, expr_array[i]);
expr_array[i] = NULL;
}
return 0;
err_elem_expr_setup:
for (; i < num_exprs; i++) {
nft_expr_destroy(ctx, expr_array[i]);
expr_array[i] = NULL;
}
return -ENOMEM;
}
| 0
|
114,024
|
static ssize_t ati_remote2_show_channel_mask(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct usb_device *udev = to_usb_device(dev);
struct usb_interface *intf = usb_ifnum_to_if(udev, 0);
struct ati_remote2 *ar2 = usb_get_intfdata(intf);
return sprintf(buf, "0x%04x\n", ar2->channel_mask);
}
| 0
|
129,816
|
static MagickBooleanType ReadPSDChannelPixels(Image *image,
const size_t channels,const size_t row,const ssize_t type,
const unsigned char *pixels,ExceptionInfo *exception)
{
Quantum
pixel;
register const unsigned char
*p;
register Quantum
*q;
register ssize_t
x;
size_t
packet_size;
unsigned short
nibble;
p=pixels;
q=GetAuthenticPixels(image,0,row,image->columns,1,exception);
if (q == (Quantum *) NULL)
return MagickFalse;
packet_size=GetPSDPacketSize(image);
for (x=0; x < (ssize_t) image->columns; x++)
{
if (packet_size == 1)
pixel=ScaleCharToQuantum(*p++);
else
{
p=PushShortPixel(MSBEndian,p,&nibble);
pixel=ScaleShortToQuantum(nibble);
}
if (image->depth > 1)
{
SetPSDPixel(image,channels,type,packet_size,pixel,q,exception);
q+=GetPixelChannels(image);
}
else
{
ssize_t
bit,
number_bits;
number_bits=image->columns-x;
if (number_bits > 8)
number_bits=8;
for (bit = 0; bit < number_bits; bit++)
{
SetPSDPixel(image,channels,type,packet_size,(((unsigned char) pixel)
& (0x01 << (7-bit))) != 0 ? 0 : QuantumRange,q,exception);
q+=GetPixelChannels(image);
x++;
}
if (x != (ssize_t) image->columns)
x--;
continue;
}
}
return(SyncAuthenticPixels(image,exception));
}
| 0
|
461,288
|
static bool sanity_check(struct ip_udp_dhcp_packet *packet, int bytes)
{
if (packet->ip.protocol != IPPROTO_UDP)
return false;
if (packet->ip.version != IPVERSION)
return false;
if (packet->ip.ihl != sizeof(packet->ip) >> 2)
return false;
if (packet->udp.dest != htons(CLIENT_PORT))
return false;
if (ntohs(packet->udp.len) != (uint16_t)(bytes - sizeof(packet->ip)))
return false;
return true;
}
| 0
|
70,483
|
_archive_write_disk_data_block(struct archive *_a,
const void *buff, size_t size, int64_t offset)
{
struct archive_write_disk *a = (struct archive_write_disk *)_a;
ssize_t r;
archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
ARCHIVE_STATE_DATA, "archive_write_data_block");
a->offset = offset;
if (a->todo & TODO_HFS_COMPRESSION)
r = hfs_write_data_block(a, buff, size);
else
r = write_data_block(a, buff, size);
if (r < ARCHIVE_OK)
return (r);
if ((size_t)r < size) {
archive_set_error(&a->archive, 0,
"Write request too large");
return (ARCHIVE_WARN);
}
#if ARCHIVE_VERSION_NUMBER < 3999000
return (ARCHIVE_OK);
#else
return (size);
#endif
}
| 0
|
325,588
|
static int mov_write_stbl_tag(ByteIOContext *pb, MOVTrack* track)
{
offset_t pos = url_ftell(pb);
put_be32(pb, 0); /* size */
put_tag(pb, "stbl");
mov_write_stsd_tag(pb, track);
mov_write_stts_tag(pb, track);
if (track->enc->codec_type == CODEC_TYPE_VIDEO &&
track->hasKeyframes < track->entry)
mov_write_stss_tag(pb, track);
if (track->enc->codec_type == CODEC_TYPE_VIDEO &&
track->hasBframes)
mov_write_ctts_tag(pb, track);
mov_write_stsc_tag(pb, track);
mov_write_stsz_tag(pb, track);
mov_write_stco_tag(pb, track);
return updateSize(pb, pos);
}
| 0
|
184,366
|
unsigned HTMLCanvasElement::GetMSAASampleCountFor2dContext() const {
if (!GetDocument().GetSettings())
return 0;
return GetDocument().GetSettings()->GetAccelerated2dCanvasMSAASampleCount();
}
| 0
|
429,829
|
smpl_t aubio_onset_get_awhitening (aubio_onset_t *o)
{
return o->apply_awhitening;
}
| 0
|
244,552
|
void red_client_set_migration_seamless(RedClient *client) // dest
{
RingItem *link;
pthread_mutex_lock(&client->lock);
client->seamless_migrate = TRUE;
/* update channel clients that got connected before the migration
* type was set. red_client_add_channel will handle newer channel clients */
RING_FOREACH(link, &client->channels) {
RedChannelClient *rcc = SPICE_CONTAINEROF(link, RedChannelClient, client_link);
red_channel_client_set_migration_seamless(rcc);
}
pthread_mutex_unlock(&client->lock);
}
| 0
|
338,292
|
static void RENAME(swScale)(SwsContext *c, uint8_t* srcParam[], int srcStrideParam[], int srcSliceY,
int srcSliceH, uint8_t* dstParam[], int dstStride[]){
/* load a few things into local vars to make the code more readable? and faster */
const int srcW= c->srcW;
const int dstW= c->dstW;
const int dstH= c->dstH;
const int chrDstW= c->chrDstW;
const int lumXInc= c->lumXInc;
const int chrXInc= c->chrXInc;
const int dstFormat= c->dstFormat;
const int flags= c->flags;
const int canMMX2BeUsed= c->canMMX2BeUsed;
int16_t *vLumFilterPos= c->vLumFilterPos;
int16_t *vChrFilterPos= c->vChrFilterPos;
int16_t *hLumFilterPos= c->hLumFilterPos;
int16_t *hChrFilterPos= c->hChrFilterPos;
int16_t *vLumFilter= c->vLumFilter;
int16_t *vChrFilter= c->vChrFilter;
int16_t *hLumFilter= c->hLumFilter;
int16_t *hChrFilter= c->hChrFilter;
int16_t *lumMmxFilter= c->lumMmxFilter;
int16_t *chrMmxFilter= c->chrMmxFilter;
const int vLumFilterSize= c->vLumFilterSize;
const int vChrFilterSize= c->vChrFilterSize;
const int hLumFilterSize= c->hLumFilterSize;
const int hChrFilterSize= c->hChrFilterSize;
int16_t **lumPixBuf= c->lumPixBuf;
int16_t **chrPixBuf= c->chrPixBuf;
const int vLumBufSize= c->vLumBufSize;
const int vChrBufSize= c->vChrBufSize;
uint8_t *funnyYCode= c->funnyYCode;
uint8_t *funnyUVCode= c->funnyUVCode;
uint8_t *formatConvBuffer= c->formatConvBuffer;
/* vars whch will change and which we need to storw back in the context */
int dstY= c->dstY;
int lumBufIndex= c->lumBufIndex;
int chrBufIndex= c->chrBufIndex;
int lastInLumBuf= c->lastInLumBuf;
int lastInChrBuf= c->lastInChrBuf;
int srcStride[3];
uint8_t *src[3];
uint8_t *dst[3];
if((c->srcFormat == IMGFMT_IYUV) || (c->srcFormat == IMGFMT_I420)){
src[0]= srcParam[0];
src[1]= srcParam[2];
src[2]= srcParam[1];
srcStride[0]= srcStrideParam[0];
srcStride[1]= srcStrideParam[2];
srcStride[2]= srcStrideParam[1];
}
else if(c->srcFormat==IMGFMT_YV12){
src[0]= srcParam[0];
src[1]= srcParam[1];
src[2]= srcParam[2];
srcStride[0]= srcStrideParam[0];
srcStride[1]= srcStrideParam[1];
srcStride[2]= srcStrideParam[2];
}
else if(isPacked(c->srcFormat)){
src[0]=
src[1]=
src[2]= srcParam[0];
srcStride[0]= srcStrideParam[0];
srcStride[1]=
srcStride[2]= srcStrideParam[0]<<1;
}
else if(c->srcFormat==IMGFMT_Y8){
src[0]= srcParam[0];
src[1]=
src[2]= NULL;
srcStride[0]= srcStrideParam[0];
srcStride[1]=
srcStride[2]= 0;
}
if((c->dstFormat == IMGFMT_IYUV) || (c->dstFormat == IMGFMT_I420)){
dst[0]= dstParam[0];
dst[1]= dstParam[2];
dst[2]= dstParam[1];
}else{
dst[0]= dstParam[0];
dst[1]= dstParam[1];
dst[2]= dstParam[2];
}
if(dstStride[0]%8 !=0 || dstStride[1]%8 !=0 || dstStride[2]%8 !=0)
{
static int firstTime=1; //FIXME move this into the context perhaps
if(flags & SWS_PRINT_INFO && firstTime)
{
fprintf(stderr, "SwScaler: Warning: dstStride is not aligned!\n"
"SwScaler: ->cannot do aligned memory acesses anymore\n");
firstTime=0;
}
}
/* Note the user might start scaling the picture in the middle so this will not get executed
this is not really intended but works currently, so ppl might do it */
if(srcSliceY ==0){
lumBufIndex=0;
chrBufIndex=0;
dstY=0;
lastInLumBuf= -1;
lastInChrBuf= -1;
}
for(;dstY < dstH; dstY++){
unsigned char *dest =dst[0]+dstStride[0]*dstY;
unsigned char *uDest=dst[1]+dstStride[1]*(dstY>>1);
unsigned char *vDest=dst[2]+dstStride[2]*(dstY>>1);
const int chrDstY= isHalfChrV(dstFormat) ? (dstY>>1) : dstY;
const int firstLumSrcY= vLumFilterPos[dstY]; //First line needed as input
const int firstChrSrcY= vChrFilterPos[chrDstY]; //First line needed as input
const int lastLumSrcY= firstLumSrcY + vLumFilterSize -1; // Last line needed as input
const int lastChrSrcY= firstChrSrcY + vChrFilterSize -1; // Last line needed as input
//handle holes (FAST_BILINEAR & weird filters)
if(firstLumSrcY > lastInLumBuf) lastInLumBuf= firstLumSrcY-1;
if(firstChrSrcY > lastInChrBuf) lastInChrBuf= firstChrSrcY-1;
//printf("%d %d %d\n", firstChrSrcY, lastInChrBuf, vChrBufSize);
ASSERT(firstLumSrcY >= lastInLumBuf - vLumBufSize + 1)
ASSERT(firstChrSrcY >= lastInChrBuf - vChrBufSize + 1)
// Do we have enough lines in this slice to output the dstY line
if(lastLumSrcY < srcSliceY + srcSliceH && lastChrSrcY < ((srcSliceY + srcSliceH)>>1))
{
//Do horizontal scaling
while(lastInLumBuf < lastLumSrcY)
{
uint8_t *s= src[0]+(lastInLumBuf + 1 - srcSliceY)*srcStride[0];
lumBufIndex++;
// printf("%d %d %d %d\n", lumBufIndex, vLumBufSize, lastInLumBuf, lastLumSrcY);
ASSERT(lumBufIndex < 2*vLumBufSize)
ASSERT(lastInLumBuf + 1 - srcSliceY < srcSliceH)
ASSERT(lastInLumBuf + 1 - srcSliceY >= 0)
// printf("%d %d\n", lumBufIndex, vLumBufSize);
RENAME(hyscale)(lumPixBuf[ lumBufIndex ], dstW, s, srcW, lumXInc,
flags, canMMX2BeUsed, hLumFilter, hLumFilterPos, hLumFilterSize,
funnyYCode, c->srcFormat, formatConvBuffer);
lastInLumBuf++;
}
while(lastInChrBuf < lastChrSrcY)
{
uint8_t *src1= src[1]+(lastInChrBuf + 1 - (srcSliceY>>1))*srcStride[1];
uint8_t *src2= src[2]+(lastInChrBuf + 1 - (srcSliceY>>1))*srcStride[2];
chrBufIndex++;
ASSERT(chrBufIndex < 2*vChrBufSize)
ASSERT(lastInChrBuf + 1 - (srcSliceY>>1) < (srcSliceH>>1))
ASSERT(lastInChrBuf + 1 - (srcSliceY>>1) >= 0)
//FIXME replace parameters through context struct (some at least)
RENAME(hcscale)(chrPixBuf[ chrBufIndex ], chrDstW, src1, src2, (srcW+1)>>1, chrXInc,
flags, canMMX2BeUsed, hChrFilter, hChrFilterPos, hChrFilterSize,
funnyUVCode, c->srcFormat, formatConvBuffer);
lastInChrBuf++;
}
//wrap buf index around to stay inside the ring buffer
if(lumBufIndex >= vLumBufSize ) lumBufIndex-= vLumBufSize;
if(chrBufIndex >= vChrBufSize ) chrBufIndex-= vChrBufSize;
}
else // not enough lines left in this slice -> load the rest in the buffer
{
/* printf("%d %d Last:%d %d LastInBuf:%d %d Index:%d %d Y:%d FSize: %d %d BSize: %d %d\n",
firstChrSrcY,firstLumSrcY,lastChrSrcY,lastLumSrcY,
lastInChrBuf,lastInLumBuf,chrBufIndex,lumBufIndex,dstY,vChrFilterSize,vLumFilterSize,
vChrBufSize, vLumBufSize);
*/
//Do horizontal scaling
while(lastInLumBuf+1 < srcSliceY + srcSliceH)
{
uint8_t *s= src[0]+(lastInLumBuf + 1 - srcSliceY)*srcStride[0];
lumBufIndex++;
ASSERT(lumBufIndex < 2*vLumBufSize)
ASSERT(lastInLumBuf + 1 - srcSliceY < srcSliceH)
ASSERT(lastInLumBuf + 1 - srcSliceY >= 0)
RENAME(hyscale)(lumPixBuf[ lumBufIndex ], dstW, s, srcW, lumXInc,
flags, canMMX2BeUsed, hLumFilter, hLumFilterPos, hLumFilterSize,
funnyYCode, c->srcFormat, formatConvBuffer);
lastInLumBuf++;
}
while(lastInChrBuf+1 < ((srcSliceY + srcSliceH)>>1))
{
uint8_t *src1= src[1]+(lastInChrBuf + 1 - (srcSliceY>>1))*srcStride[1];
uint8_t *src2= src[2]+(lastInChrBuf + 1 - (srcSliceY>>1))*srcStride[2];
chrBufIndex++;
ASSERT(chrBufIndex < 2*vChrBufSize)
ASSERT(lastInChrBuf + 1 - (srcSliceY>>1) < (srcSliceH>>1))
ASSERT(lastInChrBuf + 1 - (srcSliceY>>1) >= 0)
RENAME(hcscale)(chrPixBuf[ chrBufIndex ], chrDstW, src1, src2, (srcW+1)>>1, chrXInc,
flags, canMMX2BeUsed, hChrFilter, hChrFilterPos, hChrFilterSize,
funnyUVCode, c->srcFormat, formatConvBuffer);
lastInChrBuf++;
}
//wrap buf index around to stay inside the ring buffer
if(lumBufIndex >= vLumBufSize ) lumBufIndex-= vLumBufSize;
if(chrBufIndex >= vChrBufSize ) chrBufIndex-= vChrBufSize;
break; //we cant output a dstY line so lets try with the next slice
}
#ifdef HAVE_MMX
b5Dither= dither8[dstY&1];
g6Dither= dither4[dstY&1];
g5Dither= dither8[dstY&1];
r5Dither= dither8[(dstY+1)&1];
#endif
if(dstY < dstH-2)
{
if(isPlanarYUV(dstFormat)) //YV12 like
{
if(dstY&1) uDest=vDest= NULL; //FIXME split functions in lumi / chromi
if(vLumFilterSize == 1 && vChrFilterSize == 1) // Unscaled YV12
{
int16_t *lumBuf = lumPixBuf[0];
int16_t *chrBuf= chrPixBuf[0];
RENAME(yuv2yuv1)(lumBuf, chrBuf, dest, uDest, vDest, dstW);
}
else //General YV12
{
int16_t **lumSrcPtr= lumPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize;
int16_t **chrSrcPtr= chrPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
RENAME(yuv2yuvX)(
vLumFilter+dstY*vLumFilterSize , lumSrcPtr, vLumFilterSize,
vChrFilter+(dstY>>1)*vChrFilterSize, chrSrcPtr, vChrFilterSize,
dest, uDest, vDest, dstW,
lumMmxFilter+dstY*vLumFilterSize*4, chrMmxFilter+(dstY>>1)*vChrFilterSize*4);
}
}
else
{
int16_t **lumSrcPtr= lumPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize;
int16_t **chrSrcPtr= chrPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
ASSERT(lumSrcPtr + vLumFilterSize - 1 < lumPixBuf + vLumBufSize*2);
ASSERT(chrSrcPtr + vChrFilterSize - 1 < chrPixBuf + vChrBufSize*2);
if(vLumFilterSize == 1 && vChrFilterSize == 2) //Unscaled RGB
{
int chrAlpha= vChrFilter[2*dstY+1];
RENAME(yuv2rgb1)(*lumSrcPtr, *chrSrcPtr, *(chrSrcPtr+1),
dest, dstW, chrAlpha, dstFormat, flags);
}
else if(vLumFilterSize == 2 && vChrFilterSize == 2) //BiLinear Upscale RGB
{
int lumAlpha= vLumFilter[2*dstY+1];
int chrAlpha= vChrFilter[2*dstY+1];
RENAME(yuv2rgb2)(*lumSrcPtr, *(lumSrcPtr+1), *chrSrcPtr, *(chrSrcPtr+1),
dest, dstW, lumAlpha, chrAlpha, dstFormat, flags);
}
else //General RGB
{
RENAME(yuv2rgbX)(
vLumFilter+dstY*vLumFilterSize, lumSrcPtr, vLumFilterSize,
vChrFilter+dstY*vChrFilterSize, chrSrcPtr, vChrFilterSize,
dest, dstW, dstFormat,
lumMmxFilter+dstY*vLumFilterSize*4, chrMmxFilter+dstY*vChrFilterSize*4);
}
}
}
else // hmm looks like we cant use MMX here without overwriting this arrays tail
{
int16_t **lumSrcPtr= lumPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize;
int16_t **chrSrcPtr= chrPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
if(isPlanarYUV(dstFormat)) //YV12
{
if(dstY&1) uDest=vDest= NULL; //FIXME split functions in lumi / chromi
yuv2yuvXinC(
vLumFilter+dstY*vLumFilterSize , lumSrcPtr, vLumFilterSize,
vChrFilter+(dstY>>1)*vChrFilterSize, chrSrcPtr, vChrFilterSize,
dest, uDest, vDest, dstW);
}
else
{
ASSERT(lumSrcPtr + vLumFilterSize - 1 < lumPixBuf + vLumBufSize*2);
ASSERT(chrSrcPtr + vChrFilterSize - 1 < chrPixBuf + vChrBufSize*2);
yuv2rgbXinC(
vLumFilter+dstY*vLumFilterSize, lumSrcPtr, vLumFilterSize,
vChrFilter+dstY*vChrFilterSize, chrSrcPtr, vChrFilterSize,
dest, dstW, dstFormat);
}
}
}
#ifdef HAVE_MMX
__asm __volatile(SFENCE:::"memory");
__asm __volatile(EMMS:::"memory");
#endif
/* store changed local vars back in the context */
c->dstY= dstY;
c->lumBufIndex= lumBufIndex;
c->chrBufIndex= chrBufIndex;
c->lastInLumBuf= lastInLumBuf;
c->lastInChrBuf= lastInChrBuf;
}
| 0
|
273,875
|
selftest_fips_192 (int extended, selftest_report_func_t report)
{
const char *what;
const char *errtxt;
(void)extended; /* No extended tests available. */
what = "low-level";
errtxt = selftest_basic_192 ();
if (errtxt)
goto failed;
return 0; /* Succeeded. */
failed:
if (report)
report ("cipher", GCRY_CIPHER_AES192, what, errtxt);
return GPG_ERR_SELFTEST_FAILED;
}
| 0
|
461,454
|
static int stat_to_qid(V9fsPDU *pdu, const struct stat *stbuf, V9fsQID *qidp)
{
int err;
size_t size;
if (pdu->s->ctx.export_flags & V9FS_REMAP_INODES) {
/* map inode+device to qid path (fast path) */
err = qid_path_suffixmap(pdu, stbuf, &qidp->path);
if (err == -ENFILE) {
/* fast path didn't work, fall back to full map */
err = qid_path_fullmap(pdu, stbuf, &qidp->path);
}
if (err) {
return err;
}
} else {
if (pdu->s->dev_id != stbuf->st_dev) {
if (pdu->s->ctx.export_flags & V9FS_FORBID_MULTIDEVS) {
error_report_once(
"9p: Multiple devices detected in same VirtFS export. "
"Access of guest to additional devices is (partly) "
"denied due to virtfs option 'multidevs=forbid' being "
"effective."
);
return -ENODEV;
} else {
warn_report_once(
"9p: Multiple devices detected in same VirtFS export, "
"which might lead to file ID collisions and severe "
"misbehaviours on guest! You should either use a "
"separate export for each device shared from host or "
"use virtfs option 'multidevs=remap'!"
);
}
}
memset(&qidp->path, 0, sizeof(qidp->path));
size = MIN(sizeof(stbuf->st_ino), sizeof(qidp->path));
memcpy(&qidp->path, &stbuf->st_ino, size);
}
qidp->version = stbuf->st_mtime ^ (stbuf->st_size << 8);
qidp->type = 0;
if (S_ISDIR(stbuf->st_mode)) {
qidp->type |= P9_QID_TYPE_DIR;
}
if (S_ISLNK(stbuf->st_mode)) {
qidp->type |= P9_QID_TYPE_SYMLINK;
}
return 0;
}
| 0
|
210,543
|
void Browser::FocusLocationBar() {
UserMetrics::RecordAction(UserMetricsAction("FocusLocation"));
window_->SetFocusToLocationBar(true);
}
| 0
|
88,983
|
static struct mempolicy *mpol_new(unsigned short mode, unsigned short flags,
nodemask_t *nodes)
{
struct mempolicy *policy;
pr_debug("setting mode %d flags %d nodes[0] %lx\n",
mode, flags, nodes ? nodes_addr(*nodes)[0] : NUMA_NO_NODE);
if (mode == MPOL_DEFAULT) {
if (nodes && !nodes_empty(*nodes))
return ERR_PTR(-EINVAL);
return NULL;
}
VM_BUG_ON(!nodes);
/*
* MPOL_PREFERRED cannot be used with MPOL_F_STATIC_NODES or
* MPOL_F_RELATIVE_NODES if the nodemask is empty (local allocation).
* All other modes require a valid pointer to a non-empty nodemask.
*/
if (mode == MPOL_PREFERRED) {
if (nodes_empty(*nodes)) {
if (((flags & MPOL_F_STATIC_NODES) ||
(flags & MPOL_F_RELATIVE_NODES)))
return ERR_PTR(-EINVAL);
}
} else if (mode == MPOL_LOCAL) {
if (!nodes_empty(*nodes) ||
(flags & MPOL_F_STATIC_NODES) ||
(flags & MPOL_F_RELATIVE_NODES))
return ERR_PTR(-EINVAL);
mode = MPOL_PREFERRED;
} else if (nodes_empty(*nodes))
return ERR_PTR(-EINVAL);
policy = kmem_cache_alloc(policy_cache, GFP_KERNEL);
if (!policy)
return ERR_PTR(-ENOMEM);
atomic_set(&policy->refcnt, 1);
policy->mode = mode;
policy->flags = flags;
return policy;
}
| 0
|
472,889
|
static int hw_atl_utils_init_ucp(struct aq_hw_s *self,
const struct aq_hw_caps_s *aq_hw_caps)
{
int err = 0;
if (!aq_hw_read_reg(self, 0x370U)) {
unsigned int rnd = 0U;
unsigned int ucp_0x370 = 0U;
get_random_bytes(&rnd, sizeof(unsigned int));
ucp_0x370 = 0x02020202U | (0xFEFEFEFEU & rnd);
aq_hw_write_reg(self, HW_ATL_UCP_0X370_REG, ucp_0x370);
}
hw_atl_reg_glb_cpu_scratch_scp_set(self, 0x00000000U, 25U);
/* check 10 times by 1ms */
err = readx_poll_timeout_atomic(hw_atl_scrpad25_get,
self, self->mbox_addr,
self->mbox_addr != 0U,
1000U, 10000U);
err = readx_poll_timeout_atomic(aq_fw1x_rpc_get, self,
self->rpc_addr,
self->rpc_addr != 0U,
1000U, 100000U);
return err;
}
| 0
|
40,572
|
static int recheck_discard_flags(AVFormatContext *s, int first)
{
HLSContext *c = s->priv_data;
int i, changed = 0;
/* Check if any new streams are needed */
for (i = 0; i < c->n_playlists; i++)
c->playlists[i]->cur_needed = 0;
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
struct playlist *pls = c->playlists[s->streams[i]->id];
if (st->discard < AVDISCARD_ALL)
pls->cur_needed = 1;
}
for (i = 0; i < c->n_playlists; i++) {
struct playlist *pls = c->playlists[i];
if (pls->cur_needed && !pls->needed) {
pls->needed = 1;
changed = 1;
pls->cur_seq_no = select_cur_seq_no(c, pls);
pls->pb.eof_reached = 0;
if (c->cur_timestamp != AV_NOPTS_VALUE) {
/* catch up */
pls->seek_timestamp = c->cur_timestamp;
pls->seek_flags = AVSEEK_FLAG_ANY;
pls->seek_stream_index = -1;
}
av_log(s, AV_LOG_INFO, "Now receiving playlist %d, segment %d\n", i, pls->cur_seq_no);
} else if (first && !pls->cur_needed && pls->needed) {
if (pls->input)
ff_format_io_close(pls->parent, &pls->input);
pls->needed = 0;
changed = 1;
av_log(s, AV_LOG_INFO, "No longer receiving playlist %d\n", i);
}
}
return changed;
}
| 0
|
520,104
|
subselect_rowid_merge_engine::cmp_keys_by_cur_rownum(void *arg,
uchar *k1, uchar *k2)
{
rownum_t r1= ((Ordered_key*) k1)->current();
rownum_t r2= ((Ordered_key*) k2)->current();
return (r1 < r2) ? -1 : (r1 > r2) ? 1 : 0;
}
| 0
|
264,016
|
void ext4_ext_init(struct super_block *sb)
{
/*
* possible initialization would be here
*/
if (ext4_has_feature_extents(sb)) {
#if defined(AGGRESSIVE_TEST) || defined(CHECK_BINSEARCH) || defined(EXTENTS_STATS)
printk(KERN_INFO "EXT4-fs: file extents enabled"
#ifdef AGGRESSIVE_TEST
", aggressive tests"
#endif
#ifdef CHECK_BINSEARCH
", check binsearch"
#endif
#ifdef EXTENTS_STATS
", stats"
#endif
"\n");
#endif
#ifdef EXTENTS_STATS
spin_lock_init(&EXT4_SB(sb)->s_ext_stats_lock);
EXT4_SB(sb)->s_ext_min = 1 << 30;
EXT4_SB(sb)->s_ext_max = 0;
#endif
}
}
| 0
|
209,076
|
static void iscsi_detach_aio_context(BlockDriverState *bs)
{
IscsiLun *iscsilun = bs->opaque;
aio_set_fd_handler(iscsilun->aio_context, iscsi_get_fd(iscsilun->iscsi),
false, NULL, NULL, NULL);
iscsilun->events = 0;
if (iscsilun->nop_timer) {
timer_del(iscsilun->nop_timer);
timer_free(iscsilun->nop_timer);
iscsilun->nop_timer = NULL;
}
if (iscsilun->event_timer) {
timer_del(iscsilun->event_timer);
timer_free(iscsilun->event_timer);
iscsilun->event_timer = NULL;
}
}
| 0
|
520,823
|
void set_param_func(uchar **pos, ulong len)
{
/*
To avoid Item_param::set_xxx() asserting on data type mismatch,
we set the value type handler here:
- It can not be initialized yet after Item_param::setup_conversion().
- Also, for LIMIT clause parameters, the value type handler might have
changed from the real type handler to type_handler_longlong.
So here we'll restore it.
*/
const Type_handler *h= Item_param::type_handler();
value.set_handler(h);
h->Item_param_set_param_func(this, pos, len);
}
| 0
|
390,173
|
long SSL_CTX_get_session_cache_mode(SSL_CTX*)
{
// always 0, unlimited size for now
return 0;
}
| 0
|
182,831
|
CastTrayView::~CastTrayView() {
}
| 0
|
21,717
|
static uint query_cache_hits ( MYSQL * conn ) {
MYSQL_RES * res ;
MYSQL_ROW row ;
int rc ;
uint result ;
rc = mysql_query ( conn , "show status like 'qcache_hits'" ) ;
myquery ( rc ) ;
res = mysql_use_result ( conn ) ;
DIE_UNLESS ( res ) ;
row = mysql_fetch_row ( res ) ;
DIE_UNLESS ( row ) ;
result = atoi ( row [ 1 ] ) ;
mysql_free_result ( res ) ;
return result ;
}
| 0
|
422,998
|
static int process_backlog(struct napi_struct *napi, int quota)
{
int work = 0;
struct softnet_data *sd = container_of(napi, struct softnet_data, backlog);
#ifdef CONFIG_RPS
/* Check if we have pending ipi, its better to send them now,
* not waiting net_rx_action() end.
*/
if (sd->rps_ipi_list) {
local_irq_disable();
net_rps_action_and_irq_enable(sd);
}
#endif
napi->weight = weight_p;
local_irq_disable();
while (work < quota) {
struct sk_buff *skb;
unsigned int qlen;
while ((skb = __skb_dequeue(&sd->process_queue))) {
local_irq_enable();
__netif_receive_skb(skb);
local_irq_disable();
input_queue_head_incr(sd);
if (++work >= quota) {
local_irq_enable();
return work;
}
}
rps_lock(sd);
qlen = skb_queue_len(&sd->input_pkt_queue);
if (qlen)
skb_queue_splice_tail_init(&sd->input_pkt_queue,
&sd->process_queue);
if (qlen < quota - work) {
/*
* Inline a custom version of __napi_complete().
* only current cpu owns and manipulates this napi,
* and NAPI_STATE_SCHED is the only possible flag set on backlog.
* we can use a plain write instead of clear_bit(),
* and we dont need an smp_mb() memory barrier.
*/
list_del(&napi->poll_list);
napi->state = 0;
quota = work + qlen;
}
rps_unlock(sd);
}
local_irq_enable();
return work;
| 0
|
316,400
|
void DownloadFilesToReadonlyFolder(size_t count,
DownloadInfo* download_info) {
DownloadFilesCheckErrorsSetup();
base::FilePath destination_folder = GetDownloadDirectory(browser());
DVLOG(1) << " " << __FUNCTION__ << "()"
<< " folder = '" << destination_folder.value() << "'";
base::FilePermissionRestorer permission_restorer(destination_folder);
EXPECT_TRUE(base::MakeFileUnwritable(destination_folder));
for (size_t i = 0; i < count; ++i) {
DownloadFilesCheckErrorsLoopBody(download_info[i], i);
}
}
| 0
|
477,485
|
static void tcf_proto_get(struct tcf_proto *tp)
{
refcount_inc(&tp->refcnt);
}
| 0
|
386,806
|
static OPJ_BOOL opj_j2k_read_siz(opj_j2k_t *p_j2k,
OPJ_BYTE * p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t * p_manager
)
{
OPJ_UINT32 i;
OPJ_UINT32 l_nb_comp;
OPJ_UINT32 l_nb_comp_remain;
OPJ_UINT32 l_remaining_size;
OPJ_UINT32 l_nb_tiles;
OPJ_UINT32 l_tmp, l_tx1, l_ty1;
opj_image_t *l_image = 00;
opj_cp_t *l_cp = 00;
opj_image_comp_t * l_img_comp = 00;
opj_tcp_t * l_current_tile_param = 00;
/* preconditions */
assert(p_j2k != 00);
assert(p_manager != 00);
assert(p_header_data != 00);
l_image = p_j2k->m_private_image;
l_cp = &(p_j2k->m_cp);
/* minimum size == 39 - 3 (= minimum component parameter) */
if (p_header_size < 36) {
opj_event_msg(p_manager, EVT_ERROR, "Error with SIZ marker size\n");
return OPJ_FALSE;
}
l_remaining_size = p_header_size - 36;
l_nb_comp = l_remaining_size / 3;
l_nb_comp_remain = l_remaining_size % 3;
if (l_nb_comp_remain != 0){
opj_event_msg(p_manager, EVT_ERROR, "Error with SIZ marker size\n");
return OPJ_FALSE;
}
opj_read_bytes(p_header_data,&l_tmp ,2); /* Rsiz (capabilities) */
p_header_data+=2;
l_cp->rsiz = (OPJ_UINT16) l_tmp;
opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_image->x1, 4); /* Xsiz */
p_header_data+=4;
opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_image->y1, 4); /* Ysiz */
p_header_data+=4;
opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_image->x0, 4); /* X0siz */
p_header_data+=4;
opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_image->y0, 4); /* Y0siz */
p_header_data+=4;
opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_cp->tdx, 4); /* XTsiz */
p_header_data+=4;
opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_cp->tdy, 4); /* YTsiz */
p_header_data+=4;
opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_cp->tx0, 4); /* XT0siz */
p_header_data+=4;
opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_cp->ty0, 4); /* YT0siz */
p_header_data+=4;
opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_tmp, 2); /* Csiz */
p_header_data+=2;
if (l_tmp < 16385)
l_image->numcomps = (OPJ_UINT16) l_tmp;
else {
opj_event_msg(p_manager, EVT_ERROR, "Error with SIZ marker: number of component is illegal -> %d\n", l_tmp);
return OPJ_FALSE;
}
if (l_image->numcomps != l_nb_comp) {
opj_event_msg(p_manager, EVT_ERROR, "Error with SIZ marker: number of component is not compatible with the remaining number of parameters ( %d vs %d)\n", l_image->numcomps, l_nb_comp);
return OPJ_FALSE;
}
/* testcase 4035.pdf.SIGSEGV.d8b.3375 */
/* testcase issue427-null-image-size.jp2 */
if ((l_image->x0 >= l_image->x1) || (l_image->y0 >= l_image->y1)) {
opj_event_msg(p_manager, EVT_ERROR, "Error with SIZ marker: negative or zero image size (%d x %d)\n", l_image->x1 - l_image->x0, l_image->y1 - l_image->y0);
return OPJ_FALSE;
}
/* testcase 2539.pdf.SIGFPE.706.1712 (also 3622.pdf.SIGFPE.706.2916 and 4008.pdf.SIGFPE.706.3345 and maybe more) */
if (!(l_cp->tdx * l_cp->tdy)) {
opj_event_msg(p_manager, EVT_ERROR, "Error with SIZ marker: invalid tile size (tdx: %d, tdy: %d)\n", l_cp->tdx, l_cp->tdy);
return OPJ_FALSE;
}
/* testcase 1610.pdf.SIGSEGV.59c.681 */
if (((OPJ_UINT64)l_image->x1) * ((OPJ_UINT64)l_image->y1) != (l_image->x1 * l_image->y1)) {
opj_event_msg(p_manager, EVT_ERROR, "Prevent buffer overflow (x1: %d, y1: %d)\n", l_image->x1, l_image->y1);
return OPJ_FALSE;
}
/* testcase issue427-illegal-tile-offset.jp2 */
l_tx1 = l_cp->tx0 + l_cp->tdx;
if (l_tx1 < l_cp->tx0) { /* manage overflow */
l_tx1 = 0xFFFFFFFFU;
}
l_ty1 = l_cp->ty0 + l_cp->tdy;
if (l_ty1 < l_cp->ty0) { /* manage overflow */
l_ty1 = 0xFFFFFFFFU;
}
if ((l_cp->tx0 > l_image->x0) || (l_cp->ty0 > l_image->y0) || (l_tx1 <= l_image->x0) || (l_ty1 <= l_image->y0) ) {
opj_event_msg(p_manager, EVT_ERROR, "Error with SIZ marker: illegal tile offset\n");
return OPJ_FALSE;
}
#ifdef USE_JPWL
if (l_cp->correct) {
/* if JPWL is on, we check whether TX errors have damaged
too much the SIZ parameters */
if (!(l_image->x1 * l_image->y1)) {
opj_event_msg(p_manager, EVT_ERROR,
"JPWL: bad image size (%d x %d)\n",
l_image->x1, l_image->y1);
if (!JPWL_ASSUME || JPWL_ASSUME) {
opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
return OPJ_FALSE;
}
}
/* FIXME check previously in the function so why keep this piece of code ? Need by the norm ?
if (l_image->numcomps != ((len - 38) / 3)) {
opj_event_msg(p_manager, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,
"JPWL: Csiz is %d => space in SIZ only for %d comps.!!!\n",
l_image->numcomps, ((len - 38) / 3));
if (!JPWL_ASSUME) {
opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
return OPJ_FALSE;
}
*/ /* we try to correct */
/* opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust this\n");
if (l_image->numcomps < ((len - 38) / 3)) {
len = 38 + 3 * l_image->numcomps;
opj_event_msg(p_manager, EVT_WARNING, "- setting Lsiz to %d => HYPOTHESIS!!!\n",
len);
} else {
l_image->numcomps = ((len - 38) / 3);
opj_event_msg(p_manager, EVT_WARNING, "- setting Csiz to %d => HYPOTHESIS!!!\n",
l_image->numcomps);
}
}
*/
/* update components number in the jpwl_exp_comps filed */
l_cp->exp_comps = l_image->numcomps;
}
#endif /* USE_JPWL */
/* Allocate the resulting image components */
l_image->comps = (opj_image_comp_t*) opj_calloc(l_image->numcomps, sizeof(opj_image_comp_t));
if (l_image->comps == 00){
l_image->numcomps = 0;
opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to take in charge SIZ marker\n");
return OPJ_FALSE;
}
l_img_comp = l_image->comps;
/* Read the component information */
for (i = 0; i < l_image->numcomps; ++i){
OPJ_UINT32 tmp;
opj_read_bytes(p_header_data,&tmp,1); /* Ssiz_i */
++p_header_data;
l_img_comp->prec = (tmp & 0x7f) + 1;
l_img_comp->sgnd = tmp >> 7;
opj_read_bytes(p_header_data,&tmp,1); /* XRsiz_i */
++p_header_data;
l_img_comp->dx = (OPJ_UINT32)tmp; /* should be between 1 and 255 */
opj_read_bytes(p_header_data,&tmp,1); /* YRsiz_i */
++p_header_data;
l_img_comp->dy = (OPJ_UINT32)tmp; /* should be between 1 and 255 */
if( l_img_comp->dx < 1 || l_img_comp->dx > 255 ||
l_img_comp->dy < 1 || l_img_comp->dy > 255 ) {
opj_event_msg(p_manager, EVT_ERROR,
"Invalid values for comp = %d : dx=%u dy=%u\n (should be between 1 and 255 according the JPEG2000 norm)",
i, l_img_comp->dx, l_img_comp->dy);
return OPJ_FALSE;
}
#ifdef USE_JPWL
if (l_cp->correct) {
/* if JPWL is on, we check whether TX errors have damaged
too much the SIZ parameters, again */
if (!(l_image->comps[i].dx * l_image->comps[i].dy)) {
opj_event_msg(p_manager, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,
"JPWL: bad XRsiz_%d/YRsiz_%d (%d x %d)\n",
i, i, l_image->comps[i].dx, l_image->comps[i].dy);
if (!JPWL_ASSUME) {
opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
return OPJ_FALSE;
}
/* we try to correct */
opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust them\n");
if (!l_image->comps[i].dx) {
l_image->comps[i].dx = 1;
opj_event_msg(p_manager, EVT_WARNING, "- setting XRsiz_%d to %d => HYPOTHESIS!!!\n",
i, l_image->comps[i].dx);
}
if (!l_image->comps[i].dy) {
l_image->comps[i].dy = 1;
opj_event_msg(p_manager, EVT_WARNING, "- setting YRsiz_%d to %d => HYPOTHESIS!!!\n",
i, l_image->comps[i].dy);
}
}
}
#endif /* USE_JPWL */
l_img_comp->resno_decoded = 0; /* number of resolution decoded */
l_img_comp->factor = l_cp->m_specific_param.m_dec.m_reduce; /* reducing factor per component */
++l_img_comp;
}
/* Compute the number of tiles */
l_cp->tw = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)(l_image->x1 - l_cp->tx0), (OPJ_INT32)l_cp->tdx);
l_cp->th = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)(l_image->y1 - l_cp->ty0), (OPJ_INT32)l_cp->tdy);
/* Check that the number of tiles is valid */
if (l_cp->tw == 0 || l_cp->th == 0 || l_cp->tw > 65535 / l_cp->th) {
opj_event_msg( p_manager, EVT_ERROR,
"Invalid number of tiles : %u x %u (maximum fixed by jpeg2000 norm is 65535 tiles)\n",
l_cp->tw, l_cp->th);
return OPJ_FALSE;
}
l_nb_tiles = l_cp->tw * l_cp->th;
/* Define the tiles which will be decoded */
if (p_j2k->m_specific_param.m_decoder.m_discard_tiles) {
p_j2k->m_specific_param.m_decoder.m_start_tile_x = (p_j2k->m_specific_param.m_decoder.m_start_tile_x - l_cp->tx0) / l_cp->tdx;
p_j2k->m_specific_param.m_decoder.m_start_tile_y = (p_j2k->m_specific_param.m_decoder.m_start_tile_y - l_cp->ty0) / l_cp->tdy;
p_j2k->m_specific_param.m_decoder.m_end_tile_x = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)(p_j2k->m_specific_param.m_decoder.m_end_tile_x - l_cp->tx0), (OPJ_INT32)l_cp->tdx);
p_j2k->m_specific_param.m_decoder.m_end_tile_y = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)(p_j2k->m_specific_param.m_decoder.m_end_tile_y - l_cp->ty0), (OPJ_INT32)l_cp->tdy);
}
else {
p_j2k->m_specific_param.m_decoder.m_start_tile_x = 0;
p_j2k->m_specific_param.m_decoder.m_start_tile_y = 0;
p_j2k->m_specific_param.m_decoder.m_end_tile_x = l_cp->tw;
p_j2k->m_specific_param.m_decoder.m_end_tile_y = l_cp->th;
}
#ifdef USE_JPWL
if (l_cp->correct) {
/* if JPWL is on, we check whether TX errors have damaged
too much the SIZ parameters */
if ((l_cp->tw < 1) || (l_cp->th < 1) || (l_cp->tw > l_cp->max_tiles) || (l_cp->th > l_cp->max_tiles)) {
opj_event_msg(p_manager, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,
"JPWL: bad number of tiles (%d x %d)\n",
l_cp->tw, l_cp->th);
if (!JPWL_ASSUME) {
opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
return OPJ_FALSE;
}
/* we try to correct */
opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust them\n");
if (l_cp->tw < 1) {
l_cp->tw= 1;
opj_event_msg(p_manager, EVT_WARNING, "- setting %d tiles in x => HYPOTHESIS!!!\n",
l_cp->tw);
}
if (l_cp->tw > l_cp->max_tiles) {
l_cp->tw= 1;
opj_event_msg(p_manager, EVT_WARNING, "- too large x, increase expectance of %d\n"
"- setting %d tiles in x => HYPOTHESIS!!!\n",
l_cp->max_tiles, l_cp->tw);
}
if (l_cp->th < 1) {
l_cp->th= 1;
opj_event_msg(p_manager, EVT_WARNING, "- setting %d tiles in y => HYPOTHESIS!!!\n",
l_cp->th);
}
if (l_cp->th > l_cp->max_tiles) {
l_cp->th= 1;
opj_event_msg(p_manager, EVT_WARNING, "- too large y, increase expectance of %d to continue\n",
"- setting %d tiles in y => HYPOTHESIS!!!\n",
l_cp->max_tiles, l_cp->th);
}
}
}
#endif /* USE_JPWL */
/* memory allocations */
l_cp->tcps = (opj_tcp_t*) opj_calloc(l_nb_tiles, sizeof(opj_tcp_t));
if (l_cp->tcps == 00) {
opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to take in charge SIZ marker\n");
return OPJ_FALSE;
}
#ifdef USE_JPWL
if (l_cp->correct) {
if (!l_cp->tcps) {
opj_event_msg(p_manager, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,
"JPWL: could not alloc tcps field of cp\n");
if (!JPWL_ASSUME || JPWL_ASSUME) {
opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
return OPJ_FALSE;
}
}
}
#endif /* USE_JPWL */
p_j2k->m_specific_param.m_decoder.m_default_tcp->tccps =
(opj_tccp_t*) opj_calloc(l_image->numcomps, sizeof(opj_tccp_t));
if(p_j2k->m_specific_param.m_decoder.m_default_tcp->tccps == 00) {
opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to take in charge SIZ marker\n");
return OPJ_FALSE;
}
p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mct_records =
(opj_mct_data_t*)opj_calloc(OPJ_J2K_MCT_DEFAULT_NB_RECORDS ,sizeof(opj_mct_data_t));
if (! p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mct_records) {
opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to take in charge SIZ marker\n");
return OPJ_FALSE;
}
p_j2k->m_specific_param.m_decoder.m_default_tcp->m_nb_max_mct_records = OPJ_J2K_MCT_DEFAULT_NB_RECORDS;
p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mcc_records =
(opj_simple_mcc_decorrelation_data_t*)
opj_calloc(OPJ_J2K_MCC_DEFAULT_NB_RECORDS, sizeof(opj_simple_mcc_decorrelation_data_t));
if (! p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mcc_records) {
opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to take in charge SIZ marker\n");
return OPJ_FALSE;
}
p_j2k->m_specific_param.m_decoder.m_default_tcp->m_nb_max_mcc_records = OPJ_J2K_MCC_DEFAULT_NB_RECORDS;
/* set up default dc level shift */
for (i=0;i<l_image->numcomps;++i) {
if (! l_image->comps[i].sgnd) {
p_j2k->m_specific_param.m_decoder.m_default_tcp->tccps[i].m_dc_level_shift = 1 << (l_image->comps[i].prec - 1);
}
}
l_current_tile_param = l_cp->tcps;
for (i = 0; i < l_nb_tiles; ++i) {
l_current_tile_param->tccps = (opj_tccp_t*) opj_calloc(l_image->numcomps, sizeof(opj_tccp_t));
if (l_current_tile_param->tccps == 00) {
opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to take in charge SIZ marker\n");
return OPJ_FALSE;
}
++l_current_tile_param;
}
p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_MH; /* FIXME J2K_DEC_STATE_MH; */
opj_image_comp_header_update(l_image,l_cp);
return OPJ_TRUE;
}
| 0
|
193,048
|
void RenderFrameHostCreatedObserver::RenderFrameCreated(
RenderFrameHost* render_frame_host) {
frames_created_++;
if (frames_created_ == expected_frame_count_) {
message_loop_runner_->Quit();
}
}
| 0
|
285,909
|
ResourceDispatcherHostImpl::ResourceDispatcherHostImpl()
: download_file_manager_(new DownloadFileManager(NULL)),
save_file_manager_(new SaveFileManager()),
request_id_(-1),
is_shutdown_(false),
max_outstanding_requests_cost_per_process_(
kMaxOutstandingRequestsCostPerProcess),
filter_(NULL),
delegate_(NULL),
allow_cross_origin_auth_prompt_(false) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!g_resource_dispatcher_host);
g_resource_dispatcher_host = this;
GetContentClient()->browser()->ResourceDispatcherHostCreated();
ANNOTATE_BENIGN_RACE(
&last_user_gesture_time_,
"We don't care about the precise value, see http://crbug.com/92889");
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&appcache::AppCacheInterceptor::EnsureRegistered));
update_load_states_timer_.reset(
new base::RepeatingTimer<ResourceDispatcherHostImpl>());
}
| 0
|
273,018
|
static int adts_write_trailer(AVFormatContext *s)
{
ADTSContext *adts = s->priv_data;
if (adts->apetag)
ff_ape_write_tag(s);
return 0;
}
| 0
|
140,095
|
static void *setup_temp_malloc(vorb *f, int sz)
{
sz = (sz+3) & ~3;
if (f->alloc.alloc_buffer) {
if (f->temp_offset - sz < f->setup_offset) return NULL;
f->temp_offset -= sz;
return (char *) f->alloc.alloc_buffer + f->temp_offset;
}
return malloc(sz);
}
| 0
|
455,515
|
TEST_F(RenameCollectionTest, RenameCollectionAcrossDatabaseDropsTemporaryCollectionOnException) {
_createCollection(_opCtx.get(), _sourceNss);
_createIndexOnEmptyCollection(_opCtx.get(), _sourceNss, "a_1");
_insertDocument(_opCtx.get(), _sourceNss, BSON("_id" << 0));
_opObserver->onInsertsThrows = true;
_opObserver->oplogEntries.clear();
ASSERT_THROWS_CODE(renameCollection(_opCtx.get(), _sourceNss, _targetNssDifferentDb, {}),
AssertionException,
ErrorCodes::OperationFailed);
_checkOplogEntries(_opObserver->oplogEntries, {"create", "index", "drop"});
}
| 0
|
47,254
|
static int proc_pid_schedstat(struct seq_file *m, struct pid_namespace *ns,
struct pid *pid, struct task_struct *task)
{
if (unlikely(!sched_info_on()))
seq_printf(m, "0 0 0\n");
else
seq_printf(m, "%llu %llu %lu\n",
(unsigned long long)task->se.sum_exec_runtime,
(unsigned long long)task->sched_info.run_delay,
task->sched_info.pcount);
return 0;
}
| 0
|
207,135
|
void V8Console::lastEvaluationResultCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
ConsoleHelper helper(info);
InspectedContext* context = helper.ensureInspectedContext();
if (!context)
return;
if (InjectedScript* injectedScript = context->getInjectedScript())
info.GetReturnValue().Set(injectedScript->lastEvaluationResult());
}
| 0
|
74,610
|
static int close_user_core(int user_core_fd, off_t core_size)
{
if (user_core_fd >= 0 && (fsync(user_core_fd) != 0 || close(user_core_fd) != 0 || core_size < 0))
{
perror_msg("Error writing '%s' at '%s'", core_basename, user_pwd);
return -1;
}
return 0;
}
| 0
|
268,244
|
void do_append_file(struct st_command *command)
{
do_write_file_command(command, TRUE);
}
| 0
|
510,707
|
bool ha_partition::initialize_partition(MEM_ROOT *mem_root)
{
handler **file_array, *file;
ulonglong check_table_flags;
DBUG_ENTER("ha_partition::initialize_partition");
if (m_create_handler)
{
m_tot_parts= m_part_info->get_tot_partitions();
DBUG_ASSERT(m_tot_parts > 0);
if (new_handlers_from_part_info(mem_root))
DBUG_RETURN(1);
}
else if (!table_share || !table_share->normalized_path.str)
{
/*
Called with dummy table share (delete, rename and alter table).
Don't need to set-up anything.
*/
DBUG_RETURN(0);
}
else if (get_from_handler_file(table_share->normalized_path.str,
mem_root, false))
{
my_error(ER_FAILED_READ_FROM_PAR_FILE, MYF(0));
DBUG_RETURN(1);
}
/*
We create all underlying table handlers here. We do it in this special
method to be able to report allocation errors.
Set up primary_key_is_clustered and
has_transactions since they are called often in all kinds of places,
other parameters are calculated on demand.
Verify that all partitions have the same table_flags.
*/
check_table_flags= m_file[0]->ha_table_flags();
m_pkey_is_clustered= TRUE;
file_array= m_file;
do
{
file= *file_array;
if (!file->primary_key_is_clustered())
m_pkey_is_clustered= FALSE;
if (check_table_flags != file->ha_table_flags())
{
my_error(ER_MIX_HANDLER_ERROR, MYF(0));
DBUG_RETURN(1);
}
} while (*(++file_array));
m_handler_status= handler_initialized;
DBUG_RETURN(0);
}
| 0
|
424,384
|
int unit_add_two_dependencies(Unit *u, UnitDependency d, UnitDependency e, Unit *other, bool add_reference, UnitDependencyMask mask) {
int r;
assert(u);
r = unit_add_dependency(u, d, other, add_reference, mask);
if (r < 0)
return r;
return unit_add_dependency(u, e, other, add_reference, mask);
}
| 0
|
81,926
|
hfs_cat_read_thread_record(HFS_INFO * hfs, TSK_OFF_T off,
hfs_thread * thread)
{
TSK_FS_INFO *fs = (TSK_FS_INFO *) & (hfs->fs_info);
uint16_t uni_len;
ssize_t cnt;
memset(thread, 0, sizeof(hfs_thread));
cnt = tsk_fs_attr_read(hfs->catalog_attr, off, (char *) thread, 10, 0);
if (cnt != 10) {
if (cnt >= 0) {
tsk_error_reset();
tsk_error_set_errno(TSK_ERR_FS_READ);
}
tsk_error_set_errstr2
("hfs_cat_read_thread_record: Error reading catalog offset %"
PRIuOFF " (header)", off);
return 1;
}
if ((tsk_getu16(fs->endian, thread->rec_type) != HFS_FOLDER_THREAD)
&& (tsk_getu16(fs->endian, thread->rec_type) != HFS_FILE_THREAD)) {
tsk_error_set_errno(TSK_ERR_FS_GENFS);
tsk_error_set_errstr
("hfs_cat_read_thread_record: unexpected record type %" PRIu16,
tsk_getu16(fs->endian, thread->rec_type));
return 1;
}
uni_len = tsk_getu16(fs->endian, thread->name.length);
if (uni_len > 255) {
tsk_error_set_errno(TSK_ERR_FS_INODE_COR);
tsk_error_set_errstr
("hfs_cat_read_thread_record: invalid string length (%" PRIu16
")", uni_len);
return 1;
}
cnt =
tsk_fs_attr_read(hfs->catalog_attr, off + 10,
(char *) thread->name.unicode, uni_len * 2, 0);
if (cnt != uni_len * 2) {
if (cnt >= 0) {
tsk_error_reset();
tsk_error_set_errno(TSK_ERR_FS_READ);
}
tsk_error_set_errstr2
("hfs_cat_read_thread_record: Error reading catalog offset %"
PRIuOFF " (name)", off + 10);
return 1;
}
return 0;
}
| 0
|
58,026
|
static DWORD get_win32_connect_timeout(MYSQL *mysql)
{
DWORD timeout_ms;
uint timeout_sec;
/*
A timeout of 0 means no timeout. Also, the connect_timeout
option value is in seconds, while WIN32 timeouts are in
milliseconds. Hence, check for a possible overflow. In case
of overflow, set to no timeout.
*/
timeout_sec= mysql->options.connect_timeout;
if (!timeout_sec || (timeout_sec > INT_MAX/1000))
timeout_ms= INFINITE;
else
timeout_ms= (DWORD) (timeout_sec * 1000);
return timeout_ms;
}
| 0
|
7,442
|
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;
}
| 1
|
479,179
|
static double mp_image_whds(_cimg_math_parser& mp) {
unsigned int ind = (unsigned int)mp.opcode[2];
if (ind!=~0U) {
if (!mp.imglist.width()) return cimg::type<double>::nan();
ind = (unsigned int)cimg::mod((int)_mp_arg(2),mp.imglist.width());
}
const CImg<T> &img = ind==~0U?mp.imgout:mp.imglist[ind];
return (double)img.width()*img.height()*img.depth()*img.spectrum();
}
| 0
|
222,071
|
bool RenderViewImpl::GetPpapiPluginCaretBounds(gfx::Rect* rect) {
if (!pepper_delegate_.IsPluginFocused())
return false;
*rect = pepper_delegate_.GetCaretBounds();
return true;
}
| 0
|
493,547
|
HIDDEN int mailbox_changequotaroot(struct mailbox *mailbox,
const char *root, int silent)
{
int r = 0;
int res;
quota_t quota_usage[QUOTA_NUMRESOURCES];
mailbox_get_usage(mailbox, quota_usage);
if (mailbox->h.quotaroot) {
quota_t quota_diff[QUOTA_NUMRESOURCES];
if (root) {
size_t len = strlen(root);
if (strlen(mailbox->h.quotaroot) >= len && !strncmp(mailbox->h.quotaroot, root, len) &&
(mailbox->h.quotaroot[len] == '\0' || mailbox->h.quotaroot[len] == '.')) {
/* Part of a child quota root - skip */
goto done;
}
}
/* remove usage from the old quotaroot */
for (res = 0; res < QUOTA_NUMRESOURCES ; res++) {
quota_diff[res] = -quota_usage[res];
}
r = quota_update_useds(mailbox->h.quotaroot, quota_diff,
mailbox_name(mailbox), silent);
}
/* update (or set) the quotaroot */
mailbox_set_quotaroot(mailbox, root);
if (root) {
/* update the new quota root */
r = quota_update_useds(root, quota_usage, mailbox_name(mailbox), silent);
}
done:
return r;
}
| 0
|
182,383
|
void RenderFrameImpl::DidChangePerformanceTiming() {
for (auto& observer : observers_)
observer.DidChangePerformanceTiming();
}
| 0
|
391,052
|
static int ntop_get_interface_find_user_flows(lua_State* vm) {
NetworkInterfaceView *ntop_interface = getCurrentInterface(vm);
char *key;
ntop->getTrace()->traceEvent(TRACE_INFO, "%s() called", __FUNCTION__);
if(!Utils::isUserAdministrator(vm)) return(CONST_LUA_ERROR);
if(ntop_lua_check(vm, __FUNCTION__, 1, LUA_TSTRING)) return(CONST_LUA_ERROR);
key = (char*)lua_tostring(vm, 1);
if(!ntop_interface) return(CONST_LUA_ERROR);
ntop_interface->findUserFlows(vm, key);
return(CONST_LUA_OK);
}
| 0
|
355,127
|
static int pipe_to_file(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
struct splice_desc *sd)
{
struct file *file = sd->u.file;
struct address_space *mapping = file->f_mapping;
unsigned int offset, this_len;
struct page *page;
void *fsdata;
int ret;
/*
* make sure the data in this buffer is uptodate
*/
ret = buf->ops->confirm(pipe, buf);
if (unlikely(ret))
return ret;
offset = sd->pos & ~PAGE_CACHE_MASK;
this_len = sd->len;
if (this_len + offset > PAGE_CACHE_SIZE)
this_len = PAGE_CACHE_SIZE - offset;
ret = pagecache_write_begin(file, mapping, sd->pos, this_len,
AOP_FLAG_UNINTERRUPTIBLE, &page, &fsdata);
if (unlikely(ret))
goto out;
if (buf->page != page) {
/*
* Careful, ->map() uses KM_USER0!
*/
char *src = buf->ops->map(pipe, buf, 1);
char *dst = kmap_atomic(page, KM_USER1);
memcpy(dst + offset, src + buf->offset, this_len);
flush_dcache_page(page);
kunmap_atomic(dst, KM_USER1);
buf->ops->unmap(pipe, buf, src);
}
ret = pagecache_write_end(file, mapping, sd->pos, this_len, this_len,
page, fsdata);
out:
return ret;
}
| 0
|
426,998
|
xsltFreeNsAliasList(xsltNsAliasPtr item)
{
xsltNsAliasPtr tmp;
while (item) {
tmp = item;
item = item->next;
xmlFree(tmp);
}
return;
}
| 0
|
360,703
|
int do_print(const char *path_p, const struct stat *st, int walk_flags, void *unused)
{
const char *default_prefix = NULL;
acl_t acl = NULL, default_acl = NULL;
int error = 0;
if (walk_flags & WALK_TREE_FAILED) {
fprintf(stderr, "%s: %s: %s\n", progname, xquote(path_p, "\n\r"),
strerror(errno));
return 1;
}
/*
* Symlinks can never have ACLs, so when doing a physical walk, we
* skip symlinks altogether, and when doing a half-logical walk, we
* skip all non-toplevel symlinks.
*/
if ((walk_flags & WALK_TREE_SYMLINK) &&
((walk_flags & WALK_TREE_PHYSICAL) ||
!(walk_flags & (WALK_TREE_TOPLEVEL | WALK_TREE_LOGICAL))))
return 0;
if (opt_print_acl) {
acl = acl_get_file(path_p, ACL_TYPE_ACCESS);
if (acl == NULL && (errno == ENOSYS || errno == ENOTSUP))
acl = acl_get_file_mode(path_p);
if (acl == NULL)
goto fail;
}
if (opt_print_default_acl && S_ISDIR(st->st_mode)) {
default_acl = acl_get_file(path_p, ACL_TYPE_DEFAULT);
if (default_acl == NULL) {
if (errno != ENOSYS && errno != ENOTSUP)
goto fail;
} else if (acl_entries(default_acl) == 0) {
acl_free(default_acl);
default_acl = NULL;
}
}
if (opt_skip_base &&
(!acl || acl_equiv_mode(acl, NULL) == 0) && !default_acl)
return 0;
if (opt_print_acl && opt_print_default_acl)
default_prefix = "default:";
if (opt_strip_leading_slash) {
if (*path_p == '/') {
if (!absolute_warning) {
fprintf(stderr, _("%s: Removing leading "
"'/' from absolute path names\n"),
progname);
absolute_warning = 1;
}
while (*path_p == '/')
path_p++;
} else if (*path_p == '.' && *(path_p+1) == '/')
while (*++path_p == '/')
/* nothing */ ;
if (*path_p == '\0')
path_p = ".";
}
if (opt_tabular) {
if (do_show(stdout, path_p, st, acl, default_acl) != 0)
goto fail;
} else {
if (opt_comments) {
printf("# file: %s\n", xquote(path_p, "\n\r"));
printf("# owner: %s\n",
xquote(user_name(st->st_uid, opt_numeric), " \t\n\r"));
printf("# group: %s\n",
xquote(group_name(st->st_gid, opt_numeric), " \t\n\r"));
}
if (acl != NULL) {
char *acl_text = acl_to_any_text(acl, NULL, '\n',
print_options);
if (!acl_text)
goto fail;
if (puts(acl_text) < 0) {
acl_free(acl_text);
goto fail;
}
acl_free(acl_text);
}
if (default_acl != NULL) {
char *acl_text = acl_to_any_text(default_acl,
default_prefix, '\n',
print_options);
if (!acl_text)
goto fail;
if (puts(acl_text) < 0) {
acl_free(acl_text);
goto fail;
}
acl_free(acl_text);
}
}
if (acl || default_acl || opt_comments)
printf("\n");
cleanup:
if (acl)
acl_free(acl);
if (default_acl)
acl_free(default_acl);
return error;
fail:
fprintf(stderr, "%s: %s: %s\n", progname, xquote(path_p, "\n\r"),
strerror(errno));
error = -1;
goto cleanup;
}
| 0
|
231,119
|
GahpClient::condor_job_stage_in(const char *schedd_name, ClassAd *job_ad)
{
static const char* command = "CONDOR_JOB_STAGE_IN";
MyString ad_string;
if (server->m_commands_supported->contains_anycase(command)==FALSE) {
return GAHPCLIENT_COMMAND_NOT_SUPPORTED;
}
if (!schedd_name) schedd_name=NULLSTRING;
if (!job_ad) {
ad_string=NULLSTRING;
} else {
if ( useXMLClassads ) {
ClassAdXMLUnparser unparser;
unparser.SetUseCompactSpacing( true );
unparser.SetOutputType( false );
unparser.SetOutputTargetType( false );
unparser.Unparse( job_ad, ad_string );
} else {
NewClassAdUnparser unparser;
unparser.SetUseCompactSpacing( true );
unparser.SetOutputType( false );
unparser.SetOutputTargetType( false );
unparser.Unparse( job_ad, ad_string );
}
}
std::string reqline;
char *esc1 = strdup( escapeGahpString(schedd_name) );
char *esc2 = strdup( escapeGahpString(ad_string.Value()) );
int x = sprintf(reqline, "%s %s", esc1, esc2);
free( esc1 );
free( esc2 );
ASSERT( x > 0 );
const char *buf = reqline.c_str();
if ( !is_pending(command,buf) ) {
if ( m_mode == results_only ) {
return GAHPCLIENT_COMMAND_NOT_SUBMITTED;
}
now_pending(command,buf,deleg_proxy);
}
Gahp_Args* result = get_pending_result(command,buf);
if ( result ) {
if (result->argc != 3) {
EXCEPT("Bad %s Result",command);
}
int rc = 1;
if ( result->argv[1][0] == 'S' ) {
rc = 0;
}
if ( strcasecmp(result->argv[2], NULLSTRING) ) {
error_string = result->argv[2];
} else {
error_string = "";
}
delete result;
return rc;
}
if ( check_pending_timeout(command,buf) ) {
sprintf( error_string, "%s timed out", command );
return GAHPCLIENT_COMMAND_TIMED_OUT;
}
return GAHPCLIENT_COMMAND_PENDING;
}
| 0
|
82,721
|
vim_regexec_string(
regmatch_T *rmp,
char_u *line, // string to match against
colnr_T col, // column to start looking for match
int nl)
{
int result;
regexec_T rex_save;
int rex_in_use_save = rex_in_use;
// Cannot use the same prog recursively, it contains state.
if (rmp->regprog->re_in_use)
{
emsg(_(e_cannot_use_pattern_recursively));
return FALSE;
}
rmp->regprog->re_in_use = TRUE;
if (rex_in_use)
// Being called recursively, save the state.
rex_save = rex;
rex_in_use = TRUE;
rex.reg_startp = NULL;
rex.reg_endp = NULL;
rex.reg_startpos = NULL;
rex.reg_endpos = NULL;
result = rmp->regprog->engine->regexec_nl(rmp, line, col, nl);
rmp->regprog->re_in_use = FALSE;
// NFA engine aborted because it's very slow.
if (rmp->regprog->re_engine == AUTOMATIC_ENGINE
&& result == NFA_TOO_EXPENSIVE)
{
int save_p_re = p_re;
int re_flags = rmp->regprog->re_flags;
char_u *pat = vim_strsave(((nfa_regprog_T *)rmp->regprog)->pattern);
p_re = BACKTRACKING_ENGINE;
vim_regfree(rmp->regprog);
if (pat != NULL)
{
#ifdef FEAT_EVAL
report_re_switch(pat);
#endif
rmp->regprog = vim_regcomp(pat, re_flags);
if (rmp->regprog != NULL)
{
rmp->regprog->re_in_use = TRUE;
result = rmp->regprog->engine->regexec_nl(rmp, line, col, nl);
rmp->regprog->re_in_use = FALSE;
}
vim_free(pat);
}
p_re = save_p_re;
}
rex_in_use = rex_in_use_save;
if (rex_in_use)
rex = rex_save;
return result > 0;
}
| 0
|
43,800
|
static void dump_vmcs(void)
{
u32 vmentry_ctl = vmcs_read32(VM_ENTRY_CONTROLS);
u32 vmexit_ctl = vmcs_read32(VM_EXIT_CONTROLS);
u32 cpu_based_exec_ctrl = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
u32 pin_based_exec_ctrl = vmcs_read32(PIN_BASED_VM_EXEC_CONTROL);
u32 secondary_exec_control = 0;
unsigned long cr4 = vmcs_readl(GUEST_CR4);
u64 efer = vmcs_readl(GUEST_IA32_EFER);
int i, n;
if (cpu_has_secondary_exec_ctrls())
secondary_exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL);
pr_err("*** Guest State ***\n");
pr_err("CR0: actual=0x%016lx, shadow=0x%016lx, gh_mask=%016lx\n",
vmcs_readl(GUEST_CR0), vmcs_readl(CR0_READ_SHADOW),
vmcs_readl(CR0_GUEST_HOST_MASK));
pr_err("CR4: actual=0x%016lx, shadow=0x%016lx, gh_mask=%016lx\n",
cr4, vmcs_readl(CR4_READ_SHADOW), vmcs_readl(CR4_GUEST_HOST_MASK));
pr_err("CR3 = 0x%016lx\n", vmcs_readl(GUEST_CR3));
if ((secondary_exec_control & SECONDARY_EXEC_ENABLE_EPT) &&
(cr4 & X86_CR4_PAE) && !(efer & EFER_LMA))
{
pr_err("PDPTR0 = 0x%016lx PDPTR1 = 0x%016lx\n",
vmcs_readl(GUEST_PDPTR0), vmcs_readl(GUEST_PDPTR1));
pr_err("PDPTR2 = 0x%016lx PDPTR3 = 0x%016lx\n",
vmcs_readl(GUEST_PDPTR2), vmcs_readl(GUEST_PDPTR3));
}
pr_err("RSP = 0x%016lx RIP = 0x%016lx\n",
vmcs_readl(GUEST_RSP), vmcs_readl(GUEST_RIP));
pr_err("RFLAGS=0x%08lx DR7 = 0x%016lx\n",
vmcs_readl(GUEST_RFLAGS), vmcs_readl(GUEST_DR7));
pr_err("Sysenter RSP=%016lx CS:RIP=%04x:%016lx\n",
vmcs_readl(GUEST_SYSENTER_ESP),
vmcs_read32(GUEST_SYSENTER_CS), vmcs_readl(GUEST_SYSENTER_EIP));
vmx_dump_sel("CS: ", GUEST_CS_SELECTOR);
vmx_dump_sel("DS: ", GUEST_DS_SELECTOR);
vmx_dump_sel("SS: ", GUEST_SS_SELECTOR);
vmx_dump_sel("ES: ", GUEST_ES_SELECTOR);
vmx_dump_sel("FS: ", GUEST_FS_SELECTOR);
vmx_dump_sel("GS: ", GUEST_GS_SELECTOR);
vmx_dump_dtsel("GDTR:", GUEST_GDTR_LIMIT);
vmx_dump_sel("LDTR:", GUEST_LDTR_SELECTOR);
vmx_dump_dtsel("IDTR:", GUEST_IDTR_LIMIT);
vmx_dump_sel("TR: ", GUEST_TR_SELECTOR);
if ((vmexit_ctl & (VM_EXIT_SAVE_IA32_PAT | VM_EXIT_SAVE_IA32_EFER)) ||
(vmentry_ctl & (VM_ENTRY_LOAD_IA32_PAT | VM_ENTRY_LOAD_IA32_EFER)))
pr_err("EFER = 0x%016llx PAT = 0x%016lx\n",
efer, vmcs_readl(GUEST_IA32_PAT));
pr_err("DebugCtl = 0x%016lx DebugExceptions = 0x%016lx\n",
vmcs_readl(GUEST_IA32_DEBUGCTL),
vmcs_readl(GUEST_PENDING_DBG_EXCEPTIONS));
if (vmentry_ctl & VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL)
pr_err("PerfGlobCtl = 0x%016lx\n",
vmcs_readl(GUEST_IA32_PERF_GLOBAL_CTRL));
if (vmentry_ctl & VM_ENTRY_LOAD_BNDCFGS)
pr_err("BndCfgS = 0x%016lx\n", vmcs_readl(GUEST_BNDCFGS));
pr_err("Interruptibility = %08x ActivityState = %08x\n",
vmcs_read32(GUEST_INTERRUPTIBILITY_INFO),
vmcs_read32(GUEST_ACTIVITY_STATE));
if (secondary_exec_control & SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY)
pr_err("InterruptStatus = %04x\n",
vmcs_read16(GUEST_INTR_STATUS));
pr_err("*** Host State ***\n");
pr_err("RIP = 0x%016lx RSP = 0x%016lx\n",
vmcs_readl(HOST_RIP), vmcs_readl(HOST_RSP));
pr_err("CS=%04x SS=%04x DS=%04x ES=%04x FS=%04x GS=%04x TR=%04x\n",
vmcs_read16(HOST_CS_SELECTOR), vmcs_read16(HOST_SS_SELECTOR),
vmcs_read16(HOST_DS_SELECTOR), vmcs_read16(HOST_ES_SELECTOR),
vmcs_read16(HOST_FS_SELECTOR), vmcs_read16(HOST_GS_SELECTOR),
vmcs_read16(HOST_TR_SELECTOR));
pr_err("FSBase=%016lx GSBase=%016lx TRBase=%016lx\n",
vmcs_readl(HOST_FS_BASE), vmcs_readl(HOST_GS_BASE),
vmcs_readl(HOST_TR_BASE));
pr_err("GDTBase=%016lx IDTBase=%016lx\n",
vmcs_readl(HOST_GDTR_BASE), vmcs_readl(HOST_IDTR_BASE));
pr_err("CR0=%016lx CR3=%016lx CR4=%016lx\n",
vmcs_readl(HOST_CR0), vmcs_readl(HOST_CR3),
vmcs_readl(HOST_CR4));
pr_err("Sysenter RSP=%016lx CS:RIP=%04x:%016lx\n",
vmcs_readl(HOST_IA32_SYSENTER_ESP),
vmcs_read32(HOST_IA32_SYSENTER_CS),
vmcs_readl(HOST_IA32_SYSENTER_EIP));
if (vmexit_ctl & (VM_EXIT_LOAD_IA32_PAT | VM_EXIT_LOAD_IA32_EFER))
pr_err("EFER = 0x%016lx PAT = 0x%016lx\n",
vmcs_readl(HOST_IA32_EFER), vmcs_readl(HOST_IA32_PAT));
if (vmexit_ctl & VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL)
pr_err("PerfGlobCtl = 0x%016lx\n",
vmcs_readl(HOST_IA32_PERF_GLOBAL_CTRL));
pr_err("*** Control State ***\n");
pr_err("PinBased=%08x CPUBased=%08x SecondaryExec=%08x\n",
pin_based_exec_ctrl, cpu_based_exec_ctrl, secondary_exec_control);
pr_err("EntryControls=%08x ExitControls=%08x\n", vmentry_ctl, vmexit_ctl);
pr_err("ExceptionBitmap=%08x PFECmask=%08x PFECmatch=%08x\n",
vmcs_read32(EXCEPTION_BITMAP),
vmcs_read32(PAGE_FAULT_ERROR_CODE_MASK),
vmcs_read32(PAGE_FAULT_ERROR_CODE_MATCH));
pr_err("VMEntry: intr_info=%08x errcode=%08x ilen=%08x\n",
vmcs_read32(VM_ENTRY_INTR_INFO_FIELD),
vmcs_read32(VM_ENTRY_EXCEPTION_ERROR_CODE),
vmcs_read32(VM_ENTRY_INSTRUCTION_LEN));
pr_err("VMExit: intr_info=%08x errcode=%08x ilen=%08x\n",
vmcs_read32(VM_EXIT_INTR_INFO),
vmcs_read32(VM_EXIT_INTR_ERROR_CODE),
vmcs_read32(VM_EXIT_INSTRUCTION_LEN));
pr_err(" reason=%08x qualification=%016lx\n",
vmcs_read32(VM_EXIT_REASON), vmcs_readl(EXIT_QUALIFICATION));
pr_err("IDTVectoring: info=%08x errcode=%08x\n",
vmcs_read32(IDT_VECTORING_INFO_FIELD),
vmcs_read32(IDT_VECTORING_ERROR_CODE));
pr_err("TSC Offset = 0x%016lx\n", vmcs_readl(TSC_OFFSET));
if (secondary_exec_control & SECONDARY_EXEC_TSC_SCALING)
pr_err("TSC Multiplier = 0x%016lx\n",
vmcs_readl(TSC_MULTIPLIER));
if (cpu_based_exec_ctrl & CPU_BASED_TPR_SHADOW)
pr_err("TPR Threshold = 0x%02x\n", vmcs_read32(TPR_THRESHOLD));
if (pin_based_exec_ctrl & PIN_BASED_POSTED_INTR)
pr_err("PostedIntrVec = 0x%02x\n", vmcs_read16(POSTED_INTR_NV));
if ((secondary_exec_control & SECONDARY_EXEC_ENABLE_EPT))
pr_err("EPT pointer = 0x%016lx\n", vmcs_readl(EPT_POINTER));
n = vmcs_read32(CR3_TARGET_COUNT);
for (i = 0; i + 1 < n; i += 4)
pr_err("CR3 target%u=%016lx target%u=%016lx\n",
i, vmcs_readl(CR3_TARGET_VALUE0 + i * 2),
i + 1, vmcs_readl(CR3_TARGET_VALUE0 + i * 2 + 2));
if (i < n)
pr_err("CR3 target%u=%016lx\n",
i, vmcs_readl(CR3_TARGET_VALUE0 + i * 2));
if (secondary_exec_control & SECONDARY_EXEC_PAUSE_LOOP_EXITING)
pr_err("PLE Gap=%08x Window=%08x\n",
vmcs_read32(PLE_GAP), vmcs_read32(PLE_WINDOW));
if (secondary_exec_control & SECONDARY_EXEC_ENABLE_VPID)
pr_err("Virtual processor ID = 0x%04x\n",
vmcs_read16(VIRTUAL_PROCESSOR_ID));
}
| 0
|
106,098
|
TRIO_PUBLIC trio_pointer_t trio_register TRIO_ARGS2((callback, name), trio_callback_t callback,
TRIO_CONST char* name)
{
trio_userdef_t* def;
trio_userdef_t* prev = NULL;
if (callback == NULL)
return NULL;
if (name)
{
/* Handle built-in namespaces */
if (name[0] == ':')
{
if (trio_equal(name, ":enter"))
{
internalEnterCriticalRegion = callback;
}
else if (trio_equal(name, ":leave"))
{
internalLeaveCriticalRegion = callback;
}
return NULL;
}
/* Bail out if namespace is too long */
if (trio_length_max(name, MAX_USER_NAME) >= MAX_USER_NAME)
return NULL;
/* Bail out if namespace already is registered */
def = TrioFindNamespace(name, &prev);
if (def)
return NULL;
}
def = (trio_userdef_t*)TRIO_MALLOC(sizeof(trio_userdef_t));
if (def)
{
if (internalEnterCriticalRegion)
(void)internalEnterCriticalRegion(NULL);
if (name)
{
/* Link into internal list */
if (prev == NULL)
internalUserDef = def;
else
prev->next = def;
}
/* Initialize */
def->callback = callback;
def->name = (name == NULL) ? NULL : trio_duplicate(name);
def->next = NULL;
if (internalLeaveCriticalRegion)
(void)internalLeaveCriticalRegion(NULL);
}
return (trio_pointer_t)def;
}
| 0
|
323,642
|
static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, DCTELEM *block)
{
int i;
register int t1,t2,t3,t4,t5,t6,t7,t8;
DCTELEM *src, *dst;
const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
src = block;
dst = block;
for(i = 0; i < 8; i++){
t1 = 17 * (src[0] + src[2]) + 4;
t2 = 17 * (src[0] - src[2]) + 4;
t3 = 22 * src[1] + 10 * src[3];
t4 = 22 * src[3] - 10 * src[1];
dst[0] = (t1 + t3) >> 3;
dst[1] = (t2 - t4) >> 3;
dst[2] = (t2 + t4) >> 3;
dst[3] = (t1 - t3) >> 3;
src += 8;
dst += 8;
}
src = block;
for(i = 0; i < 4; i++){
t1 = 12 * (src[ 0] + src[32]) + 64;
t2 = 12 * (src[ 0] - src[32]) + 64;
t3 = 16 * src[16] + 6 * src[48];
t4 = 6 * src[16] - 16 * src[48];
t5 = t1 + t3;
t6 = t2 + t4;
t7 = t2 - t4;
t8 = t1 - t3;
t1 = 16 * src[ 8] + 15 * src[24] + 9 * src[40] + 4 * src[56];
t2 = 15 * src[ 8] - 4 * src[24] - 16 * src[40] - 9 * src[56];
t3 = 9 * src[ 8] - 16 * src[24] + 4 * src[40] + 15 * src[56];
t4 = 4 * src[ 8] - 9 * src[24] + 15 * src[40] - 16 * src[56];
dest[0*linesize] = cm[dest[0*linesize] + ((t5 + t1) >> 7)];
dest[1*linesize] = cm[dest[1*linesize] + ((t6 + t2) >> 7)];
dest[2*linesize] = cm[dest[2*linesize] + ((t7 + t3) >> 7)];
dest[3*linesize] = cm[dest[3*linesize] + ((t8 + t4) >> 7)];
dest[4*linesize] = cm[dest[4*linesize] + ((t8 - t4 + 1) >> 7)];
dest[5*linesize] = cm[dest[5*linesize] + ((t7 - t3 + 1) >> 7)];
dest[6*linesize] = cm[dest[6*linesize] + ((t6 - t2 + 1) >> 7)];
dest[7*linesize] = cm[dest[7*linesize] + ((t5 - t1 + 1) >> 7)];
src ++;
dest++;
}
}
| 0
|
139,842
|
ram_addr_t memory_region_get_ram_addr(MemoryRegion *mr)
{
return mr->ram_block ? mr->ram_block->offset : RAM_ADDR_INVALID;
}
| 0
|
186,641
|
int NavigationControllerImpl::GetIndexOfEntry(
const NavigationEntryImpl* entry) const {
const NavigationEntries::const_iterator i(std::find(
entries_.begin(),
entries_.end(),
entry));
return (i == entries_.end()) ? -1 : static_cast<int>(i - entries_.begin());
}
| 0
|
27,272
|
static void dtap_sms_cp_data ( tvbuff_t * tvb , proto_tree * tree , packet_info * pinfo _U_ , guint32 offset , guint len ) {
guint32 curr_offset ;
guint32 consumed ;
guint curr_len ;
curr_offset = offset ;
curr_len = len ;
is_uplink = IS_UPLINK_TRUE ;
ELEM_MAND_LV ( GSM_A_PDU_TYPE_DTAP , DE_CP_USER_DATA , NULL ) ;
EXTRANEOUS_DATA_CHECK ( curr_len , 0 , pinfo , & ei_gsm_a_dtap_extraneous_data ) ;
}
| 0
|
161,186
|
unsigned int getNumber() const {
return number;
}
| 0
|
381,797
|
CopySendString(CopyState cstate, const char *str)
{
appendBinaryStringInfo(cstate->fe_msgbuf, str, strlen(str));
}
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.