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

+    case 0x04:	/* TIPB_BUS_ALLOC */
+
+        s->alloc = value & 0x003f;
+
+        break;

static void omap_tipb_bridge_write(void *opaque, target_phys_addr_t addr,

                                   uint64_t value, unsigned size)

{

    struct omap_tipb_bridge_s *s = (struct omap_tipb_bridge_s *) opaque;

    if (size < 2) {

        return omap_badwidth_write16(opaque, addr, value);

    }

    switch (addr) {

    case 0x00:	/* TIPB_CNTL */

        s->control = value & 0xffff;

        break;

    case 0x04:	/* TIPB_BUS_ALLOC */

        s->alloc = value & 0x003f;

        break;

    case 0x08:	/* MPU_TIPB_CNTL */

        s->buffer = value & 0x0003;

        break;

    case 0x0c:	/* ENHANCED_TIPB_CNTL */

        s->width_intr = !(value & 2);

        s->enh_control = value & 0x000f;

        break;

    case 0x10:	/* ADDRESS_DBG */

    case 0x14:	/* DATA_DEBUG_LOW */

    case 0x18:	/* DATA_DEBUG_HIGH */

    case 0x1c:	/* DEBUG_CNTR_SIG */

        OMAP_RO_REG(addr);

        break;

    default:

        OMAP_BAD_REG(addr);

    }

}


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

         it = g_new(BdrvNextIterator, 1);

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

     }

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

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

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

