--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     OCVContext *ocv = ctx->priv;

     DilateContext *dilate = ocv->priv;
+
     char default_kernel_str[] = "3x3+0x0/rect";
+
     char *kernel_str;
+
     const char *buf = args;

     int ret;

static av_cold int dilate_init(AVFilterContext *ctx, const char *args)

{

    OCVContext *ocv = ctx->priv;

    DilateContext *dilate = ocv->priv;

    char default_kernel_str[] = "3x3+0x0/rect";

    char *kernel_str;

    const char *buf = args;

    int ret;

    dilate->nb_iterations = 1;

    if (args)

        kernel_str = av_get_token(&buf, "|");

    if ((ret = parse_iplconvkernel(&dilate->kernel,

                                   *kernel_str ? kernel_str : default_kernel_str,

                                   ctx)) < 0)

        return ret;

    av_free(kernel_str);

    sscanf(buf, "|%d", &dilate->nb_iterations);

    av_log(ctx, AV_LOG_VERBOSE, "iterations_nb:%d\n", dilate->nb_iterations);

    if (dilate->nb_iterations <= 0) {

        av_log(ctx, AV_LOG_ERROR, "Invalid non-positive value '%d' for nb_iterations\n",

               dilate->nb_iterations);

        return AVERROR(EINVAL);

    }

    return 0;

}


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

 {

+    CPUState *cpu = ENV_GET_CPU(cpu_env);
+
+    int sig;
+
     TaskState *ts = cpu->opaque;

+
     if (!ts->signal_pending)

         return;

void process_pending_signals(CPUArchState *cpu_env)

{

    CPUState *cpu = ENV_GET_CPU(cpu_env);

    int sig;

    TaskState *ts = cpu->opaque;

    if (!ts->signal_pending)

        return;

    /* FIXME: This is not threadsafe.  */

    for(sig = 1; sig <= TARGET_NSIG; sig++) {

        if (ts->sigtab[sig - 1].pending) {

            handle_pending_signal(cpu_env, sig);

            return;

        }

    }

    /* if no signal is pending, just return */

    ts->signal_pending = 0;

    return;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int nbd_handle_list(NBDClient *client, uint32_t length)

+{
+
+    int csock;
+
+    NBDExport *exp;

static int nbd_handle_list(NBDClient *client, uint32_t length)

{

    int csock;

    NBDExport *exp;

    csock = client->sock;

    if (length) {

        if (drop_sync(csock, length) != length) {

            return -EIO;

        }

        return nbd_send_rep(csock, NBD_REP_ERR_INVALID, NBD_OPT_LIST);

    }

    /* For each export, send a NBD_REP_SERVER reply. */

    QTAILQ_FOREACH(exp, &exports, next) {

        if (nbd_send_rep_list(csock, exp)) {

            return -EINVAL;

        }

    }

    /* Finish with a NBD_REP_ACK. */

    return nbd_send_rep(csock, NBD_REP_ACK, NBD_OPT_LIST);

}


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

+    return false;
+
+}

bool aio_prepare(AioContext *ctx)

{

    /* Poll mode cannot be used with glib's event loop, disable it. */

    poll_set_started(ctx, false);

    return false;

}


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

 {

+    int i;

     float speech_energy = 0.0, postfilter_energy = 0.0, gain_scale_factor;

static void adaptive_gain_control(float *out, const float *in,

                                  const float *speech_synth,

                                  int size, float alpha, float *gain_mem)

{

    int i;

    float speech_energy = 0.0, postfilter_energy = 0.0, gain_scale_factor;

    float mem = *gain_mem;

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

        speech_energy     += fabsf(speech_synth[i]);

        postfilter_energy += fabsf(in[i]);

    }

    gain_scale_factor = (1.0 - alpha) * speech_energy / postfilter_energy;

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

        mem = alpha * mem + gain_scale_factor;

        out[i] = in[i] * mem;

    }

    *gain_mem = mem;

}


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

     iocb = qemu_aio_get(&trim_aiocb_info, bs, cb, opaque);
+
+    iocb->bh = qemu_bh_new(ide_trim_bh_cb, iocb);
+
+    iocb->ret = 0;
+
     iocb->qiov = qiov;

     iocb->i = -1;

BlockAIOCB *ide_issue_trim(BlockDriverState *bs,

        int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,

        BlockCompletionFunc *cb, void *opaque)

{

    TrimAIOCB *iocb;

    iocb = qemu_aio_get(&trim_aiocb_info, bs, cb, opaque);

    iocb->bh = qemu_bh_new(ide_trim_bh_cb, iocb);

    iocb->ret = 0;

    iocb->qiov = qiov;

    iocb->i = -1;

    iocb->j = 0;

    ide_issue_trim_cb(iocb, 0);

    return &iocb->common;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int vhost_verify_ring_mappings(struct vhost_dev *dev,

+                                      uint64_t start_addr,

                                       uint64_t size)

@@ -11,15 +11,15 @@
     for (i = 0; i < dev->nvqs; ++i) {

         struct vhost_virtqueue *vq = dev->vqs + i;
+
         hwaddr l;

         void *p;
+

         if (!ranges_overlap(start_addr, size, vq->ring_phys, vq->ring_size)) {
+
             continue;

         }

static int vhost_verify_ring_mappings(struct vhost_dev *dev,

                                      uint64_t start_addr,

                                      uint64_t size)

{

    int i;

    for (i = 0; i < dev->nvqs; ++i) {

        struct vhost_virtqueue *vq = dev->vqs + i;

        hwaddr l;

        void *p;

        if (!ranges_overlap(start_addr, size, vq->ring_phys, vq->ring_size)) {

            continue;

        }

        l = vq->ring_size;

        p = cpu_physical_memory_map(vq->ring_phys, &l, 1);

        if (!p || l != vq->ring_size) {

            fprintf(stderr, "Unable to map ring buffer for ring %d\n", i);

            return -ENOMEM;

        }

        if (p != vq->ring) {

            fprintf(stderr, "Ring buffer relocated for ring %d\n", i);

            return -EBUSY;

        }

        cpu_physical_memory_unmap(p, l, 0, 0);

    }

    return 0;

}


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

         target_el = 3;

+        break;
+
+    case CP_ACCESS_TRAP_UNCATEGORIZED:
+
+        target_el = exception_target_el(env);

         syndrome = syn_uncategorized();

void HELPER(access_check_cp_reg)(CPUARMState *env, void *rip, uint32_t syndrome)

{

    const ARMCPRegInfo *ri = rip;

    int target_el;

    if (arm_feature(env, ARM_FEATURE_XSCALE) && ri->cp < 14

        && extract32(env->cp15.c15_cpar, ri->cp, 1) == 0) {

        raise_exception(env, EXCP_UDEF, syndrome, exception_target_el(env));

    }

    if (!ri->accessfn) {

        return;

    }

    switch (ri->accessfn(env, ri)) {

    case CP_ACCESS_OK:

        return;

    case CP_ACCESS_TRAP:

        target_el = exception_target_el(env);

        break;

    case CP_ACCESS_TRAP_EL2:

        /* Requesting a trap to EL2 when we're in EL3 or S-EL0/1 is

         * a bug in the access function.

         */

        assert(!arm_is_secure(env) && !arm_current_el(env) == 3);

        target_el = 2;

        break;

    case CP_ACCESS_TRAP_EL3:

        target_el = 3;

        break;

    case CP_ACCESS_TRAP_UNCATEGORIZED:

        target_el = exception_target_el(env);

        syndrome = syn_uncategorized();

        break;

    default:

        g_assert_not_reached();

    }

    raise_exception(env, EXCP_UDEF, syndrome, target_el);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static inline int put_dwords(uint32_t addr, uint32_t *buf, int num)

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

         uint32_t tmp = cpu_to_le32(*buf);

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

{

    int i;

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

        uint32_t tmp = cpu_to_le32(*buf);

        cpu_physical_memory_rw(addr,(uint8_t *)&tmp, sizeof(tmp), 1);

    }

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void arm_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu)

+{

     DisasContext *dc = container_of(dcbase, DisasContext, base);

static void arm_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu)

{

    DisasContext *dc = container_of(dcbase, DisasContext, base);

    dc->insn_start_idx = tcg_op_buf_count();

    tcg_gen_insn_start(dc->pc,

                       (dc->condexec_cond << 4) | (dc->condexec_mask >> 1),

                       0);

}


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

+    if (s->identify_set) {
+
+        blk_set_enable_write_cache(s->blk, !!(s->identify_data[85] & (1 << 5)));
+
     }

     return 0;

static int ide_drive_post_load(void *opaque, int version_id)

{

    IDEState *s = opaque;

    if (s->identify_set) {

        blk_set_enable_write_cache(s->blk, !!(s->identify_data[85] & (1 << 5)));

    }

    return 0;

}


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

     v = validate_test_init_raw(data, schema_json);
+
+
+
+    visit_type_SchemaInfoList(v, NULL, &schema, &error_abort);
+
     g_assert(schema);

static void do_test_validate_qmp_introspect(TestInputVisitorData *data,

                                            const char *schema_json)

{

    SchemaInfoList *schema = NULL;

    Visitor *v;

    v = validate_test_init_raw(data, schema_json);

    visit_type_SchemaInfoList(v, NULL, &schema, &error_abort);

    g_assert(schema);

    qapi_free_SchemaInfoList(schema);

}


--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
     /* qemu_aio_flush will execute the rest of the coroutine.  */

+
+    qemu_aio_flush();
+
+
+
     /* Back here after the coroutine has finished.  */

static void test_submit_co(void)

{

    WorkerTestData data;

    Coroutine *co = qemu_coroutine_create(co_test_cb);

    qemu_coroutine_enter(co, &data);

    /* Back here once the worker has started.  */

    g_assert_cmpint(active, ==, 1);

    g_assert_cmpint(data.ret, ==, -EINPROGRESS);

    /* qemu_aio_flush will execute the rest of the coroutine.  */

    qemu_aio_flush();

    /* Back here after the coroutine has finished.  */

    g_assert_cmpint(active, ==, 0);

    g_assert_cmpint(data.ret, ==, 0);

}


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

         } else {

+            pci_set_long(dev->config + pci_bar(dev, r), region->type);
+
+        }
+
+    }

     pci_update_mappings(dev);

static void pci_device_reset(PCIDevice *dev)

{

    int r;

    dev->irq_state = 0;

    pci_update_irq_status(dev);

    /* Clear all writeable bits */

    pci_word_test_and_clear_mask(dev->config + PCI_COMMAND,

                                 pci_get_word(dev->wmask + PCI_COMMAND));

    dev->config[PCI_CACHE_LINE_SIZE] = 0x0;

    dev->config[PCI_INTERRUPT_LINE] = 0x0;

    for (r = 0; r < PCI_NUM_REGIONS; ++r) {

        PCIIORegion *region = &dev->io_regions[r];

        if (!region->size) {

            continue;

        }

        if (!(region->type & PCI_BASE_ADDRESS_SPACE_IO) &&

            region->type & PCI_BASE_ADDRESS_MEM_TYPE_64) {

            pci_set_quad(dev->config + pci_bar(dev, r), region->type);

        } else {

            pci_set_long(dev->config + pci_bar(dev, r), region->type);

        }

    }

    pci_update_mappings(dev);

}


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

     g_assert(!throttle_enabled(&cfg));

+

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

static void test_enabled(void)

{

    int i;

    throttle_config_init(&cfg);

    g_assert(!throttle_enabled(&cfg));

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

        throttle_config_init(&cfg);

        set_cfg_value(false, i, 150);

        g_assert(throttle_enabled(&cfg));

    }

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

        throttle_config_init(&cfg);

        set_cfg_value(false, i, -150);

        g_assert(!throttle_enabled(&cfg));

    }

}


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

+    initial_reset_issued = 1;
+
+
+
     TAILQ_FOREACH(chr, &chardevs, next) {

         qemu_chr_reset(chr);

void qemu_chr_initial_reset(void)

{

    CharDriverState *chr;

    initial_reset_issued = 1;

    TAILQ_FOREACH(chr, &chardevs, next) {

        qemu_chr_reset(chr);

    }

}


--- a/source.c
+++ b/source.c
@@ -9,10 +9,10 @@
     if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))

         return AVERROR(EINVAL);
+
+

+    if (avctx->internal->draining)

         return AVERROR_EOF;

int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)

