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

     int64_t ret;

+    QemuOpts *opts;
+
+    Error *local_err = NULL;
+
+

     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);

static int nfs_file_open(BlockDriverState *bs, QDict *options, int flags,

                         Error **errp) {

    NFSClient *client = bs->opaque;

    int64_t ret;

    QemuOpts *opts;

    Error *local_err = NULL;

    opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);

    qemu_opts_absorb_qdict(opts, options, &local_err);

    if (error_is_set(&local_err)) {

        error_propagate(errp, local_err);

        return -EINVAL;

    }

    ret = nfs_client_open(client, qemu_opt_get(opts, "filename"),

                          (flags & BDRV_O_RDWR) ? O_RDWR : O_RDONLY,

                          errp);

    if (ret < 0) {

        return ret;

    }

    bs->total_sectors = ret;

    return 0;

}


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

     c->dsp.resample_one[FNIDX(S16P)] = (resample_one_fn) resample_one_int16;

+    c->dsp.resample_one[FNIDX(S32P)] = (resample_one_fn) resample_one_int32;
+
+    c->dsp.resample_one[FNIDX(FLTP)] = (resample_one_fn) resample_one_float;
+
+    c->dsp.resample_one[FNIDX(DBLP)] = (resample_one_fn) resample_one_double;

void swri_resample_dsp_init(ResampleContext *c)

