--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 int qemu_devtree_setprop_cell(void *fdt, const char *node_path,
+
+                              const char *property, uint32_t val)
+
+{

     int offset;

int qemu_devtree_setprop_cell(void *fdt, const char *node_path,

                              const char *property, uint32_t val)

{

    int offset;

    offset = fdt_path_offset(fdt, node_path);

    if (offset < 0)

        return offset;

    return fdt_setprop_cell(fdt, offset, property, val);

}


--- a/source.c
+++ b/source.c
@@ -16,11 +16,11 @@
            x265pic.stride[i] = pic->linesize[i];
         }
         x265pic.pts = pic->pts;
+    }
+    ret = x265_encoder_encode(ctx->encoder, &nal, &nnal,
+                              pic ? &x265pic : NULL, &x265pic_out);
+    if (ret < 0)
+        return AVERROR_UNKNOWN;
     if (!nnal)
         return 0;
     for (i = 0; i < nnal; i++)

static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
                                const AVFrame *pic, int *got_packet)
{
    libx265Context *ctx = avctx->priv_data;
    x265_picture x265pic;
    x265_picture x265pic_out = { { 0 } };
    x265_nal *nal;
    uint8_t *dst;
    int payload = 0;
    int nnal;
    int ret;
    int i;
    if (pic) {
        for (i = 0; i < 3; i++) {
           x265pic.planes[i] = pic->data[i];
           x265pic.stride[i] = pic->linesize[i];
        }
        x265pic.pts = pic->pts;
    }
    ret = x265_encoder_encode(ctx->encoder, &nal, &nnal,
                              pic ? &x265pic : NULL, &x265pic_out);
    if (ret < 0)
        return AVERROR_UNKNOWN;
    if (!nnal)
        return 0;
    for (i = 0; i < nnal; i++)
        payload += nal[i].sizeBytes;
    payload += ctx->header_size;
    ret = ff_alloc_packet(pkt, payload);
    if (ret < 0) {
        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
        return ret;
    }
    dst = pkt->data;
    if (ctx->header) {
        memcpy(dst, ctx->header, ctx->header_size);
        dst += ctx->header_size;
        av_freep(&ctx->header);
        ctx->header_size = 0;
    }
    for (i = 0; i < nnal; i++) {
        memcpy(dst, nal[i].payload, nal[i].sizeBytes);
        dst += nal[i].sizeBytes;
        if (is_keyframe(nal[i].type))
            pkt->flags |= AV_PKT_FLAG_KEY;
    }
    pkt->pts = x265pic_out.pts;
    pkt->dts = x265pic_out.dts;
    *got_packet = 1;
    return 0;
}


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

     if (qdev_init(&dev->qdev) < 0)

+        return NULL;
+
+    return &DO_UPCAST(ISAParallelState, dev, dev)->state;
+
+}

ParallelState *parallel_init(int index, CharDriverState *chr)

