--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
                            int count, int copy)

 {
+
+    struct target_iovec *target_vec;
+
+    abi_ulong base;
+
     int i;

static abi_long lock_iovec(int type, struct iovec *vec, abi_ulong target_addr,

                           int count, int copy)

{

    struct target_iovec *target_vec;

    abi_ulong base;

    int i;

    target_vec = lock_user(VERIFY_READ, target_addr, count * sizeof(struct target_iovec), 1);

    if (!target_vec)

        return -TARGET_EFAULT;

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

        base = tswapal(target_vec[i].iov_base);

        vec[i].iov_len = tswapal(target_vec[i].iov_len);

        if (vec[i].iov_len != 0) {

            vec[i].iov_base = lock_user(type, base, vec[i].iov_len, copy);

            /* Don't check lock_user return value. We must call writev even

               if a element has invalid base address. */

        } else {

            /* zero length pointer is ignored */

            vec[i].iov_base = NULL;

        }

    }

    unlock_user (target_vec, target_addr, 0);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline void put_codeword(PutBitContext *pb, vorbis_enc_codebook *cb,

                                 int entry)

static inline void put_codeword(PutBitContext *pb, vorbis_enc_codebook *cb,

                                int entry)

{

    assert(entry >= 0);

    assert(entry < cb->nentries);

    assert(cb->lens[entry]);

    put_bits(pb, cb->lens[entry], cb->codewords[entry]);

}


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

     unsigned v = le ? bytestream2_get_le32u(gb) : bytestream2_get_be32u(gb);

+    return v;
+
 }

static unsigned tget_long(GetByteContext *gb, int le)

{

    unsigned v = le ? bytestream2_get_le32u(gb) : bytestream2_get_be32u(gb);

    return v;

}


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

 		tcg_gen_shri_tl(x, x, 4);

+
+
+		tcg_gen_and_tl(x, x, c);
+
+		tcg_gen_sub_tl(d, d, x);

 		tcg_temp_free(x);

static inline void t_gen_subx_carry(DisasContext *dc, TCGv d)

{

	if (dc->flagx_known) {

		if (dc->flags_x) {

			TCGv c;

			c = tcg_temp_new(TCG_TYPE_TL);

			t_gen_mov_TN_preg(c, PR_CCS);

			/* C flag is already at bit 0.  */

			tcg_gen_andi_tl(c, c, C_FLAG);

			tcg_gen_sub_tl(d, d, c);

			tcg_temp_free(c);

		}

	} else {

		TCGv x, c;

		x = tcg_temp_new(TCG_TYPE_TL);

		c = tcg_temp_new(TCG_TYPE_TL);

		t_gen_mov_TN_preg(x, PR_CCS);

		tcg_gen_mov_tl(c, x);

		/* Propagate carry into d if X is set. Branch free.  */

		tcg_gen_andi_tl(c, c, C_FLAG);

		tcg_gen_andi_tl(x, x, X_FLAG);

		tcg_gen_shri_tl(x, x, 4);

		tcg_gen_and_tl(x, x, c);

		tcg_gen_sub_tl(d, d, x);

		tcg_temp_free(x);

		tcg_temp_free(c);

	}

}


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

         }

+    }
+
+
+
+    if (found_codestream)

         return 1;

static int jp2_find_codestream(Jpeg2000DecoderContext *s)

