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

             val += src[abs(sample_index + i)] * (FELEM2)filter[i];

+            v2  += src[abs(sample_index + i)] * (FELEM2)filter[i + c->filter_length];
+
+        }
+
+        val += (v2 - val) * (FELEML)frac / c->src_incr;

     } else {

static void SET_TYPE(resample_one)(ResampleContext *c,

                                   void *dst0, int dst_index, const void *src0,

                                   int src_size, int index, int frac)

{

    FELEM *dst = dst0;

    const FELEM *src = src0;

    int i;

    int sample_index = index >> c->phase_shift;

    FELEM2 val = 0;

    FELEM *filter = ((FELEM *)c->filter_bank) +

                    c->filter_length * (index & c->phase_mask);

    if (sample_index < 0) {

        for (i = 0; i < c->filter_length; i++)

            val += src[FFABS(sample_index + i) % src_size] *

                   (FELEM2)filter[i];

    } else if (c->linear) {

        FELEM2 v2 = 0;

        for (i = 0; i < c->filter_length; i++) {

            val += src[abs(sample_index + i)] * (FELEM2)filter[i];

            v2  += src[abs(sample_index + i)] * (FELEM2)filter[i + c->filter_length];

        }

        val += (v2 - val) * (FELEML)frac / c->src_incr;

    } else {

        for (i = 0; i < c->filter_length; i++)

            val += src[sample_index + i] * (FELEM2)filter[i];

    }

    OUT(dst[dst_index], val);

}


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

+    while (penv) {
+
+        penv->stop = 0;
+
+        penv->stopped = 0;

         qemu_thread_signal(penv->thread, SIGUSR1);

static void resume_all_vcpus(void)

{

    CPUState *penv = first_cpu;

    while (penv) {

        penv->stop = 0;

        penv->stopped = 0;

        qemu_thread_signal(penv->thread, SIGUSR1);

        qemu_cpu_kick(penv);

        penv = (CPUState *)penv->next_cpu;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void spr_read_tbl(DisasContext *ctx, int gprn, int sprn)
+
 {

     if (ctx->tb->cflags & CF_USE_ICOUNT) {

static void spr_read_tbl(DisasContext *ctx, int gprn, int sprn)

{

    if (ctx->tb->cflags & CF_USE_ICOUNT) {

        gen_io_start();

    }

    gen_helper_load_tbl(cpu_gpr[gprn], cpu_env);

    if (ctx->tb->cflags & CF_USE_ICOUNT) {

        gen_io_end();

        gen_stop_exception(ctx);

    }

}


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

     BlockDriverState *bs = blk_bs(blk);

+    char *id;
+
+

     /* blk_eject is only called by qdevified devices */

void blk_eject(BlockBackend *blk, bool eject_flag)

{

    BlockDriverState *bs = blk_bs(blk);

    char *id;

    /* blk_eject is only called by qdevified devices */

    assert(!blk->legacy_dev);

    if (bs) {

        bdrv_eject(bs, eject_flag);

        id = blk_get_attached_dev_id(blk);

        qapi_event_send_device_tray_moved(blk_name(blk), id,

                                          eject_flag, &error_abort);

        g_free(id);

    }

}


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

     virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
+
+                                TYPE_VIRTIO_CRYPTO);
+
+    object_property_add_alias(obj, "cryptodev", OBJECT(&dev->vdev),

                               "cryptodev", &error_abort);

static void virtio_crypto_initfn(Object *obj)

{

    VirtIOCryptoPCI *dev = VIRTIO_CRYPTO_PCI(obj);

    virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),

                                TYPE_VIRTIO_CRYPTO);

    object_property_add_alias(obj, "cryptodev", OBJECT(&dev->vdev),

                              "cryptodev", &error_abort);

}


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

         return NULL;

+    }
+
+
+
+    s = g_malloc0(sizeof(QEMUFileStdio));

QEMUFile *qemu_popen_cmd(const char *command, const char *mode)

{

    FILE *stdio_file;

    QEMUFileStdio *s;

    stdio_file = popen(command, mode);

    if (stdio_file == NULL) {

        return NULL;

    }

    if (mode == NULL || (mode[0] != 'r' && mode[0] != 'w') || mode[1] != 0) {

        fprintf(stderr, "qemu_popen: Argument validity check failed\n");

        return NULL;

    }

    s = g_malloc0(sizeof(QEMUFileStdio));

    s->stdio_file = stdio_file;

    if(mode[0] == 'r') {

        s->file = qemu_fopen_ops(s, &stdio_pipe_read_ops);

    } else {

        s->file = qemu_fopen_ops(s, &stdio_pipe_write_ops);

    }

    return s->file;

}


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

     cc->reset = xtensa_cpu_reset;

+

     cc->class_by_name = xtensa_cpu_class_by_name;

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

{

    DeviceClass *dc = DEVICE_CLASS(oc);

    CPUClass *cc = CPU_CLASS(oc);

    XtensaCPUClass *xcc = XTENSA_CPU_CLASS(cc);

    xcc->parent_realize = dc->realize;

    dc->realize = xtensa_cpu_realizefn;

    xcc->parent_reset = cc->reset;

    cc->reset = xtensa_cpu_reset;

    cc->class_by_name = xtensa_cpu_class_by_name;

    cc->has_work = xtensa_cpu_has_work;

    cc->do_interrupt = xtensa_cpu_do_interrupt;

    cc->cpu_exec_interrupt = xtensa_cpu_exec_interrupt;

    cc->dump_state = xtensa_cpu_dump_state;

    cc->set_pc = xtensa_cpu_set_pc;

    cc->gdb_read_register = xtensa_cpu_gdb_read_register;

    cc->gdb_write_register = xtensa_cpu_gdb_write_register;

    cc->gdb_stop_before_watchpoint = true;

#ifndef CONFIG_USER_ONLY

    cc->do_unaligned_access = xtensa_cpu_do_unaligned_access;

    cc->get_phys_page_debug = xtensa_cpu_get_phys_page_debug;

    cc->do_unassigned_access = xtensa_cpu_do_unassigned_access;

#endif

    cc->debug_excp_handler = xtensa_breakpoint_handler;

    dc->vmsd = &vmstate_xtensa_cpu;

    /*

     * Reason: xtensa_cpu_initfn() calls cpu_exec_init(), which saves

     * the object in cpus -> dangling pointer after final

     * object_unref().

     */

    dc->cannot_destroy_with_object_finalize_yet = true;

}


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

     int w1, x, y, last_width;

+

     last_width = s->width;

static void text_console_resize(QemuConsole *s)

{

    TextCell *cells, *c, *c1;

    int w1, x, y, last_width;

    last_width = s->width;

    s->width = surface_width(s->surface) / FONT_WIDTH;

    s->height = surface_height(s->surface) / FONT_HEIGHT;

    w1 = last_width;

    if (s->width < w1)

        w1 = s->width;

    cells = g_malloc(s->width * s->total_height * sizeof(TextCell));

    for(y = 0; y < s->total_height; y++) {

        c = &cells[y * s->width];

        if (w1 > 0) {

            c1 = &s->cells[y * last_width];

            for(x = 0; x < w1; x++) {

                *c++ = *c1++;

            }

        }

        for(x = w1; x < s->width; x++) {

            c->ch = ' ';

            c->t_attrib = s->t_attrib_default;

            c++;

        }

    }

    g_free(s->cells);

    s->cells = cells;

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 static void monitor_puts(Monitor *mon, const char *str)

 {
+
     char c;

+
+
+    for(;;) {

         assert(mon->outbuf_index < sizeof(mon->outbuf) - 1);

static void monitor_puts(Monitor *mon, const char *str)

{

    char c;

    for(;;) {

        assert(mon->outbuf_index < sizeof(mon->outbuf) - 1);

        c = *str++;

        if (c == '\0')

            break;

        if (c == '\n')

            mon->outbuf[mon->outbuf_index++] = '\r';

        mon->outbuf[mon->outbuf_index++] = c;

        if (mon->outbuf_index >= (sizeof(mon->outbuf) - 1)

            || c == '\n')

            monitor_flush(mon);

    }

}


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

     uint32_t v;

+    v = dp8393x_readw(opaque, addr);
+
+    v |= dp8393x_readw(opaque, addr + 2) << 16;

     return v;

static uint32_t dp8393x_readl(void *opaque, target_phys_addr_t addr)

{

    uint32_t v;

    v = dp8393x_readw(opaque, addr);

    v |= dp8393x_readw(opaque, addr + 2) << 16;

    return v;

}


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

     int fd;

+    int64_t ret = -1, handle;
+
+

     if (!has_mode) {

int64_t qmp_guest_file_open(const char *path, bool has_mode, const char *mode, Error **err)

{

    FILE *fh;

    int fd;

    int64_t ret = -1, handle;

    if (!has_mode) {

        mode = "r";

    }

    slog("guest-file-open called, filepath: %s, mode: %s", path, mode);

    fh = fopen(path, mode);

    if (!fh) {

        error_setg_errno(err, errno, "failed to open file '%s' (mode: '%s')",

                         path, mode);

        return -1;

    }

    /* set fd non-blocking to avoid common use cases (like reading from a

     * named pipe) from hanging the agent

     */

    fd = fileno(fh);

    ret = fcntl(fd, F_GETFL);

    ret = fcntl(fd, F_SETFL, ret | O_NONBLOCK);

    if (ret == -1) {

        error_setg_errno(err, errno, "failed to make file '%s' non-blocking",

                         path);

        fclose(fh);

        return -1;

    }

    handle = guest_file_handle_add(fh, err);

    if (error_is_set(err)) {

        fclose(fh);

        return -1;

    }

    slog("guest-file-open, handle: %d", handle);

    return handle;

}


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

+                           const uint8_t *buf, int size, int64_t pts)

 {

static int swf_write_packet(AVFormatContext *s, int stream_index,

                           const uint8_t *buf, int size, int64_t pts)

{

    AVCodecContext *codec = &s->streams[stream_index]->codec;

    if (codec->codec_type == CODEC_TYPE_AUDIO)

        return swf_write_audio(s, buf, size);

    else

        return swf_write_video(s, codec, buf, size);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int asf_build_simple_index(AVFormatContext *s, int stream_index)
+{
+    ff_asf_guid g;
+    ASFContext *asf     = s->priv_data;
+    int64_t current_pos = avio_tell(s->pb);
     int64_t ret;
     if((ret = avio_seek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET)) < 0) {
         return ret;

static int asf_build_simple_index(AVFormatContext *s, int stream_index)
{
    ff_asf_guid g;
    ASFContext *asf     = s->priv_data;
    int64_t current_pos = avio_tell(s->pb);
    int64_t ret;
    if((ret = avio_seek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET)) < 0) {
        return ret;
    if ((ret = ff_get_guid(s->pb, &g)) < 0)
    /* the data object can be followed by other top-level objects,
     * skip them until the simple index object is reached */
    while (ff_guidcmp(&g, &ff_asf_simple_index_header)) {
        int64_t gsize = avio_rl64(s->pb);
        if (gsize < 24 || avio_feof(s->pb)) {
        avio_skip(s->pb, gsize - 24);
        if ((ret = ff_get_guid(s->pb, &g)) < 0)
    {
        int64_t itime, last_pos = -1;
        int pct, ict;
        int i;
        int64_t av_unused gsize = avio_rl64(s->pb);
        if ((ret = ff_get_guid(s->pb, &g)) < 0)
        itime = avio_rl64(s->pb);
        pct   = avio_rl32(s->pb);
        ict   = avio_rl32(s->pb);
        av_log(s, AV_LOG_DEBUG,
               "itime:0x%"PRIx64", pct:%d, ict:%d\n", itime, pct, ict);
        for (i = 0; i < ict; i++) {
            int pktnum        = avio_rl32(s->pb);
            int pktct         = avio_rl16(s->pb);
            int64_t pos       = s->internal->data_offset + s->packet_size * (int64_t)pktnum;
            int64_t index_pts = FFMAX(av_rescale(itime, i, 10000) - asf->hdr.preroll, 0);
            if (pos != last_pos) {
                av_log(s, AV_LOG_DEBUG, "pktnum:%d, pktct:%d  pts: %"PRId64"\n",
                       pktnum, pktct, index_pts);
                av_add_index_entry(s->streams[stream_index], pos, index_pts,
                                   s->packet_size, 0, AVINDEX_KEYFRAME);
                last_pos = pos;
        asf->index_read = ict > 1;
end:
//     if (avio_feof(s->pb)) {
//         ret = 0;
//     }
    avio_seek(s->pb, current_pos, SEEK_SET);
    return ret;


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

         return ntohs(ssu.in6.sin6_port);

+#endif
+
+    return 0;
+
+}

static int get_port(const struct sockaddr_storage *ss)

{

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

    if (ss->ss_family == AF_INET)

        return ntohs(ssu.in.sin_port);

#if HAVE_STRUCT_SOCKADDR_IN6

    if (ss->ss_family == AF_INET6)

        return ntohs(ssu.in6.sin6_port);

#endif

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 const char *qdict_get_try_str(const QDict *qdict, const char *key)
+
+{
+
+    QObject *obj;

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

{

    QObject *obj;

    obj = qdict_get(qdict, key);

    if (!obj || qobject_type(obj) != QTYPE_QSTRING)

        return NULL;

    return qstring_get_str(qobject_to_qstring(obj));

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void multipath_pr_init(void)
+
 {
+
     static struct udev *udev;

static void multipath_pr_init(void)

{

    static struct udev *udev;

    udev = udev_new();

    mpath_lib_init(udev);

}


--- 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(CPUTLGState *env)

{

    abi_ulong frame_addr = env->regs[TILEGX_R_SP];

    struct target_rt_sigframe *frame;

    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(&set, &frame->uc.tuc_sigmask);

    do_sigprocmask(SIG_SETMASK, &set, NULL);

    restore_sigcontext(env, &frame->uc.tuc_mcontext);

    if (do_sigaltstack(frame_addr + offsetof(struct target_rt_sigframe,

                                             uc.tuc_stack),

                       0, env->regs[TILEGX_R_SP]) == -EFAULT) {

        goto badframe;

    }

    unlock_user_struct(frame, frame_addr, 0);

    return env->regs[TILEGX_R_RE];

 badframe:

    unlock_user_struct(frame, frame_addr, 0);

    force_sig(TARGET_SIGSEGV);

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                             MemoryRegionSection *section)

 {
+
+    /* FIXME: implement */

 }

static void vhost_log_start(MemoryListener *listener,

                            MemoryRegionSection *section)

{

    /* FIXME: implement */

}


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

     RMContext *rm = s->priv_data;
+
+    AVStream *st;
+
+

     rm->old_format = 1;

static int rm_read_header_old(AVFormatContext *s, AVFormatParameters *ap)

{

    RMContext *rm = s->priv_data;

    AVStream *st;

    rm->old_format = 1;

    st = av_new_stream(s, 0);

    if (!st)

        goto fail;

    rm_read_audio_stream_info(s, st, 1);

    return 0;

 fail:

    return -1;

}


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

+    if (QTAILQ_EMPTY(&mouse_handlers)) {
+
+        goto out;
+
+    }

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

{

    QEMUPutMouseEntry *cursor;

    QList *mice_list;

    int current;

    mice_list = qlist_new();

    if (QTAILQ_EMPTY(&mouse_handlers)) {

        goto out;

    }

    current = QTAILQ_FIRST(&mouse_handlers)->index;

    QTAILQ_FOREACH(cursor, &mouse_handlers, node) {

        QObject *obj;

        obj = qobject_from_jsonf("{ 'name': %s, 'index': %d, 'current': %i }",

                                 cursor->qemu_put_mouse_event_name,

                                 cursor->index,

                                 cursor->index == current);

        qlist_append_obj(mice_list, obj);

    }

out:

    *ret_data = QOBJECT(mice_list);

}


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

     IntelIOMMUNotifierNode *node;
+
+    VTDContextEntry ce;
+
+    int ret;
+

     QLIST_FOREACH(node, &(s->notifiers_list), next) {

static void vtd_iotlb_page_invalidate_notify(IntelIOMMUState *s,

                                           uint16_t domain_id, hwaddr addr,

                                           uint8_t am)

{

    IntelIOMMUNotifierNode *node;

    VTDContextEntry ce;

    int ret;

    QLIST_FOREACH(node, &(s->notifiers_list), next) {

        VTDAddressSpace *vtd_as = node->vtd_as;

        ret = vtd_dev_to_context_entry(s, pci_bus_num(vtd_as->bus),

                                       vtd_as->devfn, &ce);

        if (!ret && domain_id == VTD_CONTEXT_ENTRY_DID(ce.hi)) {

            vtd_page_walk(&ce, addr, addr + (1 << am) * VTD_PAGE_SIZE,

                          vtd_page_invalidate_notify_hook,

                          (void *)&vtd_as->iommu, true);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     RpzaContext *s = avctx->priv_data;

+
+    s->avctx = avctx;
+
+    avctx->pix_fmt = AV_PIX_FMT_RGB555;
+

     s->frame.data[0] = NULL;

static av_cold int rpza_decode_init(AVCodecContext *avctx)

{

    RpzaContext *s = avctx->priv_data;

    s->avctx = avctx;

    avctx->pix_fmt = AV_PIX_FMT_RGB555;

    s->frame.data[0] = NULL;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     int64_t ret;

     Error *err = NULL;
+
+
+
+    if (guest_fsfreeze_state.status == GUEST_FSFREEZE_STATUS_FROZEN) {
+
         ret = qmp_guest_fsfreeze_thaw(&err);

         if (ret < 0 || err) {

static void guest_fsfreeze_cleanup(void)

{

    int64_t ret;

    Error *err = NULL;

    if (guest_fsfreeze_state.status == GUEST_FSFREEZE_STATUS_FROZEN) {

        ret = qmp_guest_fsfreeze_thaw(&err);

        if (ret < 0 || err) {

            slog("failed to clean up frozen filesystems");

        }

    }

}


int event_notifier_get_fd(EventNotifier *e)

{

    return e->fd;

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
     int i;

     pixel *src = (pixel*)_src;
+
     stride /= sizeof(pixel);

static void FUNCC(pred16x16_horizontal)(uint8_t *_src, int stride){

    int i;

    pixel *src = (pixel*)_src;

    stride /= sizeof(pixel);

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

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

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

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

        ((pixel4*)(src+i*stride))[3] = PIXEL_SPLAT_X4(src[-1+i*stride]);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void use_normal_update_speed(WmallDecodeCtx *s, int ich)

 {
+
     int ilms, recent, icoef;

     s->update_speed[ich] = 8;

static void use_normal_update_speed(WmallDecodeCtx *s, int ich)

{

    int ilms, recent, icoef;

    s->update_speed[ich] = 8;

    for (ilms = s->cdlms_ttl[ich]; ilms >= 0; ilms--) {

        recent = s->cdlms[ich][ilms].recent;

        if (s->bV3RTM) {

            for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)

                s->cdlms[ich][ilms].lms_updates[icoef + recent] /= 2;

        } else {

            for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)

                s->cdlms[ich][ilms].lms_updates[icoef] /= 2;

        }

    }

}


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

     QEMUBH *bh;

+
+
+    for (bh = async_context->first_bh; bh; bh = bh->next) {
+
+        if (!bh->deleted && bh->scheduled) {

             if (bh->idle) {

void qemu_bh_update_timeout(int *timeout)

{

    QEMUBH *bh;

    for (bh = async_context->first_bh; bh; bh = bh->next) {

        if (!bh->deleted && bh->scheduled) {

            if (bh->idle) {

                /* idle bottom halves will be polled at least

                 * every 10ms */

                *timeout = MIN(10, *timeout);

            } else {

                /* non-idle bottom halves will be executed

                 * immediately */

                *timeout = 0;

                break;

            }

        }

    }

}


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

     BDRVQcowState *s = bs->opaque;

+    Qcow2Cache *c;

     int i;

Qcow2Cache *qcow2_cache_create(BlockDriverState *bs, int num_tables)

{

    BDRVQcowState *s = bs->opaque;

    Qcow2Cache *c;

    int i;

    c = g_malloc0(sizeof(*c));

    c->size = num_tables;

    c->entries = g_malloc0(sizeof(*c->entries) * num_tables);

    for (i = 0; i < c->size; i++) {

        c->entries[i].table = qemu_try_blockalign(bs->file, s->cluster_size);

        if (c->entries[i].table == NULL) {

            goto fail;

        }

    }

    return c;

fail:

    for (i = 0; i < c->size; i++) {

        qemu_vfree(c->entries[i].table);

    }

    g_free(c->entries);

    g_free(c);

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -15,7 +15,7 @@
     gsize bytes_read;

+
     len = sizeof(buf);

     if (len > s->max_size) {

static gboolean fd_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque)

{

    CharDriverState *chr = opaque;

    FDCharDriver *s = chr->opaque;

    int len;

    uint8_t buf[READ_BUF_LEN];

    GIOStatus status;

    gsize bytes_read;

    len = sizeof(buf);

    if (len > s->max_size) {

        len = s->max_size;

    }

    if (len == 0) {

        return TRUE;

    }

    status = g_io_channel_read_chars(chan, (gchar *)buf,

                                     len, &bytes_read, NULL);

    if (status == G_IO_STATUS_EOF) {

        if (s->fd_in_tag) {

            g_source_remove(s->fd_in_tag);

            s->fd_in_tag = 0;

        }

        qemu_chr_be_event(chr, CHR_EVENT_CLOSED);

        return FALSE;

    }

    if (status == G_IO_STATUS_NORMAL) {

        qemu_chr_be_write(chr, buf, bytes_read);

    }

    return TRUE;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
+
 {

     return addr;

target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)

{

    return addr;

}


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

     int *image_line;

+    int frame_index;
+
     const int numcomps = image->numcomps;

@@ -28,7 +28,7 @@

             return 0;

+        }

     }

static int libopenjpeg_copy_unpacked8(AVCodecContext *avctx, const AVFrame *frame, opj_image_t *image)

{

    int compno;

    int x;

    int y;

    int width;

    int height;

    int *image_line;

    int frame_index;

    const int numcomps = image->numcomps;

    for (compno = 0; compno < numcomps; ++compno) {

        if (image->comps[compno].w > frame->linesize[compno]) {

            av_log(avctx, AV_LOG_ERROR, "Error: frame's linesize is too small for the image\n");

            return 0;

        }

    }

    for (compno = 0; compno < numcomps; ++compno) {

        width  = avctx->width / image->comps[compno].dx;

        height = avctx->height / image->comps[compno].dy;

        for (y = 0; y < height; ++y) {

            image_line = image->comps[compno].data + y * image->comps[compno].w;

            frame_index = y * frame->linesize[compno];

            for (x = 0; x < width; ++x)

                image_line[x] = frame->data[compno][frame_index++];

            for (; x < image->comps[compno].w; ++x) {

                image_line[x] = image_line[x - 1];

            }

        }

        for (; y < image->comps[compno].h; ++y) {

            image_line = image->comps[compno].data + y * image->comps[compno].w;

            for (x = 0; x < image->comps[compno].w; ++x) {

                image_line[x] = image_line[x - image->comps[compno].w];

            }

        }

    }

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
     /* No error here: 6 bits are used */

     tcg_gen_andi_i32(t0, arg2, 0x3F);
+
+    tcg_gen_brcondi_i32(TCG_COND_GE, t0, 32, l1);
+
+    tcg_gen_shr_i32(ret, arg1, t0);
+
     tcg_gen_br(l2);

     gen_set_label(l1);

static inline void gen_op_evsrwu(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2)

{

    TCGv_i32 t0;

    int l1, l2;

    l1 = gen_new_label();

    l2 = gen_new_label();

    t0 = tcg_temp_local_new_i32();

    /* No error here: 6 bits are used */

    tcg_gen_andi_i32(t0, arg2, 0x3F);

    tcg_gen_brcondi_i32(TCG_COND_GE, t0, 32, l1);

    tcg_gen_shr_i32(ret, arg1, t0);

    tcg_gen_br(l2);

    gen_set_label(l1);

    tcg_gen_movi_i32(ret, 0);

    gen_set_label(l2);

    tcg_temp_free_i32(t0);

}


--- a/source.c
+++ b/source.c
@@ -51,11 +51,11 @@
         tcg_gen_shl_tl(cpu_R[dc->rd], cpu_R[dc->ra], t0);

     else {
+
+        if (t)
+
+            tcg_gen_sar_tl(cpu_R[dc->rd], cpu_R[dc->ra], t0);
+
         else

             tcg_gen_shr_tl(cpu_R[dc->rd], cpu_R[dc->ra], t0);

static void dec_barrel(DisasContext *dc)

{

    TCGv t0;

    unsigned int s, t;

    if ((dc->tb_flags & MSR_EE_FLAG)

          && !(dc->env->pvr.regs[2] & PVR2_ILL_OPCODE_EXC_MASK)

          && !(dc->env->pvr.regs[0] & PVR0_USE_BARREL_MASK)) {

        tcg_gen_movi_tl(cpu_SR[SR_ESR], ESR_EC_ILLEGAL_OP);

        t_gen_raise_exception(dc, EXCP_HW_EXCP);

        return;

    }

    s = dc->imm & (1 << 10);

    t = dc->imm & (1 << 9);

    LOG_DIS("bs%s%s r%d r%d r%d\n",

            s ? "l" : "r", t ? "a" : "l", dc->rd, dc->ra, dc->rb);

    t0 = tcg_temp_new();

    tcg_gen_mov_tl(t0, *(dec_alu_op_b(dc)));

    tcg_gen_andi_tl(t0, t0, 31);

    if (s)

        tcg_gen_shl_tl(cpu_R[dc->rd], cpu_R[dc->ra], t0);

    else {

        if (t)

            tcg_gen_sar_tl(cpu_R[dc->rd], cpu_R[dc->ra], t0);

        else

            tcg_gen_shr_tl(cpu_R[dc->rd], cpu_R[dc->ra], t0);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+void scsi_bus_legacy_handle_cmdline(SCSIBus *bus)

+{

     DriveInfo *dinfo;

     int unit;

+

     for (unit = 0; unit < MAX_SCSI_DEVS; unit++) {

void scsi_bus_legacy_handle_cmdline(SCSIBus *bus)

{

    DriveInfo *dinfo;

    int unit;

    for (unit = 0; unit < MAX_SCSI_DEVS; unit++) {

        dinfo = drive_get(IF_SCSI, bus->busnr, unit);

        if (dinfo == NULL) {

            continue;

        }

        scsi_bus_legacy_add_drive(bus, dinfo, unit);

    }

}


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

     ret = dv_extract_timecode(c->dv_demux, partial_frame, timecode);
+
+    if (ret)
+
+        av_dict_set(&s->metadata, "timecode", timecode, 0);
+
     else if (ret < 0)

         av_log(s, AV_LOG_ERROR, "Detected timecode is invalid\n");

static int dv_read_timecode(AVFormatContext *s) {

    int ret;

    char timecode[AV_TIMECODE_STR_SIZE];

    int64_t pos = avio_tell(s->pb);

    // Read 3 DIF blocks: Header block and 2 Subcode blocks.

    int partial_frame_size = 3 * 80;

    uint8_t *partial_frame = av_mallocz(sizeof(*partial_frame) *

                                        partial_frame_size);

    RawDVContext *c = s->priv_data;

    ret = avio_read(s->pb, partial_frame, partial_frame_size);

    if (ret < 0)

        goto finish;

    if (ret < partial_frame_size) {

        ret = -1;

        goto finish;

    }

    ret = dv_extract_timecode(c->dv_demux, partial_frame, timecode);

    if (ret)

        av_dict_set(&s->metadata, "timecode", timecode, 0);

    else if (ret < 0)

        av_log(s, AV_LOG_ERROR, "Detected timecode is invalid\n");

finish:

    av_free(partial_frame);

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

    return ret;

}


static int libopenjpeg_copy_packed16(AVCodecContext *avctx, const AVFrame *frame, opj_image_t *image)

{

    int compno;

    int x;

    int y;

    int *image_line;

    int frame_index;

    const int numcomps = image->numcomps;

    uint16_t *frame_ptr = (uint16_t*)frame->data[0];

    for (compno = 0; compno < numcomps; ++compno) {

        if (image->comps[compno].w > frame->linesize[0] / numcomps) {

            av_log(avctx, AV_LOG_ERROR, "Error: frame's linesize is too small for the image\n");

            return 0;

        }

    }

    for (compno = 0; compno < numcomps; ++compno) {

        for (y = 0; y < avctx->height; ++y) {

            image_line = image->comps[compno].data + y * image->comps[compno].w;

            frame_index = y * (frame->linesize[0] / 2) + compno;

            for (x = 0; x < avctx->width; ++x) {

                image_line[x] = frame_ptr[frame_index];

                frame_index += numcomps;

            }

            for (; x < image->comps[compno].w; ++x) {

                image_line[x] = image_line[x - 1];

            }

        }

        for (; y < image->comps[compno].h; ++y) {

            image_line = image->comps[compno].data + y * image->comps[compno].w;

            for (x = 0; x < image->comps[compno].w; ++x) {

                image_line[x] = image_line[x - image->comps[compno].w];

            }

        }

    }

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static int get_buffer(AVCodecContext *avctx, AVFrame *pic)
+
+{
+
     pic->type = FF_BUFFER_TYPE_USER;

     pic->data[0] = (void *)1;

static int get_buffer(AVCodecContext *avctx, AVFrame *pic)

{

    pic->type = FF_BUFFER_TYPE_USER;

    pic->data[0] = (void *)1;

    return 0;

}


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

 {

+	struct sigframe_v1 *frame;
+
 	abi_ulong frame_addr = get_sigframe(ka, regs, sizeof(*frame));

+	int i;

static void setup_frame_v1(int usig, struct target_sigaction *ka,

                           target_sigset_t *set, CPUARMState *regs)

{

	struct sigframe_v1 *frame;

	abi_ulong frame_addr = get_sigframe(ka, regs, sizeof(*frame));

	int i;

	if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 0))

		return;

	setup_sigcontext(&frame->sc, regs, set->sig[0]);

        for(i = 1; i < TARGET_NSIG_WORDS; i++) {

            if (__put_user(set->sig[i], &frame->extramask[i - 1]))

                goto end;

	}

        setup_return(regs, ka, &frame->retcode, frame_addr, usig,

                     frame_addr + offsetof(struct sigframe_v1, retcode));

end:

	unlock_user_struct(frame, frame_addr, 1);

}


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

 {

+    int fd = open(file, O_RDONLY);

     int err = -1;

static int read_random(uint32_t *dst, const char *file)

{

    int fd = open(file, O_RDONLY);

    int err = -1;

    if (fd == -1)

        return -1;

#if HAVE_FCNTL && defined(O_NONBLOCK)

    if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK) != -1)

#endif

        err = read(fd, dst, sizeof(*dst));

    close(fd);

    return err;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline void cris_ftag_d(unsigned int x)

 {

static inline void cris_ftag_d(unsigned int x)

{

	register unsigned int v asm("$r10") = x;

	asm ("ftagd\t[%0]\n" : : "r" (v) );

}


--- a/source.c
+++ b/source.c
@@ -9,10 +9,10 @@
     int ret = bdrv_co_pwritev(bs->file->bs, offset, bytes, qiov, flags);

     block_request_create(reqid, bs, qemu_coroutine_self());
+
+    qemu_coroutine_yield();
+
+

     return ret;

static int coroutine_fn blkreplay_co_pwritev(BlockDriverState *bs,

    uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags)

{

    uint64_t reqid = request_id++;

    int ret = bdrv_co_pwritev(bs->file->bs, offset, bytes, qiov, flags);

    block_request_create(reqid, bs, qemu_coroutine_self());

    qemu_coroutine_yield();

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 float32 helper_fdtos(CPUSPARCState *env, float64 src)

 {
+
+    float32 ret;
+
     clear_float_exceptions(env);

     ret = float64_to_float32(src, &env->fp_status);

float32 helper_fdtos(CPUSPARCState *env, float64 src)

{

    float32 ret;

    clear_float_exceptions(env);

    ret = float64_to_float32(src, &env->fp_status);

    check_ieee_exceptions(env);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
                         uint64_t value)

 {
+
+    ARMCPU *cpu = arm_env_get_cpu(env);
+
+
+
     if (env->cp15.c1_sys == value) {

         /* Skip the TLB flush if nothing actually changed; Linux likes

static void sctlr_write(CPUARMState *env, const ARMCPRegInfo *ri,

                        uint64_t value)

{

    ARMCPU *cpu = arm_env_get_cpu(env);

    if (env->cp15.c1_sys == value) {

        /* Skip the TLB flush if nothing actually changed; Linux likes

         * to do a lot of pointless SCTLR writes.

         */

        return;

    }

    env->cp15.c1_sys = value;

    /* ??? Lots of these bits are not implemented.  */

    /* This may enable/disable the MMU, so do a TLB flush.  */

    tlb_flush(CPU(cpu), 1);

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
         ydst+= lumStride;

     }
+
+#if COMPILE_TEMPLATE_MMX
+
+    __asm__(
+
             EMMS"       \n\t"

             SFENCE"     \n\t"

static void RENAME(yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,

                                      long width, long height,

                                      long lumStride, long chromStride, long srcStride)

{

    long y;

    const long chromWidth= -((-width)>>1);

    for (y=0; y<height; y++) {

        RENAME(extract_even)(src, ydst, width);

        if(y&1) {

            RENAME(extract_odd2avg)(src-srcStride, src, udst, vdst, chromWidth);

            udst+= chromStride;

            vdst+= chromStride;

        }

        src += srcStride;

        ydst+= lumStride;

    }

#if COMPILE_TEMPLATE_MMX

    __asm__(

            EMMS"       \n\t"

            SFENCE"     \n\t"

            ::: "memory"

        );

#endif

}


--- a/source.c
+++ b/source.c
@@ -3,8 +3,8 @@
     struct qemu_laiocb *laiocb)

 {
+
+    int ret;

static void qemu_laio_process_completion(struct qemu_laio_state *s,

    struct qemu_laiocb *laiocb)

{

    int ret;

    s->count--;

    ret = laiocb->ret;

    if (ret != -ECANCELED) {

        if (ret == laiocb->nbytes)

            ret = 0;

        else if (ret >= 0)

            ret = -EINVAL;

        laiocb->common.cb(laiocb->common.opaque, ret);

    }

    qemu_aio_release(laiocb);

}


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

 {
+
     VTEncContext *vtctx = avctx->priv_data;

static av_cold int vtenc_close(AVCodecContext *avctx)

{

    VTEncContext *vtctx = avctx->priv_data;

    if(!vtctx->session) return 0;

    VTCompressionSessionInvalidate(vtctx->session);

    pthread_cond_destroy(&vtctx->cv_sample_sent);

    pthread_mutex_destroy(&vtctx->lock);

    CFRelease(vtctx->session);

    vtctx->session = NULL;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void gen_jmp_tb(DisasContext *s, target_ulong eip, int tb_num)
+
+{
+
+    gen_update_cc_op(s);
+
     set_cc_op(s, CC_OP_DYNAMIC);

     if (s->jmp_opt) {

static void gen_jmp_tb(DisasContext *s, target_ulong eip, int tb_num)

{

    gen_update_cc_op(s);

    set_cc_op(s, CC_OP_DYNAMIC);

    if (s->jmp_opt) {

        gen_goto_tb(s, tb_num, eip);

        s->is_jmp = DISAS_TB_JUMP;

    } else {

        gen_jmp_im(eip);

        gen_eob(s);

    }

}


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

 {

+    QemuOpts *opts;

     char *path, *optstr;

int unix_listen(const char *str, char *ostr, int olen)

{

    QemuOpts *opts;

    char *path, *optstr;

    int sock, len;

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

    optstr = strchr(str, ',');

    if (optstr) {

        len = optstr - str;

        if (len) {

            path = g_malloc(len+1);

            snprintf(path, len+1, "%.*s", len, str);

            qemu_opt_set(opts, "path", path);

            g_free(path);

        }

    } else {

        qemu_opt_set(opts, "path", str);

    }

    sock = unix_listen_opts(opts);

    if (sock != -1 && ostr)

        snprintf(ostr, olen, "%s%s", qemu_opt_get(opts, "path"), optstr ? optstr : "");

    qemu_opts_del(opts);

    return sock;

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     uint16_t temp;

+
     ret = pci_device_load(&s->dev, f);

     if (ret < 0) {
@@ -23,7 +23,7 @@
     qemu_get_be16s(f, &s->ar.pm1.evt.en);

     qemu_get_be16s(f, &s->ar.pm1.cnt.cnt);
+

     ret = vmstate_load_state(f, &vmstate_apm, opaque, 1);

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

{

    PIIX4PMState *s = opaque;

    int ret, i;

    uint16_t temp;

    ret = pci_device_load(&s->dev, f);

    if (ret < 0) {

        return ret;

    }

    qemu_get_be16s(f, &s->ar.pm1.evt.sts);

    qemu_get_be16s(f, &s->ar.pm1.evt.en);

    qemu_get_be16s(f, &s->ar.pm1.cnt.cnt);

    ret = vmstate_load_state(f, &vmstate_apm, opaque, 1);

    if (ret) {

        return ret;

    }

    qemu_get_timer(f, s->ar.tmr.timer);

    qemu_get_sbe64s(f, &s->ar.tmr.overflow_time);

    qemu_get_be16s(f, (uint16_t *)s->ar.gpe.sts);

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

        qemu_get_be16s(f, &temp);

    }

    qemu_get_be16s(f, (uint16_t *)s->ar.gpe.en);

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

        qemu_get_be16s(f, &temp);

    }

    ret = vmstate_load_state(f, &vmstate_pci_status, opaque, 1);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static bool qapi_dealloc_start_union(Visitor *v, bool data_present,
+
                                      Error **errp)

 {

static bool qapi_dealloc_start_union(Visitor *v, bool data_present,

                                     Error **errp)

{

    return data_present;

}


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

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

static void adx_decode(ADXContext *c, int16_t *out, const uint8_t *in, int ch)

{

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

    GetBitContext gb;

    int scale = AV_RB16(in);

    int i;

    int s0, s1, s2, d;

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

    s1 = prev->s1;

    s2 = prev->s2;

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

        d  = get_sbits(&gb, 4);

        s0 = (BASEVOL * d * scale + SCALE1 * s1 - SCALE2 * s2) >> 14;

        s2 = s1;

        s1 = av_clip_int16(s0);

        *out = s1;

        out += c->channels;

    }

    prev->s1 = s1;

    prev->s2 = s2;

}


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

     int len;
@@ -12,14 +12,14 @@

     /* Try the name as a straight path first */

+    if (access(name, R_OK) == 0) {
+
+        return g_strdup(name);
+
     }
+
     switch (type) {
+
     case QEMU_FILE_TYPE_BIOS:

         subdir = "";

char *qemu_find_file(int type, const char *name)

{

    int len;

    const char *subdir;

    char *buf;

    /* Try the name as a straight path first */

    if (access(name, R_OK) == 0) {

        return g_strdup(name);

    }

    switch (type) {

    case QEMU_FILE_TYPE_BIOS:

        subdir = "";

        break;

    case QEMU_FILE_TYPE_KEYMAP:

        subdir = "keymaps/";

        break;

    default:

        abort();

    }

    len = strlen(data_dir) + strlen(name) + strlen(subdir) + 2;

    buf = g_malloc0(len);

    snprintf(buf, len, "%s/%s%s", data_dir, subdir, name);

    if (access(buf, R_OK)) {

        g_free(buf);

        return NULL;

    }

    return buf;

}


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

         return 0;

+
+
+    for (i = 0; i < 3; i++) {
+
+        int hshift = (i > 0) ? h->chroma_x_shift : 0;

         int vshift = (i > 0) ? h->chroma_y_shift : 0;

static int output_frame(H264Context *h, AVFrame *dst, Picture *srcp)

{

    AVFrame *src = &srcp->f;

    int i;

    int ret = av_frame_ref(dst, src);

    if (ret < 0)

        return ret;

    av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(h), 0);

    if (!srcp->crop)

        return 0;

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

        int hshift = (i > 0) ? h->chroma_x_shift : 0;

        int vshift = (i > 0) ? h->chroma_y_shift : 0;

        int off    = ((srcp->crop_left >> hshift) << h->pixel_shift) +

                      (srcp->crop_top  >> vshift) * dst->linesize[i];

        dst->data[i] += off;

    }

    return 0;

}


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

                              gdb_reg_cb get_reg, gdb_reg_cb set_reg,

+                             int num_regs, const char *xml, int g_pos)
+
+{
+
+    GDBRegisterState *s;
+
     GDBRegisterState **p;

     static int last_reg = NUM_CORE_REGS;

void gdb_register_coprocessor(CPUState * env,

                             gdb_reg_cb get_reg, gdb_reg_cb set_reg,

                             int num_regs, const char *xml, int g_pos)

{

    GDBRegisterState *s;

    GDBRegisterState **p;

    static int last_reg = NUM_CORE_REGS;

    s = (GDBRegisterState *)g_malloc0(sizeof(GDBRegisterState));

    s->base_reg = last_reg;

    s->num_regs = num_regs;

    s->get_reg = get_reg;

    s->set_reg = set_reg;

    s->xml = xml;

    p = &env->gdb_regs;

    while (*p) {

        /* Check for duplicates.  */

        if (strcmp((*p)->xml, xml) == 0)

            return;

        p = &(*p)->next;

    }

    /* Add to end of list.  */

    last_reg += num_regs;

    *p = s;

    if (g_pos) {

        if (g_pos != s->base_reg) {

            fprintf(stderr, "Error: Bad gdb register numbering for '%s'\n"

                    "Expected %d got %d\n", xml, g_pos, s->base_reg);

        } else {

            num_g_regs = last_reg;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
     if ((*pcc->interrupts_big_endian)(cpu)) {

         info->d_endian = ELFDATA2MSB;
+
+    } else {
+
+        info->d_endian = ELFDATA2LSB;
+

int cpu_get_dump_info(ArchDumpInfo *info,

                      const struct GuestPhysBlockList *guest_phys_blocks)

{

    PowerPCCPU *cpu = POWERPC_CPU(first_cpu);

    PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);

    info->d_machine = EM_PPC64;

    info->d_class = ELFCLASS64;

    if ((*pcc->interrupts_big_endian)(cpu)) {

        info->d_endian = ELFDATA2MSB;

    } else {

        info->d_endian = ELFDATA2LSB;

    return 0;


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
 static void visit_type_TestStruct(Visitor *v, TestStruct **obj,
+
                                   const char *name, Error **errp)

+{

     Error *err = NULL;

+
     visit_start_struct(v, (void **)obj, "TestStruct", name, sizeof(TestStruct),

                        &err);

static void visit_type_TestStruct(Visitor *v, TestStruct **obj,

                                  const char *name, Error **errp)

{

    Error *err = NULL;

    visit_start_struct(v, (void **)obj, "TestStruct", name, sizeof(TestStruct),

                       &err);

    if (err) {

        goto out;

    }

    visit_type_int(v, &(*obj)->integer, "integer", &err);

    visit_type_bool(v, &(*obj)->boolean, "boolean", &err);

    visit_type_str(v, &(*obj)->string, "string", &err);

    visit_end_struct(v, &err);

out:

    error_propagate(errp, err);

}


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

     int sec_num = ((rec_list2 >> 32) & 0xffff) + 1;

+    int sec_len = rec_list2 >> 48;

     ulong addr = (ulong)load_addr;

unsigned long virtio_load_direct(ulong rec_list1, ulong rec_list2,

                                 ulong subchan_id, void *load_addr)

{

    u8 status;

    int sec = rec_list1;

    int sec_num = ((rec_list2 >> 32) & 0xffff) + 1;

    int sec_len = rec_list2 >> 48;

    ulong addr = (ulong)load_addr;

    if (sec_len != virtio_get_block_size()) {

        return -1;

    }

    sclp_print(".");

    status = virtio_read_many(sec, (void *)addr, sec_num);

    if (status) {

        virtio_panic("I/O Error");

    }

    addr += sec_num * virtio_get_block_size();

    return addr;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static inline void gen_op_eval_fblg(TCGv dst, TCGv src,
+
+                                    unsigned int fcc_offset)
+
 {

     gen_mov_reg_FCC0(dst, src, fcc_offset);

static inline void gen_op_eval_fblg(TCGv dst, TCGv src,

                                    unsigned int fcc_offset)

{

    gen_mov_reg_FCC0(dst, src, fcc_offset);

    gen_mov_reg_FCC1(cpu_tmp0, src, fcc_offset);

    tcg_gen_xor_tl(dst, dst, cpu_tmp0);

}


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

 {

+    AVStream *st;

     if (c->fc->nb_streams < 1)

+        return 0;

     st = c->fc->streams[c->fc->nb_streams-1];

static int mov_read_smi(MOVContext *c, AVIOContext *pb, MOVAtom atom)

{

    AVStream *st;

    if (c->fc->nb_streams < 1)

        return 0;

    st = c->fc->streams[c->fc->nb_streams-1];

    if ((uint64_t)atom.size > (1<<30))

        return AVERROR_INVALIDDATA;

    // currently SVQ3 decoder expect full STSD header - so let's fake it

    // this should be fixed and just SMI header should be passed

    av_free(st->codec->extradata);

    st->codec->extradata = av_mallocz(atom.size + 0x5a + FF_INPUT_BUFFER_PADDING_SIZE);

    if (!st->codec->extradata)

        return AVERROR(ENOMEM);

    st->codec->extradata_size = 0x5a + atom.size;

    memcpy(st->codec->extradata, "SVQ3", 4); // fake

    avio_read(pb, st->codec->extradata + 0x5a, atom.size);

    av_log(c->fc, AV_LOG_TRACE, "Reading SMI %"PRId64"  %s\n", atom.size, st->codec->extradata + 0x5a);

    return 0;

}


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

         for (i = 0; i < debug_regions->len; i++) {

+            Range *range = &g_array_index(debug_regions, Range, i);
+
+            if (addr >= range->begin && addr <= range->end - 1) {
+
+                return true;

             }

bool qemu_log_in_addr_range(uint64_t addr)

{

    if (debug_regions) {

        int i = 0;

        for (i = 0; i < debug_regions->len; i++) {

            Range *range = &g_array_index(debug_regions, Range, i);

            if (addr >= range->begin && addr <= range->end - 1) {

                return true;

            }

        }

        return false;

    } else {

        return true;

    }

}


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

                            uint32_t value)

+{
+
+    uint32_t addr;
+
+    uint16_t mask;

     uint16_t v;

static void bitband_writew(void *opaque, target_phys_addr_t offset,

                           uint32_t value)

{

    uint32_t addr;

    uint16_t mask;

    uint16_t v;

    addr = bitband_addr(opaque, offset) & ~1;

    mask = (1 << ((offset >> 2) & 15));

    mask = tswap16(mask);

    cpu_physical_memory_read(addr, (uint8_t *)&v, 2);

    if (value & 1)

        v |= mask;

    else

        v &= ~mask;

    cpu_physical_memory_write(addr, (uint8_t *)&v, 2);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void bdrv_inherited_options(int *child_flags, QDict *child_options,

+                                   int parent_flags, QDict *parent_options)
+
+{
+
+    int flags = parent_flags;

static void bdrv_inherited_options(int *child_flags, QDict *child_options,

                                   int parent_flags, QDict *parent_options)

{

    int flags = parent_flags;

    /* Enable protocol handling, disable format probing for bs->file */

    flags |= BDRV_O_PROTOCOL;

    /* If the cache mode isn't explicitly set, inherit direct and no-flush from

     * the parent. */

    qdict_copy_default(child_options, parent_options, BDRV_OPT_CACHE_DIRECT);

    qdict_copy_default(child_options, parent_options, BDRV_OPT_CACHE_NO_FLUSH);

    /* Inherit the read-only option from the parent if it's not set */

    qdict_copy_default(child_options, parent_options, BDRV_OPT_READ_ONLY);

    /* Our block drivers take care to send flushes and respect unmap policy,

     * so we can default to enable both on lower layers regardless of the

     * corresponding parent options. */

    flags |= BDRV_O_UNMAP;

    /* Clear flags that only apply to the top layer */

    flags &= ~(BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING | BDRV_O_COPY_ON_READ |

               BDRV_O_NO_IO);

    *child_flags = flags;

}


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

 {

+    const MXFCodecUL *uls = ff_mxf_essence_container_uls;
+
+    while (uls->id != CODEC_ID_NONE) {
+
         if (uls->id == type)

             break;

static const MXFCodecUL *mxf_get_essence_container_ul(enum CodecID type)

{

    const MXFCodecUL *uls = ff_mxf_essence_container_uls;

    while (uls->id != CODEC_ID_NONE) {

        if (uls->id == type)

            break;

        uls++;

    }

    return uls;

}


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

             return 0;

+        }

         /* Normal 4kiB page */

static unsigned hpte_page_shift(const struct ppc_one_seg_page_size *sps,

    uint64_t pte0, uint64_t pte1)

{

    int i;

    if (!(pte0 & HPTE64_V_LARGE)) {

        if (sps->page_shift != 12) {

            /* 4kiB page in a non 4kiB segment */

            return 0;

        }

        /* Normal 4kiB page */

        return 12;

    }

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

        const struct ppc_one_page_size *ps = &sps->enc[i];

        uint64_t mask;

        if (!ps->page_shift) {

            break;

        }

        if (ps->page_shift == 12) {

            /* L bit is set so this can't be a 4kiB page */

            continue;

        }

        mask = ((1ULL << ps->page_shift) - 1) & HPTE64_R_RPN;

        if ((pte1 & mask) == (ps->pte_enc << HPTE64_R_RPN_SHIFT)) {

            return ps->page_shift;

        }

    }

    return 0; /* Bad page size encoding */

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void spapr_core_unplug(HotplugHandler *hotplug_dev, DeviceState *dev,
+
+                       Error **errp)
+
+{

     sPAPRCPUCore *core = SPAPR_CPU_CORE(OBJECT(dev));

void spapr_core_unplug(HotplugHandler *hotplug_dev, DeviceState *dev,

                       Error **errp)

{

    sPAPRCPUCore *core = SPAPR_CPU_CORE(OBJECT(dev));

    PowerPCCPU *cpu = POWERPC_CPU(core->threads);

    int id = ppc_get_vcpu_dt_id(cpu);

    sPAPRDRConnector *drc =

        spapr_dr_connector_by_id(SPAPR_DR_CONNECTOR_TYPE_CPU, id);

    sPAPRDRConnectorClass *drck;

    Error *local_err = NULL;

    g_assert(drc);

    drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);

    drck->detach(drc, dev, spapr_core_release, NULL, &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        return;

    }

    spapr_hotplug_req_remove_by_index(drc);

}


static inline void yuv2packedXinC(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,

				    int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,

				    uint8_t *dest, int dstW, int y)

{

	int i;

	switch(c->dstFormat)

	{

	case IMGFMT_RGB32:

	case IMGFMT_BGR32:

		YSCALE_YUV_2_RGBX_C(uint32_t)

			((uint32_t*)dest)[i2+0]= r[Y1] + g[Y1] + b[Y1];

			((uint32_t*)dest)[i2+1]= r[Y2] + g[Y2] + b[Y2];

		}

		break;

	case IMGFMT_RGB24:

		YSCALE_YUV_2_RGBX_C(uint8_t)

			((uint8_t*)dest)[0]= r[Y1];

			((uint8_t*)dest)[1]= g[Y1];

			((uint8_t*)dest)[2]= b[Y1];

			((uint8_t*)dest)[3]= r[Y2];

			((uint8_t*)dest)[4]= g[Y2];

			((uint8_t*)dest)[5]= b[Y2];

			((uint8_t*)dest)+=6;

		}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+static void coroutine_fn v9fs_fix_fid_paths(V9fsPDU *pdu, V9fsPath *olddir,

                                             V9fsString *old_name,

                                             V9fsPath *newdir,

+                                            V9fsString *new_name)
+
 {

     V9fsFidState *tfidp;

static void coroutine_fn v9fs_fix_fid_paths(V9fsPDU *pdu, V9fsPath *olddir,

                                            V9fsString *old_name,

                                            V9fsPath *newdir,

                                            V9fsString *new_name)

{

    V9fsFidState *tfidp;

    V9fsPath oldpath, newpath;

    V9fsState *s = pdu->s;

    v9fs_path_init(&oldpath);

    v9fs_path_init(&newpath);

    v9fs_co_name_to_path(pdu, olddir, old_name->data, &oldpath);

    v9fs_co_name_to_path(pdu, newdir, new_name->data, &newpath);

    /*

     * Fixup fid's pointing to the old name to

     * start pointing to the new name

     */

    for (tfidp = s->fid_list; tfidp; tfidp = tfidp->next) {

        if (v9fs_path_is_ancestor(&oldpath, &tfidp->path)) {

            /* replace the name */

            v9fs_fix_path(&tfidp->path, &newpath, strlen(oldpath.data));

        }

    }

    v9fs_path_free(&oldpath);

    v9fs_path_free(&newpath);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void visit_type_number(Visitor *v, double *obj, const char *name, Error **errp)
+
+{

     if (!error_is_set(errp)) {

void visit_type_number(Visitor *v, double *obj, const char *name, Error **errp)

{

    if (!error_is_set(errp)) {

        v->type_number(v, obj, name, errp);

    }

}


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

 {

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

{

    MXFTrack *track = arg;

    switch(tag) {

    case 0x4801:

        track->track_id = avio_rb32(pb);

        break;

    case 0x4804:

        avio_read(pb, track->track_number, 4);

        break;

    case 0x4B01:

        track->edit_rate.den = avio_rb32(pb);

        track->edit_rate.num = avio_rb32(pb);

        break;

    case 0x4803:

        avio_read(pb, track->sequence_ref, 16);

        break;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -65,9 +65,9 @@
     if (frame != out_frame)

         av_frame_free(&frame);
+
+
+
+    return ff_filter_frame(ctx->outputs[0], out_frame);
+
 }

static int compand_nodelay(AVFilterContext *ctx, AVFrame *frame)

{

    CompandContext *s    = ctx->priv;

    AVFilterLink *inlink = ctx->inputs[0];

    const int channels = inlink->channels;

    const int nb_samples = frame->nb_samples;

    AVFrame *out_frame;

    int chan, i;

    if (av_frame_is_writable(frame)) {

        out_frame = frame;

    } else {

        out_frame = ff_get_audio_buffer(inlink, nb_samples);

        if (!out_frame) {

            av_frame_free(&frame);

            return AVERROR(ENOMEM);

        }

        av_frame_copy_props(out_frame, frame);

    }

    for (chan = 0; chan < channels; chan++) {

        const double *src = (double *)frame->extended_data[chan];

        double *dst = (double *)out_frame->extended_data[chan];

        ChanParam *cp = &s->channels[chan];

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

            update_volume(cp, fabs(src[i]));

            dst[i] = av_clipd(src[i] * get_volume(s, cp->volume), -1, 1);

        }

    }

    if (frame != out_frame)

        av_frame_free(&frame);

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

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void pollfds_poll(GArray *pollfds, int nfds, fd_set *rfds,
+
+                         fd_set *wfds, fd_set *xfds)
+
+{
+
     int i;

static void pollfds_poll(GArray *pollfds, int nfds, fd_set *rfds,

                         fd_set *wfds, fd_set *xfds)

{

    int i;

    for (i = 0; i < pollfds->len; i++) {

        GPollFD *pfd = &g_array_index(pollfds, GPollFD, i);

        int fd = pfd->fd;

        int revents = 0;

        if (FD_ISSET(fd, rfds)) {

            revents |= G_IO_IN;

        }

        if (FD_ISSET(fd, wfds)) {

            revents |= G_IO_OUT;

        }

        if (FD_ISSET(fd, xfds)) {

            revents |= G_IO_PRI;

        }

        pfd->revents = revents & pfd->events;

    }

}


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

 {

+    MacIOState *s = MACIO(d);

     NewWorldMacIOState *ns = NEWWORLD_MACIO(d);

static int macio_newworld_initfn(PCIDevice *d)

{

    MacIOState *s = MACIO(d);

    NewWorldMacIOState *ns = NEWWORLD_MACIO(d);

    SysBusDevice *sysbus_dev;

    MemoryRegion *timer_memory = g_new(MemoryRegion, 1);

    int i;

    int cur_irq = 0;

    int ret = macio_common_initfn(d);

    if (ret < 0) {

        return ret;

    }

    sysbus_dev = SYS_BUS_DEVICE(&s->cuda);

    sysbus_connect_irq(sysbus_dev, 0, ns->irqs[cur_irq++]);

    if (s->pic_mem) {

        /* OpenPIC */

        memory_region_add_subregion(&s->bar, 0x40000, s->pic_mem);

    }

    /* IDE buses */

    for (i = 0; i < ARRAY_SIZE(ns->ide); i++) {

        qemu_irq irq0 = ns->irqs[cur_irq++];

        qemu_irq irq1 = ns->irqs[cur_irq++];

        ret = macio_initfn_ide(s, &ns->ide[i], irq0, irq1, 0x16 + (i * 4));

        if (ret < 0) {

            return ret;

        }

    }

    /* Timer */

    memory_region_init_io(timer_memory, OBJECT(s), &timer_ops, NULL, "timer",

                          0x1000);

    memory_region_add_subregion(&s->bar, 0x15000, timer_memory);

    return 0;

}


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

     const char *str = g_strdup_printf("%llu", ULLONG_MAX);

static void test_qemu_strtoull_max(void)

{

    const char *str = g_strdup_printf("%llu", ULLONG_MAX);

    char f = 'X';

    const char *endptr = &f;

    uint64_t res = 999;

    int err;

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

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, ULLONG_MAX);

    g_assert(endptr == str + strlen(str));

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int decode_phys_chunk(AVCodecContext *avctx, PNGDecContext *s)
+
 {

     if (s->state & PNG_IDAT) {

static int decode_phys_chunk(AVCodecContext *avctx, PNGDecContext *s)

{

    if (s->state & PNG_IDAT) {

        av_log(avctx, AV_LOG_ERROR, "pHYs after IDAT\n");

        return AVERROR_INVALIDDATA;

    }

    avctx->sample_aspect_ratio.num = bytestream2_get_be32(&s->gb);

    avctx->sample_aspect_ratio.den = bytestream2_get_be32(&s->gb);

    if (avctx->sample_aspect_ratio.num < 0 || avctx->sample_aspect_ratio.den < 0)

        avctx->sample_aspect_ratio = (AVRational){ 0, 1 };

    bytestream2_skip(&s->gb, 1); /* unit specifier */

    bytestream2_skip(&s->gb, 4); /* crc */

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+const char *error_get_pretty(Error *err)

 {

const char *error_get_pretty(Error *err)

{

    return err->msg;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 void FUNCC(ff_h264_idct8_dc_add)(uint8_t *_dst, int16_t *block, int stride){

     int i, j;
+
+    int dc = (((dctcoef*)block)[0] + 32) >> 6;
+
+    pixel *dst = (pixel*)_dst;
+
     stride >>= sizeof(pixel)-1;

     for( j = 0; j < 8; j++ )

void FUNCC(ff_h264_idct8_dc_add)(uint8_t *_dst, int16_t *block, int stride){

    int i, j;

    int dc = (((dctcoef*)block)[0] + 32) >> 6;

    pixel *dst = (pixel*)_dst;

    stride >>= sizeof(pixel)-1;

    for( j = 0; j < 8; j++ )

    {

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

            dst[i] = av_clip_pixel( dst[i] + dc );

        dst += stride;

    }

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     bdrv_get_geometry(s->bs, &nb_sectors);

     s->nb_sectors = nb_sectors;
+
+
+
+    /* Update the identify data buffer. */
+
     if (s->drive_kind == IDE_CFATA) {

         ide_cfata_identify_size(s);

static void ide_resize_cb(void *opaque)

{

    IDEState *s = opaque;

    uint64_t nb_sectors;

    if (!s->identify_set) {

        return;

    }

    bdrv_get_geometry(s->bs, &nb_sectors);

    s->nb_sectors = nb_sectors;

    /* Update the identify data buffer. */

    if (s->drive_kind == IDE_CFATA) {

        ide_cfata_identify_size(s);

    } else {

        /* IDE_CD uses a different set of callbacks entirely. */

        assert(s->drive_kind != IDE_CD);

        ide_identify_size(s);

    }

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     CPUS390XState *env = &cpu->env;

     target_ulong raddr;
+
     int prot;

     uint64_t asc = env->psw.mask & PSW_MASK_ASC;

hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr)

{

    S390CPU *cpu = S390_CPU(cs);

    CPUS390XState *env = &cpu->env;

    target_ulong raddr;

    int prot;

    uint64_t asc = env->psw.mask & PSW_MASK_ASC;

    /* 31-Bit mode */

    if (!(env->psw.mask & PSW_MASK_64)) {

        vaddr &= 0x7fffffff;

    }

    mmu_translate(env, vaddr, MMU_INST_FETCH, asc, &raddr, &prot, false);

    return raddr;

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     if (job->co && !job->busy) {

         bdrv_coroutine_enter(blk_bs(job->blk), job->co);
+
+    }

 }

void block_job_enter(BlockJob *job)

{

    if (job->co && !job->busy) {

        bdrv_coroutine_enter(blk_bs(job->blk), job->co);

    }

}


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

{

    int i;

    char header[MAX_FRAME_HEADER+1];

    int ret;

    int64_t off = avio_tell(s->pb);

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

        header[i] = avio_r8(s->pb);

        if (header[i] == '\n') {

            header[i + 1] = 0;

            break;

        }

    }

    if (s->pb->error)

        return s->pb->error;

    else if (s->pb->eof_reached)

        return AVERROR_EOF;

    else if (i == MAX_FRAME_HEADER)

        return AVERROR_INVALIDDATA;

    if (strncmp(header, Y4M_FRAME_MAGIC, strlen(Y4M_FRAME_MAGIC)))

        return AVERROR_INVALIDDATA;

    ret = av_get_packet(s->pb, pkt, s->packet_size - Y4M_FRAME_MAGIC_LEN);

    if (ret < 0)

        return ret;

    else if (ret != s->packet_size - Y4M_FRAME_MAGIC_LEN)

        return s->pb->eof_reached ? AVERROR_EOF : AVERROR(EIO);

    pkt->stream_index = 0;

    pkt->pts = (off - s->internal->data_offset) / s->packet_size;

    pkt->duration = 1;

    return 0;

}


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

+{

     APICCommonState *s = APIC_COMMON(dev);

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

{

    APICCommonState *s = APIC_COMMON(dev);

    memory_region_init_io(&s->io_memory, NULL, &kvm_apic_io_ops, s, "kvm-apic-msi",

                          APIC_SPACE_SIZE);

    if (kvm_has_gsi_routing()) {

        msi_nonbroken = true;

    }

}


--- a/source.c
+++ b/source.c
@@ -5,5 +5,5 @@
     int ret = pthread_cond_broadcast(cond);

     if (ret) die2(ret, "pthread_cond_broadcast");
+
+}

static void cond_broadcast(pthread_cond_t *cond)

{

    int ret = pthread_cond_broadcast(cond);

    if (ret) die2(ret, "pthread_cond_broadcast");

}


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

         if (!strcmp(sn->id_str, name) || !strcmp(sn->name, name)) {

+            *sn_info = *sn;
+
+            ret = 0;
+
+            break;

         }

static int bdrv_snapshot_find(BlockDriverState *bs, QEMUSnapshotInfo *sn_info,

                              const char *name)

{

    QEMUSnapshotInfo *sn_tab, *sn;

    int nb_sns, i, ret;

    ret = -ENOENT;

    nb_sns = bdrv_snapshot_list(bs, &sn_tab);

    if (nb_sns < 0)

        return ret;

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

        sn = &sn_tab[i];

        if (!strcmp(sn->id_str, name) || !strcmp(sn->name, name)) {

            *sn_info = *sn;

            ret = 0;

            break;

        }

    }

    g_free(sn_tab);

    return ret;

}


--- 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
@@ -21,11 +21,11 @@
             trace_pvscsi_update_irq_msi();

             msi_notify(d, PVSCSI_VECTOR_COMPLETION);
+
+        }
+
+        return;
+
     }

pvscsi_update_irq_status(PVSCSIState *s)

{

    PCIDevice *d = PCI_DEVICE(s);

    bool should_raise = s->reg_interrupt_enabled & s->reg_interrupt_status;

    trace_pvscsi_update_irq_level(should_raise, s->reg_interrupt_enabled,

                                  s->reg_interrupt_status);

    if (s->msi_used && msi_enabled(d)) {

        if (should_raise) {

            trace_pvscsi_update_irq_msi();

            msi_notify(d, PVSCSI_VECTOR_COMPLETION);

        }

        return;

    }

    pci_set_irq(d, !!should_raise);

}


--- a/source.c
+++ b/source.c
@@ -6,11 +6,11 @@
         int fd;
         if (cmsg->cmsg_len != CMSG_LEN(sizeof(int)) ||
             cmsg->cmsg_level != SOL_SOCKET ||
+            cmsg->cmsg_type != SCM_RIGHTS)
+            continue;
+        fd = *((int *)CMSG_DATA(cmsg));
+        if (fd < 0)
+            continue;
 #ifndef MSG_CMSG_CLOEXEC
         qemu_set_cloexec(fd);
 #endif

static void unix_process_msgfd(CharDriverState *chr, struct msghdr *msg)
{
    TCPCharDriver *s = chr->opaque;
    struct cmsghdr *cmsg;
    for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
        int fd;
        if (cmsg->cmsg_len != CMSG_LEN(sizeof(int)) ||
            cmsg->cmsg_level != SOL_SOCKET ||
            cmsg->cmsg_type != SCM_RIGHTS)
            continue;
        fd = *((int *)CMSG_DATA(cmsg));
        if (fd < 0)
            continue;
#ifndef MSG_CMSG_CLOEXEC
        qemu_set_cloexec(fd);
#endif
        if (s->msgfd != -1)
            close(s->msgfd);
        s->msgfd = fd;
    }
}


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

     }

+    if (size == 4) {
+
+        return nvic_readl(opaque, offset);
+
+    }

     hw_error("NVIC: Bad read of size %d at offset 0x%x\n", size, offset);

static uint64_t nvic_sysreg_read(void *opaque, target_phys_addr_t addr,

                                 unsigned size)

{

    /* At the moment we only support the ID registers for byte/word access.

     * This is not strictly correct as a few of the other registers also

     * allow byte access.

     */

    uint32_t offset = addr;

    if (offset >= 0xfe0) {

        if (offset & 3) {

            return 0;

        }

        return nvic_id[(offset - 0xfe0) >> 2];

    }

    if (size == 4) {

        return nvic_readl(opaque, offset);

    }

    hw_error("NVIC: Bad read of size %d at offset 0x%x\n", size, offset);

}


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

+{

     return ff_vaapi_encode_init(avctx, &vaapi_encode_type_h264);

static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx)

{

    return ff_vaapi_encode_init(avctx, &vaapi_encode_type_h264);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int coroutine_fn raw_co_writev(BlockDriverState *bs, int64_t sector_num,

+                                      int nb_sectors, QEMUIOVector *qiov)

 {

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

                                      int nb_sectors, QEMUIOVector *qiov)

{

    BLKDBG_EVENT(bs->file, BLKDBG_WRITE_AIO);

    return bdrv_co_writev(bs->file, sector_num, nb_sectors, qiov);

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     /* FIXME - figure out which other formats work */

     switch (fmt) {
+
+    case IMGFMT_YV12:
+
+    case IMGFMT_IYUV:
+
     case IMGFMT_I420:

         return ff_vf_next_query_format(vf, fmt);

static int query_format(struct vf_instance *vf, unsigned int fmt)

{

    /* FIXME - figure out which other formats work */

    switch (fmt) {

    case IMGFMT_YV12:

    case IMGFMT_IYUV:

    case IMGFMT_I420:

        return ff_vf_next_query_format(vf, fmt);

    }

    return 0;

}


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

         /* Only the LOAD AND TEST instruction is available.  */
+
+        return val == 0;
+
+    }
+
 }

static int tcg_match_cmpi(TCGType type, tcg_target_long val)

{

    if (facilities & FACILITY_EXT_IMM) {

        /* The COMPARE IMMEDIATE instruction is available.  */

        if (type == TCG_TYPE_I32) {

            /* We have a 32-bit immediate and can compare against anything.  */

            return 1;

        } else {

            /* ??? We have no insight here into whether the comparison is

               signed or unsigned.  The COMPARE IMMEDIATE insn uses a 32-bit

               signed immediate, and the COMPARE LOGICAL IMMEDIATE insn uses

               a 32-bit unsigned immediate.  If we were to use the (semi)

               obvious "val == (int32_t)val" we would be enabling unsigned

               comparisons vs very large numbers.  The only solution is to

               take the intersection of the ranges.  */

            /* ??? Another possible solution is to simply lie and allow all

               constants here and force the out-of-range values into a temp

               register in tgen_cmp when we have knowledge of the actual

               comparison code in use.  */

            return val >= 0 && val <= 0x7fffffff;

        }

    } else {

        /* Only the LOAD AND TEST instruction is available.  */

        return val == 0;

    }

}


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

     SCSIDevice *d = SCSI_DEVICE(dev);

+    char path[100];
+
+
+
     snprintf(path, sizeof(path), "channel@%x/%s@%x,%x", d->channel,

              qdev_fw_name(dev), d->id, d->lun);

static char *scsibus_get_fw_dev_path(DeviceState *dev)

{

    SCSIDevice *d = SCSI_DEVICE(dev);

    char path[100];

    snprintf(path, sizeof(path), "channel@%x/%s@%x,%x", d->channel,

             qdev_fw_name(dev), d->id, d->lun);

    return strdup(path);

}


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

                                             int flags)
+
 {

     static RAMBlock *block = NULL;
@@ -13,7 +13,7 @@
     uint8_t len;

+
     if (flags & RAM_SAVE_FLAG_CONTINUE) {

         if (!block) {

static inline void *host_from_stream_offset(QEMUFile *f,

                                            ram_addr_t offset,

                                            int flags)

{

    static RAMBlock *block = NULL;

    char id[256];

    uint8_t len;

    if (flags & RAM_SAVE_FLAG_CONTINUE) {

        if (!block) {

            error_report("Ack, bad migration stream!");

            return NULL;

        }

        return memory_region_get_ram_ptr(block->mr) + offset;

    }

    len = qemu_get_byte(f);

    qemu_get_buffer(f, (uint8_t *)id, len);

    id[len] = 0;

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

        if (!strncmp(id, block->idstr, sizeof(id)))

            return memory_region_get_ram_ptr(block->mr) + offset;

    }

    error_report("Can't find block %s!", id);

    return NULL;

}


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

         bus->parent->num_child_bus--;

+    }
+
+
+    if (bus->qdev_allocated) {
+
         qemu_free(bus);

     }

void qbus_free(BusState *bus)

{

    DeviceState *dev;

    while ((dev = QLIST_FIRST(&bus->children)) != NULL) {

        qdev_free(dev);

    }

    if (bus->parent) {

        QLIST_REMOVE(bus, sibling);

        bus->parent->num_child_bus--;

    }

    if (bus->qdev_allocated) {

        qemu_free(bus);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+bool guest_validate_base(unsigned long guest_base)

 {

bool guest_validate_base(unsigned long guest_base)

{

    return 1;

}


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

                     if (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ff_jpeg2000_getsigctxno(t1->flags[y+1][x+1] & flags_mask, bandno))) {

+                        int xorbit, ctxno = ff_jpeg2000_getsgnctxno(t1->flags[y+1][x+1], &xorbit);
+
+                        if (bpass_csty_symbol)
+
+                             t1->data[y][x] = ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ctxno) ? -mask : mask;

                         else

static void decode_sigpass(Jpeg2000T1Context *t1, int width, int height,

                           int bpno, int bandno, int bpass_csty_symbol,

                           int vert_causal_ctx_csty_symbol)

{

    int mask = 3 << (bpno - 1), y0, x, y;

    for (y0 = 0; y0 < height; y0 += 4)

        for (x = 0; x < width; x++)

            for (y = y0; y < height && y < y0 + 4; y++) {

                if ((t1->flags[y+1][x+1] & JPEG2000_T1_SIG_NB)

                && !(t1->flags[y+1][x+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS))) {

                    int flags_mask = -1;

                    if (vert_causal_ctx_csty_symbol && y == y0 + 3)

                        flags_mask &= ~(JPEG2000_T1_SIG_S | JPEG2000_T1_SIG_SW | JPEG2000_T1_SIG_SE);

                    if (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ff_jpeg2000_getsigctxno(t1->flags[y+1][x+1] & flags_mask, bandno))) {

                        int xorbit, ctxno = ff_jpeg2000_getsgnctxno(t1->flags[y+1][x+1], &xorbit);

                        if (bpass_csty_symbol)

                             t1->data[y][x] = ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ctxno) ? -mask : mask;

                        else

                             t1->data[y][x] = (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ctxno) ^ xorbit) ?

                                               -mask : mask;

                        ff_jpeg2000_set_significance(t1, x, y,

                                                     t1->data[y][x] < 0);

                    }

                    t1->flags[y + 1][x + 1] |= JPEG2000_T1_VIS;

                }

            }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1,

+                       intptr_t arg2)
+
+{
+
+    uint8_t *old_code_ptr = s->code_ptr;

     if (type == TCG_TYPE_I32) {

static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1,

                       intptr_t arg2)

{

    uint8_t *old_code_ptr = s->code_ptr;

    if (type == TCG_TYPE_I32) {

        tcg_out_op_t(s, INDEX_op_st_i32);

        tcg_out_r(s, arg);

        tcg_out_r(s, arg1);

        tcg_out32(s, arg2);

    } else {

        assert(type == TCG_TYPE_I64);

#if TCG_TARGET_REG_BITS == 64

        tcg_out_op_t(s, INDEX_op_st_i64);

        tcg_out_r(s, arg);

        tcg_out_r(s, arg1);

        tcg_out32(s, arg2);

#else

        TODO();

#endif

    }

    old_code_ptr[1] = s->code_ptr - old_code_ptr;

}


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

+{

     return lduw_phys_internal(addr, DEVICE_NATIVE_ENDIAN);

uint32_t lduw_phys(target_phys_addr_t addr)

{

    return lduw_phys_internal(addr, DEVICE_NATIVE_ENDIAN);

}


void do_divduo (void)

{

    if (likely((uint64_t)T1 != 0)) {

        xer_ov = 0;

        T0 = (uint64_t)T0 / (uint64_t)T1;

    } else {

        xer_so = 1;

        xer_ov = 1;

        T0 = 0;

    }

}


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

     c[PCI_SUBSYSTEM_VENDOR_ID + 1] = 0x49;

+    c[PCI_SUBSYSTEM_ID] = 0x4c;
+
+    c[PCI_SUBSYSTEM_ID + 1] = 0x4c;
+
+#else

     c[PCI_SUBSYSTEM_VENDOR_ID] = 0x74;

static int es1370_initfn (PCIDevice *dev)

{

    ES1370State *s = DO_UPCAST (ES1370State, dev, dev);

    uint8_t *c = s->dev.config;

    pci_config_set_vendor_id (c, PCI_VENDOR_ID_ENSONIQ);

    pci_config_set_device_id (c, PCI_DEVICE_ID_ENSONIQ_ES1370);

    c[PCI_STATUS + 1] = PCI_STATUS_DEVSEL_SLOW >> 8;

    pci_config_set_class (c, PCI_CLASS_MULTIMEDIA_AUDIO);

#if 1

    c[PCI_SUBSYSTEM_VENDOR_ID] = 0x42;

    c[PCI_SUBSYSTEM_VENDOR_ID + 1] = 0x49;

    c[PCI_SUBSYSTEM_ID] = 0x4c;

    c[PCI_SUBSYSTEM_ID + 1] = 0x4c;

#else

    c[PCI_SUBSYSTEM_VENDOR_ID] = 0x74;

    c[PCI_SUBSYSTEM_VENDOR_ID + 1] = 0x12;

    c[PCI_SUBSYSTEM_ID] = 0x71;

    c[PCI_SUBSYSTEM_ID + 1] = 0x13;

    c[PCI_CAPABILITY_LIST] = 0xdc;

    c[PCI_INTERRUPT_LINE] = 10;

    c[0xdc] = 0x00;

#endif

    /* TODO: RST# value should be 0. */

    c[PCI_INTERRUPT_PIN] = 1;

    c[PCI_MIN_GNT] = 0x0c;

    c[PCI_MAX_LAT] = 0x80;

    pci_register_bar (&s->dev, 0, 256, PCI_BASE_ADDRESS_SPACE_IO, es1370_map);

    qemu_register_reset (es1370_on_reset, s);

    AUD_register_card ("es1370", &s->card);

    es1370_reset (s);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
     if (!qobj) {

         *present = false;
+
+        return;
+
+    }
+

     *present = true;

static void qmp_input_optional(Visitor *v, const char *name, bool *present)

{

    QmpInputVisitor *qiv = to_qiv(v);

    QObject *qobj = qmp_input_get_object(qiv, name, false, NULL);

    if (!qobj) {

        *present = false;

        return;

    }

    *present = true;

}


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

         e->is_list_head = true;

+    }
+
+    QTAILQ_INSERT_HEAD(&qov->stack, e, node);
+
+}

static void qmp_output_push_obj(QmpOutputVisitor *qov, QObject *value)

{

    QStackEntry *e = g_malloc0(sizeof(*e));

    assert(qov->root);

    assert(value);

    e->value = value;

    if (qobject_type(e->value) == QTYPE_QLIST) {

        e->is_list_head = true;

    }

    QTAILQ_INSERT_HEAD(&qov->stack, e, node);

}


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

 {

+    put_ebml_binary(pb, elementid, str, strlen(str));

 }

static void put_ebml_utf8(ByteIOContext *pb, unsigned int elementid, char *str)

{

    put_ebml_binary(pb, elementid, str, strlen(str));

}


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

     int64_t res = 0;
+
+    Error *err = NULL;
+
+    Visitor *v;
+

     /* this will overflow a Qint/int64, so should be deserialized into

static void test_visitor_in_int_overflow(TestInputVisitorData *data,

                                         const void *unused)

{

    int64_t res = 0;

    Error *err = NULL;

    Visitor *v;

    /* this will overflow a Qint/int64, so should be deserialized into

     * a QFloat/double field instead, leading to an error if we pass it

     * to visit_type_int. confirm this.

     */

    v = visitor_input_test_init(data, "%f", DBL_MAX);

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

    error_free_or_abort(&err);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void coroutine_fn bdrv_get_block_status_above_co_entry(void *opaque)
+
+{
+
     BdrvCoGetBlockStatusData *data = opaque;

static void coroutine_fn bdrv_get_block_status_above_co_entry(void *opaque)

{

    BdrvCoGetBlockStatusData *data = opaque;

    data->ret = bdrv_co_get_block_status_above(data->bs, data->base,

                                               data->sector_num,

                                               data->nb_sectors,

                                               data->pnum);

    data->done = true;

}


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

+    /* No dirty page as there is zero RAM */

+    if (!ram_bytes_total()) {

         return pages;
+
     }

static int ram_find_and_save_block(RAMState *rs, bool last_stage)

{

    PageSearchStatus pss;

    int pages = 0;

    bool again, found;

    ram_addr_t dirty_ram_abs; /* Address of the start of the dirty page in

                                 ram_addr_t space */

    /* No dirty page as there is zero RAM */

    if (!ram_bytes_total()) {

        return pages;

    }

    pss.block = rs->last_seen_block;

    pss.offset = rs->last_offset;

    pss.complete_round = false;

    if (!pss.block) {

        pss.block = QLIST_FIRST_RCU(&ram_list.blocks);

    }

    do {

        again = true;

        found = get_queued_page(rs, &pss, &dirty_ram_abs);

        if (!found) {

            /* priority queue empty, so just search for something dirty */

            found = find_dirty_block(rs, &pss, &again, &dirty_ram_abs);

        }

        if (found) {

            pages = ram_save_host_page(rs, &pss, last_stage, dirty_ram_abs);

        }

    } while (!pages && again);

    rs->last_seen_block = pss.block;

    rs->last_offset = pss.offset;

    return pages;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
                                        QIOChannel **src,

                                        QIOChannel **dst)
+
+{
+
+    QIOChannelSocket *lioc;
+

     lioc = qio_channel_socket_new();

static void test_io_channel_setup_sync(SocketAddress *listen_addr,

                                       SocketAddress *connect_addr,

                                       QIOChannel **src,

                                       QIOChannel **dst)

{

    QIOChannelSocket *lioc;

    lioc = qio_channel_socket_new();

    qio_channel_socket_listen_sync(lioc, listen_addr, &error_abort);

    if (listen_addr->type == SOCKET_ADDRESS_KIND_INET) {

        SocketAddress *laddr = qio_channel_socket_get_local_address(

            lioc, &error_abort);

        g_free(connect_addr->u.inet.data->port);

        connect_addr->u.inet.data->port = g_strdup(laddr->u.inet.data->port);

        qapi_free_SocketAddress(laddr);

    }

    *src = QIO_CHANNEL(qio_channel_socket_new());

    qio_channel_socket_connect_sync(

        QIO_CHANNEL_SOCKET(*src), connect_addr, &error_abort);

    qio_channel_set_delay(*src, false);

    qio_channel_wait(QIO_CHANNEL(lioc), G_IO_IN);

    *dst = QIO_CHANNEL(qio_channel_socket_accept(lioc, &error_abort));

    g_assert(*dst);

    test_io_channel_set_socket_bufs(*src, *dst);

    object_unref(OBJECT(lioc));

}


--- a/source.c
+++ b/source.c
@@ -13,9 +13,9 @@
     if (data)

         cmd->user_print(mon, data);
+
+
+
+    qobject_decref(data);
+
 }

static void monitor_call_handler(Monitor *mon, const mon_cmd_t *cmd,

                                 const QDict *params)

{

    QObject *data = NULL;

    cmd->mhandler.cmd_new(mon, params, &data);

    if (data)

        cmd->user_print(mon, data);

    qobject_decref(data);

}


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

     av_frame_free(&avctx->coded_frame);

+
+
     return 0;

 }

static av_cold int asv_encode_close(AVCodecContext *avctx)

{

    av_frame_free(&avctx->coded_frame);

    return 0;

}


static int mm_decode_pal(MmContext *s)

{

    int i;

    bytestream2_skip(&s->gb, 4);

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

        s->palette[i] = 0xFF << 24 | bytestream2_get_be24(&s->gb);

        s->palette[i+128] = s->palette[i]<<2;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);

     struct virtio_pci_cfg_cap *cfg;
+

     if (proxy->config_cap &&

static uint32_t virtio_read_config(PCIDevice *pci_dev,

                                   uint32_t address, int len)

{

    VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);

    struct virtio_pci_cfg_cap *cfg;

    if (proxy->config_cap &&

        ranges_overlap(address, len, proxy->config_cap + offsetof(struct virtio_pci_cfg_cap,

                                                                  pci_cfg_data),

                       sizeof cfg->pci_cfg_data)) {

        uint32_t off;

        uint32_t len;

        cfg = (void *)(proxy->pci_dev.config + proxy->config_cap);

        off = le32_to_cpu(cfg->cap.offset);

        len = le32_to_cpu(cfg->cap.length);

        if (len <= sizeof cfg->pci_cfg_data) {

            virtio_address_space_read(&proxy->modern_as, off,

                                      cfg->pci_cfg_data, len);

        }

    }

    return pci_default_read_config(pci_dev, address, len);

}


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

     else

+        pages_to_flush[nb_pages_to_flush++] = addr;
+
+}

void kqemu_flush_page(CPUState *env, target_ulong addr)

{

    LOG_INT("kqemu_flush_page: addr=" TARGET_FMT_lx "\n", addr);

    if (nb_pages_to_flush >= KQEMU_MAX_PAGES_TO_FLUSH)

        nb_pages_to_flush = KQEMU_FLUSH_ALL;

    else

        pages_to_flush[nb_pages_to_flush++] = addr;

}


--- a/source.c
+++ b/source.c
@@ -10,10 +10,10 @@
     if (ret != size) {
         av_free_packet(pkt);
         return ret < 0 ? ret : AVERROR(EIO);
+    if (AV_RB16(pkt->data) & 0x8000) {
+        av_free_packet(pkt);
+        return AVERROR_EOF;
+    pkt->size     = size;
     pkt->duration = 1;
     pkt->pts      = (pkt->pos - c->header_size) / size;
     return 0;

static int adx_read_packet(AVFormatContext *s, AVPacket *pkt)
{
    ADXDemuxerContext *c = s->priv_data;
    AVCodecContext *avctx = s->streams[0]->codec;
    int ret, size;
    size = BLOCK_SIZE * avctx->channels;
    pkt->pos = avio_tell(s->pb);
    pkt->stream_index = 0;
    ret = av_get_packet(s->pb, pkt, size);
    if (ret != size) {
        av_free_packet(pkt);
        return ret < 0 ? ret : AVERROR(EIO);
    if (AV_RB16(pkt->data) & 0x8000) {
        av_free_packet(pkt);
        return AVERROR_EOF;
    pkt->size     = size;
    pkt->duration = 1;
    pkt->pts      = (pkt->pos - c->header_size) / size;
    return 0;


--- a/source.c
+++ b/source.c
@@ -1,18 +1,18 @@
 int qemu_opts_foreach(QemuOptsList *list, qemu_opts_loopfunc func,

                       void *opaque, Error **errp)
+
 {

     Location loc;

     QemuOpts *opts;
+
     int rc;

+    loc_push_none(&loc);

     QTAILQ_FOREACH(opts, &list->head, next) {

int qemu_opts_foreach(QemuOptsList *list, qemu_opts_loopfunc func,

                      void *opaque, Error **errp)

{

    Location loc;

    QemuOpts *opts;

    int rc;

    loc_push_none(&loc);

    QTAILQ_FOREACH(opts, &list->head, next) {

        loc_restore(&opts->loc);

        rc = func(opaque, opts, errp);

        if (rc) {

            return rc;

        }

        assert(!errp || !*errp);

    }

    loc_pop(&loc);

    return 0;

}


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

     WSACleanup();

static void slirp_cleanup(void)

{

    WSACleanup();

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
         return true;

     }
+
+    return false;
+
 }

gboolean qcrypto_hash_supports(QCryptoHashAlgorithm alg)

{

    if (alg < G_N_ELEMENTS(qcrypto_hash_alg_map)) {

        return true;

    }

    return false;

}


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

+
     s = (icp_pit_state *)qemu_mallocz(sizeof(icp_pit_state));

     s->base = base;

void icp_pit_init(uint32_t base, qemu_irq *pic, int irq)

{

    int iomemtype;

    icp_pit_state *s;

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

    s->base = base;

    /* Timer 0 runs at the system clock speed (40MHz).  */

    s->timer[0] = arm_timer_init(40000000, pic[irq]);

    /* The other two timers run at 1MHz.  */

    s->timer[1] = arm_timer_init(1000000, pic[irq + 1]);

    s->timer[2] = arm_timer_init(1000000, pic[irq + 2]);

    iomemtype = cpu_register_io_memory(0, icp_pit_readfn,

                                       icp_pit_writefn, s);

    cpu_register_physical_memory(base, 0x00000fff, iomemtype);

    /* ??? Save/restore.  */

}


--- a/source.c
+++ b/source.c
@@ -15,10 +15,10 @@
         return;
     if (has_format && (format == DATA_FORMAT_BASE64)) {
         write_data = g_base64_decode(data, &write_count);
+    } else {
+        write_data = (uint8_t *)data;
+        write_count = strlen(data);
+    ret = cirmem_chr_write(chr, write_data, write_count);
+    if (ret < 0) {
         error_setg(errp, "Failed to write to device %s", device);
         return;

void qmp_memchar_write(const char *device, const char *data,
                       bool has_format, enum DataFormat format,
                       Error **errp)
{
    CharDriverState *chr;
    const uint8_t *write_data;
    int ret;
    size_t write_count;
    chr = qemu_chr_find(device);
    if (!chr) {
        error_setg(errp, "Device '%s' not found", device);
        return;
    if (qemu_is_chr(chr, "memory")) {
        error_setg(errp,"%s is not memory char device", device);
        return;
    if (has_format && (format == DATA_FORMAT_BASE64)) {
        write_data = g_base64_decode(data, &write_count);
    } else {
        write_data = (uint8_t *)data;
        write_count = strlen(data);
    ret = cirmem_chr_write(chr, write_data, write_count);
    if (ret < 0) {
        error_setg(errp, "Failed to write to device %s", device);
        return;


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

 	PIIX4PMState *s = opaque;
+
+	uint8_t *pci_conf = s->dev.config;
+
+

 	pci_conf[0x58] = 0;

static void piix4_reset(void *opaque)

{

	PIIX4PMState *s = opaque;

	uint8_t *pci_conf = s->dev.config;

	pci_conf[0x58] = 0;

	pci_conf[0x59] = 0;

	pci_conf[0x5a] = 0;

	pci_conf[0x5b] = 0;

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
                                   const char *model,

                                   const char *name,
+
+                                  const char *host_str)
+
+{
+
     NetClientState *nc;

     NetSocketState *s;

static int net_socket_listen_init(NetClientState *peer,

                                  const char *model,

                                  const char *name,

                                  const char *host_str)

{

    NetClientState *nc;

    NetSocketState *s;

    SocketAddressLegacy *saddr;

    int ret;

    Error *local_error = NULL;

    saddr = socket_parse(host_str, &local_error);

    if (saddr == NULL) {

        error_report_err(local_error);

        return -1;

    }

    ret = socket_listen(saddr, &local_error);

    if (ret < 0) {

        qapi_free_SocketAddressLegacy(saddr);

        error_report_err(local_error);

        return -1;

    }

    nc = qemu_new_net_client(&net_socket_info, peer, model, name);

    s = DO_UPCAST(NetSocketState, nc, nc);

    s->fd = -1;

    s->listen_fd = ret;

    s->nc.link_down = true;

    net_socket_rs_init(&s->rs, net_socket_rs_finalize);

    qemu_set_fd_handler(s->listen_fd, net_socket_accept, NULL, s);

    qapi_free_SocketAddressLegacy(saddr);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int local_open(FsContext *ctx, V9fsPath *fs_path,
+
+                      int flags, V9fsFidOpenState *fs)

+{
+
+    char *buffer;

     char *path = fs_path->data;

static int local_open(FsContext *ctx, V9fsPath *fs_path,

                      int flags, V9fsFidOpenState *fs)

{

    char *buffer;

    char *path = fs_path->data;

    int fd;

    buffer = rpath(ctx, path);

    fd = open(buffer, flags | O_NOFOLLOW);

    g_free(buffer);

    if (fd == -1) {

        return -1;

    }

    fs->fd = fd;

    return fs->fd;

}


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

     QLIST_FOREACH(mon_fdset, &mon_fdsets, next) {

+        QLIST_FOREACH(mon_fdset_fd_dup, &mon_fdset->dup_fds, next) {

             if (mon_fdset_fd_dup->fd == dup_fd) {

+                if (remove) {

                     QLIST_REMOVE(mon_fdset_fd_dup, next);

static int monitor_fdset_dup_fd_find_remove(int dup_fd, bool remove)

{

    MonFdset *mon_fdset;

    MonFdsetFd *mon_fdset_fd_dup;

    QLIST_FOREACH(mon_fdset, &mon_fdsets, next) {

        QLIST_FOREACH(mon_fdset_fd_dup, &mon_fdset->dup_fds, next) {

            if (mon_fdset_fd_dup->fd == dup_fd) {

                if (remove) {

                    QLIST_REMOVE(mon_fdset_fd_dup, next);

                    if (QLIST_EMPTY(&mon_fdset->dup_fds)) {

                        monitor_fdset_cleanup(mon_fdset);

                    }

                }

                return mon_fdset->id;

            }

        }

    }

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int ivf_write_trailer(AVFormatContext *s)

+{
+
     AVIOContext *pb = s->pb;

     if (pb->seekable) {

static int ivf_write_trailer(AVFormatContext *s)

{

    AVIOContext *pb = s->pb;

    if (pb->seekable) {

        IVFEncContext *ctx = s->priv_data;

        size_t end = avio_tell(pb);

        avio_seek(pb, 24, SEEK_SET);

        avio_wl64(pb, ctx->frame_cnt * ctx->sum_delta_pts / (ctx->frame_cnt - 1));

        avio_seek(pb, end, SEEK_SET);

    }

    return 0;

}


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

     init_get_clock();

static void init_timers(void)

{

    init_get_clock();

    rt_clock = qemu_new_clock(QEMU_TIMER_REALTIME);

    vm_clock = qemu_new_clock(QEMU_TIMER_VIRTUAL);

}


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

             qapi_event_send_device_tray_moved(blk_name(blk),
+
+                                              false, &error_abort);
+
+        }
+
     }

 }

void blk_dev_change_media_cb(BlockBackend *blk, bool load)

{

    if (blk->dev_ops && blk->dev_ops->change_media_cb) {

        bool tray_was_closed = !blk_dev_is_tray_open(blk);

        blk->dev_ops->change_media_cb(blk->dev_opaque, load);

        if (tray_was_closed) {

            /* tray open */

            qapi_event_send_device_tray_moved(blk_name(blk),

                                              true, &error_abort);

        }

        if (load) {

            /* tray close */

            qapi_event_send_device_tray_moved(blk_name(blk),

                                              false, &error_abort);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
+void qemu_notify_event(void)
+
+{
+
+    CPUState *env = cpu_single_env;

+
+
     qemu_event_increment ();
+
     if (env) {

         cpu_exit(env);

void qemu_notify_event(void)

{

    CPUState *env = cpu_single_env;

    qemu_event_increment ();

    if (env) {

        cpu_exit(env);

    }

    if (next_cpu && env != next_cpu) {

        cpu_exit(next_cpu);

    }

    exit_request = 1;

}


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

     pci_mem_config = cpu_register_io_memory(pci_grackle_config_read,

+                                            pci_grackle_config_write, s);
+
+    pci_mem_data = cpu_register_io_memory(pci_grackle_read,
+
+                                          pci_grackle_write,

                                           &s->host_state);

static int pci_grackle_init_device(SysBusDevice *dev)

{

    GrackleState *s;

    int pci_mem_config, pci_mem_data;

    s = FROM_SYSBUS(GrackleState, dev);

    pci_mem_config = cpu_register_io_memory(pci_grackle_config_read,

                                            pci_grackle_config_write, s);

    pci_mem_data = cpu_register_io_memory(pci_grackle_read,

                                          pci_grackle_write,

                                          &s->host_state);

    sysbus_init_mmio(dev, 0x1000, pci_mem_config);

    sysbus_init_mmio(dev, 0x1000, pci_mem_data);

    register_savevm("grackle", 0, 1, pci_grackle_save, pci_grackle_load,

                    &s->host_state);

    qemu_register_reset(pci_grackle_reset, &s->host_state);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+void visit_get_next_type(Visitor *v, int *obj, const int *qtypes,

+                         const char *name, Error **errp)

 {

void visit_get_next_type(Visitor *v, int *obj, const int *qtypes,

                         const char *name, Error **errp)

{

    if (v->get_next_type) {

        v->get_next_type(v, obj, qtypes, name, errp);

    }

}


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

                                         float *vec, unsigned vlen)

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

                                        unsigned ch,

                                        uint8_t *do_not_decode,

                                        float *vec, unsigned vlen)

{

    if (vr->type == 2)

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

    else if (vr->type == 1)

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

    else if (vr->type == 0)

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

    else {

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

        return AVERROR_INVALIDDATA;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int dxva2_vc1_start_frame(AVCodecContext *avctx,

+                                 av_unused const uint8_t *buffer,
+
+                                 av_unused uint32_t size)
+
+{

     const VC1Context *v = avctx->priv_data;

static int dxva2_vc1_start_frame(AVCodecContext *avctx,

                                 av_unused const uint8_t *buffer,

                                 av_unused uint32_t size)

{

    const VC1Context *v = avctx->priv_data;

    AVDXVAContext *ctx = avctx->hwaccel_context;

    struct dxva2_picture_context *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private;

    if (!DXVA_CONTEXT_VALID(avctx, ctx))

        return -1;

    assert(ctx_pic);

    fill_picture_parameters(avctx, ctx, v, &ctx_pic->pp);

    ctx_pic->bitstream_size = 0;

    ctx_pic->bitstream      = NULL;

    return 0;

}