Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
qemu
HACKING
static uint64_t unassigned_mem_read(void *opaque, target_phys_addr_t addr, unsigned size) { #ifdef DEBUG_UNASSIGNED printf("Unassigned mem read " TARGET_FMT_plx "\n", addr); #endif #if defined(TARGET_ALPHA) || defined(TARGET_SPARC) || defined(TARGET_MICROBLAZE) cpu_unassig...
[ 0, 0 ]
FFmpeg
libavcodec/h264_loopfilter.c
static void h264_h_loop_filter_luma_c(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0) { h264_loop_filter_luma_c(pix, 1, stride, alpha, beta, tc0); }
[ 0, 0 ]
qemu
configure
gboolean qcrypto_hash_supports(QCryptoHashAlgorithm alg) { if (alg < G_N_ELEMENTS(qcrypto_hash_alg_map)) { return true; } return false; }
[ 0, 0 ]
qemu
hw/pci.c
static uint64_t pci_config_get_pref_base(PCIDevice *d, uint32_t base, uint32_t upper) { uint64_t val; val = ((uint64_t)pci_get_word(d->config + base) & PCI_PREF_RANGE_MASK) << 16; val |= (uint64_t)pci_get_long(d->config + upper) << 32; return val;...
[ 0, 0 ]
qemu
hw/acpi/aml-build.c
build_srat(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info) { AcpiSystemResourceAffinityTable *srat; AcpiSratProcessorGiccAffinity *core; AcpiSratMemoryAffinity *numamem; int i, j, srat_start; uint64_t mem_base; uint32_t *cpu_node = g_malloc0(guest_info->smp_cpus * sizeof(uint32_t)); ...
[ 1, 0 ]
qemu
tcg/aarch64/tcg-target.c
static void tgen_compare_branch(TCGContext *s, S390Opcode opc, int cc, TCGReg r1, TCGReg r2, int labelno) { TCGLabel *l = &s->labels[labelno]; intptr_t off; if (l->has_value) { off = l->u.value_ptr - s->code_ptr; } else { /* We need to keep the offset unchanged fo...
[ 1, 0 ]
qemu
hw/acpi/pcihp.c
int acpi_pcihp_device_hotplug(AcpiPciHpState *s, PCIDevice *dev, PCIHotplugState state) { int slot = PCI_SLOT(dev->devfn); int bsel = acpi_pcihp_get_bsel(dev->bus); if (bsel < 0) { return -1; } /* Don't send event when device is enabled during qemu machine creation: ...
[ 0, 0 ]
FFmpeg
libavcodec/h264.c
static void frame_start(H264Context *h) { MpegEncContext *const s = &h->s; int i; MPV_frame_start(s, s->avctx); ff_er_frame_start(s); assert(s->linesize && s->uvlinesize); for (i = 0; i < 16; i++) { h->block_offset[i] = 4 * ((scan8[i] - scan8[0]) & 7) + 4 * s->linesize * ...
[ 1, 1 ]
FFmpeg
configure
URLProtocol *ffurl_protocol_next(const URLProtocol *prev) { return prev ? prev->next : first_protocol; }
[ 0, 0 ]
FFmpeg
libavformat/movenc.c
static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track) { int tag = track->enc->codec_tag; if (!tag || (track->enc->strict_std_compliance >= FF_COMPLIANCE_NORMAL && (tag == MKTAG('d', 'v', 'c', 'p') || track->enc->codec_id == CODEC_ID_RAWVIDEO || track-...
[ 1, 0 ]
FFmpeg
libavformat/utils.c
static void probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt) { if (st->codec->codec_id == CODEC_ID_PROBE) { AVProbeData *pd = &st->probe_data; av_log(s, AV_LOG_DEBUG, "probing stream %d\n", st->index); --st->probe_packets; pd->buf = av_realloc(pd->buf, pd->buf_size + pk...
[ 1, 1 ]
FFmpeg
libavcodec/aacdec_fixed.c
static inline int *DEC_UPAIR(int *dst, unsigned idx, unsigned sign) { dst[0] = (idx & 15) * (1 - (sign & 0xFFFFFFFE)); dst[1] = (idx >> 4 & 15) * (1 - ((sign & 1) << 1)); return dst + 2; }
[ 1, 0 ]
qemu
Makefile.objs
static void usbredir_configuration_status( void *priv, uint32_t id, struct usb_redir_configuration_status_header *config_status) { USBRedirDevice *dev = priv; AsyncURB *aurb; int len = 0; DPRINTF("set config status %d config %d id %u\n", config_status->status, config_status->configurati...
[ 1, 0 ]
FFmpeg
libavcodec/h264pred_template.c
static void FUNCC(pred4x4_horizontal)(uint8_t *_src, const uint8_t *topright, int _stride) { pixel *src = (pixel *)_src; int stride = _stride / sizeof(pixel); ((pixel4 *)(src + 0 * stride))[0] = PIXEL_SPLAT_X4(src[-1 + 0 * stride]); ((pixel4 *)(src + 1 * stride))[0] = P...
[ 1, 0 ]
FFmpeg
libavformat/mvdec.c
static int mv_read_packet(AVFormatContext *avctx, AVPacket *pkt) { MvContext *mv = avctx->priv_data; AVIOContext *pb = avctx->pb; AVStream *st = avctx->streams[mv->stream_index]; const AVIndexEntry *index; int frame = mv->frame[mv->stream_index]; int ret; uint64_t pos; if (frame < st->nb_index_...
[ 1, 0 ]
qemu
qga/commands-posix.c
void qmp_guest_file_flush(int64_t handle, Error **errp) { GuestFileHandle *gfh = guest_file_handle_find(handle, errp); FILE *fh; int ret; if (!gfh) { return; } fh = gfh->fh; ret = fflush(fh); if (ret == EOF) { error_setg_errno(errp, errno, "failed to flush file"); } }
[ 1, 0 ]
FFmpeg
libavcodec/j2k.c
static void dequantization_int(int x, int y, Jpeg2000Cblk *cblk, Jpeg2000Component *comp, Jpeg2000T1Context *t1, Jpeg2000Band *band) { int i, j, idx; int32_t *datap = (int32_t *)&comp->data[(comp->coord[0][1] - comp->coord[0][0]) * y + x]; ...
[ 1, 0 ]
FFmpeg
libavcodec/h264_direct.c
static void fill_colmap(H264Context *h, int map[2][16 + 32], int list, int field, int colfield, int mbafi) { MpegEncContext *const s = &h->s; Picture *const ref1 = &h->ref_list[1][0]; int j, old_ref, rfield; int start = mbafi ? 16 : 0; int end = mbafi ? 16 + 2 * h->ref_count[0] : ...
[ 1, 1 ]
FFmpeg
ffmpeg.c
static void compute_frame_duration(int *pnum, int *pden, AVFormatContext *s, AVStream *st, AVCodecParserContext *pc, AVPacket *pkt) { int frame_size; *pnum = 0; *pden = 0; switch (st->codec.codec_type) { case CODEC_TYPE_VIDEO: ...
[ 1, 0 ]
qemu
hw/s390x/css.c
void ioinst_handle_rsch(S390CPU *cpu, uint64_t reg1) { int cssid, ssid, schid, m; SubchDev *sch; int ret = -ENODEV; int cc; if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) { program_interrupt(&cpu->env, PGM_OPERAND, 4); return; } trace_ioinst_sch_id("rsch", cssid, ssid,...
[ 1, 0 ]
qemu
block/vvfat.c
static int commit_one_file(BDRVVVFATState *s, int dir_index, uint32_t offset) { direntry_t *direntry = array_get(&(s->directory), dir_index); uint32_t c = begin_of_direntry(direntry); uint32_t first_cluster = c; mapping_t *mapping = find_mapping_for_cluster(s, c); uint32_t si...
[ 1, 0 ]
qemu
numa.c
MemdevList *qmp_query_memdev(Error **errp) { Object *obj; MemdevList *list = NULL; obj = object_get_objects_root(); if (obj == NULL) { return NULL; } if (object_child_foreach(obj, query_memdev, &list) != 0) { goto error; } return list; error: qapi_free_MemdevList(list); return NU...
[ 1, 0 ]
qemu
bsd-user/main.c
static void create_cpu_without_cps(const char *cpu_model, qemu_irq *cbus_irq, qemu_irq *i8259_irq) { CPUMIPSState *env; MIPSCPU *cpu; int i; for (i = 0; i < smp_cpus; i++) { cpu = cpu_mips_init(cpu_model); if (cpu == NULL) { fprintf(stderr, "Unable to fi...
[ 1, 0 ]
FFmpeg
libavfilter/vf_separatefields.c
static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref) { AVFilterContext *ctx = inlink->dst; SeparateFieldsContext *sf = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; AVFrame *second; int i, ret; inpicref->height = outlink->h; inpicref->interlaced_frame = 0; second = av_frame_cl...
[ 1, 0 ]
qemu
nbd.c
int nbd_receive_reply(int csock, struct nbd_reply *reply) { uint8_t buf[NBD_REPLY_SIZE]; uint32_t magic; memset(buf, 0xAA, sizeof(buf)); if (read_sync(csock, buf, sizeof(buf)) != sizeof(buf)) { LOG("read failed"); errno = EINVAL; return -1; } /* Reply [ 0 .. 3] magic (NBD_RE...
[ 1, 0 ]
qemu
hw/ide/core.c
static void ide_sector_write_cb(void *opaque, int ret) { IDEState *s = opaque; int n; if (ret == -ECANCELED) { return; } block_acct_done(blk_get_stats(s->blk), &s->acct); s->pio_aiocb = NULL; s->status &= ~BUSY_STAT; if (ret != 0) { if (ide_handle_rw_error(s, -ret, IDE_RETRY_PIO)) { ...
[ 1, 1 ]
FFmpeg
libavformat/avisynth.c
static av_cold int avisynth_load_library(void) { avs_library.library = LoadLibrary(AVISYNTH_LIB); if (!avs_library.library) return AVERROR_UNKNOWN; #define LOAD_AVS_FUNC(name, continue_on_fail) avs_library.name = (void *)GetProcAddress(avs_library.library, #name); if (!continue_on_fail && !avs...
[ 0, 0 ]
qemu
acl.c
static void do_closefd(Monitor *mon, const QDict *qdict) { const char *fdname = qdict_get_str(qdict, "fdname"); mon_fd_t *monfd; LIST_FOREACH(monfd, &mon->fds, next) { if (strcmp(monfd->name, fdname) != 0) { continue; } LIST_REMOVE(monfd, next); close(monfd->fd); qemu_free(monfd...
[ 0, 0 ]
qemu
hw/hw.h
static void qemu_fill_buffer(QEMUFile *f) { int len; if (f->is_writable) return; if (f->is_file) { fseek(f->outfile, f->buf_offset, SEEK_SET); len = fread(f->buf, 1, IO_BUF_SIZE, f->outfile); if (len < 0) len = 0; } else { len = bdrv_pread(f->bs, f->base_offset + f->buf_offs...
[ 1, 0 ]
qemu
accel/kvm/kvm-all.c
void net_hub_check_clients(void) { NetHub *hub; NetHubPort *port; NetClientState *peer; QLIST_FOREACH(hub, &hubs, next) { int has_nic = 0, has_host_dev = 0; QLIST_FOREACH(port, &hub->ports, next) { peer = port->nc.peer; if (!peer) { fprintf(stderr, "Warning: hub port %s has...
[ 0, 0 ]
qemu
hw/mac_dbdma.c
static void conditional_interrupt(DBDMA_channel *ch) { dbdma_cmd *current = &ch->current; uint16_t intr; uint16_t sel_mask, sel_value; uint32_t status; int cond; DBDMA_DPRINTF("conditional_interrupt\n"); intr = le16_to_cpu(current->command) & INTR_MASK; switch (intr) { case INTR_NEVER: /* do...
[ 1, 0 ]
qemu
target-ppc/translate_init.c
static void gen_spr_amr(CPUPPCState *env) { #ifndef CONFIG_USER_ONLY /* Virtual Page Class Key protection */ /* The AMR is accessible either via SPR 13 or SPR 29. 13 is * userspace accessible, 29 is privileged. So we only need to set * the kvm ONE_REG id on one of them, we use 29 */ spr_register(en...
[ 0, 0 ]
qemu
HACKING
static void set_kernel_args(const struct arm_boot_info *info) { int initrd_size = info->initrd_size; target_phys_addr_t base = info->loader_start; target_phys_addr_t p; p = base + KERNEL_ARGS_ADDR; /* ATAG_CORE */ WRITE_WORD(p, 5); WRITE_WORD(p, 0x54410001); WRITE_WORD(p, 1); WRITE_WORD(p, 0...
[ 0, 1 ]
qemu
fsdev/virtfs-proxy-helper.c
static int proxy_remove(FsContext *ctx, const char *path) { int retval; V9fsString name; v9fs_string_init(&name); v9fs_string_sprintf(&name, "%s", path); retval = v9fs_request(ctx->private, T_REMOVE, NULL, "s", &name); v9fs_string_free(&name); if (retval < 0) { errno = -retval; } return ...
[ 0, 0 ]
qemu
block.c
void bdrv_info(void) { BlockDriverState *bs; for (bs = bdrv_first; bs != NULL; bs = bs->next) { term_printf("%s:", bs->device_name); term_printf(" type="); switch (bs->type) { case BDRV_TYPE_HD: term_printf("hd"); break; case BDRV_TYPE_CDROM: term_printf("cdrom"); ...
[ 1, 0 ]
qemu
hw/ppc/spapr.c
static void spapr_core_release(DeviceState *dev, void *opaque) { HotplugHandler *hotplug_ctrl; hotplug_ctrl = qdev_get_hotplug_handler(dev); hotplug_handler_unplug(hotplug_ctrl, dev, &error_abort); }
[ 0, 0 ]
FFmpeg
fftools/ffmpeg.c
static const HWAccel *get_hwaccel(enum AVPixelFormat pix_fmt, enum HWAccelID selected_hwaccel_id) { int i; for (i = 0; hwaccels[i].name; i++) if (hwaccels[i].pix_fmt == pix_fmt && (!selected_hwaccel_id || selected_hwaccel_id == HWACCEL_AUTO || hwaccels[i]....
[ 1, 0 ]
FFmpeg
libavcodec/asv1.c
void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size) { void **p = ptr; if (min_size < *size) return; min_size = FFMAX(17 * min_size / 16 + 32, min_size); av_free(*p); *p = av_malloc(min_size); if (!*p) min_size = 0; *size = min_size; }
[ 1, 0 ]
qemu
audio/audio.c
QObject *qlist_peek(QList *qlist) { QListEntry *entry; QObject *ret; if (qlist == NULL || QTAILQ_EMPTY(&qlist->head)) { return NULL; } entry = QTAILQ_FIRST(&qlist->head); ret = entry->value; return ret; }
[ 0, 0 ]
qemu
HACKING
static int find_real_tpr_addr(VAPICROMState *s, CPUX86State *env) { target_phys_addr_t paddr; target_ulong addr; if (s->state == VAPIC_ACTIVE) { return 0; } /* * If there is no prior TPR access instruction we could analyze (which is * the case after resume from hibernation), we need to scan ...
[ 1, 0 ]
qemu
memory.c
void memory_region_ram_resize(MemoryRegion *mr, ram_addr_t newsize, Error **errp) { assert(mr->terminates); qemu_ram_resize(mr->ram_addr, newsize, errp); }
[ 0, 0 ]
qemu
block/qcow2-cluster.c
int qcow2_zero_clusters(BlockDriverState *bs, uint64_t offset, int nb_sectors, int flags) { BDRVQcow2State *s = bs->opaque; uint64_t end_offset; uint64_t nb_clusters; int ret; end_offset = offset + (nb_sectors << BDRV_SECTOR_BITS); /* Caller must pass aligned values, except a...
[ 0, 0 ]
qemu
nbd.c
static int nbd_handle_list(NBDClient *client, uint32_t length) { int csock; NBDExport *exp; csock = client->sock; if (length) { return nbd_send_rep(csock, NBD_REP_ERR_INVALID, NBD_OPT_LIST); /* For each export, send a NBD_REP_SERVER reply. */ QTAILQ_FOREACH(exp, &exports, next) { if (...
[ 1, 0 ]
qemu
tests/test-cutils.c
static void test_qemu_strtoull_invalid(void) { const char *str = " xxxx \t abc"; char f = 'X'; const char *endptr = &f; uint64_t res = 999; int err; err = qemu_strtoull(str, &endptr, 0, &res); g_assert_cmpint(err, ==, 0); g_assert(endptr == str); }
[ 1, 0 ]
qemu
hw/ipmi/ipmi_bmc_sim.c
static void get_sensor_evt_enable(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len, uint8_t *rsp, unsigned int *rsp_len, unsigned int max_rsp_len) { IPMISensor *sens; IPMI_CHECK_CMD_LEN(3); if ((cmd[2] ...
[ 1, 0 ]
qemu
migration/migration.c
void migration_incoming_state_destroy(void) { struct MigrationIncomingState *mis = migration_incoming_get_current(); qemu_event_destroy(&mis->main_thread_load_event);
[ 1, 0 ]
qemu
hw/ppc/ppc_booke.c
static void booke_update_fixed_timer(CPUPPCState *env, uint8_t target_bit, uint64_t *next, struct QEMUTimer *timer) { ppc_tb_t *tb_env = env->tb_env; uint64_t lapse; uint64_t tb; uint64_t perio...
[ 1, 1 ]
qemu
Makefile.objs
static void unset_dirty_tracking(void) { BlkMigDevState *bmds; QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { bdrv_release_dirty_bitmap(bmds->bs, bmds->dirty_bitmap); } }
[ 1, 0 ]
qemu
hw/ipmi/ipmi_bmc_sim.c
static void get_sel_entry(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len, uint8_t *rsp, unsigned int *rsp_len, unsigned int max_rsp_len) { unsigned int val; IPMI_CHECK_CMD_LEN(8); if (cmd[6]) { IPMI_CHECK_RESERVATION(2,...
[ 1, 0 ]
qemu
qemu-nbd.c
static int find_partition(BlockDriverState *bs, int partition, off_t *offset, off_t *size) { struct partition_record mbr[4]; uint8_t data[512]; int i; int ext_partnum = 4; if (bdrv_read(bs, 0, data, 1)) errx(EINVAL, "error while reading"); if (data[510] != 0x55 || data...
[ 1, 0 ]
qemu
disas/i386.c
print_operand_value(char *buf, size_t bufsize, int hex, bfd_vma disp) { if (address_mode == mode_64bit) { if (hex) { char tmp[30]; int i; buf[0] = '0'; buf[1] = 'x'; snprintf_vma(tmp, sizeof(tmp), disp); for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++) ; ...
[ 1, 0 ]
qemu
target-ppc/helper.c
void OPPROTO op_4xx_tlbsx_check(void) { int tmp; tmp = xer_so; if (T0 != -1) tmp |= 0x02; env->crf[0] = tmp; RETURN(); }
[ 1, 0 ]
qemu
tests/benchmark-crypto-cipher.c
static void test_hmac_speed(const void *opaque) { size_t chunk_size = (size_t)opaque; QCryptoHmac *hmac = NULL; uint8_t *in = NULL, *out = NULL; size_t out_len = 0; double total = 0.0; struct iovec iov; Error *err = NULL; int ret; if (!qcrypto_hmac_supports(QCRYPTO_HASH_ALG_SHA256)) { r...
[ 1, 0 ]
FFmpeg
libavcodec/ac3dec.c
static inline void mix_dualmono_to_stereo(AC3DecodeContext *ctx) { int i; float tmp; float (*output)[256] = ctx->audio_block.block_output; for (i = 0; i < 256; i++) { tmp = output[1][i] + output[2][i]; output[1][i] = output[2][i] = tmp; } }
[ 0, 0 ]
FFmpeg
libavcodec/audiotoolboxenc.c
static OSStatus ffat_encode_callback(AudioConverterRef converter, UInt32 *nb_packets, AudioBufferList *data, AudioStreamPacketDescription **packets, void *inctx) { A...
[ 1, 0 ]
qemu
qapi/qmp-input-visitor.c
static void qmp_input_type_number(Visitor *v, double *obj, const char *name, Error **errp) { QmpInputVisitor *qiv = to_qiv(v); QObject *qobj = qmp_input_get_object(qiv, name, true); if (!qobj || (qobject_type(qobj) != QTYPE_QFLOAT && qobject_type(qobj) != QT...
[ 1, 0 ]
qemu
block.c
int bdrv_all_find_snapshot(const char *name, BlockDriverState **first_bad_bs) { QEMUSnapshotInfo sn; int err = 0; BlockDriverState *bs; BdrvNextIterator *it = NULL; while (err == 0 && (it = bdrv_next(it, &bs))) { AioContext *ctx = bdrv_get_aio_context(bs); aio_context_acquire(ctx); if (bd...
[ 1, 0 ]
qemu
block/cow.c
static int cow_is_allocated(BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *num_same) { int changed; if (nb_sectors == 0) { *num_same = nb_sectors; return 0; } changed = is_bit_set(bs, sector_num); if (changed < 0) { return 0; /* XXX: how to retu...
[ 1, 1 ]
qemu
target-ppc/cpu.h
static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) { TranslationBlock *tb; tb = ctx->tb; if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) { if (n == 0) gen_op_goto_tb0(TBPARAM(tb)); else gen_op_goto_tb1(TBPARAM(tb)); gen_op_set_T1(dest); ...
[ 1, 0 ]
qemu
include/qapi/qobject-input-visitor.h
static void test_visitor_in_null(TestInputVisitorData *data, const void *unused) { Visitor *v; Error *err = NULL; char *tmp; /* * FIXME: Since QAPI doesn't know the 'null' type yet, we can't * test visit_type_null() by reading into a QAPI struct then * checking...
[ 1, 1 ]
qemu
Makefile.objs
static int usb_net_handle_statusin(USBNetState *s, USBPacket *p) { int ret = 8; if (p->len < 8) return USB_RET_STALL; ((le32 *)p->data)[0] = cpu_to_le32(1); ((le32 *)p->data)[1] = cpu_to_le32(0); if (!s->rndis_resp.tqh_first) ret = USB_RET_NAK; #ifdef TRAFFIC_DEBUG fprintf(stderr, "usbnet:...
[ 1, 0 ]
FFmpeg
ffmpeg.c
static OutputStream *new_audio_stream(OptionsContext *o, AVFormatContext *oc, int source_index) { int n; AVStream *st; OutputStream *ost; AVCodecContext *audio_enc; ost = new_output_stream(o, oc, AVMEDIA_TYPE_AUDIO, source_index); st = ost->st; audio_enc = st-...
[ 1, 0 ]
FFmpeg
libswscale/x86/rgb2rgb_template.c
static void RENAME(uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, int width, int height, int lumStride, int chromStride, int srcStride) { int y; const int chromWidth = FF_CEIL_RSHI...
[ 1, 0 ]
qemu
target-alpha/helper.h
uint64_t helper_subqv(CPUAlphaState *env, uint64_t op1, uint64_t op2) { uint64_t res; res = op1 - op2; if (unlikely((op1 ^ op2) & (res ^ op1) & (1ULL << 63))) { arith_excp(env, GETPC(), EXC_M_IOV, 0); } return res; }
[ 1, 0 ]
FFmpeg
libavcodec/huffyuv.c
static int common_end(HYuvContext *s) { int i; for (i = 0; i < 3; i++) { av_freep(&s->temp[i]); } return 0; }
[ 1, 0 ]
FFmpeg
libavcodec/apedec.c
static void ape_unpack_mono(APEContext *ctx, int count) { if (ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) { /* We are pure silence, so we're done. */ av_log(ctx->avctx, AV_LOG_DEBUG, "pure silence mono\n"); return; } entropy_decode(ctx, count, 0); ape_apply_filters(ctx, ctx->decoded[0], N...
[ 1, 0 ]
qemu
hw/arm/omap1.c
struct omap_mcspi_s *omap_mcspi_init(struct omap_target_agent_s *ta, int chnum, qemu_irq irq, qemu_irq *drq, omap_clk fclk, omap_clk iclk) { struct omap_mcspi_s *s = (struct omap_mcspi_s *) g_malloc0(sizeof(struct omap_mcspi_s)); s...
[ 1, 0 ]
qemu
block/raw-aio.h
static int coroutine_fn raw_co_write_zeroes( BlockDriverState *bs, int64_t sector_num, int nb_sectors, BdrvRequestFlags flags) { BDRVRawState *s = bs->opaque; if (!(flags & BDRV_REQ_MAY_UNMAP)) { return -ENOTSUP; } if (!s->discard_zeroes) { return -ENOTSUP; } return paio_submit_co(b...
[ 1, 0 ]
qemu
hw/9pfs/virtio-9p.c
static void v9fs_xattrcreate(void *opaque) { int flags; int32_t fid; int64_t size; ssize_t err = 0; V9fsString name; size_t offset = 7; V9fsFidState *file_fidp; V9fsFidState *xattr_fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; pdu_unmarshal(pdu, offset, "dsqd", &...
[ 1, 0 ]
qemu
hw/cirrus_vga.c
void isa_cirrus_vga_init(DisplayState *ds, uint8_t *vga_ram_base, unsigned long vga_ram_offset, int vga_ram_size) { CirrusVGAState *s; s = qemu_mallocz(sizeof(CirrusVGAState)); vga_common_init((VGAState *)s, ds, vga_ram_base, vga_ram_offset, vga_ram_size); cirru...
[ 1, 1 ]
qemu
docs/qapi-code-gen.txt
StringInputVisitor *string_input_visitor_new(const char *str) { StringInputVisitor *v; v = g_malloc0(sizeof(*v)); v->visitor.type = VISITOR_INPUT; v->visitor.type_int64 = parse_type_int64; v->visitor.type_uint64 = parse_type_uint64; v->visitor.type_size = parse_type_size; v->visitor.type_bool = pa...
[ 0, 0 ]
FFmpeg
libavcodec/dv.c
static always_inline int dv_rl2vlc(int run, int l, uint32_t *vlc) { *vlc = dv_vlc_map[run][((uint16_t)l) & 0x1ff].vlc; return dv_vlc_map[run][((uint16_t)l) & 0x1ff].size; }
[ 0, 0 ]
qemu
hw/spapr_llan.c
void spapr_vio_bus_register_withprop(VIOsPAPRDeviceInfo *info) { info->qdev.init = spapr_vio_busdev_init; info->qdev.bus_info = &spapr_vio_bus_info; assert(info->qdev.size >= sizeof(VIOsPAPRDevice)); qdev_register(&info->qdev); }
[ 1, 0 ]
qemu
bootdevice.c
static int pc_boot_set(void *opaque, const char *boot_device) { return set_boot_dev(opaque, boot_device); }
[ 0, 0 ]
qemu
monitor.c
static void term_completion(void) { int len, i, j, max_width, nb_cols; char *cmdline; nb_completions = 0; cmdline = qemu_malloc(term_cmd_buf_index + 1); if (!cmdline) return; memcpy(cmdline, term_cmd_buf, term_cmd_buf_index); cmdline[term_cmd_buf_index] = '\0'; find_completion(cmdline); ...
[ 1, 1 ]
qemu
hw/hw.h
void pci_device_save(PCIDevice *s, QEMUFile *f) { int i; qemu_put_be32(f, s->version_id); /* PCI device version */ qemu_put_buffer(f, s->config, 256); for (i = 0; i < 4; i++) qemu_put_be32(f, s->irq_state[i]); }
[ 0, 0 ]
FFmpeg
libavformat/movenc.c
static int check_pkt(AVFormatContext *s, AVPacket *pkt) { MOVMuxContext *mov = s->priv_data; MOVTrack *trk = &mov->tracks[pkt->stream_index]; int64_t ref; uint64_t duration; if (trk->entry) { ref = trk->cluster[trk->entry - 1].dts; } else if (trk->start_dts != AV_NOPTS_VALUE && !trk->frag_discont) { ...
[ 1, 0 ]
qemu
cpu-defs.h
void cpu_interrupt(CPUState *env, int mask) { #if !defined(USE_NPTL) TranslationBlock *tb; static spinlock_t interrupt_lock = SPIN_LOCK_UNLOCKED; #endif int old_mask; old_mask = env->interrupt_request; /* FIXME: This is probably not threadsafe. A different thread could be in the middle of a rea...
[ 1, 1 ]
FFmpeg
libavcodec/4xm.c
static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length) { int x, y, x2, y2; const int width = f->avctx->width; const int height = f->avctx->height; uint16_t *dst = (uint16_t *)f->current_picture.data[0]; const int stride = f->current_picture.linesize[0] >> 1; for (y = 0; y < height...
[ 1, 0 ]
qemu
hw/acpi/nvdimm.c
static void nvdimm_build_fit_buffer(NvdimmFitBuffer *fit_buf) { qemu_mutex_lock(&fit_buf->lock); g_array_free(fit_buf->fit, true); fit_buf->fit = nvdimm_build_device_structure(); fit_buf->dirty = true; qemu_mutex_unlock(&fit_buf->lock); }
[ 0, 0 ]
qemu
Makefile
static void vnc_debug_gnutls_log(int level, const char *str) { VNC_DEBUG("%d %s", level, str); }
[ 0, 0 ]
qemu
fpu/softfloat-native.c
uint32_t helper_efdctui(uint64_t val) { CPU_DoubleU u; u.ll = val; /* NaN are not treated the same way IEEE 754 does */ if (unlikely(float64_is_nan(u.d))) return 0; return float64_to_uint32(u.d, &env->vec_status); }
[ 0, 0 ]
qemu
hw/ppc/spapr.c
void spapr_tce_free(sPAPRTCETable *tcet) { QLIST_REMOVE(tcet, list); if (!kvm_enabled() || (kvmppc_remove_spapr_tce(tcet->table, tcet->fd, tcet->window_size) != 0)) { g_free(tcet->table); } g_free(tcet); }
[ 0, 0 ]
qemu
block/vmdk.c
static coroutine_fn int vmdk_co_write(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors) { int ret; BDRVVmdkState *s = bs->opaque; qemu_co_mutex_lock(&s->lock); ret = vmdk_write(bs, sector_num, buf, nb_sectors); qemu_co_mutex_unlock(&s->l...
[ 1, 0 ]
qemu
arch_init.c
void cache_fini(PageCache *cache) { int64_t i; g_assert(cache); g_assert(cache->page_cache); for (i = 0; i < cache->max_num_items; i++) { g_free(cache->page_cache[i].it_data); } g_free(cache->page_cache); cache->page_cache = NULL; }
[ 1, 0 ]
qemu
qemu-io-cmds.c
static int aio_flush_f(BlockBackend *blk, int argc, char **argv) { blk_drain_all(); return 0; }
[ 1, 0 ]
FFmpeg
libavcodec/idcinvideo.c
static int idcin_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; IdcinContext *s = avctx->priv_data; const uint8_t *pal = av_packet_get_side_d...
[ 1, 0 ]
qemu
hw/scsi/scsi-disk.c
static int scsi_get_configuration(SCSIDiskState *s, uint8_t *outbuf) { int current; if (s->qdev.type != TYPE_ROM) { return -1; } current = media_is_dvd(s) ? MMC_PROFILE_DVD_ROM : MMC_PROFILE_CD_ROM; memset(outbuf, 0, 40); stl_be_p(&outbuf[0], 36); /* Bytes after the data length field */ stw_be...
[ 1, 1 ]
qemu
hw/scsi/scsi-bus.c
static bool scsi_target_emulate_report_luns(SCSITargetReq *r) { BusChild *kid; int i, len, n; int channel, id; bool found_lun0; if (r->req.cmd.xfer < 16) { return false; } if (r->req.cmd.buf[2] > 2) { return false; } channel = r->req.dev->channel; id = r->req.dev->id; found_lun...
[ 1, 1 ]
qemu
block.c
static void mirror_iteration_done(MirrorOp *op, int ret) { MirrorBlockJob *s = op->s; struct iovec *iov; int64_t chunk_num; int i, nb_chunks, sectors_per_chunk; trace_mirror_iteration_done(s, op->sector_num, op->nb_sectors, ret); s->in_flight--; s->sectors_in_flight -= op->nb_sectors; iov = op-...
[ 1, 0 ]
FFmpeg
libavformat/img2dec.c
static int find_image_range(int *pfirst_index, int *plast_index, const char *path, int start_index) { char buf[1024]; int range, last_index, range1, first_index; /* find the first image */ for (first_index = start_index; first_index < start_index + 5; first_index++) { ...
[ 1, 0 ]
qemu
nbd.c
static void nbd_client_close(NBDClient *client) { qemu_set_fd_handler2(client->sock, NULL, NULL, NULL, NULL); close(client->sock); client->sock = -1; if (client->close) { client->close(client); } nbd_client_put(client); }
[ 1, 0 ]
qemu
qga/main.c
static void process_event(JSONMessageParser *parser, QList *tokens) { GAState *s = container_of(parser, GAState, parser); QObject *obj; QDict *qdict; Error *err = NULL; int ret; g_assert(s && parser); g_debug("process_event: called"); obj = json_parser_parse_err(tokens, NULL, &err); if (err ...
[ 1, 0 ]
FFmpeg
libavfilter/pthread.c
static void slice_thread_park_workers(ThreadContext *c) { pthread_cond_wait(&c->last_job_cond, &c->current_job_lock); pthread_mutex_unlock(&c->current_job_lock); }
[ 1, 0 ]
qemu
include/ui/console.h
static void gd_resize(DisplayChangeListener *dcl, DisplayState *ds) { GtkDisplayState *s = ds->opaque; cairo_format_t kind; int stride; DPRINTF("resize(width=%d, height=%d)\n", ds_get_width(ds), ds_get_height(ds)); if (s->surface) { cairo_surface_destroy(s->surface...
[ 1, 0 ]
qemu
hw/ppce500_pci.c
static void pci_reg_write4(void *opaque, target_phys_addr_t addr, uint32_t value) { PPCE500PCIState *pci = opaque; unsigned long win; win = addr & 0xfe0; pci_debug("%s: value:%x -> win:%lx(addr:" TARGET_FMT_plx ")\n", __func__, value, win, addr); switch (win) { ...
[ 1, 0 ]
FFmpeg
libavcodec/aacenc_tns.c
static int quantize_coefs(double *coef, int *idx, float *lpc, int order) { int i; uint8_t u_coef; const float *quant_arr = tns_tmp2_map[TNS_Q_BITS == 4]; const double iqfac_p = ((1 << (TNS_Q_BITS - 1)) - 0.5) / (M_PI / 2.0); const double iqfac_m = ((1 << (TNS_Q_BITS - 1)) + 0.5) / (M_PI / 2.0); for (...
[ 1, 0 ]
qemu
Makefile.objs
static int get_int16(QEMUFile *f, void *pv, size_t size) { int16_t *v = pv; qemu_get_sbe16s(f, v); return 0; }
[ 1, 0 ]
qemu
Makefile.objs
static void compress_to_network(RDMACompress *comp) { comp->value = htonl(comp->value); comp->block_idx = htonl(comp->block_idx); comp->offset = htonll(comp->offset); comp->length = htonll(comp->length); }
[ 1, 0 ]
FFmpeg
libavfilter/avfiltergraph.c
int avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter) { graph->filters = av_realloc(graph->filters, sizeof(AVFilterContext *) * ++graph->filter_count); if (!graph->filters) return AVERROR(ENOMEM); graph->filters[graph->filter_count - 1] = filter; return 0...
[ 1, 0 ]