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

 {

+    readline_start("(qemu) ", 0, monitor_handle_command1, NULL);

 }

static void monitor_start_input(void)

{

    readline_start("(qemu) ", 0, monitor_handle_command1, NULL);

}


--- a/source.c
+++ b/source.c
@@ -13,7 +13,7 @@
             io_remove_watch_poll(s->fd_tag);

             s->fd_tag = 0;
+
         }

         s->connected = 0;

static void pty_chr_state(CharDriverState *chr, int connected)

{

    PtyCharDriver *s = chr->opaque;

    if (!connected) {

        if (s->fd_tag) {

            io_remove_watch_poll(s->fd_tag);

            s->fd_tag = 0;

        }

        s->connected = 0;

        /* (re-)connect poll interval for idle guests: once per second.

         * We check more frequently in case the guests sends data to

         * the virtual device linked to our pty. */

        pty_chr_rearm_timer(chr, 1000);

    } else {

        if (s->timer_tag) {

            g_source_remove(s->timer_tag);

            s->timer_tag = 0;

        }

        if (!s->connected) {

            qemu_chr_be_generic_open(chr);

            s->connected = 1;

            s->fd_tag = io_add_watch_poll(s->fd, pty_chr_read_poll, pty_chr_read, chr);

        }

    }

}


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

     AVStream *st;
+
     uint8_t profile_level;

@@ -11,7 +11,7 @@
     if (c->fc->nb_streams < 1)

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

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

