--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void hScale16To19_c(SwsContext *c, int16_t *_dst, int dstW, const uint8_t *_src,

                            const int16_t *filter,

static void hScale16To19_c(SwsContext *c, int16_t *_dst, int dstW, const uint8_t *_src,

                           const int16_t *filter,

                           const int16_t *filterPos, int filterSize)

{

    int i;

    int32_t *dst = (int32_t *) _dst;

    const uint16_t *src = (const uint16_t *) _src;

    int bits = av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1;

    int sh = bits - 4;

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

        int j;

        int srcPos = filterPos[i];

        int val = 0;

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

            val += src[srcPos + j] * filter[filterSize * i + j];

        }

        // filter=14 bit, input=16 bit, output=30 bit, >> 11 makes 19 bit

        dst[i] = FFMIN(val >> sh, (1 << 19) - 1);

    }

}


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

                         // XXX dsputil-ize

+                        dest[group*128+k] += cce->coup.gain[index][idx] * src[group*128+k];
+
+                    }
+
+                }

             }

static void apply_dependent_coupling(AACContext * ac, SingleChannelElement * target, ChannelElement * cce, int index) {

    IndividualChannelStream * ics = &cce->ch[0].ics;

    const uint16_t * offsets = ics->swb_offset;

    float * dest = target->coeffs;

    const float * src = cce->ch[0].coeffs;

    int g, i, group, k, idx = 0;

    if(ac->m4ac.object_type == AOT_AAC_LTP) {

        av_log(ac->avccontext, AV_LOG_ERROR,

               "Dependent coupling is not supported together with LTP\n");

        return;

    }

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

        for (i = 0; i < ics->max_sfb; i++, idx++) {

            if (cce->ch[0].band_type[idx] != ZERO_BT) {

                for (group = 0; group < ics->group_len[g]; group++) {

                    for (k = offsets[i]; k < offsets[i+1]; k++) {

                        // XXX dsputil-ize

                        dest[group*128+k] += cce->coup.gain[index][idx] * src[group*128+k];

                    }

                }

            }

        }

        dest += ics->group_len[g]*128;

        src  += ics->group_len[g]*128;

    }

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     ppcmas_tlb_t *tlb;

     target_phys_addr_t raddr;
+
+    int i, j, ret;
+
+
+
     ret = -1;

     raddr = (target_phys_addr_t)-1ULL;

static int mmubooke206_get_physical_address(CPUState *env, mmu_ctx_t *ctx,

                                            target_ulong address, int rw,

                                            int access_type)