{

    if (!it) {

        it = g_new(BdrvNextIterator, 1);

        *it = (BdrvNextIterator) {

            .phase = BDRV_NEXT_BACKEND_ROOTS,

        };

    }

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

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

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

    if (it->phase == BDRV_NEXT_BACKEND_ROOTS) {

        do {

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

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

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

        if (*bs) {

            return it;

        }

        it->phase = BDRV_NEXT_MONITOR_OWNED;

    }

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

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

     * by the above block already */

    do {

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

        *bs = it->bs;

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

    return *bs ? it : NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static QmpOutputVisitor *to_qov(Visitor *v)
+
 {

     return container_of(v, QmpOutputVisitor, visitor);

static QmpOutputVisitor *to_qov(Visitor *v)

{

    return container_of(v, QmpOutputVisitor, visitor);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr,

                                   GetBitContext *gb, int id_aac)
+
 {
+
     unsigned int cnt = get_bits_count(gb);

static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr,

                                  GetBitContext *gb, int id_aac)

{

    unsigned int cnt = get_bits_count(gb);

    if (id_aac == TYPE_SCE || id_aac == TYPE_CCE) {

        read_sbr_single_channel_element(ac, sbr, gb);

    } else if (id_aac == TYPE_CPE) {

        read_sbr_channel_pair_element(ac, sbr, gb);

    } else {

        av_log(ac->avccontext, AV_LOG_ERROR,

            "Invalid bitstream - cannot apply SBR to element type %d\n", id_aac);

        sbr->start = 0;

        return get_bits_count(gb) - cnt;

    }

    if (get_bits1(gb)) { // bs_extended_data

        int num_bits_left = get_bits(gb, 4); // bs_extension_size

        if (num_bits_left == 15)

            num_bits_left += get_bits(gb, 8); // bs_esc_count

        num_bits_left <<= 3;

        while (num_bits_left > 7) {

            num_bits_left -= 2;

            read_sbr_extension(ac, sbr, gb, get_bits(gb, 2), &num_bits_left); // bs_extension_id

        }

    }

    return get_bits_count(gb) - cnt;

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     NetClientState *ncs[MAX_QUEUE_NUM];

+
     if (nb_args != 2) {

         return;

void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str)

{

    int len, count, i;

    NetClientState *ncs[MAX_QUEUE_NUM];

    if (nb_args != 2) {

        return;

    }

    len = strlen(str);

    readline_set_completion_index(rs, len);

    count = qemu_find_net_clients_except(NULL, ncs, NET_CLIENT_OPTIONS_KIND_NIC,

                                         MAX_QUEUE_NUM);

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

        QemuOpts *opts;

        const char *name = ncs[i]->name;

        if (strncmp(str, name, len)) {

            continue;

        }

        opts = qemu_opts_find(qemu_find_opts_err("netdev", NULL), name);

        if (opts) {

            readline_add_completion(rs, name);

        }

    }

}


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

 #endif

+
+
+    while (len) {
+
+        if (dma->translate(dma, addr, &paddr, &plen, dir) != 0) {

             return false;

bool iommu_dma_memory_valid(DMAContext *dma, dma_addr_t addr, dma_addr_t len,

                            DMADirection dir)

{

    target_phys_addr_t paddr, plen;

#ifdef DEBUG_IOMMU

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

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

#endif

    while (len) {

        if (dma->translate(dma, addr, &paddr, &plen, dir) != 0) {

            return false;

        }

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

        if (plen > len) {

            plen = len;

        }

        len -= plen;

        addr += plen;

    }

    return true;

}


--- a/source.c
+++ b/source.c
@@ -13,7 +13,7 @@
     env->interrupt_request |= mask;

+
     /*

      * If called from iothread context, wake the target cpu in

static void tcg_handle_interrupt(CPUArchState *env, int mask)

{

    CPUState *cpu = ENV_GET_CPU(env);

    int old_mask;

    old_mask = env->interrupt_request;

    env->interrupt_request |= mask;

    /*

     * If called from iothread context, wake the target cpu in

     * case its halted.

     */

    if (!qemu_cpu_is_self(cpu)) {

        qemu_cpu_kick(cpu);

        return;

    }

    if (use_icount) {

        env->icount_decr.u16.high = 0xffff;

        if (!can_do_io(env)

            && (mask & ~old_mask) != 0) {

            cpu_abort(env, "Raised interrupt while not in I/O function");

        }

    } else {

        cpu_unlink_tb(cpu);

    }

}


--- a/source.c
+++ b/source.c
@@ -38,11 +38,11 @@
         seek_data = g_new0(GuestFileSeek, 1);

         seek_data->position = ftell(fh);
+
+        seek_data->eof = feof(fh);
+
+
+
     clearerr(fh);

struct GuestFileSeek *qmp_guest_file_seek(int64_t handle, int64_t offset,

                                          int64_t whence, Error **errp)

{

    GuestFileHandle *gfh = guest_file_handle_find(handle, errp);

    GuestFileSeek *seek_data = NULL;

    FILE *fh;

    int ret;

    if (!gfh) {

        return NULL;

    fh = gfh->fh;

    ret = fseek(fh, offset, whence);

    if (ret == -1) {

        error_setg_errno(errp, errno, "failed to seek file");

    } else {

        seek_data = g_new0(GuestFileSeek, 1);

        seek_data->position = ftell(fh);

        seek_data->eof = feof(fh);

    clearerr(fh);

    return seek_data;


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int mxf_read_source_clip(void *arg, AVIOContext *pb, int tag, int size, UID uid)

 {

static int mxf_read_source_clip(void *arg, AVIOContext *pb, int tag, int size, UID uid)

{

    MXFStructuralComponent *source_clip = arg;

    switch(tag) {

    case 0x0202:

        source_clip->duration = avio_rb64(pb);

        break;

    case 0x1201:

        source_clip->start_position = avio_rb64(pb);

        break;

    case 0x1101:

        /* UMID, only get last 16 bytes */

        avio_skip(pb, 16);

        avio_read(pb, source_clip->source_package_uid, 16);

        break;

    case 0x1102:

        source_clip->source_track_id = avio_rb32(pb);

        break;

    }

    return 0;

}


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

{

    uint8_t *v = pv;

    qemu_get_8s(f, v);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
                 pic->data[i] = CVPixelBufferGetBaseAddressOfPlane(cv_buffer, i);
                 pic->linesize[i] = CVPixelBufferGetBytesPerRowOfPlane(cv_buffer, i);
             }
+        } else {
+            pic->data[0] = CVPixelBufferGetBaseAddress(cv_buffer);
+            pic->linesize[0] = CVPixelBufferGetBytesPerRow(cv_buffer);
+        }
+    }
     avctx->pix_fmt = ctx->pix_fmt;
     return ret;
 }

static int vdadec_decode(AVCodecContext *avctx,
        void *data, int *got_frame, AVPacket *avpkt)
{
    VDADecoderContext *ctx = avctx->priv_data;
    AVFrame *pic = data;
    int ret;
    ret = ff_h264_decoder.decode(avctx, data, got_frame, avpkt);
    if (*got_frame) {
        AVBufferRef *buffer = pic->buf[0];
        VDABufferContext *context = av_buffer_get_opaque(buffer);
        CVPixelBufferRef cv_buffer = (CVPixelBufferRef)pic->data[3];
        CVPixelBufferLockBaseAddress(cv_buffer, 0);
        context->cv_buffer = cv_buffer;
        pic->format = ctx->pix_fmt;
        if (CVPixelBufferIsPlanar(cv_buffer)) {
            int i, count = CVPixelBufferGetPlaneCount(cv_buffer);
            av_assert0(count < 4);
            for (i = 0; i < count; i++) {
                pic->data[i] = CVPixelBufferGetBaseAddressOfPlane(cv_buffer, i);
                pic->linesize[i] = CVPixelBufferGetBytesPerRowOfPlane(cv_buffer, i);
            }
        } else {
            pic->data[0] = CVPixelBufferGetBaseAddress(cv_buffer);
            pic->linesize[0] = CVPixelBufferGetBytesPerRow(cv_buffer);
        }
    }
    avctx->pix_fmt = ctx->pix_fmt;
    return ret;
}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static inline TCGv gen_ld8u(TCGv addr, int index)
+
 {

     TCGv tmp = new_tmp();

static inline TCGv gen_ld8u(TCGv addr, int index)

{

    TCGv tmp = new_tmp();

    tcg_gen_qemu_ld8u(tmp, addr, index);

    return tmp;

}


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

 {

+    AVFilterLink *out = NULL;

void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref)

{

    AVFilterLink *out = NULL;

    if(link->dst->output_count)

        out = link->dst->outputs[0];

    if(out) {

        out->outpic      = avfilter_get_video_buffer(out, AV_PERM_WRITE, link->w, link->h);

        out->outpic->pts = picref->pts;

        avfilter_start_frame(out, avfilter_ref_pic(out->outpic, ~0));

    }

}


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

     vector unsigned int sad = (vector unsigned int) vec_splat_u32(0);

+    vector signed int sumdiffs;

static int pix_sum_altivec(uint8_t *pix, int line_size)

{

    int i, s;

    const vector unsigned int zero =

        (const vector unsigned int) vec_splat_u32(0);

    vector unsigned int sad = (vector unsigned int) vec_splat_u32(0);

    vector signed int sumdiffs;

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

        /* Read the potentially unaligned 16 pixels into t1. */

        //vector unsigned char pixl = vec_ld(0,  pix);

        //vector unsigned char pixr = vec_ld(15, pix);

        //vector unsigned char t1   = vec_perm(pixl, pixr, perm);

        vector unsigned char t1   = vec_vsx_ld(0,  pix);

        /* Add each 4 pixel group together and put 4 results into sad. */

        sad = vec_sum4s(t1, sad);

        pix += line_size;

    }

    /* Sum up the four partial sums, and put the result into s. */

    sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);

    sumdiffs = vec_splat(sumdiffs, 3);

    vec_vsx_st(sumdiffs, 0, &s);

    return s;

}


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

+    if (event_notifier_init(&vector->kvm_interrupt, 0)) {
+
+        return;
+
+    }

static void vfio_add_kvm_msi_virq(VFIOMSIVector *vector, MSIMessage *msg,

                                  bool msix)

{

    int virq;

    if ((msix && !VFIO_ALLOW_KVM_MSIX) ||

        (!msix && !VFIO_ALLOW_KVM_MSI) || !msg) {

        return;

    }

    if (event_notifier_init(&vector->kvm_interrupt, 0)) {

        return;

    }

    virq = kvm_irqchip_add_msi_route(kvm_state, *msg);

    if (virq < 0) {

        event_notifier_cleanup(&vector->kvm_interrupt);

        return;

    }

    if (kvm_irqchip_add_irqfd_notifier_gsi(kvm_state, &vector->kvm_interrupt,

                                       NULL, virq) < 0) {

        kvm_irqchip_release_virq(kvm_state, virq);

        event_notifier_cleanup(&vector->kvm_interrupt);

        return;

    }

    vector->virq = virq;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int tta_probe(AVProbeData *p)

 {
+
+    const uint8_t *d = p->buf;
+
+    if (p->buf_size < 4)

         return 0;

static int tta_probe(AVProbeData *p)

{

    const uint8_t *d = p->buf;

    if (p->buf_size < 4)

        return 0;

    if (d[0] == 'T' && d[1] == 'T' && d[2] == 'A' && d[3] == '1')

        return 80;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void monitor_print_error(Monitor *mon)

 {
+
+    qerror_print(mon->error);

     QDECREF(mon->error);

static void monitor_print_error(Monitor *mon)

{

    qerror_print(mon->error);

    QDECREF(mon->error);

    mon->error = NULL;

}


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

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

+    mapping_t* mapping;
+
+    direntry_t* direntry;
+
+    assert(vvv->mapping.size >= vvv->mapping.item_size * vvv->mapping.next);

     assert(vvv->directory.size >= vvv->directory.item_size * vvv->directory.next);

static void checkpoint(void) {

    assert(((mapping_t*)array_get(&(vvv->mapping), 0))->end == 2);

    check1(vvv);

    check2(vvv);

    assert(!vvv->current_mapping || vvv->current_fd || (vvv->current_mapping->mode & MODE_DIRECTORY));

#if 0

    if (((direntry_t*)vvv->directory.pointer)[1].attributes != 0xf)

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

    mapping_t* mapping;

    direntry_t* direntry;

    assert(vvv->mapping.size >= vvv->mapping.item_size * vvv->mapping.next);

    assert(vvv->directory.size >= vvv->directory.item_size * vvv->directory.next);

    if (vvv->mapping.next<47)

        return;

    assert((mapping = array_get(&(vvv->mapping), 47)));

    assert(mapping->dir_index < vvv->directory.next);

    direntry = array_get(&(vvv->directory), mapping->dir_index);

    assert(!memcmp(direntry->name, "USB     H  ", 11) || direntry->name[0]==0);

#endif

}


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

     VirtIOBlock *s = VIRTIO_BLK(vdev);
+
     VirtIOBlockReq *req = s->rq;

static void virtio_blk_save_device(VirtIODevice *vdev, QEMUFile *f)

{

    VirtIOBlock *s = VIRTIO_BLK(vdev);

    VirtIOBlockReq *req = s->rq;

    while (req) {

        qemu_put_sbyte(f, 1);

        qemu_put_buffer(f, (unsigned char *)req->elem,

                        sizeof(VirtQueueElement));

        req = req->next;

    }

    qemu_put_sbyte(f, 0);

}


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

     m68k_set_feature(env, M68K_FEATURE_USP);

+    m68k_set_feature(env, M68K_FEATURE_WORD_INDEX);
+
+    m68k_set_feature(env, M68K_FEATURE_BRAL);
+
+    m68k_set_feature(env, M68K_FEATURE_BCCL);

     m68k_set_feature(env, M68K_FEATURE_BITFIELD);

static void m68060_cpu_initfn(Object *obj)

{

    M68kCPU *cpu = M68K_CPU(obj);

    CPUM68KState *env = &cpu->env;

    m68k_set_feature(env, M68K_FEATURE_M68000);

    m68k_set_feature(env, M68K_FEATURE_USP);

    m68k_set_feature(env, M68K_FEATURE_WORD_INDEX);

    m68k_set_feature(env, M68K_FEATURE_BRAL);

    m68k_set_feature(env, M68K_FEATURE_BCCL);

    m68k_set_feature(env, M68K_FEATURE_BITFIELD);

    m68k_set_feature(env, M68K_FEATURE_EXT_FULL);

    m68k_set_feature(env, M68K_FEATURE_SCALED_INDEX);

    m68k_set_feature(env, M68K_FEATURE_LONG_MULDIV);

    m68k_set_feature(env, M68K_FEATURE_FPU);

    m68k_set_feature(env, M68K_FEATURE_CAS);

    m68k_set_feature(env, M68K_FEATURE_BKPT);

    m68k_set_feature(env, M68K_FEATURE_RTD);

}


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

         pci_for_each_bus(d->bus, piix4_update_bus_hotplug, s);

+    } else {
+
+        piix4_update_bus_hotplug(d->bus, s);
+
+    }

 }

static void piix4_pm_machine_ready(Notifier *n, void *opaque)

{

    PIIX4PMState *s = container_of(n, PIIX4PMState, machine_ready);

    PCIDevice *d = PCI_DEVICE(s);

    MemoryRegion *io_as = pci_address_space_io(d);

    uint8_t *pci_conf;

    pci_conf = d->config;

    pci_conf[0x5f] = 0x10 |

        (memory_region_present(io_as, 0x378) ? 0x80 : 0);

    pci_conf[0x63] = 0x60;

    pci_conf[0x67] = (memory_region_present(io_as, 0x3f8) ? 0x08 : 0) |

        (memory_region_present(io_as, 0x2f8) ? 0x90 : 0);

    if (s->use_acpi_pci_hotplug) {

        pci_for_each_bus(d->bus, piix4_update_bus_hotplug, s);

    } else {

        piix4_update_bus_hotplug(d->bus, s);

    }

}


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

                                     uint8_t *buf, int nb_sectors)

+{
+
+    int ret;
+
     BDRVCowState *s = bs->opaque;

     qemu_co_mutex_lock(&s->lock);

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

                                    uint8_t *buf, int nb_sectors)

{

    int ret;

    BDRVCowState *s = bs->opaque;

    qemu_co_mutex_lock(&s->lock);

    ret = cow_read(bs, sector_num, buf, nb_sectors);

    qemu_co_mutex_unlock(&s->lock);

    return ret;

}


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

                                 EventNotifierHandler *handler)

+{
+
+    iohandler_init();

     aio_set_event_notifier(iohandler_ctx, e, false,

void event_notifier_set_handler(EventNotifier *e,

                                EventNotifierHandler *handler)

{

    iohandler_init();

    aio_set_event_notifier(iohandler_ctx, e, false,

                           handler, NULL);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void check_guest_output(const testdef_t *test, int fd)

+{

     bool output_ok = false;
+
     int i, nbr, pos = 0;

     char ch;

static void check_guest_output(const testdef_t *test, int fd)

{

    bool output_ok = false;

    int i, nbr, pos = 0;

    char ch;

    /* Poll serial output... Wait at most 60 seconds */

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

        while ((nbr = read(fd, &ch, 1)) == 1) {

            if (ch == test->expect[pos]) {

                pos += 1;

                if (test->expect[pos] == '\0') {

                    /* We've reached the end of the expected string! */

                    output_ok = true;

                    goto done;

                }

            } else {

                pos = 0;

            }

        }

        g_assert(nbr >= 0);

        g_usleep(10000);

    }

done:

    g_assert(output_ok);

}


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

         FUNCC(pred4x4_horizontal_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);

+    for(i=4; i<8; i++)
+
+        FUNCC(pred4x4_horizontal_add)(pix + block_offset[i+4], block + i*16*sizeof(pixel), stride);
+
 }

static void FUNCC(pred8x16_horizontal_add)(uint8_t *pix,

                                           const int *block_offset,

                                           const int16_t *block, ptrdiff_t stride)

{

    int i;

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

        FUNCC(pred4x4_horizontal_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);

    for(i=4; i<8; i++)

        FUNCC(pred4x4_horizontal_add)(pix + block_offset[i+4], block + i*16*sizeof(pixel), stride);

}


--- a/source.c
+++ b/source.c
@@ -9,8 +9,8 @@
     USBDevice *dev;

+
+    dev = USB_DEVICE(qdev_try_create(&bus->qbus, name));

     if (!dev) {

static USBDevice *usb_try_create_simple(USBBus *bus, const char *name,

                                        Error **errp)

{

    Error *err = NULL;

    USBDevice *dev;

    dev = USB_DEVICE(qdev_try_create(&bus->qbus, name));

    if (!dev) {

        error_setg(errp, "Failed to create USB device '%s'", name);

        return NULL;

    }

    object_property_set_bool(OBJECT(dev), true, "realized", &err);

    if (err) {

        error_propagate(errp, err);

        error_prepend(errp, "Failed to initialize USB device '%s': ",

                      name);

        object_unparent(OBJECT(dev));

        return NULL;

    }

    return dev;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 BlockAIOCB *bdrv_aio_flush(BlockDriverState *bs,
+
+        BlockCompletionFunc *cb, void *opaque)
+
+{
+
     trace_bdrv_aio_flush(bs, opaque);

BlockAIOCB *bdrv_aio_flush(BlockDriverState *bs,

        BlockCompletionFunc *cb, void *opaque)

{

    trace_bdrv_aio_flush(bs, opaque);

    Coroutine *co;

    BlockAIOCBCoroutine *acb;

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

    acb->need_bh = true;

    acb->req.error = -EINPROGRESS;

    co = qemu_coroutine_create(bdrv_aio_flush_co_entry);

    qemu_coroutine_enter(co, acb);

    bdrv_co_maybe_schedule_bh(acb);

    return &acb->common;

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     for(i = 0; i < s->l2_size; i++) {
         offset = be64_to_cpu(l2_table[i]);
         if (offset != 0) {
+            if (offset & QCOW_OFLAG_COMPRESSED) {
+                /* Compressed clusters don't have QCOW_OFLAG_COPIED */
+                if (offset & QCOW_OFLAG_COPIED) {
+                    fprintf(stderr, "ERROR: cluster %" PRId64 ": "
+                        "copied flag must never be set for compressed "
                         "clusters\n", offset >> s->cluster_bits);
                     offset &= ~QCOW_OFLAG_COPIED;
                 /* Mark cluster as used */

static int check_refcounts_l2(BlockDriverState *bs,
    uint16_t *refcount_table, int refcount_table_size, int64_t l2_offset,
    int check_copied)
{
    BDRVQcowState *s = bs->opaque;
    uint64_t *l2_table, offset;
    int i, l2_size, nb_csectors, refcount;
    int errors = 0;
    /* Read L2 table from disk */
    l2_size = s->l2_size * sizeof(uint64_t);
    l2_table = qemu_malloc(l2_size);
    if (bdrv_pread(s->hd, l2_offset, l2_table, l2_size) != l2_size)
        goto fail;
    /* Do the actual checks */
    for(i = 0; i < s->l2_size; i++) {
        offset = be64_to_cpu(l2_table[i]);
        if (offset != 0) {
            if (offset & QCOW_OFLAG_COMPRESSED) {
                /* Compressed clusters don't have QCOW_OFLAG_COPIED */
                if (offset & QCOW_OFLAG_COPIED) {
                    fprintf(stderr, "ERROR: cluster %" PRId64 ": "
                        "copied flag must never be set for compressed "
                        "clusters\n", offset >> s->cluster_bits);
                    offset &= ~QCOW_OFLAG_COPIED;
                /* Mark cluster as used */
                nb_csectors = ((offset >> s->csize_shift) &
                               s->csize_mask) + 1;
                offset &= s->cluster_offset_mask;
                errors += inc_refcounts(bs, refcount_table,
                              refcount_table_size,
                              offset & ~511, nb_csectors * 512);
            } else {
                /* QCOW_OFLAG_COPIED must be set iff refcount == 1 */
                if (check_copied) {
                    uint64_t entry = offset;
                    offset &= ~QCOW_OFLAG_COPIED;
                    refcount = get_refcount(bs, offset >> s->cluster_bits);
                    if ((refcount == 1) != ((entry & QCOW_OFLAG_COPIED) != 0)) {
                        fprintf(stderr, "ERROR OFLAG_COPIED: offset=%"
                            PRIx64 " refcount=%d\n", entry, refcount);
                /* Mark cluster as used */
                offset &= ~QCOW_OFLAG_COPIED;
                errors += inc_refcounts(bs, refcount_table,
                              refcount_table_size,
                              offset, s->cluster_size);
    qemu_free(l2_table);
    return errors;
fail:
    fprintf(stderr, "ERROR: I/O error in check_refcounts_l1\n");
    qemu_free(l2_table);
    return -EIO;


--- a/source.c
+++ b/source.c
@@ -8,10 +8,10 @@
         return -1;
     avctx->pix_fmt = PIX_FMT_PAL8;
     avcodec_get_frame_defaults(&s->frame);
+    s->num_pal_colors = avctx->extradata[0];
+    s->first_color[0] = avctx->extradata[1];
+    s->first_color[1] = avctx->extradata[2];
+    if (s->num_pal_colors + s->first_color[0] > 256 ||
         s->num_pal_colors + s->first_color[1] > 256) {
         av_log(avctx, AV_LOG_ERROR,
                "YOP: palette parameters invalid, header probably corrupt\n");

static av_cold int yop_decode_init(AVCodecContext *avctx)
{
    YopDecContext *s = avctx->priv_data;
    s->avctx = avctx;
    if (avctx->width & 1 || avctx->height & 1 ||
        av_image_check_size(avctx->width, avctx->height, 0, avctx) < 0) {
        av_log(avctx, AV_LOG_ERROR, "YOP has invalid dimensions\n");
        return -1;
    avctx->pix_fmt = PIX_FMT_PAL8;
    avcodec_get_frame_defaults(&s->frame);
    s->num_pal_colors = avctx->extradata[0];
    s->first_color[0] = avctx->extradata[1];
    s->first_color[1] = avctx->extradata[2];
    if (s->num_pal_colors + s->first_color[0] > 256 ||
        s->num_pal_colors + s->first_color[1] > 256) {
        av_log(avctx, AV_LOG_ERROR,
               "YOP: palette parameters invalid, header probably corrupt\n");
    return 0;


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static int alloc_table(VLC *vlc, int size)

 {

     int index;

+    index = vlc->table_size;

     vlc->table_size += size;

static int alloc_table(VLC *vlc, int size)

{

    int index;

    index = vlc->table_size;

    vlc->table_size += size;

    if (vlc->table_size > vlc->table_allocated) {

        vlc->table_allocated += (1 << vlc->bits);

        vlc->table = av_realloc(vlc->table,

                                sizeof(VLC_TYPE) * 2 * vlc->table_allocated);

        if (!vlc->table)

            return -1;

    }

    return index;

}


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

                                hwaddr addr,

+                               unsigned size,

                                bool match_data,

void memory_region_del_eventfd(MemoryRegion *mr,

                               hwaddr addr,

                               unsigned size,

                               bool match_data,

                               uint64_t data,

                               EventNotifier *e)

{

    MemoryRegionIoeventfd mrfd = {

        .addr.start = int128_make64(addr),

        .addr.size = int128_make64(size),

        .match_data = match_data,

        .data = data,

        .e = e,

    };

    unsigned i;

    adjust_endianness(mr, &mrfd.data, size);

    memory_region_transaction_begin();

    for (i = 0; i < mr->ioeventfd_nb; ++i) {

        if (memory_region_ioeventfd_equal(mrfd, mr->ioeventfds[i])) {

            break;

        }

    }

    assert(i != mr->ioeventfd_nb);

    memmove(&mr->ioeventfds[i], &mr->ioeventfds[i+1],

            sizeof(*mr->ioeventfds) * (mr->ioeventfd_nb - (i+1)));

    --mr->ioeventfd_nb;

    mr->ioeventfds = g_realloc(mr->ioeventfds,

                                  sizeof(*mr->ioeventfds)*mr->ioeventfd_nb + 1);

    ioeventfd_update_pending |= mr->enabled;

    memory_region_transaction_commit();

}


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

     if (vs->vd->lock_key_sync)

+        vs->led = qemu_add_led_event_handler(kbd_leds, vs);
+
+
+
+    vs->mouse_mode_notifier.notify = check_pointer_type_change;

     qemu_add_mouse_mode_change_notifier(&vs->mouse_mode_notifier);

void vnc_init_state(VncState *vs)

{

    vs->initialized = true;

    VncDisplay *vd = vs->vd;

    bool first_client = QTAILQ_EMPTY(&vd->clients);

    vs->last_x = -1;

    vs->last_y = -1;

    vs->as.freq = 44100;

    vs->as.nchannels = 2;

    vs->as.fmt = AUD_FMT_S16;

    vs->as.endianness = 0;

    qemu_mutex_init(&vs->output_mutex);

    vs->bh = qemu_bh_new(vnc_jobs_bh, vs);

    QTAILQ_INSERT_TAIL(&vd->clients, vs, next);

    if (first_client) {

        vnc_update_server_surface(vd);

    }

    graphic_hw_update(vd->dcl.con);

    vnc_write(vs, "RFB 003.008\n", 12);

    vnc_flush(vs);

    vnc_read_when(vs, protocol_version, 12);

    reset_keys(vs);

    if (vs->vd->lock_key_sync)

        vs->led = qemu_add_led_event_handler(kbd_leds, vs);

    vs->mouse_mode_notifier.notify = check_pointer_type_change;

    qemu_add_mouse_mode_change_notifier(&vs->mouse_mode_notifier);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 AVFrame *ff_framequeue_take(FFFrameQueue *fq)

 {
+
+    FFFrameBucket *b;
+
+
+
     check_consistency(fq);

     av_assert1(fq->queued);

AVFrame *ff_framequeue_take(FFFrameQueue *fq)

{

    FFFrameBucket *b;

    check_consistency(fq);

    av_assert1(fq->queued);

    b = bucket(fq, 0);

    fq->queued--;

    fq->tail++;

    fq->tail &= fq->allocated - 1;

    fq->total_frames_tail++;

    fq->total_samples_tail += b->frame->nb_samples;

    check_consistency(fq);

    return b->frame;

}


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

     VirtioBusState *vbus = VIRTIO_BUS(qbus);

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

{

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

    VirtioBusState *vbus = VIRTIO_BUS(qbus);

    VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus);

    return !k->query_guest_notifiers ||

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

           hdev->force;

}


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

     trace_user_do_rt_sigreturn(env, frame_addr);
+
     if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1))

         goto badframe;

long do_rt_sigreturn(CPUM68KState *env)

{

    struct target_rt_sigframe *frame;

    abi_ulong frame_addr = env->aregs[7] - 4;

    target_sigset_t target_set;

    sigset_t set;

    trace_user_do_rt_sigreturn(env, frame_addr);

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

        goto badframe;

    target_to_host_sigset_internal(&set, &target_set);

    set_sigmask(&set);

    /* restore registers */

    if (target_rt_restore_ucontext(env, &frame->uc))

        goto badframe;

    if (do_sigaltstack(frame_addr +

                       offsetof(struct target_rt_sigframe, uc.tuc_stack),

                       0, get_sp_from_cpustate(env)) == -EFAULT)

        goto badframe;

    unlock_user_struct(frame, frame_addr, 0);

    return -TARGET_QEMU_ESIGRETURN;

badframe:

    unlock_user_struct(frame, frame_addr, 0);

    force_sig(TARGET_SIGSEGV);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
+static void adb_mouse_class_init(ObjectClass *oc, void *data)
+
+{
+
+    DeviceClass *dc = DEVICE_CLASS(oc);
+
+    ADBDeviceClass *adc = ADB_DEVICE_CLASS(oc);
+
+    ADBMouseClass *amc = ADB_MOUSE_CLASS(oc);
+

     amc->parent_realize = dc->realize;

static void adb_mouse_class_init(ObjectClass *oc, void *data)

{

    DeviceClass *dc = DEVICE_CLASS(oc);

    ADBDeviceClass *adc = ADB_DEVICE_CLASS(oc);

    ADBMouseClass *amc = ADB_MOUSE_CLASS(oc);

    amc->parent_realize = dc->realize;

    dc->realize = adb_mouse_realizefn;

    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);

    adc->devreq = adb_mouse_request;

    dc->reset = adb_mouse_reset;

    dc->vmsd = &vmstate_adb_mouse;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCursor *cursor)

+{

     QEMUCursor *c;

@@ -8,15 +8,15 @@

     size_t size;

+

     c = cursor_alloc(cursor->header.width, cursor->header.height);
+
+    c->hot_x = cursor->header.hot_spot_x;
+
+    c->hot_y = cursor->header.hot_spot_y;

+    switch (cursor->header.type) {

     case SPICE_CURSOR_TYPE_ALPHA:

static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCursor *cursor)

{

    QEMUCursor *c;

    uint8_t *image, *mask;

    size_t size;

    c = cursor_alloc(cursor->header.width, cursor->header.height);

    c->hot_x = cursor->header.hot_spot_x;

    c->hot_y = cursor->header.hot_spot_y;

    switch (cursor->header.type) {

    case SPICE_CURSOR_TYPE_ALPHA:

        size = sizeof(uint32_t) * cursor->header.width * cursor->header.height;

        memcpy(c->data, cursor->chunk.data, size);

        if (qxl->debug > 2) {

            cursor_print_ascii_art(c, "qxl/alpha");

        }

        break;

    case SPICE_CURSOR_TYPE_MONO:

        mask  = cursor->chunk.data;

        image = mask + cursor_get_mono_bpl(c) * c->width;

        cursor_set_mono(c, 0xffffff, 0x000000, image, 1, mask);

        if (qxl->debug > 2) {

            cursor_print_ascii_art(c, "qxl/mono");

        }

        break;

    default:

        fprintf(stderr, "%s: not implemented: type %d\n",

                __FUNCTION__, cursor->header.type);

        goto fail;

    }

    return c;

fail:

    cursor_put(c);

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     struct vmsvga_state_s *s = opaque;

+
+    if (s->vga.text_update)
+
         s->vga.text_update(&s->vga, chardata);

 }

static void vmsvga_text_update(void *opaque, console_ch_t *chardata)

{

    struct vmsvga_state_s *s = opaque;

    if (s->vga.text_update)

        s->vga.text_update(&s->vga, chardata);

}


--- a/source.c
+++ b/source.c
@@ -69,8 +69,8 @@
                                        offsetof(CPUState, fpscr), "fpscr");
     cpu_access_type = tcg_global_mem_new_i32(TCG_AREG0,
                                              offsetof(CPUState, access_type), "access_type");
+    /* register helpers */
+#define GEN_HELPER 2
+#include "helper.h"
+    done_init = 1;
+}

void ppc_translate_init(void)
{
    int i;
    char* p;
    size_t cpu_reg_names_size;
    static int done_init = 0;
    if (done_init)
        return;
    cpu_env = tcg_global_reg_new_ptr(TCG_AREG0, "env");
    p = cpu_reg_names;
    cpu_reg_names_size = sizeof(cpu_reg_names);
    for (i = 0; i < 8; i++) {
        snprintf(p, cpu_reg_names_size, "crf%d", i);
        cpu_crf[i] = tcg_global_mem_new_i32(TCG_AREG0,
                                            offsetof(CPUState, crf[i]), p);
        p += 5;
        cpu_reg_names_size -= 5;
    }
    for (i = 0; i < 32; i++) {
        snprintf(p, cpu_reg_names_size, "r%d", i);
        cpu_gpr[i] = tcg_global_mem_new(TCG_AREG0,
                                        offsetof(CPUState, gpr[i]), p);
        p += (i < 10) ? 3 : 4;
        cpu_reg_names_size -= (i < 10) ? 3 : 4;
#if !defined(TARGET_PPC64)
        snprintf(p, cpu_reg_names_size, "r%dH", i);
        cpu_gprh[i] = tcg_global_mem_new_i32(TCG_AREG0,
                                             offsetof(CPUState, gprh[i]), p);
        p += (i < 10) ? 4 : 5;
        cpu_reg_names_size -= (i < 10) ? 4 : 5;
        snprintf(p, cpu_reg_names_size, "fp%d", i);
        cpu_fpr[i] = tcg_global_mem_new_i64(TCG_AREG0,
                                            offsetof(CPUState, fpr[i]), p);
        p += (i < 10) ? 4 : 5;
        cpu_reg_names_size -= (i < 10) ? 4 : 5;
        snprintf(p, cpu_reg_names_size, "avr%dH", i);
#ifdef HOST_WORDS_BIGENDIAN
        cpu_avrh[i] = tcg_global_mem_new_i64(TCG_AREG0,
                                             offsetof(CPUState, avr[i].u64[0]), p);
#else
        cpu_avrh[i] = tcg_global_mem_new_i64(TCG_AREG0,
                                             offsetof(CPUState, avr[i].u64[1]), p);
        p += (i < 10) ? 6 : 7;
        cpu_reg_names_size -= (i < 10) ? 6 : 7;
        snprintf(p, cpu_reg_names_size, "avr%dL", i);
#ifdef HOST_WORDS_BIGENDIAN
        cpu_avrl[i] = tcg_global_mem_new_i64(TCG_AREG0,
                                             offsetof(CPUState, avr[i].u64[1]), p);
#else
        cpu_avrl[i] = tcg_global_mem_new_i64(TCG_AREG0,
                                             offsetof(CPUState, avr[i].u64[0]), p);
        p += (i < 10) ? 6 : 7;
        cpu_reg_names_size -= (i < 10) ? 6 : 7;
    }
    cpu_nip = tcg_global_mem_new(TCG_AREG0,
                                 offsetof(CPUState, nip), "nip");
    cpu_msr = tcg_global_mem_new(TCG_AREG0,
                                 offsetof(CPUState, msr), "msr");
    cpu_ctr = tcg_global_mem_new(TCG_AREG0,
                                 offsetof(CPUState, ctr), "ctr");
    cpu_lr = tcg_global_mem_new(TCG_AREG0,
                                offsetof(CPUState, lr), "lr");
    cpu_xer = tcg_global_mem_new(TCG_AREG0,
                                 offsetof(CPUState, xer), "xer");
    cpu_reserve = tcg_global_mem_new(TCG_AREG0,
                                     offsetof(CPUState, reserve_addr),
                                     "reserve_addr");
    cpu_fpscr = tcg_global_mem_new_i32(TCG_AREG0,
                                       offsetof(CPUState, fpscr), "fpscr");
    cpu_access_type = tcg_global_mem_new_i32(TCG_AREG0,
                                             offsetof(CPUState, access_type), "access_type");
    /* register helpers */
#define GEN_HELPER 2
#include "helper.h"
    done_init = 1;
}


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

     return (rusage.ru_utime.tv_sec * 1000000LL) + rusage.ru_utime.tv_usec;

+#elif defined(__MINGW32__)
+
+  return av_gettime();
+
+#endif

 }

static int64_t getutime(void)

{

#ifdef HAVE_GETRUSAGE

    struct rusage rusage;

    getrusage(RUSAGE_SELF, &rusage);

    return (rusage.ru_utime.tv_sec * 1000000LL) + rusage.ru_utime.tv_usec;

#elif defined(__MINGW32__)

  return av_gettime();

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void encode_frame(VC2EncContext *s, const AVFrame *frame,
+
                          const char *aux_data, int field)

 {
@@ -8,15 +8,15 @@

+    /* Sequence header */
+
+    encode_parse_info(s, DIRAC_PCODE_SEQ_HEADER);
+
+    encode_seq_header(s);
+

+
+    /* Encoder version */

     if (aux_data) {

static void encode_frame(VC2EncContext *s, const AVFrame *frame,

                         const char *aux_data, int field)

{

    int i;

    /* Sequence header */

    encode_parse_info(s, DIRAC_PCODE_SEQ_HEADER);

    encode_seq_header(s);

    /* Encoder version */

    if (aux_data) {

        encode_parse_info(s, DIRAC_PCODE_AUX);

        avpriv_put_string(&s->pb, aux_data, 1);

    }

    /* Picture header */

    encode_parse_info(s, DIRAC_PCODE_PICTURE_HQ);

    encode_picture_start(s);

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

        s->transform_args[i].ctx   = s;

        s->transform_args[i].field = field;

        s->transform_args[i].plane = &s->plane[i];

        s->transform_args[i].idata = frame->data[i];

        s->transform_args[i].istride = frame->linesize[i];

    }

    /* Do a DWT transform */

    s->avctx->execute(s->avctx, dwt_plane, s->transform_args, NULL, 3,

                      sizeof(TransformArgs));

    /* Calculate per-slice quantizers and sizes */

    calc_slice_sizes(s);

    /* Init planes and encode slices */

    encode_slices(s);

    /* End sequence */

    encode_parse_info(s, DIRAC_PCODE_END_SEQ);

}


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

             s->sssr |= SSSR_TFS;

+        else
+
+            s->sssr &= ~SSSR_TFS;
+
+        if (s->rx_level)

             s->sssr |= SSSR_RNE;

static void pxa2xx_ssp_fifo_update(PXA2xxSSPState *s)

{

    s->sssr &= ~(0xf << 12);	/* Clear RFL */

    s->sssr &= ~(0xf << 8);	/* Clear TFL */

    s->sssr &= ~SSSR_TNF;

    if (s->enable) {

        s->sssr |= ((s->rx_level - 1) & 0xf) << 12;

        if (s->rx_level >= SSCR1_RFT(s->sscr[1]))

            s->sssr |= SSSR_RFS;

        else

            s->sssr &= ~SSSR_RFS;

        if (0 <= SSCR1_TFT(s->sscr[1]))

            s->sssr |= SSSR_TFS;

        else

            s->sssr &= ~SSSR_TFS;

        if (s->rx_level)

            s->sssr |= SSSR_RNE;

        else

            s->sssr &= ~SSSR_RNE;

        s->sssr |= SSSR_TNF;

    }

    pxa2xx_ssp_int_update(s);

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
     GetBitContext gb;

     int i;
+

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

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

    GetBitContext gb;

    int i;

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

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

        read_len_table(s->len[i], &gb);

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

            return -1;

        }

#if 0

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

printf("%6X, %2d,  %3d\n", s->bits[i][j], s->len[i][j], j);

}

#endif

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

        init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0);

    }

    generate_joint_tables(s);

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

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void write_strip_header(CinepakEncContext *s, int y, int h, int keyframe, unsigned char *buf, int strip_size)
+
 {
+
     buf[0] = keyframe ? 0x11: 0x10;
+
     AV_WB24(&buf[1], strip_size + STRIP_HEADER_SIZE);

     AV_WB16(&buf[4], y);

static void write_strip_header(CinepakEncContext *s, int y, int h, int keyframe, unsigned char *buf, int strip_size)

{

    buf[0] = keyframe ? 0x11: 0x10;

    AV_WB24(&buf[1], strip_size + STRIP_HEADER_SIZE);

    AV_WB16(&buf[4], y);

    AV_WB16(&buf[6], 0);

    AV_WB16(&buf[8], h);

    AV_WB16(&buf[10], s->w);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static inline void read_mem(IVState *s, uint64_t off, void *buf, size_t len)

 {
+
     QTestState *qtest = global_qtest;

static inline void read_mem(IVState *s, uint64_t off, void *buf, size_t len)

{

    QTestState *qtest = global_qtest;

    global_qtest = s->qtest;

    qpci_memread(s->dev, s->mem_base + off, buf, len);

    global_qtest = qtest;

}


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

 {

+    uint8_t *packet, mask;
+
+    int mask_byte;
+
+

     if (len > 255) {

static inline uint8_t *bt_hci_event_start(struct bt_hci_s *hci,

                int evt, int len)

{

    uint8_t *packet, mask;

    int mask_byte;

    if (len > 255) {

        fprintf(stderr, "%s: HCI event params too long (%ib)\n",

                        __FUNCTION__, len);

        exit(-1);

    }

    mask_byte = (evt - 1) >> 3;

    mask = 1 << ((evt - 1) & 3);

    if (mask & bt_event_reserved_mask[mask_byte] & ~hci->event_mask[mask_byte])

        return NULL;

    packet = hci->evt_packet(hci->opaque);

    packet[0] = evt;

    packet[1] = len;

    return &packet[2];

}


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

             /* Not in the list, so add the first input as a open_output */

+            input->name = name;
+
+            insert_inout(open_outputs, input);
+
+
         *buf += strspn(*buf, WHITESPACES);

         pad++;

static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs,

                         AVFilterInOut **open_inputs,

                         AVFilterInOut **open_outputs, AVClass *log_ctx)

{

    int ret, pad = 0;

    while (**buf == '[') {

        char *name = parse_link_name(buf, log_ctx);

        AVFilterInOut *match;

        AVFilterInOut *input = *curr_inputs;

        *curr_inputs = (*curr_inputs)->next;

        if (!name)

        /* First check if the label is not in the open_inputs list */

        match = extract_inout(name, open_inputs);

        if (match) {

            if ((ret = link_filter(input->filter_ctx, input->pad_idx,

                                   match->filter_ctx, match->pad_idx, log_ctx)) < 0)

                return ret;

            av_free(match->name);

            av_free(name);

            av_free(match);

            av_free(input);

        } else {

            /* Not in the list, so add the first input as a open_output */

            input->name = name;

            insert_inout(open_outputs, input);

        *buf += strspn(*buf, WHITESPACES);

        pad++;

    return pad;


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int64_t coroutine_fn vvfat_co_get_block_status(BlockDriverState *bs,
+
+	int64_t sector_num, int nb_sectors, int *n, BlockDriverState **file)

 {

static int64_t coroutine_fn vvfat_co_get_block_status(BlockDriverState *bs,

	int64_t sector_num, int nb_sectors, int *n, BlockDriverState **file)

{

    BDRVVVFATState* s = bs->opaque;

    *n = s->sector_count - sector_num;

    if (*n > nb_sectors) {

        *n = nb_sectors;

    } else if (*n < 0) {

        return 0;

    }

    return BDRV_BLOCK_DATA;

}


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

 {

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

 #else

void qemu_spice_create_primary_surface(SimpleSpiceDisplay *ssd, uint32_t id,

                                       QXLDevSurfaceCreate *surface,

                                       qxl_async_io async)

{

    if (async != QXL_SYNC) {

#if SPICE_INTERFACE_QXL_MINOR >= 1

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

#else

        abort();

#endif

    } else {

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

    }

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static inline int put_dwords(uint32_t addr, uint32_t *buf, int num)

 {
+
+    int i;
+
+
+
     for(i = 0; i < num; i++, buf++, addr += sizeof(*buf)) {

         uint32_t tmp = cpu_to_le32(*buf);

static inline int put_dwords(uint32_t addr, uint32_t *buf, int num)

{

    int i;

    for(i = 0; i < num; i++, buf++, addr += sizeof(*buf)) {

        uint32_t tmp = cpu_to_le32(*buf);

        cpu_physical_memory_rw(addr,(uint8_t *)&tmp, sizeof(tmp), 1);

    }

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
 	if ((x || env->cc_op == CC_OP_ADDC)

 	    && flags & Z_FLAG)
+
+		env->cc_mask &= ~Z_FLAG;
+
+
+
 	/* all insn clear the x-flag except setf or clrf.  */

 	env->pregs[PR_CCS] &= ~(env->cc_mask | X_FLAG);

static void evaluate_flags_writeback(uint32_t flags)

{

	int x;

	/* Extended arithmetics, leave the z flag alone.  */

	x = env->cc_x;

	if ((x || env->cc_op == CC_OP_ADDC)

	    && flags & Z_FLAG)

		env->cc_mask &= ~Z_FLAG;

	/* all insn clear the x-flag except setf or clrf.  */

	env->pregs[PR_CCS] &= ~(env->cc_mask | X_FLAG);

	flags &= env->cc_mask;

	env->pregs[PR_CCS] |= flags;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int virtio_scsi_load(QEMUFile *f, void *opaque, int version_id)

+{

     VirtIOSCSI *s = opaque;

static int virtio_scsi_load(QEMUFile *f, void *opaque, int version_id)

{

    VirtIOSCSI *s = opaque;

    virtio_load(&s->vdev, f);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void palette8torgb16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
+
+{
+
 	long i;

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

void palette8torgb16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)

{

	long i;

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

		((uint16_t *)dst)[i] = ((uint16_t *)palette)[ src[i] ];

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 bool runstate_needs_reset(void)
+
 {

     return runstate_check(RUN_STATE_INTERNAL_ERROR) ||

bool runstate_needs_reset(void)

{

    return runstate_check(RUN_STATE_INTERNAL_ERROR) ||

        runstate_check(RUN_STATE_SHUTDOWN) ||

        runstate_check(RUN_STATE_GUEST_PANICKED);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+bool qemu_file_is_writable(QEMUFile *f)

 {

bool qemu_file_is_writable(QEMUFile *f)

{

    return f->ops->writev_buffer || f->ops->put_buffer;

}


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

 {

+    int i;
+
+    long long n_removed_local = 0;
+
+

     struct list_element *el, *prev_el;

static void rcu_qtest(const char *test, int duration, int nreaders)

{

    int i;

    long long n_removed_local = 0;

    struct list_element *el, *prev_el;

    rcu_qtest_init();

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

        create_thread(rcu_q_reader);

    }

    create_thread(rcu_q_updater);

    rcu_qtest_run(duration, nreaders);

    QLIST_FOREACH_SAFE_RCU(prev_el, &Q_list_head, entry, el) {

        QLIST_REMOVE_RCU(prev_el, entry);

        call_rcu1(&prev_el->rcu, reclaim_list_el);

        n_removed_local++;

    }

    atomic_add(&n_nodes_removed, n_removed_local);

    synchronize_rcu();

    while (n_nodes_removed > n_reclaims) {

        g_usleep(100);

        synchronize_rcu();

    }

    if (g_test_in_charge) {

        g_assert_cmpint(n_nodes_removed, ==, n_reclaims);

    } else {

        printf("%s: %d readers; 1 updater; nodes read: "  \

               "%lld, nodes removed: %lld; nodes reclaimed: %lld\n",

               test, nthreadsrunning - 1, n_reads, n_nodes_removed, n_reclaims);

        exit(0);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int film_read_close(AVFormatContext *s)
+
+{
+
+    FilmDemuxContext *film = s->priv_data;

static int film_read_close(AVFormatContext *s)

{

    FilmDemuxContext *film = s->priv_data;

    av_free(film->sample_table);

    av_free(film->stereo_buffer);

    return 0;

}


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

 	DIS(fprintf (logfile, "addi.%c $r%u, $r%u, $acr\n",

+		  memsize_char(memsize_zz(dc)), dc->op2, dc->op1));
+
+	cris_cc_mask(dc, 0);
+
+	t0 = tcg_temp_new(TCG_TYPE_TL);

 	tcg_gen_shl_tl(t0, cpu_R[dc->op2], tcg_const_tl(dc->zzsize));

static unsigned int dec_addi_acr(DisasContext *dc)

{

	TCGv t0;

	DIS(fprintf (logfile, "addi.%c $r%u, $r%u, $acr\n",

		  memsize_char(memsize_zz(dc)), dc->op2, dc->op1));

	cris_cc_mask(dc, 0);

	t0 = tcg_temp_new(TCG_TYPE_TL);

	tcg_gen_shl_tl(t0, cpu_R[dc->op2], tcg_const_tl(dc->zzsize));

	tcg_gen_add_tl(cpu_R[R_ACR], cpu_R[dc->op1], t0);

	tcg_temp_free(t0);

	return 2;

}


void fw_cfg_add_i64(FWCfgState *s, uint16_t key, uint64_t value)

{

    uint64_t *copy;

    copy = g_malloc(sizeof(value));

    *copy = cpu_to_le64(value);

    fw_cfg_add_bytes(s, key, (uint8_t *)copy, sizeof(value));

}


--- a/source.c
+++ b/source.c
@@ -65,9 +65,9 @@
     inet_aton(slirp_special_ip, &special_addr);

     alias_addr.s_addr = special_addr.s_addr | htonl(CTL_ALIAS);
+
+    getouraddr();
+
+    register_savevm("slirp", 0, 1, slirp_state_save, slirp_state_load, NULL);
+
 }

void slirp_init(int restricted, const char *special_ip)

{

    //    debug_init("/tmp/slirp.log", DEBUG_DEFAULT);

#ifdef _WIN32

    {

        WSADATA Data;

        WSAStartup(MAKEWORD(2,0), &Data);

	atexit(slirp_cleanup);

    }

#endif

    link_up = 1;

    slirp_restrict = restricted;

    if_init();

    ip_init();

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

    m_init();

    /* set default addresses */

    inet_aton("127.0.0.1", &loopback_addr);

    if (get_dns_addr(&dns_addr) < 0) {

        dns_addr = loopback_addr;

        fprintf (stderr, "Warning: No DNS servers found\n");

    }

    if (special_ip)

        slirp_special_ip = special_ip;

    inet_aton(slirp_special_ip, &special_addr);

    alias_addr.s_addr = special_addr.s_addr | htonl(CTL_ALIAS);

    getouraddr();

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

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void test_acpi_q35_tcg_cphp(void)
+
+{
+
+    test_data data;
+

     memset(&data, 0, sizeof(data));

static void test_acpi_q35_tcg_cphp(void)

{

    test_data data;

    memset(&data, 0, sizeof(data));

    data.machine = MACHINE_Q35;

    data.variant = ".cphp";

    test_acpi_one(" -smp 2,cores=3,sockets=2,maxcpus=6"

                  " -numa node -numa node",

                  &data);

    free_test_data(&data);

}


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

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

     p = cpu_reg_names;

static void alpha_translate_init(void)

{

    int i;

    char *p;

    static int done_init = 0;

    if (done_init)

        return;

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

    p = cpu_reg_names;

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

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

        cpu_ir[i] = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0,

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

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

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

        cpu_fir[i] = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0,

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

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

    }

    cpu_pc = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0,

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

    cpu_lock = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0,

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

    /* register helpers */

#undef DEF_HELPER

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

#include "helper.h"

    done_init = 1;

}


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

     QString *qstring;

+
+
+    qstring = qstring_from_str("foo");
+
     fail_unless(qobject_to_qstring(QOBJECT(qstring)) == qstring);

START_TEST(qobject_to_qstring_test)

{

    QString *qstring;

    qstring = qstring_from_str("foo");

    fail_unless(qobject_to_qstring(QOBJECT(qstring)) == qstring);

    QDECREF(qstring);

}


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

     tmpl = load_reg(s, rlow);

+    tmph = load_reg(s, rhigh);
+
+    tmp = tcg_temp_new(TCG_TYPE_I64);
+
+    tcg_gen_concat_i32_i64(tmp, tmpl, tmph);

     dead_tmp(tmpl);

static void gen_addq(DisasContext *s, TCGv val, int rlow, int rhigh)

{

    TCGv tmp;

    TCGv tmpl;

    TCGv tmph;

    /* Load 64-bit value rd:rn.  */

    tmpl = load_reg(s, rlow);

    tmph = load_reg(s, rhigh);

    tmp = tcg_temp_new(TCG_TYPE_I64);

    tcg_gen_concat_i32_i64(tmp, tmpl, tmph);

    dead_tmp(tmpl);

    dead_tmp(tmph);

    tcg_gen_add_i64(val, val, tmp);

}


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

         exit(1);

+    }
+
+    /* Round up optiom rom size to the next 2k boundary */
+
+    size = (size + 2047) & ~2047;

     option_rom_setup_reset(start, size);

static int load_option_rom(const char *oprom, target_phys_addr_t start,

                           target_phys_addr_t end)

{

    int size;

    char *filename;

    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, oprom);

    if (filename) {

        size = get_image_size(filename);

        if (size > 0 && start + size > end) {

            fprintf(stderr, "Not enough space to load option rom '%s'\n",

                    oprom);

            exit(1);

        }

        size = load_image_targphys(filename, start, end - start);

        qemu_free(filename);

    } else {

        size = -1;

    }

    if (size < 0) {

        fprintf(stderr, "Could not load option rom '%s'\n", oprom);

        exit(1);

    }

    /* Round up optiom rom size to the next 2k boundary */

    size = (size + 2047) & ~2047;

    option_rom_setup_reset(start, size);

    return size;

}


--- a/source.c
+++ b/source.c
@@ -27,9 +27,9 @@
             ERROR("Device no longer matches filter after interface info "

                   "change, disconnecting!\n");
+
+        }
+
+    }
+
 }

static void usbredir_interface_info(void *priv,

    struct usb_redir_interface_info_header *interface_info)

{

    USBRedirDevice *dev = priv;

    dev->interface_info = *interface_info;

    /*

     * If we receive interface info after the device has already been

     * connected (ie on a set_config), re-check the filter.

     */

    if (qemu_timer_pending(dev->attach_timer) || dev->dev.attached) {

        if (usbredir_check_filter(dev)) {

            ERROR("Device no longer matches filter after interface info "

                  "change, disconnecting!\n");

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -9,10 +9,10 @@
     GtkDisplayState *s = vc->s;

+
+    gtk_release_modifiers(s);
+
+

     return TRUE;

static gboolean gd_focus_out_event(GtkWidget *widget,

                                   GdkEventCrossing *crossing, gpointer opaque)

{

    VirtualConsole *vc = opaque;

    GtkDisplayState *s = vc->s;

    gtk_release_modifiers(s);

    return TRUE;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void vmport_class_initfn(ObjectClass *klass, void *data)

 {
+
     DeviceClass *dc = DEVICE_CLASS(klass);

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    dc->realize = vmport_realizefn;

    dc->no_user = 1;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static inline void RENAME(yuv2rgb565_2)(SwsContext *c, const uint16_t *buf0,
+
+                                        const uint16_t *buf1, const uint16_t *ubuf0,

                                         const uint16_t *ubuf1, const uint16_t *vbuf0,

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

                                        const uint16_t *buf1, const uint16_t *ubuf0,

                                        const uint16_t *ubuf1, const uint16_t *vbuf0,

                                        const uint16_t *vbuf1, const uint16_t *abuf0,

                                        const uint16_t *abuf1, uint8_t *dest,

                                        int dstW, int yalpha, int uvalpha, int y)

{

    x86_reg uv_off = c->uv_off << 1;

    //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(

    __asm__ volatile(

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

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

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

        YSCALEYUV2RGB(%%REGBP, %5, %6)

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

        /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */

#ifdef DITHER1XBPP

        "paddusb "BLUE_DITHER"(%5), %%mm2      \n\t"

        "paddusb "GREEN_DITHER"(%5), %%mm4      \n\t"

        "paddusb "RED_DITHER"(%5), %%mm5      \n\t"

#endif

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

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

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

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

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

    );

}


--- a/source.c
+++ b/source.c
@@ -3,9 +3,9 @@
                                           int *beta, int *tc, uint8_t *no_p,

                                           uint8_t *no_q)
+
+{
+
     FUNC(hevc_loop_filter_luma)(pix, sizeof(pixel), stride,

                                 beta, tc, no_p, no_q);

static void FUNC(hevc_v_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride,

                                          int *beta, int *tc, uint8_t *no_p,

                                          uint8_t *no_q)

{

    FUNC(hevc_loop_filter_luma)(pix, sizeof(pixel), stride,

                                beta, tc, no_p, no_q);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void IRQ_check(OpenPICState *opp, IRQ_queue_t *q)

 {

static void IRQ_check(OpenPICState *opp, IRQ_queue_t *q)

{

    int next, i;

    int priority;

    next = -1;

    priority = -1;

    if (!q->pending) {

        /* IRQ bitmap is empty */

        goto out;

    }

    for (i = 0; i < opp->max_irq; i++) {

        if (IRQ_testbit(q, i)) {

            DPRINTF("IRQ_check: irq %d set ipvp_pr=%d pr=%d\n",

                    i, IPVP_PRIORITY(opp->src[i].ipvp), priority);

            if (IPVP_PRIORITY(opp->src[i].ipvp) > priority) {

                next = i;

                priority = IPVP_PRIORITY(opp->src[i].ipvp);

            }

        }

    }

out:

    q->next = next;

    q->priority = priority;

}


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

+    /* Lest we fail to service interrupts in a timely manner, limit the
+
+       amount of work we're willing to do.  For now, let's cap at 8k.  */
+
+    for (len = 0; len < 0x2000; ++len) {

         if (str + len == end) {

void HELPER(srst)(CPUS390XState *env, uint32_t r1, uint32_t r2)

{

    uintptr_t ra = GETPC();

    uint64_t end, str;

    uint32_t len;

    uint8_t v, c = env->regs[0];

    /* Bits 32-55 must contain all 0.  */

    if (env->regs[0] & 0xffffff00u) {

        cpu_restore_state(ENV_GET_CPU(env), ra);

        program_interrupt(env, PGM_SPECIFICATION, 6);

    }

    str = get_address(env, r2);

    end = get_address(env, r1);

    /* Lest we fail to service interrupts in a timely manner, limit the

       amount of work we're willing to do.  For now, let's cap at 8k.  */

    for (len = 0; len < 0x2000; ++len) {

        if (str + len == end) {

            /* Character not found.  R1 & R2 are unmodified.  */

            env->cc_op = 2;

            return;

        }

        v = cpu_ldub_data_ra(env, str + len, ra);

        if (v == c) {

            /* Character found.  Set R1 to the location; R2 is unmodified.  */

            env->cc_op = 1;

            set_address(env, r1, str + len);

            return;

        }

    }

    /* CPU-determined bytes processed.  Advance R2 to next byte to process.  */

    env->cc_op = 3;

    set_address(env, r2, str + len);

}


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

+                               uint64_t val, unsigned size)
+
 {

     MMIOState *s = opaque;

static void mmio_ide_cmd_write(void *opaque, target_phys_addr_t addr,

                               uint64_t val, unsigned size)

{

    MMIOState *s = opaque;

    ide_cmd_write(&s->bus, 0, val);

}


--- a/source.c
+++ b/source.c
@@ -6,9 +6,9 @@
     if (s->streams[0]->codec->pix_fmt == PIX_FMT_YUV411P) {
         av_log(s, AV_LOG_ERROR, "Warning: generating rarely used 4:1:1 YUV stream, some mjpegtools might not work.\n");
     else if ((s->streams[0]->codec->pix_fmt != PIX_FMT_YUV420P) &&
+             (s->streams[0]->codec->pix_fmt != PIX_FMT_YUV422P) &&
+             (s->streams[0]->codec->pix_fmt != PIX_FMT_GRAY8) &&
+             (s->streams[0]->codec->pix_fmt != PIX_FMT_YUV444P)) {
         av_log(s, AV_LOG_ERROR, "ERROR: yuv4mpeg only handles yuv444p, yuv422p, yuv420p, yuv411p and gray pixel formats. Use -pix_fmt to select one.\n");
         return AVERROR(EIO);
     *first_pkt = 1;

static int yuv4_write_header(AVFormatContext *s)
{
    int* first_pkt = s->priv_data;
    if (s->nb_streams != 1)
        return AVERROR(EIO);
    if (s->streams[0]->codec->pix_fmt == PIX_FMT_YUV411P) {
        av_log(s, AV_LOG_ERROR, "Warning: generating rarely used 4:1:1 YUV stream, some mjpegtools might not work.\n");
    else if ((s->streams[0]->codec->pix_fmt != PIX_FMT_YUV420P) &&
             (s->streams[0]->codec->pix_fmt != PIX_FMT_YUV422P) &&
             (s->streams[0]->codec->pix_fmt != PIX_FMT_GRAY8) &&
             (s->streams[0]->codec->pix_fmt != PIX_FMT_YUV444P)) {
        av_log(s, AV_LOG_ERROR, "ERROR: yuv4mpeg only handles yuv444p, yuv422p, yuv420p, yuv411p and gray pixel formats. Use -pix_fmt to select one.\n");
        return AVERROR(EIO);
    *first_pkt = 1;
    return 0;


--- a/source.c
+++ b/source.c
@@ -3,5 +3,5 @@
     AVFixedDSPContext * fdsp = av_malloc(sizeof(AVFixedDSPContext));
     fdsp->vector_fmul_window_scaled = vector_fmul_window_fixed_scaled_c;
     fdsp->vector_fmul_window = vector_fmul_window_fixed_c;
+    return fdsp;
 }

AVFixedDSPContext * avpriv_alloc_fixed_dsp(int bit_exact)
{
    AVFixedDSPContext * fdsp = av_malloc(sizeof(AVFixedDSPContext));
    fdsp->vector_fmul_window_scaled = vector_fmul_window_fixed_scaled_c;
    fdsp->vector_fmul_window = vector_fmul_window_fixed_c;
    return fdsp;
}


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

     addr = socket_local_address(fd, errp);
+
+
+
+
+

     if (addr->type == SOCKET_ADDRESS_TYPE_UNIX

void socket_listen_cleanup(int fd, Error **errp)

{

    SocketAddress *addr;

    addr = socket_local_address(fd, errp);

    if (addr->type == SOCKET_ADDRESS_TYPE_UNIX

        && addr->u.q_unix.path) {

        if (unlink(addr->u.q_unix.path) < 0 && errno != ENOENT) {

            error_setg_errno(errp, errno,

                             "Failed to unlink socket %s",

                             addr->u.q_unix.path);

    qapi_free_SocketAddress(addr);


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                                            Error **errp,

                                            gpointer opaque)
+
 {

     QIOChannelSocket *ioc = QIO_CHANNEL_SOCKET(qio_task_get_source(task));

static int qio_channel_socket_dgram_worker(QIOTask *task,

                                           Error **errp,

                                           gpointer opaque)

{

    QIOChannelSocket *ioc = QIO_CHANNEL_SOCKET(qio_task_get_source(task));

    struct QIOChannelSocketDGramWorkerData *data = opaque;

    int ret;

    /* socket_dgram() blocks in DNS lookups, so we must use a thread */

    ret = qio_channel_socket_dgram_sync(ioc,

                                        data->localAddr,

                                        data->remoteAddr,

                                        errp);

    object_unref(OBJECT(ioc));

    return ret;

}


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

     MirrorBlockJob *s = container_of(job, MirrorBlockJob, common);

+

     if (speed < 0) {

static void mirror_set_speed(BlockJob *job, int64_t speed, Error **errp)

{

    MirrorBlockJob *s = container_of(job, MirrorBlockJob, common);

    if (speed < 0) {

        error_setg(errp, QERR_INVALID_PARAMETER, "speed");

        return;

    }

    ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE, SLICE_TIME);

}


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

         return 0;

+
+
+    if(!(gctx->link_filter = avfilter_open(&vf_graph_dummy, NULL)))
+
+        return -1;

     if(avfilter_init_filter(gctx->link_filter, NULL, ctx))

static int init(AVFilterContext *ctx, const char *args, void *opaque)

{

    GraphContext *gctx = ctx->priv;

    if(!args)

        return 0;

    if(!(gctx->link_filter = avfilter_open(&vf_graph_dummy, NULL)))

        return -1;

    if(avfilter_init_filter(gctx->link_filter, NULL, ctx))

        goto fail;

    return graph_load_chain_from_string(ctx, args, NULL, NULL);

fail:

    avfilter_destroy(gctx->link_filter);

    return -1;

}


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

         struct kvm_msr_entry entry;

+    } msr_data;
+
+
+
+    kvm_msr_entry_set(&msr_data.entry, MSR_IA32_FEATURE_CONTROL,

                       cpu->env.msr_ia32_feature_control);

static int kvm_put_msr_feature_control(X86CPU *cpu)

{

    struct {

        struct kvm_msrs info;

        struct kvm_msr_entry entry;

    } msr_data;

    kvm_msr_entry_set(&msr_data.entry, MSR_IA32_FEATURE_CONTROL,

                      cpu->env.msr_ia32_feature_control);

    msr_data.info.nmsrs = 1;

    return kvm_vcpu_ioctl(CPU(cpu), KVM_SET_MSRS, &msr_data);

}


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

                       size_t size, Error **errp)

+{

     Error *err = NULL;

void visit_start_list(Visitor *v, const char *name, GenericList **list,

                      size_t size, Error **errp)

{

    Error *err = NULL;

    assert(!list || size >= sizeof(GenericList));

    v->start_list(v, name, list, size, &err);

    if (list && v->type == VISITOR_INPUT) {

        assert(!(err && *list));

    }

    error_propagate(errp, err);

}


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

     TCGv t2 = tcg_temp_local_new();

+    tcg_gen_andi_tl(t2, cpu_gpr[rB(ctx->opcode)], 0x1F);
+
+    tcg_gen_shr_tl(t0, cpu_gpr[rS(ctx->opcode)], t2);
+
+    tcg_gen_sar_tl(t1, cpu_gpr[rS(ctx->opcode)], t2);

     tcg_gen_subfi_tl(t2, 32, t2);

static void gen_sraq(DisasContext *ctx)

{

    int l1 = gen_new_label();

    int l2 = gen_new_label();

    TCGv t0 = tcg_temp_new();

    TCGv t1 = tcg_temp_local_new();

    TCGv t2 = tcg_temp_local_new();

    tcg_gen_andi_tl(t2, cpu_gpr[rB(ctx->opcode)], 0x1F);

    tcg_gen_shr_tl(t0, cpu_gpr[rS(ctx->opcode)], t2);

    tcg_gen_sar_tl(t1, cpu_gpr[rS(ctx->opcode)], t2);

    tcg_gen_subfi_tl(t2, 32, t2);

    tcg_gen_shl_tl(t2, cpu_gpr[rS(ctx->opcode)], t2);

    tcg_gen_or_tl(t0, t0, t2);

    gen_store_spr(SPR_MQ, t0);

    tcg_gen_andi_tl(t0, cpu_gpr[rB(ctx->opcode)], 0x20);

    tcg_gen_brcondi_tl(TCG_COND_EQ, t2, 0, l1);

    tcg_gen_mov_tl(t2, cpu_gpr[rS(ctx->opcode)]);

    tcg_gen_sari_tl(t1, cpu_gpr[rS(ctx->opcode)], 31);

    gen_set_label(l1);

    tcg_temp_free(t0);

    tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], t1);

    tcg_gen_movi_tl(cpu_ca, 0);

    tcg_gen_brcondi_tl(TCG_COND_GE, t1, 0, l2);

    tcg_gen_brcondi_tl(TCG_COND_EQ, t2, 0, l2);

    tcg_gen_movi_tl(cpu_ca, 1);

    gen_set_label(l2);

    tcg_temp_free(t1);

    tcg_temp_free(t2);

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

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

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void chassis_control(IPMIBmcSim *ibs,

                             uint8_t *cmd, unsigned int cmd_len,
+
                             uint8_t *rsp, unsigned int *rsp_len,

                             unsigned int max_rsp_len)

static void chassis_control(IPMIBmcSim *ibs,

                            uint8_t *cmd, unsigned int cmd_len,

                            uint8_t *rsp, unsigned int *rsp_len,

                            unsigned int max_rsp_len)

{

    IPMIInterface *s = ibs->parent.intf;

    IPMIInterfaceClass *k = IPMI_INTERFACE_GET_CLASS(s);

    IPMI_CHECK_CMD_LEN(3);

    switch (cmd[2] & 0xf) {

    case 0: /* power down */

        rsp[2] = k->do_hw_op(s, IPMI_POWEROFF_CHASSIS, 0);

        break;

    case 1: /* power up */

        rsp[2] = k->do_hw_op(s, IPMI_POWERON_CHASSIS, 0);

        break;

    case 2: /* power cycle */

        rsp[2] = k->do_hw_op(s, IPMI_POWERCYCLE_CHASSIS, 0);

        break;

    case 3: /* hard reset */

        rsp[2] = k->do_hw_op(s, IPMI_RESET_CHASSIS, 0);

        break;

    case 4: /* pulse diagnostic interrupt */

        rsp[2] = k->do_hw_op(s, IPMI_PULSE_DIAG_IRQ, 0);

        break;

    case 5: /* soft shutdown via ACPI by overtemp emulation */

        rsp[2] = k->do_hw_op(s,

                             IPMI_SHUTDOWN_VIA_ACPI_OVERTEMP, 0);

        break;

    default:

        rsp[2] = IPMI_CC_INVALID_DATA_FIELD;

        return;

    }

}


AVRational av_d2q(double d, int max)

{

    AVRational a;

#define LOG2  0.69314718055994530941723212145817656807550013436025

    int exponent;

    int64_t den;

    if (isnan(d))

        return (AVRational) { 0,0 };

    if (isinf(d))

        return (AVRational) { d < 0 ? -1 : 1, 0 };

    exponent = FFMAX( (int)(log(fabs(d) + 1e-20)/LOG2), 0);

    den = 1LL << (61 - exponent);

    av_reduce(&a.num, &a.den, (int64_t)(d * den + 0.5), den, max);

    return a;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void bt_dummy_lmp_disconnect_master(struct bt_link_s *link)
+
 {

     fprintf(stderr, "%s: stray LMP_detach received, fixme\n", __func__);

static void bt_dummy_lmp_disconnect_master(struct bt_link_s *link)

{

    fprintf(stderr, "%s: stray LMP_detach received, fixme\n", __func__);

    exit(-1);

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     pci_config_set_device_id(d->config, PCI_DEVICE_ID_APPLE_UNI_N_PCI);

     d->config[0x08] = 0x00; // revision
+
+    pci_config_set_class(d->config, PCI_CLASS_BRIDGE_HOST);
+
+    d->config[0x0C] = 0x08; // cache_line_size
+
     d->config[0x0D] = 0x10; // latency_timer

     d->config[0x34] = 0x00; // capabilities_pointer

static int unin_main_pci_host_init(PCIDevice *d)

{

    pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_APPLE);

    pci_config_set_device_id(d->config, PCI_DEVICE_ID_APPLE_UNI_N_PCI);

    d->config[0x08] = 0x00; // revision

    pci_config_set_class(d->config, PCI_CLASS_BRIDGE_HOST);

    d->config[0x0C] = 0x08; // cache_line_size

    d->config[0x0D] = 0x10; // latency_timer

    d->config[0x34] = 0x00; // capabilities_pointer

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void gxf_write_padding(ByteIOContext *pb, offset_t to_pad)

 {
+
+    while (to_pad--) {

         put_byte(pb, 0);

static void gxf_write_padding(ByteIOContext *pb, offset_t to_pad)

{

    while (to_pad--) {

        put_byte(pb, 0);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void palette_destroy(VncPalette *palette)
+
+{

     if (palette == NULL) {

void palette_destroy(VncPalette *palette)

{

    if (palette == NULL) {

        qemu_free(palette);

    }

}


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

     AVFilterContext *ctx = inlink->dst;

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

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

static int channelmap_config_input(AVFilterLink *inlink)

{

    AVFilterContext *ctx = inlink->dst;

    ChannelMapContext *s = ctx->priv;

    int i, err = 0;

    const char *channel_name;

    char layout_name[256];

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

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

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

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

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

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

                av_get_channel_layout_string(layout_name, sizeof(layout_name),

                                             0, inlink->channel_layout);

                av_log(ctx, AV_LOG_ERROR,

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

                       channel_name, layout_name);

                err = AVERROR(EINVAL);

            }

        }

    }

    return err;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void free_device_list(AVOpenCLDeviceList *device_list)

+{

     int i, j;

static void free_device_list(AVOpenCLDeviceList *device_list)

{

    int i, j;

    if (!device_list)

        return;

    for (i = 0; i < device_list->platform_num; i++) {

        if (!device_list->platform_node[i])

            continue;

        for (j = 0; j < device_list->platform_node[i]->device_num; j++) {

            av_freep(&(device_list->platform_node[i]->device_node[j]->device_name));

            av_freep(&(device_list->platform_node[i]->device_node[j]));

        }

        av_freep(&device_list->platform_node[i]->device_node);

        av_freep(&(device_list->platform_node[i]->platform_name));

        av_freep(&device_list->platform_node[i]);

    }

    av_freep(&device_list->platform_node);

    device_list->platform_num = 0;

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     cc->handle_mmu_fault = arm_cpu_handle_mmu_fault;
 #else
     cc->do_interrupt = arm_cpu_do_interrupt;
+    cc->get_phys_page_debug = arm_cpu_get_phys_page_debug;
+    cc->vmsd = &vmstate_arm_cpu;
+    cc->virtio_is_big_endian = arm_cpu_is_big_endian;
+#endif
+    cc->gdb_num_core_regs = 26;
     cc->gdb_core_xml_file = "arm-core.xml";
     cc->gdb_stop_before_watchpoint = true;
     cc->debug_excp_handler = arm_debug_excp_handler;

static void arm_cpu_class_init(ObjectClass *oc, void *data)
{
    ARMCPUClass *acc = ARM_CPU_CLASS(oc);
    CPUClass *cc = CPU_CLASS(acc);
    DeviceClass *dc = DEVICE_CLASS(oc);
    acc->parent_realize = dc->realize;
    dc->realize = arm_cpu_realizefn;
    dc->props = arm_cpu_properties;
    acc->parent_reset = cc->reset;
    cc->reset = arm_cpu_reset;
    cc->class_by_name = arm_cpu_class_by_name;
    cc->has_work = arm_cpu_has_work;
    cc->cpu_exec_interrupt = arm_cpu_exec_interrupt;
    cc->dump_state = arm_cpu_dump_state;
    cc->set_pc = arm_cpu_set_pc;
    cc->gdb_read_register = arm_cpu_gdb_read_register;
    cc->gdb_write_register = arm_cpu_gdb_write_register;
#ifdef CONFIG_USER_ONLY
    cc->handle_mmu_fault = arm_cpu_handle_mmu_fault;
#else
    cc->do_interrupt = arm_cpu_do_interrupt;
    cc->get_phys_page_debug = arm_cpu_get_phys_page_debug;
    cc->vmsd = &vmstate_arm_cpu;
    cc->virtio_is_big_endian = arm_cpu_is_big_endian;
#endif
    cc->gdb_num_core_regs = 26;
    cc->gdb_core_xml_file = "arm-core.xml";
    cc->gdb_stop_before_watchpoint = true;
    cc->debug_excp_handler = arm_debug_excp_handler;
    cc->disas_set_info = arm_disas_set_info;
}


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

     if (ret < 0) {

+        error_setg_errno(errp, -ret, "Could not read image for determining its "
+
+                         "format");
+
+        *pdrv = NULL;

         return ret;

static int find_image_format(BlockDriverState *bs, const char *filename,

                             BlockDriver **pdrv, Error **errp)

{

    BlockDriver *drv;

    uint8_t buf[BLOCK_PROBE_BUF_SIZE];

    int ret = 0;

    /* Return the raw BlockDriver * to scsi-generic devices or empty drives */

    if (bs->sg || !bdrv_is_inserted(bs) || bdrv_getlength(bs) == 0) {

        *pdrv = &bdrv_raw;

        return ret;

    }

    ret = bdrv_pread(bs, 0, buf, sizeof(buf));

    if (ret < 0) {

        error_setg_errno(errp, -ret, "Could not read image for determining its "

                         "format");

        *pdrv = NULL;

        return ret;

    }

    drv = bdrv_probe_all(buf, ret, filename);

    if (!drv) {

        error_setg(errp, "Could not determine image format: No compatible "

                   "driver found");

        ret = -ENOENT;

    }

    *pdrv = drv;

    return ret;

}


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

     do_subfco();

void OPPROTO op_subfco (void)

{

    do_subfco();

    RETURN();

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 int qemu_devtree_add_subnode(void *fdt, const char *name)
+
 {

     int offset;
@@ -8,11 +8,11 @@

     char *basename = strrchr(dupname, '/');

+    int retval;
+
+

+    if (!basename) {

         return -1;

int qemu_devtree_add_subnode(void *fdt, const char *name)

{

    int offset;

    char *dupname = g_strdup(name);

    char *basename = strrchr(dupname, '/');

    int retval;

    if (!basename) {

        return -1;

    }

    basename[0] = '\0';

    basename++;

    offset = fdt_path_offset(fdt, dupname);

    if (offset < 0) {

        return offset;

    }

    retval = fdt_add_subnode(fdt, offset, basename);

    g_free(dupname);

    return retval;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline void RENAME(nv12ToUV)(uint8_t *dstU, uint8_t *dstV,

                                     const uint8_t *src1, const uint8_t *src2,

static inline void RENAME(nv12ToUV)(uint8_t *dstU, uint8_t *dstV,

                                    const uint8_t *src1, const uint8_t *src2,

                                    int width, uint32_t *unused)

{

    RENAME(nvXXtoUV)(dstU, dstV, src1, width);

}


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

              * by @to as @to's backing node. */

+            QLIST_FOREACH(to_c, &to->children, next) {
+
+                if (to_c == c) {
+
+                    break;

                 }

static void change_parent_backing_link(BlockDriverState *from,

                                       BlockDriverState *to)

{

    BdrvChild *c, *next, *to_c;

    QLIST_FOREACH_SAFE(c, &from->parents, next_parent, next) {

        if (c->role->stay_at_node) {

            continue;

        }

        if (c->role == &child_backing) {

            /* @from is generally not allowed to be a backing file, except for

             * when @to is the overlay. In that case, @from may not be replaced

             * by @to as @to's backing node. */

            QLIST_FOREACH(to_c, &to->children, next) {

                if (to_c == c) {

                    break;

                }

            }

            if (to_c) {

                continue;

            }

        }

        assert(c->role != &child_backing);

        bdrv_ref(to);

        /* FIXME Are we sure that bdrv_replace_child() can't run into

         * &error_abort because of permissions? */

        bdrv_replace_child(c, to, true);

        bdrv_unref(from);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
+
+{
+
+    GetBitContext *gb        = &ctx->gb;

static int read_block(ALSDecContext *ctx, ALSBlockData *bd)

{

    GetBitContext *gb        = &ctx->gb;

    *bd->shift_lsbs = 0;

    // read block type flag and read the samples accordingly

    if (get_bits1(gb)) {

        if (read_var_block_data(ctx, bd))

            return -1;

    } else {

        read_const_block_data(ctx, bd);

    }

    return 0;

}


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

 {
+
+    QEMUSnapshotInfo sn;
+
     int err = 0;

     BlockDriverState *bs;

int bdrv_all_find_snapshot(const char *name, BlockDriverState **first_bad_bs)

{

    QEMUSnapshotInfo sn;

    int err = 0;

    BlockDriverState *bs;

    BdrvNextIterator *it = NULL;

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

        AioContext *ctx = bdrv_get_aio_context(bs);

        aio_context_acquire(ctx);

        if (bdrv_can_snapshot(bs)) {

            err = bdrv_snapshot_find(bs, &sn, name);

        }

        aio_context_release(ctx);

    }

    *first_bad_bs = bs;

    return err;

}


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

                 env->interrupt_index = TT_EXTINT | i;
+
+                if (old_interrupt != env->interrupt_index) {
+
+                    CPUIRQ_DPRINTF("Set CPU IRQ %d\n", i);
+
                     cpu_interrupt(env, CPU_INTERRUPT_HARD);

                 }

void cpu_check_irqs(CPUState *env)

{

    uint32_t pil = env->pil_in | (env->softint & ~SOFTINT_TIMER) |

        ((env->softint & SOFTINT_TIMER) << 14);

    if (pil && (env->interrupt_index == 0 ||

                (env->interrupt_index & ~15) == TT_EXTINT)) {

        unsigned int i;

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

            if (pil & (1 << i)) {

                int old_interrupt = env->interrupt_index;

                env->interrupt_index = TT_EXTINT | i;

                if (old_interrupt != env->interrupt_index) {

                    CPUIRQ_DPRINTF("Set CPU IRQ %d\n", i);

                    cpu_interrupt(env, CPU_INTERRUPT_HARD);

                }

                break;

            }

        }

    } else if (!pil && (env->interrupt_index & ~15) == TT_EXTINT) {

        CPUIRQ_DPRINTF("Reset CPU IRQ %d\n", env->interrupt_index & 15);

        env->interrupt_index = 0;

        cpu_reset_interrupt(env, CPU_INTERRUPT_HARD);

    }

}


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

     int i;
+

     for (i = 0; i < mcb->num_callbacks; i++) {

static void multiwrite_user_cb(MultiwriteCB *mcb)

{

    int i;

    for (i = 0; i < mcb->num_callbacks; i++) {

        mcb->callbacks[i].cb(mcb->callbacks[i].opaque, mcb->error);

        qemu_free(mcb->callbacks[i].free_qiov);

        qemu_free(mcb->callbacks[i].free_buf);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
+static void GCC_FMT_ATTR(2, 3) qtest_send(CharDriverState *chr,

+                                          const char *fmt, ...)
+
 {
+
     va_list ap;
+
+    char buffer[1024];
+
     size_t len;

static void GCC_FMT_ATTR(2, 3) qtest_send(CharDriverState *chr,

                                          const char *fmt, ...)

{

    va_list ap;

    char buffer[1024];

    size_t len;

    va_start(ap, fmt);

    len = vsnprintf(buffer, sizeof(buffer), fmt, ap);

    va_end(ap);

    qemu_chr_fe_write_all(chr, (uint8_t *)buffer, len);

    if (qtest_log_fp && qtest_opened) {

        fprintf(qtest_log_fp, "%s", buffer);

    }

}


int find_utlb_entry(CPUState * env, target_ulong address, int use_asid)

{

    uint8_t urb, urc;

    /* Increment URC */

    urb = ((env->mmucr) >> 18) & 0x3f;

    urc = ((env->mmucr) >> 10) & 0x3f;

    urc++;

    if (urc == urb || urc == UTLB_SIZE - 1)

	urc = 0;

    env->mmucr = (env->mmucr & 0xffff03ff) | (urc << 10);

    /* Return entry */

    return find_tlb_entry(env, address, env->utlb, UTLB_SIZE, use_asid);

}


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

 {

+    DeviceClass *dc = DEVICE_CLASS(oc);
+
     dc->realize = spapr_cpu_core_realize;

 }

static void spapr_cpu_core_class_init(ObjectClass *oc, void *data)

{

    DeviceClass *dc = DEVICE_CLASS(oc);

    dc->realize = spapr_cpu_core_realize;

}


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

 {

+    blend_image_packed_rgb(ctx, dst, src, 0, x, y, 1);

 }

static void blend_image_rgb_pm(AVFilterContext *ctx, AVFrame *dst, const AVFrame *src, int x, int y)

{

    blend_image_packed_rgb(ctx, dst, src, 0, x, y, 1);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void put_int32(QEMUFile *f, void *pv, size_t size)
+
 {

     int32_t *v = pv;

static void put_int32(QEMUFile *f, void *pv, size_t size)

{

    int32_t *v = pv;

    qemu_put_sbe32s(f, v);

}


--- a/source.c
+++ b/source.c
@@ -47,11 +47,11 @@
                 *cpu_version = pvr;

             }
+
+        } else if (max_lvl >= lvl) {
+
+            /* User chose the level, don't set higher than this */
+
             *compat_lvl = lvl;

             *cpu_version = pvr;

static void cas_handle_compat_cpu(PowerPCCPUClass *pcc, uint32_t pvr,

                                  unsigned max_lvl, unsigned *compat_lvl,

                                  unsigned *cpu_version)

{

    unsigned lvl = get_compat_level(pvr);

    bool is205, is206;

    if (!lvl) {

        return;

    }

    /* If it is a logical PVR, try to determine the highest level */

    is205 = (pcc->pcr_mask & PCR_COMPAT_2_05) &&

            (lvl == get_compat_level(CPU_POWERPC_LOGICAL_2_05));

    is206 = (pcc->pcr_mask & PCR_COMPAT_2_06) &&

            ((lvl == get_compat_level(CPU_POWERPC_LOGICAL_2_06)) ||

             (lvl == get_compat_level(CPU_POWERPC_LOGICAL_2_06_PLUS)));

    if (is205 || is206) {

        if (!max_lvl) {

            /* User did not set the level, choose the highest */

            if (*compat_lvl <= lvl) {

                *compat_lvl = lvl;

                *cpu_version = pvr;

            }

        } else if (max_lvl >= lvl) {

            /* User chose the level, don't set higher than this */

            *compat_lvl = lvl;

            *cpu_version = pvr;

        }

    }

}


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

     return SIZE_BUFFER_VT220 - scon->iov_data_len;
+
+}

static int chr_can_read(void *opaque)

{

    SCLPConsole *scon = opaque;

    return SIZE_BUFFER_VT220 - scon->iov_data_len;

}


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

             if(len>=ff_mpeg4_get_video_packet_prefix_length(s))
+
+                return 1;
+
+        }
+
     }

     return 0;

static inline int mpeg4_is_resync(MpegEncContext *s){

    const int bits_count= get_bits_count(&s->gb);

    if(s->workaround_bugs&FF_BUG_NO_PADDING){

        return 0;

    }

    if(bits_count + 8 >= s->gb.size*8){

        int v= show_bits(&s->gb, 8);

        v|= 0x7F >> (7-(bits_count&7));

        if(v==0x7F)

            return 1;

    }else{

        if(show_bits(&s->gb, 16) == ff_mpeg4_resync_prefix[bits_count&7]){

            int len;

            GetBitContext gb= s->gb;

            skip_bits(&s->gb, 1);

            align_get_bits(&s->gb);

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

                if(get_bits1(&s->gb)) break;

            }

            s->gb= gb;

            if(len>=ff_mpeg4_get_video_packet_prefix_length(s))

                return 1;

        }

    }

    return 0;

}


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

 {

+    LOCAL_ALIGNED_16(int16_t, temp, [64 * 2]);

     int16_t *const bak = temp + 64;

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

                           uint8_t *src2, ptrdiff_t stride, int h)

{

    LOCAL_ALIGNED_16(int16_t, temp, [64 * 2]);

    int16_t *const bak = temp + 64;

    int sum = 0, i;

    av_assert2(h == 8);

    s->mb_intra = 0;

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

    memcpy(bak, temp, 64 * sizeof(int16_t));

    s->block_last_index[0 /* FIXME */] =

        s->fast_dct_quantize(s, temp, 0 /* FIXME */, s->qscale, &i);

    s->dct_unquantize_inter(s, temp, 0, s->qscale);

    ff_simple_idct_8(temp); // FIXME

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

        sum += (temp[i] - bak[i]) * (temp[i] - bak[i]);

    return sum;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int h261_probe(AVProbeData *p)
+
+{
+
+    int code;
+
     const uint8_t *d;

static int h261_probe(AVProbeData *p)

{

    int code;

    const uint8_t *d;

    if (p->buf_size < 6)

        return 0;

    d = p->buf;

    code = (d[0] << 12) | (d[1] << 4) | (d[2] >> 4);

    if (code == 0x10) {

        return 50;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     ARMCPU *cpu = opaque;

     CPUARMState *env = &cpu->env;
+
+
+
     return arm_feature(env, ARM_FEATURE_PMSA) &&

            arm_feature(env, ARM_FEATURE_V7);

static bool pmsav7_needed(void *opaque)

{

    ARMCPU *cpu = opaque;

    CPUARMState *env = &cpu->env;

    return arm_feature(env, ARM_FEATURE_PMSA) &&

           arm_feature(env, ARM_FEATURE_V7);

}


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

 {

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

     CharDriverState *chr;

static CharDriverState *qemu_chr_open_pp(QemuOpts *opts)

{

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

    CharDriverState *chr;

    int fd;

    fd = open(filename, O_RDWR);

    if (fd < 0)

        return NULL;

    chr = g_malloc0(sizeof(CharDriverState));

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

    chr->chr_write = null_chr_write;

    chr->chr_ioctl = pp_ioctl;

    return chr;

}


int do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data)

{

    MigrationState *s = current_migration;

    if (s)

        s->cancel(s);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+int qemu_shutdown_requested_get(void)

 {

int qemu_shutdown_requested_get(void)

{

    return shutdown_requested;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int fmod_init_out (HWVoiceOut *hw, audsettings_t *as)
+
+{
+
+    int bits16, mode, channel;

     FMODVoiceOut *fmd = (FMODVoiceOut *) hw;

static int fmod_init_out (HWVoiceOut *hw, audsettings_t *as)

{

    int bits16, mode, channel;

    FMODVoiceOut *fmd = (FMODVoiceOut *) hw;

    audsettings_t obt_as = *as;

    mode = aud_to_fmodfmt (as->fmt, as->nchannels == 2 ? 1 : 0);

    fmd->fmod_sample = FSOUND_Sample_Alloc (

        FSOUND_FREE,            /* index */

        conf.nb_samples,        /* length */

        mode,                   /* mode */

        as->freq,               /* freq */

        255,                    /* volume */

        128,                    /* pan */

        255                     /* priority */

        );

    if (!fmd->fmod_sample) {

        fmod_logerr2 ("DAC", "Failed to allocate FMOD sample\n");

        return -1;

    }

    channel = FSOUND_PlaySoundEx (FSOUND_FREE, fmd->fmod_sample, 0, 1);

    if (channel < 0) {

        fmod_logerr2 ("DAC", "Failed to start playing sound\n");

        FSOUND_Sample_Free (fmd->fmod_sample);

        return -1;

    }

    fmd->channel = channel;

    /* FMOD always operates on little endian frames? */

    obt_as.endianness = 0;

    audio_pcm_init_info (&hw->info, &obt_as);

    bits16 = (mode & FSOUND_16BITS) != 0;

    hw->samples = conf.nb_samples;

    return 0;

}


static int smacker_probe(AVProbeData *p)

{

    if (p->buf_size < 4)

        return 0;

    if(p->buf[0] == 'S' && p->buf[1] == 'M' && p->buf[2] == 'K'

        && (p->buf[3] == '2' || p->buf[3] == '4'))

        return AVPROBE_SCORE_MAX;

    else

        return 0;

}


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

 {

+    VirtIORNGCcw *dev = VIRTIO_RNG_CCW(obj);

     object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_RNG);

static void virtio_ccw_rng_instance_init(Object *obj)

{

    VirtIORNGCcw *dev = VIRTIO_RNG_CCW(obj);

    object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_RNG);

    object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);

    object_property_add_link(obj, "rng", TYPE_RNG_BACKEND,

                             (Object **)&dev->vdev.conf.rng, NULL);

}


--- a/source.c
+++ b/source.c
@@ -4,8 +4,8 @@
     QEMUIOVector qiov;
     struct iovec iov = {
         .iov_base = (void *)buf,
+        .iov_len = nb_sectors * BDRV_SECTOR_SIZE,
+    };
     qemu_iovec_init_external(&qiov, &iov, 1);
     return bdrv_prwv_co(bs, sector_num << BDRV_SECTOR_BITS,
                         &qiov, is_write, flags);

static int bdrv_rw_co(BlockDriverState *bs, int64_t sector_num, uint8_t *buf,
                      int nb_sectors, bool is_write, BdrvRequestFlags flags)
{
    QEMUIOVector qiov;
    struct iovec iov = {
        .iov_base = (void *)buf,
        .iov_len = nb_sectors * BDRV_SECTOR_SIZE,
    };
    qemu_iovec_init_external(&qiov, &iov, 1);
    return bdrv_prwv_co(bs, sector_num << BDRV_SECTOR_BITS,
                        &qiov, is_write, flags);


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

     T1 = T1 >> PARAM1;

void OPPROTO op_srli_T1 (void)

{

    T1 = T1 >> PARAM1;

    RETURN();

}


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

     block_mig_state.submitted--;
+
+    block_mig_state.read_done++;
+
+    assert(block_mig_state.submitted >= 0);
+
     blk_mig_unlock();

 }

static void blk_mig_read_cb(void *opaque, int ret)

{

    BlkMigBlock *blk = opaque;

    blk_mig_lock();

    blk->ret = ret;

    QSIMPLEQ_INSERT_TAIL(&block_mig_state.blk_list, blk, entry);

    bmds_set_aio_inflight(blk->bmds, blk->sector, blk->nr_sectors, 0);

    block_mig_state.submitted--;

    block_mig_state.read_done++;

    assert(block_mig_state.submitted >= 0);

    blk_mig_unlock();

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     uint8_t v;

     cpu_physical_memory_read(bitband_addr(opaque, offset), &v, 1);
+
+    return (v & (1 << ((offset >> 2) & 7))) != 0;

 }

static uint32_t bitband_readb(void *opaque, target_phys_addr_t offset)

{

    uint8_t v;

    cpu_physical_memory_read(bitband_addr(opaque, offset), &v, 1);

    return (v & (1 << ((offset >> 2) & 7))) != 0;

}


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

+{
+
+    float64 *v = pv;

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

{

    float64 *v = pv;

    *v = make_float64(qemu_get_be64(f));

    return 0;

}


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

     av_freep(&mdct->sintab);

+    av_freep(&mdct->xcos1);
+
+    av_freep(&mdct->xsin1);
+
     av_freep(&mdct->rot_tmp);

     av_freep(&mdct->cplx_tmp);

static av_cold void mdct_end(AC3MDCTContext *mdct)

{

    mdct->nbits = 0;

    av_freep(&mdct->costab);

    av_freep(&mdct->sintab);

    av_freep(&mdct->xcos1);

    av_freep(&mdct->xsin1);

    av_freep(&mdct->rot_tmp);

    av_freep(&mdct->cplx_tmp);

}


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

     qemu_notify_event();
+
 }

void qemu_timer_notify_cb(void *opaque, QEMUClockType type)

{

    qemu_notify_event();

}


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

     uint8_t op = 0xA0; /* IfOp */

+
+
+    build_append_byte(notify, 0x93); /* LEqualOp */
+
+    build_append_byte(notify, 0x68); /* Arg0Op */

     build_append_value(notify, value, size);

static void build_append_notify_target(GArray *method, GArray *target_name,

                                       uint32_t value, int size)

{

    GArray *notify = build_alloc_array();

    uint8_t op = 0xA0; /* IfOp */

    build_append_byte(notify, 0x93); /* LEqualOp */

    build_append_byte(notify, 0x68); /* Arg0Op */

    build_append_value(notify, value, size);

    build_append_byte(notify, 0x86); /* NotifyOp */

    build_append_array(notify, target_name);

    build_append_byte(notify, 0x69); /* Arg1Op */

    /* Pack it up */

    build_package(notify, op, 1);

    build_append_array(method, notify);

    build_free_array(notify);

}


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

 {

+    int offset;
+
+    mcf_intc_state *s = (mcf_intc_state *)opaque;
+
+    offset = addr & 0xff;

     if (offset >= 0x40 && offset < 0x80) {

static uint64_t mcf_intc_read(void *opaque, target_phys_addr_t addr,

                              unsigned size)

{

    int offset;

    mcf_intc_state *s = (mcf_intc_state *)opaque;

    offset = addr & 0xff;

    if (offset >= 0x40 && offset < 0x80) {

        return s->icr[offset - 0x40];

    }

    switch (offset) {

    case 0x00:

        return (uint32_t)(s->ipr >> 32);

    case 0x04:

        return (uint32_t)s->ipr;

    case 0x08:

        return (uint32_t)(s->imr >> 32);

    case 0x0c:

        return (uint32_t)s->imr;

    case 0x10:

        return (uint32_t)(s->ifr >> 32);

    case 0x14:

        return (uint32_t)s->ifr;

    case 0xe0: /* SWIACK.  */

        return s->active_vector;

    case 0xe1: case 0xe2: case 0xe3: case 0xe4:

    case 0xe5: case 0xe6: case 0xe7:

        /* LnIACK */

        hw_error("mcf_intc_read: LnIACK not implemented\n");

    default:

        return 0;

    }

}


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

         if (arg & 0x3ff)

+            tcg_out_arithi(s, ret, ret, arg & 0x3ff, ARITH_OR);
+
+    }
+
 }

static inline void tcg_out_movi_imm32(TCGContext *s, int ret, uint32_t arg)

{

    if (check_fit_tl(arg, 12))

        tcg_out_movi_imm13(s, ret, arg);

    else {

        tcg_out_sethi(s, ret, arg);

        if (arg & 0x3ff)

            tcg_out_arithi(s, ret, ret, arg & 0x3ff, ARITH_OR);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 void tb_set_jmp_target1(uintptr_t jmp_addr, uintptr_t addr)

 {
+
+    uint32_t *ptr = (uint32_t *)jmp_addr;
+
+    uintptr_t disp = addr - jmp_addr;
+

     /* We can reach the entire address space for 32-bit.  For 64-bit

void tb_set_jmp_target1(uintptr_t jmp_addr, uintptr_t addr)

{

    uint32_t *ptr = (uint32_t *)jmp_addr;

    uintptr_t disp = addr - jmp_addr;

    /* We can reach the entire address space for 32-bit.  For 64-bit

       the code_gen_buffer can't be larger than 2GB.  */

    assert(disp == (int32_t)disp);

    *ptr = CALL | (uint32_t)disp >> 2;

    flush_icache_range(jmp_addr, jmp_addr + 4);

}


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

     BackupBlockJob *s = container_of(job, BackupBlockJob, common);

+

     if (speed < 0) {

static void backup_set_speed(BlockJob *job, int64_t speed, Error **errp)

{

    BackupBlockJob *s = container_of(job, BackupBlockJob, common);

    if (speed < 0) {

        error_setg(errp, QERR_INVALID_PARAMETER, "speed");

        return;

    }

    ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE, SLICE_TIME);

}