project
stringclasses
2 values
commit_id
stringlengths
40
40
target
int64
0
1
func
stringlengths
26
142k
idx
int64
0
27.3k
qemu
494a8ebe713055d3946183f4b395f85a18b43e9e
0
static int proxy_truncate(FsContext *ctx, V9fsPath *fs_path, off_t size) { int retval; retval = v9fs_request(ctx->private, T_TRUNCATE, NULL, "sq", fs_path, size); if (retval < 0) { errno = -retval; return -1; } return 0; }
17,081
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
0
static uint64_t e1000_io_read(void *opaque, target_phys_addr_t addr, unsigned size) { E1000State *s = opaque; (void)s; return 0; }
17,083
qemu
d28fca153bb27ff965b9eb26d73327fa4d2402c8
0
static void pci_vpb_init(Object *obj) { PCIHostState *h = PCI_HOST_BRIDGE(obj); PCIVPBState *s = PCI_VPB(obj); memory_region_init(&s->pci_io_space, OBJECT(s), "pci_io", 1ULL << 32); memory_region_init(&s->pci_mem_space, OBJECT(s), "pci_mem", 1ULL << 32); pci_bus_new_inplace(&s->pci_bus, si...
17,084
qemu
98522f63f40adaebc412481e1d2e9170160d4539
0
BlockDriverState *bdrv_new(const char *device_name) { BlockDriverState *bs; bs = g_malloc0(sizeof(BlockDriverState)); QLIST_INIT(&bs->dirty_bitmaps); pstrcpy(bs->device_name, sizeof(bs->device_name), device_name); if (device_name[0] != '\0') { QTAILQ_INSERT_TAIL(&bdrv_states, bs, de...
17,086
FFmpeg
e6ffd997cbc06426e75d3fa291b991866c84a79b
0
static inline int get_scale(GetBitContext *gb, int level, int value) { if (level < 5) { /* huffman encoded */ value += get_bitalloc(gb, &dca_scalefactor, level); } else if (level < 8) value = get_bits(gb, level + 1); return value; }
17,087
qemu
2bcf018340cbf233f7145e643fc1bb367f23fd90
0
int s390_cpu_handle_mmu_fault(CPUState *cs, vaddr orig_vaddr, int rw, int mmu_idx) { S390CPU *cpu = S390_CPU(cs); CPUS390XState *env = &cpu->env; target_ulong vaddr, raddr; uint64_t asc; int prot; DPRINTF("%s: address 0x%" VADDR_PRIx " rw %d mmu_idx %d\n",...
17,089
qemu
f36951c19f15f3c053a31234bd2c297d86c1a052
0
uint64_t kvmppc_rma_size(uint64_t current_size, unsigned int hash_shift) { if (cap_ppc_rma >= 2) { return current_size; } return MIN(current_size, getrampagesize() << (hash_shift - 7)); }
17,090
qemu
f8b0aa25599782eef91edc00ebf620bd14db720c
0
setup_sigcontext(struct target_sigcontext *sc, /*struct _fpstate *fpstate,*/ CPUState *env, unsigned long mask) { int err = 0; __put_user_error(env->regs[0], &sc->arm_r0, err); __put_user_error(env->regs[1], &sc->arm_r1, err); __put_user_error(env->regs[2], &sc->arm_r2, err); __put_user_error(env->regs...
17,093
qemu
dc28c0cd30d7b122500b17eedc7e070624fd7c86
0
void hd_geometry_guess(BlockDriverState *bs, int *pcyls, int *pheads, int *psecs) { int cylinders, heads, secs, translation; bdrv_get_geometry_hint(bs, &cylinders, &heads, &secs); translation = bdrv_get_translation_hint(bs); if (cylinders != 0) { /* already got ...
17,094
qemu
d9f62dde1303286b24ac8ce88be27e2b9b9c5f46
0
static void test_visitor_in_intList(TestInputVisitorData *data, const void *unused) { int64_t value[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20}; int16List *res = NULL, *tmp; Error *err = NULL; Visitor *v; int i = 0; v = visitor_input_test_init(data, "1,2,...
17,095
qemu
de188751da8db3c77a681bf903035a0e5218c463
0
int init_timer_alarm(void) { struct qemu_alarm_timer *t = NULL; int i, err = -1; for (i = 0; alarm_timers[i].name; i++) { t = &alarm_timers[i]; err = t->start(t); if (!err) break; } if (err) { err = -ENOENT; goto fail; } ...
17,096
qemu
c5a49c63fa26e8825ad101dfe86339ae4c216539
1
static void i386_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) { DisasContext *dc = container_of(dcbase, DisasContext, base); target_ulong pc_next = disas_insn(dc, cpu); if (dc->tf || (dc->base.tb->flags & HF_INHIBIT_IRQ_MASK)) { /* if single step mode, we generate only one instr...
17,097
FFmpeg
001af703c6bff7cb8009db3ac882b8d929d67d9e
0
static av_cold int alac_decode_init(AVCodecContext * avctx) { int ret; int req_packed; ALACContext *alac = avctx->priv_data; alac->avctx = avctx; /* initialize from the extradata */ if (alac->avctx->extradata_size != ALAC_EXTRADATA_SIZE) { av_log(avctx, AV_LOG_ERROR, "expected ...
17,098
FFmpeg
e102fcf7f0f78bbdd395f05bb5b2fca83297749b
1
static void qtrle_decode_8bpp(QtrleContext *s) { int stream_ptr; int header; int start_line; int lines_to_change; signed char rle_code; int row_ptr, pixel_ptr; int row_inc = s->frame.linesize[0]; unsigned char pi1, pi2, pi3, pi4; /* 4 palette indices */ unsigned char *rgb ...
17,099
FFmpeg
39bb30f6640fe1faf4bbc779a79786028febc95d
1
static int mxf_read_source_package(MXFPackage *package, ByteIOContext *pb, int tag) { switch(tag) { case 0x4403: package->tracks_count = get_be32(pb); if (package->tracks_count >= UINT_MAX / sizeof(UID)) return -1; package->tracks_refs = av_malloc(package->tracks_count...
17,100
FFmpeg
7ad698e24e6b9dde57c4e01c145bcddfe9d6e4a3
1
static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket* avpkt) { WMAProDecodeCtx *s = avctx->priv_data; GetBitContext* gb = &s->pgb; const uint8_t* buf = avpkt->data; int buf_size = avpkt->size; int num_bits_prev_frame; int packet...
17,102
FFmpeg
ecad9872fb8c50dc88e8298535603e04fd9cf8b4
1
int ff_pca(PCA *pca, double *eigenvector, double *eigenvalue){ int i, j, k, pass; const int n= pca->n; double z[n]; memset(eigenvector, 0, sizeof(double)*n*n); for(j=0; j<n; j++){ pca->mean[j] /= pca->count; eigenvector[j + j*n] = 1.0; for(i=0; i<=j; i++){ ...
17,103
qemu
0e1d02452bf2c3486406dd48524a5b1de3c0eba8
1
qcrypto_tls_creds_check_cert_key_purpose(QCryptoTLSCredsX509 *creds, gnutls_x509_crt_t cert, const char *certFile, bool isServer, Error **errp) { ...
17,104
qemu
2db59a76c421cdd1039d10e32a9798952d3ff5ba
1
void HELPER(window_check)(CPUXtensaState *env, uint32_t pc, uint32_t w) { uint32_t windowbase = windowbase_bound(env->sregs[WINDOW_BASE], env); uint32_t windowstart = env->sregs[WINDOW_START]; uint32_t m, n; if ((env->sregs[PS] & (PS_WOE | PS_EXCM)) ^ PS_WOE) { return; } for ...
17,105
qemu
89cad9f3ec6b30d7550fb5704475fc9c3393a066
1
QDict *qobject_to_qdict(const QObject *obj) { if (qobject_type(obj) != QTYPE_QDICT) return NULL; return container_of(obj, QDict, base); }
17,106
qemu
167351020420c285b67cdf0603501b3d3b15e3f7
1
PXA2xxLCDState *pxa2xx_lcdc_init(MemoryRegion *sysmem, target_phys_addr_t base, qemu_irq irq) { PXA2xxLCDState *s; s = (PXA2xxLCDState *) g_malloc0(sizeof(PXA2xxLCDState)); s->invalidated = 1; s->irq = irq; s->sysmem = sysmem; pxa2xx_lcdc_orientation(...
17,107
qemu
240ce26a0533a6e5ee472789fbfbd9f7f939197e
1
static int decode_mips16_opc (CPUMIPSState *env, DisasContext *ctx, int *is_branch) { int rx, ry; int sa; int op, cnvt_op, op1, offset; int funct; int n_bytes; op = (ctx->opcode >> 11) & 0x1f; sa = (ctx->opcode >> 2) & 0x7; sa = sa == 0 ? 8 : sa;...
17,108
qemu
53111180946a56d314a9c1d07d09b9ef91e847b9
1
static int arm_gic_common_init(SysBusDevice *dev) { GICState *s = FROM_SYSBUS(GICState, dev); int num_irq = s->num_irq; if (s->num_cpu > NCPU) { hw_error("requested %u CPUs exceeds GIC maximum %d\n", s->num_cpu, NCPU); } s->num_irq += GIC_BASE_IRQ; if (s->num_...
17,109
qemu
f2d3476eba17486c42357ba25c36bd26e627d1d7
1
static kbd_layout_t *parse_keyboard_layout(const name2keysym_t *table, const char *language, kbd_layout_t * k) { FILE *f; char * filename; char line[1024]; int len; filename = qemu_find_file(QEMU_FILE_TYPE_KEYMAP, language); if (!k) k = g_malloc0(sizeof(kbd_layout_...
17,110
qemu
3c3ce981423e0d6c18af82ee62f1850c2cda5976
1
static void *virtio_scsi_load_request(QEMUFile *f, SCSIRequest *sreq) { SCSIBus *bus = sreq->bus; VirtIOSCSI *s = container_of(bus, VirtIOSCSI, bus); VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s); VirtIOSCSIReq *req; uint32_t n; req = g_malloc(sizeof(*req)); qemu_get_be32s(f, &n); ...
17,111
FFmpeg
0a373c31cb7f8dae84857881cd7e3829a6483efe
1
static int svq1_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MpegEncContext *s = avctx->priv_data; uint8_t *current, *previous; int result, i, x, y, width, h...
17,112
qemu
60fe637bf0e4d7989e21e50f52526444765c63b4
1
bool migrate_rdma_pin_all(void) { MigrationState *s; s = migrate_get_current(); return s->enabled_capabilities[MIGRATION_CAPABILITY_RDMA_PIN_ALL]; }
17,114
qemu
d14ed2548c3163cdb316eb4da36cd7a6a8975da4
1
static void openpic_reset (void *opaque) { openpic_t *opp = (openpic_t *)opaque; int i; opp->glbc = 0x80000000; /* Initialise controller registers */ opp->frep = ((OPENPIC_EXT_IRQ - 1) << 16) | ((MAX_CPU - 1) << 8) | VID; opp->veni = VENI; opp->pint = 0x00000000; opp->spve = 0...
17,115
FFmpeg
97392553656a7f4fabde9ded4d2b7f538d98ee17
1
static av_cold void movie_uninit(AVFilterContext *ctx) { MovieContext *movie = ctx->priv; int i; for (i = 0; i < ctx->nb_outputs; i++) { av_freep(&ctx->output_pads[i].name); if (movie->st[i].st) avcodec_close(movie->st[i].st->codec); } av_freep(&movie->st); ...
17,116
qemu
903a41d3415960240cb3b9f1d66f3707b27010d6
1
static XICSState *xics_system_init(MachineState *machine, int nr_servers, int nr_irqs) { XICSState *icp = NULL; if (kvm_enabled()) { Error *err = NULL; if (machine_kernel_irqchip_allowed(machine)) { icp = try_create_xics(TYPE_KVM_XICS, nr...
17,117
FFmpeg
5b349c8d7cc5dd26b3fbbce6e3883ce02861eeb7
0
static void chroma(WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset, int column) { const int plane = s->desc->comp[component].plane; const int mirror = s->mirror; const int c0_linesize = in->linesize[(plane + 1) % s->ncomp]; const int c1_li...
17,119
qemu
fc40787abcf8452b8f50d92b7a13243a12972c7a
1
target_ulong helper_lwr(CPUMIPSState *env, target_ulong arg1, target_ulong arg2, int mem_idx) { target_ulong tmp; tmp = do_lbu(env, arg2, mem_idx); arg1 = (arg1 & 0xFFFFFF00) | tmp; if (GET_LMASK(arg2) >= 1) { tmp = do_lbu(env, GET_OFFSET(arg2, -1), mem_idx); ...
17,121
qemu
d9654a58576dae982458bdb1eb565c9876c24c22
1
read_help(void) { printf( "\n" " reads a range of bytes from the given offset\n" "\n" " Example:\n" " 'read -v 512 1k' - dumps 1 kilobyte read from 512 bytes into the file\n" "\n" " Reads a segment of the currently open file, optionally dumping it to the\n" " standard output stream (with -v option) for subse...
17,122
qemu
60fe637bf0e4d7989e21e50f52526444765c63b4
1
QEMUSizedBuffer *qsb_clone(const QEMUSizedBuffer *qsb) { QEMUSizedBuffer *out = qsb_create(NULL, qsb_get_length(qsb)); size_t i; ssize_t res; off_t pos = 0; if (!out) { return NULL; } for (i = 0; i < qsb->n_iov; i++) { res = qsb_write_at(out, qsb->iov[i].iov_ba...
17,123
FFmpeg
92eb82325e8bddc56daa8dbd1308efd4896c6114
0
int put_wav_header(ByteIOContext *pb, AVCodecContext *enc) { int bps, blkalign, bytespersec; int hdrsize = 18; if(!enc->codec_tag || enc->codec_tag > 0xffff) enc->codec_tag = codec_get_tag(codec_wav_tags, enc->codec_id); if(!enc->codec_tag) return -1; put_le16(pb, enc->cod...
17,125
FFmpeg
2884cf205a9a29d89db7a444c5b1613cdfe37acf
0
static inline int get_egolomb(GetBitContext *gb) { int v = 4; while (get_bits1(gb)) v++; return (1 << v) + get_bits(gb, v); }
17,126
FFmpeg
cc9c5126387a1d8093ca8cc1df6ab2c535c35dba
0
static int read_access_unit(AVCodecContext *avctx, void* data, int *data_size, const uint8_t *buf, int buf_size) { MLPDecodeContext *m = avctx->priv_data; GetBitContext gb; unsigned int length, substr; unsigned int substream_start; unsigned int header_size = 4; ...
17,127
FFmpeg
2eba9087f3031c6050f8dcd996225490be6c2410
0
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags) { int ret; switch (avctx->codec_type) { case AVMEDIA_TYPE_VIDEO: if (!frame->width) frame->width = avctx->width; if (!frame->height) frame->height = avctx->height;...
17,129
FFmpeg
a51fbb56bb9352476affaef1fc6773c8b059db91
0
static av_cold void common_init(H264Context *h){ MpegEncContext * const s = &h->s; s->width = s->avctx->width; s->height = s->avctx->height; s->codec_id= s->avctx->codec->id; ff_h264dsp_init(&h->h264dsp, 8, 1); ff_h264_pred_init(&h->hpc, s->codec_id, 8, 1); h->dequant_coeff_pps=...
17,130
FFmpeg
13a099799e89a76eb921ca452e1b04a7a28a9855
0
static void RENAME(yuv2rgb555_2)(SwsContext *c, const uint16_t *buf0, const uint16_t *buf1, const uint16_t *ubuf0, const uint16_t *ubuf1, const uint16_t *vbuf0, const uint16_t *vbuf1, const uint16_t *abuf0, ...
17,131
qemu
06f7f2bb562826101468f387b4a34971b16e9aee
0
static void device_finalize(Object *obj) { DeviceState *dev = DEVICE(obj); BusState *bus; DeviceClass *dc = DEVICE_GET_CLASS(dev); if (dev->realized) { while (dev->num_child_bus) { bus = QLIST_FIRST(&dev->child_bus); qbus_free(bus); } if (qdev_...
17,132
qemu
496272a7018ba01aa2b87a1a5ed866ff85133401
0
static int pte_check_hash32(mmu_ctx_t *ctx, target_ulong pte0, target_ulong pte1, int h, int rw, int type) { target_ulong ptem, mmask; int access, ret, pteh, ptev, pp; ret = -1; /* Check validity and table match */ ptev = pte_is_valid_hash32(pte0); pteh = (p...
17,134
qemu
9c605cb13547a5faa5cb1092e3e44ac8b0d0b841
0
static void gen_lea_modrm(DisasContext *s, int modrm, int *reg_ptr, int *offset_ptr) { int havesib; int base, disp; int index; int scale; int opreg; int mod, rm, code, override, must_add_seg; /* XXX: add a generation time variable to tell if base == 0 in DS/ES/SS */ override =...
17,135
FFmpeg
f929ab0569ff31ed5a59b0b0adb7ce09df3fca39
0
static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t pos) { VideoPicture *vp; #if CONFIG_AVFILTER AVPicture pict_src; #else int dst_pix_fmt = AV_PIX_FMT_YUV420P; #endif /* wait until we have space to put a new picture */ SDL_LockMutex(is->pictq_mutex); if ...
17,136
qemu
f090c9d4ad5812fb92843d6470a1111c15190c4c
0
float64 int64_to_float64( int64 a STATUS_PARAM ) { flag zSign; if ( a == 0 ) return 0; if ( a == (sbits64) LIT64( 0x8000000000000000 ) ) { return packFloat64( 1, 0x43E, 0 ); } zSign = ( a < 0 ); return normalizeRoundAndPackFloat64( zSign, 0x43C, zSign ? - a : a STATUS_VAR ); ...
17,137
qemu
210b580b106fa798149e28aa13c66b325a43204e
0
static void rtas_ibm_change_msi(sPAPREnvironment *spapr, uint32_t token, uint32_t nargs, target_ulong args, uint32_t nret, target_ulong rets) { uint32_t config_addr = rtas_ld(args, 0); uint64_t buid = ((uint64_...
17,138
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
0
static void gic_dist_writel(void *opaque, target_phys_addr_t offset, uint32_t value) { GICState *s = (GICState *)opaque; if (offset == 0xf00) { int cpu; int irq; int mask; cpu = gic_get_current_cpu(s); irq = value & 0x3ff; s...
17,139
qemu
eb700029c7836798046191d62d595363d92c84d4
0
void eth_setup_vlan_headers(struct eth_header *ehdr, uint16_t vlan_tag, bool *is_new) { struct vlan_header *vhdr = PKT_GET_VLAN_HDR(ehdr); switch (be16_to_cpu(ehdr->h_proto)) { case ETH_P_VLAN: case ETH_P_DVLAN: /* vlan hdr exists */ *is_new = false; break; ...
17,142
qemu
2be5064953540d5451480375519389f104eb7909
0
static void qemu_laio_completion_cb(void *opaque) { struct qemu_laio_state *s = opaque; while (1) { struct io_event events[MAX_EVENTS]; uint64_t val; ssize_t ret; struct timespec ts = { 0 }; int nevents, i; do { ret = read(s->efd, &val, s...
17,143
qemu
621ff94d5074d88253a5818c6b9c4db718fbfc65
0
static void virtio_ccw_blk_realize(VirtioCcwDevice *ccw_dev, Error **errp) { VirtIOBlkCcw *dev = VIRTIO_BLK_CCW(ccw_dev); DeviceState *vdev = DEVICE(&dev->vdev); Error *err = NULL; qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus)); object_property_set_bool(OBJECT(vdev), true, "realized", &err); ...
17,145
qemu
e7d336959b7c01699702dcda4b54a822972d74a8
0
S390PCIBusDevice *s390_pci_find_dev_by_idx(uint32_t idx) { S390PCIBusDevice *pbdev; int i; int j = 0; S390pciState *s = S390_PCI_HOST_BRIDGE( object_resolve_path(TYPE_S390_PCI_HOST_BRIDGE, NULL)); if (!s) { return NULL; } for (i = 0; i < PCI_SLOT_MAX; i++) { ...
17,146
FFmpeg
6369ba3c9cc74becfaad2a8882dff3dd3e7ae3c0
0
hadamard_func(mmxext) hadamard_func(sse2) hadamard_func(ssse3) av_cold void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx) { int cpu_flags = av_get_cpu_flags(); #if HAVE_YASM int bit_depth = avctx->bits_per_raw_sample; if (EXTERNAL_MMX(cpu_flags)) { if (bit_depth <= 8) ...
17,147
qemu
c2b38b277a7882a592f4f2ec955084b2b756daaa
0
void aio_set_fd_poll(AioContext *ctx, int fd, IOHandler *io_poll_begin, IOHandler *io_poll_end) { /* Not implemented */ }
17,148
qemu
22d5cd82e98b61b1dbd791fab9f4ae0f77c0ed14
0
static void raw_invalidate_cache(BlockDriverState *bs, Error **errp) { BDRVRawState *s = bs->opaque; int ret; assert(!(bdrv_get_flags(bs) & BDRV_O_INACTIVE)); ret = raw_handle_perm_lock(bs, RAW_PL_PREPARE, s->perm, s->shared_perm, errp); if (ret) { re...
17,149
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
0
static uint64_t bw_conf1_read(void *opaque, target_phys_addr_t addr, unsigned size) { PCIBus *b = opaque; return pci_data_read(b, addr, size); }
17,150
qemu
4d70655bcb852ea0a006d3923f0b0a9c69ff462e
0
int bdrv_open(BlockDriverState *bs, const char *filename, QDict *options, int flags, BlockDriver *drv) { int ret; /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */ char tmp_filename[PATH_MAX + 1]; BlockDriverState *file = NULL; /* NULL means an empty set of...
17,151
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
0
static uint32_t omap_sysctl_read(void *opaque, target_phys_addr_t addr) { struct omap_sysctl_s *s = (struct omap_sysctl_s *) opaque; switch (addr) { case 0x000: /* CONTROL_REVISION */ return 0x20; case 0x010: /* CONTROL_SYSCONFIG */ return s->sysconfig; case 0x030 ... 0...
17,153
qemu
b29a0341d7ed7e7df4bf77a41db8e614f1ddb645
0
static void gen_dmtc0 (DisasContext *ctx, int reg, int sel) { const char *rn = "invalid"; switch (reg) { case 0: switch (sel) { case 0: gen_op_mtc0_index(); rn = "Index"; break; case 1: // gen_op_dmtc0_mvpcontrol(); /* MT ASE *...
17,154
qemu
2133a5f6b8f8941a6a3734c6c1990656553de76c
0
static void xilinx_spips_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { int mask = ~0; int man_start_com = 0; XilinxSPIPS *s = opaque; DB_PRINT("addr=" TARGET_FMT_plx " = %x\n", addr, (unsigned)value); addr >>= 2; switch (addr)...
17,155
qemu
7423f417827146f956df820f172d0bf80a489495
0
int nbd_init(int fd, QIOChannelSocket *ioc, uint32_t flags, off_t size) { return -ENOTSUP; }
17,156
FFmpeg
e80b2b9c81716a5d9f559c04cfe69d76b04e4cd3
0
static int dca_find_frame_end(DCAParseContext *pc1, const uint8_t *buf, int buf_size) { int start_found, i; uint32_t state; ParseContext *pc = &pc1->pc; start_found = pc->frame_start_found; state = pc->state; i = 0; if (!start_found) { ...
17,158
qemu
dfd100f242370886bb6732f70f1f7cbd8eb9fedc
0
static int connect_to_sdog(BDRVSheepdogState *s, Error **errp) { int fd; fd = socket_connect(s->addr, NULL, NULL, errp); if (s->addr->type == SOCKET_ADDRESS_KIND_INET && fd >= 0) { int ret = socket_set_nodelay(fd); if (ret < 0) { error_report("%s", strerror(errno)); ...
17,159
qemu
9307c4c1d93939db9b04117b654253af5113dc21
0
static void do_info_block(int argc, const char **argv) { bdrv_info(); }
17,160
qemu
3d6dff316f20137a87e099c30136358df029c0f6
0
static void buffered_flush(QEMUFileBuffered *s) { size_t offset = 0; int error; error = qemu_file_get_error(s->file); if (error != 0) { DPRINTF("flush when error, bailing: %s\n", strerror(-error)); return; } DPRINTF("flushing %zu byte(s) of data\n", s->buffer_size); ...
17,161
qemu
1cf0d2b8352a2df35919030b84dbfc713ee9b9be
0
static int vt82c686b_mc97_initfn(PCIDevice *dev) { VT686MC97State *s = DO_UPCAST(VT686MC97State, dev, dev); uint8_t *pci_conf = s->dev.config; pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_VIA); pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_VIA_MC97); pci_config_set_class(pci_conf, PCI...
17,162
qemu
4f5e19e6c570459cd524b29b24374f03860f5149
0
PCIBus *pci_gt64120_init(qemu_irq *pic) { GT64120State *s; PCIDevice *d; (void)&pci_host_data_writeb; /* avoid warning */ (void)&pci_host_data_writew; /* avoid warning */ (void)&pci_host_data_writel; /* avoid warning */ (void)&pci_host_data_readb; /* avoid warning */ (void)&pci_hos...
17,163
qemu
de13d2161473d02ae97ec0f8e4503147554892dd
0
static void enter_pgmcheck(S390CPU *cpu, uint16_t code) { kvm_s390_interrupt(cpu, KVM_S390_PROGRAM_INT, code); }
17,164
FFmpeg
155ec6edf82692bcf3a5f87d2bc697404f4e5aaf
0
static void add_xblock(DWTELEM *dst, uint8_t *src, uint8_t *obmc, int s_x, int s_y, int b_w, int b_h, int mv_x, int mv_y, int w, int h, int dst_stride, int src_stride, int obmc_stride, int mb_type, int add){ uint8_t tmp[src_stride*(b_h+5)]; //FIXME move to context to gurantee alignment int x,y; if(s_x<...
17,165
FFmpeg
f94b150a0342fc5a7d0b0f0c82d0d9c3aec3c49f
0
int av_buffersrc_add_ref(AVFilterContext *buffer_filter, AVFilterBufferRef *picref, int flags) { BufferSourceContext *c = buffer_filter->priv; AVFilterLink *outlink = buffer_filter->outputs[0]; AVFilterBufferRef *buf; int ret; if (!picref) { c->eof = 1; ...
17,166
FFmpeg
75a9479b393a02ffa03436f275ad2b91bd2acd26
0
int avformat_write_header(AVFormatContext *s, AVDictionary **options) { int ret = 0, i; AVStream *st; AVDictionary *tmp = NULL; if (options) av_dict_copy(&tmp, *options, 0); if ((ret = av_opt_set_dict(s, &tmp)) < 0) goto fail; if (s->priv_data && s->oformat->priv_class...
17,167
FFmpeg
af8aa846fa5b9f2c7dcde451c872426528b8b561
0
static int decode_slice_header(H264Context *h){ MpegEncContext * const s = &h->s; int first_mb_in_slice, pps_id; int num_ref_idx_active_override_flag; static const uint8_t slice_type_map[5]= {P_TYPE, B_TYPE, I_TYPE, SP_TYPE, SI_TYPE}; int slice_type; int default_ref_list_done = 0; s...
17,168
FFmpeg
e549933a270dd2cfc36f2cf9bb6b29acf3dc6d08
0
void ff_put_h264_qpel8_mc12_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride) { avc_luma_midh_qrt_8w_msa(src - (2 * stride) - 2, stride, dst, stride, 8, 0); }
17,169
qemu
226a48949cf74006a94b5931e50352b2af801ac7
1
static void become_daemon(const char *pidfile) { #ifndef _WIN32 pid_t pid, sid; pid = fork(); if (pid < 0) { exit(EXIT_FAILURE); } if (pid > 0) { exit(EXIT_SUCCESS); } if (pidfile) { if (!ga_open_pidfile(pidfile)) { g_critical("failed to c...
17,170
FFmpeg
cabfed6895fcc679cd6a6244a12d800e0f3f2d20
1
static int msvideo1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; Msvideo1Context *s = avctx->priv_data; int ret; s->buf = buf; s->si...
17,171
FFmpeg
6e42e6c4b410dbef8b593c2d796a5dad95f89ee4
1
void rgb16tobgr24(const uint8_t *src, uint8_t *dst, long src_size) { const uint16_t *end; uint8_t *d = (uint8_t *)dst; const uint16_t *s = (const uint16_t *)src; end = s + src_size/2; while(s < end) { register uint16_t bgr; bgr = *s++; *d++ = (bgr&0xF800)>>8; *d++ = (bgr&0x7E0)>>3; *d++ = (b...
17,173
qemu
81174dae3f9189519cd60c7b79e91c291b021bbe
1
static void serial_receive_byte(SerialState *s, int ch) { s->rbr = ch; s->lsr |= UART_LSR_DR; serial_update_irq(s); }
17,174
qemu
60be6340796e66b5ac8aac2d98dde5c79336a89c
1
ram_addr_t migration_bitmap_find_and_reset_dirty(RAMBlock *rb, ram_addr_t start) { unsigned long base = rb->offset >> TARGET_PAGE_BITS; unsigned long nr = base + (start >> TARGET_PAGE_BITS); uint64_t rb_size = rb->used_length; unsigned long size = b...
17,175
FFmpeg
ecff5acb5a738fcb4f9e206a12070dac4bf259b3
1
static int svq1_motion_inter_block(DSPContext *dsp, GetBitContext *bitbuf, uint8_t *current, uint8_t *previous, int pitch, svq1_pmv *motion, int x, int y) { uint8_t *src; uint8_t *dst; svq1_pmv mv; svq1_pmv *pmv[3]; int re...
17,176
qemu
7d1b0095bff7157e856d1d0e6c4295641ced2752
1
static inline TCGv gen_ld8u(TCGv addr, int index) { TCGv tmp = new_tmp(); tcg_gen_qemu_ld8u(tmp, addr, index); return tmp; }
17,177
qemu
982263ce714ffcc4c7c41a7b255bd29e093912fe
1
void replay_account_executed_instructions(void) { if (replay_mode == REPLAY_MODE_PLAY) { replay_mutex_lock(); if (replay_state.instructions_count > 0) { int count = (int)(replay_get_current_step() - replay_state.current_step); replay_state.instru...
17,178
FFmpeg
ddfa3751c092feaf1e080f66587024689dfe603c
1
static int decode_tile(J2kDecoderContext *s, J2kTile *tile) { int compno, reslevelno, bandno; int x, y, *src[4]; uint8_t *line; J2kT1Context t1; for (compno = 0; compno < s->ncomponents; compno++){ J2kComponent *comp = tile->comp + compno; J2kCodingStyle *codsty = tile->cod...
17,179
qemu
83898cce62ba25a473af6a164388105994481e9c
1
void boot_sector_test(void) { uint8_t signature_low; uint8_t signature_high; uint16_t signature; int i; /* Wait at most 90 seconds */ #define TEST_DELAY (1 * G_USEC_PER_SEC / 10) #define TEST_CYCLES MAX((90 * G_USEC_PER_SEC / TEST_DELAY), 1) /* Poll until code has run and modified m...
17,180
qemu
c170aad8b057223b1139d72e5ce7acceafab4fa9
1
int scsi_req_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf) { int rc; cmd->lba = -1; cmd->len = scsi_cdb_length(buf); switch (dev->type) { case TYPE_TAPE: rc = scsi_req_stream_xfer(cmd, dev, buf); break; case TYPE_MEDIUM_CHANGER: rc = scsi_req_me...
17,181
FFmpeg
125acd215250ead008938266efcacd56743f3a2a
0
static int graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx) { int ret; /* find supported formats from sub-filters, and merge along links */ if ((ret = query_formats(graph, log_ctx)) < 0) return ret; /* Once everything is merged, it's possible that we'll still have * m...
17,182
FFmpeg
69c23e6f33c38ebc03ce7f51fcb963deaff7383b
0
static int pred(float *in, float *tgt, int n) { int x, y; float *p1, *p2; double f0, f1, f2; float temp; if (in[n] == 0) return 0; if ((f0 = *in) <= 0) return 0; for (x=1 ; ; x++) { if (n < x) return 1; p1 = in + x; p2...
17,184
qemu
30e5210a706ca6b52cbefa8b71e40ae614ffd6e5
1
void watchdog_perform_action(void) { switch (watchdog_action) { case WDT_RESET: /* same as 'system_reset' in monitor */ qapi_event_send_watchdog(WATCHDOG_EXPIRATION_ACTION_RESET, &error_abort); qemu_system_reset_request(); break; case WDT_SHUTDOWN: /* sa...
17,185
qemu
0ddbd0536296f5a36c8f225edd4d14441be6b153
1
static void *spapr_create_fdt_skel(hwaddr initrd_base, hwaddr initrd_size, hwaddr kernel_size, bool little_endian, const char *kernel_cmdline, ...
17,186
FFmpeg
b6ee25e300420a3c98b78a1c2e983250ff065038
1
static inline struct rgbvec interp_trilinear(const LUT3DContext *lut3d, const struct rgbvec *s) { const struct rgbvec d = {s->r - PREV(s->r), s->g - PREV(s->g), s->b - PREV(s->b)}; const struct rgbvec c000 = lut3d->lut[PREV(s->r)][PREV(s->g)][PREV(s->b)]; co...
17,187
qemu
a80bf99fa3dd829ecea88b9bfb4f7cf146208f07
1
static void mux_chr_accept_input(CharDriverState *chr) { int m = chr->focus; MuxDriver *d = chr->opaque; while (d->prod != d->cons && d->chr_can_read[m] && d->chr_can_read[m](d->ext_opaque[m])) { d->chr_read[m](d->ext_opaque[m], &d->buffer[d->co...
17,188
FFmpeg
89b51b570daa80e6e3790fcd449fe61fc5574e07
1
static int ogg_read_close(AVFormatContext *s) { struct ogg *ogg = s->priv_data; int i; for (i = 0; i < ogg->nstreams; i++) { av_free(ogg->streams[i].buf); av_free(ogg->streams[i].private); } av_free(ogg->streams); return 0; }
17,189
FFmpeg
1a48a57071df7756a92dee147acb2123cb92a799
1
static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) { Vp3DecodeContext *s = avctx->priv_data; int i, n, matrices, inter, plane; if (s->theora >= 0x030200) { n = get_bits(gb, 3); /* loop filter limit values table */ if (n) { for (i = 0; i < 64; ...
17,190
qemu
3e5feb6202149e8a963a33b911216e40d790f1d7
1
int64_t qcow2_alloc_bytes(BlockDriverState *bs, int size) { BDRVQcowState *s = bs->opaque; int64_t offset; size_t free_in_cluster; int ret; BLKDBG_EVENT(bs->file, BLKDBG_CLUSTER_ALLOC_BYTES); assert(size > 0 && size <= s->cluster_size); assert(!s->free_byte_offset || offset_into_cl...
17,192
qemu
6133b39f3c36623425a6ede9e89d93175fde15cd
1
void aio_co_schedule(AioContext *ctx, Coroutine *co) { trace_aio_co_schedule(ctx, co); QSLIST_INSERT_HEAD_ATOMIC(&ctx->scheduled_coroutines, co, co_scheduled_next); qemu_bh_schedule(ctx->co_schedule_bh);
17,194
qemu
4482e05cbbb7e50e476f6a9500cf0b38913bd939
1
static void xtensa_sim_init(MachineState *machine) { XtensaCPU *cpu = NULL; CPUXtensaState *env = NULL; ram_addr_t ram_size = machine->ram_size; const char *cpu_model = machine->cpu_model; const char *kernel_filename = machine->kernel_filename; int n; if (!cpu_model) { cpu...
17,196
qemu
0b57e287138728f72d88b06e69b970c5d745c44a
1
void cpu_physical_memory_write_rom(target_phys_addr_t addr, const uint8_t *buf, int len) { int l; uint8_t *ptr; target_phys_addr_t page; MemoryRegionSection *section; while (len > 0) { page = addr & TARGET_PAGE_MASK; l = (page + TARGET_PA...
17,197
FFmpeg
dcc39ee10e82833ce24aa57926c00ffeb1948198
0
av_cold void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx) { c->clear_block = clear_block_8_c; c->clear_blocks = clear_blocks_8_c; c->fill_block_tab[0] = fill_block16_c; c->fill_block_tab[1] = fill_block8_c; if (ARCH_ARM) ff_blockdsp_init_arm(c); if (ARCH_PPC) ...
17,198
FFmpeg
26f027fba1c5ab482fa2488fbe0fa36c8bb33b69
1
static void estimate_timings_from_bit_rate(AVFormatContext *ic) { int64_t filesize, duration; int i; AVStream *st; /* if bit_rate is already set, we believe it */ if (ic->bit_rate <= 0) { int bit_rate = 0; for(i=0;i<ic->nb_streams;i++) { st = ic->streams[i]; ...
17,200
FFmpeg
6fb2fd895e858ab93f46e656a322778ee181c307
1
AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask) { AVFilterBufferRef *ret = av_malloc(sizeof(AVFilterBufferRef)); if (!ret) return NULL; *ret = *ref; if (ref->type == AVMEDIA_TYPE_VIDEO) { ret->video = av_malloc(sizeof(AVFilterBufferRefVideoProps)); if (!...
17,201
FFmpeg
c41b9842ceac42bedfd74a7ba2d02add82f818a9
1
static int parse_playlist(AppleHTTPContext *c, const char *url, struct variant *var, AVIOContext *in) { int ret = 0, duration = 0, is_segment = 0, is_variant = 0, bandwidth = 0; enum KeyType key_type = KEY_NONE; uint8_t iv[16] = ""; int has_iv = 0; char key[MAX_URL_S...
17,202
FFmpeg
5836a5037ecbbd9b10ac85cdec5ff8cccb1177d0
0
static int integrate(hdcd_state_t *state, int *flag, const int32_t *samples, int count, int stride) { uint32_t bits = 0; int result = FFMIN(state->readahead, count); int i; *flag = 0; for (i = result - 1; i >= 0; i--) { bits |= (*samples & 1) << i; /* might be better as a conditiona...
17,204