{

    int32_t atom_size;

    int found_codestream = 0, search_range = 10;

    // Skip JPEG 2000 signature atom.

    s->buf += 12;

    while (!found_codestream && search_range) {

        atom_size = AV_RB32(s->buf);

        if (AV_RB32(s->buf + 4) == JP2_CODESTREAM) {

            found_codestream = 1;

            s->buf += 8;

        } else {

            s->buf += atom_size;

            search_range--;

        }

    }

    if (found_codestream)

        return 1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 QEMUFile *qemu_fopen_ops(void *opaque, const QEMUFileOps *ops)

+{
+
+    QEMUFile *f;
+

     f = g_malloc0(sizeof(QEMUFile));

QEMUFile *qemu_fopen_ops(void *opaque, const QEMUFileOps *ops)

{

    QEMUFile *f;

    f = g_malloc0(sizeof(QEMUFile));

    f->opaque = opaque;

    f->ops = ops;

    return f;

}


--- a/source.c
+++ b/source.c
@@ -1,21 +1,21 @@
 static inline void gen_op_arith_add(DisasContext *ctx, TCGv ret, TCGv arg1,

+                                    TCGv arg2, bool add_ca, bool compute_ca,

                                     bool compute_ov, bool compute_rc0)

+{
+
+    TCGv t0 = ret;
+

+
     if (((compute_ca && add_ca) || compute_ov)
+
         && (TCGV_EQUAL(ret, arg1) || TCGV_EQUAL(ret, arg2)))  {

         t0 = tcg_temp_new();
+
     }

static inline void gen_op_arith_add(DisasContext *ctx, TCGv ret, TCGv arg1,

                                    TCGv arg2, bool add_ca, bool compute_ca,

                                    bool compute_ov, bool compute_rc0)

{

    TCGv t0 = ret;

    if (((compute_ca && add_ca) || compute_ov)

        && (TCGV_EQUAL(ret, arg1) || TCGV_EQUAL(ret, arg2)))  {

        t0 = tcg_temp_new();

    }

    if (compute_ca) {

        TCGv zero = tcg_const_tl(0);

        if (add_ca) {

            tcg_gen_add2_tl(t0, cpu_ca, arg1, zero, cpu_ca, zero);

            tcg_gen_add2_tl(t0, cpu_ca, t0, cpu_ca, arg2, zero);

        } else {

            tcg_gen_add2_tl(t0, cpu_ca, arg1, zero, arg2, zero);

        }

        tcg_temp_free(zero);

    } else {

        tcg_gen_add_tl(t0, arg1, arg2);

        if (add_ca) {

            tcg_gen_add_tl(t0, t0, cpu_ca);

        }

    }

    if (compute_ov) {

        gen_op_arith_compute_ov(ctx, t0, arg1, arg2, 0);

    }

    if (unlikely(compute_rc0)) {

        gen_set_Rc0(ctx, t0);

    }

    if (!TCGV_EQUAL(t0, ret)) {

        tcg_gen_mov_tl(ret, t0);

        tcg_temp_free(t0);

    }

}


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

 {

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

{

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
         qemu_co_queue_wait(&bs->throttled_reqs[is_write]);

     }
+
+
+
+    /* the IO will be executed, do the accounting */
+
     throttle_account(&bs->throttle_state,

                      is_write,

static void bdrv_io_limits_intercept(BlockDriverState *bs,

                                     int nb_sectors,

                                     bool is_write)

{

    /* does this io must wait */

    bool must_wait = throttle_schedule_timer(&bs->throttle_state, is_write);

    /* if must wait or any request of this type throttled queue the IO */

    if (must_wait ||

        !qemu_co_queue_empty(&bs->throttled_reqs[is_write])) {

        qemu_co_queue_wait(&bs->throttled_reqs[is_write]);

    }

    /* the IO will be executed, do the accounting */

    throttle_account(&bs->throttle_state,

                     is_write,

                     nb_sectors * BDRV_SECTOR_SIZE);

    /* if the next request must wait -> do nothing */

    if (throttle_schedule_timer(&bs->throttle_state, is_write)) {

        return;

    }

    /* else queue next request for execution */

    qemu_co_queue_next(&bs->throttled_reqs[is_write]);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void ff_svq3_add_idct_c(uint8_t *dst, DCTELEM *block, int stride, int qp,

                             int dc)
+
 {

     const int qmul = svq3_dequant_coeff[qp];
@@ -22,10 +22,10 @@

+    for (i = 0; i < 4; i++) {
+
+        const int z0 = 13*(block[0 + 4*i] +    block[2 + 4*i]);
+
         const int z1 = 13*(block[0 + 4*i] -    block[2 + 4*i]);

         const int z2 =  7* block[1 + 4*i] - 17*block[3 + 4*i];

void ff_svq3_add_idct_c(uint8_t *dst, DCTELEM *block, int stride, int qp,

                            int dc)

{

    const int qmul = svq3_dequant_coeff[qp];

    int i;

    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

    if (dc) {

        dc = 13*13*((dc == 1) ? 1538*block[0] : ((qmul*(block[0] >> 3)) / 2));

        block[0] = 0;

    }

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

        const int z0 = 13*(block[0 + 4*i] +    block[2 + 4*i]);

        const int z1 = 13*(block[0 + 4*i] -    block[2 + 4*i]);

        const int z2 =  7* block[1 + 4*i] - 17*block[3 + 4*i];

        const int z3 = 17* block[1 + 4*i] +  7*block[3 + 4*i];

        block[0 + 4*i] = z0 + z3;

        block[1 + 4*i] = z1 + z2;

        block[2 + 4*i] = z1 - z2;

        block[3 + 4*i] = z0 - z3;

    }

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

        const int z0 = 13*(block[i + 4*0] +    block[i + 4*2]);

        const int z1 = 13*(block[i + 4*0] -    block[i + 4*2]);

        const int z2 =  7* block[i + 4*1] - 17*block[i + 4*3];

        const int z3 = 17* block[i + 4*1] +  7*block[i + 4*3];

        const int rr = (dc + 0x80000);

        dst[i + stride*0] = cm[ dst[i + stride*0] + (((z0 + z3)*qmul + rr) >> 20) ];

        dst[i + stride*1] = cm[ dst[i + stride*1] + (((z1 + z2)*qmul + rr) >> 20) ];

        dst[i + stride*2] = cm[ dst[i + stride*2] + (((z1 - z2)*qmul + rr) >> 20) ];

        dst[i + stride*3] = cm[ dst[i + stride*3] + (((z0 - z3)*qmul + rr) >> 20) ];

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static av_cold int che_configure(AACContext *ac,
+
                                  enum ChannelPosition che_pos,

                                  int type, int id, int *channels)

static av_cold int che_configure(AACContext *ac,

                                 enum ChannelPosition che_pos,

                                 int type, int id, int *channels)

{

    if (*channels >= MAX_CHANNELS)

        return AVERROR_INVALIDDATA;

    if (che_pos) {

        if (!ac->che[type][id]) {

            if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))

                return AVERROR(ENOMEM);

            ff_aac_sbr_ctx_init(ac, &ac->che[type][id]->sbr);

        }

        if (type != TYPE_CCE) {

            ac->output_element[(*channels)++] = &ac->che[type][id]->ch[0];

            if (type == TYPE_CPE ||

                (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1)) {

                ac->output_element[(*channels)++] = &ac->che[type][id]->ch[1];

            }

        }

    } else {

        if (ac->che[type][id])

            ff_aac_sbr_ctx_close(&ac->che[type][id]->sbr);

        av_freep(&ac->che[type][id]);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+static unsigned int virtqueue_get_head(VirtQueue *vq, unsigned int idx)
+
+{
+
+    unsigned int head;
+

+
     /* Grab the next descriptor number they're advertising, and increment

      * the index we've seen. */

static unsigned int virtqueue_get_head(VirtQueue *vq, unsigned int idx)

{

    unsigned int head;

    /* Grab the next descriptor number they're advertising, and increment

     * the index we've seen. */

    head = vring_avail_ring(vq, idx % vq->vring.num);

    /* If their number is silly, that's a fatal mistake. */

    if (head >= vq->vring.num) {

        error_report("Guest says index %u is available", head);

        exit(1);

    }

    return head;

}


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

+    if (ch == STI_TRACE_CONTROL_CHANNEL) {
+
+        /* Flush channel <i>value</i>.  */
+
+        qemu_chr_fe_write(s->chr, (const uint8_t *) "\r", 1);

     } else if (ch == STI_TRACE_CONSOLE_CHANNEL || 1) {

static void omap_sti_fifo_write(void *opaque, target_phys_addr_t addr,

                                uint64_t value, unsigned size)

{

    struct omap_sti_s *s = (struct omap_sti_s *) opaque;

    int ch = addr >> 6;

    uint8_t byte = value;

    if (size != 1) {

        return omap_badwidth_write8(opaque, addr, size);

    }

    if (ch == STI_TRACE_CONTROL_CHANNEL) {

        /* Flush channel value.  */

        qemu_chr_fe_write(s->chr, (const uint8_t *) "\r", 1);

    } else if (ch == STI_TRACE_CONSOLE_CHANNEL || 1) {

        if (value == 0xc0 || value == 0xc3) {

            /* Open channel ch.  */

        } else if (value == 0x00)

            qemu_chr_fe_write(s->chr, (const uint8_t *) "\n", 1);

        else

            qemu_chr_fe_write(s->chr, &byte, 1);

    }

}


--- 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
@@ -8,7 +8,7 @@

 {

+    ProresContext *ctx = avctx->priv_data;

     LOCAL_ALIGNED_16(int16_t, blocks, [8*4*64]);

static int decode_slice_chroma(AVCodecContext *avctx, SliceContext *slice,

                               uint16_t *dst, int dst_stride,

                               const uint8_t *buf, unsigned buf_size,

                               const int16_t *qmat, int log2_blocks_per_mb)

{

    ProresContext *ctx = avctx->priv_data;

    LOCAL_ALIGNED_16(int16_t, blocks, [8*4*64]);

    int16_t *block;

    GetBitContext gb;

    int i, j, blocks_per_slice = slice->mb_count << log2_blocks_per_mb;

    int ret;

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

        ctx->bdsp.clear_block(blocks+(i<<6));

    init_get_bits(&gb, buf, buf_size << 3);

    decode_dc_coeffs(&gb, blocks, blocks_per_slice);

    if ((ret = decode_ac_coeffs(avctx, &gb, blocks, blocks_per_slice)) < 0)

        return ret;

    block = blocks;

    for (i = 0; i < slice->mb_count; i++) {

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

            ctx->prodsp.idct_put(dst,              dst_stride, block+(0<<6), qmat);

            ctx->prodsp.idct_put(dst+4*dst_stride, dst_stride, block+(1<<6), qmat);

            block += 2*64;

            dst += 8;

        }

    }

    return 0;

}


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

 #if defined(__MINGW32__) || defined(CONFIG_OS2) || defined(__CYGWIN__)

+    access |= O_BINARY;
+
+#endif
+
+    fd = open(filename, access, 0666);

     if (fd < 0)

static int file_open(URLContext *h, const char *filename, int flags)

{

    int access;

    int fd;

    av_strstart(filename, "file:", &filename);

    if (flags & URL_RDWR) {

        access = O_CREAT | O_TRUNC | O_RDWR;

    } else if (flags & URL_WRONLY) {

        access = O_CREAT | O_TRUNC | O_WRONLY;

    } else {

        access = O_RDONLY;

    }

#if defined(__MINGW32__) || defined(CONFIG_OS2) || defined(__CYGWIN__)

    access |= O_BINARY;

#endif

    fd = open(filename, access, 0666);

    if (fd < 0)

        return AVERROR(ENOENT);

    h->priv_data = (void *)(size_t)fd;

    return 0;

}


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

     uint32_t dw10 = le32_to_cpu(cmd->cdw10);

+    uint32_t result;

static uint16_t nvme_get_feature(NvmeCtrl *n, NvmeCmd *cmd, NvmeRequest *req)

{

    uint32_t dw10 = le32_to_cpu(cmd->cdw10);

    uint32_t result;

    switch (dw10) {

    case NVME_VOLATILE_WRITE_CACHE:

        result = blk_enable_write_cache(n->conf.blk);

        break;

    case NVME_NUMBER_OF_QUEUES:

        result = cpu_to_le32((n->num_queues - 1) | ((n->num_queues - 1) << 16));

        break;

    default:

        return NVME_INVALID_FIELD | NVME_DNR;

    }

    req->cqe.result = result;

    return NVME_SUCCESS;

}


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

                        const uint8_t *src, const uint8_t *src_end)

+{

+    const uint8_t *frame_start = frame;
+
     const uint8_t *frame_end   = frame + width * height;

     int mask = 0x10000, bitbuf = 0;

static int decode_tsw1(uint8_t *frame, int width, int height,

                       const uint8_t *src, const uint8_t *src_end)

{

    const uint8_t *frame_start = frame;

    const uint8_t *frame_end   = frame + width * height;

    int mask = 0x10000, bitbuf = 0;

    int v, offset, count, segments;

    segments = bytestream_get_le32(&src);

    frame   += bytestream_get_le32(&src);

    if (frame < frame_start || frame > frame_end)

        return -1;

    while (segments--) {

        if (mask == 0x10000) {

            if (src >= src_end)

                return -1;

            bitbuf = bytestream_get_le16(&src);

            mask = 1;

        }

        if (src_end - src < 2 || frame_end - frame < 2)

            return -1;

        if (bitbuf & mask) {

            v = bytestream_get_le16(&src);

            offset = (v & 0x1FFF) << 1;

            count = ((v >> 13) + 2) << 1;

            if (frame - frame_start < offset || frame_end - frame < count)

                return -1;

            av_memcpy_backptr(frame, offset, count);

            frame += count;

        } else {

            *frame++ = *src++;

            *frame++ = *src++;

        }

        mask <<= 1;

    }

    return 0;

}


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

     }

+
+
+    return !QTAILQ_EMPTY(&s->pending_sei);
+
+}

int chsc_sei_nt2_have_event(void)

{

    S390pciState *s = S390_PCI_HOST_BRIDGE(

        object_resolve_path(TYPE_S390_PCI_HOST_BRIDGE, NULL));

    if (!s) {

        return 0;

    }

    return !QTAILQ_EMPTY(&s->pending_sei);

}


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

         info.ld_list[num_ld_disks].state = MFI_LD_STATE_OPTIMAL;

+        info.ld_list[num_ld_disks].size = cpu_to_le64(ld_size);
+
+        num_ld_disks++;
+
+    }

     info.ld_count = cpu_to_le32(num_ld_disks);

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

{

    struct mfi_ld_list info;

    size_t dcmd_size = sizeof(info), resid;

    uint32_t num_ld_disks = 0, max_ld_disks = s->fw_luns;

    uint64_t ld_size;

    BusChild *kid;

    memset(&info, 0, dcmd_size);

    if (cmd->iov_size < dcmd_size) {

        trace_megasas_dcmd_invalid_xfer_len(cmd->index, cmd->iov_size,

                                            dcmd_size);

        return MFI_STAT_INVALID_PARAMETER;

    }

    if (megasas_is_jbod(s)) {

        max_ld_disks = 0;

    }

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

        SCSIDevice *sdev = DO_UPCAST(SCSIDevice, qdev, kid->child);

        BlockConf *conf = &sdev->conf;

        if (num_ld_disks >= max_ld_disks) {

            break;

        }

        /* Logical device size is in blocks */

        bdrv_get_geometry(conf->bs, &ld_size);

        info.ld_list[num_ld_disks].ld.v.target_id = sdev->id;

        info.ld_list[num_ld_disks].ld.v.lun_id = sdev->lun;

        info.ld_list[num_ld_disks].state = MFI_LD_STATE_OPTIMAL;

        info.ld_list[num_ld_disks].size = cpu_to_le64(ld_size);

        num_ld_disks++;

    }

    info.ld_count = cpu_to_le32(num_ld_disks);

    trace_megasas_dcmd_ld_get_list(cmd->index, num_ld_disks, max_ld_disks);

    resid = dma_buf_read((uint8_t *)&info, dcmd_size, &cmd->qsg);

    cmd->iov_size = dcmd_size - resid;

    return MFI_STAT_OK;

}


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

         cpu_to_be16wu((uint16_t *)(data + sloc),

+                      do_cksum(data + css, data + n));
+
+}

putsum(uint8_t *data, uint32_t n, uint32_t sloc, uint32_t css, uint32_t cse)

{

    if (cse && cse < n)

        n = cse + 1;

    if (sloc < n-1)

        cpu_to_be16wu((uint16_t *)(data + sloc),

                      do_cksum(data + css, data + n));

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     s = g_malloc0(sizeof(mcf_intc_state));

     s->env = env;
+
+    mcf_intc_reset(s);
+
+
+
     memory_region_init_io(&s->iomem, &mcf_intc_ops, s, "mcf", 0x100);

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

qemu_irq *mcf_intc_init(MemoryRegion *sysmem,

                        target_phys_addr_t base,

                        CPUM68KState *env)

{

    mcf_intc_state *s;

    s = g_malloc0(sizeof(mcf_intc_state));

    s->env = env;

    mcf_intc_reset(s);

    memory_region_init_io(&s->iomem, &mcf_intc_ops, s, "mcf", 0x100);

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

    return qemu_allocate_irqs(mcf_intc_set_irq, s, 64);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 int coroutine_fn thread_pool_submit_co(ThreadPoolFunc *func, void *arg)

+{
+
+    ThreadPoolCo tpc = { .co = qemu_coroutine_self(), .ret = -EINPROGRESS };

     assert(qemu_in_coroutine());

int coroutine_fn thread_pool_submit_co(ThreadPoolFunc *func, void *arg)

{

    ThreadPoolCo tpc = { .co = qemu_coroutine_self(), .ret = -EINPROGRESS };

    assert(qemu_in_coroutine());

    thread_pool_submit_aio(func, arg, thread_pool_co_cb, &tpc);

    qemu_coroutine_yield();

    return tpc.ret;

}


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

 {

+    SCLPConsole *scon = SCLP_CONSOLE(event);
+
+
+
+    if (!scon->chr) {

         /* If there's no backend, we can just say we consumed all data. */

static ssize_t write_console_data(SCLPEvent *event, const uint8_t *buf,

                                  size_t len)

{

    SCLPConsole *scon = SCLP_CONSOLE(event);

    if (!scon->chr) {

        /* If there's no backend, we can just say we consumed all data. */

        return len;

    }

    return qemu_chr_fe_write_all(scon->chr, buf, len);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void qio_channel_test_validate(QIOChannelTest *test)

+{
+
     g_assert_cmpint(memcmp(test->input,

                            test->output,

void qio_channel_test_validate(QIOChannelTest *test)

{

    g_assert_cmpint(memcmp(test->input,

                           test->output,

                           test->len), ==, 0);

    g_assert(test->readerr == NULL);

    g_assert(test->writeerr == NULL);

    g_free(test->inputv);

    g_free(test->outputv);

    g_free(test->input);

    g_free(test->output);

    g_free(test);

}


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

             if (s->codec && s->codec->cts) {

+                s->codec->out.fifo[s->codec->out.len ++] =
+
+                        (value >> 24) & 0xff;
+
+                s->codec->out.fifo[s->codec->out.len ++] =

                         (value >> 16) & 0xff;

static void omap_mcbsp_writew(void *opaque, target_phys_addr_t addr,

                uint32_t value)

{

    struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) opaque;

    int offset = addr & OMAP_MPUI_REG_MASK;

    if (offset == 0x04) {				/* DXR */

        if (((s->xcr[0] >> 5) & 7) < 3)			/* XWDLEN1 */

            return;

        if (s->tx_req > 3) {

            s->tx_req -= 4;

            if (s->codec && s->codec->cts) {

                s->codec->out.fifo[s->codec->out.len ++] =

                        (value >> 24) & 0xff;

                s->codec->out.fifo[s->codec->out.len ++] =

                        (value >> 16) & 0xff;

                s->codec->out.fifo[s->codec->out.len ++] =

                        (value >> 8) & 0xff;

                s->codec->out.fifo[s->codec->out.len ++] =

                        (value >> 0) & 0xff;

            }

            if (s->tx_req < 4)

                omap_mcbsp_tx_done(s);

        } else

            printf("%s: Tx FIFO overrun\n", __FUNCTION__);

        return;

    }

    omap_badwidth_write16(opaque, addr, value);

}


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

     dc->vmsd = &vmstate_sysbus_esp_scsi;

+    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
+
+
+
+

 }

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    dc->realize = sysbus_esp_realize;

    dc->reset = sysbus_esp_hard_reset;

    dc->vmsd = &vmstate_sysbus_esp_scsi;

    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);

}


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

 {

+    avctx->pix_fmt             = PIX_FMT_YUV444P10;
+
     avctx->bits_per_raw_sample = 10;

static av_cold int v410_decode_init(AVCodecContext *avctx)

{

    avctx->pix_fmt             = PIX_FMT_YUV444P10;

    avctx->bits_per_raw_sample = 10;

    if (avctx->width & 1) {

        av_log(avctx, AV_LOG_ERROR, "v410 requires width to be even.\n");

        return AVERROR_INVALIDDATA;

    }

    avctx->coded_frame = avcodec_alloc_frame();

    if (!avctx->coded_frame) {

        av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");

        return AVERROR(ENOMEM);

    }

    return 0;

}


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

                             size_t len) {

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

  retry:

static ssize_t vnc_tls_push(gnutls_transport_ptr_t transport,

                            const void *data,

                            size_t len) {

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

    int ret;

 retry:

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

    if (ret < 0) {

	if (errno == EINTR)

	    goto retry;

	return -1;

    }

    return ret;

}


static void onenand_reset(OneNANDState *s, int cold)

{

    memset(&s->addr, 0, sizeof(s->addr));

    s->command = 0;

    s->count = 1;

    s->bufaddr = 0;

    s->config[0] = 0x40c0;

    s->config[1] = 0x0000;

    onenand_intr_update(s);

    qemu_irq_raise(s->rdy);

    s->status = 0x0000;

    s->intstatus = cold ? 0x8080 : 0x8010;

    s->unladdr[0] = 0;

    s->unladdr[1] = 0;

    s->wpstatus = 0x0002;

    s->cycle = 0;

    s->otpmode = 0;

    s->blk_cur = s->blk;

    s->current = s->image;

    s->secs_cur = s->secs;

    if (cold) {

        /* Lock the whole flash */

        memset(s->blockwp, ONEN_LOCK_LOCKED, s->blocks);

        if (s->blk_cur && blk_read(s->blk_cur, 0, s->boot[0], 8) < 0) {

            hw_error("%s: Loading the BootRAM failed.\n", __func__);

        }

    }

}


static void test_qemu_strtoull_underflow(void)

{

    const char *str = "-99999999999999999999999999999999999999999999";

    char f = 'X';

    const char *endptr = &f;

    uint64_t res = 999;

    int err;

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

    g_assert_cmpint(err, ==, -ERANGE);

    g_assert_cmpint(res, ==, -1);

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

}


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

 		return -errno;

+
+
+	/*
+
+	 * This looks weird, but the aio code only consideres a request

 	 * successfull if it has written the number full number of bytes.

static size_t handle_aiocb_ioctl(struct qemu_paiocb *aiocb)

{

	int ret;

	ret = ioctl(aiocb->aio_fildes, aiocb->aio_ioctl_cmd, aiocb->aio_ioctl_buf);

	if (ret == -1)

		return -errno;

	/*

	 * This looks weird, but the aio code only consideres a request

	 * successfull if it has written the number full number of bytes.

	 *

	 * Now we overload aio_nbytes as aio_ioctl_cmd for the ioctl command,

	 * so in fact we return the ioctl command here to make posix_aio_read()

	 * happy..

	 */

	return aiocb->aio_nbytes;

}


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

 {

+    const uint8_t *p;

     int c;

static inline int get16(const uint8_t **pp, const uint8_t *p_end)

{

    const uint8_t *p;

    int c;

    p = *pp;

    if ((p + 1) >= p_end)

        return AVERROR_INVALIDDATA;

    c   = AV_RB16(p);

    p  += 2;

    *pp = p;

    return c;

}


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

+    if (size > INT_MAX) {
+
+        return -EIO;
+
+    }

static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset,

                                   size_t size)

{

    int64_t len;

    if (size > INT_MAX) {

        return -EIO;

    }

    if (!bdrv_is_inserted(bs))

        return -ENOMEDIUM;

    if (bs->growable)

        return 0;

    len = bdrv_getlength(bs);

    if (offset < 0)

        return -EIO;

    if ((offset > len) || (len - offset < size))

        return -EIO;

    return 0;

}


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

                       const void *ptr_val)

+{

     uint8_t *entries_ptr = s->entries + 12 * s->num_entries;

+

     av_assert0(s->num_entries < TIFF_MAX_ENTRY);

static void add_entry(TiffEncoderContext * s,

                      enum TiffTags tag, enum TiffTypes type, int count,

                      const void *ptr_val)

{

    uint8_t *entries_ptr = s->entries + 12 * s->num_entries;

    av_assert0(s->num_entries < TIFF_MAX_ENTRY);

    bytestream_put_le16(&entries_ptr, tag);

    bytestream_put_le16(&entries_ptr, type);

    bytestream_put_le32(&entries_ptr, count);

    if (type_sizes[type] * count <= 4) {

        tnput(&entries_ptr, count, ptr_val, type, 0);

    } else {

        bytestream_put_le32(&entries_ptr, *s->buf - s->buf_start);

        check_size(s, count * type_sizes2[type]);

        tnput(s->buf, count, ptr_val, type, 0);

    }

    s->num_entries++;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 print_syscall_ret_addr(const struct syscallname *name, abi_long ret)

+{
+
     char *errstr = NULL;
+
+

     if (ret == -1) {

print_syscall_ret_addr(const struct syscallname *name, abi_long ret)

{

    char *errstr = NULL;

    if (ret == -1) {

        errstr = target_strerror(errno);

    }

    if ((ret == -1) && errstr) {

        gemu_log(" = -1 errno=%d (%s)\n", errno, errstr);

    } else {

        gemu_log(" = 0x" TARGET_ABI_FMT_lx "\n", ret);

    }

}


void input_type_enum(Visitor *v, int *obj, const char *strings[],

                     const char *kind, const char *name,

                     Error **errp)

{

    int64_t value = 0;

    char *enum_str;

    assert(strings);

    visit_type_str(v, &enum_str, name, errp);

    if (error_is_set(errp)) {

        return;

    }

    while (strings[value] != NULL) {

        if (strcmp(strings[value], enum_str) == 0) {

            break;

        }

        value++;

    }

    if (strings[value] == NULL) {

        error_set(errp, QERR_INVALID_PARAMETER, name ? name : "null");

        g_free(enum_str);

        return;

    }

    g_free(enum_str);

    *obj = value;

}


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

     bdrv_iostatus_reset(bs);

+}

static void iostatus_bdrv_it(void *opaque, BlockDriverState *bs)

{

    bdrv_iostatus_reset(bs);

}


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

     SliceArgs *slice_dat = arg;
+
     VC2EncContext *s = slice_dat->ctx;

     const int sx = slice_dat->x;
@@ -15,14 +15,14 @@
     const int64_t top = slice_dat->bits_ceil;

     const double percent = s->tolerance;
+
+    const double bottom = top - top*(percent/100.0f);

     int bits = count_hq_slice(s, sx, sy, quant);

     range -= range & 1; /* Make it an even number */
+
+    while ((bits > top) || (bits < bottom)) {

         range *= bits > top ? +1 : -1;

static int rate_control(AVCodecContext *avctx, void *arg)

{

    SliceArgs *slice_dat = arg;

    VC2EncContext *s = slice_dat->ctx;

    const int sx = slice_dat->x;

    const int sy = slice_dat->y;

    int quant_buf[2], bits_buf[2], quant = s->q_start, range = s->q_start/3;

    const int64_t top = slice_dat->bits_ceil;

    const double percent = s->tolerance;

    const double bottom = top - top*(percent/100.0f);

    int bits = count_hq_slice(s, sx, sy, quant);

    range -= range & 1; /* Make it an even number */

    while ((bits > top) || (bits < bottom)) {

        range *= bits > top ? +1 : -1;

        quant = av_clip(quant + range, 0, s->q_ceil);

        bits = count_hq_slice(s, sx, sy, quant);

        range = av_clip(range/2, 1, s->q_ceil);

        if (quant_buf[1] == quant) {

            quant = bits_buf[0] < bits ? quant_buf[0] : quant;

            bits = bits_buf[0] < bits ? bits_buf[0] : bits;

            break;

        }

        quant_buf[1] = quant_buf[0];

        quant_buf[0] = quant;

        bits_buf[1] = bits_buf[0];

        bits_buf[0] = bits;

    }

    slice_dat->quant_idx = av_clip(quant, 0, s->q_ceil);

    slice_dat->bytes = FFALIGN((bits >> 3), s->size_scaler) + 4 + s->prefix_bytes;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,21 +1,21 @@
 static void selfTest(uint8_t *src[3], int stride[3], int w, int h){
+
+	enum PixelFormat srcFormat, dstFormat;
+
+	int srcW, srcH, dstW, dstH;
+
+	int flags;
+
+
+
+	for(srcFormat = 0; srcFormat < PIX_FMT_NB; srcFormat++) {
+
+		for(dstFormat = 0; dstFormat < PIX_FMT_NB; dstFormat++) {
+
+			printf("%s -> %s\n",
+
+					sws_format_name(srcFormat),
+
 					sws_format_name(dstFormat));

static void selfTest(uint8_t *src[3], int stride[3], int w, int h){

	enum PixelFormat srcFormat, dstFormat;

	int srcW, srcH, dstW, dstH;

	int flags;

	for(srcFormat = 0; srcFormat < PIX_FMT_NB; srcFormat++) {

		for(dstFormat = 0; dstFormat < PIX_FMT_NB; dstFormat++) {

			printf("%s -> %s\n",

					sws_format_name(srcFormat),

					sws_format_name(dstFormat));

			srcW= w;

			srcH= h;

			for(dstW=w - w/3; dstW<= 4*w/3; dstW+= w/3){

				for(dstH=h - h/3; dstH<= 4*h/3; dstH+= h/3){

					for(flags=1; flags<33; flags*=2) {

						int res;

						res = doTest(src, stride, w, h, srcFormat, dstFormat,

							srcW, srcH, dstW, dstH, flags);

						if (res < 0) {

							dstW = 4 * w / 3;

							dstH = 4 * h / 3;

							flags = 33;

						}

					}

				}

			}

		}

	}

}


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

                                    DeviceState *dev, Error **errp)

+{
+
     HotplugHandlerClass *hhc;

     Error *local_err = NULL;

static void pc_dimm_unplug_request(HotplugHandler *hotplug_dev,

                                   DeviceState *dev, Error **errp)

{

    HotplugHandlerClass *hhc;

    Error *local_err = NULL;

    PCMachineState *pcms = PC_MACHINE(hotplug_dev);

    if (!pcms->acpi_dev) {

        error_setg(&local_err,

                   "memory hotplug is not enabled: missing acpi device");

        goto out;

    }

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

        error_setg(&local_err,

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

        goto out;

    }

    hhc = HOTPLUG_HANDLER_GET_CLASS(pcms->acpi_dev);

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

out:

    error_propagate(errp, local_err);

}


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

     if (reg == 15) {

+        tcg_gen_andi_i32(var, var, ~1);

         s->is_jmp = DISAS_JUMP;

static void store_reg(DisasContext *s, int reg, TCGv var)

{

    if (reg == 15) {

        tcg_gen_andi_i32(var, var, ~1);

        s->is_jmp = DISAS_JUMP;

    }

    tcg_gen_mov_i32(cpu_R[reg], var);

    dead_tmp(var);

}


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

     if (x->twopassbuffer) {

+        av_free(x->twopassbuffer);
+
+        av_free(x->old_twopassbuffer);
+
+    }

     av_free(x->twopassfile);

static av_cold int xvid_encode_close(AVCodecContext *avctx)

{

    struct xvid_context *x = avctx->priv_data;

    if (x->encoder_handle) {

        xvid_encore(x->encoder_handle, XVID_ENC_DESTROY, NULL, NULL);

        x->encoder_handle = NULL;

    }

    av_frame_free(&avctx->coded_frame);

    av_freep(&avctx->extradata);

    if (x->twopassbuffer) {

        av_free(x->twopassbuffer);

        av_free(x->old_twopassbuffer);

    }

    av_free(x->twopassfile);

    av_free(x->intra_matrix);

    av_free(x->inter_matrix);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+int s390_ccw_cmd_request(ORB *orb, SCSW *scsw, void *data)
+
+{
+
     S390CCWDeviceClass *cdc = S390_CCW_DEVICE_GET_CLASS(data);
+

     if (cdc->handle_request) {

int s390_ccw_cmd_request(ORB *orb, SCSW *scsw, void *data)

{

    S390CCWDeviceClass *cdc = S390_CCW_DEVICE_GET_CLASS(data);

    if (cdc->handle_request) {

        return cdc->handle_request(orb, scsw, data);

    } else {

        return -ENOSYS;

    }

}


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

             int n;

+            n = (addr >> 1) & 7;
+
+            if (n >= NB_PORTS)
+
+                goto read_default;

             port = &s->ports[n];

static uint32_t uhci_ioport_readw(void *opaque, uint32_t addr)

{

    UHCIState *s = opaque;

    uint32_t val;

    addr &= 0x1f;

    switch(addr) {

    case 0x00:

        val = s->cmd;

        break;

    case 0x02:

        val = s->status;

        break;

    case 0x04:

        val = s->intr;

        break;

    case 0x06:

        val = s->frnum;

        break;

    case 0x10 ... 0x1f:

        {

            UHCIPort *port;

            int n;

            n = (addr >> 1) & 7;

            if (n >= NB_PORTS)

                goto read_default;

            port = &s->ports[n];

            val = port->ctrl;

        }

        break;

    default:

    read_default:

        val = 0xff7f; /* disabled port */

        break;

    }

#ifdef DEBUG

    printf("uhci readw port=0x%04x val=0x%04x\n", addr, val);

#endif

    return val;

}


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

     if (!local_err) {

+        if (completion_cb)
+
+            completion_cb(opaque, 0);
+
+        return 0;

     }

int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs,

                                BlockCompletionFunc *completion_cb,

                                void *opaque)

{

    Error *local_err = NULL;

    int err;

    bdrv_add_key(bs, NULL, &local_err);

    if (!local_err) {

        if (completion_cb)

            completion_cb(opaque, 0);

        return 0;

    }

    /* Need a key for @bs */

    if (monitor_ctrl_mode(mon)) {

        qerror_report_err(local_err);

        return -1;

    }

    monitor_printf(mon, "%s (%s) is encrypted.\n", bdrv_get_device_name(bs),

                   bdrv_get_encrypted_filename(bs));

    mon->password_completion_cb = completion_cb;

    mon->password_opaque = opaque;

    err = monitor_read_password(mon, bdrv_password_cb, bs);

    if (err && completion_cb)

        completion_cb(opaque, err);

    return err;

}


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

     if (check_func(s.threshold, "threshold8")) {

+        call_ref(in, threshold, min, max, out_ref, line_size, line_size, line_size, line_size, line_size, w, 1);
+
+        call_new(in, threshold, min, max, out_new, line_size, line_size, line_size, line_size, line_size, w, 1);
+
+        if (memcmp(out_ref, out_new, w))

             fail();

static void check_threshold_8(void){

    LOCAL_ALIGNED_32(uint8_t, in       , [WIDTH_PADDED]);

    LOCAL_ALIGNED_32(uint8_t, threshold, [WIDTH_PADDED]);

    LOCAL_ALIGNED_32(uint8_t, min      , [WIDTH_PADDED]);

    LOCAL_ALIGNED_32(uint8_t, max      , [WIDTH_PADDED]);

    LOCAL_ALIGNED_32(uint8_t, out_ref  , [WIDTH_PADDED]);

    LOCAL_ALIGNED_32(uint8_t, out_new  , [WIDTH_PADDED]);

    ptrdiff_t line_size = WIDTH_PADDED;

    int w = WIDTH;

    ThresholdContext s;

    s.depth = 8;

    ff_threshold_init(&s);

    declare_func(void, const uint8_t *in, const uint8_t *threshold,

                 const uint8_t *min, const uint8_t *max, uint8_t *out,

                 ptrdiff_t ilinesize, ptrdiff_t tlinesize,

                 ptrdiff_t flinesize, ptrdiff_t slinesize,

                 ptrdiff_t olinesize, int w, int h);

    memset(in,     0, WIDTH_PADDED);

    memset(threshold, 0, WIDTH_PADDED);

    memset(min, 0, WIDTH_PADDED);

    memset(max, 0, WIDTH_PADDED);

    memset(out_ref, 0, WIDTH_PADDED);

    memset(out_new, 0, WIDTH_PADDED);

    randomize_buffers(in, WIDTH);

    randomize_buffers(threshold, WIDTH);

    randomize_buffers(min, WIDTH);

    randomize_buffers(max, WIDTH);

    if (check_func(s.threshold, "threshold8")) {

        call_ref(in, threshold, min, max, out_ref, line_size, line_size, line_size, line_size, line_size, w, 1);

        call_new(in, threshold, min, max, out_new, line_size, line_size, line_size, line_size, line_size, w, 1);

        if (memcmp(out_ref, out_new, w))

            fail();

        bench_new(in, threshold, min, max, out_new, line_size, line_size, line_size, line_size, line_size, w, 1);

    }

}


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

     if (INLINE_SSE2(cpu_flags) && (cpu_flags & AV_CPU_FLAG_SSE2SLOW)) {
+
+        c->lpc_apply_welch_window = lpc_apply_welch_window_sse2;
+
+        c->lpc_compute_autocorr   = lpc_compute_autocorr_sse2;
+
     }

 #endif /* HAVE_SSE2_INLINE */

av_cold void ff_lpc_init_x86(LPCContext *c)

{

#if HAVE_SSE2_INLINE

    int cpu_flags = av_get_cpu_flags();

    if (INLINE_SSE2(cpu_flags) && (cpu_flags & AV_CPU_FLAG_SSE2SLOW)) {

        c->lpc_apply_welch_window = lpc_apply_welch_window_sse2;

        c->lpc_compute_autocorr   = lpc_compute_autocorr_sse2;

    }

#endif /* HAVE_SSE2_INLINE */

}


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

         exit(1);

+    }
+
+    slirp_smb_export = exported_dir;
+
+    if (slirp_inited) {

         slirp_smb(exported_dir);

void net_slirp_smb(const char *exported_dir)

{

    if (slirp_smb_export) {

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

        exit(1);

    }

    slirp_smb_export = exported_dir;

    if (slirp_inited) {

        slirp_smb(exported_dir);

    }

}


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

     AMRWBContext *s = avctx->priv_data;

+    const int16_t *samples = (const int16_t *)frame->data[0];
+
+    int size, ret;
+
+

     if ((ret = ff_alloc_packet2(avctx, avpkt, MAX_PACKET_SIZE)))

static int amr_wb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,

                               const AVFrame *frame, int *got_packet_ptr)

{

    AMRWBContext *s = avctx->priv_data;

    const int16_t *samples = (const int16_t *)frame->data[0];

    int size, ret;

    if ((ret = ff_alloc_packet2(avctx, avpkt, MAX_PACKET_SIZE)))

        return ret;

    if (s->last_bitrate != avctx->bit_rate) {

        s->mode         = get_wb_bitrate_mode(avctx->bit_rate, avctx);

        s->last_bitrate = avctx->bit_rate;

    }

    size = E_IF_encode(s->state, s->mode, samples, avpkt->data, s->allow_dtx);

    if (size <= 0 || size > MAX_PACKET_SIZE) {

        av_log(avctx, AV_LOG_ERROR, "Error encoding frame\n");

        return AVERROR(EINVAL);

    }

    if (frame->pts != AV_NOPTS_VALUE)

        avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);

    avpkt->size = size;

    *got_packet_ptr = 1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 void ppc_tb_set_jmp_target(uintptr_t jmp_addr, uintptr_t addr)

 {
+
+    tcg_insn_unit i1, i2;
+
+    uint64_t pair;
+
     intptr_t diff = addr - jmp_addr;

void ppc_tb_set_jmp_target(uintptr_t jmp_addr, uintptr_t addr)

{

    tcg_insn_unit i1, i2;

    uint64_t pair;

    intptr_t diff = addr - jmp_addr;

    if (in_range_b(diff)) {

        i1 = B | (diff & 0x3fffffc);

        i2 = NOP;

    } else if (USE_REG_RA) {

        intptr_t lo, hi;

        diff = addr - (uintptr_t)tb_ret_addr;

        lo = (int16_t)diff;

        hi = (int32_t)(diff - lo);

        assert(diff == hi + lo);

        i1 = ADDIS | TAI(TCG_REG_TMP1, TCG_REG_RA, hi >> 16);

        i2 = ADDI | TAI(TCG_REG_TMP1, TCG_REG_TMP1, lo);

    } else {

        assert(TCG_TARGET_REG_BITS == 32 || addr == (int32_t)addr);

        i1 = ADDIS | TAI(TCG_REG_TMP1, 0, addr >> 16);

        i2 = ORI | SAI(TCG_REG_TMP1, TCG_REG_TMP1, addr);

    }

#ifdef HOST_WORDS_BIGENDIAN

    pair = (uint64_t)i1 << 32 | i2;

#else

    pair = (uint64_t)i2 << 32 | i1;

#endif

    /* ??? __atomic_store_8, presuming there's some way to do that

       for 32-bit, otherwise this is good enough for 64-bit.  */

    *(uint64_t *)jmp_addr = pair;

    flush_icache_range(jmp_addr, jmp_addr + 8);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void shifter_out_im(TCGv var, int shift)
+
 {

     TCGv tmp = new_tmp();
@@ -7,7 +7,7 @@
     if (shift == 0) {

         tcg_gen_andi_i32(tmp, var, 1);
+
     } else {

         tcg_gen_shri_i32(tmp, var, shift);

static void shifter_out_im(TCGv var, int shift)

{

    TCGv tmp = new_tmp();

    if (shift == 0) {

        tcg_gen_andi_i32(tmp, var, 1);

    } else {

        tcg_gen_shri_i32(tmp, var, shift);

        if (shift != 31)

            tcg_gen_andi_i32(tmp, tmp, 1);

    }

    gen_set_CF(tmp);

    dead_tmp(tmp);

}


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

 {
+
+    ISADevice *d = ISA_DEVICE(dev);

+    PVPanicState *s = ISA_PVPANIC_DEVICE(dev);
+
+    static bool port_configured;
+
+    FWCfgState *fw_cfg;

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

{

    ISADevice *d = ISA_DEVICE(dev);

    PVPanicState *s = ISA_PVPANIC_DEVICE(dev);

    static bool port_configured;

    FWCfgState *fw_cfg;

    isa_register_ioport(d, &s->io, s->ioport);

    if (!port_configured) {

        fw_cfg = fw_cfg_find();

        if (fw_cfg) {

            fw_cfg_add_file(fw_cfg, "etc/pvpanic-port",

                            g_memdup(&s->ioport, sizeof(s->ioport)),

                            sizeof(s->ioport));

            port_configured = true;

        }

    }

}


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

 {

uint32_t kvmppc_get_vmx(void)

{

    return kvmppc_read_int_cpu_dt("ibm,vmx");

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int aac_parse_packet(AVFormatContext *ctx, PayloadContext *data,

+                            AVStream *st, AVPacket *pkt, uint32_t *timestamp,

                             const uint8_t *buf, int len, uint16_t seq,

static int aac_parse_packet(AVFormatContext *ctx, PayloadContext *data,

                            AVStream *st, AVPacket *pkt, uint32_t *timestamp,

                            const uint8_t *buf, int len, uint16_t seq,

                            int flags)

{

    int ret;

    if (rtp_parse_mp4_au(data, buf))

        return -1;

    buf += data->au_headers_length_bytes + 2;

    len -= data->au_headers_length_bytes + 2;

    /* XXX: Fixme we only handle the case where rtp_parse_mp4_au define

                    one au_header */

    if ((ret = av_new_packet(pkt, data->au_headers[0].size)) < 0)

        return ret;

    memcpy(pkt->data, buf, data->au_headers[0].size);

    pkt->stream_index = st->index;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,19 +1,19 @@
+static int find_and_check_chardev(CharDriverState **chr,

                                   char *chr_name,

                                   Error **errp)
+
 {
+
+    CompareChardevProps props;

+
+    *chr = qemu_chr_find(chr_name);

     if (*chr == NULL) {
+
         error_setg(errp, "Device '%s' not found",

                    chr_name);

static int find_and_check_chardev(CharDriverState **chr,

                                  char *chr_name,

                                  Error **errp)

{

    CompareChardevProps props;

    *chr = qemu_chr_find(chr_name);

    if (*chr == NULL) {

        error_setg(errp, "Device '%s' not found",

                   chr_name);

        return 1;

    }

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

    if (qemu_opt_foreach((*chr)->opts, compare_chardev_opts, &props, errp)) {

        return 1;

    }

    if (!props.is_socket) {

        error_setg(errp, "chardev \"%s\" is not a tcp socket",

                   chr_name);

        return 1;

    }

    return 0;

}


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

     printf("qemu-" TARGET_ARCH " version " QEMU_VERSION QEMU_PKGVERSION
+
+           ", Copyright (c) 2003-2008 Fabrice Bellard\n");

 }

static void version(void)

{

    printf("qemu-" TARGET_ARCH " version " QEMU_VERSION QEMU_PKGVERSION

           ", Copyright (c) 2003-2008 Fabrice Bellard\n");

}


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

     } else if (level < 8)

+        value = get_bits(gb, level + 1);
+
+    return value;
+
 }

static inline int get_scale(GetBitContext *gb, int level, int value)

{

    if (level < 5) {

        /* huffman encoded */

        value += get_bitalloc(gb, &dca_scalefactor, level);

    } else if (level < 8)

        value = get_bits(gb, level + 1);

    return value;

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
         delta = active_timers[QEMU_CLOCK_VIRTUAL]->expire_time -

                      qemu_get_clock(vm_clock);
+
+    } else {
+
+        /* To avoid problems with overflow limit this to 2^32.  */
+
         delta = INT32_MAX;

     }

static int64_t qemu_next_deadline(void)

{

    int64_t delta;

    if (active_timers[QEMU_CLOCK_VIRTUAL]) {

        delta = active_timers[QEMU_CLOCK_VIRTUAL]->expire_time -

                     qemu_get_clock(vm_clock);

    } else {

        /* To avoid problems with overflow limit this to 2^32.  */

        delta = INT32_MAX;

    }

    if (delta < 0)

        delta = 0;

    return delta;

}


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

         if (!alloc)

+            return NULL;
+
+        p = qemu_vmalloc(sizeof(PhysPageDesc) * L2_SIZE);
+
+        memset(p, 0, sizeof(PhysPageDesc) * L2_SIZE);

         *lp = p;

static PhysPageDesc *phys_page_find_alloc(target_phys_addr_t index, int alloc)

{

    void **lp, **p;

    p = (void **)l1_phys_map;

#if TARGET_PHYS_ADDR_SPACE_BITS > 32

#if TARGET_PHYS_ADDR_SPACE_BITS > (32 + L1_BITS)

#error unsupported TARGET_PHYS_ADDR_SPACE_BITS

#endif

    lp = p + ((index >> (L1_BITS + L2_BITS)) & (L1_SIZE - 1));

    p = *lp;

    if (!p) {

        /* allocate if not found */

        if (!alloc)

            return NULL;

        p = qemu_vmalloc(sizeof(void *) * L1_SIZE);

        memset(p, 0, sizeof(void *) * L1_SIZE);

        *lp = p;

    }

#endif

    lp = p + ((index >> L2_BITS) & (L1_SIZE - 1));

    p = *lp;

    if (!p) {

        /* allocate if not found */

        if (!alloc)

            return NULL;

        p = qemu_vmalloc(sizeof(PhysPageDesc) * L2_SIZE);

        memset(p, 0, sizeof(PhysPageDesc) * L2_SIZE);

        *lp = p;

    }

    return ((PhysPageDesc *)p) + (index & (L2_SIZE - 1));

}


--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
         env->tlb_table[0][i].addr_read = -1;

         env->tlb_table[0][i].addr_write = -1;
+
+        env->tlb_table[0][i].addr_code = -1;
+
+        env->tlb_table[1][i].addr_read = -1;
+
         env->tlb_table[1][i].addr_write = -1;

         env->tlb_table[1][i].addr_code = -1;

void tlb_flush(CPUState *env, int flush_global)

{

    int i;

#if defined(DEBUG_TLB)

    printf("tlb_flush:\n");

#endif

    /* must reset current TB so that interrupts cannot modify the

       links while we are modifying them */

    env->current_tb = NULL;

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

        env->tlb_table[0][i].addr_read = -1;

        env->tlb_table[0][i].addr_write = -1;

        env->tlb_table[0][i].addr_code = -1;

        env->tlb_table[1][i].addr_read = -1;

        env->tlb_table[1][i].addr_write = -1;

        env->tlb_table[1][i].addr_code = -1;

#if (NB_MMU_MODES >= 3)

        env->tlb_table[2][i].addr_read = -1;

        env->tlb_table[2][i].addr_write = -1;

        env->tlb_table[2][i].addr_code = -1;

#if (NB_MMU_MODES == 4)

        env->tlb_table[3][i].addr_read = -1;

        env->tlb_table[3][i].addr_write = -1;

        env->tlb_table[3][i].addr_code = -1;

#endif

#endif

    }

    memset (env->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof (void *));

#ifdef USE_KQEMU

    if (env->kqemu_enabled) {

        kqemu_flush(env, flush_global);

    }

#endif

    tlb_flush_count++;

}


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

                             int dst_stride, int src_stride,

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

                            int dst_stride, int src_stride,

                            int width, int height, int log2_scale,

                            const uint8_t dither[8][8])

{

    int y;

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

        uint8_t *dst1 = dst;

        const int16_t *src1 = src;

        __asm__ volatile(

            "movq (%3), %%mm3           \n"

            "movq (%3), %%mm4           \n"

            "movd %4, %%mm2             \n"

            "pxor %%mm0, %%mm0          \n"

            "punpcklbw %%mm0, %%mm3     \n"

            "punpckhbw %%mm0, %%mm4     \n"

            "psraw %%mm2, %%mm3         \n"

            "psraw %%mm2, %%mm4         \n"

            "movd %5, %%mm2             \n"

            "1:                         \n"

            "movq (%0), %%mm0           \n"

            "movq 8(%0), %%mm1          \n"

            "paddw %%mm3, %%mm0         \n"

            "paddw %%mm4, %%mm1         \n"

            "psraw %%mm2, %%mm0         \n"

            "psraw %%mm2, %%mm1         \n"

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

            "movq %%mm0, (%1)           \n"

            "add $16, %0                \n"

            "add $8, %1                 \n"

            "cmp %2, %1                 \n"

            " jb 1b                     \n"

            : "+r" (src1), "+r"(dst1)

            : "r"(dst + width), "r"(dither[y]), "g"(log2_scale), "g"(MAX_LEVEL - log2_scale)

        );

        src += src_stride;

        dst += dst_stride;

    }

}


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

 {

+    BlockAIOCB *acb = p;
+
+    assert(acb->refcnt > 0);

     if (--acb->refcnt == 0) {

void qemu_aio_unref(void *p)

{

    BlockAIOCB *acb = p;

    assert(acb->refcnt > 0);

    if (--acb->refcnt == 0) {

        g_free(acb);

    }

}


--- a/source.c
+++ b/source.c
@@ -10,11 +10,11 @@
         return -EACCES;
     if (bdrv_check_request(bs, sector_num, nb_sectors)) {
         return -EIO;
+    /* throttling disk write I/O */
+    if (bs->io_limits_enabled) {
+        bdrv_io_limits_intercept(bs, true, nb_sectors);
+    tracked_request_begin(&req, bs, sector_num, nb_sectors, true);
+    ret = drv->bdrv_co_writev(bs, sector_num, nb_sectors, qiov);
     if (bs->dirty_bitmap) {
         set_dirty_bitmap(bs, sector_num, nb_sectors, 1);
     if (bs->wr_highest_sector < sector_num + nb_sectors - 1) {

static int coroutine_fn bdrv_co_do_writev(BlockDriverState *bs,
    int64_t sector_num, int nb_sectors, QEMUIOVector *qiov)
{
    BlockDriver *drv = bs->drv;
    BdrvTrackedRequest req;
    int ret;
    if (!bs->drv) {
        return -ENOMEDIUM;
    if (bs->read_only) {
        return -EACCES;
    if (bdrv_check_request(bs, sector_num, nb_sectors)) {
        return -EIO;
    /* throttling disk write I/O */
    if (bs->io_limits_enabled) {
        bdrv_io_limits_intercept(bs, true, nb_sectors);
    tracked_request_begin(&req, bs, sector_num, nb_sectors, true);
    ret = drv->bdrv_co_writev(bs, sector_num, nb_sectors, qiov);
    if (bs->dirty_bitmap) {
        set_dirty_bitmap(bs, sector_num, nb_sectors, 1);
    if (bs->wr_highest_sector < sector_num + nb_sectors - 1) {
        bs->wr_highest_sector = sector_num + nb_sectors - 1;
    tracked_request_end(&req);
    return ret;


--- a/source.c
+++ b/source.c
@@ -1,29 +1,29 @@
+static void check_lowpass_line(int depth){
+
+    LOCAL_ALIGNED_32(uint8_t, src,     [SRC_SIZE]);
+
+    LOCAL_ALIGNED_32(uint8_t, dst_ref, [WIDTH_PADDED]);
+
+    LOCAL_ALIGNED_32(uint8_t, dst_new, [WIDTH_PADDED]);
+
+    int w = WIDTH;
+
+    int mref = WIDTH_PADDED * -1;
+
+    int pref = WIDTH_PADDED;
+
+    int i, depth_byte;
+
+    InterlaceContext s;
+
+
+
     declare_func(void, uint8_t *dstp, ptrdiff_t linesize, const uint8_t *srcp,
+
+                 ptrdiff_t mref, ptrdiff_t pref, int clip_max);
+

+
     s.lowpass = 1;

     s.lowpass = VLPF_LIN;

static void check_lowpass_line(int depth){

    LOCAL_ALIGNED_32(uint8_t, src,     [SRC_SIZE]);

    LOCAL_ALIGNED_32(uint8_t, dst_ref, [WIDTH_PADDED]);

    LOCAL_ALIGNED_32(uint8_t, dst_new, [WIDTH_PADDED]);

    int w = WIDTH;

    int mref = WIDTH_PADDED * -1;

    int pref = WIDTH_PADDED;

    int i, depth_byte;

    InterlaceContext s;

    declare_func(void, uint8_t *dstp, ptrdiff_t linesize, const uint8_t *srcp,

                 ptrdiff_t mref, ptrdiff_t pref, int clip_max);

    s.lowpass = 1;

    s.lowpass = VLPF_LIN;

    depth_byte = depth >> 3;

    w /= depth_byte;

    memset(src,     0, SRC_SIZE);

    memset(dst_ref, 0, WIDTH_PADDED);

    memset(dst_new, 0, WIDTH_PADDED);

    randomize_buffers(src, SRC_SIZE);

    ff_interlace_init(&s, depth);

    if (check_func(s.lowpass_line, "lowpass_line_%d", depth)) {

        for (i = 0; i < 32; i++) { /* simulate crop */

            call_ref(dst_ref, w, src + WIDTH_PADDED, mref - i*depth_byte, pref, 0);

            call_new(dst_new, w, src + WIDTH_PADDED, mref - i*depth_byte, pref, 0);

            if (memcmp(dst_ref, dst_new, WIDTH - i))

                fail();

        }

        bench_new(dst_new, w, src + WIDTH_PADDED, mref, pref, 0);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void rearm_sensor_evts(IPMIBmcSim *ibs,

+                              uint8_t *cmd, unsigned int cmd_len,

                               uint8_t *rsp, unsigned int *rsp_len,

static void rearm_sensor_evts(IPMIBmcSim *ibs,

                              uint8_t *cmd, unsigned int cmd_len,

                              uint8_t *rsp, unsigned int *rsp_len,

                              unsigned int max_rsp_len)

{

    IPMISensor *sens;

    IPMI_CHECK_CMD_LEN(4);

    if ((cmd[2] >= MAX_SENSORS) ||

        !IPMI_SENSOR_GET_PRESENT(ibs->sensors + cmd[2])) {

        rsp[2] = IPMI_CC_REQ_ENTRY_NOT_PRESENT;

        return;

    }

    sens = ibs->sensors + cmd[2];

    if ((cmd[3] & 0x80) == 0) {

        /* Just clear everything */

        sens->states = 0;

        return;

    }

}


static void lcd_refresh(void *opaque)

{

    musicpal_lcd_state *s = opaque;

    int x, y;

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

        for (y = 0; y < 64; y++)

            if (s->video_ram[x + (y/8)*128] & (1 << (y % 8)))

                set_lcd_pixel(s, x, y, MP_LCD_TEXTCOLOR);

            else

                set_lcd_pixel(s, x, y, 0);

    dpy_update(s->ds, 0, 0, 128*3, 64*3);

}


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

         if (nb_outputs <= 0) {

+            av_log(ctx, AV_LOG_ERROR, "Invalid number of outputs specified: %d.\n",
+
+                   nb_outputs);
+
+            return AVERROR(EINVAL);

         }

static int split_init(AVFilterContext *ctx, const char *args, void *opaque)

{

    int i, nb_outputs = 2;

    if (args) {

        nb_outputs = strtol(args, NULL, 0);

        if (nb_outputs <= 0) {

            av_log(ctx, AV_LOG_ERROR, "Invalid number of outputs specified: %d.\n",

                   nb_outputs);

            return AVERROR(EINVAL);

        }

    }

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

        char name[32];

        AVFilterPad pad = { 0 };

        snprintf(name, sizeof(name), "output%d", i);

        pad.type = !strcmp(ctx->name, "split") ? AVMEDIA_TYPE_VIDEO : AVMEDIA_TYPE_AUDIO;

        pad.name = av_strdup(name);

        avfilter_insert_outpad(ctx, i, &pad);

    }

    return 0;

}


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

     const int b_stride= s->b_width << s->block_max_depth;

+    BlockNode *block= &s->block[mb_x + mb_y * b_stride];

     BlockNode backup[4]= {block[0], block[1], block[b_stride], block[b_stride+1]};

static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int ref, int *best_rd){

    const int b_stride= s->b_width << s->block_max_depth;

    BlockNode *block= &s->block[mb_x + mb_y * b_stride];

    BlockNode backup[4]= {block[0], block[1], block[b_stride], block[b_stride+1]};

    int rd, index, value;

    assert(mb_x>=0 && mb_y>=0);

    assert(mb_x<b_stride);

    assert(((mb_x|mb_y)&1) == 0);

    index= (p0 + 31*p1) & (ME_CACHE_SIZE-1);

    value= s->me_cache_generation + (p0>>10) + (p1<<6) + (block->ref<<12);

    if(s->me_cache[index] == value)

        return 0;

    s->me_cache[index]= value;

    block->mx= p0;

    block->my= p1;

    block->ref= ref;

    block->type &= ~BLOCK_INTRA;

    block[1]= block[b_stride]= block[b_stride+1]= *block;

    rd= get_4block_rd(s, mb_x, mb_y, 0);

//FIXME chroma

    if(rd < *best_rd){

        *best_rd= rd;

        return 1;

    }else{

        block[0]= backup[0];

        block[1]= backup[1];

        block[b_stride]= backup[2];

        block[b_stride+1]= backup[3];

        return 0;

    }

}


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

     char *buffer = NULL;
+
+    av_dict_copy(&dict, m, 0);
+
+    print_dict(dict);
+
     av_dict_get_string(dict, &buffer, val, pair);

     printf("%s\n", buffer);

static void test_separators(const AVDictionary *m, const char pair, const char val)

{

    AVDictionary *dict = NULL;

    char pairs[] = {pair , '\0'};

    char vals[]  = {val, '\0'};

    char *buffer = NULL;

    av_dict_copy(&dict, m, 0);

    print_dict(dict);

    av_dict_get_string(dict, &buffer, val, pair);

    printf("%s\n", buffer);

    av_dict_free(&dict);

    av_dict_parse_string(&dict, buffer, vals, pairs, 0);

    av_freep(&buffer);

    print_dict(dict);

    av_dict_free(&dict);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int qemu_chr_open_win(QemuOpts *opts, CharDriverState **_chr)

 {

@@ -10,11 +10,11 @@

+    chr = g_malloc0(sizeof(CharDriverState));

     s = g_malloc0(sizeof(WinCharState));
+
+    chr->opaque = s;

     chr->chr_write = win_chr_write;

static int qemu_chr_open_win(QemuOpts *opts, CharDriverState **_chr)

{

    const char *filename = qemu_opt_get(opts, "path");

    CharDriverState *chr;

    WinCharState *s;

    chr = g_malloc0(sizeof(CharDriverState));

    s = g_malloc0(sizeof(WinCharState));

    chr->opaque = s;

    chr->chr_write = win_chr_write;

    chr->chr_close = win_chr_close;

    if (win_chr_init(chr, filename) < 0) {

        g_free(s);

        g_free(chr);

        return -EIO;

    }

    qemu_chr_generic_open(chr);

    *_chr = chr;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int sd_snapshot_delete(BlockDriverState *bs, const char *snapshot_id)

 {

static int sd_snapshot_delete(BlockDriverState *bs, const char *snapshot_id)

{

    /* FIXME: Delete specified snapshot id.  */

    return 0;

}


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

     k->no_hotplug = 1;
+
     k->init = i440fx_initfn;

     k->config_write = i440fx_write_config;

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);

    k->no_hotplug = 1;

    k->init = i440fx_initfn;

    k->config_write = i440fx_write_config;

    k->vendor_id = PCI_VENDOR_ID_INTEL;

    k->device_id = PCI_DEVICE_ID_INTEL_82441;

    k->revision = 0x02;

    k->class_id = PCI_CLASS_BRIDGE_HOST;

    dc->desc = "Host bridge";

    dc->no_user = 1;

    dc->vmsd = &vmstate_i440fx;

}


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

             if (ff_neterrno() != AVERROR(EINTR) &&
+
+                ff_neterrno() != AVERROR(EAGAIN))
+
+                return ff_neterrno();
+
         } else {

             break;

static int udp_write(URLContext *h, const uint8_t *buf, int size)

{

    UDPContext *s = h->priv_data;

    int ret;

    for(;;) {

        if (!s->is_connected) {

            ret = sendto (s->udp_fd, buf, size, 0,

                          (struct sockaddr *) &s->dest_addr,

                          s->dest_addr_len);

        } else

            ret = send(s->udp_fd, buf, size, 0);

        if (ret < 0) {

            if (ff_neterrno() != AVERROR(EINTR) &&

                ff_neterrno() != AVERROR(EAGAIN))

                return ff_neterrno();

        } else {

            break;

        }

    }

    return size;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void pci_bridge_region_cleanup(PCIBridge *br)

+{
+
+    PCIBus *parent = br->dev.bus;

     pci_bridge_cleanup_alias(&br->alias_io,

static void pci_bridge_region_cleanup(PCIBridge *br)

{

    PCIBus *parent = br->dev.bus;

    pci_bridge_cleanup_alias(&br->alias_io,

                             parent->address_space_io);

    pci_bridge_cleanup_alias(&br->alias_mem,

                             parent->address_space_mem);

    pci_bridge_cleanup_alias(&br->alias_pref_mem,

                             parent->address_space_mem);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void gen_logicq_cc(TCGv_i64 val)
+
 {

+    TCGv tmp = new_tmp();

     gen_helper_logicq_cc(tmp, val);

static void gen_logicq_cc(TCGv_i64 val)

{

    TCGv tmp = new_tmp();

    gen_helper_logicq_cc(tmp, val);

    gen_logic_CC(tmp);

    dead_tmp(tmp);

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                                              Error **errp,

                                              gpointer opaque)
+
 {

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

static int qio_channel_socket_connect_worker(QIOTask *task,

                                             Error **errp,

                                             gpointer opaque)

{

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

    SocketAddress *addr = opaque;

    int ret;

    ret = qio_channel_socket_connect_sync(ioc,

                                          addr,

                                          errp);

    object_unref(OBJECT(ioc));

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void do_info_registers(Monitor *mon)

 {
+
     CPUState *env;

     env = mon_get_cpu();

static void do_info_registers(Monitor *mon)

{

    CPUState *env;

    env = mon_get_cpu();

    if (!env)

        return;

#ifdef TARGET_I386

    cpu_dump_state(env, (FILE *)mon, monitor_fprintf,

                   X86_DUMP_FPU);

#else

    cpu_dump_state(env, (FILE *)mon, monitor_fprintf,

                   0);

#endif

}


--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
         qdict_iter(qobject_to_qdict(obj), qdict_add_key, h);

         tos->h = h;
+
+    } else if (qobject_type(obj) == QTYPE_QLIST) {
+
+        tos->entry = qlist_first(qobject_to_qlist(obj));
+
     }

static const QListEntry *qmp_input_push(QmpInputVisitor *qiv, QObject *obj,

                                        void *qapi, Error **errp)

{

    GHashTable *h;

    StackObject *tos = g_new0(StackObject, 1);

    assert(obj);

    tos->obj = obj;

    tos->qapi = qapi;

    if (qiv->strict && qobject_type(obj) == QTYPE_QDICT) {

        h = g_hash_table_new(g_str_hash, g_str_equal);

        qdict_iter(qobject_to_qdict(obj), qdict_add_key, h);

        tos->h = h;

    } else if (qobject_type(obj) == QTYPE_QLIST) {

        tos->entry = qlist_first(qobject_to_qlist(obj));

    }

    QSLIST_INSERT_HEAD(&qiv->stack, tos, node);

    return tos->entry;

}


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

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

+        if (ext2_feature_name[i] && !strcmp (flagname, ext2_feature_name[i])) {
+
+            *ext2_features |= 1 << i;
+
+            found = 1;

         }

static void add_flagname_to_bitmaps(const char *flagname, uint32_t *features,

                                    uint32_t *ext_features,

                                    uint32_t *ext2_features,

                                    uint32_t *ext3_features,

                                    uint32_t *kvm_features)

{

    int i;

    int found = 0;

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

        if (feature_name[i] && !strcmp (flagname, feature_name[i])) {

            *features |= 1 << i;

            found = 1;

        }

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

        if (ext_feature_name[i] && !strcmp (flagname, ext_feature_name[i])) {

            *ext_features |= 1 << i;

            found = 1;

        }

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

        if (ext2_feature_name[i] && !strcmp (flagname, ext2_feature_name[i])) {

            *ext2_features |= 1 << i;

            found = 1;

        }

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

        if (ext3_feature_name[i] && !strcmp (flagname, ext3_feature_name[i])) {

            *ext3_features |= 1 << i;

            found = 1;

        }

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

        if (kvm_feature_name[i] && !strcmp (flagname, kvm_feature_name[i])) {

            *kvm_features |= 1 << i;

            found = 1;

        }

    if (!found) {

        fprintf(stderr, "CPU feature %s not found\n", flagname);

    }

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     AVFilterContext *ctx  = inlink->dst;

     ConcatContext *cat    = ctx->priv;
+
     unsigned in_no = FF_INLINK_IDX(inlink);

static void process_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)

{

    AVFilterContext *ctx  = inlink->dst;

    ConcatContext *cat    = ctx->priv;

    unsigned in_no = FF_INLINK_IDX(inlink);

    if (in_no < cat->cur_idx) {

        av_log(ctx, AV_LOG_ERROR, "Frame after EOF on input %s\n",

               ctx->input_pads[in_no].name);

        avfilter_unref_buffer(buf);

    } if (in_no >= cat->cur_idx + ctx->nb_outputs) {

        ff_bufqueue_add(ctx, &cat->in[in_no].queue, buf);

    } else {

        push_frame(ctx, in_no, buf);

    }

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     Coroutine *to = self->caller;

+
     trace_qemu_coroutine_yield(self, to);

void coroutine_fn qemu_coroutine_yield(void)

{

    Coroutine *self = qemu_coroutine_self();

    Coroutine *to = self->caller;

    trace_qemu_coroutine_yield(self, to);

    if (!to) {

        fprintf(stderr, "Co-routine is yielding to no one\n");

        abort();

    }

    self->caller = NULL;

    coroutine_swap(self, to);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 int bdrv_all_delete_snapshot(const char *name, BlockDriverState **first_bad_bs,

+                             Error **err)
+
 {
+
     int ret = 0;

     BlockDriverState *bs;

int bdrv_all_delete_snapshot(const char *name, BlockDriverState **first_bad_bs,

                             Error **err)

{

    int ret = 0;

    BlockDriverState *bs;

    BdrvNextIterator *it = NULL;

    QEMUSnapshotInfo sn1, *snapshot = &sn1;

    while (ret == 0 && (it = bdrv_next(it, &bs))) {

        AioContext *ctx = bdrv_get_aio_context(bs);

        aio_context_acquire(ctx);

        if (bdrv_can_snapshot(bs) &&

                bdrv_snapshot_find(bs, snapshot, name) >= 0) {

            ret = bdrv_snapshot_delete_by_id_or_name(bs, name, err);

        }

        aio_context_release(ctx);

    }

    *first_bad_bs = bs;

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static CharDriverState *qemu_chr_open_file_out(QemuOpts *opts)

+{

     int fd_out;

static CharDriverState *qemu_chr_open_file_out(QemuOpts *opts)

{

    int fd_out;

    TFR(fd_out = open(qemu_opt_get(opts, "path"),

                      O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0666));

    if (fd_out < 0)

        return NULL;

    return qemu_chr_open_fd(-1, fd_out);

}


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

                     __FUNCTION__, value, offset);

+#endif
+
+}

static void static_write(void *opaque, hwaddr offset, uint64_t value,

                         unsigned size)

{

#ifdef SPY

    printf("%s: value %08lx written at " PA_FMT "\n",

                    __FUNCTION__, value, offset);

#endif

}


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

         rc = read(il->fd, &event, sizeof(event));

+        if (rc != sizeof(event)) {
+
+            if (rc < 0 && errno != EAGAIN) {
+
+                fprintf(stderr, "%s: read: %s\n", __func__, strerror(errno));

                 qemu_set_fd_handler(il->fd, NULL, NULL, NULL);

static void input_linux_event_keyboard(void *opaque)

{

    InputLinux *il = opaque;

    struct input_event event;

    int rc;

    for (;;) {

        rc = read(il->fd, &event, sizeof(event));

        if (rc != sizeof(event)) {

            if (rc < 0 && errno != EAGAIN) {

                fprintf(stderr, "%s: read: %s\n", __func__, strerror(errno));

                qemu_set_fd_handler(il->fd, NULL, NULL, NULL);

                close(il->fd);

            }

            break;

        }

        input_linux_handle_keyboard(il, &event);

    }

}


--- a/source.c
+++ b/source.c
@@ -13,9 +13,9 @@
             TAILQ_REMOVE(&vc->vlan->send_queue, packet, entry);

             qemu_free(packet);
+
+        }
+
+    }
+
 }

void qemu_purge_queued_packets(VLANClientState *vc)

{

    VLANPacket *packet, *next;

    TAILQ_FOREACH_SAFE(packet, &vc->vlan->send_queue, entry, next) {

        if (packet->sender == vc) {

            TAILQ_REMOVE(&vc->vlan->send_queue, packet, entry);

            qemu_free(packet);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 bool block_job_is_paused(BlockJob *job)
+
 {

     return job->paused;

bool block_job_is_paused(BlockJob *job)

{

    return job->paused;

}


static int eval_refl(int *refl, const int16_t *coefs, RA144Context *ractx)

{

    int b, i, j;

    int buffer1[10];

    int buffer2[10];

    int *bp1 = buffer1;

    int *bp2 = buffer2;

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

        buffer2[i] = coefs[i];

    refl[9] = bp2[9];

    if ((unsigned) bp2[9] + 0x1000 > 0x1fff) {

        av_log(ractx, AV_LOG_ERROR, "Overflow. Broken sample?\n");

        return 1;

    }

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

        b = 0x1000-((bp2[i+1] * bp2[i+1]) >> 12);

        if (!b)

            b = -2;

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

            bp1[j] = ((bp2[j] - ((refl[i+1] * bp2[i-j]) >> 12)) * (0x1000000 / b)) >> 12;

        refl[i] = bp1[i];

        if ((unsigned) bp1[i] + 0x1000 > 0x1fff)

            return 1;

        FFSWAP(int *, bp1, bp2);

    }

    return 0;

}


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

     vdst = vec_ld(0, dst);\

+    vdst_16 = (vec_s16)vec_perm(vdst, zero_u8v, vdst_mask);\
+
+    vdst_16 = vec_adds(a, vdst_16);\
+
+    t = vec_packsu(vdst_16, vdst_16);\

     vec_ste((vec_u32)t, 0, (unsigned int *)dst);\

void ff_vp3_idct_add_altivec(uint8_t *dst, int stride, DCTELEM block[64])

{

    LOAD_ZERO;

    vec_u8 t, vdst;

    vec_s16 vdst_16;

    vec_u8 vdst_mask = vec_mergeh(vec_splat_u8(-1), vec_lvsl(0, dst));

    IDCT_START

    IDCT_1D(NOP, NOP)

    TRANSPOSE8(b0, b1, b2, b3, b4, b5, b6, b7);

    IDCT_1D(ADD8, SHIFT4)

#define ADD(a)\

    vdst = vec_ld(0, dst);\

    vdst_16 = (vec_s16)vec_perm(vdst, zero_u8v, vdst_mask);\

    vdst_16 = vec_adds(a, vdst_16);\

    t = vec_packsu(vdst_16, vdst_16);\

    vec_ste((vec_u32)t, 0, (unsigned int *)dst);\

    vec_ste((vec_u32)t, 4, (unsigned int *)dst);

    ADD(b0)     dst += stride;

    ADD(b1)     dst += stride;

    ADD(b2)     dst += stride;

    ADD(b3)     dst += stride;

    ADD(b4)     dst += stride;

    ADD(b5)     dst += stride;

    ADD(b6)     dst += stride;

    ADD(b7)

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void omap_id_write(void *opaque, target_phys_addr_t addr,
+
+                          uint64_t value, unsigned size)
+
 {

     if (size != 4) {

static void omap_id_write(void *opaque, target_phys_addr_t addr,

                          uint64_t value, unsigned size)

{

    if (size != 4) {

        return omap_badwidth_write32(opaque, addr, value);

    }

    OMAP_BAD_REG(addr);

}


--- a/source.c
+++ b/source.c
@@ -40,11 +40,11 @@
          * elsewhere in the function as the state machine dictates.
          */
         hs->kbd.modifiers |= 1 << (hid_code & 0x0f);
+        return;
+    case 0xea ... 0xef:
+        abort();
+    default:
+        break;
     if (keycode & (1 << 7)) {
         for (i = hs->kbd.keys - 1; i >= 0; i--) {
             if (hs->kbd.key[i] == hid_code) {

static void hid_keyboard_process_keycode(HIDState *hs)
{
    uint8_t hid_code, index, key;
    int i, keycode, slot;
    if (hs->n == 0) {
        return;
    slot = hs->head & QUEUE_MASK; QUEUE_INCR(hs->head); hs->n--;
    keycode = hs->kbd.keycodes[slot];
    key = keycode & 0x7f;
    index = key | ((hs->kbd.modifiers & (1 << 8)) >> 1);
    hid_code = hid_usage_keys[index];
    hs->kbd.modifiers &= ~(1 << 8);
    switch (hid_code) {
    case 0x00:
        return;
    case 0xe0:
        assert(key == 0x1d);
        if (hs->kbd.modifiers & (1 << 9)) {
            /* The hid_codes for the 0xe1/0x1d scancode sequence are 0xe9/0xe0.
             * Here we're processing the second hid_code.  By dropping bit 9
             * and setting bit 8, the scancode after 0x1d will access the
             * second half of the table.
             */
            hs->kbd.modifiers ^= (1 << 8) | (1 << 9);
            return;
        /* fall through to process Ctrl_L */
    case 0xe1 ... 0xe7:
        /* Ctrl_L/Ctrl_R, Shift_L/Shift_R, Alt_L/Alt_R, Win_L/Win_R.
         * Handle releases here, or fall through to process presses.
         */
        if (keycode & (1 << 7)) {
            hs->kbd.modifiers &= ~(1 << (hid_code & 0x0f));
            return;
        /* fall through */
    case 0xe8 ... 0xe9:
        /* USB modifiers are just 1 byte long.  Bits 8 and 9 of
         * hs->kbd.modifiers implement a state machine that detects the
         * 0xe0 and 0xe1/0x1d sequences.  These bits do not follow the
         * usual rules where bit 7 marks released keys; they are cleared
         * elsewhere in the function as the state machine dictates.
         */
        hs->kbd.modifiers |= 1 << (hid_code & 0x0f);
        return;
    case 0xea ... 0xef:
        abort();
    default:
        break;
    if (keycode & (1 << 7)) {
        for (i = hs->kbd.keys - 1; i >= 0; i--) {
            if (hs->kbd.key[i] == hid_code) {
                hs->kbd.key[i] = hs->kbd.key[-- hs->kbd.keys];
                hs->kbd.key[hs->kbd.keys] = 0x00;
                break;
        if (i < 0) {
            return;
    } else {
        for (i = hs->kbd.keys - 1; i >= 0; i--) {
            if (hs->kbd.key[i] == hid_code) {
                break;
        if (i < 0) {
            if (hs->kbd.keys < sizeof(hs->kbd.key)) {
                hs->kbd.key[hs->kbd.keys++] = hid_code;
        } else {
            return;


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

                const uint8_t *buf, int nb_sectors)

+{
+
     return bdrv_rw_co(bs, sector_num, (uint8_t *)buf, nb_sectors, true, 0);

 }

int bdrv_write(BlockDriverState *bs, int64_t sector_num,

               const uint8_t *buf, int nb_sectors)

{

    return bdrv_rw_co(bs, sector_num, (uint8_t *)buf, nb_sectors, true, 0);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void bdrv_reset_dirty_bitmap(BdrvDirtyBitmap *bitmap,

                              int64_t cur_sector, int64_t nr_sectors)
+
+{

     assert(bdrv_dirty_bitmap_enabled(bitmap));

void bdrv_reset_dirty_bitmap(BdrvDirtyBitmap *bitmap,

                             int64_t cur_sector, int64_t nr_sectors)

{

    assert(bdrv_dirty_bitmap_enabled(bitmap));

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

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+static bool is_zero_cluster_top_locked(BlockDriverState *bs, int64_t start)
+
+{
+
+    BDRVQcow2State *s = bs->opaque;
+
+    int nr = s->cluster_sectors;
+
     uint64_t off;

     int ret;

static bool is_zero_cluster_top_locked(BlockDriverState *bs, int64_t start)

{

    BDRVQcow2State *s = bs->opaque;

    int nr = s->cluster_sectors;

    uint64_t off;

    int ret;

    ret = qcow2_get_cluster_offset(bs, start << BDRV_SECTOR_BITS, &nr, &off);

    assert(nr == s->cluster_sectors);

    return ret == QCOW2_CLUSTER_UNALLOCATED || ret == QCOW2_CLUSTER_ZERO;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static inline void tcg_out_ldst(TCGContext *s, int ret, int addr, int offset, int op)
+
+{

     if (offset == (offset & 0xfff))

static inline void tcg_out_ldst(TCGContext *s, int ret, int addr, int offset, int op)

{

    if (offset == (offset & 0xfff))

        tcg_out32(s, op | INSN_RD(ret) | INSN_RS1(addr) |

                  INSN_IMM13(offset));

    else

        fprintf(stderr, "unimplemented %s with offset %d\n", __func__, offset);

}


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

     DiscardCo rwco = {

+        .bs = bs,

         .offset = offset,

int bdrv_pdiscard(BlockDriverState *bs, int64_t offset, int count)

{

    Coroutine *co;

    DiscardCo rwco = {

        .bs = bs,

        .offset = offset,

        .count = count,

        .ret = NOT_DONE,

    };

    if (qemu_in_coroutine()) {

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

        bdrv_pdiscard_co_entry(&rwco);

    } else {

        co = qemu_coroutine_create(bdrv_pdiscard_co_entry, &rwco);

        qemu_coroutine_enter(co);

        BDRV_POLL_WHILE(bs, rwco.ret == NOT_DONE);

    }

    return rwco.ret;

}


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

     if (sz > p->iov.size) {
+
         sz = p->iov.size;

     }

static void usb_net_handle_dataout(USBNetState *s, USBPacket *p)

{

    int sz = sizeof(s->out_buf) - s->out_ptr;

    struct rndis_packet_msg_type *msg =

            (struct rndis_packet_msg_type *) s->out_buf;

    uint32_t len;

#ifdef TRAFFIC_DEBUG

    fprintf(stderr, "usbnet: data out len %zu\n", p->iov.size);

    iov_hexdump(p->iov.iov, p->iov.niov, stderr, "usbnet", p->iov.size);

#endif

    if (sz > p->iov.size) {

        sz = p->iov.size;

    }

    usb_packet_copy(p, &s->out_buf[s->out_ptr], sz);

    s->out_ptr += sz;

    if (!is_rndis(s)) {

        if (p->iov.size < 64) {

            qemu_send_packet(qemu_get_queue(s->nic), s->out_buf, s->out_ptr);

            s->out_ptr = 0;

        }

        return;

    }

    len = le32_to_cpu(msg->MessageLength);

    if (s->out_ptr < 8 || s->out_ptr < len) {

        return;

    }

    if (le32_to_cpu(msg->MessageType) == RNDIS_PACKET_MSG) {

        uint32_t offs = 8 + le32_to_cpu(msg->DataOffset);

        uint32_t size = le32_to_cpu(msg->DataLength);

        if (offs + size <= len)

            qemu_send_packet(qemu_get_queue(s->nic), s->out_buf + offs, size);

    }

    s->out_ptr -= len;

    memmove(s->out_buf, &s->out_buf[len], s->out_ptr);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static void scsi_remove_request(SCSIGenericReq *r)

+{

     qemu_free(r->buf);

static void scsi_remove_request(SCSIGenericReq *r)

{

    qemu_free(r->buf);

    scsi_req_free(&r->req);

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     LOCAL_ALIGNED(32, float, odst, [LEN]);

     int ret;
+
+
+
+    cdsp->vector_fmul_reverse(cdst, v1, v2, LEN);
+
     fdsp->vector_fmul_reverse(odst, v1, v2, LEN);

static int test_vector_fmul_reverse(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,

                                    const float *v1, const float *v2)

{

    LOCAL_ALIGNED(32, float, cdst, [LEN]);

    LOCAL_ALIGNED(32, float, odst, [LEN]);

    int ret;

    cdsp->vector_fmul_reverse(cdst, v1, v2, LEN);

    fdsp->vector_fmul_reverse(odst, v1, v2, LEN);

    if (ret = compare_floats(cdst, odst, LEN, FLT_EPSILON))

        av_log(NULL, AV_LOG_ERROR, "vector_fmul_reverse failed\n");

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
         if (pvr == ppc_defs[i].pvr) {

             return &ppc_defs[i];
+
+        }
+
+    }
+

     return NULL;

static const ppc_def_t *ppc_find_by_pvr (uint32_t pvr)

{

    int i;

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

        /* If we have an exact match, we're done */

        if (pvr == ppc_defs[i].pvr) {

            return &ppc_defs[i];

        }

    }

    return NULL;

}


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

     uint32_t cp = (insn >> 8) & 0xf;

+    if (IS_USER(s)) {

         return 1;

@@ -20,7 +20,7 @@

         if (!env->cp[cp].cp_read)

+            return 1;

         gen_set_pc_im(s->pc);

static int disas_cp_insn(CPUState *env, DisasContext *s, uint32_t insn)

{

    TCGv tmp, tmp2;

    uint32_t rd = (insn >> 12) & 0xf;

    uint32_t cp = (insn >> 8) & 0xf;

    if (IS_USER(s)) {

        return 1;

    }

    if (insn & ARM_CP_RW_BIT) {

        if (!env->cp[cp].cp_read)

            return 1;

        gen_set_pc_im(s->pc);

        tmp = new_tmp();

        tmp2 = tcg_const_i32(insn);

        gen_helper_get_cp(tmp, cpu_env, tmp2);

        tcg_temp_free(tmp2);

        store_reg(s, rd, tmp);

    } else {

        if (!env->cp[cp].cp_write)

            return 1;

        gen_set_pc_im(s->pc);

        tmp = load_reg(s, rd);

        tmp2 = tcg_const_i32(insn);

        gen_helper_set_cp(cpu_env, tmp2, tmp);

        tcg_temp_free(tmp2);

        dead_tmp(tmp);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -35,11 +35,11 @@
     bios_linker_loader_add_checksum(linker, ACPI_BUILD_RSDP_FILE,

                                     rsdp, sizeof *rsdp,
+
+                                    &rsdp->checksum);
+
+
+
     return rsdp_table;

 }

build_rsdp(GArray *rsdp_table, BIOSLinker *linker, unsigned rsdt)

{

    AcpiRsdpDescriptor *rsdp = acpi_data_push(rsdp_table, sizeof *rsdp);

    bios_linker_loader_alloc(linker, ACPI_BUILD_RSDP_FILE, rsdp_table, 16,

                             true /* fseg memory */);

    memcpy(&rsdp->signature, "RSD PTR ", 8);

    memcpy(rsdp->oem_id, ACPI_BUILD_APPNAME6, 6);

    rsdp->rsdt_physical_address = cpu_to_le32(rsdt);

    /* Address to be filled by Guest linker */

    bios_linker_loader_add_pointer(linker, ACPI_BUILD_RSDP_FILE,

                                   ACPI_BUILD_TABLE_FILE,

                                   &rsdp->rsdt_physical_address,

                                   sizeof rsdp->rsdt_physical_address);

    rsdp->checksum = 0;

    /* Checksum to be filled by Guest linker */

    bios_linker_loader_add_checksum(linker, ACPI_BUILD_RSDP_FILE,

                                    rsdp, sizeof *rsdp,

                                    &rsdp->checksum);

    return rsdp_table;

}


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

     DeviceState *dev;
+
     SysBusDevice *s;

     GrackleState *d;

PCIBus *pci_grackle_init(uint32_t base, qemu_irq *pic)

{

    DeviceState *dev;

    SysBusDevice *s;

    GrackleState *d;

    dev = qdev_create(NULL, "grackle");

    qdev_init(dev);

    s = sysbus_from_qdev(dev);

    d = FROM_SYSBUS(GrackleState, s);

    d->host_state.bus = pci_register_bus(&d->busdev.qdev, "pci",

                                         pci_grackle_set_irq,

                                         pci_grackle_map_irq,

                                         pic, 0, 4);

    pci_create_simple(d->host_state.bus, 0, "grackle");

    sysbus_mmio_map(s, 0, base);

    sysbus_mmio_map(s, 1, base + 0x00200000);

    return d->host_state.bus;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void end_frame(AVFilterLink *link)

+{

     CropContext *crop = link->dst->priv;

static void end_frame(AVFilterLink *link)

{

    CropContext *crop = link->dst->priv;

    crop->var_values[N] += 1.0;

    avfilter_unref_buffer(link->cur_buf);

    avfilter_end_frame(link->dst->outputs[0]);

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
     bs = bdrv_find(id);

     if (!bs) {
+
+        qerror_report(QERR_DEVICE_NOT_FOUND, id);
+
+        return -1;
+
     }

     if (bdrv_in_use(bs)) {

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

{

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

    BlockDriverState *bs;

    bs = bdrv_find(id);

    if (!bs) {

        qerror_report(QERR_DEVICE_NOT_FOUND, id);

        return -1;

    }

    if (bdrv_in_use(bs)) {

        qerror_report(QERR_DEVICE_IN_USE, id);

        return -1;

    }

    /* quiesce block driver; prevent further io */

    qemu_aio_flush();

    bdrv_flush(bs);

    bdrv_close(bs);

    /* if we have a device attached to this BlockDriverState

     * then we need to make the drive anonymous until the device

     * can be removed.  If this is a drive with no device backing

     * then we can just get rid of the block driver state right here.

     */

    if (bdrv_get_attached_dev(bs)) {

        bdrv_make_anon(bs);

    } else {

        drive_uninit(drive_get_by_blockdev(bs));

    }

    return 0;

}


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

                                  const int chroma_format_idc)

+{

 #if HAVE_ALTIVEC

av_cold void ff_h264dsp_init_ppc(H264DSPContext *c, const int bit_depth,

                                 const int chroma_format_idc)

{

#if HAVE_ALTIVEC

    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))

        return;

    if (bit_depth == 8) {

        c->h264_idct_add = h264_idct_add_altivec;

        if (chroma_format_idc == 1)

            c->h264_idct_add8 = h264_idct_add8_altivec;

        c->h264_idct_add16      = h264_idct_add16_altivec;

        c->h264_idct_add16intra = h264_idct_add16intra_altivec;

        c->h264_idct_dc_add= h264_idct_dc_add_altivec;

        c->h264_idct8_dc_add = h264_idct8_dc_add_altivec;

        c->h264_idct8_add    = h264_idct8_add_altivec;

        c->h264_idct8_add4   = h264_idct8_add4_altivec;

        c->h264_v_loop_filter_luma= h264_v_loop_filter_luma_altivec;

        c->h264_h_loop_filter_luma= h264_h_loop_filter_luma_altivec;

        c->weight_h264_pixels_tab[0]   = weight_h264_pixels16_altivec;

        c->weight_h264_pixels_tab[1]   = weight_h264_pixels8_altivec;

        c->biweight_h264_pixels_tab[0] = biweight_h264_pixels16_altivec;

        c->biweight_h264_pixels_tab[1] = biweight_h264_pixels8_altivec;

    }

#endif /* HAVE_ALTIVEC */

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
         s->max_gsi = gsi_bits;

+
+        /* Mark any over-allocated bits as already in use */
+
+        for (i = gsi_count; i < gsi_bits; i++) {
+
             set_gsi(s, i);

         }

static void kvm_init_irq_routing(KVMState *s)

{

    int gsi_count;

    gsi_count = kvm_check_extension(s, KVM_CAP_IRQ_ROUTING);

    if (gsi_count > 0) {

        unsigned int gsi_bits, i;

        /* Round up so we can search ints using ffs */

        gsi_bits = ALIGN(gsi_count, 32);

        s->used_gsi_bitmap = g_malloc0(gsi_bits / 8);

        s->max_gsi = gsi_bits;

        /* Mark any over-allocated bits as already in use */

        for (i = gsi_count; i < gsi_bits; i++) {

            set_gsi(s, i);

        }

    }

    s->irq_routes = g_malloc0(sizeof(*s->irq_routes));

    s->nr_allocated_irq_routes = 0;

    kvm_arch_init_irq_routing(s);

}


--- a/source.c
+++ b/source.c
@@ -7,10 +7,10 @@
         if (!s->iformat)
             return av_probe_input_buffer(s->pb, &s->iformat, filename, s, 0, 0);
         else if (s->iformat->flags & AVFMT_NOFILE)
+            av_log(s, AV_LOG_WARNING, "Custom AVIOContext makes no sense and "
+                                      "will be ignored with AVFMT_NOFILE format.\n");
+    }
+    if ( (s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
         (!s->iformat && (s->iformat = av_probe_input_format(&pd, 0))))
     if ((ret = avio_open(&s->pb, filename, AVIO_FLAG_READ)) < 0)
         return ret;

static int init_input(AVFormatContext *s, const char *filename)
{
    int ret;
    AVProbeData pd = {filename, NULL, 0};
    if (s->pb) {
        s->flags |= AVFMT_FLAG_CUSTOM_IO;
        if (!s->iformat)
            return av_probe_input_buffer(s->pb, &s->iformat, filename, s, 0, 0);
        else if (s->iformat->flags & AVFMT_NOFILE)
            av_log(s, AV_LOG_WARNING, "Custom AVIOContext makes no sense and "
                                      "will be ignored with AVFMT_NOFILE format.\n");
    }
    if ( (s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
        (!s->iformat && (s->iformat = av_probe_input_format(&pd, 0))))
    if ((ret = avio_open(&s->pb, filename, AVIO_FLAG_READ)) < 0)
        return ret;
    if (s->iformat)
    return av_probe_input_buffer(s->pb, &s->iformat, filename, s, 0, 0);
}


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

     uint32_t * palette = (uint32_t *)frame->data[1];
+
+    int a;
+
+    for(a = 0; a < 256; a++){

         palette[a] = AV_RB24(&palette_buffer[a * 3]) * 4;

static void set_palette(AVFrame * frame, const uint8_t * palette_buffer)

{

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

    int a;

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

        palette[a] = AV_RB24(&palette_buffer[a * 3]) * 4;

    }

    frame->palette_has_changed = 1;

}


--- a/source.c
+++ b/source.c
@@ -3,10 +3,10 @@
                                             const char *name, void *opaque,

                                             Error **errp)
+
+{
+
+    I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj);

     uint32_t value = s->pci_hole.end;

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

                                            const char *name, void *opaque,

                                            Error **errp)

{

    I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj);

    uint32_t value = s->pci_hole.end;

    visit_type_uint32(v, name, &value, errp);

}


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

     int w1, x, y, last_width;

+

     last_width = s->width;

static void text_console_resize(QemuConsole *s)

{

    TextCell *cells, *c, *c1;

    int w1, x, y, last_width;

    last_width = s->width;

    s->width = surface_width(s->surface) / FONT_WIDTH;

    s->height = surface_height(s->surface) / FONT_HEIGHT;

    w1 = last_width;

    if (s->width < w1)

        w1 = s->width;

    cells = g_malloc(s->width * s->total_height * sizeof(TextCell));

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

        c = &cells[y * s->width];

        if (w1 > 0) {

            c1 = &s->cells[y * last_width];

            for(x = 0; x < w1; x++) {

                *c++ = *c1++;

            }

        }

        for(x = w1; x < s->width; x++) {

            c->ch = ' ';

            c->t_attrib = s->t_attrib_default;

            c++;

        }

    }

    g_free(s->cells);

    s->cells = cells;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void coroutine_fn sd_finish_aiocb(SheepdogAIOCB *acb)
+
 {

     qemu_coroutine_enter(acb->coroutine, NULL);

static void coroutine_fn sd_finish_aiocb(SheepdogAIOCB *acb)

{

    qemu_coroutine_enter(acb->coroutine, NULL);

    qemu_aio_unref(acb);

}


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

 {

+    int ret, rc = 0;
+
     unsigned int xh_len;

     int xh_flags;
@@ -15,8 +15,8 @@
         XBZRLE.decoded_buf = g_malloc(TARGET_PAGE_SIZE);

     }
+
+

     /* extract RLE header */

static int load_xbzrle(QEMUFile *f, ram_addr_t addr, void *host)

{

    int ret, rc = 0;

    unsigned int xh_len;

    int xh_flags;

    if (!XBZRLE.decoded_buf) {

        XBZRLE.decoded_buf = g_malloc(TARGET_PAGE_SIZE);

    }

    /* extract RLE header */

    xh_flags = qemu_get_byte(f);

    xh_len = qemu_get_be16(f);

    if (xh_flags != ENCODING_FLAG_XBZRLE) {

        fprintf(stderr, "Failed to load XBZRLE page - wrong compression!\n");

        return -1;

    }

    if (xh_len > TARGET_PAGE_SIZE) {

        fprintf(stderr, "Failed to load XBZRLE page - len overflow!\n");

        return -1;

    }

    /* load data and decode */

    qemu_get_buffer(f, XBZRLE.decoded_buf, xh_len);

    /* decode RLE */

    ret = xbzrle_decode_buffer(XBZRLE.decoded_buf, xh_len, host,

                               TARGET_PAGE_SIZE);

    if (ret == -1) {

        fprintf(stderr, "Failed to load XBZRLE page - decode error!\n");

        rc = -1;

    } else  if (ret > TARGET_PAGE_SIZE) {

        fprintf(stderr, "Failed to load XBZRLE page - size %d exceeds %d!\n",

                ret, TARGET_PAGE_SIZE);

        abort();

    }

    return rc;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static uint32_t m5206_mbar_readb(void *opaque, target_phys_addr_t offset)
+
+{
+
+    m5206_mbar_state *s = (m5206_mbar_state *)opaque;

     offset &= 0x3ff;

static uint32_t m5206_mbar_readb(void *opaque, target_phys_addr_t offset)

{

    m5206_mbar_state *s = (m5206_mbar_state *)opaque;

    offset &= 0x3ff;

    if (offset >= 0x200) {

        hw_error("Bad MBAR read offset 0x%x", (int)offset);

    }

    if (m5206_mbar_width[offset >> 2] > 1) {

        uint16_t val;

        val = m5206_mbar_readw(opaque, offset & ~1);

        if ((offset & 1) == 0) {

            val >>= 8;

        }

        return val & 0xff;

    }

    return m5206_mbar_read(s, offset, 1);

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
         io_mem_write(section->mr, addr, (uint32_t)val, 4);

         io_mem_write(section->mr, addr + 4, val >> 32, 4);
+
+#endif
+
+    } else {
+
         ptr = qemu_get_ram_ptr((memory_region_get_ram_addr(section->mr)

                                 & TARGET_PAGE_MASK)

void stq_phys_notdirty(target_phys_addr_t addr, uint64_t val)

{

    uint8_t *ptr;

    MemoryRegionSection *section;

    section = phys_page_find(addr >> TARGET_PAGE_BITS);

    if (!memory_region_is_ram(section->mr) || section->readonly) {

        addr = memory_region_section_addr(section, addr);

        if (memory_region_is_ram(section->mr)) {

            section = &phys_sections[phys_section_rom];

        }

#ifdef TARGET_WORDS_BIGENDIAN

        io_mem_write(section->mr, addr, val >> 32, 4);

        io_mem_write(section->mr, addr + 4, (uint32_t)val, 4);

#else

        io_mem_write(section->mr, addr, (uint32_t)val, 4);

        io_mem_write(section->mr, addr + 4, val >> 32, 4);

#endif

    } else {

        ptr = qemu_get_ram_ptr((memory_region_get_ram_addr(section->mr)

                                & TARGET_PAGE_MASK)

                               + memory_region_section_addr(section, addr));

        stq_p(ptr, val);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+static av_always_inline int vmnc_get_pixel(const uint8_t *buf, int bpp, int be)

+{
+
+    switch (bpp * 2 + be) {
+
+    case 2:
+
     case 3:

         return *buf;

static av_always_inline int vmnc_get_pixel(const uint8_t *buf, int bpp, int be)

{

    switch (bpp * 2 + be) {

    case 2:

    case 3:

        return *buf;

    case 4:

        return AV_RL16(buf);

    case 5:

        return AV_RB16(buf);

    case 8:

        return AV_RL32(buf);

    case 9:

        return AV_RB32(buf);

    default:

        return 0;

    }

}


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

     if (unlikely((float64_is_infinity(farg1.d) && float64_is_zero(farg2.d)) ||

+                 (float64_is_zero(farg1.d) && float64_is_infinity(farg2.d)))) {
+
+        /* Multiplication of zero by infinity */
+
+        farg1.ll = fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXIMZ);

     } else {

uint64_t helper_fmul(CPUPPCState *env, uint64_t arg1, uint64_t arg2)

{

    CPU_DoubleU farg1, farg2;

    farg1.ll = arg1;

    farg2.ll = arg2;

    if (unlikely((float64_is_infinity(farg1.d) && float64_is_zero(farg2.d)) ||

                 (float64_is_zero(farg1.d) && float64_is_infinity(farg2.d)))) {

        /* Multiplication of zero by infinity */

        farg1.ll = fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXIMZ);

    } else {

        if (unlikely(float64_is_signaling_nan(farg1.d) ||

                     float64_is_signaling_nan(farg2.d))) {

            /* sNaN multiplication */

            fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN);

        }

        farg1.d = float64_mul(farg1.d, farg2.d, &env->fp_status);

    }

    return farg1.ll;

}