{

    AVStream *st;

    uint8_t profile_level;

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

        return 0;

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

    if (atom.size >= (1<<28) || atom.size < 7)

        return AVERROR_INVALIDDATA;

    profile_level = avio_r8(pb);

    if ((profile_level & 0xf0) != 0xc0)

        return 0;

    av_free(st->codec->extradata);

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

    if (!st->codec->extradata)

        return AVERROR(ENOMEM);

    st->codec->extradata_size = atom.size - 7;

    avio_seek(pb, 6, SEEK_CUR);

    avio_read(pb, st->codec->extradata, st->codec->extradata_size);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int nbd_send_reply(int csock, struct nbd_reply *reply)

 {

static int nbd_send_reply(int csock, struct nbd_reply *reply)

{

    uint8_t buf[4 + 4 + 8];

    /* Reply

       [ 0 ..  3]    magic   (NBD_REPLY_MAGIC)

       [ 4 ..  7]    error   (0 == no error)

       [ 7 .. 15]    handle

     */

    cpu_to_be32w((uint32_t*)buf, NBD_REPLY_MAGIC);

    cpu_to_be32w((uint32_t*)(buf + 4), reply->error);

    cpu_to_be64w((uint64_t*)(buf + 8), reply->handle);

    TRACE("Sending response to client");

    if (write_sync(csock, buf, sizeof(buf)) != sizeof(buf)) {

        LOG("writing to socket failed");

        errno = EINVAL;

        return -1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
     if ((s->attributes & ATTR_BLINK))

         bg += 8;
+
+    if ((s->attributes & ATTR_REVERSE))
+
+        FFSWAP(int, fg, bg);
+
     if ((s->attributes & ATTR_CONCEALED))

         fg = bg;

static void draw_char(AVCodecContext *avctx, int c)

{

    AnsiContext *s = avctx->priv_data;

    int fg = s->fg;

    int bg = s->bg;

    if ((s->attributes & ATTR_BOLD))

        fg += 8;

    if ((s->attributes & ATTR_BLINK))

        bg += 8;

    if ((s->attributes & ATTR_REVERSE))

        FFSWAP(int, fg, bg);

    if ((s->attributes & ATTR_CONCEALED))

        fg = bg;

    ff_draw_pc_font(s->frame->data[0] + s->y * s->frame->linesize[0] + s->x,

                    s->frame->linesize[0], s->font, s->font_height, c, fg, bg);

    s->x += FONT_WIDTH;

    if (s->x >= avctx->width) {

        s->x = 0;

        hscroll(avctx);

    }

}


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

     if (oc) {
+
+        DeviceClass *dc = DEVICE_CLASS(oc);
+
+
+
         if (dc->hotpluggable) {

             /* If hotpluggable then skip not_used checking. */

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

{

    GlobalProperty *g;

    ObjectClass *oc;

    g = g_malloc0(sizeof(*g));

    g->driver   = qemu_opt_get(opts, "driver");

    g->property = qemu_opt_get(opts, "property");

    g->value    = qemu_opt_get(opts, "value");

    oc = object_class_dynamic_cast(object_class_by_name(g->driver),

                                   TYPE_DEVICE);

    if (oc) {

        DeviceClass *dc = DEVICE_CLASS(oc);

        if (dc->hotpluggable) {

            /* If hotpluggable then skip not_used checking. */

            g->not_used = false;

        } else {

            /* Maybe a typo. */

            g->not_used = true;

        }

    } else {

        /* Maybe a typo. */

        g->not_used = true;

    }

    qdev_prop_register_global(g);

    return 0;

}


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

                                                  va_list *ap)

+{
+
+    visitor_input_teardown(data, NULL);
+
+

     data->obj = qobject_from_jsonv(json_string, ap);

static Visitor *visitor_input_test_init_internal(TestInputVisitorData *data,

                                                 const char *json_string,

                                                 va_list *ap)

{

    visitor_input_teardown(data, NULL);

    data->obj = qobject_from_jsonv(json_string, ap);

    g_assert(data->obj);

    data->qiv = qmp_input_visitor_new(data->obj, false);

    g_assert(data->qiv);

    return data->qiv;

}


static void vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride, int mode, int rnd)

{

    int i, j;

    uint8_t tmp[8*11], *tptr;

    int m, r;

    m = (mode & 3);

    r = rnd;

    src -= stride;

    tptr = tmp;

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

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

            tptr[i] = vc1_mspel_filter(src + i, 1, m, r);

        src += stride;

        tptr += 8;

    }

    r = 1 - rnd;

    m = (mode >> 2) & 3;

    tptr = tmp + 8;

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

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

            dst[i] = vc1_mspel_filter(tptr + i, 8, m, r);

        dst += stride;

        tptr += 8;

    }

}


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

     trace_qemu_system_shutdown_request();

void qemu_system_shutdown_request(void)

{

    trace_qemu_system_shutdown_request();

    replay_shutdown_request();

    /* TODO - add a parameter to allow callers to specify reason */

    shutdown_requested = SHUTDOWN_CAUSE_HOST_ERROR;

    qemu_notify_event();

}


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

     /* we must restore the default rounding state */
+
+    asm volatile ("fninit");
+
+    fpuc = 0x037f | (env->fpuc & (3 << 10));
+
     asm volatile("fldcw %0" : : "m" (fpuc));

 }

static void save_native_fp_fxsave(CPUState *env)

{

    struct fpxstate *fp = &fpx1;

    int fptag, i, j;

    uint16_t fpuc;

    asm volatile ("fxsave %0" : : "m" (*fp));

    env->fpuc = fp->fpuc;

    env->fpstt = (fp->fpus >> 11) & 7;

    env->fpus = fp->fpus & ~0x3800;

    fptag = fp->fptag ^ 0xff;

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

        env->fptags[i] = (fptag >> i) & 1;

    }

    j = env->fpstt;

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

        memcpy(&env->fpregs[j].d, &fp->fpregs1[i * 16], 10);

        j = (j + 1) & 7;

    }

    if (env->cpuid_features & CPUID_SSE) {

        env->mxcsr = fp->mxcsr;

        memcpy(env->xmm_regs, fp->xmm_regs, CPU_NB_REGS * 16);

    }

    /* we must restore the default rounding state */

    asm volatile ("fninit");

    fpuc = 0x037f | (env->fpuc & (3 << 10));

    asm volatile("fldcw %0" : : "m" (fpuc));

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     OMAPI2C *s = g_malloc0(sizeof(*s));

     I2CAdapter *i2c = (I2CAdapter *)s;
+
     uint16_t data;

I2CAdapter *omap_i2c_create(uint64_t addr)

{

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

    I2CAdapter *i2c = (I2CAdapter *)s;

    uint16_t data;

    s->addr = addr;

    i2c->send = omap_i2c_send;

    i2c->recv = omap_i2c_recv;

    /* verify the mmio address by looking for a known signature */

    memread(addr + OMAP_I2C_REV, &data, 2);

    g_assert_cmphex(data, ==, 0x34);

    return i2c;

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                                          DeviceState *dev,

                                          uint8_t **exp_cap, Error **errp)
+
 {

     *exp_cap = hotplug_dev->config + hotplug_dev->exp.exp_cap;

static void pcie_cap_slot_hotplug_common(PCIDevice *hotplug_dev,

                                         DeviceState *dev,

                                         uint8_t **exp_cap, Error **errp)

{

    *exp_cap = hotplug_dev->config + hotplug_dev->exp.exp_cap;

    uint16_t sltsta = pci_get_word(*exp_cap + PCI_EXP_SLTSTA);

    PCIE_DEV_PRINTF(PCI_DEVICE(dev), "hotplug state: 0x%x\n", sltsta);

    if (sltsta & PCI_EXP_SLTSTA_EIS) {

        /* the slot is electromechanically locked.

         * This error is propagated up to qdev and then to HMP/QMP.

         */

        error_setg_errno(errp, -EBUSY, "slot is electromechanically locked");

    }

}


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

         return 0;

+
+
+    return sizeof(s->buffer)-16;
+
+}

static int pcnet_can_receive(void *opaque)

{

    PCNetState *s = opaque;

    if (CSR_STOP(s) || CSR_SPND(s))

        return 0;

    if (s->recv_pos > 0)

        return 0;

    return sizeof(s->buffer)-16;

}


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

     s->root = vtd_get_quad_raw(s, DMAR_RTADDR_REG);
+
+    s->root_extended = s->root & VTD_RTADDR_RTT;
+
     s->root &= VTD_RTADDR_ADDR_MASK(VTD_HOST_ADDRESS_WIDTH);

static void vtd_root_table_setup(IntelIOMMUState *s)

{

    s->root = vtd_get_quad_raw(s, DMAR_RTADDR_REG);

    s->root_extended = s->root & VTD_RTADDR_RTT;

    s->root &= VTD_RTADDR_ADDR_MASK(VTD_HOST_ADDRESS_WIDTH);

    trace_vtd_reg_dmar_root(s->root, s->root_extended);

}


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

+    if (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX) {
+
+#if HAVE_MMX_INLINE
+
+        if (mm_flags & AV_CPU_FLAG_MMX && HAVE_MMX)

             s->dct_quantize = dct_quantize_MMX;

void ff_MPV_encode_init_x86(MpegEncContext *s)

{

    int mm_flags = av_get_cpu_flags();

    const int dct_algo = s->avctx->dct_algo;

    if (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX) {

#if HAVE_MMX_INLINE

        if (mm_flags & AV_CPU_FLAG_MMX && HAVE_MMX)

            s->dct_quantize = dct_quantize_MMX;

#endif

#if HAVE_MMXEXT_INLINE

        if (mm_flags & AV_CPU_FLAG_MMXEXT && HAVE_MMXEXT)

            s->dct_quantize = dct_quantize_MMX2;

#endif

#if HAVE_SSE2_INLINE

        if (mm_flags & AV_CPU_FLAG_SSE2 && HAVE_SSE2)

            s->dct_quantize = dct_quantize_SSE2;

#endif

#if HAVE_SSSE3_INLINE

        if (mm_flags & AV_CPU_FLAG_SSSE3)

            s->dct_quantize = dct_quantize_SSSE3;

#endif

    }

}


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

 {

+    TranslationBlock *tb;
+
+
+
+    tb = s->tb;

     if (use_goto_tb(s, n, dest)) {

static inline void gen_goto_tb(DisasContext *s, int n, uint64_t dest)

{

    TranslationBlock *tb;

    tb = s->tb;

    if (use_goto_tb(s, n, dest)) {

        tcg_gen_goto_tb(n);

        gen_a64_set_pc_im(dest);

        tcg_gen_exit_tb((intptr_t)tb + n);

        s->is_jmp = DISAS_TB_JUMP;

    } else {

        gen_a64_set_pc_im(dest);

        if (s->singlestep_enabled) {

            gen_exception_internal(EXCP_DEBUG);

        }

        tcg_gen_exit_tb(0);

        s->is_jmp = DISAS_JUMP;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static uint64_t get_v(ByteIOContext *bc)

+{
+
+    uint64_t val = 0;
+
+

     for(; bytes_left(bc) > 0; )

static uint64_t get_v(ByteIOContext *bc)

{

    uint64_t val = 0;

    for(; bytes_left(bc) > 0; )

    {

	int tmp = get_byte(bc);

	if (tmp&0x80)

	    val= (val<<7) + tmp - 0x80;

	else

	    return (val<<7) + tmp;

    }

    return -1;

}


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

 {

+    MpegTSService *service;

static MpegTSService *mpegts_add_service(MpegTSWrite *ts, int sid,

                                         const char *provider_name,

                                         const char *name)

{

    MpegTSService *service;

    service = av_mallocz(sizeof(MpegTSService));

    if (!service)

        return NULL;

    service->pmt.pid       = ts->pmt_start_pid + ts->nb_services;

    service->sid           = sid;

    service->provider_name = av_strdup(provider_name);

    service->name          = av_strdup(name);

    service->pcr_pid       = 0x1fff;

    dynarray_add(&ts->services, &ts->nb_services, service);

    return service;

}


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

 {

+    Coroutine *co;
+
     RwCo rwco = {

         .child = child,

static int bdrv_prwv_co(BdrvChild *child, int64_t offset,

                        QEMUIOVector *qiov, bool is_write,

                        BdrvRequestFlags flags)

{

    Coroutine *co;

    RwCo rwco = {

        .child = child,

        .offset = offset,

        .qiov = qiov,

        .is_write = is_write,

        .ret = NOT_DONE,

        .flags = flags,

    };

    if (qemu_in_coroutine()) {

        /* Fast-path if already in coroutine context */

        bdrv_rw_co_entry(&rwco);

    } else {

        AioContext *aio_context = bdrv_get_aio_context(child->bs);

        co = qemu_coroutine_create(bdrv_rw_co_entry);

        qemu_coroutine_enter(co, &rwco);

        while (rwco.ret == NOT_DONE) {

            aio_poll(aio_context, true);

        }

    }

    return rwco.ret;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int local_post_create_passthrough(FsContext *fs_ctx, const char *path,

+        FsCred *credp)

 {

static int local_post_create_passthrough(FsContext *fs_ctx, const char *path,

        FsCred *credp)

{

    if (chmod(rpath(fs_ctx, path), credp->fc_mode & 07777) < 0) {

        return -1;

    }

    if (chown(rpath(fs_ctx, path), credp->fc_uid, credp->fc_gid) < 0) {

        return -1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -60,11 +60,11 @@
                 continue;

             }
+
+        }
+
+
+
         virtio_blk_req_complete(req, VIRTIO_BLK_S_OK);

         block_acct_done(blk_get_stats(req->dev->blk), &req->acct);

static void virtio_blk_rw_complete(void *opaque, int ret)

{

    VirtIOBlockReq *next = opaque;

    while (next) {

        VirtIOBlockReq *req = next;

        next = req->mr_next;

        trace_virtio_blk_rw_complete(req, ret);

        if (req->qiov.nalloc != -1) {

            /* If nalloc is != 1 req->qiov is a local copy of the original

             * external iovec. It was allocated in submit_merged_requests

             * to be able to merge requests. */

            qemu_iovec_destroy(&req->qiov);

        }

        if (ret) {

            int p = virtio_ldl_p(VIRTIO_DEVICE(req->dev), &req->out.type);

            bool is_read = !(p & VIRTIO_BLK_T_OUT);

            /* Note that memory may be dirtied on read failure.  If the

             * virtio request is not completed here, as is the case for

             * BLOCK_ERROR_ACTION_STOP, the memory may not be copied

             * correctly during live migration.  While this is ugly,

             * it is acceptable because the device is free to write to

             * the memory until the request is completed (which will

             * happen on the other side of the migration).

            if (virtio_blk_handle_rw_error(req, -ret, is_read)) {

                continue;

            }

        }

        virtio_blk_req_complete(req, VIRTIO_BLK_S_OK);

        block_acct_done(blk_get_stats(req->dev->blk), &req->acct);

        virtio_blk_free_request(req);

    }

}


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

         return NULL;
+
+    }
+
+
+
     offset = c->argv[1];

     if (offset > o->stat.st_size) {

static MTPData *usb_mtp_get_partial_object(MTPState *s, MTPControl *c,

                                           MTPObject *o)

{

    MTPData *d = usb_mtp_data_alloc(c);

    off_t offset;

    trace_usb_mtp_op_get_partial_object(s->dev.addr, o->handle, o->path,

                                        c->argv[1], c->argv[2]);

    d->fd = open(o->path, O_RDONLY);

    if (d->fd == -1) {

        return NULL;

    }

    offset = c->argv[1];

    if (offset > o->stat.st_size) {

        offset = o->stat.st_size;

    }

    lseek(d->fd, offset, SEEK_SET);

    d->length = c->argv[2];

    if (d->length > o->stat.st_size - offset) {

        d->length = o->stat.st_size - offset;

    }

    return d;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static av_cold int pcx_init(AVCodecContext *avctx) {

     PCXContext *s = avctx->priv_data;

static av_cold int pcx_init(AVCodecContext *avctx) {

    PCXContext *s = avctx->priv_data;

    avcodec_get_frame_defaults(&s->picture);

    avctx->coded_frame= &s->picture;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static inline bool migration_bitmap_test_and_reset_dirty(MemoryRegion *mr,
+
+                                                         ram_addr_t offset)
+
+{

     bool ret;

static inline bool migration_bitmap_test_and_reset_dirty(MemoryRegion *mr,

                                                         ram_addr_t offset)

{

    bool ret;

    int nr = (mr->ram_addr + offset) >> TARGET_PAGE_BITS;

    ret = test_and_clear_bit(nr, migration_bitmap);

    if (ret) {

        migration_dirty_pages--;

    }

    return ret;

}


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

         return AVERROR_EOF;

+    }
+
+    return open_file(avf, fileno);
+
+}

static int open_next_file(AVFormatContext *avf)

{

    ConcatContext *cat = avf->priv_data;

    unsigned fileno = cat->cur_file - cat->files;

    if (cat->cur_file->duration == AV_NOPTS_VALUE)

        cat->cur_file->duration = cat->avf->duration - (cat->cur_file->file_inpoint - cat->cur_file->file_start_time);

    if (++fileno >= cat->nb_files) {

        cat->eof = 1;

        return AVERROR_EOF;

    }

    return open_file(avf, fileno);

}


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

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

+        if (nb_channels    == channel_layout_map[i].nb_channels &&
+
+            channel_layout == channel_layout_map[i].layout) {
+
+            snprintf(buf, buf_size, channel_layout_map[i].name);

             return;

void avcodec_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int64_t channel_layout)

{

    int i;

    if (channel_layout==0)

        channel_layout = avcodec_guess_channel_layout(nb_channels, CODEC_ID_NONE, NULL);

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

        if (nb_channels    == channel_layout_map[i].nb_channels &&

            channel_layout == channel_layout_map[i].layout) {

            snprintf(buf, buf_size, channel_layout_map[i].name);

            return;

        }

    snprintf(buf, buf_size, "%d channels", nb_channels);

    if (channel_layout) {

        int i,ch;

        av_strlcat(buf, " (", buf_size);

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

            if ((channel_layout & (1L<<i))) {

                const char *name = get_channel_name(i);

                if (name) {

                    if (ch>0) av_strlcat(buf, "|", buf_size);

                    av_strlcat(buf, name, buf_size);

                }

                ch++;

            }

        }

        av_strlcat(buf, ")", buf_size);

    }

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
     read_count = fread(buf, 1, count, fh);
     if (ferror(fh)) {
         error_setg_errno(errp, errno, "failed to read file");
+        slog("guest-file-read failed, handle: %" PRId64, handle);
+    } else {
+        buf[read_count] = 0;
+        read_data = g_new0(GuestFileRead, 1);
+        read_data->count = read_count;
         read_data->eof = feof(fh);
         if (read_count) {
             read_data->buf_b64 = g_base64_encode(buf, read_count);

struct GuestFileRead *qmp_guest_file_read(int64_t handle, bool has_count,
                                          int64_t count, Error **errp)
{
    GuestFileHandle *gfh = guest_file_handle_find(handle, errp);
    GuestFileRead *read_data = NULL;
    guchar *buf;
    FILE *fh;
    size_t read_count;
    if (!gfh) {
    if (!has_count) {
        count = QGA_READ_COUNT_DEFAULT;
    } else if (count < 0) {
        error_setg(errp, "value '%" PRId64 "' is invalid for argument count",
                   count);
    fh = gfh->fh;
    buf = g_malloc0(count+1);
    read_count = fread(buf, 1, count, fh);
    if (ferror(fh)) {
        error_setg_errno(errp, errno, "failed to read file");
        slog("guest-file-read failed, handle: %" PRId64, handle);
    } else {
        buf[read_count] = 0;
        read_data = g_new0(GuestFileRead, 1);
        read_data->count = read_count;
        read_data->eof = feof(fh);
        if (read_count) {
            read_data->buf_b64 = g_base64_encode(buf, read_count);
        gfh->state = RW_STATE_READING;
    g_free(buf);
    clearerr(fh);
    return read_data;


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static inline uint32_t efsctsf(uint32_t val)
+
+{
+
+    CPU_FloatU u;

     float32 tmp;

static inline uint32_t efsctsf(uint32_t val)

{

    CPU_FloatU u;

    float32 tmp;

    u.l = val;

    /* NaN are not treated the same way IEEE 754 does */

    if (unlikely(float32_is_nan(u.f)))

        return 0;

    tmp = uint64_to_float32(1ULL << 32, &env->vec_status);

    u.f = float32_mul(u.f, tmp, &env->vec_status);

    return float32_to_int32(u.f, &env->vec_status);

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                                   unsigned size)

 {
+
     MacIONVRAMState *s = opaque;

     uint32_t value;

static uint64_t macio_nvram_readb(void *opaque, hwaddr addr,

                                  unsigned size)

{

    MacIONVRAMState *s = opaque;

    uint32_t value;

    addr = (addr >> s->it_shift) & (s->size - 1);

    value = s->data[addr];

    NVR_DPRINTF("readb addr %04x val %x\n", (int)addr, value);

    return value;

}


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

+    for (i = 1; i < 3; i++) {
+
+        EventNotifierTestData data = { .n = 0, .active = 10, .auto_set = true };
+
+        event_notifier_init(&data.e, false);

         aio_set_event_notifier(ctx, &data.e, true, event_ready_cb);

static void test_aio_external_client(void)

{

    int i, j;

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

        EventNotifierTestData data = { .n = 0, .active = 10, .auto_set = true };

        event_notifier_init(&data.e, false);

        aio_set_event_notifier(ctx, &data.e, true, event_ready_cb);

        event_notifier_set(&data.e);

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

            aio_disable_external(ctx);

        }

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

            assert(!aio_poll(ctx, false));

            assert(event_notifier_test_and_clear(&data.e));

            event_notifier_set(&data.e);

            aio_enable_external(ctx);

        }

        assert(aio_poll(ctx, false));

        event_notifier_cleanup(&data.e);

    }

}


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

     uc->handle_reset   = usb_hid_handle_reset;

+    uc->handle_control = usb_hid_handle_control;
+
+    uc->handle_data    = usb_hid_handle_data;
+
+    uc->handle_destroy = usb_hid_handle_destroy;

 }

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

{

    USBDeviceClass *uc = USB_DEVICE_CLASS(klass);

    uc->init           = usb_keyboard_initfn;

    uc->product_desc   = "QEMU USB Keyboard";

    uc->usb_desc       = &desc_keyboard;

    uc->handle_packet  = usb_generic_handle_packet;

    uc->handle_reset   = usb_hid_handle_reset;

    uc->handle_control = usb_hid_handle_control;

    uc->handle_data    = usb_hid_handle_data;

    uc->handle_destroy = usb_hid_handle_destroy;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static always_inline void gen_op_subfo_64 (void)
+
 {
+
     gen_op_move_T2_T0();

     gen_op_subf();

static always_inline void gen_op_subfo_64 (void)

{

    gen_op_move_T2_T0();

    gen_op_subf();

    gen_op_check_subfo_64();

}


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

     ARMCPU *cpu = ARM_CPU(obj);

+    set_feature(&cpu->env, ARM_FEATURE_V6K);
+
+    set_feature(&cpu->env, ARM_FEATURE_VFP);
+
+    set_feature(&cpu->env, ARM_FEATURE_VAPA);

     cpu->midr = ARM_CPUID_ARM11MPCORE;

static void arm11mpcore_initfn(Object *obj)

{

    ARMCPU *cpu = ARM_CPU(obj);

    set_feature(&cpu->env, ARM_FEATURE_V6K);

    set_feature(&cpu->env, ARM_FEATURE_VFP);

    set_feature(&cpu->env, ARM_FEATURE_VAPA);

    cpu->midr = ARM_CPUID_ARM11MPCORE;

    cpu->reset_fpsid = 0x410120b4;

    cpu->mvfr0 = 0x11111111;

    cpu->mvfr1 = 0x00000000;

    cpu->ctr = 0x1dd20d2;

    cpu->id_pfr0 = 0x111;

    cpu->id_pfr1 = 0x1;

    cpu->id_dfr0 = 0;

    cpu->id_afr0 = 0x2;

    cpu->id_mmfr0 = 0x01100103;

    cpu->id_mmfr1 = 0x10020302;

    cpu->id_mmfr2 = 0x01222000;

    cpu->id_isar0 = 0x00100011;

    cpu->id_isar1 = 0x12002111;

    cpu->id_isar2 = 0x11221011;

    cpu->id_isar3 = 0x01102131;

    cpu->id_isar4 = 0x141;

}


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

     cc->reset = superh_cpu_reset;

+

     cc->class_by_name = superh_cpu_class_by_name;

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

{

    DeviceClass *dc = DEVICE_CLASS(oc);

    CPUClass *cc = CPU_CLASS(oc);

    SuperHCPUClass *scc = SUPERH_CPU_CLASS(oc);

    scc->parent_realize = dc->realize;

    dc->realize = superh_cpu_realizefn;

    scc->parent_reset = cc->reset;

    cc->reset = superh_cpu_reset;

    cc->class_by_name = superh_cpu_class_by_name;

    cc->has_work = superh_cpu_has_work;

    cc->do_interrupt = superh_cpu_do_interrupt;

    cc->cpu_exec_interrupt = superh_cpu_exec_interrupt;

    cc->dump_state = superh_cpu_dump_state;

    cc->set_pc = superh_cpu_set_pc;

    cc->synchronize_from_tb = superh_cpu_synchronize_from_tb;

    cc->gdb_read_register = superh_cpu_gdb_read_register;

    cc->gdb_write_register = superh_cpu_gdb_write_register;

#ifdef CONFIG_USER_ONLY

    cc->handle_mmu_fault = superh_cpu_handle_mmu_fault;

#else

    cc->get_phys_page_debug = superh_cpu_get_phys_page_debug;

#endif

    cc->disas_set_info = superh_cpu_disas_set_info;

    cc->gdb_num_core_regs = 59;

    dc->vmsd = &vmstate_sh_cpu;

    /*

     * Reason: superh_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
@@ -13,11 +13,11 @@
     if (!f)
         return;
     if (s->ctla & CTLA_FORCE_BLANK) {
+        /* blank screen */
+        fprintf(f, "P4\n%d %d\n",
+            s->width, s->height);
+        for (y = 0; y < s->height; y++)
+            for (x = 0; x < s->width; x++)
                 fputc(0, f);
     } else {
         data_buffer = s->vram + s->top_of_screen;

static void g364fb_screen_dump(void *opaque, const char *filename)
{
    G364State *s = opaque;
    int y, x;
    uint8_t index;
    uint8_t *data_buffer;
    FILE *f;
    if (s->depth != 8) {
        error_report("g364: unknown guest depth %d", s->depth);
        return;
    }
    f = fopen(filename, "wb");
    if (!f)
        return;
    if (s->ctla & CTLA_FORCE_BLANK) {
        /* blank screen */
        fprintf(f, "P4\n%d %d\n",
            s->width, s->height);
        for (y = 0; y < s->height; y++)
            for (x = 0; x < s->width; x++)
                fputc(0, f);
    } else {
        data_buffer = s->vram + s->top_of_screen;
        fprintf(f, "P6\n%d %d\n%d\n",
            s->width, s->height, 255);
        for (y = 0; y < s->height; y++)
            for (x = 0; x < s->width; x++, data_buffer++) {
                index = *data_buffer;
                fputc(s->color_palette[index][0], f);
                fputc(s->color_palette[index][1], f);
                fputc(s->color_palette[index][2], f);
        }
    }
    fclose(f);
}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     AlphaCPU *cpu;

     ObjectClass *cpu_class;
+
+
+
+    cpu_class = alpha_cpu_class_by_name(cpu_model);
+
     if (cpu_class == NULL) {

         /* Default to ev67; no reason not to emulate insns by default.  */

AlphaCPU *cpu_alpha_init(const char *cpu_model)

{

    AlphaCPU *cpu;

    ObjectClass *cpu_class;

    cpu_class = alpha_cpu_class_by_name(cpu_model);

    if (cpu_class == NULL) {

        /* Default to ev67; no reason not to emulate insns by default.  */

        cpu_class = object_class_by_name(TYPE("ev67"));

    }

    cpu = ALPHA_CPU(object_new(object_class_get_name(cpu_class)));

    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);

    return cpu;

}


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

     s->txint = 1;
+
     if (!s->rxint_under_svc) {

         s->txint_under_svc = 1;

+        if (s->chn == chn_a) {

             s->rregs[R_INTR] |= INTR_TXINTA;

static inline void set_txint(ChannelState *s)

{

    s->txint = 1;

    if (!s->rxint_under_svc) {

        s->txint_under_svc = 1;

        if (s->chn == chn_a) {

            s->rregs[R_INTR] |= INTR_TXINTA;

            if (s->wregs[W_MINTR] & MINTR_STATUSHI)

                s->otherchn->rregs[R_IVEC] = IVEC_HITXINTA;

            else

                s->otherchn->rregs[R_IVEC] = IVEC_LOTXINTA;

        } else {

            s->rregs[R_IVEC] = IVEC_TXINTB;

            s->otherchn->rregs[R_INTR] |= INTR_TXINTB;

        }

    escc_update_irq(s);

    }

}


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

     if (ret) {
+
+        DPRINTF("IO error ret %d\n", ret);

         scsi_command_complete(r, ret);

static void scsi_read_complete(void * opaque, int ret)

{

    SCSIGenericReq *r = (SCSIGenericReq *)opaque;

    int len;

    if (ret) {

        DPRINTF("IO error ret %d\n", ret);

        scsi_command_complete(r, ret);

        return;

    }

    len = r->io_header.dxfer_len - r->io_header.resid;

    DPRINTF("Data ready tag=0x%x len=%d\n", r->req.tag, len);

    r->len = -1;

    r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag, len);

    if (len == 0)

        scsi_command_complete(r, 0);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void qemu_chr_parse_pipe(QemuOpts *opts, ChardevBackend *backend,

                                 Error **errp)
+
+{
+
+    const char *device = qemu_opt_get(opts, "path");
+
     ChardevHostdev *dev;

static void qemu_chr_parse_pipe(QemuOpts *opts, ChardevBackend *backend,

                                Error **errp)

{

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

    ChardevHostdev *dev;

    if (device == NULL) {

        error_setg(errp, "chardev: pipe: no device path given");

        return;

    }

    dev = backend->u.pipe = g_new0(ChardevHostdev, 1);

    qemu_chr_parse_common(opts, qapi_ChardevHostdev_base(dev));

    dev->device = g_strdup(device);

}


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

                         *nmsedec += getnmsedec_sig(t1->data[y][x], bpno + NMSEDEC_FRACBITS);

+                        ff_jpeg2000_set_significance(t1, x, y, t1->flags[y+1][x+1] >> 15);
+
+                    }
+
+                    t1->flags[y+1][x+1] |= JPEG2000_T1_VIS;

                 }

static void encode_sigpass(Jpeg2000T1Context *t1, int width, int height, int bandno, int *nmsedec, int bpno)

{

    int y0, x, y, mask = 1 << (bpno + NMSEDEC_FRACBITS);

    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) && (t1->flags[y+1][x+1] & JPEG2000_T1_SIG_NB)){

                    int ctxno = ff_jpeg2000_getsigctxno(t1->flags[y+1][x+1], bandno),

                        bit = t1->data[y][x] & mask ? 1 : 0;

                    ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, bit);

                    if (bit){

                        int xorbit;

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

                        ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, (t1->flags[y+1][x+1] >> 15) ^ xorbit);

                        *nmsedec += getnmsedec_sig(t1->data[y][x], bpno + NMSEDEC_FRACBITS);

                        ff_jpeg2000_set_significance(t1, x, y, t1->flags[y+1][x+1] >> 15);

                    }

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

                }

            }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void openrisc_cpu_realizefn(DeviceState *dev, Error **errp)
+
 {
+
     OpenRISCCPU *cpu = OPENRISC_CPU(dev);

     OpenRISCCPUClass *occ = OPENRISC_CPU_GET_CLASS(dev);

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

{

    OpenRISCCPU *cpu = OPENRISC_CPU(dev);

    OpenRISCCPUClass *occ = OPENRISC_CPU_GET_CLASS(dev);

    cpu_reset(CPU(cpu));

    occ->parent_realize(dev, errp);

}


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

     if (req->out->sector & req->dev->sector_mask) {
+
+        virtio_blk_rw_complete(req, -EIO);
+
+        return;
+
     }

static void virtio_blk_handle_write(BlockRequest *blkreq, int *num_writes,

    VirtIOBlockReq *req)

{

    if (req->out->sector & req->dev->sector_mask) {

        virtio_blk_rw_complete(req, -EIO);

        return;

    }

    if (*num_writes == 32) {

        do_multiwrite(req->dev->bs, blkreq, *num_writes);

        *num_writes = 0;

    }

    blkreq[*num_writes].sector = req->out->sector;

    blkreq[*num_writes].nb_sectors = req->qiov.size / BDRV_SECTOR_SIZE;

    blkreq[*num_writes].qiov = &req->qiov;

    blkreq[*num_writes].cb = virtio_blk_rw_complete;

    blkreq[*num_writes].opaque = req;

    blkreq[*num_writes].error = 0;

    (*num_writes)++;

}


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

     CFDictionarySetValue( classesToMatch, CFSTR( kIOMediaEjectableKey ), kCFBooleanTrue );

+    }
+
+    kernResult = IOServiceGetMatchingServices( masterPort, classesToMatch, mediaIterator );
+
+    if ( KERN_SUCCESS != kernResult )

     {

kern_return_t FindEjectableCDMedia( io_iterator_t *mediaIterator )

{

    kern_return_t       kernResult;

    mach_port_t     masterPort;

    CFMutableDictionaryRef  classesToMatch;

    kernResult = IOMasterPort( MACH_PORT_NULL, &masterPort );

    if ( KERN_SUCCESS != kernResult ) {

        printf( "IOMasterPort returned %d\n", kernResult );

    }

    classesToMatch = IOServiceMatching( kIOCDMediaClass );

    if ( classesToMatch == NULL ) {

        printf( "IOServiceMatching returned a NULL dictionary.\n" );

    } else {

    CFDictionarySetValue( classesToMatch, CFSTR( kIOMediaEjectableKey ), kCFBooleanTrue );

    }

    kernResult = IOServiceGetMatchingServices( masterPort, classesToMatch, mediaIterator );

    if ( KERN_SUCCESS != kernResult )

    {

        printf( "IOServiceGetMatchingServices returned %d\n", kernResult );

    }

    return kernResult;

}


--- a/source.c
+++ b/source.c
@@ -13,7 +13,7 @@
     rc = spapr_vio_dma_write(&s->vdev, req->crq.s.IU_data_ptr,

                              &req->iu, length);
+
     if (rc) {

         fprintf(stderr, "vscsi_send_iu: DMA write failure !\n");

static int vscsi_send_iu(VSCSIState *s, vscsi_req *req,

                         uint64_t length, uint8_t format)

{

    long rc, rc1;

    /* First copy the SRP */

    rc = spapr_vio_dma_write(&s->vdev, req->crq.s.IU_data_ptr,

                             &req->iu, length);

    if (rc) {

        fprintf(stderr, "vscsi_send_iu: DMA write failure !\n");

    }

    req->crq.s.valid = 0x80;

    req->crq.s.format = format;

    req->crq.s.reserved = 0x00;

    req->crq.s.timeout = cpu_to_be16(0x0000);

    req->crq.s.IU_length = cpu_to_be16(length);

    req->crq.s.IU_data_ptr = req->iu.srp.rsp.tag; /* right byte order */

    if (rc == 0) {

        req->crq.s.status = 0x99; /* Just needs to be non-zero */

    } else {

        req->crq.s.status = 0x00;

    }

    rc1 = spapr_vio_send_crq(&s->vdev, req->crq.raw);

    if (rc1) {

        fprintf(stderr, "vscsi_send_iu: Error sending response\n");

        return rc1;

    }

    return rc;

}


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

     if (oc->oformat->check_bitstream) {

+        int ret = oc->oformat->check_bitstream(oc, pkt);
+
+        if (ret == 1) {
+
+            AVStream *st = s->streams[pkt->stream_index];

             AVStream *ost = oc->streams[pkt->stream_index];

static int seg_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt)

{

    SegmentContext *seg = s->priv_data;

    AVFormatContext *oc = seg->avf;

    if (oc->oformat->check_bitstream) {

        int ret = oc->oformat->check_bitstream(oc, pkt);

        if (ret == 1) {

            AVStream *st = s->streams[pkt->stream_index];

            AVStream *ost = oc->streams[pkt->stream_index];

            st->internal->bsfcs = ost->internal->bsfcs;

            st->internal->nb_bsfcs = ost->internal->nb_bsfcs;

            ost->internal->bsfcs = NULL;

            ost->internal->nb_bsfcs = 0;

        }

        return ret;

    }

    return 1;

}


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

                      qemu_irq *pic, PCIBus **bus2, PCIBus **bus3)
+
 {

     DeviceState *dev;

PCIBus *pci_apb_init(target_phys_addr_t special_base,

                     target_phys_addr_t mem_base,

                     qemu_irq *pic, PCIBus **bus2, PCIBus **bus3)

{

    DeviceState *dev;

    SysBusDevice *s;

    APBState *d;

    /* Ultrasparc PBM main bus */

    dev = qdev_create(NULL, "pbm");

    qdev_init(dev);

    s = sysbus_from_qdev(dev);

    /* apb_config */

    sysbus_mmio_map(s, 0, special_base + 0x2000ULL);

    /* pci_ioport */

    sysbus_mmio_map(s, 1, special_base + 0x2000000ULL);

    /* mem_config: XXX size should be 4G-prom */

    sysbus_mmio_map(s, 2, special_base + 0x1000000ULL);

    /* mem_data */

    sysbus_mmio_map(s, 3, mem_base);

    d = FROM_SYSBUS(APBState, s);

    d->host_state.bus = pci_register_bus(&d->busdev.qdev, "pci",

                                         pci_apb_set_irq, pci_pbm_map_irq, pic,

                                         0, 32);

    pci_create_simple(d->host_state.bus, 0, "pbm");

    /* APB secondary busses */

    *bus2 = pci_bridge_init(d->host_state.bus, 8, PCI_VENDOR_ID_SUN,

                            PCI_DEVICE_ID_SUN_SIMBA, pci_apb_map_irq,

                            "Advanced PCI Bus secondary bridge 1");

    *bus3 = pci_bridge_init(d->host_state.bus, 9, PCI_VENDOR_ID_SUN,

                            PCI_DEVICE_ID_SUN_SIMBA, pci_apb_map_irq,

                            "Advanced PCI Bus secondary bridge 2");

    return d->host_state.bus;

}


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

+    nc = net_hub_find_client_by_name(vlan_id, device);
+
+    if (!nc) {
+
+        error_report("Host network device '%s' on hub '%d' not found",

                      device, vlan_id);

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

{

    NetClientState *nc;

    int vlan_id = qdict_get_int(qdict, "vlan_id");

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

    nc = net_hub_find_client_by_name(vlan_id, device);

    if (!nc) {

        error_report("Host network device '%s' on hub '%d' not found",

                     device, vlan_id);

        return;

    }

    if (!net_host_check_device(nc->model)) {

        error_report("invalid host network device '%s'", device);

        return;

    }

    qemu_del_net_client(nc->peer);

    qemu_del_net_client(nc);

}


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

     max = ARRAY_SIZE(ppc_defs);

+    for (i = 0; i < max; i++) {
+
+        (*cpu_fprintf)(f, "PowerPC %-16s PVR %08x\n",
+
                        ppc_defs[i].name, ppc_defs[i].pvr);

     }

void ppc_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...))

{

    int i, max;

    max = ARRAY_SIZE(ppc_defs);

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

        (*cpu_fprintf)(f, "PowerPC %-16s PVR %08x\n",

                       ppc_defs[i].name, ppc_defs[i].pvr);

    }

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     if(pos >= 0)

         url_fseek(bc, pos, SEEK_SET); //note, this may fail if the stream isnt seekable, but that shouldnt matter, as in this case we simply start where we are currently
+
+
+
+    while(bytes_left(bc)){
+
         state= (state<<8) | get_byte(bc);

         if((state>>56) != 'N')

static uint64_t find_any_startcode(ByteIOContext *bc, int64_t pos){

    uint64_t state=0;

    if(pos >= 0)

        url_fseek(bc, pos, SEEK_SET); //note, this may fail if the stream isnt seekable, but that shouldnt matter, as in this case we simply start where we are currently

    while(bytes_left(bc)){

        state= (state<<8) | get_byte(bc);

        if((state>>56) != 'N')

            continue;

        switch(state){

        case MAIN_STARTCODE:

        case STREAM_STARTCODE:

        case KEYFRAME_STARTCODE:

        case INFO_STARTCODE:

        case INDEX_STARTCODE:

            return state;

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static bool qemu_vmstop_requested(RunState *r)
+
+{
+
+    if (vmstop_requested < RUN_STATE_MAX) {

+        *r = vmstop_requested;

         vmstop_requested = RUN_STATE_MAX;

static bool qemu_vmstop_requested(RunState *r)

{

    if (vmstop_requested < RUN_STATE_MAX) {

        *r = vmstop_requested;

        vmstop_requested = RUN_STATE_MAX;

        return true;

    }

    return false;

}


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

+    fidp = get_fid(pdu, fid);
+
+    if (fidp == NULL) {
+
+        err = -ENOENT;

         goto out_nofid;

static void v9fs_mknod(void *opaque)

{

    int mode;

    gid_t gid;

    int32_t fid;

    V9fsQID qid;

    int err = 0;

    int major, minor;

    size_t offset = 7;

    V9fsString name;

    struct stat stbuf;

    V9fsFidState *fidp;

    V9fsPDU *pdu = opaque;

    V9fsState *s = pdu->s;

    pdu_unmarshal(pdu, offset, "dsdddd", &fid, &name, &mode,

                  &major, &minor, &gid);

    fidp = get_fid(pdu, fid);

    if (fidp == NULL) {

        err = -ENOENT;

        goto out_nofid;

    }

    err = v9fs_co_mknod(pdu, fidp, &name, fidp->uid, gid,

                        makedev(major, minor), mode, &stbuf);

    if (err < 0) {

        goto out;

    }

    stat_to_qid(&stbuf, &qid);

    err = offset;

    err += pdu_marshal(pdu, offset, "Q", &qid);

out:

    put_fid(pdu, fidp);

out_nofid:

    trace_v9fs_mknod_return(pdu->tag, pdu->id, qid.type, qid.version, qid.path);

    complete_pdu(s, pdu, err);

    v9fs_string_free(&name);

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
         uint64_t txaddr;
         /* Check if we are in bound */
         if (taddr >= dev->rtce_window_size) {
+#ifdef DEBUG_TCE
+            fprintf(stderr, "spapr_tce_dma_read out of bounds\n");
+#endif
+            return H_DEST_PARM;
+        tce = dev->rtce_table[taddr >> SPAPR_VIO_TCE_PAGE_SHIFT].tce;
         /* How much til end of page ? */
         lsize = MIN(size, ((~taddr) & SPAPR_VIO_TCE_PAGE_MASK) + 1);
         /* Check TCE */

int spapr_tce_dma_read(VIOsPAPRDevice *dev, uint64_t taddr, void *buf,
                       uint32_t size)
{
#ifdef DEBUG_TCE
    fprintf(stderr, "spapr_tce_dma_write taddr=0x%llx size=0x%x\n",
            (unsigned long long)taddr, size);
#endif
    while (size) {
        uint64_t tce;
        uint32_t lsize;
        uint64_t txaddr;
        /* Check if we are in bound */
        if (taddr >= dev->rtce_window_size) {
#ifdef DEBUG_TCE
            fprintf(stderr, "spapr_tce_dma_read out of bounds\n");
#endif
            return H_DEST_PARM;
        tce = dev->rtce_table[taddr >> SPAPR_VIO_TCE_PAGE_SHIFT].tce;
        /* How much til end of page ? */
        lsize = MIN(size, ((~taddr) & SPAPR_VIO_TCE_PAGE_MASK) + 1);
        /* Check TCE */
        if (!(tce & 1)) {
            return H_DEST_PARM;
        /* Translate */
        txaddr = (tce & ~SPAPR_VIO_TCE_PAGE_MASK) |
            (taddr & SPAPR_VIO_TCE_PAGE_MASK);
#ifdef DEBUG_TCE
        fprintf(stderr, " -> write to txaddr=0x%llx, size=0x%x\n",
                (unsigned long long)txaddr, lsize);
#endif
        /* Do it */
        cpu_physical_memory_read(txaddr, buf, lsize);
        buf += lsize;
        taddr += lsize;
        size -= lsize;
    return H_SUCCESS;


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void bufp_alloc(USBRedirDevice *dev,

     uint8_t *data, int len, int status, uint8_t ep)

static void bufp_alloc(USBRedirDevice *dev,

    uint8_t *data, int len, int status, uint8_t ep)

{

    struct buf_packet *bufp;

    if (!dev->endpoint[EP2I(ep)].bufpq_dropping_packets &&

        dev->endpoint[EP2I(ep)].bufpq_size >

            2 * dev->endpoint[EP2I(ep)].bufpq_target_size) {

        DPRINTF("bufpq overflow, dropping packets ep %02X\n", ep);

        dev->endpoint[EP2I(ep)].bufpq_dropping_packets = 1;

    }

    /* Since we're interupting the stream anyways, drop enough packets to get

       back to our target buffer size */

    if (dev->endpoint[EP2I(ep)].bufpq_dropping_packets) {

        if (dev->endpoint[EP2I(ep)].bufpq_size >

                dev->endpoint[EP2I(ep)].bufpq_target_size) {

            free(data);

            return;

        }

        dev->endpoint[EP2I(ep)].bufpq_dropping_packets = 0;

    }

    bufp = g_malloc(sizeof(struct buf_packet));

    bufp->data   = data;

    bufp->len    = len;

    bufp->status = status;

    QTAILQ_INSERT_TAIL(&dev->endpoint[EP2I(ep)].bufpq, bufp, next);

    dev->endpoint[EP2I(ep)].bufpq_size++;

}


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

     for (lp_cnt = 4; lp_cnt--;) {

+        SD(out0, src);
+
+        SD(out1, src + stride * 4);
+
+        src += stride;

     }

static void intra_predict_mad_cow_dc_l00_8x8_msa(uint8_t *src, int32_t stride)

{

    uint8_t lp_cnt;

    uint32_t src0 = 0;

    uint64_t out0, out1;

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

        src0 += src[lp_cnt * stride - 1];

    }

    src0 = (src0 + 2) >> 2;

    out0 = src0 * 0x0101010101010101;

    out1 = 0x8080808080808080;

    for (lp_cnt = 4; lp_cnt--;) {

        SD(out0, src);

        SD(out1, src + stride * 4);

        src += stride;

    }

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     int stat_all = 0;

     int i;
+
+    int best_score = 0;
+
+
+
     memset(stat, 0, packet_size * sizeof(*stat));

static int analyze(const uint8_t *buf, int size, int packet_size, int *index,

                   int probe)

{

    int stat[TS_MAX_PACKET_SIZE];

    int stat_all = 0;

    int i;

    int best_score = 0;

    memset(stat, 0, packet_size * sizeof(*stat));

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

        if (buf[i] == 0x47 &&

            (!probe || (!(buf[i + 1] & 0x80) && buf[i + 3] != 0x47))) {

            int x = i % packet_size;

            stat[x]++;

            stat_all++;

            if (stat[x] > best_score) {

                best_score = stat[x];

                if (index)

                    *index = x;

            }

        }

    }

    return best_score - FFMAX(stat_all - 10*best_score, 0)/10;

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     QOSState *qs;

     struct tm tm;
+
     uint32_t ns;

     uint64_t ret;

static void test_rtas_get_time_of_day(void)

{

    QOSState *qs;

    struct tm tm;

    uint32_t ns;

    uint64_t ret;

    time_t t1, t2;

    qs = qtest_spapr_boot("-machine pseries");

    g_assert(qs != NULL);

    t1 = time(NULL);

    ret = qrtas_get_time_of_day(qs->alloc, &tm, &ns);

    g_assert_cmpint(ret, ==, 0);

    t2 = mktimegm(&tm);

    g_assert(t2 - t1 < 5); /* 5 sec max to run the test */

    qtest_shutdown(qs);

}


--- a/source.c
+++ b/source.c
@@ -5,5 +5,5 @@
     QObject *obj = qobject_from_json("[32,}");

     fail_unless(obj == NULL);
+
+}

START_TEST(invalid_array_comma)

{

    QObject *obj = qobject_from_json("[32,}");

    fail_unless(obj == NULL);

}


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

     int value;
+
+
+
+    value = get_vlc2(gb, vlc->table, vlc->bits, depth);
+

     /* stage-2, 3 bits exponent escape sequence */

static int qdm2_get_vlc (GetBitContext *gb, VLC *vlc, int flag, int depth)

{

    int value;

    value = get_vlc2(gb, vlc->table, vlc->bits, depth);

    /* stage-2, 3 bits exponent escape sequence */

    if (value-- == 0)

        value = get_bits (gb, get_bits (gb, 3) + 1);

    /* stage-3, optional */

    if (flag) {

        int tmp = vlc_stage3_values[value];

        if ((value & ~3) > 0)

            tmp += get_bits (gb, (value >> 2));

        value = tmp;

    }

    return value;

}


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

     int i;
+
     int8_t dc[6];

static int tgq_decode_mb(TgqContext *s, AVFrame *frame, int mb_y, int mb_x)

{

    int mode;

    int i;

    int8_t dc[6];

    mode = bytestream2_get_byte(&s->gb);

    if (mode > 12) {

        GetBitContext gb;

        init_get_bits8(&gb, s->gb.buffer, FFMIN(bytestream2_get_bytes_left(&s->gb), mode));

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

            tgq_decode_block(s, s->block[i], &gb);

        tgq_idct_put_mb(s, s->block, frame, mb_x, mb_y);

        bytestream2_skip(&s->gb, mode);

    } else {

        if (mode == 3) {

            memset(dc, bytestream2_get_byte(&s->gb), 4);

            dc[4] = bytestream2_get_byte(&s->gb);

            dc[5] = bytestream2_get_byte(&s->gb);

        } else if (mode == 6) {

            bytestream2_get_buffer(&s->gb, dc, 6);

        } else if (mode == 12) {

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

                dc[i] = bytestream2_get_byte(&s->gb);

                bytestream2_skip(&s->gb, 1);

            }

        } else {

            av_log(s->avctx, AV_LOG_ERROR, "unsupported mb mode %i\n", mode);

            return -1;

        }

        tgq_idct_put_mb_dconly(s, frame, mb_x, mb_y, dc);

    }

    return 0;

}


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

 {

+    tcg_gen_st_i32(var, cpu_env, offsetof(CPUState, iwmmxt.cregs[reg]));
+

 }

static inline void iwmmxt_store_creg(int reg, TCGv var)

{

    tcg_gen_st_i32(var, cpu_env, offsetof(CPUState, iwmmxt.cregs[reg]));

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void elcr_ioport_write(void *opaque, target_phys_addr_t addr,
+
+                              uint64_t val, unsigned size)

 {

static void elcr_ioport_write(void *opaque, target_phys_addr_t addr,

                              uint64_t val, unsigned size)

{

    PICCommonState *s = opaque;

    s->elcr = val & s->elcr_mask;

}


int ff_mpv_lowest_referenced_row(MpegEncContext *s, int dir)

{

    int my_max = INT_MIN, my_min = INT_MAX, qpel_shift = !s->quarter_sample;

    int my, off, i, mvs;

    if (s->picture_structure != PICT_FRAME || s->mcsel)

        goto unhandled;

    switch (s->mv_type) {

        case MV_TYPE_16X16:

            mvs = 1;

            break;

        case MV_TYPE_16X8:

            mvs = 2;

            break;

        case MV_TYPE_8X8:

            mvs = 4;

            break;

        default:

            goto unhandled;

    }

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

        my = s->mv[dir][i][1]<<qpel_shift;

        my_max = FFMAX(my_max, my);

        my_min = FFMIN(my_min, my);

    }

    off = (FFMAX(-my_min, my_max) + 63) >> 6;

    return FFMIN(FFMAX(s->mb_y + off, 0), s->mb_height-1);

unhandled:

    return s->mb_height-1;

}


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

         tcg_out_op_t(s, INDEX_op_movi_i64);

+        tcg_out_r(s, t0);
+
+        tcg_out64(s, arg);
+
+#else

         TODO();

static void tcg_out_movi(TCGContext *s, TCGType type,

                         TCGReg t0, tcg_target_long arg)

{

    uint8_t *old_code_ptr = s->code_ptr;

    uint32_t arg32 = arg;

    if (type == TCG_TYPE_I32 || arg == arg32) {

        tcg_out_op_t(s, INDEX_op_movi_i32);

        tcg_out_r(s, t0);

        tcg_out32(s, arg32);

    } else {

        assert(type == TCG_TYPE_I64);

#if TCG_TARGET_REG_BITS == 64

        tcg_out_op_t(s, INDEX_op_movi_i64);

        tcg_out_r(s, t0);

        tcg_out64(s, arg);

#else

        TODO();

#endif

    }

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

}


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

      * to link status bit in mac_reg[STATUS].

+     * Alternatively, restart link negotiation if it was in progress. */
+
+    nc->link_down = (s->mac_reg[STATUS] & E1000_STATUS_LU) == 0;
+
+

     if (s->compat_flags & E1000_FLAG_AUTONEG &&

static int e1000_post_load(void *opaque, int version_id)

{

    E1000State *s = opaque;

    NetClientState *nc = qemu_get_queue(s->nic);

    if (!(s->compat_flags & E1000_FLAG_MIT)) {

        s->mac_reg[ITR] = s->mac_reg[RDTR] = s->mac_reg[RADV] =

            s->mac_reg[TADV] = 0;

        s->mit_irq_level = false;

    }

    s->mit_ide = 0;

    s->mit_timer_on = false;

    /* nc.link_down can't be migrated, so infer link_down according

     * to link status bit in mac_reg[STATUS].

     * Alternatively, restart link negotiation if it was in progress. */

    nc->link_down = (s->mac_reg[STATUS] & E1000_STATUS_LU) == 0;

    if (s->compat_flags & E1000_FLAG_AUTONEG &&

        s->phy_reg[PHY_CTRL] & MII_CR_AUTO_NEG_EN &&

        s->phy_reg[PHY_CTRL] & MII_CR_RESTART_AUTO_NEG &&

        !(s->phy_reg[PHY_STATUS] & MII_SR_AUTONEG_COMPLETE)) {

        nc->link_down = false;

        timer_mod(s->autoneg_timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 500);

    }

    return 0;

}


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

                     /* invalidate code */

+                    tb_invalidate_phys_page_range(addr1, addr1 + l, 0);
+
+                    /* set dirty bit */
+
+                    phys_ram_dirty[addr1 >> TARGET_PAGE_BITS] |=

                         (0xff & ~CODE_DIRTY_FLAG);

void cpu_physical_memory_unmap(void *buffer, target_phys_addr_t len,

                               int is_write, target_phys_addr_t access_len)

{

    if (buffer != bounce.buffer) {

        if (is_write) {

            unsigned long addr1 = (uint8_t *)buffer - phys_ram_base;

            while (access_len) {

                unsigned l;

                l = TARGET_PAGE_SIZE;

                if (l > access_len)

                    l = access_len;

                if (!cpu_physical_memory_is_dirty(addr1)) {

                    /* invalidate code */

                    tb_invalidate_phys_page_range(addr1, addr1 + l, 0);

                    /* set dirty bit */

                    phys_ram_dirty[addr1 >> TARGET_PAGE_BITS] |=

                        (0xff & ~CODE_DIRTY_FLAG);

                }

                addr1 += l;

                access_len -= l;

            }

        }

        return;

    }

    if (is_write) {

        cpu_physical_memory_write(bounce.addr, bounce.buffer, access_len);

    }

    qemu_free(bounce.buffer);

    bounce.buffer = NULL;

}


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

     spin_lock(&global_cpu_lock);

void helper_lock(void)

{

    spin_lock(&global_cpu_lock);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static int applehttp_close(URLContext *h)
+
+{
+
+    AppleHTTPContext *s = h->priv_data;
+
+

     free_segment_list(s);

static int applehttp_close(URLContext *h)

{

    AppleHTTPContext *s = h->priv_data;

    free_segment_list(s);

    free_variant_list(s);

    ffurl_close(s->seg_hd);

    av_free(s);

    return 0;

}


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

     int bits = qdict_get_try_int(qdict, "bits", -1);

+    int has_channels = qdict_haskey(qdict, "nchannels");

     int nchannels = qdict_get_try_int(qdict, "nchannels", -1);

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

{

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

    int has_freq = qdict_haskey(qdict, "freq");

    int freq = qdict_get_try_int(qdict, "freq", -1);

    int has_bits = qdict_haskey(qdict, "bits");

    int bits = qdict_get_try_int(qdict, "bits", -1);

    int has_channels = qdict_haskey(qdict, "nchannels");

    int nchannels = qdict_get_try_int(qdict, "nchannels", -1);

    CaptureState *s;

    s = qemu_mallocz (sizeof (*s));

    freq = has_freq ? freq : 44100;

    bits = has_bits ? bits : 16;

    nchannels = has_channels ? nchannels : 2;

    if (wav_start_capture (s, path, freq, bits, nchannels)) {

        monitor_printf(mon, "Faied to add wave capture\n");

        qemu_free (s);

    }

    QLIST_INSERT_HEAD (&capture_head, s, entries);

}


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

 {

+    AVFilterContext *avctx = inlink->dst;

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

static AVFrame *hwmap_get_buffer(AVFilterLink *inlink, int w, int h)

{

    AVFilterContext *avctx = inlink->dst;

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

    HWMapContext      *ctx = avctx->priv;

    if (ctx->map_backwards) {

        AVFrame *src, *dst;

        int err;

        src = ff_get_video_buffer(outlink, w, h);

        if (!src) {

            av_log(avctx, AV_LOG_ERROR, "Failed to allocate source "

                   "frame for software mapping.\n");

            return NULL;

        }

        dst = av_frame_alloc();

        if (!dst) {

            av_frame_free(&src);

            return NULL;

        }

        err = av_hwframe_map(dst, src, ctx->mode);

        if (err) {

            av_log(avctx, AV_LOG_ERROR, "Failed to map frame to "

                   "software: %d.\n", err);

            av_frame_free(&src);

            av_frame_free(&dst);

            return NULL;

        }

        av_frame_free(&src);

        return dst;

    } else {

        return ff_default_get_video_buffer(inlink, w, h);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void test_visitor_in_uint(TestInputVisitorData *data,
+
                                 const void *unused)

 {
@@ -16,8 +16,8 @@

     Visitor *v;

+
+
     v = visitor_input_test_init(data, "%d", value);

static void test_visitor_in_uint(TestInputVisitorData *data,

                                const void *unused)

{

    Error *err = NULL;

    uint64_t res = 0;

    int64_t i64;

    double dbl;

    int value = 42;

    Visitor *v;

    v = visitor_input_test_init(data, "%d", value);

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

    g_assert_cmpuint(res, ==, (uint64_t)value);

    visit_type_int(v, NULL, &i64, &error_abort);

    g_assert_cmpint(i64, ==, value);

    visit_type_number(v, NULL, &dbl, &error_abort);

    g_assert_cmpfloat(dbl, ==, value);

    /* BUG: value between INT64_MIN and -1 accepted modulo 2^64 */

    v = visitor_input_test_init(data, "%d", -value);

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

    g_assert_cmpuint(res, ==, (uint64_t)-value);

    /* BUG: value between INT64_MAX+1 and UINT64_MAX rejected */

    v = visitor_input_test_init(data, "18446744073709551574");

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

    error_free_or_abort(&err);

    visit_type_number(v, NULL, &dbl, &error_abort);

    g_assert_cmpfloat(dbl, ==, 18446744073709552000.0);

}


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

     CPUBreakpoint *bp;
+

     if (env->watchpoint_hit) {

         if (env->watchpoint_hit->flags & BP_CPU) {
+
             env->watchpoint_hit = NULL;

             if (check_hw_breakpoints(env, 0))

void breakpoint_handler(CPUX86State *env)

{

    CPUBreakpoint *bp;

    if (env->watchpoint_hit) {

        if (env->watchpoint_hit->flags & BP_CPU) {

            env->watchpoint_hit = NULL;

            if (check_hw_breakpoints(env, 0))

                raise_exception(env, EXCP01_DB);

            else

                cpu_resume_from_signal(env, NULL);

        }

    } else {

        QTAILQ_FOREACH(bp, &env->breakpoints, entry)

            if (bp->pc == env->eip) {

                if (bp->flags & BP_CPU) {

                    check_hw_breakpoints(env, 1);

                    raise_exception(env, EXCP01_DB);

                }

                break;

            }

    }

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
         error_setg(errp, "NBD server address missing");

         goto done;
+
+    }
+
+
+
     crumpled_addr = qdict_crumple(addr, errp);

     if (!crumpled_addr) {

static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options, Error **errp)

{

    SocketAddress *saddr = NULL;

    QDict *addr = NULL;

    QObject *crumpled_addr = NULL;

    Visitor *iv = NULL;

    Error *local_err = NULL;

    qdict_extract_subqdict(options, &addr, "server.");

    if (!qdict_size(addr)) {

        error_setg(errp, "NBD server address missing");

        goto done;

    }

    crumpled_addr = qdict_crumple(addr, errp);

    if (!crumpled_addr) {

        goto done;

    }

    iv = qobject_input_visitor_new(crumpled_addr);

    visit_type_SocketAddress(iv, NULL, &saddr, &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        goto done;

    }

done:

    QDECREF(addr);

    qobject_decref(crumpled_addr);

    visit_free(iv);

    return saddr;

}


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

         if (bs_table[i])

+            bdrv_commit(bs_table[i]);
+
+    }
+
 }

static void do_commit(void)

{

    int i;

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

        if (bs_table[i])

            bdrv_commit(bs_table[i]);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void virtio_ccw_device_plugged(DeviceState *d)

 {

static void virtio_ccw_device_plugged(DeviceState *d)

{

    VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d);

    SubchDev *sch = dev->sch;

    sch->id.cu_model = virtio_bus_get_vdev_id(&dev->bus);

    css_generate_sch_crws(sch->cssid, sch->ssid, sch->schid,

                          d->hotplugged, 1);

}


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

     if (s->blocker) {

+        blk_op_unblock_all(s->conf->conf.blk, s->blocker);
+
+        error_free(s->blocker);

         s->blocker = NULL;

static void data_plane_remove_op_blockers(VirtIOBlockDataPlane *s)

{

    if (s->blocker) {

        blk_op_unblock_all(s->conf->conf.blk, s->blocker);

        error_free(s->blocker);

        s->blocker = NULL;

    }

}


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

     int err;

+    AVDictionary *opts;

     AVFormatContext *ic;

int av_open_input_stream(AVFormatContext **ic_ptr,

                         AVIOContext *pb, const char *filename,

                         AVInputFormat *fmt, AVFormatParameters *ap)

{

    int err;

    AVDictionary *opts;

    AVFormatContext *ic;

    AVFormatParameters default_ap;

    if(!ap){

        ap=&default_ap;

        memset(ap, 0, sizeof(default_ap));

    }

    opts = convert_format_parameters(ap);

    if(!ap->prealloced_context)

        ic = avformat_alloc_context();

    else

        ic = *ic_ptr;

    if (!ic) {

        err = AVERROR(ENOMEM);

        goto fail;

    }

    if (pb && fmt && fmt->flags & AVFMT_NOFILE)

        av_log(ic, AV_LOG_WARNING, "Custom AVIOContext makes no sense and "

                                   "will be ignored with AVFMT_NOFILE format.\n");

    else

        ic->pb = pb;

    err = avformat_open_input(&ic, filename, fmt, &opts);

    ic->pb = ic->pb ? ic->pb : pb; // don't leak custom pb if it wasn't set above

    *ic_ptr = ic;

fail:

    av_dict_free(&opts);

    return err;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 bool bdrv_qiov_is_aligned(BlockDriverState *bs, QEMUIOVector *qiov)

 {
+
     int i;

+

     for (i = 0; i < qiov->niov; i++) {

bool bdrv_qiov_is_aligned(BlockDriverState *bs, QEMUIOVector *qiov)

{

    int i;

    for (i = 0; i < qiov->niov; i++) {

        if ((uintptr_t) qiov->iov[i].iov_base % bs->buffer_alignment) {

            return false;

        }

        if (qiov->iov[i].iov_len % bs->buffer_alignment) {

            return false;

        }

    }

    return true;

}


--- a/source.c
+++ b/source.c
@@ -41,11 +41,11 @@
     trace_exec_tb_nocache(tb, tb->pc);

     cpu_tb_exec(cpu, tb->tc_ptr);
+
+    cpu->current_tb = NULL;
+
+    tb_phys_invalidate(tb, -1);
+
     tb_free(tb);

 }

static void cpu_exec_nocache(CPUArchState *env, int max_cycles,

                             TranslationBlock *orig_tb)

{

    CPUState *cpu = ENV_GET_CPU(env);

    TranslationBlock *tb;

    target_ulong pc = orig_tb->pc;

    target_ulong cs_base = orig_tb->cs_base;

    uint64_t flags = orig_tb->flags;

    /* Should never happen.

       We only end up here when an existing TB is too long.  */

    if (max_cycles > CF_COUNT_MASK)

        max_cycles = CF_COUNT_MASK;

    /* tb_gen_code can flush our orig_tb, invalidate it now */

    tb_phys_invalidate(orig_tb, -1);

    tb = tb_gen_code(cpu, pc, cs_base, flags,

                     max_cycles);

    cpu->current_tb = tb;

    /* execute the generated code */

    trace_exec_tb_nocache(tb, tb->pc);

    cpu_tb_exec(cpu, tb->tc_ptr);

    cpu->current_tb = NULL;

    tb_phys_invalidate(tb, -1);

    tb_free(tb);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 target_ulong spapr_rtas_call(PowerPCCPU *cpu, sPAPREnvironment *spapr,
+
+                             uint32_t token, uint32_t nargs, target_ulong args,

                              uint32_t nret, target_ulong rets)

target_ulong spapr_rtas_call(PowerPCCPU *cpu, sPAPREnvironment *spapr,

                             uint32_t token, uint32_t nargs, target_ulong args,

                             uint32_t nret, target_ulong rets)

{

    if ((token >= TOKEN_BASE)

        && ((token - TOKEN_BASE) < TOKEN_MAX)) {

        struct rtas_call *call = rtas_table + (token - TOKEN_BASE);

        if (call->fn) {

            call->fn(cpu, spapr, token, nargs, args, nret, rets);

            return H_SUCCESS;

        }

    }

    /* HACK: Some Linux early debug code uses RTAS display-character,

     * but assumes the token value is 0xa (which it is on some real

     * machines) without looking it up in the device tree.  This

     * special case makes this work */

    if (token == 0xa) {

        rtas_display_character(cpu, spapr, 0xa, nargs, args, nret, rets);

        return H_SUCCESS;

    }

    hcall_dprintf("Unknown RTAS token 0x%x\n", token);

    rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR);

    return H_PARAMETER;

}


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

     MemoryRegionIORange *mrio

+        = container_of(iorange, MemoryRegionIORange, iorange);
+
+    MemoryRegion *mr = mrio->mr;
+
+

     offset += mrio->offset;

static void memory_region_iorange_write(IORange *iorange,

                                        uint64_t offset,

                                        unsigned width,

                                        uint64_t data)

{

    MemoryRegionIORange *mrio

        = container_of(iorange, MemoryRegionIORange, iorange);

    MemoryRegion *mr = mrio->mr;

    offset += mrio->offset;

    if (mr->ops->old_portio) {

        const MemoryRegionPortio *mrp = find_portio(mr, offset - mrio->offset,

                                                    width, true);

        if (mrp) {

            mrp->write(mr->opaque, offset, data);

        } else if (width == 2) {

            mrp = find_portio(mr, offset - mrio->offset, 1, true);

            assert(mrp);

            mrp->write(mr->opaque, offset, data & 0xff);

            mrp->write(mr->opaque, offset + 1, data >> 8);

        }

        return;

    }

    access_with_adjusted_size(offset, &data, width,

                              mr->ops->impl.min_access_size,

                              mr->ops->impl.max_access_size,

                              memory_region_write_accessor, mr);

}


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

     /* Map AHCI's ABAR (BAR5) */

+    *hba_base = qpci_iomap(ahci, 5, NULL);
+
+
+
     /* turns on pci.cmd.iose, pci.cmd.mse and pci.cmd.bme */

     qpci_device_enable(ahci);

static QPCIDevice *start_ahci_device(QPCIDevice *ahci, void **hba_base)

{

    /* Map AHCI's ABAR (BAR5) */

    *hba_base = qpci_iomap(ahci, 5, NULL);

    /* turns on pci.cmd.iose, pci.cmd.mse and pci.cmd.bme */

    qpci_device_enable(ahci);

    return ahci;

}


--- a/source.c
+++ b/source.c
@@ -26,10 +26,10 @@
      * Objects using the same ID (which can happen in cases where
      * qemu_opts_parse() is used to parse the object params, such as
      * with hmp_object_add() at the time of this comment), we need to
+     * check for this in user_creatable_del() and remove the QemuOpts if
+     * it is present.
+     *
+     * The below check ensures this works as expected.
+     */
     g_assert_null(qemu_opts_find(&qemu_object_opts, "dev0"));
 }

static void test_dummy_createcmdl(void)
{
    QemuOpts *opts;
    DummyObject *dobj;
    Error *err = NULL;
    const char *params = TYPE_DUMMY \
                         ",id=dev0," \
                         "bv=yes,sv=Hiss hiss hiss,av=platypus";
    qemu_add_opts(&qemu_object_opts);
    opts = qemu_opts_parse(&qemu_object_opts, params, true, &err);
    g_assert(err == NULL);
    g_assert(opts);
    dobj = DUMMY_OBJECT(user_creatable_add_opts(opts, &err));
    g_assert(err == NULL);
    g_assert(dobj);
    g_assert_cmpstr(dobj->sv, ==, "Hiss hiss hiss");
    g_assert(dobj->bv == true);
    g_assert(dobj->av == DUMMY_PLATYPUS);
    user_creatable_del("dev0", &err);
    g_assert(err == NULL);
    error_free(err);
    /*
     * cmdline-parsing via qemu_opts_parse() results in a QemuOpts entry
     * corresponding to the Object's ID to be added to the QemuOptsList
     * for objects. To avoid having this entry conflict with future
     * Objects using the same ID (which can happen in cases where
     * qemu_opts_parse() is used to parse the object params, such as
     * with hmp_object_add() at the time of this comment), we need to
     * check for this in user_creatable_del() and remove the QemuOpts if
     * it is present.
     *
     * The below check ensures this works as expected.
     */
    g_assert_null(qemu_opts_find(&qemu_object_opts, "dev0"));
}


--- a/source.c
+++ b/source.c
@@ -59,11 +59,11 @@
                  SCSW_ACTL_SUSP);

     sch->channel_prog = 0x0;
+
+    sch->last_cmd_valid = false;
+
+    s->dstat = 0;
+
     s->cstat = 0;

     ret = 0;

int css_do_xsch(SubchDev *sch)

{

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

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

    int ret;

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

        ret = -ENODEV;

        goto out;

    }

    if (!(s->ctrl & SCSW_CTRL_MASK_FCTL) ||

        ((s->ctrl & SCSW_CTRL_MASK_FCTL) != SCSW_FCTL_START_FUNC) ||

        (!(s->ctrl &

           (SCSW_ACTL_RESUME_PEND | SCSW_ACTL_START_PEND | SCSW_ACTL_SUSP))) ||

        (s->ctrl & SCSW_ACTL_SUBCH_ACTIVE)) {

        ret = -EINPROGRESS;

        goto out;

    }

    if (s->ctrl & SCSW_CTRL_MASK_STCTL) {

        ret = -EBUSY;

        goto out;

    }

    /* Cancel the current operation. */

    s->ctrl &= ~(SCSW_FCTL_START_FUNC |

                 SCSW_ACTL_RESUME_PEND |

                 SCSW_ACTL_START_PEND |

                 SCSW_ACTL_SUSP);

    sch->channel_prog = 0x0;

    sch->last_cmd_valid = false;

    s->dstat = 0;

    s->cstat = 0;

    ret = 0;

out:

    return ret;

}


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

     if (!PPC_ALTIVEC(av_get_cpu_flags()))

+        return;
+
+
+
     c->add_bytes = add_bytes_altivec;

 #endif /* HAVE_ALTIVEC && HAVE_BIGENDIAN */

av_cold void ff_huffyuvdsp_init_ppc(HuffYUVDSPContext *c)

{

#if HAVE_ALTIVEC && HAVE_BIGENDIAN

    if (!PPC_ALTIVEC(av_get_cpu_flags()))

        return;

    c->add_bytes = add_bytes_altivec;

#endif /* HAVE_ALTIVEC && HAVE_BIGENDIAN */

}


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

     /* if the line ends with a space, it means we want to complete the

+       next arg */
+
+    len = strlen(cmdline);
+
+    if (len > 0 && qemu_isspace(cmdline[len - 1])) {

         if (nb_args >= MAX_ARGS) {

static void monitor_find_completion(Monitor *mon,

                                    const char *cmdline)

{

    char *args[MAX_ARGS];

    int nb_args, len;

    /* 1. parse the cmdline */

    if (parse_cmdline(cmdline, &nb_args, args) < 0) {

        return;

    }

#ifdef DEBUG_COMPLETION

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

        monitor_printf(mon, "arg%d = '%s'\n", i, args[i]);

    }

#endif

    /* if the line ends with a space, it means we want to complete the

       next arg */

    len = strlen(cmdline);

    if (len > 0 && qemu_isspace(cmdline[len - 1])) {

        if (nb_args >= MAX_ARGS) {

            goto cleanup;

        }

        args[nb_args++] = g_strdup("");

    }

    /* 2. auto complete according to args */

    monitor_find_completion_by_table(mon, mon->cmd_table, args, nb_args);

cleanup:

    free_cmdline_args(args, nb_args);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 QInt *qobject_to_qint(const QObject *obj)
+
 {

     if (qobject_type(obj) != QTYPE_QINT)

QInt *qobject_to_qint(const QObject *obj)

{

    if (qobject_type(obj) != QTYPE_QINT)

        return NULL;

    return container_of(obj, QInt, base);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+pcie_cap_v1_fill(uint8_t *exp_cap, uint8_t port, uint8_t type, uint8_t version)

 {

+    /* capability register

     interrupt message number defaults to 0 */

pcie_cap_v1_fill(uint8_t *exp_cap, uint8_t port, uint8_t type, uint8_t version)

{

    /* capability register

    interrupt message number defaults to 0 */

    pci_set_word(exp_cap + PCI_EXP_FLAGS,

                 ((type << PCI_EXP_FLAGS_TYPE_SHIFT) & PCI_EXP_FLAGS_TYPE) |

                 version);

    /* device capability register

     * table 7-12:

     * roll based error reporting bit must be set by all

     * Functions conforming to the ECN, PCI Express Base

     * Specification, Revision 1.1., or subsequent PCI Express Base

     * Specification revisions.

     */

    pci_set_long(exp_cap + PCI_EXP_DEVCAP, PCI_EXP_DEVCAP_RBER);

    pci_set_long(exp_cap + PCI_EXP_LNKCAP,

                 (port << PCI_EXP_LNKCAP_PN_SHIFT) |

                 PCI_EXP_LNKCAP_ASPMS_0S |

                 PCI_EXP_LNK_MLW_1 |

                 PCI_EXP_LNK_LS_25);

    pci_set_word(exp_cap + PCI_EXP_LNKSTA,

                 PCI_EXP_LNK_MLW_1 | PCI_EXP_LNK_LS_25 |PCI_EXP_LNKSTA_DLLLA);

}


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

+{

     uint8_t ret;

static void test_read_without_media(void)

{

    uint8_t ret;

    ret = send_read_command();

    g_assert(ret == 0);

}


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

     int l1, l2;

+    TCGv tmp;
+
+
+
+    l1 = gen_new_label();

     l2 = gen_new_label();

static always_inline void gen_fbcond (DisasContext *ctx,

                                      void* func,

                                      int ra, int32_t disp16)

{

    int l1, l2;

    TCGv tmp;

    l1 = gen_new_label();

    l2 = gen_new_label();

    if (ra != 31) {

        tmp = tcg_temp_new(TCG_TYPE_I64);

        tcg_gen_helper_1_1(func, tmp, cpu_fir[ra]);

    } else  {

        tmp = tcg_const_i64(0);

        tcg_gen_helper_1_1(func, tmp, tmp);

    }

    tcg_gen_brcondi_i64(TCG_COND_NE, tmp, 0, l1);

    tcg_gen_movi_i64(cpu_pc, ctx->pc);

    tcg_gen_br(l2);

    gen_set_label(l1);

    tcg_gen_movi_i64(cpu_pc, ctx->pc + (int64_t)(disp16 << 2));

    gen_set_label(l2);

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
+pci_ebus_init1(PCIDevice *s)
+
 {
+
     isa_bus_new(&s->qdev);

+    s->config[0x04] = 0x06; // command = bus master, pci mem
+
     s->config[0x05] = 0x00;

     s->config[0x06] = 0xa0; // status = fast back-to-back, 66MHz, no error

pci_ebus_init1(PCIDevice *s)

{

    isa_bus_new(&s->qdev);

    s->config[0x04] = 0x06; // command = bus master, pci mem

    s->config[0x05] = 0x00;

    s->config[0x06] = 0xa0; // status = fast back-to-back, 66MHz, no error

    s->config[0x07] = 0x03; // status = medium devsel

    s->config[0x09] = 0x00; // programming i/f

    s->config[0x0D] = 0x0a; // latency_timer

    pci_register_bar(s, 0, 0x1000000, PCI_BASE_ADDRESS_SPACE_MEMORY,

                           ebus_mmio_mapfunc);

    pci_register_bar(s, 1, 0x800000,  PCI_BASE_ADDRESS_SPACE_MEMORY,

                           ebus_mmio_mapfunc);

    return 0;

}


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

     /* note: we need to modify the packet size here to handle the last

+       packet */
+
+    pkt->size = ret;
+
+    return 0;

 }

static int sol_read_packet(AVFormatContext *s,

                          AVPacket *pkt)

{

    int ret;

    if (s->pb->eof_reached)

        return AVERROR(EIO);

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

    pkt->stream_index = 0;

    /* note: we need to modify the packet size here to handle the last

       packet */

    pkt->size = ret;

    return 0;

}


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

+{
+
+    AHCIQState *ahci;
+
     ahci = ahci_boot();

static AHCIQState *ahci_boot_and_enable(void)

{

    AHCIQState *ahci;

    ahci = ahci_boot();

    ahci_pci_enable(ahci);

    ahci_hba_enable(ahci);

    return ahci;

}


static void subband_scale(int *dst, int *src, int scale, int offset, int len)

{

    int ssign = scale < 0 ? -1 : 1;

    int s = FFABS(scale);

    unsigned int round;

    int i, out, c = exp2tab[s & 3];

    s = offset - (s >> 2);

    if (s > 31) {

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

            dst[i] = 0;

        }

    } else if (s > 0) {

        round = 1 << (s-1);

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

            out = (int)(((int64_t)src[i] * c) >> 32);

            dst[i] = ((int)(out+round) >> s) * ssign;

        }

    }

    else {

        s = s + 32;

        round = 1U << (s-1);

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

            out = (int)((int64_t)((int64_t)src[i] * c + round) >> s);

            dst[i] = out * ssign;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int32_t ide_nop_int32(IDEDMA *dma, int x)

 {

static int32_t ide_nop_int32(IDEDMA *dma, int x)

{

    return 0;

}


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

     tcet->bypass = false;
+
+    memset(tcet->table, 0, table_size);
+
 }

static void spapr_tce_reset(DeviceState *dev)

{

    sPAPRTCETable *tcet = SPAPR_TCE_TABLE(dev);

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

    tcet->bypass = false;

    memset(tcet->table, 0, table_size);

}


--- a/source.c
+++ b/source.c
@@ -1,17 +1,17 @@
 QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head,
+
                                   const GraphicHwOps *hw_ops,

                                   void *opaque)

 {

+    Error *local_err = NULL;

     int width = 640;

+    int height = 480;
+
     QemuConsole *s;

     DisplayState *ds;

QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head,

                                  const GraphicHwOps *hw_ops,

                                  void *opaque)

{

    Error *local_err = NULL;

    int width = 640;

    int height = 480;

    QemuConsole *s;

    DisplayState *ds;

    ds = get_alloc_displaystate();

    trace_console_gfx_new();

    s = new_console(ds, GRAPHIC_CONSOLE);

    s->hw_ops = hw_ops;

    s->hw = opaque;

    if (dev) {

        object_property_set_link(OBJECT(s), OBJECT(dev),

                                 "device", &local_err);

        object_property_set_int(OBJECT(s), head,

                                "head", &local_err);

    }

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

    return s;

}


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

     int ret;

+
+
+    *frame_size_ptr= 0;
+
+    ret = avctx->codec->decode(avctx, samples, frame_size_ptr,

                                buf, buf_size);

int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,

                         int *frame_size_ptr,

                         uint8_t *buf, int buf_size)

{

    int ret;

    *frame_size_ptr= 0;

    ret = avctx->codec->decode(avctx, samples, frame_size_ptr,

                               buf, buf_size);

    avctx->frame_number++;

    return ret;

}


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

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

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

         exit(1);
+
     }

     if (*size < new_size) {

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

{

    if (new_size >= INT_MAX / elem_size) {

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

        exit(1);

    }

    if (*size < new_size) {

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

        if (!tmp) {

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

            exit(1);

        }

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

        *size = new_size;

        return tmp;

    }

    return array;

}


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

+{

     MicroDriveState *md = MICRODRIVE(dev);

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

{

    MicroDriveState *md = MICRODRIVE(dev);

    ide_init2(&md->bus, qemu_allocate_irqs(md_set_irq, md, 1)[0]);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void gen_neon_dup_low16(TCGv var)
+
 {

     TCGv tmp = new_tmp();
+
     tcg_gen_ext16u_i32(var, var);

     tcg_gen_shli_i32(tmp, var, 16);

static void gen_neon_dup_low16(TCGv var)

{

    TCGv tmp = new_tmp();

    tcg_gen_ext16u_i32(var, var);

    tcg_gen_shli_i32(tmp, var, 16);

    tcg_gen_or_i32(var, var, tmp);

    dead_tmp(tmp);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void usb_serial_read(void *opaque, const uint8_t *buf, int size)

+{
+
+    USBSerialState *s = opaque;
+
     int first_size = RECV_BUF - s->recv_ptr;

     if (first_size > size)

static void usb_serial_read(void *opaque, const uint8_t *buf, int size)

{

    USBSerialState *s = opaque;

    int first_size = RECV_BUF - s->recv_ptr;

    if (first_size > size)

        first_size = size;

    memcpy(s->recv_buf + s->recv_ptr + s->recv_used, buf, first_size);

    if (size > first_size)

        memcpy(s->recv_buf, buf + first_size, size - first_size);

    s->recv_used += size;

}


--- a/source.c
+++ b/source.c
@@ -61,9 +61,9 @@
     DPRINTF("cfgaddr %x pciaddr %x busno %x devno %d funno %d regno %d\n",

         cfgaddr, pciaddr, pci_bus_num(phb->bus), devno, funno, regno);
+
+
+
+    return pciaddr;
+
 }

static uint32_t bonito_sbridge_pciaddr(void *opaque, hwaddr addr)

{

    PCIBonitoState *s = opaque;

    PCIHostState *phb = PCI_HOST_BRIDGE(s->pcihost);

    uint32_t cfgaddr;

    uint32_t idsel;

    uint32_t devno;

    uint32_t funno;

    uint32_t regno;

    uint32_t pciaddr;

    /* support type0 pci config */

    if ((s->regs[BONITO_PCIMAP_CFG] & 0x10000) != 0x0) {

        return 0xffffffff;

    }

    cfgaddr = addr & 0xffff;

    cfgaddr |= (s->regs[BONITO_PCIMAP_CFG] & 0xffff) << 16;

    idsel = (cfgaddr & BONITO_PCICONF_IDSEL_MASK) >> BONITO_PCICONF_IDSEL_OFFSET;

    devno = ffs(idsel) - 1;

    funno = (cfgaddr & BONITO_PCICONF_FUN_MASK) >> BONITO_PCICONF_FUN_OFFSET;

    regno = (cfgaddr & BONITO_PCICONF_REG_MASK) >> BONITO_PCICONF_REG_OFFSET;

    if (idsel == 0) {

        fprintf(stderr, "error in bonito pci config address " TARGET_FMT_plx

            ",pcimap_cfg=%x\n", addr, s->regs[BONITO_PCIMAP_CFG]);

        exit(1);

    }

    pciaddr = PCI_ADDR(pci_bus_num(phb->bus), devno, funno, regno);

    DPRINTF("cfgaddr %x pciaddr %x busno %x devno %d funno %d regno %d\n",

        cfgaddr, pciaddr, pci_bus_num(phb->bus), devno, funno, regno);

    return pciaddr;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static inline void RENAME(uyvyToY)(uint8_t *dst, uint8_t *src, int width)
+
 {

 #ifdef HAVE_MMX

static inline void RENAME(uyvyToY)(uint8_t *dst, uint8_t *src, int width)

{

#ifdef HAVE_MMX

	asm volatile(

		"mov %0, %%"REG_a"		\n\t"

		"1:				\n\t"

		"movq (%1, %%"REG_a",2), %%mm0	\n\t"

		"movq 8(%1, %%"REG_a",2), %%mm1	\n\t"

		"psrlw $8, %%mm0		\n\t"

		"psrlw $8, %%mm1		\n\t"

		"packuswb %%mm1, %%mm0		\n\t"

		"movq %%mm0, (%2, %%"REG_a")	\n\t"

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

		" js 1b				\n\t"

		: : "g" ((long)-width), "r" (src+width*2), "r" (dst+width)

		: "%"REG_a

	);

#else

	int i;

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

		dst[i]= src[2*i+1];

#endif

}


--- a/source.c
+++ b/source.c
@@ -19,15 +19,15 @@
     if (!data)

         return AVERROR(ENOMEM);
+
+    memcpy(data, avctx->extradata, avctx->extradata_size);

     data[avctx->extradata_size] = '\0';

     cur = data;

+
     while (*cur) {

         if (strncmp("palette:", cur, 8) == 0) {

static av_cold int dvdsub_init(AVCodecContext *avctx)

{

    DVDSubContext *ctx = avctx->priv_data;

    char *data, *cur;

    if (!avctx->extradata || !avctx->extradata_size)

        return 0;

    data = av_malloc(avctx->extradata_size + 1);

    if (!data)

        return AVERROR(ENOMEM);

    memcpy(data, avctx->extradata, avctx->extradata_size);

    data[avctx->extradata_size] = '\0';

    cur = data;

    while (*cur) {

        if (strncmp("palette:", cur, 8) == 0) {

            int i;

            char *p = cur + 8;

            ctx->has_palette = 1;

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

                ctx->palette[i] = strtoul(p, &p, 16);

                while (*p == ',' || av_isspace(*p))

                    p++;

            }

        } else if (!strncmp("size:", cur, 5)) {

            int w, h;

            if (sscanf(cur + 5, "%dx%d", &w, &h) == 2) {

               int ret = ff_set_dimensions(avctx, w, h);

               if (ret < 0)

                   return ret;

            }

        }

        cur += strcspn(cur, "\n\r");

        cur += strspn(cur, "\n\r");

    }

    av_free(data);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     VncServerInfo *info;

     Error *err = NULL;
+
+
+
+    info = g_malloc(sizeof(*info));
+
     info->base = g_malloc(sizeof(*info->base));

     vnc_init_basic_info_from_server_addr(vd->lsock, info->base, &err);

static VncServerInfo *vnc_server_info_get(VncDisplay *vd)

{

    VncServerInfo *info;

    Error *err = NULL;

    info = g_malloc(sizeof(*info));

    info->base = g_malloc(sizeof(*info->base));

    vnc_init_basic_info_from_server_addr(vd->lsock, info->base, &err);

    info->has_auth = true;

    info->auth = g_strdup(vnc_auth_name(vd));

    if (err) {

        qapi_free_VncServerInfo(info);

        info = NULL;

        error_free(err);

    }

    return info;

}


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

     gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

 #else

+    TCGv t0;

     if (unlikely(ctx->pr)) {

static void gen_mfsr_64b(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

#else

    TCGv t0;

    if (unlikely(ctx->pr)) {

        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

        return;

    }

    t0 = tcg_const_tl(SR(ctx->opcode));

    gen_helper_load_sr(cpu_gpr[rD(ctx->opcode)], cpu_env, t0);

    tcg_temp_free(t0);

#endif

}


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

     }

+
+
+    nb_fds++;
+
+    nbd_update_server_watch();

     nbd_client_new(newproto ? NULL : exp, cioc,

static gboolean nbd_accept(QIOChannel *ioc, GIOCondition cond, gpointer opaque)

{

    QIOChannelSocket *cioc;

    cioc = qio_channel_socket_accept(QIO_CHANNEL_SOCKET(ioc),

                                     NULL);

    if (!cioc) {

        return TRUE;

    }

    if (state >= TERMINATE) {

        object_unref(OBJECT(cioc));

        return TRUE;

    }

    nb_fds++;

    nbd_update_server_watch();

    nbd_client_new(newproto ? NULL : exp, cioc,

                   NULL, NULL, nbd_client_closed);

    object_unref(OBJECT(cioc));

    return TRUE;

}


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

     g_source_unref(iwp->src);

+    iwp->src = NULL;
+
+}

static void io_watch_poll_finalize(GSource *source)

{

    IOWatchPoll *iwp = io_watch_poll_from_source(source);

    g_source_destroy(iwp->src);

    g_source_unref(iwp->src);

    iwp->src = NULL;

}


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

     pdu_handler_t *handler;
+
+
+
     if (debug_9p_pdu) {

         pprint_pdu(pdu);

static void submit_pdu(V9fsState *s, V9fsPDU *pdu)

{

    pdu_handler_t *handler;

    if (debug_9p_pdu) {

        pprint_pdu(pdu);

    }

    BUG_ON(pdu->id >= ARRAY_SIZE(pdu_handlers));

    handler = pdu_handlers[pdu->id];

    BUG_ON(handler == NULL);

    handler(s, pdu);

}


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

                               DeviceState *ccm)
+
+{
+
+    IMXTimerGState *pp;
+
     DeviceState *dev;

void imx_timerg_create(const target_phys_addr_t addr,

                              qemu_irq irq,

                              DeviceState *ccm)

{

    IMXTimerGState *pp;

    DeviceState *dev;

    dev = sysbus_create_simple("imx_timerg", addr, irq);

    pp = container_of(dev, IMXTimerGState, busdev.qdev);

    pp->ccm = ccm;

}


static int qemu_rdma_close(void *opaque)

{

    DPRINTF("Shutting down connection.\n");

    QEMUFileRDMA *r = opaque;

    if (r->rdma) {

        qemu_rdma_cleanup(r->rdma);

        g_free(r->rdma);

    }

    g_free(r);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int dnxhd_init_vlc(DNXHDContext *ctx, int cid)

 {

static int dnxhd_init_vlc(DNXHDContext *ctx, int cid)

{

    if (cid != ctx->cid) {

        int index;

        if ((index = ff_dnxhd_get_cid_table(cid)) < 0) {

            av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %d\n", cid);

            return -1;

        }

        if (ff_dnxhd_cid_table[index].bit_depth != ctx->bit_depth) {

            av_log(ctx->avctx, AV_LOG_ERROR, "bit depth mismatches %d %d\n", ff_dnxhd_cid_table[index].bit_depth, ctx->bit_depth);

            return AVERROR_INVALIDDATA;

        }

        ctx->cid_table = &ff_dnxhd_cid_table[index];

        ff_free_vlc(&ctx->ac_vlc);

        ff_free_vlc(&ctx->dc_vlc);

        ff_free_vlc(&ctx->run_vlc);

        init_vlc(&ctx->ac_vlc, DNXHD_VLC_BITS, 257,

                 ctx->cid_table->ac_bits, 1, 1,

                 ctx->cid_table->ac_codes, 2, 2, 0);

        init_vlc(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, ctx->bit_depth + 4,

                 ctx->cid_table->dc_bits, 1, 1,

                 ctx->cid_table->dc_codes, 1, 1, 0);

        init_vlc(&ctx->run_vlc, DNXHD_VLC_BITS, 62,

                 ctx->cid_table->run_bits, 1, 1,

                 ctx->cid_table->run_codes, 2, 2, 0);

        ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, ff_zigzag_direct);

        ctx->cid = cid;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,26 +1,26 @@
+static int local_rename(FsContext *ctx, const char *oldpath,
+
+                        const char *newpath)
+
+{
+
+    int err;

+    char *buffer, *buffer1;
+
+
+
+    if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {
+
         err = local_create_mapped_attr_dir(ctx, newpath);

         if (err < 0) {
+
+            return err;
+
+        }
+
+        /* rename the .virtfs_metadata files */

         buffer = local_mapped_attr_path(ctx, oldpath);

static int local_rename(FsContext *ctx, const char *oldpath,

                        const char *newpath)

{

    int err;

    char *buffer, *buffer1;

    if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {

        err = local_create_mapped_attr_dir(ctx, newpath);

        if (err < 0) {

            return err;

        }

        /* rename the .virtfs_metadata files */

        buffer = local_mapped_attr_path(ctx, oldpath);

        buffer1 = local_mapped_attr_path(ctx, newpath);

        err = rename(buffer, buffer1);

        g_free(buffer);

        g_free(buffer1);

        if (err < 0 && errno != ENOENT) {

            return err;

        }

    }

    buffer = rpath(ctx, oldpath);

    buffer1 = rpath(ctx, newpath);

    err = rename(buffer, buffer1);

    g_free(buffer);

    g_free(buffer1);

    return err;

}


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

     MOVStreamContext *sc;

+    unsigned i, entries;
+
+
+
+    if (c->fc->nb_streams < 1)

         return 0;

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

{

    AVStream *st;

    MOVStreamContext *sc;

    unsigned i, entries;

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

        return 0;

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

    sc = st->priv_data;

    avio_rb32(pb); // version + flags

    entries = avio_rb32(pb);

    if (entries >= UINT_MAX / sizeof(*sc->stps_data))

        return AVERROR_INVALIDDATA;

    sc->stps_data = av_malloc(entries * sizeof(*sc->stps_data));

    if (!sc->stps_data)

        return AVERROR(ENOMEM);

    sc->stps_count = entries;

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

        sc->stps_data[i] = avio_rb32(pb);

        //av_dlog(c->fc, "stps %d\n", sc->stps_data[i]);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+int nbd_client_init(BlockDriverState *bs, QIOChannelSocket *sioc,
+
+                    const char *export, Error **errp)
+
+{

     NbdClientSession *client = nbd_get_client_session(bs);

int nbd_client_init(BlockDriverState *bs, QIOChannelSocket *sioc,

                    const char *export, Error **errp)

{

    NbdClientSession *client = nbd_get_client_session(bs);

    int ret;

    /* NBD handshake */

    logout("session init %s\n", export);

    qio_channel_set_blocking(QIO_CHANNEL(sioc), true, NULL);

    ret = nbd_receive_negotiate(QIO_CHANNEL(sioc), export,

                                &client->nbdflags,

                                NULL, NULL,

                                &client->ioc,

                                &client->size, errp);

    if (ret < 0) {

        logout("Failed to negotiate with the NBD server\n");

        return ret;

    }

    qemu_co_mutex_init(&client->send_mutex);

    qemu_co_mutex_init(&client->free_sema);

    client->sioc = sioc;

    object_ref(OBJECT(client->sioc));

    if (!client->ioc) {

        client->ioc = QIO_CHANNEL(sioc);

        object_ref(OBJECT(client->ioc));

    }

    /* Now that we're connected, set the socket to be non-blocking and

     * kick the reply mechanism.  */

    qio_channel_set_blocking(QIO_CHANNEL(sioc), false, NULL);

    nbd_client_attach_aio_context(bs, bdrv_get_aio_context(bs));

    logout("Established connection with NBD server\n");

    return 0;

}


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

     BDRVRBDState *s = bs->opaque;
+
+    int r;
+
+

     r = rbd_snap_rollback(s->image, snapshot_name);

static int qemu_rbd_snap_rollback(BlockDriverState *bs,

                                  const char *snapshot_name)

{

    BDRVRBDState *s = bs->opaque;

    int r;

    r = rbd_snap_rollback(s->image, snapshot_name);

    return r;

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
         dest[0] = av_clip_uint8(dest[0] + dc);

         dest[1] = av_clip_uint8(dest[1] + dc);
+
+        dest[2] = av_clip_uint8(dest[2] + dc);
+
+        dest[3] = av_clip_uint8(dest[3] + dc);
+
         dest[4] = av_clip_uint8(dest[4] + dc);

         dest[5] = av_clip_uint8(dest[5] + dc);

static void vp3_idct_dc_add_c(uint8_t *dest/*align 8*/, int line_size,

                              const DCTELEM *block/*align 16*/){

    int i, dc = (block[0] + 15) >> 5;

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

        dest[0] = av_clip_uint8(dest[0] + dc);

        dest[1] = av_clip_uint8(dest[1] + dc);

        dest[2] = av_clip_uint8(dest[2] + dc);

        dest[3] = av_clip_uint8(dest[3] + dc);

        dest[4] = av_clip_uint8(dest[4] + dc);

        dest[5] = av_clip_uint8(dest[5] + dc);

        dest[6] = av_clip_uint8(dest[6] + dc);

        dest[7] = av_clip_uint8(dest[7] + dc);

        dest += line_size;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb, MOVAtom atom)

 {

int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb, MOVAtom atom)

{

    AVStream *st;

    int tag;

    if (fc->nb_streams < 1)

        return 0;

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

    avio_rb32(pb); /* version + flags */

    ff_mp4_read_descr(fc, pb, &tag);

    if (tag == MP4ESDescrTag) {

        ff_mp4_parse_es_descr(pb, NULL);

    } else

        avio_rb16(pb); /* ID */

    ff_mp4_read_descr(fc, pb, &tag);

    if (tag == MP4DecConfigDescrTag)

        ff_mp4_read_dec_config_descr(fc, st, pb);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void raw_close_fd_pool(BDRVRawState *s)
+
+{
+
+    int i;

static void raw_close_fd_pool(BDRVRawState *s)

{

    int i;

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

        if (s->fd_pool[i] != -1) {

            close(s->fd_pool[i]);

            s->fd_pool[i] = -1;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, int width)
+
 {

 #ifdef HAVE_MMX

static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, int width)

{

#ifdef HAVE_MMX

	asm volatile(

		"movq "MANGLE(bm01010101)", %%mm2\n\t"

		"mov %0, %%"REG_a"		\n\t"

		"1:				\n\t"

		"movq (%1, %%"REG_a",2), %%mm0	\n\t"

		"movq 8(%1, %%"REG_a",2), %%mm1	\n\t"

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

		"pand %%mm2, %%mm1		\n\t"

		"packuswb %%mm1, %%mm0		\n\t"

		"movq %%mm0, (%2, %%"REG_a")	\n\t"

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

		" js 1b				\n\t"

		: : "g" ((long)-width), "r" (src+width*2), "r" (dst+width)

		: "%"REG_a

	);

#else

	int i;

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

		dst[i]= src[2*i];

#endif

}


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

     g_assert(c->client_channel);
+
+    g_io_channel_shutdown(c->client_channel, true, NULL);
+
+    g_io_channel_unref(c->client_channel);

     c->client_channel = NULL;

static void ga_channel_client_close(GAChannel *c)

{

    g_assert(c->client_channel);

    g_io_channel_shutdown(c->client_channel, true, NULL);

    g_io_channel_unref(c->client_channel);

    c->client_channel = NULL;

    if (c->method == GA_CHANNEL_UNIX_LISTEN && c->listen_channel) {

        ga_channel_listen_add(c, 0, false);

    }

}