--- a/source.c
+++ b/source.c
@@ -1,22 +1,22 @@
 static void print_type_size(Visitor *v, uint64_t *obj, const char *name,

+                           Error **errp)

 {

     StringOutputVisitor *sov = DO_UPCAST(StringOutputVisitor, visitor, v);
+
     static const char suffixes[] = { 'B', 'K', 'M', 'G', 'T' };

     uint64_t div, val;

+    char *out;
+
+    int i;
+

+    if (!sov->human) {

         out = g_strdup_printf("%llu", (long long) *obj);

static void print_type_size(Visitor *v, uint64_t *obj, const char *name,

                           Error **errp)

{

    StringOutputVisitor *sov = DO_UPCAST(StringOutputVisitor, visitor, v);

    static const char suffixes[] = { 'B', 'K', 'M', 'G', 'T' };

    uint64_t div, val;

    char *out;

    int i;

    if (!sov->human) {

        out = g_strdup_printf("%llu", (long long) *obj);

        string_output_set(sov, out);

        return;

    }

    val = *obj;

    /* Compute floor(log2(val)).  */

    i = 64 - clz64(val);

    /* Find the power of 1024 that we'll display as the units.  */

    i /= 10;

    if (i >= ARRAY_SIZE(suffixes)) {

        i = ARRAY_SIZE(suffixes) - 1;

    }

    div = 1ULL << (i * 10);

    out = g_strdup_printf("%0.03f%c", (double)val/div, suffixes[i]);

    string_output_set(sov, out);

}


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

     if (n < 32) {

+#if defined(TARGET_PPC64)

         stl_p(mem_buf, env->gpr[n] >> 32);

+#else

         stl_p(mem_buf, env->gprh[n]);

static int gdb_get_spe_reg(CPUState *env, uint8_t *mem_buf, int n)

{

    if (n < 32) {

#if defined(TARGET_PPC64)

        stl_p(mem_buf, env->gpr[n] >> 32);

#else

        stl_p(mem_buf, env->gprh[n]);

#endif

        return 4;

    }

    if (n == 33) {

        stq_p(mem_buf, env->spe_acc);

        return 8;

    }

    if (n == 34) {

        /* SPEFSCR not implemented */

        memset(mem_buf, 0, 4);

        return 4;

    }

    return 0;

}


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

         buffered_flush(s);

+    }
+
+    return migrate_fd_close(s);
+
+}

static int buffered_close(void *opaque)

{

    MigrationState *s = opaque;

    DPRINTF("closing\n");

    s->xfer_limit = INT_MAX;

    while (!qemu_file_get_error(s->file) && s->buffer_size) {

        buffered_flush(s);

    }

    return migrate_fd_close(s);

}


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

+                         int stream_index, int64_t timestamp, int flags)

 {

static int oma_read_seek(struct AVFormatContext *s,

                         int stream_index, int64_t timestamp, int flags)

{

    OMAContext *oc = s->priv_data;

    int err = ff_pcm_read_seek(s, stream_index, timestamp, flags);

    if (!oc->encrypted)

        return err;

    /* readjust IV for CBC */

    if (err || avio_tell(s->pb) < oc->content_start)

        goto wipe;

    if ((err = avio_seek(s->pb, -8, SEEK_CUR)) < 0)

        goto wipe;

    if ((err = avio_read(s->pb, oc->iv, 8)) < 8) {

        if (err >= 0)

            err = AVERROR_EOF;

        goto wipe;

    }

    return 0;

wipe:

    memset(oc->iv, 0, 8);

    return err;

}


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

     case TIFF_LONG : return tget_long(p, le);

+    default        : return UINT_MAX;
+
+    }
+
 }

static unsigned tget(const uint8_t **p, int type, int le)

{

    switch (type) {

    case TIFF_BYTE : return *(*p)++;

    case TIFF_SHORT: return tget_short(p, le);

    case TIFF_LONG : return tget_long(p, le);

    default        : return UINT_MAX;

    }

}


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

     vnc_write_u8(vs, 2);

+
+
+    vnc_read_when(vs, protocol_client_vencrypt_init, 2);
+
     return 0;

 }

static int start_auth_vencrypt(VncState *vs)

{

    /* Send VeNCrypt version 0.2 */

    vnc_write_u8(vs, 0);

    vnc_write_u8(vs, 2);

    vnc_read_when(vs, protocol_client_vencrypt_init, 2);

    return 0;

}


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

         return 0;

+    if (!vm_running)
+
+        return 0;
+
     return 1;

 }

static int cpu_can_run(CPUState *env)

{

    if (env->stop)

        return 0;

    if (env->stopped)

        return 0;

    if (!vm_running)

        return 0;

    return 1;

}


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

     pixel *src = (pixel*)_src;

+    int stride = _stride/sizeof(pixel);

     const int dc= (  src[-1+0*stride] + src[-1+1*stride] + src[-1+2*stride] + src[-1+3*stride] + 2) >>2;

static void FUNCC(pred4x4_left_dc)(uint8_t *_src, const uint8_t *topright, int _stride){

    pixel *src = (pixel*)_src;

    int stride = _stride/sizeof(pixel);

    const int dc= (  src[-1+0*stride] + src[-1+1*stride] + src[-1+2*stride] + src[-1+3*stride] + 2) >>2;

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

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

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

    ((pixel4*)(src+3*stride))[0]= PIXEL_SPLAT_X4(dc);

}


--- a/source.c
+++ b/source.c
@@ -13,7 +13,7 @@
     pci_config_set_device_id(d->card.config, PCI_DEVICE_ID_INTEL_82801IR);

+
     pci_config_set_class(d->card.config, PCI_CLASS_STORAGE_SATA);

     pci_config_set_revision(d->card.config, 0x02);

static int pci_ich9_ahci_init(PCIDevice *dev)

{

    struct AHCIPCIState *d;

    d = DO_UPCAST(struct AHCIPCIState, card, dev);

    pci_config_set_vendor_id(d->card.config, PCI_VENDOR_ID_INTEL);

    pci_config_set_device_id(d->card.config, PCI_DEVICE_ID_INTEL_82801IR);

    pci_config_set_class(d->card.config, PCI_CLASS_STORAGE_SATA);

    pci_config_set_revision(d->card.config, 0x02);

    pci_config_set_prog_interface(d->card.config, AHCI_PROGMODE_MAJOR_REV_1);

    d->card.config[PCI_CACHE_LINE_SIZE] = 0x08;  /* Cache line size */

    d->card.config[PCI_LATENCY_TIMER]   = 0x00;  /* Latency timer */

    pci_config_set_interrupt_pin(d->card.config, 1);

    /* XXX Software should program this register */

    d->card.config[0x90]   = 1 << 6; /* Address Map Register - AHCI mode */

    qemu_register_reset(ahci_reset, d);

    /* XXX BAR size should be 1k, but that breaks, so bump it to 4k for now */

    pci_register_bar_simple(&d->card, 5, 0x1000, 0, d->ahci.mem);

    msi_init(dev, 0x50, 1, true, false);

    ahci_init(&d->ahci, &dev->qdev, 6);

    d->ahci.irq = d->card.irq[0];

    return 0;

}


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

     bdrv_guess_geometry(s->bs, &cylinders, &heads, &secs);

+    s->cylinders = cylinders;
+
+    s->heads = heads;
+
+    s->sectors = secs;

     s->nb_sectors = nb_sectors;

void ide_init_drive(IDEState *s, DriveInfo *dinfo,

                    const char *version, const char *serial)

{

    int cylinders, heads, secs;

    uint64_t nb_sectors;

    s->bs = dinfo->bdrv;

    bdrv_get_geometry(s->bs, &nb_sectors);

    bdrv_guess_geometry(s->bs, &cylinders, &heads, &secs);

    s->cylinders = cylinders;

    s->heads = heads;

    s->sectors = secs;

    s->nb_sectors = nb_sectors;

    /* The SMART values should be preserved across power cycles

       but they aren't.  */

    s->smart_enabled = 1;

    s->smart_autosave = 1;

    s->smart_errors = 0;

    s->smart_selftest_count = 0;

    if (bdrv_get_type_hint(s->bs) == BDRV_TYPE_CDROM) {

        s->is_cdrom = 1;

        bdrv_set_change_cb(s->bs, cdrom_change_cb, s);

    }

    if (serial && *serial) {

        strncpy(s->drive_serial_str, serial, sizeof(s->drive_serial_str));

    } else {

        snprintf(s->drive_serial_str, sizeof(s->drive_serial_str),

                 "QM%05d", s->drive_serial);

    }

    if (version) {

        pstrcpy(s->version, sizeof(s->version), version);

    } else {

        pstrcpy(s->version, sizeof(s->version), QEMU_VERSION);

    }

    ide_reset(s);

}


