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

     }

+    is_none_mode = mode == MIRROR_SYNC_MODE_NONE;
+
+    base = mode == MIRROR_SYNC_MODE_TOP ? backing_bs(bs) : NULL;
+
+    mirror_start_job(job_id, bs, target, replaces,

                      speed, granularity, buf_size, backing_mode,

void mirror_start(const char *job_id, BlockDriverState *bs,

                  BlockDriverState *target, const char *replaces,

                  int64_t speed, uint32_t granularity, int64_t buf_size,

                  MirrorSyncMode mode, BlockMirrorBackingMode backing_mode,

                  BlockdevOnError on_source_error,

                  BlockdevOnError on_target_error,

                  bool unmap,

                  BlockCompletionFunc *cb,

                  void *opaque, Error **errp)

{

    bool is_none_mode;

    BlockDriverState *base;

    if (mode == MIRROR_SYNC_MODE_INCREMENTAL) {

        error_setg(errp, "Sync mode 'incremental' not supported");

        return;

    }

    is_none_mode = mode == MIRROR_SYNC_MODE_NONE;

    base = mode == MIRROR_SYNC_MODE_TOP ? backing_bs(bs) : NULL;

    mirror_start_job(job_id, bs, target, replaces,

                     speed, granularity, buf_size, backing_mode,

                     on_source_error, on_target_error, unmap, cb, opaque, errp,

                     &mirror_job_driver, is_none_mode, base);

}


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

+    case PSSR:	/* Read-clean registers */
+
+    case RCSR:
+
+    case PKSR:

         s->pm_regs[addr >> 2] &= ~value;

static void pxa2xx_pm_write(void *opaque, hwaddr addr,

                            uint64_t value, unsigned size)

{

    PXA2xxState *s = (PXA2xxState *) opaque;

    switch (addr) {

    case PMCR:

        /* Clear the write-one-to-clear bits... */

        s->pm_regs[addr >> 2] &= ~(value & 0x2a);

        /* ...and set the plain r/w bits */

        s->pm_regs[addr >> 2] &= ~0x15;

        s->pm_regs[addr >> 2] |= value & 0x15;

        break;

    case PSSR:	/* Read-clean registers */

    case RCSR:

    case PKSR:

        s->pm_regs[addr >> 2] &= ~value;

        break;

    default:	/* Read-write registers */

        if (!(addr & 3)) {

            s->pm_regs[addr >> 2] = value;

            break;

        }

        printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr);

        break;

    }

}


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

     switch (remote->kind) {

+    case SOCKET_ADDRESS_KIND_INET:

         qemu_opt_set(opts, "host", remote->inet->host);

int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp)

{

    QemuOpts *opts;

    int fd;

    opts = qemu_opts_create_nofail(&socket_optslist);

    switch (remote->kind) {

    case SOCKET_ADDRESS_KIND_INET:

        qemu_opt_set(opts, "host", remote->inet->host);

        qemu_opt_set(opts, "port", remote->inet->port);

        if (local) {

            qemu_opt_set(opts, "localaddr", local->inet->host);

            qemu_opt_set(opts, "localport", local->inet->port);

        }

        fd = inet_dgram_opts(opts, errp);

        break;

    default:

        error_setg(errp, "socket type unsupported for datagram");

        return -1;

    }

    qemu_opts_del(opts);

    return fd;

}


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

     BDRVQcowState *s = bs->opaque;
+
+    uint64_t val;
+
+    int ret;
+

     assert(s->qcow_version >= 3);

static int qcow2_mark_dirty(BlockDriverState *bs)

{

    BDRVQcowState *s = bs->opaque;

    uint64_t val;

    int ret;

    assert(s->qcow_version >= 3);

    if (s->incompatible_features & QCOW2_INCOMPAT_DIRTY) {

        return 0; /* already dirty */

    }

    val = cpu_to_be64(s->incompatible_features | QCOW2_INCOMPAT_DIRTY);

    ret = bdrv_pwrite(bs->file, offsetof(QCowHeader, incompatible_features),

                      &val, sizeof(val));

    if (ret < 0) {

        return ret;

    }

    ret = bdrv_flush(bs->file);

    if (ret < 0) {

        return ret;

    }

    /* Only treat image as dirty if the header was updated successfully */

    s->incompatible_features |= QCOW2_INCOMPAT_DIRTY;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int gxf_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) {
+
     int res = 0;

     uint64_t pos;

static int gxf_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) {

    int res = 0;

    uint64_t pos;

    uint64_t maxlen = 100 * 1024 * 1024;

    AVStream *st = s->streams[0];

    int64_t start_time = s->streams[stream_index]->start_time;

    int64_t found;

    int idx;

    if (timestamp < start_time) timestamp = start_time;

    idx = av_index_search_timestamp(st, timestamp - start_time,

                                    AVSEEK_FLAG_ANY | AVSEEK_FLAG_BACKWARD);

    if (idx < 0)

        return -1;

    pos = st->index_entries[idx].pos;

    if (idx < st->nb_index_entries - 2)

        maxlen = st->index_entries[idx + 2].pos - pos;

    maxlen = FFMAX(maxlen, 200 * 1024);

    res = avio_seek(s->pb, pos, SEEK_SET);

    if (res < 0)

        return res;

    found = gxf_resync_media(s, maxlen, -1, timestamp);

    if (FFABS(found - timestamp) > 4)

        return -1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -7,6 +7,6 @@
     blk_drain_all();

+    return 0;
+
+}

static int aio_flush_f(BlockBackend *blk, int argc, char **argv)

{

    blk_drain_all();

    return 0;

}


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

         width  = h->avctx->width;

