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

     if (value < min || value > max) {
+
+        error_set(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE,
+
+                  dev->id?:"", name, (int64_t)value, min, max);
+
         return;

     }

static void set_blocksize(Object *obj, Visitor *v, void *opaque,

                          const char *name, Error **errp)

{

    DeviceState *dev = DEVICE(obj);

    Property *prop = opaque;

    uint16_t value, *ptr = qdev_get_prop_ptr(dev, prop);

    Error *local_err = NULL;

    const int64_t min = 512;

    const int64_t max = 32768;

    if (dev->realized) {

        qdev_prop_set_after_realize(dev, name, errp);

        return;

    }

    visit_type_uint16(v, &value, name, &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        return;

    }

    if (value < min || value > max) {

        error_set(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE,

                  dev->id?:"", name, (int64_t)value, min, max);

        return;

    }

    /* We rely on power-of-2 blocksizes for bitmasks */

    if ((value & (value - 1)) != 0) {

        error_setg(errp,

                  "Property %s.%s doesn't take value '%" PRId64 "', it's not a power of 2",

                  dev->id ?: "", name, (int64_t)value);

        return;

    }

    *ptr = value;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void gif_fill_rect(AVFrame *picture, uint32_t color, int l, int t, int w, int h)

 {
+
     const int linesize = picture->linesize[0] / sizeof(uint32_t);

     const uint32_t *py = (uint32_t *)picture->data[0] + t * linesize;

static void gif_fill_rect(AVFrame *picture, uint32_t color, int l, int t, int w, int h)

{

    const int linesize = picture->linesize[0] / sizeof(uint32_t);

    const uint32_t *py = (uint32_t *)picture->data[0] + t * linesize;

    const uint32_t *pr, *pb = py + (t + h) * linesize;

    uint32_t *px;

    for (; py < pb; py += linesize) {

        px = (uint32_t *)py + l;

        pr = px + w;

        for (; px < pr; px++)

            *px = color;

    }

}


--- a/source.c
+++ b/source.c
@@ -37,11 +37,11 @@
     if (ctx->nvenc_ctx)

         nv->nvEncDestroyEncoder(ctx->nvenc_ctx);
+
+
+
+    if (ctx->cu_context)
+
         ctx->nvel.cu_ctx_destroy(ctx->cu_context);

av_cold int ff_nvenc_encode_close(AVCodecContext *avctx)

{

    NVENCContext *ctx               = avctx->priv_data;

    NV_ENCODE_API_FUNCTION_LIST *nv = &ctx->nvel.nvenc_funcs;

    int i;

    av_frame_free(&avctx->coded_frame);

    if (ctx->in) {

        for (i = 0; i < ctx->nb_surfaces; ++i) {

            nv->nvEncDestroyInputBuffer(ctx->nvenc_ctx, ctx->in[i].in);

            nv->nvEncDestroyBitstreamBuffer(ctx->nvenc_ctx, ctx->out[i].out);

        }

    }

    av_freep(&ctx->in);

    av_freep(&ctx->out);

    if (ctx->nvenc_ctx)

        nv->nvEncDestroyEncoder(ctx->nvenc_ctx);

    if (ctx->cu_context)

        ctx->nvel.cu_ctx_destroy(ctx->cu_context);

    if (ctx->nvel.nvenc)

        dlclose(ctx->nvel.nvenc);

    if (ctx->nvel.cuda)

        dlclose(ctx->nvel.cuda);

    return 0;

}


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

     entry = qdict_find(qdict, key, hash);

+    if (entry) {
+
+        /* replace key's value */
+
+        qobject_decref(entry->value);

         entry->value = value;

void qdict_put_obj(QDict *qdict, const char *key, QObject *value)

{

    unsigned int hash;

    QDictEntry *entry;

    hash = tdb_hash(key) % QDICT_HASH_SIZE;

    entry = qdict_find(qdict, key, hash);

    if (entry) {

        /* replace key's value */

        qobject_decref(entry->value);

        entry->value = value;

    } else {

        /* allocate a new entry */

        entry = alloc_entry(key, value);

        LIST_INSERT_HEAD(&qdict->table[hash], entry, next);

    }

    qdict->size++;

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                 qemu_irq irq0, qemu_irq irq1)

 {
+
     int iomemtype;

     pl181_state *s;

void pl181_init(uint32_t base, BlockDriverState *bd,

                qemu_irq irq0, qemu_irq irq1)

{

    int iomemtype;

    pl181_state *s;

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

    iomemtype = cpu_register_io_memory(0, pl181_readfn,

                                       pl181_writefn, s);

    cpu_register_physical_memory(base, 0x00000fff, iomemtype);

    s->base = base;

    s->card = sd_init(bd);

    s->irq[0] = irq0;

    s->irq[1] = irq1;

    qemu_register_reset(pl181_reset, s);

    pl181_reset(s);

    /* ??? Save/restore.  */

}


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

         if (!outpicref)

+            return AVERROR(ENOMEM);
+
+    }
+
+

     ret = ff_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0));

static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)

{

    AVFilterLink *outlink = inlink->dst->outputs[0];

    AVFilterBufferRef *outpicref = NULL;

    int ret = 0;

    if (inpicref->perms & AV_PERM_PRESERVE) {

        outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE,

                                        outlink->w, outlink->h);

        if (!outpicref)

            return AVERROR(ENOMEM);

        avfilter_copy_buffer_ref_props(outpicref, inpicref);

        outpicref->video->w = outlink->w;

        outpicref->video->h = outlink->h;

    } else {

        outpicref = avfilter_ref_buffer(inpicref, ~0);

        if (!outpicref)

            return AVERROR(ENOMEM);

    }

    ret = ff_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0));

    if (ret < 0) {

        avfilter_unref_bufferp(&outpicref);

        return ret;

    }

    outlink->out_buf = outpicref;

    return 0;

}


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

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

+
+
+    vhost_user_stop(s);

     qemu_purge_queued_packets(nc);

static void vhost_user_cleanup(NetClientState *nc)

{

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

    vhost_user_stop(s);

    qemu_purge_queued_packets(nc);

}


--- a/source.c
+++ b/source.c
@@ -5,10 +5,10 @@
     DeviceState *dev;

+
+    dev = qdev_create(NULL, "realview_sysctl");
+
+    qdev_prop_set_uint32(dev, "sys_id", sys_id);

     qdev_init_nofail(dev);

void arm_sysctl_init(uint32_t base, uint32_t sys_id)

{

    DeviceState *dev;

    dev = qdev_create(NULL, "realview_sysctl");

    qdev_prop_set_uint32(dev, "sys_id", sys_id);

    qdev_init_nofail(dev);

    sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);

}


--- a/source.c
+++ b/source.c
@@ -1,22 +1,22 @@
+static av_cold void init_mdct_win(TwinContext *tctx)
+
 {

     int i,j;

     const ModeTab *mtab = tctx->mtab;
+
     int size_s = mtab->size / mtab->fmode[FT_SHORT].sub;
+
     int size_m = mtab->size / mtab->fmode[FT_MEDIUM].sub;
+
+    int channels = tctx->avctx->channels;
+
+    float norm = channels == 1 ? 2. : 1.;

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

         int bsize = tctx->mtab->size/tctx->mtab->fmode[i].sub;

static av_cold void init_mdct_win(TwinContext *tctx)

{

    int i,j;

    const ModeTab *mtab = tctx->mtab;

    int size_s = mtab->size / mtab->fmode[FT_SHORT].sub;

    int size_m = mtab->size / mtab->fmode[FT_MEDIUM].sub;

    int channels = tctx->avctx->channels;

    float norm = channels == 1 ? 2. : 1.;

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

        int bsize = tctx->mtab->size/tctx->mtab->fmode[i].sub;

        ff_mdct_init(&tctx->mdct_ctx[i], av_log2(bsize) + 1, 1,

                     -sqrt(norm/bsize) / (1<<15));

    }

    tctx->tmp_buf  = av_malloc(mtab->size            * sizeof(*tctx->tmp_buf));

    tctx->spectrum  = av_malloc(2*mtab->size*channels*sizeof(float));

    tctx->curr_frame = av_malloc(2*mtab->size*channels*sizeof(float));

    tctx->prev_frame  = av_malloc(2*mtab->size*channels*sizeof(float));

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

        int m = 4*mtab->size/mtab->fmode[i].sub;

        double freq = 2*M_PI/m;

        tctx->cos_tabs[i] = av_malloc((m/4)*sizeof(*tctx->cos_tabs));

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

            tctx->cos_tabs[i][j] = cos((2*j + 1)*freq);

        for (j = 1; j <  m/8; j++)

            tctx->cos_tabs[i][m/4-j] = tctx->cos_tabs[i][j];

    }

    ff_init_ff_sine_windows(av_log2(size_m));

    ff_init_ff_sine_windows(av_log2(size_s/2));

    ff_init_ff_sine_windows(av_log2(mtab->size));

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int v9fs_synth_symlink(FsContext *fs_ctx, const char *oldpath,

                               V9fsPath *newpath, const char *buf, FsCred *credp)
+
+{

     errno = EPERM;

static int v9fs_synth_symlink(FsContext *fs_ctx, const char *oldpath,

                              V9fsPath *newpath, const char *buf, FsCred *credp)

{

    errno = EPERM;

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -45,11 +45,11 @@
     ctx->lsp[0] = ctx->lsp_buf[0];

     ctx->lsp[1] = ctx->lsp_buf[1];
+
+    memcpy(ctx->lsp[0], lsp_init, 10 * sizeof(int16_t));
+
+
+
     ctx->exc = &ctx->exc_base[PITCH_DELAY_MAX+INTERPOL_LEN];

static av_cold int decoder_init(AVCodecContext * avctx)

{

    G729Context* ctx = avctx->priv_data;

    int i,k;

    if (avctx->channels != 1) {

        av_log(avctx, AV_LOG_ERROR, "Only mono sound is supported (requested channels: %d).\n", avctx->channels);

        return AVERROR(EINVAL);

    }

    avctx->sample_fmt = AV_SAMPLE_FMT_S16;

    /* Both 8kbit/s and 6.4kbit/s modes uses two subframes per frame. */

    avctx->frame_size = SUBFRAME_SIZE << 1;

    ctx->gain_coeff = 16384; // 1.0 in (1.14)

    for (k = 0; k < MA_NP + 1; k++) {

        ctx->past_quantizer_outputs[k] = ctx->past_quantizer_output_buf[k];

        for (i = 1; i < 11; i++)

            ctx->past_quantizer_outputs[k][i - 1] = (18717 * i) >> 3;

    }

    ctx->lsp[0] = ctx->lsp_buf[0];

    ctx->lsp[1] = ctx->lsp_buf[1];

    memcpy(ctx->lsp[0], lsp_init, 10 * sizeof(int16_t));

    ctx->exc = &ctx->exc_base[PITCH_DELAY_MAX+INTERPOL_LEN];

    /* random seed initialization */

    ctx->rand_value = 21845;

    /* quantized prediction error */

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

        ctx->quant_energy[i] = -14336; // -14 in (5.10)

    avctx->dsp_mask= ~AV_CPU_FLAG_FORCE;

    dsputil_init(&ctx->dsp, avctx);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
                         VIRTQUEUE_MAX_SIZE, 1);

     virtqueue_map_iovec(elem->out_sg, elem->out_addr, &elem->out_num,
+
+                        VIRTQUEUE_MAX_SIZE, 0);
+
 }

void virtqueue_map(VirtQueueElement *elem)

{

    virtqueue_map_iovec(elem->in_sg, elem->in_addr, &elem->in_num,

                        VIRTQUEUE_MAX_SIZE, 1);

    virtqueue_map_iovec(elem->out_sg, elem->out_addr, &elem->out_num,

                        VIRTQUEUE_MAX_SIZE, 0);

}


static const OptionDef *find_option(const OptionDef *po, const char *name)

{

    const char *p = strchr(name, ':');

    int len = p ? p - name : strlen(name);

    while (po->name != NULL) {

        if (!strncmp(name, po->name, len) && strlen(po->name) == len)

            break;

        po++;

    }

    return po;

}


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

     FileContext *c = h->priv_data;

+    int r = write(c->fd, buf, size);
+
     return (-1 == r)?AVERROR(errno):r;

 }

static int file_write(URLContext *h, const unsigned char *buf, int size)

