instruction stringclasses 1
value | output stringclasses 2
values | input stringlengths 21 96.3k |
|---|---|---|
positive | int64_t avio_seek(AVIOContext *s, int64_t offset, int whence){ int64_t offset1; int64_t pos; int force = whence & AVSEEK_FORCE; int buffer_size; int short_seek; whence &= ~AVSEEK_FORCE; if(!s) buffer_size = s->buf_end - s->buffer; // pos is the absolute position that the beginning of s->buffer corresponds to in the fil... | |
positive | static void coroutine_fn v9fs_rename(void *opaque){ int32_t fid; ssize_t err = 0; size_t offset = 7; V9fsString name; int32_t newdirfid; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dds", &fid, &newdirfid, &name); if (err < 0) { goto out_no... | |
positive | AVVDPAUContext *av_vdpau_alloc_context(void){ return av_mallocz(sizeof(AVVDPAUContext));} | |
positive | static AVBufferRef *pool_alloc_buffer(AVBufferPool *pool){ BufferPoolEntry *buf; AVBufferRef *ret; ret = pool->alloc(pool->size); if (!ret) return NULL; buf = av_mallocz(sizeof(*buf)); if (!buf) { av_buffer_unref(&ret); return NULL; } buf->data = ret->buffer->data; buf->opaque = ret->buffer->opaque; buf->free = ret->bu... | |
positive | static void compute_frame_duration(int *pnum, int *pden, AVStream *st, AVCodecParserContext *pc, AVPacket *pkt){ int frame_size; *pnum = 0; *pden = 0; switch(st->codec.codec_type) { case CODEC_TYPE_VIDEO: if(st->time_base.num*1000 > st->time_base.den){ *pnum = st->time_base.num; *pden = st->time_base.den; }else if(st->... | |
positive | static int vdi_check(BlockDriverState *bs){ /* TODO: additional checks possible. */ BDRVVdiState *s = (BDRVVdiState *)bs->opaque; int n_errors = 0; uint32_t blocks_allocated = 0; uint32_t block; uint32_t *bmap; logout("\n"); bmap = qemu_malloc(s->header.blocks_in_image * sizeof(uint32_t)); memset(bmap, 0xff, s->header.... | |
positive | static void submit_pdu(V9fsState *s, V9fsPDU *pdu){ pdu_handler_t *handler; if (debug_9p_pdu) { pprint_pdu(pdu); } BUG_ON(pdu->id >= ARRAY_SIZE(pdu_handlers)); handler = pdu_handlers[pdu->id]; BUG_ON(handler == NULL); handler(s, pdu);} | |
positive | uint64_t helper_addqv (uint64_t op1, uint64_t op2){ uint64_t tmp = op1; op1 += op2; if (unlikely((tmp ^ op2 ^ (-1ULL)) & (tmp ^ op1) & (1ULL << 63))) { arith_excp(env, GETPC(), EXC_M_IOV, 0); } return op1;} | |
positive | static void cirrus_mem_writeb_mode4and5_8bpp(CirrusVGAState * s, unsigned mode, unsigned offset, uint32_t mem_value){ int x; unsigned val = mem_value; uint8_t *dst; dst = s->vram_ptr + offset; for (x = 0; x < 8; x++) {if (val & 0x80) { *dst = s->cirrus_shadow_gr1;} else if (mode == 5) { *dst = s->cirrus_shadow_gr0;}val... | |
positive | void translator_loop(const TranslatorOps *ops, DisasContextBase *db, CPUState *cpu, TranslationBlock *tb){ int max_insns; /* Initialize DisasContext */ db->tb = tb; db->pc_first = tb->pc; db->pc_next = db->pc_first; db->is_jmp = DISAS_NEXT; db->num_insns = 0; db->singlestep_enabled = cpu->singlestep_enabled; /* Instruc... | |
positive | static int load_apply_palette(FFFrameSync *fs){ AVFilterContext *ctx = fs->parent; AVFilterLink *inlink = ctx->inputs[0]; PaletteUseContext *s = ctx->priv; AVFrame *master, *second, *out = NULL; int ret; // writable for error diffusal dithering ret = ff_framesync_dualinput_get_writable(fs, &master, &second); if (ret < ... | |
negative | void avfilter_uninit(void){ memset(registered_avfilters, 0, sizeof(registered_avfilters)); next_registered_avfilter_idx = 0;} | |
negative | int pcm_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags){ AVStream *st; int block_align, byte_rate; int64_t pos; st = s->streams[0]; block_align = st->codec->block_align ? st->codec->block_align : (av_get_bits_per_sample(st->codec->codec_id) * st->codec->channels) >> 3; byte_rate = st->code... | |
negative | void show_pix_fmts(void){ list_fmts(avcodec_pix_fmt_string, PIX_FMT_NB);} | |
negative | static int spdif_get_offset_and_codec(AVFormatContext *s, enum IEC61937DataType data_type, const char *buf, int *offset, enum AVCodecID *codec){ AACADTSHeaderInfo aac_hdr; GetBitContext gbc; switch (data_type & 0xff) { case IEC61937_AC3: *offset = AC3_FRAME_SIZE << 2; *codec = AV_CODEC_ID_AC3; break; case IEC61937_MPEG... | |
negative | static av_cold int seqvideo_decode_init(AVCodecContext *avctx){ SeqVideoContext *seq = avctx->priv_data; seq->avctx = avctx; avctx->pix_fmt = AV_PIX_FMT_PAL8; seq->frame.data[0] = NULL; return 0;} | |
negative | void set_context_opts(void *ctx, void *opts_ctx, int flags, AVCodec *codec){ int i; void *priv_ctx=NULL; if(!strcmp("AVCodecContext", (*(AVClass**)ctx)->class_name)){ AVCodecContext *avctx= ctx; if(codec && codec->priv_class && avctx->priv_data){ priv_ctx= avctx->priv_data; } } else if (!strcmp("AVFormatContext", (*(AV... | |
negative | int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int64_t pts, AVRational pixel_aspect){ BufferSourceContext *c = buffer_filter->priv; AVFilterBufferRef *buf; int ret; if (!buf) { c->eof = 1; return 0; } else if (c->eof) return AVERROR(EINVAL); if (!av_fifo_space(c->fifo) && (ret = av_fifo_re... | |
positive | static int decode_byterun(uint8_t *dst, int dst_size, const uint8_t *buf, const uint8_t *const buf_end){ const uint8_t *const buf_start = buf; unsigned x; for (x = 0; x < dst_size && buf < buf_end;) { unsigned length; const int8_t value = *buf++; if (value >= 0) { length = value + 1; memcpy(dst + x, buf, FFMIN3(length,... | |
positive | uint64_t blk_mig_bytes_total(void){ BlkMigDevState *bmds; uint64_t sum = 0; QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { sum += bmds->total_sectors; } return sum << BDRV_SECTOR_BITS;} | |
positive | theora_header (AVFormatContext * s, int idx){ struct ogg *ogg = s->priv_data; struct ogg_stream *os = ogg->streams + idx; AVStream *st = s->streams[idx]; struct theora_params *thp = os->private; int cds = st->codec->extradata_size + os->psize + 2; uint8_t *cdp; if(!(os->buf[os->pstart] & 0x80)) return 0; if(!thp){ thp ... | |
positive | static TAPState *net_tap_fd_init(VLANState *vlan, const char *model, const char *name, int fd){ TAPState *s; s = qemu_mallocz(sizeof(TAPState)); s->fd = fd; s->vc = qemu_new_vlan_client(vlan, model, name, tap_receive, NULL, s); s->vc->fd_readv = tap_receive_iov; qemu_set_fd_handler(s->fd, tap_send, NULL, s); snprintf(s... | |
positive | static int write_refcount_block_entries(BlockDriverState *bs, int64_t refcount_block_offset, int first_index, int last_index){ BDRVQcowState *s = bs->opaque; size_t size; int ret; if (cache_refcount_updates) { return 0; } if (first_index < 0) { return 0; } first_index &= ~(REFCOUNTS_PER_SECTOR - 1); last_index = (last_... | |
positive | static int t15(InterplayACMContext *s, unsigned ind, unsigned col){ GetBitContext *gb = &s->gb; unsigned i, b; int n1, n2, n3; for (i = 0; i < s->rows; i++) { /* b = (x1) + (x2 * 3) + (x3 * 9) */ b = get_bits(gb, 5); n1 = (mul_3x3[b] & 0x0F) - 1; n2 = ((mul_3x3[b] >> 4) & 0x0F) - 1; n3 = ((mul_3x3[b] >> 8) & 0x0F) - 1;... | |
positive | void do_load_6xx_tlb (int is_code){ target_ulong RPN, CMP, EPN; int way; RPN = env->spr[SPR_RPA]; if (is_code) { CMP = env->spr[SPR_ICMP]; EPN = env->spr[SPR_IMISS]; } else { CMP = env->spr[SPR_DCMP]; EPN = env->spr[SPR_DMISS]; } way = (env->spr[SPR_SRR1] >> 17) & 1;#if defined (DEBUG_SOFTWARE_TLB) if (loglevel != 0) {... | |
positive | void helper_dcbz(CPUPPCState *env, target_ulong addr, uint32_t is_dcbzl){ int dcbz_size = env->dcache_line_size;#if defined(TARGET_PPC64) if (!is_dcbzl && (env->excp_model == POWERPC_EXCP_970) && ((env->spr[SPR_970_HID5] >> 7) & 0x3) == 1) { dcbz_size = 32; }#endif /* XXX add e500mc support */ do_dcbz(env, addr, dcbz_s... | |
positive | envlist_create(void){envlist_t *envlist;if ((envlist = malloc(sizeof (*envlist))) == NULL)return (NULL);QLIST_INIT(&envlist->el_entries);envlist->el_count = 0;return (envlist);} | |
positive | static void gen_ori(DisasContext *ctx){ target_ulong uimm = UIMM(ctx->opcode); if (rS(ctx->opcode) == rA(ctx->opcode) && uimm == 0) { /* NOP */ /* XXX: should handle special NOPs for POWER series */ return; } tcg_gen_ori_tl(cpu_gpr[rA(ctx->opcode)], cpu_gpr[rS(ctx->opcode)], uimm);} | |
positive | static void close(AVCodecParserContext *s){ H264Context *h = s->priv_data; ParseContext *pc = &h->s.parse_context; av_free(pc->buffer);} | |
positive | static void sch_handle_start_func(SubchDev *sch, ORB *orb){ PMCW *p = &sch->curr_status.pmcw; SCSW *s = &sch->curr_status.scsw; int path; int ret; /* Path management: In our simple css, we always choose the only path. */ path = 0x80; if (!(s->ctrl & SCSW_ACTL_SUSP)) { /* Look at the orb and try to execute the channel p... | |
positive | static int net_vhost_chardev_opts(void *opaque, const char *name, const char *value, Error **errp){ VhostUserChardevProps *props = opaque; if (strcmp(name, "backend") == 0 && strcmp(value, "socket") == 0) { props->is_socket = true; } else if (strcmp(name, "path") == 0) { props->is_unix = true; } else if (strcmp(name, "... | |
positive | static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt){ const uint8_t *buf = avpkt->data; const uint8_t *buf_end = avpkt->data + avpkt->size; int buf_size = avpkt->size; DPXContext *const s = avctx->priv_data; AVFrame *picture = data; AVFrame *const p = &s->picture; uint8_t *ptr; in... | |
positive | static int mpeg_decode_mb(MpegEncContext *s, DCTELEM block[12][64]){ int i, j, k, cbp, val, mb_type, motion_type; const int mb_block_count = 4 + (1<< s->chroma_format) dprintf("decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y); assert(s->mb_skiped==0); if (s->mb_skip_run-- != 0) { if(s->pict_type == I_TYPE){ av_log(s->avctx, ... | |
positive | void op_subo (void){ target_ulong tmp; tmp = T0; T0 = (int32_t)T0 - (int32_t)T1; if (!((T0 >> 31) ^ (T1 >> 31) ^ (tmp >> 31))) { CALL_FROM_TB1(do_raise_exception_direct, EXCP_OVERFLOW); } RETURN();} | |
positive | int get_physical_address (CPUState *env, mmu_ctx_t *ctx, target_ulong eaddr, int rw, int access_type, int check_BATs){ int ret;#if 0 if (loglevel != 0) { fprintf(logfile, "%s\n", __func__); }#endif if ((access_type == ACCESS_CODE && msr_ir == 0) || (access_type != ACCESS_CODE && msr_dr == 0)) { /* No address translatio... | |
negative | uint32_t HELPER(neon_min_f32)(uint32_t a, uint32_t b){ float32 f0 = make_float32(a); float32 f1 = make_float32(b); return (float32_compare_quiet(f0, f1, NFS) == -1) ? a : b;} | |
negative | static void test_primitive_lists(gconstpointer opaque){ TestArgs *args = (TestArgs *) opaque; const SerializeOps *ops = args->ops; PrimitiveType *pt = args->test_data; PrimitiveList pl = { .value = { NULL } }; PrimitiveList pl_copy = { .value = { NULL } }; PrimitiveList *pl_copy_ptr = &pl_copy; Error *err = NULL; void ... | |
negative | static struct omap_pwl_s *omap_pwl_init(MemoryRegion *system_memory, target_phys_addr_t base, omap_clk clk){ struct omap_pwl_s *s = g_malloc0(sizeof(*s)); omap_pwl_reset(s); memory_region_init_io(&s->iomem, &omap_pwl_ops, s, "omap-pwl", 0x800); memory_region_add_subregion(system_memory, base, &s->iomem); omap_clk_addus... | |
negative | static void gem_transmit(GemState *s){ unsigned desc[2]; target_phys_addr_t packet_desc_addr; uint8_t tx_packet[2048]; uint8_t *p; unsigned total_bytes; /* Do nothing if transmit is not enabled. */ if (!(s->regs[GEM_NWCTRL] & GEM_NWCTRL_TXENA)) { return; } DB_PRINT("\n"); /* The packet we will hand off to qemu. * Packe... | |
negative | static void rx_init_frame(eTSEC *etsec, const uint8_t *buf, size_t size){ uint32_t fcb_size = 0; uint8_t prsdep = (etsec->regs[RCTRL].value >> RCTRL_PRSDEP_OFFSET) & RCTRL_PRSDEP_MASK; if (prsdep != 0) { /* Prepend FCB (FCB size + RCTRL[PAL]) */ fcb_size = 8 + ((etsec->regs[RCTRL].value >> 16) & 0x1F); etsec->rx_fcb_si... | |
negative | static uint32_t qpci_spapr_io_readl(QPCIBus *bus, void *addr){ QPCIBusSPAPR *s = container_of(bus, QPCIBusSPAPR, bus); uint64_t port = (uintptr_t)addr; uint32_t v; if (port < s->pio.size) { v = readl(s->pio_cpu_base + port); } else { v = readl(s->mmio_cpu_base + port); } return bswap32(v);} | |
negative | void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr){#if defined(TARGET_MIPS) || defined(TARGET_SH4) CPUArchState *env = cpu->env_ptr;#endif TranslationBlock *tb; uint32_t n, cflags; target_ulong pc, cs_base; uint32_t flags; tb_lock(); tb = tb_find_pc(retaddr); if (!tb) { cpu_abort(cpu, "cpu_io_recompile: could not ... | |
negative | START_TEST(unterminated_array){ QObject *obj = qobject_from_json("[32"); fail_unless(obj == NULL);} | |
negative | static void imx_fec_reset(DeviceState *d){ IMXFECState *s = IMX_FEC(d); /* Reset the FEC */ s->eir = 0; s->eimr = 0; s->rx_enabled = 0; s->ecr = 0; s->mscr = 0; s->mibc = 0xc0000000; s->rcr = 0x05ee0001; s->tcr = 0; s->tfwr = 0; s->frsr = 0x500; s->miigsk_cfgr = 0; s->miigsk_enr = 0x6; /* We also reset the PHY */ phy_r... | |
negative | struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta, BlockDriverState *bd, qemu_irq irq, qemu_irq dma[], omap_clk fclk, omap_clk iclk){ struct omap_mmc_s *s = (struct omap_mmc_s *) g_malloc0(sizeof(struct omap_mmc_s)); s->irq = irq; s->dma = dma; s->clk = fclk; s->lines = 4; s->rev = 2; omap_mmc_reset(s); ... | |
negative | int vmstate_register(int instance_id, const VMStateDescription *vmsd, void *opaque){ SaveStateEntry *se; se = qemu_malloc(sizeof(SaveStateEntry)); pstrcpy(se->idstr, sizeof(se->idstr), vmsd->name); se->version_id = vmsd->version_id; se->section_id = global_section_id++; se->save_live_state = NULL; se->save_state = NULL... | |
negative | bool qemu_clock_expired(QEMUClockType type){ return timerlist_expired( main_loop_tlg.tl[type]);} | |
negative | static int proxy_opendir(FsContext *ctx, V9fsPath *fs_path, V9fsFidOpenState *fs){ int serrno, fd; fs->dir = NULL; fd = v9fs_request(ctx->private, T_OPEN, NULL, "sd", fs_path, O_DIRECTORY); if (fd < 0) { errno = -fd; return -1; } fs->dir = fdopendir(fd); if (!fs->dir) { serrno = errno; close(fd); errno = serrno; return... | |
negative | static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req){ uint32_t rca = 0x0000; uint64_t addr = (sd->ocr & (1 << 30)) ? (uint64_t) req.arg << 9 : req.arg; /* Not interpreting this as an app command */ sd->card_status &= ~APP_CMD; if (sd_cmd_type[req.cmd] == sd_ac || sd_cmd_type[req.cmd] == sd_adtc) rca = req... | |
negative | static void amdvi_mmio_trace(hwaddr addr, unsigned size){ uint8_t index = (addr & ~0x2000) / 8; if ((addr & 0x2000)) { /* high table */ index = index >= AMDVI_MMIO_REGS_HIGH ? AMDVI_MMIO_REGS_HIGH : index; trace_amdvi_mmio_read(amdvi_mmio_high[index], addr, size, addr & ~0x07); } else { index = index >= AMDVI_MMIO_REGS... | |
negative | void virtio_cleanup(VirtIODevice *vdev){ qemu_del_vm_change_state_handler(vdev->vmstate); g_free(vdev->config); g_free(vdev->vq); g_free(vdev->vector_queues);} | |
negative | static void gen_pool32axf (CPUMIPSState *env, DisasContext *ctx, int rt, int rs){ int extension = (ctx->opcode >> 6) & 0x3f; int minor = (ctx->opcode >> 12) & 0xf; uint32_t mips32_op; switch (extension) { case TEQ: mips32_op = OPC_TEQ; goto do_trap; case TGE: mips32_op = OPC_TGE; goto do_trap; case TGEU: mips32_op = OP... | |
negative | void ff_fix_long_mvs(MpegEncContext * s, uint8_t *field_select_table, int field_select, int16_t (*mv_table)[2], int f_code, int type, int truncate){ MotionEstContext * const c= &s->me; int y, h_range, v_range; // RAL: 8 in MPEG-1, 16 in MPEG-4 int range = (((s->out_format == FMT_MPEG1) ? 8 : 16) << f_code); if(s->msmpe... | |
negative | ThreadPool *thread_pool_new(AioContext *ctx){ ThreadPool *pool = g_new(ThreadPool, 1); thread_pool_init_one(pool, ctx); return pool;} | |
negative | static int parse_bootdevices(char *devices){ /* We just do some generic consistency checks */ const char *p; int bitmap = 0; for (p = devices; *p != '\0'; p++) { /* Allowed boot devices are: * a-b: floppy disk drives * c-f: IDE disk drives * g-m: machine implementation dependant drives * n-p: network devices * It's up ... | |
negative | static void tcg_out_brcond(TCGContext *s, TCGCond cond, TCGReg arg1, TCGReg arg2, int label_index){ static const MIPSInsn b_zero[16] = { [TCG_COND_LT] = OPC_BLTZ, [TCG_COND_GT] = OPC_BGTZ, [TCG_COND_LE] = OPC_BLEZ, [TCG_COND_GE] = OPC_BGEZ, }; TCGLabel *l; MIPSInsn s_opc = OPC_SLTU; MIPSInsn b_opc; int cmp_map; switch ... | |
negative | static unsigned int dec_move_rp(DisasContext *dc){TCGv t[2];DIS(fprintf (logfile, "move $r%u, $p%u\n", dc->op1, dc->op2));cris_cc_mask(dc, 0);t[0] = tcg_temp_new(TCG_TYPE_TL);if (dc->op2 == PR_CCS) {cris_evaluate_flags(dc);t_gen_mov_TN_reg(t[0], dc->op1);if (dc->tb_flags & U_FLAG) {t[1] = tcg_temp_new(TCG_TYPE_TL);/* U... | |
negative | static uint32_t get_elf_hwcap(void){ ARMCPU *cpu = ARM_CPU(thread_cpu); uint32_t hwcaps = 0; hwcaps |= ARM_HWCAP_ARM_SWP; hwcaps |= ARM_HWCAP_ARM_HALF; hwcaps |= ARM_HWCAP_ARM_THUMB; hwcaps |= ARM_HWCAP_ARM_FAST_MULT; /* probe for the extra features */#define GET_FEATURE(feat, hwcap) \ do { if (arm_feature(&cpu->env, f... | |
negative | static void test_visitor_out_native_list_uint64(TestOutputVisitorData *data, const void *unused){ test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_U64);} | |
negative | BlockAIOCB *bdrv_aio_flush(BlockDriverState *bs, BlockCompletionFunc *cb, void *opaque){ trace_bdrv_aio_flush(bs, opaque); Coroutine *co; BlockAIOCBCoroutine *acb; acb = qemu_aio_get(&bdrv_em_co_aiocb_info, bs, cb, opaque); acb->need_bh = true; acb->req.error = -EINPROGRESS; co = qemu_coroutine_create(bdrv_aio_flush_co... | |
negative | xmit_seg(E1000State *s){ uint16_t len; unsigned int frames = s->tx.tso_frames, css, sofar; struct e1000_tx *tp = &s->tx; if (tp->props.tse && tp->props.cptse) { css = tp->props.ipcss; DBGOUT(TXSUM, "frames %d size %d ipcss %d\n", frames, tp->size, css); if (tp->props.ip) { /* IPv4 */ stw_be_p(tp->data+css+2, tp->size -... | |
negative | int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile){ int mbn, blk, num_blocks, num_coeffs, blk_size, scan_pos, run, val, pos, is_intra, mc_type, mv_x, mv_y, col_mask; uint8_t col_flags[8]; int32_t prev_dc, trvec[64]; uint32_t cbp, sym, lo, hi, quant, buf_offs, q; IVIMbInfo *mb; RVMapDesc *rvma... | |
negative | static void assigned_dev_ioport_write(void *opaque, target_phys_addr_t addr, uint64_t data, unsigned size){ assigned_dev_ioport_rw(opaque, addr, size, &data);} | |
negative | static int kvm_put_fpu(CPUState *env){ struct kvm_fpu fpu; int i; memset(&fpu, 0, sizeof fpu); fpu.fsw = env->fpus & ~(7 << 11); fpu.fsw |= (env->fpstt & 7) << 11; fpu.fcw = env->fpuc; for (i = 0; i < 8; ++i)fpu.ftwx |= (!env->fptags[i]) << i; memcpy(fpu.fpr, env->fpregs, sizeof env->fpregs); memcpy(fpu.xmm, env->xmm_r... | |
positive | target_read_memory (bfd_vma memaddr, bfd_byte *myaddr, int length, struct disassemble_info *info){ int i; for(i = 0; i < length; i++) { myaddr[i] = ldub_code(memaddr + i); } return 0;} | |
positive | static int http_connect(URLContext *h, const char *path, const char *hoststr, const char *auth, int *new_location){ HTTPContext *s = h->priv_data; int post, err, ch; char line[1024], *q; char *auth_b64; int auth_b64_len = strlen(auth)* 4 / 3 + 12; int64_t off = s->off; /* send http header */ post = h->flags & URL_WRONL... | |
positive | static void set_guest_connected(VirtIOSerialPort *port, int guest_connected){ VirtConsole *vcon = VIRTIO_CONSOLE(port); DeviceState *dev = DEVICE(port); if (vcon->chr) { qemu_chr_fe_set_open(vcon->chr, guest_connected); } if (dev->id) { qapi_event_send_vserport_change(dev->id, guest_connected, &error_abort); }} | |
positive | void error_setg_errno(Error **errp, int os_errno, const char *fmt, ...){ va_list ap; char *msg; int saved_errno = errno; if (errp == NULL) { return; } va_start(ap, fmt); error_setv(errp, ERROR_CLASS_GENERIC_ERROR, fmt, ap); va_end(ap); if (os_errno != 0) { msg = (*errp)->msg; (*errp)->msg = g_strdup_printf("%s: %s", ms... | |
positive | void bitmap_set(unsigned long *map, long start, long nr){ unsigned long *p = map + BIT_WORD(start); const long size = start + nr; int bits_to_set = BITS_PER_LONG - (start % BITS_PER_LONG); unsigned long mask_to_set = BITMAP_FIRST_WORD_MASK(start); while (nr - bits_to_set >= 0) { *p |= mask_to_set; nr -= bits_to_set; bi... | |
positive | static void vmdk_free_extents(BlockDriverState *bs){ int i; BDRVVmdkState *s = bs->opaque; for (i = 0; i < s->num_extents; i++) { g_free(s->extents[i].l1_table); g_free(s->extents[i].l2_cache); g_free(s->extents[i].l1_backup_table); } g_free(s->extents);} | |
positive | static void console_putchar(TextConsole *s, int ch){ TextCell *c; int y1, i; int x, y; switch(s->state) { case TTY_STATE_NORM: switch(ch) { case '\r': /* carriage return */ s->x = 0; break; case '\n': /* newline */ console_put_lf(s); break; case '\b': /* backspace */ if (s->x > 0) s->x--; break; case '\t': /* tabspace ... | |
positive | static void blkverify_err(BlkverifyAIOCB *acb, const char *fmt, ...){ va_list ap; va_start(ap, fmt); fprintf(stderr, "blkverify: %s sector_num=%ld nb_sectors=%d ", acb->is_write ? "write" : "read", acb->sector_num, acb->nb_sectors); vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); va_end(ap); exit(1);} | |
positive | static void format_line(void *ptr, int level, const char *fmt, va_list vl, char part[3][512], int part_size, int *print_prefix, int type[2]){ AVClass* avc = ptr ? *(AVClass **) ptr : NULL; part[0][0] = part[1][0] = part[2][0] = 0; if(type) type[0] = type[1] = AV_CLASS_CATEGORY_NA + 16; if (*print_prefix && avc) { if (a... | |
negative | find_c_packed_planar_out_funcs(SwsContext *c, yuv2planar1_fn *yuv2yuv1, yuv2planarX_fn *yuv2yuvX, yuv2packed1_fn *yuv2packed1, yuv2packed2_fn *yuv2packed2, yuv2packedX_fn *yuv2packedX){ enum PixelFormat dstFormat = c->dstFormat; if (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21) { *yuv2yuvX = yuv2nv12X_c; } el... | |
negative | static av_always_inline void h264_filter_mb_fast_internal(H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize, int pixel_shift){ int chroma = !(CONFIG_GRAY && (h->flags&CODEC_FLAG_GRAY)); int chroma444 = CHROMA444(h); int chroma422 = CHROM... | |
positive | static int h263_decode_init(AVCodecContext *avctx){ MpegEncContext *s = avctx->priv_data; int i; s->avctx = avctx; s->out_format = FMT_H263; s->width = avctx->width; s->height = avctx->height; /* select sub codec */ switch(avctx->codec->id) { case CODEC_ID_H263: s->gob_number = 0; s->first_gob_line = 0; break; case COD... | |
positive | static int spdif_write_packet(struct AVFormatContext *s, AVPacket *pkt){ IEC958Context *ctx = s->priv_data; int ret, padding; ctx->out_bytes = pkt->size; ctx->length_code = FFALIGN(pkt->size, 2) << 3; ret = ctx->header_info(s, pkt); if (ret < 0) return -1; if (!ctx->pkt_offset) return 0; padding = (ctx->pkt_offset - BU... | |
positive | static void blkverify_refresh_filename(BlockDriverState *bs, QDict *options){ BDRVBlkverifyState *s = bs->opaque; /* bs->file->bs has already been refreshed */ bdrv_refresh_filename(s->test_file->bs); if (bs->file->bs->full_open_options && s->test_file->bs->full_open_options) { QDict *opts = qdict_new(); qdict_put_str(... | |
negative | static int ffmmal_read_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame){ MMALDecodeContext *ctx = avctx->priv_data; MMAL_BUFFER_HEADER_T *buffer = NULL; MMAL_STATUS_T status = 0; int ret = 0; if (ctx->eos_received) goto done; while (1) { // To ensure decoding in lockstep with a constant delay between fed pa... | |
negative | void ff_sbrdsp_init_x86(SBRDSPContext *s){ if (HAVE_YASM) { int mm_flags = av_get_cpu_flags(); if (mm_flags & AV_CPU_FLAG_SSE) { s->sum_square = ff_sbr_sum_square_sse; s->hf_g_filt = ff_sbr_hf_g_filt_sse; } }} | |
positive | static int usb_host_handle_control(USBHostDevice *s, USBPacket *p){ struct usbdevfs_urb *urb; AsyncURB *aurb; int ret, value, index; /* * Process certain standard device requests. * These are infrequent and are processed synchronously. */ value = le16_to_cpu(s->ctrl.req.wValue); index = le16_to_cpu(s->ctrl.req.wIndex);... | |
positive | static void pc_init1(MachineState *machine){ PCMachineState *pc_machine = PC_MACHINE(machine); MemoryRegion *system_memory = get_system_memory(); MemoryRegion *system_io = get_system_io(); int i; ram_addr_t below_4g_mem_size, above_4g_mem_size; PCIBus *pci_bus; ISABus *isa_bus; PCII440FXState *i440fx_state; int piix3_d... | |
positive | static void parse_type_int64(Visitor *v, const char *name, int64_t *obj, Error **errp){ StringInputVisitor *siv = to_siv(v); if (!siv->string) { error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", "integer"); return; } parse_str(siv, errp); if (!siv->ranges) { goto error; } if (!siv->cur_range) { Range ... | |
positive | void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len){ s->chr_read(s->handler_opaque, buf, len);} | |
positive | static void virtio_set_status(struct subchannel_id schid, unsigned long dev_addr){ unsigned char status = dev_addr; if (run_ccw(schid, CCW_CMD_WRITE_STATUS, &status, sizeof(status))) { virtio_panic("Could not write status to host!\n"); }} | |
positive | uint32_t do_arm_semihosting(CPUState *env){ target_ulong args; char * s; int nr; uint32_t ret; uint32_t len;#ifdef CONFIG_USER_ONLY TaskState *ts = env->opaque;#else CPUState *ts = env;#endif nr = env->regs[0]; args = env->regs[1]; switch (nr) { case SYS_OPEN: if (!(s = lock_user_string(ARG(0)))) /* FIXME - should this... | |
positive | int inet_connect(const char *str, Error **errp){ QemuOpts *opts; int sock = -1; opts = qemu_opts_create(&dummy_opts, NULL, 0, NULL); if (inet_parse(opts, str) == 0) { sock = inet_connect_opts(opts, true, NULL, errp); } else { error_set(errp, QERR_SOCKET_CREATE_FAILED); } qemu_opts_del(opts); return sock;} | |
positive | static void do_interrupt_user(CPUX86State *env, int intno, int is_int, int error_code, target_ulong next_eip){ SegmentCache *dt; target_ulong ptr; int dpl, cpl, shift; uint32_t e2; dt = &env->idt; if (env->hflags & HF_LMA_MASK) { shift = 4; } else { shift = 3; } ptr = dt->base + (intno << shift); e2 = cpu_ldl_kernel(en... | |
positive | static int64_t load_kernel(void){ int64_t entry, kernel_high; long kernel_size, initrd_size, params_size; ram_addr_t initrd_offset; uint32_t *params_buf; int big_endian;#ifdef TARGET_WORDS_BIGENDIAN big_endian = 1;#else big_endian = 0;#endif kernel_size = load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys, N... | |
positive | static int cin_read_frame_header(CinDemuxContext *cin, AVIOContext *pb) { CinFrameHeader *hdr = &cin->frame_header; hdr->video_frame_type = avio_r8(pb); hdr->audio_frame_type = avio_r8(pb); hdr->pal_colors_count = avio_rl16(pb); hdr->video_frame_size = avio_rl32(pb); hdr->audio_frame_size = avio_rl32(pb); if (pb->eof_r... | |
positive | static void test_endianness_combine(gconstpointer data){ const TestCase *test = data; char *args; args = g_strdup_printf("-display none -M %s%s%s -device pc-testdev", test->machine, test->superio ? " -device " : "", test->superio ?: ""); qtest_start(args); isa_outl(test, 0xe0, 0x87654321); g_assert_cmphex(isa_inl(test,... | |
negative | int avpicture_deinterlace(AVPicture *dst, const AVPicture *src, enum AVPixelFormat pix_fmt, int width, int height){ int i; if (pix_fmt != AV_PIX_FMT_YUV420P && pix_fmt != AV_PIX_FMT_YUVJ420P && pix_fmt != AV_PIX_FMT_YUV422P && pix_fmt != AV_PIX_FMT_YUVJ422P && pix_fmt != AV_PIX_FMT_YUV444P && pix_fmt != AV_PIX_FMT_YUV4... | |
negative | static void chroma_mc(HEVCContext *s, int16_t *dst1, int16_t *dst2, ptrdiff_t dststride, AVFrame *ref, const Mv *mv, int x_off, int y_off, int block_w, int block_h){ HEVCLocalContext *lc = &s->HEVClc; uint8_t *src1 = ref->data[1]; uint8_t *src2 = ref->data[2]; ptrdiff_t src1stride = ref->linesize[1]; ptrdiff_t src2stri... | |
negative | static void mpegts_push_data(void *opaque, const uint8_t *buf, int buf_size, int is_start){ PESContext *pes = opaque; MpegTSContext *ts = pes->stream->priv_data; AVStream *st; const uint8_t *p; int len, code, codec_type, codec_id; if (is_start) { pes->state = MPEGTS_HEADER; pes->data_index = 0; } p = buf; while (buf_si... | |
positive | static bool gscb_needed(void *opaque){ return kvm_s390_get_gs();} | |
positive | void do_fctiw (void){ union { double d; uint64_t i; } p; /* XXX: higher bits are not supposed to be significant. * to make tests easier, return the same as a real PowerPC 750 (aka G3) */ p.i = float64_to_int32(FT0, &env->fp_status); p.i |= 0xFFF80000ULL << 32; FT0 = p.d;} | |
positive | static struct omap_mpu_timer_s *omap_mpu_timer_init(MemoryRegion *system_memory, hwaddr base, qemu_irq irq, omap_clk clk){ struct omap_mpu_timer_s *s = (struct omap_mpu_timer_s *) g_malloc0(sizeof(struct omap_mpu_timer_s)); s->irq = irq; s->clk = clk; s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, omap_timer_tick, s); s->... | |
positive | static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet){ LibOpenJPEGContext *ctx = avctx->priv_data; opj_cinfo_t *compress = ctx->compress; opj_image_t *image = ctx->image; opj_cio_t *stream = ctx->stream; int cpyresult = 0; int ret, len; AVFrame *gbrframe; switc... | |
positive | static void termsig_handler(int signum){ state = TERMINATE; qemu_notify_event();} | |
positive | static int qxl_post_load(void *opaque, int version){ PCIQXLDevice* d = opaque; uint8_t *ram_start = d->vga.vram_ptr; QXLCommandExt *cmds; int in, out, newmode; assert(d->last_release_offset < d->vga.vram_size); if (d->last_release_offset == 0) { d->last_release = NULL; } else { d->last_release = (QXLReleaseInfo *)(ram_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.