Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
qemu | exec.c | static long gethugepagesize(const char *path, Error **errp)
{
struct statfs fs;
int ret;
do {
ret = statfs(path, &fs);
} while (ret != 0 && errno == EINTR);
if (ret != 0) {
error_setg_errno(errp, errno, "failed to get page size of file %s",
path);
return 0;
}
if... | [
1,
0
] |
qemu | MAINTAINERS | static void raw_eject(BlockDriverState *bs, bool eject_flag)
{
bdrv_eject(bs->file->bs, eject_flag);
} | [
0,
0
] |
FFmpeg | libavformat/network.c | int ff_listen_bind(int fd, const struct sockaddr *addr,
socklen_t addrlen, int timeout, URLContext *h)
{
int ret;
int reuse = 1;
struct pollfd lp = {fd, POLLIN, 0};
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse))) {
av_log(NULL, AV_LOG_WARNING, "setsockopt(SO_RE... | [
1,
0
] |
qemu | hw/char/sclpconsole.c | static int chr_can_read(void *opaque)
{
SCLPConsole *scon = opaque;
return SIZE_BUFFER_VT220 - scon->iov_data_len;
} | [
0,
0
] |
FFmpeg | libavcodec/dxva2_mpeg2.c | static int skip_check(MpegEncContext *s, Picture *p, Picture *ref)
{
int x, y, plane;
int score = 0;
int64_t score64 = 0;
for (plane = 0; plane < 3; plane++) {
const int stride = p->f.linesize[plane];
const int bw = plane ? 1 : 2;
for (y = 0; y < s->mb_height * bw; y++) {
for (x = 0; ... | [
1,
0
] |
qemu | target/m68k/helper.c | uint32_t HELPER(sar_cc)(CPUM68KState *env, uint32_t val, uint32_t shift)
{
uint64_t temp;
uint32_t result;
shift &= 63;
temp = (int64_t)val << 32 >> shift;
result = temp >> 32;
env->cc_c = (temp >> 31) & 1;
env->cc_n = result;
env->cc_z = result;
env->cc_v = result ^ val;
env->cc_x = shif... | [
1,
0
] |
FFmpeg | libavcodec/aacenc.c | static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
const AVFrame *frame, int *got_packet_ptr)
{
int i, k, channel;
DCAContext *c = avctx->priv_data;
const int16_t *samples;
int ret, real_channel = 0;
if ((ret = ff_alloc_packet2(avctx, avpkt,
... | [
1,
0
] |
qemu | util/thread-pool.c | static void thread_pool_completion_bh(void *opaque) {
ThreadPool *pool = opaque;
ThreadPoolElement *elem, *next;
aio_context_acquire(pool->ctx);
restart:
QLIST_FOREACH_SAFE(elem, &pool->head, all, next) {
if (elem->state != THREAD_DONE) {
continue;
}
trace_thread_pool_complete(pool, elem, elem... | [
1,
0
] |
qemu | hw/core/qdev-properties.c | static void ivshmem_check_memdev_is_busy(Object *obj, const char *name,
Object *val, Error **errp)
{
if (host_memory_backend_is_mapped(MEMORY_BACKEND(val))) {
char *path = object_get_canonical_path_component(val);
error_setg(errp, "can't use already busy memdev: %... | [
1,
0
] |
FFmpeg | libavformat/isom.c | int ff_mov_iso639_to_lang(const char *lang, int mp4)
{
int i, code = 0;
/* old way, only for QT? */
for (i = 0; !mp4 && i < FF_ARRAY_ELEMS(mov_mdhd_language_map); i++) {
if (mov_mdhd_language_map[i] && !strcmp(lang, mov_mdhd_language_map[i]))
return i;
}
/* XXX:can we do that in mov too? */
... | [
1,
0
] |
qemu | tests/boot-order-test.c | static void test_nop(gconstpointer data)
{
QTestState *s;
const char *machine = data;
char *args;
args = g_strdup_printf("-display none -machine %s", machine);
s = qtest_start(args);
if (s) {
qtest_quit(s);
}
g_free(args);
} | [
1,
0
] |
qemu | block/qapi.c | char *object_property_print(Object *obj, const char *name, bool human,
Error **errp)
{
StringOutputVisitor *sov;
char *string = NULL;
Error *local_err = NULL;
sov = string_output_visitor_new(human);
object_property_get(obj, string_output_get_visitor(sov), name, &local_err);
... | [
0,
0
] |
qemu | Makefile.objs | static int send_sub_rect_solid(VncState *vs, int x, int y, int w, int h)
{
vnc_framebuffer_update(vs, x, y, w, h, VNC_ENCODING_TIGHT);
vnc_tight_start(vs);
vnc_raw_send_framebuffer_update(vs, x, y, w, h);
vnc_tight_stop(vs);
return send_solid_rect(vs);
} | [
0,
0
] |
qemu | buffered_file.c | void qemu_announce_self(void)
{
static QEMUTimer *timer;
timer = qemu_new_timer(rt_clock, qemu_announce_self_once, &timer);
qemu_announce_self_once(&timer);
} | [
0,
0
] |
FFmpeg | ffmpeg.c | static int mpegts_probe(AVProbeData *p)
{
const int size = p->buf_size;
int maxscore = 0;
int sumscore = 0;
int i;
int check_count = size / TS_FEC_PACKET_SIZE;
#define CHECK_COUNT 10
#define CHECK_BLOCK 100
if (check_count < CHECK_COUNT)
return 0;
for (i = 0; i < check_count; i += CHECK_BLO... | [
1,
0
] |
qemu | target-ppc/mmu-hash32.c | static int ppc_hash32_pp_check(int key, int pp, int nx)
{
int access;
/* Compute access rights */
access = 0;
if (key == 0) {
switch (pp) {
case 0x0:
case 0x1:
case 0x2:
access |= PAGE_WRITE;
/* No break here */
case 0x3:
access |= PAGE_READ;
break;
... | [
1,
0
] |
qemu | target-i386/helper.c | static inline void load_seg_cache_raw_dt(SegmentCache *sc, uint32_t e1,
uint32_t e2)
{
sc->base = get_seg_base(e1, e2);
sc->limit = get_seg_limit(e1, e2);
sc->flags = e2;
} | [
0,
0
] |
qemu | target-i386/translate.c | static inline void gen_op_mov_v_reg(int ot, TCGv t0, int reg)
{
switch (ot) {
case OT_BYTE:
if (reg < 4 X86_64_DEF(|| reg >= 8 || x86_64_hregs)) {
goto std_case;
} else {
tcg_gen_shri_tl(t0, cpu_regs[reg - 4], 8);
tcg_gen_ext8u_tl(t0, t0);
}
break;
default:
std_case:... | [
1,
0
] |
FFmpeg | configure | static inline void int8x8_fmul_int32(DCADSPContext *dsp, float *dst,
const int8_t *src, int scale)
{
dsp->int8x8_fmul_int32(dst, src, scale);
} | [
0,
0
] |
qemu | block-raw.c | static int hdev_open(BlockDriverState *bs, const char *filename, int flags)
{
BDRVRawState *s = bs->opaque;
int access_flags, create_flags;
DWORD overlapped;
char device_name[64];
if (strstart(filename, "/dev/cdrom", NULL)) {
if (find_cdrom(device_name, sizeof(device_name)) < 0)
return -ENOE... | [
1,
0
] |
qemu | block/parallels.c | static int parallels_probe(const uint8_t *buf, int buf_size,
const char *filename)
{
const ParallelsHeader *ph = (const void *)buf;
if (buf_size < sizeof(ParallelsHeader))
return 0;
if ((!memcmp(ph->magic, HEADER_MAGIC, 16) ||
!memcmp(ph->magic, HEADER_MAGIC2, 16)) &&
... | [
1,
0
] |
qemu | aio-posix.c | QEMUBH *aio_bh_new(AioContext *ctx, QEMUBHFunc *cb, void *opaque)
{
QEMUBH *bh;
bh = g_malloc0(sizeof(QEMUBH));
bh->ctx = ctx;
bh->cb = cb;
bh->opaque = opaque;
qemu_mutex_lock(&ctx->bh_lock);
bh->next = ctx->first_bh;
/* Make sure that the members are ready before putting bh into list */
sm... | [
0,
0
] |
qemu | target-ppc/cpu-models.c | static int check_pow_970MP(CPUPPCState *env)
{
if (env->spr[SPR_HID0] & 0x01C00000)
return 1;
return 0;
} | [
0,
0
] |
qemu | savevm.c | int qemu_fclose(QEMUFile *f)
{
int ret = 0;
qemu_fflush(f);
if (f->close)
ret = f->close(f->opaque);
g_free(f);
return ret;
} | [
1,
0
] |
FFmpeg | libavformat/mpegtsenc.c | static int mpegts_write_end(AVFormatContext *s)
{
MpegTSWrite *ts = s->priv_data;
MpegTSWriteStream *ts_st;
MpegTSService *service;
AVStream *st;
int i;
/* flush current packets */
for (i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
ts_st = st->priv_data;
if (ts_st->payload_in... | [
1,
0
] |
FFmpeg | libavcodec/ansi.c | static void draw_char(AVCodecContext *avctx, int c)
{
AnsiContext *s = avctx->priv_data;
int fg = s->fg;
int bg = s->bg;
if ((s->attributes & ATTR_BOLD))
fg += 8;
if ((s->attributes & ATTR_BLINK))
bg += 8;
if ((s->attributes & ATTR_REVERSE))
FFSWAP(int, fg, bg);
if ((s->attributes &... | [
1,
0
] |
FFmpeg | libavcodec/dcaenc.c | static int init_quantization_noise(DCAEncContext *c, int noise)
{
int ch, band, ret = 0;
c->consumed_bits = 132 + 493 * c->fullband_channels;
if (c->lfe_channel)
c->consumed_bits += 72;
/* attempt to guess the bit distribution based on the prevoius frame */
for (ch = 0; ch < c->fullband_channels; c... | [
0,
0
] |
qemu | block/qcow2-refcount.c | int64_t qcow2_alloc_clusters(BlockDriverState *bs, int64_t size)
{
int64_t offset;
int ret;
BLKDBG_EVENT(bs->file, BLKDBG_CLUSTER_ALLOC);
offset = alloc_clusters_noref(bs, size);
if (offset < 0) {
return offset;
}
ret = update_refcount(bs, offset, size, 1, QCOW2_DISCARD_NEVER);
if (ret < 0)... | [
1,
0
] |
qemu | configure | void vm_stop(int reason)
{
do_vm_stop(reason);
} | [
1,
0
] |
qemu | block/blkverify.c | static BlockAIOCB *blkverify_aio_writev(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov,
int nb_sectors,
BlockCompletionFunc *cb, void *opaque)
{
BDRVBlkverifyState *s = bs->opaque;... | [
1,
0
] |
FFmpeg | libavcodec/vorbis_enc.c | static void floor_fit(vorbis_enc_context *venc, vorbis_enc_floor *fc,
float *coeffs, uint_fast16_t *posts, int samples)
{
int range = 255 / fc->multiplier + 1;
int i;
float tot_average = 0.;
float averages[fc->values];
for (i = 0; i < fc->values; i++) {
averages[i] = get_floo... | [
1,
0
] |
FFmpeg | libavformat/rtpdec.c | static int rtp_parse_mp4_au(RTPDemuxContext *s, const uint8_t *buf)
{
int au_headers_length, au_header_size, i;
GetBitContext getbitcontext;
RTPPayloadData *infos;
infos = s->rtp_payload_data;
if (infos == NULL)
return -1;
/* decode the first 2 bytes where the AUHeader sections are stored
... | [
1,
1
] |
qemu | hmp.c | static void hmp_migrate_status_cb(void *opaque)
{
MigrationStatus *status = opaque;
MigrationInfo *info;
info = qmp_query_migrate(NULL);
if (!info->has_status || strcmp(info->status, "active") == 0) {
if (info->has_disk) {
int progress;
if (info->disk->remaining) {
progress = in... | [
1,
0
] |
qemu | audio/paaudio.c | static void *qpa_audio_init(void)
{
return &conf;
} | [
1,
0
] |
qemu | Makefile.objs | void timer_deinit(QEMUTimer *ts)
{
assert(ts->expire_time == -1);
ts->timer_list = NULL;
} | [
0,
0
] |
qemu | monitor.c | static void term_read(void *opaque, const uint8_t *buf, int size)
{
int i;
for (i = 0; i < size; i++)
term_handle_byte(buf[i]);
} | [
0,
0
] |
qemu | HACKING | static uint32_t cuda_readl(void *opaque, target_phys_addr_t addr)
{
return 0;
} | [
0,
0
] |
qemu | block/backup.c | static void coroutine_fn mirror_pause(BlockJob *job)
{
MirrorBlockJob *s = container_of(job, MirrorBlockJob, common);
mirror_drain(s);
} | [
0,
0
] |
qemu | backends/baum.c | int net_init_bridge(const NetClientOptions *opts, const char *name,
NetClientState *peer, Error **errp)
{
const NetdevBridgeOptions *bridge;
const char *helper, *br;
TAPState *s;
int fd, vnet_hdr;
assert(opts->type == NET_CLIENT_OPTIONS_KIND_BRIDGE);
bridge = opts->u.bridge;
h... | [
1,
0
] |
qemu | cpu-exec.c | static inline void t_gen_raise_exception(uint32_t index)
{
tcg_gen_helper_0_1(helper_raise_exception, tcg_const_tl(index));
} | [
0,
0
] |
qemu | Makefile.objs | uint64_t ram_bytes_total(void)
{
return last_ram_offset;
} | [
0,
0
] |
qemu | target-i386/helper.c | int kvm_arch_on_sigbus(int code, void *addr)
{
#ifdef KVM_CAP_MCE
if ((first_cpu->mcg_cap & MCG_SER_P) && addr && code == BUS_MCEERR_AO) {
void *vaddr;
ram_addr_t ram_addr;
target_phys_addr_t paddr;
/* Hope we are lucky for AO MCE */
vaddr = addr;
if (qemu_ram_addr_from_host(vaddr, &r... | [
0,
0
] |
qemu | target/mips/helper.c | int mips_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int rw,
int mmu_idx)
{
MIPSCPU *cpu = MIPS_CPU(cs);
CPUMIPSState *env = &cpu->env;
#if !defined(CONFIG_USER_ONLY)
hwaddr physical;
int prot;
int access_type;
#endif
int ret = 0;
#if 0
log_cpu_state(cs, 0... | [
1,
1
] |
qemu | cpu-all.h | void cpu_reset(CPUM68KState *env) {
memset(env, 0, offsetof(CPUM68KState, breakpoints));
#if !defined(CONFIG_USER_ONLY)
env->sr = 0x2700;
#endif
m68k_switch_sp(env);
/* ??? FP regs should be initialized to NaN. */
env->cc_op = CC_OP_FLAGS;
/* TODO: We should set PC from the interrupt vector. */
env->pc ... | [
1,
1
] |
FFmpeg | libavcodec/Makefile | static void sbr_qmf_analysis(DSPContext *dsp, FFTContext *mdct, const float *in,
float *x,
float z[320], float W[2][32][32][2])
{
int i, k;
memcpy(W[0], W[1], sizeof(W[0]));
memcpy(x, x + 1024, (320 - 32) * sizeof(x[0]));
memcpy(x + 288, in, 1024 *... | [
1,
0
] |
qemu | Makefile.objs | static void tight_pack24(VncState *vs, uint8_t *buf, size_t count, size_t *ret)
{
uint32_t *buf32;
uint32_t pix;
int rshift, gshift, bshift;
buf32 = (uint32_t *)buf;
if ((vs->clientds.flags & QEMU_BIG_ENDIAN_FLAG) ==
(vs->ds->surface->flags & QEMU_BIG_ENDIAN_FLAG)) {
rshift = vs->clientds.pf... | [
1,
0
] |
qemu | HACKING | static uint64_t gic_thiscpu_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
GICState *s = (GICState *)opaque;
return gic_cpu_read(s, gic_get_current_cpu(s), addr);
} | [
0,
0
] |
FFmpeg | libavdevice/alsa-audio-enc.c | audio_get_output_timestamp(AVFormatContext *s1, int stream,
int64_t *dts, int64_t *wall)
{
AlsaData *s = s1->priv_data;
snd_pcm_sframes_t delay = 0;
*wall = av_gettime();
snd_pcm_delay(s->h, &delay);
*dts = s1->streams[0]->cur_dts - delay;
} | [
1,
0
] |
qemu | hw/core/stream.c | xilinx_axienet_data_stream_push(StreamSlave *obj, uint8_t *buf, size_t size,
uint32_t *hdr)
{
XilinxAXIEnetStreamSlave *ds = XILINX_AXI_ENET_DATA_STREAM(obj);
XilinxAXIEnet *s = ds->enet;
/* TX enable ? */
if (!(s->tc & TC_TX)) {
return size;
}
/* Jumbo or vlan s... | [
1,
0
] |
qemu | acl.c | static int audio_attach_capture(HWVoiceOut *hw)
{
AudioState *s = &glob_audio_state;
CaptureVoiceOut *cap;
audio_detach_capture(hw);
for (cap = s->cap_head.lh_first; cap; cap = cap->entries.le_next) {
SWVoiceCap *sc;
SWVoiceOut *sw;
HWVoiceOut *hw_cap = &cap->hw;
sc = audio_calloc(AUDIO... | [
1,
0
] |
FFmpeg | ffserver_config.c | static int ffserver_opt_preset(const char *arg,
AVCodecContext *avctx, int type,
enum AVCodecID *audio_id,
enum AVCodecID *video_id)
{
FILE *f = NULL;
char filename[1000], tmp[1000], tmp2[1000], line[1000];
int ret ... | [
1,
0
] |
qemu | block.c | int bdrv_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors)
{
Coroutine *co;
DiscardCo rwco = {
.bs = bs,
.sector_num = sector_num,
.nb_sectors = nb_sectors,
.ret = NOT_DONE,
};
if (qemu_in_coroutine()) {
/* Fast-path if already in coroutine context */
b... | [
0,
0
] |
qemu | target-i386/exec.h | void cpu_x86_set_a20(CPUX86State *env, int a20_state)
{
a20_state = (a20_state != 0);
if (a20_state != a20_enabled) {
#if defined(DEBUG_MMU)
printf("A20 update: a20=%d\n", a20_state);
#endif
/* if the cpu is currently executing code, we must unlink it and
all the potentially executing TB */
... | [
1,
0
] |
qemu | block/qcow2-cluster.c | static coroutine_fn int qcow2_co_pdiscard(BlockDriverState *bs,
int64_t offset, int count)
{
int ret;
BDRVQcow2State *s = bs->opaque;
if (!QEMU_IS_ALIGNED(offset | count, s->cluster_size)) {
assert(count < s->cluster_size);
/* Ignore partial clusters, excep... | [
1,
0
] |
qemu | hw/i386/acpi-build.c | static void acpi_build_update(void *build_opaque, uint32_t offset)
{
AcpiBuildState *build_state = build_opaque;
AcpiBuildTables tables;
/* No state to update or already patched? Nothing to do. */
if (!build_state || build_state->patched) {
return;
}
build_state->patched = 1;
acpi_build_tables... | [
1,
0
] |
qemu | hw/net/vhost_net.c | struct vhost_net *vhost_net_init(VhostNetOptions *options)
{
int r;
bool backend_kernel = options->backend_type == VHOST_BACKEND_TYPE_KERNEL;
struct vhost_net *net = g_malloc(sizeof *net);
if (!options->net_backend) {
fprintf(stderr, "vhost-net requires net backend to be setup\n");
goto fail;
}... | [
1,
0
] |
qemu | hw/lsi53c895a.c | static void lsi_do_dma(LSIState *s, int out)
{
uint32_t count;
target_phys_addr_t addr;
if (!s->current_dma_len) {
/* Wait until data is available. */
DPRINTF("DMA no data available\n");
return;
}
count = s->dbc;
if (count > s->current_dma_len)
count = s->current_dma_len;
addr ... | [
1,
0
] |
FFmpeg | libavcodec/opusenc_psy.c | static void celt_search_for_intensity(OpusPsyContext *s, CeltFrame *f) {
int i, best_band = CELT_MAX_BANDS - 1;
float dist, best_dist = FLT_MAX;
/* TODO: fix, make some heuristic up here using the lambda value */
float end_band = 0;
for (i = f->end_band; i >= end_band; i--) {
f->intensity_stereo = i;
... | [
1,
1
] |
qemu | ui/spice-display.c | void qemu_spice_create_host_primary(SimpleSpiceDisplay *ssd)
{
QXLDevSurfaceCreate surface;
memset(&surface, 0, sizeof(surface));
dprint(1, "%s/%d: %dx%d\n", __func__, ssd->qxl.id,
surface_width(ssd->ds), surface_height(ssd->ds));
surface.format = SPICE_SURFACE_FMT_32_xRGB;
surface.width = sur... | [
1,
0
] |
qemu | block/raw-posix.c | static int net_socket_mcast_create(struct sockaddr_in *mcastaddr)
{
struct ip_mreq imr;
int fd;
int val, ret;
if (!IN_MULTICAST(ntohl(mcastaddr->sin_addr.s_addr))) {
fprintf(stderr,
"qemu: error: specified mcastaddr \"%s\" (0x%08x) does not contain "
"a multicast address\n",
... | [
1,
0
] |
qemu | target-ppc/translate_init.c | static void init_proc_750fx(CPUPPCState *env)
{
gen_spr_ne_601(env);
gen_spr_7xx(env);
/* XXX : not implemented */
spr_register(env, SPR_L2CR, "L2CR",
SPR_NOACCESS, SPR_NOACCESS,
&spr_read_generic, NULL,
0x00000000);
/* Time base */
gen_tbl(env);
/* ... | [
1,
1
] |
qemu | hw/usb/ccid-card-emulated.c | static void packet_id_queue_add(struct PacketIdQueue *q, uint64_t id)
{
USBRedirDevice *dev = q->dev;
struct PacketIdQueueEntry *e;
DPRINTF("adding packet id %" PRIu64 " to %s queue\n", id, q->name);
e = g_malloc0(sizeof(struct PacketIdQueueEntry));
e->id = id;
QTAILQ_INSERT_TAIL(&q->head, e, next);
... | [
1,
0
] |
qemu | exec.c | static void xtensa_cpu_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
CPUClass *cc = CPU_CLASS(oc);
XtensaCPUClass *xcc = XTENSA_CPU_CLASS(cc);
xcc->parent_realize = dc->realize;
dc->realize = xtensa_cpu_realizefn;
xcc->parent_reset = cc->reset;
cc->reset = xtensa_cp... | [
1,
0
] |
qemu | hw/usb/hcd-uhci.c | static void uhci_queue_fill(UHCIQueue *q, UHCI_TD *td)
{
uint32_t int_mask = 0;
uint32_t plink = td->link;
UHCI_TD ptd;
int ret;
while (is_valid(plink)) {
uhci_read_td(q->uhci, &ptd, plink);
if (!(ptd.ctrl & TD_CTRL_ACTIVE)) {
break;
}
if (uhci_queue_token(&ptd) != q->token) {
... | [
1,
0
] |
qemu | hw/usb/hcd-xhci.c | static void xhci_port_write(void *ptr, hwaddr reg,
uint64_t val, unsigned size)
{
XHCIPort *port = ptr;
uint32_t portsc;
trace_usb_xhci_port_write(port->portnr, reg, val);
switch (reg) {
case 0x00: /* PORTSC */
portsc = port->portsc;
/* write-1-to-clear bits*/
... | [
1,
0
] |
qemu | docs/tracing.txt | void st_print_trace_file_status(FILE *stream,
int (*stream_printf)(FILE *stream,
const char *fmt, ...))
{
stream_printf(stream, "Trace file \"%s\" %s.\n",
trace_file_name, trace_file_enabled ? "on" : "off");
} | [
1,
0
] |
FFmpeg | libavcodec/dxva2_h264.c | static void init_scan_tables(H264Context *h)
{
int i;
for (i = 0; i < 16; i++) {
#define TRANSPOSE(x) (x >> 2) | ((x << 2) & 0xF)
h->zigzag_scan[i] = TRANSPOSE(ff_zigzag_scan[i]);
h->field_scan[i] = TRANSPOSE(field_scan[i]);
#undef TRANSPOSE
}
for (i = 0; i < 64; i++) {
#define TRANSPOSE(x) (x ... | [
1,
1
] |
qemu | hw/char/imx_serial.c | static uint64_t imx_serial_read(void *opaque, hwaddr offset,
unsigned size)
{
IMXSerialState *s = (IMXSerialState *)opaque;
uint32_t c;
DPRINTF("read(offset=%x)\n", offset >> 2);
switch (offset >> 2) {
case 0x0: /* URXD */
c = s->readbuff;
if (!(s->uts1 & UTS1_... | [
1,
1
] |
FFmpeg | avconv.c | static int check_recording_time(OutputStream *ost)
{
OutputFile *of = output_files[ost->file_index];
if (of->recording_time != INT64_MAX &&
av_compare_ts(ost->sync_opts - ost->first_pts, ost->st->codec->time_base,
of->recording_time,
AV_TIME_BASE_Q) >= 0) {
os... | [
1,
0
] |
qemu | hw/s390x/css.c | int do_subchannel_work_virtual(SubchDev *sch)
{
SCSW *s = &sch->curr_status.scsw;
if (s->ctrl & SCSW_FCTL_CLEAR_FUNC) {
sch_handle_clear_func(sch);
} else if (s->ctrl & SCSW_FCTL_HALT_FUNC) {
sch_handle_halt_func(sch);
} else if (s->ctrl & SCSW_FCTL_START_FUNC) {
/* Triggered by both ssch an... | [
1,
0
] |
FFmpeg | libavcodec/ac3dec.c | static inline void mix_2f_1r_to_mono(AC3DecodeContext *ctx)
{
int i;
float (*output)[256] = ctx->audio_block.block_output;
for (i = 0; i < 256; i++)
output[1][i] += (output[2][i] + output[3][i]);
memset(output[2], 0, sizeof(output[2]));
memset(output[3], 0, sizeof(output[3]));
} | [
1,
0
] |
FFmpeg | libavformat/mov.c | static int mov_read_glbl(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams - 1];
if ((uint64_t)atom.size > (1 << 30))
return AVERROR_INVALIDDATA;
if (atom.size >= 10) {
// Broken files created by legacy... | [
1,
0
] |
qemu | hw/intc/apic.c | void apic_deliver_pic_intr(DeviceState *dev, int level)
{
APICCommonState *s = APIC_COMMON(dev);
if (level) {
apic_local_deliver(s, APIC_LVT_LINT0);
} else {
uint32_t lvt = s->lvt[APIC_LVT_LINT0];
switch ((lvt >> 8) & 7) {
case APIC_DM_FIXED:
if (!(lvt & APIC_LVT_LEVEL_TRIGGER))
... | [
1,
0
] |
FFmpeg | postproc/rgb2rgb.c | void rgb15tobgr16(const uint8_t *src, uint8_t *dst, unsigned int src_size)
{
unsigned i;
unsigned num_pixels = src_size >> 1;
for (i = 0; i < num_pixels; i++)
{
unsigned b, g, r;
register uint16_t rgb;
rgb = src[2 * i];
r = rgb & 0x1F;
g = (rgb & 0x3E0) >> 5;
b = (rgb & 0x7C00... | [
1,
0
] |
qemu | hw/9pfs/9p-local.c | static int local_rename(FsContext *ctx, const char *oldpath,
const char *newpath)
{
int err;
char *buffer, *buffer1;
if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {
err = local_create_mapped_attr_dir(ctx, newpath);
if (err < 0) {
return err;
}
/* rename the .v... | [
1,
0
] |
FFmpeg | libavcodec/tiff.c | static unsigned tget(const uint8_t **p, int type, int le)
{
switch (type) {
case TIFF_BYTE:
return *(*p)++;
case TIFF_SHORT:
return tget_short(p, le);
case TIFF_LONG:
return tget_long(p, le);
default:
return UINT_MAX;
}
} | [
1,
0
] |
FFmpeg | libavcodec/diracdec.c | static int decode_hq_slice(AVCodecContext *avctx, void *arg)
{
int i, quant, level, orientation, quant_idx;
uint8_t quants[MAX_DWT_LEVELS][4];
DiracContext *s = avctx->priv_data;
DiracSlice *slice = arg;
GetBitContext *gb = &slice->gb;
skip_bits_long(gb, 8 * s->highquality.prefix_bytes);
quant_idx... | [
1,
0
] |
qemu | target-i386/helper.c | uint32_t div32(uint32_t *q_ptr, uint64_t num, uint32_t den)
{
*q_ptr = num / den;
return num % den;
} | [
1,
0
] |
FFmpeg | libavfilter/avf_showwaves.c | inline static int push_frame(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
AVFilterLink *inlink = ctx->inputs[0];
ShowWavesContext *showwaves = outlink->src->priv;
int nb_channels = inlink->channels;
int ret, i;
if ((ret = ff_filter_frame(outlink, showwaves->outpicref)) >= 0)
sho... | [
1,
0
] |
qemu | console.c | static void pxa2xx_screen_dump(void *opaque, const char *filename)
{
/* TODO */
} | [
1,
1
] |
FFmpeg | libavcodec/mpeg12.c | void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove)
{
int i;
s->dts =
s->pts = AV_NOPTS_VALUE;
s->pos = -1;
s->offset = 0;
for (i = 0; i < AV_PARSER_PTS_NB; i++) {
if (s->cur_offset + off >= s->cur_frame_offset[i] &&
(s->frame_offset < s->cur_frame_offset[i] ||
... | [
1,
0
] |
qemu | bootdevice.c | void restore_boot_order(void *opaque)
{
char *normal_boot_order = opaque;
static int first = 1;
/* Restore boot order and remove ourselves after the first boot */
if (first) {
first = 0;
return;
}
qemu_boot_set(normal_boot_order, NULL);
qemu_unregister_reset(restore_boot_order, normal_boo... | [
1,
0
] |
FFmpeg | libavcodec/utils.c | static int convert_sub_to_old_ass_form(AVSubtitle *sub, const AVPacket *pkt,
AVRational tb)
{
int i;
AVBPrint buf;
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
for (i = 0; i < sub->num_rects; i++) {
char *final_dialog;
const char *dialog;
AVSubtit... | [
1,
0
] |
FFmpeg | libavcodec/a64multienc.c | static av_cold int bmp_encode_init(AVCodecContext *avctx) {
switch (avctx->pix_fmt) {
case AV_PIX_FMT_BGR24:
avctx->bits_per_coded_sample = 24;
break;
case AV_PIX_FMT_RGB555:
case AV_PIX_FMT_RGB565:
case AV_PIX_FMT_RGB444:
avctx->bits_per_coded_sample = 16;
break;
case AV_PIX_FMT_R... | [
0,
0
] |
qemu | qemu-char.c | static gboolean udp_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque)
{
CharDriverState *chr = opaque;
NetCharDriver *s = chr->opaque;
gsize bytes_read = 0;
GIOStatus status;
if (s->max_size == 0) {
return TRUE;
}
status = g_io_channel_read_chars(s->chan, (gchar *)s->buf, sizeof(s->b... | [
1,
0
] |
FFmpeg | libavformat/avienc.c | static unsigned int codec_get_asf_tag(const CodecTag *tags, unsigned int id)
{
while (tags->id != 0) {
if (!tags->invalid_asf && tags->id == id)
return tags->tag;
tags++;
}
return 0;
} | [
1,
0
] |
qemu | hw/ipmi/ipmi_bmc_sim.c | static void ipmi_init_sensors_from_sdrs(IPMIBmcSim *s)
{
unsigned int i, pos;
IPMISensor *sens;
for (i = 0; i < MAX_SENSORS; i++) {
memset(s->sensors + i, 0, sizeof(*sens));
}
pos = 0;
for (i = 0; !sdr_find_entry(&s->sdr, i, &pos, NULL); i++) {
struct ipmi_sdr_compact *sdr =
(struct... | [
1,
0
] |
FFmpeg | libavformat/mxfdec.c | static int mxf_read_track(void *arg, AVIOContext *pb, int tag, int size,
UID uid)
{
MXFTrack *track = arg;
switch (tag) {
case 0x4801:
track->track_id = avio_rb32(pb);
break;
case 0x4804:
avio_read(pb, track->track_number, 4);
break;
case 0x4B01:
track-... | [
1,
0
] |
qemu | hw/vmware_vga.c | static void vmsvga_init(struct vmsvga_state_s *s, int vga_ram_size)
{
s->scratch_size = SVGA_SCRATCH_SIZE;
s->scratch = qemu_malloc(s->scratch_size * 4);
vmsvga_reset(s);
s->fifo_size = SVGA_FIFO_SIZE;
s->fifo_offset = qemu_ram_alloc(s->fifo_size);
s->fifo_ptr = qemu_get_ram_ptr(s->fifo_offset);
v... | [
1,
0
] |
qemu | audio/audio.c | void monitor_init(CharDriverState *chr, int flags)
{
static int is_first_init = 1;
Monitor *mon;
if (is_first_init) {
monitor_qapi_event_init();
sortcmdlist();
is_first_init = 0;
}
mon = g_malloc(sizeof(*mon));
monitor_data_init(mon);
mon->chr = chr;
mon->flags = flags;
if (fla... | [
1,
0
] |
qemu | target-sparc/helper.h | target_ulong helper_sdiv(target_ulong a, target_ulong b)
{
int64_t x0;
int32_t x1;
x0 = (a & 0xffffffff) | ((int64_t)(env->y) << 32);
x1 = (b & 0xffffffff);
if (x1 == 0) {
raise_exception(TT_DIV_ZERO);
}
x0 = x0 / x1;
if ((int32_t)x0 != x0) {
env->cc_src2 = 1;
return x0 < 0 ? 0x80... | [
1,
0
] |
qemu | hw/usb/hcd-xhci.c | static void xhci_reset(DeviceState *dev)
{
XHCIState *xhci = XHCI(dev);
int i;
trace_usb_xhci_reset();
if (!(xhci->usbsts & USBSTS_HCH)) {
DPRINTF("xhci: reset while running!\n");
}
xhci->usbcmd = 0;
xhci->usbsts = USBSTS_HCH;
xhci->dnctrl = 0;
xhci->crcr_low = 0;
xhci->crcr_high = 0;... | [
1,
0
] |
qemu | memory.c | ram_addr_t memory_region_get_ram_addr(MemoryRegion *mr)
{
assert(mr->backend_registered);
return mr->ram_addr;
} | [
0,
0
] |
qemu | target-sparc/translate.c | static inline void gen_op_eval_fbue(TCGv dst, TCGv src,
unsigned int fcc_offset)
{
gen_mov_reg_FCC0(dst, src, fcc_offset);
gen_mov_reg_FCC1(cpu_tmp0, src, fcc_offset);
tcg_gen_xor_tl(dst, dst, cpu_tmp0);
tcg_gen_xori_tl(dst, dst, 0x1);
} | [
0,
0
] |
qemu | include/qapi/qmp/qbool.h | static void qlist_destroy_obj(QObject *obj)
{
QList *qlist;
QListEntry *entry, *next_entry;
assert(obj != NULL);
qlist = qobject_to_qlist(obj);
QTAILQ_FOREACH_SAFE(entry, &qlist->head, next, next_entry) {
QTAILQ_REMOVE(&qlist->head, entry, next);
qobject_decref(entry->value);
g_free(entry... | [
0,
0
] |
qemu | util/qemu-sockets.c | SocketAddress *socket_address_flatten(SocketAddressLegacy *addr_legacy)
{
SocketAddress *addr = g_new(SocketAddress, 1);
if (!addr_legacy) {
return NULL;
}
switch (addr_legacy->type) {
case SOCKET_ADDRESS_LEGACY_KIND_INET:
addr->type = SOCKET_ADDRESS_TYPE_INET;
QAPI_CLONE_MEMBERS(InetSocke... | [
1,
0
] |
qemu | hw/block/nvme.c | static void nvme_instance_init(Object *obj)
{
object_property_add(obj, "bootindex", "int32",
nvme_get_bootindex,
nvme_set_bootindex, NULL, NULL, NULL);
object_property_set_int(obj, -1, "bootindex", NULL);
} | [
1,
0
] |
FFmpeg | libswscale/ppc/swscale_altivec.c | static void hScale8To15_c(SwsContext *c, int16_t *dst, int dstW,
const uint8_t *src,
const int16_t *filter, const int16_t *filterPos,
int filterSize)
{
int i;
for (i = 0; i < dstW; i++) {
int j;
int srcPos = filterPos[i];
... | [
1,
0
] |
qemu | include/exec/gen-icount.h | static void t_gen_cris_dstep(TCGv d, TCGv a, TCGv b)
{
int l1;
l1 = gen_new_label();
/*
* d <<= 1
* if (d >= s)
* d -= s;
*/
tcg_gen_shli_tl(d, a, 1);
tcg_gen_brcond_tl(TCG_COND_LTU, d, b, l1);
tcg_gen_sub_tl(d, d, b);
gen_set_label(l1);
} | [
0,
0
] |
qemu | cpu-exec.c | static always_inline void gen_arith3(void *helper,
int ra, int rb, int rc,
int islit, uint8_t lit)
{
if (unlikely(rc == 31))
return;
if (ra != 31) {
if (islit) {
TCGv tmp = tcg_const_i64(lit);
tcg_gen_helper_1_2(h... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.