Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
FFmpeg
libavformat/flvdec.c
static int flv_data_packet(AVFormatContext *s, AVPacket *pkt, int64_t dts, int64_t next) { AVIOContext *pb = s->pb; AVStream *st = NULL; char buf[20]; int ret = AVERROR_INVALIDDATA; int i, length = -1; switch (avio_r8(pb)) { case AMF_DATA_TYPE_MIXEDARRAY: avio_seek...
[ 1, 0 ]
FFmpeg
libavcodec/noise_bsf.c
static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe) { unsigned int *state = bsfc->priv_data; int amount = args ? atoi(args) : (*state % 10001 + 1); int i; ...
[ 1, 0 ]
FFmpeg
libavcodec/avuienc.c
static av_cold int avui_encode_init(AVCodecContext *avctx) { avctx->coded_frame = av_frame_alloc(); if (avctx->width != 720 || avctx->height != 486 && avctx->height != 576) { av_log(avctx, AV_LOG_ERROR, "Only 720x486 and 720x576 are supported.\n"); return AVERROR(EINVAL); } if (!avctx->coded_frame...
[ 1, 0 ]
qemu
hw/acpi.c
void acpi_pm1_evt_write_sts(ACPIREGS *ar, uint16_t val) { uint16_t pm1_sts = acpi_pm1_evt_get_sts(ar, ar->tmr.overflow_time); if (pm1_sts & val & ACPI_BITMASK_TIMER_STATUS) { /* if TMRSTS is reset, then compute the new overflow time */ acpi_pm_tmr_calc_overflow_time(ar); } ar->pm1.evt.sts &= ~val;...
[ 1, 0 ]
qemu
linux-user/elfload.c
static abi_ulong setup_arg_pages(abi_ulong p, struct linux_binprm *bprm, struct image_info *info) { abi_ulong stack_base, size, error; int i; /* Create enough stack to hold everything. If we don't use * it for args, we'll use it for something else... */ size = gue...
[ 1, 1 ]
qemu
hw/char/cadence_uart.c
static void uart_parameters_setup(UartState *s) { QEMUSerialSetParams ssp; unsigned int baud_rate, packet_size; baud_rate = (s->r[R_MR] & UART_MR_CLKS) ? UART_INPUT_CLK / 8 : UART_INPUT_CLK; ssp.speed = baud_rate / (s->r[R...
[ 0, 0 ]
qemu
block/raw-posix.c
static size_t handle_aiocb_rw_vector(struct qemu_paiocb *aiocb) { size_t offset = 0; ssize_t len; do { if (aiocb->aio_type == QEMU_PAIO_WRITE) len = qemu_pwritev(aiocb->aio_fildes, aiocb->aio_iov, aiocb->aio_niov, aiocb-...
[ 0, 0 ]
qemu
target/ppc/fpu_helper.c
void helper_xssubqp(CPUPPCState *env, uint32_t opcode) { ppc_vsr_t xt, xa, xb; float_status tstat; getVSR(rA(opcode) + 32, &xa, env); getVSR(rB(opcode) + 32, &xb, env); getVSR(rD(opcode) + 32, &xt, env); helper_reset_fpstatus(env); if (unlikely(Rc(opcode) != 0)) { /* TODO: Support xssubqp aft...
[ 0, 1 ]
FFmpeg
libavformat/matroskaenc.c
static int mkv_write_tag_targets(AVFormatContext *s, unsigned int elementid, unsigned int uid, ebml_master *tags, ebml_master *tag) { AVIOContext *pb; MatroskaMuxContext *mkv = s->priv_data; ebml_master targets; int ret; if (!tags->pos)...
[ 0, 0 ]
qemu
block/nbd.c
static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr, Error **errp) { QIOChannelSocket *sioc; Error *local_err = NULL; sioc = qio_channel_socket_new(); qio_channel_set_name(QIO_CHANNEL(sioc), "nbd-client"); qio_channel_socket_connect_s...
[ 1, 0 ]
FFmpeg
libavformat/4xm.c
static int ogg_read_header(AVFormatContext *avfcontext, AVFormatParameters *ap) { OggContext *context = avfcontext->priv_data; ogg_packet op; char *buf; ogg_page og; AVStream *ast; AVCodecContext *codec; uint8_t *p; int i; ogg_sync_init(&context->oy); buf = ogg_sync_buffer(&context->oy, D...
[ 1, 0 ]
qemu
tcg/tcg.c
static inline int tcg_temp_new_internal(TCGType type, int temp_local) { TCGContext *s = &tcg_ctx; TCGTemp *ts; int idx, k; k = type; if (temp_local) k += TCG_TYPE_COUNT; idx = s->first_free_temp[k]; if (idx != -1) { /* There is already an available temp with the right type */ ts = &s->t...
[ 1, 0 ]
qemu
configure
static VncClientInfo *qmp_query_vnc_client(const VncState *client) { struct sockaddr_storage sa; socklen_t salen = sizeof(sa); char host[NI_MAXHOST]; char serv[NI_MAXSERV]; VncClientInfo *info; if (getpeername(client->csock, (struct sockaddr *)&sa, &salen) < 0) { return NULL; } if (getnamei...
[ 1, 0 ]
FFmpeg
libavcodec/vp56.c
static int vp56_size_changed(VP56Context *s) { AVCodecContext *avctx = s->avctx; int stride = s->frames[VP56_FRAME_CURRENT]->linesize[0]; int i; s->plane_width[0] = s->plane_width[3] = avctx->coded_width; s->plane_width[1] = s->plane_width[2] = avctx->coded_width / 2; s->plane_height[0] = s->plane_height[3]...
[ 1, 0 ]
qemu
backends/testdev.c
static CharDriverState *qemu_chr_open_win_path(const char *filename) { CharDriverState *chr; WinCharState *s; chr = qemu_chr_alloc(); s = g_malloc0(sizeof(WinCharState)); chr->opaque = s; chr->chr_write = win_chr_write; chr->chr_close = win_chr_close; if (win_chr_init(chr, filename) < 0) { ...
[ 1, 0 ]
qemu
bsd-user/main.c
static void shix_init(MachineState *machine) { const char *cpu_model = machine->cpu_model; int ret; SuperHCPU *cpu; struct SH7750State *s; MemoryRegion *sysmem = get_system_memory(); MemoryRegion *rom = g_new(MemoryRegion, 1); MemoryRegion *sdram = g_new(MemoryRegion, 2); if (!cpu_model) c...
[ 1, 0 ]
FFmpeg
libavcodec/hevc_cabac.c
void ff_hevc_cabac_init(HEVCContext *s, int ctb_addr_ts) { if (ctb_addr_ts == s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]) { cabac_init_decoder(s); if (s->sh.dependent_slice_segment_flag == 0 || (s->ps.pps->tiles_enabled_flag && s->ps.pps->tile_id[ctb_addr_ts] != ...
[ 1, 0 ]
qemu
target-m68k/translate.c
static inline TCGv gen_load(DisasContext *s, int opsize, TCGv addr, int sign) { TCGv tmp; int index = IS_USER(s); s->is_mem = 1; tmp = tcg_temp_new_i32(); switch (opsize) { case OS_BYTE: if (sign) tcg_gen_qemu_ld8s(tmp, addr, index); else tcg_gen_qemu_ld8u(tmp, addr, index); ...
[ 1, 0 ]
FFmpeg
libavcodec/simple_idct.c
void FUNC(ff_simple_idct_put)(uint8_t *dest_, int line_size, DCTELEM *block) { pixel *dest = (pixel *)dest_; int i; line_size /= sizeof(pixel); for (i = 0; i < 8; i++) FUNC(idctRowCondDC)(block + i * 8); for (i = 0; i < 8; i++) FUNC(idctSparseColPut)(dest + i, line_size, block + i); }
[ 1, 0 ]
qemu
hw/scsi/megasas.c
static void megasas_scsi_uninit(PCIDevice *d) { MegasasState *s = MEGASAS(d); if (megasas_use_msix(s)) { msix_uninit(d, &s->mmio_io, &s->mmio_io); } if (megasas_use_msi(s)) { msi_uninit(d); } }
[ 1, 0 ]
FFmpeg
libavformat/aviobuf.c
static uint64_t find_any_startcode(ByteIOContext *bc, int64_t pos) { uint64_t state = 0; if (pos >= 0) url_fseek(bc, pos, SEEK_SET); // note, this may fail if the stream isnt seekable, but // that shouldnt matter, as in this case we simply // st...
[ 1, 0 ]
qemu
Makefile.objs
static void jpeg_init_destination(j_compress_ptr cinfo) { VncState *vs = cinfo->client_data; Buffer *buffer = &vs->tight_jpeg; cinfo->dest->next_output_byte = (JOCTET *)buffer->buffer + buffer->offset; cinfo->dest->free_in_buffer = (size_t)(buffer->capacity - buffer->offset); }
[ 0, 0 ]
qemu
configure
int xen_be_init(void) { xenstore = xs_daemon_open(); if (!xenstore) { xen_be_printf(NULL, 0, "can't connect to xenstored\n"); return -1; } if (qemu_set_fd_handler(xs_fileno(xenstore), xenstore_update, NULL, NULL) < 0) { goto err; } xen_xc = xc_interface_open(); if (xen_xc == -1)...
[ 0, 0 ]
qemu
hw/msix.c
static void msix_mmio_writel(void *opaque, target_phys_addr_t addr, uint32_t val) { PCIDevice *dev = opaque; unsigned int offset = addr & (MSIX_PAGE_SIZE - 1) & ~0x3; int vector = offset / MSIX_ENTRY_SIZE; pci_set_long(dev->msix_table_page + offset, val); if (!msix_is_maske...
[ 1, 0 ]
qemu
hmp.c
static void virtio_input_handle_event(DeviceState *dev, QemuConsole *src, InputEvent *evt) { VirtIOInput *vinput = VIRTIO_INPUT(dev); virtio_input_event event; int qcode; switch (evt->kind) { case INPUT_EVENT_KIND_KEY: qcode = qemu_input_key_value_to_qcode(evt...
[ 1, 0 ]
qemu
hw/intc/omap_intc.c
static void omap_inth_sir_update(struct omap_intr_handler_s *s, int is_fiq) { int i, j, sir_intr, p_intr, p, f; uint32_t level; sir_intr = 0; p_intr = 255; /* Find the interrupt line with the highest dynamic priority. * Note: 0 denotes the hightest priority. * If all interrupts have the same pri...
[ 1, 0 ]
qemu
monitor.c
static target_long monitor_get_pc(const struct MonitorDef *md, int val) { CPUState *env = mon_get_cpu(); if (!env) return 0; return env->eip + env->segs[R_CS].base; }
[ 1, 0 ]
qemu
configure
static void bufp_alloc(USBRedirDevice *dev, uint8_t *data, int len, int status, uint8_t ep) { struct buf_packet *bufp; if (!dev->endpoint[EP2I(ep)].bufpq_dropping_packets && dev->endpoint[EP2I(ep)].bufpq_size > 2 * dev->endpoint[EP2I(ep)].bufpq_target_size) { DPRINT...
[ 1, 0 ]
FFmpeg
libavformat/au.c
static int au_write_header(AVFormatContext *s) { AVIOContext *pb = s->pb; AVCodecContext *enc = s->streams[0]->codec; if (!enc->codec_tag) return AVERROR(EINVAL); ffio_wfourcc(pb, ".snd"); /* magic number */ avio_wb32(pb, AU_HEADER_SIZE); /* header size */ avio_wb32(pb, AU_UNKNOWN_SIZE); /* data...
[ 1, 0 ]
qemu
hw/rtl8139.c
static int rtl8139_config_writable(RTL8139State *s) { if (s->Cfg9346 & Cfg9346_Unlock) { return 1; } DPRINTF("Configuration registers are write-protected\n"); return 0; }
[ 0, 0 ]
qemu
hw/vfio/common.c
static int vfio_container_do_ioctl(AddressSpace *as, int32_t groupid, int req, void *param) { VFIOGroup *group; VFIOContainer *container; int ret = -1; group = vfio_get_group(groupid, as); if (!group) { error_report("vfio: group %d not registered", groupid); ...
[ 0, 0 ]
FFmpeg
libavcodec/h264.h
static int h264_find_frame_end(H264ParseContext *p, const uint8_t *buf, int buf_size) { int i; uint32_t state; ParseContext *pc = &p->pc; // mb_addr= pc->mb_addr - 1; state = pc->state; if (state > 13) state = 7; for (i = 0; i < buf_size; i++) { if (sta...
[ 1, 0 ]
qemu
monitor.c
static void do_info_balloon(Monitor *mon, QObject **ret_data) { ram_addr_t actual; actual = qemu_balloon_status(); if (kvm_enabled() && !kvm_has_sync_mmu()) qemu_error_new(QERR_KVM_MISSING_CAP, "synchronous MMU", "balloon"); else if (actual == 0) qemu_error_new(QERR_DEVICE_NOT_ACTIVE, "balloon");...
[ 0, 0 ]
qemu
block/nbd.c
void qio_channel_socket_listen_async(QIOChannelSocket *ioc, SocketAddressLegacy *addr, QIOTaskFunc callback, gpointer opaque, GDestroyNotify destroy) { QIOTask *tas...
[ 0, 0 ]
qemu
HACKING
static void bmdma_write(void *opaque, target_phys_addr_t addr, uint64_t val, unsigned size) { BMDMAState *bm = opaque; if (size != 1) { return; } #ifdef DEBUG_IDE printf("bmdma: writeb 0x%02x : 0x%02x\n", addr, val); #endif switch (addr & 3) { case 0: bmdma_cmd_wri...
[ 0, 0 ]
qemu
hw/omap.h
static uint32_t omap_l4_io_readw(void *opaque, target_phys_addr_t addr) { unsigned int i = (addr - OMAP2_L4_BASE) >> TARGET_PAGE_BITS; return omap_l4_io_readw_fn[i](omap_l4_io_opaque[i], addr); }
[ 1, 0 ]
qemu
target/arm/helper.c
static void pmuserenr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { env->cp15.c9_pmuserenr = value & 1; }
[ 0, 0 ]
FFmpeg
libavcodec/libopenjpegdec.c
static inline void libopenjpeg_copy_to_packed16(AVFrame *picture, opj_image_t *image) { uint16_t *img_ptr; int index, x, y, c; int adjust[4]; for (x = 0; x < image->numcomps; x++) adjust[x] = FFMAX(FFMIN(av_pix_fmt_desc_get(picture->format)->comp[...
[ 1, 0 ]
FFmpeg
libavformat/avformat.h
static int gif_write_header(AVFormatContext *s) { GIFContext *gif = s->priv_data; AVIOContext *pb = s->pb; AVCodecContext *enc, *video_enc; int i, width, height, loop_count /*, rate*/; /* XXX: do we reject audio streams or just ignore them ? if(s->nb_streams > 1) return -1; */ gi...
[ 0, 1 ]
qemu
contrib/libvhost-user/libvhost-user.c
vu_queue_empty(VuDev *dev, VuVirtq *vq) { if (vq->shadow_avail_idx != vq->last_avail_idx) { return 0; } return vring_avail_idx(vq) == vq->last_avail_idx; }
[ 1, 0 ]
FFmpeg
libavformat/oggparsevorbis.c
fixup_vorbis_headers(AVFormatContext *as, struct oggvorbis_private *priv, uint8_t **buf) { int i, offset, len, buf_len; unsigned char *ptr; len = priv->len[0] + priv->len[1] + priv->len[2]; buf_len = len + len / 255 + 64; ptr = *buf = av_realloc(NULL, buf_len); memset(*buf, '\0'...
[ 1, 0 ]
FFmpeg
libavcodec/4xm.c
static int build_vlc(VLC *vlc, const uint8_t *bits_table, const uint8_t *val_table, int nb_codes) { uint8_t huff_size[256]; uint16_t huff_code[256]; memset(huff_size, 0, sizeof(huff_size)); build_huffman_codes(huff_size, huff_code, bits_table, val_table); retur...
[ 1, 0 ]
FFmpeg
configure
void ff_xvmc_init_block(MpegEncContext *s) { struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt *)s->current_picture.f->data[2]; assert(render && render->xvmc_id == AV_XVMC_ID); s->block = (int16_t (*)[64])(render->data_blocks + render->next_free_data_block_num * 64); }
[ 1, 0 ]
FFmpeg
libavcodec/motion_est.c
static inline int small_diamond_search4MV(MpegEncContext *s, int *best, int dmin, UINT8 *new_pic, UINT8 *old_pic, int pic_stride, int pred_x, int pred_y, UINT16 *mv_penalty, int quant, int xmin, int ymin, int xmax, int ymax, int shift) { int...
[ 1, 0 ]
FFmpeg
libavcodec/motion_est.c
static inline void set_p_mv_tables(MpegEncContext *s, int mx, int my) { const int xy = s->mb_x + 1 + (s->mb_y + 1) * (s->mb_width + 2); s->p_mv_table[xy][0] = mx; s->p_mv_table[xy][1] = my; /* has allready been set to the 4 MV if 4MV is done */ if (!(s->flags & CODEC_FLAG_4MV)) { int mot_xy = s->bl...
[ 0, 0 ]
FFmpeg
doc/APIchanges
static int hds_flush(AVFormatContext *s, OutputStream *os, int final, int64_t end_ts) { HDSContext *c = s->priv_data; int i, ret = 0; char target_filename[1024]; int index = s->streams[os->first_stream]->id; if (!os->packets_written) return 0; avio_flush(os->ctx->pb); os...
[ 1, 0 ]
FFmpeg
postproc/rgb2rgb.c
static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, int width) { #ifdef HAVE_MMX asm volatile( "movq " MANGLE(bm01010101) ", %%mm2\n\t" "mov %0, %%" REG_a " \n\t" "1: \n\t" "movq (%1, %%" REG...
[ 1, 0 ]
qemu
monitor.c
static void print_pte(Monitor *mon, uint32_t addr, uint32_t pte, uint32_t mask) { monitor_printf(mon, "%08x: %08x %c%c%c%c%c%c%c%c\n", addr, pte & mask, pte & PG_GLOBAL_MASK ? 'G' : '-', pte & PG_PSE_MASK ? 'P' : '-', pte & PG...
[ 1, 0 ]
FFmpeg
libavcodec/h264_refs.c
void ff_h264_remove_all_refs(H264Context *h) { int i; for (i = 0; i < 16; i++) { remove_long(h, i, 0); } assert(h->long_ref_count == 0); ff_h264_unref_picture(h, &h->last_pic_for_ec); if (h->short_ref_count) ff_h264_ref_picture(h, &h->last_pic_for_ec, h->short_ref[0]); for (i = 0; i < h->...
[ 1, 0 ]
FFmpeg
ffserver.c
static int tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st) { RTSPState *rt = s->priv_data; AVFormatContext *rtpctx = rtsp_st->transport_priv; uint8_t *buf, *ptr; int size; uint8_t *interleave_header, *interleaved_packet; size = avio_close_dyn_buf(rtpctx->pb, &buf); ptr = buf; while (s...
[ 1, 0 ]
qemu
target-ppc/cpu.h
static int dump_ppc_insns(CPUPPCState *env) { opc_handler_t **table, *handler; uint8_t opc1, opc2, opc3; printf("Instructions set:\n"); /* opc1 is 6 bits long */ for (opc1 = 0x00; opc1 < 0x40; opc1++) { table = env->opcodes; handler = table[opc1]; if (is_indirect_opcode(handler)) { ...
[ 1, 0 ]
qemu
configure
static void main_loop(void) { bool nonblocking; int last_io __attribute__((unused)) = 0; #ifdef CONFIG_PROFILER int64_t ti; #endif int r; qemu_main_loop_start(); for (;;) { #ifdef CONFIG_IOTHREAD nonblocking = !kvm_enabled() && last_io > 0; #else nonblocking = cpu_exec_all(); if (v...
[ 1, 0 ]
FFmpeg
libavformat/mpegts.c
static int get_packet_size(const uint8_t *buf, int size) { int score, fec_score, dvhs_score; if (size < (TS_FEC_PACKET_SIZE * 5 + 1)) return AVERROR_INVALIDDATA; score = analyze(buf, size, TS_PACKET_SIZE, NULL); dvhs_score = analyze(buf, size, TS_DVHS_PACKET_SIZE, NULL); fec_score = analyze(buf, si...
[ 1, 0 ]
FFmpeg
libavformat/matroskadec.c
static void matroska_execute_seekhead(MatroskaDemuxContext *matroska) { EbmlList *seekhead_list = &matroska->seekhead; MatroskaSeekhead *seekhead = seekhead_list->elem; int64_t before_pos = avio_tell(matroska->ctx->pb); int i; // we should not do any seeking in the streaming case if (!matroska->ctx->...
[ 1, 0 ]
qemu
hw/ppc/spapr_hcall.c
static inline void do_rfi(CPUPPCState *env, target_ulong nip, target_ulong msr, target_ulong msrm, int keep_msrh) { CPUState *cs = CPU(ppc_env_get_cpu(env)); #if defined(TARGET_PPC64) if (msr_is_64bit(env, msr)) { nip = (uint64_t)nip; msr &= (uint64_t)msrm; } else { nip = (ui...
[ 1, 1 ]
qemu
hw/arm/nseries.c
static void omap_lpg_update(struct omap_lpg_s *s) { int64_t on, period = 1, ticks = 1000; static const int per[8] = {1, 2, 4, 8, 12, 16, 20, 24}; if (~s->control & (1 << 6)) /* LPGRES */ on = 0; else if (s->control & (1 << 7)) /* PERM_ON */ on = period; else { period = muldiv64(ticks, per...
[ 1, 0 ]
qemu
check-qjson.c
START_TEST(vararg_number) { QObject *obj; QInt *qint; QFloat *qfloat; int value = 0x2342; int64_t value64 = 0x2342342343LL; double valuef = 2.323423423; obj = qobject_from_jsonf("%d", value); fail_unless(obj != NULL); fail_unless(qobject_type(obj) == QTYPE_QINT); qint = qobject_to_qint(ob...
[ 1, 0 ]
qemu
cpu-all.h
static void print_features(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...), uint32_t features, const char *prefix) { unsigned int i; for (i = 0; i < ARRAY_SIZE(feature_name); i++) if (feature_name[i] && (features & (1 << i))) { if (pr...
[ 0, 0 ]
qemu
block.c
static int qcow2_check(BlockDriverState *bs, BdrvCheckResult *result) { return qcow2_check_refcounts(bs, result); }
[ 0, 0 ]
qemu
block.c
int bdrv_pread(BlockDriverState *bs, int64_t offset, void *buf, int bytes) { QEMUIOVector qiov; struct iovec iov = { .iov_base = (void *)buf, .iov_len = bytes, }; int ret; if (bytes < 0) { return -EINVAL; } qemu_iovec_init_external(&qiov, &iov, 1); ret = bdrv_prwv_co(bs, offse...
[ 0, 0 ]
qemu
block/gluster.c
static int qemu_gluster_parseuri(GlusterConf *gconf, const char *filename) { URI *uri; QueryParams *qp = NULL; bool is_unix = false; int ret = 0; uri = uri_parse(filename); if (!uri) { return -EINVAL; } /* transport */ if (!strcmp(uri->scheme, "gluster")) { gconf->transport = g_strd...
[ 1, 0 ]
qemu
block/iscsi.c
iscsi_abort_task_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data) { IscsiAIOCB *acb = (IscsiAIOCB *)private_data; scsi_free_scsi_task(acb->task); acb->task = NULL; }
[ 1, 0 ]
qemu
block.c
int bdrv_all_delete_snapshot(const char *name, BlockDriverState **first_bad_bs, Error **err) { int ret = 0; BlockDriverState *bs; BdrvNextIterator *it = NULL; QEMUSnapshotInfo sn1, *snapshot = &sn1; while (ret == 0 && (it = bdrv_next(it, &bs))) { AioContext *ctx = bdrv...
[ 1, 0 ]
qemu
include/qemu/sockets.h
static void qio_channel_socket_finalize(Object *obj) { QIOChannelSocket *ioc = QIO_CHANNEL_SOCKET(obj); if (ioc->fd != -1) { #ifdef WIN32 WSAEventSelect(ioc->fd, NULL, 0); #endif closesocket(ioc->fd); ioc->fd = -1;
[ 1, 0 ]
qemu
tests/e1000e-test.c
static void load_tco(const TestData *d) { qpci_io_writew(d->dev, d->tco_io_base + TCO_RLD, 4); }
[ 1, 0 ]
qemu
target-ppc/int_helper.c
target_ulong helper_srad(CPUPPCState *env, target_ulong value, target_ulong shift) { int64_t ret; if (likely(!(shift & 0x40))) { if (likely((uint64_t)shift != 0)) { shift &= 0x3f; ret = (int64_t)value >> shift; if (likely(ret >= 0 || (value & ((1 << shift) - 1)...
[ 1, 0 ]
qemu
Makefile
void qemu_aio_wait_end(void) {}
[ 1, 0 ]
qemu
hw/ppc/spapr_hcall.c
static target_ulong h_remove(PowerPCCPU *cpu, sPAPRMachineState *spapr, target_ulong opcode, target_ulong *args) { CPUPPCState *env = &cpu->env; target_ulong flags = args[0]; target_ulong pte_index = args[1]; target_ulong avpn = args[2]; RemoveResult ret; ret = remove_hp...
[ 1, 0 ]
qemu
hw/ide/ich.c
static int pci_ich9_uninit(PCIDevice *dev) { struct AHCIPCIState *d; d = DO_UPCAST(struct AHCIPCIState, card, dev); if (msi_enabled(dev)) { msi_uninit(dev); } qemu_unregister_reset(ahci_reset, d); ahci_uninit(&d->ahci); return 0; }
[ 1, 0 ]
FFmpeg
libavformat/idcin.c
static int idcin_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) { IdcinDemuxContext *idcin = s->priv_data; if (idcin->first_pkt_pos > 0) { int ret = avio_seek(s->pb, idcin->first_pkt_pos, SEEK_SET); if (ret < 0) return ret; ff_updat...
[ 1, 0 ]
qemu
util/hbitmap.c
void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint) { qiov->iov = g_malloc(alloc_hint * sizeof(struct iovec)); qiov->niov = 0; qiov->nalloc = alloc_hint; qiov->size = 0; }
[ 1, 0 ]
FFmpeg
libavcodec/cabac.h
static int decode_cabac_mb_skip(H264Context *h, int mb_x, int mb_y) { MpegEncContext *const s = &h->s; int mba_xy, mbb_xy; int ctx = 0; if (FRAME_MBAFF) { // FIXME merge with the stuff in fill_caches? int mb_xy = mb_x + (mb_y & ~1) * s->mb_stride; mba_xy = mb_xy - 1; if ((mb_y & 1) &...
[ 1, 1 ]
FFmpeg
libavformat/mpeg.c
static int handle_packets(AVFormatContext *s, int nb_packets) { MpegTSContext *ts = s->priv_data; ByteIOContext *pb = &s->pb; uint8_t packet[TS_FEC_PACKET_SIZE]; int packet_num, len; ts->stop_parse = 0; packet_num = 0; for (;;) { if (ts->stop_parse) break; packet_num++; if (n...
[ 1, 1 ]
FFmpeg
libavcodec/sbrdsp_fixed.c
static SoftFloat sbr_sum_square_c(int (*x)[2], int n) { SoftFloat ret; uint64_t accu = 0, round; int i, nz; unsigned u; for (i = 0; i < n; i += 2) { // Larger values are inavlid and could cause overflows of accu. av_assert2(FFABS(x[i + 0][0]) >> 29 == 0); accu += (int64_t)x[i + 0][0] * x[...
[ 1, 0 ]
qemu
tests/test-cutils.c
int qemu_strtoll(const char *nptr, const char **endptr, int base, int64_t *result) { char *p; int err = 0; if (!nptr) { if (endptr) { *endptr = nptr; } err = -EINVAL; } else { errno = 0; *result = strtoll(nptr, &p, base); err = check_strtox_error(endptr...
[ 1, 0 ]
FFmpeg
libswscale/swscale-example.c
static uint64_t getSSD(uint8_t *src1, uint8_t *src2, int stride1, int stride2, int w, int h) { int x, y; uint64_t ssd = 0; // printf("%d %d\n", w, h); for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { int d = src1[x + y * stride1] - src2[x + y * stride2]; ssd += d...
[ 1, 0 ]
qemu
tests/vhost-user-test.c
static inline void test_server_connect(TestServer *server) { test_server_create_chr(server, ",reconnect=1"); }
[ 1, 0 ]
FFmpeg
libavcodec/nellymoserenc.c
static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) { NellyMoserEncodeContext *s = avctx->priv_data; int ret; if (s->last_frame) return 0; memcpy(s->buf, s->buf + NELLY_SAMPLES, NELLY_BUF_LEN * sizeof(*s->buf)); if (fra...
[ 1, 0 ]
qemu
Makefile.objs
void unix_start_outgoing_migration(MigrationState *s, const char *path, Error **errp) { unix_nonblocking_connect(path, unix_wait_for_connect, s, errp); }
[ 1, 0 ]
qemu
hw/scsi/mptsas.c
static void *mptsas_load_request(QEMUFile *f, SCSIRequest *sreq) { SCSIBus *bus = sreq->bus; MPTSASState *s = container_of(bus, MPTSASState, bus); PCIDevice *pci = PCI_DEVICE(s); MPTSASRequest *req; int i, n; req = g_new(MPTSASRequest, 1); qemu_get_buffer(f, (unsigned char *)&req->scsi_io, sizeof(...
[ 1, 1 ]
qemu
hw/lance.c
VLANClientState *qemu_new_vlan_client(VLANState *vlan, IOReadHandler *fd_read, void *opaque) { VLANClientState *vc, **pvc; vc = qemu_mallocz(sizeof(VLANClientState)); if (!vc) return NULL; vc->fd_read = fd_read; vc->opaque = opaque; vc->vlan = vlan; vc->...
[ 1, 0 ]
qemu
hw/arm/omap1.c
struct omap_gpmc_s *omap_gpmc_init(struct omap_mpu_state_s *mpu, hwaddr base, qemu_irq irq, qemu_irq drq) { int cs; struct omap_gpmc_s *s = (struct omap_gpmc_s *) g_malloc0(sizeof(struct omap_gpmc_s)); memory_region_init_io(&s->iom...
[ 1, 0 ]
FFmpeg
libavcodec/dsputil.c
static void rv34_idct_add_c(uint8_t *dst, ptrdiff_t stride, DCTELEM *block) { int temp[16]; uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; int i; rv34_row_transform(temp, block); memset(block, 0, 16 * sizeof(DCTELEM)); for (i = 0; i < 4; i++) { const int z0 = 13 * (temp[4 * 0 + i] + temp[4 * 2 + i]) + ...
[ 1, 0 ]
qemu
linux-user/elfload.c
static inline void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUSH4State *env) { int i; for (i = 0; i < 16; i++) { (*regs[i]) = tswapreg(env->gregs[i]); } (*regs)[TARGET_REG_PC] = tswapreg(env->pc); (*regs)[TARGET_REG_PR] = tswapreg(env->pr); (*re...
[ 1, 1 ]
qemu
tcg/ppc64/tcg-target.c
static void tcg_out_ld(TCGContext *s, TCGType type, int ret, int arg1, tcg_target_long arg2) { if (type == TCG_TYPE_I32) tcg_out_ldst(s, ret, arg1, arg2, LWZ, LWZX); else tcg_out_ldst(s, ret, arg1, arg2, LD, LDX); }
[ 1, 0 ]
FFmpeg
libavfilter/af_afir.c
static int filter_frame(AVFilterLink *link, AVFrame *frame) { AVFilterContext *ctx = link->dst; AudioFIRContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; int ret = 0; av_audio_fifo_write(s->fifo[0], (void **)frame->extended_data, frame->nb_samples); if (s->pts ==...
[ 1, 0 ]
FFmpeg
libavcodec/intrax8.c
static av_cold int wmv2_decode_init(AVCodecContext *avctx) { Wmv2Context *const w = avctx->priv_data; int ret; if ((ret = ff_msmpeg4_decode_init(avctx)) < 0) return ret; ff_wmv2_common_init(w); return ff_intrax8_common_init(&w->x8, &w->s.idsp, &w->s); }
[ 0, 0 ]
FFmpeg
libavcodec/dxva2_h264.c
static int h264_init_context(AVCodecContext *avctx, H264Context *h) { int i; h->avctx = avctx; h->picture_structure = PICT_FRAME; h->slice_context_count = 1; h->workaround_bugs = avctx->workaround_bugs; h->flags = avctx->flags; h->prev_poc_msb = 1 << 16; h->x264_build = -1; h->recovery_frame...
[ 1, 0 ]
qemu
fpu/softfloat-specialize.h
INLINE flag extractFloat32Sign(float32 a) { return a >> 31; }
[ 0, 0 ]
qemu
fpu/softfloat-specialize.h
int float64_lt_quiet(float64 a, float64 b STATUS_PARAM) { flag aSign, bSign; if (((extractFloat64Exp(a) == 0x7FF) && extractFloat64Frac(a)) || ((extractFloat64Exp(b) == 0x7FF) && extractFloat64Frac(b)) ) { if (float64_is_signaling_nan(a) || float64_is_signaling_nan(b)) { float_raise(float_f...
[ 1, 0 ]
qemu
include/exec/gen-icount.h
gen_intermediate_code_internal(TriCoreCPU *cpu, struct TranslationBlock *tb, int search_pc) { CPUState *cs = CPU(cpu); CPUTriCoreState *env = &cpu->env; DisasContext ctx; target_ulong pc_start; int num_insns; uint16_t *gen_opc_end; if (search_pc) { qemu_log("se...
[ 0, 0 ]
qemu
block/raw-posix.c
static int raw_pread_aligned(BlockDriverState *bs, int64_t offset, uint8_t *buf, int count) { BDRVRawState *s = bs->opaque; int ret; ret = fd_open(bs); if (ret < 0) return ret; ret = pread(s->fd, buf, count, offset); if (ret == count) goto label__raw_read__succ...
[ 1, 0 ]
qemu
cpu-exec.c
static void dead_tmp(TCGv tmp) { int i; num_temps--; i = num_temps; if (GET_TCGV(temps[i]) == GET_TCGV(tmp)) return; /* Shuffle this temp to the last slot. */ while (GET_TCGV(temps[i]) != GET_TCGV(tmp)) i--; while (i < num_temps) { temps[i] = temps[i + 1]; i++; } temps[i]...
[ 0, 0 ]
qemu
target-i386/misc_helper.c
static inline void check_io(CPUX86State *env, int addr, int size) { int io_offset, val, mask; /* TSS must be a valid 32 bit one */ if (!(env->tr.flags & DESC_P_MASK) || ((env->tr.flags >> DESC_TYPE_SHIFT) & 0xf) != 9 || env->tr.limit < 103) { goto fail; } io_offset = cpu_lduw_kernel(en...
[ 1, 0 ]
qemu
hw/escc.c
static inline void set_txint(ChannelState *s) { s->txint = 1; if (!s->rxint_under_svc) { s->txint_under_svc = 1; if (s->chn == chn_a) { s->rregs[R_INTR] |= INTR_TXINTA; if (s->wregs[W_MINTR] & MINTR_STATUSHI) s->otherchn->rregs[R_IVEC] = IVEC_HITXINTA; else s->oth...
[ 1, 0 ]
FFmpeg
libavcodec/lossless_audiodsp.c
static void revert_acfilter(WmallDecodeCtx *s, int tile_size) { int ich, pred, i, j; int16_t *filter_coeffs = s->acfilter_coeffs; int scaling = s->acfilter_scaling; int order = s->acfilter_order; for (ich = 0; ich < s->num_channels; ich++) { int *prevvalues = s->acfilter_prevvalues[ich]; for (...
[ 1, 0 ]
qemu
qom/object.c
static void property_set_enum(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { EnumProperty *prop = opaque; int value; visit_type_enum(v, &value, prop->strings, NULL, name, errp); prop->set(obj, value, errp); }
[ 1, 0 ]
FFmpeg
libavcodec/dxva2_h264.c
void ff_h264_filter_mb_fast(const H264Context *h, H264SliceContext *sl, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize) { assert(!FRAME_MBAFF(h)); if (!h->h...
[ 1, 0 ]
FFmpeg
libavformat/ffmdec.c
static int ffm_is_avail_data(AVFormatContext *s, int size) { FFMContext *ffm = s->priv_data; int64_t pos, avail_size; int len; len = ffm->packet_end - ffm->packet_ptr; if (size <= len) return 1; pos = avio_tell(s->pb); if (!ffm->write_index) { if (pos == ffm->file_size) return AVE...
[ 1, 0 ]
qemu
hw/fw_cfg.c
int fw_cfg_add_bytes(FWCfgState *s, uint16_t key, uint8_t *data, uint32_t len) { int arch = !!(key & FW_CFG_ARCH_LOCAL); key &= FW_CFG_ENTRY_MASK; if (key >= FW_CFG_MAX_ENTRY) return 0; s->entries[arch][key].data = data; s->entries[arch][key].len = len; return 1; }
[ 1, 0 ]