--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 MemTxResult memory_region_dispatch_write(MemoryRegion *mr,
                                          hwaddr addr,
                                          uint64_t data,
+                                         unsigned size,
+                                         MemTxAttrs attrs)
+{
+    if (!memory_region_access_valid(mr, addr, size, true)) {
+        unassigned_mem_write(mr, addr, data, size);
         return MEMTX_DECODE_ERROR;
     adjust_endianness(mr, &data, size);
     if (mr->ops->write) {

MemTxResult memory_region_dispatch_write(MemoryRegion *mr,
                                         hwaddr addr,
                                         uint64_t data,
                                         unsigned size,
                                         MemTxAttrs attrs)
{
    if (!memory_region_access_valid(mr, addr, size, true)) {
        unassigned_mem_write(mr, addr, data, size);
        return MEMTX_DECODE_ERROR;
    adjust_endianness(mr, &data, size);
    if (mr->ops->write) {
        return access_with_adjusted_size(addr, &data, size,
                                         mr->ops->impl.min_access_size,
                                         mr->ops->impl.max_access_size,
                                         memory_region_write_accessor, mr,
                                         attrs);
    } else if (mr->ops->write_with_attrs) {
        return
            access_with_adjusted_size(addr, &data, size,
                                      mr->ops->impl.min_access_size,
                                      mr->ops->impl.max_access_size,
                                      memory_region_write_with_attrs_accessor,
                                      mr, attrs);
    } else {
        return access_with_adjusted_size(addr, &data, size, 1, 4,
                                         memory_region_oldmmio_write_accessor,
                                         mr, attrs);


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

     fdctrl->state &= ~FD_CTRL_SLEEP;

+    if (FD_STATE(fdctrl->data_state) == FD_STATE_CMD) {

         FLOPPY_ERROR("can't read data in CMD state\n");

static uint32_t fdctrl_read_data (fdctrl_t *fdctrl)

{

    fdrive_t *cur_drv;

    uint32_t retval = 0;

    int pos, len;

    cur_drv = get_cur_drv(fdctrl);

    fdctrl->state &= ~FD_CTRL_SLEEP;

    if (FD_STATE(fdctrl->data_state) == FD_STATE_CMD) {

        FLOPPY_ERROR("can't read data in CMD state\n");

        return 0;

    }

    pos = fdctrl->data_pos;

    if (FD_STATE(fdctrl->data_state) == FD_STATE_DATA) {

        pos %= FD_SECTOR_LEN;

        if (pos == 0) {

            len = fdctrl->data_len - fdctrl->data_pos;

            if (len > FD_SECTOR_LEN)

                len = FD_SECTOR_LEN;

            bdrv_read(cur_drv->bs, fd_sector(cur_drv),

                      fdctrl->fifo, len);

        }

    }

    retval = fdctrl->fifo[pos];

    if (++fdctrl->data_pos == fdctrl->data_len) {

        fdctrl->data_pos = 0;

        /* Switch from transfer mode to status mode

         * then from status mode to command mode

         */

        if (FD_STATE(fdctrl->data_state) == FD_STATE_DATA) {

            fdctrl_stop_transfer(fdctrl, 0x20, 0x00, 0x00);

        } else {

            fdctrl_reset_fifo(fdctrl);

            fdctrl_reset_irq(fdctrl);

        }

    }

    FLOPPY_DPRINTF("data register: 0x%02x\n", retval);

    return retval;

}


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

         free(entry->match);

+        free(entry);
+
+    }
+
+    acl->nentries = 0;

 }

void qemu_acl_reset(qemu_acl *acl)

{

    qemu_acl_entry *entry;

    /* Put back to deny by default, so there is no window

     * of "open access" while the user re-initializes the

     * access control list */

    acl->defaultDeny = 1;

    TAILQ_FOREACH(entry, &acl->entries, next) {

        TAILQ_REMOVE(&acl->entries, entry, next);

        free(entry->match);

        free(entry);

    }

    acl->nentries = 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static void user_monitor_complete(void *opaque, QObject *ret_data)
+
+{
+
     MonitorCompletionData *data = (MonitorCompletionData *)opaque;
+
+

     if (ret_data) {

static void user_monitor_complete(void *opaque, QObject *ret_data)

{

    MonitorCompletionData *data = (MonitorCompletionData *)opaque;

    if (ret_data) {

        data->user_print(data->mon, ret_data);

    }

    monitor_resume(data->mon);

    g_free(data);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void qvirtio_pci_set_queue_address(QVirtioDevice *d, uint32_t pfn)

+{

     QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;

static void qvirtio_pci_set_queue_address(QVirtioDevice *d, uint32_t pfn)

{

    QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;

    qpci_io_writel(dev->pdev, dev->addr + VIRTIO_PCI_QUEUE_PFN, pfn);

}


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

     sigprocmask(SIG_SETMASK, &set, 0);

+
+
+    pending = atomic_xchg(&ts->signal_pending, 1);
+
+

     return pending;

int block_signals(void)

{

    TaskState *ts = (TaskState *)thread_cpu->opaque;

    sigset_t set;

    int pending;

    /* It's OK to block everything including SIGSEGV, because we won't

     * run any further guest code before unblocking signals in

     * process_pending_signals().

     */

    sigfillset(&set);

    sigprocmask(SIG_SETMASK, &set, 0);

    pending = atomic_xchg(&ts->signal_pending, 1);

    return pending;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void hybrid4_8_12_cx(float (*in)[2], float (*out)[32][2], const float (*filter)[7][2], int N, int len)

+{
+
+    int i, j, ssb;
+
+

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

static void hybrid4_8_12_cx(float (*in)[2], float (*out)[32][2], const float (*filter)[7][2], int N, int len)

{

    int i, j, ssb;

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

        for (ssb = 0; ssb < N; ssb++) {

            float sum_re = filter[ssb][6][0] * in[6][0], sum_im = filter[ssb][6][0] * in[6][1];

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

                float in0_re = in[j][0];

                float in0_im = in[j][1];

                float in1_re = in[12-j][0];

                float in1_im = in[12-j][1];

                sum_re += filter[ssb][j][0] * (in0_re + in1_re) - filter[ssb][j][1] * (in0_im - in1_im);

                sum_im += filter[ssb][j][0] * (in0_im + in1_im) + filter[ssb][j][1] * (in0_re - in1_re);

            }

            out[ssb][i][0] = sum_re;

            out[ssb][i][1] = sum_im;

        }

    }

}


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

     if (!job->job_type->set_speed) {
+
+        return -ENOTSUP;
+
+    }
+
     rc = job->job_type->set_speed(job, value);

     if (rc == 0) {

int block_job_set_speed(BlockJob *job, int64_t value)

{

    int rc;

    if (!job->job_type->set_speed) {

        return -ENOTSUP;

    }

    rc = job->job_type->set_speed(job, value);

    if (rc == 0) {

        job->speed = value;

    }

    return rc;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void do_info_roms(Monitor *mon, const QDict *qdict)

 {
+
     Rom *rom;

void do_info_roms(Monitor *mon, const QDict *qdict)

{

    Rom *rom;

    QTAILQ_FOREACH(rom, &roms, next) {

        if (!rom->fw_file) {

            monitor_printf(mon, "addr=" TARGET_FMT_plx

                           " size=0x%06zx mem=%s name=\"%s\"\n",

                           rom->addr, rom->romsize,

                           rom->isrom ? "rom" : "ram",

                           rom->name);

        } else {

            monitor_printf(mon, "fw=%s/%s"

                           " size=0x%06zx name=\"%s\"\n",

                           rom->fw_dir,

                           rom->fw_file,

                           rom->romsize,

                           rom->name);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
         dev = s->pbdev[idx];

         if (dev && dev->state != ZPCI_FS_RESERVED) {
+
+            return dev;
+
+        }
+
     }

S390PCIBusDevice *s390_pci_find_next_avail_dev(S390PCIBusDevice *pbdev)

{

    int idx = 0;

    S390PCIBusDevice *dev = NULL;

    S390pciState *s = s390_get_phb();

    if (pbdev) {

        idx = (pbdev->fh & FH_MASK_INDEX) + 1;

    }

    for (; idx < PCI_SLOT_MAX; idx++) {

        dev = s->pbdev[idx];

        if (dev && dev->state != ZPCI_FS_RESERVED) {

            return dev;

        }

    }

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static CharDriverState *qmp_chardev_open_parallel(ChardevHostdev *parallel,

                                                   Error **errp)
+
 {

 #ifdef HAVE_CHARDEV_PARPORT

static CharDriverState *qmp_chardev_open_parallel(ChardevHostdev *parallel,

                                                  Error **errp)

{

#ifdef HAVE_CHARDEV_PARPORT

    int fd;

    fd = qmp_chardev_open_file_source(parallel->device, O_RDWR, errp);

    if (error_is_set(errp)) {

        return NULL;

    }

    return qemu_chr_open_pp_fd(fd);

#else

    error_setg(errp, "character device backend type 'parallel' not supported");

    return NULL;

#endif

}


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

         tc[1] = tc0_table[index_a][bS[1]];

+        tc[2] = tc0_table[index_a][bS[2]];
+
+        tc[3] = tc0_table[index_a][bS[3]];
+
+        h->h264dsp.h264_h_loop_filter_luma(pix, stride, alpha, beta, tc);

     } else {

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

    const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);

    const unsigned int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset;

    const int alpha = alpha_table[index_a];

    const int beta  = beta_table[qp - qp_bd_offset + h->slice_beta_offset];

    if (alpha ==0 || beta == 0) return;

    if( bS[0] < 4 || !intra ) {

        int8_t tc[4];

        tc[0] = tc0_table[index_a][bS[0]];

        tc[1] = tc0_table[index_a][bS[1]];

        tc[2] = tc0_table[index_a][bS[2]];

        tc[3] = tc0_table[index_a][bS[3]];

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

    } else {

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

    }

}


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

     switch (code) {

+    case BRK_OVERFLOW:
+
+    case BRK_DIVZERO:
+
+        info->si_signo = TARGET_SIGFPE;

         info->si_code = (code == BRK_OVERFLOW) ? FPE_INTOVF : FPE_INTDIV;

static int do_break(CPUMIPSState *env, target_siginfo_t *info,

                    unsigned int code)

{

    int ret = -1;

    switch (code) {

    case BRK_OVERFLOW:

    case BRK_DIVZERO:

        info->si_signo = TARGET_SIGFPE;

        info->si_code = (code == BRK_OVERFLOW) ? FPE_INTOVF : FPE_INTDIV;

        break;

    default:

        break;

    }

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+static RAMBlock *unqueue_page(RAMState *rs, ram_addr_t *offset,

                               ram_addr_t *ram_addr_abs)

 {

     RAMBlock *block = NULL;
+

     qemu_mutex_lock(&rs->src_page_req_mutex);

static RAMBlock *unqueue_page(RAMState *rs, ram_addr_t *offset,

                              ram_addr_t *ram_addr_abs)

{

    RAMBlock *block = NULL;

    qemu_mutex_lock(&rs->src_page_req_mutex);

    if (!QSIMPLEQ_EMPTY(&rs->src_page_requests)) {

        struct RAMSrcPageRequest *entry =

                                QSIMPLEQ_FIRST(&rs->src_page_requests);

        block = entry->rb;

        *offset = entry->offset;

        *ram_addr_abs = (entry->offset + entry->rb->offset) &

                        TARGET_PAGE_MASK;

        if (entry->len > TARGET_PAGE_SIZE) {

            entry->len -= TARGET_PAGE_SIZE;

            entry->offset += TARGET_PAGE_SIZE;

        } else {

            memory_region_unref(block->mr);

            QSIMPLEQ_REMOVE_HEAD(&rs->src_page_requests, next_req);

            g_free(entry);

        }

    }

    qemu_mutex_unlock(&rs->src_page_req_mutex);

    return block;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int parse_metadata_ext(DBEContext *s)
+
+{

     if (s->mtd_ext_size)

static int parse_metadata_ext(DBEContext *s)

{

    if (s->mtd_ext_size)

        skip_input(s, s->key_present + s->mtd_ext_size + 1);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time)

 {

     AVFormatContext *s = priv_data;
+
     struct dshow_ctx *ctx = s->priv_data;

     AVPacketList **ppktl, *pktl_next;

callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time)

{

    AVFormatContext *s = priv_data;

    struct dshow_ctx *ctx = s->priv_data;

    AVPacketList **ppktl, *pktl_next;

//    dump_videohdr(s, vdhdr);

    WaitForSingleObject(ctx->mutex, INFINITE);

    if(shall_we_drop(s, index))

        goto fail;

    pktl_next = av_mallocz(sizeof(AVPacketList));

    if(!pktl_next)

        goto fail;

    if(av_new_packet(&pktl_next->pkt, buf_size) < 0) {

        av_free(pktl_next);

        goto fail;

    }

    pktl_next->pkt.stream_index = index;

    pktl_next->pkt.pts = time;

    memcpy(pktl_next->pkt.data, buf, buf_size);

    for(ppktl = &ctx->pktl ; *ppktl ; ppktl = &(*ppktl)->next);

    *ppktl = pktl_next;

    ctx->curbufsize[index] += buf_size;

    SetEvent(ctx->event[1]);

    ReleaseMutex(ctx->mutex);

    return;

fail:

    ReleaseMutex(ctx->mutex);

    return;

}


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

     qemu_mutex_lock(&pool->lock);
+
+    if (elem->state == THREAD_QUEUED &&
+
+        /* No thread has yet started working on elem. we can try to "steal"
+
          * the item from the worker if we can get a signal from the

          * semaphore.  Because this is non-blocking, we can do it with

static void thread_pool_cancel(BlockDriverAIOCB *acb)

{

    ThreadPoolElement *elem = (ThreadPoolElement *)acb;

    ThreadPool *pool = elem->pool;

    trace_thread_pool_cancel(elem, elem->common.opaque);

    qemu_mutex_lock(&pool->lock);

    if (elem->state == THREAD_QUEUED &&

        /* No thread has yet started working on elem. we can try to "steal"

         * the item from the worker if we can get a signal from the

         * semaphore.  Because this is non-blocking, we can do it with

         * the lock taken and ensure that elem will remain THREAD_QUEUED.

         */

        qemu_sem_timedwait(&pool->sem, 0) == 0) {

        QTAILQ_REMOVE(&pool->request_list, elem, reqs);

        elem->state = THREAD_CANCELED;

        event_notifier_set(&pool->notifier);

    } else {

        pool->pending_cancellations++;

        while (elem->state != THREAD_CANCELED && elem->state != THREAD_DONE) {

            qemu_cond_wait(&pool->check_cancel, &pool->lock);

        }

        pool->pending_cancellations--;

    }

    qemu_mutex_unlock(&pool->lock);

}


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

             tlb_entry->addr_write = (tlb_entry->addr_write & TARGET_PAGE_MASK) | TLB_NOTDIRTY;

+        }
+
+    }
+
+}

static inline void tlb_reset_dirty_range(CPUTLBEntry *tlb_entry,

                                         unsigned long start, unsigned long length)

{

    unsigned long addr;

    if ((tlb_entry->addr_write & ~TARGET_PAGE_MASK) == io_mem_ram.ram_addr) {

        addr = (tlb_entry->addr_write & TARGET_PAGE_MASK) + tlb_entry->addend;

        if ((addr - start) < length) {

            tlb_entry->addr_write = (tlb_entry->addr_write & TARGET_PAGE_MASK) | TLB_NOTDIRTY;

        }

    }

}


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

     if (memcmp(buf, "FLV", 3))

+        return AVERROR_INVALIDDATA;

     buf      += 13;

static int parse_header(OutputStream *os, const uint8_t *buf, int buf_size)

{

    if (buf_size < 13)

        return AVERROR_INVALIDDATA;

    if (memcmp(buf, "FLV", 3))

        return AVERROR_INVALIDDATA;

    buf      += 13;

    buf_size -= 13;

    while (buf_size >= 11 + 4) {

        int type = buf[0];

        int size = AV_RB24(&buf[1]) + 11 + 4;

        if (size > buf_size)

            return AVERROR_INVALIDDATA;

        if (type == 8 || type == 9) {

            if (os->nb_extra_packets > FF_ARRAY_ELEMS(os->extra_packets))

                return AVERROR_INVALIDDATA;

            os->extra_packet_sizes[os->nb_extra_packets] = size;

            os->extra_packets[os->nb_extra_packets] = av_malloc(size);

            if (!os->extra_packets[os->nb_extra_packets])

                return AVERROR(ENOMEM);

            memcpy(os->extra_packets[os->nb_extra_packets], buf, size);

            os->nb_extra_packets++;

        } else if (type == 0x12) {

            if (os->metadata)

                return AVERROR_INVALIDDATA;

            os->metadata_size = size - 11 - 4;

            os->metadata      = av_malloc(os->metadata_size);

            if (!os->metadata)

                return AVERROR(ENOMEM);

            memcpy(os->metadata, buf + 11, os->metadata_size);

        }

        buf      += size;

        buf_size -= size;

    }

    if (!os->metadata)

        return AVERROR_INVALIDDATA;

    return 0;

}


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

+    if (HAVE_NEON)
+
+        ff_rv34dsp_init_neon(c, dsp);
+
+    if (ARCH_X86)

         ff_rv34dsp_init_x86(c, dsp);

av_cold void ff_rv34dsp_init(RV34DSPContext *c, DSPContext* dsp) {

    c->rv34_inv_transform    = rv34_inv_transform_noround_c;

    c->rv34_inv_transform_dc = rv34_inv_transform_dc_noround_c;

    c->rv34_idct_add    = rv34_idct_add_c;

    c->rv34_idct_dc_add = rv34_idct_dc_add_c;

    if (HAVE_NEON)

        ff_rv34dsp_init_neon(c, dsp);

    if (ARCH_X86)

        ff_rv34dsp_init_x86(c, dsp);

}


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

     for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {
+
         AioContext *ctx = bdrv_get_aio_context(bs);

         if (ctx == qemu_get_aio_context()) {

void iothread_stop_all(void)

{

    Object *container = object_get_objects_root();

    BlockDriverState *bs;

    BdrvNextIterator it;

    for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {

        AioContext *ctx = bdrv_get_aio_context(bs);

        if (ctx == qemu_get_aio_context()) {

            continue;

        }

        aio_context_acquire(ctx);

        bdrv_set_aio_context(bs, qemu_get_aio_context());

        aio_context_release(ctx);

    }

    object_child_foreach(container, iothread_stop, NULL);

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
         AVChapter *chapter = fmt_ctx->chapters[i];

+
+        writer_print_section_header(w, SECTION_ID_CHAPTER);
+
+        print_int("id", chapter->id);
+
         print_q  ("time_base", chapter->time_base, '/');

         print_int("start", chapter->start);

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

{

    int i;

    writer_print_section_header(w, SECTION_ID_CHAPTERS);

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

        AVChapter *chapter = fmt_ctx->chapters[i];

        writer_print_section_header(w, SECTION_ID_CHAPTER);

        print_int("id", chapter->id);

        print_q  ("time_base", chapter->time_base, '/');

        print_int("start", chapter->start);

        print_time("start_time", chapter->start, &chapter->time_base);

        print_int("end", chapter->end);

        print_time("end_time", chapter->end, &chapter->time_base);

        show_tags(w, chapter->metadata, SECTION_ID_CHAPTER_TAGS);

        writer_print_section_footer(w);

    }

    writer_print_section_footer(w);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 char *object_property_print(Object *obj, const char *name, bool human,

+                            Error **errp)

+{

     StringOutputVisitor *mo;

char *object_property_print(Object *obj, const char *name, bool human,

                            Error **errp)

{

    StringOutputVisitor *mo;

    char *string;

    mo = string_output_visitor_new(human);

    object_property_get(obj, string_output_get_visitor(mo), name, errp);

    string = string_output_get_string(mo);

    string_output_visitor_cleanup(mo);

    return string;

}


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

+
     res = src1 - src2;

     if (((res ^ src1) & SIGNBIT64) && ((src1 ^ src2) & SIGNBIT64)) {

uint64_t HELPER(neon_sub_saturate_s64)(uint64_t src1, uint64_t src2)

{

    uint64_t res;

    res = src1 - src2;

    if (((res ^ src1) & SIGNBIT64) && ((src1 ^ src2) & SIGNBIT64)) {

        env->QF = 1;

        res = ((int64_t)src1 >> 63) ^ ~SIGNBIT64;

    }

    return res;

}


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

     if (lag) { /* Voiced */
+
         int16_t *vector_ptr = buf + PITCH_MAX;

         /* Attenuate */

static void residual_interp(int16_t *buf, int16_t *out, int lag,

                            int gain, int *rseed)

{

    int i;

    if (lag) { /* Voiced */

        int16_t *vector_ptr = buf + PITCH_MAX;

        /* Attenuate */

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

            out[i] = vector_ptr[i - lag] * 3 >> 2;

        av_memcpy_backptr((uint8_t*)(out + lag), lag * sizeof(*out),

                          (FRAME_LEN - lag) * sizeof(*out));

    } else {  /* Unvoiced */

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

            *rseed = *rseed * 521 + 259;

            out[i] = gain * *rseed >> 15;

        }

        memset(buf, 0, (FRAME_LEN + PITCH_MAX) * sizeof(*buf));

    }

}


int float32_is_nan( float32 a1 )

{

    float32u u;

    uint64_t a;

    u.f = a1;

    a = u.i;

    return ( 0xFF800000 < ( a<<1 ) );

}


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

     ioport_write(2, addr, val);

+#ifdef CONFIG_KQEMU
+
+    if (env)
+
         env->last_io_time = cpu_get_time_fast();

 #endif

void cpu_outl(CPUState *env, pio_addr_t addr, uint32_t val)

{

    LOG_IOPORT("outl: %04"FMT_pioaddr" %08"PRIx32"\n", addr, val);

    ioport_write(2, addr, val);

#ifdef CONFIG_KQEMU

    if (env)

        env->last_io_time = cpu_get_time_fast();

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static void tlb_info(Monitor *mon)
+
 {

+    CPUState *env;
+
+    int l1, l2;

     uint32_t pgd, pde, pte;

@@ -13,7 +13,7 @@
     env = mon_get_cpu();

+
     if (!(env->cr[0] & CR0_PG_MASK)) {

         monitor_printf(mon, "PG disabled\n");

static void tlb_info(Monitor *mon)

{

    CPUState *env;

    int l1, l2;

    uint32_t pgd, pde, pte;

    env = mon_get_cpu();

    if (!(env->cr[0] & CR0_PG_MASK)) {

        monitor_printf(mon, "PG disabled\n");

        return;

    }

    pgd = env->cr[3] & ~0xfff;

    for(l1 = 0; l1 < 1024; l1++) {

        cpu_physical_memory_read(pgd + l1 * 4, (uint8_t *)&pde, 4);

        pde = le32_to_cpu(pde);

        if (pde & PG_PRESENT_MASK) {

            if ((pde & PG_PSE_MASK) && (env->cr[4] & CR4_PSE_MASK)) {

                print_pte(mon, (l1 << 22), pde, ~((1 << 20) - 1));

            } else {

                for(l2 = 0; l2 < 1024; l2++) {

                    cpu_physical_memory_read((pde & ~0xfff) + l2 * 4,

                                             (uint8_t *)&pte, 4);

                    pte = le32_to_cpu(pte);

                    if (pte & PG_PRESENT_MASK) {

                        print_pte(mon, (l1 << 22) + (l2 << 12),

                                  pte & ~PG_PSE_MASK,

                                  ~0xfff);

                    }

                }

            }

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int get_packet_size(const uint8_t *buf, int size)

 {
+
+    int score, fec_score, dvhs_score;
+

     if (size < (TS_FEC_PACKET_SIZE * 5 + 1))

static int get_packet_size(const uint8_t *buf, int size)

{

    int score, fec_score, dvhs_score;

    if (size < (TS_FEC_PACKET_SIZE * 5 + 1))

        return AVERROR_INVALIDDATA;

    score      = analyze(buf, size, TS_PACKET_SIZE, NULL);

    dvhs_score = analyze(buf, size, TS_DVHS_PACKET_SIZE, NULL);

    fec_score  = analyze(buf, size, TS_FEC_PACKET_SIZE, NULL);

    av_dlog(NULL, "score: %d, dvhs_score: %d, fec_score: %d \n",

            score, dvhs_score, fec_score);

    if (score > fec_score && score > dvhs_score)

        return TS_PACKET_SIZE;

    else if (dvhs_score > score && dvhs_score > fec_score)

        return TS_DVHS_PACKET_SIZE;

    else if (score < fec_score && dvhs_score < fec_score)

        return TS_FEC_PACKET_SIZE;

    else

        return AVERROR_INVALIDDATA;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void handle_msr(DisasContext *s, uint32_t insn, unsigned int op0,

                        unsigned int op1, unsigned int op2,
+
+                       unsigned int crn, unsigned int crm, unsigned int rt)

 {

static void handle_msr(DisasContext *s, uint32_t insn, unsigned int op0,

                       unsigned int op1, unsigned int op2,

                       unsigned int crn, unsigned int crm, unsigned int rt)

{

    unsupported_encoding(s, insn);

}


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

 {
+
     UNINState *s = opaque;

     PCIHostState *phb = PCI_HOST_BRIDGE(s);

static uint64_t unin_data_read(void *opaque, hwaddr addr,

                               unsigned len)

{

    UNINState *s = opaque;

    PCIHostState *phb = PCI_HOST_BRIDGE(s);

    uint32_t val;

    val = pci_data_read(phb->bus,

                        unin_get_config_reg(phb->config_reg, addr),

                        len);

    UNIN_DPRINTF("read addr %" TARGET_FMT_plx " len %d val %x\n",

                 addr, len, val);

    return val;

}


int cpu_x86_signal_handler(int host_signum, struct siginfo *info,

                           void *puc)

{

    uint32_t *regs = (uint32_t *)(info + 1);

    void *sigmask = (regs + 20);

    unsigned long pc;

    int is_write;

    uint32_t insn;

    /* XXX: is there a standard glibc define ? */

    pc = regs[1];

    /* XXX: need kernel patch to get write flag faster */

    is_write = 0;

    insn = *(uint32_t *)pc;

    if ((insn >> 30) == 3) {

      switch((insn >> 19) & 0x3f) {

      case 0x05: // stb

      case 0x06: // sth

      case 0x04: // st

      case 0x07: // std

      case 0x24: // stf

      case 0x27: // stdf

      case 0x25: // stfsr

	is_write = 1;

	break;

      }

    }

    return handle_cpu_signal(pc, (unsigned long)info->si_addr,

                             is_write, sigmask);

}


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

     VncState *vs = cinfo->client_data;

+    Buffer *buffer = &vs->tight_jpeg;
+
+
+
     buffer->offset = buffer->capacity;

     buffer_reserve(buffer, 2048);

static boolean jpeg_empty_output_buffer(j_compress_ptr cinfo)

{

    VncState *vs = cinfo->client_data;

    Buffer *buffer = &vs->tight_jpeg;

    buffer->offset = buffer->capacity;

    buffer_reserve(buffer, 2048);

    jpeg_init_destination(cinfo);

    return TRUE;

}


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

         assert(replay_data_kind == EVENT_INSTRUCTION);

+        return event == EVENT_INSTRUCTION;
+
+    }
+
+

     while (true) {

bool replay_next_event_is(int event)

{

    bool res = false;

    /* nothing to skip - not all instructions used */

    if (replay_state.instructions_count != 0) {

        assert(replay_data_kind == EVENT_INSTRUCTION);

        return event == EVENT_INSTRUCTION;

    }

    while (true) {

        if (event == replay_data_kind) {

            res = true;

        }

        switch (replay_data_kind) {

        case EVENT_SHUTDOWN:

            replay_finish_event();

            qemu_system_shutdown_request();

            break;

        default:

            /* clock, time_t, checkpoint and other events */

            return res;

        }

    }

    return res;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 START_TEST(qobject_to_qdict_test)
+
 {

     fail_unless(qobject_to_qdict(QOBJECT(tests_dict)) == tests_dict);

START_TEST(qobject_to_qdict_test)

{

    fail_unless(qobject_to_qdict(QOBJECT(tests_dict)) == tests_dict);

}


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

 {

+    int i;
+
+    BDRVVmdkState *s = bs->opaque;

static void vmdk_free_extents(BlockDriverState *bs)

{

    int i;

    BDRVVmdkState *s = bs->opaque;

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

        g_free(s->extents[i].l1_table);

        g_free(s->extents[i].l2_cache);

        g_free(s->extents[i].l1_backup_table);

    }

    g_free(s->extents);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     FFPsyPreprocessContext *ctx;

     int i;
+
     float cutoff_coeff = 0;

     ctx        = av_mallocz(sizeof(FFPsyPreprocessContext));

av_cold struct FFPsyPreprocessContext* ff_psy_preprocess_init(AVCodecContext *avctx)

{

    FFPsyPreprocessContext *ctx;

    int i;

    float cutoff_coeff = 0;

    ctx        = av_mallocz(sizeof(FFPsyPreprocessContext));

    ctx->avctx = avctx;

    if (avctx->cutoff > 0)

        cutoff_coeff = 2.0 * avctx->cutoff / avctx->sample_rate;

    if (cutoff_coeff)

    ctx->fcoeffs = ff_iir_filter_init_coeffs(FF_FILTER_TYPE_BUTTERWORTH, FF_FILTER_MODE_LOWPASS,

                                             FILT_ORDER, cutoff_coeff, 0.0, 0.0);

    if (ctx->fcoeffs) {

        ctx->fstate = av_mallocz(sizeof(ctx->fstate[0]) * avctx->channels);

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

            ctx->fstate[i] = ff_iir_filter_init_state(FILT_ORDER);

    }

    return ctx;

}


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

 	ctrl->base = base;

+	ctrl->env = env;
+
+	ctrl->nr_channels = nr_channels;
+
+	ctrl->channels = qemu_mallocz(sizeof ctrl->channels[0] * nr_channels);

 	if (!ctrl->channels)

void *etraxfs_dmac_init(CPUState *env,

			target_phys_addr_t base, int nr_channels)

{

	struct fs_dma_ctrl *ctrl = NULL;

	int i;

	ctrl = qemu_mallocz(sizeof *ctrl);

	if (!ctrl)

		return NULL;

	ctrl->base = base;

	ctrl->env = env;

	ctrl->nr_channels = nr_channels;

	ctrl->channels = qemu_mallocz(sizeof ctrl->channels[0] * nr_channels);

	if (!ctrl->channels)

		goto err;

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

	{

		ctrl->channels[i].regmap = cpu_register_io_memory(0,

								  dma_read,

								  dma_write,

								  ctrl);

		cpu_register_physical_memory (base + i * 0x2000,

					      sizeof ctrl->channels[i].regs,

					      ctrl->channels[i].regmap);

	}

	/* Hax, we only support one DMA controller at a time.  */

	etraxfs_dmac = ctrl;

	return ctrl;

  err:

	qemu_free(ctrl->channels);

	qemu_free(ctrl);

	return NULL;

}


--- 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,11 +1,11 @@
 static void qmp_input_type_str(Visitor *v, char **obj, const char *name,

+                               Error **errp)
+
 {

     QmpInputVisitor *qiv = to_qiv(v);
+
     QObject *qobj = qmp_input_get_object(qiv, name, true);

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

                               Error **errp)

{

    QmpInputVisitor *qiv = to_qiv(v);

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

    if (!qobj || qobject_type(qobj) != QTYPE_QSTRING) {

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

                   "string");

        return;

    }

    *obj = g_strdup(qstring_get_str(qobject_to_qstring(qobj)));

}


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

     if (!env->watchpoint_hit)
+
+        TAILQ_FOREACH(wp, &env->watchpoints, entry)
+
+            wp->flags &= ~BP_WATCHPOINT_HIT;
+

     if (debug_excp_handler)

static void cpu_handle_debug_exception(CPUState *env)

{

    CPUWatchpoint *wp;

    if (!env->watchpoint_hit)

        TAILQ_FOREACH(wp, &env->watchpoints, entry)

            wp->flags &= ~BP_WATCHPOINT_HIT;

    if (debug_excp_handler)

        debug_excp_handler(env);

}


--- a/source.c
+++ b/source.c
@@ -3,8 +3,8 @@
                            uint8_t *src, uint8_t *top, int size, int bpp)

 {
+
+    int i;

static void png_filter_row(DSPContext *dsp, uint8_t *dst, int filter_type,

                           uint8_t *src, uint8_t *top, int size, int bpp)

{

    int i;

    switch(filter_type) {

    case PNG_FILTER_VALUE_NONE:

        memcpy(dst, src, size);

        break;

    case PNG_FILTER_VALUE_SUB:

        dsp->diff_bytes(dst, src, src-bpp, size);

        memcpy(dst, src, bpp);

        break;

    case PNG_FILTER_VALUE_UP:

        dsp->diff_bytes(dst, src, top, size);

        break;

    case PNG_FILTER_VALUE_AVG:

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

            dst[i] = src[i] - (top[i] >> 1);

        for(; i < size; i++)

            dst[i] = src[i] - ((src[i-bpp] + top[i]) >> 1);

        break;

    case PNG_FILTER_VALUE_PAETH:

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

            dst[i] = src[i] - top[i];

        sub_png_paeth_prediction(dst+i, src+i, top+i, size-i, bpp);

        break;

    }

}


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

     QString *qstring = qerror_human(qerror);
+
+    loc_push_restore(&qerror->loc);
+
     error_report("%s", qstring_get_str(qstring));

     loc_pop(&qerror->loc);

void qerror_print(QError *qerror)

{

    QString *qstring = qerror_human(qerror);

    loc_push_restore(&qerror->loc);

    error_report("%s", qstring_get_str(qstring));

    loc_pop(&qerror->loc);

    QDECREF(qstring);

}


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

+
+    case 0x04:	/* DEBUG_ADDR */
+
+    case 0x08:	/* DEBUG_DATA */
+
     case 0x0c:	/* DEBUG_FLAG */

     case 0x10:	/* STATUS */

static void omap_mpui_write(void *opaque, target_phys_addr_t addr,

                            uint64_t value, unsigned size)

{

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

    if (size != 4) {

        return omap_badwidth_write32(opaque, addr, value);

    }

    switch (addr) {

    case 0x00:	/* CTRL */

        s->mpui_ctrl = value & 0x007fffff;

        break;

    case 0x04:	/* DEBUG_ADDR */

    case 0x08:	/* DEBUG_DATA */

    case 0x0c:	/* DEBUG_FLAG */

    case 0x10:	/* STATUS */

    /* Not in OMAP310 */

    case 0x14:	/* DSP_STATUS */

        OMAP_RO_REG(addr);

    case 0x18:	/* DSP_BOOT_CONFIG */

    case 0x1c:	/* DSP_MPUI_CONFIG */

        break;

    default:

        OMAP_BAD_REG(addr);

    }

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
     cirrus_invalidate_region(s, s->cirrus_blt_dstaddr,

 			     s->cirrus_blt_dstpitch, s->cirrus_blt_width,
+
+			     s->cirrus_blt_height);
+
+    cirrus_bitblt_reset(s);
+
     return 1;

 }

static int cirrus_bitblt_solidfill(CirrusVGAState *s, int blt_rop)

{

    cirrus_fill_t rop_func;

    if (blit_is_unsafe(s, true)) {

        return 0;

    }

    rop_func = cirrus_fill[rop_to_index[blt_rop]][s->cirrus_blt_pixelwidth - 1];

    rop_func(s, s->vga.vram_ptr + s->cirrus_blt_dstaddr,

             s->cirrus_blt_dstpitch,

             s->cirrus_blt_width, s->cirrus_blt_height);

    cirrus_invalidate_region(s, s->cirrus_blt_dstaddr,

			     s->cirrus_blt_dstpitch, s->cirrus_blt_width,

			     s->cirrus_blt_height);

    cirrus_bitblt_reset(s);

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void helper_stl_raw(uint64_t t0, uint64_t t1)

 {
+
     stl_raw(t1, t0);

 }

void helper_stl_raw(uint64_t t0, uint64_t t1)

{

    stl_raw(t1, t0);

}


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

         pci_for_each_bus(d->bus, piix4_update_bus_hotplug, s);

+    } else {
+
+        piix4_update_bus_hotplug(d->bus, s);
+
+    }

 }

static void piix4_pm_machine_ready(Notifier *n, void *opaque)

{

    PIIX4PMState *s = container_of(n, PIIX4PMState, machine_ready);

    PCIDevice *d = PCI_DEVICE(s);

    MemoryRegion *io_as = pci_address_space_io(d);

    uint8_t *pci_conf;

    pci_conf = d->config;

    pci_conf[0x5f] = 0x10 |

        (memory_region_present(io_as, 0x378) ? 0x80 : 0);

    pci_conf[0x63] = 0x60;

    pci_conf[0x67] = (memory_region_present(io_as, 0x3f8) ? 0x08 : 0) |

        (memory_region_present(io_as, 0x2f8) ? 0x90 : 0);

    if (s->use_acpi_pci_hotplug) {

        pci_for_each_bus(d->bus, piix4_update_bus_hotplug, s);

    } else {

        piix4_update_bus_hotplug(d->bus, s);

    }

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
                                            ((N  >> R_shift) & 0xFF) - GN,
                                            ((W  >> R_shift) & 0xFF) - GW,
                                            ((NW >> R_shift) & 0xFF) - GNW);
+        B = G + epic_decode_component_pred(dc,
+                                           ((N  >> B_shift) & 0xFF) - GN,
+                                           ((W  >> B_shift) & 0xFF) - GW,
+                                           ((NW >> B_shift) & 0xFF) - GNW);
+    } else {
         if (x)
             pred = curr_row[x - 1];
         else

static uint32_t epic_decode_pixel_pred(ePICContext *dc, int x, int y,
                                       const uint32_t *curr_row,
                                       const uint32_t *above_row)
{
    uint32_t N, W, NW, pred;
    unsigned delta;
    int GN, GW, GNW, R, G, B;
    if (x && y) {
        W  = curr_row[x  - 1];
        N  = above_row[x];
        NW = above_row[x - 1];
        GN  = (N  >> G_shift) & 0xFF;
        GW  = (W  >> G_shift) & 0xFF;
        GNW = (NW >> G_shift) & 0xFF;
        G = epic_decode_component_pred(dc, GN, GW, GNW);
        R = G + epic_decode_component_pred(dc,
                                           ((N  >> R_shift) & 0xFF) - GN,
                                           ((W  >> R_shift) & 0xFF) - GW,
                                           ((NW >> R_shift) & 0xFF) - GNW);
        B = G + epic_decode_component_pred(dc,
                                           ((N  >> B_shift) & 0xFF) - GN,
                                           ((W  >> B_shift) & 0xFF) - GW,
                                           ((NW >> B_shift) & 0xFF) - GNW);
    } else {
        if (x)
            pred = curr_row[x - 1];
        else
            pred = above_row[x];
        delta = ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung);
        R     = ((pred >> R_shift) & 0xFF) - TOSIGNED(delta);
        delta = ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung);
        G     = ((pred >> G_shift) & 0xFF) - TOSIGNED(delta);
        delta = ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung);
        B     = ((pred >> B_shift) & 0xFF) - TOSIGNED(delta);
    return (R << R_shift) | (G << G_shift) | (B << B_shift);


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

     /*

+     * Reason: it crashes FIXME find and document the real reason
+
+     */
+
+    dk->user_creatable = false;

 }

static void spapr_dr_connector_class_init(ObjectClass *k, void *data)

{

    DeviceClass *dk = DEVICE_CLASS(k);

    sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_CLASS(k);

    dk->reset = reset;

    dk->realize = realize;

    dk->unrealize = unrealize;

    drck->set_isolation_state = set_isolation_state;

    drck->set_allocation_state = set_allocation_state;

    drck->release_pending = release_pending;

    drck->set_signalled = set_signalled;

    /*

     * Reason: it crashes FIXME find and document the real reason

     */

    dk->user_creatable = false;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void xlnx_dp_set_dpdma(Object *obj, const char *name, Object *val,

                               Error **errp)

static void xlnx_dp_set_dpdma(Object *obj, const char *name, Object *val,

                              Error **errp)

{

    XlnxDPState *s = XLNX_DP(obj);

    if (s->console) {

        DisplaySurface *surface = qemu_console_surface(s->console);

        XlnxDPDMAState *dma = XLNX_DPDMA(val);

        xlnx_dpdma_set_host_data_location(dma, DP_GRAPHIC_DMA_CHANNEL,

                                          surface_data(surface));

    }

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     mr->terminates = true;

     mr->destructor = memory_region_destructor_rom_device;
+
+    mr->ram_addr = qemu_ram_alloc(size, mr);
+
+    mr->ram_addr |= cpu_register_io_memory(memory_region_read_thunk,
+
                                            memory_region_write_thunk,

                                            mr);

void memory_region_init_rom_device(MemoryRegion *mr,

                                   const MemoryRegionOps *ops,

                                   void *opaque,

                                   const char *name,

                                   uint64_t size)

{

    memory_region_init(mr, name, size);

    mr->ops = ops;

    mr->opaque = opaque;

    mr->terminates = true;

    mr->destructor = memory_region_destructor_rom_device;

    mr->ram_addr = qemu_ram_alloc(size, mr);

    mr->ram_addr |= cpu_register_io_memory(memory_region_read_thunk,

                                           memory_region_write_thunk,

                                           mr);

    mr->ram_addr |= IO_MEM_ROMD;

    mr->backend_registered = true;

}


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

     visitor_output_teardown(data, NULL);

+    visitor_output_setup(data, NULL);
+
 }

static void visitor_reset(TestOutputVisitorData *data)

{

    visitor_output_teardown(data, NULL);

    visitor_output_setup(data, NULL);

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     ConcatStream *cs = &cat->cur_file->streams[idx];

     AVBitStreamFilterContext *bsf;
+
+    int ret;
+
+
+
     if (cat->auto_convert && st->codecpar->codec_id == AV_CODEC_ID_H264 &&

         (st->codecpar->extradata_size < 4 || AV_RB32(st->codecpar->extradata) != 1)) {

static int detect_stream_specific(AVFormatContext *avf, int idx)

{

    ConcatContext *cat = avf->priv_data;

    AVStream *st = cat->avf->streams[idx];

    ConcatStream *cs = &cat->cur_file->streams[idx];

    AVBitStreamFilterContext *bsf;

    int ret;

    if (cat->auto_convert && st->codecpar->codec_id == AV_CODEC_ID_H264 &&

        (st->codecpar->extradata_size < 4 || AV_RB32(st->codecpar->extradata) != 1)) {

        av_log(cat->avf, AV_LOG_INFO,

               "Auto-inserting h264_mp4toannexb bitstream filter\n");

        if (!(bsf = av_bitstream_filter_init("h264_mp4toannexb"))) {

            av_log(avf, AV_LOG_ERROR, "h264_mp4toannexb bitstream filter "

                   "required for H.264 streams\n");

            return AVERROR_BSF_NOT_FOUND;

        }

        cs->bsf = bsf;

        cs->avctx = avcodec_alloc_context3(NULL);

        if (!cs->avctx)

            return AVERROR(ENOMEM);

        /* This really should be part of the bsf work.

           Note: input bitstream filtering will not work with bsf that

           create extradata from the first packet. */

        av_freep(&st->codecpar->extradata);

        st->codecpar->extradata_size = 0;

        ret = avcodec_parameters_to_context(cs->avctx, st->codecpar);

        if (ret < 0) {

            avcodec_free_context(&cs->avctx);

            return ret;

        }

    }

    return 0;

}


static sPAPREventLogEntry *rtas_event_log_dequeue(uint32_t event_mask)

{

    sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());

    sPAPREventLogEntry *entry = NULL;

    QTAILQ_FOREACH(entry, &spapr->pending_events, next) {

        const sPAPREventSource *source =

            rtas_event_log_to_source(spapr, entry->log_type);

        if (source->mask & event_mask) {

            break;

        }

    }

    if (entry) {

        QTAILQ_REMOVE(&spapr->pending_events, entry, next);

    }

    return entry;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
                    uint8_t *properties)
+{
+    Jpeg2000CodingStyle tmp;
+    int compno, ret;
+    if (bytestream2_get_bytes_left(&s->g) < 5)
     tmp.csty = bytestream2_get_byteu(&s->g);
     // get progression order
     tmp.prog_order = bytestream2_get_byteu(&s->g);

static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
                   uint8_t *properties)
{
    Jpeg2000CodingStyle tmp;
    int compno, ret;
    if (bytestream2_get_bytes_left(&s->g) < 5)
    tmp.csty = bytestream2_get_byteu(&s->g);
    // get progression order
    tmp.prog_order = bytestream2_get_byteu(&s->g);
    tmp.nlayers    = bytestream2_get_be16u(&s->g);
    tmp.mct        = bytestream2_get_byteu(&s->g); // multiple component transformation
    if ((ret = get_cox(s, &tmp)) < 0)
        return ret;
    for (compno = 0; compno < s->ncomponents; compno++)
        if (!(properties[compno] & HAD_COC))
            memcpy(c + compno, &tmp, sizeof(tmp));
    return 0;


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

+    cpu_smm_register(&i440fx_set_smm, d);
+
+    return 0;
+
+}

static int i440fx_initfn(PCIDevice *dev)

{

    PCII440FXState *d = DO_UPCAST(PCII440FXState, dev, dev);

    pci_config_set_vendor_id(d->dev.config, PCI_VENDOR_ID_INTEL);

    pci_config_set_device_id(d->dev.config, PCI_DEVICE_ID_INTEL_82441);

    d->dev.config[0x08] = 0x02; // revision

    pci_config_set_class(d->dev.config, PCI_CLASS_BRIDGE_HOST);

    d->dev.config[I440FX_SMRAM] = 0x02;

    cpu_smm_register(&i440fx_set_smm, d);

    return 0;

}


static int compare_doubles(const double *a, const double *b, int len,

                           double max_diff)

{

    int i;

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

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

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

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

            return -1;

        }

    }

    return 0;

}


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

         AVDictionaryEntry *tag = NULL;

+        bytestream_put_le32(p, count);
+
+        while ((tag = av_dict_get(*m, "", tag, AV_DICT_IGNORE_SUFFIX))) {
+
+            unsigned int len1 = strlen(tag->key);

             unsigned int len2 = strlen(tag->value);

int ff_vorbiscomment_write(uint8_t **p, AVDictionary **m,

                           const char *vendor_string)

{

    bytestream_put_le32(p, strlen(vendor_string));

    bytestream_put_buffer(p, vendor_string, strlen(vendor_string));

    if (*m) {

        int count = av_dict_count(*m);

        AVDictionaryEntry *tag = NULL;

        bytestream_put_le32(p, count);

        while ((tag = av_dict_get(*m, "", tag, AV_DICT_IGNORE_SUFFIX))) {

            unsigned int len1 = strlen(tag->key);

            unsigned int len2 = strlen(tag->value);

            bytestream_put_le32(p, len1+1+len2);

            bytestream_put_buffer(p, tag->key, len1);

            bytestream_put_byte(p, '=');

            bytestream_put_buffer(p, tag->value, len2);

        }

    } else

        bytestream_put_le32(p, 0);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,22 +1,22 @@
+static always_inline void gen_op_neg (DisasContext *ctx, TCGv ret, TCGv arg1, int ov_check)
+
+{
+
     int l1, l2;
+

+
+    l1 = gen_new_label();

     l2 = gen_new_label();
+
+#if defined(TARGET_PPC64)

     if (ctx->sf_mode) {

         tcg_gen_brcondi_tl(TCG_COND_EQ, arg1, INT64_MIN, l1);

+    } else {

         TCGv t0 = tcg_temp_new(TCG_TYPE_TL);

static always_inline void gen_op_neg (DisasContext *ctx, TCGv ret, TCGv arg1, int ov_check)

{

    int l1, l2;

    l1 = gen_new_label();

    l2 = gen_new_label();

#if defined(TARGET_PPC64)

    if (ctx->sf_mode) {

        tcg_gen_brcondi_tl(TCG_COND_EQ, arg1, INT64_MIN, l1);

    } else {

        TCGv t0 = tcg_temp_new(TCG_TYPE_TL);

	tcg_gen_ext32s_tl(t0, arg1);

        tcg_gen_brcondi_tl(TCG_COND_EQ, t0, INT32_MIN, l1);

    }

#else

        tcg_gen_brcondi_tl(TCG_COND_EQ, arg1, INT32_MIN, l1);

#endif

    tcg_gen_neg_tl(ret, arg1);

    if (ov_check) {

        tcg_gen_andi_tl(cpu_xer, cpu_xer, ~(1 << XER_OV));

    }

    tcg_gen_br(l2);

    gen_set_label(l1);

    tcg_gen_mov_tl(ret, arg1);

    if (ov_check) {

        tcg_gen_ori_tl(cpu_xer, cpu_xer, (1 << XER_OV) | (1 << XER_SO));

    }

    gen_set_label(l2);

    if (unlikely(Rc(ctx->opcode) != 0))

        gen_set_Rc0(ctx, ret);

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
         s->padconf[pad_offset] = prev_value;

         break;
+
+
+
+    default:
+
         OMAP_BAD_REG(addr);

         break;

static void omap_sysctl_write8(void *opaque, target_phys_addr_t addr,

                uint32_t value)

{

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

    int pad_offset, byte_offset;

    int prev_value;

    switch (addr) {

    case 0x030 ... 0x140:	/* CONTROL_PADCONF - only used in the POP */

        pad_offset = (addr - 0x30) >> 2;

        byte_offset = (addr - 0x30) & (4 - 1);

        prev_value = s->padconf[pad_offset];

        prev_value &= ~(0xff << (byte_offset * 8));

        prev_value |= ((value & 0x1f1f1f1f) << (byte_offset * 8)) & 0x1f1f1f1f;

        s->padconf[pad_offset] = prev_value;

        break;

    default:

        OMAP_BAD_REG(addr);

        break;

    }

}


--- 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
@@ -1,11 +1,11 @@
 static int handle_diag(S390CPU *cpu, struct kvm_run *run, uint32_t ipb)

 {
+
+    int r = 0;
+
+    uint16_t func_code;
+

     /*

static int handle_diag(S390CPU *cpu, struct kvm_run *run, uint32_t ipb)

{

    int r = 0;

    uint16_t func_code;

    /*

     * For any diagnose call we support, bits 48-63 of the resulting

     * address specify the function code; the remainder is ignored.

     */

    func_code = decode_basedisp_rs(&cpu->env, ipb) & DIAG_KVM_CODE_MASK;

    switch (func_code) {

    case DIAG_IPL:

        kvm_handle_diag_308(cpu, run);

        break;

    case DIAG_KVM_HYPERCALL:

        r = handle_hypercall(cpu, run);

        break;

    case DIAG_KVM_BREAKPOINT:

        r = handle_sw_breakpoint(cpu, run);

        break;

    default:

        DPRINTF("KVM: unknown DIAG: 0x%x\n", func_code);

        r = -1;

        break;

    }

    return r;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static inline void RENAME(yuv2bgr24_2)(SwsContext *c, const uint16_t *buf0,
+
+                                       const uint16_t *buf1, const uint16_t *ubuf0,

                                        const uint16_t *ubuf1, const uint16_t *vbuf0,

static inline void RENAME(yuv2bgr24_2)(SwsContext *c, const uint16_t *buf0,

                                       const uint16_t *buf1, const uint16_t *ubuf0,

                                       const uint16_t *ubuf1, const uint16_t *vbuf0,

                                       const uint16_t *vbuf1, const uint16_t *abuf0,

                                       const uint16_t *abuf1, uint8_t *dest,

                                       int dstW, int yalpha, int uvalpha, int y)

{

    x86_reg uv_off = c->uv_off << 1;

    //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(

    __asm__ volatile(

        "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"

        "mov        %4, %%"REG_b"               \n\t"

        "push %%"REG_BP"                        \n\t"

        YSCALEYUV2RGB(%%REGBP, %5, %6)

        "pxor    %%mm7, %%mm7                   \n\t"

        WRITEBGR24(%%REGb, 8280(%5), %%REGBP)

        "pop %%"REG_BP"                         \n\t"

        "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"

        :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),

           "a" (&c->redDither), "m"(uv_off)

    );

}


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

 {

+    assert(mr->backend_registered);
+
     return mr->ram_addr;

 }

ram_addr_t memory_region_get_ram_addr(MemoryRegion *mr)

{

    assert(mr->backend_registered);

    return mr->ram_addr;

}


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

     avio_wb32(pb, 0); /* size */
+
+    ffio_wfourcc(pb, "stbl");
+
+    mov_write_stsd_tag(s, pb, mov, track);
+
     mov_write_stts_tag(pb, track);

     if ((track->par->codec_type == AVMEDIA_TYPE_VIDEO ||

static int mov_write_stbl_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)

{

    int64_t pos = avio_tell(pb);

    int ret;

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

    ffio_wfourcc(pb, "stbl");

    mov_write_stsd_tag(s, pb, mov, track);

    mov_write_stts_tag(pb, track);

    if ((track->par->codec_type == AVMEDIA_TYPE_VIDEO ||

         track->par->codec_tag == MKTAG('r','t','p',' ')) &&

        track->has_keyframes && track->has_keyframes < track->entry)

        mov_write_stss_tag(pb, track, MOV_SYNC_SAMPLE);

    if (track->mode == MODE_MOV && track->flags & MOV_TRACK_STPS)

        mov_write_stss_tag(pb, track, MOV_PARTIAL_SYNC_SAMPLE);

    if (track->par->codec_type == AVMEDIA_TYPE_VIDEO &&

        track->flags & MOV_TRACK_CTTS && track->entry) {

        if ((ret = mov_write_ctts_tag(pb, track)) < 0)

            return ret;

    }

    mov_write_stsc_tag(pb, track);

    mov_write_stsz_tag(pb, track);

    mov_write_stco_tag(pb, track);

    if (mov->encryption_scheme == MOV_ENC_CENC_AES_CTR) {

        ff_mov_cenc_write_stbl_atoms(&track->cenc, pb);

    }

    if (track->par->codec_id == AV_CODEC_ID_OPUS) {

        mov_preroll_write_stbl_atoms(pb, track);

    }

    return update_size(pb, pos);

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                     uint8_t *buf, int nb_sectors)

 {
+
     BDRVVmdkState *s = bs->opaque;

     int index_in_cluster, n, ret;

static int vmdk_read(BlockDriverState *bs, int64_t sector_num,

                    uint8_t *buf, int nb_sectors)

{

    BDRVVmdkState *s = bs->opaque;

    int index_in_cluster, n, ret;

    uint64_t cluster_offset;

    while (nb_sectors > 0) {

        cluster_offset = get_cluster_offset(bs, sector_num << 9, 0);

        index_in_cluster = sector_num % s->cluster_sectors;

        n = s->cluster_sectors - index_in_cluster;

        if (n > nb_sectors)

            n = nb_sectors;

        if (!cluster_offset) {

            // try to read from parent image, if exist

            if (s->hd->backing_hd) {

                if (!vmdk_is_cid_valid(bs))

                    return -1;

                ret = bdrv_read(s->hd->backing_hd, sector_num, buf, n);

                if (ret < 0)

                    return -1;

            } else {

                memset(buf, 0, 512 * n);

            }

        } else {

            if(bdrv_pread(s->hd, cluster_offset + index_in_cluster * 512, buf, n * 512) != n * 512)

                return -1;

        }

        nb_sectors -= n;

        sector_num += n;

        buf += n * 512;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 URLProtocol *ffurl_protocol_next(const URLProtocol *prev)

+{

     return prev ? prev->next : first_protocol;

URLProtocol *ffurl_protocol_next(const URLProtocol *prev)

{

    return prev ? prev->next : first_protocol;

}


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

     CPUState *cs = CPU(obj);
+
     MIPSCPU *cpu = MIPS_CPU(obj);

     CPUMIPSState *env = &cpu->env;

static void mips_cpu_initfn(Object *obj)

{

    CPUState *cs = CPU(obj);

    MIPSCPU *cpu = MIPS_CPU(obj);

    CPUMIPSState *env = &cpu->env;

    cs->env_ptr = env;

    cpu_exec_init(cs, &error_abort);

    if (tcg_enabled()) {

        mips_tcg_init();

    }

}


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

 	/* Load and decode. FIXME: handle endianness.  */

+	cpu_physical_memory_read (addr,
+
+				  (void *) &ctrl->channels[c].current_c,
+
+				  sizeof ctrl->channels[c].current_c);

static void channel_load_c(struct fs_dma_ctrl *ctrl, int c)

{

	target_phys_addr_t addr = channel_reg(ctrl, c, RW_GROUP_DOWN);

	/* Load and decode. FIXME: handle endianness.  */

	cpu_physical_memory_read (addr,

				  (void *) &ctrl->channels[c].current_c,

				  sizeof ctrl->channels[c].current_c);

	D(dump_c(c, &ctrl->channels[c].current_c));

	/* I guess this should update the current pos.  */

	ctrl->channels[c].regs[RW_SAVED_DATA] =

		(uint32_t)(unsigned long)ctrl->channels[c].current_c.saved_data;

	ctrl->channels[c].regs[RW_SAVED_DATA_BUF] =

		(uint32_t)(unsigned long)ctrl->channels[c].current_c.saved_data_buf;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static inline void downmix_2f_1r_to_mono(float *samples)

 {
+
+    int i;
+
+

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

static inline void downmix_2f_1r_to_mono(float *samples)

{

    int i;

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

        samples[i] += (samples[i + 256] + samples[i + 512]);

        samples[i + 256] = samples[i + 512] = 0;

    }

}


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

      * Then we set UNIT_ATTENTION, by which the guest will
+
+     * detect a new CD in the drive.  See ide_atapi_cmd() for details.
+
+     */
+
     s->cdrom_changed = 1;

     s->events.new_media = true;

static void ide_cd_change_cb(void *opaque, bool load)

{

    IDEState *s = opaque;

    uint64_t nb_sectors;

    s->tray_open = !load;

    bdrv_get_geometry(s->bs, &nb_sectors);

    s->nb_sectors = nb_sectors;

    /*

     * First indicate to the guest that a CD has been removed.  That's

     * done on the next command the guest sends us.

     *

     * Then we set UNIT_ATTENTION, by which the guest will

     * detect a new CD in the drive.  See ide_atapi_cmd() for details.

     */

    s->cdrom_changed = 1;

    s->events.new_media = true;

    s->events.eject_request = false;

    ide_set_irq(s->bus);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static int poll_frame(AVFilterLink *link)
+
+{
+
+    AVFilterContext   *s = link->src;
+
     OverlayContext *over = s->priv;

     int ret = avfilter_poll_frame(s->inputs[OVERLAY]);

static int poll_frame(AVFilterLink *link)

{

    AVFilterContext   *s = link->src;

    OverlayContext *over = s->priv;

    int ret = avfilter_poll_frame(s->inputs[OVERLAY]);

    if (ret == AVERROR_EOF)

        ret = !!over->overpicref;

    return ret && avfilter_poll_frame(s->inputs[MAIN]);

}


--- a/source.c
+++ b/source.c
@@ -27,11 +27,11 @@
         QINCREF(bs->file->bs->full_open_options);

         qdict_put_obj(opts, "raw", QOBJECT(bs->file->bs->full_open_options));
+
+        QINCREF(s->test_file->bs->full_open_options);
+
+        qdict_put_obj(opts, "test",
+
                       QOBJECT(s->test_file->bs->full_open_options));

static void blkverify_refresh_filename(BlockDriverState *bs)

{

    BDRVBlkverifyState *s = bs->opaque;

    /* bs->file->bs has already been refreshed */

    bdrv_refresh_filename(s->test_file->bs);

    if (bs->file->bs->full_open_options

        && s->test_file->bs->full_open_options)

    {

        QDict *opts = qdict_new();

        qdict_put_obj(opts, "driver", QOBJECT(qstring_from_str("blkverify")));

        QINCREF(bs->file->bs->full_open_options);

        qdict_put_obj(opts, "raw", QOBJECT(bs->file->bs->full_open_options));

        QINCREF(s->test_file->bs->full_open_options);

        qdict_put_obj(opts, "test",

                      QOBJECT(s->test_file->bs->full_open_options));

        bs->full_open_options = opts;

    }

    if (bs->file->bs->exact_filename[0]

        && s->test_file->bs->exact_filename[0])

    {

        snprintf(bs->exact_filename, sizeof(bs->exact_filename),

                 "blkverify:%s:%s",

                 bs->file->bs->exact_filename,

                 s->test_file->bs->exact_filename);

    }

}


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

     if (avctx->channels > 2)
+
+        return -1;
+
+    avctx->frame_size = 32;
+

     avctx->coded_frame = avcodec_alloc_frame();

static av_cold int adx_encode_init(AVCodecContext *avctx)

{

    ADXContext *c = avctx->priv_data;

    if (avctx->channels > 2)

        return -1;

    avctx->frame_size = 32;

    avctx->coded_frame = avcodec_alloc_frame();

    avctx->coded_frame->key_frame = 1;

    /* the cutoff can be adjusted, but this seems to work pretty well */

    c->cutoff = 500;

    ff_adx_calculate_coeffs(c->cutoff, avctx->sample_rate, COEFF_BITS, c->coeff);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
+QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, int fail_if_exists)

 {

+    QemuOpts *opts = NULL;

     if (id) {

         if (!id_wellformed(id)) {
+
             qerror_report(QERR_INVALID_PARAMETER_VALUE, "id", "an identifier");

             error_printf_unless_qmp("Identifiers consist of letters, digits, '-', '.', '_', starting with a letter.\n");

QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, int fail_if_exists)

{

    QemuOpts *opts = NULL;

    if (id) {

        if (!id_wellformed(id)) {

            qerror_report(QERR_INVALID_PARAMETER_VALUE, "id", "an identifier");

            error_printf_unless_qmp("Identifiers consist of letters, digits, '-', '.', '_', starting with a letter.\n");

            return NULL;

        }

        opts = qemu_opts_find(list, id);

        if (opts != NULL) {

            if (fail_if_exists && !list->merge_lists) {

                qerror_report(QERR_DUPLICATE_ID, id, list->name);

                return NULL;

            } else {

                return opts;

            }

        }

    } else if (list->merge_lists) {

        opts = qemu_opts_find(list, NULL);

        if (opts) {

            return opts;

        }

    }

    opts = g_malloc0(sizeof(*opts));

    if (id) {

        opts->id = g_strdup(id);

    }

    opts->list = list;

    loc_save(&opts->loc);

    QTAILQ_INIT(&opts->head);

    QTAILQ_INSERT_TAIL(&list->head, opts, next);

    return opts;

}


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

     int i, idx = 0;

+    for (i = 0; i < BITS_TO_U64S(size); i++) {
+
+        uint64_t w = bmp[idx++];
+
+        if (sizeof(unsigned long) == 4 && idx < BITS_TO_LONGS(size)) {

             w |= ((uint64_t)bmp[idx++]) << 32;

static void put_bitmap(QEMUFile *f, void *pv, size_t size)

{

    unsigned long *bmp = pv;

    int i, idx = 0;

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

        uint64_t w = bmp[idx++];

        if (sizeof(unsigned long) == 4 && idx < BITS_TO_LONGS(size)) {

            w |= ((uint64_t)bmp[idx++]) << 32;

        }

        qemu_put_be64(f, w);

    }

}


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

                               unsigned char *buf, int size)
+
 {

     HTTPContext *c = opaque;

static void http_write_packet(void *opaque,

                              unsigned char *buf, int size)

{

    HTTPContext *c = opaque;

    if (c->buffer_ptr == c->buffer_end || !c->buffer_ptr)

        c->buffer_ptr = c->buffer_end = c->buffer;

    if (c->buffer_end - c->buffer + size > IOBUFFER_MAX_SIZE)

        abort();

    memcpy(c->buffer_end, buf, size);

    c->buffer_end += size;

}


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

             QLIST_REMOVE(entry, list);

+
+            break;
+
+        }
+
     }

     return 0;

int kvm_arch_release_virq_post(int virq)

{

    MSIRouteEntry *entry, *next;

    QLIST_FOREACH_SAFE(entry, &msi_route_list, list, next) {

        if (entry->virq == virq) {

            trace_kvm_x86_remove_msi_route(virq);

            QLIST_REMOVE(entry, list);

            break;

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static int kvm_set_ioeventfd_mmio(int fd, hwaddr addr, uint32_t val,

+                                  bool assign, uint32_t size, bool datamatch)
+
+{
+
+    int ret;
+
     struct kvm_ioeventfd iofd;

static int kvm_set_ioeventfd_mmio(int fd, hwaddr addr, uint32_t val,

                                  bool assign, uint32_t size, bool datamatch)

{

    int ret;

    struct kvm_ioeventfd iofd;

    iofd.datamatch = datamatch ? adjust_ioeventfd_endianness(val, size) : 0;

    iofd.addr = addr;

    iofd.len = size;

    iofd.flags = 0;

    iofd.fd = fd;

    if (!kvm_enabled()) {

        return -ENOSYS;

    }

    if (datamatch) {

        iofd.flags |= KVM_IOEVENTFD_FLAG_DATAMATCH;

    }

    if (!assign) {

        iofd.flags |= KVM_IOEVENTFD_FLAG_DEASSIGN;

    }

    ret = kvm_vm_ioctl(kvm_state, KVM_IOEVENTFD, &iofd);

    if (ret < 0) {

        return -errno;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void mp3_update_xing(AVFormatContext *s)
+
+{
+
+    MP3Context  *mp3 = s->priv_data;
+
     int i;

static void mp3_update_xing(AVFormatContext *s)

{

    MP3Context  *mp3 = s->priv_data;

    int i;

    /* replace "Xing" identification string with "Info" for CBR files. */

    if (!mp3->has_variable_bitrate) {

        avio_seek(s->pb, mp3->xing_offset, SEEK_SET);

        ffio_wfourcc(s->pb, "Info");

    }

    avio_seek(s->pb, mp3->xing_offset + 8, SEEK_SET);

    avio_wb32(s->pb, mp3->frames);

    avio_wb32(s->pb, mp3->size);

    avio_w8(s->pb, 0);  // first toc entry has to be zero.

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

        int j = i * mp3->pos / XING_TOC_SIZE;

        int seek_point = 256LL * mp3->bag[j] / mp3->size;

        avio_w8(s->pb, FFMIN(seek_point, 255));

    }

    avio_seek(s->pb, 0, SEEK_END);

}


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

     if (!assign) {
+
+        /* Test and clear notifier before after disabling event,
+
+         * in case poll callback didn't have time to run. */
+
         virtio_queue_host_notifier_read(&vq->host_notifier);

     }

void virtio_queue_set_host_notifier_fd_handler(VirtQueue *vq, bool assign,

                                               bool set_handler)

{

    if (assign && set_handler) {

        event_notifier_set_handler(&vq->host_notifier, true,

                                   virtio_queue_host_notifier_read);

    } else {

        event_notifier_set_handler(&vq->host_notifier, true, NULL);

    }

    if (!assign) {

        /* Test and clear notifier before after disabling event,

         * in case poll callback didn't have time to run. */

        virtio_queue_host_notifier_read(&vq->host_notifier);

    }

}


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

     int cpu_flags = av_get_cpu_flags();
+
+
+
+    cavsdsp_init_mmx(c, avctx);
+
 #if HAVE_AMD3DNOW_INLINE

     if (INLINE_AMD3DNOW(cpu_flags))

av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c, AVCodecContext *avctx)

{

    int cpu_flags = av_get_cpu_flags();

    cavsdsp_init_mmx(c, avctx);

#if HAVE_AMD3DNOW_INLINE

    if (INLINE_AMD3DNOW(cpu_flags))

        cavsdsp_init_3dnow(c, avctx);

#endif /* HAVE_AMD3DNOW_INLINE */

#if HAVE_MMXEXT_INLINE

    if (INLINE_MMXEXT(cpu_flags)) {

        DSPFUNC(put, 0, 16, mmxext);

        DSPFUNC(put, 1,  8, mmxext);

        DSPFUNC(avg, 0, 16, mmxext);

        DSPFUNC(avg, 1,  8, mmxext);

    }

#endif

#if HAVE_MMX_EXTERNAL

    if (EXTERNAL_MMXEXT(cpu_flags)) {

        c->avg_cavs_qpel_pixels_tab[0][0] = avg_cavs_qpel16_mc00_mmxext;

        c->avg_cavs_qpel_pixels_tab[1][0] = avg_cavs_qpel8_mc00_mmxext;

    }

#endif

#if HAVE_SSE2_EXTERNAL

    if (EXTERNAL_SSE2(cpu_flags)) {

        c->put_cavs_qpel_pixels_tab[0][0] = put_cavs_qpel16_mc00_sse2;

        c->avg_cavs_qpel_pixels_tab[0][0] = avg_cavs_qpel16_mc00_sse2;

    }

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static void gen_ove_cy(DisasContext *dc, TCGv cy)

+{

     if (dc->tb_flags & SR_OVE) {

static void gen_ove_cy(DisasContext *dc, TCGv cy)

{

    if (dc->tb_flags & SR_OVE) {

        gen_helper_ove(cpu_env, cy);

    }

}


--- a/source.c
+++ b/source.c
@@ -7,16 +7,16 @@
     uint8_t *line;

     for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++){
+
         J2kTile *tile = s->tile + tileno;

         if (s->planar){

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

                 J2kComponent *comp = tile->comp + compno;

+                int *dst = comp->data;

                 line = s->picture->data[compno]

@@ -25,7 +25,7 @@
                        + comp->coord[0][0];

                 for (y = comp->coord[1][0]; y < comp->coord[1][1]; y++){
+
                     uint8_t *ptr = line;

                     for (x = comp->coord[0][0]; x < comp->coord[0][1]; x++)

static void copy_frame(J2kEncoderContext *s)

{

    int tileno, compno, i, y, x;

    uint8_t *line;

    for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++){

        J2kTile *tile = s->tile + tileno;

        if (s->planar){

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

                J2kComponent *comp = tile->comp + compno;

                int *dst = comp->data;

                line = s->picture->data[compno]

                       + comp->coord[1][0] * s->picture->linesize[compno]

                       + comp->coord[0][0];

                for (y = comp->coord[1][0]; y < comp->coord[1][1]; y++){

                    uint8_t *ptr = line;

                    for (x = comp->coord[0][0]; x < comp->coord[0][1]; x++)

                        *dst++ = *ptr++ - (1 << 7);

                    line += s->picture->linesize[compno];

                }

            }

        } else{

            line = s->picture->data[0] + tile->comp[0].coord[1][0] * s->picture->linesize[0]

                   + tile->comp[0].coord[0][0] * s->ncomponents;

            i = 0;

            for (y = tile->comp[0].coord[1][0]; y < tile->comp[0].coord[1][1]; y++){

                uint8_t *ptr = line;

                for (x = tile->comp[0].coord[0][0]; x < tile->comp[0].coord[0][1]; x++, i++){

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

                        tile->comp[compno].data[i] = *ptr++  - (1 << 7);

                    }

                }

                line += s->picture->linesize[0];

            }

        }

    }

}


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

+    r = *in;
+
+    DEBUG("slow_bar_readl addr=0x" TARGET_FMT_plx " val=0x%08x\n", addr, r);
+
+

     return r;

static uint32_t slow_bar_readl(void *opaque, target_phys_addr_t addr)

{

    AssignedDevRegion *d = opaque;

    uint32_t *in = (uint32_t *)(d->u.r_virtbase + addr);

    uint32_t r;

    r = *in;

    DEBUG("slow_bar_readl addr=0x" TARGET_FMT_plx " val=0x%08x\n", addr, r);

    return r;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset;

     int alpha = alpha_table[index_a];
+
+    int beta  = beta_table[qp - qp_bd_offset + h->slice_beta_offset];
+
+    if (alpha ==0 || beta == 0) return;
+

     if( bS[0] < 4 ) {

static void filter_mb_mbaff_edgev( H264Context *h, uint8_t *pix, int stride, const int16_t bS[7], int bsi, int qp ) {

    const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);

    int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset;

    int alpha = alpha_table[index_a];

    int beta  = beta_table[qp - qp_bd_offset + h->slice_beta_offset];

    if (alpha ==0 || beta == 0) return;

    if( bS[0] < 4 ) {

        int8_t tc[4];

        tc[0] = tc0_table[index_a][bS[0*bsi]];

        tc[1] = tc0_table[index_a][bS[1*bsi]];

        tc[2] = tc0_table[index_a][bS[2*bsi]];

        tc[3] = tc0_table[index_a][bS[3*bsi]];

        h->h264dsp.h264_h_loop_filter_luma_mbaff(pix, stride, alpha, beta, tc);

    } else {

        h->h264dsp.h264_h_loop_filter_luma_mbaff_intra(pix, stride, alpha, beta);

    }

}


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

         gen_set_label(label);

+        tcg_temp_free(tmp);
+
+    }
+
+}

static void gen_load_store_alignment(DisasContext *dc, int shift,

        TCGv_i32 addr, bool no_hw_alignment)

{

    if (!option_enabled(dc, XTENSA_OPTION_UNALIGNED_EXCEPTION)) {

        tcg_gen_andi_i32(addr, addr, ~0 << shift);

    } else if (option_enabled(dc, XTENSA_OPTION_HW_ALIGNMENT) &&

            no_hw_alignment) {

        int label = gen_new_label();

        TCGv_i32 tmp = tcg_temp_new_i32();

        tcg_gen_andi_i32(tmp, addr, ~(~0 << shift));

        tcg_gen_brcondi_i32(TCG_COND_EQ, tmp, 0, label);

        gen_exception_cause_vaddr(dc, LOAD_STORE_ALIGNMENT_CAUSE, addr);

        gen_set_label(label);

        tcg_temp_free(tmp);

    }

}


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

     AVFrame *frame = av_frame_alloc();

+    if (!frame)

         return NULL;

static AVFrame *alloc_frame(enum AVPixelFormat pixfmt, int w, int h)

{

    AVFrame *frame = av_frame_alloc();

    if (!frame)

        return NULL;

    frame->format = pixfmt;

    frame->width  = w;

    frame->height = h;

    if (av_frame_get_buffer(frame, 32) < 0)

        return NULL;

    return frame;

}


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

     CPUX86State *env;

+    static int inited;
+
+
+
+    cpu = X86_CPU(object_new(TYPE_X86_CPU));

     env = &cpu->env;

X86CPU *cpu_x86_init(const char *cpu_model)

{

    X86CPU *cpu;

    CPUX86State *env;

    static int inited;

    cpu = X86_CPU(object_new(TYPE_X86_CPU));

    env = &cpu->env;

    env->cpu_model_str = cpu_model;

    /* init various static tables used in TCG mode */

    if (tcg_enabled() && !inited) {

        inited = 1;

        optimize_flags_init();

#ifndef CONFIG_USER_ONLY

        prev_debug_excp_handler =

            cpu_set_debug_excp_handler(breakpoint_handler);

#endif

    }

    if (cpu_x86_register(cpu, cpu_model) < 0) {

        object_delete(OBJECT(cpu));

        return NULL;

    }

    x86_cpu_realize(OBJECT(cpu), NULL);

    return cpu;

}


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

+
+    prop = g_malloc(sizeof(*prop));
+
+    prop->target_obj = target_obj;
+
     prop->target_name = target_name;

void object_property_add_alias(Object *obj, const char *name,

                               Object *target_obj, const char *target_name,

                               Error **errp)

{

    AliasProperty *prop;

    ObjectProperty *target_prop;

    target_prop = object_property_find(target_obj, target_name, errp);

    if (!target_prop) {

        return;

    }

    prop = g_malloc(sizeof(*prop));

    prop->target_obj = target_obj;

    prop->target_name = target_name;

    object_property_add(obj, name, target_prop->type,

                        property_get_alias,

                        property_set_alias,

                        property_release_alias,

                        prop, errp);

}


static inline void downmix_2f_2r_to_stereo(float *samples)

{

    int i;

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

        samples[i] += samples[i + 512];

        samples[i + 256] = samples[i + 768];

        samples[i + 512] = samples[i + 768] = 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void vhost_user_stop(VhostUserState *s)
+
+{
+
     if (vhost_user_running(s)) {

         vhost_net_cleanup(s->vhost_net);

static void vhost_user_stop(VhostUserState *s)

{

    if (vhost_user_running(s)) {

        vhost_net_cleanup(s->vhost_net);

    }

    s->vhost_net = 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void qxl_hard_reset(PCIQXLDevice *d, int loadvm)

+{

     dprint(d, 1, "%s: start%s\n", __FUNCTION__,
+
            loadvm ? " (loadvm)" : "");

static void qxl_hard_reset(PCIQXLDevice *d, int loadvm)

{

    dprint(d, 1, "%s: start%s\n", __FUNCTION__,

           loadvm ? " (loadvm)" : "");

    qemu_mutex_unlock_iothread();

    d->ssd.worker->reset_cursor(d->ssd.worker);

    d->ssd.worker->reset_image_cache(d->ssd.worker);

    qemu_mutex_lock_iothread();

    qxl_reset_surfaces(d);

    qxl_reset_memslots(d);

    /* pre loadvm reset must not touch QXLRam.  This lives in

     * device memory, is migrated together with RAM and thus

     * already loaded at this point */

    if (!loadvm) {

        qxl_reset_state(d);

    }

    qemu_spice_create_host_memslot(&d->ssd);

    qxl_soft_reset(d);

    dprint(d, 1, "%s: done\n", __FUNCTION__);

}


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

 {

+    const char *models[2];

void qemu_check_nic_model(NICInfo *nd, const char *model)

{

    const char *models[2];

    models[0] = model;

    models[1] = NULL;

    qemu_check_nic_model_list(nd, models, model);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 bool bdrv_all_can_snapshot(BlockDriverState **first_bad_bs)

+{

     bool ok = true;

bool bdrv_all_can_snapshot(BlockDriverState **first_bad_bs)

{

    bool ok = true;

    BlockDriverState *bs;

    BdrvNextIterator it;

    for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {

        AioContext *ctx = bdrv_get_aio_context(bs);

        aio_context_acquire(ctx);

        if (bdrv_is_inserted(bs) && !bdrv_is_read_only(bs)) {

            ok = bdrv_can_snapshot(bs);

        }

        aio_context_release(ctx);

        if (!ok) {

            goto fail;

        }

    }

fail:

    *first_bad_bs = bs;

    return ok;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void qed_plug_allocating_write_reqs(BDRVQEDState *s)
+
+{

     assert(!s->allocating_write_reqs_plugged);

static void qed_plug_allocating_write_reqs(BDRVQEDState *s)

{

    assert(!s->allocating_write_reqs_plugged);

    s->allocating_write_reqs_plugged = true;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static inline void t_gen_raise_exception(uint32_t index)
+
 {

 	tcg_gen_helper_0_1(helper_raise_exception, tcg_const_tl(index));

static inline void t_gen_raise_exception(uint32_t index)

{

	tcg_gen_helper_0_1(helper_raise_exception, tcg_const_tl(index));

}


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

     UserDefNested *udnp = g_malloc0(sizeof(*udnp));
+
+    udnp->string0 = strdup("test_string0");
+
+    udnp->dict1.string1 = strdup("test_string1");
+
     udnp->dict1.dict2.userdef1 = g_malloc0(sizeof(UserDefOne));

     udnp->dict1.dict2.userdef1->base = g_new0(UserDefZero, 1);

static UserDefNested *nested_struct_create(void)

{

    UserDefNested *udnp = g_malloc0(sizeof(*udnp));

    udnp->string0 = strdup("test_string0");

    udnp->dict1.string1 = strdup("test_string1");

    udnp->dict1.dict2.userdef1 = g_malloc0(sizeof(UserDefOne));

    udnp->dict1.dict2.userdef1->base = g_new0(UserDefZero, 1);

    udnp->dict1.dict2.userdef1->base->integer = 42;

    udnp->dict1.dict2.userdef1->string = strdup("test_string");

    udnp->dict1.dict2.string2 = strdup("test_string2");

    udnp->dict1.has_dict3 = true;

    udnp->dict1.dict3.userdef2 = g_malloc0(sizeof(UserDefOne));

    udnp->dict1.dict3.userdef2->base = g_new0(UserDefZero, 1);

    udnp->dict1.dict3.userdef2->base->integer = 43;

    udnp->dict1.dict3.userdef2->string = strdup("test_string");

    udnp->dict1.dict3.string3 = strdup("test_string3");

    return udnp;

}


--- a/source.c
+++ b/source.c
@@ -19,9 +19,9 @@
     if (fd < 0) {

         return NULL;
+
+    }
+
+    return qemu_chr_open_pp_fd(fd, errp);
+
 }

static CharDriverState *qmp_chardev_open_parallel(const char *id,

                                                  ChardevBackend *backend,

                                                  ChardevReturn *ret,

                                                  Error **errp)

{

    ChardevHostdev *parallel = backend->u.parallel;

    int fd;

    fd = qmp_chardev_open_file_source(parallel->device, O_RDWR, errp);

    if (fd < 0) {

        return NULL;

    }

    return qemu_chr_open_pp_fd(fd, errp);

}


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

 {

+    CharDriverState *chr = opaque;
+
+
+
+    if (cond != G_IO_HUP) {

         return FALSE;

static gboolean tcp_chr_chan_close(GIOChannel *channel, GIOCondition cond,

                                   void *opaque)

{

    CharDriverState *chr = opaque;

    if (cond != G_IO_HUP) {

        return FALSE;

    }

    /* connection closed */

    tcp_chr_disconnect(chr);

    if (chr->fd_hup_tag) {

        g_source_remove(chr->fd_hup_tag);

        chr->fd_hup_tag = 0;

    }

    return TRUE;

}


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

     size = vde_recv(s->vde, (char *)buf, sizeof(buf), 0);

+    if (size > 0) {
+
+        qemu_send_packet(&s->nc, buf, size);
+
+    }

 }

static void vde_to_qemu(void *opaque)

{

    VDEState *s = opaque;

    uint8_t buf[4096];

    int size;

    size = vde_recv(s->vde, (char *)buf, sizeof(buf), 0);

    if (size > 0) {

        qemu_send_packet(&s->nc, buf, size);

    }

}


--- a/source.c
+++ b/source.c
@@ -13,9 +13,9 @@
     if (sector > total_sectors || nb_sectors > total_sectors - sector) {

         return false;
+
+    }
+
+    return true;
+
 }

static bool ide_sect_range_ok(IDEState *s,

                              uint64_t sector, uint64_t nb_sectors)

{

    uint64_t total_sectors;

    bdrv_get_geometry(s->bs, &total_sectors);

    if (sector > total_sectors || nb_sectors > total_sectors - sector) {

        return false;

    }

    return true;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int vp8_alloc_frame(VP8Context *s, AVFrame *f)

 {
+
     int ret;

     if ((ret = ff_thread_get_buffer(s->avctx, f)) < 0)

static int vp8_alloc_frame(VP8Context *s, AVFrame *f)

{

    int ret;

    if ((ret = ff_thread_get_buffer(s->avctx, f)) < 0)

        return ret;

    if (!s->maps_are_invalid && s->num_maps_to_be_freed) {

        f->ref_index[0] = s->segmentation_maps[--s->num_maps_to_be_freed];

    } else if (!(f->ref_index[0] = av_mallocz(s->mb_width * s->mb_height))) {

        ff_thread_release_buffer(s->avctx, f);

        return AVERROR(ENOMEM);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int normalize_samples(AC3EncodeContext *s)

 {
+
     int v = 14 - log2_tab(s, s->windowed_samples, AC3_WINDOW_SIZE);

     lshift_tab(s->windowed_samples, AC3_WINDOW_SIZE, v);

static int normalize_samples(AC3EncodeContext *s)

{

    int v = 14 - log2_tab(s, s->windowed_samples, AC3_WINDOW_SIZE);

    lshift_tab(s->windowed_samples, AC3_WINDOW_SIZE, v);

    return v - 9;

}


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

     if (!s->bs || !s->mult_sectors) {

+        ide_abort_command(s);
+
+        return true;
+
+    }

static bool cmd_write_multiple(IDEState *s, uint8_t cmd)

{

    bool lba48 = (cmd == WIN_MULTWRITE_EXT);

    int n;

    if (!s->bs || !s->mult_sectors) {

        ide_abort_command(s);

        return true;

    }

    ide_cmd_lba48_transform(s, lba48);

    s->req_nb_sectors = s->mult_sectors;

    n = MIN(s->nsector, s->req_nb_sectors);

    s->status = SEEK_STAT | READY_STAT;

    ide_transfer_start(s, s->io_buffer, 512 * n, ide_sector_write);

    s->media_changed = 1;

    return false;

}


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

 	/* Every channel has a 0x2000 ctrl register map.  */
+
+	return addr >> 13;

 }

static inline int fs_channel(target_phys_addr_t addr)

{

	/* Every channel has a 0x2000 ctrl register map.  */

	return addr >> 13;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void crs_replace_with_free_ranges(GPtrArray *ranges,
+
                                          uint64_t start, uint64_t end)

 {
@@ -17,7 +17,7 @@
     for (i = 0; i < ranges->len; i++) {

         CrsRangeEntry *used = g_ptr_array_index(ranges, i);
+

         if (free_base < used->base) {

static void crs_replace_with_free_ranges(GPtrArray *ranges,

                                         uint64_t start, uint64_t end)

{

    GPtrArray *free_ranges = g_ptr_array_new_with_free_func(crs_range_free);

    uint64_t free_base = start;

    int i;

    g_ptr_array_sort(ranges, crs_range_compare);

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

        CrsRangeEntry *used = g_ptr_array_index(ranges, i);

        if (free_base < used->base) {

            crs_range_insert(free_ranges, free_base, used->base - 1);

        }

        free_base = used->limit + 1;

    }

    if (free_base < end) {

        crs_range_insert(free_ranges, free_base, end);

    }

    g_ptr_array_set_size(ranges, 0);

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

        g_ptr_array_add(ranges, g_ptr_array_index(free_ranges, i));

    }

    g_ptr_array_free(free_ranges, false);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void acpi_add_table(GArray *table_offsets, GArray *table_data)
+
+{

     uint32_t offset = cpu_to_le32(table_data->len);

void acpi_add_table(GArray *table_offsets, GArray *table_data)

{

    uint32_t offset = cpu_to_le32(table_data->len);

    g_array_append_val(table_offsets, offset);

}


int av_packet_copy_props(AVPacket *dst, const AVPacket *src)

{

    int i;

    dst->pts                  = src->pts;

    dst->dts                  = src->dts;

    dst->pos                  = src->pos;

    dst->duration             = src->duration;

    dst->convergence_duration = src->convergence_duration;

    dst->flags                = src->flags;

    dst->stream_index         = src->stream_index;

    dst->side_data_elems      = src->side_data_elems;

    for (i = 0; i < src->side_data_elems; i++) {

         enum AVPacketSideDataType type = src->side_data[i].type;

         int size          = src->side_data[i].size;

         uint8_t *src_data = src->side_data[i].data;

         uint8_t *dst_data = av_packet_new_side_data(dst, type, size);

        if (!dst_data) {

            av_packet_free_side_data(dst);

            return AVERROR(ENOMEM);

        }

        memcpy(dst_data, src_data, size);

    }

    return 0;

}


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

      * BIOS does not set MTRR entries for the 64 bit window, so no need to
+
+     * align address to power of two.  Align address at 1G, this makes sure
+
+     * it can be exactly covered with a PAT entry even when using huge
+
      * pages.

      */

void pc_init_pci64_hole(PcPciInfo *pci_info, uint64_t pci_hole64_start,

                        uint64_t pci_hole64_size)

{

    if ((sizeof(hwaddr) == 4) || (!pci_hole64_size)) {

        return;

    }

    /*

     * BIOS does not set MTRR entries for the 64 bit window, so no need to

     * align address to power of two.  Align address at 1G, this makes sure

     * it can be exactly covered with a PAT entry even when using huge

     * pages.

     */

    pci_info->w64.begin = ROUND_UP(pci_hole64_start, 0x1ULL << 30);

    pci_info->w64.end = pci_info->w64.begin + pci_hole64_size;

    assert(pci_info->w64.begin <= pci_info->w64.end);

}


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

     int r;
@@ -7,10 +7,10 @@

     /* Account partial waits to the vm_clock.  */
+
+    qemu_clock_warp(vm_clock);

+

     if (next_cpu == NULL) {

bool cpu_exec_all(void)

{

    int r;

    /* Account partial waits to the vm_clock.  */

    qemu_clock_warp(vm_clock);

    if (next_cpu == NULL) {

        next_cpu = first_cpu;

    }

    for (; next_cpu != NULL && !exit_request; next_cpu = next_cpu->next_cpu) {

        CPUState *env = next_cpu;

        qemu_clock_enable(vm_clock,

                          (env->singlestep_enabled & SSTEP_NOTIMER) == 0);

#ifndef CONFIG_IOTHREAD

        if (qemu_alarm_pending()) {

            break;

        }

#endif

        if (cpu_can_run(env)) {

            if (kvm_enabled()) {

                r = kvm_cpu_exec(env);

                qemu_kvm_eat_signals(env);

            } else {

                r = tcg_cpu_exec(env);

            }

            if (r == EXCP_DEBUG) {

                cpu_handle_guest_debug(env);

                break;

            }

        } else if (env->stop || env->stopped) {

            break;

        }

    }

    exit_request = 0;

    return !all_cpu_threads_idle();

}


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

             val = s->control_regs.impl;

+            break;
+
+        case HOST_VERSION:
+
+            val = s->control_regs.version;

             break;

static uint64_t ahci_mem_read(void *opaque, target_phys_addr_t addr,

                              unsigned size)

{

    AHCIState *s = opaque;

    uint32_t val = 0;

    if (addr < AHCI_GENERIC_HOST_CONTROL_REGS_MAX_ADDR) {

        switch (addr) {

        case HOST_CAP:

            val = s->control_regs.cap;

            break;

        case HOST_CTL:

            val = s->control_regs.ghc;

            break;

        case HOST_IRQ_STAT:

            val = s->control_regs.irqstatus;

            break;

        case HOST_PORTS_IMPL:

            val = s->control_regs.impl;

            break;

        case HOST_VERSION:

            val = s->control_regs.version;

            break;

        }

        DPRINTF(-1, "(addr 0x%08X), val 0x%08X\n", (unsigned) addr, val);

    } else if ((addr >= AHCI_PORT_REGS_START_ADDR) &&

               (addr < (AHCI_PORT_REGS_START_ADDR +

                (s->ports * AHCI_PORT_ADDR_OFFSET_LEN)))) {

        val = ahci_port_read(s, (addr - AHCI_PORT_REGS_START_ADDR) >> 7,

                             addr & AHCI_PORT_ADDR_OFFSET_MASK);

    }

    return val;

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
                           |INLCR|IGNCR|ICRNL|IXON);

     tty.c_oflag |= OPOST;
+
+    tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN);
+
+    tty.c_cflag &= ~(CSIZE|PARENB);
+
     tty.c_cflag |= CS8;

     tty.c_cc[VMIN] = 1;

static void term_init(void)

{

    struct termios tty;

    tcgetattr (0, &tty);

    oldtty = tty;

    tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP

                          |INLCR|IGNCR|ICRNL|IXON);

    tty.c_oflag |= OPOST;

    tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN);

    tty.c_cflag &= ~(CSIZE|PARENB);

    tty.c_cflag |= CS8;

    tty.c_cc[VMIN] = 1;

    tty.c_cc[VTIME] = 0;

    tcsetattr (0, TCSANOW, &tty);

    atexit(term_exit);

}


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

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

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

     case AMF_DATA_TYPE_NULL:        return 1;

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

{

    const uint8_t *base = data;

    if (data >= data_end)

        return -1;

    switch (*data++) {

    case AMF_DATA_TYPE_NUMBER:      return 9;

    case AMF_DATA_TYPE_BOOL:        return 2;

    case AMF_DATA_TYPE_STRING:      return 3 + AV_RB16(data);

    case AMF_DATA_TYPE_LONG_STRING: return 5 + AV_RB32(data);

    case AMF_DATA_TYPE_NULL:        return 1;

    case AMF_DATA_TYPE_ARRAY:

        data += 4;

    case AMF_DATA_TYPE_OBJECT:

        for (;;) {

            int size = bytestream_get_be16(&data);

            int t;

            if (!size) {

                data++;

                break;

            }

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

                return -1;

            data += size;

            t = ff_amf_tag_size(data, data_end);

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

                return -1;

            data += t;

        }

        return data - base;

    case AMF_DATA_TYPE_OBJECT_END:  return 1;

    default:                        return -1;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static bool sys_ops_accepts(void *opaque, target_phys_addr_t addr,

+                            unsigned size, bool is_write)
+
 {

     return is_write && size == 4;

static bool sys_ops_accepts(void *opaque, target_phys_addr_t addr,

                            unsigned size, bool is_write)

{

    return is_write && size == 4;

}


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

+    switch (addr) {

     case CG3_REG_BT458_ADDR:

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

{

    CG3State *s = opaque;

    int val;

    switch (addr) {

    case CG3_REG_BT458_ADDR:

    case CG3_REG_BT458_COLMAP:

        val = 0;

        break;

    case CG3_REG_FBC_CTRL:

        val = s->regs[0];

        break;

    case CG3_REG_FBC_STATUS:

        /* monitor ID 6, board type = 1 (color) */

        val = s->regs[1] | CG3_SR_1152_900_76_B | CG3_SR_ID_COLOR;

        break;

    case CG3_REG_FBC_CURSTART ... CG3_REG_SIZE:

        val = s->regs[addr - 0x10];

        break;

    default:

        qemu_log_mask(LOG_UNIMP,

                  "cg3: Unimplemented register read "

                  "reg 0x%" HWADDR_PRIx " size 0x%x\n",

                  addr, size);

        val = 0;

        break;

    }

    DPRINTF("read %02x from reg %" HWADDR_PRIx "\n", val, addr);

    return val;

}


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

     uint32_t multiple8_cnt;

+
+
+    for (multiple8_cnt = 4; multiple8_cnt--;) {
+
+        avc_luma_midh_qrt_and_aver_dst_4w_msa(src, src_stride, dst, dst_stride,

                                               height, horiz_offset);

static void avc_luma_midh_qrt_and_aver_dst_16w_msa(const uint8_t *src,

                                                   int32_t src_stride,

                                                   uint8_t *dst,

                                                   int32_t dst_stride,

                                                   int32_t height,

                                                   uint8_t horiz_offset)

{

    uint32_t multiple8_cnt;

    for (multiple8_cnt = 4; multiple8_cnt--;) {

        avc_luma_midh_qrt_and_aver_dst_4w_msa(src, src_stride, dst, dst_stride,

                                              height, horiz_offset);

        src += 4;

        dst += 4;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void bdrv_dirty_bitmap_deserialize_zeroes(BdrvDirtyBitmap *bitmap,

                                           uint64_t start, uint64_t count,
+
+                                          bool finish)

 {

void bdrv_dirty_bitmap_deserialize_zeroes(BdrvDirtyBitmap *bitmap,

                                          uint64_t start, uint64_t count,

                                          bool finish)

{

    hbitmap_deserialize_zeroes(bitmap->bitmap, start, count, finish);

}


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

     char *dup;

+    size_t i;
+
+
+
+    if (!s) {

         return NULL;

char *g_strdup(const char *s)

{

    char *dup;

    size_t i;

    if (!s) {

        return NULL;

    }

    __coverity_string_null_sink__(s);

    __coverity_string_size_sink__(s);

    dup = __coverity_alloc_nosize__();

    __coverity_mark_as_afm_allocated__(dup, AFM_free);

    for (i = 0; (dup[i] = s[i]); i++) ;

    return dup;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,
+
                 BlockBackend *blk, qemu_irq irq, qemu_irq dma[],

                 omap_clk fclk, omap_clk iclk)

struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,

                BlockBackend *blk, qemu_irq irq, qemu_irq dma[],

                omap_clk fclk, omap_clk iclk)

{

    struct omap_mmc_s *s = (struct omap_mmc_s *)

            g_malloc0(sizeof(struct omap_mmc_s));

    s->irq = irq;

    s->dma = dma;

    s->clk = fclk;

    s->lines = 4;

    s->rev = 2;

    omap_mmc_reset(s);

    memory_region_init_io(&s->iomem, NULL, &omap_mmc_ops, s, "omap.mmc",

                          omap_l4_region_size(ta, 0));

    omap_l4_attach(ta, 0, &s->iomem);

    /* Instantiate the storage */

    s->card = sd_init(blk, false);

    if (s->card == NULL) {

        exit(1);

    }

    s->cdet = qemu_allocate_irq(omap_mmc_cover_cb, s, 0);

    sd_set_cb(s->card, NULL, s->cdet);

    return s;

}


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

         qemu_input_event_send(src, evt);

+        qemu_input_event_sync();
+
+        qapi_free_InputEvent(evt);
+
+    } else {

         qemu_input_queue_event(&kbd_queue, src, evt);

void qemu_input_event_send_key(QemuConsole *src, KeyValue *key, bool down)

{

    InputEvent *evt;

    evt = qemu_input_event_new_key(key, down);

    if (QTAILQ_EMPTY(&kbd_queue)) {

        qemu_input_event_send(src, evt);

        qemu_input_event_sync();

        qapi_free_InputEvent(evt);

    } else {

        qemu_input_queue_event(&kbd_queue, src, evt);

        qemu_input_queue_sync(&kbd_queue);

    }

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
     s->active = false;

     s->sin.subtype = g_strdup(subtype);
+
+    chr->opaque = s;
+
+    chr->chr_write = spice_chr_write;
+
     chr->chr_add_watch = spice_chr_add_watch;

     chr->chr_close = spice_chr_close;

static CharDriverState *chr_open(const char *subtype,

    void (*set_fe_open)(struct CharDriverState *, int))

{

    CharDriverState *chr;

    SpiceCharDriver *s;

    chr = g_malloc0(sizeof(CharDriverState));

    s = g_malloc0(sizeof(SpiceCharDriver));

    s->chr = chr;

    s->active = false;

    s->sin.subtype = g_strdup(subtype);

    chr->opaque = s;

    chr->chr_write = spice_chr_write;

    chr->chr_add_watch = spice_chr_add_watch;

    chr->chr_close = spice_chr_close;

    chr->chr_set_fe_open = set_fe_open;

    chr->explicit_be_open = true;

    chr->chr_fe_event = spice_chr_fe_event;

    QLIST_INSERT_HEAD(&spice_chars, s, next);

    return chr;

}


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

         return -EINVAL;

+    }
+
+
+
+    return bdrv_co_do_preadv(bs, sector_num << BDRV_SECTOR_BITS,

                              nb_sectors << BDRV_SECTOR_BITS, qiov, flags);

static int coroutine_fn bdrv_co_do_readv(BlockDriverState *bs,

    int64_t sector_num, int nb_sectors, QEMUIOVector *qiov,

    BdrvRequestFlags flags)

{

    if (nb_sectors < 0 || nb_sectors > (UINT_MAX >> BDRV_SECTOR_BITS)) {

        return -EINVAL;

    }

    return bdrv_co_do_preadv(bs, sector_num << BDRV_SECTOR_BITS,

                             nb_sectors << BDRV_SECTOR_BITS, qiov, flags);

}