--- a/source.c
+++ b/source.c
@@ -18,11 +18,11 @@
             break;
         for (i = 0; i < s->terms; i++) {
             t = s->decorr[i].value;
+            if (t > 8) {
+                if (t & 1)
+                    A =  2 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1];
+                else
+                    A = (3 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1;
                 s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0];
                 j                        = 0;
             } else {

static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb,
                                 void *dst, const int type)
{
    int i, j, count = 0;
    int last, t;
    int A, S, T;
    int pos                  = s->pos;
    uint32_t crc             = s->sc.crc;
    uint32_t crc_extra_bits  = s->extra_sc.crc;
    int16_t *dst16           = dst;
    int32_t *dst32           = dst;
    float *dstfl             = dst;
    s->one = s->zero = s->zeroes = 0;
    do {
        T = wv_get_value(s, gb, 0, &last);
        S = 0;
        if (last)
            break;
        for (i = 0; i < s->terms; i++) {
            t = s->decorr[i].value;
            if (t > 8) {
                if (t & 1)
                    A =  2 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1];
                else
                    A = (3 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1;
                s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0];
                j                        = 0;
            } else {
                A = s->decorr[i].samplesA[pos];
                j = (pos + t) & 7;
            if (type != AV_SAMPLE_FMT_S16P)
                S = T + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10);
            else
                S = T + ((s->decorr[i].weightA * A + 512) >> 10);
            if (A && T)
                s->decorr[i].weightA -= ((((T ^ A) >> 30) & 2) - 1) * s->decorr[i].delta;
            s->decorr[i].samplesA[j] = T = S;
        pos = (pos + 1) & 7;
        crc = crc * 3 + S;
        if (type == AV_SAMPLE_FMT_FLTP) {
            *dstfl++ = wv_get_value_float(s, &crc_extra_bits, S);
        } else if (type == AV_SAMPLE_FMT_S32P) {
            *dst32++ = wv_get_value_integer(s, &crc_extra_bits, S);
        } else {
            *dst16++ = wv_get_value_integer(s, &crc_extra_bits, S);
        count++;
    } while (!last && count < s->samples);
    wv_reset_saved_context(s);
    if (s->avctx->err_recognition & AV_EF_CRCCHECK) {
        int ret = wv_check_crc(s, crc, crc_extra_bits);
        if (ret < 0 && s->avctx->err_recognition & AV_EF_EXPLODE)
            return ret;
    return 0;


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

     int mba_xy, mbb_xy;

+    int ctx = 0;
+
+
+
+    if(FRAME_MBAFF){ //FIXME merge with the stuff in fill_caches?

         int mb_xy = mb_x + (mb_y&~1)*s->mb_stride;

static int decode_cabac_mb_skip( H264Context *h, int mb_x, int mb_y ) {

    MpegEncContext * const s = &h->s;

    int mba_xy, mbb_xy;

    int ctx = 0;

    if(FRAME_MBAFF){ //FIXME merge with the stuff in fill_caches?

        int mb_xy = mb_x + (mb_y&~1)*s->mb_stride;

        mba_xy = mb_xy - 1;

        if( (mb_y&1)

            && h->slice_table[mba_xy] == h->slice_num

            && MB_FIELD == !!IS_INTERLACED( s->current_picture.mb_type[mba_xy] ) )

            mba_xy += s->mb_stride;

        if( MB_FIELD ){

            mbb_xy = mb_xy - s->mb_stride;

            if( !(mb_y&1)

                && h->slice_table[mbb_xy] == h->slice_num

                && IS_INTERLACED( s->current_picture.mb_type[mbb_xy] ) )

                mbb_xy -= s->mb_stride;

        }else

            mbb_xy = mb_x + (mb_y-1)*s->mb_stride;

    }else{

        int mb_xy = mb_x + mb_y*s->mb_stride;

        mba_xy = mb_xy - 1;

        mbb_xy = mb_xy - s->mb_stride;

    }

    if( h->slice_table[mba_xy] == h->slice_num && !IS_SKIP( s->current_picture.mb_type[mba_xy] ))

        ctx++;

    if( h->slice_table[mbb_xy] == h->slice_num && !IS_SKIP( s->current_picture.mb_type[mbb_xy] ))

        ctx++;

    if( h->slice_type == B_TYPE )

        ctx += 13;

    return get_cabac( &h->cabac, &h->cabac_state[11+ctx] );

}


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

     }

+
+
+    if (s->ctrl & SCSW_STCTL_STATUS_PEND) {
+
+        ret = -EINPROGRESS;

         goto out;

int css_do_rsch(SubchDev *sch)

{

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

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

    int ret;

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

        ret = -ENODEV;

        goto out;

    }

    if (s->ctrl & SCSW_STCTL_STATUS_PEND) {

        ret = -EINPROGRESS;

        goto out;

    }

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

        (s->ctrl & SCSW_ACTL_RESUME_PEND) ||

        (!(s->ctrl & SCSW_ACTL_SUSP))) {

        ret = -EINVAL;

        goto out;

    }

    /* If monitoring is active, update counter. */

    if (channel_subsys.chnmon_active) {

        css_update_chnmon(sch);

    }

    s->ctrl |= SCSW_ACTL_RESUME_PEND;

    do_subchannel_work(sch, NULL);

    ret = 0;

out:

    return ret;

}


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

             tcg_gen_brcondi_tl(TCG_COND_EQ, t0, 1, l1);

+            t_gen_illegal_insn(dc);
+
+            tcg_gen_br(l2);
+
+        }

static void dec_sr(DisasContext *dc)

{

    if (dc->format == OP_FMT_RI) {

        LOG_DIS("sri r%d, r%d, %d\n", dc->r1, dc->r0, dc->imm5);

    } else {

        LOG_DIS("sr r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1);

    }

    /* The real CPU (w/o hardware shifter) only supports right shift by exactly

     * one bit */

    if (dc->format == OP_FMT_RI) {

        if (!(dc->features & LM32_FEATURE_SHIFT) && (dc->imm5 != 1)) {

            qemu_log_mask(LOG_GUEST_ERROR,

                    "hardware shifter is not available\n");

            t_gen_illegal_insn(dc);

            return;

        }

        tcg_gen_sari_tl(cpu_R[dc->r1], cpu_R[dc->r0], dc->imm5);

    } else {

        int l1 = gen_new_label();

        int l2 = gen_new_label();

        TCGv t0 = tcg_temp_local_new();

        tcg_gen_andi_tl(t0, cpu_R[dc->r1], 0x1f);

        if (!(dc->features & LM32_FEATURE_SHIFT)) {

            tcg_gen_brcondi_tl(TCG_COND_EQ, t0, 1, l1);

            t_gen_illegal_insn(dc);

            tcg_gen_br(l2);

        }

        gen_set_label(l1);

        tcg_gen_sar_tl(cpu_R[dc->r2], cpu_R[dc->r0], t0);

        gen_set_label(l2);

        tcg_temp_free(t0);

    }

}


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

     QLIST_REMOVE(req, list);

+
+}

static void tracked_request_end(BdrvTrackedRequest *req)

{

    QLIST_REMOVE(req, list);

}


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

 {
+
     int iomemtype;

     pl181_state *s;

void pl181_init(uint32_t base, BlockDriverState *bd,

                qemu_irq irq0, qemu_irq irq1)

{

    int iomemtype;

    pl181_state *s;

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

    iomemtype = cpu_register_io_memory(0, pl181_readfn,

                                       pl181_writefn, s);

    cpu_register_physical_memory(base, 0x00000fff, iomemtype);

    s->base = base;

    s->card = sd_init(bd);

    s->irq[0] = irq0;

    s->irq[1] = irq1;

    qemu_register_reset(pl181_reset, s);

    pl181_reset(s);

    /* ??? Save/restore.  */

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     uint8_t use_same_mux = get_bits(gb, 1);

     if (!use_same_mux) {
+
         if ((err = read_stream_mux_config(latmctx, gb)) < 0)

             return err;

static int read_audio_mux_element(struct LATMContext *latmctx,

                                  GetBitContext *gb)

{

    int err;

    uint8_t use_same_mux = get_bits(gb, 1);

    if (!use_same_mux) {

        if ((err = read_stream_mux_config(latmctx, gb)) < 0)

            return err;

    } else if (!latmctx->aac_ctx.avctx->extradata) {

        av_log(latmctx->aac_ctx.avctx, AV_LOG_DEBUG,

               "no decoder config found\n");

        return AVERROR(EAGAIN);

    }

    if (latmctx->audio_mux_version_A == 0) {

        int mux_slot_length_bytes = read_payload_length_info(latmctx, gb);

        if (mux_slot_length_bytes * 8 > get_bits_left(gb)) {

            av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR, "incomplete frame\n");

            return AVERROR_INVALIDDATA;

        } else if (mux_slot_length_bytes * 8 + 256 < get_bits_left(gb)) {

            av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR,

                   "frame length mismatch %d << %d\n",

                   mux_slot_length_bytes * 8, get_bits_left(gb));

            return AVERROR_INVALIDDATA;

        }

    }

    return 0;

}


static int compare_doubles(const double *a, const double *b, int len,

                           double max_diff)

{

    int i;

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

        if (fabs(a[i] - b[i]) > max_diff) {

            av_log(NULL, AV_LOG_ERROR, "%d: %- .12f - %- .12f = % .12g\n",

                   i, a[i], b[i], a[i] - b[i]);

            return -1;

        }

    }

    return 0;

}


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

     slirp_vc = qemu_new_vlan_client(vlan, model, name,

+                                    slirp_receive, NULL, NULL, NULL);
+
+    slirp_vc->info_str[0] = '\0';
+
+    return 0;

 }

static int net_slirp_init(VLANState *vlan, const char *model, const char *name)

{

    if (!slirp_inited) {

        slirp_inited = 1;

        slirp_init(slirp_restrict, slirp_ip);

    }

    slirp_vc = qemu_new_vlan_client(vlan, model, name,

                                    slirp_receive, NULL, NULL, NULL);

    slirp_vc->info_str[0] = '\0';

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static bool is_iso_bc_entry_compatible(IsoBcSection *s)

 {
+
     return true;

 }

static bool is_iso_bc_entry_compatible(IsoBcSection *s)

{

    return true;

}


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

+    qemu_bh_delete(acb->bh);
+
+    qemu_aio_unref(acb);
+
 }

static void bdrv_co_em_bh(void *opaque)

{

    BlockAIOCBCoroutine *acb = opaque;

    acb->common.cb(acb->common.opaque, acb->req.error);

    qemu_bh_delete(acb->bh);

    qemu_aio_unref(acb);

}


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

     acls = qemu_realloc(acls, sizeof(*acls) * (nacls +1));
+
+    acls[nacls] = acl;
+
+    nacls++;
+

     return acl;

qemu_acl *qemu_acl_init(const char *aclname)

