--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
             saddr.sin_addr.s_addr = so->so_faddr.s_addr;

     }
+
+    daddr.sin_addr = so->so_laddr;
+
+    daddr.sin_port = so->so_lport;
+

     return udp_output2(so, m, &saddr, &daddr, so->so_iptos);

int udp_output(struct socket *so, struct mbuf *m,

               struct sockaddr_in *addr)

{

    struct sockaddr_in saddr, daddr;

    saddr = *addr;

    if ((so->so_faddr.s_addr & htonl(0xffffff00)) == special_addr.s_addr) {

        if ((so->so_faddr.s_addr & htonl(0x000000ff)) == htonl(0xff))

            saddr.sin_addr.s_addr = alias_addr.s_addr;

        else if (addr->sin_addr.s_addr == loopback_addr.s_addr ||

                 ((so->so_faddr.s_addr & htonl(CTL_DNS)) == htonl(CTL_DNS)))

            saddr.sin_addr.s_addr = so->so_faddr.s_addr;

    }

    daddr.sin_addr = so->so_laddr;

    daddr.sin_port = so->so_lport;

    return udp_output2(so, m, &saddr, &daddr, so->so_iptos);

}


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

     struct MpegEncContext *s = avctx->priv_data;
+
     struct dxva2_picture_context *ctx_pic =

         s->current_picture_ptr->hwaccel_picture_private;

static int dxva2_mpeg2_end_frame(AVCodecContext *avctx)