{

    FileContext *c = h->priv_data;

    int r = write(c->fd, buf, size);

    return (-1 == r)?AVERROR(errno):r;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void kvm_client_set_memory(struct CPUPhysMemoryClient *client,
+
                                   target_phys_addr_t start_addr,

                                   ram_addr_t size, ram_addr_t phys_offset,

static void kvm_client_set_memory(struct CPUPhysMemoryClient *client,

                                  target_phys_addr_t start_addr,

                                  ram_addr_t size, ram_addr_t phys_offset,

                                  bool log_dirty)

{

    kvm_set_phys_mem(start_addr, size, phys_offset, log_dirty);

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     cc->dump_state = mb_cpu_dump_state;
     cc->set_pc = mb_cpu_set_pc;
     cc->gdb_read_register = mb_cpu_gdb_read_register;
+    cc->gdb_write_register = mb_cpu_gdb_write_register;
+#ifdef CONFIG_USER_ONLY
+    cc->handle_mmu_fault = mb_cpu_handle_mmu_fault;
+#else
+    cc->do_unassigned_access = mb_cpu_unassigned_access;
     cc->get_phys_page_debug = mb_cpu_get_phys_page_debug;
 #endif
     dc->vmsd = &vmstate_mb_cpu;

static void mb_cpu_class_init(ObjectClass *oc, void *data)
{
    DeviceClass *dc = DEVICE_CLASS(oc);
    CPUClass *cc = CPU_CLASS(oc);
    MicroBlazeCPUClass *mcc = MICROBLAZE_CPU_CLASS(oc);
    mcc->parent_realize = dc->realize;
    dc->realize = mb_cpu_realizefn;
    mcc->parent_reset = cc->reset;
    cc->reset = mb_cpu_reset;
    cc->has_work = mb_cpu_has_work;
    cc->do_interrupt = mb_cpu_do_interrupt;
    cc->cpu_exec_interrupt = mb_cpu_exec_interrupt;
    cc->dump_state = mb_cpu_dump_state;
    cc->set_pc = mb_cpu_set_pc;
    cc->gdb_read_register = mb_cpu_gdb_read_register;
    cc->gdb_write_register = mb_cpu_gdb_write_register;
#ifdef CONFIG_USER_ONLY
    cc->handle_mmu_fault = mb_cpu_handle_mmu_fault;
#else
    cc->do_unassigned_access = mb_cpu_unassigned_access;
    cc->get_phys_page_debug = mb_cpu_get_phys_page_debug;
#endif
    dc->vmsd = &vmstate_mb_cpu;
    dc->props = mb_properties;
    cc->gdb_num_core_regs = 32 + 5;
    cc->disas_set_info = mb_disas_set_info;
}


--- a/source.c
+++ b/source.c
@@ -32,11 +32,11 @@
         w_lim = w;
     } else {
         w_lim = w - (w_lim % VNC_DIRTY_PIXELS_PER_BIT);
+    for (i = 0; i < h; i++) {
+        for (x = 0; x <= w_lim;
+                x += s, src_row += cmp_bytes, dst_row += cmp_bytes) {
+            if (x == w_lim) {
+                if ((s = w - w_lim) == 0)
                     break;
             } else if (!x) {
                 s = (VNC_DIRTY_PIXELS_PER_BIT -

static void vnc_dpy_copy(DisplayChangeListener *dcl,
                         int src_x, int src_y,
                         int dst_x, int dst_y, int w, int h)
{
    VncDisplay *vd = container_of(dcl, VncDisplay, dcl);
    VncState *vs, *vn;
    uint8_t *src_row;
    uint8_t *dst_row;
    int i, x, y, pitch, inc, w_lim, s;
    int cmp_bytes;
    vnc_refresh_server_surface(vd);
    QTAILQ_FOREACH_SAFE(vs, &vd->clients, next, vn) {
        if (vnc_has_feature(vs, VNC_FEATURE_COPYRECT)) {
            vs->force_update = 1;
            vnc_update_client(vs, 1, true);
            /* vs might be free()ed here */
    /* do bitblit op on the local surface too */
    pitch = vnc_server_fb_stride(vd);
    src_row = vnc_server_fb_ptr(vd, src_x, src_y);
    dst_row = vnc_server_fb_ptr(vd, dst_x, dst_y);
    y = dst_y;
    inc = 1;
    if (dst_y > src_y) {
        /* copy backwards */
        src_row += pitch * (h-1);
        dst_row += pitch * (h-1);
        pitch = -pitch;
        y = dst_y + h - 1;
        inc = -1;
    w_lim = w - (VNC_DIRTY_PIXELS_PER_BIT - (dst_x % VNC_DIRTY_PIXELS_PER_BIT));
    if (w_lim < 0) {
        w_lim = w;
    } else {
        w_lim = w - (w_lim % VNC_DIRTY_PIXELS_PER_BIT);
    for (i = 0; i < h; i++) {
        for (x = 0; x <= w_lim;
                x += s, src_row += cmp_bytes, dst_row += cmp_bytes) {
            if (x == w_lim) {
                if ((s = w - w_lim) == 0)
                    break;
            } else if (!x) {
                s = (VNC_DIRTY_PIXELS_PER_BIT -
                    (dst_x % VNC_DIRTY_PIXELS_PER_BIT));
                s = MIN(s, w_lim);
            } else {
                s = VNC_DIRTY_PIXELS_PER_BIT;
            cmp_bytes = s * VNC_SERVER_FB_BYTES;
            if (memcmp(src_row, dst_row, cmp_bytes) == 0)
                continue;
            memmove(dst_row, src_row, cmp_bytes);
            QTAILQ_FOREACH(vs, &vd->clients, next) {
                if (!vnc_has_feature(vs, VNC_FEATURE_COPYRECT)) {
                    set_bit(((x + dst_x) / VNC_DIRTY_PIXELS_PER_BIT),
                            vs->dirty[y]);
        src_row += pitch - w * VNC_SERVER_FB_BYTES;
        dst_row += pitch - w * VNC_SERVER_FB_BYTES;
        y += inc;
    QTAILQ_FOREACH(vs, &vd->clients, next) {
        if (vnc_has_feature(vs, VNC_FEATURE_COPYRECT)) {
            vnc_copy(vs, src_x, src_y, dst_x, dst_y, w, h);


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

         error_propagate(errp, local_err);

+        object_unref(OBJECT(cpu));
+
+        cpu = NULL;
+
+    }

     return cpu;

static X86CPU *pc_new_cpu(const char *cpu_model, int64_t apic_id,

                          Error **errp)

{

    X86CPU *cpu = NULL;

    Error *local_err = NULL;

    cpu = cpu_x86_create(cpu_model, &local_err);

    if (local_err != NULL) {

        goto out;

    }

    object_property_set_int(OBJECT(cpu), apic_id, "apic-id", &local_err);

    object_property_set_bool(OBJECT(cpu), true, "realized", &local_err);

out:

    if (local_err) {

        error_propagate(errp, local_err);

        object_unref(OBJECT(cpu));

        cpu = NULL;

    }

    return cpu;

}


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

     test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_INTEGER);
+
+}

static void test_visitor_out_native_list_int(TestOutputVisitorData *data,

                                             const void *unused)

{

    test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_INTEGER);

}


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

                                        size_t nfds,
+
+                                       Error **errp)
+
+{
+
     QIOChannelFile *fioc = QIO_CHANNEL_FILE(ioc);

     ssize_t ret;

static ssize_t qio_channel_file_writev(QIOChannel *ioc,

                                       const struct iovec *iov,

                                       size_t niov,

                                       int *fds,

                                       size_t nfds,

                                       Error **errp)

{

    QIOChannelFile *fioc = QIO_CHANNEL_FILE(ioc);

    ssize_t ret;

 retry:

    ret = writev(fioc->fd, iov, niov);

    if (ret <= 0) {

        if (errno == EAGAIN ||

            errno == EWOULDBLOCK) {

            return QIO_CHANNEL_ERR_BLOCK;

        }

        if (errno == EINTR) {

            goto retry;

        }

        error_setg_errno(errp, errno,

                         "Unable to write to file");

        return -1;

    }

    return ret;

}


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

         return -EMFILE;

+    }
+
+    qemu_notify_bh = qemu_bh_new(notify_event_cb, NULL);
+
+    gpollfds = g_array_new(FALSE, FALSE, sizeof(GPollFD));

     src = aio_get_g_source(qemu_aio_context);

int qemu_init_main_loop(Error **errp)

{

    int ret;

    GSource *src;

    Error *local_error = NULL;

    init_clocks();

    ret = qemu_signal_init();

    if (ret) {

        return ret;

    }

    qemu_aio_context = aio_context_new(&local_error);

    if (!qemu_aio_context) {

        error_propagate(errp, local_error);

        return -EMFILE;

    }

    qemu_notify_bh = qemu_bh_new(notify_event_cb, NULL);

    gpollfds = g_array_new(FALSE, FALSE, sizeof(GPollFD));

    src = aio_get_g_source(qemu_aio_context);

    g_source_set_name(src, "aio-context");

    g_source_attach(src, NULL);

    g_source_unref(src);

    src = iohandler_get_g_source();

    g_source_set_name(src, "io-handler");

    g_source_attach(src, NULL);

    g_source_unref(src);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int vfio_pci_hot_reset_multi(VFIOPCIDevice *vdev)

 {
+
     return vfio_pci_hot_reset(vdev, false);

 }

static int vfio_pci_hot_reset_multi(VFIOPCIDevice *vdev)

{

    return vfio_pci_hot_reset(vdev, false);

}


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

+    virgl_renderer_get_cap_set(gc.capset_id, &max_ver,
+
+                               &max_size);
+
+    resp = g_malloc(sizeof(*resp) + max_size);

static void virgl_cmd_get_capset(VirtIOGPU *g,

                                 struct virtio_gpu_ctrl_command *cmd)

{

    struct virtio_gpu_get_capset gc;

    struct virtio_gpu_resp_capset *resp;

    uint32_t max_ver, max_size;

    VIRTIO_GPU_FILL_CMD(gc);

    virgl_renderer_get_cap_set(gc.capset_id, &max_ver,

                               &max_size);

    resp = g_malloc(sizeof(*resp) + max_size);

    resp->hdr.type = VIRTIO_GPU_RESP_OK_CAPSET;

    virgl_renderer_fill_caps(gc.capset_id,

                             gc.capset_version,

                             (void *)resp->capset_data);

    virtio_gpu_ctrl_response(g, cmd, &resp->hdr, sizeof(*resp) + max_size);

    g_free(resp);

}


--- a/source.c
+++ b/source.c
@@ -51,11 +51,11 @@
             if(s->codec_id==CODEC_ID_MPEG4)

                 ret= mpeg4_decode_video_packet_header(s);
+
+            else
+
+                ret= h263_decode_gob_header(s);
+
             if(ret>=0)

                 return 0;

int ff_h263_resync(MpegEncContext *s){

    int left, ret;

    if(s->codec_id==CODEC_ID_MPEG4)

        skip_bits1(&s->gb);

    align_get_bits(&s->gb);

    if(show_bits(&s->gb, 16)==0){

        if(s->codec_id==CODEC_ID_MPEG4)

            ret= mpeg4_decode_video_packet_header(s);

        else

            ret= h263_decode_gob_header(s);

        if(ret>=0)

            return 0;

    }

    //ok, its not where its supposed to be ...

    s->gb= s->last_resync_gb;

    align_get_bits(&s->gb);

    left= s->gb.size*8 - get_bits_count(&s->gb);

    for(;left>16+1+5+5; left-=8){

        if(show_bits(&s->gb, 16)==0){

            GetBitContext bak= s->gb;

            if(s->codec_id==CODEC_ID_MPEG4)

                ret= mpeg4_decode_video_packet_header(s);

            else

                ret= h263_decode_gob_header(s);

            if(ret>=0)

                return 0;

            s->gb= bak;

        }

        skip_bits(&s->gb, 8);

    }

    return -1;

}


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

         cd_data_to_raw(buf, lba);

+        break;
+
+    default:
+
+        ret = -EIO;

         break;

static int cd_read_sector(IDEState *s, int lba, uint8_t *buf, int sector_size)

{

    int ret;

    switch(sector_size) {

    case 2048:

        block_acct_start(bdrv_get_stats(s->bs), &s->acct,

                         4 * BDRV_SECTOR_SIZE, BLOCK_ACCT_READ);

        ret = bdrv_read(s->bs, (int64_t)lba << 2, buf, 4);

        block_acct_done(bdrv_get_stats(s->bs), &s->acct);

        break;

    case 2352:

        block_acct_start(bdrv_get_stats(s->bs), &s->acct,

                         4 * BDRV_SECTOR_SIZE, BLOCK_ACCT_READ);

        ret = bdrv_read(s->bs, (int64_t)lba << 2, buf + 16, 4);

        block_acct_done(bdrv_get_stats(s->bs), &s->acct);

        if (ret < 0)

            return ret;

        cd_data_to_raw(buf, lba);

        break;

    default:

        ret = -EIO;

        break;

    }

    return ret;

}


bool vfio_blacklist_opt_rom(VFIOPCIDevice *vdev)

{

    PCIDevice *pdev = &vdev->pdev;

    uint16_t vendor_id, device_id;

    int count = 0;

    vendor_id = pci_get_word(pdev->config + PCI_VENDOR_ID);

    device_id = pci_get_word(pdev->config + PCI_DEVICE_ID);

    while (count < ARRAY_SIZE(romblacklist)) {

        if (romblacklist[count].vendor_id == vendor_id &&

            romblacklist[count].device_id == device_id) {

                return true;

        }

        count++;

    }

    return false;

}


static inline uint8_t fat_chksum(const direntry_t* entry)

{

    uint8_t chksum=0;

    int i;

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

        unsigned char c;

        c = (i < 8) ? entry->name[i] : entry->extension[i-8];

        chksum=(((chksum&0xfe)>>1)|((chksum&0x01)?0x80:0)) + c;

    }

    return chksum;

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     struct ibv_sge sge = {

                             .addr = (uint64_t)(rdma->wr_data[idx].control),
+
+                            .length = RDMA_CONTROL_MAX_BUFFER,
+
+                            .lkey = rdma->wr_data[idx].control_mr->lkey,
+
                          };

static int qemu_rdma_post_recv_control(RDMAContext *rdma, int idx)

{

    struct ibv_recv_wr *bad_wr;

    struct ibv_sge sge = {

                            .addr = (uint64_t)(rdma->wr_data[idx].control),

                            .length = RDMA_CONTROL_MAX_BUFFER,

                            .lkey = rdma->wr_data[idx].control_mr->lkey,

                         };

    struct ibv_recv_wr recv_wr = {

                                    .wr_id = RDMA_WRID_RECV_CONTROL + idx,

                                    .sg_list = &sge,

                                    .num_sge = 1,

                                 };

    if (ibv_post_recv(rdma->qp, &recv_wr, &bad_wr)) {

        return -1;

    }

    return 0;

}


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

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

     INIT_CLIP

+    pixel *dst = (pixel*)_dst;

     stride /= sizeof(pixel);

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

    int i, j;

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

    INIT_CLIP

    pixel *dst = (pixel*)_dst;

    stride /= sizeof(pixel);

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

    {

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

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

        dst += stride;

    }

}


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

+    TAILQ_FOREACH(re, &reset_handlers, entry) {
+
+        if (re->func == func && re->opaque == opaque) {
+
+            TAILQ_REMOVE(&reset_handlers, re, entry);

             qemu_free(re);

void qemu_unregister_reset(QEMUResetHandler *func, void *opaque)

{

    QEMUResetEntry *re;

    TAILQ_FOREACH(re, &reset_handlers, entry) {

        if (re->func == func && re->opaque == opaque) {

            TAILQ_REMOVE(&reset_handlers, re, entry);

            qemu_free(re);

            return;

        }

    }

}


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

     return dev->bus->address_space_mem;

+}

MemoryRegion *pci_address_space(PCIDevice *dev)

{

    return dev->bus->address_space_mem;

}


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

             data_size = FFMAX(avpkt->size, AVCODEC_MAX_AUDIO_FRAME_SIZE);

+            samples = av_malloc(data_size);
+
+            if (!samples)
+
+                goto fail;

             ret = avcodec_decode_audio3(st->codec, samples,

static int try_decode_frame(AVStream *st, AVPacket *avpkt)

{

    int16_t *samples;

    AVCodec *codec;

    int got_picture, data_size, ret=0;

    AVFrame picture;

    if(!st->codec->codec){

        codec = avcodec_find_decoder(st->codec->codec_id);

        if (!codec)

            return -1;

        ret = avcodec_open(st->codec, codec);

        if (ret < 0)

            return ret;

    }

    if(!has_codec_parameters(st->codec)){

        switch(st->codec->codec_type) {

        case CODEC_TYPE_VIDEO:

            ret = avcodec_decode_video2(st->codec, &picture,

                                        &got_picture, avpkt);

            break;

        case CODEC_TYPE_AUDIO:

            data_size = FFMAX(avpkt->size, AVCODEC_MAX_AUDIO_FRAME_SIZE);

            samples = av_malloc(data_size);

            if (!samples)

                goto fail;

            ret = avcodec_decode_audio3(st->codec, samples,

                                        &data_size, avpkt);

            av_free(samples);

            break;

        default:

            break;

        }

    }

 fail:

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -15,9 +15,9 @@
         if (f->buf_index >= f->buf_size)

             return 0;
+
+    }
+
+    return f->buf[f->buf_index++];
+
 }

int qemu_get_byte(QEMUFile *f)

{

    if (f->is_write)

        abort();

    if (f->buf_index >= f->buf_size) {

        qemu_fill_buffer(f);

        if (f->buf_index >= f->buf_size)

            return 0;

    }

    return f->buf[f->buf_index++];

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int smc91c111_can_receive(NetClientState *nc)

+{
+
+    smc91c111_state *s = qemu_get_nic_opaque(nc);

static int smc91c111_can_receive(NetClientState *nc)

{

    smc91c111_state *s = qemu_get_nic_opaque(nc);

    if ((s->rcr & RCR_RXEN) == 0 || (s->rcr & RCR_SOFT_RST))

        return 1;

    if (s->allocated == (1 << NUM_PACKETS) - 1)

        return 0;

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static uint64_t pci_host_data_read(void *opaque,

                                    hwaddr addr, unsigned len)
+
 {

     PCIHostState *s = opaque;

static uint64_t pci_host_data_read(void *opaque,

                                   hwaddr addr, unsigned len)

{

    PCIHostState *s = opaque;

    uint32_t val;

    if (!(s->config_reg & (1 << 31)))

        return 0xffffffff;

    val = pci_data_read(s->bus, s->config_reg | (addr & 3), len);

    PCI_DPRINTF("read addr " TARGET_FMT_plx " len %d val %x\n",

                addr, len, val);

    return val;

}


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

     g_free(pollfds);

+    g_free(nodes);
+
+    nalloc = 0;

 }

static void pollfds_cleanup(Notifier *n, void *unused)

{

    g_assert(npfd == 0);

    g_free(pollfds);

    g_free(nodes);

    nalloc = 0;

}


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

+    if((buf == NULL) || (buf_size < s->checksum_size))
+
+        return 0;
+
+

     *data_size = s->channels * s->frame_size * sizeof(int16_t);

static int qdm2_decode_frame(AVCodecContext *avctx,

            void *data, int *data_size,

            uint8_t *buf, int buf_size)

{

    QDM2Context *s = avctx->priv_data;

    if((buf == NULL) || (buf_size < s->checksum_size))

        return 0;

    *data_size = s->channels * s->frame_size * sizeof(int16_t);

    av_log(avctx, AV_LOG_DEBUG, "decode(%d): %p[%d] -> %p[%d]\n",

       buf_size, buf, s->checksum_size, data, *data_size);

    qdm2_decode(s, buf, data);

    // reading only when next superblock found

    if (s->sub_packet == 0) {

        return s->checksum_size;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -9,9 +9,9 @@
     qemu_register_wakeup_notifier(&ar->wakeup);

     memory_region_init_io(&ar->pm1.cnt.io, memory_region_owner(parent),
+
+                          &acpi_pm_cnt_ops, ar, "acpi-cnt", 2);
+
+    memory_region_add_subregion(parent, 4, &ar->pm1.cnt.io);

 }

void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent, uint8_t s4_val)

{

    ar->pm1.cnt.s4_val = s4_val;

    ar->wakeup.notify = acpi_notify_wakeup;

    qemu_register_wakeup_notifier(&ar->wakeup);

    memory_region_init_io(&ar->pm1.cnt.io, memory_region_owner(parent),

                          &acpi_pm_cnt_ops, ar, "acpi-cnt", 2);

    memory_region_add_subregion(parent, 4, &ar->pm1.cnt.io);

}


--- a/source.c
+++ b/source.c
@@ -5,19 +5,19 @@
     int rc;

     uint8_t byte;
+

     if (!dev->crq.qsize) {

         fprintf(stderr, "spapr_vio_send_creq on uninitialized queue\n");

+        return -1;

     }

+
     /* Maybe do a fast path for KVM just writing to the pages */

     rc = spapr_tce_dma_read(dev, dev->crq.qladdr + dev->crq.qnext, &byte, 1);
@@ -25,7 +25,7 @@
     if (rc) {

         return rc;
+
     }

     if (byte != 0) {

int spapr_vio_send_crq(VIOsPAPRDevice *dev, uint8_t *crq)

{

    int rc;

    uint8_t byte;

    if (!dev->crq.qsize) {

        fprintf(stderr, "spapr_vio_send_creq on uninitialized queue\n");

        return -1;

    }

    /* Maybe do a fast path for KVM just writing to the pages */

    rc = spapr_tce_dma_read(dev, dev->crq.qladdr + dev->crq.qnext, &byte, 1);

    if (rc) {

        return rc;

    }

    if (byte != 0) {

        return 1;

    }

    rc = spapr_tce_dma_write(dev, dev->crq.qladdr + dev->crq.qnext + 8,

                             &crq[8], 8);

    if (rc) {

        return rc;

    }

    kvmppc_eieio();

    rc = spapr_tce_dma_write(dev, dev->crq.qladdr + dev->crq.qnext, crq, 8);

    if (rc) {

        return rc;

    }

    dev->crq.qnext = (dev->crq.qnext + 16) % dev->crq.qsize;

    if (dev->signal_state & 1) {

        qemu_irq_pulse(dev->qirq);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -37,11 +37,11 @@
     mov_write_string_metadata(s, pb, "desc",    "description",1);

     mov_write_string_metadata(s, pb, "ldes",    "synopsis" , 1);
+
+    mov_write_string_metadata(s, pb, "tvsh",    "show"     , 1);
+
+    mov_write_string_metadata(s, pb, "tven",    "episode_id",1);
+
     mov_write_string_metadata(s, pb, "tvnn",    "network"  , 1);

     mov_write_trkn_tag(pb, mov, s);

static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov,

                              AVFormatContext *s)

{

    int64_t pos = avio_tell(pb);

    avio_wb32(pb, 0); /* size */

    ffio_wfourcc(pb, "ilst");

    mov_write_string_metadata(s, pb, "\251nam", "title"    , 1);

    mov_write_string_metadata(s, pb, "\251ART", "artist"   , 1);

    mov_write_string_metadata(s, pb, "aART", "album_artist", 1);

    mov_write_string_metadata(s, pb, "\251wrt", "composer" , 1);

    mov_write_string_metadata(s, pb, "\251alb", "album"    , 1);

    mov_write_string_metadata(s, pb, "\251day", "date"     , 1);

    mov_write_string_tag(pb, "\251too", LIBAVFORMAT_IDENT, 0, 1);

    mov_write_string_metadata(s, pb, "\251cmt", "comment"  , 1);

    mov_write_string_metadata(s, pb, "\251gen", "genre"    , 1);

    mov_write_string_metadata(s, pb, "\251cpy", "copyright", 1);

    mov_write_string_metadata(s, pb, "\251grp", "grouping" , 1);

    mov_write_string_metadata(s, pb, "\251lyr", "lyrics"   , 1);

    mov_write_string_metadata(s, pb, "desc",    "description",1);

    mov_write_string_metadata(s, pb, "ldes",    "synopsis" , 1);

    mov_write_string_metadata(s, pb, "tvsh",    "show"     , 1);

    mov_write_string_metadata(s, pb, "tven",    "episode_id",1);

    mov_write_string_metadata(s, pb, "tvnn",    "network"  , 1);

    mov_write_trkn_tag(pb, mov, s);

    return update_size(pb, pos);

}


--- a/source.c
+++ b/source.c
@@ -39,11 +39,11 @@
     if (srclen > destlen) {

         srclen = destlen;
+
+    }
+
+
+
     for (; destlen && srclen; src++, dest++, destlen--, srclen--) {

         v = cpu_ldub_data_ra(env, src, ra);

uint32_t HELPER(mvcl)(CPUS390XState *env, uint32_t r1, uint32_t r2)

{

    uintptr_t ra = GETPC();

    uint64_t destlen = env->regs[r1 + 1] & 0xffffff;

    uint64_t dest = get_address(env, r1);

    uint64_t srclen = env->regs[r2 + 1] & 0xffffff;

    uint64_t src = get_address(env, r2);

    uint8_t pad = env->regs[r2 + 1] >> 24;

    uint8_t v;

    uint32_t cc;

    if (destlen == srclen) {

        cc = 0;

    } else if (destlen < srclen) {

        cc = 1;

    } else {

        cc = 2;

    }

    if (srclen > destlen) {

        srclen = destlen;

    }

    for (; destlen && srclen; src++, dest++, destlen--, srclen--) {

        v = cpu_ldub_data_ra(env, src, ra);

        cpu_stb_data_ra(env, dest, v, ra);

    }

    for (; destlen; dest++, destlen--) {

        cpu_stb_data_ra(env, dest, pad, ra);

    }

    env->regs[r1 + 1] = destlen;

    /* can't use srclen here, we trunc'ed it */

    env->regs[r2 + 1] -= src - env->regs[r2];

    set_address(env, r1, dest);

    set_address(env, r2, src);

    return cc;

}


int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit, uint64_t *hw_limit)

{

    int rc;

    struct kvm_device_attr attr = {

        .group = KVM_S390_VM_MEM_CTRL,

        .attr = KVM_S390_VM_MEM_LIMIT_SIZE,

        .addr = (uint64_t) &new_limit,

    };

    if (!kvm_s390_supports_mem_limit(s)) {

        return 0;

    }

    rc = kvm_s390_query_mem_limit(s, hw_limit);

    if (rc) {

        return rc;

    } else if (*hw_limit < new_limit) {

        return -E2BIG;

    }

    return kvm_vm_ioctl(s, KVM_SET_DEVICE_ATTR, &attr);

}


--- a/source.c
+++ b/source.c
@@ -7,10 +7,10 @@
     AspeedSoCClass *sc = ASPEED_SOC_CLASS(oc);

+
+    sc->info = (AspeedSoCInfo *) data;
+
+    dc->realize = aspeed_soc_realize;

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

{

    DeviceClass *dc = DEVICE_CLASS(oc);

    AspeedSoCClass *sc = ASPEED_SOC_CLASS(oc);

    sc->info = (AspeedSoCInfo *) data;

    dc->realize = aspeed_soc_realize;

}


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

     if (INLINE_SSE2(cpu_flags) && (cpu_flags & AV_CPU_FLAG_SSE2SLOW)) {
+
+        c->lpc_apply_welch_window = lpc_apply_welch_window_sse2;
+
+        c->lpc_compute_autocorr   = lpc_compute_autocorr_sse2;
+
     }

 #endif /* HAVE_SSE2_INLINE */

av_cold void ff_lpc_init_x86(LPCContext *c)

{

#if HAVE_SSE2_INLINE

    int cpu_flags = av_get_cpu_flags();

    if (INLINE_SSE2(cpu_flags) && (cpu_flags & AV_CPU_FLAG_SSE2SLOW)) {

        c->lpc_apply_welch_window = lpc_apply_welch_window_sse2;

        c->lpc_compute_autocorr   = lpc_compute_autocorr_sse2;

    }

#endif /* HAVE_SSE2_INLINE */

}


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

     if (s->delta == 0 || s->period == 0) {

+        fprintf(stderr, "Timer with period zero, disabling\n");
+
+        s->enabled = 0;
+
+        return;

     }

static void ptimer_reload(ptimer_state *s)

{

    if (s->delta == 0) {

        ptimer_trigger(s);

        s->delta = s->limit;

    }

    if (s->delta == 0 || s->period == 0) {

        fprintf(stderr, "Timer with period zero, disabling\n");

        s->enabled = 0;

        return;

    }

    s->last_event = s->next_event;

    s->next_event = s->last_event + s->delta * s->period;

    if (s->period_frac) {

        s->next_event += ((int64_t)s->period_frac * s->delta) >> 32;

    }

    timer_mod(s->timer, s->next_event);

}


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

 {
+
+    DisasContext *ctx = opaque;
+

     gen_op_store_ibatu((sprn - SPR_IBAT4U) / 2);

static void spr_write_ibatu_h (void *opaque, int sprn)

{

    DisasContext *ctx = opaque;

    gen_op_store_ibatu((sprn - SPR_IBAT4U) / 2);

    RET_STOP(ctx);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 uint64_t HELPER(neon_abdl_u64)(uint32_t a, uint32_t b)

+{

     uint64_t result;

uint64_t HELPER(neon_abdl_u64)(uint32_t a, uint32_t b)

{

    uint64_t result;

    DO_ABD(result, a, b, uint32_t);

    return result;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int check_opt(const CmdArgs *cmd_args, const char *name, QDict *args)
+
+{
+
+    if (!cmd_args->optional) {

         qerror_report(QERR_MISSING_PARAMETER, name);

static int check_opt(const CmdArgs *cmd_args, const char *name, QDict *args)

{

    if (!cmd_args->optional) {

        qerror_report(QERR_MISSING_PARAMETER, name);

        return -1;

    }

    if (cmd_args->type == '-') {

        /* handlers expect a value, they need to be changed */

        qdict_put(args, name, qint_from_int(0));

    }

    return 0;

}


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

     env->crf[0] = T0 | xer_ov;

void OPPROTO op_set_Rc0 (void)

{

    env->crf[0] = T0 | xer_ov;

    RETURN();

}


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

 #if defined(_VNC_DEBUG) && _VNC_DEBUG >= 2
+
+    gnutls_global_set_log_level(10);
+
+    gnutls_global_set_log_function(vnc_debug_gnutls_log);
+
 #endif

static int vnc_tls_initialize(void)

{

    static int tlsinitialized = 0;

    if (tlsinitialized)

	return 1;

    if (gnutls_global_init () < 0)

	return 0;

    /* XXX ought to re-generate diffie-hellmen params periodically */

    if (gnutls_dh_params_init (&dh_params) < 0)

	return 0;

    if (gnutls_dh_params_generate2 (dh_params, DH_BITS) < 0)

	return 0;

#if defined(_VNC_DEBUG) && _VNC_DEBUG >= 2

    gnutls_global_set_log_level(10);

    gnutls_global_set_log_function(vnc_debug_gnutls_log);

#endif

    tlsinitialized = 1;

    return 1;

}


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

      * migration, otherwise first 24 gsi routes will be invalid.

+
+    k->post_load = ioapic_update_kvm_routes;
+
+    dc->reset = ioapic_reset_common;
+
     dc->props = ioapic_properties;

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

{

    IOAPICCommonClass *k = IOAPIC_COMMON_CLASS(klass);

    DeviceClass *dc = DEVICE_CLASS(klass);

    k->realize = ioapic_realize;

     * If APIC is in kernel, we need to update the kernel cache after

     * migration, otherwise first 24 gsi routes will be invalid.

    k->post_load = ioapic_update_kvm_routes;

    dc->reset = ioapic_reset_common;

    dc->props = ioapic_properties;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+void checkasm_check_vf_interlace(void)
+
+{
+
+    check_lowpass_line(8);

     report("lowpass_line_8");

void checkasm_check_vf_interlace(void)

{

    check_lowpass_line(8);

    report("lowpass_line_8");

    check_lowpass_line(16);

    report("lowpass_line_16");

}


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

     /* XXX missing r0 handling */
+
+    env->cc_op = 0;
+
+#ifdef CONFIG_USER_ONLY

     memmove(g2h(r1), g2h(r2), TARGET_PAGE_SIZE);

void HELPER(mvpg)(CPUS390XState *env, uint64_t r0, uint64_t r1, uint64_t r2)

{

    /* XXX missing r0 handling */

    env->cc_op = 0;

#ifdef CONFIG_USER_ONLY

    memmove(g2h(r1), g2h(r2), TARGET_PAGE_SIZE);

#else

    mvc_fast_memmove(env, TARGET_PAGE_SIZE, r1, r2);

#endif

}


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

     int copy_count;
+
     uint8_t *end_ptr;

static void cirrus_bitblt_cputovideo_next(CirrusVGAState * s)

{

    int copy_count;

    uint8_t *end_ptr;

    if (s->cirrus_srccounter > 0) {

        if (s->cirrus_blt_mode & CIRRUS_BLTMODE_PATTERNCOPY) {

            cirrus_bitblt_common_patterncopy(s, s->cirrus_bltbuf);

        the_end:

            s->cirrus_srccounter = 0;

            cirrus_bitblt_reset(s);

        } else {

            /* at least one scan line */

            do {

                (*s->cirrus_rop)(s, s->vga.vram_ptr + s->cirrus_blt_dstaddr,

                                  s->cirrus_bltbuf, 0, 0, s->cirrus_blt_width, 1);

                cirrus_invalidate_region(s, s->cirrus_blt_dstaddr, 0,

                                         s->cirrus_blt_width, 1);

                s->cirrus_blt_dstaddr += s->cirrus_blt_dstpitch;

                s->cirrus_srccounter -= s->cirrus_blt_srcpitch;

                if (s->cirrus_srccounter <= 0)

                    goto the_end;

                /* more bytes than needed can be transferred because of

                   word alignment, so we keep them for the next line */

                /* XXX: keep alignment to speed up transfer */

                end_ptr = s->cirrus_bltbuf + s->cirrus_blt_srcpitch;

                copy_count = s->cirrus_srcptr_end - end_ptr;

                memmove(s->cirrus_bltbuf, end_ptr, copy_count);

                s->cirrus_srcptr = s->cirrus_bltbuf + copy_count;

                s->cirrus_srcptr_end = s->cirrus_bltbuf + s->cirrus_blt_srcpitch;

            } while (s->cirrus_srcptr >= s->cirrus_srcptr_end);

        }

    }

}


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

     return last_ram_offset;
+
 }

uint64_t ram_bytes_total(void)

{

    return last_ram_offset;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+void rgb15tobgr16(const uint8_t *src, uint8_t *dst, unsigned int src_size)
+
+{

 	unsigned i;

void rgb15tobgr16(const uint8_t *src, uint8_t *dst, unsigned int src_size)

{

	unsigned i;

	unsigned num_pixels = src_size >> 1;

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

	{

	    unsigned b,g,r;

	    register uint16_t rgb;

	    rgb = src[2*i];

	    r = rgb&0x1F;

	    g = (rgb&0x3E0)>>5;

	    b = (rgb&0x7C00)>>10;

	    dst[2*i] = (b&0x1F) | ((g&0x3F)<<5) | ((r&0x1F)<<11);

	}

}


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

 #ifdef TARGET_ABI32

+    case CTLTYPE_LONG:
+
+    case CTLTYPE_ULONG:
+
+        *(uint32_t *)holdp = tswap32(*(long *)holdp);

         break;

static int sysctl_oldcvt(void *holdp, size_t holdlen, uint32_t kind)

{

    switch (kind & CTLTYPE) {

    case CTLTYPE_INT:

    case CTLTYPE_UINT:

        *(uint32_t *)holdp = tswap32(*(uint32_t *)holdp);

        break;

#ifdef TARGET_ABI32

    case CTLTYPE_LONG:

    case CTLTYPE_ULONG:

        *(uint32_t *)holdp = tswap32(*(long *)holdp);

        break;

#else

    case CTLTYPE_LONG:

        *(uint64_t *)holdp = tswap64(*(long *)holdp);

    case CTLTYPE_ULONG:

        *(uint64_t *)holdp = tswap64(*(unsigned long *)holdp);

        break;

#endif

#if !defined(__FreeBSD_version) || __FreeBSD_version < 900031

    case CTLTYPE_QUAD:

#else

    case CTLTYPE_U64:

#endif

        *(uint64_t *)holdp = tswap64(*(uint64_t *)holdp);

        break;

    case CTLTYPE_STRING:

        break;

    default:

        /* XXX unhandled */

        return -1;

    }

    return 0;

}


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

+    if (offset < 0x40) {
+
+        arm_timer_write(s->timer[1], offset - 0x20, value);
+
+        return;

     }

static void sp804_write(void *opaque, target_phys_addr_t offset,

                        uint64_t value, unsigned size)

{

    sp804_state *s = (sp804_state *)opaque;

    if (offset < 0x20) {

        arm_timer_write(s->timer[0], offset, value);

        return;

    }

    if (offset < 0x40) {

        arm_timer_write(s->timer[1], offset - 0x20, value);

        return;

    }

    /* Technically we could be writing to the Test Registers, but not likely */

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

}


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

     switch (addr) {

+    case R_SR:
+
+    case R_CR:
+
+    case R_PERIOD:

         r = s->regs[addr];

static uint64_t timer_read(void *opaque, target_phys_addr_t addr, unsigned size)

{

    LM32TimerState *s = opaque;

    uint32_t r = 0;

    addr >>= 2;

    switch (addr) {

    case R_SR:

    case R_CR:

    case R_PERIOD:

        r = s->regs[addr];

        break;

    case R_SNAPSHOT:

        r = (uint32_t)ptimer_get_count(s->ptimer);

        break;

    default:

        error_report("lm32_timer: read access to unknown register 0x"

                TARGET_FMT_plx, addr << 2);

        break;

    }

    trace_lm32_timer_memory_read(addr << 2, r);

    return r;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 int avformat_network_deinit(void)

+{
+
+#if CONFIG_NETWORK
+
     ff_network_close();

     ff_tls_deinit();

int avformat_network_deinit(void)

{

#if CONFIG_NETWORK

    ff_network_close();

    ff_tls_deinit();

    ff_network_inited_globally = 0;

#endif

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
         if( tc0[i] < 0 ) {

             pix += 4*ystride;
+
+            continue;
+
+        }
+
         for( d = 0; d < 4; d++ ) {

             const int p0 = pix[-1*xstride];

static inline void h264_loop_filter_luma_c(uint8_t *pix, int xstride, int ystride, int alpha, int beta, int *tc0)

{

    int i, d;

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

        if( tc0[i] < 0 ) {

            pix += 4*ystride;

            continue;

        }

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

            const int p0 = pix[-1*xstride];

            const int p1 = pix[-2*xstride];

            const int p2 = pix[-3*xstride];

            const int q0 = pix[0];

            const int q1 = pix[1*xstride];

            const int q2 = pix[2*xstride];

            if( ABS( p0 - q0 ) < alpha &&

                ABS( p1 - p0 ) < beta &&

                ABS( q1 - q0 ) < beta ) {

                int tc = tc0[i];

                int i_delta;

                if( ABS( p2 - p0 ) < beta ) {

                    pix[-2*xstride] = p1 + clip( ( p2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( p1 << 1 ) ) >> 1, -tc0[i], tc0[i] );

                    tc++;

                }

                if( ABS( q2 - q0 ) < beta ) {

                    pix[xstride] = q1 + clip( ( q2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( q1 << 1 ) ) >> 1, -tc0[i], tc0[i] );

                    tc++;

                }

                i_delta = clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );

                pix[-xstride] = clip_uint8( p0 + i_delta );    /* p0' */

                pix[0]        = clip_uint8( q0 - i_delta );    /* q0' */

            }

            pix += ystride;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void release_delayed_buffers(PerThreadContext *p)

 {
+
     FrameThreadContext *fctx = p->parent;

static void release_delayed_buffers(PerThreadContext *p)

{

    FrameThreadContext *fctx = p->parent;

    while (p->num_released_buffers > 0) {

        AVFrame *f = &p->released_buffers[--p->num_released_buffers];

        pthread_mutex_lock(&fctx->buffer_mutex);

        free_progress(f);

        f->thread_opaque = NULL;

        f->owner->release_buffer(f->owner, f);

        pthread_mutex_unlock(&fctx->buffer_mutex);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame)

 {

int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame)

{

    BufferSinkContext *s    = ctx->priv;

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

    int ret;

    if ((ret = ff_request_frame(link)) < 0)

        return ret;

    if (!s->cur_frame)

        return AVERROR(EINVAL);

    av_frame_move_ref(frame, s->cur_frame);

    av_frame_free(&s->cur_frame);

    return 0;

}


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

                       + SCLP_STARTING_SUBINCREMENT_ID;

+    for (i = 0; i < assigned; i++) {
+
+        attach_info->entries[i] = cpu_to_be32(subincrement_id);
+
+        subincrement_id += SCLP_INCREMENT_UNIT;

     }

static void attach_storage_element(SCLPDevice *sclp, SCCB *sccb,

                                   uint16_t element)

{

    int i, assigned, subincrement_id;

    AttachStorageElement *attach_info = (AttachStorageElement *) sccb;

    sclpMemoryHotplugDev *mhd = get_sclp_memory_hotplug_dev();

    assert(mhd);

    if (element != 1) {

        sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_SCLP_COMMAND);

        return;

    }

    assigned = mhd->standby_mem_size >> mhd->increment_size;

    attach_info->assigned = cpu_to_be16(assigned);

    subincrement_id = ((ram_size >> mhd->increment_size) << 16)

                      + SCLP_STARTING_SUBINCREMENT_ID;

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

        attach_info->entries[i] = cpu_to_be32(subincrement_id);

        subincrement_id += SCLP_INCREMENT_UNIT;

    }

    sccb->h.response_code = cpu_to_be16(SCLP_RC_NORMAL_COMPLETION);

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
 static int scale_vector(int16_t *vector, int length)

+{

+    int bits, max = 0;
+
     int64_t scale;

+    int i;

+

static int scale_vector(int16_t *vector, int length)

{

    int bits, max = 0;

    int64_t scale;

    int i;

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

        max = FFMAX(max, FFABS(vector[i]));

    max   = FFMIN(max, 0x7FFF);

    bits  = normalize_bits(max, 15);

    scale = (bits == 15) ? 0x7FFF : (1 << bits);

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

        vector[i] = av_clipl_int32(vector[i] * scale << 1) >> 4;

    return bits - 3;

}


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

 {

+    AVCodecParameters *par = stream->codecpar;

static int sdp_parse_fmtp_config_h264(AVFormatContext *s,

                                      AVStream *stream,

                                      PayloadContext *h264_data,

                                      const char *attr, const char *value)

{

    AVCodecParameters *par = stream->codecpar;

    if (!strcmp(attr, "packetization-mode")) {

        av_log(s, AV_LOG_DEBUG, "RTP Packetization Mode: %d\n", atoi(value));

        h264_data->packetization_mode = atoi(value);

        /*

         * Packetization Mode:

         * 0 or not present: Single NAL mode (Only nals from 1-23 are allowed)

         * 1: Non-interleaved Mode: 1-23, 24 (STAP-A), 28 (FU-A) are allowed.

         * 2: Interleaved Mode: 25 (STAP-B), 26 (MTAP16), 27 (MTAP24), 28 (FU-A),

         *                      and 29 (FU-B) are allowed.

         */

        if (h264_data->packetization_mode > 1)

            av_log(s, AV_LOG_ERROR,

                   "Interleaved RTP mode is not supported yet.\n");

    } else if (!strcmp(attr, "profile-level-id")) {

        if (strlen(value) == 6)

            parse_profile_level_id(s, h264_data, value);

    } else if (!strcmp(attr, "sprop-parameter-sets")) {

        int ret;

        if (value[strlen(value) - 1] == ',') {

            av_log(s, AV_LOG_WARNING, "Missing PPS in sprop-parameter-sets, ignoring\n");

            return 0;

        }

        par->extradata_size = 0;

        av_freep(&par->extradata);

        ret = ff_h264_parse_sprop_parameter_sets(s, &par->extradata,

                                                 &par->extradata_size, value);

        av_log(s, AV_LOG_DEBUG, "Extradata set to %p (size: %d)\n",

               par->extradata, par->extradata_size);

        return ret;

    }

    return 0;

}


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

                                  uint8_t *base_lag_int, int subframe, enum Mode mode)

+{

     if (subframe == 0 || (subframe == 2 && mode != MODE_6k60)) {

@@ -10,7 +10,7 @@

             *lag_int  = (pitch_index + 69) >> 1;

+            *lag_frac = (pitch_index - (*lag_int << 1) + 68) << 1;

         } else {

static void decode_pitch_lag_low(int *lag_int, int *lag_frac, int pitch_index,

                                 uint8_t *base_lag_int, int subframe, enum Mode mode)

{

    if (subframe == 0 || (subframe == 2 && mode != MODE_6k60)) {

        if (pitch_index < 116) {

            *lag_int  = (pitch_index + 69) >> 1;

            *lag_frac = (pitch_index - (*lag_int << 1) + 68) << 1;

        } else {

            *lag_int  = pitch_index - 24;

            *lag_frac = 0;

        }

        // XXX: same problem as before

        *base_lag_int = av_clip(*lag_int - 8 - (*lag_frac < 0),

                                AMRWB_P_DELAY_MIN, AMRWB_P_DELAY_MAX - 15);

    } else {

        *lag_int  = (pitch_index + 1) >> 1;

        *lag_frac = (pitch_index - (*lag_int << 1)) << 1;

        *lag_int += *base_lag_int;

    }

}


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

         }

+    } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) {
+
+        if (!xen_enabled()) {
+
+            acpi_pcihp_device_plug_cb(hotplug_dev, &s->acpi_pci_hotplug, dev,

                                       errp);

static void piix4_device_plug_cb(HotplugHandler *hotplug_dev,

                                 DeviceState *dev, Error **errp)

{

    PIIX4PMState *s = PIIX4_PM(hotplug_dev);

    if (s->acpi_memory_hotplug.is_enabled &&

        object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {

        if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) {

            nvdimm_acpi_plug_cb(hotplug_dev, dev);

        } else {

            acpi_memory_plug_cb(hotplug_dev, &s->acpi_memory_hotplug,

                                dev, errp);

        }

    } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) {

        if (!xen_enabled()) {

            acpi_pcihp_device_plug_cb(hotplug_dev, &s->acpi_pci_hotplug, dev,

                                      errp);

        }

    } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) {

        if (s->cpu_hotplug_legacy) {

            legacy_acpi_cpu_plug_cb(hotplug_dev, &s->gpe_cpu, dev, errp);

        } else {

            acpi_cpu_plug_cb(hotplug_dev, &s->cpuhp_state, dev, errp);

        }

    } else {

        error_setg(errp, "acpi: device plug request for not supported device"

                   " type: %s", object_get_typename(OBJECT(dev)));

    }

}


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

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

+        if ((ret = exif_decode_tag(avctx, gbytes, le, depth, metadata)) < 0) {
+
+            return ret;
+
+        }

     }

int avpriv_exif_decode_ifd(AVCodecContext *avctx, GetByteContext *gbytes, int le,

                           int depth, AVDictionary **metadata)

{

    int i, ret;

    int entries;

    entries = ff_tget_short(gbytes, le);

    if (bytestream2_get_bytes_left(gbytes) < entries * 12) {

        return AVERROR_INVALIDDATA;

    }

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

        if ((ret = exif_decode_tag(avctx, gbytes, le, depth, metadata)) < 0) {

            return ret;

        }

    }

    // return next IDF offset or 0x000000000 or a value < 0 for failure

    return ff_tget_long(gbytes, le);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void increase_dynamic_storage(IVShmemState *s, int new_min_size) {

+
     int j, old_nb_alloc;

static void increase_dynamic_storage(IVShmemState *s, int new_min_size) {

    int j, old_nb_alloc;

    old_nb_alloc = s->nb_peers;

    while (new_min_size >= s->nb_peers)

        s->nb_peers = s->nb_peers * 2;

    IVSHMEM_DPRINTF("bumping storage to %d guests\n", s->nb_peers);

    s->peers = g_realloc(s->peers, s->nb_peers * sizeof(Peer));

    /* zero out new pointers */

    for (j = old_nb_alloc; j < s->nb_peers; j++) {

        s->peers[j].eventfds = NULL;

        s->peers[j].nb_eventfds = 0;

    }

}


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

     FlatRange *fr;

+    unsigned ioeventfd_nb = 0;

     MemoryRegionIoeventfd *ioeventfds = NULL;

static void address_space_update_ioeventfds(AddressSpace *as)

{

    FlatRange *fr;

    unsigned ioeventfd_nb = 0;

    MemoryRegionIoeventfd *ioeventfds = NULL;

    AddrRange tmp;

    unsigned i;

    FOR_EACH_FLAT_RANGE(fr, &as->current_map) {

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

            tmp = addrrange_shift(fr->mr->ioeventfds[i].addr,

                                  int128_sub(fr->addr.start,

                                             int128_make64(fr->offset_in_region)));

            if (addrrange_intersects(fr->addr, tmp)) {

                ++ioeventfd_nb;

                ioeventfds = g_realloc(ioeventfds,

                                          ioeventfd_nb * sizeof(*ioeventfds));

                ioeventfds[ioeventfd_nb-1] = fr->mr->ioeventfds[i];

                ioeventfds[ioeventfd_nb-1].addr = tmp;

            }

        }

    }

    address_space_add_del_ioeventfds(as, ioeventfds, ioeventfd_nb,

                                     as->ioeventfds, as->ioeventfd_nb);

    g_free(as->ioeventfds);

    as->ioeventfds = ioeventfds;

    as->ioeventfd_nb = ioeventfd_nb;

}


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

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

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

{

    AVFilterContext *ctx = inlink->dst;

    APadContext *apad = ctx->priv;

    if (apad->whole_len)

        apad->whole_len -= frame->nb_samples;

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

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

}


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

 {

+    uint8_t *status = shpc->config + SHPC_SLOT_STATUS(slot);
+
     return (pci_get_word(status) & msk) >> (ffs(msk) - 1);

 }

static uint16_t shpc_get_status(SHPCDevice *shpc, int slot, uint16_t msk)

{

    uint8_t *status = shpc->config + SHPC_SLOT_STATUS(slot);

    return (pci_get_word(status) & msk) >> (ffs(msk) - 1);

}


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

 {

+    int sh, sm, ss, sc, eh, em, es, ec;
+
     uint64_t start, end;

static int ass_get_duration(const uint8_t *p)

{

    int sh, sm, ss, sc, eh, em, es, ec;

    uint64_t start, end;

    if (sscanf(p, "%*[^,],%d:%d:%d%*c%d,%d:%d:%d%*c%d",

               &sh, &sm, &ss, &sc, &eh, &em, &es, &ec) != 8)

        return 0;

    start = 3600000*sh + 60000*sm + 1000*ss + 10*sc;

    end   = 3600000*eh + 60000*em + 1000*es + 10*ec;

    return end - start;

}


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

     if (qemu_put_kbd_event) {
+
+        qemu_put_kbd_event(qemu_put_kbd_event_opaque, keycode);
+
+    }

 }

void kbd_put_keycode(int keycode)

{

    if (!runstate_is_running()) {

        return;

    }

    if (qemu_put_kbd_event) {

        qemu_put_kbd_event(qemu_put_kbd_event_opaque, keycode);

    }

}


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

         if (ff_alsa_xrun_recover(s1, res) < 0) {

+            av_log(s1, AV_LOG_ERROR, "ALSA read error: %s\n",
+
+                   snd_strerror(res));
+
+            av_free_packet(pkt);

static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)

{

    AlsaData *s  = s1->priv_data;

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

    int res;

    snd_htimestamp_t timestamp;

    snd_pcm_uframes_t ts_delay;

    if (av_new_packet(pkt, s->period_size) < 0) {

        return AVERROR(EIO);

    }

    while ((res = snd_pcm_readi(s->h, pkt->data, pkt->size / s->frame_size)) < 0) {

        if (res == -EAGAIN) {

            av_free_packet(pkt);

            return AVERROR(EAGAIN);

        }

        if (ff_alsa_xrun_recover(s1, res) < 0) {

            av_log(s1, AV_LOG_ERROR, "ALSA read error: %s\n",

                   snd_strerror(res));

            av_free_packet(pkt);

            return AVERROR(EIO);

        }

    }

    snd_pcm_htimestamp(s->h, &ts_delay, &timestamp);

    ts_delay += res;

    pkt->pts = timestamp.tv_sec * 1000000LL

               + (timestamp.tv_nsec * st->codec->sample_rate

                  - ts_delay * 1000000000LL + st->codec->sample_rate * 500LL)

               / (st->codec->sample_rate * 1000LL);

    pkt->size = res * s->frame_size;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
     /* XXX: we assume that nb_sectors == 0 is suppored by the async read */

     if (sector_num == 0 && bs->boot_sector_enabled && nb_sectors > 0) {
+
+        memcpy(buf, bs->boot_sector_data, 512);
+
+        sector_num++;
+
         nb_sectors--;

         buf += 512;

BlockDriverAIOCB *bdrv_aio_read(BlockDriverState *bs, int64_t sector_num,

                                uint8_t *buf, int nb_sectors,

                                BlockDriverCompletionFunc *cb, void *opaque)

{

    BlockDriver *drv = bs->drv;

    BlockDriverAIOCB *ret;

    if (!drv)

        return NULL;

    /* XXX: we assume that nb_sectors == 0 is suppored by the async read */

    if (sector_num == 0 && bs->boot_sector_enabled && nb_sectors > 0) {

        memcpy(buf, bs->boot_sector_data, 512);

        sector_num++;

        nb_sectors--;

        buf += 512;

    }

    ret = drv->bdrv_aio_read(bs, sector_num, buf, nb_sectors, cb, opaque);

    if (ret) {

	/* Update stats even though technically transfer has not happened. */

	bs->rd_bytes += (unsigned) nb_sectors * SECTOR_SIZE;

	bs->rd_ops ++;

    }

    return ret;

}


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

 {

+    AVFilterContext *ctx = fs->parent;

     LUT2Context *s = fs->opaque;
+
     AVFilterLink *outlink = ctx->outputs[0];

     AVFrame *out, *srcx, *srcy;

static int process_frame(FFFrameSync *fs)

{

    AVFilterContext *ctx = fs->parent;

    LUT2Context *s = fs->opaque;

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

    AVFrame *out, *srcx, *srcy;

    int ret;

    if ((ret = ff_framesync2_get_frame(&s->fs, 0, &srcx, 0)) < 0 ||

        (ret = ff_framesync2_get_frame(&s->fs, 1, &srcy, 0)) < 0)

        return ret;

    if (ctx->is_disabled) {

        out = av_frame_clone(srcx);

        if (!out)

            return AVERROR(ENOMEM);

    } else {

        out = ff_get_video_buffer(outlink, outlink->w, outlink->h);

        if (!out)

            return AVERROR(ENOMEM);

        av_frame_copy_props(out, srcx);

        s->lut2(s, out, srcx, srcy);

    }

    out->pts = av_rescale_q(s->fs.pts, s->fs.time_base, outlink->time_base);

    return ff_filter_frame(outlink, out);

}


void ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number)

{

    int full_frame= 0;

    avpriv_align_put_bits(&s->pb);

    put_bits(&s->pb, 1, 1);     /* marker */

    put_bits(&s->pb, 1, (s->pict_type == AV_PICTURE_TYPE_P));

    put_bits(&s->pb, 1, 0);     /* not PB frame */

    put_bits(&s->pb, 5, s->qscale);

    if (s->pict_type == AV_PICTURE_TYPE_I) {

        /* specific MPEG like DC coding not used */

    }

    /* if multiple packets per frame are sent, the position at which

       to display the macroblocks is coded here */

    if(!full_frame){

        put_bits(&s->pb, 6, 0); /* mb_x */

        put_bits(&s->pb, 6, 0); /* mb_y */

        put_bits(&s->pb, 12, s->mb_width * s->mb_height);

    }

    put_bits(&s->pb, 3, 0);     /* ignored */

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
                   *abuf1 = hasAlpha ? abuf[1] : NULL;
     int  yalpha1 = 4095 - yalpha;
     int uvalpha1 = 4095 - uvalpha;
+    int i;
+    for (i = 0; i < (dstW >> 1); i++) {
+        int Y1 = (buf0[i * 2]     * yalpha1  + buf1[i * 2]     * yalpha)  >> 19;
+        int Y2 = (buf0[i * 2 + 1] * yalpha1  + buf1[i * 2 + 1] * yalpha)  >> 19;
+        int U  = (ubuf0[i]        * uvalpha1 + ubuf1[i]        * uvalpha) >> 19;
         int V  = (vbuf0[i]        * uvalpha1 + vbuf1[i]        * uvalpha) >> 19;
         int A1, A2;
         const void *r =  c->table_rV[V],

yuv2rgb_2_c_template(SwsContext *c, const int16_t *buf[2],
                     const int16_t *ubuf[2], const int16_t *vbuf[2],
                     const int16_t *abuf[2], uint8_t *dest, int dstW,
                     int yalpha, int uvalpha, int y,
                     enum PixelFormat target, int hasAlpha)
{
    const int16_t *buf0  = buf[0],  *buf1  = buf[1],
                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
                  *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],
                  *abuf0 = hasAlpha ? abuf[0] : NULL,
                  *abuf1 = hasAlpha ? abuf[1] : NULL;
    int  yalpha1 = 4095 - yalpha;
    int uvalpha1 = 4095 - uvalpha;
    int i;
    for (i = 0; i < (dstW >> 1); i++) {
        int Y1 = (buf0[i * 2]     * yalpha1  + buf1[i * 2]     * yalpha)  >> 19;
        int Y2 = (buf0[i * 2 + 1] * yalpha1  + buf1[i * 2 + 1] * yalpha)  >> 19;
        int U  = (ubuf0[i]        * uvalpha1 + ubuf1[i]        * uvalpha) >> 19;
        int V  = (vbuf0[i]        * uvalpha1 + vbuf1[i]        * uvalpha) >> 19;
        int A1, A2;
        const void *r =  c->table_rV[V],
                   *g = (c->table_gU[U] + c->table_gV[V]),
                   *b =  c->table_bU[U];
        if (hasAlpha) {
            A1 = (abuf0[i * 2    ] * yalpha1 + abuf1[i * 2    ] * yalpha) >> 19;
            A2 = (abuf0[i * 2 + 1] * yalpha1 + abuf1[i * 2 + 1] * yalpha) >> 19;
        }
        yuv2rgb_write(dest, i, Y1, Y2, hasAlpha ? A1 : 0, hasAlpha ? A2 : 0,
                      r, g, b, y, target, hasAlpha);
    }
}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 uint64_t HELPER(neon_abdl_u32)(uint32_t a, uint32_t b)

 {
+
+    uint64_t tmp;

     uint64_t result;

uint64_t HELPER(neon_abdl_u32)(uint32_t a, uint32_t b)

{

    uint64_t tmp;

    uint64_t result;

    DO_ABD(result, a, b, uint16_t);

    DO_ABD(tmp, a >> 16, b >> 16, uint16_t);

    return result | (tmp << 32);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void qvirtio_pci_device_disable(QVirtioPCIDevice *d)
+
+{

     qpci_iounmap(d->pdev, d->addr);

void qvirtio_pci_device_disable(QVirtioPCIDevice *d)

{

    qpci_iounmap(d->pdev, d->addr);

    d->addr = NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 const char *qemu_get_version(void)
+
 {

     return qemu_version;

const char *qemu_get_version(void)

{

    return qemu_version;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void cpu_exit(CPUState *cpu)
+
 {
+
     cpu->exit_request = 1;

     /* Ensure cpu_exec will see the exit request after TCG has exited.  */

void cpu_exit(CPUState *cpu)

{

    cpu->exit_request = 1;

    /* Ensure cpu_exec will see the exit request after TCG has exited.  */

    smp_wmb();

    cpu->tcg_exit_req = 1;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void spapr_add_lmbs(DeviceState *dev, uint64_t addr, uint64_t size,

                            uint32_t node, Error **errp)

@@ -14,7 +14,7 @@

     void *fdt;

+

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

static void spapr_add_lmbs(DeviceState *dev, uint64_t addr, uint64_t size,

                           uint32_t node, Error **errp)

{

    sPAPRDRConnector *drc;

    sPAPRDRConnectorClass *drck;

    uint32_t nr_lmbs = size/SPAPR_MEMORY_BLOCK_SIZE;

    int i, fdt_offset, fdt_size;

    void *fdt;

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

        drc = spapr_dr_connector_by_id(SPAPR_DR_CONNECTOR_TYPE_LMB,

                addr/SPAPR_MEMORY_BLOCK_SIZE);

        g_assert(drc);

        fdt = create_device_tree(&fdt_size);

        fdt_offset = spapr_populate_memory_node(fdt, node, addr,

                                                SPAPR_MEMORY_BLOCK_SIZE);

        drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);

        drck->attach(drc, dev, fdt, fdt_offset, !dev->hotplugged, errp);

        addr += SPAPR_MEMORY_BLOCK_SIZE;

    }

    /* send hotplug notification to the

     * guest only in case of hotplugged memory

     */

    if (dev->hotplugged) {

       spapr_hotplug_req_add_by_count(SPAPR_DR_CONNECTOR_TYPE_LMB, nr_lmbs);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
 int boot_sector_init(char *fname)

+{

     int fd, ret;

     size_t len = sizeof boot_sector;

+
+
     fd = mkstemp(fname);
+
     if (fd < 0) {

         fprintf(stderr, "Couldn't open \"%s\": %s", fname, strerror(errno));

int boot_sector_init(char *fname)

{

    int fd, ret;

    size_t len = sizeof boot_sector;

    fd = mkstemp(fname);

    if (fd < 0) {

        fprintf(stderr, "Couldn't open \"%s\": %s", fname, strerror(errno));

        return 1;

    }

    /* For Open Firmware based system, we can use a Forth script instead */

    if (strcmp(qtest_get_arch(), "ppc64") == 0) {

        len = sprintf((char *)boot_sector, "\\ Bootscript\n%x %x c! %x %x c!\n",

                LOW(SIGNATURE), BOOT_SECTOR_ADDRESS + SIGNATURE_OFFSET,

                HIGH(SIGNATURE), BOOT_SECTOR_ADDRESS + SIGNATURE_OFFSET + 1);

    }

    ret = write(fd, boot_sector, len);

    close(fd);

    if (ret != len) {

        fprintf(stderr, "Could not write \"%s\"", fname);

        return 1;

    }

    return 0;

}


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

     uint16_t val;

static uint16_t eepro100_read2(EEPRO100State * s, uint32_t addr)

{

    uint16_t val;

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

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

    }

    switch (addr) {

    case SCBStatus:

    case SCBCmd:

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

        break;

    case SCBeeprom:

        val = eepro100_read_eeprom(s);

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

        break;

    default:

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

        missing("unknown word read");

    }

    return val;

}


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

     fd_set fdset = dispr->fdset;
+
+

     /* wait until some of sockets become readable. */

dispatcher_wait(Dispatcher *dispr, uint32_t timeout)

{

    struct timeval tv;

    tv.tv_sec = timeout / 1000000;

    tv.tv_usec = timeout % 1000000;

    fd_set fdset = dispr->fdset;

    /* wait until some of sockets become readable. */

    int rc = select(dispr->max_sock + 1, &fdset, 0, 0, &tv);

    if (rc == -1) {

        vubr_die("select");

    }

    /* Timeout */

    if (rc == 0) {

        return 0;

    }

    /* Now call callback for every ready socket. */

    int sock;

    for (sock = 0; sock < dispr->max_sock + 1; sock++)

        if (FD_ISSET(sock, &fdset)) {

            Event *e = &dispr->events[sock];

            e->callback(sock, e->ctx);

        }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,20 +1,20 @@
 static void do_interrupt_user(CPUX86State *env, int intno, int is_int,
+
+                              int error_code, target_ulong next_eip)
+
+{
+
+    SegmentCache *dt;
+
     target_ulong ptr;
+
     int dpl, cpl, shift;
+
+    uint32_t e2;
+
+
+
+    dt = &env->idt;

     if (env->hflags & HF_LMA_MASK) {

static void do_interrupt_user(CPUX86State *env, int intno, int is_int,

                              int error_code, target_ulong next_eip)

{

    SegmentCache *dt;

    target_ulong ptr;

    int dpl, cpl, shift;

    uint32_t e2;

    dt = &env->idt;

    if (env->hflags & HF_LMA_MASK) {

        shift = 4;

    } else {

        shift = 3;

    }

    ptr = dt->base + (intno << shift);

    e2 = cpu_ldl_kernel(env, ptr + 4);

    dpl = (e2 >> DESC_DPL_SHIFT) & 3;

    cpl = env->hflags & HF_CPL_MASK;

    /* check privilege if software int */

    if (is_int && dpl < cpl) {

        raise_exception_err(env, EXCP0D_GPF, (intno << shift) + 2);

    }

    /* Since we emulate only user space, we cannot do more than

       exiting the emulation with the suitable exception and error

       code. So update EIP for INT 0x80 and EXCP_SYSCALL. */

    if (is_int || intno == EXCP_SYSCALL) {

        env->eip = next_eip;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,19 +1,19 @@
+static QPCIDevice *get_ahci_device(uint32_t *fingerprint)
+
+{
+
+    QPCIDevice *ahci;
+
+    uint32_t ahci_fingerprint;
+
+    QPCIBus *pcibus;
+
+

+    pcibus = qpci_init_pc();
+

+
     /* Find the AHCI PCI device and verify it's the right one. */

     ahci = qpci_device_find(pcibus, QPCI_DEVFN(0x1F, 0x02));

static QPCIDevice *get_ahci_device(uint32_t *fingerprint)

{

    QPCIDevice *ahci;

    uint32_t ahci_fingerprint;

    QPCIBus *pcibus;

    pcibus = qpci_init_pc();

    /* Find the AHCI PCI device and verify it's the right one. */

    ahci = qpci_device_find(pcibus, QPCI_DEVFN(0x1F, 0x02));

    g_assert(ahci != NULL);

    ahci_fingerprint = qpci_config_readl(ahci, PCI_VENDOR_ID);

    switch (ahci_fingerprint) {

    case AHCI_INTEL_ICH9:

        break;

    default:

        /* Unknown device. */

        g_assert_not_reached();

    }

    if (fingerprint) {

        *fingerprint = ahci_fingerprint;

    }

    return ahci;

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
      * for(i=0 ; i<bitamount/64 ; i++)

      *     (int64_t)out[i] = 0x37c511f237c511f2^av_be2ne64(int64_t)in[i]);
+
+     * Buffer alignment needs to be checked. */
+
+
+
     off = (intptr_t)inbuffer & 3;

     buf = (const uint32_t*) (inbuffer - off);

static inline int decode_bytes(const uint8_t* inbuffer, uint8_t* out, int bytes){

    int i, off;

    uint32_t c;

    const uint32_t* buf;

    uint32_t* obuf = (uint32_t*) out;

    /* FIXME: 64 bit platforms would be able to do 64 bits at a time.

     * I'm too lazy though, should be something like

     * for(i=0 ; i<bitamount/64 ; i++)

     *     (int64_t)out[i] = 0x37c511f237c511f2^av_be2ne64(int64_t)in[i]);

     * Buffer alignment needs to be checked. */

    off = (intptr_t)inbuffer & 3;

    buf = (const uint32_t*) (inbuffer - off);

    c = av_be2ne32((0x37c511f2 >> (off*8)) | (0x37c511f2 << (32-(off*8))));

    bytes += 3 + off;

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

        obuf[i] = c ^ buf[i];

    return off;

}


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

     return 128;

static int term_can_read(void *opaque)

{

    return 128;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int rac_get_model_sym(RangeCoder *c, Model *m)
+
 {

     int prob, prob2, helper, val;

static int rac_get_model_sym(RangeCoder *c, Model *m)

{

    int prob, prob2, helper, val;

    int end, end2;

    prob       = 0;

    prob2      = c->range;

    c->range >>= MODEL_SCALE;

    val        = 0;

    end        = m->num_syms >> 1;

    end2       = m->num_syms;

    do {

        helper = m->freqs[end] * c->range;

        if (helper <= c->low) {

            val   = end;

            prob  = helper;

        } else {

            end2  = end;

            prob2 = helper;

        }

        end = (end2 + val) >> 1;

    } while (end != val);

    c->low  -= prob;

    c->range = prob2 - prob;

    if (c->range < RAC_BOTTOM)

        rac_normalise(c);

    model_update(m, val);

    return val;

}


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

     union semun semun;

+    struct semid_ds semid_ds;

     int i, ret;

static inline abi_long target_to_host_semarray(int semid, unsigned short **host_array,

                                               abi_ulong target_addr)

{

    int nsems;

    unsigned short *array;

    union semun semun;

    struct semid_ds semid_ds;

    int i, ret;

    semun.buf = &semid_ds;

    ret = semctl(semid, 0, IPC_STAT, semun);

    if (ret == -1)

        return get_errno(ret);

    nsems = semid_ds.sem_nsems;

    *host_array = malloc(nsems*sizeof(unsigned short));

    array = lock_user(VERIFY_READ, target_addr,

                      nsems*sizeof(unsigned short), 1);

    if (!array)

        return -TARGET_EFAULT;

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

        __get_user((*host_array)[i], &array[i]);

    }

    unlock_user(array, target_addr, 0);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,5 +5,5 @@
     /* No possible exceptions converting int to double.  */

     return int32_to_float64(src, &env->fp_status);
+
+}

float64 helper_fitod(CPUSPARCState *env, int32_t src)

{

    /* No possible exceptions converting int to double.  */

    return int32_to_float64(src, &env->fp_status);

}


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

     DeviceState *dev;
+
     SysBusDevice *s;

     GrackleState *d;

PCIBus *pci_grackle_init(uint32_t base, qemu_irq *pic)

{

    DeviceState *dev;

    SysBusDevice *s;

    GrackleState *d;

    dev = qdev_create(NULL, "grackle");

    qdev_init(dev);

    s = sysbus_from_qdev(dev);

    d = FROM_SYSBUS(GrackleState, s);

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

                                         pci_grackle_set_irq,

                                         pci_grackle_map_irq,

                                         pic, 0, 4);

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

    sysbus_mmio_map(s, 0, base);

    sysbus_mmio_map(s, 1, base + 0x00200000);

    return d->host_state.bus;

}


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

+{

     BlockDriverState *bs = opaque;

static void nbd_restart_write(void *opaque)

{

    BlockDriverState *bs = opaque;

    qemu_coroutine_enter(nbd_get_client_session(bs)->send_coroutine, NULL);

}


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

     const char *str = "";
+
+    int64_t res = 999;

     int err;

static void test_qemu_strtoll_full_empty(void)

{

    const char *str = "";

    int64_t res = 999;

    int err;

    err = qemu_strtoll(str, NULL, 0, &res);

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, 0);

}


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

             g_malloc0(sizeof(struct omap_gpmc_s));

+
+
+    memory_region_init_io(&s->iomem, &omap_gpmc_ops, s, "omap-gpmc", 0x1000);
+
+    memory_region_add_subregion(get_system_memory(), base, &s->iomem);

struct omap_gpmc_s *omap_gpmc_init(target_phys_addr_t base, qemu_irq irq)

{

    struct omap_gpmc_s *s = (struct omap_gpmc_s *)

            g_malloc0(sizeof(struct omap_gpmc_s));

    memory_region_init_io(&s->iomem, &omap_gpmc_ops, s, "omap-gpmc", 0x1000);

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

    omap_gpmc_reset(s);

    return s;

}


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

         hw_error("CPU can only have one NVIC\n");

+    env->v7m.nvic = s;
+
+    register_savevm("armv7m_nvic", -1, 1, nvic_save, nvic_load, s);
+
+}

static void armv7m_nvic_init(SysBusDevice *dev)

{

    nvic_state *s= FROM_SYSBUSGIC(nvic_state, dev);

    CPUState *env;

    env = qdev_get_prop_ptr(&dev->qdev, "cpu");

    gic_init(&s->gic);

    cpu_register_physical_memory(0xe000e000, 0x1000, s->gic.iomemtype);

    s->systick.timer = qemu_new_timer(vm_clock, systick_timer_tick, s);

    if (env->v7m.nvic)

        hw_error("CPU can only have one NVIC\n");

    env->v7m.nvic = s;

    register_savevm("armv7m_nvic", -1, 1, nvic_save, nvic_load, s);

}


--- a/source.c
+++ b/source.c
@@ -32,11 +32,11 @@
         c->factor        = factor;
         c->filter_length = FFMAX((int)ceil(filter_size/factor), 1);
         c->filter_alloc  = FFALIGN(c->filter_length, 8);
+        c->filter_bank   = av_calloc(c->filter_alloc, (phase_count+1)*c->felem_size);
+        c->filter_type   = filter_type;
+        c->kaiser_beta   = kaiser_beta;
+        if (!c->filter_bank)
+        if (build_filter(c, (void*)c->filter_bank, factor, c->filter_length, c->filter_alloc, phase_count, 1<<c->filter_shift, filter_type, kaiser_beta))
         memcpy(c->filter_bank + (c->filter_alloc*phase_count+1)*c->felem_size, c->filter_bank, (c->filter_alloc-1)*c->felem_size);
         memcpy(c->filter_bank + (c->filter_alloc*phase_count  )*c->felem_size, c->filter_bank + (c->filter_alloc - 1)*c->felem_size, c->felem_size);
     c->compensation_distance= 0;

static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear,
                                    double cutoff0, enum AVSampleFormat format, enum SwrFilterType filter_type, int kaiser_beta,
                                    double precision, int cheby){
    double cutoff = cutoff0? cutoff0 : 0.97;
    double factor= FFMIN(out_rate * cutoff / in_rate, 1.0);
    int phase_count= 1<<phase_shift;
    if (!c || c->phase_shift != phase_shift || c->linear!=linear || c->factor != factor
           || c->filter_length != FFMAX((int)ceil(filter_size/factor), 1) || c->format != format
           || c->filter_type != filter_type || c->kaiser_beta != kaiser_beta) {
        c = av_mallocz(sizeof(*c));
        if (!c)
            return NULL;
        c->format= format;
        c->felem_size= av_get_bytes_per_sample(c->format);
        switch(c->format){
        case AV_SAMPLE_FMT_S16P:
            c->filter_shift = 15;
            break;
        case AV_SAMPLE_FMT_S32P:
            c->filter_shift = 30;
            break;
        case AV_SAMPLE_FMT_FLTP:
        case AV_SAMPLE_FMT_DBLP:
            c->filter_shift = 0;
            break;
        default:
            av_log(NULL, AV_LOG_ERROR, "Unsupported sample format\n");
            av_assert0(0);
        c->phase_shift   = phase_shift;
        c->phase_mask    = phase_count - 1;
        c->linear        = linear;
        c->factor        = factor;
        c->filter_length = FFMAX((int)ceil(filter_size/factor), 1);
        c->filter_alloc  = FFALIGN(c->filter_length, 8);
        c->filter_bank   = av_calloc(c->filter_alloc, (phase_count+1)*c->felem_size);
        c->filter_type   = filter_type;
        c->kaiser_beta   = kaiser_beta;
        if (!c->filter_bank)
        if (build_filter(c, (void*)c->filter_bank, factor, c->filter_length, c->filter_alloc, phase_count, 1<<c->filter_shift, filter_type, kaiser_beta))
        memcpy(c->filter_bank + (c->filter_alloc*phase_count+1)*c->felem_size, c->filter_bank, (c->filter_alloc-1)*c->felem_size);
        memcpy(c->filter_bank + (c->filter_alloc*phase_count  )*c->felem_size, c->filter_bank + (c->filter_alloc - 1)*c->felem_size, c->felem_size);
    c->compensation_distance= 0;
    if(!av_reduce(&c->src_incr, &c->dst_incr, out_rate, in_rate * (int64_t)phase_count, INT32_MAX/2))
    c->ideal_dst_incr= c->dst_incr;
    c->index= -phase_count*((c->filter_length-1)/2);
    c->frac= 0;
    return c;
error:
    av_freep(&c->filter_bank);
    av_free(c);
    return NULL;


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 av_cold int ff_vp8_decode_free(AVCodecContext *avctx)
+{
+    VP8Context *s = avctx->priv_data;
     int i;
     vp8_decode_flush_impl(avctx, 1);
     for (i = 0; i < FF_ARRAY_ELEMS(s->frames); i++)

av_cold int ff_vp8_decode_free(AVCodecContext *avctx)
{
    VP8Context *s = avctx->priv_data;
    int i;
    vp8_decode_flush_impl(avctx, 1);
    for (i = 0; i < FF_ARRAY_ELEMS(s->frames); i++)
        av_frame_free(&s->frames[i].tf.f);
}


int64_t qemu_get_clock_ns(QEMUClock *clock)

{

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     ssize_t ret = qemu_paio_return(aiocb);

+
+    if (ret < 0)
+
+        ret = -ret;
+
     else

         ret = 0;

int qemu_paio_error(struct qemu_paiocb *aiocb)

{

    ssize_t ret = qemu_paio_return(aiocb);

    if (ret < 0)

        ret = -ret;

    else

        ret = 0;

    return ret;

}


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

+

     for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {

static void quantize_mantissas(AC3EncodeContext *s)

{

    int blk, ch;

    for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {

        AC3Block *block = &s->blocks[blk];

        s->mant1_cnt  = s->mant2_cnt  = s->mant4_cnt  = 0;

        s->qmant1_ptr = s->qmant2_ptr = s->qmant4_ptr = NULL;

        for (ch = 0; ch < s->channels; ch++) {

            quantize_mantissas_blk_ch(s, block->fixed_coef[ch], block->exp_shift[ch],

                                      block->exp[ch], block->bap[ch],

                                      block->qmant[ch], s->nb_coefs[ch]);

        }

    }

}


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

                               unsigned len)

+{

     OpenPICState *opp = opaque;

static void openpic_src_write(void *opaque, hwaddr addr, uint64_t val,

                              unsigned len)

{

    OpenPICState *opp = opaque;

    int idx;

    DPRINTF("%s: addr %08x <= %08x\n", __func__, addr, val);

    if (addr & 0xF)

        return;

    addr = addr & 0xFFF0;

    idx = addr >> 5;

    if (addr & 0x10) {

        /* EXDE / IFEDE / IEEDE */

        write_IRQreg_ide(opp, idx, val);

    } else {

        /* EXVP / IFEVP / IEEVP */

        write_IRQreg_ipvp(opp, idx, val);

    }

}


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

 {

+    HWVoiceIn *hw = NULL;
+

     while ((hw = audio_pcm_hw_find_any_enabled_in (hw))) {

static void audio_run_in (AudioState *s)

{

    HWVoiceIn *hw = NULL;

    while ((hw = audio_pcm_hw_find_any_enabled_in (hw))) {

        SWVoiceIn *sw;

        int captured, min;

        captured = hw->pcm_ops->run_in (hw);

        min = audio_pcm_hw_find_min_in (hw);

        hw->total_samples_captured += captured - min;

        hw->ts_helper += captured;

        for (sw = hw->sw_head.lh_first; sw; sw = sw->entries.le_next) {

            sw->total_hw_samples_acquired -= min;

            if (sw->active) {

                int avail;

                avail = audio_get_avail (sw);

                if (avail > 0) {

                    sw->callback.fn (sw->callback.opaque, avail);

                }

            }

        }

    }

}


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

         return AVERROR_NOMEM;
+
+    if (ap) {
+
+        id = s->iformat->value;
+
         if (id == CODEC_ID_RAWVIDEO) {

             st->codec->codec_type = CODEC_TYPE_VIDEO;

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

{

    AVStream *st;

    int id;

    st = av_new_stream(s, 0);

    if (!st)

        return AVERROR_NOMEM;

    if (ap) {

        id = s->iformat->value;

        if (id == CODEC_ID_RAWVIDEO) {

            st->codec->codec_type = CODEC_TYPE_VIDEO;

        } else {

            st->codec->codec_type = CODEC_TYPE_AUDIO;

        }

        st->codec->codec_id = id;

        switch(st->codec->codec_type) {

        case CODEC_TYPE_AUDIO:

            st->codec->sample_rate = ap->sample_rate;

            st->codec->channels = ap->channels;

            av_set_pts_info(st, 64, 1, st->codec->sample_rate);

            break;

        case CODEC_TYPE_VIDEO:

            av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);

            st->codec->width = ap->width;

            st->codec->height = ap->height;

            st->codec->pix_fmt = ap->pix_fmt;

            if(st->codec->pix_fmt == PIX_FMT_NONE)

                st->codec->pix_fmt= PIX_FMT_YUV420P;

            break;

        default:

            return -1;

        }

    } else {

        return -1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void blend_image_rgb(AVFilterContext *ctx, AVFrame *dst, const AVFrame *src, int x, int y)

+{

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

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

{

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

}


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

     BFIContext *bfi = avctx->priv_data;

+    avctx->pix_fmt  = AV_PIX_FMT_PAL8;
+
+    bfi->dst        = av_mallocz(avctx->width * avctx->height);

static av_cold int bfi_decode_init(AVCodecContext *avctx)

{

    BFIContext *bfi = avctx->priv_data;

    avctx->pix_fmt  = AV_PIX_FMT_PAL8;

    bfi->dst        = av_mallocz(avctx->width * avctx->height);

    return 0;

}


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

 {

+    return bdrv_get_block_status_above(bs, backing_bs(bs),
+
+                                       sector_num, nb_sectors, pnum);

 }

int64_t bdrv_get_block_status(BlockDriverState *bs,

                              int64_t sector_num,

                              int nb_sectors, int *pnum)

{

    return bdrv_get_block_status_above(bs, backing_bs(bs),

                                       sector_num, nb_sectors, pnum);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 int qemu_chr_fe_ioctl(CharDriverState *s, int cmd, void *arg)
+
+{

     if (!s->chr_ioctl)

int qemu_chr_fe_ioctl(CharDriverState *s, int cmd, void *arg)

{

    if (!s->chr_ioctl)

        return -ENOTSUP;

    return s->chr_ioctl(s, cmd, arg);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static inline void downmix_mono_to_stereo(float *samples)

 {
+
+    int i;
+

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

static inline void downmix_mono_to_stereo(float *samples)

{

    int i;

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

        samples[i + 256] = samples[i];

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 BlockDeviceInfoList *qmp_query_named_block_nodes(Error **errp)
+
 {

     return bdrv_named_nodes_list();

BlockDeviceInfoList *qmp_query_named_block_nodes(Error **errp)

{

    return bdrv_named_nodes_list();

}


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

     /* Free allocated memory buffers. */
+
+    av_free(q->mlt_window);
+
+    av_free(q->mlt_precos);
+
     av_free(q->mlt_presin);

     av_free(q->mlt_postcos);

static int cook_decode_close(AVCodecContext *avctx)

{

    int i;

    COOKContext *q = avctx->priv_data;

    av_log(NULL,AV_LOG_DEBUG, "Deallocating memory.\n");

    /* Free allocated memory buffers. */

    av_free(q->mlt_window);

    av_free(q->mlt_precos);

    av_free(q->mlt_presin);

    av_free(q->mlt_postcos);

    av_free(q->frame_reorder_index);

    av_free(q->frame_reorder_buffer);

    av_free(q->decoded_bytes_buffer);

    /* Free the transform. */

    ff_fft_end(&q->fft_ctx);

    /* Free the VLC tables. */

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

        free_vlc(&q->envelope_quant_index[i]);

    }

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

        free_vlc(&q->sqvh[i]);

    }

    if(q->nb_channels==2 && q->joint_stereo==1 ){

        free_vlc(&q->ccpl);

    }

    av_log(NULL,AV_LOG_DEBUG,"Memory deallocated.\n");

    return 0;

}


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

+
     if (nb_args != 2) {

         return;

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

{

    int len, count, i;

    NetClientState *ncs[MAX_QUEUE_NUM];

    if (nb_args != 2) {

        return;

    }

    len = strlen(str);

    readline_set_completion_index(rs, len);

    count = qemu_find_net_clients_except(NULL, ncs, NET_CLIENT_OPTIONS_KIND_NIC,

                                         MAX_QUEUE_NUM);

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

        QemuOpts *opts;

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

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

            continue;

        }

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

        if (opts) {

            readline_add_completion(rs, name);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 int qcrypto_cipher_setiv(QCryptoCipher *cipher,

+                         const uint8_t *iv, size_t niv,
+
                          Error **errp)

 {

int qcrypto_cipher_setiv(QCryptoCipher *cipher,

                         const uint8_t *iv, size_t niv,

                         Error **errp)

{

    QCryptoCipherNettle *ctx = cipher->opaque;

    if (niv != ctx->niv) {

        error_setg(errp, "Expected IV size %zu not %zu",

                   ctx->niv, niv);

        return -1;

    }

    memcpy(ctx->iv, iv, niv);

    return 0;

}


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

         return ret;

+    pkt->stream_index = 0;
+
+    return ret;
+
+}

static int iff_read_packet(AVFormatContext *s,

                           AVPacket *pkt)

{

    IffDemuxContext *iff = s->priv_data;

    AVIOContext *pb = s->pb;

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

    int ret;

    int64_t pos = avio_tell(pb);

    if (pos >= iff->body_end)

        return AVERROR_EOF;

    if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {

        if (st->codec->codec_tag == ID_MAUD) {

            ret = av_get_packet(pb, pkt, FFMIN(iff->body_end - pos, 1024 * st->codec->block_align));

        } else {

            ret = av_get_packet(pb, pkt, iff->body_size);

        }

    } else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {

        uint8_t *buf;

        if (av_new_packet(pkt, iff->body_size + 2) < 0) {

            return AVERROR(ENOMEM);

        }

        buf = pkt->data;

        bytestream_put_be16(&buf, 2);

        ret = avio_read(pb, buf, iff->body_size);

    } else {

        av_assert0(0);

    }

    if (pos == iff->body_pos)

        pkt->flags |= AV_PKT_FLAG_KEY;

    if (ret < 0)

        return ret;

    pkt->stream_index = 0;

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,16 +1,16 @@
 void rgb24tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
+
+{

+	long i;
+
+	for(i=0; 3*i<src_size; i++)
+
+	{
+
+		#ifdef WORDS_BIGENDIAN
+
+			/* RGB24 (= R,G,B) -> BGR32 (= A,R,G,B) */

 			dst[4*i + 0] = 0;

void rgb24tobgr32(const uint8_t *src, uint8_t *dst, long src_size)

{

	long i;

	for(i=0; 3*i<src_size; i++)

	{

		#ifdef WORDS_BIGENDIAN

			/* RGB24 (= R,G,B) -> BGR32 (= A,R,G,B) */

			dst[4*i + 0] = 0;

			dst[4*i + 1] = src[3*i + 0];

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

			dst[4*i + 3] = src[3*i + 2];

		#else

			dst[4*i + 0] = src[3*i + 2];

			dst[4*i + 1] = src[3*i + 1];

			dst[4*i + 2] = src[3*i + 0];

			dst[4*i + 3] = 0;

		#endif

	}

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static int megasas_handle_dcmd(MegasasState *s, MegasasCmd *cmd)
+
 {

     int opcode, len;

+    int retval = 0;
+
     const struct dcmd_cmd_tbl_t *cmdptr = dcmd_cmd_tbl;

static int megasas_handle_dcmd(MegasasState *s, MegasasCmd *cmd)

{

    int opcode, len;

    int retval = 0;

    const struct dcmd_cmd_tbl_t *cmdptr = dcmd_cmd_tbl;

    opcode = le32_to_cpu(cmd->frame->dcmd.opcode);

    trace_megasas_handle_dcmd(cmd->index, opcode);

    len = megasas_map_dcmd(s, cmd);

    if (len < 0) {

        return MFI_STAT_MEMORY_NOT_AVAILABLE;

    }

    while (cmdptr->opcode != -1 && cmdptr->opcode != opcode) {

        cmdptr++;

    }

    if (cmdptr->opcode == -1) {

        trace_megasas_dcmd_unhandled(cmd->index, opcode, len);

        retval = megasas_dcmd_dummy(s, cmd);

    } else {

        trace_megasas_dcmd_enter(cmd->index, cmdptr->desc, len);

        retval = cmdptr->func(s, cmd);

    }

    if (retval != MFI_STAT_INVALID_STATUS) {

        megasas_finish_dcmd(cmd, len);

    }

    return retval;

}


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

     g_assert_cmpint(udnp1->dict1->dict2->userdef->base->integer, ==,

+                    udnp2->dict1->dict2->userdef->base->integer);
+
+    g_assert_cmpstr(udnp1->dict1->dict2->userdef->string, ==,
+
+                    udnp2->dict1->dict2->userdef->string);

     g_assert_cmpstr(udnp1->dict1->dict2->string, ==,

static void nested_struct_compare(UserDefTwo *udnp1, UserDefTwo *udnp2)

{

    g_assert(udnp1);

    g_assert(udnp2);

    g_assert_cmpstr(udnp1->string0, ==, udnp2->string0);

    g_assert_cmpstr(udnp1->dict1->string1, ==, udnp2->dict1->string1);

    g_assert_cmpint(udnp1->dict1->dict2->userdef->base->integer, ==,

                    udnp2->dict1->dict2->userdef->base->integer);

    g_assert_cmpstr(udnp1->dict1->dict2->userdef->string, ==,

                    udnp2->dict1->dict2->userdef->string);

    g_assert_cmpstr(udnp1->dict1->dict2->string, ==,

                    udnp2->dict1->dict2->string);

    g_assert(udnp1->dict1->has_dict3 == udnp2->dict1->has_dict3);

    g_assert_cmpint(udnp1->dict1->dict3->userdef->base->integer, ==,

                    udnp2->dict1->dict3->userdef->base->integer);

    g_assert_cmpstr(udnp1->dict1->dict3->userdef->string, ==,

                    udnp2->dict1->dict3->userdef->string);

    g_assert_cmpstr(udnp1->dict1->dict3->string, ==,

                    udnp2->dict1->dict3->string);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static bool pc_machine_get_vmport(Object *obj, Error **errp)

 {
+
+    PCMachineState *pcms = PC_MACHINE(obj);

static bool pc_machine_get_vmport(Object *obj, Error **errp)

{

    PCMachineState *pcms = PC_MACHINE(obj);

    return pcms->vmport;

}