project
stringclasses
2 values
commit_id
stringlengths
40
40
target
int64
0
1
func
stringlengths
26
142k
idx
int64
0
27.3k
FFmpeg
eae2d89bf715bc3edff478174b43e1f388e768bf
0
static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url, AVDictionary *opts, AVDictionary *opts2) { HLSContext *c = s->priv_data; AVDictionary *tmp = NULL; const char *proto_name = avio_find_protocol_name(url); int ret; av_dict_copy(&tmp, opts, 0); ...
1,835
FFmpeg
4c7b023d56e09a78a587d036db1b64bf7c493b3d
0
static int nvdec_mpeg12_end_frame(AVCodecContext *avctx) { NVDECContext *ctx = avctx->internal->hwaccel_priv_data; int ret = ff_nvdec_end_frame(avctx); ctx->bitstream = NULL; return ret; }
1,837
qemu
b0fd8d18683f0d77a8e6b482771ebea82234d727
0
static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, target_sigset_t *set, CPUX86State *env) { abi_ulong frame_addr, addr; struct rt_sigframe *frame; int i, err = 0; frame_addr = get_sigframe(ka, env, sizeof(*frame)); if (!lock...
1,838
qemu
fd56e0612b6454a282fa6a953fdb09281a98c589
0
static void pci_qdev_realize(DeviceState *qdev, Error **errp) { PCIDevice *pci_dev = (PCIDevice *)qdev; PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(pci_dev); Error *local_err = NULL; PCIBus *bus; bool is_default_rom; /* initialize cap_present for pci_is_express() and pci_config_size() */ ...
1,839
qemu
1bfe5f0586083747f1602931713111673849cd9d
0
int check_migratable(Object *obj, Error **err) { return 0; }
1,840
FFmpeg
d6604b29ef544793479d7fb4e05ef6622bb3e534
0
static av_cold int vp8_free(AVCodecContext *avctx) { VP8Context *ctx = avctx->priv_data; vpx_codec_destroy(&ctx->encoder); av_freep(&ctx->twopass_stats.buf); av_freep(&avctx->coded_frame); av_freep(&avctx->stats_out); free_frame_list(ctx->coded_frame_list); return 0; }
1,841
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
0
static void exynos4210_fimd_write(void *opaque, target_phys_addr_t offset, uint64_t val, unsigned size) { Exynos4210fimdState *s = (Exynos4210fimdState *)opaque; unsigned w, i; uint32_t old_value; DPRINT_L2("write offset 0x%08x, value=%llu(0x%08llx)\n", offset, ...
1,842
qemu
a980a065fb5e86d6dec337e6cb6ff432f1a143c9
0
static int usb_wacom_initfn(USBDevice *dev) { USBWacomState *s = DO_UPCAST(USBWacomState, dev, dev); s->dev.speed = USB_SPEED_FULL; s->changed = 1; return 0; }
1,843
qemu
f8c35c1d59c9fecf79f6d5a02cd09f472a6f411d
0
void bdrv_register(BlockDriver *bdrv) { /* Block drivers without coroutine functions need emulation */ if (!bdrv->bdrv_co_readv) { bdrv->bdrv_co_readv = bdrv_co_readv_em; bdrv->bdrv_co_writev = bdrv_co_writev_em; if (!bdrv->bdrv_aio_readv) { /* add AIO emulation laye...
1,844
qemu
dfd100f242370886bb6732f70f1f7cbd8eb9fedc
0
void socket_listen_cleanup(int fd, Error **errp) { SocketAddress *addr; addr = socket_local_address(fd, errp); if (addr->type == SOCKET_ADDRESS_KIND_UNIX && addr->u.q_unix.data->path) { if (unlink(addr->u.q_unix.data->path) < 0 && errno != ENOENT) { error_setg_errno(er...
1,845
qemu
b6fcf32d9b851a83dedcb609091236b97cc4a985
0
static void test_nested_struct(gconstpointer opaque) { TestArgs *args = (TestArgs *) opaque; const SerializeOps *ops = args->ops; UserDefNested *udnp = nested_struct_create(); UserDefNested *udnp_copy = NULL; Error *err = NULL; void *serialize_data; ops->serialize(udnp, &serial...
1,846
qemu
a980a065fb5e86d6dec337e6cb6ff432f1a143c9
0
static int usb_net_initfn(USBDevice *dev) { USBNetState *s = DO_UPCAST(USBNetState, dev, dev); s->dev.speed = USB_SPEED_FULL; s->rndis = 1; s->rndis_state = RNDIS_UNINITIALIZED; QTAILQ_INIT(&s->rndis_resp); s->medium = 0; /* NDIS_MEDIUM_802_3 */ s->speed = 1000000; /* 100MBps,...
1,847
qemu
4083733db5e4120939acee57019ff52db1f45b9d
0
static void curses_setup(void) { int i, colour_default[8] = { COLOR_BLACK, COLOR_BLUE, COLOR_GREEN, COLOR_CYAN, COLOR_RED, COLOR_MAGENTA, COLOR_YELLOW, COLOR_WHITE, }; /* input as raw as possible, let everything be interpreted * by the guest system */ initscr(); noecho(); ...
1,848
qemu
245f7b51c0ea04fb2224b1127430a096c91aee70
0
static bool send_gradient_rect(VncState *vs, int w, int h) { int stream = 3; int level = tight_conf[vs->tight_compression].gradient_zlib_level; size_t bytes; if (vs->clientds.pf.bytes_per_pixel == 1) return send_full_color_rect(vs, w, h); vnc_write_u8(vs, (stream | VNC_TIGHT_EXPLI...
1,849
qemu
61007b316cd71ee7333ff7a0a749a8949527575f
0
int bdrv_get_flags(BlockDriverState *bs) { return bs->open_flags; }
1,850
FFmpeg
000836c2a98e1c6a2867dd9db0371c137609acf0
0
static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) { AVFilterContext *ctx = inlink->dst; ASNSContext *asns = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; int ret; int nb_samples = insamples->nb_samples; if (av_audio_fifo_space(asns->fifo) < nb_samples) { a...
1,852
qemu
f8b0aa25599782eef91edc00ebf620bd14db720c
0
long do_rt_sigreturn(CPUState *env) { struct rt_sigframe *frame; sigset_t host_set; /* * Since we stacked the signal on a 64-bit boundary, * then 'sp' should be word aligned here. If it's * not, then the user is trying to mess with us. */ if (env->regs[13] & 7) goto badframe; frame...
1,853
qemu
46c5874e9cd752ed8ded31af03472edd8fc3efc1
0
static PCIDevice *find_dev(sPAPREnvironment *spapr, uint64_t buid, uint32_t config_addr) { sPAPRPHBState *sphb = find_phb(spapr, buid); PCIHostState *phb = PCI_HOST_BRIDGE(sphb); int bus_num = (config_addr >> 16) & 0xFF; int devfn = (config_addr >> 8) & 0xFF; if (...
1,854
qemu
9ed2690354e65a87b830f197cac0138e842f989e
0
void *pci_assign_dev_load_option_rom(PCIDevice *dev, struct Object *owner, int *size, unsigned int domain, unsigned int bus, unsigned int slot, unsigned int function) { char name[32], rom_file[64]; ...
1,855
qemu
72cf2d4f0e181d0d3a3122e04129c58a95da713e
0
void cpu_unregister_map_client(void *_client) { MapClient *client = (MapClient *)_client; LIST_REMOVE(client, link); qemu_free(client); }
1,857
qemu
cd42d5b23691ad73edfd6dbcfc935a960a9c5a65
0
static inline void gen_intermediate_code_internal(PowerPCCPU *cpu, TranslationBlock *tb, bool search_pc) { CPUState *cs = CPU(cpu); CPUPPCState *env = &cpu->env; DisasContext ctx, *ctxp = &ctx; opc...
1,858
qemu
c3adb5b9168a57790b5074489b6f0275ac3cc8b5
1
static void dma_aio_cancel(BlockDriverAIOCB *acb) { DMAAIOCB *dbs = container_of(acb, DMAAIOCB, common); if (dbs->acb) { bdrv_aio_cancel(dbs->acb); } }
1,859
qemu
45bbbb466cf4a6280076ea5a51f67ef5bedee345
1
int32_t idiv32(int32_t *q_ptr, int64_t num, int32_t den) { *q_ptr = num / den; return num % den; }
1,860
qemu
5839e53bbc0fec56021d758aab7610df421ed8c8
1
void qmp_nbd_server_add(const char *device, bool has_writable, bool writable, Error **errp) { BlockDriverState *bs; NBDExport *exp; NBDCloseNotifier *n; if (server_fd == -1) { error_setg(errp, "NBD server not running"); return; } if (nbd_expo...
1,861
FFmpeg
e0704840404381c7b976a35db4004deca4495a22
1
static void xbr3x(AVFrame *input, AVFrame *output, const uint32_t *r2y) { const int nl = output->linesize[0]>>2; const int nl1 = nl + nl; uint32_t pprev; uint32_t pprev2; int x,y; for (y = 0; y < input->height; y++) { uint32_t * E = (uint32_t *)(output->data[0] + y * output...
1,862
qemu
eefa3d8ef649f9055611361e2201cca49f8c3433
1
qio_channel_websock_source_prepare(GSource *source, gint *timeout) { QIOChannelWebsockSource *wsource = (QIOChannelWebsockSource *)source; GIOCondition cond = 0; *timeout = -1; if (wsource->wioc->rawinput.offset) { cond |= G_IO_IN; } if (wsou...
1,863
FFmpeg
3dde66752d59dfdd0f3727efd66e7202b3c75078
1
static uint_fast8_t vorbis_floor1_decode(vorbis_context *vc, vorbis_floor_data *vfu, float *vec) { vorbis_floor1 *vf = &vfu->t1; GetBitContext *gb = &vc->gb; uint_fast16_t range_v[4] = { 256, 128, 86, 64 }; uint_fast16_t range = range_v[vf->multiplier-1]; ...
1,864
qemu
354711279fcc532cee310ed8098f51403dfef5d9
1
static void qemu_add_data_dir(const char *path) { int i; if (path == NULL) { return; } if (data_dir_idx == ARRAY_SIZE(data_dir)) { return; } for (i = 0; i < data_dir_idx; i++) { if (strcmp(data_dir[i], path) == 0) { return; /* duplicate */ ...
1,865
FFmpeg
220b24c7c97dc033ceab1510549f66d0e7b52ef1
1
void *ff_schro_queue_pop(FFSchroQueue *queue) { FFSchroQueueElement *top = queue->p_head; if (top) { void *data = top->data; queue->p_head = queue->p_head->next; --queue->size; av_freep(&top); return data; } return NULL; }
1,866
qemu
1e7398a140f7a6bd9f5a438e7ad0f1ef50990e25
1
static void virtio_net_vhost_status(VirtIONet *n, uint8_t status) { VirtIODevice *vdev = VIRTIO_DEVICE(n); NetClientState *nc = qemu_get_queue(n->nic); int queues = n->multiqueue ? n->max_queues : 1; if (!get_vhost_net(nc->peer)) { return; } if ((virtio_net_started(n, status)...
1,867
FFmpeg
5ae484e350e4f1b20b31802dac59ca3519627c0a
0
static int evrc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; AVFrame *frame = data; EVRCContext *e = avctx->priv_data; int buf_size = avpkt->size; float ilspf[FILTER_ORDER], ...
1,868
FFmpeg
0058584580b87feb47898e60e4b80c7f425882ad
0
static int _do_rematrixing(AC3DecodeContext *ctx, int start, int end) { float tmp0, tmp1; while (start < end) { tmp0 = ctx->samples[start]; tmp1 = (ctx->samples + 256)[start]; ctx->samples[start] = tmp0 + tmp1; (ctx->samples + 256)[start] = tmp0 - tmp1; start++;...
1,869
FFmpeg
e97efecec82ca8458a9bbd75a91ebf556abde362
0
const DVprofile* avpriv_dv_frame_profile(const DVprofile *sys, const uint8_t* frame, unsigned buf_size) { int i; int dsf = (frame[3] & 0x80) >> 7; int stype = frame[80*5 + 48 + 3] & 0x1f; /* 576i50 25Mbps 4:1:1 is a special case */ if (dsf == 1 && stype == 0...
1,870
qemu
48e15fc2de29276f0c93482f5175b95e50557fbf
1
static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp, abi_ulong parent_tidptr, target_ulong newtls, abi_ulong child_tidptr) { int ret; TaskState *ts; uint8_t *new_stack; CPUState *new_env; #if defined(CONFIG_USE_NPTL) unsigned int nptl_...
1,873
qemu
3604a76fea6ff37738d4a8f596be38407be74a83
1
static inline void decode(DisasContext *dc, uint32_t ir) { if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP | CPU_LOG_TB_OP_OPT))) { tcg_gen_debug_insn_start(dc->pc); } dc->ir = ir; LOG_DIS("%8.8x\t", dc->ir); /* try guessing 'empty' instruction memory, although it may be a valid ...
1,874
FFmpeg
e371f031b942d73e02c090170975561fabd5c264
1
static int decode_zbuf(AVBPrint *bp, const uint8_t *data, const uint8_t *data_end) { z_stream zstream; unsigned char *buf; unsigned buf_size; int ret; zstream.zalloc = ff_png_zalloc; zstream.zfree = ff_png_zfree; zstream.opaque = NULL; if (inflateInit(...
1,875
FFmpeg
eeb3fb9e62d4647e1fee5d262be63e793117430d
1
static int write_extradata(FFV1Context *f) { RangeCoder *const c = &f->c; uint8_t state[CONTEXT_SIZE]; int i, j, k; uint8_t state2[32][CONTEXT_SIZE]; unsigned v; memset(state2, 128, sizeof(state2)); memset(state, 128, sizeof(state)); f->avctx->extradata_size = 10000 + 4 + ...
1,876
qemu
47d4be12c3997343e436c6cca89aefbbbeb70863
1
int qemu_strtol(const char *nptr, const char **endptr, int base, long *result) { char *p; int err = 0; if (!nptr) { if (endptr) { *endptr = nptr; } err = -EINVAL; } else { errno = 0; *result = strtol(nptr, &p, base); ...
1,877
qemu
8904e5a75005fe579c28806003892d8ae4a27dfa
1
static void spapr_set_vsmt_mode(sPAPRMachineState *spapr, Error **errp) { Error *local_err = NULL; bool vsmt_user = !!spapr->vsmt; int kvm_smt = kvmppc_smt_threads(); int ret; if (!kvm_enabled() && (smp_threads > 1)) { error_setg(&local_err, "TCG cannot support more than 1 thread/co...
1,879
qemu
b308c82cbda44e138ef990af64d44a5613c16092
1
static void pci_bridge_update_mappings(PCIBridge *br) { /* Make updates atomic to: handle the case of one VCPU updating the bridge * while another accesses an unaffected region. */ memory_region_transaction_begin(); pci_bridge_region_cleanup(br); pci_bridge_region_init(br); memory_region...
1,880
qemu
b45c03f585ea9bb1af76c73e82195418c294919d
1
static struct omap_sysctl_s *omap_sysctl_init(struct omap_target_agent_s *ta, omap_clk iclk, struct omap_mpu_state_s *mpu) { struct omap_sysctl_s *s = (struct omap_sysctl_s *) g_malloc0(sizeof(struct omap_sysctl_s)); s->mpu = mpu; omap_sysctl_reset(s); memory_regio...
1,881
FFmpeg
1d5edad8ccfd1843bc8c60260a20ac37b738cb77
1
static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt) { AVStream *st = s->streams[pkt->stream_index]; int size = pkt->size; uint8_t *buf = pkt->data; uint8_t *data = NULL; MpegTSWrite *ts = s->priv_data; MpegTSWriteStream *ts_st = st->priv_data; const int64_t del...
1,884
FFmpeg
d003a0cd2e587a47627fd328f9fc5a484adc29f2
1
static int mp3_write_packet(AVFormatContext *s, AVPacket *pkt) { MP3Context *mp3 = s->priv_data; if (pkt->stream_index == mp3->audio_stream_idx) { if (mp3->pics_to_write) { /* buffer audio packets until we get all the pictures */ AVPacketList *pktl = av_mallocz(sizeof(*pk...
1,885
qemu
ccc2960d654a233a6ed415b37d8ff41728d817c5
1
static void ioport_write(void *opaque, target_phys_addr_t addr, uint64_t val, unsigned size) { PCIQXLDevice *d = opaque; uint32_t io_port = addr; qxl_async_io async = QXL_SYNC; uint32_t orig_io_port = io_port; if (d->guest_bug && !io_port == QXL_IO_RESET) { ...
1,886
FFmpeg
fe51b5ce504d118757407c0855e957e97ca90f78
0
static int decode_frame_byterun1(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { IffContext *s = avctx->priv_data; const uint8_t *buf = avpkt->data; unsigned buf_size = avpkt->size; const uint8_t *buf_end = buf+buf_size...
1,887
FFmpeg
bcd7bf7eeb09a395cc01698842d1b8be9af483fc
0
static void avc_loopfilter_luma_inter_edge_ver_msa(uint8_t *data, uint8_t bs0, uint8_t bs1, uint8_t bs2, uint8_t bs3, uint8_t tc0, uint8_t tc1, ...
1,888
FFmpeg
607ad990d31e6be52980970e5ce8cd25ab3de812
0
static void dvbsub_parse_region_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size) { DVBSubContext *ctx = avctx->priv_data; const uint8_t *buf_end = buf + buf_size; int region_id, object_id; DVBSubRegion *region; DVBSubObject *object; ...
1,889
qemu
4be746345f13e99e468c60acbd3a355e8183e3ce
0
static void sdhci_initfn(Object *obj) { SDHCIState *s = SDHCI(obj); DriveInfo *di; di = drive_get_next(IF_SD); s->card = sd_init(di ? blk_bs(blk_by_legacy_dinfo(di)) : NULL, false); if (s->card == NULL) { exit(1); } s->eject_cb = qemu_allocate_irq(sdhci_insert_eject_cb, s,...
1,890
qemu
036f7166c73a9e0cc1b2f10c03763e61894a1033
0
static int print_ptr(DeviceState *dev, Property *prop, char *dest, size_t len) { void **ptr = qdev_get_prop_ptr(dev, prop); return snprintf(dest, len, "<%p>", *ptr); }
1,891
qemu
1a6245a5b0b4e8d822c739b403fc67c8a7bc8d12
0
static ssize_t drop_sync(int fd, size_t size) { ssize_t ret, dropped = size; uint8_t *buffer = g_malloc(MIN(65536, size)); while (size > 0) { ret = read_sync(fd, buffer, MIN(65536, size)); if (ret < 0) { g_free(buffer); return ret; } asse...
1,892
qemu
b192af8acc597a6e8068873434e56e0c7de1b7d3
0
static int coroutine_fn iscsi_co_flush(BlockDriverState *bs) { IscsiLun *iscsilun = bs->opaque; struct IscsiTask iTask; if (bs->sg) { return 0; } if (!iscsilun->force_next_flush) { return 0; } iscsilun->force_next_flush = false; iscsi_co_init_iscsitask(is...
1,893
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
0
static void mmio_ide_write(void *opaque, target_phys_addr_t addr, uint64_t val, unsigned size) { MMIOState *s = opaque; addr >>= s->shift; if (addr & 7) ide_ioport_write(&s->bus, addr, val); else ide_data_writew(&s->bus, 0, val); }
1,895
FFmpeg
504dff8e4ec7e282bed5bf1f31d5ede765643d3e
0
static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; VmdAudioContext *s = avctx->priv_data; int block_type; unsign...
1,897
qemu
f61eddcb2bb5cbbdd1d911b7e937db9affc29028
0
static int usb_parse(const char *cmdline) { int r; r = usb_device_add(cmdline); if (r < 0) { fprintf(stderr, "qemu: could not add USB device '%s'\n", cmdline); } return r; }
1,898
qemu
b6d36def6d9e9fd187327182d0abafc9b7085d8f
0
static int count_contiguous_free_clusters(uint64_t nb_clusters, uint64_t *l2_table) { int i; for (i = 0; i < nb_clusters; i++) { int type = qcow2_get_cluster_type(be64_to_cpu(l2_table[i])); if (type != QCOW2_CLUSTER_UNALLOCATED) { break; } } return i; ...
1,899
qemu
2b584959ed300ddff4acba0d7554becad5f274fd
0
void bdrv_set_geometry_hint(BlockDriverState *bs, int cyls, int heads, int secs) { bs->cyls = cyls; bs->heads = heads; bs->secs = secs; }
1,901
qemu
ad7171394f2fe3f9b5fe02f0c62496291a859a92
0
static BlockDriverState *bdrv_new_open(const char *filename, const char *fmt, int flags) { BlockDriverState *bs; BlockDriver *drv; char password[256]; bs = bdrv_new(""); if (!bs) { error_report("Not enou...
1,903
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
0
static uint32_t bitband_readl(void *opaque, target_phys_addr_t offset) { uint32_t addr; uint32_t mask; uint32_t v; addr = bitband_addr(opaque, offset) & ~3; mask = (1 << ((offset >> 2) & 31)); mask = tswap32(mask); cpu_physical_memory_read(addr, (uint8_t *)&v, 4); return (v & ma...
1,904
qemu
f17fd4fdf0df3d2f3444399d04c38d22b9a3e1b7
0
int64_t qemu_strtosz_MiB(const char *nptr, char **end) { return do_strtosz(nptr, end, 'M', 1024); }
1,906
qemu
e2ec3f976803b360c70d9ae2ba13852fa5d11665
0
static void to_json(const QObject *obj, QString *str, int pretty, int indent) { switch (qobject_type(obj)) { case QTYPE_QINT: { QInt *val = qobject_to_qint(obj); char buffer[1024]; snprintf(buffer, sizeof(buffer), "%" PRId64, qint_get_int(val)); qstring_append(str, buffe...
1,907
FFmpeg
27a2f87da8012efd31f0df063072c16345fbe115
0
static int rm_assemble_video_frame(AVFormatContext *s, RMContext *rm, AVPacket *pkt, int len) { ByteIOContext *pb = &s->pb; int hdr, seq, pic_num, len2, pos; int type; int ssize; hdr = get_byte(pb); len--; type = hdr >> 6; switch(type){ case 0: // slice case 2: // last sl...
1,908
qemu
90f998f5f4267a0c22e983f533d19b9de1849283
0
static int mux_proc_byte(CharDriverState *chr, MuxDriver *d, int ch) { if (d->term_got_escape) { d->term_got_escape = 0; if (ch == term_escape_char) goto send_char; switch(ch) { case '?': case 'h': mux_print_help(chr); break; ...
1,910
qemu
9bd7854e1e5d6f4cfe4558090bbd9493c12bf846
0
static void win_chr_readfile(CharDriverState *chr) { WinCharState *s = chr->opaque; int ret, err; uint8_t buf[1024]; DWORD size; ZeroMemory(&s->orecv, sizeof(s->orecv)); s->orecv.hEvent = s->hrecv; ret = ReadFile(s->hcom, buf, s->len, &size, &s->orecv); if (!ret) { er...
1,911
qemu
8297be80f7cf71e09617669a8bd8b2836dcfd4c3
0
void mips_r4k_init(MachineState *machine) { ram_addr_t ram_size = machine->ram_size; const char *cpu_model = machine->cpu_model; const char *kernel_filename = machine->kernel_filename; const char *kernel_cmdline = machine->kernel_cmdline; const char *initrd_filename = machine->initrd_filename;...
1,912
qemu
80f5ce758ac277e76c016dd7c0b246e40d4fca2d
0
static int write_note(struct memelfnote *men, int fd) { struct elf_note en; en.n_namesz = men->namesz; en.n_type = men->type; en.n_descsz = men->datasz; bswap_note(&en); if (dump_write(fd, &en, sizeof(en)) != 0) return (-1); if (dump_write(fd, men->name, men->namesz_ro...
1,913
qemu
95129d6fc9ead97155627a4ca0cfd37282883658
0
static int vhost_virtqueue_start(struct vhost_dev *dev, struct VirtIODevice *vdev, struct vhost_virtqueue *vq, unsigned idx) { hwaddr s, l, a; int r; int vhost_vq_index = idx - dev->vq_index; struct v...
1,916
qemu
8e9b0d24fb986d4241ae3b77752eca5dab4cb486
0
void vnc_client_read(void *opaque) { VncState *vs = opaque; long ret; #ifdef CONFIG_VNC_SASL if (vs->sasl.conn && vs->sasl.runSSF) ret = vnc_client_read_sasl(vs); else #endif /* CONFIG_VNC_SASL */ #ifdef CONFIG_VNC_WS if (vs->encode_ws) { ret = vnc_client_read_ws...
1,918
FFmpeg
6df2c94130b026930d1f7148699925dcaa08759c
0
static void update_sono_yuv(AVFrame *sono, const ColorFloat *c, int idx) { int x, fmt = sono->format, w = sono->width; uint8_t *lpy = sono->data[0] + idx * sono->linesize[0]; uint8_t *lpu = sono->data[1] + idx * sono->linesize[1]; uint8_t *lpv = sono->data[2] + idx * sono->linesize[2]; for (...
1,919
qemu
7f3bdc2d8e17999a26ac0f6649caef92fedfc1c0
0
static int find_pte32(CPUPPCState *env, struct mmu_ctx_hash32 *ctx, target_ulong sr, target_ulong eaddr, int rwx) { hwaddr pteg_off, pte_offset; ppc_hash_pte32_t pte; hwaddr hash; uint32_t vsid, pgidx, ptem; int ret; ret = -1; /* No entry found */ vsid = sr &...
1,920
qemu
a89f364ae8740dfc31b321eed9ee454e996dc3c1
0
static void csrhci_in_packet_vendor(struct csrhci_s *s, int ocf, uint8_t *data, int len) { int offset; uint8_t *rpkt; switch (ocf) { case OCF_CSR_SEND_FIRMWARE: /* Check if this is the bd_address packet */ if (len >= 18 + 8 && data[12] == 0x01 && data[13] == 0x0...
1,921
qemu
7ebaf7955603cc50988e0eafd5e6074320fefc70
0
static void spapr_cpu_core_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); dc->realize = spapr_cpu_core_realize; }
1,922
qemu
bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884
0
static int vnc_display_listen(VncDisplay *vd, SocketAddressLegacy **saddr, size_t nsaddr, SocketAddressLegacy **wsaddr, size_t nwsaddr, Error **errp) { size_t ...
1,923
qemu
9fd2ecdc8cb2dc1a8a7c57b6c9c60bc9947b6a73
0
static int do_create_others(int type, struct iovec *iovec) { dev_t rdev; int retval = 0; int offset = PROXY_HDR_SZ; V9fsString oldpath, path; int mode, uid, gid, cur_uid, cur_gid; v9fs_string_init(&path); v9fs_string_init(&oldpath); cur_uid = geteuid(); cur_gid = getegid(...
1,924
qemu
0fc0f1fa7f86e9f1d480c6508191ca90ac10b32c
0
void blockdev_auto_del(BlockDriverState *bs) { DriveInfo *dinfo = drive_get_by_blockdev(bs); if (dinfo->auto_del) { drive_uninit(dinfo); } }
1,925
qemu
7e84c2498f0ff3999937d18d1e9abaa030400000
0
void helper_lcall_protected_T0_T1(int shift, int next_eip) { int new_cs, new_eip; uint32_t e1, e2, cpl, dpl, rpl, selector, offset, param_count; uint32_t ss, ss_e1, ss_e2, push_size, sp, type, ss_dpl; uint32_t old_ss, old_esp, val, i, limit; uint8_t *ssp, *old_ssp; new_cs = T0; ...
1,926
qemu
f104919d15a3f0be57a70b5499bc9fa5e06224fd
0
static void armv7m_nvic_realize(DeviceState *dev, Error **errp) { NVICState *s = NVIC(dev); SysBusDevice *systick_sbd; Error *err = NULL; s->cpu = ARM_CPU(qemu_get_cpu(0)); assert(s->cpu); if (s->num_irq > NVIC_MAX_IRQ) { error_setg(errp, "num-irq %d exceeds NVIC maximum", s-...
1,927
FFmpeg
72ec043af4510723c53c729a67be482a14b7c7f3
1
static int nprobe(AVFormatContext *s, uint8_t *enc_header, const uint8_t *n_val) { OMAContext *oc = s->priv_data; uint32_t pos, taglen, datalen; struct AVDES av_des; if (!enc_header || !n_val) return -1; pos = OMA_ENC_HEADER_SIZE + oc->k_size; if (!memcmp(&enc_header[pos], "E...
1,928
qemu
0b8b8753e4d94901627b3e86431230f2319215c4
1
static gboolean nbd_negotiate_continue(QIOChannel *ioc, GIOCondition condition, void *opaque) { qemu_coroutine_enter(opaque, NULL); return TRUE; }
1,929
qemu
c3481247e58ff3f13337ce0a262b058799bd156c
1
void object_add(const char *type, const char *id, const QDict *qdict, Visitor *v, Error **errp) { Object *obj; const QDictEntry *e; Error *local_err = NULL; if (!object_class_by_name(type)) { error_setg(errp, "invalid class name"); return; } obj = ob...
1,930
FFmpeg
531ff7161d9d6b0cf8f71125319c1f5df5041637
1
static int create_filtergraph(AVFilterContext *ctx, const AVFrame *in, const AVFrame *out) { ColorSpaceContext *s = ctx->priv; const AVPixFmtDescriptor *in_desc = av_pix_fmt_desc_get(in->format); const AVPixFmtDescriptor *out_desc = av_pix_fmt_desc_get(out->format); ...
1,931
FFmpeg
a67cb012e6947fb238193afc0f18114f6e20818c
1
AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff){ AVResampleContext *c= av_mallocz(sizeof(AVResampleContext)); double factor= FFMIN(out_rate * cutoff / in_rate, 1.0); int phase_count= 1<<phase_shift; if (!c) return...
1,932
qemu
8f94a6e40e46cbc8e8014da825d25824b1803b34
1
static int bdrv_open_common(BlockDriverState *bs, BlockDriverState *file, QDict *options, int flags, BlockDriver *drv, Error **errp) { int ret, open_flags; const char *filename; Error *local_err = NULL; assert(drv != NULL); assert(bs->file == NULL); assert(options != NULL && bs->op...
1,933
qemu
703e0e89c669a70bbd6bf33c5e75f910d8d8cca3
1
static void usage(void) { printf("qemu-" TARGET_ARCH " version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n" "usage: qemu-" TARGET_ARCH " [options] program [arguments...]\n" "Linux CPU emulator (compiled for %s emulation)\n" "\n" "Stan...
1,934
qemu
297a3646c2947ee64a6d42ca264039732c6218e0
1
void visit_end_struct(Visitor *v, Error **errp) { assert(!error_is_set(errp)); v->end_struct(v, errp); }
1,935
FFmpeg
46ff7a5f4ae05e5e4da33b700604dae2c37bebcb
1
static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, uint8_t *buf, int buf_size) { RTSPState *rt = s->priv_data; RTSPStream *rtsp_st; fd_set rfds; int fd, fd_max, n, i, ret, tcp_fd; struct timeval tv; for(;;) { if (url_interrupt_cb()...
1,936
FFmpeg
34c52005605d68f7cd1957b169b6732c7d2447d9
1
static float **alloc_audio_arrays(int channels, int frame_size) { float **audio = av_mallocz_array(channels, sizeof(float *)); if (!audio) return NULL; for (int ch = 0; ch < channels; ch++) { audio[ch] = av_mallocz_array(frame_size, sizeof(float)); if (!audio[ch]) { ...
1,938
qemu
aec4b054ea36c53c8b887da99f20010133b84378
1
static void unterminated_sq_string(void) { QObject *obj = qobject_from_json("'abc", NULL); g_assert(obj == NULL); }
1,939
qemu
c5a49c63fa26e8825ad101dfe86339ae4c216539
1
static inline bool use_goto_tb(DisasContext *s, int n, uint64_t dest) { /* No direct tb linking with singlestep (either QEMU's or the ARM * debug architecture kind) or deterministic io */ if (s->base.singlestep_enabled || s->ss_active || (s->base.tb->cflags & CF_LAST_IO)) { return false;...
1,940
FFmpeg
3caffb7d80f20c66d7d582ca3d23f80ad373ba0a
1
static int common_end(AVCodecContext *avctx){ FFV1Context *s = avctx->priv_data; int i; for(i=0; i<s->plane_count; i++){ PlaneContext *p= &s->plane[i]; av_freep(&p->state); } return 0; }
1,941
FFmpeg
f972193a15026a99eb2b08e7913a03f2123663da
1
av_cold void ff_sws_init_input_funcs(SwsContext *c) { enum PixelFormat srcFormat = c->srcFormat; c->chrToYV12 = NULL; switch(srcFormat) { case PIX_FMT_YUYV422 : c->chrToYV12 = yuy2ToUV_c; break; case PIX_FMT_UYVY422 : c->chrToYV12 = uyvyToUV_c; break; case PIX_FMT_NV12 ...
1,942
qemu
43e86c8f5b6d9f6279e20dede4e1f7829bdc43b7
1
static uint32_t pcie_mmcfg_data_read(PCIBus *s, uint32_t addr, int len) { PCIDevice *pci_dev = pcie_dev_find_by_mmcfg_addr(s, addr); if (!pci_dev) { return ~0x0; } return pci_host_config_read_common(pci_dev, PCIE_MMCFG_CONFOFFSET(addr), pci_config_...
1,943
FFmpeg
0ffea3565700c9b3093ead285f729bb319a2163e
1
int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type, uint8_t *data, size_t size) { AVPacketSideData *sd, *tmp; int i; for (i = 0; i < st->nb_side_data; i++) { sd = &st->side_data[i]; if (sd->type == type) { av_freep(&sd...
1,944
qemu
18995b9808dc48897bda6ed93ce3e978191f7251
1
static void qemu_announce_self_once(void *opaque) { int i, len; VLANState *vlan; VLANClientState *vc; uint8_t buf[256]; static int count = SELF_ANNOUNCE_ROUNDS; QEMUTimer *timer = *(QEMUTimer **)opaque; for (i = 0; i < MAX_NICS; i++) { if (!nd_table[i].used) c...
1,947
qemu
306077640a652e090779498aadbeb0c605feaacd
1
static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, const char *name, int devfn) { PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(pci_dev); PCIConfigReadFunc *config_read = pc->config_read; PCIConfigWriteFunc *config_write = pc->config_write; ...
1,948
FFmpeg
662234a9a22f1cd0f0ac83b8bb1ffadedca90c0a
0
static void avc_luma_vt_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { int32_t loop_cnt; int16_t filt_const0 = 0xfb01; int16_t filt_const1 = 0x1414; int16_t filt_const2 = 0x1fb; ...
1,949
qemu
898248a32915024a4f01ce4f0c3519509fb703cb
1
static bool xhci_er_full(void *opaque, int version_id) { struct XHCIInterrupter *intr = opaque; return intr->er_full; }
1,950
qemu
0b5538c300a56c3cfb33022840fe0b4968147e7a
1
bool st_change_trace_event_state(const char *tname, bool tstate) { TraceEvent *tp; tp = find_trace_event_by_name(tname); if (tp) { tp->state = tstate; return true; } return false; }
1,951
qemu
1afec9138f848cfba517bd2d80167b27216b9df9
1
aio_read_f(int argc, char **argv) { int nr_iov, c; struct aio_ctx *ctx = calloc(1, sizeof(struct aio_ctx)); BlockDriverAIOCB *acb; while ((c = getopt(argc, argv, "CP:qv")) != EOF) { switch (c) { case 'C': ctx->Cflag = 1; break; case 'P': ctx->Pflag = 1; ctx->pattern = parse_pattern(o...
1,952
FFmpeg
7c845450d2daa0d066045cf94ab51cb496f1b824
1
int ff_eval_refl(int *refl, const int16_t *coefs, AVCodecContext *avctx) { int b, i, j; int buffer1[LPC_ORDER]; int buffer2[LPC_ORDER]; int *bp1 = buffer1; int *bp2 = buffer2; for (i=0; i < LPC_ORDER; i++) buffer2[i] = coefs[i]; refl[LPC_ORDER-1] = bp2[LPC_ORDER-1]; ...
1,953
qemu
0e141977e690ee6cd06e5a842eae0be291297efa
1
void cpu_loop(CPUAlphaState *env) { int trapnr; target_siginfo_t info; abi_long sysret; while (1) { trapnr = cpu_alpha_exec (env); /* All of the traps imply a transition through PALcode, which implies an REI instruction has been executed. Which means t...
1,954