+        height = h->avctx->height;
+
+    }
+
+

     if (width <= 0 || height <= 0) {

static int init_dimensions(H264Context *h)

{

    int width  = h->width  - (h->sps.crop_right + h->sps.crop_left);

    int height = h->height - (h->sps.crop_top   + h->sps.crop_bottom);

    /* handle container cropping */

    if (FFALIGN(h->avctx->width,  16) == FFALIGN(width,  16) &&

        FFALIGN(h->avctx->height, 16) == FFALIGN(height, 16)) {

        width  = h->avctx->width;

        height = h->avctx->height;

    }

    if (width <= 0 || height <= 0) {

        av_log(h->avctx, AV_LOG_ERROR, "Invalid cropped dimensions: %dx%d.\n",

               width, height);

        if (h->avctx->err_recognition & AV_EF_EXPLODE)

            return AVERROR_INVALIDDATA;

        av_log(h->avctx, AV_LOG_WARNING, "Ignoring cropping information.\n");

        h->sps.crop_bottom =

        h->sps.crop_top    =

        h->sps.crop_right  =

        h->sps.crop_left   =

        h->sps.crop        = 0;

        width  = h->width;

        height = h->height;

    }

    h->avctx->coded_width  = h->width;

    h->avctx->coded_height = h->height;

    h->avctx->width        = width;

    h->avctx->height       = height;

    return 0;

}


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

     int64_t ticks;
+
+    int64_t bytes;
+
+
+
     now = qemu_get_clock (vm_clock);

     ticks = now - no->old_ticks;

static int no_run_out (HWVoiceOut *hw, int live)

{

    NoVoiceOut *no = (NoVoiceOut *) hw;

    int decr, samples;

    int64_t now;

    int64_t ticks;

    int64_t bytes;

    now = qemu_get_clock (vm_clock);

    ticks = now - no->old_ticks;

    bytes = muldiv64 (ticks, hw->info.bytes_per_second, get_ticks_per_sec ());

    bytes = audio_MIN (bytes, INT_MAX);

    samples = bytes >> hw->info.shift;

    no->old_ticks = now;

    decr = audio_MIN (live, samples);

    hw->rpos = (hw->rpos + decr) % hw->samples;

    return decr;

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
 static void test_ide_mbr(bool use_device, MBRcontents mbr)
+
 {

     char *argv[256];
+
     int argc;

     Backend i;
+
     const char *dev;
+

     argc = setup_common(argv, ARRAY_SIZE(argv));

static void test_ide_mbr(bool use_device, MBRcontents mbr)

{

    char *argv[256];

    int argc;

    Backend i;

    const char *dev;

    argc = setup_common(argv, ARRAY_SIZE(argv));

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

        cur_ide[i] = &hd_chst[i][mbr];

        dev = use_device ? (is_hd(cur_ide[i]) ? "ide-hd" : "ide-cd") : NULL;

        argc = setup_ide(argc, argv, ARRAY_SIZE(argv), i, dev, i, mbr, "");

    }

    qtest_start(g_strjoinv(" ", argv));

    test_cmos();

    qtest_end();

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void qemu_clock_register_reset_notifier(QEMUClockType type,

+                                        Notifier *notifier)
+
 {

     QEMUClock *clock = qemu_clock_ptr(type);

void qemu_clock_register_reset_notifier(QEMUClockType type,

                                        Notifier *notifier)

{

    QEMUClock *clock = qemu_clock_ptr(type);

    notifier_list_add(&clock->reset_notifiers, notifier);

}


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

     const char *str = "";
+
+    int64_t res = 999;

     int err;

static void test_qemu_strtoll_full_empty(void)

{

    const char *str = "";

    int64_t res = 999;

    int err;

    err = qemu_strtoll(str, NULL, 0, &res);

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, 0);

}


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

         return AVERROR_PATCHWELCOME;

+    }
+
+
+
+    av_init_packet(&pkt);

     pkt.data = data_start;

static int vp8_lossy_decode_frame(AVCodecContext *avctx, AVFrame *p,

                                  int *got_frame, uint8_t *data_start,

                                  unsigned int data_size)

{

    WebPContext *s = avctx->priv_data;

    AVPacket pkt;

    int ret;

    if (!s->initialized) {

        ff_vp8_decode_init(avctx);

        s->initialized = 1;

        if (s->has_alpha)

            avctx->pix_fmt = AV_PIX_FMT_YUVA420P;

    }

    s->lossless = 0;

    if (data_size > INT_MAX) {

        av_log(avctx, AV_LOG_ERROR, "unsupported chunk size\n");

        return AVERROR_PATCHWELCOME;

    }

    av_init_packet(&pkt);

    pkt.data = data_start;

    pkt.size = data_size;

    ret = ff_vp8_decode_frame(avctx, p, got_frame, &pkt);

    if (s->has_alpha) {

        ret = vp8_lossy_decode_alpha(avctx, p, s->alpha_data,

                                     s->alpha_data_size);

    }

}


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

+    return false;
+
+}

bool aio_prepare(AioContext *ctx)

{

    /* Poll mode cannot be used with glib's event loop, disable it. */

    poll_set_started(ctx, false);

    return false;

}


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

     unsigned int i;
+
+
+
+    for (i = 0; i < ARRAY_SIZE(sparc_defs); i++) {
+
         (*cpu_fprintf)(f, "Sparc %16s IU " TARGET_FMT_lx " FPU %08x MMU %08x NWINS %d ",

                        sparc_defs[i].name,

void sparc_cpu_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...))

{

    unsigned int i;

    for (i = 0; i < ARRAY_SIZE(sparc_defs); i++) {

        (*cpu_fprintf)(f, "Sparc %16s IU " TARGET_FMT_lx " FPU %08x MMU %08x NWINS %d ",

                       sparc_defs[i].name,

                       sparc_defs[i].iu_version,

                       sparc_defs[i].fpu_version,

                       sparc_defs[i].mmu_version,

                       sparc_defs[i].nwindows);

        print_features(f, cpu_fprintf, CPU_DEFAULT_FEATURES &

                       ~sparc_defs[i].features, "-");

        print_features(f, cpu_fprintf, ~CPU_DEFAULT_FEATURES &

                       sparc_defs[i].features, "+");

        (*cpu_fprintf)(f, "\n");

    }

    (*cpu_fprintf)(f, "Default CPU feature flags (use '-' to remove): ");

    print_features(f, cpu_fprintf, CPU_DEFAULT_FEATURES, NULL);

    (*cpu_fprintf)(f, "\n");

    (*cpu_fprintf)(f, "Available CPU feature flags (use '+' to add): ");

    print_features(f, cpu_fprintf, ~CPU_DEFAULT_FEATURES, NULL);

    (*cpu_fprintf)(f, "\n");

    (*cpu_fprintf)(f, "Numerical features (use '=' to set): iu_version "

                   "fpu_version mmu_version nwindows\n");

}


--- a/source.c
+++ b/source.c
@@ -29,11 +29,11 @@
         error_setg(errp, "Invalid number of queues (= %" PRIu32 "), "

                          "must be a positive integer less than %d.",
+
+                   s->conf.num_queues, VIRTIO_QUEUE_MAX - 2);
+
+        virtio_cleanup(vdev);
+
         return;

     }

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

                                VirtIOHandleOutput ctrl,

                                VirtIOHandleOutput evt,

                                VirtIOHandleOutput 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_QUEUE_MAX - 2) {

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

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

                   s->conf.num_queues, VIRTIO_QUEUE_MAX - 2);

        virtio_cleanup(vdev);

        return;

    }

    s->cmd_vqs = g_new0(VirtQueue *, s->conf.num_queues);

    s->sense_size = VIRTIO_SCSI_SENSE_DEFAULT_SIZE;

    s->cdb_size = VIRTIO_SCSI_CDB_DEFAULT_SIZE;

    s->ctrl_vq = virtio_add_queue_aio(vdev, VIRTIO_SCSI_VQ_SIZE, ctrl);

    s->event_vq = virtio_add_queue_aio(vdev, VIRTIO_SCSI_VQ_SIZE, evt);

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

        s->cmd_vqs[i] = virtio_add_queue_aio(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,8 +1,8 @@
 static void test_lifecycle(void)

 {
+
+    Coroutine *coroutine;

     bool done = false;

static void test_lifecycle(void)

{

    Coroutine *coroutine;

    bool done = false;

    /* Create, enter, and return from coroutine */

    coroutine = qemu_coroutine_create(set_and_exit);

    qemu_coroutine_enter(coroutine, &done);

    g_assert(done); /* expect done to be true (first time) */

    /* Repeat to check that no state affects this test */

    done = false;

    coroutine = qemu_coroutine_create(set_and_exit);

    qemu_coroutine_enter(coroutine, &done);

    g_assert(done); /* expect done to be true (second time) */

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static uint32_t qpi_mem_readb(void *opaque, target_phys_addr_t addr)

+{

     return 0;

static uint32_t qpi_mem_readb(void *opaque, target_phys_addr_t addr)

{

    return 0;

}


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

     if (ct & TCG_CT_CONST)

+        return 1;
+
+    else if ((ct & TCG_CT_CONST_S11) && ABS(val) == (ABS(val) & 0x3ff))
+
+        return 1;

     else if ((ct & TCG_CT_CONST_S13) && ABS(val) == (ABS(val) & 0xfff))

static inline int tcg_target_const_match(tcg_target_long val,

                                         const TCGArgConstraint *arg_ct)

{

    int ct;

    ct = arg_ct->ct;

    if (ct & TCG_CT_CONST)

        return 1;

    else if ((ct & TCG_CT_CONST_S11) && ABS(val) == (ABS(val) & 0x3ff))

        return 1;

    else if ((ct & TCG_CT_CONST_S13) && ABS(val) == (ABS(val) & 0xfff))

        return 1;

    else

        return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 int sws_getColorspaceDetails(SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation)
+
 {

     if (isYUV(c->dstFormat) || isGray(c->dstFormat)) return -1;

int sws_getColorspaceDetails(SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation)

{

    if (isYUV(c->dstFormat) || isGray(c->dstFormat)) return -1;

    *inv_table = c->srcColorspaceTable;

    *table     = c->dstColorspaceTable;

    *srcRange  = c->srcRange;

    *dstRange  = c->dstRange;

    *brightness= c->brightness;

    *contrast  = c->contrast;

    *saturation= c->saturation;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+int pt_setxattr(FsContext *ctx, const char *path, const char *name, void *value,
+
+                size_t size, int flags)
+
+{
+
+    char *buffer;

     int ret;

int pt_setxattr(FsContext *ctx, const char *path, const char *name, void *value,

                size_t size, int flags)

{

    char *buffer;

    int ret;

    buffer = rpath(ctx, path);

    ret = lsetxattr(buffer, name, value, size, flags);

    g_free(buffer);

    return ret;

}


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

     gen_mov_reg_FCC0(dst, src, fcc_offset);

+    gen_mov_reg_FCC1(cpu_tmp0, src, fcc_offset);
+
+    tcg_gen_xor_tl(dst, dst, cpu_tmp0);

     tcg_gen_xori_tl(dst, dst, 0x1);

static inline void gen_op_eval_fbue(TCGv dst, TCGv src,

                                    unsigned int fcc_offset)

{

    gen_mov_reg_FCC0(dst, src, fcc_offset);

    gen_mov_reg_FCC1(cpu_tmp0, src, fcc_offset);

    tcg_gen_xor_tl(dst, dst, cpu_tmp0);

    tcg_gen_xori_tl(dst, dst, 0x1);

}


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

 {

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

                                ptrdiff_t stride)

{

    avc_luma_hz_qrt_4w_msa(src - 2, stride, dst, stride, 4, 0);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static inline int vorbis_residue_decode(vorbis_context *vc, vorbis_residue *vr,
+
+                                        unsigned ch,
+
                                         uint8_t *do_not_decode,

                                         float *vec, unsigned vlen)

static inline int vorbis_residue_decode(vorbis_context *vc, vorbis_residue *vr,

                                        unsigned ch,

                                        uint8_t *do_not_decode,

                                        float *vec, unsigned vlen)

{

    if (vr->type == 2)

        return vorbis_residue_decode_internal(vc, vr, ch, do_not_decode, vec, vlen, 2);

    else if (vr->type == 1)

        return vorbis_residue_decode_internal(vc, vr, ch, do_not_decode, vec, vlen, 1);

    else if (vr->type == 0)

        return vorbis_residue_decode_internal(vc, vr, ch, do_not_decode, vec, vlen, 0);

    else {

        av_log(vc->avccontext, AV_LOG_ERROR, " Invalid residue type while residue decode?! \n");

        return AVERROR_INVALIDDATA;

    }

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
     sysbus_connect_irq(s, 0, IRQ);

     if (io_base != 0) {
+
+        register_ioport_read(io_base, 0x04, 1, NVRAM_readb, state);
+
+        register_ioport_write(io_base, 0x04, 1, NVRAM_writeb, state);
+
     }

     if (mem_base != 0) {

M48t59State *m48t59_init(qemu_irq IRQ, target_phys_addr_t mem_base,

                         uint32_t io_base, uint16_t size, int model)

{

    DeviceState *dev;

    SysBusDevice *s;

    M48t59SysBusState *d;

    M48t59State *state;

    dev = qdev_create(NULL, "m48t59");

    qdev_prop_set_uint32(dev, "model", model);

    qdev_prop_set_uint32(dev, "size", size);

    qdev_prop_set_uint32(dev, "io_base", io_base);

    qdev_init_nofail(dev);

    s = sysbus_from_qdev(dev);

    d = FROM_SYSBUS(M48t59SysBusState, s);

    state = &d->state;

    sysbus_connect_irq(s, 0, IRQ);

    if (io_base != 0) {

        register_ioport_read(io_base, 0x04, 1, NVRAM_readb, state);

        register_ioport_write(io_base, 0x04, 1, NVRAM_writeb, state);

    }

    if (mem_base != 0) {

        sysbus_mmio_map(s, 0, mem_base);

    }

    return state;

}


--- a/source.c
+++ b/source.c
@@ -11,7 +11,7 @@
     av_freep(&film->stereo_buffer);

+
+    return 0;
+
+}

static int film_read_close(AVFormatContext *s)

{

    FilmDemuxContext *film = s->priv_data;

    av_freep(&film->sample_table);

    av_freep(&film->stereo_buffer);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
   src = &previous[x + y*pitch];

   dst = current;
+
+
+
+  for (i=0; i < 16; i++) {
+
     memcpy (dst, src, 16);

     src += pitch;

static void skip_block (uint8_t *current, uint8_t *previous, int pitch, int x, int y) {

  uint8_t *src;

  uint8_t *dst;

  int	   i;

  src = &previous[x + y*pitch];

  dst = current;

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

    memcpy (dst, src, 16);

    src += pitch;

    dst += pitch;

  }

}


static inline void gen_evmwsmi(DisasContext *ctx)

{

    TCGv_i64 t0, t1;

    if (unlikely(!ctx->spe_enabled)) {

        gen_exception(ctx, POWERPC_EXCP_APU);

        return;

    }

    t0 = tcg_temp_new_i64();

    t1 = tcg_temp_new_i64();

    /* t0 := rA; t1 := rB */

#if defined(TARGET_PPC64)

    tcg_gen_ext32s_tl(t0, cpu_gpr[rA(ctx->opcode)]);

    tcg_gen_ext32s_tl(t1, cpu_gpr[rB(ctx->opcode)]);

#else

    tcg_gen_ext_tl_i64(t0, cpu_gpr[rA(ctx->opcode)]);

    tcg_gen_ext_tl_i64(t1, cpu_gpr[rB(ctx->opcode)]);

#endif

    tcg_gen_mul_i64(t0, t0, t1);  /* t0 := rA * rB */

    gen_store_gpr64(rD(ctx->opcode), t0); /* rD := t0 */

    tcg_temp_free_i64(t0);

    tcg_temp_free_i64(t1);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static inline void RENAME(yvu9toyv12)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc,
+
 	uint8_t *ydst, uint8_t *udst, uint8_t *vdst,

 	long width, long height, long lumStride, long chromStride)

static inline void RENAME(yvu9toyv12)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc,

	uint8_t *ydst, uint8_t *udst, uint8_t *vdst,

	long width, long height, long lumStride, long chromStride)

{

	/* Y Plane */

	memcpy(ydst, ysrc, width*height);

	/* XXX: implement upscaling for U,V */

}


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

         register_ioport_write(addr + 4, 4, 2, bmdma_addr_writew, bm);

+        register_ioport_read(addr + 4, 4, 2, bmdma_addr_readw, bm);
+
+        register_ioport_write(addr + 4, 4, 4, bmdma_addr_writel, bm);
+
+        register_ioport_read(addr + 4, 4, 4, bmdma_addr_readl, bm);

         addr += 8;

static void bmdma_map(PCIDevice *pci_dev, int region_num,

                    pcibus_t addr, pcibus_t size, int type)

{

    PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, pci_dev);

    int i;

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

        BMDMAState *bm = &d->bmdma[i];

        d->bus[i].bmdma = bm;

        bm->bus = d->bus+i;

        bm->pci_dev = d;

        qemu_add_vm_change_state_handler(ide_dma_restart_cb, bm);

        register_ioport_write(addr, 1, 1, bmdma_cmd_writeb, bm);

        register_ioport_write(addr + 1, 3, 1, bmdma_writeb, bm);

        register_ioport_read(addr, 4, 1, bmdma_readb, bm);

        register_ioport_write(addr + 4, 4, 1, bmdma_addr_writeb, bm);

        register_ioport_read(addr + 4, 4, 1, bmdma_addr_readb, bm);

        register_ioport_write(addr + 4, 4, 2, bmdma_addr_writew, bm);

        register_ioport_read(addr + 4, 4, 2, bmdma_addr_readw, bm);

        register_ioport_write(addr + 4, 4, 4, bmdma_addr_writel, bm);

        register_ioport_read(addr + 4, 4, 4, bmdma_addr_readl, bm);

        addr += 8;

    }

}


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

     avc_luma_hv_qrt_and_aver_dst_8x8_msa(src + stride - 2,

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

 }

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

                                ptrdiff_t stride)

{

    avc_luma_hv_qrt_and_aver_dst_8x8_msa(src + stride - 2,

                                         src - (stride * 2),

                                         stride, dst, stride);

}


static int net_rx_ok(NetClientState *nc)

{

    struct XenNetDev *netdev = qemu_get_nic_opaque(nc);

    RING_IDX rc, rp;

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

        return 0;

    }

    rc = netdev->rx_ring.req_cons;

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

    xen_rmb();

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

        xen_be_printf(&netdev->xendev, 2, "%s: no rx buffers (%d/%d)\n",

                      __FUNCTION__, rc, rp);

        return 0;

    }

    return 1;

}


int event_notifier_get_fd(EventNotifier *e)

{

    return e->fd;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 struct omap_sdrc_s *omap_sdrc_init(MemoryRegion *sysmem,
+
                                    hwaddr base)

 {

struct omap_sdrc_s *omap_sdrc_init(MemoryRegion *sysmem,

                                   hwaddr base)

{

    struct omap_sdrc_s *s = (struct omap_sdrc_s *)

            g_malloc0(sizeof(struct omap_sdrc_s));

    omap_sdrc_reset(s);

    memory_region_init_io(&s->iomem, NULL, &omap_sdrc_ops, s, "omap.sdrc", 0x1000);

    memory_region_add_subregion(sysmem, base, &s->iomem);

    return s;

}


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

 {

+    *resp = qmp("{ 'execute': 'query-cpus' }");

     g_assert(*resp);

static QList *get_cpus(QDict **resp)

{

    *resp = qmp("{ 'execute': 'query-cpus' }");

    g_assert(*resp);

    g_assert(qdict_haskey(*resp, "return"));

    return  qdict_get_qlist(*resp, "return");

}


--- 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
@@ -31,11 +31,11 @@
     for (i = 0; i < max_cpus; i++) {

         unsigned int apic_id = x86_cpu_apic_id_from_index(i);
+
+        assert(apic_id < pcms->apic_id_limit);
+
+        for (j = 0; j < nb_numa_nodes; j++) {
+
             if (test_bit(i, numa_info[j].node_cpu)) {

                 pcms->node_cpu[apic_id] = j;

void pc_guest_info_init(PCMachineState *pcms)

{

    int i, j;

    pcms->apic_xrupt_override = kvm_allows_irq0_override();

    pcms->numa_nodes = nb_numa_nodes;

    pcms->node_mem = g_malloc0(pcms->numa_nodes *

                                    sizeof *pcms->node_mem);

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

        pcms->node_mem[i] = numa_info[i].node_mem;

    }

    pcms->node_cpu = g_malloc0(pcms->apic_id_limit *

                                     sizeof *pcms->node_cpu);

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

        unsigned int apic_id = x86_cpu_apic_id_from_index(i);

        assert(apic_id < pcms->apic_id_limit);

        for (j = 0; j < nb_numa_nodes; j++) {

            if (test_bit(i, numa_info[j].node_cpu)) {

                pcms->node_cpu[apic_id] = j;

                break;

            }

        }

    }

    pcms->machine_done.notify = pc_machine_done;

    qemu_add_machine_init_done_notifier(&pcms->machine_done);

}


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

 {

+    if (env->sregs[IBREAKENABLE] & (1 << i) && env->sregs[IBREAKA + i] != v) {
+
+        tb_invalidate_phys_page_range(
+
                 env->sregs[IBREAKA + i], env->sregs[IBREAKA + i] + 1, 0);

         tb_invalidate_phys_page_range(v, v + 1, 0);

void HELPER(wsr_ibreaka)(uint32_t i, uint32_t v)

{

    if (env->sregs[IBREAKENABLE] & (1 << i) && env->sregs[IBREAKA + i] != v) {

        tb_invalidate_phys_page_range(

                env->sregs[IBREAKA + i], env->sregs[IBREAKA + i] + 1, 0);

        tb_invalidate_phys_page_range(v, v + 1, 0);

    }

    env->sregs[IBREAKA + i] = v;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void fill_prstatus(struct target_elf_prstatus *prstatus,
+
+                          const TaskState *ts, int signr)
+
+{

     (void) memset(prstatus, 0, sizeof (*prstatus));

static void fill_prstatus(struct target_elf_prstatus *prstatus,

                          const TaskState *ts, int signr)

{

    (void) memset(prstatus, 0, sizeof (*prstatus));

    prstatus->pr_info.si_signo = prstatus->pr_cursig = signr;

    prstatus->pr_pid = ts->ts_tid;

    prstatus->pr_ppid = getppid();

    prstatus->pr_pgrp = getpgrp();

    prstatus->pr_sid = getsid(0);

#ifdef BSWAP_NEEDED

    bswap_prstatus(prstatus);

#endif

}


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

+    ret->type = ORG_QEMU_X_UNION1_KIND___ORG_QEMU_X_BRANCH;
+
+    ret->u.__org_qemu_x_branch = strdup("blah1");
+
+

__org_qemu_x_Union1 *qmp___org_qemu_x_command(__org_qemu_x_EnumList *a,

                                              __org_qemu_x_StructList *b,

                                              __org_qemu_x_Union2 *c,

                                              __org_qemu_x_Alt *d,

                                              Error **errp)

{

    __org_qemu_x_Union1 *ret = g_new0(__org_qemu_x_Union1, 1);

    ret->type = ORG_QEMU_X_UNION1_KIND___ORG_QEMU_X_BRANCH;

    ret->u.__org_qemu_x_branch = strdup("blah1");

    return ret;


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+uint64_t helper_addqv (uint64_t op1, uint64_t op2)
+
+{
+
+    uint64_t tmp = op1;

+    op1 += op2;

     if (unlikely((tmp ^ op2 ^ (-1ULL)) & (tmp ^ op1) & (1ULL << 63))) {

uint64_t helper_addqv (uint64_t op1, uint64_t op2)

{

    uint64_t tmp = op1;

    op1 += op2;

    if (unlikely((tmp ^ op2 ^ (-1ULL)) & (tmp ^ op1) & (1ULL << 63))) {

        arith_excp(env, GETPC(), EXC_M_IOV, 0);

    }

    return op1;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+void palette8torgb24(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette)
+
 {

 	unsigned i;

void palette8torgb24(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette)

{

	unsigned i;

/*

	writes 1 byte o much and might cause alignment issues on some architectures?

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

		((unsigned *)(&dst[i*3])) = ((unsigned *)palette)[ src[i] ];

*/

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

	{

		//FIXME slow?

		dst[0]= palette[ src[i]*4+2 ];

		dst[1]= palette[ src[i]*4+1 ];

		dst[2]= palette[ src[i]*4+0 ];

		dst+= 3;

	}

}


PPC_OP(extsb)

{

    T0 = (int32_t)((int8_t)(Ts0));

    RETURN();

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void balloon_stats_poll_cb(void *opaque)

 {
+
     VirtIOBalloon *s = opaque;

     VirtIODevice *vdev = VIRTIO_DEVICE(s);

static void balloon_stats_poll_cb(void *opaque)

{

    VirtIOBalloon *s = opaque;

    VirtIODevice *vdev = VIRTIO_DEVICE(s);

    if (!balloon_stats_supported(s)) {

        /* re-schedule */

        balloon_stats_change_timer(s, s->stats_poll_interval);

        return;

    }

    virtqueue_push(s->svq, s->stats_vq_elem, s->stats_vq_offset);

    virtio_notify(vdev, s->svq);

    g_free(s->stats_vq_elem);

    s->stats_vq_elem = NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static bool virtio_scsi_data_plane_handle_ctrl(VirtIODevice *vdev,

                                                VirtQueue *vq)
+
 {

     VirtIOSCSI *s = VIRTIO_SCSI(vdev);

static bool virtio_scsi_data_plane_handle_ctrl(VirtIODevice *vdev,

                                               VirtQueue *vq)

{

    VirtIOSCSI *s = VIRTIO_SCSI(vdev);

    assert(s->ctx && s->dataplane_started);

    return virtio_scsi_handle_ctrl_vq(s, vq);

}


--- a/source.c
+++ b/source.c
@@ -1,20 +1,20 @@
 static int read_key(void)
+
+{
+
+#if HAVE_TERMIOS_H
+
+    int n = 1;
+
+    unsigned char ch;
+
+    struct timeval tv;
+
+    fd_set rfds;
+

+
+    FD_ZERO(&rfds);

     FD_SET(0, &rfds);

static int read_key(void)

{

#if HAVE_TERMIOS_H

    int n = 1;

    unsigned char ch;

    struct timeval tv;

    fd_set rfds;

    FD_ZERO(&rfds);

    FD_SET(0, &rfds);

    tv.tv_sec = 0;

    tv.tv_usec = 0;

    n = select(1, &rfds, NULL, NULL, &tv);

    if (n > 0) {

        n = read(0, &ch, 1);

        if (n == 1)

            return ch;

        return n;

    }

#elif HAVE_CONIO_H

    if(kbhit())

        return(getch());

#endif

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void bdrv_get_backing_filename(BlockDriverState *bs,

+                               char *filename, int filename_size)
+
 {

     pstrcpy(filename, filename_size, bs->backing_file);

void bdrv_get_backing_filename(BlockDriverState *bs,

                               char *filename, int filename_size)

{

    pstrcpy(filename, filename_size, bs->backing_file);

}


static void gif_put_bits_rev(PutBitContext *s, int n, unsigned int value)

{

    unsigned int bit_buf;

    int bit_cnt;

    //    printf("put_bits=%d %x\n", n, value);

    assert(n == 32 || value < (1U << n));

    bit_buf = s->bit_buf;

    bit_cnt = 32 - s->bit_left; /* XXX:lazyness... was = s->bit_cnt; */

    //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);

    /* XXX: optimize */

    if (n < (32-bit_cnt)) {

        bit_buf |= value << (bit_cnt);

        bit_cnt+=n;

    } else {

        bit_buf |= value << (bit_cnt);

        *s->buf_ptr = bit_buf & 0xff;

        s->buf_ptr[1] = (bit_buf >> 8) & 0xff;

        s->buf_ptr[2] = (bit_buf >> 16) & 0xff;

        s->buf_ptr[3] = (bit_buf >> 24) & 0xff;

        //printf("bitbuf = %08x\n", bit_buf);

        s->buf_ptr+=4;

        if (s->buf_ptr >= s->buf_end)

            puts("bit buffer overflow !!"); // should never happen ! who got rid of the callback ???

//            flush_buffer_rev(s);

        bit_cnt=bit_cnt + n - 32;

        if (bit_cnt == 0) {

            bit_buf = 0;

        } else {

            bit_buf = value >> (n - bit_cnt);

        }

    }

    s->bit_buf = bit_buf;

    s->bit_left = 32 - bit_cnt;

}


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

 	t_gen_mov_preg_TN(dc, dc->op2, t[0]);

+	if (dc->op2 == PR_CCS) {
+
+		cris_update_cc_op(dc, CC_OP_FLAGS, 4);
+
+		dc->flags_uptodate = 1;

 	}

static unsigned int dec_move_rp(DisasContext *dc)

{

	TCGv t[2];

	DIS(fprintf (logfile, "move $r%u, $p%u\n", dc->op1, dc->op2));

	cris_cc_mask(dc, 0);

	t[0] = tcg_temp_new(TCG_TYPE_TL);

	if (dc->op2 == PR_CCS) {

		cris_evaluate_flags(dc);

		t_gen_mov_TN_reg(t[0], dc->op1);

		if (dc->tb_flags & U_FLAG) {

			t[1] = tcg_temp_new(TCG_TYPE_TL);

			/* User space is not allowed to touch all flags.  */

			tcg_gen_andi_tl(t[0], t[0], 0x39f);

			tcg_gen_andi_tl(t[1], cpu_PR[PR_CCS], ~0x39f);

			tcg_gen_or_tl(t[0], t[1], t[0]);

			tcg_temp_free(t[1]);

		}

	}

	else

		t_gen_mov_TN_reg(t[0], dc->op1);

	t_gen_mov_preg_TN(dc, dc->op2, t[0]);

	if (dc->op2 == PR_CCS) {

		cris_update_cc_op(dc, CC_OP_FLAGS, 4);

		dc->flags_uptodate = 1;

	}

	tcg_temp_free(t[0]);

	return 2;

}


--- 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
@@ -1,11 +1,11 @@
 static int v9fs_synth_init(FsContext *ctx)

 {
+
+    QLIST_INIT(&v9fs_synth_root.child);
+
+    qemu_mutex_init(&v9fs_synth_mutex);
+

     /* Add "." and ".." entries for root */

static int v9fs_synth_init(FsContext *ctx)

{

    QLIST_INIT(&v9fs_synth_root.child);

    qemu_mutex_init(&v9fs_synth_mutex);

    /* Add "." and ".." entries for root */

    v9fs_add_dir_node(&v9fs_synth_root, v9fs_synth_root.attr->mode,

                      "..", v9fs_synth_root.attr, v9fs_synth_root.attr->inode);

    v9fs_add_dir_node(&v9fs_synth_root, v9fs_synth_root.attr->mode,

                      ".", v9fs_synth_root.attr, v9fs_synth_root.attr->inode);

    /* Mark the subsystem is ready for use */

    v9fs_synth_fs = 1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+bool vhost_net_query(VHostNetState *net, VirtIODevice *dev)
+
 {

     return false;

bool vhost_net_query(VHostNetState *net, VirtIODevice *dev)

{

    return false;

}


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

+{
+
+    term_printf("(qemu) ");

     fflush(stdout);

static void term_show_prompt2(void)

{

    term_printf("(qemu) ");

    fflush(stdout);

    term_last_cmd_buf_index = 0;

    term_last_cmd_buf_size = 0;

    term_esc_state = IS_NORM;

}


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

     const float *in = audio + 448;

+    float *out = sce->ret;
+
+
+
+    for (int w = 0; w < 8; w++) {

         dsp->vector_fmul        (out, in, w ? pwindow : swindow, 128);

WINDOW_FUNC(eight_short)

{

    const float *swindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;

    const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;

    const float *in = audio + 448;

    float *out = sce->ret;

    for (int w = 0; w < 8; w++) {

        dsp->vector_fmul        (out, in, w ? pwindow : swindow, 128);

        out += 128;

        in  += 128;

        dsp->vector_fmul_reverse(out, in, swindow, 128);

        out += 128;

    }

}


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

+    ms->kernel_irqchip = value;
+
 }

static void machine_set_kernel_irqchip(Object *obj, bool value, Error **errp)

{

    MachineState *ms = MACHINE(obj);

    ms->kernel_irqchip = value;

}


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

     /* qemu_log("eTSEC cleanup\n"); */

+}

static void etsec_cleanup(NetClientState *nc)

{

    /* qemu_log("eTSEC cleanup\n"); */

}


--- a/source.c
+++ b/source.c
@@ -3,9 +3,9 @@
                                 uint64_t value, unsigned size)

 {
+
+    arm_mptimer_state *s = (arm_mptimer_state *)opaque;
+
     int id = get_current_cpu(s);

     timerblock_write(&s->timerblock[id * 2], addr, value, size);

static void arm_thistimer_write(void *opaque, target_phys_addr_t addr,

                                uint64_t value, unsigned size)

{

    arm_mptimer_state *s = (arm_mptimer_state *)opaque;

    int id = get_current_cpu(s);

    timerblock_write(&s->timerblock[id * 2], addr, value, size);

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
                           aiocb->aio_offset + offset);

          else
+
+             len = pread(aiocb->aio_fildes,
+
+                         buf + offset,
+
                          aiocb->aio_nbytes - offset,

                          aiocb->aio_offset + offset);

static size_t handle_aiocb_rw_linear(struct qemu_paiocb *aiocb, char *buf)

{

    size_t offset = 0;

    size_t len;

    while (offset < aiocb->aio_nbytes) {

         if (aiocb->aio_type == QEMU_PAIO_WRITE)

             len = pwrite(aiocb->aio_fildes,

                          (const char *)buf + offset,

                          aiocb->aio_nbytes - offset,

                          aiocb->aio_offset + offset);

         else

             len = pread(aiocb->aio_fildes,

                         buf + offset,

                         aiocb->aio_nbytes - offset,

                         aiocb->aio_offset + offset);

         if (len == -1 && errno == EINTR)

             continue;

         else if (len == -1) {

             offset = -errno;

             break;

         } else if (len == 0)

             break;

         offset += len;

    }

    return offset;

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
         /* sNaN conversion */

         farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN | POWERPC_EXCP_FP_VXCVI);
+
+    } else if (unlikely(float64_is_nan(farg.d) || float64_is_infinity(farg.d))) {
+
+        /* qNan / infinity conversion */
+
         farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXCVI);

     } else {

uint64_t helper_fctid (uint64_t arg)

{

    CPU_DoubleU farg;

    farg.ll = arg;

    if (unlikely(float64_is_signaling_nan(farg.d))) {

        /* sNaN conversion */

        farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN | POWERPC_EXCP_FP_VXCVI);

    } else if (unlikely(float64_is_nan(farg.d) || float64_is_infinity(farg.d))) {

        /* qNan / infinity conversion */

        farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXCVI);

    } else {

        farg.ll = float64_to_int64(farg.d, &env->fp_status);

    }

    return farg.ll;

}


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

     uintptr_t ra = GETPC();

+    uint64_t hi, lo;
+
+
+
+    if (parallel_cpus) {

 #ifndef CONFIG_ATOMIC128

uint64_t HELPER(lpq)(CPUS390XState *env, uint64_t addr)

{

    uintptr_t ra = GETPC();

    uint64_t hi, lo;

    if (parallel_cpus) {

#ifndef CONFIG_ATOMIC128

        cpu_loop_exit_atomic(ENV_GET_CPU(env), ra);

#else

        int mem_idx = cpu_mmu_index(env, false);

        TCGMemOpIdx oi = make_memop_idx(MO_TEQ | MO_ALIGN_16, mem_idx);

        Int128 v = helper_atomic_ldo_be_mmu(env, addr, oi, ra);

        hi = int128_gethi(v);

        lo = int128_getlo(v);

#endif

    } else {

        check_alignment(env, addr, 16, ra);

        hi = cpu_ldq_data_ra(env, addr + 0, ra);

        lo = cpu_ldq_data_ra(env, addr + 8, ra);

    }

    env->retxl = lo;

    return hi;

}


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

 {

+    uint32_t features = 0;
+
+
+
+    /* Linux kernel 2.6.25.  It understood MAC (as everyone must),

      * but also these: */

static uint32_t virtio_net_bad_features(VirtIODevice *vdev)

{

    uint32_t features = 0;

    /* Linux kernel 2.6.25.  It understood MAC (as everyone must),

     * but also these: */

    features |= (1 << VIRTIO_NET_F_MAC);

    features |= (1 << VIRTIO_NET_F_CSUM);

    features |= (1 << VIRTIO_NET_F_HOST_TSO4);

    features |= (1 << VIRTIO_NET_F_HOST_TSO6);

    features |= (1 << VIRTIO_NET_F_HOST_ECN);

    return features;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 void pstrcpy_targphys(const char *name, target_phys_addr_t dest, int buf_size,

                       const char *source)
+
+{
+
+    const char *nulp;
+
     char *ptr;

void pstrcpy_targphys(const char *name, target_phys_addr_t dest, int buf_size,

                      const char *source)

{

    const char *nulp;

    char *ptr;

    if (buf_size <= 0) return;

    nulp = memchr(source, 0, buf_size);

    if (nulp) {

        rom_add_blob_fixed(name, source, (nulp - source) + 1, dest);

    } else {

        rom_add_blob_fixed(name, source, buf_size, dest);

        ptr = rom_ptr(dest + buf_size - 1);

        *ptr = 0;

    }

}


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

     if (next_map.nodes_nb + nodes > next_map.nodes_nb_alloc) {

+        next_map.nodes_nb_alloc = MAX(next_map.nodes_nb_alloc * 2,
+
+                                            16);
+
+        next_map.nodes_nb_alloc = MAX(next_map.nodes_nb_alloc,

                                       next_map.nodes_nb + nodes);

static void phys_map_node_reserve(unsigned nodes)

{

    if (next_map.nodes_nb + nodes > next_map.nodes_nb_alloc) {

        next_map.nodes_nb_alloc = MAX(next_map.nodes_nb_alloc * 2,

                                            16);

        next_map.nodes_nb_alloc = MAX(next_map.nodes_nb_alloc,

                                      next_map.nodes_nb + nodes);

        next_map.nodes = g_renew(Node, next_map.nodes,

                                 next_map.nodes_nb_alloc);

    }

}


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

     vp8_idct_dc_add_c(dst+ 4, block[1], stride);

+    vp8_idct_dc_add_c(dst+ 8, block[2], stride);
+
+    vp8_idct_dc_add_c(dst+12, block[3], stride);

 }

static void vp8_idct_dc_add4y_c(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride)

{

    vp8_idct_dc_add_c(dst+ 0, block[0], stride);

    vp8_idct_dc_add_c(dst+ 4, block[1], stride);

    vp8_idct_dc_add_c(dst+ 8, block[2], stride);

    vp8_idct_dc_add_c(dst+12, block[3], stride);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static uint64_t mpcore_scu_read(void *opaque, target_phys_addr_t offset,

+                                unsigned size)
+
+{
+
+    mpcore_priv_state *s = (mpcore_priv_state *)opaque;

     int id;

static uint64_t mpcore_scu_read(void *opaque, target_phys_addr_t offset,

                                unsigned size)

{

    mpcore_priv_state *s = (mpcore_priv_state *)opaque;

    int id;

    /* SCU */

    switch (offset) {

    case 0x00: /* Control.  */

        return s->scu_control;

    case 0x04: /* Configuration.  */

        id = ((1 << s->num_cpu) - 1) << 4;

        return id | (s->num_cpu - 1);

    case 0x08: /* CPU status.  */

        return 0;

    case 0x0c: /* Invalidate all.  */

        return 0;

    default:

        hw_error("mpcore_priv_read: Bad offset %x\n", (int)offset);

    }

}


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

                                       int rc, int *result)

+{

     BlockDriverState *bs;

static BlockJob *test_block_job_start(unsigned int iterations,

                                      bool use_timer,

                                      int rc, int *result)

{

    BlockDriverState *bs;

    TestBlockJob *s;

    TestBlockJobCBData *data;

    data = g_new0(TestBlockJobCBData, 1);

    bs = bdrv_new();

    s = block_job_create(&test_block_job_driver, bs, 0, test_block_job_cb,

                         data, &error_abort);

    s->iterations = iterations;

    s->use_timer = use_timer;

    s->rc = rc;

    s->result = result;

    s->common.co = qemu_coroutine_create(test_block_job_run);

    data->job = s;

    data->result = result;

    qemu_coroutine_enter(s->common.co, s);

    return &s->common;

}


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

+{

     return ff_vaapi_encode_init(avctx, &vaapi_encode_type_h264);

static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx)

{

    return ff_vaapi_encode_init(avctx, &vaapi_encode_type_h264);

}


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

                  &spr_read_403_pbr, &spr_write_403_pbr,

+                 0x00000000);
+
+    spr_register(env, SPR_403_PBU1,  "PBU1",
+
+                 SPR_NOACCESS, SPR_NOACCESS,

                  &spr_read_403_pbr, &spr_write_403_pbr,

static void gen_spr_403 (CPUPPCState *env)

{

    /* MMU */

    spr_register(env, SPR_403_PBL1,  "PBL1",

                 SPR_NOACCESS, SPR_NOACCESS,

                 &spr_read_403_pbr, &spr_write_403_pbr,

                 0x00000000);

    spr_register(env, SPR_403_PBU1,  "PBU1",

                 SPR_NOACCESS, SPR_NOACCESS,

                 &spr_read_403_pbr, &spr_write_403_pbr,

                 0x00000000);

    spr_register(env, SPR_403_PBL2,  "PBL2",

                 SPR_NOACCESS, SPR_NOACCESS,

                 &spr_read_403_pbr, &spr_write_403_pbr,

                 0x00000000);

    spr_register(env, SPR_403_PBU2,  "PBU2",

                 SPR_NOACCESS, SPR_NOACCESS,

                 &spr_read_403_pbr, &spr_write_403_pbr,

                 0x00000000);

    /* Debug */

    /* XXX : not implemented */

    spr_register(env, SPR_40x_DAC2, "DAC2",

                 SPR_NOACCESS, SPR_NOACCESS,

                 &spr_read_generic, &spr_write_generic,

                 0x00000000);

    /* XXX : not implemented */

    spr_register(env, SPR_40x_IAC2, "IAC2",

                 SPR_NOACCESS, SPR_NOACCESS,

                 &spr_read_generic, &spr_write_generic,

                 0x00000000);

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
     qemu_chr_parse_common(opts, qapi_ChardevFile_base(file));

     file->out = g_strdup(path);
+
+
+
+    file->has_append = true;
+
     file->append = qemu_opt_get_bool(opts, "append", false);

 }

static void qemu_chr_parse_file_out(QemuOpts *opts, ChardevBackend *backend,

                                    Error **errp)

{

    const char *path = qemu_opt_get(opts, "path");

    ChardevFile *file;

    if (path == NULL) {

        error_setg(errp, "chardev: file: no filename given");

        return;

    }

    file = backend->u.file = g_new0(ChardevFile, 1);

    qemu_chr_parse_common(opts, qapi_ChardevFile_base(file));

    file->out = g_strdup(path);

    file->has_append = true;

    file->append = qemu_opt_get_bool(opts, "append", false);

}


--- a/source.c
+++ b/source.c
@@ -23,9 +23,9 @@
     conditional_branch(ch);

+
+wait:
+
+    qemu_bh_schedule(dbdma_bh);
+
 }

static void nop(DBDMA_channel *ch)

{

    dbdma_cmd *current = &ch->current;

    if (conditional_wait(ch))

        goto wait;

    current->xfer_status = cpu_to_le16(be32_to_cpu(ch->regs[DBDMA_STATUS]));

    dbdma_cmdptr_save(ch);

    conditional_interrupt(ch);

    conditional_branch(ch);

wait:

    qemu_bh_schedule(dbdma_bh);

}


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

        MIPS_TLB_NB not being a power of two.  But so does real silicon.  */

+    invalidate_tlb(env->CP0_index & (MIPS_TLB_NB - 1), 0);
+
+    fill_tlb(env->CP0_index & (MIPS_TLB_NB - 1));
+
+}

void do_tlbwi (void)

{

    /* Discard cached TLB entries.  We could avoid doing this if the

       tlbwi is just upgrading access permissions on the current entry;

       that might be a further win.  */

    mips_tlb_flush_extra (env, MIPS_TLB_NB);

    /* Wildly undefined effects for CP0_index containing a too high value and

       MIPS_TLB_NB not being a power of two.  But so does real silicon.  */

    invalidate_tlb(env->CP0_index & (MIPS_TLB_NB - 1), 0);

    fill_tlb(env->CP0_index & (MIPS_TLB_NB - 1));

}


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

     XenIOState *state = container_of(listener, XenIOState, io_listener);

+
+
+    memory_region_ref(section->mr);
+

     xen_map_io_section(xen_xc, xen_domid, state->ioservid, section);

static void xen_io_add(MemoryListener *listener,

                       MemoryRegionSection *section)

{

    XenIOState *state = container_of(listener, XenIOState, io_listener);

    memory_region_ref(section->mr);

    xen_map_io_section(xen_xc, xen_domid, state->ioservid, section);

}


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

             qemu_chr_add_handlers(s->chn[i].chr, serial_can_receive,

+                                  serial_receive1, serial_event, &s->chn[i]);
+
+        }
+
+    }

     s->chn[0].otherchn = &s->chn[1];

static int escc_init1(SysBusDevice *dev)

{

    ESCCState *s = ESCC(dev);

    unsigned int i;

    s->chn[0].disabled = s->disabled;

    s->chn[1].disabled = s->disabled;

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

        sysbus_init_irq(dev, &s->chn[i].irq);

        s->chn[i].chn = 1 - i;

        s->chn[i].clock = s->frequency / 2;

        if (s->chn[i].chr) {

            qemu_chr_add_handlers(s->chn[i].chr, serial_can_receive,

                                  serial_receive1, serial_event, &s->chn[i]);

        }

    }

    s->chn[0].otherchn = &s->chn[1];

    s->chn[1].otherchn = &s->chn[0];

    memory_region_init_io(&s->mmio, OBJECT(s), &escc_mem_ops, s, "escc",

                          ESCC_SIZE << s->it_shift);

    sysbus_init_mmio(dev, &s->mmio);

    if (s->chn[0].type == mouse) {

        qemu_add_mouse_event_handler(sunmouse_event, &s->chn[0], 0,

                                     "QEMU Sun Mouse");

    }

    if (s->chn[1].type == kbd) {

        qemu_add_kbd_event_handler(sunkbd_event, &s->chn[1]);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 unsigned int avpriv_toupper4(unsigned int x)
+
 {

     return av_toupper(x & 0xFF) +

unsigned int avpriv_toupper4(unsigned int x)

{

    return av_toupper(x & 0xFF) +

          (av_toupper((x >>  8) & 0xFF) << 8)  +

          (av_toupper((x >> 16) & 0xFF) << 16) +

          (av_toupper((x >> 24) & 0xFF) << 24);

}


--- a/source.c
+++ b/source.c
@@ -37,11 +37,11 @@
     phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS] = dirty_flags;

     /* we remove the notdirty callback only if the code has been
+
+       flushed */
+
+    if (dirty_flags == 0xff)
+
         tlb_set_dirty(cpu_single_env, cpu_single_env->mem_io_vaddr);

 }

static void notdirty_mem_writeb(void *opaque, target_phys_addr_t ram_addr,

                                uint32_t val)

{

    int dirty_flags;

    dirty_flags = phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS];

    if (!(dirty_flags & CODE_DIRTY_FLAG)) {

#if !defined(CONFIG_USER_ONLY)

        tb_invalidate_phys_page_fast(ram_addr, 1);

        dirty_flags = phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS];

#endif

    }

    stb_p(qemu_get_ram_ptr(ram_addr), val);

#ifdef CONFIG_KQEMU

    if (cpu_single_env->kqemu_enabled &&

        (dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK)

        kqemu_modify_page(cpu_single_env, ram_addr);

#endif

    dirty_flags |= (0xff & ~CODE_DIRTY_FLAG);

    phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS] = dirty_flags;

    /* we remove the notdirty callback only if the code has been

       flushed */

    if (dirty_flags == 0xff)

        tlb_set_dirty(cpu_single_env, cpu_single_env->mem_io_vaddr);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void pcie_cap_slot_hot_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,

                                  Error **errp)
+
+{
+
     uint8_t *exp_cap;

void pcie_cap_slot_hot_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,

                                 Error **errp)

{

    uint8_t *exp_cap;

    pcie_cap_slot_hotplug_common(PCI_DEVICE(hotplug_dev), dev, &exp_cap, errp);

    object_unparent(OBJECT(dev));

    pci_word_test_and_clear_mask(exp_cap + PCI_EXP_SLTSTA,

                                 PCI_EXP_SLTSTA_PDS);

    pcie_cap_slot_event(PCI_DEVICE(hotplug_dev), PCI_EXP_HP_EV_PDC);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static VirtIOBlockReq *virtio_blk_get_request(VirtIOBlock *s)

+{

     VirtIOBlockReq *req = virtio_blk_alloc_request(s);

static VirtIOBlockReq *virtio_blk_get_request(VirtIOBlock *s)

{

    VirtIOBlockReq *req = virtio_blk_alloc_request(s);

    if (!virtqueue_pop(s->vq, req->elem)) {

        virtio_blk_free_request(req);

        return NULL;

    }

    return req;

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 static void gen_tlbwe_booke206(DisasContext *ctx)
+
+{
+
 #if defined(CONFIG_USER_ONLY)

     gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

+#else

     if (unlikely(ctx->pr)) {

static void gen_tlbwe_booke206(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

#else

    if (unlikely(ctx->pr)) {

        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

        return;

    }

    gen_update_nip(ctx, ctx->nip - 4);

    gen_helper_booke206_tlbwe(cpu_env);

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+static int libquvi_probe(AVProbeData *p)
+
+{
+
+    int score;
+
+    quvi_t q;
+
+    QUVIcode rc;

static int libquvi_probe(AVProbeData *p)

{

    int score;

    quvi_t q;

    QUVIcode rc;

    rc = quvi_init(&q);

    if (rc != QUVI_OK)

        return AVERROR(ENOMEM);

    score = quvi_supported(q, (char *)p->filename) == QUVI_OK ? AVPROBE_SCORE_EXTENSION : 0;

    quvi_close(&q);

    return score;

}


--- a/source.c
+++ b/source.c
@@ -3,4 +3,4 @@
 {
     if (sector & dev->sector_mask) {
     if (size % dev->conf->logical_block_size) {
+    return true;

static bool virtio_blk_sect_range_ok(VirtIOBlock *dev,
                                     uint64_t sector, size_t size)
{
    if (sector & dev->sector_mask) {
    if (size % dev->conf->logical_block_size) {
    return true;


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
     CPUState *cs;
     if (env->pil_in && (env->interrupt_index == 0 ||
                         (env->interrupt_index & ~15) == TT_EXTINT)) {
+        unsigned int i;
+        for (i = 15; i > 0; i--) {
+            if (env->pil_in & (1 << i)) {
+                int old_interrupt = env->interrupt_index;
+                env->interrupt_index = TT_EXTINT | i;
                 if (old_interrupt != env->interrupt_index) {
                     cs = CPU(sparc_env_get_cpu(env));
                     trace_sun4m_cpu_interrupt(i);

void cpu_check_irqs(CPUSPARCState *env)
{
    CPUState *cs;
    if (env->pil_in && (env->interrupt_index == 0 ||
                        (env->interrupt_index & ~15) == TT_EXTINT)) {
        unsigned int i;
        for (i = 15; i > 0; i--) {
            if (env->pil_in & (1 << i)) {
                int old_interrupt = env->interrupt_index;
                env->interrupt_index = TT_EXTINT | i;
                if (old_interrupt != env->interrupt_index) {
                    cs = CPU(sparc_env_get_cpu(env));
                    trace_sun4m_cpu_interrupt(i);
                    cpu_interrupt(cs, CPU_INTERRUPT_HARD);
                }
                break;
            }
        }
    } else if (!env->pil_in && (env->interrupt_index & ~15) == TT_EXTINT) {
        cs = CPU(sparc_env_get_cpu(env));
        trace_sun4m_cpu_reset_interrupt(env->interrupt_index & 15);
        env->interrupt_index = 0;
        cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);
    }
}


--- a/source.c
+++ b/source.c
@@ -65,9 +65,9 @@
         program_interrupt(env, PGM_OPERAND, 2);

         return;
+
+    }
+
+    setcc(cpu, cc);
+
 }

void ioinst_handle_rchp(S390CPU *cpu, uint64_t reg1)

{

    int cc;

    uint8_t cssid;

    uint8_t chpid;

    int ret;

    CPUS390XState *env = &cpu->env;

    if (RCHP_REG1_RES(reg1)) {

        program_interrupt(env, PGM_OPERAND, 2);

        return;

    }

    cssid = RCHP_REG1_CSSID(reg1);

    chpid = RCHP_REG1_CHPID(reg1);

    trace_ioinst_chp_id("rchp", cssid, chpid);

    ret = css_do_rchp(cssid, chpid);

    switch (ret) {

    case -ENODEV:

        cc = 3;

        break;

    case -EBUSY:

        cc = 2;

        break;

    case 0:

        cc = 0;

        break;

    default:

        /* Invalid channel subsystem. */

        program_interrupt(env, PGM_OPERAND, 2);

        return;

    }

    setcc(cpu, cc);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void migrate_fd_put_ready(void *opaque)
+
+{
+
+    MigrationState *s = opaque;
+
     int ret;

static void migrate_fd_put_ready(void *opaque)

{

    MigrationState *s = opaque;

    int ret;

    if (s->state != MIG_STATE_ACTIVE) {

        DPRINTF("put_ready returning because of non-active state\n");

        return;

    }

    DPRINTF("iterate\n");

    ret = qemu_savevm_state_iterate(s->mon, s->file);

    if (ret < 0) {

        migrate_fd_error(s);

    } else if (ret == 1) {

        int old_vm_running = runstate_is_running();

        DPRINTF("done iterating\n");

        vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);

        if (qemu_savevm_state_complete(s->mon, s->file) < 0) {

            migrate_fd_error(s);

        } else {

            migrate_fd_completed(s);

        }

        if (s->state != MIG_STATE_COMPLETED) {

            if (old_vm_running) {

                vm_start();

            }

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void gen_tlbwe_440(DisasContext *ctx)
+
+{
+
 #if defined(CONFIG_USER_ONLY)

     gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
@@ -14,7 +14,7 @@

         return;

+    }

     switch (rB(ctx->opcode)) {

static void gen_tlbwe_440(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

#else

    if (unlikely(ctx->pr)) {

        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

        return;

    }

    switch (rB(ctx->opcode)) {

    case 0:

    case 1:

    case 2:

        {

            TCGv_i32 t0 = tcg_const_i32(rB(ctx->opcode));

            gen_helper_440_tlbwe(cpu_env, t0, cpu_gpr[rA(ctx->opcode)],

                                 cpu_gpr[rS(ctx->opcode)]);

            tcg_temp_free_i32(t0);

        }

        break;

    default:

        gen_inval_exception(ctx, POWERPC_EXCP_INVAL_INVAL);

        break;

    }

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+bool qemu_co_queue_next(CoQueue *queue)
+
+{
+
+    Coroutine *next;

bool qemu_co_queue_next(CoQueue *queue)

{

    Coroutine *next;

    next = QTAILQ_FIRST(&queue->entries);

    if (next) {

        QTAILQ_REMOVE(&queue->entries, next, co_queue_next);

        QTAILQ_INSERT_TAIL(&unlock_bh_queue, next, co_queue_next);

        trace_qemu_co_queue_next(next);

        qemu_bh_schedule(unlock_bh);

    }

    return (next != NULL);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void cg3_initfn(Object *obj)

 {
+
     SysBusDevice *sbd = SYS_BUS_DEVICE(obj);

     CG3State *s = CG3(obj);

static void cg3_initfn(Object *obj)

{

    SysBusDevice *sbd = SYS_BUS_DEVICE(obj);

    CG3State *s = CG3(obj);

    memory_region_init_ram(&s->rom, NULL, "cg3.prom", FCODE_MAX_ROM_SIZE,

                           &error_abort);

    memory_region_set_readonly(&s->rom, true);

    sysbus_init_mmio(sbd, &s->rom);

    memory_region_init_io(&s->reg, NULL, &cg3_reg_ops, s, "cg3.reg",

                          CG3_REG_SIZE);

    sysbus_init_mmio(sbd, &s->reg);

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
     if(ctx->tok_ptrs[type] >= ctx->tok_lens[type]) {

         av_log(ctx->avctx, AV_LOG_ERROR, "Read token from stream %i out of bounds (%i>=%i)\n", type, ctx->tok_ptrs[type], ctx->tok_lens[type]);
+
         return 0;

     }

static inline int GET_TOK(TM2Context *ctx,int type) {

    if(ctx->tok_ptrs[type] >= ctx->tok_lens[type]) {

        av_log(ctx->avctx, AV_LOG_ERROR, "Read token from stream %i out of bounds (%i>=%i)\n", type, ctx->tok_ptrs[type], ctx->tok_lens[type]);

        return 0;

    }

    if(type <= TM2_MOT)

        return ctx->deltas[type][ctx->tokens[type][ctx->tok_ptrs[type]++]];

    return ctx->tokens[type][ctx->tok_ptrs[type]++];

}


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

                         uint8_t *src2, ptrdiff_t stride, int h)

+{

     LOCAL_ALIGNED_16(int16_t, temp, [64]);

static int dct_max8x8_c(MpegEncContext *s, uint8_t *src1,

                        uint8_t *src2, ptrdiff_t stride, int h)

{

    LOCAL_ALIGNED_16(int16_t, temp, [64]);

    int sum = 0, i;

    av_assert2(h == 8);

    s->pdsp.diff_pixels(temp, src1, src2, stride);

    s->fdsp.fdct(temp);

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

        sum = FFMAX(sum, FFABS(temp[i]));

    return sum;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static uint64_t qvirtio_pci_config_readq(QVirtioDevice *d, uint64_t off)

 {
+
     QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;

     uint64_t val;

static uint64_t qvirtio_pci_config_readq(QVirtioDevice *d, uint64_t off)

{

    QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;

    uint64_t val;

    val = qpci_io_readq(dev->pdev, CONFIG_BASE(dev) + off);

    if (qvirtio_is_big_endian(d)) {

        val = bswap64(val);

    }

    return val;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void visit_start_implicit_struct(Visitor *v, void **obj, size_t size,
+
                                  Error **errp)

 {

void visit_start_implicit_struct(Visitor *v, void **obj, size_t size,

                                 Error **errp)

{

    if (!error_is_set(errp) && v->start_implicit_struct) {

        v->start_implicit_struct(v, obj, size, errp);

    }

}


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

     trace_esp_get_cmd(dmalen, target);
+
+
+
+    s->ti_size = 0;
+
     s->ti_rptr = 0;

     s->ti_wptr = 0;

static uint32_t get_cmd(ESPState *s, uint8_t *buf, uint8_t buflen)

{

    uint32_t dmalen;

    int target;

    target = s->wregs[ESP_WBUSID] & BUSID_DID;

    if (s->dma) {

        dmalen = s->rregs[ESP_TCLO];

        dmalen |= s->rregs[ESP_TCMID] << 8;

        dmalen |= s->rregs[ESP_TCHI] << 16;

        if (dmalen > buflen) {

        s->dma_memory_read(s->dma_opaque, buf, dmalen);

    } else {

        dmalen = s->ti_size;

        memcpy(buf, s->ti_buf, dmalen);

        buf[0] = buf[2] >> 5;

    trace_esp_get_cmd(dmalen, target);

    s->ti_size = 0;

    s->ti_rptr = 0;

    s->ti_wptr = 0;

    if (s->current_req) {

        /* Started a new command before the old one finished.  Cancel it.  */

        scsi_req_cancel(s->current_req);

        s->async_len = 0;

    s->current_dev = scsi_device_find(&s->bus, 0, target, 0);

    if (!s->current_dev) {

        // No such drive

        s->rregs[ESP_RSTAT] = 0;

        s->rregs[ESP_RINTR] = INTR_DC;

        s->rregs[ESP_RSEQ] = SEQ_0;

        esp_raise_irq(s);

    return dmalen;


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

                 int socktype, int port_offset, Error **errp)

+{

     QemuOpts *opts;

int inet_listen(const char *str, char *ostr, int olen,

                int socktype, int port_offset, Error **errp)

{

    QemuOpts *opts;

    char *optstr;

    int sock = -1;

    opts = qemu_opts_create(&dummy_opts, NULL, 0);

    if (inet_parse(opts, str) == 0) {

        sock = inet_listen_opts(opts, port_offset, errp);

        if (sock != -1 && ostr) {

            optstr = strchr(str, ',');

            if (qemu_opt_get_bool(opts, "ipv6", 0)) {

                snprintf(ostr, olen, "[%s]:%s%s",

                         qemu_opt_get(opts, "host"),

                         qemu_opt_get(opts, "port"),

                         optstr ? optstr : "");

            } else {

                snprintf(ostr, olen, "%s:%s%s",

                         qemu_opt_get(opts, "host"),

                         qemu_opt_get(opts, "port"),

                         optstr ? optstr : "");

            }

        }

    } else {

        error_set(errp, QERR_SOCKET_CREATE_FAILED);

    }

    qemu_opts_del(opts);

    return sock;

}


yuv2rgb48_2_c_template(SwsContext *c, const int32_t *buf[2],

                       const int32_t *ubuf[2], const int32_t *vbuf[2],

                       const int32_t *abuf[2], uint16_t *dest, int dstW,

                       int yalpha, int uvalpha, int y,

                       enum AVPixelFormat target)

{

    const int32_t *buf0  = buf[0],  *buf1  = buf[1],

                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],

                  *vbuf0 = vbuf[0], *vbuf1 = vbuf[1];

    int  yalpha1 = 4096 - yalpha;

    int uvalpha1 = 4096 - uvalpha;

    int i;

    for (i = 0; i < ((dstW + 1) >> 1); i++) {

        int Y1 = (buf0[i * 2]     * yalpha1  + buf1[i * 2]     * yalpha) >> 14;

        int Y2 = (buf0[i * 2 + 1] * yalpha1  + buf1[i * 2 + 1] * yalpha) >> 14;

        int U  = (ubuf0[i]        * uvalpha1 + ubuf1[i]        * uvalpha + (-128 << 23)) >> 14;

        int V  = (vbuf0[i]        * uvalpha1 + vbuf1[i]        * uvalpha + (-128 << 23)) >> 14;

        int R, G, B;

        Y1 -= c->yuv2rgb_y_offset;

        Y2 -= c->yuv2rgb_y_offset;

        Y1 *= c->yuv2rgb_y_coeff;

        Y2 *= c->yuv2rgb_y_coeff;

        Y1 += 1 << 13;

        Y2 += 1 << 13;

        R = V * c->yuv2rgb_v2r_coeff;

        G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;

        B =                            U * c->yuv2rgb_u2b_coeff;

        output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);

        output_pixel(&dest[1], av_clip_uintp2(  G + Y1, 30) >> 14);

        output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);

        output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14);

        output_pixel(&dest[4], av_clip_uintp2(  G + Y2, 30) >> 14);

        output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14);

        dest += 6;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 float32 HELPER(ucf64_divs)(float32 a, float32 b, CPUUniCore32State *env)

+{

     return float32_div(a, b, &env->ucf64.fp_status);

float32 HELPER(ucf64_divs)(float32 a, float32 b, CPUUniCore32State *env)

{

    return float32_div(a, b, &env->ucf64.fp_status);

}


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

     int64_t v;

+    uint32 res;

     v = float32_to_int64_round_to_zero(a STATUS_VAR);
+
     if (v < 0) {

         res = 0;

uint32 float32_to_uint32_round_to_zero( float32 a STATUS_PARAM )

{

    int64_t v;

    uint32 res;

    v = float32_to_int64_round_to_zero(a STATUS_VAR);

    if (v < 0) {

        res = 0;

        float_raise( float_flag_invalid STATUS_VAR);

    } else if (v > 0xffffffff) {

        res = 0xffffffff;

        float_raise( float_flag_invalid STATUS_VAR);

    } else {

        res = v;

    }

    return res;

}


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

     avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;

+    avctx->coded_frame->key_frame = 1;
+
+    avctx->bits_per_coded_sample = av_get_bits_per_pixel(desc);
+
+    if(!avctx->codec_tag)

         avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt);

static av_cold int raw_encode_init(AVCodecContext *avctx)

{

    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);

    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;

    avctx->bits_per_coded_sample = av_get_bits_per_pixel(desc);

    if(!avctx->codec_tag)

        avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 void breakpoint_handler(CPUState *cs)

 {
+
+    X86CPU *cpu = X86_CPU(cs);
+
+    CPUX86State *env = &cpu->env;
+
     CPUBreakpoint *bp;

void breakpoint_handler(CPUState *cs)

{

    X86CPU *cpu = X86_CPU(cs);

    CPUX86State *env = &cpu->env;

    CPUBreakpoint *bp;

    if (cs->watchpoint_hit) {

        if (cs->watchpoint_hit->flags & BP_CPU) {

            cs->watchpoint_hit = NULL;

            if (check_hw_breakpoints(env, false)) {

                raise_exception(env, EXCP01_DB);

            } else {

                cpu_resume_from_signal(cs, NULL);

            }

        }

    } else {

        QTAILQ_FOREACH(bp, &cs->breakpoints, entry) {

            if (bp->pc == env->eip) {

                if (bp->flags & BP_CPU) {

                    check_hw_breakpoints(env, true);

                    raise_exception(env, EXCP01_DB);

                }

                break;

            }

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int check_pow_970MP (CPUPPCState *env)
+
+{
+
     if (env->spr[SPR_HID0] & 0x01C00000)

         return 1;

static int check_pow_970MP (CPUPPCState *env)

{

    if (env->spr[SPR_HID0] & 0x01C00000)

        return 1;

    return 0;

}


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

+    nbd_export_get(exp);
+
+    QTAILQ_FOREACH_SAFE(client, &exp->clients, next, next) {
+
         client_close(client);

     }

void nbd_export_close(NBDExport *exp)

{

    NBDClient *client, *next;

    nbd_export_get(exp);

    QTAILQ_FOREACH_SAFE(client, &exp->clients, next, next) {

        client_close(client);

    }

    nbd_export_set_name(exp, NULL);

    nbd_export_put(exp);

    if (exp->blk) {

        blk_remove_aio_context_notifier(exp->blk, blk_aio_attached,

                                        blk_aio_detach, exp);

        blk_unref(exp->blk);

        exp->blk = NULL;

    }

}


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

     info->base->service = g_strdup(serv);

+    info->base->family = inet_netfamily(sa.ss_family);
+
+    info->base->websocket = client->websocket;
+
+

     if (client->tls) {

static VncClientInfo *qmp_query_vnc_client(const VncState *client)

{

    struct sockaddr_storage sa;

    socklen_t salen = sizeof(sa);

    char host[NI_MAXHOST];

    char serv[NI_MAXSERV];

    VncClientInfo *info;

    if (getpeername(client->csock, (struct sockaddr *)&sa, &salen) < 0) {

        return NULL;

    }

    if (getnameinfo((struct sockaddr *)&sa, salen,

                    host, sizeof(host),

                    serv, sizeof(serv),

                    NI_NUMERICHOST | NI_NUMERICSERV) < 0) {

        return NULL;

    }

    info = g_malloc0(sizeof(*info));

    info->base = g_malloc0(sizeof(*info->base));

    info->base->host = g_strdup(host);

    info->base->service = g_strdup(serv);

    info->base->family = inet_netfamily(sa.ss_family);

    info->base->websocket = client->websocket;

    if (client->tls) {

        info->x509_dname = qcrypto_tls_session_get_peer_name(client->tls);

        info->has_x509_dname = info->x509_dname != NULL;

    }

#ifdef CONFIG_VNC_SASL

    if (client->sasl.conn && client->sasl.username) {

        info->has_sasl_username = true;

        info->sasl_username = g_strdup(client->sasl.username);

    }

#endif

    return info;

}


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

                                          iscsi_synccache10_cb,

+                                         acb);
+
+    if (acb->task == NULL) {
+
+        error_report("iSCSI: Failed to send synchronizecache10 command. %s",

                      iscsi_get_error(iscsi));

iscsi_aio_flush(BlockDriverState *bs,

                BlockDriverCompletionFunc *cb, void *opaque)

{

    IscsiLun *iscsilun = bs->opaque;

    struct iscsi_context *iscsi = iscsilun->iscsi;

    IscsiAIOCB *acb;

    acb = qemu_aio_get(&iscsi_aiocb_info, bs, cb, opaque);

    acb->iscsilun = iscsilun;

    acb->canceled   = 0;

    acb->bh         = NULL;

    acb->status     = -EINPROGRESS;

    acb->buf        = NULL;

    acb->task = iscsi_synchronizecache10_task(iscsi, iscsilun->lun,

                                         0, 0, 0, 0,

                                         iscsi_synccache10_cb,

                                         acb);

    if (acb->task == NULL) {

        error_report("iSCSI: Failed to send synchronizecache10 command. %s",

                     iscsi_get_error(iscsi));

        qemu_aio_release(acb);

        return NULL;

    }

    iscsi_set_events(iscsilun);

    return &acb->common;

}


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

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

+        size_t len = iov[i].iov_len;
+
+
+
+        memcpy(packet->data + packet->size, iov[i].iov_base, len);

         packet->size += len;

static ssize_t qemu_enqueue_packet_iov(VLANClientState *sender,

                                       const struct iovec *iov, int iovcnt,

                                       NetPacketSent *sent_cb)

{

    VLANPacket *packet;

    size_t max_len = 0;

    int i;

    max_len = calc_iov_length(iov, iovcnt);

    packet = qemu_malloc(sizeof(VLANPacket) + max_len);

    packet->sender = sender;

    packet->sent_cb = sent_cb;

    packet->size = 0;

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

        size_t len = iov[i].iov_len;

        memcpy(packet->data + packet->size, iov[i].iov_base, len);

        packet->size += len;

    }

    TAILQ_INSERT_TAIL(&sender->vlan->send_queue, packet, entry);

    return packet->size;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int find_start_code(const uint8_t **pbuf_ptr, const uint8_t *buf_end)

+{
+
+    const uint8_t *buf_ptr= *pbuf_ptr;
+
+

     buf_ptr++; //gurantees that -1 is within the array

static int find_start_code(const uint8_t **pbuf_ptr, const uint8_t *buf_end)

{

    const uint8_t *buf_ptr= *pbuf_ptr;

    buf_ptr++; //gurantees that -1 is within the array

    buf_end -= 2; // gurantees that +2 is within the array

    while (buf_ptr < buf_end) {

        if(*buf_ptr==0){

            while(buf_ptr < buf_end && buf_ptr[1]==0)

                buf_ptr++;

            if(buf_ptr[-1] == 0 && buf_ptr[1] == 1){

                *pbuf_ptr = buf_ptr+3;

                return buf_ptr[2] + 0x100;

            }

        }

        buf_ptr += 2;

    }

    buf_end += 2; //undo the hack above

    *pbuf_ptr = buf_end;

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     SysBusDevice *s;

+
     dev = qdev_create(NULL, "escc");

     qdev_prop_set_uint32(dev, "disabled", disabled);

void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq,

                               int disabled, int clock, int it_shift)

{

    DeviceState *dev;

    SysBusDevice *s;

    dev = qdev_create(NULL, "escc");

    qdev_prop_set_uint32(dev, "disabled", disabled);

    qdev_prop_set_uint32(dev, "frequency", clock);

    qdev_prop_set_uint32(dev, "it_shift", it_shift);

    qdev_prop_set_chr(dev, "chrB", NULL);

    qdev_prop_set_chr(dev, "chrA", NULL);

    qdev_prop_set_uint32(dev, "chnBtype", mouse);

    qdev_prop_set_uint32(dev, "chnAtype", kbd);

    qdev_init(dev);

    s = sysbus_from_qdev(dev);

    sysbus_connect_irq(s, 0, irq);

    sysbus_connect_irq(s, 1, irq);

    sysbus_mmio_map(s, 0, base);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int64_t buffered_get_rate_limit(void *opaque)

+{
+
     QEMUFileBuffered *s = opaque;

static int64_t buffered_get_rate_limit(void *opaque)

{

    QEMUFileBuffered *s = opaque;

    return s->xfer_limit;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void inner_add_yblock_bw_16_obmc_32_mmx(const uint8_t *obmc, const long obmc_stride, uint8_t * * block, int b_w, long b_h,
+
                       int src_x, int src_y, long src_stride, slice_buffer * sb, int add, uint8_t * dst8){

 snow_inner_add_yblock_mmx_header

static void inner_add_yblock_bw_16_obmc_32_mmx(const uint8_t *obmc, const long obmc_stride, uint8_t * * block, int b_w, long b_h,

                      int src_x, int src_y, long src_stride, slice_buffer * sb, int add, uint8_t * dst8){

snow_inner_add_yblock_mmx_header

snow_inner_add_yblock_mmx_start("mm1", "mm5", "3", "0", "0")

snow_inner_add_yblock_mmx_accum("2", "16", "0")

snow_inner_add_yblock_mmx_accum("1", "512", "0")

snow_inner_add_yblock_mmx_accum("0", "528", "0")

snow_inner_add_yblock_mmx_mix("0", "0")

snow_inner_add_yblock_mmx_start("mm1", "mm5", "3", "8", "8")

snow_inner_add_yblock_mmx_accum("2", "24", "8")

snow_inner_add_yblock_mmx_accum("1", "520", "8")

snow_inner_add_yblock_mmx_accum("0", "536", "8")

snow_inner_add_yblock_mmx_mix("32", "8")

snow_inner_add_yblock_mmx_end("32")

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     s->vsub  = desc->log2_chroma_h;
     s->depth = desc->comp[0].depth_minus1+1;
     s->line = av_malloc(inlink->w * sizeof(*s->line));
+    if (!s->line)
+        return AVERROR(ENOMEM);
+    for (i = 0; i < 4; i++) {
+        s->coefs[i] = precalc_coefs(s->strength[i], s->depth);
+        if (!s->coefs[i])
             return AVERROR(ENOMEM);
     }
     if (ARCH_X86)

static int config_input(AVFilterLink *inlink)
{
    HQDN3DContext *s = inlink->dst->priv;
    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
    int i;
    s->hsub  = desc->log2_chroma_w;
    s->vsub  = desc->log2_chroma_h;
    s->depth = desc->comp[0].depth_minus1+1;
    s->line = av_malloc(inlink->w * sizeof(*s->line));
    if (!s->line)
        return AVERROR(ENOMEM);
    for (i = 0; i < 4; i++) {
        s->coefs[i] = precalc_coefs(s->strength[i], s->depth);
        if (!s->coefs[i])
            return AVERROR(ENOMEM);
    }
    if (ARCH_X86)
        ff_hqdn3d_init_x86(s);
    return 0;
}


--- a/source.c
+++ b/source.c
@@ -5,5 +5,5 @@
     avctx->pix_fmt = AV_PIX_FMT_PAL8;
     s->frame = av_frame_alloc();
     if (!s->frame)
+        return AVERROR(ENOMEM);
+    return 0;

static av_cold int mm_decode_init(AVCodecContext *avctx)
{
    MmContext *s = avctx->priv_data;
    s->avctx = avctx;
    avctx->pix_fmt = AV_PIX_FMT_PAL8;
    s->frame = av_frame_alloc();
    if (!s->frame)
        return AVERROR(ENOMEM);
    return 0;


static inline void hcscale_fast_c(SwsContext *c, int16_t *dst1, int16_t *dst2,

                                  int dstWidth, const uint8_t *src1,

                                  const uint8_t *src2, int srcW, int xInc)

{

    int i;

    unsigned int xpos=0;

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

        register unsigned int xx=xpos>>16;

        register unsigned int xalpha=(xpos&0xFFFF)>>9;

        dst1[i]=(src1[xx]*(xalpha^127)+src1[xx+1]*xalpha);

        dst2[i]=(src2[xx]*(xalpha^127)+src2[xx+1]*xalpha);

        xpos+=xInc;


--- a/source.c
+++ b/source.c
@@ -29,11 +29,11 @@
         av_free_packet(&pktl->pkt);

         av_freep(&pktl);
+
+
+
+        if(ret<0)
+
             return ret;

     }

int av_write_trailer(AVFormatContext *s)

{

    int ret;

    while(s->packet_buffer){

        int ret;

        AVPacketList *pktl= s->packet_buffer;

//av_log(s, AV_LOG_DEBUG, "write_trailer st:%d dts:%lld\n", pktl->pkt.stream_index, pktl->pkt.dts);

        truncate_ts(s->streams[pktl->pkt.stream_index], &pktl->pkt);

        ret= s->oformat->write_packet(s, &pktl->pkt);

        s->packet_buffer= pktl->next;

        av_free_packet(&pktl->pkt);

        av_freep(&pktl);

        if(ret<0)

            return ret;

    }

    ret = s->oformat->write_trailer(s);

    av_freep(&s->priv_data);

    return ret;

}


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

     uint32_t n;

+
+
+    req = g_malloc(sizeof(*req));
+
+    qemu_get_be32s(f, &n);

     assert(n < vs->conf.num_queues);

static void *virtio_scsi_load_request(QEMUFile *f, SCSIRequest *sreq)

{

    SCSIBus *bus = sreq->bus;

    VirtIOSCSI *s = container_of(bus, VirtIOSCSI, bus);

    VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s);

    VirtIOSCSIReq *req;

    uint32_t n;

    req = g_malloc(sizeof(*req));

    qemu_get_be32s(f, &n);

    assert(n < vs->conf.num_queues);

    qemu_get_buffer(f, (unsigned char *)&req->elem, sizeof(req->elem));

    virtio_scsi_parse_req(s, vs->cmd_vqs[n], req);

    scsi_req_ref(sreq);

    req->sreq = sreq;

    if (req->sreq->cmd.mode != SCSI_XFER_NONE) {

        int req_mode =

            (req->elem.in_num > 1 ? SCSI_XFER_FROM_DEV : SCSI_XFER_TO_DEV);

        assert(req->sreq->cmd.mode == req_mode);

    }

    return req;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static void IMLT(float *pInput, float *pOutput, int odd_band)

 {

     int     i;

+

     if (odd_band) {

static void IMLT(float *pInput, float *pOutput, int odd_band)

{

    int     i;

    if (odd_band) {

        /**

        * Reverse the odd bands before IMDCT, this is an effect of the QMF transform

        * or it gives better compression to do it this way.

        * FIXME: It should be possible to handle this in ff_imdct_calc

        * for that to happen a modification of the prerotation step of

        * all SIMD code and C code is needed.

        * Or fix the functions before so they generate a pre reversed spectrum.

        */

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

            FFSWAP(float, pInput[i], pInput[255-i]);

    }

    ff_imdct_calc(&mdct_ctx,pOutput,pInput);

    /* Perform windowing on the output. */

    dsp.vector_fmul(pOutput,mdct_window,512);

}


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

     PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);

+
+
+    switch (cpu->cpu_version) {
+
+    case CPU_POWERPC_LOGICAL_2_05:

         ret = 2;

int ppc_get_compat_smt_threads(PowerPCCPU *cpu)

{

    int ret = smp_threads;

    PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);

    switch (cpu->cpu_version) {

    case CPU_POWERPC_LOGICAL_2_05:

        ret = 2;

        break;

    case CPU_POWERPC_LOGICAL_2_06:

        ret = 4;

        break;

    case CPU_POWERPC_LOGICAL_2_07:

        ret = 8;

        break;

    default:

        if (pcc->pcr_mask & PCR_COMPAT_2_06) {

            ret = 4;

        } else if (pcc->pcr_mask & PCR_COMPAT_2_05) {

            ret = 2;

        }

        break;

    }

    return MIN(ret, smp_threads);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void qmp_input_type_str(Visitor *v, char **obj, const char *name,

+                               Error **errp)
+
 {

     QmpInputVisitor *qiv = to_qiv(v);
+
     QObject *qobj = qmp_input_get_object(qiv, name, true);

static void qmp_input_type_str(Visitor *v, char **obj, const char *name,

                               Error **errp)

{

    QmpInputVisitor *qiv = to_qiv(v);

    QObject *qobj = qmp_input_get_object(qiv, name, true);

    if (!qobj || qobject_type(qobj) != QTYPE_QSTRING) {

        error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",

                   "string");

        return;

    }

    *obj = g_strdup(qstring_get_str(qobject_to_qstring(qobj)));

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void vmsa_ttbcr_reset(CPUARMState *env, const ARMCPRegInfo *ri)

 {
+
+    env->cp15.c2_base_mask = 0xffffc000u;

     env->cp15.c2_control = 0;

static void vmsa_ttbcr_reset(CPUARMState *env, const ARMCPRegInfo *ri)

{

    env->cp15.c2_base_mask = 0xffffc000u;

    env->cp15.c2_control = 0;

    env->cp15.c2_mask = 0;

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
     tcase_add_test(qstring_public_tcase, qstring_destroy_test);

     tcase_add_test(qstring_public_tcase, qstring_get_str_test);
+
+    tcase_add_test(qstring_public_tcase, qstring_append_chr_test);
+
+    tcase_add_test(qstring_public_tcase, qstring_from_substr_test);
+
     tcase_add_test(qstring_public_tcase, qobject_to_qstring_test);

static Suite *qstring_suite(void)

{

    Suite *s;

    TCase *qstring_public_tcase;

    s = suite_create("QString test-suite");

    qstring_public_tcase = tcase_create("Public Interface");

    suite_add_tcase(s, qstring_public_tcase);

    tcase_add_test(qstring_public_tcase, qstring_from_str_test);

    tcase_add_test(qstring_public_tcase, qstring_destroy_test);

    tcase_add_test(qstring_public_tcase, qstring_get_str_test);

    tcase_add_test(qstring_public_tcase, qstring_append_chr_test);

    tcase_add_test(qstring_public_tcase, qstring_from_substr_test);

    tcase_add_test(qstring_public_tcase, qobject_to_qstring_test);

    return s;

}


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

         do_dma_memory_set(dma->as, paddr, c, plen);
+
+
+
+        len -= plen;
+
         addr += plen;

     }

int iommu_dma_memory_set(DMAContext *dma, dma_addr_t addr, uint8_t c,

                         dma_addr_t len)

{

    target_phys_addr_t paddr, plen;

    int err;

#ifdef DEBUG_IOMMU

    fprintf(stderr, "dma_memory_set context=%p addr=0x" DMA_ADDR_FMT

            " len=0x" DMA_ADDR_FMT "\n", dma, addr, len);

#endif

    while (len) {

        err = dma->translate(dma, addr, &paddr, &plen,

                             DMA_DIRECTION_FROM_DEVICE);

        if (err) {

            return err;

        }

        /* The translation might be valid for larger regions. */

        if (plen > len) {

            plen = len;

        }

        do_dma_memory_set(dma->as, paddr, c, plen);

        len -= plen;

        addr += plen;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                    void *value, size_t size, int flags)

 {
+
     XattrOperations *xops = get_xattr_operations(ctx->xops, name);

     if (xops) {

int v9fs_set_xattr(FsContext *ctx, const char *path, const char *name,

                   void *value, size_t size, int flags)

{

    XattrOperations *xops = get_xattr_operations(ctx->xops, name);

    if (xops) {

        return xops->setxattr(ctx, path, name, value, size, flags);

    }

    errno = -EOPNOTSUPP;

    return -1;

}


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

     rects[sub->num_rects]       = av_mallocz(sizeof(*rects[0]));

+
+
+    rects[sub->num_rects]->type = SUBTITLE_ASS;
+
+    ret = av_bprint_finalize(&buf, &rects[sub->num_rects]->ass);

     if (ret < 0)

int ff_ass_add_rect(AVSubtitle *sub, const char *dialog,

                    int ts_start, int duration, int raw)

{

    AVBPrint buf;

    int ret, dlen;

    AVSubtitleRect **rects;

    av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);

    if ((ret = ff_ass_bprint_dialog(&buf, dialog, ts_start, duration, raw)) < 0)

        goto err;

    dlen = ret;

    if (!av_bprint_is_complete(&buf))

    rects = av_realloc_array(sub->rects, (sub->num_rects+1), sizeof(*sub->rects));

    if (!rects)

    sub->rects = rects;

    sub->end_display_time = FFMAX(sub->end_display_time, 10 * duration);

    rects[sub->num_rects]       = av_mallocz(sizeof(*rects[0]));

    rects[sub->num_rects]->type = SUBTITLE_ASS;

    ret = av_bprint_finalize(&buf, &rects[sub->num_rects]->ass);

    if (ret < 0)

        goto err;

    sub->num_rects++;

    return dlen;

errnomem:

    ret = AVERROR(ENOMEM);

err:

    av_bprint_finalize(&buf, NULL);

    return ret;

}


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

                               unsigned size)

+{
+
+    E1000State *s = opaque;

static uint64_t e1000_io_read(void *opaque, target_phys_addr_t addr,

                              unsigned size)

{

    E1000State *s = opaque;

    (void)s;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void ide_dma_restart_cb(void *opaque, int running, int reason)

 {
+
+    BMDMAState *bm = opaque;
+
+    if (!running)
+
         return;

     if (bm->status & BM_STATUS_DMA_RETRY) {

static void ide_dma_restart_cb(void *opaque, int running, int reason)

{

    BMDMAState *bm = opaque;

    if (!running)

        return;

    if (bm->status & BM_STATUS_DMA_RETRY) {

        bm->status &= ~BM_STATUS_DMA_RETRY;

        ide_dma_restart(bm->ide_if);

    } else if (bm->status & BM_STATUS_PIO_RETRY) {

        bm->status &= ~BM_STATUS_PIO_RETRY;

        ide_sector_write(bm->ide_if);

    }

}


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

     int iomemtype;

+

     s = (arm_sysctl_state *)qemu_mallocz(sizeof(arm_sysctl_state));

void arm_sysctl_init(uint32_t base, uint32_t sys_id)

{

    arm_sysctl_state *s;

    int iomemtype;

    s = (arm_sysctl_state *)qemu_mallocz(sizeof(arm_sysctl_state));

    if (!s)

        return;

    s->base = base;

    s->sys_id = sys_id;

    iomemtype = cpu_register_io_memory(0, arm_sysctl_readfn,

                                       arm_sysctl_writefn, s);

    cpu_register_physical_memory(base, 0x00000fff, iomemtype);

    /* ??? Save/restore.  */

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+int ffurl_register_protocol(URLProtocol *protocol, int size)

+{
+
+    URLProtocol **p;
+
     if (size < sizeof(URLProtocol)) {

         URLProtocol *temp = av_mallocz(sizeof(URLProtocol));

int ffurl_register_protocol(URLProtocol *protocol, int size)

{

    URLProtocol **p;

    if (size < sizeof(URLProtocol)) {

        URLProtocol *temp = av_mallocz(sizeof(URLProtocol));

        memcpy(temp, protocol, size);

        protocol = temp;

    }

    p = &first_protocol;

    while (*p != NULL)

        p = &(*p)->next;

    *p             = protocol;

    protocol->next = NULL;

    return 0;

}


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

     avc_luma_vt_and_aver_dst_8x8_msa(src - (stride * 2), stride, dst, stride);
+
+}

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

                                ptrdiff_t stride)

{

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

}


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

     sbd = SYS_BUS_DEVICE(dev);
+
+    sysbus_mmio_map(sbd, 0, ctl_addr);
+
+    sysbus_mmio_map(sbd, 1, data_addr);
+

     return FW_CFG(dev);

FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr)

{

    DeviceState *dev;

    SysBusDevice *sbd;

    dev = qdev_create(NULL, TYPE_FW_CFG_MEM);

    qdev_prop_set_uint32(dev, "data_width",

                         fw_cfg_data_mem_ops.valid.max_access_size);

    fw_cfg_init1(dev);

    sbd = SYS_BUS_DEVICE(dev);

    sysbus_mmio_map(sbd, 0, ctl_addr);

    sysbus_mmio_map(sbd, 1, data_addr);

    return FW_CFG(dev);

}


--- a/source.c
+++ b/source.c
@@ -17,7 +17,7 @@
     if (strstart(optarg, "chardev:", &p)) {

         snprintf(label, sizeof(label), "%s", p);
+
     } else {

         snprintf(label, sizeof(label), "compat_monitor%d",

static void monitor_parse(const char *optarg, const char *mode)

{

    static int monitor_device_index = 0;

    QemuOpts *opts;

    const char *p;

    char label[32];

    int def = 0;

    if (strstart(optarg, "chardev:", &p)) {

        snprintf(label, sizeof(label), "%s", p);

    } else {

        snprintf(label, sizeof(label), "compat_monitor%d",

                 monitor_device_index);

        if (monitor_device_index == 0) {

            def = 1;

        }

        opts = qemu_chr_parse_compat(label, optarg);

        if (!opts) {

            fprintf(stderr, "parse error: %s\n", optarg);

            exit(1);

        }

    }

    opts = qemu_opts_create(qemu_find_opts("mon"), label, 1);

    if (!opts) {

        fprintf(stderr, "duplicate chardev: %s\n", label);

        exit(1);

    }

    qemu_opt_set(opts, "mode", mode);

    qemu_opt_set(opts, "chardev", label);

    if (def)

        qemu_opt_set(opts, "default", "on");

    monitor_device_index++;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static int nbd_handle_reply_err(uint32_t opt, uint32_t type, Error **errp)

+{

     if (!(type & (1 << 31))) {
+
+        return 0;

     }

@@ -14,7 +14,7 @@

     case NBD_REP_ERR_UNSUP:

+        error_setg(errp, "Unsupported option type %x", opt);

         break;

static int nbd_handle_reply_err(uint32_t opt, uint32_t type, Error **errp)

{

    if (!(type & (1 << 31))) {

        return 0;

    }

    switch (type) {

    case NBD_REP_ERR_UNSUP:

        error_setg(errp, "Unsupported option type %x", opt);

        break;

    case NBD_REP_ERR_POLICY:

        error_setg(errp, "Denied by server for option %x", opt);

        break;

    case NBD_REP_ERR_INVALID:

        error_setg(errp, "Invalid data length for option %x", opt);

        break;

    case NBD_REP_ERR_TLS_REQD:

        error_setg(errp, "TLS negotiation required before option %x", opt);

        break;

    default:

        error_setg(errp, "Unknown error code when asking for option %x", opt);

        break;

    }

    return -1;

}


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

+    stop_tco(&d);

     clear_tco_status(&d);

static void test_tco_ticks_counter(void)

{

    TestData d;

    uint16_t ticks = TCO_SECS_TO_TICKS(8);

    uint16_t rld;

    d.args = NULL;

    d.noreboot = true;

    test_init(&d);

    stop_tco(&d);

    clear_tco_status(&d);

    reset_on_second_timeout(false);

    set_tco_timeout(&d, ticks);

    load_tco(&d);

    start_tco(&d);

    do {

        rld = qpci_io_readw(d.dev, d.tco_io_bar, TCO_RLD) & TCO_RLD_MASK;

        g_assert_cmpint(rld, ==, ticks);

        clock_step(TCO_TICK_NSEC);

        ticks--;

    } while (!(qpci_io_readw(d.dev, d.tco_io_bar, TCO1_STS) & TCO_TIMEOUT));

    stop_tco(&d);

    qtest_end();

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 int bdrv_inactivate_all(void)

+{
+
+    BlockDriverState *bs = NULL;
+
+    BdrvNextIterator it;

     int ret = 0;

int bdrv_inactivate_all(void)

{

    BlockDriverState *bs = NULL;

    BdrvNextIterator it;

    int ret = 0;

    int pass;

    for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {

        aio_context_acquire(bdrv_get_aio_context(bs));

    }

    /* We do two passes of inactivation. The first pass calls to drivers'

     * .bdrv_inactivate callbacks recursively so all cache is flushed to disk;

     * the second pass sets the BDRV_O_INACTIVE flag so that no further write

     * is allowed. */

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

        for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {

            ret = bdrv_inactivate_recurse(bs, pass);

            if (ret < 0) {

                goto out;

            }

        }

    }

out:

    for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {

        aio_context_release(bdrv_get_aio_context(bs));

    }

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void vmxnet3_complete_packet(VMXNET3State *s, int qidx, uint32_t tx_ridx)

 {
+
+    struct Vmxnet3_TxCompDesc txcq_descr;
+
+    PCIDevice *d = PCI_DEVICE(s);
+

     VMXNET3_RING_DUMP(VMW_RIPRN, "TXC", qidx, &s->txq_descr[qidx].comp_ring);

static void vmxnet3_complete_packet(VMXNET3State *s, int qidx, uint32_t tx_ridx)

{

    struct Vmxnet3_TxCompDesc txcq_descr;

    PCIDevice *d = PCI_DEVICE(s);

    VMXNET3_RING_DUMP(VMW_RIPRN, "TXC", qidx, &s->txq_descr[qidx].comp_ring);

    txcq_descr.txdIdx = tx_ridx;

    txcq_descr.gen = vmxnet3_ring_curr_gen(&s->txq_descr[qidx].comp_ring);

    vmxnet3_ring_write_curr_cell(d, &s->txq_descr[qidx].comp_ring, &txcq_descr);

    /* Flush changes in TX descriptor before changing the counter value */

    smp_wmb();

    vmxnet3_inc_tx_completion_counter(s, qidx);

    vmxnet3_trigger_interrupt(s, s->txq_descr[qidx].intr_idx);

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     /* FIXME error_setg(errp, ...) on failure */

     const NetdevBridgeOptions *bridge;
+
     const char *helper, *br;

     TAPState *s;

int net_init_bridge(const NetClientOptions *opts, const char *name,

                    NetClientState *peer, Error **errp)

{

    /* FIXME error_setg(errp, ...) on failure */

    const NetdevBridgeOptions *bridge;

    const char *helper, *br;

    TAPState *s;

    int fd, vnet_hdr;

    assert(opts->kind == NET_CLIENT_OPTIONS_KIND_BRIDGE);

    bridge = opts->bridge;

    helper = bridge->has_helper ? bridge->helper : DEFAULT_BRIDGE_HELPER;

    br     = bridge->has_br     ? bridge->br     : DEFAULT_BRIDGE_INTERFACE;

    fd = net_bridge_run_helper(helper, br);

    if (fd == -1) {

        return -1;

    }

    fcntl(fd, F_SETFL, O_NONBLOCK);

    vnet_hdr = tap_probe_vnet_hdr(fd);

    s = net_tap_fd_init(peer, "bridge", name, fd, vnet_hdr);

    snprintf(s->nc.info_str, sizeof(s->nc.info_str), "helper=%s,br=%s", helper,

             br);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static inline int target_to_host_errno(int err)
+
 {

     if (target_to_host_errno_table[err])

static inline int target_to_host_errno(int err)

{

    if (target_to_host_errno_table[err])

        return target_to_host_errno_table[err];

    return err;

}