--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+int init_vlc(VLC *vlc, int nb_bits, int nb_codes,

+             const void *bits, int bits_wrap, int bits_size,
+
+             const void *codes, int codes_wrap, int codes_size)

+{

     vlc->bits = nb_bits;

int init_vlc(VLC *vlc, int nb_bits, int nb_codes,

             const void *bits, int bits_wrap, int bits_size,

             const void *codes, int codes_wrap, int codes_size)

{

    vlc->bits = nb_bits;

    vlc->table = NULL;

    vlc->table_allocated = 0;

    vlc->table_size = 0;

#ifdef DEBUG_VLC

    printf("build table nb_codes=%d\n", nb_codes);

#endif

    if (build_table(vlc, nb_bits, nb_codes,

                    bits, bits_wrap, bits_size,

                    codes, codes_wrap, codes_size,

                    0, 0) < 0) {

        av_free(vlc->table);

        return -1;

    }

    return 0;

}


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

     se->vmsd = NULL;

+
+
+    if (instance_id == -1) {
+
+        se->instance_id = calculate_new_instance_id(idstr);

     } else {

int register_savevm_live(const char *idstr,

                         int instance_id,

                         int version_id,

                         SaveLiveStateHandler *save_live_state,

                         SaveStateHandler *save_state,

                         LoadStateHandler *load_state,

                         void *opaque)

{

    SaveStateEntry *se;

    se = qemu_malloc(sizeof(SaveStateEntry));

    pstrcpy(se->idstr, sizeof(se->idstr), idstr);

    se->version_id = version_id;

    se->section_id = global_section_id++;

    se->save_live_state = save_live_state;

    se->save_state = save_state;

    se->load_state = load_state;

    se->opaque = opaque;

    se->vmsd = NULL;

    if (instance_id == -1) {

        se->instance_id = calculate_new_instance_id(idstr);

    } else {

        se->instance_id = instance_id;

    }

    /* add at the end of list */

    TAILQ_INSERT_TAIL(&savevm_handlers, se, entry);

    return 0;

}


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

     do {

+        ret = qemu_savevm_state_iterate(f);
+
+        if (ret < 0)
+
+            goto out;

     } while (ret == 0);

int qemu_savevm_state(QEMUFile *f)

{

    int saved_vm_running;

    int ret;

    saved_vm_running = vm_running;

    vm_stop(0);

    ret = qemu_savevm_state_begin(f);

    if (ret < 0)

        goto out;

    do {

        ret = qemu_savevm_state_iterate(f);

        if (ret < 0)

            goto out;

    } while (ret == 0);

    ret = qemu_savevm_state_complete(f);

out:

    if (saved_vm_running)

        vm_start();

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void fw_cfg_boot_set(void *opaque, const char *boot_device,
+
                             Error **errp)

 {

static void fw_cfg_boot_set(void *opaque, const char *boot_device,

                            Error **errp)

{

    fw_cfg_add_i16(opaque, FW_CFG_BOOT_DEVICE, boot_device[0]);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static int shall_we_drop(AVFormatContext *s, int index)

 {

     struct dshow_ctx *ctx = s->priv_data;

+    static const uint8_t dropscore[] = {62, 75, 87, 100};

     const int ndropscores = FF_ARRAY_ELEMS(dropscore);

static int shall_we_drop(AVFormatContext *s, int index)

{

    struct dshow_ctx *ctx = s->priv_data;

    static const uint8_t dropscore[] = {62, 75, 87, 100};

    const int ndropscores = FF_ARRAY_ELEMS(dropscore);

    unsigned int buffer_fullness = (ctx->curbufsize[index]*100)/s->max_picture_buffer;

    if(dropscore[++ctx->video_frame_num%ndropscores] <= buffer_fullness) {

        av_log(s, AV_LOG_ERROR,

              "real-time buffer[%d] too full (%d%% of size: %d)! frame dropped!\n", index, buffer_fullness, s->max_picture_buffer);

        return 1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static ram_addr_t qxl_rom_size(void)
+
 {
+
+    uint32_t required_rom_size = sizeof(QXLRom) + sizeof(QXLModes) +

                                  sizeof(qxl_modes);

static ram_addr_t qxl_rom_size(void)

{

    uint32_t required_rom_size = sizeof(QXLRom) + sizeof(QXLModes) +

                                 sizeof(qxl_modes);

    uint32_t rom_size = 8192; /* two pages */

    QEMU_BUILD_BUG_ON(required_rom_size > rom_size);

    return rom_size;

}


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

     QEMUFileStdio *s;
+

     if (qemu_file_mode_is_not_valid(mode)) {

QEMUFile *qemu_fopen(const char *filename, const char *mode)

{

    QEMUFileStdio *s;

    if (qemu_file_mode_is_not_valid(mode)) {

        return NULL;

    }

    s = g_malloc0(sizeof(QEMUFileStdio));

    s->stdio_file = fopen(filename, mode);

    if (!s->stdio_file) {

        goto fail;

    }

    if (mode[0] == 'w') {

        s->file = qemu_fopen_ops(s, &stdio_file_write_ops);

    } else {

        s->file = qemu_fopen_ops(s, &stdio_file_read_ops);

    }

    return s->file;

fail:

    g_free(s);

    return NULL;

}


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

     qemu_opts_del(dinfo->opts);

+    bdrv_delete(dinfo->bdrv);
+
+
     QTAILQ_REMOVE(&drives, dinfo, next);

     qemu_free(dinfo);

static void drive_uninit(DriveInfo *dinfo)

{

    qemu_opts_del(dinfo->opts);

    bdrv_delete(dinfo->bdrv);

    QTAILQ_REMOVE(&drives, dinfo, next);

    qemu_free(dinfo);

}


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

     ret = avctx->codec->init(avctx);

+    if (ret < 0) {
+
+        av_freep(&avctx->priv_data);
+
+        return ret;

     }

int avcodec_open(AVCodecContext *avctx, AVCodec *codec)

{

    int ret;

    if(avctx->codec)

        return -1;

    avctx->codec = codec;

    avctx->codec_id = codec->id;

    avctx->frame_number = 0;

    if (codec->priv_data_size > 0) {

        avctx->priv_data = av_mallocz(codec->priv_data_size);

        if (!avctx->priv_data)

            return -ENOMEM;

    } else {

        avctx->priv_data = NULL;

    }

    if(avctx->coded_width && avctx->coded_height)

        avcodec_set_dimensions(avctx, avctx->coded_width, avctx->coded_height);

    else if(avctx->width && avctx->height)

        avcodec_set_dimensions(avctx, avctx->width, avctx->height);

    if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height)){

        av_freep(&avctx->priv_data);

        return -1;

    }

    ret = avctx->codec->init(avctx);

    if (ret < 0) {

        av_freep(&avctx->priv_data);

        return ret;

    }

    return 0;

}


--- 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
@@ -9,7 +9,7 @@
     subregion->may_overlap = false;

     subregion->priority = 0;
+
+    memory_region_add_subregion_common(mr, offset, subregion);
+
 }

void memory_region_add_subregion(MemoryRegion *mr,

                                 hwaddr offset,

                                 MemoryRegion *subregion)

{

    subregion->may_overlap = false;

    subregion->priority = 0;

    memory_region_add_subregion_common(mr, offset, subregion);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static bool iscsi_allocationmap_is_allocated(IscsiLun *iscsilun,
+
+                                             int64_t sector_num, int nb_sectors)
+
+{

     unsigned long size;

static bool iscsi_allocationmap_is_allocated(IscsiLun *iscsilun,

                                             int64_t sector_num, int nb_sectors)

{

    unsigned long size;

    if (iscsilun->allocationmap == NULL) {

        return true;

    }

    size = DIV_ROUND_UP(sector_num + nb_sectors, iscsilun->cluster_sectors);

    return !(find_next_bit(iscsilun->allocationmap, size,

                           sector_num / iscsilun->cluster_sectors) == size);

}


static void t_gen_cris_dstep(TCGv d, TCGv a, TCGv b)

{

    int l1;

    l1 = gen_new_label();

    /*

     * d <<= 1

     * if (d >= s)

     *    d -= s;

     */

    tcg_gen_shli_tl(d, a, 1);

    tcg_gen_brcond_tl(TCG_COND_LTU, d, b, l1);

    tcg_gen_sub_tl(d, d, b);

    gen_set_label(l1);

}


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

     QObject *obj = qobject_from_json("'abc", NULL);

static void unterminated_sq_string(void)

{

    QObject *obj = qobject_from_json("'abc", NULL);

    g_assert(obj == NULL);

}


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

     const char *str = g_strdup_printf("%lld", ULLONG_MAX);

static void test_qemu_strtoull_full_max(void)

{

    const char *str = g_strdup_printf("%lld", ULLONG_MAX);

    uint64_t res = 999;

    int err;

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

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, ULLONG_MAX);

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                     const void *userp, uint32_t hash)

 {
+
     struct qht_bucket *b = head;

     int i;

void *qht_do_lookup(struct qht_bucket *head, qht_lookup_func_t func,

                    const void *userp, uint32_t hash)

{

    struct qht_bucket *b = head;

    int i;

    do {

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

            if (b->hashes[i] == hash) {

                /* The pointer is dereferenced before seqlock_read_retry,

                 * so (unlike qht_insert__locked) we need to use

                 * atomic_rcu_read here.

                 */

                void *p = atomic_rcu_read(&b->pointers[i]);

                if (likely(p) && likely(func(p, userp))) {

                    return p;

                }

            }

        }

        b = atomic_rcu_read(&b->next);

    } while (b);

    return NULL;

}


static void tgen_compare_imm_branch(TCGContext *s, S390Opcode opc, int cc,

                                    TCGReg r1, int i2, int labelno)

{

    TCGLabel* l = &s->labels[labelno];

    tcg_target_long off;

    if (l->has_value) {

        off = l->u.value_ptr - s->code_ptr;

    } else {

        /* We need to keep the offset unchanged for retranslation.  */

        off = s->code_ptr[1];

        tcg_out_reloc(s, s->code_ptr + 1, R_390_PC16DBL, labelno, -2);

    }

    tcg_out16(s, (opc & 0xff00) | (r1 << 4) | cc);

    tcg_out16(s, off);

    tcg_out16(s, (i2 << 8) | (opc & 0xff));

}


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

     chr->chr_accept_input = msmouse_chr_accept_input;

+    chr->explicit_be_open = true;
+
+
+
+    mouse = g_new0(MouseState, 1);

     mouse->hs = qemu_input_handler_register((DeviceState *)mouse,

static CharDriverState *qemu_chr_open_msmouse(const char *id,

                                              ChardevBackend *backend,

                                              ChardevReturn *ret,

                                              Error **errp)

{

    ChardevCommon *common = backend->u.msmouse.data;

    MouseState *mouse;

    CharDriverState *chr;

    chr = qemu_chr_alloc(common, errp);

    chr->chr_write = msmouse_chr_write;

    chr->chr_close = msmouse_chr_close;

    chr->chr_accept_input = msmouse_chr_accept_input;

    chr->explicit_be_open = true;

    mouse = g_new0(MouseState, 1);

    mouse->hs = qemu_input_handler_register((DeviceState *)mouse,

                                            &msmouse_handler);

    mouse->chr = chr;

    chr->opaque = mouse;

    return chr;


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
 static void test_bmdma_one_sector_short_prdt(void)

+{

     QPCIDevice *dev;

     void *bmdma_base, *ide_base;

+    uint8_t status;

+
     /* Read 2 sectors but only give 1 sector in PRDT */

     PrdtEntry prdt[] = {

static void test_bmdma_one_sector_short_prdt(void)

{

    QPCIDevice *dev;

    void *bmdma_base, *ide_base;

    uint8_t status;

    /* Read 2 sectors but only give 1 sector in PRDT */

    PrdtEntry prdt[] = {

        {

            .addr = 0,

            .size = cpu_to_le32(0x200 | PRDT_EOT),

        },

    };

    dev = get_pci_device(&bmdma_base, &ide_base);

    /* Normal request */

    status = send_dma_request(CMD_READ_DMA, 0, 2,

                              prdt, ARRAY_SIZE(prdt), NULL);

    g_assert_cmphex(status, ==, 0);

    assert_bit_clear(qpci_io_readb(dev, ide_base + reg_status), DF | ERR);

    /* Abort the request before it completes */

    status = send_dma_request(CMD_READ_DMA | CMDF_ABORT, 0, 2,

                              prdt, ARRAY_SIZE(prdt), NULL);

    g_assert_cmphex(status, ==, 0);

    assert_bit_clear(qpci_io_readb(dev, ide_base + reg_status), DF | ERR);

}


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

     int x, y;

+    int offset = ((offsets + offsetd + 1) | 1) << log2_denom;

     asm volatile(

static inline void ff_h264_biweight_WxH_mmx2(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offsetd, int offsets, int w, int h)

{

    int x, y;

    int offset = ((offsets + offsetd + 1) | 1) << log2_denom;

    asm volatile(

        "movd    %0, %%mm3        \n\t"

        "movd    %1, %%mm4        \n\t"

        "movd    %2, %%mm5        \n\t"

        "movd    %3, %%mm6        \n\t"

        "pshufw  $0, %%mm3, %%mm3 \n\t"

        "pshufw  $0, %%mm4, %%mm4 \n\t"

        "pshufw  $0, %%mm5, %%mm5 \n\t"

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

        :: "g"(weightd), "g"(weights), "g"(offset), "g"(log2_denom+1)

    );

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

        for(x=0; x<w; x+=4){

            asm volatile(

                "movd      %0,    %%mm0 \n\t"

                "movd      %1,    %%mm1 \n\t"

                "punpcklbw %%mm7, %%mm0 \n\t"

                "punpcklbw %%mm7, %%mm1 \n\t"

                "pmullw    %%mm3, %%mm0 \n\t"

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

                "paddw     %%mm5, %%mm0 \n\t"

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

                "psraw     %%mm6, %%mm0 \n\t"

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

                "movd      %%mm0, %0    \n\t"

                : "+m"(*(uint32_t*)(dst+x))

                :  "m"(*(uint32_t*)(src+x))

            );

        }

        src += stride;

        dst += stride;

    }

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
      pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_QEMU_VGA);

      pci_config_set_class(pci_conf, PCI_CLASS_DISPLAY_VGA);
+
+
+
+     /* XXX: VGA_RAM_SIZE must be a power of two */
+
      pci_register_bar(&d->dev, 0, VGA_RAM_SIZE,

                       PCI_BASE_ADDRESS_MEM_PREFETCH, vga_map);

static int pci_vga_initfn(PCIDevice *dev)

{

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

     VGACommonState *s = &d->vga;

     uint8_t *pci_conf = d->dev.config;

     // vga + console init

     vga_common_init(s, VGA_RAM_SIZE);

     vga_init(s);

     s->ds = graphic_console_init(s->update, s->invalidate,

                                  s->screen_dump, s->text_update, s);

     // dummy VGA (same as Bochs ID)

     pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_QEMU);

     pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_QEMU_VGA);

     pci_config_set_class(pci_conf, PCI_CLASS_DISPLAY_VGA);

     /* XXX: VGA_RAM_SIZE must be a power of two */

     pci_register_bar(&d->dev, 0, VGA_RAM_SIZE,

                      PCI_BASE_ADDRESS_MEM_PREFETCH, vga_map);

     if (!dev->rom_bar) {

         /* compatibility with pc-0.13 and older */

         vga_init_vbe(s);

     }

     return 0;

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     const uint8_t *s = src;

     const uint8_t *end;
+
     const uint8_t *mm_end;

     end = s + src_size;

static inline void RENAME(rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)

{

    uint8_t *dest = dst;

    const uint8_t *s = src;

    const uint8_t *end;

    const uint8_t *mm_end;

    end = s + src_size;

    __asm__ volatile(PREFETCH"    %0"::"m"(*s):"memory");

    mm_end = end - 31;

    while (s < mm_end) {

        __asm__ volatile(

            PREFETCH"    32%1           \n\t"

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

            "movq         8%1, %%mm1    \n\t"

            "movq        16%1, %%mm4    \n\t"

            "movq        24%1, %%mm5    \n\t"

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

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

            "movq       %%mm4, %%mm6    \n\t"

            "movq       %%mm5, %%mm7    \n\t"

            STORE_BGR24_MMX

            :"=m"(*dest)

            :"m"(*s)

            :"memory");

        dest += 24;

        s += 32;

    }

    __asm__ volatile(SFENCE:::"memory");

    __asm__ volatile(EMMS:::"memory");

    while (s < end) {

        *dest++ = *s++;

        *dest++ = *s++;

        *dest++ = *s++;

        s++;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static void up_heap(uint32_t val, uint32_t *heap, uint32_t *weights)
+
+{
+
+    uint32_t initial_val = heap[val];

+

     while (weights[initial_val] < weights[heap[val >> 1]]) {

static void up_heap(uint32_t val, uint32_t *heap, uint32_t *weights)

{

    uint32_t initial_val = heap[val];

    while (weights[initial_val] < weights[heap[val >> 1]]) {

        heap[val] = heap[val >> 1];

        val     >>= 1;

    }

    heap[val] = initial_val;

}


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

     CPU_FOREACH(cpu) {

+        acpi_set_cpu_present_bit(gpe_cpu, cpu, &error_abort);
+
+    }
+
+    memory_region_init_io(&gpe_cpu->io, owner, &AcpiCpuHotplug_ops,

                           gpe_cpu, "acpi-cpu-hotplug", ACPI_GPE_PROC_LEN);

void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner,

                                  AcpiCpuHotplug *gpe_cpu, uint16_t base)

{

    CPUState *cpu;

    CPU_FOREACH(cpu) {

        acpi_set_cpu_present_bit(gpe_cpu, cpu, &error_abort);

    }

    memory_region_init_io(&gpe_cpu->io, owner, &AcpiCpuHotplug_ops,

                          gpe_cpu, "acpi-cpu-hotplug", ACPI_GPE_PROC_LEN);

    memory_region_add_subregion(parent, base, &gpe_cpu->io);

    gpe_cpu->device = owner;

}


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

     dshowdebug("libAVMemInputPin_Receive(%p)\n", this);

+

     if (!sample)

libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)

{

    libAVPin *pin = (libAVPin *) ((uint8_t *) this - imemoffset);

    enum dshowDeviceType devtype = pin->filter->type;

    void *priv_data;

    uint8_t *buf;

    int buf_size;

    int index;

    int64_t curtime;

    dshowdebug("libAVMemInputPin_Receive(%p)\n", this);

    if (!sample)

        return E_POINTER;

    if (devtype == VideoDevice) {

        /* PTS from video devices is unreliable. */

        IReferenceClock *clock = pin->filter->clock;

        IReferenceClock_GetTime(clock, &curtime);

    } else {

        int64_t dummy;

        IMediaSample_GetTime(sample, &curtime, &dummy);

        curtime += pin->filter->start_time;

    }

    buf_size = IMediaSample_GetActualDataLength(sample);

    IMediaSample_GetPointer(sample, &buf);

    priv_data = pin->filter->priv_data;

    index = pin->filter->stream_index;

    pin->filter->callback(priv_data, index, buf, buf_size, curtime);

    return S_OK;

}


--- a/source.c
+++ b/source.c
@@ -15,7 +15,7 @@
         bdrv_mon_event(s->bs, BDRV_ACTION_IGNORE, is_read);

         return 0;
+
     }

static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type)

{

    int is_read = (type == SCSI_REQ_STATUS_RETRY_READ);

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

    BlockErrorAction action = bdrv_get_on_error(s->bs, is_read);

    if (action == BLOCK_ERR_IGNORE) {

        bdrv_mon_event(s->bs, BDRV_ACTION_IGNORE, is_read);

        return 0;

    }

    if ((error == ENOSPC && action == BLOCK_ERR_STOP_ENOSPC)

            || action == BLOCK_ERR_STOP_ANY) {

        type &= SCSI_REQ_STATUS_RETRY_TYPE_MASK;

        r->status |= SCSI_REQ_STATUS_RETRY | type;

        bdrv_mon_event(s->bs, BDRV_ACTION_STOP, is_read);

        vm_stop(VMSTOP_DISKFULL);

    } else {

        if (type == SCSI_REQ_STATUS_RETRY_READ) {

            scsi_req_data(&r->req, 0);

        }

        scsi_command_complete(r, CHECK_CONDITION,

                HARDWARE_ERROR);

        bdrv_mon_event(s->bs, BDRV_ACTION_REPORT, is_read);

    }

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     bs = bdrv_find(str);

     if (bs == NULL) {
+
+        return -ENOENT;
+
+    }
+
     if (bdrv_attach_dev(bs, dev) < 0) {

         return -EEXIST;

static int parse_drive(DeviceState *dev, const char *str, void **ptr)

{

    BlockDriverState *bs;

    bs = bdrv_find(str);

    if (bs == NULL) {

        return -ENOENT;

    }

    if (bdrv_attach_dev(bs, dev) < 0) {

        return -EEXIST;

    }

    *ptr = bs;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)
+
+{
+
+    if (n < 32) {
+
         GET_REGL(env->active_tc.gpr[n]);

     }

static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)

{

    if (n < 32) {

        GET_REGL(env->active_tc.gpr[n]);

    }

    if (env->CP0_Config1 & (1 << CP0C1_FP)) {

        if (n >= 38 && n < 70) {

            if (env->CP0_Status & (1 << CP0St_FR))

		GET_REGL(env->active_fpu.fpr[n - 38].d);

            else

		GET_REGL(env->active_fpu.fpr[n - 38].w[FP_ENDIAN_IDX]);

        }

        switch (n) {

        case 70: GET_REGL((int32_t)env->active_fpu.fcr31);

        case 71: GET_REGL((int32_t)env->active_fpu.fcr0);

        }

    }

    switch (n) {

    case 32: GET_REGL((int32_t)env->CP0_Status);

    case 33: GET_REGL(env->active_tc.LO[0]);

    case 34: GET_REGL(env->active_tc.HI[0]);

    case 35: GET_REGL(env->CP0_BadVAddr);

    case 36: GET_REGL((int32_t)env->CP0_Cause);

    case 37: GET_REGL(env->active_tc.PC);

    case 72: GET_REGL(0); /* fp */

    case 89: GET_REGL((int32_t)env->CP0_PRid);

    }

    if (n >= 73 && n <= 88) {

	/* 16 embedded regs.  */

	GET_REGL(0);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,21 +1,21 @@
+static void libschroedinger_handle_first_access_unit(AVCodecContext *avctx)
+
+{
+
+    SchroDecoderParams *p_schro_params = avctx->priv_data;
+
+    SchroDecoder *decoder = p_schro_params->decoder;

+
+    p_schro_params->format = schro_decoder_get_video_format(decoder);
+
+
+
     /* Tell FFmpeg about sequence details. */

+    if (av_image_check_size(p_schro_params->format->width,
+
                             p_schro_params->format->height, 0, avctx) < 0) {

         av_log(avctx, AV_LOG_ERROR, "invalid dimensions (%dx%d)\n",

static void libschroedinger_handle_first_access_unit(AVCodecContext *avctx)

{

    SchroDecoderParams *p_schro_params = avctx->priv_data;

    SchroDecoder *decoder = p_schro_params->decoder;

    p_schro_params->format = schro_decoder_get_video_format(decoder);

    /* Tell FFmpeg about sequence details. */

    if (av_image_check_size(p_schro_params->format->width,

                            p_schro_params->format->height, 0, avctx) < 0) {

        av_log(avctx, AV_LOG_ERROR, "invalid dimensions (%dx%d)\n",

               p_schro_params->format->width, p_schro_params->format->height);

        avctx->height = avctx->width = 0;

        return;

    }

    avctx->height  = p_schro_params->format->height;

    avctx->width   = p_schro_params->format->width;

    avctx->pix_fmt = get_chroma_format(p_schro_params->format->chroma_format);

    if (ff_get_schro_frame_format(p_schro_params->format->chroma_format,

                                  &p_schro_params->frame_format) == -1) {

        av_log(avctx, AV_LOG_ERROR,

               "This codec currently only supports planar YUV 4:2:0, 4:2:2 "

               "and 4:4:4 formats.\n");

        return;

    }

    avctx->framerate.num = p_schro_params->format->frame_rate_numerator;

    avctx->framerate.den = p_schro_params->format->frame_rate_denominator;

}


--- a/source.c
+++ b/source.c
@@ -5,10 +5,10 @@
     DeviceState *dev;

+
+    dev = qdev_create(NULL, "realview_sysctl");
+
+    qdev_prop_set_uint32(dev, "sys_id", sys_id);

     qdev_init_nofail(dev);

void arm_sysctl_init(uint32_t base, uint32_t sys_id)

{

    DeviceState *dev;

    dev = qdev_create(NULL, "realview_sysctl");

    qdev_prop_set_uint32(dev, "sys_id", sys_id);

    qdev_init_nofail(dev);

    sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);

}


size_t qemu_fd_getpagesize(int fd)

{

#ifdef CONFIG_LINUX

    struct statfs fs;

    int ret;

    if (fd != -1) {

        do {

            ret = fstatfs(fd, &fs);

        } while (ret != 0 && errno == EINTR);

        if (ret == 0 && fs.f_type == HUGETLBFS_MAGIC) {

            return fs.f_bsize;

        }

    }

    return getpagesize();

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
     if (pciaddr == 0xffffffff) {

         return 0xffff;
+
+    }
+
+
+
     /* set the pci address in s->config_reg */

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

static uint32_t bonito_spciconf_readw(void *opaque, target_phys_addr_t addr)

{

    PCIBonitoState *s = opaque;

    uint32_t pciaddr;

    uint16_t status;

    DPRINTF("bonito_spciconf_readw "TARGET_FMT_plx"  \n", addr);

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

    pciaddr = bonito_sbridge_pciaddr(s, addr);

    if (pciaddr == 0xffffffff) {

        return 0xffff;

    }

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

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

    /* clear PCI_STATUS_REC_MASTER_ABORT and PCI_STATUS_REC_TARGET_ABORT */

    status = pci_get_word(s->dev.config + PCI_STATUS);

    status &= ~(PCI_STATUS_REC_MASTER_ABORT | PCI_STATUS_REC_TARGET_ABORT);

    pci_set_word(s->dev.config + PCI_STATUS, status);

    return pci_data_read(s->pcihost->bus, s->pcihost->config_reg, 2);

}


static int dxtory_decode_v1_420(AVCodecContext *avctx, AVFrame *pic,

                                const uint8_t *src, int src_size)

{

    int h, w;

    uint8_t *Y1, *Y2, *U, *V;

    int ret;

    if (src_size < avctx->width * avctx->height * 3LL / 2) {

        av_log(avctx, AV_LOG_ERROR, "packet too small\n");

        return AVERROR_INVALIDDATA;

    }

    avctx->pix_fmt = AV_PIX_FMT_YUV420P;

    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)

        return ret;

    Y1 = pic->data[0];

    Y2 = pic->data[0] + pic->linesize[0];

    U  = pic->data[1];

    V  = pic->data[2];

    for (h = 0; h < avctx->height; h += 2) {

        for (w = 0; w < avctx->width; w += 2) {

            AV_COPY16(Y1 + w, src);

            AV_COPY16(Y2 + w, src + 2);

            U[w >> 1] = src[4] + 0x80;

            V[w >> 1] = src[5] + 0x80;

            src += 6;

        }

        Y1 += pic->linesize[0] << 1;

        Y2 += pic->linesize[0] << 1;

        U  += pic->linesize[1];

        V  += pic->linesize[2];

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 int qemu_socket(int domain, int type, int protocol)

 {
+
     int ret;

+
 #ifdef SOCK_CLOEXEC

     ret = socket(domain, type | SOCK_CLOEXEC, protocol);

int qemu_socket(int domain, int type, int protocol)

{

    int ret;

#ifdef SOCK_CLOEXEC

    ret = socket(domain, type | SOCK_CLOEXEC, protocol);

#else

    ret = socket(domain, type, protocol);

    if (ret >= 0) {

        qemu_set_cloexec(ret);

    }

#endif

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -7,5 +7,5 @@
     qemu_get_sbe32s(f, v);

     return 0;
+
+}

static int get_int32(QEMUFile *f, void *pv, size_t size)

{

    int32_t *v = pv;

    qemu_get_sbe32s(f, v);

    return 0;

}


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

     if (!err) {

+        socket_start_incoming_migration(saddr, &err);
+
+    }
+
     error_propagate(errp, err);

 }

void tcp_start_incoming_migration(const char *host_port, Error **errp)

{

    Error *err = NULL;

    SocketAddressLegacy *saddr = tcp_build_address(host_port, &err);

    if (!err) {

        socket_start_incoming_migration(saddr, &err);

    }

    error_propagate(errp, err);

}


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

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

         mr = address_space_translate(&address_space_memory,

void cpu_physical_memory_write_rom(hwaddr addr,

                                   const uint8_t *buf, int len)

{

    hwaddr l;

    uint8_t *ptr;

    hwaddr addr1;

    MemoryRegion *mr;

    while (len > 0) {

        l = len;

        mr = address_space_translate(&address_space_memory,

                                     addr, &addr1, &l, true);

        if (!(memory_region_is_ram(mr) ||

              memory_region_is_romd(mr))) {

            /* do nothing */

        } else {

            addr1 += memory_region_get_ram_addr(mr);

            /* ROM/RAM case */

            ptr = qemu_get_ram_ptr(addr1);

            memcpy(ptr, buf, l);

            invalidate_and_set_dirty(addr1, l);

        }

        len -= l;

        buf += l;

        addr += l;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 const char *avcodec_configuration(void)

+{

     return FFMPEG_CONFIGURATION;

const char *avcodec_configuration(void)

{

    return FFMPEG_CONFIGURATION;

}


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

     }

+
+
+
+    ctxt->free = qcrypto_cipher_free_aes;
+
     ctxt->setiv = qcrypto_cipher_setiv_aes;

     ctxt->encrypt = qcrypto_cipher_encrypt_aes;

static int qcrypto_cipher_init_aes(QCryptoCipher *cipher,

                                   const uint8_t *key, size_t nkey,

                                   Error **errp)

{

    QCryptoCipherBuiltin *ctxt;

    if (cipher->mode != QCRYPTO_CIPHER_MODE_CBC &&

        cipher->mode != QCRYPTO_CIPHER_MODE_ECB) {

        error_setg(errp, "Unsupported cipher mode %d", cipher->mode);

        return -1;

    }

    ctxt = g_new0(QCryptoCipherBuiltin, 1);

    if (AES_set_encrypt_key(key, nkey * 8, &ctxt->state.aes.encrypt_key) != 0) {

        error_setg(errp, "Failed to set encryption key");

        goto error;

    }

    if (AES_set_decrypt_key(key, nkey * 8, &ctxt->state.aes.decrypt_key) != 0) {

        error_setg(errp, "Failed to set decryption key");

        goto error;

    }

    ctxt->free = qcrypto_cipher_free_aes;

    ctxt->setiv = qcrypto_cipher_setiv_aes;

    ctxt->encrypt = qcrypto_cipher_encrypt_aes;

    ctxt->decrypt = qcrypto_cipher_decrypt_aes;

    cipher->opaque = ctxt;

    return 0;

 error:

    g_free(ctxt);

    return -1;

}


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

         size = avio_close_dyn_buf(*dyn_cp, &buf);

+        avio_write(pb, buf, size);
+
+    }
+
+    av_free(buf);

     *dyn_cp = NULL;

static void end_ebml_master_crc32(AVIOContext *pb, AVIOContext **dyn_cp, MatroskaMuxContext *mkv,

                                  ebml_master master)

{

    uint8_t *buf, crc[4];

    int size;

    if (pb->seekable) {

        size = avio_close_dyn_buf(*dyn_cp, &buf);

        if (mkv->write_crc && mkv->mode != MODE_WEBM) {

            AV_WL32(crc, av_crc(av_crc_get_table(AV_CRC_32_IEEE_LE), UINT32_MAX, buf, size) ^ UINT32_MAX);

            put_ebml_binary(pb, EBML_ID_CRC32, crc, sizeof(crc));

        }

        avio_write(pb, buf, size);

        end_ebml_master(pb, master);

    } else {

        end_ebml_master(*dyn_cp, master);

        size = avio_close_dyn_buf(*dyn_cp, &buf);

        avio_write(pb, buf, size);

    }

    av_free(buf);

    *dyn_cp = NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 uint64_t hbitmap_serialization_granularity(const HBitmap *hb)
+
 {

     /* Must hold true so that the shift below is defined

uint64_t hbitmap_serialization_granularity(const HBitmap *hb)

{

    /* Must hold true so that the shift below is defined

     * (ld(64) == 6, i.e. 1 << 6 == 64) */

    assert(hb->granularity < 64 - 6);

    /* Require at least 64 bit granularity to be safe on both 64 bit and 32 bit

     * hosts. */

    return UINT64_C(64) << hb->granularity;

}


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

     ThreadContext *c = v;
+
     int our_job      = c->nb_jobs;

     int nb_threads   = c->nb_threads;
@@ -18,7 +18,7 @@

     self_id = c->current_job++;

+    for (;;) {

         while (our_job >= c->nb_jobs) {

static void* attribute_align_arg worker(void *v)

{

    ThreadContext *c = v;

    int our_job      = c->nb_jobs;

    int nb_threads   = c->nb_threads;

    unsigned int last_execute = 0;

    int self_id;

    pthread_mutex_lock(&c->current_job_lock);

    self_id = c->current_job++;

    for (;;) {

        while (our_job >= c->nb_jobs) {

            if (c->current_job == nb_threads + c->nb_jobs)

                pthread_cond_signal(&c->last_job_cond);

            while (last_execute == c->current_execute && !c->done)

                pthread_cond_wait(&c->current_job_cond, &c->current_job_lock);

            last_execute = c->current_execute;

            our_job = self_id;

            if (c->done) {

                pthread_mutex_unlock(&c->current_job_lock);

                return NULL;

            }

        }

        pthread_mutex_unlock(&c->current_job_lock);

        c->rets[our_job % c->nb_rets] = c->func(c->ctx, c->arg, our_job, c->nb_jobs);

        pthread_mutex_lock(&c->current_job_lock);

        our_job = c->current_job++;

    }

}


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

     /* let's disallow possible ambiguous cases */
+
+    if(size > INT_MAX)
+
+        return NULL;
+

 #ifdef MEMALIGN_HACK

void *av_realloc(void *ptr, unsigned int size)

{

#ifdef MEMALIGN_HACK

    int diff;

#endif

    /* let's disallow possible ambiguous cases */

    if(size > INT_MAX)

        return NULL;

#ifdef MEMALIGN_HACK

    //FIXME this isn't aligned correctly, though it probably isn't needed

    if(!ptr) return av_malloc(size);

    diff= ((char*)ptr)[-1];

    return realloc(ptr - diff, size + diff) + diff;

#else

    return realloc(ptr, size);

#endif

}


void ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number)

{

    int full_frame= 0;

    avpriv_align_put_bits(&s->pb);

    put_bits(&s->pb, 1, 1);     /* marker */

    put_bits(&s->pb, 1, (s->pict_type == AV_PICTURE_TYPE_P));

    put_bits(&s->pb, 1, 0);     /* not PB frame */

    put_bits(&s->pb, 5, s->qscale);

    if (s->pict_type == AV_PICTURE_TYPE_I) {

        /* specific MPEG like DC coding not used */

    }

    /* if multiple packets per frame are sent, the position at which

       to display the macroblocks is coded here */

    if(!full_frame){

        put_bits(&s->pb, 6, 0); /* mb_x */

        put_bits(&s->pb, 6, 0); /* mb_y */

        put_bits(&s->pb, 12, s->mb_width * s->mb_height);

    }

    put_bits(&s->pb, 3, 0);     /* ignored */

}


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

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

     int err;

static void test_qemu_strtoll_empty(void)

{

    const char *str = "";

    char f = 'X';

    const char *endptr = &f;

    int64_t res = 999;

    int err;

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

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, 0);

    g_assert(endptr == str);

}


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

 {

+    assert(kvm_enabled());

 }

static void kvmppc_host_cpu_initfn(Object *obj)

{

    assert(kvm_enabled());

}


--- a/source.c
+++ b/source.c
@@ -5,8 +5,8 @@
     PostcopyState ps = postcopy_state_set(POSTCOPY_INCOMING_RUNNING);

+
+    trace_loadvm_postcopy_handle_run();

     if (ps != POSTCOPY_INCOMING_LISTENING) {

static int loadvm_postcopy_handle_run(MigrationIncomingState *mis)

{

    PostcopyState ps = postcopy_state_set(POSTCOPY_INCOMING_RUNNING);

    trace_loadvm_postcopy_handle_run();

    if (ps != POSTCOPY_INCOMING_LISTENING) {

        error_report("CMD_POSTCOPY_RUN in wrong postcopy state (%d)", ps);

        return -1;

    }

    mis->bh = qemu_bh_new(loadvm_postcopy_handle_run_bh, NULL);

    qemu_bh_schedule(mis->bh);

    /* We need to finish reading the stream from the package

     * and also stop reading anything more from the stream that loaded the

     * package (since it's now being read by the listener thread).

     * LOADVM_QUIT will quit all the layers of nested loadvm loops.

     */

    return LOADVM_QUIT;

}


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

+{

     raise_exception(EXCP0D_GPF);

void OPPROTO op_cli(void)

{

    raise_exception(EXCP0D_GPF);

}


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

     int exponent;
+
+    int64_t den;
+
+    if (isnan(d))
+
         return (AVRational) { 0,0 };

     if (fabs(d) > INT_MAX + 3LL)

AVRational av_d2q(double d, int max)

{

    AVRational a;

    int exponent;

    int64_t den;

    if (isnan(d))

        return (AVRational) { 0,0 };

    if (fabs(d) > INT_MAX + 3LL)

        return (AVRational) { d < 0 ? -1 : 1, 0 };

    frexp(d, &exponent);

    exponent = FFMAX(exponent-1, 0);

    den = 1LL << (61 - exponent);

    // (int64_t)rint() and llrint() do not work with gcc on ia64 and sparc64

    av_reduce(&a.num, &a.den, floor(d * den + 0.5), den, max);

    if ((!a.num || !a.den) && d && max>0 && max<INT_MAX)

        av_reduce(&a.num, &a.den, floor(d * den + 0.5), den, INT_MAX);

    return a;

}


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

     uint64_t sect;

+
+
     if (bdrv) {

         bdrv_get_geometry(bdrv, &sect);

static void sd_reset(SDState *sd, BlockDriverState *bdrv)

{

    uint64_t size;

    uint64_t sect;

    if (bdrv) {

        bdrv_get_geometry(bdrv, &sect);

    } else {

        sect = 0;

    }

    sect <<= 9;

    size = sect + 1;

    sect = (size >> (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT)) + 1;

    sd->state = sd_idle_state;

    sd->rca = 0x0000;

    sd_set_ocr(sd);

    sd_set_scr(sd);

    sd_set_cid(sd);

    sd_set_csd(sd, size);

    sd_set_cardstatus(sd);

    sd_set_sdstatus(sd);

    sd->bdrv = bdrv;

    if (sd->wp_groups)

        qemu_free(sd->wp_groups);

    sd->wp_switch = bdrv ? bdrv_is_read_only(bdrv) : 0;

    sd->wp_groups = (int *) qemu_mallocz(sizeof(int) * sect);

    memset(sd->function_group, 0, sizeof(int) * 6);

    sd->erase_start = 0;

    sd->erase_end = 0;

    sd->size = size;

    sd->blk_len = 0x200;

    sd->pwd_len = 0;

}


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

     trace_run_poll_handlers_begin(ctx, max_ns);

+
+
+    end_time = qemu_clock_get_ns(QEMU_CLOCK_REALTIME) + max_ns;
+
+

     do {

static bool run_poll_handlers(AioContext *ctx, int64_t max_ns)

{

    bool progress;

    int64_t end_time;

    assert(ctx->notify_me);

    assert(qemu_lockcnt_count(&ctx->list_lock) > 0);

    assert(ctx->poll_disable_cnt == 0);

    trace_run_poll_handlers_begin(ctx, max_ns);

    end_time = qemu_clock_get_ns(QEMU_CLOCK_REALTIME) + max_ns;

    do {

        progress = run_poll_handlers_once(ctx);

    } while (!progress && qemu_clock_get_ns(QEMU_CLOCK_REALTIME) < end_time);

    trace_run_poll_handlers_end(ctx, progress);

    return progress;

}


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

     check_tlb_flush(env);

void helper_check_tlb_flush(CPUPPCState *env)

{

    check_tlb_flush(env);

}


--- a/source.c
+++ b/source.c
@@ -57,11 +57,11 @@
         h->mb_y              = hx->mb_y;

         h->droppable         = hx->droppable;
+
+        h->picture_structure = hx->picture_structure;
+
+        for (i = 1; i < context_count; i++)
+
             h->er.error_count += h->thread_context[i]->er.error_count;

     }

int ff_h264_execute_decode_slices(H264Context *h, unsigned context_count)

{

    AVCodecContext *const avctx = h->avctx;

    H264Context *hx;

    int i;

    if (h->mb_y >= h->mb_height) {

        av_log(h->avctx, AV_LOG_ERROR,

               "Input contains more MB rows than the frame height.\n");

        return AVERROR_INVALIDDATA;

    }

    if (h->avctx->hwaccel)

        return 0;

    if (context_count == 1) {

        return decode_slice(avctx, &h);

    } else {

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

            hx                 = h->thread_context[i];

            hx->er.error_count = 0;

        }

        avctx->execute(avctx, decode_slice, h->thread_context,

                       NULL, context_count, sizeof(void *));

        /* pull back stuff from slices to master context */

        hx                   = h->thread_context[context_count - 1];

        h->mb_x              = hx->mb_x;

        h->mb_y              = hx->mb_y;

        h->droppable         = hx->droppable;

        h->picture_structure = hx->picture_structure;

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

            h->er.error_count += h->thread_context[i]->er.error_count;

    }

    return 0;

}


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

     int64_t v;

+    uint32 res;

     v = float32_to_int64(a STATUS_VAR);
+
     if (v < 0) {

         res = 0;

uint32 float32_to_uint32( float32 a STATUS_PARAM )

{

    int64_t v;

    uint32 res;

    v = float32_to_int64(a STATUS_VAR);

    if (v < 0) {

        res = 0;

        float_raise( float_flag_invalid STATUS_VAR);

    } else if (v > 0xffffffff) {

        res = 0xffffffff;

        float_raise( float_flag_invalid STATUS_VAR);

    } else {

        res = v;

    }

    return res;

}


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

     CPUPPCState *env = &cpu->env;
+
     target_ulong flags = args[0];

     target_ulong pte_index = args[1];

static target_ulong h_protect(PowerPCCPU *cpu, sPAPREnvironment *spapr,

                              target_ulong opcode, target_ulong *args)

{

    CPUPPCState *env = &cpu->env;

    target_ulong flags = args[0];

    target_ulong pte_index = args[1];

    target_ulong avpn = args[2];

    hwaddr hpte;

    target_ulong v, r, rb;

    if ((pte_index * HASH_PTE_SIZE_64) & ~env->htab_mask) {

        return H_PARAMETER;

    }

    hpte = pte_index * HASH_PTE_SIZE_64;

    v = ppc_hash64_load_hpte0(env, hpte);

    r = ppc_hash64_load_hpte1(env, hpte);

    if ((v & HPTE64_V_VALID) == 0 ||

        ((flags & H_AVPN) && (v & ~0x7fULL) != avpn)) {

        return H_NOT_FOUND;

    }

    r &= ~(HPTE64_R_PP0 | HPTE64_R_PP | HPTE64_R_N |

           HPTE64_R_KEY_HI | HPTE64_R_KEY_LO);

    r |= (flags << 55) & HPTE64_R_PP0;

    r |= (flags << 48) & HPTE64_R_KEY_HI;

    r |= flags & (HPTE64_R_PP | HPTE64_R_N | HPTE64_R_KEY_LO);

    rb = compute_tlbie_rb(v, r, pte_index);

    ppc_hash64_store_hpte0(env, hpte, (v & ~HPTE64_V_VALID) | HPTE64_V_HPTE_DIRTY);

    ppc_tlb_invalidate_one(env, rb);

    ppc_hash64_store_hpte1(env, hpte, r);

    /* Don't need a memory barrier, due to qemu's global lock */

    ppc_hash64_store_hpte0(env, hpte, v | HPTE64_V_HPTE_DIRTY);

    return H_SUCCESS;

}


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

     gen_set_pc_im(s, s->pc - offset);

+    gen_exception(excp, syn, target_el);
+
+    s->is_jmp = DISAS_JUMP;

 }

static void gen_exception_insn(DisasContext *s, int offset, int excp,

                               int syn, uint32_t target_el)

{

    gen_set_condexec(s);

    gen_set_pc_im(s, s->pc - offset);

    gen_exception(excp, syn, target_el);

    s->is_jmp = DISAS_JUMP;

}


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

     PCIDeviceClass *k = PCI_DEVICE_CLASS (klass);

+
+
+    k->realize = es1370_realize;
+
+
     k->vendor_id = PCI_VENDOR_ID_ENSONIQ;

     k->device_id = PCI_DEVICE_ID_ENSONIQ_ES1370;

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

{

    DeviceClass *dc = DEVICE_CLASS (klass);

    PCIDeviceClass *k = PCI_DEVICE_CLASS (klass);

    k->realize = es1370_realize;

    k->vendor_id = PCI_VENDOR_ID_ENSONIQ;

    k->device_id = PCI_DEVICE_ID_ENSONIQ_ES1370;

    k->class_id = PCI_CLASS_MULTIMEDIA_AUDIO;

    k->subsystem_vendor_id = 0x4942;

    k->subsystem_id = 0x4c4c;

    set_bit(DEVICE_CATEGORY_SOUND, dc->categories);

    dc->desc = "ENSONIQ AudioPCI ES1370";

    dc->vmsd = &vmstate_es1370;

}


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

     nb_clusters = size_to_clusters(s, size);

+retry:

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

static int64_t alloc_clusters_noref(BlockDriverState *bs, uint64_t size)

{

    BDRVQcowState *s = bs->opaque;

    uint64_t i, nb_clusters;

    int refcount;

    nb_clusters = size_to_clusters(s, size);

retry:

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

        uint64_t next_cluster_index = s->free_cluster_index++;

        refcount = get_refcount(bs, next_cluster_index);

        if (refcount < 0) {

            return refcount;

        } else if (refcount != 0) {

            goto retry;

        }

    }

    /* Make sure that all offsets in the "allocated" range are representable

     * in an int64_t */

    if (s->free_cluster_index - 1 > (INT64_MAX >> s->cluster_bits)) {

        return -EFBIG;

    }

#ifdef DEBUG_ALLOC2

    fprintf(stderr, "alloc_clusters: size=%" PRId64 " -> %" PRId64 "\n",

            size,

            (s->free_cluster_index - nb_clusters) << s->cluster_bits);

#endif

    return (s->free_cluster_index - nb_clusters) << s->cluster_bits;

}


static void idct(uint8_t *dst, int dst_linesize, int src[64])

{

    int i, j, k;

    double tmp[64];

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

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

            double sum = 0.0;

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

                sum += c[k*8+j] * src[8*i+k];

            tmp[8*i+j] = sum;

        }

    }

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

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

            double sum = 0.0;

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

                sum += c[k*8+i]*tmp[8*k+j];

            dst[dst_linesize*i + j] = av_clip_uint8((int)floor(sum+0.5));

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -47,11 +47,11 @@
                 idedev = pci_ide->bus[di->bus].master;

             } else {
+
+                idedev = pci_ide->bus[di->bus].slave;
+
+            }
+
             idedev->conf.blk = NULL;

             monitor_remove_blk(blk);

int pci_piix3_xen_ide_unplug(DeviceState *dev)

{

    PCIIDEState *pci_ide;

    DriveInfo *di;

    int i;

    IDEDevice *idedev;

    pci_ide = PCI_IDE(dev);

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

        di = drive_get_by_index(IF_IDE, i);

        if (di != NULL && !di->media_cd) {

            BlockBackend *blk = blk_by_legacy_dinfo(di);

            DeviceState *ds = blk_get_attached_dev(blk);

            blk_drain(blk);

            blk_flush(blk);

            if (ds) {

                blk_detach_dev(blk, ds);

            }

            pci_ide->bus[di->bus].ifs[di->unit].blk = NULL;

            if (!(i % 2)) {

                idedev = pci_ide->bus[di->bus].master;

            } else {

                idedev = pci_ide->bus[di->bus].slave;

            }

            idedev->conf.blk = NULL;

            monitor_remove_blk(blk);

            blk_unref(blk);

        }

    }

    qdev_reset_all(DEVICE(dev));

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void migration_fd_process_incoming(QEMUFile *f)
+
 {

+    Coroutine *co = qemu_coroutine_create(process_incoming_migration_co);

void migration_fd_process_incoming(QEMUFile *f)

{

    Coroutine *co = qemu_coroutine_create(process_incoming_migration_co);

    migrate_decompress_threads_create();

    qemu_file_set_blocking(f, false);

    qemu_coroutine_enter(co, f);

}


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

 {

+    GetBitContext *gb        = &ctx->gb;

+    *bd->shift_lsbs = 0;

     // read block type flag and read the samples accordingly

static int read_block(ALSDecContext *ctx, ALSBlockData *bd)

{

    GetBitContext *gb        = &ctx->gb;

    *bd->shift_lsbs = 0;

    // read block type flag and read the samples accordingly

    if (get_bits1(gb)) {

        if (read_var_block_data(ctx, bd))

            return -1;

    } else {

        read_const_block_data(ctx, bd);

    }

    return 0;

}


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

             qxl_name(qxl_cursor_cmd, cmd->type));

+    switch (cmd->type) {
+
+    case QXL_CURSOR_SET:
+
+        fprintf(stderr, " +%d+%d visible %s, shape @ 0x%" PRIx64,

                 cmd->u.set.position.x,

void qxl_log_cmd_cursor(PCIQXLDevice *qxl, QXLCursorCmd *cmd, int group_id)

{

    QXLCursor *cursor;

    fprintf(stderr, ": %s",

            qxl_name(qxl_cursor_cmd, cmd->type));

    switch (cmd->type) {

    case QXL_CURSOR_SET:

        fprintf(stderr, " +%d+%d visible %s, shape @ 0x%" PRIx64,

                cmd->u.set.position.x,

                cmd->u.set.position.y,

                cmd->u.set.visible ? "yes" : "no",

                cmd->u.set.shape);

        cursor = qxl_phys2virt(qxl, cmd->u.set.shape, group_id);

        fprintf(stderr, " type %s size %dx%d hot-spot +%d+%d"

                " unique 0x%" PRIx64 " data-size %d",

                qxl_name(spice_cursor_type, cursor->header.type),

                cursor->header.width, cursor->header.height,

                cursor->header.hot_spot_x, cursor->header.hot_spot_y,

                cursor->header.unique, cursor->data_size);

        break;

    case QXL_CURSOR_MOVE:

        fprintf(stderr, " +%d+%d", cmd->u.position.x, cmd->u.position.y);

        break;

    }

}


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

     hwaddr addr;

+
+
+    addr = ((uint64_t)ubase << 32) | lbase;

     return addr;

static hwaddr intel_hda_addr(uint32_t lbase, uint32_t ubase)

{

    hwaddr addr;

    addr = ((uint64_t)ubase << 32) | lbase;

    return addr;

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
 void stellaris_enet_init(NICInfo *nd, uint32_t base, qemu_irq irq)

+{

     stellaris_enet_state *s;
+
+    int iomemtype;

+    qemu_check_nic_model(nd, "stellaris");

void stellaris_enet_init(NICInfo *nd, uint32_t base, qemu_irq irq)

{

    stellaris_enet_state *s;

    int iomemtype;

    qemu_check_nic_model(nd, "stellaris");

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

    iomemtype = cpu_register_io_memory(0, stellaris_enet_readfn,

                                       stellaris_enet_writefn, s);

    cpu_register_physical_memory(base, 0x00001000, iomemtype);

    s->irq = irq;

    memcpy(s->macaddr, nd->macaddr, 6);

    if (nd->vlan) {

        s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,

                                     stellaris_enet_receive, stellaris_enet_can_receive, s);

        qemu_format_nic_info_str(s->vc, s->macaddr);

    }

    stellaris_enet_reset(s);

    register_savevm("stellaris_enet", -1, 1,

                    stellaris_enet_save, stellaris_enet_load, s);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int process_metadata(AVFormatContext *s, uint8_t *name, uint16_t name_len,

                             uint16_t val_len, uint16_t type, AVDictionary **met)

@@ -15,7 +15,7 @@
         switch (type) {

         case ASF_UNICODE:
+
             asf_read_value(s, name, name_len, val_len, type, met);

             break;

static int process_metadata(AVFormatContext *s, uint8_t *name, uint16_t name_len,

                            uint16_t val_len, uint16_t type, AVDictionary **met)

{

    int ret;

    ff_asf_guid guid;

    if (val_len) {

        switch (type) {

        case ASF_UNICODE:

            asf_read_value(s, name, name_len, val_len, type, met);

            break;

        case ASF_BYTE_ARRAY:

            if (!strcmp(name, "WM/Picture")) // handle cover art

                asf_read_picture(s, val_len);

            else if (!strcmp(name, "ID3")) // handle ID3 tag

                get_id3_tag(s, val_len);

            else

                asf_read_value(s, name, name_len, val_len, type, met);

            break;

        case ASF_GUID:

            ff_get_guid(s->pb, &guid);

            break;

        default:

            if ((ret = asf_read_generic_value(s, name, name_len, type, met)) < 0)

                return ret;

            break;

        }

    }

    av_freep(&name);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int ac3_probe(AVProbeData *p)
+
 {

     int max_frames, first_frames, frames;

static int ac3_probe(AVProbeData *p)

{

    int max_frames, first_frames, frames;

    uint8_t *buf, *buf2, *end;

    AC3HeaderInfo hdr;

    if(p->buf_size < 7)

        return 0;

    max_frames = 0;

    buf = p->buf;

    end = buf + FFMIN(4096, p->buf_size - 7);

    for(; buf < end; buf++) {

        buf2 = buf;

        for(frames = 0; buf2 < end; frames++) {

            if(ff_ac3_parse_header(buf2, &hdr) < 0)

                break;

            buf2 += hdr.frame_size;

        }

        max_frames = FFMAX(max_frames, frames);

        if(buf == p->buf)

            first_frames = frames;

    }

    if   (first_frames>=3) return AVPROBE_SCORE_MAX * 3 / 4;

    else if(max_frames>=3) return AVPROBE_SCORE_MAX / 2;

    else if(max_frames>=1) return 1;

    else                   return 0;

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     while (g->name)

         g++;
+
+    octx->nb_groups = g - groups;
+
+    octx->groups    = av_mallocz(sizeof(*octx->groups) * octx->nb_groups);
+
     if (!octx->groups)

         exit(1);

static void init_parse_context(OptionParseContext *octx,

                               const OptionGroupDef *groups)

{

    static const OptionGroupDef global_group = { "global" };

    const OptionGroupDef *g = groups;

    int i;

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

    while (g->name)

        g++;

    octx->nb_groups = g - groups;

    octx->groups    = av_mallocz(sizeof(*octx->groups) * octx->nb_groups);

    if (!octx->groups)

        exit(1);

    for (i = 0; i < octx->nb_groups; i++)

        octx->groups[i].group_def = &groups[i];

    octx->global_opts.group_def = &global_group;

    octx->global_opts.arg       = "";

    init_opts();

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int decode_blck(uint8_t *frame, int width, int height,

                        const uint8_t *src, const uint8_t *src_end)

static int decode_blck(uint8_t *frame, int width, int height,

                       const uint8_t *src, const uint8_t *src_end)

{

    memset(frame, 0, width * height);

    return 0;

}


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

     tcg_gen_mov_tl(cpu_tmp0, cpu_regs[R_ECX]);

static inline void gen_op_jnz_ecx(TCGMemOp size, int label1)

{

    tcg_gen_mov_tl(cpu_tmp0, cpu_regs[R_ECX]);

    gen_extu(size, cpu_tmp0);

    tcg_gen_brcondi_tl(TCG_COND_NE, cpu_tmp0, 0, label1);

}


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

+{

     return prev ? prev->next : first_protocol;

URLProtocol *ffurl_protocol_next(const URLProtocol *prev)

{

    return prev ? prev->next : first_protocol;

}


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

+
+
+
+
+
     av_free(filter);

     ts->pids[pid] = NULL;

static void mpegts_close_filter(MpegTSContext *ts, MpegTSFilter *filter)

{

    int pid;

    pid = filter->pid;

    if (filter->type == MPEGTS_SECTION)

        av_freep(&filter->u.section_filter.section_buf);

    av_free(filter);

    ts->pids[pid] = NULL;


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int cdrom_probe_device(const char *filename)
+
+{
+
+    int fd, ret;

     int prio = 0;

static int cdrom_probe_device(const char *filename)

{

    int fd, ret;

    int prio = 0;

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

        prio = 50;

    fd = open(filename, O_RDONLY | O_NONBLOCK);

    if (fd < 0) {

        goto out;

    }

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

    ret = ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT);

    if (ret >= 0)

        prio = 100;

    close(fd);

out:

    return prio;

}


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

     assert(bs != base);
+
+    for (p = bs; p != base; p = backing_bs(p)) {
+
+        ret = bdrv_co_get_block_status(p, sector_num, nb_sectors, pnum, file);
+
         if (ret < 0) {

             break;

static int64_t coroutine_fn bdrv_co_get_block_status_above(BlockDriverState *bs,

        BlockDriverState *base,

        int64_t sector_num,

        int nb_sectors,

        int *pnum,

        BlockDriverState **file)

{

    BlockDriverState *p;

    int64_t ret = 0;

    bool first = true;

    assert(bs != base);

    for (p = bs; p != base; p = backing_bs(p)) {

        ret = bdrv_co_get_block_status(p, sector_num, nb_sectors, pnum, file);

        if (ret < 0) {

            break;

        }

        if (ret & BDRV_BLOCK_ZERO && ret & BDRV_BLOCK_EOF && !first) {

            /*

             * Reading beyond the end of the file continues to read

             * zeroes, but we can only widen the result to the

             * unallocated length we learned from an earlier

             * iteration.

             */

            *pnum = nb_sectors;

        }

        if (ret & (BDRV_BLOCK_ZERO | BDRV_BLOCK_DATA)) {

            break;

        }

        /* [sector_num, pnum] unallocated on this layer, which could be only

         * the first part of [sector_num, nb_sectors].  */

        nb_sectors = MIN(nb_sectors, *pnum);

        first = false;

    }

    return ret;

}


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

 {
+
     BlockDriver *drv = bs->drv;

     if (!drv)

int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num,

                          const uint8_t *buf, int nb_sectors)

{

    BlockDriver *drv = bs->drv;

    if (!drv)

        return -ENOMEDIUM;

    if (!drv->bdrv_write_compressed)

        return -ENOTSUP;

    if (bdrv_check_request(bs, sector_num, nb_sectors))

        return -EIO;

    if (bs->dirty_tracking) {

        set_dirty_bitmap(bs, sector_num, nb_sectors, 1);

    }

    return drv->bdrv_write_compressed(bs, sector_num, buf, nb_sectors);

}


--- a/source.c
+++ b/source.c
@@ -3,6 +3,6 @@
     MP3On4DecodeContext *s = avctx->priv_data;
     int i;
     for (i = 0; i < s->frames; i++)
+        av_freep(&s->mp3decctx[i]);
+    return 0;
 }

static av_cold int decode_close_mp3on4(AVCodecContext * avctx)
{
    MP3On4DecodeContext *s = avctx->priv_data;
    int i;
    for (i = 0; i < s->frames; i++)
        av_freep(&s->mp3decctx[i]);
    return 0;
}


static void trigger_page_fault(CPUS390XState *env, target_ulong vaddr,

                               uint32_t type, uint64_t asc, int rw, bool exc)

{

    int ilen = ILEN_LATER;

    uint64_t tec;

    tec = vaddr | (rw == MMU_DATA_STORE ? FS_WRITE : FS_READ) | asc >> 46;

    DPRINTF("%s: trans_exc_code=%016" PRIx64 "\n", __func__, tec);

    if (!exc) {

        return;

    }

    /* Code accesses have an undefined ilc.  */

    if (rw == MMU_INST_FETCH) {

        ilen = 2;

    }

    trigger_access_exception(env, type, ilen, tec);

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
+static void close_slave(TeeSlave *tee_slave)

 {

+    AVFormatContext *avf;
+
+    unsigned i;
+
+
+
     avf = tee_slave->avf;

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

static void close_slave(TeeSlave *tee_slave)

{

    AVFormatContext *avf;

    unsigned i;

    avf = tee_slave->avf;

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

        AVBitStreamFilterContext *bsf_next, *bsf = tee_slave->bsfs[i];

        while (bsf) {

            bsf_next = bsf->next;

            av_bitstream_filter_close(bsf);

            bsf = bsf_next;

        }

    }

    av_freep(&tee_slave->stream_map);

    av_freep(&tee_slave->bsfs);

    ff_format_io_close(avf, &avf->pb);

    avformat_free_context(avf);

    tee_slave->avf = NULL;

}


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

     Coroutine *next;
+

     trace_qemu_co_queue_run_restart(co);

void qemu_co_queue_run_restart(Coroutine *co)

{

    Coroutine *next;

    trace_qemu_co_queue_run_restart(co);

    while ((next = QSIMPLEQ_FIRST(&co->co_queue_wakeup))) {

        QSIMPLEQ_REMOVE_HEAD(&co->co_queue_wakeup, co_queue_next);

        qemu_coroutine_enter(next, NULL);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void xilinx_enet_init(Object *obj)

 {
+
+    XilinxAXIEnet *s = XILINX_AXI_ENET(obj);

     SysBusDevice *sbd = SYS_BUS_DEVICE(obj);

static void xilinx_enet_init(Object *obj)

{

    XilinxAXIEnet *s = XILINX_AXI_ENET(obj);

    SysBusDevice *sbd = SYS_BUS_DEVICE(obj);

    object_property_add_link(obj, "axistream-connected", TYPE_STREAM_SLAVE,

                             (Object **) &s->tx_data_dev, &error_abort);

    object_property_add_link(obj, "axistream-control-connected",

                             TYPE_STREAM_SLAVE,

                             (Object **) &s->tx_control_dev, &error_abort);

    object_initialize(&s->rx_data_dev, sizeof(s->rx_data_dev),

                      TYPE_XILINX_AXI_ENET_DATA_STREAM);

    object_initialize(&s->rx_control_dev, sizeof(s->rx_control_dev),

                      TYPE_XILINX_AXI_ENET_CONTROL_STREAM);

    object_property_add_child(OBJECT(s), "axistream-connected-target",

                              (Object *)&s->rx_data_dev, &error_abort);

    object_property_add_child(OBJECT(s), "axistream-control-connected-target",

                              (Object *)&s->rx_control_dev, &error_abort);

    sysbus_init_irq(sbd, &s->irq);

    memory_region_init_io(&s->iomem, OBJECT(s), &enet_ops, s, "enet", 0x40000);

    sysbus_init_mmio(sbd, &s->iomem);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void mips_cpu_do_unaligned_access(CPUState *cs, vaddr addr,

+                                  int is_write, int is_user, uintptr_t retaddr)
+
+{
+
     MIPSCPU *cpu = MIPS_CPU(cs);

     CPUMIPSState *env = &cpu->env;

void mips_cpu_do_unaligned_access(CPUState *cs, vaddr addr,

                                  int is_write, int is_user, uintptr_t retaddr)

{

    MIPSCPU *cpu = MIPS_CPU(cs);

    CPUMIPSState *env = &cpu->env;

    env->CP0_BadVAddr = addr;

    do_raise_exception(env, (is_write == 1) ? EXCP_AdES : EXCP_AdEL, retaddr);

}


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

     target_ulong cs_base, pc;

+    uint32_t flags;
+
+    uint32_t cflags = 1 | CF_IGNORE_ICOUNT;
+
+

     if (sigsetjmp(cpu->jmp_env, 0) == 0) {

static void cpu_exec_step(CPUState *cpu)

{

    CPUClass *cc = CPU_GET_CLASS(cpu);

    TranslationBlock *tb;

    target_ulong cs_base, pc;

    uint32_t flags;

    uint32_t cflags = 1 | CF_IGNORE_ICOUNT;

    if (sigsetjmp(cpu->jmp_env, 0) == 0) {

        tb = tb_lookup__cpu_state(cpu, &pc, &cs_base, &flags,

                                  cflags & CF_HASH_MASK);

        if (tb == NULL) {

            mmap_lock();

            tb_lock();

            tb = tb_gen_code(cpu, pc, cs_base, flags, cflags);

            tb_unlock();

            mmap_unlock();

        }

        cc->cpu_exec_enter(cpu);

        /* execute the generated code */

        trace_exec_tb(tb, pc);

        cpu_tb_exec(cpu, tb);

        cc->cpu_exec_exit(cpu);

    } else {

        /* We may have exited due to another problem here, so we need

         * to reset any tb_locks we may have taken but didn't release.

         * The mmap_lock is dropped by tb_gen_code if it runs out of

         * memory.

         */

#ifndef CONFIG_SOFTMMU

        tcg_debug_assert(!have_mmap_lock());

#endif

        tb_lock_reset();

    }

}


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

     for(i=0; i<bytes; i++) put_bits(pb, 16, be2me_16(((uint16_t*)src)[i]));
+
+    put_bits(pb, bits, be2me_16(((uint16_t*)src)[i])>>(16-bits));
+
+#else
+
     int bytes= length>>3;

     int bits= length&7;

static void copy_bits(PutBitContext *pb, UINT8 *src, int length)

{

#if 1

    int bytes= length>>4;

    int bits= length&15;

    int i;

    for(i=0; i<bytes; i++) put_bits(pb, 16, be2me_16(((uint16_t*)src)[i]));

    put_bits(pb, bits, be2me_16(((uint16_t*)src)[i])>>(16-bits));

#else

    int bytes= length>>3;

    int bits= length&7;

    int i;

    for(i=0; i<bytes; i++) put_bits(pb, 8, src[i]);

    put_bits(pb, bits, src[i]>>(8-bits));

#endif

}


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

+{

     MSDState *s = opaque;

static void usb_msd_cancel_io(USBPacket *p, void *opaque)

{

    MSDState *s = opaque;

    s->scsi_dev->info->cancel_io(s->scsi_dev, s->tag);

    s->packet = NULL;

    s->scsi_len = 0;

}


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

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

             *endptr = nptr;

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

                 unsigned long *result)

{

    char *p;

    int err = 0;

    if (!nptr) {

        if (endptr) {

            *endptr = nptr;

        }

        err = -EINVAL;

    } else {

        errno = 0;

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

        err = check_strtox_error(endptr, p, errno);

    }

    return err;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void gen_spr_power8_fscr(CPUPPCState *env)
+
 {

     spr_register_kvm(env, SPR_FSCR, "FSCR",

static void gen_spr_power8_fscr(CPUPPCState *env)

{

    spr_register_kvm(env, SPR_FSCR, "FSCR",

                     SPR_NOACCESS, SPR_NOACCESS,

                     &spr_read_generic, &spr_write_generic,

                     KVM_REG_PPC_FSCR, 0x00000000);

}


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

     char *testname;

+
+
+    trace_lm32_sys_memory_write(addr, value);
+
+

     addr >>= 2;

static void sys_write(void *opaque, target_phys_addr_t addr,

                      uint64_t value, unsigned size)

{

    LM32SysState *s = opaque;

    char *testname;

    trace_lm32_sys_memory_write(addr, value);

    addr >>= 2;

    switch (addr) {

    case R_CTRL:

        qemu_system_shutdown_request();

        break;

    case R_PASSFAIL:

        s->regs[addr] = value;

        testname = (char *)s->testname;

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

        break;

    case R_TESTNAME:

        s->regs[addr] = value;

        copy_testname(s);

        break;

    default:

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

                TARGET_FMT_plx, addr << 2);

        break;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void test_source_notify(void)
+
+{
+
+    while (g_main_context_iteration(NULL, false));

     aio_notify(ctx);

static void test_source_notify(void)

{

    while (g_main_context_iteration(NULL, false));

    aio_notify(ctx);

    g_assert(g_main_context_iteration(NULL, true));

    g_assert(!g_main_context_iteration(NULL, false));

}


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

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

int32_t helper_fstoi(CPUSPARCState *env, float32 src)

{

    int32_t ret;

    clear_float_exceptions(env);

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

    check_ieee_exceptions(env);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+uint64_t helper_mullv (uint64_t op1, uint64_t op2)
+
+{
+
     int64_t res = (int64_t)op1 * (int64_t)op2;
+

     if (unlikely((int32_t)res != res)) {

uint64_t helper_mullv (uint64_t op1, uint64_t op2)

{

    int64_t res = (int64_t)op1 * (int64_t)op2;

    if (unlikely((int32_t)res != res)) {

        arith_excp(env, GETPC(), EXC_M_IOV, 0);

    }

    return (int64_t)((int32_t)res);

}


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

             buf_off += len;

+            iov_off += len;
+
+            size -= len;
+
+        }

         iovec_off += iov[i].iov_len;

size_t iov_from_buf(struct iovec *iov, unsigned int iov_cnt, size_t iov_off,

                    const void *buf, size_t size)

{

    size_t iovec_off, buf_off;

    unsigned int i;

    iovec_off = 0;

    buf_off = 0;

    for (i = 0; i < iov_cnt && size; i++) {

        if (iov_off < (iovec_off + iov[i].iov_len)) {

            size_t len = MIN((iovec_off + iov[i].iov_len) - iov_off, size);

            memcpy(iov[i].iov_base + (iov_off - iovec_off), buf + buf_off, len);

            buf_off += len;

            iov_off += len;

            size -= len;

        }

        iovec_off += iov[i].iov_len;

    }

    return buf_off;

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
     char filename[40];
     time_t today2 = time(NULL);
     struct tm *today = localtime(&today2);
+    snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
+             today->tm_sec);
     return opt_vstats_file(NULL, opt, filename);
 }

static int opt_vstats(void *optctx, const char *opt, const char *arg)
{
    char filename[40];
    time_t today2 = time(NULL);
    struct tm *today = localtime(&today2);
    snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
             today->tm_sec);
    return opt_vstats_file(NULL, opt, filename);
}


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

+        load_asl(exp_data.ssdt_tables, exp_sdt);
+
+        exp_asl = normalize_asl(exp_sdt->asl);
+
+

         g_assert(!g_strcmp0(asl->str, exp_asl->str));

static void test_acpi_asl(test_data *data)

{

    int i;

    AcpiSdtTable *sdt, *exp_sdt;

    test_data exp_data;

    memset(&exp_data, 0, sizeof(exp_data));

    exp_data.ssdt_tables = load_expected_aml(data);

    dump_aml_files(data);

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

        GString *asl, *exp_asl;

        sdt = &g_array_index(data->ssdt_tables, AcpiSdtTable, i);

        exp_sdt = &g_array_index(exp_data.ssdt_tables, AcpiSdtTable, i);

        load_asl(data->ssdt_tables, sdt);

        asl = normalize_asl(sdt->asl);

        load_asl(exp_data.ssdt_tables, exp_sdt);

        exp_asl = normalize_asl(exp_sdt->asl);

        g_assert(!g_strcmp0(asl->str, exp_asl->str));

        g_string_free(asl, true);

        g_string_free(exp_asl, true);

    }

    free_test_data(&exp_data);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void cpu_common_realizefn(DeviceState *dev, Error **errp)
+{
+    CPUState *cpu = CPU(dev);
     if (dev->hotplugged) {
         cpu_synchronize_post_init(cpu);
         cpu_resume(cpu);

static void cpu_common_realizefn(DeviceState *dev, Error **errp)
{
    CPUState *cpu = CPU(dev);
    if (dev->hotplugged) {
        cpu_synchronize_post_init(cpu);
        cpu_resume(cpu);
    }
}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
     /* Copy the sub-list and null-terminate it.  */

     pio = g_new(MemoryRegionPortio, count + 1);
+
+    memcpy(pio, pio_init, sizeof(MemoryRegionPortio) * count);
+
+    memset(pio + count, 0, sizeof(MemoryRegionPortio));
+

     /* Adjust the offsets to all be zero-based for the region.  */

static void portio_list_add_1(PortioList *piolist,

                              const MemoryRegionPortio *pio_init,

                              unsigned count, unsigned start,

                              unsigned off_low, unsigned off_high)

{

    MemoryRegionPortio *pio;

    MemoryRegionOps *ops;

    MemoryRegion *region, *alias;

    unsigned i;

    /* Copy the sub-list and null-terminate it.  */

    pio = g_new(MemoryRegionPortio, count + 1);

    memcpy(pio, pio_init, sizeof(MemoryRegionPortio) * count);

    memset(pio + count, 0, sizeof(MemoryRegionPortio));

    /* Adjust the offsets to all be zero-based for the region.  */

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

        pio[i].offset -= off_low;

    }

    ops = g_new0(MemoryRegionOps, 1);

    ops->old_portio = pio;

    region = g_new(MemoryRegion, 1);

    alias = g_new(MemoryRegion, 1);

    /*

     * Use an alias so that the callback is called with an absolute address,

     * rather than an offset relative to to start + off_low.

     */

    memory_region_init_io(region, ops, piolist->opaque, piolist->name,

                          INT64_MAX);

    memory_region_init_alias(alias, piolist->name,

                             region, start + off_low, off_high - off_low);

    memory_region_add_subregion(piolist->address_space,

                                start + off_low, alias);

    piolist->regions[piolist->nr] = region;

    piolist->aliases[piolist->nr] = alias;

    ++piolist->nr;

}


--- a/source.c
+++ b/source.c
@@ -4,6 +4,6 @@
     thread_pool_free(ctx->thread_pool);
     aio_set_event_notifier(ctx, &ctx->notifier, NULL);
     event_notifier_cleanup(&ctx->notifier);
+    rfifolock_destroy(&ctx->lock);
+    qemu_mutex_destroy(&ctx->bh_lock);
     timerlistgroup_deinit(&ctx->tlg);

aio_ctx_finalize(GSource     *source)
{
    AioContext *ctx = (AioContext *) source;
    thread_pool_free(ctx->thread_pool);
    aio_set_event_notifier(ctx, &ctx->notifier, NULL);
    event_notifier_cleanup(&ctx->notifier);
    rfifolock_destroy(&ctx->lock);
    qemu_mutex_destroy(&ctx->bh_lock);
    timerlistgroup_deinit(&ctx->tlg);


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
     if (!(--ref->buf->refcount)) {

         if (!ref->buf->free) {
+
+            store_in_pool(ref);
+
+            return;
+
         }

         ref->buf->free(ref->buf);

void avfilter_unref_buffer(AVFilterBufferRef *ref)

{

    if (!ref)

        return;

    av_assert0(ref->buf->refcount > 0);

    if (!(--ref->buf->refcount)) {

        if (!ref->buf->free) {

            store_in_pool(ref);

            return;

        }

        ref->buf->free(ref->buf);

    }

    if (ref->extended_data != ref->data)

        av_freep(&ref->extended_data);

    if (ref->video)

        av_freep(&ref->video->qp_table);

    av_freep(&ref->video);

    av_freep(&ref->audio);

    av_free(ref);

}


--- a/source.c
+++ b/source.c
@@ -7,5 +7,5 @@
     float32 f1 = make_float32(b);

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

uint32_t HELPER(neon_min_f32)(uint32_t a, uint32_t b)

{

    float32 f0 = make_float32(a);

    float32 f1 = make_float32(b);

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

}


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

         gdk_window_set_cursor(window, s->null_cursor);

+    } else {
+
+        gdk_window_set_cursor(window, NULL);
+
+    }

 }

static void gd_update_cursor(GtkDisplayState *s, gboolean override)

{

    GdkWindow *window;

    bool on_vga;

    window = gtk_widget_get_window(GTK_WIDGET(s->drawing_area));

    on_vga = (gtk_notebook_get_current_page(GTK_NOTEBOOK(s->notebook)) == 0);

    if ((override || on_vga) && kbd_mouse_is_absolute()) {

        gdk_window_set_cursor(window, s->null_cursor);

    } else {

        gdk_window_set_cursor(window, NULL);

    }

}


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

     /* see similar ffmpeg.c:grow_array() */

+    int nb, nb_alloc;

     intptr_t *tab;

void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem)

{

    /* see similar ffmpeg.c:grow_array() */

    int nb, nb_alloc;

    intptr_t *tab;

    nb = *nb_ptr;

    tab = *(intptr_t**)tab_ptr;

    if ((nb & (nb - 1)) == 0) {

        if (nb == 0)

            nb_alloc = 1;

        else

            nb_alloc = nb * 2;

        tab = av_realloc(tab, nb_alloc * sizeof(intptr_t));

        *(intptr_t**)tab_ptr = tab;

    }

    tab[nb++] = (intptr_t)elem;

    *nb_ptr = nb;

}


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

 {

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

static void vhost_iommu_region_add(MemoryListener *listener,

                                   MemoryRegionSection *section)

{

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

                                         iommu_listener);

    struct vhost_iommu *iommu;

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

        return;

    }

    iommu = g_malloc0(sizeof(*iommu));

    iommu->n.notify = vhost_iommu_unmap_notify;

    iommu->n.notifier_flags = IOMMU_NOTIFIER_UNMAP;

    iommu->mr = section->mr;

    iommu->iommu_offset = section->offset_within_address_space -

                          section->offset_within_region;

    iommu->hdev = dev;

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

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

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

}


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

            && toupper((tag >> 8)&0xFF) == toupper((tags->tag >> 8)&0xFF)

+           && toupper((tag >>16)&0xFF) == toupper((tags->tag >>16)&0xFF)
+
+           && toupper((tag >>24)&0xFF) == toupper((tags->tag >>24)&0xFF))
+
+            return tags->id;

         tags++;

enum CodecID codec_get_id(const CodecTag *tags, unsigned int tag)

{

    while (tags->id != 0) {

        if(   toupper((tag >> 0)&0xFF) == toupper((tags->tag >> 0)&0xFF)

           && toupper((tag >> 8)&0xFF) == toupper((tags->tag >> 8)&0xFF)

           && toupper((tag >>16)&0xFF) == toupper((tags->tag >>16)&0xFF)

           && toupper((tag >>24)&0xFF) == toupper((tags->tag >>24)&0xFF))

            return tags->id;

        tags++;

    }

    return CODEC_ID_NONE;

}


--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
     if (local_err) {

+        error_propagate(errp, local_err);
+
+        return NULL;
+
+    }

static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr,

                                                  Error **errp)

{

    QIOChannelSocket *sioc;

    Error *local_err = NULL;

    sioc = qio_channel_socket_new();

    qio_channel_set_name(QIO_CHANNEL(sioc), "nbd-client");

    qio_channel_socket_connect_sync(sioc,

                                    saddr,

                                    &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        return NULL;

    }

    qio_channel_set_delay(QIO_CHANNEL(sioc), false);

    return sioc;

}


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

 {

+    const char *filename = qemu_opt_get(opts, "path");

     CharDriverState *chr;

static CharDriverState *qemu_chr_open_tty(QemuOpts *opts)

{

    const char *filename = qemu_opt_get(opts, "path");

    CharDriverState *chr;

    int fd;

    TFR(fd = open(filename, O_RDWR | O_NONBLOCK));

    if (fd < 0) {

        return NULL;

    }

    tty_serial_init(fd, 115200, 'N', 8, 1);

    chr = qemu_chr_open_fd(fd, fd);

    if (!chr) {

        close(fd);

        return NULL;

    }

    chr->chr_ioctl = tty_serial_ioctl;

    chr->chr_close = qemu_chr_close_tty;

    return chr;

}


--- a/source.c
+++ b/source.c
@@ -53,9 +53,9 @@
         tlb_flush_page(cs, page ^ 0x80000000);

     } else {
+
+        tlb_flush_page_all_cpus_synced(cs, page ^ 0x80000000);
+
+    }
+
 }

void HELPER(ipte)(CPUS390XState *env, uint64_t pto, uint64_t vaddr,

                  uint32_t m4)

{

    CPUState *cs = CPU(s390_env_get_cpu(env));

    uint64_t page = vaddr & TARGET_PAGE_MASK;

    uint64_t pte_addr, pte;

    /* Compute the page table entry address */

    pte_addr = (pto & _SEGMENT_ENTRY_ORIGIN);

    pte_addr += (vaddr & VADDR_PX) >> 9;

    /* Mark the page table entry as invalid */

    pte = ldq_phys(cs->as, pte_addr);

    pte |= _PAGE_INVALID;

    stq_phys(cs->as, pte_addr, pte);

    /* XXX we exploit the fact that Linux passes the exact virtual

       address here - it's not obliged to! */

    if (m4 & 1) {

        tlb_flush_page(cs, page);

    } else {

        tlb_flush_page_all_cpus_synced(cs, page);

    }

    /* XXX 31-bit hack */

    if (m4 & 1) {

        tlb_flush_page(cs, page ^ 0x80000000);

    } else {

        tlb_flush_page_all_cpus_synced(cs, page ^ 0x80000000);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void ff_h264_direct_dist_scale_factor(H264Context * const h){
+
     const int poc = h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM_FIELD];

     const int poc1 = h->ref_list[1][0].poc;

void ff_h264_direct_dist_scale_factor(H264Context * const h){

    const int poc = h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM_FIELD];

    const int poc1 = h->ref_list[1][0].poc;

    int i, field;

    if (FRAME_MBAFF(h))

        for (field = 0; field < 2; field++){

            const int poc  = h->cur_pic_ptr->field_poc[field];

            const int poc1 = h->ref_list[1][0].field_poc[field];

            for (i = 0; i < 2 * h->ref_count[0]; i++)

                h->dist_scale_factor_field[field][i^field] =

                    get_scale_factor(h, poc, poc1, i+16);

        }

    for (i = 0; i < h->ref_count[0]; i++){

        h->dist_scale_factor[i] = get_scale_factor(h, poc, poc1, i);

    }

}


--- a/source.c
+++ b/source.c
@@ -11,7 +11,7 @@
     /* Access real host bridge. */

     int rc = snprintf(path, size, "/sys/bus/pci/devices/%04x:%02x:%02x.%d/%s",
+
                       0, 0, 0, 0, "config");

@@ -19,7 +19,7 @@
     if (rc >= size || rc < 0) {

         return -ENODEV;
+
     }

static int host_pci_config_read(int pos, int len, uint32_t val)

{

    char path[PATH_MAX];

    int config_fd;

    ssize_t size = sizeof(path);

    /* Access real host bridge. */

    int rc = snprintf(path, size, "/sys/bus/pci/devices/%04x:%02x:%02x.%d/%s",

                      0, 0, 0, 0, "config");

    if (rc >= size || rc < 0) {

        return -ENODEV;

    }

    config_fd = open(path, O_RDWR);

    if (config_fd < 0) {

        return -ENODEV;

    }

    if (lseek(config_fd, pos, SEEK_SET) != pos) {

        return -errno;

    }

    do {

        rc = read(config_fd, (uint8_t *)&val, len);

    } while (rc < 0 && (errno == EINTR || errno == EAGAIN));

    if (rc != len) {

        return -errno;

    }

    return 0;

}


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

     ffm->write_index = pos;

+    ffm->file_size = file_size;
+
+}

static void ffm_set_write_index(AVFormatContext *s, int64_t pos,

                                int64_t file_size)

{

    FFMContext *ffm = s->priv_data;

    ffm->write_index = pos;

    ffm->file_size = file_size;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void *av_mallocz_static(unsigned int size)
+
+{
+
+    void *ptr = av_mallocz(size);
+

+
     if(ptr){

         array_static =av_fast_realloc(array_static, &allocated_static, sizeof(void*)*(last_static+1));

static void *av_mallocz_static(unsigned int size)

{

    void *ptr = av_mallocz(size);

    if(ptr){

        array_static =av_fast_realloc(array_static, &allocated_static, sizeof(void*)*(last_static+1));

        if(!array_static)

            return NULL;

        array_static[last_static++] = ptr;

    }

    return ptr;

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     TypeInfo ti = {

         .name       = name,
+
+        .parent     = TYPE_MACHINE,
+
+        .class_init = machine_class_init,
+
         .class_data = (void *)m,

     };

int qemu_register_machine(QEMUMachine *m)

{

    char *name = g_strconcat(m->name, TYPE_MACHINE_SUFFIX, NULL);

    TypeInfo ti = {

        .name       = name,

        .parent     = TYPE_MACHINE,

        .class_init = machine_class_init,

        .class_data = (void *)m,

    };

    type_register(&ti);

    g_free(name);

    return 0;

}


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

     HTTPContext *s = h->priv_data;
+
+
+
+    h->is_streamed = 1;
+

     s->filesize = -1;

static int http_open(URLContext *h, const char *uri, int flags)

{

    HTTPContext *s = h->priv_data;

    h->is_streamed = 1;

    s->filesize = -1;

    av_strlcpy(s->location, uri, sizeof(s->location));

    if (s->headers) {

        int len = strlen(s->headers);

        if (len < 2 || strcmp("\r\n", s->headers + len - 2))

            av_log(h, AV_LOG_WARNING, "No trailing CRLF found in HTTP header.\n");

    }

    return http_open_cnx(h);

}


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

+    if (pdu->id >= ARRAY_SIZE(pdu_co_handlers) ||
+
         (pdu_co_handlers[pdu->id] == NULL)) {

         handler = v9fs_op_not_supp;

void pdu_submit(V9fsPDU *pdu)

{

    Coroutine *co;

    CoroutineEntry *handler;

    V9fsState *s = pdu->s;

    if (pdu->id >= ARRAY_SIZE(pdu_co_handlers) ||

        (pdu_co_handlers[pdu->id] == NULL)) {

        handler = v9fs_op_not_supp;

    } else {

        handler = pdu_co_handlers[pdu->id];

    }

    if (is_ro_export(&s->ctx) && !is_read_only_op(pdu)) {

        handler = v9fs_fs_ro;

    }

    co = qemu_coroutine_create(handler);

    qemu_coroutine_enter(co, pdu);

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
         unsigned n = FFMAX(*nb_files_alloc * 2, 16);

         ConcatFile *new_files;
+
+        if (n <= cat->nb_files || n > SIZE_MAX / sizeof(*cat->files) ||
+
+            !(new_files = av_realloc(cat->files, n * sizeof(*cat->files))))
+
             return AVERROR(ENOMEM);

         cat->files = new_files;

static int add_file(AVFormatContext *avf, char *filename, ConcatFile **rfile,

                    unsigned *nb_files_alloc)

{

    ConcatContext *cat = avf->priv_data;

    ConcatFile *file;

    char *url;

    size_t url_len;

    url_len = strlen(avf->filename) + strlen(filename) + 16;

    if (!(url = av_malloc(url_len)))

        return AVERROR(ENOMEM);

    ff_make_absolute_url(url, url_len, avf->filename, filename);

    av_free(filename);

    if (cat->nb_files >= *nb_files_alloc) {

        unsigned n = FFMAX(*nb_files_alloc * 2, 16);

        ConcatFile *new_files;

        if (n <= cat->nb_files || n > SIZE_MAX / sizeof(*cat->files) ||

            !(new_files = av_realloc(cat->files, n * sizeof(*cat->files))))

            return AVERROR(ENOMEM);

        cat->files = new_files;

        *nb_files_alloc = n;

    }

    file = &cat->files[cat->nb_files++];

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

    *rfile = file;

    file->url        = url;

    file->start_time = AV_NOPTS_VALUE;

    file->duration   = AV_NOPTS_VALUE;

    return 0;

}


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

+
+    trace_xics_icp_accept(xirr, ss->xirr);
+
+
+
     return xirr;

 }

static uint32_t icp_accept(struct icp_server_state *ss)

{

    uint32_t xirr = ss->xirr;

    qemu_irq_lower(ss->output);

    ss->xirr = ss->pending_priority << 24;

    trace_xics_icp_accept(xirr, ss->xirr);

    return xirr;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void t_gen_lsr(TCGv d, TCGv a, TCGv b)
+
+{
+
+	TCGv t0, t_31;
+

 	t0 = tcg_temp_new(TCG_TYPE_TL);

static void t_gen_lsr(TCGv d, TCGv a, TCGv b)

{

	TCGv t0, t_31;

	t0 = tcg_temp_new(TCG_TYPE_TL);

	t_31 = tcg_temp_new(TCG_TYPE_TL);

	tcg_gen_shr_tl(d, a, b);

	tcg_gen_movi_tl(t_31, 31);

	tcg_gen_sub_tl(t0, t_31, b);

	tcg_gen_sar_tl(t0, t0, t_31);

	tcg_gen_and_tl(t0, t0, d);

	tcg_gen_xor_tl(d, d, t0);

	tcg_temp_free(t0);

	tcg_temp_free(t_31);

}


--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
     pool->cur_threads -= pool->new_threads;

     pool->new_threads = 0;
+
+
+
+    /* Wait for worker threads to terminate */
+
     pool->stopping = true;

     while (pool->cur_threads > 0) {

void thread_pool_free(ThreadPool *pool)

{

    if (!pool) {

        return;

    }

    assert(QLIST_EMPTY(&pool->head));

    qemu_mutex_lock(&pool->lock);

    /* Stop new threads from spawning */

    qemu_bh_delete(pool->new_thread_bh);

    pool->cur_threads -= pool->new_threads;

    pool->new_threads = 0;

    /* Wait for worker threads to terminate */

    pool->stopping = true;

    while (pool->cur_threads > 0) {

        qemu_sem_post(&pool->sem);

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

    }

    qemu_mutex_unlock(&pool->lock);

    qemu_bh_delete(pool->completion_bh);

    qemu_sem_destroy(&pool->sem);

    qemu_cond_destroy(&pool->worker_stopped);

    qemu_mutex_destroy(&pool->lock);

    g_free(pool);

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
     g_assert(aio_poll(ctx, false));

     g_assert_cmpint(data.n, ==, 1);
+
+
+
+    g_assert(aio_poll(ctx, true));
+
     g_assert_cmpint(data.n, ==, 2);

static void test_bh_schedule10(void)

{

    BHTestData data = { .n = 0, .max = 10 };

    data.bh = aio_bh_new(ctx, bh_test_cb, &data);

    qemu_bh_schedule(data.bh);

    g_assert_cmpint(data.n, ==, 0);

    g_assert(aio_poll(ctx, false));

    g_assert_cmpint(data.n, ==, 1);

    g_assert(aio_poll(ctx, true));

    g_assert_cmpint(data.n, ==, 2);

    wait_for_aio();

    g_assert_cmpint(data.n, ==, 10);

    g_assert(!aio_poll(ctx, false));

    g_assert_cmpint(data.n, ==, 10);

    qemu_bh_delete(data.bh);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void usage(const char *cmd)
+
 {

     printf(

static void usage(const char *cmd)

{

    printf(

"Usage: %s [-m <method> -p <path>] [<options>]\n"

"QEMU Guest Agent %s\n"

"\n"

"  -m, --method      transport method: one of unix-listen, virtio-serial, or\n"

"                    isa-serial (virtio-serial is the default)\n"

"  -p, --path        device/socket path (the default for virtio-serial is:\n"

"                    %s)\n"

"  -l, --logfile     set logfile path, logs to stderr by default\n"

"  -f, --pidfile     specify pidfile (default is %s)\n"

"  -v, --verbose     log extra debugging information\n"

"  -V, --version     print version information and exit\n"

"  -d, --daemonize   become a daemon\n"

#ifdef _WIN32

"  -s, --service     service commands: install, uninstall\n"

#endif

"  -b, --blacklist   comma-separated list of RPCs to disable (no spaces, \"?\"\n"

"                    to list available RPCs)\n"

"  -h, --help        display this help and exit\n"

"\n"

"Report bugs to <mdroth@linux.vnet.ibm.com>\n"

    , cmd, QGA_VERSION, QGA_VIRTIO_PATH_DEFAULT, QGA_PIDFILE_DEFAULT);

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
+static unsigned int get_video_format_idx(AVCodecContext *avctx)
+
+{
+
+    unsigned int ret_idx = 0;
+
+    unsigned int idx;
+
+    unsigned int num_formats = sizeof(ff_schro_video_format_info) /

                                sizeof(ff_schro_video_format_info[0]);
+

     for (idx = 1; idx < num_formats; ++idx) {

static unsigned int get_video_format_idx(AVCodecContext *avctx)

{

    unsigned int ret_idx = 0;

    unsigned int idx;

    unsigned int num_formats = sizeof(ff_schro_video_format_info) /

                               sizeof(ff_schro_video_format_info[0]);

    for (idx = 1; idx < num_formats; ++idx) {

        const SchroVideoFormatInfo *vf = &ff_schro_video_format_info[idx];

        if (avctx->width  == vf->width &&

            avctx->height == vf->height) {

            ret_idx = idx;

            if (avctx->time_base.den == vf->frame_rate_num &&

                avctx->time_base.num == vf->frame_rate_denom)

                return idx;

        }

    }

    return ret_idx;

}


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

 {

+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(klass);
+
+

     hc->root_bus_path = i440fx_pcihost_root_bus_path;

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(klass);

    hc->root_bus_path = i440fx_pcihost_root_bus_path;

    dc->realize = i440fx_pcihost_realize;

    dc->fw_name = "pci";

    dc->props = i440fx_props;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void arm_thiswdog_write(void *opaque, target_phys_addr_t addr,
+
+                               uint64_t value, unsigned size)
+
 {

     arm_mptimer_state *s = (arm_mptimer_state *)opaque;

static void arm_thiswdog_write(void *opaque, target_phys_addr_t addr,

                               uint64_t value, unsigned size)

{

    arm_mptimer_state *s = (arm_mptimer_state *)opaque;

    int id = get_current_cpu(s);

    timerblock_write(&s->timerblock[id * 2 + 1], addr, value, size);

}


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

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

     } else {

build_header(GArray *linker, GArray *table_data,

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

             const char *oem_id, const char *oem_table_id)

{

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

    h->length = cpu_to_le32(len);

    h->revision = rev;

    if (oem_id) {

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

    } else {

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

    }

    if (oem_table_id) {

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

    } else {

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

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

    }

    h->oem_revision = cpu_to_le32(1);

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

    h->asl_compiler_revision = cpu_to_le32(1);

    h->checksum = 0;

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

    bios_linker_loader_add_checksum(linker, ACPI_BUILD_TABLE_FILE,

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

}


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

         return -1;

+
+
+    /* compute the position by aligning it to block_align */
+
+    pos = av_rescale_rnd(timestamp * byte_rate,

                          st->time_base.num,

int pcm_read_seek(AVFormatContext *s,

                  int stream_index, int64_t timestamp, int flags)

{

    AVStream *st;

    int block_align, byte_rate;

    int64_t pos;

    st = s->streams[0];

    block_align = st->codec->block_align ? st->codec->block_align :

        (av_get_bits_per_sample(st->codec->codec_id) * st->codec->channels) >> 3;

    byte_rate = st->codec->bit_rate ? st->codec->bit_rate >> 3 :

        block_align * st->codec->sample_rate;

    if (block_align <= 0 || byte_rate <= 0)

        return -1;

    /* compute the position by aligning it to block_align */

    pos = av_rescale_rnd(timestamp * byte_rate,

                         st->time_base.num,

                         st->time_base.den * (int64_t)block_align,

                         (flags & AVSEEK_FLAG_BACKWARD) ? AV_ROUND_DOWN : AV_ROUND_UP);

    pos *= block_align;

    /* recompute exact position */

    st->cur_dts = av_rescale(pos, st->time_base.den, byte_rate * (int64_t)st->time_base.num);

    url_fseek(s->pb, pos + s->data_offset, SEEK_SET);

    return 0;

}


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

{

    exit(0);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
 			       TCGv d, TCGv op_a, TCGv op_b, int size)

 {
+
 	TCGv tmp;

 	int writeback;

static void cris_alu(DisasContext *dc, int op,

			       TCGv d, TCGv op_a, TCGv op_b, int size)

{

	TCGv tmp;

	int writeback;

	writeback = 1;

	if (op == CC_OP_BOUND || op == CC_OP_BTST)

		tmp = tcg_temp_local_new(TCG_TYPE_TL);

	else

		tmp = tcg_temp_new(TCG_TYPE_TL);

	if (op == CC_OP_CMP) {

		writeback = 0;

	} else if (size == 4) {

		tmp = d;

		writeback = 0;

	}

	cris_pre_alu_update_cc(dc, op, op_a, op_b, size);

	cris_alu_op_exec(dc, op, tmp, op_a, op_b, size);

	cris_update_result(dc, tmp);

	/* Writeback.  */

	if (writeback) {

		if (size == 1)

			tcg_gen_andi_tl(d, d, ~0xff);

		else

			tcg_gen_andi_tl(d, d, ~0xffff);

		tcg_gen_or_tl(d, d, tmp);

	}

	if (tmp != d)

		tcg_temp_free(tmp);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+int av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flags)

 {

int av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flags)

{

    BufferSinkContext *buf = ctx->priv;

    AVFilterLink *inlink = ctx->inputs[0];

    int ret;

    AVFrame *cur_frame;

    /* no picref available, fetch it from the filterchain */

    if (!av_fifo_size(buf->fifo)) {

        if (flags & AV_BUFFERSINK_FLAG_NO_REQUEST)

            return AVERROR(EAGAIN);

        if ((ret = ff_request_frame(inlink)) < 0)

            return ret;

    }

    if (!av_fifo_size(buf->fifo))

        return AVERROR(EINVAL);

    if (flags & AV_BUFFERSINK_FLAG_PEEK) {

        cur_frame = *((AVFrame **)av_fifo_peek2(buf->fifo, 0));

        av_frame_ref(frame, cur_frame); /* TODO check failure */

    } else {

        av_fifo_generic_read(buf->fifo, &cur_frame, sizeof(cur_frame), NULL);

        av_frame_move_ref(frame, cur_frame);

        av_frame_free(&cur_frame);

    }

    return 0;

}


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

         QEMUIOVector *qiov, int nb_sectors,

+        BlockDriverCompletionFunc *cb, void *opaque)
+
+{
+
+    BDRVRawState *s = bs->opaque;

     RawAIOCB *acb;

static RawAIOCB *raw_aio_setup(BlockDriverState *bs, int64_t sector_num,

        QEMUIOVector *qiov, int nb_sectors,

        BlockDriverCompletionFunc *cb, void *opaque)

{

    BDRVRawState *s = bs->opaque;

    RawAIOCB *acb;

    if (fd_open(bs) < 0)

        return NULL;

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

    if (!acb)

        return NULL;

    acb->aiocb.aio_fildes = s->fd;

    acb->aiocb.ev_signo = SIGUSR2;

    acb->aiocb.aio_iov = qiov->iov;

    acb->aiocb.aio_niov = qiov->niov;

    acb->aiocb.aio_nbytes = nb_sectors * 512;

    acb->aiocb.aio_offset = sector_num * 512;

    acb->aiocb.aio_flags = 0;

    /*

     * If O_DIRECT is used the buffer needs to be aligned on a sector

     * boundary. Tell the low level code to ensure that in case it's

     * not done yet.

     */

    if (s->aligned_buf)

        acb->aiocb.aio_flags |= QEMU_AIO_SECTOR_ALIGNED;

    acb->next = posix_aio_state->first_aio;

    posix_aio_state->first_aio = acb;

    return acb;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+void kvm_s390_interrupt(S390CPU *cpu, int type, uint32_t code)

 {

void kvm_s390_interrupt(S390CPU *cpu, int type, uint32_t code)

{

    kvm_s390_interrupt_internal(cpu, type, code, 0, 0);

}