--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int spapr_tce_table_realize(DeviceState *dev)

+{
+
     sPAPRTCETable *tcet = SPAPR_TCE_TABLE(dev);

static int spapr_tce_table_realize(DeviceState *dev)

{

    sPAPRTCETable *tcet = SPAPR_TCE_TABLE(dev);

    if (kvm_enabled()) {

        tcet->table = kvmppc_create_spapr_tce(tcet->liobn,

                                              tcet->nb_table <<

                                              tcet->page_shift,

                                              &tcet->fd,

                                              tcet->vfio_accel);

    }

    if (!tcet->table) {

        size_t table_size = tcet->nb_table * sizeof(uint64_t);

        tcet->table = g_malloc0(table_size);

    }

    trace_spapr_iommu_new_table(tcet->liobn, tcet, tcet->table, tcet->fd);

    memory_region_init_iommu(&tcet->iommu, OBJECT(dev), &spapr_iommu_ops,

                             "iommu-spapr",

                             (uint64_t)tcet->nb_table << tcet->page_shift);

    QLIST_INSERT_HEAD(&spapr_tce_tables, tcet, list);

    vmstate_register(DEVICE(tcet), tcet->liobn, &vmstate_spapr_tce_table,

                     tcet);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void s390_pci_iommu_enable(S390PCIBusDevice *pbdev)
+
+{
+
     uint64_t size = pbdev->pal - pbdev->pba + 1;

void s390_pci_iommu_enable(S390PCIBusDevice *pbdev)

{

    uint64_t size = pbdev->pal - pbdev->pba + 1;

    memory_region_init_iommu(&pbdev->iommu_mr, OBJECT(&pbdev->mr),

                             &s390_iommu_ops, "iommu-s390", size);

    memory_region_add_subregion(&pbdev->mr, pbdev->pba, &pbdev->iommu_mr);

    pbdev->iommu_enabled = true;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int get_video_frame(VideoState *is, AVFrame *frame)

+{

     int got_picture;

static int get_video_frame(VideoState *is, AVFrame *frame)

{

    int got_picture;

    if ((got_picture = decoder_decode_frame(&is->viddec, frame)) < 0)

        return -1;

    if (got_picture) {

        double dpts = NAN;

        if (frame->pts != AV_NOPTS_VALUE)

            dpts = av_q2d(is->video_st->time_base) * frame->pts;

        frame->sample_aspect_ratio = av_guess_sample_aspect_ratio(is->ic, is->video_st, frame);

        if (framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) {

            if (frame->pts != AV_NOPTS_VALUE) {

                double diff = dpts - get_master_clock(is);

                if (!isnan(diff) && fabs(diff) < AV_NOSYNC_THRESHOLD &&

                    diff - is->frame_last_filter_delay < 0 &&

                    is->viddec.pkt_serial == is->vidclk.serial &&

                    is->videoq.nb_packets) {

                    is->frame_drops_early++;

                    av_frame_unref(frame);

                    got_picture = 0;

                }

            }

        }

    }

    return got_picture;

}


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

     if (!fmt) {

+        qerror_abort(qerr, "QDict not specified");
+
+    }
+
+

     qerror_set_data(qerr, fmt, va);

QError *qerror_from_info(const char *file, int linenr, const char *func,

                         const char *fmt, va_list *va)

{

    QError *qerr;

    qerr = qerror_new();

    loc_save(&qerr->loc);

    qerr->linenr = linenr;

    qerr->file = file;

    qerr->func = func;

    if (!fmt) {

        qerror_abort(qerr, "QDict not specified");

    }

    qerror_set_data(qerr, fmt, va);

    qerror_set_desc(qerr, fmt);

    return qerr;

}


--- a/source.c
+++ b/source.c
@@ -29,9 +29,9 @@
         aio_poll(block_job_get_aio_context(job), true);

     }
+
+
+
+    block_job_unref(job);
+
 }

static void block_job_detach_aio_context(void *opaque)

{

    BlockJob *job = opaque;

    /* In case the job terminates during aio_poll()... */

    block_job_ref(job);

    block_job_pause(job);

    if (!job->paused) {

        /* If job is !job->busy this kicks it into the next pause point. */

        block_job_enter(job);

    }

    while (!job->paused && !job->completed) {

        aio_poll(block_job_get_aio_context(job), true);

    }

    block_job_unref(job);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void vvfat_refresh_limits(BlockDriverState *bs, Error **errp)

+{

     bs->request_alignment = BDRV_SECTOR_SIZE; /* No sub-sector I/O supported */

static void vvfat_refresh_limits(BlockDriverState *bs, Error **errp)

{

    bs->request_alignment = BDRV_SECTOR_SIZE; /* No sub-sector I/O supported */

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void OPPROTO op_addq_ESI_T0(void)

 {
+
     ESI = (ESI + T0);

 }

void OPPROTO op_addq_ESI_T0(void)

{

    ESI = (ESI + T0);

}


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

             band->zero_mem[k] = ((band->zero_mem[k] * 255) >> 8) + \

+               d*((band->diff_mem[k]^cur_diff) < 0 ? -128 : 128); \

             band->diff_mem[k] = tmp; \

             s_zero += (tmp * band->zero_mem[k]) >> 15; \

         } while (0)
+
     if (cur_diff) {

         ACCUM(5, band->diff_mem[4], 1);

static inline void s_zero(int cur_diff, struct G722Band *band)

{

    int s_zero = 0;

    #define ACCUM(k, x, d) do { \

            int tmp = x; \

            band->zero_mem[k] = ((band->zero_mem[k] * 255) >> 8) + \

               d*((band->diff_mem[k]^cur_diff) < 0 ? -128 : 128); \

            band->diff_mem[k] = tmp; \

            s_zero += (tmp * band->zero_mem[k]) >> 15; \

        } while (0)

    if (cur_diff) {

        ACCUM(5, band->diff_mem[4], 1);

        ACCUM(4, band->diff_mem[3], 1);

        ACCUM(3, band->diff_mem[2], 1);

        ACCUM(2, band->diff_mem[1], 1);

        ACCUM(1, band->diff_mem[0], 1);

        ACCUM(0, cur_diff << 1, 1);

    } else {

        ACCUM(5, band->diff_mem[4], 0);

        ACCUM(4, band->diff_mem[3], 0);

        ACCUM(3, band->diff_mem[2], 0);

        ACCUM(2, band->diff_mem[1], 0);

        ACCUM(1, band->diff_mem[0], 0);

        ACCUM(0, cur_diff << 1, 0);

    }

    #undef ACCUM

    band->s_zero = s_zero;

}


    vmstate_get_subsection(const VMStateSubsection *sub, char *idstr)

{

    while (sub && sub->needed) {

        if (strcmp(idstr, sub->vmsd->name) == 0) {

            return sub->vmsd;

        }

        sub++;

    }

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 int bdrv_all_delete_snapshot(const char *name, BlockDriverState **first_bad_bs,

+                             Error **err)
+
 {
+
     int ret = 0;

     BlockDriverState *bs;

int bdrv_all_delete_snapshot(const char *name, BlockDriverState **first_bad_bs,

                             Error **err)

{

    int ret = 0;

    BlockDriverState *bs;

    BdrvNextIterator *it = NULL;

    QEMUSnapshotInfo sn1, *snapshot = &sn1;

    while (ret == 0 && (it = bdrv_next(it, &bs))) {

        AioContext *ctx = bdrv_get_aio_context(bs);

        aio_context_acquire(ctx);

        if (bdrv_can_snapshot(bs) &&

                bdrv_snapshot_find(bs, snapshot, name) >= 0) {

            ret = bdrv_snapshot_delete_by_id_or_name(bs, name, err);

        }

        aio_context_release(ctx);

    }

    *first_bad_bs = bs;

    return ret;

}


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

         char *dst = qdev_get_prop_ptr(dev, props);
+
+        memcpy(dst, src, props->info->size);
+
+    }

 }

static void qdev_prop_cpy(DeviceState *dev, Property *props, void *src)

{

    if (props->info->type == PROP_TYPE_BIT) {

        bool *defval = src;

        bit_prop_set(dev, props, *defval);

    } else {

        char *dst = qdev_get_prop_ptr(dev, props);

        memcpy(dst, src, props->info->size);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void sbr_qmf_deint_bfly_c(INTFLOAT *v, const INTFLOAT *src0, const INTFLOAT *src1)

 {
+
+    int i;

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

static void sbr_qmf_deint_bfly_c(INTFLOAT *v, const INTFLOAT *src0, const INTFLOAT *src1)

{

    int i;

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

        v[      i] = AAC_SRA_R((src0[i] - src1[63 - i]), 5);

        v[127 - i] = AAC_SRA_R((src0[i] + src1[63 - i]), 5);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static struct omap_mpu_timer_s *omap_mpu_timer_init(MemoryRegion *system_memory,
+
                 hwaddr base,

                 qemu_irq irq, omap_clk clk)

static struct omap_mpu_timer_s *omap_mpu_timer_init(MemoryRegion *system_memory,

                hwaddr base,

                qemu_irq irq, omap_clk clk)

{

    struct omap_mpu_timer_s *s = (struct omap_mpu_timer_s *)

            g_malloc0(sizeof(struct omap_mpu_timer_s));

    s->irq = irq;

    s->clk = clk;

    s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, omap_timer_tick, s);

    s->tick = qemu_bh_new(omap_timer_fire, s);

    omap_mpu_timer_reset(s);

    omap_timer_clk_setup(s);

    memory_region_init_io(&s->iomem, NULL, &omap_mpu_timer_ops, s,

                          "omap-mpu-timer", 0x100);

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

    return s;

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
     case 270:

         if (move->axis == INPUT_AXIS_X) {
+
+            move->axis = INPUT_AXIS_Y;
+
+            move->value = INPUT_EVENT_ABS_SIZE - 1 - move->value;
+
         } else if (move->axis == INPUT_AXIS_Y) {

             move->axis = INPUT_AXIS_X;

static void qemu_input_transform_abs_rotate(InputEvent *evt)

{

    InputMoveEvent *move = evt->u.abs;

    switch (graphic_rotate) {

    case 90:

        if (move->axis == INPUT_AXIS_X) {

            move->axis = INPUT_AXIS_Y;

        } else if (move->axis == INPUT_AXIS_Y) {

            move->axis = INPUT_AXIS_X;

            move->value = INPUT_EVENT_ABS_SIZE - 1 - move->value;

        }

        break;

    case 180:

        move->value = INPUT_EVENT_ABS_SIZE - 1 - move->value;

        break;

    case 270:

        if (move->axis == INPUT_AXIS_X) {

            move->axis = INPUT_AXIS_Y;

            move->value = INPUT_EVENT_ABS_SIZE - 1 - move->value;

        } else if (move->axis == INPUT_AXIS_Y) {

            move->axis = INPUT_AXIS_X;

        }

        break;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void monitor_readline_cb(void *opaque, const char *input)

+{
+
     pstrcpy(monitor_readline_buf, monitor_readline_buf_size, input);

     monitor_readline_started = 0;

static void monitor_readline_cb(void *opaque, const char *input)

{

    pstrcpy(monitor_readline_buf, monitor_readline_buf_size, input);

    monitor_readline_started = 0;

}


--- a/source.c
+++ b/source.c
@@ -13,7 +13,7 @@
         int end   = fc->list[fc->list[FFMIN(i+1, fc->values - 1)].sort].x;

         int j;
+
         float average = 0;

         begin = (position + begin) / 2;

static void floor_fit(venc_context_t * venc, floor_t * fc, float * coeffs, int * posts, int samples) {

    int range = 255 / fc->multiplier + 1;

    int i;

    for (i = 0; i < fc->values; i++) {

        int position = fc->list[fc->list[i].sort].x;

        int begin = fc->list[fc->list[FFMAX(i-1, 0)].sort].x;

        int end   = fc->list[fc->list[FFMIN(i+1, fc->values - 1)].sort].x;

        int j;

        float average = 0;

        begin = (position + begin) / 2;

        end   = (position + end  ) / 2;

        assert(end <= samples);

        for (j = begin; j < end; j++) average += fabs(coeffs[j]);

        average /= end - begin;

        average /= 32; // MAGIC!

        for (j = 0; j < range; j++) if (floor1_inverse_db_table[j * fc->multiplier] > average) break;

        posts[fc->list[i].sort] = j;

    }

}


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

     return address_space_memory.dispatch->sections[index & ~TARGET_PAGE_MASK].mr;
+
 }

MemoryRegion *iotlb_to_region(hwaddr index)

{

    return address_space_memory.dispatch->sections[index & ~TARGET_PAGE_MASK].mr;

}


static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt)

{

    MP3Context  *mp3 = s->priv_data;

    if (pkt && pkt->data && pkt->size >= 4) {

        MPADecodeHeader c;

        int av_unused base;

        avpriv_mpegaudio_decode_header(&c, AV_RB32(pkt->data));

        if (!mp3->initial_bitrate)

            mp3->initial_bitrate = c.bit_rate;

        if ((c.bit_rate == 0) || (mp3->initial_bitrate != c.bit_rate))

            mp3->has_variable_bitrate = 1;

#ifdef FILTER_VBR_HEADERS

        /* filter out XING and INFO headers. */

        base = 4 + xing_offtbl[c.lsf == 1][c.nb_channels == 1];

        if (base + 4 <= pkt->size) {

            uint32_t v = AV_RB32(pkt->data + base);

            if (MKBETAG('X','i','n','g') == v || MKBETAG('I','n','f','o') == v)

                return 0;

        }

        /* filter out VBRI headers. */

        base = 4 + 32;

        if (base + 4 <= pkt->size && MKBETAG('V','B','R','I') == AV_RB32(pkt->data + base))

            return 0;

#endif

        if (mp3->xing_offset)

            mp3_xing_add_frame(mp3, pkt);

    }

    return ff_raw_write_packet(s, pkt);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 target_ulong do_load_msr (CPUPPCState *env)
+
 {

     return

target_ulong do_load_msr (CPUPPCState *env)

{

    return

#if defined (TARGET_PPC64)

        ((target_ulong)msr_sf   << MSR_SF)   |

        ((target_ulong)msr_isf  << MSR_ISF)  |

        ((target_ulong)msr_hv   << MSR_HV)   |

#endif

        ((target_ulong)msr_ucle << MSR_UCLE) |

        ((target_ulong)msr_vr   << MSR_VR)   | /* VR / SPE */

        ((target_ulong)msr_ap   << MSR_AP)   |

        ((target_ulong)msr_sa   << MSR_SA)   |

        ((target_ulong)msr_key  << MSR_KEY)  |

        ((target_ulong)msr_pow  << MSR_POW)  | /* POW / WE */

        ((target_ulong)msr_tgpr << MSR_TGPR) | /* TGPR / CE */

        ((target_ulong)msr_ile  << MSR_ILE)  |

        ((target_ulong)msr_ee   << MSR_EE)   |

        ((target_ulong)msr_pr   << MSR_PR)   |

        ((target_ulong)msr_fp   << MSR_FP)   |

        ((target_ulong)msr_me   << MSR_ME)   |

        ((target_ulong)msr_fe0  << MSR_FE0)  |

        ((target_ulong)msr_se   << MSR_SE)   | /* SE / DWE / UBLE */

        ((target_ulong)msr_be   << MSR_BE)   | /* BE / DE */

        ((target_ulong)msr_fe1  << MSR_FE1)  |

        ((target_ulong)msr_al   << MSR_AL)   |

        ((target_ulong)msr_ip   << MSR_IP)   |

        ((target_ulong)msr_ir   << MSR_IR)   | /* IR / IS */

        ((target_ulong)msr_dr   << MSR_DR)   | /* DR / DS */

        ((target_ulong)msr_pe   << MSR_PE)   | /* PE / EP */

        ((target_ulong)msr_px   << MSR_PX)   | /* PX / PMM */

        ((target_ulong)msr_ri   << MSR_RI)   |

        ((target_ulong)msr_le   << MSR_LE);

}


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

     bs->boot_sector_enabled = 1;
+
+    if (size > 512)
+
         size = 512;

     memcpy(bs->boot_sector_data, data, size);

void bdrv_set_boot_sector(BlockDriverState *bs, const uint8_t *data, int size)

{

    bs->boot_sector_enabled = 1;

    if (size > 512)

        size = 512;

    memcpy(bs->boot_sector_data, data, size);

    memset(bs->boot_sector_data + size, 0, 512 - size);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void common_unbind(struct common *c)

 {
+
     xen_be_unbind_evtchn(&c->xendev);

     if (c->page) {

static void common_unbind(struct common *c)

{

    xen_be_unbind_evtchn(&c->xendev);

    if (c->page) {

	munmap(c->page, XC_PAGE_SIZE);

	c->page = NULL;

    }

}


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

+
+    return ret < 0 ? ret : ret * BDRV_SECTOR_SIZE;
+
 }

int64_t bdrv_getlength(BlockDriverState *bs)

{

    int64_t ret = bdrv_nb_sectors(bs);

    return ret < 0 ? ret : ret * BDRV_SECTOR_SIZE;

}


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

+    return omap_l4_io_writew_fn[i](omap_l4_io_opaque[i], addr, value);
+
+}

static void omap_l4_io_writew(void *opaque, target_phys_addr_t addr,

                uint32_t value)

{

    unsigned int i = (addr - OMAP2_L4_BASE) >> TARGET_PAGE_BITS;

    return omap_l4_io_writew_fn[i](omap_l4_io_opaque[i], addr, value);

}


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

     int i;

+    for (i = 0; hwaccels[i].name; i++)
+
+        if (hwaccels[i].pix_fmt == pix_fmt)

             return &hwaccels[i];

static const HWAccel *get_hwaccel(enum AVPixelFormat pix_fmt)

{

    int i;

    for (i = 0; hwaccels[i].name; i++)

        if (hwaccels[i].pix_fmt == pix_fmt)

            return &hwaccels[i];

    return NULL;

}


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

                         const uint8_t *buf, int len)

+{

+    int len1;

int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,

                        const uint8_t *buf, int len)

{

    int len1;

    len1 = len;

    ts->pkt = pkt;

    ts->stop_parse = 0;

    for(;;) {

        if (ts->stop_parse>0)

            break;

        if (len < TS_PACKET_SIZE)

            return -1;

        if (buf[0] != 0x47) {

            buf++;

            len--;

        } else {

            handle_packet(ts, buf);

            buf += TS_PACKET_SIZE;

            len -= TS_PACKET_SIZE;

        }

    }

    return len1 - len;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void vnc_display_close(DisplayState *ds)
+
 {

     VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;

static void vnc_display_close(DisplayState *ds)

{

    VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;

    if (!vs)

        return;

    if (vs->display) {

        g_free(vs->display);

        vs->display = NULL;

    }

    if (vs->lsock != -1) {

        qemu_set_fd_handler2(vs->lsock, NULL, NULL, NULL, NULL);

        close(vs->lsock);

        vs->lsock = -1;

    }

#ifdef CONFIG_VNC_WS

    g_free(vs->ws_display);

    vs->ws_display = NULL;

    if (vs->lwebsock != -1) {

        qemu_set_fd_handler2(vs->lwebsock, NULL, NULL, NULL, NULL);

        close(vs->lwebsock);

        vs->lwebsock = -1;

    }

#endif /* CONFIG_VNC_WS */

    vs->auth = VNC_AUTH_INVALID;

#ifdef CONFIG_VNC_TLS

    vs->subauth = VNC_AUTH_INVALID;

    vs->tls.x509verify = 0;

#endif

}


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

     for (i = 0; i < s->nb_chapters; i++) {
+
+        AVChapter *ch = s->chapters[i];
+
+
+
         if (!av_dict_get(ch->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX))

             continue;

static int mkv_write_tags(AVFormatContext *s)

{

    ebml_master tags = {0};

    int i, ret;

    ff_metadata_conv_ctx(s, ff_mkv_metadata_conv, NULL);

    if (av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX)) {

        ret = mkv_write_tag(s, s->metadata, 0, 0, &tags);

        if (ret < 0) return ret;

    }

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

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

        if (!av_dict_get(st->metadata, "", 0, AV_DICT_IGNORE_SUFFIX))

            continue;

        ret = mkv_write_tag(s, st->metadata, MATROSKA_ID_TAGTARGETS_TRACKUID, i + 1, &tags);

        if (ret < 0) return ret;

    }

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

        AVChapter *ch = s->chapters[i];

        if (!av_dict_get(ch->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX))

            continue;

        ret = mkv_write_tag(s, ch->metadata, MATROSKA_ID_TAGTARGETS_CHAPTERUID, ch->id, &tags);

        if (ret < 0) return ret;

    }

    if (tags.pos)

        end_ebml_master(s->pb, tags);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void pci_apb_iowritel (void *opaque, target_phys_addr_t addr,

+                                uint32_t val)
+
 {

     cpu_outl(addr & IOPORTS_MASK, bswap32(val));

static void pci_apb_iowritel (void *opaque, target_phys_addr_t addr,

                                uint32_t val)

{

    cpu_outl(addr & IOPORTS_MASK, bswap32(val));

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag,
+
+                                     uint32_t lun, void *hba_private)
+
+{
+
     SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, d);

     SCSIRequest *req;

static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag,

                                     uint32_t lun, void *hba_private)

{

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

    SCSIRequest *req;

    SCSIDiskReq *r;

    req = scsi_req_alloc(&scsi_disk_reqops, &s->qdev, tag, lun, hba_private);

    r = DO_UPCAST(SCSIDiskReq, req, req);

    r->iov.iov_base = qemu_blockalign(s->bs, SCSI_DMA_BUF_SIZE);

    return req;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static int libquvi_close(AVFormatContext *s)
+
+{
+
     LibQuviContext *qc = s->priv_data;

     if (qc->fmtctx)

static int libquvi_close(AVFormatContext *s)

{

    LibQuviContext *qc = s->priv_data;

    if (qc->fmtctx)

        avformat_close_input(&qc->fmtctx);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static uint64_t pmsav5_insn_ap_read(CPUARMState *env, const ARMCPRegInfo *ri)
+
 {

     return simple_mpu_ap_bits(env->cp15.c5_insn);

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

{

    return simple_mpu_ap_bits(env->cp15.c5_insn);

}


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

      * not, then the user is trying to mess with us.

+     */

     frame_addr = env->regs[13];

static long do_rt_sigreturn_v2(CPUARMState *env)

{

    abi_ulong frame_addr;

    struct rt_sigframe_v2 *frame = NULL;

    /*

     * Since we stacked the signal on a 64-bit boundary,

     * then 'sp' should be word aligned here.  If it's

     * not, then the user is trying to mess with us.

     */

    frame_addr = env->regs[13];

    trace_user_do_rt_sigreturn(env, frame_addr);

    if (frame_addr & 7) {

        goto badframe;

    }

    if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) {

        goto badframe;

    }

    if (do_sigframe_return_v2(env, frame_addr, &frame->uc)) {

        goto badframe;

    }

    unlock_user_struct(frame, frame_addr, 0);

    return -TARGET_QEMU_ESIGRETURN;

badframe:

    unlock_user_struct(frame, frame_addr, 0);

    force_sig(TARGET_SIGSEGV /* , current */);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static uint16_t qpci_pc_config_readw(QPCIBus *bus, int devfn, uint8_t offset)
+
 {

     outl(0xcf8, (1 << 31) | (devfn << 8) | offset);

static uint16_t qpci_pc_config_readw(QPCIBus *bus, int devfn, uint8_t offset)

{

    outl(0xcf8, (1 << 31) | (devfn << 8) | offset);

    return inw(0xcfc);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void qnull_destroy_obj(QObject *obj)
+
 {

     assert(0);

static void qnull_destroy_obj(QObject *obj)

{

    assert(0);

}


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

                        uint32_t io_int_word)

+{
+
+    if (kvm_enabled()) {
+
+        kvm_s390_io_interrupt(cpu, subchannel_id, subchannel_nr, io_int_parm,

                               io_int_word);

void s390_io_interrupt(S390CPU *cpu, uint16_t subchannel_id,

                       uint16_t subchannel_nr, uint32_t io_int_parm,

                       uint32_t io_int_word)

{

    if (kvm_enabled()) {

        kvm_s390_io_interrupt(cpu, subchannel_id, subchannel_nr, io_int_parm,

                              io_int_word);

    } else {

        cpu_inject_io(cpu, subchannel_id, subchannel_nr, io_int_parm,

                      io_int_word);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+uint8_t qpci_io_readb(QPCIDevice *dev, void *data)
+
+{
+
     uintptr_t addr = (uintptr_t)data;

+

     if (addr < QPCI_PIO_LIMIT) {

uint8_t qpci_io_readb(QPCIDevice *dev, void *data)

{

    uintptr_t addr = (uintptr_t)data;

    if (addr < QPCI_PIO_LIMIT) {

        return dev->bus->pio_readb(dev->bus, addr);

    } else {

        uint8_t val;

        dev->bus->memread(dev->bus, addr, &val, sizeof(val));

        return val;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static const AVClass *ff_avio_child_class_next(const AVClass *prev)
+
 {

     return prev ? NULL : &ffurl_context_class;

static const AVClass *ff_avio_child_class_next(const AVClass *prev)

{

    return prev ? NULL : &ffurl_context_class;

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
     s = &d->ne2000;

     s->irq = d->dev.irq[0];
+
+
+
+    qemu_macaddr_default_if_unset(&s->c.macaddr);
+
     ne2000_reset(s);

static int pci_ne2000_init(PCIDevice *pci_dev)

{

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

    NE2000State *s;

    uint8_t *pci_conf;

    pci_conf = d->dev.config;

    pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_REALTEK);

    pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_REALTEK_8029);

    pci_config_set_class(pci_conf, PCI_CLASS_NETWORK_ETHERNET);

    /* TODO: RST# value should be 0. PCI spec 6.2.4 */

    pci_conf[PCI_INTERRUPT_PIN] = 1; // interrupt pin 0

    pci_register_bar(&d->dev, 0, 0x100,

                           PCI_BASE_ADDRESS_SPACE_IO, ne2000_map);

    s = &d->ne2000;

    s->irq = d->dev.irq[0];

    qemu_macaddr_default_if_unset(&s->c.macaddr);

    ne2000_reset(s);

    s->nic = qemu_new_nic(&net_ne2000_info, &s->c,

                          pci_dev->qdev.info->name, pci_dev->qdev.id, s);

    qemu_format_nic_info_str(&s->nic->nc, s->c.macaddr.a);

    if (!pci_dev->qdev.hotplugged) {

        static int loaded = 0;

        if (!loaded) {

            rom_add_option("pxe-ne2k_pci.rom", -1);

            loaded = 1;

        }

    }

    add_boot_device_path(s->c.bootindex, &pci_dev->qdev, "/ethernet-phy@0");

    return 0;

}


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

     if (table == NULL) {
+
+        /* Use g_direct_hash/equal for direct pointer comparisons on func.  */
+
+        table = g_hash_table_new(NULL, NULL);
+
         s->helpers = table;

     }

void tcg_register_helper(void *func, const char *name)

{

    TCGContext *s = &tcg_ctx;

    GHashTable *table = s->helpers;

    if (table == NULL) {

        /* Use g_direct_hash/equal for direct pointer comparisons on func.  */

        table = g_hash_table_new(NULL, NULL);

        s->helpers = table;

    }

    g_hash_table_insert(table, (gpointer)func, (gpointer)name);

}


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

     n  = 1 << mdct->nbits;
+
     n2 = n >> 1;

     n4 = n >> 2;

+
     /* shift to simplify computations */

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

static void mdct512(AC3MDCTContext *mdct, int32_t *out, int16_t *in)

{

    int i, re, im, n, n2, n4;

    int16_t *rot = mdct->rot_tmp;

    IComplex *x  = mdct->cplx_tmp;

    n  = 1 << mdct->nbits;

    n2 = n >> 1;

    n4 = n >> 2;

    /* shift to simplify computations */

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

        rot[i] = -in[i + 3*n4];

    memcpy(&rot[n4], &in[0], 3*n4*sizeof(*in));

    /* pre rotation */

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

        re =  ((int)rot[   2*i] - (int)rot[ n-1-2*i]) >> 1;

        im = -((int)rot[n2+2*i] - (int)rot[n2-1-2*i]) >> 1;

        CMUL(x[i].re, x[i].im, re, im, -mdct->xcos1[i], mdct->xsin1[i]);

    }

    fft(mdct, x, mdct->nbits - 2);

    /* post rotation */

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

        re = x[i].re;

        im = x[i].im;

        CMUL(out[n2-1-2*i], out[2*i], re, im, mdct->xsin1[i], mdct->xcos1[i]);

    }

}


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

     struct timeval t2;

+
+
+    gettimeofday(&t2, NULL);
+
+

static void aio_write_done(void *opaque, int ret)

{

    struct aio_ctx *ctx = opaque;

    struct timeval t2;

    gettimeofday(&t2, NULL);

    if (ret < 0) {

        printf("aio_write failed: %s\n", strerror(-ret));

        goto out;

    }

    if (ctx->qflag) {

        goto out;

    }

    /* Finally, report back -- -C gives a parsable format */

    t2 = tsub(t2, ctx->t1);

    print_report("wrote", &t2, ctx->offset, ctx->qiov.size,

                 ctx->qiov.size, 1, ctx->Cflag);

out:

    qemu_io_free(ctx->buf);

    free(ctx);

}


static uint64_t mv88w8618_flashcfg_read(void *opaque,

                                        target_phys_addr_t offset,

                                        unsigned size)

{

    mv88w8618_flashcfg_state *s = opaque;

    switch (offset) {

    case MP_FLASHCFG_CFGR0:

        return s->cfgr0;

    default:

        return 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -49,11 +49,11 @@
     av_des_init(&av_des, n_val, 192, 1);

     while (datalen-- > 0) {
+
+        av_des_crypt(&av_des, oc->r_val, &enc_header[pos], 2, NULL, 1);
+
+        kset(s, oc->r_val, NULL, 16);
+
         if (!rprobe(s, enc_header, oc->r_val))

             return 0;

static int nprobe(AVFormatContext *s, uint8_t *enc_header, int size, const uint8_t *n_val)

{

    OMAContext *oc = s->priv_data;

    uint32_t pos, taglen, datalen;

    struct AVDES av_des;

    if (!enc_header || !n_val)

        return -1;

    pos = OMA_ENC_HEADER_SIZE + oc->k_size;

    if (!memcmp(&enc_header[pos], "EKB ", 4))

        pos += 32;

    if (AV_RB32(&enc_header[pos]) != oc->rid)

        av_log(s, AV_LOG_DEBUG, "Mismatching RID\n");

    taglen = AV_RB32(&enc_header[pos+32]);

    datalen = AV_RB32(&enc_header[pos+36]) >> 4;

    if(taglen + (((uint64_t)datalen)<<4) + 44 > size)

        return -1;

    pos += 44 + taglen;

    av_des_init(&av_des, n_val, 192, 1);

    while (datalen-- > 0) {

        av_des_crypt(&av_des, oc->r_val, &enc_header[pos], 2, NULL, 1);

        kset(s, oc->r_val, NULL, 16);

        if (!rprobe(s, enc_header, oc->r_val))

            return 0;

        pos += 16;

    }

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void tcg_target_init(TCGContext *s)

+{

     tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffffffff);

+    tcg_regset_set32(tcg_target_call_clobber_regs, 0,

                      (1 << TCG_REG_R0) |

static void tcg_target_init(TCGContext *s)

{

    tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffffffff);

    tcg_regset_set32(tcg_target_call_clobber_regs, 0,

                     (1 << TCG_REG_R0) |

#ifdef _CALL_DARWIN

                     (1 << TCG_REG_R2) |

#endif

                     (1 << TCG_REG_R3) |

                     (1 << TCG_REG_R4) |

                     (1 << TCG_REG_R5) |

                     (1 << TCG_REG_R6) |

                     (1 << TCG_REG_R7) |

                     (1 << TCG_REG_R8) |

                     (1 << TCG_REG_R9) |

                     (1 << TCG_REG_R10) |

                     (1 << TCG_REG_R11) |

                     (1 << TCG_REG_R12)

        );

    tcg_regset_clear(s->reserved_regs);

    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R0);

    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R1);

#ifndef _CALL_DARWIN

    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R2);

#endif

#ifdef _CALL_SYSV

    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R13);

#endif

    tcg_add_target_add_op_defs(ppc_op_defs);

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     const char *key = "key";

     const char *str = "string";
+
+
+
+    qdict_put(tests_dict, key, qstring_from_str(str));
+

     p = qdict_get_str(tests_dict, key);

START_TEST(qdict_get_str_test)

{

    const char *p;

    const char *key = "key";

    const char *str = "string";

    qdict_put(tests_dict, key, qstring_from_str(str));

    p = qdict_get_str(tests_dict, key);

    fail_unless(p != NULL);

    fail_unless(strcmp(p, str) == 0);

}


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

     switch (offset) {
+
+    case 0: /* Control register.  */
+
+        s->scu_control = value & 1;
+
         break;

     case 0x0c: /* Invalidate all.  */

static void mpcore_scu_write(void *opaque, target_phys_addr_t offset,

                             uint64_t value, unsigned size)

{

    mpcore_priv_state *s = (mpcore_priv_state *)opaque;

    /* SCU */

    switch (offset) {

    case 0: /* Control register.  */

        s->scu_control = value & 1;

        break;

    case 0x0c: /* Invalidate all.  */

        /* This is a no-op as cache is not emulated.  */

        break;

    default:

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

    }

}


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

+{
+
     QEMUFileBuffered *s = opaque;

static int64_t buffered_get_rate_limit(void *opaque)

{

    QEMUFileBuffered *s = opaque;

    return s->xfer_limit;

}


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

 {

+    static const LxBoardDesc ml605_board = {
+
+        .flash_base = 0xf8000000,
+
         .flash_size = 0x01000000,

         .flash_sector_size = 0x20000,

static void xtensa_ml605_init(MachineState *machine)

{

    static const LxBoardDesc ml605_board = {

        .flash_base = 0xf8000000,

        .flash_size = 0x01000000,

        .flash_sector_size = 0x20000,

        .sram_size = 0x2000000,

    };

    lx_init(&ml605_board, machine);

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
     if( vo_len > 0 ) {

         /* We need to store the header, so extract it */
+
+        if( avctx->extradata == NULL ) {
+
+            avctx->extradata = av_malloc(vo_len);
+
             memcpy(avctx->extradata, pkt->data, vo_len);

             avctx->extradata_size = vo_len;

static int xvid_strip_vol_header(AVCodecContext *avctx,

                  AVPacket *pkt,

                  unsigned int header_len,

                  unsigned int frame_len) {

    int vo_len = 0, i;

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

        if( pkt->data[i] == 0x00 &&

            pkt->data[i+1] == 0x00 &&

            pkt->data[i+2] == 0x01 &&

            pkt->data[i+3] == 0xB6 ) {

            vo_len = i;

            break;

        }

    }

    if( vo_len > 0 ) {

        /* We need to store the header, so extract it */

        if( avctx->extradata == NULL ) {

            avctx->extradata = av_malloc(vo_len);

            memcpy(avctx->extradata, pkt->data, vo_len);

            avctx->extradata_size = vo_len;

        }

        /* Less dangerous now, memmove properly copies the two

           chunks of overlapping data */

        memmove(pkt->data, &pkt->data[vo_len], frame_len - vo_len);

        pkt->size = frame_len - vo_len;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static bool megasas_use_msi(MegasasState *s)
+
 {

     return s->msi != ON_OFF_AUTO_OFF;

static bool megasas_use_msi(MegasasState *s)

{

    return s->msi != ON_OFF_AUTO_OFF;

}


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

     s = migrate_get_current();
+
+    s->bandwidth_limit = value;
+
+    if (s->file) {
+
         qemu_file_set_rate_limit(s->file, s->bandwidth_limit / XFER_LIMIT_RATIO);

     }

void qmp_migrate_set_speed(int64_t value, Error **errp)

{

    MigrationState *s;

    if (value < 0) {

        value = 0;

    }

    if (value > SIZE_MAX) {

        value = SIZE_MAX;

    }

    s = migrate_get_current();

    s->bandwidth_limit = value;

    if (s->file) {

        qemu_file_set_rate_limit(s->file, s->bandwidth_limit / XFER_LIMIT_RATIO);

    }

}


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

 #if HAVE_STRUCT_SOCKADDR_IN6

+    else if (ss->ss_family == AF_INET6)
+
+        ssu.in6.sin6_port = htons(port);
+
+#endif

     *ss = ssu.storage;

static void set_port(struct sockaddr_storage *ss, int port)

{

    sockaddr_union ssu = (sockaddr_union){.storage = *ss};

    if (ss->ss_family == AF_INET)

        ssu.in.sin_port = htons(port);

#if HAVE_STRUCT_SOCKADDR_IN6

    else if (ss->ss_family == AF_INET6)

        ssu.in6.sin6_port = htons(port);

#endif

    *ss = ssu.storage;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int usb_device_post_load(void *opaque, int version_id)
+
+{
+
+    USBDevice *dev = opaque;
+

     if (dev->state == USB_STATE_NOTATTACHED) {

static int usb_device_post_load(void *opaque, int version_id)

{

    USBDevice *dev = opaque;

    if (dev->state == USB_STATE_NOTATTACHED) {

        dev->attached = 0;

    } else {

        dev->attached = 1;

    return 0;


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void adb_kbd_realizefn(DeviceState *dev, Error **errp)
+
+{
+
     ADBKeyboardClass *akc = ADB_KEYBOARD_GET_CLASS(dev);

     akc->parent_realize(dev, errp);

static void adb_kbd_realizefn(DeviceState *dev, Error **errp)

{

    ADBKeyboardClass *akc = ADB_KEYBOARD_GET_CLASS(dev);

    akc->parent_realize(dev, errp);

    qemu_input_handler_register(dev, &adb_keyboard_handler);

}


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

     switch (remote->kind) {

+    case SOCKET_ADDRESS_KIND_INET:

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

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

{

    QemuOpts *opts;

    int fd;

    opts = qemu_opts_create_nofail(&socket_optslist);

    switch (remote->kind) {

    case SOCKET_ADDRESS_KIND_INET:

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

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

        if (local) {

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

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

        }

        fd = inet_dgram_opts(opts, errp);

        break;

    default:

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

        return -1;

    }

    qemu_opts_del(opts);

    return fd;

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
     if(is_block2){

         decode_coeff(dst+8, coeffs[1], 2, gb, vlc, q_ac1);
+
+        decode_coeff(dst+1, coeffs[2], 2, gb, vlc, q_ac1);
+
+    }else{
+
         decode_coeff(dst+1, coeffs[1], 2, gb, vlc, q_ac1);

         decode_coeff(dst+8, coeffs[2], 2, gb, vlc, q_ac1);

static inline void decode_subblock3(DCTELEM *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc,

                                    int q_dc, int q_ac1, int q_ac2)

{

    int coeffs[4];

    coeffs[0] = modulo_three_table[code][0];

    coeffs[1] = modulo_three_table[code][1];

    coeffs[2] = modulo_three_table[code][2];

    coeffs[3] = modulo_three_table[code][3];

    decode_coeff(dst  , coeffs[0], 3, gb, vlc, q_dc);

    if(is_block2){

        decode_coeff(dst+8, coeffs[1], 2, gb, vlc, q_ac1);

        decode_coeff(dst+1, coeffs[2], 2, gb, vlc, q_ac1);

    }else{

        decode_coeff(dst+1, coeffs[1], 2, gb, vlc, q_ac1);

        decode_coeff(dst+8, coeffs[2], 2, gb, vlc, q_ac1);

    }

    decode_coeff(dst+9, coeffs[3], 2, gb, vlc, q_ac2);

}


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

     int i, j;
+
+    int has_fg, has_bg;

     uint8_t *last_fg, *last_bg;

static void send_framebuffer_update_hextile(VncState *vs, int x, int y, int w, int h)

{

    int i, j;

    int has_fg, has_bg;

    uint8_t *last_fg, *last_bg;

    vnc_framebuffer_update(vs, x, y, w, h, 5);

    last_fg = (uint8_t *) malloc(vs->depth);

    last_bg = (uint8_t *) malloc(vs->depth);

    has_fg = has_bg = 0;

    for (j = y; j < (y + h); j += 16) {

	for (i = x; i < (x + w); i += 16) {

            vs->send_hextile_tile(vs, i, j,

                                  MIN(16, x + w - i), MIN(16, y + h - j),

                                  last_bg, last_fg, &has_bg, &has_fg);

	}

    }

    free(last_fg);

    free(last_bg);

}


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

+    fidp = clunk_fid(s, fid);
+
+    if (fidp == NULL) {
+
+        err = -ENOENT;

         goto out_nofid;

static void v9fs_clunk(void *opaque)

{

    int err;

    int32_t fid;

    size_t offset = 7;

    V9fsFidState *fidp;

    V9fsPDU *pdu = opaque;

    V9fsState *s = pdu->s;

    pdu_unmarshal(pdu, offset, "d", &fid);

    trace_v9fs_clunk(pdu->tag, pdu->id, fid);

    fidp = clunk_fid(s, fid);

    if (fidp == NULL) {

        err = -ENOENT;

        goto out_nofid;

    }

    /*

     * Bump the ref so that put_fid will

     * free the fid.

     */

    fidp->ref++;

    err = offset;

    put_fid(pdu, fidp);

out_nofid:

    complete_pdu(s, pdu, err);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],

                    const uint8_t *src_data[4], const int src_linesizes[4],
+
                    enum PixelFormat pix_fmt, int width, int height)

 {

void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],

                   const uint8_t *src_data[4], const int src_linesizes[4],

                   enum PixelFormat pix_fmt, int width, int height)

{

    const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];

    if (desc->flags & PIX_FMT_HWACCEL)

        return;

    if (desc->flags & PIX_FMT_PAL) {

        av_image_copy_plane(dst_data[0], dst_linesizes[0],

                            src_data[0], src_linesizes[0],

                            width, height);

        /* copy the palette */

        memcpy(dst_data[1], src_data[1], 4*256);

    } else {

        int i, planes_nb = 0;

        for (i = 0; i < desc->nb_components; i++)

            planes_nb = FFMAX(planes_nb, desc->comp[i].plane + 1);

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

            int h = height;

            int bwidth = av_image_get_linesize(pix_fmt, width, i);

            if (i == 1 || i == 2) {

                h= -((-height)>>desc->log2_chroma_h);

            }

            av_image_copy_plane(dst_data[i], dst_linesizes[i],

                                src_data[i], src_linesizes[i],

                                bwidth, h);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     uint8_t *msg_data;

+
     if (offset % PCI_MSIX_ENTRY_SIZE != 8) {

         return;

static void update_msix_table_msg_data(S390PCIBusDevice *pbdev, uint64_t offset,

                                       uint64_t *data, uint8_t len)

{

    uint32_t val;

    uint8_t *msg_data;

    if (offset % PCI_MSIX_ENTRY_SIZE != 8) {

        return;

    }

    if (len != 4) {

        DPRINTF("access msix table msg data but len is %d\n", len);

        return;

    }

    msg_data = (uint8_t *)data - offset % PCI_MSIX_ENTRY_SIZE +

               PCI_MSIX_ENTRY_VECTOR_CTRL;

    val = pci_get_long(msg_data) | (pbdev->fid << ZPCI_MSI_VEC_BITS);

    pci_set_long(msg_data, val);

    DPRINTF("update msix msg_data to 0x%" PRIx64 "\n", *data);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+void qemu_cpu_kick_self(void)
+
+{
+
+#ifndef _WIN32

     assert(cpu_single_env);

void qemu_cpu_kick_self(void)

{

#ifndef _WIN32

    assert(cpu_single_env);

    raise(SIG_IPI);

#else

    abort();

#endif

}


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

 {

+    MovieContext *movie = outlink->src->priv;

     int ret;

static int amovie_request_frame(AVFilterLink *outlink)

{

    MovieContext *movie = outlink->src->priv;

    int ret;

    if (movie->is_done)

        return AVERROR_EOF;

    if ((ret = amovie_get_samples(outlink)) < 0)

        return ret;

    avfilter_filter_samples(outlink, avfilter_ref_buffer(movie->samplesref, ~0));

    avfilter_unref_buffer(movie->samplesref);

    movie->samplesref = NULL;

    return 0;

}


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

         (vring_avail_flags(vq) & VRING_AVAIL_F_NO_INTERRUPT))

+        return;
+
+
+
     vdev->isr |= 0x01;

     virtio_update_irq(vdev);

void virtio_notify(VirtIODevice *vdev, VirtQueue *vq)

{

    /* Always notify when queue is empty */

    if ((vq->inuse || vring_avail_idx(vq) != vq->last_avail_idx) &&

        (vring_avail_flags(vq) & VRING_AVAIL_F_NO_INTERRUPT))

        return;

    vdev->isr |= 0x01;

    virtio_update_irq(vdev);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     if (ret <= 0) {

         if (ret == 0) {
+
             VNC_DEBUG("Closing down client sock: EOF\n");

         } else if (ret != QIO_CHANNEL_ERR_BLOCK) {

ssize_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp)

{

    if (ret <= 0) {

        if (ret == 0) {

            VNC_DEBUG("Closing down client sock: EOF\n");

        } else if (ret != QIO_CHANNEL_ERR_BLOCK) {

            VNC_DEBUG("Closing down client sock: ret %zd (%s)\n",

                      ret, errp ? error_get_pretty(*errp) : "Unknown");

        }

        vnc_disconnect_start(vs);

        if (errp) {

            error_free(*errp);

            *errp = NULL;

        }

        return 0;

    }

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void nbd_refresh_limits(BlockDriverState *bs, Error **errp)
+
 {

     bs->bl.max_pdiscard = NBD_MAX_BUFFER_SIZE;

static void nbd_refresh_limits(BlockDriverState *bs, Error **errp)

{

    bs->bl.max_pdiscard = NBD_MAX_BUFFER_SIZE;

    bs->bl.max_pwrite_zeroes = NBD_MAX_BUFFER_SIZE;

    bs->bl.max_transfer = NBD_MAX_BUFFER_SIZE;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static av_always_inline int simple_limit(uint8_t *p, ptrdiff_t stride, int flim)
+
 {

     LOAD_PIXELS

static av_always_inline int simple_limit(uint8_t *p, ptrdiff_t stride, int flim)

{

    LOAD_PIXELS

    return 2 * FFABS(p0 - q0) + (FFABS(p1 - q1) >> 1) <= flim;

}


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

         } else {

+            /* fall back on uncompressed */
+
+            count = count_pixels(ptr, w-x, bpp, 0);
+
+            *out++ = (count ^ xor_raw) + add_raw;

int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *ptr , int bpp, int w,

                  int add_rep, int xor_rep, int add_raw, int xor_raw)

{

    int count, x;

    uint8_t *out = outbuf;

    for(x = 0; x < w; x += count) {

        /* see if we can encode the next set of pixels with RLE */

        if((count = count_pixels(ptr, w-x, bpp, 1)) > 1) {

            if(out + bpp + 1 > outbuf + out_size) return -1;

            *out++ = (count ^ xor_rep) + add_rep;

            memcpy(out, ptr, bpp);

            out += bpp;

        } else {

            /* fall back on uncompressed */

            count = count_pixels(ptr, w-x, bpp, 0);

            *out++ = (count ^ xor_raw) + add_raw;

            if(out + bpp*count > outbuf + out_size) return -1;

            memcpy(out, ptr, bpp * count);

            out += bpp * count;

        }

        ptr += count * bpp;

    }

    return out - outbuf;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)

+{

     if (min_size < *size)

void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)

{

    if (min_size < *size)

        return ptr;

    min_size = FFMAX(17 * min_size / 16 + 32, min_size);

    ptr = av_realloc(ptr, min_size);

    /* we could set this to the unmodified min_size but this is safer

     * if the user lost the ptr and uses NULL now

     */

    if (!ptr)

        min_size = 0;

    *size = min_size;

    return ptr;

}


static void intel_hda_corb_run(IntelHDAState *d)

{

    hwaddr addr;

    uint32_t rp, verb;

    if (d->ics & ICH6_IRS_BUSY) {

        dprint(d, 2, "%s: [icw] verb 0x%08x\n", __FUNCTION__, d->icw);

        intel_hda_send_command(d, d->icw);

        return;

    }

    for (;;) {

        if (!(d->corb_ctl & ICH6_CORBCTL_RUN)) {

            dprint(d, 2, "%s: !run\n", __FUNCTION__);

            return;

        }

        if ((d->corb_rp & 0xff) == d->corb_wp) {

            dprint(d, 2, "%s: corb ring empty\n", __FUNCTION__);

            return;

        }

        if (d->rirb_count == d->rirb_cnt) {

            dprint(d, 2, "%s: rirb count reached\n", __FUNCTION__);

            return;

        }

        rp = (d->corb_rp + 1) & 0xff;

        addr = intel_hda_addr(d->corb_lbase, d->corb_ubase);

        verb = ldl_le_pci_dma(&d->pci, addr + 4*rp);

        d->corb_rp = rp;

        dprint(d, 2, "%s: [rp 0x%x] verb 0x%08x\n", __FUNCTION__, rp, verb);

        intel_hda_send_command(d, verb);

    }

}


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

         container_of(blockacb, BlockDriverAIOCBCoroutine, common);

+    bool done = false;
+
+
+
+    acb->done = &done;

     while (!done) {

static void bdrv_aio_co_cancel_em(BlockDriverAIOCB *blockacb)

{

    BlockDriverAIOCBCoroutine *acb =

        container_of(blockacb, BlockDriverAIOCBCoroutine, common);

    bool done = false;

    acb->done = &done;

    while (!done) {

        qemu_aio_wait();

    }

}


PPC_OP(btest_T1)

{

    if (T0) {

        regs->nip = T1 & ~3;

    } else {

        regs->nip = PARAM1;

    }

    RETURN();

}


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

     return ((const OpenCLDeviceBenchmark*)a)->runtime - ((const OpenCLDeviceBenchmark*)b)->runtime;

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

{

    return ((const OpenCLDeviceBenchmark*)a)->runtime - ((const OpenCLDeviceBenchmark*)b)->runtime;

}


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

     uint64_t pos;

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

    int res = 0;

    uint64_t pos;

    uint64_t maxlen = 100 * 1024 * 1024;

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

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

    int64_t found;

    int idx;

    if (timestamp < start_time) timestamp = start_time;

    idx = av_index_search_timestamp(st, timestamp - start_time,

                                    AVSEEK_FLAG_ANY | AVSEEK_FLAG_BACKWARD);

    if (idx < 0)

        return -1;

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

    if (idx < st->nb_index_entries - 2)

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

    maxlen = FFMAX(maxlen, 200 * 1024);

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

    if (res < 0)

        return res;

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

    if (FFABS(found - timestamp) > 4)

        return -1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static CharDriverState *qemu_chr_open_file_out(QemuOpts *opts)

+{

     int fd_out;

static CharDriverState *qemu_chr_open_file_out(QemuOpts *opts)

{

    int fd_out;

    TFR(fd_out = open(qemu_opt_get(opts, "path"),

                      O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0666));

    if (fd_out < 0)

        return NULL;

    return qemu_chr_open_fd(-1, fd_out);

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     int error = rule->options.inject.error;

     bool immediately = rule->options.inject.immediately;
+

     if (rule->options.inject.once) {

static int inject_error(BlockDriverState *bs, BlkdebugRule *rule)

{

    BDRVBlkdebugState *s = bs->opaque;

    int error = rule->options.inject.error;

    bool immediately = rule->options.inject.immediately;

    if (rule->options.inject.once) {

        QSIMPLEQ_REMOVE(&s->active_rules, rule, BlkdebugRule, active_next);

        remove_rule(rule);

    }

    if (!immediately) {

        aio_bh_schedule_oneshot(bdrv_get_aio_context(bs), error_callback_bh,

                                qemu_coroutine_self());

        qemu_coroutine_yield();

    }

    return -error;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+int net_init_dump(QemuOpts *opts, const char *name, VLANState *vlan)

 {

int net_init_dump(QemuOpts *opts, const char *name, VLANState *vlan)

{

    int len;

    const char *file;

    char def_file[128];

    assert(vlan);

    file = qemu_opt_get(opts, "file");

    if (!file) {

        snprintf(def_file, sizeof(def_file), "qemu-vlan%d.pcap", vlan->id);

        file = def_file;

    }

    len = qemu_opt_get_size(opts, "len", 65536);

    return net_dump_init(vlan, "dump", name, file, len);

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     CharDriverState *chr = NULL;

     NetCharDriver *s = NULL;
+
+
+
+    chr = g_malloc0(sizeof(CharDriverState));
+
     s = g_malloc0(sizeof(NetCharDriver));

static CharDriverState *qemu_chr_open_udp_fd(int fd)

{

    CharDriverState *chr = NULL;

    NetCharDriver *s = NULL;

    chr = g_malloc0(sizeof(CharDriverState));

    s = g_malloc0(sizeof(NetCharDriver));

    s->fd = fd;

    s->chan = io_channel_from_socket(s->fd);

    s->bufcnt = 0;

    s->bufptr = 0;

    chr->opaque = s;

    chr->chr_write = udp_chr_write;

    chr->chr_update_read_handler = udp_chr_update_read_handler;

    chr->chr_close = udp_chr_close;

    /* be isn't opened until we get a connection */

    chr->explicit_be_open = true;

    return chr;

}


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

     const char virtio_name[] = "virtio-net-";

+

     driver = qemu_opt_get(opts, "driver");

static int net_vhost_check_net(void *opaque, QemuOpts *opts, Error **errp)

{

    const char *name = opaque;

    const char *driver, *netdev;

    const char virtio_name[] = "virtio-net-";

    driver = qemu_opt_get(opts, "driver");

    netdev = qemu_opt_get(opts, "netdev");

    if (!driver || !netdev) {

        return 0;

    }

    if (strcmp(netdev, name) == 0 &&

        strncmp(driver, virtio_name, strlen(virtio_name)) != 0) {

        error_report("vhost-user requires frontend driver virtio-net-*");

        return -1;

    }

    return 0;

}


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

 {
+
+    if (strcmp(target, "passwd") == 0 ||

 	strcmp(target, "password") == 0) {

static void do_change_vnc(const char *target)

{

    if (strcmp(target, "passwd") == 0 ||

	strcmp(target, "password") == 0) {

	char password[9];

	monitor_readline("Password: ", 1, password, sizeof(password)-1);

	password[sizeof(password)-1] = '\0';

	if (vnc_display_password(NULL, password) < 0)

	    term_printf("could not set VNC server password\n");

    } else {

	if (vnc_display_open(NULL, target) < 0)

	    term_printf("could not start VNC server on %s\n", target);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 int raw_get_aio_fd(BlockDriverState *bs)

+{
+
+    BDRVRawState *s;
+
+

     if (!bs->drv) {

int raw_get_aio_fd(BlockDriverState *bs)

{

    BDRVRawState *s;

    if (!bs->drv) {

        return -ENOMEDIUM;

    }

    if (bs->drv == bdrv_find_format("raw")) {

        bs = bs->file;

    }

    /* raw-posix has several protocols so just check for raw_aio_readv */

    if (bs->drv->bdrv_aio_readv != raw_aio_readv) {

        return -ENOTSUP;

    }

    s = bs->opaque;

    if (!s->use_aio) {

        return -ENOTSUP;

    }

    return s->fd;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void s390_program_interrupt(CPUS390XState *env, uint32_t code, int ilen,
+
+                            uintptr_t ra)
+
+{
+
 #ifdef CONFIG_TCG

     S390CPU *cpu = s390_env_get_cpu(env);

void s390_program_interrupt(CPUS390XState *env, uint32_t code, int ilen,

                            uintptr_t ra)

{

#ifdef CONFIG_TCG

    S390CPU *cpu = s390_env_get_cpu(env);

    if (tcg_enabled()) {

        cpu_restore_state(CPU(cpu), ra);

    }

#endif

    program_interrupt(env, code, ilen);

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
 static void vnc_resize(VncState *vs)

 {
+
+    DisplayState *ds = vs->ds;
+
+

+    int size_changed;

+
+
     vs->old_data = qemu_realloc(vs->old_data, ds_get_linesize(ds) * ds_get_height(ds));

@@ -19,8 +19,8 @@
         fprintf(stderr, "vnc: memory allocation failed\n");

         exit(1);
+
+    }

static void vnc_resize(VncState *vs)

{

    DisplayState *ds = vs->ds;

    int size_changed;

    vs->old_data = qemu_realloc(vs->old_data, ds_get_linesize(ds) * ds_get_height(ds));

    if (vs->old_data == NULL) {

        fprintf(stderr, "vnc: memory allocation failed\n");

        exit(1);

    }

    if (ds_get_bytes_per_pixel(ds) != vs->serverds.pf.bytes_per_pixel)

        console_color_init(ds);

    vnc_colordepth(vs);

    size_changed = ds_get_width(ds) != vs->serverds.width ||

                   ds_get_height(ds) != vs->serverds.height;

    vs->serverds = *(ds->surface);

    if (size_changed) {

        if (vs->csock != -1 && vnc_has_feature(vs, VNC_FEATURE_RESIZE)) {

            vnc_write_u8(vs, 0);  /* msg id */

            vnc_write_u8(vs, 0);

            vnc_write_u16(vs, 1); /* number of rects */

            vnc_framebuffer_update(vs, 0, 0, ds_get_width(ds), ds_get_height(ds),

                                   VNC_ENCODING_DESKTOPRESIZE);

            vnc_flush(vs);

        }

    }

    memset(vs->dirty_row, 0xFF, sizeof(vs->dirty_row));

    memset(vs->old_data, 42, ds_get_linesize(vs->ds) * ds_get_height(vs->ds));

}


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

 {

+    Monitor *mon;

static void monitor_qapi_event_emit(QAPIEvent event, QDict *qdict)

{

    Monitor *mon;

    trace_monitor_protocol_event_emit(event, qdict);

    QLIST_FOREACH(mon, &mon_list, entry) {

        if (monitor_is_qmp(mon) && mon->qmp.in_command_mode) {

            monitor_json_emitter(mon, QOBJECT(qdict));

        }

    }

}


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

     return &qemu_clocks[type];

+}

QEMUClock *qemu_clock_ptr(QEMUClockType type)

{

    return &qemu_clocks[type];

}


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

     if (iscsilun->allocmap == NULL) {

+        return;

     }

     /* expand to entirely contain all affected clusters */

+    cl_num_expanded = sector_num / iscsilun->cluster_sectors;

     nb_cls_expanded = DIV_ROUND_UP(sector_num + nb_sectors,

iscsi_allocmap_update(IscsiLun *iscsilun, int64_t sector_num,

                      int nb_sectors, bool allocated, bool valid)

{

    int64_t cl_num_expanded, nb_cls_expanded, cl_num_shrunk, nb_cls_shrunk;

    if (iscsilun->allocmap == NULL) {

        return;

    }

    /* expand to entirely contain all affected clusters */

    cl_num_expanded = sector_num / iscsilun->cluster_sectors;

    nb_cls_expanded = DIV_ROUND_UP(sector_num + nb_sectors,

                                   iscsilun->cluster_sectors) - cl_num_expanded;

    /* shrink to touch only completely contained clusters */

    cl_num_shrunk = DIV_ROUND_UP(sector_num, iscsilun->cluster_sectors);

    nb_cls_shrunk = (sector_num + nb_sectors) / iscsilun->cluster_sectors

                      - cl_num_shrunk;

    if (allocated) {

        bitmap_set(iscsilun->allocmap, cl_num_expanded, nb_cls_expanded);

    } else {

        bitmap_clear(iscsilun->allocmap, cl_num_shrunk, nb_cls_shrunk);

    }

    if (iscsilun->allocmap_valid == NULL) {

        return;

    }

    if (valid) {

        bitmap_set(iscsilun->allocmap_valid, cl_num_shrunk, nb_cls_shrunk);

    } else {

        bitmap_clear(iscsilun->allocmap_valid, cl_num_expanded,

                     nb_cls_expanded);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 static void vp8_idct_dc_add_c(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride)

+{

     int i, dc = (block[0] + 4) >> 3;
+
+    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + dc;
+
+    block[0] = 0;

static void vp8_idct_dc_add_c(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride)

{

    int i, dc = (block[0] + 4) >> 3;

    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + dc;

    block[0] = 0;

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

        dst[0] = cm[dst[0]];

        dst[1] = cm[dst[1]];

        dst[2] = cm[dst[2]];

        dst[3] = cm[dst[3]];

        dst += stride;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
+static int append_extradata(APNGDemuxContext *ctx, AVIOContext *pb, int len)
+
 {

     int previous_size = ctx->extra_data_size;

+    int new_size, ret;

+    uint8_t *new_extradata;
+
+

     if (previous_size > INT_MAX - len)

static int append_extradata(APNGDemuxContext *ctx, AVIOContext *pb, int len)

{

    int previous_size = ctx->extra_data_size;

    int new_size, ret;

    uint8_t *new_extradata;

    if (previous_size > INT_MAX - len)

        return AVERROR_INVALIDDATA;

    new_size = previous_size + len;

    new_extradata = av_realloc(ctx->extra_data, new_size + AV_INPUT_BUFFER_PADDING_SIZE);

    if (!new_extradata)

        return AVERROR(ENOMEM);

    ctx->extra_data = new_extradata;

    ctx->extra_data_size = new_size;

    if ((ret = avio_read(pb, ctx->extra_data + previous_size, len)) < 0)

        return ret;

    return previous_size;

}


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

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

     TAPState *s;

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

                    NetClientState *peer, Error **errp)

{

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

    const NetdevBridgeOptions *bridge;

    const char *helper, *br;

    TAPState *s;

    int fd, vnet_hdr;

    assert(opts->kind == NET_CLIENT_OPTIONS_KIND_BRIDGE);

    bridge = opts->bridge;

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

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

    fd = net_bridge_run_helper(helper, br);

    if (fd == -1) {

        return -1;

    }

    fcntl(fd, F_SETFL, O_NONBLOCK);

    vnet_hdr = tap_probe_vnet_hdr(fd);

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

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

             br);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+static gnutls_anon_server_credentials_t vnc_tls_initialize_anon_cred(void)
+
+{
+
+    gnutls_anon_server_credentials_t anon_cred;
+
     int ret;
+
+

     if ((ret = gnutls_anon_allocate_server_credentials(&anon_cred)) < 0) {

static gnutls_anon_server_credentials_t vnc_tls_initialize_anon_cred(void)

{

    gnutls_anon_server_credentials_t anon_cred;

    int ret;

    if ((ret = gnutls_anon_allocate_server_credentials(&anon_cred)) < 0) {

        VNC_DEBUG("Cannot allocate credentials %s\n", gnutls_strerror(ret));

        return NULL;

    }

    gnutls_anon_set_server_dh_params(anon_cred, dh_params);

    return anon_cred;

}


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

     writable_mask = reg->emu_mask & ~reg->ro_mask & valid_mask;

+    cfg_entry->data = XEN_PT_MERGE_VALUE(*val, cfg_entry->data, writable_mask);
+
+
+
+    /* create value for writing to I/O device register */

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

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

                                 uint8_t *val, uint8_t dev_value,

                                 uint8_t valid_mask)

{

    XenPTRegInfo *reg = cfg_entry->reg;

    uint8_t writable_mask = 0;

    uint8_t throughable_mask = get_throughable_mask(s, reg, valid_mask);

    /* modify emulate register */

    writable_mask = reg->emu_mask & ~reg->ro_mask & valid_mask;

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

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

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

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,24 +1,24 @@
+BdrvNextIterator *bdrv_next(BdrvNextIterator *it, BlockDriverState **bs)
+
+{
+
+    if (!it) {

         it = g_new(BdrvNextIterator, 1);

         *it = (BdrvNextIterator) {
+
+            .phase = BDRV_NEXT_BACKEND_ROOTS,
+
+        };

     }

+    /* First, return all root nodes of BlockBackends. In order to avoid
+
+     * returning a BDS twice when multiple BBs refer to it, we only return it

      * if the BB is the first one in the parent list of the BDS. */

BdrvNextIterator *bdrv_next(BdrvNextIterator *it, BlockDriverState **bs)

{

    if (!it) {

        it = g_new(BdrvNextIterator, 1);

        *it = (BdrvNextIterator) {

            .phase = BDRV_NEXT_BACKEND_ROOTS,

        };

    }

    /* First, return all root nodes of BlockBackends. In order to avoid

     * returning a BDS twice when multiple BBs refer to it, we only return it

     * if the BB is the first one in the parent list of the BDS. */

    if (it->phase == BDRV_NEXT_BACKEND_ROOTS) {

        do {

            it->blk = blk_all_next(it->blk);

            *bs = it->blk ? blk_bs(it->blk) : NULL;

        } while (it->blk && (*bs == NULL || bdrv_first_blk(*bs) != it->blk));

        if (*bs) {

            return it;

        }

        it->phase = BDRV_NEXT_MONITOR_OWNED;

    }

    /* Then return the monitor-owned BDSes without a BB attached. Ignore all

     * BDSes that are attached to a BlockBackend here; they have been handled

     * by the above block already */

    do {

        it->bs = bdrv_next_monitor_owned(it->bs);

        *bs = it->bs;

    } while (*bs && bdrv_has_blk(*bs));

    return *bs ? it : NULL;

}


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

     struct kvm_get_htab_buf  *hpte_buf;

+
+
+    ghf.flags = 0;
+
+    ghf.start_index = pte_index;

     htab_fd = kvm_vm_ioctl(kvm_state, KVM_PPC_GET_HTAB_FD, &ghf);

uint64_t kvmppc_hash64_read_pteg(PowerPCCPU *cpu, target_ulong pte_index)

{

    int htab_fd;

    struct kvm_get_htab_fd ghf;

    struct kvm_get_htab_buf  *hpte_buf;

    ghf.flags = 0;

    ghf.start_index = pte_index;

    htab_fd = kvm_vm_ioctl(kvm_state, KVM_PPC_GET_HTAB_FD, &ghf);

    if (htab_fd < 0) {

        goto error_out;

    }

    hpte_buf = g_malloc0(sizeof(*hpte_buf));

    /*

     * Read the hpte group

     */

    if (read(htab_fd, hpte_buf, sizeof(*hpte_buf)) < 0) {

        goto out_close;

    }

    close(htab_fd);

    return (uint64_t)(uintptr_t) hpte_buf->hpte;

out_close:

    g_free(hpte_buf);

    close(htab_fd);

error_out:

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -41,11 +41,11 @@
                 (irq < GIC_INTERNAL || GIC_TARGET(irq) & cm)) {

                 if (GIC_GET_PRIORITY(irq, cpu) < best_prio) {
+
+                    best_prio = GIC_GET_PRIORITY(irq, cpu);
+
+                    best_irq = irq;
+
                 }

             }

void gic_update(GICState *s)

{

    int best_irq;

    int best_prio;

    int irq;

    int level;

    int cpu;

    int cm;

    for (cpu = 0; cpu < NUM_CPU(s); cpu++) {

        cm = 1 << cpu;

        s->current_pending[cpu] = 1023;

        if (!s->enabled || !s->cpu_enabled[cpu]) {

            qemu_irq_lower(s->parent_irq[cpu]);

            return;

        }

        best_prio = 0x100;

        best_irq = 1023;

        for (irq = 0; irq < s->num_irq; irq++) {

            if (GIC_TEST_ENABLED(irq, cm) && gic_test_pending(s, irq, cm) &&

                (irq < GIC_INTERNAL || GIC_TARGET(irq) & cm)) {

                if (GIC_GET_PRIORITY(irq, cpu) < best_prio) {

                    best_prio = GIC_GET_PRIORITY(irq, cpu);

                    best_irq = irq;

                }

            }

        }

        level = 0;

        if (best_prio < s->priority_mask[cpu]) {

            s->current_pending[cpu] = best_irq;

            if (best_prio < s->running_priority[cpu]) {

                DPRINTF("Raised pending IRQ %d (cpu %d)\n", best_irq, cpu);

                level = 1;

            }

        }

        qemu_set_irq(s->parent_irq[cpu], level);

    }

}


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

         tcg_out_sh64(s, RSY_SLLG, dest, src, TCG_REG_NONE, 48);

+        tcg_out_sh64(s, RSY_SRAG, dest, dest, TCG_REG_NONE, 48);
+
+    }
+
+}

static void tgen_ext16s(TCGContext *s, TCGType type, TCGReg dest, TCGReg src)

{

    if (facilities & FACILITY_EXT_IMM) {

        tcg_out_insn(s, RRE, LGHR, dest, src);

        return;

    }

    if (type == TCG_TYPE_I32) {

        if (dest == src) {

            tcg_out_sh32(s, RS_SLL, dest, TCG_REG_NONE, 16);

        } else {

            tcg_out_sh64(s, RSY_SLLG, dest, src, TCG_REG_NONE, 16);

        }

        tcg_out_sh32(s, RS_SRA, dest, TCG_REG_NONE, 16);

    } else {

        tcg_out_sh64(s, RSY_SLLG, dest, src, TCG_REG_NONE, 48);

        tcg_out_sh64(s, RSY_SRAG, dest, dest, TCG_REG_NONE, 48);

    }

}


--- a/source.c
+++ b/source.c
@@ -15,9 +15,9 @@
         ost->is_past_recording_time = 1;

         return 0;
+
+    }
+
+    return 1;
+
 }

static int check_recording_time(OutputStream *ost)

{

    OutputFile *of = output_files[ost->file_index];

    if (of->recording_time != INT64_MAX &&

        av_compare_ts(ost->sync_opts - ost->first_pts, ost->st->codec->time_base, of->recording_time,

                      AV_TIME_BASE_Q) >= 0) {

        ost->is_past_recording_time = 1;

        return 0;

    }

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 static void close_decoder(QSVContext *q)

 {
+
+    QSVFrame *cur;
+
+
+
+    if (q->session)

         MFXVideoDECODE_Close(q->session);

static void close_decoder(QSVContext *q)

{

    QSVFrame *cur;

    if (q->session)

        MFXVideoDECODE_Close(q->session);

    while (q->async_fifo && av_fifo_size(q->async_fifo)) {

        QSVFrame *out_frame;

        mfxSyncPoint *sync;

        av_fifo_generic_read(q->async_fifo, &out_frame, sizeof(out_frame), NULL);

        av_fifo_generic_read(q->async_fifo, &sync,      sizeof(sync),      NULL);

        av_freep(&sync);

    }

    cur = q->work_frames;

    while (cur) {

        q->work_frames = cur->next;

        av_frame_free(&cur->frame);

        av_freep(&cur);

        cur = q->work_frames;

    }

    q->engine_ready   = 0;

    q->reinit_pending = 0;

}


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

     int i;
+
+
+
+    if (s->iformat->read_close)
+
         s->iformat->read_close(s);

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

void av_close_input_file(AVFormatContext *s)

{

    int i;

    if (s->iformat->read_close)

        s->iformat->read_close(s);

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

        av_free(s->streams[i]);

    }

    if (s->packet_buffer) {

        AVPacketList *p, *p1;

        p = s->packet_buffer;

        while (p != NULL) {

            p1 = p->next;

            av_free_packet(&p->pkt);

            av_free(p);

            p = p1;

        }

        s->packet_buffer = NULL;

    }

    if (!(s->iformat->flags & AVFMT_NOFILE)) {

        url_fclose(&s->pb);

    }

    av_free(s->priv_data);

    av_free(s);

}


static bool iasl_installed(void)

{

    gchar *out = NULL, *out_err = NULL;

    bool ret;

    /* pass 'out' and 'out_err' in order to be redirected */

    ret = g_spawn_command_line_sync("iasl", &out, &out_err, NULL, NULL);

    if (out_err) {

        ret = ret && (out_err[0] == '\0');

        g_free(out_err);

    }

    if (out) {

        g_free(out);

    }

    return ret;

}


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

         switch (ret) {

+        case -EEXIST:
+
+            fprintf(stderr, "property \"%s.%s\": \"%s\" is already in use\n",
+
+                    dev->info->name, name, value);

             break;

int qdev_prop_parse(DeviceState *dev, const char *name, const char *value)

{

    Property *prop;

    int ret;

    prop = qdev_prop_find(dev, name);

    if (!prop) {

        fprintf(stderr, "property \"%s.%s\" not found\n",

                dev->info->name, name);

        return -1;

    }

    if (!prop->info->parse) {

        fprintf(stderr, "property \"%s.%s\" has no parser\n",

                dev->info->name, name);

        return -1;

    }

    ret = prop->info->parse(dev, prop, value);

    if (ret < 0) {

        switch (ret) {

        case -EEXIST:

            fprintf(stderr, "property \"%s.%s\": \"%s\" is already in use\n",

                    dev->info->name, name, value);

            break;

        default:

        case -EINVAL:

            fprintf(stderr, "property \"%s.%s\": failed to parse \"%s\"\n",

                    dev->info->name, name, value);

            break;

        case -ENOENT:

            fprintf(stderr, "property \"%s.%s\": could not find \"%s\"\n",

                    dev->info->name, name, value);

            break;

        }

        return -1;

    }

    return 0;

}


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

     VirtQueueElement elem;

+    VirtQueue *vq;
+
+    size_t offset = 0;
+
+    size_t len = 0;

static size_t write_to_port(VirtIOSerialPort *port,

                            const uint8_t *buf, size_t size)

{

    VirtQueueElement elem;

    VirtQueue *vq;

    size_t offset = 0;

    size_t len = 0;

    vq = port->ivq;

    if (!virtio_queue_ready(vq)) {

        return 0;

    }

    if (!size) {

        return 0;

    }

    while (offset < size) {

        int i;

        if (!virtqueue_pop(vq, &elem)) {

            break;

        }

        for (i = 0; offset < size && i < elem.in_num; i++) {

            len = MIN(elem.in_sg[i].iov_len, size - offset);

            memcpy(elem.in_sg[i].iov_base, buf + offset, len);

            offset += len;

        }

        virtqueue_push(vq, &elem, len);

    }

    virtio_notify(&port->vser->vdev, vq);

    return offset;

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     qemu_log("%s: frame_addr 0x%llx\n", __FUNCTION__,

              (unsigned long long)frame_addr);
+
+    target_sigset_t target_set;
+
+    sigset_t set;
+

     if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) {

long do_sigreturn(CPUS390XState *env)

{

    sigframe *frame;

    abi_ulong frame_addr = env->regs[15];

    qemu_log("%s: frame_addr 0x%llx\n", __FUNCTION__,

             (unsigned long long)frame_addr);

    target_sigset_t target_set;

    sigset_t set;

    if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) {

        goto badframe;

    }

    if (__get_user(target_set.sig[0], &frame->sc.oldmask[0])) {

        goto badframe;

    }

    target_to_host_sigset_internal(&set, &target_set);

    sigprocmask(SIG_SETMASK, &set, NULL); /* ~_BLOCKABLE? */

    if (restore_sigregs(env, &frame->sregs)) {

        goto badframe;

    }

    unlock_user_struct(frame, frame_addr, 0);

    return env->regs[2];

badframe:

    unlock_user_struct(frame, frame_addr, 0);

    force_sig(TARGET_SIGSEGV);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void fw_cfg_mem_realize(DeviceState *dev, Error **errp)

 {
+
+    FWCfgMemState *s = FW_CFG_MEM(dev);
+
+    SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
+

     memory_region_init_io(&s->ctl_iomem, OBJECT(s), &fw_cfg_ctl_mem_ops,

static void fw_cfg_mem_realize(DeviceState *dev, Error **errp)

{

    FWCfgMemState *s = FW_CFG_MEM(dev);

    SysBusDevice *sbd = SYS_BUS_DEVICE(dev);

    memory_region_init_io(&s->ctl_iomem, OBJECT(s), &fw_cfg_ctl_mem_ops,

                          FW_CFG(s), "fwcfg.ctl", FW_CFG_SIZE);

    sysbus_init_mmio(sbd, &s->ctl_iomem);

    memory_region_init_io(&s->data_iomem, OBJECT(s), &fw_cfg_data_mem_ops,

                          FW_CFG(s), "fwcfg.data",

                          fw_cfg_data_mem_ops.valid.max_access_size);

    sysbus_init_mmio(sbd, &s->data_iomem);

}


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

         return -1;

+    }
+
+
+
+    object_property_add_child(container_get(object_get_root(), "/objects"),

                               id, obj, NULL);

static int object_create(QemuOpts *opts, void *opaque)

{

    const char *type = qemu_opt_get(opts, "qom-type");

    const char *id = qemu_opts_id(opts);

    Object *obj;

    g_assert(type != NULL);

    if (id == NULL) {

        qerror_report(QERR_MISSING_PARAMETER, "id");

        return -1;

    }

    obj = object_new(type);

    if (qemu_opt_foreach(opts, object_set_property, obj, 1) < 0) {

        return -1;

    }

    object_property_add_child(container_get(object_get_root(), "/objects"),

                              id, obj, NULL);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static struct omap_mcbsp_s *omap_mcbsp_init(MemoryRegion *system_memory,
+
                                             hwaddr base,

                                             qemu_irq txirq, qemu_irq rxirq,

static struct omap_mcbsp_s *omap_mcbsp_init(MemoryRegion *system_memory,

                                            hwaddr base,

                                            qemu_irq txirq, qemu_irq rxirq,

                                            qemu_irq *dma, omap_clk clk)

{

    struct omap_mcbsp_s *s = (struct omap_mcbsp_s *)

            g_malloc0(sizeof(struct omap_mcbsp_s));

    s->txirq = txirq;

    s->rxirq = rxirq;

    s->txdrq = dma[0];

    s->rxdrq = dma[1];

    s->sink_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, omap_mcbsp_sink_tick, s);

    s->source_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, omap_mcbsp_source_tick, s);

    omap_mcbsp_reset(s);

    memory_region_init_io(&s->iomem, NULL, &omap_mcbsp_ops, s, "omap-mcbsp", 0x800);

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

    return s;

}


--- a/source.c
+++ b/source.c
@@ -4,10 +4,10 @@
     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);
+                qemu_set_fd_handler(vs->csock, NULL, vncws_tls_handshake_io,
                                     vs);
             return 0;
         VNC_DEBUG("Handshake failed %s\n", gnutls_strerror(ret));

static int vncws_start_tls_handshake(struct 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);
                qemu_set_fd_handler(vs->csock, NULL, vncws_tls_handshake_io,
                                    vs);
            return 0;
        VNC_DEBUG("Handshake failed %s\n", gnutls_strerror(ret));
    VNC_DEBUG("Handshake done, switching to TLS data mode\n");
    qemu_set_fd_handler2(vs->csock, NULL, vncws_handshake_read, NULL, vs);
    return 0;


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void adb_keyboard_event(DeviceState *dev, QemuConsole *src,

                                InputEvent *evt)
+
+{
+
+    KBDState *s = (KBDState *)dev;
+
     int qcode, keycode;

static void adb_keyboard_event(DeviceState *dev, QemuConsole *src,

                               InputEvent *evt)

{

    KBDState *s = (KBDState *)dev;

    int qcode, keycode;

    qcode = qemu_input_key_value_to_qcode(evt->u.key.data->key);

    if (qcode >= ARRAY_SIZE(qcode_to_adb_keycode)) {

        return;

    }

    keycode = qcode_to_adb_keycode[qcode];

    if (evt->u.key.data->down == false) { /* if key release event */

        keycode = keycode | 0x80;   /* create keyboard break code */

    }

    adb_kbd_put_keycode(s, keycode);

}


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

     gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

 #else

     TCGv t0;
+
     if (unlikely(ctx->pr)) {

         gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

static void gen_tlbivax_booke206(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

#else

    TCGv t0;

    if (unlikely(ctx->pr)) {

        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

        return;

    }

    t0 = tcg_temp_new();

    gen_addr_reg_index(ctx, t0);

    gen_helper_booke206_tlbivax(cpu_env, t0);

    tcg_temp_free(t0);

#endif

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     sync_info->crc1 = get_bits(gb, 16);

     sync_info->fscod = get_bits(gb, 2);
+
+    if (sync_info->fscod == 0x03)
+
+        return -1;
+
     sync_info->frmsizecod = get_bits(gb, 6);

     if (sync_info->frmsizecod >= 0x38)

static int ac3_parse_sync_info(AC3DecodeContext *ctx)

{

    ac3_sync_info *sync_info = &ctx->sync_info;

    GetBitContext *gb = &ctx->gb;

    sync_info->sync_word = get_bits(gb, 16);

    sync_info->crc1 = get_bits(gb, 16);

    sync_info->fscod = get_bits(gb, 2);

    if (sync_info->fscod == 0x03)

        return -1;

    sync_info->frmsizecod = get_bits(gb, 6);

    if (sync_info->frmsizecod >= 0x38)

        return -1;

    sync_info->sampling_rate = ac3_freqs[sync_info->fscod];

    sync_info->bit_rate = ac3_bitratetab[sync_info->frmsizecod >> 1];

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
 	if (r < 0 || r > 15)

 		fprintf(stderr, "wrong register write $p%d\n", r);
+
+	if (r == PR_BZ || r == PR_WZ || r == PR_DZ)
+
+		return;
+
 	else if (r == PR_SRS)

 		tcg_gen_andi_tl(cpu_PR[r], tn, 3);

static inline void t_gen_mov_preg_TN(DisasContext *dc, int r, TCGv tn)

{

	if (r < 0 || r > 15)

		fprintf(stderr, "wrong register write $p%d\n", r);

	if (r == PR_BZ || r == PR_WZ || r == PR_DZ)

		return;

	else if (r == PR_SRS)

		tcg_gen_andi_tl(cpu_PR[r], tn, 3);

	else {

		if (r == PR_PID)

			tcg_gen_helper_0_1(helper_tlb_flush_pid, tn);

		if (dc->tb_flags & S_FLAG && r == PR_SPC)

			tcg_gen_helper_0_1(helper_spc_write, tn);

		else if (r == PR_CCS)

			dc->cpustate_changed = 1;

		tcg_gen_mov_tl(cpu_PR[r], tn);

	}

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
         virtio_pci_modern_mem_region_unmap(proxy, &proxy->device);

         virtio_pci_modern_mem_region_unmap(proxy, &proxy->notify);
+
+        if (modern_pio) {
+
+            virtio_pci_modern_io_region_unmap(proxy, &proxy->notify_pio);
+
         }

     }

static void virtio_pci_device_unplugged(DeviceState *d)

{

    VirtIOPCIProxy *proxy = VIRTIO_PCI(d);

    bool modern = !(proxy->flags & VIRTIO_PCI_FLAG_DISABLE_MODERN);

    bool modern_pio = proxy->flags & VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY;

    virtio_pci_stop_ioeventfd(proxy);

    if (modern) {

        virtio_pci_modern_mem_region_unmap(proxy, &proxy->common);

        virtio_pci_modern_mem_region_unmap(proxy, &proxy->isr);

        virtio_pci_modern_mem_region_unmap(proxy, &proxy->device);

        virtio_pci_modern_mem_region_unmap(proxy, &proxy->notify);

        if (modern_pio) {

            virtio_pci_modern_io_region_unmap(proxy, &proxy->notify_pio);

        }

    }

}


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

+    for (i = 0; i < TERM_MAX_CMDS; i++) {
+
+	if (term_history[i] == NULL)
+
 	    break;

 	term_printf("%d: '%s'\n", i, term_history[i]);

static void do_info_history (void)

{

    int i;

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

	if (term_history[i] == NULL)

	    break;

	term_printf("%d: '%s'\n", i, term_history[i]);

    }

}


--- a/source.c
+++ b/source.c
@@ -2,9 +2,9 @@
 {
     VReaderListEntry *current_entry;
     VReaderListEntry *next_entry = NULL;
+    VReaderList *list = vreader_get_reader_list();
+    for (current_entry = vreader_list_get_first(list); current_entry;
+            current_entry = next_entry) {
         VReader *vreader = vreader_list_get_reader(current_entry);
         next_entry = vreader_list_get_next(current_entry);
         vreader_queue_card_event(vreader);

vcard_emul_replay_insertion_events(void)
{
    VReaderListEntry *current_entry;
    VReaderListEntry *next_entry = NULL;
    VReaderList *list = vreader_get_reader_list();
    for (current_entry = vreader_list_get_first(list); current_entry;
            current_entry = next_entry) {
        VReader *vreader = vreader_list_get_reader(current_entry);
        next_entry = vreader_list_get_next(current_entry);
        vreader_queue_card_event(vreader);
    }
}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+void *g_malloc(size_t size)
+
+{
+
+    char * p;
+
     size += 16;

     p = bsd_vmalloc(size);

void *g_malloc(size_t size)

{

    char * p;

    size += 16;

    p = bsd_vmalloc(size);

    *(size_t *)p = size;

    return p + 16;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void css_generate_sch_crws(uint8_t cssid, uint8_t ssid, uint16_t schid,
+
+                           int hotplugged, int add)
+
+{
+
     uint8_t guest_cssid;

     bool chain_crw;

void css_generate_sch_crws(uint8_t cssid, uint8_t ssid, uint16_t schid,

                           int hotplugged, int add)

{

    uint8_t guest_cssid;

    bool chain_crw;

    if (add && !hotplugged) {

        return;

    }

    if (channel_subsys.max_cssid == 0) {

        /* Default cssid shows up as 0. */

        guest_cssid = (cssid == channel_subsys.default_cssid) ? 0 : cssid;

    } else {

        /* Show real cssid to the guest. */

        guest_cssid = cssid;

    }

    /*

     * Only notify for higher subchannel sets/channel subsystems if the

     * guest has enabled it.

     */

    if ((ssid > channel_subsys.max_ssid) ||

        (guest_cssid > channel_subsys.max_cssid) ||

        ((channel_subsys.max_cssid == 0) &&

         (cssid != channel_subsys.default_cssid))) {

        return;

    }

    chain_crw = (channel_subsys.max_ssid > 0) ||

            (channel_subsys.max_cssid > 0);

    css_queue_crw(CRW_RSC_SUBCH, CRW_ERC_IPI, chain_crw ? 1 : 0, schid);

    if (chain_crw) {

        css_queue_crw(CRW_RSC_SUBCH, CRW_ERC_IPI, 0,

                      (guest_cssid << 8) | (ssid << 4));

    }

    /* RW_ERC_IPI --> clear pending interrupts */

    css_clear_io_interrupt(css_do_build_subchannel_id(cssid, ssid), schid);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void h264_v_loop_filter_chroma_intra_c(uint8_t *pix, int stride, int alpha, int beta)

 {

static void h264_v_loop_filter_chroma_intra_c(uint8_t *pix, int stride, int alpha, int beta)

{

    h264_loop_filter_chroma_intra_c(pix, stride, 1, alpha, beta);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void object_property_set_link(Object *obj, Object *value,
+
                               const char *name, Error **errp)

 {

void object_property_set_link(Object *obj, Object *value,

                              const char *name, Error **errp)

{

    object_property_set_str(obj, object_get_canonical_path(value),

                            name, errp);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     if (f->last_error == 0) {

         f->last_error = ret;
+
+    }

 }

static void qemu_file_set_error(QEMUFile *f, int ret)

{

    if (f->last_error == 0) {

        f->last_error = ret;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int udp_close(URLContext *h)
+
 {

     UDPContext *s = h->priv_data;

+

     if (s->is_multicast && (h->flags & AVIO_FLAG_READ))

static int udp_close(URLContext *h)

{

    UDPContext *s = h->priv_data;

    if (s->is_multicast && (h->flags & AVIO_FLAG_READ))

        udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr,(struct sockaddr *)&s->local_addr_storage);

    closesocket(s->udp_fd);

#if HAVE_PTHREAD_CANCEL

    if (s->thread_started) {

        int ret;

        pthread_cancel(s->circular_buffer_thread);

        ret = pthread_join(s->circular_buffer_thread, NULL);

        if (ret != 0)

            av_log(h, AV_LOG_ERROR, "pthread_join(): %s\n", strerror(ret));

        pthread_mutex_destroy(&s->mutex);

        pthread_cond_destroy(&s->cond);

    }

#endif

    av_fifo_freep(&s->fifo);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static inline void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0,
+
                                        const uint16_t *ubuf0, const uint16_t *ubuf1,

+                                       const uint16_t *vbuf0, const uint16_t *vbuf1,

+                                       const uint16_t *abuf0, uint8_t *dest,

                                        int dstW, int uvalpha, enum PixelFormat dstFormat,

static inline void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0,

                                       const uint16_t *ubuf0, const uint16_t *ubuf1,

                                       const uint16_t *vbuf0, const uint16_t *vbuf1,

                                       const uint16_t *abuf0, uint8_t *dest,

                                       int dstW, int uvalpha, enum PixelFormat dstFormat,

                                       int flags, int y)

{

    x86_reg uv_off = c->uv_off << 1;

    const uint16_t *buf1= buf0; //FIXME needed for RGB1/BGR1

    if (uvalpha < 2048) { // note this is not correct (shifts chrominance by 0.5 pixels) but it is a bit faster

        __asm__ volatile(

            "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"

            "mov        %4, %%"REG_b"               \n\t"

            "push %%"REG_BP"                        \n\t"

            YSCALEYUV2RGB1(%%REGBP, %5, %6)

            "pxor    %%mm7, %%mm7                   \n\t"

            WRITEBGR24(%%REGb, 8280(%5), %%REGBP)

            "pop %%"REG_BP"                         \n\t"

            "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"

            :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),

               "a" (&c->redDither), "m"(uv_off)

        );

    } else {

        __asm__ volatile(

            "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"

            "mov        %4, %%"REG_b"               \n\t"

            "push %%"REG_BP"                        \n\t"

            YSCALEYUV2RGB1b(%%REGBP, %5, %6)

            "pxor    %%mm7, %%mm7                   \n\t"

            WRITEBGR24(%%REGb, 8280(%5), %%REGBP)

            "pop %%"REG_BP"                         \n\t"

            "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"

            :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),

               "a" (&c->redDither), "m"(uv_off)

        );

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int qemu_rdma_registration_start(QEMUFile *f, void *opaque,
+
+                                        uint64_t flags)
+
+{
+
     QEMUFileRDMA *rfile = opaque;

     RDMAContext *rdma = rfile->rdma;

static int qemu_rdma_registration_start(QEMUFile *f, void *opaque,

                                        uint64_t flags)

{

    QEMUFileRDMA *rfile = opaque;

    RDMAContext *rdma = rfile->rdma;

    CHECK_ERROR_STATE();

    DDDPRINTF("start section: %" PRIu64 "\n", flags);

    qemu_put_be64(f, RAM_SAVE_FLAG_HOOK);

    qemu_fflush(f);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
                    ACPI_PCIHP_PROP_BSEL "' set");

         return;
+
+    }
+
+
+
     /* Don't send event when device is enabled during qemu machine creation:

      * it is present on boot, no hotplug event is necessary. We do send an

void acpi_pcihp_device_plug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState *s,

                               DeviceState *dev, Error **errp)

{

    PCIDevice *pdev = PCI_DEVICE(dev);

    int slot = PCI_SLOT(pdev->devfn);

    int bsel = acpi_pcihp_get_bsel(pdev->bus);

    if (bsel < 0) {

        error_setg(errp, "Unsupported bus. Bus doesn't have property '"

                   ACPI_PCIHP_PROP_BSEL "' set");

        return;

    }

    /* Don't send event when device is enabled during qemu machine creation:

     * it is present on boot, no hotplug event is necessary. We do send an

     * event when the device is disabled later. */

    if (!dev->hotplugged) {

        return;

    }

    s->acpi_pcihp_pci_status[bsel].up |= (1U << slot);

    acpi_send_event(DEVICE(hotplug_dev), ACPI_PCI_HOTPLUG_STATUS);

}


--- a/source.c
+++ b/source.c
@@ -11,7 +11,7 @@
     case TIFF_SHORT : return add_shorts_metadata(buf, count, name, sep, s);

     default         : return AVERROR_INVALIDDATA;
+
+    };
+
+}

static int add_metadata(const uint8_t **buf, int count, int type,

                        const char *name, const char *sep, TiffContext *s)

{

    switch(type) {

    case TIFF_DOUBLE: return add_doubles_metadata(buf, count, name, sep, s);

    case TIFF_SHORT : return add_shorts_metadata(buf, count, name, sep, s);

    default         : return AVERROR_INVALIDDATA;

    };

}


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

     sc = I2C_SLAVE_GET_CLASS(QLIST_FIRST(&bus->current_devs)->elt);
+
+    if (sc->recv) {
+
+        return sc->recv(QLIST_FIRST(&bus->current_devs)->elt);
+
     }

     return -1;

int i2c_recv(I2CBus *bus)

{

    I2CSlaveClass *sc;

    if ((QLIST_EMPTY(&bus->current_devs)) || (bus->broadcast)) {

        return -1;

    }

    sc = I2C_SLAVE_GET_CLASS(QLIST_FIRST(&bus->current_devs)->elt);

    if (sc->recv) {

        return sc->recv(QLIST_FIRST(&bus->current_devs)->elt);

    }

    return -1;

}


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

                                      const uint8_t *end,

+                                     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 && src < end) {

static const uint8_t *pcx_rle_decode(const uint8_t *src,

                                     const uint8_t *end,

                                     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 && src < end) {

            run   = 1;

            value = *src++;

            if (value >= 0xc0 && src < end) {

                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,6 +1,6 @@
 void page_set_flags(target_ulong start, target_ulong end, int flags)

+{

     target_ulong addr, len;

void page_set_flags(target_ulong start, target_ulong end, int flags)

{

    target_ulong addr, len;

    /* This function should never be called with addresses outside the

       guest address space.  If this assert fires, it probably indicates

       a missing call to h2g_valid.  */

#if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS

    assert(end < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS));

#endif

    assert(start < end);

    assert_memory_lock();

    start = start & TARGET_PAGE_MASK;

    end = TARGET_PAGE_ALIGN(end);

    if (flags & PAGE_WRITE) {

        flags |= PAGE_WRITE_ORG;

    }

    for (addr = start, len = end - start;

         len != 0;

         len -= TARGET_PAGE_SIZE, addr += TARGET_PAGE_SIZE) {

        PageDesc *p = page_find_alloc(addr >> TARGET_PAGE_BITS, 1);

        /* If the write protection bit is set, then we invalidate

           the code inside.  */

        if (!(p->flags & PAGE_WRITE) &&

            (flags & PAGE_WRITE) &&

            p->first_tb) {

            tb_invalidate_phys_page(addr, 0);

        }

        p->flags = flags;

    }

}


--- a/source.c
+++ b/source.c
@@ -14,11 +14,11 @@
      * the fifo-reading code, and the next byte of data
      * to read is always fifo[63 - fifopointer].
      */
+    int fptr;
+    int cs = prefetch_cs(s->prefetch.config1);
+    int is16bit = (((s->cs_file[cs].config[0] >> 12) & 3) != 0);
+    int bytes;
+    /* Don't believe the bit of the OMAP TRM that says that COUNTVALUE
      * and TRANSFERCOUNT are in units of 16 bit words for 16 bit NAND.
      * Instead believe the bit that says it is always a byte count.
      */

static void fill_prefetch_fifo(struct omap_gpmc_s *s)
{
    /* Fill the prefetch FIFO by reading data from NAND.
     * We do this synchronously, unlike the hardware which
     * will do this asynchronously. We refill when the
     * FIFO has THRESHOLD bytes free, and we always refill
     * as much data as possible starting at the top end
     * of the FIFO.
     * (We have to refill at THRESHOLD rather than waiting
     * for the FIFO to empty to allow for the case where
     * the FIFO size isn't an exact multiple of THRESHOLD
     * and we're doing DMA transfers.)
     * This means we never need to handle wrap-around in
     * the fifo-reading code, and the next byte of data
     * to read is always fifo[63 - fifopointer].
     */
    int fptr;
    int cs = prefetch_cs(s->prefetch.config1);
    int is16bit = (((s->cs_file[cs].config[0] >> 12) & 3) != 0);
    int bytes;
    /* Don't believe the bit of the OMAP TRM that says that COUNTVALUE
     * and TRANSFERCOUNT are in units of 16 bit words for 16 bit NAND.
     * Instead believe the bit that says it is always a byte count.
     */
    bytes = 64 - s->prefetch.fifopointer;
    if (bytes > s->prefetch.count) {
        bytes = s->prefetch.count;
    s->prefetch.count -= bytes;
    s->prefetch.fifopointer += bytes;
    fptr = 64 - s->prefetch.fifopointer;
    /* Move the existing data in the FIFO so it sits just
     * before what we're about to read in
     */
    while (fptr < (64 - bytes)) {
        s->prefetch.fifo[fptr] = s->prefetch.fifo[fptr + bytes];
        fptr++;
    while (fptr < 64) {
            uint32_t v = omap_nand_read(&s->cs_file[cs], 0, 2);
            s->prefetch.fifo[fptr++] = v & 0xff;
            s->prefetch.fifo[fptr++] = (v >> 8) & 0xff;
        } else {
            s->prefetch.fifo[fptr++] = omap_nand_read(&s->cs_file[cs], 0, 1);
    if (s->prefetch.startengine && (s->prefetch.count == 0)) {
        /* This was the final transfer: raise TERMINALCOUNTSTATUS */
        s->irqst |= 2;
        s->prefetch.startengine = 0;
    /* If there are any bytes in the FIFO at this point then
     * we must raise a DMA request (either this is a final part
     * transfer, or we filled the FIFO in which case we certainly
     * have THRESHOLD bytes available)
     */
    if (s->prefetch.fifopointer != 0) {
        omap_gpmc_dma_update(s, 1);
    omap_gpmc_int_update(s);


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static bool check_irqchip_in_kernel(void)

+{

+    if (kvm_irqchip_in_kernel()) {
+
         return true;

     }

static bool check_irqchip_in_kernel(void)

{

    if (kvm_irqchip_in_kernel()) {

        return true;

    }

    error_report("pci-assign: error: requires KVM with in-kernel irqchip "

                 "enabled");

    return false;

}


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

     case SIGSEGV:

+    case SIGBUS:
+
+    case SIGTRAP:
+
+        if (info->si_code && (info->si_segvflags & __ISR_VALID)) {

             /* ISR.W (write-access) is bit 33:  */

int cpu_signal_handler(int host_signum, void *pinfo, void *puc)

{

    siginfo_t *info = pinfo;

    ucontext_t *uc = puc;

    unsigned long ip;

    int is_write = 0;

    ip = uc->uc_mcontext.sc_ip;

    switch (host_signum) {

    case SIGILL:

    case SIGFPE:

    case SIGSEGV:

    case SIGBUS:

    case SIGTRAP:

        if (info->si_code && (info->si_segvflags & __ISR_VALID)) {

            /* ISR.W (write-access) is bit 33:  */

            is_write = (info->si_isr >> 33) & 1;

        }

        break;

    default:

        break;

    }

    return handle_cpu_signal(ip, (unsigned long)info->si_addr,

                             is_write,

                             (sigset_t *)&uc->uc_sigmask);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int get_bool(QEMUFile *f, void *pv, size_t size)

+{
+
     bool *v = pv;

     *v = qemu_get_byte(f);

static int get_bool(QEMUFile *f, void *pv, size_t size)

{

    bool *v = pv;

    *v = qemu_get_byte(f);

    return 0;

}