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

         btn = INPUT_BUTTON_WHEEL_DOWN;

+    } else {
+
+        return TRUE;
+
+    }

static gboolean gd_scroll_event(GtkWidget *widget, GdkEventScroll *scroll,

                                void *opaque)

{

    VirtualConsole *vc = opaque;

    InputButton btn;

    if (scroll->direction == GDK_SCROLL_UP) {

        btn = INPUT_BUTTON_WHEEL_UP;

    } else if (scroll->direction == GDK_SCROLL_DOWN) {

        btn = INPUT_BUTTON_WHEEL_DOWN;

    } else {

        return TRUE;

    }

    qemu_input_queue_btn(vc->gfx.dcl.con, btn, true);

    qemu_input_event_sync();

    qemu_input_queue_btn(vc->gfx.dcl.con, btn, false);

    qemu_input_event_sync();

    return TRUE;

}


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

+        if (get_dwords(q->ehci, NLPTR_GET(qtdaddr),
+
+                       (uint32_t *) &qtd, sizeof(EHCIqtd) >> 2) < 0) {
+
+            return -1;

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

static int ehci_fill_queue(EHCIPacket *p)

{

    USBEndpoint *ep = p->packet.ep;

    EHCIQueue *q = p->queue;

    EHCIqtd qtd = p->qtd;

    uint32_t qtdaddr;

    for (;;) {

        if (NLPTR_TBIT(qtd.next) != 0) {

        qtdaddr = qtd.next;

        /*

         * Detect circular td lists, Windows creates these, counting on the

         * active bit going low after execution to make the queue stop.

         */

        QTAILQ_FOREACH(p, &q->packets, next) {

            if (p->qtdaddr == qtdaddr) {

                goto leave;

        if (get_dwords(q->ehci, NLPTR_GET(qtdaddr),

                       (uint32_t *) &qtd, sizeof(EHCIqtd) >> 2) < 0) {

            return -1;

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

        if (!(qtd.token & QTD_TOKEN_ACTIVE)) {

        p = ehci_alloc_packet(q);

        p->qtdaddr = qtdaddr;

        p->qtd = qtd;

        if (ehci_execute(p, "queue") == -1) {

            return -1;

        assert(p->packet.status == USB_RET_ASYNC);

        p->async = EHCI_ASYNC_INFLIGHT;

leave:

    usb_device_flush_ep_queue(ep->dev, ep);

    return 1;


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

 {

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

     scsi_req_ref(req);

void scsi_req_complete(SCSIRequest *req)

{

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

    scsi_req_ref(req);

    scsi_req_dequeue(req);

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

                            req->tag,

                            req->status);

    scsi_req_unref(req);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void fsl_imx25_class_init(ObjectClass *oc, void *data)
+{
     DeviceClass *dc = DEVICE_CLASS(oc);
     dc->realize = fsl_imx25_realize;
 }

static void fsl_imx25_class_init(ObjectClass *oc, void *data)
{
    DeviceClass *dc = DEVICE_CLASS(oc);
    dc->realize = fsl_imx25_realize;
}


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

     BlockDriverState *bs;

+    const char **parg;
+
+    int force;
+
+

     parg = argv + 1;

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

{

    BlockDriverState *bs;

    const char **parg;

    int force;

    parg = argv + 1;

    if (!*parg) {

    fail:

        help_cmd(argv[0]);

        return;

    }

    force = 0;

    if (!strcmp(*parg, "-f")) {

        force = 1;

        parg++;

    }

    if (!*parg)

        goto fail;

    bs = bdrv_find(*parg);

    if (!bs) {

        term_printf("device not found\n");

        return;

    }

    eject_device(bs, force);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 int bdrv_has_zero_init_1(BlockDriverState *bs)

+{

     return 1;

int bdrv_has_zero_init_1(BlockDriverState *bs)

{

    return 1;

}


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

 {
+
     blk_mig_cleanup();

 }

static void block_migration_cancel(void *opaque)

{

    blk_mig_cleanup();

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static void rm_read_metadata(AVFormatContext *s, int wide)

 {

+    char buf[1024];
+
     int i;

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

static void rm_read_metadata(AVFormatContext *s, int wide)

{

    char buf[1024];

    int i;

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

        int len = wide ? avio_rb16(s->pb) : avio_r8(s->pb);

        get_strl(s->pb, buf, sizeof(buf), len);

        av_dict_set(&s->metadata, ff_rm_metadata[i], buf, 0);

    }

}


--- a/source.c
+++ b/source.c
@@ -55,9 +55,9 @@
     if (ptrans) {

         *ptrans = translation;
+
+    }
+
+    trace_hd_geometry_guess(blk, *pcyls, *pheads, *psecs, translation);
+
 }

void hd_geometry_guess(BlockBackend *blk,

                       uint32_t *pcyls, uint32_t *pheads, uint32_t *psecs,

                       int *ptrans)

{

    int cylinders, heads, secs, translation;

    if (guess_disk_lchs(blk, &cylinders, &heads, &secs) < 0) {

        /* no LCHS guess: use a standard physical disk geometry  */

        guess_chs_for_size(blk, pcyls, pheads, psecs);

        translation = hd_bios_chs_auto_trans(*pcyls, *pheads, *psecs);

    } else if (heads > 16) {

        /* LCHS guess with heads > 16 means that a BIOS LBA

           translation was active, so a standard physical disk

           geometry is OK */

        guess_chs_for_size(blk, pcyls, pheads, psecs);

        translation = *pcyls * *pheads <= 131072

            ? BIOS_ATA_TRANSLATION_LARGE

            : BIOS_ATA_TRANSLATION_LBA;

    } else {

        /* LCHS guess with heads <= 16: use as physical geometry */

        *pcyls = cylinders;

        *pheads = heads;

        *psecs = secs;

        /* disable any translation to be in sync with

           the logical geometry */

        translation = BIOS_ATA_TRANSLATION_NONE;

    }

    if (ptrans) {

        *ptrans = translation;

    }

    trace_hd_geometry_guess(blk, *pcyls, *pheads, *psecs, translation);

}


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

     uint64_t addr;

+

     if (size % SPAPR_MEMORY_BLOCK_SIZE) {

static void spapr_memory_plug(HotplugHandler *hotplug_dev, DeviceState *dev,

                              uint32_t node, Error **errp)

{

    Error *local_err = NULL;

    sPAPRMachineState *ms = SPAPR_MACHINE(hotplug_dev);

    PCDIMMDevice *dimm = PC_DIMM(dev);

    PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);

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

    uint64_t align = memory_region_get_alignment(mr);

    uint64_t size = memory_region_size(mr);

    uint64_t addr;

    if (size % SPAPR_MEMORY_BLOCK_SIZE) {

        error_setg(&local_err, "Hotplugged memory size must be a multiple of "

                      "%lld MB", SPAPR_MEMORY_BLOCK_SIZE/M_BYTE);

        goto out;

    }

    pc_dimm_memory_plug(dev, &ms->hotplug_memory, mr, align, &local_err);

    if (local_err) {

        goto out;

    }

    addr = object_property_get_int(OBJECT(dimm), PC_DIMM_ADDR_PROP, &local_err);

    if (local_err) {

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

        goto out;

    }

    spapr_add_lmbs(dev, addr, size, node, &error_abort);

out:

    error_propagate(errp, local_err);

}


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

     TPMInfo *info = g_new0(TPMInfo, 1);

+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
     TPMIfClass *tic = TPM_IF_GET_CLASS(s->tpmif);

TPMInfo *tpm_backend_query_tpm(TPMBackend *s)

{

    TPMInfo *info = g_new0(TPMInfo, 1);

    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);

    TPMIfClass *tic = TPM_IF_GET_CLASS(s->tpmif);

    info->id = g_strdup(s->id);

    info->model = tic->model;

    if (k->get_tpm_options) {

        info->options = k->get_tpm_options(s);

    }

    return info;

}


--- a/source.c
+++ b/source.c
@@ -5,10 +5,10 @@
     TCGv_i32 tmp = tcg_const_i32(dest);

     if (((dc->pc ^ dest) & TARGET_PAGE_MASK) != 0) {
+
+        slot = -1;
+
+    }

     gen_callw_slot(dc, callinc, tmp, slot);

static void gen_callwi(DisasContext *dc, int callinc, uint32_t dest, int slot)

{

    TCGv_i32 tmp = tcg_const_i32(dest);

    if (((dc->pc ^ dest) & TARGET_PAGE_MASK) != 0) {

        slot = -1;

    }

    gen_callw_slot(dc, callinc, tmp, slot);

    tcg_temp_free(tmp);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static size_t curl_size_cb(void *ptr, size_t size, size_t nmemb, void *opaque)
+
 {
+
+    CURLState *s = ((CURLState*)opaque);
+
     size_t realsize = size * nmemb;

     size_t fsize;

static size_t curl_size_cb(void *ptr, size_t size, size_t nmemb, void *opaque)

{

    CURLState *s = ((CURLState*)opaque);

    size_t realsize = size * nmemb;

    size_t fsize;

    if(sscanf(ptr, "Content-Length: %zd", &fsize) == 1) {

        s->s->len = fsize;

    }

    return realsize;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void decode_opc_special3(CPUMIPSState *env, DisasContext *ctx)
 {
+    int rs, rt, rd, sa;
+    uint32_t op1, op2;
+    rs = (ctx->opcode >> 21) & 0x1f;
+    rt = (ctx->opcode >> 16) & 0x1f;
+    rd = (ctx->opcode >> 11) & 0x1f;
     sa = (ctx->opcode >> 6) & 0x1f;
     op1 = MASK_SPECIAL3(ctx->opcode);
     case OPC_EXT:

static void decode_opc_special3(CPUMIPSState *env, DisasContext *ctx)
{
    int rs, rt, rd, sa;
    uint32_t op1, op2;
    rs = (ctx->opcode >> 21) & 0x1f;
    rt = (ctx->opcode >> 16) & 0x1f;
    rd = (ctx->opcode >> 11) & 0x1f;
    sa = (ctx->opcode >> 6) & 0x1f;
    op1 = MASK_SPECIAL3(ctx->opcode);
    case OPC_EXT:
    case OPC_INS:
        check_insn(ctx, ISA_MIPS32R2);
        gen_bitops(ctx, op1, rt, rs, sa, rd);
        break;
    case OPC_BSHFL:
        op2 = MASK_BSHFL(ctx->opcode);
        switch (op2) {
        case OPC_ALIGN ... OPC_ALIGN_END:
        case OPC_BITSWAP:
            check_insn(ctx, ISA_MIPS32R6);
            decode_opc_special3_r6(env, ctx);
            break;
        default:
            check_insn(ctx, ISA_MIPS32R2);
            gen_bshfl(ctx, op2, rt, rd);
            break;
        break;
#if defined(TARGET_MIPS64)
    case OPC_DEXTM ... OPC_DEXT:
    case OPC_DINSM ... OPC_DINS:
        check_insn(ctx, ISA_MIPS64R2);
        check_mips_64(ctx);
        gen_bitops(ctx, op1, rt, rs, sa, rd);
        break;
    case OPC_DBSHFL:
        op2 = MASK_DBSHFL(ctx->opcode);
        switch (op2) {
        case OPC_DALIGN ... OPC_DALIGN_END:
        case OPC_DBITSWAP:
            check_insn(ctx, ISA_MIPS32R6);
            decode_opc_special3_r6(env, ctx);
            break;
        default:
            check_insn(ctx, ISA_MIPS64R2);
            check_mips_64(ctx);
            op2 = MASK_DBSHFL(ctx->opcode);
            gen_bshfl(ctx, op2, rt, rd);
            break;
        break;
#endif
    case OPC_RDHWR:
        gen_rdhwr(ctx, rt, rd, extract32(ctx->opcode, 6, 3));
        break;
    case OPC_FORK:
        check_insn(ctx, ASE_MT);
        {
            TCGv t0 = tcg_temp_new();
            TCGv t1 = tcg_temp_new();
            gen_load_gpr(t0, rt);
            gen_load_gpr(t1, rs);
            gen_helper_fork(t0, t1);
            tcg_temp_free(t0);
            tcg_temp_free(t1);
        break;
    case OPC_YIELD:
        check_insn(ctx, ASE_MT);
        {
            TCGv t0 = tcg_temp_new();
            gen_load_gpr(t0, rs);
            gen_helper_yield(t0, cpu_env, t0);
            gen_store_gpr(t0, rd);
            tcg_temp_free(t0);
        break;
    default:
        if (ctx->insn_flags & ISA_MIPS32R6) {
            decode_opc_special3_r6(env, ctx);
        } else {
            decode_opc_special3_legacy(env, ctx);


--- a/source.c
+++ b/source.c
@@ -1,16 +1,16 @@
 static int check_protocol_support(bool *has_ipv4, bool *has_ipv6)
+
+{
+
+    struct sockaddr_in sin = {
+
+        .sin_family = AF_INET,
+
         .sin_addr = { .s_addr = htonl(INADDR_LOOPBACK) },
+
     };

+    struct sockaddr_in6 sin6 = {

         .sin6_family = AF_INET6,

static int check_protocol_support(bool *has_ipv4, bool *has_ipv6)

{

    struct sockaddr_in sin = {

        .sin_family = AF_INET,

        .sin_addr = { .s_addr = htonl(INADDR_LOOPBACK) },

    };

    struct sockaddr_in6 sin6 = {

        .sin6_family = AF_INET6,

        .sin6_addr = IN6ADDR_LOOPBACK_INIT,

    };

    if (check_bind((struct sockaddr *)&sin, sizeof(sin), has_ipv4) < 0) {

        return -1;

    }

    if (check_bind((struct sockaddr *)&sin6, sizeof(sin6), has_ipv6) < 0) {

        return -1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void qpci_pc_config_writeb(QPCIBus *bus, int devfn, uint8_t offset, uint8_t value)
+
 {

     outl(0xcf8, (1 << 31) | (devfn << 8) | offset);

static void qpci_pc_config_writeb(QPCIBus *bus, int devfn, uint8_t offset, uint8_t value)

{

    outl(0xcf8, (1 << 31) | (devfn << 8) | offset);

    outb(0xcfc, value);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+Aml *aml_shiftright(Aml *arg1, Aml *count)
+
+{

     Aml *var = aml_opcode(0x7A /* ShiftRightOp */);

Aml *aml_shiftright(Aml *arg1, Aml *count)

{

    Aml *var = aml_opcode(0x7A /* ShiftRightOp */);

    aml_append(var, arg1);

    aml_append(var, count);

    build_append_byte(var->buf, 0x00); /* NullNameOp */

    return var;

}


static inline void h264_loop_filter_chroma_c(uint8_t *pix, int xstride, int ystride, int alpha, int beta, int8_t *tc0)

{

    int i, d;

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

        const int tc = tc0[i];

        if( tc <= 0 ) {

            pix += 2*ystride;

            continue;

        }

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

            const int p0 = pix[-1*xstride];

            const int p1 = pix[-2*xstride];

            const int q0 = pix[0];

            const int q1 = pix[1*xstride];

            if( FFABS( p0 - q0 ) < alpha &&

                FFABS( p1 - p0 ) < beta &&

                FFABS( q1 - q0 ) < beta ) {

                int delta = av_clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );

                pix[-xstride] = av_clip_uint8( p0 + delta );    /* p0' */

                pix[0]        = av_clip_uint8( q0 - delta );    /* q0' */

            }

            pix += ystride;

        }

    }

}


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

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


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     BusClass *bc = BUS_GET_CLASS(bus);

     Error *local_err = NULL;
+

     if (value && !bus->realized) {

static void bus_set_realized(Object *obj, bool value, Error **errp)

{

    BusState *bus = BUS(obj);

    BusClass *bc = BUS_GET_CLASS(bus);

    Error *local_err = NULL;

    if (value && !bus->realized) {

        if (bc->realize) {

            bc->realize(bus, &local_err);

        }

    } else if (!value && bus->realized) {

        if (bc->unrealize) {

            bc->unrealize(bus, &local_err);

        }

    }

    if (local_err != NULL) {

        error_propagate(errp, local_err);

        return;

    }

    bus->realized = value;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 int ff_j2k_dwt_init(DWTContext *s, uint16_t border[2][2], int decomp_levels, int type)

+{

     int i, j, lev = decomp_levels, maxlen,

int ff_j2k_dwt_init(DWTContext *s, uint16_t border[2][2], int decomp_levels, int type)

{

    int i, j, lev = decomp_levels, maxlen,

        b[2][2];

    if (decomp_levels >= FF_DWT_MAX_DECLVLS)

        return AVERROR_INVALIDDATA;

    s->ndeclevels = decomp_levels;

    s->type = type;

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

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

            b[i][j] = border[i][j];

    maxlen = FFMAX(b[0][1] - b[0][0],

                   b[1][1] - b[1][0]);

    while(--lev >= 0){

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

            s->linelen[lev][i] = b[i][1] - b[i][0];

            s->mod[lev][i] = b[i][0] & 1;

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

                b[i][j] = (b[i][j] + 1) >> 1;

        }

    }

    if (type == FF_DWT97)

        s->linebuf = av_malloc((maxlen + 12) * sizeof(float));

    else if (type == FF_DWT53)

        s->linebuf = av_malloc((maxlen + 6) * sizeof(int));

    else

        return -1;

    if (!s->linebuf)

        return AVERROR(ENOMEM);

    return 0;

}


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

                                 unsigned len)

+{

     OpenPICState *opp = opaque;

static void openpic_tmr_write(void *opaque, hwaddr addr, uint64_t val,

                                unsigned len)

{

    OpenPICState *opp = opaque;

    int idx;

    DPRINTF("%s: addr %08x <= %08x\n", __func__, addr, val);

    if (addr & 0xF)

        return;

    idx = (addr >> 6) & 0x3;

    addr = addr & 0x30;

    if (addr == 0x0) {

        /* TIFR (TFRR) */

        opp->tifr = val;

        return;

    }

    switch (addr & 0x30) {

    case 0x00: /* TICC (GTCCR) */

        break;

    case 0x10: /* TIBC (GTBCR) */

        if ((opp->timers[idx].ticc & TICC_TOG) != 0 &&

            (val & TIBC_CI) == 0 &&

            (opp->timers[idx].tibc & TIBC_CI) != 0) {

            opp->timers[idx].ticc &= ~TICC_TOG;

        }

        opp->timers[idx].tibc = val;

        break;

    case 0x20: /* TIVP (GTIVPR) */

        write_IRQreg_ipvp(opp, opp->irq_tim0 + idx, val);

        break;

    case 0x30: /* TIDE (GTIDR) */

        write_IRQreg_ide(opp, opp->irq_tim0 + idx, val);

        break;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 bool arm_regime_using_lpae_format(CPUARMState *env, ARMMMUIdx mmu_idx)
+
 {

     return regime_using_lpae_format(env, mmu_idx);

bool arm_regime_using_lpae_format(CPUARMState *env, ARMMMUIdx mmu_idx)

{

    return regime_using_lpae_format(env, mmu_idx);

}


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

 {

static void qmp_input_pop(QmpInputVisitor *qiv, Error **errp)

{

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

    assert(qiv->nb_stack > 0);

    if (qiv->strict) {

        GHashTable *const top_ht = tos->h;

        if (top_ht) {

            GHashTableIter iter;

            const char *key;

            g_hash_table_iter_init(&iter, top_ht);

            if (g_hash_table_iter_next(&iter, (void **)&key, NULL)) {

                error_setg(errp, QERR_QMP_EXTRA_MEMBER, key);

            }

            g_hash_table_unref(top_ht);

        }

        tos->h = NULL;

    }

    qiv->nb_stack--;

}


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

     address_space_rw(as, addr, buf, len, false);
+
 }

void address_space_read(AddressSpace *as, target_phys_addr_t addr, uint8_t *buf, int len)

{

    address_space_rw(as, addr, buf, len, false);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void qfloat_destroy_obj(QObject *obj)
+
 {

     assert(obj != NULL);

static void qfloat_destroy_obj(QObject *obj)

{

    assert(obj != NULL);

    g_free(qobject_to_qfloat(obj));

}


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

     s->irq_enabled = 0;

+    s->oldclock = 0;

     s->clock = 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->base = base;

    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(0, pxa2xx_timer_readfn,

                    pxa2xx_timer_writefn, s);

    cpu_register_physical_memory(base, 0x00000fff, iomemtype);

    register_savevm("pxa2xx_timer", 0, 0,

                    pxa2xx_timer_save, pxa2xx_timer_load, s);

    return s;

}


--- a/source.c
+++ b/source.c
@@ -1,17 +1,17 @@
 void net_cleanup(void)
+
 {
+
+#if !defined(_WIN32)
+
+    VLANState *vlan;
+

+
+    /* close network clients */
+
     for(vlan = first_vlan; vlan != NULL; vlan = vlan->next) {
+
         VLANClientState *vc;

void net_cleanup(void)

{

#if !defined(_WIN32)

    VLANState *vlan;

    /* close network clients */

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

        VLANClientState *vc;

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

            if (vc->fd_read == tap_receive) {

                TAPState *s = vc->opaque;

                if (s->down_script[0])

                    launch_script(s->down_script, s->down_script_arg, s->fd);

            }

#if defined(CONFIG_VDE)

            if (vc->fd_read == vde_from_qemu) {

                VDEState *s = vc->opaque;

                vde_close(s->vde);

            }

#endif

        }

    }

#endif

}


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

     const char *ptr     = p->buf;

+    const char *ptr_end = p->buf + p->buf_size;

static int mpsub_probe(AVProbeData *p)

{

    const char *ptr     = p->buf;

    const char *ptr_end = p->buf + p->buf_size;

    while (ptr < ptr_end) {

        if (!memcmp(ptr, "FORMAT=TIME", 11))

            return AVPROBE_SCORE_EXTENSION;

        if (!memcmp(ptr, "FORMAT=", 7))

            return AVPROBE_SCORE_EXTENSION / 3;

        ptr += strcspn(ptr, "\n") + 1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static uint64_t bonito_cop_readl(void *opaque, hwaddr addr,
                                  unsigned size)
 {
     uint32_t val;

static uint64_t bonito_cop_readl(void *opaque, hwaddr addr,
                                 unsigned size)
{
    uint32_t val;
    PCIBonitoState *s = opaque;
    val = ((uint32_t *)(&s->boncop))[addr/sizeof(uint32_t)];
    return val;


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void stream_pause(VideoState *is)
+
+{

+    is->paused = !is->paused;

+    if (!is->paused) {
+
         if(is->read_pause_return != AVERROR(ENOSYS)){

             is->video_current_pts = get_video_clock(is);

static void stream_pause(VideoState *is)

{

    is->paused = !is->paused;

    if (!is->paused) {

        if(is->read_pause_return != AVERROR(ENOSYS)){

            is->video_current_pts = get_video_clock(is);

        }

        is->frame_timer += (av_gettime() - is->video_current_pts_time) / 1000000.0;

        is->video_current_pts_time= av_gettime();

    }

}


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

     src |= a2 & ~TARGET_PAGE_MASK;

+
+
+    /* XXX replace w/ memcpy */
+
+    for (i = 0; i < l; i++) {

         /* XXX be more clever */

static uint32_t mvc_asc(CPUS390XState *env, int64_t l, uint64_t a1,

                        uint64_t mode1, uint64_t a2, uint64_t mode2)

{

    CPUState *cs = CPU(s390_env_get_cpu(env));

    target_ulong src, dest;

    int flags, cc = 0, i;

    if (!l) {

        return 0;

    } else if (l > 256) {

        /* max 256 */

        l = 256;

        cc = 3;

    }

    if (mmu_translate(env, a1, 1, mode1, &dest, &flags, true)) {

        cpu_loop_exit(CPU(s390_env_get_cpu(env)));

    }

    dest |= a1 & ~TARGET_PAGE_MASK;

    if (mmu_translate(env, a2, 0, mode2, &src, &flags, true)) {

        cpu_loop_exit(CPU(s390_env_get_cpu(env)));

    }

    src |= a2 & ~TARGET_PAGE_MASK;

    /* XXX replace w/ memcpy */

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

        /* XXX be more clever */

        if ((((dest + i) & TARGET_PAGE_MASK) != (dest & TARGET_PAGE_MASK)) ||

            (((src + i) & TARGET_PAGE_MASK) != (src & TARGET_PAGE_MASK))) {

            mvc_asc(env, l - i, a1 + i, mode1, a2 + i, mode2);

            break;

        }

        stb_phys(cs->as, dest + i, ldub_phys(cs->as, src + i));

    }

    return cc;

}


--- a/source.c
+++ b/source.c
@@ -29,11 +29,11 @@
         qemu_put_be32s (f, &r->bdbar);

         qemu_put_8s (f, &r->civ);
+
+        qemu_put_8s (f, &r->lvi);
+
+        qemu_put_be16s (f, &r->sr);
+
         qemu_put_be16s (f, &r->picb);

         qemu_put_8s (f, &r->piv);

static void ac97_save (QEMUFile *f, void *opaque)

{

    size_t i;

    uint8_t active[LAST_INDEX];

    AC97LinkState *s = opaque;

    pci_device_save (s->pci_dev, f);

    qemu_put_be32s (f, &s->glob_cnt);

    qemu_put_be32s (f, &s->glob_sta);

    qemu_put_be32s (f, &s->cas);

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

        AC97BusMasterRegs *r = &s->bm_regs[i];

        qemu_put_be32s (f, &r->bdbar);

        qemu_put_8s (f, &r->civ);

        qemu_put_8s (f, &r->lvi);

        qemu_put_be16s (f, &r->sr);

        qemu_put_be16s (f, &r->picb);

        qemu_put_8s (f, &r->piv);

        qemu_put_8s (f, &r->cr);

        qemu_put_be32s (f, &r->bd_valid);

        qemu_put_be32s (f, &r->bd.addr);

        qemu_put_be32s (f, &r->bd.ctl_len);

    }

    qemu_put_buffer (f, s->mixer_data, sizeof (s->mixer_data));

    active[PI_INDEX] = AUD_is_active_in (s->voice_pi) ? 1 : 0;

    active[PO_INDEX] = AUD_is_active_out (s->voice_po) ? 1 : 0;

    active[MC_INDEX] = AUD_is_active_in (s->voice_mc) ? 1 : 0;

    qemu_put_buffer (f, active, sizeof (active));

}


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

     hwctx_dec = av_qsv_alloc_context();

+    if (!hwctx_dec)
+
+        return AVERROR(ENOMEM);
+
+

     hwctx_dec->session        = qsv->session;

int qsv_init(AVCodecContext *s)

{

    InputStream *ist = s->opaque;

    QSVContext  *qsv = ist->hwaccel_ctx;

    AVQSVContext *hwctx_dec;

    int ret;

    if (!qsv) {

        av_log(NULL, AV_LOG_ERROR, "QSV transcoding is not initialized. "

               "-hwaccel qsv should only be used for one-to-one QSV transcoding "

               "with no filters.\n");

        return AVERROR_BUG;

    }

    ret = init_opaque_surf(qsv);

    if (ret < 0)

        return ret;

    hwctx_dec = av_qsv_alloc_context();

    if (!hwctx_dec)

        return AVERROR(ENOMEM);

    hwctx_dec->session        = qsv->session;

    hwctx_dec->iopattern      = MFX_IOPATTERN_OUT_OPAQUE_MEMORY;

    hwctx_dec->ext_buffers    = qsv->ext_buffers;

    hwctx_dec->nb_ext_buffers = FF_ARRAY_ELEMS(qsv->ext_buffers);

    av_freep(&s->hwaccel_context);

    s->hwaccel_context = hwctx_dec;

    ist->hwaccel_get_buffer = qsv_get_buffer;

    ist->hwaccel_uninit     = qsv_uninit;

    return 0;

}


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

     RTSPState *rt = s->priv_data;
+
     int idx       = 0;

     int ret       = 0;

static inline int read_line(AVFormatContext *s, char *rbuf, const int rbufsize,

                            int *rbuflen)

{

    RTSPState *rt = s->priv_data;

    int idx       = 0;

    int ret       = 0;

    *rbuflen      = 0;

    do {

        ret = ffurl_read_complete(rt->rtsp_hd, rbuf + idx, 1);

        if (ret < 0)

            return ret;

        if (rbuf[idx] == '\r') {

            /* Ignore */

        } else if (rbuf[idx] == '\n') {

            rbuf[idx] = '\0';

            *rbuflen  = idx;

            return 0;

        } else

            idx++;

    } while (idx < rbufsize);

    av_log(s, AV_LOG_ERROR, "Message too long\n");

    return AVERROR(EIO);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+int net_init_vde(QemuOpts *opts, const char *name, VLANState *vlan)

 {

@@ -7,7 +7,7 @@
     const char *group;

     int port, mode;
+

     sock  = qemu_opt_get(opts, "sock");

int net_init_vde(QemuOpts *opts, const char *name, VLANState *vlan)

{

    const char *sock;

    const char *group;

    int port, mode;

    sock  = qemu_opt_get(opts, "sock");

    group = qemu_opt_get(opts, "group");

    port = qemu_opt_get_number(opts, "port", 0);

    mode = qemu_opt_get_number(opts, "mode", 0700);

    if (net_vde_init(vlan, "vde", name, sock, port, group, mode) == -1) {

        return -1;

    }

    return 0;

}


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

 #ifdef HAS_AUDIO

+    return 1;
+
+#else

     return 0;

int audio_available(void)

{

#ifdef HAS_AUDIO

    return 1;

#else

    return 0;

#endif

}


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

+    memory_region_init_io(&s->iomem, &omap_lpg_ops, s, "omap-lpg", 0x800);
+
+    memory_region_add_subregion(system_memory, base, &s->iomem);
+
+

     omap_clk_adduser(clk, qemu_allocate_irqs(omap_lpg_clk_update, s, 1)[0]);

static struct omap_lpg_s *omap_lpg_init(MemoryRegion *system_memory,

                                        target_phys_addr_t base, omap_clk clk)

{

    struct omap_lpg_s *s = (struct omap_lpg_s *)

            g_malloc0(sizeof(struct omap_lpg_s));

    s->tm = qemu_new_timer_ms(vm_clock, omap_lpg_tick, s);

    omap_lpg_reset(s);

    memory_region_init_io(&s->iomem, &omap_lpg_ops, s, "omap-lpg", 0x800);

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

    omap_clk_adduser(clk, qemu_allocate_irqs(omap_lpg_clk_update, s, 1)[0]);

    return s;

}


--- a/source.c
+++ b/source.c
@@ -1,19 +1,19 @@
+DISAS_INSN(shift_im)
+
+{
+
     TCGv reg;
+
+    int tmp;
+
+    TCGv shift;
+
+

+    set_cc_op(s, CC_OP_FLAGS);
+

+
     reg = DREG(insn, 0);

     tmp = (insn >> 9) & 7;

DISAS_INSN(shift_im)

{

    TCGv reg;

    int tmp;

    TCGv shift;

    set_cc_op(s, CC_OP_FLAGS);

    reg = DREG(insn, 0);

    tmp = (insn >> 9) & 7;

    if (tmp == 0)

        tmp = 8;

    shift = tcg_const_i32(tmp);

    /* No need to flush flags becuse we know we will set C flag.  */

    if (insn & 0x100) {

        gen_helper_shl_cc(reg, cpu_env, reg, shift);

    } else {

        if (insn & 8) {

            gen_helper_shr_cc(reg, cpu_env, reg, shift);

        } else {

            gen_helper_sar_cc(reg, cpu_env, reg, shift);

        }

    }

}


--- 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
@@ -9,11 +9,11 @@
     wt2 = float32_to_int32(fst0, &env->active_fpu.fp_status);

     update_fcr31(env, GETPC());
+
+    if (get_float_exception_flags(&env->active_fpu.fp_status)
+
+        & (float_flag_invalid | float_flag_overflow)) {
+
         wt2 = FP_TO_INT32_OVERFLOW;

     }

uint32_t helper_float_cvtw_s(CPUMIPSState *env, uint32_t fst0)

{

    uint32_t wt2;

    wt2 = float32_to_int32(fst0, &env->active_fpu.fp_status);

    update_fcr31(env, GETPC());

    if (get_float_exception_flags(&env->active_fpu.fp_status)

        & (float_flag_invalid | float_flag_overflow)) {

        wt2 = FP_TO_INT32_OVERFLOW;

    }

    return wt2;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     int old_mask;

+
+    old_mask = env->interrupt_request;
+
+    env->interrupt_request |= mask;
+

 #ifndef CONFIG_USER_ONLY

void cpu_interrupt(CPUState *env, int mask)

{

    int old_mask;

    old_mask = env->interrupt_request;

    env->interrupt_request |= mask;

#ifndef CONFIG_USER_ONLY

    /*

     * If called from iothread context, wake the target cpu in

     * case its halted.

     */

    if (!qemu_cpu_self(env)) {

        qemu_cpu_kick(env);

        return;

    }

#endif

    if (use_icount) {

        env->icount_decr.u16.high = 0xffff;

#ifndef CONFIG_USER_ONLY

        if (!can_do_io(env)

            && (mask & ~old_mask) != 0) {

            cpu_abort(env, "Raised interrupt while not in I/O function");

        }

#endif

    } else {

        cpu_unlink_tb(env);

    }

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
 #if SPICE_INTERFACE_QXL_MINOR >= 1

         spice_qxl_add_memslot_async(&ssd->qxl, memslot, 0);
+
+#else
+
+        abort();
+
 #endif

     } else {

void qemu_spice_add_memslot(SimpleSpiceDisplay *ssd, QXLDevMemSlot *memslot,

                            qxl_async_io async)

{

    if (async != QXL_SYNC) {

#if SPICE_INTERFACE_QXL_MINOR >= 1

        spice_qxl_add_memslot_async(&ssd->qxl, memslot, 0);

#else

        abort();

#endif

    } else {

        ssd->worker->add_memslot(ssd->worker, memslot);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void bdrv_io_limits_enable(BlockDriverState *bs)

+{
+
     qemu_co_queue_init(&bs->throttled_reqs);

     bs->block_timer = qemu_new_timer_ns(vm_clock, bdrv_block_timer, bs);

void bdrv_io_limits_enable(BlockDriverState *bs)

{

    qemu_co_queue_init(&bs->throttled_reqs);

    bs->block_timer = qemu_new_timer_ns(vm_clock, bdrv_block_timer, bs);

    bs->io_limits_enabled = true;

}


--- a/source.c
+++ b/source.c
@@ -4,10 +4,10 @@
     PCIDevice *d = PCI_DEVICE(s);
     vmxnet_tx_pkt_init(&s->tx_pkt, s->max_tx_frags, s->peer_has_vhdr);
     vmxnet_rx_pkt_init(&s->rx_pkt, s->peer_has_vhdr);
+    if (s->msix_used) {
+        if  (!vmxnet3_use_msix_vectors(s, VMXNET3_MAX_INTRS)) {
+            VMW_WRPRN("Failed to re-use MSI-X vectors");
+            msix_uninit(d, &s->msix_bar, &s->msix_bar);
             s->msix_used = false;
             return -1;
         }

static int vmxnet3_post_load(void *opaque, int version_id)
{
    VMXNET3State *s = opaque;
    PCIDevice *d = PCI_DEVICE(s);
    vmxnet_tx_pkt_init(&s->tx_pkt, s->max_tx_frags, s->peer_has_vhdr);
    vmxnet_rx_pkt_init(&s->rx_pkt, s->peer_has_vhdr);
    if (s->msix_used) {
        if  (!vmxnet3_use_msix_vectors(s, VMXNET3_MAX_INTRS)) {
            VMW_WRPRN("Failed to re-use MSI-X vectors");
            msix_uninit(d, &s->msix_bar, &s->msix_bar);
            s->msix_used = false;
            return -1;
        }
    }
    return 0;
}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
                                    table_data, &tcpa->log_area_start_address,

                                    sizeof(tcpa->log_area_start_address));
+
+
+
+    build_header(linker, table_data,
+
                  (void *)tcpa, "TCPA", sizeof(*tcpa), 2, NULL);

build_tpm_tcpa(GArray *table_data, GArray *linker, GArray *tcpalog)

{

    Acpi20Tcpa *tcpa = acpi_data_push(table_data, sizeof *tcpa);

    uint64_t log_area_start_address = acpi_data_len(tcpalog);

    tcpa->platform_class = cpu_to_le16(TPM_TCPA_ACPI_CLASS_CLIENT);

    tcpa->log_area_minimum_length = cpu_to_le32(TPM_LOG_AREA_MINIMUM_SIZE);

    tcpa->log_area_start_address = cpu_to_le64(log_area_start_address);

    bios_linker_loader_alloc(linker, ACPI_BUILD_TPMLOG_FILE, 1,

                             false /* high memory */);

    /* log area start address to be filled by Guest linker */

    bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE,

                                   ACPI_BUILD_TPMLOG_FILE,

                                   table_data, &tcpa->log_area_start_address,

                                   sizeof(tcpa->log_area_start_address));

    build_header(linker, table_data,

                 (void *)tcpa, "TCPA", sizeof(*tcpa), 2, NULL);

    acpi_data_push(tcpalog, TPM_LOG_AREA_MINIMUM_SIZE);

}


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

     return qemu_paio_submit(aiocb, QEMU_PAIO_IOCTL);
+
 }

int qemu_paio_ioctl(struct qemu_paiocb *aiocb)

{

    return qemu_paio_submit(aiocb, QEMU_PAIO_IOCTL);

}


--- a/source.c
+++ b/source.c
@@ -1,18 +1,18 @@
 static void trace(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3,
+
                   uint64_t x4, uint64_t x5, uint64_t x6)

 {
+
+    TraceRecord *rec = &trace_buf[trace_idx];
+
+
+
+    if (!trace_list[event].state) {
+
+        return;
+
+    }

static void trace(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3,

                  uint64_t x4, uint64_t x5, uint64_t x6)

{

    TraceRecord *rec = &trace_buf[trace_idx];

    if (!trace_list[event].state) {

        return;

    }

    rec->event = event;

    rec->timestamp_ns = get_clock();

    rec->x1 = x1;

    rec->x2 = x2;

    rec->x3 = x3;

    rec->x4 = x4;

    rec->x5 = x5;

    rec->x6 = x6;

    if (++trace_idx == TRACE_BUF_LEN) {

        st_flush_trace_buffer();

    }

}


--- a/source.c
+++ b/source.c
@@ -7,9 +7,9 @@
     QEDRequest *request = read_l2_table_cb->request;

     BDRVQEDState *s = read_l2_table_cb->s;
+
     CachedL2Table *l2_table = request->l2_table;
+

     if (ret) {

static void qed_read_l2_table_cb(void *opaque, int ret)

{

    QEDReadL2TableCB *read_l2_table_cb = opaque;

    QEDRequest *request = read_l2_table_cb->request;

    BDRVQEDState *s = read_l2_table_cb->s;

    CachedL2Table *l2_table = request->l2_table;

    if (ret) {

        /* can't trust loaded L2 table anymore */

        qed_unref_l2_cache_entry(l2_table);

        request->l2_table = NULL;

    } else {

        l2_table->offset = read_l2_table_cb->l2_offset;

        qed_commit_l2_cache_entry(&s->l2_cache, l2_table);

        /* This is guaranteed to succeed because we just committed the entry

         * to the cache.

         */

        request->l2_table = qed_find_l2_cache_entry(&s->l2_cache,

                                                    l2_table->offset);

        assert(request->l2_table != NULL);

    }

    gencb_complete(&read_l2_table_cb->gencb, ret);

}


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

     uint64_t subch_id = args[0];

+    uint64_t queue = args[1];
+
+    SubchDev *sch;
+
+    int cssid, ssid, schid, m;

static int virtio_ccw_hcall_notify(const uint64_t *args)

{

    uint64_t subch_id = args[0];

    uint64_t queue = args[1];

    SubchDev *sch;

    int cssid, ssid, schid, m;

    if (ioinst_disassemble_sch_ident(subch_id, &m, &cssid, &ssid, &schid)) {

    sch = css_find_subch(m, cssid, ssid, schid);

    if (!sch || !css_subch_visible(sch)) {

    virtio_queue_notify(virtio_ccw_get_vdev(sch), queue);

    return 0;


static int request_frame(AVFilterLink *outlink)

{

    AVFilterContext *ctx = outlink->src;

    TrimContext       *s = ctx->priv;

    int ret;

    s->got_output = 0;

    while (!s->got_output) {

        if (s->eof)

            return AVERROR_EOF;

        ret = ff_request_frame(ctx->inputs[0]);

        if (ret < 0)

            return ret;

    }

    return 0;

}


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

         return 0;

+    }
+
+
+
+    reg = addr >> s->it_shift;

     return read_register(s, reg);

static uint32_t dp8393x_readw(void *opaque, target_phys_addr_t addr)

{

    dp8393xState *s = opaque;

    int reg;

    if ((addr & ((1 << s->it_shift) - 1)) != 0) {

        return 0;

    }

    reg = addr >> s->it_shift;

    return read_register(s, reg);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 envlist_to_environ(const envlist_t *envlist, size_t *count)

 {
+
+	struct envlist_entry *entry;

 	char **env, **penv;
+

 	penv = env = malloc((envlist->el_count + 1) * sizeof (char *));

envlist_to_environ(const envlist_t *envlist, size_t *count)

{

	struct envlist_entry *entry;

	char **env, **penv;

	penv = env = malloc((envlist->el_count + 1) * sizeof (char *));

	if (env == NULL)

		return (NULL);

	for (entry = envlist->el_entries.lh_first; entry != NULL;

	    entry = entry->ev_link.le_next) {

		*(penv++) = strdup(entry->ev_var);

	}

	*penv = NULL; /* NULL terminate the list */

	if (count != NULL)

		*count = envlist->el_count;

	return (env);

}


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

     int ascii_diff, digit_diff;
+
+
+
+    for (; !(ascii_diff = *a - *b) && *a; a++, b++);

     for (; av_isdigit(*a) && av_isdigit(*b); a++, b++);

static int cmp_func_names(const char *a, const char *b)

{

    int ascii_diff, digit_diff;

    for (; !(ascii_diff = *a - *b) && *a; a++, b++);

    for (; av_isdigit(*a) && av_isdigit(*b); a++, b++);

    return (digit_diff = av_isdigit(*a) - av_isdigit(*b)) ? digit_diff : ascii_diff;

}


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

     uint32_t code   = AV_RL32(block + 12);

+

     extract_color(colors, color0, color1, 1, 0);

static inline void dxt3_block_internal(uint8_t *dst, ptrdiff_t stride,

                                       const uint8_t *block)

{

    int x, y;

    uint32_t colors[4];

    uint16_t color0 = AV_RL16(block +  8);

    uint16_t color1 = AV_RL16(block + 10);

    uint32_t code   = AV_RL32(block + 12);

    extract_color(colors, color0, color1, 1, 0);

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

        const uint16_t alpha_code = AV_RL16(block + 2 * y);

        uint8_t alpha_values[4];

        alpha_values[0] = ((alpha_code >>  0) & 0x0F) * 17;

        alpha_values[1] = ((alpha_code >>  4) & 0x0F) * 17;

        alpha_values[2] = ((alpha_code >>  8) & 0x0F) * 17;

        alpha_values[3] = ((alpha_code >> 12) & 0x0F) * 17;

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

            uint8_t alpha = alpha_values[x];

            uint32_t pixel = colors[code & 3] | (alpha << 24);

            code >>= 2;

            AV_WL32(dst + x * 4, pixel);

        }

        dst += stride;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,17 +1,17 @@
 static inline void RENAME(rgb32ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, int width)
+
+{
+
 	int i;
+
+        assert(src1==src2);
+
+	for(i=0; i<width; i++)
+
+	{
+
+		const int a= ((uint32_t*)src1)[2*i+0];
+
 		const int e= ((uint32_t*)src1)[2*i+1];

 		const int l= (a&0xFF00FF) + (e&0xFF00FF);

static inline void RENAME(rgb32ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, int width)

{

	int i;

        assert(src1==src2);

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

	{

		const int a= ((uint32_t*)src1)[2*i+0];

		const int e= ((uint32_t*)src1)[2*i+1];

		const int l= (a&0xFF00FF) + (e&0xFF00FF);

		const int h= (a&0x00FF00) + (e&0x00FF00);

 		const int r=  l&0x3FF;

		const int g=  h>>8;

		const int b=  l>>16;

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

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

	}

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static target_ulong put_tce_emu(sPAPRTCETable *tcet, target_ulong ioba,

                                 target_ulong tce)
+
 {

     sPAPRTCE *tcep;

static target_ulong put_tce_emu(sPAPRTCETable *tcet, target_ulong ioba,

                                target_ulong tce)

{

    sPAPRTCE *tcep;

    if (ioba >= tcet->window_size) {

        hcall_dprintf("spapr_vio_put_tce on out-of-boards IOBA 0x"

                      TARGET_FMT_lx "\n", ioba);

        return H_PARAMETER;

    }

    tcep = tcet->table + (ioba >> SPAPR_TCE_PAGE_SHIFT);

    tcep->tce = tce;

    return H_SUCCESS;

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
         f = &f1;

         if (url_fopen(f, filename, URL_RDONLY) < 0)
+
+            return -EIO;
+
+    } else {
+
         f = &s1->pb;

         if (url_feof(f))

static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)

{

    VideoData *s = s1->priv_data;

    char filename[1024];

    int ret;

    ByteIOContext f1, *f;

    if (!s->is_pipe) {

        if (get_frame_filename(filename, sizeof(filename),

                               s->path, s->img_number) < 0)

            return -EIO;

        f = &f1;

        if (url_fopen(f, filename, URL_RDONLY) < 0)

            return -EIO;

    } else {

        f = &s1->pb;

        if (url_feof(f))

            return -EIO;

    }

    av_new_packet(pkt, s->img_size);

    pkt->stream_index = 0;

    s->ptr = pkt->data;

    ret = av_read_image(f, filename, s->img_fmt, read_packet_alloc_cb, s);

    if (!s->is_pipe) {

        url_fclose(f);

    }

    if (ret < 0) {

        av_free_packet(pkt);

        return -EIO; /* signal EOF */

    } else {

        pkt->pts = av_rescale((int64_t)s->img_number * s1->streams[0]->codec.frame_rate_base, s1->pts_den, s1->streams[0]->codec.frame_rate) / s1->pts_num;

        s->img_number++;

        return 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+int bdrv_open_backing_file(BlockDriverState *bs)

 {

@@ -6,7 +6,7 @@

     int back_flags, ret;

+    BlockDriver *back_drv = NULL;

@@ -15,7 +15,7 @@
         return 0;

     }
+

     bs->open_flags &= ~BDRV_O_NO_BACKING;

int bdrv_open_backing_file(BlockDriverState *bs)

{

    char backing_filename[PATH_MAX];

    int back_flags, ret;

    BlockDriver *back_drv = NULL;

    if (bs->backing_hd != NULL) {

        return 0;

    }

    bs->open_flags &= ~BDRV_O_NO_BACKING;

    if (bs->backing_file[0] == '\0') {

        return 0;

    }

    bs->backing_hd = bdrv_new("");

    bdrv_get_full_backing_filename(bs, backing_filename,

                                   sizeof(backing_filename));

    if (bs->backing_format[0] != '\0') {

        back_drv = bdrv_find_format(bs->backing_format);

    }

    /* backing files always opened read-only */

    back_flags = bs->open_flags & ~(BDRV_O_RDWR | BDRV_O_SNAPSHOT);

    ret = bdrv_open(bs->backing_hd, backing_filename, NULL,

                    back_flags, back_drv);

    if (ret < 0) {

        bdrv_delete(bs->backing_hd);

        bs->backing_hd = NULL;

        bs->open_flags |= BDRV_O_NO_BACKING;

        return ret;

    }

    return 0;

}


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

 {

+    QString *qstring = qstring_from_str("destroy test");
+
     QDECREF(qstring);

 }

START_TEST(qstring_destroy_test)

{

    QString *qstring = qstring_from_str("destroy test");

    QDECREF(qstring);

}


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

 {

+    struct IscsiTask *iTask = opaque;

     iTask->complete = 1;

static void iscsi_retry_timer_expired(void *opaque)

{

    struct IscsiTask *iTask = opaque;

    iTask->complete = 1;

    if (iTask->co) {

        qemu_coroutine_enter(iTask->co, NULL);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static void virtio_scsi_handle_cmd(VirtIODevice *vdev, VirtQueue *vq)
+
 {

+    /* use non-QOM casts in the data path */
+
     VirtIOSCSI *s = (VirtIOSCSI *)vdev;

     VirtIOSCSIReq *req, *next;

static void virtio_scsi_handle_cmd(VirtIODevice *vdev, VirtQueue *vq)

{

    /* use non-QOM casts in the data path */

    VirtIOSCSI *s = (VirtIOSCSI *)vdev;

    VirtIOSCSIReq *req, *next;

    QTAILQ_HEAD(, VirtIOSCSIReq) reqs = QTAILQ_HEAD_INITIALIZER(reqs);

    if (s->ctx && !s->dataplane_started) {

        virtio_scsi_dataplane_start(s);

        return;

    }

    while ((req = virtio_scsi_pop_req(s, vq))) {

        if (virtio_scsi_handle_cmd_req_prepare(s, req)) {

            QTAILQ_INSERT_TAIL(&reqs, req, next);

        }

    }

    QTAILQ_FOREACH_SAFE(req, &reqs, next, next) {

        virtio_scsi_handle_cmd_req_submit(s, req);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static bool key_is_missing(const BlockInfo *bdev)
+
 {

     return (bdev->inserted && bdev->inserted->encryption_key_missing);

static bool key_is_missing(const BlockInfo *bdev)

{

    return (bdev->inserted && bdev->inserted->encryption_key_missing);

}


--- 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();

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static gint range_compare(gconstpointer a, gconstpointer b)
+
+{
+
+    Range *ra = (Range *)a, *rb = (Range *)b;
+
     if (ra->begin == rb->begin && ra->end == rb->end) {

         return 0;

static gint range_compare(gconstpointer a, gconstpointer b)

{

    Range *ra = (Range *)a, *rb = (Range *)b;

    if (ra->begin == rb->begin && ra->end == rb->end) {

        return 0;

    } else if (range_get_last(ra->begin, ra->end) <

               range_get_last(rb->begin, rb->end)) {

        return -1;

    } else {

        return 1;

    }

}


void do_adde (void)

{

    T2 = T0;

    T0 += T1 + xer_ca;

    if (likely(!(T0 < T2 || (xer_ca == 1 && T0 == T2)))) {

        xer_ca = 0;

    } else {

        xer_ca = 1;

    }

}


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

     AVStream *stream;
+
     AVCodecContext *codec;

     const char *p = line;

static int parse_h264_sdp_line(AVFormatContext *s, int st_index,

                               PayloadContext *h264_data, const char *line)

{

    AVStream *stream;

    AVCodecContext *codec;

    const char *p = line;

    if (st_index < 0)

        return 0;

    stream = s->streams[st_index];

    codec = stream->codec;

    assert(h264_data->cookie == MAGIC_COOKIE);

    if (av_strstart(p, "framesize:", &p)) {

        char buf1[50];

        char *dst = buf1;

        // remove the protocol identifier..

        while (*p && *p == ' ') p++; // strip spaces.

        while (*p && *p != ' ') p++; // eat protocol identifier

        while (*p && *p == ' ') p++; // strip trailing spaces.

        while (*p && *p != '-' && (dst - buf1) < sizeof(buf1) - 1) {

            *dst++ = *p++;

        }

        *dst = '\0';

        // a='framesize:96 320-240'

        // set our parameters..

        codec->width = atoi(buf1);

        codec->height = atoi(p + 1); // skip the -

        codec->pix_fmt = PIX_FMT_YUV420P;

    } else if (av_strstart(p, "fmtp:", &p)) {

        return ff_parse_fmtp(stream, h264_data, p, sdp_parse_fmtp_config_h264);

    } else if (av_strstart(p, "cliprect:", &p)) {

        // could use this if we wanted.

    }

    return 0;                   // keep processing it the normal way...

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void usb_cancel_packet(USBPacket * p)
+
+{
+
     assert(p->owner != NULL);

     usb_device_cancel_packet(p->owner->dev, p);

void usb_cancel_packet(USBPacket * p)

{

    assert(p->owner != NULL);

    usb_device_cancel_packet(p->owner->dev, p);

    p->owner = NULL;

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     agc->parent_realize(dev, &local_err);

     if (local_err) {
+
+        error_propagate(errp, local_err);
+
+        return;
+
     }

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

{

    /* Device instance realize function for the GIC sysbus device */

    GICv3State *s = ARM_GICV3(dev);

    ARMGICv3Class *agc = ARM_GICV3_GET_CLASS(s);

    Error *local_err = NULL;

    agc->parent_realize(dev, &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        return;

    }

    gicv3_init_irqs_and_mmio(s, gicv3_set_irq, NULL);

}


--- a/source.c
+++ b/source.c
@@ -27,11 +27,11 @@
     for(y=0;y<(height-2);y+=2) {

         deinterlace_line_inplace(buf,src_m1,src_0,src_p1,src_p2,width);
+
+        src_m1 = src_p1;
+
+        src_0 = src_p2;
+
         src_p1 += 2*src_wrap;

         src_p2 += 2*src_wrap;

static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap,

                                             int width, int height)

{

    uint8_t *src_m1, *src_0, *src_p1, *src_p2;

    int y;

    uint8_t *buf;

    buf = av_malloc(width);

    src_m1 = src1;

    memcpy(buf,src_m1,width);

    src_0=&src_m1[src_wrap];

    src_p1=&src_0[src_wrap];

    src_p2=&src_p1[src_wrap];

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

        deinterlace_line_inplace(buf,src_m1,src_0,src_p1,src_p2,width);

        src_m1 = src_p1;

        src_0 = src_p2;

        src_p1 += 2*src_wrap;

        src_p2 += 2*src_wrap;

    }

    /* do last line */

    deinterlace_line_inplace(buf,src_m1,src_0,src_0,src_0,width);

    av_free(buf);

}


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

     assert(mutex->owner == 0);

void qemu_mutex_destroy(QemuMutex *mutex)

{

    assert(mutex->owner == 0);

    DeleteCriticalSection(&mutex->lock);

}


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

     if (enable) {
+
+        /* Expose avail event/used flags before caller checks the avail idx. */
+
+        smp_mb();
+
     }

 }

void virtio_queue_set_notification(VirtQueue *vq, int enable)

{

    vq->notification = enable;

    if (virtio_has_feature(vq->vdev, VIRTIO_RING_F_EVENT_IDX)) {

        vring_set_avail_event(vq, vring_avail_idx(vq));

    } else if (enable) {

        vring_used_flags_unset_bit(vq, VRING_USED_F_NO_NOTIFY);

    } else {

        vring_used_flags_set_bit(vq, VRING_USED_F_NO_NOTIFY);

    }

    if (enable) {

        /* Expose avail event/used flags before caller checks the avail idx. */

        smp_mb();

    }

}


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

     UnsharpContext *unsharp = ctx->priv;

+    int lmsize_x = 5, cmsize_x = 0;

     int lmsize_y = 5, cmsize_y = 0;

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

{

    UnsharpContext *unsharp = ctx->priv;

    int lmsize_x = 5, cmsize_x = 0;

    int lmsize_y = 5, cmsize_y = 0;

    double lamount = 1.0f, camount = 0.0f;

    if (args)

        sscanf(args, "%d:%d:%lf:%d:%d:%lf", &lmsize_x, &lmsize_y, &lamount,

                                            &cmsize_x, &cmsize_y, &camount);

    if (lmsize_x < 2 || lmsize_y < 2 || cmsize_x < 2 || cmsize_y < 2) {

        av_log(ctx, AV_LOG_ERROR,

               "Invalid value <2 for lmsize_x:%d or lmsize_y:%d or cmsize_x:%d or cmsize_y:%d\n",

               lmsize_x, lmsize_y, cmsize_x, cmsize_y);

        return AVERROR(EINVAL);

    }

    set_filter_param(&unsharp->luma,   lmsize_x, lmsize_y, lamount);

    set_filter_param(&unsharp->chroma, cmsize_x, cmsize_y, camount);

    return 0;

}


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

     sbd = SYS_BUS_DEVICE(dev);
+
+    sysbus_mmio_map(sbd, 0, ctl_addr);
+
+    sysbus_mmio_map(sbd, 1, data_addr);
+

     return FW_CFG(dev);

FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr)

{

    DeviceState *dev;

    SysBusDevice *sbd;

    dev = qdev_create(NULL, TYPE_FW_CFG_MEM);

    qdev_prop_set_uint32(dev, "data_width",

                         fw_cfg_data_mem_ops.valid.max_access_size);

    fw_cfg_init1(dev);

    sbd = SYS_BUS_DEVICE(dev);

    sysbus_mmio_map(sbd, 0, ctl_addr);

    sysbus_mmio_map(sbd, 1, data_addr);

    return FW_CFG(dev);

}


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

+    tmp = new_tmp();
+
+    tmp2 = new_tmp();
+
+

     tcg_gen_andi_i32(tmp, t0, 0xffff);

static void gen_neon_zip_u16(TCGv t0, TCGv t1)

{

    TCGv tmp, tmp2;

    tmp = new_tmp();

    tmp2 = new_tmp();

    tcg_gen_andi_i32(tmp, t0, 0xffff);

    tcg_gen_shli_i32(tmp2, t1, 16);

    tcg_gen_or_i32(tmp, tmp, tmp2);

    tcg_gen_andi_i32(t1, t1, 0xffff0000);

    tcg_gen_shri_i32(tmp2, t0, 16);

    tcg_gen_or_i32(t1, t1, tmp2);

    tcg_gen_mov_i32(t0, tmp);

    dead_tmp(tmp2);

    dead_tmp(tmp);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int film_read_close(AVFormatContext *s)
+
+{
+
+    FilmDemuxContext *film = s->priv_data;

static int film_read_close(AVFormatContext *s)

{

    FilmDemuxContext *film = s->priv_data;

    av_free(film->sample_table);

    av_free(film->stereo_buffer);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static inline void mix_3f_to_stereo(AC3DecodeContext *ctx)
+
+{
+
+    int i;
+
     float (*output)[256] = ctx->audio_block.block_output;

static inline void mix_3f_to_stereo(AC3DecodeContext *ctx)

{

    int i;

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

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

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

        output[2][i] += output[3][i];

    }

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

}


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

     TTAContext *c = s->priv_data;

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

     int index = av_index_search_timestamp(st, timestamp, flags);

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

{

    TTAContext *c = s->priv_data;

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

    int index = av_index_search_timestamp(st, timestamp, flags);

    if (index < 0)

        return -1;

    c->currentframe = index;

    avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+int qtest_init(void)
+
+{
+
     CharDriverState *chr;

@@ -14,7 +14,7 @@

     chr = qemu_chr_new("qtest", qtest_chrdev, NULL);

+

     qemu_chr_add_handlers(chr, qtest_can_read, qtest_read, qtest_event, chr);

int qtest_init(void)

{

    CharDriverState *chr;

    g_assert(qtest_chrdev != NULL);

    configure_icount("0");

    chr = qemu_chr_new("qtest", qtest_chrdev, NULL);

    qemu_chr_add_handlers(chr, qtest_can_read, qtest_read, qtest_event, chr);

    qemu_chr_fe_set_echo(chr, true);

    inbuf = g_string_new("");

    if (qtest_log) {

        if (strcmp(qtest_log, "none") != 0) {

            qtest_log_fp = fopen(qtest_log, "w+");

        }

    } else {

        qtest_log_fp = stderr;

    }

    qtest_chr = chr;

    return 0;

}


static void curl_close(BlockDriverState *bs)

{

    BDRVCURLState *s = bs->opaque;

    int i;

    DPRINTF("CURL: Close\n");

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

        if (s->states[i].in_use)

            curl_clean_state(&s->states[i]);

        if (s->states[i].curl) {

            curl_easy_cleanup(s->states[i].curl);

            s->states[i].curl = NULL;

        }

        if (s->states[i].orig_buf) {

            g_free(s->states[i].orig_buf);

            s->states[i].orig_buf = NULL;

        }

    }

    if (s->multi)

        curl_multi_cleanup(s->multi);

    timer_del(&s->timer);

    g_free(s->url);

}


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

     CPUState *cs = CPU(obj);

+    UniCore32CPU *cpu = UNICORE32_CPU(obj);

     CPUUniCore32State *env = &cpu->env;

static void uc32_cpu_initfn(Object *obj)

{

    CPUState *cs = CPU(obj);

    UniCore32CPU *cpu = UNICORE32_CPU(obj);

    CPUUniCore32State *env = &cpu->env;

    static bool inited;

    cs->env_ptr = env;

    cpu_exec_init(cs, &error_abort);

#ifdef CONFIG_USER_ONLY

    env->uncached_asr = ASR_MODE_USER;

    env->regs[31] = 0;

#else

    env->uncached_asr = ASR_MODE_PRIV;

    env->regs[31] = 0x03000000;

#endif

    tlb_flush(cs, 1);

    if (tcg_enabled() && !inited) {

        inited = true;

        uc32_translate_init();

    }

}


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

         return;

+    }
+
+
+
+    pte_index *= HASH_PTE_SIZE_64;

     if (env->external_htab) {

void ppc_hash64_store_hpte(PowerPCCPU *cpu,

                           target_ulong pte_index,

                           target_ulong pte0, target_ulong pte1)

{

    CPUPPCState *env = &cpu->env;

    if (env->external_htab == MMU_HASH64_KVM_MANAGED_HPT) {

        kvmppc_hash64_write_pte(env, pte_index, pte0, pte1);

        return;

    }

    pte_index *= HASH_PTE_SIZE_64;

    if (env->external_htab) {

        stq_p(env->external_htab + pte_index, pte0);

        stq_p(env->external_htab + pte_index + HASH_PTE_SIZE_64 / 2, pte1);

    } else {

        stq_phys(CPU(cpu)->as, env->htab_base + pte_index, pte0);

        stq_phys(CPU(cpu)->as,

                 env->htab_base + pte_index + HASH_PTE_SIZE_64 / 2, pte1);

    }

}


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

         QObject *data;

+        Monitor *mon = opaque;
+
+
+
+        json_message_parser_init(&mon->mc->parser, handle_qmp_command);

static void monitor_control_event(void *opaque, int event)

{

    if (event == CHR_EVENT_OPENED) {

        QObject *data;

        Monitor *mon = opaque;

        json_message_parser_init(&mon->mc->parser, handle_qmp_command);

        data = qobject_from_jsonf("{ 'QMP': { 'capabilities': [] } }");

        assert(data != NULL);

        monitor_json_emitter(mon, data);

        qobject_decref(data);

    }

}


static void raw_decode(uint8_t *dst, const int8_t *src, int src_size)

{

    while (src_size--)

        *dst++ = *src++ + 128;

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     if (version_id != 1)

         return -EINVAL;
+
+
+
+    qemu_get_buffer(f, s->cmos_data, 128);
+
     qemu_get_8s(f, &s->cmos_index);

static int rtc_load(QEMUFile *f, void *opaque, int version_id)

{

    RTCState *s = opaque;

    if (version_id != 1)

        return -EINVAL;

    qemu_get_buffer(f, s->cmos_data, 128);

    qemu_get_8s(f, &s->cmos_index);

    s->current_tm.tm_sec=qemu_get_be32(f);

    s->current_tm.tm_min=qemu_get_be32(f);

    s->current_tm.tm_hour=qemu_get_be32(f);

    s->current_tm.tm_wday=qemu_get_be32(f);

    s->current_tm.tm_mday=qemu_get_be32(f);

    s->current_tm.tm_mon=qemu_get_be32(f);

    s->current_tm.tm_year=qemu_get_be32(f);

    qemu_get_timer(f, s->periodic_timer);

    s->next_periodic_time=qemu_get_be64(f);

    s->next_second_time=qemu_get_be64(f);

    qemu_get_timer(f, s->second_timer);

    qemu_get_timer(f, s->second_timer2);

    return 0;

}


static inline void hcscale_fast_c(SwsContext *c, int16_t *dst1, int16_t *dst2,

                                  int dstWidth, const uint8_t *src1,

                                  const uint8_t *src2, int srcW, int xInc)

{

    int i;

    unsigned int xpos=0;

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

        register unsigned int xx=xpos>>16;

        register unsigned int xalpha=(xpos&0xFFFF)>>9;

        dst1[i]=(src1[xx]*(xalpha^127)+src1[xx+1]*xalpha);

        dst2[i]=(src2[xx]*(xalpha^127)+src2[xx+1]*xalpha);

        xpos+=xInc;


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

+{
+
     VDAContext *vda = avctx->internal->hwaccel_priv_data;

     av_freep(&vda->bitstream);

static int vda_h264_uninit(AVCodecContext *avctx)

{

    VDAContext *vda = avctx->internal->hwaccel_priv_data;

    av_freep(&vda->bitstream);

    if (vda->frame)

        CVPixelBufferRelease(vda->frame);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static void release_buffer(AVCodecContext *avctx, AVFrame *pic)
+
+{
+
+    int i;
+
+

     CVPixelBufferRef cv_buffer = (CVPixelBufferRef)pic->data[3];

static void release_buffer(AVCodecContext *avctx, AVFrame *pic)

{

    int i;

    CVPixelBufferRef cv_buffer = (CVPixelBufferRef)pic->data[3];

    CVPixelBufferUnlockBaseAddress(cv_buffer, 0);

    CVPixelBufferRelease(cv_buffer);

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

        pic->data[i] = NULL;

}


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

     /* Copy RTAS over */
+
+    cpu_physical_memory_write(spapr->rtas_addr, spapr->rtas_blob,
+
+                              spapr->rtas_size);
+

     /* Set up the entry state */

static void ppc_spapr_reset(void)

{

    sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());

    PowerPCCPU *first_ppc_cpu;

    uint32_t rtas_limit;

    /* Check for unknown sysbus devices */

    foreach_dynamic_sysbus_device(find_unknown_sysbus_device, NULL);

    /* Reset the hash table & recalc the RMA */

    spapr_reset_htab(spapr);

    qemu_devices_reset();

    /*

     * We place the device tree and RTAS just below either the top of the RMA,

     * or just below 2GB, whichever is lowere, so that it can be

     * processed with 32-bit real mode code if necessary

     */

    rtas_limit = MIN(spapr->rma_size, RTAS_MAX_ADDR);

    spapr->rtas_addr = rtas_limit - RTAS_MAX_SIZE;

    spapr->fdt_addr = spapr->rtas_addr - FDT_MAX_SIZE;

    /* Load the fdt */

    spapr_finalize_fdt(spapr, spapr->fdt_addr, spapr->rtas_addr,

                       spapr->rtas_size);

    /* Copy RTAS over */

    cpu_physical_memory_write(spapr->rtas_addr, spapr->rtas_blob,

                              spapr->rtas_size);

    /* Set up the entry state */

    first_ppc_cpu = POWERPC_CPU(first_cpu);

    first_ppc_cpu->env.gpr[3] = spapr->fdt_addr;

    first_ppc_cpu->env.gpr[5] = 0;

    first_cpu->halted = 0;

    first_ppc_cpu->env.nip = spapr->entry_point;

}


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

     int bit_pos, node_num, dat_pos;

+

     prev = bit_pos = dat_pos = 0;

static void idcin_decode_vlcs(IdcinContext *s)

{

    hnode_t *hnodes;

    long x, y;

    int prev;

    unsigned char v = 0;

    int bit_pos, node_num, dat_pos;

    prev = bit_pos = dat_pos = 0;

    for (y = 0; y < (s->frame.linesize[0] * s->avctx->height);

        y += s->frame.linesize[0]) {

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

            node_num = s->num_huff_nodes[prev];

            hnodes = s->huff_nodes[prev];

            while(node_num >= HUF_TOKENS) {

                if(!bit_pos) {

                    if(dat_pos > s->size) {

                        av_log(s->avctx, AV_LOG_ERROR, "Huffman decode error.\n");

                        return;

                    }

                    bit_pos = 8;

                    v = s->buf[dat_pos++];

                }

                node_num = hnodes[node_num].children[v & 0x01];

                v = v >> 1;

                bit_pos--;

            }

            s->frame.data[0][x] = node_num;

            prev = node_num;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void pmac_ide_writel (void *opaque,

+                             target_phys_addr_t addr, uint32_t val)
+
+{
+
+    MACIOIDEState *d = opaque;

static void pmac_ide_writel (void *opaque,

                             target_phys_addr_t addr, uint32_t val)

{

    MACIOIDEState *d = opaque;

    addr = (addr & 0xFFF) >> 4;

    val = bswap32(val);

    if (addr == 0) {

        ide_data_writel(&d->bus, 0, val);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void pc_compat_1_6(MachineState *machine)

+{
+
     pc_compat_1_7(machine);

     rom_file_has_mr = false;

static void pc_compat_1_6(MachineState *machine)

{

    pc_compat_1_7(machine);

    rom_file_has_mr = false;

    has_acpi_build = false;

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
         if (s->vectors[irq].active) {

             nhand++;
+
+            if (nhand == 2) {
+
+                return 0;
+
             }

         }

static bool nvic_rettobase(NVICState *s)

{

    int irq, nhand = 0;

    for (irq = ARMV7M_EXCP_RESET; irq < s->num_irq; irq++) {

        if (s->vectors[irq].active) {

            nhand++;

            if (nhand == 2) {

                return 0;

            }

        }

    }

    return 1;

}


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

         int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);

+        int64_t warp_delta = clock - vm_clock_warp_start;
+
+        if (use_icount == 1) {
+
+            qemu_icount_bias += warp_delta;

         } else {

static void icount_warp_rt(void *opaque)

{

    if (vm_clock_warp_start == -1) {

        return;

    }

    if (runstate_is_running()) {

        int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);

        int64_t warp_delta = clock - vm_clock_warp_start;

        if (use_icount == 1) {

            qemu_icount_bias += warp_delta;

        } else {

            /*

             * In adaptive mode, do not let QEMU_CLOCK_VIRTUAL run too

             * far ahead of real time.

             */

            int64_t cur_time = cpu_get_clock();

            int64_t cur_icount = cpu_get_icount();

            int64_t delta = cur_time - cur_icount;

            qemu_icount_bias += MIN(warp_delta, delta);

        }

        if (qemu_clock_expired(QEMU_CLOCK_VIRTUAL)) {

            qemu_clock_notify(QEMU_CLOCK_VIRTUAL);

        }

    }

    vm_clock_warp_start = -1;

}


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

     MirrorBlockJob *s = container_of(job, MirrorBlockJob, common);

+

     if (speed < 0) {

static void mirror_set_speed(BlockJob *job, int64_t speed, Error **errp)

{

    MirrorBlockJob *s = container_of(job, MirrorBlockJob, common);

    if (speed < 0) {

        error_setg(errp, QERR_INVALID_PARAMETER, "speed");

        return;

    }

    ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE, SLICE_TIME);

}


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

     }

+    for (i = 0; i < ARRAY_SIZE(bus->devices); ++i) {
+
+        if (bus->devices[i]) {
+
+            pci_device_reset(bus->devices[i]);

         }

void pci_bus_reset(PCIBus *bus)

{

    int i;

    for (i = 0; i < bus->nirq; i++) {

        bus->irq_count[i] = 0;

    }

    for (i = 0; i < ARRAY_SIZE(bus->devices); ++i) {

        if (bus->devices[i]) {

            pci_device_reset(bus->devices[i]);

        }

    }

}


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

         if (!logfile) {

+            perror(logfilename);

             _exit(1);

void cpu_set_log(int log_flags)

{

    loglevel = log_flags;

    if (loglevel && !logfile) {

        logfile = fopen(logfilename, log_append ? "a" : "w");

        if (!logfile) {

            perror(logfilename);

            _exit(1);

        }

#if !defined(CONFIG_SOFTMMU)

        /* must avoid mmap() usage of glibc by setting a buffer "by hand" */

        {

            static char logfile_buf[4096];

            setvbuf(logfile, logfile_buf, _IOLBF, sizeof(logfile_buf));

        }

#elif !defined(_WIN32)

        /* Win32 doesn't support line-buffering and requires size >= 2 */

        setvbuf(logfile, NULL, _IOLBF, 0);

#endif

        log_append = 1;

    }

    if (!loglevel && logfile) {

        fclose(logfile);

        logfile = NULL;

    }

}


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

     switch (size) {

+    case 1:
+
+        stb_p(qemu_get_ram_ptr(ram_addr), val);
+
+        break;

     case 2:

static void notdirty_mem_write(void *opaque, hwaddr ram_addr,

                               uint64_t val, unsigned size)

{

    if (!cpu_physical_memory_get_dirty_flag(ram_addr, DIRTY_MEMORY_CODE)) {

        tb_invalidate_phys_page_fast(ram_addr, size);

    }

    switch (size) {

    case 1:

        stb_p(qemu_get_ram_ptr(ram_addr), val);

        break;

    case 2:

        stw_p(qemu_get_ram_ptr(ram_addr), val);

        break;

    case 4:

        stl_p(qemu_get_ram_ptr(ram_addr), val);

        break;

    default:

        abort();

    }

    cpu_physical_memory_set_dirty_flag(ram_addr, DIRTY_MEMORY_MIGRATION);

    cpu_physical_memory_set_dirty_flag(ram_addr, DIRTY_MEMORY_VGA);

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

       flushed */

    if (!cpu_physical_memory_is_clean(ram_addr)) {

        CPUArchState *env = current_cpu->env_ptr;

        tlb_set_dirty(env, current_cpu->mem_io_vaddr);

    }

}


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

 {

+    PCIDevice *d = PCI_DEVICE(dev);

     GenPCIERootPort *grp = GEN_PCIE_ROOT_PORT(d);

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

{

    PCIDevice *d = PCI_DEVICE(dev);

    GenPCIERootPort *grp = GEN_PCIE_ROOT_PORT(d);

    PCIERootPortClass *rpc = PCIE_ROOT_PORT_GET_CLASS(d);

    rpc->parent_realize(dev, errp);

    int rc = pci_bridge_qemu_reserve_cap_init(d, 0, grp->bus_reserve,

            grp->io_reserve, grp->mem_reserve, grp->pref32_reserve,

            grp->pref64_reserve, errp);

    if (rc < 0) {

        rpc->parent_class.exit(d);

        return;

    }

    if (!grp->io_reserve) {

        pci_word_test_and_clear_mask(d->wmask + PCI_COMMAND,

                                     PCI_COMMAND_IO);

        d->wmask[PCI_IO_BASE] = 0;

        d->wmask[PCI_IO_LIMIT] = 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     const char *buf;

+
     if (mon->skip_flush) {

         return;

void monitor_flush(Monitor *mon)

{

    int rc;

    size_t len;

    const char *buf;

    if (mon->skip_flush) {

        return;

    }

    buf = qstring_get_str(mon->outbuf);

    len = qstring_get_length(mon->outbuf);

    if (len && !mon->mux_out) {

        rc = qemu_chr_fe_write(mon->chr, (const uint8_t *) buf, len);

        if (rc == len) {

            /* all flushed */

            QDECREF(mon->outbuf);

            mon->outbuf = qstring_new();

            return;

        }

        if (rc > 0) {

            /* partinal write */

            QString *tmp = qstring_from_str(buf + rc);

            QDECREF(mon->outbuf);

            mon->outbuf = tmp;

        }

        if (mon->watch == 0) {

            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT,

                                               monitor_unblocked, mon);

        }

    }

}


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

     ram_control_before_iterate(f, RAM_CONTROL_FINISH);
+

     /* try transferring iterative blocks of memory */

static int ram_save_complete(QEMUFile *f, void *opaque)

{

    rcu_read_lock();

    migration_bitmap_sync();

    ram_control_before_iterate(f, RAM_CONTROL_FINISH);

    /* try transferring iterative blocks of memory */

    /* flush all remaining blocks regardless of rate limiting */

    while (true) {

        int pages;

        pages = ram_find_and_save_block(f, true, &bytes_transferred);

        /* no more blocks to sent */

        if (pages == 0) {

            break;

        }

    }

    flush_compressed_data(f);

    ram_control_after_iterate(f, RAM_CONTROL_FINISH);

    migration_end();

    rcu_read_unlock();

    qemu_put_be64(f, RAM_SAVE_FLAG_EOS);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static size_t refcount_array_byte_size(BDRVQcow2State *s, uint64_t entries)

 {

static size_t refcount_array_byte_size(BDRVQcow2State *s, uint64_t entries)

{

    /* This assertion holds because there is no way we can address more than

     * 2^(64 - 9) clusters at once (with cluster size 512 = 2^9, and because

     * offsets have to be representable in bytes); due to every cluster

     * corresponding to one refcount entry, we are well below that limit */

    assert(entries < (UINT64_C(1) << (64 - 9)));

    /* Thanks to the assertion this will not overflow, because

     * s->refcount_order < 7.

     * (note: x << s->refcount_order == x * s->refcount_bits) */

    return DIV_ROUND_UP(entries << s->refcount_order, 8);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int kvm_has_msr_hsave_pa(CPUState *env)
+
+{

     kvm_supported_msrs(env);

static int kvm_has_msr_hsave_pa(CPUState *env)

{

    kvm_supported_msrs(env);

    return has_msr_hsave_pa;

}


static int encrypt_sectors(BDRVQcowState *s, int64_t sector_num,

                           uint8_t *buf, int nb_sectors, bool enc,

                           Error **errp)

{

    union {

        uint64_t ll[2];

        uint8_t b[16];

    } ivec;

    int i;

    int ret;

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

        ivec.ll[0] = cpu_to_le64(sector_num);

        ivec.ll[1] = 0;

        if (qcrypto_cipher_setiv(s->cipher,

                                 ivec.b, G_N_ELEMENTS(ivec.b),

                                 errp) < 0) {

            return -1;

        }

        if (enc) {

            ret = qcrypto_cipher_encrypt(s->cipher,

                                         buf, buf,

                                         512,

                                         errp);

        } else {

            ret = qcrypto_cipher_decrypt(s->cipher,

                                         buf, buf,

                                         512,

                                         errp);

        }

        if (ret < 0) {

            return -1;

        }

        sector_num++;

        buf += 512;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void get_lag(float *buf, const float *new, LongTermPrediction *ltp)
+
+{

     int i, j, lag, max_corr = 0;

static void get_lag(float *buf, const float *new, LongTermPrediction *ltp)

{

    int i, j, lag, max_corr = 0;

    float max_ratio;

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

        float corr, s0 = 0.0f, s1 = 0.0f;

        const int start = FFMAX(0, i - 1024);

        for (j = start; j < 2048; j++) {

            const int idx = j - i + 1024;

            s0 += new[j]*buf[idx];

            s1 += buf[idx]*buf[idx];

        }

        corr = s1 > 0.0f ? s0/sqrt(s1) : 0.0f;

        if (corr > max_corr) {

            max_corr = corr;

            lag = i;

            max_ratio = corr/(2048-start);

        }

    }

    ltp->lag = FFMAX(av_clip_uintp2(lag, 11), 0);

    ltp->coef_idx = quant_array_idx(max_ratio, ltp_coef, 8);

    ltp->coef = ltp_coef[ltp->coef_idx];

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static inline void acpi_build_tables_cleanup(AcpiBuildTables *tables, bool mfre)

+{
+
     void *linker_data = bios_linker_loader_cleanup(tables->linker);

+    if (mfre) {

         g_free(linker_data);

static inline void acpi_build_tables_cleanup(AcpiBuildTables *tables, bool mfre)

{

    void *linker_data = bios_linker_loader_cleanup(tables->linker);

    if (mfre) {

        g_free(linker_data);

    }

    g_array_free(tables->rsdp, mfre);

    g_array_free(tables->table_data, mfre);

    g_array_free(tables->tcpalog, mfre);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void rv34_idct_dc_add_c(uint8_t *dst, ptrdiff_t stride, int dc)
+
 {
+
     const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

     int i, j;
+

     cm += (13*13*dc + 0x200) >> 10;

static void rv34_idct_dc_add_c(uint8_t *dst, ptrdiff_t stride, int dc)

{

    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

    int i, j;

    cm += (13*13*dc + 0x200) >> 10;

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

    {

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

            dst[j] = cm[ dst[j] ];

        dst += stride;

    }

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     if (s->is_cf)

         s->mult_sectors = 0;
+
+    else
+
+        s->mult_sectors = MAX_MULT_SECTORS;
+
     s->cur_drive = s;

     s->select = 0xa0;

static void ide_reset(IDEState *s)

{

    if (s->is_cf)

        s->mult_sectors = 0;

    else

        s->mult_sectors = MAX_MULT_SECTORS;

    s->cur_drive = s;

    s->select = 0xa0;

    s->status = READY_STAT;

    ide_set_signature(s);

    /* init the transfer handler so that 0xffff is returned on data

       accesses */

    s->end_transfer_func = ide_dummy_transfer_stop;

    ide_dummy_transfer_stop(s);

    s->media_changed = 0;

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
     int mx         = mv->x & 3;

     int my         = mv->y & 3;
+
+    int extra_left = ff_hevc_qpel_extra_before[mx];
+
+    int extra_top  = ff_hevc_qpel_extra_before[my];
+

     x_off += mv->x >> 2;

static void luma_mc(HEVCContext *s, int16_t *dst, ptrdiff_t dststride,

                    AVFrame *ref, const Mv *mv, int x_off, int y_off,

                    int block_w, int block_h)

{

    HEVCLocalContext *lc = &s->HEVClc;

    uint8_t *src         = ref->data[0];

    ptrdiff_t srcstride  = ref->linesize[0];

    int pic_width        = s->ps.sps->width;

    int pic_height       = s->ps.sps->height;

    int mx         = mv->x & 3;

    int my         = mv->y & 3;

    int extra_left = ff_hevc_qpel_extra_before[mx];

    int extra_top  = ff_hevc_qpel_extra_before[my];

    x_off += mv->x >> 2;

    y_off += mv->y >> 2;

    src   += y_off * srcstride + (x_off << s->ps.sps->pixel_shift);

    if (x_off < extra_left || y_off < extra_top ||

        x_off >= pic_width - block_w - ff_hevc_qpel_extra_after[mx] ||

        y_off >= pic_height - block_h - ff_hevc_qpel_extra_after[my]) {

        const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift;

        int offset = extra_top * srcstride + (extra_left << s->ps.sps->pixel_shift);

        int buf_offset = extra_top *

                         edge_emu_stride + (extra_left << s->ps.sps->pixel_shift);

        s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src - offset,

                                 edge_emu_stride, srcstride,

                                 block_w + ff_hevc_qpel_extra[mx],

                                 block_h + ff_hevc_qpel_extra[my],

                                 x_off - extra_left, y_off - extra_top,

                                 pic_width, pic_height);

        src = lc->edge_emu_buffer + buf_offset;

        srcstride = edge_emu_stride;

    }

    s->hevcdsp.put_hevc_qpel[my][mx](dst, dststride, src, srcstride, block_w,

                                     block_h, lc->mc_buffer);

}


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

         struct sockaddr_ll *target_ll = (struct sockaddr_ll *)target_saddr;

+        target_ll->sll_ifindex = tswap32(target_ll->sll_ifindex);
+
+        target_ll->sll_hatype = tswap16(target_ll->sll_hatype);
+
+    } else if (addr->sa_family == AF_INET6 &&

                len >= sizeof(struct target_sockaddr_in6)) {

static inline abi_long host_to_target_sockaddr(abi_ulong target_addr,

                                               struct sockaddr *addr,

                                               socklen_t len)

{

    struct target_sockaddr *target_saddr;

    if (len == 0) {

        return 0;

    }

    target_saddr = lock_user(VERIFY_WRITE, target_addr, len, 0);

    if (!target_saddr)

        return -TARGET_EFAULT;

    memcpy(target_saddr, addr, len);

    if (len >= offsetof(struct target_sockaddr, sa_family) +

        sizeof(target_saddr->sa_family)) {

        target_saddr->sa_family = tswap16(addr->sa_family);

    }

    if (addr->sa_family == AF_NETLINK && len >= sizeof(struct sockaddr_nl)) {

        struct sockaddr_nl *target_nl = (struct sockaddr_nl *)target_saddr;

        target_nl->nl_pid = tswap32(target_nl->nl_pid);

        target_nl->nl_groups = tswap32(target_nl->nl_groups);

    } else if (addr->sa_family == AF_PACKET) {

        struct sockaddr_ll *target_ll = (struct sockaddr_ll *)target_saddr;

        target_ll->sll_ifindex = tswap32(target_ll->sll_ifindex);

        target_ll->sll_hatype = tswap16(target_ll->sll_hatype);

    } else if (addr->sa_family == AF_INET6 &&

               len >= sizeof(struct target_sockaddr_in6)) {

        struct target_sockaddr_in6 *target_in6 =

               (struct target_sockaddr_in6 *)target_saddr;

        target_in6->sin6_scope_id = tswap16(target_in6->sin6_scope_id);

    }

    unlock_user(target_saddr, target_addr, len);

    return 0;

}


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

     RV34DecContext *r = avctx->priv_data;
+
+    int ret;
+
+
+
     r->rv30 = 1;

     if ((ret = ff_rv34_decode_init(avctx)) < 0)

static av_cold int rv30_decode_init(AVCodecContext *avctx)

{

    RV34DecContext *r = avctx->priv_data;

    int ret;

    r->rv30 = 1;

    if ((ret = ff_rv34_decode_init(avctx)) < 0)

        return ret;

    if(avctx->extradata_size < 2){

        av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");

        return -1;

    }

    r->rpr = (avctx->extradata[1] & 7) >> 1;

    r->rpr = FFMIN(r->rpr + 1, 3);

    if(avctx->extradata_size - 8 < (r->rpr - 1) * 2){

        av_log(avctx, AV_LOG_ERROR, "Insufficient extradata - need at least %d bytes, got %d\n",

               6 + r->rpr * 2, avctx->extradata_size);

        return AVERROR(EINVAL);

    }

    r->parse_slice_header = rv30_parse_slice_header;

    r->decode_intra_types = rv30_decode_intra_types;

    r->decode_mb_info     = rv30_decode_mb_info;

    r->loop_filter        = rv30_loop_filter;

    r->luma_dc_quant_i = rv30_luma_dc_quant;

    r->luma_dc_quant_p = rv30_luma_dc_quant;

    return 0;

}


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

         for (j = begin; j < end; j++) average += fabs(coeffs[j]);

+        average /= end - begin;
+
+        average /= 32; // MAGIC!
+
+        for (j = 0; j < range - 1; j++) if (floor1_inverse_db_table[j * fc->multiplier] > average) break;

         posts[fc->list[i].sort] = j;

static void floor_fit(venc_context_t * venc, floor_t * fc, float * coeffs, int * posts, int samples) {

    int range = 255 / fc->multiplier + 1;

    int i;

    for (i = 0; i < fc->values; i++) {

        int position = fc->list[fc->list[i].sort].x;

        int begin = fc->list[fc->list[FFMAX(i-1, 0)].sort].x;

        int end   = fc->list[fc->list[FFMIN(i+1, fc->values - 1)].sort].x;

        int j;

        float average = 0;

        begin = (position + begin) / 2;

        end   = (position + end  ) / 2;

        assert(end <= samples);

        for (j = begin; j < end; j++) average += fabs(coeffs[j]);

        average /= end - begin;

        average /= 32; // MAGIC!

        for (j = 0; j < range - 1; j++) if (floor1_inverse_db_table[j * fc->multiplier] > average) break;

        posts[fc->list[i].sort] = j;

    }

}


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

     case 1:

+        avctx->codec_id = AV_CODEC_ID_MP1;
+
+        *frame_size = 384;
+
+        break;

     case 2:

int avpriv_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bit_rate)

{

    MPADecodeHeader s1, *s = &s1;

    if (ff_mpa_check_header(head) != 0)

        return -1;

    if (avpriv_mpegaudio_decode_header(s, head) != 0) {

        return -1;

    }

    switch(s->layer) {

    case 1:

        avctx->codec_id = AV_CODEC_ID_MP1;

        *frame_size = 384;

        break;

    case 2:

        avctx->codec_id = AV_CODEC_ID_MP2;

        *frame_size = 1152;

        break;

    default:

    case 3:

        if (avctx->codec_id != AV_CODEC_ID_MP3ADU)

            avctx->codec_id = AV_CODEC_ID_MP3;

        if (s->lsf)

            *frame_size = 576;

        else

            *frame_size = 1152;

        break;

    }

    *sample_rate = s->sample_rate;

    *channels = s->nb_channels;

    *bit_rate = s->bit_rate;

    return s->frame_size;

}


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

     //FIXME interpolate chroma
+
+    RENAME(yuvPlanartoyuy2)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 2);
+
 }

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

                                      long width, long height,

                                      long lumStride, long chromStride, long dstStride)

{

    //FIXME interpolate chroma

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

}


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

     UserDefFlatUnion *tmp;

+    UserDefUnionBase *base;

static void test_visitor_in_union_flat(TestInputVisitorData *data,

                                       const void *unused)

{

    Visitor *v;

    UserDefFlatUnion *tmp;

    UserDefUnionBase *base;

    v = visitor_input_test_init(data,

                                "{ 'enum1': 'value1', "

                                "'integer': 41, "

                                "'string': 'str', "

                                "'boolean': true }");

    visit_type_UserDefFlatUnion(v, NULL, &tmp, &error_abort);

    g_assert_cmpint(tmp->enum1, ==, ENUM_ONE_VALUE1);

    g_assert_cmpstr(tmp->string, ==, "str");

    g_assert_cmpint(tmp->integer, ==, 41);

    g_assert_cmpint(tmp->u.value1->boolean, ==, true);

    base = qapi_UserDefFlatUnion_base(tmp);

    g_assert(&base->enum1 == &tmp->enum1);

    qapi_free_UserDefFlatUnion(tmp);

}


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

 	if (!CONN_CANFRCV(so) || so->so_snd.sb_cc >= (so->so_snd.sb_datalen/2))
+
+		return 0;
+
+
+
 	return sopreprbuf(so, iov, NULL);

 }

size_t slirp_socket_can_recv(Slirp *slirp, struct in_addr guest_addr,

                             int guest_port)

{

	struct iovec iov[2];

	struct socket *so;

	so = slirp_find_ctl_socket(slirp, guest_addr, guest_port);

	if (!so || so->so_state & SS_NOFDREF)

		return 0;

	if (!CONN_CANFRCV(so) || so->so_snd.sb_cc >= (so->so_snd.sb_datalen/2))

		return 0;

	return sopreprbuf(so, iov, NULL);

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
     decr = muldiv64(tb_env->decr_next - qemu_get_clock(vm_clock),

                     tb_env->tb_freq, ticks_per_sec);
+
+#if defined(DEBUG_TB)
+
+    printf("%s: 0x%08x\n", __func__, decr);
+
 #endif

uint32_t cpu_ppc_load_decr (CPUState *env)

{

    ppc_tb_t *tb_env = env->tb_env;

    uint32_t decr;

    decr = muldiv64(tb_env->decr_next - qemu_get_clock(vm_clock),

                    tb_env->tb_freq, ticks_per_sec);

#if defined(DEBUG_TB)

    printf("%s: 0x%08x\n", __func__, decr);

#endif

    return decr;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int proxy_lstat(FsContext *fs_ctx, V9fsPath *fs_path, struct stat *stbuf)
+
+{
+
+    int retval;

     retval = v9fs_request(fs_ctx->private, T_LSTAT, stbuf, "s", fs_path);

static int proxy_lstat(FsContext *fs_ctx, V9fsPath *fs_path, struct stat *stbuf)

{

    int retval;

    retval = v9fs_request(fs_ctx->private, T_LSTAT, stbuf, "s", fs_path);

    if (retval < 0) {

        errno = -retval;

        return -1;

    }

    return retval;

}


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

+    VTD_DPRINTF(CSR, "int remap table addr 0x%"PRIx64 " size %"PRIu32,
+
+                s->intr_root, s->intr_size);
+
+}

static void vtd_interrupt_remap_table_setup(IntelIOMMUState *s)

{

    uint64_t value = 0;

    value = vtd_get_quad_raw(s, DMAR_IRTA_REG);

    s->intr_size = 1UL << ((value & VTD_IRTA_SIZE_MASK) + 1);

    s->intr_root = value & VTD_IRTA_ADDR_MASK;

    /* TODO: invalidate interrupt entry cache */

    VTD_DPRINTF(CSR, "int remap table addr 0x%"PRIx64 " size %"PRIu32,

                s->intr_root, s->intr_size);

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
             pstrcat(id, sizeof(id), "/");

             g_free(path);
+
+        }
+
+    }
+
     pstrcat(id, sizeof(id), idstr);

void register_device_unmigratable(DeviceState *dev, const char *idstr,

                                                            void *opaque)

{

    SaveStateEntry *se;

    char id[256] = "";

    if (dev && dev->parent_bus && dev->parent_bus->info->get_dev_path) {

        char *path = dev->parent_bus->info->get_dev_path(dev);

        if (path) {

            pstrcpy(id, sizeof(id), path);

            pstrcat(id, sizeof(id), "/");

            g_free(path);

        }

    }

    pstrcat(id, sizeof(id), idstr);

    QTAILQ_FOREACH(se, &savevm_handlers, entry) {

        if (strcmp(se->idstr, id) == 0 && se->opaque == opaque) {

            se->no_migrate = 1;

        }

    }

}


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

    int i, d;

    const int index_a = qp + h->slice_alpha_c0_offset;

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

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

    if( bS[0] < 4 ) {

        int8_t tc[4];

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

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

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

    } else {

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

    }

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     AVFrame frame;

     int i = 0;
+

     av_init_packet(&pkt);

static void show_packets(WriterContext *w, AVFormatContext *fmt_ctx)

{

    AVPacket pkt;

    AVFrame frame;

    int i = 0;

    av_init_packet(&pkt);

    while (!av_read_frame(fmt_ctx, &pkt)) {

        if (do_show_packets)

            show_packet(w, fmt_ctx, &pkt, i++);

        if (do_show_frames &&

            get_video_frame(fmt_ctx, &frame, &pkt)) {

            show_frame(w, &frame, fmt_ctx->streams[pkt.stream_index]);

            av_destruct_packet(&pkt);

        }

    }

    av_init_packet(&pkt);

    pkt.data = NULL;

    pkt.size = 0;

    //Flush remaining frames that are cached in the decoder

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

        pkt.stream_index = i;

        while (get_video_frame(fmt_ctx, &frame, &pkt))

            show_frame(w, &frame, fmt_ctx->streams[pkt.stream_index]);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)
+
+{
+
     QEMUBH *bh;

QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)

{

    QEMUBH *bh;

    bh = qemu_malloc(sizeof(*bh));

    bh->cb = cb;

    bh->opaque = opaque;

    return bh;

}


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

 	DIS(fprintf (logfile, "addi.%c $r%u, $r%u, $acr\n",

+		  memsize_char(memsize_zz(dc)), dc->op2, dc->op1));
+
+	cris_cc_mask(dc, 0);
+
+	t0 = tcg_temp_new(TCG_TYPE_TL);

 	tcg_gen_shl_tl(t0, cpu_R[dc->op2], tcg_const_tl(dc->zzsize));

static unsigned int dec_addi_acr(DisasContext *dc)

{

	TCGv t0;

	DIS(fprintf (logfile, "addi.%c $r%u, $r%u, $acr\n",

		  memsize_char(memsize_zz(dc)), dc->op2, dc->op1));

	cris_cc_mask(dc, 0);

	t0 = tcg_temp_new(TCG_TYPE_TL);

	tcg_gen_shl_tl(t0, cpu_R[dc->op2], tcg_const_tl(dc->zzsize));

	tcg_gen_add_tl(cpu_R[R_ACR], cpu_R[dc->op1], t0);

	tcg_temp_free(t0);

	return 2;

}


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

     if (term_cmd_buf_index > 0) {

static void term_backward_char(void)

{

    if (term_cmd_buf_index > 0) {

        term_cmd_buf_index--;

    }

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
         gen_op_addq_EDI_T0();

     } else
+
+#endif
+
+    if (s->aflag) {
+
         gen_op_addl_ESI_T0();

         gen_op_addl_EDI_T0();

static inline void gen_cmps(DisasContext *s, int ot)

{

    gen_string_movl_A0_ESI(s);

    gen_op_ld_T0_A0(ot + s->mem_index);

    gen_string_movl_A0_EDI(s);

    gen_op_ld_T1_A0(ot + s->mem_index);

    gen_op_cmpl_T0_T1_cc();

    gen_op_movl_T0_Dshift[ot]();

#ifdef TARGET_X86_64

    if (s->aflag == 2) {

        gen_op_addq_ESI_T0();

        gen_op_addq_EDI_T0();

    } else

#endif

    if (s->aflag) {

        gen_op_addl_ESI_T0();

        gen_op_addl_EDI_T0();

    } else {

        gen_op_addw_ESI_T0();

        gen_op_addw_EDI_T0();

    }

}


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

 {

+    SocketAddress *saddr = socket_address_crumple(saddr_flat);
+
+    QIOChannelSocket *sioc;
+
+    Error *local_err = NULL;

static QIOChannelSocket *nbd_establish_connection(SocketAddressFlat *saddr_flat,

                                                  Error **errp)

{

    SocketAddress *saddr = socket_address_crumple(saddr_flat);

    QIOChannelSocket *sioc;

    Error *local_err = NULL;

    sioc = qio_channel_socket_new();

    qio_channel_set_name(QIO_CHANNEL(sioc), "nbd-client");

    qio_channel_socket_connect_sync(sioc,

                                    saddr,

                                    &local_err);

    qapi_free_SocketAddress(saddr);

    if (local_err) {

        object_unref(OBJECT(sioc));

        error_propagate(errp, local_err);

        return NULL;

    }

    qio_channel_set_delay(QIO_CHANNEL(sioc), false);

    return sioc;

}


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

     if (!avctx)

+        return;
+
+
+
+    avcodec_close(avctx);

void avcodec_free_context(AVCodecContext **pavctx)

{

    AVCodecContext *avctx = *pavctx;

    if (!avctx)

        return;

    avcodec_close(avctx);

    av_freep(&avctx->extradata);

    av_freep(&avctx->subtitle_header);

    av_freep(pavctx);

}


static int kvm_sclp_service_call(CPUS390XState *env, struct kvm_run *run,

                                 uint16_t ipbh0)

{

    uint32_t sccb;

    uint64_t code;

    int r = 0;

    cpu_synchronize_state(env);

    sccb = env->regs[ipbh0 & 0xf];

    code = env->regs[(ipbh0 & 0xf0) >> 4];

    r = sclp_service_call(env, sccb, code);

    if (r) {

        setcc(env, 3);

    }

    return 0;

}


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

     unsigned int nb_entries = avio_rb32(pb);

+    for (i = 0; i < nb_entries; i++) {
+
+        char key[32];
+
+        char value[1024];

         avio_get_str(pb, INT_MAX, key, sizeof(key));

static void read_info_chunk(AVFormatContext *s, int64_t size)

{

    AVIOContext *pb = s->pb;

    unsigned int i;

    unsigned int nb_entries = avio_rb32(pb);

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

        char key[32];

        char value[1024];

        avio_get_str(pb, INT_MAX, key, sizeof(key));

        avio_get_str(pb, INT_MAX, value, sizeof(value));

        av_dict_set(&s->metadata, key, value, 0);

    }

}


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

     target_ulong li, target;

+
+
+    ctx->exception = POWERPC_EXCP_BRANCH;
+
+    /* sign extend LI */

 #if defined(TARGET_PPC64)

static void gen_b(DisasContext *ctx)

{

    target_ulong li, target;

    ctx->exception = POWERPC_EXCP_BRANCH;

    /* sign extend LI */

#if defined(TARGET_PPC64)

    if (ctx->sf_mode)

        li = ((int64_t)LI(ctx->opcode) << 38) >> 38;

    else

#endif

        li = ((int32_t)LI(ctx->opcode) << 6) >> 6;

    if (likely(AA(ctx->opcode) == 0))

        target = ctx->nip + li - 4;

    else

        target = li;

    if (LK(ctx->opcode))

        gen_setlr(ctx, ctx->nip);

    gen_goto_tb(ctx, 0, target);

}