instruction stringclasses 1
value | output stringclasses 2
values | input stringlengths 21 96.3k |
|---|---|---|
positive | static int handle_utimensat(FsContext *ctx, V9fsPath *fs_path, const struct timespec *buf){ int ret;#ifdef CONFIG_UTIMENSAT int fd; struct handle_data *data = (struct handle_data *)ctx->private; fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK); if (fd < 0) { return fd; } ret = futimens(fd, buf); close(fd);... | |
positive | void object_property_add_str(Object *obj, const char *name, char *(*get)(Object *, Error **), void (*set)(Object *, const char *, Error **), Error **errp){ StringProperty *prop = g_malloc0(sizeof(*prop)); prop->get = get; prop->set = set; object_property_add(obj, name, "string", get ? property_get_str : NULL, set ? pro... | |
positive | static int disas_cp14_write(CPUState * env, DisasContext *s, uint32_t insn){ int crn = (insn >> 16) & 0xf; int crm = insn & 0xf; int op1 = (insn >> 21) & 7; int op2 = (insn >> 5) & 7; int rt = (insn >> 12) & 0xf; TCGv tmp; if (arm_feature(env, ARM_FEATURE_THUMB2EE)) { if (op1 == 6 && crn == 0 && crm == 0 && op2 == 0) {... | |
positive | static void tcp_wait_for_connect(int fd, Error *err, void *opaque){ MigrationState *s = opaque; if (fd < 0) { DPRINTF("migrate connect error: %s\n", error_get_pretty(err)); s->to_dst_file = NULL; migrate_fd_error(s); } else { DPRINTF("migrate connect success\n"); s->to_dst_file = qemu_fopen_socket(fd, "wb"); migrate_fd... | |
positive | static FlatView generate_memory_topology(MemoryRegion *mr){ FlatView view; flatview_init(&view); render_memory_region(&view, mr, 0, addrrange_make(0, UINT64_MAX)); flatview_simplify(&view); return view;} | |
positive | static void visit_type_int32(Visitor *v, int *value, const char *name, Error **errp){ int64_t val = *value; visit_type_int(v, &val, name, errp);} | |
positive | static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf, int do_search_pc, const uint8_t *searched_pc){ int opc, op_index, macro_op_index; const TCGOpDef *def; unsigned int dead_iargs; const TCGArg *args;#ifdef DEBUG_DISAS if (unlikely(loglevel & CPU_LOG_TB_OP)) { fprintf(logfile, "OP:\n"); tcg_dump_... | |
positive | static int setup_hwaccel(AVCodecContext *avctx, const enum AVPixelFormat fmt, const char *name){ AVHWAccel *hwa = find_hwaccel(avctx->codec_id, fmt); int ret = 0; if (!hwa) { "Could not find an AVHWAccel for the pixel format: %s", name); return AVERROR(ENOENT); if (hwa->capabilities & HWACCEL_CODEC_CAP_EXPERIMENTAL && ... | |
positive | static void rpza_decode_stream(RpzaContext *s){ int width = s->avctx->width; int stride = s->frame.linesize[0] / 2; int row_inc = stride - 4; int stream_ptr = 0; int chunk_size; unsigned char opcode; int n_blocks; unsigned short colorA = 0, colorB; unsigned short color4[4]; unsigned char index, idx; unsigned short ta, ... | |
positive | static int mlib_YUV2RGB420_24(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]){ if(c->srcFormat == PIX_FMT_YUV422P){srcStride[1] *= 2;srcStride[2] *= 2; } assert(srcStride[1] == srcStride[2]); mlib_VideoColorYUV2RGB420(dst[0]+srcSliceY*dstStride[0], src[0], ... | |
positive | uint64_t ldq_tce(VIOsPAPRDevice *dev, uint64_t taddr){ uint64_t val; spapr_tce_dma_read(dev, taddr, &val, sizeof(val)); return tswap64(val);} | |
positive | static int raw_reopen_prepare(BDRVReopenState *state, BlockReopenQueue *queue, Error **errp){ BDRVRawState *s; BDRVRawReopenState *raw_s; int ret = 0; Error *local_err = NULL; assert(state != NULL); assert(state->bs != NULL); s = state->bs->opaque; state->opaque = g_malloc0(sizeof(BDRVRawReopenState)); raw_s = state->o... | |
positive | int net_init_dump(QemuOpts *opts, const char *name, VLANState *vlan){ int len; const char *file; char def_file[128]; assert(vlan); file = qemu_opt_get(opts, "file"); if (!file) { snprintf(def_file, sizeof(def_file), "qemu-vlan%d.pcap", vlan->id); file = def_file; } len = qemu_opt_get_size(opts, "len", 65536); return ne... | |
positive | static int blk_free(struct XenDevice *xendev){ struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev); struct ioreq *ioreq; if (blkdev->blk || blkdev->sring) { blk_disconnect(xendev); } /* Free persistent grants */ if (blkdev->feature_persistent) { g_tree_destroy(blkdev->persistent_gnts); } while (!Q... | |
positive | static void r2d_init(ram_addr_t ram_size, int vga_ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model){ CPUState *env; struct SH7750State *s; ram_addr_t sdram_addr, sm501_vga_ram_addr; qemu_irq *irq; PCIBus *pci; int i; if (!cpu_... | |
positive | MigrationIncomingState *migration_incoming_state_new(QEMUFile* f){ mis_current = g_malloc0(sizeof(MigrationIncomingState)); mis_current->file = f; QLIST_INIT(&mis_current->loadvm_handlers); return mis_current;} | |
positive | double av_get_double(void *obj, const char *name, const AVOption **o_out){ int64_t intnum=1; double num=1; int den=1; av_get_number(obj, name, o_out, &num, &den, &intnum); return num*intnum/den;} | |
positive | static void laio_cancel(BlockDriverAIOCB *blockacb){ struct qemu_laiocb *laiocb = (struct qemu_laiocb *)blockacb; struct io_event event; int ret; if (laiocb->ret != -EINPROGRESS) return; /* * Note that as of Linux 2.6.31 neither the block device code nor any * filesystem implements cancellation of AIO request. * Thus t... | |
positive | static inline void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0, const uint16_t *ubuf0, const uint16_t *ubuf1, const uint16_t *vbuf0, const uint16_t *vbuf1, const uint16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, enum PixelFormat dstFormat, int flags, int y){ x86_reg uv_off = c->uv_off << 1; const uint1... | |
positive | static int avi_read_idx1(AVFormatContext *s, int size){ AVIContext *avi = s->priv_data; AVIOContext *pb = s->pb; int nb_index_entries, i; AVStream *st; AVIStream *ast; unsigned int index, tag, flags, pos, len, first_packet = 1; unsigned last_pos= -1; int64_t idx1_pos, first_packet_pos = 0, data_offset = 0; nb_index_ent... | |
positive | static float quantize_band_cost_bits(struct AACEncContext *s, const float *in, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, int *bits, int rtz){ return get_band_numbits(s, NULL, in, scaled, size, scale_idx, cb, lambda, uplim, bits);} | |
positive | static void coroutine_fn stream_run(void *opaque){ StreamBlockJob *s = opaque; BlockDriverState *bs = s->common.bs; BlockDriverState *base = s->base; int64_t sector_num, end; int error = 0; int ret = 0; int n = 0; void *buf; s->common.len = bdrv_getlength(bs); if (s->common.len < 0) { block_job_completed(&s->common, s-... | |
negative | PCIBus *pci_apb_init(hwaddr special_base, hwaddr mem_base, qemu_irq *ivec_irqs, PCIBus **busA, PCIBus **busB, qemu_irq **pbm_irqs){ DeviceState *dev; SysBusDevice *s; PCIHostState *phb; APBState *d; IOMMUState *is; PCIDevice *pci_dev; PCIBridge *br; /* Ultrasparc PBM main bus */ dev = qdev_create(NULL, TYPE_APB); d = A... | |
negative | void register_module_init(void (*fn)(void), module_init_type type){ ModuleEntry *e; ModuleTypeList *l; e = qemu_mallocz(sizeof(*e)); e->init = fn; l = find_type(type); TAILQ_INSERT_TAIL(l, e, node);} | |
negative | static void spitz_common_init(ram_addr_t ram_size, int vga_ram_size, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model, enum spitz_model_e model, int arm_id){ struct pxa2xx_state_s *cpu; struct scoop_info_s *scp0, *scp1 = NULL; if (!cpu_model) cpu_model = (model... | |
negative | uint32_t cpu_inl(pio_addr_t addr){ uint32_t val; val = ioport_read(2, addr); trace_cpu_in(addr, val); LOG_IOPORT("inl : %04"FMT_pioaddr" %08"PRIx32"\n", addr, val); return val;} | |
negative | static int nbd_co_request(BlockDriverState *bs, NBDRequest *request, QEMUIOVector *qiov){ NBDClientSession *client = nbd_get_client_session(bs); int ret; assert(!qiov || request->type == NBD_CMD_WRITE || request->type == NBD_CMD_READ); ret = nbd_co_send_request(bs, request, request->type == NBD_CMD_WRITE ? qiov : NULL)... | |
negative | static int posix_aio_process_queue(void *opaque){ PosixAioState *s = opaque; struct qemu_paiocb *acb, **pacb; int ret; int result = 0; int async_context_id = get_async_context_id(); for(;;) { pacb = &s->first_aio; for(;;) { acb = *pacb; if (!acb) return result; /* we're only interested in requests in the right context ... | |
negative | static uint32_t isa_mmio_readb (void *opaque, target_phys_addr_t addr){ return cpu_inb(addr & IOPORTS_MASK);} | |
negative | static int vpc_create(const char *filename, int64_t total_sectors, const char *backing_file, int flags){ uint8_t buf[1024]; struct vhd_footer* footer = (struct vhd_footer*) buf; struct vhd_dyndisk_header* dyndisk_header = (struct vhd_dyndisk_header*) buf; int fd, i; uint16_t cyls; uint8_t heads; uint8_t secs_per_cyl; s... | |
negative | static int usb_msd_initfn(USBDevice *dev){ MSDState *s = DO_UPCAST(MSDState, dev, dev); BlockDriverState *bs = s->conf.bs; DriveInfo *dinfo; if (!bs) { error_report("usb-msd: drive property not set"); return -1; } /* * Hack alert: this pretends to be a block device, but it's really * a SCSI bus that can serve only a si... | |
negative | static int encode_superframe(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ WMACodecContext *s = avctx->priv_data; const short *samples = data; int i, total_gain; s->block_len_bits= s->frame_len_bits; //required by non variable block len s->block_len = 1 << s->block_len_bits; apply_window_and_mdc... | |
negative | static void tgen_movcond(TCGContext *s, TCGType type, TCGCond c, TCGReg dest, TCGReg c1, TCGArg c2, int c2const, TCGReg r3){ int cc; if (facilities & FACILITY_LOAD_ON_COND) { cc = tgen_cmp(s, type, c, c1, c2, c2const, false); tcg_out_insn(s, RRF, LOCGR, dest, r3, cc); } else { c = tcg_invert_cond(c); cc = tgen_cmp(s, t... | |
negative | static void parse_numa_node(MachineState *ms, NumaNodeOptions *node, QemuOpts *opts, Error **errp){ uint16_t nodenr; uint16List *cpus = NULL; MachineClass *mc = MACHINE_GET_CLASS(ms); if (node->has_nodeid) { nodenr = node->nodeid; } else { nodenr = nb_numa_nodes; } if (nodenr >= MAX_NODES) { error_setg(errp, "Max numbe... | |
negative | static int calculate_geometry(int64_t total_sectors, uint16_t* cyls, uint8_t* heads, uint8_t* secs_per_cyl){ uint32_t cyls_times_heads; if (total_sectors > 65535 * 16 * 255) return -EFBIG; if (total_sectors > 65535 * 16 * 63) { *secs_per_cyl = 255; *heads = 16; cyls_times_heads = total_sectors / *secs_per_cyl; } else {... | |
negative | static uint32_t do_csst(CPUS390XState *env, uint32_t r3, uint64_t a1, uint64_t a2, bool parallel){#if !defined(CONFIG_USER_ONLY) || defined(CONFIG_ATOMIC128) uint32_t mem_idx = cpu_mmu_index(env, false);#endif uintptr_t ra = GETPC(); uint32_t fc = extract32(env->regs[0], 0, 8); uint32_t sc = extract32(env->regs[0], 8, ... | |
negative | static void test_visitor_out_native_list_int32(TestOutputVisitorData *data, const void *unused){ test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_S32);} | |
negative | static void blockdev_mirror_common(BlockDriverState *bs, BlockDriverState *target, bool has_replaces, const char *replaces, enum MirrorSyncMode sync, bool has_speed, int64_t speed, bool has_granularity, uint32_t granularity, bool has_buf_size, int64_t buf_size, bool has_on_source_error, BlockdevOnError on_source_error,... | |
negative | void helper_mtc0_index(CPUMIPSState *env, target_ulong arg1){ int num = 1; unsigned int tmp = env->tlb->nb_tlb; do { tmp >>= 1; num <<= 1; } while (tmp); env->CP0_Index = (env->CP0_Index & 0x80000000) | (arg1 & (num - 1));} | |
negative | static ram_addr_t kqemu_ram_alloc(ram_addr_t size){ ram_addr_t addr; if ((last_ram_offset + size) > kqemu_phys_ram_size) { fprintf(stderr, "Not enough memory (requested_size = %" PRIu64 ", max memory = %" PRIu64 ")\n", (uint64_t)size, (uint64_t)kqemu_phys_ram_size); abort(); } addr = last_ram_offset; last_ram_offset = ... | |
negative | void do_cpu_init(X86CPU *cpu){ CPUX86State *env = &cpu->env; int sipi = env->interrupt_request & CPU_INTERRUPT_SIPI; uint64_t pat = env->pat; cpu_reset(CPU(cpu)); env->interrupt_request = sipi; env->pat = pat; apic_init_reset(env->apic_state); env->halted = !cpu_is_bsp(env);} | |
negative | static inline int show_tags(WriterContext *wctx, AVDictionary *tags, int section_id){ AVDictionaryEntry *tag = NULL; int ret = 0; if (!tags) return 0; writer_print_section_header(wctx, section_id); while ((tag = av_dict_get(tags, "", tag, AV_DICT_IGNORE_SUFFIX))) { ret = writer_print_string(wctx, tag->key, tag->value, ... | |
negative | static void gen_dozi(DisasContext *ctx){ target_long simm = SIMM(ctx->opcode); int l1 = gen_new_label(); int l2 = gen_new_label(); tcg_gen_brcondi_tl(TCG_COND_LT, cpu_gpr[rA(ctx->opcode)], simm, l1); tcg_gen_subfi_tl(cpu_gpr[rD(ctx->opcode)], simm, cpu_gpr[rA(ctx->opcode)]); tcg_gen_br(l2); gen_set_label(l1); tcg_gen_m... | |
negative | static inline void t_gen_swapb(TCGv d, TCGv s){TCGv t, org_s;t = tcg_temp_new(TCG_TYPE_TL);org_s = tcg_temp_new(TCG_TYPE_TL);/* d and s may refer to the same object. */tcg_gen_mov_tl(org_s, s);tcg_gen_shli_tl(t, org_s, 8);tcg_gen_andi_tl(d, t, 0xff00ff00);tcg_gen_shri_tl(t, org_s, 8);tcg_gen_andi_tl(t, t, 0x00ff00ff);t... | |
positive | static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){ if(get_rac(c, state+0)) return 0; else{ int i, e, a; e= 0; while(get_rac(c, state+1 + e)){ //1..10 e++; } assert(e<=9); a= 1; for(i=e-1; i>=0; i--){ a += a + get_rac(c, state+22 + i); //22..31 } if(is_signed && get_rac(c, state+11 + e)) //11..2... | |
positive | static int asink_query_formats(AVFilterContext *ctx){ BufferSinkContext *buf = ctx->priv; AVFilterFormats *formats = NULL; AVFilterChannelLayouts *layouts = NULL; unsigned i; int ret; CHECK_LIST_SIZE(sample_fmts) CHECK_LIST_SIZE(sample_rates) CHECK_LIST_SIZE(channel_layouts) CHECK_LIST_SIZE(channel_counts) if (buf->sam... | |
positive | static int mxf_read_source_package(void *arg, AVIOContext *pb, int tag, int size, UID uid){ MXFPackage *package = arg; switch(tag) { case 0x4403: package->tracks_count = avio_rb32(pb); if (package->tracks_count >= UINT_MAX / sizeof(UID)) return -1; package->tracks_refs = av_malloc(package->tracks_count * sizeof(UID)); ... | |
positive | int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size){ int ret = 0; uint8_t *p = *buf; int64_t len = 0; while (bytestream2_get_bytes_left(gb) > 2) { uint8_t s = bytestream2_get_byte(gb); if (s < LZF_LITERAL_MAX) { s++; if (s > *size - len) { *size += *size /2; ret = av_reallocp(buf, *size); if (ret < ... | |
positive | static int inject_fake_duration_metadata(RTMPContext *rt){ // We need to insert the metdata packet directly after the FLV // header, i.e. we need to move all other already read data by the // size of our fake metadata packet. uint8_t* p; // Keep old flv_data pointer uint8_t* old_flv_data = rt->flv_data; // Allocate a n... | |
positive | static int dmg_open(BlockDriverState *bs, int flags){ BDRVDMGState *s = bs->opaque; off_t info_begin,info_end,last_in_offset,last_out_offset; uint32_t count; uint32_t max_compressed_size=1,max_sectors_per_chunk=1,i; int64_t offset; bs->read_only = 1; s->n_chunks = 0; s->offsets = s->lengths = s->sectors = s->sectorcoun... | |
negative | static void idct32(int *out, int *tab){ int i, j; int *t, *t1, xr; const int *xp = costab32; for(j=31;j>=3;j-=2) tab[j] += tab[j - 2]; t = tab + 30; t1 = tab + 2; do { t[0] += t[-4]; t[1] += t[1 - 4]; t -= 4; } while (t != t1); t = tab + 28; t1 = tab + 4; do { t[0] += t[-8]; t[1] += t[1-8]; t[2] += t[2-8]; t[3] += t[3-... | |
negative | static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size, const uint8_t *buf, int buf_size){ AC3DecodeContext *s = avctx->priv_data; int16_t *out_samples = (int16_t *)data; int i, blk, ch, err; /* initialize the GetBitContext with the start of valid AC-3 Frame */ if (s->input_buffer) { /* copy inp... | |
positive | static void multi_serial_pci_realize(PCIDevice *dev, Error **errp){ PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev); PCIMultiSerialState *pci = DO_UPCAST(PCIMultiSerialState, dev, dev); SerialState *s; Error *err = NULL; int i; switch (pc->device_id) { case 0x0003: pci->ports = 2; break; case 0x0004: pci->ports = 4; bre... | |
positive | int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length){ MpegEncContext * const s = &h->s; unsigned int pps_id= get_ue_golomb(&s->gb); PPS *pps; const int qp_bd_offset = 6*(h->sps.bit_depth_luma-8); int bits_left; if(pps_id >= MAX_PPS_COUNT) { av_log(h->s.avctx, AV_LOG_ERROR, "pps_id (%d) out of range\... | |
positive | int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr, hwaddr rtas_size){ int ret; int i; ret = fdt_add_mem_rsv(fdt, rtas_addr, rtas_size); if (ret < 0) { fprintf(stderr, "Couldn't add RTAS reserve entry: %s\n", fdt_strerror(ret)); return ret; } ret = qemu_fdt_setprop_cell(fdt, "/rtas", "linux,rtas-base", rtas_a... | |
positive | static int get_phys_addr_mpu(CPUARMState *env, uint32_t address, int access_type, int is_user, hwaddr *phys_ptr, int *prot){ int n; uint32_t mask; uint32_t base; *phys_ptr = address; for (n = 7; n >= 0; n--) {base = env->cp15.c6_region[n];if ((base & 1) == 0) continue;mask = 1 << ((base >> 1) & 0x1f);/* Keep this shift... | |
positive | static int huff_build(VLC *vlc, uint8_t *len){ HuffEntry he[256]; uint32_t codes[256]; uint8_t bits[256]; uint8_t syms[256]; uint32_t code; int i; for (i = 0; i < 256; i++) { he[i].sym = 255 - i; he[i].len = len[i]; if (len[i] == 0) return AVERROR_INVALIDDATA; } AV_QSORT(he, 256, HuffEntry, huff_cmp_len); code = 1; for... | |
positive | static int get_cox(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c){ uint8_t byte; if (s->buf_end - s->buf < 5) return AVERROR(EINVAL); /* nreslevels = number of resolution levels = number of decomposition level +1 */ c->nreslevels = bytestream_get_byte(&s->buf) + 1; if (c->nreslevels > JPEG2000_MAX_RESLEVELS) return... | |
positive | void qemu_clock_warp(QEMUClockType type){ int64_t deadline; /* * There are too many global variables to make the "warp" behavior * applicable to other clocks. But a clock argument removes the * need for if statements all over the place. */ if (type != QEMU_CLOCK_VIRTUAL || !use_icount) { return; } /* * If the CPUs have... | |
negative | void qpci_plug_device_test(const char *driver, const char *id, uint8_t slot, const char *opts){ QDict *response; char *cmd; cmd = g_strdup_printf("{'execute': 'device_add'," " 'arguments': {" " 'driver': '%s'," " 'addr': '%d'," " %s%s" " 'id': '%s'" "}}", driver, slot, opts ? opts : "", opts ? "," : "", id); response =... | |
negative | void tlb_fill(CPUState *cs, target_ulong addr, int is_write, int mmu_idx, uintptr_t retaddr){ bool ret; uint32_t fsr = 0; ARMMMUFaultInfo fi = {}; ret = arm_tlb_fill(cs, addr, is_write, mmu_idx, &fsr, &fi); if (unlikely(ret)) { ARMCPU *cpu = ARM_CPU(cs); CPUARMState *env = &cpu->env; uint32_t syn, exc; unsigned int tar... | |
negative | static int local_fstat(FsContext *fs_ctx, int fd, struct stat *stbuf){ int err; err = fstat(fd, stbuf); if (err) { return err; } if (fs_ctx->fs_sm == SM_MAPPED) { /* Actual credentials are part of extended attrs */ uid_t tmp_uid; gid_t tmp_gid; mode_t tmp_mode; dev_t tmp_dev; if (fgetxattr(fd, "user.virtfs.uid", &tmp_u... | |
negative | static void test_visitor_in_native_list_int8(TestInputVisitorData *data, const void *unused){ test_native_list_integer_helper(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_S8);} | |
negative | static void xen_platform_ioport_writeb(void *opaque, hwaddr addr, uint64_t val, unsigned int size){ PCIXenPlatformState *s = opaque; PCIDevice *pci_dev = PCI_DEVICE(s); switch (addr) { case 0: /* Platform flags */ platform_fixed_ioport_writeb(opaque, 0, (uint32_t)val); break; case 4: if (val == 1) { /* * SUSE unplug fo... | |
negative | void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f){ PerThreadContext *p = avctx->internal->thread_ctx; FrameThreadContext *fctx; AVFrame *dst, *tmp;FF_DISABLE_DEPRECATION_WARNINGS int can_direct_free = !(avctx->active_thread_type & FF_THREAD_FRAME) || avctx->thread_safe_callbacks || (#if FF_API_GET_BU... | |
negative | static int count_contiguous_clusters_by_type(int nb_clusters, uint64_t *l2_table, int wanted_type){ int i; for (i = 0; i < nb_clusters; i++) { int type = qcow2_get_cluster_type(be64_to_cpu(l2_table[i])); if (type != wanted_type) { break; } } return i;} | |
negative | static void scsi_disk_emulate_mode_select(SCSIDiskReq *r, uint8_t *inbuf){ SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); uint8_t *p = inbuf; int cmd = r->req.cmd.buf[0]; int len = r->req.cmd.xfer; int hdr_len = (cmd == MODE_SELECT ? 4 : 8); int bd_len; int pass; /* We only support PF=1, SP=0. */ if ((r... | |
negative | int32 float32_to_int32_round_to_zero( float32 a STATUS_PARAM ){ flag aSign; int16 aExp, shiftCount; bits32 aSig; int32 z; aSig = extractFloat32Frac( a ); aExp = extractFloat32Exp( a ); aSign = extractFloat32Sign( a ); shiftCount = aExp - 0x9E; if ( 0 <= shiftCount ) { if ( a != 0xCF000000 ) { float_raise( float_flag_in... | |
negative | QEMUFile *qemu_popen_cmd(const char *command, const char *mode){ FILE *stdio_file; QEMUFileStdio *s; stdio_file = popen(command, mode); if (stdio_file == NULL) { return NULL; } if (mode == NULL || (mode[0] != 'r' && mode[0] != 'w') || mode[1] != 0) { fprintf(stderr, "qemu_popen: Argument validity check failed\n"); retu... | |
negative | static int openpic_load(QEMUFile* f, void *opaque, int version_id){ OpenPICState *opp = (OpenPICState *)opaque; unsigned int i; if (version_id != 1) return -EINVAL; qemu_get_be32s(f, &opp->glbc); qemu_get_be32s(f, &opp->veni); qemu_get_be32s(f, &opp->pint); qemu_get_be32s(f, &opp->spve); qemu_get_be32s(f, &opp->tifr); ... | |
negative | uint64_t HELPER(abs_i64)(int64_t val){ HELPER_LOG("%s: val 0x%" PRIx64 "\n", __func__, val); if (val < 0) { return -val; } else { return val; }} | |
negative | void blk_resume_after_migration(Error **errp){ BlockBackend *blk; Error *local_err = NULL; for (blk = blk_all_next(NULL); blk; blk = blk_all_next(blk)) { if (!blk->disable_perm) { continue; } blk->disable_perm = false; blk_set_perm(blk, blk->perm, blk->shared_perm, &local_err); if (local_err) { error_propagate(errp, lo... | |
negative | static int vfio_pci_hot_reset(VFIOPCIDevice *vdev, bool single){ VFIOGroup *group; struct vfio_pci_hot_reset_info *info; struct vfio_pci_dependent_device *devices; struct vfio_pci_hot_reset *reset; int32_t *fds; int ret, i, count; bool multi = false; trace_vfio_pci_hot_reset(vdev->vbasedev.name, single ? "one" : "multi... | |
negative | pvscsi_ring_pop_req_descr(PVSCSIRingInfo *mgr){ uint32_t ready_ptr = RS_GET_FIELD(mgr, reqProdIdx); if (ready_ptr != mgr->consumed_ptr) { uint32_t next_ready_ptr = mgr->consumed_ptr++ & mgr->txr_len_mask; uint32_t next_ready_page = next_ready_ptr / PVSCSI_MAX_NUM_REQ_ENTRIES_PER_PAGE; uint32_t inpage_idx = next_ready_p... | |
negative | int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint32_t *flags, QCryptoTLSCreds *tlscreds, const char *hostname, QIOChannel **outioc, off_t *size, Error **errp){ char buf[256]; uint64_t magic, s; int rc; TRACE("Receiving negotiation tlscreds=%p hostname=%s.", tlscreds, hostname ? hostname : "<null>"); rc ... | |
negative | SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun, uint8_t *buf, void *hba_private){ SCSIRequest *req; req = d->info->alloc_req(d, tag, lun, hba_private); memcpy(req->cmd.buf, buf, 16); return req;} | |
negative | int qemu_read_password(char *buf, int buf_size){ uint8_t ch; int i, ret; printf("password: "); fflush(stdout); term_init(); i = 0; for (;;) { ret = read(0, &ch, 1); if (ret == -1) { if (errno == EAGAIN || errno == EINTR) { continue; } else { break; } } else if (ret == 0) { ret = -1; break; } else { if (ch == '\r') { re... | |
negative | static void qemu_account_warp_timer(void){ if (!use_icount || !icount_sleep) { return; } /* Nothing to do if the VM is stopped: QEMU_CLOCK_VIRTUAL timers * do not fire, so computing the deadline does not make sense. */ if (!runstate_is_running()) { return; } /* warp clock deterministically in record/replay mode */ if (... | |
negative | int host_to_target_signal(int sig){ if (sig >= _NSIG) return sig; return host_to_target_signal_table[sig];} | |
negative | void process_pending_signals(CPUArchState *cpu_env){ CPUState *cpu = ENV_GET_CPU(cpu_env); int sig; abi_ulong handler; sigset_t set, old_set; target_sigset_t target_old_set; struct emulated_sigtable *k; struct target_sigaction *sa; struct sigqueue *q; TaskState *ts = cpu->opaque; if (!ts->signal_pending) return; /* FIX... | |
negative | static void handle_stream_probing(AVStream *st){ if (st->codec->codec_id == AV_CODEC_ID_PCM_S16LE) { st->request_probe = AVPROBE_SCORE_EXTENSION; st->probe_packets = FFMIN(st->probe_packets, 14); }} | |
negative | int avcodec_close(AVCodecContext *avctx){ /* If there is a user-supplied mutex locking routine, call it. */ if (ff_lockmgr_cb) { if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN)) return -1; } entangled_thread_counter++; if(entangled_thread_counter != 1){ av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around... | |
negative | static int a52_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size){ AC3DecodeState *s = avctx->priv_data; uint8_t *buf_ptr; int flags, i, len; int sample_rate, bit_rate; short *out_samples = data; float level; static const int ac3_channels[8] = { 2, 1, 2, 3, 3, 4, 4, 5 }; *data_s... | |
negative | static int get_packetheader(NUTContext *nut, ByteIOContext *bc, int calculate_checksum){ int64_t start, size; start= url_ftell(bc) - 8; init_checksum(bc, calculate_checksum ? update_adler32 : NULL, 0); size= get_v(bc); nut->packet_start[2] = start; nut->written_packet_size= size; return size;} | |
negative | static void rtsp_close_streams(RTSPState *rt){ int i; RTSPStream *rtsp_st; for(i=0;i<rt->nb_rtsp_streams;i++) { rtsp_st = rt->rtsp_streams[i]; if (rtsp_st) { if (rtsp_st->transport_priv) { if (rt->transport == RTSP_TRANSPORT_RDT) ff_rdt_parse_close(rtsp_st->transport_priv); else rtp_parse_close(rtsp_st->transport_priv)... | |
negative | static uint32_t drc_isolate_logical(sPAPRDRConnector *drc){ /* if the guest is configuring a device attached to this DRC, we * should reset the configuration state at this point since it may * no longer be reliable (guest released device and needs to start * over, or unplug occurred so the FDT is no longer valid) */ g_... | |
negative | static void compat_free_buffer(void *opaque, uint8_t *data){ CompatReleaseBufPriv *priv = opaque; priv->avctx.release_buffer(&priv->avctx, &priv->frame); av_freep(&priv);} | |
negative | static int aio_write_f(BlockBackend *blk, int argc, char **argv){ int nr_iov, c; int pattern = 0xcd; struct aio_ctx *ctx = g_new0(struct aio_ctx, 1); int flags = 0; ctx->blk = blk; while ((c = getopt(argc, argv, "CfqP:uz")) != -1) { switch (c) { case 'C': ctx->Cflag = true; break; case 'f': flags |= BDRV_REQ_FUA; break... | |
negative | void *g_malloc_n(size_t nmemb, size_t size){ size_t sz; void *ptr; __coverity_negative_sink__(nmemb); __coverity_negative_sink__(size); sz = nmemb * size; ptr = __coverity_alloc__(size); __coverity_mark_as_uninitialized_buffer__(ptr); __coverity_mark_as_afm_allocated__(ptr, AFM_free); return ptr;} | |
negative | int i2c_recv(I2CBus *bus){ I2CSlaveClass *sc; if ((QLIST_EMPTY(&bus->current_devs)) || (bus->broadcast)) { return -1; } sc = I2C_SLAVE_GET_CLASS(QLIST_FIRST(&bus->current_devs)->elt); if (sc->recv) { return sc->recv(QLIST_FIRST(&bus->current_devs)->elt); } return -1;} | |
negative | static int spapr_vga_init(PCIBus *pci_bus){ switch (vga_interface_type) { case VGA_STD: pci_std_vga_init(pci_bus); return 1; case VGA_NONE: return 0; default: fprintf(stderr, "This vga model is not supported," "currently it only supports -vga std\n"); exit(0); break; }} | |
negative | void async_context_pop(void){} | |
negative | static void thread_pool_init_one(ThreadPool *pool, AioContext *ctx){ if (!ctx) { ctx = qemu_get_aio_context(); } memset(pool, 0, sizeof(*pool)); event_notifier_init(&pool->notifier, false); pool->ctx = ctx; qemu_mutex_init(&pool->lock); qemu_cond_init(&pool->check_cancel); qemu_cond_init(&pool->worker_stopped); qemu_se... | |
negative | static always_inline void gen_cmov (TCGCond inv_cond, int ra, int rb, int rc, int islit, uint8_t lit, int mask){ int l1; if (unlikely(rc == 31)) return; l1 = gen_new_label(); if (ra != 31) { if (mask) { TCGv tmp = tcg_temp_new(TCG_TYPE_I64); tcg_gen_andi_i64(tmp, cpu_ir[ra], 1); tcg_gen_brcondi_i64(inv_cond, tmp, 0, l1... | |
negative | static int process_tns_coeffs(TemporalNoiseShaping *tns, float *tns_coefs_raw, int order, int w, int filt){ int i, j; int *idx = tns->coef_idx[w][filt]; float *lpc = tns->coef[w][filt]; const int iqfac_p = ((1 << (MAX_LPC_PRECISION-1)) - 0.5)/(M_PI/2.0); const int iqfac_m = ((1 << (MAX_LPC_PRECISION-1)) + 0.5)/(M_PI/2.... | |
negative | static inline void downmix_3f_to_stereo(float *samples){ int i; for (i = 0; i < 256; i++) { samples[i] += samples[i + 256]; samples[i + 256] = samples[i + 512]; samples[i + 512] = 0; }} | |
negative | static int vfio_set_resample_eventfd(VFIOINTp *intp){ VFIODevice *vbasedev = &intp->vdev->vbasedev; struct vfio_irq_set *irq_set; int argsz, ret; int32_t *pfd; argsz = sizeof(*irq_set) + sizeof(*pfd); irq_set = g_malloc0(argsz); irq_set->argsz = argsz; irq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD | VFIO_IRQ_SET_ACTION_UN... | |
negative | static void test_io_channel_unix_fd_pass(void){ SocketAddress *listen_addr = g_new0(SocketAddress, 1); SocketAddress *connect_addr = g_new0(SocketAddress, 1); QIOChannel *src, *dst; int testfd; int fdsend[3]; int *fdrecv = NULL; size_t nfdrecv = 0; size_t i; char bufsend[12], bufrecv[12]; struct iovec iosend[1], iorecv... | |
negative | static int raw_open_common(BlockDriverState *bs, const char *filename, int bdrv_flags, int open_flags){ BDRVRawState *s = bs->opaque; int fd, ret; ret = raw_normalize_devicepath(&filename); if (ret != 0) { return ret; } s->open_flags = open_flags | O_BINARY; s->open_flags &= ~O_ACCMODE; if (bdrv_flags & BDRV_O_RDWR) { ... | |
negative | static int proxy_close(FsContext *ctx, V9fsFidOpenState *fs){ return close(fs->fd);} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.