{

    struct MpegEncContext *s = avctx->priv_data;

    struct dxva2_picture_context *ctx_pic =

        s->current_picture_ptr->hwaccel_picture_private;

    int ret;

    if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)

        return -1;

    ret = ff_dxva2_common_end_frame(avctx, &s->current_picture_ptr->f,

                                    &ctx_pic->pp, sizeof(ctx_pic->pp),

                                    &ctx_pic->qm, sizeof(ctx_pic->qm),

                                    commit_bitstream_and_slice_buffer);

    if (!ret)

        ff_mpeg_draw_horiz_band(s, 0, avctx->height);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static int ftp_get_file_handle(URLContext *h)

 {
+
+    FTPContext *s = h->priv_data;
+
+
+
     av_dlog(h, "ftp protocol get_file_handle\n");

static int ftp_get_file_handle(URLContext *h)

{

    FTPContext *s = h->priv_data;

    av_dlog(h, "ftp protocol get_file_handle\n");

    if (s->conn_data)

        return ffurl_get_file_handle(s->conn_data);

    return AVERROR(EIO);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static bool vhost_section(MemoryRegionSection *section)
+
 {

     return memory_region_is_ram(section->mr);

static bool vhost_section(MemoryRegionSection *section)

{

    return memory_region_is_ram(section->mr);

}


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

 {

+    if (pbdev->msix.available && pbdev->msix.table_bar == pcias &&
+
+        offset >= pbdev->msix.table_offset &&
+
+        offset <= pbdev->msix.table_offset +

                   (pbdev->msix.entries - 1) * PCI_MSIX_ENTRY_SIZE) {

static int trap_msix(S390PCIBusDevice *pbdev, uint64_t offset, uint8_t pcias)

{

    if (pbdev->msix.available && pbdev->msix.table_bar == pcias &&

        offset >= pbdev->msix.table_offset &&

        offset <= pbdev->msix.table_offset +

                  (pbdev->msix.entries - 1) * PCI_MSIX_ENTRY_SIZE) {

        return 1;

    } else {

        return 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,17 +1,17 @@
+static int qemu_chr_open_pp(QemuOpts *opts, CharDriverState **_chr)

 {

+    const char *filename = qemu_opt_get(opts, "path");
+
+    CharDriverState *chr;

     int fd;

+    fd = qemu_open(filename, O_RDWR);
+
     if (fd < 0) {

         return -errno;

static int qemu_chr_open_pp(QemuOpts *opts, CharDriverState **_chr)

{

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

    CharDriverState *chr;

    int fd;

    fd = qemu_open(filename, O_RDWR);

    if (fd < 0) {

        return -errno;

    }

    chr = g_malloc0(sizeof(CharDriverState));

    chr->opaque = (void *)(intptr_t)fd;

    chr->chr_write = null_chr_write;

    chr->chr_ioctl = pp_ioctl;

    *_chr = chr;

    return 0;

}


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

         s390_running_cpus++;

+        cs->halted = 0;
+
+        cs->exception_index = -1;
+
     }

 }

void s390_add_running_cpu(S390CPU *cpu)

{

    CPUState *cs = CPU(cpu);

    if (cs->halted) {

        s390_running_cpus++;

        cs->halted = 0;

        cs->exception_index = -1;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void pcx_palette(const uint8_t **src, uint32_t *dst, unsigned int pallen) {
+
     unsigned int i;
+

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

static void pcx_palette(const uint8_t **src, uint32_t *dst, unsigned int pallen) {

    unsigned int i;

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

        *dst++ = 0xFF000000 | bytestream_get_be24(src);

    if (pallen < 256)

        memset(dst, 0, (256 - pallen) * sizeof(*dst));

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void handle_port_status_write(EHCIState *s, int port, uint32_t val)

 {

static void handle_port_status_write(EHCIState *s, int port, uint32_t val)

{

    uint32_t *portsc = &s->portsc[port];

    USBDevice *dev = s->ports[port].dev;

    /* Clear rwc bits */

    *portsc &= ~(val & PORTSC_RWC_MASK);

    /* The guest may clear, but not set the PED bit */

    *portsc &= val | ~PORTSC_PED;

    /* POWNER is masked out by RO_MASK as it is RO when we've no companion */

    handle_port_owner_write(s, port, val);

    /* And finally apply RO_MASK */

    val &= PORTSC_RO_MASK;

    if ((val & PORTSC_PRESET) && !(*portsc & PORTSC_PRESET)) {

        trace_usb_ehci_port_reset(port, 1);

    }

    if (!(val & PORTSC_PRESET) &&(*portsc & PORTSC_PRESET)) {

        trace_usb_ehci_port_reset(port, 0);

        if (dev && dev->attached) {

            usb_port_reset(&s->ports[port]);

            *portsc &= ~PORTSC_CSC;

        }

        /*

         *  Table 2.16 Set the enable bit(and enable bit change) to indicate

         *  to SW that this port has a high speed device attached

         */

        if (dev && dev->attached && (dev->speedmask & USB_SPEED_MASK_HIGH)) {

            val |= PORTSC_PED;

        }

    }

    *portsc &= ~PORTSC_RO_MASK;

    *portsc |= val;

}


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

                 target_phys_addr_t addr)

+{
+
     return range_covers_byte(OMAP_IMIF_BASE, s->sram_size, addr);

 }

static int omap_validate_imif_addr(struct omap_mpu_state_s *s,

                target_phys_addr_t addr)

{

    return range_covers_byte(OMAP_IMIF_BASE, s->sram_size, addr);

}


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

 {

+    H264Context *h = avctx->priv_data;
+
+    int i;
+
+

     memset(h->delayed_pic, 0, sizeof(h->delayed_pic));

static void flush_dpb(AVCodecContext *avctx)

{

    H264Context *h = avctx->priv_data;

    int i;

    memset(h->delayed_pic, 0, sizeof(h->delayed_pic));

    ff_h264_flush_change(h);

    if (h->DPB)

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

            ff_h264_unref_picture(h, &h->DPB[i]);

    h->cur_pic_ptr = NULL;

    ff_h264_unref_picture(h, &h->cur_pic);

    h->mb_y = 0;

    ff_h264_free_tables(h);

    h->context_initialized = 0;

}


float64 int64_to_float64( int64 a STATUS_PARAM )

{

    flag zSign;

    if ( a == 0 ) return 0;

    if ( a == (sbits64) LIT64( 0x8000000000000000 ) ) {

        return packFloat64( 1, 0x43E, 0 );

    }

    zSign = ( a < 0 );

    return normalizeRoundAndPackFloat64( zSign, 0x43C, zSign ? - a : a STATUS_VAR );

}


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

         *ret_data = qobject_from_jsonf("{ 'enabled': true, 'clients': %p }",

+                                       QOBJECT(clist));
+
+        assert(*ret_data != NULL);
+
+

         if (vnc_server_info_put(qobject_to_qdict(*ret_data)) < 0) {

void do_info_vnc(Monitor *mon, QObject **ret_data)

{

    if (vnc_display == NULL || vnc_display->display == NULL) {

        *ret_data = qobject_from_jsonf("{ 'enabled': false }");

    } else {

        QDict *qdict;

        QList *clist;

        clist = qlist_new();

        if (vnc_display->clients) {

            VncState *client = vnc_display->clients;

            while (client) {

                qdict = do_info_vnc_client(mon, client);

                if (qdict)

                    qlist_append(clist, qdict);

                client = client->next;

            }

        }

        *ret_data = qobject_from_jsonf("{ 'enabled': true, 'clients': %p }",

                                       QOBJECT(clist));

        assert(*ret_data != NULL);

        if (vnc_server_info_put(qobject_to_qdict(*ret_data)) < 0) {

            qobject_decref(*ret_data);

            *ret_data = NULL;

        }

    }

}


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

     int type, len;

+    int max_score = 0;

static int dvbsub_probe(AVProbeData *p)

{

    int i, j, k;

    const uint8_t *end = p->buf + p->buf_size;

    int type, len;

    int max_score = 0;

    for(i=0; i<p->buf_size; i++){

        if (p->buf[i] == 0x0f) {

            const uint8_t *ptr = p->buf + i;

            uint8_t histogram[6] = {0};

            int min = 255;

            for(j=0; ptr + 6 < end; j++) {

                if (*ptr != 0x0f)

                    break;

                type    = ptr[1];

                //page_id = AV_RB16(ptr + 2);

                len     = AV_RB16(ptr + 4);

                if (type == 0x80) {

                    ;

                } else if (type >= 0x10 && type <= 0x14) {

                    histogram[type - 0x10] ++;

                } else

                    break;

                ptr += 6 + len;

            }

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

                min = FFMIN(min, histogram[k]);

            }

            if (min && j > max_score)

                max_score = j;

        }

    }

    if (max_score > 5)

        return AVPROBE_SCORE_EXTENSION;

    return 0;

}


static void decode_finish_row(H264Context *h, H264SliceContext *sl)

{

    int top            = 16 * (h->mb_y      >> FIELD_PICTURE(h));

    int pic_height     = 16 *  h->mb_height >> FIELD_PICTURE(h);

    int height         =  16      << FRAME_MBAFF(h);

    int deblock_border = (16 + 4) << FRAME_MBAFF(h);

    if (h->deblocking_filter) {

        if ((top + height) >= pic_height)

            height += deblock_border;

        top -= deblock_border;

    }

    if (top >= pic_height || (top + height) < 0)

        return;

    height = FFMIN(height, pic_height - top);

    if (top < 0) {

        height = top + height;

        top    = 0;

    }

    ff_h264_draw_horiz_band(h, sl, top, height);

    if (h->droppable)

        return;

    ff_thread_report_progress(&h->cur_pic_ptr->tf, top + height - 1,

                              h->picture_structure == PICT_BOTTOM_FIELD);

}


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

     assert(s->refcount_table_size <= INT_MAX / sizeof(uint64_t));
+
     refcount_table_size2 = s->refcount_table_size * sizeof(uint64_t);

     s->refcount_table = g_try_malloc(refcount_table_size2);

+

     if (s->refcount_table_size > 0) {

int qcow2_refcount_init(BlockDriverState *bs)

{

    BDRVQcowState *s = bs->opaque;

    unsigned int refcount_table_size2, i;

    int ret;

    assert(s->refcount_table_size <= INT_MAX / sizeof(uint64_t));

    refcount_table_size2 = s->refcount_table_size * sizeof(uint64_t);

    s->refcount_table = g_try_malloc(refcount_table_size2);

    if (s->refcount_table_size > 0) {

        if (s->refcount_table == NULL) {

            goto fail;

        }

        BLKDBG_EVENT(bs->file, BLKDBG_REFTABLE_LOAD);

        ret = bdrv_pread(bs->file, s->refcount_table_offset,

                         s->refcount_table, refcount_table_size2);

        if (ret != refcount_table_size2)

            goto fail;

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

            be64_to_cpus(&s->refcount_table[i]);

    }

    return 0;

 fail:

    return -ENOMEM;

}


--- 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
@@ -1,11 +1,11 @@
 static int av_thread_message_queue_recv_locked(AVThreadMessageQueue *mq,

                                                void *msg,
+
                                                unsigned flags)

 {
+
     while (!mq->err_recv && av_fifo_size(mq->fifo) < mq->elsize) {

         if ((flags & AV_THREAD_MESSAGE_NONBLOCK))

static int av_thread_message_queue_recv_locked(AVThreadMessageQueue *mq,

                                               void *msg,

                                               unsigned flags)

{

    while (!mq->err_recv && av_fifo_size(mq->fifo) < mq->elsize) {

        if ((flags & AV_THREAD_MESSAGE_NONBLOCK))

            return AVERROR(EAGAIN);

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

    }

    if (av_fifo_size(mq->fifo) < mq->elsize)

        return mq->err_recv;

    av_fifo_generic_read(mq->fifo, msg, mq->elsize, NULL);

    pthread_cond_signal(&mq->cond);

    return 0;

}


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

     DeviceState *dev;

+    SysBusDevice *sbd;

     FWCfgState *s;

FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,

                                 hwaddr data_addr, uint32_t data_width,

                                 hwaddr dma_addr, AddressSpace *dma_as)

{

    DeviceState *dev;

    SysBusDevice *sbd;

    FWCfgState *s;

    bool dma_requested = dma_addr && dma_as;

    dev = qdev_create(NULL, TYPE_FW_CFG_MEM);

    qdev_prop_set_uint32(dev, "data_width", data_width);

    if (!dma_requested) {

        qdev_prop_set_bit(dev, "dma_enabled", false);

    }

    fw_cfg_init1(dev);

    sbd = SYS_BUS_DEVICE(dev);

    sysbus_mmio_map(sbd, 0, ctl_addr);

    sysbus_mmio_map(sbd, 1, data_addr);

    s = FW_CFG(dev);

    if (s->dma_enabled) {

        s->dma_as = dma_as;

        s->dma_addr = 0;

        sysbus_mmio_map(sbd, 2, dma_addr);

    }

    return s;

}


PPC_OP(icbi)

{

    do_icbi();

    RETURN();

}


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

 {
+
+    RTCState *s = opaque;

+
     rtc_timer_update(s, s->next_periodic_time);

 #ifdef TARGET_I386

static void rtc_periodic_timer(void *opaque)

{

    RTCState *s = opaque;

    rtc_timer_update(s, s->next_periodic_time);

#ifdef TARGET_I386

    if ((s->cmos_data[RTC_REG_C] & 0xc0) && rtc_td_hack) {

        s->irq_coalesced++;

        return;

    }

#endif

    if (s->cmos_data[RTC_REG_B] & REG_B_PIE) {

        s->cmos_data[RTC_REG_C] |= 0xc0;

        rtc_irq_raise(s->irq);

    }

    if (s->cmos_data[RTC_REG_B] & REG_B_SQWE) {

        /* Not square wave at all but we don't want 2048Hz interrupts!

           Must be seen as a pulse.  */

        qemu_irq_raise(s->sqw_irq);

    }

}


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

 {

+    CPUState *cpu = ENV_GET_CPU(cpu_env);
+
+    int sig;
+
     TaskState *ts = cpu->opaque;

+
     if (!ts->signal_pending)

         return;

void process_pending_signals(CPUArchState *cpu_env)

{

    CPUState *cpu = ENV_GET_CPU(cpu_env);

    int sig;

    TaskState *ts = cpu->opaque;

    if (!ts->signal_pending)

        return;

    /* FIXME: This is not threadsafe.  */

    for(sig = 1; sig <= TARGET_NSIG; sig++) {

        if (ts->sigtab[sig - 1].pending) {

            handle_pending_signal(cpu_env, sig);

            return;

        }

    }

    /* if no signal is pending, just return */

    ts->signal_pending = 0;

    return;

}


--- a/source.c
+++ b/source.c
@@ -17,9 +17,9 @@
         level |= lpc->sci_level;

     }
+
+
+
+    qemu_set_irq(lpc->gsi[gsi], level);
+
 }

static void ich9_lpc_update_apic(ICH9LPCState *lpc, int gsi)

{

    int level = 0;

    assert(gsi >= ICH9_LPC_PIC_NUM_PINS);

    level |= pci_bus_get_irq_level(lpc->d.bus, ich9_gsi_to_pirq(gsi));

    if (gsi == lpc->sci_gsi) {

        level |= lpc->sci_level;

    }

    qemu_set_irq(lpc->gsi[gsi], level);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 rdt_new_extradata (void)
+
+{
+
     PayloadContext *rdt = av_mallocz(sizeof(PayloadContext));

rdt_new_extradata (void)

{

    PayloadContext *rdt = av_mallocz(sizeof(PayloadContext));

    av_open_input_stream(&rdt->rmctx, NULL, "", &rdt_demuxer, NULL);

    return rdt;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int color_distance(uint32_t a, uint32_t b)

+{
+
     int r = 0, d, i;

static int color_distance(uint32_t a, uint32_t b)

{

    int r = 0, d, i;

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

        d = ((a >> i) & 0xFF) - ((b >> i) & 0xFF);

        r += d * d;

    }

    return r;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int config(struct vf_instance *vf,
+
+    int width, int height, int d_width, int d_height,
+
+    unsigned int flags, unsigned int outfmt)

 {

static int config(struct vf_instance *vf,

    int width, int height, int d_width, int d_height,

    unsigned int flags, unsigned int outfmt)

{

    switch (vf->priv->mode) {

    case 0:

    case 3:

        return ff_vf_next_config(vf,width,height*2,d_width,d_height*2,flags,outfmt);

    case 1:            /* odd frames */

    case 2:            /* even frames */

    case 4:            /* alternate frame (height-preserving) interlacing */

        return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,17 +1,17 @@
+int css_do_ssch(SubchDev *sch, ORB *orb)

 {
+
     SCSW *s = &sch->curr_status.scsw;
+
+    PMCW *p = &sch->curr_status.pmcw;

     int ret;
+

     if (~(p->flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)) {
+
         ret = -ENODEV;

         goto out;
@@ -21,8 +21,8 @@

     if (s->ctrl & SCSW_STCTL_STATUS_PEND) {
+
+        ret = -EINPROGRESS;

         goto out;

int css_do_ssch(SubchDev *sch, ORB *orb)

{

    SCSW *s = &sch->curr_status.scsw;

    PMCW *p = &sch->curr_status.pmcw;

    int ret;

    if (~(p->flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)) {

        ret = -ENODEV;

        goto out;

    }

    if (s->ctrl & SCSW_STCTL_STATUS_PEND) {

        ret = -EINPROGRESS;

        goto out;

    }

    if (s->ctrl & (SCSW_FCTL_START_FUNC |

                   SCSW_FCTL_HALT_FUNC |

                   SCSW_FCTL_CLEAR_FUNC)) {

        ret = -EBUSY;

        goto out;

    }

    /* If monitoring is active, update counter. */

    if (channel_subsys.chnmon_active) {

        css_update_chnmon(sch);

    }

    sch->orb = *orb;

    sch->channel_prog = orb->cpa;

    /* Trigger the start function. */

    s->ctrl |= (SCSW_FCTL_START_FUNC | SCSW_ACTL_START_PEND);

    s->flags &= ~SCSW_FLAGS_MASK_PNO;

    ret = do_subchannel_work(sch);

out:

    return ret;

}


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

     union {
+
         double d;

         uint64_t i;

void do_fctiw (void)

{

    union {

        double d;

        uint64_t i;

    } p;

    /* XXX: higher bits are not supposed to be significant.

     *     to make tests easier, return the same as a real PowerPC 750 (aka G3)

     */

    p.i = float64_to_int32(FT0, &env->fp_status);

    p.i |= 0xFFF80000ULL << 32;

    FT0 = p.d;

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     buf = av_mallocz(sizeof(*buf));

     if (!buf) {
+
+        av_buffer_unref(&ret);
+
+        return NULL;
+
     }

static AVBufferRef *pool_alloc_buffer(AVBufferPool *pool)

{

    BufferPoolEntry *buf;

    AVBufferRef     *ret;

    ret = pool->alloc(pool->size);

    if (!ret)

        return NULL;

    buf = av_mallocz(sizeof(*buf));

    if (!buf) {

        av_buffer_unref(&ret);

        return NULL;

    }

    buf->data   = ret->buffer->data;

    buf->opaque = ret->buffer->opaque;

    buf->free   = ret->buffer->free;

    buf->pool   = pool;

    ret->buffer->opaque = buf;

    ret->buffer->free   = pool_release_buffer;

    avpriv_atomic_int_add_and_fetch(&pool->refcount, 1);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,18 +1,18 @@
 void rdma_start_outgoing_migration(void *opaque,

+                            const char *host_port, Error **errp)
+
 {

+    MigrationState *s = opaque;

     Error *local_err = NULL, **temp = &local_err;
+
     RDMAContext *rdma = qemu_rdma_data_init(host_port, &local_err);

     int ret = 0;

+

     if (rdma == NULL) {

@@ -20,9 +20,9 @@

         goto err;

+    }

+

     ret = qemu_rdma_source_init(rdma, &local_err,

void rdma_start_outgoing_migration(void *opaque,

                            const char *host_port, Error **errp)

{

    MigrationState *s = opaque;

    Error *local_err = NULL, **temp = &local_err;

    RDMAContext *rdma = qemu_rdma_data_init(host_port, &local_err);

    int ret = 0;

    if (rdma == NULL) {

        ERROR(temp, "Failed to initialize RDMA data structures! %d", ret);

        goto err;

    }

    ret = qemu_rdma_source_init(rdma, &local_err,

        s->enabled_capabilities[MIGRATION_CAPABILITY_RDMA_PIN_ALL]);

    if (ret) {

        goto err;

    }

    trace_rdma_start_outgoing_migration_after_rdma_source_init();

    ret = qemu_rdma_connect(rdma, &local_err);

    if (ret) {

        goto err;

    }

    trace_rdma_start_outgoing_migration_after_rdma_connect();

    s->to_dst_file = qemu_fopen_rdma(rdma, "wb");

    migrate_fd_connect(s);

    return;

err:

    error_propagate(errp, local_err);

    g_free(rdma);

    migrate_fd_error(s);

}


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

         int poc0 = h->ref_list[0][ref0].poc;

+        for(ref1=0; ref1 < h->ref_count[1]; ref1++){
+
+            int poc1 = h->ref_list[1][ref1].poc;
+
+            int td = av_clip(poc1 - poc0, -128, 127);

             if(td){

static void implicit_weight_table(H264Context *h){

    MpegEncContext * const s = &h->s;

    int ref0, ref1, i;

    int cur_poc = s->current_picture_ptr->poc;

    if(   h->ref_count[0] == 1 && h->ref_count[1] == 1

       && h->ref_list[0][0].poc + h->ref_list[1][0].poc == 2*cur_poc){

        h->use_weight= 0;

        h->use_weight_chroma= 0;

        return;

    }

    h->use_weight= 2;

    h->use_weight_chroma= 2;

    h->luma_log2_weight_denom= 5;

    h->chroma_log2_weight_denom= 5;

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

        h->luma_weight_flag[i]   = 0;

        h->chroma_weight_flag[i] = 0;

    }

    for(ref0=0; ref0 < h->ref_count[0]; ref0++){

        int poc0 = h->ref_list[0][ref0].poc;

        for(ref1=0; ref1 < h->ref_count[1]; ref1++){

            int poc1 = h->ref_list[1][ref1].poc;

            int td = av_clip(poc1 - poc0, -128, 127);

            if(td){

                int tb = av_clip(cur_poc - poc0, -128, 127);

                int tx = (16384 + (FFABS(td) >> 1)) / td;

                int dist_scale_factor = av_clip((tb*tx + 32) >> 6, -1024, 1023) >> 2;

                if(dist_scale_factor < -64 || dist_scale_factor > 128)

                    h->implicit_weight[ref0][ref1] = 32;

                else

                    h->implicit_weight[ref0][ref1] = 64 - dist_scale_factor;

            }else

                h->implicit_weight[ref0][ref1] = 32;

        }

    }

}


static int htab_save_complete(QEMUFile *f, void *opaque)

{

    sPAPRMachineState *spapr = opaque;

    /* Iteration header */

    qemu_put_be32(f, 0);

    if (!spapr->htab) {

        int rc;

        assert(kvm_enabled());

        rc = spapr_check_htab_fd(spapr);

        if (rc < 0) {

            return rc;

        }

        rc = kvmppc_save_htab(f, spapr->htab_fd, MAX_KVM_BUF_SIZE, -1);

        if (rc < 0) {

            return rc;

        }

        close(spapr->htab_fd);

        spapr->htab_fd = -1;

    } else {

        htab_save_later_pass(f, spapr, -1);

    }

    /* End marker */

    qemu_put_be32(f, 0);

    qemu_put_be16(f, 0);

    qemu_put_be16(f, 0);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+TPMVersion tpm_tis_get_tpm_version(Object *obj)
 {
     TPMState *s = TPM(obj);
     return tpm_backend_get_tpm_version(s->be_driver);


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

     if (unlikely(ctx->mem_idx)) {
+
+        TCGv_i32 t0;
+
+        tcg_gen_qemu_ld32u(arg1, arg2, ctx->mem_idx);
+
         t0 = tcg_temp_new_i32();

         tcg_gen_trunc_tl_i32(t0, arg1);

static always_inline void gen_qemu_ld32s(DisasContext *ctx, TCGv arg1, TCGv arg2)

{

    if (unlikely(ctx->mem_idx)) {

        TCGv_i32 t0;

        tcg_gen_qemu_ld32u(arg1, arg2, ctx->mem_idx);

        t0 = tcg_temp_new_i32();

        tcg_gen_trunc_tl_i32(t0, arg1);

        tcg_gen_bswap_i32(t0, t0);

        tcg_gen_ext_i32_tl(arg1, t0);

        tcg_temp_free_i32(t0);

    } else

        tcg_gen_qemu_ld32s(arg1, arg2, ctx->mem_idx);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void test_parse_invalid_path(void)
+
+{
+
+    g_test_trap_subprocess ("/logging/parse_invalid_path/subprocess", 0, 0);

     g_test_trap_assert_passed();

static void test_parse_invalid_path(void)

{

    g_test_trap_subprocess ("/logging/parse_invalid_path/subprocess", 0, 0);

    g_test_trap_assert_passed();

    g_test_trap_assert_stdout("");

    g_test_trap_assert_stderr("Bad logfile format: /tmp/qemu-%d%d.log\n");

}


--- a/source.c
+++ b/source.c
@@ -2,11 +2,11 @@
 {
     int w;
     if (blit_is_unsafe(s, true)) {
+        return 0;
+    }
+    s->cirrus_blt_mode &= ~CIRRUS_BLTMODE_MEMSYSSRC;
+    s->cirrus_srcptr = &s->cirrus_bltbuf[0];
+    s->cirrus_srcptr_end = &s->cirrus_bltbuf[0];
     if (s->cirrus_blt_mode & CIRRUS_BLTMODE_PATTERNCOPY) {
 	if (s->cirrus_blt_mode & CIRRUS_BLTMODE_COLOREXPAND) {
 	    s->cirrus_blt_srcpitch = 8;

static int cirrus_bitblt_cputovideo(CirrusVGAState * s)
{
    int w;
    if (blit_is_unsafe(s, true)) {
        return 0;
    }
    s->cirrus_blt_mode &= ~CIRRUS_BLTMODE_MEMSYSSRC;
    s->cirrus_srcptr = &s->cirrus_bltbuf[0];
    s->cirrus_srcptr_end = &s->cirrus_bltbuf[0];
    if (s->cirrus_blt_mode & CIRRUS_BLTMODE_PATTERNCOPY) {
	if (s->cirrus_blt_mode & CIRRUS_BLTMODE_COLOREXPAND) {
	    s->cirrus_blt_srcpitch = 8;
	} else {
            /* XXX: check for 24 bpp */
	    s->cirrus_blt_srcpitch = 8 * 8 * s->cirrus_blt_pixelwidth;
	}
	s->cirrus_srccounter = s->cirrus_blt_srcpitch;
    } else {
	if (s->cirrus_blt_mode & CIRRUS_BLTMODE_COLOREXPAND) {
            w = s->cirrus_blt_width / s->cirrus_blt_pixelwidth;
            if (s->cirrus_blt_modeext & CIRRUS_BLTMODEEXT_DWORDGRANULARITY)
                s->cirrus_blt_srcpitch = ((w + 31) >> 5);
            else
                s->cirrus_blt_srcpitch = ((w + 7) >> 3);
	} else {
            /* always align input size to 32 bits */
	    s->cirrus_blt_srcpitch = (s->cirrus_blt_width + 3) & ~3;
	}
        s->cirrus_srccounter = s->cirrus_blt_srcpitch * s->cirrus_blt_height;
    }
    s->cirrus_srcptr = s->cirrus_bltbuf;
    s->cirrus_srcptr_end = s->cirrus_bltbuf + s->cirrus_blt_srcpitch;
    cirrus_update_memory_access(s);
    return 1;
}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
 static inline struct rgbvec interp_trilinear(const LUT3DContext *lut3d,
+
+                                             const struct rgbvec *s)
+
+{
+
+    const struct rgbvec d = {s->r - PREV(s->r), s->g - PREV(s->g), s->b - PREV(s->b)};
+
+    const struct rgbvec c000 = lut3d->lut[PREV(s->r)][PREV(s->g)][PREV(s->b)];
+
     const struct rgbvec c001 = lut3d->lut[PREV(s->r)][PREV(s->g)][NEXT(s->b)];

     const struct rgbvec c010 = lut3d->lut[PREV(s->r)][NEXT(s->g)][PREV(s->b)];

static inline struct rgbvec interp_trilinear(const LUT3DContext *lut3d,

                                             const struct rgbvec *s)

{

    const struct rgbvec d = {s->r - PREV(s->r), s->g - PREV(s->g), s->b - PREV(s->b)};

    const struct rgbvec c000 = lut3d->lut[PREV(s->r)][PREV(s->g)][PREV(s->b)];

    const struct rgbvec c001 = lut3d->lut[PREV(s->r)][PREV(s->g)][NEXT(s->b)];

    const struct rgbvec c010 = lut3d->lut[PREV(s->r)][NEXT(s->g)][PREV(s->b)];

    const struct rgbvec c011 = lut3d->lut[PREV(s->r)][NEXT(s->g)][NEXT(s->b)];

    const struct rgbvec c100 = lut3d->lut[NEXT(s->r)][PREV(s->g)][PREV(s->b)];

    const struct rgbvec c101 = lut3d->lut[NEXT(s->r)][PREV(s->g)][NEXT(s->b)];

    const struct rgbvec c110 = lut3d->lut[NEXT(s->r)][NEXT(s->g)][PREV(s->b)];

    const struct rgbvec c111 = lut3d->lut[NEXT(s->r)][NEXT(s->g)][NEXT(s->b)];

    const struct rgbvec c00  = lerp(&c000, &c100, d.r);

    const struct rgbvec c10  = lerp(&c010, &c110, d.r);

    const struct rgbvec c01  = lerp(&c001, &c101, d.r);

    const struct rgbvec c11  = lerp(&c011, &c111, d.r);

    const struct rgbvec c0   = lerp(&c00,  &c10,  d.g);

    const struct rgbvec c1   = lerp(&c01,  &c11,  d.g);

    const struct rgbvec c    = lerp(&c0,   &c1,   d.b);

    return c;

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     AVIStream *ast, *next_ast = next_st->priv_data;

     int64_t ts, next_ts, ts_min = INT64_MAX;
+
     AVStream *st, *sub_st = NULL;

     int i;

static AVStream *get_subtitle_pkt(AVFormatContext *s, AVStream *next_st,

                                  AVPacket *pkt)

{

    AVIStream *ast, *next_ast = next_st->priv_data;

    int64_t ts, next_ts, ts_min = INT64_MAX;

    AVStream *st, *sub_st = NULL;

    int i;

    next_ts = av_rescale_q(next_ast->frame_offset, next_st->time_base,

                           AV_TIME_BASE_Q);

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

        st  = s->streams[i];

        ast = st->priv_data;

        if (st->discard < AVDISCARD_ALL && ast->sub_pkt.data) {

            ts = av_rescale_q(ast->sub_pkt.dts, st->time_base, AV_TIME_BASE_Q);

            if (ts <= next_ts && ts < ts_min) {

                ts_min = ts;

                sub_st = st;

            }

        }

    }

    if (sub_st) {

        ast = sub_st->priv_data;

        *pkt = ast->sub_pkt;

        pkt->stream_index = sub_st->index;

        if (av_read_packet(ast->sub_ctx, &ast->sub_pkt) < 0)

            ast->sub_pkt.data = NULL;

    }

    return sub_st;

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
 void *grow_array(void *array, int elem_size, int *size, int new_size)

 {
+
     if (new_size >= INT_MAX / elem_size) {

         av_log(NULL, AV_LOG_ERROR, "Array too big.\n");

         exit(1);
+
     }

     if (*size < new_size) {

void *grow_array(void *array, int elem_size, int *size, int new_size)

{

    if (new_size >= INT_MAX / elem_size) {

        av_log(NULL, AV_LOG_ERROR, "Array too big.\n");

        exit(1);

    }

    if (*size < new_size) {

        uint8_t *tmp = av_realloc(array, new_size*elem_size);

        if (!tmp) {

            av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");

            exit(1);

        }

        memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

        *size = new_size;

        return tmp;

    }

    return array;

}


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

     int i;
+
+
+
+    for (i = 0; i < sdram->nbanks; i++) {
+
 #ifdef DEBUG_SDRAM

         printf("%s: Unmap RAM area " TARGET_FMT_plx " " TARGET_FMT_lx "\n",

static void sdram_unmap_bcr (ppc4xx_sdram_t *sdram)

{

    int i;

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

#ifdef DEBUG_SDRAM

        printf("%s: Unmap RAM area " TARGET_FMT_plx " " TARGET_FMT_lx "\n",

               __func__, sdram_base(sdram->bcr[i]), sdram_size(sdram->bcr[i]));

#endif

        cpu_register_physical_memory(sdram_base(sdram->bcr[i]),

                                     sdram_size(sdram->bcr[i]),

                                     IO_MEM_UNASSIGNED);

    }

}


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

     sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);

+    drck->set_signalled(drc);
+
 }

static void spapr_hotplug_set_signalled(uint32_t drc_index)

{

    sPAPRDRConnector *drc = spapr_drc_by_index(drc_index);

    sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);

    drck->set_signalled(drc);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static inline int get_chroma_qp(int chroma_qp_index_offset, int qscale){
+

     return chroma_qp[av_clip(qscale + chroma_qp_index_offset, 0, 51)];

static inline int get_chroma_qp(int chroma_qp_index_offset, int qscale){

    return chroma_qp[av_clip(qscale + chroma_qp_index_offset, 0, 51)];

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void generate_silence(uint8_t* buf, enum AVSampleFormat sample_fmt, size_t size)
+
+{
+
     int fill_char = 0x00;

     if (sample_fmt == AV_SAMPLE_FMT_U8)

static void generate_silence(uint8_t* buf, enum AVSampleFormat sample_fmt, size_t size)

{

    int fill_char = 0x00;

    if (sample_fmt == AV_SAMPLE_FMT_U8)

        fill_char = 0x80;

    memset(buf, fill_char, size);

}


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

 {

+    hc->dev = qpci_device_find(pcibus, devfn);
+
     g_assert(hc->dev != NULL);

     qpci_device_enable(hc->dev);

void qusb_pci_init_one(QPCIBus *pcibus, struct qhc *hc, uint32_t devfn, int bar)

{

    hc->dev = qpci_device_find(pcibus, devfn);

    g_assert(hc->dev != NULL);

    qpci_device_enable(hc->dev);

    hc->base = qpci_iomap(hc->dev, bar, NULL);

    g_assert(hc->base != NULL);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void blkverify_verify_readv(BlkverifyAIOCB *acb)
+
+{
+
     ssize_t offset = qemu_iovec_compare(acb->qiov, &acb->raw_qiov);

     if (offset != -1) {

static void blkverify_verify_readv(BlkverifyAIOCB *acb)

{

    ssize_t offset = qemu_iovec_compare(acb->qiov, &acb->raw_qiov);

    if (offset != -1) {

        blkverify_err(acb, "contents mismatch in sector %" PRId64,

                      acb->sector_num + (int64_t)(offset / BDRV_SECTOR_SIZE));

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void stw_be_phys(target_phys_addr_t addr, uint32_t val)

+{

     stw_phys_internal(addr, val, DEVICE_BIG_ENDIAN);

void stw_be_phys(target_phys_addr_t addr, uint32_t val)

{

    stw_phys_internal(addr, val, DEVICE_BIG_ENDIAN);

}


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

+{
+
+    Coroutine *next;
+

     trace_qemu_co_queue_next_bh();

static void qemu_co_queue_next_bh(void *opaque)

{

    Coroutine *next;

    trace_qemu_co_queue_next_bh();

    while ((next = QTAILQ_FIRST(&unlock_bh_queue))) {

        QTAILQ_REMOVE(&unlock_bh_queue, next, co_queue_next);

        qemu_coroutine_enter(next, NULL);

    }

}


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

     VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc);

+
+
+    vhost_user_stop(s);

     qemu_purge_queued_packets(nc);

static void vhost_user_cleanup(NetClientState *nc)

{

    VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc);

    vhost_user_stop(s);

    qemu_purge_queued_packets(nc);

}


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

         if (EXTERNAL_AVX(cpu_flags)) {

+            vol->scale_samples = ff_scale_samples_s32_avx;
+
+            vol->samples_align = 8;
+
+        }

     }

av_cold void ff_volume_init_x86(VolumeContext *vol)

{

    int cpu_flags = av_get_cpu_flags();

    enum AVSampleFormat sample_fmt = av_get_packed_sample_fmt(vol->sample_fmt);

    if (sample_fmt == AV_SAMPLE_FMT_S16) {

        if (EXTERNAL_SSE2(cpu_flags) && vol->volume_i < 32768) {

            vol->scale_samples = ff_scale_samples_s16_sse2;

            vol->samples_align = 8;

        }

    } else if (sample_fmt == AV_SAMPLE_FMT_S32) {

        if (EXTERNAL_SSE2(cpu_flags)) {

            vol->scale_samples = ff_scale_samples_s32_sse2;

            vol->samples_align = 4;

        }

        if (EXTERNAL_SSSE3(cpu_flags) && cpu_flags & AV_CPU_FLAG_ATOM) {

            vol->scale_samples = ff_scale_samples_s32_ssse3_atom;

            vol->samples_align = 4;

        }

        if (EXTERNAL_AVX(cpu_flags)) {

            vol->scale_samples = ff_scale_samples_s32_avx;

            vol->samples_align = 8;

        }

    }

}


static void mxf_read_pixel_layout(AVIOContext *pb, MXFDescriptor *descriptor)

{

    int code, value, ofs = 0;

    char layout[16] = {0}; /* not for printing, may end up not terminated on purpose */

    do {

        code = avio_r8(pb);

        value = avio_r8(pb);

        av_dlog(NULL, "pixel layout: code %#x\n", code);

        if (ofs <= 14) {

            layout[ofs++] = code;

            layout[ofs++] = value;

        }

    } while (code != 0); /* SMPTE 377M E.2.46 */

    ff_mxf_decode_pixel_layout(layout, &descriptor->pix_fmt);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static int http_send_data(HTTPContext *c, long cur_time)

 {
+
     int len, ret;

static int http_send_data(HTTPContext *c, long cur_time)

{

    int len, ret;

    while (c->buffer_ptr >= c->buffer_end) {

        ret = http_prepare_data(c, cur_time);

        if (ret < 0)

            return -1;

        else if (ret == 0) {

            continue;

        } else {

            /* state change requested */

            return 0;

        }

    }

    if (c->buffer_end > c->buffer_ptr) {

        len = write(c->fd, c->buffer_ptr, c->buffer_end - c->buffer_ptr);

        if (len < 0) {

            if (errno != EAGAIN && errno != EINTR) {

                /* error : close connection */

                return -1;

            }

        } else {

            c->buffer_ptr += len;

            c->data_count += len;

            if (c->stream)

                c->stream->bytes_served += len;

        }

    }

    return 0;

}


static void vc1_put_ver_16b_shift2_mmx(int16_t *dst,

                                       const uint8_t *src, x86_reg stride,

                                       int rnd, int64_t shift)

{

    __asm__ volatile(

        "mov       $3, %%"REG_c"           \n\t"

        LOAD_ROUNDER_MMX("%5")

        "movq      "MANGLE(ff_pw_9)", %%mm6 \n\t"

        "1:                                \n\t"

        "movd      (%0), %%mm2             \n\t"

        "add       %2, %0                  \n\t"

        "movd      (%0), %%mm3             \n\t"

        "punpcklbw %%mm0, %%mm2            \n\t"

        "punpcklbw %%mm0, %%mm3            \n\t"

        SHIFT2_LINE(  0, 1, 2, 3, 4)

        SHIFT2_LINE( 24, 2, 3, 4, 1)

        SHIFT2_LINE( 48, 3, 4, 1, 2)

        SHIFT2_LINE( 72, 4, 1, 2, 3)

        SHIFT2_LINE( 96, 1, 2, 3, 4)

        SHIFT2_LINE(120, 2, 3, 4, 1)

        SHIFT2_LINE(144, 3, 4, 1, 2)

        SHIFT2_LINE(168, 4, 1, 2, 3)

        "sub       %6, %0                  \n\t"

        "add       $8, %1                  \n\t"

        "dec       %%"REG_c"               \n\t"

        "jnz 1b                            \n\t"

        : "+r"(src), "+r"(dst)

        : "r"(stride), "r"(-2*stride),

          "m"(shift), "m"(rnd), "r"(9*stride-4)

          NAMED_CONSTRAINTS_ADD(ff_pw_9)

        : "%"REG_c, "memory"

    );

}


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

 {

+    uint64_t interval; /* in 1/16 seconds */

+
+
+    if (NVRAM->wd_timer != NULL) {
+
         qemu_del_timer(NVRAM->wd_timer);

 	NVRAM->wd_timer = NULL;

static void set_up_watchdog (m48t59_t *NVRAM, uint8_t value)

{

    uint64_t interval; /* in 1/16 seconds */

    if (NVRAM->wd_timer != NULL) {

        qemu_del_timer(NVRAM->wd_timer);

	NVRAM->wd_timer = NULL;

    }

    NVRAM->buffer[0x1FF0] &= ~0x80;

    if (value != 0) {

	interval = (1 << (2 * (value & 0x03))) * ((value >> 2) & 0x1F);

	qemu_mod_timer(NVRAM->wd_timer, ((uint64_t)time(NULL) * 1000) +

		       ((interval * 1000) >> 4));

    }

}


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

     }

+
+
+    /* non-wrapping path or overwrapping enabled */
+
+    cpu_physical_memory_write( s->RxBuf + s->RxBufAddr, buf, size );

static void rtl8139_write_buffer(RTL8139State *s, const void *buf, int size)

{

    if (s->RxBufAddr + size > s->RxBufferSize)

    {

        int wrapped = MOD2(s->RxBufAddr + size, s->RxBufferSize);

        /* write packet data */

        if (wrapped && s->RxBufferSize < 65536 && !rtl8139_RxWrap(s))

        {

            DEBUG_PRINT((">>> RTL8139: rx packet wrapped in buffer at %d\n", size-wrapped));

            if (size > wrapped)

            {

                cpu_physical_memory_write( s->RxBuf + s->RxBufAddr,

                                           buf, size-wrapped );

            }

            /* reset buffer pointer */

            s->RxBufAddr = 0;

            cpu_physical_memory_write( s->RxBuf + s->RxBufAddr,

                                       buf + (size-wrapped), wrapped );

            s->RxBufAddr = wrapped;

            return;

        }

    }

    /* non-wrapping path or overwrapping enabled */

    cpu_physical_memory_write( s->RxBuf + s->RxBufAddr, buf, size );

    s->RxBufAddr += size;

}


--- a/source.c
+++ b/source.c
@@ -5,10 +5,10 @@
     int i;

     NICInfo *nic;
+
+
+
+    for (i = 0; i < MAX_NICS; i++) {

         nic = &nd_table[i];

void destroy_nic(dev_match_fn *match_fn, void *arg)

{

    int i;

    NICInfo *nic;

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

        nic = &nd_table[i];

        if (nic->used) {

            if (nic->private && match_fn(nic->private, arg)) {

                if (nic->vlan) {

                    VLANClientState *vc;

                    vc = qemu_find_vlan_client(nic->vlan, nic->private);

                    if (vc)

                        qemu_del_vlan_client(vc);

                }

                net_client_uninit(nic);

            }

        }

    }

}


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

 {

+    slirp_init_once();
+
+
+
+    link_up = 1;

     slirp_restrict = restricted;

void slirp_init(int restricted, struct in_addr vnetwork,

                struct in_addr vnetmask, struct in_addr vhost,

                const char *vhostname, const char *tftp_path,

                const char *bootfile, struct in_addr vdhcp_start,

                struct in_addr vnameserver)

{

    slirp_init_once();

    link_up = 1;

    slirp_restrict = restricted;

    if_init();

    ip_init();

    /* Initialise mbufs *after* setting the MTU */

    m_init();

    vnetwork_addr = vnetwork;

    vnetwork_mask = vnetmask;

    vhost_addr = vhost;

    if (vhostname) {

        pstrcpy(slirp_hostname, sizeof(slirp_hostname), vhostname);

    }

    qemu_free(tftp_prefix);

    tftp_prefix = NULL;

    if (tftp_path) {

        tftp_prefix = qemu_strdup(tftp_path);

    }

    qemu_free(bootp_filename);

    bootp_filename = NULL;

    if (bootfile) {

        bootp_filename = qemu_strdup(bootfile);

    }

    vdhcp_startaddr = vdhcp_start;

    vnameserver_addr = vnameserver;

    register_savevm("slirp", 0, 1, slirp_state_save, slirp_state_load, NULL);

}


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

     for (multiple8_cnt = 2; multiple8_cnt--;) {
+
+        avc_luma_mid_8w_msa(src, src_stride, dst, dst_stride, height);
+
+        src += 8;
+
         dst += 8;

     }

static void avc_luma_mid_16w_msa(const uint8_t *src, int32_t src_stride,

                                 uint8_t *dst, int32_t dst_stride,

                                 int32_t height)

{

    uint32_t multiple8_cnt;

    for (multiple8_cnt = 2; multiple8_cnt--;) {

        avc_luma_mid_8w_msa(src, src_stride, dst, dst_stride, height);

        src += 8;

        dst += 8;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void usb_serial_event(void *opaque, int event)

 {
+
+    USBSerialState *s = opaque;
+
+
+
     switch (event) {

         case CHR_EVENT_BREAK:

static void usb_serial_event(void *opaque, int event)

{

    USBSerialState *s = opaque;

    switch (event) {

        case CHR_EVENT_BREAK:

            s->event_trigger |= FTDI_BI;

            break;

        case CHR_EVENT_FOCUS:

            break;

        case CHR_EVENT_OPENED:

            usb_serial_reset(s);

            /* TODO: Reset USB port */

            break;

    }

}


--- a/source.c
+++ b/source.c
@@ -19,7 +19,7 @@
         error_printf_unless_qmp(

             "firstport value of %u makes companion take ports %u - %u, which "
+
             "is outside of the valid range of 0 - %u\n", firstport, firstport,

             firstport + portcount - 1, NB_PORTS - 1);

static int ehci_register_companion(USBBus *bus, USBPort *ports[],

                                   uint32_t portcount, uint32_t firstport)

{

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

    uint32_t i;

    if (firstport + portcount > NB_PORTS) {

        qerror_report(QERR_INVALID_PARAMETER_VALUE, "firstport",

                      "firstport on masterbus");

        error_printf_unless_qmp(

            "firstport value of %u makes companion take ports %u - %u, which "

            "is outside of the valid range of 0 - %u\n", firstport, firstport,

            firstport + portcount - 1, NB_PORTS - 1);

        return -1;

    }

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

        if (s->companion_ports[firstport + i]) {

            qerror_report(QERR_INVALID_PARAMETER_VALUE, "masterbus",

                          "an USB masterbus");

            error_printf_unless_qmp(

                "port %u on masterbus %s already has a companion assigned\n",

                firstport + i, bus->qbus.name);

            return -1;

        }

    }

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

        s->companion_ports[firstport + i] = ports[i];

        s->ports[firstport + i].speedmask |=

            USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL;

        /* Ensure devs attached before the initial reset go to the companion */

        s->portsc[firstport + i] = PORTSC_POWNER;

    }

    s->companion_count++;

    s->mmio[0x05] = (s->companion_count << 4) | portcount;

    return 0;

}


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

             break;

+        /* record url */
+
+        q = buf;
+
+        for(;;) {

             if (c == URL_EOF || redir_isspace(c))

int redir_open(AVFormatContext **ic_ptr, ByteIOContext *f)

{

    char buf[4096], *q;

    int c;

    AVFormatContext *ic = NULL;

    /* parse each URL and try to open it */

    c = url_fgetc(f);

    while (c != URL_EOF) {

        /* skip spaces */

        for(;;) {

            if (!redir_isspace(c))

                break;

            c = url_fgetc(f);

        }

        if (c == URL_EOF)

            break;

        /* record url */

        q = buf;

        for(;;) {

            if (c == URL_EOF || redir_isspace(c))

                break;

            if ((q - buf) < sizeof(buf) - 1)

                *q++ = c;

            c = url_fgetc(f);

        }

        *q = '\0';

        //printf("URL='%s'\n", buf);

        /* try to open the media file */

        if (av_open_input_file(&ic, buf, NULL, 0, NULL) == 0)

            break;

    }

    *ic_ptr = ic;

    if (!ic)

        return AVERROR(EIO);

    else

        return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void add_user_command(char *optarg)
+
+{
+
+    ncmdline++;
+
     cmdline = realloc(cmdline, ncmdline * sizeof(char *));

     if (!cmdline) {

void add_user_command(char *optarg)

{

    ncmdline++;

    cmdline = realloc(cmdline, ncmdline * sizeof(char *));

    if (!cmdline) {

        perror("realloc");

        exit(1);

    }

    cmdline[ncmdline-1] = optarg;

}


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

 {

+    SubchSet *set;

     uint8_t real_cssid;

bool css_schid_final(int m, uint8_t cssid, uint8_t ssid, uint16_t schid)

{

    SubchSet *set;

    uint8_t real_cssid;

    real_cssid = (!m && (cssid == 0)) ? channel_subsys.default_cssid : cssid;

    if (real_cssid > MAX_CSSID || ssid > MAX_SSID ||

        !channel_subsys.css[real_cssid] ||

        !channel_subsys.css[real_cssid]->sch_set[ssid]) {

        return true;

    }

    set = channel_subsys.css[real_cssid]->sch_set[ssid];

    return schid > find_last_bit(set->schids_used,

                                 (MAX_SCHID + 1) / sizeof(unsigned long));

}


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

     events.exception.injected = (env->exception_injected >= 0);

+    events.exception.nr = env->exception_injected;
+
+    events.exception.has_error_code = env->has_error_code;
+
+    events.exception.error_code = env->error_code;

     events.exception.pad = 0;

static int kvm_put_vcpu_events(X86CPU *cpu, int level)

{

    CPUX86State *env = &cpu->env;

    struct kvm_vcpu_events events;

    if (!kvm_has_vcpu_events()) {

        return 0;

    }

    events.exception.injected = (env->exception_injected >= 0);

    events.exception.nr = env->exception_injected;

    events.exception.has_error_code = env->has_error_code;

    events.exception.error_code = env->error_code;

    events.exception.pad = 0;

    events.interrupt.injected = (env->interrupt_injected >= 0);

    events.interrupt.nr = env->interrupt_injected;

    events.interrupt.soft = env->soft_interrupt;

    events.nmi.injected = env->nmi_injected;

    events.nmi.pending = env->nmi_pending;

    events.nmi.masked = !!(env->hflags2 & HF2_NMI_MASK);

    events.nmi.pad = 0;

    events.sipi_vector = env->sipi_vector;

    events.flags = 0;

    if (level >= KVM_PUT_RESET_STATE) {

        events.flags |=

            KVM_VCPUEVENT_VALID_NMI_PENDING | KVM_VCPUEVENT_VALID_SIPI_VECTOR;

    }

    return kvm_vcpu_ioctl(CPU(cpu), KVM_SET_VCPU_EVENTS, &events);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void dmix_sub_c(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len)

 {
+
     int i;

static void dmix_sub_c(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len)

{

    int i;

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

        dst[i] -= mul15(src[i], coeff);

}


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

     if (avctx->sample_rate != 8000 || avctx->channels != 1 ||
+
+        (avctx->bit_rate != 16000 && avctx->bit_rate != 24000 &&
+
+	 avctx->bit_rate != 32000 && avctx->bit_rate != 40000)) {
+
         av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n");

 	return -1;

static int g726_init(AVCodecContext * avctx)

{

    AVG726Context* c = (AVG726Context*)avctx->priv_data;

    if (avctx->sample_rate != 8000 || avctx->channels != 1 ||

        (avctx->bit_rate != 16000 && avctx->bit_rate != 24000 &&

	 avctx->bit_rate != 32000 && avctx->bit_rate != 40000)) {

        av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n");

	return -1;

    }

    g726_reset(&c->c, avctx->bit_rate);

    c->code_size = c->c.tbls->bits;

    c->bit_buffer = 0;

    c->bits_left = 0;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -9,9 +9,9 @@
         .u.mchk.cr14 = 1 << 28,

         .u.mchk.mcic = build_channel_report_mcic(),
+
+    };
+
+    kvm_s390_floating_interrupt(&irq);

 }

void kvm_s390_crw_mchk(void)

{

    struct kvm_s390_irq irq = {

        .type = KVM_S390_MCHK,

        .u.mchk.cr14 = 1 << 28,

        .u.mchk.mcic = build_channel_report_mcic(),

    };

    kvm_s390_floating_interrupt(&irq);

}


--- a/source.c
+++ b/source.c
@@ -42,11 +42,11 @@
     if (kvm_enabled()) {

         int ret = kvmppc_set_compat(cpu, cpu->compat_pvr);
+
+        if (ret < 0) {
+
+            error_setg_errno(errp, -ret,
+
                              "Unable to set CPU compatibility mode in KVM");

         }

void ppc_set_compat(PowerPCCPU *cpu, uint32_t compat_pvr, Error **errp)

{

    const CompatInfo *compat = compat_by_pvr(compat_pvr);

    CPUPPCState *env = &cpu->env;

    PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);

    uint64_t pcr;

    if (!compat_pvr) {

        pcr = 0;

    } else if (!compat) {

        error_setg(errp, "Unknown compatibility PVR 0x%08"PRIx32, compat_pvr);

    } else {

        pcr = compat->pcr;

    }

    cpu->compat_pvr = compat_pvr;

    env->spr[SPR_PCR] = pcr & pcc->pcr_mask;

    if (kvm_enabled()) {

        int ret = kvmppc_set_compat(cpu, cpu->compat_pvr);

        if (ret < 0) {

            error_setg_errno(errp, -ret,

                             "Unable to set CPU compatibility mode in KVM");

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 opts_start_struct(Visitor *v, void **obj, const char *kind,

+                  const char *name, size_t size, Error **errp)
+
+{
+
+    OptsVisitor *ov = DO_UPCAST(OptsVisitor, visitor, v);

     const QemuOpt *opt;

opts_start_struct(Visitor *v, void **obj, const char *kind,

                  const char *name, size_t size, Error **errp)

{

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

    const QemuOpt *opt;

    *obj = g_malloc0(size > 0 ? size : 1);

    if (ov->depth++ > 0) {

        return;

    }

    ov->unprocessed_opts = g_hash_table_new_full(&g_str_hash, &g_str_equal,

                                                 NULL, &destroy_list);

    QTAILQ_FOREACH(opt, &ov->opts_root->head, next) {

        /* ensured by qemu-option.c::opts_do_parse() */

        assert(strcmp(opt->name, "id") != 0);

        opts_visitor_insert(ov->unprocessed_opts, opt);

    }

    if (ov->opts_root->id != NULL) {

        ov->fake_id_opt = g_malloc0(sizeof *ov->fake_id_opt);

        ov->fake_id_opt->name = "id";

        ov->fake_id_opt->str = ov->opts_root->id;

        opts_visitor_insert(ov->unprocessed_opts, ov->fake_id_opt);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline int64_t get_image_offset(BlockDriverState *bs, uint64_t offset,

                                        bool write)

@@ -11,7 +11,7 @@
     uint32_t pagetable_index, offset_in_block;

+
     pagetable_index = offset / s->block_size;

     offset_in_block = offset % s->block_size;

static inline int64_t get_image_offset(BlockDriverState *bs, uint64_t offset,

                                       bool write)

{

    BDRVVPCState *s = bs->opaque;

    uint64_t bitmap_offset, block_offset;

    uint32_t pagetable_index, offset_in_block;

    pagetable_index = offset / s->block_size;

    offset_in_block = offset % s->block_size;

    if (pagetable_index >= s->max_table_entries || s->pagetable[pagetable_index] == 0xffffffff)

        return -1; /* not allocated */

    bitmap_offset = 512 * (uint64_t) s->pagetable[pagetable_index];

    block_offset = bitmap_offset + s->bitmap_size + offset_in_block;

    /* We must ensure that we don't write to any sectors which are marked as

       unused in the bitmap. We get away with setting all bits in the block

       bitmap each time we write to a new block. This might cause Virtual PC to

       miss sparse read optimization, but it's not a problem in terms of

       correctness. */

    if (write && (s->last_bitmap_offset != bitmap_offset)) {

        uint8_t bitmap[s->bitmap_size];

        s->last_bitmap_offset = bitmap_offset;

        memset(bitmap, 0xff, s->bitmap_size);

        bdrv_pwrite_sync(bs->file, bitmap_offset, bitmap, s->bitmap_size);

    }

    return block_offset;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void set_bmc_global_enables(IPMIBmcSim *ibs,
+
                                    uint8_t *cmd, unsigned int cmd_len,

                                    uint8_t *rsp, unsigned int *rsp_len,

static void set_bmc_global_enables(IPMIBmcSim *ibs,

                                   uint8_t *cmd, unsigned int cmd_len,

                                   uint8_t *rsp, unsigned int *rsp_len,

                                   unsigned int max_rsp_len)

{

    IPMI_CHECK_CMD_LEN(3);

    set_global_enables(ibs, cmd[2]);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+void bdrv_set_read_only(BlockDriverState *bs, bool read_only)

 {

void bdrv_set_read_only(BlockDriverState *bs, bool read_only)

{

    bs->read_only = read_only;

}


static void test_visitor_in_native_list_string(TestInputVisitorData *data,

                                               const void *unused)

{

    UserDefNativeListUnion *cvalue = NULL;

    strList *elem = NULL;

    Visitor *v;

    GString *gstr_list = g_string_new("");

    GString *gstr_union = g_string_new("");

    int i;

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

        g_string_append_printf(gstr_list, "'%d'", i);

        if (i != 31) {

            g_string_append(gstr_list, ", ");

        }

    }

    g_string_append_printf(gstr_union,  "{ 'type': 'string', 'data': [ %s ] }",

                           gstr_list->str);

    v = visitor_input_test_init_raw(data,  gstr_union->str);

    visit_type_UserDefNativeListUnion(v, NULL, &cvalue, &error_abort);

    g_assert(cvalue != NULL);

    g_assert_cmpint(cvalue->type, ==, USER_DEF_NATIVE_LIST_UNION_KIND_STRING);

    for (i = 0, elem = cvalue->u.string.data; elem; elem = elem->next, i++) {

        gchar str[8];

        sprintf(str, "%d", i);

        g_assert_cmpstr(elem->value, ==, str);

    }

    g_string_free(gstr_union, true);

    g_string_free(gstr_list, true);

    qapi_free_UserDefNativeListUnion(cvalue);

}


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

     CPUX86State *env = &cpu->env;

+    struct kvm_fpu fpu;
+
+    int i;
+
+

     memset(&fpu, 0, sizeof fpu);

static int kvm_put_fpu(X86CPU *cpu)

{

    CPUX86State *env = &cpu->env;

    struct kvm_fpu fpu;

    int i;

    memset(&fpu, 0, sizeof fpu);

    fpu.fsw = env->fpus & ~(7 << 11);

    fpu.fsw |= (env->fpstt & 7) << 11;

    fpu.fcw = env->fpuc;

    fpu.last_opcode = env->fpop;

    fpu.last_ip = env->fpip;

    fpu.last_dp = env->fpdp;

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

        fpu.ftwx |= (!env->fptags[i]) << i;

    }

    memcpy(fpu.fpr, env->fpregs, sizeof env->fpregs);

    memcpy(fpu.xmm, env->xmm_regs, sizeof env->xmm_regs);

    fpu.mxcsr = env->mxcsr;

    return kvm_vcpu_ioctl(CPU(cpu), KVM_SET_FPU, &fpu);

}


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

+void helper_cache(CPUMIPSState *env, target_ulong addr, uint32_t op)
+
+{
+
+#ifndef CONFIG_USER_ONLY

     target_ulong index = addr & 0x1fffffff;

MSA_ST_DF(DF_BYTE,   b, helper_ret_stb_mmu, oi, GETRA())

MSA_ST_DF(DF_HALF,   h, helper_ret_stw_mmu, oi, GETRA())

MSA_ST_DF(DF_WORD,   w, helper_ret_stl_mmu, oi, GETRA())

MSA_ST_DF(DF_DOUBLE, d, helper_ret_stq_mmu, oi, GETRA())

#else

MSA_ST_DF(DF_BYTE,   b, cpu_stb_data)

MSA_ST_DF(DF_HALF,   h, cpu_stw_data)

MSA_ST_DF(DF_WORD,   w, cpu_stl_data)

MSA_ST_DF(DF_DOUBLE, d, cpu_stq_data)

#endif

void helper_cache(CPUMIPSState *env, target_ulong addr, uint32_t op)

{

#ifndef CONFIG_USER_ONLY

    target_ulong index = addr & 0x1fffffff;

    if (op == 9) {

        /* Index Store Tag */

        memory_region_dispatch_write(env->itc_tag, index, env->CP0_TagLo,

                                     8, MEMTXATTRS_UNSPECIFIED);

    } else if (op == 5) {

        /* Index Load Tag */

        memory_region_dispatch_read(env->itc_tag, index, &env->CP0_TagLo,

                                    8, MEMTXATTRS_UNSPECIFIED);

    }

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+uint64_t ldq_le_phys(target_phys_addr_t addr)

 {

uint64_t ldq_le_phys(target_phys_addr_t addr)

{

    return ldq_phys_internal(addr, DEVICE_LITTLE_ENDIAN);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 QObject *qmp_output_get_qobject(QmpOutputVisitor *qov)

 {
+
+    /* FIXME: we should require that a visit occurred, and that it is
+
+     * complete (no starts without a matching end) */
+
     QObject *obj = qov->root;

     if (obj) {

QObject *qmp_output_get_qobject(QmpOutputVisitor *qov)

{

    /* FIXME: we should require that a visit occurred, and that it is

     * complete (no starts without a matching end) */

    QObject *obj = qov->root;

    if (obj) {

        qobject_incref(obj);

    } else {

        obj = qnull();

    }

    return obj;

}


--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
     if (!ret)

         return 0;
+
+fail:
+
+    ffurl_close(*puc);
+
     *puc = NULL;

     return ret;

int ffurl_open(URLContext **puc, const char *filename, int flags,

               const AVIOInterruptCB *int_cb, AVDictionary **options)

{

    int ret = ffurl_alloc(puc, filename, flags, int_cb);

    if (ret < 0)

        return ret;

    if (options && (*puc)->prot->priv_data_class &&

        (ret = av_opt_set_dict((*puc)->priv_data, options)) < 0)

        goto fail;

    if ((ret = av_opt_set_dict(*puc, options)) < 0)

        goto fail;

    ret = ffurl_connect(*puc, options);

    if (!ret)

        return 0;

fail:

    ffurl_close(*puc);

    *puc = NULL;

    return ret;

}


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

 {

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

                                ptrdiff_t stride)

{

    avc_luma_hz_8w_msa(src - 2, stride, dst, stride, 8);

}


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

+                                uint16_t valid_mask)
+
+{

     XenPTRegInfo *reg = cfg_entry->reg;

+    uint16_t writable_mask = 0;

     uint16_t throughable_mask = 0;

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

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

     }

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

                                uint16_t *val, uint16_t dev_value,

                                uint16_t valid_mask)

{

    XenPTRegInfo *reg = cfg_entry->reg;

    uint16_t writable_mask = 0;

    uint16_t throughable_mask = 0;

    uint16_t emu_mask = reg->emu_mask;

    if (s->is_virtfn) {

        emu_mask |= PCI_COMMAND_MEMORY;

    }

    /* modify emulate register */

    writable_mask = ~reg->ro_mask & valid_mask;

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

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

    throughable_mask = ~emu_mask & valid_mask;

    if (*val & PCI_COMMAND_INTX_DISABLE) {

        throughable_mask |= PCI_COMMAND_INTX_DISABLE;

    } else {

        if (s->machine_irq) {

            throughable_mask |= PCI_COMMAND_INTX_DISABLE;

        }

    }

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

    return 0;

}


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

     DeviceClass *dc = DEVICE_CLASS(klass);

+    dc->vmsd = &vmstate_spapr_tce_table;
+
+    dc->init = spapr_tce_table_realize;
+
+    dc->reset = spapr_tce_reset;

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    dc->vmsd = &vmstate_spapr_tce_table;

    dc->init = spapr_tce_table_realize;

    dc->reset = spapr_tce_reset;

    QLIST_INIT(&spapr_tce_tables);

    /* hcall-tce */

    spapr_register_hypercall(H_PUT_TCE, h_put_tce);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static bool check_section_footer(QEMUFile *f, SaveStateEntry *se)
+
+{
+
+    uint8_t read_mark;
+
     uint32_t read_section_id;

static bool check_section_footer(QEMUFile *f, SaveStateEntry *se)

{

    uint8_t read_mark;

    uint32_t read_section_id;

    if (skip_section_footers) {

        /* No footer to check */

        return true;

    }

    read_mark = qemu_get_byte(f);

    if (read_mark != QEMU_VM_SECTION_FOOTER) {

        error_report("Missing section footer for %s", se->idstr);

        return false;

    }

    read_section_id = qemu_get_be32(f);

    if (read_section_id != se->section_id) {

        error_report("Mismatched section id in footer for %s -"

                     " read 0x%x expected 0x%x",

                     se->idstr, read_section_id, se->section_id);

        return false;

    }

    /* All good */

    return true;

}


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

         (TCG_MAX_OP_SIZE * OPC_BUF_SIZE);

+    code_gen_max_blocks = code_gen_buffer_size / CODE_GEN_AVG_BLOCK_SIZE;
+
+    tbs = g_malloc(code_gen_max_blocks * sizeof(TranslationBlock));
+
+}

static inline void code_gen_alloc(size_t tb_size)

{

    code_gen_buffer_size = size_code_gen_buffer(tb_size);

    code_gen_buffer = alloc_code_gen_buffer();

    if (code_gen_buffer == NULL) {

        fprintf(stderr, "Could not allocate dynamic translator buffer\n");

        exit(1);

    }

    map_exec(code_gen_prologue, sizeof(code_gen_prologue));

    code_gen_buffer_max_size = code_gen_buffer_size -

        (TCG_MAX_OP_SIZE * OPC_BUF_SIZE);

    code_gen_max_blocks = code_gen_buffer_size / CODE_GEN_AVG_BLOCK_SIZE;

    tbs = g_malloc(code_gen_max_blocks * sizeof(TranslationBlock));

}


--- a/source.c
+++ b/source.c
@@ -4,7 +4,7 @@
     clock->type = type;
     clock->enabled = true;
     clock->last = INT64_MIN;
+    QLIST_INIT(&clock->timerlists);
+    notifier_list_init(&clock->reset_notifiers);
     main_loop_tlg.tl[type] = timerlist_new(type, NULL, NULL);
 }

static void qemu_clock_init(QEMUClockType type)
{
    QEMUClock *clock = qemu_clock_ptr(type);
    clock->type = type;
    clock->enabled = true;
    clock->last = INT64_MIN;
    QLIST_INIT(&clock->timerlists);
    notifier_list_init(&clock->reset_notifiers);
    main_loop_tlg.tl[type] = timerlist_new(type, NULL, NULL);
}


static void query_facilities(void)

{

    unsigned long hwcap = qemu_getauxval(AT_HWCAP);

    /* Is STORE FACILITY LIST EXTENDED available?  Honestly, I believe this

       is present on all 64-bit systems, but let's check for it anyway.  */

    if (hwcap & HWCAP_S390_STFLE) {

        register int r0 __asm__("0");

        register void *r1 __asm__("1");

        /* stfle 0(%r1) */

        r1 = &facilities;

        asm volatile(".word 0xb2b0,0x1000"

                     : "=r"(r0) : "0"(0), "r"(r1) : "memory", "cc");

    }

}


--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
         return g_strdup_printf("%sunix:%s%s", prefix,

                                addr->u.q_unix.data->path,
+
+                               is_listen ? ",server" : "");
+
+        break;
+
     case SOCKET_ADDRESS_KIND_FD:

         return g_strdup_printf("%sfd:%s%s", prefix, addr->u.fd.data->str,

static char *SocketAddress_to_str(const char *prefix, SocketAddress *addr,

                                  bool is_listen, bool is_telnet)

{

    switch (addr->type) {

    case SOCKET_ADDRESS_KIND_INET:

        return g_strdup_printf("%s%s:%s:%s%s", prefix,

                               is_telnet ? "telnet" : "tcp",

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

                               addr->u.inet.data->port,

                               is_listen ? ",server" : "");

        break;

    case SOCKET_ADDRESS_KIND_UNIX:

        return g_strdup_printf("%sunix:%s%s", prefix,

                               addr->u.q_unix.data->path,

                               is_listen ? ",server" : "");

        break;

    case SOCKET_ADDRESS_KIND_FD:

        return g_strdup_printf("%sfd:%s%s", prefix, addr->u.fd.data->str,

                               is_listen ? ",server" : "");

        break;

    default:

        abort();

    }

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
     dy = strtol(dy_str, NULL, 0);

     qemu_input_queue_rel(NULL, INPUT_AXIS_X, dx);
+
+    qemu_input_queue_rel(NULL, INPUT_AXIS_Y, dy);
+
+
+
     if (dz_str) {

         dz = strtol(dz_str, NULL, 0);

static void hmp_mouse_move(Monitor *mon, const QDict *qdict)

{

    int dx, dy, dz, button;

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

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

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

    dx = strtol(dx_str, NULL, 0);

    dy = strtol(dy_str, NULL, 0);

    qemu_input_queue_rel(NULL, INPUT_AXIS_X, dx);

    qemu_input_queue_rel(NULL, INPUT_AXIS_Y, dy);

    if (dz_str) {

        dz = strtol(dz_str, NULL, 0);

        if (dz != 0) {

            button = (dz > 0) ? INPUT_BUTTON_WHEEL_UP : INPUT_BUTTON_WHEEL_DOWN;

            qemu_input_queue_btn(NULL, button, true);

            qemu_input_event_sync();

            qemu_input_queue_btn(NULL, button, false);

        }

    }

    qemu_input_event_sync();

}


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

     for(i = 0; i < NB_ADDR; i++) {
+
+        if (!bootp_clients[i].allocated)
+
+            goto found;
+
     }

     return NULL;

static BOOTPClient *get_new_addr(struct in_addr *paddr)

{

    BOOTPClient *bc;

    int i;

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

        if (!bootp_clients[i].allocated)

            goto found;

    }

    return NULL;

 found:

    bc = &bootp_clients[i];

    bc->allocated = 1;

    paddr->s_addr = htonl(ntohl(special_addr.s_addr) | (i + START_ADDR));

    return bc;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int get_cluster_duration(MOVTrack *track, int cluster_idx)

+{
+
+    int64_t next_dts;
+
+

     if (cluster_idx >= track->entry)

static int get_cluster_duration(MOVTrack *track, int cluster_idx)

{

    int64_t next_dts;

    if (cluster_idx >= track->entry)

        return 0;

    if (cluster_idx + 1 == track->entry)

        next_dts = track->track_duration + track->start_dts;

    else

        next_dts = track->cluster[cluster_idx + 1].dts;

    return next_dts - track->cluster[cluster_idx].dts;

}


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

                     cw = get_bits(&q->gb, cw_len);

+
+
+                chctx->codewords[j] = cw;
+
+            }

         }

static void imc_get_coeffs(AVCodecContext *avctx,

                           IMCContext *q, IMCChannel *chctx)

{

    int i, j, cw_len, cw;

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

        if (!chctx->sumLenArr[i])

            continue;

        if (chctx->bandFlagsBuf[i] || chctx->bandWidthT[i]) {

            for (j = band_tab[i]; j < band_tab[i + 1]; j++) {

                cw_len = chctx->CWlengthT[j];

                cw = 0;

                if (get_bits_count(&q->gb) + cw_len > 512) {

                    av_log(avctx, AV_LOG_WARNING,

                           "Potential problem on band %i, coefficient %i"

                           ": cw_len=%i\n", i, j, cw_len);

                }

                if (cw_len && (!chctx->bandFlagsBuf[i] || !chctx->skipFlags[j]))

                    cw = get_bits(&q->gb, cw_len);

                chctx->codewords[j] = cw;

            }

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,
+
                 BlockBackend *blk, qemu_irq irq, qemu_irq dma[],

                 omap_clk fclk, omap_clk iclk)

struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,

                BlockBackend *blk, qemu_irq irq, qemu_irq dma[],

                omap_clk fclk, omap_clk iclk)

{

    struct omap_mmc_s *s = (struct omap_mmc_s *)

            g_malloc0(sizeof(struct omap_mmc_s));

    s->irq = irq;

    s->dma = dma;

    s->clk = fclk;

    s->lines = 4;

    s->rev = 2;

    omap_mmc_reset(s);

    memory_region_init_io(&s->iomem, NULL, &omap_mmc_ops, s, "omap.mmc",

                          omap_l4_region_size(ta, 0));

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

    /* Instantiate the storage */

    s->card = sd_init(blk, false);

    if (s->card == NULL) {

        exit(1);

    }

    s->cdet = qemu_allocate_irq(omap_mmc_cover_cb, s, 0);

    sd_set_cb(s->card, NULL, s->cdet);

    return s;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static uint16_t eepro100_read2(EEPRO100State * s, uint32_t addr)
+
 {

     uint16_t val;

static uint16_t eepro100_read2(EEPRO100State * s, uint32_t addr)

{

    uint16_t val;

    if (addr <= sizeof(s->mem) - sizeof(val)) {

        memcpy(&val, &s->mem[addr], sizeof(val));

    }

    switch (addr) {

    case SCBStatus:

    case SCBCmd:

        TRACE(OTHER, logout("addr=%s val=0x%04x\n", regname(addr), val));

        break;

    case SCBeeprom:

        val = eepro100_read_eeprom(s);

        TRACE(OTHER, logout("addr=%s val=0x%04x\n", regname(addr), val));

        break;

    default:

        logout("addr=%s val=0x%04x\n", regname(addr), val);

        missing("unknown word read");

    }

    return val;

}


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

+{
+
     QEMUFileBuffered *s = opaque;

static int buffered_get_fd(void *opaque)

{

    QEMUFileBuffered *s = opaque;

    return qemu_get_fd(s->file);

}


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

         break;

+    case SPAPR_DR_CONNECTOR_TYPE_PHB:
+
+    case SPAPR_DR_CONNECTOR_TYPE_VIO:
+
+    default:

         g_assert_not_reached();

static bool spapr_drc_needed(void *opaque)

{

    sPAPRDRConnector *drc = (sPAPRDRConnector *)opaque;

    sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);

    bool rc = false;

    sPAPRDREntitySense value = drck->dr_entity_sense(drc);

    /* If no dev is plugged in there is no need to migrate the DRC state */

    if (value != SPAPR_DR_ENTITY_SENSE_PRESENT) {

        return false;

    }

    /*

     * If there is dev plugged in, we need to migrate the DRC state when

     * it is different from cold-plugged state

     */

    switch (spapr_drc_type(drc)) {

    case SPAPR_DR_CONNECTOR_TYPE_PCI:

    case SPAPR_DR_CONNECTOR_TYPE_CPU:

    case SPAPR_DR_CONNECTOR_TYPE_LMB:

        rc = !((drc->isolation_state == SPAPR_DR_ISOLATION_STATE_UNISOLATED) &&

               (drc->allocation_state == SPAPR_DR_ALLOCATION_STATE_USABLE) &&

               drc->configured && !drc->awaiting_release);

        break;

    case SPAPR_DR_CONNECTOR_TYPE_PHB:

    case SPAPR_DR_CONNECTOR_TYPE_VIO:

    default:

        g_assert_not_reached();

    }

    return rc;

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
 {
     GICv3State *s = opaque;
     GICv3CPUState *cs;
+    MemTxResult r;
+    int cpuidx;
+    /* This region covers all the redistributor pages; there are
+     * (for GICv3) two 64K pages per CPU. At the moment they are
+     * all contiguous (ie in this one region), though we might later
      * want to allow splitting of redistributor pages into several
      * blocks so we can support more CPUs.
      */

MemTxResult gicv3_redist_read(void *opaque, hwaddr offset, uint64_t *data,
                              unsigned size, MemTxAttrs attrs)
{
    GICv3State *s = opaque;
    GICv3CPUState *cs;
    MemTxResult r;
    int cpuidx;
    /* This region covers all the redistributor pages; there are
     * (for GICv3) two 64K pages per CPU. At the moment they are
     * all contiguous (ie in this one region), though we might later
     * want to allow splitting of redistributor pages into several
     * blocks so we can support more CPUs.
     */
    cpuidx = offset / 0x20000;
    offset %= 0x20000;
    assert(cpuidx < s->num_cpu);
    cs = &s->cpu[cpuidx];
    switch (size) {
    case 1:
        r = gicr_readb(cs, offset, data, attrs);
        break;
    case 4:
        r = gicr_readl(cs, offset, data, attrs);
        break;
    case 8:
        r = gicr_readll(cs, offset, data, attrs);
        break;
    default:
        r = MEMTX_ERROR;
        break;
    }
    if (r == MEMTX_ERROR) {
        qemu_log_mask(LOG_GUEST_ERROR,
                      "%s: invalid guest read at offset " TARGET_FMT_plx
                      "size %u\n", __func__, offset, size);
        trace_gicv3_redist_badread(gicv3_redist_affid(cs), offset,
                                   size, attrs.secure);
    } else {
        trace_gicv3_redist_read(gicv3_redist_affid(cs), offset, *data,
                                size, attrs.secure);
    }
    return r;
}


bool s390_cpu_exec_interrupt(CPUState *cs, int interrupt_request)

{

    if (interrupt_request & CPU_INTERRUPT_HARD) {

        S390CPU *cpu = S390_CPU(cs);

        CPUS390XState *env = &cpu->env;

        if (env->ex_value) {

            /* Execution of the target insn is indivisible from

               the parent EXECUTE insn.  */

            return false;

        }

        if (env->psw.mask & PSW_MASK_EXT) {

            s390_cpu_do_interrupt(cs);

            return true;

        }

    }

    return false;

}


--- a/source.c
+++ b/source.c
@@ -13,9 +13,9 @@
         apad->whole_len -= frame->nb_samples;

+
+    apad->next_pts = frame->pts + av_rescale_q(frame->nb_samples, (AVRational){1, inlink->sample_rate}, inlink->time_base);
+
+    return ff_filter_frame(ctx->outputs[0], frame);
+
 }

static int filter_frame(AVFilterLink *inlink, AVFrame *frame)

{

    AVFilterContext *ctx = inlink->dst;

    APadContext *apad = ctx->priv;

    if (apad->whole_len)

        apad->whole_len -= frame->nb_samples;

    apad->next_pts = frame->pts + av_rescale_q(frame->nb_samples, (AVRational){1, inlink->sample_rate}, inlink->time_base);

    return ff_filter_frame(ctx->outputs[0], frame);

}


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

     RomResetData *rrd = qemu_malloc(sizeof *rrd);

+
+
+    rrd->data = qemu_malloc(size);
+
     cpu_physical_memory_read(addr, rrd->data, size);

     rrd->addr = addr;

static void option_rom_setup_reset(target_phys_addr_t addr, unsigned size)

{

    RomResetData *rrd = qemu_malloc(sizeof *rrd);

    rrd->data = qemu_malloc(size);

    cpu_physical_memory_read(addr, rrd->data, size);

    rrd->addr = addr;

    rrd->size = size;

    qemu_register_reset(option_rom_reset, rrd);

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     QemuConsole *s;

     DisplayState *ds;
+
+
+
+    ds = get_alloc_displaystate();
+
     trace_console_gfx_new();

     s = new_console(ds, GRAPHIC_CONSOLE, head);

QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head,

                                  const GraphicHwOps *hw_ops,

                                  void *opaque)

{

    int width = 640;

    int height = 480;

    QemuConsole *s;

    DisplayState *ds;

    ds = get_alloc_displaystate();

    trace_console_gfx_new();

    s = new_console(ds, GRAPHIC_CONSOLE, head);

    s->hw_ops = hw_ops;

    s->hw = opaque;

    if (dev) {

        object_property_set_link(OBJECT(s), OBJECT(dev), "device",

                                 &error_abort);

    }

    s->surface = qemu_create_displaysurface(width, height);

    return s;

}


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

 FF_DISABLE_DEPRECATION_WARNINGS
+
+    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+
+    avctx->coded_frame->key_frame = 1;
+
 FF_ENABLE_DEPRECATION_WARNINGS

 #endif

static av_cold int png_enc_init(AVCodecContext *avctx)

{

    PNGEncContext *s = avctx->priv_data;

#if FF_API_CODED_FRAME

FF_DISABLE_DEPRECATION_WARNINGS

    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;

    avctx->coded_frame->key_frame = 1;

FF_ENABLE_DEPRECATION_WARNINGS

#endif

    ff_huffyuvencdsp_init(&s->hdsp);

    s->filter_type = av_clip(avctx->prediction_method,

                             PNG_FILTER_VALUE_NONE,

                             PNG_FILTER_VALUE_MIXED);

    if (avctx->pix_fmt == AV_PIX_FMT_MONOBLACK)

        s->filter_type = PNG_FILTER_VALUE_NONE;

    return 0;

}


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

     QString *qstr;

+
+
+    *obj = NULL;
+
+    if (!qobj) {

         return;

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

                               Error **errp)

{

    QmpInputVisitor *qiv = to_qiv(v);

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

    QString *qstr;

    *obj = NULL;

    if (!qobj) {

        return;

    }

    qstr = qobject_to_qstring(qobj);

    if (!qstr) {

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

                   "string");

        return;

    }

    *obj = g_strdup(qstring_get_str(qstr));

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     SheepdogAIOCB acb;

     BDRVSheepdogState *s = bs->opaque;
+
+
+
+    sd_aio_setup(&acb, s, qiov, sector_num, nb_sectors, AIOCB_READ_UDATA);
+

 retry:

static coroutine_fn int sd_co_readv(BlockDriverState *bs, int64_t sector_num,

                       int nb_sectors, QEMUIOVector *qiov)

{

    SheepdogAIOCB acb;

    BDRVSheepdogState *s = bs->opaque;

    sd_aio_setup(&acb, s, qiov, sector_num, nb_sectors, AIOCB_READ_UDATA);

retry:

    if (check_overlapping_aiocb(s, &acb)) {

        qemu_co_queue_wait(&s->overlapping_queue);

        goto retry;

    }

    sd_co_rw_vector(&acb);

    QLIST_REMOVE(&acb, aiocb_siblings);

    qemu_co_queue_restart_all(&s->overlapping_queue);

    return acb.ret;

}


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

     gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

+#else

     if (unlikely(ctx->pr)) {

static void gen_mfdcrx(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

#else

    if (unlikely(ctx->pr)) {

        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

        return;

    }

    /* NIP cannot be restored if the memory exception comes from an helper */

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

    gen_helper_load_dcr(cpu_gpr[rD(ctx->opcode)], cpu_env,

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

    /* Note: Rc update flag set leads to undefined state of Rc0 */

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static uint16_t vring_used_idx(VirtQueue *vq)
+
 {

     VRingMemoryRegionCaches *caches = atomic_rcu_read(&vq->vring.caches);

static uint16_t vring_used_idx(VirtQueue *vq)

{

    VRingMemoryRegionCaches *caches = atomic_rcu_read(&vq->vring.caches);

    hwaddr pa = offsetof(VRingUsed, idx);

    return virtio_lduw_phys_cached(vq->vdev, &caches->used, pa);

}


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

         return;

+    for(list=0; list<2; list++){
+
+        for(i=0; i<ref1->ref_count[ref1sidx][list]; i++){
+
+            const int poc = ref1->ref_poc[ref1sidx][list][i];

             h->map_col_to_list0[list][i] = 0; /* bogus; fills in for missing frames */

static inline void direct_ref_list_init(H264Context * const h){

    MpegEncContext * const s = &h->s;

    Picture * const ref1 = &h->ref_list[1][0];

    Picture * const cur = s->current_picture_ptr;

    int list, i, j;

    int sidx= s->picture_structure&1;

    int ref1sidx= ref1->reference&1;

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

        cur->ref_count[sidx][list] = h->ref_count[list];

        for(j=0; j<h->ref_count[list]; j++)

            cur->ref_poc[sidx][list][j] = h->ref_list[list][j].poc;

    }

    if(s->picture_structure == PICT_FRAME){

        memcpy(cur->ref_count[0], cur->ref_count[1], sizeof(cur->ref_count[0]));

        memcpy(cur->ref_poc  [0], cur->ref_poc  [1], sizeof(cur->ref_poc  [0]));

    }

    if(cur->pict_type != FF_B_TYPE || h->direct_spatial_mv_pred)

        return;

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

        for(i=0; i<ref1->ref_count[ref1sidx][list]; i++){

            const int poc = ref1->ref_poc[ref1sidx][list][i];

            h->map_col_to_list0[list][i] = 0; /* bogus; fills in for missing frames */

            for(j=0; j<h->ref_count[list]; j++)

                if(h->ref_list[list][j].poc == poc){

                    h->map_col_to_list0[list][i] = j;

                    break;

                }

        }

    }

    if(FRAME_MBAFF){

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

            for(i=0; i<ref1->ref_count[ref1sidx][list]; i++){

                j = h->map_col_to_list0[list][i];

                h->map_col_to_list0_field[list][2*i] = 2*j;

                h->map_col_to_list0_field[list][2*i+1] = 2*j+1;

            }

        }

    }

}


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

     if (endp) {

+        vlan_id = strtol(endp + 6, &endp, 0);
+
+        if (*endp) {
+
+            fprintf(stderr, "qemu: unrecognised bluetooth vlan Id\n");

             return 0;

static struct bt_device_s *bt_device_add(const char *opt)

{

    struct bt_scatternet_s *vlan;

    int vlan_id = 0;

    char *endp = strstr(opt, ",vlan=");

    int len = (endp ? endp - opt : strlen(opt)) + 1;

    char devname[10];

    pstrcpy(devname, MIN(sizeof(devname), len), opt);

    if (endp) {

        vlan_id = strtol(endp + 6, &endp, 0);

        if (*endp) {

            fprintf(stderr, "qemu: unrecognised bluetooth vlan Id\n");

            return 0;

        }

    }

    vlan = qemu_find_bt_vlan(vlan_id);

    if (!vlan->slave)

        fprintf(stderr, "qemu: warning: adding a slave device to "

                        "an empty scatternet %i\n", vlan_id);

    if (!strcmp(devname, "keyboard"))

        return bt_keyboard_init(vlan);

    fprintf(stderr, "qemu: unsupported bluetooth device `%s'\n", devname);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -7,5 +7,5 @@
         qemu_file_set_error(f, ret);

     }
+
+}

static void qemu_file_set_if_error(QEMUFile *f, int ret)

{

    if (ret < 0 && !f->last_error) {

        qemu_file_set_error(f, ret);

    }

}


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

     qemu_put_byte(f, S390_TOD_CLOCK_VALUE_PRESENT);
+
+    qemu_put_byte(f, tod_high);
+
+    qemu_put_be64(f, tod_low);
+
 }

void gtod_save(QEMUFile *f, void *opaque)

{

    uint64_t tod_low;

    uint8_t tod_high;

    int r;

    r = s390_get_clock(&tod_high, &tod_low);

    if (r) {

        fprintf(stderr, "WARNING: Unable to get guest clock for migration. "

                        "Error code %d. Guest clock will not be migrated "

                        "which could cause the guest to hang.\n", r);

        qemu_put_byte(f, S390_TOD_CLOCK_VALUE_MISSING);

        return;

    }

    qemu_put_byte(f, S390_TOD_CLOCK_VALUE_PRESENT);

    qemu_put_byte(f, tod_high);

    qemu_put_be64(f, tod_low);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int gen_rp_interrupts_init(PCIDevice *d, Error **errp)

+{

     int rc;
+

     rc = msix_init_exclusive_bar(d, GEN_PCIE_ROOT_PORT_MSIX_NR_VECTOR, 0);

static int gen_rp_interrupts_init(PCIDevice *d, Error **errp)

{

    int rc;

    rc = msix_init_exclusive_bar(d, GEN_PCIE_ROOT_PORT_MSIX_NR_VECTOR, 0);

    if (rc < 0) {

        assert(rc == -ENOTSUP);

        error_setg(errp, "Unable to init msix vectors");

    } else {

        msix_vector_use(d, 0);

    }

    return rc;

}


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

 #if !defined(CONFIG_USER_ONLY)
+
+    trace_win_helper_wrpil(env->psrpil, (uint32_t)new_pil);
+
+
+
     env->psrpil = new_pil;

void helper_wrpil(CPUSPARCState *env, target_ulong new_pil)

{

#if !defined(CONFIG_USER_ONLY)

    trace_win_helper_wrpil(env->psrpil, (uint32_t)new_pil);

    env->psrpil = new_pil;

    if (cpu_interrupts_enabled(env)) {

        cpu_check_irqs(env);

    }

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void virtqueue_flush(VirtQueue *vq, unsigned int count)
+{
+    uint16_t old, new;
     /* Make sure buffer is written before we update index. */
     smp_wmb();
     trace_virtqueue_flush(vq, count);

void virtqueue_flush(VirtQueue *vq, unsigned int count)
{
    uint16_t old, new;
    /* Make sure buffer is written before we update index. */
    smp_wmb();
    trace_virtqueue_flush(vq, count);
    old = vq->used_idx;
    new = old + count;
    vring_used_idx_set(vq, new);
    if (unlikely((int16_t)(new - vq->signalled_used) < (uint16_t)(new - old)))
        vq->signalled_used_valid = false;


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

     int L = ctx->opcode & 0x02000000;

+
+
+    if (unlikely(!ctx->fpu_enabled)) {
+
+        gen_exception(ctx, POWERPC_EXCP_FPU);

         return;

static void gen_mtfsf(DisasContext *ctx)

{

    TCGv_i32 t0;

    int L = ctx->opcode & 0x02000000;

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

        gen_exception(ctx, POWERPC_EXCP_FPU);

        return;

    }

    /* NIP cannot be restored if the memory exception comes from an helper */

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

    gen_reset_fpstatus();

    if (L)

        t0 = tcg_const_i32(0xff);

    else

        t0 = tcg_const_i32(FM(ctx->opcode));

    gen_helper_store_fpscr(cpu_env, cpu_fpr[rB(ctx->opcode)], t0);

    tcg_temp_free_i32(t0);

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

        tcg_gen_trunc_tl_i32(cpu_crf[1], cpu_fpscr);

        tcg_gen_shri_i32(cpu_crf[1], cpu_crf[1], FPSCR_OX);

    }

    /* We can raise a differed exception */

    gen_helper_float_check_status(cpu_env);

}


--- a/source.c
+++ b/source.c
@@ -13,7 +13,7 @@
     ts->cb = cb;

     ts->opaque = opaque;
+
+    return ts;
+
+}

QEMUTimer *qemu_new_timer(QEMUClock *clock, QEMUTimerCB *cb, void *opaque)

{

    QEMUTimer *ts;

    ts = qemu_mallocz(sizeof(QEMUTimer));

    ts->clock = clock;

    ts->cb = cb;

    ts->opaque = opaque;

    return ts;

}


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

+{

+    PCIDevice *dev = opaque;
+
+    unsigned int offset = addr & (MSIX_PAGE_SIZE - 1);

     void *page = dev->msix_table_page;

static uint32_t msix_mmio_readl(void *opaque, target_phys_addr_t addr)

{

    PCIDevice *dev = opaque;

    unsigned int offset = addr & (MSIX_PAGE_SIZE - 1);

    void *page = dev->msix_table_page;

    uint32_t val = 0;

    memcpy(&val, (void *)((char *)page + offset), 4);

    return val;

}


--- a/source.c
+++ b/source.c
@@ -6,11 +6,11 @@
     minor = get_bits(&gb, 8); /* version minor */
     micro = get_bits(&gb, 8); /* version micro */
     av_log(avctx, AV_LOG_INFO, "Theora bitstream version %d.%d.%d\n",
+	major, minor, micro);
+    /* FIXME: endianess? */
+    s->theora = (major << 16) | (minor << 8) | micro;
+    /* 3.3.0 aka alpha3 has the same frame orientation as original vp3 */
+    /* but previous versions have the image flipped relative to vp3 */
     if (s->theora < 0x030300)
     {
 	s->flipped_image = 1;

static int theora_decode_header(AVCodecContext *avctx, GetBitContext gb)
{
    Vp3DecodeContext *s = avctx->priv_data;
    int major, minor, micro;
    major = get_bits(&gb, 8); /* version major */
    minor = get_bits(&gb, 8); /* version minor */
    micro = get_bits(&gb, 8); /* version micro */
    av_log(avctx, AV_LOG_INFO, "Theora bitstream version %d.%d.%d\n",
	major, minor, micro);
    /* FIXME: endianess? */
    s->theora = (major << 16) | (minor << 8) | micro;
    /* 3.3.0 aka alpha3 has the same frame orientation as original vp3 */
    /* but previous versions have the image flipped relative to vp3 */
    if (s->theora < 0x030300)
    {
	s->flipped_image = 1;
        av_log(avctx, AV_LOG_DEBUG, "Old (<alpha3) Theora bitstream, flipped image\n");
    s->width = get_bits(&gb, 16) << 4;
    s->height = get_bits(&gb, 16) << 4;
    skip_bits(&gb, 24); /* frame width */
    skip_bits(&gb, 24); /* frame height */
    skip_bits(&gb, 8); /* offset x */
    skip_bits(&gb, 8); /* offset y */
    skip_bits(&gb, 32); /* fps numerator */
    skip_bits(&gb, 32); /* fps denumerator */
    skip_bits(&gb, 24); /* aspect numerator */
    skip_bits(&gb, 24); /* aspect denumerator */
    if (s->theora < 0x030300)
	skip_bits(&gb, 5); /* keyframe frequency force */
    skip_bits(&gb, 8); /* colorspace */
    skip_bits(&gb, 24); /* bitrate */
    skip_bits(&gb, 6); /* last(?) quality index */
    if (s->theora >= 0x030300)
    {
	skip_bits(&gb, 5); /* keyframe frequency force */
	skip_bits(&gb, 5); /* spare bits */
//    align_get_bits(&gb);
    avctx->width = s->width;
    avctx->height = s->height;
    vp3_decode_init(avctx);
    return 0;


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

                                  uint64_t value, unsigned size)
+
 {

 }

static void mv88w8618_wlan_write(void *opaque, target_phys_addr_t offset,

                                 uint64_t value, unsigned size)

{

}


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

     avctx->coded_frame = av_frame_alloc();

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

static av_cold int xwd_encode_init(AVCodecContext *avctx)

{

    avctx->coded_frame = av_frame_alloc();

    if (!avctx->coded_frame)

        return AVERROR(ENOMEM);

    return 0;

}


--- 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
@@ -30,11 +30,11 @@

 	put_packetheader(nut, bc, 64);

+	put_v(bc, s->streams[i]->id);
+
+	put_v(bc, ...);
+
+	put_be32(bc, 0); /* FIXME: checksum */

         update_packetheader(nut, bc, 0);

static int nut_write_trailer(AVFormatContext *s)

{

    NUTContext *nut = s->priv_data;

    ByteIOContext *bc = &s->pb;

    update_packetheader(nut, bc, 0);

#if 0

    int i;

    /* WRITE INDEX */

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

    {

	put_be64(bc, INDEX_STARTCODE);

	put_packetheader(nut, bc, 64);

	put_v(bc, s->streams[i]->id);

	put_v(bc, ...);

	put_be32(bc, 0); /* FIXME: checksum */

        update_packetheader(nut, bc, 0);

    }

#endif

    put_flush_packet(bc);

    av_freep(&nut->stream);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline int cris_swap(const int mode, int x)

 {

static inline int cris_swap(const int mode, int x)

{

	switch (mode)

	{

		case N: asm ("swapn\t%0\n" : "+r" (x) : "0" (x)); break;

		case W: asm ("swapw\t%0\n" : "+r" (x) : "0" (x)); break;

		case B: asm ("swapb\t%0\n" : "+r" (x) : "0" (x)); break;

		case R: asm ("swapr\t%0\n" : "+r" (x) : "0" (x)); break;

		case B|R: asm ("swapbr\t%0\n" : "+r" (x) : "0" (x)); break;

		case W|R: asm ("swapwr\t%0\n" : "+r" (x) : "0" (x)); break;

		case W|B: asm ("swapwb\t%0\n" : "+r" (x) : "0" (x)); break;

		case W|B|R: asm ("swapwbr\t%0\n" : "+r" (x) : "0" (x)); break;

		case N|R: asm ("swapnr\t%0\n" : "+r" (x) : "0" (x)); break;

		case N|B: asm ("swapnb\t%0\n" : "+r" (x) : "0" (x)); break;

		case N|B|R: asm ("swapnbr\t%0\n" : "+r" (x) : "0" (x)); break;

		case N|W: asm ("swapnw\t%0\n" : "+r" (x) : "0" (x)); break;

		default:

			err();

			break;

	}

	return x;

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     if (dc->format == OP_FMT_RI) {

         LOG_DIS("muli r%d, r%d, %d\n", dc->r0, dc->r1,
+
                 sign_extend(dc->imm16, 16));

     } else {

static void dec_mul(DisasContext *dc)

{

    if (dc->format == OP_FMT_RI) {

        LOG_DIS("muli r%d, r%d, %d\n", dc->r0, dc->r1,

                sign_extend(dc->imm16, 16));

    } else {

        LOG_DIS("mul r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1);

    }

    if (!(dc->env->features & LM32_FEATURE_MULTIPLY)) {

        cpu_abort(dc->env, "hardware multiplier is not available\n");

    }

    if (dc->format == OP_FMT_RI) {

        tcg_gen_muli_tl(cpu_R[dc->r1], cpu_R[dc->r0],

                sign_extend(dc->imm16, 16));

    } else {

        tcg_gen_mul_tl(cpu_R[dc->r2], cpu_R[dc->r0], cpu_R[dc->r1]);

    }

}


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

     while (ctx->rc.range <= BOTTOM_VALUE) {

+        ctx->rc.buffer = (ctx->rc.buffer << 8) | bytestream_get_byte(&ctx->ptr);
+
+        ctx->rc.low    = (ctx->rc.low << 8)    | ((ctx->rc.buffer >> 1) & 0xFF);

         ctx->rc.range  <<= 8;

static inline void range_dec_normalize(APEContext * ctx)

{

    while (ctx->rc.range <= BOTTOM_VALUE) {

        ctx->rc.buffer = (ctx->rc.buffer << 8) | bytestream_get_byte(&ctx->ptr);

        ctx->rc.low    = (ctx->rc.low << 8)    | ((ctx->rc.buffer >> 1) & 0xFF);

        ctx->rc.range  <<= 8;

    }

}


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

+    DBDMA_DPRINTF("    status 0x%08x\n", status);
+
+
+
+    ch->regs[DBDMA_STATUS] = status;

dbdma_control_write(DBDMA_channel *ch)

{

    uint16_t mask, value;

    uint32_t status;

    mask = (ch->regs[DBDMA_CONTROL] >> 16) & 0xffff;

    value = ch->regs[DBDMA_CONTROL] & 0xffff;

    value &= (RUN | PAUSE | FLUSH | WAKE | DEVSTAT);

    status = ch->regs[DBDMA_STATUS];

    status = (value & mask) | (status & ~mask);

    if (status & WAKE)

        status |= ACTIVE;

    if (status & RUN) {

        status |= ACTIVE;

        status &= ~DEAD;

    }

    if (status & PAUSE)

        status &= ~ACTIVE;

    if ((ch->regs[DBDMA_STATUS] & RUN) && !(status & RUN)) {

        /* RUN is cleared */

        status &= ~(ACTIVE|DEAD);

    }

    DBDMA_DPRINTF("    status 0x%08x\n", status);

    ch->regs[DBDMA_STATUS] = status;

    if (status & ACTIVE)

        qemu_bh_schedule(dbdma_bh);

    if (status & FLUSH)

        ch->flush(&ch->io);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int msf_probe(AVProbeData *p)
 {
+    if (memcmp(p->buf, "MSF", 3))
+        return 0;
     if (AV_RB32(p->buf+8) <= 0)
         return 0;
     if (AV_RB32(p->buf+16) <= 0)

static int msf_probe(AVProbeData *p)
{
    if (memcmp(p->buf, "MSF", 3))
        return 0;
    if (AV_RB32(p->buf+8) <= 0)
        return 0;
    if (AV_RB32(p->buf+16) <= 0)
        return 0;
    return AVPROBE_SCORE_MAX / 3 * 2;
}