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

         flags |= PAGE_WRITE_ORG;

+    for(addr = start; addr < end; addr += TARGET_PAGE_SIZE) {
+
+        p = page_find_alloc(addr >> TARGET_PAGE_BITS);
+
+        /* We may be called for host regions that are outside guest

            address space.  */

void page_set_flags(target_ulong start, target_ulong end, int flags)

{

    PageDesc *p;

    target_ulong addr;

    /* mmap_lock should already be held.  */

    start = start & TARGET_PAGE_MASK;

    end = TARGET_PAGE_ALIGN(end);

    if (flags & PAGE_WRITE)

        flags |= PAGE_WRITE_ORG;

    for(addr = start; addr < end; addr += TARGET_PAGE_SIZE) {

        p = page_find_alloc(addr >> TARGET_PAGE_BITS);

        /* We may be called for host regions that are outside guest

           address space.  */

        if (!p)

            return;

        /* if the write protection is set, then we invalidate the code

           inside */

        if (!(p->flags & PAGE_WRITE) &&

            (flags & PAGE_WRITE) &&

            p->first_tb) {

            tb_invalidate_phys_page(addr, 0, NULL);

        }

        p->flags = flags;

    }

}


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

 {

+    qemu_set_fd_handler2(s->fd,
+
+                         s->read_poll  ? net_socket_can_send : NULL,

                          s->read_poll  ? s->send_fn : NULL,

static void net_socket_update_fd_handler(NetSocketState *s)

{

    qemu_set_fd_handler2(s->fd,

                         s->read_poll  ? net_socket_can_send : NULL,

                         s->read_poll  ? s->send_fn : NULL,

                         s->write_poll ? net_socket_writable : NULL,

                         s);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 gen_set_condexec (DisasContext *s)

 {
+
     if (s->condexec_mask) {

         uint32_t val = (s->condexec_cond << 4) | (s->condexec_mask >> 1);

gen_set_condexec (DisasContext *s)

{

    if (s->condexec_mask) {

        uint32_t val = (s->condexec_cond << 4) | (s->condexec_mask >> 1);

        TCGv tmp = new_tmp();

        tcg_gen_movi_i32(tmp, val);

        store_cpu_field(tmp, condexec_bits);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 void tcg_op_remove(TCGContext *s, TCGOp *op)
+
+{
+
+    int next = op->next;
+
+    int prev = op->prev;

+

     /* We should never attempt to remove the list terminator.  */

void tcg_op_remove(TCGContext *s, TCGOp *op)

{

    int next = op->next;

    int prev = op->prev;

    /* We should never attempt to remove the list terminator.  */

    tcg_debug_assert(op != &s->gen_op_buf[0]);

    s->gen_op_buf[next].prev = prev;

    s->gen_op_buf[prev].next = next;

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

#ifdef CONFIG_PROFILER

    atomic_set(&s->prof.del_op_count, s->prof.del_op_count + 1);

#endif

}


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

     gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

 #else

+    TCGv t0;

     if (unlikely(ctx->pr)) {

static void gen_mtsr_64b(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

#else

    TCGv t0;

    if (unlikely(ctx->pr)) {

        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

        return;

    }

    t0 = tcg_const_tl(SR(ctx->opcode));

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

    tcg_temp_free(t0);

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int nvme_start_ctrl(NvmeCtrl *n)

 {
+
     uint32_t page_bits = NVME_CC_MPS(n->bar.cc) + 12;

     uint32_t page_size = 1 << page_bits;

static int nvme_start_ctrl(NvmeCtrl *n)

{

    uint32_t page_bits = NVME_CC_MPS(n->bar.cc) + 12;

    uint32_t page_size = 1 << page_bits;

    if (n->cq[0] || n->sq[0] || !n->bar.asq || !n->bar.acq ||

            n->bar.asq & (page_size - 1) || n->bar.acq & (page_size - 1) ||

            NVME_CC_MPS(n->bar.cc) < NVME_CAP_MPSMIN(n->bar.cap) ||

            NVME_CC_MPS(n->bar.cc) > NVME_CAP_MPSMAX(n->bar.cap) ||

            NVME_CC_IOCQES(n->bar.cc) < NVME_CTRL_CQES_MIN(n->id_ctrl.cqes) ||

            NVME_CC_IOCQES(n->bar.cc) > NVME_CTRL_CQES_MAX(n->id_ctrl.cqes) ||

            NVME_CC_IOSQES(n->bar.cc) < NVME_CTRL_SQES_MIN(n->id_ctrl.sqes) ||

            NVME_CC_IOSQES(n->bar.cc) > NVME_CTRL_SQES_MAX(n->id_ctrl.sqes) ||

            !NVME_AQA_ASQS(n->bar.aqa) || !NVME_AQA_ACQS(n->bar.aqa)) {

        return -1;

    }

    n->page_bits = page_bits;

    n->page_size = page_size;

    n->max_prp_ents = n->page_size / sizeof(uint64_t);

    n->cqe_size = 1 << NVME_CC_IOCQES(n->bar.cc);

    n->sqe_size = 1 << NVME_CC_IOSQES(n->bar.cc);

    nvme_init_cq(&n->admin_cq, n, n->bar.acq, 0, 0,

        NVME_AQA_ACQS(n->bar.aqa) + 1, 1);

    nvme_init_sq(&n->admin_sq, n, n->bar.asq, 0, 0,

        NVME_AQA_ASQS(n->bar.aqa) + 1);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static inline void gen_op_jz_ecx(TCGMemOp size, int label1)

 {
+
+    tcg_gen_mov_tl(cpu_tmp0, cpu_regs[R_ECX]);

     gen_extu(size, cpu_tmp0);

static inline void gen_op_jz_ecx(TCGMemOp size, int label1)

{

    tcg_gen_mov_tl(cpu_tmp0, cpu_regs[R_ECX]);

    gen_extu(size, cpu_tmp0);

    tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_tmp0, 0, label1);

}


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

 {
+
     video_channel = strtol(arg, NULL, 0);

 }

static void opt_video_channel(const char *arg)

{

    video_channel = strtol(arg, NULL, 0);

}


--- a/source.c
+++ b/source.c
@@ -9,9 +9,9 @@
     qdict = g_malloc0(sizeof(*qdict));

     QOBJECT_INIT(qdict, &qdict_type);
+
+
+
+    return qdict;

 }

QDict *qdict_new(void)

{

    QDict *qdict;

    qdict = g_malloc0(sizeof(*qdict));

    QOBJECT_INIT(qdict, &qdict_type);

    return qdict;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void xlnx_zynqmp_class_init(ObjectClass *oc, void *data)
 {
+    DeviceClass *dc = DEVICE_CLASS(oc);
     dc->props = xlnx_zynqmp_props;
     dc->realize = xlnx_zynqmp_realize;
 }

static void xlnx_zynqmp_class_init(ObjectClass *oc, void *data)
{
    DeviceClass *dc = DEVICE_CLASS(oc);
    dc->props = xlnx_zynqmp_props;
    dc->realize = xlnx_zynqmp_realize;
}


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

     ctx->poll_max_ns = max_ns;
+
+    ctx->poll_ns = 0;
+
+    ctx->poll_grow = grow;
+
     ctx->poll_shrink = shrink;

void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns,

                                 int64_t grow, int64_t shrink, Error **errp)

{

    /* No thread synchronization here, it doesn't matter if an incorrect value

     * is used once.

     */

    ctx->poll_max_ns = max_ns;

    ctx->poll_ns = 0;

    ctx->poll_grow = grow;

    ctx->poll_shrink = shrink;

    aio_notify(ctx);

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width)
+
+{
+
 #ifdef HAVE_MMX
+
+	asm volatile(

+		"movq "MANGLE(bm01010101)", %%mm4\n\t"

 		"mov %0, %%"REG_a"		\n\t"

static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width)

{

#ifdef HAVE_MMX

	asm volatile(

		"movq "MANGLE(bm01010101)", %%mm4\n\t"

		"mov %0, %%"REG_a"		\n\t"

		"1:				\n\t"

		"movq (%1, %%"REG_a",4), %%mm0	\n\t"

		"movq 8(%1, %%"REG_a",4), %%mm1	\n\t"

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

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

		"packuswb %%mm1, %%mm0		\n\t"

		"movq %%mm0, %%mm1		\n\t"

		"psrlw $8, %%mm0		\n\t"

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

		"packuswb %%mm0, %%mm0		\n\t"

		"packuswb %%mm1, %%mm1		\n\t"

		"movd %%mm0, (%3, %%"REG_a")	\n\t"

		"movd %%mm1, (%2, %%"REG_a")	\n\t"

		"add $4, %%"REG_a"		\n\t"

		" js 1b				\n\t"

		: : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width)

		: "%"REG_a

	);

#else

	int i;

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

	{

		dstU[i]= src1[4*i + 0];

		dstV[i]= src1[4*i + 2];

	}

#endif

        assert(src1 == src2);

}


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

     if ((vs->clientds.flags & QEMU_BIG_ENDIAN_FLAG) ==
+
+        (vs->ds->surface->flags & QEMU_BIG_ENDIAN_FLAG)) {
+
+        rshift = vs->clientds.pf.rshift;
+
         gshift = vs->clientds.pf.gshift;

         bshift = vs->clientds.pf.bshift;

static void tight_pack24(VncState *vs, uint8_t *buf, size_t count, size_t *ret)

{

    uint32_t *buf32;

    uint32_t pix;

    int rshift, gshift, bshift;

    buf32 = (uint32_t *)buf;

    if ((vs->clientds.flags & QEMU_BIG_ENDIAN_FLAG) ==

        (vs->ds->surface->flags & QEMU_BIG_ENDIAN_FLAG)) {

        rshift = vs->clientds.pf.rshift;

        gshift = vs->clientds.pf.gshift;

        bshift = vs->clientds.pf.bshift;

    } else {

        rshift = 24 - vs->clientds.pf.rshift;

        gshift = 24 - vs->clientds.pf.gshift;

        bshift = 24 - vs->clientds.pf.bshift;

    }

    if (ret) {

        *ret = count * 3;

    }

    while (count--) {

        pix = *buf32++;

        *buf++ = (char)(pix >> rshift);

        *buf++ = (char)(pix >> gshift);

        *buf++ = (char)(pix >> bshift);

    }

}


--- a/source.c
+++ b/source.c
@@ -9,10 +9,10 @@
     for (i = 0; registered_avfilters[i]; i++)

         if (!strcmp(registered_avfilters[i]->name, name))
+
+            return registered_avfilters[i];
+
+

     return NULL;

AVFilter *avfilter_get_by_name(const char *name)

{

    int i;

    for (i = 0; registered_avfilters[i]; i++)

        if (!strcmp(registered_avfilters[i]->name, name))

            return registered_avfilters[i];

    return NULL;

}


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

         fd = qemu_open(tpm_pt->options->cancel_path, O_WRONLY);

+        if (fd < 0) {
+
             error_report("Could not open TPM cancel path : %s",

                          strerror(errno));

static int tpm_passthrough_open_sysfs_cancel(TPMPassthruState *tpm_pt)

{

    int fd = -1;

    char *dev;

    char path[PATH_MAX];

    if (tpm_pt->options->cancel_path) {

        fd = qemu_open(tpm_pt->options->cancel_path, O_WRONLY);

        if (fd < 0) {

            error_report("Could not open TPM cancel path : %s",

                         strerror(errno));

        }

        return fd;

    }

    dev = strrchr(tpm_pt->tpm_dev, '/');

    if (dev) {

        dev++;

        if (snprintf(path, sizeof(path), "/sys/class/misc/%s/device/cancel",

                     dev) < sizeof(path)) {

            fd = qemu_open(path, O_WRONLY);

            if (fd >= 0) {

                tpm_pt->options->cancel_path = g_strdup(path);

            } else {

                error_report("tpm_passthrough: Could not open TPM cancel "

                             "path %s : %s", path, strerror(errno));

            }

        }

    } else {

       error_report("tpm_passthrough: Bad TPM device path %s",

                    tpm_pt->tpm_dev);

    }

    return fd;

}


--- a/source.c
+++ b/source.c
@@ -5,5 +5,5 @@
     j_rev_dct_ARM (block);

     add_pixels_clamped(block, dest, line_size);
+
+}

static void arm_idct_add(UINT8 *dest, int line_size, DCTELEM *block)

{

    j_rev_dct_ARM (block);

    add_pixels_clamped(block, dest, line_size);

}


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

+
     {

         Visitor *v = opts_visitor_new(opts);

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

         visit_free(v);

     }

+
+
     if (err) {
+
         goto error;

     }

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

{

    NumaOptions *object = NULL;

    Error *err = NULL;

    {

        Visitor *v = opts_visitor_new(opts);

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

        visit_free(v);

    }

    if (err) {

        goto error;

    }

    switch (object->type) {

    case NUMA_OPTIONS_KIND_NODE:

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

        if (err) {

            goto error;

        }

        nb_numa_nodes++;

        break;

    default:

        abort();

    }

    return 0;

error:

    error_report_err(err);

    qapi_free_NumaOptions(object);

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     int stat_all = 0;

     int i;
+
+    int best_score = 0;
+
+
+
     memset(stat, 0, packet_size * sizeof(*stat));

static int analyze(const uint8_t *buf, int size, int packet_size, int *index,

                   int probe)

{

    int stat[TS_MAX_PACKET_SIZE];

    int stat_all = 0;

    int i;

    int best_score = 0;

    memset(stat, 0, packet_size * sizeof(*stat));

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

        if (buf[i] == 0x47 &&

            (!probe || (!(buf[i + 1] & 0x80) && buf[i + 3] != 0x47))) {

            int x = i % packet_size;

            stat[x]++;

            stat_all++;

            if (stat[x] > best_score) {

                best_score = stat[x];

                if (index)

                    *index = x;

            }

        }

    }

    return best_score - FFMAX(stat_all - 10*best_score, 0)/10;

}


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

                        uint8_t *buf, int len, bool fixed)

+{

     SCSISense sense;

+    bool fixed_in;
+

     fixed_in = (in_buf[0] & 2) == 0;
+
     if (in_len && fixed == fixed_in) {

         memcpy(buf, in_buf, MIN(len, in_len));

int scsi_convert_sense(uint8_t *in_buf, int in_len,

                       uint8_t *buf, int len, bool fixed)

{

    SCSISense sense;

    bool fixed_in;

    fixed_in = (in_buf[0] & 2) == 0;

    if (in_len && fixed == fixed_in) {

        memcpy(buf, in_buf, MIN(len, in_len));

        return MIN(len, in_len);

    }

    if (in_len == 0) {

        sense = SENSE_CODE(NO_SENSE);

    } else {

        sense = scsi_parse_sense_buf(in_buf, in_len);

    }

    return scsi_build_sense_buf(buf, len, sense, fixed);

}


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

     clear_float_exceptions(env);
+
+    QT0 = float128_sqrt(QT1, &env->fp_status);

     check_ieee_exceptions(env);

void helper_fsqrtq(CPUSPARCState *env)

{

    clear_float_exceptions(env);

    QT0 = float128_sqrt(QT1, &env->fp_status);

    check_ieee_exceptions(env);

}


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

     return blk_cfg.blk_size;
+
 }

int virtio_get_block_size(void)

{

    return blk_cfg.blk_size;

}


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

     do_addeo();

PPC_OP(addeo)

{

    do_addeo();

    RETURN();

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+void QEMU_NORETURN do_unassigned_access(target_phys_addr_t addr, int is_write,

                                         int is_exec, int unused, int size)

void QEMU_NORETURN do_unassigned_access(target_phys_addr_t addr, int is_write,

                                        int is_exec, int unused, int size)

{

    env->trap_arg0 = addr;

    env->trap_arg1 = is_write;

    dynamic_excp(EXCP_MCHK, 0);

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
+int ff_lock_avcodec(AVCodecContext *log_ctx, const AVCodec *codec)
+
+{
+
+    if (codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE || !codec->init)
+
+        return 0;
+

+
+    if (ff_mutex_lock(&codec_mutex))
+
         return -1;

int ff_lock_avcodec(AVCodecContext *log_ctx, const AVCodec *codec)

{

    if (codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE || !codec->init)

        return 0;

    if (ff_mutex_lock(&codec_mutex))

        return -1;

    if (atomic_fetch_add(&entangled_thread_counter, 1)) {

        av_log(log_ctx, AV_LOG_ERROR,

               "Insufficient thread locking. At least %d threads are "

               "calling avcodec_open2() at the same time right now.\n",

               atomic_load(&entangled_thread_counter));

        ff_avcodec_locked = 1;

        ff_unlock_avcodec(codec);

        return AVERROR(EINVAL);

    }

    av_assert0(!ff_avcodec_locked);

    ff_avcodec_locked = 1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
                               AVFormatContext *s)

 {
+
+    offset_t pos = url_ftell(pb);
+
+    int i;
+

     put_be32(pb, 0); /* size */

static int mov_write_udta_tag(ByteIOContext *pb, MOVContext* mov,

                              AVFormatContext *s)

{

    offset_t pos = url_ftell(pb);

    int i;

    put_be32(pb, 0); /* size */

    put_tag(pb, "udta");

    /* iTunes meta data */

    mov_write_meta_tag(pb, mov, s);

  if(mov->mode == MODE_MOV){ // the title field breaks gtkpod with mp4 and my suspicion is that stuff isnt valid in mp4

    /* Requirements */

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

        if(mov->tracks[i].entry <= 0) continue;

        if (mov->tracks[i].enc->codec_id == CODEC_ID_AAC ||

            mov->tracks[i].enc->codec_id == CODEC_ID_MPEG4) {

            mov_write_string_tag(pb, "\251req", "QuickTime 6.0 or greater", 0);

            break;

        }

    }

    mov_write_string_tag(pb, "\251nam", s->title         , 0);

    mov_write_string_tag(pb, "\251aut", s->author        , 0);

    mov_write_string_tag(pb, "\251alb", s->album         , 0);

    mov_write_day_tag(pb, s->year, 0);

    if(mov->tracks[0].enc && !(mov->tracks[0].enc->flags & CODEC_FLAG_BITEXACT))

        mov_write_string_tag(pb, "\251enc", LIBAVFORMAT_IDENT, 0);

    mov_write_string_tag(pb, "\251des", s->comment       , 0);

    mov_write_string_tag(pb, "\251gen", s->genre         , 0);

  }

    return updateSize(pb, pos);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void pci_device_reset(PCIDevice *dev)

+{

     int r;

static void pci_device_reset(PCIDevice *dev)

{

    int r;

    memset(dev->irq_state, 0, sizeof dev->irq_state);

    dev->config[PCI_COMMAND] &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY |

                                  PCI_COMMAND_MASTER);

    dev->config[PCI_CACHE_LINE_SIZE] = 0x0;

    dev->config[PCI_INTERRUPT_LINE] = 0x0;

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

        if (!dev->io_regions[r].size) {

            continue;

        }

        pci_set_long(dev->config + pci_bar(dev, r), dev->io_regions[r].type);

    }

    pci_update_mappings(dev);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void print_pte(Monitor *mon, uint32_t addr, uint32_t pte, uint32_t mask)
+
 {

     monitor_printf(mon, "%08x: %08x %c%c%c%c%c%c%c%c\n",

static void print_pte(Monitor *mon, uint32_t addr, uint32_t pte, uint32_t mask)

{

    monitor_printf(mon, "%08x: %08x %c%c%c%c%c%c%c%c\n",

                   addr,

                   pte & mask,

                   pte & PG_GLOBAL_MASK ? 'G' : '-',

                   pte & PG_PSE_MASK ? 'P' : '-',

                   pte & PG_DIRTY_MASK ? 'D' : '-',

                   pte & PG_ACCESSED_MASK ? 'A' : '-',

                   pte & PG_PCD_MASK ? 'C' : '-',

                   pte & PG_PWT_MASK ? 'T' : '-',

                   pte & PG_USER_MASK ? 'U' : '-',

                   pte & PG_RW_MASK ? 'W' : '-');

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void dnxhd_decode_dct_block_8(const DNXHDContext *ctx,
+
                                      RowContext *row, int n)

 {

static void dnxhd_decode_dct_block_8(const DNXHDContext *ctx,

                                     RowContext *row, int n)

{

    dnxhd_decode_dct_block(ctx, row, n, 4, 32, 6);

}


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

     }

+
+
+    cd.type = KVM_DEV_TYPE_FLIC;
+
+    ret = kvm_vm_ioctl(kvm_state, KVM_CREATE_DEVICE, &cd);

     if (ret < 0) {

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

{

    S390FLICState *fs = S390_FLIC_COMMON(dev);

    KVMS390FLICState *flic_state = KVM_S390_FLIC(dev);

    struct kvm_create_device cd = {0};

    struct kvm_device_attr test_attr = {0};

    int ret;

    Error *errp_local = NULL;

    KVM_S390_FLIC_GET_CLASS(dev)->parent_realize(dev, &errp_local);

    if (errp_local) {

        goto fail;

    }

    flic_state->fd = -1;

    if (!kvm_check_extension(kvm_state, KVM_CAP_DEVICE_CTRL)) {

        error_setg_errno(&errp_local, errno, "KVM is missing capability"

                         " KVM_CAP_DEVICE_CTRL");

        trace_flic_no_device_api(errno);

        goto fail;

    }

    cd.type = KVM_DEV_TYPE_FLIC;

    ret = kvm_vm_ioctl(kvm_state, KVM_CREATE_DEVICE, &cd);

    if (ret < 0) {

        error_setg_errno(&errp_local, errno, "Creating the KVM device failed");

        trace_flic_create_device(errno);

        goto fail;

    }

    flic_state->fd = cd.fd;

    /* Check clear_io_irq support */

    test_attr.group = KVM_DEV_FLIC_CLEAR_IO_IRQ;

    flic_state->clear_io_supported = !ioctl(flic_state->fd,

                                            KVM_HAS_DEVICE_ATTR, test_attr);

    fs->ais_supported = false;

    return;

fail:

    error_propagate(errp, errp_local);

}


--- a/source.c
+++ b/source.c
@@ -1,24 +1,24 @@
+static int write_representation(AVFormatContext *s, AVStream *stream, int id,

                                 int output_width, int output_height,

                                 int output_sample_rate) {

+    AVDictionaryEntry *irange = av_dict_get(stream->metadata, INITIALIZATION_RANGE, NULL, 0);

     AVDictionaryEntry *cues_start = av_dict_get(stream->metadata, CUES_START, NULL, 0);
+
+    AVDictionaryEntry *cues_end = av_dict_get(stream->metadata, CUES_END, NULL, 0);

     AVDictionaryEntry *filename = av_dict_get(stream->metadata, FILENAME, NULL, 0);

+    AVDictionaryEntry *bandwidth = av_dict_get(stream->metadata, BANDWIDTH, NULL, 0);
+
+    if (!irange || cues_start == NULL || cues_end == NULL || filename == NULL ||
+
+        !bandwidth) {
+
+        return -1;

     }

static int write_representation(AVFormatContext *s, AVStream *stream, int id,

                                int output_width, int output_height,

                                int output_sample_rate) {

    AVDictionaryEntry *irange = av_dict_get(stream->metadata, INITIALIZATION_RANGE, NULL, 0);

    AVDictionaryEntry *cues_start = av_dict_get(stream->metadata, CUES_START, NULL, 0);

    AVDictionaryEntry *cues_end = av_dict_get(stream->metadata, CUES_END, NULL, 0);

    AVDictionaryEntry *filename = av_dict_get(stream->metadata, FILENAME, NULL, 0);

    AVDictionaryEntry *bandwidth = av_dict_get(stream->metadata, BANDWIDTH, NULL, 0);

    if (!irange || cues_start == NULL || cues_end == NULL || filename == NULL ||

        !bandwidth) {

        return -1;

    }

    avio_printf(s->pb, "<Representation id=\"%d\"", id);

    avio_printf(s->pb, " bandwidth=\"%s\"", bandwidth->value);

    if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO && output_width)

        avio_printf(s->pb, " width=\"%d\"", stream->codec->width);

    if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO && output_height)

        avio_printf(s->pb, " height=\"%d\"", stream->codec->height);

    if (stream->codec->codec_type = AVMEDIA_TYPE_AUDIO && output_sample_rate)

        avio_printf(s->pb, " audioSamplingRate=\"%d\"", stream->codec->sample_rate);

    avio_printf(s->pb, ">\n");

    avio_printf(s->pb, "<BaseURL>%s</BaseURL>\n", filename->value);

    avio_printf(s->pb, "<SegmentBase\n");

    avio_printf(s->pb, "  indexRange=\"%s-%s\">\n", cues_start->value, cues_end->value);

    avio_printf(s->pb, "<Initialization\n");

    avio_printf(s->pb, "  range=\"0-%s\" />\n", irange->value);

    avio_printf(s->pb, "</SegmentBase>\n");

    avio_printf(s->pb, "</Representation>\n");

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     const char *str = "";

     char f = 'X';
+
+    const char *endptr = &f;
+
     uint64_t res = 999;

     int err;

static void test_qemu_strtoull_empty(void)

{

    const char *str = "";

    char f = 'X';

    const char *endptr = &f;

    uint64_t res = 999;

    int err;

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

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, 0);

    g_assert(endptr == str);

}


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

     memory_region_destroy(&s->mmio);

+
+
+    timer_del(s->watchdog);
+
+    timer_free(s->watchdog);

static void nic_cleanup(NetClientState *nc)

{

    dp8393xState *s = qemu_get_nic_opaque(nc);

    memory_region_del_subregion(s->address_space, &s->mmio);

    memory_region_destroy(&s->mmio);

    timer_del(s->watchdog);

    timer_free(s->watchdog);

    g_free(s);

}


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

+{

     rc4030State *s = RC4030(dev);

     int i;
+

     s->config = 0x410; /* some boards seem to accept 0x104 too */

static void rc4030_reset(DeviceState *dev)

{

    rc4030State *s = RC4030(dev);

    int i;

    s->config = 0x410; /* some boards seem to accept 0x104 too */

    s->revision = 1;

    s->invalid_address_register = 0;

    memset(s->dma_regs, 0, sizeof(s->dma_regs));

    rc4030_dma_tt_update(s, 0, 0);

    s->remote_failed_address = s->memory_failed_address = 0;

    s->cache_maint = 0;

    s->cache_ptag = s->cache_ltag = 0;

    s->cache_bmask = 0;

    s->memory_refresh_rate = 0x18186;

    s->nvram_protect = 7;

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

        s->rem_speed[i] = 7;

    s->imr_jazz = 0x10; /* XXX: required by firmware, but why? */

    s->isr_jazz = 0;

    s->itr = 0;

    qemu_irq_lower(s->timer_irq);

    qemu_irq_lower(s->jazz_bus_irq);

}


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

+{

+    Coroutine *co;

static void do_order_test(void)

{

    Coroutine *co;

    co = qemu_coroutine_create(co_order_test);

    record_push(1, 1);

    qemu_coroutine_enter(co, NULL);

    record_push(1, 2);

    g_assert(!qemu_in_coroutine());

    qemu_coroutine_enter(co, NULL);

    record_push(1, 3);

    g_assert(!qemu_in_coroutine());

}


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

     gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
@@ -12,7 +12,7 @@

         gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

+        return;

     }

static void gen_tlbre_40x(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

#else

    if (unlikely(ctx->pr)) {

        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

        return;

    }

    switch (rB(ctx->opcode)) {

    case 0:

        gen_helper_4xx_tlbre_hi(cpu_gpr[rD(ctx->opcode)], cpu_env,

                                cpu_gpr[rA(ctx->opcode)]);

        break;

    case 1:

        gen_helper_4xx_tlbre_lo(cpu_gpr[rD(ctx->opcode)], cpu_env,

                                cpu_gpr[rA(ctx->opcode)]);

        break;

    default:

        gen_inval_exception(ctx, POWERPC_EXCP_INVAL_INVAL);

        break;

    }

#endif

}


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

 #endif

+#if CONFIG_HEVC_VAAPI_HWACCEL
+
+        *fmt++ = AV_PIX_FMT_VAAPI;
+
+#endif

         break;

static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)

{

    #define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VAAPI_HWACCEL + CONFIG_HEVC_VDPAU_HWACCEL)

    enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;

    switch (sps->pix_fmt) {

    case AV_PIX_FMT_YUV420P:

    case AV_PIX_FMT_YUVJ420P:

#if CONFIG_HEVC_DXVA2_HWACCEL

        *fmt++ = AV_PIX_FMT_DXVA2_VLD;

#endif

#if CONFIG_HEVC_D3D11VA_HWACCEL

        *fmt++ = AV_PIX_FMT_D3D11VA_VLD;

#endif

#if CONFIG_HEVC_VAAPI_HWACCEL

        *fmt++ = AV_PIX_FMT_VAAPI;

#endif

#if CONFIG_HEVC_VDPAU_HWACCEL

        *fmt++ = AV_PIX_FMT_VDPAU;

#endif

        break;

    case AV_PIX_FMT_YUV420P10:

#if CONFIG_HEVC_DXVA2_HWACCEL

        *fmt++ = AV_PIX_FMT_DXVA2_VLD;

#endif

#if CONFIG_HEVC_D3D11VA_HWACCEL

        *fmt++ = AV_PIX_FMT_D3D11VA_VLD;

#endif

#if CONFIG_HEVC_VAAPI_HWACCEL

        *fmt++ = AV_PIX_FMT_VAAPI;

#endif

        break;

    }

    *fmt++ = sps->pix_fmt;

    *fmt = AV_PIX_FMT_NONE;

    return ff_thread_get_format(s->avctx, pix_fmts);

}


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

+    s->num_coeff_partitions = 1 << vp8_rac_get_uint(&s->c, 2);

+    buf      += 3 * (s->num_coeff_partitions - 1);
+
     buf_size -= 3 * (s->num_coeff_partitions - 1);

     if (buf_size < 0)

static int setup_partitions(VP8Context *s, const uint8_t *buf, int buf_size)

{

    const uint8_t *sizes = buf;

    int i;

    s->num_coeff_partitions = 1 << vp8_rac_get_uint(&s->c, 2);

    buf      += 3 * (s->num_coeff_partitions - 1);

    buf_size -= 3 * (s->num_coeff_partitions - 1);

    if (buf_size < 0)

        return -1;

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

        int size = AV_RL24(sizes + 3 * i);

        if (buf_size - size < 0)

            return -1;

        ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, size);

        buf      += size;

        buf_size -= size;

    }

    ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, buf_size);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static int get_slice_offset(AVCodecContext *avctx, const uint8_t *buf, int n)
+
+{

     if(avctx->slice_count) return avctx->slice_offset[n];

static int get_slice_offset(AVCodecContext *avctx, const uint8_t *buf, int n)

{

    if(avctx->slice_count) return avctx->slice_offset[n];

    else                   return AV_RL32(buf + n*8 - 4) == 1 ? AV_RL32(buf + n*8) :  AV_RB32(buf + n*8);

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 static coroutine_fn void test_multi_co_schedule_entry(void *opaque)

+{

     g_assert(to_schedule[id] == NULL);

     atomic_mb_set(&to_schedule[id], qemu_coroutine_self());
+
+

     while (!atomic_mb_read(&now_stopping)) {

static coroutine_fn void test_multi_co_schedule_entry(void *opaque)

{

    g_assert(to_schedule[id] == NULL);

    atomic_mb_set(&to_schedule[id], qemu_coroutine_self());

    while (!atomic_mb_read(&now_stopping)) {

        int n;

        n = g_test_rand_int_range(0, NUM_CONTEXTS);

        schedule_next(n);

        qemu_coroutine_yield();

        g_assert(to_schedule[id] == NULL);

        atomic_mb_set(&to_schedule[id], qemu_coroutine_self());

    }

}


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

     avctx->coded_frame->key_frame = 1;

+
+
+    return 0;
+
+}

static av_cold int pcx_encode_init(AVCodecContext *avctx)

{

    avctx->coded_frame = av_frame_alloc();

    if (!avctx->coded_frame)

        return AVERROR(ENOMEM);

    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;

    avctx->coded_frame->key_frame = 1;

    return 0;

}


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

     /*

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

      * functions for the specific versioned machine types can override

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

{

    MachineClass *mc = MACHINE_CLASS(oc);

    sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(oc);

    FWPathProviderClass *fwc = FW_PATH_PROVIDER_CLASS(oc);

    NMIClass *nc = NMI_CLASS(oc);

    HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);

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

    /*

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

     * functions for the specific versioned machine types can override

     * these details for backwards compatibility

     */

    mc->init = ppc_spapr_init;

    mc->reset = ppc_spapr_reset;

    mc->block_default_type = IF_SCSI;

    mc->max_cpus = MAX_CPUMASK_BITS;

    mc->no_parallel = 1;

    mc->default_boot_order = "";

    mc->default_ram_size = 512 * M_BYTE;

    mc->kvm_type = spapr_kvm_type;

    mc->has_dynamic_sysbus = true;

    mc->pci_allow_0_address = true;

    mc->get_hotplug_handler = spapr_get_hotpug_handler;

    hc->pre_plug = spapr_machine_device_pre_plug;

    hc->plug = spapr_machine_device_plug;

    hc->unplug = spapr_machine_device_unplug;

    mc->cpu_index_to_socket_id = spapr_cpu_index_to_socket_id;

    mc->query_hotpluggable_cpus = spapr_query_hotpluggable_cpus;

    smc->dr_lmb_enabled = true;

    smc->dr_cpu_enabled = true;

    fwc->get_dev_path = spapr_get_fw_dev_path;

    nc->nmi_monitor_handler = spapr_nmi;

}


--- a/source.c
+++ b/source.c
@@ -1,25 +1,25 @@
 void ff_slice_thread_free(AVCodecContext *avctx)

+{
+
+    SliceThreadContext *c = avctx->internal->thread_ctx;
+
+    int i;
+
+
+
+    pthread_mutex_lock(&c->current_job_lock);

     c->done = 1;

     pthread_cond_broadcast(&c->current_job_cond);
+
+    for (i = 0; i < c->thread_count; i++)
+
         pthread_cond_broadcast(&c->progress_cond[i]);

     pthread_mutex_unlock(&c->current_job_lock);
+

     for (i=0; i<avctx->thread_count; i++)

void ff_slice_thread_free(AVCodecContext *avctx)

{

    SliceThreadContext *c = avctx->internal->thread_ctx;

    int i;

    pthread_mutex_lock(&c->current_job_lock);

    c->done = 1;

    pthread_cond_broadcast(&c->current_job_cond);

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

        pthread_cond_broadcast(&c->progress_cond[i]);

    pthread_mutex_unlock(&c->current_job_lock);

    for (i=0; i<avctx->thread_count; i++)

         pthread_join(c->workers[i], NULL);

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

        pthread_mutex_destroy(&c->progress_mutex[i]);

        pthread_cond_destroy(&c->progress_cond[i]);

    }

    pthread_mutex_destroy(&c->current_job_lock);

    pthread_cond_destroy(&c->current_job_cond);

    pthread_cond_destroy(&c->last_job_cond);

    av_freep(&c->entries);

    av_freep(&c->progress_mutex);

    av_freep(&c->progress_cond);

    av_freep(&c->workers);

    av_freep(&avctx->internal->thread_ctx);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int acpi_checksum(const uint8_t *data, int len)

 {
+
+    int sum, i;
+
     sum = 0;

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

static int acpi_checksum(const uint8_t *data, int len)

{

    int sum, i;

    sum = 0;

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

        sum += data[i];

    return (-sum) & 0xff;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int64_t ffm_read_write_index(int fd)

 {
+
+    uint8_t buf[8];
+
+

     lseek(fd, 8, SEEK_SET);

static int64_t ffm_read_write_index(int fd)

{

    uint8_t buf[8];

    lseek(fd, 8, SEEK_SET);

    if (read(fd, buf, 8) != 8)

        return AVERROR(EIO);

    return AV_RB64(buf);

}


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

     uint64_t offset_in_cluster, extent_begin_offset, extent_relative_offset;

+    uint64_t cluster_size = extent->cluster_sectors * BDRV_SECTOR_SIZE;
+
+
+
+    extent_begin_offset =

         (extent->end_sector - extent->sectors) * BDRV_SECTOR_SIZE;

static inline uint64_t vmdk_find_offset_in_cluster(VmdkExtent *extent,

                                                   int64_t offset)

{

    uint64_t offset_in_cluster, extent_begin_offset, extent_relative_offset;

    uint64_t cluster_size = extent->cluster_sectors * BDRV_SECTOR_SIZE;

    extent_begin_offset =

        (extent->end_sector - extent->sectors) * BDRV_SECTOR_SIZE;

    extent_relative_offset = offset - extent_begin_offset;

    offset_in_cluster = extent_relative_offset % cluster_size;

    return offset_in_cluster;

}


--- a/source.c
+++ b/source.c
@@ -15,9 +15,9 @@
     }

+
+    trace_qmp_block_job_resume(job);
+
+    block_job_resume(job);
+
 }

void qmp_block_job_resume(const char *device, Error **errp)

{

    BlockJob *job = find_block_job(device);

    if (!job) {

        error_set(errp, QERR_BLOCK_JOB_NOT_ACTIVE, device);

        return;

    }

    trace_qmp_block_job_resume(job);

    block_job_resume(job);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err)

+{

     return guest_fsfreeze_state.status;

GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err)

{

    return guest_fsfreeze_state.status;

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
     while (snr_offset >= 0 &&

            bit_alloc(s, snr_offset) > bits_left) {
+
+        snr_offset -= 64;
+
+    }
+
     if (snr_offset < 0)

         return AVERROR(EINVAL);

static int cbr_bit_allocation(AC3EncodeContext *s)

{

    int ch;

    int bits_left;

    int snr_offset, snr_incr;

    bits_left = 8 * s->frame_size - (s->frame_bits + s->exponent_bits);

    snr_offset = s->coarse_snr_offset << 4;

    while (snr_offset >= 0 &&

           bit_alloc(s, snr_offset) > bits_left) {

        snr_offset -= 64;

    }

    if (snr_offset < 0)

        return AVERROR(EINVAL);

    FFSWAP(uint8_t *, s->bap_buffer, s->bap1_buffer);

    for (snr_incr = 64; snr_incr > 0; snr_incr >>= 2) {

        while (snr_offset + 64 <= 1023 &&

               bit_alloc(s, snr_offset + snr_incr) <= bits_left) {

            snr_offset += snr_incr;

            FFSWAP(uint8_t *, s->bap_buffer, s->bap1_buffer);

        }

    }

    FFSWAP(uint8_t *, s->bap_buffer, s->bap1_buffer);

    reset_block_bap(s);

    s->coarse_snr_offset = snr_offset >> 4;

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

        s->fine_snr_offset[ch] = snr_offset & 0xF;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
 void qemu_thread_create(QemuThread *thread,

+                       void *(*start_routine)(void *),

                        void *arg, int mode)

+{

     HANDLE hThread;
+

     assert(mode == QEMU_THREAD_DETACHED);

void qemu_thread_create(QemuThread *thread,

                       void *(*start_routine)(void *),

                       void *arg, int mode)

{

    HANDLE hThread;

    assert(mode == QEMU_THREAD_DETACHED);

    struct QemuThreadData *data;

    qemu_thread_init();

    data = g_malloc(sizeof *data);

    data->thread = thread;

    data->start_routine = start_routine;

    data->arg = arg;

    hThread = (HANDLE) _beginthreadex(NULL, 0, win32_start_routine,

                                      data, 0, NULL);

    if (!hThread) {

        error_exit(GetLastError(), __func__);

    }

    CloseHandle(hThread);

}


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

                       const int16_t **lumSrc, int lumFilterSize,

+                      const int16_t *chrFilter, const int16_t **chrUSrc,

                       const int16_t **chrVSrc, int chrFilterSize,

yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter,

                      const int16_t **lumSrc, int lumFilterSize,

                      const int16_t *chrFilter, const int16_t **chrUSrc,

                      const int16_t **chrVSrc, int chrFilterSize,

                      const int16_t **alpSrc, uint8_t *dest, int dstW,

                      int y, enum PixelFormat target)

{

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

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

    int i;

    int acc = 0;

    for (i = 0; i < dstW - 1; i += 2) {

        int j;

        int Y1 = 1 << 18;

        int Y2 = 1 << 18;

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

            Y1 += lumSrc[j][i]   * lumFilter[j];

            Y2 += lumSrc[j][i+1] * lumFilter[j];

        }

        Y1 >>= 19;

        Y2 >>= 19;

        if ((Y1 | Y2) & 0x100) {

            Y1 = av_clip_uint8(Y1);

            Y2 = av_clip_uint8(Y2);

        }

        acc += acc + g[Y1 + d128[(i + 0) & 7]];

        acc += acc + g[Y2 + d128[(i + 1) & 7]];

        if ((i & 7) == 6) {

            output_pixel(*dest++, acc);

        }

    }

}


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

     /* Attach the CPU on one end of our I2C bus.  */
+
     I2CBus *bus = pxa2xx_i2c_bus(cpu->i2c[0]);

static void spitz_i2c_setup(PXA2xxState *cpu)

{

    /* Attach the CPU on one end of our I2C bus.  */

    I2CBus *bus = pxa2xx_i2c_bus(cpu->i2c[0]);

    DeviceState *wm;

    /* Attach a WM8750 to the bus */

    wm = i2c_create_slave(bus, "wm8750", 0);

    spitz_wm8750_addr(wm, 0, 0);

    qdev_connect_gpio_out(cpu->gpio, SPITZ_GPIO_WM,

                    qemu_allocate_irqs(spitz_wm8750_addr, wm, 1)[0]);

    /* .. and to the sound interface.  */

    cpu->i2s->opaque = wm;

    cpu->i2s->codec_out = wm8750_dac_dat;

    cpu->i2s->codec_in = wm8750_adc_dat;

    wm8750_data_req_set(wm, cpu->i2s->data_req, cpu->i2s);

}


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

         return 0;

+
+
+    n->has_ufo = qemu_peer_has_ufo(qemu_get_queue(n->nic));
+

     return n->has_ufo;

static int peer_has_ufo(VirtIONet *n)

{

    if (!peer_has_vnet_hdr(n))

        return 0;

    n->has_ufo = qemu_peer_has_ufo(qemu_get_queue(n->nic));

    return n->has_ufo;

}


--- a/source.c
+++ b/source.c
@@ -1,26 +1,26 @@
+static MegasasCmd *megasas_next_frame(MegasasState *s,
+
+    hwaddr frame)
+
+{
+
+    MegasasCmd *cmd = NULL;

+    int num = 0, index;
+
+
+
+    cmd = megasas_lookup_frame(s, frame);
+
     if (cmd) {
+
+        trace_megasas_qf_found(cmd->index, cmd->pa);

+        return cmd;
+
     }
+
+    index = s->reply_queue_head;

     num = 0;

static MegasasCmd *megasas_next_frame(MegasasState *s,

    hwaddr frame)

{

    MegasasCmd *cmd = NULL;

    int num = 0, index;

    cmd = megasas_lookup_frame(s, frame);

    if (cmd) {

        trace_megasas_qf_found(cmd->index, cmd->pa);

        return cmd;

    }

    index = s->reply_queue_head;

    num = 0;

    while (num < s->fw_cmds) {

        if (!s->frames[index].pa) {

            cmd = &s->frames[index];

            break;

        }

        index = megasas_next_index(s, index, s->fw_cmds);

        num++;

    }

    if (!cmd) {

        trace_megasas_qf_failed(frame);

    }

    trace_megasas_qf_new(index, cmd);

    return cmd;

}


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

     if (child->next.le_prev) {

+        QLIST_REMOVE(child, next);
+
+        child->next.le_prev = NULL;
+
+    }

static void bdrv_detach_child(BdrvChild *child)

{

    if (child->next.le_prev) {

        QLIST_REMOVE(child, next);

        child->next.le_prev = NULL;

    }

    bdrv_replace_child(child, NULL, false);

    g_free(child->name);

    g_free(child);

}


--- a/source.c
+++ b/source.c
@@ -11,7 +11,7 @@
     ret = int32_to_float32(src, &env->fp_status);

     check_ieee_exceptions(env);
+
+    return ret;
+
+}

float32 helper_fitos(CPUSPARCState *env, int32_t src)

{

    /* Inexact error possible converting int to float.  */

    float32 ret;

    clear_float_exceptions(env);

    ret = int32_to_float32(src, &env->fp_status);

    check_ieee_exceptions(env);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     BusState *bus;

     bus = qbus_create(BUS_TYPE_SSI, sizeof(SSIBus), parent, name);
+
+    return FROM_QBUS(SSIBus, bus);

 }

SSIBus *ssi_create_bus(DeviceState *parent, const char *name)

{

    BusState *bus;

    bus = qbus_create(BUS_TYPE_SSI, sizeof(SSIBus), parent, name);

    return FROM_QBUS(SSIBus, bus);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+void memory_region_ram_resize(MemoryRegion *mr, ram_addr_t newsize, Error **errp)
+
 {

     assert(mr->terminates);

void memory_region_ram_resize(MemoryRegion *mr, ram_addr_t newsize, Error **errp)

{

    assert(mr->terminates);

    qemu_ram_resize(mr->ram_addr, newsize, errp);

}


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

      * Check if the underlying device requires requests to be aligned,

+     * and if the request we are trying to submit is aligned or not.
+
+     * If this is the case tell the low-level driver that it needs
+
+     * to copy the buffer.

      */

static BlockAIOCB *raw_aio_submit(BlockDriverState *bs,

        int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,

        BlockCompletionFunc *cb, void *opaque, int type)

{

    BDRVRawState *s = bs->opaque;

    if (fd_open(bs) < 0)

        return NULL;

    /*

     * Check if the underlying device requires requests to be aligned,

     * and if the request we are trying to submit is aligned or not.

     * If this is the case tell the low-level driver that it needs

     * to copy the buffer.

     */

    if (s->needs_alignment) {

        if (!bdrv_qiov_is_aligned(bs, qiov)) {

            type |= QEMU_AIO_MISALIGNED;

#ifdef CONFIG_LINUX_AIO

        } else if (s->use_aio) {

            return laio_submit(bs, s->aio_ctx, s->fd, sector_num, qiov,

                               nb_sectors, cb, opaque, type);

#endif

        }

    }

    return paio_submit(bs, s->fd, sector_num, qiov, nb_sectors,

                       cb, opaque, type);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+void qemu_file_reset_rate_limit(QEMUFile *f)

 {

void qemu_file_reset_rate_limit(QEMUFile *f)

{

    f->bytes_xfer = 0;

}


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

                                             NULL);

+    hole64->end = object_property_get_int(pci_host,
+
+                                          PCI_HOST_PROP_PCI_HOLE64_END,
+
+                                          NULL);

 }

static void acpi_get_pci_holes(Range *hole, Range *hole64)

{

    Object *pci_host;

    pci_host = acpi_get_i386_pci_host();

    g_assert(pci_host);

    hole->begin = object_property_get_int(pci_host,

                                          PCI_HOST_PROP_PCI_HOLE_START,

                                          NULL);

    hole->end = object_property_get_int(pci_host,

                                        PCI_HOST_PROP_PCI_HOLE_END,

                                        NULL);

    hole64->begin = object_property_get_int(pci_host,

                                            PCI_HOST_PROP_PCI_HOLE64_START,

                                            NULL);

    hole64->end = object_property_get_int(pci_host,

                                          PCI_HOST_PROP_PCI_HOLE64_END,

                                          NULL);

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     d = MAX(0, MIN(UINT32_MAX, d));

     max_throttle = d;
+
+
+
+    s = migrate_to_fms(current_migration);
+
     if (s && s->file) {

         qemu_file_set_rate_limit(s->file, max_throttle);

int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data)

{

    int64_t d;

    FdMigrationState *s;

    d = qdict_get_int(qdict, "value");

    d = MAX(0, MIN(UINT32_MAX, d));

    max_throttle = d;

    s = migrate_to_fms(current_migration);

    if (s && s->file) {

        qemu_file_set_rate_limit(s->file, max_throttle);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)

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

     MOVStreamContext *sc = (MOVStreamContext *)st->priv_data;

static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)

{

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

    MOVStreamContext *sc = (MOVStreamContext *)st->priv_data;

    int entries, i;

    print_atom("stsz", atom);

    get_byte(pb); /* version */

    get_byte(pb); get_byte(pb); get_byte(pb); /* flags */

    sc->sample_size = get_be32(pb);

    entries = get_be32(pb);

    sc->sample_count = entries;

#ifdef DEBUG

    av_log(NULL, AV_LOG_DEBUG, "sample_size = %ld sample_count = %ld\n", sc->sample_size, sc->sample_count);

#endif

    if(sc->sample_size)

        return 0; /* there isn't any table following */

    sc->sample_sizes = (long*) av_malloc(entries * sizeof(long));

    if (!sc->sample_sizes)

        return -1;

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

        sc->sample_sizes[i] = get_be32(pb);

#ifdef DEBUG

/*        av_log(NULL, AV_LOG_DEBUG, "sample_sizes[]=%ld\n", sc->sample_sizes[i]); */

#endif

    }

    return 0;

}


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

     Rom *rom;

+
+
+    QTAILQ_FOREACH(rom, &roms, next) {
+
+        if (!rom->fw_file) {

             continue;

int rom_load_fw(void *fw_cfg)

{

    Rom *rom;

    QTAILQ_FOREACH(rom, &roms, next) {

        if (!rom->fw_file) {

            continue;

        }

        fw_cfg_add_file(fw_cfg, rom->fw_dir, rom->fw_file, rom->data, rom->romsize);

    }

    return 0;

}


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

     if (QLIST_EMPTY(&bus->current_devs)) {
+
+        return;
+
+    }
+

     QLIST_FOREACH_SAFE(node, &bus->current_devs, next, next) {

void i2c_end_transfer(I2CBus *bus)

{

    I2CSlaveClass *sc;

    I2CNode *node, *next;

    if (QLIST_EMPTY(&bus->current_devs)) {

        return;

    }

    QLIST_FOREACH_SAFE(node, &bus->current_devs, next, next) {

        sc = I2C_SLAVE_GET_CLASS(node->elt);

        if (sc->event) {

            sc->event(node->elt, I2C_FINISH);

        }

        QLIST_REMOVE(node, next);

        g_free(node);

    }

    bus->broadcast = false;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void sync_c0_tcstatus(CPUMIPSState *cpu, int tc,

                              target_ulong v)
+
 {

     uint32_t status;

static void sync_c0_tcstatus(CPUMIPSState *cpu, int tc,

                             target_ulong v)

{

    uint32_t status;

    uint32_t tcu, tmx, tasid, tksu;

    uint32_t mask = ((1 << CP0St_CU3)

                       | (1 << CP0St_CU2)

                       | (1 << CP0St_CU1)

                       | (1 << CP0St_CU0)

                       | (1 << CP0St_MX)

                       | (3 << CP0St_KSU));

    tcu = (v >> CP0TCSt_TCU0) & 0xf;

    tmx = (v >> CP0TCSt_TMX) & 0x1;

    tasid = v & 0xff;

    tksu = (v >> CP0TCSt_TKSU) & 0x3;

    status = tcu << CP0St_CU0;

    status |= tmx << CP0St_MX;

    status |= tksu << CP0St_KSU;

    cpu->CP0_Status &= ~mask;

    cpu->CP0_Status |= status;

    /* Sync the TASID with EntryHi.  */

    cpu->CP0_EntryHi &= ~0xff;

    cpu->CP0_EntryHi = tasid;

    compute_hflags(cpu);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void omap_gp_timer_clk_setup(struct omap_gp_timer_s *timer)
+
 {

     omap_clk_adduser(timer->clk,

static void omap_gp_timer_clk_setup(struct omap_gp_timer_s *timer)

{

    omap_clk_adduser(timer->clk,

                    qemu_allocate_irqs(omap_gp_timer_clk_update, timer, 1)[0]);

    timer->rate = omap_clk_getrate(timer->clk);

}


--- a/source.c
+++ b/source.c
@@ -3,8 +3,8 @@
     struct qemu_laiocb *laiocb)

 {
+
+    int ret;

static void qemu_laio_process_completion(struct qemu_laio_state *s,

    struct qemu_laiocb *laiocb)

{

    int ret;

    s->count--;

    ret = laiocb->ret;

    if (ret != -ECANCELED) {

        if (ret == laiocb->nbytes)

            ret = 0;

        else if (ret >= 0)

            ret = -EINVAL;

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

    }

    qemu_aio_release(laiocb);

}


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

         goto out_nofid;

+    }
+
+
+
+    v9fs_string_init(&target);

     err = v9fs_co_readlink(pdu, &fidp->path, &target);

static void v9fs_readlink(void *opaque)

{

    V9fsPDU *pdu = opaque;

    size_t offset = 7;

    V9fsString target;

    int32_t fid;

    int err = 0;

    V9fsFidState *fidp;

    pdu_unmarshal(pdu, offset, "d", &fid);

    trace_v9fs_readlink(pdu->tag, pdu->id, fid);

    fidp = get_fid(pdu, fid);

    if (fidp == NULL) {

        err = -ENOENT;

        goto out_nofid;

    }

    v9fs_string_init(&target);

    err = v9fs_co_readlink(pdu, &fidp->path, &target);

    if (err < 0) {

        goto out;

    }

    offset += pdu_marshal(pdu, offset, "s", &target);

    err = offset;

    trace_v9fs_readlink_return(pdu->tag, pdu->id, target.data);

    v9fs_string_free(&target);

out:

    put_fid(pdu, fidp);

out_nofid:

    complete_pdu(pdu->s, pdu, err);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+static int add_string_metadata(int count, const char *name,

                                TiffContext *s)

 {

     char *value;
+

     if (bytestream2_get_bytes_left(&s->gb) < count || count < 0)

static int add_string_metadata(int count, const char *name,

                               TiffContext *s)

{

    char *value;

    if (bytestream2_get_bytes_left(&s->gb) < count || count < 0)

        return AVERROR_INVALIDDATA;

    value = av_malloc(count + 1);

    if (!value)

        return AVERROR(ENOMEM);

    bytestream2_get_bufferu(&s->gb, value, count);

    value[count] = 0;

    av_dict_set(avpriv_frame_get_metadatap(&s->picture), name, value, AV_DICT_DONT_STRDUP_VAL);

    return 0;

}


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

 {

+    Monitor *mon;

static void monitor_qapi_event_emit(QAPIEvent event, QDict *qdict)

{

    Monitor *mon;

    trace_monitor_protocol_event_emit(event, qdict);

    QLIST_FOREACH(mon, &mon_list, entry) {

        if (monitor_is_qmp(mon) && mon->qmp.in_command_mode) {

            monitor_json_emitter(mon, QOBJECT(qdict));

        }

    }

}


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

     if (cpu_flags & AV_CPU_FLAG_SSE)

+        dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_sse;
+
+#endif /* HAVE_YASM */
+
+}

av_cold void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp)

{

#if HAVE_YASM

    int cpu_flags = av_get_cpu_flags();

#if ARCH_X86_32

    if (cpu_flags & AV_CPU_FLAG_3DNOW)

        dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_3dnow;

#endif /* ARCH_X86_32 */

    if (cpu_flags & AV_CPU_FLAG_SSE)

        dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_sse;

#endif /* HAVE_YASM */

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     cpu_ticks_offset=qemu_get_be64(f);

     ticks_per_sec=qemu_get_be64(f);
+
+    if (version_id == 2) {
+
+        cpu_clock_offset=qemu_get_be64(f);
+
     }

     return 0;

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

{

    if (version_id != 1 && version_id != 2)

        return -EINVAL;

    if (cpu_ticks_enabled) {

        return -EINVAL;

    }

    cpu_ticks_offset=qemu_get_be64(f);

    ticks_per_sec=qemu_get_be64(f);

    if (version_id == 2) {

        cpu_clock_offset=qemu_get_be64(f);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                                   unsigned size)

 {
+
     MacIONVRAMState *s = opaque;

     uint32_t value;

static uint64_t macio_nvram_readb(void *opaque, hwaddr addr,

                                  unsigned size)

{

    MacIONVRAMState *s = opaque;

    uint32_t value;

    addr = (addr >> s->it_shift) & (s->size - 1);

    value = s->data[addr];

    NVR_DPRINTF("readb addr %04x val %x\n", (int)addr, value);

    return value;

}


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

                   int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
+
+                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
+
+                  int64_t (*seek)(void *opaque, int64_t offset, int whence))
+
 {

     AVIOContext *s = av_mallocz(sizeof(AVIOContext));

AVIOContext *avio_alloc_context(

                  unsigned char *buffer,

                  int buffer_size,

                  int write_flag,

                  void *opaque,

                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),

                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),

                  int64_t (*seek)(void *opaque, int64_t offset, int whence))

{

    AVIOContext *s = av_mallocz(sizeof(AVIOContext));

    ffio_init_context(s, buffer, buffer_size, write_flag, opaque,

                  read_packet, write_packet, seek);

    return s;

}


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

+    if (filter->filter->uninit)

         filter->filter->uninit(filter);

void avfilter_free(AVFilterContext *filter)

{

    int i;

    AVFilterLink *link;

    if (filter->filter->uninit)

        filter->filter->uninit(filter);

    for (i = 0; i < filter->input_count; i++) {

        if ((link = filter->inputs[i])) {

            if (link->src)

                link->src->outputs[link->srcpad - link->src->output_pads] = NULL;

            avfilter_formats_unref(&link->in_formats);

            avfilter_formats_unref(&link->out_formats);

        }

        av_freep(&link);

    }

    for (i = 0; i < filter->output_count; i++) {

        if ((link = filter->outputs[i])) {

            if (link->dst)

                link->dst->inputs[link->dstpad - link->dst->input_pads] = NULL;

            avfilter_formats_unref(&link->in_formats);

            avfilter_formats_unref(&link->out_formats);

        }

        av_freep(&link);

    }

    av_freep(&filter->name);

    av_freep(&filter->input_pads);

    av_freep(&filter->output_pads);

    av_freep(&filter->inputs);

    av_freep(&filter->outputs);

    av_freep(&filter->priv);

    av_free(filter);

}


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

            av_get_sample_fmt_name(link->format),

+           old_layout_str, link->sample_rate,
+
+           av_get_sample_fmt_name(ref->format),
+
+           new_layout_str, ref->audio->sample_rate);

 }

static inline void log_input_change(void *ctx, AVFilterLink *link, AVFilterBufferRef *ref)

{

    char old_layout_str[16], new_layout_str[16];

    av_get_channel_layout_string(old_layout_str, sizeof(old_layout_str),

                                 -1, link->channel_layout);

    av_get_channel_layout_string(new_layout_str, sizeof(new_layout_str),

                                 -1, ref->audio->channel_layout);

    av_log(ctx, AV_LOG_INFO,

           "Audio input format changed: "

           "%s:%s:%"PRId64" -> %s:%s:%u, normalizing\n",

           av_get_sample_fmt_name(link->format),

           old_layout_str, link->sample_rate,

           av_get_sample_fmt_name(ref->format),

           new_layout_str, ref->audio->sample_rate);

}


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

 {

+    flag aSign;

     int32 aExp, shiftCount;

int32 floatx80_to_int32_round_to_zero( floatx80 a STATUS_PARAM )

{

    flag aSign;

    int32 aExp, shiftCount;

    uint64_t aSig, savedASig;

    int32 z;

    aSig = extractFloatx80Frac( a );

    aExp = extractFloatx80Exp( a );

    aSign = extractFloatx80Sign( a );

    if ( 0x401E < aExp ) {

        if ( ( aExp == 0x7FFF ) && (uint64_t) ( aSig<<1 ) ) aSign = 0;

        goto invalid;

    }

    else if ( aExp < 0x3FFF ) {

        if ( aExp || aSig ) STATUS(float_exception_flags) |= float_flag_inexact;

        return 0;

    }

    shiftCount = 0x403E - aExp;

    savedASig = aSig;

    aSig >>= shiftCount;

    z = aSig;

    if ( aSign ) z = - z;

    if ( ( z < 0 ) ^ aSign ) {

 invalid:

        float_raise( float_flag_invalid STATUS_VAR);

        return aSign ? (int32_t) 0x80000000 : 0x7FFFFFFF;

    }

    if ( ( aSig<<shiftCount ) != savedASig ) {

        STATUS(float_exception_flags) |= float_flag_inexact;

    }

    return z;

}


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

     BlockDriverState *bs;

+    int force = qdict_get_int(qdict, "force");
+
+    const char *filename = qdict_get_str(qdict, "device");
+
+

     bs = bdrv_find(filename);

int do_eject(Monitor *mon, const QDict *qdict, QObject **ret_data)

{

    BlockDriverState *bs;

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

    const char *filename = qdict_get_str(qdict, "device");

    bs = bdrv_find(filename);

    if (!bs) {

        qerror_report(QERR_DEVICE_NOT_FOUND, filename);

        return -1;

    }

    return eject_device(mon, bs, force);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     TCGLabel *label = &s->labels[arg];

     if (label->has_value) {
+
         tcg_out_i(s, label->u.value);

         assert(label->u.value);

static void tci_out_label(TCGContext *s, TCGArg arg)

{

    TCGLabel *label = &s->labels[arg];

    if (label->has_value) {

        tcg_out_i(s, label->u.value);

        assert(label->u.value);

    } else {

        tcg_out_reloc(s, s->code_ptr, sizeof(tcg_target_ulong), arg, 0);

        tcg_out_i(s, 0);

    }

}


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

     if (qiov->niov > 1) {

+        acb->buf = acb->orig_buf = qemu_blockalign(bs, qiov->size);
+
+        if (is_write)
+
+            qemu_iovec_to_buffer(qiov, acb->buf);

     } else {

static QCowAIOCB *qcow_aio_setup(BlockDriverState *bs,

        int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,

        BlockDriverCompletionFunc *cb, void *opaque, int is_write)

{

    QCowAIOCB *acb;

    acb = qemu_aio_get(&qcow_aio_pool, bs, cb, opaque);

    if (!acb)

        return NULL;

    acb->hd_aiocb = NULL;

    acb->sector_num = sector_num;

    acb->qiov = qiov;

    if (qiov->niov > 1) {

        acb->buf = acb->orig_buf = qemu_blockalign(bs, qiov->size);

        if (is_write)

            qemu_iovec_to_buffer(qiov, acb->buf);

    } else {

        acb->buf = (uint8_t *)qiov->iov->iov_base;

    }

    acb->nb_sectors = nb_sectors;

    acb->n = 0;

    acb->cluster_offset = 0;

    acb->l2meta.nb_clusters = 0;

    LIST_INIT(&acb->l2meta.dependent_requests);

    return acb;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static inline void update_rice(APERice *rice, int x)
+
+{
+
+    rice->ksum += ((x + 1) / 2) - ((rice->ksum + 16) >> 5);
+

     if (rice->k == 0)

static inline void update_rice(APERice *rice, int x)

{

    rice->ksum += ((x + 1) / 2) - ((rice->ksum + 16) >> 5);

    if (rice->k == 0)

        rice->k = 1;

    else if (rice->ksum < (1 << (rice->k + 4)))

        rice->k--;

    else if (rice->ksum >= (1 << (rice->k + 5)))

        rice->k++;

}


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

+    m48t59_write(NVRAM, addr, value & 0xff);
+
 }

static void nvram_writeb (void *opaque, target_phys_addr_t addr, uint32_t value)

{

    M48t59State *NVRAM = opaque;

    m48t59_write(NVRAM, addr, value & 0xff);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void visit_type_enum(Visitor *v, const char *name, int *obj,

+                     const char *const strings[], Error **errp)

+{

     assert(obj && strings);

void visit_type_enum(Visitor *v, const char *name, int *obj,

                     const char *const strings[], Error **errp)

{

    assert(obj && strings);

    if (v->type == VISITOR_INPUT) {

        input_type_enum(v, name, obj, strings, errp);

    } else if (v->type == VISITOR_OUTPUT) {

        output_type_enum(v, name, obj, strings, errp);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void qemu_thread_get_self(QemuThread *thread)
+
+{
+
+    if (!thread->thread) {

         /* In the main thread of the process.  Initialize the QemuThread

void qemu_thread_get_self(QemuThread *thread)

{

    if (!thread->thread) {

        /* In the main thread of the process.  Initialize the QemuThread

           pointer in TLS, and use the dummy GetCurrentThread handle as

           the identifier for qemu_thread_is_self.  */

        qemu_thread_init();

        TlsSetValue(qemu_thread_tls_index, thread);

        thread->thread = GetCurrentThread();

    }

}


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

             /* Force page fault for first write access */

+            ctx->prot &= ~PAGE_WRITE;
+
+        }
+
+    }

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

                                       int ret, int rwx)

{

    int store = 0;

    /* Update page flags */

    if (!(*pte1p & HPTE32_R_R)) {

        /* Update accessed flag */

        *pte1p |= HPTE32_R_R;

        store = 1;

    }

    if (!(*pte1p & HPTE32_R_C)) {

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

            /* Update changed flag */

            *pte1p |= HPTE32_R_C;

            store = 1;

        } else {

            /* Force page fault for first write access */

            ctx->prot &= ~PAGE_WRITE;

        }

    }

    return store;

}


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

                                      RowContext *row, int n)

+{
+
     return dnxhd_decode_dct_block(ctx, row, n, 6, 8, 4);

 }

static int dnxhd_decode_dct_block_10(const DNXHDContext *ctx,

                                     RowContext *row, int n)

{

    return dnxhd_decode_dct_block(ctx, row, n, 6, 8, 4);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static int print_uint32(DeviceState *dev, Property *prop, char *dest, size_t len)
+
+{

     uint32_t *ptr = qdev_get_prop_ptr(dev, prop);

static int print_uint32(DeviceState *dev, Property *prop, char *dest, size_t len)

{

    uint32_t *ptr = qdev_get_prop_ptr(dev, prop);

    return snprintf(dest, len, "%" PRIu32, *ptr);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     int len;

     const uint8_t *p;
+
     char *str;

static char *getstr8(const uint8_t **pp, const uint8_t *p_end)

{

    int len;

    const uint8_t *p;

    char *str;

    p   = *pp;

    len = get8(&p, p_end);

    if (len < 0)

        return NULL;

    if ((p + len) > p_end)

        return NULL;

    str = av_malloc(len + 1);

    if (!str)

        return NULL;

    memcpy(str, p, len);

    str[len] = '\0';

    p  += len;

    *pp = p;

    return str;

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
                         target_phys_addr_t addr, uint64_t max_sz)

 {
+
+    int size;
+
+
+
     size = get_image_size(filename);

     if (size > max_sz) {

int load_image_targphys(const char *filename,

                        target_phys_addr_t addr, uint64_t max_sz)

{

    int size;

    size = get_image_size(filename);

    if (size > max_sz) {

        return -1;

    }

    if (size > 0) {

        rom_add_file_fixed(filename, addr, -1);

    }

    return size;

}


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

     s->qdev.type = TYPE_DISK;

+    if (!s->product) {
+
+        s->product = g_strdup("QEMU HARDDISK");
+
     }

     return scsi_initfn(&s->qdev);

static int scsi_hd_initfn(SCSIDevice *dev)

{

    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev);

    s->qdev.blocksize = s->qdev.conf.logical_block_size;

    s->qdev.type = TYPE_DISK;

    if (!s->product) {

        s->product = g_strdup("QEMU HARDDISK");

    }

    return scsi_initfn(&s->qdev);

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
 bool qemu_co_queue_next(CoQueue *queue)
+
 {

     struct unlock_bh *unlock_bh;

     Coroutine *next;

+
+
+    next = QTAILQ_FIRST(&queue->entries);

     if (next) {

bool qemu_co_queue_next(CoQueue *queue)

{

    struct unlock_bh *unlock_bh;

    Coroutine *next;

    next = QTAILQ_FIRST(&queue->entries);

    if (next) {

        QTAILQ_REMOVE(&queue->entries, next, co_queue_next);

        QTAILQ_INSERT_TAIL(&unlock_bh_queue, next, co_queue_next);

        trace_qemu_co_queue_next(next);

        unlock_bh = qemu_malloc(sizeof(*unlock_bh));

        unlock_bh->bh = qemu_bh_new(qemu_co_queue_next_bh, unlock_bh);

        qemu_bh_schedule(unlock_bh->bh);

    }

    return (next != NULL);

}


--- a/source.c
+++ b/source.c
@@ -51,11 +51,11 @@
             if(s->codec_id==CODEC_ID_MPEG4)

                 ret= mpeg4_decode_video_packet_header(s);
+
+            else
+
+                ret= h263_decode_gob_header(s);
+
             if(ret>=0)

                 return 0;

int ff_h263_resync(MpegEncContext *s){

    int left, ret;

    if(s->codec_id==CODEC_ID_MPEG4)

        skip_bits1(&s->gb);

    align_get_bits(&s->gb);

    if(show_bits(&s->gb, 16)==0){

        if(s->codec_id==CODEC_ID_MPEG4)

            ret= mpeg4_decode_video_packet_header(s);

        else

            ret= h263_decode_gob_header(s);

        if(ret>=0)

            return 0;

    }

    //ok, its not where its supposed to be ...

    s->gb= s->last_resync_gb;

    align_get_bits(&s->gb);

    left= s->gb.size*8 - get_bits_count(&s->gb);

    for(;left>16+1+5+5; left-=8){

        if(show_bits(&s->gb, 16)==0){

            GetBitContext bak= s->gb;

            if(s->codec_id==CODEC_ID_MPEG4)

                ret= mpeg4_decode_video_packet_header(s);

            else

                ret= h263_decode_gob_header(s);

            if(ret>=0)

                return 0;

            s->gb= bak;

        }

        skip_bits(&s->gb, 8);

    }

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     abi_ulong frame_addr = env->regs[R_ESP] - 8;

     target_sigset_t target_set;
+
+    sigset_t set;
+
+    int eax, i;
+

 #if defined(DEBUG_SIGNAL)

long do_sigreturn(CPUX86State *env)

{

    struct sigframe *frame;

    abi_ulong frame_addr = env->regs[R_ESP] - 8;

    target_sigset_t target_set;

    sigset_t set;

    int eax, i;

#if defined(DEBUG_SIGNAL)

    fprintf(stderr, "do_sigreturn\n");

#endif

    if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1))

        goto badframe;

    /* set blocked signals */

    if (__get_user(target_set.sig[0], &frame->sc.oldmask))

        goto badframe;

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

        if (__get_user(target_set.sig[i], &frame->extramask[i - 1]))

            goto badframe;

    }

    target_to_host_sigset_internal(&set, &target_set);

    sigprocmask(SIG_SETMASK, &set, NULL);

    /* restore registers */

    if (restore_sigcontext(env, &frame->sc, &eax))

        goto badframe;

    unlock_user_struct(frame, frame_addr, 0);

    return eax;

badframe:

    unlock_user_struct(frame, frame_addr, 0);

    force_sig(TARGET_SIGSEGV);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static uint64_t vtd_get_iotlb_key(uint64_t gfn, uint8_t source_id,
+
                                   uint32_t level)

 {

static uint64_t vtd_get_iotlb_key(uint64_t gfn, uint8_t source_id,

                                  uint32_t level)

{

    return gfn | ((uint64_t)(source_id) << VTD_IOTLB_SID_SHIFT) |

           ((uint64_t)(level) << VTD_IOTLB_LVL_SHIFT);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static uint64_t master_abort_mem_read(void *opaque, hwaddr addr, unsigned size)
+
 {

    return -1ULL;

static uint64_t master_abort_mem_read(void *opaque, hwaddr addr, unsigned size)

{

   return -1ULL;

}


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

                            "'string': 'str', "

+                           "'boolean': true }");
+
+    /* TODO when generator bug is fixed, add 'integer': 41 */
+
+

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

static void test_validate_union_flat(TestInputVisitorData *data,

                                     const void *unused)

{

    UserDefFlatUnion *tmp = NULL;

    Visitor *v;

    Error *err = NULL;

    v = validate_test_init(data,

                           "{ 'enum1': 'value1', "

                           "'string': 'str', "

                           "'boolean': true }");

    /* TODO when generator bug is fixed, add 'integer': 41 */

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

    g_assert(!err);

    qapi_free_UserDefFlatUnion(tmp);

}


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

 {

+    uint8_t ch;
+
+    int i, ret;
+
+

     printf("password: ");

int qemu_read_password(char *buf, int buf_size)

{

    uint8_t ch;

    int i, ret;

    printf("password: ");

    fflush(stdout);

    term_init();

    i = 0;

    for (;;) {

        ret = read(0, &ch, 1);

        if (ret == -1) {

            if (errno == EAGAIN || errno == EINTR) {

                continue;

            } else {

                break;

            }

        } else if (ret == 0) {

            ret = -1;

            break;

        } else {

            if (ch == '\r') {

                ret = 0;

                break;

            }

            if (i < (buf_size - 1)) {

                buf[i++] = ch;

            }

        }

    }

    term_exit();

    buf[i] = '\0';

    printf("\n");

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void isa_ne2000_cleanup(NetClientState *nc)
+
+{

     NE2000State *s = qemu_get_nic_opaque(nc);

static void isa_ne2000_cleanup(NetClientState *nc)

{

    NE2000State *s = qemu_get_nic_opaque(nc);

    s->nic = NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void qxl_check_state(PCIQXLDevice *d)
+
+{
+
     QXLRam *ram = d->ram;

static void qxl_check_state(PCIQXLDevice *d)

{

    QXLRam *ram = d->ram;

    assert(SPICE_RING_IS_EMPTY(&ram->cmd_ring));

    assert(SPICE_RING_IS_EMPTY(&ram->cursor_ring));

}


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

         con = dcl->con;

+    } else {
+
+        con = active_console;
+
+    }

     if (dcl->ops->dpy_gfx_switch) {

void register_displaychangelistener(DisplayChangeListener *dcl)

{

    static DisplaySurface *dummy;

    QemuConsole *con;

    trace_displaychangelistener_register(dcl, dcl->ops->dpy_name);

    dcl->ds = get_alloc_displaystate();

    QLIST_INSERT_HEAD(&dcl->ds->listeners, dcl, next);

    gui_setup_refresh(dcl->ds);

    if (dcl->con) {

        dcl->con->dcls++;

        con = dcl->con;

    } else {

        con = active_console;

    }

    if (dcl->ops->dpy_gfx_switch) {

        if (con) {

            dcl->ops->dpy_gfx_switch(dcl, con->surface);

        } else {

            if (!dummy) {

                dummy = qemu_create_dummy_surface();

            }

            dcl->ops->dpy_gfx_switch(dcl, dummy);

        }

    }

}


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

                                  Error **errp)

+{
+
+    s->get_error = socket_errno;
+
+    s->write = socket_write;

     s->close = tcp_close;

int tcp_start_outgoing_migration(MigrationState *s, const char *host_port,

                                 Error **errp)

{

    s->get_error = socket_errno;

    s->write = socket_write;

    s->close = tcp_close;

    s->fd = inet_connect(host_port, false, errp);

    if (!error_is_set(errp)) {

        migrate_fd_connect(s);

    } else if (error_is_type(*errp, QERR_SOCKET_CONNECT_IN_PROGRESS)) {

        DPRINTF("connect in progress\n");

        qemu_set_fd_handler2(s->fd, NULL, NULL, tcp_wait_for_connect, s);

    } else if (error_is_type(*errp, QERR_SOCKET_CREATE_FAILED)) {

        DPRINTF("connect failed\n");

        return -1;

    } else if (error_is_type(*errp, QERR_SOCKET_CONNECT_FAILED)) {

        DPRINTF("connect failed\n");

        migrate_fd_error(s);

        return -1;

    } else {

        DPRINTF("unknown error\n");

        return -1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,28 +1,28 @@
 GList *range_list_insert(GList *list, Range *data)
+
+{
+
+    GList *l, *next = NULL;
+
     Range *r, *nextr;
+
+
+
+    if (!list) {
+
+        list = g_list_insert_sorted(list, data, range_compare);
+
+        return list;
+
+    }

+

     nextr = data;
+
     l = list;

+    while (l && l != next && nextr) {

         r = l->data;

GList *range_list_insert(GList *list, Range *data)

{

    GList *l, *next = NULL;

    Range *r, *nextr;

    if (!list) {

        list = g_list_insert_sorted(list, data, range_compare);

        return list;

    }

    nextr = data;

    l = list;

    while (l && l != next && nextr) {

        r = l->data;

        if (ranges_can_merge(r, nextr)) {

            range_merge(r, nextr);

            l = g_list_remove_link(l, next);

            next = g_list_next(l);

            if (next) {

                nextr = next->data;

            } else {

                nextr = NULL;

            }

        } else {

            l = g_list_next(l);

        }

    }

    if (!l) {

        list = g_list_insert_sorted(list, data, range_compare);

    }

    return list;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 int qemu_get_thread_id(void)

 {
+
+#if defined (__linux__)
+
     return syscall(SYS_gettid);

 #else

int qemu_get_thread_id(void)

{

#if defined (__linux__)

    return syscall(SYS_gettid);

#else

    return getpid();

#endif

}


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

     int ret;

static int mp_dacl_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_DEFAULT, value, size, flags);

    g_free(buffer);

    return ret;

}


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

 	unsigned i;

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

{

	unsigned i;

	unsigned num_pixels = src_size >> 1;

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

	{

	    unsigned b,g,r;

	    register uint16_t rgb;

	    rgb = src[2*i];

	    r = rgb&0x1F;

	    g = (rgb&0x7E0)>>5;

	    b = (rgb&0xF800)>>11;

	    dst[2*i] = (b&0x1F) | ((g&0x1F)<<5) | ((r&0x1F)<<10);

	}

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+int pt_removexattr(FsContext *ctx, const char *path, const char *name)
+
+{
+
+    char *buffer;
+
+    int ret;

int pt_removexattr(FsContext *ctx, const char *path, const char *name)

{

    char *buffer;

    int ret;

    buffer = rpath(ctx, path);

    ret = lremovexattr(path, name);

    g_free(buffer);

    return ret;

}


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

     qemu_file_set_blocking(mis->from_src_file, true);

+
+
+    /* TODO: COLO checkpoint restore loop */
+
+

 out:

void *colo_process_incoming_thread(void *opaque)

{

    MigrationIncomingState *mis = opaque;

    migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,

                      MIGRATION_STATUS_COLO);

    mis->to_src_file = qemu_file_get_return_path(mis->from_src_file);

    if (!mis->to_src_file) {

        error_report("COLO incoming thread: Open QEMUFile to_src_file failed");

        goto out;

    }

    /*

     * Note: the communication between Primary side and Secondary side

     * should be sequential, we set the fd to unblocked in migration incoming

     * coroutine, and here we are in the COLO incoming thread, so it is ok to

     * set the fd back to blocked.

     */

    qemu_file_set_blocking(mis->from_src_file, true);

    /* TODO: COLO checkpoint restore loop */

out:

    if (mis->to_src_file) {

        qemu_fclose(mis->to_src_file);

    }

    migration_incoming_exit_colo();

    return NULL;

}


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

     AVBufferPool *pool = buf->pool;

+
+
+    if(CONFIG_MEMORY_POISONING)
+
+        memset(buf->data, 0x2a, pool->size);

static void pool_release_buffer(void *opaque, uint8_t *data)

{

    BufferPoolEntry *buf = opaque;

    AVBufferPool *pool = buf->pool;

    if(CONFIG_MEMORY_POISONING)

        memset(buf->data, 0x2a, pool->size);

    add_to_pool(buf);

    if (!avpriv_atomic_int_add_and_fetch(&pool->refcount, -1))

        buffer_pool_free(pool);

}


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

 #ifndef CONFIG_USER_ONLY
+
+    /* Virtual Page Class Key protection */
+
+    /* The AMR is accessible either via SPR 13 or SPR 29.  13 is
+
      * userspace accessible, 29 is privileged.  So we only need to set

      * the kvm ONE_REG id on one of them, we use 29 */

static void gen_spr_amr (CPUPPCState *env)

{

#ifndef CONFIG_USER_ONLY

    /* Virtual Page Class Key protection */

    /* The AMR is accessible either via SPR 13 or SPR 29.  13 is

     * userspace accessible, 29 is privileged.  So we only need to set

     * the kvm ONE_REG id on one of them, we use 29 */

    spr_register(env, SPR_UAMR, "UAMR",

                 &spr_read_uamr, &spr_write_uamr_pr,

                 &spr_read_uamr, &spr_write_uamr,

                 0);

    spr_register_kvm(env, SPR_AMR, "AMR",

                     SPR_NOACCESS, SPR_NOACCESS,

                     &spr_read_generic, &spr_write_generic,

                     KVM_REG_PPC_AMR, 0xffffffffffffffffULL);

    spr_register_kvm(env, SPR_UAMOR, "UAMOR",

                     SPR_NOACCESS, SPR_NOACCESS,

                     &spr_read_generic, &spr_write_generic,

                     KVM_REG_PPC_UAMOR, 0);

#endif /* !CONFIG_USER_ONLY */

}


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

     if (!*filename) {

+        error_report("character device specification needed");
+
+        return NULL;
+
+    }

     filename++;

static USBDevice *usb_serial_init(USBBus *bus, const char *filename)

{

    USBDevice *dev;

    Chardev *cdrv;

    char label[32];

    static int index;

    while (*filename && *filename != ':') {

        const char *p;

        if (strstart(filename, "vendorid=", &p)) {

            error_report("vendorid is not supported anymore");

            return NULL;

        } else if (strstart(filename, "productid=", &p)) {

            error_report("productid is not supported anymore");

            return NULL;

        } else {

            error_report("unrecognized serial USB option %s", filename);

            return NULL;

        }

        while(*filename == ',')

            filename++;

    }

    if (!*filename) {

        error_report("character device specification needed");

        return NULL;

    }

    filename++;

    snprintf(label, sizeof(label), "usbserial%d", index++);

    cdrv = qemu_chr_new(label, filename);

    if (!cdrv)

        return NULL;

    dev = usb_create(bus, "usb-serial");

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

    return dev;

}


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

     switch (memop) {

+    case MO_8:
+
+        tcg_gen_ld8u_i32(tcg_dest, cpu_env, vect_off);
+
+        break;

     case MO_16:

static void read_vec_element_i32(DisasContext *s, TCGv_i32 tcg_dest, int srcidx,

                                 int element, TCGMemOp memop)

{

    int vect_off = vec_reg_offset(srcidx, element, memop & MO_SIZE);

    switch (memop) {

    case MO_8:

        tcg_gen_ld8u_i32(tcg_dest, cpu_env, vect_off);

        break;

    case MO_16:

        tcg_gen_ld16u_i32(tcg_dest, cpu_env, vect_off);

        break;

    case MO_8|MO_SIGN:

        tcg_gen_ld8s_i32(tcg_dest, cpu_env, vect_off);

        break;

    case MO_16|MO_SIGN:

        tcg_gen_ld16s_i32(tcg_dest, cpu_env, vect_off);

        break;

    case MO_32:

    case MO_32|MO_SIGN:

        tcg_gen_ld_i32(tcg_dest, cpu_env, vect_off);

        break;

    default:

        g_assert_not_reached();

    }

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
 void helper_stsw(CPUPPCState *env, target_ulong addr, uint32_t nb,

                  uint32_t reg)
+
 {

     int sh;

+
     for (; nb > 3; nb -= 4) {

         cpu_stl_data(env, addr, env->gpr[reg]);

void helper_stsw(CPUPPCState *env, target_ulong addr, uint32_t nb,

                 uint32_t reg)

{

    int sh;

    for (; nb > 3; nb -= 4) {

        cpu_stl_data(env, addr, env->gpr[reg]);

        reg = (reg + 1) % 32;

        addr = addr_add(env, addr, 4);

    }

    if (unlikely(nb > 0)) {

        for (sh = 24; nb > 0; nb--, sh -= 8) {

            cpu_stb_data(env, addr, (env->gpr[reg] >> sh) & 0xFF);

            addr = addr_add(env, addr, 1);

        }

    }

}


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

     QGuestAllocator *alloc;

+    void *addr;

static void pci_basic(void)

{

    QVirtioPCIDevice *dev;

    QPCIBus *bus;

    QVirtQueuePCI *vqpci;

    QGuestAllocator *alloc;

    void *addr;

    bus = pci_test_start();

    dev = virtio_blk_pci_init(bus, PCI_SLOT);

    alloc = pc_alloc_init();

    vqpci = (QVirtQueuePCI *)qvirtqueue_setup(&qvirtio_pci, &dev->vdev,

                                                                    alloc, 0);

    /* MSI-X is not enabled */

    addr = dev->addr + VIRTIO_PCI_CONFIG_OFF(false);

    test_basic(&qvirtio_pci, &dev->vdev, alloc, &vqpci->vq,

                                                    (uint64_t)(uintptr_t)addr);

    /* End test */

    guest_free(alloc, vqpci->vq.desc);

    pc_alloc_uninit(alloc);

    qvirtio_pci_device_disable(dev);

    g_free(dev);

    qpci_free_pc(bus);

    test_end();

}


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

     HANDLE h;
+
     BOOL res;
+

     if ((GetVersion() & 0x80000000UL) && (length >> 32) != 0)

int qemu_ftruncate64(int fd, int64_t length)

{

    LARGE_INTEGER li;

    LONG high;

    HANDLE h;

    BOOL res;

    if ((GetVersion() & 0x80000000UL) && (length >> 32) != 0)

	return -1;

    h = (HANDLE)_get_osfhandle(fd);

    /* get current position, ftruncate do not change position */

    li.HighPart = 0;

    li.LowPart = SetFilePointer (h, 0, &li.HighPart, FILE_CURRENT);

    if (li.LowPart == 0xffffffffUL && GetLastError() != NO_ERROR)

	return -1;

    high = length >> 32;

    if (!SetFilePointer(h, (DWORD) length, &high, FILE_BEGIN))

	return -1;

    res = SetEndOfFile(h);

    /* back to old position */

    SetFilePointer(h, li.LowPart, &li.HighPart, FILE_BEGIN);

    return res ? 0 : -1;

}


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

     if (posix_aio_state) {

+        char byte = 0;
+
+
+
         write(posix_aio_state->wfd, &byte, sizeof(byte));

     }

static void aio_signal_handler(int signum)

{

    if (posix_aio_state) {

        char byte = 0;

        write(posix_aio_state->wfd, &byte, sizeof(byte));

    }

    qemu_service_io();

}


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

     uint32_t pciaddr;

+    uint16_t status;
+
+
+
+    DPRINTF("bonito_spciconf_writew "TARGET_FMT_plx" val %x\n", addr, val);

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

static void bonito_spciconf_writew(void *opaque, target_phys_addr_t addr,

                                   uint32_t val)

{

    PCIBonitoState *s = opaque;

    PCIDevice *d = PCI_DEVICE(s);

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

    uint32_t pciaddr;

    uint16_t status;

    DPRINTF("bonito_spciconf_writew "TARGET_FMT_plx" val %x\n", addr, val);

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

    pciaddr = bonito_sbridge_pciaddr(s, addr);

    if (pciaddr == 0xffffffff) {

        return;

    }

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

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

    pci_data_write(phb->bus, phb->config_reg, val, 2);

    /* clear PCI_STATUS_REC_MASTER_ABORT and PCI_STATUS_REC_TARGET_ABORT */

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

    status &= ~(PCI_STATUS_REC_MASTER_ABORT | PCI_STATUS_REC_TARGET_ABORT);

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

}


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

         ehci_set_state(q->ehci, async, EST_EXECUTE);

+        again = 1;
+
+    } else {
+
+        ehci_set_state(q->ehci, async, EST_HORIZONTALQH);

         again = 1;

static int ehci_state_fetchqtd(EHCIQueue *q, int async)

{

    int again = 0;

    get_dwords(NLPTR_GET(q->qtdaddr),(uint32_t *) &q->qtd, sizeof(EHCIqtd) >> 2);

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

    if (q->qtd.token & QTD_TOKEN_ACTIVE) {

        ehci_set_state(q->ehci, async, EST_EXECUTE);

        again = 1;

    } else {

        ehci_set_state(q->ehci, async, EST_HORIZONTALQH);

        again = 1;

    }

    return again;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static ssize_t qio_channel_command_writev(QIOChannel *ioc,
+
+                                          const struct iovec *iov,
+
+                                          size_t niov,
+
                                           int *fds,

                                           size_t nfds,

static ssize_t qio_channel_command_writev(QIOChannel *ioc,

                                          const struct iovec *iov,

                                          size_t niov,

                                          int *fds,

                                          size_t nfds,

                                          Error **errp)

{

    QIOChannelCommand *cioc = QIO_CHANNEL_COMMAND(ioc);

    ssize_t ret;

 retry:

    ret = writev(cioc->writefd, iov, niov);

    if (ret <= 0) {

        if (errno == EAGAIN ||

            errno == EWOULDBLOCK) {

            return QIO_CHANNEL_ERR_BLOCK;

        }

        if (errno == EINTR) {

            goto retry;

        }

        error_setg_errno(errp, errno, "%s",

                         "Unable to write to command");

        return -1;

    }

    return ret;

}


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

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

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

static void nographic_update(void *opaque)

{

    uint64_t interval = GUI_REFRESH_INTERVAL;

    qemu_flush_coalesced_mmio_buffer();

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

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+int ff_mov_lang_to_iso639(int code, char *to)

 {

int ff_mov_lang_to_iso639(int code, char *to)

{

    int i;

    /* is it the mangled iso code? */

    /* see http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt */

    if (code > 138) {

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

            to[i] = 0x60 + (code & 0x1f);

            code >>= 5;

        }

        return 1;

    }

    /* old fashion apple lang code */

    if (code >= FF_ARRAY_ELEMS(mov_mdhd_language_map))

        return 0;

    if (!mov_mdhd_language_map[code])

        return 0;

    strncpy(to, mov_mdhd_language_map[code], 4);

    return 1;

}


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

+    if (r->req.io_canceled) {
+
+        scsi_req_cancel_complete(&r->req);
+
+        goto done;

     }

static void scsi_write_do_fua(SCSIDiskReq *r)

{

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

    if (r->req.io_canceled) {

        scsi_req_cancel_complete(&r->req);

        goto done;

    }

    if (scsi_is_cmd_fua(&r->req.cmd)) {

        block_acct_start(bdrv_get_stats(s->qdev.conf.bs), &r->acct, 0,

                         BLOCK_ACCT_FLUSH);

        r->req.aiocb = bdrv_aio_flush(s->qdev.conf.bs, scsi_aio_complete, r);

        return;

    }

    scsi_req_complete(&r->req, GOOD);

done:

    scsi_req_unref(&r->req);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+int qemu_strtoul(const char *nptr, const char **endptr, int base,
+
+                 unsigned long *result)
+
+{

     char *ep;

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

                 unsigned long *result)

{

    char *ep;

    int err = 0;

    if (!nptr) {

        if (endptr) {

            *endptr = nptr;

        }

        err = -EINVAL;

    } else {

        errno = 0;

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

        /* Windows returns 1 for negative out-of-range values.  */

        if (errno == ERANGE) {

            *result = -1;

        }

        err = check_strtox_error(nptr, ep, endptr, errno);

    }

    return err;

}


static av_always_inline int vc1_filter_line(uint8_t* src, int stride, int pq){

    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

    int a0 = (2*(src[-2*stride] - src[ 1*stride]) - 5*(src[-1*stride] - src[ 0*stride]) + 4) >> 3;

    int a0_sign = a0 >> 31;        /* Store sign */

    a0 = (a0 ^ a0_sign) - a0_sign; /* a0 = FFABS(a0); */

    if(a0 < pq){

        int a1 = FFABS((2*(src[-4*stride] - src[-1*stride]) - 5*(src[-3*stride] - src[-2*stride]) + 4) >> 3);

        int a2 = FFABS((2*(src[ 0*stride] - src[ 3*stride]) - 5*(src[ 1*stride] - src[ 2*stride]) + 4) >> 3);

        if(a1 < a0 || a2 < a0){

            int clip = src[-1*stride] - src[ 0*stride];

            int clip_sign = clip >> 31;

            clip = ((clip ^ clip_sign) - clip_sign)>>1;

            if(clip){

                int a3 = FFMIN(a1, a2);

                int d = 5 * (a3 - a0);

                int d_sign = (d >> 31);

                d = ((d ^ d_sign) - d_sign) >> 3;

                d_sign ^= a0_sign;

                if( d_sign ^ clip_sign )

                    d = 0;

                else{

                    d = FFMIN(d, clip);

                    d = (d ^ d_sign) - d_sign;          /* Restore sign */

                    src[-1*stride] = cm[src[-1*stride] - d];

                    src[ 0*stride] = cm[src[ 0*stride] + d];

                }

                return 1;

            }

        }

    }

    return 0;

}


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

     FileContext *c = h->priv_data;

+    int r = write(c->fd, buf, size);
+
     return (-1 == r)?AVERROR(errno):r;

 }

static int file_write(URLContext *h, const unsigned char *buf, int size)

{

    FileContext *c = h->priv_data;

    int r = write(c->fd, buf, size);

    return (-1 == r)?AVERROR(errno):r;

}


--- a/source.c
+++ b/source.c
@@ -10,6 +10,6 @@
         /* RTP payload type */
         hd = s->rtp_hd;
     }
+    ret = ffurl_write(hd, buf, size);
+    return ret;
+}

static int rtp_write(URLContext *h, const uint8_t *buf, int size)
{
    RTPContext *s = h->priv_data;
    int ret;
    URLContext *hd;
    if (RTP_PT_IS_RTCP(buf[1])) {
        /* RTCP payload type */
        hd = s->rtcp_hd;
    } else {
        /* RTP payload type */
        hd = s->rtp_hd;
    }
    ret = ffurl_write(hd, buf, size);
    return ret;
}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     if (f->last_error == 0) {

         f->last_error = ret;
+
+    }

 }

static void qemu_file_set_error(QEMUFile *f, int ret)

{

    if (f->last_error == 0) {

        f->last_error = ret;

    }

}


static int tm2_read_deltas(TM2Context *ctx, int stream_id)

{

    int d, mb;

    int i, v;

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

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

    av_assert2(mb < 32);

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

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

        return AVERROR_INVALIDDATA;

    }

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

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

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

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

        else

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

    }

    for (; i < TM2_DELTAS; i++)

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

    return 0;

}


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

         buf->pixel_fmts = ff_copy_int_list(pixel_fmts);
+
+        if (!buf->pixel_fmts)
+
+            return AVERROR(ENOMEM);
+
     }

static av_cold int vsink_init(AVFilterContext *ctx, void *opaque)

{

    BufferSinkContext *buf = ctx->priv;

    AVBufferSinkParams *params = opaque;

    if (params && params->pixel_fmts) {

        const int *pixel_fmts = params->pixel_fmts;

        buf->pixel_fmts = ff_copy_int_list(pixel_fmts);

        if (!buf->pixel_fmts)

            return AVERROR(ENOMEM);

    }

    return common_init(ctx);

}


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

     TeletextContext *ctx = avctx->priv_data;
+

+
     av_dlog(avctx, "lines_total=%u\n", ctx->lines_processed);

     while (ctx->nb_pages)

static int teletext_close_decoder(AVCodecContext *avctx)

{

    TeletextContext *ctx = avctx->priv_data;

    av_dlog(avctx, "lines_total=%u\n", ctx->lines_processed);

    while (ctx->nb_pages)

        subtitle_rect_free(&ctx->pages[--ctx->nb_pages].sub_rect);

    av_freep(&ctx->pages);

    vbi_dvb_demux_delete(ctx->dx);

    vbi_decoder_delete(ctx->vbi);

    ctx->dx = NULL;

    ctx->vbi = NULL;

    ctx->pts = AV_NOPTS_VALUE;

    return 0;

}


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

     while (band < num_bands) {
+
+        band_type = get_bits(gb, 4);
+
+        run_len   = 1;
+
         do {

             run = get_bits(gb, bits_per_sect);

static int on2avc_decode_band_types(On2AVCContext *c, GetBitContext *gb)

{

    int bits_per_sect = c->is_long ? 5 : 3;

    int esc_val = (1 << bits_per_sect) - 1;

    int num_bands = c->num_bands * c->num_windows;

    int band = 0, i, band_type, run_len, run;

    while (band < num_bands) {

        band_type = get_bits(gb, 4);

        run_len   = 1;

        do {

            run = get_bits(gb, bits_per_sect);

            run_len += run;

        } while (run == esc_val);

        if (band + run_len > num_bands) {

            av_log(c->avctx, AV_LOG_ERROR, "Invalid band type run\n");

            return AVERROR_INVALIDDATA;

        }

        for (i = band; i < band + run_len; i++) {

            c->band_type[i]    = band_type;

            c->band_run_end[i] = band + run_len;

        }

        band += run_len;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static ssize_t flush_buf(VirtIOSerialPort *port, const uint8_t *buf, size_t len)
+
+{
+
+    VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);

     ssize_t ret;

static ssize_t flush_buf(VirtIOSerialPort *port, const uint8_t *buf, size_t len)

{

    VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);

    ssize_t ret;

    ret = qemu_chr_write(vcon->chr, buf, len);

    trace_virtio_console_flush_buf(port->id, len, ret);

    return ret;

}


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

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

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

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

           unsigned facs_tbl_offset, unsigned dsdt_tbl_offset,

           const char *oem_id, const char *oem_table_id)

{

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

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

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

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

    bios_linker_loader_add_pointer(linker,

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

        ACPI_BUILD_TABLE_FILE, facs_tbl_offset);

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

    fadt_setup(fadt, pm);

    bios_linker_loader_add_pointer(linker,

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

        ACPI_BUILD_TABLE_FILE, dsdt_tbl_offset);

    build_header(linker, table_data,

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

}