--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+void usb_packet_unmap(USBPacket *p)
+
 {

+    int is_write = (p->pid == USB_TOKEN_IN);

     int i;

void usb_packet_unmap(USBPacket *p)

{

    int is_write = (p->pid == USB_TOKEN_IN);

    int i;

    for (i = 0; i < p->iov.niov; i++) {

        cpu_physical_memory_unmap(p->iov.iov[i].iov_base,

                                  p->iov.iov[i].iov_len, is_write,

                                  p->iov.iov[i].iov_len);

    }

}


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

     DisasContext *ctx = opaque;

+
+
+    gen_op_store_ibatu((sprn - SPR_IBAT0U) / 2);

     RET_STOP(ctx);

static void spr_write_ibatu (void *opaque, int sprn)

{

    DisasContext *ctx = opaque;

    gen_op_store_ibatu((sprn - SPR_IBAT0U) / 2);

    RET_STOP(ctx);

}


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

     memset(desc, 0, sizeof(desc));

+    if (bdrv_pread(bs->file, s->desc_offset, desc, DESC_SIZE) != DESC_SIZE) {
+
+        return -EIO;
+
+    }

static int vmdk_write_cid(BlockDriverState *bs, uint32_t cid)

{

    char desc[DESC_SIZE], tmp_desc[DESC_SIZE];

    char *p_name, *tmp_str;

    BDRVVmdkState *s = bs->opaque;

    memset(desc, 0, sizeof(desc));

    if (bdrv_pread(bs->file, s->desc_offset, desc, DESC_SIZE) != DESC_SIZE) {

        return -EIO;

    }

    tmp_str = strstr(desc,"parentCID");

    pstrcpy(tmp_desc, sizeof(tmp_desc), tmp_str);

    if ((p_name = strstr(desc,"CID")) != NULL) {

        p_name += sizeof("CID");

        snprintf(p_name, sizeof(desc) - (p_name - desc), "%x\n", cid);

        pstrcat(desc, sizeof(desc), tmp_desc);

    }

    if (bdrv_pwrite_sync(bs->file, s->desc_offset, desc, DESC_SIZE) < 0) {

        return -EIO;

    }

    return 0;

}


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

         env->exception.fsr |= (1 << 11);

+    }
+
+
+
+    raise_exception(env, EXCP_DATA_ABORT,

                     syn_data_abort(same_el, 0, 0, 0, is_write == 1, 0x21),

void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, int is_write,

                                 int is_user, uintptr_t retaddr)