{

    ISADevice *dev;

    dev = isa_create("isa-parallel");

    qdev_prop_set_uint32(&dev->qdev, "index", index);

    qdev_prop_set_chr(&dev->qdev, "chardev", chr);

    if (qdev_init(&dev->qdev) < 0)

        return NULL;

    return &DO_UPCAST(ISAParallelState, dev, dev)->state;

}


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

 {

+    arm_mptimer_state *s = (arm_mptimer_state *)opaque;
+
+    int id = get_current_cpu(s);

     return timerblock_read(&s->timerblock[id * 2 + 1], addr, size);

static uint64_t arm_thiswdog_read(void *opaque, target_phys_addr_t addr,

                                  unsigned size)

{

    arm_mptimer_state *s = (arm_mptimer_state *)opaque;

    int id = get_current_cpu(s);

    return timerblock_read(&s->timerblock[id * 2 + 1], addr, size);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void hmp_info_cpustats(Monitor *mon, const QDict *qdict)
+
 {

     cpu_dump_statistics(mon_get_cpu(), (FILE *)mon, &monitor_fprintf, 0);

static void hmp_info_cpustats(Monitor *mon, const QDict *qdict)

{

    cpu_dump_statistics(mon_get_cpu(), (FILE *)mon, &monitor_fprintf, 0);

}


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

     } else {

+        set_float_rounding_mode(rounding_mode, &env->fp_status);
+
+        farg.ll = float64_round_to_int(farg.d, &env->fp_status);
+
+        /* Restore rounding mode from FPSCR */

         fpscr_set_rounding_mode();

static inline uint64_t do_fri(uint64_t arg, int rounding_mode)

{

    CPU_DoubleU farg;

    farg.ll = arg;

    if (unlikely(float64_is_signaling_nan(farg.d))) {

        /* sNaN round */

        farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN | POWERPC_EXCP_FP_VXCVI);

    } else if (unlikely(float64_is_nan(farg.d) || float64_is_infinity(farg.d))) {

        /* qNan / infinity round */

        farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXCVI);

    } else {

        set_float_rounding_mode(rounding_mode, &env->fp_status);

        farg.ll = float64_round_to_int(farg.d, &env->fp_status);

        /* Restore rounding mode from FPSCR */

        fpscr_set_rounding_mode();

    }

    return farg.ll;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void listener_add_address_space(MemoryListener *listener,
+
+                                       AddressSpace *as)
+
+{
+
     FlatView *view;

     FlatRange *fr;

static void listener_add_address_space(MemoryListener *listener,

                                       AddressSpace *as)

{

    FlatView *view;

    FlatRange *fr;

    if (listener->address_space_filter

        && listener->address_space_filter != as) {

        return;

    }

    if (global_dirty_log) {

        if (listener->log_global_start) {

            listener->log_global_start(listener);

        }

    }

    view = as->current_map;

    FOR_EACH_FLAT_RANGE(fr, view) {

        MemoryRegionSection section = {

            .mr = fr->mr,

            .address_space = as,

            .offset_within_region = fr->offset_in_region,

            .size = fr->addr.size,

            .offset_within_address_space = int128_get64(fr->addr.start),

            .readonly = fr->readonly,

        };

        if (listener->region_add) {

            listener->region_add(listener, &section);

        }

    }

}


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

             qemu_chr_add_handlers(s->chn[i].chr, serial_can_receive,

+                                  serial_receive1, serial_event, &s->chn[i]);
+
+        }
+
+    }

     s->chn[0].otherchn = &s->chn[1];

static int escc_init1(SysBusDevice *dev)

{

    ESCCState *s = ESCC(dev);

    unsigned int i;

    s->chn[0].disabled = s->disabled;

    s->chn[1].disabled = s->disabled;

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

        sysbus_init_irq(dev, &s->chn[i].irq);

        s->chn[i].chn = 1 - i;

        s->chn[i].clock = s->frequency / 2;

        if (s->chn[i].chr) {

            qemu_chr_add_handlers(s->chn[i].chr, serial_can_receive,

                                  serial_receive1, serial_event, &s->chn[i]);

        }

    }

    s->chn[0].otherchn = &s->chn[1];

    s->chn[1].otherchn = &s->chn[0];

    memory_region_init_io(&s->mmio, OBJECT(s), &escc_mem_ops, s, "escc",

                          ESCC_SIZE << s->it_shift);

    sysbus_init_mmio(dev, &s->mmio);

    if (s->chn[0].type == mouse) {

        qemu_add_mouse_event_handler(sunmouse_event, &s->chn[0], 0,

                                     "QEMU Sun Mouse");

    }

    if (s->chn[1].type == kbd) {

        qemu_add_kbd_event_handler(sunkbd_event, &s->chn[1]);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+BlockDeviceInfoList *bdrv_named_nodes_list(void)

 {

     BlockDeviceInfoList *list, *entry;

+    BlockDriverState *bs;

BlockDeviceInfoList *bdrv_named_nodes_list(void)

{

    BlockDeviceInfoList *list, *entry;

    BlockDriverState *bs;

    list = NULL;

    QTAILQ_FOREACH(bs, &graph_bdrv_states, node_list) {

        entry = g_malloc0(sizeof(*entry));

        entry->value = bdrv_block_device_info(bs);

        entry->next = list;

        list = entry;

    }

    return list;

}


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

 {
+
+    type_register_static(&adb_bus_type_info);

     type_register_static(&adb_device_type_info);

static void adb_register_types(void)

{

    type_register_static(&adb_bus_type_info);

    type_register_static(&adb_device_type_info);

    type_register_static(&adb_kbd_type_info);

    type_register_static(&adb_mouse_type_info);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void visit_end_list(Visitor *v, Error **errp)
+
 {

     assert(!error_is_set(errp));

void visit_end_list(Visitor *v, Error **errp)

{

    assert(!error_is_set(errp));

    v->end_list(v, errp);

}


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

     if (n == 1) {

+        pthread_cond_signal(&ev->cond);
+
+    } else {
+
         pthread_cond_broadcast(&ev->cond);

     }

static inline void futex_wake(QemuEvent *ev, int n)

{

    if (n == 1) {

        pthread_cond_signal(&ev->cond);

    } else {

        pthread_cond_broadcast(&ev->cond);

    }

}


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

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

     int label_match;

static void disas_test_b_imm(DisasContext *s, uint32_t insn)

{

    unsigned int bit_pos, op, rt;

    uint64_t addr;

    int label_match;

    TCGv_i64 tcg_cmp;

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

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

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

    rt = extract32(insn, 0, 5);

    tcg_cmp = tcg_temp_new_i64();

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

    label_match = gen_new_label();

    tcg_gen_brcondi_i64(op ? TCG_COND_NE : TCG_COND_EQ,

                        tcg_cmp, 0, label_match);

    tcg_temp_free_i64(tcg_cmp);

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

    gen_set_label(label_match);

    gen_goto_tb(s, 1, addr);

}


--- a/source.c
+++ b/source.c
@@ -1,16 +1,16 @@
+static CharDriverState *net_vhost_parse_chardev(

+    const NetdevVhostUserOptions *opts, Error **errp)

 {

     CharDriverState *chr = qemu_chr_find(opts->chardev);
+
+    VhostUserChardevProps props;

+
+    if (chr == NULL) {

         error_setg(errp, "chardev \"%s\" not found", opts->chardev);

static CharDriverState *net_vhost_parse_chardev(

    const NetdevVhostUserOptions *opts, Error **errp)

{

    CharDriverState *chr = qemu_chr_find(opts->chardev);

    VhostUserChardevProps props;

    if (chr == NULL) {

        error_setg(errp, "chardev \"%s\" not found", opts->chardev);

        return NULL;

    }

    /* inspect chardev opts */

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

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

        return NULL;

    }

    if (!props.is_socket || !props.is_unix) {

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

                   opts->chardev);

        return NULL;

    }

    qemu_chr_fe_claim_no_fail(chr);

    return chr;

}


--- a/source.c
+++ b/source.c
@@ -7,21 +7,21 @@
     Error *err = NULL;

+
     {

         Visitor *v = opts_visitor_new(opts);

+        visit_type_NumaOptions(v, NULL, &object, &err);

         visit_free(v);

     }

+
+
     if (err) {
+
         goto error;

     }

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

{

    NumaOptions *object = NULL;

    Error *err = NULL;

    {

        Visitor *v = opts_visitor_new(opts);

        visit_type_NumaOptions(v, NULL, &object, &err);

        visit_free(v);

    }

    if (err) {

        goto error;

    }

    switch (object->type) {

    case NUMA_OPTIONS_KIND_NODE:

        numa_node_parse(object->u.node.data, opts, &err);

        if (err) {

            goto error;

        }

        nb_numa_nodes++;

        break;

    default:

        abort();

    }

    return 0;

error:

    error_report_err(err);

    qapi_free_NumaOptions(object);

    return -1;

}


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

 {

+    char buf[4096];
+
+    va_list ap;
+
     va_start(ap, fmt);

     vsnprintf(buf, sizeof(buf), fmt, ap);

void qemu_chr_printf(CharDriverState *s, const char *fmt, ...)

{

    char buf[4096];

    va_list ap;

    va_start(ap, fmt);

    vsnprintf(buf, sizeof(buf), fmt, ap);

    qemu_chr_write(s, (uint8_t *)buf, strlen(buf));

    va_end(ap);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 int bdrv_get_dirty(BlockDriverState *bs, int64_t sector)

+{
+
     int64_t chunk = sector / (int64_t)BDRV_SECTORS_PER_DIRTY_CHUNK;

int bdrv_get_dirty(BlockDriverState *bs, int64_t sector)

{

    int64_t chunk = sector / (int64_t)BDRV_SECTORS_PER_DIRTY_CHUNK;

    if (bs->dirty_bitmap != NULL &&

        (sector << BDRV_SECTOR_BITS) <= bdrv_getlength(bs)) {

        return bs->dirty_bitmap[chunk];

    } else {

        return 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int coroutine_fn mirror_iteration(MirrorBlockJob *s)

 {

@@ -15,9 +15,9 @@
     struct iovec iov;

+
     end = s->common.len >> BDRV_SECTOR_BITS;
+
     s->sector_num = bdrv_get_next_dirty(source, s->sector_num);

     nb_sectors = MIN(BDRV_SECTORS_PER_DIRTY_CHUNK, end - s->sector_num);

static int coroutine_fn mirror_iteration(MirrorBlockJob *s)

{

    BlockDriverState *source = s->common.bs;

    BlockDriverState *target = s->target;

    QEMUIOVector qiov;

    int ret, nb_sectors;

    int64_t end;

    struct iovec iov;

    end = s->common.len >> BDRV_SECTOR_BITS;

    s->sector_num = bdrv_get_next_dirty(source, s->sector_num);

    nb_sectors = MIN(BDRV_SECTORS_PER_DIRTY_CHUNK, end - s->sector_num);

    bdrv_reset_dirty(source, s->sector_num, nb_sectors);

    /* Copy the dirty cluster.  */

    iov.iov_base = s->buf;

    iov.iov_len  = nb_sectors * 512;

    qemu_iovec_init_external(&qiov, &iov, 1);

    trace_mirror_one_iteration(s, s->sector_num, nb_sectors);

    ret = bdrv_co_readv(source, s->sector_num, nb_sectors, &qiov);

    if (ret < 0) {

        return ret;

    }

    return bdrv_co_writev(target, s->sector_num, nb_sectors, &qiov);

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
         abort();

     }
+
+
+
+    cpu->cpreg_vmstate_array_len = cpu->cpreg_array_len;
+
     memcpy(cpu->cpreg_vmstate_indexes, cpu->cpreg_indexes,

            cpu->cpreg_array_len * sizeof(uint64_t));

static void cpu_pre_save(void *opaque)

{

    ARMCPU *cpu = opaque;

    if (!write_cpustate_to_list(cpu)) {

        /* This should never fail. */

        abort();

    }

    cpu->cpreg_vmstate_array_len = cpu->cpreg_array_len;

    memcpy(cpu->cpreg_vmstate_indexes, cpu->cpreg_indexes,

           cpu->cpreg_array_len * sizeof(uint64_t));

    memcpy(cpu->cpreg_vmstate_values, cpu->cpreg_values,

           cpu->cpreg_array_len * sizeof(uint64_t));

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void gen_window_check2(DisasContext *dc, unsigned r1, unsigned r2)
+
 {

     gen_window_check1(dc, r1 > r2 ? r1 : r2);

static void gen_window_check2(DisasContext *dc, unsigned r1, unsigned r2)

{

    gen_window_check1(dc, r1 > r2 ? r1 : r2);

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
                      addr, mask, wr);

             if (!(env->sregs[SR_MSR] & MSR_EE)) {
+
+                return;
+
+            }
+

             env->sregs[SR_ESR] = ESR_EC_UNALIGNED_DATA | (wr << 10) \

void helper_memalign(uint32_t addr, uint32_t dr, uint32_t wr, uint32_t mask)

{

    if (addr & mask) {

            qemu_log("unaligned access addr=%x mask=%x, wr=%d\n",

                     addr, mask, wr);

            if (!(env->sregs[SR_MSR] & MSR_EE)) {

                return;

            }

            env->sregs[SR_ESR] = ESR_EC_UNALIGNED_DATA | (wr << 10) \

                                 | (dr & 31) << 5;

            if (mask == 3) {

                env->sregs[SR_ESR] |= 1 << 11;

            }

            helper_raise_exception(EXCP_HW_EXCP);

    }

}


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

     s->stdio_file = stdio_file;
+
+
+
+    if (mode[0] == 'r') {
+
         s->file = qemu_fopen_ops(s, &stdio_pipe_read_ops);

     } else {

QEMUFile *qemu_popen_cmd(const char *command, const char *mode)

{

    FILE *stdio_file;

    QEMUFileStdio *s;

    if (mode == NULL || (mode[0] != 'r' && mode[0] != 'w') || mode[1] != 0) {

        fprintf(stderr, "qemu_popen: Argument validity check failed\n");

        return NULL;

    }

    stdio_file = popen(command, mode);

    if (stdio_file == NULL) {

        return NULL;

    }

    s = g_malloc0(sizeof(QEMUFileStdio));

    s->stdio_file = stdio_file;

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

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

    } else {

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

    }

    return s->file;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 const char *postproc_configuration(void)

 {
+
     return FFMPEG_CONFIGURATION;

 }

const char *postproc_configuration(void)

{

    return FFMPEG_CONFIGURATION;

}


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

         cb->status = BDRV_BLOCK_DATA | BDRV_BLOCK_OFFSET_VALID | offset;

+        *cb->file = cb->bs->file->bs;

         break;

static void qed_is_allocated_cb(void *opaque, int ret, uint64_t offset, size_t len)

{

    QEDIsAllocatedCB *cb = opaque;

    BDRVQEDState *s = cb->bs->opaque;

    *cb->pnum = len / BDRV_SECTOR_SIZE;

    switch (ret) {

    case QED_CLUSTER_FOUND:

        offset |= qed_offset_into_cluster(s, cb->pos);

        cb->status = BDRV_BLOCK_DATA | BDRV_BLOCK_OFFSET_VALID | offset;

        *cb->file = cb->bs->file->bs;

        break;

    case QED_CLUSTER_ZERO:

        cb->status = BDRV_BLOCK_ZERO;

        break;

    case QED_CLUSTER_L2:

    case QED_CLUSTER_L1:

        cb->status = 0;

        break;

    default:

        assert(ret < 0);

        cb->status = ret;

        break;

    }

    if (cb->co) {

        qemu_coroutine_enter(cb->co, NULL);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int qemu_event_init(void)

 {
+
     int err;

     int fds[2];

static int qemu_event_init(void)

{

    int err;

    int fds[2];

    err = pipe(fds);

    if (err == -1)

        return -errno;

    err = fcntl_setfl(fds[0], O_NONBLOCK);

    if (err < 0)

        goto fail;

    err = fcntl_setfl(fds[1], O_NONBLOCK);

    if (err < 0)

        goto fail;

    qemu_set_fd_handler2(fds[0], NULL, qemu_event_read, NULL,

                         (void *)(unsigned long)fds[0]);

    io_thread_fd = fds[1];

    return 0;

fail:

    close(fds[0]);

    close(fds[1]);

    return err;

}


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

     g_assert(!aio_poll(ctx, false));
+
+    g_assert_cmpint(data.n, ==, 1);
+
+    qemu_bh_delete(data.bh);
+
 }

static void test_bh_flush(void)

{

    BHTestData data = { .n = 0 };

    data.bh = aio_bh_new(ctx, bh_test_cb, &data);

    qemu_bh_schedule(data.bh);

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

    wait_for_aio();

    g_assert_cmpint(data.n, ==, 1);

    g_assert(!aio_poll(ctx, false));

    g_assert_cmpint(data.n, ==, 1);

    qemu_bh_delete(data.bh);

}


--- a/source.c
+++ b/source.c
@@ -21,8 +21,8 @@
     DPRINTF("Read TOC (track %d format %d msf %d)\n", start_track, format, msf >> 1);

     nb_sectors /= s->qdev.blocksize / 512;
+
+    switch (format) {

     case 0:

static int scsi_disk_emulate_read_toc(SCSIRequest *req, uint8_t *outbuf)

{

    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev);

    int start_track, format, msf, toclen;

    uint64_t nb_sectors;

    msf = req->cmd.buf[1] & 2;

    format = req->cmd.buf[2] & 0xf;

    start_track = req->cmd.buf[6];

    bdrv_get_geometry(s->qdev.conf.bs, &nb_sectors);

    DPRINTF("Read TOC (track %d format %d msf %d)\n", start_track, format, msf >> 1);

    nb_sectors /= s->qdev.blocksize / 512;

    switch (format) {

    case 0:

        toclen = cdrom_read_toc(nb_sectors, outbuf, msf, start_track);

        break;

    case 1:

        /* multi session : only a single session defined */

        toclen = 12;

        memset(outbuf, 0, 12);

        outbuf[1] = 0x0a;

        outbuf[2] = 0x01;

        outbuf[3] = 0x01;

        break;

    case 2:

        toclen = cdrom_read_toc_raw(nb_sectors, outbuf, msf, start_track);

        break;

    default:

        return -1;

    }

    if (toclen > req->cmd.xfer) {

        toclen = req->cmd.xfer;

    }

    return toclen;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void vmxnet3_set_events(VMXNET3State *s, uint32_t val)

 {
+
+    uint32_t events;

static void vmxnet3_set_events(VMXNET3State *s, uint32_t val)

{

    uint32_t events;

    VMW_CBPRN("Setting events: 0x%x", val);

    events = VMXNET3_READ_DRV_SHARED32(s->drv_shmem, ecr) | val;

    VMXNET3_WRITE_DRV_SHARED32(s->drv_shmem, ecr, events);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static uint32_t hpet_time_after64(uint64_t a, uint64_t b)
+
 {

     return ((int64_t)(b) - (int64_t)(a) < 0);

static uint32_t hpet_time_after64(uint64_t a, uint64_t b)

{

    return ((int64_t)(b) - (int64_t)(a) < 0);

}


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

 {

+    int i;

     uint64_t mask = stop_flags | L2E_OFFSET_MASK | QCOW_OFLAG_COMPRESSED;

static int count_contiguous_clusters(int nb_clusters, int cluster_size,

        uint64_t *l2_table, uint64_t stop_flags)

{

    int i;

    uint64_t mask = stop_flags | L2E_OFFSET_MASK | QCOW_OFLAG_COMPRESSED;

    uint64_t first_entry = be64_to_cpu(l2_table[0]);

    uint64_t offset = first_entry & mask;

    if (!offset)

        return 0;

    assert(qcow2_get_cluster_type(first_entry) != QCOW2_CLUSTER_COMPRESSED);

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

        uint64_t l2_entry = be64_to_cpu(l2_table[i]) & mask;

        if (offset + (uint64_t) i * cluster_size != l2_entry) {

            break;

        }

    }

	return i;

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);

+
+    mc->alias = "pseries";
+
     mc->is_default = 1;

     smc->dr_lmb_enabled = true;

static void spapr_machine_2_5_class_options(MachineClass *mc)

{

    sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);

    mc->alias = "pseries";

    mc->is_default = 1;

    smc->dr_lmb_enabled = true;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 unsigned iov_copy(struct iovec *dst_iov, unsigned int dst_iov_cnt,

                  const struct iovec *iov, unsigned int iov_cnt,
+
                  size_t offset, size_t bytes)

 {

unsigned iov_copy(struct iovec *dst_iov, unsigned int dst_iov_cnt,

                 const struct iovec *iov, unsigned int iov_cnt,

                 size_t offset, size_t bytes)

{

    size_t len;

    unsigned int i, j;

    for (i = 0, j = 0; i < iov_cnt && j < dst_iov_cnt && bytes; i++) {

        if (offset >= iov[i].iov_len) {

            offset -= iov[i].iov_len;

            continue;

        }

        len = MIN(bytes, iov[i].iov_len - offset);

        dst_iov[j].iov_base = iov[i].iov_base + offset;

        dst_iov[j].iov_len = len;

        j++;

        bytes -= len;

        offset = 0;

    }

    assert(offset == 0);

    return j;

}


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

     int ret = 0;

+
+
+    if (runstate_is_running()) {
+
+        cpu_disable_ticks();

         pause_all_vcpus();

static int do_vm_stop(RunState state)

{

    int ret = 0;

    if (runstate_is_running()) {

        cpu_disable_ticks();

        pause_all_vcpus();

        runstate_set(state);

        vm_state_notify(0, state);

        qapi_event_send_stop(&error_abort);

    }

    bdrv_drain_all();

    ret = blk_flush_all();

    return ret;

}


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

     switch (avctx->codec->id) {
+
+    case AV_CODEC_ID_8SVX_FIB: esc->table = fibonacci;    break;
+
+    case AV_CODEC_ID_8SVX_EXP: esc->table = exponential;  break;
+
     case AV_CODEC_ID_PCM_S8_PLANAR:

     case AV_CODEC_ID_8SVX_RAW: esc->table = NULL;         break;

static av_cold int eightsvx_decode_init(AVCodecContext *avctx)

{

    EightSvxContext *esc = avctx->priv_data;

    if (avctx->channels < 1 || avctx->channels > 2) {

        av_log(avctx, AV_LOG_ERROR, "8SVX does not support more than 2 channels\n");

        return AVERROR_INVALIDDATA;

    }

    switch (avctx->codec->id) {

    case AV_CODEC_ID_8SVX_FIB: esc->table = fibonacci;    break;

    case AV_CODEC_ID_8SVX_EXP: esc->table = exponential;  break;

    case AV_CODEC_ID_PCM_S8_PLANAR:

    case AV_CODEC_ID_8SVX_RAW: esc->table = NULL;         break;

    default:

        av_log(avctx, AV_LOG_ERROR, "Invalid codec id %d.\n", avctx->codec->id);

        return AVERROR_INVALIDDATA;

    }

    avctx->sample_fmt = AV_SAMPLE_FMT_U8P;

    avcodec_get_frame_defaults(&esc->frame);

    avctx->coded_frame = &esc->frame;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int ftp_close(URLContext *h)

+{
+
+    FTPContext *s = h->priv_data;
+
+

     av_dlog(h, "ftp protocol close\n");

static int ftp_close(URLContext *h)

{

    FTPContext *s = h->priv_data;

    av_dlog(h, "ftp protocol close\n");

    ftp_close_both_connections(s);

    av_freep(&s->user);

    av_freep(&s->password);

    av_freep(&s->hostname);

    av_freep(&s->path);

    av_freep(&s->features);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
+static void bdrv_password_cb(void *opaque, const char *password,
+
+                             void *readline_opaque)
+
+{
+
+    Monitor *mon = opaque;
+
+    BlockDriverState *bs = readline_opaque;

+    int ret = 0;
+
     Error *local_err = NULL;

static void bdrv_password_cb(void *opaque, const char *password,

                             void *readline_opaque)

{

    Monitor *mon = opaque;

    BlockDriverState *bs = readline_opaque;

    int ret = 0;

    Error *local_err = NULL;

    bdrv_add_key(bs, password, &local_err);

    if (local_err) {

        error_report_err(local_err);

        ret = -EPERM;

    }

    if (mon->password_completion_cb)

        mon->password_completion_cb(mon->password_opaque, ret);

    monitor_read_command(mon, 1);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static inline void vmsvga_check_size(struct vmsvga_state_s *s)

+{
+
     DisplaySurface *surface = qemu_console_surface(s->vga.con);

static inline void vmsvga_check_size(struct vmsvga_state_s *s)

{

    DisplaySurface *surface = qemu_console_surface(s->vga.con);

    if (s->new_width != surface_width(surface) ||

        s->new_height != surface_height(surface)) {

        qemu_console_resize(s->vga.con, s->new_width, s->new_height);

        s->invalidated = 1;

    }

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     /* FIXME: qobject_to_qint mishandles values over INT64_MAX */

     QObjectInputVisitor *qiv = to_qiv(v);
+
     QObject *qobj = qobject_input_get_object(qiv, name, true, errp);

     QInt *qint;

static void qobject_input_type_uint64(Visitor *v, const char *name,

                                      uint64_t *obj, Error **errp)

{

    /* FIXME: qobject_to_qint mishandles values over INT64_MAX */

    QObjectInputVisitor *qiv = to_qiv(v);

    QObject *qobj = qobject_input_get_object(qiv, name, true, errp);

    QInt *qint;

    if (!qobj) {

        return;

    }

    qint = qobject_to_qint(qobj);

    if (!qint) {

        error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",

                   "integer");

        return;

    }

    *obj = qint_get_int(qint);

}


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

         return 0;

+    if (shutdown_requested)
+
+        return 0;
+
+    if (debug_requested)

         return 0;

static int vm_can_run(void)

{

    if (powerdown_requested)

        return 0;

    if (reset_requested)

        return 0;

    if (shutdown_requested)

        return 0;

    if (debug_requested)

        return 0;

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static target_long monitor_get_pc (const struct MonitorDef *md, int val)

+{

     CPUState *env = mon_get_cpu();

static target_long monitor_get_pc (const struct MonitorDef *md, int val)

{

    CPUState *env = mon_get_cpu();

    if (!env)

        return 0;

    return env->eip + env->segs[R_CS].base;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm,

+           unsigned facs_tbl_offset, unsigned dsdt_tbl_offset,
+
+           const char *oem_id, const char *oem_table_id)
+
+{

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

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

           unsigned facs_tbl_offset, unsigned dsdt_tbl_offset,

           const char *oem_id, const char *oem_table_id)

{

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

    unsigned fw_ctrl_offset = (char *)&fadt->firmware_ctrl - table_data->data;

    unsigned dsdt_entry_offset = (char *)&fadt->dsdt - table_data->data;

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

    bios_linker_loader_add_pointer(linker,

        ACPI_BUILD_TABLE_FILE, fw_ctrl_offset, sizeof(fadt->firmware_ctrl),

        ACPI_BUILD_TABLE_FILE, facs_tbl_offset);

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

    fadt_setup(fadt, pm);

    bios_linker_loader_add_pointer(linker,

        ACPI_BUILD_TABLE_FILE, dsdt_entry_offset, sizeof(fadt->dsdt),

        ACPI_BUILD_TABLE_FILE, dsdt_tbl_offset);

    build_header(linker, table_data,

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

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 libAVFilter_QueryVendorInfo(libAVFilter *this, wchar_t **info)

 {
+
+    dshowdebug("libAVFilter_QueryVendorInfo(%p)\n", this);

libAVFilter_QueryVendorInfo(libAVFilter *this, wchar_t **info)

{

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

    if (!info)

        return E_POINTER;

    *info = wcsdup(L"libAV");

    return S_OK;

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     QIOChannelSocket *sioc = qio_channel_socket_new();

     char *name;
+
+    UdpChardev *s = UDP_CHARDEV(chr);
+
+
+
     if (qio_channel_socket_dgram_sync(sioc,

                                       udp->local, udp->remote,

static void qmp_chardev_open_udp(Chardev *chr,

                                 ChardevBackend *backend,

                                 bool *be_opened,

                                 Error **errp)

{

    ChardevUdp *udp = backend->u.udp.data;

    QIOChannelSocket *sioc = qio_channel_socket_new();

    char *name;

    UdpChardev *s = UDP_CHARDEV(chr);

    if (qio_channel_socket_dgram_sync(sioc,

                                      udp->local, udp->remote,

                                      errp) < 0) {

        object_unref(OBJECT(sioc));

        return;

    }

    name = g_strdup_printf("chardev-udp-%s", chr->label);

    qio_channel_set_name(QIO_CHANNEL(sioc), name);

    g_free(name);

    s->ioc = QIO_CHANNEL(sioc);

    /* be isn't opened until we get a connection */

    *be_opened = false;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void execute_async(DWORD WINAPI (*func)(LPVOID), LPVOID opaque,

+                          Error **errp)

 {

static void execute_async(DWORD WINAPI (*func)(LPVOID), LPVOID opaque,

                          Error **errp)

{

    Error *local_err = NULL;

    if (error_is_set(errp)) {

        return;

    }

    HANDLE thread = CreateThread(NULL, 0, func, opaque, 0, NULL);

    if (!thread) {

        error_set(&local_err, QERR_QGA_COMMAND_FAILED,

                  "failed to dispatch asynchronous command");

        error_propagate(errp, local_err);

    }

}


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

     } else {

+        write_cb = ctx->spr_cb[sprn].oea_write;

     }

static void gen_mtspr(DisasContext *ctx)

{

    void (*write_cb)(DisasContext *ctx, int sprn, int gprn);

    uint32_t sprn = SPR(ctx->opcode);

#if defined(CONFIG_USER_ONLY)

    write_cb = ctx->spr_cb[sprn].uea_write;

#else

    if (ctx->pr) {

        write_cb = ctx->spr_cb[sprn].uea_write;

    } else if (ctx->hv) {

        write_cb = ctx->spr_cb[sprn].hea_write;

    } else {

        write_cb = ctx->spr_cb[sprn].oea_write;

    }

#endif

    if (likely(write_cb != NULL)) {

        if (likely(write_cb != SPR_NOACCESS)) {

            (*write_cb)(ctx, sprn, rS(ctx->opcode));

        } else {

            /* Privilege exception */

            fprintf(stderr, "Trying to write privileged spr %d (0x%03x) at "

                    TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);

            if (qemu_log_separate()) {

                qemu_log("Trying to write privileged spr %d (0x%03x) at "

                         TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);

            }

            gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

        }

    } else {

        /* Not defined */

        if (qemu_log_separate()) {

            qemu_log("Trying to write invalid spr %d (0x%03x) at "

                     TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);

        }

        fprintf(stderr, "Trying to write invalid spr %d (0x%03x) at "

                TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);

        gen_inval_exception(ctx, POWERPC_EXCP_INVAL_SPR);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 int is_adx(const unsigned char *buf,size_t bufsize)
+
+{
+
+	int	offset;
+

 	if (buf[0]!=0x80) return 0;

int is_adx(const unsigned char *buf,size_t bufsize)

{

	int	offset;

	if (buf[0]!=0x80) return 0;

	offset = (read_long(buf)^0x80000000)+4;

	if (bufsize<offset || memcmp(buf+offset-6,"(c)CRI",6)) return 0;

	return offset;

}


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

     mmio = g_malloc0(sizeof(subpage_t));

+
+
+    mmio->base = base;
+
+    memory_region_init_io(&mmio->iomem, &subpage_ops, mmio,

                           "subpage", TARGET_PAGE_SIZE);

static subpage_t *subpage_init(target_phys_addr_t base)

{

    subpage_t *mmio;

    mmio = g_malloc0(sizeof(subpage_t));

    mmio->base = base;

    memory_region_init_io(&mmio->iomem, &subpage_ops, mmio,

                          "subpage", TARGET_PAGE_SIZE);

    mmio->iomem.subpage = true;

#if defined(DEBUG_SUBPAGE)

    printf("%s: %p base " TARGET_FMT_plx " len %08x %d\n", __func__,

           mmio, base, TARGET_PAGE_SIZE, subpage_memory);

#endif

    subpage_register(mmio, 0, TARGET_PAGE_SIZE-1, phys_section_unassigned);

    return mmio;

}


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

 	printf(

read_help(void)

{

	printf(

"\n"

" reads a range of bytes from the given offset\n"

"\n"

" Example:\n"

" 'read -v 512 1k' - dumps 1 kilobyte read from 512 bytes into the file\n"

"\n"

" Reads a segment of the currently open file, optionally dumping it to the\n"

" standard output stream (with -v option) for subsequent inspection.\n"

" -p, -- use bdrv_pread to read the file\n"

" -P, -- use a pattern to verify read data\n"

" -C, -- report statistics in a machine parsable format\n"

" -v, -- dump buffer to standard output\n"

" -q, -- quite mode, do not show I/O statistics\n"

"\n");

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void bitband_writeb(void *opaque, target_phys_addr_t offset,

                            uint32_t value)
+
+{
+
+    uint32_t addr;
+
     uint8_t mask;

     uint8_t v;

static void bitband_writeb(void *opaque, target_phys_addr_t offset,

                           uint32_t value)

{

    uint32_t addr;

    uint8_t mask;

    uint8_t v;

    addr = bitband_addr(opaque, offset);

    mask = (1 << ((offset >> 2) & 7));

    cpu_physical_memory_read(addr, &v, 1);

    if (value & 1)

        v |= mask;

    else

        v &= ~mask;

    cpu_physical_memory_write(addr, &v, 1);

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
     field->type = type;

     field->offset = cpu_to_le16(offset);
+
+    memcpy(field->data, data, len);
+
+
+
     smbios_entries_len += sizeof(*field) + len;

     (*(uint16_t *)smbios_entries) =

void smbios_add_field(int type, int offset, const void *data, size_t len)

{

    struct smbios_field *field;

    smbios_check_collision(type, SMBIOS_FIELD_ENTRY);

    if (!smbios_entries) {

        smbios_entries_len = sizeof(uint16_t);

        smbios_entries = g_malloc0(smbios_entries_len);

    }

    smbios_entries = g_realloc(smbios_entries, smbios_entries_len +

                                                  sizeof(*field) + len);

    field = (struct smbios_field *)(smbios_entries + smbios_entries_len);

    field->header.type = SMBIOS_FIELD_ENTRY;

    field->header.length = cpu_to_le16(sizeof(*field) + len);

    field->type = type;

    field->offset = cpu_to_le16(offset);

    memcpy(field->data, data, len);

    smbios_entries_len += sizeof(*field) + len;

    (*(uint16_t *)smbios_entries) =

            cpu_to_le16(le16_to_cpu(*(uint16_t *)smbios_entries) + 1);

}


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

+    env = cpu_single_env;
+
+    if (!env)
+
         return;

     env->eflags = (env->eflags & ~(IF_MASK | IOPL_MASK)) |

static void qpi_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t val)

{

    CPUState *env;

    env = cpu_single_env;

    if (!env)

        return;

    env->eflags = (env->eflags & ~(IF_MASK | IOPL_MASK)) |

        (val & (IF_MASK | IOPL_MASK));

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void test_io_channel_command_fifo(bool async)

 {
+
+#define TEST_FIFO "tests/test-io-channel-command.fifo"

     QIOChannel *src, *dst;

@@ -21,8 +21,8 @@
     const char *dstargv[] = {

         "/bin/socat", dstfifo, "-", NULL,
+
+    };

static void test_io_channel_command_fifo(bool async)

{

#define TEST_FIFO "tests/test-io-channel-command.fifo"

    QIOChannel *src, *dst;

    QIOChannelTest *test;

    char *srcfifo = g_strdup_printf("PIPE:%s,wronly", TEST_FIFO);

    char *dstfifo = g_strdup_printf("PIPE:%s,rdonly", TEST_FIFO);

    const char *srcargv[] = {

        "/bin/socat", "-", srcfifo, NULL,

    };

    const char *dstargv[] = {

        "/bin/socat", dstfifo, "-", NULL,

    };

    unlink(TEST_FIFO);

    if (access("/bin/socat", X_OK) < 0) {

        return; /* Pretend success if socat is not present */

    }

    if (mkfifo(TEST_FIFO, 0600) < 0) {

        abort();

    }

    src = QIO_CHANNEL(qio_channel_command_new_spawn(srcargv,

                                                    O_WRONLY,

                                                    &error_abort));

    dst = QIO_CHANNEL(qio_channel_command_new_spawn(dstargv,

                                                    O_RDONLY,

                                                    &error_abort));

    test = qio_channel_test_new();

    qio_channel_test_run_threads(test, async, src, dst);

    qio_channel_test_validate(test);

    object_unref(OBJECT(src));

    object_unref(OBJECT(dst));

    g_free(srcfifo);

    g_free(dstfifo);

    unlink(TEST_FIFO);

}


--- a/source.c
+++ b/source.c
@@ -11,7 +11,7 @@
     entry = g_new0(MSIRouteEntry, 1);
     entry->dev = dev;
     entry->vector = vector;
+    entry->virq = route->gsi;
+    QLIST_INSERT_HEAD(&msi_route_list, entry, list);
+    trace_kvm_x86_add_msi_route(route->gsi);
+    return 0;

int kvm_arch_add_msi_route_post(struct kvm_irq_routing_entry *route,
                                int vector, PCIDevice *dev)
{
    static bool notify_list_inited = false;
    MSIRouteEntry *entry;
    if (!dev) {
        /* These are (possibly) IOAPIC routes only used for split
         * kernel irqchip mode, while what we are housekeeping are
         * PCI devices only. */
        return 0;
    entry = g_new0(MSIRouteEntry, 1);
    entry->dev = dev;
    entry->vector = vector;
    entry->virq = route->gsi;
    QLIST_INSERT_HEAD(&msi_route_list, entry, list);
    trace_kvm_x86_add_msi_route(route->gsi);
    return 0;


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void tcg_gen_ld8s_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset)

+{

     tcg_gen_ld8s_i32(TCGV_LOW(ret), arg2, offset);

void tcg_gen_ld8s_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset)

{

    tcg_gen_ld8s_i32(TCGV_LOW(ret), arg2, offset);

    tcg_gen_sari_i32(TCGV_HIGH(ret), TCGV_HIGH(ret), 31);

}


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

     for (n = 0; n < buffer_length; n++) {
+
+        out[n] = in[n];
+
+        for (i = 1; i < filter_length; i++)
+
             out[n] += filter_coeffs[i-1] * in[n-i];

     }

void ff_celp_lp_zero_synthesis_filterf(float *out,

                                       const float* filter_coeffs,

                                       const float* in,

                                       int buffer_length,

                                       int filter_length)

{

    int i,n;

    // Avoids a +1 in the inner loop.

    filter_length++;

    for (n = 0; n < buffer_length; n++) {

        out[n] = in[n];

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

            out[n] += filter_coeffs[i-1] * in[n-i];

    }

}


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

                 return NULL;

+            }
+
+            lp->u.node = p = g_malloc0(sizeof(PhysPageEntry) * L2_SIZE);
+
+            if (i == 0) {

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

static uint16_t *phys_page_find_alloc(target_phys_addr_t index, int alloc)

{

    PhysPageEntry *lp, *p;

    int i, j;

    lp = &phys_map;

    /* Level 1..N.  */

    for (i = P_L2_LEVELS - 1; i >= 0; i--) {

        if (lp->u.node == NULL) {

            if (!alloc) {

                return NULL;

            }

            lp->u.node = p = g_malloc0(sizeof(PhysPageEntry) * L2_SIZE);

            if (i == 0) {

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

                    p[j].u.leaf = phys_section_unassigned;

                }

            }

        }

        lp = &lp->u.node[(index >> (i * L2_BITS)) & (L2_SIZE - 1)];

    }

    return &lp->u.leaf;

}


--- a/source.c
+++ b/source.c
@@ -29,11 +29,11 @@
         tv.tv_sec = 0;

         tv.tv_usec = 100 * 1000;
+
+        ret = select(fd_max + 1, NULL, &wfds, NULL, &tv);
+
+        if (ret > 0 && FD_ISSET(s->fd, &wfds)) {
+
             len = send(s->fd, buf, size, 0);

             if (len < 0) {

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

{

    TCPContext *s = h->priv_data;

    int ret, size1, fd_max, len;

    fd_set wfds;

    struct timeval tv;

    size1 = size;

    while (size > 0) {

        if (url_interrupt_cb())

            return AVERROR(EINTR);

        fd_max = s->fd;

        FD_ZERO(&wfds);

        FD_SET(s->fd, &wfds);

        tv.tv_sec = 0;

        tv.tv_usec = 100 * 1000;

        ret = select(fd_max + 1, NULL, &wfds, NULL, &tv);

        if (ret > 0 && FD_ISSET(s->fd, &wfds)) {

            len = send(s->fd, buf, size, 0);

            if (len < 0) {

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

                    ff_neterrno() != FF_NETERROR(EAGAIN))

                    return ff_neterrno();

                continue;

            }

            size -= len;

            buf += len;

        } else if (ret < 0) {

            if (ff_neterrno() == FF_NETERROR(EINTR))

                continue;

            return -1;

        }

    }

    return size1 - size;

}


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

     QString *qstr;

+
+
+    *obj = NULL;
+
+    if (!qobj) {

         return;

static void qmp_input_type_str(Visitor *v, const char *name, char **obj,

                               Error **errp)

{

    QmpInputVisitor *qiv = to_qiv(v);

    QObject *qobj = qmp_input_get_object(qiv, name, true, errp);

    QString *qstr;

    *obj = NULL;

    if (!qobj) {

        return;

    }

    qstr = qobject_to_qstring(qobj);

    if (!qstr) {

        error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",

                   "string");

        return;

    }

    *obj = g_strdup(qstring_get_str(qstr));

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static inline int usb_bt_fifo_dequeue(struct usb_hci_in_fifo_s *fifo,
+
                 USBPacket *p)
+
+{
+
     int len;

static inline int usb_bt_fifo_dequeue(struct usb_hci_in_fifo_s *fifo,

                USBPacket *p)

{

    int len;

    if (likely(!fifo->len))

        return USB_RET_STALL;

    len = MIN(p->len, fifo->fifo[fifo->start].len);

    memcpy(p->data, fifo->fifo[fifo->start].data, len);

    if (len == p->len) {

        fifo->fifo[fifo->start].len -= len;

        fifo->fifo[fifo->start].data += len;

    } else {

        fifo->start ++;

        fifo->start &= CFIFO_LEN_MASK;

        fifo->len --;

    }

    fifo->dstart += len;

    fifo->dlen -= len;

    if (fifo->dstart >= fifo->dsize) {

        fifo->dstart = 0;

        fifo->dsize = DFIFO_LEN_MASK + 1;

    }

    return len;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void check_pred8x8l(H264PredContext *h, uint8_t *buf0, uint8_t *buf1,
+
+                           int codec, int chroma_format, int bit_depth)
+
+{

     if (chroma_format == 1 && codec_ids[codec] == AV_CODEC_ID_H264) {

static void check_pred8x8l(H264PredContext *h, uint8_t *buf0, uint8_t *buf1,

                           int codec, int chroma_format, int bit_depth)

{

    if (chroma_format == 1 && codec_ids[codec] == AV_CODEC_ID_H264) {

        int pred_mode;

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

            if (check_pred_func(h->pred8x8l[pred_mode], "8x8l", pred4x4_modes[codec][pred_mode])) {

                int neighbors;

                for (neighbors = 0; neighbors <= 0xc000; neighbors += 0x4000) {

                    int has_topleft  = neighbors & 0x8000;

                    int has_topright = neighbors & 0x4000;

                    if ((pred_mode == DIAG_DOWN_RIGHT_PRED || pred_mode == VERT_RIGHT_PRED) && !has_topleft)

                        continue; /* Those aren't allowed according to the spec */

                    randomize_buffers();

                    call_ref(src0, has_topleft, has_topright, (ptrdiff_t)24*SIZEOF_PIXEL);

                    call_new(src1, has_topleft, has_topright, (ptrdiff_t)24*SIZEOF_PIXEL);

                    if (memcmp(buf0, buf1, BUF_SIZE))

                        fail();

                    bench_new(src1, has_topleft, has_topright, (ptrdiff_t)24*SIZEOF_PIXEL);

                }

            }

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void ff_put_h264_qpel4_mc02_msa(uint8_t *dst, const uint8_t *src,
+
+                                ptrdiff_t stride)

 {

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

                                ptrdiff_t stride)

{

    avc_luma_vt_4w_msa(src - (stride * 2), stride, dst, stride, 4);

}


static int ass_get_duration(const uint8_t *p)

{

    int sh, sm, ss, sc, eh, em, es, ec;

    uint64_t start, end;

    if (sscanf(p, "%*[^,],%d:%d:%d%*c%d,%d:%d:%d%*c%d",

               &sh, &sm, &ss, &sc, &eh, &em, &es, &ec) != 8)

        return 0;

    start = 3600000 * sh + 60000 * sm + 1000 * ss + 10 * sc;

    end   = 3600000 * eh + 60000 * em + 1000 * es + 10 * ec;

    return end - start;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static int show_hwaccels(void *optctx, const char *opt, const char *arg)

 {
+
+    int i;
+
+
+
     printf("Hardware acceleration methods:\n");

     for (i = 0; hwaccels[i].name; i++) {

static int show_hwaccels(void *optctx, const char *opt, const char *arg)

{

    int i;

    printf("Hardware acceleration methods:\n");

    for (i = 0; hwaccels[i].name; i++) {

        printf("%s\n", hwaccels[i].name);

    }

    printf("\n");

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int parse_uint32(DeviceState *dev, Property *prop, const char *str)

+{
+
+    uint32_t *ptr = qdev_get_prop_ptr(dev, prop);

     const char *fmt;

static int parse_uint32(DeviceState *dev, Property *prop, const char *str)

{

    uint32_t *ptr = qdev_get_prop_ptr(dev, prop);

    const char *fmt;

    /* accept both hex and decimal */

    fmt = strncasecmp(str, "0x",2) == 0 ? "%" PRIx32 : "%" PRIu32;

    if (sscanf(str, fmt, ptr) != 1)

        return -EINVAL;

    return 0;

}


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

     assert(!qemu_lockcnt_count(&ctx->list_lock));

+    while (ctx->first_bh) {
+
+        QEMUBH *next = ctx->first_bh->next;
+
+

         /* qemu_bh_delete() must have been called on BHs in this AioContext */

aio_ctx_finalize(GSource     *source)

{

    AioContext *ctx = (AioContext *) source;

    thread_pool_free(ctx->thread_pool);

#ifdef CONFIG_LINUX_AIO

    if (ctx->linux_aio) {

        laio_detach_aio_context(ctx->linux_aio, ctx);

        laio_cleanup(ctx->linux_aio);

        ctx->linux_aio = NULL;

    }

#endif

    qemu_lockcnt_lock(&ctx->list_lock);

    assert(!qemu_lockcnt_count(&ctx->list_lock));

    while (ctx->first_bh) {

        QEMUBH *next = ctx->first_bh->next;

        /* qemu_bh_delete() must have been called on BHs in this AioContext */

        assert(ctx->first_bh->deleted);

        g_free(ctx->first_bh);

        ctx->first_bh = next;

    }

    qemu_lockcnt_unlock(&ctx->list_lock);

    aio_set_event_notifier(ctx, &ctx->notifier, false, NULL, NULL);

    event_notifier_cleanup(&ctx->notifier);

    qemu_rec_mutex_destroy(&ctx->lock);

    qemu_lockcnt_destroy(&ctx->list_lock);

    timerlistgroup_deinit(&ctx->tlg);

}


static void vga_screen_dump_blank(VGAState *s, const char *filename)

{

    FILE *f;

    unsigned int y, x, w, h;

    w = s->last_scr_width * sizeof(uint32_t);

    h = s->last_scr_height;

    f = fopen(filename, "wb");

    if (!f)

        return;

    fprintf(f, "P6\n%d %d\n%d\n", w, h, 255);

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

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

            fputc(0, f);

        }

    }

    fclose(f);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline void RENAME(nv12ToUV)(uint8_t *dstU, uint8_t *dstV,

                                     const uint8_t *src1, const uint8_t *src2,

static inline void RENAME(nv12ToUV)(uint8_t *dstU, uint8_t *dstV,

                                    const uint8_t *src1, const uint8_t *src2,

                                    int width, uint32_t *unused)

{

    RENAME(nvXXtoUV)(dstU, dstV, src1, width);

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
                           const char *tag)

 {
+
+    while (bs && bs->drv && !bs->drv->bdrv_debug_breakpoint) {
+
+        bs = bs->file;
+
     }

int bdrv_debug_breakpoint(BlockDriverState *bs, const char *event,

                          const char *tag)

{

    while (bs && bs->drv && !bs->drv->bdrv_debug_breakpoint) {

        bs = bs->file;

    }

    if (bs && bs->drv && bs->drv->bdrv_debug_breakpoint) {

        return bs->drv->bdrv_debug_breakpoint(bs, event, tag);

    }

    return -ENOTSUP;

}


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

 {

+    BlkMigDevState *bmds;
+
+    uint64_t sum = 0;
+
+

     blk_mig_lock();

uint64_t blk_mig_bytes_transferred(void)

{

    BlkMigDevState *bmds;

    uint64_t sum = 0;

    blk_mig_lock();

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

        sum += bmds->completed_sectors;

    }

    blk_mig_unlock();

    return sum << BDRV_SECTOR_BITS;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static FlatView generate_memory_topology(MemoryRegion *mr)

 {
+
     FlatView view;

static FlatView generate_memory_topology(MemoryRegion *mr)

{

    FlatView view;

    flatview_init(&view);

    render_memory_region(&view, mr, 0, addrrange_make(0, UINT64_MAX));

    flatview_simplify(&view);

    return view;

}


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

                                 size_t size, int flags)
+
+{
+
     errno = ENOTSUP;

     return -1;

static int v9fs_synth_lsetxattr(FsContext *ctx, V9fsPath *path,

                                const char *name, void *value,

                                size_t size, int flags)

{

    errno = ENOTSUP;

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -13,7 +13,7 @@
     Error *local_err = NULL;

     int64_t value;
+

     if (dev->state != DEV_STATE_CREATED) {

static void set_int16(Object *obj, Visitor *v, void *opaque,

                      const char *name, Error **errp)

{

    DeviceState *dev = DEVICE(obj);

    Property *prop = opaque;

    int16_t *ptr = qdev_get_prop_ptr(dev, prop);

    Error *local_err = NULL;

    int64_t value;

    if (dev->state != DEV_STATE_CREATED) {

        error_set(errp, QERR_PERMISSION_DENIED);

        return;

    }

    visit_type_int(v, &value, name, &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        return;

    }

    if (value > prop->info->min && value <= prop->info->max) {

        *ptr = value;

    } else {

        error_set(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE,

                  dev->id?:"", name, value, prop->info->min,

                  prop->info->max);

    }

}


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

     /* We can't rely on STS_BSY until the command has started processing.
+
+     * Therefore, we also use the Command Issue bit as indication of
+
+     * a command in-flight. */
+
     while (BITSET(ahci_px_rreg(ahci, cmd->port, AHCI_PX_TFD),

                   AHCI_PX_TFD_STS_BSY) ||

void ahci_command_wait(AHCIQState *ahci, AHCICommand *cmd)

{

    /* We can't rely on STS_BSY until the command has started processing.

     * Therefore, we also use the Command Issue bit as indication of

     * a command in-flight. */

    while (BITSET(ahci_px_rreg(ahci, cmd->port, AHCI_PX_TFD),

                  AHCI_PX_TFD_STS_BSY) ||

           BITSET(ahci_px_rreg(ahci, cmd->port, AHCI_PX_CI), (1 << cmd->slot))) {

        usleep(50);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+static void imx_eth_enable_rx(IMXFECState *s)

 {

     IMXFECBufDesc bd;

     bool rx_ring_full;
+

     imx_fec_read_bd(&bd, s->rx_descriptor);

static void imx_eth_enable_rx(IMXFECState *s)

{

    IMXFECBufDesc bd;

    bool rx_ring_full;

    imx_fec_read_bd(&bd, s->rx_descriptor);

    rx_ring_full = !(bd.flags & ENET_BD_E);

    if (rx_ring_full) {

        FEC_PRINTF("RX buffer full\n");

    } else if (!s->regs[ENET_RDAR]) {

        qemu_flush_queued_packets(qemu_get_queue(s->nic));

    }

    s->regs[ENET_RDAR] = rx_ring_full ? 0 : ENET_RDAR_RDAR;

}


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

     BlkMigDevState *bmds;

+    uint64_t sum = 0;
+
+
+
     QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {

         sum += bmds->total_sectors;

uint64_t blk_mig_bytes_total(void)

{

    BlkMigDevState *bmds;

    uint64_t sum = 0;

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

        sum += bmds->total_sectors;

    }

    return sum << BDRV_SECTOR_BITS;

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     dom = xs_get_domain_path(xenstore, con->xendev.dom);

     snprintf(con->console, sizeof(con->console), "%s/console", dom);
+
+    free(dom);
+
+
+
     type = xenstore_read_str(con->console, "type");

     if (!type || strcmp(type, "ioemu") != 0) {

static int con_init(struct XenDevice *xendev)

{

    struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);

    char *type, *dom;

    int ret = 0;

    /* setup */

    dom = xs_get_domain_path(xenstore, con->xendev.dom);

    snprintf(con->console, sizeof(con->console), "%s/console", dom);

    free(dom);

    type = xenstore_read_str(con->console, "type");

    if (!type || strcmp(type, "ioemu") != 0) {

	xen_be_printf(xendev, 1, "not for me (type=%s)\n", type);

        ret = -1;

        goto out;

    }

    if (!serial_hds[con->xendev.dev])

	xen_be_printf(xendev, 1, "WARNING: serial line %d not configured\n",

                      con->xendev.dev);

    else

        con->chr = serial_hds[con->xendev.dev];

out:

    qemu_free(type);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void fill_yuv_image(AVFrame *pict, int frame_index,
+
+                           int width, int height)
+
 {

     int x, y, i, ret;

static void fill_yuv_image(AVFrame *pict, int frame_index,

                           int width, int height)

{

    int x, y, i, ret;

    /* when we pass a frame to the encoder, it may keep a reference to it

     * internally;

     * make sure we do not overwrite it here

     */

    ret = av_frame_make_writable(pict);

    if (ret < 0)

        exit(1);

    i = frame_index;

    /* Y */

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

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

            pict->data[0][y * pict->linesize[0] + x] = x + y + i * 3;

    /* Cb and Cr */

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

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

            pict->data[1][y * pict->linesize[1] + x] = 128 + y + i * 2;

            pict->data[2][y * pict->linesize[2] + x] = 64 + x + i * 5;

        }

    }

}


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

         ics->irqs[i].priority = 0xff;

+        ics->irqs[i].saved_priority = 0xff;
+
+    }
+
+}

static void xics_reset(void *opaque)

{

    struct icp_state *icp = (struct icp_state *)opaque;

    struct ics_state *ics = icp->ics;

    int i;

    for (i = 0; i < icp->nr_servers; i++) {

        icp->ss[i].xirr = 0;

        icp->ss[i].pending_priority = 0;

        icp->ss[i].mfrr = 0xff;

        /* Make all outputs are deasserted */

        qemu_set_irq(icp->ss[i].output, 0);

    }

    for (i = 0; i < ics->nr_irqs; i++) {

        /* Reset everything *except* the type */

        ics->irqs[i].server = 0;

        ics->irqs[i].status = 0;

        ics->irqs[i].priority = 0xff;

        ics->irqs[i].saved_priority = 0xff;

    }

}


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

+    for (i = s->parent.requests; i; i = i->next) {
+
+        rng_egd_free_request(i->data);
+
+    }

static void rng_egd_free_requests(RngEgd *s)

{

    GSList *i;

    for (i = s->parent.requests; i; i = i->next) {

        rng_egd_free_request(i->data);

    }

    g_slist_free(s->parent.requests);

    s->parent.requests = NULL;

}


--- a/source.c
+++ b/source.c
@@ -9,8 +9,8 @@
         powernv_create_core_node(chip, pnv_core, fdt);
     }
     if (chip->ram_size) {
+        powernv_populate_memory_node(fdt, chip->chip_id, chip->ram_start,
+                                     chip->ram_size);
+    }
+    g_free(typename);
 }

static void powernv_populate_chip(PnvChip *chip, void *fdt)
{
    PnvChipClass *pcc = PNV_CHIP_GET_CLASS(chip);
    char *typename = pnv_core_typename(pcc->cpu_model);
    size_t typesize = object_type_get_instance_size(typename);
    int i;
    for (i = 0; i < chip->nr_cores; i++) {
        PnvCore *pnv_core = PNV_CORE(chip->cores + i * typesize);
        powernv_create_core_node(chip, pnv_core, fdt);
    }
    if (chip->ram_size) {
        powernv_populate_memory_node(fdt, chip->chip_id, chip->ram_start,
                                     chip->ram_size);
    }
    g_free(typename);
}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+unsigned int av_codec_get_tag(const AVCodecTag *tags[4], enum CodecID id)
+
+{
+
     int i;

     for(i=0; i<4 && tags[i]; i++){

unsigned int av_codec_get_tag(const AVCodecTag *tags[4], enum CodecID id)

{

    int i;

    for(i=0; i<4 && tags[i]; i++){

        int tag= codec_get_tag(tags[i], id);

        if(tag) return tag;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+void rgb15tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size)

 {

void rgb15tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size)

{

	const uint16_t *end;

	uint8_t *d = (uint8_t *)dst;

	const uint16_t *s = (uint16_t *)src;

	end = s + src_size/2;

	while(s < end)

	{

		register uint16_t bgr;

		bgr = *s++;

		*d++ = (bgr&0x7C00)>>7;

		*d++ = (bgr&0x3E0)>>2;

		*d++ = (bgr&0x1F)<<3;

	}

}


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

         gnutls_certificate_free_credentials(creds->data);

+        creds->data = NULL;
+
+

qcrypto_tls_creds_x509_unload(QCryptoTLSCredsX509 *creds)

{

    if (creds->data) {

        gnutls_certificate_free_credentials(creds->data);

        creds->data = NULL;


void armv7m_nvic_complete_irq(void *opaque, int irq)

{

    nvic_state *s = (nvic_state *)opaque;

    if (irq >= 16)

        irq += 16;

    gic_complete_irq(&s->gic, 0, irq);

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
             run_length *=2;
         if (color) {
             memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length);
+            if (half_vert)
+                memset(s->frame.data[0] + (y+1)*s->frame.linesize[0] + x, color, run_length);
+        }
+        x+= run_length;
+        if (x >= s->avctx->width) {
             x=0;
             y += 1 + half_vert;
         }

static void mm_decode_intra(MmContext * s, int half_horiz, int half_vert, const uint8_t *buf, int buf_size)
{
    int i, x, y;
    i=0; x=0; y=0;
    while(i<buf_size) {
        int run_length, color;
        if (buf[i] & 0x80) {
            run_length = 1;
            color = buf[i];
            i++;
        }else{
            run_length = (buf[i] & 0x7f) + 2;
            color = buf[i+1];
            i+=2;
        }
        if (half_horiz)
            run_length *=2;
        if (color) {
            memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length);
            if (half_vert)
                memset(s->frame.data[0] + (y+1)*s->frame.linesize[0] + x, color, run_length);
        }
        x+= run_length;
        if (x >= s->avctx->width) {
            x=0;
            y += 1 + half_vert;
        }
    }
}


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

{

    int b, c, i;

    unsigned int u;

    int buffer1[10];

    int buffer2[10];

    int *bp1 = buffer1;

    int *bp2 = buffer2;

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

        buffer2[i] = coefs[i];

    refl[9] = bp2[9];

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

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

        return 1;

    }

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

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

        if (!b)

            b = -2;

        for (u=0; u<=c; u++)

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

        refl[c] = bp1[c];

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

            return 1;

        FFSWAP(int *, bp1, bp2);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -19,9 +19,9 @@
 #ifdef DEBUG_SEEK

     av_log(s, AV_LOG_DEBUG, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos);
+
+#endif
+
+    url_fseek(pb, pos, SEEK_SET);
+
 }

static void ffm_seek1(AVFormatContext *s, int64_t pos1)

{

    FFMContext *ffm = s->priv_data;

    ByteIOContext *pb = s->pb;

    int64_t pos;

    pos = pos1 + ffm->write_index;

    if (pos >= ffm->file_size)

        pos -= (ffm->file_size - FFM_PACKET_SIZE);

#ifdef DEBUG_SEEK

    av_log(s, AV_LOG_DEBUG, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos);

#endif

    url_fseek(pb, pos, SEEK_SET);

}


--- a/source.c
+++ b/source.c
@@ -15,7 +15,7 @@
         drive->fdctrl = fdctrl;

+
         if (drive->bs) {

             if (bdrv_get_on_error(drive->bs, 0) != BLOCK_ERR_STOP_ENOSPC) {

static int fdctrl_connect_drives(FDCtrl *fdctrl)

{

    unsigned int i;

    FDrive *drive;

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

        drive = &fdctrl->drives[i];

        drive->fdctrl = fdctrl;

        if (drive->bs) {

            if (bdrv_get_on_error(drive->bs, 0) != BLOCK_ERR_STOP_ENOSPC) {

                error_report("fdc doesn't support drive option werror");

                return -1;

            }

            if (bdrv_get_on_error(drive->bs, 1) != BLOCK_ERR_REPORT) {

                error_report("fdc doesn't support drive option rerror");

                return -1;

            }

        }

        fd_init(drive);

        fd_revalidate(drive);

        if (drive->bs) {

            bdrv_set_dev_ops(drive->bs, &fdctrl_block_ops, drive);

        }

    }

    return 0;

}


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

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

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

             fail();

static void check_threshold_8(void){

    LOCAL_ALIGNED_32(uint8_t, in       , [WIDTH_PADDED]);

    LOCAL_ALIGNED_32(uint8_t, threshold, [WIDTH_PADDED]);

    LOCAL_ALIGNED_32(uint8_t, min      , [WIDTH_PADDED]);

    LOCAL_ALIGNED_32(uint8_t, max      , [WIDTH_PADDED]);

    LOCAL_ALIGNED_32(uint8_t, out_ref  , [WIDTH_PADDED]);

    LOCAL_ALIGNED_32(uint8_t, out_new  , [WIDTH_PADDED]);

    ptrdiff_t line_size = WIDTH_PADDED;

    int w = WIDTH;

    ThresholdContext s;

    s.depth = 8;

    ff_threshold_init(&s);

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

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

                 ptrdiff_t ilinesize, ptrdiff_t tlinesize,

                 ptrdiff_t flinesize, ptrdiff_t slinesize,

                 ptrdiff_t olinesize, int w, int h);

    memset(in,     0, WIDTH_PADDED);

    memset(threshold, 0, WIDTH_PADDED);

    memset(min, 0, WIDTH_PADDED);

    memset(max, 0, WIDTH_PADDED);

    memset(out_ref, 0, WIDTH_PADDED);

    memset(out_new, 0, WIDTH_PADDED);

    randomize_buffers(in, WIDTH);

    randomize_buffers(threshold, WIDTH);

    randomize_buffers(min, WIDTH);

    randomize_buffers(max, WIDTH);

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

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

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

        if (memcmp(out_ref, out_new, w))

            fail();

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

    }

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     const int num = get_be32(pb);

     const int den = get_be32(pb);
+
+    AVStream * const st = c->fc->streams[c->fc->nb_streams-1];
+
+    if (den != 0) {
+
         if ((st->sample_aspect_ratio.den != 1 || st->sample_aspect_ratio.num) && // default

             (den != st->sample_aspect_ratio.den || num != st->sample_aspect_ratio.num))

static int mov_read_pasp(MOVContext *c, ByteIOContext *pb, MOVAtom atom)

{

    const int num = get_be32(pb);

    const int den = get_be32(pb);

    AVStream * const st = c->fc->streams[c->fc->nb_streams-1];

    if (den != 0) {

        if ((st->sample_aspect_ratio.den != 1 || st->sample_aspect_ratio.num) && // default

            (den != st->sample_aspect_ratio.den || num != st->sample_aspect_ratio.num))

            av_log(c->fc, AV_LOG_WARNING,

                   "sample aspect ratio already set to %d:%d, overriding by 'pasp' atom\n",

                   st->sample_aspect_ratio.num, st->sample_aspect_ratio.den);

        st->sample_aspect_ratio.num = num;

        st->sample_aspect_ratio.den = den;

    }

    return 0;

}


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

     /*

+     * We set up the default / latest behaviour here.  The class_init

      * functions for the specific versioned machine types can override

static void spapr_machine_class_init(ObjectClass *oc, void *data)

{

    MachineClass *mc = MACHINE_CLASS(oc);

    sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(oc);

    FWPathProviderClass *fwc = FW_PATH_PROVIDER_CLASS(oc);

    NMIClass *nc = NMI_CLASS(oc);

    HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);

    mc->desc = "pSeries Logical Partition (PAPR compliant)";

    /*

     * We set up the default / latest behaviour here.  The class_init

     * functions for the specific versioned machine types can override

     * these details for backwards compatibility

     */

    mc->init = ppc_spapr_init;

    mc->reset = ppc_spapr_reset;

    mc->block_default_type = IF_SCSI;

    mc->max_cpus = MAX_CPUMASK_BITS;

    mc->no_parallel = 1;

    mc->default_boot_order = "";

    mc->default_ram_size = 512 * M_BYTE;

    mc->kvm_type = spapr_kvm_type;

    mc->has_dynamic_sysbus = true;

    mc->pci_allow_0_address = true;

    mc->get_hotplug_handler = spapr_get_hotpug_handler;

    hc->pre_plug = spapr_machine_device_pre_plug;

    hc->plug = spapr_machine_device_plug;

    hc->unplug = spapr_machine_device_unplug;

    mc->cpu_index_to_socket_id = spapr_cpu_index_to_socket_id;

    mc->query_hotpluggable_cpus = spapr_query_hotpluggable_cpus;

    smc->dr_lmb_enabled = true;

    smc->dr_cpu_enabled = true;

    fwc->get_dev_path = spapr_get_fw_dev_path;

    nc->nmi_monitor_handler = spapr_nmi;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void write_dt(void *ptr, unsigned long addr, unsigned long limit,

+                     int flags)
+
+{
+
+    unsigned int e1, e2;

     uint32_t *p;

static void write_dt(void *ptr, unsigned long addr, unsigned long limit,

                     int flags)

{

    unsigned int e1, e2;

    uint32_t *p;

    e1 = (addr << 16) | (limit & 0xffff);

    e2 = ((addr >> 16) & 0xff) | (addr & 0xff000000) | (limit & 0x000f0000);

    e2 |= flags;

    p = ptr;

    p[0] = tswapl(e1);

    p[1] = tswapl(e2);

}


static int compare_floats(const float *a, const float *b, int len,

                          float max_diff)

{

    int i;

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

        if (fabsf(a[i] - b[i]) > max_diff) {

            av_log(NULL, AV_LOG_ERROR, "%d: %- .12f - %- .12f = % .12g\n",

                   i, a[i], b[i], a[i] - b[i]);

            return -1;

        }

    }

    return 0;

}


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

             goto end;
+
+    }
+
+    /*initialize program, kernel_name, kernel_count*/
+
     opt_build_entry = av_dict_get(options, "build_options", NULL, 0);

     if (opt_build_entry)

int av_opencl_init(AVDictionary *options, AVOpenCLExternalEnv *ext_opencl_env)

{

    int ret = 0;

    AVDictionaryEntry *opt_build_entry;

    AVDictionaryEntry *opt_platform_entry;

    AVDictionaryEntry *opt_device_entry;

    LOCK_OPENCL

    if (!gpu_env.init_count) {

        opt_platform_entry = av_dict_get(options, "platform_idx", NULL, 0);

        opt_device_entry   = av_dict_get(options, "device_idx", NULL, 0);

        /*initialize devices, context, command_queue*/

        gpu_env.usr_spec_dev_info.platform_idx = -1;

        gpu_env.usr_spec_dev_info.dev_idx = -1;

        if (opt_platform_entry) {

            gpu_env.usr_spec_dev_info.platform_idx = strtol(opt_platform_entry->value, NULL, 10);

        }

        if (opt_device_entry) {

            gpu_env.usr_spec_dev_info.dev_idx = strtol(opt_device_entry->value, NULL, 10);

        }

        ret = init_opencl_env(&gpu_env, ext_opencl_env);

        if (ret < 0)

            goto end;

    }

    /*initialize program, kernel_name, kernel_count*/

    opt_build_entry = av_dict_get(options, "build_options", NULL, 0);

    if (opt_build_entry)

        ret = compile_kernel_file(&gpu_env, opt_build_entry->value);

    else

        ret = compile_kernel_file(&gpu_env, NULL);

    if (ret < 0)

        goto end;

    av_assert1(gpu_env.kernel_code_count > 0);

    gpu_env.init_count++;

end:

    UNLOCK_OPENCL

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     int err = 0;

     if (!nptr) {
+
         if (endptr) {

             *endptr = nptr;

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

                 unsigned long *result)

{

    char *p;

    int err = 0;

    if (!nptr) {

        if (endptr) {

            *endptr = nptr;

        }

        err = -EINVAL;

    } else {

        errno = 0;

        *result = strtoul(nptr, &p, base);

        err = check_strtox_error(endptr, p, errno);

    }

    return err;

}


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

+
+    term_printf("%s (%s) is encrypted.\n", bdrv_get_device_name(bs),
+
+                bdrv_get_encrypted_filename(bs));
+
     for(i = 0; i < 3; i++) {

         monitor_readline("Password: ", 1, password, sizeof(password));

int monitor_read_bdrv_key(BlockDriverState *bs)

{

    char password[256];

    int i;

    if (!bdrv_is_encrypted(bs))

        return 0;

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

                bdrv_get_encrypted_filename(bs));

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

        monitor_readline("Password: ", 1, password, sizeof(password));

        if (bdrv_set_key(bs, password) == 0)

            return 0;

        term_printf("invalid password\n");

    }

    return -EPERM;

}


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

                        &testdata, test_validate_fail_union_flat);

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

                        &testdata, test_validate_fail_union_anon);

int main(int argc, char **argv)

{

    TestInputVisitorData testdata;

    g_test_init(&argc, &argv, NULL);

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

                       &testdata, test_validate_struct);

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

                       &testdata, test_validate_struct_nested);

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

                       &testdata, test_validate_list);

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

                       &testdata, test_validate_union);

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

                       &testdata, test_validate_union_flat);

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

                       &testdata, test_validate_union_anon);

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

                       &testdata, test_validate_fail_struct);

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

                       &testdata, test_validate_fail_struct_nested);

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

                       &testdata, test_validate_fail_list);

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

                       &testdata, test_validate_fail_union);

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

                       &testdata, test_validate_fail_union_flat);

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

                       &testdata, test_validate_fail_union_flat_no_discrim);

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

                       &testdata, test_validate_fail_union_anon);

    g_test_run();

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
 {
     GICv3State *s = opaque;
     GICv3CPUState *cs;
+    MemTxResult r;
+    int cpuidx;
+    /* This region covers all the redistributor pages; there are
+     * (for GICv3) two 64K pages per CPU. At the moment they are
+     * all contiguous (ie in this one region), though we might later
      * want to allow splitting of redistributor pages into several
      * blocks so we can support more CPUs.
      */

MemTxResult gicv3_redist_read(void *opaque, hwaddr offset, uint64_t *data,
                              unsigned size, MemTxAttrs attrs)
{
    GICv3State *s = opaque;
    GICv3CPUState *cs;
    MemTxResult r;
    int cpuidx;
    /* This region covers all the redistributor pages; there are
     * (for GICv3) two 64K pages per CPU. At the moment they are
     * all contiguous (ie in this one region), though we might later
     * want to allow splitting of redistributor pages into several
     * blocks so we can support more CPUs.
     */
    cpuidx = offset / 0x20000;
    offset %= 0x20000;
    assert(cpuidx < s->num_cpu);
    cs = &s->cpu[cpuidx];
    switch (size) {
    case 1:
        r = gicr_readb(cs, offset, data, attrs);
        break;
    case 4:
        r = gicr_readl(cs, offset, data, attrs);
        break;
    case 8:
        r = gicr_readll(cs, offset, data, attrs);
        break;
    default:
        r = MEMTX_ERROR;
        break;
    }
    if (r == MEMTX_ERROR) {
        qemu_log_mask(LOG_GUEST_ERROR,
                      "%s: invalid guest read at offset " TARGET_FMT_plx
                      "size %u\n", __func__, offset, size);
        trace_gicv3_redist_badread(gicv3_redist_affid(cs), offset,
                                   size, attrs.secure);
    } else {
        trace_gicv3_redist_read(gicv3_redist_affid(cs), offset, *data,
                                size, attrs.secure);
    }
    return r;
}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     ByteIOContext *pb = s->pb;

     uint8_t *streaminfo = s->streams[0]->codec->extradata;
+
+    int len = s->streams[0]->codec->extradata_size;
+
+    int64_t file_size;
+

     if (streaminfo && len > 0 && !url_is_streamed(s->pb)) {

static int flac_write_trailer(struct AVFormatContext *s)

{

    ByteIOContext *pb = s->pb;

    uint8_t *streaminfo = s->streams[0]->codec->extradata;

    int len = s->streams[0]->codec->extradata_size;

    int64_t file_size;

    if (streaminfo && len > 0 && !url_is_streamed(s->pb)) {

        file_size = url_ftell(pb);

        url_fseek(pb, 8, SEEK_SET);

        put_buffer(pb, streaminfo, len);

        url_fseek(pb, file_size, SEEK_SET);

        put_flush_packet(pb);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void pmac_ide_flush(DBDMA_io *io)

+{
+
+    MACIOIDEState *m = io->opaque;

static void pmac_ide_flush(DBDMA_io *io)

{

    MACIOIDEState *m = io->opaque;

    if (m->aiocb) {

        bdrv_drain_all();

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+int nbd_receive_reply(int csock, struct nbd_reply *reply)

 {
+
     uint8_t buf[NBD_REPLY_SIZE];

     uint32_t magic;

int nbd_receive_reply(int csock, struct nbd_reply *reply)

{

    uint8_t buf[NBD_REPLY_SIZE];

    uint32_t magic;

    memset(buf, 0xAA, sizeof(buf));

    if (read_sync(csock, buf, sizeof(buf)) != sizeof(buf)) {

        LOG("read failed");

        errno = EINVAL;

        return -1;

    }

    /* Reply

       [ 0 ..  3]    magic   (NBD_REPLY_MAGIC)

       [ 4 ..  7]    error   (0 == no error)

       [ 7 .. 15]    handle

     */

    magic = be32_to_cpup((uint32_t*)buf);

    reply->error  = be32_to_cpup((uint32_t*)(buf + 4));

    reply->handle = be64_to_cpup((uint64_t*)(buf + 8));

    TRACE("Got reply: "

          "{ magic = 0x%x, .error = %d, handle = %" PRIu64" }",

          magic, reply->error, reply->handle);

    if (magic != NBD_REPLY_MAGIC) {

        LOG("invalid magic (got 0x%x)", magic);

        errno = EINVAL;

        return -1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, int (*read_child)(), int ctx_size, enum MXFMetadataSetType type)
+
 {

     ByteIOContext *pb = mxf->fc->pb;

static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, int (*read_child)(), int ctx_size, enum MXFMetadataSetType type)

{

    ByteIOContext *pb = mxf->fc->pb;

    MXFMetadataSet *ctx = ctx_size ? av_mallocz(ctx_size) : mxf;

    uint64_t klv_end = url_ftell(pb) + klv->length;

    if (!ctx)

        return -1;

    while (url_ftell(pb) + 4 < klv_end) {

        int tag = get_be16(pb);

        int size = get_be16(pb); /* KLV specified by 0x53 */

        uint64_t next = url_ftell(pb) + size;

        UID uid = {0};

        dprintf(mxf->fc, "local tag %#04x size %d\n", tag, size);

        if (!size) { /* ignore empty tag, needed for some files with empty UMID tag */

            av_log(mxf->fc, AV_LOG_ERROR, "local tag %#04x with 0 size\n", tag);

            continue;

        }

        if (tag > 0x7FFF) { /* dynamic tag */

            int i;

            for (i = 0; i < mxf->local_tags_count; i++) {

                int local_tag = AV_RB16(mxf->local_tags+i*18);

                if (local_tag == tag) {

                    memcpy(uid, mxf->local_tags+i*18+2, 16);

                    dprintf(mxf->fc, "local tag %#04x\n", local_tag);

                    PRINT_KEY(mxf->fc, "uid", uid);

                }

            }

        }

        if (ctx_size && tag == 0x3C0A)

            get_buffer(pb, ctx->uid, 16);

        else if (read_child(ctx, pb, tag, size, uid) < 0)

            return -1;

        url_fseek(pb, next, SEEK_SET);

    }

    if (ctx_size) ctx->type = type;

    return ctx_size ? mxf_add_metadata_set(mxf, ctx) : 0;

}


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

     int mirror5 = mirror(y + 4, height - 1);

+    DWTELEM *b0= cs->b0;
+
+    DWTELEM *b1= cs->b1;
+
     DWTELEM *b2= cs->b2;

     DWTELEM *b3= cs->b3;

+    DWTELEM *b4= slice_buffer_get_line(sb, mirror4 * stride_line);
+
     DWTELEM *b5= slice_buffer_get_line(sb, mirror5 * stride_line);

static void spatial_compose97i_dy_buffered(dwt_compose_t *cs, slice_buffer * sb, int width, int height, int stride_line){

    int y = cs->y;

    int mirror0 = mirror(y - 1, height - 1);

    int mirror1 = mirror(y + 0, height - 1);

    int mirror2 = mirror(y + 1, height - 1);

    int mirror3 = mirror(y + 2, height - 1);

    int mirror4 = mirror(y + 3, height - 1);

    int mirror5 = mirror(y + 4, height - 1);

    DWTELEM *b0= cs->b0;

    DWTELEM *b1= cs->b1;

    DWTELEM *b2= cs->b2;

    DWTELEM *b3= cs->b3;

    DWTELEM *b4= slice_buffer_get_line(sb, mirror4 * stride_line);

    DWTELEM *b5= slice_buffer_get_line(sb, mirror5 * stride_line);

{START_TIMER

    if(y>0 && y+4<height){

        vertical_compose97i(b0, b1, b2, b3, b4, b5, width);

    }else{

        if(mirror3 <= mirror5) vertical_compose97iL1(b3, b4, b5, width);

        if(mirror2 <= mirror4) vertical_compose97iH1(b2, b3, b4, width);

        if(mirror1 <= mirror3) vertical_compose97iL0(b1, b2, b3, width);

        if(mirror0 <= mirror2) vertical_compose97iH0(b0, b1, b2, width);

    }

if(width>400){

STOP_TIMER("vertical_compose97i")}}

{START_TIMER

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

        if(mirror0 <= mirror2) horizontal_compose97i(b1, width);

if(width>400 && mirror0 <= mirror2){

STOP_TIMER("horizontal_compose97i")}}

    cs->b0=b2;

    cs->b1=b3;

    cs->b2=b4;

    cs->b3=b5;

    cs->y += 2;

}


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

     if (vs->tls_session) {

+	ret = gnutls_write(vs->tls_session, vs->output.buffer, vs->output.offset);
+
+	if (ret < 0) {
+
+	    if (ret == GNUTLS_E_AGAIN)

 		errno = EAGAIN;

static void vnc_client_write(void *opaque)

{

    long ret;

    VncState *vs = opaque;

#ifdef CONFIG_VNC_TLS

    if (vs->tls_session) {

	ret = gnutls_write(vs->tls_session, vs->output.buffer, vs->output.offset);

	if (ret < 0) {

	    if (ret == GNUTLS_E_AGAIN)

		errno = EAGAIN;

	    else

		errno = EIO;

	    ret = -1;

	}

    } else

#endif /* CONFIG_VNC_TLS */

	ret = send(vs->csock, vs->output.buffer, vs->output.offset, 0);

    ret = vnc_client_io_error(vs, ret, socket_error());

    if (!ret)

	return;

    memmove(vs->output.buffer, vs->output.buffer + ret, (vs->output.offset - ret));

    vs->output.offset -= ret;

    if (vs->output.offset == 0) {

	qemu_set_fd_handler2(vs->csock, NULL, vnc_client_read, NULL, vs);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static int32_t ahci_dma_prepare_buf(IDEDMA *dma, int is_write)

 {
+
     AHCIDevice *ad = DO_UPCAST(AHCIDevice, dma, dma);

     IDEState *s = &ad->port.ifs[0];

static int32_t ahci_dma_prepare_buf(IDEDMA *dma, int is_write)

{

    AHCIDevice *ad = DO_UPCAST(AHCIDevice, dma, dma);

    IDEState *s = &ad->port.ifs[0];

    if (ahci_populate_sglist(ad, &s->sg, s->io_buffer_offset) == -1) {

        DPRINTF(ad->port_no, "ahci_dma_prepare_buf failed.\n");

        return -1;

    }

    s->io_buffer_size = s->sg.size;

    DPRINTF(ad->port_no, "len=%#x\n", s->io_buffer_size);

    return s->io_buffer_size;

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
 void qemu_cond_destroy(QemuCond *cond)
+
+{
+
+    BOOL result;

+    result = CloseHandle(cond->continue_event);
+
     if (!result) {

         error_exit(GetLastError(), __func__);
+
     }

     cond->continue_event = 0;

void qemu_cond_destroy(QemuCond *cond)

{

    BOOL result;

    result = CloseHandle(cond->continue_event);

    if (!result) {

        error_exit(GetLastError(), __func__);

    }

    cond->continue_event = 0;

    result = CloseHandle(cond->sema);

    if (!result) {

        error_exit(GetLastError(), __func__);

    }

    cond->sema = 0;

}


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

     errno = EPERM;

+    return -1;
+
 }

static int v9fs_synth_chmod(FsContext *fs_ctx, V9fsPath *path, FsCred *credp)

{

    errno = EPERM;

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static inline void scale_mv(AVSContext *h, int *d_x, int *d_y,
+
                             cavs_vector *src, int distp)

 {

static inline void scale_mv(AVSContext *h, int *d_x, int *d_y,

                            cavs_vector *src, int distp)

{

    int den = h->scale_den[FFMAX(src->ref, 0)];

    *d_x = (src->x * distp * den + 256 + FF_SIGNBIT(src->x)) >> 9;

    *d_y = (src->y * distp * den + 256 + FF_SIGNBIT(src->y)) >> 9;

}


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

 {

+    int ret;

@@ -16,7 +16,7 @@

         .filename = g_strdup(filename),

+        .options = options,

         .ret = NOT_DONE,

int bdrv_create(BlockDriver *drv, const char* filename,

    QEMUOptionParameter *options)

{

    int ret;

    Coroutine *co;

    CreateCo cco = {

        .drv = drv,

        .filename = g_strdup(filename),

        .options = options,

        .ret = NOT_DONE,

    };

    if (!drv->bdrv_create) {

        return -ENOTSUP;

    }

    if (qemu_in_coroutine()) {

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

        bdrv_create_co_entry(&cco);

    } else {

        co = qemu_coroutine_create(bdrv_create_co_entry);

        qemu_coroutine_enter(co, &cco);

        while (cco.ret == NOT_DONE) {

            qemu_aio_wait();

        }

    }

    ret = cco.ret;

    g_free(cco.filename);

    return ret;

}


static int buf_get_buffer(void *opaque, uint8_t *buf, int64_t pos, int size)

{

    QEMUBuffer *s = opaque;

    ssize_t len = qsb_get_length(s->qsb) - pos;

    if (len <= 0) {

        return 0;

    }

    if (len > size) {

        len = size;

    }

    return qsb_get_buffer(s->qsb, pos, len, buf);

}


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

+    rdma->migration_started_on_destination = 1;
+
+    process_incoming_migration(f);
+
+}

static void rdma_accept_incoming_migration(void *opaque)

{

    RDMAContext *rdma = opaque;

    int ret;

    QEMUFile *f;

    Error *local_err = NULL, **errp = &local_err;

    DPRINTF("Accepting rdma connection...\n");

    ret = qemu_rdma_accept(rdma);

    if (ret) {

        ERROR(errp, "RDMA Migration initialization failed!");

        return;

    }

    DPRINTF("Accepted migration\n");

    f = qemu_fopen_rdma(rdma, "rb");

    if (f == NULL) {

        ERROR(errp, "could not qemu_fopen_rdma!");

        qemu_rdma_cleanup(rdma);

        return;

    }

    rdma->migration_started_on_destination = 1;

    process_incoming_migration(f);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void dump_syscall(CPUState *env)
+
 {

     fprintf(logfile, "syscall r0=0x%08x r3=0x%08x r4=0x%08x "

static void dump_syscall(CPUState *env)

{

    fprintf(logfile, "syscall r0=0x%08x r3=0x%08x r4=0x%08x "

            "r5=0x%08x r6=0x%08x nip=0x%08x\n",

            env->gpr[0], env->gpr[3], env->gpr[4],

            env->gpr[5], env->gpr[6], env->nip);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void pred4x4_horizontal_vp8_c(uint8_t *src, const uint8_t *topright, int stride){
+
     const int lt= src[-1-1*stride];

     LOAD_LEFT_EDGE


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

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

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

 out:

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

{

    VirtIODevice *vdev = VIRTIO_DEVICE(dev);

    V9fsVirtioState *v = VIRTIO_9P(dev);

    V9fsState *s = &v->state;

    if (v9fs_device_realize_common(s, errp)) {

        goto out;

    }

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

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

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

    v9fs_register_transport(s, &virtio_9p_transport);

out:

    return;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void ff_put_h264_qpel16_mc01_msa(uint8_t *dst, const uint8_t *src,

                                  ptrdiff_t stride)
+
+{

     avc_luma_vt_qrt_16w_msa(src - (stride * 2), stride, dst, stride, 16, 0);

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

                                 ptrdiff_t stride)

{

    avc_luma_vt_qrt_16w_msa(src - (stride * 2), stride, dst, stride, 16, 0);

}


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

     regs->lr = PARAM1;

PPC_OP(setlr)

{

    regs->lr = PARAM1;

    RETURN();

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static hwaddr ppc_hash64_pte_raddr(ppc_slb_t *slb, ppc_hash_pte64_t pte,
+
+                                   target_ulong eaddr)
+
+{
+
+    hwaddr mask;

     int target_page_bits;

static hwaddr ppc_hash64_pte_raddr(ppc_slb_t *slb, ppc_hash_pte64_t pte,

                                   target_ulong eaddr)

{

    hwaddr mask;

    int target_page_bits;

    hwaddr rpn = pte.pte1 & HPTE64_R_RPN;

    /*

     * We support 4K, 64K and 16M now

     */

    target_page_bits = ppc_hash64_page_shift(slb);

    mask = (1ULL << target_page_bits) - 1;

    return (rpn & ~mask) | (eaddr & mask);

}


static int tm2_read_deltas(TM2Context *ctx, int stream_id)

{

    int d, mb;

    int i, v;

    d  = get_bits(&ctx->gb, 9);

    mb = get_bits(&ctx->gb, 5);

    av_assert2(mb < 32);

    if ((d < 1) || (d > TM2_DELTAS) || (mb < 1)) {

        av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect delta table: %i deltas x %i bits\n", d, mb);

        return AVERROR_INVALIDDATA;

    }

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

        v = get_bits_long(&ctx->gb, mb);

        if (v & (1 << (mb - 1)))

            ctx->deltas[stream_id][i] = v - (1 << mb);

        else

            ctx->deltas[stream_id][i] = v;

    }

    for (; i < TM2_DELTAS; i++)

        ctx->deltas[stream_id][i] = 0;

    return 0;

}


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

     return (val << ((sizeof(tcg_target_long) * 8 - bits))

+            >> (sizeof(tcg_target_long) * 8 - bits)) == val;
+
 }

static inline int check_fit_tl(tcg_target_long val, unsigned int bits)

{

    return (val << ((sizeof(tcg_target_long) * 8 - bits))

            >> (sizeof(tcg_target_long) * 8 - bits)) == val;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static int virtio_rng_load(QEMUFile *f, void *opaque, int version_id)

 {
+
+    VirtIORNG *vrng = opaque;
+
+    VirtIODevice *vdev = VIRTIO_DEVICE(vrng);
+

     if (version_id != 1) {

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

{

    VirtIORNG *vrng = opaque;

    VirtIODevice *vdev = VIRTIO_DEVICE(vrng);

    if (version_id != 1) {

        return -EINVAL;

    }

    virtio_load(vdev, f, version_id);

    /* We may have an element ready but couldn't process it due to a quota

     * limit.  Make sure to try again after live migration when the quota may

     * have been reset.

     */

    virtio_rng_process(vrng);

    return 0;

}


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

     set_bit(DEVICE_CATEGORY_MISC, k->categories);

+    k->bus_type = TYPE_AUX_BUS;
+
+}

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

{

    DeviceClass *k = DEVICE_CLASS(klass);

    set_bit(DEVICE_CATEGORY_MISC, k->categories);

    k->bus_type = TYPE_AUX_BUS;

}


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

     dev = sysbus_create_simple("imx_timerp", addr, irq);
+
+    pp = container_of(dev, IMXTimerPState, busdev.qdev);
+
+    pp->ccm = ccm;
+
 }

void imx_timerp_create(const target_phys_addr_t addr,

                              qemu_irq irq,

                              DeviceState *ccm)

{

    IMXTimerPState *pp;

    DeviceState *dev;

    dev = sysbus_create_simple("imx_timerp", addr, irq);

    pp = container_of(dev, IMXTimerPState, busdev.qdev);

    pp->ccm = ccm;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int ac3_probe(AVProbeData *p)
+
 {

     int max_frames, first_frames, frames;

static int ac3_probe(AVProbeData *p)

{

    int max_frames, first_frames, frames;

    uint8_t *buf, *buf2, *end;

    AC3HeaderInfo hdr;

    if(p->buf_size < 7)

        return 0;

    max_frames = 0;

    buf = p->buf;

    end = buf + FFMIN(4096, p->buf_size - 7);

    for(; buf < end; buf++) {

        buf2 = buf;

        for(frames = 0; buf2 < end; frames++) {

            if(ff_ac3_parse_header(buf2, &hdr) < 0)

                break;

            buf2 += hdr.frame_size;

        }

        max_frames = FFMAX(max_frames, frames);

        if(buf == p->buf)

            first_frames = frames;

    }

    if   (first_frames>=3) return AVPROBE_SCORE_MAX * 3 / 4;

    else if(max_frames>=3) return AVPROBE_SCORE_MAX / 2;

    else if(max_frames>=1) return 1;

    else                   return 0;

}


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

 {
+
     uint8_t dir;

static void test_media_insert(void)

{

    uint8_t dir;

    /* Insert media in drive. DSKCHK should not be reset until a step pulse

     * is sent. */

    qmp_discard_response("{'execute':'change', 'arguments':{"

                         " 'device':'floppy0', 'target': '%s' }}",

                         test_image);

    qmp_discard_response(""); /* ignore event

                                 (FIXME open -> open transition?!) */

    qmp_discard_response(""); /* ignore event */

    dir = inb(FLOPPY_BASE + reg_dir);

    assert_bit_set(dir, DSKCHG);

    dir = inb(FLOPPY_BASE + reg_dir);

    assert_bit_set(dir, DSKCHG);

    send_seek(0);

    dir = inb(FLOPPY_BASE + reg_dir);

    assert_bit_set(dir, DSKCHG);

    dir = inb(FLOPPY_BASE + reg_dir);

    assert_bit_set(dir, DSKCHG);

    /* Step to next track should clear DSKCHG bit. */

    send_seek(1);

    dir = inb(FLOPPY_BASE + reg_dir);

    assert_bit_clear(dir, DSKCHG);

    dir = inb(FLOPPY_BASE + reg_dir);

    assert_bit_clear(dir, DSKCHG);

}


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

     AVABufferSinkParams *params;

+
+
+    if (!opaque) {
+
+        av_log(ctx, AV_LOG_ERROR,

                "No opaque field provided, an AVABufferSinkParams struct is required\n");

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

{

    BufferSinkContext *buf = ctx->priv;

    AVABufferSinkParams *params;

    if (!opaque) {

        av_log(ctx, AV_LOG_ERROR,

               "No opaque field provided, an AVABufferSinkParams struct is required\n");

        return AVERROR(EINVAL);

    } else

        params = (AVABufferSinkParams *)opaque;

    buf->sample_fmts     = params->sample_fmts;

    buf->channel_layouts = params->channel_layouts;

    buf->packing_fmts    = params->packing_fmts;

    return common_init(ctx);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int default_fdset_dup_fd_find(int dup_fd)

 {

static int default_fdset_dup_fd_find(int dup_fd)

{

    return -1;

}


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

     qemu_version = version;
+
 }

void qemu_set_version(const char *version)

{

    qemu_version = version;

}


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

 {

+    PVSCSICmdDescSetupRings *rc =

         (PVSCSICmdDescSetupRings *) s->curr_cmd_data;

pvscsi_on_cmd_setup_rings(PVSCSIState *s)

{

    PVSCSICmdDescSetupRings *rc =

        (PVSCSICmdDescSetupRings *) s->curr_cmd_data;

    trace_pvscsi_on_cmd_arrived("PVSCSI_CMD_SETUP_RINGS");

    pvscsi_dbg_dump_tx_rings_config(rc);

    pvscsi_ring_init_data(&s->rings, rc);

    s->rings_info_valid = TRUE;

    return PVSCSI_COMMAND_PROCESSING_SUCCEEDED;

}


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

     fs->fd = open(rpath(ctx, path, buffer), flags | O_NOFOLLOW);
+
+    return fs->fd;
+
+}

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

                      int flags, V9fsFidOpenState *fs)

{

    char buffer[PATH_MAX];

    char *path = fs_path->data;

    fs->fd = open(rpath(ctx, path, buffer), flags | O_NOFOLLOW);

    return fs->fd;

}


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

     omap_update_display(opaque);
+
+    if (omap_lcd && surface_data(surface))
+
+        omap_ppm_save(filename, surface_data(surface),
+
                     omap_lcd->width, omap_lcd->height,

                     surface_stride(surface), errp);

static void omap_screen_dump(void *opaque, const char *filename, bool cswitch,

                             Error **errp)

{

    struct omap_lcd_panel_s *omap_lcd = opaque;

    DisplaySurface *surface = qemu_console_surface(omap_lcd->con);

    omap_update_display(opaque);

    if (omap_lcd && surface_data(surface))

        omap_ppm_save(filename, surface_data(surface),

                    omap_lcd->width, omap_lcd->height,

                    surface_stride(surface), errp);

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
         if (value == 1 || value == 2) {

             qemu_system_reset_request();
+
+        } else if (value == 3) {
+
+            qemu_system_shutdown_request();
+
         }

     }

static void hb_regs_write(void *opaque, target_phys_addr_t offset,

                          uint64_t value, unsigned size)

{

    uint32_t *regs = opaque;

    if (offset == 0xf00) {

        if (value == 1 || value == 2) {

            qemu_system_reset_request();

        } else if (value == 3) {

            qemu_system_shutdown_request();

        }

    }

    regs[offset/4] = value;

}


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

+{
+
+    CoSleepCB *sleep_cb = opaque;

static void co_sleep_cb(void *opaque)

{

    CoSleepCB *sleep_cb = opaque;

    aio_co_wake(sleep_cb->co);

}


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

     BlockDriver *drv = bs->drv;
+
+
+
+    if (!drv)
+
         return -ENOMEDIUM;

     if (!drv->bdrv_pread)

int bdrv_pread(BlockDriverState *bs, int64_t offset,

               void *buf1, int count1)

{

    BlockDriver *drv = bs->drv;

    if (!drv)

        return -ENOMEDIUM;

    if (!drv->bdrv_pread)

        return bdrv_pread_em(bs, offset, buf1, count1);

    return drv->bdrv_pread(bs, offset, buf1, count1);

}