{

#define FNIDX(fmt) (AV_SAMPLE_FMT_##fmt - AV_SAMPLE_FMT_S16P)

    c->dsp.resample_one[FNIDX(S16P)] = (resample_one_fn) resample_one_int16;

    c->dsp.resample_one[FNIDX(S32P)] = (resample_one_fn) resample_one_int32;

    c->dsp.resample_one[FNIDX(FLTP)] = (resample_one_fn) resample_one_float;

    c->dsp.resample_one[FNIDX(DBLP)] = (resample_one_fn) resample_one_double;

    c->dsp.resample_common[FNIDX(S16P)] = (resample_fn) resample_common_int16;

    c->dsp.resample_common[FNIDX(S32P)] = (resample_fn) resample_common_int32;

    c->dsp.resample_common[FNIDX(FLTP)] = (resample_fn) resample_common_float;

    c->dsp.resample_common[FNIDX(DBLP)] = (resample_fn) resample_common_double;

    c->dsp.resample_linear[FNIDX(S16P)] = (resample_fn) resample_linear_int16;

    c->dsp.resample_linear[FNIDX(S32P)] = (resample_fn) resample_linear_int32;

    c->dsp.resample_linear[FNIDX(FLTP)] = (resample_fn) resample_linear_float;

    c->dsp.resample_linear[FNIDX(DBLP)] = (resample_fn) resample_linear_double;

    if (ARCH_X86) swri_resample_dsp_x86_init(c);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 vu_queue_empty(VuDev *dev, VuVirtq *vq)

+{

     if (vq->shadow_avail_idx != vq->last_avail_idx) {

vu_queue_empty(VuDev *dev, VuVirtq *vq)

{

    if (vq->shadow_avail_idx != vq->last_avail_idx) {

        return 0;

    }

    return vring_avail_idx(vq) == vq->last_avail_idx;

}


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

 end:

+    av_frame_free(&src_buffer);
+
+    return ret;
+
+}

static int filter_frame(AVFilterLink *inlink, AVFrame *src_buffer)

{

    AVFilterContext  *ctx = inlink->dst;

    ATempoContext *atempo = ctx->priv;

    AVFilterLink *outlink = ctx->outputs[0];

    int ret = 0;

    int n_in = src_buffer->nb_samples;

    int n_out = (int)(0.5 + ((double)n_in) / atempo->tempo);

    const uint8_t *src = src_buffer->data[0];

    const uint8_t *src_end = src + n_in * atempo->stride;

    while (src < src_end) {

        if (!atempo->dst_buffer) {

            atempo->dst_buffer = ff_get_audio_buffer(outlink, n_out);

            av_frame_copy_props(atempo->dst_buffer, src_buffer);

            atempo->dst = atempo->dst_buffer->data[0];

            atempo->dst_end = atempo->dst + n_out * atempo->stride;

        }

        yae_apply(atempo, &src, src_end, &atempo->dst, atempo->dst_end);

        if (atempo->dst == atempo->dst_end) {

            ret = push_samples(atempo, outlink, n_out);

            if (ret < 0)

                goto end;

            atempo->request_fulfilled = 1;

        }

    }

    atempo->nsamples_in += n_in;

end:

    av_frame_free(&src_buffer);

    return ret;

}


int check_params(char *buf, int buf_size,

                 const char * const *params, const char *str)

{

    const char *p;

    int i;

    p = str;

    while (*p != '\0') {

        p = get_opt_name(buf, buf_size, p, '=');

        if (*p != '=') {

            return -1;

        }

        p++;

        for (i = 0; params[i] != NULL; i++) {

            if (!strcmp(params[i], buf)) {

                break;

            }

        }

        if (params[i] == NULL) {

            return -1;

        }

        p = get_opt_value(NULL, 0, p);

        if (*p != ',') {

            break;

        }

        p++;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -3,10 +3,10 @@
                                  uint64_t val, unsigned size)

 {
+
+#ifdef DEBUG_UNASSIGNED
+
+    printf("Unassigned mem write " TARGET_FMT_plx " = 0x%"PRIx64"\n", addr, val);

 #endif

static void unassigned_mem_write(void *opaque, hwaddr addr,

                                 uint64_t val, unsigned size)

{

#ifdef DEBUG_UNASSIGNED

    printf("Unassigned mem write " TARGET_FMT_plx " = 0x%"PRIx64"\n", addr, val);

#endif

#if defined(TARGET_ALPHA) || defined(TARGET_SPARC) || defined(TARGET_MICROBLAZE)

    cpu_unassigned_access(cpu_single_env, addr, 1, 0, 0, size);

#endif

}


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

     if (req1->sector > req2->sector) {
+
+        return 1;
+
+    } else if (req1->sector < req2->sector) {
+
         return -1;

     } else {

static int multiwrite_req_compare(const void *a, const void *b)

{

    const BlockRequest *req1 = a, *req2 = b;

    /*

     * Note that we can't simply subtract req2->sector from req1->sector

     * here as that could overflow the return value.

     */

    if (req1->sector > req2->sector) {

        return 1;

    } else if (req1->sector < req2->sector) {

        return -1;

    } else {

        return 0;

    }

}


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

 {

+    int64_t intnum=1;

     double num=1;

AVRational av_get_q(void *obj, const char *name, const AVOption **o_out)

{

    int64_t intnum=1;

    double num=1;

    int den=1;

    av_get_number(obj, name, o_out, &num, &den, &intnum);

    if (num == 1.0 && (int)intnum == intnum)

        return (AVRational){intnum, den};

    else

        return av_d2q(num*intnum/den, 1<<24);

}


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

     size_t elf_note_size = 0;

+    int note_head_size;

     const NoteFuncDesc *nf;

ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)

{

    int name_size = 8; /* "CORE" or "QEMU" rounded */

    size_t elf_note_size = 0;

    int note_head_size;

    const NoteFuncDesc *nf;

    assert(class == ELFCLASS64);

    assert(machine == EM_S390);

    note_head_size = sizeof(Elf64_Nhdr);

    for (nf = note_func; nf->note_contents_func; nf++) {

        elf_note_size = elf_note_size + note_head_size + name_size +

                        nf->contents_size;

    }

    return (elf_note_size) * nr_cpus;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     USBSerialState *s = DO_UPCAST(USBSerialState, dev, dev);

+
+    usb_desc_create_serial(dev);
+
+    usb_desc_init(dev);
+
     dev->auto_attach = 0;

static void usb_serial_realize(USBDevice *dev, Error **errp)

{

    USBSerialState *s = DO_UPCAST(USBSerialState, dev, dev);

    usb_desc_create_serial(dev);

    usb_desc_init(dev);

    dev->auto_attach = 0;

    if (!s->cs) {

        error_setg(errp, "Property chardev is required");

        return;

    }

    qemu_chr_add_handlers(s->cs, usb_serial_can_read, usb_serial_read,

                          usb_serial_event, s);

    usb_serial_handle_reset(dev);

    if (s->cs->be_open && !dev->attached) {

        usb_device_attach(dev, errp);

    }

}


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

         if (tos->h && consume && ret) {

+            bool removed = g_hash_table_remove(tos->h, name);
+
+            assert(removed);
+
+        }

     } else {

static QObject *qmp_input_get_object(QmpInputVisitor *qiv,

                                     const char *name,

                                     bool consume)

{

    StackObject *tos;

    QObject *qobj;

    QObject *ret;

    if (!qiv->nb_stack) {

        /* Starting at root, name is ignored. */

        return qiv->root;

    }

    /* We are in a container; find the next element. */

    tos = &qiv->stack[qiv->nb_stack - 1];

    qobj = tos->obj;

    assert(qobj);

    if (qobject_type(qobj) == QTYPE_QDICT) {

        assert(name);

        ret = qdict_get(qobject_to_qdict(qobj), name);

        if (tos->h && consume && ret) {

            bool removed = g_hash_table_remove(tos->h, name);

            assert(removed);

        }

    } else {

        assert(qobject_type(qobj) == QTYPE_QLIST);

        assert(!name);

        ret = qlist_entry_obj(tos->entry);

        if (consume) {

            tos->entry = qlist_next(tos->entry);

        }

    }

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+void migration_set_incoming_channel(MigrationState *s,
+
+                                    QIOChannel *ioc)

 {

void migration_set_incoming_channel(MigrationState *s,

                                    QIOChannel *ioc)

{

    QEMUFile *f = qemu_fopen_channel_input(ioc);

    process_incoming_migration(f);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 target_ulong helper_rdhwr_synci_step(CPUMIPSState *env)
+
 {

     check_hwrena(env, 1);

target_ulong helper_rdhwr_synci_step(CPUMIPSState *env)

{

    check_hwrena(env, 1);

    return env->SYNCI_Step;

}


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

     DPRINTF("putting %d bytes at %" PRId64 "\n", size, pos);

+
+
+    if (size <= 0) {
+
+        return size;

     }

static int migration_put_buffer(void *opaque, const uint8_t *buf,

                               int64_t pos, int size)

{

    MigrationState *s = opaque;

    int ret;

    DPRINTF("putting %d bytes at %" PRId64 "\n", size, pos);

    if (size <= 0) {

        return size;

    }

    qemu_put_buffer(s->migration_file, buf, size);

    ret = qemu_file_get_error(s->migration_file);

    if (ret) {

        return ret;

    }

    s->bytes_xfer += size;

    return size;

}


--- a/source.c
+++ b/source.c
@@ -29,9 +29,9 @@
         aio_poll(block_job_get_aio_context(job), true);

     }
+
+
+
+    block_job_unref(job);
+
 }

static void block_job_detach_aio_context(void *opaque)

{

    BlockJob *job = opaque;

    /* In case the job terminates during aio_poll()... */

    block_job_ref(job);

    block_job_pause(job);

    if (!job->paused) {

        /* If job is !job->busy this kicks it into the next pause point. */

        block_job_enter(job);

    }

    while (!job->paused && !job->completed) {

        aio_poll(block_job_get_aio_context(job), true);

    }

    block_job_unref(job);

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
                       const uint16_t *abuf1, uint8_t *dest, int dstW,

                       int yalpha, int uvalpha, int y,
+
+                      enum PixelFormat target)
+
+{
+
     const uint8_t * const d128 = dither_8x8_220[y & 7];

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

yuv2mono_2_c_template(SwsContext *c, const uint16_t *buf0,

                      const uint16_t *buf1, const uint16_t *ubuf0,

                      const uint16_t *ubuf1, const uint16_t *vbuf0,

                      const uint16_t *vbuf1, const uint16_t *abuf0,

                      const uint16_t *abuf1, uint8_t *dest, int dstW,

                      int yalpha, int uvalpha, int y,

                      enum PixelFormat target)

{

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

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

    int  yalpha1 = 4095 - yalpha;

    int i;

    for (i = 0; i < dstW - 7; i += 8) {

        int acc =    g[((buf0[i    ] * yalpha1 + buf1[i    ] * yalpha) >> 19) + d128[0]];

        acc += acc + g[((buf0[i + 1] * yalpha1 + buf1[i + 1] * yalpha) >> 19) + d128[1]];

        acc += acc + g[((buf0[i + 2] * yalpha1 + buf1[i + 2] * yalpha) >> 19) + d128[2]];

        acc += acc + g[((buf0[i + 3] * yalpha1 + buf1[i + 3] * yalpha) >> 19) + d128[3]];

        acc += acc + g[((buf0[i + 4] * yalpha1 + buf1[i + 4] * yalpha) >> 19) + d128[4]];

        acc += acc + g[((buf0[i + 5] * yalpha1 + buf1[i + 5] * yalpha) >> 19) + d128[5]];

        acc += acc + g[((buf0[i + 6] * yalpha1 + buf1[i + 6] * yalpha) >> 19) + d128[6]];

        acc += acc + g[((buf0[i + 7] * yalpha1 + buf1[i + 7] * yalpha) >> 19) + d128[7]];

        output_pixel(*dest++, acc);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
+cpu_mips_check_sign_extensions (CPUMIPSState *env, FILE *f,
+
+                                fprintf_function cpu_fprintf,
+
+                                int flags)
+
+{
+
     int i;
+
+

     if (!SIGN_EXT_P(env->active_tc.PC))

cpu_mips_check_sign_extensions (CPUMIPSState *env, FILE *f,

                                fprintf_function cpu_fprintf,

                                int flags)

{

    int i;

    if (!SIGN_EXT_P(env->active_tc.PC))

        cpu_fprintf(f, "BROKEN: pc=0x" TARGET_FMT_lx "\n", env->active_tc.PC);

    if (!SIGN_EXT_P(env->active_tc.HI[0]))

        cpu_fprintf(f, "BROKEN: HI=0x" TARGET_FMT_lx "\n", env->active_tc.HI[0]);

    if (!SIGN_EXT_P(env->active_tc.LO[0]))

        cpu_fprintf(f, "BROKEN: LO=0x" TARGET_FMT_lx "\n", env->active_tc.LO[0]);

    if (!SIGN_EXT_P(env->btarget))

        cpu_fprintf(f, "BROKEN: btarget=0x" TARGET_FMT_lx "\n", env->btarget);

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

        if (!SIGN_EXT_P(env->active_tc.gpr[i]))

            cpu_fprintf(f, "BROKEN: %s=0x" TARGET_FMT_lx "\n", regnames[i], env->active_tc.gpr[i]);

    }

    if (!SIGN_EXT_P(env->CP0_EPC))

        cpu_fprintf(f, "BROKEN: EPC=0x" TARGET_FMT_lx "\n", env->CP0_EPC);

    if (!SIGN_EXT_P(env->lladdr))

        cpu_fprintf(f, "BROKEN: LLAddr=0x" TARGET_FMT_lx "\n", env->lladdr);

}


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

     CopyFromBackingFileCB *copy_cb;

+

     /* Skip copy entirely if there is no work to do */

static void qed_copy_from_backing_file(BDRVQEDState *s, uint64_t pos,

                                       uint64_t len, uint64_t offset,

                                       BlockDriverCompletionFunc *cb,

                                       void *opaque)

{

    CopyFromBackingFileCB *copy_cb;

    /* Skip copy entirely if there is no work to do */

    if (len == 0) {

        cb(opaque, 0);

        return;

    }

    copy_cb = gencb_alloc(sizeof(*copy_cb), cb, opaque);

    copy_cb->s = s;

    copy_cb->offset = offset;

    copy_cb->iov.iov_base = qemu_blockalign(s->bs, len);

    copy_cb->iov.iov_len = len;

    qemu_iovec_init_external(&copy_cb->qiov, &copy_cb->iov, 1);

    qed_read_backing_file(s, pos, &copy_cb->qiov,

                          qed_copy_from_backing_file_write, copy_cb);

}


--- a/source.c
+++ b/source.c
@@ -5,12 +5,12 @@
     DWTELEM *b0= cs->b0;

     DWTELEM *b1= cs->b1;
+
+    DWTELEM *b2= buffer + mirror(y+1, height-1)*stride;

     DWTELEM *b3= buffer + mirror(y+2, height-1)*stride;
+
+

 {START_TIMER

static void spatial_compose53i_dy(dwt_compose_t *cs, DWTELEM *buffer, int width, int height, int stride){

    int y= cs->y;

    DWTELEM *b0= cs->b0;

    DWTELEM *b1= cs->b1;

    DWTELEM *b2= buffer + mirror(y+1, height-1)*stride;

    DWTELEM *b3= buffer + mirror(y+2, height-1)*stride;

{START_TIMER

        if(b1 <= b3) vertical_compose53iL0(b1, b2, b3, width);

        if(b0 <= b2) vertical_compose53iH0(b0, b1, b2, width);

STOP_TIMER("vertical_compose53i*")}

{START_TIMER

        if(y-1 >= 0) horizontal_compose53i(b0, width);

        if(b0 <= b2) horizontal_compose53i(b1, width);

STOP_TIMER("horizontal_compose53i")}

    cs->b0 = b2;

    cs->b1 = b3;

    cs->y += 2;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static bool pmsav7_rgnr_vmstate_validate(void *opaque, int version_id)

+{
+
     ARMCPU *cpu = opaque;

static bool pmsav7_rgnr_vmstate_validate(void *opaque, int version_id)

{

    ARMCPU *cpu = opaque;

    return cpu->env.pmsav7.rnr < cpu->pmsav7_dregion;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int decode_phys_chunk(AVCodecContext *avctx, PNGDecContext *s)
+
 {

     if (s->state & PNG_IDAT) {

static int decode_phys_chunk(AVCodecContext *avctx, PNGDecContext *s)

{

    if (s->state & PNG_IDAT) {

        av_log(avctx, AV_LOG_ERROR, "pHYs after IDAT\n");

        return AVERROR_INVALIDDATA;

    }

    avctx->sample_aspect_ratio.num = bytestream2_get_be32(&s->gb);

    avctx->sample_aspect_ratio.den = bytestream2_get_be32(&s->gb);

    if (avctx->sample_aspect_ratio.num < 0 || avctx->sample_aspect_ratio.den < 0)

        avctx->sample_aspect_ratio = (AVRational){ 0, 1 };

    bytestream2_skip(&s->gb, 1); /* unit specifier */

    bytestream2_skip(&s->gb, 4); /* crc */

    return 0;

}


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

     env->asi = 0x82; // Primary no-fault

+#endif
+
+#else
+
+    env->psret = 0;

     env->psrs = 1;

void cpu_reset(CPUSPARCState *env)

{

    tlb_flush(env, 1);

    env->cwp = 0;

    env->wim = 1;

    env->regwptr = env->regbase + (env->cwp * 16);

#if defined(CONFIG_USER_ONLY)

    env->user_mode_only = 1;

#ifdef TARGET_SPARC64

    env->cleanwin = env->nwindows - 2;

    env->cansave = env->nwindows - 2;

    env->pstate = PS_RMO | PS_PEF | PS_IE;

    env->asi = 0x82; // Primary no-fault

#endif

#else

    env->psret = 0;

    env->psrs = 1;

    env->psrps = 1;

#ifdef TARGET_SPARC64

    env->pstate = PS_PRIV;

    env->hpstate = HS_PRIV;

    env->pc = 0x1fff0000020ULL; // XXX should be different for system_reset

    env->tsptr = &env->ts[env->tl];

#else

    env->pc = 0;

    env->mmuregs[0] &= ~(MMU_E | MMU_NF);

    env->mmuregs[0] |= env->mmu_bm;

#endif

    env->npc = env->pc + 4;

#endif

}


void op_dmfc0_ebase (void)

{

    T0 = env->CP0_EBase;

    RETURN();

}


--- a/source.c
+++ b/source.c
@@ -39,11 +39,11 @@
                     q->quantized_coeffs[ch][i][j + k] = (level + ((k*diff) / run));

+
+                level += diff;
+
+                j += run;
+
             }

         }

static void process_subpacket_9 (QDM2Context *q, QDM2SubPNode *node)

{

    GetBitContext gb;

    int i, j, k, n, ch, run, level, diff;

    init_get_bits(&gb, node->packet->data, node->packet->size*8);

    n = coeff_per_sb_for_avg[q->coeff_per_sb_select][QDM2_SB_USED(q->sub_sampling) - 1] + 1; // same as averagesomething function

    for (i = 1; i < n; i++)

        for (ch=0; ch < q->nb_channels; ch++) {

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

            q->quantized_coeffs[ch][i][0] = level;

            for (j = 0; j < (8 - 1); ) {

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

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

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

                    q->quantized_coeffs[ch][i][j + k] = (level + ((k*diff) / run));

                level += diff;

                j += run;

            }

        }

    for (ch = 0; ch < q->nb_channels; ch++)

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

            q->quantized_coeffs[ch][0][i] = 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void xscale_cpar_write(CPUARMState *env, const ARMCPRegInfo *ri,
+
+                              uint64_t value)
+
+{

     value &= 0x3fff;

static void xscale_cpar_write(CPUARMState *env, const ARMCPRegInfo *ri,

                              uint64_t value)

{

    value &= 0x3fff;

    if (env->cp15.c15_cpar != value) {

        /* Changes cp0 to cp13 behavior, so needs a TB flush.  */

        tb_flush(env);

        env->cp15.c15_cpar = value;

    }

}


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

     s = g_malloc0(sizeof(SerialState));

+
+
+    s->it_shift = it_shift;
+
+    s->irq = irq;

     s->baudbase = baudbase;

SerialState *serial_mm_init(MemoryRegion *address_space,

                            hwaddr base, int it_shift,

                            qemu_irq irq, int baudbase,

                            CharDriverState *chr, enum device_endian end)

{

    SerialState *s;

    Error *err = NULL;

    s = g_malloc0(sizeof(SerialState));

    s->it_shift = it_shift;

    s->irq = irq;

    s->baudbase = baudbase;

    s->chr = chr;

    serial_realize_core(s, &err);

    if (err != NULL) {

        error_report("%s", error_get_pretty(err));

        error_free(err);

        exit(1);

    }

    vmstate_register(NULL, base, &vmstate_serial, s);

    memory_region_init_io(&s->io, NULL, &serial_mm_ops[end], s,

                          "serial", 8 << it_shift);

    memory_region_add_subregion(address_space, base, &s->io);

    serial_update_msl(s);

    return s;

}


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

 {

+    PutBitContext pb;

     int buf_pos, len;

static int write_header(FlashSV2Context * s, uint8_t * buf, int buf_size)

{

    PutBitContext pb;

    int buf_pos, len;

    if (buf_size < 5)

        return -1;

    init_put_bits(&pb, buf, buf_size * 8);

    put_bits(&pb, 4, (s->block_width  >> 4) - 1);

    put_bits(&pb, 12, s->image_width);

    put_bits(&pb, 4, (s->block_height >> 4) - 1);

    put_bits(&pb, 12, s->image_height);

    flush_put_bits(&pb);

    buf_pos = 4;

    buf[buf_pos++] = s->flags;

    if (s->flags & HAS_PALLET_INFO) {

        len = write_palette(s, buf + buf_pos, buf_size - buf_pos);

        if (len < 0)

            return -1;

        buf_pos += len;

    }

    return buf_pos;

}


--- a/source.c
+++ b/source.c
@@ -1,32 +1,32 @@
+iscsi_readcapacity10_cb(struct iscsi_context *iscsi, int status,
+
+                        void *command_data, void *opaque)
+
+{
+
+    struct IscsiTask *itask = opaque;
+
+    struct scsi_readcapacity10 *rc10;

     struct scsi_task *task = command_data;
+
+
+
     if (status != 0) {

         error_report("iSCSI: Failed to read capacity of iSCSI lun. %s",

                      iscsi_get_error(iscsi));
+
+        itask->status   = 1;
+
         itask->complete = 1;
+
         scsi_free_scsi_task(task);
+
+        return;
+
+    }

iscsi_readcapacity10_cb(struct iscsi_context *iscsi, int status,

                        void *command_data, void *opaque)

{

    struct IscsiTask *itask = opaque;

    struct scsi_readcapacity10 *rc10;

    struct scsi_task *task = command_data;

    if (status != 0) {

        error_report("iSCSI: Failed to read capacity of iSCSI lun. %s",

                     iscsi_get_error(iscsi));

        itask->status   = 1;

        itask->complete = 1;

        scsi_free_scsi_task(task);

        return;

    }

    rc10 = scsi_datain_unmarshall(task);

    if (rc10 == NULL) {

        error_report("iSCSI: Failed to unmarshall readcapacity10 data.");

        itask->status   = 1;

        itask->complete = 1;

        scsi_free_scsi_task(task);

        return;

    }

    itask->iscsilun->block_size = rc10->block_size;

    if (rc10->lba == 0) {

        /* blank disk loaded */

        itask->iscsilun->num_blocks = 0;

    } else {

        itask->iscsilun->num_blocks = rc10->lba + 1;

    }

    itask->bs->total_sectors    = itask->iscsilun->num_blocks *

                               itask->iscsilun->block_size / BDRV_SECTOR_SIZE ;

    itask->status   = 0;

    itask->complete = 1;

    scsi_free_scsi_task(task);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void qmp_tmp105_set_temperature(const char *id, int value)

+{

     QDict *response;

static void qmp_tmp105_set_temperature(const char *id, int value)

{

    QDict *response;

    response = qmp("{ 'execute': 'qom-set', 'arguments': { 'path': '%s', "

                   "'property': 'temperature', 'value': %d } }", id, value);

    g_assert(qdict_haskey(response, "return"));

    QDECREF(response);

}


--- a/source.c
+++ b/source.c
@@ -1,18 +1,18 @@
 static void pci_set_irq(void *opaque, int irq_num, int level)

+{

+    PCIDevice *pci_dev = opaque;

+    PCIBus *bus;
+
+    int change;
+
+
+
     change = level - pci_dev->irq_state[irq_num];
+
+    if (!change)

         return;

static void pci_set_irq(void *opaque, int irq_num, int level)

{

    PCIDevice *pci_dev = opaque;

    PCIBus *bus;

    int change;

    change = level - pci_dev->irq_state[irq_num];

    if (!change)

        return;

    pci_dev->irq_state[irq_num] = level;

    for (;;) {

        bus = pci_dev->bus;

        irq_num = bus->map_irq(pci_dev, irq_num);

        if (bus->set_irq)

            break;

        pci_dev = bus->parent_dev;

    }

    bus->irq_count[irq_num] += change;

    bus->set_irq(bus->irq_opaque, irq_num, bus->irq_count[irq_num] != 0);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static inline void qemu_assert(int cond, const char *msg)
+
+{
+
     if (!cond) {

         fprintf (stderr, "badness: %s\n", msg);

static inline void qemu_assert(int cond, const char *msg)

{

    if (!cond) {

        fprintf (stderr, "badness: %s\n", msg);

        abort();

    }

}


setup_return(CPUARMState *env, struct target_sigaction *ka,

	     abi_ulong *rc, abi_ulong frame_addr, int usig, abi_ulong rc_addr)

{

	abi_ulong handler = ka->_sa_handler;

	abi_ulong retcode;

	int thumb = handler & 1;

	uint32_t cpsr = cpsr_read(env);

	cpsr &= ~CPSR_IT;

	if (thumb) {

		cpsr |= CPSR_T;

	} else {

		cpsr &= ~CPSR_T;

	}

	if (ka->sa_flags & TARGET_SA_RESTORER) {

		retcode = ka->sa_restorer;

	} else {

		unsigned int idx = thumb;

		if (ka->sa_flags & TARGET_SA_SIGINFO)

			idx += 2;

		if (__put_user(retcodes[idx], rc))

			return 1;

		retcode = rc_addr + thumb;

	}

	env->regs[0] = usig;

	env->regs[13] = frame_addr;

	env->regs[14] = retcode;

	env->regs[15] = handler & (thumb ? ~1 : ~3);

	cpsr_write(env, cpsr, 0xffffffff);

	return 0;

}


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

     CharDriverState *chr;

+
+
+    assert(opts->kind == NET_CLIENT_OPTIONS_KIND_VHOST_USER);
+
+    vhost_user_opts = opts->vhost_user;

int net_init_vhost_user(const NetClientOptions *opts, const char *name,

                        NetClientState *peer, Error **errp)

{

    const NetdevVhostUserOptions *vhost_user_opts;

    CharDriverState *chr;

    assert(opts->kind == NET_CLIENT_OPTIONS_KIND_VHOST_USER);

    vhost_user_opts = opts->vhost_user;

    chr = net_vhost_parse_chardev(vhost_user_opts, errp);

    if (!chr) {

        return -1;

    }

    /* verify net frontend */

    if (qemu_opts_foreach(qemu_find_opts("device"), net_vhost_check_net,

                          (char *)name, errp)) {

        return -1;

    }

    return net_vhost_user_init(peer, "vhost_user", name, chr);

}


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

         error_report("oom: %d %d\n", acb->aiocb_type, acb->aiocb_type);
+
+        return -EIO;
+
+    }
+

     qemu_bh_schedule(acb->bh);

static int sd_schedule_bh(QEMUBHFunc *cb, SheepdogAIOCB *acb)

{

    if (acb->bh) {

        error_report("bug: %d %d\n", acb->aiocb_type, acb->aiocb_type);

        return -EIO;

    }

    acb->bh = qemu_bh_new(cb, acb);

    if (!acb->bh) {

        error_report("oom: %d %d\n", acb->aiocb_type, acb->aiocb_type);

        return -EIO;

    }

    qemu_bh_schedule(acb->bh);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 uint64_t cpu_tick_get_count(CPUTimer *timer)

+{
+
     uint64_t real_count = timer_to_cpu_ticks(

                     qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - timer->clock_offset,

uint64_t cpu_tick_get_count(CPUTimer *timer)

{

    uint64_t real_count = timer_to_cpu_ticks(

                    qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - timer->clock_offset,

                    timer->frequency);

    TIMER_DPRINTF("%s get_count count=0x%016lx (%s) p=%p\n",

           timer->name, real_count,

           timer->disabled?"disabled":"enabled", timer);

    if (timer->disabled)

        real_count |= timer->disabled_mask;

    return real_count;

}


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

+
+    v9fs_string_init(&xname);
+
+    v9fs_string_sprintf(&xname, "%s", name);
+
     retval = v9fs_request(ctx->private, T_LREMOVEXATTR, NULL, "ss",

                           fs_path, &xname);

static int proxy_lremovexattr(FsContext *ctx, V9fsPath *fs_path,

                              const char *name)

{

    int retval;

    V9fsString xname;

    v9fs_string_init(&xname);

    v9fs_string_sprintf(&xname, "%s", name);

    retval = v9fs_request(ctx->private, T_LREMOVEXATTR, NULL, "ss",

                          fs_path, &xname);

    v9fs_string_free(&xname);

    if (retval < 0) {

        errno = -retval;

    }

    return retval;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void uninit(struct vf_instance *vf)
+
 {

         free(vf->priv);

static void uninit(struct vf_instance *vf)

{

        free(vf->priv);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static bool tlb_is_dirty_ram(CPUTLBEntry *tlbe)
+
 {

     return (tlbe->addr_write & (TLB_INVALID_MASK|TLB_MMIO|TLB_NOTDIRTY)) == 0;

static bool tlb_is_dirty_ram(CPUTLBEntry *tlbe)

{

    return (tlbe->addr_write & (TLB_INVALID_MASK|TLB_MMIO|TLB_NOTDIRTY)) == 0;

}


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

     dev->auto_attach = 1;

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

         rc = usb_device_attach(dev);

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

{

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

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

    int rc;

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

    dev->info = info;

    dev->auto_attach = 1;

    QLIST_INIT(&dev->strings);

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

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

        rc = usb_device_attach(dev);

    return rc;

}


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

     s->config[1] = 0x0000;

+    onenand_intr_update(s);
+
+    qemu_irq_raise(s->rdy);
+
+    s->status = 0x0000;

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

static void onenand_reset(OneNANDState *s, int cold)

{

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

    s->command = 0;

    s->count = 1;

    s->bufaddr = 0;

    s->config[0] = 0x40c0;

    s->config[1] = 0x0000;

    onenand_intr_update(s);

    qemu_irq_raise(s->rdy);

    s->status = 0x0000;

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

    s->unladdr[0] = 0;

    s->unladdr[1] = 0;

    s->wpstatus = 0x0002;

    s->cycle = 0;

    s->otpmode = 0;

    s->bdrv_cur = s->bdrv;

    s->current = s->image;

    s->secs_cur = s->secs;

    if (cold) {

        /* Lock the whole flash */

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

        if (s->bdrv_cur && bdrv_read(s->bdrv_cur, 0, s->boot[0], 8) < 0) {

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

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void openrisc_pic_cpu_handler(void *opaque, int irq, int level)

+{
+
+    OpenRISCCPU *cpu = (OpenRISCCPU *)opaque;
+
+    CPUState *cs = CPU(cpu);

     int i;

static void openrisc_pic_cpu_handler(void *opaque, int irq, int level)

{

    OpenRISCCPU *cpu = (OpenRISCCPU *)opaque;

    CPUState *cs = CPU(cpu);

    int i;

    uint32_t irq_bit = 1 << irq;

    if (irq > 31 || irq < 0) {

        return;

    }

    if (level) {

        cpu->env.picsr |= irq_bit;

    } else {

        cpu->env.picsr &= ~irq_bit;

    }

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

        if ((cpu->env.picsr && (1 << i)) && (cpu->env.picmr && (1 << i))) {

            cpu_interrupt(cs, CPU_INTERRUPT_HARD);

        } else {

            cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);

            cpu->env.picsr &= ~(1 << i);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
         return env->CP0_Count;

 #else
+
+        return (int32_t)cpu_mips_get_count(env);
+
+#endif
+
     } else {

         do_raise_exception(env, EXCP_RI, GETPC());

target_ulong helper_rdhwr_cc(CPUMIPSState *env)

{

    if ((env->hflags & MIPS_HFLAG_CP0) ||

        (env->CP0_HWREna & (1 << 2))) {

#ifdef CONFIG_USER_ONLY

        return env->CP0_Count;

#else

        return (int32_t)cpu_mips_get_count(env);

#endif

    } else {

        do_raise_exception(env, EXCP_RI, GETPC());

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,17 +1,17 @@
+static int pci_read_devaddr(Monitor *mon, const char *addr,
+
+                            int *busp, unsigned *slotp)
+
 {
+
+    int dom;
+

+
+    /* strip legacy tag */

     if (!strncmp(addr, "pci_addr=", 9)) {
+
         addr += 9;

     }

static int pci_read_devaddr(Monitor *mon, const char *addr,

                            int *busp, unsigned *slotp)

{

    int dom;

    /* strip legacy tag */

    if (!strncmp(addr, "pci_addr=", 9)) {

        addr += 9;

    }

    if (pci_parse_devaddr(addr, &dom, busp, slotp, NULL)) {

        monitor_printf(mon, "Invalid pci address\n");

        return -1;

    }

    if (dom != 0) {

        monitor_printf(mon, "Multiple PCI domains not supported, use device_add\n");

        return -1;

    }

    return 0;

}


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

                  struct target_sigaction *oact)

+{
+
     struct emulated_sigaction *k;

int do_sigaction(int sig, const struct target_sigaction *act,

                 struct target_sigaction *oact)

{

    struct emulated_sigaction *k;

    if (sig < 1 || sig > TARGET_NSIG)

        return -EINVAL;

    k = &sigact_table[sig - 1];

#if defined(DEBUG_SIGNAL) && 0

    fprintf(stderr, "sigaction sig=%d act=0x%08x, oact=0x%08x\n",

            sig, (int)act, (int)oact);

#endif

    if (oact) {

        oact->_sa_handler = tswapl(k->sa._sa_handler);

        oact->sa_flags = tswapl(k->sa.sa_flags);

        oact->sa_restorer = tswapl(k->sa.sa_restorer);

        oact->sa_mask = k->sa.sa_mask;

    }

    if (act) {

        k->sa._sa_handler = tswapl(act->_sa_handler);

        k->sa.sa_flags = tswapl(act->sa_flags);

        k->sa.sa_restorer = tswapl(act->sa_restorer);

        k->sa.sa_mask = act->sa_mask;

    }

    return 0;

}


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

         int *need_next_header, int *new_frame_start)

+{

     int err;

static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,

        int *need_next_header, int *new_frame_start)

{

    int err;

    union {

        uint64_t u64;

        uint8_t  u8[8];

    } tmp = { av_be2ne64(state) };

    AC3HeaderInfo hdr, *phdr = &hdr;

    GetBitContext gbc;

    init_get_bits(&gbc, tmp.u8+8-AC3_HEADER_SIZE, 54);

    err = avpriv_ac3_parse_header2(&gbc, &phdr);

    if(err < 0)

        return 0;

    hdr_info->sample_rate = hdr.sample_rate;

    hdr_info->bit_rate = hdr.bit_rate;

    hdr_info->channels = hdr.channels;

    hdr_info->channel_layout = hdr.channel_layout;

    hdr_info->samples = hdr.num_blocks * 256;

    hdr_info->service_type = hdr.bitstream_mode;

    if (hdr.bitstream_mode == 0x7 && hdr.channels > 1)

        hdr_info->service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;

    if(hdr.bitstream_id>10)

        hdr_info->codec_id = AV_CODEC_ID_EAC3;

    else if (hdr_info->codec_id == AV_CODEC_ID_NONE)

        hdr_info->codec_id = AV_CODEC_ID_AC3;

    *need_next_header = (hdr.frame_type != EAC3_FRAME_TYPE_AC3_CONVERT);

    *new_frame_start  = (hdr.frame_type != EAC3_FRAME_TYPE_DEPENDENT);

    return hdr.frame_size;

}


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

             found = 1;

+            qemu_input_handler_activate(s);
+
+            break;
+
+        }

     }

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

{

    QemuInputHandlerState *s;

    int index = qdict_get_int(qdict, "index");

    int found = 0;

    QTAILQ_FOREACH(s, &handlers, node) {

        if (s->id == index) {

            found = 1;

            qemu_input_handler_activate(s);

            break;

        }

    }

    if (!found) {

        monitor_printf(mon, "Mouse at given index not found\n");

    }

    qemu_input_check_mode_change();

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void disas_test_b_imm(DisasContext *s, uint32_t insn)

+{
+
+    unsigned int bit_pos, op, rt;
+
+    uint64_t addr;

     int label_match;

static void disas_test_b_imm(DisasContext *s, uint32_t insn)

{

    unsigned int bit_pos, op, rt;

    uint64_t addr;

    int label_match;

    TCGv_i64 tcg_cmp;

    bit_pos = (extract32(insn, 31, 1) << 5) | extract32(insn, 19, 5);

    op = extract32(insn, 24, 1); /* 0: TBZ; 1: TBNZ */

    addr = s->pc + sextract32(insn, 5, 14) * 4 - 4;

    rt = extract32(insn, 0, 5);

    tcg_cmp = tcg_temp_new_i64();

    tcg_gen_andi_i64(tcg_cmp, cpu_reg(s, rt), (1ULL << bit_pos));

    label_match = gen_new_label();

    tcg_gen_brcondi_i64(op ? TCG_COND_NE : TCG_COND_EQ,

                        tcg_cmp, 0, label_match);

    tcg_temp_free_i64(tcg_cmp);

    gen_goto_tb(s, 0, s->pc);

    gen_set_label(label_match);

    gen_goto_tb(s, 1, addr);

}


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

     CPUState *cs = CPU(obj);
+
     MoxieCPU *cpu = MOXIE_CPU(obj);

     static int inited;

static void moxie_cpu_initfn(Object *obj)

{

    CPUState *cs = CPU(obj);

    MoxieCPU *cpu = MOXIE_CPU(obj);

    static int inited;

    cs->env_ptr = &cpu->env;

    cpu_exec_init(cs, &error_abort);

    if (tcg_enabled() && !inited) {

        inited = 1;

        moxie_translate_init();

    }

}


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

     }
+
+
+
+    bdrv_flags = bdrv_is_read_only(bs) ? 0 : BDRV_O_RDWR;
+
     bdrv_flags |= bdrv_is_snapshot(bs) ? BDRV_O_SNAPSHOT : 0;

void qmp_change_blockdev(const char *device, const char *filename,

                         const char *format, Error **errp)

{

    BlockBackend *blk;

    BlockDriverState *bs;

    BlockDriver *drv = NULL;

    int bdrv_flags;

    Error *err = NULL;

    blk = blk_by_name(device);

    if (!blk) {

        error_set(errp, QERR_DEVICE_NOT_FOUND, device);

        return;

    }

    bs = blk_bs(blk);

    if (format) {

        drv = bdrv_find_whitelisted_format(format, bs->read_only);

        if (!drv) {

            error_set(errp, QERR_INVALID_BLOCK_FORMAT, format);

            return;

        }

    }

    eject_device(blk, 0, &err);

    if (err) {

        error_propagate(errp, err);

        return;

    }

    bdrv_flags = bdrv_is_read_only(bs) ? 0 : BDRV_O_RDWR;

    bdrv_flags |= bdrv_is_snapshot(bs) ? BDRV_O_SNAPSHOT : 0;

    qmp_bdrv_open_encrypted(bs, filename, bdrv_flags, drv, NULL, errp);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void memory_global_sync_dirty_bitmap(MemoryRegion *address_space)

 {
+
     AddressSpace *as = memory_region_to_address_space(address_space);

     FlatRange *fr;

void memory_global_sync_dirty_bitmap(MemoryRegion *address_space)

{

    AddressSpace *as = memory_region_to_address_space(address_space);

    FlatRange *fr;

    FOR_EACH_FLAT_RANGE(fr, &as->current_map) {

        MEMORY_LISTENER_UPDATE_REGION(fr, as, Forward, log_sync);

    }

}


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

     int64_t v;

+    uint_fast16_t res;

     v = float64_to_int64_round_to_zero(a STATUS_VAR);
+
     if (v < 0) {

         res = 0;

uint_fast16_t float64_to_uint16_round_to_zero(float64 a STATUS_PARAM)

{

    int64_t v;

    uint_fast16_t res;

    v = float64_to_int64_round_to_zero(a STATUS_VAR);

    if (v < 0) {

        res = 0;

        float_raise( float_flag_invalid STATUS_VAR);

    } else if (v > 0xffff) {

        res = 0xffff;

        float_raise( float_flag_invalid STATUS_VAR);

    } else {

        res = v;

    }

    return res;

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
         av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n");

         return -1;
+
+    }
+
+
+
     c->code_size = avctx->bits_per_coded_sample;

     if (c->code_size < 2 || c->code_size > 5) {

static av_cold int g726_decode_init(AVCodecContext *avctx)

{

    G726Context* c = avctx->priv_data;

    if (avctx->sample_rate <= 0) {

        av_log(avctx, AV_LOG_ERROR, "Samplerate is invalid\n");

        return -1;

    }

    if(avctx->channels != 1){

        av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n");

        return -1;

    }

    c->code_size = avctx->bits_per_coded_sample;

    if (c->code_size < 2 || c->code_size > 5) {

        av_log(avctx, AV_LOG_ERROR, "Invalid number of bits %d\n", c->code_size);

        return AVERROR(EINVAL);

    }

    g726_reset(c, c->code_size - 2);

    avctx->sample_fmt = AV_SAMPLE_FMT_S16;

    return 0;

}


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

     QemuOpts *opts;
+
     int sock = -1;

int inet_connect(const char *str, Error **errp)

{

    QemuOpts *opts;

    int sock = -1;

    opts = qemu_opts_create(&dummy_opts, NULL, 0, NULL);

    if (inet_parse(opts, str) == 0) {

        sock = inet_connect_opts(opts, true, NULL, errp);

    } else {

        error_set(errp, QERR_SOCKET_CREATE_FAILED);

    }

    qemu_opts_del(opts);

    return sock;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void opt_frame_pad_left(const char *arg)

 {
+
+    frame_padleft = atoi(arg);
+
     if (frame_padleft < 0) {

         fprintf(stderr, "Incorrect left pad size\n");

static void opt_frame_pad_left(const char *arg)

{

    frame_padleft = atoi(arg);

    if (frame_padleft < 0) {

        fprintf(stderr, "Incorrect left pad size\n");

        av_exit(1);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static uint32_t timer_int_route(struct HPETTimer *timer)
+
+{
+
     uint32_t route;

     route = (timer->config & HPET_TN_INT_ROUTE_MASK) >> HPET_TN_INT_ROUTE_SHIFT;

static uint32_t timer_int_route(struct HPETTimer *timer)

{

    uint32_t route;

    route = (timer->config & HPET_TN_INT_ROUTE_MASK) >> HPET_TN_INT_ROUTE_SHIFT;

    return route;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void virtio_net_add_queue(VirtIONet *n, int index)

 {
+
+    VirtIODevice *vdev = VIRTIO_DEVICE(n);
+
+
+
     n->vqs[index].rx_vq = virtio_add_queue(vdev, n->net_conf.rx_queue_size,

                                            virtio_net_handle_rx);

static void virtio_net_add_queue(VirtIONet *n, int index)

{

    VirtIODevice *vdev = VIRTIO_DEVICE(n);

    n->vqs[index].rx_vq = virtio_add_queue(vdev, n->net_conf.rx_queue_size,

                                           virtio_net_handle_rx);

    if (n->net_conf.tx && !strcmp(n->net_conf.tx, "timer")) {

        n->vqs[index].tx_vq =

            virtio_add_queue(vdev, 256, virtio_net_handle_tx_timer);

        n->vqs[index].tx_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,

                                              virtio_net_tx_timer,

                                              &n->vqs[index]);

    } else {

        n->vqs[index].tx_vq =

            virtio_add_queue(vdev, 256, virtio_net_handle_tx_bh);

        n->vqs[index].tx_bh = qemu_bh_new(virtio_net_tx_bh, &n->vqs[index]);

    }

    n->vqs[index].tx_waiting = 0;

    n->vqs[index].n = n;

}


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

         qemu_coroutine_delete(co);

+    }
+
+
+
+    qemu_mutex_destroy(&pool_lock);

 }

static void __attribute__((destructor)) coroutine_pool_cleanup(void)

{

    Coroutine *co;

    Coroutine *tmp;

    QSLIST_FOREACH_SAFE(co, &pool, pool_next, tmp) {

        QSLIST_REMOVE_HEAD(&pool, pool_next);

        qemu_coroutine_delete(co);

    }

    qemu_mutex_destroy(&pool_lock);

}


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

     }

+
+
+    /*
+
+     * drive_init() tries to find a default for dinfo->unit.  Doesn't

      * work at all for hotplug though as we assign the device to a

static int scsi_hot_add(Monitor *mon, DeviceState *adapter,

                        DriveInfo *dinfo, int printinfo)

{

    SCSIBus *scsibus;

    SCSIDevice *scsidev;

    scsibus = DO_UPCAST(SCSIBus, qbus, QLIST_FIRST(&adapter->child_bus));

    if (!scsibus || strcmp(scsibus->qbus.info->name, "SCSI") != 0) {

        error_report("Device is not a SCSI adapter");

        return -1;

    }

    /*

     * drive_init() tries to find a default for dinfo->unit.  Doesn't

     * work at all for hotplug though as we assign the device to a

     * specific bus instead of the first bus with spare scsi ids.

     *

     * Ditch the calculated value and reload from option string (if

     * specified).

     */

    dinfo->unit = qemu_opt_get_number(dinfo->opts, "unit", -1);

    scsidev = scsi_bus_legacy_add_drive(scsibus, dinfo, dinfo->unit);

    if (!scsidev) {

        return -1;

    }

    dinfo->unit = scsidev->id;

    if (printinfo)

        monitor_printf(mon, "OK bus %d, unit %d\n",

                       scsibus->busnr, scsidev->id);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int coroutine_fn blkreplay_co_pwrite_zeroes(BlockDriverState *bs,

+    int64_t offset, int count, BdrvRequestFlags flags)
+
+{
+
     uint64_t reqid = request_id++;

     int ret = bdrv_co_pwrite_zeroes(bs->file->bs, offset, count, flags);

static int coroutine_fn blkreplay_co_pwrite_zeroes(BlockDriverState *bs,

    int64_t offset, int count, BdrvRequestFlags flags)

{

    uint64_t reqid = request_id++;

    int ret = bdrv_co_pwrite_zeroes(bs->file->bs, offset, count, flags);

    block_request_create(reqid, bs, qemu_coroutine_self());

    qemu_coroutine_yield();

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static inline int coeff_unpack_golomb(GetBitContext *gb, int qfactor, int qoffset)

+{

     int coeff = dirac_get_se_golomb(gb);

static inline int coeff_unpack_golomb(GetBitContext *gb, int qfactor, int qoffset)

{

    int coeff = dirac_get_se_golomb(gb);

    const int sign = FFSIGN(coeff);

    if (coeff)

        coeff = sign*((sign * coeff * qfactor + qoffset) >> 2);

    return coeff;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 QBool *qobject_to_qbool(const QObject *obj)
+
 {

     if (qobject_type(obj) != QTYPE_QBOOL)

QBool *qobject_to_qbool(const QObject *obj)

{

    if (qobject_type(obj) != QTYPE_QBOOL)

        return NULL;

    return container_of(obj, QBool, base);

}


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

     }

+
+
+    nut->last_packet_start = nut->packet_start;
+
+    nut->packet_start = start;

     nut->written_packet_size= size;

static int get_packetheader(NUTContext *nut, ByteIOContext *bc, int prefix_length)

{

    int64_t start, size, last_size;

    start= url_ftell(bc) - prefix_length;

    if(start != nut->packet_start + nut->written_packet_size){

        av_log(nut->avf, AV_LOG_ERROR, "get_packetheader called at weird position\n");

        return -1;

    }

    size= get_v(bc);

    last_size= get_v(bc);

    if(nut->written_packet_size != last_size){

        av_log(nut->avf, AV_LOG_ERROR, "packet size missmatch %d != %lld at %lld\n", nut->written_packet_size, last_size, start);

        return -1;

    }

    nut->last_packet_start = nut->packet_start;

    nut->packet_start = start;

    nut->written_packet_size= size;

    return size;

}


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

         DPRINTF("read: %08x = %08x\n", s->ioregsel, val);
+
+        break;
+
+    }
+
     return val;

 }

ioapic_mem_read(void *opaque, target_phys_addr_t addr, unsigned int size)

{

    IOAPICCommonState *s = opaque;

    int index;

    uint32_t val = 0;

    switch (addr & 0xff) {

    case IOAPIC_IOREGSEL:

        val = s->ioregsel;

        break;

    case IOAPIC_IOWIN:

        if (size != 4) {

            break;

        }

        switch (s->ioregsel) {

        case IOAPIC_REG_ID:

            val = s->id << IOAPIC_ID_SHIFT;

            break;

        case IOAPIC_REG_VER:

            val = IOAPIC_VERSION |

                ((IOAPIC_NUM_PINS - 1) << IOAPIC_VER_ENTRIES_SHIFT);

            break;

        case IOAPIC_REG_ARB:

            val = 0;

            break;

        default:

            index = (s->ioregsel - IOAPIC_REG_REDTBL_BASE) >> 1;

            if (index >= 0 && index < IOAPIC_NUM_PINS) {

                if (s->ioregsel & 1) {

                    val = s->ioredtbl[index] >> 32;

                } else {

                    val = s->ioredtbl[index] & 0xffffffff;

                }

            }

        }

        DPRINTF("read: %08x = %08x\n", s->ioregsel, val);

        break;

    }

    return val;

}


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

     }

+
+
+    return socket_sockaddr_to_address(&ss, sslen, errp);
+
+}

SocketAddressLegacy *socket_remote_address(int fd, Error **errp)

{

    struct sockaddr_storage ss;

    socklen_t sslen = sizeof(ss);

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

        error_setg_errno(errp, errno, "%s",

                         "Unable to query remote socket address");

        return NULL;

    }

    return socket_sockaddr_to_address(&ss, sslen, errp);

}


static void ff_h264_idct_dc_add8_mmx2(uint8_t *dst, int16_t *block, int stride)

{

    __asm__ volatile(

        "movd             %0, %%mm0 \n\t"   //  0 0 X D

        "punpcklwd        %1, %%mm0 \n\t"   //  x X d D

        "paddsw           %2, %%mm0 \n\t"

        "psraw            $6, %%mm0 \n\t"

        "punpcklwd     %%mm0, %%mm0 \n\t"   //  d d D D

        "pxor          %%mm1, %%mm1 \n\t"   //  0 0 0 0

        "psubw         %%mm0, %%mm1 \n\t"   // -d-d-D-D

        "packuswb      %%mm1, %%mm0 \n\t"   // -d-d-D-D d d D D

        "pshufw $0xFA, %%mm0, %%mm1 \n\t"   // -d-d-d-d-D-D-D-D

        "punpcklwd     %%mm0, %%mm0 \n\t"   //  d d d d D D D D

        ::"m"(block[ 0]),

          "m"(block[16]),

          "m"(ff_pw_32)

    );

    __asm__ volatile(

        "movq          %0, %%mm2 \n\t"

        "movq          %1, %%mm3 \n\t"

        "movq          %2, %%mm4 \n\t"

        "movq          %3, %%mm5 \n\t"

        "paddusb    %%mm0, %%mm2 \n\t"

        "paddusb    %%mm0, %%mm3 \n\t"

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

        "paddusb    %%mm0, %%mm5 \n\t"

        "psubusb    %%mm1, %%mm2 \n\t"

        "psubusb    %%mm1, %%mm3 \n\t"

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

        "psubusb    %%mm1, %%mm5 \n\t"

        "movq       %%mm2, %0    \n\t"

        "movq       %%mm3, %1    \n\t"

        "movq       %%mm4, %2    \n\t"

        "movq       %%mm5, %3    \n\t"

        :"+m"(*(uint64_t*)(dst+0*stride)),

         "+m"(*(uint64_t*)(dst+1*stride)),

         "+m"(*(uint64_t*)(dst+2*stride)),

         "+m"(*(uint64_t*)(dst+3*stride))

    );

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void ff_jref_idct1_put(uint8_t *dest, int line_size, DCTELEM *block)
+
+{

     uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

static void ff_jref_idct1_put(uint8_t *dest, int line_size, DCTELEM *block)

{

    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

    dest[0] = cm[(block[0] + 4)>>3];

}


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

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

     int i;

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

{

    struct endp_data *endp = priv;

    USBRedirDevice *dev = endp->dev;

    struct buf_packet *bufp;

    int i;

    endp->bufpq_size = qemu_get_be32(f);

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

        bufp = g_malloc(sizeof(struct buf_packet));

        bufp->len = qemu_get_be32(f);

        bufp->status = qemu_get_be32(f);

        bufp->offset = 0;

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

        bufp->free_on_destroy = bufp->data;

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

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

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

                bufp->len, bufp->status);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static av_cold int omx_try_load(OMXContext *s, void *logctx,

                                 const char *libname, const char *prefix)

static av_cold int omx_try_load(OMXContext *s, void *logctx,

                                const char *libname, const char *prefix)

{

    s->lib = dlopen(libname, RTLD_NOW | RTLD_GLOBAL);

    if (!s->lib) {

        av_log(logctx, AV_LOG_WARNING, "%s not found\n", libname);

        return AVERROR_ENCODER_NOT_FOUND;

    }

    s->ptr_Init                = dlsym_prefixed(s->lib, "OMX_Init", prefix);

    s->ptr_Deinit              = dlsym_prefixed(s->lib, "OMX_Deinit", prefix);

    s->ptr_ComponentNameEnum   = dlsym_prefixed(s->lib, "OMX_ComponentNameEnum", prefix);

    s->ptr_GetHandle           = dlsym_prefixed(s->lib, "OMX_GetHandle", prefix);

    s->ptr_FreeHandle          = dlsym_prefixed(s->lib, "OMX_FreeHandle", prefix);

    s->ptr_GetComponentsOfRole = dlsym_prefixed(s->lib, "OMX_GetComponentsOfRole", prefix);

    s->ptr_GetRolesOfComponent = dlsym_prefixed(s->lib, "OMX_GetRolesOfComponent", prefix);

    if (!s->ptr_Init || !s->ptr_Deinit || !s->ptr_ComponentNameEnum ||

        !s->ptr_GetHandle || !s->ptr_FreeHandle ||

        !s->ptr_GetComponentsOfRole || !s->ptr_GetRolesOfComponent) {

        av_log(logctx, AV_LOG_WARNING, "Not all functions found in %s\n", libname);

        dlclose(s->lib);

        s->lib = NULL;

        return AVERROR_ENCODER_NOT_FOUND;

    }

    return 0;

}


static void celt_denormalize(CeltFrame *f, CeltBlock *block, float *data)

{

    int i, j;

    for (i = f->start_band; i < f->end_band; i++) {

        float *dst = data + (ff_celt_freq_bands[i] << f->size);

        float norm = exp2f(block->energy[i] + ff_celt_mean_energy[i]);

        for (j = 0; j < ff_celt_freq_range[i] << f->size; j++)

            dst[j] *= norm;

    }

}


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

         closesocket(server_fd);

+        return -1;
+
+    }
+
+    ff_socket_nonblock(server_fd, 1);

static int socket_open_listen(struct sockaddr_in *my_addr)

{

    int server_fd, tmp;

    server_fd = socket(AF_INET,SOCK_STREAM,0);

    if (server_fd < 0) {

        perror ("socket");

        return -1;

    }

    tmp = 1;

    setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, &tmp, sizeof(tmp));

    if (bind (server_fd, (struct sockaddr *) my_addr, sizeof (*my_addr)) < 0) {

        char bindmsg[32];

        snprintf(bindmsg, sizeof(bindmsg), "bind(port %d)", ntohs(my_addr->sin_port));

        perror (bindmsg);

        closesocket(server_fd);

        return -1;

    }

    if (listen (server_fd, 5) < 0) {

        perror ("listen");

        closesocket(server_fd);

        return -1;

    }

    ff_socket_nonblock(server_fd, 1);

    return server_fd;

}


--- a/source.c
+++ b/source.c
@@ -5,8 +5,8 @@
     struct ogg *ogg = s->priv_data;

     struct ogg_stream *os = ogg->streams + idx;
+
+    AVStream *st = s->streams[idx];

     dirac_source_params source;

static int dirac_header(AVFormatContext *s, int idx)

{

    struct ogg *ogg = s->priv_data;

    struct ogg_stream *os = ogg->streams + idx;

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

    dirac_source_params source;

    GetBitContext gb;

    // already parsed the header

    if (st->codec->codec_id == AV_CODEC_ID_DIRAC)

        return 0;

    init_get_bits(&gb, os->buf + os->pstart + 13, (os->psize - 13) * 8);

    if (avpriv_dirac_parse_sequence_header(st->codec, &gb, &source) < 0)

        return -1;

    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;

    st->codec->codec_id = AV_CODEC_ID_DIRAC;

    // dirac in ogg always stores timestamps as though the video were interlaced

    avpriv_set_pts_info(st, 64, st->codec->framerate.den, 2*st->codec->framerate.num);

    return 1;

}


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

 {

+    S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
+
+    int i;
+
+

     for (i = 0; i < sizeof(ms->loadparm) && val[i]; i++) {

static void machine_set_loadparm(Object *obj, const char *val, Error **errp)

{

    S390CcwMachineState *ms = S390_CCW_MACHINE(obj);

    int i;

    for (i = 0; i < sizeof(ms->loadparm) && val[i]; i++) {

        uint8_t c = toupper(val[i]); /* mimic HMC */

        if (('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') || (c == '.') ||

            (c == ' ')) {

            ms->loadparm[i] = c;

        } else {

            error_setg(errp, "LOADPARM: invalid character '%c' (ASCII 0x%02x)",

                       c, c);

            return;

        }

    }

    for (; i < sizeof(ms->loadparm); i++) {

        ms->loadparm[i] = ' '; /* pad right with spaces */

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void vfio_unmap_bars(VFIOPCIDevice *vdev)
+
+{
+
+    int i;
+

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

static void vfio_unmap_bars(VFIOPCIDevice *vdev)

{

    int i;

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

        vfio_unmap_bar(vdev, i);

    }

    if (vdev->has_vga) {

        vfio_vga_quirk_teardown(vdev);

        pci_unregister_vga(&vdev->pdev);

    }

}


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

+{
+
+    PCIBonitoState *s = opaque;
+
+    PCIDevice *d = PCI_DEVICE(s);

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

static uint32_t bonito_spciconf_readl(void *opaque, target_phys_addr_t addr)

{

    PCIBonitoState *s = opaque;

    PCIDevice *d = PCI_DEVICE(s);

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

    uint32_t pciaddr;

    uint16_t status;

    DPRINTF("bonito_spciconf_readl "TARGET_FMT_plx"\n", addr);

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

    pciaddr = bonito_sbridge_pciaddr(s, addr);

    if (pciaddr == 0xffffffff) {

        return 0xffffffff;

    }

    /* set the pci address in s->config_reg */

    phb->config_reg = (pciaddr) | (1u << 31);

    /* clear PCI_STATUS_REC_MASTER_ABORT and PCI_STATUS_REC_TARGET_ABORT */

    status = pci_get_word(d->config + PCI_STATUS);

    status &= ~(PCI_STATUS_REC_MASTER_ABORT | PCI_STATUS_REC_TARGET_ABORT);

    pci_set_word(d->config + PCI_STATUS, status);

    return pci_data_read(phb->bus, phb->config_reg, 4);

}


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

     BlockDriverState *bs = acb->common.bs;

+    BDRVGlusterState *s = bs->opaque;

+    int retval;
+
+
+
+    acb->ret = ret;

+    retval = qemu_write_full(s->fds[GLUSTER_FD_WRITE], &acb, sizeof(acb));

     if (retval != sizeof(acb)) {

static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret, void *arg)

{

    GlusterAIOCB *acb = (GlusterAIOCB *)arg;

    BlockDriverState *bs = acb->common.bs;

    BDRVGlusterState *s = bs->opaque;

    int retval;

    acb->ret = ret;

    retval = qemu_write_full(s->fds[GLUSTER_FD_WRITE], &acb, sizeof(acb));

    if (retval != sizeof(acb)) {

        /*

         * Gluster AIO callback thread failed to notify the waiting

         * QEMU thread about IO completion.

         *

         * Complete this IO request and make the disk inaccessible for

         * subsequent reads and writes.

         */

        error_report("Gluster failed to notify QEMU about IO completion");

        qemu_mutex_lock_iothread(); /* We are in gluster thread context */

        acb->common.cb(acb->common.opaque, -EIO);

        qemu_aio_release(acb);

        close(s->fds[GLUSTER_FD_READ]);

        close(s->fds[GLUSTER_FD_WRITE]);

        qemu_aio_set_fd_handler(s->fds[GLUSTER_FD_READ], NULL, NULL, NULL);

        bs->drv = NULL; /* Make the disk inaccessible */

        qemu_mutex_unlock_iothread();

    }

}


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

     offset[1] = frame->linesize[1] * cy;

+    offset[2] = frame->linesize[2] * cy;
+
+    for (i = 3; i < AV_NUM_DATA_POINTERS; i++)
+
+        offset[i] = 0;

     emms_c();

static void draw_slice(HYuvContext *s, AVFrame *frame, int y)

{

    int h, cy, i;

    int offset[AV_NUM_DATA_POINTERS];

    if (s->avctx->draw_horiz_band == NULL)

        return;

    h  = y - s->last_slice_end;

    y -= h;

    if (s->bitstream_bpp == 12)

        cy = y >> 1;

    else

        cy = y;

    offset[0] = frame->linesize[0] * y;

    offset[1] = frame->linesize[1] * cy;

    offset[2] = frame->linesize[2] * cy;

    for (i = 3; i < AV_NUM_DATA_POINTERS; i++)

        offset[i] = 0;

    emms_c();

    s->avctx->draw_horiz_band(s->avctx, frame, offset, y, 3, h);

    s->last_slice_end = y + h;

}


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

         printf("offset %" PRId64 " is not sector aligned\n",

+               offset);
+
+        return 0;
+
+    }

static int alloc_f(int argc, char **argv)

{

    int64_t offset;

    int nb_sectors, remaining;

    char s1[64];

    int num, sum_alloc;

    int ret;

    offset = cvtnum(argv[1]);

    if (offset & 0x1ff) {

        printf("offset %" PRId64 " is not sector aligned\n",

               offset);

        return 0;

    }

    if (argc == 3) {

        nb_sectors = cvtnum(argv[2]);

    } else {

        nb_sectors = 1;

    }

    remaining = nb_sectors;

    sum_alloc = 0;

    while (remaining) {

        ret = bdrv_is_allocated(bs, offset >> 9, nb_sectors, &num);

        remaining -= num;

        if (ret) {

            sum_alloc += num;

        }

    }

    cvtstr(offset, s1, sizeof(s1));

    printf("%d/%d sectors allocated at offset %s\n",

           sum_alloc, nb_sectors, s1);

    return 0;

}


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

+    error_report("%s(%04x:%02x:%02x.%x) Unrecoverable error detected.  "
+
+                 "Please collect any data possible and then kill the guest",
+
+                 __func__, vdev->host.domain, vdev->host.bus,

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

static void vfio_err_notifier_handler(void *opaque)

{

    VFIOPCIDevice *vdev = opaque;

    if (!event_notifier_test_and_clear(&vdev->err_notifier)) {

        return;

    }

    /*

     * TBD. Retrieve the error details and decide what action

     * needs to be taken. One of the actions could be to pass

     * the error to the guest and have the guest driver recover

     * from the error. This requires that PCIe capabilities be

     * exposed to the guest. For now, we just terminate the

     * guest to contain the error.

     */

    error_report("%s(%04x:%02x:%02x.%x) Unrecoverable error detected.  "

                 "Please collect any data possible and then kill the guest",

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

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

    vm_stop(RUN_STATE_INTERNAL_ERROR);

}


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

     BlkMigDevState *bmds;
+
+
+
+    QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {

         aio_context_acquire(blk_get_aio_context(bmds->blk));

static void unset_dirty_tracking(void)

{

    BlkMigDevState *bmds;

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

        aio_context_acquire(blk_get_aio_context(bmds->blk));

        bdrv_release_dirty_bitmap(blk_bs(bmds->blk), bmds->dirty_bitmap);

        aio_context_release(blk_get_aio_context(bmds->blk));

    }

}


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

             access = PAGE_READ | PAGE_WRITE;

+            break;
+
+        }
+
+    }

     if (nx == 0) {

int pp_check(int key, int pp, int nx)

{

    int access;

    /* Compute access rights */

    /* When pp is 3/7, the result is undefined. Set it to noaccess */

    access = 0;

    if (key == 0) {

        switch (pp) {

        case 0x0:

        case 0x1:

        case 0x2:

            access |= PAGE_WRITE;

            /* No break here */

        case 0x3:

        case 0x6:

            access |= PAGE_READ;

            break;

        }

    } else {

        switch (pp) {

        case 0x0:

        case 0x6:

            access = 0;

            break;

        case 0x1:

        case 0x3:

            access = PAGE_READ;

            break;

        case 0x2:

            access = PAGE_READ | PAGE_WRITE;

            break;

        }

    }

    if (nx == 0) {

        access |= PAGE_EXEC;

    }

    return access;

}


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

                           "control", 0x00800000);

+    memory_region_add_subregion(get_system_memory(), base, io);
+
+    /* ??? Save/restore.  */
+
 }

static void icp_control_init(target_phys_addr_t base)

{

    MemoryRegion *io;

    io = (MemoryRegion *)g_malloc0(sizeof(MemoryRegion));

    memory_region_init_io(io, &icp_control_ops, NULL,

                          "control", 0x00800000);

    memory_region_add_subregion(get_system_memory(), base, io);

    /* ??? Save/restore.  */

}


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

     case AV_PIX_FMT_RGB565:
+
+    case AV_PIX_FMT_RGB444:
+
+        avctx->bits_per_coded_sample = 16;
+
         break;

     case AV_PIX_FMT_RGB8:

static av_cold int bmp_encode_init(AVCodecContext *avctx){

    switch (avctx->pix_fmt) {

    case AV_PIX_FMT_BGR24:

        avctx->bits_per_coded_sample = 24;

        break;

    case AV_PIX_FMT_RGB555:

    case AV_PIX_FMT_RGB565:

    case AV_PIX_FMT_RGB444:

        avctx->bits_per_coded_sample = 16;

        break;

    case AV_PIX_FMT_RGB8:

    case AV_PIX_FMT_BGR8:

    case AV_PIX_FMT_RGB4_BYTE:

    case AV_PIX_FMT_BGR4_BYTE:

    case AV_PIX_FMT_GRAY8:

    case AV_PIX_FMT_PAL8:

        avctx->bits_per_coded_sample = 8;

        break;

    case AV_PIX_FMT_MONOBLACK:

        avctx->bits_per_coded_sample = 1;

        break;

    default:

        av_log(avctx, AV_LOG_INFO, "unsupported pixel format\n");

        return -1;

    }

    avctx->coded_frame = av_frame_alloc();

    if (!avctx->coded_frame)

        return AVERROR(ENOMEM);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     if (bs->peer) {

         return -EBUSY;
+
+    }
+
     bs->peer = qdev;

     return 0;

int bdrv_attach(BlockDriverState *bs, DeviceState *qdev)

{

    if (bs->peer) {

        return -EBUSY;

    }

    bs->peer = qdev;

    return 0;

}


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

 #ifdef DEBUG
+
+    int ii;
+

     for (ii = 0; ii < 32; ii++) {

static void h264_free_context(PayloadContext *data)

{

#ifdef DEBUG

    int ii;

    for (ii = 0; ii < 32; ii++) {

        if (data->packet_types_received[ii])

            av_log(NULL, AV_LOG_DEBUG, "Received %d packets of type %d\n",

                   data->packet_types_received[ii], ii);

    }

#endif

    assert(data);

    assert(data->cookie == MAGIC_COOKIE);

    // avoid stale pointers (assert)

    data->cookie = DEAD_COOKIE;

    // and clear out this...

    av_free(data);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static bool is_sector_request_lun_aligned(int64_t sector_num, int nb_sectors,
+
                                           IscsiLun *iscsilun)

 {

static bool is_sector_request_lun_aligned(int64_t sector_num, int nb_sectors,

                                          IscsiLun *iscsilun)

{

    assert(nb_sectors < BDRV_REQUEST_MAX_SECTORS);

    return is_byte_request_lun_aligned(sector_num << BDRV_SECTOR_BITS,

                                       nb_sectors << BDRV_SECTOR_BITS,

                                       iscsilun);

}


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

         while (dev->num_child_bus) {

+            bus = QLIST_FIRST(&dev->child_bus);
+
+            qbus_free(bus);
+
+        }

         if (dev->info->vmsd)

void qdev_free(DeviceState *dev)

{

    BusState *bus;

    if (dev->state == DEV_STATE_INITIALIZED) {

        while (dev->num_child_bus) {

            bus = QLIST_FIRST(&dev->child_bus);

            qbus_free(bus);

        }

        if (dev->info->vmsd)

            vmstate_unregister(dev->info->vmsd, dev);

        if (dev->info->exit)

            dev->info->exit(dev);

        if (dev->opts)

            qemu_opts_del(dev->opts);

    }

    qemu_unregister_reset(qdev_reset, dev);

    QLIST_REMOVE(dev, sibling);

    for (prop = dev->info->props; prop && prop->name; prop++) {

        if (prop->info->free) {

            prop->info->free(dev, prop);

        }

    }

    qemu_free(dev);

}


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

     aacPlusAudioContext *s = avctx->priv_data;

+    int32_t *input_buffer = (int32_t *)frame->data[0];
+
+    int ret;
+
+

     if ((ret = ff_alloc_packet2(avctx, pkt, s->max_output_bytes)))

static int aacPlus_encode_frame(AVCodecContext *avctx, AVPacket *pkt,

                                const AVFrame *frame, int *got_packet)

{

    aacPlusAudioContext *s = avctx->priv_data;

    int32_t *input_buffer = (int32_t *)frame->data[0];

    int ret;

    if ((ret = ff_alloc_packet2(avctx, pkt, s->max_output_bytes)))

        return ret;

    pkt->size = aacplusEncEncode(s->aacplus_handle, input_buffer,

                                 s->samples_input, pkt->data, pkt->size);

    *got_packet   = 1;

    pkt->pts      = frame->pts;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -41,11 +41,11 @@
     gen_set_label(l1);

     if (sign) {
+
+        tcg_gen_sari_i64(ret, arg1, 63);
+
+    } else {
+
         tcg_gen_movi_i64(ret, 0);

     }

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

                                     TCGv arg2, int sign, int compute_ov)

{

    int l1 = gen_new_label();

    int l2 = gen_new_label();

    tcg_gen_brcondi_i64(TCG_COND_EQ, arg2, 0, l1);

    if (sign) {

        int l3 = gen_new_label();

        tcg_gen_brcondi_i64(TCG_COND_NE, arg2, -1, l3);

        tcg_gen_brcondi_i64(TCG_COND_EQ, arg1, INT64_MIN, l1);

        gen_set_label(l3);

        tcg_gen_div_i64(ret, arg1, arg2);

    } else {

        tcg_gen_divu_i64(ret, arg1, arg2);

    }

    if (compute_ov) {

        tcg_gen_movi_tl(cpu_ov, 0);

    }

    tcg_gen_br(l2);

    gen_set_label(l1);

    if (sign) {

        tcg_gen_sari_i64(ret, arg1, 63);

    } else {

        tcg_gen_movi_i64(ret, 0);

    }

    if (compute_ov) {

        tcg_gen_movi_tl(cpu_ov, 1);

        tcg_gen_movi_tl(cpu_so, 1);

    }

    gen_set_label(l2);

    if (unlikely(Rc(ctx->opcode) != 0))

        gen_set_Rc0(ctx, ret);

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+static ssize_t vnc_tls_pull(gnutls_transport_ptr_t transport,
+
+                            void *data,
+
+                            size_t len) {
+
+    VncState *vs = (VncState *)transport;

+    int ret;

static ssize_t vnc_tls_pull(gnutls_transport_ptr_t transport,

                            void *data,

                            size_t len) {

    VncState *vs = (VncState *)transport;

    int ret;

 retry:

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

    if (ret < 0) {

        if (errno == EINTR)

            goto retry;

        return -1;

    }

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
     if (   (arg & ( AV_CPU_FLAG_3DNOW    |

                     AV_CPU_FLAG_3DNOWEXT |
+
                     AV_CPU_FLAG_MMXEXT   |

                     AV_CPU_FLAG_SSE      |

void av_force_cpu_flags(int arg){

    if (   (arg & ( AV_CPU_FLAG_3DNOW    |

                    AV_CPU_FLAG_3DNOWEXT |

                    AV_CPU_FLAG_MMXEXT   |

                    AV_CPU_FLAG_SSE      |

                    AV_CPU_FLAG_SSE2     |

                    AV_CPU_FLAG_SSE2SLOW |

                    AV_CPU_FLAG_SSE3     |

                    AV_CPU_FLAG_SSE3SLOW |

                    AV_CPU_FLAG_SSSE3    |

                    AV_CPU_FLAG_SSE4     |

                    AV_CPU_FLAG_SSE42    |

                    AV_CPU_FLAG_AVX      |

                    AV_CPU_FLAG_AVXSLOW  |

                    AV_CPU_FLAG_XOP      |

                    AV_CPU_FLAG_FMA3     |

                    AV_CPU_FLAG_FMA4     |

                    AV_CPU_FLAG_AVX2     ))

        && !(arg & AV_CPU_FLAG_MMX)) {

        av_log(NULL, AV_LOG_WARNING, "MMX implied by specified flags\n");

        arg |= AV_CPU_FLAG_MMX;

    }

    cpu_flags = arg;

}


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

 {
+
+    LOCAL_ALIGNED_16(uint16_t, buf0, [6 * 8 * 8]);
+
+    LOCAL_ALIGNED_16(uint16_t, buf1, [6 * 8 * 8]);
+

     AVCodecContext avctx = { 0 };

void checkasm_check_blockdsp(void)

{

    LOCAL_ALIGNED_16(uint16_t, buf0, [6 * 8 * 8]);

    LOCAL_ALIGNED_16(uint16_t, buf1, [6 * 8 * 8]);

    AVCodecContext avctx = { 0 };

    BlockDSPContext h;

    ff_blockdsp_init(&h, &avctx);

    check_clear(clear_block,  8 * 8);

    check_clear(clear_blocks, 8 * 8 * 6);

    report("blockdsp");

}


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

+        if (timer_alarm_pending) {
+
+            timer_alarm_pending = 0;
+
+            break;

         }

static void tcg_cpu_exec(void)

{

    int ret = 0;

    if (next_cpu == NULL)

        next_cpu = first_cpu;

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

        CPUState *env = cur_cpu = next_cpu;

        if (timer_alarm_pending) {

            timer_alarm_pending = 0;

            break;

        }

        if (cpu_can_run(env))

            ret = qemu_cpu_exec(env);

        else if (env->stop)

            break;

        if (ret == EXCP_DEBUG) {

            gdb_set_stop_cpu(env);

            debug_requested = 1;

            break;

        }

    }

}


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

 {

+    int i;

     float *output = sce->ret_buf;

static void apply_window_and_mdct(AACEncContext *s, SingleChannelElement *sce,

                                  float *audio)

{

    int i;

    float *output = sce->ret_buf;

    apply_window[sce->ics.window_sequence[0]](s->fdsp, sce, audio);

    if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE)

        s->mdct1024.mdct_calc(&s->mdct1024, sce->coeffs, output);

    else

        for (i = 0; i < 1024; i += 128)

            s->mdct128.mdct_calc(&s->mdct128, sce->coeffs + i, output + i*2);

    memcpy(audio, audio + 1024, sizeof(audio[0]) * 1024);

    memcpy(sce->pcoeffs, sce->coeffs, sizeof(sce->pcoeffs));

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
         fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_sse;

     }
+
+    if (mm_flags & AV_CPU_FLAG_AVX && HAVE_AVX) {
+
+        fdsp->vector_fmul = ff_vector_fmul_avx;
+
         fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_avx;

     }

void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)

{

#if HAVE_YASM

    int mm_flags = av_get_cpu_flags();

    if (mm_flags & AV_CPU_FLAG_SSE && HAVE_SSE) {

        fdsp->vector_fmul = ff_vector_fmul_sse;

        fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_sse;

    }

    if (mm_flags & AV_CPU_FLAG_AVX && HAVE_AVX) {

        fdsp->vector_fmul = ff_vector_fmul_avx;

        fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_avx;

    }

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
 void kvm_setup_guest_memory(void *start, size_t size)

+{

+    if (!kvm_has_sync_mmu()) {

 #ifdef MADV_DONTFORK
+
+        int ret = madvise(start, size, MADV_DONTFORK);
+

         if (ret) {

void kvm_setup_guest_memory(void *start, size_t size)

{

    if (!kvm_has_sync_mmu()) {

#ifdef MADV_DONTFORK

        int ret = madvise(start, size, MADV_DONTFORK);

        if (ret) {

            perror("madvice");

            exit(1);

        }

#else

        fprintf(stderr,

                "Need MADV_DONTFORK in absence of synchronous KVM MMU\n");

        exit(1);

#endif

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int pad_count(const AVFilterPad *pads)

 {
+
+    int count;
+
+

     if (!pads)

static int pad_count(const AVFilterPad *pads)

{

    int count;

    if (!pads)

        return 0;

    for(count = 0; pads->name; count ++) pads ++;

    return count;

}


--- a/source.c
+++ b/source.c
@@ -35,9 +35,9 @@
 #else

     tpm_tis_raise_irq(s, locty,
+
+                      TPM_TIS_INT_DATA_AVAILABLE | TPM_TIS_INT_STS_VALID);
+
+#endif
+
 }

static void tpm_tis_receive_bh(void *opaque)

{

    TPMState *s = opaque;

    TPMTISEmuState *tis = &s->s.tis;

    uint8_t locty = s->locty_number;

    tis->loc[locty].sts = TPM_TIS_STS_VALID | TPM_TIS_STS_DATA_AVAILABLE;

    tis->loc[locty].state = TPM_TIS_STATE_COMPLETION;

    tis->loc[locty].r_offset = 0;

    tis->loc[locty].w_offset = 0;

    if (TPM_TIS_IS_VALID_LOCTY(tis->next_locty)) {

        tpm_tis_abort(s, locty);

    }

#ifndef RAISE_STS_IRQ

    tpm_tis_raise_irq(s, locty, TPM_TIS_INT_DATA_AVAILABLE);

#else

    tpm_tis_raise_irq(s, locty,

                      TPM_TIS_INT_DATA_AVAILABLE | TPM_TIS_INT_STS_VALID);

#endif

}


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

     DriveInfo *di;

+
+
     di = drive_get_next(IF_SD);

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

static void sdhci_initfn(Object *obj)

{

    SDHCIState *s = SDHCI(obj);

    DriveInfo *di;

    di = drive_get_next(IF_SD);

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

    if (s->card == NULL) {

        exit(1);

    }

    s->eject_cb = qemu_allocate_irqs(sdhci_insert_eject_cb, s, 1)[0];

    s->ro_cb = qemu_allocate_irqs(sdhci_card_readonly_cb, s, 1)[0];

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

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

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

}


--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
             fprintf(stderr, "cpage out of range (%d)\n", cpage);

+            return -1;
+
+        }
+
+

         page  = p->qtd.bufptr[cpage] & QTD_BUFPTR_MASK;

static int ehci_init_transfer(EHCIPacket *p)

{

    uint32_t cpage, offset, bytes, plen;

    dma_addr_t page;

    cpage  = get_field(p->qtd.token, QTD_TOKEN_CPAGE);

    bytes  = get_field(p->qtd.token, QTD_TOKEN_TBYTES);

    offset = p->qtd.bufptr[0] & ~QTD_BUFPTR_MASK;

    qemu_sglist_init(&p->sgl, p->queue->ehci->device, 5, p->queue->ehci->as);

    while (bytes > 0) {

        if (cpage > 4) {

            fprintf(stderr, "cpage out of range (%d)\n", cpage);

            return -1;

        }

        page  = p->qtd.bufptr[cpage] & QTD_BUFPTR_MASK;

        page += offset;

        plen  = bytes;

        if (plen > 4096 - offset) {

            plen = 4096 - offset;

            offset = 0;

            cpage++;

        }

        qemu_sglist_add(&p->sgl, page, plen);

        bytes -= plen;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int vmdk_L2update(BlockDriverState *bs, VmdkMetaData *m_data)

+{

     BDRVVmdkState *s = bs->opaque;
+

     /* update L2 table */

static int vmdk_L2update(BlockDriverState *bs, VmdkMetaData *m_data)

{

    BDRVVmdkState *s = bs->opaque;

    /* update L2 table */

    if (bdrv_pwrite(bs->file, ((int64_t)m_data->l2_offset * 512) + (m_data->l2_index * sizeof(m_data->offset)),

                    &(m_data->offset), sizeof(m_data->offset)) != sizeof(m_data->offset))

        return -1;

    /* update backup L2 table */

    if (s->l1_backup_table_offset != 0) {

        m_data->l2_offset = s->l1_backup_table[m_data->l1_index];

        if (bdrv_pwrite(bs->file, ((int64_t)m_data->l2_offset * 512) + (m_data->l2_index * sizeof(m_data->offset)),

                        &(m_data->offset), sizeof(m_data->offset)) != sizeof(m_data->offset))

            return -1;

    }

    return 0;

}


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

         }
+
+
+        kvm_mce_inject(env, paddr, code);
+
+    } else

 #endif /* KVM_CAP_MCE */

int kvm_arch_on_sigbus_vcpu(CPUState *env, int code, void *addr)

{

#ifdef KVM_CAP_MCE

    ram_addr_t ram_addr;

    target_phys_addr_t paddr;

    if ((env->mcg_cap & MCG_SER_P) && addr

        && (code == BUS_MCEERR_AR || code == BUS_MCEERR_AO)) {

        if (qemu_ram_addr_from_host(addr, &ram_addr) ||

            !kvm_physical_memory_addr_from_ram(env->kvm_state, ram_addr,

                                               &paddr)) {

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

                    "QEMU itself instead of guest system!\n");

            /* Hope we are lucky for AO MCE */

            if (code == BUS_MCEERR_AO) {

                return 0;

            } else {

                hardware_memory_error();

            }

        }

        kvm_mce_inject(env, paddr, code);

    } else

#endif /* KVM_CAP_MCE */

    {

        if (code == BUS_MCEERR_AO) {

            return 0;

        } else if (code == BUS_MCEERR_AR) {

            hardware_memory_error();

        } else {

            return 1;

        }

    }

    return 0;

}


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

 {
+
 }


--- a/source.c
+++ b/source.c
@@ -29,11 +29,11 @@
     for (i = 0; i < 4; i ++) {

         s->timer[i].value = 0;
+
+        s->timer[i].irq = irqs[i];
+
+        s->timer[i].info = s;
+
         s->timer[i].num = i;

         s->timer[i].level = 0;

static pxa2xx_timer_info *pxa2xx_timer_init(target_phys_addr_t base,

                qemu_irq *irqs)

{

    int i;

    int iomemtype;

    pxa2xx_timer_info *s;

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

    s->irq_enabled = 0;

    s->oldclock = 0;

    s->clock = 0;

    s->lastload = qemu_get_clock(vm_clock);

    s->reset3 = 0;

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

        s->timer[i].value = 0;

        s->timer[i].irq = irqs[i];

        s->timer[i].info = s;

        s->timer[i].num = i;

        s->timer[i].level = 0;

        s->timer[i].qtimer = qemu_new_timer(vm_clock,

                        pxa2xx_timer_tick, &s->timer[i]);

    }

    iomemtype = cpu_register_io_memory(pxa2xx_timer_readfn,

                    pxa2xx_timer_writefn, s, DEVICE_NATIVE_ENDIAN);

    cpu_register_physical_memory(base, 0x00001000, iomemtype);

    register_savevm(NULL, "pxa2xx_timer", 0, 0,

                    pxa2xx_timer_save, pxa2xx_timer_load, s);

    return s;

}


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

+    if (s->rx_count) {
+
+        uint32_t rx_rpos =
+
+                (RX_FIFO_SIZE + s->rx_wpos - s->rx_count) % RX_FIFO_SIZE;

         *c = s->rx_fifo[rx_rpos];

static void uart_read_rx_fifo(UartState *s, uint32_t *c)

{

    if ((s->r[R_CR] & UART_CR_RX_DIS) || !(s->r[R_CR] & UART_CR_RX_EN)) {

        return;

    }

    if (s->rx_count) {

        uint32_t rx_rpos =

                (RX_FIFO_SIZE + s->rx_wpos - s->rx_count) % RX_FIFO_SIZE;

        *c = s->rx_fifo[rx_rpos];

        s->rx_count--;

        qemu_chr_accept_input(s->chr);

    } else {

        *c = 0;

    }

    uart_update_status(s);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void configure_icount(const char *option)

 {
+
+    vmstate_register(NULL, 0, &vmstate_timers, &timers_state);

     if (!option)

void configure_icount(const char *option)

{

    vmstate_register(NULL, 0, &vmstate_timers, &timers_state);

    if (!option)

        return;

#ifdef CONFIG_IOTHREAD

    vm_clock->warp_timer = qemu_new_timer_ns(rt_clock, icount_warp_rt, NULL);

#endif

    if (strcmp(option, "auto") != 0) {

        icount_time_shift = strtol(option, NULL, 0);

        use_icount = 1;

        return;

    }

    use_icount = 2;

    /* 125MIPS seems a reasonable initial guess at the guest speed.

       It will be corrected fairly quickly anyway.  */

    icount_time_shift = 3;

    /* Have both realtime and virtual time triggers for speed adjustment.

       The realtime trigger catches emulated time passing too slowly,

       the virtual time trigger catches emulated time passing too fast.

       Realtime triggers occur even when idle, so use them less frequently

       than VM triggers.  */

    icount_rt_timer = qemu_new_timer_ms(rt_clock, icount_adjust_rt, NULL);

    qemu_mod_timer(icount_rt_timer,

                   qemu_get_clock_ms(rt_clock) + 1000);

    icount_vm_timer = qemu_new_timer_ns(vm_clock, icount_adjust_vm, NULL);

    qemu_mod_timer(icount_vm_timer,

                   qemu_get_clock_ns(vm_clock) + get_ticks_per_sec() / 10);

}


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

     mbk = SCHM_REG1_MBK(reg1);
+
+    update = SCHM_REG1_UPD(reg1);
+
+    dct = SCHM_REG1_DCT(reg1);
+

     if (update && (reg2 & 0x0000000000000fff)) {

int ioinst_handle_schm(CPUS390XState *env, uint64_t reg1, uint64_t reg2,

                       uint32_t ipb)

{

    uint8_t mbk;

    int update;

    int dct;

    trace_ioinst("schm");

    if (SCHM_REG1_RES(reg1)) {

        program_interrupt(env, PGM_OPERAND, 2);

        return -EIO;

    }

    mbk = SCHM_REG1_MBK(reg1);

    update = SCHM_REG1_UPD(reg1);

    dct = SCHM_REG1_DCT(reg1);

    if (update && (reg2 & 0x0000000000000fff)) {

        program_interrupt(env, PGM_OPERAND, 2);

        return -EIO;

    }

    css_do_schm(mbk, update, dct, update ? reg2 : 0);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void qemu_input_event_send_key_number(QemuConsole *src, int num, bool down)
+
+{
+
     KeyValue *key = g_new0(KeyValue, 1);

     key->type = KEY_VALUE_KIND_NUMBER;

void qemu_input_event_send_key_number(QemuConsole *src, int num, bool down)

{

    KeyValue *key = g_new0(KeyValue, 1);

    key->type = KEY_VALUE_KIND_NUMBER;

    key->u.number = num;

    qemu_input_event_send_key(src, key, down);

}


--- a/source.c
+++ b/source.c
@@ -27,9 +27,9 @@
         return false;

     }
+
+
+
+    return true;
+
 }

static bool eckd_valid_address(BootMapPointer *p)

{

    const uint64_t cylinder = p->eckd.cylinder

                            + ((p->eckd.head & 0xfff0) << 12);

    const uint64_t head = p->eckd.head & 0x000f;

    if (head >= virtio_get_heads()

        ||  p->eckd.sector > virtio_get_sectors()

        ||  p->eckd.sector <= 0) {

        return false;

    }

    if (!virtio_guessed_disk_nature() && cylinder >= virtio_get_cylinders()) {

        return false;

    }

    return true;

}


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

+    /* FCode ROM */

     vmstate_register_ram_global(&s->rom);

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

{

    SysBusDevice *sbd = SYS_BUS_DEVICE(dev);

    CG3State *s = CG3(dev);

    int ret;

    char *fcode_filename;

    /* FCode ROM */

    vmstate_register_ram_global(&s->rom);

    fcode_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, CG3_ROM_FILE);

    if (fcode_filename) {

        ret = load_image_targphys(fcode_filename, s->prom_addr,

                                  FCODE_MAX_ROM_SIZE);

        g_free(fcode_filename);

        if (ret < 0 || ret > FCODE_MAX_ROM_SIZE) {

            error_report("cg3: could not load prom '%s'", CG3_ROM_FILE);

        }

    }

    memory_region_init_ram(&s->vram_mem, NULL, "cg3.vram", s->vram_size,

                           &error_abort);

    memory_region_set_log(&s->vram_mem, true, DIRTY_MEMORY_VGA);

    vmstate_register_ram_global(&s->vram_mem);

    sysbus_init_mmio(sbd, &s->vram_mem);

    sysbus_init_irq(sbd, &s->irq);

    s->con = graphic_console_init(DEVICE(dev), 0, &cg3_ops, s);

    qemu_console_resize(s->con, s->width, s->height);

}


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

     pixel *dest = (pixel *)dest_;
+
     int i;

void FUNC(ff_simple_idct_put)(uint8_t *dest_, int line_size, DCTELEM *block)

{

    pixel *dest = (pixel *)dest_;

    int i;

    line_size /= sizeof(pixel);

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

        FUNC(idctRowCondDC)(block + i*8);

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

        FUNC(idctSparseColPut)(dest + i, line_size, block + i);

}


--- a/source.c
+++ b/source.c
@@ -27,9 +27,9 @@
                      SPR_NOACCESS, SPR_NOACCESS,

                      &spr_read_generic, &spr_write_generic,
+
+                     KVM_REG_PPC_WORT, 0);
+
+#endif
+
 }

static void gen_spr_power8_book4(CPUPPCState *env)

{

    /* Add a number of P8 book4 registers */

#if !defined(CONFIG_USER_ONLY)

    spr_register_kvm(env, SPR_ACOP, "ACOP",

                     SPR_NOACCESS, SPR_NOACCESS,

                     &spr_read_generic, &spr_write_generic,

                     KVM_REG_PPC_ACOP, 0);

    spr_register_kvm(env, SPR_BOOKS_PID, "PID",

                     SPR_NOACCESS, SPR_NOACCESS,

                     &spr_read_generic, &spr_write_generic,

                     KVM_REG_PPC_PID, 0);

    spr_register_kvm(env, SPR_WORT, "WORT",

                     SPR_NOACCESS, SPR_NOACCESS,

                     &spr_read_generic, &spr_write_generic,

                     KVM_REG_PPC_WORT, 0);

#endif

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     AIOReq *aio_req;

     SheepdogAIOCB *acb;
+

     while ((aio_req = find_pending_req(s, oid)) != NULL) {

static void coroutine_fn send_pending_req(BDRVSheepdogState *s, uint64_t oid)

{

    AIOReq *aio_req;

    SheepdogAIOCB *acb;

    while ((aio_req = find_pending_req(s, oid)) != NULL) {

        acb = aio_req->aiocb;

        /* move aio_req from pending list to inflight one */

        QLIST_REMOVE(aio_req, aio_siblings);

        QLIST_INSERT_HEAD(&s->inflight_aio_head, aio_req, aio_siblings);

        add_aio_request(s, aio_req, acb->qiov->iov, acb->qiov->niov, false,

                        acb->aiocb_type);

    }

}


--- a/source.c
+++ b/source.c
@@ -7,5 +7,5 @@
         trace_migrate_set_state(new_state);

     }
+
+}

static void migrate_set_state(MigrationState *s, int old_state, int new_state)

{

    if (atomic_cmpxchg(&s->state, old_state, new_state) == new_state) {

        trace_migrate_set_state(new_state);

    }

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
     rd = extract32(insn, 0, 5);

+
+    if (mos || type > 1) {
+
+        unallocated_encoding(s);
+
         return;

     }

static void disas_fp_csel(DisasContext *s, uint32_t insn)

{

    unsigned int mos, type, rm, cond, rn, rd;

    int label_continue = -1;

    mos = extract32(insn, 29, 3);

    type = extract32(insn, 22, 2); /* 0 = single, 1 = double */

    rm = extract32(insn, 16, 5);

    cond = extract32(insn, 12, 4);

    rn = extract32(insn, 5, 5);

    rd = extract32(insn, 0, 5);

    if (mos || type > 1) {

        unallocated_encoding(s);

        return;

    }

    if (!fp_access_check(s)) {

        return;

    }

    if (cond < 0x0e) { /* not always */

        int label_match = gen_new_label();

        label_continue = gen_new_label();

        arm_gen_test_cc(cond, label_match);

        /* nomatch: */

        gen_mov_fp2fp(s, type, rd, rm);

        tcg_gen_br(label_continue);

        gen_set_label(label_match);

    }

    gen_mov_fp2fp(s, type, rd, rn);

    if (cond < 0x0e) { /* continue */

        gen_set_label(label_continue);

    }

}


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

 {

+#if CONFIG_NETWORK

     int ret;

int avformat_network_init(void)

{

#if CONFIG_NETWORK

    int ret;

    ff_network_inited_globally = 1;

    if ((ret = ff_network_init()) < 0)

        return ret;

    ff_tls_init();

#endif

    return 0;

}


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

     memcpy(&val, (void *)((uint8_t *)adev->msix_table + addr), size);
+
+
+
+    return val;

 }

assigned_dev_msix_mmio_read(void *opaque, target_phys_addr_t addr,

                            unsigned size)

{

    AssignedDevice *adev = opaque;

    uint64_t val;

    memcpy(&val, (void *)((uint8_t *)adev->msix_table + addr), size);

    return val;

}


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

+        /* Choose VTY with lowest reg value */
+
+        if (sdev->reg < selected->reg) {
+
+            selected = sdev;

         }

VIOsPAPRDevice *spapr_vty_get_default(VIOsPAPRBus *bus)

{

    VIOsPAPRDevice *sdev, *selected;

    DeviceState *iter;

    /*

     * To avoid the console bouncing around we want one VTY to be

     * the "default". We haven't really got anything to go on, so

     * arbitrarily choose the one with the lowest reg value.

     */

    selected = NULL;

    QTAILQ_FOREACH(iter, &bus->bus.children, sibling) {

        /* Only look at VTY devices */

        if (qdev_get_info(iter) != &spapr_vty_info.qdev) {

            continue;

        }

        sdev = DO_UPCAST(VIOsPAPRDevice, qdev, iter);

        /* First VTY we've found, so it is selected for now */

        if (!selected) {

            selected = sdev;

            continue;

        }

        /* Choose VTY with lowest reg value */

        if (sdev->reg < selected->reg) {

            selected = sdev;

        }

    }

    return selected;

}


static void mpeg_decode_quant_matrix_extension(MpegEncContext *s)

{

    int i, v, j;

    dprintf("matrix extension\n");

    if (get_bits1(&s->gb)) {

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

            v = get_bits(&s->gb, 8);

            j = zigzag_direct[i];

            s->intra_matrix[j] = v;

            s->chroma_intra_matrix[j] = v;

        }

    }

    if (get_bits1(&s->gb)) {

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

            v = get_bits(&s->gb, 8);

            j = zigzag_direct[i];

            s->non_intra_matrix[j] = v;

            s->chroma_non_intra_matrix[j] = v;

        }

    }

    if (get_bits1(&s->gb)) {

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

            v = get_bits(&s->gb, 8);

            j = zigzag_direct[i];

            s->chroma_intra_matrix[j] = v;

        }

    }

    if (get_bits1(&s->gb)) {

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

            v = get_bits(&s->gb, 8);

            j = zigzag_direct[i];

            s->chroma_non_intra_matrix[j] = v;

        }

    }

}


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

     int x, y;

+    pixel *src          = (pixel *)_src;

     ptrdiff_t srcstride = _srcstride / sizeof(pixel);

static void FUNC(put_hevc_pel_bi_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,

                                           int16_t *src2,

                                           int height, int denom, int wx0, int wx1,

                                           int ox0, int ox1, intptr_t mx, intptr_t my, int width)

{

    int x, y;

    pixel *src          = (pixel *)_src;

    ptrdiff_t srcstride = _srcstride / sizeof(pixel);

    pixel *dst          = (pixel *)_dst;

    ptrdiff_t dststride = _dststride / sizeof(pixel);

    int shift = 14  + 1 - BIT_DEPTH;

    int log2Wd = denom + shift - 1;

    ox0     = ox0 * (1 << (BIT_DEPTH - 8));

    ox1     = ox1 * (1 << (BIT_DEPTH - 8));

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

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

            dst[x] = av_clip_pixel(( (src[x] << (14 - BIT_DEPTH)) * wx1 + src2[x] * wx0 + ((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1));

        }

        src  += srcstride;

        dst  += dststride;

        src2 += MAX_PB_SIZE;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static ExitStatus trans_fop_ded(DisasContext *ctx, uint32_t insn,

                                 const DisasInsn *di)
+
 {

     unsigned rt = extract32(insn, 0, 5);

static ExitStatus trans_fop_ded(DisasContext *ctx, uint32_t insn,

                                const DisasInsn *di)

{

    unsigned rt = extract32(insn, 0, 5);

    unsigned ra = extract32(insn, 21, 5);

    return do_fop_ded(ctx, rt, ra, di->f_ded);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+void cpu_breakpoint_remove_all(CPUState *cpu, int mask)
+
+{
+
+#if defined(TARGET_HAS_ICE)

     CPUBreakpoint *bp, *next;

void cpu_breakpoint_remove_all(CPUState *cpu, int mask)

{

#if defined(TARGET_HAS_ICE)

    CPUBreakpoint *bp, *next;

    QTAILQ_FOREACH_SAFE(bp, &cpu->breakpoints, entry, next) {

        if (bp->flags & mask) {

            cpu_breakpoint_remove_by_ref(cpu, bp);

        }

    }

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)

 {
+
+    if(st->codec->codec_id == CODEC_ID_PROBE){
+
+        AVProbeData *pd = &st->probe_data;
+
         av_log(s, AV_LOG_DEBUG, "probing stream %d\n", st->index);

         --st->probe_packets;

static void probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)

{

    if(st->codec->codec_id == CODEC_ID_PROBE){

        AVProbeData *pd = &st->probe_data;

        av_log(s, AV_LOG_DEBUG, "probing stream %d\n", st->index);

        --st->probe_packets;

        pd->buf = av_realloc(pd->buf, pd->buf_size+pkt->size+AVPROBE_PADDING_SIZE);

        memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size);

        pd->buf_size += pkt->size;

        memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE);

        if(av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)){

            //FIXME we do not reduce score to 0 for the case of running out of buffer space in bytes

            set_codec_from_probe_data(s, st, pd, st->probe_packets > 0 ? AVPROBE_SCORE_MAX/4 : 0);

            if(st->codec->codec_id != CODEC_ID_PROBE){

                pd->buf_size=0;

                av_freep(&pd->buf);

                av_log(s, AV_LOG_DEBUG, "probed stream %d\n", st->index);

            }

        }

    }

}


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

 {

+    if (use_icount) {
+
         return cpu_get_icount();
+
+    }
+
+    if (!timers_state.cpu_ticks_enabled) {

+        return timers_state.cpu_ticks_offset;
+
     } else {

         int64_t ticks;

int64_t cpu_get_ticks(void)

{

    if (use_icount) {

        return cpu_get_icount();

    }

    if (!timers_state.cpu_ticks_enabled) {

        return timers_state.cpu_ticks_offset;

    } else {

        int64_t ticks;

        ticks = cpu_get_real_ticks();

        if (timers_state.cpu_ticks_prev > ticks) {

            /* Note: non increasing ticks may happen if the host uses

               software suspend */

            timers_state.cpu_ticks_offset += timers_state.cpu_ticks_prev - ticks;

        }

        timers_state.cpu_ticks_prev = ticks;

        return ticks + timers_state.cpu_ticks_offset;

    }

}


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

+
+    if (ARCH_X86) ff_vp9dsp_init_x86(dsp, bpp, bitexact);
+
+    if (ARCH_MIPS) ff_vp9dsp_init_mips(dsp, bpp);
+
 }

av_cold void ff_vp9dsp_init(VP9DSPContext *dsp, int bpp, int bitexact)

{

    if (bpp == 8) {

        ff_vp9dsp_init_8(dsp);

    } else if (bpp == 10) {

        ff_vp9dsp_init_10(dsp);

    } else {

        av_assert0(bpp == 12);

        ff_vp9dsp_init_12(dsp);

    }

    if (ARCH_X86) ff_vp9dsp_init_x86(dsp, bpp, bitexact);

    if (ARCH_MIPS) ff_vp9dsp_init_mips(dsp, bpp);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 ISADevice *isa_create(ISABus *bus, const char *name)

+{
+
     DeviceState *dev;

ISADevice *isa_create(ISABus *bus, const char *name)

{

    DeviceState *dev;

    if (!bus) {

        hw_error("Tried to create isa device %s with no isa bus present.",

                 name);

    }

    dev = qdev_create(BUS(bus), name);

    return ISA_DEVICE(dev);

}