--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 void ff_celp_lp_synthesis_filterf(float *out,

                                   const float* filter_coeffs,
+
+                                  const float* in,
+
+                                  int buffer_length,
+
                                   int filter_length)

 {

void ff_celp_lp_synthesis_filterf(float *out,

                                  const float* filter_coeffs,

                                  const float* in,

                                  int buffer_length,

                                  int filter_length)

{

    int i,n;

    // Avoids a +1 in the inner loop.

    filter_length++;

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

        out[n] = in[n];

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

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

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static int gif_read_close(AVFormatContext *s1)
+
+{
+
     GifState *s = s1->priv_data;

     av_free(s->image_buf);

static int gif_read_close(AVFormatContext *s1)

{

    GifState *s = s1->priv_data;

    av_free(s->image_buf);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void put_unused_buffer(QEMUFile *f, void *pv, size_t size)
+
+{
+
+    static const uint8_t buf[1024];

     int block_len;

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

{

    static const uint8_t buf[1024];

    int block_len;

    while (size > 0) {

        block_len = MIN(sizeof(buf), size);

        size -= block_len;

        qemu_put_buffer(f, buf, block_len);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir)

 {
+
     int my_max = INT_MIN, my_min = INT_MAX, qpel_shift = !s->quarter_sample;

     int my, off, i, mvs;

int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir)

{

    int my_max = INT_MIN, my_min = INT_MAX, qpel_shift = !s->quarter_sample;

    int my, off, i, mvs;

    if (s->picture_structure != PICT_FRAME) goto unhandled;

    switch (s->mv_type) {

        case MV_TYPE_16X16:

            mvs = 1;

            break;

        case MV_TYPE_16X8:

            mvs = 2;

            break;

        case MV_TYPE_8X8:

            mvs = 4;

            break;

        default:

            goto unhandled;

    }

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

        my = s->mv[dir][i][1]<<qpel_shift;

        my_max = FFMAX(my_max, my);

        my_min = FFMIN(my_min, my);

    }

    off = (FFMAX(-my_min, my_max) + 63) >> 6;

    return FFMIN(FFMAX(s->mb_y + off, 0), s->mb_height-1);

unhandled:

    return s->mb_height-1;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int parse_key(DBEContext *s)
+
+{
+
+    int key = 0;

static int parse_key(DBEContext *s)

{

    int key = 0;

    if (s->key_present && s->input_size > 0)

        key = AV_RB24(s->input) >> 24 - s->word_bits;

    skip_input(s, s->key_present);

    return key;

}


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

     /* Always run first iteration so any pending completion BHs run */
+
+    bool busy = true;

     BlockDriverState *bs;

void bdrv_drain_all(void)

{

    /* Always run first iteration so any pending completion BHs run */

    bool busy = true;

    BlockDriverState *bs;

    while (busy) {

        /* FIXME: We do not have timer support here, so this is effectively

         * a busy wait.

         */

        QTAILQ_FOREACH(bs, &bdrv_states, list) {

            if (bdrv_start_throttled_reqs(bs)) {

                busy = true;

            }

        }

        busy = bdrv_requests_pending_all();

        busy |= aio_poll(qemu_get_aio_context(), busy);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 int64_t bdrv_getlength(BlockDriverState *bs)

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

         return -ENOMEDIUM;

int64_t bdrv_getlength(BlockDriverState *bs)

{

    BlockDriver *drv = bs->drv;

    if (!drv)

        return -ENOMEDIUM;

    if (bs->growable || bs->removable) {

        if (drv->bdrv_getlength) {

            return drv->bdrv_getlength(bs);

        }

    }

    return bs->total_sectors * BDRV_SECTOR_SIZE;

}


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

             fseek(f->outfile, f->buf_offset, SEEK_SET);

+            fwrite(f->buf, 1, f->buf_index, f->outfile);
+
+        } else {
+
+            bdrv_pwrite(f->bs, f->base_offset + f->buf_offset,

                         f->buf, f->buf_index);

void qemu_fflush(QEMUFile *f)

{

    if (!f->is_writable)

        return;

    if (f->buf_index > 0) {

        if (f->is_file) {

            fseek(f->outfile, f->buf_offset, SEEK_SET);

            fwrite(f->buf, 1, f->buf_index, f->outfile);

        } else {

            bdrv_pwrite(f->bs, f->base_offset + f->buf_offset,

                        f->buf, f->buf_index);

        }

        f->buf_offset += f->buf_index;

        f->buf_index = 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void free_device_list(AVOpenCLDeviceList *device_list)

+{

     int i, j;

static void free_device_list(AVOpenCLDeviceList *device_list)

{

    int i, j;

    if (!device_list)

        return;

    for (i = 0; i < device_list->platform_num; i++) {

        if (!device_list->platform_node[i])

            continue;

        for (j = 0; j < device_list->platform_node[i]->device_num; j++) {

            av_freep(&(device_list->platform_node[i]->device_node[j]->device_name));

            av_freep(&(device_list->platform_node[i]->device_node[j]));

        }

        av_freep(&device_list->platform_node[i]->device_node);

        av_freep(&(device_list->platform_node[i]->platform_name));

        av_freep(&device_list->platform_node[i]);

    }

    av_freep(&device_list->platform_node);

    device_list->platform_num = 0;

}


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

     if (size < 0) {

+        hw_error("Load kernel error: '%s'\n", kernel_filename);
+
+    }
+
+

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

static void puv3_load_kernel(const char *kernel_filename)

{

    int size;

    assert(kernel_filename != NULL);

    /* only zImage format supported */

    size = load_image_targphys(kernel_filename, KERNEL_LOAD_ADDR,

            KERNEL_MAX_SIZE);

    if (size < 0) {

        hw_error("Load kernel error: '%s'\n", kernel_filename);

    }

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

    graphic_console_init(NULL, NULL, NULL, NULL, NULL);

}


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

     NICInfo *nic;
+
+
+
+    for (i = 0; i < MAX_NICS; i++) {

         nic = &nd_table[i];

void destroy_nic(dev_match_fn *match_fn, void *arg)

{

    int i;

    NICInfo *nic;

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

        nic = &nd_table[i];

        if (nic->used) {

            if (nic->private && match_fn(nic->private, arg)) {

                if (nic->vlan) {

                    VLANClientState *vc;

                    vc = qemu_find_vlan_client(nic->vlan, nic->private);

                    if (vc)

                        qemu_del_vlan_client(vc);

                }

                net_client_uninit(nic);

            }

        }

    }

}


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

     if (s->waiting == 1 || !s->current || req->hba_private != s->current ||
+
+        (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON))) {
+
+        if (lsi_queue_req(s, req, len)) {
+
             return;

         }

static void lsi_transfer_data(SCSIRequest *req, uint32_t len)

{

    LSIState *s = DO_UPCAST(LSIState, dev.qdev, req->bus->qbus.parent);

    int out;

    if (s->waiting == 1 || !s->current || req->hba_private != s->current ||

        (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON))) {

        if (lsi_queue_req(s, req, len)) {

            return;

        }

    }

    out = (s->sstat1 & PHASE_MASK) == PHASE_DO;

    /* host adapter (re)connected */

    DPRINTF("Data ready tag=0x%x len=%d\n", req->tag, len);

    s->current->dma_len = len;

    s->command_complete = 1;

    if (s->waiting) {

        if (s->waiting == 1 || s->dbc == 0) {

            lsi_resume_script(s);

        } else {

            lsi_do_dma(s, out);

        }

    }

}


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

+
+    /* Attempt to detect via a floppy specific ioctl */
+
+    ret = ioctl(fd, FDGETPRM, &fdparam);
+
     if (ret >= 0)

         prio = 100;

static int floppy_probe_device(const char *filename)

{

    int fd, ret;

    int prio = 0;

    struct floppy_struct fdparam;

    struct stat st;

    if (strstart(filename, "/dev/fd", NULL))

        prio = 50;

    fd = open(filename, O_RDONLY | O_NONBLOCK);

    if (fd < 0) {

        goto out;

    }

    ret = fstat(fd, &st);

    if (ret == -1 || !S_ISBLK(st.st_mode)) {

        goto outc;

    }

    /* Attempt to detect via a floppy specific ioctl */

    ret = ioctl(fd, FDGETPRM, &fdparam);

    if (ret >= 0)

        prio = 100;

outc:

    close(fd);

out:

    return prio;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void sigaction_invoke(struct sigaction *action,
+
                       struct qemu_signalfd_siginfo *info)

 {

void sigaction_invoke(struct sigaction *action,

                      struct qemu_signalfd_siginfo *info)

{

    siginfo_t si = { 0 };

    si.si_signo = info->ssi_signo;

    si.si_errno = info->ssi_errno;

    si.si_code = info->ssi_code;

    /* Convert the minimal set of fields defined by POSIX.

     * Positive si_code values are reserved for kernel-generated

     * signals, where the valid siginfo fields are determined by

     * the signal number.  But according to POSIX, it is unspecified

     * whether SI_USER and SI_QUEUE have values less than or equal to

     * zero.

     */

    if (info->ssi_code == SI_USER || info->ssi_code == SI_QUEUE ||

        info->ssi_code <= 0) {

        /* SIGTERM, etc.  */

        si.si_pid = info->ssi_pid;

        si.si_uid = info->ssi_uid;

    } else if (info->ssi_signo == SIGILL || info->ssi_signo == SIGFPE ||

               info->ssi_signo == SIGSEGV || info->ssi_signo == SIGBUS) {

        si.si_addr = (void *)(uintptr_t)info->ssi_addr;

    } else if (info->ssi_signo == SIGCHLD) {

        si.si_pid = info->ssi_pid;

        si.si_status = info->ssi_status;

        si.si_uid = info->ssi_uid;

    }

    action->sa_sigaction(info->ssi_signo, &si, NULL);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static int coroutine_fn bdrv_co_writev_em(BlockDriverState *bs,
+
                                          int64_t sector_num, int nb_sectors,

                                          QEMUIOVector *iov)

static int coroutine_fn bdrv_co_writev_em(BlockDriverState *bs,

                                         int64_t sector_num, int nb_sectors,

                                         QEMUIOVector *iov)

{

    return bdrv_co_io_em(bs, sector_num, nb_sectors, iov, true);

}


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

     test_init(&td);

+

     stop_tco(&td);

static void test_tco_second_timeout_pause(void)

{

    TestData td;

    const uint16_t ticks = TCO_SECS_TO_TICKS(32);

    QDict *ad;

    td.args = "-watchdog-action pause";

    td.noreboot = false;

    test_init(&td);

    stop_tco(&td);

    clear_tco_status(&td);

    reset_on_second_timeout(true);

    set_tco_timeout(&td, TCO_SECS_TO_TICKS(16));

    load_tco(&td);

    start_tco(&td);

    clock_step(ticks * TCO_TICK_NSEC * 2);

    ad = get_watchdog_action();

    g_assert(!strcmp(qdict_get_str(ad, "action"), "pause"));

    QDECREF(ad);

    stop_tco(&td);

    qtest_end();

}


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

     *result = NULL;

+    v->result = result;
+
+
+
+    return &v->visitor;

 }

Visitor *qmp_output_visitor_new(QObject **result)

{

    QmpOutputVisitor *v;

    v = g_malloc0(sizeof(*v));

    v->visitor.type = VISITOR_OUTPUT;

    v->visitor.start_struct = qmp_output_start_struct;

    v->visitor.end_struct = qmp_output_end_struct;

    v->visitor.start_list = qmp_output_start_list;

    v->visitor.next_list = qmp_output_next_list;

    v->visitor.end_list = qmp_output_end_list;

    v->visitor.type_int64 = qmp_output_type_int64;

    v->visitor.type_uint64 = qmp_output_type_uint64;

    v->visitor.type_bool = qmp_output_type_bool;

    v->visitor.type_str = qmp_output_type_str;

    v->visitor.type_number = qmp_output_type_number;

    v->visitor.type_any = qmp_output_type_any;

    v->visitor.type_null = qmp_output_type_null;

    v->visitor.complete = qmp_output_complete;

    v->visitor.free = qmp_output_free;

    *result = NULL;

    v->result = result;

    return &v->visitor;

}


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

     if (!gd_is_grab_active(s) && gd_grab_on_hover(s)) {
+
+        gd_ungrab_keyboard(s);
+
+    }
+

     return TRUE;

static gboolean gd_leave_event(GtkWidget *widget, GdkEventCrossing *crossing,

                               gpointer opaque)

{

    VirtualConsole *vc = opaque;

    GtkDisplayState *s = vc->s;

    if (!gd_is_grab_active(s) && gd_grab_on_hover(s)) {

        gd_ungrab_keyboard(s);

    }

    return TRUE;

}


static int ppc_hash32_pp_check(int key, int pp, int nx)

{

    int access;

    /* Compute access rights */

    access = 0;

    if (key == 0) {

        switch (pp) {

        case 0x0:

        case 0x1:

        case 0x2:

            access |= PAGE_WRITE;

            /* No break here */

        case 0x3:

            access |= PAGE_READ;

            break;

        }

    } else {

        switch (pp) {

        case 0x0:

            access = 0;

            break;

        case 0x1:

        case 0x3:

            access = PAGE_READ;

            break;

        case 0x2:

            access = PAGE_READ | PAGE_WRITE;

            break;

        }

    }

    if (nx == 0) {

        access |= PAGE_EXEC;

    }

    return access;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 bool net_tx_pkt_send(struct NetTxPkt *pkt, NetClientState *nc)
+
+{
+
+    assert(pkt);
+

     if (!pkt->has_virt_hdr &&

bool net_tx_pkt_send(struct NetTxPkt *pkt, NetClientState *nc)

{

    assert(pkt);

    if (!pkt->has_virt_hdr &&

        pkt->virt_hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) {

        net_tx_pkt_do_sw_csum(pkt);

    }

    /*

     * Since underlying infrastructure does not support IP datagrams longer

     * than 64K we should drop such packets and don't even try to send

     */

    if (VIRTIO_NET_HDR_GSO_NONE != pkt->virt_hdr.gso_type) {

        if (pkt->payload_len >

            ETH_MAX_IP_DGRAM_LEN -

            pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_len) {

            return false;

        }

    }

    if (pkt->has_virt_hdr ||

        pkt->virt_hdr.gso_type == VIRTIO_NET_HDR_GSO_NONE) {

        qemu_sendv_packet(nc, pkt->vec,

            pkt->payload_frags + NET_TX_PKT_PL_START_FRAG);

        return true;

    }

    return net_tx_pkt_do_sw_fragmentation(pkt, nc);

}


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

         memory_region_unref(mr);
+
+        return;
+
+    }
+
     if (is_write) {

         address_space_write(as, bounce.addr, bounce.buffer, access_len);

void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len,

                         int is_write, hwaddr access_len)

{

    if (buffer != bounce.buffer) {

        MemoryRegion *mr;

        ram_addr_t addr1;

        mr = qemu_ram_addr_from_host(buffer, &addr1);

        assert(mr != NULL);

        if (is_write) {

            while (access_len) {

                unsigned l;

                l = TARGET_PAGE_SIZE;

                if (l > access_len)

                    l = access_len;

                invalidate_and_set_dirty(addr1, l);

                addr1 += l;

                access_len -= l;

            }

        }

        if (xen_enabled()) {

            xen_invalidate_map_cache_entry(buffer);

        }

        memory_region_unref(mr);

        return;

    }

    if (is_write) {

        address_space_write(as, bounce.addr, bounce.buffer, access_len);

    }

    qemu_vfree(bounce.buffer);

    bounce.buffer = NULL;

    memory_region_unref(bounce.mr);

    cpu_notify_map_clients();

}


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

     env->CP0_Wired = arg1 % env->tlb->nb_tlb;

+}

void helper_mtc0_wired(CPUMIPSState *env, target_ulong arg1)

{

    env->CP0_Wired = arg1 % env->tlb->nb_tlb;

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     if (ri->numPages > PVSCSI_SETUP_MSG_RING_MAX_NUM_PAGES) {

         return -1;
+
+    }
+
+    ring_size = ri->numPages * PVSCSI_MAX_NUM_MSG_ENTRIES_PER_PAGE;
+
     len_log2 = pvscsi_log2(ring_size - 1);

pvscsi_ring_init_msg(PVSCSIRingInfo *m, PVSCSICmdDescSetupMsgRing *ri)

{

    int i;

    uint32_t len_log2;

    uint32_t ring_size;

    if (ri->numPages > PVSCSI_SETUP_MSG_RING_MAX_NUM_PAGES) {

        return -1;

    }

    ring_size = ri->numPages * PVSCSI_MAX_NUM_MSG_ENTRIES_PER_PAGE;

    len_log2 = pvscsi_log2(ring_size - 1);

    m->msg_len_mask = MASK(len_log2);

    m->filled_msg_ptr = 0;

    for (i = 0; i < ri->numPages; i++) {

        m->msg_ring_pages_pa[i] = ri->ringPPNs[i] << VMW_PAGE_SHIFT;

    }

    RS_SET_FIELD(m, msgProdIdx, 0);

    RS_SET_FIELD(m, msgConsIdx, 0);

    RS_SET_FIELD(m, msgNumEntriesLog2, len_log2);

    trace_pvscsi_ring_init_msg(len_log2);

    /* Flush ring state page changes */

    smp_wmb();

    return 0;

}


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

     bytestream2_skip(&s->gb, length);

+

     /* decode one line if possible */

static int png_decode_idat(PNGDecContext *s, int length)

{

    int ret;

    s->zstream.avail_in = FFMIN(length, bytestream2_get_bytes_left(&s->gb));

    s->zstream.next_in  = (unsigned char *)s->gb.buffer;

    bytestream2_skip(&s->gb, length);

    /* decode one line if possible */

    while (s->zstream.avail_in > 0) {

        ret = inflate(&s->zstream, Z_PARTIAL_FLUSH);

        if (ret != Z_OK && ret != Z_STREAM_END) {

            av_log(s->avctx, AV_LOG_ERROR, "inflate returned error %d\n", ret);

            return AVERROR_EXTERNAL;

        }

        if (s->zstream.avail_out == 0) {

            if (!(s->state & PNG_ALLIMAGE)) {

                png_handle_row(s);

            }

            s->zstream.avail_out = s->crow_size;

            s->zstream.next_out  = s->crow_buf;

        }

        if (ret == Z_STREAM_END && s->zstream.avail_in > 0) {

            av_log(NULL, AV_LOG_WARNING,

                   "%d undecompressed bytes left in buffer\n", s->zstream.avail_in);

            return 0;

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     for(ppe = &first_polling_entry; *ppe != NULL; ppe = &(*ppe)->next) {

         pe = *ppe;
+
+        if (pe->func == func && pe->opaque == opaque) {
+
+            *ppe = pe->next;
+
             g_free(pe);

             break;

void qemu_del_polling_cb(PollingFunc *func, void *opaque)

{

    PollingEntry **ppe, *pe;

    for(ppe = &first_polling_entry; *ppe != NULL; ppe = &(*ppe)->next) {

        pe = *ppe;

        if (pe->func == func && pe->opaque == opaque) {

            *ppe = pe->next;

            g_free(pe);

            break;

        }

    }

}


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

     int iomemtype;

+

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

void arm_sysctl_init(uint32_t base, uint32_t sys_id)

{

    arm_sysctl_state *s;

    int iomemtype;

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

    if (!s)

        return;

    s->base = base;

    s->sys_id = sys_id;

    iomemtype = cpu_register_io_memory(0, arm_sysctl_readfn,

                                       arm_sysctl_writefn, s);

    cpu_register_physical_memory(base, 0x00000fff, iomemtype);

    /* ??? Save/restore.  */

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void do_brinc (void)

+{

     uint32_t a, b, d, mask;

void do_brinc (void)

{

    uint32_t a, b, d, mask;

    mask = (uint32_t)(-1UL) >> MASKBITS;

    b = T1_64 & mask;

    a = T0_64 & mask;

    d = word_reverse(1 + word_reverse(a | ~mask));

    T0_64 = (T0_64 & ~mask) | (d & mask);

}


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

     int i;

+

     if (AV_RB24(ptr) == 0xEFBBBF)

static int microdvd_probe(AVProbeData *p)

{

    unsigned char c;

    const uint8_t *ptr = p->buf;

    int i;

    if (AV_RB24(ptr) == 0xEFBBBF)

        ptr += 3;  /* skip UTF-8 BOM */

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

        if (sscanf(ptr, "{%*d}{}%c",     &c) != 1 &&

            sscanf(ptr, "{%*d}{%*d}%c",  &c) != 1 &&

            sscanf(ptr, "{DEFAULT}{}%c", &c) != 1)

            return 0;

        ptr += strcspn(ptr, "\n") + 1;

    }

    return AVPROBE_SCORE_MAX;

}


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

+    return bdrv_co_do_readv(bs, sector_num, nb_sectors, qiov, 0);
+
+}

int coroutine_fn bdrv_co_readv(BlockDriverState *bs, int64_t sector_num,

    int nb_sectors, QEMUIOVector *qiov)

{

    trace_bdrv_co_readv(bs, sector_num, nb_sectors);

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

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+bdrv_acct_start(BlockDriverState *bs, BlockAcctCookie *cookie, int64_t bytes,
+
+        enum BlockAcctType type)
+
+{

     assert(type < BDRV_MAX_IOTYPE);

bdrv_acct_start(BlockDriverState *bs, BlockAcctCookie *cookie, int64_t bytes,

        enum BlockAcctType type)

{

    assert(type < BDRV_MAX_IOTYPE);

    cookie->bytes = bytes;

    cookie->start_time_ns = get_clock();

    cookie->type = type;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
                      enum PixelFormat target)
 {
     const int16_t *buf0  = buf[0],  *buf1  = buf[1],
+                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
+                  *vbuf0 = vbuf[0], *vbuf1 = vbuf[1];
+    int  yalpha1 = 4095 - yalpha;
+    int uvalpha1 = 4095 - uvalpha;
+    int i;
     for (i = 0; i < (dstW >> 1); i++) {
         int Y1 = (buf0[i * 2]     * yalpha1  + buf1[i * 2]     * yalpha)  >> 19;
         int Y2 = (buf0[i * 2 + 1] * yalpha1  + buf1[i * 2 + 1] * yalpha)  >> 19;

yuv2422_2_c_template(SwsContext *c, const int16_t *buf[2],
                     const int16_t *ubuf[2], const int16_t *vbuf[2],
                     const int16_t *abuf[2], uint8_t *dest, int dstW,
                     int yalpha, int uvalpha, int y,
                     enum PixelFormat target)
{
    const int16_t *buf0  = buf[0],  *buf1  = buf[1],
                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
                  *vbuf0 = vbuf[0], *vbuf1 = vbuf[1];
    int  yalpha1 = 4095 - yalpha;
    int uvalpha1 = 4095 - uvalpha;
    int i;
    for (i = 0; i < (dstW >> 1); i++) {
        int Y1 = (buf0[i * 2]     * yalpha1  + buf1[i * 2]     * yalpha)  >> 19;
        int Y2 = (buf0[i * 2 + 1] * yalpha1  + buf1[i * 2 + 1] * yalpha)  >> 19;
        int U  = (ubuf0[i]        * uvalpha1 + ubuf1[i]        * uvalpha) >> 19;
        int V  = (vbuf0[i]        * uvalpha1 + vbuf1[i]        * uvalpha) >> 19;
        output_pixels(i * 4, Y1, U, Y2, V);
    }
}


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

         /* TODO inverted pulse on timer->out_val == 1?  */
+
+        qemu_irq_pulse(timer->out);
+
+}

static inline void omap_gp_timer_trigger(struct omap_gp_timer_s *timer)

{

    if (timer->pt)

        /* TODO in overflow-and-match mode if the first event to

         * occurs is the match, don't toggle.  */

        omap_gp_timer_out(timer, !timer->out_val);

    else

        /* TODO inverted pulse on timer->out_val == 1?  */

        qemu_irq_pulse(timer->out);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void ff_bink_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block)

+{

     int i;

void ff_bink_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block)

{

    int i;

    DCTELEM temp[64];

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

        bink_idct_col(&temp[i], &block[i]);

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

        IDCT_ROW( (&dest[i*linesize]), (&temp[8*i]) );

    }

}


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

     gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
+
 #else

     if (unlikely(ctx->pr)) {

static void gen_msgsnd(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

#else

    if (unlikely(ctx->pr)) {

        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

        return;

    }

    gen_helper_msgsnd(cpu_gpr[rB(ctx->opcode)]);

#endif

}


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

         event.user.data1 = opaque;

+        if (!is->refresh && (!is->paused || is->force_refresh)) {
+
+            is->refresh = 1;
+
+            SDL_PushEvent(&event);

         }

static int refresh_thread(void *opaque)

{

    VideoState *is= opaque;

    while (!is->abort_request) {

        SDL_Event event;

        event.type = FF_REFRESH_EVENT;

        event.user.data1 = opaque;

        if (!is->refresh && (!is->paused || is->force_refresh)) {

            is->refresh = 1;

            SDL_PushEvent(&event);

        }

        //FIXME ideally we should wait the correct time but SDLs event passing is so slow it would be silly

        av_usleep(is->audio_st && is->show_mode != SHOW_MODE_VIDEO ? rdftspeed*1000 : 5000);

    }

    return 0;

}


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

     bool *v = pv;

+    qemu_put_byte(f, *v);
+
 }

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

{

    bool *v = pv;

    qemu_put_byte(f, *v);

}


--- a/source.c
+++ b/source.c
@@ -16,11 +16,11 @@
     gen_spr_power8_tce_address_control(env);
     gen_spr_power8_ids(env);
     gen_spr_power8_ebb(env);
+    gen_spr_power8_fscr(env);
+    gen_spr_power8_pmu_sup(env);
+    gen_spr_power8_pmu_user(env);
+    gen_spr_power8_tm(env);
+    gen_spr_power8_pspb(env);
     gen_spr_vtb(env);
     gen_spr_power8_ic(env);
     gen_spr_power8_book4(env);

static void init_proc_POWER9(CPUPPCState *env)
{
    /* Common Registers */
    init_proc_book3s_common(env);
    gen_spr_book3s_207_dbg(env);
    /* POWER8 Specific Registers */
    gen_spr_book3s_ids(env);
    gen_spr_amr(env);
    gen_spr_iamr(env);
    gen_spr_book3s_purr(env);
    gen_spr_power5p_common(env);
    gen_spr_power5p_lpar(env);
    gen_spr_power5p_ear(env);
    gen_spr_power6_common(env);
    gen_spr_power6_dbg(env);
    gen_spr_power8_tce_address_control(env);
    gen_spr_power8_ids(env);
    gen_spr_power8_ebb(env);
    gen_spr_power8_fscr(env);
    gen_spr_power8_pmu_sup(env);
    gen_spr_power8_pmu_user(env);
    gen_spr_power8_tm(env);
    gen_spr_power8_pspb(env);
    gen_spr_vtb(env);
    gen_spr_power8_ic(env);
    gen_spr_power8_book4(env);
    gen_spr_power8_rpr(env);
    /* POWER9 Specific registers */
    spr_register_kvm(env, SPR_TIDR, "TIDR", NULL, NULL,
                     KVM_REG_PPC_TIDR, 0);
    /* env variables */
#if !defined(CONFIG_USER_ONLY)
    env->slb_nr = 32;
#endif
    env->ci_large_pages = true;
    env->dcache_line_size = 128;
    env->icache_line_size = 128;
    /* Allocate hardware IRQ controller */
    init_excp_POWER8(env);
    ppcPOWER7_irq_init(ppc_env_get_cpu(env));
}


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

     s->frame_start = start;

+    s->frame_end = start + size;
+
     s->frame_reg = reg;

 }

void tcg_set_frame(TCGContext *s, int reg, intptr_t start, intptr_t size)

{

    s->frame_start = start;

    s->frame_end = start + size;

    s->frame_reg = reg;

}


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

         if (s->tray_open != !start) {

+            bdrv_eject(s->bs, !start);
+
+            s->tray_open = !start;
+
+        }

     }

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

{

    int sense;

    bool start = buf[4] & 1;

    bool loej = buf[4] & 2;     /* load on start, eject on !start */

    int pwrcnd = buf[4] & 0xf0;

    if (pwrcnd) {

        /* eject/load only happens for power condition == 0 */

        return;

    }

    if (loej) {

        if (!start && !s->tray_open && s->tray_locked) {

            sense = bdrv_is_inserted(s->bs)

                ? NOT_READY : ILLEGAL_REQUEST;

            ide_atapi_cmd_error(s, sense, ASC_MEDIA_REMOVAL_PREVENTED);

            return;

        }

        if (s->tray_open != !start) {

            bdrv_eject(s->bs, !start);

            s->tray_open = !start;

        }

    }

    ide_atapi_cmd_ok(s);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int qemu_savevm_state(Monitor *mon, QEMUFile *f)
+
+{
+
+    int ret;
+

     if (qemu_savevm_state_blocked(mon)) {

static int qemu_savevm_state(Monitor *mon, QEMUFile *f)

{

    int ret;

    if (qemu_savevm_state_blocked(mon)) {

        ret = -EINVAL;

        goto out;

    }

    ret = qemu_savevm_state_begin(f, 0, 0);

    if (ret < 0)

        goto out;

    do {

        ret = qemu_savevm_state_iterate(f);

        if (ret < 0)

            goto out;

    } while (ret == 0);

    ret = qemu_savevm_state_complete(f);

out:

    if (ret == 0) {

        ret = qemu_file_get_error(f);

    }

    return ret;

}


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

         error_setg(errp, "acpi: device plug request for not supported device"

+                   " type: %s", object_get_typename(OBJECT(dev)));
+
+    }
+
+}

void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,

                            Error **errp)

{

    ICH9LPCState *lpc = ICH9_LPC_DEVICE(hotplug_dev);

    if (lpc->pm.acpi_memory_hotplug.is_enabled &&

        object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {

        acpi_memory_plug_cb(hotplug_dev, &lpc->pm.acpi_memory_hotplug,

                            dev, errp);

    } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) {

        if (lpc->pm.cpu_hotplug_legacy) {

            legacy_acpi_cpu_plug_cb(hotplug_dev, &lpc->pm.gpe_cpu, dev, errp);

        } else {

            acpi_cpu_plug_cb(hotplug_dev, &lpc->pm.cpuhp_state, dev, errp);

        }

    } else {

        error_setg(errp, "acpi: device plug request for not supported device"

                   " type: %s", object_get_typename(OBJECT(dev)));

    }

}


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

     if (virtio_queue_empty(n->rx_vq) ||

+        (n->mergeable_rx_bufs &&
+
+         !virtqueue_avail_bytes(n->rx_vq, bufsize, 0))) {
+
+        virtio_queue_set_notification(n->rx_vq, 1);

         return 0;

static int do_virtio_net_can_receive(VirtIONet *n, int bufsize)

{

    if (!virtio_queue_ready(n->rx_vq) ||

        !(n->vdev.status & VIRTIO_CONFIG_S_DRIVER_OK))

        return 0;

    if (virtio_queue_empty(n->rx_vq) ||

        (n->mergeable_rx_bufs &&

         !virtqueue_avail_bytes(n->rx_vq, bufsize, 0))) {

        virtio_queue_set_notification(n->rx_vq, 1);

        return 0;

    }

    virtio_queue_set_notification(n->rx_vq, 0);

    return 1;

}


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

                            "'string': 'str', "

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

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

static void test_validate_union_flat(TestInputVisitorData *data,

                                     const void *unused)

{

    UserDefFlatUnion *tmp = NULL;

    Visitor *v;

    Error *errp = NULL;

    v = validate_test_init(data,

                           "{ 'enum1': 'value1', "

                           "'string': 'str', "

                           "'boolean': true }");

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

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

    g_assert(!error_is_set(&errp));

    qapi_free_UserDefFlatUnion(tmp);

}


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

     if ((event_mask & EVENT_MASK_EPOW) == 0) {

+        return NULL;
+
+    }
+
+

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

static sPAPREventLogEntry *rtas_event_log_dequeue(uint32_t event_mask,

                                                  bool exception)

{

    sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());

    sPAPREventLogEntry *entry = NULL;

    /* we only queue EPOW events atm. */

    if ((event_mask & EVENT_MASK_EPOW) == 0) {

        return NULL;

    }

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

        if (entry->exception != exception) {

            continue;

        }

        /* EPOW and hotplug events are surfaced in the same manner */

        if (entry->log_type == RTAS_LOG_TYPE_EPOW ||

            entry->log_type == RTAS_LOG_TYPE_HOTPLUG) {

            break;

        }

    }

    if (entry) {

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

    }

    return entry;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+void OPPROTO op_decq_ECX(void)

 {

void OPPROTO op_decq_ECX(void)

{

    ECX--;

}


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

     }
+
+
+
+    if (rule && rule->options.inject.error) {
+
         return inject_error(bs, rule);

     }

blkdebug_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes,

                    QEMUIOVector *qiov, int flags)

{

    BDRVBlkdebugState *s = bs->opaque;

    BlkdebugRule *rule = NULL;

    /* Sanity check block layer guarantees */

    assert(QEMU_IS_ALIGNED(offset, bs->bl.request_alignment));

    assert(QEMU_IS_ALIGNED(bytes, bs->bl.request_alignment));

    if (bs->bl.max_transfer) {

        assert(bytes <= bs->bl.max_transfer);

    }

    QSIMPLEQ_FOREACH(rule, &s->active_rules, active_next) {

        uint64_t inject_offset = rule->options.inject.offset;

        if (inject_offset == -1 ||

            (inject_offset >= offset && inject_offset < offset + bytes))

        {

            break;

        }

    }

    if (rule && rule->options.inject.error) {

        return inject_error(bs, rule);

    }

    return bdrv_co_pwritev(bs->file, offset, bytes, qiov, flags);

}


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

     char *bdref_key_dot;

+    const char *reference;
+
+
+
+    assert(pbs);

     assert(*pbs == NULL);

int bdrv_open_image(BlockDriverState **pbs, const char *filename,

                    QDict *options, const char *bdref_key, int flags,

                    bool allow_none, Error **errp)

{

    QDict *image_options;

    int ret;

    char *bdref_key_dot;

    const char *reference;

    assert(pbs);

    assert(*pbs == NULL);

    bdref_key_dot = g_strdup_printf("%s.", bdref_key);

    qdict_extract_subqdict(options, &image_options, bdref_key_dot);

    g_free(bdref_key_dot);

    reference = qdict_get_try_str(options, bdref_key);

    if (!filename && !reference && !qdict_size(image_options)) {

        if (allow_none) {

            ret = 0;

        } else {

            error_setg(errp, "A block device must be specified for \"%s\"",

                       bdref_key);

            ret = -EINVAL;

        }

        goto done;

    }

    ret = bdrv_open(pbs, filename, reference, image_options, flags, NULL, errp);

done:

    qdict_del(options, bdref_key);

    return ret;

}


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

 {

+    QObject *arg;

     QDict *qdict;

static void test_visitor_out_null(TestOutputVisitorData *data,

                                  const void *unused)

{

    QObject *arg;

    QDict *qdict;

    QObject *nil;

    visit_start_struct(data->ov, NULL, NULL, 0, &error_abort);

    visit_type_null(data->ov, "a", &error_abort);

    visit_end_struct(data->ov, &error_abort);

    arg = qmp_output_get_qobject(data->qov);

    g_assert(qobject_type(arg) == QTYPE_QDICT);

    qdict = qobject_to_qdict(arg);

    g_assert_cmpint(qdict_size(qdict), ==, 1);

    nil = qdict_get(qdict, "a");

    g_assert(nil);

    g_assert(qobject_type(nil) == QTYPE_QNULL);

    qobject_decref(arg);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int vqf_read_seek(AVFormatContext *s,

                          int stream_index, int64_t timestamp, int flags)
+
 {

     VqfContext *c = s->priv_data;

static int vqf_read_seek(AVFormatContext *s,

                         int stream_index, int64_t timestamp, int flags)

{

    VqfContext *c = s->priv_data;

    AVStream *st;

    int ret;

    int64_t pos;

    st = s->streams[stream_index];

    pos = av_rescale_rnd(timestamp * st->codec->bit_rate,

                         st->time_base.num,

                         st->time_base.den * (int64_t)c->frame_bit_len,

                         (flags & AVSEEK_FLAG_BACKWARD) ?

                                                   AV_ROUND_DOWN : AV_ROUND_UP);

    pos *= c->frame_bit_len;

    st->cur_dts = av_rescale(pos, st->time_base.den,

                             st->codec->bit_rate * (int64_t)st->time_base.num);

    if ((ret = avio_seek(s->pb, ((pos-7) >> 3) + s->internal->data_offset, SEEK_SET)) < 0)

        return ret;

    c->remaining_bits = -7 - ((pos-7)&7);

    return 0;

}


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

     sPAPRPHBState *sphb = opaque;
+
+    GHashTableIter iter;
+
+    gpointer key, value;

     int i;
+
+
+
+    g_free(sphb->msi_devs);
+
     sphb->msi_devs = NULL;

     sphb->msi_devs_num = g_hash_table_size(sphb->msi);

static void spapr_pci_pre_save(void *opaque)

{

    sPAPRPHBState *sphb = opaque;

    GHashTableIter iter;

    gpointer key, value;

    int i;

    g_free(sphb->msi_devs);

    sphb->msi_devs = NULL;

    sphb->msi_devs_num = g_hash_table_size(sphb->msi);

    if (!sphb->msi_devs_num) {

        return;

    }

    sphb->msi_devs = g_malloc(sphb->msi_devs_num * sizeof(spapr_pci_msi_mig));

    g_hash_table_iter_init(&iter, sphb->msi);

    for (i = 0; g_hash_table_iter_next(&iter, &key, &value); ++i) {

        sphb->msi_devs[i].key = *(uint32_t *) key;

        sphb->msi_devs[i].value = *(spapr_pci_msi *) value;

    }

    if (sphb->pre_2_8_migration) {

        sphb->mig_liobn = sphb->dma_liobn[0];

        sphb->mig_mem_win_addr = sphb->mem_win_addr;

        sphb->mig_mem_win_size = sphb->mem_win_size;

        sphb->mig_io_win_addr = sphb->io_win_addr;

        sphb->mig_io_win_size = sphb->io_win_size;

        if ((sphb->mem64_win_size != 0)

            && (sphb->mem64_win_addr

                == (sphb->mem_win_addr + sphb->mem_win_size))) {

            sphb->mig_mem_win_size += sphb->mem64_win_size;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void palette8tobgr15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
+
+{
+
 	long i;

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

void palette8tobgr15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)

{

	long i;

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

		((uint16_t *)dst)[i] = bswap_16(((uint16_t *)palette)[ src[i] ]);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void vnc_flush(VncState *vs)
+
 {

     if (vs->output.offset)

void vnc_flush(VncState *vs)

{

    if (vs->output.offset)

        vnc_client_write(vs);

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
     hwaddr addr1;

     MemoryRegion *mr;
+
+
+
+    while (len > 0) {
+
         l = len;

         mr = address_space_translate(&address_space_memory,

void cpu_physical_memory_write_rom(hwaddr addr,

                                   const uint8_t *buf, int len)

{

    hwaddr l;

    uint8_t *ptr;

    hwaddr addr1;

    MemoryRegion *mr;

    while (len > 0) {

        l = len;

        mr = address_space_translate(&address_space_memory,

                                     addr, &addr1, &l, true);

        if (!(memory_region_is_ram(mr) ||

              memory_region_is_romd(mr))) {

            /* do nothing */

        } else {

            addr1 += memory_region_get_ram_addr(mr);

            /* ROM/RAM case */

            ptr = qemu_get_ram_ptr(addr1);

            memcpy(ptr, buf, l);

            invalidate_and_set_dirty(addr1, l);

        }

        len -= l;

        buf += l;

        addr += l;

    }

}


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

+{

     CompareState *s = opaque;

static void colo_old_packet_check(void *opaque)

{

    CompareState *s = opaque;

    g_queue_foreach(&s->conn_list, colo_old_packet_check_one_conn, NULL);

}


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

 {

+    ram_addr_t raddr = addr;
+
+    void *ptr = qemu_get_ram_ptr(raddr);
+
+    switch (size) {

     case 1: return ldub_p(ptr);

static uint64_t subpage_ram_read(void *opaque, target_phys_addr_t addr,

                                 unsigned size)

{

    ram_addr_t raddr = addr;

    void *ptr = qemu_get_ram_ptr(raddr);

    switch (size) {

    case 1: return ldub_p(ptr);

    case 2: return lduw_p(ptr);

    case 4: return ldl_p(ptr);

    default: abort();

    }

}


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

     }

+    opts = qemu_mallocz(sizeof(*opts));
+
+    if (id) {
+
+        opts->id = qemu_strdup(id);

     }

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

{

    QemuOpts *opts = NULL;

    if (id) {

        opts = qemu_opts_find(list, id);

        if (opts != NULL) {

            if (fail_if_exists) {

                fprintf(stderr, "tried to create id \"%s\" twice for \"%s\"\n",

                        id, list->name);

                return NULL;

            } else {

                return opts;

            }

        }

    }

    opts = qemu_mallocz(sizeof(*opts));

    if (id) {

        opts->id = qemu_strdup(id);

    }

    opts->list = list;

    TAILQ_INIT(&opts->head);

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

    return opts;

}


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

 {

+    if (data && qobject_type(data) == QTYPE_QDICT) {
+
+        return qdict_haskey(qobject_to_qdict(data), "__mon_async");

     }

static int is_async_return(const QObject *data)

{

    if (data && qobject_type(data) == QTYPE_QDICT) {

        return qdict_haskey(qobject_to_qdict(data), "__mon_async");

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int decode_dc_progressive(MJpegDecodeContext *s, int16_t *block,
+
                                  int component, int dc_index,

                                  uint16_t *quant_matrix, int Al)

static int decode_dc_progressive(MJpegDecodeContext *s, int16_t *block,

                                 int component, int dc_index,

                                 uint16_t *quant_matrix, int Al)

{

    int val;

    s->bdsp.clear_block(block);

    val = mjpeg_decode_dc(s, dc_index);

    if (val == 0xfffff) {

        av_log(s->avctx, AV_LOG_ERROR, "error dc\n");

        return AVERROR_INVALIDDATA;

    }

    val = (val * (quant_matrix[0] << Al)) + s->last_dc[component];

    s->last_dc[component] = val;

    block[0] = val;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 hwaddr uc32_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
+
+{
+
     UniCore32CPU *cpu = UNICORE32_CPU(cs);

hwaddr uc32_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)

{

    UniCore32CPU *cpu = UNICORE32_CPU(cs);

    cpu_abort(CPU(cpu), "%s not supported yet\n", __func__);

    return addr;

}


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

 {

+    Error *err = NULL;

+    Visitor *v;

     QDict *qdict;

+    AltNumStr *ans;
+
+    AltNumInt *ani;
+
+

     /*

static void test_keyval_visit_alternate(void)

{

    Error *err = NULL;

    Visitor *v;

    QDict *qdict;

    AltNumStr *ans;

    AltNumInt *ani;

    /*

     * Can't do scalar alternate variants other than string.  You get

     * the string variant if there is one, else an error.

     */

    qdict = keyval_parse("a=1,b=2", NULL, &error_abort);

    v = qobject_input_visitor_new_keyval(QOBJECT(qdict));

    QDECREF(qdict);

    visit_start_struct(v, NULL, NULL, 0, &error_abort);

    visit_type_AltNumStr(v, "a", &ans, &error_abort);

    g_assert_cmpint(ans->type, ==, QTYPE_QSTRING);

    g_assert_cmpstr(ans->u.s, ==, "1");

    qapi_free_AltNumStr(ans);

    visit_type_AltNumInt(v, "a", &ani, &err);

    error_free_or_abort(&err);

    visit_end_struct(v, NULL);

    visit_free(v);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void test_qemu_strtoul_full_max(void)

+{
+
+    char *str = g_strdup_printf("%lu", ULONG_MAX);
+
+    unsigned long res = 999;

     int err;

static void test_qemu_strtoul_full_max(void)

{

    char *str = g_strdup_printf("%lu", ULONG_MAX);

    unsigned long res = 999;

    int err;

    err = qemu_strtoul(str, NULL, 0, &res);

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, ULONG_MAX);

    g_free(str);

}


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

     /* XXX implement */
+
+#if 0
+
+    env->storage_keys[r2 / TARGET_PAGE_SIZE] &= ~SK_REFERENCED;
+
 #endif

uint32_t HELPER(rrbe)(uint32_t r1, uint64_t r2)

{

    if (r2 > ram_size) {

        return 0;

    }

    /* XXX implement */

#if 0

    env->storage_keys[r2 / TARGET_PAGE_SIZE] &= ~SK_REFERENCED;

#endif

    /*

     * cc

     *

     * 0  Reference bit zero; change bit zero

     * 1  Reference bit zero; change bit one

     * 2  Reference bit one; change bit zero

     * 3  Reference bit one; change bit one

     */

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void pred8x8_dc_rv40_c(uint8_t *src, int stride){

+    int i;

     int dc0=0;


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

+    width = st->codec->width;

     height = st->codec->height;

static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)

{

    int packet_size, ret, width, height;

    AVStream *st = s->streams[0];

    width = st->codec->width;

    height = st->codec->height;

    packet_size = avpicture_get_size(st->codec->pix_fmt, width, height);

    if (packet_size < 0)

        return -1;

    ret= av_get_packet(s->pb, pkt, packet_size);

    pkt->pts=

    pkt->dts= pkt->pos / packet_size;

    pkt->stream_index = 0;

    if (ret != packet_size)

        return AVERROR(EIO);

    return 0;

}


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

     d.args = NULL;
+
     d.noreboot = true;

+    test_init(&d);
+

     stop_tco(&d);

static void test_tco2_status_bits(void)

{

    TestData d;

    uint16_t ticks = 8;

    uint16_t val;

    int ret;

    d.args = NULL;

    d.noreboot = true;

    test_init(&d);

    stop_tco(&d);

    clear_tco_status(&d);

    reset_on_second_timeout(true);

    set_tco_timeout(&d, ticks);

    load_tco(&d);

    start_tco(&d);

    clock_step(ticks * TCO_TICK_NSEC * 2);

    val = qpci_io_readw(d.dev, d.tco_io_base + TCO2_STS);

    ret = val & (TCO_SECOND_TO_STS | TCO_BOOT_STS) ? 1 : 0;

    g_assert(ret == 1);

    qpci_io_writew(d.dev, d.tco_io_base + TCO2_STS, val);

    g_assert_cmpint(qpci_io_readw(d.dev, d.tco_io_base + TCO2_STS), ==, 0);

    qtest_end();

}


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

 	unsigned i;

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

{

	unsigned i;

	unsigned num_pixels = src_size >> 1;

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

	{

	    unsigned b,g,r;

	    register uint16_t rgb;

	    rgb = src[2*i];

	    r = rgb&0x1F;

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

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

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

	}

}


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

     RTCState *s = opaque;
+
+
+
     qemu_put_be32(f, s->irq_coalesced);

     qemu_put_be32(f, s->period);

static void rtc_save_td(QEMUFile *f, void *opaque)

{

    RTCState *s = opaque;

    qemu_put_be32(f, s->irq_coalesced);

    qemu_put_be32(f, s->period);

}


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

 {

+    struct list_element *new_el;
+
+    int i;
+
+    nthreadsrunning = 0;

     srand(time(0));

static void rcu_qtest_init(void)

{

    struct list_element *new_el;

    int i;

    nthreadsrunning = 0;

    srand(time(0));

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

        new_el = g_new(struct list_element, 1);

        new_el->val = i;

        QLIST_INSERT_HEAD_RCU(&Q_list_head, new_el, entry);

    }

    atomic_add(&n_nodes, RCU_Q_LEN);

}


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

     } else {

+        qdev_prop_allow_set_link_before_realize(obj, name, val, &local_err);
+
+    }
+
+

     error_propagate(errp, local_err);

static void pc_dimm_check_memdev_is_busy(const Object *obj, const char *name,

                                      Object *val, Error **errp)

{

    Error *local_err = NULL;

    if (host_memory_backend_is_mapped(MEMORY_BACKEND(val))) {

        char *path = object_get_canonical_path_component(val);

        error_setg(&local_err, "can't use already busy memdev: %s", path);

        g_free(path);

    } else {

        qdev_prop_allow_set_link_before_realize(obj, name, val, &local_err);

    }

    error_propagate(errp, local_err);

}


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

                                       long lumStride, long chromStride, long srcStride)

+{
+
+    long y;
+
+    const long chromWidth= -((-width)>>1);

static void RENAME(yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,

                                      long width, long height,

                                      long lumStride, long chromStride, long srcStride)

{

    long y;

    const long chromWidth= -((-width)>>1);

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

        RENAME(extract_even)(src, ydst, width);

        RENAME(extract_odd2)(src, udst, vdst, chromWidth);

        src += srcStride;

        ydst+= lumStride;

        udst+= chromStride;

        vdst+= chromStride;

    }

#if COMPILE_TEMPLATE_MMX

    __asm__(

            EMMS"       \n\t"

            SFENCE"     \n\t"

            ::: "memory"

        );

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void object_property_set_qobject(Object *obj, QObject *value,

+                                 const char *name, Error **errp)

 {

void object_property_set_qobject(Object *obj, QObject *value,

                                 const char *name, Error **errp)

{

    Visitor *v;

    /* TODO: Should we reject, rather than ignore, excess input? */

    v = qobject_input_visitor_new(value, false);

    object_property_set(obj, v, name, errp);

    visit_free(v);

}


--- a/source.c
+++ b/source.c
@@ -3,8 +3,8 @@
                                           uint32_t fid, uint64_t faddr,

                                           uint32_t e)
+
+{

     s390_pci_generate_event(1, pec, fh, fid, faddr, e);

static void s390_pci_generate_error_event(uint16_t pec, uint32_t fh,

                                          uint32_t fid, uint64_t faddr,

                                          uint32_t e)

{

    s390_pci_generate_event(1, pec, fh, fid, faddr, e);

}


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

     uint32_t pciaddr;

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

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

static void bonito_spciconf_writew(void *opaque, target_phys_addr_t addr,

                                   uint32_t val)

{

    PCIBonitoState *s = opaque;

    PCIDevice *d = PCI_DEVICE(s);

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

    uint32_t pciaddr;

    uint16_t status;

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

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

    pciaddr = bonito_sbridge_pciaddr(s, addr);

    if (pciaddr == 0xffffffff) {

        return;

    }

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

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

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

    /* clear PCI_STATUS_REC_MASTER_ABORT and PCI_STATUS_REC_TARGET_ABORT */

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

    status &= ~(PCI_STATUS_REC_MASTER_ABORT | PCI_STATUS_REC_TARGET_ABORT);

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

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static inline int mjpeg_decode_dc(MJpegDecodeContext *s, int dc_index)

 {
+
     int code;

     code = get_vlc2(&s->gb, s->vlcs[0][dc_index].table, 9, 2);

static inline int mjpeg_decode_dc(MJpegDecodeContext *s, int dc_index)

{

    int code;

    code = get_vlc2(&s->gb, s->vlcs[0][dc_index].table, 9, 2);

    if (code < 0) {

        av_log(s->avctx, AV_LOG_WARNING,

               "mjpeg_decode_dc: bad vlc: %d:%d (%p)\n",

               0, dc_index, &s->vlcs[0][dc_index]);

        return 0xffff;

    }

    if (code)

        return get_xbits(&s->gb, code);

    else

        return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+int cache_insert(PageCache *cache, uint64_t addr, uint8_t *pdata)

 {

int cache_insert(PageCache *cache, uint64_t addr, uint8_t *pdata)

{

    CacheItem *it = NULL;

    g_assert(cache);

    g_assert(cache->page_cache);

    /* actual update of entry */

    it = cache_get_by_addr(cache, addr);

    /* allocate page */

    if (!it->it_data) {

        it->it_data = g_try_malloc(cache->page_size);

        if (!it->it_data) {

            DPRINTF("Error allocating page\n");

            return -1;

        }

        cache->num_items++;

    }

    memcpy(it->it_data, pdata, cache->page_size);

    it->it_age = ++cache->max_item_age;

    it->it_addr = addr;

    return 0;

}


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

 {

+    int jumpLabel;
+
+    jumpLabel = gen_new_label();
+
+    tcg_gen_brcond_tl(cond, r1, r2, jumpLabel);

static inline void gen_branch_cond(DisasContext *ctx, TCGCond cond, TCGv r1,

                                   TCGv r2, int16_t address)

{

    int jumpLabel;

    jumpLabel = gen_new_label();

    tcg_gen_brcond_tl(cond, r1, r2, jumpLabel);

    gen_goto_tb(ctx, 1, ctx->next_pc);

    gen_set_label(jumpLabel);

    gen_goto_tb(ctx, 0, ctx->pc + address * 2);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 void sclp_print(const char *str)

+{
+
+    int len = _strlen(str);
+
+    WriteEventData *sccb = (void*)_sccb;

void sclp_print(const char *str)

{

    int len = _strlen(str);

    WriteEventData *sccb = (void*)_sccb;

    sccb->h.length = sizeof(WriteEventData) + len;

    sccb->h.function_code = SCLP_FC_NORMAL_WRITE;

    sccb->ebh.length = sizeof(EventBufferHeader) + len;

    sccb->ebh.type = SCLP_EVENT_ASCII_CONSOLE_DATA;

    sccb->ebh.flags = 0;

    _memcpy(sccb->data, str, len);

    sclp_service_call(SCLP_CMD_WRITE_EVENT_DATA, sccb);

}


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

 {

+    struct vhost_dev *dev = container_of(listener, struct vhost_dev,
+
+                                         iommu_listener);
+
+    struct vhost_iommu *iommu;

static void vhost_iommu_region_add(MemoryListener *listener,

                                   MemoryRegionSection *section)

{

    struct vhost_dev *dev = container_of(listener, struct vhost_dev,

                                         iommu_listener);

    struct vhost_iommu *iommu;

    if (!memory_region_is_iommu(section->mr)) {

        return;

    }

    iommu = g_malloc0(sizeof(*iommu));

    iommu->n.notify = vhost_iommu_unmap_notify;

    iommu->n.notifier_flags = IOMMU_NOTIFIER_UNMAP;

    iommu->mr = section->mr;

    iommu->iommu_offset = section->offset_within_address_space -

                          section->offset_within_region;

    iommu->hdev = dev;

    memory_region_register_iommu_notifier(section->mr, &iommu->n);

    QLIST_INSERT_HEAD(&dev->iommu_list, iommu, iommu_next);

    /* TODO: can replay help performance here? */

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     int32_t fid, err = 0;
     V9fsPDU *pdu = opaque;
     V9fsState *s = pdu->s;
+    glock = g_malloc(sizeof(*glock));
+    pdu_unmarshal(pdu, offset, "dbqqds", &fid, &glock->type,
+                  &glock->start, &glock->length, &glock->proc_id,
+                  &glock->client_id);
+    trace_v9fs_getlock(pdu->tag, pdu->id, fid,
                        glock->type, glock->start, glock->length);
     fidp = get_fid(pdu, fid);
     if (fidp == NULL) {

static void v9fs_getlock(void *opaque)
{
    size_t offset = 7;
    struct stat stbuf;
    V9fsFidState *fidp;
    V9fsGetlock *glock;
    int32_t fid, err = 0;
    V9fsPDU *pdu = opaque;
    V9fsState *s = pdu->s;
    glock = g_malloc(sizeof(*glock));
    pdu_unmarshal(pdu, offset, "dbqqds", &fid, &glock->type,
                  &glock->start, &glock->length, &glock->proc_id,
                  &glock->client_id);
    trace_v9fs_getlock(pdu->tag, pdu->id, fid,
                       glock->type, glock->start, glock->length);
    fidp = get_fid(pdu, fid);
    if (fidp == NULL) {
        err = -ENOENT;
        goto out_nofid;
    }
    err = v9fs_co_fstat(pdu, fidp->fs.fd, &stbuf);
    if (err < 0) {
        goto out;
    }
    glock->type = P9_LOCK_TYPE_UNLCK;
    offset += pdu_marshal(pdu, offset, "bqqds", glock->type,
                          glock->start, glock->length, glock->proc_id,
                          &glock->client_id);
    err = offset;
out:
    put_fid(pdu, fidp);
out_nofid:
    complete_pdu(s, pdu, err);
    v9fs_string_free(&glock->client_id);
    g_free(glock);
}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static inline void neon_load_reg64(TCGv var, int reg)

+{

     tcg_gen_ld_i64(var, cpu_env, vfp_reg_offset(1, reg));

static inline void neon_load_reg64(TCGv var, int reg)

{

    tcg_gen_ld_i64(var, cpu_env, vfp_reg_offset(1, reg));

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
         av_dict_set(options, "method", c->method, 0);

     } else if (proto && http_base_proto) {
+
+        av_log(c, AV_LOG_WARNING, "No HTTP method set, hls muxer defaulting to method PUT.\n");
+
+        av_dict_set(options, "method", "PUT", 0);
+
     }

 }

static void set_http_options(AVFormatContext *s, AVDictionary **options, HLSContext *c)

{

    const char *proto = avio_find_protocol_name(s->filename);

    int http_base_proto = !av_strcasecmp(proto, "http") || !av_strcasecmp(proto, "https");

    if (c->method) {

        av_dict_set(options, "method", c->method, 0);

    } else if (proto && http_base_proto) {

        av_log(c, AV_LOG_WARNING, "No HTTP method set, hls muxer defaulting to method PUT.\n");

        av_dict_set(options, "method", "PUT", 0);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 int qemu_devtree_nop_node(void *fdt, const char *node_path)
+
+{
+
+    int offset;

int qemu_devtree_nop_node(void *fdt, const char *node_path)

{

    int offset;

    offset = fdt_path_offset(fdt, node_path);

    if (offset < 0)

        return offset;

    return fdt_nop_node(fdt, offset);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int nbd_can_accept(void *opaque)

 {

static int nbd_can_accept(void *opaque)

{

    return nb_fds < shared;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+float64 uint64_to_float64( uint64 a STATUS_PARAM )
+
 {

     if ( a == 0 ) return 0;

float64 uint64_to_float64( uint64 a STATUS_PARAM )

{

    if ( a == 0 ) return 0;

    return normalizeRoundAndPackFloat64( 0, 0x43C, a STATUS_VAR );

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int parse_fade(struct sbg_parser *p, struct sbg_fade *fr)
+
 {

     struct sbg_fade f;

static int parse_fade(struct sbg_parser *p, struct sbg_fade *fr)

{

    struct sbg_fade f;

    if (lex_char(p, '<'))

        f.in = SBG_FADE_SILENCE;

    else if (lex_char(p, '-'))

        f.in = SBG_FADE_SAME;

    else if (lex_char(p, '='))

        f.in = SBG_FADE_ADAPT;

    else

        return 0;

    if (lex_char(p, '>'))

        f.out = SBG_FADE_SILENCE;

    else if (lex_char(p, '-'))

        f.out = SBG_FADE_SAME;

    else if (lex_char(p, '='))

        f.out = SBG_FADE_ADAPT;

    else

        return AVERROR_INVALIDDATA;

    *fr = f;

    return 1;

}


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

         }

+        offset += NBD_MAX_SECTORS * 512;
+
+        sector_num += NBD_MAX_SECTORS;
+
+        nb_sectors -= NBD_MAX_SECTORS;

     }

int nbd_client_session_co_readv(NbdClientSession *client, int64_t sector_num,

    int nb_sectors, QEMUIOVector *qiov)

{

    int offset = 0;

    int ret;

    while (nb_sectors > NBD_MAX_SECTORS) {

        ret = nbd_co_readv_1(client, sector_num,

                             NBD_MAX_SECTORS, qiov, offset);

        if (ret < 0) {

            return ret;

        }

        offset += NBD_MAX_SECTORS * 512;

        sector_num += NBD_MAX_SECTORS;

        nb_sectors -= NBD_MAX_SECTORS;

    }

    return nbd_co_readv_1(client, sector_num, nb_sectors, qiov, offset);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void d3d11va_device_uninit(AVHWDeviceContext *hwdev)

+{
+
+    AVD3D11VADeviceContext *device_hwctx = hwdev->hwctx;
+
+

     if (device_hwctx->device)

static void d3d11va_device_uninit(AVHWDeviceContext *hwdev)

{

    AVD3D11VADeviceContext *device_hwctx = hwdev->hwctx;

    if (device_hwctx->device)

        ID3D11Device_Release(device_hwctx->device);

    if (device_hwctx->device_context)

        ID3D11DeviceContext_Release(device_hwctx->device_context);

    if (device_hwctx->video_device)

        ID3D11VideoDevice_Release(device_hwctx->video_device);

    if (device_hwctx->video_context)

        ID3D11VideoContext_Release(device_hwctx->video_context);

    if (device_hwctx->lock == d3d11va_default_lock)

        CloseHandle(device_hwctx->lock_ctx);

}


--- a/source.c
+++ b/source.c
@@ -13,7 +13,7 @@
         /* Other bus types might support multiple devices at slots 0-31 */

         return pci_dev->bus->devices[PCI_DEVFN(PCI_SLOT(pci_dev->devfn), 0)];
+
+    }
+
+}

PCIDevice *pci_get_function_0(PCIDevice *pci_dev)

{

    if(pcie_has_upstream_port(pci_dev)) {

        /* With an upstream PCIe port, we only support 1 device at slot 0 */

        return pci_dev->bus->devices[0];

    } else {

        /* Other bus types might support multiple devices at slots 0-31 */

        return pci_dev->bus->devices[PCI_DEVFN(PCI_SLOT(pci_dev->devfn), 0)];

    }

}


--- a/source.c
+++ b/source.c
@@ -35,11 +35,11 @@
     timeout_source = g_timeout_source_new(REGULAR_PACKET_CHECK_MS);

     g_source_set_callback(timeout_source,
+
+                          (GSourceFunc)check_old_packet_regular, s, NULL);
+
+    g_source_attach(timeout_source, s->worker_context);
+

     g_main_loop_run(s->compare_loop);

static void *colo_compare_thread(void *opaque)

{

    CompareState *s = opaque;

    GSource *timeout_source;

    s->worker_context = g_main_context_new();

    qemu_chr_fe_set_handlers(&s->chr_pri_in, compare_chr_can_read,

                             compare_pri_chr_in, NULL, NULL,

                             s, s->worker_context, true);

    qemu_chr_fe_set_handlers(&s->chr_sec_in, compare_chr_can_read,

                             compare_sec_chr_in, NULL, NULL,

                             s, s->worker_context, true);

    s->compare_loop = g_main_loop_new(s->worker_context, FALSE);

    /* To kick any packets that the secondary doesn't match */

    timeout_source = g_timeout_source_new(REGULAR_PACKET_CHECK_MS);

    g_source_set_callback(timeout_source,

                          (GSourceFunc)check_old_packet_regular, s, NULL);

    g_source_attach(timeout_source, s->worker_context);

    g_main_loop_run(s->compare_loop);

    g_source_unref(timeout_source);

    g_main_loop_unref(s->compare_loop);

    g_main_context_unref(s->worker_context);

    return NULL;

}


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

     info->qdev.init = i2c_slave_qdev_init;

+    info->qdev.bus_type = BUS_TYPE_I2C;
+
+    qdev_register(&info->qdev);

 }

void i2c_register_slave(I2CSlaveInfo *info)

{

    assert(info->qdev.size >= sizeof(i2c_slave));

    info->qdev.init = i2c_slave_qdev_init;

    info->qdev.bus_type = BUS_TYPE_I2C;

    qdev_register(&info->qdev);

}


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

     term_cmd_buf_index = term_cmd_buf_size;
+
 }

static void term_eol(void)

{

    term_cmd_buf_index = term_cmd_buf_size;

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+static void v7m_exception_taken(ARMCPU *cpu, uint32_t lr)

 {
+
     /* Do the "take the exception" parts of exception entry,

      * but not the pushing of state to the stack. This is

+     * similar to the pseudocode ExceptionTaken() function.

      */

static void v7m_exception_taken(ARMCPU *cpu, uint32_t lr)

{

    /* Do the "take the exception" parts of exception entry,

     * but not the pushing of state to the stack. This is

     * similar to the pseudocode ExceptionTaken() function.

     */

    CPUARMState *env = &cpu->env;

    uint32_t addr;

    armv7m_nvic_acknowledge_irq(env->nvic);

    write_v7m_control_spsel(env, 0);

    arm_clear_exclusive(env);

    /* Clear IT bits */

    env->condexec_bits = 0;

    env->regs[14] = lr;

    addr = arm_v7m_load_vector(cpu);

    env->regs[15] = addr & 0xfffffffe;

    env->thumb = addr & 1;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void gen_check_sr(DisasContext *dc, uint32_t sr)

 {

static void gen_check_sr(DisasContext *dc, uint32_t sr)

{

    if (!xtensa_option_bits_enabled(dc->config, sregnames[sr].opt_bits)) {

        if (sregnames[sr].name) {

            qemu_log("SR %s is not configured\n", sregnames[sr].name);

        } else {

            qemu_log("SR %d is not implemented\n", sr);

        }

        gen_exception_cause(dc, ILLEGAL_INSTRUCTION_CAUSE);

    }

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
         memcpy(h->oem_id, ACPI_BUILD_APPNAME6, 6);

     }
+
+
+
+    if (oem_table_id) {
+
         strncpy((char *)h->oem_table_id, oem_table_id, sizeof(h->oem_table_id));

     } else {

build_header(GArray *linker, GArray *table_data,

             AcpiTableHeader *h, const char *sig, int len, uint8_t rev,

             const char *oem_id, const char *oem_table_id)

{

    memcpy(&h->signature, sig, 4);

    h->length = cpu_to_le32(len);

    h->revision = rev;

    if (oem_id) {

        strncpy((char *)h->oem_id, oem_id, sizeof h->oem_id);

    } else {

        memcpy(h->oem_id, ACPI_BUILD_APPNAME6, 6);

    }

    if (oem_table_id) {

        strncpy((char *)h->oem_table_id, oem_table_id, sizeof(h->oem_table_id));

    } else {

        memcpy(h->oem_table_id, ACPI_BUILD_APPNAME4, 4);

        memcpy(h->oem_table_id + 4, sig, 4);

    }

    h->oem_revision = cpu_to_le32(1);

    memcpy(h->asl_compiler_id, ACPI_BUILD_APPNAME4, 4);

    h->asl_compiler_revision = cpu_to_le32(1);

    h->checksum = 0;

    /* Checksum to be filled in by Guest linker */

    bios_linker_loader_add_checksum(linker, ACPI_BUILD_TABLE_FILE,

                                    table_data, h, len, &h->checksum);

}


--- a/source.c
+++ b/source.c
@@ -13,9 +13,9 @@
         memory_region_del_subregion(&pci_dev->bus_master_container_region,

                                     &pci_dev->bus_master_enable_region);
+
+    }
+
+    address_space_destroy(&pci_dev->bus_master_as);
+
 }

static void do_pci_unregister_device(PCIDevice *pci_dev)

{

    pci_dev->bus->devices[pci_dev->devfn] = NULL;

    pci_config_free(pci_dev);

    if (memory_region_is_mapped(&pci_dev->bus_master_enable_region)) {

        memory_region_del_subregion(&pci_dev->bus_master_container_region,

                                    &pci_dev->bus_master_enable_region);

    }

    address_space_destroy(&pci_dev->bus_master_as);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static av_noinline void emulated_edge_mc_sse(uint8_t *buf, ptrdiff_t buf_stride,
+
                                              const uint8_t *src, ptrdiff_t src_stride,

                                              int block_w, int block_h,

static av_noinline void emulated_edge_mc_sse(uint8_t *buf, ptrdiff_t buf_stride,

                                             const uint8_t *src, ptrdiff_t src_stride,

                                             int block_w, int block_h,

                                             int src_x, int src_y, int w, int h)

{

    emulated_edge_mc(buf, buf_stride, src, src_stride, block_w, block_h, src_x,

                     src_y, w, h, vfixtbl_sse, &ff_emu_edge_vvar_sse, hfixtbl_sse,

#if ARCH_X86_64

                     &ff_emu_edge_hvar_sse

#else

                     &ff_emu_edge_hvar_mmx

#endif

                     );

}


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

+{
+
+    VncState *vs = (VncState *)opaque;

+    if (!vs->tls.session) {

         VNC_DEBUG("TLS Websocket setup\n");

void vncws_tls_handshake_io(void *opaque)

{

    VncState *vs = (VncState *)opaque;

    if (!vs->tls.session) {

        VNC_DEBUG("TLS Websocket setup\n");

        if (vnc_tls_client_setup(vs, vs->vd->tls.x509cert != NULL) < 0) {

            return;

        }

    }

    VNC_DEBUG("Handshake IO continue\n");

    vncws_start_tls_handshake(vs);

}


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

         syms[i]  = he[i].sym;

+        code += 0x80000000u >> (he[i].len - 1);
+
+    }
+
+

     return init_vlc_sparse(vlc, FFMIN(he[last].len, 9), last + 1,

static int build_huff(const uint8_t *src, VLC *vlc)

{

    int i;

    HuffEntry he[256];

    int last;

    uint32_t codes[256];

    uint8_t bits[256];

    uint8_t syms[256];

    uint32_t code;

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

        he[i].sym = i;

        he[i].len = *src++;

    }

    qsort(he, 256, sizeof(*he), huff_cmp);

    if (!he[0].len || he[0].len > 32)

        return -1;

    last = 255;

    while (he[last].len == 255 && last)

        last--;

    code = 1;

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

        codes[i] = code >> (32 - he[i].len);

        bits[i]  = he[i].len;

        syms[i]  = he[i].sym;

        code += 0x80000000u >> (he[i].len - 1);

    }

    return init_vlc_sparse(vlc, FFMIN(he[last].len, 9), last + 1,

                           bits,  sizeof(*bits),  sizeof(*bits),

                           codes, sizeof(*codes), sizeof(*codes),

                           syms,  sizeof(*syms),  sizeof(*syms), 0);

}


--- a/source.c
+++ b/source.c
@@ -1,28 +1,28 @@
 static void encode_signal_range(VC2EncContext *s)
+
+{
+
+    int idx;
+
+    AVCodecContext *avctx = s->avctx;
+
+    const AVPixFmtDescriptor *fmt = av_pix_fmt_desc_get(avctx->pix_fmt);
+
+    const int depth = fmt->comp[0].depth;
+
     if (depth == 8 && avctx->color_range == AVCOL_RANGE_JPEG) {

+        idx = 1;
+
+        s->bpp = 1;
+
         s->diff_offset = 128;
+
     } else if (depth == 8 && (avctx->color_range == AVCOL_RANGE_MPEG ||
+
                avctx->color_range == AVCOL_RANGE_UNSPECIFIED)) {

+        idx = 2;

         s->bpp = 1;

static void encode_signal_range(VC2EncContext *s)

{

    int idx;

    AVCodecContext *avctx = s->avctx;

    const AVPixFmtDescriptor *fmt = av_pix_fmt_desc_get(avctx->pix_fmt);

    const int depth = fmt->comp[0].depth;

    if (depth == 8 && avctx->color_range == AVCOL_RANGE_JPEG) {

        idx = 1;

        s->bpp = 1;

        s->diff_offset = 128;

    } else if (depth == 8 && (avctx->color_range == AVCOL_RANGE_MPEG ||

               avctx->color_range == AVCOL_RANGE_UNSPECIFIED)) {

        idx = 2;

        s->bpp = 1;

        s->diff_offset = 128;

    } else if (depth == 10) {

        idx = 3;

        s->bpp = 2;

        s->diff_offset = 512;

    } else {

        idx = 4;

        s->bpp = 2;

        s->diff_offset = 2048;

    }

    put_bits(&s->pb, 1, !s->strict_compliance);

    if (!s->strict_compliance)

        put_vc2_ue_uint(&s->pb, idx);

}


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

     unsigned int den, q, r;

void helper_divl_EAX_T0(void)

{

    unsigned int den, q, r;

    uint64_t num;

    num = ((uint32_t)EAX) | ((uint64_t)((uint32_t)EDX) << 32);

    den = T0;

    if (den == 0) {

        raise_exception(EXCP00_DIVZ);

    }

#ifdef BUGGY_GCC_DIV64

    r = div32(&q, num, den);

#else

    q = (num / den);

    r = (num % den);

#endif

    EAX = (uint32_t)q;

    EDX = (uint32_t)r;

}


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

+    if (have_armv6(cpu_flags))
+
+        ff_vp8dsp_init_armv6(dsp);
+
     if (have_neon(cpu_flags))

         ff_vp8dsp_init_neon(dsp);

av_cold void ff_vp8dsp_init_arm(VP8DSPContext *dsp)

{

    int cpu_flags = av_get_cpu_flags();

    if (have_armv6(cpu_flags))

        ff_vp8dsp_init_armv6(dsp);

    if (have_neon(cpu_flags))

        ff_vp8dsp_init_neon(dsp);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static inline void array_free(array_t* array)
+
 {

     if(array->pointer)

static inline void array_free(array_t* array)

{

    if(array->pointer)

        free(array->pointer);

    array->size=array->next=0;

}


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

     sample *samples = (sample *) OUT(out);

+    int i, j;
+
+
+
     for (j = 0; j < len; j++)

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

static void FUNC(flac_decorrelate_indep_c)(uint8_t **out, int32_t **in,

                                           int channels, int len, int shift)

{

    sample *samples = (sample *) OUT(out);

    int i, j;

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

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

            S(samples, i, j) = in[i][j] << shift;

}


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

     BlkMigDevState *bmds;
+
+
+
+    QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {

         aio_context_acquire(blk_get_aio_context(bmds->blk));

static void unset_dirty_tracking(void)

{

    BlkMigDevState *bmds;

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

        aio_context_acquire(blk_get_aio_context(bmds->blk));

        bdrv_release_dirty_bitmap(blk_bs(bmds->blk), bmds->dirty_bitmap);

        aio_context_release(blk_get_aio_context(bmds->blk));

    }

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
     if (bdrv_enable_write_cache(s->bs))

         features |= (1 << VIRTIO_BLK_F_WCE);
+
+
+
+    if (bdrv_is_read_only(s->bs))
+
         features |= 1 << VIRTIO_BLK_F_RO;

static uint32_t virtio_blk_get_features(VirtIODevice *vdev, uint32_t features)

{

    VirtIOBlock *s = to_virtio_blk(vdev);

    features |= (1 << VIRTIO_BLK_F_SEG_MAX);

    features |= (1 << VIRTIO_BLK_F_GEOMETRY);

    features |= (1 << VIRTIO_BLK_F_TOPOLOGY);

    features |= (1 << VIRTIO_BLK_F_BLK_SIZE);

    features |= (1 << VIRTIO_BLK_F_SCSI);

    features |= (1 << VIRTIO_BLK_F_CONFIG_WCE);

    if (bdrv_enable_write_cache(s->bs))

        features |= (1 << VIRTIO_BLK_F_WCE);

    if (bdrv_is_read_only(s->bs))

        features |= 1 << VIRTIO_BLK_F_RO;

    return features;

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     memory_region_init(mr, name, size);

     mr->ram = true;
+
+    mr->terminates = true;
+
+    mr->destructor = memory_region_destructor_ram;
+
     mr->ram_addr = qemu_ram_alloc(size, mr);

     mr->backend_registered = true;

void memory_region_init_ram(MemoryRegion *mr,

                            const char *name,

                            uint64_t size)

{

    memory_region_init(mr, name, size);

    mr->ram = true;

    mr->terminates = true;

    mr->destructor = memory_region_destructor_ram;

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

    mr->backend_registered = true;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc)

 {
+
+    inc_tb = av_mul_q(inc_tb, (AVRational) {inc, 1});
+
+
+
     if (av_cmp_q(inc_tb, ts_tb) < 0) {

         //increase step is too small for even 1 step to be representable

int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc)

{

    inc_tb = av_mul_q(inc_tb, (AVRational) {inc, 1});

    if (av_cmp_q(inc_tb, ts_tb) < 0) {

        //increase step is too small for even 1 step to be representable

        return ts;

    } else {

        int64_t old = av_rescale_q(ts, ts_tb, inc_tb);

        int64_t old_ts = av_rescale_q(old, inc_tb, ts_tb);

        return av_rescale_q(old + 1, inc_tb, ts_tb) + (ts - old_ts);

    }

}


--- a/source.c
+++ b/source.c
@@ -27,11 +27,11 @@
     memory_region_init_io(&s->iomem, &omap_os_timer_ops, s,

                           "omap-os-timer", 0x800);
+
+    memory_region_add_subregion(memory, base, &s->iomem);
+
+
+
     return s;

 }

static struct omap_32khz_timer_s *omap_os_timer_init(MemoryRegion *memory,

                target_phys_addr_t base,

                qemu_irq irq, omap_clk clk)

{

    struct omap_32khz_timer_s *s = (struct omap_32khz_timer_s *)

            g_malloc0(sizeof(struct omap_32khz_timer_s));

    s->timer.irq = irq;

    s->timer.clk = clk;

    s->timer.timer = qemu_new_timer_ns(vm_clock, omap_timer_tick, &s->timer);

    omap_os_timer_reset(s);

    omap_timer_clk_setup(&s->timer);

    memory_region_init_io(&s->iomem, &omap_os_timer_ops, s,

                          "omap-os-timer", 0x800);

    memory_region_add_subregion(memory, base, &s->iomem);

    return s;

}


static void lcd_refresh(void *opaque)

{

    musicpal_lcd_state *s = opaque;

    int x, y;

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

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

            if (s->video_ram[x + (y/8)*128] & (1 << (y % 8)))

                set_lcd_pixel(s, x, y, MP_LCD_TEXTCOLOR);

            else

                set_lcd_pixel(s, x, y, 0);

    dpy_update(s->ds, 0, 0, 128*3, 64*3);

}


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

     } else {

+        create_flags = OPEN_EXISTING;
+
+    }
+
+#ifdef QEMU_TOOL

     overlapped = FILE_ATTRIBUTE_NORMAL;

static int raw_open(BlockDriverState *bs, const char *filename, int flags)

{

    BDRVRawState *s = bs->opaque;

    int access_flags, create_flags;

    DWORD overlapped;

    s->type = FTYPE_FILE;

    if ((flags & BDRV_O_ACCESS) == O_RDWR) {

        access_flags = GENERIC_READ | GENERIC_WRITE;

    } else {

        access_flags = GENERIC_READ;

    }

    if (flags & BDRV_O_CREAT) {

        create_flags = CREATE_ALWAYS;

    } else {

        create_flags = OPEN_EXISTING;

    }

#ifdef QEMU_TOOL

    overlapped = FILE_ATTRIBUTE_NORMAL;

#else

    overlapped = FILE_FLAG_OVERLAPPED;

#endif

    s->hfile = CreateFile(filename, access_flags,

                          FILE_SHARE_READ, NULL,

                          create_flags, overlapped, NULL);

    if (s->hfile == INVALID_HANDLE_VALUE)

        return -1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 int gdbserver_start(int port)

+{
+
+    gdbserver_fd = gdbserver_open(port);
+
     if (gdbserver_fd < 0)

         return -1;

int gdbserver_start(int port)

{

    gdbserver_fd = gdbserver_open(port);

    if (gdbserver_fd < 0)

        return -1;

    /* accept connections */

    gdb_accept (NULL);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 int qemu_chr_fe_write_all(CharDriverState *s, const uint8_t *buf, int len)

+{

     int offset = 0;

int qemu_chr_fe_write_all(CharDriverState *s, const uint8_t *buf, int len)

{

    int offset = 0;

    int res;

    qemu_mutex_lock(&s->chr_write_lock);

    while (offset < len) {

        do {

            res = s->chr_write(s, buf + offset, len - offset);

            if (res == -1 && errno == EAGAIN) {

                g_usleep(100);

            }

        } while (res == -1 && errno == EAGAIN);

        if (res <= 0) {

            break;

        }

        offset += res;

    }

    qemu_mutex_unlock(&s->chr_write_lock);

    if (res < 0) {

        return res;

    }

    return offset;

}


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

+{

     RET_INVAL(ctx);

static inline void gen_speundef (DisasContext *ctx)

{

    RET_INVAL(ctx);

}


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

     uint64_t offset = sector_num * BDRV_SECTOR_SIZE;

+    unsigned long start = offset / object_size,
+
+                  end = DIV_ROUND_UP((sector_num + nb_sectors) *
+
+                                     BDRV_SECTOR_SIZE, object_size);

     unsigned long idx;

sd_co_get_block_status(BlockDriverState *bs, int64_t sector_num, int nb_sectors,

                       int *pnum)

{

    BDRVSheepdogState *s = bs->opaque;

    SheepdogInode *inode = &s->inode;

    uint32_t object_size = (UINT32_C(1) << inode->block_size_shift);

    uint64_t offset = sector_num * BDRV_SECTOR_SIZE;

    unsigned long start = offset / object_size,

                  end = DIV_ROUND_UP((sector_num + nb_sectors) *

                                     BDRV_SECTOR_SIZE, object_size);

    unsigned long idx;

    int64_t ret = BDRV_BLOCK_DATA | BDRV_BLOCK_OFFSET_VALID | offset;

    for (idx = start; idx < end; idx++) {

        if (inode->data_vdi_id[idx] == 0) {

            break;

        }

    }

    if (idx == start) {

        /* Get the longest length of unallocated sectors */

        ret = 0;

        for (idx = start + 1; idx < end; idx++) {

            if (inode->data_vdi_id[idx] != 0) {

                break;

            }

        }

    }

    *pnum = (idx - start) * object_size / BDRV_SECTOR_SIZE;

    if (*pnum > nb_sectors) {

        *pnum = nb_sectors;

    }

    return ret;

}


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

                              uint64_t val, unsigned size)

+{
+
+    IVShmemState *s = opaque;
+
+

     uint16_t dest = val >> 16;

static void ivshmem_io_write(void *opaque, target_phys_addr_t addr,

                             uint64_t val, unsigned size)

{

    IVShmemState *s = opaque;

    uint16_t dest = val >> 16;

    uint16_t vector = val & 0xff;

    addr &= 0xfc;

    IVSHMEM_DPRINTF("writing to addr " TARGET_FMT_plx "\n", addr);

    switch (addr)

    {

        case INTRMASK:

            ivshmem_IntrMask_write(s, val);

            break;

        case INTRSTATUS:

            ivshmem_IntrStatus_write(s, val);

            break;

        case DOORBELL:

            /* check that dest VM ID is reasonable */

            if (dest > s->max_peer) {

                IVSHMEM_DPRINTF("Invalid destination VM ID (%d)\n", dest);

                break;

            }

            /* check doorbell range */

            if (vector < s->peers[dest].nb_eventfds) {

                IVSHMEM_DPRINTF("Notifying VM %d on vector %d\n", dest, vector);

                event_notifier_set(&s->peers[dest].eventfds[vector]);

            }

            break;

        default:

            IVSHMEM_DPRINTF("Invalid VM Doorbell VM %d\n", dest);

    }

}


static void tcg_out_ri(TCGContext *s, int const_arg, TCGArg arg)

{

    if (const_arg) {

        assert(const_arg == 1);

        tcg_out8(s, TCG_CONST);

        tcg_out_i(s, arg);

    } else {

        tcg_out_r(s, arg);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void add_user_command(char *optarg)
+
+{
+
+    ncmdline++;
+
     cmdline = realloc(cmdline, ncmdline * sizeof(char *));

     if (!cmdline) {

void add_user_command(char *optarg)

{

    ncmdline++;

    cmdline = realloc(cmdline, ncmdline * sizeof(char *));

    if (!cmdline) {

        perror("realloc");

        exit(1);

    }

    cmdline[ncmdline-1] = optarg;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     Suite *s;

     TCase *qint_public_tcase;
+
+
+
+    s = suite_create("QInt test-suite");
+

     qint_public_tcase = tcase_create("Public Interface");

static Suite *qint_suite(void)

{

    Suite *s;

    TCase *qint_public_tcase;

    s = suite_create("QInt test-suite");

    qint_public_tcase = tcase_create("Public Interface");

    suite_add_tcase(s, qint_public_tcase);

    tcase_add_test(qint_public_tcase, qint_from_int_test);

    tcase_add_test(qint_public_tcase, qint_destroy_test);

    tcase_add_test(qint_public_tcase, qint_from_int64_test);

    tcase_add_test(qint_public_tcase, qint_get_int_test);

    tcase_add_test(qint_public_tcase, qobject_to_qint_test);

    return s;

}


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

     slirp_cleanup(s->slirp);

+    slirp_smb_cleanup(s);
+
+    TAILQ_REMOVE(&slirp_stacks, s, entry);
+
     qemu_free(s);

 }

static void net_slirp_cleanup(VLANClientState *vc)

{

    SlirpState *s = vc->opaque;

    slirp_cleanup(s->slirp);

    slirp_smb_cleanup(s);

    TAILQ_REMOVE(&slirp_stacks, s, entry);

    qemu_free(s);

}


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

+    if (env->cp15.contextidr_el1 != value && !arm_feature(env, ARM_FEATURE_MPU)
+
+        && !extended_addresses_enabled(env)) {
+
+        /* For VMSA (when not using the LPAE long descriptor page table

          * format) this register includes the ASID, so do a TLB flush.

static void contextidr_write(CPUARMState *env, const ARMCPRegInfo *ri,

                             uint64_t value)

{

    ARMCPU *cpu = arm_env_get_cpu(env);

    if (env->cp15.contextidr_el1 != value && !arm_feature(env, ARM_FEATURE_MPU)

        && !extended_addresses_enabled(env)) {

        /* For VMSA (when not using the LPAE long descriptor page table

         * format) this register includes the ASID, so do a TLB flush.

         * For PMSA it is purely a process ID and no action is needed.

         */

        tlb_flush(CPU(cpu), 1);

    }

    env->cp15.contextidr_el1 = value;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int nbd_co_writev_1(NbdClientSession *client, int64_t sector_num,
+
                            int nb_sectors, QEMUIOVector *qiov,

+                           int offset)

 {

static int nbd_co_writev_1(NbdClientSession *client, int64_t sector_num,

                           int nb_sectors, QEMUIOVector *qiov,

                           int offset)

{

    struct nbd_request request;

    struct nbd_reply reply;

    ssize_t ret;

    request.type = NBD_CMD_WRITE;

    if (!bdrv_enable_write_cache(client->bs) &&

        (client->nbdflags & NBD_FLAG_SEND_FUA)) {

        request.type |= NBD_CMD_FLAG_FUA;

    }

    request.from = sector_num * 512;

    request.len = nb_sectors * 512;

    nbd_coroutine_start(client, &request);

    ret = nbd_co_send_request(client, &request, qiov, offset);

    if (ret < 0) {

        reply.error = -ret;

    } else {

        nbd_co_receive_reply(client, &request, &reply, NULL, 0);

    }

    nbd_coroutine_end(client, &request);

    return -reply.error;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void coroutine_fn resend_aioreq(BDRVSheepdogState *s, AIOReq *aio_req)

+{

     SheepdogAIOCB *acb = aio_req->aiocb;

@@ -13,15 +13,15 @@
     if (acb->aiocb_type == AIOCB_WRITE_UDATA && is_data_obj(aio_req->oid)) {

         int idx = data_oid_to_idx(aio_req->oid);
+

+        if (is_data_obj_writable(&s->inode, idx)) {

             goto out;

         }
+

         if (check_simultaneous_create(s, aio_req)) {

static void coroutine_fn resend_aioreq(BDRVSheepdogState *s, AIOReq *aio_req)

{

    SheepdogAIOCB *acb = aio_req->aiocb;

    bool create = false;

    /* check whether this request becomes a CoW one */

    if (acb->aiocb_type == AIOCB_WRITE_UDATA && is_data_obj(aio_req->oid)) {

        int idx = data_oid_to_idx(aio_req->oid);

        if (is_data_obj_writable(&s->inode, idx)) {

            goto out;

        }

        if (check_simultaneous_create(s, aio_req)) {

            return;

        }

        if (s->inode.data_vdi_id[idx]) {

            aio_req->base_oid = vid_to_data_oid(s->inode.data_vdi_id[idx], idx);

            aio_req->flags |= SD_FLAG_CMD_COW;

        }

        create = true;

    }

out:

    if (is_data_obj(aio_req->oid)) {

        add_aio_request(s, aio_req, acb->qiov->iov, acb->qiov->niov, create,

                        acb->aiocb_type);

    } else {

        struct iovec iov;

        iov.iov_base = &s->inode;

        iov.iov_len = sizeof(s->inode);

        add_aio_request(s, aio_req, &iov, 1, false, AIOCB_WRITE_UDATA);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+void put_string(PutBitContext * pbc, char *s)

 {

     while(*s){
+
         put_bits(pbc, 8, *s);

         s++;

void put_string(PutBitContext * pbc, char *s)

{

    while(*s){

        put_bits(pbc, 8, *s);

        s++;

    }

    put_bits(pbc, 8, 0);

}


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

         stream->buffer_ptr += len;

+        buf += len;
+
+        size -= len;
+
+        while (stream->buffer_ptr >= s->packet_data_max_size) {

             /* output the packet */

static int mpeg_mux_write_packet(AVFormatContext *ctx, int stream_index,

                                 const uint8_t *buf, int size, int64_t pts)

{

    MpegMuxContext *s = ctx->priv_data;

    AVStream *st = ctx->streams[stream_index];

    StreamInfo *stream = st->priv_data;

    int len;

    while (size > 0) {

        /* set pts */

        if (stream->start_pts == -1) {

            stream->start_pts = pts;

        }

        len = s->packet_data_max_size - stream->buffer_ptr;

        if (len > size)

            len = size;

        memcpy(stream->buffer + stream->buffer_ptr, buf, len);

        stream->buffer_ptr += len;

        buf += len;

        size -= len;

        while (stream->buffer_ptr >= s->packet_data_max_size) {

            /* output the packet */

            if (stream->start_pts == -1)

                stream->start_pts = pts;

            flush_packet(ctx, stream_index, 0);

        }

    }

    return 0;

}


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

     struct device_config *conf;
+
+    int rc;
+
+
+
     TAILQ_FOREACH(conf, &device_configs, next) {

         if (conf->type != type)

static int foreach_device_config(int type, int (*func)(const char *cmdline))

{

    struct device_config *conf;

    int rc;

    TAILQ_FOREACH(conf, &device_configs, next) {

        if (conf->type != type)

            continue;

        rc = func(conf->cmdline);

        if (0 != rc)

            return rc;

    }

    return 0;

}


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

     QLIST_INIT(&pool->head);
+
+    QTAILQ_INIT(&pool->request_list);
+
+
+
     aio_set_event_notifier(ctx, &pool->notifier, event_notifier_ready);

 }

static void thread_pool_init_one(ThreadPool *pool, AioContext *ctx)

{

    if (!ctx) {

        ctx = qemu_get_aio_context();

    }

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

    event_notifier_init(&pool->notifier, false);

    pool->ctx = ctx;

    qemu_mutex_init(&pool->lock);

    qemu_cond_init(&pool->check_cancel);

    qemu_cond_init(&pool->worker_stopped);

    qemu_sem_init(&pool->sem, 0);

    pool->max_threads = 64;

    pool->new_thread_bh = aio_bh_new(ctx, spawn_thread_bh_fn, pool);

    QLIST_INIT(&pool->head);

    QTAILQ_INIT(&pool->request_list);

    aio_set_event_notifier(ctx, &pool->notifier, event_notifier_ready);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg)
+
+{
+
+    uint8_t type;
+

     while (dev) {

static void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg)

{

    uint8_t type;

    while (dev) {

        if (!pci_is_express(dev)) {

            /* just ignore it */

            /* TODO: Shouldn't we set PCI_STATUS_SIG_SYSTEM_ERROR?

             * Consider e.g. a PCI bridge above a PCI Express device. */

            return;

        }

        type = pcie_cap_get_type(dev);

        if ((type == PCI_EXP_TYPE_ROOT_PORT ||

            type == PCI_EXP_TYPE_UPSTREAM ||

            type == PCI_EXP_TYPE_DOWNSTREAM) &&

            !pcie_aer_msg_vbridge(dev, msg)) {

                return;

        }

        if (!pcie_aer_msg_alldev(dev, msg)) {

            return;

        }

        if (type == PCI_EXP_TYPE_ROOT_PORT) {

            pcie_aer_msg_root_port(dev, msg);

            /* Root port can notify system itself,

               or send the error message to root complex event collector. */

            /*

             * if root port is associated with an event collector,

             * return the root complex event collector here.

             * For now root complex event collector isn't supported.

             */

            return;

        }

        dev = pci_bridge_get_device(dev->bus);

    }

}


--- a/source.c
+++ b/source.c
@@ -15,9 +15,9 @@
     } else if (*n < 0) {

         return 0;
+
+    }
+
+    return BDRV_BLOCK_DATA;
+
 }

static int64_t coroutine_fn vvfat_co_get_block_status(BlockDriverState *bs,

	int64_t sector_num, int nb_sectors, int* n)

{

    BDRVVVFATState* s = bs->opaque;

    *n = s->sector_count - sector_num;

    if (*n > nb_sectors) {

        *n = nb_sectors;

    } else if (*n < 0) {

        return 0;

    }

    return BDRV_BLOCK_DATA;

}


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

     const char *socket = qemu_opt_get(opts, "socket");

+    const char *sock_fd = qemu_opt_get(opts, "sock_fd");
+
+
+
+    if (!socket && !sock_fd) {

         fprintf(stderr, "socket and sock_fd none of the option specified\n");

static int proxy_parse_opts(QemuOpts *opts, struct FsDriverEntry *fs)

{

    const char *socket = qemu_opt_get(opts, "socket");

    const char *sock_fd = qemu_opt_get(opts, "sock_fd");

    if (!socket && !sock_fd) {

        fprintf(stderr, "socket and sock_fd none of the option specified\n");

        return -1;

    }

    if (socket && sock_fd) {

        fprintf(stderr, "Both socket and sock_fd options specified\n");

        return -1;

    }

    if (socket) {

        fs->path = g_strdup(socket);

        fs->export_flags = V9FS_PROXY_SOCK_NAME;

    } else {

        fs->path = g_strdup(sock_fd);

        fs->export_flags = V9FS_PROXY_SOCK_FD;

    }

    return 0;

}


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

 {

+    if (chipselect < 0 || chipselect > 3) {
+
+        fprintf(stderr, "%s: Bad chipselect %i\n", __FUNCTION__, chipselect);
+
         exit(-1);

     }

void omap_uwire_attach(struct omap_uwire_s *s,

                uWireSlave *slave, int chipselect)

{

    if (chipselect < 0 || chipselect > 3) {

        fprintf(stderr, "%s: Bad chipselect %i\n", __FUNCTION__, chipselect);

        exit(-1);

    }

    s->chip[chipselect] = slave;

}


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

         memset(msg, 0, sizeof(struct rndis_packet_msg_type));

+        msg->MessageType = cpu_to_le32(RNDIS_PACKET_MSG);
+
+        msg->MessageLength = cpu_to_le32(size + sizeof(struct rndis_packet_msg_type));
+
+        msg->DataOffset = cpu_to_le32(sizeof(struct rndis_packet_msg_type) - 8);

         msg->DataLength = cpu_to_le32(size);

static void usbnet_receive(void *opaque, const uint8_t *buf, size_t size)

{

    USBNetState *s = opaque;

    struct rndis_packet_msg_type *msg;

    if (s->rndis) {

        msg = (struct rndis_packet_msg_type *) s->in_buf;

        if (!s->rndis_state == RNDIS_DATA_INITIALIZED)

            return;

        if (size + sizeof(struct rndis_packet_msg_type) > sizeof(s->in_buf))

            return;

        memset(msg, 0, sizeof(struct rndis_packet_msg_type));

        msg->MessageType = cpu_to_le32(RNDIS_PACKET_MSG);

        msg->MessageLength = cpu_to_le32(size + sizeof(struct rndis_packet_msg_type));

        msg->DataOffset = cpu_to_le32(sizeof(struct rndis_packet_msg_type) - 8);

        msg->DataLength = cpu_to_le32(size);

        /* msg->OOBDataOffset;

         * msg->OOBDataLength;

         * msg->NumOOBDataElements;

         * msg->PerPacketInfoOffset;

         * msg->PerPacketInfoLength;

         * msg->VcHandle;

         * msg->Reserved;

         */

        memcpy(msg + 1, buf, size);

        s->in_len = size + sizeof(struct rndis_packet_msg_type);

    } else {

        if (size > sizeof(s->in_buf))

            return;

        memcpy(s->in_buf, buf, size);

        s->in_len = size;

    }

    s->in_ptr = 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static struct omap_eac_s *omap_eac_init(struct omap_target_agent_s *ta,
+
                 qemu_irq irq, qemu_irq *drq, omap_clk fclk, omap_clk iclk)

 {

static struct omap_eac_s *omap_eac_init(struct omap_target_agent_s *ta,

                qemu_irq irq, qemu_irq *drq, omap_clk fclk, omap_clk iclk)

{

    struct omap_eac_s *s = (struct omap_eac_s *)

            g_malloc0(sizeof(struct omap_eac_s));

    s->irq = irq;

    s->codec.rxdrq = *drq ++;

    s->codec.txdrq = *drq;

    omap_eac_reset(s);

    AUD_register_card("OMAP EAC", &s->codec.card);

    memory_region_init_io(&s->iomem, NULL, &omap_eac_ops, s, "omap.eac",

                          omap_l4_region_size(ta, 0));

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

    return s;

}


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

 {

+    int64_t now, last;
+
+    QEMUClock *clock = qemu_clock_ptr(type);
+
+

     switch (type) {

int64_t qemu_clock_get_ns(QEMUClockType type)

{

    int64_t now, last;

    QEMUClock *clock = qemu_clock_ptr(type);

    switch (type) {

    case QEMU_CLOCK_REALTIME:

        return get_clock();

    default:

    case QEMU_CLOCK_VIRTUAL:

        if (use_icount) {

            return cpu_get_icount();

        } else {

            return cpu_get_clock();

        }

    case QEMU_CLOCK_HOST:

        now = get_clock_realtime();

        last = clock->last;

        clock->last = now;

        if (now < last) {

            notifier_list_notify(&clock->reset_notifiers, &now);

        }

        return now;

    case QEMU_CLOCK_VIRTUAL_RT:

        return cpu_get_clock();

    }

}


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

             tcg_gen_andi_i64(tmp, cpu_ir[rb], 7);

+            tcg_gen_shli_i64(tmp, tmp, 3);
+
+            tcg_gen_shr_i64(cpu_ir[rc], cpu_ir[ra], tmp);
+
+            tcg_temp_free(tmp);

         }

static always_inline void gen_ext_l(void (*tcg_gen_ext_i64)(TCGv t0, TCGv t1),

                                    int ra, int rb, int rc,

                                    int islit, uint8_t lit)

{

    if (unlikely(rc == 31))

        return;

    if (ra != 31) {

        if (islit) {

                tcg_gen_shri_i64(cpu_ir[rc], cpu_ir[ra], (lit & 7) * 8);

        } else {

            TCGv tmp = tcg_temp_new(TCG_TYPE_I64);

            tcg_gen_andi_i64(tmp, cpu_ir[rb], 7);

            tcg_gen_shli_i64(tmp, tmp, 3);

            tcg_gen_shr_i64(cpu_ir[rc], cpu_ir[ra], tmp);

            tcg_temp_free(tmp);

        }

        if (tcg_gen_ext_i64)

            tcg_gen_ext_i64(cpu_ir[rc], cpu_ir[rc]);

    } else

        tcg_gen_movi_i64(cpu_ir[rc], 0);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void ide_init1(IDEBus *bus, int unit, DriveInfo *dinfo)
+
+{
+
+    static int drive_serial = 1;
+
     IDEState *s = &bus->ifs[unit];

static void ide_init1(IDEBus *bus, int unit, DriveInfo *dinfo)

{

    static int drive_serial = 1;

    IDEState *s = &bus->ifs[unit];

    s->bus = bus;

    s->unit = unit;

    s->drive_serial = drive_serial++;

    s->io_buffer = qemu_blockalign(s->bs, IDE_DMA_BUF_SECTORS*512 + 4);

    s->io_buffer_total_len = IDE_DMA_BUF_SECTORS*512 + 4;

    s->smart_selftest_data = qemu_blockalign(s->bs, 512);

    s->sector_write_timer = qemu_new_timer(vm_clock,

                                           ide_sector_write_timer_cb, s);

    ide_init_drive(s, dinfo, NULL);

}