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

         int32_t val;
+
+
+
+        val = i;
+
         hash = i;

         p = qht_lookup(&ht, is_equal, &val, hash);

static void check(int a, int b, bool expected)

{

    struct qht_stats stats;

    int i;

    for (i = a; i < b; i++) {

        void *p;

        uint32_t hash;

        int32_t val;

        val = i;

        hash = i;

        p = qht_lookup(&ht, is_equal, &val, hash);

        g_assert_true(!!p == expected);

    }

    rcu_read_unlock();

    qht_statistics_init(&ht, &stats);

    if (stats.used_head_buckets) {

        g_assert_cmpfloat(qdist_avg(&stats.chain), >=, 1.0);

    }

    g_assert_cmpuint(stats.head_buckets, >, 0);

    qht_statistics_destroy(&stats);

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     put_tag(pb, "ftyp");

+
+    if (!strcmp("3gp", s->oformat->name))
+
+        put_tag(pb, "3gp4");
+
     else

         put_tag(pb, "isom");

int mov_write_ftyp_tag(ByteIOContext *pb, AVFormatContext *s)

{

    put_be32(pb, 0x14 ); /* size */

    put_tag(pb, "ftyp");

    if (!strcmp("3gp", s->oformat->name))

        put_tag(pb, "3gp4");

    else

        put_tag(pb, "isom");

    put_be32(pb, 0x200 );

    if (!strcmp("3gp", s->oformat->name))

        put_tag(pb, "3gp4");

    else

        put_tag(pb, "mp41");

    return 0x14;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int add_doubles_metadata(int count,

                                 const char *name, const char *sep,

@@ -11,7 +11,7 @@
     int i;

     double *dp;
+

     if (count >= INT_MAX / sizeof(int64_t) || count <= 0)

static int add_doubles_metadata(int count,

                                const char *name, const char *sep,

                                TiffContext *s)

{

    char *ap;

    int i;

    double *dp;

    if (count >= INT_MAX / sizeof(int64_t) || count <= 0)

        return AVERROR_INVALIDDATA;

    if (bytestream2_get_bytes_left(&s->gb) < count * sizeof(int64_t))

        return AVERROR_INVALIDDATA;

    dp = av_malloc(count * sizeof(double));

    if (!dp)

        return AVERROR(ENOMEM);

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

        dp[i] = tget_double(&s->gb, s->le);

    ap = doubles2str(dp, count, sep);

    av_freep(&dp);

    if (!ap)

        return AVERROR(ENOMEM);

    av_dict_set(avpriv_frame_get_metadatap(&s->picture), name, ap, AV_DICT_DONT_STRDUP_VAL);

    return 0;

}


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

 {
+
     gen_eob_inhibit_irq(s, false);

 }

static void gen_eob(DisasContext *s)

{

    gen_eob_inhibit_irq(s, false);

}


--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
             saddr.sin_addr.s_addr = so->so_faddr.s_addr;

     }
+
+    daddr.sin_addr = so->so_laddr;
+
+    daddr.sin_port = so->so_lport;
+

     return udp_output2(so, m, &saddr, &daddr, so->so_iptos);

int udp_output(struct socket *so, struct mbuf *m,

               struct sockaddr_in *addr)

{

    struct sockaddr_in saddr, daddr;

    saddr = *addr;

    if ((so->so_faddr.s_addr & htonl(0xffffff00)) == special_addr.s_addr) {

        if ((so->so_faddr.s_addr & htonl(0x000000ff)) == htonl(0xff))

            saddr.sin_addr.s_addr = alias_addr.s_addr;

        else if (addr->sin_addr.s_addr == loopback_addr.s_addr ||

                 ((so->so_faddr.s_addr & htonl(CTL_DNS)) == htonl(CTL_DNS)))

            saddr.sin_addr.s_addr = so->so_faddr.s_addr;

    }

    daddr.sin_addr = so->so_laddr;

    daddr.sin_port = so->so_lport;

    return udp_output2(so, m, &saddr, &daddr, so->so_iptos);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void helper_restore_mode (void)

+{

     env->ps = (env->ps & ~0xC) | env->saved_mode;

void helper_restore_mode (void)

{

    env->ps = (env->ps & ~0xC) | env->saved_mode;

}


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

+    if (BITS_LEFT(length,gb) < 16)
+
+        return;
+
+    level = qdm2_get_vlc(gb, &vlc_tab_level, 0, 2);

static void init_quantized_coeffs_elem0 (int8_t *quantized_coeffs, GetBitContext *gb, int length)

{

    int i, k, run, level, diff;

    if (BITS_LEFT(length,gb) < 16)

        return;

    level = qdm2_get_vlc(gb, &vlc_tab_level, 0, 2);

    quantized_coeffs[0] = level;

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

        if (BITS_LEFT(length,gb) < 16)

            break;

        run = qdm2_get_vlc(gb, &vlc_tab_run, 0, 1) + 1;

        if (BITS_LEFT(length,gb) < 16)

            break;

        diff = qdm2_get_se_vlc(&vlc_tab_diff, gb, 2);

        for (k = 1; k <= run; k++)

            quantized_coeffs[i + k] = (level + ((k * diff) / run));

        level += diff;

        i += run;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static inline int get_len(LZOContext *c, int x, int mask)

 {
+
     int cnt = x & mask;

     if (!cnt) {

static inline int get_len(LZOContext *c, int x, int mask)

{

    int cnt = x & mask;

    if (!cnt) {

        while (!(x = get_byte(c)))

            cnt += 255;

        cnt += mask + x;

    }

    return cnt;

}


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

     schro_frame_unref(frame);

static void libschroedinger_decode_frame_free(void *frame)

{

    schro_frame_unref(frame);

}


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

         lan9118_writew(opaque, offset, (uint32_t)val);

+        return;
+
+    case 4:
+
+        lan9118_writel(opaque, offset, val, size);

         return;

static void lan9118_16bit_mode_write(void *opaque, target_phys_addr_t offset,

                                     uint64_t val, unsigned size)

{

    switch (size) {

    case 2:

        lan9118_writew(opaque, offset, (uint32_t)val);

        return;

    case 4:

        lan9118_writel(opaque, offset, val, size);

        return;

    }

    hw_error("lan9118_write: Bad size 0x%x\n", size);

}


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

      */

+    if (s->bs->backing_hd) {

         int64_t l = bdrv_getlength(s->bs->backing_hd);

static void qed_read_backing_file(BDRVQEDState *s, uint64_t pos,

                                  QEMUIOVector *qiov,

                                  BlockDriverCompletionFunc *cb, void *opaque)

{

    uint64_t backing_length = 0;

    size_t size;

    /* If there is a backing file, get its length.  Treat the absence of a

     * backing file like a zero length backing file.

     */

    if (s->bs->backing_hd) {

        int64_t l = bdrv_getlength(s->bs->backing_hd);

        if (l < 0) {

            cb(opaque, l);

            return;

        }

        backing_length = l;

    }

    /* Zero all sectors if reading beyond the end of the backing file */

    if (pos >= backing_length ||

        pos + qiov->size > backing_length) {

        qemu_iovec_memset(qiov, 0, 0, qiov->size);

    }

    /* Complete now if there are no backing file sectors to read */

    if (pos >= backing_length) {

        cb(opaque, 0);

        return;

    }

    /* If the read straddles the end of the backing file, shorten it */

    size = MIN((uint64_t)backing_length - pos, qiov->size);

    BLKDBG_EVENT(s->bs->file, BLKDBG_READ_BACKING_AIO);

    bdrv_aio_readv(s->bs->backing_hd, pos / BDRV_SECTOR_SIZE,

                   qiov, size / BDRV_SECTOR_SIZE, cb, opaque);

}


static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,

                               int h, const uint8_t *src, int size, int Uoff,

                               const int step)

{

    int i, j;

    GetBitContext gb;

    VLC vlc;

    Node nodes[512];

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

        nodes[i].count = bytestream_get_le32(&src);

    size -= 1024;

    if (ff_huff_build_tree(s->avctx, &vlc, 256, nodes, huff_cmp,

                           FF_HUFFMAN_FLAG_ZERO_COUNT) < 0)

        return -1;

    /* we have built Huffman table and are ready to decode plane */

    /* convert bits so they may be used by standard bitreader */

    s->dsp.bswap_buf((uint32_t *)s->tmpbuf, (const uint32_t *)src, size >> 2);

    init_get_bits(&gb, s->tmpbuf, size * 8);

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

        for(i = 0; i < w*step; i += step){

            dst[i] = get_vlc2(&gb, vlc.table, 9, 3);

            /* lines are stored as deltas between previous lines

             * and we need to add 0x80 to the first lines of chroma planes

             */

            if(j) dst[i] += dst[i - stride];

            else if(Uoff) dst[i] += 0x80;

        }

        dst += stride;

        if(get_bits_left(&gb) < 0){

            free_vlc(&vlc);

            return -1;

        }

    }

    free_vlc(&vlc);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static ssize_t test_block_write_func(QCryptoBlock *block,

+                                     size_t offset,
+
+                                     const uint8_t *buf,
+
+                                     size_t buflen,

                                      Error **errp,

static ssize_t test_block_write_func(QCryptoBlock *block,

                                     size_t offset,

                                     const uint8_t *buf,

                                     size_t buflen,

                                     Error **errp,

                                     void *opaque)

{

    Buffer *header = opaque;

    g_assert_cmpint(buflen + offset, <=, header->capacity);

    memcpy(header->buffer + offset, buf, buflen);

    header->offset = offset + buflen;

    return buflen;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void FUNCC(pred4x4_127_dc)(uint8_t *_src, const uint8_t *topright, int _stride){

     pixel *src = (pixel*)_src;
+
     int stride = _stride/sizeof(pixel);

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

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

    pixel *src = (pixel*)_src;

    int stride = _stride/sizeof(pixel);

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

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

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

    ((pixel4*)(src+3*stride))[0]= PIXEL_SPLAT_X4((1<<(BIT_DEPTH-1))-1);

}


float64 int64_to_float64( int64 a STATUS_PARAM )

{

    flag zSign;

    if ( a == 0 ) return 0;

    if ( a == (sbits64) LIT64( 0x8000000000000000 ) ) {

        return packFloat64( 1, 0x43E, 0 );

    }

    zSign = ( a < 0 );

    return normalizeRoundAndPackFloat64( zSign, 0x43C, zSign ? - a : a STATUS_VAR );

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+void net_slirp_smb(const char *exported_dir)

 {

+    struct in_addr vserver_addr = { .s_addr = 0 };

+    if (legacy_smb_export) {

         fprintf(stderr, "-smb given twice\n");

void net_slirp_smb(const char *exported_dir)

{

    struct in_addr vserver_addr = { .s_addr = 0 };

    if (legacy_smb_export) {

        fprintf(stderr, "-smb given twice\n");

        exit(1);

    }

    legacy_smb_export = exported_dir;

    if (!QTAILQ_EMPTY(&slirp_stacks)) {

        slirp_smb(QTAILQ_FIRST(&slirp_stacks), NULL, exported_dir,

                  vserver_addr);

    }

}


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

     if (posix_aio_state)
+
+        return 0;
+
+
+
     s = qemu_malloc(sizeof(PosixAioState));

static int posix_aio_init(void)

{

    struct sigaction act;

    PosixAioState *s;

    int fds[2];

    struct qemu_paioinit ai;

    if (posix_aio_state)

        return 0;

    s = qemu_malloc(sizeof(PosixAioState));

    sigfillset(&act.sa_mask);

    act.sa_flags = 0; /* do not restart syscalls to interrupt select() */

    act.sa_handler = aio_signal_handler;

    sigaction(SIGUSR2, &act, NULL);

    s->first_aio = NULL;

    if (pipe(fds) == -1) {

        fprintf(stderr, "failed to create pipe\n");

        return -errno;

    }

    s->rfd = fds[0];

    s->wfd = fds[1];

    fcntl(s->rfd, F_SETFL, O_NONBLOCK);

    fcntl(s->wfd, F_SETFL, O_NONBLOCK);

    qemu_aio_set_fd_handler(s->rfd, posix_aio_read, NULL, posix_aio_flush, s);

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

    ai.aio_threads = 64;

    ai.aio_num = 64;

    qemu_paio_init(&ai);

    posix_aio_state = s;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -41,11 +41,11 @@
         s->vp8dsp.vp8_h_loop_filter16_inner(dst[0]+12, s->linesize,   bedge_lim, inner_limit, hev_thresh);

         s->vp8dsp.vp8_h_loop_filter8_inner (dst[1]+ 4, s->uvlinesize, bedge_lim, inner_limit, hev_thresh);
+
+        s->vp8dsp.vp8_h_loop_filter8_inner (dst[2]+ 4, s->uvlinesize, bedge_lim, inner_limit, hev_thresh);
+
+    }
+

     if (mb_y) {

static void filter_mb(VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb, int mb_x, int mb_y)

{

    int filter_level, inner_limit, hev_thresh, mbedge_lim, bedge_lim;

    filter_level_for_mb(s, mb, &filter_level, &inner_limit, &hev_thresh);

    if (!filter_level)

        return;

    mbedge_lim = 2*(filter_level+2) + inner_limit;

     bedge_lim = 2* filter_level    + inner_limit;

    if (mb_x) {

        s->vp8dsp.vp8_h_loop_filter16(dst[0], s->linesize,   mbedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter8 (dst[1], s->uvlinesize, mbedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter8 (dst[2], s->uvlinesize, mbedge_lim, inner_limit, hev_thresh);

    }

    if (!mb->skip || mb->mode == MODE_I4x4 || mb->mode == VP8_MVMODE_SPLIT) {

        s->vp8dsp.vp8_h_loop_filter16_inner(dst[0]+ 4, s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter16_inner(dst[0]+ 8, s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter16_inner(dst[0]+12, s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter8_inner (dst[1]+ 4, s->uvlinesize, bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter8_inner (dst[2]+ 4, s->uvlinesize, bedge_lim, inner_limit, hev_thresh);

    }

    if (mb_y) {

        s->vp8dsp.vp8_v_loop_filter16(dst[0], s->linesize,   mbedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter8 (dst[1], s->uvlinesize, mbedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter8 (dst[2], s->uvlinesize, mbedge_lim, inner_limit, hev_thresh);

    }

    if (!mb->skip || mb->mode == MODE_I4x4 || mb->mode == VP8_MVMODE_SPLIT) {

        s->vp8dsp.vp8_v_loop_filter16_inner(dst[0]+ 4*s->linesize,   s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter16_inner(dst[0]+ 8*s->linesize,   s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter16_inner(dst[0]+12*s->linesize,   s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter8_inner (dst[1]+ 4*s->uvlinesize, s->uvlinesize, bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter8_inner (dst[2]+ 4*s->uvlinesize, s->uvlinesize, bedge_lim, inner_limit, hev_thresh);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static float get_band_cost_ZERO_mips(struct AACEncContext *s,

                                      PutBitContext *pb, const float *in,

static float get_band_cost_ZERO_mips(struct AACEncContext *s,

                                     PutBitContext *pb, const float *in,

                                     const float *scaled, int size, int scale_idx,

                                     int cb, const float lambda, const float uplim,

                                     int *bits)

{

    int i;

    float cost = 0;

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

        cost += in[i  ] * in[i  ];

        cost += in[i+1] * in[i+1];

        cost += in[i+2] * in[i+2];

        cost += in[i+3] * in[i+3];

    }

    if (bits)

        *bits = 0;

    return cost * lambda;

}


--- a/source.c
+++ b/source.c
@@ -2,11 +2,11 @@
 {
     int w;
     if (blit_is_unsafe(s, true)) {
+        return 0;
+    }
+    s->cirrus_blt_mode &= ~CIRRUS_BLTMODE_MEMSYSSRC;
+    s->cirrus_srcptr = &s->cirrus_bltbuf[0];
+    s->cirrus_srcptr_end = &s->cirrus_bltbuf[0];
     if (s->cirrus_blt_mode & CIRRUS_BLTMODE_PATTERNCOPY) {
 	if (s->cirrus_blt_mode & CIRRUS_BLTMODE_COLOREXPAND) {
 	    s->cirrus_blt_srcpitch = 8;

static int cirrus_bitblt_cputovideo(CirrusVGAState * s)
{
    int w;
    if (blit_is_unsafe(s, true)) {
        return 0;
    }
    s->cirrus_blt_mode &= ~CIRRUS_BLTMODE_MEMSYSSRC;
    s->cirrus_srcptr = &s->cirrus_bltbuf[0];
    s->cirrus_srcptr_end = &s->cirrus_bltbuf[0];
    if (s->cirrus_blt_mode & CIRRUS_BLTMODE_PATTERNCOPY) {
	if (s->cirrus_blt_mode & CIRRUS_BLTMODE_COLOREXPAND) {
	    s->cirrus_blt_srcpitch = 8;
	} else {
            /* XXX: check for 24 bpp */
	    s->cirrus_blt_srcpitch = 8 * 8 * s->cirrus_blt_pixelwidth;
	}
	s->cirrus_srccounter = s->cirrus_blt_srcpitch;
    } else {
	if (s->cirrus_blt_mode & CIRRUS_BLTMODE_COLOREXPAND) {
            w = s->cirrus_blt_width / s->cirrus_blt_pixelwidth;
            if (s->cirrus_blt_modeext & CIRRUS_BLTMODEEXT_DWORDGRANULARITY)
                s->cirrus_blt_srcpitch = ((w + 31) >> 5);
            else
                s->cirrus_blt_srcpitch = ((w + 7) >> 3);
	} else {
            /* always align input size to 32 bits */
	    s->cirrus_blt_srcpitch = (s->cirrus_blt_width + 3) & ~3;
	}
        s->cirrus_srccounter = s->cirrus_blt_srcpitch * s->cirrus_blt_height;
    }
    s->cirrus_srcptr = s->cirrus_bltbuf;
    s->cirrus_srcptr_end = s->cirrus_bltbuf + s->cirrus_blt_srcpitch;
    cirrus_update_memory_access(s);
    return 1;
}


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

     vaapi_encode_mjpeg_init_tables(avctx);

+
+
+    return 0;
+
+}

static av_cold int vaapi_encode_mjpeg_init_internal(AVCodecContext *avctx)

{

    static const VAConfigAttrib default_config_attributes[] = {

        { .type  = VAConfigAttribRTFormat,

          .value = VA_RT_FORMAT_YUV420 },

        { .type  = VAConfigAttribEncPackedHeaders,

          .value = VA_ENC_PACKED_HEADER_SEQUENCE },

    };

    VAAPIEncodeContext       *ctx = avctx->priv_data;

    VAAPIEncodeMJPEGContext *priv = ctx->priv_data;

    int i;

    ctx->va_profile    = VAProfileJPEGBaseline;

    ctx->va_entrypoint = VAEntrypointEncPicture;

    ctx->input_width    = avctx->width;

    ctx->input_height   = avctx->height;

    ctx->aligned_width  = FFALIGN(ctx->input_width,  8);

    ctx->aligned_height = FFALIGN(ctx->input_height, 8);

    for (i = 0; i < FF_ARRAY_ELEMS(default_config_attributes); i++) {

        ctx->config_attributes[ctx->nb_config_attributes++] =

            default_config_attributes[i];

    }

    priv->quality = avctx->global_quality;

    if (priv->quality < 1 || priv->quality > 100) {

        av_log(avctx, AV_LOG_ERROR, "Invalid quality value %d "

               "(must be 1-100).\n", priv->quality);

        return AVERROR(EINVAL);

    }

    vaapi_encode_mjpeg_init_tables(avctx);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void colo_old_packet_check_one_conn(void *opaque,
+
                                            void *user_data)

 {

static void colo_old_packet_check_one_conn(void *opaque,

                                           void *user_data)

{

    Connection *conn = opaque;

    GList *result = NULL;

    int64_t check_time = REGULAR_PACKET_CHECK_MS;

    result = g_queue_find_custom(&conn->primary_list,

                                 &check_time,

                                 (GCompareFunc)colo_old_packet_check_one);

    if (result) {

        /* do checkpoint will flush old packet */

        /* TODO: colo_notify_checkpoint();*/

    }

}


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

 {

+    qemu_rec_mutex_unlock(&ctx->lock);

 }

void aio_context_release(AioContext *ctx)

{

    qemu_rec_mutex_unlock(&ctx->lock);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+bool vhost_net_query(VHostNetState *net, VirtIODevice *dev)
+
 {

     return false;

bool vhost_net_query(VHostNetState *net, VirtIODevice *dev)

{

    return false;

}


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

     uint32_t data = val & E1000_MDIC_DATA_MASK;

+    uint32_t addr = ((val & E1000_MDIC_REG_MASK) >> E1000_MDIC_REG_SHIFT);
+
+
+
+    if ((val & E1000_MDIC_PHY_MASK) >> E1000_MDIC_PHY_SHIFT != 1) // phy #

         val = s->mac_reg[MDIC] | E1000_MDIC_ERROR;

set_mdic(E1000State *s, int index, uint32_t val)

{

    uint32_t data = val & E1000_MDIC_DATA_MASK;

    uint32_t addr = ((val & E1000_MDIC_REG_MASK) >> E1000_MDIC_REG_SHIFT);

    if ((val & E1000_MDIC_PHY_MASK) >> E1000_MDIC_PHY_SHIFT != 1) // phy #

        val = s->mac_reg[MDIC] | E1000_MDIC_ERROR;

    else if (val & E1000_MDIC_OP_READ) {

        DBGOUT(MDIC, "MDIC read reg 0x%x\n", addr);

        if (!(phy_regcap[addr] & PHY_R)) {

            DBGOUT(MDIC, "MDIC read reg %x unhandled\n", addr);

            val |= E1000_MDIC_ERROR;

        } else

            val = (val ^ data) | s->phy_reg[addr];

    } else if (val & E1000_MDIC_OP_WRITE) {

        DBGOUT(MDIC, "MDIC write reg 0x%x, value 0x%x\n", addr, data);

        if (!(phy_regcap[addr] & PHY_W)) {

            DBGOUT(MDIC, "MDIC write reg %x unhandled\n", addr);

            val |= E1000_MDIC_ERROR;

        } else {

            if (addr < NPHYWRITEOPS && phyreg_writeops[addr]) {

                phyreg_writeops[addr](s, index, data);

            }

            s->phy_reg[addr] = data;

        }

    }

    s->mac_reg[MDIC] = val | E1000_MDIC_READY;

    if (val & E1000_MDIC_INT_EN) {

        set_ics(s, 0, E1000_ICR_MDAC);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+void qemu_set_log_filename(const char *filename)

 {

     char *pidstr;

+    g_free(logfilename);
+

     pidstr = strstr(filename, "%");

void qemu_set_log_filename(const char *filename)

{

    char *pidstr;

    g_free(logfilename);

    pidstr = strstr(filename, "%");

    if (pidstr) {

        /* We only accept one %d, no other format strings */

        if (pidstr[1] != 'd' || strchr(pidstr + 2, '%')) {

            error_report("Bad logfile format: %s", filename);

            logfilename = NULL;

        } else {

            logfilename = g_strdup_printf(filename, getpid());

        }

    } else {

        logfilename = g_strdup(filename);

    }

    qemu_log_close();

    qemu_set_log(qemu_loglevel);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void idr(H264Context *h){

     int i;
+
     ff_h264_remove_all_refs(h);

     h->prev_frame_num= 0;

static void idr(H264Context *h){

    int i;

    ff_h264_remove_all_refs(h);

    h->prev_frame_num= 0;

    h->prev_frame_num_offset= 0;

    h->prev_poc_msb=

    h->prev_poc_lsb= 0;

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

        h->last_pocs[i] = INT_MIN;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void qemu_aio_wait_all(void)

+{
+
     while (qemu_aio_wait()) {

         /* Do nothing */

static void qemu_aio_wait_all(void)

{

    while (qemu_aio_wait()) {

        /* Do nothing */

    }

}


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

 {
+
+    Coroutine *c1;
+
     Coroutine *c2;
+

     c1 = qemu_coroutine_create(c1_fn);

static void test_co_queue(void)

{

    Coroutine *c1;

    Coroutine *c2;

    c1 = qemu_coroutine_create(c1_fn);

    c2 = qemu_coroutine_create(c2_fn);

    qemu_coroutine_enter(c1, c2);

    memset(c1, 0xff, sizeof(Coroutine));

    qemu_coroutine_enter(c2, NULL);

}


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

+                                 ptrdiff_t stride)
+
+{

     avc_luma_hv_qrt_and_aver_dst_16x16_msa(src - 2,

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

                                 ptrdiff_t stride)

{

    avc_luma_hv_qrt_and_aver_dst_16x16_msa(src - 2,

                                           src - (stride * 2) +

                                           sizeof(uint8_t), stride,

                                           dst, stride);

}


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

                       const int16_t **lumSrc, int lumFilterSize,

+                      const int16_t *chrFilter, const int16_t **chrUSrc,

                       const int16_t **chrVSrc, int chrFilterSize,

yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter,

                      const int16_t **lumSrc, int lumFilterSize,

                      const int16_t *chrFilter, const int16_t **chrUSrc,

                      const int16_t **chrVSrc, int chrFilterSize,

                      const int16_t **alpSrc, uint8_t *dest, int dstW,

                      int y, enum PixelFormat target)

{

    const uint8_t * const d128=dither_8x8_220[y&7];

    uint8_t *g = c->table_gU[128] + c->table_gV[128];

    int i;

    int acc = 0;

    for (i = 0; i < dstW - 1; i += 2) {

        int j;

        int Y1 = 1 << 18;

        int Y2 = 1 << 18;

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

            Y1 += lumSrc[j][i]   * lumFilter[j];

            Y2 += lumSrc[j][i+1] * lumFilter[j];

        }

        Y1 >>= 19;

        Y2 >>= 19;

        if ((Y1 | Y2) & 0x100) {

            Y1 = av_clip_uint8(Y1);

            Y2 = av_clip_uint8(Y2);

        }

        acc += acc + g[Y1 + d128[(i + 0) & 7]];

        acc += acc + g[Y2 + d128[(i + 1) & 7]];

        if ((i & 7) == 6) {

            output_pixel(*dest++, acc);

        }

    }

}


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

     ff_read_frame_flush(s);

+
+
+    if (!state)
+
+        return;

void ff_restore_parser_state(AVFormatContext *s, AVParserState *state)

{

    int i;

    AVStream *st;

    AVParserStreamState *ss;

    ff_read_frame_flush(s);

    if (!state)

        return;

    avio_seek(s->pb, state->fpos, SEEK_SET);

    // copy context structures

    s->cur_st                           = state->cur_st;

    s->packet_buffer                    = state->packet_buffer;

    s->raw_packet_buffer                = state->raw_packet_buffer;

    s->raw_packet_buffer_remaining_size = state->raw_packet_buffer_remaining_size;

    // copy stream structures

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

        st = s->streams[i];

        ss = &state->stream_states[i];

        st->parser        = ss->parser;

        st->last_IP_pts   = ss->last_IP_pts;

        st->cur_dts       = ss->cur_dts;

        st->reference_dts = ss->reference_dts;

        st->cur_ptr       = ss->cur_ptr;

        st->cur_len       = ss->cur_len;

        st->probe_packets = ss->probe_packets;

        st->cur_pkt       = ss->cur_pkt;

    }

    av_free(state->stream_states);

    av_free(state);

}


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

         .offset_within_address_space = base,

+        .size = TARGET_PAGE_SIZE,

     };

static void register_subpage(MemoryRegionSection *section)

{

    subpage_t *subpage;

    target_phys_addr_t base = section->offset_within_address_space

        & TARGET_PAGE_MASK;

    MemoryRegionSection *existing = phys_page_find(base >> TARGET_PAGE_BITS);

    MemoryRegionSection subsection = {

        .offset_within_address_space = base,

        .size = TARGET_PAGE_SIZE,

    };

    target_phys_addr_t start, end;

    assert(existing->mr->subpage || existing->mr == &io_mem_unassigned);

    if (!(existing->mr->subpage)) {

        subpage = subpage_init(base);

        subsection.mr = &subpage->iomem;

        phys_page_set(base >> TARGET_PAGE_BITS, 1,

                      phys_section_add(&subsection));

    } else {

        subpage = container_of(existing->mr, subpage_t, iomem);

    }

    start = section->offset_within_address_space & ~TARGET_PAGE_MASK;

    end = start + section->size;

    subpage_register(subpage, start, end, phys_section_add(section));

}


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

     av_freep(&st->codec->extradata);

+    st->codec->extradata_size = 0;
+
+    st->codec->extradata = av_mallocz(strlen(buf) + FF_INPUT_BUFFER_PADDING_SIZE);
+
+    if (!st->codec->extradata)

         return AVERROR(ENOMEM);

static int mov_rewrite_dvd_sub_extradata(AVStream *st)

{

    char pal_s[256];

    char buf[256];

    int pal_s_pos = 0;

    uint8_t *src = st->codec->extradata;

    int i;

    if (st->codec->extradata_size != 64)

        return 0;

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

        uint32_t yuv = AV_RB32(src + i * 4);

        uint32_t rgba = yuv_to_rgba(yuv);

        snprintf(pal_s + pal_s_pos, sizeof(pal_s) - pal_s_pos, "%06x%s", rgba,

                 i != 15 ? ", " : "");

        pal_s_pos = strlen(pal_s);

        if (pal_s_pos >= sizeof(pal_s))

            return 0;

    }

    snprintf(buf, sizeof(buf), "size: %dx%d\npalette: %s\n",

             st->codec->width, st->codec->height, pal_s);

    av_freep(&st->codec->extradata);

    st->codec->extradata_size = 0;

    st->codec->extradata = av_mallocz(strlen(buf) + FF_INPUT_BUFFER_PADDING_SIZE);

    if (!st->codec->extradata)

        return AVERROR(ENOMEM);

    st->codec->extradata_size = strlen(buf);

    memcpy(st->codec->extradata, buf, st->codec->extradata_size);

    return 0;

}


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

+
+        avio_close(avf2->pb);
+
+        avf2->pb = NULL;
+
         avformat_free_context(avf2);

         tee->slaves[i].avf = NULL;

static void close_slaves(AVFormatContext *avf)

{

    TeeContext *tee = avf->priv_data;

    AVFormatContext *avf2;

    unsigned i, j;

    for (i = 0; i < tee->nb_slaves; i++) {

        avf2 = tee->slaves[i].avf;

        for (j = 0; j < avf2->nb_streams; j++) {

            AVBitStreamFilterContext *bsf_next, *bsf = tee->slaves[i].bsfs[j];

            while (bsf) {

                bsf_next = bsf->next;

                av_bitstream_filter_close(bsf);

                bsf = bsf_next;

            }

        }

        av_freep(&tee->slaves[i].stream_map);

        avio_close(avf2->pb);

        avf2->pb = NULL;

        avformat_free_context(avf2);

        tee->slaves[i].avf = NULL;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void parse_option_number(const char *name, const char *value,
+
                                 uint64_t *ret, Error **errp)
+
+{

     char *postfix;

static void parse_option_number(const char *name, const char *value,

                                uint64_t *ret, Error **errp)

{

    char *postfix;

    uint64_t number;

    number = strtoull(value, &postfix, 0);

    if (*postfix != '\0') {

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

        return;

    }

    *ret = number;

}


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

     MERGE(i_tex_bits);

+    MERGE(p_tex_bits);
+
+    MERGE(i_count);

     MERGE(f_count);

static void merge_context_after_encode(MpegEncContext *dst, MpegEncContext *src){

    int i;

    MERGE(dct_count[0]); //note, the other dct vars are not part of the context

    MERGE(dct_count[1]);

    MERGE(mv_bits);

    MERGE(i_tex_bits);

    MERGE(p_tex_bits);

    MERGE(i_count);

    MERGE(f_count);

    MERGE(b_count);

    MERGE(skip_count);

    MERGE(misc_bits);

    MERGE(er.error_count);

    MERGE(padding_bug_score);

    MERGE(current_picture.f->error[0]);

    MERGE(current_picture.f->error[1]);

    MERGE(current_picture.f->error[2]);

    if(dst->avctx->noise_reduction){

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

            MERGE(dct_error_sum[0][i]);

            MERGE(dct_error_sum[1][i]);

        }

    }

    assert(put_bits_count(&src->pb) % 8 ==0);

    assert(put_bits_count(&dst->pb) % 8 ==0);

    avpriv_copy_bits(&dst->pb, src->pb.buf, put_bits_count(&src->pb));

    flush_put_bits(&dst->pb);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     struct endp_data *endp = priv;

     USBRedirDevice *dev = endp->dev;
+
     struct buf_packet *bufp;

     int i;

static int usbredir_get_bufpq(QEMUFile *f, void *priv, size_t unused)

{

    struct endp_data *endp = priv;

    USBRedirDevice *dev = endp->dev;

    struct buf_packet *bufp;

    int i;

    endp->bufpq_size = qemu_get_be32(f);

    for (i = 0; i < endp->bufpq_size; i++) {

        bufp = g_malloc(sizeof(struct buf_packet));

        bufp->len = qemu_get_be32(f);

        bufp->status = qemu_get_be32(f);

        bufp->offset = 0;

        bufp->data = qemu_oom_check(malloc(bufp->len)); /* regular malloc! */

        bufp->free_on_destroy = bufp->data;

        qemu_get_buffer(f, bufp->data, bufp->len);

        QTAILQ_INSERT_TAIL(&endp->bufpq, bufp, next);

        DPRINTF("get_bufpq %d/%d len %d status %d\n", i + 1, endp->bufpq_size,

                bufp->len, bufp->status);

    }

    return 0;

}


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

     r_asi = gen_get_asi(dc, insn);

+    r_size = tcg_const_i32(1);
+
+    r_sign = tcg_const_i32(0);
+
+    gen_helper_ld_asi(d64, cpu_env, addr, r_asi, r_size, r_sign);

     tcg_temp_free_i32(r_sign);

static void gen_ldstub_asi(DisasContext *dc, TCGv dst, TCGv addr, int insn)

{

    TCGv_i32 r_asi, r_size, r_sign;

    TCGv_i64 s64, d64 = tcg_temp_new_i64();

    r_asi = gen_get_asi(dc, insn);

    r_size = tcg_const_i32(1);

    r_sign = tcg_const_i32(0);

    gen_helper_ld_asi(d64, cpu_env, addr, r_asi, r_size, r_sign);

    tcg_temp_free_i32(r_sign);

    s64 = tcg_const_i64(0xff);

    gen_helper_st_asi(cpu_env, addr, s64, r_asi, r_size);

    tcg_temp_free_i64(s64);

    tcg_temp_free_i32(r_size);

    tcg_temp_free_i32(r_asi);

    tcg_gen_trunc_i64_tl(dst, d64);

    tcg_temp_free_i64(d64);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     const testdef_t *test = data;

     char *args;
+
     char tmpname[] = "/tmp/qtest-boot-serial-XXXXXX";

     int fd;

static void test_machine(const void *data)

{

    const testdef_t *test = data;

    char *args;

    char tmpname[] = "/tmp/qtest-boot-serial-XXXXXX";

    int fd;

    fd = mkstemp(tmpname);

    g_assert(fd != -1);

    args = g_strdup_printf("-M %s,accel=tcg -chardev file,id=serial0,path=%s"

                           " -serial chardev:serial0 %s", test->machine,

                           tmpname, test->extra);

    qtest_start(args);

    unlink(tmpname);

    check_guest_output(test, fd);

    qtest_quit(global_qtest);

    g_free(args);

    close(fd);

}


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

+    cpu = S390_CPU(object_new(TYPE_S390_CPU));
+
+
+
     object_property_set_bool(OBJECT(cpu), true, "realized", NULL);

S390CPU *cpu_s390x_init(const char *cpu_model)

{

    S390CPU *cpu;

    cpu = S390_CPU(object_new(TYPE_S390_CPU));

    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);

    return cpu;

}


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

     struct viosrp_adapter_info *sinfo;
+
     struct mad_adapter_info_data info;

     int rc;
+

     sinfo = &req->iu.mad.adapter_info;

+#if 0 /* What for ? */

     rc = spapr_tce_dma_read(&s->vdev, be64_to_cpu(sinfo->buffer),

static int vscsi_send_adapter_info(VSCSIState *s, vscsi_req *req)

{

    struct viosrp_adapter_info *sinfo;

    struct mad_adapter_info_data info;

    int rc;

    sinfo = &req->iu.mad.adapter_info;

#if 0 /* What for ? */

    rc = spapr_tce_dma_read(&s->vdev, be64_to_cpu(sinfo->buffer),

                            &info, be16_to_cpu(sinfo->common.length));

    if (rc) {

        fprintf(stderr, "vscsi_send_adapter_info: DMA read failure !\n");

    }

#endif

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

    strcpy(info.srp_version, SRP_VERSION);

    strncpy(info.partition_name, "qemu", sizeof("qemu"));

    info.partition_number = cpu_to_be32(0);

    info.mad_version = cpu_to_be32(1);

    info.os_type = cpu_to_be32(2);

    info.port_max_txu[0] = cpu_to_be32(VSCSI_MAX_SECTORS << 9);

    rc = spapr_tce_dma_write(&s->vdev, be64_to_cpu(sinfo->buffer),

                             &info, be16_to_cpu(sinfo->common.length));

    if (rc)  {

        fprintf(stderr, "vscsi_send_adapter_info: DMA write failure !\n");

    }

    sinfo->common.status = rc ? cpu_to_be32(1) : 0;

    return vscsi_send_iu(s, req, sizeof(*sinfo), VIOSRP_MAD_FORMAT);

}


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

     NvmeRwCmd *rw = (NvmeRwCmd *)cmd;

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

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

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

    NvmeRequest *req)

{

    NvmeRwCmd *rw = (NvmeRwCmd *)cmd;

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

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

    uint64_t slba = le64_to_cpu(rw->slba);

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

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

    uint32_t aio_nlb = nlb << (data_shift - BDRV_SECTOR_BITS);

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

        return NVME_LBA_RANGE | NVME_DNR;

    }

    req->has_sg = false;

    block_acct_start(blk_get_stats(n->conf.blk), &req->acct, 0,

                     BLOCK_ACCT_WRITE);

    req->aiocb = blk_aio_pwrite_zeroes(n->conf.blk, aio_slba, aio_nlb,

                                        BDRV_REQ_MAY_UNMAP, nvme_rw_cb, req);

    return NVME_NO_COMPLETE;

}


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

        flushed */

+    if (dirty_flags == 0xff)
+
+        tlb_set_dirty(cpu_single_env, cpu_single_env->mem_io_vaddr);
+
+}

static void notdirty_mem_writew(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, 2);

        dirty_flags = phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS];

#endif

    }

    stw_p(qemu_get_ram_ptr(ram_addr), val);

#ifdef CONFIG_KQEMU

    if (cpu_single_env->kqemu_enabled &&

        (dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK)

        kqemu_modify_page(cpu_single_env, ram_addr);

#endif

    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
@@ -1,7 +1,7 @@
 static bool virtio_scsi_data_plane_handle_event(VirtIODevice *vdev,

                                                 VirtQueue *vq)
+
 {

     VirtIOSCSI *s = VIRTIO_SCSI(vdev);

static bool virtio_scsi_data_plane_handle_event(VirtIODevice *vdev,

                                                VirtQueue *vq)

{

    VirtIOSCSI *s = VIRTIO_SCSI(vdev);

    assert(s->ctx && s->dataplane_started);

    return virtio_scsi_handle_event_vq(s, vq);

}


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

     LOAD_COMMON

+
+
+ //FIXME factorize
+
+

     cmp_sub= s->dsp.mb_cmp[size];

static int inline get_mb_score(MpegEncContext * s, int mx, int my, int src_index,

                               int ref_index)

{

//    const int check_luma= s->dsp.me_sub_cmp != s->dsp.mb_cmp;

    MotionEstContext * const c= &s->me;

    const int size= 0;

    const int h= 16;

    const int penalty_factor= c->mb_penalty_factor;

    const int flags= c->mb_flags;

    const int qpel= flags & FLAG_QPEL;

    const int mask= 1+2*qpel;

    me_cmp_func cmp_sub, chroma_cmp_sub;

    int d;

    LOAD_COMMON

 //FIXME factorize

    cmp_sub= s->dsp.mb_cmp[size];

    chroma_cmp_sub= s->dsp.mb_cmp[size+1];

    assert(!c->skip);

    assert(c->avctx->me_sub_cmp != c->avctx->mb_cmp);

    d= cmp(s, mx>>(qpel+1), my>>(qpel+1), mx&mask, my&mask, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);

    //FIXME check cbp before adding penalty for (0,0) vector

    if(mx || my || size>0)

        d += (mv_penalty[mx - pred_x] + mv_penalty[my - pred_y])*penalty_factor;

    return d;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void cpu_outl(pio_addr_t addr, uint32_t val)

 {
+
+    LOG_IOPORT("outl: %04"FMT_pioaddr" %08"PRIx32"\n", addr, val);

     trace_cpu_out(addr, val);

void cpu_outl(pio_addr_t addr, uint32_t val)

{

    LOG_IOPORT("outl: %04"FMT_pioaddr" %08"PRIx32"\n", addr, val);

    trace_cpu_out(addr, val);

    ioport_write(2, addr, val);

}


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

                                    vaddr addr, unsigned size,

+                                   MMUAccessType access_type,

                                    int mmu_idx, MemTxAttrs attrs,

void arm_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,

                                   vaddr addr, unsigned size,

                                   MMUAccessType access_type,

                                   int mmu_idx, MemTxAttrs attrs,

                                   MemTxResult response, uintptr_t retaddr)

{

    ARMCPU *cpu = ARM_CPU(cs);

    ARMMMUFaultInfo fi = {};

    /* now we have a real cpu fault */

    cpu_restore_state(cs, retaddr);

    /* The EA bit in syndromes and fault status registers is an

     * IMPDEF classification of external aborts. ARM implementations

     * usually use this to indicate AXI bus Decode error (0) or

     * Slave error (1); in QEMU we follow that.

     */

    fi.ea = (response != MEMTX_DECODE_ERROR);

    fi.type = ARMFault_SyncExternal;

    deliver_fault(cpu, addr, access_type, mmu_idx, &fi);

}


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

     for(i = 0; i < num; i++, buf++, addr += sizeof(*buf)) {

+        cpu_physical_memory_rw(addr,(uint8_t *)buf, sizeof(*buf), 0);
+
+        *buf = le32_to_cpu(*buf);
+
+    }

static inline int get_dwords(uint32_t addr, uint32_t *buf, int num)

{

    int i;

    for(i = 0; i < num; i++, buf++, addr += sizeof(*buf)) {

        cpu_physical_memory_rw(addr,(uint8_t *)buf, sizeof(*buf), 0);

        *buf = le32_to_cpu(*buf);

    }

    return 1;

}


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

         bdrv_io_unplugged_end(bs);

+        bdrv_parent_drained_end(bs);
+
+        aio_context_release(aio_context);
+
+    }

void bdrv_drain_all_end(void)

{

    BlockDriverState *bs;

    BdrvNextIterator it;

    BlockJob *job = NULL;

    for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {

        AioContext *aio_context = bdrv_get_aio_context(bs);

        aio_context_acquire(aio_context);

        aio_enable_external(aio_context);

        bdrv_io_unplugged_end(bs);

        bdrv_parent_drained_end(bs);

        aio_context_release(aio_context);

    }

    while ((job = block_job_next(job))) {

        AioContext *aio_context = blk_get_aio_context(job->blk);

        aio_context_acquire(aio_context);

        block_job_resume(job);

        aio_context_release(aio_context);

    }

}


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

 {

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

{

    int i;

    assert(src1==src2);

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

        int r= src1[6*i + 0] + src1[6*i + 3];

        int g= src1[6*i + 1] + src1[6*i + 4];

        int b= src1[6*i + 2] + src1[6*i + 5];

        dstU[i]= (RU*r + GU*g + BU*b + (257<<RGB2YUV_SHIFT))>>(RGB2YUV_SHIFT+1);

        dstV[i]= (RV*r + GV*g + BV*b + (257<<RGB2YUV_SHIFT))>>(RGB2YUV_SHIFT+1);

    }

}


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

                                                 void *opaque, Error **errp)

+{
+
+    PCIHostState *h = PCI_HOST_BRIDGE(obj);
+
+    Range w64;

static void i440fx_pcihost_get_pci_hole64_start(Object *obj, Visitor *v,

                                                const char *name,

                                                void *opaque, Error **errp)

{

    PCIHostState *h = PCI_HOST_BRIDGE(obj);

    Range w64;

    pci_bus_get_w64_range(h->bus, &w64);

    visit_type_uint64(v, name, &w64.begin, errp);

}


static int get_char(GDBState *s)

{

    uint8_t ch;

    int ret;

    for(;;) {

        ret = qemu_recv(s->fd, &ch, 1, 0);

        if (ret < 0) {

            if (errno == ECONNRESET)

                s->fd = -1;

            if (errno != EINTR && errno != EAGAIN)

                return -1;

        } else if (ret == 0) {

            close(s->fd);

            s->fd = -1;

            return -1;

        } else {

            break;

        }

    }

    return ch;

}


--- a/source.c
+++ b/source.c
@@ -1,19 +1,19 @@
+static int guest_get_network_stats(const char *name,
+
+                       GuestNetworkInterfaceStat *stats)
+
+{
+
+    DWORD if_index = 0;
+
+    MIB_IFROW a_mid_ifrow;
+
+    memset(&a_mid_ifrow, 0, sizeof(a_mid_ifrow));
+
+    if_index = get_interface_index(name);
+
+    a_mid_ifrow.dwIndex = if_index;
+
     if (NO_ERROR == GetIfEntry(&a_mid_ifrow)) {

         stats->rx_bytes = a_mid_ifrow.dwInOctets;

static int guest_get_network_stats(const char *name,

                       GuestNetworkInterfaceStat *stats)

{

    DWORD if_index = 0;

    MIB_IFROW a_mid_ifrow;

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

    if_index = get_interface_index(name);

    a_mid_ifrow.dwIndex = if_index;

    if (NO_ERROR == GetIfEntry(&a_mid_ifrow)) {

        stats->rx_bytes = a_mid_ifrow.dwInOctets;

        stats->rx_packets = a_mid_ifrow.dwInUcastPkts;

        stats->rx_errs = a_mid_ifrow.dwInErrors;

        stats->rx_dropped = a_mid_ifrow.dwInDiscards;

        stats->tx_bytes = a_mid_ifrow.dwOutOctets;

        stats->tx_packets = a_mid_ifrow.dwOutUcastPkts;

        stats->tx_errs = a_mid_ifrow.dwOutErrors;

        stats->tx_dropped = a_mid_ifrow.dwOutDiscards;

        return 0;

    }

    return -1;

}


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

     fprintf(stderr, "%s version " FFMPEG_VERSION ", Copyright (c) %d-%d the FFmpeg developers\n",

+            program_name, program_birth_year, this_year);
+
+    fprintf(stderr, "  built on %s %s with %s %s\n",
+
             __DATE__, __TIME__, CC_TYPE, CC_VERSION);

     fprintf(stderr, "  configuration: " FFMPEG_CONFIGURATION "\n");

void show_banner(void)

{

    fprintf(stderr, "%s version " FFMPEG_VERSION ", Copyright (c) %d-%d the FFmpeg developers\n",

            program_name, program_birth_year, this_year);

    fprintf(stderr, "  built on %s %s with %s %s\n",

            __DATE__, __TIME__, CC_TYPE, CC_VERSION);

    fprintf(stderr, "  configuration: " FFMPEG_CONFIGURATION "\n");

    print_all_libs_info(stderr, INDENT|SHOW_CONFIG);

    print_all_libs_info(stderr, INDENT|SHOW_VERSION);

}


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

     }

+
+
+    if (!handled && propagate_accel) {
+
+        handled = gtk_window_activate_key(GTK_WINDOW(widget), key);

     }

static gboolean gd_window_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)

{

    GtkDisplayState *s = opaque;

    GtkAccelGroupEntry *entries;

    guint n_entries = 0;

    gboolean propagate_accel = TRUE;

    gboolean handled = FALSE;

    entries = gtk_accel_group_query(s->accel_group, key->keyval,

                                    key->state, &n_entries);

    if (n_entries) {

        const char *quark = g_quark_to_string(entries[0].accel_path_quark);

        if (gd_is_grab_active(s) && strstart(quark, "<QEMU>/File/", NULL)) {

            propagate_accel = FALSE;

        }

    }

    if (!handled && propagate_accel) {

        handled = gtk_window_activate_key(GTK_WINDOW(widget), key);

    }

    if (handled) {

        gtk_release_modifiers(s);

    } else {

        handled = gtk_window_propagate_key_event(GTK_WINDOW(widget), key);

    }

    return handled;

}


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

     set_feature(&cpu->env, ARM_FEATURE_VFP);

+    set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS);
+
+    set_feature(&cpu->env, ARM_FEATURE_CACHE_TEST_CLEAN);
+
+
     cpu->midr = 0x41069265;

     cpu->reset_fpsid = 0x41011090;

static void arm926_initfn(Object *obj)

{

    ARMCPU *cpu = ARM_CPU(obj);

    cpu->dtb_compatible = "arm,arm926";

    set_feature(&cpu->env, ARM_FEATURE_V5);

    set_feature(&cpu->env, ARM_FEATURE_VFP);

    set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS);

    set_feature(&cpu->env, ARM_FEATURE_CACHE_TEST_CLEAN);

    cpu->midr = 0x41069265;

    cpu->reset_fpsid = 0x41011090;

    cpu->ctr = 0x1dd20d2;

    cpu->reset_sctlr = 0x00090078;

}


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

+{

     gen_set_cpsr(cpsr, 0xffffffff);

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

{

    gen_set_cpsr(cpsr, 0xffffffff);

    dead_tmp(cpsr);

    store_reg(s, 15, pc);

    s->is_jmp = DISAS_UPDATE;

}


int do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data)

{

    MigrationState *s = current_migration;

    if (s)

        s->cancel(s);

    return 0;

}


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

+
+    pci_register_bar(dev, bar_nr, PCI_BASE_ADDRESS_SPACE_MEMORY,
+
+                     &dev->msix_exclusive_bar);
+

     return 0;

int msix_init_exclusive_bar(PCIDevice *dev, unsigned short nentries,

                            uint8_t bar_nr)

{

    int ret;

    char *name;

    /*

     * Migration compatibility dictates that this remains a 4k

     * BAR with the vector table in the lower half and PBA in

     * the upper half.  Do not use these elsewhere!

     */

#define MSIX_EXCLUSIVE_BAR_SIZE 4096

#define MSIX_EXCLUSIVE_BAR_TABLE_OFFSET 0

#define MSIX_EXCLUSIVE_BAR_PBA_OFFSET (MSIX_EXCLUSIVE_BAR_SIZE / 2)

#define MSIX_EXCLUSIVE_CAP_OFFSET 0

    if (nentries * PCI_MSIX_ENTRY_SIZE > MSIX_EXCLUSIVE_BAR_PBA_OFFSET) {

        return -EINVAL;

    }

    name = g_strdup_printf("%s-msix", dev->name);

    memory_region_init(&dev->msix_exclusive_bar, OBJECT(dev), name, MSIX_EXCLUSIVE_BAR_SIZE);

    g_free(name);

    ret = msix_init(dev, nentries, &dev->msix_exclusive_bar, bar_nr,

                    MSIX_EXCLUSIVE_BAR_TABLE_OFFSET, &dev->msix_exclusive_bar,

                    bar_nr, MSIX_EXCLUSIVE_BAR_PBA_OFFSET,

                    MSIX_EXCLUSIVE_CAP_OFFSET);

    if (ret) {

        return ret;

    }

    pci_register_bar(dev, bar_nr, PCI_BASE_ADDRESS_SPACE_MEMORY,

                     &dev->msix_exclusive_bar);

    return 0;

}


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

     if (!so->entry) {

+        return NULL;
+
+    }
+
+    tail->next = g_malloc0(size);

     return tail->next;

static GenericList *qmp_input_next_list(Visitor *v, GenericList *tail,

                                        size_t size)

{

    QmpInputVisitor *qiv = to_qiv(v);

    StackObject *so = &qiv->stack[qiv->nb_stack - 1];

    if (!so->entry) {

        return NULL;

    }

    tail->next = g_malloc0(size);

    return tail->next;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 size_t qemu_file_set_rate_limit(QEMUFile *f, size_t new_rate)
+
 {

     if (f->set_rate_limit)

size_t qemu_file_set_rate_limit(QEMUFile *f, size_t new_rate)

{

    if (f->set_rate_limit)

        return f->set_rate_limit(f->opaque, new_rate);

    return 0;

}


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

     XtensaCPU *cpu = XTENSA_CPU(obj);

+    XtensaCPUClass *xcc = XTENSA_CPU_GET_CLASS(obj);

     CPUXtensaState *env = &cpu->env;

static void xtensa_cpu_initfn(Object *obj)

{

    CPUState *cs = CPU(obj);

    XtensaCPU *cpu = XTENSA_CPU(obj);

    XtensaCPUClass *xcc = XTENSA_CPU_GET_CLASS(obj);

    CPUXtensaState *env = &cpu->env;

    static bool tcg_inited;

    cs->env_ptr = env;

    env->config = xcc->config;

    cpu_exec_init(cs, &error_abort);

    if (tcg_enabled() && !tcg_inited) {

        tcg_inited = true;

        xtensa_translate_init();

    }

}


--- a/source.c
+++ b/source.c
@@ -7,8 +7,8 @@
     height = (height + 1) & ~1;

     if (quality >= 0)
+
+        get_quant_quality(c, quality);

     if (width != c->width || height != c->height) {

static int codec_reinit(AVCodecContext *avctx, int width, int height, int quality) {

    NuvContext *c = avctx->priv_data;

    width = (width + 1) & ~1;

    height = (height + 1) & ~1;

    if (quality >= 0)

        get_quant_quality(c, quality);

    if (width != c->width || height != c->height) {

        if (av_image_check_size(height, width, 0, avctx) < 0)

            return 0;

        avctx->width = c->width = width;

        avctx->height = c->height = height;

        c->decomp_size = c->height * c->width * 3 / 2;

        c->decomp_buf = av_realloc(c->decomp_buf, c->decomp_size + AV_LZO_OUTPUT_PADDING);

        if (!c->decomp_buf) {

            av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");

            return 0;

        }

        rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq);

    } else if (quality != c->quality)

        rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq);

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void chomp3(ChannelData *ctx, int16_t *output, uint8_t val,

+                   const uint16_t tab1[],

                    const int16_t *tab2, int tab2_stride,

static void chomp3(ChannelData *ctx, int16_t *output, uint8_t val,

                   const uint16_t tab1[],

                   const int16_t *tab2, int tab2_stride,

                   uint32_t numChannels)

{

    int16_t current;

    current = tab2[((ctx->index & 0x7f0) >> 4)*tab2_stride + val];

    current = mace_broken_clip_int16(current + ctx->lev);

    ctx->lev = current - (current >> 3);

    *output = QT_8S_2_16S(current);

    if (( ctx->index += tab1[val]-(ctx->index >> 5) ) < 0)

        ctx->index = 0;

}


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

 {

+    int ret = qcow2_check_metadata_overlap(bs, ign, offset, size);

+
+
+    if (ret < 0) {
+
+        return ret;
+
     } else if (ret > 0) {

         int metadata_ol_bitnr = ffs(ret) - 1;

int qcow2_pre_write_overlap_check(BlockDriverState *bs, int ign, int64_t offset,

                                  int64_t size)

{

    int ret = qcow2_check_metadata_overlap(bs, ign, offset, size);

    if (ret < 0) {

        return ret;

    } else if (ret > 0) {

        int metadata_ol_bitnr = ffs(ret) - 1;

        char *message;

        assert(metadata_ol_bitnr < QCOW2_OL_MAX_BITNR);

        fprintf(stderr, "qcow2: Preventing invalid write on metadata (overlaps "

                "with %s); image marked as corrupt.\n",

                metadata_ol_names[metadata_ol_bitnr]);

        message = g_strdup_printf("Prevented %s overwrite",

                metadata_ol_names[metadata_ol_bitnr]);

        qapi_event_send_block_image_corrupted(bdrv_get_device_name(bs),

                                              message,

                                              true,

                                              offset,

                                              true,

                                              size,

                                              true,

                                              &error_abort);

        g_free(message);

        qcow2_mark_corrupt(bs);

        bs->drv = NULL; /* make BDS unusable */

        return -EIO;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 QDict *qdict_get_qdict(const QDict *qdict, const char *key)
+
 {

     return qobject_to_qdict(qdict_get_obj(qdict, key, QTYPE_QDICT));

QDict *qdict_get_qdict(const QDict *qdict, const char *key)

{

    return qobject_to_qdict(qdict_get_obj(qdict, key, QTYPE_QDICT));

}


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

         if (!id_wellformed(id)) {
+
+            error_set(errp,QERR_INVALID_PARAMETER_VALUE, "id", "an identifier");
+
+#if 0 /* conversion from qerror_report() to error_set() broke this: */
+
             error_printf_unless_qmp("Identifiers consist of letters, digits, '-', '.', '_', starting with a letter.\n");

 #endif

QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id,

                           int fail_if_exists, Error **errp)

{

    QemuOpts *opts = NULL;

    if (id) {

        if (!id_wellformed(id)) {

            error_set(errp,QERR_INVALID_PARAMETER_VALUE, "id", "an identifier");

#if 0 /* conversion from qerror_report() to error_set() broke this: */

            error_printf_unless_qmp("Identifiers consist of letters, digits, '-', '.', '_', starting with a letter.\n");

#endif

            return NULL;

        }

        opts = qemu_opts_find(list, id);

        if (opts != NULL) {

            if (fail_if_exists && !list->merge_lists) {

                error_setg(errp, "Duplicate ID '%s' for %s", id, list->name);

                return NULL;

            } else {

                return opts;

            }

        }

    } else if (list->merge_lists) {

        opts = qemu_opts_find(list, NULL);

        if (opts) {

            return opts;

        }

    }

    opts = g_malloc0(sizeof(*opts));

    opts->id = g_strdup(id);

    opts->list = list;

    loc_save(&opts->loc);

    QTAILQ_INIT(&opts->head);

    QTAILQ_INSERT_TAIL(&list->head, opts, next);

    return opts;

}


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

 {

+    sigset_t set, oldset;
+
+    int err;
+
     pthread_attr_t attr;

void qemu_thread_create(QemuThread *thread, const char *name,

                       void *(*start_routine)(void*),

                       void *arg, int mode)

{

    sigset_t set, oldset;

    int err;

    pthread_attr_t attr;

    err = pthread_attr_init(&attr);

    if (err) {

        error_exit(err, __func__);

    }

    if (mode == QEMU_THREAD_DETACHED) {

        err = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);

        if (err) {

            error_exit(err, __func__);

        }

    }

    /* Leave signal handling to the iothread.  */

    sigfillset(&set);

    pthread_sigmask(SIG_SETMASK, &set, &oldset);

    err = pthread_create(&thread->thread, &attr, start_routine, arg);

    if (err)

        error_exit(err, __func__);

    if (name_threads) {

        qemu_thread_set_name(thread, name);

    }

    pthread_sigmask(SIG_SETMASK, &oldset, NULL);

    pthread_attr_destroy(&attr);

}


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

                             MemoryRegionSection *section)

+{
+
     cpu_register_physical_memory_log(section, section->readonly);

 }

static void core_region_add(MemoryListener *listener,

                            MemoryRegionSection *section)

{

    cpu_register_physical_memory_log(section, section->readonly);

}


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

         fprintf(stderr, "Nonono!\n");

+    mapping_t* mapping;
+
+    direntry_t* direntry;
+
+    assert(vvv->mapping.size >= vvv->mapping.item_size * vvv->mapping.next);

     assert(vvv->directory.size >= vvv->directory.item_size * vvv->directory.next);

static void checkpoint(void) {

    assert(((mapping_t*)array_get(&(vvv->mapping), 0))->end == 2);

    check1(vvv);

    check2(vvv);

    assert(!vvv->current_mapping || vvv->current_fd || (vvv->current_mapping->mode & MODE_DIRECTORY));

#if 0

    if (((direntry_t*)vvv->directory.pointer)[1].attributes != 0xf)

        fprintf(stderr, "Nonono!\n");

    mapping_t* mapping;

    direntry_t* direntry;

    assert(vvv->mapping.size >= vvv->mapping.item_size * vvv->mapping.next);

    assert(vvv->directory.size >= vvv->directory.item_size * vvv->directory.next);

    if (vvv->mapping.next<47)

        return;

    assert((mapping = array_get(&(vvv->mapping), 47)));

    assert(mapping->dir_index < vvv->directory.next);

    direntry = array_get(&(vvv->directory), mapping->dir_index);

    assert(!memcmp(direntry->name, "USB     H  ", 11) || direntry->name[0]==0);

#endif

}


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

     if (HAVE_NEON) {

+        s->fft_permute  = ff_fft_permute_neon;
+
+        s->fft_calc     = ff_fft_calc_neon;
+
+        s->imdct_calc   = ff_imdct_calc_neon;

         s->imdct_half   = ff_imdct_half_neon;

av_cold void ff_fft_init_arm(FFTContext *s)

{

    if (HAVE_NEON) {

        s->fft_permute  = ff_fft_permute_neon;

        s->fft_calc     = ff_fft_calc_neon;

        s->imdct_calc   = ff_imdct_calc_neon;

        s->imdct_half   = ff_imdct_half_neon;

        s->mdct_calc    = ff_mdct_calc_neon;

        s->permutation  = FF_MDCT_PERM_INTERLEAVE;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline void RENAME(yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,

 	unsigned int width, unsigned int height,

static inline void RENAME(yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,

	unsigned int width, unsigned int height,

	int lumStride, int chromStride, int dstStride)

{

	RENAME(yuvPlanartoyuy2)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 1);

}


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

     cpu_outb(addr & IOPORTS_MASK, val);
+
+}

static void pci_apb_iowriteb (void *opaque, target_phys_addr_t addr,

                                  uint32_t val)

{

    cpu_outb(addr & IOPORTS_MASK, val);

}


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

 {

static uint64_t addrrange_end(AddrRange r)

{

    return r.start + r.size;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void init_excp_4xx_real (CPUPPCState *env)
+
 {

 #if !defined(CONFIG_USER_ONLY)
@@ -9,11 +9,11 @@
     env->excp_vectors[POWERPC_EXCP_MCHECK]   = 0x00000200;

     env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
+
+    env->excp_vectors[POWERPC_EXCP_ALIGN]    = 0x00000600;
+
     env->excp_vectors[POWERPC_EXCP_PROGRAM]  = 0x00000700;
+
     env->excp_vectors[POWERPC_EXCP_SYSCALL]  = 0x00000C00;

     env->excp_vectors[POWERPC_EXCP_PIT]      = 0x00001000;

static void init_excp_4xx_real (CPUPPCState *env)

{

#if !defined(CONFIG_USER_ONLY)

    env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000100;

    env->excp_vectors[POWERPC_EXCP_MCHECK]   = 0x00000200;

    env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;

    env->excp_vectors[POWERPC_EXCP_ALIGN]    = 0x00000600;

    env->excp_vectors[POWERPC_EXCP_PROGRAM]  = 0x00000700;

    env->excp_vectors[POWERPC_EXCP_SYSCALL]  = 0x00000C00;

    env->excp_vectors[POWERPC_EXCP_PIT]      = 0x00001000;

    env->excp_vectors[POWERPC_EXCP_FIT]      = 0x00001010;

    env->excp_vectors[POWERPC_EXCP_WDT]      = 0x00001020;

    env->excp_vectors[POWERPC_EXCP_DEBUG]    = 0x00002000;

    env->excp_prefix = 0x00000000;

    env->ivor_mask = 0x0000FFF0;

    env->ivpr_mask = 0xFFFF0000;

    /* Hardware reset vector */

    env->hreset_vector = 0xFFFFFFFCUL;

#endif

}


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

     bdrv_register(&bdrv_https);
+
+    bdrv_register(&bdrv_ftp);
+
     bdrv_register(&bdrv_ftps);

     bdrv_register(&bdrv_tftp);

static void curl_block_init(void)

{

    bdrv_register(&bdrv_http);

    bdrv_register(&bdrv_https);

    bdrv_register(&bdrv_ftp);

    bdrv_register(&bdrv_ftps);

    bdrv_register(&bdrv_tftp);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int rv34_decoder_alloc(RV34DecContext *r)

+{
+
+    r->intra_types_stride = r->s.mb_width * 4 + 4;

static int rv34_decoder_alloc(RV34DecContext *r)

{

    r->intra_types_stride = r->s.mb_width * 4 + 4;

    r->cbp_chroma       = av_malloc(r->s.mb_stride * r->s.mb_height *

                                    sizeof(*r->cbp_chroma));

    r->cbp_luma         = av_malloc(r->s.mb_stride * r->s.mb_height *

                                    sizeof(*r->cbp_luma));

    r->deblock_coefs    = av_malloc(r->s.mb_stride * r->s.mb_height *

                                    sizeof(*r->deblock_coefs));

    r->intra_types_hist = av_malloc(r->intra_types_stride * 4 * 2 *

                                    sizeof(*r->intra_types_hist));

    r->mb_type          = av_mallocz(r->s.mb_stride * r->s.mb_height *

                                     sizeof(*r->mb_type));

    if (!(r->cbp_chroma       && r->cbp_luma && r->deblock_coefs &&

          r->intra_types_hist && r->mb_type)) {

        rv34_decoder_free(r);

        return AVERROR(ENOMEM);

    }

    r->intra_types = r->intra_types_hist + r->intra_types_stride * 4;

    return 0;

}


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

     int val;

+    int s;

int tcp_start_incoming_migration(const char *host_port)

{

    struct sockaddr_in addr;

    int val;

    int s;

    if (parse_host_port(&addr, host_port) < 0) {

        fprintf(stderr, "invalid host/port combination: %s\n", host_port);

        return -EINVAL;

    }

    s = socket(PF_INET, SOCK_STREAM, 0);

    if (s == -1)

        return -socket_error();

    val = 1;

    setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (const char *)&val, sizeof(val));

    if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) == -1)

        goto err;

    if (listen(s, 1) == -1)

        goto err;

    qemu_set_fd_handler2(s, NULL, tcp_accept_incoming_migration, NULL,

                         (void *)(unsigned long)s);

    return 0;

err:

    close(s);

    return -socket_error();

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static int mlib_YUV2RGB420_24(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,

+             int srcSliceH, uint8_t* dst[], int dstStride[]){
+
     if(c->srcFormat == PIX_FMT_YUV422P){

+	srcStride[1] *= 2;

 	srcStride[2] *= 2;

static int mlib_YUV2RGB420_24(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,

             int srcSliceH, uint8_t* dst[], int dstStride[]){

    if(c->srcFormat == PIX_FMT_YUV422P){

	srcStride[1] *= 2;

	srcStride[2] *= 2;

    }

    assert(srcStride[1] == srcStride[2]);

    mlib_VideoColorYUV2RGB420(dst[0]+srcSliceY*dstStride[0], src[0], src[1], src[2], c->dstW,

			     srcSliceH, dstStride[0], srcStride[0], srcStride[1]);

    return srcSliceH;

}


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

         return ff_neterrno();

+
+
+    ret = poll(&lp, 1, timeout >= 0 ? timeout : -1);
+
+    if (ret <= 0)

         return AVERROR(ETIMEDOUT);

int ff_listen_bind(int fd, const struct sockaddr *addr,

                   socklen_t addrlen, int timeout)

{

    int ret;

    int reuse = 1;

    struct pollfd lp = { fd, POLLIN, 0 };

    setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse));

    ret = bind(fd, addr, addrlen);

    if (ret)

        return ff_neterrno();

    ret = listen(fd, 1);

    if (ret)

        return ff_neterrno();

    ret = poll(&lp, 1, timeout >= 0 ? timeout : -1);

    if (ret <= 0)

        return AVERROR(ETIMEDOUT);

    ret = accept(fd, NULL, NULL);

    if (ret < 0)

        return ff_neterrno();

    closesocket(fd);

    ff_socket_nonblock(ret, 1);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 av_cold int vp56_free(AVCodecContext *avctx)
 {
     VP56Context *s = avctx->priv_data;
+    int pt;
+    av_freep(&s->qscale_table);
+    av_freep(&s->above_blocks);
     av_freep(&s->macroblocks);
     av_freep(&s->edge_emu_buffer_alloc);
     if (s->framep[VP56_FRAME_GOLDEN]->data[0])

av_cold int vp56_free(AVCodecContext *avctx)
{
    VP56Context *s = avctx->priv_data;
    int pt;
    av_freep(&s->qscale_table);
    av_freep(&s->above_blocks);
    av_freep(&s->macroblocks);
    av_freep(&s->edge_emu_buffer_alloc);
    if (s->framep[VP56_FRAME_GOLDEN]->data[0])
        avctx->release_buffer(avctx, s->framep[VP56_FRAME_GOLDEN]);
    if (s->framep[VP56_FRAME_GOLDEN2]->data[0])
        avctx->release_buffer(avctx, s->framep[VP56_FRAME_GOLDEN2]);
    if (s->framep[VP56_FRAME_PREVIOUS]->data[0])
        avctx->release_buffer(avctx, s->framep[VP56_FRAME_PREVIOUS]);
    return 0;


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline unsigned char gif_clut_index(uint8_t r, uint8_t g, uint8_t b)

 {

static inline unsigned char gif_clut_index(uint8_t r, uint8_t g, uint8_t b)

{

    return ((((r)/47)%6)*6*6+(((g)/47)%6)*6+(((b)/47)%6));

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int tls_read(URLContext *h, uint8_t *buf, int size)

+{
+
     TLSContext *c = h->priv_data;

     size_t processed = 0;

static int tls_read(URLContext *h, uint8_t *buf, int size)

{

    TLSContext *c = h->priv_data;

    size_t processed = 0;

    int ret = SSLRead(c->ssl_context, buf, size, &processed);

    ret = map_ssl_error(ret, processed);

    if (ret > 0)

        return ret;

    if (ret == 0)

        return AVERROR_EOF;

    return print_tls_error(h, ret);

}


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

     while (nb_sectors > 0) {

+        ret = cow_co_is_allocated(bs, sector_num, nb_sectors, &n);
+
+        if (ret < 0) {
+
+            return ret;

         }

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

                                 uint8_t *buf, int nb_sectors)

{

    BDRVCowState *s = bs->opaque;

    int ret, n;

    while (nb_sectors > 0) {

        ret = cow_co_is_allocated(bs, sector_num, nb_sectors, &n);

        if (ret < 0) {

            return ret;

        }

        if (ret) {

            ret = bdrv_pread(bs->file,

                        s->cow_sectors_offset + sector_num * 512,

                        buf, n * 512);

            if (ret < 0) {

                return ret;

            }

        } else {

            if (bs->backing_hd) {

                /* read from the base image */

                ret = bdrv_read(bs->backing_hd, sector_num, buf, n);

                if (ret < 0) {

                    return ret;

                }

            } else {

                memset(buf, 0, n * 512);

            }

        }

        nb_sectors -= n;

        sector_num += n;

        buf += n * 512;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     uint16_t *src1w = (uint16_t *)src1;

     uint16_t *src2w = (uint16_t *)src2;
+
     width /= 2;

     src1_linesize /= 2;

static void blend_frames16_c(BLEND_FUNC_PARAMS)

{

    int line, pixel;

    uint16_t *dstw = (uint16_t *)dst;

    uint16_t *src1w = (uint16_t *)src1;

    uint16_t *src2w = (uint16_t *)src2;

    width /= 2;

    src1_linesize /= 2;

    src2_linesize /= 2;

    dst_linesize /= 2;

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

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

            dstw[pixel] = ((src1w[pixel] * factor1) + (src2w[pixel] * factor2) + half) >> shift;

        src1w += src1_linesize;

        src2w += src2_linesize;

        dstw  += dst_linesize;

    }

}


--- a/source.c
+++ b/source.c
@@ -3,4 +3,4 @@
     VMMouseState *s = container_of(d, VMMouseState, dev.qdev);
     s->status = 0xffff;
     s->queue_size = VMMOUSE_QUEUE_SIZE;
+}

static void vmmouse_reset(DeviceState *d)
{
    VMMouseState *s = container_of(d, VMMouseState, dev.qdev);
    s->status = 0xffff;
    s->queue_size = VMMOUSE_QUEUE_SIZE;
}


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

 {

+    int64_t total;
+
+    total = qemu_time;
+
+    if (total == 0)

         total = 1;

static void do_info_profile(Monitor *mon)

{

    int64_t total;

    total = qemu_time;

    if (total == 0)

        total = 1;

    monitor_printf(mon, "async time  %" PRId64 " (%0.3f)\n",

                   dev_time, dev_time / (double)ticks_per_sec);

    monitor_printf(mon, "qemu time   %" PRId64 " (%0.3f)\n",

                   qemu_time, qemu_time / (double)ticks_per_sec);

    monitor_printf(mon, "kqemu time  %" PRId64 " (%0.3f %0.1f%%) count=%"

                        PRId64 " int=%" PRId64 " excp=%" PRId64 " intr=%"

                        PRId64 "\n",

                   kqemu_time, kqemu_time / (double)ticks_per_sec,

                   kqemu_time / (double)total * 100.0,

                   kqemu_exec_count,

                   kqemu_ret_int_count,

                   kqemu_ret_excp_count,

                   kqemu_ret_intr_count);

    qemu_time = 0;

    kqemu_time = 0;

    kqemu_exec_count = 0;

    dev_time = 0;

    kqemu_ret_int_count = 0;

    kqemu_ret_excp_count = 0;

    kqemu_ret_intr_count = 0;

#ifdef CONFIG_KQEMU

    kqemu_record_dump();

#endif

}


--- a/source.c
+++ b/source.c
@@ -7,9 +7,9 @@
     QList *list = qlist_new();

+
+    qmp_output_add(qov, name, list);
+
     qmp_output_push(qov, list);

 }

static void qmp_output_start_list(Visitor *v, const char *name, Error **errp)

{

    QmpOutputVisitor *qov = to_qov(v);

    QList *list = qlist_new();

    qmp_output_add(qov, name, list);

    qmp_output_push(qov, list);

}


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

         /* A backend didn't support modern virtio. */

+       dev->max_rev = 0;
+
+   }
+
 }

static void virtio_ccw_post_plugged(DeviceState *d, Error **errp)

{

   VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d);

   VirtIODevice *vdev = virtio_bus_get_device(&dev->bus);

   if (!virtio_host_has_feature(vdev, VIRTIO_F_VERSION_1)) {

        /* A backend didn't support modern virtio. */

       dev->max_rev = 0;

   }

}


void timer_del(QEMUTimer *ts)

{

    QEMUTimer **pt, *t;

    pt = &ts->timer_list->active_timers;

    for(;;) {

        t = *pt;

        if (!t)

            break;

        if (t == ts) {

            *pt = t->next;

            break;

        }

        pt = &t->next;

    }

}


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

     int8_t *v = pv;

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

{

    int8_t *v = pv;

    qemu_get_s8s(f, v);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void qtest_add_func(const char *str, void (*fn))
+
+{

     gchar *path = g_strdup_printf("/%s/%s", qtest_get_arch(), str);

void qtest_add_func(const char *str, void (*fn))

{

    gchar *path = g_strdup_printf("/%s/%s", qtest_get_arch(), str);

    g_test_add_func(path, fn);

}


--- a/source.c
+++ b/source.c
@@ -41,11 +41,11 @@
         if (!(val & (GC_WR | GC_CR)))

             s->glob_cnt = val & GC_VALID_MASK;
+
+        dolog ("glob_cnt <- %#x (glob_cnt %#x)\n", val, s->glob_cnt);
+
+        break;
+
     case GLOB_STA:

         s->glob_sta &= ~(val & GS_WCLEAR_MASK);

static void nabm_writel (void *opaque, uint32_t addr, uint32_t val)

{

    PCIAC97LinkState *d = opaque;

    AC97LinkState *s = &d->ac97;

    AC97BusMasterRegs *r = NULL;

    uint32_t index = addr - s->base[1];

    switch (index) {

    case PI_BDBAR:

    case PO_BDBAR:

    case MC_BDBAR:

        r = &s->bm_regs[GET_BM (index)];

        r->bdbar = val & ~3;

        dolog ("BDBAR[%d] <- %#x (bdbar %#x)\n",

               GET_BM (index), val, r->bdbar);

        break;

    case GLOB_CNT:

        if (val & GC_WR)

            warm_reset (s);

        if (val & GC_CR)

            cold_reset (s);

        if (!(val & (GC_WR | GC_CR)))

            s->glob_cnt = val & GC_VALID_MASK;

        dolog ("glob_cnt <- %#x (glob_cnt %#x)\n", val, s->glob_cnt);

        break;

    case GLOB_STA:

        s->glob_sta &= ~(val & GS_WCLEAR_MASK);

        s->glob_sta |= (val & ~(GS_WCLEAR_MASK | GS_RO_MASK)) & GS_VALID_MASK;

        dolog ("glob_sta <- %#x (glob_sta %#x)\n", val, s->glob_sta);

        break;

    default:

        dolog ("U nabm writel %#x <- %#x\n", addr, val);

        break;

    }

}


--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
         return ret;

+
+    mdct->window = ff_ac3_window;
+
+
+
     FF_ALLOC_OR_GOTO(avctx, mdct->xcos1,    n4 * sizeof(*mdct->xcos1),    mdct_alloc_fail);

     FF_ALLOC_OR_GOTO(avctx, mdct->xsin1,    n4 * sizeof(*mdct->xsin1),    mdct_alloc_fail);

static av_cold int mdct_init(AVCodecContext *avctx, AC3MDCTContext *mdct,

                             int nbits)

{

    int i, n, n4, ret;

    n  = 1 << nbits;

    n4 = n >> 2;

    mdct->nbits = nbits;

    ret = fft_init(avctx, mdct, nbits - 2);

    if (ret)

        return ret;

    mdct->window = ff_ac3_window;

    FF_ALLOC_OR_GOTO(avctx, mdct->xcos1,    n4 * sizeof(*mdct->xcos1),    mdct_alloc_fail);

    FF_ALLOC_OR_GOTO(avctx, mdct->xsin1,    n4 * sizeof(*mdct->xsin1),    mdct_alloc_fail);

    FF_ALLOC_OR_GOTO(avctx, mdct->rot_tmp,  n  * sizeof(*mdct->rot_tmp),  mdct_alloc_fail);

    FF_ALLOC_OR_GOTO(avctx, mdct->cplx_tmp, n4 * sizeof(*mdct->cplx_tmp), mdct_alloc_fail);

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

        float alpha = 2.0 * M_PI * (i + 1.0 / 8.0) / n;

        mdct->xcos1[i] = FIX15(-cos(alpha));

        mdct->xsin1[i] = FIX15(-sin(alpha));

    }

    return 0;

mdct_alloc_fail:

    mdct_end(mdct);

    return AVERROR(ENOMEM);

}


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

 {

+    return s->chr_write(s, buf, len);

 }

int qemu_chr_fe_write(CharDriverState *s, const uint8_t *buf, int len)

{

    return s->chr_write(s, buf, len);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     BlockDriverCompletionFunc *cb, void *opaque)

 {
+
+    return bdrv_aio_writev(bs->file, sector_num, qiov, nb_sectors, cb, opaque);

 }

static BlockDriverAIOCB *raw_aio_writev(BlockDriverState *bs,

    int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,

    BlockDriverCompletionFunc *cb, void *opaque)

{

    return bdrv_aio_writev(bs->file, sector_num, qiov, nb_sectors, cb, opaque);

}


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

     PCMachineState *pcms = PC_MACHINE(hotplug_dev);
+

     if (pcms->acpi_dev) {

static void pc_cpu_plug(HotplugHandler *hotplug_dev,

                        DeviceState *dev, Error **errp)

{

    CPUArchId *found_cpu;

    HotplugHandlerClass *hhc;

    Error *local_err = NULL;

    PCMachineState *pcms = PC_MACHINE(hotplug_dev);

    if (pcms->acpi_dev) {

        hhc = HOTPLUG_HANDLER_GET_CLASS(pcms->acpi_dev);

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

        if (local_err) {

            goto out;

        }

    }

    /* increment the number of CPUs */

    pcms->boot_cpus++;

    if (dev->hotplugged) {

        rtc_set_cpus_count(pcms->rtc, pcms->boot_cpus);

        fw_cfg_modify_i16(pcms->fw_cfg, FW_CFG_NB_CPUS, pcms->boot_cpus);

    }

    found_cpu = pc_find_cpu_slot(pcms, CPU(dev), NULL);

    found_cpu->cpu = CPU(dev);

out:

    error_propagate(errp, local_err);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void scsi_req_data(SCSIRequest *req, int len)

+{

     trace_scsi_req_data(req->dev->id, req->lun, req->tag, len);

void scsi_req_data(SCSIRequest *req, int len)

{

    trace_scsi_req_data(req->dev->id, req->lun, req->tag, len);

    req->bus->ops->complete(req->bus, SCSI_REASON_DATA, req->tag, len);

}


--- 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_pull(gnutls_transport_ptr_t transport,

                            void *data,

                            size_t len) {

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

    int ret;

 retry:

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

    if (ret < 0) {

	if (errno == EINTR)

	    goto retry;

	return -1;

    }

    return ret;

}


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

     info->base->service = g_strdup(serv);

+    info->base->family = inet_netfamily(sa.ss_family);
+
+    info->base->websocket = client->websocket;
+
+

     if (client->tls) {

static VncClientInfo *qmp_query_vnc_client(const VncState *client)

{

    struct sockaddr_storage sa;

    socklen_t salen = sizeof(sa);

    char host[NI_MAXHOST];

    char serv[NI_MAXSERV];

    VncClientInfo *info;

    if (getpeername(client->csock, (struct sockaddr *)&sa, &salen) < 0) {

        return NULL;

    }

    if (getnameinfo((struct sockaddr *)&sa, salen,

                    host, sizeof(host),

                    serv, sizeof(serv),

                    NI_NUMERICHOST | NI_NUMERICSERV) < 0) {

        return NULL;

    }

    info = g_malloc0(sizeof(*info));

    info->base = g_malloc0(sizeof(*info->base));

    info->base->host = g_strdup(host);

    info->base->service = g_strdup(serv);

    info->base->family = inet_netfamily(sa.ss_family);

    info->base->websocket = client->websocket;

    if (client->tls) {

        info->x509_dname = qcrypto_tls_session_get_peer_name(client->tls);

        info->has_x509_dname = info->x509_dname != NULL;

    }

#ifdef CONFIG_VNC_SASL

    if (client->sasl.conn && client->sasl.username) {

        info->has_sasl_username = true;

        info->sasl_username = g_strdup(client->sasl.username);

    }

#endif

    return info;

}


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

     block_acct_done(bdrv_get_stats(n->conf.bs), &req->acct);

+    if (!ret) {
+
+        req->status = NVME_SUCCESS;
+
+    } else {

         req->status = NVME_INTERNAL_DEV_ERROR;

static void nvme_rw_cb(void *opaque, int ret)

{

    NvmeRequest *req = opaque;

    NvmeSQueue *sq = req->sq;

    NvmeCtrl *n = sq->ctrl;

    NvmeCQueue *cq = n->cq[sq->cqid];

    block_acct_done(bdrv_get_stats(n->conf.bs), &req->acct);

    if (!ret) {

        req->status = NVME_SUCCESS;

    } else {

        req->status = NVME_INTERNAL_DEV_ERROR;

    }

    qemu_sglist_destroy(&req->qsg);

    nvme_enqueue_req_completion(cq, req);

}


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

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

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

             AC3Block *block = &s->blocks[blk];
+
             uint8_t *exp   = block->exp[ch];

             int32_t *coef = block->fixed_coef[ch];

static void extract_exponents(AC3EncodeContext *s)

{

    int blk, ch, i;

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

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

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

            uint8_t *exp   = block->exp[ch];

            int32_t *coef = block->fixed_coef[ch];

            int exp_shift  = block->exp_shift[ch];

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

                int e;

                int v = abs(coef[i]);

                if (v == 0)

                    e = 24;

                else {

                    e = 23 - av_log2(v) + exp_shift;

                    if (e >= 24) {

                        e = 24;

                        coef[i] = 0;

                    }

                    av_assert2(e >= 0);

                }

                exp[i] = e;

            }

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -36,11 +36,11 @@
     memcpy(ctx->bands,     bands,     sizeof(ctx->bands[0])     *  num_lens);

     memcpy(ctx->num_bands, num_bands, sizeof(ctx->num_bands[0]) *  num_lens);
+
+
+
+    /* assign channels to groups (with virtual channels for coupling) */
+
     for (i = 0; i < num_groups; i++) {

         /* NOTE: Add 1 to handle the AAC chan_config without modification.

av_cold int ff_psy_init(FFPsyContext *ctx, AVCodecContext *avctx, int num_lens,

                        const uint8_t **bands, const int* num_bands,

                        int num_groups, const uint8_t *group_map)

{

    int i, j, k = 0;

    ctx->avctx = avctx;

    ctx->ch        = av_mallocz_array(sizeof(ctx->ch[0]), avctx->channels * 2);

    ctx->group     = av_mallocz_array(sizeof(ctx->group[0]), num_groups);

    ctx->bands     = av_malloc_array (sizeof(ctx->bands[0]),      num_lens);

    ctx->num_bands = av_malloc_array (sizeof(ctx->num_bands[0]),  num_lens);

    if (!ctx->ch || !ctx->group || !ctx->bands || !ctx->num_bands) {

        ff_psy_end(ctx);

        return AVERROR(ENOMEM);

    }

    memcpy(ctx->bands,     bands,     sizeof(ctx->bands[0])     *  num_lens);

    memcpy(ctx->num_bands, num_bands, sizeof(ctx->num_bands[0]) *  num_lens);

    /* assign channels to groups (with virtual channels for coupling) */

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

        /* NOTE: Add 1 to handle the AAC chan_config without modification.

         *       This has the side effect of allowing an array of 0s to map

         *       to one channel per group.

         */

        ctx->group[i].num_ch = group_map[i] + 1;

        for (j = 0; j < ctx->group[i].num_ch * 2; j++)

            ctx->group[i].ch[j]  = &ctx->ch[k++];

    }

    switch (ctx->avctx->codec_id) {

    case AV_CODEC_ID_AAC:

        ctx->model = &ff_aac_psy_model;

        break;

    }

    if (ctx->model->init)

        return ctx->model->init(ctx);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -8,11 +8,11 @@
     AVStream *st = s->streams[0];
     if (avio_read(pb, preamble, AUD_CHUNK_PREAMBLE_SIZE) !=
         AUD_CHUNK_PREAMBLE_SIZE)
+        return AVERROR(EIO);
+    /* validate the chunk */
+    if (AV_RL32(&preamble[4]) != AUD_CHUNK_SIGNATURE)
+    chunk_size = AV_RL16(&preamble[0]);
+    if (st->codecpar->codec_id == AV_CODEC_ID_WESTWOOD_SND1) {
         /* For Westwood SND1 audio we need to add the output size and input
            size to the start of the packet to match what is in VQA.
            Specifically, this is needed to signal when a packet should be

static int wsaud_read_packet(AVFormatContext *s,
                             AVPacket *pkt)
{
    AVIOContext *pb = s->pb;
    unsigned char preamble[AUD_CHUNK_PREAMBLE_SIZE];
    unsigned int chunk_size;
    int ret = 0;
    AVStream *st = s->streams[0];
    if (avio_read(pb, preamble, AUD_CHUNK_PREAMBLE_SIZE) !=
        AUD_CHUNK_PREAMBLE_SIZE)
        return AVERROR(EIO);
    /* validate the chunk */
    if (AV_RL32(&preamble[4]) != AUD_CHUNK_SIGNATURE)
    chunk_size = AV_RL16(&preamble[0]);
    if (st->codecpar->codec_id == AV_CODEC_ID_WESTWOOD_SND1) {
        /* For Westwood SND1 audio we need to add the output size and input
           size to the start of the packet to match what is in VQA.
           Specifically, this is needed to signal when a packet should be
           decoding as raw 8-bit pcm or variable-size ADPCM. */
        int out_size = AV_RL16(&preamble[2]);
        if ((ret = av_new_packet(pkt, chunk_size + 4)) < 0)
            return ret;
        if ((ret = avio_read(pb, &pkt->data[4], chunk_size)) != chunk_size)
            return ret < 0 ? ret : AVERROR(EIO);
        AV_WL16(&pkt->data[0], out_size);
        AV_WL16(&pkt->data[2], chunk_size);
        pkt->duration = out_size;
    } else {
        ret = av_get_packet(pb, pkt, chunk_size);
        if (ret != chunk_size)
            return AVERROR(EIO);
        /* 2 samples/byte, 1 or 2 samples per frame depending on stereo */
        pkt->duration = (chunk_size * 2) / st->codecpar->channels;
    pkt->stream_index = st->index;
    return ret;


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
     /* Create new timer */

     tb_env->decr_timer = qemu_new_timer(vm_clock, &cpu_ppc_decr_cb, env);
+
+#if defined(TARGET_PPC64H)
+
+    tb_env->hdecr_timer = qemu_new_timer(vm_clock, &cpu_ppc_hdecr_cb, env);
+
 #endif /* defined(TARGET_PPC64H) */

     cpu_ppc_set_tb_clk(env, freq);

clk_setup_cb cpu_ppc_tb_init (CPUState *env, uint32_t freq)

{

    ppc_tb_t *tb_env;

    tb_env = qemu_mallocz(sizeof(ppc_tb_t));

    if (tb_env == NULL)

        return NULL;

    env->tb_env = tb_env;

    /* Create new timer */

    tb_env->decr_timer = qemu_new_timer(vm_clock, &cpu_ppc_decr_cb, env);

#if defined(TARGET_PPC64H)

    tb_env->hdecr_timer = qemu_new_timer(vm_clock, &cpu_ppc_hdecr_cb, env);

#endif /* defined(TARGET_PPC64H) */

    cpu_ppc_set_tb_clk(env, freq);

    return &cpu_ppc_set_tb_clk;

}


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

     Coroutine *co;
+
+    CoWriteZeroes data = {

         .blk    = blk,

static int do_co_pwrite_zeroes(BlockBackend *blk, int64_t offset,

                               int64_t count, int flags, int64_t *total)

{

    Coroutine *co;

    CoWriteZeroes data = {

        .blk    = blk,

        .offset = offset,

        .count  = count,

        .total  = total,

        .flags  = flags,

        .done   = false,

    };

    if (count >> BDRV_SECTOR_BITS > INT_MAX) {

        return -ERANGE;

    }

    co = qemu_coroutine_create(co_pwrite_zeroes_entry);

    qemu_coroutine_enter(co, &data);

    while (!data.done) {

        aio_poll(blk_get_aio_context(blk), true);

    }

    if (data.ret < 0) {

        return data.ret;

    } else {

        return 1;

    }

}


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

     /* TODO SOCKET_ADDRESS_LEGACY_KIND_FD when fd has AF_UNIX */
+
+    vd->is_unix = saddr[0]->type == SOCKET_ADDRESS_LEGACY_KIND_UNIX;
+
+    sioc = qio_channel_socket_new();
+
     qio_channel_set_name(QIO_CHANNEL(sioc), "vnc-reverse");

     if (qio_channel_socket_connect_sync(sioc, saddr[0], errp) < 0) {

static int vnc_display_connect(VncDisplay *vd,

                               SocketAddressLegacy **saddr,

                               size_t nsaddr,

                               SocketAddressLegacy **wsaddr,

                               size_t nwsaddr,

                               Error **errp)

{

    /* connect to viewer */

    QIOChannelSocket *sioc = NULL;

    if (nwsaddr != 0) {

        error_setg(errp, "Cannot use websockets in reverse mode");

        return -1;

    }

    if (nsaddr != 1) {

        error_setg(errp, "Expected a single address in reverse mode");

        return -1;

    }

    /* TODO SOCKET_ADDRESS_LEGACY_KIND_FD when fd has AF_UNIX */

    vd->is_unix = saddr[0]->type == SOCKET_ADDRESS_LEGACY_KIND_UNIX;

    sioc = qio_channel_socket_new();

    qio_channel_set_name(QIO_CHANNEL(sioc), "vnc-reverse");

    if (qio_channel_socket_connect_sync(sioc, saddr[0], errp) < 0) {

        return -1;

    }

    vnc_connect(vd, sioc, false, false);

    object_unref(OBJECT(sioc));

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     if (addrlen < 0)

         return -TARGET_EINVAL;
+
+
+
+    addr = alloca(addrlen+1);
+

     ret = target_to_host_sockaddr(addr, target_addr, addrlen);

static abi_long do_bind(int sockfd, abi_ulong target_addr,

                        socklen_t addrlen)

{

    void *addr;

    abi_long ret;

    if (addrlen < 0)

        return -TARGET_EINVAL;

    addr = alloca(addrlen+1);

    ret = target_to_host_sockaddr(addr, target_addr, addrlen);

    if (ret)

        return ret;

    return get_errno(bind(sockfd, addr, addrlen));

}


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

     v9fs_synth_direntry(node, entry, off);

+    *result = entry;
+
+    return 0;
+
+}

static int v9fs_synth_get_dentry(V9fsSynthNode *dir, struct dirent *entry,

                                 struct dirent **result, off_t off)

{

    int i = 0;

    V9fsSynthNode *node;

    rcu_read_lock();

    QLIST_FOREACH(node, &dir->child, sibling) {

        /* This is the off child of the directory */

        if (i == off) {

            break;

        }

        i++;

    }

    rcu_read_unlock();

    if (!node) {

        /* end of directory */

        *result = NULL;

        return 0;

    }

    v9fs_synth_direntry(node, entry, off);

    *result = entry;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+uint64_t helper_addqv(CPUAlphaState *env, uint64_t op1, uint64_t op2)
+
+{
+
+    uint64_t tmp = op1;

+    op1 += op2;

     if (unlikely((tmp ^ op2 ^ (-1ULL)) & (tmp ^ op1) & (1ULL << 63))) {

uint64_t helper_addqv(CPUAlphaState *env, uint64_t op1, uint64_t op2)

{

    uint64_t tmp = op1;

    op1 += op2;

    if (unlikely((tmp ^ op2 ^ (-1ULL)) & (tmp ^ op1) & (1ULL << 63))) {

        arith_excp(env, GETPC(), EXC_M_IOV, 0);

    }

    return op1;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void kqemu_flush(CPUState *env, int global)
+
+{

     LOG_INT("kqemu_flush:\n");

void kqemu_flush(CPUState *env, int global)

{

    LOG_INT("kqemu_flush:\n");

    nb_pages_to_flush = KQEMU_FLUSH_ALL;

}


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

+                                ptrdiff_t stride)
+
 {

     avc_luma_vt_qrt_8w_msa(src - (stride * 2), stride, dst, stride, 8, 1);

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

                                ptrdiff_t stride)

{

    avc_luma_vt_qrt_8w_msa(src - (stride * 2), stride, dst, stride, 8, 1);

}


--- a/source.c
+++ b/source.c
@@ -49,11 +49,11 @@
     while (--n >= 0) {

         if (!virtio_queue_get_num(vdev, n)) {
+
+            continue;
+
+        }
+
         r = virtio_ccw_set_guest2host_notifier(dev, n, false, false);

         assert(r >= 0);

static void virtio_ccw_start_ioeventfd(VirtioCcwDevice *dev)

{

    VirtIODevice *vdev;

    int n, r;

    if (!(dev->flags & VIRTIO_CCW_FLAG_USE_IOEVENTFD) ||

        dev->ioeventfd_disabled ||

        dev->ioeventfd_started) {

        return;

    }

    vdev = virtio_bus_get_device(&dev->bus);

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

        if (!virtio_queue_get_num(vdev, n)) {

            continue;

        }

        r = virtio_ccw_set_guest2host_notifier(dev, n, true, true);

        if (r < 0) {

            goto assign_error;

        }

    }

    dev->ioeventfd_started = true;

    return;

  assign_error:

    while (--n >= 0) {

        if (!virtio_queue_get_num(vdev, n)) {

            continue;

        }

        r = virtio_ccw_set_guest2host_notifier(dev, n, false, false);

        assert(r >= 0);

    }

    dev->ioeventfd_started = false;

    /* Disable ioeventfd for this device. */

    dev->flags &= ~VIRTIO_CCW_FLAG_USE_IOEVENTFD;

    error_report("%s: failed. Fallback to userspace (slower).", __func__);

}


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

     video_qmax = atoi(arg);
+
+    if (video_qmax < 0 ||
+
+        video_qmax > 31) {

         fprintf(stderr, "qmax must be >= 1 and <= 31\n");

static void opt_qmax(const char *arg)

{

    video_qmax = atoi(arg);

    if (video_qmax < 0 ||

        video_qmax > 31) {

        fprintf(stderr, "qmax must be >= 1 and <= 31\n");

        exit(1);

    }

}


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

+    tb_env = g_malloc0(sizeof(ppc_tb_t));

     env->tb_env = tb_env;

clk_setup_cb cpu_ppc_tb_init (CPUPPCState *env, uint32_t freq)

{

    PowerPCCPU *cpu = ppc_env_get_cpu(env);

    ppc_tb_t *tb_env;

    tb_env = g_malloc0(sizeof(ppc_tb_t));

    env->tb_env = tb_env;

    tb_env->flags = PPC_DECR_UNDERFLOW_TRIGGERED;

    if (env->insns_flags & PPC_SEGMENT_64B) {

        /* All Book3S 64bit CPUs implement level based DEC logic */

        tb_env->flags |= PPC_DECR_UNDERFLOW_LEVEL;

    }

    /* Create new timer */

    tb_env->decr_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &cpu_ppc_decr_cb, cpu);

    if (0) {

        /* XXX: find a suitable condition to enable the hypervisor decrementer

         */

        tb_env->hdecr_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &cpu_ppc_hdecr_cb,

                                                cpu);

    } else {

        tb_env->hdecr_timer = NULL;

    }

    cpu_ppc_set_tb_clk(env, freq);

    return &cpu_ppc_set_tb_clk;

}


--- a/source.c
+++ b/source.c
@@ -3,10 +3,10 @@
                                         DeviceState *dev, Error **errp)

 {
+
+    sPAPRMachineState *spapr = SPAPR_MACHINE(hotplug_dev);
+
+    Error *local_err = NULL;

     PCDIMMDevice *dimm = PC_DIMM(dev);

static void spapr_memory_unplug_request(HotplugHandler *hotplug_dev,

                                        DeviceState *dev, Error **errp)

{

    sPAPRMachineState *spapr = SPAPR_MACHINE(hotplug_dev);

    Error *local_err = NULL;

    PCDIMMDevice *dimm = PC_DIMM(dev);

    PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);

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

    uint64_t size = memory_region_size(mr);

    uint32_t nr_lmbs = size / SPAPR_MEMORY_BLOCK_SIZE;

    uint64_t addr_start, addr;

    int i;

    sPAPRDRConnector *drc;

    addr_start = object_property_get_uint(OBJECT(dimm), PC_DIMM_ADDR_PROP,

                                         &local_err);

    if (local_err) {

        goto out;

    }

    spapr_pending_dimm_unplugs_add(spapr, nr_lmbs, dimm);

    addr = addr_start;

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

        drc = spapr_drc_by_id(TYPE_SPAPR_DRC_LMB,

                              addr / SPAPR_MEMORY_BLOCK_SIZE);

        g_assert(drc);

        spapr_drc_detach(drc);

        addr += SPAPR_MEMORY_BLOCK_SIZE;

    }

    drc = spapr_drc_by_id(TYPE_SPAPR_DRC_LMB,

                          addr_start / SPAPR_MEMORY_BLOCK_SIZE);

    spapr_hotplug_req_remove_by_count_indexed(SPAPR_DR_CONNECTOR_TYPE_LMB,

                                              nr_lmbs, spapr_drc_index(drc));

out:

    error_propagate(errp, local_err);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void verify_irqchip_in_kernel(Error **errp)

 {

static void verify_irqchip_in_kernel(Error **errp)

{

    if (kvm_irqchip_in_kernel()) {

        return;

    }

    error_setg(errp, "pci-assign requires KVM with in-kernel irqchip enabled");

}


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

     QLIST_FOREACH(timer_list, &clock->timerlists, list) {

+        timerlist_notify(timer_list);
+
+    }

 }

void qemu_clock_notify(QEMUClockType type)

{

    QEMUTimerList *timer_list;

    QEMUClock *clock = qemu_clock_ptr(type);

    QLIST_FOREACH(timer_list, &clock->timerlists, list) {

        timerlist_notify(timer_list);

    }

}


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

 {

+    return ((float) (mantissa * scale_factors[exp]));

 }

static inline float to_float(uint8_t exp, int16_t mantissa)

{

    return ((float) (mantissa * scale_factors[exp]));

}


--- a/source.c
+++ b/source.c
@@ -11,7 +11,7 @@
     if (type != E820_RAM) {

         /* old FW_CFG_E820_TABLE entry -- reservations only */
+
         if (index >= E820_NR_ENTRIES) {

             return -EBUSY;

int e820_add_entry(uint64_t address, uint64_t length, uint32_t type)

{

    int index = le32_to_cpu(e820_reserve.count);

    struct e820_entry *entry;

    if (type != E820_RAM) {

        /* old FW_CFG_E820_TABLE entry -- reservations only */

        if (index >= E820_NR_ENTRIES) {

            return -EBUSY;

        }

        entry = &e820_reserve.entry[index++];

        entry->address = cpu_to_le64(address);

        entry->length = cpu_to_le64(length);

        entry->type = cpu_to_le32(type);

        e820_reserve.count = cpu_to_le32(index);

    }

    /* new "etc/e820" file -- include ram too */

    e820_table = g_realloc(e820_table,

                           sizeof(struct e820_entry) * (e820_entries+1));

    e820_table[e820_entries].address = cpu_to_le64(address);

    e820_table[e820_entries].length = cpu_to_le64(length);

    e820_table[e820_entries].type = cpu_to_le32(type);

    e820_entries++;

    return e820_entries;

}