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

                                       Error **errp)

+{
+
+    Q35PCIHost *s = Q35_HOST_DEVICE(obj);
+
     uint32_t value = s->mch.pci_hole.end;

static void q35_host_get_pci_hole_end(Object *obj, Visitor *v,

                                      const char *name, void *opaque,

                                      Error **errp)

{

    Q35PCIHost *s = Q35_HOST_DEVICE(obj);

    uint32_t value = s->mch.pci_hole.end;

    visit_type_uint32(v, name, &value, errp);

}


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

     if (unlikely(!ctx->spe_enabled)) {
+
+        gen_exception(ctx, POWERPC_EXCP_APU);
+
+        return;
+
     }

static inline void gen_evmwumiaa(DisasContext *ctx)

{

    TCGv_i64 acc;

    TCGv_i64 tmp;

    if (unlikely(!ctx->spe_enabled)) {

        gen_exception(ctx, POWERPC_EXCP_APU);

        return;

    }

    gen_evmwumi(ctx);           /* rD := rA * rB */

    acc = tcg_temp_new_i64();

    tmp = tcg_temp_new_i64();

    /* tmp := rD */

    gen_load_gpr64(tmp, rD(ctx->opcode));

    /* Load acc */

    tcg_gen_ld_i64(acc, cpu_env, offsetof(CPUState, spe_acc));

    /* acc := tmp + acc */

    tcg_gen_add_i64(acc, acc, tmp);

    /* Store acc */

    tcg_gen_st_i64(acc, cpu_env, offsetof(CPUState, spe_acc));

    /* rD := acc */

    gen_store_gpr64(rD(ctx->opcode), acc);

    tcg_temp_free_i64(acc);

    tcg_temp_free_i64(tmp);

}


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

 {

const char * avdevice_configuration(void)

{

    return FFMPEG_CONFIGURATION;

}


--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
         env->tlb_table[0][i].addr_read = -1;

         env->tlb_table[0][i].addr_write = -1;
+
+        env->tlb_table[0][i].addr_code = -1;
+
+        env->tlb_table[1][i].addr_read = -1;
+
         env->tlb_table[1][i].addr_write = -1;

         env->tlb_table[1][i].addr_code = -1;

void tlb_flush(CPUState *env, int flush_global)

{

    int i;

#if defined(DEBUG_TLB)

    printf("tlb_flush:\n");

#endif

    /* must reset current TB so that interrupts cannot modify the

       links while we are modifying them */

    env->current_tb = NULL;

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

        env->tlb_table[0][i].addr_read = -1;

        env->tlb_table[0][i].addr_write = -1;

        env->tlb_table[0][i].addr_code = -1;

        env->tlb_table[1][i].addr_read = -1;

        env->tlb_table[1][i].addr_write = -1;

        env->tlb_table[1][i].addr_code = -1;

#if (NB_MMU_MODES >= 3)

        env->tlb_table[2][i].addr_read = -1;

        env->tlb_table[2][i].addr_write = -1;

        env->tlb_table[2][i].addr_code = -1;

#if (NB_MMU_MODES == 4)

        env->tlb_table[3][i].addr_read = -1;

        env->tlb_table[3][i].addr_write = -1;

        env->tlb_table[3][i].addr_code = -1;

#endif

#endif

    }

    memset (env->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof (void *));

#ifdef USE_KQEMU

    if (env->kqemu_enabled) {

        kqemu_flush(env, flush_global);

    }

#endif

    tlb_flush_count++;

}


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

 {

+    int slot = PCI_SLOT(dev->devfn);
+
     PIIX4PMState *s = DO_UPCAST(PIIX4PMState, dev,

                                 PCI_DEVICE(qdev));

static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev,

				PCIHotplugState state)

{

    int slot = PCI_SLOT(dev->devfn);

    PIIX4PMState *s = DO_UPCAST(PIIX4PMState, dev,

                                PCI_DEVICE(qdev));

    /* Don't send event when device is enabled during qemu machine creation:

     * it is present on boot, no hotplug event is necessary. We do send an

     * event when the device is disabled later. */

    if (state == PCI_COLDPLUG_ENABLED) {

        return 0;

    }

    s->pci0_status.up = 0;

    s->pci0_status.down = 0;

    if (state == PCI_HOTPLUG_ENABLED) {

        enable_device(s, slot);

    } else {

        disable_device(s, slot);

    }

    pm_update_sci(s);

    return 0;

}


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

                           size << it_shift);

+    vmstate_register(NULL, -1, &vmstate_macio_nvram, s);
+
+    qemu_register_reset(macio_nvram_reset, s);
+
+

     return s;

MacIONVRAMState *macio_nvram_init (target_phys_addr_t size,

                                   unsigned int it_shift)

