--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int g2m_init_buffers(G2MContext *c)

 {
+
+    int aligned_height;

static int g2m_init_buffers(G2MContext *c)

{

    int aligned_height;

    if (!c->framebuf || c->old_width < c->width || c->old_height < c->height) {

        c->framebuf_stride = FFALIGN(c->width * 3, 16);

        aligned_height     = FFALIGN(c->height,    16);

        av_free(c->framebuf);

        c->framebuf = av_mallocz(c->framebuf_stride * aligned_height);

        if (!c->framebuf)

            return AVERROR(ENOMEM);

    }

    if (!c->synth_tile || !c->jpeg_tile ||

        c->old_tile_w < c->tile_width ||

        c->old_tile_h < c->tile_height) {

        c->tile_stride = FFALIGN(c->tile_width, 16) * 3;

        aligned_height = FFALIGN(c->tile_height,    16);

        av_free(c->synth_tile);

        av_free(c->jpeg_tile);

        av_free(c->kempf_buf);

        av_free(c->kempf_flags);

        c->synth_tile  = av_mallocz(c->tile_stride      * aligned_height);

        c->jpeg_tile   = av_mallocz(c->tile_stride      * aligned_height);

        c->kempf_buf   = av_mallocz((c->tile_width + 1) * aligned_height

                                    + FF_INPUT_BUFFER_PADDING_SIZE);

        c->kempf_flags = av_mallocz( c->tile_width      * aligned_height);

        if (!c->synth_tile || !c->jpeg_tile ||

            !c->kempf_buf || !c->kempf_flags)

            return AVERROR(ENOMEM);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void v9fs_link(void *opaque)
+{
+    V9fsPDU *pdu = opaque;
+    int32_t dfid, oldfid;
+    V9fsFidState *dfidp, *oldfidp;
+    V9fsString name;
     size_t offset = 7;
     int err = 0;
     v9fs_string_init(&name);

static void v9fs_link(void *opaque)
{
    V9fsPDU *pdu = opaque;
    int32_t dfid, oldfid;
    V9fsFidState *dfidp, *oldfidp;
    V9fsString name;
    size_t offset = 7;
    int err = 0;
    v9fs_string_init(&name);
    err = pdu_unmarshal(pdu, offset, "dds", &dfid, &oldfid, &name);
    if (err < 0) {
    trace_v9fs_link(pdu->tag, pdu->id, dfid, oldfid, name.data);
    if (name_is_illegal(name.data)) {
        err = -ENOENT;
    dfidp = get_fid(pdu, dfid);
    if (dfidp == NULL) {
        err = -ENOENT;
    oldfidp = get_fid(pdu, oldfid);
    if (oldfidp == NULL) {
        err = -ENOENT;
        goto out;
    err = v9fs_co_link(pdu, oldfidp, dfidp, &name);
    if (!err) {
        err = offset;
out:
    put_fid(pdu, dfidp);
out_nofid:
    v9fs_string_free(&name);
    pdu_complete(pdu, err);


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void kvm_s390_interrupt_internal(S390CPU *cpu, int type, uint32_t parm,
+
+                                 uint64_t parm64, int vm)
+
+{
+
     CPUState *cs = CPU(cpu);

     struct kvm_s390_interrupt kvmint;

void kvm_s390_interrupt_internal(S390CPU *cpu, int type, uint32_t parm,

                                 uint64_t parm64, int vm)

{

    CPUState *cs = CPU(cpu);

    struct kvm_s390_interrupt kvmint;

    int r;

    if (!cs->kvm_state) {

        return;

    }

    kvmint.type = type;

    kvmint.parm = parm;

    kvmint.parm64 = parm64;

    if (vm) {

        r = kvm_vm_ioctl(cs->kvm_state, KVM_S390_INTERRUPT, &kvmint);

    } else {

        r = kvm_vcpu_ioctl(cs, KVM_S390_INTERRUPT, &kvmint);

    }

    if (r < 0) {

        fprintf(stderr, "KVM failed to inject interrupt\n");

        exit(1);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,19 +1,19 @@
+static void patch_reloc(tcg_insn_unit *code_ptr, int type,
+
+                        intptr_t value, intptr_t addend)
+
+{
+
+    tcg_insn_unit *target;
+
+    tcg_insn_unit old;

+
+
+    value += addend;
+
     target = (tcg_insn_unit *)value;
+

     switch (type) {

static void patch_reloc(tcg_insn_unit *code_ptr, int type,

                        intptr_t value, intptr_t addend)

{

    tcg_insn_unit *target;

    tcg_insn_unit old;

    value += addend;

    target = (tcg_insn_unit *)value;

    switch (type) {

    case R_PPC_REL14:

        reloc_pc14(code_ptr, target);

        break;

    case R_PPC_REL24:

        reloc_pc24(code_ptr, target);

        break;

    case R_PPC_ADDR16:

        assert(value == (int16_t)value);

        old = *code_ptr;

        old = deposit32(old, 0, 16, value);

        *code_ptr = old;

        break;

    default:

        tcg_abort();

    }

}


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

     if (subframe == 0 || subframe == 2) {
+
         if (pitch_index < 376) {

             *lag_int  = (pitch_index + 137) >> 2;

static void decode_pitch_lag_high(int *lag_int, int *lag_frac, int pitch_index,

                                  uint8_t *base_lag_int, int subframe)

{

    if (subframe == 0 || subframe == 2) {

        if (pitch_index < 376) {

            *lag_int  = (pitch_index + 137) >> 2;

            *lag_frac = pitch_index - (*lag_int << 2) + 136;

        } else if (pitch_index < 440) {

            *lag_int  = (pitch_index + 257 - 376) >> 1;

            *lag_frac = (pitch_index - (*lag_int << 1) + 256 - 376) << 1;

            /* the actual resolution is 1/2 but expressed as 1/4 */

        } else {

            *lag_int  = pitch_index - 280;

            *lag_frac = 0;

        }

        /* minimum lag for next subframe */

        *base_lag_int = av_clip(*lag_int - 8 - (*lag_frac < 0),

                                AMRWB_P_DELAY_MIN, AMRWB_P_DELAY_MAX - 15);

        // XXX: the spec states clearly that *base_lag_int should be

        // the nearest integer to *lag_int (minus 8), but the ref code

        // actually always uses its floor, I'm following the latter

    } else {

        *lag_int  = (pitch_index + 1) >> 2;

        *lag_frac = pitch_index - (*lag_int << 2);

        *lag_int += *base_lag_int;

    }

}


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

     while (nb_sectors > 0) {

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

         }

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

                                 uint8_t *buf, int nb_sectors)

{

    BDRVCowState *s = bs->opaque;

    int ret, n;

    while (nb_sectors > 0) {

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

        if (ret < 0) {

            return ret;

        }

        if (ret) {

            ret = bdrv_pread(bs->file,

                        s->cow_sectors_offset + sector_num * 512,

                        buf, n * 512);

            if (ret < 0) {

                return ret;

            }

        } else {

            if (bs->backing_hd) {

                /* read from the base image */

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

                if (ret < 0) {

                    return ret;

                }

            } else {

                memset(buf, 0, n * 512);

            }

        }

        nb_sectors -= n;

        sector_num += n;

        buf += n * 512;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     rdma->wr_data[idx].control_mr = ibv_reg_mr(rdma->pd,

             rdma->wr_data[idx].control, RDMA_CONTROL_MAX_BUFFER,
+
+            IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_WRITE);
+
+    if (rdma->wr_data[idx].control_mr) {
+
         rdma->total_registrations++;

         return 0;

static int qemu_rdma_reg_control(RDMAContext *rdma, int idx)

{

    rdma->wr_data[idx].control_mr = ibv_reg_mr(rdma->pd,

            rdma->wr_data[idx].control, RDMA_CONTROL_MAX_BUFFER,

            IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_WRITE);

    if (rdma->wr_data[idx].control_mr) {

        rdma->total_registrations++;

        return 0;

    }

    fprintf(stderr, "qemu_rdma_reg_control failed!\n");

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static inline uint32_t get_hwc_address(SM501State *state, int crt)
+
 {

     uint32_t addr = crt ? state->dc_crt_hwc_addr : state->dc_panel_hwc_addr;

static inline uint32_t get_hwc_address(SM501State *state, int crt)

{

    uint32_t addr = crt ? state->dc_crt_hwc_addr : state->dc_panel_hwc_addr;

    return (addr & 0x03FFFFF0)/* >> 4*/;

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
+static int qemu_peek_byte(QEMUFile *f)

 {

+    if (f->is_write) {

+        abort();

     }

+

     if (f->buf_index >= f->buf_size) {

static int qemu_peek_byte(QEMUFile *f)

{

    if (f->is_write) {

        abort();

    }

    if (f->buf_index >= f->buf_size) {

        qemu_fill_buffer(f);

        if (f->buf_index >= f->buf_size) {

            return 0;

        }

    }

    return f->buf[f->buf_index];

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void ff_free_stream(AVFormatContext *s, AVStream *st){

     av_assert0(s->nb_streams>0);
+
+    av_assert0(s->streams[ s->nb_streams-1 ] == st);

void ff_free_stream(AVFormatContext *s, AVStream *st){

    av_assert0(s->nb_streams>0);

    av_assert0(s->streams[ s->nb_streams-1 ] == st);

    if (st->codec) {

        avcodec_close(st->codec);

    }

    if (st->parser) {

        av_parser_close(st->parser);

    }

    if (st->attached_pic.data)

        av_free_packet(&st->attached_pic);

    av_dict_free(&st->metadata);

    av_freep(&st->probe_data.buf);

    av_freep(&st->index_entries);

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

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

    av_freep(&st->codec);

    av_freep(&st->priv_data);

    if (st->info)

        av_freep(&st->info->duration_error);

    av_freep(&st->info);

    av_freep(&s->streams[ --s->nb_streams ]);

}


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

         (o = c->opt_find(obj, name, unit, opt_flags, search_flags)))

+        return o;
+
+
+
+    while (o = av_next_option(obj, o)) {

         if (!strcmp(o->name, name) && (!unit || (o->unit && !strcmp(o->unit, unit))) &&

const AVOption *av_opt_find(void *obj, const char *name, const char *unit,

                            int opt_flags, int search_flags)

{

    AVClass *c = *(AVClass**)obj;

    const AVOption *o = NULL;

    if (c->opt_find && search_flags & AV_OPT_SEARCH_CHILDREN &&

        (o = c->opt_find(obj, name, unit, opt_flags, search_flags)))

        return o;

    while (o = av_next_option(obj, o)) {

        if (!strcmp(o->name, name) && (!unit || (o->unit && !strcmp(o->unit, unit))) &&

            (o->flags & opt_flags) == opt_flags)

            return o;

    }

    return NULL;

}


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

 {

+    MigrationState *s = data;
+
+
+
+    if (migration_is_active(s)) {

 #ifdef SPICE_INTERFACE_MIGRATION

static void migration_state_notifier(Notifier *notifier, void *data)

{

    MigrationState *s = data;

    if (migration_is_active(s)) {

#ifdef SPICE_INTERFACE_MIGRATION

        spice_server_migrate_start(spice_server);

#endif

    } else if (migration_has_finished(s)) {

#if SPICE_SERVER_VERSION >= 0x000701 /* 0.7.1 */

#ifndef SPICE_INTERFACE_MIGRATION

        spice_server_migrate_switch(spice_server);

#else

        spice_server_migrate_end(spice_server, true);

    } else if (migration_has_failed(s)) {

        spice_server_migrate_end(spice_server, false);

#endif

#endif

    }

}


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

 {

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

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

static int write_header(AVFormatContext *s)

{

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

    if (s->nb_streams > 1) {

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

        return AVERROR(EINVAL);

    }

    if (codec->codec_id != AV_CODEC_ID_WAVPACK) {

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

        return AVERROR(EINVAL);

    }

    if (codec->extradata_size > 0) {

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

        return AVERROR_PATCHWELCOME;

    }

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

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int idcin_read_seek(AVFormatContext *s, int stream_index,

                            int64_t timestamp, int flags)
+
 {

     IdcinDemuxContext *idcin = s->priv_data;

static int idcin_read_seek(AVFormatContext *s, int stream_index,

                           int64_t timestamp, int flags)

{

    IdcinDemuxContext *idcin = s->priv_data;

    if (idcin->first_pkt_pos > 0) {

        int ret = avio_seek(s->pb, idcin->first_pkt_pos, SEEK_SET);

        if (ret < 0)

            return ret;

        ff_update_cur_dts(s, s->streams[idcin->video_stream_index], 0);

        idcin->next_chunk_is_video = 1;

        idcin->current_audio_chunk = 0;

        return 0;

    }

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     ram_addr_t addr;

     if ((last_ram_offset + size) > kqemu_phys_ram_size) {
+
+        fprintf(stderr, "Not enough memory (requested_size = %" PRIu64 ", max memory = %" PRIu64 ")\n",
+
+                (uint64_t)size, (uint64_t)kqemu_phys_ram_size);
+
         abort();

     }

static ram_addr_t kqemu_ram_alloc(ram_addr_t size)

{

    ram_addr_t addr;

    if ((last_ram_offset + size) > kqemu_phys_ram_size) {

        fprintf(stderr, "Not enough memory (requested_size = %" PRIu64 ", max memory = %" PRIu64 ")\n",

                (uint64_t)size, (uint64_t)kqemu_phys_ram_size);

        abort();

    }

    addr = last_ram_offset;

    last_ram_offset = TARGET_PAGE_ALIGN(last_ram_offset + size);

    return addr;

}


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

     }
+
+    if (read_sync(csock, name, length) != length) {
+
+        LOG("read failed");
+
         goto fail;

     }

static int nbd_handle_export_name(NBDClient *client, uint32_t length)

{

    int rc = -EINVAL, csock = client->sock;

    char name[256];

    /* Client sends:

        [20 ..  xx]   export name (length bytes)

     */

    TRACE("Checking length");

    if (length > 255) {

        LOG("Bad length received");

        goto fail;

    }

    if (read_sync(csock, name, length) != length) {

        LOG("read failed");

        goto fail;

    }

    name[length] = '\0';

    client->exp = nbd_export_find(name);

    if (!client->exp) {

        LOG("export not found");

        goto fail;

    }

    QTAILQ_INSERT_TAIL(&client->exp->clients, client, next);

    nbd_export_get(client->exp);

    rc = 0;

fail:

    return rc;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static int libquvi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
+
+{

     LibQuviContext *qc = s->priv_data;

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

{

    LibQuviContext *qc = s->priv_data;

    return av_seek_frame(qc->fmtctx, stream_index, timestamp, flags);

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
         qemu_chr_write(s->chr, "\r", 1);

     } else if (ch == STI_TRACE_CONSOLE_CHANNEL || 1) {
+
+        if (value == 0xc0 || value == 0xc3) {
+
+            /* Open channel <i>ch</i>.  */
+
         } else if (value == 0x00)

             qemu_chr_write(s->chr, "\n", 1);

static void omap_sti_fifo_write(void *opaque, target_phys_addr_t addr,

                uint32_t value)

{

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

    int offset = addr - s->channel_base;

    int ch = offset >> 6;

    uint8_t byte = value;

    if (ch == STI_TRACE_CONTROL_CHANNEL) {

        /* Flush channel value.  */

        qemu_chr_write(s->chr, "\r", 1);

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

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

            /* Open channel ch.  */

        } else if (value == 0x00)

            qemu_chr_write(s->chr, "\n", 1);

        else

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

    }

}


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

     if (fs->ac > 1) {
+
+        //FIXME only redo if state_transition changed
+
+        for (j = 1; j < 256; j++) {
+
             fs->c.one_state[j]        = f->state_transition[j];

             fs->c.zero_state[256 - j] = 256 - fs->c.one_state[j];

int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)

{

    int j;

    fs->plane_count  = f->plane_count;

    fs->transparency = f->transparency;

    for (j = 0; j < f->plane_count; j++) {

        PlaneContext *const p = &fs->plane[j];

        if (fs->ac) {

            if (!p->state)

                p->state = av_malloc(CONTEXT_SIZE * p->context_count *

                                     sizeof(uint8_t));

            if (!p->state)

                return AVERROR(ENOMEM);

        } else {

            if (!p->vlc_state)

                p->vlc_state = av_malloc(p->context_count * sizeof(VlcState));

            if (!p->vlc_state)

                return AVERROR(ENOMEM);

        }

    }

    if (fs->ac > 1) {

        //FIXME only redo if state_transition changed

        for (j = 1; j < 256; j++) {

            fs->c.one_state[j]        = f->state_transition[j];

            fs->c.zero_state[256 - j] = 256 - fs->c.one_state[j];

        }

    }

    return 0;

}


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

     register_savevm_live(NULL, "block", 0, 1, &savevm_block_handlers,
+
+                         &block_mig_state);
+
+}

void blk_mig_init(void)

{

    QSIMPLEQ_INIT(&block_mig_state.bmds_list);

    QSIMPLEQ_INIT(&block_mig_state.blk_list);

    qemu_mutex_init(&block_mig_state.lock);

    register_savevm_live(NULL, "block", 0, 1, &savevm_block_handlers,

                         &block_mig_state);

}


--- a/source.c
+++ b/source.c
@@ -3,9 +3,9 @@
                            const struct timespec *buf)

 {
+
+    char buffer[PATH_MAX];
+
     char *path = fs_path->data;

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

                           const struct timespec *buf)

{

    char buffer[PATH_MAX];

    char *path = fs_path->data;

    return qemu_utimens(rpath(s, path, buffer), buf);

}


--- a/source.c
+++ b/source.c
@@ -13,7 +13,7 @@
     for (mat = 0; mat < s->num_primitive_matrices; mat++)

         if (s->lsb_bypass[mat])
+
             m->bypassed_lsbs[pos + s->blockpos][mat] = get_bits1(gbp);

static inline int read_huff_channels(MLPDecodeContext *m, GetBitContext *gbp,

                                     unsigned int substr, unsigned int pos)

{

    SubStream *s = &m->substream[substr];

    unsigned int mat, channel;

    for (mat = 0; mat < s->num_primitive_matrices; mat++)

        if (s->lsb_bypass[mat])

            m->bypassed_lsbs[pos + s->blockpos][mat] = get_bits1(gbp);

    for (channel = s->min_channel; channel <= s->max_channel; channel++) {

        ChannelParams *cp = &s->channel_params[channel];

        int codebook = cp->codebook;

        int quant_step_size = s->quant_step_size[channel];

        int lsb_bits = cp->huff_lsbs - quant_step_size;

        int result = 0;

        if (codebook > 0)

            result = get_vlc2(gbp, huff_vlc[codebook-1].table,

                            VLC_BITS, (9 + VLC_BITS - 1) / VLC_BITS);

        if (result < 0)

            return AVERROR_INVALIDDATA;

        if (lsb_bits > 0)

            result = (result << lsb_bits) + get_bits(gbp, lsb_bits);

        result  += cp->sign_huff_offset;

        result <<= quant_step_size;

        m->sample_buffer[pos + s->blockpos][channel] = result;

    }

    return 0;

}


static int dnxhd_init_rc(DNXHDEncContext *ctx)

{

    CHECKED_ALLOCZ(ctx->mb_rc, 8160*ctx->m.avctx->qmax*sizeof(RCEntry));

    if (ctx->m.avctx->mb_decision != FF_MB_DECISION_RD)

        CHECKED_ALLOCZ(ctx->mb_cmp, ctx->m.mb_num*sizeof(RCCMPEntry));

    ctx->frame_bits = (ctx->cid_table->coding_unit_size - 640 - 4) * 8;

    ctx->qscale = 1;

    ctx->lambda = 2<<LAMBDA_FRAC_BITS; // qscale 2

    return 0;

 fail:

    return -1;

}


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

     int i;

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

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

    int i;

    const int index_a = qp + h->slice_alpha_c0_offset;

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

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

    if( bS[0] < 4 ) {

        int8_t tc[4];

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

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

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

    } else {

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

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void HELPER(set_cp_reg)(CPUARMState *env, void *rip, uint32_t value)

+{

     const ARMCPRegInfo *ri = rip;

void HELPER(set_cp_reg)(CPUARMState *env, void *rip, uint32_t value)

{

    const ARMCPRegInfo *ri = rip;

    ri->writefn(env, ri, value);

}


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

+    gen_op_move_T2_T0();

     gen_op_subf();

static always_inline void gen_op_subfco (void)

{

    gen_op_move_T2_T0();

    gen_op_subf();

    gen_op_check_subfc();

    gen_op_check_subfo();

}


static inline void decode_subband_slice_buffered(SnowContext *s, SubBand *b, slice_buffer * sb, int start_y, int h, int save_state[1]){

    const int w= b->width;

    int y;

    const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16);

    int qmul= ff_qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);

    int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;

    int new_index = 0;

    if(b->ibuf == s->spatial_idwt_buffer || s->qlog == LOSSLESS_QLOG){

        qadd= 0;

        qmul= 1<<QEXPSHIFT;

    }

    /* If we are on the second or later slice, restore our index. */

    if (start_y != 0)

        new_index = save_state[0];

    for(y=start_y; y<h; y++){

        int x = 0;

        int v;

        IDWTELEM * line = slice_buffer_get_line(sb, y * b->stride_line + b->buf_y_offset) + b->buf_x_offset;

        memset(line, 0, b->width*sizeof(IDWTELEM));

        v = b->x_coeff[new_index].coeff;

        x = b->x_coeff[new_index++].x;

        while(x < w){

            register int t= ( (v>>1)*qmul + qadd)>>QEXPSHIFT;

            register int u= -(v&1);

            line[x] = (t^u) - u;

            v = b->x_coeff[new_index].coeff;

            x = b->x_coeff[new_index++].x;

        }

    }

    /* Save our variables for the next slice. */

    save_state[0] = new_index;

    return;

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     writable_mask = ~reg->ro_mask & valid_mask;

     cfg_entry->data = XEN_PT_MERGE_VALUE(*val, cfg_entry->data, writable_mask);
+
+
+
+    /* create value for writing to I/O device register */
+
     if (*val & PCI_COMMAND_INTX_DISABLE) {

         throughable_mask |= PCI_COMMAND_INTX_DISABLE;

static int xen_pt_cmd_reg_write(XenPCIPassthroughState *s, XenPTReg *cfg_entry,

                                uint16_t *val, uint16_t dev_value,

                                uint16_t valid_mask)

{

    XenPTRegInfo *reg = cfg_entry->reg;

    uint16_t writable_mask = 0;

    uint16_t throughable_mask = get_throughable_mask(s, reg, valid_mask);

    /* modify emulate register */

    writable_mask = ~reg->ro_mask & valid_mask;

    cfg_entry->data = XEN_PT_MERGE_VALUE(*val, cfg_entry->data, writable_mask);

    /* create value for writing to I/O device register */

    if (*val & PCI_COMMAND_INTX_DISABLE) {

        throughable_mask |= PCI_COMMAND_INTX_DISABLE;

    } else {

        if (s->machine_irq) {

            throughable_mask |= PCI_COMMAND_INTX_DISABLE;

        }

    }

    *val = XEN_PT_MERGE_VALUE(*val, dev_value, throughable_mask);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
         return !!(bmds->aio_bitmap[chunk / (sizeof(unsigned long) * 8)] &

             (1UL << (chunk % (sizeof(unsigned long) * 8))));
+
+    } else {
+
+        return 0;
+
     }

 }

static int bmds_aio_inflight(BlkMigDevState *bmds, int64_t sector)

{

    int64_t chunk = sector / (int64_t)BDRV_SECTORS_PER_DIRTY_CHUNK;

    if (sector < bdrv_nb_sectors(bmds->bs)) {

        return !!(bmds->aio_bitmap[chunk / (sizeof(unsigned long) * 8)] &

            (1UL << (chunk % (sizeof(unsigned long) * 8))));

    } else {

        return 0;

    }

}


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

     DeviceState *dev;
+
     SysBusDevice *s;

     unsigned int i;

static DeviceState *sbi_init(target_phys_addr_t addr, qemu_irq **parent_irq)

{

    DeviceState *dev;

    SysBusDevice *s;

    unsigned int i;

    dev = qdev_create(NULL, "sbi");

    qdev_init(dev);

    s = sysbus_from_qdev(dev);

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

        sysbus_connect_irq(s, i, *parent_irq[i]);

    }

    sysbus_mmio_map(s, 0, addr);

    return dev;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 size_t mptsas_config_ioc_0(MPTSASState *s, uint8_t **data, int address)

+{

     PCIDeviceClass *pcic = PCI_DEVICE_GET_CLASS(s);

size_t mptsas_config_ioc_0(MPTSASState *s, uint8_t **data, int address)

{

    PCIDeviceClass *pcic = PCI_DEVICE_GET_CLASS(s);

    return MPTSAS_CONFIG_PACK(0, MPI_CONFIG_PAGETYPE_IOC, 0x01,

                              "*l*lwwb*b*b*blww",

                              pcic->vendor_id, pcic->device_id, pcic->revision,

                              pcic->subsystem_vendor_id,

                              pcic->subsystem_id);

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     int size = (c->frame_bit_len - c->remaining_bits + 7)>>3;

+
     if (av_new_packet(pkt, size+2) < 0)

         return AVERROR(EIO);

static int vqf_read_packet(AVFormatContext *s, AVPacket *pkt)

{

    VqfContext *c = s->priv_data;

    int ret;

    int size = (c->frame_bit_len - c->remaining_bits + 7)>>3;

    if (av_new_packet(pkt, size+2) < 0)

        return AVERROR(EIO);

    pkt->pos          = avio_tell(s->pb);

    pkt->stream_index = 0;

    pkt->duration     = 1;

    pkt->data[0] = 8 - c->remaining_bits; // Number of bits to skip

    pkt->data[1] = c->last_frame_bits;

    ret = avio_read(s->pb, pkt->data+2, size);

    if (ret<=0) {

        av_free_packet(pkt);

        return AVERROR(EIO);

    }

    c->last_frame_bits = pkt->data[size+1];

    c->remaining_bits  = (size << 3) - c->frame_bit_len + c->remaining_bits;

    return size+2;

}


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

     XtensaCPU *cpu = XTENSA_CPU(obj);

+    XtensaCPUClass *xcc = XTENSA_CPU_GET_CLASS(obj);

     CPUXtensaState *env = &cpu->env;

static void xtensa_cpu_initfn(Object *obj)

{

    CPUState *cs = CPU(obj);

    XtensaCPU *cpu = XTENSA_CPU(obj);

    XtensaCPUClass *xcc = XTENSA_CPU_GET_CLASS(obj);

    CPUXtensaState *env = &cpu->env;

    static bool tcg_inited;

    cs->env_ptr = env;

    env->config = xcc->config;

    cpu_exec_init(cs, &error_abort);

    if (tcg_enabled() && !tcg_inited) {

        tcg_inited = true;

        xtensa_translate_init();

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+PPC_OP(check_reservation)

+{

     if ((uint32_t)env->reserve == (uint32_t)(T0 & ~0x00000003))

PPC_OP(check_reservation)

{

    if ((uint32_t)env->reserve == (uint32_t)(T0 & ~0x00000003))

        env->reserve = -1;

    RETURN();

}


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

                        &testdata, test_validate_fail_union_flat);

+    validate_test_add("/visitor/input-strict/fail/union-flat-no-discriminator",
+
+                       &testdata, test_validate_fail_union_flat_no_discrim);
+
+    validate_test_add("/visitor/input-strict/fail/union-anon",

                        &testdata, test_validate_fail_union_anon);

int main(int argc, char **argv)

{

    TestInputVisitorData testdata;

    g_test_init(&argc, &argv, NULL);

    validate_test_add("/visitor/input-strict/pass/struct",

                       &testdata, test_validate_struct);

    validate_test_add("/visitor/input-strict/pass/struct-nested",

                       &testdata, test_validate_struct_nested);

    validate_test_add("/visitor/input-strict/pass/list",

                       &testdata, test_validate_list);

    validate_test_add("/visitor/input-strict/pass/union",

                       &testdata, test_validate_union);

    validate_test_add("/visitor/input-strict/pass/union-flat",

                       &testdata, test_validate_union_flat);

    validate_test_add("/visitor/input-strict/pass/union-anon",

                       &testdata, test_validate_union_anon);

    validate_test_add("/visitor/input-strict/fail/struct",

                       &testdata, test_validate_fail_struct);

    validate_test_add("/visitor/input-strict/fail/struct-nested",

                       &testdata, test_validate_fail_struct_nested);

    validate_test_add("/visitor/input-strict/fail/list",

                       &testdata, test_validate_fail_list);

    validate_test_add("/visitor/input-strict/fail/union",

                       &testdata, test_validate_fail_union);

    validate_test_add("/visitor/input-strict/fail/union-flat",

                       &testdata, test_validate_fail_union_flat);

    validate_test_add("/visitor/input-strict/fail/union-flat-no-discriminator",

                       &testdata, test_validate_fail_union_flat_no_discrim);

    validate_test_add("/visitor/input-strict/fail/union-anon",

                       &testdata, test_validate_fail_union_anon);

    g_test_run();

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     BlockDriverState *bs;

     BdrvDirtyBitmap *bitmap;
+
+
+
+    bitmap = block_dirty_bitmap_lookup(node, name, &bs, &aio_context, errp);
+
     if (!bitmap || !bs) {

         return;

void qmp_block_dirty_bitmap_remove(const char *node, const char *name,

                                   Error **errp)

{

    AioContext *aio_context;

    BlockDriverState *bs;

    BdrvDirtyBitmap *bitmap;

    bitmap = block_dirty_bitmap_lookup(node, name, &bs, &aio_context, errp);

    if (!bitmap || !bs) {

        return;

    bdrv_dirty_bitmap_make_anon(bs, bitmap);

    bdrv_release_dirty_bitmap(bs, bitmap);

    aio_context_release(aio_context);


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     VirtIOBlock *s = VIRTIO_BLK(dev);

+
+    remove_migration_state_change_notifier(&s->migration_state_notifier);
+
+    virtio_blk_data_plane_destroy(s->dataplane);
+
     s->dataplane = NULL;

     qemu_del_vm_change_state_handler(s->change);

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

{

    VirtIODevice *vdev = VIRTIO_DEVICE(dev);

    VirtIOBlock *s = VIRTIO_BLK(dev);

    remove_migration_state_change_notifier(&s->migration_state_notifier);

    virtio_blk_data_plane_destroy(s->dataplane);

    s->dataplane = NULL;

    qemu_del_vm_change_state_handler(s->change);

    unregister_savevm(dev, "virtio-blk", s);

    blockdev_mark_auto_del(s->bs);

    virtio_cleanup(vdev);

}


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

     const char *key = "key";

+    const char *str = "string";
+
+
+
+    qdict_put(tests_dict, key, qstring_from_str(str));

START_TEST(qdict_get_try_str_test)

{

    const char *p;

    const char *key = "key";

    const char *str = "string";

    qdict_put(tests_dict, key, qstring_from_str(str));

    p = qdict_get_try_str(tests_dict, key);

    fail_unless(p != NULL);

    fail_unless(strcmp(p, str) == 0);

}


--- a/source.c
+++ b/source.c
@@ -60,11 +60,11 @@
                s1->bitstream_buffer_size);
         memset(s->bitstream_buffer + s->bitstream_buffer_size, 0,
                FF_INPUT_BUFFER_PADDING_SIZE);
+    }
+    // MPEG2/interlacing info
+    memcpy(&s->progressive_sequence, &s1->progressive_sequence,
+           (char *) &s1->rtp_mode - (char *) &s1->progressive_sequence);
+    if (!s1->first_field) {
         s->last_pict_type = s1->pict_type;
         if (s1->current_picture_ptr)
             s->last_lambda_for[s1->pict_type] = s1->current_picture_ptr->f.quality;

int ff_mpeg_update_thread_context(AVCodecContext *dst,
                                  const AVCodecContext *src)
{
    int i;
    MpegEncContext *s = dst->priv_data, *s1 = src->priv_data;
    if (dst == src || !s1->context_initialized)
        return 0;
    // FIXME can parameters change on I-frames?
    // in that case dst may need a reinit
    if (!s->context_initialized) {
        memcpy(s, s1, sizeof(MpegEncContext));
        s->avctx                 = dst;
        s->picture_range_start  += MAX_PICTURE_COUNT;
        s->picture_range_end    += MAX_PICTURE_COUNT;
        s->bitstream_buffer      = NULL;
        s->bitstream_buffer_size = s->allocated_bitstream_buffer_size = 0;
        ff_MPV_common_init(s);
    }
    if (s->height != s1->height || s->width != s1->width || s->context_reinit) {
        int err;
        s->context_reinit = 0;
        s->height = s1->height;
        s->width  = s1->width;
        if ((err = ff_MPV_common_frame_size_change(s)) < 0)
            return err;
    }
    s->avctx->coded_height  = s1->avctx->coded_height;
    s->avctx->coded_width   = s1->avctx->coded_width;
    s->avctx->width         = s1->avctx->width;
    s->avctx->height        = s1->avctx->height;
    s->coded_picture_number = s1->coded_picture_number;
    s->picture_number       = s1->picture_number;
    s->input_picture_number = s1->input_picture_number;
    memcpy(s->picture, s1->picture, s1->picture_count * sizeof(Picture));
    memcpy(&s->last_picture, &s1->last_picture,
           (char *) &s1->last_picture_ptr - (char *) &s1->last_picture);
    s->last_picture_ptr    = REBASE_PICTURE(s1->last_picture_ptr,    s, s1);
    s->current_picture_ptr = REBASE_PICTURE(s1->current_picture_ptr, s, s1);
    s->next_picture_ptr    = REBASE_PICTURE(s1->next_picture_ptr,    s, s1);
    // Error/bug resilience
    s->next_p_frame_damaged = s1->next_p_frame_damaged;
    s->workaround_bugs      = s1->workaround_bugs;
    // MPEG4 timing info
    memcpy(&s->time_increment_bits, &s1->time_increment_bits,
           (char *) &s1->shape - (char *) &s1->time_increment_bits);
    // B-frame info
    s->max_b_frames = s1->max_b_frames;
    s->low_delay    = s1->low_delay;
    s->dropable     = s1->dropable;
    // DivX handling (doesn't work)
    s->divx_packed  = s1->divx_packed;
    if (s1->bitstream_buffer) {
        if (s1->bitstream_buffer_size +
            FF_INPUT_BUFFER_PADDING_SIZE > s->allocated_bitstream_buffer_size)
            av_fast_malloc(&s->bitstream_buffer,
                           &s->allocated_bitstream_buffer_size,
                           s1->allocated_bitstream_buffer_size);
            s->bitstream_buffer_size = s1->bitstream_buffer_size;
        memcpy(s->bitstream_buffer, s1->bitstream_buffer,
               s1->bitstream_buffer_size);
        memset(s->bitstream_buffer + s->bitstream_buffer_size, 0,
               FF_INPUT_BUFFER_PADDING_SIZE);
    }
    // MPEG2/interlacing info
    memcpy(&s->progressive_sequence, &s1->progressive_sequence,
           (char *) &s1->rtp_mode - (char *) &s1->progressive_sequence);
    if (!s1->first_field) {
        s->last_pict_type = s1->pict_type;
        if (s1->current_picture_ptr)
            s->last_lambda_for[s1->pict_type] = s1->current_picture_ptr->f.quality;
        if (s1->pict_type != AV_PICTURE_TYPE_B) {
            s->last_non_b_pict_type = s1->pict_type;
        }
    }
    return 0;
}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
     } else {

         errno = 0;
+
+        /* FIXME This assumes int64_t is long long */
+
+        *result = strtoll(nptr, &ep, base);
+
         err = check_strtox_error(nptr, ep, endptr, errno);

     }

int qemu_strtoi64(const char *nptr, const char **endptr, int base,

                 int64_t *result)

{

    char *ep;

    int err = 0;

    if (!nptr) {

        if (endptr) {

            *endptr = nptr;

        }

        err = -EINVAL;

    } else {

        errno = 0;

        /* FIXME This assumes int64_t is long long */

        *result = strtoll(nptr, &ep, base);

        err = check_strtox_error(nptr, ep, endptr, errno);

    }

    return err;

}


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

     virtio_init(vdev, "virtio-9p", VIRTIO_ID_9P, v->config_size);

+    v->vq = virtio_add_queue(vdev, MAX_REQ, handle_9p_output);
+
+    v9fs_register_transport(s, &virtio_9p_transport);
+
+

 out:

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

{

    VirtIODevice *vdev = VIRTIO_DEVICE(dev);

    V9fsVirtioState *v = VIRTIO_9P(dev);

    V9fsState *s = &v->state;

    if (v9fs_device_realize_common(s, errp)) {

        goto out;

    }

    v->config_size = sizeof(struct virtio_9p_config) + strlen(s->fsconf.tag);

    virtio_init(vdev, "virtio-9p", VIRTIO_ID_9P, v->config_size);

    v->vq = virtio_add_queue(vdev, MAX_REQ, handle_9p_output);

    v9fs_register_transport(s, &virtio_9p_transport);

out:

    return;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     if (replay_mode != REPLAY_MODE_PLAY) {

         /* put the event into the file */
+
+        replay_put_event(EVENT_ASYNC);
+
+        replay_put_byte(checkpoint);
+
         replay_put_byte(event->event_kind);

static void replay_save_event(Event *event, int checkpoint)

{

    if (replay_mode != REPLAY_MODE_PLAY) {

        /* put the event into the file */

        replay_put_event(EVENT_ASYNC);

        replay_put_byte(checkpoint);

        replay_put_byte(event->event_kind);

        /* save event-specific data */

        switch (event->event_kind) {

        default:

            error_report("Unknown ID %d of replay event", read_event_kind);

            exit(1);

            break;

        }

    }

}


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

     memcpy(&fst->codec, codec, sizeof(AVCodecContext));

+
+    stream->streams[stream->nb_streams++] = fst;
+
+    return fst;
+
 }

AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec)

{

    AVStream *fst;

    fst = av_mallocz(sizeof(AVStream));

    if (!fst)

        return NULL;

    fst->priv_data = av_mallocz(sizeof(FeedData));

    memcpy(&fst->codec, codec, sizeof(AVCodecContext));

    stream->streams[stream->nb_streams++] = fst;

    return fst;

}


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

 {

+    assert(req->status != -1);

     scsi_req_ref(req);

void scsi_req_complete(SCSIRequest *req)

{

    assert(req->status != -1);

    scsi_req_ref(req);

    scsi_req_dequeue(req);

    req->bus->ops->complete(req->bus, SCSI_REASON_DONE,

                            req->tag,

                            req->status);

    scsi_req_unref(req);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static inline void gen_ins(DisasContext *s, TCGMemOp ot)
+
 {

     if (s->base.tb->cflags & CF_USE_ICOUNT) {

static inline void gen_ins(DisasContext *s, TCGMemOp ot)

{

    if (s->base.tb->cflags & CF_USE_ICOUNT) {

        gen_io_start();

    }

    gen_string_movl_A0_EDI(s);

    /* Note: we must do this dummy write first to be restartable in

       case of page fault. */

    tcg_gen_movi_tl(cpu_T0, 0);

    gen_op_st_v(s, ot, cpu_T0, cpu_A0);

    tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_regs[R_EDX]);

    tcg_gen_andi_i32(cpu_tmp2_i32, cpu_tmp2_i32, 0xffff);

    gen_helper_in_func(ot, cpu_T0, cpu_tmp2_i32);

    gen_op_st_v(s, ot, cpu_T0, cpu_A0);

    gen_op_movl_T0_Dshift(ot);

    gen_op_add_reg_T0(s->aflag, R_EDI);

    gen_bpt_io(s, cpu_tmp2_i32, ot);

    if (s->base.tb->cflags & CF_USE_ICOUNT) {

        gen_io_end();

    }

}


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

                         aiocb->aio_offset + offset);

+        }
+
+        if (len == -1 && errno == EINTR) {
+
+            continue;

static ssize_t handle_aiocb_rw_linear(RawPosixAIOData *aiocb, char *buf)

{

    ssize_t offset = 0;

    ssize_t len;

    while (offset < aiocb->aio_nbytes) {

        if (aiocb->aio_type & QEMU_AIO_WRITE) {

            len = pwrite(aiocb->aio_fildes,

                         (const char *)buf + offset,

                         aiocb->aio_nbytes - offset,

                         aiocb->aio_offset + offset);

        } else {

            len = pread(aiocb->aio_fildes,

                        buf + offset,

                        aiocb->aio_nbytes - offset,

                        aiocb->aio_offset + offset);

        }

        if (len == -1 && errno == EINTR) {

            continue;

        } else if (len == -1) {

            offset = -errno;

        } else if (len == 0) {

        }

        offset += len;

    }

    return offset;

}


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

                                                    sPAPREnvironment *spapr,

+                                                   uint32_t token,

                                                    uint32_t nargs,
+
                                                    target_ulong args,

                                                    uint32_t nret,
+
+                                                   target_ulong rets)
+
+{

     uint32_t config_addr = rtas_ld(args, 0);
+
     uint64_t buid = ((uint64_t)rtas_ld(args, 1) << 32) | rtas_ld(args, 2);

     unsigned int intr_src_num = -1, ioa_intr_num = rtas_ld(args, 3);

static void rtas_ibm_query_interrupt_source_number(PowerPCCPU *cpu,

                                                   sPAPREnvironment *spapr,

                                                   uint32_t token,

                                                   uint32_t nargs,

                                                   target_ulong args,

                                                   uint32_t nret,

                                                   target_ulong rets)

{

    uint32_t config_addr = rtas_ld(args, 0);

    uint64_t buid = ((uint64_t)rtas_ld(args, 1) << 32) | rtas_ld(args, 2);

    unsigned int intr_src_num = -1, ioa_intr_num = rtas_ld(args, 3);

    int ndev;

    sPAPRPHBState *phb = NULL;

    /* Fins sPAPRPHBState */

    phb = find_phb(spapr, buid);

    if (!phb) {

        rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR);

        return;

    }

    /* Find device descriptor and start IRQ */

    ndev = spapr_msicfg_find(phb, config_addr, false);

    if (ndev < 0) {

        trace_spapr_pci_msi("MSI has not been enabled", -1, config_addr);

        rtas_st(rets, 0, RTAS_OUT_HW_ERROR);

        return;

    }

    intr_src_num = phb->msi_table[ndev].irq + ioa_intr_num;

    trace_spapr_pci_rtas_ibm_query_interrupt_source_number(ioa_intr_num,

                                                           intr_src_num);

    rtas_st(rets, 0, RTAS_OUT_SUCCESS);

    rtas_st(rets, 1, intr_src_num);

    rtas_st(rets, 2, 1);/* 0 == level; 1 == edge */

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)
+
 {

     ff_draw_horiz_band(s->avctx, &s->current_picture.f,

void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)

{

    ff_draw_horiz_band(s->avctx, &s->current_picture.f,

                       &s->last_picture.f, y, h, s->picture_structure,

                       s->first_field, s->low_delay);

}


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

     bdrv_refresh_filename(bs->backing->bs);

+    pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),
+
+            bs->backing->bs->filename);

static void bdrv_mirror_top_refresh_filename(BlockDriverState *bs, QDict *opts)

{

    bdrv_refresh_filename(bs->backing->bs);

    pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),

            bs->backing->bs->filename);


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

 	struct envlist_entry *entry;

+
+
 	assert(envlist != NULL);
+

 	while (envlist->el_entries.lh_first != NULL) {

envlist_free(envlist_t *envlist)

{

	struct envlist_entry *entry;

	assert(envlist != NULL);

	while (envlist->el_entries.lh_first != NULL) {

		entry = envlist->el_entries.lh_first;

		QLIST_REMOVE(entry, ev_link);

		free((char *)entry->ev_var);

		free(entry);

	}

	free(envlist);

}


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

     errno = ENOTSUP;
+
+    return -1;

 }

static int v9fs_synth_lremovexattr(FsContext *ctx,

                                   V9fsPath *path, const char *name)

{

    errno = ENOTSUP;

    return -1;

}


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

+    vnc_read_when(vs, protocol_client_auth_vnc, sizeof(vs->challenge));
+
+    return 0;
+
 }

static int start_auth_vnc(VncState *vs)

{

    make_challenge(vs);

    /* Send client a 'random' challenge */

    vnc_write(vs, vs->challenge, sizeof(vs->challenge));

    vnc_flush(vs);

    vnc_read_when(vs, protocol_client_auth_vnc, sizeof(vs->challenge));

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
         end1 = FFMIN(band_start_tab[j] + ff_ac3_critical_band_size_tab[j], end);

         for (; i < end1; i++) {
+
+            address = av_clip((psd[i] - v) >> 5, 0, 63);
+
+            bap[i] = bap_tab[address];
+
         }

     } while (end > band_start_tab[j++]);

void ff_ac3_bit_alloc_calc_bap(int16_t *mask, int16_t *psd, int start, int end,

                               int snr_offset, int floor,

                               const uint8_t *bap_tab, uint8_t *bap)

{

    int i, j, end1, v, address;

    /* special case, if snr offset is -960, set all bap's to zero */

    if (snr_offset == -960) {

        memset(bap, 0, 256);

        return;

    }

    i = start;

    j = bin_to_band_tab[start];

    do {

        v = (FFMAX(mask[j] - snr_offset - floor, 0) & 0x1FE0) + floor;

        end1 = FFMIN(band_start_tab[j] + ff_ac3_critical_band_size_tab[j], end);

        for (; i < end1; i++) {

            address = av_clip((psd[i] - v) >> 5, 0, 63);

            bap[i] = bap_tab[address];

        }

    } while (end > band_start_tab[j++]);

}


--- a/source.c
+++ b/source.c
@@ -21,9 +21,9 @@
     if (s->mode_8bit)
         msvideo1_decode_8bit(s);
     else
+        msvideo1_decode_16bit(s);
+    if ((ret = av_frame_ref(data, s->frame)) < 0)
+        return ret;
+    *got_frame      = 1;
+    /* report that the buffer was completely consumed */
     return buf_size;

static int msvideo1_decode_frame(AVCodecContext *avctx,
                                void *data, int *got_frame,
                                AVPacket *avpkt)
{
    const uint8_t *buf = avpkt->data;
    int buf_size = avpkt->size;
    Msvideo1Context *s = avctx->priv_data;
    int ret;
    s->buf = buf;
    s->size = buf_size;
    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
        return ret;
    if (s->mode_8bit) {
        int size;
        const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
        if (pal && size == AVPALETTE_SIZE) {
            memcpy(s->pal, pal, AVPALETTE_SIZE);
            s->frame->palette_has_changed = 1;
        } else if (pal) {
            av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size);
    if (s->mode_8bit)
        msvideo1_decode_8bit(s);
    else
        msvideo1_decode_16bit(s);
    if ((ret = av_frame_ref(data, s->frame)) < 0)
        return ret;
    *got_frame      = 1;
    /* report that the buffer was completely consumed */
    return buf_size;


--- a/source.c
+++ b/source.c
@@ -35,11 +35,11 @@
                                    table_data, &fadt->dsdt,

                                    sizeof fadt->dsdt);
+
+
+
+    fadt_setup(fadt, pm);
+

     build_header(linker, table_data,

build_fadt(GArray *table_data, GArray *linker, AcpiPmInfo *pm,

           unsigned facs, unsigned dsdt,

           const char *oem_id, const char *oem_table_id)

{

    AcpiFadtDescriptorRev1 *fadt = acpi_data_push(table_data, sizeof(*fadt));

    fadt->firmware_ctrl = cpu_to_le32(facs);

    /* FACS address to be filled by Guest linker */

    bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE,

                                   ACPI_BUILD_TABLE_FILE,

                                   table_data, &fadt->firmware_ctrl,

                                   sizeof fadt->firmware_ctrl);

    fadt->dsdt = cpu_to_le32(dsdt);

    /* DSDT address to be filled by Guest linker */

    bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE,

                                   ACPI_BUILD_TABLE_FILE,

                                   table_data, &fadt->dsdt,

                                   sizeof fadt->dsdt);

    fadt_setup(fadt, pm);

    build_header(linker, table_data,

                 (void *)fadt, "FACP", sizeof(*fadt), 1, oem_id, oem_table_id);

}


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

+    len = strlen(str);

     readline_set_completion_index(rs, len);

void set_link_completion(ReadLineState *rs, int nb_args, const char *str)

{

    size_t len;

    len = strlen(str);

    readline_set_completion_index(rs, len);

    if (nb_args == 2) {

        NetClientState *ncs[MAX_QUEUE_NUM];

        int count, i;

        count = qemu_find_net_clients_except(NULL, ncs,

                                             NET_CLIENT_OPTIONS_KIND_NONE,

                                             MAX_QUEUE_NUM);

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

            const char *name = ncs[i]->name;

            if (!strncmp(str, name, len)) {

                readline_add_completion(rs, name);

            }

        }

    } else if (nb_args == 3) {

        add_completion_option(rs, str, "on");

        add_completion_option(rs, str, "off");

    }

}


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

     FlushCo flush_co = {

+        .bs = bs,

         .ret = NOT_DONE,

int bdrv_flush(BlockDriverState *bs)

{

    Coroutine *co;

    FlushCo flush_co = {

        .bs = bs,

        .ret = NOT_DONE,

    };

    if (qemu_in_coroutine()) {

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

        bdrv_flush_co_entry(&flush_co);

    } else {

        co = qemu_coroutine_create(bdrv_flush_co_entry, &flush_co);

        qemu_coroutine_enter(co);

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

    }

    return flush_co.ret;

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
             mgr->consumed_ptr++ & mgr->txr_len_mask;

         uint32_t next_ready_page =
+
+            next_ready_ptr / PVSCSI_MAX_NUM_REQ_ENTRIES_PER_PAGE;
+
+        uint32_t inpage_idx =
+
             next_ready_ptr % PVSCSI_MAX_NUM_REQ_ENTRIES_PER_PAGE;

pvscsi_ring_pop_req_descr(PVSCSIRingInfo *mgr)

{

    uint32_t ready_ptr = RS_GET_FIELD(mgr, reqProdIdx);

    if (ready_ptr != mgr->consumed_ptr) {

        uint32_t next_ready_ptr =

            mgr->consumed_ptr++ & mgr->txr_len_mask;

        uint32_t next_ready_page =

            next_ready_ptr / PVSCSI_MAX_NUM_REQ_ENTRIES_PER_PAGE;

        uint32_t inpage_idx =

            next_ready_ptr % PVSCSI_MAX_NUM_REQ_ENTRIES_PER_PAGE;

        return mgr->req_ring_pages_pa[next_ready_page] +

               inpage_idx * sizeof(PVSCSIRingReqDesc);

    } else {

        return 0;

    }

}


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

         return;

+    if (size == 0) {
+
+        /* end of connection */
+
+        net_socket_read_poll(s, false);

         net_socket_write_poll(s, false);

static void net_socket_send_dgram(void *opaque)

{

    NetSocketState *s = opaque;

    int size;

    size = qemu_recv(s->fd, s->buf, sizeof(s->buf), 0);

    if (size < 0)

        return;

    if (size == 0) {

        /* end of connection */

        net_socket_read_poll(s, false);

        net_socket_write_poll(s, false);

        return;

    }

    qemu_send_packet(&s->nc, s->buf, size);

}


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

         output[1][i] += (output[2][i] + output[3][i]);

+    memset(output[2], 0, sizeof(output[2]));
+
+    memset(output[3], 0, sizeof(output[3]));
+
+

 }

static inline void mix_2f_1r_to_mono(AC3DecodeContext *ctx)

{

    int i;

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

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

        output[1][i] += (output[2][i] + output[3][i]);

    memset(output[2], 0, sizeof(output[2]));

    memset(output[3], 0, sizeof(output[3]));

}


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

     tcsetattr (0, TCSANOW, &oldtty);

+}

static void term_exit(void)

{

    tcsetattr (0, TCSANOW, &oldtty);

}


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

+    if (qxl->mode != QXL_MODE_NATIVE && qxl->mode != QXL_MODE_COMPAT) {
+
+        return;
+
+    }

static void qxl_dirty_surfaces(PCIQXLDevice *qxl)

{

    uintptr_t vram_start;

    int i;

    if (qxl->mode != QXL_MODE_NATIVE && qxl->mode != QXL_MODE_COMPAT) {

        return;

    }

    /* dirty the primary surface */

    qxl_set_dirty(&qxl->vga.vram, qxl->shadow_rom.draw_area_offset,

                  qxl->shadow_rom.surface0_area_size);

    vram_start = (uintptr_t)memory_region_get_ram_ptr(&qxl->vram_bar);

    /* dirty the off-screen surfaces */

    for (i = 0; i < qxl->ssd.num_surfaces; i++) {

        QXLSurfaceCmd *cmd;

        intptr_t surface_offset;

        int surface_size;

        if (qxl->guest_surfaces.cmds[i] == 0) {

            continue;

        }

        cmd = qxl_phys2virt(qxl, qxl->guest_surfaces.cmds[i],

                            MEMSLOT_GROUP_GUEST);

        assert(cmd);

        assert(cmd->type == QXL_SURFACE_CMD_CREATE);

        surface_offset = (intptr_t)qxl_phys2virt(qxl,

                                                 cmd->u.surface_create.data,

                                                 MEMSLOT_GROUP_GUEST);

        assert(surface_offset);

        surface_offset -= vram_start;

        surface_size = cmd->u.surface_create.height *

                       abs(cmd->u.surface_create.stride);

        trace_qxl_surfaces_dirty(qxl->id, i, (int)surface_offset, surface_size);

        qxl_set_dirty(&qxl->vram_bar, surface_offset, surface_size);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void build_guest_fsinfo_for_virtual_device(char const *syspath,

                                                   GuestFilesystemInfo *fs,
+
                                                   Error **errp)

 {
@@ -9,20 +9,20 @@
     DIR *dir;

     char *dirpath;
+
     struct dirent entry, *result;
+
+
+
     dirpath = g_strdup_printf("%s/slaves", syspath);
+
     dir = opendir(dirpath);

+    if (!dir) {
+
+        error_setg_errno(errp, errno, "opendir(\"%s\")", dirpath);
+
+        g_free(dirpath);

         return;

static void build_guest_fsinfo_for_virtual_device(char const *syspath,

                                                  GuestFilesystemInfo *fs,

                                                  Error **errp)

{

    DIR *dir;

    char *dirpath;

    struct dirent entry, *result;

    dirpath = g_strdup_printf("%s/slaves", syspath);

    dir = opendir(dirpath);

    if (!dir) {

        error_setg_errno(errp, errno, "opendir(\"%s\")", dirpath);

        g_free(dirpath);

        return;

    }

    g_free(dirpath);

    for (;;) {

        if (readdir_r(dir, &entry, &result) != 0) {

            error_setg_errno(errp, errno, "readdir_r(\"%s\")", dirpath);

            break;

        }

        if (!result) {

            break;

        }

        if (entry.d_type == DT_LNK) {

            g_debug(" slave device '%s'", entry.d_name);

            dirpath = g_strdup_printf("%s/slaves/%s", syspath, entry.d_name);

            build_guest_fsinfo_for_device(dirpath, fs, errp);

            g_free(dirpath);

            if (*errp) {

                break;

            }

        }

    }

    closedir(dir);

}


--- a/source.c
+++ b/source.c
@@ -7,14 +7,14 @@
     ARMCPU *target_cpu;

+
     DPRINTF("cpu %" PRId64 "\n", cpuid);

+
+    /* change to the cpu we are powering up */
+
+    target_cpu_state = arm_get_cpu_by_id(cpuid);

     if (!target_cpu_state) {

int arm_set_cpu_off(uint64_t cpuid)

{

    CPUState *target_cpu_state;

    ARMCPU *target_cpu;

    DPRINTF("cpu %" PRId64 "\n", cpuid);

    /* change to the cpu we are powering up */

    target_cpu_state = arm_get_cpu_by_id(cpuid);

    if (!target_cpu_state) {

        return QEMU_ARM_POWERCTL_INVALID_PARAM;

    }

    target_cpu = ARM_CPU(target_cpu_state);

    if (target_cpu->powered_off) {

        qemu_log_mask(LOG_GUEST_ERROR,

                      "[ARM]%s: CPU %" PRId64 " is already off\n",

                      __func__, cpuid);

        return QEMU_ARM_POWERCTL_IS_OFF;

    }

    target_cpu->powered_off = true;

    target_cpu_state->halted = 1;

    target_cpu_state->exception_index = EXCP_HLT;

    cpu_loop_exit(target_cpu_state);

    /* notreached */

    return QEMU_ARM_POWERCTL_RET_SUCCESS;

}


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

 {

+    CPUPPCState *env = &cpu->env;

     target_ulong flags = args[0];

@@ -19,9 +19,9 @@

     if (!valid_pte_index(env, pte_index)) {
+
         return H_PARAMETER;
+
     }

static target_ulong h_protect(PowerPCCPU *cpu, sPAPRMachineState *spapr,

                              target_ulong opcode, target_ulong *args)

{

    CPUPPCState *env = &cpu->env;

    target_ulong flags = args[0];

    target_ulong pte_index = args[1];

    target_ulong avpn = args[2];

    uint64_t token;

    target_ulong v, r, rb;

    if (!valid_pte_index(env, pte_index)) {

        return H_PARAMETER;

    }

    token = ppc_hash64_start_access(cpu, pte_index);

    v = ppc_hash64_load_hpte0(cpu, token, 0);

    r = ppc_hash64_load_hpte1(cpu, token, 0);

    ppc_hash64_stop_access(token);

    if ((v & HPTE64_V_VALID) == 0 ||

        ((flags & H_AVPN) && (v & ~0x7fULL) != avpn)) {

        return H_NOT_FOUND;

    }

    r &= ~(HPTE64_R_PP0 | HPTE64_R_PP | HPTE64_R_N |

           HPTE64_R_KEY_HI | HPTE64_R_KEY_LO);

    r |= (flags << 55) & HPTE64_R_PP0;

    r |= (flags << 48) & HPTE64_R_KEY_HI;

    r |= flags & (HPTE64_R_PP | HPTE64_R_N | HPTE64_R_KEY_LO);

    rb = compute_tlbie_rb(v, r, pte_index);

    ppc_hash64_store_hpte(cpu, pte_index,

                          (v & ~HPTE64_V_VALID) | HPTE64_V_HPTE_DIRTY, 0);

    ppc_tlb_invalidate_one(env, rb);

    /* Don't need a memory barrier, due to qemu's global lock */

    ppc_hash64_store_hpte(cpu, pte_index, v | HPTE64_V_HPTE_DIRTY, r);

    return H_SUCCESS;

}


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

 {

+    char *cli;

     QDict *resp;

static void test_query_cpus(const void *data)

{

    char *cli;

    QDict *resp;

    QList *cpus;

    const QObject *e;

    cli = make_cli(data, "-smp 8 -numa node,cpus=0-3 -numa node,cpus=4-7");

    qtest_start(cli);

    cpus = get_cpus(&resp);

    g_assert(cpus);

    while ((e = qlist_pop(cpus))) {

        QDict *cpu, *props;

        int64_t cpu_idx, node;

        cpu = qobject_to_qdict(e);

        g_assert(qdict_haskey(cpu, "CPU"));

        g_assert(qdict_haskey(cpu, "props"));

        cpu_idx = qdict_get_int(cpu, "CPU");

        props = qdict_get_qdict(cpu, "props");

        g_assert(qdict_haskey(props, "node-id"));

        node = qdict_get_int(props, "node-id");

        if (cpu_idx >= 0 && cpu_idx < 4) {

            g_assert_cmpint(node, ==, 0);

        } else {

            g_assert_cmpint(node, ==, 1);

        }

    }

    QDECREF(resp);

    qtest_end();

    g_free(cli);

}


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

      */

+
+
+    s = __coverity_alloc_nosize__();
+
+    __coverity_writeall__(s);

     __coverity_mark_as_afm_allocated__(s, AFM_free);

char *g_strconcat(const char *s, ...)

{

    char *s;

    /*

     * Can't model: last argument must be null, the others

     * null-terminated strings

     */

    s = __coverity_alloc_nosize__();

    __coverity_writeall__(s);

    __coverity_mark_as_afm_allocated__(s, AFM_free);

    return s;

}


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

     ByteIOContext *pb = &s->pb;
+
+    uint8_t packet[TS_FEC_PACKET_SIZE];
+
+    int packet_num, len;
+

     ts->stop_parse = 0;

static int handle_packets(AVFormatContext *s, int nb_packets)

{

    MpegTSContext *ts = s->priv_data;

    ByteIOContext *pb = &s->pb;

    uint8_t packet[TS_FEC_PACKET_SIZE];

    int packet_num, len;

    ts->stop_parse = 0;

    packet_num = 0;

    for(;;) {

        if (ts->stop_parse)

            break;

        packet_num++;

        if (nb_packets != 0 && packet_num >= nb_packets)

            break;

        len = get_buffer(pb, packet, ts->raw_packet_size);

        if (len != ts->raw_packet_size)

            return AVERROR_IO;

        /* check paquet sync byte */

        /* XXX: accept to resync ? */

        if (packet[0] != 0x47)

            return AVERROR_INVALIDDATA;

        handle_packet(s, packet);

    }

    return 0;

}


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

     }
+
+
+
+    id = rtas_ld(args, 0);
+
     cpu = qemu_get_cpu(id);

     if (cpu != NULL) {

static void rtas_query_cpu_stopped_state(sPAPREnvironment *spapr,

                                         uint32_t token, uint32_t nargs,

                                         target_ulong args,

                                         uint32_t nret, target_ulong rets)

{

    target_ulong id;

    CPUState *cpu;

    if (nargs != 1 || nret != 2) {

        rtas_st(rets, 0, -3);

        return;

    }

    id = rtas_ld(args, 0);

    cpu = qemu_get_cpu(id);

    if (cpu != NULL) {

        if (cpu->halted) {

            rtas_st(rets, 1, 0);

        } else {

            rtas_st(rets, 1, 2);

        }

        rtas_st(rets, 0, 0);

        return;

    }

    /* Didn't find a matching cpu */

    rtas_st(rets, 0, -3);

}


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

         return 0;

+
+
+    slice_buf_ids =
+
+        av_fast_realloc(vactx->slice_buf_ids,

                         &vactx->slice_buf_ids_alloc,

int ff_vaapi_commit_slices(FFVAContext *vactx)

{

    VABufferID *slice_buf_ids;

    VABufferID slice_param_buf_id, slice_data_buf_id;

    if (vactx->slice_count == 0)

        return 0;

    slice_buf_ids =

        av_fast_realloc(vactx->slice_buf_ids,

                        &vactx->slice_buf_ids_alloc,

                        (vactx->n_slice_buf_ids + 2) * sizeof(slice_buf_ids[0]));

    if (!slice_buf_ids)

        return -1;

    vactx->slice_buf_ids = slice_buf_ids;

    slice_param_buf_id = 0;

    if (vaCreateBuffer(vactx->display, vactx->context_id,

                       VASliceParameterBufferType,

                       vactx->slice_param_size,

                       vactx->slice_count, vactx->slice_params,

                       &slice_param_buf_id) != VA_STATUS_SUCCESS)

        return -1;

    vactx->slice_count = 0;

    slice_data_buf_id = 0;

    if (vaCreateBuffer(vactx->display, vactx->context_id,

                       VASliceDataBufferType,

                       vactx->slice_data_size,

                       1, (void *)vactx->slice_data,

                       &slice_data_buf_id) != VA_STATUS_SUCCESS)

        return -1;

    vactx->slice_data = NULL;

    vactx->slice_data_size = 0;

    slice_buf_ids[vactx->n_slice_buf_ids++] = slice_param_buf_id;

    slice_buf_ids[vactx->n_slice_buf_ids++] = slice_data_buf_id;

    return 0;

}


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

                             src - (stride * 2) +

+                            sizeof(uint8_t), stride, dst, stride, 16);
+
+}

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

                                 ptrdiff_t stride)

{

    avc_luma_hv_qrt_16w_msa(src + stride - 2,

                            src - (stride * 2) +

                            sizeof(uint8_t), stride, dst, stride, 16);

}


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

     //"#!AMR-WB_MC1.0\n" (not supported)

+
+
+    if (p->buf_size < 5)
+
+        return 0;

     if(memcmp(p->buf,AMR_header,5)==0)

static int amr_probe(AVProbeData *p)

{

    //Only check for "#!AMR" which could be amr-wb, amr-nb.

    //This will also trigger multichannel files: "#!AMR_MC1.0\n" and

    //"#!AMR-WB_MC1.0\n" (not supported)

    if (p->buf_size < 5)

        return 0;

    if(memcmp(p->buf,AMR_header,5)==0)

        return AVPROBE_SCORE_MAX;

    else

        return 0;

}


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

     static const int rv30_p_types[6] = { RV34_MB_SKIP, RV34_MB_P_16x16, RV34_MB_P_8x8, -1, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 };

+    static const int rv30_b_types[6] = { RV34_MB_SKIP, RV34_MB_B_DIRECT, RV34_MB_B_FORWARD, RV34_MB_B_BACKWARD, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 };

     MpegEncContext *s = &r->s;

static int rv30_decode_mb_info(RV34DecContext *r)

{

    static const int rv30_p_types[6] = { RV34_MB_SKIP, RV34_MB_P_16x16, RV34_MB_P_8x8, -1, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 };

    static const int rv30_b_types[6] = { RV34_MB_SKIP, RV34_MB_B_DIRECT, RV34_MB_B_FORWARD, RV34_MB_B_BACKWARD, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 };

    MpegEncContext *s = &r->s;

    GetBitContext *gb = &s->gb;

    int code = svq3_get_ue_golomb(gb);

    if(code > 11){

        av_log(s->avctx, AV_LOG_ERROR, "Incorrect MB type code\n");

        return -1;

    }

    if(code > 5){

        av_log(s->avctx, AV_LOG_ERROR, "dquant needed\n");

        code -= 6;

    }

    if(s->pict_type != AV_PICTURE_TYPE_B)

        return rv30_p_types[code];

    else

        return rv30_b_types[code];

}


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

     int i;
+
     s->acfilter_order = get_bits(&s->gb, 4) + 1;

     s->acfilter_scaling = get_bits(&s->gb, 4);

static void decode_ac_filter(WmallDecodeCtx *s)

{

    int i;

    s->acfilter_order = get_bits(&s->gb, 4) + 1;

    s->acfilter_scaling = get_bits(&s->gb, 4);

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

	s->acfilter_coeffs[i] = get_bits(&s->gb, s->acfilter_scaling) + 1;

    }

}


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

     default:

+        break;
+
+    }
+
+    OMAP_BAD_REG(addr);

     return 0;

static uint64_t omap_os_timer_read(void *opaque, target_phys_addr_t addr,

                                   unsigned size)

{

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

    int offset = addr & OMAP_MPUI_REG_MASK;

    if (size != 4) {

        return omap_badwidth_read32(opaque, addr);

    }

    switch (offset) {

    case 0x00:	/* TVR */

        return s->timer.reset_val;

    case 0x04:	/* TCR */

        return omap_timer_read(&s->timer);

    case 0x08:	/* CR */

        return (s->timer.ar << 3) | (s->timer.it_ena << 2) | s->timer.st;

    default:

        break;

    }

    OMAP_BAD_REG(addr);

    return 0;

}


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

                         rtas_ibm_get_system_parameter);

+    spapr_rtas_register(RTAS_IBM_SET_SYSTEM_PARAMETER,
+
+                        "ibm,set-system-parameter",
+
+                        rtas_ibm_set_system_parameter);

static void core_rtas_register_types(void)

{

    spapr_rtas_register(RTAS_DISPLAY_CHARACTER, "display-character",

                        rtas_display_character);

    spapr_rtas_register(RTAS_GET_TIME_OF_DAY, "get-time-of-day",

                        rtas_get_time_of_day);

    spapr_rtas_register(RTAS_SET_TIME_OF_DAY, "set-time-of-day",

                        rtas_set_time_of_day);

    spapr_rtas_register(RTAS_POWER_OFF, "power-off", rtas_power_off);

    spapr_rtas_register(RTAS_SYSTEM_REBOOT, "system-reboot",

                        rtas_system_reboot);

    spapr_rtas_register(RTAS_QUERY_CPU_STOPPED_STATE, "query-cpu-stopped-state",

                        rtas_query_cpu_stopped_state);

    spapr_rtas_register(RTAS_START_CPU, "start-cpu", rtas_start_cpu);

    spapr_rtas_register(RTAS_STOP_SELF, "stop-self", rtas_stop_self);

    spapr_rtas_register(RTAS_IBM_GET_SYSTEM_PARAMETER,

                        "ibm,get-system-parameter",

                        rtas_ibm_get_system_parameter);

    spapr_rtas_register(RTAS_IBM_SET_SYSTEM_PARAMETER,

                        "ibm,set-system-parameter",

                        rtas_ibm_set_system_parameter);

}


--- a/source.c
+++ b/source.c
@@ -4,9 +4,9 @@
     if (lock->writer) {
         lock->writer = false;
         qemu_co_queue_restart_all(&lock->queue);
+    } else {
+        lock->reader--;
+        assert(lock->reader >= 0);
         /* Wakeup only one waiting writer */
         if (!lock->reader) {
             qemu_co_queue_next(&lock->queue);

void qemu_co_rwlock_unlock(CoRwlock *lock)
{
    assert(qemu_in_coroutine());
    if (lock->writer) {
        lock->writer = false;
        qemu_co_queue_restart_all(&lock->queue);
    } else {
        lock->reader--;
        assert(lock->reader >= 0);
        /* Wakeup only one waiting writer */
        if (!lock->reader) {
            qemu_co_queue_next(&lock->queue);
        }
    }
}


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

+    /* The operands are processed from right to left.  */
+
+    src += srclen - 1;
+
+    dest += destlen - 1;

void HELPER(pka)(CPUS390XState *env, uint64_t dest, uint64_t src,

                 uint32_t srclen)

{

    uintptr_t ra = GETPC();

    int i;

    /* The destination operand is always 16 bytes long.  */

    const int destlen = 16;

    /* The operands are processed from right to left.  */

    src += srclen - 1;

    dest += destlen - 1;

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

        uint8_t b = 0;

        /* Start with a positive sign */

        if (i == 0) {

            b = 0xc;

        } else if (srclen > 1) {

            b = cpu_ldub_data_ra(env, src, ra) & 0x0f;

            src--;

            srclen--;

        }

        if (srclen > 1) {

            b |= cpu_ldub_data_ra(env, src, ra) << 4;

            src--;

            srclen--;

        }

        cpu_stb_data_ra(env, dest, b, ra);

        dest--;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int vfio_pci_hot_reset_multi(VFIOPCIDevice *vdev)

 {
+
     return vfio_pci_hot_reset(vdev, false);

 }

static int vfio_pci_hot_reset_multi(VFIOPCIDevice *vdev)

{

    return vfio_pci_hot_reset(vdev, false);

}


--- a/source.c
+++ b/source.c
@@ -10,11 +10,11 @@
         error_report("discard_granularity must be 512 for ide");
     blkconf_serial(&dev->conf, &dev->serial);
     if (kind != IDE_CD) {
+        blkconf_geometry(&dev->conf, &dev->chs_trans, 65536, 16, 255, &err);
+        if (err) {
+            error_report("%s", error_get_pretty(err));
+            error_free(err);
+    if (ide_init_drive(s, dev->conf.blk, kind,
                        dev->version, dev->serial, dev->model, dev->wwn,
                        dev->conf.cyls, dev->conf.heads, dev->conf.secs,
                        dev->chs_trans) < 0) {

static int ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind)
{
    IDEBus *bus = DO_UPCAST(IDEBus, qbus, dev->qdev.parent_bus);
    IDEState *s = bus->ifs + dev->unit;
    Error *err = NULL;
    if (dev->conf.discard_granularity == -1) {
        dev->conf.discard_granularity = 512;
    } else if (dev->conf.discard_granularity &&
               dev->conf.discard_granularity != 512) {
        error_report("discard_granularity must be 512 for ide");
    blkconf_serial(&dev->conf, &dev->serial);
    if (kind != IDE_CD) {
        blkconf_geometry(&dev->conf, &dev->chs_trans, 65536, 16, 255, &err);
        if (err) {
            error_report("%s", error_get_pretty(err));
            error_free(err);
    if (ide_init_drive(s, dev->conf.blk, kind,
                       dev->version, dev->serial, dev->model, dev->wwn,
                       dev->conf.cyls, dev->conf.heads, dev->conf.secs,
                       dev->chs_trans) < 0) {
    if (!dev->version) {
        dev->version = g_strdup(s->version);
    if (!dev->serial) {
        dev->serial = g_strdup(s->drive_serial_str);
    add_boot_device_path(dev->conf.bootindex, &dev->qdev,
                         dev->unit ? "/disk@1" : "/disk@0");
    return 0;


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

 {

+    TCGContext *s = &tcg_ctx;
+
+    TCGTemp *ts;
+
+    int k;

static void tcg_temp_free_internal(int idx)

{

    TCGContext *s = &tcg_ctx;

    TCGTemp *ts;

    int k;

#if defined(CONFIG_DEBUG_TCG)

    s->temps_in_use--;

    if (s->temps_in_use < 0) {

        fprintf(stderr, "More temporaries freed than allocated!\n");

    }

#endif

    assert(idx >= s->nb_globals && idx < s->nb_temps);

    ts = &s->temps[idx];

    assert(ts->temp_allocated != 0);

    ts->temp_allocated = 0;

    k = ts->base_type + (ts->temp_local ? TCG_TYPE_COUNT : 0);

    set_bit(idx, s->free_temps[k].l);

}


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

     writable_mask = reg->emu_mask & ~reg->ro_mask & valid_mask;

+    cfg_entry->data = XEN_PT_MERGE_VALUE(*val, cfg_entry->data, writable_mask);
+
+
+
+    /* create value for writing to I/O device register */

     *val = XEN_PT_MERGE_VALUE(*val, dev_value, throughable_mask);

static int xen_pt_byte_reg_write(XenPCIPassthroughState *s, XenPTReg *cfg_entry,

                                 uint8_t *val, uint8_t dev_value,

                                 uint8_t valid_mask)

{

    XenPTRegInfo *reg = cfg_entry->reg;

    uint8_t writable_mask = 0;

    uint8_t throughable_mask = get_throughable_mask(s, reg, valid_mask);

    /* modify emulate register */

    writable_mask = reg->emu_mask & ~reg->ro_mask & valid_mask;

    cfg_entry->data = XEN_PT_MERGE_VALUE(*val, cfg_entry->data, writable_mask);

    /* create value for writing to I/O device register */

    *val = XEN_PT_MERGE_VALUE(*val, dev_value, throughable_mask);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static inline TCGv gen_ld32(TCGv addr, int index)
+
 {

     TCGv tmp = new_tmp();

static inline TCGv gen_ld32(TCGv addr, int index)

{

    TCGv tmp = new_tmp();

    tcg_gen_qemu_ld32u(tmp, addr, index);

    return tmp;

}


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

     g_assert_cmpint(udnp1->dict1.dict2.userdef1->base->integer, ==,

+                    udnp2->dict1.dict2.userdef1->base->integer);
+
+    g_assert_cmpstr(udnp1->dict1.dict2.userdef1->string, ==,
+
+                    udnp2->dict1.dict2.userdef1->string);

     g_assert_cmpstr(udnp1->dict1.dict2.string2, ==, udnp2->dict1.dict2.string2);

static void nested_struct_compare(UserDefNested *udnp1, UserDefNested *udnp2)

{

    g_assert(udnp1);

    g_assert(udnp2);

    g_assert_cmpstr(udnp1->string0, ==, udnp2->string0);

    g_assert_cmpstr(udnp1->dict1.string1, ==, udnp2->dict1.string1);

    g_assert_cmpint(udnp1->dict1.dict2.userdef1->base->integer, ==,

                    udnp2->dict1.dict2.userdef1->base->integer);

    g_assert_cmpstr(udnp1->dict1.dict2.userdef1->string, ==,

                    udnp2->dict1.dict2.userdef1->string);

    g_assert_cmpstr(udnp1->dict1.dict2.string2, ==, udnp2->dict1.dict2.string2);

    g_assert(udnp1->dict1.has_dict3 == udnp2->dict1.has_dict3);

    g_assert_cmpint(udnp1->dict1.dict3.userdef2->base->integer, ==,

                    udnp2->dict1.dict3.userdef2->base->integer);

    g_assert_cmpstr(udnp1->dict1.dict3.userdef2->string, ==,

                    udnp2->dict1.dict3.userdef2->string);

    g_assert_cmpstr(udnp1->dict1.dict3.string3, ==, udnp2->dict1.dict3.string3);

}


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

     /* Reason: object_unref() hangs */
+
+    dc->cannot_destroy_with_object_finalize_yet = true;
+
 }

static void pci_realview_class_init(ObjectClass *class, void *data)

{

    DeviceClass *dc = DEVICE_CLASS(class);

    /* Reason: object_unref() hangs */

    dc->cannot_destroy_with_object_finalize_yet = true;

}


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

     MemTxAttrs attrs = {};

+    AddressSpace *as;

+

     attrs.secure = is_secure;

static uint32_t arm_ldl_ptw(CPUState *cs, hwaddr addr, bool is_secure,

                            ARMMMUIdx mmu_idx, ARMMMUFaultInfo *fi)

{

    ARMCPU *cpu = ARM_CPU(cs);

    CPUARMState *env = &cpu->env;

    MemTxAttrs attrs = {};

    AddressSpace *as;

    attrs.secure = is_secure;

    as = arm_addressspace(cs, attrs);

    addr = S1_ptw_translate(env, mmu_idx, addr, attrs, fi);

    if (fi->s1ptw) {

        return 0;

    }

    if (regime_translation_big_endian(env, mmu_idx)) {

        return address_space_ldl_be(as, addr, attrs, NULL);

    } else {

        return address_space_ldl_le(as, addr, attrs, NULL);

    }

}


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

         error_report("Failed flush request: %s\n", strerror(-ret));
+
+        exit(EXIT_FAILURE);
+
     }

 }

static void bench_undrained_flush_cb(void *opaque, int ret)

{

    if (ret < 0) {

        error_report("Failed flush request: %s\n", strerror(-ret));

        exit(EXIT_FAILURE);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,1 +1,1 @@
+static void dump_data(const uint8_t *data, int len) {}


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

     S390CPU *cpu = S390_CPU(cs);

+    SigpInfo *si = arg.host_ptr;
+
+
+
+    if (s390_cpu_get_state(cpu) != CPU_STATE_OPERATING) {

         si->cc = SIGP_CC_ORDER_CODE_ACCEPTED;

static void sigp_stop(CPUState *cs, run_on_cpu_data arg)

{

    S390CPU *cpu = S390_CPU(cs);

    SigpInfo *si = arg.host_ptr;

    if (s390_cpu_get_state(cpu) != CPU_STATE_OPERATING) {

        si->cc = SIGP_CC_ORDER_CODE_ACCEPTED;

        return;

    }

    /* disabled wait - sleeping in user space */

    if (cs->halted) {

        s390_cpu_set_state(CPU_STATE_STOPPED, cpu);

    } else {

        /* execute the stop function */

        cpu->env.sigp_order = SIGP_STOP;

        cpu_inject_stop(cpu);

    }

    si->cc = SIGP_CC_ORDER_CODE_ACCEPTED;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static struct pathelem *add_entry(struct pathelem *root, const char *name)

 {
+
+    root->num_entries++;

static struct pathelem *add_entry(struct pathelem *root, const char *name)

{

    root->num_entries++;

    root = realloc(root, sizeof(*root)

                   + sizeof(root->entries[0])*root->num_entries);

    root->entries[root->num_entries-1] = new_entry(root->pathname, root, name);

    root->entries[root->num_entries-1]

        = add_dir_maybe(root->entries[root->num_entries-1]);

    return root;

}


--- a/source.c
+++ b/source.c
@@ -1,29 +1,29 @@
 int qcow2_alloc_clusters_at(BlockDriverState *bs, uint64_t offset,

     int nb_clusters)
+
 {

     BDRVQcowState *s = bs->opaque;

+    uint64_t cluster_index;

+    uint64_t old_free_cluster_index;
+
+    uint64_t i;
+
+    int refcount, ret;
+
+

     assert(nb_clusters >= 0);
+
+    if (nb_clusters == 0) {
+
         return 0;

     }
+

     /* Check how many clusters there are free */

int qcow2_alloc_clusters_at(BlockDriverState *bs, uint64_t offset,

    int nb_clusters)

{

    BDRVQcowState *s = bs->opaque;

    uint64_t cluster_index;

    uint64_t old_free_cluster_index;

    uint64_t i;

    int refcount, ret;

    assert(nb_clusters >= 0);

    if (nb_clusters == 0) {

        return 0;

    }

    /* Check how many clusters there are free */

    cluster_index = offset >> s->cluster_bits;

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

        refcount = get_refcount(bs, cluster_index++);

        if (refcount < 0) {

            return refcount;

        } else if (refcount != 0) {

            break;

        }

    }

    /* And then allocate them */

    old_free_cluster_index = s->free_cluster_index;

    s->free_cluster_index = cluster_index + i;

    ret = update_refcount(bs, offset, i << s->cluster_bits, 1,

                          QCOW2_DISCARD_NEVER);

    if (ret < 0) {

        return ret;

    }

    s->free_cluster_index = old_free_cluster_index;

    return i;

}


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

     char *pr;

+

     qdist_init(&dist);

static void test_none(void)

{

    struct qdist dist;

    char *pr;

    qdist_init(&dist);

    g_assert(isnan(qdist_avg(&dist)));

    g_assert(isnan(qdist_xmin(&dist)));

    g_assert(isnan(qdist_xmax(&dist)));

    pr = qdist_pr_plain(&dist, 0);

    g_assert(pr == NULL);

    pr = qdist_pr_plain(&dist, 2);

    g_assert(pr == NULL);

    qdist_destroy(&dist);

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
 {
     int i, b, c_idx = 0;
     int16_t *dst = (int16_t *)_dst;
+    DiracGolombLUT *future[4], *l = &lut_ctx[2*LUT_SIZE + buf[0]];
+    INIT_RESIDUE(res);
+    for (b = 1; b <= bytes; b++) {
+        future[0] = &lut_ctx[buf[b]];
+        future[1] = future[0] + 1*LUT_SIZE;
         future[2] = future[0] + 2*LUT_SIZE;
         future[3] = future[0] + 3*LUT_SIZE;
         if ((c_idx + 1) > coeffs)

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


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
         case PIX_FMT_RGB565:

         case PIX_FMT_RGB555:
+
+            bits = 16;
+
+                        break;
+
         case PIX_FMT_PAL8:

             bits = 8;

static int avg_bits_per_pixel(int pix_fmt)

{

    int bits;

    const PixFmtInfo *pf;

    pf = &pix_fmt_info[pix_fmt];

    if (pf->is_packed) {

        switch(pix_fmt) {

        case PIX_FMT_RGB24:

        case PIX_FMT_BGR24:

            bits = 24;

            break;

        case PIX_FMT_RGBA32:

            bits = 32;

                        break;

        case PIX_FMT_RGB565:

        case PIX_FMT_RGB555:

            bits = 16;

                        break;

        case PIX_FMT_PAL8:

            bits = 8;

            break;

        default:

            bits = 32;

            break;

        }

    } else {

        bits = pf->depth;

        bits += (2 * pf->depth >>

                 (pf->x_chroma_shift + pf->x_chroma_shift));

    }

    return bits;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int virtio_9p_init_pci(PCIDevice *pci_dev)
+
+{
+
+    VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);

     VirtIODevice *vdev;

static int virtio_9p_init_pci(PCIDevice *pci_dev)

{

    VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);

    VirtIODevice *vdev;

    vdev = virtio_9p_init(&pci_dev->qdev, &proxy->fsconf);

    vdev->nvectors = proxy->nvectors;

    virtio_init_pci(proxy, vdev,

                    PCI_VENDOR_ID_REDHAT_QUMRANET,

                    0x1009,

                    0x2,

                    0x00);

    /* make the actual value visible */

    proxy->nvectors = vdev->nvectors;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
 static av_cold int vcr1_decode_init(AVCodecContext *avctx)
 {
+    avctx->pix_fmt = AV_PIX_FMT_YUV410P;
     return 0;

static av_cold int vcr1_decode_init(AVCodecContext *avctx)
{
    avctx->pix_fmt = AV_PIX_FMT_YUV410P;
    return 0;


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

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

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

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

static char *addr_to_string(const char *format,

                            struct sockaddr_storage *sa,

                            socklen_t salen) {

    char *addr;

    char host[NI_MAXHOST];

    char serv[NI_MAXSERV];

    int err;

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

                           host, sizeof(host),

                           serv, sizeof(serv),

                           NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {

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

                  err, gai_strerror(err));

        return NULL;

    }

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

        return NULL;

    return addr;

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                            unsigned int pid)

 {
+
     struct Program *p = get_program(ts, programid);

     int i;

static void add_pid_to_pmt(MpegTSContext *ts, unsigned int programid,

                           unsigned int pid)

{

    struct Program *p = get_program(ts, programid);

    int i;

    if (!p)

        return;

    if (p->nb_pids >= MAX_PIDS_PER_PROGRAM)

        return;

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

        if (p->pids[i] == pid)

            return;

    p->pids[p->nb_pids++] = pid;

}


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

     if(pm_state->pmen & PWRBTN_EN) {

void qemu_system_powerdown(void)

{

    if(pm_state->pmen & PWRBTN_EN) {

        pm_state->pmsts |= PWRBTN_EN;

	pm_update_sci(pm_state);

    }

}


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

     static int apic_no;

+

     if (apic_no >= MAX_APICS) {

static int apic_init_common(SysBusDevice *dev)

{

    APICCommonState *s = APIC_COMMON(dev);

    APICCommonClass *info;

    static DeviceState *vapic;

    static int apic_no;

    if (apic_no >= MAX_APICS) {

        return -1;

    }

    s->idx = apic_no++;

    info = APIC_COMMON_GET_CLASS(s);

    info->init(s);

    sysbus_init_mmio(dev, &s->io_memory);

    if (!vapic && s->vapic_control & VAPIC_ENABLE_MASK) {

        vapic = sysbus_create_simple("kvmvapic", -1, NULL);

    }

    s->vapic = vapic;

    if (apic_report_tpr_access && info->enable_tpr_reporting) {

        info->enable_tpr_reporting(s, true);

    }

    return 0;

}


void qmp_disable_command(const char *name)

{

    QmpCommand *cmd;

    QTAILQ_FOREACH(cmd, &qmp_commands, node) {

        if (strcmp(cmd->name, name) == 0) {

            cmd->enabled = false;

            return;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void do_cont(int argc, const char **argv)

 {

static void do_cont(int argc, const char **argv)

{

    vm_start();

}


--- a/source.c
+++ b/source.c
@@ -4,7 +4,7 @@
     VRingUsedElem uelem;
     trace_virtqueue_fill(vq, elem, len, idx);
     virtqueue_unmap_sg(vq, elem, len);
+    idx = (idx + vq->used_idx) % vq->vring.num;
+    uelem.id = elem->index;
     uelem.len = len;
     vring_used_write(vq, &uelem, idx);

void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem,
                    unsigned int len, unsigned int idx)
{
    VRingUsedElem uelem;
    trace_virtqueue_fill(vq, elem, len, idx);
    virtqueue_unmap_sg(vq, elem, len);
    idx = (idx + vq->used_idx) % vq->vring.num;
    uelem.id = elem->index;
    uelem.len = len;
    vring_used_write(vq, &uelem, idx);


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

+
+    if ((ret = avio_open_dyn_buf(dyn_cp)) < 0)
+
+        return ret;
+

     if (pb->seekable)

static int start_ebml_master_crc32(AVIOContext *pb, AVIOContext **dyn_cp, ebml_master *master,

                                   unsigned int elementid, uint64_t expectedsize)

{

    int ret;

    if ((ret = avio_open_dyn_buf(dyn_cp)) < 0)

        return ret;

    if (pb->seekable)

        *master = start_ebml_master(pb, elementid, expectedsize);

    else

        *master = start_ebml_master(*dyn_cp, elementid, expectedsize);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int kvm_dirty_pages_log_change(target_phys_addr_t phys_addr, target_phys_addr_t end_addr,

+                                      unsigned flags,

+                                      unsigned mask)

 {

static int kvm_dirty_pages_log_change(target_phys_addr_t phys_addr, target_phys_addr_t end_addr,

                                      unsigned flags,

                                      unsigned mask)

{

    KVMState *s = kvm_state;

    KVMSlot *mem = kvm_lookup_slot(s, phys_addr);

    if (mem == NULL)  {

            dprintf("invalid parameters %llx-%llx\n", phys_addr, end_addr);

            return -EINVAL;

    }

    flags = (mem->flags & ~mask) | flags;

    /* Nothing changed, no need to issue ioctl */

    if (flags == mem->flags)

            return 0;

    mem->flags = flags;

    return kvm_set_user_memory_region(s, mem);

}


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

+{

     uint32_t a, b, d, mask;

void do_brinc (void)

{

    uint32_t a, b, d, mask;

    mask = (uint32_t)(-1UL) >> MASKBITS;

    b = T1_64 & mask;

    a = T0_64 & mask;

    d = word_reverse(1 + word_reverse(a | ~mask));

    T0_64 = (T0_64 & ~mask) | (d & mask);

}


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

     size= ffio_limit(s, size);

+
+
+    ret= av_new_packet(pkt, size);
+
+

     if(ret<0)

int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)

{

    int ret;

    size= ffio_limit(s, size);

    ret= av_new_packet(pkt, size);

    if(ret<0)

        return ret;

    pkt->pos= avio_tell(s);

    ret= avio_read(s, pkt->data, size);

    if(ret<=0)

        av_free_packet(pkt);

    else

        av_shrink_packet(pkt, ret);

    if (pkt->size < orig_size)

        pkt->flags |= AV_PKT_FLAG_CORRUPT;

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 int bdrv_all_goto_snapshot(const char *name, BlockDriverState **first_bad_bs)

+{
+
+    int err = 0;

     BlockDriverState *bs;

int bdrv_all_goto_snapshot(const char *name, BlockDriverState **first_bad_bs)

{

    int err = 0;

    BlockDriverState *bs;

    BdrvNextIterator *it = NULL;

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

        AioContext *ctx = bdrv_get_aio_context(bs);

        aio_context_acquire(ctx);

        if (bdrv_can_snapshot(bs)) {

            err = bdrv_snapshot_goto(bs, name);

        }

        aio_context_release(ctx);

    }

    *first_bad_bs = bs;

    return err;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+void run_on_cpu(CPUState *env, void (*func)(void *data), void *data)
+
 {

     func(data);

void run_on_cpu(CPUState *env, void (*func)(void *data), void *data)

{

    func(data);

}


--- a/source.c
+++ b/source.c
@@ -29,11 +29,11 @@
         /* Try to find a BAT */

         if (env->nb_BATs != 0) {
+
+            ret = ppc_hash32_get_bat(env, ctx, eaddr, rw, access_type);
+
+        }
+
         if (ret < 0) {

             /* We didn't match any BAT entry or don't have BATs */

static int ppc_hash32_get_physical_address(CPUPPCState *env, struct mmu_ctx_hash32 *ctx,

                                           target_ulong eaddr, int rw,

                                           int access_type)

{

    bool real_mode = (access_type == ACCESS_CODE && msr_ir == 0)

        || (access_type != ACCESS_CODE && msr_dr == 0);

    if (real_mode) {

        ctx->raddr = eaddr;

        ctx->prot = PAGE_READ | PAGE_EXEC | PAGE_WRITE;

        return 0;

    } else {

        int ret = -1;

        /* Try to find a BAT */

        if (env->nb_BATs != 0) {

            ret = ppc_hash32_get_bat(env, ctx, eaddr, rw, access_type);

        }

        if (ret < 0) {

            /* We didn't match any BAT entry or don't have BATs */

            ret = get_segment32(env, ctx, eaddr, rw, access_type);

        }

        return ret;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 I2CBus *aux_get_i2c_bus(AUXBus *bus)
+
 {

     return aux_bridge_get_i2c_bus(bus->bridge);

I2CBus *aux_get_i2c_bus(AUXBus *bus)

{

    return aux_bridge_get_i2c_bus(bus->bridge);

}


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

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

     unlock_user_struct(frame, frame_addr, 0);

static long do_sigreturn_v2(CPUARMState *env)

{

    abi_ulong frame_addr;

    struct sigframe_v2 *frame = NULL;

    /*

     * Since we stacked the signal on a 64-bit boundary,

     * then 'sp' should be word aligned here.  If it's

     * not, then the user is trying to mess with us.

     */

    frame_addr = env->regs[13];

    trace_user_do_sigreturn(env, frame_addr);

    if (frame_addr & 7) {

        goto badframe;

    }

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

        goto badframe;

    }

    if (do_sigframe_return_v2(env, frame_addr, &frame->uc)) {

        goto badframe;

    }

    unlock_user_struct(frame, frame_addr, 0);

    return env->regs[0];

badframe:

    unlock_user_struct(frame, frame_addr, 0);

    force_sig(TARGET_SIGSEGV /* , current */);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void virtio_queue_guest_notifier_read(EventNotifier *n)

 {
+
     VirtQueue *vq = container_of(n, VirtQueue, guest_notifier);

     if (event_notifier_test_and_clear(n)) {

static void virtio_queue_guest_notifier_read(EventNotifier *n)

{

    VirtQueue *vq = container_of(n, VirtQueue, guest_notifier);

    if (event_notifier_test_and_clear(n)) {

        virtio_irq(vq);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void vc1_sprite_flush(AVCodecContext *avctx)

 {
+
     VC1Context *v     = avctx->priv_data;

     MpegEncContext *s = &v->s;

static void vc1_sprite_flush(AVCodecContext *avctx)

{

    VC1Context *v     = avctx->priv_data;

    MpegEncContext *s = &v->s;

    AVFrame *f = &s->current_picture.f;

    int plane, i;

    /* Windows Media Image codecs have a convergence interval of two keyframes.

       Since we can't enforce it, clear to black the missing sprite. This is

       wrong but it looks better than doing nothing. */

    if (f->data[0])

        for (plane = 0; plane < (s->flags&CODEC_FLAG_GRAY ? 1 : 3); plane++)

            for (i = 0; i < v->sprite_height>>!!plane; i++)

                memset(f->data[plane] + i * f->linesize[plane],

                       plane ? 128 : 0, f->linesize[plane]);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 bool gs_allowed(void)

 {
+
+    if (kvm_enabled()) {
+
+        MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
+
         if (object_class_dynamic_cast(OBJECT_CLASS(mc),

                                       TYPE_S390_CCW_MACHINE)) {

bool gs_allowed(void)

{

    if (kvm_enabled()) {

        MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());

        if (object_class_dynamic_cast(OBJECT_CLASS(mc),

                                      TYPE_S390_CCW_MACHINE)) {

            S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);

            return s390mc->gs_allowed;

        }

        /* Make sure the "none" machine can have gs */

        return true;

    }

    return false;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void bt_dummy_lmp_acl_resp(struct bt_link_s *link,
+
+                const uint8_t *data, int start, int len)

 {

static void bt_dummy_lmp_acl_resp(struct bt_link_s *link,

                const uint8_t *data, int start, int len)

{

    fprintf(stderr, "%s: stray ACL response PDU, fixme\n", __FUNCTION__);

    exit(-1);

}


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

         return -1;

+    }
+
+
+
+    object_property_add_child(container_get(object_get_root(), "/objects"),

                               id, obj, NULL);

static int object_create(QemuOpts *opts, void *opaque)

{

    const char *type = qemu_opt_get(opts, "qom-type");

    const char *id = qemu_opts_id(opts);

    Object *obj;

    g_assert(type != NULL);

    if (id == NULL) {

        qerror_report(QERR_MISSING_PARAMETER, "id");

        return -1;

    }

    obj = object_new(type);

    if (qemu_opt_foreach(opts, object_set_property, obj, 1) < 0) {

        return -1;

    }

    object_property_add_child(container_get(object_get_root(), "/objects"),

                              id, obj, NULL);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void qemu_mutex_destroy(QemuMutex *mutex)
+
+{

     assert(mutex->owner == 0);

void qemu_mutex_destroy(QemuMutex *mutex)

{

    assert(mutex->owner == 0);

    DeleteCriticalSection(&mutex->lock);

}