{

    int ret;

    if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))

        return AVERROR(EINVAL);

    if (avctx->internal->draining)

        return AVERROR_EOF;

    if (!avpkt || !avpkt->size) {

        avctx->internal->draining = 1;

        avpkt = NULL;

        if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY))

            return 0;

    }

    if (avctx->codec->send_packet) {

        if (avpkt) {

            ret = apply_param_change(avctx, (AVPacket *)avpkt);

            if (ret < 0)

                return ret;

        }

        return avctx->codec->send_packet(avctx, avpkt);

    }

    // Emulation via old API. Assume avpkt is likely not refcounted, while

    // decoder output is always refcounted, and avoid copying.

    if (avctx->internal->buffer_pkt->size || avctx->internal->buffer_frame->buf[0])

        return AVERROR(EAGAIN);

    // The goal is decoding the first frame of the packet without using memcpy,

    // because the common case is having only 1 frame per packet (especially

    // with video, but audio too). In other cases, it can't be avoided, unless

    // the user is feeding refcounted packets.

    return do_decode(avctx, (AVPacket *)avpkt);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,

+                          VdpGetProcAddress *get_proc, unsigned flags)

 {

int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,

                          VdpGetProcAddress *get_proc, unsigned flags)

{

    VDPAUHWContext *hwctx;

    if (flags != 0)

        return AVERROR(EINVAL);

    if (av_reallocp(&avctx->hwaccel_context, sizeof(*hwctx)))

        return AVERROR(ENOMEM);

    hwctx = avctx->hwaccel_context;

    memset(hwctx, 0, sizeof(*hwctx));

    hwctx->context.decoder  = VDP_INVALID_HANDLE;

    hwctx->device           = device;

    hwctx->get_proc_address = get_proc;

    hwctx->reset            = 1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 void ff_mqc_init_contexts(MqcState *mqc)

 {
+
+    int i;
+
+    memset(mqc->cx_states, 0, sizeof(mqc->cx_states));
+
     mqc->cx_states[MQC_CX_UNI] = 2 * 46;

     mqc->cx_states[MQC_CX_RL]  = 2 * 3;

void ff_mqc_init_contexts(MqcState *mqc)

{

    int i;

    memset(mqc->cx_states, 0, sizeof(mqc->cx_states));

    mqc->cx_states[MQC_CX_UNI] = 2 * 46;

    mqc->cx_states[MQC_CX_RL]  = 2 * 3;

    mqc->cx_states[0]          = 2 * 4;

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

        ff_mqc_qe[2 * i]     =

        ff_mqc_qe[2 * i + 1] = cx_states[i].qe;

        ff_mqc_nlps[2 * i]     = 2 * cx_states[i].nlps + cx_states[i].sw;

        ff_mqc_nlps[2 * i + 1] = 2 * cx_states[i].nlps + 1 - cx_states[i].sw;

        ff_mqc_nmps[2 * i]     = 2 * cx_states[i].nmps;

        ff_mqc_nmps[2 * i + 1] = 2 * cx_states[i].nmps + 1;

    }

}


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

     }

+
+
+    timer_del(icount_warp_timer);
+
+    icount_warp_rt();

 }

static void qemu_account_warp_timer(void)

{

    if (!use_icount || !icount_sleep) {

        return;

    }

    /* Nothing to do if the VM is stopped: QEMU_CLOCK_VIRTUAL timers

     * do not fire, so computing the deadline does not make sense.

     */

    if (!runstate_is_running()) {

        return;

    }

    /* warp clock deterministically in record/replay mode */

    if (!replay_checkpoint(CHECKPOINT_CLOCK_WARP_ACCOUNT)) {

        return;

    }

    timer_del(icount_warp_timer);

    icount_warp_rt();

}


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

     wait = le16_to_cpu(current->command) & WAIT_MASK;
+
+
+
+    switch(wait) {
+
     case WAIT_NEVER:  /* don't wait */

         return 0;

static int conditional_wait(DBDMA_channel *ch)

{

    dbdma_cmd *current = &ch->current;

    uint16_t wait;

    uint16_t sel_mask, sel_value;

    uint32_t status;

    int cond;

    DBDMA_DPRINTF("conditional_wait\n");

    wait = le16_to_cpu(current->command) & WAIT_MASK;

    switch(wait) {

    case WAIT_NEVER:  /* don't wait */

        return 0;

    case WAIT_ALWAYS: /* always wait */

        return 1;

    }

    status = be32_to_cpu(ch->regs[DBDMA_STATUS]) & DEVSTAT;

    sel_mask = (be32_to_cpu(ch->regs[DBDMA_WAIT_SEL]) >> 16) & 0x0f;

    sel_value = be32_to_cpu(ch->regs[DBDMA_WAIT_SEL]) & 0x0f;

    cond = (status & sel_mask) == (sel_value & sel_mask);

    switch(wait) {

    case WAIT_IFSET:  /* wait if condition bit is 1 */

        if (cond)

            return 1;

        return 0;

    case WAIT_IFCLR:  /* wait if condition bit is 0 */

        if (!cond)

            return 1;

        return 0;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+void ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src)

+{

     MpegEncContext bak;

void ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src)

{

    MpegEncContext bak;

    int i;

    // FIXME copy only needed parts

    // START_TIMER

    backup_duplicate_context(&bak, dst);

    memcpy(dst, src, sizeof(MpegEncContext));

    backup_duplicate_context(dst, &bak);

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

        dst->pblocks[i] = &dst->block[i];

    }

    // STOP_TIMER("update_duplicate_context")

    // about 10k cycles / 0.01 sec for  1000frames on 1ghz with 2 threads

}


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

+    QObject *obj = qobject_from_json(empty);
+
+    fail_unless(obj == NULL);

 }

START_TEST(empty_input)

{

    const char *empty = "";

    QObject *obj = qobject_from_json(empty);

    fail_unless(obj == NULL);

}


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

     if (s->match.addr > 127) {
+
+        error_setg(errp, "hostaddr out of range");
+
+        return;
+
     }

static void usb_host_realize(USBDevice *udev, Error **errp)

{

    USBHostDevice *s = USB_HOST_DEVICE(udev);

    if (s->match.vendor_id > 0xffff) {

        error_setg(errp, "vendorid out of range");

        return;

    }

    if (s->match.product_id > 0xffff) {

        error_setg(errp, "productid out of range");

        return;

    }

    if (s->match.addr > 127) {

        error_setg(errp, "hostaddr out of range");

        return;

    }

    loglevel = s->loglevel;

    udev->flags |= (1 << USB_DEV_FLAG_IS_HOST);

    udev->auto_attach = 0;

    QTAILQ_INIT(&s->requests);

    QTAILQ_INIT(&s->isorings);

    s->exit.notify = usb_host_exit_notifier;

    qemu_add_exit_notifier(&s->exit);

    QTAILQ_INSERT_TAIL(&hostdevs, s, next);

    usb_host_auto_check(NULL);

}


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

     }

+    g_free(chr->filename);
+
+    g_free(chr->label);
+
     qemu_opts_del(chr->opts);

     g_free(chr);

void qemu_chr_free(CharDriverState *chr)

{

    if (chr->chr_close) {

        chr->chr_close(chr);

    }

    g_free(chr->filename);

    g_free(chr->label);

    qemu_opts_del(chr->opts);

    g_free(chr);

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
 void smc91c111_init(NICInfo *nd, uint32_t base, qemu_irq irq)

+{

     smc91c111_state *s;
+
+    int iomemtype;

+    qemu_check_nic_model(nd, "smc91c111");

void smc91c111_init(NICInfo *nd, uint32_t base, qemu_irq irq)

{

    smc91c111_state *s;

    int iomemtype;

    qemu_check_nic_model(nd, "smc91c111");

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

    iomemtype = cpu_register_io_memory(0, smc91c111_readfn,

                                       smc91c111_writefn, s);

    cpu_register_physical_memory(base, 16, iomemtype);

    s->irq = irq;

    memcpy(s->macaddr, nd->macaddr, 6);

    smc91c111_reset(s);

    s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,

                                 smc91c111_receive, smc91c111_can_receive, s);

    qemu_format_nic_info_str(s->vc, s->macaddr);

    /* ??? Save/restore.  */

}


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

     qemu_chr_fe_claim_no_fail(chr);

+    monitor_init(chr, flags);
+
+    return 0;
+
+}

static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp)

{

    CharDriverState *chr;

    const char *chardev;

    const char *mode;

    int flags;

    mode = qemu_opt_get(opts, "mode");

    if (mode == NULL) {

        mode = "readline";

    }

    if (strcmp(mode, "readline") == 0) {

        flags = MONITOR_USE_READLINE;

    } else if (strcmp(mode, "control") == 0) {

        flags = MONITOR_USE_CONTROL;

    } else {

        fprintf(stderr, "unknown monitor mode \"%s\"\n", mode);

        exit(1);

    }

    if (qemu_opt_get_bool(opts, "pretty", 0))

        flags |= MONITOR_USE_PRETTY;

    if (qemu_opt_get_bool(opts, "default", 0))

        flags |= MONITOR_IS_DEFAULT;

    chardev = qemu_opt_get(opts, "chardev");

    chr = qemu_chr_find(chardev);

    if (chr == NULL) {

        fprintf(stderr, "chardev \"%s\" not found\n", chardev);

        exit(1);

    }

    qemu_chr_fe_claim_no_fail(chr);

    monitor_init(chr, flags);

    return 0;

}


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

     uint64_t interval = GUI_REFRESH_INTERVAL;
+
+
+
     qemu_flush_coalesced_mmio_buffer();

     qemu_mod_timer(nographic_timer, interval + qemu_get_clock(rt_clock));

static void nographic_update(void *opaque)

