--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static uint16_t roundToInt16(int64_t f){
+
+	int r= (f + (1<<15))>>16;
+
+	     if(r<-0x7FFF) return 0x8000;

 	else if(r> 0x7FFF) return 0x7FFF;

static uint16_t roundToInt16(int64_t f){

	int r= (f + (1<<15))>>16;

	     if(r<-0x7FFF) return 0x8000;

	else if(r> 0x7FFF) return 0x7FFF;

	else               return r;

}


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

     if (avctx->sample_rate != 8000 || avctx->channels != 1 ||
+
+        (avctx->bit_rate != 16000 && avctx->bit_rate != 24000 &&
+
+	 avctx->bit_rate != 32000 && avctx->bit_rate != 40000)) {
+
         av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n");

 	return -1;

static int g726_init(AVCodecContext * avctx)

{

    AVG726Context* c = (AVG726Context*)avctx->priv_data;

    if (avctx->sample_rate != 8000 || avctx->channels != 1 ||

        (avctx->bit_rate != 16000 && avctx->bit_rate != 24000 &&

	 avctx->bit_rate != 32000 && avctx->bit_rate != 40000)) {

        av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n");

	return -1;

    }

    g726_reset(&c->c, avctx->bit_rate);

    c->code_size = c->c.tbls->bits;

    c->bit_buffer = 0;

    c->bits_left = 0;

    return 0;

}


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

     int level, profile;
+
+
+
+    skip_bits(&s->gb, 1); /* profil and level esc*/
+
     profile= get_bits(&s->gb, 3);

     level= get_bits(&s->gb, 4);

static void mpeg_decode_sequence_extension(MpegEncContext *s)

{

    int horiz_size_ext, vert_size_ext;

    int bit_rate_ext;

    int level, profile;

    skip_bits(&s->gb, 1); /* profil and level esc*/

    profile= get_bits(&s->gb, 3);

    level= get_bits(&s->gb, 4);

    s->progressive_sequence = get_bits1(&s->gb); /* progressive_sequence */

    s->chroma_format = get_bits(&s->gb, 2); /* chroma_format 1=420, 2=422, 3=444 */

    horiz_size_ext = get_bits(&s->gb, 2);

    vert_size_ext = get_bits(&s->gb, 2);

    s->width |= (horiz_size_ext << 12);

    s->height |= (vert_size_ext << 12);

    bit_rate_ext = get_bits(&s->gb, 12);  /* XXX: handle it */

    s->bit_rate += (bit_rate_ext << 12) * 400;

    skip_bits1(&s->gb); /* marker */

    s->avctx->rc_buffer_size += get_bits(&s->gb, 8)*1024*16<<10;

    s->low_delay = get_bits1(&s->gb);

    if(s->flags & CODEC_FLAG_LOW_DELAY) s->low_delay=1;

    s->frame_rate_ext_n = get_bits(&s->gb, 2);

    s->frame_rate_ext_d = get_bits(&s->gb, 5);

    dprintf("sequence extension\n");

    s->codec_id= s->avctx->codec_id= CODEC_ID_MPEG2VIDEO;

    s->avctx->sub_id = 2; /* indicates mpeg2 found */

    if(s->avctx->debug & FF_DEBUG_PICT_INFO)

        av_log(s->avctx, AV_LOG_DEBUG, "profile: %d, level: %d vbv buffer: %d, bitrate:%d\n",

               profile, level, s->avctx->rc_buffer_size, s->bit_rate);

}


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

     if (!timer_head)
+
+        return 0;

     return (timer_head->expire_time <= current_time);

int qemu_timer_expired(QEMUTimer *timer_head, int64_t current_time)

{

    if (!timer_head)

        return 0;

    return (timer_head->expire_time <= current_time);

}


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

+    mn = s->min_dirty_data_idx;

+    mx = s->max_dirty_data_idx;

     if (mn <= mx) {

static void coroutine_fn sd_write_done(SheepdogAIOCB *acb)

{

    BDRVSheepdogState *s = acb->common.bs->opaque;

    struct iovec iov;

    AIOReq *aio_req;

    uint32_t offset, data_len, mn, mx;

    mn = s->min_dirty_data_idx;

    mx = s->max_dirty_data_idx;

    if (mn <= mx) {

        /* we need to update the vdi object. */

        offset = sizeof(s->inode) - sizeof(s->inode.data_vdi_id) +

            mn * sizeof(s->inode.data_vdi_id[0]);

        data_len = (mx - mn + 1) * sizeof(s->inode.data_vdi_id[0]);

        s->min_dirty_data_idx = UINT32_MAX;

        s->max_dirty_data_idx = 0;

        iov.iov_base = &s->inode;

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

        aio_req = alloc_aio_req(s, acb, vid_to_vdi_oid(s->inode.vdi_id),

                                data_len, offset, 0, 0, offset);

        QLIST_INSERT_HEAD(&s->inflight_aio_head, aio_req, aio_siblings);

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

        acb->aio_done_func = sd_finish_aiocb;

        acb->aiocb_type = AIOCB_WRITE_UDATA;

        return;

    }

    sd_finish_aiocb(acb);

}


--- a/source.c
+++ b/source.c
@@ -16,11 +16,11 @@
     }
     trace_usb_uas_command(uas->dev.addr, req->tag,
                           usb_uas_get_lun(req->lun),
+                          req->lun >> 32, req->lun & 0xffffffff);
+    QTAILQ_INSERT_TAIL(&uas->requests, req, next);
+    if (uas_using_streams(uas) && uas->data3[req->tag] != NULL) {
+        req->data = uas->data3[req->tag];
+        req->data_async = true;
         uas->data3[req->tag] = NULL;
     }
     req->req = scsi_req_new(req->dev, req->tag,

static void usb_uas_command(UASDevice *uas, uas_ui *ui)
{
    UASRequest *req;
    uint32_t len;
    uint16_t tag = be16_to_cpu(ui->hdr.tag);
    if (uas_using_streams(uas) && tag > UAS_MAX_STREAMS) {
        goto invalid_tag;
    }
    req = usb_uas_find_request(uas, tag);
    if (req) {
        goto overlapped_tag;
    }
    req = usb_uas_alloc_request(uas, ui);
    if (req->dev == NULL) {
        goto bad_target;
    }
    trace_usb_uas_command(uas->dev.addr, req->tag,
                          usb_uas_get_lun(req->lun),
                          req->lun >> 32, req->lun & 0xffffffff);
    QTAILQ_INSERT_TAIL(&uas->requests, req, next);
    if (uas_using_streams(uas) && uas->data3[req->tag] != NULL) {
        req->data = uas->data3[req->tag];
        req->data_async = true;
        uas->data3[req->tag] = NULL;
    }
    req->req = scsi_req_new(req->dev, req->tag,
                            usb_uas_get_lun(req->lun),
                            ui->command.cdb, req);
    if (uas->requestlog) {
        scsi_req_print(req->req);
    }
    len = scsi_req_enqueue(req->req);
    if (len) {
        req->data_size = len;
        scsi_req_continue(req->req);
    }
overlapped_tag:
    usb_uas_queue_fake_sense(uas, tag, sense_code_OVERLAPPED_COMMANDS);
bad_target:
    usb_uas_queue_fake_sense(uas, tag, sense_code_LUN_NOT_SUPPORTED);
    g_free(req);
}


--- a/source.c
+++ b/source.c
@@ -47,11 +47,11 @@
     s->deblock_filtering = 1;

+
+    s->filter = NULL;
+
+
+
     s->has_alpha = has_alpha;

     if (flip) {

av_cold void ff_vp56_init(AVCodecContext *avctx, int flip, int has_alpha)

{

    VP56Context *s = avctx->priv_data;

    int i;

    s->avctx = avctx;

    avctx->pix_fmt = has_alpha ? PIX_FMT_YUVA420P : PIX_FMT_YUV420P;

    if (avctx->idct_algo == FF_IDCT_AUTO)

        avctx->idct_algo = FF_IDCT_VP3;

    ff_dsputil_init(&s->dsp, avctx);

    ff_vp56dsp_init(&s->vp56dsp, avctx->codec->id);

    ff_init_scantable(s->dsp.idct_permutation, &s->scantable,ff_zigzag_direct);

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

        s->framep[i] = &s->frames[i];

    s->framep[VP56_FRAME_UNUSED] = s->framep[VP56_FRAME_GOLDEN];

    s->framep[VP56_FRAME_UNUSED2] = s->framep[VP56_FRAME_GOLDEN2];

    s->edge_emu_buffer_alloc = NULL;

    s->above_blocks = NULL;

    s->macroblocks = NULL;

    s->quantizer = -1;

    s->deblock_filtering = 1;

    s->filter = NULL;

    s->has_alpha = has_alpha;

    if (flip) {

        s->flip = -1;

        s->frbi = 2;

        s->srbi = 0;

    } else {

        s->flip = 1;

        s->frbi = 0;

        s->srbi = 2;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 vcard_free(VCard *vcard)
+
+{
+
+    VCardApplet *current_applet = NULL;
+
     VCardApplet *next_applet = NULL;

vcard_free(VCard *vcard)

{

    VCardApplet *current_applet = NULL;

    VCardApplet *next_applet = NULL;

    if (vcard == NULL) {

        return;

    }

    vcard->reference_count--;

    if (vcard->reference_count != 0) {

        return;

    }

    if (vcard->vcard_private_free) {

        (*vcard->vcard_private_free)(vcard->vcard_private);

        vcard->vcard_private_free = 0;

        vcard->vcard_private = 0;

    }

    for (current_applet = vcard->applet_list; current_applet;

                                        current_applet = next_applet) {

        next_applet = current_applet->next;

        vcard_delete_applet(current_applet);

    }

    vcard_buffer_response_delete(vcard->vcard_buffer_response);

    g_free(vcard);

}


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

     int bit;

+
+
+    level = s->olevel & s->dir;
+
+

     for (diff = s->prev_level ^ level; diff; diff ^= 1 << bit) {

static void strongarm_ppc_handler_update(StrongARMPPCInfo *s)

{

    uint32_t level, diff;

    int bit;

    level = s->olevel & s->dir;

    for (diff = s->prev_level ^ level; diff; diff ^= 1 << bit) {

        bit = ffs(diff) - 1;

        qemu_set_irq(s->handler[bit], (level >> bit) & 1);

    }

    s->prev_level = level;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void memory_global_sync_dirty_bitmap(MemoryRegion *address_space)

 {
+
     AddressSpace *as = memory_region_to_address_space(address_space);

     FlatRange *fr;

void memory_global_sync_dirty_bitmap(MemoryRegion *address_space)

{

    AddressSpace *as = memory_region_to_address_space(address_space);

    FlatRange *fr;

    FOR_EACH_FLAT_RANGE(fr, &as->current_map) {

        MEMORY_LISTENER_UPDATE_REGION(fr, as, Forward, log_sync);

    }

}


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

 {

+    GuestSuspendMode *mode = opaque;

     DWORD ret = 0;

static DWORD WINAPI do_suspend(LPVOID opaque)

{

    GuestSuspendMode *mode = opaque;

    DWORD ret = 0;

    if (!SetSuspendState(*mode == GUEST_SUSPEND_MODE_DISK, TRUE, TRUE)) {

        slog("failed to suspend guest, %s", GetLastError());

        ret = -1;

    }

    g_free(mode);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -37,9 +37,9 @@
         monitor_printf(mon, ",%s=%s", prop->name, str);

         g_free(str);
+
+    }
+
+    monitor_printf(mon, "\n");
+
 }

static void netfilter_print_info(Monitor *mon, NetFilterState *nf)

{

    char *str;

    ObjectProperty *prop;

    ObjectPropertyIterator iter;

    StringOutputVisitor *ov;

    /* generate info str */

    object_property_iter_init(&iter, OBJECT(nf));

    while ((prop = object_property_iter_next(&iter))) {

        if (!strcmp(prop->name, "type")) {

            continue;

        }

        ov = string_output_visitor_new(false);

        object_property_get(OBJECT(nf), string_output_get_visitor(ov),

                            prop->name, NULL);

        str = string_output_get_string(ov);

        visit_free(string_output_get_visitor(ov));

        monitor_printf(mon, ",%s=%s", prop->name, str);

        g_free(str);

    }

    monitor_printf(mon, "\n");

}


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

     MpegTSWrite *ts = s->priv_data;

+    MpegTSWriteStream *ts_st;
+
     MpegTSService *service;

     AVStream *st;
@@ -21,7 +21,7 @@
         st = s->streams[i];

         ts_st = st->priv_data;
+
         if (ts_st->payload_index > 0) {

             mpegts_write_pes(s, st, ts_st->payload, ts_st->payload_index,

static int mpegts_write_end(AVFormatContext *s)

{

    MpegTSWrite *ts = s->priv_data;

    MpegTSWriteStream *ts_st;

    MpegTSService *service;

    AVStream *st;

    int i;

    /* flush current packets */

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

        st = s->streams[i];

        ts_st = st->priv_data;

        if (ts_st->payload_index > 0) {

            mpegts_write_pes(s, st, ts_st->payload, ts_st->payload_index,

                             ts_st->payload_pts);

        }

    }

    put_flush_packet(&s->pb);

    for(i = 0; i < ts->nb_services; i++) {

        service = ts->services[i];

        av_freep(&service->provider_name);

        av_freep(&service->name);

        av_free(service);

    }

    av_free(ts->services);

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

        st = s->streams[i];

        av_free(st->priv_data);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
     avio_wl16(pb, 4);   /* wLongsPerEntry */

     avio_w8(pb, 0);     /* bIndexSubType (0 == frame index) */
+
+    avio_w8(pb, 0);     /* bIndexType (0 == AVI_INDEX_OF_INDEXES) */
+
+    avio_wl32(pb, 0);   /* nEntriesInUse (will fill out later on) */
+
     ffio_wfourcc(pb, avi_stream2fourcc(tag, stream_index, enc->codec_type));

                         /* dwChunkId */

static void write_odml_master(AVFormatContext *s, int stream_index)

{

    AVIOContext *pb = s->pb;

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

    AVCodecContext *enc = st->codec;

    AVIStream *avist = st->priv_data;

    unsigned char tag[5];

    int j;

    /* Starting to lay out AVI OpenDML master index.

        * We want to make it JUNK entry for now, since we'd

        * like to get away without making AVI an OpenDML one

        * for compatibility reasons. */

    avist->indexes.entry      = avist->indexes.ents_allocated = 0;

    avist->indexes.indx_start = ff_start_tag(pb, "JUNK");

    avio_wl16(pb, 4);   /* wLongsPerEntry */

    avio_w8(pb, 0);     /* bIndexSubType (0 == frame index) */

    avio_w8(pb, 0);     /* bIndexType (0 == AVI_INDEX_OF_INDEXES) */

    avio_wl32(pb, 0);   /* nEntriesInUse (will fill out later on) */

    ffio_wfourcc(pb, avi_stream2fourcc(tag, stream_index, enc->codec_type));

                        /* dwChunkId */

    avio_wl64(pb, 0);   /* dwReserved[3] */

    avio_wl32(pb, 0);   /* Must be 0.    */

    for (j = 0; j < AVI_MASTER_INDEX_SIZE * 2; j++)

        avio_wl64(pb, 0);

    ff_end_tag(pb, avist->indexes.indx_start);

}


static int default_fdset_dup_fd_add(int64_t fdset_id, int dup_fd)

{

    return -1;

}


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

                                    const void *unused)

+{

     TestStruct *p = NULL;

static void test_visitor_in_errors(TestInputVisitorData *data,

                                   const void *unused)

{

    TestStruct *p = NULL;

    Error *err = NULL;

    Visitor *v;

    v = visitor_input_test_init(data, "{ 'integer': false, 'boolean': 'foo', 'string': -42 }");

    visit_type_TestStruct(v, &p, NULL, &err);

    error_free_or_abort(&err);

    /* FIXME - a failed parse should not leave a partially-allocated p

     * for us to clean up; this could cause callers to leak memory. */

    g_assert(p->string == NULL);

    g_free(p->string);

    g_free(p);

}


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

     c->dir = opendir(h->filename);

+    if (!c->dir)
+
+        return AVERROR(errno);
+
+

     return 0;

static int file_open_dir(URLContext *h)

{

#if HAVE_DIRENT_H

    FileContext *c = h->priv_data;

    c->dir = opendir(h->filename);

    if (!c->dir)

        return AVERROR(errno);

    return 0;

#else

    return AVERROR(ENOSYS);

#endif /* HAVE_DIRENT_H */

}


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

     /* Verify that we have an AHCI device present. */
+
+    s->dev = get_ahci_device(&s->fingerprint);
+
+
+
     return s;

 }

static AHCIQState *ahci_boot(void)

{

    AHCIQState *s;

    const char *cli;

    s = g_malloc0(sizeof(AHCIQState));

    cli = "-drive if=none,id=drive0,file=%s,cache=writeback,serial=%s"

        ",format=raw"

        " -M q35 "

        "-device ide-hd,drive=drive0 "

        "-global ide-hd.ver=%s";

    s->parent = qtest_pc_boot(cli, tmp_path, "testdisk", "version");

    /* Verify that we have an AHCI device present. */

    s->dev = get_ahci_device(&s->fingerprint);

    return s;

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     VFIOQuirk *quirk;

     VFIOrtl8168Quirk *rtl;
+

     if (!vfio_pci_is(vdev, PCI_VENDOR_ID_REALTEK, 0x8168) || nr != 2) {

static void vfio_probe_rtl8168_bar2_quirk(VFIOPCIDevice *vdev, int nr)

{

    VFIOQuirk *quirk;

    VFIOrtl8168Quirk *rtl;

    if (!vfio_pci_is(vdev, PCI_VENDOR_ID_REALTEK, 0x8168) || nr != 2) {

        return;

    }

    quirk = g_malloc0(sizeof(*quirk));

    quirk->mem = g_malloc0(sizeof(MemoryRegion) * 2);

    quirk->nr_mem = 2;

    quirk->data = rtl = g_malloc0(sizeof(*rtl));

    rtl->vdev = vdev;

    memory_region_init_io(&quirk->mem[0], OBJECT(vdev),

                          &vfio_rtl_address_quirk, rtl,

                          "vfio-rtl8168-window-address-quirk", 4);

    memory_region_add_subregion_overlap(&vdev->bars[nr].region.mem,

                                        0x74, &quirk->mem[0], 1);

    memory_region_init_io(&quirk->mem[1], OBJECT(vdev),

                          &vfio_rtl_data_quirk, rtl,

                          "vfio-rtl8168-window-data-quirk", 4);

    memory_region_add_subregion_overlap(&vdev->bars[nr].region.mem,

                                        0x70, &quirk->mem[1], 1);

    QLIST_INSERT_HEAD(&vdev->bars[nr].quirks, quirk, next);

    trace_vfio_quirk_rtl8168_probe(vdev->vbasedev.name);

}


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

     const char *name = reg2str(reg);
+
     QTestState *qtest = global_qtest;

static inline void out_reg(IVState *s, enum Reg reg, unsigned v)

{

    const char *name = reg2str(reg);

    QTestState *qtest = global_qtest;

    global_qtest = s->qtest;

    g_test_message("%x -> *%s\n", v, name);

    qpci_io_writel(s->dev, s->reg_base + reg, v);

    global_qtest = qtest;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 struct omap_lcd_panel_s *omap_lcdc_init(MemoryRegion *sysmem,
+
                                         hwaddr base,

                                         qemu_irq irq,

struct omap_lcd_panel_s *omap_lcdc_init(MemoryRegion *sysmem,

                                        hwaddr base,

                                        qemu_irq irq,

                                        struct omap_dma_lcd_channel_s *dma,

                                        omap_clk clk)

{

    struct omap_lcd_panel_s *s = (struct omap_lcd_panel_s *)

            g_malloc0(sizeof(struct omap_lcd_panel_s));

    s->irq = irq;

    s->dma = dma;

    s->sysmem = sysmem;

    omap_lcdc_reset(s);

    memory_region_init_io(&s->iomem, NULL, &omap_lcdc_ops, s, "omap.lcdc", 0x100);

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

    s->con = graphic_console_init(NULL, 0, &omap_ops, s);

    return s;

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
     srat_start = table_data->len;

     srat = acpi_data_push(table_data, sizeof(*srat));
+
+    srat->reserved1 = cpu_to_le32(1);
+
+
+
     for (i = 0; i < cpu_list->len; ++i) {

         int node_id = cpu_list->cpus[i].props.has_node_id ?

build_srat(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)

{

    AcpiSystemResourceAffinityTable *srat;

    AcpiSratProcessorGiccAffinity *core;

    AcpiSratMemoryAffinity *numamem;

    int i, srat_start;

    uint64_t mem_base;

    MachineClass *mc = MACHINE_GET_CLASS(vms);

    const CPUArchIdList *cpu_list = mc->possible_cpu_arch_ids(MACHINE(vms));

    srat_start = table_data->len;

    srat = acpi_data_push(table_data, sizeof(*srat));

    srat->reserved1 = cpu_to_le32(1);

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

        int node_id = cpu_list->cpus[i].props.has_node_id ?

            cpu_list->cpus[i].props.node_id : 0;

        core = acpi_data_push(table_data, sizeof(*core));

        core->type = ACPI_SRAT_PROCESSOR_GICC;

        core->length = sizeof(*core);

        core->proximity = cpu_to_le32(node_id);

        core->acpi_processor_uid = cpu_to_le32(i);

        core->flags = cpu_to_le32(1);

    }

    mem_base = vms->memmap[VIRT_MEM].base;

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

        numamem = acpi_data_push(table_data, sizeof(*numamem));

        build_srat_memory(numamem, mem_base, numa_info[i].node_mem, i,

                          MEM_AFFINITY_ENABLED);

        mem_base += numa_info[i].node_mem;

    }

    build_header(linker, table_data, (void *)srat, "SRAT",

                 table_data->len - srat_start, 3, NULL, NULL);

}


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

     int payload_size = 0;

+    int byte = 0xFF;
+
+    av_log(logctx, AV_LOG_DEBUG, "Decoding SEI\n");
+
+

     while (byte == 0xFF) {

static int decode_nal_sei_message(GetBitContext *gb, void *logctx, HEVCSEI *s,

                                  const HEVCParamSets *ps, int nal_unit_type)

{

    int payload_type = 0;

    int payload_size = 0;

    int byte = 0xFF;

    av_log(logctx, AV_LOG_DEBUG, "Decoding SEI\n");

    while (byte == 0xFF) {

        byte          = get_bits(gb, 8);

        payload_type += byte;

    }

    byte = 0xFF;

    while (byte == 0xFF) {

        byte          = get_bits(gb, 8);

        payload_size += byte;

    }

    if (nal_unit_type == HEVC_NAL_SEI_PREFIX) {

        return decode_nal_sei_prefix(gb, logctx, s, ps, payload_type, payload_size);

    } else { /* nal_unit_type == NAL_SEI_SUFFIX */

        return decode_nal_sei_suffix(gb, logctx, s, payload_type, payload_size);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 SwsContext *sws_alloc_context(void)

+{
+
     SwsContext *c = av_mallocz(sizeof(SwsContext));

SwsContext *sws_alloc_context(void)

{

    SwsContext *c = av_mallocz(sizeof(SwsContext));

    c->av_class = &sws_context_class;

    av_opt_set_defaults(c);

    return c;

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+static void ahci_pci_enable(AHCIQState *ahci)
+
+{
+
+    uint8_t reg;
+
+
+
+    start_ahci_device(ahci);

static void ahci_pci_enable(AHCIQState *ahci)

{

    uint8_t reg;

    start_ahci_device(ahci);

    switch (ahci->fingerprint) {

    case AHCI_INTEL_ICH9:

        /* ICH9 has a register at PCI 0x92 that

         * acts as a master port enabler mask. */

        reg = qpci_config_readb(ahci->dev, 0x92);

        reg |= 0x3F;

        qpci_config_writeb(ahci->dev, 0x92, reg);

        /* 0...0111111b -- bit significant, ports 0-5 enabled. */

        ASSERT_BIT_SET(qpci_config_readb(ahci->dev, 0x92), 0x3F);

        break;

    }

}


--- a/source.c
+++ b/source.c
@@ -11,7 +11,7 @@
         struct qdist_entry e;

+
         e.x = x;

         entry = bsearch(&e, dist->entries, dist->n, sizeof(e), qdist_cmp);

void qdist_add(struct qdist *dist, double x, long count)

{

    struct qdist_entry *entry = NULL;

    if (dist->n) {

        struct qdist_entry e;

        e.x = x;

        entry = bsearch(&e, dist->entries, dist->n, sizeof(e), qdist_cmp);

    }

    if (entry) {

        entry->count += count;

        return;

    }

    if (unlikely(dist->n == dist->size)) {

        dist->size *= 2;

        dist->entries = g_realloc(dist->entries,

                                  sizeof(*dist->entries) * (dist->size));

    }

    dist->n++;

    entry = &dist->entries[dist->n - 1];

    entry->x = x;

    entry->count = count;

    qsort(dist->entries, dist->n, sizeof(*entry), qdist_cmp);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void gen_neon_trn_u8(TCGv t0, TCGv t1)

+{
+
     TCGv rd, tmp;

@@ -11,8 +11,8 @@
     tmp = new_tmp();

+
+    tcg_gen_shli_i32(rd, t0, 8);

     tcg_gen_andi_i32(rd, rd, 0xff00ff00);

static void gen_neon_trn_u8(TCGv t0, TCGv t1)

{

    TCGv rd, tmp;

    rd = new_tmp();

    tmp = new_tmp();

    tcg_gen_shli_i32(rd, t0, 8);

    tcg_gen_andi_i32(rd, rd, 0xff00ff00);

    tcg_gen_andi_i32(tmp, t1, 0x00ff00ff);

    tcg_gen_or_i32(rd, rd, tmp);

    tcg_gen_shri_i32(t1, t1, 8);

    tcg_gen_andi_i32(t1, t1, 0x00ff00ff);

    tcg_gen_andi_i32(tmp, t0, 0xff00ff00);

    tcg_gen_or_i32(t1, t1, tmp);

    tcg_gen_mov_i32(t0, rd);

    dead_tmp(tmp);

    dead_tmp(rd);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static void device_set_hotplugged(Object *obj, bool value, Error **err)
+
+{

     DeviceState *dev = DEVICE(obj);

static void device_set_hotplugged(Object *obj, bool value, Error **err)

{

    DeviceState *dev = DEVICE(obj);

    dev->hotplugged = value;

}


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

 {

+    int old_flv_size;

+
     // generate packet header and put data into buffer for FLV demuxer

     if (rt->flv_off < rt->flv_size) {

static int update_offset(RTMPContext *rt, int size)

{

    int old_flv_size;

    // generate packet header and put data into buffer for FLV demuxer

    if (rt->flv_off < rt->flv_size) {

        // There is old unread data in the buffer, thus append at the end

        old_flv_size  = rt->flv_size;

        rt->flv_size += size + 15;

    } else {

        // All data has been read, write the new data at the start of the buffer

        old_flv_size = 0;

        rt->flv_size = size + 15;

        rt->flv_off  = 0;

    }

    return old_flv_size;

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
         DPRINTF("Unable to set nonblocking mode on file descriptor\n");

         goto err_after_open;
+
+    }
+
+
+
     s->get_error = fd_errno;

     s->write = fd_write;

int fd_start_outgoing_migration(MigrationState *s, const char *fdname)

{

    s->fd = monitor_get_fd(s->mon, fdname);

    if (s->fd == -1) {

        DPRINTF("fd_migration: invalid file descriptor identifier\n");

        goto err_after_get_fd;

    }

    if (fcntl(s->fd, F_SETFL, O_NONBLOCK) == -1) {

        DPRINTF("Unable to set nonblocking mode on file descriptor\n");

        goto err_after_open;

    }

    s->get_error = fd_errno;

    s->write = fd_write;

    s->close = fd_close;

    migrate_fd_connect(s);

    return 0;

err_after_open:

    close(s->fd);

err_after_get_fd:

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int sys_utimensat(int dirfd, const char *pathname,

     const struct timespec times[2], int flags)
+
+{

   return (utimensat(dirfd, pathname, times, flags));

static int sys_utimensat(int dirfd, const char *pathname,

    const struct timespec times[2], int flags)

{

  return (utimensat(dirfd, pathname, times, flags));

}


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

{

    int t   = get_bits(gb, 3);

    int val = dim[t];

    if(val < 0)

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

    if(!val){

        do{

            t = get_bits(gb, 8);

            val += t << 2;

        }while(t == 0xFF);

    }

    return val;

}


static void onenand_reset(OneNANDState *s, int cold)

{

    memset(&s->addr, 0, sizeof(s->addr));

    s->command = 0;

    s->count = 1;

    s->bufaddr = 0;

    s->config[0] = 0x40c0;

    s->config[1] = 0x0000;

    onenand_intr_update(s);

    qemu_irq_raise(s->rdy);

    s->status = 0x0000;

    s->intstatus = cold ? 0x8080 : 0x8010;

    s->unladdr[0] = 0;

    s->unladdr[1] = 0;

    s->wpstatus = 0x0002;

    s->cycle = 0;

    s->otpmode = 0;

    s->blk_cur = s->blk;

    s->current = s->image;

    s->secs_cur = s->secs;

    if (cold) {

        /* Lock the whole flash */

        memset(s->blockwp, ONEN_LOCK_LOCKED, s->blocks);

        if (s->blk_cur && blk_read(s->blk_cur, 0, s->boot[0], 8) < 0) {

            hw_error("%s: Loading the BootRAM failed.\n", __func__);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -7,14 +7,14 @@
     ARMCPU *target_cpu;

+
     DPRINTF("cpu %" PRId64 "\n", cpuid);

+
+    /* change to the cpu we are powering up */
+
+    target_cpu_state = arm_get_cpu_by_id(cpuid);

     if (!target_cpu_state) {

int arm_set_cpu_off(uint64_t cpuid)

{

    CPUState *target_cpu_state;

    ARMCPU *target_cpu;

    DPRINTF("cpu %" PRId64 "\n", cpuid);

    /* change to the cpu we are powering up */

    target_cpu_state = arm_get_cpu_by_id(cpuid);

    if (!target_cpu_state) {

        return QEMU_ARM_POWERCTL_INVALID_PARAM;

    }

    target_cpu = ARM_CPU(target_cpu_state);

    if (target_cpu->powered_off) {

        qemu_log_mask(LOG_GUEST_ERROR,

                      "[ARM]%s: CPU %" PRId64 " is already off\n",

                      __func__, cpuid);

        return QEMU_ARM_POWERCTL_IS_OFF;

    }

    target_cpu->powered_off = true;

    target_cpu_state->halted = 1;

    target_cpu_state->exception_index = EXCP_HLT;

    cpu_loop_exit(target_cpu_state);

    /* notreached */

    return QEMU_ARM_POWERCTL_RET_SUCCESS;

}


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

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

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

{

    M48t59State *NVRAM = opaque;

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

}


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

     avfilter_unref_buffer(tinterlace->cur);

+    tinterlace->cur  = tinterlace->next;
+
+    tinterlace->next = picref;
+
+
     return 0;

 }

static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)

{

    AVFilterContext *ctx = inlink->dst;

    TInterlaceContext *tinterlace = ctx->priv;

    avfilter_unref_buffer(tinterlace->cur);

    tinterlace->cur  = tinterlace->next;

    tinterlace->next = picref;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,

                       AVStream *st, RMStream *ast, AVPacket *pkt)
+
 {

     RMDemuxContext *rm = s->priv_data;

ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,

                      AVStream *st, RMStream *ast, AVPacket *pkt)

{

    RMDemuxContext *rm = s->priv_data;

    assert (rm->audio_pkt_cnt > 0);

    if (st->codec->codec_id == CODEC_ID_AAC)

        av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);

    else {

        av_new_packet(pkt, st->codec->block_align);

        memcpy(pkt->data, ast->pkt.data + st->codec->block_align * //FIXME avoid this

               (ast->sub_packet_h * ast->audio_framesize / st->codec->block_align - rm->audio_pkt_cnt),

               st->codec->block_align);

    }

    rm->audio_pkt_cnt--;

    if ((pkt->pts = ast->audiotimestamp) != AV_NOPTS_VALUE) {

        ast->audiotimestamp = AV_NOPTS_VALUE;

        pkt->flags = AV_PKT_FLAG_KEY;

    } else

        pkt->flags = 0;

    pkt->stream_index = st->index;

    return rm->audio_pkt_cnt;

}


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

+{

     QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;

static uint32_t qvirtio_pci_get_guest_features(QVirtioDevice *d)

{

    QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;

    return qpci_io_readl(dev->pdev, dev->addr + VIRTIO_PCI_GUEST_FEATURES);

}


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

 {

+    UserDefFlatUnion2 *tmp = NULL;
+
     Error *err = NULL;

     Visitor *v;

static void test_validate_fail_union_flat_no_discrim(TestInputVisitorData *data,

                                                     const void *unused)

{

    UserDefFlatUnion2 *tmp = NULL;

    Error *err = NULL;

    Visitor *v;

    /* test situation where discriminator field ('enum1' here) is missing */

    v = validate_test_init(data, "{ 'integer': 42, 'string': 'c', 'string1': 'd', 'string2': 'e' }");

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

    g_assert(err);

    error_free(err);

    qapi_free_UserDefFlatUnion2(tmp);

}


--- a/source.c
+++ b/source.c
@@ -28,11 +28,11 @@
         return 0;
     if (buf_size <= 7)
     buf_size -= 7;
+    /* Decode rle bitmap length, stored size includes width/height data */
+    rle_bitmap_len = bytestream_get_be24(&buf) - 2*2;
+    /* Get bitmap dimensions from data */
+    width  = bytestream_get_be16(&buf);
+    height = bytestream_get_be16(&buf);
     /* Make sure the bitmap is not too large */
     if (avctx->width < width || avctx->height < height) {
         av_log(avctx, AV_LOG_ERROR, "Bitmap dimensions larger than video.\n");

static int parse_object_segment(AVCodecContext *avctx,
                                  const uint8_t *buf, int buf_size)
{
    PGSSubContext *ctx = avctx->priv_data;
    PGSSubObject *object;
    uint8_t sequence_desc;
    unsigned int rle_bitmap_len, width, height;
    int id;
    if (buf_size <= 4)
    buf_size -= 4;
    id = bytestream_get_be16(&buf);
    object = find_object(id, &ctx->objects);
    if (!object) {
        if (ctx->objects.count >= MAX_EPOCH_OBJECTS) {
            av_log(avctx, AV_LOG_ERROR, "Too many objects in epoch\n");
        object = &ctx->objects.object[ctx->objects.count++];
        object->id = id;
    /* skip object version number */
    buf += 1;
    /* Read the Sequence Description to determine if start of RLE data or appended to previous RLE */
    sequence_desc = bytestream_get_byte(&buf);
    if (!(sequence_desc & 0x80)) {
        /* Additional RLE data */
        if (buf_size > object->rle_remaining_len)
        memcpy(object->rle + object->rle_data_len, buf, buf_size);
        object->rle_data_len += buf_size;
        object->rle_remaining_len -= buf_size;
        return 0;
    if (buf_size <= 7)
    buf_size -= 7;
    /* Decode rle bitmap length, stored size includes width/height data */
    rle_bitmap_len = bytestream_get_be24(&buf) - 2*2;
    /* Get bitmap dimensions from data */
    width  = bytestream_get_be16(&buf);
    height = bytestream_get_be16(&buf);
    /* Make sure the bitmap is not too large */
    if (avctx->width < width || avctx->height < height) {
        av_log(avctx, AV_LOG_ERROR, "Bitmap dimensions larger than video.\n");
    object->w = width;
    object->h = height;
    av_fast_malloc(&object->rle, &object->rle_buffer_size, rle_bitmap_len);
    if (!object->rle)
        return AVERROR(ENOMEM);
    memcpy(object->rle, buf, buf_size);
    object->rle_data_len = buf_size;
    object->rle_remaining_len = rle_bitmap_len - buf_size;
    return 0;


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void ff_write_pass1_stats(MpegEncContext *s)
+
 {

     snprintf(s->avctx->stats_out, 256,

void ff_write_pass1_stats(MpegEncContext *s)

{

    snprintf(s->avctx->stats_out, 256,

             "in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d "

             "fcode:%d bcode:%d mc-var:%d var:%d icount:%d skipcount:%d hbits:%d;\n",

             s->current_picture_ptr->f.display_picture_number,

             s->current_picture_ptr->f.coded_picture_number,

             s->pict_type,

             s->current_picture.f.quality,

             s->i_tex_bits,

             s->p_tex_bits,

             s->mv_bits,

             s->misc_bits,

             s->f_code,

             s->b_code,

             s->current_picture.mc_mb_var_sum,

             s->current_picture.mb_var_sum,

             s->i_count, s->skip_count,

             s->header_bits);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 int read_ffserver_streams(AVFormatContext *s, const char *filename)

+{
+
+    int i;
+
+    AVFormatContext *ic;

int read_ffserver_streams(AVFormatContext *s, const char *filename)

{

    int i;

    AVFormatContext *ic;

    ic = av_open_input_file(filename, FFM_PACKET_SIZE);

    if (!ic)

        return -EIO;

    /* copy stream format */

    s->nb_streams = ic->nb_streams;

    for(i=0;i<ic->nb_streams;i++) {

        AVStream *st;

        st = av_mallocz(sizeof(AVFormatContext));

        memcpy(st, ic->streams[i], sizeof(AVStream));

        s->streams[i] = st;

    }

    av_close_input_file(ic);

    return 0;

}


static void FUNCC(pred8x8l_vertical)(uint8_t *_src, int has_topleft, int has_topright, int _stride)

{

    int y;

    pixel *src = (pixel*)_src;

    int stride = _stride/sizeof(pixel);

    PREDICT_8x8_LOAD_TOP;

    src[0] = t0;

    src[1] = t1;

    src[2] = t2;

    src[3] = t3;

    src[4] = t4;

    src[5] = t5;

    src[6] = t6;

    src[7] = t7;

    for( y = 1; y < 8; y++ ) {

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

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

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static int ram_decompress_open(RamDecompressState *s, QEMUFile *f)
+
+{
+
+    int ret;
+
+    memset(s, 0, sizeof(*s));

     s->f = f;

static int ram_decompress_open(RamDecompressState *s, QEMUFile *f)

{

    int ret;

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

    s->f = f;

    ret = inflateInit(&s->zstream);

    if (ret != Z_OK)

        return -1;

    return 0;

}


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

      * Synchronize between bios and QEMU by canceling

+     * pxb's effect.
+
+     */
+
+    return pin - PCI_SLOT(pxb->devfn);

 }

static int pxb_map_irq_fn(PCIDevice *pci_dev, int pin)

{

    PCIDevice *pxb = pci_dev->bus->parent_dev;

    /*

     * The bios does not index the pxb slot number when

     * it computes the IRQ because it resides on bus 0

     * and not on the current bus.

     * However QEMU routes the irq through bus 0 and adds

     * the pxb slot to the IRQ computation of the PXB

     * device.

     *

     * Synchronize between bios and QEMU by canceling

     * pxb's effect.

     */

    return pin - PCI_SLOT(pxb->devfn);

}


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

         cpu_fprintf(f, "BROKEN: LO=0x" TARGET_FMT_lx "\n", env->active_tc.LO[0]);

+    if (!SIGN_EXT_P(env->btarget))
+
+        cpu_fprintf(f, "BROKEN: btarget=0x" TARGET_FMT_lx "\n", env->btarget);
+
+

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

cpu_mips_check_sign_extensions (CPUState *env, FILE *f,

                                int (*cpu_fprintf)(FILE *f, const char *fmt, ...),

                                int flags)

{

    int i;

    if (!SIGN_EXT_P(env->active_tc.PC))

        cpu_fprintf(f, "BROKEN: pc=0x" TARGET_FMT_lx "\n", env->active_tc.PC);

    if (!SIGN_EXT_P(env->active_tc.HI[0]))

        cpu_fprintf(f, "BROKEN: HI=0x" TARGET_FMT_lx "\n", env->active_tc.HI[0]);

    if (!SIGN_EXT_P(env->active_tc.LO[0]))

        cpu_fprintf(f, "BROKEN: LO=0x" TARGET_FMT_lx "\n", env->active_tc.LO[0]);

    if (!SIGN_EXT_P(env->btarget))

        cpu_fprintf(f, "BROKEN: btarget=0x" TARGET_FMT_lx "\n", env->btarget);

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

        if (!SIGN_EXT_P(env->active_tc.gpr[i]))

            cpu_fprintf(f, "BROKEN: %s=0x" TARGET_FMT_lx "\n", regnames[i], env->active_tc.gpr[i]);

    }

    if (!SIGN_EXT_P(env->CP0_EPC))

        cpu_fprintf(f, "BROKEN: EPC=0x" TARGET_FMT_lx "\n", env->CP0_EPC);

    if (!SIGN_EXT_P(env->lladdr))

        cpu_fprintf(f, "BROKEN: LLAddr=0x" TARGET_FMT_lx "\n", env->lladdr);

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     printf("\n"

            "Options:\n"
+
+           "-e                echo each input line on output\n"
+
+           "-h                print this help\n"
+
            "-i INFILE         set INFILE as input file, stdin if omitted\n"

            "-l LEVEL          set the number of escaping levels, 1 if omitted\n"

static void usage(void)

{

    printf("Escape an input string, adopting the av_get_token() escaping logic\n");

    printf("usage: ffescape [OPTIONS]\n");

    printf("\n"

           "Options:\n"

           "-e                echo each input line on output\n"

           "-h                print this help\n"

           "-i INFILE         set INFILE as input file, stdin if omitted\n"

           "-l LEVEL          set the number of escaping levels, 1 if omitted\n"

           "-m ESCAPE_MODE    select escape mode between 'full', 'lazy', 'quote', default is 'lazy'\n"

           "-o OUTFILE        set OUTFILE as output file, stdout if omitted\n"

           "-p PROMPT         set output prompt, is '=> ' by default\n"

           "-s SPECIAL_CHARS  set the list of special characters\n");

}


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

                                                 int block_w, int block_h,

static av_noinline void emulated_edge_mc_mmxext(uint8_t *buf, const uint8_t *src,

                                                ptrdiff_t buf_stride,

                                                ptrdiff_t src_stride,

                                                int block_w, int block_h,

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

{

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

                     src_x, src_y, w, h, vfixtbl_mmx, &ff_emu_edge_vvar_mmx,

                     hfixtbl_mmxext, &ff_emu_edge_hvar_mmxext);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 iscsi_abort_task_cb(struct iscsi_context *iscsi, int status, void *command_data,
+
+                    void *private_data)
+
 {

     IscsiAIOCB *acb = (IscsiAIOCB *)private_data;

iscsi_abort_task_cb(struct iscsi_context *iscsi, int status, void *command_data,

                    void *private_data)

{

    IscsiAIOCB *acb = (IscsiAIOCB *)private_data;

    scsi_free_scsi_task(acb->task);

    acb->task = NULL;

}


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

     BMDMAState *bm = opaque;

+
+
     if (!level) {

         /* pass through lower */

static void bmdma_irq(void *opaque, int n, int level)

{

    BMDMAState *bm = opaque;

    if (!level) {

        /* pass through lower */

        qemu_set_irq(bm->irq, level);

        return;

    }

    if (bm) {

        bm->status |= BM_STATUS_INT;

    }

    /* trigger the real irq */

    qemu_set_irq(bm->irq, level);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static inline void memcpy_tofs(void * to, const void * from, unsigned long n)

+{

 	memcpy(to, from, n);

static inline void memcpy_tofs(void * to, const void * from, unsigned long n)

{

	memcpy(to, from, n);

}


--- a/source.c
+++ b/source.c
@@ -37,11 +37,11 @@
     ret = ga_channel_client_add(c, client_fd);

     if (ret) {
+
+        g_warning("error setting up connection");
+
+
+        goto out;

     }

static gboolean ga_channel_listen_accept(GIOChannel *channel,

                                         GIOCondition condition, gpointer data)

{

    GAChannel *c = data;

    int ret, client_fd;

    bool accepted = false;

    struct sockaddr_un addr;

    socklen_t addrlen = sizeof(addr);

    g_assert(channel != NULL);

    client_fd = qemu_accept(g_io_channel_unix_get_fd(channel),

                            (struct sockaddr *)&addr, &addrlen);

    if (client_fd == -1) {

        g_warning("error converting fd to gsocket: %s", strerror(errno));

        goto out;

    }

    fcntl(client_fd, F_SETFL, O_NONBLOCK);

    ret = ga_channel_client_add(c, client_fd);

    if (ret) {

        g_warning("error setting up connection");

        goto out;

    }

    accepted = true;

out:

    /* only accept 1 connection at a time */

    return !accepted;

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     uint64_t buf[RT_ENTRIES_PER_SECTOR];

     int rt_start_index;
+
     int i, ret;

static int write_reftable_entry(BlockDriverState *bs, int rt_index)

{

    BDRVQcowState *s = bs->opaque;

    uint64_t buf[RT_ENTRIES_PER_SECTOR];

    int rt_start_index;

    int i, ret;

    rt_start_index = rt_index & ~(RT_ENTRIES_PER_SECTOR - 1);

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

        buf[i] = cpu_to_be64(s->refcount_table[rt_start_index + i]);

    }

    ret = qcow2_pre_write_overlap_check(bs,

            QCOW2_OL_DEFAULT & ~QCOW2_OL_REFCOUNT_TABLE,

            s->refcount_table_offset + rt_start_index * sizeof(uint64_t),

            sizeof(buf));

    if (ret < 0) {

        return ret;

    }

    BLKDBG_EVENT(bs->file, BLKDBG_REFTABLE_UPDATE);

    ret = bdrv_pwrite_sync(bs->file, s->refcount_table_offset +

            rt_start_index * sizeof(uint64_t), buf, sizeof(buf));

    if (ret < 0) {

        return ret;

    }

    return 0;

}


int qemu_opts_id_wellformed(const char *id)

{

    int i;

    if (!qemu_isalpha(id[0])) {

        return 0;

    }

    for (i = 1; id[i]; i++) {

        if (!qemu_isalnum(id[i]) && !strchr("-._", id[i])) {

            return 0;

        }

    }

    return 1;

}


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

     /* We don't provide a receive callback */

+    s->nc.receive_disabled = 1;
+
+    s->chr = chr;
+
+

     qemu_chr_add_handlers(s->chr, NULL, NULL, net_vhost_user_event, s);

static int net_vhost_user_init(NetClientState *peer, const char *device,

                               const char *name, CharDriverState *chr)

{

    NetClientState *nc;

    VhostUserState *s;

    nc = qemu_new_net_client(&net_vhost_user_info, peer, device, name);

    snprintf(nc->info_str, sizeof(nc->info_str), "vhost-user to %s",

             chr->label);

    s = DO_UPCAST(VhostUserState, nc, nc);

    /* We don't provide a receive callback */

    s->nc.receive_disabled = 1;

    s->chr = chr;

    qemu_chr_add_handlers(s->chr, NULL, NULL, net_vhost_user_event, s);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 int ff_avfilter_graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx)
+
+{
+
+    int ret;
+

     /* find supported formats from sub-filters, and merge along links */

int ff_avfilter_graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx)

{

    int ret;

    /* find supported formats from sub-filters, and merge along links */

    if ((ret = query_formats(graph, log_ctx)) < 0)

        return ret;

    /* Once everything is merged, it's possible that we'll still have

     * multiple valid media format choices. We pick the first one. */

    pick_formats(graph);

    return 0;

}


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

+
     if (!ost)

         return 0;

static int ogg_restore(AVFormatContext *s, int discard)

{

    struct ogg *ogg = s->priv_data;

    AVIOContext *bc = s->pb;

    struct ogg_state *ost = ogg->state;

    int i;

    if (!ost)

        return 0;

    ogg->state = ost->next;

    if (!discard){

        for (i = 0; i < ogg->nstreams; i++)

            av_free (ogg->streams[i].buf);

        avio_seek (bc, ost->pos, SEEK_SET);

        ogg->curidx = ost->curidx;

        ogg->nstreams = ost->nstreams;

        memcpy(ogg->streams, ost->streams,

               ost->nstreams * sizeof(*ogg->streams));

    }

    av_free (ost);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void av_thread_message_queue_set_err_recv(AVThreadMessageQueue *mq,

                                           int err)
+
 {

 #if HAVE_THREADS

void av_thread_message_queue_set_err_recv(AVThreadMessageQueue *mq,

                                          int err)

{

#if HAVE_THREADS

    pthread_mutex_lock(&mq->lock);

    mq->err_recv = err;

    pthread_cond_broadcast(&mq->cond);

    pthread_mutex_unlock(&mq->lock);

#endif /* HAVE_THREADS */

}


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

     nut->last_syncpoint_pos = avio_tell(bc) - 8;

+

     end  = get_packetheader(nut, bc, 1, SYNCPOINT_STARTCODE);

static int decode_syncpoint(NUTContext *nut, int64_t *ts, int64_t *back_ptr)

{

    AVFormatContext *s = nut->avf;

    AVIOContext *bc    = s->pb;

    int64_t end;

    uint64_t tmp;

    nut->last_syncpoint_pos = avio_tell(bc) - 8;

    end  = get_packetheader(nut, bc, 1, SYNCPOINT_STARTCODE);

    end += avio_tell(bc);

    tmp       = ffio_read_varlen(bc);

    *back_ptr = nut->last_syncpoint_pos - 16 * ffio_read_varlen(bc);

    if (*back_ptr < 0)

        return -1;

    ff_nut_reset_ts(nut, nut->time_base[tmp % nut->time_base_count],

                    tmp / nut->time_base_count);

    if (skip_reserved(bc, end) || ffio_get_checksum(bc)) {

        av_log(s, AV_LOG_ERROR, "sync point checksum mismatch\n");

        return -1;

    }

    *ts = tmp / s->nb_streams *

          av_q2d(nut->time_base[tmp % s->nb_streams]) * AV_TIME_BASE;

    ff_nut_add_sp(nut, nut->last_syncpoint_pos, *back_ptr, *ts);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,5 +5,5 @@
     range->begin = range->end = 0;

     pci_for_each_device_under_bus(bus, pci_dev_get_w64, range);
+
+}

void pci_bus_get_w64_range(PCIBus *bus, Range *range)

{

    range->begin = range->end = 0;

    pci_for_each_device_under_bus(bus, pci_dev_get_w64, range);

}


--- a/source.c
+++ b/source.c
@@ -7,5 +7,5 @@
         completions[nb_completions++] = qemu_strdup(str);

     }
+
+}

static void add_completion(const char *str)

{

    if (nb_completions < NB_COMPLETIONS_MAX) {

        completions[nb_completions++] = qemu_strdup(str);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+static int libquvi_probe(AVProbeData *p)
+
+{
+
+    int score;
+
+    quvi_t q;
+
+    QUVIcode rc;

static int libquvi_probe(AVProbeData *p)

{

    int score;

    quvi_t q;

    QUVIcode rc;

    rc = quvi_init(&q);

    if (rc != QUVI_OK)

        return AVERROR(ENOMEM);

    score = quvi_supported(q, (char *)p->filename) == QUVI_OK ? AVPROBE_SCORE_EXTENSION : 0;

    quvi_close(&q);

    return score;

}


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

     saddr = g_new0(SocketAddressLegacy, 1);
+
+    saddr->type = SOCKET_ADDRESS_LEGACY_KIND_UNIX;
+
+    saddr->u.q_unix.data = g_new0(UnixSocketAddress, 1);
+
     saddr->u.q_unix.data->path = g_strdup(path);

static SocketAddressLegacy *unix_build_address(const char *path)

{

    SocketAddressLegacy *saddr;

    saddr = g_new0(SocketAddressLegacy, 1);

    saddr->type = SOCKET_ADDRESS_LEGACY_KIND_UNIX;

    saddr->u.q_unix.data = g_new0(UnixSocketAddress, 1);

    saddr->u.q_unix.data->path = g_strdup(path);

    return saddr;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static always_inline target_phys_addr_t get_pgaddr (target_phys_addr_t sdr1,
+
                                                     int sdr_sh,

                                                     target_phys_addr_t hash,

static always_inline target_phys_addr_t get_pgaddr (target_phys_addr_t sdr1,

                                                    int sdr_sh,

                                                    target_phys_addr_t hash,

                                                    target_phys_addr_t mask)

{

    return (sdr1 & ((target_ulong)(-1ULL) << sdr_sh)) | (hash & mask);

}


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

     ASFContext *asf = s->priv_data;

+
+
+    s->packet_size  = PACKET_SIZE;
+
+    s->max_interleave_delta = 0;

     asf->nb_packets = 0;

static int asf_write_header(AVFormatContext *s)

{

    ASFContext *asf = s->priv_data;

    s->packet_size  = PACKET_SIZE;

    s->max_interleave_delta = 0;

    asf->nb_packets = 0;

    asf->index_ptr             = av_malloc(sizeof(ASFIndex) * ASF_INDEX_BLOCK);

    asf->nb_index_memory_alloc = ASF_INDEX_BLOCK;

    asf->maximum_packet        = 0;

    /* the data-chunk-size has to be 50 (DATA_HEADER_SIZE), which is

     * data_size - asf->data_offset at the moment this function is done.

     * It is needed to use asf as a streamable format. */

    if (asf_write_header1(s, 0, DATA_HEADER_SIZE) < 0) {

        //av_free(asf);

        return -1;

    }

    avio_flush(s->pb);

    asf->packet_nb_payloads     = 0;

    asf->packet_timestamp_start = -1;

    asf->packet_timestamp_end   = -1;

    ffio_init_context(&asf->pb, asf->packet_buf, s->packet_size, 1,

                      NULL, NULL, NULL, NULL);

    if (s->avoid_negative_ts < 0)

        s->avoid_negative_ts = 1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     dbs->acb = NULL;

     dbs->bs = bs;
+
+    dbs->sg = sg;
+
+    dbs->sector_num = sector_num;
+
     dbs->sg_cur_index = 0;

     dbs->sg_cur_byte = 0;

BlockDriverAIOCB *dma_bdrv_io(

    BlockDriverState *bs, QEMUSGList *sg, uint64_t sector_num,

    DMAIOFunc *io_func, BlockDriverCompletionFunc *cb,

    void *opaque, DMADirection dir)

{

    DMAAIOCB *dbs = qemu_aio_get(&dma_aiocb_info, bs, cb, opaque);

    trace_dma_bdrv_io(dbs, bs, sector_num, (dir == DMA_DIRECTION_TO_DEVICE));

    dbs->acb = NULL;

    dbs->bs = bs;

    dbs->sg = sg;

    dbs->sector_num = sector_num;

    dbs->sg_cur_index = 0;

    dbs->sg_cur_byte = 0;

    dbs->dir = dir;

    dbs->io_func = io_func;

    dbs->bh = NULL;

    qemu_iovec_init(&dbs->iov, sg->nsg);

    dma_bdrv_cb(dbs, 0);

    return &dbs->common;

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     int height = FFMIN(avctx->height, C64YRES);

     int width  = FFMIN(avctx->width , C64XRES);
+
     uint8_t *src = p->data[0];

static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest)

{

    int blockx, blocky, x, y;

    int luma = 0;

    int height = FFMIN(avctx->height, C64YRES);

    int width  = FFMIN(avctx->width , C64XRES);

    uint8_t *src = p->data[0];

    for (blocky = 0; blocky < C64YRES; blocky += 8) {

        for (blockx = 0; blockx < C64XRES; blockx += 8) {

            for (y = blocky; y < blocky + 8 && y < C64YRES; y++) {

                for (x = blockx; x < blockx + 8 && x < C64XRES; x += 2) {

                    if(x < width && y < height) {

                        /* build average over 2 pixels */

                        luma = (src[(x + 0 + y * p->linesize[0])] +

                                src[(x + 1 + y * p->linesize[0])]) / 2;

                        /* write blocks as linear data now so they are suitable for elbg */

                        dest[0] = luma;

                    }

                    dest++;

                }

            }

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void memory_region_sync_dirty_bitmap(MemoryRegion *mr)

+{

     FlatRange *fr;

void memory_region_sync_dirty_bitmap(MemoryRegion *mr)

{

    FlatRange *fr;

    FOR_EACH_FLAT_RANGE(fr, &address_space_memory.current_map) {

        if (fr->mr == mr) {

            MEMORY_LISTENER_UPDATE_REGION(fr, &address_space_memory,

                                          Forward, log_sync);

        }

    }

}


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

     /* Determine the security model */
+
+    if (fs_ctx->fs_sm == SM_MAPPED) {

+        err = mkdir(rpath(fs_ctx, path), SM_LOCAL_DIR_MODE_BITS);

         if (err == -1) {

static int local_mkdir(FsContext *fs_ctx, const char *path, FsCred *credp)

{

    int err = -1;

    int serrno = 0;

    /* Determine the security model */

    if (fs_ctx->fs_sm == SM_MAPPED) {

        err = mkdir(rpath(fs_ctx, path), SM_LOCAL_DIR_MODE_BITS);

        if (err == -1) {

            return err;

        }

        credp->fc_mode = credp->fc_mode|S_IFDIR;

        err = local_set_xattr(rpath(fs_ctx, path), credp);

        if (err == -1) {

            serrno = errno;

            goto err_end;

        }

    } else if (fs_ctx->fs_sm == SM_PASSTHROUGH) {

        err = mkdir(rpath(fs_ctx, path), credp->fc_mode);

        if (err == -1) {

            return err;

        }

        err = local_post_create_passthrough(fs_ctx, path, credp);

        if (err == -1) {

            serrno = errno;

            goto err_end;

        }

    }

    return err;

err_end:

    remove(rpath(fs_ctx, path));

    errno = serrno;

    return err;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void fix_bitshift(ShortenContext *s, int32_t *buffer)

 {
+
     int i;

static void fix_bitshift(ShortenContext *s, int32_t *buffer)

{

    int i;

    if (s->bitshift != 0)

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

            buffer[s->nwrap + i] <<= s->bitshift;

}


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

     }
+
     if (data_dir_idx == ARRAY_SIZE(data_dir)) {

         return;

static void qemu_add_data_dir(const char *path)

{

    int i;

    if (path == NULL) {

        return;

    }

    if (data_dir_idx == ARRAY_SIZE(data_dir)) {

        return;

    }

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

        if (strcmp(data_dir[i], path) == 0) {

            return; /* duplicate */

        }

    }

    data_dir[data_dir_idx++] = path;

}


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

     if (level) {
+
         apic_local_deliver(s, APIC_LVT_LINT0);

     } else {

void apic_deliver_pic_intr(DeviceState *dev, int level)

{

    APICCommonState *s = APIC_COMMON(dev);

    if (level) {

        apic_local_deliver(s, APIC_LVT_LINT0);

    } else {

        uint32_t lvt = s->lvt[APIC_LVT_LINT0];

        switch ((lvt >> 8) & 7) {

        case APIC_DM_FIXED:

            if (!(lvt & APIC_LVT_LEVEL_TRIGGER))

                break;

            apic_reset_bit(s->irr, lvt & 0xff);

            /* fall through */

        case APIC_DM_EXTINT:

            cpu_reset_interrupt(CPU(s->cpu), CPU_INTERRUPT_HARD);

            break;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void gif_copy_img_rect(const uint32_t *src, uint32_t *dst,

                               int linesize, int l, int t, int w, int h)
+
 {

     const int y_start = t * linesize;

static void gif_copy_img_rect(const uint32_t *src, uint32_t *dst,

                              int linesize, int l, int t, int w, int h)

{

    const int y_start = t * linesize;

    const uint32_t *src_px, *src_pr,

                   *src_py = src + y_start,

                   *dst_py = dst + y_start;

    const uint32_t *src_pb = src_py + (t + h) * linesize;

    uint32_t *dst_px;

    for (; src_py < src_pb; src_py += linesize, dst_py += linesize) {

        src_px = src_py + l;

        dst_px = (uint32_t *)dst_py + l;

        src_pr = src_px + w;

        for (; src_px < src_pr; src_px++, dst_px++)

            *dst_px = *src_px;

    }

}


--- a/source.c
+++ b/source.c
@@ -37,11 +37,11 @@
         channel_subsys.crws_lost = false;

     }
+
+
+
+    QTAILQ_INSERT_TAIL(&channel_subsys.pending_crws, crw_cont, sibling);
+

     if (channel_subsys.do_crw_mchk) {

void css_queue_crw(uint8_t rsc, uint8_t erc, int chain, uint16_t rsid)

{

    CrwContainer *crw_cont;

    trace_css_crw(rsc, erc, rsid, chain ? "(chained)" : "");

    /* TODO: Maybe use a static crw pool? */

    crw_cont = g_try_malloc0(sizeof(CrwContainer));

    if (!crw_cont) {

        channel_subsys.crws_lost = true;

        return;

    }

    crw_cont->crw.flags = (rsc << 8) | erc;

    if (chain) {

        crw_cont->crw.flags |= CRW_FLAGS_MASK_C;

    }

    crw_cont->crw.rsid = rsid;

    if (channel_subsys.crws_lost) {

        crw_cont->crw.flags |= CRW_FLAGS_MASK_R;

        channel_subsys.crws_lost = false;

    }

    QTAILQ_INSERT_TAIL(&channel_subsys.pending_crws, crw_cont, sibling);

    if (channel_subsys.do_crw_mchk) {

        channel_subsys.do_crw_mchk = false;

        /* Inject crw pending machine check. */

        s390_crw_mchk();

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 int bdrv_all_goto_snapshot(const char *name, BlockDriverState **first_bad_bs)

+{
+
+    int err = 0;

     BlockDriverState *bs;

int bdrv_all_goto_snapshot(const char *name, BlockDriverState **first_bad_bs)

{

    int err = 0;

    BlockDriverState *bs;

    BdrvNextIterator *it = NULL;

    while (err == 0 && (it = bdrv_next(it, &bs))) {

        AioContext *ctx = bdrv_get_aio_context(bs);

        aio_context_acquire(ctx);

        if (bdrv_can_snapshot(bs)) {

            err = bdrv_snapshot_goto(bs, name);

        }

        aio_context_release(ctx);

    }

    *first_bad_bs = bs;

    return err;

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     le32_to_cpus(&set_label_data->offset);

     le32_to_cpus(&set_label_data->length);
+
+
+
+    nvdimm_debug("Write Label Data: offset %#x length %#x.\n",
+
                  set_label_data->offset, set_label_data->length);

static void nvdimm_dsm_set_label_data(NVDIMMDevice *nvdimm, NvdimmDsmIn *in,

                                      hwaddr dsm_mem_addr)

{

    NVDIMMClass *nvc = NVDIMM_GET_CLASS(nvdimm);

    NvdimmFuncSetLabelDataIn *set_label_data;

    uint32_t status;

    set_label_data = (NvdimmFuncSetLabelDataIn *)in->arg3;

    le32_to_cpus(&set_label_data->offset);

    le32_to_cpus(&set_label_data->length);

    nvdimm_debug("Write Label Data: offset %#x length %#x.\n",

                 set_label_data->offset, set_label_data->length);

    status = nvdimm_rw_label_data_check(nvdimm, set_label_data->offset,

                                        set_label_data->length);

    if (status != 0 /* Success */) {

        nvdimm_dsm_no_payload(status, dsm_mem_addr);

        return;

    }

    assert(offsetof(NvdimmDsmIn, arg3) +

           sizeof(*set_label_data) + set_label_data->length <= 4096);

    nvc->write_label_data(nvdimm, set_label_data->in_buf,

                          set_label_data->length, set_label_data->offset);

    nvdimm_dsm_no_payload(0 /* Success */, dsm_mem_addr);

}


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

+    if (w->num >= MAXIMUM_WAIT_OBJECTS)
+
+        return -1;
+
+    w->events[w->num] = handle;

     w->func[w->num] = func;

int qemu_add_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque)

{

    WaitObjects *w = &wait_objects;

    if (w->num >= MAXIMUM_WAIT_OBJECTS)

        return -1;

    w->events[w->num] = handle;

    w->func[w->num] = func;

    w->opaque[w->num] = opaque;

    w->num++;

    return 0;

}


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

+    assert(opts->type == NET_CLIENT_OPTIONS_KIND_VHOST_USER);
+
     vhost_user_opts = opts->u.vhost_user;

int net_init_vhost_user(const NetClientOptions *opts, const char *name,

                        NetClientState *peer, Error **errp)

{

    int queues;

    const NetdevVhostUserOptions *vhost_user_opts;

    CharDriverState *chr;

    assert(opts->type == NET_CLIENT_OPTIONS_KIND_VHOST_USER);

    vhost_user_opts = opts->u.vhost_user;

    chr = net_vhost_parse_chardev(vhost_user_opts, errp);

    if (!chr) {

        return -1;

    }

    /* verify net frontend */

    if (qemu_opts_foreach(qemu_find_opts("device"), net_vhost_check_net,

                          (char *)name, errp)) {

        return -1;

    }

    queues = vhost_user_opts->has_queues ? vhost_user_opts->queues : 1;

    if (queues < 1) {

        error_setg(errp,

                   "vhost-user number of queues must be bigger than zero");

        return -1;

    }

    return net_vhost_user_init(peer, "vhost_user", name, chr, queues);

}


static int ipvideo_decode_block_opcode_0xD(IpvideoContext *s)

{

    int y;

    unsigned char P[2];

    /* 4-color block encoding: each 4x4 block is a different color */

    CHECK_STREAM_PTR(4);

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

        if (!(y & 3)) {

            P[0] = *s->stream_ptr++;

            P[1] = *s->stream_ptr++;

        }

        memset(s->pixel_ptr,     P[0], 4);

        memset(s->pixel_ptr + 4, P[1], 4);

        s->pixel_ptr += s->stride;

    }

    /* report success */

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void process_incoming_migration_bh(void *opaque)
+{
+    Error *local_err = NULL;
+    MigrationIncomingState *mis = opaque;
+    /* Make sure all file formats flush their mutable metadata */
+    bdrv_invalidate_cache_all(&local_err);
         migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,
                           MIGRATION_STATUS_FAILED);
         error_report_err(local_err);

static void process_incoming_migration_bh(void *opaque)
{
    Error *local_err = NULL;
    MigrationIncomingState *mis = opaque;
    /* Make sure all file formats flush their mutable metadata */
    bdrv_invalidate_cache_all(&local_err);
        migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,
                          MIGRATION_STATUS_FAILED);
        error_report_err(local_err);
        migrate_decompress_threads_join();
        exit(EXIT_FAILURE);
    /*
     * This must happen after all error conditions are dealt with and
     * we're sure the VM is going to be running on this host.
     */
    qemu_announce_self();
    /* If global state section was not received or we are in running
       state, we need to obey autostart. Any other state is set with
       runstate_set. */
    if (!global_state_received() ||
        global_state_get_runstate() == RUN_STATE_RUNNING) {
        if (autostart) {
            vm_start();
        } else {
            runstate_set(RUN_STATE_PAUSED);
    } else {
        runstate_set(global_state_get_runstate());
    migrate_decompress_threads_join();
    /*
     * This must happen after any state changes since as soon as an external
     * observer sees this event they might start to prod at the VM assuming
     * it's ready to use.
     */
    migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,
                      MIGRATION_STATUS_COMPLETED);
    qemu_bh_delete(mis->bh);
    migration_incoming_state_destroy();


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

         bs = bs->file;

+    }
+
+
+
+    if (bs && bs->drv && bs->drv->bdrv_debug_is_suspended) {

         return bs->drv->bdrv_debug_is_suspended(bs, tag);

bool bdrv_debug_is_suspended(BlockDriverState *bs, const char *tag)

{

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

        bs = bs->file;

    }

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

        return bs->drv->bdrv_debug_is_suspended(bs, tag);

    }

    return false;

}


static void dec_modu(DisasContext *dc)

{

    int l1;

    LOG_DIS("modu r%d, r%d, %d\n", dc->r2, dc->r0, dc->r1);

    if (!(dc->env->features & LM32_FEATURE_DIVIDE)) {

        cpu_abort(dc->env, "hardware divider is not available\n");

    }

    l1 = gen_new_label();

    tcg_gen_brcondi_tl(TCG_COND_NE, cpu_R[dc->r1], 0, l1);

    tcg_gen_movi_tl(cpu_pc, dc->pc);

    t_gen_raise_exception(dc, EXCP_DIVIDE_BY_ZERO);

    gen_set_label(l1);

    tcg_gen_remu_tl(cpu_R[dc->r2], cpu_R[dc->r0], cpu_R[dc->r1]);

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
+static void user_async_cmd_handler(Monitor *mon, const mon_cmd_t *cmd,
+
+                                   const QDict *params)
+
+{
+
+    int ret;
+
+
+
     MonitorCompletionData *cb_data = g_malloc(sizeof(*cb_data));

     cb_data->mon = mon;

static void user_async_cmd_handler(Monitor *mon, const mon_cmd_t *cmd,

                                   const QDict *params)

{

    int ret;

    MonitorCompletionData *cb_data = g_malloc(sizeof(*cb_data));

    cb_data->mon = mon;

    cb_data->user_print = cmd->user_print;

    monitor_suspend(mon);

    ret = cmd->mhandler.cmd_async(mon, params,

                                  user_monitor_complete, cb_data);

    if (ret < 0) {

        monitor_resume(mon);

        g_free(cb_data);

    }

}


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

 {

+    value *= 1e9;
+
     value = MAX(0, MIN(UINT64_MAX, value));

     max_downtime = (uint64_t)value;

void qmp_migrate_set_downtime(double value, Error **errp)

{

    value *= 1e9;

    value = MAX(0, MIN(UINT64_MAX, value));

    max_downtime = (uint64_t)value;

}


--- a/source.c
+++ b/source.c
@@ -43,9 +43,9 @@
     if (loglevel & CPU_LOG_EXEC)

         CALL_FROM_TB2(do_mtc0_status_debug, old, val);
+
+    CALL_FROM_TB1(cpu_mips_update_irq, env);
+
+    RETURN();
+
 }

void op_mtc0_status (void)

{

    uint32_t val, old;

    uint32_t mask = env->Status_rw_bitmask;

    /* No reverse endianness, no MDMX/DSP, no 64bit ops

       implemented. */

    val = T0 & mask;

    old = env->CP0_Status;

    if (!(val & (1 << CP0St_EXL)) &&

        !(val & (1 << CP0St_ERL)) &&

        !(env->hflags & MIPS_HFLAG_DM) &&

        (val & (1 << CP0St_UM)))

        env->hflags |= MIPS_HFLAG_UM;

#ifdef TARGET_MIPS64

    if ((env->hflags & MIPS_HFLAG_UM) &&

        !(val & (1 << CP0St_PX)) &&

        !(val & (1 << CP0St_UX)))

        env->hflags &= ~MIPS_HFLAG_64;

#endif

    env->CP0_Status = (env->CP0_Status & ~mask) | val;

    if (loglevel & CPU_LOG_EXEC)

        CALL_FROM_TB2(do_mtc0_status_debug, old, val);

    CALL_FROM_TB1(cpu_mips_update_irq, env);

    RETURN();

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+void cpu_ppc_store_hdecr (CPUPPCState *env, uint32_t value)
+
 {

     PowerPCCPU *cpu = ppc_env_get_cpu(env);

void cpu_ppc_store_hdecr (CPUPPCState *env, uint32_t value)

{

    PowerPCCPU *cpu = ppc_env_get_cpu(env);

    _cpu_ppc_store_hdecr(cpu, cpu_ppc_load_hdecr(env), value, 0);

}


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

     } else if (desc->full && (dev->port->speedmask & USB_SPEED_MASK_FULL)) {

+        dev->speed = USB_SPEED_FULL;
+
+    } else {
+
+        return;

     }

void usb_desc_attach(USBDevice *dev)

{

    const USBDesc *desc = usb_device_get_usb_desc(dev);

    assert(desc != NULL);

    if (desc->super && (dev->port->speedmask & USB_SPEED_MASK_SUPER)) {

        dev->speed = USB_SPEED_SUPER;

    } else if (desc->high && (dev->port->speedmask & USB_SPEED_MASK_HIGH)) {

        dev->speed = USB_SPEED_HIGH;

    } else if (desc->full && (dev->port->speedmask & USB_SPEED_MASK_FULL)) {

        dev->speed = USB_SPEED_FULL;

    } else {

        return;

    }

    usb_desc_setdefaults(dev);

}


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

+{
+
     if (likely(T0 < 602)) {

 #ifdef USE_MFROM_ROM_TABLE
@@ -11,7 +11,7 @@
         T0 = mfrom_ROM_table[T0];

 #else
+
         double d;

         /* Extremly decomposed:

void do_op_602_mfrom (void)

{

    if (likely(T0 < 602)) {

#ifdef USE_MFROM_ROM_TABLE

#include "mfrom_table.c"

        T0 = mfrom_ROM_table[T0];

#else

        double d;

        /* Extremly decomposed:

         *                    -T0 / 256

         * T0 = 256 * log10(10          + 1.0) + 0.5

         */

        d = T0;

        d = float64_div(d, 256, &env->fp_status);

        d = float64_chs(d);

        d = exp10(d); // XXX: use float emulation function

        d = float64_add(d, 1.0, &env->fp_status);

        d = log10(d); // XXX: use float emulation function

        d = float64_mul(d, 256, &env->fp_status);

        d = float64_add(d, 0.5, &env->fp_status);

        T0 = float64_round_to_int(d, &env->fp_status);

#endif

    } else {

        T0 = 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -5,10 +5,10 @@
     ff_dlog(s, "%s", command);
     if (response)
         *response = NULL;
+    if ((err = ffurl_write(s->conn_control, command, strlen(command))) < 0)
+        return err;
+    if (!err)
+        return -1;
     /* return status */
     if (response_codes) {
         return ftp_status(s, response, response_codes);

static int ftp_send_command(FTPContext *s, const char *command,
                            const int response_codes[], char **response)
{
    int err;
    ff_dlog(s, "%s", command);
    if (response)
        *response = NULL;
    if ((err = ffurl_write(s->conn_control, command, strlen(command))) < 0)
        return err;
    if (!err)
        return -1;
    /* return status */
    if (response_codes) {
        return ftp_status(s, response, response_codes);
    }
    return 0;
}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void cpu_exit(CPUArchState *env)

 {
+
     CPUState *cpu = ENV_GET_CPU(env);

void cpu_exit(CPUArchState *env)

{

    CPUState *cpu = ENV_GET_CPU(env);

    cpu->exit_request = 1;

    cpu_unlink_tb(cpu);

}


--- a/source.c
+++ b/source.c
@@ -26,9 +26,9 @@
     acb = bdrv_aio_readv(req->dev->bs, sector, &req->qiov,

                          req->qiov.size / BDRV_SECTOR_SIZE,
+
+                         virtio_blk_rw_complete, req);
+
+    if (!acb) {
+

static void virtio_blk_handle_read(VirtIOBlockReq *req)

{

    BlockDriverAIOCB *acb;

    uint64_t sector;

    sector = ldq_p(&req->out->sector);

    if (sector & req->dev->sector_mask) {

    acb = bdrv_aio_readv(req->dev->bs, sector, &req->qiov,

                         req->qiov.size / BDRV_SECTOR_SIZE,

                         virtio_blk_rw_complete, req);

    if (!acb) {


static void intel_hda_parse_bdl(IntelHDAState *d, IntelHDAStream *st)

{

    target_phys_addr_t addr;

    uint8_t buf[16];

    uint32_t i;

    addr = intel_hda_addr(st->bdlp_lbase, st->bdlp_ubase);

    st->bentries = st->lvi +1;

    g_free(st->bpl);

    st->bpl = g_malloc(sizeof(bpl) * st->bentries);

    for (i = 0; i < st->bentries; i++, addr += 16) {

        pci_dma_read(&d->pci, addr, buf, 16);

        st->bpl[i].addr  = le64_to_cpu(*(uint64_t *)buf);

        st->bpl[i].len   = le32_to_cpu(*(uint32_t *)(buf + 8));

        st->bpl[i].flags = le32_to_cpu(*(uint32_t *)(buf + 12));

        dprint(d, 1, "bdl/%d: 0x%" PRIx64 " +0x%x, 0x%x\n",

               i, st->bpl[i].addr, st->bpl[i].len, st->bpl[i].flags);

    }

    st->bsize = st->cbl;

    st->lpib  = 0;

    st->be    = 0;

    st->bp    = 0;

}


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

 {

+    TestStruct *p = NULL;
+
     Error *err = NULL;

     Visitor *v;

static void test_validate_fail_struct(TestInputVisitorData *data,

                                       const void *unused)

{

    TestStruct *p = NULL;

    Error *err = NULL;

    Visitor *v;

    v = validate_test_init(data, "{ 'integer': -42, 'boolean': true, 'string': 'foo', 'extra': 42 }");

    visit_type_TestStruct(v, &p, NULL, &err);

    g_assert(err);

    error_free(err);

    if (p) {

        g_free(p->string);

    }

    g_free(p);

}


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

     PIIX3State *piix3 = opaque;
+
+
+
+    for (i = 0; i < ARRAY_SIZE(piix3->pci_irq_levels_vmstate); i++) {
+
         piix3->pci_irq_levels_vmstate[i] =

             pci_bus_get_irq_level(piix3->dev.bus, i);

static int piix3_pre_save(void *opaque)

{

    int i;

    PIIX3State *piix3 = opaque;

    for (i = 0; i < ARRAY_SIZE(piix3->pci_irq_levels_vmstate); i++) {

        piix3->pci_irq_levels_vmstate[i] =

            pci_bus_get_irq_level(piix3->dev.bus, i);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     if (dev->state != DEV_STATE_CREATED) {

         error_set(errp, QERR_PERMISSION_DENIED);
+
+        return;
+
+    }
+

     visit_type_enum(v, ptr, prop->info->enum_table,

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

                     const char *name, Error **errp)

{

    DeviceState *dev = DEVICE(obj);

    Property *prop = opaque;

    int *ptr = qdev_get_prop_ptr(dev, prop);

    if (dev->state != DEV_STATE_CREATED) {

        error_set(errp, QERR_PERMISSION_DENIED);

        return;

    }

    visit_type_enum(v, ptr, prop->info->enum_table,

                    prop->info->name, prop->name, errp);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void test_io_channel_ipv4_fd(void)
 {
+    QIOChannel *ioc;
+    int fd = -1;
     fd = socket(AF_INET, SOCK_STREAM, 0);
     g_assert_cmpint(fd, >, -1);
     ioc = qio_channel_new_fd(fd, &error_abort);

static void test_io_channel_ipv4_fd(void)
{
    QIOChannel *ioc;
    int fd = -1;
    fd = socket(AF_INET, SOCK_STREAM, 0);
    g_assert_cmpint(fd, >, -1);
    ioc = qio_channel_new_fd(fd, &error_abort);
    g_assert_cmpstr(object_get_typename(OBJECT(ioc)),
                    ==,
                    TYPE_QIO_CHANNEL_SOCKET);
    object_unref(OBJECT(ioc));


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

+    CPUMIPSState *other_cpu = first_cpu;
+
+    target_ulong prev = env->mvp->CP0_MVPControl;

+
+
     do {

         /* Turn off all VPEs except the one executing the dvpe.  */

target_ulong helper_dvpe(CPUMIPSState *env)

{

    CPUMIPSState *other_cpu = first_cpu;

    target_ulong prev = env->mvp->CP0_MVPControl;

    do {

        /* Turn off all VPEs except the one executing the dvpe.  */

        if (other_cpu != env) {

            other_cpu->mvp->CP0_MVPControl &= ~(1 << CP0MVPCo_EVP);

            mips_vpe_sleep(other_cpu);

        }

        other_cpu = other_cpu->next_cpu;

    } while (other_cpu);

    return prev;

}


--- a/source.c
+++ b/source.c
@@ -5,5 +5,5 @@
     return (s->compat_flags & E1000_FLAG_AUTONEG) &&

            (s->phy_reg[PHY_CTRL] & MII_CR_AUTO_NEG_EN);
+
+}

have_autoneg(E1000State *s)

{

    return (s->compat_flags & E1000_FLAG_AUTONEG) &&

           (s->phy_reg[PHY_CTRL] & MII_CR_AUTO_NEG_EN);

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     int keycode = qemu_input_key_value_to_number(value);

     int count = 0;
+
+
+
+    if (value->type == KEY_VALUE_KIND_QCODE &&
+
         value->u.qcode == Q_KEY_CODE_PAUSE) {

         /* specific case */

int qemu_input_key_value_to_scancode(const KeyValue *value, bool down,

                                     int *codes)

{

    int keycode = qemu_input_key_value_to_number(value);

    int count = 0;

    if (value->type == KEY_VALUE_KIND_QCODE &&

        value->u.qcode == Q_KEY_CODE_PAUSE) {

        /* specific case */

        int v = down ? 0 : 0x80;

        codes[count++] = 0xe1;

        codes[count++] = 0x1d | v;

        codes[count++] = 0x45 | v;

        return count;

    }

    if (keycode & SCANCODE_GREY) {

        codes[count++] = SCANCODE_EMUL0;

        keycode &= ~SCANCODE_GREY;

    }

    if (!down) {

        keycode |= SCANCODE_UP;

    }

    codes[count++] = keycode;

    return count;

}


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

     DIR *dir;

+

     if ((dir = opendir(path->pathname)) != NULL) {

static struct pathelem *add_dir_maybe(struct pathelem *path)

{

    DIR *dir;

    if ((dir = opendir(path->pathname)) != NULL) {

        struct dirent *dirent;

        while ((dirent = readdir(dir)) != NULL) {

            if (!streq(dirent->d_name,".") && !streq(dirent->d_name,"..")){

                path = add_entry(path, dirent->d_name);

            }

        }

        closedir(dir);

    }

    return path;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void serial_exit_core(SerialState *s)
 {
     qemu_chr_fe_deinit(&s->chr);
+    qemu_unregister_reset(serial_reset, s);
 }

void serial_exit_core(SerialState *s)
{
    qemu_chr_fe_deinit(&s->chr);
    qemu_unregister_reset(serial_reset, s);
}


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

     s->packet_transfer_size = size;

+    s->io_buffer_size = size;    /* dma: send the reply data as one chunk */
+
+    s->elementary_transfer_size = 0;
+
+    s->io_buffer_index = 0;

static void ide_atapi_cmd_reply(IDEState *s, int size, int max_size)

{

    if (size > max_size)

        size = max_size;

    s->lba = -1; /* no sector read */

    s->packet_transfer_size = size;

    s->io_buffer_size = size;    /* dma: send the reply data as one chunk */

    s->elementary_transfer_size = 0;

    s->io_buffer_index = 0;

    if (s->atapi_dma) {

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

                         BLOCK_ACCT_READ);

        s->status = READY_STAT | SEEK_STAT | DRQ_STAT;

        ide_start_dma(s, ide_atapi_cmd_read_dma_cb);

    } else {

        s->status = READY_STAT | SEEK_STAT;

        ide_atapi_cmd_reply_end(s);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 yuv2plane1_16_c_template(const int32_t *src, uint16_t *dest, int dstW,

+                         int big_endian, int output_bits)

 {

yuv2plane1_16_c_template(const int32_t *src, uint16_t *dest, int dstW,

                         int big_endian, int output_bits)

{

    int i;

    int shift = 19 - output_bits;

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

        int val = src[i] + (1 << (shift - 1));

        output_pixel(&dest[i], val, 0, uint);

    }

}


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

     if(!graph)

+        return r;

int avfilter_graph_send_command(AVFilterGraph *graph, const char *target, const char *cmd, const char *arg, char *res, int res_len, int flags)

{

    int i, r = AVERROR(ENOSYS);

    if(!graph)

        return r;

    if((flags & AVFILTER_CMD_FLAG_ONE) && !(flags & AVFILTER_CMD_FLAG_FAST)) {

        r=avfilter_graph_send_command(graph, target, cmd, arg, res, res_len, flags | AVFILTER_CMD_FLAG_FAST);

        if(r != AVERROR(ENOSYS))

            return r;

    }

    if(res_len && res)

        res[0]= 0;

    for (i = 0; i < graph->filter_count; i++) {

        AVFilterContext *filter = graph->filters[i];

        if(!strcmp(target, "all") || !strcmp(target, filter->name) || !strcmp(target, filter->filter->name)){

            r = avfilter_process_command(filter, cmd, arg, res, res_len, flags);

            if(r != AVERROR(ENOSYS)) {

                if((flags & AVFILTER_CMD_FLAG_ONE) || r<0)

                    return r;

            }

        }

    }

    return r;

}


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

                            DESC_CS_MASK | DESC_R_MASK | DESC_A_MASK);
+
+    cpu_x86_load_seg_cache(env, R_SS, (env->sysenter_cs + 8) & 0xfffc,
+
+                           0, 0xffffffff,
+
                            DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |

                            DESC_S_MASK |

void helper_sysenter(void)

{

    if (env->sysenter_cs == 0) {

        raise_exception_err(EXCP0D_GPF, 0);

    }

    env->eflags &= ~(VM_MASK | IF_MASK | RF_MASK);

    cpu_x86_set_cpl(env, 0);

    cpu_x86_load_seg_cache(env, R_CS, env->sysenter_cs & 0xfffc,

                           0, 0xffffffff,

                           DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |

                           DESC_S_MASK |

                           DESC_CS_MASK | DESC_R_MASK | DESC_A_MASK);

    cpu_x86_load_seg_cache(env, R_SS, (env->sysenter_cs + 8) & 0xfffc,

                           0, 0xffffffff,

                           DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |

                           DESC_S_MASK |

                           DESC_W_MASK | DESC_A_MASK);

    ESP = env->sysenter_esp;

    EIP = env->sysenter_eip;

}


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

     cc->dump_state = tricore_cpu_dump_state;
+
+    cc->set_pc = tricore_cpu_set_pc;
+
+    cc->synchronize_from_tb = tricore_cpu_synchronize_from_tb;
+

 }

static void tricore_cpu_class_init(ObjectClass *c, void *data)

{

    TriCoreCPUClass *mcc = TRICORE_CPU_CLASS(c);

    CPUClass *cc = CPU_CLASS(c);

    DeviceClass *dc = DEVICE_CLASS(c);

    mcc->parent_realize = dc->realize;

    dc->realize = tricore_cpu_realizefn;

    mcc->parent_reset = cc->reset;

    cc->reset = tricore_cpu_reset;

    cc->class_by_name = tricore_cpu_class_by_name;

    cc->has_work = tricore_cpu_has_work;

    cc->dump_state = tricore_cpu_dump_state;

    cc->set_pc = tricore_cpu_set_pc;

    cc->synchronize_from_tb = tricore_cpu_synchronize_from_tb;

}


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

                                       void (*access)(MemoryRegion *mr,

+                                                     hwaddr addr,
+
+                                                     uint64_t *value,
+
+                                                     unsigned size,

                                                      unsigned shift,

static void access_with_adjusted_size(hwaddr addr,

                                      uint64_t *value,

                                      unsigned size,

                                      unsigned access_size_min,

                                      unsigned access_size_max,

                                      void (*access)(MemoryRegion *mr,

                                                     hwaddr addr,

                                                     uint64_t *value,

                                                     unsigned size,

                                                     unsigned shift,

                                                     uint64_t mask),

                                      MemoryRegion *mr)

{

    uint64_t access_mask;

    unsigned access_size;

    unsigned i;

    if (!access_size_min) {

        access_size_min = 1;

    }

    if (!access_size_max) {

        access_size_max = 4;

    }

    /* FIXME: support unaligned access? */

    access_size = MAX(MIN(size, access_size_max), access_size_min);

    access_mask = -1ULL >> (64 - access_size * 8);

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

#ifdef TARGET_WORDS_BIGENDIAN

        access(mr, addr + i, value, access_size,

               (size - access_size - i) * 8, access_mask);

#else

        access(mr, addr + i, value, access_size, i * 8, access_mask);

#endif

    }

}


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

 {

+    spapr->epow_irq = spapr_allocate_msi(0);

     spapr->epow_notifier.notify = spapr_powerdown_req;

void spapr_events_init(sPAPREnvironment *spapr)

{

    spapr->epow_irq = spapr_allocate_msi(0);

    spapr->epow_notifier.notify = spapr_powerdown_req;

    qemu_register_powerdown_notifier(&spapr->epow_notifier);

    spapr_rtas_register("check-exception", check_exception);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void gen_mfsri(DisasContext *ctx)
+
+{

 #if defined(CONFIG_USER_ONLY)
+
+    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

 #else

@@ -14,7 +14,7 @@

     TCGv t0;

+    if (unlikely(ctx->pr)) {

         gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

static void gen_mfsri(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

#else

    int ra = rA(ctx->opcode);

    int rd = rD(ctx->opcode);

    TCGv t0;

    if (unlikely(ctx->pr)) {

        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

        return;

    }

    t0 = tcg_temp_new();

    gen_addr_reg_index(ctx, t0);

    tcg_gen_shri_tl(t0, t0, 28);

    tcg_gen_andi_tl(t0, t0, 0xF);

    gen_helper_load_sr(cpu_gpr[rd], cpu_env, t0);

    tcg_temp_free(t0);

    if (ra != 0 && ra != rd)

        tcg_gen_mov_tl(cpu_gpr[ra], cpu_gpr[rd]);

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void virtio_rng_process(VirtIORNG *vrng)
+
+{
+
+    size_t size;
+

     if (!is_guest_ready(vrng)) {

static void virtio_rng_process(VirtIORNG *vrng)

{

    size_t size;

    if (!is_guest_ready(vrng)) {

        return;

    }

    size = get_request_size(vrng->vq);

    size = MIN(vrng->quota_remaining, size);

    if (size) {

        rng_backend_request_entropy(vrng->rng, size, chr_read, vrng);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 int avpriv_unlock_avformat(void)
+
+{

+    if (lockmgr_cb) {

         if ((*lockmgr_cb)(&avformat_mutex, AV_LOCK_RELEASE))

int avpriv_unlock_avformat(void)

{

    if (lockmgr_cb) {

        if ((*lockmgr_cb)(&avformat_mutex, AV_LOCK_RELEASE))

            return -1;

    }

    return 0;

}


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

             g_malloc0(sizeof(struct omap_mmc_s));

+
+
+    s->irq = irq;
+
+    s->dma = dma;

     s->clk = fclk;

struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,

                BlockDriverState *bd, qemu_irq irq, qemu_irq dma[],

                omap_clk fclk, omap_clk iclk)

{

    struct omap_mmc_s *s = (struct omap_mmc_s *)

            g_malloc0(sizeof(struct omap_mmc_s));

    s->irq = irq;

    s->dma = dma;

    s->clk = fclk;

    s->lines = 4;

    s->rev = 2;

    omap_mmc_reset(s);

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

                          omap_l4_region_size(ta, 0));

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

    /* Instantiate the storage */

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

    if (s->card == NULL) {

        exit(1);

    }

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

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

    return s;

}


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

 {

+    hbitmap_iter_init(hbi, bitmap->bitmap, 0);

 }

void bdrv_dirty_iter_init(BdrvDirtyBitmap *bitmap, HBitmapIter *hbi)

{

    hbitmap_iter_init(hbi, bitmap->bitmap, 0);

}


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

 {


--- a/source.c
+++ b/source.c
@@ -1,25 +1,25 @@
+static int inc_refcounts(BlockDriverState *bs,

                           uint16_t *refcount_table,

+                          int refcount_table_size,
+
                           int64_t offset, int64_t size)

 {

     BDRVQcowState *s = bs->opaque;
+
     int64_t start, last, cluster_offset;
+
     int k;

     int errors = 0;
+

     if (size <= 0)
+
         return 0;

static int inc_refcounts(BlockDriverState *bs,

                          uint16_t *refcount_table,

                          int refcount_table_size,

                          int64_t offset, int64_t size)

{

    BDRVQcowState *s = bs->opaque;

    int64_t start, last, cluster_offset;

    int k;

    int errors = 0;

    if (size <= 0)

        return 0;

    start = offset & ~(s->cluster_size - 1);

    last = (offset + size - 1) & ~(s->cluster_size - 1);

    for(cluster_offset = start; cluster_offset <= last;

        cluster_offset += s->cluster_size) {

        k = cluster_offset >> s->cluster_bits;

        if (k < 0 || k >= refcount_table_size) {

            fprintf(stderr, "ERROR: invalid cluster offset=0x%" PRIx64 "\n",

                cluster_offset);

            errors++;

        } else {

            if (++refcount_table[k] == 0) {

                fprintf(stderr, "ERROR: overflow cluster offset=0x%" PRIx64

                    "\n", cluster_offset);

                errors++;

            }

        }

    }

    return errors;

}


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

 {

+    QObject *data;

     Monitor *mon = opaque;

static void monitor_qmp_event(void *opaque, int event)

{

    QObject *data;

    Monitor *mon = opaque;

    switch (event) {

    case CHR_EVENT_OPENED:

        mon->qmp.in_command_mode = false;

        data = get_qmp_greeting();

        monitor_json_emitter(mon, data);

        qobject_decref(data);

        mon_refcount++;

        break;

    case CHR_EVENT_CLOSED:

        json_message_parser_destroy(&mon->qmp.parser);

        json_message_parser_init(&mon->qmp.parser, handle_qmp_command);

        mon_refcount--;

        monitor_fdsets_cleanup();

        break;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
+static void blkverify_aio_cb(void *opaque, int ret)
+
+{
+
+    BlkverifyAIOCB *acb = opaque;
+
+

+    switch (++acb->done) {
+
     case 1:
+
         acb->ret = ret;

         break;

static void blkverify_aio_cb(void *opaque, int ret)

{

    BlkverifyAIOCB *acb = opaque;

    switch (++acb->done) {

    case 1:

        acb->ret = ret;

        break;

    case 2:

        if (acb->ret != ret) {

            blkverify_err(acb, "return value mismatch %d != %d", acb->ret, ret);

        }

        if (acb->verify) {

            acb->verify(acb);

        }

        aio_bh_schedule_oneshot(bdrv_get_aio_context(acb->common.bs),

                                blkverify_aio_bh, acb);

        break;

    }

}


--- a/source.c
+++ b/source.c
@@ -9,9 +9,9 @@
     trace_bdrv_aio_writev(bs, sector_num, nb_sectors, opaque);

+
+    return bdrv_co_aio_rw_vector(bs, sector_num, qiov, nb_sectors, 0,
+
+                                 cb, opaque, true);

 }

BlockAIOCB *bdrv_aio_writev(BlockDriverState *bs, int64_t sector_num,

                            QEMUIOVector *qiov, int nb_sectors,

                            BlockCompletionFunc *cb, void *opaque)

{

    trace_bdrv_aio_writev(bs, sector_num, nb_sectors, opaque);

    return bdrv_co_aio_rw_vector(bs, sector_num, qiov, nb_sectors, 0,

                                 cb, opaque, true);

}


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

         fprintf(stderr, "%s: stray LMP_accepted received, fixme\n",
+
+                        __func__);
+
+    exit(-1);

 }

static void bt_dummy_lmp_connection_complete(struct bt_link_s *link)

{

    if (link->slave->reject_reason)

        fprintf(stderr, "%s: stray LMP_not_accepted received, fixme\n",

                        __func__);

    else

        fprintf(stderr, "%s: stray LMP_accepted received, fixme\n",

                        __func__);

    exit(-1);

}


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

         }

+        if (ret & BDRV_BLOCK_ZERO) {
+
+            sector_num += n;
+
+            continue;

         }

int bdrv_make_zero(BlockDriverState *bs, BdrvRequestFlags flags)

{

    int64_t target_sectors, ret, nb_sectors, sector_num = 0;

    int n;

    target_sectors = bdrv_nb_sectors(bs);

    if (target_sectors < 0) {

        return target_sectors;

    }

    for (;;) {

        nb_sectors = target_sectors - sector_num;

        if (nb_sectors <= 0) {

            return 0;

        }

        if (nb_sectors > INT_MAX / BDRV_SECTOR_SIZE) {

            nb_sectors = INT_MAX / BDRV_SECTOR_SIZE;

        }

        ret = bdrv_get_block_status(bs, sector_num, nb_sectors, &n);

        if (ret < 0) {

            error_report("error getting block status at sector %" PRId64 ": %s",

                         sector_num, strerror(-ret));

            return ret;

        }

        if (ret & BDRV_BLOCK_ZERO) {

            sector_num += n;

            continue;

        }

        ret = bdrv_write_zeroes(bs, sector_num, n, flags);

        if (ret < 0) {

            error_report("error writing zeroes at sector %" PRId64 ": %s",

                         sector_num, strerror(-ret));

            return ret;

        }

        sector_num += n;

    }

}


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

+    return s->compat_flags & E1000_FLAG_MIT;
+
 }

static bool e1000_mit_state_needed(void *opaque)

{

    E1000State *s = opaque;

    return s->compat_flags & E1000_FLAG_MIT;

}


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

         }

+        return shift;
+
+    }
+
+

     /* We have a kernel that predates the htab reset calls.  For PR

int kvmppc_reset_htab(int shift_hint)

{

    uint32_t shift = shift_hint;

    if (!kvm_enabled()) {

        /* Full emulation, tell caller to allocate htab itself */

        return 0;

    }

    if (kvm_check_extension(kvm_state, KVM_CAP_PPC_ALLOC_HTAB)) {

        int ret;

        ret = kvm_vm_ioctl(kvm_state, KVM_PPC_ALLOCATE_HTAB, &shift);

        if (ret == -ENOTTY) {

            /* At least some versions of PR KVM advertise the

             * capability, but don't implement the ioctl().  Oops.

             * Return 0 so that we allocate the htab in qemu, as is

             * correct for PR. */

            return 0;

        } else if (ret < 0) {

            return ret;

        }

        return shift;

    }

    /* We have a kernel that predates the htab reset calls.  For PR

     * KVM, we need to allocate the htab ourselves, for an HV KVM of

     * this era, it has allocated a 16MB fixed size hash table

     * already.  Kernels of this era have the GET_PVINFO capability

     * only on PR, so we use this hack to determine the right

     * answer */

    if (kvm_check_extension(kvm_state, KVM_CAP_PPC_GET_PVINFO)) {

        /* PR - tell caller to allocate htab */

        return 0;

    } else {

        /* HV - assume 16MB kernel allocated htab */

        return 24;

    }

}


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

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

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

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

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

                   int parity, int tff)

{

    YADIFContext *yadif = ctx->priv;

    int y, i;

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

        int w = dstpic->video->w;

        int h = dstpic->video->h;

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

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

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

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

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

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

        }

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

            if ((y ^ parity) & 1) {

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

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

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

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

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

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

            } else {

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

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

            }

        }

    }

    emms_c();

}


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

 {

+    while (tags->id != 0) {
+
+        if (!tags->invalid_asf && tags->id == id)
+
             return tags->tag;

         tags++;

static unsigned int codec_get_asf_tag(const CodecTag *tags, unsigned int id)

{

    while (tags->id != 0) {

        if (!tags->invalid_asf && tags->id == id)

            return tags->tag;

        tags++;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+av_cold void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx)
+
+{
+
     int i;

     ff_iir_filter_free_coeffs(ctx->fcoeffs);

av_cold void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx)

{

    int i;

    ff_iir_filter_free_coeffs(ctx->fcoeffs);

    if (ctx->fstate)

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

            ff_iir_filter_free_state(ctx->fstate[i]);

    av_freep(&ctx->fstate);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static uint64_t tmu2_read(void *opaque, target_phys_addr_t addr,

                           unsigned size)
+
+{
+
+    MilkymistTMU2State *s = opaque;
+
     uint32_t r = 0;

static uint64_t tmu2_read(void *opaque, target_phys_addr_t addr,

                          unsigned size)

{

    MilkymistTMU2State *s = opaque;

    uint32_t r = 0;

    addr >>= 2;

    switch (addr) {

    case R_CTL:

    case R_HMESHLAST:

    case R_VMESHLAST:

    case R_BRIGHTNESS:

    case R_CHROMAKEY:

    case R_VERTICESADDR:

    case R_TEXFBUF:

    case R_TEXHRES:

    case R_TEXVRES:

    case R_TEXHMASK:

    case R_TEXVMASK:

    case R_DSTFBUF:

    case R_DSTHRES:

    case R_DSTVRES:

    case R_DSTHOFFSET:

    case R_DSTVOFFSET:

    case R_DSTSQUAREW:

    case R_DSTSQUAREH:

    case R_ALPHA:

        r = s->regs[addr];

        break;

    default:

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

                TARGET_FMT_plx, addr << 2);

        break;

    }

    trace_milkymist_tmu2_memory_read(addr << 2, r);

    return r;

}