--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+static const uint8_t *pcx_rle_decode(const uint8_t *src, uint8_t *dst,

                                      unsigned int bytes_per_scanline,

+                                     int compressed)

 {
+
     unsigned int i = 0;

     unsigned char run, value;

static const uint8_t *pcx_rle_decode(const uint8_t *src, uint8_t *dst,

                                     unsigned int bytes_per_scanline,

                                     int compressed)

{

    unsigned int i = 0;

    unsigned char run, value;

    if (compressed) {

        while (i < bytes_per_scanline) {

            run   = 1;

            value = *src++;

            if (value >= 0xc0) {

                run   = value & 0x3f;

                value = *src++;

            }

            while (i < bytes_per_scanline && run--)

                dst[i++] = value;

        }

    } else {

        memcpy(dst, src, bytes_per_scanline);

        src += bytes_per_scanline;

    }

    return src;

}


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

+    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

 #else

static void gen_iccci(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;

    }

    /* interpreted as no-op */

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void matroska_execute_seekhead(MatroskaDemuxContext *matroska)

+{

     EbmlList *seekhead_list = &matroska->seekhead;

static void matroska_execute_seekhead(MatroskaDemuxContext *matroska)

{

    EbmlList *seekhead_list = &matroska->seekhead;

    MatroskaSeekhead *seekhead = seekhead_list->elem;

    int64_t before_pos = avio_tell(matroska->ctx->pb);

    int i;

    // we should not do any seeking in the streaming case

    if (!matroska->ctx->pb->seekable ||

        (matroska->ctx->flags & AVFMT_FLAG_IGNIDX))

        return;

    for (i = 0; i < seekhead_list->nb_elem; i++) {

        if (seekhead[i].pos <= before_pos)

            continue;

        // defer cues parsing until we actually need cue data.

        if (seekhead[i].id == MATROSKA_ID_CUES) {

            matroska->cues_parsing_deferred = 1;

            continue;

        }

        if (matroska_parse_seekhead_entry(matroska, i) < 0)

            break;

    }

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
         g_assert_cmpint(tmp->value, ==, value[i++]);

         tmp = tmp->next;
+
+    }
+
+    g_assert(!tmp);
+

     qapi_free_int16List(res);

static void test_visitor_in_intList(TestInputVisitorData *data,

                                    const void *unused)

{

    int64_t value[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20};

    int16List *res = NULL, *tmp;

    Error *err = NULL;

    Visitor *v;

    int i = 0;

    v = visitor_input_test_init(data, "1,2,0,2-4,20,5-9,1-8");

    visit_type_int16List(v, NULL, &res, &error_abort);

    tmp = res;

    while (i < sizeof(value) / sizeof(value[0])) {

        g_assert(tmp);

        g_assert_cmpint(tmp->value, ==, value[i++]);

        tmp = tmp->next;

    }

    g_assert(!tmp);

    qapi_free_int16List(res);

    visitor_input_teardown(data, unused);

    v = visitor_input_test_init(data, "not an int list");

    /* FIXME: res should be NULL on failure, regardless of starting value */

    res = NULL;

    visit_type_int16List(v, NULL, &res, &err);

    error_free_or_abort(&err);

    g_assert(!res);

}


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

     ga_disable_logging(ga_state);
+
 }

static void disable_logging(void)

{

    ga_disable_logging(ga_state);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static struct omap_sysctl_s *omap_sysctl_init(struct omap_target_agent_s *ta,
+
                 omap_clk iclk, struct omap_mpu_state_s *mpu)

 {

static struct omap_sysctl_s *omap_sysctl_init(struct omap_target_agent_s *ta,

                omap_clk iclk, struct omap_mpu_state_s *mpu)

{

    struct omap_sysctl_s *s = (struct omap_sysctl_s *)

            g_malloc0(sizeof(struct omap_sysctl_s));

    s->mpu = mpu;

    omap_sysctl_reset(s);

    memory_region_init_io(&s->iomem, NULL, &omap_sysctl_ops, s, "omap.sysctl",

                          omap_l4_region_size(ta, 0));

    omap_l4_attach(ta, 0, &s->iomem);

    return s;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+void qemu_get_guest_simple_memory_mapping(MemoryMappingList *list)
+
+{
+
     RAMBlock *block;

void qemu_get_guest_simple_memory_mapping(MemoryMappingList *list)

{

    RAMBlock *block;

    QTAILQ_FOREACH(block, &ram_list.blocks, next) {

        create_new_memory_mapping(list, block->offset, 0, block->length);

    }

}


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

            "infiniband_verbs class device path %s, "

+           "infiniband class device path %s, "
+
+           "transport: (%d) %s\n",
+
+                who,

                 verbs->device->name,

static void qemu_rdma_dump_id(const char *who, struct ibv_context *verbs)

{

    struct ibv_port_attr port;

    if (ibv_query_port(verbs, 1, &port)) {

        error_report("Failed to query port information");

        return;

    }

    printf("%s RDMA Device opened: kernel name %s "

           "uverbs device name %s, "

           "infiniband_verbs class device path %s, "

           "infiniband class device path %s, "

           "transport: (%d) %s\n",

                who,

                verbs->device->name,

                verbs->device->dev_name,

                verbs->device->dev_path,

                verbs->device->ibdev_path,

                port.link_layer,

                (port.link_layer == IBV_LINK_LAYER_INFINIBAND) ? "Infiniband" :

                 ((port.link_layer == IBV_LINK_LAYER_ETHERNET)

                    ? "Ethernet" : "Unknown"));

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static const unsigned char *seq_decode_op3(SeqVideoContext *seq, const unsigned char *src, unsigned char *dst)

 {

static const unsigned char *seq_decode_op3(SeqVideoContext *seq, const unsigned char *src, unsigned char *dst)

{

    int pos, offset;

    do {

        pos = *src++;

        offset = ((pos >> 3) & 7) * seq->frame.linesize[0] + (pos & 7);

        dst[offset] = *src++;

    } while (!(pos & 0x80));

    return src;

}


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

     memory_region_transaction_begin();

+    as->root = root;
+
+    as->current_map = g_new(FlatView, 1);
+
+    flatview_init(as->current_map);

void address_space_init(AddressSpace *as, MemoryRegion *root)

{

    memory_region_transaction_begin();

    as->root = root;

    as->current_map = g_new(FlatView, 1);

    flatview_init(as->current_map);

    QTAILQ_INSERT_TAIL(&address_spaces, as, address_spaces_link);

    as->name = NULL;

    memory_region_transaction_commit();

    address_space_init_dispatch(as);

}


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

     int start, i, j, w;

+

     if (sce->ics.clip_avoidance_factor < 1.0f) {

static void avoid_clipping(AACEncContext *s, SingleChannelElement *sce)

{

    int start, i, j, w;

    if (sce->ics.clip_avoidance_factor < 1.0f) {

        for (w = 0; w < sce->ics.num_windows; w++) {

            start = 0;

            for (i = 0; i < sce->ics.max_sfb; i++) {

                float *swb_coeffs = sce->coeffs + start + w*128;

                for (j = 0; j < sce->ics.swb_sizes[i]; j++)

                    swb_coeffs[j] *= sce->ics.clip_avoidance_factor;

                start += sce->ics.swb_sizes[i];

            }

        }

    }

}


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

+    if (pread(vdev->vbasedev.fd, &ctrl, sizeof(ctrl),

               vdev->config_offset + pos + PCI_CAP_FLAGS) != sizeof(ctrl)) {

         return -errno;
+
     }

     ctrl = le16_to_cpu(ctrl);

static int vfio_msi_setup(VFIOPCIDevice *vdev, int pos)

{

    uint16_t ctrl;

    bool msi_64bit, msi_maskbit;

    int ret, entries;

    if (pread(vdev->vbasedev.fd, &ctrl, sizeof(ctrl),

              vdev->config_offset + pos + PCI_CAP_FLAGS) != sizeof(ctrl)) {

        return -errno;

    }

    ctrl = le16_to_cpu(ctrl);

    msi_64bit = !!(ctrl & PCI_MSI_FLAGS_64BIT);

    msi_maskbit = !!(ctrl & PCI_MSI_FLAGS_MASKBIT);

    entries = 1 << ((ctrl & PCI_MSI_FLAGS_QMASK) >> 1);

    trace_vfio_msi_setup(vdev->vbasedev.name, pos);

    ret = msi_init(&vdev->pdev, pos, entries, msi_64bit, msi_maskbit);

    if (ret < 0) {

        if (ret == -ENOTSUP) {

            return 0;

        }

        error_report("vfio: msi_init failed");

        return ret;

    }

    vdev->msi_cap_size = 0xa + (msi_maskbit ? 0xa : 0) + (msi_64bit ? 0x4 : 0);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                            const void *in,

                            void *out,
+
                            size_t len,

                            Error **errp)

int qcrypto_cipher_decrypt(QCryptoCipher *cipher,

                           const void *in,

                           void *out,

                           size_t len,

                           Error **errp)

{

    QCryptoCipherNettle *ctx = cipher->opaque;

    switch (cipher->mode) {

    case QCRYPTO_CIPHER_MODE_ECB:

        ctx->alg_decrypt(ctx->ctx_decrypt ? ctx->ctx_decrypt : ctx->ctx_encrypt,

                         len, out, in);

        break;

    case QCRYPTO_CIPHER_MODE_CBC:

        cbc_decrypt(ctx->ctx_decrypt ? ctx->ctx_decrypt : ctx->ctx_encrypt,

                    ctx->alg_decrypt, ctx->niv, ctx->iv,

                    len, out, in);

        break;

    default:

        error_setg(errp, "Unsupported cipher algorithm %d",

                   cipher->alg);

        return -1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,31 +1,31 @@
 static int vncws_start_tls_handshake(VncState *vs)
+
+{
+
+    int ret = gnutls_handshake(vs->tls.session);
+
+

+    if (ret < 0) {

+        if (!gnutls_error_is_fatal(ret)) {

+            VNC_DEBUG("Handshake interrupted (blocking)\n");
+
+            if (!gnutls_record_get_direction(vs->tls.session)) {

+                qemu_set_fd_handler(vs->csock, vncws_tls_handshake_io,
+
+                                    NULL, vs);
+
+            } else {

+                qemu_set_fd_handler(vs->csock, NULL, vncws_tls_handshake_io,

                                     vs);
+
+            }
+
             return 0;

         }

static int vncws_start_tls_handshake(VncState *vs)

{

    int ret = gnutls_handshake(vs->tls.session);

    if (ret < 0) {

        if (!gnutls_error_is_fatal(ret)) {

            VNC_DEBUG("Handshake interrupted (blocking)\n");

            if (!gnutls_record_get_direction(vs->tls.session)) {

                qemu_set_fd_handler(vs->csock, vncws_tls_handshake_io,

                                    NULL, vs);

            } else {

                qemu_set_fd_handler(vs->csock, NULL, vncws_tls_handshake_io,

                                    vs);

            }

            return 0;

        }

        VNC_DEBUG("Handshake failed %s\n", gnutls_strerror(ret));

        vnc_client_error(vs);

        return -1;

    }

    if (vs->vd->tls.x509verify) {

        if (vnc_tls_validate_certificate(vs) < 0) {

            VNC_DEBUG("Client verification failed\n");

            vnc_client_error(vs);

            return -1;

        } else {

            VNC_DEBUG("Client verification passed\n");

        }

    }

    VNC_DEBUG("Handshake done, switching to TLS data mode\n");

    qemu_set_fd_handler(vs->csock, vncws_handshake_read, NULL, vs);

    return 0;

}


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

                            TCGArg arg1, TCGArg arg2, int const_arg2,

+                           int label_index, TCGType type)
+
+{

     tcg_out_cmp(s, cond, arg1, arg2, const_arg2, 7, type);

static void tcg_out_brcond(TCGContext *s, TCGCond cond,

                           TCGArg arg1, TCGArg arg2, int const_arg2,

                           int label_index, TCGType type)

{

    tcg_out_cmp(s, cond, arg1, arg2, const_arg2, 7, type);

    tcg_out_bc(s, tcg_to_bc[cond], label_index);

}


--- a/source.c
+++ b/source.c
@@ -27,10 +27,10 @@
         } else {
             if ((err = mxf_write_partition(s, 0, 0, header_closed_partition_key, 1)) < 0)
 end:
+    ff_audio_interleave_close(s);
+    av_freep(&mxf->index_entries);
+    av_freep(&mxf->body_partition_offset);
+    av_freep(&mxf->timecode_track->priv_data);
+    av_freep(&mxf->timecode_track);
     mxf_free(s);
     return err < 0 ? err : 0;

static int mxf_write_footer(AVFormatContext *s)
{
    MXFContext *mxf = s->priv_data;
    AVIOContext *pb = s->pb;
    int err = 0;
    mxf->duration = mxf->last_indexed_edit_unit + mxf->edit_units_count;
    mxf_write_klv_fill(s);
    mxf->footer_partition_offset = avio_tell(pb);
    if (mxf->edit_unit_byte_count && s->oformat != &ff_mxf_opatom_muxer) { // no need to repeat index
        if ((err = mxf_write_partition(s, 0, 0, footer_partition_key, 0)) < 0)
    } else {
        if ((err = mxf_write_partition(s, 0, 2, footer_partition_key, 0)) < 0)
        mxf_write_klv_fill(s);
        mxf_write_index_table_segment(s);
    mxf_write_klv_fill(s);
    mxf_write_random_index_pack(s);
    if (s->pb->seekable) {
        if (s->oformat == &ff_mxf_opatom_muxer){
            /* rewrite body partition to update lengths */
            avio_seek(pb, mxf->body_partition_offset[0], SEEK_SET);
            if ((err = mxf_write_opatom_body_partition(s)) < 0)
        avio_seek(pb, 0, SEEK_SET);
        if (mxf->edit_unit_byte_count && s->oformat != &ff_mxf_opatom_muxer) {
            if ((err = mxf_write_partition(s, 1, 2, header_closed_partition_key, 1)) < 0)
            mxf_write_klv_fill(s);
            mxf_write_index_table_segment(s);
        } else {
            if ((err = mxf_write_partition(s, 0, 0, header_closed_partition_key, 1)) < 0)
end:
    ff_audio_interleave_close(s);
    av_freep(&mxf->index_entries);
    av_freep(&mxf->body_partition_offset);
    av_freep(&mxf->timecode_track->priv_data);
    av_freep(&mxf->timecode_track);
    mxf_free(s);
    return err < 0 ? err : 0;


static inline uint32_t ucf64_stoi(float32 s)

{

    union {

        uint32_t i;

        float32 s;

    } v;

    v.s = s;

    return v.i;

}


--- a/source.c
+++ b/source.c
@@ -5,10 +5,10 @@
     gen_mov_reg_N(cpu_tmp0, src);

     gen_mov_reg_V(dst, src);
+
+    tcg_gen_xor_tl(dst, dst, cpu_tmp0);
+
+    gen_mov_reg_Z(cpu_tmp0, src);

     tcg_gen_or_tl(dst, dst, cpu_tmp0);

static inline void gen_op_eval_bg(TCGv dst, TCGv_i32 src)

{

    gen_mov_reg_N(cpu_tmp0, src);

    gen_mov_reg_V(dst, src);

    tcg_gen_xor_tl(dst, dst, cpu_tmp0);

    gen_mov_reg_Z(cpu_tmp0, src);

    tcg_gen_or_tl(dst, dst, cpu_tmp0);

    tcg_gen_xori_tl(dst, dst, 0x1);

}


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

             absolute_enabled = 1;
+
+        }
+
+    } else if (absolute_enabled) {
+
 	sdl_show_cursor();

 	absolute_enabled = 0;

static void sdl_mouse_mode_change(Notifier *notify, void *data)

{

    if (kbd_mouse_is_absolute()) {

        if (!absolute_enabled) {

            sdl_hide_cursor();

            if (gui_grab) {

                sdl_grab_end();

            }

            absolute_enabled = 1;

        }

    } else if (absolute_enabled) {

	sdl_show_cursor();

	absolute_enabled = 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+void ff_wmv2_idct_c(short * block){
+
+    int i;
+

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

         wmv2_idct_row(block+i);

void ff_wmv2_idct_c(short * block){

    int i;

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

        wmv2_idct_row(block+i);

    }

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

        wmv2_idct_col(block+i);

    }

}


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

     DeviceClass *dc = DEVICE_CLASS(klass);

+    VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);
+
+
+
+    dc->props = virtio_9p_properties;

     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);

static void virtio_9p_class_init(ObjectClass *klass, void *data)

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);

    dc->props = virtio_9p_properties;

    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);

    vdc->realize = virtio_9p_device_realize;

    vdc->get_features = virtio_9p_get_features;

    vdc->get_config = virtio_9p_get_config;

}


--- a/source.c
+++ b/source.c
@@ -4,9 +4,9 @@
     if (lock->writer) {
         lock->writer = false;
         qemu_co_queue_restart_all(&lock->queue);
+    } else {
+        lock->reader--;
+        assert(lock->reader >= 0);
         /* Wakeup only one waiting writer */
         if (!lock->reader) {
             qemu_co_queue_next(&lock->queue);

void qemu_co_rwlock_unlock(CoRwlock *lock)
{
    assert(qemu_in_coroutine());
    if (lock->writer) {
        lock->writer = false;
        qemu_co_queue_restart_all(&lock->queue);
    } else {
        lock->reader--;
        assert(lock->reader >= 0);
        /* Wakeup only one waiting writer */
        if (!lock->reader) {
            qemu_co_queue_next(&lock->queue);
        }
    }
}


--- a/source.c
+++ b/source.c
@@ -53,11 +53,11 @@
                 s->decoded[channel][sample] = get_sbits(&s->gb, tmp);

+        else
+
+        {
+
+//            av_log(s->avctx, AV_LOG_DEBUG, "rice coded partition k=%d\n", tmp);

             for (; i < samples; i++, sample++){

static int decode_residuals(FLACContext *s, int channel, int pred_order)

{

    int i, tmp, partition, method_type, rice_order;

    int sample = 0, samples;

    method_type = get_bits(&s->gb, 2);

    if (method_type != 0){

        av_log(s->avctx, AV_LOG_DEBUG, "illegal residual coding method %d\n", method_type);

    rice_order = get_bits(&s->gb, 4);

    samples= s->blocksize >> rice_order;

    sample=

    i= pred_order;

    for (partition = 0; partition < (1 << rice_order); partition++)

    {

        tmp = get_bits(&s->gb, 4);

        if (tmp == 15)

        {

            av_log(s->avctx, AV_LOG_DEBUG, "fixed len partition\n");

            tmp = get_bits(&s->gb, 5);

            for (; i < samples; i++, sample++)

                s->decoded[channel][sample] = get_sbits(&s->gb, tmp);

        else

        {

//            av_log(s->avctx, AV_LOG_DEBUG, "rice coded partition k=%d\n", tmp);

            for (; i < samples; i++, sample++){

                s->decoded[channel][sample] = get_sr_golomb_flac(&s->gb, tmp, INT_MAX, 0);

        i= 0;

//    av_log(s->avctx, AV_LOG_DEBUG, "partitions: %d, samples: %d\n", 1 << rice_order, sample);

    return 0;


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static bool e1000_full_mac_needed(void *opaque)

 {
+
+    E1000State *s = opaque;

static bool e1000_full_mac_needed(void *opaque)

{

    E1000State *s = opaque;

    return s->compat_flags & E1000_FLAG_MAC;

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     fail_unless(opaque == NULL);

+
+    qi = qobject_to_qint(obj);
+
+    fail_unless(qi != NULL);
+
     fail_unless((qint_get_int(qi) >= 0) && (qint_get_int(qi) <= iter_max));

static void iter_func(QObject *obj, void *opaque)

{

    QInt *qi;

    fail_unless(opaque == NULL);

    qi = qobject_to_qint(obj);

    fail_unless(qi != NULL);

    fail_unless((qint_get_int(qi) >= 0) && (qint_get_int(qi) <= iter_max));

    iter_called++;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+void ide_drive_get(DriveInfo **hd, int max_bus)

+{
+
     int i;

+
+
     if (drive_get_max_bus(IF_IDE) >= max_bus) {

         fprintf(stderr, "qemu: too many IDE bus: %d\n", max_bus);

void ide_drive_get(DriveInfo **hd, int max_bus)

{

    int i;

    if (drive_get_max_bus(IF_IDE) >= max_bus) {

        fprintf(stderr, "qemu: too many IDE bus: %d\n", max_bus);

        exit(1);

    }

    for(i = 0; i < max_bus * MAX_IDE_DEVS; i++) {

        hd[i] = drive_get(IF_IDE, i / MAX_IDE_DEVS, i % MAX_IDE_DEVS);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static int check_opts(QemuOptsList *opts_list, QDict *args)
+
 {

     assert(!opts_list->desc->name);

static int check_opts(QemuOptsList *opts_list, QDict *args)

{

    assert(!opts_list->desc->name);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void virtio_scsi_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq)
+
 {
+
+    VirtIOSCSI *s = (VirtIOSCSI *)vdev;

     VirtIOSCSIReq *req;

static void virtio_scsi_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq)

{

    VirtIOSCSI *s = (VirtIOSCSI *)vdev;

    VirtIOSCSIReq *req;

    if (s->ctx && !s->dataplane_started) {

        virtio_scsi_dataplane_start(s);

        return;

    }

    while ((req = virtio_scsi_pop_req(s, vq))) {

        virtio_scsi_handle_ctrl_req(s, req);

    }

}


--- a/source.c
+++ b/source.c
@@ -9,14 +9,14 @@
     hwaddr pte_offset;

     ppc_hash_pte64_t pte;
+
     unsigned apshift;
+

     if (msr_dr == 0) {
+
+        /* In real mode the top 4 effective address bits are ignored */

         return addr & 0x0FFFFFFFFFFFFFFFULL;

hwaddr ppc_hash64_get_phys_page_debug(PowerPCCPU *cpu, target_ulong addr)

{

    CPUPPCState *env = &cpu->env;

    ppc_slb_t *slb;

    hwaddr pte_offset;

    ppc_hash_pte64_t pte;

    unsigned apshift;

    if (msr_dr == 0) {

        /* In real mode the top 4 effective address bits are ignored */

        return addr & 0x0FFFFFFFFFFFFFFFULL;

    }

    slb = slb_lookup(cpu, addr);

    if (!slb) {

        return -1;

    }

    pte_offset = ppc_hash64_htab_lookup(cpu, slb, addr, &pte);

    if (pte_offset == -1) {

        return -1;

    }

    apshift = hpte_page_shift(slb->sps, pte.pte0, pte.pte1);

    if (!apshift) {

        return -1;

    }

    return deposit64(pte.pte1 & HPTE64_R_RPN, 0, apshift, addr)

        & TARGET_PAGE_MASK;

}


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

     tcg_gen_ext_i32_i64(tmp1, a);
+
+    dead_tmp(a);
+
+    tcg_gen_ext_i32_i64(tmp2, b);
+
     dead_tmp(b);

     tcg_gen_mul_i64(tmp1, tmp1, tmp2);

static TCGv gen_muls_i64_i32(TCGv a, TCGv b)

{

    TCGv tmp1 = tcg_temp_new(TCG_TYPE_I64);

    TCGv tmp2 = tcg_temp_new(TCG_TYPE_I64);

    tcg_gen_ext_i32_i64(tmp1, a);

    dead_tmp(a);

    tcg_gen_ext_i32_i64(tmp2, b);

    dead_tmp(b);

    tcg_gen_mul_i64(tmp1, tmp1, tmp2);

    return tmp1;

}


--- a/source.c
+++ b/source.c
@@ -27,11 +27,11 @@
     ent = QLIST_FIRST(&qdict->table[12345 % QDICT_BUCKET_MAX]);

     qi = qobject_to_qint(ent->value);
+
+    fail_unless(qint_get_int(qi) == num);
+
+
+
     // destroy doesn't exit yet

     QDECREF(qi);

START_TEST(qdict_put_obj_test)

{

    QInt *qi;

    QDict *qdict;

    QDictEntry *ent;

    const int num = 42;

    qdict = qdict_new();

    // key "" will have tdb hash 12345

    qdict_put_obj(qdict, "", QOBJECT(qint_from_int(num)));

    fail_unless(qdict_size(qdict) == 1);

    ent = QLIST_FIRST(&qdict->table[12345 % QDICT_BUCKET_MAX]);

    qi = qobject_to_qint(ent->value);

    fail_unless(qint_get_int(qi) == num);

    // destroy doesn't exit yet

    QDECREF(qi);

    g_free(ent->key);

    g_free(ent);

    g_free(qdict);

}


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

     pixel *src = (pixel*)_src;

+    int stride = _stride/sizeof(pixel);

     const int dc= (  src[-1+0*stride] + src[-1+1*stride] + src[-1+2*stride] + src[-1+3*stride] + 2) >>2;

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

    pixel *src = (pixel*)_src;

    int stride = _stride/sizeof(pixel);

    const int dc= (  src[-1+0*stride] + src[-1+1*stride] + src[-1+2*stride] + src[-1+3*stride] + 2) >>2;

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

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

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

    ((pixel4*)(src+3*stride))[0]= PIXEL_SPLAT_X4(dc);

}


size_t qemu_fd_getpagesize(int fd)

{

#ifdef CONFIG_LINUX

    struct statfs fs;

    int ret;

    if (fd != -1) {

        do {

            ret = fstatfs(fd, &fs);

        } while (ret != 0 && errno == EINTR);

        if (ret == 0 && fs.f_type == HUGETLBFS_MAGIC) {

            return fs.f_bsize;

        }

    }

    return getpagesize();

}


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

     if ((s->flags & FRAMERATE_FLAG_SCD)) {

+        if (s->score >= 0.0)

             interpolate_scene_score = s->score;

static int blend_frames(AVFilterContext *ctx, int interpolate)

{

    FrameRateContext *s = ctx->priv;

    AVFilterLink *outlink = ctx->outputs[0];

    double interpolate_scene_score = 0;

    if ((s->flags & FRAMERATE_FLAG_SCD)) {

        if (s->score >= 0.0)

            interpolate_scene_score = s->score;

        else

            interpolate_scene_score = s->score = get_scene_score(ctx, s->f0, s->f1);

        ff_dlog(ctx, "blend_frames() interpolate scene score:%f\n", interpolate_scene_score);

    }

    // decide if the shot-change detection allows us to blend two frames

    if (interpolate_scene_score < s->scene_score) {

        ThreadData td;

        td.copy_src1 = s->f0;

        td.copy_src2 = s->f1;

        td.src2_factor = interpolate;

        td.src1_factor = s->max - td.src2_factor;

        // get work-space for output frame

        s->work = ff_get_video_buffer(outlink, outlink->w, outlink->h);

        if (!s->work)

            return AVERROR(ENOMEM);

        av_frame_copy_props(s->work, s->f0);

        ff_dlog(ctx, "blend_frames() INTERPOLATE to create work frame\n");

        ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));

        return 1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
     }

     if (nsaddr != 1) {
+
+        error_setg(errp, "Expected a single address in reverse mode");
+
+        return -1;
+
     }

     /* TODO SOCKET_ADDRESS_KIND_FD when fd has AF_UNIX */

static int vnc_display_connect(VncDisplay *vd,

                               SocketAddress **saddr,

                               size_t nsaddr,

                               SocketAddress **wsaddr,

                               size_t nwsaddr,

                               Error **errp)

{

    /* connect to viewer */

    QIOChannelSocket *sioc = NULL;

    if (nwsaddr != 0) {

        error_setg(errp, "Cannot use websockets in reverse mode");

        return -1;

    }

    if (nsaddr != 1) {

        error_setg(errp, "Expected a single address in reverse mode");

        return -1;

    }

    /* TODO SOCKET_ADDRESS_KIND_FD when fd has AF_UNIX */

    vd->is_unix = saddr[0]->type == SOCKET_ADDRESS_KIND_UNIX;

    sioc = qio_channel_socket_new();

    qio_channel_set_name(QIO_CHANNEL(sioc), "vnc-reverse");

    if (qio_channel_socket_connect_sync(sioc, saddr[0], errp) < 0) {

        return -1;

    }

    vnc_connect(vd, sioc, false, false);

    object_unref(OBJECT(sioc));

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+av_cold int ff_vc2enc_init_transforms(VC2TransformContext *s, int p_width, int p_height)

 {

     s->vc2_subband_dwt[VC2_TRANSFORM_9_7]    = vc2_subband_dwt_97;
+
     s->vc2_subband_dwt[VC2_TRANSFORM_5_3]    = vc2_subband_dwt_53;

     s->vc2_subband_dwt[VC2_TRANSFORM_HAAR]   = vc2_subband_dwt_haar;

av_cold int ff_vc2enc_init_transforms(VC2TransformContext *s, int p_width, int p_height)

{

    s->vc2_subband_dwt[VC2_TRANSFORM_9_7]    = vc2_subband_dwt_97;

    s->vc2_subband_dwt[VC2_TRANSFORM_5_3]    = vc2_subband_dwt_53;

    s->vc2_subband_dwt[VC2_TRANSFORM_HAAR]   = vc2_subband_dwt_haar;

    s->vc2_subband_dwt[VC2_TRANSFORM_HAAR_S] = vc2_subband_dwt_haar_shift;

    s->buffer = av_malloc(2*p_width*p_height*sizeof(dwtcoef));

    if (!s->buffer)

        return 1;

    return 0;

}


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

     int dom, bus;

+    unsigned slot;
+
+    Error *local_err = NULL;
+
+

     if (pci_read_devaddr(mon, pci_addr, &dom, &bus, &slot)) {

static int pci_device_hot_remove(Monitor *mon, const char *pci_addr)

{

    PCIDevice *d;

    int dom, bus;

    unsigned slot;

    Error *local_err = NULL;

    if (pci_read_devaddr(mon, pci_addr, &dom, &bus, &slot)) {

        return -1;

    }

    d = pci_find_device(pci_find_root_bus(dom), bus, PCI_DEVFN(slot, 0));

    if (!d) {

        monitor_printf(mon, "slot %d empty\n", slot);

        return -1;

    }

    qdev_unplug(&d->qdev, &local_err);

    if (error_is_set(&local_err)) {

        monitor_printf(mon, "%s\n", error_get_pretty(local_err));

        error_free(local_err);

        return -1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
 static CharDriverState *qmp_chardev_open_file(ChardevFile *file, Error **errp)
+
 {

+    int flags, in = -1, out = -1;

     flags = O_WRONLY | O_TRUNC | O_CREAT | O_BINARY;

+    out = qmp_chardev_open_file_source(file->out, flags, errp);

     if (error_is_set(errp)) {

static CharDriverState *qmp_chardev_open_file(ChardevFile *file, Error **errp)

{

    int flags, in = -1, out = -1;

    flags = O_WRONLY | O_TRUNC | O_CREAT | O_BINARY;

    out = qmp_chardev_open_file_source(file->out, flags, errp);

    if (error_is_set(errp)) {

        return NULL;

    }

    if (file->has_in) {

        flags = O_RDONLY;

        in = qmp_chardev_open_file_source(file->in, flags, errp);

        if (error_is_set(errp)) {

            qemu_close(out);

            return NULL;

        }

    }

    return qemu_chr_open_fd(in, out);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static int parse_vtrk(AVFormatContext *s,

+                      FourxmDemuxContext *fourxm, uint8_t *buf, int size)

 {

static int parse_vtrk(AVFormatContext *s,

                      FourxmDemuxContext *fourxm, uint8_t *buf, int size)

{

    AVStream *st;

    /* check that there is enough data */

    if (size != vtrk_SIZE) {

        return AVERROR_INVALIDDATA;

    }

    /* allocate a new AVStream */

    st = avformat_new_stream(s, NULL);

    if (!st)

        return AVERROR(ENOMEM);

    avpriv_set_pts_info(st, 60, 1, fourxm->fps);

    fourxm->video_stream_index = st->index;

    st->codec->codec_type     = AVMEDIA_TYPE_VIDEO;

    st->codec->codec_id       = AV_CODEC_ID_4XM;

    st->codec->extradata_size = 4;

    st->codec->extradata      = av_malloc(4);

    AV_WL32(st->codec->extradata, AV_RL32(buf + 16));

    st->codec->width  = AV_RL32(buf + 36);

    st->codec->height = AV_RL32(buf + 40);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                     const void *userp, uint32_t hash)

 {
+
     struct qht_bucket *b = head;

     int i;

void *qht_do_lookup(struct qht_bucket *head, qht_lookup_func_t func,

                    const void *userp, uint32_t hash)

{

    struct qht_bucket *b = head;

    int i;

    do {

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

            if (b->hashes[i] == hash) {

                /* The pointer is dereferenced before seqlock_read_retry,

                 * so (unlike qht_insert__locked) we need to use

                 * atomic_rcu_read here.

                 */

                void *p = atomic_rcu_read(&b->pointers[i]);

                if (likely(p) && likely(func(p, userp))) {

                    return p;

                }

            }

        }

        b = atomic_rcu_read(&b->next);

    } while (b);

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void virtio_set_status(struct subchannel_id schid,

+                              unsigned long dev_addr)
+
 {

     unsigned char status = dev_addr;

static void virtio_set_status(struct subchannel_id schid,

                              unsigned long dev_addr)

{

    unsigned char status = dev_addr;

    run_ccw(schid, CCW_CMD_WRITE_STATUS, &status, sizeof(status));

}


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

                      TAK_BPS_MIN;

+    s->channels    = get_bits(gb, TAK_FORMAT_CHANNEL_BITS) +
+
+                     TAK_CHANNELS_MIN;
+
+

     if (get_bits1(gb)) {

void avpriv_tak_parse_streaminfo(GetBitContext *gb, TAKStreamInfo *s)

{

    uint64_t channel_mask = 0;

    int frame_type, i;

    s->codec = get_bits(gb, TAK_ENCODER_CODEC_BITS);

    skip_bits(gb, TAK_ENCODER_PROFILE_BITS);

    frame_type = get_bits(gb, TAK_SIZE_FRAME_DURATION_BITS);

    s->samples = get_bits64(gb, TAK_SIZE_SAMPLES_NUM_BITS);

    s->data_type   = get_bits(gb, TAK_FORMAT_DATA_TYPE_BITS);

    s->sample_rate = get_bits(gb, TAK_FORMAT_SAMPLE_RATE_BITS) +

                     TAK_SAMPLE_RATE_MIN;

    s->bps         = get_bits(gb, TAK_FORMAT_BPS_BITS) +

                     TAK_BPS_MIN;

    s->channels    = get_bits(gb, TAK_FORMAT_CHANNEL_BITS) +

                     TAK_CHANNELS_MIN;

    if (get_bits1(gb)) {

        skip_bits(gb, TAK_FORMAT_VALID_BITS);

        if (get_bits1(gb)) {

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

                int value = get_bits(gb, TAK_FORMAT_CH_LAYOUT_BITS);

                if (value < FF_ARRAY_ELEMS(tak_channel_layouts))

                    channel_mask |= tak_channel_layouts[value];

            }

        }

    }

    s->ch_layout     = channel_mask;

    s->frame_samples = tak_get_nb_samples(s->sample_rate, frame_type);

}


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

             sdram_set_bcr(&sdram->bcr[i],

+                          sdram_bcr(sdram->ram_bases[i], sdram->ram_sizes[i]),
+
+                          1);
+
+        } else {

             sdram_set_bcr(&sdram->bcr[i], 0x00000000, 0);

static void sdram_map_bcr (ppc4xx_sdram_t *sdram)

{

    int i;

    for (i = 0; i < sdram->nbanks; i++) {

        if (sdram->ram_sizes[i] != 0) {

            sdram_set_bcr(&sdram->bcr[i],

                          sdram_bcr(sdram->ram_bases[i], sdram->ram_sizes[i]),

                          1);

        } else {

            sdram_set_bcr(&sdram->bcr[i], 0x00000000, 0);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+uint64_t helper_subqv (uint64_t op1, uint64_t op2)
+
+{
+
+    uint64_t res;

+    res = op1 - op2;

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

uint64_t helper_subqv (uint64_t op1, uint64_t op2)

{

    uint64_t res;

    res = op1 - op2;

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

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

    }

    return res;

}


--- a/source.c
+++ b/source.c
@@ -7,13 +7,13 @@
     int r, e;

     siginfo_t siginfo;
+
+    sigset_t waitset;
+
+
+
+    ts.tv_sec = timeout / 1000;
+
     ts.tv_nsec = (timeout % 1000) * 1000000;

static void qemu_kvm_eat_signal(CPUState *env, int timeout)

{

    struct timespec ts;

    int r, e;

    siginfo_t siginfo;

    sigset_t waitset;

    ts.tv_sec = timeout / 1000;

    ts.tv_nsec = (timeout % 1000) * 1000000;

    sigemptyset(&waitset);

    sigaddset(&waitset, SIG_IPI);

    qemu_mutex_unlock(&qemu_global_mutex);

    r = sigtimedwait(&waitset, &siginfo, &ts);

    e = errno;

    qemu_mutex_lock(&qemu_global_mutex);

    if (r == -1 && !(e == EAGAIN || e == EINTR)) {

        fprintf(stderr, "sigtimedwait: %s\n", strerror(e));

        exit(1);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int cmp_intervals(const void *a, const void *b)

 {
+
+    const Interval *i1 = a;
+
+    const Interval *i2 = b;

     int64_t ts_diff = i1->start_ts - i2->start_ts;

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

{

    const Interval *i1 = a;

    const Interval *i2 = b;

    int64_t ts_diff = i1->start_ts - i2->start_ts;

    int ret;

    ret = ts_diff > 0 ? 1 : ts_diff < 0 ? -1 : 0;

    return ret == 0 ? i1->index - i2->index : ret;

}


--- a/source.c
+++ b/source.c
@@ -13,8 +13,8 @@
     r3d->video_offsets_count = (atom->size - 8) / 4;

     r3d->video_offsets = av_malloc(atom->size);
+
+    if (!r3d->video_offsets)

         return AVERROR(ENOMEM);

static int r3d_read_rdvo(AVFormatContext *s, Atom *atom)

{

    R3DContext *r3d = s->priv_data;

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

    int i;

    r3d->video_offsets_count = (atom->size - 8) / 4;

    r3d->video_offsets = av_malloc(atom->size);

    if (!r3d->video_offsets)

        return AVERROR(ENOMEM);

    for (i = 0; i < r3d->video_offsets_count; i++) {

        r3d->video_offsets[i] = avio_rb32(s->pb);

        if (!r3d->video_offsets[i]) {

            r3d->video_offsets_count = i;

            break;

        }

        av_dlog(s, "video offset %d: %#x\n", i, r3d->video_offsets[i]);

    }

    if (st->r_frame_rate.num)

        st->duration = av_rescale_q(r3d->video_offsets_count,

                                    (AVRational){st->r_frame_rate.den,

                                                 st->r_frame_rate.num},

                                    st->time_base);

    av_dlog(s, "duration %"PRId64"\n", st->duration);

    return 0;

}


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

     BDRVQcow2State *s = bs->opaque;
+
+    unsigned int nb_clusters;
+
+    int ret;
+

     /* The zero flag is only supported by version 3 and newer */

int qcow2_zero_clusters(BlockDriverState *bs, uint64_t offset, int nb_sectors)

{

    BDRVQcow2State *s = bs->opaque;

    unsigned int nb_clusters;

    int ret;

    /* The zero flag is only supported by version 3 and newer */

    if (s->qcow_version < 3) {

        return -ENOTSUP;

    }

    /* Each L2 table is handled by its own loop iteration */

    nb_clusters = size_to_clusters(s, nb_sectors << BDRV_SECTOR_BITS);

    s->cache_discards = true;

    while (nb_clusters > 0) {

        ret = zero_single_l2(bs, offset, nb_clusters);

        if (ret < 0) {

            goto fail;

        }

        nb_clusters -= ret;

        offset += (ret * s->cluster_size);

    }

    ret = 0;

fail:

    s->cache_discards = false;

    qcow2_process_discards(bs, ret);

    return ret;

}


static void mcf_fec_enable_rx(mcf_fec_state *s)

{

    mcf_fec_bd bd;

    mcf_fec_read_bd(&bd, s->rx_descriptor);

    s->rx_enabled = ((bd.flags & FEC_BD_E) != 0);

    if (!s->rx_enabled)

        DPRINTF("RX buffer full\n");

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iovec *iov,
                                unsigned int max_num_sg, bool is_write,
                                hwaddr pa, size_t sz)
+{
+    unsigned num_sg = *p_num_sg;
+    assert(num_sg <= max_num_sg);
+    if (!sz) {
         error_report("virtio: zero sized buffers are not allowed");
     while (sz) {
         hwaddr len = sz;

static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iovec *iov,
                               unsigned int max_num_sg, bool is_write,
                               hwaddr pa, size_t sz)
{
    unsigned num_sg = *p_num_sg;
    assert(num_sg <= max_num_sg);
    if (!sz) {
        error_report("virtio: zero sized buffers are not allowed");
    while (sz) {
        hwaddr len = sz;
        if (num_sg == max_num_sg) {
            error_report("virtio: too many write descriptors in indirect table");
        iov[num_sg].iov_base = cpu_physical_memory_map(pa, &len, is_write);
        iov[num_sg].iov_len = len;
        addr[num_sg] = pa;
        sz -= len;
        pa += len;
        num_sg++;
    *p_num_sg = num_sg;


--- a/source.c
+++ b/source.c
@@ -48,8 +48,8 @@
         err = AVERROR(ENOMEM);

+
+
+    return err;
+
+}

static int set_hwframe_ctx(AVCodecContext *ctx, AVBufferRef *hw_device_ctx)

{

    AVBufferRef *hw_frames_ref;

    AVHWFramesContext *frames_ctx = NULL;

    int err = 0;

    if (!(hw_frames_ref = av_hwframe_ctx_alloc(hw_device_ctx))) {

        fprintf(stderr, "Failed to create VAAPI frame context.\n");

        return -1;

    }

    frames_ctx = (AVHWFramesContext *)(hw_frames_ref->data);

    frames_ctx->format    = AV_PIX_FMT_VAAPI;

    frames_ctx->sw_format = AV_PIX_FMT_NV12;

    frames_ctx->width     = width;

    frames_ctx->height    = height;

    frames_ctx->initial_pool_size = 20;

    if ((err = av_hwframe_ctx_init(hw_frames_ref)) < 0) {

        fprintf(stderr, "Failed to initialize VAAPI frame context."

                "Error code: %s\n",av_err2str(err));

        return err;

    }

    ctx->hw_frames_ctx = av_buffer_ref(hw_frames_ref);

    if (!ctx->hw_frames_ctx)

        err = AVERROR(ENOMEM);

    return err;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void xen_config_cleanup_dir(char *dir)
+
+{
+
     struct xs_dirs *d;

static void xen_config_cleanup_dir(char *dir)

{

    struct xs_dirs *d;

    d = qemu_malloc(sizeof(*d));

    d->xs_dir = dir;

    TAILQ_INSERT_TAIL(&xs_cleanup, d, list);

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
      * parameters as the flash devices on the Versatile Express board.

      */
+
+    DriveInfo *dinfo = drive_get_next(IF_PFLASH);
+
+    DeviceState *dev = qdev_create(NULL, "cfi.pflash01");
+
     const uint64_t sectorlength = 256 * 1024;

static void create_one_flash(const char *name, hwaddr flashbase,

                             hwaddr flashsize)

{

    /* Create and map a single flash device. We use the same

     * parameters as the flash devices on the Versatile Express board.

     */

    DriveInfo *dinfo = drive_get_next(IF_PFLASH);

    DeviceState *dev = qdev_create(NULL, "cfi.pflash01");

    const uint64_t sectorlength = 256 * 1024;

    if (dinfo && qdev_prop_set_drive(dev, "drive",

                                     blk_bs(blk_by_legacy_dinfo(dinfo)))) {

        abort();

    }

    qdev_prop_set_uint32(dev, "num-blocks", flashsize / sectorlength);

    qdev_prop_set_uint64(dev, "sector-length", sectorlength);

    qdev_prop_set_uint8(dev, "width", 4);

    qdev_prop_set_uint8(dev, "device-width", 2);

    qdev_prop_set_uint8(dev, "big-endian", 0);

    qdev_prop_set_uint16(dev, "id0", 0x89);

    qdev_prop_set_uint16(dev, "id1", 0x18);

    qdev_prop_set_uint16(dev, "id2", 0x00);

    qdev_prop_set_uint16(dev, "id3", 0x00);

    qdev_prop_set_string(dev, "name", name);

    qdev_init_nofail(dev);

    sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, flashbase);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static uint64_t ahci_alloc(AHCIQState *ahci, size_t bytes)
+
 {

     return qmalloc(ahci->parent, bytes);

static uint64_t ahci_alloc(AHCIQState *ahci, size_t bytes)

{

    return qmalloc(ahci->parent, bytes);

}


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

     uint8_t bits[256];

+    uint8_t syms[256];

     uint32_t code;

static int huff_build(VLC *vlc, uint8_t *len)

{

    HuffEntry he[256];

    uint32_t codes[256];

    uint8_t bits[256];

    uint8_t syms[256];

    uint32_t code;

    int i;

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

        he[i].sym = 255 - i;

        he[i].len = len[i];

        if (len[i] == 0)

            return AVERROR_INVALIDDATA;

    }

    AV_QSORT(he, 256, HuffEntry, huff_cmp_len);

    code = 1;

    for (i = 255; i >= 0; i--) {

        codes[i] = code >> (32 - he[i].len);

        bits[i]  = he[i].len;

        syms[i]  = he[i].sym;

        code += 0x80000000u >> (he[i].len - 1);

    }

    ff_free_vlc(vlc);

    return ff_init_vlc_sparse(vlc, FFMIN(he[255].len, 12), 256,

                              bits,  sizeof(*bits),  sizeof(*bits),

                              codes, sizeof(*codes), sizeof(*codes),

                              syms,  sizeof(*syms),  sizeof(*syms), 0);

}


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

     if (!ga_is_frozen(s)) {
+
         return;

     }

void ga_unset_frozen(GAState *s)

{

    if (!ga_is_frozen(s)) {

        return;

    }

    /* if we delayed creation/opening of pid/log files due to being

     * in a frozen state at start up, do it now

     */

    if (s->deferred_options.log_filepath) {

        s->log_file = fopen(s->deferred_options.log_filepath, "a");

        if (!s->log_file) {

            s->log_file = stderr;

        }

        s->deferred_options.log_filepath = NULL;

    }

    ga_enable_logging(s);

    g_warning("logging re-enabled due to filesystem unfreeze");

    if (s->deferred_options.pid_filepath) {

        if (!ga_open_pidfile(s->deferred_options.pid_filepath)) {

            g_warning("failed to create/open pid file");

        }

        s->deferred_options.pid_filepath = NULL;

    }

    /* enable all disabled, non-blacklisted commands */

    ga_enable_non_blacklisted(s->blacklist);

    s->frozen = false;

    if (!ga_delete_file(s->state_filepath_isfrozen)) {

        g_warning("unable to delete %s, fsfreeze may not function properly",

                  s->state_filepath_isfrozen);

    }

}


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

     dolog ("U nam writel %#x <- %#x\n", addr, val);

+    s->cas = 0;
+
+}

static void nam_writel (void *opaque, uint32_t addr, uint32_t val)

{

    PCIAC97LinkState *d = opaque;

    AC97LinkState *s = &d->ac97;

    dolog ("U nam writel %#x <- %#x\n", addr, val);

    s->cas = 0;

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
         farg.ll = float_zero_divide_excp(fone.d, farg.d);

     } else if (likely(isnormal(farg.d))) {
+
+        farg.d = float64_div(fone.d, farg.d, &env->fp_status);
+
+    } else {
+
         if (farg.ll == 0x8000000000000000ULL) {

             farg.ll = 0xFFF0000000000000ULL;

uint64_t helper_fre (uint64_t arg)

{

    CPU_DoubleU fone, farg;

    fone.ll = 0x3FF0000000000000ULL; /* 1.0 */

    farg.ll = arg;

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

        /* sNaN reciprocal */

        farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN);

    } else if (unlikely(float64_is_zero(farg.d))) {

        /* Zero reciprocal */

        farg.ll = float_zero_divide_excp(fone.d, farg.d);

    } else if (likely(isnormal(farg.d))) {

        farg.d = float64_div(fone.d, farg.d, &env->fp_status);

    } else {

        if (farg.ll == 0x8000000000000000ULL) {

            farg.ll = 0xFFF0000000000000ULL;

        } else if (farg.ll == 0x0000000000000000ULL) {

            farg.ll = 0x7FF0000000000000ULL;

        } else if (float64_is_nan(farg.d)) {

            farg.ll = 0x7FF8000000000000ULL;

        } else if (float64_is_neg(farg.d)) {

            farg.ll = 0x8000000000000000ULL;

        } else {

            farg.ll = 0x0000000000000000ULL;

        }

    }

    return farg.d;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static uint32_t virtio_net_bad_features(VirtIODevice *vdev)

 {
+
+    uint32_t features = 0;
+
+

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

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_GUEST_CSUM);

    features |= (1 << VIRTIO_NET_F_GUEST_TSO4);

    features |= (1 << VIRTIO_NET_F_GUEST_TSO6);

    features |= (1 << VIRTIO_NET_F_GUEST_ECN);

    return features & virtio_net_get_features(vdev);

}


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

                                             int nb_sectors, int *pnum)
+
+{
+
     *pnum = nb_sectors;

     return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_DATA |

static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *bs,

                                            int64_t sector_num,

                                            int nb_sectors, int *pnum)

{

    *pnum = nb_sectors;

    return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_DATA |

           (sector_num << BDRV_SECTOR_BITS);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int tty_serial_ioctl(CharDriverState *chr, int cmd, void *arg)
+
+
+    FDCharDriver *s = chr->opaque;
+

     switch(cmd) {

static int tty_serial_ioctl(CharDriverState *chr, int cmd, void *arg)

    FDCharDriver *s = chr->opaque;

    switch(cmd) {

    case CHR_IOCTL_SERIAL_SET_PARAMS:

            QEMUSerialSetParams *ssp = arg;

            tty_serial_init(s->fd_in, ssp->speed, ssp->parity,

                            ssp->data_bits, ssp->stop_bits);

    case CHR_IOCTL_SERIAL_SET_BREAK:

            int enable = *(int *)arg;

            if (enable)

                tcsendbreak(s->fd_in, 1);

    default:

        return -ENOTSUP;

    return 0;


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

 {

+    QemuUUID expected, measured;

     gchar *cmd;

static void vmgenid_set_guid_test(void)

{

    QemuUUID expected, measured;

    gchar *cmd;

    g_assert(qemu_uuid_parse(VGID_GUID, &expected) == 0);

    cmd = g_strdup_printf("-machine accel=tcg -device vmgenid,id=testvgid,"

                          "guid=%s", VGID_GUID);

    qtest_start(cmd);

    /* Read the GUID from accessing guest memory */

    read_guid_from_memory(&measured);

    g_assert(memcmp(measured.data, expected.data, sizeof(measured.data)) == 0);

    qtest_quit(global_qtest);

    g_free(cmd);

}


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

+    visit_type_int64(v, name, &value, &local_err);

     if (local_err) {

static void iothread_set_poll_max_ns(Object *obj, Visitor *v,

        const char *name, void *opaque, Error **errp)

{

    IOThread *iothread = IOTHREAD(obj);

    Error *local_err = NULL;

    int64_t value;

    visit_type_int64(v, name, &value, &local_err);

    if (local_err) {

        goto out;

    }

    if (value < 0) {

        error_setg(&local_err, "poll_max_ns value must be in range "

                   "[0, %"PRId64"]", INT64_MAX);

        goto out;

    }

    iothread->poll_max_ns = value;

    if (iothread->ctx) {

        aio_context_set_poll_params(iothread->ctx, value, &local_err);

    }

out:

    error_propagate(errp, local_err);

}


--- a/source.c
+++ b/source.c
@@ -11,7 +11,7 @@
     int scale = AV_RB16(in);

     int i;
+
     int s0, s1, s2, d;

static int adx_decode(ADXContext *c, int16_t *out, int offset,

                      const uint8_t *in, int ch)

{

    ADXChannelState *prev = &c->prev[ch];

    GetBitContext gb;

    int scale = AV_RB16(in);

    int i;

    int s0, s1, s2, d;

    /* check if this is an EOF packet */

    if (scale & 0x8000)

        return -1;

    init_get_bits(&gb, in + 2, (BLOCK_SIZE - 2) * 8);

    out += offset;

    s1 = prev->s1;

    s2 = prev->s2;

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

        d  = get_sbits(&gb, 4);

        s0 = ((d << COEFF_BITS) * scale + c->coeff[0] * s1 + c->coeff[1] * s2) >> COEFF_BITS;

        s2 = s1;

        s1 = av_clip_int16(s0);

        *out++ = s1;

    }

    prev->s1 = s1;

    prev->s2 = s2;

    return 0;

}


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

     assert(!permit_abbrev || list->implied_opt_name);

+    firstname = permit_abbrev ? list->implied_opt_name : NULL;

+
     if (strncmp(params, "id=", 3) == 0) {
+
         get_opt_value(value, sizeof(value), params+3);

         id = value;

static QemuOpts *opts_parse(QemuOptsList *list, const char *params,

                            int permit_abbrev, bool defaults)

{

    const char *firstname;

    char value[1024], *id = NULL;

    const char *p;

    QemuOpts *opts;

    assert(!permit_abbrev || list->implied_opt_name);

    firstname = permit_abbrev ? list->implied_opt_name : NULL;

    if (strncmp(params, "id=", 3) == 0) {

        get_opt_value(value, sizeof(value), params+3);

        id = value;

    } else if ((p = strstr(params, ",id=")) != NULL) {

        get_opt_value(value, sizeof(value), p+4);

        id = value;

    }

    if (defaults) {

        if (!id && !QTAILQ_EMPTY(&list->head)) {

            opts = qemu_opts_find(list, NULL);

        } else {

            opts = qemu_opts_create(list, id, 0);

        }

    } else {

        opts = qemu_opts_create(list, id, 1);

    }

    if (opts == NULL)

        return NULL;

    if (opts_do_parse(opts, params, firstname, defaults) != 0) {

        qemu_opts_del(opts);

        return NULL;

    }

    return opts;

}


--- a/source.c
+++ b/source.c
@@ -1,27 +1,27 @@
 void yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4],int brightness,int contrast, int saturation)
+
+{
+
+  union {

   	signed short tmp[8] __attribute__ ((aligned(16)));

 	vector signed short vec;

 	} buf;
+
+
+
+  buf.tmp[0] =  ( (0xffffLL) * contrast>>8 )>>9;			//cy
+
+  buf.tmp[1] =  -256*brightness;					//oy
+
   buf.tmp[2] =  (inv_table[0]>>3) *(contrast>>16)*(saturation>>16);	//crv
+
+  buf.tmp[3] =  (inv_table[1]>>3) *(contrast>>16)*(saturation>>16);	//cbu
+
+  buf.tmp[4] = -((inv_table[2]>>1)*(contrast>>16)*(saturation>>16));	//cgu
+
   buf.tmp[5] = -((inv_table[3]>>1)*(contrast>>16)*(saturation>>16));	//cgv

void yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4],int brightness,int contrast, int saturation)

{

  union {

  	signed short tmp[8] __attribute__ ((aligned(16)));

	vector signed short vec;

	} buf;

  buf.tmp[0] =  ( (0xffffLL) * contrast>>8 )>>9;			//cy

  buf.tmp[1] =  -256*brightness;					//oy

  buf.tmp[2] =  (inv_table[0]>>3) *(contrast>>16)*(saturation>>16);	//crv

  buf.tmp[3] =  (inv_table[1]>>3) *(contrast>>16)*(saturation>>16);	//cbu

  buf.tmp[4] = -((inv_table[2]>>1)*(contrast>>16)*(saturation>>16));	//cgu

  buf.tmp[5] = -((inv_table[3]>>1)*(contrast>>16)*(saturation>>16));	//cgv

  c->CSHIFT = (vector unsigned short)vec_splat_u16(2);

  c->CY  = vec_splat ((vector signed short)buf.vec, 0);

  c->OY  = vec_splat ((vector signed short)buf.vec, 1);

  c->CRV  = vec_splat ((vector signed short)buf.vec, 2);

  c->CBU  = vec_splat ((vector signed short)buf.vec, 3);

  c->CGU  = vec_splat ((vector signed short)buf.vec, 4);

  c->CGV  = vec_splat ((vector signed short)buf.vec, 5);

#if 0

{

int i;

char *v[6]={"cy","oy","crv","cbu","cgu","cgv"};

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

  printf("%s %d ", v[i],buf.tmp[i] );

  printf("\n");

}

#endif

 return;

}


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

     int network_header_length = ppkt->ip->ip_hl * 4;

+

     trace_colo_compare_main("compare icmp");

static int colo_packet_compare_icmp(Packet *spkt, Packet *ppkt)

{

    int network_header_length = ppkt->ip->ip_hl * 4;

    trace_colo_compare_main("compare icmp");

    /*

     * Because of ppkt and spkt are both in the same connection,

     * The ppkt's src ip, dst ip, src port, dst port, ip_proto all are

     * same with spkt. In addition, IP header's Identification is a random

     * field, we can handle it in IP fragmentation function later.

     * COLO just concern the response net packet payload from primary guest

     * and secondary guest are same or not, So we ignored all IP header include

     * other field like TOS,TTL,IP Checksum. we only need to compare

     * the ip payload here.

     */

    if (colo_packet_compare_common(ppkt, spkt,

                                   network_header_length + ETH_HLEN)) {

        trace_colo_compare_icmp_miscompare("primary pkt size",

                                           ppkt->size);

        trace_colo_compare_icmp_miscompare("Secondary pkt size",

                                           spkt->size);

        if (trace_event_get_state(TRACE_COLO_COMPARE_MISCOMPARE)) {

            qemu_hexdump((char *)ppkt->data, stderr, "colo-compare pri pkt",

                         ppkt->size);

            qemu_hexdump((char *)spkt->data, stderr, "colo-compare sec pkt",

                         spkt->size);

        }

        return -1;

    } else {

        return 0;

    }

}


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

     if (*ptr) {

+        blockdev_auto_del((*ptr)->bdrv);
+
+    }

 }

static void free_drive(DeviceState *dev, Property *prop)

{

    DriveInfo **ptr = qdev_get_prop_ptr(dev, prop);

    if (*ptr) {

        blockdev_auto_del((*ptr)->bdrv);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void v9fs_synth_rewinddir(FsContext *ctx, V9fsFidOpenState *fs)

 {

static void v9fs_synth_rewinddir(FsContext *ctx, V9fsFidOpenState *fs)

{

    v9fs_synth_seekdir(ctx, fs, 0);

}


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

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

+        idx[i] = ceilf(asin(coef[i])*((coef[i] >= 0) ? iqfac_p : iqfac_m));
+
+        u_coef = (idx[i])&(~(~0<<TNS_Q_BITS));
+
+        lpc[i] = quant_arr[u_coef];

     }

static int quantize_coefs(double *coef, int *idx, float *lpc, int order)

{

    int i;

    uint8_t u_coef;

    const float *quant_arr = tns_tmp2_map[TNS_Q_BITS == 4];

    const double iqfac_p = ((1 << (TNS_Q_BITS-1)) - 0.5)/(M_PI/2.0);

    const double iqfac_m = ((1 << (TNS_Q_BITS-1)) + 0.5)/(M_PI/2.0);

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

        idx[i] = ceilf(asin(coef[i])*((coef[i] >= 0) ? iqfac_p : iqfac_m));

        u_coef = (idx[i])&(~(~0<<TNS_Q_BITS));

        lpc[i] = quant_arr[u_coef];

    }

    return order;

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     int i,len;

+
+    bus = qemu_mallocz(info->size);
+
+    bus->info = info;
+
     bus->parent = parent;

BusState *qbus_create(BusInfo *info, DeviceState *parent, const char *name)

{

    BusState *bus;

    char *buf;

    int i,len;

    bus = qemu_mallocz(info->size);

    bus->info = info;

    bus->parent = parent;

    if (name) {

        /* use supplied name */

        bus->name = qemu_strdup(name);

    } else if (parent && parent->id) {

        /* parent device has id -> use it for bus name */

        len = strlen(parent->id) + 16;

        buf = qemu_malloc(len);

        snprintf(buf, len, "%s.%d", parent->id, parent->num_child_bus);

        bus->name = buf;

    } else {

        /* no id -> use lowercase bus type for bus name */

        len = strlen(info->name) + 16;

        buf = qemu_malloc(len);

        len = snprintf(buf, len, "%s.%d", info->name,

                       parent ? parent->num_child_bus : 0);

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

            buf[i] = qemu_tolower(buf[i]);

        bus->name = buf;

    }

    LIST_INIT(&bus->children);

    if (parent) {

        LIST_INSERT_HEAD(&parent->child_bus, bus, sibling);

        parent->num_child_bus++;

    }

    return bus;

}


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

     for (info = info_list; info; info = info->next) {

+        MemoryDeviceInfo *value = info->value;
+
+
+
+        if (value) {

             switch (value->type) {

static void numa_stat_memory_devices(uint64_t node_mem[])

{

    MemoryDeviceInfoList *info_list = NULL;

    MemoryDeviceInfoList **prev = &info_list;

    MemoryDeviceInfoList *info;

    qmp_pc_dimm_device_list(qdev_get_machine(), &prev);

    for (info = info_list; info; info = info->next) {

        MemoryDeviceInfo *value = info->value;

        if (value) {

            switch (value->type) {

            case MEMORY_DEVICE_INFO_KIND_DIMM:

                node_mem[value->u.dimm->node] += value->u.dimm->size;

                break;

            default:

                break;

            }

        }

    }

    qapi_free_MemoryDeviceInfoList(info_list);

}


--- a/source.c
+++ b/source.c
@@ -9,10 +9,10 @@
     if (inited != 0)

         return;
+
+    inited = 1;
+
+

     dsputil_static_init();

void avcodec_init(void)

{

    static int inited = 0;

    if (inited != 0)

        return;

    inited = 1;

    dsputil_static_init();

}


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

     TCGv tmp = tcg_temp_new(TCG_TYPE_I32);
+
+    tcg_gen_qemu_ld32u(tmp, t1, flags);
+
     tcg_gen_helper_1_1(helper_memory_to_f, t0, tmp);

     tcg_temp_free(tmp);

static always_inline void gen_qemu_ldf (TCGv t0, TCGv t1, int flags)

{

    TCGv tmp = tcg_temp_new(TCG_TYPE_I32);

    tcg_gen_qemu_ld32u(tmp, t1, flags);

    tcg_gen_helper_1_1(helper_memory_to_f, t0, tmp);

    tcg_temp_free(tmp);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void enable_device(PIIX4PMState *s, int slot)

+{

     s->ar.gpe.sts[0] |= PIIX4_PCI_HOTPLUG_STATUS;

static void enable_device(PIIX4PMState *s, int slot)

{

    s->ar.gpe.sts[0] |= PIIX4_PCI_HOTPLUG_STATUS;

    s->pci0_status.up |= (1 << slot);

}


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

         return;

+
+
+    DPRINTF("cancelling migration\n");
+
+

     s->state = MIG_STATE_CANCELLED;

static void migrate_fd_cancel(MigrationState *s)

{

    if (s->state != MIG_STATE_ACTIVE)

        return;

    DPRINTF("cancelling migration\n");

    s->state = MIG_STATE_CANCELLED;

    notifier_list_notify(&migration_state_notifiers, s);

    migrate_fd_cleanup(s);

}


static CharDriverState *qemu_chr_open_ringbuf(ChardevRingbuf *opts,

                                              Error **errp)

{

    CharDriverState *chr;

    RingBufCharDriver *d;

    chr = g_malloc0(sizeof(CharDriverState));

    d = g_malloc(sizeof(*d));

    d->size = opts->has_size ? opts->size : 65536;

    /* The size must be power of 2 */

    if (d->size & (d->size - 1)) {

        error_setg(errp, "size of ringbuf chardev must be power of two");

        goto fail;

    }

    d->prod = 0;

    d->cons = 0;

    d->cbuf = g_malloc0(d->size);

    chr->opaque = d;

    chr->chr_write = ringbuf_chr_write;

    chr->chr_close = ringbuf_chr_close;

    return chr;

fail:

    g_free(d);

    g_free(chr);

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static void pci_bridge_region_init(PCIBridge *br)

 {
+
+    PCIBus *parent = br->dev.bus;
+
     uint16_t cmd = pci_get_word(br->dev.config + PCI_COMMAND);

static void pci_bridge_region_init(PCIBridge *br)

{

    PCIBus *parent = br->dev.bus;

    uint16_t cmd = pci_get_word(br->dev.config + PCI_COMMAND);

    pci_bridge_init_alias(br, &br->alias_pref_mem,

                          PCI_BASE_ADDRESS_MEM_PREFETCH,

                          "pci_bridge_pref_mem",

                          &br->address_space_mem,

                          parent->address_space_mem,

                          cmd & PCI_COMMAND_MEMORY);

    pci_bridge_init_alias(br, &br->alias_mem,

                          PCI_BASE_ADDRESS_SPACE_MEMORY,

                          "pci_bridge_mem",

                          &br->address_space_mem,

                          parent->address_space_mem,

                          cmd & PCI_COMMAND_MEMORY);

    pci_bridge_init_alias(br, &br->alias_io,

                          PCI_BASE_ADDRESS_SPACE_IO,

                          "pci_bridge_io",

                          &br->address_space_io,

                          parent->address_space_io,

                          cmd & PCI_COMMAND_IO);

   /* TODO: optinal VGA and VGA palette snooping support. */

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+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,

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,

	unsigned int width, unsigned int height, int lumStride, int chromStride)

{

	/* Y Plane */

	memcpy(ydst, ysrc, width*height);

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

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void cqueue_free(cqueue *q)
+
 {

     av_free(q->elements);

static void cqueue_free(cqueue *q)

{

    av_free(q->elements);

    av_free(q);

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     if(s->mb_y >= s->mb_height)

         return 1;
+
+    if(!s->mb_num_left)
+
+        return 1;
+
     if(r->s.mb_skip_run > 1)

         return 0;

static int check_slice_end(RV34DecContext *r, MpegEncContext *s)

{

    int bits;

    if(s->mb_y >= s->mb_height)

        return 1;

    if(!s->mb_num_left)

        return 1;

    if(r->s.mb_skip_run > 1)

        return 0;

    bits = get_bits_left(&s->gb);

    if(bits < 0 || (bits < 8 && !show_bits(&s->gb, bits)))

        return 1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static bool kvmppc_is_pr(KVMState *ks)
+
+{

     /* Assume KVM-PR if the GET_PVINFO capability is available */

static bool kvmppc_is_pr(KVMState *ks)

{

    /* Assume KVM-PR if the GET_PVINFO capability is available */

    return kvm_check_extension(ks, KVM_CAP_PPC_GET_PVINFO) != 0;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     b_frames = atoi(arg);

     if (b_frames > FF_MAX_B_FRAMES) {
+
+        fprintf(stderr, "\nCannot have more than %d B frames, increase FF_MAX_B_FRAMES.\n", FF_MAX_B_FRAMES);
+
+        exit(1);
+
     } else if (b_frames < 1) {

         fprintf(stderr, "\nNumber of B frames must be higher than 0\n");

static void opt_b_frames(const char *arg)

{

    b_frames = atoi(arg);

    if (b_frames > FF_MAX_B_FRAMES) {

        fprintf(stderr, "\nCannot have more than %d B frames, increase FF_MAX_B_FRAMES.\n", FF_MAX_B_FRAMES);

        exit(1);

    } else if (b_frames < 1) {

        fprintf(stderr, "\nNumber of B frames must be higher than 0\n");

        exit(1);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+uint32_t HELPER(lpxbr)(CPUS390XState *env, uint32_t f1, uint32_t f2)
+
+{
+
+    CPU_QuadU v1;

     CPU_QuadU v2;

uint32_t HELPER(lpxbr)(CPUS390XState *env, uint32_t f1, uint32_t f2)

{

    CPU_QuadU v1;

    CPU_QuadU v2;

    v2.ll.upper = env->fregs[f2].ll;

    v2.ll.lower = env->fregs[f2 + 2].ll;

    v1.q = float128_abs(v2.q);

    env->fregs[f1].ll = v1.ll.upper;

    env->fregs[f1 + 2].ll = v1.ll.lower;

    return set_cc_nz_f128(v1.q);

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
             qerror_report(QERR_DEVICE_NOT_FOUND, device);

             return;
+
+        }
+
+        bdrv_commit(bs);
+
     }

 }

void do_commit(Monitor *mon, const QDict *qdict)

{

    const char *device = qdict_get_str(qdict, "device");

    BlockDriverState *bs;

    if (!strcmp(device, "all")) {

        bdrv_commit_all();

    } else {

        bs = bdrv_find(device);

        if (!bs) {

            qerror_report(QERR_DEVICE_NOT_FOUND, device);

            return;

        }

        bdrv_commit(bs);

    }

}


--- a/source.c
+++ b/source.c
@@ -69,11 +69,11 @@
         }

         DPRINTF("read: %08x = %08x\n", s->ioregsel, val);
+
+        break;
+
+    }
+
     return val;

 }

ioapic_mem_read(void *opaque, target_phys_addr_t addr, unsigned int size)

{

    IOAPICCommonState *s = opaque;

    int index;

    uint32_t val = 0;

    switch (addr & 0xff) {

    case IOAPIC_IOREGSEL:

        val = s->ioregsel;

        break;

    case IOAPIC_IOWIN:

        if (size != 4) {

            break;

        }

        switch (s->ioregsel) {

        case IOAPIC_REG_ID:

            val = s->id << IOAPIC_ID_SHIFT;

            break;

        case IOAPIC_REG_VER:

            val = IOAPIC_VERSION |

                ((IOAPIC_NUM_PINS - 1) << IOAPIC_VER_ENTRIES_SHIFT);

            break;

        case IOAPIC_REG_ARB:

            val = 0;

            break;

        default:

            index = (s->ioregsel - IOAPIC_REG_REDTBL_BASE) >> 1;

            if (index >= 0 && index < IOAPIC_NUM_PINS) {

                if (s->ioregsel & 1) {

                    val = s->ioredtbl[index] >> 32;

                } else {

                    val = s->ioredtbl[index] & 0xffffffff;

                }

            }

        }

        DPRINTF("read: %08x = %08x\n", s->ioregsel, val);

        break;

    }

    return val;

}


--- a/source.c
+++ b/source.c
@@ -3,9 +3,9 @@
                               target_ulong opcode, target_ulong *args)

 {
+
+    target_ulong liobn = args[0];
+
     target_ulong ioba = args[1];

     target_ulong tce = args[2];

static target_ulong h_put_tce(PowerPCCPU *cpu, sPAPREnvironment *spapr,

                              target_ulong opcode, target_ulong *args)

{

    target_ulong liobn = args[0];

    target_ulong ioba = args[1];

    target_ulong tce = args[2];

    sPAPRTCETable *tcet = spapr_tce_find_by_liobn(liobn);

    if (liobn & 0xFFFFFFFF00000000ULL) {

        hcall_dprintf("spapr_vio_put_tce on out-of-boundsw LIOBN "

                      TARGET_FMT_lx "\n", liobn);

        return H_PARAMETER;

    }

    ioba &= ~(SPAPR_TCE_PAGE_SIZE - 1);

    if (tcet) {

        return put_tce_emu(tcet, ioba, tce);

    }

#ifdef DEBUG_TCE

    fprintf(stderr, "%s on liobn=" TARGET_FMT_lx /*%s*/

            "  ioba 0x" TARGET_FMT_lx "  TCE 0x" TARGET_FMT_lx "\n",

            __func__, liobn, /*dev->qdev.id, */ioba, tce);

#endif

    return H_PARAMETER;

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
         int over = gen_new_label();

         tcg_out_jxx(s, tcg_cond_to_jcc[tcg_invert_cond(cond)], over, 1);
+
+        tcg_out_mov(s, TCG_TYPE_I32, dest, v1);
+
+        tcg_out_label(s, over, s->code_ptr);
+
     }

 }

static void tcg_out_movcond32(TCGContext *s, TCGCond cond, TCGArg dest,

                              TCGArg c1, TCGArg c2, int const_c2,

                              TCGArg v1)

{

    tcg_out_cmp(s, c1, c2, const_c2, 0);

    if (have_cmov) {

        tcg_out_modrm(s, OPC_CMOVCC | tcg_cond_to_jcc[cond], dest, v1);

    } else {

        int over = gen_new_label();

        tcg_out_jxx(s, tcg_cond_to_jcc[tcg_invert_cond(cond)], over, 1);

        tcg_out_mov(s, TCG_TYPE_I32, dest, v1);

        tcg_out_label(s, over, s->code_ptr);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void migrate_finish_set_state(MigrationState *s, int new_state)
+
 {

     if (atomic_cmpxchg(&s->state, MIG_STATE_ACTIVE, new_state) == new_state) {

static void migrate_finish_set_state(MigrationState *s, int new_state)

{

    if (atomic_cmpxchg(&s->state, MIG_STATE_ACTIVE, new_state) == new_state) {

        trace_migrate_set_state(new_state);

    }

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     while (g->name)

         g++;
+
+    octx->nb_groups = g - groups;
+
+    octx->groups    = av_mallocz(sizeof(*octx->groups) * octx->nb_groups);
+
     if (!octx->groups)

         exit(1);

static void init_parse_context(OptionParseContext *octx,

                               const OptionGroupDef *groups)

{

    static const OptionGroupDef global_group = { "global" };

    const OptionGroupDef *g = groups;

    int i;

    memset(octx, 0, sizeof(*octx));

    while (g->name)

        g++;

    octx->nb_groups = g - groups;

    octx->groups    = av_mallocz(sizeof(*octx->groups) * octx->nb_groups);

    if (!octx->groups)

        exit(1);

    for (i = 0; i < octx->nb_groups; i++)

        octx->groups[i].group_def = &groups[i];

    octx->global_opts.group_def = &global_group;

    octx->global_opts.arg       = "";

    init_opts();

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void cpu_exec_exit(CPUState *cpu)
+
+{
+
+    if (cpu->cpu_index == -1) {

         /* cpu_index was never allocated by this @cpu or was already freed. */

void cpu_exec_exit(CPUState *cpu)

{

    if (cpu->cpu_index == -1) {

        /* cpu_index was never allocated by this @cpu or was already freed. */

        return;

    }

    bitmap_clear(cpu_index_map, cpu->cpu_index, 1);

    cpu->cpu_index = -1;

}


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

+    while ((c = getopt(argc, argv,

                        "h"  /* help */

ivshmem_client_parse_args(IvshmemClientArgs *args, int argc, char *argv[])

{

    int c;

    while ((c = getopt(argc, argv,

                       "h"  /* help */

                       "v"  /* verbose */

                       "S:" /* unix_sock_path */

                      )) != -1) {

        switch (c) {

        case 'h': /* help */

            ivshmem_client_usage(argv[0], 0);

            break;

        case 'v': /* verbose */

            args->verbose = 1;

            break;

        case 'S': /* unix_sock_path */

            args->unix_sock_path = strdup(optarg);

            break;

        default:

            ivshmem_client_usage(argv[0], 1);

            break;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -4,4 +4,4 @@
     QObject *qobj = qmp_input_get_object(qiv, name, true);
     if (qobject_type(qobj) != QTYPE_QNULL) {
         error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",
+                   "null");

static void qmp_input_type_null(Visitor *v, const char *name, Error **errp)
{
    QmpInputVisitor *qiv = to_qiv(v);
    QObject *qobj = qmp_input_get_object(qiv, name, true);
    if (qobject_type(qobj) != QTYPE_QNULL) {
        error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",
                   "null");


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static bool object_create_initial(const char *type)
 {
+    if (g_str_equal(type, "rng-egd")) {
+    /*
      * return false for concrete netfilters since
      * they depend on netdevs already existing
     if (g_str_equal(type, "filter-buffer") ||

static bool object_create_initial(const char *type)
{
    if (g_str_equal(type, "rng-egd")) {
    /*
     * return false for concrete netfilters since
     * they depend on netdevs already existing
    if (g_str_equal(type, "filter-buffer") ||
        g_str_equal(type, "filter-dump") ||
        g_str_equal(type, "filter-mirror") ||
        g_str_equal(type, "filter-redirector")) {
    return true;


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

     kroute.flags = 0;

+    kroute.u.msi.address_lo = (uint32_t)msg.address;
+
+    kroute.u.msi.address_hi = msg.address >> 32;
+
+    kroute.u.msi.data = msg.data;

int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg)

{

    struct kvm_irq_routing_entry kroute;

    if (!kvm_irqchip_in_kernel()) {

        return -ENOSYS;

    }

    kroute.gsi = virq;

    kroute.type = KVM_IRQ_ROUTING_MSI;

    kroute.flags = 0;

    kroute.u.msi.address_lo = (uint32_t)msg.address;

    kroute.u.msi.address_hi = msg.address >> 32;

    kroute.u.msi.data = msg.data;

    return kvm_update_routing_entry(s, &kroute);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int bgr24ToYv12Wrapper(SwsContext *c, const uint8_t *src[],
+
                               int srcStride[], int srcSliceY, int srcSliceH,

                               uint8_t *dst[], int dstStride[])

static int bgr24ToYv12Wrapper(SwsContext *c, const uint8_t *src[],

                              int srcStride[], int srcSliceY, int srcSliceH,

                              uint8_t *dst[], int dstStride[])

{

    rgb24toyv12(

        src[0],

        dst[0] +  srcSliceY       * dstStride[0],

        dst[1] + (srcSliceY >> 1) * dstStride[1],

        dst[2] + (srcSliceY >> 1) * dstStride[2],

        c->srcW, srcSliceH,

        dstStride[0], dstStride[1], srcStride[0]);

    if (dst[3])

        fillPlane(dst[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255);

    return srcSliceH;

}


--- a/source.c
+++ b/source.c
@@ -43,11 +43,11 @@
     if (pm->smi_en & ICH9_PMIO_SMI_EN_TCO_EN) {

         ich9_generate_smi();
+
+    } else {
+
+        ich9_generate_nmi();
+
     }

     tr->tco.rld = tr->tco.tmr;

static void tco_timer_expired(void *opaque)

{

    TCOIORegs *tr = opaque;

    ICH9LPCPMRegs *pm = container_of(tr, ICH9LPCPMRegs, tco_regs);

    ICH9LPCState *lpc = container_of(pm, ICH9LPCState, pm);

    uint32_t gcs = pci_get_long(lpc->chip_config + ICH9_CC_GCS);

    tr->tco.rld = 0;

    tr->tco.sts1 |= TCO_TIMEOUT;

    if (++tr->timeouts_no == 2) {

        tr->tco.sts2 |= TCO_SECOND_TO_STS;

        tr->tco.sts2 |= TCO_BOOT_STS;

        tr->timeouts_no = 0;

        if (!(gcs & ICH9_CC_GCS_NO_REBOOT)) {

            watchdog_perform_action();

            tco_timer_stop(tr);

            return;

        }

    }

    if (pm->smi_en & ICH9_PMIO_SMI_EN_TCO_EN) {

        ich9_generate_smi();

    } else {

        ich9_generate_nmi();

    }

    tr->tco.rld = tr->tco.tmr;

    tco_timer_reload(tr);

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     uint32_t ret = 0;

+
+    wpnum = addr >> (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT);
+
+
+
     for (i = 0; i < 32; i ++, wpnum ++, addr += WPGROUP_SIZE)

         if (addr < sd->size && sd->wp_groups[wpnum])

static uint32_t sd_wpbits(SDState *sd, uint64_t addr)

{

    uint32_t i, wpnum;

    uint32_t ret = 0;

    wpnum = addr >> (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT);

    for (i = 0; i < 32; i ++, wpnum ++, addr += WPGROUP_SIZE)

        if (addr < sd->size && sd->wp_groups[wpnum])

            ret |= (1 << i);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -4,9 +4,9 @@
     len = s->buf_end - s->buf_ptr;
     if (len == 0) {
         fill_buffer(s);
+        len = s->buf_end - s->buf_ptr;
+    }
+    if (len > size)
         len = size;
     memcpy(buf, s->buf_ptr, len);
     s->buf_ptr += len;

int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size)
{
    int len;
    len = s->buf_end - s->buf_ptr;
    if (len == 0) {
        fill_buffer(s);
        len = s->buf_end - s->buf_ptr;
    }
    if (len > size)
        len = size;
    memcpy(buf, s->buf_ptr, len);
    s->buf_ptr += len;
    return len;
}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
         skip_bits_long(gb,24+align);

         h->stc = get_bits(gb,8);
+
+        decode_slice_header(h,gb);
+
+        return 1;
+
     }

     return 0;

static inline int check_for_slice(AVSContext *h) {

    GetBitContext *gb = &h->s.gb;

    int align;

    if(h->mbx)

        return 0;

    align = (-get_bits_count(gb)) & 7;

    /* check for stuffing byte */

    if(!align && (show_bits(gb,8) == 0x80))

        get_bits(gb,8);

    if((show_bits_long(gb,24+align) & 0xFFFFFF) == 0x000001) {

        skip_bits_long(gb,24+align);

        h->stc = get_bits(gb,8);

        decode_slice_header(h,gb);

        return 1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void openpic_load_IRQ_queue(QEMUFile* f, IRQ_queue_t *q)

 {

static void openpic_load_IRQ_queue(QEMUFile* f, IRQ_queue_t *q)

{

    unsigned int i;

    for (i = 0; i < BF_WIDTH(MAX_IRQ); i++)

        qemu_get_be32s(f, &q->queue[i]);

    qemu_get_sbe32s(f, &q->next);

    qemu_get_sbe32s(f, &q->priority);

}


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

     destroy_l2_mapping(&phys_map, P_L2_LEVELS - 1);

+    phys_map_nodes_reset();
+
 }

static void destroy_all_mappings(void)

{

    destroy_l2_mapping(&phys_map, P_L2_LEVELS - 1);

    phys_map_nodes_reset();

}


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

         if (!strcmp(channel_layout_map[i].name, name))

+            return channel_layout_map[i].layout;
+
+        i++;
+
+    } while (channel_layout_map[i].name);

int64_t av_get_channel_layout(const char *name)

{

    int i = 0;

    do {

        if (!strcmp(channel_layout_map[i].name, name))

            return channel_layout_map[i].layout;

        i++;

    } while (channel_layout_map[i].name);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static inline void comp_block(MadContext *t, int mb_x, int mb_y,

                               int j, int mv_x, int mv_y, int add)
+
 {

+    MpegEncContext *s = &t->s;

     if (j < 4) {

static inline void comp_block(MadContext *t, int mb_x, int mb_y,

                              int j, int mv_x, int mv_y, int add)

{

    MpegEncContext *s = &t->s;

    if (j < 4) {

        comp(t->frame.data[0] + (mb_y*16 + ((j&2)<<2))*t->frame.linesize[0] + mb_x*16 + ((j&1)<<3),

             t->frame.linesize[0],

             t->last_frame.data[0] + (mb_y*16 + ((j&2)<<2) + mv_y)*t->last_frame.linesize[0] + mb_x*16 + ((j&1)<<3) + mv_x,

             t->last_frame.linesize[0], add);

    } else if (!(s->avctx->flags & CODEC_FLAG_GRAY)) {

        int index = j - 3;

        comp(t->frame.data[index] + (mb_y*8)*t->frame.linesize[index] + mb_x * 8,

             t->frame.linesize[index],

             t->last_frame.data[index] + (mb_y * 8 + (mv_y/2))*t->last_frame.linesize[index] + mb_x * 8 + (mv_x/2),

             t->last_frame.linesize[index], add);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void ppc_hw_interrupt (CPUState *env)

 {
+
     env->exception_index = -1;

 }

void ppc_hw_interrupt (CPUState *env)

{

    env->exception_index = -1;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void qvirtio_pci_set_status(QVirtioDevice *d, uint8_t status)

+{

     QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;

static void qvirtio_pci_set_status(QVirtioDevice *d, uint8_t status)

{

    QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;

    qpci_io_writeb(dev->pdev, dev->addr + VIRTIO_PCI_STATUS, status);

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     const char *str = "";

     char f = 'X';
+
+    const char *endptr = &f;
+
     unsigned long res = 999;

     int err;

static void test_qemu_strtoul_empty(void)

{

    const char *str = "";

    char f = 'X';

    const char *endptr = &f;

    unsigned long res = 999;

    int err;

    err = qemu_strtoul(str, &endptr, 0, &res);

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, 0);

    g_assert(endptr == str);

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     if (replay_mode != REPLAY_MODE_PLAY) {

         /* put the event into the file */
+
+        replay_put_event(EVENT_ASYNC);
+
+        replay_put_byte(checkpoint);
+
         replay_put_byte(event->event_kind);

static void replay_save_event(Event *event, int checkpoint)

{

    if (replay_mode != REPLAY_MODE_PLAY) {

        /* put the event into the file */

        replay_put_event(EVENT_ASYNC);

        replay_put_byte(checkpoint);

        replay_put_byte(event->event_kind);

        /* save event-specific data */

        switch (event->event_kind) {

        default:

            error_report("Unknown ID %d of replay event", read_event_kind);

            exit(1);

            break;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,25 +1,25 @@
 void HELPER(window_check)(CPUXtensaState *env, uint32_t pc, uint32_t w)

+{
+
+    uint32_t windowbase = windowbase_bound(env->sregs[WINDOW_BASE], env);

     uint32_t windowstart = env->sregs[WINDOW_START];
+
+    uint32_t m, n;

+
+    if ((env->sregs[PS] & (PS_WOE | PS_EXCM)) ^ PS_WOE) {

         return;
+
     }

+
     for (n = 1; ; ++n) {
+
         if (n > w) {

             return;

void HELPER(window_check)(CPUXtensaState *env, uint32_t pc, uint32_t w)

{

    uint32_t windowbase = windowbase_bound(env->sregs[WINDOW_BASE], env);

    uint32_t windowstart = env->sregs[WINDOW_START];

    uint32_t m, n;

    if ((env->sregs[PS] & (PS_WOE | PS_EXCM)) ^ PS_WOE) {

        return;

    }

    for (n = 1; ; ++n) {

        if (n > w) {

            return;

        }

        if (windowstart & windowstart_bit(windowbase + n, env)) {

            break;

        }

    }

    m = windowbase_bound(windowbase + n, env);

    rotate_window(env, n);

    env->sregs[PS] = (env->sregs[PS] & ~PS_OWB) |

        (windowbase << PS_OWB_SHIFT) | PS_EXCM;

    env->sregs[EPC1] = env->pc = pc;

    if (windowstart & windowstart_bit(m + 1, env)) {

        HELPER(exception)(env, EXC_WINDOW_OVERFLOW4);

    } else if (windowstart & windowstart_bit(m + 2, env)) {

        HELPER(exception)(env, EXC_WINDOW_OVERFLOW8);

    } else {

        HELPER(exception)(env, EXC_WINDOW_OVERFLOW12);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int spapr_vty_init(VIOsPAPRDevice *sdev)
 {
     VIOsPAPRVTYDevice *dev = (VIOsPAPRVTYDevice *)sdev;
     qemu_chr_add_handlers(dev->chardev, vty_can_receive,

static int spapr_vty_init(VIOsPAPRDevice *sdev)
{
    VIOsPAPRVTYDevice *dev = (VIOsPAPRVTYDevice *)sdev;
    qemu_chr_add_handlers(dev->chardev, vty_can_receive,
                          vty_receive, NULL, dev);
    return 0;


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static inline uint64_t ram_chunk_index(const uint8_t *start,
+
+                                       const uint8_t *host)

 {

static inline uint64_t ram_chunk_index(const uint8_t *start,

                                       const uint8_t *host)

{

    return ((uintptr_t) host - (uintptr_t) start) >> RDMA_REG_CHUNK_SHIFT;

}


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

 {

+    if (async != QXL_SYNC) {
+
+#if SPICE_INTERFACE_QXL_MINOR >= 1
+
+        spice_qxl_create_primary_surface_async(&ssd->qxl, id, surface, 0);

 #else

void qemu_spice_create_primary_surface(SimpleSpiceDisplay *ssd, uint32_t id,

                                       QXLDevSurfaceCreate *surface,

                                       qxl_async_io async)

{

    if (async != QXL_SYNC) {

#if SPICE_INTERFACE_QXL_MINOR >= 1

        spice_qxl_create_primary_surface_async(&ssd->qxl, id, surface, 0);

#else

        abort();

#endif

    } else {

        ssd->worker->create_primary_surface(ssd->worker, id, surface);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 e1000e_set_pbaclr(E1000ECore *core, int index, uint32_t val)

 {
+
     int i;

e1000e_set_pbaclr(E1000ECore *core, int index, uint32_t val)

{

    int i;

    core->mac[PBACLR] = val & E1000_PBACLR_VALID_MASK;

    if (msix_enabled(core->owner)) {

        return;

    }

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

        if (core->mac[PBACLR] & BIT(i)) {

            msix_clr_pending(core->owner, i);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void dec_scall(DisasContext *dc)

 {
+
+    TCGv t0;
+
+    int l1;
+

     if (dc->imm5 == 7) {

static void dec_scall(DisasContext *dc)

{

    TCGv t0;

    int l1;

    if (dc->imm5 == 7) {

        LOG_DIS("scall\n");

    } else if (dc->imm5 == 2) {

        LOG_DIS("break\n");

    } else {

        cpu_abort(dc->env, "invalid opcode\n");

    }

    t0 = tcg_temp_new();

    l1 = gen_new_label();

    if (dc->imm5 == 7) {

        tcg_gen_movi_tl(cpu_pc, dc->pc);

        t_gen_raise_exception(dc, EXCP_SYSTEMCALL);

    } else {

        tcg_gen_movi_tl(cpu_pc, dc->pc);

        t_gen_raise_exception(dc, EXCP_BREAKPOINT);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int write_number(void *obj, const AVOption *o, void *dst, double num, int den, int64_t intnum)

+{

     if (o->max*den < num*intnum || o->min*den > num*intnum) {

static int write_number(void *obj, const AVOption *o, void *dst, double num, int den, int64_t intnum)

{

    if (o->max*den < num*intnum || o->min*den > num*intnum) {

        av_log(obj, AV_LOG_ERROR, "Value %f for parameter '%s' out of range\n",

               num*intnum/den, o->name);

        return AVERROR(ERANGE);

    }

    switch (o->type) {

    case AV_OPT_TYPE_FLAGS:

    case AV_OPT_TYPE_INT:   *(int       *)dst= llrint(num/den)*intnum; break;

    case AV_OPT_TYPE_INT64: *(int64_t   *)dst= llrint(num/den)*intnum; break;

    case AV_OPT_TYPE_FLOAT: *(float     *)dst= num*intnum/den;         break;

    case AV_OPT_TYPE_DOUBLE:*(double    *)dst= num*intnum/den;         break;

    case AV_OPT_TYPE_RATIONAL:

        if ((int)num == num) *(AVRational*)dst= (AVRational){num*intnum, den};

        else                 *(AVRational*)dst= av_d2q(num*intnum/den, 1<<24);

        break;

    default:

        return AVERROR(EINVAL);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void ff_mpeg_unref_picture(MpegEncContext *s, Picture *pic)

+{

+    int off = offsetof(Picture, mb_mean) + sizeof(pic->mb_mean);

void ff_mpeg_unref_picture(MpegEncContext *s, Picture *pic)

{

    int off = offsetof(Picture, mb_mean) + sizeof(pic->mb_mean);

    pic->tf.f = &pic->f;

    /* WM Image / Screen codecs allocate internal buffers with different

     * dimensions / colorspaces; ignore user-defined callbacks for these. */

    if (s->codec_id != AV_CODEC_ID_WMV3IMAGE &&

        s->codec_id != AV_CODEC_ID_VC1IMAGE  &&

        s->codec_id != AV_CODEC_ID_MSS2)

        ff_thread_release_buffer(s->avctx, &pic->tf);

    else

        av_frame_unref(&pic->f);

    av_buffer_unref(&pic->hwaccel_priv_buf);

    if (pic->needs_realloc)

        ff_free_picture_tables(pic);

    memset((uint8_t*)pic + off, 0, sizeof(*pic) - off);

}


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

     T0 = T0 >> T1;

void OPPROTO op_srl_T0_T1 (void)

{

    T0 = T0 >> T1;

    RETURN();

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     const char *firstname;

     char value[1024], *id = NULL;
+
     const char *p;

     QemuOpts *opts;

QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params,

                          int permit_abbrev)

{

    const char *firstname;

    char value[1024], *id = NULL;

    const char *p;

    QemuOpts *opts;

    assert(!permit_abbrev || list->implied_opt_name);

    firstname = permit_abbrev ? list->implied_opt_name : NULL;

    if (strncmp(params, "id=", 3) == 0) {

        get_opt_value(value, sizeof(value), params+3);

        id = qemu_strdup(value);

    } else if ((p = strstr(params, ",id=")) != NULL) {

        get_opt_value(value, sizeof(value), p+4);

        id = qemu_strdup(value);

    }

    opts = qemu_opts_create(list, id, 1);

    if (opts == NULL)

        return NULL;

    if (qemu_opts_do_parse(opts, params, firstname) != 0) {

        qemu_opts_del(opts);

        return NULL;

    }

    return opts;

}


--- a/source.c
+++ b/source.c
@@ -1,17 +1,17 @@
 static void inc_refcounts(BlockDriverState *bs,

+                          BdrvCheckResult *res,
+
                           uint16_t *refcount_table,

                           int refcount_table_size,

                           int64_t offset, int64_t size)

+{
+
+    BDRVQcowState *s = bs->opaque;
+
     int64_t start, last, cluster_offset;

     int k;

static void inc_refcounts(BlockDriverState *bs,

                          BdrvCheckResult *res,

                          uint16_t *refcount_table,

                          int refcount_table_size,

                          int64_t offset, int64_t size)

{

    BDRVQcowState *s = bs->opaque;

    int64_t start, last, cluster_offset;

    int k;

    if (size <= 0)

        return;

    start = start_of_cluster(s, offset);

    last = start_of_cluster(s, offset + size - 1);

    for(cluster_offset = start; cluster_offset <= last;

        cluster_offset += s->cluster_size) {

        k = cluster_offset >> s->cluster_bits;

        if (k < 0) {

            fprintf(stderr, "ERROR: invalid cluster offset=0x%" PRIx64 "\n",

                cluster_offset);

            res->corruptions++;

        } else if (k >= refcount_table_size) {

            fprintf(stderr, "Warning: cluster offset=0x%" PRIx64 " is after "

                "the end of the image file, can't properly check refcounts.\n",

                cluster_offset);

            res->check_errors++;

        } else {

            if (++refcount_table[k] == 0) {

                fprintf(stderr, "ERROR: overflow cluster offset=0x%" PRIx64

                    "\n", cluster_offset);

                res->corruptions++;

            }

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
+static int scsi_write_data(SCSIDevice *d, uint32_t tag)
+
+{

+    SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, d);
+
+    SCSIGenericReq *r;
+
+    int ret;
+

     DPRINTF("scsi_write_data 0x%x\n", tag);
@@ -17,7 +17,7 @@
     if (!r) {

         BADF("Bad write tag 0x%x\n", tag);
+
         /* ??? This is the wrong error.  */

         scsi_command_complete(r, -EINVAL);

static int scsi_write_data(SCSIDevice *d, uint32_t tag)

{

    SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, d);

    SCSIGenericReq *r;

    int ret;

    DPRINTF("scsi_write_data 0x%x\n", tag);

    r = scsi_find_request(s, tag);

    if (!r) {

        BADF("Bad write tag 0x%x\n", tag);

        /* ??? This is the wrong error.  */

        scsi_command_complete(r, -EINVAL);

        return 0;

    }

    if (r->len == 0) {

        r->len = r->buflen;

        scsi_req_data(&r->req, r->len);

        return 0;

    }

    ret = execute_command(s->bs, r, SG_DXFER_TO_DEV, scsi_write_complete);

    if (ret == -1) {

        scsi_command_complete(r, -EINVAL);

        return 1;

    }

    return 0;

}


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

     const char *arg3 = qdict_get_try_str(qdict, "arg3");

+

     if (arg2) {

void hmp_hostfwd_add(Monitor *mon, const QDict *qdict)

{

    const char *redir_str;

    SlirpState *s;

    const char *arg1 = qdict_get_str(qdict, "arg1");

    const char *arg2 = qdict_get_try_str(qdict, "arg2");

    const char *arg3 = qdict_get_try_str(qdict, "arg3");

    if (arg2) {

        s = slirp_lookup(mon, arg1, arg2);

        redir_str = arg3;

    } else {

        s = slirp_lookup(mon, NULL, NULL);

        redir_str = arg1;

    }

    if (s) {

        slirp_hostfwd(s, redir_str, 0);

    }

}


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

                        str);

+        } else {
+
+            error_setg(errp, "Drive '%s' is already in use by another device",
+
+                       str);

         }

static void parse_drive(DeviceState *dev, const char *str, void **ptr,

                        const char *propname, Error **errp)

{

    BlockBackend *blk;

    blk = blk_by_name(str);

    if (!blk) {

        error_setg(errp, "Property '%s.%s' can't find value '%s'",

                   object_get_typename(OBJECT(dev)), propname, str);

        return;

    }

    if (blk_attach_dev(blk, dev) < 0) {

        DriveInfo *dinfo = blk_legacy_dinfo(blk);

        if (dinfo->type != IF_NONE) {

            error_setg(errp, "Drive '%s' is already in use because "

                       "it has been automatically connected to another "

                       "device (did you need 'if=none' in the drive options?)",

                       str);

        } else {

            error_setg(errp, "Drive '%s' is already in use by another device",

                       str);

        }

        return;

    }

    *ptr = blk;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static inline void load_seg_vm(int seg, int selector)

+{
+
     selector &= 0xffff;

     cpu_x86_load_seg_cache(env, seg, selector,

static inline void load_seg_vm(int seg, int selector)

{

    selector &= 0xffff;

    cpu_x86_load_seg_cache(env, seg, selector,

                           (uint8_t *)(selector << 4), 0xffff, 0);

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     /* Let the compiler perform the right-shift as part of the arithmetic.  */

     ptrdiff_t disp = target - (pc + 1);
+
+    assert(disp == (int16_t)disp);
+
     return disp & 0xffff;

 }

static inline uint32_t reloc_pc16_val(tcg_insn_unit *pc, tcg_insn_unit *target)

{

    /* Let the compiler perform the right-shift as part of the arithmetic.  */

    ptrdiff_t disp = target - (pc + 1);

    assert(disp == (int16_t)disp);

    return disp & 0xffff;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void qdm2_calculate_fft (QDM2Context *q, int channel, int sub_packet)

 {
+
+    const float gain = (q->channels == 1 && q->nb_channels == 2) ? 0.5f : 1.0f;
+
+    int i;
+
     q->fft.complex[channel][0].re *= 2.0f;

     q->fft.complex[channel][0].im = 0.0f;

static void qdm2_calculate_fft (QDM2Context *q, int channel, int sub_packet)

{

    const float gain = (q->channels == 1 && q->nb_channels == 2) ? 0.5f : 1.0f;

    int i;

    q->fft.complex[channel][0].re *= 2.0f;

    q->fft.complex[channel][0].im = 0.0f;

    q->rdft_ctx.rdft_calc(&q->rdft_ctx, (FFTSample *)q->fft.complex[channel]);

    /* add samples to output buffer */

    for (i = 0; i < ((q->fft_frame_size + 15) & ~15); i++)

        q->output_buffer[q->channels * i + channel] += ((float *) q->fft.complex[channel])[i] * gain;

}


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

     /* close fd so that we can reopen it as needed */
+
+    close(s->fd);
+
+    s->fd = -1;
+
     s->fd_media_changed = 1;

static int floppy_open(BlockDriverState *bs, const char *filename, int flags)

{

    BDRVRawState *s = bs->opaque;

    int ret;

    posix_aio_init();

    s->type = FTYPE_FD;

    /* open will not fail even if no floppy is inserted, so add O_NONBLOCK */

    ret = raw_open_common(bs, filename, flags, O_NONBLOCK);

    if (ret)

        return ret;

    /* close fd so that we can reopen it as needed */

    close(s->fd);

    s->fd = -1;

    s->fd_media_changed = 1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 const char *qdict_get_str(const QDict *qdict, const char *key)
+
+{

     QObject *obj = qdict_get_obj(qdict, key, QTYPE_QSTRING);

const char *qdict_get_str(const QDict *qdict, const char *key)

{

    QObject *obj = qdict_get_obj(qdict, key, QTYPE_QSTRING);

    return qstring_get_str(qobject_to_qstring(obj));

}


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

     CPUState *cs = CPU(obj);

+    MicroBlazeCPU *cpu = MICROBLAZE_CPU(obj);

     CPUMBState *env = &cpu->env;

static void mb_cpu_initfn(Object *obj)

{

    CPUState *cs = CPU(obj);

    MicroBlazeCPU *cpu = MICROBLAZE_CPU(obj);

    CPUMBState *env = &cpu->env;

    static bool tcg_initialized;

    cs->env_ptr = env;

    cpu_exec_init(cs, &error_abort);

    set_float_rounding_mode(float_round_nearest_even, &env->fp_status);

#ifndef CONFIG_USER_ONLY

    /* Inbound IRQ and FIR lines */

    qdev_init_gpio_in(DEVICE(cpu), microblaze_cpu_set_irq, 2);

#endif

    if (tcg_enabled() && !tcg_initialized) {

        tcg_initialized = true;

        mb_tcg_init();

    }

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     trace_vfio_put_group(group->fd);

     close(group->fd);
+
+    g_free(group);
+
+
+
     if (QLIST_EMPTY(&group_list)) {

         qemu_unregister_reset(vfio_pci_reset_handler, NULL);

static void vfio_put_group(VFIOGroup *group)

{

    if (!QLIST_EMPTY(&group->device_list)) {

        return;

    }

    vfio_kvm_device_del_group(group);

    vfio_disconnect_container(group);

    QLIST_REMOVE(group, next);

    trace_vfio_put_group(group->fd);

    close(group->fd);

    g_free(group);

    if (QLIST_EMPTY(&group_list)) {

        qemu_unregister_reset(vfio_pci_reset_handler, NULL);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 int bdrv_all_create_snapshot(QEMUSnapshotInfo *sn,

+                             BlockDriverState *vm_state_bs,

                              uint64_t vm_state_size,

int bdrv_all_create_snapshot(QEMUSnapshotInfo *sn,

                             BlockDriverState *vm_state_bs,

                             uint64_t vm_state_size,

                             BlockDriverState **first_bad_bs)

{

    int err = 0;

    BlockDriverState *bs;

    BdrvNextIterator it;

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

        AioContext *ctx = bdrv_get_aio_context(bs);

        aio_context_acquire(ctx);

        if (bs == vm_state_bs) {

            sn->vm_state_size = vm_state_size;

            err = bdrv_snapshot_create(bs, sn);

        } else if (bdrv_can_snapshot(bs)) {

            sn->vm_state_size = 0;

            err = bdrv_snapshot_create(bs, sn);

        }

        aio_context_release(ctx);

        if (err < 0) {

            goto fail;

        }

    }

fail:

    *first_bad_bs = bs;

    return err;

}