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

     static int initialized;
+
+    struct hostent *he;
+
+    char our_name[256];
+
 #ifdef _WIN32

     WSADATA Data;

static void slirp_init_once(void)

{

    static int initialized;

    struct hostent *he;

    char our_name[256];

#ifdef _WIN32

    WSADATA Data;

#endif

    if (initialized) {

        return;

    }

    initialized = 1;

#ifdef _WIN32

    WSAStartup(MAKEWORD(2,0), &Data);

    atexit(winsock_cleanup);

#endif

    loopback_addr.s_addr = htonl(INADDR_LOOPBACK);

    /* FIXME: This address may change during runtime */

    if (gethostname(our_name, sizeof(our_name)) == 0) {

        he = gethostbyname(our_name);

        if (he) {

            our_addr = *(struct in_addr *)he->h_addr;

        }

    }

    if (our_addr.s_addr == 0) {

        our_addr = loopback_addr;

    }

    /* FIXME: This address may change during runtime */

    if (get_dns_addr(&dns_addr) < 0) {

        dns_addr = loopback_addr;

    }

}


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

     } else {

+        node->attr = &node->actual_attr;
+
+        node->attr->inode = inode;
+
+        node->attr->nlink = 1;

         /* We don't allow write to directories */

static V9fsSynthNode *v9fs_add_dir_node(V9fsSynthNode *parent, int mode,

                                        const char *name,

                                        V9fsSynthNodeAttr *attr, int inode)

{

    V9fsSynthNode *node;

    /* Add directory type and remove write bits */

    mode = ((mode & 0777) | S_IFDIR) & ~(S_IWUSR | S_IWGRP | S_IWOTH);

    node = g_malloc0(sizeof(V9fsSynthNode));

    if (attr) {

        /* We are adding .. or . entries */

        node->attr = attr;

        node->attr->nlink++;

    } else {

        node->attr = &node->actual_attr;

        node->attr->inode = inode;

        node->attr->nlink = 1;

        /* We don't allow write to directories */

        node->attr->mode   = mode;

        node->attr->write = NULL;

        node->attr->read  = NULL;

    }

    node->private = node;

    pstrcpy(node->name, sizeof(node->name), name);

    QLIST_INSERT_HEAD_RCU(&parent->child, node, sibling);

    return node;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+int inet_nonblocking_connect(const char *str, bool *in_progress,

                              Error **errp)

 {
+
     QemuOpts *opts;

     int sock = -1;

int inet_nonblocking_connect(const char *str, bool *in_progress,

                             Error **errp)

{

    QemuOpts *opts;

    int sock = -1;

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

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

        sock = inet_connect_opts(opts, false, in_progress, errp);

    } else {

        error_set(errp, QERR_SOCKET_CREATE_FAILED);

    }

    qemu_opts_del(opts);

    return sock;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void xvid_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)

+{

     ff_xvid_idct(block);

static void xvid_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)

{

    ff_xvid_idct(block);

    ff_add_pixels_clamped(block, dest, line_size);

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     VAAPIEncodeH265Options  *opt = ctx->codec_options;

+
+    priv->fixed_qp_p = opt->qp;
+
+    if (avctx->i_quant_factor > 0.0)
+
         priv->fixed_qp_idr = (int)((priv->fixed_qp_p * avctx->i_quant_factor +

                                     avctx->i_quant_offset) + 0.5);

static av_cold int vaapi_encode_h265_init_fixed_qp(AVCodecContext *avctx)

{

    VAAPIEncodeContext      *ctx = avctx->priv_data;

    VAAPIEncodeH265Context *priv = ctx->priv_data;

    VAAPIEncodeH265Options  *opt = ctx->codec_options;

    priv->fixed_qp_p = opt->qp;

    if (avctx->i_quant_factor > 0.0)

        priv->fixed_qp_idr = (int)((priv->fixed_qp_p * avctx->i_quant_factor +

                                    avctx->i_quant_offset) + 0.5);

    else

        priv->fixed_qp_idr = priv->fixed_qp_p;

    if (avctx->b_quant_factor > 0.0)

        priv->fixed_qp_b = (int)((priv->fixed_qp_p * avctx->b_quant_factor +

                                  avctx->b_quant_offset) + 0.5);

    else

        priv->fixed_qp_b = priv->fixed_qp_p;

    av_log(avctx, AV_LOG_DEBUG, "Using fixed QP = "

           "%d / %d / %d for IDR- / P- / B-frames.\n",

           priv->fixed_qp_idr, priv->fixed_qp_p, priv->fixed_qp_b);

    return 0;

}


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

     uint32_t mask;

+    int rv, i;
+
+    struct model_features_t ft[] = {
+
+        {&guest_def->features, &host_def.features,

             ~0, feature_name, 0x00000000},

static int check_features_against_host(x86_def_t *guest_def)

{

    x86_def_t host_def;

    uint32_t mask;

    int rv, i;

    struct model_features_t ft[] = {

        {&guest_def->features, &host_def.features,

            ~0, feature_name, 0x00000000},

        {&guest_def->ext_features, &host_def.ext_features,

            ~CPUID_EXT_HYPERVISOR, ext_feature_name, 0x00000001},

        {&guest_def->ext2_features, &host_def.ext2_features,

            ~PPRO_FEATURES, ext2_feature_name, 0x80000000},

        {&guest_def->ext3_features, &host_def.ext3_features,

            ~CPUID_EXT3_SVM, ext3_feature_name, 0x80000001}};

    cpu_x86_fill_host(&host_def);

    for (rv = 0, i = 0; i < ARRAY_SIZE(ft); ++i)

        for (mask = 1; mask; mask <<= 1)

            if (ft[i].check_feat & mask && *ft[i].guest_feat & mask &&

                !(*ft[i].host_feat & mask)) {

                    unavailable_host_feature(&ft[i], mask);

                    rv = 1;

                }

    return rv;

}


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

     limit = (e1 & 0xffff) | (e2 & 0x000f0000);

+    if (e2 & DESC_G_MASK)
+
+        limit = (limit << 12) | 0xfff;

     return limit;

static inline unsigned int get_seg_limit(uint32_t e1, uint32_t e2)

{

    unsigned int limit;

    limit = (e1 & 0xffff) | (e2 & 0x000f0000);

    if (e2 & DESC_G_MASK)

        limit = (limit << 12) | 0xfff;

    return limit;

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
     uint64_t res = 999;

     int err;
+
+
+
+    err = qemu_strtoull(str, &endptr, 10, &res);
+

     g_assert_cmpint(err, ==, 0);

static void test_qemu_strtoull_decimal(void)

{

    const char *str = "0123";

    char f = 'X';

    const char *endptr = &f;

    uint64_t res = 999;

    int err;

    err = qemu_strtoull(str, &endptr, 10, &res);

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, 123);

    g_assert(endptr == str + strlen(str));

    str = "123";

    endptr = &f;

    res = 999;

    err = qemu_strtoull(str, &endptr, 0, &res);

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, 123);

    g_assert(endptr == str + strlen(str));

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int mov_write_gmhd_tag(AVIOContext *pb)
+
+{
+
+    avio_wb32(pb, 0x20);   /* size */

     ffio_wfourcc(pb, "gmhd");

static int mov_write_gmhd_tag(AVIOContext *pb)

{

    avio_wb32(pb, 0x20);   /* size */

    ffio_wfourcc(pb, "gmhd");

    avio_wb32(pb, 0x18);   /* gmin size */

    ffio_wfourcc(pb, "gmin");/* generic media info */

    avio_wb32(pb, 0);      /* version & flags */

    avio_wb16(pb, 0x40);   /* graphics mode = */

    avio_wb16(pb, 0x8000); /* opColor (r?) */

    avio_wb16(pb, 0x8000); /* opColor (g?) */

    avio_wb16(pb, 0x8000); /* opColor (b?) */

    avio_wb16(pb, 0);      /* balance */

    avio_wb16(pb, 0);      /* reserved */

    return 0x20;

}


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

                                  AioFlushEventNotifierHandler *io_flush)

+{
+
+    qemu_aio_set_fd_handler(event_notifier_get_fd(notifier),

                             (IOHandler *)io_read, NULL,

void qemu_aio_set_event_notifier(EventNotifier *notifier,

                                 EventNotifierHandler *io_read,

                                 AioFlushEventNotifierHandler *io_flush)

{

    qemu_aio_set_fd_handler(event_notifier_get_fd(notifier),

                            (IOHandler *)io_read, NULL,

                            (AioFlushHandler *)io_flush, notifier);

}


static uint16_t nvme_set_feature(NvmeCtrl *n, NvmeCmd *cmd, NvmeRequest *req)

{

    uint32_t dw10 = le32_to_cpu(cmd->cdw10);

    uint32_t dw11 = le32_to_cpu(cmd->cdw11);

    switch (dw10) {

    case NVME_VOLATILE_WRITE_CACHE:

        blk_set_enable_write_cache(n->conf.blk, dw11 & 1);

        break;

    case NVME_NUMBER_OF_QUEUES:

        req->cqe.result =

            cpu_to_le32((n->num_queues - 1) | ((n->num_queues - 1) << 16));

        break;

    default:

        return NVME_INVALID_FIELD | NVME_DNR;

    }

    return NVME_SUCCESS;

}


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

+    /* caller have hold iothread lock or is in a bh, so there is
+
+     * no writing race against this migration_bitmap
+
+     */
+
+    memory_global_dirty_log_stop();
+
+
+
     QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
+
         g_free(block->bmap);

         block->bmap = NULL;

static void ram_save_cleanup(void *opaque)

{

    RAMState **rsp = opaque;

    RAMBlock *block;

    /* caller have hold iothread lock or is in a bh, so there is

     * no writing race against this migration_bitmap

     */

    memory_global_dirty_log_stop();

    QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {

        g_free(block->bmap);

        block->bmap = NULL;

        g_free(block->unsentmap);

        block->unsentmap = NULL;

    }

    XBZRLE_cache_lock();

    if (XBZRLE.cache) {

        cache_fini(XBZRLE.cache);

        g_free(XBZRLE.encoded_buf);

        g_free(XBZRLE.current_buf);

        g_free(XBZRLE.zero_target_page);

        XBZRLE.cache = NULL;

        XBZRLE.encoded_buf = NULL;

        XBZRLE.current_buf = NULL;

        XBZRLE.zero_target_page = NULL;

    }

    XBZRLE_cache_unlock();

    compress_threads_save_cleanup();

    ram_state_cleanup(rsp);

}


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

         struct kvm_mp_state mp_state;

+        int ret = kvm_vcpu_ioctl(CPU(cpu), KVM_GET_MP_STATE, &mp_state);

         if (ret) {

int kvm_arm_sync_mpstate_to_qemu(ARMCPU *cpu)

{

    if (cap_has_mp_state) {

        struct kvm_mp_state mp_state;

        int ret = kvm_vcpu_ioctl(CPU(cpu), KVM_GET_MP_STATE, &mp_state);

        if (ret) {

            fprintf(stderr, "%s: failed to get MP_STATE %d/%s\n",

                    __func__, ret, strerror(-ret));

            abort();

        }

        cpu->powered_off = (mp_state.mp_state == KVM_MP_STATE_STOPPED);

    }

    return 0;

}


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

 {

+    if (kvm_enabled()) {
+
+        kvm_s390_service_interrupt(parm);
+
     } else {

         S390CPU *dummy_cpu = s390_cpu_addr2state(0);

void s390_sclp_extint(uint32_t parm)

{

    if (kvm_enabled()) {

        kvm_s390_service_interrupt(parm);

    } else {

        S390CPU *dummy_cpu = s390_cpu_addr2state(0);

        cpu_inject_ext(dummy_cpu, EXT_SERVICE, parm, 0);

    }

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     s->framep[VP56_FRAME_CURRENT]->key_frame = !vp56_rac_get(c);

     vp56_rac_get(c);
+
+    ff_vp56_init_dequant(s, vp56_rac_gets(c, 6));
+
+    if (s->framep[VP56_FRAME_CURRENT]->key_frame)
+
     {

         vp56_rac_gets(c, 8);

static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,

                            int *golden_frame)

{

    VP56RangeCoder *c = &s->c;

    int rows, cols;

    ff_vp56_init_range_decoder(&s->c, buf, buf_size);

    s->framep[VP56_FRAME_CURRENT]->key_frame = !vp56_rac_get(c);

    vp56_rac_get(c);

    ff_vp56_init_dequant(s, vp56_rac_gets(c, 6));

    if (s->framep[VP56_FRAME_CURRENT]->key_frame)

    {

        vp56_rac_gets(c, 8);

        if(vp56_rac_gets(c, 5) > 5)

        vp56_rac_gets(c, 2);

        if (vp56_rac_get(c)) {

            av_log(s->avctx, AV_LOG_ERROR, "interlacing not supported\n");

        rows = vp56_rac_gets(c, 8);  /* number of stored macroblock rows */

        cols = vp56_rac_gets(c, 8);  /* number of stored macroblock cols */

        vp56_rac_gets(c, 8);  /* number of displayed macroblock rows */

        vp56_rac_gets(c, 8);  /* number of displayed macroblock cols */

        vp56_rac_gets(c, 2);

        if (!s->macroblocks || /* first frame */

            16*cols != s->avctx->coded_width ||

            16*rows != s->avctx->coded_height) {

            avcodec_set_dimensions(s->avctx, 16*cols, 16*rows);

            return 2;

    } else if (!s->macroblocks)

    return 1;


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

     AppleHTTPContext *c = s->priv_data;

+    int i, j, ret;
+

     if ((flags & AVSEEK_FLAG_BYTE) || !c->variants[0]->finished)

static int applehttp_read_seek(AVFormatContext *s, int stream_index,

                               int64_t timestamp, int flags)

{

    AppleHTTPContext *c = s->priv_data;

    int i, j, ret;

    if ((flags & AVSEEK_FLAG_BYTE) || !c->variants[0]->finished)

        return AVERROR(ENOSYS);

    timestamp = av_rescale_rnd(timestamp, 1, stream_index >= 0 ?

                               s->streams[stream_index]->time_base.den :

                               AV_TIME_BASE, flags & AVSEEK_FLAG_BACKWARD ?

                               AV_ROUND_DOWN : AV_ROUND_UP);

    ret = AVERROR(EIO);

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

        /* Reset reading */

        struct variant *var = c->variants[i];

        int64_t pos = 0;

        if (var->input) {

            ffurl_close(var->input);

            var->input = NULL;

        }

        av_free_packet(&var->pkt);

        reset_packet(&var->pkt);

        var->pb.eof_reached = 0;

        /* Locate the segment that contains the target timestamp */

        for (j = 0; j < var->n_segments; j++) {

            if (timestamp >= pos &&

                timestamp < pos + var->segments[j]->duration) {

                var->cur_seq_no = var->start_seq_no + j;

                ret = 0;

                break;

            }

            pos += var->segments[j]->duration;

        }

    }

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static uint64_t empty_slot_read(void *opaque, target_phys_addr_t addr,
+
+                                unsigned size)

 {

static uint64_t empty_slot_read(void *opaque, target_phys_addr_t addr,

                                unsigned size)

{

    DPRINTF("read from " TARGET_FMT_plx "\n", addr);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static inline void gen_op_fpexception_im(int fsr_flags)

+{

     TCGv r_const;

static inline void gen_op_fpexception_im(int fsr_flags)

{

    TCGv r_const;

    tcg_gen_andi_tl(cpu_fsr, cpu_fsr, ~FSR_FTT_MASK);

    tcg_gen_ori_tl(cpu_fsr, cpu_fsr, fsr_flags);

    r_const = tcg_const_i32(TT_FP_EXCP);

    tcg_gen_helper_0_1(raise_exception, r_const);

    tcg_temp_free(r_const);

}


void pci_device_save(PCIDevice *s, QEMUFile *f)

{

    int i;

    qemu_put_be32(f, s->version_id); /* PCI device version */

    qemu_put_buffer(f, s->config, 256);

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

        qemu_put_be32(f, s->irq_state[i]);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+uint64_t HELPER(neon_add_saturate_u64)(uint64_t src1, uint64_t src2)
+
+{
+
+    uint64_t res;
+

+
     res = src1 + src2;

     if (res < src1) {

uint64_t HELPER(neon_add_saturate_u64)(uint64_t src1, uint64_t src2)

{

    uint64_t res;

    res = src1 + src2;

    if (res < src1) {

        env->QF = 1;

        res = ~(uint64_t)0;

    }

    return res;

}


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

 {

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

 }

START_TEST(qstring_destroy_test)

{

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

    QDECREF(qstring);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void gen_neon_dup_low16(TCGv var)
+
 {

     TCGv tmp = new_tmp();
+
     tcg_gen_ext16u_i32(var, var);

     tcg_gen_shli_i32(tmp, var, 16);

static void gen_neon_dup_low16(TCGv var)

{

    TCGv tmp = new_tmp();

    tcg_gen_ext16u_i32(var, var);

    tcg_gen_shli_i32(tmp, var, 16);

    tcg_gen_or_i32(var, var, tmp);

    dead_tmp(tmp);

}


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

 {

+    if (msr_pr) {

         hcall_dprintf("Hypercall made with MSR[PR]=1\n");

target_ulong spapr_hypercall(CPUState *env, target_ulong opcode,

                             target_ulong *args)

{

    if (msr_pr) {

        hcall_dprintf("Hypercall made with MSR[PR]=1\n");

        return H_PRIVILEGE;

    }

    if ((opcode <= MAX_HCALL_OPCODE)

        && ((opcode & 0x3) == 0)) {

        spapr_hcall_fn fn = hypercall_table[opcode / 4];

        if (fn) {

            return fn(env, spapr, opcode, args);

        }

    }

    hcall_dprintf("Unimplemented hcall 0x" TARGET_FMT_lx "\n", opcode);

    return H_FUNCTION;

}


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

     sc->chunk_offsets = av_malloc(entries * sizeof(int64_t));
+
+    if (!sc->chunk_offsets)
+
+        return AVERROR(ENOMEM);
+
     sc->chunk_count = entries;

static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom)

{

    AVStream *st;

    MOVStreamContext *sc;

    unsigned int i, entries;

    if (c->fc->nb_streams < 1)

        return 0;

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

    sc = st->priv_data;

    avio_r8(pb); /* version */

    avio_rb24(pb); /* flags */

    entries = avio_rb32(pb);

    if (!entries)

        return 0;

    if (entries >= UINT_MAX/sizeof(int64_t))

        return AVERROR_INVALIDDATA;

    sc->chunk_offsets = av_malloc(entries * sizeof(int64_t));

    if (!sc->chunk_offsets)

        return AVERROR(ENOMEM);

    sc->chunk_count = entries;

    if      (atom.type == MKTAG('s','t','c','o'))

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

            sc->chunk_offsets[i] = avio_rb32(pb);

    else if (atom.type == MKTAG('c','o','6','4'))

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

            sc->chunk_offsets[i] = avio_rb64(pb);

    else

        return AVERROR_INVALIDDATA;

    return 0;

}


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

+    set_cc_op(s, CC_OP_FLAGS);
+

+
     reg = DREG(insn, 0);

     tmp = (insn >> 9) & 7;

DISAS_INSN(shift_im)

{

    TCGv reg;

    int tmp;

    TCGv shift;

    set_cc_op(s, CC_OP_FLAGS);

    reg = DREG(insn, 0);

    tmp = (insn >> 9) & 7;

    if (tmp == 0)

        tmp = 8;

    shift = tcg_const_i32(tmp);

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

    if (insn & 0x100) {

        gen_helper_shl_cc(reg, cpu_env, reg, shift);

    } else {

        if (insn & 8) {

            gen_helper_shr_cc(reg, cpu_env, reg, shift);

        } else {

            gen_helper_sar_cc(reg, cpu_env, reg, shift);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
     qdict_put(tests_dict, key, qint_from_int(1));

     qdict_put(tests_dict, key, qint_from_int(2));
+
+
+
+    value = qdict_get_int(tests_dict, key);
+
     fail_unless(value == 2);

START_TEST(qdict_put_exists_test)

{

    int value;

    const char *key = "exists";

    qdict_put(tests_dict, key, qint_from_int(1));

    qdict_put(tests_dict, key, qint_from_int(2));

    value = qdict_get_int(tests_dict, key);

    fail_unless(value == 2);

    fail_unless(qdict_size(tests_dict) == 1);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void spapr_machine_2_6_class_options(MachineClass *mc)
+
 {
+
     sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);

static void spapr_machine_2_6_class_options(MachineClass *mc)

{

    sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);

    spapr_machine_2_7_class_options(mc);

    smc->dr_cpu_enabled = false;

    SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_6);

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
         [GDB_BREAKPOINT_HW] = 0x0,

         [GDB_WATCHPOINT_WRITE] = 0x1,
+
+        [GDB_WATCHPOINT_ACCESS] = 0x3
+
+    };
+
     const uint8_t len_code[] = {

         [1] = 0x0, [2] = 0x1, [4] = 0x3, [8] = 0x2

void kvm_arch_update_guest_debug(CPUState *env, struct kvm_guest_debug *dbg)

{

    const uint8_t type_code[] = {

        [GDB_BREAKPOINT_HW] = 0x0,

        [GDB_WATCHPOINT_WRITE] = 0x1,

        [GDB_WATCHPOINT_ACCESS] = 0x3

    };

    const uint8_t len_code[] = {

        [1] = 0x0, [2] = 0x1, [4] = 0x3, [8] = 0x2

    };

    int n;

    if (kvm_sw_breakpoints_active(env))

        dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP;

    if (nb_hw_breakpoint > 0) {

        dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_HW_BP;

        dbg->arch.debugreg[7] = 0x0600;

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

            dbg->arch.debugreg[n] = hw_breakpoint[n].addr;

            dbg->arch.debugreg[7] |= (2 << (n * 2)) |

                (type_code[hw_breakpoint[n].type] << (16 + n*4)) |

                ((uint32_t)len_code[hw_breakpoint[n].len] << (18 + n*4));

        }

    }

    /* Legal xcr0 for loading */

    env->xcr0 = 1;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+void hbitmap_iter_init(HBitmapIter *hbi, const HBitmap *hb, uint64_t first)
+
+{
+
+    unsigned i, bit;

     uint64_t pos;

void hbitmap_iter_init(HBitmapIter *hbi, const HBitmap *hb, uint64_t first)

{

    unsigned i, bit;

    uint64_t pos;

    hbi->hb = hb;

    pos = first >> hb->granularity;

    hbi->pos = pos >> BITS_PER_LEVEL;

    hbi->granularity = hb->granularity;

    for (i = HBITMAP_LEVELS; i-- > 0; ) {

        bit = pos & (BITS_PER_LONG - 1);

        pos >>= BITS_PER_LEVEL;

        /* Drop bits representing items before first.  */

        hbi->cur[i] = hb->levels[i][pos] & ~((1UL << bit) - 1);

        /* We have already added level i+1, so the lowest set bit has

         * been processed.  Clear it.

         */

        if (i != HBITMAP_LEVELS - 1) {

            hbi->cur[i] &= ~(1UL << bit);

        }

    }

}


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

     check_hwrena(env, 5);

target_ulong helper_rdhwr_xnp(CPUMIPSState *env)

{

    check_hwrena(env, 5);

    return (env->CP0_Config5 >> CP0C5_XNP) & 1;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int mp_pacl_setxattr(FsContext *ctx, const char *path, const char *name,
+
+                            void *value, size_t size, int flags)
+
+{
+
+    char *buffer;

     int ret;

static int mp_pacl_setxattr(FsContext *ctx, const char *path, const char *name,

                            void *value, size_t size, int flags)

{

    char *buffer;

    int ret;

    buffer = rpath(ctx, path);

    ret = lsetxattr(buffer, MAP_ACL_ACCESS, value, size, flags);

    g_free(buffer);

    return ret;

}


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

     av_frame_free(&avctx->coded_frame);

+    return 0;
+
 }

static av_cold int raw_encode_close(AVCodecContext *avctx)

{

    av_frame_free(&avctx->coded_frame);

    return 0;

}


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

     V9fsSynthOpenState *synth_open = fs->private;

+    V9fsSynthNode *node = synth_open->node;
+
+
+
     node->open_count--;

     g_free(synth_open);

static int v9fs_synth_close(FsContext *ctx, V9fsFidOpenState *fs)

{

    V9fsSynthOpenState *synth_open = fs->private;

    V9fsSynthNode *node = synth_open->node;

    node->open_count--;

    g_free(synth_open);

    fs->private = NULL;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,5 +5,5 @@
     PITChannelState *s = &pit->channels[channel];

     return pit_get_out1(s, current_time);
+
+}

int pit_get_out(PITState *pit, int channel, int64_t current_time)

{

    PITChannelState *s = &pit->channels[channel];

    return pit_get_out1(s, current_time);

}


--- a/source.c
+++ b/source.c
@@ -5,24 +5,24 @@
     int i;

     pixel *dst = (pixel*)_dst;
+
+    dctcoef *block = (dctcoef*)_block;
+
+    stride >>= sizeof(pixel)-1;

     block[0] += 1 << 5;

+
+    for(i=0; i<4; i++){
+
+        const int z0=  block[i + 4*0]     +  block[i + 4*2];
+
+        const int z1=  block[i + 4*0]     -  block[i + 4*2];
+
+        const int z2= (block[i + 4*1]>>1) -  block[i + 4*3];

         const int z3=  block[i + 4*1]     + (block[i + 4*3]>>1);

void FUNCC(ff_h264_idct_add)(uint8_t *_dst, int16_t *_block, int stride)

{

    int i;

    pixel *dst = (pixel*)_dst;

    dctcoef *block = (dctcoef*)_block;

    stride >>= sizeof(pixel)-1;

    block[0] += 1 << 5;

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

        const int z0=  block[i + 4*0]     +  block[i + 4*2];

        const int z1=  block[i + 4*0]     -  block[i + 4*2];

        const int z2= (block[i + 4*1]>>1) -  block[i + 4*3];

        const int z3=  block[i + 4*1]     + (block[i + 4*3]>>1);

        block[i + 4*0]= z0 + z3;

        block[i + 4*1]= z1 + z2;

        block[i + 4*2]= z1 - z2;

        block[i + 4*3]= z0 - z3;

    }

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

        const int z0=  block[0 + 4*i]     +  block[2 + 4*i];

        const int z1=  block[0 + 4*i]     -  block[2 + 4*i];

        const int z2= (block[1 + 4*i]>>1) -  block[3 + 4*i];

        const int z3=  block[1 + 4*i]     + (block[3 + 4*i]>>1);

        dst[i + 0*stride]= av_clip_pixel(dst[i + 0*stride] + ((z0 + z3) >> 6));

        dst[i + 1*stride]= av_clip_pixel(dst[i + 1*stride] + ((z1 + z2) >> 6));

        dst[i + 2*stride]= av_clip_pixel(dst[i + 2*stride] + ((z1 - z2) >> 6));

        dst[i + 3*stride]= av_clip_pixel(dst[i + 3*stride] + ((z0 - z3) >> 6));

    }

    memset(block, 0, 16 * sizeof(dctcoef));

}


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

 {
+
+    if (term_cmd_buf_index < term_cmd_buf_size) {

         term_cmd_buf_index++;

static void term_forward_char(void)

{

    if (term_cmd_buf_index < term_cmd_buf_size) {

        term_cmd_buf_index++;

    }

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     char val_str[128];

     int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1;
+

     print_section_header("format");

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

{

    char val_str[128];

    int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1;

    print_section_header("format");

    print_str("filename",         fmt_ctx->filename);

    print_int("nb_streams",       fmt_ctx->nb_streams);

    print_str("format_name",      fmt_ctx->iformat->name);

    print_str("format_long_name", fmt_ctx->iformat->long_name);

    print_time("start_time",      fmt_ctx->start_time, &AV_TIME_BASE_Q);

    print_time("duration",        fmt_ctx->duration,   &AV_TIME_BASE_Q);

    if (size >= 0) print_val    ("size", size, unit_byte_str);

    else           print_str_opt("size", "N/A");

    if (fmt_ctx->bit_rate > 0) print_val    ("bit_rate", fmt_ctx->bit_rate, unit_bit_per_second_str);

    else                       print_str_opt("bit_rate", "N/A");

    show_tags(fmt_ctx->metadata);

    print_section_footer("format");

    fflush(stdout);

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     ppc_slb_t *slb;

+
+    slb = slb_lookup(cpu, addr);
+
+    if (!slb) {
+
         return;

     }

void helper_slbie(CPUPPCState *env, target_ulong addr)

{

    PowerPCCPU *cpu = ppc_env_get_cpu(env);

    ppc_slb_t *slb;

    slb = slb_lookup(cpu, addr);

    if (!slb) {

        return;

    }

    if (slb->esid & SLB_ESID_V) {

        slb->esid &= ~SLB_ESID_V;

        /* XXX: given the fact that segment size is 256 MB or 1TB,

         *      and we still don't have a tlb_flush_mask(env, n, mask)

         *      in QEMU, we just invalidate all TLBs

         */

        env->tlb_need_flush |= TLB_NEED_LOCAL_FLUSH;

    }

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
     k->query_guest_notifiers = virtio_ccw_query_guest_notifiers;

     k->set_guest_notifiers = virtio_ccw_set_guest_notifiers;
+
+    k->save_queue = virtio_ccw_save_queue;
+
+    k->load_queue = virtio_ccw_load_queue;
+
     k->save_config = virtio_ccw_save_config;

     k->load_config = virtio_ccw_load_config;

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

{

    VirtioBusClass *k = VIRTIO_BUS_CLASS(klass);

    BusClass *bus_class = BUS_CLASS(klass);

    bus_class->max_dev = 1;

    k->notify = virtio_ccw_notify;

    k->vmstate_change = virtio_ccw_vmstate_change;

    k->query_guest_notifiers = virtio_ccw_query_guest_notifiers;

    k->set_guest_notifiers = virtio_ccw_set_guest_notifiers;

    k->save_queue = virtio_ccw_save_queue;

    k->load_queue = virtio_ccw_load_queue;

    k->save_config = virtio_ccw_save_config;

    k->load_config = virtio_ccw_load_config;

    k->device_plugged = virtio_ccw_device_plugged;

    k->post_plugged = virtio_ccw_post_plugged;

    k->device_unplugged = virtio_ccw_device_unplugged;

    k->ioeventfd_started = virtio_ccw_ioeventfd_started;

    k->ioeventfd_set_started = virtio_ccw_ioeventfd_set_started;

    k->ioeventfd_disabled = virtio_ccw_ioeventfd_disabled;

    k->ioeventfd_set_disabled = virtio_ccw_ioeventfd_set_disabled;

    k->ioeventfd_assign = virtio_ccw_ioeventfd_assign;

}


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

     QObject *obj = qobject_from_json("[32,");

+    fail_unless(obj == NULL);
+
 }

START_TEST(unterminated_array_comma)

{

    QObject *obj = qobject_from_json("[32,");

    fail_unless(obj == NULL);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int can_safely_read(GetBitContext* gb, uint64_t bits) {

     return get_bits_left(gb) >= bits;
+
 }

static int can_safely_read(GetBitContext* gb, uint64_t bits) {

    return get_bits_left(gb) >= bits;

}


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

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

+            if ((y ^ parity) & 1) {
+
+                uint8_t *prev = &yadif->prev->data[i][y*refs];
+
+                uint8_t *cur  = &yadif->cur ->data[i][y*refs];

                 uint8_t *next = &yadif->next->data[i][y*refs];

static void filter(AVFilterContext *ctx, AVFilterBufferRef *dstpic,

                   int parity, int tff)

{

    YADIFContext *yadif = ctx->priv;

    int y, i;

    for (i = 0; i < yadif->csp->nb_components; i++) {

        int w = dstpic->video->w;

        int h = dstpic->video->h;

        int refs = yadif->cur->linesize[i];

        int df = (yadif->csp->comp[i].depth_minus1 + 8) / 8;

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

        /* Why is this not part of the per-plane description thing? */

            w >>= yadif->csp->log2_chroma_w;

            h >>= yadif->csp->log2_chroma_h;

        }

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

            if ((y ^ parity) & 1) {

                uint8_t *prev = &yadif->prev->data[i][y*refs];

                uint8_t *cur  = &yadif->cur ->data[i][y*refs];

                uint8_t *next = &yadif->next->data[i][y*refs];

                uint8_t *dst  = &dstpic->data[i][y*dstpic->linesize[i]];

                int     mode  = y==1 || y+2==h ? 2 : yadif->mode;

                yadif->filter_line(dst, prev, cur, next, w, y+1<h ? refs : -refs, y ? -refs : refs, parity ^ tff, mode);

            } else {

                memcpy(&dstpic->data[i][y*dstpic->linesize[i]],

                       &yadif->cur->data[i][y*refs], w*df);

            }

        }

    }

    emms_c();

}


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

                             "o=- %d %d IN IPV4 %s\r\n"

+                            "t=%d %d\r\n"
+
+                            "s=%s\r\n"
+
+                            "a=tool:libavformat " AV_STRINGIFY(LIBAVFORMAT_VERSION) "\r\n",

                             s->sdp_version,

static void sdp_write_header(char *buff, int size, struct sdp_session_level *s)

{

    av_strlcatf(buff, size, "v=%d\r\n"

                            "o=- %d %d IN IPV4 %s\r\n"

                            "t=%d %d\r\n"

                            "s=%s\r\n"

                            "a=tool:libavformat " AV_STRINGIFY(LIBAVFORMAT_VERSION) "\r\n",

                            s->sdp_version,

                            s->id, s->version, s->src_addr,

                            s->start_time, s->end_time,

                            s->name[0] ? s->name : "No Name");

    dest_write(buff, size, s->dst_addr, s->ttl);

}


--- a/source.c
+++ b/source.c
@@ -20,11 +20,11 @@
     sub_hdr_size = DIV_ROUND_UP(sub_hdr_size, block_size);
     dh->sub_hdr_size = cpu_to_dump32(s, sub_hdr_size);
     /* dh->max_mapnr may be truncated, full 64bit is in kh.max_mapnr_64 */
+    dh->max_mapnr = cpu_to_dump32(s, MIN(s->max_mapnr, UINT_MAX));
+    dh->nr_cpus = cpu_to_dump32(s, s->nr_cpus);
+    bitmap_blocks = DIV_ROUND_UP(s->len_dump_bitmap, block_size) * 2;
+    dh->bitmap_blocks = cpu_to_dump32(s, bitmap_blocks);
+    strncpy(dh->utsname.machine, ELF_MACHINE_UNAME, sizeof(dh->utsname.machine));
     if (s->flag_compress & DUMP_DH_COMPRESSED_ZLIB) {
         status |= DUMP_DH_COMPRESSED_ZLIB;
 #ifdef CONFIG_LZO

static void create_header32(DumpState *s, Error **errp)
{
    DiskDumpHeader32 *dh = NULL;
    KdumpSubHeader32 *kh = NULL;
    size_t size;
    uint32_t block_size;
    uint32_t sub_hdr_size;
    uint32_t bitmap_blocks;
    uint32_t status = 0;
    uint64_t offset_note;
    Error *local_err = NULL;
    /* write common header, the version of kdump-compressed format is 6th */
    size = sizeof(DiskDumpHeader32);
    dh = g_malloc0(size);
    strncpy(dh->signature, KDUMP_SIGNATURE, strlen(KDUMP_SIGNATURE));
    dh->header_version = cpu_to_dump32(s, 6);
    block_size = s->dump_info.page_size;
    dh->block_size = cpu_to_dump32(s, block_size);
    sub_hdr_size = sizeof(struct KdumpSubHeader32) + s->note_size;
    sub_hdr_size = DIV_ROUND_UP(sub_hdr_size, block_size);
    dh->sub_hdr_size = cpu_to_dump32(s, sub_hdr_size);
    /* dh->max_mapnr may be truncated, full 64bit is in kh.max_mapnr_64 */
    dh->max_mapnr = cpu_to_dump32(s, MIN(s->max_mapnr, UINT_MAX));
    dh->nr_cpus = cpu_to_dump32(s, s->nr_cpus);
    bitmap_blocks = DIV_ROUND_UP(s->len_dump_bitmap, block_size) * 2;
    dh->bitmap_blocks = cpu_to_dump32(s, bitmap_blocks);
    strncpy(dh->utsname.machine, ELF_MACHINE_UNAME, sizeof(dh->utsname.machine));
    if (s->flag_compress & DUMP_DH_COMPRESSED_ZLIB) {
        status |= DUMP_DH_COMPRESSED_ZLIB;
#ifdef CONFIG_LZO
    if (s->flag_compress & DUMP_DH_COMPRESSED_LZO) {
        status |= DUMP_DH_COMPRESSED_LZO;
#endif
#ifdef CONFIG_SNAPPY
    if (s->flag_compress & DUMP_DH_COMPRESSED_SNAPPY) {
        status |= DUMP_DH_COMPRESSED_SNAPPY;
#endif
    dh->status = cpu_to_dump32(s, status);
    if (write_buffer(s->fd, 0, dh, size) < 0) {
        error_setg(errp, "dump: failed to write disk dump header");
        goto out;
    /* write sub header */
    size = sizeof(KdumpSubHeader32);
    kh = g_malloc0(size);
    /* 64bit max_mapnr_64 */
    kh->max_mapnr_64 = cpu_to_dump64(s, s->max_mapnr);
    kh->phys_base = cpu_to_dump32(s, s->dump_info.phys_base);
    kh->dump_level = cpu_to_dump32(s, DUMP_LEVEL);
    offset_note = DISKDUMP_HEADER_BLOCKS * block_size + size;
    kh->offset_note = cpu_to_dump64(s, offset_note);
    kh->note_size = cpu_to_dump32(s, s->note_size);
    if (write_buffer(s->fd, DISKDUMP_HEADER_BLOCKS *
                     block_size, kh, size) < 0) {
        error_setg(errp, "dump: failed to write kdump sub header");
        goto out;
    /* write note */
    s->note_buf = g_malloc0(s->note_size);
    s->note_buf_offset = 0;
    /* use s->note_buf to store notes temporarily */
    write_elf32_notes(buf_write_note, s, &local_err);
    if (local_err) {
        error_propagate(errp, local_err);
        goto out;
    if (write_buffer(s->fd, offset_note, s->note_buf,
                     s->note_size) < 0) {
        error_setg(errp, "dump: failed to write notes");
        goto out;
    /* get offset of dump_bitmap */
    s->offset_dump_bitmap = (DISKDUMP_HEADER_BLOCKS + sub_hdr_size) *
                             block_size;
    /* get offset of page */
    s->offset_page = (DISKDUMP_HEADER_BLOCKS + sub_hdr_size + bitmap_blocks) *
                     block_size;
out:
    g_free(dh);
    g_free(kh);
    g_free(s->note_buf);


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

+    switch(s->setup_state) {
+
     case SETUP_STATE_ACK:

         if (s->setup_buf[0] & USB_DIR_IN) {

static int do_token_out(USBDevice *s, USBPacket *p)

{

    if (p->devep != 0)

        return s->info->handle_data(s, p);

    switch(s->setup_state) {

    case SETUP_STATE_ACK:

        if (s->setup_buf[0] & USB_DIR_IN) {

            s->setup_state = SETUP_STATE_IDLE;

            /* transfer OK */

        } else {

            /* ignore additional output */

        }

        return 0;

    case SETUP_STATE_DATA:

        if (!(s->setup_buf[0] & USB_DIR_IN)) {

            int len = s->setup_len - s->setup_index;

            if (len > p->len)

                len = p->len;

            memcpy(s->data_buf + s->setup_index, p->data, len);

            s->setup_index += len;

            if (s->setup_index >= s->setup_len)

                s->setup_state = SETUP_STATE_ACK;

            return len;

        }

        s->setup_state = SETUP_STATE_IDLE;

        return USB_RET_STALL;

    default:

        return USB_RET_STALL;

    }

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     if (!f)
         return;
     if (s->ctla & CTLA_FORCE_BLANK) {
+        /* blank screen */
+        fprintf(f, "P4\n%d %d\n",
+            s->width, s->height);
+        for (y = 0; y < s->height; y++)
+            for (x = 0; x < s->width; x++)
                 fputc(0, f);
     } else {
         data_buffer = s->vram + s->top_of_screen;

static void g364fb_screen_dump(void *opaque, const char *filename)
{
    G364State *s = opaque;
    int y, x;
    uint8_t index;
    uint8_t *data_buffer;
    FILE *f;
    if (s->depth != 8) {
        error_report("g364: unknown guest depth %d", s->depth);
        return;
    }
    f = fopen(filename, "wb");
    if (!f)
        return;
    if (s->ctla & CTLA_FORCE_BLANK) {
        /* blank screen */
        fprintf(f, "P4\n%d %d\n",
            s->width, s->height);
        for (y = 0; y < s->height; y++)
            for (x = 0; x < s->width; x++)
                fputc(0, f);
    } else {
        data_buffer = s->vram + s->top_of_screen;
        fprintf(f, "P6\n%d %d\n%d\n",
            s->width, s->height, 255);
        for (y = 0; y < s->height; y++)
            for (x = 0; x < s->width; x++, data_buffer++) {
                index = *data_buffer;
                fputc(s->color_palette[index][0], f);
                fputc(s->color_palette[index][1], f);
                fputc(s->color_palette[index][2], f);
        }
    }
    fclose(f);
}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void tcg_target_init(TCGContext *s)

+{

     tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffffffff);

+    tcg_regset_set32(tcg_target_call_clobber_regs, 0,

                      (1 << TCG_REG_R0) |

static void tcg_target_init(TCGContext *s)

{

    tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffffffff);

    tcg_regset_set32(tcg_target_call_clobber_regs, 0,

                     (1 << TCG_REG_R0) |

#ifdef _CALL_DARWIN

                     (1 << TCG_REG_R2) |

#endif

                     (1 << TCG_REG_R3) |

                     (1 << TCG_REG_R4) |

                     (1 << TCG_REG_R5) |

                     (1 << TCG_REG_R6) |

                     (1 << TCG_REG_R7) |

                     (1 << TCG_REG_R8) |

                     (1 << TCG_REG_R9) |

                     (1 << TCG_REG_R10) |

                     (1 << TCG_REG_R11) |

                     (1 << TCG_REG_R12)

        );

    tcg_regset_clear(s->reserved_regs);

    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R0);

    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R1);

#ifndef _CALL_DARWIN

    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R2);

#endif

#ifdef _CALL_SYSV

    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R13);

#endif

    tcg_add_target_add_op_defs(ppc_op_defs);

}


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

     AVStream *stream;
+
     AVCodecContext *codec;

     const char *p = line;

static int parse_h264_sdp_line(AVFormatContext *s, int st_index,

                               PayloadContext *h264_data, const char *line)

{

    AVStream *stream;

    AVCodecContext *codec;

    const char *p = line;

    if (st_index < 0)

        return 0;

    stream = s->streams[st_index];

    codec = stream->codec;

    assert(h264_data->cookie == MAGIC_COOKIE);

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

        char buf1[50];

        char *dst = buf1;

        // remove the protocol identifier..

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

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

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

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

            *dst++ = *p++;

        }

        *dst = '\0';

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

        // set our parameters..

        codec->width = atoi(buf1);

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

        codec->pix_fmt = PIX_FMT_YUV420P;

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

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

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

        // could use this if we wanted.

    }

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

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
                         VIRTQUEUE_MAX_SIZE, 1);

     virtqueue_map_iovec(elem->out_sg, elem->out_addr, &elem->out_num,
+
+                        VIRTQUEUE_MAX_SIZE, 0);
+
 }

void virtqueue_map(VirtQueueElement *elem)

{

    virtqueue_map_iovec(elem->in_sg, elem->in_addr, &elem->in_num,

                        VIRTQUEUE_MAX_SIZE, 1);

    virtqueue_map_iovec(elem->out_sg, elem->out_addr, &elem->out_num,

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

 {

+    char path[PATH_MAX];
+
+    char buf[XEN_HOST_PCI_GET_VALUE_BUFFER_SIZE];

     int fd, rc;

static int xen_host_pci_get_value(XenHostPCIDevice *d, const char *name,

                                  unsigned int *pvalue, int base)

{

    char path[PATH_MAX];

    char buf[XEN_HOST_PCI_GET_VALUE_BUFFER_SIZE];

    int fd, rc;

    unsigned long value;

    char *endptr;

    rc = xen_host_pci_sysfs_path(d, name, path, sizeof (path));

    if (rc) {

        return rc;

    }

    fd = open(path, O_RDONLY);

    if (fd == -1) {

        XEN_HOST_PCI_LOG("Error: Can't open %s: %s\n", path, strerror(errno));

        return -errno;

    }

    do {

        rc = read(fd, &buf, sizeof (buf) - 1);

        if (rc < 0 && errno != EINTR) {

            rc = -errno;

            goto out;

        }

    } while (rc < 0);

    buf[rc] = 0;

    value = strtol(buf, &endptr, base);

    if (endptr == buf || *endptr != '\n') {

        rc = -1;

    } else if ((value == LONG_MIN || value == LONG_MAX) && errno == ERANGE) {

        rc = -errno;

    } else {

        rc = 0;

        *pvalue = value;

    }

out:

    close(fd);

    return rc;

}


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

 {

+    USBBus *bus;
+
+
+
+    bus = FROM_QBUS(USBBus, qbus_create(&usb_bus_info, host, NULL));

     bus->busnr = next_usb_bus++;

USBBus *usb_bus_new(DeviceState *host)

{

    USBBus *bus;

    bus = FROM_QBUS(USBBus, qbus_create(&usb_bus_info, host, NULL));

    bus->busnr = next_usb_bus++;

    TAILQ_INIT(&bus->free);

    TAILQ_INIT(&bus->used);

    TAILQ_INSERT_TAIL(&busses, bus, next);

    return bus;

}


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

     unsigned int i = (addr - OMAP2_L4_BASE) >> TARGET_PAGE_BITS;

static uint32_t omap_l4_io_readb(void *opaque, target_phys_addr_t addr)

{

    unsigned int i = (addr - OMAP2_L4_BASE) >> TARGET_PAGE_BITS;

    return omap_l4_io_readb_fn[i](omap_l4_io_opaque[i], addr);

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     AVRational frame_rate_q;

+
+    memset(frei0r->params, 0, sizeof(frei0r->params));
+
+
+
     if (args)

         sscanf(args, "%127[^:]:%127[^:]:%1023[^:=]%c%255c",

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

{

    Frei0rContext *frei0r = ctx->priv;

    char dl_name[1024], c;

    char frame_size[128] = "";

    char frame_rate[128] = "";

    AVRational frame_rate_q;

    memset(frei0r->params, 0, sizeof(frei0r->params));

    if (args)

        sscanf(args, "%127[^:]:%127[^:]:%1023[^:=]%c%255c",

               frame_size, frame_rate, dl_name, &c, frei0r->params);

    if (av_parse_video_size(&frei0r->w, &frei0r->h, frame_size) < 0) {

        av_log(ctx, AV_LOG_ERROR, "Invalid frame size: '%s'\n", frame_size);

        return AVERROR(EINVAL);

    }

    if (av_parse_video_rate(&frame_rate_q, frame_rate) < 0 ||

        frame_rate_q.den <= 0 || frame_rate_q.num <= 0) {

        av_log(ctx, AV_LOG_ERROR, "Invalid frame rate: '%s'\n", frame_rate);

        return AVERROR(EINVAL);

    }

    frei0r->time_base.num = frame_rate_q.den;

    frei0r->time_base.den = frame_rate_q.num;

    return frei0r_init(ctx, dl_name, F0R_PLUGIN_TYPE_SOURCE);

}


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

     /* for "none" machine this results in true */

bool gs_allowed(void)

{

    /* for "none" machine this results in true */

    return get_machine_class()->gs_allowed;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+void error_setg(Error **errp, const char *fmt, ...)

 {
+
     va_list ap;

void error_setg(Error **errp, const char *fmt, ...)

{

    va_list ap;

    va_start(ap, fmt);

    error_setv(errp, ERROR_CLASS_GENERIC_ERROR, fmt, ap);

    va_end(ap);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     TCGv tmp;

     switch (opsize) {
+
     case OS_BYTE:

         tcg_gen_andi_i32(reg, reg, 0xffffff00);
@@ -13,7 +13,7 @@
         tmp = tcg_temp_new();

         tcg_gen_ext8u_i32(tmp, val);
+
         tcg_gen_or_i32(reg, reg, tmp);

         break;

static void gen_partset_reg(int opsize, TCGv reg, TCGv val)

{

    TCGv tmp;

    switch (opsize) {

    case OS_BYTE:

        tcg_gen_andi_i32(reg, reg, 0xffffff00);

        tmp = tcg_temp_new();

        tcg_gen_ext8u_i32(tmp, val);

        tcg_gen_or_i32(reg, reg, tmp);

        break;

    case OS_WORD:

        tcg_gen_andi_i32(reg, reg, 0xffff0000);

        tmp = tcg_temp_new();

        tcg_gen_ext16u_i32(tmp, val);

        tcg_gen_or_i32(reg, reg, tmp);

        break;

    case OS_LONG:

    case OS_SINGLE:

        tcg_gen_mov_i32(reg, val);

        break;

    default:

        qemu_assert(0, "Bad operand size");

        break;

    }

}


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

         }
+
+    }
+
+
+
     tcg_out_movi(s, TCG_TYPE_PTR, dest, addr & ~0xffff);

     tcg_out_ld(s, type, dest, dest, addr & 0xffff);

static void tcg_out_ld_abs(TCGContext *s, TCGType type, TCGReg dest, void *abs)

{

    intptr_t addr = (intptr_t)abs;

    if ((facilities & FACILITY_GEN_INST_EXT) && !(addr & 1)) {

        ptrdiff_t disp = tcg_pcrel_diff(s, abs) >> 1;

        if (disp == (int32_t)disp) {

            if (type == TCG_TYPE_I32) {

                tcg_out_insn(s, RIL, LRL, dest, disp);

            } else {

                tcg_out_insn(s, RIL, LGRL, dest, disp);

            }

            return;

        }

    }

    tcg_out_movi(s, TCG_TYPE_PTR, dest, addr & ~0xffff);

    tcg_out_ld(s, type, dest, dest, addr & 0xffff);

}


--- a/source.c
+++ b/source.c
@@ -1,18 +1,18 @@
+static int arm_gic_common_init(SysBusDevice *dev)
+
 {

+    GICState *s = FROM_SYSBUS(GICState, dev);

     int num_irq = s->num_irq;

+

     if (s->num_cpu > NCPU) {
+
         hw_error("requested %u CPUs exceeds GIC maximum %d\n",

+                 s->num_cpu, NCPU);

     }

static int arm_gic_common_init(SysBusDevice *dev)

{

    GICState *s = FROM_SYSBUS(GICState, dev);

    int num_irq = s->num_irq;

    if (s->num_cpu > NCPU) {

        hw_error("requested %u CPUs exceeds GIC maximum %d\n",

                 s->num_cpu, NCPU);

    }

    s->num_irq += GIC_BASE_IRQ;

    if (s->num_irq > GIC_MAXIRQ) {

        hw_error("requested %u interrupt lines exceeds GIC maximum %d\n",

                 num_irq, GIC_MAXIRQ);

    }

    /* ITLinesNumber is represented as (N / 32) - 1 (see

     * gic_dist_readb) so this is an implementation imposed

     * restriction, not an architectural one:

     */

    if (s->num_irq < 32 || (s->num_irq % 32)) {

        hw_error("%d interrupt lines unsupported: not divisible by 32\n",

                 num_irq);

    }

    register_savevm(NULL, "arm_gic", -1, 3, gic_save, gic_load, s);

    return 0;

}


static void id3v2_read_ttag(AVFormatContext *s, int taglen, char *dst, int dstlen)

{

    char *q;

    int len;

    if(dstlen > 0)

        dst[0]= 0;

    if(taglen < 1)

        return;

    taglen--; /* account for encoding type byte */

    dstlen--; /* Leave space for zero terminator */

    switch(get_byte(s->pb)) { /* encoding type */

    case 0:  /* ISO-8859-1 (0 - 255 maps directly into unicode) */

        q = dst;

        while(taglen--) {

            uint8_t tmp;

            PUT_UTF8(get_byte(s->pb), tmp, if (q - dst < dstlen - 1) *q++ = tmp;)

        }

        *q = '\0';

        break;

    case 3:  /* UTF-8 */

        len = FFMIN(taglen, dstlen);

        get_buffer(s->pb, dst, len);

        dst[len] = 0;

        break;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+static int parse_uint64(DeviceState *dev, Property *prop, const char *str)
+
+{
+
+    uint64_t *ptr = qdev_get_prop_ptr(dev, prop);
+
     char *end;
+

     /* accept both hex and decimal */

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

{

    uint64_t *ptr = qdev_get_prop_ptr(dev, prop);

    char *end;

    /* accept both hex and decimal */

    *ptr = strtoull(str, &end, 0);

    if ((*end != '\0') || (end == str)) {

        return -EINVAL;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -35,11 +35,11 @@
 #define POW2CLIP(x,max) (((x) & ~max) ? (-(x))>>31 & max : (x));

     filter_level = POW2CLIP(filter_level, 63);
+
+
+
+    interior_limit = filter_level;
+
     if (s->filter.sharpness) {

         interior_limit >>= s->filter.sharpness > 4 ? 2 : 1;

static av_always_inline void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb, VP8FilterStrength *f )

{

    int interior_limit, filter_level;

    if (s->segmentation.enabled) {

        filter_level = s->segmentation.filter_level[s->segment];

        if (!s->segmentation.absolute_vals)

            filter_level += s->filter.level;

    } else

        filter_level = s->filter.level;

    if (s->lf_delta.enabled) {

        filter_level += s->lf_delta.ref[mb->ref_frame];

        filter_level += s->lf_delta.mode[mb->mode];

    }

/* Like av_clip for inputs 0 and max, where max is equal to (2^n-1) */

#define POW2CLIP(x,max) (((x) & ~max) ? (-(x))>>31 & max : (x));

    filter_level = POW2CLIP(filter_level, 63);

    interior_limit = filter_level;

    if (s->filter.sharpness) {

        interior_limit >>= s->filter.sharpness > 4 ? 2 : 1;

        interior_limit = FFMIN(interior_limit, 9 - s->filter.sharpness);

    }

    interior_limit = FFMAX(interior_limit, 1);

    f->filter_level = filter_level;

    f->inner_limit = interior_limit;

    f->inner_filter = !mb->skip || mb->mode == MODE_I4x4 || mb->mode == VP8_MVMODE_SPLIT;

}


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

         break;
+
+    case R_PASSFAIL:
+
+        s->regs[addr] = value;
+
         testname = (char *)s->testname;

         qemu_log("TC  %-16s %s\n", testname, (value) ? "FAILED" : "OK");

static void sys_write(void *opaque, hwaddr addr,

                      uint64_t value, unsigned size)

{

    LM32SysState *s = opaque;

    char *testname;

    trace_lm32_sys_memory_write(addr, value);

    addr >>= 2;

    switch (addr) {

    case R_CTRL:

        qemu_system_shutdown_request();

        break;

    case R_PASSFAIL:

        s->regs[addr] = value;

        testname = (char *)s->testname;

        qemu_log("TC  %-16s %s\n", testname, (value) ? "FAILED" : "OK");

        break;

    case R_TESTNAME:

        s->regs[addr] = value;

        copy_testname(s);

        break;

    default:

        error_report("lm32_sys: write access to unknown register 0x"

                TARGET_FMT_plx, addr << 2);

        break;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+bool st_init(const char *file)

 {

@@ -10,11 +10,11 @@

     int ret;

+

+    pthread_attr_init(&attr);
+
+    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);

bool st_init(const char *file)

{

    pthread_t thread;

    pthread_attr_t attr;

    sigset_t set, oldset;

    int ret;

    pthread_attr_init(&attr);

    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);

    sigfillset(&set);

    pthread_sigmask(SIG_SETMASK, &set, &oldset);

    ret = pthread_create(&thread, &attr, writeout_thread, NULL);

    pthread_sigmask(SIG_SETMASK, &oldset, NULL);

    if (ret != 0) {

        return false;

    }

    atexit(st_flush_trace_buffer);

    st_set_trace_file(file);

    return true;

}


static void FUNCC(pred8x8_top_dc)(uint8_t *_src, int stride){

    int i;

    int dc0, dc1;

    pixel4 dc0splat, dc1splat;

    pixel *src = (pixel*)_src;

    stride /= sizeof(pixel);

    dc0=dc1=0;

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

        dc0+= src[i-stride];

        dc1+= src[4+i-stride];

    }

    dc0splat = PIXEL_SPLAT_X4((dc0 + 2)>>2);

    dc1splat = PIXEL_SPLAT_X4((dc1 + 2)>>2);

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

        ((pixel4*)(src+i*stride))[0]= dc0splat;

        ((pixel4*)(src+i*stride))[1]= dc1splat;

    }

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

        ((pixel4*)(src+i*stride))[0]= dc0splat;

        ((pixel4*)(src+i*stride))[1]= dc1splat;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void visit_type_enum(Visitor *v, int *obj, const char *strings[],
+
+                     const char *kind, const char *name, Error **errp)

 {

void visit_type_enum(Visitor *v, int *obj, const char *strings[],

                     const char *kind, const char *name, Error **errp)

{

    if (!error_is_set(errp)) {

        v->type_enum(v, obj, strings, kind, name, errp);

    }

}


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

     my = y + deltay;

+
+
+    /* check MV against frame boundaries */
+
+    if ((mx < 0) || (mx > ri->width - sz) ||

         (my < 0) || (my > ri->height - sz)) {

static inline void apply_motion_generic(RoqContext *ri, int x, int y, int deltax,

                                        int deltay, int sz)

{

    int mx, my, cp;

    mx = x + deltax;

    my = y + deltay;

    /* check MV against frame boundaries */

    if ((mx < 0) || (mx > ri->width - sz) ||

        (my < 0) || (my > ri->height - sz)) {

        av_log(ri->avctx, AV_LOG_ERROR, "motion vector out of bounds: MV = (%d, %d), boundaries = (0, 0, %d, %d)\n",

            mx, my, ri->width, ri->height);

        return;

    }

    if (ri->last_frame->data[0] == NULL) {

        av_log(ri->avctx, AV_LOG_ERROR, "Invalid decode type. Invalid header?\n");

        return;

    }

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

        int outstride = ri->current_frame->linesize[cp];

        int instride  = ri->last_frame   ->linesize[cp];

        block_copy(ri->current_frame->data[cp] + y*outstride + x,

                   ri->last_frame->data[cp] + my*instride + mx,

                   outstride, instride, sz);

    }

}


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

 {

+    V4L2m2mContext *s = buf_to_m2mctx(avbuf);

     AVRational v4l2_timebase = { 1, USEC_PER_SEC };

static inline uint64_t v4l2_get_pts(V4L2Buffer *avbuf)

{

    V4L2m2mContext *s = buf_to_m2mctx(avbuf);

    AVRational v4l2_timebase = { 1, USEC_PER_SEC };

    int64_t v4l2_pts;

    /* convert pts back to encoder timebase */

    v4l2_pts = avbuf->buf.timestamp.tv_sec * USEC_PER_SEC + avbuf->buf.timestamp.tv_usec;

    return av_rescale_q(v4l2_pts, v4l2_timebase, s->avctx->time_base);

}


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

     QmpInputVisitor *qiv = to_qiv(v);

static void qmp_input_end_struct(Visitor *v, Error **errp)

{

    QmpInputVisitor *qiv = to_qiv(v);

    qmp_input_pop(qiv, errp);

}


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

 {

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

                                 ptrdiff_t stride)

{

    avc_luma_midh_qrt_16w_msa(src - (2 * stride) - 2,

                              stride, dst, stride, 16, 1);

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     pvtd_as = s->address_spaces[bus_num];

     if (!pvtd_as) {
+
+        /* No corresponding free() */
+
+        pvtd_as = g_malloc0(sizeof(VTDAddressSpace *) * VTD_PCI_DEVFN_MAX);
+
         s->address_spaces[bus_num] = pvtd_as;

     }

static AddressSpace *q35_host_dma_iommu(PCIBus *bus, void *opaque, int devfn)

{

    IntelIOMMUState *s = opaque;

    VTDAddressSpace **pvtd_as;

    int bus_num = pci_bus_num(bus);

    assert(0 <= bus_num && bus_num <= VTD_PCI_BUS_MAX);

    assert(0 <= devfn && devfn <= VTD_PCI_DEVFN_MAX);

    pvtd_as = s->address_spaces[bus_num];

    if (!pvtd_as) {

        /* No corresponding free() */

        pvtd_as = g_malloc0(sizeof(VTDAddressSpace *) * VTD_PCI_DEVFN_MAX);

        s->address_spaces[bus_num] = pvtd_as;

    }

    if (!pvtd_as[devfn]) {

        pvtd_as[devfn] = g_malloc0(sizeof(VTDAddressSpace));

        pvtd_as[devfn]->bus_num = (uint8_t)bus_num;

        pvtd_as[devfn]->devfn = (uint8_t)devfn;

        pvtd_as[devfn]->iommu_state = s;

        pvtd_as[devfn]->context_cache_entry.context_cache_gen = 0;

        memory_region_init_iommu(&pvtd_as[devfn]->iommu, OBJECT(s),

                                 &s->iommu_ops, "intel_iommu", UINT64_MAX);

        address_space_init(&pvtd_as[devfn]->as,

                           &pvtd_as[devfn]->iommu, "intel_iommu");

    }

    return &pvtd_as[devfn]->as;

}


--- a/source.c
+++ b/source.c
@@ -11,9 +11,9 @@
     mouse = qobject_to_qdict(data);

     monitor_printf(mon, "%c Mouse #%" PRId64 ": %s\n",
+
+                  (qdict_get_bool(mouse, "current") ? '*' : ' '),
+
+                  qdict_get_int(mouse, "index"), qdict_get_str(mouse, "name"));

 }

static void info_mice_iter(QObject *data, void *opaque)

{

    QDict *mouse;

    Monitor *mon = opaque;

    mouse = qobject_to_qdict(data);

    monitor_printf(mon, "%c Mouse #%" PRId64 ": %s\n",

                  (qdict_get_bool(mouse, "current") ? '*' : ' '),

                  qdict_get_int(mouse, "index"), qdict_get_str(mouse, "name"));

}


--- 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
@@ -1,9 +1,9 @@
 static void hid_keyboard_event(DeviceState *dev, QemuConsole *src,
+
+                               InputEvent *evt)
+
+{
+
     HIDState *hs = (HIDState *)dev;

     int scancodes[3], i, count;

static void hid_keyboard_event(DeviceState *dev, QemuConsole *src,

                               InputEvent *evt)

{

    HIDState *hs = (HIDState *)dev;

    int scancodes[3], i, count;

    int slot;

    count = qemu_input_key_value_to_scancode(evt->key->key,

                                             evt->key->down,

                                             scancodes);

    if (hs->n + count > QUEUE_LENGTH) {

        fprintf(stderr, "usb-kbd: warning: key event queue full\n");

        return;

    }

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

        slot = (hs->head + hs->n) & QUEUE_MASK; hs->n++;

        hs->kbd.keycodes[slot] = scancodes[i];

    }

    hs->event(hs);

}


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

     }

+    gen_helper_store_decr(cpu_env, cpu_gpr[gprn]);
+
+    if (use_icount) {
+
+        gen_io_end();

         gen_stop_exception(ctx);

static void spr_write_decr (DisasContext *ctx, int sprn, int gprn)

{

    if (use_icount) {

        gen_io_start();

    }

    gen_helper_store_decr(cpu_env, cpu_gpr[gprn]);

    if (use_icount) {

        gen_io_end();

        gen_stop_exception(ctx);

    }

}


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

+{

     BlockDriverAIOCBSync *acb = opaque;

static void bdrv_aio_bh_cb(void *opaque)

{

    BlockDriverAIOCBSync *acb = opaque;

    if (!acb->is_write)

        qemu_iovec_from_buf(acb->qiov, 0, acb->bounce, acb->qiov->size);

    qemu_vfree(acb->bounce);

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

    qemu_bh_delete(acb->bh);

    acb->bh = NULL;

    qemu_aio_release(acb);

}


static unsigned int rms(const int *data)

{

    int x;

    unsigned int res = 0x10000;

    int b = 0;

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

        res = (((0x1000000 - (*data) * (*data)) >> 12) * res) >> 12;

        if (res == 0)

            return 0;

        while (res <= 0x3fff) {

            b++;

            res <<= 2;

        }

        data++;

    }

    if (res > 0)

        res = t_sqrt(res);

    res >>= (b + 10);

    return res;

}


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

 {

+    FeatureWordInfo *f = &feature_word_info[w];

     int i;

static void report_unavailable_features(FeatureWord w, uint32_t mask)

{

    FeatureWordInfo *f = &feature_word_info[w];

    int i;

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

        if (1 << i & mask) {

            const char *reg = get_register_name_32(f->cpuid_reg);

            assert(reg);

            fprintf(stderr, "warning: %s doesn't support requested feature: "

                "CPUID.%02XH:%s%s%s [bit %d]\n",

                kvm_enabled() ? "host" : "TCG",

                f->cpuid_eax, reg,

                f->feat_names[i] ? "." : "",

                f->feat_names[i] ? f->feat_names[i] : "", i);

        }

    }

}


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

     for (ich = 0; ich < s->num_channels; ich++) {
+
         if (!s->is_channel_coded[ich])

             continue;

static void revert_cdlms(WmallDecodeCtx *s, int tile_size)

{

    int icoef, ich;

    int32_t pred, channel_coeff;

    int ilms, num_lms;

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

        if (!s->is_channel_coded[ich])

            continue;

        for (icoef = 0; icoef < tile_size; icoef++) {

            num_lms = s->cdlms_ttl[ich];

            channel_coeff = s->channel_residues[ich][icoef];

            if (icoef == s->transient_pos[ich]) {

                s->transient[ich] = 1;

                use_high_update_speed(s, ich);

            }

            for (ilms = num_lms; ilms >= 0; ilms--) {

                pred = lms_predict(s, ich, ilms);

                channel_coeff += pred;

                lms_update(s, ich, ilms, channel_coeff, pred);

            }

            if (s->transient[ich]) {

                --s->channel[ich].transient_counter;

                if(!s->channel[ich].transient_counter)

                    use_normal_update_speed(s, ich);

            }

            s->channel_coeffs[ich][icoef] = channel_coeff;

        }

    }

}


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

     VideoDemuxData *s1 = s->priv_data;

+
+
+    if (timestamp < 0 || timestamp > s1->img_last - s1->img_first)
+
         return -1;

     s1->img_number = timestamp + s1->img_first;

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

{

    VideoDemuxData *s1 = s->priv_data;

    if (timestamp < 0 || timestamp > s1->img_last - s1->img_first)

        return -1;

    s1->img_number = timestamp + s1->img_first;

    return 0;

}


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

             g_free(temp->asl);

+        }
+
+        if (temp->asl_file) {
+
+            if (!temp->tmp_files_retain) {

                 unlink(temp->asl_file);

static void free_test_data(test_data *data)

{

    AcpiSdtTable *temp;

    int i;

    if (data->rsdt_tables_addr) {

        g_free(data->rsdt_tables_addr);

    }

    for (i = 0; i < data->tables->len; ++i) {

        temp = &g_array_index(data->tables, AcpiSdtTable, i);

        if (temp->aml) {

            g_free(temp->aml);

        }

        if (temp->aml_file) {

            if (!temp->tmp_files_retain &&

                g_strstr_len(temp->aml_file, -1, "aml-")) {

                unlink(temp->aml_file);

            }

            g_free(temp->aml_file);

        }

        if (temp->asl) {

            g_free(temp->asl);

        }

        if (temp->asl_file) {

            if (!temp->tmp_files_retain) {

                unlink(temp->asl_file);

            }

            g_free(temp->asl_file);

        }

    }

    g_array_free(data->tables, false);

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     ssize_t len = sizeof(ACL_DEFAULT);

+
     if (!value) {

         return len;

static ssize_t mp_dacl_listxattr(FsContext *ctx, const char *path,

                                 char *name, void *value, size_t osize)

{

    ssize_t len = sizeof(ACL_DEFAULT);

    if (!value) {

        return len;

    }

    if (osize < len) {

        errno = ERANGE;

        return -1;

    }

    /* len includes the trailing NUL */

    memcpy(value, ACL_ACCESS, len);

    return 0;

}


static uint64_t ahci_idp_read(void *opaque, target_phys_addr_t addr,

                              unsigned size)

{

    AHCIState *s = opaque;

    if (addr == s->idp_offset) {

        /* index register */

        return s->idp_index;

    } else if (addr == s->idp_offset + 4) {

        /* data register - do memory read at location selected by index */

        return ahci_mem_read(opaque, s->idp_index, size);

    } else {

        return 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -3,4 +3,4 @@
     VMMouseState *s = container_of(d, VMMouseState, dev.qdev);
     s->status = 0xffff;
     s->queue_size = VMMOUSE_QUEUE_SIZE;
+}

static void vmmouse_reset(DeviceState *d)
{
    VMMouseState *s = container_of(d, VMMouseState, dev.qdev);
    s->status = 0xffff;
    s->queue_size = VMMOUSE_QUEUE_SIZE;
}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     assert(type == R_ARM_PC24);

     assert(addend == 0);
+
+    reloc_pc24(code_ptr, (tcg_insn_unit *)value);
+
 }

static void patch_reloc(tcg_insn_unit *code_ptr, int type,

                        intptr_t value, intptr_t addend)

{

    assert(type == R_ARM_PC24);

    assert(addend == 0);

    reloc_pc24(code_ptr, (tcg_insn_unit *)value);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int arm946_prbs_read(CPUARMState *env, const ARMCPRegInfo *ri,
+
                             uint64_t *value)

 {

static int arm946_prbs_read(CPUARMState *env, const ARMCPRegInfo *ri,

                            uint64_t *value)

{

    if (ri->crm > 8) {

        return EXCP_UDEF;

    }

    *value = env->cp15.c6_region[ri->crm];

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline void vmsvga_fill_rect(struct vmsvga_state_s *s,

                 uint32_t c, int x, int y, int w, int h)

static inline void vmsvga_fill_rect(struct vmsvga_state_s *s,

                uint32_t c, int x, int y, int w, int h)

{

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

    int bypl = surface_stride(surface);

    int width = surface_bytes_per_pixel(surface) * w;

    int line = h;

    int column;

    uint8_t *fst;

    uint8_t *dst;

    uint8_t *src;

    uint8_t col[4];

    col[0] = c;

    col[1] = c >> 8;

    col[2] = c >> 16;

    col[3] = c >> 24;

    fst = s->vga.vram_ptr + surface_bytes_per_pixel(surface) * x + bypl * y;

    if (line--) {

        dst = fst;

        src = col;

        for (column = width; column > 0; column--) {

            *(dst++) = *(src++);

            if (src - col == surface_bytes_per_pixel(surface)) {

                src = col;

            }

        }

        dst = fst;

        for (; line > 0; line--) {

            dst += bypl;

            memcpy(dst, fst, width);

        }

    }

    vmsvga_update_rect_delayed(s, x, y, w, h);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 CPUState *cpu_generic_init(const char *typename, const char *cpu_model)
+
+{
+
     /* TODO: all callers of cpu_generic_init() need to be converted to
+
      * call cpu_parse_features() only once, before calling cpu_generic_init().

      */

CPUState *cpu_generic_init(const char *typename, const char *cpu_model)

{

    /* TODO: all callers of cpu_generic_init() need to be converted to

     * call cpu_parse_features() only once, before calling cpu_generic_init().

     */

    const char *cpu_type = cpu_parse_cpu_model(typename, cpu_model);

    if (cpu_type) {

        return cpu_create(cpu_type);

    }

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static uint32_t get_features(VirtIODevice *vdev, uint32_t features)

 {
+
     VirtIOSerial *vser;

static uint32_t get_features(VirtIODevice *vdev, uint32_t features)

{

    VirtIOSerial *vser;

    vser = DO_UPCAST(VirtIOSerial, vdev, vdev);

    if (vser->bus->max_nr_ports > 1) {

        features |= (1 << VIRTIO_CONSOLE_F_MULTIPORT);

    }

    return features;

}


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

     switch (addr) {

+    case R_SR:
+
+    case R_CR:
+
+    case R_PERIOD:

         r = s->regs[addr];

static uint64_t timer_read(void *opaque, target_phys_addr_t addr, unsigned size)

{

    LM32TimerState *s = opaque;

    uint32_t r = 0;

    addr >>= 2;

    switch (addr) {

    case R_SR:

    case R_CR:

    case R_PERIOD:

        r = s->regs[addr];

        break;

    case R_SNAPSHOT:

        r = (uint32_t)ptimer_get_count(s->ptimer);

        break;

    default:

        error_report("lm32_timer: read access to unknown register 0x"

                TARGET_FMT_plx, addr << 2);

        break;

    }

    trace_lm32_timer_memory_read(addr << 2, r);

    return r;

}


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

     BDRVRawState *s = bs->opaque;

+    int rc;

+

     rc = fd_open(bs);
+
     if (rc < 0) {

         return rc;

static coroutine_fn int hdev_co_write_zeroes(BlockDriverState *bs,

    int64_t sector_num, int nb_sectors, BdrvRequestFlags flags)

{

    BDRVRawState *s = bs->opaque;

    int rc;

    rc = fd_open(bs);

    if (rc < 0) {

        return rc;

    }

    if (!(flags & BDRV_REQ_MAY_UNMAP)) {

        return -ENOTSUP;

    }

    if (!s->discard_zeroes) {

        return -ENOTSUP;

    }

    return paio_submit_co(bs, s->fd, sector_num, NULL, nb_sectors,

                          QEMU_AIO_DISCARD|QEMU_AIO_BLKDEV);

}


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

     s->msix->ctrl_offset = real_offset;

+
+
+    *data = reg->init_val;
+
+    return 0;

 }

static int xen_pt_msixctrl_reg_init(XenPCIPassthroughState *s,

                                    XenPTRegInfo *reg, uint32_t real_offset,

                                    uint32_t *data)

{

    PCIDevice *d = &s->dev;

    uint16_t reg_field = 0;

    /* use I/O device register's value as initial value */

    reg_field = pci_get_word(d->config + real_offset);

    if (reg_field & PCI_MSIX_FLAGS_ENABLE) {

        XEN_PT_LOG(d, "MSIX already enabled, disabling it first\n");

        xen_host_pci_set_word(&s->real_device, real_offset,

                              reg_field & ~PCI_MSIX_FLAGS_ENABLE);

    }

    s->msix->ctrl_offset = real_offset;

    *data = reg->init_val;

    return 0;

}


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

     IDEState *s = opaque;
+
+    uint64_t nb_sectors;
+
+

     /* XXX: send interrupt too */

static void cdrom_change_cb(void *opaque)

{

    IDEState *s = opaque;

    uint64_t nb_sectors;

    /* XXX: send interrupt too */

    bdrv_get_geometry(s->bs, &nb_sectors);

    s->nb_sectors = nb_sectors;

}


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

 {

+    DeviceClass *dc = DEVICE_CLASS(klass);

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    dc->realize = ioapic_common_realize;

    dc->vmsd = &vmstate_ioapic_common;

    dc->no_user = 1;

}


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

     }
+
     buf[2047] = '\0';

     if (vmdk_parse_description(buf, "createType", ct, sizeof(ct))) {

static int vmdk_open_desc_file(BlockDriverState *bs, int flags,

                               int64_t desc_offset)

{

    int ret;

    char buf[2048];

    char ct[128];

    BDRVVmdkState *s = bs->opaque;

    ret = bdrv_pread(bs->file, desc_offset, buf, sizeof(buf));

    if (ret < 0) {

        return ret;

    }

    buf[2047] = '\0';

    if (vmdk_parse_description(buf, "createType", ct, sizeof(ct))) {

        return -EINVAL;

    }

    if (strcmp(ct, "monolithicFlat") &&

        strcmp(ct, "twoGbMaxExtentSparse") &&

        strcmp(ct, "twoGbMaxExtentFlat")) {

        fprintf(stderr,

                "VMDK: Not supported image type \"%s\""".\n", ct);

        return -ENOTSUP;

    }

    s->desc_offset = 0;

    ret = vmdk_parse_extents(buf, bs, bs->file->filename);

    if (ret) {

        return ret;

    }

    /* try to open parent images, if exist */

    if (vmdk_parent_open(bs)) {

        g_free(s->extents);

        return -EINVAL;

    }

    s->parent_cid = vmdk_read_cid(bs, 1);

    return 0;

}


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

                                inet_ntoa(spkt->ip->ip_src),

+                               inet_ntoa(spkt->ip->ip_dst));
+
+
+
+    if (ppkt->size == spkt->size) {

         return memcmp(ppkt->data, spkt->data, spkt->size);

static int colo_packet_compare(Packet *ppkt, Packet *spkt)

{

    trace_colo_compare_ip_info(ppkt->size, inet_ntoa(ppkt->ip->ip_src),

                               inet_ntoa(ppkt->ip->ip_dst), spkt->size,

                               inet_ntoa(spkt->ip->ip_src),

                               inet_ntoa(spkt->ip->ip_dst));

    if (ppkt->size == spkt->size) {

        return memcmp(ppkt->data, spkt->data, spkt->size);

    } else {

        return -1;

    }

}


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

     BlockBackend *blk;

+    Error *local_err = NULL;
+
+
+
+    for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {

         BlockInfoList *info = g_malloc0(sizeof(*info));

BlockInfoList *qmp_query_block(Error **errp)

{

    BlockInfoList *head = NULL, **p_next = &head;

    BlockBackend *blk;

    Error *local_err = NULL;

    for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {

        BlockInfoList *info = g_malloc0(sizeof(*info));

        bdrv_query_info(blk, &info->value, &local_err);

        if (local_err) {

            error_propagate(errp, local_err);

            g_free(info);

            qapi_free_BlockInfoList(head);

            return NULL;

        }

        *p_next = info;

        p_next = &info->next;

    }

    return head;

}


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

     QDict *qdict;
+
+    Monitor *mon = opaque;
+
+
+
     qdict = qobject_to_qdict(data);

     monitor_printf(mon, "%s:", qdict_get_str(qdict, "device"));

static void bdrv_stats_iter(QObject *data, void *opaque)

{

    QDict *qdict;

    Monitor *mon = opaque;

    qdict = qobject_to_qdict(data);

    monitor_printf(mon, "%s:", qdict_get_str(qdict, "device"));

    qdict = qobject_to_qdict(qdict_get(qdict, "stats"));

    monitor_printf(mon, " rd_bytes=%" PRId64

                        " wr_bytes=%" PRId64

                        " rd_operations=%" PRId64

                        " wr_operations=%" PRId64

                        " flush_operations=%" PRId64

                        "\n",

                        qdict_get_int(qdict, "rd_bytes"),

                        qdict_get_int(qdict, "wr_bytes"),

                        qdict_get_int(qdict, "rd_operations"),

                        qdict_get_int(qdict, "wr_operations"),

                        qdict_get_int(qdict, "flush_operations"));

}


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

                                       int has_alpha,
+
                                       int loss_mask)

 {

static int avcodec_find_best_pix_fmt1(int64_t pix_fmt_mask,

                                      int src_pix_fmt,

                                      int has_alpha,

                                      int loss_mask)

{

    int dist, i, loss, min_dist, dst_pix_fmt;

    /* find exact color match with smallest size */

    dst_pix_fmt = -1;

    min_dist = 0x7fffffff;

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

        if (pix_fmt_mask & (1 << i)) {

            loss = avcodec_get_pix_fmt_loss(i, src_pix_fmt, has_alpha) & loss_mask;

            if (loss == 0) {

                dist = avg_bits_per_pixel(i);

                if (dist < min_dist) {

                    min_dist = dist;

                    dst_pix_fmt = i;

                }

            }

        }

    }

    return dst_pix_fmt;

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
     if (!ide_sect_range_ok(s, sector_num, n)) {

         ide_rw_error(s);
+
+        return;
+
+    }
+

     s->iov.iov_base = s->io_buffer;

void ide_sector_write(IDEState *s)

{

    int64_t sector_num;

    int n;

    s->status = READY_STAT | SEEK_STAT | BUSY_STAT;

    sector_num = ide_get_sector(s);

#if defined(DEBUG_IDE)

    printf("sector=%" PRId64 "\n", sector_num);

#endif

    n = s->nsector;

    if (n > s->req_nb_sectors) {

        n = s->req_nb_sectors;

    }

    if (!ide_sect_range_ok(s, sector_num, n)) {

        ide_rw_error(s);

        return;

    }

    s->iov.iov_base = s->io_buffer;

    s->iov.iov_len  = n * BDRV_SECTOR_SIZE;

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

    block_acct_start(bdrv_get_stats(s->bs), &s->acct,

                     n * BDRV_SECTOR_SIZE, BLOCK_ACCT_READ);

    s->pio_aiocb = bdrv_aio_writev(s->bs, sector_num, &s->qiov, n,

                                   ide_sector_write_cb, s);

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 static inline void RENAME(rgb15ToY)(uint8_t *dst, uint8_t *src, int width)
+
+{

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

 		int d= ((uint16_t*)src)[i];

static inline void RENAME(rgb15ToY)(uint8_t *dst, uint8_t *src, int width)

{

	int i;

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

	{

		int d= ((uint16_t*)src)[i];

		int r= d&0x1F;

		int g= (d>>5)&0x1F;

		int b= (d>>10)&0x1F;

		dst[i]= ((RY*r + GY*g + BY*b)>>(RGB2YUV_SHIFT-3)) + 16;

	}

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 vreader_get_reader_by_id(vreader_id_t id)

+{
+
+    VReader *reader = NULL;
+
+    VReaderListEntry *current_entry = NULL;

vreader_get_reader_by_id(vreader_id_t id)

{

    VReader *reader = NULL;

    VReaderListEntry *current_entry = NULL;

    if (id == (vreader_id_t) -1) {

        return NULL;

    }

    vreader_list_lock();

    for (current_entry = vreader_list_get_first(vreader_list); current_entry;

            current_entry = vreader_list_get_next(current_entry)) {

        VReader *creader = vreader_list_get_reader(current_entry);

        if (creader->id == id) {

            reader = creader;

            break;

        }

        vreader_free(creader);

    }

    vreader_list_unlock();

    return reader;

}


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

     s->last_scr=scr;
+
+
+
+    return scr;
+
 }

static int64_t update_scr(AVFormatContext *ctx,int stream_index,int64_t pts)

{

    MpegMuxContext *s = ctx->priv_data;

    int64_t scr;

    if (s->is_vcd)

        /* Since the data delivery rate is constant, SCR is computed

           using the formula C + i * 1200 where C is the start constant

           and i is the pack index.

           It is recommended that SCR 0 is at the beginning of the VCD front

           margin (a sequence of empty Form 2 sectors on the CD).

           It is recommended that the front margin is 30 sectors long, so

           we use C = 30*1200 = 36000

           (Note that even if the front margin is not 30 sectors the file

           will still be correct according to the standard. It just won't have

           the "recommended" value).*/

        scr = 36000 + s->packet_number * 1200;

    else {

        /* XXX I believe this calculation of SCR is wrong. SCR

           specifies at which time the data should enter the decoder.

           Two packs cannot enter the decoder at the same time. */

        /* XXX: system clock should be computed precisely, especially for

        CBR case. The current mode gives at least something coherent */

        if (stream_index == s->scr_stream_index

            && pts != AV_NOPTS_VALUE)

            scr = pts;

        else

            scr = s->last_scr;

    }

    s->last_scr=scr;

    return scr;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void cmd_prevent_allow_medium_removal(IDEState *s, uint8_t* buf)
+
+{

     s->tray_locked = buf[4] & 1;

static void cmd_prevent_allow_medium_removal(IDEState *s, uint8_t* buf)

{

    s->tray_locked = buf[4] & 1;

    bdrv_lock_medium(s->bs, buf[4] & 1);

    ide_atapi_cmd_ok(s);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 CharDriverState *qemu_chr_open_eventfd(int eventfd)

 {
+
+    CharDriverState *chr = qemu_chr_open_fd(eventfd, eventfd);
+
+

     if (chr) {

CharDriverState *qemu_chr_open_eventfd(int eventfd)

{

    CharDriverState *chr = qemu_chr_open_fd(eventfd, eventfd);

    if (chr) {

        chr->avail_connections = 1;

    }

    return chr;

}


static int get_dimension(GetBitContext *gb, const int *dim)

{

    int t   = get_bits(gb, 3);

    int val = dim[t];

    if(val < 0)

        val = dim[get_bits1(gb) - val];

    if(!val){

        do{

            t = get_bits(gb, 8);

            val += t << 2;

        }while(t == 0xFF);

    }

    return val;

}


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

     BusState *bus;

+
+
+    LIST_FOREACH(bus, &dev->child_bus, sibling) {
+
+        if (strcmp(name, bus->name) == 0) {

             return bus;

BusState *qdev_get_child_bus(DeviceState *dev, const char *name)

{

    BusState *bus;

    LIST_FOREACH(bus, &dev->child_bus, sibling) {

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

            return bus;

        }

    }

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static inline void gen_addr_imm_index (DisasContext *ctx)

 {
+
     target_long simm = SIMM(ctx->opcode);

static inline void gen_addr_imm_index (DisasContext *ctx)

{

    target_long simm = SIMM(ctx->opcode);

    if (rA(ctx->opcode) == 0) {

        gen_op_set_T0(simm);

    } else {

        gen_op_load_gpr_T0(rA(ctx->opcode));

        if (likely(simm != 0))

            gen_op_addi(simm);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static inline int available_samples(AVFrame *out)

+{

     int bytes_per_sample = av_get_bytes_per_sample(out->format);

static inline int available_samples(AVFrame *out)

{

    int bytes_per_sample = av_get_bytes_per_sample(out->format);

    int samples = out->linesize[0] / bytes_per_sample;

    if (av_sample_fmt_is_planar(out->format)) {

        return samples;

    } else {

        int channels = av_get_channel_layout_nb_channels(out->channel_layout);

        return samples / channels;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static void fw_cfg_init1(DeviceState *dev)

 {

+    FWCfgState *s = FW_CFG(dev);
+
+    MachineState *machine = MACHINE(qdev_get_machine());

     uint32_t version = FW_CFG_VERSION;

static void fw_cfg_init1(DeviceState *dev)

{

    FWCfgState *s = FW_CFG(dev);

    MachineState *machine = MACHINE(qdev_get_machine());

    uint32_t version = FW_CFG_VERSION;

    assert(!object_resolve_path(FW_CFG_PATH, NULL));

    object_property_add_child(OBJECT(machine), FW_CFG_NAME, OBJECT(s), NULL);

    qdev_init_nofail(dev);

    fw_cfg_add_bytes(s, FW_CFG_SIGNATURE, (char *)"QEMU", 4);

    fw_cfg_add_bytes(s, FW_CFG_UUID, &qemu_uuid, 16);

    fw_cfg_add_i16(s, FW_CFG_NOGRAPHIC, (uint16_t)!machine->enable_graphics);

    fw_cfg_add_i16(s, FW_CFG_BOOT_MENU, (uint16_t)boot_menu);

    fw_cfg_bootsplash(s);

    fw_cfg_reboot(s);

    if (s->dma_enabled) {

        version |= FW_CFG_VERSION_DMA;

    }

    fw_cfg_add_i32(s, FW_CFG_ID, version);

    s->machine_ready.notify = fw_cfg_machine_ready;

    qemu_add_machine_init_done_notifier(&s->machine_ready);

}


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

     dc->vmsd = &pci_vpb_vmstate;

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

 }

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    dc->realize = pci_vpb_realize;

    dc->reset = pci_vpb_reset;

    dc->vmsd = &pci_vpb_vmstate;

    dc->props = pci_vpb_properties;

    /* Reason: object_unref() hangs */

    dc->cannot_destroy_with_object_finalize_yet = true;

}


--- a/source.c
+++ b/source.c
@@ -15,10 +15,10 @@
     case AMF_DATA_TYPE_NUMBER:      return 9;

     case AMF_DATA_TYPE_BOOL:        return 2;
+
     case AMF_DATA_TYPE_STRING:      return 3 + AV_RB16(data);

+    case AMF_DATA_TYPE_LONG_STRING: return 5 + AV_RB32(data);

     case AMF_DATA_TYPE_NULL:        return 1;

int ff_amf_tag_size(const uint8_t *data, const uint8_t *data_end)

{

    const uint8_t *base = data;

    if (data >= data_end)

        return -1;

    switch (*data++) {

    case AMF_DATA_TYPE_NUMBER:      return 9;

    case AMF_DATA_TYPE_BOOL:        return 2;

    case AMF_DATA_TYPE_STRING:      return 3 + AV_RB16(data);

    case AMF_DATA_TYPE_LONG_STRING: return 5 + AV_RB32(data);

    case AMF_DATA_TYPE_NULL:        return 1;

    case AMF_DATA_TYPE_ARRAY:

        data += 4;

    case AMF_DATA_TYPE_OBJECT:

        for (;;) {

            int size = bytestream_get_be16(&data);

            int t;

            if (!size) {

                data++;

                break;

            }

            if (data + size >= data_end || data + size < data)

                return -1;

            data += size;

            t = ff_amf_tag_size(data, data_end);

            if (t < 0 || data + t >= data_end)

                return -1;

            data += t;

        }

        return data - base;

    case AMF_DATA_TYPE_OBJECT_END:  return 1;

    default:                        return -1;

    }

}


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

         if (s->bs) {

+            ide_sector_start_dma(s, IDE_DMA_TRIM);
+
+            return false;
+
+        }

         break;

static bool cmd_data_set_management(IDEState *s, uint8_t cmd)

{

    switch (s->feature) {

    case DSM_TRIM:

        if (s->bs) {

            ide_sector_start_dma(s, IDE_DMA_TRIM);

            return false;

        }

        break;

    }

    ide_abort_command(s);

    return true;

}


--- 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
@@ -32,11 +32,11 @@
         caps->value =

             g_malloc(sizeof(*caps->value));
+
+        caps->value->capability = i;
+
+        caps->value->state = s->enabled_capabilities[i];
+
     }

MigrationCapabilityStatusList *qmp_query_migrate_capabilities(Error **errp)

{

    MigrationCapabilityStatusList *head = NULL;

    MigrationCapabilityStatusList *caps;

    MigrationState *s = migrate_get_current();

    int i;

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

        if (head == NULL) {

            head = g_malloc0(sizeof(*caps));

            caps = head;

        } else {

            caps->next = g_malloc0(sizeof(*caps));

            caps = caps->next;

        }

        caps->value =

            g_malloc(sizeof(*caps->value));

        caps->value->capability = i;

        caps->value->state = s->enabled_capabilities[i];

    }

    return head;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void qemu_mutex_unlock(QemuMutex *mutex)
+
+{
+
     assert(mutex->owner == GetCurrentThreadId());

     mutex->owner = 0;

void qemu_mutex_unlock(QemuMutex *mutex)

{

    assert(mutex->owner == GetCurrentThreadId());

    mutex->owner = 0;

    LeaveCriticalSection(&mutex->lock);

}


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

     return env->cpuid_apic_id == 0;

+}

int cpu_is_bsp(CPUState *env)

{

    return env->cpuid_apic_id == 0;

}


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

 {

+    char buf[8];

     int len, i, channel_id = 0;

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

         layout0 = layout = av_get_channel_layout(buf);

+        /* channel_id <- first set bit in layout */

         for (i = 32; i > 0; i >>= 1) {

static int parse_channel_name(char **arg, int *rchannel, int *rnamed)

{

    char buf[8];

    int len, i, channel_id = 0;

    int64_t layout, layout0;

    /* try to parse a channel name, e.g. "FL" */

    if (sscanf(*arg, " %7[A-Z] %n", buf, &len)) {

        layout0 = layout = av_get_channel_layout(buf);

        /* channel_id <- first set bit in layout */

        for (i = 32; i > 0; i >>= 1) {

            if (layout >= (int64_t)1 << i) {

                channel_id += i;

                layout >>= i;

            }

        }

        /* reject layouts that are not a single channel */

        if (channel_id >= MAX_CHANNELS || layout0 != (int64_t)1 << channel_id)

            return AVERROR(EINVAL);

        *rchannel = channel_id;

        *rnamed = 1;

        *arg += len;

        return 0;

    }

    /* try to parse a channel number, e.g. "c2" */

    if (sscanf(*arg, " c%d %n", &channel_id, &len) &&

        channel_id >= 0 && channel_id < MAX_CHANNELS) {

        *rchannel = channel_id;

        *rnamed = 0;

        *arg += len;

        return 0;

    }

    return AVERROR(EINVAL);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void compute_chapters_end(AVFormatContext *s)

+{

     unsigned int i, j;

static void compute_chapters_end(AVFormatContext *s)

{

    unsigned int i, j;

    int64_t max_time = s->duration +

                       ((s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time);

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

        if (s->chapters[i]->end == AV_NOPTS_VALUE) {

            AVChapter *ch = s->chapters[i];

            int64_t end = max_time ? av_rescale_q(max_time, AV_TIME_BASE_Q,

                                                  ch->time_base)

                                   : INT64_MAX;

            for (j = 0; j < s->nb_chapters; j++) {

                AVChapter *ch1     = s->chapters[j];

                int64_t next_start = av_rescale_q(ch1->start, ch1->time_base,

                                                  ch->time_base);

                if (j != i && next_start > ch->start && next_start < end)

                    end = next_start;

            }

            ch->end = (end == INT64_MAX) ? ch->start : end;

        }

}


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

     return malloc(size);
+
 }

void *qemu_malloc(size_t size)

{

    return malloc(size);

}


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

     if (SDL_GetAppState() & SDL_APPINPUTFOCUS) {
+
+        SDL_GetMouseState(&mouse_x, &mouse_y);
+
+        if (mouse_x > 0 && mouse_x < real_screen->w - 1 &&
+
             mouse_y > 0 && mouse_y < real_screen->h - 1) {

             sdl_grab_start();

static void absolute_mouse_grab(void)

{

    int mouse_x, mouse_y;

    if (SDL_GetAppState() & SDL_APPINPUTFOCUS) {

        SDL_GetMouseState(&mouse_x, &mouse_y);

        if (mouse_x > 0 && mouse_x < real_screen->w - 1 &&

            mouse_y > 0 && mouse_y < real_screen->h - 1) {

            sdl_grab_start();

        }

    }

}


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

     float32 f0 = make_float32(a);
+
+    float32 f1 = make_float32(b);

     return (float32_compare_quiet(f0, f1, NFS) == 1) ? a : b;

uint32_t HELPER(neon_max_f32)(uint32_t a, uint32_t b)

{

    float32 f0 = make_float32(a);

    float32 f1 = make_float32(b);

    return (float32_compare_quiet(f0, f1, NFS) == 1) ? a : b;

}


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

     tcg_gen_movi_i64(cpu_pc, ctx->pc);

+    tmp1 = tcg_const_i32(exception);
+
+    tmp2 = tcg_const_i32(error_code);
+
+    tcg_gen_helper_0_2(helper_excp, tmp1, tmp2);

     tcg_temp_free(tmp2);

static always_inline void gen_excp (DisasContext *ctx,

                                    int exception, int error_code)

{

    TCGv tmp1, tmp2;

    tcg_gen_movi_i64(cpu_pc, ctx->pc);

    tmp1 = tcg_const_i32(exception);

    tmp2 = tcg_const_i32(error_code);

    tcg_gen_helper_0_2(helper_excp, tmp1, tmp2);

    tcg_temp_free(tmp2);

    tcg_temp_free(tmp1);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 vu_queue_notify(VuDev *dev, VuVirtq *vq)
+
 {

     if (unlikely(dev->broken)) {

vu_queue_notify(VuDev *dev, VuVirtq *vq)

{

    if (unlikely(dev->broken)) {

        return;

    }

    if (!vring_notify(dev, vq)) {

        DPRINT("skipped notify...\n");

        return;

    }

    if (eventfd_write(vq->call_fd, 1) < 0) {

        vu_panic(dev, "Error writing eventfd: %s", strerror(errno));

    }

}


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

     state = TERMINATE;

static void termsig_handler(int signum)

{

    state = TERMINATE;

    qemu_notify_event();

}


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

 {

+    CPU_DoubleU u;
+
+
+
+    u.ll = val;

     /* NaN are not treated the same way IEEE 754 does */

uint32_t helper_efdctsi (uint64_t val)

{

    CPU_DoubleU u;

    u.ll = val;

    /* NaN are not treated the same way IEEE 754 does */

    if (unlikely(float64_is_nan(u.d)))

        return 0;

    return float64_to_int32(u.d, &env->vec_status);

}


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

     int shift, mod;

+    int64_t val;

static inline int l1_unscale(int n, int mant, int scale_factor)

{

    int shift, mod;

    int64_t val;

    shift   = scale_factor_modshift[scale_factor];

    mod     = shift & 3;

    shift >>= 2;

    val     = MUL64(mant + (-1 << n) + 1, scale_factor_mult[n-1][mod]);

    shift  += n;

    /* NOTE: at this point, 1 <= shift >= 21 + 15 */

    return (int)((val + (1LL << (shift - 1))) >> shift);

}


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

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

             *endptr = nptr;

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

                  uint64_t *result)

{

    char *p;

    int err = 0;

    if (!nptr) {

        if (endptr) {

            *endptr = nptr;

        }

        err = -EINVAL;

    } else {

        errno = 0;

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

        err = check_strtox_error(endptr, p, errno);

    }

    return err;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+int ff_h264_check_intra_pred_mode(H264Context *h, int mode){

     MpegEncContext * const s = &h->s;

int ff_h264_check_intra_pred_mode(H264Context *h, int mode){

    MpegEncContext * const s = &h->s;

    static const int8_t top [7]= {LEFT_DC_PRED8x8, 1,-1,-1};

    static const int8_t left[7]= { TOP_DC_PRED8x8,-1, 2,-1,DC_128_PRED8x8};

    if(mode > 6U) {

        av_log(h->s.avctx, AV_LOG_ERROR, "out of range intra chroma pred mode at %d %d\n", s->mb_x, s->mb_y);

        return -1;

    }

    if(!(h->top_samples_available&0x8000)){

        mode= top[ mode ];

        if(mode<0){

            av_log(h->s.avctx, AV_LOG_ERROR, "top block unavailable for requested intra mode at %d %d\n", s->mb_x, s->mb_y);

            return -1;

        }

    }

    if((h->left_samples_available&0x8080) != 0x8080){

        mode= left[ mode ];

        if(h->left_samples_available&0x8080){ //mad cow disease mode, aka MBAFF + constrained_intra_pred

            mode= ALZHEIMER_DC_L0T_PRED8x8 + (!(h->left_samples_available&0x8000)) + 2*(mode == DC_128_PRED8x8);

        }

        if(mode<0){

            av_log(h->s.avctx, AV_LOG_ERROR, "left block unavailable for requested intra mode at %d %d\n", s->mb_x, s->mb_y);

            return -1;

        }

    }

    return mode;

}


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

     assert(tos && !tos->entry);
+
     if (qiv->strict) {

         GHashTable *const top_ht = tos->h;

static void qobject_input_check_struct(Visitor *v, Error **errp)

{

    QObjectInputVisitor *qiv = to_qiv(v);

    StackObject *tos = QSLIST_FIRST(&qiv->stack);

    assert(tos && !tos->entry);

    if (qiv->strict) {

        GHashTable *const top_ht = tos->h;

        if (top_ht) {

            GHashTableIter iter;

            const char *key;

            g_hash_table_iter_init(&iter, top_ht);

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

                error_setg(errp, "Parameter '%s' is unexpected", key);

            }

        }

    }

}


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

         default: abort();

+        }

     } else {

static inline void gen_neon_widen(TCGv_i64 dest, TCGv src, int size, int u)

{

    if (u) {

        switch (size) {

        case 0: gen_helper_neon_widen_u8(dest, src); break;

        case 1: gen_helper_neon_widen_u16(dest, src); break;

        case 2: tcg_gen_extu_i32_i64(dest, src); break;

        default: abort();

        }

    } else {

        switch (size) {

        case 0: gen_helper_neon_widen_s8(dest, src); break;

        case 1: gen_helper_neon_widen_s16(dest, src); break;

        case 2: tcg_gen_ext_i32_i64(dest, src); break;

        default: abort();

        }

    }

    dead_tmp(src);

}