--- a/source.c
+++ b/source.c
@@ -15,7 +15,7 @@
         int k = 0;

         while (k < ics->max_sfb) {
+
             uint8_t sect_end = k;

             int sect_len_incr;

static int decode_band_types(AACContext *ac, enum BandType band_type[120],

                             int band_type_run_end[120], GetBitContext *gb,

                             IndividualChannelStream *ics)

{

    int g, idx = 0;

    const int bits = (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) ? 3 : 5;

    for (g = 0; g < ics->num_window_groups; g++) {

        int k = 0;

        while (k < ics->max_sfb) {

            uint8_t sect_end = k;

            int sect_len_incr;

            int sect_band_type = get_bits(gb, 4);

            if (sect_band_type == 12) {

                av_log(ac->avctx, AV_LOG_ERROR, "invalid band type\n");

                return -1;

            }

            do {

                sect_len_incr = get_bits(gb, bits);

                sect_end += sect_len_incr;

                if (get_bits_left(gb) < 0) {

                    av_log(ac->avctx, AV_LOG_ERROR, overread_err);

                    return -1;

                }

                if (sect_end > ics->max_sfb) {

                    av_log(ac->avctx, AV_LOG_ERROR,

                           "Number of bands (%d) exceeds limit (%d).\n",

                           sect_end, ics->max_sfb);

                    return -1;

                }

            } while (sect_len_incr == (1 << bits) - 1);

            for (; k < sect_end; k++) {

                band_type        [idx]   = sect_band_type;

                band_type_run_end[idx++] = sect_end;

            }

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static int x86_cpu_filter_features(X86CPU *cpu)

 {
+
+    CPUX86State *env = &cpu->env;
+
+    FeatureWord w;
+
     int rv = 0;

static int x86_cpu_filter_features(X86CPU *cpu)

{

    CPUX86State *env = &cpu->env;

    FeatureWord w;

    int rv = 0;

    for (w = 0; w < FEATURE_WORDS; w++) {

        uint32_t host_feat =

            x86_cpu_get_supported_feature_word(w, false);

        uint32_t requested_features = env->features[w];

        env->features[w] &= host_feat;

        cpu->filtered_features[w] = requested_features & ~env->features[w];

        if (cpu->filtered_features[w]) {

            rv = 1;

        }

    }

    return rv;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline void RENAME(rgb24ToY)(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused)

 {

static inline void RENAME(rgb24ToY)(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused)

{

#if COMPILE_TEMPLATE_MMX

    RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_RGB24);

#else

    int i;

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

        int r= src[i*3+0];

        int g= src[i*3+1];

        int b= src[i*3+2];

        dst[i]= ((RY*r + GY*g + BY*b + (33<<(RGB2YUV_SHIFT-1)))>>RGB2YUV_SHIFT);

    }

#endif

}


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

         return;

+    }
+
+    ret = parse(dev, str, ptr);
+
+    error_set_from_qdev_prop_error(errp, ret, dev, prop, str);

     g_free(str);

static void set_pointer(Object *obj, Visitor *v, Property *prop,

                        int (*parse)(DeviceState *dev, const char *str, void **ptr),

                        const char *name, Error **errp)

{

    DeviceState *dev = DEVICE(obj);

    Error *local_err = NULL;

    void **ptr = qdev_get_prop_ptr(dev, prop);

    char *str;

    int ret;

    if (dev->state != DEV_STATE_CREATED) {

        error_set(errp, QERR_PERMISSION_DENIED);

        return;

    }

    visit_type_str(v, &str, name, &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        return;

    }

    if (!*str) {

        g_free(str);

        *ptr = NULL;

        return;

    }

    ret = parse(dev, str, ptr);

    error_set_from_qdev_prop_error(errp, ret, dev, prop, str);

    g_free(str);

}


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

     error_report("wrong size for virtio-scsi headers");

static void virtio_scsi_bad_req(void)

{

    error_report("wrong size for virtio-scsi headers");

    exit(1);

}


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

+    if ((ret = av_image_fill_linesizes(picture->linesize, pix_fmt, width)) < 0)
+
+        return ret;
+
+

     return av_image_fill_pointers(picture->data, pix_fmt,

int avpicture_fill(AVPicture *picture, uint8_t *ptr,

                   enum AVPixelFormat pix_fmt, int width, int height)

{

    int ret;

    if ((ret = av_image_check_size(width, height, 0, NULL)) < 0)

        return ret;

    if ((ret = av_image_fill_linesizes(picture->linesize, pix_fmt, width)) < 0)

        return ret;

    return av_image_fill_pointers(picture->data, pix_fmt,

                                  height, ptr, picture->linesize);

}


--- a/source.c
+++ b/source.c
@@ -17,7 +17,7 @@
     if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1))

         goto badframe;
+
     target_to_host_sigset(&set, &frame->uc.tuc_sigmask);

     set_sigmask(&set);

long do_rt_sigreturn(CPUX86State *env)

{

    abi_ulong frame_addr;

    struct rt_sigframe *frame;

    sigset_t set;

    frame_addr = env->regs[R_ESP] - 4;

    trace_user_do_rt_sigreturn(env, frame_addr);

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

        goto badframe;

    target_to_host_sigset(&set, &frame->uc.tuc_sigmask);

    set_sigmask(&set);

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

        goto badframe;

    }

    if (do_sigaltstack(frame_addr + offsetof(struct rt_sigframe, uc.tuc_stack), 0,

                       get_sp_from_cpustate(env)) == -EFAULT) {

        goto badframe;

    }

    unlock_user_struct(frame, frame_addr, 0);

    return -TARGET_QEMU_ESIGRETURN;

badframe:

    unlock_user_struct(frame, frame_addr, 0);

    force_sig(TARGET_SIGSEGV);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void vfio_calxeda_xgmac_class_init(ObjectClass *klass, void *data)
+
+{
+
+    DeviceClass *dc = DEVICE_CLASS(klass);

     VFIOCalxedaXgmacDeviceClass *vcxc =

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    VFIOCalxedaXgmacDeviceClass *vcxc =

        VFIO_CALXEDA_XGMAC_DEVICE_CLASS(klass);

    vcxc->parent_realize = dc->realize;

    dc->realize = calxeda_xgmac_realize;

    dc->desc = "VFIO Calxeda XGMAC";

    dc->vmsd = &vfio_platform_calxeda_xgmac_vmstate;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+Aml *aml_buffer(void)

 {

Aml *aml_buffer(void)

{

    Aml *var = aml_bundle(0x11 /* BufferOp */, AML_BUFFER);

    return var;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static uint32_t scoop_readb(void *opaque, target_phys_addr_t addr)
+
+{
+
+    ScoopInfo *s = (ScoopInfo *) opaque;
+

     switch (addr) {

static uint32_t scoop_readb(void *opaque, target_phys_addr_t addr)

{

    ScoopInfo *s = (ScoopInfo *) opaque;

    switch (addr) {

    case SCOOP_MCR:

        return s->mcr;

    case SCOOP_CDR:

        return s->cdr;

    case SCOOP_CSR:

        return s->status;

    case SCOOP_CPR:

        return s->power;

    case SCOOP_CCR:

        return s->ccr;

    case SCOOP_IRR_IRM:

        return s->irr;

    case SCOOP_IMR:

        return s->imr;

    case SCOOP_ISR:

        return s->isr;

    case SCOOP_GPCR:

        return s->gpio_dir;

    case SCOOP_GPWR:

    case SCOOP_GPRR:

        return s->gpio_level;

    default:

        zaurus_printf("Bad register offset " REG_FMT "\n", (unsigned long)addr);

    }

    return 0;

}


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

     tmp = (*value >> shift) & mask;
+
+    if (mr->subpage) {
+
+        trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size);
+

static MemTxResult memory_region_oldmmio_write_accessor(MemoryRegion *mr,

                                                        hwaddr addr,

                                                        uint64_t *value,

                                                        unsigned size,

                                                        unsigned shift,

                                                        uint64_t mask,

                                                        MemTxAttrs attrs)

{

    uint64_t tmp;

    tmp = (*value >> shift) & mask;

    if (mr->subpage) {

        trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size);

    } else if (TRACE_MEMORY_REGION_OPS_WRITE_ENABLED) {

        hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);

        trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size);

    }

    mr->ops->old_mmio.write[ctz32(size)](mr->opaque, addr, tmp);

    return MEMTX_OK;

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     NBDExport *exp;

+
+    csock = client->sock;
+
+    if (length) {
+

static int nbd_handle_list(NBDClient *client, uint32_t length)

{

    int csock;

    NBDExport *exp;

    csock = client->sock;

    if (length) {

        return nbd_send_rep(csock, NBD_REP_ERR_INVALID, NBD_OPT_LIST);

    /* For each export, send a NBD_REP_SERVER reply. */

    QTAILQ_FOREACH(exp, &exports, next) {

        if (nbd_send_rep_list(csock, exp)) {

            return -EINVAL;

    /* Finish with a NBD_REP_ACK. */

    return nbd_send_rep(csock, NBD_REP_ACK, NBD_OPT_LIST);


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static inline int is_yuv_planar(PixFmtInfo *ps)
+
 {

     return (ps->color_type == FF_COLOR_YUV ||

static inline int is_yuv_planar(PixFmtInfo *ps)

{

    return (ps->color_type == FF_COLOR_YUV ||

            ps->color_type == FF_COLOR_YUV_JPEG) && !ps->is_packed;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static int print_uint16(DeviceState *dev, Property *prop, char *dest, size_t len)
+
+{

     uint16_t *ptr = qdev_get_prop_ptr(dev, prop);

static int print_uint16(DeviceState *dev, Property *prop, char *dest, size_t len)

{

    uint16_t *ptr = qdev_get_prop_ptr(dev, prop);

    return snprintf(dest, len, "%" PRIu16, *ptr);

}


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

         cpu_x86_update_cr0(env);

+        break;
+
+    case 3:
+
+        cpu_x86_update_cr3(env);

         break;

void helper_movl_crN_T0(int reg)

{

    env->cr[reg] = T0;

    switch(reg) {

    case 0:

        cpu_x86_update_cr0(env);

        break;

    case 3:

        cpu_x86_update_cr3(env);

        break;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void store_slice_c(uint8_t *dst, const uint16_t *src,

                           int dst_linesize, int src_linesize,

static void store_slice_c(uint8_t *dst, const uint16_t *src,

                          int dst_linesize, int src_linesize,

                          int width, int height, int log2_scale,

                          const uint8_t dither[8][8])

{

    int y, x;

#define STORE(pos) do {                                                     \

    temp = ((src[x + y*src_linesize + pos] << log2_scale) + d[pos]) >> 6;   \

    if (temp & 0x100)                                                       \

        temp = ~(temp >> 31);                                               \

    dst[x + y*dst_linesize + pos] = temp;                                   \

} while (0)

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

        const uint8_t *d = dither[y];

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

            int temp;

            STORE(0);

            STORE(1);

            STORE(2);

            STORE(3);

            STORE(4);

            STORE(5);

            STORE(6);

            STORE(7);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     pc_common_machine_options(m);

     m->desc = "Xen Fully-virtualized PC";
+
+    m->max_cpus = HVM_MAX_VCPUS;
+
     m->default_machine_opts = "accel=xen";

     m->hot_add_cpu = pc_hot_add_cpu;

static void xenfv_machine_options(MachineClass *m)

{

    pc_common_machine_options(m);

    m->desc = "Xen Fully-virtualized PC";

    m->max_cpus = HVM_MAX_VCPUS;

    m->default_machine_opts = "accel=xen";

    m->hot_add_cpu = pc_hot_add_cpu;

}


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

     notifier_list_add(&migration_state_notifiers, notify);
+
 }

void add_migration_state_change_notifier(Notifier *notify)

{

    notifier_list_add(&migration_state_notifiers, notify);

}


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

     TCGv_i32 tmp;
+
+    store_reg(s, 15, pc);
+
+    tmp = load_cpu_field(spsr);

     gen_set_cpsr(tmp, CPSR_ERET_MASK);

static void gen_exception_return(DisasContext *s, TCGv_i32 pc)

{

    TCGv_i32 tmp;

    store_reg(s, 15, pc);

    tmp = load_cpu_field(spsr);

    gen_set_cpsr(tmp, CPSR_ERET_MASK);

    tcg_temp_free_i32(tmp);

    s->is_jmp = DISAS_JUMP;

}


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

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

+

     if (obj) {
+
         *obj = NULL;

     }

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

                                       size_t size, Error **errp)

{

    QObjectInputVisitor *qiv = to_qiv(v);

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

    if (obj) {

        *obj = NULL;

    }

    if (!qobj) {

        return;

    }

    if (qobject_type(qobj) != QTYPE_QDICT) {

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

                   "QDict");

        return;

    }

    qobject_input_push(qiv, qobj, obj);

    if (obj) {

        *obj = g_malloc0(size);

    }

}


static void paio_cancel(BlockDriverAIOCB *blockacb)

{

    struct qemu_paiocb *acb = (struct qemu_paiocb *)blockacb;

    int active = 0;

    mutex_lock(&lock);

    if (!acb->active) {

        TAILQ_REMOVE(&request_list, acb, node);

        acb->ret = -ECANCELED;

    } else if (acb->ret == -EINPROGRESS) {

        active = 1;

    }

    mutex_unlock(&lock);

    if (active) {

        /* fail safe: if the aio could not be canceled, we wait for

           it */

        while (qemu_paio_error(acb) == EINPROGRESS)

            ;

    }

    paio_remove(acb);

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
     MpegEncContext *s = &h->s;

     int frame_rate_code;
+
+    int width, height;
+
+
+
     h->profile =         get_bits(&s->gb,8);

     h->level =           get_bits(&s->gb,8);

static int decode_seq_header(AVSContext *h) {

    MpegEncContext *s = &h->s;

    int frame_rate_code;

    int width, height;

    h->profile =         get_bits(&s->gb,8);

    h->level =           get_bits(&s->gb,8);

    skip_bits1(&s->gb); //progressive sequence

       width =           get_bits(&s->gb,14);

       height =          get_bits(&s->gb,14);

    if ((s->width || s->height) && (s->width != width || s->height != height)) {

        av_log_missing_feature(s, "Width/height changing in CAVS is", 0);

        return -1;

    s->width  = width;

    s->height = height;

    skip_bits(&s->gb,2); //chroma format

    skip_bits(&s->gb,3); //sample_precision

    h->aspect_ratio =    get_bits(&s->gb,4);

    frame_rate_code =    get_bits(&s->gb,4);

    skip_bits(&s->gb,18);//bit_rate_lower

    skip_bits1(&s->gb);  //marker_bit

    skip_bits(&s->gb,12);//bit_rate_upper

    s->low_delay =       get_bits1(&s->gb);

    h->mb_width  = (s->width  + 15) >> 4;

    h->mb_height = (s->height + 15) >> 4;

    h->s.avctx->time_base.den = avpriv_frame_rate_tab[frame_rate_code].num;

    h->s.avctx->time_base.num = avpriv_frame_rate_tab[frame_rate_code].den;

    h->s.avctx->width  = s->width;

    h->s.avctx->height = s->height;

    if(!h->top_qp)

        ff_cavs_init_top_lines(h);

    return 0;


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

+    memcpy(mem, &cpu->env.vregs, 512);
+
+
+
+    cpu_physical_memory_unmap(mem, len, 1, len);

static int kvm_s390_store_adtl_status(S390CPU *cpu, hwaddr addr)

{

    void *mem;

    hwaddr len = ADTL_SAVE_AREA_SIZE;

    mem = cpu_physical_memory_map(addr, &len, 1);

    if (!mem) {

        return -EFAULT;

    }

    if (len != ADTL_SAVE_AREA_SIZE) {

        cpu_physical_memory_unmap(mem, len, 1, 0);

        return -EFAULT;

    }

    memcpy(mem, &cpu->env.vregs, 512);

    cpu_physical_memory_unmap(mem, len, 1, len);

    return 0;

}


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

     uint8_t lba_index  = NVME_ID_NS_FLBAS_INDEX(ns->id_ns.flbas);
+
     uint8_t data_shift = ns->id_ns.lbaf[lba_index].ds;

     uint64_t data_size = (uint64_t)nlb << data_shift;

static uint16_t nvme_rw(NvmeCtrl *n, NvmeNamespace *ns, NvmeCmd *cmd,

    NvmeRequest *req)

{

    NvmeRwCmd *rw = (NvmeRwCmd *)cmd;

    uint32_t nlb  = le32_to_cpu(rw->nlb) + 1;

    uint64_t slba = le64_to_cpu(rw->slba);

    uint64_t prp1 = le64_to_cpu(rw->prp1);

    uint64_t prp2 = le64_to_cpu(rw->prp2);

    uint8_t lba_index  = NVME_ID_NS_FLBAS_INDEX(ns->id_ns.flbas);

    uint8_t data_shift = ns->id_ns.lbaf[lba_index].ds;

    uint64_t data_size = (uint64_t)nlb << data_shift;

    uint64_t aio_slba  = slba << (data_shift - BDRV_SECTOR_BITS);

    int is_write = rw->opcode == NVME_CMD_WRITE ? 1 : 0;

    if ((slba + nlb) > ns->id_ns.nsze) {

        return NVME_LBA_RANGE | NVME_DNR;

    }

    if (nvme_map_prp(&req->qsg, prp1, prp2, data_size, n)) {

        return NVME_INVALID_FIELD | NVME_DNR;

    }

    assert((nlb << data_shift) == req->qsg.size);

    req->has_sg = true;

    dma_acct_start(n->conf.blk, &req->acct, &req->qsg,

                   is_write ? BLOCK_ACCT_WRITE : BLOCK_ACCT_READ);

    req->aiocb = is_write ?

        dma_blk_write(n->conf.blk, &req->qsg, aio_slba, nvme_rw_cb, req) :

        dma_blk_read(n->conf.blk, &req->qsg, aio_slba, nvme_rw_cb, req);

    return NVME_NO_COMPLETE;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int vp8_alloc_frame(VP8Context *s, AVFrame *f)

 {
+
     int ret;

     if ((ret = ff_thread_get_buffer(s->avctx, f)) < 0)

static int vp8_alloc_frame(VP8Context *s, AVFrame *f)

{

    int ret;

    if ((ret = ff_thread_get_buffer(s->avctx, f)) < 0)

        return ret;

    if (!s->maps_are_invalid && s->num_maps_to_be_freed) {

        f->ref_index[0] = s->segmentation_maps[--s->num_maps_to_be_freed];

    } else if (!(f->ref_index[0] = av_mallocz(s->mb_width * s->mb_height))) {

        ff_thread_release_buffer(s->avctx, f);

        return AVERROR(ENOMEM);

    }

    return 0;

}


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

     /* Determine the security model */
+
+    if (fs_ctx->fs_sm == SM_MAPPED) {

+        err = mkdir(rpath(fs_ctx, path), SM_LOCAL_DIR_MODE_BITS);

         if (err == -1) {

static int local_mkdir(FsContext *fs_ctx, const char *path, FsCred *credp)

{

    int err = -1;

    int serrno = 0;

    /* Determine the security model */

    if (fs_ctx->fs_sm == SM_MAPPED) {

        err = mkdir(rpath(fs_ctx, path), SM_LOCAL_DIR_MODE_BITS);

        if (err == -1) {

            return err;

        }

        credp->fc_mode = credp->fc_mode|S_IFDIR;

        err = local_set_xattr(rpath(fs_ctx, path), credp);

        if (err == -1) {

            serrno = errno;

            goto err_end;

        }

    } else if (fs_ctx->fs_sm == SM_PASSTHROUGH) {

        err = mkdir(rpath(fs_ctx, path), credp->fc_mode);

        if (err == -1) {

            return err;

        }

        err = local_post_create_passthrough(fs_ctx, path, credp);

        if (err == -1) {

            serrno = errno;

            goto err_end;

        }

    }

    return err;

err_end:

    remove(rpath(fs_ctx, path));

    errno = serrno;

    return err;

}


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

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

 	pci_conf[0x58] = 0;

static void piix4_reset(void *opaque)

{

	PIIX4PMState *s = opaque;

	uint8_t *pci_conf = s->dev.config;

	pci_conf[0x58] = 0;

	pci_conf[0x59] = 0;

	pci_conf[0x5a] = 0;

	pci_conf[0x5b] = 0;

}


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

 #ifdef HAVE_MMX

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

{

#ifdef HAVE_MMX

	asm volatile(

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

		"1:				\n\t"

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

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

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

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

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

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

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

		" js 1b				\n\t"

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

		: "%"REG_a

	);

#else

	int i;

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

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

#endif

}


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

                         clk_setup_t *cpu_clk, clk_setup_t *tb_clk,

+                        uint32_t sysclk)
+
+{

     PowerPCCPU *cpu;

PowerPCCPU *ppc4xx_init(const char *cpu_model,

                        clk_setup_t *cpu_clk, clk_setup_t *tb_clk,

                        uint32_t sysclk)

{

    PowerPCCPU *cpu;

    CPUPPCState *env;

    /* init CPUs */

    cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, cpu_model));

    if (cpu == NULL) {

        fprintf(stderr, "Unable to find PowerPC %s CPU definition\n",

                cpu_model);

        exit(1);

    }

    env = &cpu->env;

    cpu_clk->cb = NULL; /* We don't care about CPU clock frequency changes */

    cpu_clk->opaque = env;

    /* Set time-base frequency to sysclk */

    tb_clk->cb = ppc_40x_timers_init(env, sysclk, PPC_INTERRUPT_PIT);

    tb_clk->opaque = env;

    ppc_dcr_init(env, NULL, NULL);

    /* Register qemu callbacks */

    qemu_register_reset(ppc4xx_reset, cpu);

    return cpu;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 int avcodec_decode_video(AVCodecContext *avctx, AVPicture *picture,

                          int *got_picture_ptr,
+
                          UINT8 *buf, int buf_size)

 {

int avcodec_decode_video(AVCodecContext *avctx, AVPicture *picture,

                         int *got_picture_ptr,

                         UINT8 *buf, int buf_size)

{

    int ret;

    ret = avctx->codec->decode(avctx, picture, got_picture_ptr,

                               buf, buf_size);

    avctx->frame_number++;

    return ret;

}


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

 {
+
+    uint8_t *bufptr = p->buf;
+
+

     if(ff_id3v2_match(bufptr))

static int flac_probe(AVProbeData *p)

{

    uint8_t *bufptr = p->buf;

    if(ff_id3v2_match(bufptr))

        bufptr += ff_id3v2_tag_len(bufptr);

    if(memcmp(bufptr, "fLaC", 4)) return 0;

    else                          return AVPROBE_SCORE_MAX / 2;

}


--- a/source.c
+++ b/source.c
@@ -18,11 +18,11 @@
     env->CP0_EBase = 0x80000000;
     env->CP0_Status = (1 << CP0St_BEV) | (1 << CP0St_ERL);
     /* vectored interrupts not implemented, timer on int 7,
+       no performance counters. */
+    env->CP0_IntCtl = 0xe0000000;
+    {
+        int i;
+        for (i = 0; i < 7; i++) {
             env->CP0_WatchLo[i] = 0;
             env->CP0_WatchHi[i] = 0x80000000;
         env->CP0_WatchLo[7] = 0;

void cpu_reset (CPUMIPSState *env)
{
    memset(env, 0, offsetof(CPUMIPSState, breakpoints));
    tlb_flush(env, 1);
    /* Minimal init */
#if defined(CONFIG_USER_ONLY)
    env->hflags = MIPS_HFLAG_UM;
#else
    if (env->hflags & MIPS_HFLAG_BMASK) {
        /* If the exception was raised from a delay slot,
           come back to the jump.  */
        env->CP0_ErrorEPC = env->active_tc.PC - 4;
    } else {
        env->CP0_ErrorEPC = env->active_tc.PC;
    env->active_tc.PC = (int32_t)0xBFC00000;
    env->CP0_Wired = 0;
    /* SMP not implemented */
    env->CP0_EBase = 0x80000000;
    env->CP0_Status = (1 << CP0St_BEV) | (1 << CP0St_ERL);
    /* vectored interrupts not implemented, timer on int 7,
       no performance counters. */
    env->CP0_IntCtl = 0xe0000000;
    {
        int i;
        for (i = 0; i < 7; i++) {
            env->CP0_WatchLo[i] = 0;
            env->CP0_WatchHi[i] = 0x80000000;
        env->CP0_WatchLo[7] = 0;
        env->CP0_WatchHi[7] = 0;
    /* Count register increments in debug mode, EJTAG version 1 */
    env->CP0_Debug = (1 << CP0DB_CNT) | (0x1 << CP0DB_VER);
    env->hflags = MIPS_HFLAG_CP0;
#endif
    env->exception_index = EXCP_NONE;
    cpu_mips_register(env, env->cpu_model);


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

                        int nb_sectors, QEMUIOVector *qiov)

{

    SheepdogAIOCB acb;

    int ret;

    int64_t offset = (sector_num + nb_sectors) * BDRV_SECTOR_SIZE;

    BDRVSheepdogState *s = bs->opaque;

    if (offset > s->inode.vdi_size) {

        ret = sd_truncate(bs, offset);

        if (ret < 0) {

            return ret;

        }

    }

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

retry:

    if (check_overlapping_aiocb(s, &acb)) {

        qemu_co_queue_wait(&s->overlapping_queue);

        goto retry;

    }

    sd_co_rw_vector(&acb);

    sd_write_done(&acb);

    QLIST_REMOVE(&acb, aiocb_siblings);

    qemu_co_queue_restart_all(&s->overlapping_queue);

    return acb.ret;

}


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

+
+    if (VOP >= VISO && VOP >= VOL && VO >= VOL && VOL > 0 && res==0)
+
+        return VOP+VO > 4 ? AVPROBE_SCORE_EXTENSION : AVPROBE_SCORE_EXTENSION/2;
+
     return 0;

 }

static int mpeg4video_probe(AVProbeData *probe_packet)

{

    uint32_t temp_buffer= -1;

    int VO=0, VOL=0, VOP = 0, VISO = 0, res=0;

    int i;

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

        temp_buffer = (temp_buffer<<8) + probe_packet->buf[i];

        if ((temp_buffer & 0xffffff00) != 0x100)

            continue;

        if (temp_buffer == VOP_START_CODE)                         VOP++;

        else if (temp_buffer == VISUAL_OBJECT_START_CODE)          VISO++;

        else if (temp_buffer < 0x120)                              VO++;

        else if (temp_buffer < 0x130)                              VOL++;

        else if (   !(0x1AF < temp_buffer && temp_buffer < 0x1B7)

                 && !(0x1B9 < temp_buffer && temp_buffer < 0x1C4)) res++;

    }

    if (VOP >= VISO && VOP >= VOL && VO >= VOL && VOL > 0 && res==0)

        return VOP+VO > 4 ? AVPROBE_SCORE_EXTENSION : AVPROBE_SCORE_EXTENSION/2;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static int decode_residual_block(AVSContext *h, GetBitContext *gb,

                                  const struct dec_2dvlc *r, int esc_golomb_order,
+
+                                 int qp, uint8_t *dst, int stride) {
+
+    int i, level_code, esc_code, level, run, mask;
+
     DCTELEM level_buf[65];

     uint8_t run_buf[65];

static int decode_residual_block(AVSContext *h, GetBitContext *gb,

                                 const struct dec_2dvlc *r, int esc_golomb_order,

                                 int qp, uint8_t *dst, int stride) {

    int i, level_code, esc_code, level, run, mask;

    DCTELEM level_buf[65];

    uint8_t run_buf[65];

    DCTELEM *block = h->block;

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

        level_code = get_ue_code(gb,r->golomb_order);

        if(level_code >= ESCAPE_CODE) {

            run = ((level_code - ESCAPE_CODE) >> 1) + 1;

            esc_code = get_ue_code(gb,esc_golomb_order);

            level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);

            while(level > r->inc_limit)

                r++;

            mask = -(level_code & 1);

            level = (level^mask) - mask;

        } else {

            level = r->rltab[level_code][0];

            if(!level) //end of block signal

                break;

            run   = r->rltab[level_code][1];

            r += r->rltab[level_code][2];

        }

        level_buf[i] = level;

        run_buf[i] = run;

    }

    if(dequant(h,level_buf, run_buf, block, ff_cavs_dequant_mul[qp],

               ff_cavs_dequant_shift[qp], i))

        return -1;

    h->cdsp.cavs_idct8_add(dst,block,stride);

    h->s.dsp.clear_block(block);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     MicroDriveState *md = MICRODRIVE(card);

     PCMCIACardClass *pcc = PCMCIA_CARD_GET_CLASS(card);
+

     md->attr_base = pcc->cis[0x74] | (pcc->cis[0x76] << 8);

static int dscm1xxxx_attach(PCMCIACardState *card)

{

    MicroDriveState *md = MICRODRIVE(card);

    PCMCIACardClass *pcc = PCMCIA_CARD_GET_CLASS(card);

    md->attr_base = pcc->cis[0x74] | (pcc->cis[0x76] << 8);

    md->io_base = 0x0;

    device_reset(DEVICE(md));

    md_interrupt_update(md);

    card->slot->card_string = "DSCM-1xxxx Hitachi Microdrive";

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void fdt_add_gic_node(const VirtBoardInfo *vbi)

 {

static void fdt_add_gic_node(const VirtBoardInfo *vbi)

{

    uint32_t gic_phandle;

    gic_phandle = qemu_fdt_alloc_phandle(vbi->fdt);

    qemu_fdt_setprop_cell(vbi->fdt, "/", "interrupt-parent", gic_phandle);

    qemu_fdt_add_subnode(vbi->fdt, "/intc");

    /* 'cortex-a15-gic' means 'GIC v2' */

    qemu_fdt_setprop_string(vbi->fdt, "/intc", "compatible",

                            "arm,cortex-a15-gic");

    qemu_fdt_setprop_cell(vbi->fdt, "/intc", "#interrupt-cells", 3);

    qemu_fdt_setprop(vbi->fdt, "/intc", "interrupt-controller", NULL, 0);

    qemu_fdt_setprop_sized_cells(vbi->fdt, "/intc", "reg",

                                     2, vbi->memmap[VIRT_GIC_DIST].base,

                                     2, vbi->memmap[VIRT_GIC_DIST].size,

                                     2, vbi->memmap[VIRT_GIC_CPU].base,

                                     2, vbi->memmap[VIRT_GIC_CPU].size);

    qemu_fdt_setprop_cell(vbi->fdt, "/intc", "phandle", gic_phandle);

}


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

     s->dir = qemu_get_be32(f);

+    s->isense = qemu_get_be32(f);
+
+    s->ibe = qemu_get_be32(f);
+
+    s->iev = qemu_get_be32(f);

     s->im = qemu_get_be32(f);

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

{

    pl061_state *s = (pl061_state *)opaque;

    if (version_id != 1)

        return -EINVAL;

    s->locked = qemu_get_be32(f);

    s->data = qemu_get_be32(f);

    s->old_data = qemu_get_be32(f);

    s->dir = qemu_get_be32(f);

    s->isense = qemu_get_be32(f);

    s->ibe = qemu_get_be32(f);

    s->iev = qemu_get_be32(f);

    s->im = qemu_get_be32(f);

    s->istate = qemu_get_be32(f);

    s->afsel = qemu_get_be32(f);

    s->dr2r = qemu_get_be32(f);

    s->dr4r = qemu_get_be32(f);

    s->dr8r = qemu_get_be32(f);

    s->odr = qemu_get_be32(f);

    s->pur = qemu_get_be32(f);

    s->pdr = qemu_get_be32(f);

    s->slr = qemu_get_be32(f);

    s->den = qemu_get_be32(f);

    s->cr = qemu_get_be32(f);

    s->float_high = qemu_get_be32(f);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void ioinst_handle_sal(S390CPU *cpu, uint64_t reg1)

+{
+
+    /* We do not provide address limit checking, so let's suppress it. */

     if (SAL_REG1_INVALID(reg1) || reg1 & 0x000000000000ffff) {

void ioinst_handle_sal(S390CPU *cpu, uint64_t reg1)

{

    /* We do not provide address limit checking, so let's suppress it. */

    if (SAL_REG1_INVALID(reg1) || reg1 & 0x000000000000ffff) {

        program_interrupt(&cpu->env, PGM_OPERAND, 2);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+av_cold void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)
+
+{

     afq->avctx             = avctx;

av_cold void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)

{

    afq->avctx             = avctx;

    afq->next_pts          = AV_NOPTS_VALUE;

    afq->remaining_delay   = avctx->delay;

    afq->remaining_samples = avctx->delay;

    afq->frame_queue       = NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void usb_host_set_config(USBHostDevice *s, int config, USBPacket *p)

+{
+
+    int rc;
+
+

     trace_usb_host_set_config(s->bus_num, s->addr, config);

static void usb_host_set_config(USBHostDevice *s, int config, USBPacket *p)

{

    int rc;

    trace_usb_host_set_config(s->bus_num, s->addr, config);

    usb_host_release_interfaces(s);

    usb_host_detach_kernel(s);

    rc = libusb_set_configuration(s->dh, config);

    if (rc != 0) {

        usb_host_libusb_error("libusb_set_configuration", rc);

        p->status = USB_RET_STALL;

        if (rc == LIBUSB_ERROR_NO_DEVICE) {

            usb_host_nodev(s);

        }

        return;

    }

    p->status = usb_host_claim_interfaces(s, config);

    if (p->status != USB_RET_SUCCESS) {

        return;

    }

    usb_host_ep_update(s);

}


void ff_h264_init_cabac_states(const H264Context *h, H264SliceContext *sl)

{

    int i;

    const int8_t (*tab)[2];

    const int slice_qp = av_clip(sl->qscale - 6*(h->sps.bit_depth_luma-8), 0, 51);

    if (sl->slice_type_nos == AV_PICTURE_TYPE_I) tab = cabac_context_init_I;

    else                                 tab = cabac_context_init_PB[sl->cabac_init_idc];

    /* calculate pre-state */

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

        int pre = 2*(((tab[i][0] * slice_qp) >>4 ) + tab[i][1]) - 127;

        pre^= pre>>31;

        if(pre > 124)

            pre= 124 + (pre&1);

        sl->cabac_state[i] =  pre;

    }

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     QEMUSnapshotInfo *sn_tab, *sn_info;

     QCowSnapshot *sn;
+
     int i;

int qcow2_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab)

{

    BDRVQcowState *s = bs->opaque;

    QEMUSnapshotInfo *sn_tab, *sn_info;

    QCowSnapshot *sn;

    int i;

    if (!s->nb_snapshots) {

        *psn_tab = NULL;

        return s->nb_snapshots;

    }

    sn_tab = g_malloc0(s->nb_snapshots * sizeof(QEMUSnapshotInfo));

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

        sn_info = sn_tab + i;

        sn = s->snapshots + i;

        pstrcpy(sn_info->id_str, sizeof(sn_info->id_str),

                sn->id_str);

        pstrcpy(sn_info->name, sizeof(sn_info->name),

                sn->name);

        sn_info->vm_state_size = sn->vm_state_size;

        sn_info->date_sec = sn->date_sec;

        sn_info->date_nsec = sn->date_nsec;

        sn_info->vm_clock_nsec = sn->vm_clock_nsec;

    }

    *psn_tab = sn_tab;

    return s->nb_snapshots;

}


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

     av_freep(&ctx->frm0);

+    av_freep(&ctx->frm1);
+
+    av_freep(&ctx->frm2);
+
+    av_freep(&ctx->stored_frame);

     av_freep(&ctx->rle_buf);

static void destroy_buffers(SANMVideoContext *ctx)

{

    av_freep(&ctx->frm0);

    av_freep(&ctx->frm1);

    av_freep(&ctx->frm2);

    av_freep(&ctx->stored_frame);

    av_freep(&ctx->rle_buf);

    ctx->frm0_size =

    ctx->frm1_size =

    ctx->frm2_size = 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 int ff_mpeg_ref_picture(MpegEncContext *s, Picture *dst, Picture *src)

+{
+
+    int ret;
+

     av_assert0(!dst->f.buf[0]);

int ff_mpeg_ref_picture(MpegEncContext *s, Picture *dst, Picture *src)

{

    int ret;

    av_assert0(!dst->f.buf[0]);

    av_assert0(src->f.buf[0]);

    src->tf.f = &src->f;

    dst->tf.f = &dst->f;

    ret = ff_thread_ref_frame(&dst->tf, &src->tf);

    if (ret < 0)

        goto fail;

    ret = update_picture_tables(dst, src);

    if (ret < 0)

        goto fail;

    if (src->hwaccel_picture_private) {

        dst->hwaccel_priv_buf = av_buffer_ref(src->hwaccel_priv_buf);

        if (!dst->hwaccel_priv_buf)

            goto fail;

        dst->hwaccel_picture_private = dst->hwaccel_priv_buf->data;

    }

    dst->field_picture           = src->field_picture;

    dst->mb_var_sum              = src->mb_var_sum;

    dst->mc_mb_var_sum           = src->mc_mb_var_sum;

    dst->b_frame_score           = src->b_frame_score;

    dst->needs_realloc           = src->needs_realloc;

    dst->reference               = src->reference;

    dst->shared                  = src->shared;

    return 0;

fail:

    ff_mpeg_unref_picture(s, dst);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)

+{

+    ID3v2ExtraMeta *current = *extra_meta, *next;

     void (*free_func)(ID3v2ExtraMeta*);

void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)

{

    ID3v2ExtraMeta *current = *extra_meta, *next;

    void (*free_func)(ID3v2ExtraMeta*);

    while (current) {

        if ((free_func = get_extra_meta_func(current->tag, 1)->free))

            free_func(current->data);

        next = current->next;

        av_freep(&current);

        current = next;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void ppc6xx_irq_init (CPUState *env)
+
 {

     env->irq_inputs = (void **)qemu_allocate_irqs(&ppc6xx_set_irq, env, 6);

void ppc6xx_irq_init (CPUState *env)

{

    env->irq_inputs = (void **)qemu_allocate_irqs(&ppc6xx_set_irq, env, 6);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+static void flush_buffered(AVFormatContext *s1, int last)
+
+{
+
+    RTPMuxContext *s = s1->priv_data;

+    if (s->buf_ptr != s->buf) {
+
         // If only sending one single NAL unit, skip the aggregation framing

         if (s->buffered_nals == 1)

static void flush_buffered(AVFormatContext *s1, int last)

{

    RTPMuxContext *s = s1->priv_data;

    if (s->buf_ptr != s->buf) {

        // If only sending one single NAL unit, skip the aggregation framing

        if (s->buffered_nals == 1)

            ff_rtp_send_data(s1, s->buf + 4, s->buf_ptr - s->buf - 4, last);

        else

            ff_rtp_send_data(s1, s->buf, s->buf_ptr - s->buf, last);

    }

    s->buf_ptr = s->buf;

    s->buffered_nals = 0;

}


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

 {

+    bool progress;
+
+
+
     progress = aio_bh_poll(ctx);

     progress |= aio_dispatch_handlers(ctx, INVALID_HANDLE_VALUE);

bool aio_dispatch(AioContext *ctx)

{

    bool progress;

    progress = aio_bh_poll(ctx);

    progress |= aio_dispatch_handlers(ctx, INVALID_HANDLE_VALUE);

    progress |= timerlistgroup_run_timers(&ctx->tlg);

    return progress;

}


--- a/source.c
+++ b/source.c
@@ -41,11 +41,11 @@
         st->codec->sample_rate = sample_rate;
         st->codec->bits_per_coded_sample = bytes_per_sample * 8;
         st->codec->bit_rate = sample_rate * bytes_per_sample * 8 * channels;
+        st->codec->block_align = bytes_per_sample * channels;
+        if (bytes_per_sample == 1)
+            st->codec->codec_id = AV_CODEC_ID_PCM_U8;
+        else
+            st->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
         if (sample_rate % 14 != 0) {
             idcin->audio_chunk_size1 = (sample_rate / 14) *
             bytes_per_sample * channels;

static int idcin_read_header(AVFormatContext *s)
{
    AVIOContext *pb = s->pb;
    IdcinDemuxContext *idcin = s->priv_data;
    AVStream *st;
    unsigned int width, height;
    unsigned int sample_rate, bytes_per_sample, channels;
    /* get the 5 header parameters */
    width = avio_rl32(pb);
    height = avio_rl32(pb);
    sample_rate = avio_rl32(pb);
    bytes_per_sample = avio_rl32(pb);
    channels = avio_rl32(pb);
    st = avformat_new_stream(s, NULL);
    if (!st)
        return AVERROR(ENOMEM);
    avpriv_set_pts_info(st, 33, 1, IDCIN_FPS);
    idcin->video_stream_index = st->index;
    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
    st->codec->codec_id = AV_CODEC_ID_IDCIN;
    st->codec->codec_tag = 0;  /* no fourcc */
    st->codec->width = width;
    st->codec->height = height;
    /* load up the Huffman tables into extradata */
    st->codec->extradata_size = HUFFMAN_TABLE_SIZE;
    st->codec->extradata = av_malloc(HUFFMAN_TABLE_SIZE);
    if (avio_read(pb, st->codec->extradata, HUFFMAN_TABLE_SIZE) !=
        HUFFMAN_TABLE_SIZE)
        return AVERROR(EIO);
    /* if sample rate is 0, assume no audio */
    if (sample_rate) {
        idcin->audio_present = 1;
        st = avformat_new_stream(s, NULL);
        if (!st)
            return AVERROR(ENOMEM);
        avpriv_set_pts_info(st, 33, 1, IDCIN_FPS);
        idcin->audio_stream_index = st->index;
        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
        st->codec->codec_tag = 1;
        st->codec->channels = channels;
        st->codec->sample_rate = sample_rate;
        st->codec->bits_per_coded_sample = bytes_per_sample * 8;
        st->codec->bit_rate = sample_rate * bytes_per_sample * 8 * channels;
        st->codec->block_align = bytes_per_sample * channels;
        if (bytes_per_sample == 1)
            st->codec->codec_id = AV_CODEC_ID_PCM_U8;
        else
            st->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
        if (sample_rate % 14 != 0) {
            idcin->audio_chunk_size1 = (sample_rate / 14) *
            bytes_per_sample * channels;
            idcin->audio_chunk_size2 = (sample_rate / 14 + 1) *
                bytes_per_sample * channels;
        } else {
            idcin->audio_chunk_size1 = idcin->audio_chunk_size2 =
                (sample_rate / 14) * bytes_per_sample * channels;
        idcin->current_audio_chunk = 0;
    } else
        idcin->audio_present = 1;
    idcin->next_chunk_is_video = 1;
    idcin->pts = 0;
    return 0;


--- a/source.c
+++ b/source.c
@@ -2,11 +2,11 @@
 {
     Vp3DecodeContext *s = avctx->priv_data;
     int i;
+    av_free(s->superblock_coding);
+    av_free(s->all_fragments);
+    av_free(s->coeffs);
+    av_free(s->coded_fragment_list);
+    av_free(s->superblock_fragments);
     av_free(s->superblock_macroblocks);
     av_free(s->macroblock_fragments);
     av_free(s->macroblock_coding);

static int vp3_decode_end(AVCodecContext *avctx)
{
    Vp3DecodeContext *s = avctx->priv_data;
    int i;
    av_free(s->superblock_coding);
    av_free(s->all_fragments);
    av_free(s->coeffs);
    av_free(s->coded_fragment_list);
    av_free(s->superblock_fragments);
    av_free(s->superblock_macroblocks);
    av_free(s->macroblock_fragments);
    av_free(s->macroblock_coding);
    /* release all frames */
    if (s->golden_frame.data[0] && s->golden_frame.data[0] != s->last_frame.data[0])
        avctx->release_buffer(avctx, &s->golden_frame);
    if (s->last_frame.data[0])
        avctx->release_buffer(avctx, &s->last_frame);
    /* no need to release the current_frame since it will always be pointing
     * to the same frame as either the golden or last frame */
    return 0;


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

+
+    ret = bdrv_child_check_perm(c, perm, shared, errp);
+
+    if (ret < 0) {
+
         bdrv_child_abort_perm_update(c);

         return ret;

int bdrv_child_try_set_perm(BdrvChild *c, uint64_t perm, uint64_t shared,

                            Error **errp)

{

    int ret;

    ret = bdrv_child_check_perm(c, perm, shared, errp);

    if (ret < 0) {

        bdrv_child_abort_perm_update(c);

        return ret;

    }

    bdrv_child_set_perm(c, perm, shared);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
         return AVERROR(EINVAL);

     }
+
+    mapped = clEnqueueMapBuffer(gpu_env.command_queue, src_cl_buf,
+
+                                      CL_TRUE,CL_MAP_READ, 0, buffer_size,
+
                                       0, NULL, NULL, &status);

int av_opencl_buffer_read_image(uint8_t **dst_data, int *plane_size, int plane_num,

                                       cl_mem src_cl_buf, size_t cl_buffer_size)

{

    int i,buffer_size = 0,ret = 0;

    uint8_t *temp;

    void *mapped;

    cl_int status;

    if ((unsigned int)plane_num > 8) {

        return AVERROR(EINVAL);

    }

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

        buffer_size += plane_size[i];

    }

    if (buffer_size > cl_buffer_size) {

        av_log(&openclutils, AV_LOG_ERROR, "Cannot write image to CPU buffer: OpenCL buffer too small\n");

        return AVERROR(EINVAL);

    }

    mapped = clEnqueueMapBuffer(gpu_env.command_queue, src_cl_buf,

                                      CL_TRUE,CL_MAP_READ, 0, buffer_size,

                                      0, NULL, NULL, &status);

    if (status != CL_SUCCESS) {

        av_log(&openclutils, AV_LOG_ERROR, "Could not map OpenCL buffer: %s\n", opencl_errstr(status));

        return AVERROR_EXTERNAL;

    }

    temp = mapped;

    if (ret >= 0) {

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

            memcpy(dst_data[i], temp, plane_size[i]);

            temp += plane_size[i];

        }

    }

    status = clEnqueueUnmapMemObject(gpu_env.command_queue, src_cl_buf, mapped, 0, NULL, NULL);

    if (status != CL_SUCCESS) {

        av_log(&openclutils, AV_LOG_ERROR, "Could not unmap OpenCL buffer: %s\n", opencl_errstr(status));

        return AVERROR_EXTERNAL;

    }

    return 0;

}


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

     memory_region_init(mr, owner, name, size);

+    mr->ram = true;
+
+    mr->terminates = true;
+
+    mr->destructor = memory_region_destructor_ram;

     mr->ram_addr = qemu_ram_alloc(size, mr);

void memory_region_init_ram(MemoryRegion *mr,

                            Object *owner,

                            const char *name,

                            uint64_t size)

{

    memory_region_init(mr, owner, name, size);

    mr->ram = true;

    mr->terminates = true;

    mr->destructor = memory_region_destructor_ram;

    mr->ram_addr = qemu_ram_alloc(size, mr);

}


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

     cc->dump_state = tricore_cpu_dump_state;
+
+    cc->set_pc = tricore_cpu_set_pc;
+
+    cc->synchronize_from_tb = tricore_cpu_synchronize_from_tb;
+

 }

static void tricore_cpu_class_init(ObjectClass *c, void *data)

{

    TriCoreCPUClass *mcc = TRICORE_CPU_CLASS(c);

    CPUClass *cc = CPU_CLASS(c);

    DeviceClass *dc = DEVICE_CLASS(c);

    mcc->parent_realize = dc->realize;

    dc->realize = tricore_cpu_realizefn;

    mcc->parent_reset = cc->reset;

    cc->reset = tricore_cpu_reset;

    cc->class_by_name = tricore_cpu_class_by_name;

    cc->has_work = tricore_cpu_has_work;

    cc->dump_state = tricore_cpu_dump_state;

    cc->set_pc = tricore_cpu_set_pc;

    cc->synchronize_from_tb = tricore_cpu_synchronize_from_tb;

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
     case 3: return AV_CH_LAYOUT_SURROUND;

     case 4: return AV_CH_LAYOUT_QUAD;
+
+    case 5: return AV_CH_LAYOUT_5POINT0;
+
+    case 6: return AV_CH_LAYOUT_5POINT1;
+
     case 8: return AV_CH_LAYOUT_7POINT1;

     default: return 0;

int64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name)

{

    switch(nb_channels) {

    case 1: return AV_CH_LAYOUT_MONO;

    case 2: return AV_CH_LAYOUT_STEREO;

    case 3: return AV_CH_LAYOUT_SURROUND;

    case 4: return AV_CH_LAYOUT_QUAD;

    case 5: return AV_CH_LAYOUT_5POINT0;

    case 6: return AV_CH_LAYOUT_5POINT1;

    case 8: return AV_CH_LAYOUT_7POINT1;

    default: return 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
         s->reg = 0;

         return ret;
+
+    case SERIAL_DATA:
+
+        s->rregs[R_STATUS] &= ~STATUS_RXAV;
+
         clr_rxint(s);

         if (s->type == kbd || s->type == mouse)

static uint64_t escc_mem_read(void *opaque, target_phys_addr_t addr,

                              unsigned size)

{

    SerialState *serial = opaque;

    ChannelState *s;

    uint32_t saddr;

    uint32_t ret;

    int channel;

    saddr = (addr >> serial->it_shift) & 1;

    channel = (addr >> (serial->it_shift + 1)) & 1;

    s = &serial->chn[channel];

    switch (saddr) {

    case SERIAL_CTRL:

        trace_escc_mem_readb_ctrl(CHN_C(s), s->reg, s->rregs[s->reg]);

        ret = s->rregs[s->reg];

        s->reg = 0;

        return ret;

    case SERIAL_DATA:

        s->rregs[R_STATUS] &= ~STATUS_RXAV;

        clr_rxint(s);

        if (s->type == kbd || s->type == mouse)

            ret = get_queue(s);

        else

            ret = s->rx;

        trace_escc_mem_readb_data(CHN_C(s), ret);

        if (s->chr)

            qemu_chr_accept_input(s->chr);

        return ret;

    default:

        break;

    }

    return 0;

}


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

 {

+    ppcuic_t *uic;

     uint32_t mask, sr;

static void ppcuic_set_irq (void *opaque, int irq_num, int level)

{

    ppcuic_t *uic;

    uint32_t mask, sr;

    uic = opaque;

    mask = 1 << (31-irq_num);

    LOG_UIC("%s: irq %d level %d uicsr %08" PRIx32

                " mask %08" PRIx32 " => %08" PRIx32 " %08" PRIx32 "\n",

                __func__, irq_num, level,

                uic->uicsr, mask, uic->uicsr & mask, level << irq_num);

    if (irq_num < 0 || irq_num > 31)

        return;

    sr = uic->uicsr;

    /* Update status register */

    if (uic->uictr & mask) {

        /* Edge sensitive interrupt */

        if (level == 1)

            uic->uicsr |= mask;

    } else {

        /* Level sensitive interrupt */

        if (level == 1) {

            uic->uicsr |= mask;

            uic->level |= mask;

        } else {

            uic->uicsr &= ~mask;

            uic->level &= ~mask;

        }

    }

    LOG_UIC("%s: irq %d level %d sr %" PRIx32 " => "

                "%08" PRIx32 "\n", __func__, irq_num, level, uic->uicsr, sr);

    if (sr != uic->uicsr)

        ppcuic_trigger_irq(uic);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void virtio_rng_process(VirtIORNG *vrng)
+
+{
+
+    size_t size;
+

     if (!is_guest_ready(vrng)) {

static void virtio_rng_process(VirtIORNG *vrng)

{

    size_t size;

    if (!is_guest_ready(vrng)) {

        return;

    }

    size = get_request_size(vrng->vq);

    size = MIN(vrng->quota_remaining, size);

    if (size) {

        rng_backend_request_entropy(vrng->rng, size, chr_read, vrng);

    }

}


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

                                            QObject *token, const char *msg, ...)

+{
+
+    va_list ap;
+
+    char message[1024];

     va_start(ap, msg);

static void GCC_FMT_ATTR(3, 4) parse_error(JSONParserContext *ctxt,

                                           QObject *token, const char *msg, ...)

{

    va_list ap;

    char message[1024];

    va_start(ap, msg);

    vsnprintf(message, sizeof(message), msg, ap);

    va_end(ap);

    if (ctxt->err) {

        error_free(ctxt->err);

        ctxt->err = NULL;

    }

    error_setg(&ctxt->err, "JSON parse error, %s", message);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 ssize_t slirp_send(struct socket *so, const void *buf, size_t len, int flags)

+{

     if (so->s == -1 && so->extra) {

ssize_t slirp_send(struct socket *so, const void *buf, size_t len, int flags)

{

    if (so->s == -1 && so->extra) {

        qemu_chr_fe_write(so->extra, buf, len);

        return len;

    }

    return send(so->s, buf, len, flags);

}


--- a/source.c
+++ b/source.c
@@ -1,16 +1,16 @@
+static CharDriverState *net_vhost_parse_chardev(const NetdevVhostUserOptions *opts)

 {

+    CharDriverState *chr = qemu_chr_find(opts->chardev);

     VhostUserChardevProps props;

+

     if (chr == NULL) {

+        error_report("chardev \"%s\" not found", opts->chardev);

         return NULL;

static CharDriverState *net_vhost_parse_chardev(const NetdevVhostUserOptions *opts)

{

    CharDriverState *chr = qemu_chr_find(opts->chardev);

    VhostUserChardevProps props;

    if (chr == NULL) {

        error_report("chardev \"%s\" not found", opts->chardev);

        return NULL;

    }

    /* inspect chardev opts */

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

    if (qemu_opt_foreach(chr->opts, net_vhost_chardev_opts, &props, NULL)) {

        return NULL;

    }

    if (!props.is_socket || !props.is_unix) {

        error_report("chardev \"%s\" is not a unix socket",

                     opts->chardev);

        return NULL;

    }

    qemu_chr_fe_claim_no_fail(chr);

    return chr;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)

 {
+
+    TAKDemuxContext *tc = s->priv_data;
+
+    int ret;
+

     if (tc->mlast_frame) {

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

{

    TAKDemuxContext *tc = s->priv_data;

    int ret;

    if (tc->mlast_frame) {

        AVIOContext *pb = s->pb;

        int64_t size, left;

        left = tc->data_end - avio_tell(s->pb);

        size = FFMIN(left, 1024);

        if (size <= 0)

            return AVERROR_EOF;

        ret = av_get_packet(pb, pkt, size);

        if (ret < 0)

            return ret;

        pkt->stream_index = 0;

    } else {

        ret = ff_raw_read_partial_packet(s, pkt);

    }

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 uint64_t helper_cvttq(CPUAlphaState *env, uint64_t a)
+
 {

     return inline_cvttq(env, a, FP_STATUS.float_rounding_mode, 1);

uint64_t helper_cvttq(CPUAlphaState *env, uint64_t a)

{

    return inline_cvttq(env, a, FP_STATUS.float_rounding_mode, 1);

}


--- a/source.c
+++ b/source.c
@@ -57,11 +57,11 @@
     if (ret < 0) {
         goto fail;
     g_free(s->l1_table);
+    old_l1_table_offset = s->l1_table_offset;
+    s->l1_table_offset = new_l1_table_offset;
+    s->l1_table = new_l1_table;
+    old_l1_size = s->l1_size;
+    s->l1_size = new_l1_size;
     qcow2_free_clusters(bs, old_l1_table_offset, old_l1_size * sizeof(uint64_t),
                         QCOW2_DISCARD_OTHER);
     return 0;

int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size,
                        bool exact_size)
{
    BDRVQcowState *s = bs->opaque;
    int new_l1_size2, ret, i;
    uint64_t *new_l1_table;
    int64_t old_l1_table_offset, old_l1_size;
    int64_t new_l1_table_offset, new_l1_size;
    uint8_t data[12];
    if (min_size <= s->l1_size)
        return 0;
    if (exact_size) {
        new_l1_size = min_size;
    } else {
        /* Bump size up to reduce the number of times we have to grow */
        new_l1_size = s->l1_size;
        if (new_l1_size == 0) {
            new_l1_size = 1;
        while (min_size > new_l1_size) {
            new_l1_size = (new_l1_size * 3 + 1) / 2;
    if (new_l1_size > INT_MAX / sizeof(uint64_t)) {
#ifdef DEBUG_ALLOC2
    fprintf(stderr, "grow l1_table from %d to %" PRId64 "\n",
            s->l1_size, new_l1_size);
#endif
    new_l1_size2 = sizeof(uint64_t) * new_l1_size;
    new_l1_table = g_malloc0(align_offset(new_l1_size2, 512));
    memcpy(new_l1_table, s->l1_table, s->l1_size * sizeof(uint64_t));
    /* write new table (align to cluster) */
    BLKDBG_EVENT(bs->file, BLKDBG_L1_GROW_ALLOC_TABLE);
    new_l1_table_offset = qcow2_alloc_clusters(bs, new_l1_size2);
    if (new_l1_table_offset < 0) {
        g_free(new_l1_table);
        return new_l1_table_offset;
    ret = qcow2_cache_flush(bs, s->refcount_block_cache);
    if (ret < 0) {
        goto fail;
    /* the L1 position has not yet been updated, so these clusters must
     * indeed be completely free */
    ret = qcow2_pre_write_overlap_check(bs, 0, new_l1_table_offset,
                                        new_l1_size2);
    if (ret < 0) {
        goto fail;
    BLKDBG_EVENT(bs->file, BLKDBG_L1_GROW_WRITE_TABLE);
    for(i = 0; i < s->l1_size; i++)
        new_l1_table[i] = cpu_to_be64(new_l1_table[i]);
    ret = bdrv_pwrite_sync(bs->file, new_l1_table_offset, new_l1_table, new_l1_size2);
    if (ret < 0)
        goto fail;
    for(i = 0; i < s->l1_size; i++)
        new_l1_table[i] = be64_to_cpu(new_l1_table[i]);
    /* set new table */
    BLKDBG_EVENT(bs->file, BLKDBG_L1_GROW_ACTIVATE_TABLE);
    cpu_to_be32w((uint32_t*)data, new_l1_size);
    stq_be_p(data + 4, new_l1_table_offset);
    ret = bdrv_pwrite_sync(bs->file, offsetof(QCowHeader, l1_size), data,sizeof(data));
    if (ret < 0) {
        goto fail;
    g_free(s->l1_table);
    old_l1_table_offset = s->l1_table_offset;
    s->l1_table_offset = new_l1_table_offset;
    s->l1_table = new_l1_table;
    old_l1_size = s->l1_size;
    s->l1_size = new_l1_size;
    qcow2_free_clusters(bs, old_l1_table_offset, old_l1_size * sizeof(uint64_t),
                        QCOW2_DISCARD_OTHER);
    return 0;
 fail:
    g_free(new_l1_table);
    qcow2_free_clusters(bs, new_l1_table_offset, new_l1_size2,
                        QCOW2_DISCARD_OTHER);
    return ret;


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
+static PCIDevice *find_dev(sPAPREnvironment *spapr,
+
                            uint64_t buid, uint32_t config_addr)

+{

     int devfn = (config_addr >> 8) & 0xFF;

+    sPAPRPHBState *phb;
+
+
+
     QLIST_FOREACH(phb, &spapr->phbs, list) {

         BusChild *kid;

static PCIDevice *find_dev(sPAPREnvironment *spapr,

                           uint64_t buid, uint32_t config_addr)

{

    int devfn = (config_addr >> 8) & 0xFF;

    sPAPRPHBState *phb;

    QLIST_FOREACH(phb, &spapr->phbs, list) {

        BusChild *kid;

        if (phb->buid != buid) {

            continue;

        }

        QTAILQ_FOREACH(kid, &phb->host_state.bus->qbus.children, sibling) {

            PCIDevice *dev = (PCIDevice *)kid->child;

            if (dev->devfn == devfn) {

                return dev;

            }

        }

    }

    return NULL;

}


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

     MpegEncContext *s     = &v->s;

+    AVCodecContext *avctx = s->avctx;

     SpriteData sd;

static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb)

{

    int ret;

    MpegEncContext *s     = &v->s;

    AVCodecContext *avctx = s->avctx;

    SpriteData sd;

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

    ret = vc1_parse_sprites(v, gb, &sd);

    if (ret < 0)

        return ret;

    if (!s->current_picture.f->data[0]) {

        av_log(avctx, AV_LOG_ERROR, "Got no sprites\n");

        return -1;

    }

    if (v->two_sprites && (!s->last_picture_ptr || !s->last_picture.f->data[0])) {

        av_log(avctx, AV_LOG_WARNING, "Need two sprites, only got one\n");

        v->two_sprites = 0;

    }

    av_frame_unref(v->sprite_output_frame);

    if ((ret = ff_get_buffer(avctx, v->sprite_output_frame, 0)) < 0)

        return ret;

    vc1_draw_sprites(v, &sd);

    return 0;

}


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

     uint64_t size;

+    uint8_t *buf;

     int err;

static int mov_read_extradata(MOVContext *c, AVIOContext *pb, MOVAtom atom,

                              enum AVCodecID codec_id)

{

    AVStream *st;

    uint64_t size;

    uint8_t *buf;

    int err;

    if (c->fc->nb_streams < 1) // will happen with jp2 files

        return 0;

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

    if (st->codec->codec_id != codec_id)

        return 0; /* unexpected codec_id - don't mess with extradata */

    size= (uint64_t)st->codec->extradata_size + atom.size + 8 + FF_INPUT_BUFFER_PADDING_SIZE;

    if (size > INT_MAX || (uint64_t)atom.size > INT_MAX)

        return AVERROR_INVALIDDATA;

    if ((err = av_reallocp(&st->codec->extradata, size)) < 0)

        return err;

    buf = st->codec->extradata + st->codec->extradata_size;

    st->codec->extradata_size= size - FF_INPUT_BUFFER_PADDING_SIZE;

    AV_WB32(       buf    , atom.size + 8);

    AV_WL32(       buf + 4, atom.type);

    avio_read(pb, buf + 8, atom.size);

    return 0;

}


static void spice_register_types(void)

{

    qemu_spice_init();

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void gen_wsr_debugcause(DisasContext *dc, uint32_t sr, TCGv_i32 v)

 {

static void gen_wsr_debugcause(DisasContext *dc, uint32_t sr, TCGv_i32 v)

{

}


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

     /* architectured initial values for CR 0 and 14 */
+
+    env->cregs[0] = CR0_RESET;
+
+    env->cregs[14] = CR14_RESET;
+

     /* architectured initial value for Breaking-Event-Address register */

static void s390_cpu_initial_reset(CPUState *s)

{

    S390CPU *cpu = S390_CPU(s);

    CPUS390XState *env = &cpu->env;

    int i;

    s390_cpu_reset(s);

    /* initial reset does not clear everything! */

    memset(&env->start_initial_reset_fields, 0,

        offsetof(CPUS390XState, end_reset_fields) -

        offsetof(CPUS390XState, start_initial_reset_fields));

    /* architectured initial values for CR 0 and 14 */

    env->cregs[0] = CR0_RESET;

    env->cregs[14] = CR14_RESET;

    /* architectured initial value for Breaking-Event-Address register */

    env->gbea = 1;

    env->pfault_token = -1UL;

    env->ext_index = -1;

    for (i = 0; i < ARRAY_SIZE(env->io_index); i++) {

        env->io_index[i] = -1;

    }

    env->mchk_index = -1;

    /* tininess for underflow is detected before rounding */

    set_float_detect_tininess(float_tininess_before_rounding,

                              &env->fpu_status);

    /* Reset state inside the kernel that we cannot access yet from QEMU. */

    if (kvm_enabled()) {

        kvm_s390_reset_vcpu(cpu);

    }

}


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

     case 4:

+        val = virtio_config_readl(proxy->vdev, addr);
+
+        if (virtio_is_big_endian()) {
+
+            val = bswap32(val);

         }

static uint64_t virtio_pci_config_read(void *opaque, hwaddr addr,

                                       unsigned size)

{

    VirtIOPCIProxy *proxy = opaque;

    uint32_t config = VIRTIO_PCI_CONFIG(&proxy->pci_dev);

    uint64_t val = 0;

    if (addr < config) {

        return virtio_ioport_read(proxy, addr);

    }

    addr -= config;

    switch (size) {

    case 1:

        val = virtio_config_readb(proxy->vdev, addr);

        break;

    case 2:

        val = virtio_config_readw(proxy->vdev, addr);

        if (virtio_is_big_endian()) {

            val = bswap16(val);

        }

        break;

    case 4:

        val = virtio_config_readl(proxy->vdev, addr);

        if (virtio_is_big_endian()) {

            val = bswap32(val);

        }

        break;

    }

    return val;

}


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

     for (i = 0; i < iov_cnt && size; i++) {

+        if (iov_off < (iovec_off + iov[i].iov_len)) {
+
+            size_t len = MIN((iovec_off + iov[i].iov_len) - iov_off , size);
+
+

             memset(iov[i].iov_base + (iov_off - iovec_off), fillc, len);

size_t iov_memset(const struct iovec *iov, const unsigned int iov_cnt,

                 size_t iov_off, int fillc, size_t size)

{

    size_t iovec_off, buf_off;

    unsigned int i;

    iovec_off = 0;

    buf_off = 0;

    for (i = 0; i < iov_cnt && size; i++) {

        if (iov_off < (iovec_off + iov[i].iov_len)) {

            size_t len = MIN((iovec_off + iov[i].iov_len) - iov_off , size);

            memset(iov[i].iov_base + (iov_off - iovec_off), fillc, len);

            buf_off += len;

            iov_off += len;

            size -= len;

        }

        iovec_off += iov[i].iov_len;

    }

    return buf_off;

}


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

 {

+    DeviceState *dev;

     SysBusDevice *s;

m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base,

                       uint32_t io_base, uint16_t size,

                       int type)

{

    DeviceState *dev;

    SysBusDevice *s;

    M48t59SysBusState *d;

    dev = qdev_create(NULL, "m48t59");

    qdev_prop_set_uint32(dev, "type", type);

    qdev_prop_set_uint32(dev, "size", size);

    qdev_prop_set_uint32(dev, "io_base", io_base);

    qdev_init(dev);

    s = sysbus_from_qdev(dev);

    sysbus_connect_irq(s, 0, IRQ);

    if (io_base != 0) {

        register_ioport_read(io_base, 0x04, 1, NVRAM_readb, s);

        register_ioport_write(io_base, 0x04, 1, NVRAM_writeb, s);

    }

    if (mem_base != 0) {

        sysbus_mmio_map(s, 0, mem_base);

    }

    d = FROM_SYSBUS(M48t59SysBusState, s);

    return &d->state;

}


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

     visit(qapi_dealloc_get_visitor(qdv), &native_in, errp);

+
+
+    qapi_dealloc_visitor_cleanup(qdv);

 }

static void dealloc_helper(void *native_in, VisitorFunc visit, Error **errp)

{

    QapiDeallocVisitor *qdv = qapi_dealloc_visitor_new();

    visit(qapi_dealloc_get_visitor(qdv), &native_in, errp);

    qapi_dealloc_visitor_cleanup(qdv);

}


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

+    if (bytes_left(bc) < 1)
+
+	return -1;
+
+

     val &= 0x7FFFFFFFFFFFFFFFULL; // FIXME can only encode upto 63 bits currently

static int put_v(ByteIOContext *bc, uint64_t val)

{

    int i;

//    if (bytes_left(s)*8 < 9)

//	return -1;

    if (bytes_left(bc) < 1)

	return -1;

    val &= 0x7FFFFFFFFFFFFFFFULL; // FIXME can only encode upto 63 bits currently

    i= get_length(val);

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

	put_byte(bc, 0x80 | (val>>i));

    }

    put_byte(bc, val&0x7f);

    return 0;

}


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

     int i;

+    size_t alignment = bdrv_opt_mem_align(bs);
+
+
+
+    for (i = 0; i < qiov->niov; i++) {

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

bool bdrv_qiov_is_aligned(BlockDriverState *bs, QEMUIOVector *qiov)

{

    int i;

    size_t alignment = bdrv_opt_mem_align(bs);

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

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

            return false;

        }

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

            return false;

        }

    }

    return true;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void disas_comp_b_imm(DisasContext *s, uint32_t insn)

+{
+
+    unsigned int sf, op, rt;
+
+    uint64_t addr;

     int label_match;

static void disas_comp_b_imm(DisasContext *s, uint32_t insn)

{

    unsigned int sf, op, rt;

    uint64_t addr;

    int label_match;

    TCGv_i64 tcg_cmp;

    sf = extract32(insn, 31, 1);

    op = extract32(insn, 24, 1); /* 0: CBZ; 1: CBNZ */

    rt = extract32(insn, 0, 5);

    addr = s->pc + sextract32(insn, 5, 19) * 4 - 4;

    tcg_cmp = read_cpu_reg(s, rt, sf);

    label_match = gen_new_label();

    tcg_gen_brcondi_i64(op ? TCG_COND_NE : TCG_COND_EQ,

                        tcg_cmp, 0, label_match);

    gen_goto_tb(s, 0, s->pc);

    gen_set_label(label_match);

    gen_goto_tb(s, 1, addr);

}


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

 {
+
     int i;

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

{

    int i;

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

        dst[i] += (int)(src[i] * (SUINT)coeff + (1 << 2)) >> 3;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void raw_refresh_limits(BlockDriverState *bs, Error **errp)
+
+{
+
+    BDRVRawState *s = bs->opaque;
+
     struct stat st;

static void raw_refresh_limits(BlockDriverState *bs, Error **errp)

{

    BDRVRawState *s = bs->opaque;

    struct stat st;

    if (!fstat(s->fd, &st)) {

        if (S_ISBLK(st.st_mode)) {

            int ret = hdev_get_max_transfer_length(s->fd);

            if (ret >= 0) {

                bs->bl.max_transfer_length = ret;

            }

        }

    }

    raw_probe_alignment(bs, s->fd, errp);

    bs->bl.min_mem_alignment = s->buf_align;

    bs->bl.opt_mem_alignment = MAX(s->buf_align, getpagesize());

}


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

     struct kvm_get_htab_fd s = {
+
         .flags = write ? KVM_GET_HTAB_WRITE : 0,
+
         .start_index = 0,

     };

int kvmppc_get_htab_fd(bool write)

{

    struct kvm_get_htab_fd s = {

        .flags = write ? KVM_GET_HTAB_WRITE : 0,

        .start_index = 0,

    };

    if (!cap_htab_fd) {

        fprintf(stderr, "KVM version doesn't support saving the hash table\n");

        return -1;

    }

    return kvm_vm_ioctl(kvm_state, KVM_PPC_GET_HTAB_FD, &s);

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
 	const char *format;

 	va_list args;
+
+{
+
 	vsprintf(string, format, args);

 	return strlen(string);

vsprintf_len(string, format, args)

	char *string;

	const char *format;

	va_list args;

{

	vsprintf(string, format, args);

	return strlen(string);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void virtio_net_handle_tx_bh(VirtIODevice *vdev, VirtQueue *vq)
+
 {

     VirtIONet *n = to_virtio_net(vdev);

+
     if (unlikely(n->tx_waiting)) {

         return;

static void virtio_net_handle_tx_bh(VirtIODevice *vdev, VirtQueue *vq)

{

    VirtIONet *n = to_virtio_net(vdev);

    if (unlikely(n->tx_waiting)) {

        return;

    }

    virtio_queue_set_notification(vq, 0);

    qemu_bh_schedule(n->tx_bh);

    n->tx_waiting = 1;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void cmv_decode_intra(CmvContext * s, const uint8_t *buf, const uint8_t *buf_end){

     unsigned char *dst = s->frame.data[0];
+
     int i;

static void cmv_decode_intra(CmvContext * s, const uint8_t *buf, const uint8_t *buf_end){

    unsigned char *dst = s->frame.data[0];

    int i;

    for (i=0; i < s->avctx->height && buf+s->avctx->width<=buf_end; i++) {

        memcpy(dst, buf, s->avctx->width);

        dst += s->frame.linesize[0];

        buf += s->avctx->width;

    }

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
     info = port ? DO_UPCAST(VirtIOSerialPortInfo, qdev, port->dev.info) : NULL;

+
+    if (!port || !port->host_connected || !info->have_data) {
+
+        discard_vq_data(vq, vdev);
+
         return;

     }

static void handle_output(VirtIODevice *vdev, VirtQueue *vq)

{

    VirtIOSerial *vser;

    VirtIOSerialPort *port;

    VirtIOSerialPortInfo *info;

    vser = DO_UPCAST(VirtIOSerial, vdev, vdev);

    port = find_port_by_vq(vser, vq);

    info = port ? DO_UPCAST(VirtIOSerialPortInfo, qdev, port->dev.info) : NULL;

    if (!port || !port->host_connected || !info->have_data) {

        discard_vq_data(vq, vdev);

        return;

    }

    if (!port->throttled) {

        do_flush_queued_data(port, vq, vdev);

        return;

    }

}


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

     DeviceClass *dc;
+
+    bool *show_no_user = opaque;
+
+
+
     dc = (DeviceClass *)object_class_dynamic_cast(klass, TYPE_DEVICE);

static void qdev_print_devinfo(ObjectClass *klass, void *opaque)

{

    DeviceClass *dc;

    bool *show_no_user = opaque;

    dc = (DeviceClass *)object_class_dynamic_cast(klass, TYPE_DEVICE);

    if (!dc || (show_no_user && !*show_no_user && dc->no_user)) {

        return;

    }

    error_printf("name \"%s\"", object_class_get_name(klass));

    if (dc->bus_info) {

        error_printf(", bus %s", dc->bus_info->name);

    }

    if (dc->alias) {

        error_printf(", alias \"%s\"", dc->alias);

    }

    if (dc->desc) {

        error_printf(", desc \"%s\"", dc->desc);

    }

    if (dc->no_user) {

        error_printf(", no-user");

    }

    error_printf("\n");

}


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

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

 }

static void cpu_exec_nocache(CPUArchState *env, int max_cycles,

                             TranslationBlock *orig_tb)

{

    CPUState *cpu = ENV_GET_CPU(env);

    TranslationBlock *tb;

    target_ulong pc = orig_tb->pc;

    target_ulong cs_base = orig_tb->cs_base;

    uint64_t flags = orig_tb->flags;

    /* Should never happen.

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

    if (max_cycles > CF_COUNT_MASK)

        max_cycles = CF_COUNT_MASK;

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

    tb_phys_invalidate(orig_tb, -1);

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

                     max_cycles);

    cpu->current_tb = tb;

    /* execute the generated code */

    trace_exec_tb_nocache(tb, tb->pc);

    cpu_tb_exec(cpu, tb->tc_ptr);

    cpu->current_tb = NULL;

    tb_phys_invalidate(tb, -1);

    tb_free(tb);

}


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

     if (unlikely(((int32_t)T0 == INT32_MIN && (int32_t)T1 == -1) ||


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int local_lstat(FsContext *fs_ctx, V9fsPath *fs_path, struct stat *stbuf)
+
+{
+
+    int err;
+
     char *buffer;

     char *path = fs_path->data;
@@ -12,22 +12,22 @@

     buffer = rpath(fs_ctx, path);

+    err =  lstat(buffer, stbuf);

     if (err) {
+
         goto err_out;

+    }

     if (fs_ctx->export_flags & V9FS_SM_MAPPED) {
+
         /* Actual credentials are part of extended attrs */

         uid_t tmp_uid;
+
         gid_t tmp_gid;
+
         mode_t tmp_mode;

         dev_t tmp_dev;

static int local_lstat(FsContext *fs_ctx, V9fsPath *fs_path, struct stat *stbuf)

{

    int err;

    char *buffer;

    char *path = fs_path->data;

    buffer = rpath(fs_ctx, path);

    err =  lstat(buffer, stbuf);

    if (err) {

        goto err_out;

    }

    if (fs_ctx->export_flags & V9FS_SM_MAPPED) {

        /* Actual credentials are part of extended attrs */

        uid_t tmp_uid;

        gid_t tmp_gid;

        mode_t tmp_mode;

        dev_t tmp_dev;

        if (getxattr(buffer, "user.virtfs.uid", &tmp_uid, sizeof(uid_t)) > 0) {

            stbuf->st_uid = le32_to_cpu(tmp_uid);

        }

        if (getxattr(buffer, "user.virtfs.gid", &tmp_gid, sizeof(gid_t)) > 0) {

            stbuf->st_gid = le32_to_cpu(tmp_gid);

        }

        if (getxattr(buffer, "user.virtfs.mode",

                    &tmp_mode, sizeof(mode_t)) > 0) {

            stbuf->st_mode = le32_to_cpu(tmp_mode);

        }

        if (getxattr(buffer, "user.virtfs.rdev", &tmp_dev, sizeof(dev_t)) > 0) {

            stbuf->st_rdev = le64_to_cpu(tmp_dev);

        }

    } else if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE) {

        local_mapped_file_attr(fs_ctx, path, stbuf);

    }

err_out:

    g_free(buffer);

    return err;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static uint32_t do_mac_read(lan9118_state *s, int reg)
+
+{
+
+    switch (reg) {

     case MAC_CR:

static uint32_t do_mac_read(lan9118_state *s, int reg)

{

    switch (reg) {

    case MAC_CR:

        return s->mac_cr;

    case MAC_ADDRH:

        return s->conf.macaddr.a[4] | (s->conf.macaddr.a[5] << 8);

    case MAC_ADDRL:

        return s->conf.macaddr.a[0] | (s->conf.macaddr.a[1] << 8)

               | (s->conf.macaddr.a[2] << 16) | (s->conf.macaddr.a[3] << 24);

    case MAC_HASHH:

        return s->mac_hashh;

        break;

    case MAC_HASHL:

        return s->mac_hashl;

        break;

    case MAC_MII_ACC:

        return s->mac_mii_acc;

    case MAC_MII_DATA:

        return s->mac_mii_data;

    case MAC_FLOW:

        return s->mac_flow;

    default:

        hw_error("lan9118: Unimplemented MAC register read: %d\n",

                 s->mac_cmd & 0xf);

    }

}


--- a/source.c
+++ b/source.c
@@ -34,11 +34,11 @@
         return ret;
     trace_qcow2_cache_get_read(qemu_coroutine_self(),
                                c == s->l2_table_cache, i);
+    c->entries[i].offset = 0;
+    if (read_from_disk) {
+        if (c == s->l2_table_cache) {
+            BLKDBG_EVENT(bs->file, BLKDBG_L2_LOAD);
+        ret = bdrv_pread(bs->file, offset,
                          qcow2_cache_get_table_addr(bs, c, i),
                          s->cluster_size);
         if (ret < 0) {

static int qcow2_cache_do_get(BlockDriverState *bs, Qcow2Cache *c,
    uint64_t offset, void **table, bool read_from_disk)
{
    BDRVQcow2State *s = bs->opaque;
    int i;
    int ret;
    int lookup_index;
    uint64_t min_lru_counter = UINT64_MAX;
    int min_lru_index = -1;
    trace_qcow2_cache_get(qemu_coroutine_self(), c == s->l2_table_cache,
                          offset, read_from_disk);
    /* Check if the table is already cached */
    i = lookup_index = (offset / s->cluster_size * 4) % c->size;
    do {
        const Qcow2CachedTable *t = &c->entries[i];
        if (t->offset == offset) {
            goto found;
        if (t->ref == 0 && t->lru_counter < min_lru_counter) {
            min_lru_counter = t->lru_counter;
            min_lru_index = i;
        if (++i == c->size) {
            i = 0;
    } while (i != lookup_index);
    if (min_lru_index == -1) {
        /* This can't happen in current synchronous code, but leave the check
         * here as a reminder for whoever starts using AIO with the cache */
        abort();
    /* Cache miss: write a table back and replace it */
    i = min_lru_index;
    trace_qcow2_cache_get_replace_entry(qemu_coroutine_self(),
                                        c == s->l2_table_cache, i);
    ret = qcow2_cache_entry_flush(bs, c, i);
    if (ret < 0) {
        return ret;
    trace_qcow2_cache_get_read(qemu_coroutine_self(),
                               c == s->l2_table_cache, i);
    c->entries[i].offset = 0;
    if (read_from_disk) {
        if (c == s->l2_table_cache) {
            BLKDBG_EVENT(bs->file, BLKDBG_L2_LOAD);
        ret = bdrv_pread(bs->file, offset,
                         qcow2_cache_get_table_addr(bs, c, i),
                         s->cluster_size);
        if (ret < 0) {
            return ret;
    c->entries[i].offset = offset;
    /* And return the right table */
found:
    c->entries[i].ref++;
    *table = qcow2_cache_get_table_addr(bs, c, i);
    trace_qcow2_cache_get_done(qemu_coroutine_self(),
                               c == s->l2_table_cache, i);
    return 0;


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

{

    DeviceClass *dc = DEVICE_CLASS(oc);

    dc->realize = fsl_imx31_realize;

    dc->desc = "i.MX31 SOC";

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void pc_q35_init_1_5(QEMUMachineInitArgs *args)

 {

static void pc_q35_init_1_5(QEMUMachineInitArgs *args)

{

    has_pci_info = false;

    pc_q35_init(args);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline void RENAME(nvXXtoUV)(uint8_t *dst1, uint8_t *dst2,

                                     const uint8_t *src, int width)

static inline void RENAME(nvXXtoUV)(uint8_t *dst1, uint8_t *dst2,

                                    const uint8_t *src, int width)

{

#if COMPILE_TEMPLATE_MMX

    __asm__ volatile(

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

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

        "1:                                         \n\t"

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

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

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

        "movq                %%mm1, %%mm3           \n\t"

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

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

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

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

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

        "packuswb            %%mm3, %%mm2           \n\t"

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

        "movq                %%mm2, (%3, %%"REG_a") \n\t"

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

        " js                    1b                  \n\t"

        : : "g" ((x86_reg)-width), "r" (src+width*2), "r" (dst1+width), "r" (dst2+width)

        : "%"REG_a

    );

#else

    int i;

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

        dst1[i] = src[2*i+0];

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

    }

#endif

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     mmu_idx = cpu_mmu_index(env);

     index = (virtaddr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
+
+ redo:
+
+    tlb_addr = env->tlb_table[mmu_idx][index].addr_read;
+
     if ((virtaddr & TARGET_PAGE_MASK) ==

         (tlb_addr & (TARGET_PAGE_MASK | TLB_INVALID_MASK))) {

uint64_t helper_ld_virt_to_phys (uint64_t virtaddr)

{

    uint64_t tlb_addr, physaddr;

    int index, mmu_idx;

    void *retaddr;

    mmu_idx = cpu_mmu_index(env);

    index = (virtaddr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);

 redo:

    tlb_addr = env->tlb_table[mmu_idx][index].addr_read;

    if ((virtaddr & TARGET_PAGE_MASK) ==

        (tlb_addr & (TARGET_PAGE_MASK | TLB_INVALID_MASK))) {

        physaddr = virtaddr + env->tlb_table[mmu_idx][index].addend;

    } else {

        /* the page is not in the TLB : fill it */

        retaddr = GETPC();

        tlb_fill(virtaddr, 0, mmu_idx, retaddr);

        goto redo;

    }

    return physaddr;

}


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

         }

+        /* try GetDiskFreeSpace too */
+
+    }
+
+

     if (s->drive_path[0]) {

static void raw_probe_alignment(BlockDriverState *bs)

{

    BDRVRawState *s = bs->opaque;

    DWORD sectorsPerCluster, freeClusters, totalClusters, count;

    DISK_GEOMETRY_EX dg;

    BOOL status;

    if (s->type == FTYPE_CD) {

        bs->request_alignment = 2048;

        return;

    }

    if (s->type == FTYPE_HARDDISK) {

        status = DeviceIoControl(s->hfile, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX,

                                 NULL, 0, &dg, sizeof(dg), &count, NULL);

        if (status != 0) {

            bs->request_alignment = dg.Geometry.BytesPerSector;

            return;

        }

        /* try GetDiskFreeSpace too */

    }

    if (s->drive_path[0]) {

        GetDiskFreeSpace(s->drive_path, &sectorsPerCluster,

                         &dg.Geometry.BytesPerSector,

                         &freeClusters, &totalClusters);

        bs->request_alignment = dg.Geometry.BytesPerSector;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static inline void init_thread(struct target_pt_regs *_regs, struct image_info *infop)

 {
+
+    _regs->gpr[1] = infop->start_stack;

 #if defined(TARGET_PPC64) && !defined(TARGET_ABI32)

static inline void init_thread(struct target_pt_regs *_regs, struct image_info *infop)

{

    _regs->gpr[1] = infop->start_stack;

#if defined(TARGET_PPC64) && !defined(TARGET_ABI32)

    if (get_ppc64_abi(infop) < 2) {

        _regs->gpr[2] = ldq_raw(infop->entry + 8) + infop->load_bias;

        infop->entry = ldq_raw(infop->entry) + infop->load_bias;

    } else {

        _regs->gpr[12] = infop->entry;  /* r12 set to global entry address */

    }

#endif

    _regs->nip = infop->entry;

}


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

     for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); ++i) {

+        X86CPUDefinition *def = &builtin_x86_defs[i];
+
+
+
+        /* Look for specific "cpudef" models that */

         /* have the QEMU version in .model_id */

void x86_cpudef_setup(void)

{

    int i, j;

    static const char *model_with_versions[] = { "qemu32", "qemu64", "athlon" };

    for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); ++i) {

        X86CPUDefinition *def = &builtin_x86_defs[i];

        /* Look for specific "cpudef" models that */

        /* have the QEMU version in .model_id */

        for (j = 0; j < ARRAY_SIZE(model_with_versions); j++) {

            if (strcmp(model_with_versions[j], def->name) == 0) {

                pstrcpy(def->model_id, sizeof(def->model_id),

                        "QEMU Virtual CPU version ");

                pstrcat(def->model_id, sizeof(def->model_id),

                        qemu_get_version());

                break;

            }

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     write_subsystem_identification();

     /*
+
      * The IPL PSW is at address 0. We also must not overwrite the

      * content of non-BIOS memory after we loaded the guest, so we

static void jump_to_IPL_code(uint64_t address)

{

    /* store the subsystem information _after_ the bootmap was loaded */

    write_subsystem_identification();

    /*

     * The IPL PSW is at address 0. We also must not overwrite the

     * content of non-BIOS memory after we loaded the guest, so we

     * save the original content and restore it in jump_to_IPL_2.

     */

    ResetInfo *current = 0;

    save = *current;

    current->ipl_addr = (uint32_t) (uint64_t) &jump_to_IPL_2;

    current->ipl_continue = address & 0x7fffffff;

    debug_print_int("set IPL addr to", current->ipl_continue);

    /* Ensure the guest output starts fresh */

    sclp_print("\n");

    /*

     * HACK ALERT.

     * We use the load normal reset to keep r15 unchanged. jump_to_IPL_2

     * can then use r15 as its stack pointer.

     */

    asm volatile("lghi 1,1\n\t"

                 "diag 1,1,0x308\n\t"

                 : : : "1", "memory");

    virtio_panic("\n! IPL returns !\n");

}


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

+    if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) {
+
+        nvdimm_acpi_hotplug(&pcms->acpi_nvdimm_state);
+
     }

 }

static void pc_dimm_post_plug(HotplugHandler *hotplug_dev,

                              DeviceState *dev, Error **errp)

{

    PCMachineState *pcms = PC_MACHINE(hotplug_dev);

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

        nvdimm_acpi_hotplug(&pcms->acpi_nvdimm_state);

    }

}


--- a/source.c
+++ b/source.c
@@ -45,11 +45,11 @@
         qemu_put_be32(f, se->instance_id);

         qemu_put_be32(f, se->version_id);
+
+
+
+        se->save_live_state(f, QEMU_VM_SECTION_START, se->opaque);
+
     }

int qemu_savevm_state_begin(QEMUFile *f)

{

    SaveStateEntry *se;

    qemu_put_be32(f, QEMU_VM_FILE_MAGIC);

    qemu_put_be32(f, QEMU_VM_FILE_VERSION);

    TAILQ_FOREACH(se, &savevm_handlers, entry) {

        int len;

        if (se->save_live_state == NULL)

            continue;

        /* Section type */

        qemu_put_byte(f, QEMU_VM_SECTION_START);

        qemu_put_be32(f, se->section_id);

        /* ID string */

        len = strlen(se->idstr);

        qemu_put_byte(f, len);

        qemu_put_buffer(f, (uint8_t *)se->idstr, len);

        qemu_put_be32(f, se->instance_id);

        qemu_put_be32(f, se->version_id);

        se->save_live_state(f, QEMU_VM_SECTION_START, se->opaque);

    }

    if (qemu_file_has_error(f))

        return -EIO;

    return 0;

}


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

     }

+
+
+#ifdef CONFIG_PRCTL_PR_SET_TIMERSLACK
+
+    prctl(PR_SET_TIMERSLACK, 1, 0, 0, 0);

 #endif

void init_clocks(void)

{

    QEMUClockType type;

    for (type = 0; type < QEMU_CLOCK_MAX; type++) {

        qemu_clock_init(type);

    }

#ifdef CONFIG_PRCTL_PR_SET_TIMERSLACK

    prctl(PR_SET_TIMERSLACK, 1, 0, 0, 0);

#endif

}


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

     int ich, ilms;
+
     s->mclms_recent = s->mclms_order * s->num_channels;

     for (ich = 0; ich < s->num_channels; ich++) {

static void reset_codec(WmallDecodeCtx *s)

{

    int ich, ilms;

    s->mclms_recent = s->mclms_order * s->num_channels;

    for (ich = 0; ich < s->num_channels; ich++) {

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

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

        /* first sample of a seekable subframe is considered as the starting of

           a transient area which is samples_per_frame samples long */

        s->channel[ich].transient_counter = s->samples_per_frame;

        s->transient[ich] = 1;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void visit_end_struct(Visitor *v, Error **errp)
+
 {

     assert(!error_is_set(errp));

void visit_end_struct(Visitor *v, Error **errp)

{

    assert(!error_is_set(errp));

    v->end_struct(v, errp);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 bool memory_region_is_skip_dump(MemoryRegion *mr)
+
 {

     return mr->skip_dump;

bool memory_region_is_skip_dump(MemoryRegion *mr)

{

    return mr->skip_dump;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void ga_command_state_add(GACommandState *cs,
+
                           void (*init)(void),

                           void (*cleanup)(void))

void ga_command_state_add(GACommandState *cs,

                          void (*init)(void),

                          void (*cleanup)(void))

{

    GACommandGroup *cg = g_malloc0(sizeof(GACommandGroup));

    cg->init = init;

    cg->cleanup = cleanup;

    cs->groups = g_slist_append(cs->groups, cg);

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     abi_ulong frame_addr;

     struct rt_sigframe_v2 *frame = NULL;
+
+
+
+    /*
+
      * Since we stacked the signal on a 64-bit boundary,

      * then 'sp' should be word aligned here.  If it's

static long do_rt_sigreturn_v2(CPUARMState *env)

{

    abi_ulong frame_addr;

    struct rt_sigframe_v2 *frame = NULL;

    /*

     * Since we stacked the signal on a 64-bit boundary,

     * then 'sp' should be word aligned here.  If it's

     * not, then the user is trying to mess with us.

     */

    frame_addr = env->regs[13];

    trace_user_do_rt_sigreturn(env, frame_addr);

    if (frame_addr & 7) {

        goto badframe;

    }

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

        goto badframe;

    }

    if (do_sigframe_return_v2(env, frame_addr, &frame->uc)) {

        goto badframe;

    }

    unlock_user_struct(frame, frame_addr, 0);

    return env->regs[0];

badframe:

    unlock_user_struct(frame, frame_addr, 0);

    force_sig(TARGET_SIGSEGV /* , current */);

    return 0;

}


static int curl_aio_flush(void *opaque)

{

    BDRVCURLState *s = opaque;

    int i, j;

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

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

            if (s->states[i].acb[j]) {

                return 1;

            }

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void copy_video_props(AVFilterBufferRefVideoProps *dst, AVFilterBufferRefVideoProps *src) {

     *dst = *src;

static void copy_video_props(AVFilterBufferRefVideoProps *dst, AVFilterBufferRefVideoProps *src) {

    *dst = *src;

    if (src->qp_table) {

        int qsize = src->qp_table_size;

        dst->qp_table = av_malloc(qsize);

        memcpy(dst->qp_table, src->qp_table, qsize);

    }

}


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

         cpu_outl(addr, data);

+        return;
+
+    }
+
+    assert(0);

 }

static void spapr_io_write(void *opaque, hwaddr addr,

                           uint64_t data, unsigned size)

{

    switch (size) {

    case 1:

        cpu_outb(addr, data);

        return;

    case 2:

        cpu_outw(addr, data);

        return;

    case 4:

        cpu_outl(addr, data);

        return;

    }

    assert(0);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static inline void test_server_connect(TestServer *server)
+
 {

     test_server_create_chr(server, ",reconnect=1");

static inline void test_server_connect(TestServer *server)

{

    test_server_create_chr(server, ",reconnect=1");

}


static int make_cdt15_entry(int p1, int p2, int16_t *cdt)

{

    int r, b, lo;

    b = cdt[p2];

    r = cdt[p1] * 1024;

    lo = b + r;

    return (lo + (lo * (1 << 16))) * 2;

}