{

    uint64_t interval = GUI_REFRESH_INTERVAL;

    qemu_flush_coalesced_mmio_buffer();

    qemu_mod_timer(nographic_timer, interval + qemu_get_clock(rt_clock));

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 uint8_t *ff_stream_new_side_data(AVStream *st, enum AVPacketSideDataType type,
+
+                                 int size)
+
+{
+
     AVPacketSideData *sd, *tmp;

     int i;

uint8_t *ff_stream_new_side_data(AVStream *st, enum AVPacketSideDataType type,

                                 int size)

{

    AVPacketSideData *sd, *tmp;

    int i;

    uint8_t *data = av_malloc(size);

    if (!data)

        return NULL;

    for (i = 0; i < st->nb_side_data; i++) {

        sd = &st->side_data[i];

        if (sd->type == type) {

            av_freep(&sd->data);

            sd->data = data;

            sd->size = size;

            return sd->data;

        }

    }

    tmp = av_realloc_array(st->side_data, st->nb_side_data + 1, sizeof(*tmp));

    if (!tmp) {

        av_freep(&data);

        return NULL;

    }

    st->side_data = tmp;

    st->nb_side_data++;

    sd = &st->side_data[st->nb_side_data - 1];

    sd->type = type;

    sd->data = data;

    sd->size = size;

    return data;

}


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

     int size;
+

     if (kernel_filename == NULL && qtest_enabled()) {

static void puv3_load_kernel(const char *kernel_filename)

{

    int size;

    if (kernel_filename == NULL && qtest_enabled()) {

        return;

    }

    assert(kernel_filename != NULL);

    /* only zImage format supported */

    size = load_image_targphys(kernel_filename, KERNEL_LOAD_ADDR,

            KERNEL_MAX_SIZE);

    if (size < 0) {

        error_report("Load kernel error: '%s'", kernel_filename);

        exit(1);

    }

    /* cheat curses that we have a graphic console, only under ocd console */

    graphic_console_init(NULL, 0, &no_ops, NULL);

}


--- a/source.c
+++ b/source.c
@@ -12,11 +12,11 @@
     s->block_size = be32_to_cpu(s->block_size);
     ret = bdrv_pread(bs->file, 128 + 4, &s->n_blocks, 4);
     if (ret < 0) {
+        return ret;
+    s->n_blocks = be32_to_cpu(s->n_blocks);
+    /* read offsets */
+    offsets_size = s->n_blocks * sizeof(uint64_t);
+    s->offsets = g_malloc(offsets_size);
     ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size);
     if (ret < 0) {
         goto fail;

static int cloop_open(BlockDriverState *bs, QDict *options, int flags,
                      Error **errp)
{
    BDRVCloopState *s = bs->opaque;
    uint32_t offsets_size, max_compressed_block_size = 1, i;
    int ret;
    bs->read_only = 1;
    /* read header */
    ret = bdrv_pread(bs->file, 128, &s->block_size, 4);
    if (ret < 0) {
        return ret;
    s->block_size = be32_to_cpu(s->block_size);
    ret = bdrv_pread(bs->file, 128 + 4, &s->n_blocks, 4);
    if (ret < 0) {
        return ret;
    s->n_blocks = be32_to_cpu(s->n_blocks);
    /* read offsets */
    offsets_size = s->n_blocks * sizeof(uint64_t);
    s->offsets = g_malloc(offsets_size);
    ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size);
    if (ret < 0) {
        goto fail;
    for(i=0;i<s->n_blocks;i++) {
        s->offsets[i] = be64_to_cpu(s->offsets[i]);
        if (i > 0) {
            uint32_t size = s->offsets[i] - s->offsets[i - 1];
            if (size > max_compressed_block_size) {
                max_compressed_block_size = size;
    /* initialize zlib engine */
    s->compressed_block = g_malloc(max_compressed_block_size + 1);
    s->uncompressed_block = g_malloc(s->block_size);
    if (inflateInit(&s->zstream) != Z_OK) {
        ret = -EINVAL;
        goto fail;
    s->current_block = s->n_blocks;
    s->sectors_per_block = s->block_size/512;
    bs->total_sectors = s->n_blocks * s->sectors_per_block;
    qemu_co_mutex_init(&s->lock);
    return 0;
fail:
    g_free(s->offsets);
    g_free(s->compressed_block);
    g_free(s->uncompressed_block);
    return ret;


--- a/source.c
+++ b/source.c
@@ -5,10 +5,10 @@
     AcpiBuildPciBusHotplugState *parent = parent_state;

     AcpiBuildPciBusHotplugState *child = g_malloc(sizeof *child);
+
+
+
+    build_pci_bus_state_init(child, parent, parent->pcihp_bridge_en);

static void *build_pci_bus_begin(PCIBus *bus, void *parent_state)

{

    AcpiBuildPciBusHotplugState *parent = parent_state;

    AcpiBuildPciBusHotplugState *child = g_malloc(sizeof *child);

    build_pci_bus_state_init(child, parent, parent->pcihp_bridge_en);

    return child;

}


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

 {

+    return async_context->id;

 }

int get_async_context_id(void)

{

    return async_context->id;

}


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

     ff_convert_matrix(&ctx->m.dsp, ctx->qmatrix_c, ctx->qmatrix_c16, weight_matrix,
+
+                      ctx->m.intra_quant_bias, 1, ctx->m.avctx->qmax, 1);
+
+    for (qscale = 1; qscale <= ctx->m.avctx->qmax; qscale++) {
+
         for (i = 0; i < 64; i++) {

             ctx->qmatrix_l  [qscale]   [i] <<= 2; ctx->qmatrix_c  [qscale]   [i] <<= 2;

static int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias)

{

    // init first elem to 1 to avoid div by 0 in convert_matrix

    uint16_t weight_matrix[64] = {1,}; // convert_matrix needs uint16_t*

    int qscale, i;

    CHECKED_ALLOCZ(ctx->qmatrix_l,   (ctx->m.avctx->qmax+1) * 64 * sizeof(int));

    CHECKED_ALLOCZ(ctx->qmatrix_c,   (ctx->m.avctx->qmax+1) * 64 * sizeof(int));

    CHECKED_ALLOCZ(ctx->qmatrix_l16, (ctx->m.avctx->qmax+1) * 64 * 2 * sizeof(uint16_t));

    CHECKED_ALLOCZ(ctx->qmatrix_c16, (ctx->m.avctx->qmax+1) * 64 * 2 * sizeof(uint16_t));

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

        int j = ctx->m.dsp.idct_permutation[ff_zigzag_direct[i]];

        weight_matrix[j] = ctx->cid_table->luma_weight[i];

    }

    ff_convert_matrix(&ctx->m.dsp, ctx->qmatrix_l, ctx->qmatrix_l16, weight_matrix,

                      ctx->m.intra_quant_bias, 1, ctx->m.avctx->qmax, 1);

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

        int j = ctx->m.dsp.idct_permutation[ff_zigzag_direct[i]];

        weight_matrix[j] = ctx->cid_table->chroma_weight[i];

    }

    ff_convert_matrix(&ctx->m.dsp, ctx->qmatrix_c, ctx->qmatrix_c16, weight_matrix,

                      ctx->m.intra_quant_bias, 1, ctx->m.avctx->qmax, 1);

    for (qscale = 1; qscale <= ctx->m.avctx->qmax; qscale++) {

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

            ctx->qmatrix_l  [qscale]   [i] <<= 2; ctx->qmatrix_c  [qscale]   [i] <<= 2;

            ctx->qmatrix_l16[qscale][0][i] <<= 2; ctx->qmatrix_l16[qscale][1][i] <<= 2;

            ctx->qmatrix_c16[qscale][0][i] <<= 2; ctx->qmatrix_c16[qscale][1][i] <<= 2;

        }

    }

    return 0;

 fail:

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
+{
+    MOVContext *mov = s->priv_data;
+    MOVStreamContext *sc;
+    AVIndexEntry *sample;
     AVStream *st = NULL;
     int ret;
     mov->fc = s;

static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
{
    MOVContext *mov = s->priv_data;
    MOVStreamContext *sc;
    AVIndexEntry *sample;
    AVStream *st = NULL;
    int ret;
    mov->fc = s;
 retry:
    sample = mov_find_next_sample(s, &st);
    if (!sample) {
        mov->found_mdat = 0;
        if (!mov->next_root_atom)
            return AVERROR_EOF;
        avio_seek(s->pb, mov->next_root_atom, SEEK_SET);
        mov->next_root_atom = 0;
        if (mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 ||
            url_feof(s->pb))
            return AVERROR_EOF;
        av_dlog(s, "read fragments, offset 0x%"PRIx64"\n", avio_tell(s->pb));
        goto retry;
    sc = st->priv_data;
    /* must be done just before reading, to avoid infinite loop on sample */
    sc->current_sample++;
    if (st->discard != AVDISCARD_ALL) {
        if (avio_seek(sc->pb, sample->pos, SEEK_SET) != sample->pos) {
            av_log(mov->fc, AV_LOG_ERROR, "stream %d, offset 0x%"PRIx64": partial file\n",
                   sc->ffindex, sample->pos);
            return AVERROR_INVALIDDATA;
        ret = av_get_packet(sc->pb, pkt, sample->size);
        if (ret < 0)
            return ret;
        if (sc->has_palette) {
            uint8_t *pal;
            pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE, AVPALETTE_SIZE);
            if (!pal) {
                av_log(mov->fc, AV_LOG_ERROR, "Cannot append palette to packet\n");
            } else {
                memcpy(pal, sc->palette, AVPALETTE_SIZE);
                sc->has_palette = 0;
#if CONFIG_DV_DEMUXER
        if (mov->dv_demux && sc->dv_audio_container) {
            avpriv_dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size, pkt->pos);
            av_free(pkt->data);
            pkt->size = 0;
            ret = avpriv_dv_get_packet(mov->dv_demux, pkt);
            if (ret < 0)
                return ret;
#endif
    pkt->stream_index = sc->ffindex;
    pkt->dts = sample->timestamp;
    if (sc->ctts_data && sc->ctts_index < sc->ctts_count) {
        pkt->pts = pkt->dts + sc->dts_shift + sc->ctts_data[sc->ctts_index].duration;
        /* update ctts context */
        sc->ctts_sample++;
        if (sc->ctts_index < sc->ctts_count &&
            sc->ctts_data[sc->ctts_index].count == sc->ctts_sample) {
            sc->ctts_index++;
            sc->ctts_sample = 0;
        if (sc->wrong_dts)
            pkt->dts = AV_NOPTS_VALUE;
    } else {
        int64_t next_dts = (sc->current_sample < st->nb_index_entries) ?
            st->index_entries[sc->current_sample].timestamp : st->duration;
        pkt->duration = next_dts - pkt->dts;
        pkt->pts = pkt->dts;
    if (st->discard == AVDISCARD_ALL)
        goto retry;
    pkt->flags |= sample->flags & AVINDEX_KEYFRAME ? AV_PKT_FLAG_KEY : 0;
    pkt->pos = sample->pos;
    av_dlog(s, "stream %d, pts %"PRId64", dts %"PRId64", pos 0x%"PRIx64", duration %d\n",
            pkt->stream_index, pkt->pts, pkt->dts, pkt->pos, pkt->duration);
    return 0;


--- a/source.c
+++ b/source.c
@@ -5,8 +5,8 @@
     int ch, i, cbits;

     s->lpc_order = get_bits(&s->gb, 5) + 1;
+
+    s->lpc_scaling = get_bits(&s->gb, 4);

     s->lpc_intbits = get_bits(&s->gb, 3) + 1;

decode_lpc(WmallDecodeCtx *s)

{

    int ch, i, cbits;

    s->lpc_order = get_bits(&s->gb, 5) + 1;

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

    s->lpc_intbits = get_bits(&s->gb, 3) + 1;

    cbits = s->lpc_scaling + s->lpc_intbits;

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

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

	    s->lpc_coefs[ch][i] = get_sbits(&s->gb, cbits);

	}

    }

}


void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev)

{

    int i, r;

    for (i = 0; i < hdev->nvqs; ++i) {

        vhost_virtqueue_cleanup(hdev,

                                vdev,

                                hdev->vqs + i,

                                i);

    }

    vhost_client_sync_dirty_bitmap(&hdev->client, 0,

                                   (target_phys_addr_t)~0x0ull);

    r = vdev->binding->set_guest_notifiers(vdev->binding_opaque, false);

    if (r < 0) {

        fprintf(stderr, "vhost guest notifier cleanup failed: %d\n", r);

        fflush(stderr);

    }

    assert (r >= 0);

    hdev->started = false;

    g_free(hdev->log);

    hdev->log = NULL;

    hdev->log_size = 0;

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     s->count_load_time = cpu_get_ticks();

     s->count_last_edge_check_time = s->count_load_time;
+
+    s->count = val;
+
+    if (s == &pit_channels[0] && val <= pit_min_timer_count) {
+
         fprintf(stderr,

                 "\nWARNING: qemu: on your system, accurate timer emulation is impossible if its frequency is more than %d Hz. If using a 2.5.xx Linux kernel, you must patch asm/param.h to change HZ from 1000 to 100.\n\n",

static inline void pit_load_count(PITChannelState *s, int val)

{

    if (val == 0)

        val = 0x10000;

    s->count_load_time = cpu_get_ticks();

    s->count_last_edge_check_time = s->count_load_time;

    s->count = val;

    if (s == &pit_channels[0] && val <= pit_min_timer_count) {

        fprintf(stderr,

                "\nWARNING: qemu: on your system, accurate timer emulation is impossible if its frequency is more than %d Hz. If using a 2.5.xx Linux kernel, you must patch asm/param.h to change HZ from 1000 to 100.\n\n",

                PIT_FREQ / pit_min_timer_count);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+target_ulong helper_evpe(target_ulong arg1)
+
+{

     // TODO

target_ulong helper_evpe(target_ulong arg1)

{

    // TODO

    arg1 = 0;

    // rt = arg1

    return arg1;

}


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

     void *fdt = vbi->fdt;

+    ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(0));
+
+
+
+    /* No PSCI for TCG yet */

     if (kvm_enabled()) {

static void fdt_add_psci_node(const VirtBoardInfo *vbi)

{

    void *fdt = vbi->fdt;

    ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(0));

    /* No PSCI for TCG yet */

    if (kvm_enabled()) {

        qemu_fdt_add_subnode(fdt, "/psci");

        if (armcpu->psci_version == 2) {

            const char comp[] = "arm,psci-0.2\0arm,psci";

            qemu_fdt_setprop(fdt, "/psci", "compatible", comp, sizeof(comp));

        } else {

            qemu_fdt_setprop_string(fdt, "/psci", "compatible", "arm,psci");

        }

        qemu_fdt_setprop_string(fdt, "/psci", "method", "hvc");

        qemu_fdt_setprop_cell(fdt, "/psci", "cpu_suspend",

                                  QEMU_PSCI_0_1_FN_CPU_SUSPEND);

        qemu_fdt_setprop_cell(fdt, "/psci", "cpu_off", QEMU_PSCI_0_1_FN_CPU_OFF);

        qemu_fdt_setprop_cell(fdt, "/psci", "cpu_on", QEMU_PSCI_0_1_FN_CPU_ON);

        qemu_fdt_setprop_cell(fdt, "/psci", "migrate", QEMU_PSCI_0_1_FN_MIGRATE);

    }

}


--- a/source.c
+++ b/source.c
@@ -11,9 +11,9 @@
     if (addr & 7)

         ide_ioport_write(&s->bus, addr, val);
+
+    else
+
+        ide_data_writew(&s->bus, 0, val);

 }

static void mmio_ide_write(void *opaque, target_phys_addr_t addr,

                           uint64_t val, unsigned size)

{

    MMIOState *s = opaque;

    addr >>= s->shift;

    if (addr & 7)

        ide_ioport_write(&s->bus, addr, val);

    else

        ide_data_writew(&s->bus, 0, val);

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     XenPTReg *reg_entry;

     uint32_t data = 0;
+
     int rc = 0;

static int xen_pt_config_reg_init(XenPCIPassthroughState *s,

                                  XenPTRegGroup *reg_grp, XenPTRegInfo *reg)

{

    XenPTReg *reg_entry;

    uint32_t data = 0;

    int rc = 0;

    reg_entry = g_new0(XenPTReg, 1);

    reg_entry->reg = reg;

    if (reg->init) {

        /* initialize emulate register */

        rc = reg->init(s, reg_entry->reg,

                       reg_grp->base_offset + reg->offset, &data);

        if (rc < 0) {

            free(reg_entry);

            return rc;

        }

        if (data == XEN_PT_INVALID_REG) {

            /* free unused BAR register entry */

            free(reg_entry);

            return 0;

        }

        /* set register value */

        reg_entry->data = data;

    }

    /* list add register entry */

    QLIST_INSERT_HEAD(&reg_grp->reg_tbl_list, reg_entry, entries);

    return 0;

}


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

 {

+    return kvm_irqchip_remove_irqfd(s, event_notifier_get_fd(n), virq);

 }

int kvm_irqchip_remove_irq_notifier(KVMState *s, EventNotifier *n, int virq)

{

    return kvm_irqchip_remove_irqfd(s, event_notifier_get_fd(n), virq);

}


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

     error_report("wrong size for virtio-scsi headers");

static void virtio_scsi_bad_req(void)

{

    error_report("wrong size for virtio-scsi headers");

    exit(1);

}


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

     if (qobject_type(obj) != QTYPE_QLIST) {

QList *qobject_to_qlist(const QObject *obj)

{

    if (qobject_type(obj) != QTYPE_QLIST) {

        return NULL;

    }

    return container_of(obj, QList, base);

}


static int get_uint64_as_uint32(QEMUFile *f, void *pv, size_t size,

                                VMStateField *field)

{

    uint64_t *v = pv;

    *v = qemu_get_be32(f);

    return 0;

}


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

     QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {

+        cpu_breakpoint_insert(new_cpu, bp->pc, bp->flags, NULL);
+
+    }
+
+    QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) {

         cpu_watchpoint_insert(new_cpu, wp->vaddr, wp->len, wp->flags, NULL);

CPUArchState *cpu_copy(CPUArchState *env)

{

    CPUState *cpu = ENV_GET_CPU(env);

    CPUArchState *new_env = cpu_init(cpu_model);

    CPUState *new_cpu = ENV_GET_CPU(new_env);

#if defined(TARGET_HAS_ICE)

    CPUBreakpoint *bp;

    CPUWatchpoint *wp;

#endif

    /* Reset non arch specific state */

    cpu_reset(new_cpu);

    memcpy(new_env, env, sizeof(CPUArchState));

    /* Clone all break/watchpoints.

       Note: Once we support ptrace with hw-debug register access, make sure

       BP_CPU break/watchpoints are handled correctly on clone. */

    QTAILQ_INIT(&cpu->breakpoints);

    QTAILQ_INIT(&cpu->watchpoints);

#if defined(TARGET_HAS_ICE)

    QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {

        cpu_breakpoint_insert(new_cpu, bp->pc, bp->flags, NULL);

    }

    QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) {

        cpu_watchpoint_insert(new_cpu, wp->vaddr, wp->len, wp->flags, NULL);

    }

#endif

    return new_env;

}


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

     int srcW, srcH, dstW, dstH;

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

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

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

    enum PixelFormat srcFormat, dstFormat;

    int srcW, srcH, dstW, dstH;

    int flags;

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

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

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

                   sws_format_name(srcFormat),

                   sws_format_name(dstFormat));

            fflush(stdout);

            srcW= w;

            srcH= h;

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

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

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

                        int res;

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

                                     srcW, srcH, dstW, dstH, flags);

                        if (res < 0) {

                            dstW = 4 * w / 3;

                            dstH = 4 * h / 3;

                            flags = 33;

                        }

                    }

                }

            }

        }

    }

}


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

+{
+
+    int32_t *old = pv;
+
+    int32_t new;

     qemu_get_sbe32s(f, &new);

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

{

    int32_t *old = pv;

    int32_t new;

    qemu_get_sbe32s(f, &new);

    if (*old <= new) {

        return 0;

    }

    return -EINVAL;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void gen_mtsrin(DisasContext *ctx)
+
+{
+
+#if defined(CONFIG_USER_ONLY)

     gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

@@ -10,7 +10,7 @@

     TCGv t0;

+    if (unlikely(ctx->pr)) {

         gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

static void gen_mtsrin(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

#else

    TCGv t0;

    if (unlikely(ctx->pr)) {

        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

        return;

    }

    t0 = tcg_temp_new();

    tcg_gen_shri_tl(t0, cpu_gpr[rB(ctx->opcode)], 28);

    tcg_gen_andi_tl(t0, t0, 0xF);

    gen_helper_store_sr(cpu_env, t0, cpu_gpr[rD(ctx->opcode)]);

    tcg_temp_free(t0);

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+int fw_cfg_add_i32(FWCfgState *s, uint16_t key, uint32_t value)

 {

+    uint32_t *copy;

int fw_cfg_add_i32(FWCfgState *s, uint16_t key, uint32_t value)

{

    uint32_t *copy;

    copy = g_malloc(sizeof(value));

    *copy = cpu_to_le32(value);

    return fw_cfg_add_bytes(s, key, (uint8_t *)copy, sizeof(value));

}


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

 {
+
+#if defined(PR_SET_NAME)

     char name[16];

void os_set_proc_name(const char *s)

{

#if defined(PR_SET_NAME)

    char name[16];

    if (!s)

        return;

    name[sizeof(name) - 1] = 0;

    strncpy(name, s, sizeof(name));

    /* Could rewrite argv[0] too, but that's a bit more complicated.

       This simple way is enough for `top'. */

    if (prctl(PR_SET_NAME, name)) {

        perror("unable to change process name");

        exit(1);

    }

#else

    fprintf(stderr, "Change of process name not supported by your OS\n");

    exit(1);

#endif

}


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

 {

@@ -9,7 +9,7 @@

     if (!qemu_opt_get(opts, "br")) {
+
         qemu_opt_set(opts, "br", DEFAULT_BRIDGE_INTERFACE);

     }

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

{

    TAPState *s;

    int fd, vnet_hdr;

    if (!qemu_opt_get(opts, "br")) {

        qemu_opt_set(opts, "br", DEFAULT_BRIDGE_INTERFACE);

    }

    if (!qemu_opt_get(opts, "helper")) {

        qemu_opt_set(opts, "helper", DEFAULT_BRIDGE_HELPER);

    }

    fd = net_bridge_run_helper(qemu_opt_get(opts, "helper"),

                               qemu_opt_get(opts, "br"));

    if (fd == -1) {

        return -1;

    }

    fcntl(fd, F_SETFL, O_NONBLOCK);

    vnet_hdr = tap_probe_vnet_hdr(fd);

    s = net_tap_fd_init(vlan, "bridge", name, fd, vnet_hdr);

    if (!s) {

        close(fd);

        return -1;

    }

    snprintf(s->nc.info_str, sizeof(s->nc.info_str), "helper=%s,br=%s",

             qemu_opt_get(opts, "helper"), qemu_opt_get(opts, "br"));

    return 0;

}


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

     spcr->base_address.address = cpu_to_le64(uart_memmap->base);

+
+
+    spcr->interrupt_types = (1 << 3); /* Bit[3] ARMH GIC interrupt */
+
+    spcr->gsi = cpu_to_le32(irq);  /* Global System Interrupt */

build_spcr(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info)

{

    AcpiSerialPortConsoleRedirection *spcr;

    const MemMapEntry *uart_memmap = &guest_info->memmap[VIRT_UART];

    int irq = guest_info->irqmap[VIRT_UART] + ARM_SPI_BASE;

    spcr = acpi_data_push(table_data, sizeof(*spcr));

    spcr->interface_type = 0x3;    /* ARM PL011 UART */

    spcr->base_address.space_id = AML_SYSTEM_MEMORY;

    spcr->base_address.bit_width = 8;

    spcr->base_address.bit_offset = 0;

    spcr->base_address.access_width = 1;

    spcr->base_address.address = cpu_to_le64(uart_memmap->base);

    spcr->interrupt_types = (1 << 3); /* Bit[3] ARMH GIC interrupt */

    spcr->gsi = cpu_to_le32(irq);  /* Global System Interrupt */

    spcr->baud = 3;                /* Baud Rate: 3 = 9600 */

    spcr->parity = 0;              /* No Parity */

    spcr->stopbits = 1;            /* 1 Stop bit */

    spcr->flowctrl = (1 << 1);     /* Bit[1] = RTS/CTS hardware flow control */

    spcr->term_type = 0;           /* Terminal Type: 0 = VT100 */

    spcr->pci_device_id = 0xffff;  /* PCI Device ID: not a PCI device */

    spcr->pci_vendor_id = 0xffff;  /* PCI Vendor ID: not a PCI device */

    build_header(linker, table_data, (void *)spcr, "SPCR", sizeof(*spcr), 2,

                 NULL);

}


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

     dev = qvirtio_mmio_init_device(MMIO_DEV_BASE_ADDR, MMIO_PAGE_SIZE);
+
     g_assert(dev != NULL);

     g_assert_cmphex(dev->vdev.device_type, ==, VIRTIO_ID_BLOCK);

static void mmio_basic(void)

{

    QVirtioMMIODevice *dev;

    QVirtQueue *vq;

    QGuestAllocator *alloc;

    int n_size = TEST_IMAGE_SIZE / 2;

    uint64_t capacity;

    arm_test_start();

    dev = qvirtio_mmio_init_device(MMIO_DEV_BASE_ADDR, MMIO_PAGE_SIZE);

    g_assert(dev != NULL);

    g_assert_cmphex(dev->vdev.device_type, ==, VIRTIO_ID_BLOCK);

    qvirtio_reset(&qvirtio_mmio, &dev->vdev);

    qvirtio_set_acknowledge(&qvirtio_mmio, &dev->vdev);

    qvirtio_set_driver(&qvirtio_mmio, &dev->vdev);

    alloc = generic_alloc_init(MMIO_RAM_ADDR, MMIO_RAM_SIZE, MMIO_PAGE_SIZE);

    vq = qvirtqueue_setup(&qvirtio_mmio, &dev->vdev, alloc, 0);

    test_basic(&qvirtio_mmio, &dev->vdev, alloc, vq,

                            QVIRTIO_MMIO_DEVICE_SPECIFIC);

    qmp("{ 'execute': 'block_resize', 'arguments': { 'device': 'drive0', "

                                                    " 'size': %d } }", n_size);

    qvirtio_wait_queue_isr(&qvirtio_mmio, &dev->vdev, vq,

                           QVIRTIO_BLK_TIMEOUT_US);

    capacity = qvirtio_config_readq(&qvirtio_mmio, &dev->vdev,

                                                QVIRTIO_MMIO_DEVICE_SPECIFIC);

    g_assert_cmpint(capacity, ==, n_size / 512);

    /* End test */

    guest_free(alloc, vq->desc);

    generic_alloc_uninit(alloc);

    g_free(dev);

    test_end();

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
 static int qcow_write(BlockDriverState *bs, int64_t sector_num,

                      const uint8_t *buf, int nb_sectors)
+
 {

     BDRVQcowState *s = bs->opaque;

     int ret, index_in_cluster, n;
+
     uint64_t cluster_offset;

     int n_end;
@@ -15,7 +15,7 @@

     while (nb_sectors > 0) {
+
         index_in_cluster = sector_num & (s->cluster_sectors - 1);

         n_end = index_in_cluster + nb_sectors;

static int qcow_write(BlockDriverState *bs, int64_t sector_num,

                     const uint8_t *buf, int nb_sectors)

{

    BDRVQcowState *s = bs->opaque;

    int ret, index_in_cluster, n;

    uint64_t cluster_offset;

    int n_end;

    while (nb_sectors > 0) {

        index_in_cluster = sector_num & (s->cluster_sectors - 1);

        n_end = index_in_cluster + nb_sectors;

        if (s->crypt_method &&

            n_end > QCOW_MAX_CRYPT_CLUSTERS * s->cluster_sectors)

            n_end = QCOW_MAX_CRYPT_CLUSTERS * s->cluster_sectors;

        cluster_offset = alloc_cluster_offset(bs, sector_num << 9,

                                              index_in_cluster,

                                              n_end, &n);

        if (!cluster_offset)

            return -1;

        if (s->crypt_method) {

            encrypt_sectors(s, sector_num, s->cluster_data, buf, n, 1,

                            &s->aes_encrypt_key);

            ret = bdrv_pwrite(s->hd, cluster_offset + index_in_cluster * 512,

                              s->cluster_data, n * 512);

        } else {

            ret = bdrv_pwrite(s->hd, cluster_offset + index_in_cluster * 512, buf, n * 512);

        }

        if (ret != n * 512)

            return -1;

        nb_sectors -= n;

        sector_num += n;

        buf += n * 512;

    }

    s->cluster_cache_offset = -1; /* disable compressed cache */

    return 0;

}


static void tgen_compare_imm_branch(TCGContext *s, S390Opcode opc, int cc,

                                    TCGReg r1, int i2, int labelno)

{

    TCGLabel* l = &s->labels[labelno];

    tcg_target_long off;

    if (l->has_value) {

        off = l->u.value_ptr - s->code_ptr;

    } else {

        /* We need to keep the offset unchanged for retranslation.  */

        off = s->code_ptr[1];

        tcg_out_reloc(s, s->code_ptr + 1, R_390_PC16DBL, labelno, -2);

    }

    tcg_out16(s, (opc & 0xff00) | (r1 << 4) | cc);

    tcg_out16(s, off);

    tcg_out16(s, (i2 << 8) | (opc & 0xff));

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void cg3_initfn(Object *obj)

 {
+
     SysBusDevice *sbd = SYS_BUS_DEVICE(obj);

     CG3State *s = CG3(obj);

static void cg3_initfn(Object *obj)

{

    SysBusDevice *sbd = SYS_BUS_DEVICE(obj);

    CG3State *s = CG3(obj);

    memory_region_init_ram(&s->rom, NULL, "cg3.prom", FCODE_MAX_ROM_SIZE,

                           &error_abort);

    memory_region_set_readonly(&s->rom, true);

    sysbus_init_mmio(sbd, &s->rom);

    memory_region_init_io(&s->reg, NULL, &cg3_reg_ops, s, "cg3.reg",

                          CG3_REG_SIZE);

    sysbus_init_mmio(sbd, &s->reg);

}


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

     TCGv tmp;
+
     tcg_gen_add_i32(dest, t0, t1);

     tmp = load_cpu_field(CF);

static void gen_add_carry(TCGv dest, TCGv t0, TCGv t1)

{

    TCGv tmp;

    tcg_gen_add_i32(dest, t0, t1);

    tmp = load_cpu_field(CF);

    tcg_gen_add_i32(dest, dest, tmp);

    dead_tmp(tmp);

}


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

     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
+
+    int i;
+
+
+
     for (i = 0; i < 4; i++) {

         int plane = desc->comp[i].plane;

static int check_image_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt,

                                const int linesizes[4])

{

    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);

    int i;

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

        int plane = desc->comp[i].plane;

        if (!data[plane] || !linesizes[plane])

            return 0;

    }

    return 1;

}


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

         width  = h->avctx->width;

+        height = h->avctx->height;
+
+    }
+
+

     if (width <= 0 || height <= 0) {

static int init_dimensions(H264Context *h)

{

    int width  = h->width  - (h->sps.crop_right + h->sps.crop_left);

    int height = h->height - (h->sps.crop_top   + h->sps.crop_bottom);

    /* handle container cropping */

    if (FFALIGN(h->avctx->width,  16) == FFALIGN(width,  16) &&

        FFALIGN(h->avctx->height, 16) == FFALIGN(height, 16)) {

        width  = h->avctx->width;

        height = h->avctx->height;

    }

    if (width <= 0 || height <= 0) {

        av_log(h->avctx, AV_LOG_ERROR, "Invalid cropped dimensions: %dx%d.\n",

               width, height);

        if (h->avctx->err_recognition & AV_EF_EXPLODE)

            return AVERROR_INVALIDDATA;

        av_log(h->avctx, AV_LOG_WARNING, "Ignoring cropping information.\n");

        h->sps.crop_bottom =

        h->sps.crop_top    =

        h->sps.crop_right  =

        h->sps.crop_left   =

        h->sps.crop        = 0;

        width  = h->width;

        height = h->height;

    }

    h->avctx->coded_width  = h->width;

    h->avctx->coded_height = h->height;

    h->avctx->width        = width;

    h->avctx->height       = height;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void helper_check_iow(CPUX86State *env, uint32_t t0)

 {
+
     check_io(env, t0, 2);

 }

void helper_check_iow(CPUX86State *env, uint32_t t0)

{

    check_io(env, t0, 2);

}


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

 {

+    return section->address_space == get_system_memory()
+
         && memory_region_is_ram(section->mr);

 }

static bool vhost_section(MemoryRegionSection *section)

{

    return section->address_space == get_system_memory()

        && memory_region_is_ram(section->mr);

}


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

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

+        return;
+
+    }
+
+

     omap_badwidth_write16(opaque, addr, value);

static void omap_mcbsp_writew(void *opaque, hwaddr addr,

                uint32_t value)

{

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

    int offset = addr & OMAP_MPUI_REG_MASK;

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

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

            return;

        if (s->tx_req > 3) {

            s->tx_req -= 4;

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

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

                        (value >> 24) & 0xff;

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

                        (value >> 16) & 0xff;

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

                        (value >> 8) & 0xff;

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

                        (value >> 0) & 0xff;

            }

            if (s->tx_req < 4)

                omap_mcbsp_tx_done(s);

        } else

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

        return;

    }

    omap_badwidth_write16(opaque, addr, value);

}


int socket_connect(SocketAddressLegacy *addr, NonBlockingConnectHandler *callback,

                   void *opaque, Error **errp)

{

    int fd;

    switch (addr->type) {

    case SOCKET_ADDRESS_LEGACY_KIND_INET:

        fd = inet_connect_saddr(addr->u.inet.data, callback, opaque, errp);

        break;

    case SOCKET_ADDRESS_LEGACY_KIND_UNIX:

        fd = unix_connect_saddr(addr->u.q_unix.data, callback, opaque, errp);

        break;

    case SOCKET_ADDRESS_LEGACY_KIND_FD:

        fd = monitor_get_fd(cur_mon, addr->u.fd.data->str, errp);

        if (fd >= 0 && callback) {

            qemu_set_nonblock(fd);

            callback(fd, NULL, opaque);

        }

        break;

    case SOCKET_ADDRESS_LEGACY_KIND_VSOCK:

        fd = vsock_connect_saddr(addr->u.vsock.data, callback, opaque, errp);

        break;

    default:

        abort();

    }

    return fd;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+bool qemu_signalfd_available(void)
+
+{
+
 #ifdef CONFIG_SIGNALFD

     errno = 0;

bool qemu_signalfd_available(void)

{

#ifdef CONFIG_SIGNALFD

    errno = 0;

    syscall(SYS_signalfd, -1, NULL, _NSIG / 8);

    return errno != ENOSYS;

#else

    return false;

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void quantize_and_encode_band_mips(struct AACEncContext *s, PutBitContext *pb,
+
                                           const float *in, float *out, int size, int scale_idx,

                                           int cb, const float lambda, int rtz)

static void quantize_and_encode_band_mips(struct AACEncContext *s, PutBitContext *pb,

                                          const float *in, float *out, int size, int scale_idx,

                                          int cb, const float lambda, int rtz)

{

    quantize_and_encode_band_cost(s, pb, in, out, NULL, size, scale_idx, cb, lambda,

                                  INFINITY, NULL, (rtz) ? ROUND_TO_ZERO : ROUND_STANDARD);

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                         void *data, size_t len)

 {
+
     int i, index;

     void *ptr = NULL;

void *fw_cfg_modify_file(FWCfgState *s, const char *filename,

                        void *data, size_t len)

{

    int i, index;

    void *ptr = NULL;

    assert(s->files);

    index = be32_to_cpu(s->files->count);

    assert(index < fw_cfg_file_slots(s));

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

        if (strcmp(filename, s->files->f[i].name) == 0) {

            ptr = fw_cfg_modify_bytes_read(s, FW_CFG_FILE_FIRST + i,

                                           data, len);

            s->files->f[i].size   = cpu_to_be32(len);

            return ptr;

        }

    }

    /* add new one */

    fw_cfg_add_file_callback(s, filename, NULL, NULL, NULL, data, len, true);

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
+static ssize_t vnc_client_write_tls(gnutls_session_t *session,
+
+                                    const uint8_t *data,
+
+                                    size_t datalen)

+{

+    ssize_t ret = gnutls_write(*session, data, datalen);

+    if (ret < 0) {

         if (ret == GNUTLS_E_AGAIN) {

static ssize_t vnc_client_write_tls(gnutls_session_t *session,

                                    const uint8_t *data,

                                    size_t datalen)

{

    ssize_t ret = gnutls_write(*session, data, datalen);

    if (ret < 0) {

        if (ret == GNUTLS_E_AGAIN) {

            errno = EAGAIN;

        } else {

            errno = EIO;

        }

        ret = -1;

    }

    return ret;

}


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

     int n;

+

     s->pio_aiocb = NULL;

static void ide_sector_read_cb(void *opaque, int ret)

{

    IDEState *s = opaque;

    int n;

    s->pio_aiocb = NULL;

    s->status &= ~BUSY_STAT;

    if (ret == -ECANCELED) {

        return;

    }

    block_acct_done(blk_get_stats(s->blk), &s->acct);

    if (ret != 0) {

        if (ide_handle_rw_error(s, -ret, IDE_RETRY_PIO |

                                IDE_RETRY_READ)) {

            return;

        }

    }

    n = s->nsector;

    if (n > s->req_nb_sectors) {

        n = s->req_nb_sectors;

    }

    ide_set_sector(s, ide_get_sector(s) + n);

    s->nsector -= n;

    /* Allow the guest to read the io_buffer */

    ide_transfer_start(s, s->io_buffer, n * BDRV_SECTOR_SIZE, ide_sector_read);

    ide_set_irq(s->bus);

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     Visitor *v;

     Error *err = NULL;
+
+
+
+    v = validate_test_init(data, "3.14");
+

     visit_type_UserDefAlternate(v, NULL, &tmp, &err);

static void test_validate_fail_alternate(TestInputVisitorData *data,

                                         const void *unused)

{

    UserDefAlternate *tmp;

    Visitor *v;

    Error *err = NULL;

    v = validate_test_init(data, "3.14");

    visit_type_UserDefAlternate(v, NULL, &tmp, &err);

    error_free_or_abort(&err);

    g_assert(!tmp);

}


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

     uint8_t lba_index  = NVME_ID_NS_FLBAS_INDEX(ns->id_ns.flbas);
+
     uint8_t data_shift = ns->id_ns.lbaf[lba_index].ds;

     uint64_t data_size = (uint64_t)nlb << data_shift;

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

    NvmeRequest *req)

{

    NvmeRwCmd *rw = (NvmeRwCmd *)cmd;

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

    uint64_t slba = le64_to_cpu(rw->slba);

    uint64_t prp1 = le64_to_cpu(rw->prp1);

    uint64_t prp2 = le64_to_cpu(rw->prp2);

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

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

    uint64_t data_size = (uint64_t)nlb << data_shift;

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

    int is_write = rw->opcode == NVME_CMD_WRITE ? 1 : 0;

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

        return NVME_LBA_RANGE | NVME_DNR;

    }

    if (nvme_map_prp(&req->qsg, prp1, prp2, data_size, n)) {

        return NVME_INVALID_FIELD | NVME_DNR;

    }

    assert((nlb << data_shift) == req->qsg.size);

    req->has_sg = true;

    dma_acct_start(n->conf.blk, &req->acct, &req->qsg,

                   is_write ? BLOCK_ACCT_WRITE : BLOCK_ACCT_READ);

    req->aiocb = is_write ?

        dma_blk_write(n->conf.blk, &req->qsg, aio_slba, nvme_rw_cb, req) :

        dma_blk_read(n->conf.blk, &req->qsg, aio_slba, nvme_rw_cb, req);

    return NVME_NO_COMPLETE;

}


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

                           uint8_t *cmd, unsigned int cmd_len,
+
                           uint8_t *rsp, unsigned int *rsp_len,

                           unsigned int max_rsp_len)

static void clr_msg_flags(IPMIBmcSim *ibs,

                          uint8_t *cmd, unsigned int cmd_len,

                          uint8_t *rsp, unsigned int *rsp_len,

                          unsigned int max_rsp_len)

{

    IPMIInterface *s = ibs->parent.intf;

    IPMIInterfaceClass *k = IPMI_INTERFACE_GET_CLASS(s);

    IPMI_CHECK_CMD_LEN(3);

    ibs->msg_flags &= ~cmd[2];

    k->set_atn(s, attn_set(ibs), attn_irq_enabled(ibs));

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
                          type1.version);

     smbios_maybe_add_str(1, offsetof(struct smbios_type_1, serial_number_str),
+
+                         type1.serial);
+
+    smbios_maybe_add_str(1, offsetof(struct smbios_type_1, sku_number_str),
+
                          type1.sku);

     smbios_maybe_add_str(1, offsetof(struct smbios_type_1, family_str),

static void smbios_build_type_1_fields(void)

{

    smbios_maybe_add_str(1, offsetof(struct smbios_type_1, manufacturer_str),

                         type1.manufacturer);

    smbios_maybe_add_str(1, offsetof(struct smbios_type_1, product_name_str),

                         type1.product);

    smbios_maybe_add_str(1, offsetof(struct smbios_type_1, version_str),

                         type1.version);

    smbios_maybe_add_str(1, offsetof(struct smbios_type_1, serial_number_str),

                         type1.serial);

    smbios_maybe_add_str(1, offsetof(struct smbios_type_1, sku_number_str),

                         type1.sku);

    smbios_maybe_add_str(1, offsetof(struct smbios_type_1, family_str),

                         type1.family);

    if (qemu_uuid_set) {

        /* We don't encode the UUID in the "wire format" here because this

         * function is for legacy mode and needs to keep the guest ABI, and

         * because we don't know what's the SMBIOS version advertised by the

         * BIOS.

         */

        smbios_add_field(1, offsetof(struct smbios_type_1, uuid),

                         qemu_uuid, 16);

    }

}


--- a/source.c
+++ b/source.c
@@ -27,11 +27,11 @@
         linesizes[0] = (width * (desc->comp[0].step_minus1+1) + 7) >> 3;

         return 0;
+
+    }
+
+
+
     av_image_fill_max_pixsteps(max_step, max_step_comp, desc);

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

int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width)

{

    int i;

    const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];

    int max_step     [4];       /* max pixel step for each plane */

    int max_step_comp[4];       /* the component for each plane which has the max pixel step */

    memset(linesizes, 0, 4*sizeof(linesizes[0]));

    if (desc->flags & PIX_FMT_HWACCEL)

        return AVERROR(EINVAL);

    if (desc->flags & PIX_FMT_BITSTREAM) {

        linesizes[0] = (width * (desc->comp[0].step_minus1+1) + 7) >> 3;

        return 0;

    }

    av_image_fill_max_pixsteps(max_step, max_step_comp, desc);

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

        int s = (max_step_comp[i] == 1 || max_step_comp[i] == 2) ? desc->log2_chroma_w : 0;

        linesizes[i] = max_step[i] * (((width + (1 << s) - 1)) >> s);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
 			       TCGv d, TCGv op_a, TCGv op_b, int size)

 {
+
 	TCGv tmp;

 	int writeback;

static void cris_alu(DisasContext *dc, int op,

			       TCGv d, TCGv op_a, TCGv op_b, int size)

{

	TCGv tmp;

	int writeback;

	writeback = 1;

	if (op == CC_OP_BOUND || op == CC_OP_BTST)

		tmp = tcg_temp_local_new(TCG_TYPE_TL);

	else

		tmp = tcg_temp_new(TCG_TYPE_TL);

	if (op == CC_OP_CMP) {

		writeback = 0;

	} else if (size == 4) {

		tmp = d;

		writeback = 0;

	}

	cris_pre_alu_update_cc(dc, op, op_a, op_b, size);

	cris_alu_op_exec(dc, op, tmp, op_a, op_b, size);

	cris_update_result(dc, tmp);

	/* Writeback.  */

	if (writeback) {

		if (size == 1)

			tcg_gen_andi_tl(d, d, ~0xff);

		else

			tcg_gen_andi_tl(d, d, ~0xffff);

		tcg_gen_or_tl(d, d, tmp);

	}

	if (tmp != d)

		tcg_temp_free(tmp);

}


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

         av_free(buf);

+
+
+        // initialization range
+
+        // 5 is the offset of Cluster ID.

         av_dict_set_int(&s->streams[0]->metadata, INITIALIZATION_RANGE, avio_tell(s->pb) - 5, 0);

static int webm_dash_manifest_read_header(AVFormatContext *s)

{

    char *buf;

    int ret = matroska_read_header(s);

    MatroskaTrack *tracks;

    MatroskaDemuxContext *matroska = s->priv_data;

    if (ret) {

        av_log(s, AV_LOG_ERROR, "Failed to read file headers\n");

        return -1;

    if (!matroska->is_live) {

        buf = av_asprintf("%g", matroska->duration);

        if (!buf) return AVERROR(ENOMEM);

        av_dict_set(&s->streams[0]->metadata, DURATION, buf, 0);

        av_free(buf);

        // initialization range

        // 5 is the offset of Cluster ID.

        av_dict_set_int(&s->streams[0]->metadata, INITIALIZATION_RANGE, avio_tell(s->pb) - 5, 0);

    // basename of the file

    buf = strrchr(s->filename, '/');

    av_dict_set(&s->streams[0]->metadata, FILENAME, buf ? ++buf : s->filename, 0);

    // track number

    tracks = matroska->tracks.elem;

    av_dict_set_int(&s->streams[0]->metadata, TRACK_NUMBER, tracks[0].num, 0);

    // parse the cues and populate Cue related fields

    return matroska->is_live ? 0 : webm_dash_manifest_cues(s);


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void ff_id3v2_read(AVFormatContext *s, const char *magic,
+
+                   ID3v2ExtraMeta **extra_meta)

 {

void ff_id3v2_read(AVFormatContext *s, const char *magic,

                   ID3v2ExtraMeta **extra_meta)

{

    id3v2_read_internal(s->pb, &s->metadata, s, magic, extra_meta);

}


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

     trace_bdrv_co_writev(bs, sector_num, nb_sectors);
+
+
+
     return bdrv_co_do_writev(bs, sector_num, nb_sectors, qiov, 0);

 }

int coroutine_fn bdrv_co_writev(BlockDriverState *bs, int64_t sector_num,

    int nb_sectors, QEMUIOVector *qiov)

{

    trace_bdrv_co_writev(bs, sector_num, nb_sectors);

    return bdrv_co_do_writev(bs, sector_num, nb_sectors, qiov, 0);

}


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

     dshowdebug("libAVMemInputPin_Receive(%p)\n", this);

+

     if (!sample)

libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)

{

    libAVPin *pin = (libAVPin *) ((uint8_t *) this - imemoffset);

    enum dshowDeviceType devtype = pin->filter->type;

    void *priv_data;

    uint8_t *buf;

    int buf_size;

    int index;

    int64_t curtime;

    dshowdebug("libAVMemInputPin_Receive(%p)\n", this);

    if (!sample)

        return E_POINTER;

    if (devtype == VideoDevice) {

        /* PTS from video devices is unreliable. */

        IReferenceClock *clock = pin->filter->clock;

        IReferenceClock_GetTime(clock, &curtime);

    } else {

        int64_t dummy;

        IMediaSample_GetTime(sample, &curtime, &dummy);

        curtime += pin->filter->start_time;

    }

    buf_size = IMediaSample_GetActualDataLength(sample);

    IMediaSample_GetPointer(sample, &buf);

    priv_data = pin->filter->priv_data;

    index = pin->filter->stream_index;

    pin->filter->callback(priv_data, index, buf, buf_size, curtime);

    return S_OK;

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     assert(!bdrv_requests_pending(new));

+
+    bdrv_ref(old);
+
+
+
     change_parent_backing_link(old, new);

void bdrv_replace_in_backing_chain(BlockDriverState *old, BlockDriverState *new)

{

    assert(!bdrv_requests_pending(old));

    assert(!bdrv_requests_pending(new));

    bdrv_ref(old);

    change_parent_backing_link(old, new);

    bdrv_unref(old);

}


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

     /* alloc top line of predictors */

+    h->top_qp       = av_malloc( h->mb_width);
+
+    h->top_mv[0]    = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector));
+
+    h->top_mv[1]    = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector));

     h->top_pred_Y   = av_malloc( h->mb_width*2*sizeof(*h->top_pred_Y));

void ff_cavs_init_top_lines(AVSContext *h) {

    /* alloc top line of predictors */

    h->top_qp       = av_malloc( h->mb_width);

    h->top_mv[0]    = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector));

    h->top_mv[1]    = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector));

    h->top_pred_Y   = av_malloc( h->mb_width*2*sizeof(*h->top_pred_Y));

    h->top_border_y = av_malloc((h->mb_width+1)*16);

    h->top_border_u = av_malloc( h->mb_width * 10);

    h->top_border_v = av_malloc( h->mb_width * 10);

    /* alloc space for co-located MVs and types */

    h->col_mv       = av_malloc( h->mb_width*h->mb_height*4*sizeof(cavs_vector));

    h->col_type_base = av_malloc(h->mb_width*h->mb_height);

    h->block        = av_mallocz(64*sizeof(DCTELEM));

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static av_always_inline void avcodec_thread_park_workers(ThreadContext *c, int thread_count)
+
 {

     pthread_cond_wait(&c->last_job_cond, &c->current_job_lock);

static av_always_inline void avcodec_thread_park_workers(ThreadContext *c, int thread_count)

{

    pthread_cond_wait(&c->last_job_cond, &c->current_job_lock);

    pthread_mutex_unlock(&c->current_job_lock);

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
     if (ssd->ptr_move) {

         g_free(ssd->ptr_move);
+
+    }
+
+    ssd->ptr_move = qemu_spice_create_cursor_update(ssd, NULL, on);
+
     qemu_mutex_unlock(&ssd->lock);

 }

static void display_mouse_set(DisplayChangeListener *dcl,

                              int x, int y, int on)

{

    SimpleSpiceDisplay *ssd = container_of(dcl, SimpleSpiceDisplay, dcl);

    qemu_mutex_lock(&ssd->lock);

    ssd->ptr_x = x;

    ssd->ptr_y = y;

    if (ssd->ptr_move) {

        g_free(ssd->ptr_move);

    }

    ssd->ptr_move = qemu_spice_create_cursor_update(ssd, NULL, on);

    qemu_mutex_unlock(&ssd->lock);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int protocol_version(VncState *vs, char *version, size_t len)
+
+{
+
+    char local[13];
+
     int maj, min;

static int protocol_version(VncState *vs, char *version, size_t len)

{

    char local[13];

    int maj, min;

    memcpy(local, version, 12);

    local[12] = 0;

    if (sscanf(local, "RFB %03d.%03d\n", &maj, &min) != 2) {

	vnc_client_error(vs);

	return 0;

    }

    vnc_write_u32(vs, 1); /* None */

    vnc_flush(vs);

    vnc_read_when(vs, protocol_client_init, 1);

    return 0;

}


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

+                         BdrvCheckResult *res,

                          uint16_t **refcount_table,

@@ -17,7 +17,7 @@
     int ret;

+
     if (size <= 0) {

         return 0;

static int inc_refcounts(BlockDriverState *bs,

                         BdrvCheckResult *res,

                         uint16_t **refcount_table,

                         int64_t *refcount_table_size,

                         int64_t offset, int64_t size)

{

    BDRVQcowState *s = bs->opaque;

    uint64_t start, last, cluster_offset, k;

    int ret;

    if (size <= 0) {

        return 0;

    }

    start = start_of_cluster(s, offset);

    last = start_of_cluster(s, offset + size - 1);

    for(cluster_offset = start; cluster_offset <= last;

        cluster_offset += s->cluster_size) {

        k = cluster_offset >> s->cluster_bits;

        if (k >= *refcount_table_size) {

            ret = realloc_refcount_array(s, refcount_table,

                                         refcount_table_size, k + 1);

            if (ret < 0) {

                res->check_errors++;

                return ret;

            }

        }

        if (++(*refcount_table)[k] == 0) {

            fprintf(stderr, "ERROR: overflow cluster offset=0x%" PRIx64

                    "\n", cluster_offset);

            res->corruptions++;

        }

    }

    return 0;

}


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

                                        qemu_irq **parent_irq)
+
 {

     DeviceState *dev;

static DeviceState *slavio_intctl_init(target_phys_addr_t addr,

                                       target_phys_addr_t addrg,

                                       qemu_irq **parent_irq)

{

    DeviceState *dev;

    SysBusDevice *s;

    unsigned int i, j;

    dev = qdev_create(NULL, "slavio_intctl");

    qdev_init(dev);

    s = sysbus_from_qdev(dev);

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

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

            sysbus_connect_irq(s, i * MAX_PILS + j, parent_irq[i][j]);

        }

    }

    sysbus_mmio_map(s, 0, addrg);

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

        sysbus_mmio_map(s, i + 1, addr + i * TARGET_PAGE_SIZE);

    }

    return dev;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline void gen_op_fcmpd(int fccno, TCGv_i64 r_rs1, TCGv_i64 r_rs2)

 {

static inline void gen_op_fcmpd(int fccno, TCGv_i64 r_rs1, TCGv_i64 r_rs2)

{

    gen_helper_fcmpd(cpu_env, r_rs1, r_rs2);

}


--- a/source.c
+++ b/source.c
@@ -45,11 +45,11 @@
         qemu_put_be32(f, se->instance_id);

         qemu_put_be32(f, se->version_id);
+
+
+
+        se->save_live_state(f, QEMU_VM_SECTION_START, se->opaque);
+
     }

int qemu_savevm_state_begin(QEMUFile *f)

{

    SaveStateEntry *se;

    qemu_put_be32(f, QEMU_VM_FILE_MAGIC);

    qemu_put_be32(f, QEMU_VM_FILE_VERSION);

    TAILQ_FOREACH(se, &savevm_handlers, entry) {

        int len;

        if (se->save_live_state == NULL)

            continue;

        /* Section type */

        qemu_put_byte(f, QEMU_VM_SECTION_START);

        qemu_put_be32(f, se->section_id);

        /* ID string */

        len = strlen(se->idstr);

        qemu_put_byte(f, len);

        qemu_put_buffer(f, (uint8_t *)se->idstr, len);

        qemu_put_be32(f, se->instance_id);

        qemu_put_be32(f, se->version_id);

        se->save_live_state(f, QEMU_VM_SECTION_START, se->opaque);

    }

    if (qemu_file_has_error(f))

        return -EIO;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
             s->count_latched = RW_STATE_MSB;
             break;
     } else {
+        switch(s->read_state) {
+        default:
+        case RW_STATE_LSB:
+            count = pit_get_count(s);
+            ret = count & 0xff;
             break;
         case RW_STATE_MSB:
             count = pit_get_count(s);

static uint64_t pit_ioport_read(void *opaque, hwaddr addr,
                                unsigned size)
{
    PITCommonState *pit = opaque;
    int ret, count;
    PITChannelState *s;
    addr &= 3;
    s = &pit->channels[addr];
    if (s->status_latched) {
        s->status_latched = 0;
        ret = s->status;
    } else if (s->count_latched) {
        switch(s->count_latched) {
        default:
        case RW_STATE_LSB:
            ret = s->latched_count & 0xff;
            s->count_latched = 0;
            break;
        case RW_STATE_MSB:
            ret = s->latched_count >> 8;
            s->count_latched = 0;
            break;
        case RW_STATE_WORD0:
            ret = s->latched_count & 0xff;
            s->count_latched = RW_STATE_MSB;
            break;
    } else {
        switch(s->read_state) {
        default:
        case RW_STATE_LSB:
            count = pit_get_count(s);
            ret = count & 0xff;
            break;
        case RW_STATE_MSB:
            count = pit_get_count(s);
            ret = (count >> 8) & 0xff;
            break;
        case RW_STATE_WORD0:
            count = pit_get_count(s);
            ret = count & 0xff;
            s->read_state = RW_STATE_WORD1;
            break;
        case RW_STATE_WORD1:
            count = pit_get_count(s);
            ret = (count >> 8) & 0xff;
            s->read_state = RW_STATE_WORD0;
            break;
    return ret;


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
         hw->clip (dst, src1, src_len1);

     }
+
+
+
+    if (src_len2) {
+
         dst = advance (dst, src_len1 << hw->info.shift);

         hw->clip (dst, src2, src_len2);

static void dsound_write_sample (HWVoiceOut *hw, uint8_t *dst, int dst_len)

{

    int src_len1 = dst_len;

    int src_len2 = 0;

    int pos = hw->rpos + dst_len;

    st_sample_t *src1 = hw->mix_buf + hw->rpos;

    st_sample_t *src2 = NULL;

    if (pos > hw->samples) {

        src_len1 = hw->samples - hw->rpos;

        src2 = hw->mix_buf;

        src_len2 = dst_len - src_len1;

        pos = src_len2;

    }

    if (src_len1) {

        hw->clip (dst, src1, src_len1);

    }

    if (src_len2) {

        dst = advance (dst, src_len1 << hw->info.shift);

        hw->clip (dst, src2, src_len2);

    }

    hw->rpos = pos % hw->samples;

}


--- a/source.c
+++ b/source.c
@@ -1,19 +1,19 @@
+static uint32_t parse_peak(const uint8_t *peak)
+
+{
+
+    int64_t val = 0;
+
+    int64_t scale = 1;
+
+
+
+    if (!peak)
+
+        return 0;
+

+
     peak += strspn(peak, " \t");

static uint32_t parse_peak(const uint8_t *peak)

{

    int64_t val = 0;

    int64_t scale = 1;

    if (!peak)

        return 0;

    peak += strspn(peak, " \t");

    if (peak[0] == '1' && peak[1] == '.')

        return UINT32_MAX;

    else if (!(peak[0] == '0' && peak[1] == '.'))

        return 0;

    peak += 2;

    while (av_isdigit(*peak)) {

        int digit = *peak - '0';

        if (scale > INT64_MAX / 10)

            break;

        val    = 10 * val + digit;

        scale *= 10;

        peak++;

    }

    return av_rescale(val, UINT32_MAX, scale);

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     item = QTAILQ_FIRST(queue);

     g_assert(item->type == QEMU_INPUT_QUEUE_DELAY);
+
+    QTAILQ_REMOVE(queue, item, node);
+
+
+    g_free(item);

static void qemu_input_queue_process(void *opaque)

{

    struct QemuInputEventQueueHead *queue = opaque;

    QemuInputEventQueue *item;

    g_assert(!QTAILQ_EMPTY(queue));

    item = QTAILQ_FIRST(queue);

    g_assert(item->type == QEMU_INPUT_QUEUE_DELAY);

    QTAILQ_REMOVE(queue, item, node);

    g_free(item);

    while (!QTAILQ_EMPTY(queue)) {

        item = QTAILQ_FIRST(queue);

        switch (item->type) {

        case QEMU_INPUT_QUEUE_DELAY:

            timer_mod(item->timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL)

                      + item->delay_ms);

            return;

        case QEMU_INPUT_QUEUE_EVENT:

            qemu_input_event_send(item->src, item->evt);

            qapi_free_InputEvent(item->evt);

            break;

        case QEMU_INPUT_QUEUE_SYNC:

            qemu_input_event_sync();

            break;

        }

        QTAILQ_REMOVE(queue, item, node);

        g_free(item);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int packed_16bpc_bswap(SwsContext *c, const uint8_t *src[],
+
+                              int srcStride[], int srcSliceY, int srcSliceH,
+
+                              uint8_t *dst[], int dstStride[])

 {

static int packed_16bpc_bswap(SwsContext *c, const uint8_t *src[],

                              int srcStride[], int srcSliceY, int srcSliceH,

                              uint8_t *dst[], int dstStride[])

{

    int i, j, p;

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

        int srcstr = srcStride[p] >> 1;

        int dststr = dstStride[p] >> 1;

        uint16_t       *dstPtr =       (uint16_t *) dst[p];

        const uint16_t *srcPtr = (const uint16_t *) src[p];

        int min_stride         = FFMIN(srcstr, dststr);

        if(!dstPtr || !srcPtr)

            continue;

        for (i = 0; i < (srcSliceH >> c->chrDstVSubSample); i++) {

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

                dstPtr[j] = av_bswap16(srcPtr[j]);

            }

            srcPtr += srcstr;

            dstPtr += dststr;

        }

    }

    return srcSliceH;

}


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

 {

+    UserDefOneList *head = NULL;
+
     Error *err = NULL;

     Visitor *v;

static void test_validate_fail_list(TestInputVisitorData *data,

                                     const void *unused)

{

    UserDefOneList *head = NULL;

    Error *err = NULL;

    Visitor *v;

    v = validate_test_init(data, "[ { 'string': 'string0', 'integer': 42 }, { 'string': 'string1', 'integer': 43 }, { 'string': 'string2', 'integer': 44, 'extra': 'ggg' } ]");

    visit_type_UserDefOneList(v, &head, NULL, &err);

    g_assert(err);

    error_free(err);

    qapi_free_UserDefOneList(head);

}


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

     switch (cmd) {
+
     case VOICE_ENABLE:

         {

static int oss_ctl_in (HWVoiceIn *hw, int cmd, ...)

{

    OSSVoiceIn *oss = (OSSVoiceIn *) hw;

    switch (cmd) {

    case VOICE_ENABLE:

        {

            va_list ap;

            int poll_mode;

            va_start (ap, cmd);

            poll_mode = va_arg (ap, int);

            va_end (ap);

            if (poll_mode && oss_poll_in (hw)) {

                poll_mode = 0;

            }

            hw->poll_mode = poll_mode;

        }

        break;

    case VOICE_DISABLE:

        if (hw->poll_mode) {

            hw->poll_mode = 0;

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

        }

        break;

    }

    return 0;

}


void bdrv_release_dirty_bitmap(BlockDriverState *bs, BdrvDirtyBitmap *bitmap)

{

    BdrvDirtyBitmap *bm, *next;

    QLIST_FOREACH_SAFE(bm, &bs->dirty_bitmaps, list, next) {

        if (bm == bitmap) {

            assert(!bdrv_dirty_bitmap_frozen(bm));

            QLIST_REMOVE(bitmap, list);

            hbitmap_free(bitmap->bitmap);

            g_free(bitmap->name);

            g_free(bitmap);

            return;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     uint8_t *buffer;

     int max_buffer_size = s->max_packet_size ?
+
+                          s->max_packet_size : IO_BUFFER_SIZE;
+
+    int filled = s->buf_end - s->buffer;
+
     ptrdiff_t checksum_ptr_offset = s->checksum_ptr ? s->checksum_ptr - s->buffer : -1;

int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)

{

    uint8_t *buffer;

    int max_buffer_size = s->max_packet_size ?

                          s->max_packet_size : IO_BUFFER_SIZE;

    int filled = s->buf_end - s->buffer;

    ptrdiff_t checksum_ptr_offset = s->checksum_ptr ? s->checksum_ptr - s->buffer : -1;

    buf_size += s->buf_ptr - s->buffer + max_buffer_size;

    if (buf_size < filled || s->seekable || !s->read_packet)

        return 0;

    av_assert0(!s->write_flag);

    buffer = av_malloc(buf_size);

    if (!buffer)

        return AVERROR(ENOMEM);

    memcpy(buffer, s->buffer, filled);

    av_free(s->buffer);

    s->buf_ptr = buffer + (s->buf_ptr - s->buffer);

    s->buf_end = buffer + (s->buf_end - s->buffer);

    s->buffer = buffer;

    s->buffer_size = buf_size;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline int ultrasparc_tag_match(SparcTLBEntry *tlb,

                                        uint64_t address, uint64_t context,

@@ -10,7 +10,7 @@

     uint64_t mask;

+

     switch ((tlb->tte >> 61) & 3) {

static inline int ultrasparc_tag_match(SparcTLBEntry *tlb,

                                       uint64_t address, uint64_t context,

                                       target_phys_addr_t *physical,

                                       int is_nucleus)

{

    uint64_t mask;

    switch ((tlb->tte >> 61) & 3) {

    default:

    case 0x0: // 8k

        mask = 0xffffffffffffe000ULL;

        break;

    case 0x1: // 64k

        mask = 0xffffffffffff0000ULL;

        break;

    case 0x2: // 512k

        mask = 0xfffffffffff80000ULL;

        break;

    case 0x3: // 4M

        mask = 0xffffffffffc00000ULL;

        break;

    }

    // valid, context match, virtual address match?

    if (TTE_IS_VALID(tlb->tte) &&

        ((is_nucleus && compare_masked(0, tlb->tag, 0x1fff))

         || TTE_IS_GLOBAL(tlb->tte) || compare_masked(context, tlb->tag, 0x1fff))

        && compare_masked(address, tlb->tag, mask))

    {

        // decode physical address

        *physical = ((tlb->tte & mask) | (address & ~mask)) & 0x1ffffffe000ULL;

        return 1;

    }

    return 0;

}


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

+    k->no_hotplug = 1;

     k->init = pci_piix_ide_initfn;

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);

    k->no_hotplug = 1;

    k->init = pci_piix_ide_initfn;

    k->exit = pci_piix_ide_exitfn;

    k->vendor_id = PCI_VENDOR_ID_INTEL;

    k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1;

    k->class_id = PCI_CLASS_STORAGE_IDE;

    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);

    dc->no_user = 1;

}


--- a/source.c
+++ b/source.c
@@ -15,7 +15,7 @@
     uint64_t bits[MAX_PARTITION_ORDER+1];

     int opt_porder;
+
     RiceContext tmp_rc;

     int kmax = (1 << rc->coding_mode) - 2;

static uint64_t calc_rice_params(RiceContext *rc,

                                 uint32_t udata[FLAC_MAX_BLOCKSIZE],

                                 uint64_t sums[32][MAX_PARTITIONS],

                                 int pmin, int pmax,

                                 const int32_t *data, int n, int pred_order, int exact)

{

    int i;

    uint64_t bits[MAX_PARTITION_ORDER+1];

    int opt_porder;

    RiceContext tmp_rc;

    int kmax = (1 << rc->coding_mode) - 2;

    av_assert1(pmin >= 0 && pmin <= MAX_PARTITION_ORDER);

    av_assert1(pmax >= 0 && pmax <= MAX_PARTITION_ORDER);

    av_assert1(pmin <= pmax);

    tmp_rc.coding_mode = rc->coding_mode;

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

        udata[i] = (2 * data[i]) ^ (data[i] >> 31);

    calc_sum_top(pmax, exact ? kmax : 0, udata, n, pred_order, sums);

    opt_porder = pmin;

    bits[pmin] = UINT32_MAX;

    for (i = pmax; ; ) {

        bits[i] = calc_optimal_rice_params(&tmp_rc, i, sums, n, pred_order, kmax, exact);

        if (bits[i] < bits[opt_porder]) {

            opt_porder = i;

            *rc = tmp_rc;

        }

        if (i == pmin)

            break;

        calc_sum_next(--i, sums, exact ? kmax : 0);

    }

    return bits[opt_porder];

}


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

     }

+    do_open_tray(device, force, errp);
+
+}

void qmp_blockdev_open_tray(const char *device, bool has_force, bool force,

                            Error **errp)

{

    if (!has_force) {

        force = false;

    }

    do_open_tray(device, force, errp);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void test_parse_invalid_path(void)
+
+{
+
+    g_test_trap_subprocess ("/logging/parse_invalid_path/subprocess", 0, 0);

     g_test_trap_assert_passed();

static void test_parse_invalid_path(void)

{

    g_test_trap_subprocess ("/logging/parse_invalid_path/subprocess", 0, 0);

    g_test_trap_assert_passed();

    g_test_trap_assert_stdout("");

    g_test_trap_assert_stderr("Bad logfile format: /tmp/qemu-%d%d.log\n");

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
     if (vo_len > 0) {

         /* We need to store the header, so extract it */
+
+        if (!avctx->extradata) {
+
+            avctx->extradata = av_malloc(vo_len);
+

             memcpy(avctx->extradata, pkt->data, vo_len);

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

                                 unsigned int header_len,

                                 unsigned int frame_len)

{

    int vo_len = 0, i;

    for (i = 0; i < header_len - 3; i++) {

        if (pkt->data[i]     == 0x00 &&

            pkt->data[i + 1] == 0x00 &&

            pkt->data[i + 2] == 0x01 &&

            pkt->data[i + 3] == 0xB6) {

            vo_len = i;

            break;

        }

    }

    if (vo_len > 0) {

        /* We need to store the header, so extract it */

        if (!avctx->extradata) {

            avctx->extradata = av_malloc(vo_len);

            memcpy(avctx->extradata, pkt->data, vo_len);

            avctx->extradata_size = vo_len;

        }

        /* Less dangerous now, memmove properly copies the two

         * chunks of overlapping data */

        memmove(pkt->data, &pkt->data[vo_len], frame_len - vo_len);

        pkt->size = frame_len - vo_len;

    }

    return 0;

}


static void close(AVCodecParserContext *s)

{

    H264Context *h = s->priv_data;

    ParseContext *pc = &h->s.parse_context;

    av_free(pc->buffer);

}


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

     if (flags >= IO_MEM_UNASSIGNED)

+        return;
+
+
+
+    mem = kvm_alloc_slot(s);

     mem->memory_size = size;

void kvm_set_phys_mem(target_phys_addr_t start_addr,

                      ram_addr_t size,

                      ram_addr_t phys_offset)

{

    KVMState *s = kvm_state;

    ram_addr_t flags = phys_offset & ~TARGET_PAGE_MASK;

    KVMSlot *mem;

    /* KVM does not support read-only slots */

    phys_offset &= ~IO_MEM_ROM;

    mem = kvm_lookup_slot(s, start_addr);

    if (mem) {

        if (flags == IO_MEM_UNASSIGNED) {

            mem->memory_size = 0;

            mem->guest_phys_addr = start_addr;

            mem->userspace_addr = 0;

            mem->flags = 0;

            kvm_vm_ioctl(s, KVM_SET_USER_MEMORY_REGION, mem);

        } else if (start_addr >= mem->guest_phys_addr &&

                   (start_addr + size) <= (mem->guest_phys_addr + mem->memory_size))

            return;

    }

    /* KVM does not need to know about this memory */

    if (flags >= IO_MEM_UNASSIGNED)

        return;

    mem = kvm_alloc_slot(s);

    mem->memory_size = size;

    mem->guest_phys_addr = start_addr;

    mem->userspace_addr = (unsigned long)(phys_ram_base + phys_offset);

    mem->flags = 0;

    kvm_vm_ioctl(s, KVM_SET_USER_MEMORY_REGION, mem);

    /* FIXME deal with errors */

}


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

     XenPTRegInfo *reg = cfg_entry->reg;

+    uint16_t writable_mask = 0;
+
+    uint16_t throughable_mask = get_throughable_mask(s, reg, valid_mask);
+
+

     /* modify emulate register */

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

                                 uint16_t *val, uint16_t dev_value,

                                 uint16_t valid_mask)

{

    XenPTRegInfo *reg = cfg_entry->reg;

    uint16_t writable_mask = 0;

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

    /* modify emulate register */

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

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

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

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

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -55,9 +55,9 @@
     pkt->flags |= AV_PKT_FLAG_KEY;

     *got_packet = 1;
+
+
+
+    return 0;
+
 }

static int dvvideo_encode_frame(AVCodecContext *c, AVPacket *pkt,

                                const AVFrame *frame, int *got_packet)

{

    DVVideoContext *s = c->priv_data;

    int ret;

    s->sys = avpriv_dv_codec_profile(c);

    if (!s->sys || ff_dv_init_dynamic_tables(s->sys))

        return -1;

    if ((ret = ff_alloc_packet(pkt, s->sys->frame_size)) < 0) {

        av_log(c, AV_LOG_ERROR, "Error getting output packet.\n");

        return ret;

    }

    c->pix_fmt                = s->sys->pix_fmt;

    s->frame                  = frame;

    c->coded_frame->key_frame = 1;

    c->coded_frame->pict_type = AV_PICTURE_TYPE_I;

    s->buf = pkt->data;

    c->execute(c, dv_encode_video_segment, s->sys->work_chunks, NULL,

               dv_work_pool_size(s->sys), sizeof(DVwork_chunk));

    emms_c();

    dv_format_frame(s, pkt->data);

    pkt->flags |= AV_PKT_FLAG_KEY;

    *got_packet = 1;

    return 0;

}


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

     QEMUFileStdio *s;
+

     if (qemu_file_mode_is_not_valid(mode)) {

QEMUFile *qemu_fopen(const char *filename, const char *mode)

{

    QEMUFileStdio *s;

    if (qemu_file_mode_is_not_valid(mode)) {

        return NULL;

    }

    s = g_malloc0(sizeof(QEMUFileStdio));

    s->stdio_file = fopen(filename, mode);

    if (!s->stdio_file) {

        goto fail;

    }

    if (mode[0] == 'w') {

        s->file = qemu_fopen_ops(s, &stdio_file_write_ops);

    } else {

        s->file = qemu_fopen_ops(s, &stdio_file_read_ops);

    }

    return s->file;

fail:

    g_free(s);

    return NULL;

}


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

+    gen_op_move_T2_T0();

     gen_op_subf();

static always_inline void gen_op_subfco_64 (void)

{

    gen_op_move_T2_T0();

    gen_op_subf();

    gen_op_check_subfc_64();

    gen_op_check_subfo_64();

}


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

     if (!(*pte1p & HPTE32_R_R)) {

+        /* Update accessed flag */
+
+        *pte1p |= HPTE32_R_R;
+
+        store = 1;

     }

static int ppc_hash32_pte_update_flags(struct mmu_ctx_hash32 *ctx, target_ulong *pte1p,

                                       int ret, int rw)

{

    int store = 0;

    /* Update page flags */

    if (!(*pte1p & HPTE32_R_R)) {

        /* Update accessed flag */

        *pte1p |= HPTE32_R_R;

        store = 1;

    }

    if (!(*pte1p & HPTE32_R_C)) {

        if (rw == 1 && ret == 0) {

            /* Update changed flag */

            *pte1p |= HPTE32_R_C;

            store = 1;

        } else {

            /* Force page fault for first write access */

            ctx->prot &= ~PAGE_WRITE;

        }

    }

    return store;

}


static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,

                                void *opaque)

{

    GtkDisplayState *s = opaque;

    int dx, dy;

    int x, y;

    x = motion->x / s->scale_x;

    y = motion->y / s->scale_y;

    if (kbd_mouse_is_absolute()) {

        dx = x * 0x7FFF / (ds_get_width(s->ds) - 1);

        dy = y * 0x7FFF / (ds_get_height(s->ds) - 1);

    } else if (s->last_x == -1 || s->last_y == -1) {

        dx = 0;

        dy = 0;

    } else {

        dx = x - s->last_x;

        dy = y - s->last_y;

    }

    s->last_x = x;

    s->last_y = y;

    if (kbd_mouse_is_absolute()) {

        kbd_mouse_event(dx, dy, 0, s->button_mask);

    }

    return TRUE;

}


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

     } else {

+        v9fs_path_sprintf(target, "%s", name);
+
+    }
+
     return 0;

 }

static int local_name_to_path(FsContext *ctx, V9fsPath *dir_path,

                              const char *name, V9fsPath *target)

{

    if (dir_path) {

        v9fs_path_sprintf(target, "%s/%s", dir_path->data, name);

    } else {

        v9fs_path_sprintf(target, "%s", name);

    }

    return 0;

}


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

     test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_S32);
+
+}

static void test_visitor_out_native_list_int32(TestOutputVisitorData *data,

                                               const void *unused)

{

    test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_S32);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static gboolean qio_channel_yield_enter(QIOChannel *ioc,

+                                        GIOCondition condition,

                                         gpointer opaque)

static gboolean qio_channel_yield_enter(QIOChannel *ioc,

                                        GIOCondition condition,

                                        gpointer opaque)

{

    QIOChannelYieldData *data = opaque;

    qemu_coroutine_enter(data->co, NULL);

    return FALSE;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,

                    uint8_t *properties)
+
 {
+
+    Jpeg2000CodingStyle tmp;
+
     int compno;

static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,

                   uint8_t *properties)

{

    Jpeg2000CodingStyle tmp;

    int compno;

    if (s->buf_end - s->buf < 5)

        return AVERROR_INVALIDDATA;

    tmp.log2_prec_width  =

    tmp.log2_prec_height = 15;

    tmp.csty = bytestream_get_byte(&s->buf);

    // get progression order

    tmp.prog_order = bytestream_get_byte(&s->buf);

    tmp.nlayers = bytestream_get_be16(&s->buf);

    tmp.mct     = bytestream_get_byte(&s->buf); // multiple component transformation

    get_cox(s, &tmp);

    for (compno = 0; compno < s->ncomponents; compno++)

        if (!(properties[compno] & HAD_COC))

            memcpy(c + compno, &tmp, sizeof(tmp));

    return 0;

}