{

    qemu_acl *acl;

    acl = qemu_acl_find(aclname);

    if (acl)

        return acl;

    acl = qemu_malloc(sizeof(*acl));

    acl->aclname = qemu_strdup(aclname);

    /* Deny by default, so there is no window of "open

     * access" between QEMU starting, and the user setting

     * up ACLs in the monitor */

    acl->defaultDeny = 1;

    acl->nentries = 0;

    TAILQ_INIT(&acl->entries);

    acls = qemu_realloc(acls, sizeof(*acls) * (nacls +1));

    acls[nacls] = acl;

    nacls++;

    return acl;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void ehci_trace_qh(EHCIQueue *q, target_phys_addr_t addr, EHCIqh *qh)
+
 {

     trace_usb_ehci_qh(q, addr, qh->next,

static void ehci_trace_qh(EHCIQueue *q, target_phys_addr_t addr, EHCIqh *qh)

{

    trace_usb_ehci_qh(q, addr, qh->next,

                      qh->current_qtd, qh->next_qtd, qh->altnext_qtd,

                      get_field(qh->epchar, QH_EPCHAR_RL),

                      get_field(qh->epchar, QH_EPCHAR_MPLEN),

                      get_field(qh->epchar, QH_EPCHAR_EPS),

                      get_field(qh->epchar, QH_EPCHAR_EP),

                      get_field(qh->epchar, QH_EPCHAR_DEVADDR),

                      (bool)(qh->epchar & QH_EPCHAR_C),

                      (bool)(qh->epchar & QH_EPCHAR_H),

                      (bool)(qh->epchar & QH_EPCHAR_DTC),

                      (bool)(qh->epchar & QH_EPCHAR_I));

}


--- a/source.c
+++ b/source.c
@@ -13,9 +13,9 @@
         dirty += bdrv_get_dirty_count(bmds->bs, bmds->dirty_bitmap);

     }
+
+
+
+    return dirty << BDRV_SECTOR_BITS;
+
 }

static int64_t get_remaining_dirty(void)

{

    BlkMigDevState *bmds;

    int64_t dirty = 0;

    QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {

        dirty += bdrv_get_dirty_count(bmds->bs, bmds->dirty_bitmap);

    }

    return dirty << BDRV_SECTOR_BITS;

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
         return AVERROR_OPTION_NOT_FOUND;

     if (o->type != type) {
+
+        av_log(obj, AV_LOG_ERROR,
+
+               "The value set by option '%s' is not a %s format", name, desc);
+
         return AVERROR(EINVAL);

     }

static int set_format(void *obj, const char *name, int fmt, int search_flags,

                      enum AVOptionType type, const char *desc, int nb_fmts)

{

    void *target_obj;

    const AVOption *o = av_opt_find2(obj, name, NULL, 0,

                                     search_flags, &target_obj);

    int min, max;

    const AVClass *class = *(AVClass **)obj;

    if (!o || !target_obj)

        return AVERROR_OPTION_NOT_FOUND;

    if (o->type != type) {

        av_log(obj, AV_LOG_ERROR,

               "The value set by option '%s' is not a %s format", name, desc);

        return AVERROR(EINVAL);

    }

#if LIBAVUTIL_VERSION_MAJOR < 54

    if (class->version && class->version < AV_VERSION_INT(52, 11, 100)) {

        min = -1;

        max = nb_fmts-1;

    } else

#endif

    {

        min = FFMIN(o->min, -1);

        max = FFMAX(o->max, nb_fmts-1);

    }

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

        av_log(obj, AV_LOG_ERROR,

               "Value %d for parameter '%s' out of %s format range [%d - %d]\n",

               fmt, name, desc, min, max);

        return AVERROR(ERANGE);

    }

    *(int *)(((uint8_t *)target_obj) + o->offset) = fmt;

    return 0;

}


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

     struct sockaddr_storage ss;

+    socklen_t sslen = sizeof(ss);
+
+
+
+    if (getsockname(fd, (struct sockaddr *)&ss, &sslen) < 0) {

         error_setg_errno(errp, errno, "%s",

SocketAddress *socket_local_address(int fd, Error **errp)

{

    struct sockaddr_storage ss;

    socklen_t sslen = sizeof(ss);

    if (getsockname(fd, (struct sockaddr *)&ss, &sslen) < 0) {

        error_setg_errno(errp, errno, "%s",

                         "Unable to query local socket address");

        return NULL;

    }

    return socket_sockaddr_to_address(&ss, sslen, errp);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 void memory_region_iommu_replay(MemoryRegion *mr, Notifier *n,

                                 hwaddr granularity, bool is_write)
+
+{
+
+    hwaddr addr;
+
     IOMMUTLBEntry iotlb;

void memory_region_iommu_replay(MemoryRegion *mr, Notifier *n,

                                hwaddr granularity, bool is_write)

{

    hwaddr addr;

    IOMMUTLBEntry iotlb;

    for (addr = 0; addr < memory_region_size(mr); addr += granularity) {

        iotlb = mr->iommu_ops->translate(mr, addr, is_write);

        if (iotlb.perm != IOMMU_NONE) {

            n->notify(n, &iotlb);

        }

        /* if (2^64 - MR size) < granularity, it's possible to get an

         * infinite loop here.  This should catch such a wraparound */

        if ((addr + granularity) < addr) {

            break;

        }

    }

}


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

     CPUState *env;

+
+
+    while (all_cpu_threads_idle()) {
+
        /* Start accounting real time to the virtual clock if the CPUs

           are idle.  */

static void qemu_tcg_wait_io_event(void)

{

    CPUState *env;

    while (all_cpu_threads_idle()) {

       /* Start accounting real time to the virtual clock if the CPUs

          are idle.  */

        qemu_clock_warp(vm_clock);

        qemu_cond_wait(tcg_halt_cond, &qemu_global_mutex);

    }

    qemu_mutex_unlock(&qemu_global_mutex);

    /*

     * Users of qemu_global_mutex can be starved, having no chance

     * to acquire it since this path will get to it first.

     * So use another lock to provide fairness.

     */

    qemu_mutex_lock(&qemu_fair_mutex);

    qemu_mutex_unlock(&qemu_fair_mutex);

    qemu_mutex_lock(&qemu_global_mutex);

    for (env = first_cpu; env != NULL; env = env->next_cpu) {

        qemu_wait_io_event_common(env);

    }

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
         ctx->thread_pool = thread_pool_new(ctx);

     }
+
+    return ctx->thread_pool;
+
 }

ThreadPool *aio_get_thread_pool(AioContext *ctx)

{

    if (!ctx->thread_pool) {

        ctx->thread_pool = thread_pool_new(ctx);

    }

    return ctx->thread_pool;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int64_t seek_to_sector(BlockDriverState *bs, int64_t sector_num)

+{
+
     BDRVBochsState *s = bs->opaque;

     int64_t offset = sector_num * 512;

static int64_t seek_to_sector(BlockDriverState *bs, int64_t sector_num)

{

    BDRVBochsState *s = bs->opaque;

    int64_t offset = sector_num * 512;

    int64_t extent_index, extent_offset, bitmap_offset;

    char bitmap_entry;

    // seek to sector

    extent_index = offset / s->extent_size;

    extent_offset = (offset % s->extent_size) / 512;

    if (s->catalog_bitmap[extent_index] == 0xffffffff) {

	return -1; /* not allocated */

    }

    bitmap_offset = s->data_offset + (512 * s->catalog_bitmap[extent_index] *

	(s->extent_blocks + s->bitmap_blocks));

    /* read in bitmap for current extent */

    if (bdrv_pread(bs->file, bitmap_offset + (extent_offset / 8),

                   &bitmap_entry, 1) != 1) {

        return -1;

    }

    if (!((bitmap_entry >> (extent_offset % 8)) & 1)) {

	return -1; /* not allocated */

    }

    return bitmap_offset + (512 * (s->bitmap_blocks + extent_offset));

}


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

     avctx->coded_frame = &s->frame;

+
+
+    av_log(avctx, AV_LOG_DEBUG, "%d channels, %d bits/sample, "
+
+           "block align = %d, sample rate = %d\n",

            avctx->channels, avctx->bits_per_coded_sample, avctx->block_align,

static av_cold int vmdaudio_decode_init(AVCodecContext *avctx)

{

    VmdAudioContext *s = avctx->priv_data;

    if (avctx->channels < 1 || avctx->channels > 2) {

        av_log(avctx, AV_LOG_ERROR, "invalid number of channels\n");

        return AVERROR(EINVAL);

    }

    if (avctx->block_align < 1) {

        av_log(avctx, AV_LOG_ERROR, "invalid block align\n");

        return AVERROR(EINVAL);

    }

    avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO :

                                                   AV_CH_LAYOUT_STEREO;

    if (avctx->bits_per_coded_sample == 16)

        avctx->sample_fmt = AV_SAMPLE_FMT_S16;

    else

        avctx->sample_fmt = AV_SAMPLE_FMT_U8;

    s->out_bps = av_get_bytes_per_sample(avctx->sample_fmt);

    s->chunk_size = avctx->block_align + avctx->channels * (s->out_bps == 2);

    avcodec_get_frame_defaults(&s->frame);

    avctx->coded_frame = &s->frame;

    av_log(avctx, AV_LOG_DEBUG, "%d channels, %d bits/sample, "

           "block align = %d, sample rate = %d\n",

           avctx->channels, avctx->bits_per_coded_sample, avctx->block_align,

           avctx->sample_rate);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 void spapr_register_hypercall(target_ulong opcode, spapr_hcall_fn fn)
+
+{
+
+    spapr_hcall_fn old_fn;
+
+

     assert(opcode <= MAX_HCALL_OPCODE);

void spapr_register_hypercall(target_ulong opcode, spapr_hcall_fn fn)

{

    spapr_hcall_fn old_fn;

    assert(opcode <= MAX_HCALL_OPCODE);

    assert((opcode & 0x3) == 0);

    old_fn = hypercall_table[opcode / 4];

    assert(!old_fn || (fn == old_fn));

    hypercall_table[opcode / 4] = fn;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 bool qpci_msix_pending(QPCIDevice *dev, uint16_t entry)

 {
+
     uint32_t pba_entry;
+
+    uint8_t bit_n = entry % 32;

     void *addr = dev->msix_pba + (entry / 32) * PCI_MSIX_ENTRY_SIZE / 4;

bool qpci_msix_pending(QPCIDevice *dev, uint16_t entry)

{

    uint32_t pba_entry;

    uint8_t bit_n = entry % 32;

    void *addr = dev->msix_pba + (entry / 32) * PCI_MSIX_ENTRY_SIZE / 4;

    g_assert(dev->msix_enabled);

    pba_entry = qpci_io_readl(dev, addr);

    qpci_io_writel(dev, addr, pba_entry & ~(1 << bit_n));

    return (pba_entry & (1 << bit_n)) != 0;

}


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

+
+    if (s->status == BLK_ZERO || s->status == BLK_BACKING_FILE) {
+
+        return 0;
+
     }

static int convert_read(ImgConvertState *s, int64_t sector_num, int nb_sectors,

                        uint8_t *buf)

{

    int n;

    int ret;

    if (s->status == BLK_ZERO || s->status == BLK_BACKING_FILE) {

        return 0;

    }

    assert(nb_sectors <= s->buf_sectors);

    while (nb_sectors > 0) {

        BlockBackend *blk;

        int64_t bs_sectors;

        /* In the case of compression with multiple source files, we can get a

         * nb_sectors that spreads into the next part. So we must be able to

         * read across multiple BDSes for one convert_read() call. */

        convert_select_part(s, sector_num);

        blk = s->src[s->src_cur];

        bs_sectors = s->src_sectors[s->src_cur];

        n = MIN(nb_sectors, bs_sectors - (sector_num - s->src_cur_offset));

        ret = blk_read(blk, sector_num - s->src_cur_offset, buf, n);

        if (ret < 0) {

            return ret;

        }

        sector_num += n;

        nb_sectors -= n;

        buf += n * BDRV_SECTOR_SIZE;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int calc_add_mv(RV34DecContext *r, int dir, int val)

+{

     int mul = dir ? -r->mv_weight2 : r->mv_weight1;

static int calc_add_mv(RV34DecContext *r, int dir, int val)

{

    int mul = dir ? -r->mv_weight2 : r->mv_weight1;

    return (val * mul + 0x2000) >> 14;

}


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

     if (block_job_is_cancelled(&job->common)) {
+
         return true;

     }

static bool coroutine_fn yield_and_check(BackupBlockJob *job)

{

    if (block_job_is_cancelled(&job->common)) {

        return true;

    }

    /* we need to yield so that bdrv_drain_all() returns.

     * (without, VM does not reboot)

     */

    if (job->common.speed) {

        uint64_t delay_ns = ratelimit_calculate_delay(&job->limit,

                                                      job->sectors_read);

        job->sectors_read = 0;

        block_job_sleep_ns(&job->common, QEMU_CLOCK_REALTIME, delay_ns);

    } else {

        block_job_sleep_ns(&job->common, QEMU_CLOCK_REALTIME, 0);

    }

    if (block_job_is_cancelled(&job->common)) {

        return true;

    }

    return false;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void put_pixels_clamped4_c(const DCTELEM *block, uint8_t *restrict pixels,

+                                 int line_size)

+{
+
+    int i;
+
     uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

static void put_pixels_clamped4_c(const DCTELEM *block, uint8_t *restrict pixels,

                                 int line_size)

{

    int i;

    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

    /* read the pixels */

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

        pixels[0] = cm[block[0]];

        pixels[1] = cm[block[1]];

        pixels[2] = cm[block[2]];

        pixels[3] = cm[block[3]];

        pixels += line_size;

        block += 8;

    }

}


--- a/source.c
+++ b/source.c
@@ -61,11 +61,11 @@
             dca_smpl_bitalloc[i+1].offset = bitalloc_offsets[i];

             dca_smpl_bitalloc[i+1].wrap = 1 + (j > 4);
+
+            init_vlc(&dca_smpl_bitalloc[i+1].vlc[j], bitalloc_maxbits[i][j],
+
+                     bitalloc_sizes[i],
+
                      bitalloc_bits[i][j], 1, 1,

                      bitalloc_codes[i][j], 2, 2, 1);

static void dca_init_vlcs(void)

{

    static int vlcs_inited = 0;

    int i, j;

    if (vlcs_inited)

        return;

    dca_bitalloc_index.offset = 1;

    dca_bitalloc_index.wrap = 2;

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

        init_vlc(&dca_bitalloc_index.vlc[i], bitalloc_12_vlc_bits[i], 12,

                 bitalloc_12_bits[i], 1, 1,

                 bitalloc_12_codes[i], 2, 2, 1);

    dca_scalefactor.offset = -64;

    dca_scalefactor.wrap = 2;

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

        init_vlc(&dca_scalefactor.vlc[i], SCALES_VLC_BITS, 129,

                 scales_bits[i], 1, 1,

                 scales_codes[i], 2, 2, 1);

    dca_tmode.offset = 0;

    dca_tmode.wrap = 1;

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

        init_vlc(&dca_tmode.vlc[i], tmode_vlc_bits[i], 4,

                 tmode_bits[i], 1, 1,

                 tmode_codes[i], 2, 2, 1);

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

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

            if(!bitalloc_codes[i][j]) break;

            dca_smpl_bitalloc[i+1].offset = bitalloc_offsets[i];

            dca_smpl_bitalloc[i+1].wrap = 1 + (j > 4);

            init_vlc(&dca_smpl_bitalloc[i+1].vlc[j], bitalloc_maxbits[i][j],

                     bitalloc_sizes[i],

                     bitalloc_bits[i][j], 1, 1,

                     bitalloc_codes[i][j], 2, 2, 1);

        }

    vlcs_inited = 1;

}


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

+{

     tcg_gen_andi_i32(cpu_SR[sr], v, (1 << dc->config->nareg / 4) - 1);

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

{

    tcg_gen_andi_i32(cpu_SR[sr], v, (1 << dc->config->nareg / 4) - 1);

    reset_used_window(dc);

}


--- a/source.c
+++ b/source.c
@@ -41,11 +41,11 @@
     if (new_size < 0) {

         error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
+
+                  "is smaller than page size");
+
+        return;
+
     }

void qmp_migrate_set_cache_size(int64_t value, Error **errp)

{

    MigrationState *s = migrate_get_current();

    int64_t new_size;

    /* Check for truncation */

    if (value != (size_t)value) {

        error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",

                  "exceeding address space");

        return;

    }

    /* Cache should not be larger than guest ram size */

    if (value > ram_bytes_total()) {

        error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",

                  "exceeds guest ram size ");

        return;

    }

    new_size = xbzrle_cache_resize(value);

    if (new_size < 0) {

        error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",

                  "is smaller than page size");

        return;

    }

    s->xbzrle_cache_size = new_size;

}


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

         QLIST_FOREACH_RCU(el, &Q_list_head, entry) {

+            j = atomic_read(&el->val);
+
+            (void)j;
+
+            n_reads_local++;

             if (goflag == GOFLAG_STOP) {

static void *rcu_q_reader(void *arg)

{

    long long j, n_reads_local = 0;

    struct list_element *el;

    *(struct rcu_reader_data **)arg = &rcu_reader;

    atomic_inc(&nthreadsrunning);

    while (goflag == GOFLAG_INIT) {

        g_usleep(1000);

    }

    while (goflag == GOFLAG_RUN) {

        rcu_read_lock();

        QLIST_FOREACH_RCU(el, &Q_list_head, entry) {

            j = atomic_read(&el->val);

            (void)j;

            n_reads_local++;

            if (goflag == GOFLAG_STOP) {

                break;

            }

        }

        rcu_read_unlock();

        g_usleep(100);

    }

    atomic_add(&n_reads, n_reads_local);

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static bool blit_is_unsafe(struct CirrusVGAState *s)
 {
     /* should be the case, see cirrus_bitblt_start */
+    assert(s->cirrus_blt_width > 0);
+    assert(s->cirrus_blt_height > 0);
     if (blit_region_is_unsafe(s, s->cirrus_blt_dstpitch,
                               s->cirrus_blt_dstaddr & s->cirrus_addr_mask)) {
     if (blit_region_is_unsafe(s, s->cirrus_blt_srcpitch,

static bool blit_is_unsafe(struct CirrusVGAState *s)
{
    /* should be the case, see cirrus_bitblt_start */
    assert(s->cirrus_blt_width > 0);
    assert(s->cirrus_blt_height > 0);
    if (blit_region_is_unsafe(s, s->cirrus_blt_dstpitch,
                              s->cirrus_blt_dstaddr & s->cirrus_addr_mask)) {
    if (blit_region_is_unsafe(s, s->cirrus_blt_srcpitch,
                              s->cirrus_blt_srcaddr & s->cirrus_addr_mask)) {
    return false;


static void bdrv_co_complete(BlockAIOCBCoroutine *acb)

{

    if (!acb->need_bh) {

        acb->common.cb(acb->common.opaque, acb->req.error);

        qemu_aio_unref(acb);

    }

}


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

     } else {
+
+        pagesize = getpagesize();
+
+    }
+

     return pagesize >= max_cpu_page_size;

bool kvmppc_is_mem_backend_page_size_ok(const char *obj_path)

{

    Object *mem_obj = object_resolve_path(obj_path, NULL);

    char *mempath = object_property_get_str(mem_obj, "mem-path", NULL);

    long pagesize;

    if (mempath) {

        pagesize = qemu_mempath_getpagesize(mempath);

    } else {

        pagesize = getpagesize();

    }

    return pagesize >= max_cpu_page_size;

}


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

         ebml_master cuepoint, track_positions;

+        mkv_cuepoint *entry = &cues->entries[i];
+
         uint64_t pts = entry->pts;

static int64_t mkv_write_cues(AVIOContext *pb, mkv_cues *cues, int num_tracks)

{

    ebml_master cues_element;

    int64_t currentpos;

    int i, j;

    currentpos = avio_tell(pb);

    cues_element = start_ebml_master(pb, MATROSKA_ID_CUES, 0);

    for (i = 0; i < cues->num_entries; i++) {

        ebml_master cuepoint, track_positions;

        mkv_cuepoint *entry = &cues->entries[i];

        uint64_t pts = entry->pts;

        cuepoint = start_ebml_master(pb, MATROSKA_ID_POINTENTRY, MAX_CUEPOINT_SIZE(num_tracks));

        put_ebml_uint(pb, MATROSKA_ID_CUETIME, pts);

        // put all the entries from different tracks that have the exact same

        // timestamp into the same CuePoint

        for (j = 0; j < cues->num_entries - i && entry[j].pts == pts; j++) {

            track_positions = start_ebml_master(pb, MATROSKA_ID_CUETRACKPOSITION, MAX_CUETRACKPOS_SIZE);

            put_ebml_uint(pb, MATROSKA_ID_CUETRACK          , entry[j].tracknum   );

            put_ebml_uint(pb, MATROSKA_ID_CUECLUSTERPOSITION, entry[j].cluster_pos);

            end_ebml_master(pb, track_positions);

        }

        i += j - 1;

        end_ebml_master(pb, cuepoint);

    }

    end_ebml_master(pb, cues_element);

    av_free(cues->entries);

    av_free(cues);

    return currentpos;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int v9fs_synth_statfs(FsContext *s, V9fsPath *fs_path,
+
+                             struct statfs *stbuf)
+
+{

     stbuf->f_type = 0xABCD;

static int v9fs_synth_statfs(FsContext *s, V9fsPath *fs_path,

                             struct statfs *stbuf)

{

    stbuf->f_type = 0xABCD;

    stbuf->f_bsize = 512;

    stbuf->f_blocks = 0;

    stbuf->f_files = v9fs_synth_node_count;

    stbuf->f_namelen = NAME_MAX;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void ide_init1(IDEBus *bus, int unit, DriveInfo *dinfo)
+
+{
+
+    static int drive_serial = 1;
+
     IDEState *s = &bus->ifs[unit];

static void ide_init1(IDEBus *bus, int unit, DriveInfo *dinfo)

{

    static int drive_serial = 1;

    IDEState *s = &bus->ifs[unit];

    s->bus = bus;

    s->unit = unit;

    s->drive_serial = drive_serial++;

    s->io_buffer = qemu_blockalign(s->bs, IDE_DMA_BUF_SECTORS*512 + 4);

    s->io_buffer_total_len = IDE_DMA_BUF_SECTORS*512 + 4;

    s->smart_selftest_data = qemu_blockalign(s->bs, 512);

    s->sector_write_timer = qemu_new_timer(vm_clock,

                                           ide_sector_write_timer_cb, s);

    ide_init_drive(s, dinfo, NULL);

}


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

     ssize_t i;

+    off_t curr = 0;
+
+
+
+    if (pos > qsb->used) {

         return -1;

static ssize_t qsb_get_iovec(const QEMUSizedBuffer *qsb,

                             off_t pos, off_t *d_off)

{

    ssize_t i;

    off_t curr = 0;

    if (pos > qsb->used) {

        return -1;

    }

    for (i = 0; i < qsb->n_iov; i++) {

        if (curr + qsb->iov[i].iov_len > pos) {

            *d_off = pos - curr;

            return i;

        }

        curr += qsb->iov[i].iov_len;

    }

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void pred4x4_horizontal_vp8_c(uint8_t *src, const uint8_t *topright, int stride){
+
     const int lt= src[-1-1*stride];

     LOAD_LEFT_EDGE


--- a/source.c
+++ b/source.c
@@ -7,9 +7,9 @@
                          s->read_poll && s->enabled ? tap_can_send : NULL,

                          s->read_poll && s->enabled ? tap_send     : NULL,
+
+                         s->write_poll && s->enabled ? tap_writable : NULL,
+
                          s);

 }

static void tap_update_fd_handler(TAPState *s)

{

    qemu_set_fd_handler2(s->fd,

                         s->read_poll && s->enabled ? tap_can_send : NULL,

                         s->read_poll && s->enabled ? tap_send     : NULL,

                         s->write_poll && s->enabled ? tap_writable : NULL,

                         s);

}


--- a/source.c
+++ b/source.c
@@ -20,11 +20,11 @@
         CoroutineIOCompletion co = {
             .coroutine = qemu_coroutine_self(),
         };
+        acb = bs->drv->bdrv_aio_readv(bs, sector_num, qiov, nb_sectors,
+                                      bdrv_co_io_em_complete, &co);
+        if (acb == NULL) {
+            return -EIO;
+        } else {
             qemu_coroutine_yield();
             return co.ret;
         }

static int coroutine_fn bdrv_driver_preadv(BlockDriverState *bs,
                                           uint64_t offset, uint64_t bytes,
                                           QEMUIOVector *qiov, int flags)
{
    BlockDriver *drv = bs->drv;
    int64_t sector_num;
    unsigned int nb_sectors;
    if (drv->bdrv_co_preadv) {
        return drv->bdrv_co_preadv(bs, offset, bytes, qiov, flags);
    }
    sector_num = offset >> BDRV_SECTOR_BITS;
    nb_sectors = bytes >> BDRV_SECTOR_BITS;
    assert((offset & (BDRV_SECTOR_SIZE - 1)) == 0);
    assert((bytes & (BDRV_SECTOR_SIZE - 1)) == 0);
    assert((bytes >> BDRV_SECTOR_BITS) <= BDRV_REQUEST_MAX_SECTORS);
    if (drv->bdrv_co_readv) {
        return drv->bdrv_co_readv(bs, sector_num, nb_sectors, qiov);
    } else {
        BlockAIOCB *acb;
        CoroutineIOCompletion co = {
            .coroutine = qemu_coroutine_self(),
        };
        acb = bs->drv->bdrv_aio_readv(bs, sector_num, qiov, nb_sectors,
                                      bdrv_co_io_em_complete, &co);
        if (acb == NULL) {
            return -EIO;
        } else {
            qemu_coroutine_yield();
            return co.ret;
        }
    }
}


--- a/source.c
+++ b/source.c
@@ -15,9 +15,9 @@
         ost->is_past_recording_time = 1;

         return 0;
+
+    }
+
+    return 1;
+
 }

static int check_recording_time(OutputStream *ost)

{

    OutputFile *of = output_files[ost->file_index];

    if (of->recording_time != INT64_MAX &&

        av_compare_ts(ost->sync_opts - ost->first_pts, ost->st->codec->time_base, of->recording_time,

                      AV_TIME_BASE_Q) >= 0) {

        ost->is_past_recording_time = 1;

        return 0;

    }

    return 1;

}


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

+
+    /* Invalid header to force parsing of the first header */
+
+    s->last_header = -1;
+
     /* reserve space for 8 channels, 3 bytes/sample, 4 samples/block */

     if (!(s->extra_samples = av_malloc(8 * 3 * 4)))

static av_cold int pcm_dvd_decode_init(AVCodecContext *avctx)

{

    PCMDVDContext *s = avctx->priv_data;

    /* Invalid header to force parsing of the first header */

    s->last_header = -1;

    /* reserve space for 8 channels, 3 bytes/sample, 4 samples/block */

    if (!(s->extra_samples = av_malloc(8 * 3 * 4)))

        return AVERROR(ENOMEM);

    s->extra_sample_count = 0;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     DeviceClass *dc = DEVICE_CLASS(klass);

     PnvChipClass *k = PNV_CHIP_CLASS(klass);
+
+
+
+    k->cpu_model = "POWER8E";
+
     k->chip_type = PNV_CHIP_POWER8E;

     k->chip_cfam_id = 0x221ef04980000000ull;  /* P8 Murano DD2.1 */

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    PnvChipClass *k = PNV_CHIP_CLASS(klass);

    k->cpu_model = "POWER8E";

    k->chip_type = PNV_CHIP_POWER8E;

    k->chip_cfam_id = 0x221ef04980000000ull;  /* P8 Murano DD2.1 */

    k->cores_mask = POWER8E_CORE_MASK;

    k->core_pir = pnv_chip_core_pir_p8;

    dc->desc = "PowerNV Chip POWER8E";

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
         vd->timer_interval = VNC_REFRESH_INTERVAL_BASE;

         qemu_mod_timer(vd->timer, qemu_get_clock(rt_clock) +
+
+                       vd->timer_interval);
+
+        return;
+
     }

static void vnc_refresh(void *opaque)

{

    VncDisplay *vd = opaque;

    VncState *vs, *vn;

    int has_dirty, rects = 0;

    vga_hw_update();

    if (vnc_trylock_display(vd)) {

        vd->timer_interval = VNC_REFRESH_INTERVAL_BASE;

        qemu_mod_timer(vd->timer, qemu_get_clock(rt_clock) +

                       vd->timer_interval);

        return;

    }

    has_dirty = vnc_refresh_server_surface(vd);

    vnc_unlock_display(vd);

    QTAILQ_FOREACH_SAFE(vs, &vd->clients, next, vn) {

        rects += vnc_update_client(vs, has_dirty);

        /* vs might be free()ed here */

    }

    /* vd->timer could be NULL now if the last client disconnected,

     * in this case don't update the timer */

    if (vd->timer == NULL)

        return;

    if (has_dirty && rects) {

        vd->timer_interval /= 2;

        if (vd->timer_interval < VNC_REFRESH_INTERVAL_BASE)

            vd->timer_interval = VNC_REFRESH_INTERVAL_BASE;

    } else {

        vd->timer_interval += VNC_REFRESH_INTERVAL_INC;

        if (vd->timer_interval > VNC_REFRESH_INTERVAL_MAX)

            vd->timer_interval = VNC_REFRESH_INTERVAL_MAX;

    }

    qemu_mod_timer(vd->timer, qemu_get_clock(rt_clock) + vd->timer_interval);

}


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

     switch (addr) {

+    case 0:
+
+        return s->pcsr;
+
+    case 2:

         return s->pmr;

static uint64_t m5208_timer_read(void *opaque, target_phys_addr_t addr,

                                 unsigned size)

{

    m5208_timer_state *s = (m5208_timer_state *)opaque;

    switch (addr) {

    case 0:

        return s->pcsr;

    case 2:

        return s->pmr;

    case 4:

        return ptimer_get_count(s->timer);

    default:

        hw_error("m5208_timer_read: Bad offset 0x%x\n", (int)addr);

        return 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -29,11 +29,11 @@
     ret = opt->value.uint;

     if (del) {
+
+        qemu_opt_del_all(opts, name);
+
+    }
+
     return ret;

 }

static uint64_t qemu_opt_get_size_helper(QemuOpts *opts, const char *name,

                                         uint64_t defval, bool del)

{

    QemuOpt *opt = qemu_opt_find(opts, name);

    uint64_t ret = defval;

    if (opt == NULL) {

        const QemuOptDesc *desc = find_desc_by_name(opts->list->desc, name);

        if (desc && desc->def_value_str) {

            parse_option_size(name, desc->def_value_str, &ret, &error_abort);

        }

        return ret;

    }

    assert(opt->desc && opt->desc->type == QEMU_OPT_SIZE);

    ret = opt->value.uint;

    if (del) {

        qemu_opt_del_all(opts, name);

    }

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 START_TEST(unterminated_escape)

 {
+
+    QObject *obj = qobject_from_json("\"abc\\\"");

     fail_unless(obj == NULL);

START_TEST(unterminated_escape)

{

    QObject *obj = qobject_from_json("\"abc\\\"");

    fail_unless(obj == NULL);

}


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

 {

+    PCIDevice *d = PCI_DEVICE(dev);

     GenPCIERootPort *grp = GEN_PCIE_ROOT_PORT(d);

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

{

    PCIDevice *d = PCI_DEVICE(dev);

    GenPCIERootPort *grp = GEN_PCIE_ROOT_PORT(d);

    PCIERootPortClass *rpc = PCIE_ROOT_PORT_GET_CLASS(d);

    rpc->parent_realize(dev, errp);

    int rc = pci_bridge_qemu_reserve_cap_init(d, 0, grp->bus_reserve,

            grp->io_reserve, grp->mem_reserve, grp->pref32_reserve,

            grp->pref64_reserve, errp);

    if (rc < 0) {

        rpc->parent_class.exit(d);

        return;

    }

    if (!grp->io_reserve) {

        pci_word_test_and_clear_mask(d->wmask + PCI_COMMAND,

                                     PCI_COMMAND_IO);

        d->wmask[PCI_IO_BASE] = 0;

        d->wmask[PCI_IO_LIMIT] = 0;

    }

}


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

     double d;

+    char *ptr;
+
+    FdMigrationState *s;
+
+    const char *value = qdict_get_str(qdict, "value");

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

{

    double d;

    char *ptr;

    FdMigrationState *s;

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

    d = strtod(value, &ptr);

    switch (*ptr) {

    case 'G': case 'g':

        d *= 1024;

    case 'M': case 'm':

        d *= 1024;

    case 'K': case 'k':

        d *= 1024;

    default:

        break;

    }

    max_throttle = (uint32_t)d;

    s = migrate_to_fms(current_migration);

    if (s && s->file) {

        qemu_file_set_rate_limit(s->file, max_throttle);

    }

}


static int mpegts_resync(ByteIOContext *pb)

{

    int c, i;

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

        c = url_fgetc(pb);

        if (c < 0)

            return -1;

        if (c == 0x47) {

            url_fseek(pb, -1, SEEK_CUR);

            return 0;

        }

    }

    /* no sync found */

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void gen_rfe(DisasContext *s, TCGv pc, TCGv cpsr)

+{

     gen_set_cpsr(cpsr, 0xffffffff);

static void gen_rfe(DisasContext *s, TCGv pc, TCGv cpsr)

{

    gen_set_cpsr(cpsr, 0xffffffff);

    dead_tmp(cpsr);

    store_reg(s, 15, pc);

    s->is_jmp = DISAS_UPDATE;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void gen_pusha(DisasContext *s)

 {
+
     int i;

     gen_op_movl_A0_reg(R_ESP);

static void gen_pusha(DisasContext *s)

{

    int i;

    gen_op_movl_A0_reg(R_ESP);

    gen_op_addl_A0_im(-8 << s->dflag);

    if (!s->ss32)

        tcg_gen_ext16u_tl(cpu_A0, cpu_A0);

    tcg_gen_mov_tl(cpu_T[1], cpu_A0);

    if (s->addseg)

        gen_op_addl_A0_seg(s, R_SS);

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

        gen_op_mov_v_reg(MO_32, cpu_T[0], 7 - i);

        gen_op_st_v(s, s->dflag, cpu_T[0], cpu_A0);

        gen_op_addl_A0_im(1 << s->dflag);

    }

    gen_op_mov_reg_v(MO_16 + s->ss32, R_ESP, cpu_T[1]);

}


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

     return float64_abs(t0);

+}

float64 helper_fabs_DT(float64 t0)

{

    return float64_abs(t0);

}


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

     if (s->card == NULL) {

+        exit(1);
+
+    }
+
+    s->eject_cb = qemu_allocate_irq(sdhci_insert_eject_cb, s, 0);

     s->ro_cb = qemu_allocate_irq(sdhci_card_readonly_cb, s, 0);

static void sdhci_initfn(Object *obj)

{

    SDHCIState *s = SDHCI(obj);

    DriveInfo *di;

    di = drive_get_next(IF_SD);

    s->card = sd_init(di ? blk_bs(blk_by_legacy_dinfo(di)) : NULL, false);

    if (s->card == NULL) {

        exit(1);

    }

    s->eject_cb = qemu_allocate_irq(sdhci_insert_eject_cb, s, 0);

    s->ro_cb = qemu_allocate_irq(sdhci_card_readonly_cb, s, 0);

    sd_set_cb(s->card, s->ro_cb, s->eject_cb);

    s->insert_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, sdhci_raise_insertion_irq, s);

    s->transfer_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, sdhci_do_data_transfer, s);

}


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

     int i;
+
+    for (i = 0; i < num; i++)

         loc[i] = ceilf((samples[i]/norm)*INT32_MAX);

static inline void conv_to_int32(int32_t *loc, float *samples, int num, float norm)

{

    int i;

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

        loc[i] = ceilf((samples[i]/norm)*INT32_MAX);

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
         skip_bits_long(gb,24+align);

         h->stc = get_bits(gb,8);
+
+        decode_slice_header(h,gb);
+
+        return 1;
+
     }

     return 0;

static inline int check_for_slice(AVSContext *h) {

    GetBitContext *gb = &h->s.gb;

    int align;

    if(h->mbx)

        return 0;

    align = (-get_bits_count(gb)) & 7;

    /* check for stuffing byte */

    if(!align && (show_bits(gb,8) == 0x80))

        get_bits(gb,8);

    if((show_bits_long(gb,24+align) & 0xFFFFFF) == 0x000001) {

        skip_bits_long(gb,24+align);

        h->stc = get_bits(gb,8);

        decode_slice_header(h,gb);

        return 1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 target_read_memory (bfd_vma memaddr,
+
+                    bfd_byte *myaddr,
+
                     int length,

                     struct disassemble_info *info)

target_read_memory (bfd_vma memaddr,

                    bfd_byte *myaddr,

                    int length,

                    struct disassemble_info *info)

{

    int i;

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

        myaddr[i] = ldub_code(memaddr + i);

    }

    return 0;

}


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

     QIOChannelSocket *ioc = QIO_CHANNEL_SOCKET(qio_task_get_source(task));
+
+    SocketAddressLegacy *addr = opaque;
+
+    Error *err = NULL;
+

     qio_channel_socket_listen_sync(ioc, addr, &err);

static void qio_channel_socket_listen_worker(QIOTask *task,

                                             gpointer opaque)

{

    QIOChannelSocket *ioc = QIO_CHANNEL_SOCKET(qio_task_get_source(task));

    SocketAddressLegacy *addr = opaque;

    Error *err = NULL;

    qio_channel_socket_listen_sync(ioc, addr, &err);

    qio_task_set_error(task, err);

}


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

                            int gval, int gain)

+{

     int16_t *block;

void ff_subblock_synthesis(RA144Context *ractx, const int16_t *lpc_coefs,

                           int cba_idx, int cb1_idx, int cb2_idx,

                           int gval, int gain)

{

    int16_t *block;

    int m[3];

    if (cba_idx) {

        cba_idx += BLOCKSIZE/2 - 1;

        ff_copy_and_dup(ractx->buffer_a, ractx->adapt_cb, cba_idx);

        m[0] = (ff_irms(&ractx->adsp, ractx->buffer_a) * gval) >> 12;

    } else {

        m[0] = 0;

    }

    m[1] = (ff_cb1_base[cb1_idx] * gval) >> 8;

    m[2] = (ff_cb2_base[cb2_idx] * gval) >> 8;

    memmove(ractx->adapt_cb, ractx->adapt_cb + BLOCKSIZE,

            (BUFFERSIZE - BLOCKSIZE) * sizeof(*ractx->adapt_cb));

    block = ractx->adapt_cb + BUFFERSIZE - BLOCKSIZE;

    add_wav(block, gain, cba_idx, m, cba_idx? ractx->buffer_a: NULL,

            ff_cb1_vects[cb1_idx], ff_cb2_vects[cb2_idx]);

    memcpy(ractx->curr_sblock, ractx->curr_sblock + BLOCKSIZE,

           LPC_ORDER*sizeof(*ractx->curr_sblock));

    if (ff_celp_lp_synthesis_filter(ractx->curr_sblock + LPC_ORDER, lpc_coefs,

                                    block, BLOCKSIZE, LPC_ORDER, 1, 0, 0xfff))

        memset(ractx->curr_sblock, 0, (LPC_ORDER+BLOCKSIZE)*sizeof(*ractx->curr_sblock));

}


--- a/source.c
+++ b/source.c
@@ -47,11 +47,11 @@
         phys_val = le32_to_cpu(phys_val);

     }
+
+
+
+    val = (emu_val & emu_bits) | (phys_val & ~emu_bits);
+

     trace_vfio_pci_read_config(vdev->vbasedev.name, addr, len, val);

uint32_t vfio_pci_read_config(PCIDevice *pdev, uint32_t addr, int len)

{

    VFIOPCIDevice *vdev = DO_UPCAST(VFIOPCIDevice, pdev, pdev);

    uint32_t emu_bits = 0, emu_val = 0, phys_val = 0, val;

    memcpy(&emu_bits, vdev->emulated_config_bits + addr, len);

    emu_bits = le32_to_cpu(emu_bits);

    if (emu_bits) {

        emu_val = pci_default_read_config(pdev, addr, len);

    }

    if (~emu_bits & (0xffffffffU >> (32 - len * 8))) {

        ssize_t ret;

        ret = pread(vdev->vbasedev.fd, &phys_val, len,

                    vdev->config_offset + addr);

        if (ret != len) {

            error_report("%s(%04x:%02x:%02x.%x, 0x%x, 0x%x) failed: %m",

                         __func__, vdev->host.domain, vdev->host.bus,

                         vdev->host.slot, vdev->host.function, addr, len);

            return -errno;

        }

        phys_val = le32_to_cpu(phys_val);

    }

    val = (emu_val & emu_bits) | (phys_val & ~emu_bits);

    trace_vfio_pci_read_config(vdev->vbasedev.name, addr, len, val);

    return val;

}


--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
             !kvm_physical_memory_addr_from_ram(first_cpu->kvm_state, ram_addr, &paddr)) {

             fprintf(stderr, "Hardware memory error for memory used by "
+
+                    "QEMU itself instead of guest system!: %p\n", addr);
+
+            return 0;
+
         }

         status = MCI_STATUS_VAL | MCI_STATUS_UC | MCI_STATUS_EN

int kvm_on_sigbus(int code, void *addr)

{

#if defined(KVM_CAP_MCE)

    if ((first_cpu->mcg_cap & MCG_SER_P) && addr && code == BUS_MCEERR_AO) {

        uint64_t status;

        void *vaddr;

        ram_addr_t ram_addr;

        target_phys_addr_t paddr;

        /* Hope we are lucky for AO MCE */

        vaddr = addr;

        if (qemu_ram_addr_from_host(vaddr, &ram_addr) ||

            !kvm_physical_memory_addr_from_ram(first_cpu->kvm_state, ram_addr, &paddr)) {

            fprintf(stderr, "Hardware memory error for memory used by "

                    "QEMU itself instead of guest system!: %p\n", addr);

            return 0;

        }

        status = MCI_STATUS_VAL | MCI_STATUS_UC | MCI_STATUS_EN

            | MCI_STATUS_MISCV | MCI_STATUS_ADDRV | MCI_STATUS_S

            | 0xc0;

        kvm_inject_x86_mce(first_cpu, 9, status,

                           MCG_STATUS_MCIP | MCG_STATUS_RIPV, paddr,

                           (MCM_ADDR_PHYS << 6) | 0xc, ABORT_ON_ERROR);

        kvm_mce_broadcast_rest(first_cpu);

    } else

#endif

    {

        if (code == BUS_MCEERR_AO) {

            return 0;

        } else if (code == BUS_MCEERR_AR) {

            hardware_memory_error();

        } else {

            return 1;

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
 void ff_add_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels,

+                             int line_size)

+{
+
+    int i;
+
+    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+
+
+
     /* read the pixels */

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

void ff_add_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels,

                             int line_size)

{

    int i;

    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

    /* read the pixels */

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

        pixels[0] = cm[pixels[0] + block[0]];

        pixels[1] = cm[pixels[1] + block[1]];

        pixels[2] = cm[pixels[2] + block[2]];

        pixels[3] = cm[pixels[3] + block[3]];

        pixels[4] = cm[pixels[4] + block[4]];

        pixels[5] = cm[pixels[5] + block[5]];

        pixels[6] = cm[pixels[6] + block[6]];

        pixels[7] = cm[pixels[7] + block[7]];

        pixels += line_size;

        block += 8;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void rv34_idct_dc_add_c(uint8_t *dst, ptrdiff_t stride, int dc)
+
 {
+
     const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

     int i, j;
+

     cm += (13*13*dc + 0x200) >> 10;

static void rv34_idct_dc_add_c(uint8_t *dst, ptrdiff_t stride, int dc)

{

    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

    int i, j;

    cm += (13*13*dc + 0x200) >> 10;

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

    {

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

            dst[j] = cm[ dst[j] ];

        dst += stride;

    }

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
 {
     char buf[256];
     int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
+    AVStream *st = ic->streams[i];
+    int g = av_gcd(st->time_base.num, st->time_base.den);
+    AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
+    avcodec_string(buf, sizeof(buf), st->codec, is_output);
+    av_log(NULL, AV_LOG_INFO, "    Stream #%d:%d", index, i);
     /* the pid is an important information, so we display it */
     /* XXX: add a generic system */
     if (flags & AVFMT_SHOW_IDS)

static void dump_stream_format(AVFormatContext *ic, int i,
                               int index, int is_output)
{
    char buf[256];
    int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
    AVStream *st = ic->streams[i];
    int g = av_gcd(st->time_base.num, st->time_base.den);
    AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
    avcodec_string(buf, sizeof(buf), st->codec, is_output);
    av_log(NULL, AV_LOG_INFO, "    Stream #%d:%d", index, i);
    /* the pid is an important information, so we display it */
    /* XXX: add a generic system */
    if (flags & AVFMT_SHOW_IDS)
        av_log(NULL, AV_LOG_INFO, "[0x%x]", st->id);
    if (lang)
        av_log(NULL, AV_LOG_INFO, "(%s)", lang->value);
    av_log(NULL, AV_LOG_DEBUG, ", %d, %d/%d", st->codec_info_nb_frames,
           st->time_base.num / g, st->time_base.den / g);
    av_log(NULL, AV_LOG_INFO, ": %s", buf);
    if (st->sample_aspect_ratio.num && // default
        av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) {
        AVRational display_aspect_ratio;
        av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
                  st->codec->width  * st->sample_aspect_ratio.num,
                  st->codec->height * st->sample_aspect_ratio.den,
                  1024 * 1024);
        av_log(NULL, AV_LOG_INFO, ", SAR %d:%d DAR %d:%d",
               st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
               display_aspect_ratio.num, display_aspect_ratio.den);
    }
    if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
        if (st->avg_frame_rate.den && st->avg_frame_rate.num)
            print_fps(av_q2d(st->avg_frame_rate), "fps");
#if FF_API_R_FRAME_RATE
        if (st->r_frame_rate.den && st->r_frame_rate.num)
            print_fps(av_q2d(st->r_frame_rate), "tbr");
#endif
        if (st->time_base.den && st->time_base.num)
            print_fps(1 / av_q2d(st->time_base), "tbn");
        if (st->codec->time_base.den && st->codec->time_base.num)
            print_fps(1 / av_q2d(st->codec->time_base), "tbc");
    }
    if (st->disposition & AV_DISPOSITION_DEFAULT)
        av_log(NULL, AV_LOG_INFO, " (default)");
    if (st->disposition & AV_DISPOSITION_DUB)
        av_log(NULL, AV_LOG_INFO, " (dub)");
    if (st->disposition & AV_DISPOSITION_ORIGINAL)
        av_log(NULL, AV_LOG_INFO, " (original)");
    if (st->disposition & AV_DISPOSITION_COMMENT)
        av_log(NULL, AV_LOG_INFO, " (comment)");
    if (st->disposition & AV_DISPOSITION_LYRICS)
        av_log(NULL, AV_LOG_INFO, " (lyrics)");
    if (st->disposition & AV_DISPOSITION_KARAOKE)
        av_log(NULL, AV_LOG_INFO, " (karaoke)");
    if (st->disposition & AV_DISPOSITION_FORCED)
        av_log(NULL, AV_LOG_INFO, " (forced)");
    if (st->disposition & AV_DISPOSITION_HEARING_IMPAIRED)
        av_log(NULL, AV_LOG_INFO, " (hearing impaired)");
    if (st->disposition & AV_DISPOSITION_VISUAL_IMPAIRED)
        av_log(NULL, AV_LOG_INFO, " (visual impaired)");
    if (st->disposition & AV_DISPOSITION_CLEAN_EFFECTS)
        av_log(NULL, AV_LOG_INFO, " (clean effects)");
    av_log(NULL, AV_LOG_INFO, "\n");
    dump_metadata(NULL, st->metadata, "    ");
    dump_sidedata(NULL, st, "    ");
}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 vmxnet3_init_msix(VMXNET3State *s)

+{

     PCIDevice *d = PCI_DEVICE(s);

vmxnet3_init_msix(VMXNET3State *s)

{

    PCIDevice *d = PCI_DEVICE(s);

    int res = msix_init(d, VMXNET3_MAX_INTRS,

                        &s->msix_bar,

                        VMXNET3_MSIX_BAR_IDX, VMXNET3_OFF_MSIX_TABLE,

                        &s->msix_bar,

                        VMXNET3_MSIX_BAR_IDX, VMXNET3_OFF_MSIX_PBA(s),

                        VMXNET3_MSIX_OFFSET(s));

    if (0 > res) {

        VMW_WRPRN("Failed to initialize MSI-X, error %d", res);

        s->msix_used = false;

    } else {

        if (!vmxnet3_use_msix_vectors(s, VMXNET3_MAX_INTRS)) {

            VMW_WRPRN("Failed to use MSI-X vectors, error %d", res);

            msix_uninit(d, &s->msix_bar, &s->msix_bar);

            s->msix_used = false;

        } else {

            s->msix_used = true;

        }

    }

    return s->msix_used;

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
+static int append_extradata(APNGDemuxContext *ctx, AVIOContext *pb, int len)
+
 {

     int previous_size = ctx->extra_data_size;

+    int new_size, ret;

+    uint8_t *new_extradata;
+
+

     if (previous_size > INT_MAX - len)

static int append_extradata(APNGDemuxContext *ctx, AVIOContext *pb, int len)

{

    int previous_size = ctx->extra_data_size;

    int new_size, ret;

    uint8_t *new_extradata;

    if (previous_size > INT_MAX - len)

        return AVERROR_INVALIDDATA;

    new_size = previous_size + len;

    new_extradata = av_realloc(ctx->extra_data, new_size + AV_INPUT_BUFFER_PADDING_SIZE);

    if (!new_extradata)

        return AVERROR(ENOMEM);

    ctx->extra_data = new_extradata;

    ctx->extra_data_size = new_size;

    if ((ret = avio_read(pb, ctx->extra_data + previous_size, len)) < 0)

        return ret;

    return previous_size;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void bonito_pciconf_writel(void *opaque, target_phys_addr_t addr,

+                                  uint32_t val)
+
+{

     PCIBonitoState *s = opaque;

static void bonito_pciconf_writel(void *opaque, target_phys_addr_t addr,

                                  uint32_t val)

{

    PCIBonitoState *s = opaque;

    DPRINTF("bonito_pciconf_writel "TARGET_FMT_plx" val %x \n", addr, val);

    s->dev.config_write(&s->dev, addr, val, 4);

}


--- a/source.c
+++ b/source.c
@@ -5,10 +5,10 @@
     if (!vm_running) {

         cpu_enable_ticks();
+
+        vm_running = 1;
+
+        vm_state_notify(1, 0);

         qemu_rearm_alarm_timer(alarm_timer);

void vm_start(void)

{

    if (!vm_running) {

        cpu_enable_ticks();

        vm_running = 1;

        vm_state_notify(1, 0);

        qemu_rearm_alarm_timer(alarm_timer);

        resume_all_vcpus();

    }

}


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

     avctx->pix_fmt = PIX_FMT_XVMC_MPEG2_IDCT;
+
+    avctx->xvmc_acceleration = 2;//2 - the blocks are packed!
+
+
+
     return 0;

 }

static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx){

    if( avctx->thread_count > 1)

        return -1;

    if( !(avctx->slice_flags & SLICE_FLAG_CODED_ORDER) )

        return -1;

    if( !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD) ){

        av_dlog(avctx, "mpeg12.c: XvMC decoder will work better if SLICE_FLAG_ALLOW_FIELD is set\n");

    }

    mpeg_decode_init(avctx);

    avctx->pix_fmt = PIX_FMT_XVMC_MPEG2_IDCT;

    avctx->xvmc_acceleration = 2;//2 - the blocks are packed!

    return 0;

}


int spapr_vio_send_crq(VIOsPAPRDevice *dev, uint8_t *crq)

{

    int rc;

    uint8_t byte;

    if (!dev->crq.qsize) {

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

        return -1;

    }

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

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

    if (rc) {

        return rc;

    }

    if (byte != 0) {

        return 1;

    }

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

                             &crq[8], 8);

    if (rc) {

        return rc;

    }

    kvmppc_eieio();

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

    if (rc) {

        return rc;

    }

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

    if (dev->signal_state & 1) {

        qemu_irq_pulse(dev->qirq);

    }

    return 0;

}


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

     memcpy(x+288, in,         1024*sizeof(x[0]));

+    for (i = 0; i < 32; i++) { // numTimeSlots*RATE = 16*2 as 960 sample frames
+
+                               // are not supported
+
+        dsp->vector_fmul_reverse(z, sbr_qmf_window_ds, x, 320);

         sbrdsp->sum64x5(z);

static void sbr_qmf_analysis(AVFixedDSPContext *dsp, FFTContext *mdct,

#else

static void sbr_qmf_analysis(AVFloatDSPContext *dsp, FFTContext *mdct,

#endif /* USE_FIXED */

                             SBRDSPContext *sbrdsp, const INTFLOAT *in, INTFLOAT *x,

                             INTFLOAT z[320], INTFLOAT W[2][32][32][2], int buf_idx)

{

    int i;

    int j;

    memcpy(x    , x+1024, (320-32)*sizeof(x[0]));

    memcpy(x+288, in,         1024*sizeof(x[0]));

    for (i = 0; i < 32; i++) { // numTimeSlots*RATE = 16*2 as 960 sample frames

                               // are not supported

        dsp->vector_fmul_reverse(z, sbr_qmf_window_ds, x, 320);

        sbrdsp->sum64x5(z);

        sbrdsp->qmf_pre_shuffle(z);

        mdct->imdct_half(mdct, z, z+64);

        sbrdsp->qmf_post_shuffle(W[buf_idx][i], z);

        x += 32;


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

 {

+    VirtIOSCSIReq *req, *next;

     QTAILQ_HEAD(, VirtIOSCSIReq) reqs = QTAILQ_HEAD_INITIALIZER(reqs);

void virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq)

{

    VirtIOSCSIReq *req, *next;

    QTAILQ_HEAD(, VirtIOSCSIReq) reqs = QTAILQ_HEAD_INITIALIZER(reqs);

    while ((req = virtio_scsi_pop_req(s, vq))) {

        if (virtio_scsi_handle_cmd_req_prepare(s, req)) {

            QTAILQ_INSERT_TAIL(&reqs, req, next);

        }

    }

    QTAILQ_FOREACH_SAFE(req, &reqs, next, next) {

        virtio_scsi_handle_cmd_req_submit(s, req);

    }

}


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

     uint16_t sel_mask, sel_value;

+    uint32_t status;
+
+    int cond;
+
+

     DBDMA_DPRINTF("conditional_interrupt\n");

static void conditional_interrupt(DBDMA_channel *ch)

{

    dbdma_cmd *current = &ch->current;

    uint16_t intr;

    uint16_t sel_mask, sel_value;

    uint32_t status;

    int cond;

    DBDMA_DPRINTF("conditional_interrupt\n");

    intr = le16_to_cpu(current->command) & INTR_MASK;

    switch(intr) {

    case INTR_NEVER:  /* don't interrupt */

        return;

    case INTR_ALWAYS: /* always interrupt */

        qemu_irq_raise(ch->irq);

        return;

    }

    status = be32_to_cpu(ch->regs[DBDMA_STATUS]) & DEVSTAT;

    sel_mask = (be32_to_cpu(ch->regs[DBDMA_INTR_SEL]) >> 16) & 0x0f;

    sel_value = be32_to_cpu(ch->regs[DBDMA_INTR_SEL]) & 0x0f;

    cond = (status & sel_mask) == (sel_value & sel_mask);

    switch(intr) {

    case INTR_IFSET:  /* intr if condition bit is 1 */

        if (cond)

            qemu_irq_raise(ch->irq);

        return;

    case INTR_IFCLR:  /* intr if condition bit is 0 */

        if (!cond)

            qemu_irq_raise(ch->irq);

        return;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int local_chmod(FsContext *fs_ctx, const char *path, FsCred *credp)

 {
+
     if (fs_ctx->fs_sm == SM_MAPPED) {

         return local_set_xattr(rpath(fs_ctx, path), credp);

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

{

    if (fs_ctx->fs_sm == SM_MAPPED) {

        return local_set_xattr(rpath(fs_ctx, path), credp);

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

        return chmod(rpath(fs_ctx, path), credp->fc_mode);

    }

    return -1;

}


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

     VirtIOBalloon *s = opaque;
+
+
+
+    virtio_save(&s->vdev, f);

static void virtio_balloon_save(QEMUFile *f, void *opaque)

{

    VirtIOBalloon *s = opaque;

    virtio_save(&s->vdev, f);

    qemu_put_be32(f, s->num_pages);

    qemu_put_be32(f, s->actual);

    qemu_put_buffer(f, (uint8_t *)&s->stats_vq_elem, sizeof(VirtQueueElement));

    qemu_put_buffer(f, (uint8_t *)&s->stats_vq_offset, sizeof(size_t));

    qemu_put_buffer(f, (uint8_t *)&s->stats_callback, sizeof(MonitorCompletion));

    qemu_put_buffer(f, (uint8_t *)&s->stats_opaque_callback_data, sizeof(void));

}


--- a/source.c
+++ b/source.c
@@ -9,9 +9,9 @@
     av_frame_unref(&at->new_in_frame);

     av_frame_unref(&at->in_frame);
+
+    ff_af_queue_close(&at->afq);
+
+    return 0;

 }

static av_cold int ffat_close_encoder(AVCodecContext *avctx)

{

    ATDecodeContext *at = avctx->priv_data;

    AudioConverterDispose(at->converter);

    av_frame_unref(&at->new_in_frame);

    av_frame_unref(&at->in_frame);

    ff_af_queue_close(&at->afq);

    return 0;

}


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

     MXFContext *mxf = s->priv_data;

+    AVIOContext *pb = s->pb;

     uint64_t pos = avio_tell(pb);

static void mxf_write_random_index_pack(AVFormatContext *s)

{

    MXFContext *mxf = s->priv_data;

    AVIOContext *pb = s->pb;

    uint64_t pos = avio_tell(pb);

    int i;

    avio_write(pb, random_index_pack_key, 16);

    klv_encode_ber_length(pb, 28 + 12*mxf->body_partitions_count);

    if (mxf->edit_unit_byte_count)

        avio_wb32(pb, 1); // BodySID of header partition

    else

        avio_wb32(pb, 0);

    avio_wb64(pb, 0); // offset of header partition

    for (i = 0; i < mxf->body_partitions_count; i++) {

        avio_wb32(pb, 1); // BodySID

        avio_wb64(pb, mxf->body_partition_offset[i]);

    }

    avio_wb32(pb, 0); // BodySID of footer partition

    avio_wb64(pb, mxf->footer_partition_offset);

    avio_wb32(pb, avio_tell(pb) - pos + 4);

}


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

+    if (do_sigaltstack(frame_addr + offsetof(struct target_ucontext_v2, tuc_stack), 0, get_sp_from_cpustate(env)) == -EFAULT)
+
+        return 1;
+
+

 #if 0

static int do_sigframe_return_v2(CPUARMState *env, target_ulong frame_addr,

                                 struct target_ucontext_v2 *uc)

{

    sigset_t host_set;

    abi_ulong *regspace;

    target_to_host_sigset(&host_set, &uc->tuc_sigmask);

    sigprocmask(SIG_SETMASK, &host_set, NULL);

    if (restore_sigcontext(env, &uc->tuc_mcontext))

        return 1;

    /* Restore coprocessor signal frame */

    regspace = uc->tuc_regspace;

    if (arm_feature(env, ARM_FEATURE_VFP)) {

        regspace = restore_sigframe_v2_vfp(env, regspace);

        if (!regspace) {

            return 1;

        }

    }

    if (arm_feature(env, ARM_FEATURE_IWMMXT)) {

        regspace = restore_sigframe_v2_iwmmxt(env, regspace);

        if (!regspace) {

            return 1;

        }

    }

    if (do_sigaltstack(frame_addr + offsetof(struct target_ucontext_v2, tuc_stack), 0, get_sp_from_cpustate(env)) == -EFAULT)

        return 1;

#if 0

    /* Send SIGTRAP if we're single-stepping */

    if (ptrace_cancel_bpt(current))

            send_sig(SIGTRAP, current, 1);

#endif

    return 0;

}


void ppc_slb_invalidate_all (CPUPPCState *env)

{

    /* XXX: TODO */

    tlb_flush(env, 1);

}


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

     hwaddr len = l;

+    void *dest_p;
+
+    void *src_p;
+
+    uint64_t asc = env->psw.mask & PSW_MASK_ASC;

     int flags;

static void mvc_fast_memmove(CPUS390XState *env, uint32_t l, uint64_t dest,

                             uint64_t src)

{

    S390CPU *cpu = s390_env_get_cpu(env);

    hwaddr dest_phys;

    hwaddr src_phys;

    hwaddr len = l;

    void *dest_p;

    void *src_p;

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

    int flags;

    if (mmu_translate(env, dest, 1, asc, &dest_phys, &flags, true)) {

        cpu_stb_data(env, dest, 0);

        cpu_abort(CPU(cpu), "should never reach here");

    }

    dest_phys |= dest & ~TARGET_PAGE_MASK;

    if (mmu_translate(env, src, 0, asc, &src_phys, &flags, true)) {

        cpu_ldub_data(env, src);

        cpu_abort(CPU(cpu), "should never reach here");

    }

    src_phys |= src & ~TARGET_PAGE_MASK;

    dest_p = cpu_physical_memory_map(dest_phys, &len, 1);

    src_p = cpu_physical_memory_map(src_phys, &len, 0);

    memmove(dest_p, src_p, len);

    cpu_physical_memory_unmap(dest_p, 1, len, len);

    cpu_physical_memory_unmap(src_p, 0, len, len);

}


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

     OptsVisitor *ov = to_ov(v);
+
+
+
+    assert(ov->list_mode == LM_STARTED ||
+
            ov->list_mode == LM_IN_PROGRESS ||

            ov->list_mode == LM_SIGNED_INTERVAL ||

opts_end_list(Visitor *v)

{

    OptsVisitor *ov = to_ov(v);

    assert(ov->list_mode == LM_STARTED ||

           ov->list_mode == LM_IN_PROGRESS ||

           ov->list_mode == LM_SIGNED_INTERVAL ||

           ov->list_mode == LM_UNSIGNED_INTERVAL);

    ov->repeated_opts = NULL;

    ov->list_mode = LM_NONE;

}


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

+
+    if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) {
+
+        program_interrupt(&cpu->env, PGM_OPERAND, 2);
+
         return;

     }

void ioinst_handle_rsch(S390CPU *cpu, uint64_t reg1)

{

    int cssid, ssid, schid, m;

    SubchDev *sch;

    int ret = -ENODEV;

    int cc;

    if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) {

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

        return;

    }

    trace_ioinst_sch_id("rsch", cssid, ssid, schid);

    sch = css_find_subch(m, cssid, ssid, schid);

    if (sch && css_subch_visible(sch)) {

        ret = css_do_rsch(sch);

    }

    switch (ret) {

    case -ENODEV:

        cc = 3;

        break;

    case -EINVAL:

        cc = 2;

        break;

    case 0:

        cc = 0;

        break;

    default:

        cc = 1;

        break;

    }

    setcc(cpu, cc);

}


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

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

static void filter_mb_mbaff_edgecv( H264Context *h, uint8_t *pix, int stride, const int16_t bS[7], int bsi, int qp ) {

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

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

    int alpha = alpha_table[index_a];

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

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

    if( bS[0] < 4 ) {

        int8_t tc[4];

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

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

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

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

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

    } else {

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

    }

}


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

     int x, y, plane;
+
     int score = 0;

     int64_t score64 = 0;

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

         const int stride = p->f.linesize[plane];

static int skip_check(MpegEncContext *s, Picture *p, Picture *ref)

{

    int x, y, plane;

    int score = 0;

    int64_t score64 = 0;

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

        const int stride = p->f.linesize[plane];

        const int bw = plane ? 1 : 2;

        for (y = 0; y < s->mb_height * bw; y++) {

            for (x = 0; x < s->mb_width * bw; x++) {

                int off = p->shared ? 0 : 16;

                uint8_t *dptr = p->f.data[plane] + 8 * (x + y * stride) + off;

                uint8_t *rptr = ref->f.data[plane] + 8 * (x + y * stride);

                int v   = s->dsp.frame_skip_cmp[1](s, dptr, rptr, stride, 8);

                switch (s->avctx->frame_skip_exp) {

                case 0: score    =  FFMAX(score, v);          break;

                case 1: score   += FFABS(v);                  break;

                case 2: score   += v * v;                     break;

                case 3: score64 += FFABS(v * v * (int64_t)v); break;

                case 4: score64 += v * v * (int64_t)(v * v);  break;

                }

            }

        }

    }

    if (score)

        score64 = score;

    if (score64 < s->avctx->frame_skip_threshold)

        return 1;

    if (score64 < ((s->avctx->frame_skip_factor * (int64_t)s->lambda) >> 8))

        return 1;

    return 0;

}


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

     return close(fs->fd);
+
 }

static int proxy_close(FsContext *ctx, V9fsFidOpenState *fs)

{

    return close(fs->fd);

}


void do_subfmeo (void)

{

    T1 = T0;

    T0 = ~T0 + xer_ca - 1;

    if (likely(!((uint32_t)~T1 & ((uint32_t)~T1 ^ (uint32_t)T0) &

                 (1UL << 31)))) {

        xer_ov = 0;

    } else {

        xer_so = 1;

        xer_ov = 1;

    }

    if (likely((uint32_t)T1 != UINT32_MAX))

        xer_ca = 1;

}


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

                        uint32_t io_int_word)

+{
+
+    if (kvm_enabled()) {
+
+        kvm_s390_io_interrupt(cpu, subchannel_id, subchannel_nr, io_int_parm,

                               io_int_word);

void s390_io_interrupt(S390CPU *cpu, uint16_t subchannel_id,

                       uint16_t subchannel_nr, uint32_t io_int_parm,

                       uint32_t io_int_word)

{

    if (kvm_enabled()) {

        kvm_s390_io_interrupt(cpu, subchannel_id, subchannel_nr, io_int_parm,

                              io_int_word);

    } else {

        cpu_inject_io(cpu, subchannel_id, subchannel_nr, io_int_parm,

                      io_int_word);

    }

}


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

         i++;

+        if (i == index) {
+
+            TAILQ_INSERT_BEFORE(tmp, entry, next);
+
+            acl->nentries++;

             break;

int qemu_acl_insert(qemu_acl *acl,

                    int deny,

                    const char *match,

                    int index)

{

    qemu_acl_entry *entry;

    qemu_acl_entry *tmp;

    int i = 0;

    if (index <= 0)

        return -1;

    if (index >= acl->nentries)

        return qemu_acl_append(acl, deny, match);

    entry = qemu_malloc(sizeof(*entry));

    entry->match = qemu_strdup(match);

    entry->deny = deny;

    TAILQ_FOREACH(tmp, &acl->entries, next) {

        i++;

        if (i == index) {

            TAILQ_INSERT_BEFORE(tmp, entry, next);

            acl->nentries++;

            break;

        }

    }

    return i;

}


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

+{

     tcg_gen_mov_i32(cpu_F0s, tmp);

static void gen_vfp_msr(TCGv tmp)

{

    tcg_gen_mov_i32(cpu_F0s, tmp);

    dead_tmp(tmp);

}


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

     src |= a2 & ~TARGET_PAGE_MASK;

+
+
+    /* XXX replace w/ memcpy */
+
+    for (i = 0; i < l; i++) {

         /* XXX be more clever */

static uint32_t mvc_asc(CPUS390XState *env, int64_t l, uint64_t a1,

                        uint64_t mode1, uint64_t a2, uint64_t mode2)

{

    CPUState *cs = CPU(s390_env_get_cpu(env));

    target_ulong src, dest;

    int flags, cc = 0, i;

    if (!l) {

        return 0;

    } else if (l > 256) {

        /* max 256 */

        l = 256;

        cc = 3;

    }

    if (mmu_translate(env, a1, 1, mode1, &dest, &flags, true)) {

        cpu_loop_exit(CPU(s390_env_get_cpu(env)));

    }

    dest |= a1 & ~TARGET_PAGE_MASK;

    if (mmu_translate(env, a2, 0, mode2, &src, &flags, true)) {

        cpu_loop_exit(CPU(s390_env_get_cpu(env)));

    }

    src |= a2 & ~TARGET_PAGE_MASK;

    /* XXX replace w/ memcpy */

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

        /* XXX be more clever */

        if ((((dest + i) & TARGET_PAGE_MASK) != (dest & TARGET_PAGE_MASK)) ||

            (((src + i) & TARGET_PAGE_MASK) != (src & TARGET_PAGE_MASK))) {

            mvc_asc(env, l - i, a1 + i, mode1, a2 + i, mode2);

            break;

        }

        stb_phys(cs->as, dest + i, ldub_phys(cs->as, src + i));

    }

    return cc;

}


void bt_device_done(struct bt_device_s *dev)

{

    struct bt_device_s **p = &dev->net->slave;

    while (*p && *p != dev)

        p = &(*p)->next;

    if (*p != dev) {

        fprintf(stderr, "%s: bad bt device \"%s\"\n", __FUNCTION__,

                        dev->lmp_name ?: "(null)");

        exit(-1);

    }

    *p = dev->next;

}


--- a/source.c
+++ b/source.c
@@ -62,11 +62,11 @@
     cpu->id_isar4 = 0x10011142;

     cpu->clidr = 0x0a200023;
+
+    cpu->ccsidr[0] = 0x701fe00a; /* 32K L1 dcache */
+
+    cpu->ccsidr[1] = 0x201fe00a; /* 32K L1 icache */
+
     cpu->ccsidr[2] = 0x711fe07a; /* 4096K L2 unified cache */

     define_arm_cp_regs(cpu, cortexa15_cp_reginfo);

static void cortex_a15_initfn(Object *obj)

{

    ARMCPU *cpu = ARM_CPU(obj);

    set_feature(&cpu->env, ARM_FEATURE_V7);

    set_feature(&cpu->env, ARM_FEATURE_VFP4);

    set_feature(&cpu->env, ARM_FEATURE_VFP_FP16);

    set_feature(&cpu->env, ARM_FEATURE_NEON);

    set_feature(&cpu->env, ARM_FEATURE_THUMB2EE);

    set_feature(&cpu->env, ARM_FEATURE_ARM_DIV);

    set_feature(&cpu->env, ARM_FEATURE_V7MP);

    set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER);

    set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS);

    cpu->midr = 0x412fc0f1;

    cpu->reset_fpsid = 0x410430f0;

    cpu->mvfr0 = 0x10110222;

    cpu->mvfr1 = 0x11111111;

    cpu->ctr = 0x8444c004;

    cpu->reset_sctlr = 0x00c50078;

    cpu->id_pfr0 = 0x00001131;

    cpu->id_pfr1 = 0x00011011;

    cpu->id_dfr0 = 0x02010555;

    cpu->id_afr0 = 0x00000000;

    cpu->id_mmfr0 = 0x10201105;

    cpu->id_mmfr1 = 0x20000000;

    cpu->id_mmfr2 = 0x01240000;

    cpu->id_mmfr3 = 0x02102211;

    cpu->id_isar0 = 0x02101110;

    cpu->id_isar1 = 0x13112111;

    cpu->id_isar2 = 0x21232041;

    cpu->id_isar3 = 0x11112131;

    cpu->id_isar4 = 0x10011142;

    cpu->clidr = 0x0a200023;

    cpu->ccsidr[0] = 0x701fe00a; /* 32K L1 dcache */

    cpu->ccsidr[1] = 0x201fe00a; /* 32K L1 icache */

    cpu->ccsidr[2] = 0x711fe07a; /* 4096K L2 unified cache */

    define_arm_cp_regs(cpu, cortexa15_cp_reginfo);

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     TAILQ_FOREACH(d, &xs_cleanup, list) {

 	xs_rm(xenstore, 0, d->xs_dir);
+
+    }
+
 }

void xen_config_cleanup(void)

{

    struct xs_dirs *d;

    TAILQ_FOREACH(d, &xs_cleanup, list) {

	xs_rm(xenstore, 0, d->xs_dir);

    }

}


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

     AVDictionary *tmp = NULL;
+
     int ret;

static int url_connect(struct playlist *pls, AVDictionary *opts, AVDictionary *opts2)

{

    AVDictionary *tmp = NULL;

    int ret;

    av_dict_copy(&tmp, opts, 0);

    av_dict_copy(&tmp, opts2, 0);

    av_opt_set_dict(pls->input, &tmp);

    if ((ret = ffurl_connect(pls->input, NULL)) < 0) {

        ffurl_close(pls->input);

        pls->input = NULL;

    }

    av_dict_free(&tmp);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void spatial_compose53i(IDWTELEM *buffer, int width, int height, int stride){

     dwt_compose_t cs;
+
+    spatial_compose53i_init(&cs, buffer, height, stride);

     while(cs.y <= height)

static void spatial_compose53i(IDWTELEM *buffer, int width, int height, int stride){

    dwt_compose_t cs;

    spatial_compose53i_init(&cs, buffer, height, stride);

    while(cs.y <= height)

        spatial_compose53i_dy(&cs, buffer, width, height, stride);

}


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

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

static uint32_t bonito_sbridge_pciaddr(void *opaque, hwaddr addr)

{

    PCIBonitoState *s = opaque;

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

    uint32_t cfgaddr;

    uint32_t idsel;

    uint32_t devno;

    uint32_t funno;

    uint32_t regno;

    uint32_t pciaddr;

    /* support type0 pci config */

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

        return 0xffffffff;

    }

    cfgaddr = addr & 0xffff;

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

    idsel = (cfgaddr & BONITO_PCICONF_IDSEL_MASK) >> BONITO_PCICONF_IDSEL_OFFSET;

    devno = ffs(idsel) - 1;

    funno = (cfgaddr & BONITO_PCICONF_FUN_MASK) >> BONITO_PCICONF_FUN_OFFSET;

    regno = (cfgaddr & BONITO_PCICONF_REG_MASK) >> BONITO_PCICONF_REG_OFFSET;

    if (idsel == 0) {

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

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

        exit(1);

    }

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

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

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

    return pciaddr;

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
                                            ((N  >> R_shift) & 0xFF) - GN,
                                            ((W  >> R_shift) & 0xFF) - GW,
                                            ((NW >> R_shift) & 0xFF) - GNW);
+        B = G + epic_decode_component_pred(dc,
+                                           ((N  >> B_shift) & 0xFF) - GN,
+                                           ((W  >> B_shift) & 0xFF) - GW,
+                                           ((NW >> B_shift) & 0xFF) - GNW);
+    } else {
         if (x)
             pred = curr_row[x - 1];
         else

static uint32_t epic_decode_pixel_pred(ePICContext *dc, int x, int y,
                                       const uint32_t *curr_row,
                                       const uint32_t *above_row)
{
    uint32_t N, W, NW, pred;
    unsigned delta;
    int GN, GW, GNW, R, G, B;
    if (x && y) {
        W  = curr_row[x  - 1];
        N  = above_row[x];
        NW = above_row[x - 1];
        GN  = (N  >> G_shift) & 0xFF;
        GW  = (W  >> G_shift) & 0xFF;
        GNW = (NW >> G_shift) & 0xFF;
        G = epic_decode_component_pred(dc, GN, GW, GNW);
        R = G + epic_decode_component_pred(dc,
                                           ((N  >> R_shift) & 0xFF) - GN,
                                           ((W  >> R_shift) & 0xFF) - GW,
                                           ((NW >> R_shift) & 0xFF) - GNW);
        B = G + epic_decode_component_pred(dc,
                                           ((N  >> B_shift) & 0xFF) - GN,
                                           ((W  >> B_shift) & 0xFF) - GW,
                                           ((NW >> B_shift) & 0xFF) - GNW);
    } else {
        if (x)
            pred = curr_row[x - 1];
        else
            pred = above_row[x];
        delta = ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung);
        R     = ((pred >> R_shift) & 0xFF) - TOSIGNED(delta);
        delta = ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung);
        G     = ((pred >> G_shift) & 0xFF) - TOSIGNED(delta);
        delta = ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung);
        B     = ((pred >> B_shift) & 0xFF) - TOSIGNED(delta);
    return (R << R_shift) | (G << G_shift) | (B << B_shift);


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

     mxf_write_generic_desc(s, st, key, size+5+12+8+8);
+

     // audio locked

static void mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st, const UID key, unsigned size)

{

    AVIOContext *pb = s->pb;

    mxf_write_generic_desc(s, st, key, size+5+12+8+8);

    // audio locked

    mxf_write_local_tag(pb, 1, 0x3D02);

    avio_w8(pb, 1);

    // write audio sampling rate

    mxf_write_local_tag(pb, 8, 0x3D03);

    avio_wb32(pb, st->codec->sample_rate);

    avio_wb32(pb, 1);

    mxf_write_local_tag(pb, 4, 0x3D07);

    avio_wb32(pb, st->codec->channels);

    mxf_write_local_tag(pb, 4, 0x3D01);

    avio_wb32(pb, av_get_bits_per_sample(st->codec->codec_id));

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     s->avctx = avctx;

+
+    avctx->pix_fmt = PIX_FMT_PAL8;
+
+    avctx->has_b_frames = 0;
+
     s->frame.data[0] = s->prev_frame.data[0] = NULL;

static int msrle_decode_init(AVCodecContext *avctx)

{

    MsrleContext *s = (MsrleContext *)avctx->priv_data;

    int i, j;

    unsigned char *palette;

    s->avctx = avctx;

    avctx->pix_fmt = PIX_FMT_PAL8;

    avctx->has_b_frames = 0;

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

    /* convert palette */

    palette = (unsigned char *)s->avctx->extradata;

    memset (s->palette, 0, 256 * 4);

    for (i = 0, j = 0; i < s->avctx->extradata_size / 4; i++, j += 4)

        s->palette[i] =

            (palette[j + 2] << 16) |

            (palette[j + 1] <<  8) |

            (palette[j + 0] <<  0);

    return 0;

}


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

         VNC_DEBUG("Start TLS VeNCrypt handshake process\n");
+
+        if (vnc_start_vencrypt_handshake(vs) < 0) {
+
+            VNC_DEBUG("Failed to start TLS handshake\n");
+
             return 0;

         }

static int protocol_client_vencrypt_auth(VncState *vs, uint8_t *data, size_t len)

{

    int auth = read_u32(data, 0);

    if (auth != vs->vd->subauth) {

        VNC_DEBUG("Rejecting auth %d\n", auth);

        vnc_write_u8(vs, 0); /* Reject auth */

        vnc_flush(vs);

        vnc_client_error(vs);

    } else {

        VNC_DEBUG("Accepting auth %d, setting up TLS for handshake\n", auth);

        vnc_write_u8(vs, 1); /* Accept auth */

        vnc_flush(vs);

        if (vnc_tls_client_setup(vs, NEED_X509_AUTH(vs)) < 0) {

            VNC_DEBUG("Failed to setup TLS\n");

            return 0;

        }

        VNC_DEBUG("Start TLS VeNCrypt handshake process\n");

        if (vnc_start_vencrypt_handshake(vs) < 0) {

            VNC_DEBUG("Failed to start TLS handshake\n");

            return 0;

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 iscsi_aio_read16_cb(struct iscsi_context *iscsi, int status,

                     void *command_data, void *opaque)
+
 {

     IscsiAIOCB *acb = opaque;

iscsi_aio_read16_cb(struct iscsi_context *iscsi, int status,

                    void *command_data, void *opaque)

{

    IscsiAIOCB *acb = opaque;

    trace_iscsi_aio_read16_cb(iscsi, status, acb, acb->canceled);

    if (acb->canceled) {

        qemu_aio_release(acb);

        return;

    }

    acb->status = 0;

    if (status != 0) {

        error_report("Failed to read16 data from iSCSI lun. %s",

                     iscsi_get_error(iscsi));

        acb->status = -EIO;

    }

    iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb);

}


static void realtime_init(void)

{

    if (enable_mlock) {

        if (os_mlock() < 0) {

            fprintf(stderr, "qemu: locking memory failed\n");

            exit(1);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int IRQ_get_next(OpenPICState *opp, IRQQueue *q)
+
+{
+
+    if (q->next == -1) {

         /* XXX: optimize */

static int IRQ_get_next(OpenPICState *opp, IRQQueue *q)

{

    if (q->next == -1) {

        /* XXX: optimize */

        IRQ_check(opp, q);

    }

    return q->next;

}


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

+{

     GMainContext *worker_context;

     GMainLoop *compare_loop;

+    CompareState *s = opaque;

     GSource *timeout_source;

+

+    worker_context = g_main_context_new();

static void *colo_compare_thread(void *opaque)

{

    GMainContext *worker_context;

    GMainLoop *compare_loop;

    CompareState *s = opaque;

    GSource *timeout_source;

    worker_context = g_main_context_new();

    qemu_chr_fe_set_handlers(&s->chr_pri_in, compare_chr_can_read,

                             compare_pri_chr_in, NULL, s, worker_context, true);

    qemu_chr_fe_set_handlers(&s->chr_sec_in, compare_chr_can_read,

                             compare_sec_chr_in, NULL, s, worker_context, true);

    compare_loop = g_main_loop_new(worker_context, FALSE);

    /* To kick any packets that the secondary doesn't match */

    timeout_source = g_timeout_source_new(REGULAR_PACKET_CHECK_MS);

    g_source_set_callback(timeout_source,

                          (GSourceFunc)check_old_packet_regular, s, NULL);

    g_source_attach(timeout_source, worker_context);

    g_main_loop_run(compare_loop);

    g_source_unref(timeout_source);

    g_main_loop_unref(compare_loop);

    g_main_context_unref(worker_context);

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -33,9 +33,9 @@
         if(*state % amount == 0)

             (*poutbuf)[i] = *state;
+
+    }
+
+    return 1;
+
 }

static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,

                     uint8_t **poutbuf, int *poutbuf_size,

                     const uint8_t *buf, int buf_size, int keyframe){

    unsigned int *state= bsfc->priv_data;

    int amount= args ? atoi(args) : (*state % 10001+1);

    int i;

    if(amount <= 0)

        return AVERROR(EINVAL);

    *poutbuf= av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);

    memcpy(*poutbuf, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);

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

        (*state) += (*poutbuf)[i] + 1;

        if(*state % amount == 0)

            (*poutbuf)[i] = *state;

    }

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void timer_del(QEMUTimer *ts)

+{
+
+    QEMUTimerList *timer_list = ts->timer_list;

void timer_del(QEMUTimer *ts)

{

    QEMUTimerList *timer_list = ts->timer_list;

    qemu_mutex_lock(&timer_list->active_timers_lock);

    timer_del_locked(timer_list, ts);

    qemu_mutex_unlock(&timer_list->active_timers_lock);

}


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

     QTAILQ_INIT(&mr->subregions);

+    memset(&mr->subregions_link, 0, sizeof mr->subregions_link);
+
+    QTAILQ_INIT(&mr->coalesced);
+
+    mr->name = g_strdup(name);

     mr->dirty_log_mask = 0;

void memory_region_init(MemoryRegion *mr,

                        const char *name,

                        uint64_t size)

{

    mr->ops = NULL;

    mr->parent = NULL;

    mr->size = int128_make64(size);

    if (size == UINT64_MAX) {

        mr->size = int128_2_64();

    }

    mr->addr = 0;

    mr->subpage = false;

    mr->enabled = true;

    mr->terminates = false;

    mr->ram = false;

    mr->romd_mode = true;

    mr->readonly = false;

    mr->rom_device = false;

    mr->destructor = memory_region_destructor_none;

    mr->priority = 0;

    mr->may_overlap = false;

    mr->alias = NULL;

    QTAILQ_INIT(&mr->subregions);

    memset(&mr->subregions_link, 0, sizeof mr->subregions_link);

    QTAILQ_INIT(&mr->coalesced);

    mr->name = g_strdup(name);

    mr->dirty_log_mask = 0;

    mr->ioeventfd_nb = 0;

    mr->ioeventfds = NULL;

    mr->flush_coalesced_mmio = false;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void nbd_refresh_limits(BlockDriverState *bs, Error **errp)
+
+{

     bs->bl.max_discard = UINT32_MAX >> BDRV_SECTOR_BITS;

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

{

    bs->bl.max_discard = UINT32_MAX >> BDRV_SECTOR_BITS;

    bs->bl.max_transfer_length = UINT32_MAX >> BDRV_SECTOR_BITS;

}


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

 {


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

     }

+

     iscsi_readcapacity_sync(iscsilun, &local_err);

static int iscsi_truncate(BlockDriverState *bs, int64_t offset)

{

    IscsiLun *iscsilun = bs->opaque;

    Error *local_err = NULL;

    if (iscsilun->type != TYPE_DISK) {

        return -ENOTSUP;

    }

    iscsi_readcapacity_sync(iscsilun, &local_err);

    if (local_err != NULL) {

        error_free(local_err);

        return -EIO;

    }

    if (offset > iscsi_getlength(bs)) {

        return -EINVAL;

    }

    if (iscsilun->allocationmap != NULL) {

        g_free(iscsilun->allocationmap);

        iscsilun->allocationmap =

            bitmap_new(DIV_ROUND_UP(bs->total_sectors,

                                    iscsilun->cluster_sectors));

    }

    return 0;

}


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

     QTAILQ_FOREACH(se, &savevm_handlers, entry) {
+
+        if (!strcmp(se->idstr, idstr) &&
+
+            instance_id == se->instance_id)
+
             return se;

     }

static SaveStateEntry *find_se(const char *idstr, int instance_id)

{

    SaveStateEntry *se;

    QTAILQ_FOREACH(se, &savevm_handlers, entry) {

        if (!strcmp(se->idstr, idstr) &&

            instance_id == se->instance_id)

            return se;

    }

    return NULL;

}


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

     if (index >= MAX_CONSOLES)

+        return;

     if (active_console) {

void console_select(unsigned int index)

{

    TextConsole *s;

    if (index >= MAX_CONSOLES)

        return;

    if (active_console) {

        active_console->g_width = ds_get_width(active_console->ds);

        active_console->g_height = ds_get_height(active_console->ds);

    }

    s = consoles[index];

    if (s) {

        DisplayState *ds = s->ds;

        if (active_console->cursor_timer) {

            qemu_del_timer(active_console->cursor_timer);

        }

        active_console = s;

        if (ds_get_bits_per_pixel(s->ds)) {

            ds->surface = qemu_resize_displaysurface(ds, s->g_width, s->g_height);

        } else {

            s->ds->surface->width = s->width;

            s->ds->surface->height = s->height;

        }

        if (s->cursor_timer) {

            qemu_mod_timer(s->cursor_timer,

                   qemu_get_clock_ms(rt_clock) + CONSOLE_CURSOR_PERIOD / 2);

        }

        dpy_resize(s->ds);

        vga_hw_invalidate();

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void sysbus_mmio_map_overlap(SysBusDevice *dev, int n, hwaddr addr,
+
+                             unsigned priority)

 {

void sysbus_mmio_map_overlap(SysBusDevice *dev, int n, hwaddr addr,

                             unsigned priority)

{

    sysbus_mmio_map_common(dev, n, addr, true, priority);

}


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

 {

+    AVDictionaryEntry *t;

     if ((t = av_dict_get(m, "", NULL, AV_DICT_IGNORE_SUFFIX))) {

void assert_avoptions(AVDictionary *m)

{

    AVDictionaryEntry *t;

    if ((t = av_dict_get(m, "", NULL, AV_DICT_IGNORE_SUFFIX))) {

        av_log(NULL, AV_LOG_FATAL, "Option %s not found.\n", t->key);

        exit(1);

    }

}


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

 {
+
+    XenIOState *state = container_of(listener, XenIOState, io_listener);
+
+

     xen_unmap_io_section(xen_xc, xen_domid, state->ioservid, section);

static void xen_io_del(MemoryListener *listener,

                       MemoryRegionSection *section)

{

    XenIOState *state = container_of(listener, XenIOState, io_listener);

    xen_unmap_io_section(xen_xc, xen_domid, state->ioservid, section);

    memory_region_unref(section->mr);

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
                              NULL, /* memory_region_set_container */

                              NULL, NULL, &error_abort);
+
+    op->resolve = memory_region_resolve_container;
+
+
+
     object_property_add(OBJECT(mr), "addr", "uint64",

                         memory_region_get_addr,

static void memory_region_initfn(Object *obj)

{

    MemoryRegion *mr = MEMORY_REGION(obj);

    ObjectProperty *op;

    mr->ops = &unassigned_mem_ops;

    mr->enabled = true;

    mr->romd_mode = true;

    mr->global_locking = true;

    mr->destructor = memory_region_destructor_none;

    QTAILQ_INIT(&mr->subregions);

    QTAILQ_INIT(&mr->coalesced);

    op = object_property_add(OBJECT(mr), "container",

                             "link<" TYPE_MEMORY_REGION ">",

                             memory_region_get_container,

                             NULL, /* memory_region_set_container */

                             NULL, NULL, &error_abort);

    op->resolve = memory_region_resolve_container;

    object_property_add(OBJECT(mr), "addr", "uint64",

                        memory_region_get_addr,

                        NULL, /* memory_region_set_addr */

                        NULL, NULL, &error_abort);

    object_property_add(OBJECT(mr), "priority", "uint32",

                        memory_region_get_priority,

                        NULL, /* memory_region_set_priority */

                        NULL, NULL, &error_abort);

    object_property_add_bool(OBJECT(mr), "may-overlap",

                             memory_region_get_may_overlap,

                             NULL, /* memory_region_set_may_overlap */

                             &error_abort);

    object_property_add(OBJECT(mr), "size", "uint64",

                        memory_region_get_size,

                        NULL, /* memory_region_set_size, */

                        NULL, NULL, &error_abort);

}


--- a/source.c
+++ b/source.c
@@ -19,8 +19,8 @@
             for (j = 0; j < sizeof(command_to_handler); j++) {

                 if ((j & handlers[i].mask) == handlers[i].value) {
+
+                    command_to_handler[j] = i;

                 }

static int fdctrl_init_common(FDCtrl *fdctrl)

{

    int i, j;

    static int command_tables_inited = 0;

    /* Fill 'command_to_handler' lookup table */

    if (!command_tables_inited) {

        command_tables_inited = 1;

        for (i = ARRAY_SIZE(handlers) - 1; i >= 0; i--) {

            for (j = 0; j < sizeof(command_to_handler); j++) {

                if ((j & handlers[i].mask) == handlers[i].value) {

                    command_to_handler[j] = i;

                }

            }

        }

    }

    FLOPPY_DPRINTF("init controller\n");

    fdctrl->fifo = qemu_memalign(512, FD_SECTOR_LEN);

    fdctrl->fifo_size = 512;

    fdctrl->result_timer = qemu_new_timer(vm_clock,

                                          fdctrl_result_timer, fdctrl);

    fdctrl->version = 0x90; /* Intel 82078 controller */

    fdctrl->config = FD_CONFIG_EIS | FD_CONFIG_EFIFO; /* Implicit seek, polling & FIFO enabled */

    fdctrl->num_floppies = MAX_FD;

    if (fdctrl->dma_chann != -1)

        DMA_register_channel(fdctrl->dma_chann, &fdctrl_transfer_handler, fdctrl);

    fdctrl_connect_drives(fdctrl);

    return 0;

}