{

    ARMCPU *cpu = ARM_CPU(cs);

    CPUARMState *env = &cpu->env;

    int target_el;

    bool same_el;

    if (retaddr) {

        /* now we have a real cpu fault */

        cpu_restore_state(cs, retaddr);

    }

    target_el = exception_target_el(env);

    same_el = (arm_current_el(env) == target_el);

    env->exception.vaddress = vaddr;

    /* the DFSR for an alignment fault depends on whether we're using

     * the LPAE long descriptor format, or the short descriptor format

     */

    if (arm_regime_using_lpae_format(env, cpu_mmu_index(env, false))) {

        env->exception.fsr = 0x21;

    } else {

        env->exception.fsr = 0x1;

    }

    if (is_write == 1 && arm_feature(env, ARM_FEATURE_V6)) {

        env->exception.fsr |= (1 << 11);

    }

    raise_exception(env, EXCP_DATA_ABORT,

                    syn_data_abort(same_el, 0, 0, 0, is_write == 1, 0x21),

                    target_el);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int data_size)

 {

@@ -21,11 +21,11 @@
     if (flags & 1) {

         palette = (uint32_t *)seq->frame.data[1];
+
         for (i = 0; i < 256; i++) {
+
             for (j = 0; j < 3; j++, data++)
+
                 c[j] = (*data << 2) | (*data >> 4);

             palette[i] = AV_RB24(c);

static void seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int data_size)

{

    GetBitContext gb;

    int flags, i, j, x, y, op;

    unsigned char c[3];

    unsigned char *dst;

    uint32_t *palette;

    flags = *data++;

    if (flags & 1) {

        palette = (uint32_t *)seq->frame.data[1];

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

            for (j = 0; j < 3; j++, data++)

                c[j] = (*data << 2) | (*data >> 4);

            palette[i] = AV_RB24(c);

        }

        seq->frame.palette_has_changed = 1;

    }

    if (flags & 2) {

        init_get_bits(&gb, data, 128 * 8); data += 128;

        for (y = 0; y < 128; y += 8)

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

                dst = &seq->frame.data[0][y * seq->frame.linesize[0] + x];

                op = get_bits(&gb, 2);

                switch (op) {

                case 1:

                    data = seq_decode_op1(seq, data, dst);

                    break;

                case 2:

                    data = seq_decode_op2(seq, data, dst);

                    break;

                case 3:

                    data = seq_decode_op3(seq, data, dst);

                    break;

                }

            }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void dbdma_cmdptr_save(DBDMA_channel *ch)

 {
+
+    DBDMA_DPRINTF("dbdma_cmdptr_save 0x%08x\n",
+
+                  be32_to_cpu(ch->regs[DBDMA_CMDPTR_LO]));

     DBDMA_DPRINTF("xfer_status 0x%08x res_count 0x%04x\n",

static void dbdma_cmdptr_save(DBDMA_channel *ch)

{

    DBDMA_DPRINTF("dbdma_cmdptr_save 0x%08x\n",

                  be32_to_cpu(ch->regs[DBDMA_CMDPTR_LO]));

    DBDMA_DPRINTF("xfer_status 0x%08x res_count 0x%04x\n",

                  le16_to_cpu(ch->current.xfer_status),

                  le16_to_cpu(ch->current.res_count));

    cpu_physical_memory_write(be32_to_cpu(ch->regs[DBDMA_CMDPTR_LO]),

                              (uint8_t*)&ch->current, sizeof(dbdma_cmd));

}


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

     if (env)

+        env->last_io_time = cpu_get_time_fast();
+
+#endif
+
 }

void cpu_outw(CPUState *env, pio_addr_t addr, uint16_t val)

{

    LOG_IOPORT("outw: %04"FMT_pioaddr" %04"PRIx16"\n", addr, val);

    ioport_write(1, addr, val);

#ifdef CONFIG_KQEMU

    if (env)

        env->last_io_time = cpu_get_time_fast();

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 ReadLineState *readline_init(ReadLinePrintfFunc *printf_func,
+
                              ReadLineFlushFunc *flush_func,

                              void *opaque,

ReadLineState *readline_init(ReadLinePrintfFunc *printf_func,

                             ReadLineFlushFunc *flush_func,

                             void *opaque,

                             ReadLineCompletionFunc *completion_finder)

{

    ReadLineState *rs = g_malloc0(sizeof(*rs));

    rs->hist_entry = -1;

    rs->opaque = opaque;

    rs->printf_func = printf_func;

    rs->flush_func = flush_func;

    rs->completion_finder = completion_finder;

    return rs;

}


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

     BlizzardState *s = (BlizzardState *) opaque;
+
+    DisplaySurface *surface = qemu_console_surface(s->con);
+
+
+
     blizzard_update_display(opaque);

     if (s && surface_data(surface)) {

static void blizzard_screen_dump(void *opaque, const char *filename,

                                 bool cswitch, Error **errp)

{

    BlizzardState *s = (BlizzardState *) opaque;

    DisplaySurface *surface = qemu_console_surface(s->con);

    blizzard_update_display(opaque);

    if (s && surface_data(surface)) {

        ppm_save(filename, surface, errp);

    }

}


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

 {

+    DeviceState *dev = qdev_create(NULL, TYPE_CFI_PFLASH01);
+
+
+
+    if (bs && qdev_prop_set_drive(dev, "drive", bs)) {

         abort();

type_init(pflash_cfi01_register_types)

pflash_t *pflash_cfi01_register(hwaddr base,

                                DeviceState *qdev, const char *name,

                                hwaddr size,

                                BlockDriverState *bs,

                                uint32_t sector_len, int nb_blocs,

                                int bank_width, uint16_t id0, uint16_t id1,

                                uint16_t id2, uint16_t id3, int be)

{

    DeviceState *dev = qdev_create(NULL, TYPE_CFI_PFLASH01);

    if (bs && qdev_prop_set_drive(dev, "drive", bs)) {

        abort();

    }

    qdev_prop_set_uint32(dev, "num-blocks", nb_blocs);

    qdev_prop_set_uint64(dev, "sector-length", sector_len);

    qdev_prop_set_uint8(dev, "width", bank_width);

    qdev_prop_set_uint8(dev, "big-endian", !!be);

    qdev_prop_set_uint16(dev, "id0", id0);

    qdev_prop_set_uint16(dev, "id1", id1);

    qdev_prop_set_uint16(dev, "id2", id2);

    qdev_prop_set_uint16(dev, "id3", id3);

    qdev_prop_set_string(dev, "name", name);

    qdev_init_nofail(dev);

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

    return CFI_PFLASH01(dev);

}


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

                                     int nb_sectors, int *pnum,

+                                    BlockDriverState **file)
+
 {

     Coroutine *co;

int64_t bdrv_get_block_status_above(BlockDriverState *bs,

                                    BlockDriverState *base,

                                    int64_t sector_num,

                                    int nb_sectors, int *pnum,

                                    BlockDriverState **file)

{

    Coroutine *co;

    BdrvCoGetBlockStatusData data = {

        .bs = bs,

        .base = base,

        .file = file,

        .sector_num = sector_num,

        .nb_sectors = nb_sectors,

        .pnum = pnum,

        .done = false,

    };

    if (qemu_in_coroutine()) {

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

        bdrv_get_block_status_above_co_entry(&data);

    } else {

        AioContext *aio_context = bdrv_get_aio_context(bs);

        co = qemu_coroutine_create(bdrv_get_block_status_above_co_entry);

        qemu_coroutine_enter(co, &data);

        while (!data.done) {

            aio_poll(aio_context, true);

        }

    }

    return data.ret;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline void asv2_put_level(PutBitContext *pb, int level)

 {

static inline void asv2_put_level(PutBitContext *pb, int level)

{

    unsigned int index = level + 31;

    if (index <= 62) {

        put_bits(pb, ff_asv2_level_tab[index][1], ff_asv2_level_tab[index][0]);

    } else {

        put_bits(pb, ff_asv2_level_tab[31][1], ff_asv2_level_tab[31][0]);

        asv2_put_bits(pb, 8, level & 0xFF);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void address_space_update_ioeventfds(AddressSpace *as)
+
+{
+
+    FlatView *view;
+
     FlatRange *fr;

     unsigned ioeventfd_nb = 0;

static void address_space_update_ioeventfds(AddressSpace *as)

{

    FlatView *view;

    FlatRange *fr;

    unsigned ioeventfd_nb = 0;

    MemoryRegionIoeventfd *ioeventfds = NULL;

    AddrRange tmp;

    unsigned i;

    view = as->current_map;

    FOR_EACH_FLAT_RANGE(fr, view) {

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

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

                                  int128_sub(fr->addr.start,

                                             int128_make64(fr->offset_in_region)));

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

                ++ioeventfd_nb;

                ioeventfds = g_realloc(ioeventfds,

                                          ioeventfd_nb * sizeof(*ioeventfds));

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

                ioeventfds[ioeventfd_nb-1].addr = tmp;

            }

        }

    }

    address_space_add_del_ioeventfds(as, ioeventfds, ioeventfd_nb,

                                     as->ioeventfds, as->ioeventfd_nb);

    g_free(as->ioeventfds);

    as->ioeventfds = ioeventfds;

    as->ioeventfd_nb = ioeventfd_nb;

}


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

 #ifdef TARGET_ABI32

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

         break;

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

{

    switch (kind & CTLTYPE) {

    case CTLTYPE_INT:

    case CTLTYPE_UINT:

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

        break;

#ifdef TARGET_ABI32

    case CTLTYPE_LONG:

    case CTLTYPE_ULONG:

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

        break;

#else

    case CTLTYPE_LONG:

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

    case CTLTYPE_ULONG:

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

        break;

#endif

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

    case CTLTYPE_QUAD:

#else

    case CTLTYPE_U64:

#endif

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

        break;

    case CTLTYPE_STRING:

        break;

    default:

        /* XXX unhandled */

        return -1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -17,9 +17,9 @@
                 MAX(bs->bl.write_zeroes_alignment,

                     s->extents[i].cluster_sectors);
+
+        }
+
+    }
+
 }

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

{

    BDRVVmdkState *s = bs->opaque;

    int i;

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

        if (!s->extents[i].flat) {

            bs->bl.write_zeroes_alignment =

                MAX(bs->bl.write_zeroes_alignment,

                    s->extents[i].cluster_sectors);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 int nbd_init(int fd, QIOChannelSocket *ioc, uint32_t flags, off_t size)
+
 {

     return -ENOTSUP;

int nbd_init(int fd, QIOChannelSocket *ioc, uint32_t flags, off_t size)

{

    return -ENOTSUP;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 START_TEST(unterminated_dict_comma)

+{
+
     QObject *obj = qobject_from_json("{'abc':32,");

     fail_unless(obj == NULL);

START_TEST(unterminated_dict_comma)

{

    QObject *obj = qobject_from_json("{'abc':32,");

    fail_unless(obj == NULL);

}


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

         while (av_isdigit(*fraction) && scale) {

+            mb += scale * (*fraction - '0');
+
+            scale /= 10;
+
+            fraction++;

         }

static int32_t parse_gain(const char *gain)

{

    char *fraction;

    int  scale = 10000;

    int32_t mb = 0;

    int db;

    if (!gain)

        return INT32_MIN;

    gain += strspn(gain, " \t");

    db = strtol(gain, &fraction, 0);

    if (*fraction++ == '.') {

        while (av_isdigit(*fraction) && scale) {

            mb += scale * (*fraction - '0');

            scale /= 10;

            fraction++;

        }

    }

    if (abs(db) > (INT32_MAX - mb) / 100000)

        return INT32_MIN;

    return db * 100000 + FFSIGN(db) * mb;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int plot_cqt(AVFilterContext *ctx)

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

     ShowCQTContext *s = ctx->priv;

static int plot_cqt(AVFilterContext *ctx)

{

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

    ShowCQTContext *s = ctx->priv;

    int ret;

    memcpy(s->fft_result, s->fft_data, s->fft_len * sizeof(*s->fft_data));

    av_fft_permute(s->fft_ctx, s->fft_result);

    av_fft_calc(s->fft_ctx, s->fft_result);

    s->fft_result[s->fft_len] = s->fft_result[0];

    s->cqt_calc(s->cqt_result, s->fft_result, s->coeffs, s->cqt_len, s->fft_len);

    process_cqt(s);

    if (s->sono_h)

        s->update_sono(s->sono_frame, s->c_buf, s->sono_idx);

    if (!s->sono_count) {

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

        if (!out)

            return AVERROR(ENOMEM);

        if (s->bar_h)

            s->draw_bar(out, s->h_buf, s->rcp_h_buf, s->c_buf, s->bar_h);

        if (s->axis_h)

            s->draw_axis(out, s->axis_frame, s->c_buf, s->bar_h);

        if (s->sono_h)

            s->draw_sono(out, s->sono_frame, s->bar_h + s->axis_h, s->sono_idx);

        out->pts = s->frame_count;

        ret = ff_filter_frame(outlink, out);

        s->frame_count++;

    }

    s->sono_count = (s->sono_count + 1) % s->count;

    if (s->sono_h)

        s->sono_idx = (s->sono_idx + s->sono_h - 1) % s->sono_h;

    return ret;

}


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

     report("lowpass_line_8");

void checkasm_check_vf_interlace(void)

{

    check_lowpass_line(8);

    report("lowpass_line_8");

    check_lowpass_line(16);

    report("lowpass_line_16");

}


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

         return err;

+    }
+
+    if (fs_ctx->fs_sm == SM_MAPPED) {
+
+        /* Actual credentials are part of extended attrs */

         uid_t tmp_uid;

static int local_fstat(FsContext *fs_ctx, int fd, struct stat *stbuf)

{

    int err;

    err = fstat(fd, stbuf);

    if (err) {

        return err;

    }

    if (fs_ctx->fs_sm == 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 (fgetxattr(fd, "user.virtfs.uid", &tmp_uid, sizeof(uid_t)) > 0) {

            stbuf->st_uid = tmp_uid;

        }

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

            stbuf->st_gid = tmp_gid;

        }

        if (fgetxattr(fd, "user.virtfs.mode", &tmp_mode, sizeof(mode_t)) > 0) {

            stbuf->st_mode = tmp_mode;

        }

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

                stbuf->st_rdev = tmp_dev;

        }

    }

    return err;

}


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

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

 }

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

{

    ar->pm1.cnt.s4_val = s4_val;

    ar->wakeup.notify = acpi_notify_wakeup;

    qemu_register_wakeup_notifier(&ar->wakeup);

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

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

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

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void qemu_rdma_init_one_block(void *host_addr,
+
+    ram_addr_t block_offset, ram_addr_t length, void *opaque)

 {

static void qemu_rdma_init_one_block(void *host_addr,

    ram_addr_t block_offset, ram_addr_t length, void *opaque)

{

    rdma_add_block(opaque, host_addr, block_offset, length);

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
         bdrv_attach_aio_context(bs->file->bs, new_context);

     }
+
+    if (bs->drv->bdrv_attach_aio_context) {
+
+        bs->drv->bdrv_attach_aio_context(bs, new_context);
+
     }

     if (bs->io_limits_enabled) {

void bdrv_attach_aio_context(BlockDriverState *bs,

                             AioContext *new_context)

{

    BdrvAioNotifier *ban;

    if (!bs->drv) {

        return;

    }

    bs->aio_context = new_context;

    if (bs->backing) {

        bdrv_attach_aio_context(bs->backing->bs, new_context);

    }

    if (bs->file) {

        bdrv_attach_aio_context(bs->file->bs, new_context);

    }

    if (bs->drv->bdrv_attach_aio_context) {

        bs->drv->bdrv_attach_aio_context(bs, new_context);

    }

    if (bs->io_limits_enabled) {

        throttle_timers_attach_aio_context(&bs->throttle_timers, new_context);

    }

    QLIST_FOREACH(ban, &bs->aio_notifiers, list) {

        ban->attached_aio_context(new_context, ban->opaque);

    }

}


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

         return -1;

+    }
+
+    return lgetxattr(rpath(ctx, path, buffer), name, value, size);
+
+}

static ssize_t mp_user_getxattr(FsContext *ctx, const char *path,

                                const char *name, void *value, size_t size)

{

    char buffer[PATH_MAX];

    if (strncmp(name, "user.virtfs.", 12) == 0) {

        /*

         * Don't allow fetch of user.virtfs namesapce

         * in case of mapped security

         */

        errno = ENOATTR;

        return -1;

    }

    return lgetxattr(rpath(ctx, path, buffer), name, value, size);

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
                          type1.version);

     smbios_maybe_add_str(1, offsetof(struct smbios_type_1, serial_number_str),
+
+                         type1.serial);
+
+    smbios_maybe_add_str(1, offsetof(struct smbios_type_1, sku_number_str),
+
                          type1.sku);

     smbios_maybe_add_str(1, offsetof(struct smbios_type_1, family_str),

static void smbios_build_type_1_fields(void)

{

    smbios_maybe_add_str(1, offsetof(struct smbios_type_1, manufacturer_str),

                         type1.manufacturer);

    smbios_maybe_add_str(1, offsetof(struct smbios_type_1, product_name_str),

                         type1.product);

    smbios_maybe_add_str(1, offsetof(struct smbios_type_1, version_str),

                         type1.version);

    smbios_maybe_add_str(1, offsetof(struct smbios_type_1, serial_number_str),

                         type1.serial);

    smbios_maybe_add_str(1, offsetof(struct smbios_type_1, sku_number_str),

                         type1.sku);

    smbios_maybe_add_str(1, offsetof(struct smbios_type_1, family_str),

                         type1.family);

    if (qemu_uuid_set) {

        /* We don't encode the UUID in the "wire format" here because this

         * function is for legacy mode and needs to keep the guest ABI, and

         * because we don't know what's the SMBIOS version advertised by the

         * BIOS.

         */

        smbios_add_field(1, offsetof(struct smbios_type_1, uuid),

                         qemu_uuid, 16);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 int coroutine_fn bdrv_co_pwrite_zeroes(BlockDriverState *bs,

+                                       int64_t offset, int count,
+
+                                       BdrvRequestFlags flags)
+
+{

     trace_bdrv_co_pwrite_zeroes(bs, offset, count, flags);

int coroutine_fn bdrv_co_pwrite_zeroes(BlockDriverState *bs,

                                       int64_t offset, int count,

                                       BdrvRequestFlags flags)

{

    trace_bdrv_co_pwrite_zeroes(bs, offset, count, flags);

    if (!(bs->open_flags & BDRV_O_UNMAP)) {

        flags &= ~BDRV_REQ_MAY_UNMAP;

    }

    return bdrv_co_pwritev(bs, offset, count, NULL,

                           BDRV_REQ_ZERO_WRITE | flags);

}


void qemu_put_be64(QEMUFile *f, uint64_t v)

{

    qemu_put_be32(f, v >> 32);

    qemu_put_be32(f, v);

}


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

             max = state->sustain;

+        }
+
+        state->sustain -= max;
+
+    }

     result = 0;

static int hdcd_scan(HDCDContext *ctx, hdcd_state_t *state, const int32_t *samples, int max, int stride)

{

    int cdt_active = 0;

    /* code detect timer */

    int result;

    if (state->sustain > 0) {

        cdt_active = 1;

        if (state->sustain <= max) {

            state->control = 0;

            max = state->sustain;

        }

        state->sustain -= max;

    }

    result = 0;

    while (result < max) {

        int flag;

        int consumed = hdcd_integrate(ctx, state, &flag, samples, max - result, stride);

        result += consumed;

        if (flag > 0) {

            /* reset timer if code detected in channel */

            hdcd_sustain_reset(state);

            break;

        }

        samples += consumed * stride;

    }

    /* code detect timer expired */

    if (cdt_active && state->sustain == 0)

        state->count_sustain_expired++;

    return result;

}


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

 {

+    return ldq_phys_internal(addr, DEVICE_BIG_ENDIAN);

 }

uint64_t ldq_be_phys(target_phys_addr_t addr)

{

    return ldq_phys_internal(addr, DEVICE_BIG_ENDIAN);

}


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

 {

+    DPRINTF("pm_write_config  address 0x%x  val 0x%x len 0x%x \n",
+
+           address, val, len);

     pci_default_write_config(d, address, val, len);

static void pm_write_config(PCIDevice *d,

                            uint32_t address, uint32_t val, int len)

{

    DPRINTF("pm_write_config  address 0x%x  val 0x%x len 0x%x \n",

           address, val, len);

    pci_default_write_config(d, address, val, len);

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
+void *ff_schro_queue_pop(FFSchroQueue *queue)
+
+{
+
+    FFSchroQueueElement *top = queue->p_head;
+
+
+
     if (top) {
+
         void *data = top->data;

         queue->p_head = queue->p_head->next;

void *ff_schro_queue_pop(FFSchroQueue *queue)

{

    FFSchroQueueElement *top = queue->p_head;

    if (top) {

        void *data = top->data;

        queue->p_head = queue->p_head->next;

        --queue->size;

        av_freep(&top);

        return data;

    }

    return NULL;

}


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

     sigprocmask(SIG_SETMASK, &set, 0);

+
+
+    pending = atomic_xchg(&ts->signal_pending, 1);
+
+

     return pending;

int block_signals(void)

{

    TaskState *ts = (TaskState *)thread_cpu->opaque;

    sigset_t set;

    int pending;

    /* It's OK to block everything including SIGSEGV, because we won't

     * run any further guest code before unblocking signals in

     * process_pending_signals().

     */

    sigfillset(&set);

    sigprocmask(SIG_SETMASK, &set, 0);

    pending = atomic_xchg(&ts->signal_pending, 1);

    return pending;

}


--- a/source.c
+++ b/source.c
@@ -1,20 +1,20 @@
 void parse_option_size(const char *name, const char *value,
+
+                       uint64_t *ret, Error **errp)
+
+{
+
     char *postfix;

+    double sizef;
+
+
+
+    sizef = strtod(value, &postfix);
+
+    if (sizef < 0 || sizef > UINT64_MAX) {
+
+        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name,

                    "a non-negative number below 2^64");

void parse_option_size(const char *name, const char *value,

                       uint64_t *ret, Error **errp)

{

    char *postfix;

    double sizef;

    sizef = strtod(value, &postfix);

    if (sizef < 0 || sizef > UINT64_MAX) {

        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name,

                   "a non-negative number below 2^64");

        return;

    }

    switch (*postfix) {

    case 'T':

        sizef *= 1024;

        /* fall through */

    case 'G':

        sizef *= 1024;

        /* fall through */

    case 'M':

        sizef *= 1024;

        /* fall through */

    case 'K':

    case 'k':

        sizef *= 1024;

        /* fall through */

    case 'b':

    case '\0':

        *ret = (uint64_t) sizef;

        break;

    default:

        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name, "a size");

        error_append_hint(errp, "You may use k, M, G or T suffixes for "

                          "kilobytes, megabytes, gigabytes and terabytes.\n");

        return;

    }

}


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

             g_free(block);

+            break;
+
+        }
+
+    }

     qemu_mutex_unlock_ramlist();

void qemu_ram_free_from_ptr(ram_addr_t addr)

{

    RAMBlock *block;

    /* This assumes the iothread lock is taken here too.  */

    qemu_mutex_lock_ramlist();

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

        if (addr == block->offset) {

            QTAILQ_REMOVE(&ram_list.blocks, block, next);

            ram_list.mru_block = NULL;

            ram_list.version++;

            g_free(block);

            break;

        }

    }

    qemu_mutex_unlock_ramlist();

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void draw_bar(TestSourceContext *test, const uint8_t color[4],

                      unsigned x, unsigned y, unsigned w, unsigned h,

@@ -14,9 +14,9 @@

+    x = FFMIN(x, test->w - 1);

+    y = FFMIN(y, test->h - 1);

     w = FFMIN(w, test->w - x);

static void draw_bar(TestSourceContext *test, const uint8_t color[4],

                     unsigned x, unsigned y, unsigned w, unsigned h,

                     AVFrame *frame)

{

    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);

    uint8_t *p, *p0;

    int plane;

    x = FFMIN(x, test->w - 1);

    y = FFMIN(y, test->h - 1);

    w = FFMIN(w, test->w - x);

    h = FFMIN(h, test->h - y);

    av_assert0(x + w <= test->w);

    av_assert0(y + h <= test->h);

    for (plane = 0; frame->data[plane]; plane++) {

        const int c = color[plane];

        const int linesize = frame->linesize[plane];

        int i, px, py, pw, ph;

        if (plane == 1 || plane == 2) {

            px = x >> desc->log2_chroma_w;

            pw = w >> desc->log2_chroma_w;

            py = y >> desc->log2_chroma_h;

            ph = h >> desc->log2_chroma_h;

        } else {

            px = x;

            pw = w;

            py = y;

            ph = h;

        }

        p0 = p = frame->data[plane] + py * linesize + px;

        memset(p, c, pw);

        p += linesize;

        for (i = 1; i < ph; i++, p += linesize)

            memcpy(p, p0, pw);

    }

}


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

     uint64_t abort_ctx = le64_to_cpu(cmd->frame->abort.abort_context);

+    target_phys_addr_t abort_addr, addr_hi, addr_lo;
+
+    MegasasCmd *abort_cmd;
+
+

     addr_hi = le32_to_cpu(cmd->frame->abort.abort_mfi_addr_hi);

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

{

    uint64_t abort_ctx = le64_to_cpu(cmd->frame->abort.abort_context);

    target_phys_addr_t abort_addr, addr_hi, addr_lo;

    MegasasCmd *abort_cmd;

    addr_hi = le32_to_cpu(cmd->frame->abort.abort_mfi_addr_hi);

    addr_lo = le32_to_cpu(cmd->frame->abort.abort_mfi_addr_lo);

    abort_addr = ((uint64_t)addr_hi << 32) | addr_lo;

    abort_cmd = megasas_lookup_frame(s, abort_addr);

    if (!abort_cmd) {

        trace_megasas_abort_no_cmd(cmd->index, abort_ctx);

        s->event_count++;

        return MFI_STAT_OK;

    }

    if (!megasas_use_queue64(s)) {

        abort_ctx &= (uint64_t)0xFFFFFFFF;

    }

    if (abort_cmd->context != abort_ctx) {

        trace_megasas_abort_invalid_context(cmd->index, abort_cmd->index,

                                            abort_cmd->context);

        s->event_count++;

        return MFI_STAT_ABORT_NOT_POSSIBLE;

    }

    trace_megasas_abort_frame(cmd->index, abort_cmd->index);

    megasas_abort_command(abort_cmd);

    if (!s->event_cmd || abort_cmd != s->event_cmd) {

        s->event_cmd = NULL;

    }

    s->event_count++;

    return MFI_STAT_OK;

}


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

 #if SPICE_INTERFACE_QXL_MINOR >= 1

+        spice_qxl_destroy_primary_surface_async(&ssd->qxl, id, 0);
+
+#else
+
+        abort();

 #endif

void qemu_spice_destroy_primary_surface(SimpleSpiceDisplay *ssd,

                                        uint32_t id, qxl_async_io async)

{

    if (async != QXL_SYNC) {

#if SPICE_INTERFACE_QXL_MINOR >= 1

        spice_qxl_destroy_primary_surface_async(&ssd->qxl, id, 0);

#else

        abort();

#endif

    } else {

        ssd->worker->destroy_primary_surface(ssd->worker, id);

    }

}


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

 {

+    struct IscsiTask *iTask = opaque;

     iTask->complete = 1;

static void iscsi_co_generic_bh_cb(void *opaque)

{

    struct IscsiTask *iTask = opaque;

    iTask->complete = 1;

    qemu_bh_delete(iTask->bh);

    qemu_coroutine_enter(iTask->co, NULL);

}


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

 {

+    DPRINTF("Command complete tag=0x%x status=%d sense=%d\n",

             r->req.tag, status, sense);

static void scsi_command_complete(SCSIDiskReq *r, int status, int sense)

{

    DPRINTF("Command complete tag=0x%x status=%d sense=%d\n",

            r->req.tag, status, sense);

    scsi_req_set_status(r, status, sense);

    scsi_req_complete(&r->req);

    scsi_remove_request(r);

}


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

     case 3:  /* UTF-8 */
+
+        len = FFMIN(taglen, dstlen - 1);
+
+        get_buffer(s->pb, dst, len);
+
         dst[len] = 0;

         break;

static void read_ttag(AVFormatContext *s, int taglen, const char *key)

{

    char *q, dst[512];

    int len, dstlen = sizeof(dst) - 1;

    unsigned genre;

    dst[0] = 0;

    if (taglen < 1)

        return;

    taglen--; /* account for encoding type byte */

    switch (get_byte(s->pb)) { /* encoding type */

    case 0:  /* ISO-8859-1 (0 - 255 maps directly into unicode) */

        q = dst;

        while (taglen--) {

            uint8_t tmp;

            PUT_UTF8(get_byte(s->pb), tmp, if (q - dst < dstlen - 1) *q++ = tmp;)

        }

        *q = '\0';

        break;

    case 3:  /* UTF-8 */

        len = FFMIN(taglen, dstlen - 1);

        get_buffer(s->pb, dst, len);

        dst[len] = 0;

        break;

    }

    if (!strcmp(key, "genre")

        && (sscanf(dst, "(%d)", &genre) == 1 || sscanf(dst, "%d", &genre) == 1)

        && genre <= ID3v1_GENRE_MAX)

        av_strlcpy(dst, ff_id3v1_genre_str[genre], sizeof(dst));

    if (*dst)

        av_metadata_set(&s->metadata, key, dst);

}


void cpu_ppc_store_decr (CPUState *env, uint32_t value)

{

    /* TO FIX */

}


--- a/source.c
+++ b/source.c
@@ -57,9 +57,9 @@
             }
         }
     }
+    *got_frame = 1;
+    return buf_size;
+packet_small:
+    av_log(avctx, AV_LOG_ERROR, "Input packet too small.\n");
+    return AVERROR_INVALIDDATA;
 }

static int vcr1_decode_frame(AVCodecContext *avctx, void *data,
                             int *got_frame, AVPacket *avpkt)
{
    const uint8_t *buf        = avpkt->data;
    int buf_size              = avpkt->size;
    VCR1Context *const a      = avctx->priv_data;
    AVFrame *const p          = data;
    const uint8_t *bytestream = buf;
    int i, x, y, ret;
    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
        return ret;
    }
    p->pict_type = AV_PICTURE_TYPE_I;
    p->key_frame = 1;
    if (buf_size < 32)
    for (i = 0; i < 16; i++) {
        a->delta[i] = *bytestream++;
        bytestream++;
        buf_size--;
    }
    for (y = 0; y < avctx->height; y++) {
        int offset;
        uint8_t *luma = &p->data[0][y * p->linesize[0]];
        if ((y & 3) == 0) {
            uint8_t *cb = &p->data[1][(y >> 2) * p->linesize[1]];
            uint8_t *cr = &p->data[2][(y >> 2) * p->linesize[2]];
            for (i = 0; i < 4; i++)
                a->offset[i] = *bytestream++;
            offset = a->offset[0] - a->delta[bytestream[2] & 0xF];
            for (x = 0; x < avctx->width; x += 4) {
                luma[0]     = offset += a->delta[bytestream[2] & 0xF];
                luma[1]     = offset += a->delta[bytestream[2] >>  4];
                luma[2]     = offset += a->delta[bytestream[0] & 0xF];
                luma[3]     = offset += a->delta[bytestream[0] >>  4];
                luma       += 4;
                *cb++       = bytestream[3];
                *cr++       = bytestream[1];
                bytestream += 4;
                buf_size   -= 4;
            }
        } else {
            if (buf_size < avctx->width / 2)
            offset = a->offset[y & 3] - a->delta[bytestream[2] & 0xF];
            for (x = 0; x < avctx->width; x += 8) {
                luma[0]     = offset += a->delta[bytestream[2] & 0xF];
                luma[1]     = offset += a->delta[bytestream[2] >>  4];
                luma[2]     = offset += a->delta[bytestream[3] & 0xF];
                luma[3]     = offset += a->delta[bytestream[3] >>  4];
                luma[4]     = offset += a->delta[bytestream[0] & 0xF];
                luma[5]     = offset += a->delta[bytestream[0] >>  4];
                luma[6]     = offset += a->delta[bytestream[1] & 0xF];
                luma[7]     = offset += a->delta[bytestream[1] >>  4];
                luma       += 8;
                bytestream += 4;
                buf_size   -= 4;
            }
        }
    }
    *got_frame = 1;
    return buf_size;
packet_small:
    av_log(avctx, AV_LOG_ERROR, "Input packet too small.\n");
    return AVERROR_INVALIDDATA;
}


--- a/source.c
+++ b/source.c
@@ -27,10 +27,10 @@
         } else {
             if ((err = mxf_write_partition(s, 0, 0, header_closed_partition_key, 1)) < 0)
 end:
+    ff_audio_interleave_close(s);
+    av_freep(&mxf->index_entries);
+    av_freep(&mxf->body_partition_offset);
+    av_freep(&mxf->timecode_track->priv_data);
+    av_freep(&mxf->timecode_track);
     mxf_free(s);
     return err < 0 ? err : 0;

static int mxf_write_footer(AVFormatContext *s)
{
    MXFContext *mxf = s->priv_data;
    AVIOContext *pb = s->pb;
    int err = 0;
    mxf->duration = mxf->last_indexed_edit_unit + mxf->edit_units_count;
    mxf_write_klv_fill(s);
    mxf->footer_partition_offset = avio_tell(pb);
    if (mxf->edit_unit_byte_count && s->oformat != &ff_mxf_opatom_muxer) { // no need to repeat index
        if ((err = mxf_write_partition(s, 0, 0, footer_partition_key, 0)) < 0)
    } else {
        if ((err = mxf_write_partition(s, 0, 2, footer_partition_key, 0)) < 0)
        mxf_write_klv_fill(s);
        mxf_write_index_table_segment(s);
    mxf_write_klv_fill(s);
    mxf_write_random_index_pack(s);
    if (s->pb->seekable) {
        if (s->oformat == &ff_mxf_opatom_muxer){
            /* rewrite body partition to update lengths */
            avio_seek(pb, mxf->body_partition_offset[0], SEEK_SET);
            if ((err = mxf_write_opatom_body_partition(s)) < 0)
        avio_seek(pb, 0, SEEK_SET);
        if (mxf->edit_unit_byte_count && s->oformat != &ff_mxf_opatom_muxer) {
            if ((err = mxf_write_partition(s, 1, 2, header_closed_partition_key, 1)) < 0)
            mxf_write_klv_fill(s);
            mxf_write_index_table_segment(s);
        } else {
            if ((err = mxf_write_partition(s, 0, 0, header_closed_partition_key, 1)) < 0)
end:
    ff_audio_interleave_close(s);
    av_freep(&mxf->index_entries);
    av_freep(&mxf->body_partition_offset);
    av_freep(&mxf->timecode_track->priv_data);
    av_freep(&mxf->timecode_track);
    mxf_free(s);
    return err < 0 ? err : 0;


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void build_pci_bus_state_init(AcpiBuildPciBusHotplugState *state,

+                                     AcpiBuildPciBusHotplugState *parent,
+
+                                     bool pcihp_bridge_en)
+
 {

     state->parent = parent;

static void build_pci_bus_state_init(AcpiBuildPciBusHotplugState *state,

                                     AcpiBuildPciBusHotplugState *parent,

                                     bool pcihp_bridge_en)

{

    state->parent = parent;

    state->device_table = build_alloc_array();

    state->notify_table = build_alloc_array();

    state->pcihp_bridge_en = pcihp_bridge_en;

}


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

+    if ((nvram->size < MIN_NVRAM_SIZE) || (nvram->size > MAX_NVRAM_SIZE)) {
+
+        fprintf(stderr, "spapr-nvram must be between %d and %d bytes in size\n",
+
+                MIN_NVRAM_SIZE, MAX_NVRAM_SIZE);

         return -1;

static int spapr_nvram_init(VIOsPAPRDevice *dev)

{

    sPAPRNVRAM *nvram = VIO_SPAPR_NVRAM(dev);

    if (nvram->drive) {

        nvram->size = bdrv_getlength(nvram->drive);

    } else {

        nvram->size = DEFAULT_NVRAM_SIZE;

        nvram->buf = g_malloc0(nvram->size);

    }

    if ((nvram->size < MIN_NVRAM_SIZE) || (nvram->size > MAX_NVRAM_SIZE)) {

        fprintf(stderr, "spapr-nvram must be between %d and %d bytes in size\n",

                MIN_NVRAM_SIZE, MAX_NVRAM_SIZE);

        return -1;

    }

    spapr_rtas_register(RTAS_NVRAM_FETCH, "nvram-fetch", rtas_nvram_fetch);

    spapr_rtas_register(RTAS_NVRAM_STORE, "nvram-store", rtas_nvram_store);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void arm_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu)

+{

     DisasContext *dc = container_of(dcbase, DisasContext, base);

static void arm_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu)

{

    DisasContext *dc = container_of(dcbase, DisasContext, base);

    dc->insn_start_idx = tcg_op_buf_count();

    tcg_gen_insn_start(dc->pc,

                       (dc->condexec_cond << 4) | (dc->condexec_mask >> 1),

                       0);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void vp8_idct_dc_add4y_c(uint8_t *dst, int16_t block[4][16],
+
+                                ptrdiff_t stride)
+
+{

     vp8_idct_dc_add_c(dst +  0, block[0], stride);

static void vp8_idct_dc_add4y_c(uint8_t *dst, int16_t block[4][16],

                                ptrdiff_t stride)

{

    vp8_idct_dc_add_c(dst +  0, block[0], stride);

    vp8_idct_dc_add_c(dst +  4, block[1], stride);

    vp8_idct_dc_add_c(dst +  8, block[2], stride);

    vp8_idct_dc_add_c(dst + 12, block[3], stride);

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
   if (argv[0][0] != '/')

     {
+
       fnam = malloc (strlen (argv[0]) + 2);

       if (fnam == NULL)

int main (int argc, char *argv[])

{

  char *fnam = argv[0];

  FILE *f;

  if (argv[0][0] != '/')

    {

      fnam = malloc (strlen (argv[0]) + 2);

      if (fnam == NULL)

	abort ();

      strcpy (fnam, "/");

      strcat (fnam, argv[0]);

    }

  f = fopen (fnam, "rb");

  if (f == NULL)

    abort ();

  close (f);

  /* Cover another execution path.  */

  if (fopen ("/nonexistent", "rb") != NULL

      || errno != ENOENT)

    abort ();

  printf ("pass\n");

  return 0;

}


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

         return -1;

+    av_assert0(ctx_pic);
+
+
+
+    /* Fill up DXVA_PicParams_HEVC */

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

static int dxva2_hevc_start_frame(AVCodecContext *avctx,

                                  av_unused const uint8_t *buffer,

                                  av_unused uint32_t size)

{

    const HEVCContext *h = avctx->priv_data;

    AVDXVAContext *ctx = avctx->hwaccel_context;

    struct hevc_dxva2_picture_context *ctx_pic = h->ref->hwaccel_picture_private;

    if (!DXVA_CONTEXT_VALID(avctx, ctx))

        return -1;

    av_assert0(ctx_pic);

    /* Fill up DXVA_PicParams_HEVC */

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

    /* Fill up DXVA_Qmatrix_HEVC */

    fill_scaling_lists(ctx, h, &ctx_pic->qm);

    ctx_pic->slice_count    = 0;

    ctx_pic->bitstream_size = 0;

    ctx_pic->bitstream      = NULL;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -47,11 +47,11 @@
         status |= BDRV_BLOCK_ZERO;

     } else if (ret != QCOW2_CLUSTER_UNALLOCATED) {
+
+        status |= BDRV_BLOCK_DATA;
+
+    }
+
     return status;

 }

static int64_t coroutine_fn qcow2_co_get_block_status(BlockDriverState *bs,

        int64_t sector_num, int nb_sectors, int *pnum)

{

    BDRVQcow2State *s = bs->opaque;

    uint64_t cluster_offset;

    int index_in_cluster, ret;

    int64_t status = 0;

    *pnum = nb_sectors;

    qemu_co_mutex_lock(&s->lock);

    ret = qcow2_get_cluster_offset(bs, sector_num << 9, pnum, &cluster_offset);

    qemu_co_mutex_unlock(&s->lock);

    if (ret < 0) {

        return ret;

    }

    if (cluster_offset != 0 && ret != QCOW2_CLUSTER_COMPRESSED &&

        !s->cipher) {

        index_in_cluster = sector_num & (s->cluster_sectors - 1);

        cluster_offset |= (index_in_cluster << BDRV_SECTOR_BITS);

        status |= BDRV_BLOCK_OFFSET_VALID | cluster_offset;

    }

    if (ret == QCOW2_CLUSTER_ZERO) {

        status |= BDRV_BLOCK_ZERO;

    } else if (ret != QCOW2_CLUSTER_UNALLOCATED) {

        status |= BDRV_BLOCK_DATA;

    }

    return status;

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
 	static QEMUTimer *timer;

 	timer = qemu_new_timer(rt_clock, qemu_announce_self_once, &timer);
+
+	qemu_announce_self_once(&timer);

 }

void qemu_announce_self(void)

{

	static QEMUTimer *timer;

	timer = qemu_new_timer(rt_clock, qemu_announce_self_once, &timer);

	qemu_announce_self_once(&timer);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static int kvm_client_migration_log(struct CPUPhysMemoryClient *client,
+
                                     int enable)

 {

static int kvm_client_migration_log(struct CPUPhysMemoryClient *client,

                                    int enable)

{

    return kvm_set_migration_log(enable);

}


--- a/source.c
+++ b/source.c
@@ -22,11 +22,11 @@
     found:
         ioh->fd = fd;
         ioh->fd_read_poll = fd_read_poll;
+        ioh->fd_read = fd_read;
+        ioh->fd_write = fd_write;
+        ioh->opaque = opaque;
+        ioh->deleted = 0;
+        qemu_notify_event();
     }
     return 0;
 }

int qemu_set_fd_handler2(int fd,
                         IOCanReadHandler *fd_read_poll,
                         IOHandler *fd_read,
                         IOHandler *fd_write,
                         void *opaque)
{
    IOHandlerRecord *ioh;
    if (!fd_read && !fd_write) {
        QLIST_FOREACH(ioh, &io_handlers, next) {
            if (ioh->fd == fd) {
                ioh->deleted = 1;
                break;
            }
        }
    } else {
        QLIST_FOREACH(ioh, &io_handlers, next) {
            if (ioh->fd == fd)
                goto found;
        }
        ioh = g_malloc0(sizeof(IOHandlerRecord));
        QLIST_INSERT_HEAD(&io_handlers, ioh, next);
    found:
        ioh->fd = fd;
        ioh->fd_read_poll = fd_read_poll;
        ioh->fd_read = fd_read;
        ioh->fd_write = fd_write;
        ioh->opaque = opaque;
        ioh->deleted = 0;
        qemu_notify_event();
    }
    return 0;
}


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

     CPUState *cs = CPU(obj);

+    UniCore32CPU *cpu = UNICORE32_CPU(obj);

     CPUUniCore32State *env = &cpu->env;

static void uc32_cpu_initfn(Object *obj)

{

    CPUState *cs = CPU(obj);

    UniCore32CPU *cpu = UNICORE32_CPU(obj);

    CPUUniCore32State *env = &cpu->env;

    static bool inited;

    cs->env_ptr = env;

    cpu_exec_init(cs, &error_abort);

#ifdef CONFIG_USER_ONLY

    env->uncached_asr = ASR_MODE_USER;

    env->regs[31] = 0;

#else

    env->uncached_asr = ASR_MODE_PRIV;

    env->regs[31] = 0x03000000;

#endif

    tlb_flush(cs, 1);

    if (tcg_enabled() && !inited) {

        inited = true;

        uc32_translate_init();

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void balloon_stats_change_timer(VirtIOBalloon *s, int secs)

 {

static void balloon_stats_change_timer(VirtIOBalloon *s, int secs)

{

    timer_mod(s->stats_timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + secs * 1000);

}


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

             return;

+        }
+
+        hmp_handle_error(mon, &errp);
+
+    }

 }

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

{

    Error *errp = NULL;

    qmp_cont(&errp);

    if (error_is_set(&errp)) {

        if (error_is_type(errp, QERR_DEVICE_ENCRYPTED)) {

            const char *device;

            /* The device is encrypted. Ask the user for the password

               and retry */

            device = error_get_field(errp, "device");

            assert(device != NULL);

            monitor_read_block_device_key(mon, device, hmp_cont_cb, mon);

            error_free(errp);

            return;

        }

        hmp_handle_error(mon, &errp);

    }

}


--- a/source.c
+++ b/source.c
@@ -3,8 +3,8 @@
                                           uint32_t fid, uint64_t faddr,

                                           uint32_t e)
+
+{

     s390_pci_generate_event(1, pec, fh, fid, faddr, e);

static void s390_pci_generate_error_event(uint16_t pec, uint32_t fh,

                                          uint32_t fid, uint64_t faddr,

                                          uint32_t e)

{

    s390_pci_generate_event(1, pec, fh, fid, faddr, e);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static int kvm_log_start(CPUPhysMemoryClient *client,
+
                          target_phys_addr_t phys_addr, ram_addr_t size)

 {

static int kvm_log_start(CPUPhysMemoryClient *client,

                         target_phys_addr_t phys_addr, ram_addr_t size)

{

    return kvm_dirty_pages_log_change(phys_addr, size, true);

}


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

 {

+    int first_contributory = env->old_exception == 0 ||

                               (env->old_exception >= 10 &&

static int check_exception(int intno, int *error_code)

{

    int first_contributory = env->old_exception == 0 ||

                              (env->old_exception >= 10 &&

                               env->old_exception <= 13);

    int second_contributory = intno == 0 ||

                               (intno >= 10 && intno <= 13);

    qemu_log_mask(CPU_LOG_INT, "check_exception old: 0x%x new 0x%x\n",

                env->old_exception, intno);

    if (env->old_exception == EXCP08_DBLE)

        cpu_abort(env, "triple fault");

    if ((first_contributory && second_contributory)

        || (env->old_exception == EXCP0E_PAGE &&

            (second_contributory || (intno == EXCP0E_PAGE)))) {

        intno = EXCP08_DBLE;

        *error_code = 0;

    }

    if (second_contributory || (intno == EXCP0E_PAGE) ||

        (intno == EXCP08_DBLE))

        env->old_exception = intno;

    return intno;

}


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

     VRingMemoryRegionCaches *caches;

+    hwaddr pa;

     if (!vq->notification) {

static inline void vring_set_avail_event(VirtQueue *vq, uint16_t val)

{

    VRingMemoryRegionCaches *caches;

    hwaddr pa;

    if (!vq->notification) {

        return;

    }

    caches = atomic_rcu_read(&vq->vring.caches);

    pa = offsetof(VRingUsed, ring[vq->vring.num]);

    virtio_stw_phys_cached(vq->vdev, &caches->used, pa, val);

    address_space_cache_invalidate(&caches->used, pa, sizeof(val));

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void read_sbr_channel_pair_element(AACContext *ac,

                                           SpectralBandReplication *sbr,
+
                                           GetBitContext *gb)

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

     if ((sbr->bs_coupling = get_bits1(gb))) {

+        read_sbr_grid(ac, sbr, gb, &sbr->data[0]);

         copy_sbr_grid(&sbr->data[1], &sbr->data[0]);

static void read_sbr_channel_pair_element(AACContext *ac,

                                          SpectralBandReplication *sbr,

                                          GetBitContext *gb)

{

    if (get_bits1(gb))    // bs_data_extra

        skip_bits(gb, 8); // bs_reserved

    if ((sbr->bs_coupling = get_bits1(gb))) {

        read_sbr_grid(ac, sbr, gb, &sbr->data[0]);

        copy_sbr_grid(&sbr->data[1], &sbr->data[0]);

        read_sbr_dtdf(sbr, gb, &sbr->data[0]);

        read_sbr_dtdf(sbr, gb, &sbr->data[1]);

        read_sbr_invf(sbr, gb, &sbr->data[0]);

        memcpy(sbr->data[1].bs_invf_mode[1], sbr->data[1].bs_invf_mode[0], sizeof(sbr->data[1].bs_invf_mode[0]));

        memcpy(sbr->data[1].bs_invf_mode[0], sbr->data[0].bs_invf_mode[0], sizeof(sbr->data[1].bs_invf_mode[0]));

        read_sbr_envelope(sbr, gb, &sbr->data[0], 0);

        read_sbr_noise(sbr, gb, &sbr->data[0], 0);

        read_sbr_envelope(sbr, gb, &sbr->data[1], 1);

        read_sbr_noise(sbr, gb, &sbr->data[1], 1);

    } else {

        read_sbr_grid(ac, sbr, gb, &sbr->data[0]);

        read_sbr_grid(ac, sbr, gb, &sbr->data[1]);

        read_sbr_dtdf(sbr, gb, &sbr->data[0]);

        read_sbr_dtdf(sbr, gb, &sbr->data[1]);

        read_sbr_invf(sbr, gb, &sbr->data[0]);

        read_sbr_invf(sbr, gb, &sbr->data[1]);

        read_sbr_envelope(sbr, gb, &sbr->data[0], 0);

        read_sbr_envelope(sbr, gb, &sbr->data[1], 1);

        read_sbr_noise(sbr, gb, &sbr->data[0], 0);

        read_sbr_noise(sbr, gb, &sbr->data[1], 1);

    }

    if ((sbr->data[0].bs_add_harmonic_flag = get_bits1(gb)))

        get_bits1_vector(gb, sbr->data[0].bs_add_harmonic, sbr->n[1]);

    if ((sbr->data[1].bs_add_harmonic_flag = get_bits1(gb)))

        get_bits1_vector(gb, sbr->data[1].bs_add_harmonic, sbr->n[1]);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static av_always_inline int normal_limit(uint8_t *p, ptrdiff_t stride,
+
                                          int E, int I)

 {

static av_always_inline int normal_limit(uint8_t *p, ptrdiff_t stride,

                                         int E, int I)

{

    LOAD_PIXELS

    return simple_limit(p, stride, E) &&

           FFABS(p3 - p2) <= I &&

           FFABS(p2 - p1) <= I &&

           FFABS(p1 - p0) <= I &&

           FFABS(q3 - q2) <= I &&

           FFABS(q2 - q1) <= I &&

           FFABS(q1 - q0) <= I;

}


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

     PXA2xxPCMCIAState *s = PXA2XX_PCMCIA(dev);

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

{

    PXA2xxPCMCIAState *s = PXA2XX_PCMCIA(dev);

    pcmcia_socket_register(&s->slot);

}


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

     uint32_t v;

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

     return v;

static uint32_t dp8393x_readl(void *opaque, target_phys_addr_t addr)

{

    uint32_t v;

    v = dp8393x_readw(opaque, addr);

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

    return v;

}


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

         av_free(buf);

+
+
+        // initialization range
+
+        // 5 is the offset of Cluster ID.

         av_dict_set_int(&s->streams[0]->metadata, INITIALIZATION_RANGE, avio_tell(s->pb) - 5, 0);

static int webm_dash_manifest_read_header(AVFormatContext *s)

{

    char *buf;

    int ret = matroska_read_header(s);

    MatroskaTrack *tracks;

    MatroskaDemuxContext *matroska = s->priv_data;

    if (ret) {

        av_log(s, AV_LOG_ERROR, "Failed to read file headers\n");

        return -1;

    if (!matroska->is_live) {

        buf = av_asprintf("%g", matroska->duration);

        if (!buf) return AVERROR(ENOMEM);

        av_dict_set(&s->streams[0]->metadata, DURATION, buf, 0);

        av_free(buf);

        // initialization range

        // 5 is the offset of Cluster ID.

        av_dict_set_int(&s->streams[0]->metadata, INITIALIZATION_RANGE, avio_tell(s->pb) - 5, 0);

    // basename of the file

    buf = strrchr(s->filename, '/');

    av_dict_set(&s->streams[0]->metadata, FILENAME, buf ? ++buf : s->filename, 0);

    // track number

    tracks = matroska->tracks.elem;

    av_dict_set_int(&s->streams[0]->metadata, TRACK_NUMBER, tracks[0].num, 0);

    // parse the cues and populate Cue related fields

    return matroska->is_live ? 0 : webm_dash_manifest_cues(s);


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
 static void test_ide_drive_user(const char *dev, bool trans)
+
 {

     char *argv[256], *opts;
+
     int argc;

+    int secs = img_secs[backend_small];

+    const CHST expected_chst = { secs / (4 * 32) , 4, 32, trans };

static void test_ide_drive_user(const char *dev, bool trans)

{

    char *argv[256], *opts;

    int argc;

    int secs = img_secs[backend_small];

    const CHST expected_chst = { secs / (4 * 32) , 4, 32, trans };

    argc = setup_common(argv, ARRAY_SIZE(argv));

    opts = g_strdup_printf("%s,%s%scyls=%d,heads=%d,secs=%d",

                           dev ?: "",

                           trans && dev ? "bios-chs-" : "",

                           trans ? "trans=lba," : "",

                           expected_chst.cyls, expected_chst.heads,

                           expected_chst.secs);

    cur_ide[0] = &expected_chst;

    argc = setup_ide(argc, argv, ARRAY_SIZE(argv),

                     0, dev ? opts : NULL, backend_small, mbr_chs,

                     dev ? "" : opts);

    g_free(opts);

    qtest_start(g_strjoinv(" ", argv));

    test_cmos();

    qtest_end();

}


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

     return av_mallocz(sizeof(AVVDPAUContext));

AVVDPAUContext *av_vdpau_alloc_context(void)

{

    return av_mallocz(sizeof(AVVDPAUContext));

}


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

 {
+
     FrameThreadContext *fctx = p->parent;

static void release_delayed_buffers(PerThreadContext *p)

{

    FrameThreadContext *fctx = p->parent;

    while (p->num_released_buffers > 0) {

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

        pthread_mutex_lock(&fctx->buffer_mutex);

        free_progress(f);

        f->thread_opaque = NULL;

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

        pthread_mutex_unlock(&fctx->buffer_mutex);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void qmp_input_type_int(Visitor *v, int64_t *obj, const char *name,

+                               Error **errp)
+
+{

     QmpInputVisitor *qiv = to_qiv(v);
+
     QObject *qobj = qmp_input_get_object(qiv, name, true);

static void qmp_input_type_int(Visitor *v, int64_t *obj, const char *name,

                               Error **errp)

{

    QmpInputVisitor *qiv = to_qiv(v);

    QObject *qobj = qmp_input_get_object(qiv, name, true);

    if (!qobj || qobject_type(qobj) != QTYPE_QINT) {

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

                   "integer");

        return;

    }

    *obj = qint_get_int(qobject_to_qint(qobj));

}


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

                            uint32_t node, Error **errp)

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

     void *fdt;

+

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

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

                           uint32_t node, Error **errp)

{

    sPAPRDRConnector *drc;

    sPAPRDRConnectorClass *drck;

    uint32_t nr_lmbs = size/SPAPR_MEMORY_BLOCK_SIZE;

    int i, fdt_offset, fdt_size;

    void *fdt;

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

        drc = spapr_dr_connector_by_id(SPAPR_DR_CONNECTOR_TYPE_LMB,

                addr/SPAPR_MEMORY_BLOCK_SIZE);

        g_assert(drc);

        fdt = create_device_tree(&fdt_size);

        fdt_offset = spapr_populate_memory_node(fdt, node, addr,

                                                SPAPR_MEMORY_BLOCK_SIZE);

        drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);

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

        addr += SPAPR_MEMORY_BLOCK_SIZE;

    }

    /* send hotplug notification to the

     * guest only in case of hotplugged memory

     */

    if (dev->hotplugged) {

       spapr_hotplug_req_add_by_count(SPAPR_DR_CONNECTOR_TYPE_LMB, nr_lmbs);

    }

}


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

     VirtQueueElement elem;

+    VirtQueue *vq;
+
+    size_t offset = 0;
+
+    size_t len = 0;

static size_t write_to_port(VirtIOSerialPort *port,

                            const uint8_t *buf, size_t size)

{

    VirtQueueElement elem;

    VirtQueue *vq;

    size_t offset = 0;

    size_t len = 0;

    vq = port->ivq;

    if (!virtio_queue_ready(vq)) {

        return 0;

    }

    if (!size) {

        return 0;

    }

    while (offset < size) {

        int i;

        if (!virtqueue_pop(vq, &elem)) {

            break;

        }

        for (i = 0; offset < size && i < elem.in_num; i++) {

            len = MIN(elem.in_sg[i].iov_len, size - offset);

            memcpy(elem.in_sg[i].iov_base, buf + offset, len);

            offset += len;

        }

        virtqueue_push(vq, &elem, len);

    }

    virtio_notify(&port->vser->vdev, vq);

    return offset;

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
     srat_start = table_data->len;

     srat = acpi_data_push(table_data, sizeof(*srat));
+
+    srat->reserved1 = cpu_to_le32(1);
+
+
+
     for (i = 0; i < cpu_list->len; ++i) {

         int node_id = cpu_list->cpus[i].props.has_node_id ?

build_srat(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)

{

    AcpiSystemResourceAffinityTable *srat;

    AcpiSratProcessorGiccAffinity *core;

    AcpiSratMemoryAffinity *numamem;

    int i, srat_start;

    uint64_t mem_base;

    MachineClass *mc = MACHINE_GET_CLASS(vms);

    const CPUArchIdList *cpu_list = mc->possible_cpu_arch_ids(MACHINE(vms));

    srat_start = table_data->len;

    srat = acpi_data_push(table_data, sizeof(*srat));

    srat->reserved1 = cpu_to_le32(1);

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

        int node_id = cpu_list->cpus[i].props.has_node_id ?

            cpu_list->cpus[i].props.node_id : 0;

        core = acpi_data_push(table_data, sizeof(*core));

        core->type = ACPI_SRAT_PROCESSOR_GICC;

        core->length = sizeof(*core);

        core->proximity = cpu_to_le32(node_id);

        core->acpi_processor_uid = cpu_to_le32(i);

        core->flags = cpu_to_le32(1);

    }

    mem_base = vms->memmap[VIRT_MEM].base;

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

        numamem = acpi_data_push(table_data, sizeof(*numamem));

        build_srat_memory(numamem, mem_base, numa_info[i].node_mem, i,

                          MEM_AFFINITY_ENABLED);

        mem_base += numa_info[i].node_mem;

    }

    build_header(linker, table_data, (void *)srat, "SRAT",

                 table_data->len - srat_start, 3, NULL, NULL);

}


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

+
+
+
     qemu_log ("unknown insn pc=%x opc=%x\n", dc->pc, dc->opcode);

     dc->abort_at_next_insn = 1;

static void dec_null(DisasContext *dc)

{

    qemu_log ("unknown insn pc=%x opc=%x\n", dc->pc, dc->opcode);

    dc->abort_at_next_insn = 1;


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

     pci_config_set_class(dev->config, PCI_CLASS_BRIDGE_PCI);

+    dev->config[PCI_HEADER_TYPE] =

         (dev->config[PCI_HEADER_TYPE] & PCI_HEADER_TYPE_MULTI_FUNCTION) |

int pci_bridge_initfn(PCIDevice *dev)

{

    PCIBus *parent = dev->bus;

    PCIBridge *br = DO_UPCAST(PCIBridge, dev, dev);

    PCIBus *sec_bus = &br->sec_bus;

    pci_word_test_and_set_mask(dev->config + PCI_STATUS,

                               PCI_STATUS_66MHZ | PCI_STATUS_FAST_BACK);

    pci_config_set_class(dev->config, PCI_CLASS_BRIDGE_PCI);

    dev->config[PCI_HEADER_TYPE] =

        (dev->config[PCI_HEADER_TYPE] & PCI_HEADER_TYPE_MULTI_FUNCTION) |

        PCI_HEADER_TYPE_BRIDGE;

    pci_set_word(dev->config + PCI_SEC_STATUS,

                 PCI_STATUS_66MHZ | PCI_STATUS_FAST_BACK);

    /*

     * If we don't specify the name, the bus will be addressed as <id>.0, where

     * id is the device id.

     * Since PCI Bridge devices have a single bus each, we don't need the index:

     * let users address the bus using the device name.

     */

    if (!br->bus_name && dev->qdev.id && *dev->qdev.id) {

	    br->bus_name = dev->qdev.id;

    }

    qbus_create_inplace(&sec_bus->qbus, TYPE_PCI_BUS, &dev->qdev,

                        br->bus_name);

    sec_bus->parent_dev = dev;

    sec_bus->map_irq = br->map_irq;

    sec_bus->address_space_mem = &br->address_space_mem;

    memory_region_init(&br->address_space_mem, "pci_bridge_pci", INT64_MAX);

    sec_bus->address_space_io = &br->address_space_io;

    memory_region_init(&br->address_space_io, "pci_bridge_io", 65536);

    pci_bridge_region_init(br);

    QLIST_INIT(&sec_bus->child);

    QLIST_INSERT_HEAD(&parent->child, sec_bus, sibling);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -11,14 +11,14 @@
     static const uint8_t x_offset[2]={0, 16};

     dctcoef *block = (dctcoef*)_block;
+
+
+
+    for(i=0; i<4; i++){
+
+        temp[2*i+0] = block[stride*i + xStride*0] + block[stride*i + xStride*1];
+
+        temp[2*i+1] = block[stride*i + xStride*0] - block[stride*i + xStride*1];

     }

void FUNCC(ff_h264_chroma422_dc_dequant_idct)(int16_t *_block, int qmul){

    const int stride= 16*2;

    const int xStride= 16;

    int i;

    int temp[8];

    static const uint8_t x_offset[2]={0, 16};

    dctcoef *block = (dctcoef*)_block;

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

        temp[2*i+0] = block[stride*i + xStride*0] + block[stride*i + xStride*1];

        temp[2*i+1] = block[stride*i + xStride*0] - block[stride*i + xStride*1];

    }

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

        const int offset= x_offset[i];

        const int z0= temp[2*0+i] + temp[2*2+i];

        const int z1= temp[2*0+i] - temp[2*2+i];

        const int z2= temp[2*1+i] - temp[2*3+i];

        const int z3= temp[2*1+i] + temp[2*3+i];

        block[stride*0+offset]= ((z0 + z3)*qmul + 128) >> 8;

        block[stride*1+offset]= ((z1 + z2)*qmul + 128) >> 8;

        block[stride*2+offset]= ((z1 - z2)*qmul + 128) >> 8;

        block[stride*3+offset]= ((z0 - z3)*qmul + 128) >> 8;

    }

}


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

     GICState *s = (GICState *)opaque;

+    gic_cpu_write(s, gic_get_current_cpu(s), addr, value);
+
 }

static void gic_thiscpu_write(void *opaque, target_phys_addr_t addr,

                              uint64_t value, unsigned size)

{

    GICState *s = (GICState *)opaque;

    gic_cpu_write(s, gic_get_current_cpu(s), addr, value);

}


static int handle_ping(URLContext *s, RTMPPacket *pkt)

{

    RTMPContext *rt = s->priv_data;

    int t, ret;

    if (pkt->data_size < 2) {

        av_log(s, AV_LOG_ERROR, "Too short ping packet (%d)\n",

               pkt->data_size);

        return AVERROR_INVALIDDATA;

    t = AV_RB16(pkt->data);

    if (t == 6) {

        if ((ret = gen_pong(s, rt, pkt)) < 0)

    return 0;


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

 {

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

{

	const uint16_t *end;

	uint8_t *d = (uint8_t *)dst;

	const uint16_t *s = (uint16_t *)src;

	end = s + src_size/2;

	while(s < end)

	{

		register uint16_t bgr;

		bgr = *s++;

		*d++ = (bgr&0x7C00)>>7;

		*d++ = (bgr&0x3E0)>>2;

		*d++ = (bgr&0x1F)<<3;

	}

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+int cpu_signal_handler(int host_signum, void *pinfo,
+
+                           void *puc)
+
+{

     siginfo_t *info = pinfo;

int cpu_signal_handler(int host_signum, void *pinfo,

                           void *puc)

{

    siginfo_t *info = pinfo;

    ucontext_t *uc = puc;

    uint32_t *pc = uc->uc_mcontext.sc_pc;

    uint32_t insn = *pc;

    int is_write = 0;

    /* XXX: need kernel patch to get write flag faster */

    switch (insn >> 26) {

    case 0x0d: /* stw */

    case 0x0e: /* stb */

    case 0x0f: /* stq_u */

    case 0x24: /* stf */

    case 0x25: /* stg */

    case 0x26: /* sts */

    case 0x27: /* stt */

    case 0x2c: /* stl */

    case 0x2d: /* stq */

    case 0x2e: /* stl_c */

    case 0x2f: /* stq_c */

        is_write = 1;

    }

    return handle_cpu_signal(pc, (unsigned long)info->si_addr,

                             is_write, &uc->uc_sigmask);

}


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

         if (get_bits(gb, 6))
+
+            skip_bits(gb, 25);
+
+        align_get_bits(gb);
+
     }

int ff_tak_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb,

                               TAKStreamInfo *ti, int log_level_offset)

{

    if (get_bits(gb, TAK_FRAME_HEADER_SYNC_ID_BITS) != TAK_FRAME_HEADER_SYNC_ID) {

        av_log(avctx, AV_LOG_ERROR + log_level_offset, "missing sync id\n");

        return AVERROR_INVALIDDATA;

    }

    ti->flags     = get_bits(gb, TAK_FRAME_HEADER_FLAGS_BITS);

    ti->frame_num = get_bits(gb, TAK_FRAME_HEADER_NO_BITS);

    if (ti->flags & TAK_FRAME_FLAG_IS_LAST) {

        ti->last_frame_samples = get_bits(gb, TAK_FRAME_HEADER_SAMPLE_COUNT_BITS) + 1;

        skip_bits(gb, 2);

    } else {

        ti->last_frame_samples = 0;

    }

    if (ti->flags & TAK_FRAME_FLAG_HAS_INFO) {

        avpriv_tak_parse_streaminfo(gb, ti);

        if (get_bits(gb, 6))

            skip_bits(gb, 25);

        align_get_bits(gb);

    }

    if (ti->flags & TAK_FRAME_FLAG_HAS_METADATA)

        return AVERROR_INVALIDDATA;

    skip_bits(gb, 24);

    return 0;

}


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

 {


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

     /* hands over all ports from companion uhci to ehci */

static void pci_ehci_config(void)

{

    /* hands over all ports from companion uhci to ehci */

    qpci_io_writew(ehci1.dev, ehci1.base + 0x60, 1);

}


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

+                                const uint8_t *buf, int buf_size)

+{

     DVDSubContext *ctx = avctx->priv_data;
+
+

     if (ctx->buf_size > 0xffff - buf_size) {

static int append_to_cached_buf(AVCodecContext *avctx,

                                const uint8_t *buf, int buf_size)

{

    DVDSubContext *ctx = avctx->priv_data;

    if (ctx->buf_size > 0xffff - buf_size) {

        av_log(avctx, AV_LOG_WARNING, "Attempt to reconstruct "

               "too large SPU packets aborted.\n");

        av_freep(&ctx->buf);

        return AVERROR_INVALIDDATA;

    }

    ctx->buf = av_realloc(ctx->buf, ctx->buf_size + buf_size);

    if (!ctx->buf)

        return AVERROR(ENOMEM);

    memcpy(ctx->buf + ctx->buf_size, buf, buf_size);

    ctx->buf_size += buf_size;

    return 0;

}


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

     return dev->bus->address_space_mem;

+}

MemoryRegion *pci_address_space(PCIDevice *dev)

{

    return dev->bus->address_space_mem;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static PXA2xxI2SState *pxa2xx_i2s_init(MemoryRegion *sysmem,
+
                 hwaddr base,

                 qemu_irq irq, qemu_irq rx_dma, qemu_irq tx_dma)

static PXA2xxI2SState *pxa2xx_i2s_init(MemoryRegion *sysmem,

                hwaddr base,

                qemu_irq irq, qemu_irq rx_dma, qemu_irq tx_dma)

{

    PXA2xxI2SState *s = (PXA2xxI2SState *)

            g_malloc0(sizeof(PXA2xxI2SState));

    s->irq = irq;

    s->rx_dma = rx_dma;

    s->tx_dma = tx_dma;

    s->data_req = pxa2xx_i2s_data_req;

    pxa2xx_i2s_reset(s);

    memory_region_init_io(&s->iomem, NULL, &pxa2xx_i2s_ops, s,

                          "pxa2xx-i2s", 0x100000);

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

    vmstate_register(NULL, base, &vmstate_pxa2xx_i2s, s);

    return s;

}


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

     if (mc && mc->reset) {

+        mc->reset();
+
+    } else {
+
+        qemu_devices_reset();

     }

void qemu_system_reset(ShutdownCause reason)

{

    MachineClass *mc;

    mc = current_machine ? MACHINE_GET_CLASS(current_machine) : NULL;

    cpu_synchronize_all_states();

    if (mc && mc->reset) {

        mc->reset();

    } else {

        qemu_devices_reset();

    }

    if (reason) {

        /* TODO update event based on reason */

        qapi_event_send_reset(&error_abort);

    }

    cpu_synchronize_all_post_reset();

}


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

     gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

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

     TCGv t0;

+    if (unlikely(ctx->pr)) {

         gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

static void gen_mtsrin_64b(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

#else

    TCGv t0;

    if (unlikely(ctx->pr)) {

        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

        return;

    }

    t0 = tcg_temp_new();

    tcg_gen_shri_tl(t0, cpu_gpr[rB(ctx->opcode)], 28);

    tcg_gen_andi_tl(t0, t0, 0xF);

    gen_helper_store_sr(cpu_env, t0, cpu_gpr[rS(ctx->opcode)]);

    tcg_temp_free(t0);

#endif

}


static void cpu_print_cc(FILE *f,

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

                         uint32_t cc)

{

    cpu_fprintf(f, "%c%c%c%c", cc & PSR_NEG? 'N' : '-',

                cc & PSR_ZERO? 'Z' : '-', cc & PSR_OVF? 'V' : '-',

                cc & PSR_CARRY? 'C' : '-');

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void *acpi_add_rom_blob(AcpiBuildState *build_state, GArray *blob,

                                const char *name)

static void *acpi_add_rom_blob(AcpiBuildState *build_state, GArray *blob,

                               const char *name)

{

    return rom_add_blob(name, blob->data, acpi_data_len(blob), -1, name,

                        acpi_build_update, build_state);

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
 static void gen_div(DisasContext *dc, TCGv dest, TCGv srca, TCGv srcb)
+
 {
+
+    TCGv sr_ov = tcg_temp_new();

     TCGv t0 = tcg_temp_new();
+
+
+
     tcg_gen_setcondi_tl(TCG_COND_EQ, sr_ov, srcb, 0);

     /* The result of divide-by-zero is undefined.

static void gen_div(DisasContext *dc, TCGv dest, TCGv srca, TCGv srcb)

{

    TCGv sr_ov = tcg_temp_new();

    TCGv t0 = tcg_temp_new();

    tcg_gen_setcondi_tl(TCG_COND_EQ, sr_ov, srcb, 0);

    /* The result of divide-by-zero is undefined.

       Supress the host-side exception by dividing by 1.  */

    tcg_gen_or_tl(t0, srcb, sr_ov);

    tcg_gen_div_tl(dest, srca, t0);

    tcg_temp_free(t0);

    tcg_gen_deposit_tl(cpu_sr, cpu_sr, sr_ov, ctz32(SR_OV), 1);

    gen_ove_ov(dc, sr_ov);

    tcg_temp_free(sr_ov);

}


--- a/source.c
+++ b/source.c
@@ -2,8 +2,8 @@
 {
     if (!dev->parent_bus->allow_hotplug) {
         qemu_error("Bus %s does not support hotplugging\n",
+                   dev->parent_bus->name);
+        return -1;
     }
     return dev->info->unplug(dev);
 }

int qdev_unplug(DeviceState *dev)
{
    if (!dev->parent_bus->allow_hotplug) {
        qemu_error("Bus %s does not support hotplugging\n",
                   dev->parent_bus->name);
        return -1;
    }
    return dev->info->unplug(dev);
}


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

         fprintf(stderr, "qemu: tried to set invalid watchpoint at "

+                TARGET_FMT_lx ", len=" TARGET_FMT_lu "\n", addr, len);
+
+        return -EINVAL;
+
+    }

     wp = qemu_malloc(sizeof(*wp));

int cpu_watchpoint_insert(CPUState *env, target_ulong addr, target_ulong len,

                          int flags, CPUWatchpoint **watchpoint)

{

    target_ulong len_mask = ~(len - 1);

    CPUWatchpoint *wp;

    /* sanity checks: allow power-of-2 lengths, deny unaligned watchpoints */

    if ((len != 1 && len != 2 && len != 4 && len != 8) || (addr & ~len_mask)) {

        fprintf(stderr, "qemu: tried to set invalid watchpoint at "

                TARGET_FMT_lx ", len=" TARGET_FMT_lu "\n", addr, len);

        return -EINVAL;

    }

    wp = qemu_malloc(sizeof(*wp));

    wp->vaddr = addr;

    wp->len_mask = len_mask;

    wp->flags = flags;

    /* keep all GDB-injected watchpoints in front */

    if (flags & BP_GDB)

        TAILQ_INSERT_HEAD(&env->watchpoints, wp, entry);

    else

        TAILQ_INSERT_TAIL(&env->watchpoints, wp, entry);

    tlb_flush_page(env, addr);

    if (watchpoint)

        *watchpoint = wp;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static uint64_t addrrange_end(AddrRange r)

 {

static uint64_t addrrange_end(AddrRange r)

{

    return r.start + r.size;

}


--- a/source.c
+++ b/source.c
@@ -9,10 +9,10 @@
     ff_dca_core_flush(&s->core);

     ff_dca_xll_flush(&s->xll);
+
+    ff_dca_lbr_flush(&s->lbr);
+
+

     s->core_residual_valid = 0;

static av_cold void dcadec_flush(AVCodecContext *avctx)

{

    DCAContext *s = avctx->priv_data;

    ff_dca_core_flush(&s->core);

    ff_dca_xll_flush(&s->xll);

    ff_dca_lbr_flush(&s->lbr);

    s->core_residual_valid = 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 DescRing *desc_ring_alloc(Rocker *r, int index)

+{

     DescRing *ring;

DescRing *desc_ring_alloc(Rocker *r, int index)

{

    DescRing *ring;

    ring = g_malloc0(sizeof(DescRing));

    if (!ring) {

        return NULL;

    }

    ring->r = r;

    ring->index = index;

    return ring;

}


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

     migrate_set_state(&s->state, MIGRATION_STATUS_SETUP,

+                      MIGRATION_STATUS_FAILED);
+
+    if (!s->error) {
+
+        s->error = error_copy(error);

     }

void migrate_fd_error(MigrationState *s, const Error *error)

{

    trace_migrate_fd_error(error ? error_get_pretty(error) : "");

    assert(s->to_dst_file == NULL);

    migrate_set_state(&s->state, MIGRATION_STATUS_SETUP,

                      MIGRATION_STATUS_FAILED);

    if (!s->error) {

        s->error = error_copy(error);

    }

    notifier_list_notify(&migration_state_notifiers, s);

}


--- a/source.c
+++ b/source.c
@@ -27,9 +27,9 @@
         h->h264dsp.h264_h_loop_filter_chroma(pix, stride, alpha, beta, tc);

     } else {
+
+        h->h264dsp.h264_h_loop_filter_chroma_intra(pix, stride, alpha, beta);
+
+    }
+
 }

static void av_always_inline filter_mb_edgecv( uint8_t *pix, int stride, const int16_t bS[4], unsigned int qp, H264Context *h, int intra ) {

    const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);

    const unsigned int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset;

    const int alpha = alpha_table[index_a];

    const int beta  = beta_table[qp - qp_bd_offset + h->slice_beta_offset];

    if (alpha ==0 || beta == 0) return;

    if( bS[0] < 4 || !intra ) {

        int8_t tc[4];

        tc[0] = tc0_table[index_a][bS[0]]+1;

        tc[1] = tc0_table[index_a][bS[1]]+1;

        tc[2] = tc0_table[index_a][bS[2]]+1;

        tc[3] = tc0_table[index_a][bS[3]]+1;

        h->h264dsp.h264_h_loop_filter_chroma(pix, stride, alpha, beta, tc);

    } else {

        h->h264dsp.h264_h_loop_filter_chroma_intra(pix, stride, alpha, beta);

    }

}


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

     SimpleSpiceDisplay *ssd = opaque;
+

+
     if (running) {

         ssd->worker->start(ssd->worker);

void qemu_spice_vm_change_state_handler(void *opaque, int running, int reason)

{

    SimpleSpiceDisplay *ssd = opaque;

    if (running) {

        ssd->worker->start(ssd->worker);

    } else {

        qemu_mutex_unlock_iothread();

        ssd->worker->stop(ssd->worker);

        qemu_mutex_lock_iothread();

    }

    ssd->running = running;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static QObject *get_stats_qobject(VirtIOBalloon *dev)

+{

     QDict *dict = qdict_new();

static QObject *get_stats_qobject(VirtIOBalloon *dev)

{

    QDict *dict = qdict_new();

    uint32_t actual = ram_size - (dev->actual << VIRTIO_BALLOON_PFN_SHIFT);

    stat_put(dict, "actual", actual);

    stat_put(dict, "mem_swapped_in", dev->stats[VIRTIO_BALLOON_S_SWAP_IN]);

    stat_put(dict, "mem_swapped_out", dev->stats[VIRTIO_BALLOON_S_SWAP_OUT]);

    stat_put(dict, "major_page_faults", dev->stats[VIRTIO_BALLOON_S_MAJFLT]);

    stat_put(dict, "minor_page_faults", dev->stats[VIRTIO_BALLOON_S_MINFLT]);

    stat_put(dict, "free_mem", dev->stats[VIRTIO_BALLOON_S_MEMFREE]);

    stat_put(dict, "total_mem", dev->stats[VIRTIO_BALLOON_S_MEMTOT]);

    return QOBJECT(dict);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static av_cold int common_end(AVCodecContext *avctx){
     FFV1Context *s = avctx->priv_data;
     int i, j;
     for(j=0; j<s->slice_count; j++){

static av_cold int common_end(AVCodecContext *avctx){
    FFV1Context *s = avctx->priv_data;
    int i, j;
    for(j=0; j<s->slice_count; j++){
        FFV1Context *fs= s->slice_context[j];
        for(i=0; i<s->plane_count; i++){
            PlaneContext *p= &fs->plane[i];
            av_freep(&p->state);
            av_freep(&p->vlc_state);
        av_freep(&fs->sample_buffer);
    av_freep(&avctx->stats_out);
    for(j=0; j<s->quant_table_count; j++){
        av_freep(&s->initial_states[j]);
            FFV1Context *sf= s->slice_context[i];
            av_freep(&sf->rc_stat2[j]);
        av_freep(&s->rc_stat2[j]);
    return 0;


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

     t0 = tcg_temp_local_new();

+    gen_addr_reg_index(ctx, t0);
+
+    gen_check_align(ctx, t0, 0x07);
+
+    gen_qemu_ld64(ctx, cpu_gpr[rD(ctx->opcode)], t0);

     tcg_gen_mov_tl(cpu_reserve, t0);

static void gen_ldarx(DisasContext *ctx)

{

    TCGv t0;

    gen_set_access_type(ctx, ACCESS_RES);

    t0 = tcg_temp_local_new();

    gen_addr_reg_index(ctx, t0);

    gen_check_align(ctx, t0, 0x07);

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

    tcg_gen_mov_tl(cpu_reserve, t0);

    tcg_temp_free(t0);

}


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

     uint32_t level, diff;
+
+    int bit;
+
+
+
     level = s->gpio_level & s->gpio_dir;

static void tc6393xb_gpio_handler_update(TC6393xbState *s)

{

    uint32_t level, diff;

    int bit;

    level = s->gpio_level & s->gpio_dir;

    for (diff = s->prev_level ^ level; diff; diff ^= 1 << bit) {

        bit = ffs(diff) - 1;

        qemu_set_irq(s->handler[bit], (level >> bit) & 1);

    }

    s->prev_level = level;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 bool io_mem_write(MemoryRegion *mr, hwaddr addr,
+
                   uint64_t val, unsigned size)

 {

bool io_mem_write(MemoryRegion *mr, hwaddr addr,

                  uint64_t val, unsigned size)

{

    return memory_region_dispatch_write(mr, addr, val, size);

}


--- a/source.c
+++ b/source.c
@@ -15,9 +15,9 @@
                   (void *)cpu->mem_io_pc);

     }
+
+    cpu_restore_state_from_tb(cpu, tb, cpu->mem_io_pc);
+
+    tb_phys_invalidate(tb, -1);
+
 }

void tb_check_watchpoint(CPUState *cpu)

{

    TranslationBlock *tb;

    tb = tb_find_pc(cpu->mem_io_pc);

    if (!tb) {

        cpu_abort(cpu, "check_watchpoint: could not find TB for pc=%p",

                  (void *)cpu->mem_io_pc);

    }

    cpu_restore_state_from_tb(cpu, tb, cpu->mem_io_pc);

    tb_phys_invalidate(tb, -1);

}


--- a/source.c
+++ b/source.c
@@ -1,17 +1,17 @@
+static int parse_pci_devfn(DeviceState *dev, Property *prop, const char *str)

 {

     uint32_t *ptr = qdev_get_prop_ptr(dev, prop);

+    unsigned int slot, fn, n;

+
+    if (sscanf(str, "%x.%x%n", &slot, &fn, &n) != 2) {
+
         fn = 0;
+
         if (sscanf(str, "%x%n", &slot, &n) != 1) {

             return -EINVAL;

static int parse_pci_devfn(DeviceState *dev, Property *prop, const char *str)

{

    uint32_t *ptr = qdev_get_prop_ptr(dev, prop);

    unsigned int slot, fn, n;

    if (sscanf(str, "%x.%x%n", &slot, &fn, &n) != 2) {

        fn = 0;

        if (sscanf(str, "%x%n", &slot, &n) != 1) {

            return -EINVAL;

        }

    }

    if (str[n] != '\0')

        return -EINVAL;

    if (fn > 7)

        return -EINVAL;

    if (slot > 31)

        return -EINVAL;

    *ptr = slot << 3 | fn;

    return 0;

}


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

     const char *str = g_strdup_printf("%lld", LLONG_MAX);

static void test_qemu_strtoll_max(void)

{

    const char *str = g_strdup_printf("%lld", LLONG_MAX);

    char f = 'X';

    const char *endptr = &f;

    int64_t res = 999;

    int err;

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

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, LLONG_MAX);

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

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 void helper_done(void)
+
+{
+
+    env->pc = env->tsptr->tpc;
+
+    env->npc = env->tsptr->tnpc + 4;

+    PUT_CCR(env, env->tsptr->tstate >> 32);

     env->asi = (env->tsptr->tstate >> 24) & 0xff;

void helper_done(void)

{

    env->pc = env->tsptr->tpc;

    env->npc = env->tsptr->tnpc + 4;

    PUT_CCR(env, env->tsptr->tstate >> 32);

    env->asi = (env->tsptr->tstate >> 24) & 0xff;

    change_pstate((env->tsptr->tstate >> 8) & 0xf3f);

    PUT_CWP64(env, env->tsptr->tstate & 0xff);

    env->tl--;

    env->tsptr = &env->ts[env->tl & MAXTL_MASK];

}


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

     unsigned i;

+    MSIMessage msg = { .address = addr, .data = first_irq };

static void spapr_msi_setmsg(PCIDevice *pdev, hwaddr addr, bool msix,

                             unsigned first_irq, unsigned req_num)

{

    unsigned i;

    MSIMessage msg = { .address = addr, .data = first_irq };

    if (!msix) {

        msi_set_message(pdev, msg);

        trace_spapr_pci_msi_setup(pdev->name, 0, msg.address);

        return;

    }

    for (i = 0; i < req_num; ++i, ++msg.data) {

        msix_set_message(pdev, i, msg);

        trace_spapr_pci_msi_setup(pdev->name, i, msg.address);

    }

}


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

     Error *err = NULL;

+    int ret;

+

     ret = qio_channel_websock_handshake_read(wioc, &err);

static gboolean qio_channel_websock_handshake_io(QIOChannel *ioc,

                                                 GIOCondition condition,

                                                 gpointer user_data)

{

    QIOTask *task = user_data;

    QIOChannelWebsock *wioc = QIO_CHANNEL_WEBSOCK(

        qio_task_get_source(task));

    Error *err = NULL;

    int ret;

    ret = qio_channel_websock_handshake_read(wioc, &err);

    if (ret < 0) {

        trace_qio_channel_websock_handshake_fail(ioc);

        qio_task_abort(task, err);

        error_free(err);

        return FALSE;

    }

    if (ret == 0) {

        trace_qio_channel_websock_handshake_pending(ioc, G_IO_IN);

        /* need more data still */

        return TRUE;

    }

    object_ref(OBJECT(task));

    trace_qio_channel_websock_handshake_reply(ioc);

    qio_channel_add_watch(

        wioc->master,

        G_IO_OUT,

        qio_channel_websock_handshake_send,

        task,

        (GDestroyNotify)object_unref);

    return FALSE;

}


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

     /*

+     * FIXME should set error when unvisited elements remain.  Mostly
+
+     * harmless, as the generated visits always visit all elements.

      */

opts_check_list(Visitor *v, Error **errp)

{

    /*

     * FIXME should set error when unvisited elements remain.  Mostly

     * harmless, as the generated visits always visit all elements.

     */

}


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

 {

+    BlkAioEmAIOCB *acb;

     Coroutine *co;

static BlockAIOCB *blk_aio_prwv(BlockBackend *blk, int64_t offset, int bytes,

                                QEMUIOVector *qiov, CoroutineEntry co_entry,

                                BdrvRequestFlags flags,

                                BlockCompletionFunc *cb, void *opaque)

{

    BlkAioEmAIOCB *acb;

    Coroutine *co;

    bdrv_inc_in_flight(blk_bs(blk));

    acb = blk_aio_get(&blk_aio_em_aiocb_info, blk, cb, opaque);

    acb->rwco = (BlkRwCo) {

        .blk    = blk,

        .offset = offset,

        .qiov   = qiov,

        .flags  = flags,

        .ret    = NOT_DONE,

    };

    acb->bytes = bytes;

    acb->has_returned = false;

    co = qemu_coroutine_create(co_entry, acb);

    qemu_coroutine_enter(co);

    acb->has_returned = true;

    if (acb->rwco.ret != NOT_DONE) {

        aio_bh_schedule_oneshot(blk_get_aio_context(blk),

                                blk_aio_complete_bh, acb);

    }

    return &acb->common;

}


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

 {
+
+    uint64_t tmp;

     uint64_t result;

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

{

    uint64_t tmp;

    uint64_t result;

    DO_ABD(result, a, b, int16_t);

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

    return result | (tmp << 32);

}


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

     CPUArchState *env = mon_get_cpu();

+    unsigned int u;

     int i;

static target_long monitor_get_ccr (const struct MonitorDef *md, int val)

{

    CPUArchState *env = mon_get_cpu();

    unsigned int u;

    int i;

    u = 0;

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

        u |= env->crf[i] << (32 - (4 * i));

    return u;

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     case 0x1 /* Read FIT */:

         nvdimm_dsm_func_read_fit(state, in, dsm_mem_addr);
+
+        return;
+
+    }
+

     nvdimm_dsm_no_payload(NVDIMM_DSM_RET_STATUS_UNSUPPORT, dsm_mem_addr);

static void nvdimm_dsm_reserved_root(AcpiNVDIMMState *state, NvdimmDsmIn *in,

                                     hwaddr dsm_mem_addr)

{

    switch (in->function) {

    case 0x0:

        nvdimm_dsm_function0(0x1 | 1 << 1 /* Read FIT */, dsm_mem_addr);

        return;

    case 0x1 /* Read FIT */:

        nvdimm_dsm_func_read_fit(state, in, dsm_mem_addr);

        return;

    }

    nvdimm_dsm_no_payload(NVDIMM_DSM_RET_STATUS_UNSUPPORT, dsm_mem_addr);

}


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

     t0 = tcg_temp_local_new_i32();

+    /* No error here: 6 bits are used */
+
+    tcg_gen_andi_i32(t0, arg2, 0x3F);
+
+    tcg_gen_brcondi_i32(TCG_COND_GE, t0, 32, l1);

     tcg_gen_shl_i32(ret, arg1, t0);

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

{

    TCGv_i32 t0;

    int l1, l2;

    l1 = gen_new_label();

    l2 = gen_new_label();

    t0 = tcg_temp_local_new_i32();

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

    tcg_gen_andi_i32(t0, arg2, 0x3F);

    tcg_gen_brcondi_i32(TCG_COND_GE, t0, 32, l1);

    tcg_gen_shl_i32(ret, arg1, t0);

    tcg_gen_br(l2);

    gen_set_label(l1);

    tcg_gen_movi_i32(ret, 0);

    gen_set_label(l2);

    tcg_temp_free_i32(t0);

}


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

 {

+    DeviceClass *dc = DEVICE_CLASS(klass);

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    dc->realize = pcspk_realizefn;

    set_bit(DEVICE_CATEGORY_SOUND, dc->categories);

    dc->no_user = 1;

    dc->props = pcspk_properties;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 int qemu_mutex_trylock(QemuMutex *mutex)

+{
+
+    int owned;
+

     owned = TryEnterCriticalSection(&mutex->lock);

int qemu_mutex_trylock(QemuMutex *mutex)

{

    int owned;

    owned = TryEnterCriticalSection(&mutex->lock);

    if (owned) {

        assert(mutex->owner == 0);

        mutex->owner = GetCurrentThreadId();

    }

    return !owned;

}


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

     if (!rom_enable_driver_roms)
+
+        return 0;

     return rom_add_file(file, "genroms", file, 0);

int rom_add_option(const char *file)

{

    if (!rom_enable_driver_roms)

        return 0;

    return rom_add_file(file, "genroms", file, 0);

}


static int gif_parse_next_image(GifState *s)

{

    for (;;) {

        int code = bytestream_get_byte(&s->bytestream);

#ifdef DEBUG

        dprintf(s->avctx, "gif: code=%02x '%c'\n", code, code);

#endif

        switch (code) {

        case ',':

            if (gif_read_image(s) < 0)

                return -1;

            return 0;

        case ';':

            /* end of image */

            return -1;

        case '!':

            if (gif_read_extension(s) < 0)

                return -1;

            break;

        default:

            /* error or errneous EOF */

            return -1;

        }

    }

}


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

     int i;
+
+
+
+    for (i = 0; i < s->nb_streams; i++) {
+
         if (s->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) {

             GXFStreamContext *sc = &gxf->streams[i];

static int gxf_interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush)

{

    GXFContext *gxf = s->priv_data;

    AVPacket new_pkt;

    int i;

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

        if (s->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) {

            GXFStreamContext *sc = &gxf->streams[i];

            if (pkt && pkt->stream_index == i) {

                av_fifo_write(&sc->audio_buffer, pkt->data, pkt->size);

                pkt = NULL;

            }

            if (flush || av_fifo_size(&sc->audio_buffer) >= GXF_AUDIO_PACKET_SIZE) {

                if (!pkt && gxf_new_audio_packet(gxf, sc, &new_pkt, flush) > 0) {

                    pkt = &new_pkt;

                    break; /* add pkt right now into list */

                }

            }

        }

    }

    return av_interleave_packet_per_dts(s, out, pkt, flush);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int ast_probe(AVProbeData *p)
+
+{

     if (AV_RL32(p->buf) == MKTAG('S','T','R','M') &&

static int ast_probe(AVProbeData *p)

{

    if (AV_RL32(p->buf) == MKTAG('S','T','R','M') &&

        AV_RB16(p->buf + 10) &&

        AV_RB16(p->buf + 12) &&

        AV_RB32(p->buf + 16))

        return AVPROBE_SCORE_MAX / 3 * 2;

    return 0;

}


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

     DeviceClass *dc = DEVICE_CLASS(klass);

+    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+
+
+    k->init = virtio_balloon_init_pci;

     k->exit = virtio_balloon_exit_pci;

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);

    k->init = virtio_balloon_init_pci;

    k->exit = virtio_balloon_exit_pci;

    k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;

    k->device_id = PCI_DEVICE_ID_VIRTIO_BALLOON;

    k->revision = VIRTIO_PCI_ABI_VERSION;

    k->class_id = PCI_CLASS_MEMORY_RAM;

    dc->alias = "virtio-balloon";

    dc->reset = virtio_pci_reset;

    dc->props = virtio_balloon_properties;

}


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

     TCGv tmp = new_tmp();
+
     tcg_gen_andi_i32(var, var, 0xffff0000);

     tcg_gen_shri_i32(tmp, var, 16);

static void gen_neon_dup_high16(TCGv var)

{

    TCGv tmp = new_tmp();

    tcg_gen_andi_i32(var, var, 0xffff0000);

    tcg_gen_shri_i32(tmp, var, 16);

    tcg_gen_or_i32(var, var, tmp);

    dead_tmp(tmp);

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
         perror("cannot init reset vcpu");

     }
+
+
+
+    /* Manually zero out all registers */
+
     cpu_synchronize_state(cs);

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

static int s390_cpu_initial_reset(S390CPU *cpu)

{

    CPUState *cs = CPU(cpu);

    CPUS390XState *env = &cpu->env;

    int i;

    s390_del_running_cpu(cpu);

    if (kvm_vcpu_ioctl(cs, KVM_S390_INITIAL_RESET, NULL) < 0) {

        perror("cannot init reset vcpu");

    }

    /* Manually zero out all registers */

    cpu_synchronize_state(cs);

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

        env->regs[i] = 0;

    }

    DPRINTF("DONE: SIGP initial reset: %p\n", env);

    return 0;

}


static inline int onenand_prog_spare(OneNANDState *s, int sec, int secn,

                void *src)

{

    int result = 0;

    if (secn > 0) {

        const uint8_t *sp = (const uint8_t *)src;

        uint8_t *dp = 0, *dpp = 0;

        if (s->blk_cur) {

            dp = g_malloc(512);

            if (!dp

                || blk_read(s->blk_cur, s->secs_cur + (sec >> 5), dp, 1) < 0) {

                result = 1;

            } else {

                dpp = dp + ((sec & 31) << 4);

            }

        } else {

            if (sec + secn > s->secs_cur) {

                result = 1;

            } else {

                dpp = s->current + (s->secs_cur << 9) + (sec << 4);

            }

        }

        if (!result) {

            uint32_t i;

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

                dpp[i] &= sp[i];

            }

            if (s->blk_cur) {

                result = blk_write(s->blk_cur, s->secs_cur + (sec >> 5),

                                   dp, 1) < 0;

            }

        }

        g_free(dp);

    }

    return result;

}


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

                      j++, ptr += syntax[i].list_elem_size)

+                    ebml_free(syntax[i].def.n, ptr);
+
+                av_freep(&list->elem);
+
+
             } else

                 ebml_free(syntax[i].def.n, data_off);

static void ebml_free(EbmlSyntax *syntax, void *data)

{

    int i, j;

    for (i = 0; syntax[i].id; i++) {

        void *data_off = (char *) data + syntax[i].data_offset;

        switch (syntax[i].type) {

        case EBML_STR:

        case EBML_UTF8:

            av_freep(data_off);

            break;

        case EBML_BIN:

            av_freep(&((EbmlBin *) data_off)->data);

            break;

        case EBML_LEVEL1:

        case EBML_NEST:

            if (syntax[i].list_elem_size) {

                EbmlList *list = data_off;

                char *ptr = list->elem;

                for (j = 0; j < list->nb_elem;

                     j++, ptr += syntax[i].list_elem_size)

                    ebml_free(syntax[i].def.n, ptr);

                av_freep(&list->elem);

            } else

                ebml_free(syntax[i].def.n, data_off);

        default:

            break;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static inline void vring_used_write(VirtQueue *vq, VRingUsedElem *uelem,
+
                                     int i)

 {

static inline void vring_used_write(VirtQueue *vq, VRingUsedElem *uelem,

                                    int i)

{

    VRingMemoryRegionCaches *caches = atomic_rcu_read(&vq->vring.caches);

    hwaddr pa = offsetof(VRingUsed, ring[i]);

    virtio_tswap32s(vq->vdev, &uelem->id);

    virtio_tswap32s(vq->vdev, &uelem->len);

    address_space_write_cached(&caches->used, pa, uelem, sizeof(VRingUsedElem));

    address_space_cache_invalidate(&caches->used, pa, sizeof(VRingUsedElem));

}


--- a/source.c
+++ b/source.c
@@ -19,7 +19,7 @@
             out_pts = afq->frames->pts;

     }
+
     if(!afq->frame_count)

         av_log(afq->avctx, AV_LOG_WARNING, "Trying to remove %d samples, but que empty\n", nb_samples);

void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts,

                        int *duration)

{

    int64_t out_pts = AV_NOPTS_VALUE;

    int removed_samples = 0;

    int i;

    if (afq->frame_count || afq->frame_alloc) {

        if (afq->frames->pts != AV_NOPTS_VALUE)

            out_pts = afq->frames->pts;

    }

    if(!afq->frame_count)

        av_log(afq->avctx, AV_LOG_WARNING, "Trying to remove %d samples, but que empty\n", nb_samples);

    if (pts)

        *pts = ff_samples_to_time_base(afq->avctx, out_pts);

    for(i=0; nb_samples && i<afq->frame_count; i++){

        int n= FFMIN(afq->frames[i].duration, nb_samples);

        afq->frames[i].duration -= n;

        nb_samples              -= n;

        removed_samples         += n;

        if(afq->frames[i].pts != AV_NOPTS_VALUE)

            afq->frames[i].pts      += n;

    }

    i -= i && afq->frames[i-1].duration;

    memmove(afq->frames, afq->frames + i, sizeof(*afq->frames) * (afq->frame_count - i));

    afq->frame_count -= i;

    if(nb_samples){

        av_assert0(!afq->frame_count);

        if(afq->frames[0].pts != AV_NOPTS_VALUE)

            afq->frames[0].pts += nb_samples;

        av_log(afq->avctx, AV_LOG_DEBUG, "Trying to remove %d more samples than are in the que\n", nb_samples);

    }

    if (duration)

        *duration = ff_samples_to_time_base(afq->avctx, removed_samples);

}