{

    ppcmas_tlb_t *tlb;

    target_phys_addr_t raddr;

    int i, j, ret;

    ret = -1;

    raddr = (target_phys_addr_t)-1ULL;

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

        int ways = booke206_tlb_ways(env, i);

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

            tlb = booke206_get_tlbm(env, i, address, j);

            ret = mmubooke206_check_tlb(env, tlb, &raddr, &ctx->prot, address,

                                        rw, access_type);

            if (ret != -1) {

                goto found_tlb;

found_tlb:

    if (ret >= 0) {

        ctx->raddr = raddr;

        LOG_SWTLB("%s: access granted " TARGET_FMT_lx " => " TARGET_FMT_plx

                  " %d %d\n", __func__, address, ctx->raddr, ctx->prot,

                  ret);

    } else {

        LOG_SWTLB("%s: access refused " TARGET_FMT_lx " => " TARGET_FMT_plx

                  " %d %d\n", __func__, address, raddr, ctx->prot, ret);

    return ret;


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

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


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

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

         acb->qcrs[i].buf = qemu_blockalign(s->children[i]->bs, acb->qiov->size);

static BlockAIOCB *read_quorum_children(QuorumAIOCB *acb)

{

    BDRVQuorumState *s = acb->common.bs->opaque;

    int i;

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

        acb->qcrs[i].buf = qemu_blockalign(s->children[i]->bs, acb->qiov->size);

        qemu_iovec_init(&acb->qcrs[i].qiov, acb->qiov->niov);

        qemu_iovec_clone(&acb->qcrs[i].qiov, acb->qiov, acb->qcrs[i].buf);

    }

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

        bdrv_aio_readv(s->children[i]->bs, acb->sector_num, &acb->qcrs[i].qiov,

                       acb->nb_sectors, quorum_aio_cb, &acb->qcrs[i]);

    }

    return &acb->common;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void add_query_tests(QmpSchema *schema)

 {
+
     SchemaInfoList *tail;

     SchemaInfo *si, *arg_type, *ret_type;

static void add_query_tests(QmpSchema *schema)

{

    SchemaInfoList *tail;

    SchemaInfo *si, *arg_type, *ret_type;

    const char *test_name;

    /* Test the query-like commands */

    for (tail = schema->list; tail; tail = tail->next) {

        si = tail->value;

        if (si->meta_type != SCHEMA_META_TYPE_COMMAND) {

            continue;

        }

        if (query_is_blacklisted(si->name)) {

            continue;

        }

        arg_type = qmp_schema_lookup(schema, si->u.command.arg_type);

        if (object_type_has_mandatory_members(arg_type)) {

            continue;

        }

        ret_type = qmp_schema_lookup(schema, si->u.command.ret_type);

        if (ret_type->meta_type == SCHEMA_META_TYPE_OBJECT

            && !ret_type->u.object.members) {

            continue;

        }

        test_name = g_strdup_printf("qmp/%s", si->name);

        qtest_add_data_func(test_name, si->name, test_query);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int coroutine_enter_func(void *arg)

+{

     Coroutine *co = arg;

static int coroutine_enter_func(void *arg)

{

    Coroutine *co = arg;

    qemu_coroutine_enter(co, NULL);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 int ff_wma_end(AVCodecContext *avctx)

+{
+
+    WMACodecContext *s = avctx->priv_data;
+
+    int i;

int ff_wma_end(AVCodecContext *avctx)

{

    WMACodecContext *s = avctx->priv_data;

    int i;

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

        ff_mdct_end(&s->mdct_ctx[i]);

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

        av_free(s->windows[i]);

    if (s->use_exp_vlc) {

        free_vlc(&s->exp_vlc);

    }

    if (s->use_noise_coding) {

        free_vlc(&s->hgain_vlc);

    }

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

        free_vlc(&s->coef_vlc[i]);

        av_free(s->run_table[i]);

        av_free(s->level_table[i]);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -25,9 +25,9 @@
     bink->video_pts = 0;

     memset(bink->audio_pts, 0, sizeof(bink->audio_pts));
+
+    bink->current_track = -1;
+
+    return 0;
+
 }

static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)

{

    BinkDemuxContext *bink = s->priv_data;

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

    if (!s->pb->seekable)

        return -1;

    /* seek to the first frame */

    if (avio_seek(s->pb, vst->index_entries[0].pos, SEEK_SET) < 0)

        return -1;

    bink->video_pts = 0;

    memset(bink->audio_pts, 0, sizeof(bink->audio_pts));

    bink->current_track = -1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
             return AVPROBE_SCORE_MAX-20;

     }
+
+    /* so we'll have more luck on extension... */
+
+    if (av_match_ext(p->filename, "nsv"))
+
         return AVPROBE_SCORE_MAX/2;

     /* FIXME: add mime-type check */

static int nsv_probe(AVProbeData *p)

{

    int i;

    av_dlog(NULL, "nsv_probe(), buf_size %d\n", p->buf_size);

    /* check file header */

    /* streamed files might not have any header */

    if (p->buf[0] == 'N' && p->buf[1] == 'S' &&

        p->buf[2] == 'V' && (p->buf[3] == 'f' || p->buf[3] == 's'))

        return AVPROBE_SCORE_MAX;

    /* XXX: do streamed files always start at chunk boundary ?? */

    /* or do we need to search NSVs in the byte stream ? */

    /* seems the servers don't bother starting clean chunks... */

    /* sometimes even the first header is at 9KB or something :^) */

    for (i = 1; i < p->buf_size - 3; i++) {

        if (p->buf[i+0] == 'N' && p->buf[i+1] == 'S' &&

            p->buf[i+2] == 'V' && p->buf[i+3] == 's')

            return AVPROBE_SCORE_MAX-20;

    }

    /* so we'll have more luck on extension... */

    if (av_match_ext(p->filename, "nsv"))

        return AVPROBE_SCORE_MAX/2;

    /* FIXME: add mime-type check */

    return 0;

}


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

     struct vhost_dev *dev = container_of(listener, struct vhost_dev,
+
                                          memory_listener);

     int i;

static void vhost_region_del(MemoryListener *listener,

                             MemoryRegionSection *section)

{

    struct vhost_dev *dev = container_of(listener, struct vhost_dev,

                                         memory_listener);

    int i;

    vhost_set_memory(listener, section, false);

    for (i = 0; i < dev->n_mem_sections; ++i) {

        if (dev->mem_sections[i].offset_within_address_space

            == section->offset_within_address_space) {

            --dev->n_mem_sections;

            memmove(&dev->mem_sections[i], &dev->mem_sections[i+1],

                    dev->n_mem_sections - i);

            break;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void ff_avg_h264_qpel4_mc32_msa(uint8_t *dst, const uint8_t *src,

+                                ptrdiff_t stride)
+
 {

     avc_luma_midh_qrt_and_aver_dst_4w_msa(src - (2 * stride) - 2,

void ff_avg_h264_qpel4_mc32_msa(uint8_t *dst, const uint8_t *src,

                                ptrdiff_t stride)

{

    avc_luma_midh_qrt_and_aver_dst_4w_msa(src - (2 * stride) - 2,

                                          stride, dst, stride, 4, 1);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static inline ioreq_t *xen_vcpu_ioreq(shared_iopage_t *shared_page, int vcpu)
+
 {

     return &shared_page->vcpu_iodata[vcpu].vp_ioreq;

static inline ioreq_t *xen_vcpu_ioreq(shared_iopage_t *shared_page, int vcpu)

{

    return &shared_page->vcpu_iodata[vcpu].vp_ioreq;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+void bdrv_reset_dirty(BlockDriverState *bs, int64_t cur_sector, int nr_sectors)

 {

void bdrv_reset_dirty(BlockDriverState *bs, int64_t cur_sector, int nr_sectors)

{

    BdrvDirtyBitmap *bitmap;

    QLIST_FOREACH(bitmap, &bs->dirty_bitmaps, list) {

        hbitmap_reset(bitmap->bitmap, cur_sector, nr_sectors);

    }

}


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

     BDRVQcowState *s = bs->opaque;
+
     uint32_t l1_length = s->l1_size * sizeof(uint64_t);

     int ret;

static int qcow_make_empty(BlockDriverState *bs)

{

    BDRVQcowState *s = bs->opaque;

    uint32_t l1_length = s->l1_size * sizeof(uint64_t);

    int ret;

    memset(s->l1_table, 0, l1_length);

    if (bdrv_pwrite(bs->file, s->l1_table_offset, s->l1_table, l1_length) < 0)

	return -1;

    ret = bdrv_truncate(bs->file, s->l1_table_offset + l1_length);

    if (ret < 0)

        return ret;

    memset(s->l2_cache, 0, s->l2_size * L2_CACHE_SIZE * sizeof(uint64_t));

    memset(s->l2_cache_offsets, 0, L2_CACHE_SIZE * sizeof(uint64_t));

    memset(s->l2_cache_counts, 0, L2_CACHE_SIZE * sizeof(uint32_t));

    return 0;

}


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

     double ret = 0;
+
     SelectContext *select = ctx->priv;

     AVFilterBufferRef *prev_picref = select->prev_picref;

+
+    if (prev_picref &&

         picref->video->h    == prev_picref->video->h &&
+
         picref->video->w    == prev_picref->video->w &&

         picref->linesize[0] == prev_picref->linesize[0]) {

static double get_scene_score(AVFilterContext *ctx, AVFilterBufferRef *picref)

{

    double ret = 0;

    SelectContext *select = ctx->priv;

    AVFilterBufferRef *prev_picref = select->prev_picref;

    if (prev_picref &&

        picref->video->h    == prev_picref->video->h &&

        picref->video->w    == prev_picref->video->w &&

        picref->linesize[0] == prev_picref->linesize[0]) {

        int x, y;

        int64_t sad = 0;

        double mafd, diff;

        uint8_t *p1 =      picref->data[0];

        uint8_t *p2 = prev_picref->data[0];

        const int linesize = picref->linesize[0];

        for (y = 0; y < picref->video->h; y += 8)

            for (x = 0; x < linesize; x += 8)

                sad += select->c.sad[1](select,

                                        p1 + y * linesize + x,

                                        p2 + y * linesize + x,

                                        linesize, 8);

        emms_c();

        mafd = sad / (picref->video->h * picref->video->w * 3);

        diff = fabs(mafd - select->prev_mafd);

        ret  = av_clipf(FFMIN(mafd, diff) / 100., 0, 1);

        select->prev_mafd = mafd;

        avfilter_unref_buffer(prev_picref);

    }

    select->prev_picref = avfilter_ref_buffer(picref, ~0);

    return ret;

}


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

         [GDB_WATCHPOINT_ACCESS] = 0x3

+    };

     const uint8_t len_code[] = {

void kvm_arch_update_guest_debug(CPUState *env, struct kvm_guest_debug *dbg)

{

    const uint8_t type_code[] = {

        [GDB_BREAKPOINT_HW] = 0x0,

        [GDB_WATCHPOINT_WRITE] = 0x1,

        [GDB_WATCHPOINT_ACCESS] = 0x3

    };

    const uint8_t len_code[] = {

        [1] = 0x0, [2] = 0x1, [4] = 0x3, [8] = 0x2

    };

    int n;

    if (kvm_sw_breakpoints_active(env))

        dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP;

    if (nb_hw_breakpoint > 0) {

        dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_HW_BP;

        dbg->arch.debugreg[7] = 0x0600;

        for (n = 0; n < nb_hw_breakpoint; n++) {

            dbg->arch.debugreg[n] = hw_breakpoint[n].addr;

            dbg->arch.debugreg[7] |= (2 << (n * 2)) |

                (type_code[hw_breakpoint[n].type] << (16 + n*4)) |

                (len_code[hw_breakpoint[n].len] << (18 + n*4));

        }

    }

    /* Legal xcr0 for loading */

    env->xcr0 = 1;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int get_coc(J2kDecoderContext *s, J2kCodingStyle *c, uint8_t *properties)

+{
+
     int compno;
+

     if (s->buf_end - s->buf < 2)

static int get_coc(J2kDecoderContext *s, J2kCodingStyle *c, uint8_t *properties)

{

    int compno;

    if (s->buf_end - s->buf < 2)

        return AVERROR(EINVAL);

    compno = bytestream_get_byte(&s->buf);

    c += compno;

    c->csty = bytestream_get_byte(&s->buf);

    get_cox(s, c);

    properties[compno] |= HAD_COC;

    return 0;

}


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

                              void *opaque,

ReadLineState *readline_init(ReadLinePrintfFunc *printf_func,

                             ReadLineFlushFunc *flush_func,

                             void *opaque,

                             ReadLineCompletionFunc *completion_finder)

{

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

    rs->hist_entry = -1;

    rs->opaque = opaque;

    rs->printf_func = printf_func;

    rs->flush_func = flush_func;

    rs->completion_finder = completion_finder;

    return rs;

}


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

 {

+    XanContext *s = avctx->priv_data;
+
+

     s->avctx = avctx;

static av_cold int xan_decode_init(AVCodecContext *avctx)

{

    XanContext *s = avctx->priv_data;

    s->avctx = avctx;

    s->frame_size = 0;

    if ((avctx->codec->id == CODEC_ID_XAN_WC3) &&

        (s->avctx->palctrl == NULL)) {

        av_log(avctx, AV_LOG_ERROR, "palette expected\n");

        return AVERROR(EINVAL);

    }

    avctx->pix_fmt = PIX_FMT_PAL8;

    s->buffer1_size = avctx->width * avctx->height;

    s->buffer1 = av_malloc(s->buffer1_size);

    if (!s->buffer1)

        return AVERROR(ENOMEM);

    s->buffer2_size = avctx->width * avctx->height;

    s->buffer2 = av_malloc(s->buffer2_size + 130);

    if (!s->buffer2) {

        av_freep(&s->buffer1);

        return AVERROR(ENOMEM);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static int64_t alloc_clusters_noref(BlockDriverState *bs, int64_t size)

+{

     BDRVQcowState *s = bs->opaque;
+
     int i, nb_clusters, refcount;

static int64_t alloc_clusters_noref(BlockDriverState *bs, int64_t size)

{

    BDRVQcowState *s = bs->opaque;

    int i, nb_clusters, refcount;

    nb_clusters = size_to_clusters(s, size);

retry:

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

        int64_t next_cluster_index = s->free_cluster_index++;

        refcount = get_refcount(bs, next_cluster_index);

        if (refcount < 0) {

            return refcount;

        } else if (refcount != 0) {

            goto retry;

        }

    }

#ifdef DEBUG_ALLOC2

    fprintf(stderr, "alloc_clusters: size=%" PRId64 " -> %" PRId64 "\n",

            size,

            (s->free_cluster_index - nb_clusters) << s->cluster_bits);

#endif

    return (s->free_cluster_index - nb_clusters) << s->cluster_bits;

}


bool s390_cpu_exec_interrupt(CPUState *cs, int interrupt_request)

{

    if (interrupt_request & CPU_INTERRUPT_HARD) {

        S390CPU *cpu = S390_CPU(cs);

        CPUS390XState *env = &cpu->env;

        if (env->ex_value) {

            /* Execution of the target insn is indivisible from

               the parent EXECUTE insn.  */

            return false;

        }

        if (env->psw.mask & PSW_MASK_EXT) {

            s390_cpu_do_interrupt(cs);

            return true;

        }

    }

    return false;

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     QLIST_INIT(&spapr_tce_tables);

+
+    /* hcall-tce */
+
     spapr_register_hypercall(H_PUT_TCE, h_put_tce);

 }

void spapr_iommu_init(void)

{

    QLIST_INIT(&spapr_tce_tables);

    /* hcall-tce */

    spapr_register_hypercall(H_PUT_TCE, h_put_tce);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void slow_bar_writew(void *opaque, target_phys_addr_t addr, uint32_t val)

+{
+
+    AssignedDevRegion *d = opaque;

     uint16_t *out = (uint16_t *)(d->u.r_virtbase + addr);

static void slow_bar_writew(void *opaque, target_phys_addr_t addr, uint32_t val)

{

    AssignedDevRegion *d = opaque;

    uint16_t *out = (uint16_t *)(d->u.r_virtbase + addr);

    DEBUG("slow_bar_writew addr=0x" TARGET_FMT_plx " val=0x%04x\n", addr, val);

    *out = val;

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
     k->exit = info->unplug ? usb_uhci_exit : NULL;

     k->vendor_id = info->vendor_id;
+
+    k->device_id = info->device_id;
+
+    k->revision  = info->revision;
+
     k->class_id  = PCI_CLASS_SERIAL_USB;

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);

    UHCIPCIDeviceClass *u = container_of(k, UHCIPCIDeviceClass, parent_class);

    UHCIInfo *info = data;

    k->init = info->initfn ? info->initfn : usb_uhci_common_initfn;

    k->exit = info->unplug ? usb_uhci_exit : NULL;

    k->vendor_id = info->vendor_id;

    k->device_id = info->device_id;

    k->revision  = info->revision;

    k->class_id  = PCI_CLASS_SERIAL_USB;

    dc->vmsd = &vmstate_uhci;

    dc->props = uhci_properties;

    u->info = *info;

}


--- a/source.c
+++ b/source.c
@@ -41,11 +41,11 @@
                        get_sp_from_cpustate(env)) == -EFAULT) {

         goto badframe;
+
+    }
+
+    unlock_user_struct(frame, frame_addr, 0);
+
     return env->regs[2];

long do_rt_sigreturn(CPUS390XState *env)

{

    rt_sigframe *frame;

    abi_ulong frame_addr = env->regs[15];

    qemu_log("%s: frame_addr 0x%llx\n", __FUNCTION__,

             (unsigned long long)frame_addr);

    sigset_t set;

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

        goto badframe;

    }

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

    sigprocmask(SIG_SETMASK, &set, NULL); /* ~_BLOCKABLE? */

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

        goto badframe;

    }

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

                       get_sp_from_cpustate(env)) == -EFAULT) {

        goto badframe;

    }

    unlock_user_struct(frame, frame_addr, 0);

    return env->regs[2];

badframe:

    unlock_user_struct(frame, frame_addr, 0);

    force_sig(TARGET_SIGSEGV);

    return 0;

}


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

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

     };

int kvmppc_get_htab_fd(bool write)

{

    struct kvm_get_htab_fd s = {

        .flags = write ? KVM_GET_HTAB_WRITE : 0,

        .start_index = 0,

    };

    if (!cap_htab_fd) {

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

        return -1;

    }

    return kvm_vm_ioctl(kvm_state, KVM_PPC_GET_HTAB_FD, &s);

}


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

     fail_unless(qobject_type(obj) == QTYPE_QINT);

+
+
+    qint = qobject_to_qint(obj);
+
+    fail_unless(qint_get_int(qint) == value64);

START_TEST(vararg_number)

{

    QObject *obj;

    QInt *qint;

    QFloat *qfloat;

    int value = 0x2342;

    int64_t value64 = 0x2342342343LL;

    double valuef = 2.323423423;

    obj = qobject_from_jsonf("%d", value);

    fail_unless(obj != NULL);

    fail_unless(qobject_type(obj) == QTYPE_QINT);

    qint = qobject_to_qint(obj);

    fail_unless(qint_get_int(qint) == value);

    QDECREF(qint);

    obj = qobject_from_jsonf("%" PRId64, value64);

    fail_unless(obj != NULL);

    fail_unless(qobject_type(obj) == QTYPE_QINT);

    qint = qobject_to_qint(obj);

    fail_unless(qint_get_int(qint) == value64);

    QDECREF(qint);

    obj = qobject_from_jsonf("%f", valuef);

    fail_unless(obj != NULL);

    fail_unless(qobject_type(obj) == QTYPE_QFLOAT);

    qfloat = qobject_to_qfloat(obj);

    fail_unless(qfloat_get_double(qfloat) == valuef);

    QDECREF(qfloat);

}


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

     int ret;
+
+
+
+    if (colors == 0) {
+
         if (tight_detect_smooth_image(vs, w, h)) {

             int quality = tight_conf[vs->tight.quality].jpeg_quality;

static int send_sub_rect_jpeg(VncState *vs, int x, int y, int w, int h,

                              int bg, int fg, int colors,

                              VncPalette *palette)

{

    int ret;

    if (colors == 0) {

        if (tight_detect_smooth_image(vs, w, h)) {

            int quality = tight_conf[vs->tight.quality].jpeg_quality;

            ret = send_jpeg_rect(vs, x, y, w, h, quality);

            ret = send_full_color_rect(vs, x, y, w, h);

        }

    } else if (colors == 1) {

        ret = send_solid_rect(vs);

    } else if (colors == 2) {

        ret = send_mono_rect(vs, x, y, w, h, bg, fg);

    } else if (colors <= 256) {

        if (colors > 96 &&

            tight_detect_smooth_image(vs, w, h)) {

            int quality = tight_conf[vs->tight.quality].jpeg_quality;

            ret = send_jpeg_rect(vs, x, y, w, h, quality);

            ret = send_palette_rect(vs, x, y, w, h, palette);

        }

    }

    return ret;

}


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

 {
+
     BDRVSheepdogState *s = opaque;
+

     if (!s->co_recv) {

static void co_read_response(void *opaque)

{

    BDRVSheepdogState *s = opaque;

    if (!s->co_recv) {

        s->co_recv = qemu_coroutine_create(aio_read_response);

    }

    qemu_coroutine_enter(s->co_recv, opaque);

}


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

         }

+        if (ri->type & ARM_CP_NO_MIGRATE) {
+
+            continue;
+
+        }

         cpu->cpreg_values[i] = read_raw_cp_reg(&cpu->env, ri);

bool write_cpustate_to_list(ARMCPU *cpu)

{

    /* Write the coprocessor state from cpu->env to the (index,value) list. */

    int i;

    bool ok = true;

    for (i = 0; i < cpu->cpreg_array_len; i++) {

        uint32_t regidx = kvm_to_cpreg_id(cpu->cpreg_indexes[i]);

        const ARMCPRegInfo *ri;

        ri = get_arm_cp_reginfo(cpu->cp_regs, regidx);

        if (!ri) {

            ok = false;

            continue;

        }

        if (ri->type & ARM_CP_NO_MIGRATE) {

            continue;

        }

        cpu->cpreg_values[i] = read_raw_cp_reg(&cpu->env, ri);

    }

    return ok;

}


static void h261_encode_motion(H261Context * h, int val){

    MpegEncContext * const s = &h->s;

    int sign, code;

    if(val==0){

        code = 0;

        put_bits(&s->pb,h261_mv_tab[code][1],h261_mv_tab[code][0]);

    }

    else{

        if(val > 16)

            val -=32;

        if(val < -16)

            val+=32;

        sign = val < 0;

        code = sign ? -val : val;

        put_bits(&s->pb,h261_mv_tab[code][1],h261_mv_tab[code][0]);

        put_bits(&s->pb,1,sign);

    }

}


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

     phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS] = dirty_flags;

+    /* we remove the notdirty callback only if the code has been
+
+       flushed */
+
+    if (dirty_flags == 0xff)

         tlb_set_dirty(cpu_single_env, cpu_single_env->mem_io_vaddr);

static void notdirty_mem_writel(void *opaque, target_phys_addr_t ram_addr,

                                uint32_t val)

{

    int dirty_flags;

    dirty_flags = phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS];

    if (!(dirty_flags & CODE_DIRTY_FLAG)) {

#if !defined(CONFIG_USER_ONLY)

        tb_invalidate_phys_page_fast(ram_addr, 4);

        dirty_flags = phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS];

#endif

    }

    stl_p(qemu_get_ram_ptr(ram_addr), val);

    dirty_flags |= (0xff & ~CODE_DIRTY_FLAG);

    phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS] = dirty_flags;

    /* we remove the notdirty callback only if the code has been

       flushed */

    if (dirty_flags == 0xff)

        tlb_set_dirty(cpu_single_env, cpu_single_env->mem_io_vaddr);

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
         info->service = g_strdup(addr->u.inet.data->port);

         if (addr->u.inet.data->ipv6) {
+
+            info->family = NETWORK_ADDRESS_FAMILY_IPV6;
+
+        } else {
+
             info->family = NETWORK_ADDRESS_FAMILY_IPV4;

         }

static void vnc_init_basic_info(SocketAddressLegacy *addr,

                                VncBasicInfo *info,

                                Error **errp)

{

    switch (addr->type) {

    case SOCKET_ADDRESS_LEGACY_KIND_INET:

        info->host = g_strdup(addr->u.inet.data->host);

        info->service = g_strdup(addr->u.inet.data->port);

        if (addr->u.inet.data->ipv6) {

            info->family = NETWORK_ADDRESS_FAMILY_IPV6;

        } else {

            info->family = NETWORK_ADDRESS_FAMILY_IPV4;

        }

        break;

    case SOCKET_ADDRESS_LEGACY_KIND_UNIX:

        info->host = g_strdup("");

        info->service = g_strdup(addr->u.q_unix.data->path);

        info->family = NETWORK_ADDRESS_FAMILY_UNIX;

        break;

    case SOCKET_ADDRESS_LEGACY_KIND_VSOCK:

    case SOCKET_ADDRESS_LEGACY_KIND_FD:

        error_setg(errp, "Unsupported socket address type %s",

                   SocketAddressLegacyKind_lookup[addr->type]);

        break;

    default:

        abort();

    }

    return;

}


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

+    ets = qemu_mallocz(sizeof (*ets));
+
+    ets->num_notes = 1; /* only prstatus is dumped */
+
+    fill_prstatus(&ets->prstatus, ts, 0);

     elf_core_copy_regs(&ets->prstatus.pr_reg, env);

static void fill_thread_info(struct elf_note_info *info, const CPUState *env)

{

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

    struct elf_thread_status *ets;

    ets = qemu_mallocz(sizeof (*ets));

    ets->num_notes = 1; /* only prstatus is dumped */

    fill_prstatus(&ets->prstatus, ts, 0);

    elf_core_copy_regs(&ets->prstatus.pr_reg, env);

    fill_note(&ets->notes[0], "CORE", NT_PRSTATUS, sizeof (ets->prstatus),

        &ets->prstatus);

    TAILQ_INSERT_TAIL(&info->thread_list, ets, ets_link);

    info->notes_size += note_size(&ets->notes[0]);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int decode_pic_timing(HEVCSEIContext *s, GetBitContext *gb, const HEVCParamSets *ps,

                              void *logctx)

@@ -16,7 +16,7 @@

     sps = (HEVCSPS*)ps->sps_list[s->active_seq_parameter_set_id]->data;

+

     if (sps->vui.frame_field_info_present_flag) {

static int decode_pic_timing(HEVCSEIContext *s, GetBitContext *gb, const HEVCParamSets *ps,

                             void *logctx)

{

    HEVCSEIPictureTiming *h = &s->picture_timing;

    HEVCSPS *sps;

    if (!ps->sps_list[s->active_seq_parameter_set_id])

        return(AVERROR(ENOMEM));

    sps = (HEVCSPS*)ps->sps_list[s->active_seq_parameter_set_id]->data;

    if (sps->vui.frame_field_info_present_flag) {

        int pic_struct = get_bits(gb, 4);

        h->picture_struct = AV_PICTURE_STRUCTURE_UNKNOWN;

        if (pic_struct == 2) {

            av_log(logctx, AV_LOG_DEBUG, "BOTTOM Field\n");

            h->picture_struct = AV_PICTURE_STRUCTURE_BOTTOM_FIELD;

        } else if (pic_struct == 1) {

            av_log(logctx, AV_LOG_DEBUG, "TOP Field\n");

            h->picture_struct = AV_PICTURE_STRUCTURE_TOP_FIELD;

        }

        get_bits(gb, 2);                   // source_scan_type

        get_bits(gb, 1);                   // duplicate_flag

    }

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
     if (a) {

         gen_branch_a(dc, target, dc->npc, r_cond);
+
+        dc->is_br = 1;
+
+    } else {
+
         dc->pc = dc->npc;

         dc->jump_pc[0] = target;

static void do_branch_reg(DisasContext *dc, int32_t offset, uint32_t insn,

                          TCGv r_cond, TCGv r_reg)

{

    unsigned int cond = GET_FIELD_SP(insn, 25, 27), a = (insn & (1 << 29));

    target_ulong target = dc->pc + offset;

    flush_cond(dc, r_cond);

    gen_cond_reg(r_cond, cond, r_reg);

    if (a) {

        gen_branch_a(dc, target, dc->npc, r_cond);

        dc->is_br = 1;

    } else {

        dc->pc = dc->npc;

        dc->jump_pc[0] = target;

        dc->jump_pc[1] = dc->npc + 4;

        dc->npc = JUMP_PC;

    }

}


static gint ppc_cpu_compare_class_pvr_mask(gconstpointer a, gconstpointer b)

{

    ObjectClass *oc = (ObjectClass *)a;

    uint32_t pvr = *(uint32_t *)b;

    PowerPCCPUClass *pcc = (PowerPCCPUClass *)a;

    gint ret;

    /* -cpu host does a PVR lookup during construction */

    if (unlikely(strcmp(object_class_get_name(oc),

                        TYPE_HOST_POWERPC_CPU) == 0)) {

        return -1;

    }

    if (!ppc_cpu_is_valid(pcc)) {

        return -1;

    }

    ret = (((pcc->pvr & pcc->pvr_mask) == (pvr & pcc->pvr_mask)) ? 0 : -1);

    return ret;

}


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

     int bin, band, ch, band_end;
+
+
+
+    bin = s->start_freq[CPL_CH];
+
     for (band = 0; band < s->num_cpl_bands; band++) {

         band_end = bin + s->cpl_band_sizes[band];

static void calc_transform_coeffs_cpl(AC3DecodeContext *s)

{

    int bin, band, ch, band_end;

    bin = s->start_freq[CPL_CH];

    for (band = 0; band < s->num_cpl_bands; band++) {

        band_end = bin + s->cpl_band_sizes[band];

        for (; bin < band_end; bin++) {

            for (ch = 1; ch <= s->fbw_channels; ch++) {

                if (s->channel_in_cpl[ch]) {

                    s->fixed_coeffs[ch][bin] = ((int64_t)s->fixed_coeffs[CPL_CH][bin] *

                                                (int64_t)s->cpl_coords[ch][band]) >> 23;

                    if (ch == 2 && s->phase_flags[band])

                        s->fixed_coeffs[ch][bin] = -s->fixed_coeffs[ch][bin];

                }

            }

        }

    }

}


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

     if ((err = getnameinfo((struct sockaddr *)sa, salen,

+                           host, sizeof(host),
+
+                           serv, sizeof(serv),
+
+                           NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {

         VNC_DEBUG("Cannot resolve address %d: %s\n",

static char *addr_to_string(const char *format,

                            struct sockaddr_storage *sa,

                            socklen_t salen) {

    char *addr;

    char host[NI_MAXHOST];

    char serv[NI_MAXSERV];

    int err;

    if ((err = getnameinfo((struct sockaddr *)sa, salen,

                           host, sizeof(host),

                           serv, sizeof(serv),

                           NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {

        VNC_DEBUG("Cannot resolve address %d: %s\n",

                  err, gai_strerror(err));

        return NULL;

    }

    if (asprintf(&addr, format, host, serv) < 0)

        return NULL;

    return addr;

}


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

     }

+
+
+    sumscore = sumscore * CHECK_COUNT / check_count;
+
+    maxscore = maxscore * CHECK_COUNT / CHECK_BLOCK;

static int mpegts_probe(AVProbeData *p)

{

    const int size = p->buf_size;

    int maxscore = 0;

    int sumscore = 0;

    int i;

    int check_count = size / TS_FEC_PACKET_SIZE;

#define CHECK_COUNT 10

#define CHECK_BLOCK 100

    if (check_count < CHECK_COUNT)

        return 0;

    for (i = 0; i<check_count; i+=CHECK_BLOCK) {

        int left = FFMIN(check_count - i, CHECK_BLOCK);

        int score      = analyze(p->buf + TS_PACKET_SIZE     *i, TS_PACKET_SIZE     *left, TS_PACKET_SIZE     , NULL, 1);

        int dvhs_score = analyze(p->buf + TS_DVHS_PACKET_SIZE*i, TS_DVHS_PACKET_SIZE*left, TS_DVHS_PACKET_SIZE, NULL, 1);

        int fec_score  = analyze(p->buf + TS_FEC_PACKET_SIZE *i, TS_FEC_PACKET_SIZE *left, TS_FEC_PACKET_SIZE , NULL, 1);

        score = FFMAX3(score, dvhs_score, fec_score);

        sumscore += score;

        maxscore = FFMAX(maxscore, score);

    }

    sumscore = sumscore * CHECK_COUNT / check_count;

    maxscore = maxscore * CHECK_COUNT / CHECK_BLOCK;

    av_dlog(0, "TS score: %d %d\n", sumscore, maxscore);

    if      (sumscore > 6) return AVPROBE_SCORE_MAX   + sumscore - CHECK_COUNT;

    else if (maxscore > 6) return AVPROBE_SCORE_MAX/2 + sumscore - CHECK_COUNT;

    else

        return 0;

}


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

         m->m_len = pkt_len + 2;

+        memcpy(m->m_data + 2, pkt, pkt_len);
+
+
+
+        m->m_data += 2 + ETH_HLEN;

         m->m_len -= 2 + ETH_HLEN;

void slirp_input(const uint8_t *pkt, int pkt_len)

{

    struct mbuf *m;

    int proto;

    if (pkt_len < ETH_HLEN)

        return;

    proto = ntohs(*(uint16_t *)(pkt + 12));

    switch(proto) {

    case ETH_P_ARP:

        arp_input(pkt, pkt_len);

        break;

    case ETH_P_IP:

        m = m_get();

        if (!m)

            return;

        /* Note: we add to align the IP header */

        m->m_len = pkt_len + 2;

        memcpy(m->m_data + 2, pkt, pkt_len);

        m->m_data += 2 + ETH_HLEN;

        m->m_len -= 2 + ETH_HLEN;

        ip_input(m);

        break;

    default:

        break;


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static VirtIOBlockReq *virtio_blk_alloc_request(VirtIOBlock *s)

 {

     VirtIOBlockReq *req = g_slice_new(VirtIOBlockReq);
+
     req->dev = s;

     req->qiov.size = 0;

static VirtIOBlockReq *virtio_blk_alloc_request(VirtIOBlock *s)

{

    VirtIOBlockReq *req = g_slice_new(VirtIOBlockReq);

    req->dev = s;

    req->qiov.size = 0;

    req->next = NULL;

    req->elem = g_slice_new(VirtQueueElement);

    return req;

}


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

 {
+
+    uint64_t tmp;

+    uint64_t result;

+    DO_ABD(result, a, b, int8_t);

     DO_ABD(tmp, a >> 8, b >> 8, int8_t);

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

{

    uint64_t tmp;

    uint64_t result;

    DO_ABD(result, a, b, int8_t);

    DO_ABD(tmp, a >> 8, b >> 8, int8_t);

    result |= tmp << 16;

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

    result |= tmp << 32;

    DO_ABD(tmp, a >> 24, b >> 24, int8_t);

    result |= tmp << 48;

    return result;

}


--- a/source.c
+++ b/source.c
@@ -35,9 +35,9 @@
                       "size %u\n", __func__, offset, size);
         trace_gicv3_redist_badwrite(gicv3_redist_affid(cs), offset, data,
                                     size, attrs.secure);
+    } else {
+        trace_gicv3_redist_write(gicv3_redist_affid(cs), offset, data,
+                                 size, attrs.secure);
+    }
+    return r;
 }

MemTxResult gicv3_redist_write(void *opaque, hwaddr offset, uint64_t data,
                               unsigned size, MemTxAttrs attrs)
{
    GICv3State *s = opaque;
    GICv3CPUState *cs;
    MemTxResult r;
    int cpuidx;
    /* This region covers all the redistributor pages; there are
     * (for GICv3) two 64K pages per CPU. At the moment they are
     * all contiguous (ie in this one region), though we might later
     * want to allow splitting of redistributor pages into several
     * blocks so we can support more CPUs.
     */
    cpuidx = offset / 0x20000;
    offset %= 0x20000;
    assert(cpuidx < s->num_cpu);
    cs = &s->cpu[cpuidx];
    switch (size) {
    case 1:
        r = gicr_writeb(cs, offset, data, attrs);
        break;
    case 4:
        r = gicr_writel(cs, offset, data, attrs);
        break;
    case 8:
        r = gicr_writell(cs, offset, data, attrs);
        break;
    default:
        r = MEMTX_ERROR;
        break;
    }
    if (r == MEMTX_ERROR) {
        qemu_log_mask(LOG_GUEST_ERROR,
                      "%s: invalid guest write at offset " TARGET_FMT_plx
                      "size %u\n", __func__, offset, size);
        trace_gicv3_redist_badwrite(gicv3_redist_affid(cs), offset, data,
                                    size, attrs.secure);
    } else {
        trace_gicv3_redist_write(gicv3_redist_affid(cs), offset, data,
                                 size, attrs.secure);
    }
    return r;
}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
         .bs = bs,

         .offset         = offset,
+
+        .bytes          = bytes,
+
+        .is_write       = is_write,
+
         .co             = qemu_coroutine_self(),

         .serialising    = false,

static void tracked_request_begin(BdrvTrackedRequest *req,

                                  BlockDriverState *bs,

                                  int64_t offset,

                                  unsigned int bytes, bool is_write)

{

    *req = (BdrvTrackedRequest){

        .bs = bs,

        .offset         = offset,

        .bytes          = bytes,

        .is_write       = is_write,

        .co             = qemu_coroutine_self(),

        .serialising    = false,

        .overlap_offset = offset,

        .overlap_bytes  = bytes,

    };

    qemu_co_queue_init(&req->wait_queue);

    QLIST_INSERT_HEAD(&bs->tracked_requests, req, list);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline void RENAME(BEToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused)

 {

static inline void RENAME(BEToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused)

{

#if COMPILE_TEMPLATE_MMX

    __asm__ volatile(

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

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

        "1:                                         \n\t"

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

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

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

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

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

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

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

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

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

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

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

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

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

        " js                    1b                  \n\t"

        : : "g" ((x86_reg)-width), "r" (src1+width*2), "r" (src2+width*2), "r" (dstU+width), "r" (dstV+width)

        : "%"REG_a

    );

#else

    int i;

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

        dstU[i]= src1[2*i];

        dstV[i]= src2[2*i];

    }

#endif

}


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

             v += in[n + i] * filter_coeffs[idx + frac_pos];
+
+            idx += precision;
+
+            i++;
+
             v += in[n - i] * filter_coeffs[idx - frac_pos];

         }

void ff_acelp_interpolate(

        int16_t* out,

        const int16_t* in,

        const int16_t* filter_coeffs,

        int precision,

        int frac_pos,

        int filter_length,

        int length)

{

    int n, i;

    assert(pitch_delay_frac >= 0 && pitch_delay_frac < precision);

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

    {

        int idx = 0;

        int v = 0x4000;

        for(i=0; i<filter_length;)

        {

            /* The reference G.729 and AMR fixed point code performs clipping after

               each of the two following accumulations.

               Since clipping affects only the synthetic OVERFLOW test without

               causing an int type overflow, it was moved outside the loop. */

            /*  R(x):=ac_v[-k+x]

                v += R(n-i)*ff_acelp_interp_filter(t+6i)

                v += R(n+i+1)*ff_acelp_interp_filter(6-t+6i) */

            v += in[n + i] * filter_coeffs[idx + frac_pos];

            idx += precision;

            i++;

            v += in[n - i] * filter_coeffs[idx - frac_pos];

        }

        out[n] = av_clip_int16(v >> 15);

    }

}


--- a/source.c
+++ b/source.c
@@ -11,9 +11,9 @@
     virtio_tswap64s(vdev, &desc->addr);

     virtio_tswap32s(vdev, &desc->len);
+
+    virtio_tswap16s(vdev, &desc->flags);
+
+    virtio_tswap16s(vdev, &desc->next);

 }

static void vring_desc_read(VirtIODevice *vdev, VRingDesc *desc,

                            hwaddr desc_pa, int i)

{

    address_space_read(&address_space_memory, desc_pa + i * sizeof(VRingDesc),

                       MEMTXATTRS_UNSPECIFIED, (void *)desc, sizeof(VRingDesc));

    virtio_tswap64s(vdev, &desc->addr);

    virtio_tswap32s(vdev, &desc->len);

    virtio_tswap16s(vdev, &desc->flags);

    virtio_tswap16s(vdev, &desc->next);

}


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

     AcpiFacsDescriptorRev1 *facs = acpi_data_push(table_data, sizeof *facs);
+
+    memcpy(&facs->signature, "FACS", 4);

     facs->length = cpu_to_le32(sizeof(*facs));

build_facs(GArray *table_data, GArray *linker)

{

    AcpiFacsDescriptorRev1 *facs = acpi_data_push(table_data, sizeof *facs);

    memcpy(&facs->signature, "FACS", 4);

    facs->length = cpu_to_le32(sizeof(*facs));

}


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

     av_frame_free(&avctx->coded_frame);

+    return 0;
+
 }

static av_cold int bmp_encode_close(AVCodecContext *avctx)

{

    av_frame_free(&avctx->coded_frame);

    return 0;

}


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

                             size_t len) {

+    struct VncState *vs = (struct VncState *)transport;
+
+    int ret;
+
+

  retry:

static ssize_t vnc_tls_push(gnutls_transport_ptr_t transport,

                            const void *data,

                            size_t len) {

    struct VncState *vs = (struct VncState *)transport;

    int ret;

 retry:

    ret = send(vs->csock, data, len, 0);

    if (ret < 0) {

	if (errno == EINTR)

	    goto retry;

	return -1;

    }

    return ret;

}


static int vnc_refresh_lossy_rect(VncDisplay *vd, int x, int y)

{

    VncState *vs;

    int sty = y / VNC_STAT_RECT;

    int stx = x / VNC_STAT_RECT;

    int has_dirty = 0;

    y = y / VNC_STAT_RECT * VNC_STAT_RECT;

    x = x / VNC_STAT_RECT * VNC_STAT_RECT;

    QTAILQ_FOREACH(vs, &vd->clients, next) {

        int j;

        /* kernel send buffers are full -> refresh later */

        if (vs->output.offset) {

            continue;

        }

        if (!vs->lossy_rect[sty][stx]) {

            continue;

        }

        vs->lossy_rect[sty][stx] = 0;

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

            vnc_set_bits(vs->dirty[y + j], x / 16, VNC_STAT_RECT / 16);

        }

        has_dirty++;

    }

    return has_dirty;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void test_lifecycle(void)

 {
+
+    Coroutine *coroutine;

     bool done = false;

static void test_lifecycle(void)

{

    Coroutine *coroutine;

    bool done = false;

    /* Create, enter, and return from coroutine */

    coroutine = qemu_coroutine_create(set_and_exit);

    qemu_coroutine_enter(coroutine, &done);

    g_assert(done); /* expect done to be true (first time) */

    /* Repeat to check that no state affects this test */

    done = false;

    coroutine = qemu_coroutine_create(set_and_exit);

    qemu_coroutine_enter(coroutine, &done);

    g_assert(done); /* expect done to be true (second time) */

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+void tlb_reset_dirty_range(CPUTLBEntry *tlb_entry, uintptr_t start,
+
+                           uintptr_t length)
+
 {

     uintptr_t addr;

void tlb_reset_dirty_range(CPUTLBEntry *tlb_entry, uintptr_t start,

                           uintptr_t length)

{

    uintptr_t addr;

    if (tlb_is_dirty_ram(tlb_entry)) {

        addr = (tlb_entry->addr_write & TARGET_PAGE_MASK) + tlb_entry->addend;

        if ((addr - start) < length) {

            tlb_entry->addr_write |= TLB_NOTDIRTY;

        }

    }

}


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

     assert(bdrv_dirty_bitmap_enabled(bitmap));

+    hbitmap_set(bitmap->bitmap, cur_sector, nr_sectors);
+
 }

void bdrv_set_dirty_bitmap(BdrvDirtyBitmap *bitmap,

                           int64_t cur_sector, int64_t nr_sectors)

{

    assert(bdrv_dirty_bitmap_enabled(bitmap));

    hbitmap_set(bitmap->bitmap, cur_sector, nr_sectors);

}


--- a/source.c
+++ b/source.c
@@ -35,11 +35,11 @@
     ret = ff_draw_slice(link, 0, color->h, 1);

     if (ret < 0)
+
+        goto fail;
+
+
+
     ret = ff_end_frame(link);

static int color_request_frame(AVFilterLink *link)

{

    ColorContext *color = link->src->priv;

    AVFilterBufferRef *picref = ff_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h);

    int ret;

    picref->video->pixel_aspect = (AVRational) {1, 1};

    picref->pts                 = color->pts++;

    picref->pos                 = -1;

    ret = ff_start_frame(link, avfilter_ref_buffer(picref, ~0));

    if (ret < 0)

        goto fail;

    ff_draw_rectangle(picref->data, picref->linesize,

                      color->line, color->line_step, color->hsub, color->vsub,

                      0, 0, color->w, color->h);

    ret = ff_draw_slice(link, 0, color->h, 1);

    if (ret < 0)

        goto fail;

    ret = ff_end_frame(link);

fail:

    avfilter_unref_buffer(picref);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+int cpu_gen_code(CPUState *env, TranslationBlock *tb,

                  int max_code_size, int *gen_code_size_ptr)

int cpu_gen_code(CPUState *env, TranslationBlock *tb,

                 int max_code_size, int *gen_code_size_ptr)

{

    uint8_t *gen_code_buf;

    int gen_code_size;

    if (gen_intermediate_code(env, tb) < 0)

        return -1;

    /* generate machine code */

    tb->tb_next_offset[0] = 0xffff;

    tb->tb_next_offset[1] = 0xffff;

    gen_code_buf = tb->tc_ptr;

#ifdef USE_DIRECT_JUMP

    /* the following two entries are optional (only used for string ops) */

    tb->tb_jmp_offset[2] = 0xffff;

    tb->tb_jmp_offset[3] = 0xffff;

#endif

    dyngen_labels(gen_labels, nb_gen_labels, gen_code_buf, gen_opc_buf);

    gen_code_size = dyngen_code(gen_code_buf, tb->tb_next_offset,

#ifdef USE_DIRECT_JUMP

                                tb->tb_jmp_offset,

#else

                                NULL,

#endif

                                gen_opc_buf, gen_opparam_buf, gen_labels);

    *gen_code_size_ptr = gen_code_size;

#ifdef DEBUG_DISAS

    if (loglevel & CPU_LOG_TB_OUT_ASM) {

        fprintf(logfile, "OUT: [size=%d]\n", *gen_code_size_ptr);

        disas(logfile, tb->tc_ptr, *gen_code_size_ptr);

        fprintf(logfile, "\n");

        fflush(logfile);

    }

#endif

    return 0;

}


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

     default:

+    case FSR_RD_ZERO:
+
+        rnd_mode = float_round_to_zero;
+
+        break;

     case FSR_RD_POS:

static inline void set_fsr(CPUSPARCState *env)

{

    int rnd_mode;

    switch (env->fsr & FSR_RD_MASK) {

    case FSR_RD_NEAREST:

        rnd_mode = float_round_nearest_even;

        break;

    default:

    case FSR_RD_ZERO:

        rnd_mode = float_round_to_zero;

        break;

    case FSR_RD_POS:

        rnd_mode = float_round_up;

        break;

    case FSR_RD_NEG:

        rnd_mode = float_round_down;

        break;

    }

    set_float_rounding_mode(rnd_mode, &env->fp_status);

}


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

     case 1:

+	s->rregs[0] &= ~1;
+
+        clr_rxint(s);
+
+	if (s->type == kbd || s->type == mouse)

 	    ret = get_queue(s);

static uint32_t slavio_serial_mem_readb(void *opaque, target_phys_addr_t addr)

{

    SerialState *ser = opaque;

    ChannelState *s;

    uint32_t saddr;

    uint32_t ret;

    int channel;

    saddr = (addr & 3) >> 1;

    channel = (addr & SERIAL_MAXADDR) >> 2;

    s = &ser->chn[channel];

    switch (saddr) {

    case 0:

	SER_DPRINTF("Read channel %c, reg[%d] = %2.2x\n", CHN_C(s), s->reg, s->rregs[s->reg]);

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

	s->reg = 0;

	return ret;

    case 1:

	s->rregs[0] &= ~1;

        clr_rxint(s);

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

	    ret = get_queue(s);

	else

	    ret = s->rx;

	SER_DPRINTF("Read channel %c, ch %d\n", CHN_C(s), ret);

	return ret;

    default:

	break;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     XenPTMSI *msi = s->msi;

+
     if (!msi) {

         return;

void xen_pt_msi_disable(XenPCIPassthroughState *s)

{

    XenPTMSI *msi = s->msi;

    if (!msi) {

        return;

    }

    xen_pt_msi_set_enable(s, false);

    msi_msix_disable(s, msi_addr64(msi), msi->data, msi->pirq, false,

                     msi->initialized);

    /* clear msi info */

    msi->flags = 0;

    msi->mapped = false;

    msi->pirq = XEN_PT_UNASSIGNED_PIRQ;

}


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

                  0x00000000);

+    spr_register(env, SPR_DAR, "DAR",
+
+                 SPR_NOACCESS, SPR_NOACCESS,
+
+                 &spr_read_generic, &spr_write_generic,

                  0x00000000);

static void gen_spr_ne_601 (CPUPPCState *env)

{

    /* Exception processing */

    spr_register(env, SPR_DSISR, "DSISR",

                 SPR_NOACCESS, SPR_NOACCESS,

                 &spr_read_generic, &spr_write_generic,

                 0x00000000);

    spr_register(env, SPR_DAR, "DAR",

                 SPR_NOACCESS, SPR_NOACCESS,

                 &spr_read_generic, &spr_write_generic,

                 0x00000000);

    /* Timer */

    spr_register(env, SPR_DECR, "DECR",

                 SPR_NOACCESS, SPR_NOACCESS,

                 &spr_read_decr, &spr_write_decr,

                 0x00000000);

    /* Memory management */

    spr_register(env, SPR_SDR1, "SDR1",

                 SPR_NOACCESS, SPR_NOACCESS,

                 &spr_read_sdr1, &spr_write_sdr1,

                 0x00000000);

}


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

+    if (len == 2)
+
+        return avio_rl16(bc);
+
+    else if (len == 4)

         return avio_rl32(bc);

static uint64_t get_fourcc(AVIOContext *bc)

{

    unsigned int len = ffio_read_varlen(bc);

    if (len == 2)

        return avio_rl16(bc);

    else if (len == 4)

        return avio_rl32(bc);

    else

        return -1;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void fd_accept_incoming_migration(void *opaque)
+
+{
+
     QEMUFile *f = opaque;

static void fd_accept_incoming_migration(void *opaque)

{

    QEMUFile *f = opaque;

    qemu_set_fd_handler2(qemu_get_fd(f), NULL, NULL, NULL, NULL);

    process_incoming_migration(f);

}


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

                 retry = true;

+                break;
+
+            }
+
+        }

     } while (retry);

static void coroutine_fn wait_for_overlapping_requests(BlockDriverState *bs,

        int64_t offset, unsigned int bytes)

{

    BdrvTrackedRequest *req;

    int64_t cluster_offset;

    unsigned int cluster_bytes;

    bool retry;

    /* If we touch the same cluster it counts as an overlap.  This guarantees

     * that allocating writes will be serialized and not race with each other

     * for the same cluster.  For example, in copy-on-read it ensures that the

     * CoR read and write operations are atomic and guest writes cannot

     * interleave between them.

     */

    round_bytes_to_clusters(bs, offset, bytes, &cluster_offset, &cluster_bytes);

    do {

        retry = false;

        QLIST_FOREACH(req, &bs->tracked_requests, list) {

            if (tracked_request_overlaps(req, cluster_offset, cluster_bytes)) {

                /* Hitting this means there was a reentrant request, for

                 * example, a block driver issuing nested requests.  This must

                 * never happen since it means deadlock.

                 */

                assert(qemu_coroutine_self() != req->co);

                qemu_co_queue_wait(&req->wait_queue);

                retry = true;

                break;

            }

        }

    } while (retry);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void drive_backup_abort(BlkActionState *common)

+{
+
+    DriveBackupState *state = DO_UPCAST(DriveBackupState, common, common);

     BlockDriverState *bs = state->bs;

static void drive_backup_abort(BlkActionState *common)

{

    DriveBackupState *state = DO_UPCAST(DriveBackupState, common, common);

    BlockDriverState *bs = state->bs;

    /* Only cancel if it's the job we started */

    if (bs && bs->job && bs->job == state->job) {

        block_job_cancel_sync(bs->job);

    }

}


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

     unsigned int i, maxcycles;
+
     double duration;

+

     maxcycles = 100000000;

static void perf_yield(void)

{

    unsigned int i, maxcycles;

    double duration;

    maxcycles = 100000000;

    i = maxcycles;

    Coroutine *coroutine = qemu_coroutine_create(yield_loop);

    g_test_timer_start();

    while (i > 0) {

        qemu_coroutine_enter(coroutine, &i);

    }

    duration = g_test_timer_elapsed();

    g_test_message("Yield %u iterations: %f s\n",

        maxcycles, duration);

}


--- a/source.c
+++ b/source.c
@@ -35,11 +35,11 @@
         /* It's hugepage, return the huge page size */

         return fs.f_bsize;
+
+    }
+
+
+

size_t qemu_mempath_getpagesize(const char *mem_path)

{

#ifdef CONFIG_LINUX

    struct statfs fs;

    int ret;

    do {

        ret = statfs(mem_path, &fs);

    } while (ret != 0 && errno == EINTR);

    if (ret != 0) {

        fprintf(stderr, "Couldn't statfs() memory path: %s\n",

                strerror(errno));

        exit(1);

    }

    if (fs.f_type == HUGETLBFS_MAGIC) {

        /* It's hugepage, return the huge page size */

        return fs.f_bsize;

    }

    return getpagesize();

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     int32_t *dst = (int32_t *)_dst;
     DiracGolombLUT *future[4], *l = &lut_ctx[2*LUT_SIZE + buf[0]];
     INIT_RESIDUE(res);
+    for (b = 1; b <= bytes; b++) {
+        future[0] = &lut_ctx[buf[b]];
+        future[1] = future[0] + 1*LUT_SIZE;
+        future[2] = future[0] + 2*LUT_SIZE;
+        future[3] = future[0] + 3*LUT_SIZE;
         if ((c_idx + 1) > coeffs)
             return c_idx;
         /* res_bits is a hint for better branch prediction */

int ff_dirac_golomb_read_32bit(DiracGolombLUT *lut_ctx, const uint8_t *buf,
                               int bytes, uint8_t *_dst, int coeffs)
{
    int i, b, c_idx = 0;
    int32_t *dst = (int32_t *)_dst;
    DiracGolombLUT *future[4], *l = &lut_ctx[2*LUT_SIZE + buf[0]];
    INIT_RESIDUE(res);
    for (b = 1; b <= bytes; b++) {
        future[0] = &lut_ctx[buf[b]];
        future[1] = future[0] + 1*LUT_SIZE;
        future[2] = future[0] + 2*LUT_SIZE;
        future[3] = future[0] + 3*LUT_SIZE;
        if ((c_idx + 1) > coeffs)
            return c_idx;
        /* res_bits is a hint for better branch prediction */
        if (res_bits && l->sign) {
            int32_t coeff = 1;
            APPEND_RESIDUE(res, l->preamble);
            for (i = 0; i < (res_bits >> 1) - 1; i++) {
                coeff <<= 1;
                coeff |= (res >> (RSIZE_BITS - 2*i - 2)) & 1;
            }
            dst[c_idx++] = l->sign * (coeff - 1);
        }
        memcpy(&dst[c_idx], l->ready, LUT_BITS*sizeof(int32_t));
        c_idx += l->ready_num;
        APPEND_RESIDUE(res, l->leftover);
        l = future[l->need_s ? 3 : !res_bits ? 2 : res_bits & 1];
    }
    return c_idx;
}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static gboolean register_signal_handlers(void)
+
 {

     struct sigaction sigact, sigact_chld;

+    int ret;
+

     memset(&sigact, 0, sizeof(struct sigaction));
@@ -13,10 +13,10 @@
     sigact.sa_handler = quit_handler;

+
+    ret = sigaction(SIGINT, &sigact, NULL);
+
+    if (ret == -1) {

         g_error("error configuring signal handler: %s", strerror(errno));

static gboolean register_signal_handlers(void)

{

    struct sigaction sigact, sigact_chld;

    int ret;

    memset(&sigact, 0, sizeof(struct sigaction));

    sigact.sa_handler = quit_handler;

    ret = sigaction(SIGINT, &sigact, NULL);

    if (ret == -1) {

        g_error("error configuring signal handler: %s", strerror(errno));

        return false;

    }

    ret = sigaction(SIGTERM, &sigact, NULL);

    if (ret == -1) {

        g_error("error configuring signal handler: %s", strerror(errno));

        return false;

    }

    memset(&sigact_chld, 0, sizeof(struct sigaction));

    sigact_chld.sa_handler = child_handler;

    sigact_chld.sa_flags = SA_NOCLDSTOP;

    ret = sigaction(SIGCHLD, &sigact_chld, NULL);

    if (ret == -1) {

        g_error("error configuring signal handler: %s", strerror(errno));

    }

    return true;

}


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

     v9fs_wstat_post_chown(s, vs, err);
+
+    return;
+
+
+
 out:

     v9fs_stat_free(&vs->v9stat);

static void v9fs_wstat_post_utime(V9fsState *s, V9fsWstatState *vs, int err)

{

    if (err < 0) {

        goto out;

    }

    if (vs->v9stat.n_gid != -1) {

        if (v9fs_do_chown(s, &vs->fidp->path, vs->v9stat.n_uid,

                    vs->v9stat.n_gid)) {

            err = -errno;

        }

    }

    v9fs_wstat_post_chown(s, vs, err);

    return;

out:

    v9fs_stat_free(&vs->v9stat);

    complete_pdu(s, vs->pdu, err);

    qemu_free(vs);

}


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

     if (OpenProcessToken(GetCurrentProcess(),
+
+        TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, &token))
+
+    {
+
         if (!LookupPrivilegeValue(NULL, name, &priv.Privileges[0].Luid)) {

             error_setg(&local_err, QERR_QGA_COMMAND_FAILED,

static void acquire_privilege(const char *name, Error **errp)

{

    HANDLE token = NULL;

    TOKEN_PRIVILEGES priv;

    Error *local_err = NULL;

    if (OpenProcessToken(GetCurrentProcess(),

        TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, &token))

    {

        if (!LookupPrivilegeValue(NULL, name, &priv.Privileges[0].Luid)) {

            error_setg(&local_err, QERR_QGA_COMMAND_FAILED,

                       "no luid for requested privilege");

            goto out;

        }

        priv.PrivilegeCount = 1;

        priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;

        if (!AdjustTokenPrivileges(token, FALSE, &priv, 0, NULL, 0)) {

            error_setg(&local_err, QERR_QGA_COMMAND_FAILED,

                       "unable to acquire requested privilege");

            goto out;

        }

    } else {

        error_setg(&local_err, QERR_QGA_COMMAND_FAILED,

                   "failed to open privilege token");

    }

out:

    if (token) {

        CloseHandle(token);

    }

    if (local_err) {

        error_propagate(errp, local_err);

    }

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
     Error *err = NULL;

+
+    v = validate_test_init(data, "{ 'type': 'integer', 'data' : [ 1, 2 ] }");
+
+
+
     visit_type_UserDefNativeListUnion(v, &tmp, NULL, &err);

     g_assert(!err);

static void test_validate_union_native_list(TestInputVisitorData *data,

                                            const void *unused)

{

    UserDefNativeListUnion *tmp = NULL;

    Visitor *v;

    Error *err = NULL;

    v = validate_test_init(data, "{ 'type': 'integer', 'data' : [ 1, 2 ] }");

    visit_type_UserDefNativeListUnion(v, &tmp, NULL, &err);

    g_assert(!err);

    qapi_free_UserDefNativeListUnion(tmp);

}


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

     } else {

+        h->s.dsp.h264_v_loop_filter_luma_intra(pix, stride, alpha, beta);
+
+    }
+
+}

static void filter_mb_edgeh( H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int qp ) {

    int i, d;

    const int index_a = qp + h->slice_alpha_c0_offset;

    const int alpha = (alpha_table+52)[index_a];

    const int beta  = (beta_table+52)[qp + h->slice_beta_offset];

    const int pix_next  = stride;

    if( bS[0] < 4 ) {

        int8_t tc[4];

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

            tc[i] = bS[i] ? (tc0_table+52)[index_a][bS[i] - 1] : -1;

        h->s.dsp.h264_v_loop_filter_luma(pix, stride, alpha, beta, tc);

    } else {

        h->s.dsp.h264_v_loop_filter_luma_intra(pix, stride, alpha, beta);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
+int tpm_register_driver(const TPMDriverOps *tdo)
+
+{
+
+    int i;
+

+    for (i = 0; i < TPM_MAX_DRIVERS; i++) {
+
         if (!be_drivers[i]) {

             be_drivers[i] = tdo;

int tpm_register_driver(const TPMDriverOps *tdo)

{

    int i;

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

        if (!be_drivers[i]) {

            be_drivers[i] = tdo;

            return 0;

        }

    }

    error_report("Could not register TPM driver");

    return 1;

}


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

         ehci_set_state(q->ehci, async, EST_EXECUTE);

+        again = 1;
+
+    } else {
+
+        ehci_set_state(q->ehci, async, EST_HORIZONTALQH);

         again = 1;

static int ehci_state_fetchqtd(EHCIQueue *q, int async)

{

    int again = 0;

    get_dwords(NLPTR_GET(q->qtdaddr),(uint32_t *) &q->qtd, sizeof(EHCIqtd) >> 2);

    ehci_trace_qtd(q, NLPTR_GET(q->qtdaddr), &q->qtd);

    if (q->qtd.token & QTD_TOKEN_ACTIVE) {

        ehci_set_state(q->ehci, async, EST_EXECUTE);

        again = 1;

    } else {

        ehci_set_state(q->ehci, async, EST_HORIZONTALQH);

        again = 1;

    }

    return again;

}


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

             return vlan;

+    }
+
+    if (!allocate) {
+
+        return NULL;

     }

VLANState *qemu_find_vlan(int id, int allocate)

{

    VLANState **pvlan, *vlan;

    for(vlan = first_vlan; vlan != NULL; vlan = vlan->next) {

        if (vlan->id == id)

            return vlan;

    }

    if (!allocate) {

        return NULL;

    }

    vlan = qemu_mallocz(sizeof(VLANState));

    vlan->id = id;

    TAILQ_INIT(&vlan->send_queue);

    vlan->next = NULL;

    pvlan = &first_vlan;

    while (*pvlan != NULL)

        pvlan = &(*pvlan)->next;

    *pvlan = vlan;

    return vlan;

}


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

                                                 uint8_t *dst,

+                                                int32_t dst_stride)
+
+{
+
     avc_luma_mid_and_aver_dst_8w_msa(src, src_stride, dst, dst_stride, 16);

     avc_luma_mid_and_aver_dst_8w_msa(src + 8, src_stride, dst + 8, dst_stride,

static void avc_luma_mid_and_aver_dst_16x16_msa(const uint8_t *src,

                                                int32_t src_stride,

                                                uint8_t *dst,

                                                int32_t dst_stride)

{

    avc_luma_mid_and_aver_dst_8w_msa(src, src_stride, dst, dst_stride, 16);

    avc_luma_mid_and_aver_dst_8w_msa(src + 8, src_stride, dst + 8, dst_stride,

                                     16);

}


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

 {

+    flag aSign;

     int32 aExp, shiftCount;

int32 float128_to_int32_round_to_zero( float128 a STATUS_PARAM )

{

    flag aSign;

    int32 aExp, shiftCount;

    uint64_t aSig0, aSig1, savedASig;

    int32 z;

    aSig1 = extractFloat128Frac1( a );

    aSig0 = extractFloat128Frac0( a );

    aExp = extractFloat128Exp( a );

    aSign = extractFloat128Sign( a );

    aSig0 |= ( aSig1 != 0 );

    if ( 0x401E < aExp ) {

        if ( ( aExp == 0x7FFF ) && aSig0 ) aSign = 0;

        goto invalid;

    }

    else if ( aExp < 0x3FFF ) {

        if ( aExp || aSig0 ) STATUS(float_exception_flags) |= float_flag_inexact;

        return 0;

    }

    aSig0 |= LIT64( 0x0001000000000000 );

    shiftCount = 0x402F - aExp;

    savedASig = aSig0;

    aSig0 >>= shiftCount;

    z = aSig0;

    if ( aSign ) z = - z;

    if ( ( z < 0 ) ^ aSign ) {

 invalid:

        float_raise( float_flag_invalid STATUS_VAR);

        return aSign ? (int32_t) 0x80000000 : 0x7FFFFFFF;

    }

    if ( ( aSig0<<shiftCount ) != savedASig ) {

        STATUS(float_exception_flags) |= float_flag_inexact;

    }

    return z;

}


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

     UINT8 header[FRAME_HEADER_SIZE];

+    int duration;

static int ffm_write_packet(AVFormatContext *s, int stream_index,

                            UINT8 *buf, int size, int force_pts)

{

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

    FFMStream *fst = st->priv_data;

    INT64 pts;

    UINT8 header[FRAME_HEADER_SIZE];

    int duration;

    if (st->codec.codec_type == CODEC_TYPE_AUDIO) {

        duration = ((float)st->codec.frame_size / st->codec.sample_rate * 1000000.0);

    } else {

        duration = (1000000.0 * FRAME_RATE_BASE / (float)st->codec.frame_rate);

    }

    pts = fst->pts;

    /* packet size & key_frame */

    header[0] = stream_index;

    header[1] = 0;

    if (st->codec.coded_picture->key_frame)

        header[1] |= FLAG_KEY_FRAME;

    header[2] = (size >> 16) & 0xff;

    header[3] = (size >> 8) & 0xff;

    header[4] = size & 0xff;

    header[5] = (duration >> 16) & 0xff;

    header[6] = (duration >> 8) & 0xff;

    header[7] = duration & 0xff;

    ffm_write_data(s, header, FRAME_HEADER_SIZE, pts, 1);

    ffm_write_data(s, buf, size, pts, 0);

    fst->pts += duration;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void blk_io_limits_disable(BlockBackend *blk)
+
+{
+
+    assert(blk->public.throttle_group_member.throttle_state);

     bdrv_drained_begin(blk_bs(blk));

void blk_io_limits_disable(BlockBackend *blk)

{

    assert(blk->public.throttle_group_member.throttle_state);

    bdrv_drained_begin(blk_bs(blk));

    throttle_group_unregister_tgm(&blk->public.throttle_group_member);

    bdrv_drained_end(blk_bs(blk));

}


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

 {

+    AVCodecContext *codec = s->streams[0]->codec;
+
+
+
+    if (s->nb_streams > 1) {

         av_log(s, AV_LOG_ERROR, "only one stream is supported\n");

static int write_header(AVFormatContext *s)

{

    AVCodecContext *codec = s->streams[0]->codec;

    if (s->nb_streams > 1) {

        av_log(s, AV_LOG_ERROR, "only one stream is supported\n");

        return AVERROR(EINVAL);

    }

    if (codec->codec_id != AV_CODEC_ID_WAVPACK) {

        av_log(s, AV_LOG_ERROR, "unsupported codec\n");

        return AVERROR(EINVAL);

    }

    if (codec->extradata_size > 0) {

        avpriv_report_missing_feature(s, "remuxing from matroska container");

        return AVERROR_PATCHWELCOME;

    }

    avpriv_set_pts_info(s->streams[0], 64, 1, codec->sample_rate);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void *qemu_blockalign(BlockDriverState *bs, size_t size)
+
 {

     return qemu_memalign((bs && bs->buffer_alignment) ? bs->buffer_alignment : 512, size);

void *qemu_blockalign(BlockDriverState *bs, size_t size)

{

    return qemu_memalign((bs && bs->buffer_alignment) ? bs->buffer_alignment : 512, size);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static void decode_rowskip(uint8_t* plane, int width, int height, int stride, VC9Context *v){

+    int x, y;

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

static void decode_rowskip(uint8_t* plane, int width, int height, int stride, VC9Context *v){

    int x, y;

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

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

        if (!get_bits(gb, 1)) //rowskip

            memset(plane, 0, width);

        else

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

                plane[x] = get_bits(gb, 1);

        plane += stride;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void test_init(void)

 {
+
+    uint64_t barsize;

static void test_init(void)

{

    uint64_t barsize;

    dev = get_device();

    dev_base = qpci_iomap(dev, 0, &barsize);

    g_assert(dev_base != NULL);

    qpci_device_enable(dev);

    test_timer();

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void apply_mdct(AC3EncodeContext *s)

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

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

static void apply_mdct(AC3EncodeContext *s)

{

    int blk, ch;

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

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

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

            const SampleType *input_samples = &s->planar_samples[ch][blk * AC3_BLOCK_SIZE];

            apply_window(&s->dsp, s->windowed_samples, input_samples, s->mdct.window, AC3_WINDOW_SIZE);

            block->coeff_shift[ch] = normalize_samples(s);

            mdct512(&s->mdct, block->mdct_coef[ch], s->windowed_samples);

        }

    }

}


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

         (sas_ss_flags(oldsp))) {

+        oldsp = (target_sigaltstack_used.ss_sp
+
+                 + target_sigaltstack_used.ss_size);
+
+    }

static target_ulong get_sigframe(struct target_sigaction *ka,

                                 CPUPPCState *env,

                                 int frame_size)

{

    target_ulong oldsp, newsp;

    oldsp = env->gpr[1];

    if ((ka->sa_flags & TARGET_SA_ONSTACK) &&

        (sas_ss_flags(oldsp))) {

        oldsp = (target_sigaltstack_used.ss_sp

                 + target_sigaltstack_used.ss_size);

    }

    newsp = (oldsp - frame_size) & ~0xFUL;

    return newsp;

}


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

     TCGLabel *l = &s->labels[label_index];

+    uint64_t imm;
+
+
+
+    /* We pay attention here to not modify the branch target by reading

        the existing value and using it again. This ensure that caches and

static inline void tcg_out_brcond(TCGContext *s, TCGCond cond, TCGReg arg1,

                                  TCGReg arg2, int label_index, int cmp4)

{

    TCGLabel *l = &s->labels[label_index];

    uint64_t imm;

    /* We pay attention here to not modify the branch target by reading

       the existing value and using it again. This ensure that caches and

       memory are kept coherent during retranslation. */

    if (l->has_value) {

        imm = l->u.value_ptr - s->code_ptr;

    } else {

        imm = get_reloc_pcrel21b_slot2(s->code_ptr);

        tcg_out_reloc(s, s->code_ptr, R_IA64_PCREL21B, label_index, 0);

    }

    tcg_out_bundle(s, miB,

                   INSN_NOP_M,

                   tcg_opc_cmp_a(TCG_REG_P0, cond, arg1, arg2, cmp4),

                   tcg_opc_b1(TCG_REG_P6, OPC_BR_DPTK_FEW_B1, imm));

}


static void spapr_cpu_reset(void *opaque)

{

    PowerPCCPU *cpu = opaque;

    CPUState *cs = CPU(cpu);

    CPUPPCState *env = &cpu->env;

    cpu_reset(cs);

    /* All CPUs start halted.  CPU0 is unhalted from the machine level

     * reset code and the rest are explicitly started up by the guest

     * using an RTAS call */

    cs->halted = 1;

    env->spr[SPR_HIOR] = 0;

    env->external_htab = (uint8_t *)spapr->htab;

    if (kvm_enabled() && !env->external_htab) {

        /*

         * HV KVM, set external_htab to 1 so our ppc_hash64_load_hpte*

         * functions do the right thing.

         */

        env->external_htab = (void *)1;

    }

    env->htab_base = -1;

    env->htab_mask = HTAB_SIZE(spapr) - 1;

    env->spr[SPR_SDR1] = (target_ulong)(uintptr_t)spapr->htab |

        (spapr->htab_shift - 18);

}


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

     case 3:
+
+        gen_helper_fcmpq_fcc3(cpu_env);
+
+        break;
+
     }

 }

static inline void gen_op_fcmpq(int fccno)

{

    switch (fccno) {

    case 0:

        gen_helper_fcmpq(cpu_env);

        break;

    case 1:

        gen_helper_fcmpq_fcc1(cpu_env);

        break;

    case 2:

        gen_helper_fcmpq_fcc2(cpu_env);

        break;

    case 3:

        gen_helper_fcmpq_fcc3(cpu_env);

        break;

    }

}


void do_subfmeo_64 (void)

{

    T1 = T0;

    T0 = ~T0 + xer_ca - 1;

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

                 (1ULL << 63)))) {

        xer_ov = 0;

    } else {

        xer_so = 1;

        xer_ov = 1;

    }

    if (likely((uint64_t)T1 != UINT64_MAX))

        xer_ca = 1;

}


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

     dev->auto_attach = 1;

+    QLIST_INIT(&dev->strings);
+
+    rc = dev->info->init(dev);
+
+    if (rc == 0 && dev->auto_attach)

         rc = usb_device_attach(dev);

static int usb_qdev_init(DeviceState *qdev, DeviceInfo *base)

{

    USBDevice *dev = DO_UPCAST(USBDevice, qdev, qdev);

    USBDeviceInfo *info = DO_UPCAST(USBDeviceInfo, qdev, base);

    int rc;

    pstrcpy(dev->product_desc, sizeof(dev->product_desc), info->product_desc);

    dev->info = info;

    dev->auto_attach = 1;

    QLIST_INIT(&dev->strings);

    rc = dev->info->init(dev);

    if (rc == 0 && dev->auto_attach)

        rc = usb_device_attach(dev);

    return rc;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int cmd_valid_while_locked(SDState *sd, SDRequest *req)
+
 {

     /* Valid commands in locked state:

static int cmd_valid_while_locked(SDState *sd, SDRequest *req)

{

    /* Valid commands in locked state:

     * basic class (0)

     * lock card class (7)

     * CMD16

     * implicitly, the ACMD prefix CMD55

     * ACMD41 and ACMD42

     * Anything else provokes an "illegal command" response.

     */

    if (sd->card_status & APP_CMD) {

        return req->cmd == 41 || req->cmd == 42;

    }

    if (req->cmd == 16 || req->cmd == 55) {

        return 1;

    }

    return sd_cmd_class[req->cmd] == 0 || sd_cmd_class[req->cmd] == 7;

}


--- a/source.c
+++ b/source.c
@@ -29,11 +29,11 @@
             s->bd_addr.b[3] = data[offset + 0];

             s->bd_addr.b[4] = data[offset + 3];
+
+            s->bd_addr.b[5] = data[offset + 2];
+
+
+
             s->hci->bdaddr_set(s->hci, s->bd_addr.b);

             fprintf(stderr, "%s: bd_address loaded from firmware: "

static void csrhci_in_packet_vendor(struct csrhci_s *s, int ocf,

                uint8_t *data, int len)

{

    int offset;

    uint8_t *rpkt;

    switch (ocf) {

    case OCF_CSR_SEND_FIRMWARE:

        /* Check if this is the bd_address packet */

        if (len >= 18 + 8 && data[12] == 0x01 && data[13] == 0x00) {

            offset = 18;

            s->bd_addr.b[0] = data[offset + 7];	/* Beyond cmd packet end(!?) */

            s->bd_addr.b[1] = data[offset + 6];

            s->bd_addr.b[2] = data[offset + 4];

            s->bd_addr.b[3] = data[offset + 0];

            s->bd_addr.b[4] = data[offset + 3];

            s->bd_addr.b[5] = data[offset + 2];

            s->hci->bdaddr_set(s->hci, s->bd_addr.b);

            fprintf(stderr, "%s: bd_address loaded from firmware: "

                            "%02x:%02x:%02x:%02x:%02x:%02x\n", __FUNCTION__,

                            s->bd_addr.b[0], s->bd_addr.b[1], s->bd_addr.b[2],

                            s->bd_addr.b[3], s->bd_addr.b[4], s->bd_addr.b[5]);

        }

        rpkt = csrhci_out_packet_event(s, EVT_VENDOR, 11);

        /* Status bytes: no error */

        rpkt[9] = 0x00;

        rpkt[10] = 0x00;

        break;

    default:

        fprintf(stderr, "%s: got a bad CMD packet\n", __FUNCTION__);

        return;

    }

    csrhci_fifo_wake(s);

}


--- 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
@@ -11,7 +11,7 @@
     case 2: gen_helper_neon_narrow_sat_u32(dest, cpu_env, src); break;

     default: abort();
+
+    }
+
+}

static inline void gen_neon_narrow_satu(int size, TCGv dest, TCGv src)

{

    switch (size) {

    case 0: gen_helper_neon_narrow_sat_u8(dest, cpu_env, src); break;

    case 1: gen_helper_neon_narrow_sat_u16(dest, cpu_env, src); break;

    case 2: gen_helper_neon_narrow_sat_u32(dest, cpu_env, src); break;

    default: abort();

    }

}


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

+    pc_dimm_memory_unplug(dev, &pcms->hotplug_memory, mr);
+
+    object_unparent(OBJECT(dev));
+
+

  out:

static void pc_dimm_unplug(HotplugHandler *hotplug_dev,

                           DeviceState *dev, Error **errp)

{

    PCMachineState *pcms = PC_MACHINE(hotplug_dev);

    PCDIMMDevice *dimm = PC_DIMM(dev);

    PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);

    MemoryRegion *mr = ddc->get_memory_region(dimm);

    HotplugHandlerClass *hhc;

    Error *local_err = NULL;

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

        error_setg(&local_err,

                   "nvdimm device hot unplug is not supported yet.");

        goto out;

    }

    hhc = HOTPLUG_HANDLER_GET_CLASS(pcms->acpi_dev);

    hhc->unplug(HOTPLUG_HANDLER(pcms->acpi_dev), dev, &local_err);

    if (local_err) {

        goto out;

    }

    pc_dimm_memory_unplug(dev, &pcms->hotplug_memory, mr);

    object_unparent(OBJECT(dev));

 out:

    error_propagate(errp, local_err);

}


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

     s->avctx = avctx;
+
     s->frame_number = -1;

static av_cold int dirac_decode_init(AVCodecContext *avctx)

{

    DiracContext *s = avctx->priv_data;

    int i;

    s->avctx = avctx;

    s->frame_number = -1;

    if (avctx->flags&CODEC_FLAG_EMU_EDGE) {

        av_log(avctx, AV_LOG_ERROR, "Edge emulation not supported!\n");

        return AVERROR_PATCHWELCOME;

    }

    ff_dsputil_init(&s->dsp, avctx);

    ff_diracdsp_init(&s->diracdsp);

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

        s->all_frames[i].avframe = av_frame_alloc();

    return 0;

}


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

                      int xBase, int yBase, int log2_cb_size)

+{

     int qp_y = get_qPy_pred(s, xC, yC, xBase, yBase, log2_cb_size);

void ff_hevc_set_qPy(HEVCContext *s, int xC, int yC,

                     int xBase, int yBase, int log2_cb_size)

{

    int qp_y = get_qPy_pred(s, xC, yC, xBase, yBase, log2_cb_size);

    if (s->HEVClc->tu.cu_qp_delta != 0) {

        int off = s->sps->qp_bd_offset;

        s->HEVClc->qp_y = ((qp_y + s->HEVClc->tu.cu_qp_delta + 52 + 2 * off) %

                          (52 + off)) - off;

    } else

        s->HEVClc->qp_y = qp_y;

}


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

     if (pci_get_word(pdev->config + PCI_VENDOR_ID) != PCI_VENDOR_ID_REALTEK ||

+        pci_get_word(pdev->config + PCI_DEVICE_ID) != 0x8168 || nr != 2) {

         return;

static void vfio_probe_rtl8168_bar2_window_quirk(VFIOPCIDevice *vdev, int nr)

{

    PCIDevice *pdev = &vdev->pdev;

    VFIOQuirk *quirk;

    if (pci_get_word(pdev->config + PCI_VENDOR_ID) != PCI_VENDOR_ID_REALTEK ||

        pci_get_word(pdev->config + PCI_DEVICE_ID) != 0x8168 || nr != 2) {

        return;

    }

    quirk = g_malloc0(sizeof(*quirk));

    quirk->vdev = vdev;

    quirk->data.bar = nr;

    memory_region_init_io(&quirk->mem, OBJECT(vdev), &vfio_rtl8168_window_quirk,

                          quirk, "vfio-rtl8168-window-quirk", 8);

    memory_region_add_subregion_overlap(&vdev->bars[nr].region.mem,

                                        0x70, &quirk->mem, 1);

    QLIST_INSERT_HEAD(&vdev->bars[nr].quirks, quirk, next);

    trace_vfio_probe_rtl8168_bar2_window_quirk(vdev->vbasedev.name);

}


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

     const int size = p->buf_size;
+
+    int score, fec_score, dvhs_score;
+
     int check_count = size / TS_FEC_PACKET_SIZE;

 #define CHECK_COUNT 10

static int mpegts_probe(AVProbeData *p)

{

    const int size = p->buf_size;

    int score, fec_score, dvhs_score;

    int check_count = size / TS_FEC_PACKET_SIZE;

#define CHECK_COUNT 10

    if (check_count < CHECK_COUNT)

        return AVERROR_INVALIDDATA;

    score = analyze(p->buf, TS_PACKET_SIZE * check_count,

                    TS_PACKET_SIZE, NULL) * CHECK_COUNT / check_count;

    dvhs_score = analyze(p->buf, TS_DVHS_PACKET_SIZE * check_count,

                         TS_DVHS_PACKET_SIZE, NULL) * CHECK_COUNT / check_count;

    fec_score = analyze(p->buf, TS_FEC_PACKET_SIZE * check_count,

                        TS_FEC_PACKET_SIZE, NULL) * CHECK_COUNT / check_count;

    av_dlog(NULL, "score: %d, dvhs_score: %d, fec_score: %d \n",

            score, dvhs_score, fec_score);

    /* we need a clear definition for the returned score otherwise

     * things will become messy sooner or later */

    if (score > fec_score && score > dvhs_score && score > 6)

        return AVPROBE_SCORE_MAX + score - CHECK_COUNT;

    else if (dvhs_score > score && dvhs_score > fec_score && dvhs_score > 6)

        return AVPROBE_SCORE_MAX + dvhs_score - CHECK_COUNT;

    else if (fec_score > 6)

        return AVPROBE_SCORE_MAX + fec_score - CHECK_COUNT;

    else

        return AVERROR_INVALIDDATA;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 int ff_avc_parse_nal_units(AVIOContext *pb, const uint8_t *buf_in, int size)

 {
+
+    const uint8_t *p = buf_in;
+
+    const uint8_t *end = p + size;
+
     const uint8_t *nal_start, *nal_end;

int ff_avc_parse_nal_units(AVIOContext *pb, const uint8_t *buf_in, int size)

{

    const uint8_t *p = buf_in;

    const uint8_t *end = p + size;

    const uint8_t *nal_start, *nal_end;

    size = 0;

    nal_start = ff_avc_find_startcode(p, end);

    while (nal_start < end) {

        while(!*(nal_start++));

        nal_end = ff_avc_find_startcode(nal_start, end);

        avio_wb32(pb, nal_end - nal_start);

        avio_write(pb, nal_start, nal_end - nal_start);

        size += 4 + nal_end - nal_start;

        nal_start = nal_end;

    }

    return size;

}


--- a/source.c
+++ b/source.c
@@ -27,11 +27,11 @@
     nb_streams = 0;
     if (c->stream)
         nb_streams = c->stream->nb_streams;
+    for(i=0;i<nb_streams;i++) {
+        ctx = c->rtp_ctx[i];
+        if (ctx) {
+            av_free(ctx);
+        h = c->rtp_handles[i];
         if (h) {
             url_close(h);
     if (c->stream)

static void close_connection(HTTPContext *c)
{
    HTTPContext **cp, *c1;
    int i, nb_streams;
    AVFormatContext *ctx;
    URLContext *h;
    AVStream *st;
    /* remove connection from list */
    cp = &first_http_ctx;
    while ((*cp) != NULL) {
        c1 = *cp;
        if (c1 == c) {
            *cp = c->next;
        } else {
            cp = &c1->next;
    /* remove connection associated resources */
    if (c->fd >= 0)
        close(c->fd);
    if (c->fmt_in) {
        /* close each frame parser */
        for(i=0;i<c->fmt_in->nb_streams;i++) {
            st = c->fmt_in->streams[i];
            if (st->codec.codec) {
                avcodec_close(&st->codec);
        av_close_input_file(c->fmt_in);
    /* free RTP output streams if any */
    nb_streams = 0;
    if (c->stream)
        nb_streams = c->stream->nb_streams;
    for(i=0;i<nb_streams;i++) {
        ctx = c->rtp_ctx[i];
        if (ctx) {
            av_free(ctx);
        h = c->rtp_handles[i];
        if (h) {
            url_close(h);
    if (c->stream)
        current_bandwidth -= c->stream->bandwidth;
    av_freep(&c->pb_buffer);
    av_free(c->buffer);
    av_free(c);
    nb_connections--;


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     buf = av_mallocz(sizeof(*buf));

     if (!buf) {
+
+        av_buffer_unref(&ret);
+
+        return NULL;
+
     }

static AVBufferRef *pool_alloc_buffer(AVBufferPool *pool)

{

    BufferPoolEntry *buf;

    AVBufferRef     *ret;

    ret = pool->alloc(pool->size);

    if (!ret)

        return NULL;

    buf = av_mallocz(sizeof(*buf));

    if (!buf) {

        av_buffer_unref(&ret);

        return NULL;

    }

    buf->data   = ret->buffer->data;

    buf->opaque = ret->buffer->opaque;

    buf->free   = ret->buffer->free;

    buf->pool   = pool;

    ret->buffer->opaque = buf;

    ret->buffer->free   = pool_release_buffer;

    avpriv_atomic_int_add_and_fetch(&pool->refcount, 1);

    return ret;

}


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

+
     seqlock_write_begin(&head->sequence);

     do {

static void qht_bucket_reset__locked(struct qht_bucket *head)

{

    struct qht_bucket *b = head;

    int i;

    seqlock_write_begin(&head->sequence);

    do {

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

            if (b->pointers[i] == NULL) {

                goto done;

            }

            b->hashes[i] = 0;

            atomic_set(&b->pointers[i], NULL);

        }

        b = b->next;

    } while (b);

 done:

    seqlock_write_end(&head->sequence);

}


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

     uint64_t l = x * (mantissa & 0xffffffff);
+
     uint64_t h = x * (mantissa >> 32);

     h += l >> 32;

static uint32_t softfloat_mul(uint32_t x, uint64_t mantissa)

{

    uint64_t l = x * (mantissa & 0xffffffff);

    uint64_t h = x * (mantissa >> 32);

    h += l >> 32;

    l &= 0xffffffff;

    l += 1 << av_log2(h >> 21);

    h += l >> 32;

    return h >> 20;

}


--- a/source.c
+++ b/source.c
@@ -1,22 +1,22 @@
+static int read_rle_sgi(unsigned char* out_buf, const uint8_t *in_buf,

                         const uint8_t *in_end, SgiState* s)
+
 {

+    uint8_t *dest_row;

     unsigned int len = s->height * s->depth * 4;
+
     const uint8_t *start_table = in_buf;

     unsigned int y, z;

+    unsigned int start_offset;
+
+

+    /* size of  RLE offset and length tables */

     if(len * 2  > in_end - in_buf) {

static int read_rle_sgi(unsigned char* out_buf, const uint8_t *in_buf,

                        const uint8_t *in_end, SgiState* s)

{

    uint8_t *dest_row;

    unsigned int len = s->height * s->depth * 4;

    const uint8_t *start_table = in_buf;

    unsigned int y, z;

    unsigned int start_offset;

    /* size of  RLE offset and length tables */

    if(len * 2  > in_end - in_buf) {

        return AVERROR_INVALIDDATA;

    }

    in_buf -= SGI_HEADER_SIZE;

    for (z = 0; z < s->depth; z++) {

        dest_row = out_buf;

        for (y = 0; y < s->height; y++) {

            dest_row -= s->linesize;

            start_offset = bytestream_get_be32(&start_table);

            if(start_offset > in_end - in_buf) {

                return AVERROR_INVALIDDATA;

            }

            if (expand_rle_row(in_buf + start_offset, in_end, dest_row + z,

                dest_row + FFABS(s->linesize), s->depth) != s->width)

                return AVERROR_INVALIDDATA;

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int get_unused_buffer(QEMUFile *f, void *pv, size_t size)
+
+{

     qemu_fseek(f, size, SEEK_CUR);

static int get_unused_buffer(QEMUFile *f, void *pv, size_t size)

{

    qemu_fseek(f, size, SEEK_CUR);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 int ff_generate_sliding_window_mmcos(H264Context *h, int first_slice)

+{

     MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = first_slice ? h->mmco : mmco_temp;

int ff_generate_sliding_window_mmcos(H264Context *h, int first_slice)

{

    MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = first_slice ? h->mmco : mmco_temp;

    int mmco_index = 0, i;

    assert(h->long_ref_count + h->short_ref_count <= h->sps.ref_frame_count);

    if (h->short_ref_count &&

        h->long_ref_count + h->short_ref_count == h->sps.ref_frame_count &&

        !(FIELD_PICTURE(h) && !h->first_field && h->cur_pic_ptr->reference)) {

        mmco[0].opcode        = MMCO_SHORT2UNUSED;

        mmco[0].short_pic_num = h->short_ref[h->short_ref_count - 1]->frame_num;

        mmco_index            = 1;

        if (FIELD_PICTURE(h)) {

            mmco[0].short_pic_num *= 2;

            mmco[1].opcode         = MMCO_SHORT2UNUSED;

            mmco[1].short_pic_num  = mmco[0].short_pic_num + 1;

            mmco_index             = 2;

        }

    }

    if (first_slice) {

        h->mmco_index = mmco_index;

    } else if (!first_slice && mmco_index >= 0 &&

               (mmco_index != h->mmco_index ||

                (i = check_opcodes(h->mmco, mmco_temp, mmco_index)))) {

        av_log(h->avctx, AV_LOG_ERROR,

               "Inconsistent MMCO state between slices [%d, %d, %d]\n",

               mmco_index, h->mmco_index, i);

        return AVERROR_INVALIDDATA;

    }

    return 0;

}


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

         if (qemu_uuid_parse(buf, qemu_uuid) != 0) {

+            fprintf(stderr, "Invalid SMBIOS UUID string\n");
+
+            exit(1);
+
+        }

     }

static void smbios_build_type_1_fields(const char *t)

{

    char buf[1024];

    if (get_param_value(buf, sizeof(buf), "manufacturer", t))

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

                         strlen(buf) + 1, buf);

    if (get_param_value(buf, sizeof(buf), "product", t))

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

                         strlen(buf) + 1, buf);

    if (get_param_value(buf, sizeof(buf), "version", t))

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

                         strlen(buf) + 1, buf);

    if (get_param_value(buf, sizeof(buf), "serial", t))

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

                         strlen(buf) + 1, buf);

    if (get_param_value(buf, sizeof(buf), "uuid", t)) {

        if (qemu_uuid_parse(buf, qemu_uuid) != 0) {

            fprintf(stderr, "Invalid SMBIOS UUID string\n");

            exit(1);

        }

    }

    if (get_param_value(buf, sizeof(buf), "sku", t))

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

                         strlen(buf) + 1, buf);

    if (get_param_value(buf, sizeof(buf), "family", t))

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

                         strlen(buf) + 1, buf);

}


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

+    memory_region_init_io(&s->mmio, OBJECT(s), &stellaris_enet_ops, s,
+
                           "stellaris_enet", 0x1000);

     sysbus_init_mmio(sbd, &s->mmio);

static int stellaris_enet_init(SysBusDevice *sbd)

{

    DeviceState *dev = DEVICE(sbd);

    stellaris_enet_state *s = STELLARIS_ENET(dev);

    memory_region_init_io(&s->mmio, OBJECT(s), &stellaris_enet_ops, s,

                          "stellaris_enet", 0x1000);

    sysbus_init_mmio(sbd, &s->mmio);

    sysbus_init_irq(sbd, &s->irq);

    qemu_macaddr_default_if_unset(&s->conf.macaddr);

    s->nic = qemu_new_nic(&net_stellaris_enet_info, &s->conf,

                          object_get_typename(OBJECT(dev)), dev->id, s);

    qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);

    stellaris_enet_reset(s);

    register_savevm(dev, "stellaris_enet", -1, 1,

                    stellaris_enet_save, stellaris_enet_load, s);

    return 0;

}


static void dss_sp_shift_sq_sub(const int32_t *filter_buf,

                                int32_t *error_buf, int32_t *dst)

{

    int a;

    for (a = 0; a < 72; a++) {

        int i, tmp;

        tmp = dst[a] * filter_buf[0];

        for (i = 14; i > 0; i--)

            tmp -= error_buf[i] * (unsigned)filter_buf[i];

        for (i = 14; i > 0; i--)

            error_buf[i] = error_buf[i - 1];

        tmp = (tmp + 4096) >> 13;

        error_buf[1] = tmp;

        dst[a] = av_clip_int16(tmp);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+target_ulong helper_emt(target_ulong arg1)
+
+{

     // TODO

target_ulong helper_emt(target_ulong arg1)

{

    // TODO

    arg1 = 0;

    // rt = arg1

    return arg1;

}


--- a/source.c
+++ b/source.c
@@ -13,7 +13,7 @@
             bdrv_replace_in_backing_chain(state->new_bs, state->old_bs);

         }
+
+    }
+
+}

static void external_snapshot_abort(BlkActionState *common)

{

    ExternalSnapshotState *state =

                             DO_UPCAST(ExternalSnapshotState, common, common);

    if (state->new_bs) {

        if (state->new_bs->backing) {

            bdrv_replace_in_backing_chain(state->new_bs, state->old_bs);

        }

    }

}


--- 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
@@ -2,11 +2,11 @@

 {

+    int64_t offset;
+
+    int ret;

+

     BLKDBG_EVENT(bs->file, BLKDBG_CLUSTER_ALLOC);

int64_t qcow2_alloc_clusters(BlockDriverState *bs, int64_t size)

{

    int64_t offset;

    int ret;

    BLKDBG_EVENT(bs->file, BLKDBG_CLUSTER_ALLOC);

    offset = alloc_clusters_noref(bs, size);

    if (offset < 0) {

        return offset;

    }

    ret = update_refcount(bs, offset, size, 1, QCOW2_DISCARD_NEVER);

    if (ret < 0) {

        return ret;

    }

    return offset;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static inline void mix_dualmono_to_stereo(AC3DecodeContext *ctx)
+
+{
+
+    int i;

     float tmp;

static inline void mix_dualmono_to_stereo(AC3DecodeContext *ctx)

{

    int i;

    float tmp;

    float (*output)[256] = ctx->audio_block.block_output;

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

        tmp = output[1][i] + output[2][i];

        output[1][i] = output[2][i] = tmp;

    }

}