{

    MacIONVRAMState *s;

    s = g_malloc0(sizeof(MacIONVRAMState));

    s->data = g_malloc0(size);

    s->size = size;

    s->it_shift = it_shift;

    memory_region_init_io(&s->mem, &macio_nvram_ops, s, "macio-nvram",

                          size << it_shift);

    vmstate_register(NULL, -1, &vmstate_macio_nvram, s);

    qemu_register_reset(macio_nvram_reset, s);

    return s;

}


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

     FlushCo flush_co = {

+        .bs = bs,

         .ret = NOT_DONE,

int bdrv_flush(BlockDriverState *bs)

{

    Coroutine *co;

    FlushCo flush_co = {

        .bs = bs,

        .ret = NOT_DONE,

    };

    if (qemu_in_coroutine()) {

        /* Fast-path if already in coroutine context */

        bdrv_flush_co_entry(&flush_co);

    } else {

        co = qemu_coroutine_create(bdrv_flush_co_entry, &flush_co);

        qemu_coroutine_enter(co);

        BDRV_POLL_WHILE(bs, flush_co.ret == NOT_DONE);

    }

    return flush_co.ret;

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     vdev->vbasedev.group = NULL;

     trace_vfio_put_device(vdev->vbasedev.fd);
+
+    close(vdev->vbasedev.fd);
+
+    g_free(vdev->vbasedev.name);
+
     if (vdev->msix) {

         g_free(vdev->msix);

static void vfio_put_device(VFIOPCIDevice *vdev)

{

    QLIST_REMOVE(vdev, next);

    vdev->vbasedev.group = NULL;

    trace_vfio_put_device(vdev->vbasedev.fd);

    close(vdev->vbasedev.fd);

    g_free(vdev->vbasedev.name);

    if (vdev->msix) {

        g_free(vdev->msix);

        vdev->msix = NULL;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int mxf_read_material_package(MXFPackage *package, ByteIOContext *pb, int tag)

 {

static int mxf_read_material_package(MXFPackage *package, ByteIOContext *pb, int tag)

{

    switch(tag) {

    case 0x4403:

        package->tracks_count = get_be32(pb);

        if (package->tracks_count >= UINT_MAX / sizeof(UID))

            return -1;

        package->tracks_refs = av_malloc(package->tracks_count * sizeof(UID));

        if (!package->tracks_refs)

            return -1;

        url_fskip(pb, 4); /* useless size of objects, always 16 according to specs */

        get_buffer(pb, (uint8_t *)package->tracks_refs, package->tracks_count * sizeof(UID));

        break;

    }

    return 0;

}


static void id3v2_read_ttag(AVFormatContext *s, int taglen, char *dst, int dstlen)

{

    char *q;

    int len;

    if(dstlen > 0)

        dst[0]= 0;

    if(taglen < 1)

        return;

    taglen--; /* account for encoding type byte */

    dstlen--; /* Leave space for zero terminator */

    switch(get_byte(s->pb)) { /* encoding type */

    case 0:  /* ISO-8859-1 (0 - 255 maps directly into unicode) */

        q = dst;

        while(taglen--) {

            uint8_t tmp;

            PUT_UTF8(get_byte(s->pb), tmp, if (q - dst < dstlen - 1) *q++ = tmp;)

        }

        *q = '\0';

        break;

    case 3:  /* UTF-8 */

        len = FFMIN(taglen, dstlen);

        get_buffer(s->pb, dst, len);

        dst[len] = 0;

        break;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void do_log(int loglevel, const char *format, ...)
+
+{
+
+    va_list ap;
+

     va_start(ap, format);

static void do_log(int loglevel, const char *format, ...)

{

    va_list ap;

    va_start(ap, format);

    if (is_daemon) {

        vsyslog(LOG_CRIT, format, ap);

    } else {

        vfprintf(stderr, format, ap);

    }

    va_end(ap);

}


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

+
+    uint64_t now = qemu_clock_get_ns(rtc_clock);
+
+    if (now < s->next_periodic_time ||
+
         now > (s->next_periodic_time + get_max_clock_jump())) {

         periodic_timer_update(s, qemu_clock_get_ns(rtc_clock));

static int rtc_post_load(void *opaque, int version_id)

{

    RTCState *s = opaque;

    if (version_id <= 2 || rtc_clock == QEMU_CLOCK_REALTIME) {

        rtc_set_time(s);

        s->offset = 0;

        check_update_timer(s);

    }

    uint64_t now = qemu_clock_get_ns(rtc_clock);

    if (now < s->next_periodic_time ||

        now > (s->next_periodic_time + get_max_clock_jump())) {

        periodic_timer_update(s, qemu_clock_get_ns(rtc_clock));

    }

#ifdef TARGET_I386

    if (version_id >= 2) {

        if (s->lost_tick_policy == LOST_TICK_POLICY_SLEW) {

            rtc_coalesced_timer_update(s);

        }

    }

#endif

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,19 +1,19 @@
+static void update_pam(PCII440FXState *d, uint32_t start, uint32_t end, int r,
+
+                       PAMMemoryRegion *mem)
+
 {
+
+    if (mem->initialized) {
+
+        memory_region_del_subregion(d->system_memory, &mem->mem);
+
         memory_region_destroy(&mem->mem);
+
     }

+
+
     //    printf("ISA mapping %08x-0x%08x: %d\n", start, end, r);

     switch(r) {

static void update_pam(PCII440FXState *d, uint32_t start, uint32_t end, int r,

                       PAMMemoryRegion *mem)

{

    if (mem->initialized) {

        memory_region_del_subregion(d->system_memory, &mem->mem);

        memory_region_destroy(&mem->mem);

    }

    //    printf("ISA mapping %08x-0x%08x: %d\n", start, end, r);

    switch(r) {

    case 3:

        /* RAM */

        memory_region_init_alias(&mem->mem, "pam-ram", d->ram_memory,

                                 start, end - start);

        break;

    case 1:

        /* ROM (XXX: not quite correct) */

        memory_region_init_alias(&mem->mem, "pam-rom", d->ram_memory,

                                 start, end - start);

        memory_region_set_readonly(&mem->mem, true);

        break;

    case 2:

    case 0:

        /* XXX: should distinguish read/write cases */

        memory_region_init_alias(&mem->mem, "pam-pci", d->pci_address_space,

                                 start, end - start);

        break;

    }

    memory_region_add_subregion_overlap(d->system_memory,

                                        start, &mem->mem, 1);

    mem->initialized = true;

}


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

+
+    av_frame_free(&avctx->coded_frame);
+
+
+
     return 0;

 }

static av_cold int X264_close(AVCodecContext *avctx)

{

    X264Context *x4 = avctx->priv_data;

    av_freep(&avctx->extradata);

    av_freep(&x4->sei);

    if (x4->enc) {

        x264_encoder_close(x4->enc);

        x4->enc = NULL;

    }

    av_frame_free(&avctx->coded_frame);

    return 0;

}


static void vmxnet3_fill_stats(VMXNET3State *s)

{

    int i;

    if (!s->device_active)

        return;

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

        pci_dma_write(PCI_DEVICE(s),

                      s->txq_descr[i].tx_stats_pa,

                      &s->txq_descr[i].txq_stats,

                      sizeof(s->txq_descr[i].txq_stats));

    }

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

        pci_dma_write(PCI_DEVICE(s),

                      s->rxq_descr[i].rx_stats_pa,

                      &s->rxq_descr[i].rxq_stats,

                      sizeof(s->rxq_descr[i].rxq_stats));

    }

}


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

+    for (i = 0; i < 13; i++)
+
+        layout |= thd_layout[i] * ((chanmap >> i) & 1);
+

     return layout;

static int64_t truehd_layout(int chanmap)

{

    int layout = 0, i;

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

        layout |= thd_layout[i] * ((chanmap >> i) & 1);

    return layout;

}


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

+
+	if (ctx->Pflag) {
+
+		void *cmp_buf = malloc(ctx->qiov.size);
+

 		memset(cmp_buf, ctx->pattern, ctx->qiov.size);

aio_read_done(void *opaque, int ret)

{

	struct aio_ctx *ctx = opaque;

	struct timeval t2;

	gettimeofday(&t2, NULL);

	if (ret < 0) {

		printf("readv failed: %s\n", strerror(-ret));

		return;

	}

	if (ctx->Pflag) {

		void *cmp_buf = malloc(ctx->qiov.size);

		memset(cmp_buf, ctx->pattern, ctx->qiov.size);

		if (memcmp(ctx->buf, cmp_buf, ctx->qiov.size)) {

			printf("Pattern verification failed at offset %lld, "

				"%zd bytes\n",

				(long long) ctx->offset, ctx->qiov.size);

		}

		free(cmp_buf);

	}

	if (ctx->qflag) {

		return;

	}

	if (ctx->vflag) {

		dump_buffer(ctx->buf, ctx->offset, ctx->qiov.size);

	}

	/* Finally, report back -- -C gives a parsable format */

	t2 = tsub(t2, ctx->t1);

	print_report("read", &t2, ctx->offset, ctx->qiov.size,

		     ctx->qiov.size, 1, ctx->Cflag);

	qemu_io_free(ctx->buf);

	free(ctx);

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     ssize_t len = sizeof(ACL_DEFAULT);

+
     if (!value) {

         return len;

static ssize_t mp_dacl_listxattr(FsContext *ctx, const char *path,

                                 char *name, void *value, size_t osize)

{

    ssize_t len = sizeof(ACL_DEFAULT);

    if (!value) {

        return len;

    }

    if (osize < len) {

        errno = ERANGE;

        return -1;

    }

    /* len includes the trailing NUL */

    memcpy(value, ACL_ACCESS, len);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
 	ip_id = tt.tv_sec & 0xffff;

 	udp_init();
+
+	tcp_init();
+
 }

ip_init(void)

{

	ipq.ip_link.next = ipq.ip_link.prev = &ipq.ip_link;

	ip_id = tt.tv_sec & 0xffff;

	udp_init();

	tcp_init();

}


static av_cold int pcm_encode_close(AVCodecContext *avctx)

{

    av_freep(&avctx->coded_frame);

    return 0;

}


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

     RAMBlock *prev;

+    RAMBlock **prevp;
+
+    RAMBlock *block;
+
+    uint8_t *host = ptr;

ram_addr_t qemu_ram_addr_from_host(void *ptr)

{

    RAMBlock *prev;

    RAMBlock **prevp;

    RAMBlock *block;

    uint8_t *host = ptr;

#ifdef CONFIG_KQEMU

    if (kqemu_phys_ram_base) {

        return host - kqemu_phys_ram_base;

    }

#endif

    prev = NULL;

    prevp = &ram_blocks;

    block = ram_blocks;

    while (block && (block->host > host

                     || block->host + block->length <= host)) {

        if (prev)

          prevp = &prev->next;

        prev = block;

        block = block->next;

    }

    if (!block) {

        fprintf(stderr, "Bad ram pointer %p\n", ptr);

        abort();

    }

    return block->offset + (host - block->host);

}


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

     int index = qdict_get_int(qdict, "index");
+
+    if (mon_set_cpu(index) < 0)

         qemu_error_new(QERR_INVALID_CPU_INDEX);

static void do_cpu_set(Monitor *mon, const QDict *qdict, QObject **ret_data)

{

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

    if (mon_set_cpu(index) < 0)

        qemu_error_new(QERR_INVALID_CPU_INDEX);

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     index = sector_num / s->tracks;

     offset = sector_num % s->tracks;
+
+
+
+    /* not allocated */
+
     if ((index >= s->catalog_size) || (s->catalog_bitmap[index] == 0))

         return -1;

static int64_t seek_to_sector(BDRVParallelsState *s, int64_t sector_num)

{

    uint32_t index, offset;

    index = sector_num / s->tracks;

    offset = sector_num % s->tracks;

    /* not allocated */

    if ((index >= s->catalog_size) || (s->catalog_bitmap[index] == 0))

        return -1;

    return (uint64_t)s->catalog_bitmap[index] * s->off_multiplier + offset;

}


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

     } else {

+        need_cmp = true;
+
+        tcg_out_cmp(s, ext, a, b, b_const);
+
+    }

static void tcg_out_brcond(TCGContext *s, TCGMemOp ext, TCGCond c, TCGArg a,

                           TCGArg b, bool b_const, int label)

{

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

    intptr_t offset;

    bool need_cmp;

    if (b_const && b == 0 && (c == TCG_COND_EQ || c == TCG_COND_NE)) {

        need_cmp = false;

    } else {

        need_cmp = true;

        tcg_out_cmp(s, ext, a, b, b_const);

    }

    if (!l->has_value) {

        tcg_out_reloc(s, s->code_ptr, R_AARCH64_CONDBR19, label, 0);

        offset = tcg_in32(s) >> 5;

    } else {

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

        assert(offset == sextract64(offset, 0, 19));

    }

    if (need_cmp) {

        tcg_out_insn(s, 3202, B_C, c, offset);

    } else if (c == TCG_COND_EQ) {

        tcg_out_insn(s, 3201, CBZ, ext, a, offset);

    } else {

        tcg_out_insn(s, 3201, CBNZ, ext, a, offset);

    }

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     IntelHDAState *d = opaque;

     const IntelHDAReg *reg = intel_hda_reg_find(d, addr);
+
+
+
     return intel_hda_reg_read(d, reg, 0xffffffff);

 }

static uint32_t intel_hda_mmio_readl(void *opaque, target_phys_addr_t addr)

{

    IntelHDAState *d = opaque;

    const IntelHDAReg *reg = intel_hda_reg_find(d, addr);

    return intel_hda_reg_read(d, reg, 0xffffffff);

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     PCIAC97LinkState *d = opaque;

     AC97LinkState *s = &d->ac97;
+
+    dolog ("U nam readl %#x\n", addr);
+
     s->cas = 0;

     return ~0U;

static uint32_t nam_readl (void *opaque, uint32_t addr)

{

    PCIAC97LinkState *d = opaque;

    AC97LinkState *s = &d->ac97;

    dolog ("U nam readl %#x\n", addr);

    s->cas = 0;

    return ~0U;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+void block_job_completed(BlockJob *job, int ret)
+
+{
+
     BlockDriverState *bs = job->bs;

void block_job_completed(BlockJob *job, int ret)

{

    BlockDriverState *bs = job->bs;

    assert(bs->job == job);

    job->cb(job->opaque, ret);

    bs->job = NULL;

    bdrv_op_unblock_all(bs, job->blocker);

    error_free(job->blocker);

    g_free(job);

}


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

     unsupported_encoding(s, insn);

+}

static void disas_simd_zip_trn(DisasContext *s, uint32_t insn)

{

    unsupported_encoding(s, insn);

}


e1000e_init_msi(E1000EState *s)

{

    int res;

    res = msi_init(PCI_DEVICE(s),

                   0xD0,   /* MSI capability offset              */

                   1,      /* MAC MSI interrupts                 */

                   true,   /* 64-bit message addresses supported */

                   false); /* Per vector mask supported          */

    if (res > 0) {

        s->intr_state |= E1000E_USE_MSI;

    } else {

        trace_e1000e_msi_init_fail(res);

    }

}


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

     memset(out, 0, sizeof(uuid_t));

+}

void uuid_generate(uuid_t out)

{

    memset(out, 0, sizeof(uuid_t));

}


void vnc_init_state(VncState *vs)

{

    vs->initialized = true;

    VncDisplay *vd = vs->vd;

    vs->last_x = -1;

    vs->last_y = -1;

    vs->as.freq = 44100;

    vs->as.nchannels = 2;

    vs->as.fmt = AUD_FMT_S16;

    vs->as.endianness = 0;

    qemu_mutex_init(&vs->output_mutex);

    vs->bh = qemu_bh_new(vnc_jobs_bh, vs);

    QTAILQ_INSERT_HEAD(&vd->clients, vs, next);

    graphic_hw_update(vd->dcl.con);

    vnc_write(vs, "RFB 003.008\n", 12);

    vnc_flush(vs);

    vnc_read_when(vs, protocol_version, 12);

    reset_keys(vs);

    if (vs->vd->lock_key_sync)

        vs->led = qemu_add_led_event_handler(kbd_leds, vs);

    vs->mouse_mode_notifier.notify = check_pointer_type_change;

    qemu_add_mouse_mode_change_notifier(&vs->mouse_mode_notifier);

    /* vs might be free()ed here */

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static int target_pread(int fd, abi_ulong ptr, abi_ulong len,

                         abi_ulong offset)
+
+{
+
+    void *buf;
+
     int ret;

static int target_pread(int fd, abi_ulong ptr, abi_ulong len,

                        abi_ulong offset)

{

    void *buf;

    int ret;

    buf = lock_user(VERIFY_WRITE, ptr, len, 0);

    ret = pread(fd, buf, len, offset);

    unlock_user(buf, ptr, len);

    return ret;


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

     AVStream *st;
+

     /* if bit_rate is already set, we believe it */

static void estimate_timings_from_bit_rate(AVFormatContext *ic)

{

    int64_t filesize, duration;

    int i;

    AVStream *st;

    /* if bit_rate is already set, we believe it */

    if (ic->bit_rate <= 0) {

        int bit_rate = 0;

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

            st = ic->streams[i];

            if (st->codec->bit_rate > 0) {

                if (INT_MAX - st->codec->bit_rate > bit_rate) {

                    bit_rate = 0;

                    break;

                }

                bit_rate += st->codec->bit_rate;

            }

        }

        ic->bit_rate = bit_rate;

    }

    /* if duration is already set, we believe it */

    if (ic->duration == AV_NOPTS_VALUE &&

        ic->bit_rate != 0) {

        filesize = ic->pb ? avio_size(ic->pb) : 0;

        if (filesize > 0) {

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

                st = ic->streams[i];

                duration= av_rescale(8*filesize, st->time_base.den, ic->bit_rate*(int64_t)st->time_base.num);

                if (st->duration == AV_NOPTS_VALUE)

                    st->duration = duration;

            }

        }

    }

}


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

       for ( ; i < sizeof(DCTELEM)*6*64 ; i += 128) {
+
+	asm volatile("dcbzl %0,%1" : : "b" (blocks), "r" (i) : "memory");
+
+      }
+
 #else

     memset(blocks, 0, sizeof(DCTELEM)*6*64);

void clear_blocks_dcbz128_ppc(DCTELEM *blocks)

{

POWERPC_TBL_DECLARE(powerpc_clear_blocks_dcbz128, 1);

    register int misal = ((unsigned long)blocks & 0x0000007f);

    register int i = 0;

POWERPC_TBL_START_COUNT(powerpc_clear_blocks_dcbz128, 1);

#if 1

 if (misal) {

   // we could probably also optimize this case,

   // but there's not much point as the machines

   // aren't available yet (2003-06-26)

      memset(blocks, 0, sizeof(DCTELEM)*6*64);

    }

    else

      for ( ; i < sizeof(DCTELEM)*6*64 ; i += 128) {

	asm volatile("dcbzl %0,%1" : : "b" (blocks), "r" (i) : "memory");

      }

#else

    memset(blocks, 0, sizeof(DCTELEM)*6*64);

#endif

POWERPC_TBL_STOP_COUNT(powerpc_clear_blocks_dcbz128, 1);

}


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

     gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

 #else

     TCGv dcrn;
+
     if (unlikely(ctx->pr)) {

         gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

static void gen_mfdcr(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

#else

    TCGv dcrn;

    if (unlikely(ctx->pr)) {

        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

        return;

    }

    /* NIP cannot be restored if the memory exception comes from an helper */

    gen_update_nip(ctx, ctx->nip - 4);

    dcrn = tcg_const_tl(SPR(ctx->opcode));

    gen_helper_load_dcr(cpu_gpr[rD(ctx->opcode)], cpu_env, dcrn);

    tcg_temp_free(dcrn);

#endif

}


--- a/source.c
+++ b/source.c
@@ -29,11 +29,11 @@
         /* Try to find a BAT */

         if (env->nb_BATs != 0) {
+
+            ret = ppc_hash32_get_bat(env, ctx, eaddr, rw, access_type);
+
+        }
+
         if (ret < 0) {

             /* We didn't match any BAT entry or don't have BATs */

static int ppc_hash32_get_physical_address(CPUPPCState *env, struct mmu_ctx_hash32 *ctx,

                                           target_ulong eaddr, int rw,

                                           int access_type)

{

    bool real_mode = (access_type == ACCESS_CODE && msr_ir == 0)

        || (access_type != ACCESS_CODE && msr_dr == 0);

    if (real_mode) {

        ctx->raddr = eaddr;

        ctx->prot = PAGE_READ | PAGE_EXEC | PAGE_WRITE;

        return 0;

    } else {

        int ret = -1;

        /* Try to find a BAT */

        if (env->nb_BATs != 0) {

            ret = ppc_hash32_get_bat(env, ctx, eaddr, rw, access_type);

        }

        if (ret < 0) {

            /* We didn't match any BAT entry or don't have BATs */

            ret = get_segment32(env, ctx, eaddr, rw, access_type);

        }

        return ret;

    }

}


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

     int start, size, i;

+
+
+    start = bytestream_get_byte(&c->stream);
+
+    size = (bytestream_get_byte(&c->stream) - 1) & 0xFF;

     if(start + size > 255){

static void vb_decode_palette(VBDecContext *c)

{

    int start, size, i;

    start = bytestream_get_byte(&c->stream);

    size = (bytestream_get_byte(&c->stream) - 1) & 0xFF;

    if(start + size > 255){

        av_log(c->avctx, AV_LOG_ERROR, "Palette change runs beyond entry 256\n");

        return;

    }

    for(i = start; i <= start + size; i++)

        c->pal[i] = bytestream_get_be24(&c->stream);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int filter_packet(void *log_ctx, AVPacket *pkt,

+                         AVFormatContext *fmt_ctx, AVBitStreamFilterContext *bsf_ctx)

 {

static int filter_packet(void *log_ctx, AVPacket *pkt,

                         AVFormatContext *fmt_ctx, AVBitStreamFilterContext *bsf_ctx)

{

    AVCodecContext *enc_ctx = fmt_ctx->streams[pkt->stream_index]->codec;

    int ret;

    while (bsf_ctx) {

        AVPacket new_pkt = *pkt;

        ret = av_bitstream_filter_filter(bsf_ctx, enc_ctx, NULL,

                                             &new_pkt.data, &new_pkt.size,

                                             pkt->data, pkt->size,

                                             pkt->flags & AV_PKT_FLAG_KEY);

        if (ret == 0 && new_pkt.data != pkt->data && new_pkt.destruct) {

            if ((ret = av_copy_packet(&new_pkt, pkt)) < 0)

                break;

            ret = 1;

        }

        if (ret > 0) {

            av_free_packet(pkt);

            new_pkt.buf = av_buffer_create(new_pkt.data, new_pkt.size,

                                           av_buffer_default_free, NULL, 0);

            if (!new_pkt.buf)

                break;

        }

        *pkt = new_pkt;

        bsf_ctx = bsf_ctx->next;

    }

    if (ret < 0) {

        av_log(log_ctx, AV_LOG_ERROR,

               "Failed to filter bitstream with filter %s for stream %d in file '%s' with codec %s\n",

               bsf_ctx->filter->name, pkt->stream_index, fmt_ctx->filename,

               avcodec_get_name(enc_ctx->codec_id));

    }

    return ret;

}


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

+
+    assert(!async);
+
+    entry = ehci_get_fetch_addr(ehci, async);
+

     get_dwords(NLPTR_GET(entry),(uint32_t *) &itd,

static int ehci_state_fetchitd(EHCIState *ehci, int async)

{

    uint32_t entry;

    EHCIitd itd;

    assert(!async);

    entry = ehci_get_fetch_addr(ehci, async);

    get_dwords(NLPTR_GET(entry),(uint32_t *) &itd,

               sizeof(EHCIitd) >> 2);

    ehci_trace_itd(ehci, entry, &itd);

    if (ehci_process_itd(ehci, &itd) != 0) {

        return -1;

    }

    put_dwords(NLPTR_GET(entry), (uint32_t *) &itd,

                sizeof(EHCIitd) >> 2);

    ehci_set_fetch_addr(ehci, async, itd.next);

    ehci_set_state(ehci, async, EST_FETCHENTRY);

    return 1;

}


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

         delay_ns = limit->next_slice_time - now;

+    } else {
+
+        limit->dispatched += n;
+
+    }

     return delay_ns;

static int64_t ratelimit_calculate_delay(RateLimit *limit, uint64_t n)

{

    int64_t delay_ns = 0;

    int64_t now = qemu_get_clock_ns(rt_clock);

    if (limit->next_slice_time < now) {

        limit->next_slice_time = now + SLICE_TIME;

        limit->dispatched = 0;

    }

    if (limit->dispatched + n > limit->slice_quota) {

        delay_ns = limit->next_slice_time - now;

    } else {

        limit->dispatched += n;

    }

    return delay_ns;

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 void FUNCC(ff_h264_idct_dc_add)(uint8_t *_dst, DCTELEM *block, int stride){

     int i, j;
+
     int dc = (((dctcoef*)block)[0] + 32) >> 6;

     INIT_CLIP

+    pixel *dst = (pixel*)_dst;

     stride /= sizeof(pixel);

void FUNCC(ff_h264_idct_dc_add)(uint8_t *_dst, DCTELEM *block, int stride){

    int i, j;

    int dc = (((dctcoef*)block)[0] + 32) >> 6;

    INIT_CLIP

    pixel *dst = (pixel*)_dst;

    stride /= sizeof(pixel);

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

    {

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

            dst[i] = CLIP( dst[i] + dc );

        dst += stride;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 bool vring_setup(Vring *vring, VirtIODevice *vdev, int n)

+{
+
+    hwaddr vring_addr = virtio_queue_get_ring_addr(vdev, n);
+
+    hwaddr vring_size = virtio_queue_get_ring_size(vdev, n);

     void *vring_ptr;

bool vring_setup(Vring *vring, VirtIODevice *vdev, int n)

{

    hwaddr vring_addr = virtio_queue_get_ring_addr(vdev, n);

    hwaddr vring_size = virtio_queue_get_ring_size(vdev, n);

    void *vring_ptr;

    vring->broken = false;

    hostmem_init(&vring->hostmem);

    vring_ptr = hostmem_lookup(&vring->hostmem, vring_addr, vring_size, true);

    if (!vring_ptr) {

        error_report("Failed to map vring "

                     "addr %#" HWADDR_PRIx " size %" HWADDR_PRIu,

                     vring_addr, vring_size);

        vring->broken = true;

        return false;

    }

    vring_init(&vring->vr, virtio_queue_get_num(vdev, n), vring_ptr, 4096);

    vring->last_avail_idx = 0;

    vring->last_used_idx = 0;

    vring->signalled_used = 0;

    vring->signalled_used_valid = false;

    trace_vring_setup(virtio_queue_get_ring_addr(vdev, n),

                      vring->vr.desc, vring->vr.avail, vring->vr.used);

    return true;

}


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

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

+
+
+    return s;
+
+}

static struct omap_uwire_s *omap_uwire_init(MemoryRegion *system_memory,

                                            target_phys_addr_t base,

                                            qemu_irq txirq, qemu_irq rxirq,

                                            qemu_irq dma,

                                            omap_clk clk)

{

    struct omap_uwire_s *s = (struct omap_uwire_s *)

            g_malloc0(sizeof(struct omap_uwire_s));

    s->txirq = txirq;

    s->rxirq = rxirq;

    s->txdrq = dma;

    omap_uwire_reset(s);

    memory_region_init_io(&s->iomem, &omap_uwire_ops, s, "omap-uwire", 0x800);

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

    return s;

}


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

+    bdrv_co_maybe_schedule_bh(acb);
+
+    return &acb->common;
+
+}

static BlockAIOCB *bdrv_co_aio_rw_vector(BlockDriverState *bs,

                                         int64_t sector_num,

                                         QEMUIOVector *qiov,

                                         int nb_sectors,

                                         BdrvRequestFlags flags,

                                         BlockCompletionFunc *cb,

                                         void *opaque,

                                         bool is_write)

{

    Coroutine *co;

    BlockAIOCBCoroutine *acb;

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

    acb->need_bh = true;

    acb->req.error = -EINPROGRESS;

    acb->req.sector = sector_num;

    acb->req.nb_sectors = nb_sectors;

    acb->req.qiov = qiov;

    acb->req.flags = flags;

    acb->is_write = is_write;

    co = qemu_coroutine_create(bdrv_co_do_rw);

    qemu_coroutine_enter(co, acb);

    bdrv_co_maybe_schedule_bh(acb);

    return &acb->common;

}


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

     ac3_audio_block *ab = &ctx->audio_block;

+    float *samples = ctx->samples;
+
+    int got_cplchan = 0;
+
+    int dithflag = 0;

static int get_transform_coeffs(AC3DecodeContext * ctx)

{

    int i;

    ac3_audio_block *ab = &ctx->audio_block;

    float *samples = ctx->samples;

    int got_cplchan = 0;

    int dithflag = 0;

    samples += (ctx->bsi.flags & AC3_BSI_LFEON) ? 256 : 0;

    for (i = 0; i < ctx->bsi.nfchans; i++) {

        if ((ab->flags & AC3_AB_CPLINU) && (ab->chincpl & (1 << i)))

            dithflag = 0; /* don't generate dither until channels are decoupled */

        else

            dithflag = ab->dithflag & (1 << i);

        /* transform coefficients for individual channel */

        if (_get_transform_coeffs(ab->dexps[i], ab->bap[i], ab->chcoeffs[i], samples + (i * 256),

                    0, ab->endmant[i], dithflag, &ctx->gb, &ctx->state))

            return -1;

        /* tranform coefficients for coupling channels */

        if ((ab->flags & AC3_AB_CPLINU) && (ab->chincpl & (1 << i)) && !got_cplchan) {

            if (_get_transform_coeffs(ab->dcplexps, ab->cplbap, 1.0f, ab->cplcoeffs,

                        ab->cplstrtmant, ab->cplendmant, 0, &ctx->gb, &ctx->state))

                return -1;

            got_cplchan = 1;

        }

    }

    if (ctx->bsi.flags & AC3_BSI_LFEON)

        if (_get_transform_coeffs(ab->lfeexps, ab->lfebap, 1.0f, samples - 256, 0, 7, 0, &ctx->gb, &ctx->state))

                return -1;

    /* uncouple the channels from the coupling channel */

    if (ab->flags & AC3_AB_CPLINU)

        if (uncouple_channels(ctx))

            return -1;

    return 0;

}


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

                         sep, dev->info->name);

+        if (dev->id)
+
+            pos += snprintf(dest+pos, len-pos, "/\"%s\"", dev->id);
+
+        sep = ", ";

     }

static void qbus_list_dev(BusState *bus, char *dest, int len)

{

    DeviceState *dev;

    const char *sep = " ";

    int pos = 0;

    pos += snprintf(dest+pos, len-pos, "devices at \"%s\":",

                    bus->name);

    LIST_FOREACH(dev, &bus->children, sibling) {

        pos += snprintf(dest+pos, len-pos, "%s\"%s\"",

                        sep, dev->info->name);

        if (dev->id)

            pos += snprintf(dest+pos, len-pos, "/\"%s\"", dev->id);

        sep = ", ";

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static void ehci_mem_writeb(void *ptr, target_phys_addr_t addr, uint32_t val)
+
+{

     fprintf(stderr, "EHCI doesn't handle byte writes to MMIO\n");

static void ehci_mem_writeb(void *ptr, target_phys_addr_t addr, uint32_t val)

{

    fprintf(stderr, "EHCI doesn't handle byte writes to MMIO\n");

    exit(1);

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     /* for each stream, reset read state */

     for(i = 0; i < s->nb_streams; i++) {
+
+        st = s->streams[i];
+
+
+
         if (st->parser) {

             av_parser_close(st->parser);

void ff_read_frame_flush(AVFormatContext *s)

{

    AVStream *st;

    int i, j;

    flush_packet_queue(s);

    s->cur_st = NULL;

    /* for each stream, reset read state */

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

        st = s->streams[i];

        if (st->parser) {

            av_parser_close(st->parser);

            st->parser = NULL;

            av_free_packet(&st->cur_pkt);

        }

        st->last_IP_pts = AV_NOPTS_VALUE;

        st->cur_dts = AV_NOPTS_VALUE; /* we set the current DTS to an unspecified origin */

        st->reference_dts = AV_NOPTS_VALUE;

        /* fail safe */

        st->cur_ptr = NULL;

        st->cur_len = 0;

        st->probe_packets = MAX_PROBE_PACKETS;

        for(j=0; j<MAX_REORDER_DELAY+1; j++)

            st->pts_buffer[j]= AV_NOPTS_VALUE;

    }

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
         ffio_wfourcc(pb, "mp4a");

         avio_wb32(pb, 0);
+
+        mov_write_esds_tag(pb, track);
+
+    } else if (mov_pcm_le_gt16(track->enc->codec_id)) {
+
         mov_write_enda_tag(pb);

     } else if (track->enc->codec_id == AV_CODEC_ID_AMR_NB) {

static int mov_write_wave_tag(AVIOContext *pb, MOVTrack *track)

{

    int64_t pos = avio_tell(pb);

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

    ffio_wfourcc(pb, "wave");

    if (track->enc->codec_id != AV_CODEC_ID_QDM2) {

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

    ffio_wfourcc(pb, "frma");

    avio_wl32(pb, track->tag);

    }

    if (track->enc->codec_id == AV_CODEC_ID_AAC) {

        /* useless atom needed by mplayer, ipod, not needed by quicktime */

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

        ffio_wfourcc(pb, "mp4a");

        avio_wb32(pb, 0);

        mov_write_esds_tag(pb, track);

    } else if (mov_pcm_le_gt16(track->enc->codec_id)) {

        mov_write_enda_tag(pb);

    } else if (track->enc->codec_id == AV_CODEC_ID_AMR_NB) {

        mov_write_amr_tag(pb, track);

    } else if (track->enc->codec_id == AV_CODEC_ID_AC3) {

        mov_write_ac3_tag(pb, track);

    } else if (track->enc->codec_id == AV_CODEC_ID_ALAC ||

               track->enc->codec_id == AV_CODEC_ID_QDM2) {

        mov_write_extradata_tag(pb, track);

    } else if (track->enc->codec_id == AV_CODEC_ID_ADPCM_MS ||

               track->enc->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV) {

        mov_write_ms_tag(pb, track);

    }

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

    avio_wb32(pb, 0);     /* null tag */

    return update_size(pb, pos);

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
                                   Error **errp)

 {
+
+    if (!node_name) {
+
+        return;
+
     }

static void bdrv_assign_node_name(BlockDriverState *bs,

                                  const char *node_name,

                                  Error **errp)

{

    if (!node_name) {

        return;

    }

    /* empty string node name is invalid */

    if (node_name[0] == '\0') {

        error_setg(errp, "Empty node name");

        return;

    }

    /* takes care of avoiding namespaces collisions */

    if (bdrv_find(node_name)) {

        error_setg(errp, "node-name=%s is conflicting with a device id",

                   node_name);

        return;

    }

    /* takes care of avoiding duplicates node names */

    if (bdrv_find_node(node_name)) {

        error_setg(errp, "Duplicate node name");

        return;

    }

    /* copy node name into the bs and insert it into the graph list */

    pstrcpy(bs->node_name, sizeof(bs->node_name), node_name);

    QTAILQ_INSERT_TAIL(&graph_bdrv_states, bs, node_list);

}


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

         Jpeg2000Component *comp = tile->comp + compno;

+

         for (reslevelno = 0, lev = codsty->nreslevels-1; reslevelno < codsty->nreslevels; reslevelno++, lev--){

static void truncpasses(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile)

{

    int precno, compno, reslevelno, bandno, cblkno, lev;

    Jpeg2000CodingStyle *codsty = &s->codsty;

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

        Jpeg2000Component *comp = tile->comp + compno;

        for (reslevelno = 0, lev = codsty->nreslevels-1; reslevelno < codsty->nreslevels; reslevelno++, lev--){

            Jpeg2000ResLevel *reslevel = comp->reslevel + reslevelno;

            for (precno = 0; precno < reslevel->num_precincts_x * reslevel->num_precincts_y; precno++){

                for (bandno = 0; bandno < reslevel->nbands ; bandno++){

                    int bandpos = bandno + (reslevelno > 0);

                    Jpeg2000Band *band = reslevel->band + bandno;

                    Jpeg2000Prec *prec = band->prec + precno;

                    for (cblkno = 0; cblkno < prec->nb_codeblocks_height * prec->nb_codeblocks_width; cblkno++){

                        Jpeg2000Cblk *cblk = prec->cblk + cblkno;

                        cblk->ninclpasses = getcut(cblk, s->lambda,

                                (int64_t)dwt_norms[codsty->transform == FF_DWT53][bandpos][lev] * (int64_t)band->i_stepsize >> 16);

                    }

                }

            }

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int tta_get_unary(GetBitContext *gb)

+{
+
+    int ret = 0;
+

     // count ones

static int tta_get_unary(GetBitContext *gb)

{

    int ret = 0;

    // count ones

    while(get_bits1(gb))

        ret++;

    return ret;

}


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

                                       QDict *options, Error **errp)

+{

     int ret;

     if (filename) {

         ret = qemu_gluster_parse_uri(gconf, filename);
+
         if (ret < 0) {

             error_setg(errp, "invalid URI");

static struct glfs *qemu_gluster_init(BlockdevOptionsGluster *gconf,

                                      const char *filename,

                                      QDict *options, Error **errp)

{

    int ret;

    if (filename) {

        ret = qemu_gluster_parse_uri(gconf, filename);

        if (ret < 0) {

            error_setg(errp, "invalid URI");

            error_append_hint(errp, "Usage: file=gluster[+transport]://"

                                    "[host[:port]]/volume/path[?socket=...]\n");

            errno = -ret;

            return NULL;

        }

    } else {

        ret = qemu_gluster_parse_json(gconf, options, errp);

        if (ret < 0) {

            error_append_hint(errp, "Usage: "

                             "-drive driver=qcow2,file.driver=gluster,"

                             "file.volume=testvol,file.path=/path/a.qcow2"

                             "[,file.debug=9],file.server.0.type=tcp,"

                             "file.server.0.host=1.2.3.4,"

                             "file.server.0.port=24007,"

                             "file.server.1.transport=unix,"

                             "file.server.1.socket=/var/run/glusterd.socket ..."

                             "\n");

            errno = -ret;

            return NULL;

        }

    }

    return qemu_gluster_glfs_init(gconf, errp);

}


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

+
+        left = buffer_size - rcc->buffer_index - 1;
+
+        rcc->buffer_index += av_clip(left, min_rate, max_rate);
+

         if (rcc->buffer_index > buffer_size) {

int ff_vbv_update(MpegEncContext *s, int frame_size)

{

    RateControlContext *rcc = &s->rc_context;

    const double fps        = get_fps(s->avctx);

    const int buffer_size   = s->avctx->rc_buffer_size;

    const double min_rate   = s->avctx->rc_min_rate / fps;

    const double max_rate   = s->avctx->rc_max_rate / fps;

    av_dlog(s, "%d %f %d %f %f\n",

            buffer_size, rcc->buffer_index, frame_size, min_rate, max_rate);

    if (buffer_size) {

        int left;

        rcc->buffer_index -= frame_size;

        if (rcc->buffer_index < 0) {

            av_log(s->avctx, AV_LOG_ERROR, "rc buffer underflow\n");

            rcc->buffer_index = 0;

        left = buffer_size - rcc->buffer_index - 1;

        rcc->buffer_index += av_clip(left, min_rate, max_rate);

        if (rcc->buffer_index > buffer_size) {

            int stuffing = ceil((rcc->buffer_index - buffer_size) / 8);

            if (stuffing < 4 && s->codec_id == AV_CODEC_ID_MPEG4)

                stuffing = 4;

            rcc->buffer_index -= 8 * stuffing;

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

                av_log(s->avctx, AV_LOG_DEBUG, "stuffing %d bytes\n", stuffing);

            return stuffing;

    return 0;


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
 static void megasas_reset_frames(MegasasState *s)
+
 {

     PCIDevice *pcid = PCI_DEVICE(s);

     int i;
+
+    MegasasCmd *cmd;
+

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

static void megasas_reset_frames(MegasasState *s)

{

    PCIDevice *pcid = PCI_DEVICE(s);

    int i;

    MegasasCmd *cmd;

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

        cmd = &s->frames[i];

        if (cmd->pa) {

            pci_dma_unmap(pcid, cmd->frame, cmd->pa_size, 0, 0);

            cmd->frame = NULL;

            cmd->pa = 0;

        }

    }

}


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

             qemu_bh_schedule(pool->completion_bh);
+
+
+
+            elem->common.cb(elem->common.opaque, elem->ret);
+
             qemu_aio_unref(elem);

             goto restart;

static void thread_pool_completion_bh(void *opaque)

{

    ThreadPool *pool = opaque;

    ThreadPoolElement *elem, *next;

restart:

    QLIST_FOREACH_SAFE(elem, &pool->head, all, next) {

        if (elem->state != THREAD_DONE) {

            continue;

        }

        trace_thread_pool_complete(pool, elem, elem->common.opaque,

                                   elem->ret);

        QLIST_REMOVE(elem, all);

        if (elem->common.cb) {

            /* Read state before ret.  */

            smp_rmb();

            /* Schedule ourselves in case elem->common.cb() calls aio_poll() to

             * wait for another request that completed at the same time.

             */

            qemu_bh_schedule(pool->completion_bh);

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

            qemu_aio_unref(elem);

            goto restart;

        } else {

            qemu_aio_unref(elem);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,20 +1,20 @@
 static void gen_sub(DisasContext *dc, TCGv dest, TCGv srca, TCGv srcb)

+{
+
     TCGv res = tcg_temp_new();
+
+    TCGv sr_cy = tcg_temp_new();
+
+    TCGv sr_ov = tcg_temp_new();

+
+    tcg_gen_sub_tl(res, srca, srcb);
+
+    tcg_gen_xor_tl(sr_cy, srca, srcb);
+
+    tcg_gen_xor_tl(sr_ov, res, srcb);

     tcg_gen_and_tl(sr_ov, sr_ov, sr_cy);

static void gen_sub(DisasContext *dc, TCGv dest, TCGv srca, TCGv srcb)

{

    TCGv res = tcg_temp_new();

    TCGv sr_cy = tcg_temp_new();

    TCGv sr_ov = tcg_temp_new();

    tcg_gen_sub_tl(res, srca, srcb);

    tcg_gen_xor_tl(sr_cy, srca, srcb);

    tcg_gen_xor_tl(sr_ov, res, srcb);

    tcg_gen_and_tl(sr_ov, sr_ov, sr_cy);

    tcg_gen_setcond_tl(TCG_COND_LTU, sr_cy, srca, srcb);

    tcg_gen_mov_tl(dest, res);

    tcg_temp_free(res);

    tcg_gen_shri_tl(sr_ov, sr_ov, TARGET_LONG_BITS - 1);

    tcg_gen_deposit_tl(cpu_sr, cpu_sr, sr_cy, ctz32(SR_CY), 1);

    tcg_gen_deposit_tl(cpu_sr, cpu_sr, sr_ov, ctz32(SR_OV), 1);

    gen_ove_cyov(dc, sr_ov, sr_cy);

    tcg_temp_free(sr_ov);

    tcg_temp_free(sr_cy);

}


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

 {

+	int size = memsize_zz(dc);
+
+
+
+	DIS(fprintf (logfile, "move.%c $r%u, $r%u\n",

 		    memsize_char(size), dc->op1, dc->op2));

static unsigned int dec_move_r(DisasContext *dc)

{

	int size = memsize_zz(dc);

	DIS(fprintf (logfile, "move.%c $r%u, $r%u\n",

		    memsize_char(size), dc->op1, dc->op2));

	cris_cc_mask(dc, CC_MASK_NZ);

	if (size == 4) {

		dec_prep_move_r(dc, dc->op1, dc->op2, size, 0, cpu_R[dc->op2]);

		cris_cc_mask(dc, CC_MASK_NZ);

		cris_update_cc_op(dc, CC_OP_MOVE, 4);

		cris_update_cc_x(dc);

		cris_update_result(dc, cpu_R[dc->op2]);

	}

	else {

		TCGv t0;

		t0 = tcg_temp_new(TCG_TYPE_TL);

		dec_prep_move_r(dc, dc->op1, dc->op2, size, 0, t0);

		cris_alu(dc, CC_OP_MOVE,

			 cpu_R[dc->op2],

			 cpu_R[dc->op2], t0, size);

		tcg_temp_free(t0);

	}

	return 2;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static uint64_t qemu_rdma_make_wrid(uint64_t wr_id, uint64_t index,
+
+                                         uint64_t chunk)
+
+{

     uint64_t result = wr_id & RDMA_WRID_TYPE_MASK;

static uint64_t qemu_rdma_make_wrid(uint64_t wr_id, uint64_t index,

                                         uint64_t chunk)

{

    uint64_t result = wr_id & RDMA_WRID_TYPE_MASK;

    result |= (index << RDMA_WRID_BLOCK_SHIFT);

    result |= (chunk << RDMA_WRID_CHUNK_SHIFT);

    return result;

}


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

 {

static void qemu_fill_buffer(QEMUFile *f)

{

    int len;

    int pending;

    assert(!qemu_file_is_writable(f));

    pending = f->buf_size - f->buf_index;

    if (pending > 0) {

        memmove(f->buf, f->buf + f->buf_index, pending);

    }

    f->buf_index = 0;

    f->buf_size = pending;

    len = f->ops->get_buffer(f->opaque, f->buf + pending, f->pos,

                        IO_BUF_SIZE - pending);

    if (len > 0) {

        f->buf_size += len;

        f->pos += len;

    } else if (len == 0) {

        qemu_file_set_error(f, -EIO);

    } else if (len != -EAGAIN) {

        qemu_file_set_error(f, len);

    }

}


void OPPROTO op_addw_EDI_T0(void)

{

    EDI = (EDI & ~0xffff) | ((EDI + T0) & 0xffff);

}


--- a/source.c
+++ b/source.c
@@ -4,6 +4,6 @@
     if (env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI)) {
     if (env->interrupt_request & CPU_INTERRUPT_INIT) {
         do_cpu_init(env);
+    if (env->interrupt_request & CPU_INTERRUPT_SIPI) {
+        do_cpu_sipi(env);
     return env->halted;

int kvm_arch_process_async_events(CPUState *env)
{
    if (kvm_irqchip_in_kernel()) {
    if (env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI)) {
    if (env->interrupt_request & CPU_INTERRUPT_INIT) {
        do_cpu_init(env);
    if (env->interrupt_request & CPU_INTERRUPT_SIPI) {
        do_cpu_sipi(env);
    return env->halted;


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

     QEMUFile *f = opaque;
+
+
+
     qemu_set_fd_handler2(qemu_get_fd(f), NULL, NULL, NULL, NULL);

     process_incoming_migration(f);

static void exec_accept_incoming_migration(void *opaque)

{

    QEMUFile *f = opaque;

    qemu_set_fd_handler2(qemu_get_fd(f), NULL, NULL, NULL, NULL);

    process_incoming_migration(f);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 Aml *aml_or(Aml *arg1, Aml *arg2)
+
+{
+
     Aml *var = aml_opcode(0x7D /* OrOp */);

     aml_append(var, arg1);

Aml *aml_or(Aml *arg1, Aml *arg2)

{

    Aml *var = aml_opcode(0x7D /* OrOp */);

    aml_append(var, arg1);

    aml_append(var, arg2);

    build_append_byte(var->buf, 0x00 /* NullNameOp */);

    return var;

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
     if (qio_channel_socket_listen_sync(listen_ioc, saddr, errp) < 0) {

         object_unref(OBJECT(listen_ioc));
+
+        qapi_free_SocketAddress(saddr);
+
+        return;
+
     }

static void socket_start_incoming_migration(SocketAddress *saddr,

                                            Error **errp)

{

    QIOChannelSocket *listen_ioc = qio_channel_socket_new();

    qio_channel_set_name(QIO_CHANNEL(listen_ioc),

                         "migration-socket-listener");

    if (qio_channel_socket_listen_sync(listen_ioc, saddr, errp) < 0) {

        object_unref(OBJECT(listen_ioc));

        qapi_free_SocketAddress(saddr);

        return;

    }

    qio_channel_add_watch(QIO_CHANNEL(listen_ioc),

                          G_IO_IN,

                          socket_accept_incoming_migration,

                          listen_ioc,

                          (GDestroyNotify)object_unref);

    qapi_free_SocketAddress(saddr);

}


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

     check_hwrena(env, 1);

target_ulong helper_rdhwr_synci_step(CPUMIPSState *env)

{

    check_hwrena(env, 1);

    return env->SYNCI_Step;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static ExitStatus trans_fop_dew_0c(DisasContext *ctx, uint32_t insn,

                                    const DisasInsn *di)
+
 {

     unsigned rt = extract32(insn, 0, 5);

static ExitStatus trans_fop_dew_0c(DisasContext *ctx, uint32_t insn,

                                   const DisasInsn *di)

{

    unsigned rt = extract32(insn, 0, 5);

    unsigned ra = extract32(insn, 21, 5);

    return do_fop_dew(ctx, rt, ra, di->f_dew);

}


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

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

     int err;

static void test_qemu_strtoull_octal(void)

{

    const char *str = "0123";

    char f = 'X';

    const char *endptr = &f;

    uint64_t res = 999;

    int err;

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

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, 0123);

    g_assert(endptr == str + strlen(str));

    endptr = &f;

    res = 999;

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

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, 0123);

    g_assert(endptr == str + strlen(str));

}


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

     const uint8_t *buf_ptr, *end_ptr;
+
+    uint8_t *data_ptr;

     int i;

+

     if (length > 61444) /* worst case PAL 1920 samples 8 channels */

@@ -16,7 +16,7 @@

     av_new_packet(pkt, length);

+    avio_read(pb, pkt->data, length);

     data_ptr = pkt->data;

static int mxf_get_d10_aes3_packet(AVIOContext *pb, AVStream *st, AVPacket *pkt, int64_t length)

{

    const uint8_t *buf_ptr, *end_ptr;

    uint8_t *data_ptr;

    int i;

    if (length > 61444) /* worst case PAL 1920 samples 8 channels */

        return -1;

    av_new_packet(pkt, length);

    avio_read(pb, pkt->data, length);

    data_ptr = pkt->data;

    end_ptr = pkt->data + length;

    buf_ptr = pkt->data + 4; /* skip SMPTE 331M header */

    for (; buf_ptr < end_ptr; ) {

        for (i = 0; i < st->codec->channels; i++) {

            uint32_t sample = bytestream_get_le32(&buf_ptr);

            if (st->codec->bits_per_coded_sample == 24)

                bytestream_put_le24(&data_ptr, (sample >> 4) & 0xffffff);

            else

                bytestream_put_le16(&data_ptr, (sample >> 12) & 0xffff);

        }

        buf_ptr += 32 - st->codec->channels*4; // always 8 channels stored SMPTE 331M

    }

    pkt->size = data_ptr - pkt->data;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static uint16_t mlp_checksum16(const uint8_t *buf, unsigned int buf_size)

+{
+
+    uint16_t crc;
+
+

     if (!crc_init) {

static uint16_t mlp_checksum16(const uint8_t *buf, unsigned int buf_size)

{

    uint16_t crc;

    if (!crc_init) {

        av_crc_init(crc_2D, 0, 16, 0x002D, sizeof(crc_2D));

        crc_init = 1;

    }

    crc = av_crc(crc_2D, 0, buf, buf_size - 2);

    crc ^= AV_RL16(buf + buf_size - 2);

    return crc;

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     if (s->irq_routes->nr == s->nr_allocated_irq_routes) {

         n = s->nr_allocated_irq_routes * 2;
+
+        if (n < 64) {
+
+            n = 64;
+
         }

         size = sizeof(struct kvm_irq_routing);

static void kvm_add_routing_entry(KVMState *s,

                                  struct kvm_irq_routing_entry *entry)

{

    struct kvm_irq_routing_entry *new;

    int n, size;

    if (s->irq_routes->nr == s->nr_allocated_irq_routes) {

        n = s->nr_allocated_irq_routes * 2;

        if (n < 64) {

            n = 64;

        }

        size = sizeof(struct kvm_irq_routing);

        size += n * sizeof(*new);

        s->irq_routes = g_realloc(s->irq_routes, size);

        s->nr_allocated_irq_routes = n;

    }

    n = s->irq_routes->nr++;

    new = &s->irq_routes->entries[n];

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

    new->gsi = entry->gsi;

    new->type = entry->type;

    new->flags = entry->flags;

    new->u = entry->u;

    set_gsi(s, entry->gsi);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static MemoryRegion *pc_dimm_get_memory_region(PCDIMMDevice *dimm)
+
 {

     return host_memory_backend_get_memory(dimm->hostmem, &error_abort);

static MemoryRegion *pc_dimm_get_memory_region(PCDIMMDevice *dimm)

{

    return host_memory_backend_get_memory(dimm->hostmem, &error_abort);

}


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

         break;
+
+    case 1: ea->audio_codec = CODEC_ID_PCM_MULAW; ea->bytes = 1; break;
+
+    case 2: ea->audio_codec = CODEC_ID_ADPCM_IMA_EA_EACS; break;
+
     default:

         av_log (s, AV_LOG_ERROR, "unsupported stream type; audio compression_type=%i\n", compression_type);

static int process_audio_header_eacs(AVFormatContext *s)

{

    EaDemuxContext *ea = s->priv_data;

    AVIOContext *pb = s->pb;

    int compression_type;

    ea->sample_rate  = ea->big_endian ? avio_rb32(pb) : avio_rl32(pb);

    ea->bytes        = avio_r8(pb);   /* 1=8-bit, 2=16-bit */

    ea->num_channels = avio_r8(pb);

    compression_type = avio_r8(pb);

    avio_skip(pb, 13);

    switch (compression_type) {

    case 0:

        switch (ea->bytes) {

        case 1: ea->audio_codec = CODEC_ID_PCM_S8;    break;

        case 2: ea->audio_codec = CODEC_ID_PCM_S16LE; break;

        break;

    case 1: ea->audio_codec = CODEC_ID_PCM_MULAW; ea->bytes = 1; break;

    case 2: ea->audio_codec = CODEC_ID_ADPCM_IMA_EA_EACS; break;

    default:

        av_log (s, AV_LOG_ERROR, "unsupported stream type; audio compression_type=%i\n", compression_type);

    return 1;


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

+    state->window = 0;

     state->readahead = 32;

static void hdcd_reset(hdcd_state *state, unsigned rate, unsigned cdt_ms)

{

    int i;

    state->window = 0;

    state->readahead = 32;

    state->arg = 0;

    state->control = 0;

    state->running_gain = 0;

    state->sustain = 0;

    state->sustain_reset = cdt_ms*rate/1000;

    state->code_counterA = 0;

    state->code_counterA_almost = 0;

    state->code_counterB = 0;

    state->code_counterB_checkfails = 0;

    state->code_counterC = 0;

    state->code_counterC_unmatched = 0;

    state->count_peak_extend = 0;

    state->count_transient_filter = 0;

    for(i = 0; i < 16; i++) state->gain_counts[i] = 0;

    state->max_gain = 0;

    state->count_sustain_expired = -1;

    state->_ana_snb = 0;

}


--- a/source.c
+++ b/source.c
@@ -1,25 +1,25 @@
+static int ram_load_dead(QEMUFile *f, void *opaque)
+
+{
+
+    RamDecompressState s1, *s = &s1;
+
+    uint8_t buf[10];
+
+    ram_addr_t i;

+
+
+    if (ram_decompress_open(s, f) < 0)
+
         return -EINVAL;

+    for(i = 0; i < last_ram_offset; i+= BDRV_HASH_BLOCK_SIZE) {
+
         if (ram_decompress_buf(s, buf, 1) < 0) {

+            fprintf(stderr, "Error while reading ram block header\n");
+
             goto error;

         }

static int ram_load_dead(QEMUFile *f, void *opaque)

{

    RamDecompressState s1, *s = &s1;

    uint8_t buf[10];

    ram_addr_t i;

    if (ram_decompress_open(s, f) < 0)

        return -EINVAL;

    for(i = 0; i < last_ram_offset; i+= BDRV_HASH_BLOCK_SIZE) {

        if (ram_decompress_buf(s, buf, 1) < 0) {

            fprintf(stderr, "Error while reading ram block header\n");

            goto error;

        }

        if (buf[0] == 0) {

            if (ram_decompress_buf(s, qemu_get_ram_ptr(i),

                                   BDRV_HASH_BLOCK_SIZE) < 0) {

                fprintf(stderr, "Error while reading ram block address=0x%08" PRIx64, (uint64_t)i);

                goto error;

            }

        } else {

        error:

            printf("Error block header\n");

            return -EINVAL;

        }

    }

    ram_decompress_close(s);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
+static void *bsd_vmalloc(size_t size)
+
+{
+
+    void *p;
+
+    mmap_lock();

+    /* Use map and mark the pages as used.  */
+
     p = mmap(NULL, size, PROT_READ | PROT_WRITE,

              MAP_PRIVATE | MAP_ANON, -1, 0);

static void *bsd_vmalloc(size_t size)

{

    void *p;

    mmap_lock();

    /* Use map and mark the pages as used.  */

    p = mmap(NULL, size, PROT_READ | PROT_WRITE,

             MAP_PRIVATE | MAP_ANON, -1, 0);

    if (h2g_valid(p)) {

        /* Allocated region overlaps guest address space.

           This may recurse.  */

        abi_ulong addr = h2g(p);

        page_set_flags(addr & TARGET_PAGE_MASK, TARGET_PAGE_ALIGN(addr + size),

                       PAGE_RESERVED);

    }

    mmap_unlock();

    return p;

}


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

+    /* Lest we fail to service interrupts in a timely manner, limit the
+
+       amount of work we're willing to do.  For now, let's cap at 8k.  */
+
+    for (len = 0; len < 0x2000; ++len) {

         if (str + len == end) {

void HELPER(srst)(CPUS390XState *env, uint32_t r1, uint32_t r2)

{

    uintptr_t ra = GETPC();

    uint64_t end, str;

    uint32_t len;

    uint8_t v, c = env->regs[0];

    /* Bits 32-55 must contain all 0.  */

    if (env->regs[0] & 0xffffff00u) {

        cpu_restore_state(ENV_GET_CPU(env), ra);

        program_interrupt(env, PGM_SPECIFICATION, 6);

    }

    str = get_address(env, r2);

    end = get_address(env, r1);

    /* Lest we fail to service interrupts in a timely manner, limit the

       amount of work we're willing to do.  For now, let's cap at 8k.  */

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

        if (str + len == end) {

            /* Character not found.  R1 & R2 are unmodified.  */

            env->cc_op = 2;

            return;

        }

        v = cpu_ldub_data_ra(env, str + len, ra);

        if (v == c) {

            /* Character found.  Set R1 to the location; R2 is unmodified.  */

            env->cc_op = 1;

            set_address(env, r1, str + len);

            return;

        }

    }

    /* CPU-determined bytes processed.  Advance R2 to next byte to process.  */

    env->cc_op = 3;

    set_address(env, r2, str + len);

}


--- a/source.c
+++ b/source.c
@@ -37,11 +37,11 @@
         bytestream_put_byte(&p, coupled_stream_count);

         bytestream_put_buffer(&p, channel_mapping, channels);
+
+    } else {
+
+        bytestream_put_byte(&p, 0);
+
     }

 }

static void libopus_write_header(AVCodecContext *avctx, int stream_count,

                                 int coupled_stream_count,

                                 const uint8_t *channel_mapping)

{

    uint8_t *p   = avctx->extradata;

    int channels = avctx->channels;

    bytestream_put_buffer(&p, "OpusHead", 8);

    bytestream_put_byte(&p, 1); /* Version */

    bytestream_put_byte(&p, channels);

    bytestream_put_le16(&p, avctx->delay); /* Lookahead samples at 48kHz */

    bytestream_put_le32(&p, avctx->sample_rate); /* Original sample rate */

    bytestream_put_le16(&p, 0); /* Gain of 0dB is recommended. */

    /* Channel mapping */

    if (channels > 2) {

        bytestream_put_byte(&p, channels <= 8 ? 1 : 255);

        bytestream_put_byte(&p, stream_count);

        bytestream_put_byte(&p, coupled_stream_count);

        bytestream_put_buffer(&p, channel_mapping, channels);

    } else {

        bytestream_put_byte(&p, 0);

    }

}


--- a/source.c
+++ b/source.c
@@ -39,11 +39,11 @@
                  ((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb &&

                  ((FFABS(best_dts - dts) <= AV_TIME_BASE && current_sample->pos < sample->pos) ||
+
+                  (FFABS(best_dts - dts) > AV_TIME_BASE && dts < best_dts)))))) {
+
+                sample = current_sample;
+
                 best_dts = dts;

                 *st = avst;

static AVIndexEntry *mov_find_next_sample(AVFormatContext *s, AVStream **st)

{

    AVIndexEntry *sample = NULL;

    int64_t best_dts = INT64_MAX;

    int i;

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

        AVStream *avst = s->streams[i];

        MOVStreamContext *msc = avst->priv_data;

        if (msc->pb && msc->current_sample < avst->nb_index_entries) {

            AVIndexEntry *current_sample = &avst->index_entries[msc->current_sample];

            int64_t dts;

            if (msc->ctts_data)

                dts = av_rescale(current_sample->timestamp - msc->dts_shift - msc->ctts_data[msc->ctts_index].duration,

                                 AV_TIME_BASE, msc->time_scale);

            else

                dts = av_rescale(current_sample->timestamp, AV_TIME_BASE, msc->time_scale);

            av_dlog(s, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts);

            if (!sample || (!s->pb->seekable && current_sample->pos < sample->pos) ||

                (s->pb->seekable &&

                 ((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb &&

                 ((FFABS(best_dts - dts) <= AV_TIME_BASE && current_sample->pos < sample->pos) ||

                  (FFABS(best_dts - dts) > AV_TIME_BASE && dts < best_dts)))))) {

                sample = current_sample;

                best_dts = dts;

                *st = avst;

            }

        }

    }

    return sample;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void libschroedinger_decode_buffer_free(SchroBuffer *schro_buf,
+
                                                void *priv)

 {

static void libschroedinger_decode_buffer_free(SchroBuffer *schro_buf,

                                               void *priv)

{

    av_freep(&priv);

}


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

 	tcg_gen_movi_tl(tmp, 4);

+	tcg_gen_mov_tl(addr, cpu_R[dc->op1]);
+
+	for (i = 0; i <= dc->op2; i++) {
+
+		/* Displace addr.  */

 		/* Perform the store.  */

static unsigned int dec_movem_rm(DisasContext *dc)

{

	TCGv tmp;

	TCGv addr;

	int i;

	DIS(fprintf (logfile, "movem $r%u, [$r%u%s\n", dc->op2, dc->op1,

		     dc->postinc ? "+]" : "]"));

	cris_flush_cc_state(dc);

	tmp = tcg_temp_new(TCG_TYPE_TL);

	addr = tcg_temp_new(TCG_TYPE_TL);

	tcg_gen_movi_tl(tmp, 4);

	tcg_gen_mov_tl(addr, cpu_R[dc->op1]);

	for (i = 0; i <= dc->op2; i++) {

		/* Displace addr.  */

		/* Perform the store.  */

		gen_store(dc, addr, cpu_R[i], 4);

		tcg_gen_add_tl(addr, addr, tmp);

	}

	if (dc->postinc)

		tcg_gen_mov_tl(cpu_R[dc->op1], addr);

	cris_cc_mask(dc, 0);

	tcg_temp_free(tmp);

	tcg_temp_free(addr);

	return 2;

}


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

+    qemu_set_fd_handler2(s, NULL, unix_accept_incoming_migration, NULL,
+
+                         (void *)(intptr_t)s);
+
+}

void unix_start_incoming_migration(const char *path, Error **errp)

{

    int s;

    s = unix_listen(path, NULL, 0, errp);

    if (s < 0) {

        return;

    }

    qemu_set_fd_handler2(s, NULL, unix_accept_incoming_migration, NULL,

                         (void *)(intptr_t)s);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     if(st->request_probe>0){

         AVProbeData *pd = &st->probe_data;
+
         int end;

         av_log(s, AV_LOG_DEBUG, "probing stream %d pp:%d\n", st->index, st->probe_packets);

static void probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)

{

    if(st->request_probe>0){

        AVProbeData *pd = &st->probe_data;

        int end;

        av_log(s, AV_LOG_DEBUG, "probing stream %d pp:%d\n", st->index, st->probe_packets);

        --st->probe_packets;

        if (pkt) {

            pd->buf = av_realloc(pd->buf, pd->buf_size+pkt->size+AVPROBE_PADDING_SIZE);

            memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size);

            pd->buf_size += pkt->size;

            memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE);

        } else {

            st->probe_packets = 0;

        }

        end=    s->raw_packet_buffer_remaining_size <= 0

                || st->probe_packets<=0;

        if(end || av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)){

            int score= set_codec_from_probe_data(s, st, pd);

            if(    (st->codec->codec_id != CODEC_ID_NONE && score > AVPROBE_SCORE_MAX/4)

                || end){

                pd->buf_size=0;

                av_freep(&pd->buf);

                st->request_probe= -1;

                if(st->codec->codec_id != CODEC_ID_NONE){

                    av_log(s, AV_LOG_DEBUG, "probed stream %d\n", st->index);

                }else

                    av_log(s, AV_LOG_WARNING, "probed stream %d failed\n", st->index);

            }

        }

    }

}


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

                                 uint64_t value, unsigned size)
+
 {

 }

static void musicpal_misc_write(void *opaque, target_phys_addr_t offset,

                                uint64_t value, unsigned size)

{

}


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

 {

+    BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev)));

     VirtioBusState *vbus = VIRTIO_BUS(qbus);

@@ -10,19 +10,19 @@

     int i, r;

+    if (!k->set_host_notifier) {

         fprintf(stderr, "binding does not support host notifiers\n");

         r = -ENOSYS;

         goto fail;
+
     }

+    for (i = 0; i < hdev->nvqs; ++i) {

         r = k->set_host_notifier(qbus->parent, hdev->vq_index + i, true);

int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev)

{

    BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev)));

    VirtioBusState *vbus = VIRTIO_BUS(qbus);

    VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus);

    int i, r;

    if (!k->set_host_notifier) {

        fprintf(stderr, "binding does not support host notifiers\n");

        r = -ENOSYS;

        goto fail;

    }

    for (i = 0; i < hdev->nvqs; ++i) {

        r = k->set_host_notifier(qbus->parent, hdev->vq_index + i, true);

        if (r < 0) {

            fprintf(stderr, "vhost VQ %d notifier binding failed: %d\n", i, -r);

            goto fail_vq;

        }

    }

    return 0;

fail_vq:

    while (--i >= 0) {

        r = k->set_host_notifier(qbus->parent, hdev->vq_index + i, false);

        if (r < 0) {

            fprintf(stderr, "vhost VQ %d notifier cleanup error: %d\n", i, -r);

            fflush(stderr);

        }

        assert (r >= 0);

    }

fail:

    return r;

}


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

     if (overflow == (MODEL_ELEMENTS - 1)) {
+
         tmpk = range_decode_bits(ctx, 5);

         overflow = 0;

static inline int ape_decode_value_3900(APEContext *ctx, APERice *rice)

{

    unsigned int x, overflow;

    int tmpk;

    overflow = range_get_symbol(ctx, counts_3970, counts_diff_3970);

    if (overflow == (MODEL_ELEMENTS - 1)) {

        tmpk = range_decode_bits(ctx, 5);

        overflow = 0;

    } else

        tmpk = (rice->k < 1) ? 0 : rice->k - 1;

    if (tmpk <= 16 || ctx->fileversion < 3910) {

        if (tmpk > 23) {

            av_log(ctx->avctx, AV_LOG_ERROR, "Too many bits: %d\n", tmpk);

            return AVERROR_INVALIDDATA;

        }

        x = range_decode_bits(ctx, tmpk);

    } else if (tmpk <= 32) {

        x = range_decode_bits(ctx, 16);

        x |= (range_decode_bits(ctx, tmpk - 16) << 16);

    } else {

        av_log(ctx->avctx, AV_LOG_ERROR, "Too many bits: %d\n", tmpk);

        return AVERROR_INVALIDDATA;

    }

    x += overflow << tmpk;

    update_rice(rice, x);

    /* Convert to signed */

    if (x & 1)

        return (x >> 1) + 1;

    else

        return -(x >> 1);

}


--- a/source.c
+++ b/source.c
@@ -43,11 +43,11 @@
             qemu_cond_wait(&pool->check_cancel, &pool->lock);

         }
+
+        pool->pending_cancellations--;
+
+    }
+
     qemu_mutex_unlock(&pool->lock);

     event_notifier_ready(&pool->notifier);

static void thread_pool_cancel(BlockDriverAIOCB *acb)

{

    ThreadPoolElement *elem = (ThreadPoolElement *)acb;

    ThreadPool *pool = elem->pool;

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

    qemu_mutex_lock(&pool->lock);

    if (elem->state == THREAD_QUEUED &&

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

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

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

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

         */

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

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

        elem->state = THREAD_CANCELED;

        event_notifier_set(&pool->notifier);

    } else {

        pool->pending_cancellations++;

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

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

        }

        pool->pending_cancellations--;

    }

    qemu_mutex_unlock(&pool->lock);

    event_notifier_ready(&pool->notifier);

}


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

         res = 0xffffffff;

+        float_raise( float_flag_invalid STATUS_VAR);
+
+    } else {
+
+        res = v;

     }

uint32 float64_to_uint32_round_to_zero( float64 a STATUS_PARAM )

{

    int64_t v;

    uint32 res;

    v = float64_to_int64_round_to_zero(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
@@ -1,7 +1,7 @@
 static always_inline void gen_op_subfeo_64 (void)
+
 {
+
     gen_op_move_T2_T0();

     gen_op_subfe_64();

static always_inline void gen_op_subfeo_64 (void)

{

    gen_op_move_T2_T0();

    gen_op_subfe_64();

    gen_op_check_subfo_64();

}


--- a/source.c
+++ b/source.c
@@ -39,11 +39,11 @@
     if (get_buffer(pb, (uint8_t *) *str, size) != size) {

         offset_t pos = url_ftell(pb);
+
+        av_log(matroska->ctx, AV_LOG_ERROR,
+
+               "Read error at pos. %"PRIu64" (0x%"PRIx64")\n", pos, pos);
+

         return AVERROR(EIO);

ebml_read_ascii (MatroskaDemuxContext *matroska,

                 uint32_t             *id,

                 char                **str)

{

    ByteIOContext *pb = matroska->ctx->pb;

    int size, res;

    uint64_t rlength;

    if ((res = ebml_read_element_id(matroska, id, NULL)) < 0 ||

        (res = ebml_read_element_length(matroska, &rlength)) < 0)

        return res;

    size = rlength;

    /* ebml strings are usually not 0-terminated, so we allocate one

     * byte more, read the string and NULL-terminate it ourselves. */

    if (size < 0 || !(*str = av_malloc(size + 1))) {

        av_log(matroska->ctx, AV_LOG_ERROR, "Memory allocation failed\n");

        return AVERROR(ENOMEM);

    }

    if (get_buffer(pb, (uint8_t *) *str, size) != size) {

        offset_t pos = url_ftell(pb);

        av_log(matroska->ctx, AV_LOG_ERROR,

               "Read error at pos. %"PRIu64" (0x%"PRIx64")\n", pos, pos);

        return AVERROR(EIO);

    }

    (*str)[size] = '\0';

    return 0;

}


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

 {

+    VirtIOBlockReq *req = g_new(VirtIOBlockReq, 1);
+
+    req->dev = s;
+
     req->qiov.size = 0;

     req->in_len = 0;

VirtIOBlockReq *virtio_blk_alloc_request(VirtIOBlock *s)

{

    VirtIOBlockReq *req = g_new(VirtIOBlockReq, 1);

    req->dev = s;

    req->qiov.size = 0;

    req->in_len = 0;

    req->next = NULL;

    req->mr_next = NULL;

    return req;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void rtas_ibm_os_term(PowerPCCPU *cpu,

+                            sPAPRMachineState *spapr,

                             uint32_t token, uint32_t nargs,

static void rtas_ibm_os_term(PowerPCCPU *cpu,

                            sPAPRMachineState *spapr,

                            uint32_t token, uint32_t nargs,

                            target_ulong args,

                            uint32_t nret, target_ulong rets)

{

    target_ulong ret = 0;

    qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_PAUSE, &error_abort);

    rtas_st(rets, 0, ret);

}


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

 {

+    switch (fccno) {
+
+    case 0:
+
+        gen_helper_fcmpeq(cpu_env);

         break;

static inline void gen_op_fcmpeq(int fccno)

{

    switch (fccno) {

    case 0:

        gen_helper_fcmpeq(cpu_env);

        break;

    case 1:

        gen_helper_fcmpeq_fcc1(cpu_env);

        break;

    case 2:

        gen_helper_fcmpeq_fcc2(cpu_env);

        break;

    case 3:

        gen_helper_fcmpeq_fcc3(cpu_env);

        break;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int decode_value(SCPRContext *s, unsigned *cnt, unsigned maxc, unsigned step, unsigned *rval)

+{
+
+    GetByteContext *gb = &s->gb;
+
+    RangeCoder *rc = &s->rc;

     unsigned totfr = cnt[maxc];

static int decode_value(SCPRContext *s, unsigned *cnt, unsigned maxc, unsigned step, unsigned *rval)

{

    GetByteContext *gb = &s->gb;

    RangeCoder *rc = &s->rc;

    unsigned totfr = cnt[maxc];

    unsigned value;

    unsigned c = 0, cumfr = 0, cnt_c = 0;

    int i, ret;

    if ((ret = s->get_freq(rc, totfr, &value)) < 0)

        return ret;

    while (c < maxc) {

        cnt_c = cnt[c];

        if (value >= cumfr + cnt_c)

            cumfr += cnt_c;

        else

            break;

        c++;

    }

    s->decode(gb, rc, cumfr, cnt_c, totfr);

    cnt[c] = cnt_c + step;

    totfr += step;

    if (totfr > BOT) {

        totfr = 0;

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

            unsigned nc = (cnt[i] >> 1) + 1;

            cnt[i] = nc;

            totfr += nc;

        }

    }

    cnt[maxc] = totfr;

    *rval = c;

    return 0;

}


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

     s->av_class= &av_codec_context_class;
+

     s->codec_type = codec_type;

void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType codec_type){

    int flags=0;

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

    s->av_class= &av_codec_context_class;

    s->codec_type = codec_type;

    if(codec_type == CODEC_TYPE_AUDIO)

        flags= AV_OPT_FLAG_AUDIO_PARAM;

    else if(codec_type == CODEC_TYPE_VIDEO)

        flags= AV_OPT_FLAG_VIDEO_PARAM;

    else if(codec_type == CODEC_TYPE_SUBTITLE)

        flags= AV_OPT_FLAG_SUBTITLE_PARAM;

    av_opt_set_defaults2(s, flags, flags);

    s->rc_eq= av_strdup("tex^qComp");

    s->time_base= (AVRational){0,1};

    s->get_buffer= avcodec_default_get_buffer;

    s->release_buffer= avcodec_default_release_buffer;

    s->get_format= avcodec_default_get_format;

    s->execute= avcodec_default_execute;

    s->sample_aspect_ratio= (AVRational){0,1};

    s->pix_fmt= PIX_FMT_NONE;

    s->sample_fmt= SAMPLE_FMT_S16; // FIXME: set to NONE

    s->palctrl = NULL;

    s->reget_buffer= avcodec_default_reget_buffer;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void disas_comp_b_imm(DisasContext *s, uint32_t insn)

+{
+
+    unsigned int sf, op, rt;
+
+    uint64_t addr;

     int label_match;

static void disas_comp_b_imm(DisasContext *s, uint32_t insn)

{

    unsigned int sf, op, rt;

    uint64_t addr;

    int label_match;

    TCGv_i64 tcg_cmp;

    sf = extract32(insn, 31, 1);

    op = extract32(insn, 24, 1); /* 0: CBZ; 1: CBNZ */

    rt = extract32(insn, 0, 5);

    addr = s->pc + sextract32(insn, 5, 19) * 4 - 4;

    tcg_cmp = read_cpu_reg(s, rt, sf);

    label_match = gen_new_label();

    tcg_gen_brcondi_i64(op ? TCG_COND_NE : TCG_COND_EQ,

                        tcg_cmp, 0, label_match);

    gen_goto_tb(s, 0, s->pc);

    gen_set_label(label_match);

    gen_goto_tb(s, 1, addr);

}


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

 {

void ff_tls_init(void)

{

    avpriv_lock_avformat();

#if CONFIG_OPENSSL

    if (!openssl_init) {

        SSL_library_init();

        SSL_load_error_strings();

#if HAVE_THREADS

        if (!CRYPTO_get_locking_callback()) {

            int i;

            openssl_mutexes = av_malloc_array(sizeof(pthread_mutex_t), CRYPTO_num_locks());

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

                pthread_mutex_init(&openssl_mutexes[i], NULL);

            CRYPTO_set_locking_callback(openssl_lock);

#if !defined(WIN32) && OPENSSL_VERSION_NUMBER < 0x10000000

            CRYPTO_set_id_callback(openssl_thread_id);

#endif

        }

#endif

    }

    openssl_init++;

#endif

#if CONFIG_GNUTLS

#if HAVE_THREADS && GNUTLS_VERSION_NUMBER < 0x020b00

    if (gcry_control(GCRYCTL_ANY_INITIALIZATION_P) == 0)

        gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);

#endif

    gnutls_global_init();

#endif

    avpriv_unlock_avformat();

}


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

     PnvChip *chip = opaque;
+
     uint32_t pcba = pnv_xscom_pcba(chip, addr);

     MemTxResult result;

static void xscom_write(void *opaque, hwaddr addr, uint64_t val,

                        unsigned width)

{

    PnvChip *chip = opaque;

    uint32_t pcba = pnv_xscom_pcba(chip, addr);

    MemTxResult result;

    /* Handle some SCOMs here before dispatch */

    if (xscom_write_default(chip, pcba, val)) {

        goto complete;

    }

    address_space_stq(&chip->xscom_as, pcba << 3, val, MEMTXATTRS_UNSPECIFIED,

                      &result);

    if (result != MEMTX_OK) {

        qemu_log_mask(LOG_GUEST_ERROR, "XSCOM write failed at @0x%"

                      HWADDR_PRIx " pcba=0x%08x data=0x%" PRIx64 "\n",

                      addr, pcba, val);

        xscom_complete(current_cpu, HMER_XSCOM_FAIL | HMER_XSCOM_DONE);

        return;

    }

complete:

    xscom_complete(current_cpu, HMER_XSCOM_DONE);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int get_cox(J2kDecoderContext *s, J2kCodingStyle *c)
+
 {

     if (s->buf_end - s->buf < 5)
+
         return AVERROR(EINVAL);

           c->nreslevels = bytestream_get_byte(&s->buf) + 1; // num of resolution levels - 1
@@ -11,7 +11,7 @@
      c->log2_cblk_width = bytestream_get_byte(&s->buf) + 2; // cblk width

     c->log2_cblk_height = bytestream_get_byte(&s->buf) + 2; // cblk height
+

     c->cblk_style = bytestream_get_byte(&s->buf);

static int get_cox(J2kDecoderContext *s, J2kCodingStyle *c)

{

    if (s->buf_end - s->buf < 5)

        return AVERROR(EINVAL);

          c->nreslevels = bytestream_get_byte(&s->buf) + 1; // num of resolution levels - 1

     c->log2_cblk_width = bytestream_get_byte(&s->buf) + 2; // cblk width

    c->log2_cblk_height = bytestream_get_byte(&s->buf) + 2; // cblk height

    c->cblk_style = bytestream_get_byte(&s->buf);

    if (c->cblk_style != 0){ // cblk style

        av_log(s->avctx, AV_LOG_WARNING, "extra cblk styles %X\n", c->cblk_style);

    }

    c->transform = bytestream_get_byte(&s->buf); // transformation

    if (c->csty & J2K_CSTY_PREC) {

        int i;

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

            bytestream_get_byte(&s->buf);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,24 +1,24 @@
+int monitor_read_block_device_key(Monitor *mon, const char *device,
+
+                                  BlockCompletionFunc *completion_cb,
+
+                                  void *opaque)
+
+{

+    Error *err = NULL;
+
     BlockBackend *blk;

+
+
+    blk = blk_by_name(device);
+
     if (!blk) {
+
+        monitor_printf(mon, "Device not found %s\n", device);

+        return -1;

     }

int monitor_read_block_device_key(Monitor *mon, const char *device,

                                  BlockCompletionFunc *completion_cb,

                                  void *opaque)

{

    Error *err = NULL;

    BlockBackend *blk;

    blk = blk_by_name(device);

    if (!blk) {

        monitor_printf(mon, "Device not found %s\n", device);

        return -1;

    }

    if (!blk_bs(blk)) {

        monitor_printf(mon, "Device '%s' has no medium\n", device);

        return -1;

    }

    bdrv_add_key(blk_bs(blk), NULL, &err);

    if (err) {

        error_free(err);

        return monitor_read_bdrv_key_start(mon, blk_bs(blk), completion_cb, opaque);

    }

    if (completion_cb) {

        completion_cb(opaque, 0);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void test_submit_aio(void)

 {
+
+    WorkerTestData data = { .n = 0, .ret = -EINPROGRESS };
+
+    data.aiocb = thread_pool_submit_aio(worker_cb, &data, done_cb, &data);
+

     /* The callbacks are not called until after the first wait.  */

static void test_submit_aio(void)

{

    WorkerTestData data = { .n = 0, .ret = -EINPROGRESS };

    data.aiocb = thread_pool_submit_aio(worker_cb, &data, done_cb, &data);

    /* The callbacks are not called until after the first wait.  */

    active = 1;

    g_assert_cmpint(data.ret, ==, -EINPROGRESS);

    qemu_aio_flush();

    g_assert_cmpint(active, ==, 0);

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

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

}


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

+{
+
+    unsigned int remaining;
+
+    int i;

static void run_test(void)

{

    unsigned int remaining;

    int i;

    while (atomic_read(&n_ready_threads) != n_rw_threads + n_rz_threads) {

        cpu_relax();

    }

    atomic_mb_set(&test_start, true);

    do {

        remaining = sleep(duration);

    } while (remaining);

    atomic_mb_set(&test_stop, true);

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

        qemu_thread_join(&rw_threads[i]);

    }

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

        qemu_thread_join(&rz_threads[i]);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void qmp_output_end_struct(Visitor *v, void **obj)
+
+{

     QmpOutputVisitor *qov = to_qov(v);

static void qmp_output_end_struct(Visitor *v, void **obj)

{

    QmpOutputVisitor *qov = to_qov(v);

    QObject *value = qmp_output_pop(qov, obj);

    assert(qobject_type(value) == QTYPE_QDICT);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void test_visitor_in_fail_list(TestInputVisitorData *data,
                                       const void *unused)
 {
+    int64_t i64 = -1;
+    Error *err = NULL;
+    Visitor *v;
     /* Unvisited list tail */
     v = visitor_input_test_init(data, "[ 1, 2, 3 ]");
     visit_type_int(v, NULL, &i64, &error_abort);

static void test_visitor_in_fail_list(TestInputVisitorData *data,
                                      const void *unused)
{
    int64_t i64 = -1;
    Error *err = NULL;
    Visitor *v;
    /* Unvisited list tail */
    v = visitor_input_test_init(data, "[ 1, 2, 3 ]");
    visit_type_int(v, NULL, &i64, &error_abort);
    g_assert_cmpint(i64, ==, 1);
    visit_type_int(v, NULL, &i64, &error_abort);
    g_assert_cmpint(i64, ==, 2);
    visit_check_list(v, &err);
}


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

 {

+    struct qemu_laiocb *laiocb = (struct qemu_laiocb *)blockacb;

+    struct io_event event;
+
     int ret;

+
+
     if (laiocb->ret != -EINPROGRESS)

         return;

static void laio_cancel(BlockDriverAIOCB *blockacb)

{

    struct qemu_laiocb *laiocb = (struct qemu_laiocb *)blockacb;

    struct io_event event;

    int ret;

    if (laiocb->ret != -EINPROGRESS)

        return;

    /*

     * Note that as of Linux 2.6.31 neither the block device code nor any

     * filesystem implements cancellation of AIO request.

     * Thus the polling loop below is the normal code path.

     */

    ret = io_cancel(laiocb->ctx->ctx, &laiocb->iocb, &event);

    if (ret == 0) {

        laiocb->ret = -ECANCELED;

        return;

    }

    /*

     * We have to wait for the iocb to finish.

     *

     * The only way to get the iocb status update is by polling the io context.

     * We might be able to do this slightly more optimal by removing the

     * O_NONBLOCK flag.

     */

    while (laiocb->ret == -EINPROGRESS) {

        qemu_laio_completion_cb(&laiocb->ctx->e);

    }

}


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

     ret = pci_data_read(s->bus, addr, size);

+    ret = qemu_bswap_len(ret, size);
+
+    APB_DPRINTF("%s: addr " TARGET_FMT_lx " -> %x\n", __func__, addr, ret);
+
+    return ret;

 }

static uint64_t apb_pci_config_read(void *opaque, target_phys_addr_t addr,

                                    unsigned size)

{

    uint32_t ret;

    APBState *s = opaque;

    ret = pci_data_read(s->bus, addr, size);

    ret = qemu_bswap_len(ret, size);

    APB_DPRINTF("%s: addr " TARGET_FMT_lx " -> %x\n", __func__, addr, ret);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void ff_put_h264_qpel16_mc20_msa(uint8_t *dst, const uint8_t *src,
+
+                                 ptrdiff_t stride)

 {

void ff_put_h264_qpel16_mc20_msa(uint8_t *dst, const uint8_t *src,

                                 ptrdiff_t stride)

{

    avc_luma_hz_16w_msa(src - 2, stride, dst, stride, 16);

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     if (!tags)

         return;
+
+    writer_print_section_header(wctx, section_id);
+
+    while ((tag = av_dict_get(tags, "", tag, AV_DICT_IGNORE_SUFFIX)))
+
         writer_print_string(wctx, tag->key, tag->value, 0);

     writer_print_section_footer(wctx);

static inline void show_tags(WriterContext *wctx, AVDictionary *tags, int section_id)

{

    AVDictionaryEntry *tag = NULL;

    if (!tags)

        return;

    writer_print_section_header(wctx, section_id);

    while ((tag = av_dict_get(tags, "", tag, AV_DICT_IGNORE_SUFFIX)))

        writer_print_string(wctx, tag->key, tag->value, 0);

    writer_print_section_footer(wctx);

}


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

         *page_size = TARGET_PAGE_SIZE;

+	return get_phys_addr_mpu(env, address, access_type, is_user, phys_ptr,
+
+				 prot);
+
+    } else if (env->cp15.c1_sys & (1 << 23)) {

         return get_phys_addr_v6(env, address, access_type, is_user, phys_ptr,

static inline int get_phys_addr(CPUState *env, uint32_t address,

                                int access_type, int is_user,

                                uint32_t *phys_ptr, int *prot,

                                target_ulong *page_size)

{

    /* Fast Context Switch Extension.  */

    if (address < 0x02000000)

        address += env->cp15.c13_fcse;

    if ((env->cp15.c1_sys & 1) == 0) {

        /* MMU/MPU disabled.  */

        *phys_ptr = address;

        *prot = PAGE_READ | PAGE_WRITE;

        *page_size = TARGET_PAGE_SIZE;

        return 0;

    } else if (arm_feature(env, ARM_FEATURE_MPU)) {

        *page_size = TARGET_PAGE_SIZE;

	return get_phys_addr_mpu(env, address, access_type, is_user, phys_ptr,

				 prot);

    } else if (env->cp15.c1_sys & (1 << 23)) {

        return get_phys_addr_v6(env, address, access_type, is_user, phys_ptr,

                                prot, page_size);

    } else {

        return get_phys_addr_v5(env, address, access_type, is_user, phys_ptr,

                                prot, page_size);

    }

}


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

     /* Mark transfer completed */
+
+    if (!txcount)
+
+    {
+
         DPRINTF("C+ mode : transmitter queue stalled, current TxDesc = %d\n",

             s->currCPlusTxDesc);

static void rtl8139_cplus_transmit(RTL8139State *s)

{

    int txcount = 0;

    while (rtl8139_cplus_transmit_one(s))

    {

        ++txcount;

    }

    /* Mark transfer completed */

    if (!txcount)

    {

        DPRINTF("C+ mode : transmitter queue stalled, current TxDesc = %d\n",

            s->currCPlusTxDesc);

    }

    else

    {

        /* update interrupt status */

        s->IntrStatus |= TxOK;

        rtl8139_update_irq(s);

    }

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
                                       Object *val, Error **errp)

 {
+
+    MemoryRegion *mr;
+
+    Error *local_err = NULL;
+

     mr = host_memory_backend_get_memory(MEMORY_BACKEND(val), &local_err);

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

                                      Object *val, Error **errp)

{

    MemoryRegion *mr;

    Error *local_err = NULL;

    mr = host_memory_backend_get_memory(MEMORY_BACKEND(val), &local_err);

    if (local_err) {

        goto out;

    }

    if (memory_region_is_mapped(mr)) {

        char *path = object_get_canonical_path_component(val);

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

        g_free(path);

    } else {

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

    }

out:

    error_propagate(errp, local_err);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void spr_write_40x_dbcr0 (void *opaque, int sprn)

 {
+
+    DisasContext *ctx = opaque;
+

     gen_op_store_40x_dbcr0();

static void spr_write_40x_dbcr0 (void *opaque, int sprn)

{

    DisasContext *ctx = opaque;

    gen_op_store_40x_dbcr0();

    /* We must stop translation as we may have rebooted */

    RET_STOP(ctx);

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
      * other block driver works

      */
+
+    return 1;
+
 }

static int raw_probe(const uint8_t *buf, int buf_size, const char *filename)

{

    /* smallest possible positive score so that raw is used if and only if no

     * other block driver works

     */

    return 1;

}


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

         virtio_add_feature(&features, VIRTIO_BLK_F_SCSI);

+    }
+
+
+
+    if (s->conf.config_wce) {

         virtio_add_feature(&features, VIRTIO_BLK_F_CONFIG_WCE);

static uint64_t virtio_blk_get_features(VirtIODevice *vdev, uint64_t features,

                                        Error **errp)

{

    VirtIOBlock *s = VIRTIO_BLK(vdev);

    virtio_add_feature(&features, VIRTIO_BLK_F_SEG_MAX);

    virtio_add_feature(&features, VIRTIO_BLK_F_GEOMETRY);

    virtio_add_feature(&features, VIRTIO_BLK_F_TOPOLOGY);

    virtio_add_feature(&features, VIRTIO_BLK_F_BLK_SIZE);

    if (__virtio_has_feature(features, VIRTIO_F_VERSION_1)) {

        if (s->conf.scsi) {

            error_setg(errp, "Please set scsi=off for virtio-blk devices in order to use virtio 1.0");

            return 0;

        }

    } else {

        virtio_clear_feature(&features, VIRTIO_F_ANY_LAYOUT);

        virtio_add_feature(&features, VIRTIO_BLK_F_SCSI);

    }

    if (s->conf.config_wce) {

        virtio_add_feature(&features, VIRTIO_BLK_F_CONFIG_WCE);

    }

    if (blk_enable_write_cache(s->blk)) {

        virtio_add_feature(&features, VIRTIO_BLK_F_WCE);

    }

    if (blk_is_read_only(s->blk)) {

        virtio_add_feature(&features, VIRTIO_BLK_F_RO);

    }

    return features;

}


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

 {

+    DeviceState *dev;

     SysBusDevice *s;

m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base,

                       uint32_t io_base, uint16_t size,

                       int type)

{

    DeviceState *dev;

    SysBusDevice *s;

    M48t59SysBusState *d;

    dev = qdev_create(NULL, "m48t59");

    qdev_prop_set_uint32(dev, "type", type);

    qdev_prop_set_uint32(dev, "size", size);

    qdev_prop_set_uint32(dev, "io_base", io_base);

    qdev_init(dev);

    s = sysbus_from_qdev(dev);

    sysbus_connect_irq(s, 0, IRQ);

    if (io_base != 0) {

        register_ioport_read(io_base, 0x04, 1, NVRAM_readb, s);

        register_ioport_write(io_base, 0x04, 1, NVRAM_writeb, s);

    }

    if (mem_base != 0) {

        sysbus_mmio_map(s, 0, mem_base);

    }

    d = FROM_SYSBUS(M48t59SysBusState, s);

    return &d->state;

}


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

             return PIXMAN_r5g6b5;
+
         case 24:

             return PIXMAN_r8g8b8;

pixman_format_code_t qemu_default_pixman_format(int bpp, bool native_endian)

{

    if (native_endian) {

        switch (bpp) {

        case 15:

            return PIXMAN_x1r5g5b5;

        case 16:

            return PIXMAN_r5g6b5;

        case 24:

            return PIXMAN_r8g8b8;

        case 32:

            return PIXMAN_x8r8g8b8;

        }

    } else {

        switch (bpp) {

        case 24:

            return PIXMAN_b8g8r8;

        case 32:

            return PIXMAN_b8g8r8x8;

        break;

        }

    }

    g_assert_not_reached();

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
     if (drv == NULL) {

         drv = bdrv_find_format("file");
+
+    }
+
+
+
     return bdrv_create(drv, filename, options);

 }

int bdrv_create_file(const char* filename, QEMUOptionParameter *options)

{

    BlockDriver *drv;

    drv = bdrv_find_protocol(filename);

    if (drv == NULL) {

        drv = bdrv_find_format("file");

    }

    return bdrv_create(drv, filename, options);

}


--- a/source.c
+++ b/source.c
@@ -7,9 +7,9 @@
     QIOChannel *ioc;

     lseek(fd, 0, SEEK_SET);
+
     if (write) {
+
         g_assert_cmpint(ftruncate(fd, 0), ==, 0);

     }

static QEMUFile *open_test_file(bool write)

{

    int fd = dup(temp_fd);

    QIOChannel *ioc;

    lseek(fd, 0, SEEK_SET);

    if (write) {

        g_assert_cmpint(ftruncate(fd, 0), ==, 0);

    }

    ioc = QIO_CHANNEL(qio_channel_file_new_fd(fd));

    if (write) {

        return qemu_fopen_channel_output(ioc);

    } else {

        return qemu_fopen_channel_input(ioc);

    }

}


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

         env->spr[SPR_HDSISR] = dsisr;

+    } else {
+
+        cs->exception_index = POWERPC_EXCP_DSI;
+
+        env->spr[SPR_DAR] = dar;

         env->spr[SPR_DSISR] = dsisr;

static void ppc_hash64_set_dsi(CPUState *cs, CPUPPCState *env, uint64_t dar,

                               uint64_t dsisr)

{

    bool vpm;

    if (msr_dr) {

        vpm = !!(env->spr[SPR_LPCR] & LPCR_VPM1);

    } else {

        vpm = !!(env->spr[SPR_LPCR] & LPCR_VPM0);

    }

    if (vpm && !msr_hv) {

        cs->exception_index = POWERPC_EXCP_HDSI;

        env->spr[SPR_HDAR] = dar;

        env->spr[SPR_HDSISR] = dsisr;

    } else {

        cs->exception_index = POWERPC_EXCP_DSI;

        env->spr[SPR_DAR] = dar;

        env->spr[SPR_DSISR] = dsisr;

   }

    env->error_code = 0;

}


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

     }
+
     buf[2047] = '\0';

     if (vmdk_parse_description(buf, "createType", ct, sizeof(ct))) {

static int vmdk_open_desc_file(BlockDriverState *bs, int flags,

                               int64_t desc_offset)

{

    int ret;

    char buf[2048];

    char ct[128];

    BDRVVmdkState *s = bs->opaque;

    ret = bdrv_pread(bs->file, desc_offset, buf, sizeof(buf));

    if (ret < 0) {

        return ret;

    }

    buf[2047] = '\0';

    if (vmdk_parse_description(buf, "createType", ct, sizeof(ct))) {

        return -EINVAL;

    }

    if (strcmp(ct, "monolithicFlat") &&

        strcmp(ct, "twoGbMaxExtentSparse") &&

        strcmp(ct, "twoGbMaxExtentFlat")) {

        fprintf(stderr,

                "VMDK: Not supported image type \"%s\""".\n", ct);

        return -ENOTSUP;

    }

    s->desc_offset = 0;

    ret = vmdk_parse_extents(buf, bs, bs->file->filename);

    if (ret) {

        return ret;

    }

    /* try to open parent images, if exist */

    if (vmdk_parent_open(bs)) {

        g_free(s->extents);

        return -EINVAL;

    }

    s->parent_cid = vmdk_read_cid(bs, 1);

    return 0;

}


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

     memset(cpuinfo->found_cpus, 0, sizeof cpuinfo->found_cpus);
+
+    CPU_FOREACH(cpu) {
+
+        set_bit(cpu->cpu_index, cpuinfo->found_cpus);

     }

static void virt_acpi_get_cpu_info(VirtAcpiCpuInfo *cpuinfo)

{

    CPUState *cpu;

    memset(cpuinfo->found_cpus, 0, sizeof cpuinfo->found_cpus);

    CPU_FOREACH(cpu) {

        set_bit(cpu->cpu_index, cpuinfo->found_cpus);

    }

}