--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
     /* FIXME how to correctly detect RLE ??? */
     if (avctx->height * istride == avpkt->size) { /* assume uncompressed */
         int linesize = av_image_get_linesize(avctx->pix_fmt, avctx->width, 0);
+        uint8_t *ptr = s->frame->data[0];
+        uint8_t *buf = avpkt->data + (avctx->height-1)*istride;
+        int i, j;
+        for (i = 0; i < avctx->height; i++) {
+            if (avctx->bits_per_coded_sample == 4) {
                 for (j = 0; j < avctx->width - 1; j += 2) {
                     ptr[j+0] = buf[j>>1] >> 4;
                     ptr[j+1] = buf[j>>1] & 0xF;

static int msrle_decode_frame(AVCodecContext *avctx,
                              void *data, int *got_frame,
                              AVPacket *avpkt)
{
    const uint8_t *buf = avpkt->data;
    int buf_size = avpkt->size;
    MsrleContext *s = avctx->priv_data;
    int istride = FFALIGN(avctx->width*avctx->bits_per_coded_sample, 32) / 8;
    int ret;
    s->buf = buf;
    s->size = buf_size;
    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
        return ret;
    if (avctx->bits_per_coded_sample > 1 && avctx->bits_per_coded_sample <= 8) {
        const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
        if (pal) {
            s->frame->palette_has_changed = 1;
            memcpy(s->pal, pal, AVPALETTE_SIZE);
        }
        /* make the palette available */
        memcpy(s->frame->data[1], s->pal, AVPALETTE_SIZE);
    }
    /* FIXME how to correctly detect RLE ??? */
    if (avctx->height * istride == avpkt->size) { /* assume uncompressed */
        int linesize = av_image_get_linesize(avctx->pix_fmt, avctx->width, 0);
        uint8_t *ptr = s->frame->data[0];
        uint8_t *buf = avpkt->data + (avctx->height-1)*istride;
        int i, j;
        for (i = 0; i < avctx->height; i++) {
            if (avctx->bits_per_coded_sample == 4) {
                for (j = 0; j < avctx->width - 1; j += 2) {
                    ptr[j+0] = buf[j>>1] >> 4;
                    ptr[j+1] = buf[j>>1] & 0xF;
                }
                if (avctx->width & 1)
                    ptr[j+0] = buf[j>>1] >> 4;
            } else {
                memcpy(ptr, buf, linesize);
            }
            buf -= istride;
            ptr += s->frame->linesize[0];
        }
    } else {
        bytestream2_init(&s->gb, buf, buf_size);
        ff_msrle_decode(avctx, (AVPicture*)s->frame, avctx->bits_per_coded_sample, &s->gb);
    }
    if ((ret = av_frame_ref(data, s->frame)) < 0)
        return ret;
    *got_frame      = 1;
    /* report that the buffer was completely consumed */
    return buf_size;
}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void FUNCC(pred4x4_129_dc)(uint8_t *_src, const uint8_t *topright, int _stride){

     pixel *src = (pixel*)_src;
+
     int stride = _stride/sizeof(pixel);

     ((pixel4*)(src+0*stride))[0]=

static void FUNCC(pred4x4_129_dc)(uint8_t *_src, const uint8_t *topright, int _stride){

    pixel *src = (pixel*)_src;

    int stride = _stride/sizeof(pixel);

    ((pixel4*)(src+0*stride))[0]=

    ((pixel4*)(src+1*stride))[0]=

    ((pixel4*)(src+2*stride))[0]=

    ((pixel4*)(src+3*stride))[0]= PIXEL_SPLAT_X4((1<<(BIT_DEPTH-1))+1);

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
 static int xen_pt_cmd_reg_write(XenPCIPassthroughState *s, XenPTReg *cfg_entry,
+
                                 uint16_t *val, uint16_t dev_value,

+                                uint16_t valid_mask)
+
+{

     XenPTRegInfo *reg = cfg_entry->reg;

+    uint16_t writable_mask = 0;

     uint16_t throughable_mask = 0;

@@ -17,7 +17,7 @@

     if (s->is_virtfn) {
+
         emu_mask |= PCI_COMMAND_MEMORY;

     }

static int xen_pt_cmd_reg_write(XenPCIPassthroughState *s, XenPTReg *cfg_entry,

                                uint16_t *val, uint16_t dev_value,

                                uint16_t valid_mask)

{

    XenPTRegInfo *reg = cfg_entry->reg;

    uint16_t writable_mask = 0;

    uint16_t throughable_mask = 0;

    uint16_t emu_mask = reg->emu_mask;

    if (s->is_virtfn) {

        emu_mask |= PCI_COMMAND_MEMORY;

    }

    /* modify emulate register */

    writable_mask = ~reg->ro_mask & valid_mask;

    cfg_entry->data = XEN_PT_MERGE_VALUE(*val, cfg_entry->data, writable_mask);

    /* create value for writing to I/O device register */

    throughable_mask = ~emu_mask & valid_mask;

    if (*val & PCI_COMMAND_INTX_DISABLE) {

        throughable_mask |= PCI_COMMAND_INTX_DISABLE;

    } else {

        if (s->machine_irq) {

            throughable_mask |= PCI_COMMAND_INTX_DISABLE;

        }

    }

    *val = XEN_PT_MERGE_VALUE(*val, dev_value, throughable_mask);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -10,7 +10,7 @@

     for (x = 0; x < image->numcomps; x++)

+        adjust[x] = FFMAX(FFMIN(av_pix_fmt_desc_get(picture->format)->comp[x].depth_minus1 + 1 - image->comps[x].prec, 8), 0);

static inline void libopenjpeg_copyto16(AVFrame *picture, opj_image_t *image) {

    int *comp_data;

    uint16_t *img_ptr;

    int index, x, y;

    int adjust[4];

    for (x = 0; x < image->numcomps; x++)

        adjust[x] = FFMAX(FFMIN(av_pix_fmt_desc_get(picture->format)->comp[x].depth_minus1 + 1 - image->comps[x].prec, 8), 0);

    for (index = 0; index < image->numcomps; index++) {

        comp_data = image->comps[index].data;

        for (y = 0; y < image->comps[index].h; y++) {

            img_ptr = (uint16_t*) (picture->data[index] + y * picture->linesize[index]);

            for (x = 0; x < image->comps[index].w; x++) {

                *img_ptr = 0x8000 * image->comps[index].sgnd + (*comp_data << adjust[index]);

                img_ptr++;

                comp_data++;

            }

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void gen_write_xer(TCGv src)
+
 {

     tcg_gen_andi_tl(cpu_xer, src,

static void gen_write_xer(TCGv src)

{

    tcg_gen_andi_tl(cpu_xer, src,

                    ~((1u << XER_SO) | (1u << XER_OV) | (1u << XER_CA)));

    tcg_gen_extract_tl(cpu_so, src, XER_SO, 1);

    tcg_gen_extract_tl(cpu_ov, src, XER_OV, 1);

    tcg_gen_extract_tl(cpu_ca, src, XER_CA, 1);

}


--- a/source.c
+++ b/source.c
@@ -12,7 +12,7 @@

         fdctrl->msr |= FD_MSR_RQM | FD_MSR_DIO;

+        fdctrl->status0 = status0;

         return;

static void fdctrl_raise_irq(FDCtrl *fdctrl, uint8_t status0)

{

    /* Sparc mutation */

    if (fdctrl->sun4m && (fdctrl->msr & FD_MSR_CMDBUSY)) {

        /* XXX: not sure */

        fdctrl->msr &= ~FD_MSR_CMDBUSY;

        fdctrl->msr |= FD_MSR_RQM | FD_MSR_DIO;

        fdctrl->status0 = status0;

        return;

    }

    if (!(fdctrl->sra & FD_SRA_INTPEND)) {

        qemu_set_irq(fdctrl->irq, 1);

        fdctrl->sra |= FD_SRA_INTPEND;

    }

    if (status0 & FD_SR0_SEEK) {

        FDrive *cur_drv;

        /* A seek clears the disk change line (if a disk is inserted) */

        cur_drv = get_cur_drv(fdctrl);

        if (cur_drv->max_track) {

            cur_drv->media_changed = 0;

        }

    }

    fdctrl->reset_sensei = 0;

    fdctrl->status0 = status0;

    FLOPPY_DPRINTF("Set interrupt status to 0x%02x\n", fdctrl->status0);

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+av_cold int ff_vp8_decode_init(AVCodecContext *avctx)

 {

     VP8Context *s = avctx->priv_data;

     int ret;
+
+

     s->avctx = avctx;

av_cold int ff_vp8_decode_init(AVCodecContext *avctx)

{

    VP8Context *s = avctx->priv_data;

    int ret;

    s->avctx = avctx;

    avctx->pix_fmt = AV_PIX_FMT_YUV420P;

    avctx->internal->allocate_progress = 1;

    ff_videodsp_init(&s->vdsp, 8);

    ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP8, 8, 1);

    ff_vp8dsp_init(&s->vp8dsp);

    if ((ret = vp8_init_frames(s)) < 0) {

        ff_vp8_decode_free(avctx);

        return ret;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static av_cold int sunrast_encode_close(AVCodecContext *avctx)

 {
+
+    av_frame_free(&avctx->coded_frame);

     return 0;

static av_cold int sunrast_encode_close(AVCodecContext *avctx)

{

    av_frame_free(&avctx->coded_frame);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void ff_put_h264_qpel16_mc13_msa(uint8_t *dst, const uint8_t *src,
+
+                                 ptrdiff_t stride)

 {

void ff_put_h264_qpel16_mc13_msa(uint8_t *dst, const uint8_t *src,

                                 ptrdiff_t stride)

{

    avc_luma_hv_qrt_16w_msa(src + stride - 2,

                            src - (stride * 2), stride, dst, stride, 16);

}


--- a/source.c
+++ b/source.c
@@ -5,10 +5,10 @@
 {

     uint64_t reqid = request_id++;
+
+    int ret = bdrv_co_preadv(bs->file->bs, offset, bytes, qiov, flags);
+
+    block_request_create(reqid, bs, qemu_coroutine_self());

     qemu_coroutine_yield();

static int coroutine_fn blkreplay_co_preadv(BlockDriverState *bs,

    uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags)

{

    uint64_t reqid = request_id++;

    int ret = bdrv_co_preadv(bs->file->bs, offset, bytes, qiov, flags);

    block_request_create(reqid, bs, qemu_coroutine_self());

    qemu_coroutine_yield();

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 Object *object_dynamic_cast(Object *obj, const char *typename)
+
 {

     if (object_class_dynamic_cast(object_get_class(obj), typename)) {

Object *object_dynamic_cast(Object *obj, const char *typename)

{

    if (object_class_dynamic_cast(object_get_class(obj), typename)) {

        return obj;

    }

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
         opi = STW, opx = STWX;

     } else {
+
+        opi = STD, opx = STDX;
+
+    }
+
     tcg_out_mem_long(s, opi, opx, arg, arg1, arg2);

 }

static inline void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg,

                              TCGReg arg1, intptr_t arg2)

{

    int opi, opx;

    assert(TCG_TARGET_REG_BITS == 64 || type == TCG_TYPE_I32);

    if (type == TCG_TYPE_I32) {

        opi = STW, opx = STWX;

    } else {

        opi = STD, opx = STDX;

    }

    tcg_out_mem_long(s, opi, opx, arg, arg1, arg2);

}


--- a/source.c
+++ b/source.c
@@ -2,9 +2,9 @@

                                 const struct iovec *iov, int iovcnt,

+                                size_t iovoff, bool strip_vlan)

+{

     uint16_t tci = 0;

void net_rx_pkt_attach_iovec(struct NetRxPkt *pkt,

                                const struct iovec *iov, int iovcnt,

                                size_t iovoff, bool strip_vlan)

{

    uint16_t tci = 0;

    uint16_t ploff = iovoff;

    assert(pkt);

    pkt->vlan_stripped = false;

    if (strip_vlan) {

        pkt->vlan_stripped = eth_strip_vlan(iov, iovcnt, iovoff, pkt->ehdr_buf,

                                            &ploff, &tci);

    }

    pkt->tci = tci;

    net_rx_pkt_pull_data(pkt, iov, iovcnt, ploff);

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     int ady = FFABS(dy);

     int sy  = dy < 0 ? -1 : 1;
+
     buf[x0] = ff_vorbis_floor1_inverse_db_table[y0];

     if (ady*2 <= adx) { // optimized common case

static void render_line(int x0, int y0, int x1, int y1, float *buf)

{

    int dy  = y1 - y0;

    int adx = x1 - x0;

    int ady = FFABS(dy);

    int sy  = dy < 0 ? -1 : 1;

    buf[x0] = ff_vorbis_floor1_inverse_db_table[y0];

    if (ady*2 <= adx) { // optimized common case

        render_line_unrolled(x0, y0, x1, sy, ady, adx, buf);

    } else {

        int base = dy / adx;

        int x    = x0;

        int y    = y0;

        int err  = -adx;

        ady -= FFABS(base) * adx;

        while (++x < x1) {

            y += base;

            err += ady;

            if (err >= 0) {

                err -= adx;

                y   += sy;

            }

            buf[x] = ff_vorbis_floor1_inverse_db_table[y];

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     err = mov_read_default(c, pb, atom);

     /* we parsed the 'moov' atom, we can terminate the parsing as soon as we find the 'mdat' */
+
+    /* so we don't parse the whole file if over a network */
+
+    c->found_moov=1;
+
     if(c->found_mdat)

         return 1; /* found both, just go */

static int mov_read_moov(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)

{

    int err;

    err = mov_read_default(c, pb, atom);

    /* we parsed the 'moov' atom, we can terminate the parsing as soon as we find the 'mdat' */

    /* so we don't parse the whole file if over a network */

    c->found_moov=1;

    if(c->found_mdat)

        return 1; /* found both, just go */

    return 0; /* now go for mdat */

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void HELPER(wer)(CPUXtensaState *env, uint32_t data, uint32_t addr)

+{
+
     address_space_stl(env->address_space_er, addr, data,

                       (MemTxAttrs){0}, NULL);

void HELPER(wer)(CPUXtensaState *env, uint32_t data, uint32_t addr)

{

    address_space_stl(env->address_space_er, addr, data,

                      (MemTxAttrs){0}, NULL);

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
 {

     unsigned int sclp_active_selection_mask;
+
+    unsigned int sclp_cp_receive_mask;
+
+
+
     ReadEventData *red = (ReadEventData *) sccb;

static void read_event_data(SCLPEventFacility *ef, SCCB *sccb)

{

    unsigned int sclp_active_selection_mask;

    unsigned int sclp_cp_receive_mask;

    ReadEventData *red = (ReadEventData *) sccb;

    if (be16_to_cpu(sccb->h.length) != SCCB_SIZE) {

        sccb->h.response_code = cpu_to_be16(SCLP_RC_INSUFFICIENT_SCCB_LENGTH);

        goto out;

    }

    sclp_cp_receive_mask = ef->receive_mask;

    /* get active selection mask */

    switch (sccb->h.function_code) {

    case SCLP_UNCONDITIONAL_READ:

        sclp_active_selection_mask = sclp_cp_receive_mask;

        break;

    case SCLP_SELECTIVE_READ:

        if (!(sclp_cp_receive_mask & be32_to_cpu(red->mask))) {

            sccb->h.response_code =

                    cpu_to_be16(SCLP_RC_INVALID_SELECTION_MASK);

            goto out;

        }

        sclp_active_selection_mask = be32_to_cpu(red->mask);

        break;

    default:

        sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_FUNCTION);

        goto out;

    }

    sccb->h.response_code = cpu_to_be16(

            handle_sccb_read_events(ef, sccb, sclp_active_selection_mask));

out:

    return;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 void virtio_scsi_common_realize(DeviceState *dev, Error **errp,

+                                HandleOutput ctrl, HandleOutput evt,
+
+                                HandleOutput cmd)
+
+{

     VirtIODevice *vdev = VIRTIO_DEVICE(dev);

void virtio_scsi_common_realize(DeviceState *dev, Error **errp,

                                HandleOutput ctrl, HandleOutput evt,

                                HandleOutput cmd)

{

    VirtIODevice *vdev = VIRTIO_DEVICE(dev);

    VirtIOSCSICommon *s = VIRTIO_SCSI_COMMON(dev);

    int i;

    virtio_init(vdev, "virtio-scsi", VIRTIO_ID_SCSI,

                sizeof(VirtIOSCSIConfig));

    if (s->conf.num_queues <= 0 || s->conf.num_queues > VIRTIO_PCI_QUEUE_MAX) {

        error_setg(errp, "Invalid number of queues (= %" PRId32 "), "

                         "must be a positive integer less than %d.",

                   s->conf.num_queues, VIRTIO_PCI_QUEUE_MAX);

        virtio_cleanup(vdev);

        return;

    }

    s->cmd_vqs = g_malloc0(s->conf.num_queues * sizeof(VirtQueue *));

    s->sense_size = VIRTIO_SCSI_SENSE_SIZE;

    s->cdb_size = VIRTIO_SCSI_CDB_SIZE;

    s->ctrl_vq = virtio_add_queue(vdev, VIRTIO_SCSI_VQ_SIZE,

                                  ctrl);

    s->event_vq = virtio_add_queue(vdev, VIRTIO_SCSI_VQ_SIZE,

                                   evt);

    for (i = 0; i < s->conf.num_queues; i++) {

        s->cmd_vqs[i] = virtio_add_queue(vdev, VIRTIO_SCSI_VQ_SIZE,

                                         cmd);

    }

    if (s->conf.iothread) {

        virtio_scsi_set_iothread(VIRTIO_SCSI(s), s->conf.iothread);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
 iscsi_readv_writev_bh_cb(void *p)

 {
+
     IscsiAIOCB *acb = p;

+
     qemu_bh_delete(acb->bh);

+
+
     if (!acb->canceled) {

         acb->common.cb(acb->common.opaque, acb->status);

iscsi_readv_writev_bh_cb(void *p)

{

    IscsiAIOCB *acb = p;

    qemu_bh_delete(acb->bh);

    if (!acb->canceled) {

        acb->common.cb(acb->common.opaque, acb->status);

    }

    qemu_aio_release(acb);

    if (acb->canceled) {

        return;

    }

    scsi_free_scsi_task(acb->task);

    acb->task = NULL;

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     if (done_init)

         return;
+
+
+
+    cpu_env = tcg_global_reg_new(TCG_TYPE_PTR, TCG_AREG0, "env");
+

     p = cpu_reg_names;

static void alpha_translate_init(void)

{

    int i;

    char *p;

    static int done_init = 0;

    if (done_init)

        return;

    cpu_env = tcg_global_reg_new(TCG_TYPE_PTR, TCG_AREG0, "env");

    p = cpu_reg_names;

    for (i = 0; i < 31; i++) {

        sprintf(p, "ir%d", i);

        cpu_ir[i] = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0,

                                       offsetof(CPUState, ir[i]), p);

        p += (i < 10) ? 4 : 5;

        sprintf(p, "fir%d", i);

        cpu_fir[i] = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0,

                                        offsetof(CPUState, fir[i]), p);

        p += (i < 10) ? 5 : 6;

    }

    cpu_pc = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0,

                                offsetof(CPUState, pc), "pc");

    cpu_lock = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0,

                                  offsetof(CPUState, lock), "lock");

    /* register helpers */

#undef DEF_HELPER

#define DEF_HELPER(ret, name, params) tcg_register_helper(name, #name);

#include "helper.h"

    done_init = 1;

}


--- a/source.c
+++ b/source.c
@@ -63,11 +63,11 @@

 done:
+
+    if (!r->req.io_canceled) {
+
+        scsi_req_unref(&r->req);
+
     }

 }

static void scsi_write_complete(void * opaque, int ret)

{

    SCSIDiskReq *r = (SCSIDiskReq *)opaque;

    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);

    uint32_t n;

    if (r->req.aiocb != NULL) {

        r->req.aiocb = NULL;

        block_acct_done(bdrv_get_stats(s->qdev.conf.bs), &r->acct);

    }

    if (r->req.io_canceled) {

        goto done;

    }

    if (ret < 0) {

        if (scsi_handle_rw_error(r, -ret)) {

            goto done;

        }

    }

    n = r->qiov.size / 512;

    r->sector += n;

    r->sector_count -= n;

    if (r->sector_count == 0) {

        scsi_write_do_fua(r);

        return;

    } else {

        scsi_init_iovec(r, SCSI_DMA_BUF_SIZE);

        DPRINTF("Write complete tag=0x%x more=%zd\n", r->req.tag, r->qiov.size);

        scsi_req_data(&r->req, r->qiov.size);

    }

done:

    if (!r->req.io_canceled) {

        scsi_req_unref(&r->req);

    }

}


--- a/source.c
+++ b/source.c
@@ -2,11 +2,11 @@

                         BlockDriverState *value)

+{
+
+    Error *err = NULL;
+
+    const char *bdrv_name = value ? bdrv_get_device_name(value) : "";

     object_property_set_str(OBJECT(dev), bdrv_name,

int qdev_prop_set_drive(DeviceState *dev, const char *name,

                        BlockDriverState *value)

{

    Error *err = NULL;

    const char *bdrv_name = value ? bdrv_get_device_name(value) : "";

    object_property_set_str(OBJECT(dev), bdrv_name,

                            name, &err);

    if (err) {

        qerror_report_err(err);

        error_free(err);

        return -1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void check_suspend_mode(GuestSuspendMode mode, Error **errp)

 {
+
     SYSTEM_POWER_CAPABILITIES sys_pwr_caps;

     Error *local_err = NULL;

static void check_suspend_mode(GuestSuspendMode mode, Error **errp)

{

    SYSTEM_POWER_CAPABILITIES sys_pwr_caps;

    Error *local_err = NULL;

    if (error_is_set(errp)) {

        return;

    }

    ZeroMemory(&sys_pwr_caps, sizeof(sys_pwr_caps));

    if (!GetPwrCapabilities(&sys_pwr_caps)) {

        error_set(&local_err, QERR_QGA_COMMAND_FAILED,

                  "failed to determine guest suspend capabilities");

        goto out;

    }

    switch (mode) {

    case GUEST_SUSPEND_MODE_DISK:

        if (!sys_pwr_caps.SystemS4) {

            error_set(&local_err, QERR_QGA_COMMAND_FAILED,

                      "suspend-to-disk not supported by OS");

        }

        break;

    case GUEST_SUSPEND_MODE_RAM:

        if (!sys_pwr_caps.SystemS3) {

            error_set(&local_err, QERR_QGA_COMMAND_FAILED,

                      "suspend-to-ram not supported by OS");

        }

        break;

    default:

        error_set(&local_err, QERR_INVALID_PARAMETER_VALUE, "mode",

                  "GuestSuspendMode");

    }

out:

    if (local_err) {

        error_propagate(errp, local_err);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+int check_intra_pred8x8_mode_emuedge(int mode, int mb_x, int mb_y)

 {
+
+    switch (mode) {
+
     case DC_PRED8x8:

         return check_dc_pred8x8_mode(mode, mb_x, mb_y);

int check_intra_pred8x8_mode_emuedge(int mode, int mb_x, int mb_y)

{

    switch (mode) {

    case DC_PRED8x8:

        return check_dc_pred8x8_mode(mode, mb_x, mb_y);

    case VERT_PRED8x8:

        return !mb_y ? DC_127_PRED8x8 : mode;

    case HOR_PRED8x8:

        return !mb_x ? DC_129_PRED8x8 : mode;

    case PLANE_PRED8x8: /* TM */

        return check_tm_pred8x8_mode(mode, mb_x, mb_y);

    }

    return mode;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void fill_gv_table(int table[256 + 2*YUVRGB_TABLE_HEADROOM], const int elemsize, const int inc)

 {

static void fill_gv_table(int table[256 + 2*YUVRGB_TABLE_HEADROOM], const int elemsize, const int inc)

{

    int i;

    int off    = -(inc >> 9);

    for (i = 0; i < 256 + 2*YUVRGB_TABLE_HEADROOM; i++) {

        int64_t cb = av_clip(i-YUVRGB_TABLE_HEADROOM, 0, 255)*inc;

        table[i] = elemsize * (off + (cb >> 16));

    }

}


--- a/source.c
+++ b/source.c
@@ -36,10 +36,10 @@
     visit_type_int64(v, NULL, &tail->value, &error_abort);
     tail = (int64List *)visit_next_list(v, (GenericList *)tail, sizeof(*res));
     g_assert(tail);
+    visit_type_int64(v, NULL, &tail->value, &error_abort);
+    g_assert_cmpint(tail->value, ==, 2);
+    tail = (int64List *)visit_next_list(v, (GenericList *)tail, sizeof(*res));
+    g_assert(tail);
+    visit_check_list(v, &err);
     error_free_or_abort(&err);
 }

static void test_visitor_in_intList(TestInputVisitorData *data,
                                    const void *unused)
{
    /* Note: the visitor *sorts* ranges *unsigned* */
    int64_t expect1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20 };
    int64_t expect2[] = { 32767, -32768, -32767 };
    int64_t expect3[] = { INT64_MAX, INT64_MIN };
    uint64_t expect4[] = { UINT64_MAX };
    Error *err = NULL;
    int64List *res = NULL;
    int64List *tail;
    Visitor *v;
    int64_t val;
    /* Valid lists */
    v = visitor_input_test_init(data, "1,2,0,2-4,20,5-9,1-8");
    check_ilist(v, expect1, ARRAY_SIZE(expect1));
    v = visitor_input_test_init(data, "32767,-32768--32767");
    check_ilist(v, expect2, ARRAY_SIZE(expect2));
    v = visitor_input_test_init(data,
                                "-9223372036854775808,9223372036854775807");
    check_ilist(v, expect3, ARRAY_SIZE(expect3));
    v = visitor_input_test_init(data, "18446744073709551615");
    check_ulist(v, expect4, ARRAY_SIZE(expect4));
    /* Empty list is invalid (weird) */
    v = visitor_input_test_init(data, "");
    visit_type_int64List(v, NULL, &res, &err);
    error_free_or_abort(&err);
    /* Not a list */
    v = visitor_input_test_init(data, "not an int list");
    visit_type_int64List(v, NULL, &res, &err);
    error_free_or_abort(&err);
    g_assert(!res);
    /* Unvisited list tail */
    v = visitor_input_test_init(data, "0,2-3");
    /* Would be simpler if the visitor genuinely supported virtual walks */
    visit_type_int64(v, NULL, &tail->value, &error_abort);
    tail = (int64List *)visit_next_list(v, (GenericList *)tail, sizeof(*res));
    g_assert(tail);
    visit_type_int64(v, NULL, &tail->value, &error_abort);
    g_assert_cmpint(tail->value, ==, 2);
    tail = (int64List *)visit_next_list(v, (GenericList *)tail, sizeof(*res));
    g_assert(tail);
    visit_check_list(v, &err);
    error_free_or_abort(&err);
}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void l2cap_channel_close(struct l2cap_instance_s *l2cap,
+
+                int cid, int source_cid)
+
+{

     struct l2cap_chan_s *ch = NULL;

static void l2cap_channel_close(struct l2cap_instance_s *l2cap,

                int cid, int source_cid)

{

    struct l2cap_chan_s *ch = NULL;

    /* According to Volume 3, section 6.1.1, pg 1048 of BT Core V2.0, a

     * connection in CLOSED state still responds with a L2CAP_DisconnectRsp

     * message on an L2CAP_DisconnectReq event.  */

    if (unlikely(cid < L2CAP_CID_ALLOC)) {

        l2cap_command_reject_cid(l2cap, l2cap->last_id, L2CAP_REJ_CID_INVAL,

                        cid, source_cid);

        return;

    }

    if (likely(cid >= L2CAP_CID_ALLOC && cid < L2CAP_CID_MAX))

        ch = l2cap->cid[cid];

    if (likely(ch)) {

        if (ch->remote_cid != source_cid) {

            fprintf(stderr, "%s: Ignoring a Disconnection Request with the "

                            "invalid SCID %04x.\n", __func__, source_cid);

            return;

        }

        l2cap->cid[cid] = NULL;

        ch->params.close(ch->params.opaque);

        g_free(ch);

    }

    l2cap_disconnection_response(l2cap, cid, source_cid);

}


--- a/source.c
+++ b/source.c
@@ -2,8 +2,8 @@

         int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,

+        BlockCompletionFunc *cb, void *opaque)
+
 {

     return bdrv_aio_rw_vector(bs, sector_num, qiov, nb_sectors, cb, opaque, 0);

static BlockAIOCB *bdrv_aio_readv_em(BlockDriverState *bs,

        int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,

        BlockCompletionFunc *cb, void *opaque)

{

    return bdrv_aio_rw_vector(bs, sector_num, qiov, nb_sectors, cb, opaque, 0);

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
 {

     avctx->coded_frame = av_frame_alloc();
+
+    if (!avctx->coded_frame)
+
+        return AVERROR(ENOMEM);
+

     avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;

static av_cold int pnm_encode_init(AVCodecContext *avctx)

{

    avctx->coded_frame = av_frame_alloc();

    if (!avctx->coded_frame)

        return AVERROR(ENOMEM);

    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;

    avctx->coded_frame->key_frame = 1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 QCryptoHmac *qcrypto_hmac_new(QCryptoHashAlgorithm alg,

                               const uint8_t *key, size_t nkey,
+
                               Error **errp)
+
 {

     QCryptoHmac *hmac;
@@ -13,7 +13,7 @@
     Error *err2 = NULL;

     QCryptoHmacDriver *drv = NULL;
+

 #ifdef CONFIG_AF_ALG

QCryptoHmac *qcrypto_hmac_new(QCryptoHashAlgorithm alg,

                              const uint8_t *key, size_t nkey,

                              Error **errp)

{

    QCryptoHmac *hmac;

    void *ctx = NULL;

    Error *err2 = NULL;

    QCryptoHmacDriver *drv = NULL;

#ifdef CONFIG_AF_ALG

    ctx = qcrypto_afalg_hmac_ctx_new(alg, key, nkey, &err2);

    if (ctx) {

        drv = &qcrypto_hmac_afalg_driver;

    }

#endif

    if (!ctx) {

        ctx = qcrypto_hmac_ctx_new(alg, key, nkey, errp);

        if (!ctx) {

            return NULL;

        }

        drv = &qcrypto_hmac_lib_driver;

        error_free(err2);

    }

    hmac = g_new0(QCryptoHmac, 1);

    hmac->alg = alg;

    hmac->opaque = ctx;

    hmac->driver = (void *)drv;

    return hmac;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static av_always_inline int get_dst_color_err(PaletteUseContext *s,

+                                              uint32_t c, int *er, int *eg, int *eb,
+
+                                              const enum color_search_method search_method)
+
+{

     const uint8_t a = c >> 24 & 0xff;

static av_always_inline int get_dst_color_err(PaletteUseContext *s,

                                              uint32_t c, int *er, int *eg, int *eb,

                                              const enum color_search_method search_method)

{

    const uint8_t a = c >> 24 & 0xff;

    const uint8_t r = c >> 16 & 0xff;

    const uint8_t g = c >>  8 & 0xff;

    const uint8_t b = c       & 0xff;

    const int dstx = color_get(s, c, a, r, g, b, search_method);

    const uint32_t dstc = s->palette[dstx];

    *er = r - (dstc >> 16 & 0xff);

    *eg = g - (dstc >>  8 & 0xff);

    *eb = b - (dstc       & 0xff);

    return dstx;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int can_safely_read(GetBitContext* gb, uint64_t bits) {

     return get_bits_left(gb) >= bits;
+
 }

static int can_safely_read(GetBitContext* gb, uint64_t bits) {

    return get_bits_left(gb) >= bits;

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
 static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length)

+{
+
     GetBitContext gb;
+
+    int i;

+

+    init_get_bits(&gb, src, length * 8);

static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length)

{

    GetBitContext gb;

    int i;

    init_get_bits(&gb, src, length * 8);

    for (i = 0; i < 3; i++) {

        if (read_len_table(s->len[i], &gb) < 0)

            return -1;

        if (ff_huffyuv_generate_bits_table(s->bits[i], s->len[i]) < 0)

            return -1;

        ff_free_vlc(&s->vlc[i]);

        init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1,

                 s->bits[i], 4, 4, 0);

    }

    generate_joint_tables(s);

    return (get_bits_count(&gb) + 7) / 8;

}


static int aiff_probe(AVProbeData *p)

{

    /* check file header */

    if (p->buf_size < 16)

        return 0;

    if (p->buf[0] == 'F' && p->buf[1] == 'O' &&

        p->buf[2] == 'R' && p->buf[3] == 'M' &&

        p->buf[8] == 'A' && p->buf[9] == 'I' &&

        p->buf[10] == 'F' && (p->buf[11] == 'F' || p->buf[11] == 'C'))

        return AVPROBE_SCORE_MAX;

    else

        return 0;

}


--- a/source.c
+++ b/source.c
@@ -2,11 +2,11 @@

 {

+    RBDAIOCB *acb = rcb->acb;
+
+    int64_t r;
+
+

     r = rcb->ret;

static void qemu_rbd_complete_aio(RADOSCB *rcb)

{

    RBDAIOCB *acb = rcb->acb;

    int64_t r;

    r = rcb->ret;

    if (acb->cmd == RBD_AIO_WRITE ||

        acb->cmd == RBD_AIO_DISCARD) {

        if (r < 0) {

            acb->ret = r;

            acb->error = 1;

        } else if (!acb->error) {

            acb->ret = rcb->size;

        }

    } else {

        if (r < 0) {

            memset(rcb->buf, 0, rcb->size);

            acb->ret = r;

            acb->error = 1;

        } else if (r < rcb->size) {

            memset(rcb->buf + r, 0, rcb->size - r);

            if (!acb->error) {

                acb->ret = rcb->size;

            }

        } else if (!acb->error) {

            acb->ret = r;

        }

    }

    /* Note that acb->bh can be NULL in case where the aio was cancelled */

    acb->bh = qemu_bh_new(rbd_aio_bh_cb, acb);

    qemu_bh_schedule(acb->bh);

    g_free(rcb);

}


--- a/source.c
+++ b/source.c
@@ -38,11 +38,11 @@

+    magic = ldl_be_p(buf);
+
+    request->flags  = lduw_be_p(buf + 4);
+
+    request->type   = lduw_be_p(buf + 6);

     request->handle = ldq_be_p(buf + 8);

static ssize_t nbd_receive_request(QIOChannel *ioc, NBDRequest *request)

{

    uint8_t buf[NBD_REQUEST_SIZE];

    uint32_t magic;

    ssize_t ret;

    ret = read_sync(ioc, buf, sizeof(buf), NULL);

    if (ret < 0) {

        return ret;

    }

    /* Request

       [ 0 ..  3]   magic   (NBD_REQUEST_MAGIC)

       [ 4 ..  5]   flags   (NBD_CMD_FLAG_FUA, ...)

       [ 6 ..  7]   type    (NBD_CMD_READ, ...)

       [ 8 .. 15]   handle

       [16 .. 23]   from

       [24 .. 27]   len

     */

    magic = ldl_be_p(buf);

    request->flags  = lduw_be_p(buf + 4);

    request->type   = lduw_be_p(buf + 6);

    request->handle = ldq_be_p(buf + 8);

    request->from   = ldq_be_p(buf + 16);

    request->len    = ldl_be_p(buf + 24);

    TRACE("Got request: { magic = 0x%" PRIx32 ", .flags = %" PRIx16

          ", .type = %" PRIx16 ", from = %" PRIu64 ", len = %" PRIu32 " }",

          magic, request->flags, request->type, request->from, request->len);

    if (magic != NBD_REQUEST_MAGIC) {

        LOG("invalid magic (got 0x%" PRIx32 ")", magic);

        return -EINVAL;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -16,10 +16,10 @@

     tcg_gen_movi_tl(cpu_gpr[rD(ctx->opcode)], 0);

+    gen_set_label(l2);
+
+    if (unlikely(Rc(ctx->opcode) != 0))
+
+        gen_set_Rc0(ctx, cpu_gpr[rD(ctx->opcode)]);

 }

static void gen_doz(DisasContext *ctx)

{

    int l1 = gen_new_label();

    int l2 = gen_new_label();

    tcg_gen_brcond_tl(TCG_COND_GE, cpu_gpr[rB(ctx->opcode)], cpu_gpr[rA(ctx->opcode)], l1);

    tcg_gen_sub_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rB(ctx->opcode)], cpu_gpr[rA(ctx->opcode)]);

    tcg_gen_br(l2);

    gen_set_label(l1);

    tcg_gen_movi_tl(cpu_gpr[rD(ctx->opcode)], 0);

    gen_set_label(l2);

    if (unlikely(Rc(ctx->opcode) != 0))

        gen_set_Rc0(ctx, cpu_gpr[rD(ctx->opcode)]);

}


--- a/source.c
+++ b/source.c
@@ -15,9 +15,9 @@
     }

     if (EXTERNAL_AVX(cpu_flags)) {
+
+        m->update_lls = ff_update_lls_avx;
+
+    }
+
 }

av_cold void ff_init_lls_x86(LLSModel *m)

{

    int cpu_flags = av_get_cpu_flags();

    if (EXTERNAL_SSE2(cpu_flags)) {

        m->update_lls = ff_update_lls_sse2;

        if (m->indep_count >= 4)

            m->evaluate_lls = ff_evaluate_lls_sse2;

    }

    if (EXTERNAL_AVX(cpu_flags)) {

        m->update_lls = ff_update_lls_avx;

    }

}


--- a/source.c
+++ b/source.c
@@ -2,7 +2,7 @@

     struct nbd_request *request)

+{

     int i = HANDLE_TO_INDEX(s, request->handle);

static void nbd_coroutine_end(NbdClientSession *s,

    struct nbd_request *request)

{

    int i = HANDLE_TO_INDEX(s, request->handle);

    s->recv_coroutine[i] = NULL;

    if (s->in_flight-- == MAX_NBD_REQUESTS) {

        qemu_co_mutex_unlock(&s->free_sema);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static void range_merge(Range *range1, Range *range2)
+
+{

+    if (range1->end < range2->end) {
+
         range1->end = range2->end;

     }

static void range_merge(Range *range1, Range *range2)

{

    if (range1->end < range2->end) {

        range1->end = range2->end;

    }

    if (range1->begin > range2->begin) {

        range1->begin = range2->begin;

    }

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                           void *hba_private)

 {
+
+    return d->info->alloc_req(d, tag, lun, hba_private);

 }

SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun,

                          void *hba_private)

{

    return d->info->alloc_req(d, tag, lun, hba_private);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void add_pixels_clamped4_c(const DCTELEM *block, uint8_t *restrict pixels,

+                          int line_size)

+{
+
+    int i;
+
     uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

static void add_pixels_clamped4_c(const DCTELEM *block, uint8_t *restrict pixels,

                          int line_size)

{

    int i;

    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

    /* read the pixels */

    for(i=0;i<4;i++) {

        pixels[0] = cm[pixels[0] + block[0]];

        pixels[1] = cm[pixels[1] + block[1]];

        pixels[2] = cm[pixels[2] + block[2]];

        pixels[3] = cm[pixels[3] + block[3]];

        pixels += line_size;

        block += 8;

    }

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
 {

     BlizzardState *s = (BlizzardState *) opaque;
+
+    DisplaySurface *surface = qemu_console_surface(s->con);
+
+
+
     blizzard_update_display(opaque);

     if (s && surface_data(surface)) {

static void blizzard_screen_dump(void *opaque, const char *filename,

                                 bool cswitch, Error **errp)

{

    BlizzardState *s = (BlizzardState *) opaque;

    DisplaySurface *surface = qemu_console_surface(s->con);

    blizzard_update_display(opaque);

    if (s && surface_data(surface)) {

        ppm_save(filename, surface, errp);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void read_table(AVFormatContext *avctx, AVStream *st,

                        int (*parse)(AVFormatContext *avctx, AVStream *st,

static void read_table(AVFormatContext *avctx, AVStream *st,

                       int (*parse)(AVFormatContext *avctx, AVStream *st,

                                    const char *name, int size))

{

    int count, i;

    AVIOContext *pb = avctx->pb;

    avio_skip(pb, 4);

    count = avio_rb32(pb);

    avio_skip(pb, 4);

    for (i = 0; i < count; i++) {

        char name[17];

        int size;

        avio_read(pb, name, 16);

        name[sizeof(name) - 1] = 0;

        size = avio_rb32(pb);

        if (parse(avctx, st, name, size) < 0) {

            avpriv_request_sample(avctx, "Variable %s", name);

            avio_skip(pb, size);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     MultiReqBuffer mrb = {

         .num_writes = 0,
+
+    };
+
+
+
     qemu_bh_delete(s->bh);

     s->bh = NULL;

static void virtio_blk_dma_restart_bh(void *opaque)

{

    VirtIOBlock *s = opaque;

    VirtIOBlockReq *req = s->rq;

    MultiReqBuffer mrb = {

        .num_writes = 0,

    };

    qemu_bh_delete(s->bh);

    s->bh = NULL;

    s->rq = NULL;

    while (req) {

        virtio_blk_handle_request(req, &mrb);

        req = req->next;

    }

    if (mrb.num_writes > 0) {

        do_multiwrite(s->bs, mrb.blkreq, mrb.num_writes);

    }

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     assert(src->size >= soffset);

     for (i = 0, done = 0; done < sbytes && i < src->niov; i++) {
+
+        if (soffset < siov[i].iov_len) {
+
+            size_t len = MIN(siov[i].iov_len - soffset, sbytes - done);
+
             qemu_iovec_add(dst, siov[i].iov_base + soffset, len);

             done += len;

void qemu_iovec_concat(QEMUIOVector *dst,

                       QEMUIOVector *src, size_t soffset, size_t sbytes)

{

    int i;

    size_t done;

    struct iovec *siov = src->iov;

    assert(dst->nalloc != -1);

    assert(src->size >= soffset);

    for (i = 0, done = 0; done < sbytes && i < src->niov; i++) {

        if (soffset < siov[i].iov_len) {

            size_t len = MIN(siov[i].iov_len - soffset, sbytes - done);

            qemu_iovec_add(dst, siov[i].iov_base + soffset, len);

            done += len;

            soffset = 0;

        } else {

            soffset -= siov[i].iov_len;

        }

    }

    /* return done; */

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void store_slice_c(uint8_t *dst, const int16_t *src,

                           int dst_stride, int src_stride,

static void store_slice_c(uint8_t *dst, const int16_t *src,

                          int dst_stride, int src_stride,

                          int width, int height, int log2_scale)

{

    int y, x;

#define STORE(pos) do {                                                     \

    temp = ((src[x + y * src_stride + pos] << log2_scale) + d[pos]) >> 8;   \

    if (temp & 0x100) temp = ~(temp >> 31);                                 \

    dst[x + y * dst_stride + pos] = temp;                                   \

} while (0)

    for (y = 0; y < height; y++) {

        const uint8_t *d = dither[y&7];

        for (x = 0; x < width; x += 8) {

            int temp;

            STORE(0);

            STORE(1);

            STORE(2);

            STORE(3);

            STORE(4);

            STORE(5);

            STORE(6);

            STORE(7);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -6,14 +6,14 @@

+    blankbuf = g_malloc(512);

     tmpbuf = g_malloc(512);
+
     memset(blankbuf, 0xff, 512);

     for (; num > 0; num--, sec++) {
+
         if (s->blk_cur) {

             int erasesec = s->secs_cur + (sec >> 5);

static inline int onenand_erase(OneNANDState *s, int sec, int num)

{

    uint8_t *blankbuf, *tmpbuf;

    blankbuf = g_malloc(512);

    tmpbuf = g_malloc(512);

    memset(blankbuf, 0xff, 512);

    for (; num > 0; num--, sec++) {

        if (s->blk_cur) {

            int erasesec = s->secs_cur + (sec >> 5);

            if (blk_write(s->blk_cur, sec, blankbuf, 1) < 0) {

                goto fail;

            }

            if (blk_read(s->blk_cur, erasesec, tmpbuf, 1) < 0) {

                goto fail;

            }

            memcpy(tmpbuf + ((sec & 31) << 4), blankbuf, 1 << 4);

            if (blk_write(s->blk_cur, erasesec, tmpbuf, 1) < 0) {

                goto fail;

            }

        } else {

            if (sec + 1 > s->secs_cur) {

                goto fail;

            }

            memcpy(s->current + (sec << 9), blankbuf, 512);

            memcpy(s->current + (s->secs_cur << 9) + (sec << 4),

                   blankbuf, 1 << 4);

        }

    }

    g_free(tmpbuf);

    g_free(blankbuf);

    return 0;

fail:

    g_free(tmpbuf);

    g_free(blankbuf);

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -1,17 +1,17 @@
 static inline void RENAME(bgr32ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, int width)
+
+{
+
 	int i;
+
+        assert(src1 == src2);
+
+	for(i=0; i<width; i++)
+
+	{
+
+		const int a= ((uint32_t*)src1)[2*i+0];
+
 		const int e= ((uint32_t*)src1)[2*i+1];

 		const int l= (a&0xFF00FF) + (e&0xFF00FF);

static inline void RENAME(bgr32ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, int width)

{

	int i;

        assert(src1 == src2);

	for(i=0; i<width; i++)

	{

		const int a= ((uint32_t*)src1)[2*i+0];

		const int e= ((uint32_t*)src1)[2*i+1];

		const int l= (a&0xFF00FF) + (e&0xFF00FF);

		const int h= (a&0x00FF00) + (e&0x00FF00);

 		const int b=  l&0x3FF;

		const int g=  h>>8;

		const int r=  l>>16;

		dstU[i]= ((RU*r + GU*g + BU*b)>>(RGB2YUV_SHIFT+1)) + 128;

		dstV[i]= ((RV*r + GV*g + BV*b)>>(RGB2YUV_SHIFT+1)) + 128;

	}

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                                          size_t size)

 {
+
+    return tail->next;

 }

static GenericList *qmp_output_next_list(Visitor *v, GenericList *tail,

                                         size_t size)

{

    return tail->next;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void do_acpitable_option(const char *optarg)

+{
+
+    if (acpi_table_add(optarg) < 0) {

         fprintf(stderr, "Wrong acpi table provided\n");

static void do_acpitable_option(const char *optarg)

{

    if (acpi_table_add(optarg) < 0) {

        fprintf(stderr, "Wrong acpi table provided\n");

        exit(1);

    }

}


--- a/source.c
+++ b/source.c
@@ -12,7 +12,7 @@

     sigset_t set, oldset;

+    int i = 0;

static void *do_touch_pages(void *arg)

{

    MemsetThread *memset_args = (MemsetThread *)arg;

    char *addr = memset_args->addr;

    uint64_t numpages = memset_args->numpages;

    uint64_t hpagesize = memset_args->hpagesize;

    sigset_t set, oldset;

    int i = 0;

    /* unblock SIGBUS */

    sigemptyset(&set);

    sigaddset(&set, SIGBUS);

    pthread_sigmask(SIG_UNBLOCK, &set, &oldset);

    if (sigsetjmp(memset_args->env, 1)) {

        memset_thread_failed = true;

    } else {

        for (i = 0; i < numpages; i++) {

            memset(addr, 0, 1);

            addr += hpagesize;

        }

    }

    pthread_sigmask(SIG_SETMASK, &oldset, NULL);

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -4,14 +4,14 @@

     AVFilterContext *ctx = inlink->dst;

+    ChannelMapContext *s = ctx->priv;
+
     int i, err = 0;
+
     const char *channel_name;
+
     char layout_name[256];
+

     if (s->mode == MAP_PAIR_STR_INT || s->mode == MAP_PAIR_STR_STR) {

static int channelmap_config_input(AVFilterLink *inlink)

{

    AVFilterContext *ctx = inlink->dst;

    ChannelMapContext *s = ctx->priv;

    int i, err = 0;

    const char *channel_name;

    char layout_name[256];

    if (s->mode == MAP_PAIR_STR_INT || s->mode == MAP_PAIR_STR_STR) {

        for (i = 0; i < s->nch; i++) {

            s->map[i].in_channel_idx = av_get_channel_layout_channel_index(

                inlink->channel_layout, s->map[i].in_channel);

            if (s->map[i].in_channel_idx < 0) {

                channel_name = av_get_channel_name(s->map[i].in_channel);

                av_get_channel_layout_string(layout_name, sizeof(layout_name),

                                             0, inlink->channel_layout);

                av_log(ctx, AV_LOG_ERROR,

                       "input channel '%s' not available from input layout '%s'\n",

                       channel_name, layout_name);

                err = AVERROR(EINVAL);

            }

        }

    }

    return err;

}


--- a/source.c
+++ b/source.c
@@ -6,11 +6,11 @@

                            (uint32_t *)info->pict.data[1]);

+    gif_image_write_image(pb, 0, 0, info->width, info->height,
+
+                          info->pict.data[0], info->pict.linesize[0],
+
+                          PIX_FMT_PAL8);

     put_byte(pb, 0x3b);

int gif_write(ByteIOContext *pb, AVImageInfo *info)

{

    gif_image_write_header(pb, info->width, info->height,

                           (uint32_t *)info->pict.data[1]);

    gif_image_write_image(pb, 0, 0, info->width, info->height,

                          info->pict.data[0], info->pict.linesize[0],

                          PIX_FMT_PAL8);

    put_byte(pb, 0x3b);

    put_flush_packet(pb);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
 {

     RTSPState *rt = s->priv_data;
+
     int ret;

static int rtsp_read_header(AVFormatContext *s,

                            AVFormatParameters *ap)

{

    RTSPState *rt = s->priv_data;

    int ret;

    ret = ff_rtsp_connect(s);

    if (ret)

        return ret;

    rt->real_setup_cache = av_mallocz(2 * s->nb_streams * sizeof(*rt->real_setup_cache));

    if (!rt->real_setup_cache)

        return AVERROR(ENOMEM);

    rt->real_setup = rt->real_setup_cache + s->nb_streams * sizeof(*rt->real_setup);

    if (ap->initial_pause) {

         /* do not start immediately */

    } else {

         if (rtsp_read_play(s) < 0) {

            ff_rtsp_close_streams(s);

            ff_rtsp_close_connections(s);

            return AVERROR_INVALIDDATA;

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+void usb_packet_set_state(USBPacket *p, USBPacketState state)

 {

     static const char *name[] = {
+
         [USB_PACKET_UNDEFINED] = "undef",

         [USB_PACKET_SETUP]     = "setup",

void usb_packet_set_state(USBPacket *p, USBPacketState state)

{

    static const char *name[] = {

        [USB_PACKET_UNDEFINED] = "undef",

        [USB_PACKET_SETUP]     = "setup",

        [USB_PACKET_QUEUED]    = "queued",

        [USB_PACKET_ASYNC]     = "async",

        [USB_PACKET_COMPLETE]  = "complete",

        [USB_PACKET_CANCELED]  = "canceled",

    };

    USBDevice *dev = p->ep->dev;

    USBBus *bus = usb_bus_from_device(dev);

    trace_usb_packet_state_change(bus->busnr, dev->port->path, p->ep->nr,

                                  p, name[p->state], name[state]);

    p->state = state;

}


--- a/source.c
+++ b/source.c
@@ -28,11 +28,11 @@

     cli = g_strdup_printf("%s create -f %s %s %uM", abs_path,

+                          fmt, file, size_mb);
+
+    ret = g_spawn_command_line_sync(cli, &out, &out2, &rc, &err);
+
+    if (err) {

         fprintf(stderr, "%s\n", err->message);

void mkimg(const char *file, const char *fmt, unsigned size_mb)

{

    gchar *cli;

    bool ret;

    int rc;

    GError *err = NULL;

    char *qemu_img_path;

    gchar *out, *out2;

    char *abs_path;

    qemu_img_path = getenv("QTEST_QEMU_IMG");

    abs_path = realpath(qemu_img_path, NULL);

    assert(qemu_img_path);

    cli = g_strdup_printf("%s create -f %s %s %uM", abs_path,

                          fmt, file, size_mb);

    ret = g_spawn_command_line_sync(cli, &out, &out2, &rc, &err);

    if (err) {

        fprintf(stderr, "%s\n", err->message);

        g_error_free(err);

    }

    g_assert(ret && !err);

    /* In glib 2.34, we have g_spawn_check_exit_status. in 2.12, we don't.

     * glib 2.43.91 implementation assumes that any non-zero is an error for

     * windows, but uses extra precautions for Linux. However,

     * 0 is only possible if the program exited normally, so that should be

     * sufficient for our purposes on all platforms, here. */

    if (rc) {

        fprintf(stderr, "qemu-img returned status code %d\n", rc);

    }

    g_assert(!rc);

    g_free(out);

    g_free(out2);

    g_free(cli);

    free(abs_path);

}


--- a/source.c
+++ b/source.c
@@ -1,24 +1,24 @@
+static int write_representation(AVFormatContext *s, AVStream *stream, int id,

                                 int output_width, int output_height,

                                 int output_sample_rate) {

+    AVDictionaryEntry *irange = av_dict_get(stream->metadata, INITIALIZATION_RANGE, NULL, 0);

     AVDictionaryEntry *cues_start = av_dict_get(stream->metadata, CUES_START, NULL, 0);
+
+    AVDictionaryEntry *cues_end = av_dict_get(stream->metadata, CUES_END, NULL, 0);

     AVDictionaryEntry *filename = av_dict_get(stream->metadata, FILENAME, NULL, 0);

+    AVDictionaryEntry *bandwidth = av_dict_get(stream->metadata, BANDWIDTH, NULL, 0);
+
+    if (!irange || cues_start == NULL || cues_end == NULL || filename == NULL ||
+
+        !bandwidth) {
+
+        return -1;

     }

static int write_representation(AVFormatContext *s, AVStream *stream, int id,

                                int output_width, int output_height,

                                int output_sample_rate) {

    AVDictionaryEntry *irange = av_dict_get(stream->metadata, INITIALIZATION_RANGE, NULL, 0);

    AVDictionaryEntry *cues_start = av_dict_get(stream->metadata, CUES_START, NULL, 0);

    AVDictionaryEntry *cues_end = av_dict_get(stream->metadata, CUES_END, NULL, 0);

    AVDictionaryEntry *filename = av_dict_get(stream->metadata, FILENAME, NULL, 0);

    AVDictionaryEntry *bandwidth = av_dict_get(stream->metadata, BANDWIDTH, NULL, 0);

    if (!irange || cues_start == NULL || cues_end == NULL || filename == NULL ||

        !bandwidth) {

        return -1;

    }

    avio_printf(s->pb, "<Representation id=\"%d\"", id);

    avio_printf(s->pb, " bandwidth=\"%s\"", bandwidth->value);

    if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO && output_width)

        avio_printf(s->pb, " width=\"%d\"", stream->codec->width);

    if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO && output_height)

        avio_printf(s->pb, " height=\"%d\"", stream->codec->height);

    if (stream->codec->codec_type = AVMEDIA_TYPE_AUDIO && output_sample_rate)

        avio_printf(s->pb, " audioSamplingRate=\"%d\"", stream->codec->sample_rate);

    avio_printf(s->pb, ">\n");

    avio_printf(s->pb, "<BaseURL>%s</BaseURL>\n", filename->value);

    avio_printf(s->pb, "<SegmentBase\n");

    avio_printf(s->pb, "  indexRange=\"%s-%s\">\n", cues_start->value, cues_end->value);

    avio_printf(s->pb, "<Initialization\n");

    avio_printf(s->pb, "  range=\"0-%s\" />\n", irange->value);

    avio_printf(s->pb, "</SegmentBase>\n");

    avio_printf(s->pb, "</Representation>\n");

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -34,11 +34,11 @@

         /* A device present at reset is ready to go, same as coldplugged */

+        drc->state = drck->ready_state;
+
+    } else {
+
+        drc->state = drck->empty_state;

     }

void spapr_drc_reset(sPAPRDRConnector *drc)

{

    sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);

    trace_spapr_drc_reset(spapr_drc_index(drc));

    g_free(drc->ccs);

    drc->ccs = NULL;

    /* immediately upon reset we can safely assume DRCs whose devices

     * are pending removal can be safely removed.

     */

    if (drc->unplug_requested) {

        spapr_drc_release(drc);

    }

    if (drc->dev) {

        /* A device present at reset is ready to go, same as coldplugged */

        drc->state = drck->ready_state;

    } else {

        drc->state = drck->empty_state;

    }

}


--- a/source.c
+++ b/source.c
@@ -2,15 +2,15 @@

 {

+    int l1, l2;
+
+
+
+    l1 = gen_new_label();

     l2 = gen_new_label();

+    tcg_gen_mov_tl(cpu_cc_src, src1);

     tcg_gen_mov_tl(cpu_cc_src2, src2);

static inline void gen_op_sdivx(TCGv dst, TCGv src1, TCGv src2)

{

    int l1, l2;

    l1 = gen_new_label();

    l2 = gen_new_label();

    tcg_gen_mov_tl(cpu_cc_src, src1);

    tcg_gen_mov_tl(cpu_cc_src2, src2);

    gen_trap_ifdivzero_tl(cpu_cc_src2);

    tcg_gen_brcondi_tl(TCG_COND_NE, cpu_cc_src, INT64_MIN, l1);

    tcg_gen_brcondi_tl(TCG_COND_NE, cpu_cc_src2, -1, l1);

    tcg_gen_movi_i64(dst, INT64_MIN);

    tcg_gen_br(l2);

    gen_set_label(l1);

    tcg_gen_div_i64(dst, cpu_cc_src, cpu_cc_src2);

    gen_set_label(l2);

}


--- a/source.c
+++ b/source.c
@@ -6,7 +6,7 @@

     int64_t sectors;

+

     if (!bdrv_is_read_only(bs)) {

static void init_blk_migration_it(void *opaque, BlockDriverState *bs)

{

    BlkMigDevState *bmds;

    int64_t sectors;

    if (!bdrv_is_read_only(bs)) {

        sectors = bdrv_nb_sectors(bs);

        if (sectors <= 0) {

            return;

        }

        bmds = g_malloc0(sizeof(BlkMigDevState));

        bmds->bs = bs;

        bmds->bulk_completed = 0;

        bmds->total_sectors = sectors;

        bmds->completed_sectors = 0;

        bmds->shared_base = block_mig_state.shared_base;

        alloc_aio_bitmap(bmds);

        error_setg(&bmds->blocker, "block device is in use by migration");

        bdrv_op_block_all(bs, bmds->blocker);

        bdrv_ref(bs);

        block_mig_state.total_sector_sum += sectors;

        if (bmds->shared_base) {

            DPRINTF("Start migration for %s with shared base image\n",

                    bs->device_name);

        } else {

            DPRINTF("Start full migration for %s\n", bs->device_name);

        }

        QSIMPLEQ_INSERT_TAIL(&block_mig_state.bmds_list, bmds, entry);

    }

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     if (!channel_subsys.sei_pending) {

         css_queue_crw(CRW_RSC_CSS, CRW_ERC_EVENT, 0, cssid);
+
+    }
+
     channel_subsys.sei_pending = true;

 }

void css_generate_css_crws(uint8_t cssid)

{

    if (!channel_subsys.sei_pending) {

        css_queue_crw(CRW_RSC_CSS, CRW_ERC_EVENT, 0, cssid);

    }

    channel_subsys.sei_pending = true;

}


--- a/source.c
+++ b/source.c
@@ -2,6 +2,6 @@

 {

+    bdrv_lock_medium(bs->file->bs, locked);

 }

static void raw_lock_medium(BlockDriverState *bs, bool locked)

{

    bdrv_lock_medium(bs->file->bs, locked);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 void qemu_sem_wait(QemuSemaphore *sem)

+{
+
+#if defined(__APPLE__) || defined(__NetBSD__)

     pthread_mutex_lock(&sem->lock);
+
     --sem->count;

     while (sem->count < 0) {

void qemu_sem_wait(QemuSemaphore *sem)

{

#if defined(__APPLE__) || defined(__NetBSD__)

    pthread_mutex_lock(&sem->lock);

    --sem->count;

    while (sem->count < 0) {

        pthread_cond_wait(&sem->cond, &sem->lock);

    }

    pthread_mutex_unlock(&sem->lock);

#else

    int rc;

    do {

        rc = sem_wait(&sem->sem);

    } while (rc == -1 && errno == EINTR);

    if (rc < 0) {

        error_exit(errno, __func__);

    }

#endif

}


--- a/source.c
+++ b/source.c
@@ -16,10 +16,10 @@

+    addr = start_addr;
+
+    phys_page_set(d, addr >> TARGET_PAGE_BITS, size >> TARGET_PAGE_BITS,
+
+                  section_index);

 }

static void register_multipage(AddressSpaceDispatch *d, MemoryRegionSection *section)

{

    target_phys_addr_t start_addr = section->offset_within_address_space;

    ram_addr_t size = section->size;

    target_phys_addr_t addr;

    uint16_t section_index = phys_section_add(section);

    assert(size);

    addr = start_addr;

    phys_page_set(d, addr >> TARGET_PAGE_BITS, size >> TARGET_PAGE_BITS,

                  section_index);

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
         return 0;

     }
+
+    qemu_put_be32(f, blen);
+
+    f->buf_index += blen;
+
     return blen + sizeof(int32_t);

 }

ssize_t qemu_put_compression_data(QEMUFile *f, const uint8_t *p, size_t size,

                                  int level)

{

    ssize_t blen = IO_BUF_SIZE - f->buf_index - sizeof(int32_t);

    if (blen < compressBound(size)) {

        return 0;

    }

    if (compress2(f->buf + f->buf_index + sizeof(int32_t), (uLongf *)&blen,

                  (Bytef *)p, size, level) != Z_OK) {

        error_report("Compress Failed!");

        return 0;

    }

    qemu_put_be32(f, blen);

    f->buf_index += blen;

    return blen + sizeof(int32_t);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void qio_channel_websock_handshake_send_res_ok(QIOChannelWebsock *ioc,

                                                       const char *key,
+
                                                       Error **errp)

 {

static void qio_channel_websock_handshake_send_res_ok(QIOChannelWebsock *ioc,

                                                      const char *key,

                                                      Error **errp)

{

    char combined_key[QIO_CHANNEL_WEBSOCK_CLIENT_KEY_LEN +

                      QIO_CHANNEL_WEBSOCK_GUID_LEN + 1];

    char *accept = NULL;

    char *date = qio_channel_websock_date_str();

    g_strlcpy(combined_key, key, QIO_CHANNEL_WEBSOCK_CLIENT_KEY_LEN + 1);

    g_strlcat(combined_key, QIO_CHANNEL_WEBSOCK_GUID,

              QIO_CHANNEL_WEBSOCK_CLIENT_KEY_LEN +

              QIO_CHANNEL_WEBSOCK_GUID_LEN + 1);

    /* hash and encode it */

    if (qcrypto_hash_base64(QCRYPTO_HASH_ALG_SHA1,

                            combined_key,

                            QIO_CHANNEL_WEBSOCK_CLIENT_KEY_LEN +

                            QIO_CHANNEL_WEBSOCK_GUID_LEN,

                            &accept,

                            errp) < 0) {

        qio_channel_websock_handshake_send_res_err(

            ioc, QIO_CHANNEL_WEBSOCK_HANDSHAKE_RES_SERVER_ERR);

        return;

    }

    qio_channel_websock_handshake_send_res(

        ioc, QIO_CHANNEL_WEBSOCK_HANDSHAKE_RES_OK, date, accept);

    g_free(date);

    g_free(accept);

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
 {

     unsigned int v = get_unary(gb, 1, 128);
+
+    return (v << k) | get_bits_long(gb, k);

 }

static int get_rice_un(GetBitContext *gb, int k)

{

    unsigned int v = get_unary(gb, 1, 128);

    return (v << k) | get_bits_long(gb, k);

}


--- a/source.c
+++ b/source.c
@@ -14,11 +14,11 @@

         /* All 32-bit XORs can be performed with 1 48-bit insn.  */

+        return 1;
+
+    }
+
+

     /* Look for negative values.  These are best to load with LGHI.  */

static int tcg_match_xori(TCGType type, tcg_target_long val)

{

    if ((s390_facilities & FACILITY_EXT_IMM) == 0) {

        return 0;

    }

    if (type == TCG_TYPE_I32) {

        /* All 32-bit XORs can be performed with 1 48-bit insn.  */

        return 1;

    }

    /* Look for negative values.  These are best to load with LGHI.  */

    if (val < 0 && val == (int32_t)val) {

        return 0;

    }

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -8,7 +8,7 @@

+    if (filter->filter->uninit)

         filter->filter->uninit(filter);

void avfilter_free(AVFilterContext *filter)

{

    int i;

    AVFilterLink *link;

    if (filter->filter->uninit)

        filter->filter->uninit(filter);

    for (i = 0; i < filter->input_count; i++) {

        if ((link = filter->inputs[i])) {

            if (link->src)

                link->src->outputs[link->srcpad - link->src->output_pads] = NULL;

            avfilter_formats_unref(&link->in_formats);

            avfilter_formats_unref(&link->out_formats);

        }

        av_freep(&link);

    }

    for (i = 0; i < filter->output_count; i++) {

        if ((link = filter->outputs[i])) {

            if (link->dst)

                link->dst->inputs[link->dstpad - link->dst->input_pads] = NULL;

            avfilter_formats_unref(&link->in_formats);

            avfilter_formats_unref(&link->out_formats);

        }

        av_freep(&link);

    }

    av_freep(&filter->name);

    av_freep(&filter->input_pads);

    av_freep(&filter->output_pads);

    av_freep(&filter->inputs);

    av_freep(&filter->outputs);

    av_freep(&filter->priv);

    av_free(filter);

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     if(pic->data[0] && pic->type!=FF_BUFFER_TYPE_SHARED){

         free_frame_buffer(s, pic);
+
     }

static void free_picture(MpegEncContext *s, Picture *pic){

    int i;

    if(pic->data[0] && pic->type!=FF_BUFFER_TYPE_SHARED){

        free_frame_buffer(s, pic);

    }

    av_freep(&pic->mb_var);

    av_freep(&pic->mc_mb_var);

    av_freep(&pic->mb_mean);

    av_freep(&pic->mbskip_table);

    av_freep(&pic->qscale_table);

    av_freep(&pic->mb_type_base);

    av_freep(&pic->dct_coeff);

    av_freep(&pic->pan_scan);

    pic->mb_type= NULL;

    for(i=0; i<2; i++){

        av_freep(&pic->motion_val_base[i]);

        av_freep(&pic->ref_index[i]);

    }

    if(pic->type == FF_BUFFER_TYPE_SHARED){

        for(i=0; i<4; i++){

            pic->base[i]=

            pic->data[i]= NULL;

        }

        pic->type= 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
 {

     USBNetState *s = DO_UPCAST(NICState, nc, nc)->opaque;
+
     struct rndis_packet_msg_type *msg;

static ssize_t usbnet_receive(VLANClientState *nc, const uint8_t *buf, size_t size)

{

    USBNetState *s = DO_UPCAST(NICState, nc, nc)->opaque;

    struct rndis_packet_msg_type *msg;

    if (is_rndis(s)) {

        msg = (struct rndis_packet_msg_type *) s->in_buf;

        if (!s->rndis_state == RNDIS_DATA_INITIALIZED)

            return -1;

        if (size + sizeof(struct rndis_packet_msg_type) > sizeof(s->in_buf))

            return -1;

        memset(msg, 0, sizeof(struct rndis_packet_msg_type));

        msg->MessageType = cpu_to_le32(RNDIS_PACKET_MSG);

        msg->MessageLength = cpu_to_le32(size + sizeof(struct rndis_packet_msg_type));

        msg->DataOffset = cpu_to_le32(sizeof(struct rndis_packet_msg_type) - 8);

        msg->DataLength = cpu_to_le32(size);

        /* msg->OOBDataOffset;

         * msg->OOBDataLength;

         * msg->NumOOBDataElements;

         * msg->PerPacketInfoOffset;

         * msg->PerPacketInfoLength;

         * msg->VcHandle;

         * msg->Reserved;

         */

        memcpy(msg + 1, buf, size);

        s->in_len = size + sizeof(struct rndis_packet_msg_type);

    } else {

        if (size > sizeof(s->in_buf))

            return -1;

        memcpy(s->in_buf, buf, size);

        s->in_len = size;

    }

    s->in_ptr = 0;

    return size;

}


--- a/source.c
+++ b/source.c
@@ -4,7 +4,7 @@

     GICv3CPUState *cs = icc_cs_from_env(env);

+    uint64_t value = 0;

     int i;

static uint64_t ich_elrsr_read(CPUARMState *env, const ARMCPRegInfo *ri)

{

    GICv3CPUState *cs = icc_cs_from_env(env);

    uint64_t value = 0;

    int i;

    for (i = 0; i < cs->num_list_regs; i++) {

        uint64_t lr = cs->ich_lr_el2[i];

        if ((lr & ICH_LR_EL2_STATE_MASK) == 0 &&

            ((lr & ICH_LR_EL2_HW) == 1 || (lr & ICH_LR_EL2_EOI) == 0)) {

            value |= (1 << i);

        }

    }

    trace_gicv3_ich_elrsr_read(gicv3_redist_affid(cs), value);

    return value;

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
+static int vf_open(vf_instance_t *vf, char *args)
+
+{
+
+        vf->config=config;
+
+        vf->query_format=query_format;
+
+        vf->put_image=put_image;
+
+        vf->uninit=uninit;

static int vf_open(vf_instance_t *vf, char *args)

{

        vf->config=config;

        vf->query_format=query_format;

        vf->put_image=put_image;

        vf->uninit=uninit;

        vf->priv = calloc(1, sizeof (struct vf_priv_s));

        vf->priv->skipline = 0;

        vf->priv->scalew = 1;

        vf->priv->scaleh = 2;

        if (args) sscanf(args, "%d:%d:%d", &vf->priv->skipline, &vf->priv->scalew, &vf->priv->scaleh);

        return 1;

}


--- a/source.c
+++ b/source.c
@@ -2,8 +2,8 @@

                                    uint8_t *dst,

+                                   int dstpitch, int bltwidth,int bltheight)
+
 {

 }

static void cirrus_bitblt_fill_nop(CirrusVGAState *s,

                                   uint8_t *dst,

                                   int dstpitch, int bltwidth,int bltheight)

{

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static bool write_header(FILE *fp)
+
+{
+
     static const TraceRecord header = {

         .event = HEADER_EVENT_ID,

static bool write_header(FILE *fp)

{

    static const TraceRecord header = {

        .event = HEADER_EVENT_ID,

        .timestamp_ns = HEADER_MAGIC,

        .x1 = HEADER_VERSION,

    };

    return fwrite(&header, sizeof header, 1, fp) == 1;

}


--- a/source.c
+++ b/source.c
@@ -36,10 +36,10 @@

     v7m_push(env, env->regs[3]);

+    v7m_push(env, env->regs[2]);
+
+    v7m_push(env, env->regs[1]);
+
+    v7m_push(env, env->regs[0]);

 }

static void v7m_push_stack(ARMCPU *cpu)

{

    /* Do the "set up stack frame" part of exception entry,

     * similar to pseudocode PushStack().

     */

    CPUARMState *env = &cpu->env;

    uint32_t xpsr = xpsr_read(env);

    /* Align stack pointer if the guest wants that */

    if ((env->regs[13] & 4) && (env->v7m.ccr & R_V7M_CCR_STKALIGN_MASK)) {

        env->regs[13] -= 4;

        xpsr |= XPSR_SPREALIGN;

    }

    /* Switch to the handler mode.  */

    v7m_push(env, xpsr);

    v7m_push(env, env->regs[15]);

    v7m_push(env, env->regs[14]);

    v7m_push(env, env->regs[12]);

    v7m_push(env, env->regs[3]);

    v7m_push(env, env->regs[2]);

    v7m_push(env, env->regs[1]);

    v7m_push(env, env->regs[0]);

}


--- a/source.c
+++ b/source.c
@@ -7,8 +7,8 @@
     int i, num_coeff;

+
+    /* Is it a skip block? */

     if (get_bits1(gb)) {

static int fic_decode_block(FICContext *ctx, GetBitContext *gb,

                            uint8_t *dst, int stride, int16_t *block, int *is_p)

{

    int i, num_coeff;

    /* Is it a skip block? */

    if (get_bits1(gb)) {

        *is_p = 1;

        return 0;

    }

    memset(block, 0, sizeof(*block) * 64);

    num_coeff = get_bits(gb, 7);

    if (num_coeff > 64)

        return AVERROR_INVALIDDATA;

    for (i = 0; i < num_coeff; i++)

        block[ff_zigzag_direct[i]] = get_se_golomb(gb) *

                                     ctx->qmat[ff_zigzag_direct[i]];

    fic_idct_put(dst, stride, block);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
                          unsigned size)

 {
+
+    HeathrowPICS *s = opaque;
+
+    HeathrowPIC *pic;
+
     unsigned int n;

     uint32_t value;

static uint64_t pic_read(void *opaque, target_phys_addr_t addr,

                         unsigned size)

{

    HeathrowPICS *s = opaque;

    HeathrowPIC *pic;

    unsigned int n;

    uint32_t value;

    n = ((addr & 0xfff) - 0x10) >> 4;

    if (n >= 2) {

        value = 0;

    } else {

        pic = &s->pics[n];

        switch(addr & 0xf) {

        case 0x0:

            value = pic->events;

            break;

        case 0x4:

            value = pic->mask;

            break;

        case 0xc:

            value = pic->levels;

            break;

        default:

            value = 0;

            break;

        }

    }

    PIC_DPRINTF("readl: " TARGET_FMT_plx " %u: %08x\n", addr, n, value);

    return value;

}


--- a/source.c
+++ b/source.c
@@ -1,18 +1,18 @@
 static int usb_net_handle_statusin(USBNetState *s, USBPacket *p)

+{
+
+    int ret = 8;

+

+    if (p->len < 8)
+
+        return USB_RET_STALL;
+
+

+    ((le32 *) p->data)[0] = cpu_to_le32(1);

     ((le32 *) p->data)[1] = cpu_to_le32(0);

static int usb_net_handle_statusin(USBNetState *s, USBPacket *p)

{

    int ret = 8;

    if (p->len < 8)

        return USB_RET_STALL;

    ((le32 *) p->data)[0] = cpu_to_le32(1);

    ((le32 *) p->data)[1] = cpu_to_le32(0);

    if (!s->rndis_resp.tqh_first)

        ret = USB_RET_NAK;

#ifdef TRAFFIC_DEBUG

    fprintf(stderr, "usbnet: interrupt poll len %u return %d", p->len, ret);

    {

        int i;

        fprintf(stderr, ":");

        for (i = 0; i < ret; i++) {

            if (!(i & 15))

                fprintf(stderr, "\n%04x:", i);

            fprintf(stderr, " %02x", p->data[i]);

        }

        fprintf(stderr, "\n\n");

    }

#endif

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@

     s->apicbase = 0xfee00000 |
+
+        (bsp ? MSR_IA32_APICBASE_BSP : 0) | MSR_IA32_APICBASE_ENABLE;
+
+
+
     apic_init_ipi(s);

static void apic_reset(void *opaque)

{

    APICState *s = opaque;

    int bsp = cpu_is_bsp(s->cpu_env);

    s->apicbase = 0xfee00000 |

        (bsp ? MSR_IA32_APICBASE_BSP : 0) | MSR_IA32_APICBASE_ENABLE;

    apic_init_ipi(s);

    if (bsp) {

        /*

         * LINT0 delivery mode on CPU #0 is set to ExtInt at initialization

         * time typically by BIOS, so PIC interrupt can be delivered to the

         * processor when local APIC is enabled.

         */

        s->lvt[APIC_LVT_LINT0] = 0x700;

    }

}


--- a/source.c
+++ b/source.c
@@ -39,11 +39,11 @@
         tcp_chr_disconnect(chr);

     }
+
+    object_unref(OBJECT(s->ioc));
+
+    s->ioc = QIO_CHANNEL(tioc);
+

     qio_channel_tls_handshake(tioc,

static void tcp_chr_tls_init(CharDriverState *chr)

{

    TCPCharDriver *s = chr->opaque;

    QIOChannelTLS *tioc;

    Error *err = NULL;

    if (s->is_listen) {

        tioc = qio_channel_tls_new_server(

            s->ioc, s->tls_creds,

            NULL, /* XXX Use an ACL */

            &err);

    } else {

        tioc = qio_channel_tls_new_client(

            s->ioc, s->tls_creds,

            s->addr->u.inet->host,

            &err);

    }

    if (tioc == NULL) {

        error_free(err);

        tcp_chr_disconnect(chr);

    }

    object_unref(OBJECT(s->ioc));

    s->ioc = QIO_CHANNEL(tioc);

    qio_channel_tls_handshake(tioc,

                              tcp_chr_tls_handshake,

                              chr,

                              NULL);

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
         .opaque = opaque,

     };
+
+
+
+    bdrv_replace_child(child, child_bs);
+

     return child;

BdrvChild *bdrv_root_attach_child(BlockDriverState *child_bs,

                                  const char *child_name,

                                  const BdrvChildRole *child_role,

                                  void *opaque)

{

    BdrvChild *child = g_new(BdrvChild, 1);

    *child = (BdrvChild) {

        .bs     = NULL,

        .name   = g_strdup(child_name),

        .role   = child_role,

        .opaque = opaque,

    };

    bdrv_replace_child(child, child_bs);

    return child;

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
     v->visitor.type_bool = qapi_dealloc_type_bool;

     v->visitor.type_str = qapi_dealloc_type_str;
+
+    v->visitor.type_number = qapi_dealloc_type_number;
+
+    v->visitor.type_any = qapi_dealloc_type_anything;
+
     v->visitor.type_null = qapi_dealloc_type_null;

QapiDeallocVisitor *qapi_dealloc_visitor_new(void)

{

    QapiDeallocVisitor *v;

    v = g_malloc0(sizeof(*v));

    v->visitor.type = VISITOR_DEALLOC;

    v->visitor.start_struct = qapi_dealloc_start_struct;

    v->visitor.end_struct = qapi_dealloc_end_struct;

    v->visitor.start_alternate = qapi_dealloc_start_alternate;

    v->visitor.end_alternate = qapi_dealloc_end_alternate;

    v->visitor.start_list = qapi_dealloc_start_list;

    v->visitor.next_list = qapi_dealloc_next_list;

    v->visitor.end_list = qapi_dealloc_end_list;

    v->visitor.type_int64 = qapi_dealloc_type_int64;

    v->visitor.type_uint64 = qapi_dealloc_type_uint64;

    v->visitor.type_bool = qapi_dealloc_type_bool;

    v->visitor.type_str = qapi_dealloc_type_str;

    v->visitor.type_number = qapi_dealloc_type_number;

    v->visitor.type_any = qapi_dealloc_type_anything;

    v->visitor.type_null = qapi_dealloc_type_null;

    return v;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void build_guest_fsinfo_for_virtual_device(char const *syspath,

                                                   GuestFilesystemInfo *fs,
+
                                                   Error **errp)

 {
@@ -9,20 +9,20 @@
     DIR *dir;

     char *dirpath;
+
     struct dirent entry, *result;
+
+
+
     dirpath = g_strdup_printf("%s/slaves", syspath);
+
     dir = opendir(dirpath);

+    if (!dir) {
+
+        error_setg_errno(errp, errno, "opendir(\"%s\")", dirpath);
+
+        g_free(dirpath);

         return;

static void build_guest_fsinfo_for_virtual_device(char const *syspath,

                                                  GuestFilesystemInfo *fs,

                                                  Error **errp)

{

    DIR *dir;

    char *dirpath;

    struct dirent entry, *result;

    dirpath = g_strdup_printf("%s/slaves", syspath);

    dir = opendir(dirpath);

    if (!dir) {

        error_setg_errno(errp, errno, "opendir(\"%s\")", dirpath);

        g_free(dirpath);

        return;

    }

    g_free(dirpath);

    for (;;) {

        if (readdir_r(dir, &entry, &result) != 0) {

            error_setg_errno(errp, errno, "readdir_r(\"%s\")", dirpath);

            break;

        }

        if (!result) {

            break;

        }

        if (entry.d_type == DT_LNK) {

            g_debug(" slave device '%s'", entry.d_name);

            dirpath = g_strdup_printf("%s/slaves/%s", syspath, entry.d_name);

            build_guest_fsinfo_for_device(dirpath, fs, errp);

            g_free(dirpath);

            if (*errp) {

                break;

            }

        }

    }

    closedir(dir);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void bt_dummy_lmp_acl_resp(struct bt_link_s *link,
+
+                const uint8_t *data, int start, int len)

 {

static void bt_dummy_lmp_acl_resp(struct bt_link_s *link,

                const uint8_t *data, int start, int len)

{

    fprintf(stderr, "%s: stray ACL response PDU, fixme\n", __FUNCTION__);

    exit(-1);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void *av_mallocz_static(unsigned int size)
+
+{
+
+    void *ptr = av_mallocz(size);
+

+
     if(ptr){

         array_static =av_fast_realloc(array_static, &allocated_static, sizeof(void*)*(last_static+1));

static void *av_mallocz_static(unsigned int size)

{

    void *ptr = av_mallocz(size);

    if(ptr){

        array_static =av_fast_realloc(array_static, &allocated_static, sizeof(void*)*(last_static+1));

        if(!array_static)

            return NULL;

        array_static[last_static++] = ptr;

    }

    return ptr;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
+
+    if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/4)
+
         return 0;

int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){

    if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/4)

        return 0;

    av_log(av_log_ctx, AV_LOG_ERROR, "picture size invalid (%ux%u)\n", w, h);

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -8,12 +8,12 @@

     int64_t val;

+    char *endptr;
+
+

     opt = lookup_scalar(ov, name, errp);
+
     if (!opt) {

         return;

opts_type_size(Visitor *v, uint64_t *obj, const char *name, Error **errp)

{

    OptsVisitor *ov = DO_UPCAST(OptsVisitor, visitor, v);

    const QemuOpt *opt;

    int64_t val;

    char *endptr;

    opt = lookup_scalar(ov, name, errp);

    if (!opt) {

        return;

    }

    val = strtosz_suffix(opt->str ? opt->str : "", &endptr,

                         STRTOSZ_DEFSUFFIX_B);

    if (val != -1 && *endptr == '\0') {

        *obj = val;

        processed(ov, name);

        return;

    }

    error_set(errp, QERR_INVALID_PARAMETER_VALUE, opt->name,

              "a size value representible as a non-negative int64");

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int cmp(const void *a, const void *b)
+
+{

     const double va = *(const double *)a, vb = *(const double *)b;

static int cmp(const void *a, const void *b)

{

    const double va = *(const double *)a, vb = *(const double *)b;

    return va < vb ? -1 : ( va > vb ? 1 : 0 );

}


--- a/source.c
+++ b/source.c
@@ -22,11 +22,11 @@

     if (mr->subpage) {

+        trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size);
+
+
+
+

     } else if (TRACE_MEMORY_REGION_OPS_WRITE_ENABLED) {

static MemTxResult memory_region_write_with_attrs_accessor(MemoryRegion *mr,

                                                           hwaddr addr,

                                                           uint64_t *value,

                                                           unsigned size,

                                                           unsigned shift,

                                                           uint64_t mask,

                                                           MemTxAttrs attrs)

{

    uint64_t tmp;

    tmp = (*value >> shift) & mask;

    if (mr->subpage) {

        trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size);

    } else if (TRACE_MEMORY_REGION_OPS_WRITE_ENABLED) {

        hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);

        trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size);

    }

    return mr->ops->write_with_attrs(mr->opaque, addr, tmp, size, attrs);

}


--- a/source.c
+++ b/source.c
@@ -4,11 +4,11 @@

     int mapped_node_id; /* set by -numa option */

+    int node_id = object_property_get_int(OBJECT(dev), "node-id", &error_abort);
+
+
+
+    /* by default CPUState::numa_node was 0 if it wasn't set explicitly

      * TODO: make it error when incomplete numa mapping support is removed

void numa_cpu_pre_plug(const CPUArchId *slot, DeviceState *dev, Error **errp)

{

    int mapped_node_id; /* set by -numa option */

    int node_id = object_property_get_int(OBJECT(dev), "node-id", &error_abort);

    /* by default CPUState::numa_node was 0 if it wasn't set explicitly

     * TODO: make it error when incomplete numa mapping support is removed

     */

    mapped_node_id = slot->props.node_id;

    if (!slot->props.has_node_id) {

        mapped_node_id = 0;

    }

    if (node_id == CPU_UNSET_NUMA_NODE_ID) {

        /* due to bug in libvirt, it doesn't pass node-id from props on

         * device_add as expected, so we have to fix it up here */

        object_property_set_int(OBJECT(dev), mapped_node_id, "node-id", errp);

    } else if (node_id != mapped_node_id) {

        error_setg(errp, "node-id=%d must match numa node specified "

                   "with -numa option", node_id);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void OPPROTO op_divw (void)
+
+{

     if (unlikely(((int32_t)T0 == INT32_MIN && (int32_t)T1 == -1) ||


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
 {

     PCIQXLDevice *qxl = opaque;
+
+    VGACommonState *vga = &qxl->vga;
+
+
+
     switch (qxl->mode) {

     case QXL_MODE_COMPAT:

static void qxl_hw_screen_dump(void *opaque, const char *filename, bool cswitch,

                               Error **errp)

{

    PCIQXLDevice *qxl = opaque;

    VGACommonState *vga = &qxl->vga;

    switch (qxl->mode) {

    case QXL_MODE_COMPAT:

    case QXL_MODE_NATIVE:

        qxl_render_update(qxl);

        ppm_save(filename, qxl->ssd.ds, errp);

        break;

    case QXL_MODE_VGA:

        vga->screen_dump(vga, filename, cswitch, errp);

        break;

    default:

        break;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static QObject *parser_context_peek_token(JSONParserContext *ctxt)
+
+{

     assert(!g_queue_is_empty(ctxt->buf));

static QObject *parser_context_peek_token(JSONParserContext *ctxt)

{

    assert(!g_queue_is_empty(ctxt->buf));

    return g_queue_peek_head(ctxt->buf);

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     if (len < 0) {
         error_setg_errno(errp, -len, "unable to get length for '%s'",
     BackupBlockJob *job = block_job_create(&backup_job_driver, bs, speed,
+                                           cb, opaque, errp);
+    if (!job) {
+    bdrv_op_block_all(target, job->common.blocker);
+    job->on_source_error = on_source_error;
+    job->on_target_error = on_target_error;
     job->target = target;
     job->sync_mode = sync_mode;
     job->common.len = len;

void backup_start(BlockDriverState *bs, BlockDriverState *target,
                  int64_t speed, MirrorSyncMode sync_mode,
                  BlockdevOnError on_source_error,
                  BlockdevOnError on_target_error,
                  BlockCompletionFunc *cb, void *opaque,
                  Error **errp)
{
    int64_t len;
    assert(bs);
    assert(target);
    assert(cb);
    if (bs == target) {
        error_setg(errp, "Source and target cannot be the same");
    if ((on_source_error == BLOCKDEV_ON_ERROR_STOP ||
         on_source_error == BLOCKDEV_ON_ERROR_ENOSPC) &&
        !bdrv_iostatus_is_enabled(bs)) {
        error_set(errp, QERR_INVALID_PARAMETER, "on-source-error");
    len = bdrv_getlength(bs);
    if (len < 0) {
        error_setg_errno(errp, -len, "unable to get length for '%s'",
    BackupBlockJob *job = block_job_create(&backup_job_driver, bs, speed,
                                           cb, opaque, errp);
    if (!job) {
    bdrv_op_block_all(target, job->common.blocker);
    job->on_source_error = on_source_error;
    job->on_target_error = on_target_error;
    job->target = target;
    job->sync_mode = sync_mode;
    job->common.len = len;
    job->common.co = qemu_coroutine_create(backup_run);
    qemu_coroutine_enter(job->common.co, job);


static inline void idct4col_put(uint8_t *dest, int line_size, const int16_t *col)

{

    int c0, c1, c2, c3, a0, a1, a2, a3;

    a0 = col[8*0];

    a1 = col[8*2];

    a2 = col[8*4];

    a3 = col[8*6];

    c0 = ((a0 + a2) << (CN_SHIFT - 1)) + (1 << (C_SHIFT - 1));

    c2 = ((a0 - a2) << (CN_SHIFT - 1)) + (1 << (C_SHIFT - 1));

    c1 = a1 * C1 + a3 * C2;

    c3 = a1 * C2 - a3 * C1;

    dest[0] = av_clip_uint8((c0 + c1) >> C_SHIFT);

    dest += line_size;

    dest[0] = av_clip_uint8((c2 + c3) >> C_SHIFT);

    dest += line_size;

    dest[0] = av_clip_uint8((c2 - c3) >> C_SHIFT);

    dest += line_size;

    dest[0] = av_clip_uint8((c0 - c1) >> C_SHIFT);

}


static inline void conv_to_float(float *arr, int32_t *cof, int num)

{

    int i;

    for (i = 0; i < num; i++)

        arr[i] = (float)cof[i]/INT32_MAX;

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     AddressSpace *as = memory_region_to_address_space(address_space);

     AddrRange range = addrrange_make(int128_make64(addr),
+
+                                     int128_make64(size));
+
+    FlatRange *fr = address_space_lookup(as, range);
+
     MemoryRegionSection ret = { .mr = NULL, .size = 0 };

MemoryRegionSection memory_region_find(MemoryRegion *address_space,

                                       hwaddr addr, uint64_t size)

{

    AddressSpace *as = memory_region_to_address_space(address_space);

    AddrRange range = addrrange_make(int128_make64(addr),

                                     int128_make64(size));

    FlatRange *fr = address_space_lookup(as, range);

    MemoryRegionSection ret = { .mr = NULL, .size = 0 };

    if (!fr) {

        return ret;

    }

    while (fr > as->current_map->ranges

           && addrrange_intersects(fr[-1].addr, range)) {

        --fr;

    }

    ret.mr = fr->mr;

    range = addrrange_intersection(range, fr->addr);

    ret.offset_within_region = fr->offset_in_region;

    ret.offset_within_region += int128_get64(int128_sub(range.start,

                                                        fr->addr.start));

    ret.size = int128_get64(range.size);

    ret.offset_within_address_space = int128_get64(range.start);

    ret.readonly = fr->readonly;

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -14,11 +14,11 @@

         (o = c->opt_find(obj, name, unit, opt_flags, search_flags)))

+        return o;
+
+
+
+    while (o = av_next_option(obj, o)) {

         if (!strcmp(o->name, name) && (!unit || (o->unit && !strcmp(o->unit, unit))) &&

const AVOption *av_opt_find(void *obj, const char *name, const char *unit,

                            int opt_flags, int search_flags)

{

    AVClass *c = *(AVClass**)obj;

    const AVOption *o = NULL;

    if (c->opt_find && search_flags & AV_OPT_SEARCH_CHILDREN &&

        (o = c->opt_find(obj, name, unit, opt_flags, search_flags)))

        return o;

    while (o = av_next_option(obj, o)) {

        if (!strcmp(o->name, name) && (!unit || (o->unit && !strcmp(o->unit, unit))) &&

            (o->flags & opt_flags) == opt_flags)

            return o;

    }

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static unsigned char get_ref_idx(AVFrame *frame)

+{
+
+    FrameDecodeData *fdd;
+
+    NVDECFrame *cf;

static unsigned char get_ref_idx(AVFrame *frame)

{

    FrameDecodeData *fdd;

    NVDECFrame *cf;

    if (!frame || !frame->private_ref)

        return 255;

    fdd = (FrameDecodeData*)frame->private_ref->data;

    cf  = (NVDECFrame*)fdd->hwaccel_priv;

    return cf->idx;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void wait_for_aio(void)

 {
+
+    while (aio_poll(ctx, true)) {

         /* Do nothing */

static void wait_for_aio(void)

{

    while (aio_poll(ctx, true)) {

        /* Do nothing */

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+bool vhost_dev_query(struct vhost_dev *hdev, VirtIODevice *vdev)
+
+{
+
+    BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev)));

     VirtioBusState *vbus = VIRTIO_BUS(qbus);

bool vhost_dev_query(struct vhost_dev *hdev, VirtIODevice *vdev)

{

    BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev)));

    VirtioBusState *vbus = VIRTIO_BUS(qbus);

    VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus);

    return !k->query_guest_notifiers ||

           k->query_guest_notifiers(qbus->parent) ||

           hdev->force;

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
 {

     uint32_t r;
+
+
+
+    r = fdt_get_phandle(fdt, findnode_nofail(fdt, path));
+
     if (r <= 0) {

         fprintf(stderr, "%s: Couldn't get phandle for %s: %s\n", __func__,

uint32_t qemu_devtree_get_phandle(void *fdt, const char *path)

{

    uint32_t r;

    r = fdt_get_phandle(fdt, findnode_nofail(fdt, path));

    if (r <= 0) {

        fprintf(stderr, "%s: Couldn't get phandle for %s: %s\n", __func__,

                path, fdt_strerror(r));

        exit(1);

    }

    return r;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static av_noinline void emulated_edge_mc_sse(uint8_t * buf,const uint8_t *src,
+
                                              ptrdiff_t buf_stride,

                                              ptrdiff_t src_stride,

static av_noinline void emulated_edge_mc_sse(uint8_t * buf,const uint8_t *src,

                                             ptrdiff_t buf_stride,

                                             ptrdiff_t src_stride,

                                             int block_w, int block_h,

                                             int src_x, int src_y, int w, int h)

{

    emulated_edge_mc(buf, src, buf_stride, src_stride, block_w, block_h,

                     src_x, src_y, w, h, vfixtbl_sse, &ff_emu_edge_vvar_sse,

                     hfixtbl_sse, &ff_emu_edge_hvar_sse);

}


--- a/source.c
+++ b/source.c
@@ -3,6 +3,6 @@
     IVI5DecContext *ctx = avctx->priv_data;
     ff_ivi_free_buffers(&ctx->planes[0]);
     if (ctx->frame.data[0])
+        avctx->release_buffer(avctx, &ctx->frame);
+    return 0;
 }

static av_cold int decode_close(AVCodecContext *avctx)
{
    IVI5DecContext *ctx = avctx->priv_data;
    ff_ivi_free_buffers(&ctx->planes[0]);
    if (ctx->frame.data[0])
        avctx->release_buffer(avctx, &ctx->frame);
    return 0;
}


--- a/source.c
+++ b/source.c
@@ -7,5 +7,5 @@
     float32 f1 = make_float32(b);

     return (float32_compare_quiet(f0, f1, NFS) == -1) ? a : b;
+
+}

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;

}


static target_ulong helper_sdiv_common(CPUSPARCState *env, target_ulong a,

                                       target_ulong b, int cc)

{

    SPARCCPU *cpu = sparc_env_get_cpu(env);

    int overflow = 0;

    int64_t x0;

    int32_t x1;

    x0 = (a & 0xffffffff) | ((int64_t) (env->y) << 32);

    x1 = (b & 0xffffffff);

    if (x1 == 0) {

        cpu_restore_state(CPU(cpu), GETPC());

        helper_raise_exception(env, TT_DIV_ZERO);

    }

    x0 = x0 / x1;

    if ((int32_t) x0 != x0) {

        x0 = x0 < 0 ? 0x80000000 : 0x7fffffff;

        overflow = 1;

    }

    if (cc) {

        env->cc_dst = x0;

        env->cc_src2 = overflow;

        env->cc_op = CC_OP_DIV;

    }

    return x0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+ogm_dshow_header(AVFormatContext *s, int idx)
+{
+    struct ogg *ogg = s->priv_data;
+    struct ogg_stream *os = ogg->streams + idx;
+    AVStream *st = s->streams[idx];
     uint8_t *p = os->buf + os->pstart;
     uint32_t t;
     if(!(*p & 1))

ogm_dshow_header(AVFormatContext *s, int idx)
{
    struct ogg *ogg = s->priv_data;
    struct ogg_stream *os = ogg->streams + idx;
    AVStream *st = s->streams[idx];
    uint8_t *p = os->buf + os->pstart;
    uint32_t t;
    if(!(*p & 1))
        return 0;
    if(*p != 1)
        return 1;
    t = AV_RL32(p + 96);
    if(t == 0x05589f80){
        st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
        st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, AV_RL32(p + 68));
        avpriv_set_pts_info(st, 64, AV_RL64(p + 164), 10000000);
        st->codec->width = AV_RL32(p + 176);
        st->codec->height = AV_RL32(p + 180);
    } else if(t == 0x05589f81){
        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
        st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, AV_RL16(p + 124));
        st->codec->channels = AV_RL16(p + 126);
        st->codec->sample_rate = AV_RL32(p + 128);
        st->codec->bit_rate = AV_RL32(p + 132) * 8;
    }
    return 1;
}


--- a/source.c
+++ b/source.c
@@ -53,11 +53,11 @@
                     kernel_filename);

             exit(1);
+
+        }
+
+        cpu->env.pc = entry;
+
     }

 }

static void cpu_openrisc_load_kernel(ram_addr_t ram_size,

                                     const char *kernel_filename,

                                     OpenRISCCPU *cpu)

{

    long kernel_size;

    uint64_t elf_entry;

    hwaddr entry;

    if (kernel_filename && !qtest_enabled()) {

        kernel_size = load_elf(kernel_filename, NULL, NULL,

                               &elf_entry, NULL, NULL, 1, EM_OPENRISC,

                               1, 0);

        entry = elf_entry;

        if (kernel_size < 0) {

            kernel_size = load_uimage(kernel_filename,

                                      &entry, NULL, NULL, NULL, NULL);

        }

        if (kernel_size < 0) {

            kernel_size = load_image_targphys(kernel_filename,

                                              KERNEL_LOAD_ADDR,

                                              ram_size - KERNEL_LOAD_ADDR);

            entry = KERNEL_LOAD_ADDR;

        }

        if (kernel_size < 0) {

            fprintf(stderr, "QEMU: couldn't load the kernel '%s'\n",

                    kernel_filename);

            exit(1);

        }

        cpu->env.pc = entry;

    }

}


--- a/source.c
+++ b/source.c
@@ -8,11 +8,11 @@

+    ret = cds_check_len(cds, len);
+
+    if (ret <= 0) {
+
+        return ret;

static int ccw_dstream_rw_noflags(CcwDataStream *cds, void *buff, int len,

                                  CcwDataStreamOp op)

{

    int ret;

    ret = cds_check_len(cds, len);

    if (ret <= 0) {

        return ret;

    if (op == CDS_OP_A) {

        goto incr;

    ret = address_space_rw(&address_space_memory, cds->cda,

                           MEMTXATTRS_UNSPECIFIED, buff, len, op);

    if (ret != MEMTX_OK) {

        cds->flags |= CDS_F_STREAM_BROKEN;

        return -EINVAL;

incr:

    cds->at_byte += len;

    cds->cda += len;

    return 0;


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
 	return;

+
+    rc = netdev->rx_ring.req_cons;
+
+    rp = netdev->rx_ring.sring->req_prod;
+
     xen_rmb(); /* Ensure we see queued requests up to 'rp'. */

static void net_rx_packet(void *opaque, const uint8_t *buf, size_t size)

{

    struct XenNetDev *netdev = opaque;

    netif_rx_request_t rxreq;

    RING_IDX rc, rp;

    void *page;

    if (netdev->xendev.be_state != XenbusStateConnected)

	return;

    rc = netdev->rx_ring.req_cons;

    rp = netdev->rx_ring.sring->req_prod;

    xen_rmb(); /* Ensure we see queued requests up to 'rp'. */

    if (rc == rp || RING_REQUEST_CONS_OVERFLOW(&netdev->rx_ring, rc)) {

	xen_be_printf(&netdev->xendev, 2, "no buffer, drop packet\n");

	return;

    }

    if (size > XC_PAGE_SIZE - NET_IP_ALIGN) {

	xen_be_printf(&netdev->xendev, 0, "packet too big (%lu > %ld)",

		      (unsigned long)size, XC_PAGE_SIZE - NET_IP_ALIGN);

	return;

    }

    memcpy(&rxreq, RING_GET_REQUEST(&netdev->rx_ring, rc), sizeof(rxreq));

    netdev->rx_ring.req_cons = ++rc;

    page = xc_gnttab_map_grant_ref(netdev->xendev.gnttabdev,

				   netdev->xendev.dom,

				   rxreq.gref, PROT_WRITE);

    if (page == NULL) {

	xen_be_printf(&netdev->xendev, 0, "error: rx gref dereference failed (%d)\n",

                      rxreq.gref);

	net_rx_response(netdev, &rxreq, NETIF_RSP_ERROR, 0, 0, 0);

	return;

    }

    memcpy(page + NET_IP_ALIGN, buf, size);

    xc_gnttab_munmap(netdev->xendev.gnttabdev, page, 1);

    net_rx_response(netdev, &rxreq, NETIF_RSP_OKAY, NET_IP_ALIGN, size, 0);

}


--- a/source.c
+++ b/source.c
@@ -1,16 +1,16 @@
 void visit_type_int32(Visitor *v, int32_t *obj, const char *name, Error **errp)

+{
+
+    int64_t value;

+    if (!error_is_set(errp)) {
+
+        if (v->type_int32) {
+
             v->type_int32(v, obj, name, errp);

+        } else {

             value = *obj;

void visit_type_int32(Visitor *v, int32_t *obj, const char *name, Error **errp)

{

    int64_t value;

    if (!error_is_set(errp)) {

        if (v->type_int32) {

            v->type_int32(v, obj, name, errp);

        } else {

            value = *obj;

            v->type_int(v, &value, name, errp);

            if (value < INT32_MIN || value > INT32_MAX) {

                error_set(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null",

                          "int32_t");

                return;

            }

            *obj = value;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -3,9 +3,9 @@
 {

     ThreadPool *pool = opaque;
+
+
+
     qemu_mutex_lock(&pool->lock);

     do_spawn_thread(pool);

static void spawn_thread_bh_fn(void *opaque)

{

    ThreadPool *pool = opaque;

    qemu_mutex_lock(&pool->lock);

    do_spawn_thread(pool);

    qemu_mutex_unlock(&pool->lock);

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
 {

     if (unlikely(!(env->fpu->fcr0 & (1 << FCR0_3D))))
+
+        generate_exception(ctx, EXCP_RI);

 }

static always_inline void check_cp1_3d(CPUState *env, DisasContext *ctx)

{

    if (unlikely(!(env->fpu->fcr0 & (1 << FCR0_3D))))

        generate_exception(ctx, EXCP_RI);

}


--- a/source.c
+++ b/source.c
@@ -4,7 +4,7 @@

     VFIOQuirk *quirk;

+

     /*

static void vfio_vga_probe_ati_3c3_quirk(VFIOPCIDevice *vdev)

{

    VFIOQuirk *quirk;

    /*

     * As long as the BAR is >= 256 bytes it will be aligned such that the

     * lower byte is always zero.  Filter out anything else, if it exists.

     */

    if (!vfio_pci_is(vdev, PCI_VENDOR_ID_ATI, PCI_ANY_ID) ||

        !vdev->bars[4].ioport || vdev->bars[4].region.size < 256) {

        return;

    }

    quirk = g_malloc0(sizeof(*quirk));

    quirk->mem = g_malloc0(sizeof(MemoryRegion));

    quirk->nr_mem = 1;

    memory_region_init_io(quirk->mem, OBJECT(vdev), &vfio_ati_3c3_quirk, vdev,

                          "vfio-ati-3c3-quirk", 1);

    memory_region_add_subregion(&vdev->vga.region[QEMU_PCI_VGA_IO_HI].mem,

                                3 /* offset 3 bytes from 0x3c0 */, quirk->mem);

    QLIST_INSERT_HEAD(&vdev->vga.region[QEMU_PCI_VGA_IO_HI].quirks,

                      quirk, next);

    trace_vfio_quirk_ati_3c3_probe(vdev->vbasedev.name);

}


--- a/source.c
+++ b/source.c
@@ -24,11 +24,11 @@

 			tcg_gen_qemu_ld8s(dst, addr, mem_index);

+		else
+
+			tcg_gen_qemu_ld8u(dst, addr, mem_index);
+
+	}

 	else if (size == 2) {

static void gen_load(DisasContext *dc, TCGv dst, TCGv addr,

		     unsigned int size, int sign)

{

	int mem_index = cpu_mmu_index(dc->env);

	/* If we get a fault on a delayslot we must keep the jmp state in

	   the cpu-state to be able to re-execute the jmp.  */

	if (dc->delayed_branch == 1)

		cris_store_direct_jmp(dc);

	if (size == 1) {

		if (sign)

			tcg_gen_qemu_ld8s(dst, addr, mem_index);

		else

			tcg_gen_qemu_ld8u(dst, addr, mem_index);

	}

	else if (size == 2) {

		if (sign)

			tcg_gen_qemu_ld16s(dst, addr, mem_index);

		else

			tcg_gen_qemu_ld16u(dst, addr, mem_index);

	}

	else if (size == 4) {

		tcg_gen_qemu_ld32u(dst, addr, mem_index);

	}

	else if (size == 8) {

		tcg_gen_qemu_ld64(dst, addr, mem_index);

	}

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void pty_chr_update_read_handler(CharDriverState *chr)
+
+{
+
+    PtyCharDriver *s = chr->opaque;

     GPollFD pfd;

static void pty_chr_update_read_handler(CharDriverState *chr)

{

    PtyCharDriver *s = chr->opaque;

    GPollFD pfd;

    pfd.fd = g_io_channel_unix_get_fd(s->fd);

    pfd.events = G_IO_OUT;

    pfd.revents = 0;

    g_poll(&pfd, 1, 0);

    if (pfd.revents & G_IO_HUP) {

        pty_chr_state(chr, 0);

    } else {

        pty_chr_state(chr, 1);

    }

}