--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int stdio_put_buffer(void *opaque, const uint8_t *buf, int64_t pos,

+                            int size)

 {

static int stdio_put_buffer(void *opaque, const uint8_t *buf, int64_t pos,

                            int size)

{

    QEMUFileStdio *s = opaque;

    return fwrite(buf, 1, size, s->stdio_file);

}


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

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

     const int y_start = t * linesize;

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

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

{

    const int y_start = t * linesize;

    const uint32_t *src_px, *src_pr,

                   *src_py = src + y_start,

                   *dst_py = dst + y_start;

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

    uint32_t *dst_px;

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

        src_px = src_py + l;

        dst_px = (uint32_t *)dst_py + l;

        src_pr = src_px + w;

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

            *dst_px = *src_px;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void test_notify(void)
+
+{
+
     g_assert(!aio_poll(ctx, false));

     aio_notify(ctx);

static void test_notify(void)

{

    g_assert(!aio_poll(ctx, false));

    aio_notify(ctx);

    g_assert(!aio_poll(ctx, true));

    g_assert(!aio_poll(ctx, false));

}


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

 {

+    if (arm_feature(env, ARM_FEATURE_LPAE)) {
+
+        env->cp15.par_el1 = value;
+
     } else if (arm_feature(env, ARM_FEATURE_V7)) {

         env->cp15.par_el1 = value & 0xfffff6ff;

static void par_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value)

{

    if (arm_feature(env, ARM_FEATURE_LPAE)) {

        env->cp15.par_el1 = value;

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

        env->cp15.par_el1 = value & 0xfffff6ff;

    } else {

        env->cp15.par_el1 = value & 0xfffff1ff;

    }

}


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

 {

+    DeviceClass *dc = DEVICE_CLASS(klass);

     SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);

    k->init = s390_virtio_bridge_init;

    dc->no_user = 1;

}


--- a/source.c
+++ b/source.c
@@ -9,8 +9,8 @@
     if (pkt->buf) {

         AVBufferRef *ref = av_buffer_ref(src->buf);
+
+        if (!ref)

             return AVERROR(ENOMEM);

static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)

{

    pkt->data      = NULL;

    pkt->side_data = NULL;

    if (pkt->buf) {

        AVBufferRef *ref = av_buffer_ref(src->buf);

        if (!ref)

            return AVERROR(ENOMEM);

        pkt->buf  = ref;

        pkt->data = ref->data;

    } else {

        DUP_DATA(pkt->data, src->data, pkt->size, 1, ALLOC_BUF);

    }

    if (pkt->side_data_elems && dup)

        pkt->side_data = src->side_data;

    if (pkt->side_data_elems && !dup) {

        return av_copy_packet_side_data(pkt, src);

    }

    return 0;

failed_alloc:

    av_packet_unref(pkt);

    return AVERROR(ENOMEM);

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     void *ret;

     PAVoiceIn *pa = (PAVoiceIn *) hw;
+
+
+
     audio_pt_lock (&pa->pt, AUDIO_FUNC);

     pa->done = 1;

static void qpa_fini_in (HWVoiceIn *hw)

{

    void *ret;

    PAVoiceIn *pa = (PAVoiceIn *) hw;

    audio_pt_lock (&pa->pt, AUDIO_FUNC);

    pa->done = 1;

    audio_pt_unlock_and_signal (&pa->pt, AUDIO_FUNC);

    audio_pt_join (&pa->pt, &ret, AUDIO_FUNC);

    if (pa->s) {

        pa_simple_free (pa->s);

        pa->s = NULL;

    }

    audio_pt_fini (&pa->pt, AUDIO_FUNC);

    g_free (pa->pcm_buf);

    pa->pcm_buf = NULL;

}


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

     const uint8_t *buf = avpkt->data;

+    int buf_size = avpkt->size;
+
+    G726Context *c = avctx->priv_data;
+
+    int16_t *samples = data;

     GetBitContext gb;

static int g726_decode_frame(AVCodecContext *avctx,

                             void *data, int *data_size,

                             AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size = avpkt->size;

    G726Context *c = avctx->priv_data;

    int16_t *samples = data;

    GetBitContext gb;

    init_get_bits(&gb, buf, buf_size * 8);

    while (get_bits_count(&gb) + c->code_size <= buf_size*8)

        *samples++ = g726_decode(c, get_bits(&gb, c->code_size));

    if(buf_size*8 != get_bits_count(&gb))

        av_log(avctx, AV_LOG_ERROR, "Frame invalidly split, missing parser?\n");

    *data_size = (uint8_t*)samples - (uint8_t*)data;

    return buf_size;

}


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

     if (const_arg) {
+
+        assert(const_arg == 1);
+
+        tcg_out8(s, TCG_CONST);

         tcg_out64(s, arg);

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

{

    if (const_arg) {

        assert(const_arg == 1);

        tcg_out8(s, TCG_CONST);

        tcg_out64(s, arg);

    } else {

        tcg_out_r(s, arg);

    }

}


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

         tmp1 = (ctx->samples + 256)[start];

+        ctx->samples[start] = tmp0 + tmp1;
+
+        (ctx->samples + 256)[start] = tmp0 - tmp1;
+
+        start++;

     }

static int _do_rematrixing(AC3DecodeContext *ctx, int start, int end)

{

    float tmp0, tmp1;

    while (start < end) {

        tmp0 = ctx->samples[start];

        tmp1 = (ctx->samples + 256)[start];

        ctx->samples[start] = tmp0 + tmp1;

        (ctx->samples + 256)[start] = tmp0 - tmp1;

        start++;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int add_doubles_metadata(int count,

                                 const char *name, const char *sep,

@@ -11,7 +11,7 @@
     int i;

     double *dp;
+

     if (count >= INT_MAX / sizeof(int64_t) || count <= 0)

static int add_doubles_metadata(int count,

                                const char *name, const char *sep,

                                TiffContext *s)

{

    char *ap;

    int i;

    double *dp;

    if (count >= INT_MAX / sizeof(int64_t) || count <= 0)

        return AVERROR_INVALIDDATA;

    if (bytestream2_get_bytes_left(&s->gb) < count * sizeof(int64_t))

        return AVERROR_INVALIDDATA;

    dp = av_malloc(count * sizeof(double));

    if (!dp)

        return AVERROR(ENOMEM);

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

        dp[i] = tget_double(&s->gb, s->le);

    ap = doubles2str(dp, count, sep);

    av_freep(&dp);

    if (!ap)

        return AVERROR(ENOMEM);

    av_dict_set(avpriv_frame_get_metadatap(&s->picture), name, ap, AV_DICT_DONT_STRDUP_VAL);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int cpu_common_load(QEMUFile *f, void *opaque, int version_id)
+
+{
+
+    CPUState *env = opaque;

static int cpu_common_load(QEMUFile *f, void *opaque, int version_id)

{

    CPUState *env = opaque;

    if (version_id != CPU_COMMON_SAVE_VERSION)

        return -EINVAL;

    qemu_get_be32s(f, &env->halted);

    qemu_get_be32s(f, &env->interrupt_request);

    env->interrupt_request &= ~CPU_INTERRUPT_EXIT;

    tlb_flush(env, 1);

    return 0;

}


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

                              qemu_irq irq, int baudbase,

+                             CharDriverState *chr, int ioregister)
+
 {

+    SerialState *s;
+
+    int s_io_memory;
+
+
+
     s = qemu_mallocz(sizeof(SerialState));

     if (!s)

+        return NULL;

     s->irq = irq;

SerialState *serial_mm_init (target_phys_addr_t base, int it_shift,

                             qemu_irq irq, int baudbase,

                             CharDriverState *chr, int ioregister)

{

    SerialState *s;

    int s_io_memory;

    s = qemu_mallocz(sizeof(SerialState));

    if (!s)

        return NULL;

    s->irq = irq;

    s->base = base;

    s->it_shift = it_shift;

    s->baudbase= baudbase;

    s->tx_timer = qemu_new_timer(vm_clock, serial_tx_done, s);

    if (!s->tx_timer)

        return NULL;

    qemu_register_reset(serial_reset, s);

    serial_reset(s);

    register_savevm("serial", base, 2, serial_save, serial_load, s);

    if (ioregister) {

        s_io_memory = cpu_register_io_memory(0, serial_mm_read,

                                             serial_mm_write, s);

        cpu_register_physical_memory(base, 8 << it_shift, s_io_memory);

    }

    s->chr = chr;

    qemu_chr_add_handlers(chr, serial_can_receive1, serial_receive1,

                          serial_event, s);

    return s;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void fdctrl_handle_drive_specification_command(FDCtrl *fdctrl, int direction)

+{
+
     FDrive *cur_drv = get_cur_drv(fdctrl);

static void fdctrl_handle_drive_specification_command(FDCtrl *fdctrl, int direction)

{

    FDrive *cur_drv = get_cur_drv(fdctrl);

    if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x80) {

        /* Command parameters done */

        if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x40) {

            fdctrl->fifo[0] = fdctrl->fifo[1];

            fdctrl->fifo[2] = 0;

            fdctrl->fifo[3] = 0;

            fdctrl_set_fifo(fdctrl, 4);

        } else {

            fdctrl_reset_fifo(fdctrl);

        }

    } else if (fdctrl->data_len > 7) {

        /* ERROR */

        fdctrl->fifo[0] = 0x80 |

            (cur_drv->head << 2) | GET_CUR_DRV(fdctrl);

        fdctrl_set_fifo(fdctrl, 1);

    }

}


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

         return ret;

+    pkt->stream_index = 0;
+
+    return ret;
+
+}

static int iff_read_packet(AVFormatContext *s,

                           AVPacket *pkt)

{

    IffDemuxContext *iff = s->priv_data;

    AVIOContext *pb = s->pb;

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

    int ret;

    int64_t pos = avio_tell(pb);

    if (pos >= iff->body_end)

        return AVERROR_EOF;

    if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {

        if (st->codec->codec_tag == ID_MAUD) {

            ret = av_get_packet(pb, pkt, FFMIN(iff->body_end - pos, 1024 * st->codec->block_align));

        } else {

            ret = av_get_packet(pb, pkt, iff->body_size);

        }

    } else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {

        uint8_t *buf;

        if (av_new_packet(pkt, iff->body_size + 2) < 0) {

            return AVERROR(ENOMEM);

        }

        buf = pkt->data;

        bytestream_put_be16(&buf, 2);

        ret = avio_read(pb, buf, iff->body_size);

    } else {

        av_assert0(0);

    }

    if (pos == iff->body_pos)

        pkt->flags |= AV_PKT_FLAG_KEY;

    if (ret < 0)

        return ret;

    pkt->stream_index = 0;

    return ret;

}


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

     int16_t *samples = data;
+
     MACEContext *ctx = avctx->priv_data;
+
     int i, j, k;

static int mace3_decode_frame(AVCodecContext *avctx,

                              void *data, int *data_size,

                              const uint8_t *buf, int buf_size)

{

    int16_t *samples = data;

    MACEContext *ctx = avctx->priv_data;

    int i, j, k;

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

        int16_t *output = samples + i;

        for (j=0; j < buf_size / 2 / avctx->channels; j++)

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

                uint8_t pkt = buf[i*2 + j*2*avctx->channels + k];

                chomp3(&ctx->chd[i], output, pkt       &7, MACEtab1, MACEtab2,

                       8, avctx->channels);

                output += avctx->channels;

                chomp3(&ctx->chd[i], output,(pkt >> 3) &3, MACEtab3, MACEtab4,

                       4, avctx->channels);

                output += avctx->channels;

                chomp3(&ctx->chd[i], output, pkt >> 5    , MACEtab1, MACEtab2,

                       8, avctx->channels);

                output += avctx->channels;

            }

    }

    *data_size = 2 * 3 * buf_size;

    return buf_size;

}


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

     }

+
+
+    sumscore = sumscore * CHECK_COUNT / check_count;
+
+    maxscore = maxscore * CHECK_COUNT / CHECK_BLOCK;

static int mpegts_probe(AVProbeData *p)

{

    const int size = p->buf_size;

    int maxscore = 0;

    int sumscore = 0;

    int i;

    int check_count = size / TS_FEC_PACKET_SIZE;

#define CHECK_COUNT 10

#define CHECK_BLOCK 100

    if (check_count < CHECK_COUNT)

        return 0;

    for (i = 0; i<check_count; i+=CHECK_BLOCK) {

        int left = FFMIN(check_count - i, CHECK_BLOCK);

        int score      = analyze(p->buf + TS_PACKET_SIZE     *i, TS_PACKET_SIZE     *left, TS_PACKET_SIZE     , NULL, 1);

        int dvhs_score = analyze(p->buf + TS_DVHS_PACKET_SIZE*i, TS_DVHS_PACKET_SIZE*left, TS_DVHS_PACKET_SIZE, NULL, 1);

        int fec_score  = analyze(p->buf + TS_FEC_PACKET_SIZE *i, TS_FEC_PACKET_SIZE *left, TS_FEC_PACKET_SIZE , NULL, 1);

        score = FFMAX3(score, dvhs_score, fec_score);

        sumscore += score;

        maxscore = FFMAX(maxscore, score);

    }

    sumscore = sumscore * CHECK_COUNT / check_count;

    maxscore = maxscore * CHECK_COUNT / CHECK_BLOCK;

    av_dlog(0, "TS score: %d %d\n", sumscore, maxscore);

    if      (sumscore > 6) return AVPROBE_SCORE_MAX   + sumscore - CHECK_COUNT;

    else if (maxscore > 6) return AVPROBE_SCORE_MAX/2 + sumscore - CHECK_COUNT;

    else

        return 0;

}


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

     ebml_master metaseek, seekentry;
+
     int64_t currentpos;

     int i;

static int64_t mkv_write_seekhead(AVIOContext *pb, mkv_seekhead *seekhead)

{

    ebml_master metaseek, seekentry;

    int64_t currentpos;

    int i;

    currentpos = avio_tell(pb);

    if (seekhead->reserved_size > 0)

        if (avio_seek(pb, seekhead->filepos, SEEK_SET) < 0)

            return -1;

    metaseek = start_ebml_master(pb, MATROSKA_ID_SEEKHEAD, seekhead->reserved_size);

    for (i = 0; i < seekhead->num_entries; i++) {

        mkv_seekhead_entry *entry = &seekhead->entries[i];

        seekentry = start_ebml_master(pb, MATROSKA_ID_SEEKENTRY, MAX_SEEKENTRY_SIZE);

        put_ebml_id(pb, MATROSKA_ID_SEEKID);

        put_ebml_num(pb, ebml_id_size(entry->elementid), 0);

        put_ebml_id(pb, entry->elementid);

        put_ebml_uint(pb, MATROSKA_ID_SEEKPOSITION, entry->segmentpos);

        end_ebml_master(pb, seekentry);

    }

    end_ebml_master(pb, metaseek);

    if (seekhead->reserved_size > 0) {

        uint64_t remaining = seekhead->filepos + seekhead->reserved_size - avio_tell(pb);

        put_ebml_void(pb, remaining);

        avio_seek(pb, currentpos, SEEK_SET);

        currentpos = seekhead->filepos;

    }

    av_free(seekhead->entries);

    av_free(seekhead);

    return currentpos;

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     QJSON *json = QJSON(obj);

+
+    json->str = qstring_from_str("{ ");
+
     json->omit_comma = true;

 }

static void qjson_initfn(Object *obj)

{

    QJSON *json = QJSON(obj);

    json->str = qstring_from_str("{ ");

    json->omit_comma = true;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void test_machine(const void *data)
+
+{
+
+    const testdef_t *test = data;

     char tmpname[] = "/tmp/qtest-boot-serial-XXXXXX";

static void test_machine(const void *data)

{

    const testdef_t *test = data;

    char tmpname[] = "/tmp/qtest-boot-serial-XXXXXX";

    int fd;

    fd = mkstemp(tmpname);

    g_assert(fd != -1);

    /*

     * Make sure that this test uses tcg if available: It is used as a

     * fast-enough smoketest for that.

     */

    global_qtest = qtest_startf("-M %s,accel=tcg:kvm "

                                "-chardev file,id=serial0,path=%s "

                                "-no-shutdown -serial chardev:serial0 %s",

                                test->machine, tmpname, test->extra);

    unlink(tmpname);

    check_guest_output(test, fd);

    qtest_quit(global_qtest);

    close(fd);

}


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

 {

+    PCIBus *bus = dev->bus;
+
+    int pxb_bus_num = pci_bus_num(pxb_bus);
+
+

     if (bus->parent_dev) {

static void pxb_register_bus(PCIDevice *dev, PCIBus *pxb_bus, Error **errp)

{

    PCIBus *bus = dev->bus;

    int pxb_bus_num = pci_bus_num(pxb_bus);

    if (bus->parent_dev) {

        error_setg(errp, "PXB devices can be attached only to root bus");

        return;

    }

    QLIST_FOREACH(bus, &bus->child, sibling) {

        if (pci_bus_num(bus) == pxb_bus_num) {

            error_setg(errp, "Bus %d is already in use", pxb_bus_num);

            return;

        }

    }

    QLIST_INSERT_HEAD(&dev->bus->child, pxb_bus, sibling);

}


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

+
     seqlock_write_begin(&head->sequence);

     do {

static void qht_bucket_reset__locked(struct qht_bucket *head)

{

    struct qht_bucket *b = head;

    int i;

    seqlock_write_begin(&head->sequence);

    do {

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

            if (b->pointers[i] == NULL) {

                goto done;

            }

            b->hashes[i] = 0;

            atomic_set(&b->pointers[i], NULL);

        }

        b = b->next;

    } while (b);

 done:

    seqlock_write_end(&head->sequence);

}


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

                    PAGE_EXECUTE_READWRITE, &old_protect);

+
+
+}

static void map_exec(void *addr, long size)

{

    DWORD old_protect;

    VirtualProtect(addr, size,

                   PAGE_EXECUTE_READWRITE, &old_protect);

}


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

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

     struct parallels_header ph;

     bs->read_only = 1; // no write support yet
+

     if (bdrv_pread(bs->file, 0, &ph, sizeof(ph)) != sizeof(ph))

+        goto fail;
+

     if (memcmp(ph.magic, HEADER_MAGIC, 16) ||

static int parallels_open(BlockDriverState *bs, int flags)

{

    BDRVParallelsState *s = bs->opaque;

    int i;

    struct parallels_header ph;

    bs->read_only = 1; // no write support yet

    if (bdrv_pread(bs->file, 0, &ph, sizeof(ph)) != sizeof(ph))

        goto fail;

    if (memcmp(ph.magic, HEADER_MAGIC, 16) ||

	(le32_to_cpu(ph.version) != HEADER_VERSION)) {

        goto fail;

    }

    bs->total_sectors = le32_to_cpu(ph.nb_sectors);

    s->tracks = le32_to_cpu(ph.tracks);

    s->catalog_size = le32_to_cpu(ph.catalog_entries);

    s->catalog_bitmap = g_malloc(s->catalog_size * 4);

    if (bdrv_pread(bs->file, 64, s->catalog_bitmap, s->catalog_size * 4) !=

	s->catalog_size * 4)

	goto fail;

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

	le32_to_cpus(&s->catalog_bitmap[i]);

    qemu_co_mutex_init(&s->lock);

    return 0;

fail:

    if (s->catalog_bitmap)

	g_free(s->catalog_bitmap);

    return -1;

}


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

     ram_addr_t actual;

+
+
+    actual = qemu_balloon_status();
+
+    if (kvm_enabled() && !kvm_has_sync_mmu())

         qemu_error_new(QERR_KVM_MISSING_CAP, "synchronous MMU", "balloon");

static void do_info_balloon(Monitor *mon, QObject **ret_data)

{

    ram_addr_t actual;

    actual = qemu_balloon_status();

    if (kvm_enabled() && !kvm_has_sync_mmu())

        qemu_error_new(QERR_KVM_MISSING_CAP, "synchronous MMU", "balloon");

    else if (actual == 0)

        qemu_error_new(QERR_DEVICE_NOT_ACTIVE, "balloon");

    else

        *ret_data = qobject_from_jsonf("{ 'balloon': %" PRId64 "}",

                                       (int64_t) actual);

}


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

             muldiv64 (ticks, hw->info.bytes_per_second, get_ticks_per_sec ());
+
+
+
+        no->old_ticks = now;
+
         bytes = audio_MIN (bytes, INT_MAX);

         samples = bytes >> hw->info.shift;

static int no_run_in (HWVoiceIn *hw)

{

    NoVoiceIn *no = (NoVoiceIn *) hw;

    int live = audio_pcm_hw_get_live_in (hw);

    int dead = hw->samples - live;

    int samples = 0;

    if (dead) {

        int64_t now = qemu_get_clock (vm_clock);

        int64_t ticks = now - no->old_ticks;

        int64_t bytes =

            muldiv64 (ticks, hw->info.bytes_per_second, get_ticks_per_sec ());

        no->old_ticks = now;

        bytes = audio_MIN (bytes, INT_MAX);

        samples = bytes >> hw->info.shift;

        samples = audio_MIN (samples, dead);

    }

    return samples;

}


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

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

+    int off19;
+
+
+
+    if (l->has_value) {

         off19 = INSN_OFF19(tcg_pcrel_diff(s, l->u.value_ptr));

static void tcg_out_bpcc(TCGContext *s, int scond, int flags, int label)

{

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

    int off19;

    if (l->has_value) {

        off19 = INSN_OFF19(tcg_pcrel_diff(s, l->u.value_ptr));

    } else {

        /* Make sure to preserve destinations during retranslation.  */

        off19 = *s->code_ptr & INSN_OFF19(-1);

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

    }

    tcg_out_bpcc0(s, scond, flags, off19);

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     NvdimmFitBuffer *fit_buf = &state->fit_buf;

     unsigned int header;
+
+
+
+
+
     /* NVDIMM device is not plugged? */

     if (!fit_buf->fit->len) {

static void nvdimm_build_nfit(AcpiNVDIMMState *state, GArray *table_offsets,

                              GArray *table_data, BIOSLinker *linker)

{

    NvdimmFitBuffer *fit_buf = &state->fit_buf;

    unsigned int header;

    /* NVDIMM device is not plugged? */

    if (!fit_buf->fit->len) {

        return;

    }

    acpi_add_table(table_offsets, table_data);

    /* NFIT header. */

    header = table_data->len;

    acpi_data_push(table_data, sizeof(NvdimmNfitHeader));

    /* NVDIMM device structures. */

    g_array_append_vals(table_data, fit_buf->fit->data, fit_buf->fit->len);

    build_header(linker, table_data,

                 (void *)(table_data->data + header), "NFIT",

                 sizeof(NvdimmNfitHeader) + fit_buf->fit->len, 1, NULL, NULL);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 av_cold int ff_ac3_encode_close(AVCodecContext *avctx)

 {
+
+    int blk, ch;
+
+    AC3EncodeContext *s = avctx->priv_data;
+

     av_freep(&s->windowed_samples);

av_cold int ff_ac3_encode_close(AVCodecContext *avctx)

{

    int blk, ch;

    AC3EncodeContext *s = avctx->priv_data;

    av_freep(&s->windowed_samples);

    for (ch = 0; ch < s->channels; ch++)

        av_freep(&s->planar_samples[ch]);

    av_freep(&s->planar_samples);

    av_freep(&s->bap_buffer);

    av_freep(&s->bap1_buffer);

    av_freep(&s->mdct_coef_buffer);

    av_freep(&s->fixed_coef_buffer);

    av_freep(&s->exp_buffer);

    av_freep(&s->grouped_exp_buffer);

    av_freep(&s->psd_buffer);

    av_freep(&s->band_psd_buffer);

    av_freep(&s->mask_buffer);

    av_freep(&s->qmant_buffer);

    av_freep(&s->cpl_coord_exp_buffer);

    av_freep(&s->cpl_coord_mant_buffer);

    for (blk = 0; blk < s->num_blocks; blk++) {

        AC3Block *block = &s->blocks[blk];

        av_freep(&block->mdct_coef);

        av_freep(&block->fixed_coef);

        av_freep(&block->exp);

        av_freep(&block->grouped_exp);

        av_freep(&block->psd);

        av_freep(&block->band_psd);

        av_freep(&block->mask);

        av_freep(&block->qmant);

        av_freep(&block->cpl_coord_exp);

        av_freep(&block->cpl_coord_mant);

    }

    s->mdct_end(s);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     acb->count++;

     if (ret == 0) {
+
         acb->success_count++;

     } else {
+
         quorum_report_bad(acb, sacb->aiocb->bs->node_name, ret);

     }

static void quorum_aio_cb(void *opaque, int ret)

{

    QuorumChildRequest *sacb = opaque;

    QuorumAIOCB *acb = sacb->parent;

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

    sacb->ret = ret;

    acb->count++;

    if (ret == 0) {

        acb->success_count++;

    } else {

        quorum_report_bad(acb, sacb->aiocb->bs->node_name, ret);

    }

    assert(acb->count <= s->num_children);

    assert(acb->success_count <= s->num_children);

    if (acb->count < s->num_children) {

        return;

    }

    /* Do the vote on read */

    if (acb->is_read) {

        quorum_vote(acb);

    } else {

        quorum_has_too_much_io_failed(acb);

    }

    quorum_aio_finalize(acb);

}


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

     QDECREF(tests_dict);

static void qdict_teardown(void)

{

    QDECREF(tests_dict);

    tests_dict = NULL;

}


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

         p->next = head;
+
+        head = p;
+
+    }
+

     qapi_free_UserDefTwoList(head);

static void test_visitor_out_list_qapi_free(TestOutputVisitorData *data,

                                            const void *unused)

{

    UserDefTwoList *p, *head = NULL;

    const char string[] = "foo bar";

    int i, max_count = 1024;

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

        p = g_malloc0(sizeof(*p));

        p->value = g_malloc0(sizeof(*p->value));

        p->value->string0 = g_strdup(string);

        p->value->dict1 = g_new0(UserDefTwoDict, 1);

        p->value->dict1->string1 = g_strdup(string);

        p->value->dict1->dict2 = g_new0(UserDefTwoDictDict, 1);

        p->value->dict1->dict2->userdef = g_new0(UserDefOne, 1);

        p->value->dict1->dict2->userdef->string = g_strdup(string);

        p->value->dict1->dict2->userdef->integer = 42;

        p->value->dict1->dict2->string = g_strdup(string);

        p->value->dict1->has_dict3 = false;

        p->next = head;

        head = p;

    }

    qapi_free_UserDefTwoList(head);

}


--- a/source.c
+++ b/source.c
@@ -28,11 +28,11 @@
         break;
     case AV_PIX_FMT_NV12:
         vda_ctx->cv_pix_fmt_type = '420v';
+        break;
+    case AV_PIX_FMT_YUV420P:
+        vda_ctx->cv_pix_fmt_type = 'y420';
+        break;
+    default:
         av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format: %d\n", avctx->pix_fmt);
     status = ff_vda_create_decoder(vda_ctx,
                                    avctx->extradata, avctx->extradata_size);

static av_cold int vdadec_init(AVCodecContext *avctx)
{
    VDADecoderContext *ctx = avctx->priv_data;
    struct vda_context *vda_ctx = &ctx->vda_ctx;
    OSStatus status;
    int ret;
    ctx->h264_initialized = 0;
    /* init pix_fmts of codec */
    if (!ff_h264_vda_decoder.pix_fmts) {
        if (kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber10_7)
            ff_h264_vda_decoder.pix_fmts = vda_pixfmts_prior_10_7;
        else
            ff_h264_vda_decoder.pix_fmts = vda_pixfmts;
    /* init vda */
    memset(vda_ctx, 0, sizeof(struct vda_context));
    vda_ctx->width = avctx->width;
    vda_ctx->height = avctx->height;
    vda_ctx->format = 'avc1';
    vda_ctx->use_sync_decoding = 1;
    vda_ctx->use_ref_buffer = 1;
    ctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts);
    switch (ctx->pix_fmt) {
    case AV_PIX_FMT_UYVY422:
        vda_ctx->cv_pix_fmt_type = '2vuy';
        break;
    case AV_PIX_FMT_YUYV422:
        vda_ctx->cv_pix_fmt_type = 'yuvs';
        break;
    case AV_PIX_FMT_NV12:
        vda_ctx->cv_pix_fmt_type = '420v';
        break;
    case AV_PIX_FMT_YUV420P:
        vda_ctx->cv_pix_fmt_type = 'y420';
        break;
    default:
        av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format: %d\n", avctx->pix_fmt);
    status = ff_vda_create_decoder(vda_ctx,
                                   avctx->extradata, avctx->extradata_size);
    if (status != kVDADecoderNoErr) {
        av_log(avctx, AV_LOG_ERROR,
                "Failed to init VDA decoder: %d.\n", status);
    /* init H.264 decoder */
    set_context(avctx);
    ret = ff_h264_decoder.init(avctx);
    restore_context(avctx);
    if (ret < 0) {
        av_log(avctx, AV_LOG_ERROR, "Failed to open H.264 decoder.\n");
    ctx->h264_initialized = 1;
    return 0;
failed:
    vdadec_close(avctx);
    return -1;


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

 {

+    const char *protocol = qdict_get_str(qdict, "protocol");

     const char *hostname = qdict_get_str(qdict, "hostname");

static int client_migrate_info(Monitor *mon, const QDict *qdict,

                               MonitorCompletion cb, void *opaque)

{

    const char *protocol = qdict_get_str(qdict, "protocol");

    const char *hostname = qdict_get_str(qdict, "hostname");

    const char *subject  = qdict_get_try_str(qdict, "cert-subject");

    int port             = qdict_get_try_int(qdict, "port", -1);

    int tls_port         = qdict_get_try_int(qdict, "tls-port", -1);

    Error *err;

    int ret;

    if (strcmp(protocol, "spice") == 0) {

        if (!qemu_using_spice(&err)) {

            qerror_report_err(err);

            return -1;

        }

        if (port == -1 && tls_port == -1) {

            qerror_report(QERR_MISSING_PARAMETER, "port/tls-port");

            return -1;

        }

        ret = qemu_spice_migrate_info(hostname, port, tls_port, subject,

                                      cb, opaque);

        if (ret != 0) {

            qerror_report(QERR_UNDEFINED_ERROR);

            return -1;

        }

        return 0;

    }

    qerror_report(QERR_INVALID_PARAMETER, "protocol");

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
         .overlay = (char *) overlay

     };
+
+    TransactionAction action = {
+
+        .type = TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT,
+
         .u.blockdev_snapshot = &snapshot_data,

     };

void qmp_blockdev_snapshot(const char *node, const char *overlay,

                           Error **errp)

{

    BlockdevSnapshot snapshot_data = {

        .node = (char *) node,

        .overlay = (char *) overlay

    };

    TransactionAction action = {

        .type = TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT,

        .u.blockdev_snapshot = &snapshot_data,

    };

    blockdev_do_action(&action, errp);

}


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

 {

+    static const OptionGroupDef global_group = { "global" };

     int i;

static void init_parse_context(OptionParseContext *octx,

                               const OptionGroupDef *groups, int nb_groups)

{

    static const OptionGroupDef global_group = { "global" };

    int i;

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

    octx->nb_groups = nb_groups;

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

    if (!octx->groups)

        exit(1);

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

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

    octx->global_opts.group_def = &global_group;

    octx->global_opts.arg       = "";

    init_opts();

}


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

     if (addr >= 0x100) {
+
+        return cirrus_mmio_blt_read(s, addr - 0x100);
+
+    } else {
+
         return cirrus_vga_ioport_read(s, addr + 0x3c0);

     }

static uint64_t cirrus_mmio_read(void *opaque, target_phys_addr_t addr,

                                 unsigned size)

{

    CirrusVGAState *s = opaque;

    if (addr >= 0x100) {

        return cirrus_mmio_blt_read(s, addr - 0x100);

    } else {

        return cirrus_vga_ioport_read(s, addr + 0x3c0);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+static void raw_aio_writev_scrubbed(void *opaque, int ret)
+
+{
+
     RawScrubberBounce *b = opaque;
+

+
+    if (ret < 0) {

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

static void raw_aio_writev_scrubbed(void *opaque, int ret)

{

    RawScrubberBounce *b = opaque;

    if (ret < 0) {

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

    } else {

        b->cb(b->opaque, ret + 512);

    }

    qemu_iovec_destroy(&b->qiov);

    qemu_free(b);

}


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

     const char *effect = fp->amount == 0 ? "none" : fp->amount < 0 ? "blur" : "sharpen";
+
+
+
+    if  (!(fp->msize_x & fp->msize_y & 1)) {
+
         av_log(ctx, AV_LOG_ERROR,

                "Invalid even size for %s matrix size %dx%d\n",

static int init_filter_param(AVFilterContext *ctx, FilterParam *fp, const char *effect_type, int width)

{

    int z;

    const char *effect = fp->amount == 0 ? "none" : fp->amount < 0 ? "blur" : "sharpen";

    if  (!(fp->msize_x & fp->msize_y & 1)) {

        av_log(ctx, AV_LOG_ERROR,

               "Invalid even size for %s matrix size %dx%d\n",

               effect_type, fp->msize_x, fp->msize_y);

        return AVERROR(EINVAL);

    }

    av_log(ctx, AV_LOG_VERBOSE, "effect:%s type:%s msize_x:%d msize_y:%d amount:%0.2f\n",

           effect, effect_type, fp->msize_x, fp->msize_y, fp->amount / 65535.0);

    for (z = 0; z < 2 * fp->steps_y; z++)

        fp->sc[z] = av_malloc(sizeof(*(fp->sc[z])) * (width + 2 * fp->steps_x));

    return 0;

}


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

     size_t done = 0;

+    ssize_t ret;
+
+

+    if (s->logfd < 0) {

         return;

static void qemu_chr_fe_write_log(CharDriverState *s,

                                  const uint8_t *buf, size_t len)

{

    size_t done = 0;

    ssize_t ret;

    if (s->logfd < 0) {

        return;

    }

    while (done < len) {

        do {

            ret = write(s->logfd, buf + done, len - done);

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

                g_usleep(100);

            }

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

        if (ret <= 0) {

            return;

        }

        done += ret;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static int vmstate_size(void *opaque, VMStateField *field)

 {
+
+    int size = field->size;
+
+
+
     if (field->flags & VMS_VBUFFER) {

         size = *(int32_t *)(opaque+field->size_offset);

static int vmstate_size(void *opaque, VMStateField *field)

{

    int size = field->size;

    if (field->flags & VMS_VBUFFER) {

        size = *(int32_t *)(opaque+field->size_offset);

        if (field->flags & VMS_MULTIPLY) {

            size *= field->size;

        }

    }

    return size;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void sdl_mouse_warp(int x, int y, int on)
+
+{
+
+    if (on) {
+
         if (!guest_cursor)

             sdl_show_cursor();

static void sdl_mouse_warp(int x, int y, int on)

{

    if (on) {

        if (!guest_cursor)

            sdl_show_cursor();

        if (gui_grab || kbd_mouse_is_absolute() || absolute_enabled) {

            SDL_SetCursor(guest_sprite);

            SDL_WarpMouse(x, y);

        }

    } else if (gui_grab)

        sdl_hide_cursor();

    guest_cursor = on;

    guest_x = x, guest_y = y;

}


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

+
+    if (dc->format == OP_FMT_RI) {
+
+        if (!(dc->features & LM32_FEATURE_SHIFT) && (dc->imm5 != 1)) {
+
             qemu_log_mask(LOG_GUEST_ERROR,

                     "hardware shifter is not available\n");

static void dec_sru(DisasContext *dc)

{

    if (dc->format == OP_FMT_RI) {

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

    } else {

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

    }

    if (dc->format == OP_FMT_RI) {

        if (!(dc->features & LM32_FEATURE_SHIFT) && (dc->imm5 != 1)) {

            qemu_log_mask(LOG_GUEST_ERROR,

                    "hardware shifter is not available\n");

            t_gen_illegal_insn(dc);

            return;

        }

        tcg_gen_shri_tl(cpu_R[dc->r1], cpu_R[dc->r0], dc->imm5);

    } else {

        int l1 = gen_new_label();

        int l2 = gen_new_label();

        TCGv t0 = tcg_temp_local_new();

        tcg_gen_andi_tl(t0, cpu_R[dc->r1], 0x1f);

        if (!(dc->features & LM32_FEATURE_SHIFT)) {

            tcg_gen_brcondi_tl(TCG_COND_EQ, t0, 1, l1);

            t_gen_illegal_insn(dc);

            tcg_gen_br(l2);

        }

        gen_set_label(l1);

        tcg_gen_shr_tl(cpu_R[dc->r2], cpu_R[dc->r0], t0);

        gen_set_label(l2);

        tcg_temp_free(t0);

    }

}


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

     clear_float_exceptions(env);

+    ret = float32_to_int64_round_to_zero(src, &env->fp_status);
+
+    check_ieee_exceptions(env);

     return ret;

int64_t helper_fstox(CPUSPARCState *env, float32 src)

{

    int64_t ret;

    clear_float_exceptions(env);

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

    check_ieee_exceptions(env);

    return ret;

}


static int openfile(char *name, int flags, int growable)

{

	if (bs) {

		fprintf(stderr, "file open already, try 'help close'\n");

		return 1;

	}

	bs = bdrv_new("hda");

	if (!bs)

		return 1;

	if (bdrv_open(bs, name, flags) == -1) {

		fprintf(stderr, "%s: can't open device %s\n", progname, name);

		bs = NULL;

		return 1;

	}

	if (growable) {

		if (!bs->drv || !bs->drv->protocol_name) {

			fprintf(stderr,

				"%s: only protocols can be opened growable\n",

				progname);

			return 1;

		}

		bs->growable = 1;

	}

	return 0;

}


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

+
+    do {
+
+        len = get_bits(gb, 8);

         for (i = 0; i < len; i++) skip_bits(gb, 8);

static inline void skip_hdr_extension(GetBitContext *gb)

{

    int i, len;

    do {

        len = get_bits(gb, 8);

        for (i = 0; i < len; i++) skip_bits(gb, 8);

    } while(len);

}


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

                 err |= __copy_from_user(&current->thread.fpqueue[0],

+                                        &fpu->si_fpqueue[0],
+
+                                        ((sizeof(unsigned long) +
+
+                                        (sizeof(unsigned long *)))*16));

 #endif

restore_fpu_state(CPUSPARCState *env, qemu_siginfo_fpu_t *fpu)

{

        int err;

#if 0

#ifdef CONFIG_SMP

        if (current->flags & PF_USEDFPU)

                regs->psr &= ~PSR_EF;

#else

        if (current == last_task_used_math) {

                last_task_used_math = 0;

                regs->psr &= ~PSR_EF;

        }

#endif

        current->used_math = 1;

        current->flags &= ~PF_USEDFPU;

#endif

#if 0

        if (verify_area (VERIFY_READ, fpu, sizeof(*fpu)))

                return -EFAULT;

#endif

        /* XXX: incorrect */

        err = copy_from_user(&env->fpr[0], fpu->si_float_regs[0],

                             (sizeof(abi_ulong) * 32));

        err |= __get_user(env->fsr, &fpu->si_fsr);

#if 0

        err |= __get_user(current->thread.fpqdepth, &fpu->si_fpqdepth);

        if (current->thread.fpqdepth != 0)

                err |= __copy_from_user(&current->thread.fpqueue[0],

                                        &fpu->si_fpqueue[0],

                                        ((sizeof(unsigned long) +

                                        (sizeof(unsigned long *)))*16));

#endif

        return err;

}


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

 {

+    VMW_CBPRN("Resetting vmxnet3...");

static void vmxnet3_reset(VMXNET3State *s)

{

    VMW_CBPRN("Resetting vmxnet3...");

    vmxnet3_deactivate_device(s);

    vmxnet3_reset_interrupt_states(s);

    vmxnet_tx_pkt_reset(s->tx_pkt);

    s->drv_shmem = 0;

    s->tx_sop = true;

    s->skip_current_tx_pkt = false;

}


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

      * not, then the user is trying to mess with us.

+     */

     frame_addr = env->regs[13];

static long do_rt_sigreturn_v2(CPUARMState *env)

{

    abi_ulong frame_addr;

    struct rt_sigframe_v2 *frame = NULL;

    /*

     * Since we stacked the signal on a 64-bit boundary,

     * then 'sp' should be word aligned here.  If it's

     * not, then the user is trying to mess with us.

     */

    frame_addr = env->regs[13];

    trace_user_do_rt_sigreturn(env, frame_addr);

    if (frame_addr & 7) {

        goto badframe;

    }

    if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) {

        goto badframe;

    }

    if (do_sigframe_return_v2(env, frame_addr, &frame->uc)) {

        goto badframe;

    }

    unlock_user_struct(frame, frame_addr, 0);

    return -TARGET_QEMU_ESIGRETURN;

badframe:

    unlock_user_struct(frame, frame_addr, 0);

    force_sig(TARGET_SIGSEGV /* , current */);

    return 0;

}


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

 {

+    QObject *arg;

     QDict *qdict;

static void test_visitor_out_null(TestOutputVisitorData *data,

                                  const void *unused)

{

    QObject *arg;

    QDict *qdict;

    QObject *nil;

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

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

    visit_end_struct(data->ov, &error_abort);

    arg = qmp_output_get_qobject(data->qov);

    g_assert(qobject_type(arg) == QTYPE_QDICT);

    qdict = qobject_to_qdict(arg);

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

    nil = qdict_get(qdict, "a");

    g_assert(nil);

    g_assert(qobject_type(nil) == QTYPE_QNULL);

    qobject_decref(arg);

}


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

     return (qemu_chr_fe_get_msgfds(s, &fd, 1) == 1) ? fd : -1;
+
+}

int qemu_chr_fe_get_msgfd(CharDriverState *s)

{

    int fd;

    return (qemu_chr_fe_get_msgfds(s, &fd, 1) == 1) ? fd : -1;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+int ff_http_do_new_request(URLContext *h, const char *uri)
+{
+    HTTPContext *s = h->priv_data;
+    AVDictionary *options = NULL;
     int ret;
     ret = http_shutdown(h, h->flags);
     if (ret < 0)

int ff_http_do_new_request(URLContext *h, const char *uri)
{
    HTTPContext *s = h->priv_data;
    AVDictionary *options = NULL;
    int ret;
    ret = http_shutdown(h, h->flags);
    if (ret < 0)
        return ret;
    s->end_chunked_post = 0;
    s->chunkend      = 0;
    s->off           = 0;
    s->icy_data_read = 0;
    av_free(s->location);
    s->location = av_strdup(uri);
    if (!s->location)
        return AVERROR(ENOMEM);
    ret = http_open_cnx(h, &options);
    av_dict_free(&options);
    return ret;


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

     v->visitor.end_list = qmp_input_pop;

+    v->visitor.start_alternate = qmp_input_start_alternate;
+
+    v->visitor.type_int64 = qmp_input_type_int64;
+
+    v->visitor.type_uint64 = qmp_input_type_uint64;

     v->visitor.type_bool = qmp_input_type_bool;

Visitor *qmp_input_visitor_new(QObject *obj, bool strict)

{

    QmpInputVisitor *v;

    assert(obj);

    v = g_malloc0(sizeof(*v));

    v->visitor.type = VISITOR_INPUT;

    v->visitor.start_struct = qmp_input_start_struct;

    v->visitor.check_struct = qmp_input_check_struct;

    v->visitor.end_struct = qmp_input_pop;

    v->visitor.start_list = qmp_input_start_list;

    v->visitor.next_list = qmp_input_next_list;

    v->visitor.end_list = qmp_input_pop;

    v->visitor.start_alternate = qmp_input_start_alternate;

    v->visitor.type_int64 = qmp_input_type_int64;

    v->visitor.type_uint64 = qmp_input_type_uint64;

    v->visitor.type_bool = qmp_input_type_bool;

    v->visitor.type_str = qmp_input_type_str;

    v->visitor.type_number = qmp_input_type_number;

    v->visitor.type_any = qmp_input_type_any;

    v->visitor.type_null = qmp_input_type_null;

    v->visitor.optional = qmp_input_optional;

    v->visitor.free = qmp_input_free;

    v->strict = strict;

    v->root = obj;

    qobject_incref(obj);

    return &v->visitor;

}


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

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

void sclp_print(const char *str)

{

    int len = _strlen(str);

    WriteEventData *sccb = (void*)_sccb;

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

    sccb->h.function_code = SCLP_FC_NORMAL_WRITE;

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

    sccb->ebh.type = SCLP_EVENT_ASCII_CONSOLE_DATA;

    sccb->ebh.flags = 0;

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

    sclp_service_call(SCLP_CMD_WRITE_EVENT_DATA, sccb);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+void scsi_req_free(SCSIRequest *req)
+
+{

     scsi_req_dequeue(req);

void scsi_req_free(SCSIRequest *req)

{

    scsi_req_dequeue(req);

    qemu_free(req);

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     int res, i;
     const struct dc1394_frame_format *fmt = NULL;
     const struct dc1394_frame_rate *fps = NULL;
+    if (dc1394_read_common(c, &fmt, &fps) != 0)
+       return -1;
+    /* Now let us prep the hardware. */
+    dc1394->d = dc1394_new();
+    if (dc1394_camera_enumerate(dc1394->d, &list) != DC1394_SUCCESS || !list) {
         av_log(c, AV_LOG_ERROR, "Unable to look for an IIDC camera.\n");
     if (list->num == 0) {
         av_log(c, AV_LOG_ERROR, "No cameras found.\n");

static int dc1394_read_header(AVFormatContext *c)
{
    dc1394_data* dc1394 = c->priv_data;
    dc1394camera_list_t *list;
    int res, i;
    const struct dc1394_frame_format *fmt = NULL;
    const struct dc1394_frame_rate *fps = NULL;
    if (dc1394_read_common(c, &fmt, &fps) != 0)
       return -1;
    /* Now let us prep the hardware. */
    dc1394->d = dc1394_new();
    if (dc1394_camera_enumerate(dc1394->d, &list) != DC1394_SUCCESS || !list) {
        av_log(c, AV_LOG_ERROR, "Unable to look for an IIDC camera.\n");
    if (list->num == 0) {
        av_log(c, AV_LOG_ERROR, "No cameras found.\n");
    /* FIXME: To select a specific camera I need to search in list its guid */
    dc1394->camera = dc1394_camera_new (dc1394->d, list->ids[0].guid);
    if (list->num > 1) {
        av_log(c, AV_LOG_INFO, "Working with the first camera found\n");
    /* Freeing list of cameras */
    dc1394_camera_free_list (list);
    /* Select MAX Speed possible from the cam */
    if (dc1394->camera->bmode_capable>0) {
       dc1394_video_set_operation_mode(dc1394->camera, DC1394_OPERATION_MODE_1394B);
       i = DC1394_ISO_SPEED_800;
    } else {
       i = DC1394_ISO_SPEED_400;
    for (res = DC1394_FAILURE; i >= DC1394_ISO_SPEED_MIN && res != DC1394_SUCCESS; i--) {
            res=dc1394_video_set_iso_speed(dc1394->camera, i);
    if (res != DC1394_SUCCESS) {
        av_log(c, AV_LOG_ERROR, "Couldn't set ISO Speed\n");
        goto out_camera;
    if (dc1394_video_set_mode(dc1394->camera, fmt->frame_size_id) != DC1394_SUCCESS) {
        av_log(c, AV_LOG_ERROR, "Couldn't set video format\n");
        goto out_camera;
    if (dc1394_video_set_framerate(dc1394->camera,fps->frame_rate_id) != DC1394_SUCCESS) {
        av_log(c, AV_LOG_ERROR, "Couldn't set framerate %d \n",fps->frame_rate);
        goto out_camera;
    if (dc1394_capture_setup(dc1394->camera, 10, DC1394_CAPTURE_FLAGS_DEFAULT)!=DC1394_SUCCESS) {
        av_log(c, AV_LOG_ERROR, "Cannot setup camera \n");
        goto out_camera;
    if (dc1394_video_set_transmission(dc1394->camera, DC1394_ON) !=DC1394_SUCCESS) {
        av_log(c, AV_LOG_ERROR, "Cannot start capture\n");
        goto out_camera;
    return 0;
out_camera:
    dc1394_capture_stop(dc1394->camera);
    dc1394_video_set_transmission(dc1394->camera, DC1394_OFF);
    dc1394_camera_free (dc1394->camera);
out:
    dc1394_free(dc1394->d);
    return -1;


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int rv34_decoder_alloc(RV34DecContext *r)

+{
+
+    r->intra_types_stride = r->s.mb_width * 4 + 4;

static int rv34_decoder_alloc(RV34DecContext *r)

{

    r->intra_types_stride = r->s.mb_width * 4 + 4;

    r->cbp_chroma       = av_malloc(r->s.mb_stride * r->s.mb_height *

                                    sizeof(*r->cbp_chroma));

    r->cbp_luma         = av_malloc(r->s.mb_stride * r->s.mb_height *

                                    sizeof(*r->cbp_luma));

    r->deblock_coefs    = av_malloc(r->s.mb_stride * r->s.mb_height *

                                    sizeof(*r->deblock_coefs));

    r->intra_types_hist = av_malloc(r->intra_types_stride * 4 * 2 *

                                    sizeof(*r->intra_types_hist));

    r->mb_type          = av_mallocz(r->s.mb_stride * r->s.mb_height *

                                     sizeof(*r->mb_type));

    if (!(r->cbp_chroma       && r->cbp_luma && r->deblock_coefs &&

          r->intra_types_hist && r->mb_type)) {

        rv34_decoder_free(r);

        return AVERROR(ENOMEM);

    }

    r->intra_types = r->intra_types_hist + r->intra_types_stride * 4;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,20 +1,20 @@
 static void print_type_size(Visitor *v, const char *name, uint64_t *obj,

+                            Error **errp)
+
+{
+
     StringOutputVisitor *sov = to_sov(v);

     static const char suffixes[] = { 'B', 'K', 'M', 'G', 'T', 'P', 'E' };

     uint64_t div, val;

+    char *out;
+
+    int i;
+
+

     if (!sov->human) {

static void print_type_size(Visitor *v, const char *name, uint64_t *obj,

                            Error **errp)

{

    StringOutputVisitor *sov = to_sov(v);

    static const char suffixes[] = { 'B', 'K', 'M', 'G', 'T', 'P', 'E' };

    uint64_t div, val;

    char *out;

    int i;

    if (!sov->human) {

        out = g_strdup_printf("%"PRIu64, *obj);

        string_output_set(sov, out);

        return;

    }

    val = *obj;

    /* The exponent (returned in i) minus one gives us

     * floor(log2(val * 1024 / 1000).  The correction makes us

     * switch to the higher power when the integer part is >= 1000.

     */

    frexp(val / (1000.0 / 1024.0), &i);

    i = (i - 1) / 10;

    assert(i < ARRAY_SIZE(suffixes));

    div = 1ULL << (i * 10);

    out = g_strdup_printf("%"PRIu64" (%0.3g %c%s)", val,

                          (double)val/div, suffixes[i], i ? "iB" : "");

    string_output_set(sov, out);

}


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

     uint64_t buid;

+    int ret;
+
+
+
+    if ((nargs != 3) || (nret != 1)) {

         goto param_error_exit;

static void rtas_ibm_configure_pe(PowerPCCPU *cpu,

                                  sPAPREnvironment *spapr,

                                  uint32_t token, uint32_t nargs,

                                  target_ulong args, uint32_t nret,

                                  target_ulong rets)

{

    sPAPRPHBState *sphb;

    sPAPRPHBClass *spc;

    uint64_t buid;

    int ret;

    if ((nargs != 3) || (nret != 1)) {

        goto param_error_exit;

    }

    buid = ((uint64_t)rtas_ld(args, 1) << 32) | rtas_ld(args, 2);

    sphb = find_phb(spapr, buid);

    if (!sphb) {

        goto param_error_exit;

    }

    spc = SPAPR_PCI_HOST_BRIDGE_GET_CLASS(sphb);

    if (!spc->eeh_configure) {

        goto param_error_exit;

    }

    ret = spc->eeh_configure(sphb);

    rtas_st(rets, 0, ret);

    return;

param_error_exit:

    rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR);

}


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

     };

+
+
+    for (i = 0; test_cases[i].encoded; i++) {
+
+        QObject *obj;

         QString *str;

START_TEST(simple_string)

{

    int i;

    struct {

        const char *encoded;

        const char *decoded;

    } test_cases[] = {

        { "\"hello world\"", "hello world" },

        { "\"the quick brown fox jumped over the fence\"",

          "the quick brown fox jumped over the fence" },

        {}

    };

    for (i = 0; test_cases[i].encoded; i++) {

        QObject *obj;

        QString *str;

        obj = qobject_from_json(test_cases[i].encoded);

        fail_unless(obj != NULL);

        fail_unless(qobject_type(obj) == QTYPE_QSTRING);

        str = qobject_to_qstring(obj);

        fail_unless(strcmp(qstring_get_str(str), test_cases[i].decoded) == 0);

        str = qobject_to_json(obj);

        fail_unless(strcmp(qstring_get_str(str), test_cases[i].encoded) == 0);

        qobject_decref(obj);

        QDECREF(str);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static bool qapi_dealloc_start_union(Visitor *v, bool data_present,
+
                                      Error **errp)

 {

static bool qapi_dealloc_start_union(Visitor *v, bool data_present,

                                     Error **errp)

{

    return data_present;

}


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

 {

+    ThreadPoolCo tpc = { .co = qemu_coroutine_self(), .ret = -EINPROGRESS };
+
+    assert(qemu_in_coroutine());
+
     thread_pool_submit_aio(pool, func, arg, thread_pool_co_cb, &tpc);

     qemu_coroutine_yield();

int coroutine_fn thread_pool_submit_co(ThreadPool *pool, ThreadPoolFunc *func,

                                       void *arg)

{

    ThreadPoolCo tpc = { .co = qemu_coroutine_self(), .ret = -EINPROGRESS };

    assert(qemu_in_coroutine());

    thread_pool_submit_aio(pool, func, arg, thread_pool_co_cb, &tpc);

    qemu_coroutine_yield();

    return tpc.ret;

}


--- a/source.c
+++ b/source.c
@@ -11,9 +11,9 @@
     for (i = 0; i < s->num_mmio; i++) {

         monitor_printf(mon, "%*smmio " TARGET_FMT_plx "/" TARGET_FMT_plx "\n",
+
+                       indent, "", s->mmio[i].addr, s->mmio[i].size);
+
+    }

 }

void sysbus_dev_print(Monitor *mon, DeviceState *dev, int indent)

{

    SysBusDevice *s = sysbus_from_qdev(dev);

    int i;

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

        monitor_printf(mon, "%*smmio " TARGET_FMT_plx "/" TARGET_FMT_plx "\n",

                       indent, "", s->mmio[i].addr, s->mmio[i].size);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+void helper_dcbz(CPUPPCState *env, target_ulong addr, uint32_t is_dcbzl)
+
+{

     int dcbz_size = env->dcache_line_size;
+

 #if defined(TARGET_PPC64)

void helper_dcbz(CPUPPCState *env, target_ulong addr, uint32_t is_dcbzl)

{

    int dcbz_size = env->dcache_line_size;

#if defined(TARGET_PPC64)

    if (!is_dcbzl &&

        (env->excp_model == POWERPC_EXCP_970) &&

        ((env->spr[SPR_970_HID5] >> 7) & 0x3) == 1) {

        dcbz_size = 32;

    }

#endif

    /* XXX add e500mc support */

    do_dcbz(env, addr, dcbz_size, GETPC());

}


--- a/source.c
+++ b/source.c
@@ -6,9 +6,9 @@
         error_setg(errp, "Backup job was cancelled unexpectedly");
     backup_do_checkpoint(s->secondary_disk->bs->job, &local_err);
     if (local_err) {
+        error_propagate(errp, local_err);
+    ret = s->active_disk->bs->drv->bdrv_make_empty(s->active_disk->bs);
+    if (ret < 0) {
         error_setg(errp, "Cannot make active disk empty");
     ret = s->hidden_disk->bs->drv->bdrv_make_empty(s->hidden_disk->bs);
     if (ret < 0) {

static void secondary_do_checkpoint(BDRVReplicationState *s, Error **errp)
{
    Error *local_err = NULL;
    int ret;
    if (!s->secondary_disk->bs->job) {
        error_setg(errp, "Backup job was cancelled unexpectedly");
    backup_do_checkpoint(s->secondary_disk->bs->job, &local_err);
    if (local_err) {
        error_propagate(errp, local_err);
    ret = s->active_disk->bs->drv->bdrv_make_empty(s->active_disk->bs);
    if (ret < 0) {
        error_setg(errp, "Cannot make active disk empty");
    ret = s->hidden_disk->bs->drv->bdrv_make_empty(s->hidden_disk->bs);
    if (ret < 0) {
        error_setg(errp, "Cannot make hidden disk empty");


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

     int hours, minutes, seconds;
+
+    int64_t time;

static void mpeg4_encode_gop_header(MpegEncContext *s)

{

    int hours, minutes, seconds;

    int64_t time;

    put_bits(&s->pb, 16, 0);

    put_bits(&s->pb, 16, GOP_STARTCODE);

    time = s->current_picture_ptr->f.pts;

    if (s->reordered_input_picture[1])

        time = FFMIN(time, s->reordered_input_picture[1]->f.pts);

    time = time * s->avctx->time_base.num;

    seconds  = time / s->avctx->time_base.den;

    minutes  = seconds / 60;

    seconds %= 60;

    hours    = minutes / 60;

    minutes %= 60;

    hours   %= 24;

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

    put_bits(&s->pb, 6, minutes);

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

    put_bits(&s->pb, 6, seconds);

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

    put_bits(&s->pb, 1, 0);  // broken link == NO

    s->last_time_base = time / s->avctx->time_base.den;

    ff_mpeg4_stuffing(&s->pb);

}


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

     Coroutine *co;
+
+    CoWriteZeroes data = {

         .blk    = blk,

static int do_co_pwrite_zeroes(BlockBackend *blk, int64_t offset,

                               int64_t count, int flags, int64_t *total)

{

    Coroutine *co;

    CoWriteZeroes data = {

        .blk    = blk,

        .offset = offset,

        .count  = count,

        .total  = total,

        .flags  = flags,

        .done   = false,

    };

    if (count >> BDRV_SECTOR_BITS > INT_MAX) {

        return -ERANGE;

    }

    co = qemu_coroutine_create(co_pwrite_zeroes_entry);

    qemu_coroutine_enter(co, &data);

    while (!data.done) {

        aio_poll(blk_get_aio_context(blk), true);

    }

    if (data.ret < 0) {

        return data.ret;

    } else {

        return 1;

    }

}


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

     int i;
+

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

         GPollFD *pfd = &g_array_index(pollfds, GPollFD, i);

static void pollfds_poll(GArray *pollfds, int nfds, fd_set *rfds,

                         fd_set *wfds, fd_set *xfds)

{

    int i;

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

        GPollFD *pfd = &g_array_index(pollfds, GPollFD, i);

        int fd = pfd->fd;

        int revents = 0;

        if (FD_ISSET(fd, rfds)) {

            revents |= G_IO_IN | G_IO_HUP | G_IO_ERR;

        }

        if (FD_ISSET(fd, wfds)) {

            revents |= G_IO_OUT | G_IO_ERR;

        }

        if (FD_ISSET(fd, xfds)) {

            revents |= G_IO_PRI;

        }

        pfd->revents = revents & pfd->events;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+int qemu_sendv(int sockfd, struct iovec *iov, int len, int iov_offset)
+
 {

     return do_sendv_recvv(sockfd, iov, len, iov_offset, 1);

int qemu_sendv(int sockfd, struct iovec *iov, int len, int iov_offset)

{

    return do_sendv_recvv(sockfd, iov, len, iov_offset, 1);

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
                   *abuf1 = hasAlpha ? abuf[1] : NULL;
     int  yalpha1 = 4095 - yalpha;
     int uvalpha1 = 4095 - uvalpha;
+    int i;
+    for (i = 0; i < (dstW >> 1); i++) {
+        int Y1 = (buf0[i * 2]     * yalpha1  + buf1[i * 2]     * yalpha)  >> 19;
+        int Y2 = (buf0[i * 2 + 1] * yalpha1  + buf1[i * 2 + 1] * yalpha)  >> 19;
+        int U  = (ubuf0[i]        * uvalpha1 + ubuf1[i]        * uvalpha) >> 19;
         int V  = (vbuf0[i]        * uvalpha1 + vbuf1[i]        * uvalpha) >> 19;
         int A1, A2;
         const void *r =  c->table_rV[V],

yuv2rgb_2_c_template(SwsContext *c, const int16_t *buf[2],
                     const int16_t *ubuf[2], const int16_t *vbuf[2],
                     const int16_t *abuf[2], uint8_t *dest, int dstW,
                     int yalpha, int uvalpha, int y,
                     enum PixelFormat target, int hasAlpha)
{
    const int16_t *buf0  = buf[0],  *buf1  = buf[1],
                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
                  *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],
                  *abuf0 = hasAlpha ? abuf[0] : NULL,
                  *abuf1 = hasAlpha ? abuf[1] : NULL;
    int  yalpha1 = 4095 - yalpha;
    int uvalpha1 = 4095 - uvalpha;
    int i;
    for (i = 0; i < (dstW >> 1); i++) {
        int Y1 = (buf0[i * 2]     * yalpha1  + buf1[i * 2]     * yalpha)  >> 19;
        int Y2 = (buf0[i * 2 + 1] * yalpha1  + buf1[i * 2 + 1] * yalpha)  >> 19;
        int U  = (ubuf0[i]        * uvalpha1 + ubuf1[i]        * uvalpha) >> 19;
        int V  = (vbuf0[i]        * uvalpha1 + vbuf1[i]        * uvalpha) >> 19;
        int A1, A2;
        const void *r =  c->table_rV[V],
                   *g = (c->table_gU[U] + c->table_gV[V]),
                   *b =  c->table_bU[U];
        if (hasAlpha) {
            A1 = (abuf0[i * 2    ] * yalpha1 + abuf1[i * 2    ] * yalpha) >> 19;
            A2 = (abuf0[i * 2 + 1] * yalpha1 + abuf1[i * 2 + 1] * yalpha) >> 19;
        }
        yuv2rgb_write(dest, i, Y1, Y2, hasAlpha ? A1 : 0, hasAlpha ? A2 : 0,
                      r, g, b, y, target, hasAlpha);
    }
}


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

+    if (buf->pixel_fmts_size % sizeof(*buf->pixel_fmts)) {
+
+        av_log(ctx, AV_LOG_ERROR, "Invalid size for format list\n");
+
+        return AVERROR(EINVAL);

     }

static int vsink_query_formats(AVFilterContext *ctx)

{

    BufferSinkContext *buf = ctx->priv;

    AVFilterFormats *formats = NULL;

    unsigned i;

    int ret;

    if (buf->pixel_fmts_size % sizeof(*buf->pixel_fmts)) {

        av_log(ctx, AV_LOG_ERROR, "Invalid size for format list\n");

        return AVERROR(EINVAL);

    }

    if (buf->pixel_fmts_size) {

        for (i = 0; i < NB_ITEMS(buf->pixel_fmts); i++)

            if ((ret = ff_add_format(&formats, buf->pixel_fmts[i])) < 0)

                return ret;

        ff_set_common_formats(ctx, formats);

    } else {

        ff_default_query_formats(ctx);

    }

    return 0;

}


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

 {

+    IVShmemState *s = IVSHMEM_PLAIN(obj);
+
+
+
+    object_property_add_link(obj, "memdev", TYPE_MEMORY_BACKEND,

                              (Object **)&s->hostmem,

static void ivshmem_plain_init(Object *obj)

{

    IVShmemState *s = IVSHMEM_PLAIN(obj);

    object_property_add_link(obj, "memdev", TYPE_MEMORY_BACKEND,

                             (Object **)&s->hostmem,

                             ivshmem_check_memdev_is_busy,

                             OBJ_PROP_LINK_UNREF_ON_RELEASE,

                             &error_abort);

    s->not_legacy_32bit = 1;

}


--- a/source.c
+++ b/source.c
@@ -9,10 +9,10 @@
         if(nnz){

             if(nnz==1 && block[i*16]) ff_h264_idct8_dc_add_mmx2(dst + block_offset[i], block + i*16, stride);
+
+            else                      ff_h264_idct8_add_mmx    (dst + block_offset[i], block + i*16, stride);
+
+        }

     }

static void ff_h264_idct8_add4_mmx2(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){

    int i;

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

        int nnz = nnzc[ scan8[i] ];

        if(nnz){

            if(nnz==1 && block[i*16]) ff_h264_idct8_dc_add_mmx2(dst + block_offset[i], block + i*16, stride);

            else                      ff_h264_idct8_add_mmx    (dst + block_offset[i], block + i*16, stride);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void pxb_host_class_init(ObjectClass *class, void *data)
+
+{
+
+    DeviceClass *dc = DEVICE_CLASS(class);
+
     SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(class);

     PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(class);

static void pxb_host_class_init(ObjectClass *class, void *data)

{

    DeviceClass *dc = DEVICE_CLASS(class);

    SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(class);

    PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(class);

    dc->fw_name = "pci";

    sbc->explicit_ofw_unit_address = pxb_host_ofw_unit_address;

    hc->root_bus_path = pxb_host_root_bus_path;

}


--- 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
@@ -2,8 +2,8 @@

                        const AVIOInterruptCB *int_cb, AVDictionary **options)

+{
+
     return avio_open2(pb, url, flags, int_cb, options);

 }

int ffio_open2_wrapper(struct AVFormatContext *s, AVIOContext **pb, const char *url, int flags,

                       const AVIOInterruptCB *int_cb, AVDictionary **options)

{

    return avio_open2(pb, url, flags, int_cb, options);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void kvm_apic_realize(DeviceState *dev, Error **errp)

+{

     APICCommonState *s = APIC_COMMON(dev);

static void kvm_apic_realize(DeviceState *dev, Error **errp)

{

    APICCommonState *s = APIC_COMMON(dev);

    memory_region_init_io(&s->io_memory, NULL, &kvm_apic_io_ops, s, "kvm-apic-msi",

                          APIC_SPACE_SIZE);

    if (kvm_has_gsi_routing()) {

        msi_nonbroken = true;

    }

}


--- a/source.c
+++ b/source.c
@@ -27,11 +27,11 @@
         return AVERROR(EINVAL);

+
+    pic = av_frame_alloc();
+
+    if (!pic)
+
         return AVERROR(ENOMEM);

     av_frame_ref(pic, pic_arg);

static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,

                              const AVFrame *pic_arg, int *got_packet)

{

    MpegEncContext *s = avctx->priv_data;

    AVFrame *pic;

    int i, ret;

    int chroma_h_shift, chroma_v_shift;

    av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &chroma_h_shift, &chroma_v_shift);

    //CODEC_FLAG_EMU_EDGE have to be cleared

    if(s->avctx->flags & CODEC_FLAG_EMU_EDGE)

        return AVERROR(EINVAL);

    pic = av_frame_alloc();

    if (!pic)

        return AVERROR(ENOMEM);

    av_frame_ref(pic, pic_arg);

    //picture should be flipped upside-down

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

        int vsample = i ? 2 >> chroma_v_shift : 2;

        pic->data[i] += (pic->linesize[i] * (vsample * (8 * s->mb_height -((s->height/V_MAX)&7)) - 1 ));

        pic->linesize[i] *= -1;

    }

    ret = ff_MPV_encode_picture(avctx, pkt, pic, got_packet);

    av_frame_free(&pic);

    return ret;

}


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

     dc->realize = spapr_phb_realize;

+    dc->props = spapr_phb_properties;
+
+    dc->reset = spapr_phb_reset;
+
+    dc->vmsd = &vmstate_spapr_pci;

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

{

    PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(klass);

    DeviceClass *dc = DEVICE_CLASS(klass);

    HotplugHandlerClass *hp = HOTPLUG_HANDLER_CLASS(klass);

    hc->root_bus_path = spapr_phb_root_bus_path;

    dc->realize = spapr_phb_realize;

    dc->props = spapr_phb_properties;

    dc->reset = spapr_phb_reset;

    dc->vmsd = &vmstate_spapr_pci;

    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);

    hp->plug = spapr_phb_hot_plug_child;

    hp->unplug = spapr_phb_hot_unplug_child;

}


--- 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
@@ -1,10 +1,10 @@
 static int local_utimensat(FsContext *s, V9fsPath *fs_path,
+
+                           const struct timespec *buf)
+
+{
+
+    char *buffer;

     int ret;

static int local_utimensat(FsContext *s, V9fsPath *fs_path,

                           const struct timespec *buf)

{

    char *buffer;

    int ret;

    char *path = fs_path->data;

    buffer = rpath(s, path);

    ret = qemu_utimens(buffer, buf);

    g_free(buffer);

    return ret;

}


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

     /* bs_new is now referenced by its new parents, we don't need the
+
+     * additional reference any more. */
+
+    bdrv_unref(bs_new);
+
 }

void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top)

{

    assert(!bdrv_requests_pending(bs_top));

    assert(!bdrv_requests_pending(bs_new));

    bdrv_ref(bs_top);

    change_parent_backing_link(bs_top, bs_new);

    bdrv_set_backing_hd(bs_new, bs_top);

    bdrv_unref(bs_top);

    /* bs_new is now referenced by its new parents, we don't need the

     * additional reference any more. */

    bdrv_unref(bs_new);

}


--- a/source.c
+++ b/source.c
@@ -9,6 +9,6 @@
     p = s->data_ptr;
     *(uint32_t *)p = le32_to_cpu(val);
     p += 4;
+    s->data_ptr = p;
+    if (p >= s->data_end)
+        s->end_transfer_func(s);

void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
{
    IDEBus *bus = opaque;
    IDEState *s = idebus_active_if(bus);
    uint8_t *p;
    /* PIO data access allowed only when DRQ bit is set. The result of a write
     * during PIO out is indeterminate, just ignore it. */
    if (!(s->status & DRQ_STAT) || ide_is_pio_out(s)) {
    p = s->data_ptr;
    *(uint32_t *)p = le32_to_cpu(val);
    p += 4;
    s->data_ptr = p;
    if (p >= s->data_end)
        s->end_transfer_func(s);


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
 Visitor *validate_test_init(TestInputVisitorData *data,
+
                              const char *json_string, ...)

+{

+    Visitor *v;
+
+    va_list ap;
+
+
+
     va_start(ap, json_string);

     data->obj = qobject_from_jsonv(json_string, &ap);

Visitor *validate_test_init(TestInputVisitorData *data,

                             const char *json_string, ...)

{

    Visitor *v;

    va_list ap;

    va_start(ap, json_string);

    data->obj = qobject_from_jsonv(json_string, &ap);

    va_end(ap);

    g_assert(data->obj != NULL);

    data->qiv = qmp_input_visitor_new_strict(data->obj);

    g_assert(data->qiv != NULL);

    v = qmp_input_get_visitor(data->qiv);

    g_assert(v != NULL);

    return v;

}


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

     vnc_client_io_error(vs, -1, EINVAL);

void vnc_client_error(VncState *vs)

{

    vnc_client_io_error(vs, -1, EINVAL);

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     DPRINTF(port, "reset port\n");
     ide_bus_reset(&d->port);
     ide_state->ncq_queues = AHCI_MAX_CMDS;
+    pr->scr_stat = 0;
+    pr->scr_err = 0;
+    pr->scr_act = 0;
+    d->busy_slot = -1;
+    d->init_d2h_sent = 0;
     ide_state = &s->dev[port].port.ifs[0];
     if (!ide_state->bs) {
         return;

static void ahci_reset_port(AHCIState *s, int port)
{
    AHCIDevice *d = &s->dev[port];
    AHCIPortRegs *pr = &d->port_regs;
    IDEState *ide_state = &d->port.ifs[0];
    int i;
    DPRINTF(port, "reset port\n");
    ide_bus_reset(&d->port);
    ide_state->ncq_queues = AHCI_MAX_CMDS;
    pr->scr_stat = 0;
    pr->scr_err = 0;
    pr->scr_act = 0;
    d->busy_slot = -1;
    d->init_d2h_sent = 0;
    ide_state = &s->dev[port].port.ifs[0];
    if (!ide_state->bs) {
        return;
    /* reset ncq queue */
    for (i = 0; i < AHCI_MAX_CMDS; i++) {
        NCQTransferState *ncq_tfs = &s->dev[port].ncq_tfs[i];
        if (ncq_tfs->aiocb) {
            bdrv_aio_cancel(ncq_tfs->aiocb);
            ncq_tfs->aiocb = NULL;
        qemu_sglist_destroy(&ncq_tfs->sglist);
        ncq_tfs->used = 0;
    s->dev[port].port_state = STATE_RUN;
    if (!ide_state->bs) {
        s->dev[port].port_regs.sig = 0;
        ide_state->status = SEEK_STAT | WRERR_STAT;
    } else if (ide_state->drive_kind == IDE_CD) {
        s->dev[port].port_regs.sig = SATA_SIGNATURE_CDROM;
        ide_state->lcyl = 0x14;
        ide_state->hcyl = 0xeb;
        DPRINTF(port, "set lcyl = %d\n", ide_state->lcyl);
        ide_state->status = SEEK_STAT | WRERR_STAT | READY_STAT;
    } else {
        s->dev[port].port_regs.sig = SATA_SIGNATURE_DISK;
        ide_state->status = SEEK_STAT | WRERR_STAT;
    ide_state->error = 1;
    ahci_init_d2h(d);


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void virtio_queue_set_notification(VirtQueue *vq, int enable)
+
+{
+
+    vq->notification = enable;
+
     if (vq->vdev->guest_features & (1 << VIRTIO_RING_F_EVENT_IDX)) {

         vring_avail_event(vq, vring_avail_idx(vq));

void virtio_queue_set_notification(VirtQueue *vq, int enable)

{

    vq->notification = enable;

    if (vq->vdev->guest_features & (1 << VIRTIO_RING_F_EVENT_IDX)) {

        vring_avail_event(vq, vring_avail_idx(vq));

    } else if (enable) {

        vring_used_flags_unset_bit(vq, VRING_USED_F_NO_NOTIFY);

    } else {

        vring_used_flags_set_bit(vq, VRING_USED_F_NO_NOTIFY);


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

     const FieldMatchContext *fm = ctx->priv;
+
     AVFilterPad pad = {

         .name         = av_strdup("main"),

+        .type         = AVMEDIA_TYPE_VIDEO,

         .filter_frame = filter_frame,

static av_cold int fieldmatch_init(AVFilterContext *ctx)

{

    const FieldMatchContext *fm = ctx->priv;

    AVFilterPad pad = {

        .name         = av_strdup("main"),

        .type         = AVMEDIA_TYPE_VIDEO,

        .filter_frame = filter_frame,

        .config_props = config_input,

    };

    if (!pad.name)

        return AVERROR(ENOMEM);

    ff_insert_inpad(ctx, INPUT_MAIN, &pad);

    if (fm->ppsrc) {

        pad.name = av_strdup("clean_src");

        pad.config_props = NULL;

        if (!pad.name)

            return AVERROR(ENOMEM);

        ff_insert_inpad(ctx, INPUT_CLEANSRC, &pad);

    }

    if ((fm->blockx & (fm->blockx - 1)) ||

        (fm->blocky & (fm->blocky - 1))) {

        av_log(ctx, AV_LOG_ERROR, "blockx and blocky settings must be power of two\n");

        return AVERROR(EINVAL);

    }

    if (fm->combpel > fm->blockx * fm->blocky) {

        av_log(ctx, AV_LOG_ERROR, "Combed pixel should not be larger than blockx x blocky\n");

        return AVERROR(EINVAL);

    }

    return 0;

}


static void aw_emac_cleanup(NetClientState *nc)

{

    AwEmacState *s = qemu_get_nic_opaque(nc);

    s->nic = NULL;

}


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

     void *mapped = clEnqueueMapBuffer(gpu_env.command_queue, dst_cl_buf,
+
+                                      CL_TRUE,CL_MAP_WRITE, 0, sizeof(uint8_t) * buf_size,
+
+                                      0, NULL, NULL, &status);
+

     if (status != CL_SUCCESS) {

int av_opencl_buffer_write(cl_mem dst_cl_buf, uint8_t *src_buf, size_t buf_size)

{

    cl_int status;

    void *mapped = clEnqueueMapBuffer(gpu_env.command_queue, dst_cl_buf,

                                      CL_TRUE,CL_MAP_WRITE, 0, sizeof(uint8_t) * buf_size,

                                      0, NULL, NULL, &status);

    if (status != CL_SUCCESS) {

        av_log(&openclutils, AV_LOG_ERROR, "Could not map OpenCL buffer: %s\n", opencl_errstr(status));

        return AVERROR_EXTERNAL;

    }

    memcpy(mapped, src_buf, buf_size);

    status = clEnqueueUnmapMemObject(gpu_env.command_queue, dst_cl_buf, mapped, 0, NULL, NULL);

    if (status != CL_SUCCESS) {

        av_log(&openclutils, AV_LOG_ERROR, "Could not unmap OpenCL buffer: %s\n", opencl_errstr(status));

        return AVERROR_EXTERNAL;

    }

    return 0;

}


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

     id[len] = 0;

+
+
+    QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
+
+        if (!strncmp(id, block->idstr, sizeof(id)) &&

             block->max_length > offset) {

static inline void *host_from_stream_offset(QEMUFile *f,

                                            ram_addr_t offset,

                                            int flags)

{

    static RAMBlock *block = NULL;

    char id[256];

    uint8_t len;

    if (flags & RAM_SAVE_FLAG_CONTINUE) {

        if (!block || block->max_length <= offset) {

            error_report("Ack, bad migration stream!");

            return NULL;

        }

        return block->host + offset;

    }

    len = qemu_get_byte(f);

    qemu_get_buffer(f, (uint8_t *)id, len);

    id[len] = 0;

    QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {

        if (!strncmp(id, block->idstr, sizeof(id)) &&

            block->max_length > offset) {

            return block->host + offset;

        }

    }

    error_report("Can't find block %s!", id);

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void kvm_apic_mem_write(void *opaque, target_phys_addr_t addr,
+
+                               uint64_t data, unsigned size)
+
+{
+
     MSIMessage msg = { .address = addr, .data = data };

     int ret;

static void kvm_apic_mem_write(void *opaque, target_phys_addr_t addr,

                               uint64_t data, unsigned size)

{

    MSIMessage msg = { .address = addr, .data = data };

    int ret;

    ret = kvm_irqchip_send_msi(kvm_state, msg);

    if (ret < 0) {

        fprintf(stderr, "KVM: injection failed, MSI lost (%s)\n",

                strerror(-ret));

    }

}


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

+    /* each plane data starts with mc_vector_count field, */
+
+    /* an optional array of motion vectors followed by the vq data */
+
+    num_vectors = bytestream_get_le32(&data);

     ctx->mc_vectors  = num_vectors ? data : 0;

static int decode_plane(Indeo3DecodeContext *ctx, AVCodecContext *avctx,

                        Plane *plane, const uint8_t *data, int32_t data_size,

                        int32_t strip_width)

{

    Cell            curr_cell;

    int             num_vectors;

    /* each plane data starts with mc_vector_count field, */

    /* an optional array of motion vectors followed by the vq data */

    num_vectors = bytestream_get_le32(&data);

    ctx->mc_vectors  = num_vectors ? data : 0;

    /* init the bitreader */

    init_get_bits(&ctx->gb, &data[num_vectors * 2], data_size << 3);

    ctx->skip_bits   = 0;

    ctx->need_resync = 0;

    ctx->last_byte = data + data_size - 1;

    /* initialize the 1st cell and set its dimensions to whole plane */

    curr_cell.xpos   = curr_cell.ypos = 0;

    curr_cell.width  = plane->width  >> 2;

    curr_cell.height = plane->height >> 2;

    curr_cell.tree   = 0; // we are in the MC tree now

    curr_cell.mv_ptr = 0; // no motion vector = INTRA cell

    return parse_bintree(ctx, avctx, plane, INTRA_NULL, &curr_cell, CELL_STACK_MAX, strip_width);

}


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

     return bs->blk ? blk_legacy_dinfo(bs->blk) : NULL;
+
 }

DriveInfo *drive_get_by_blockdev(BlockDriverState *bs)

{

    return bs->blk ? blk_legacy_dinfo(bs->blk) : NULL;

}


--- a/source.c
+++ b/source.c
@@ -13,7 +13,7 @@
     memcpy(lpc->chip_config + addr, &val, len);

     pci_bus_fire_intx_routing_notifier(lpc->d.bus);
+
+    ich9_cc_update(lpc);
+
+}

static void ich9_cc_write(void *opaque, hwaddr addr,

                          uint64_t val, unsigned len)

{

    ICH9LPCState *lpc = (ICH9LPCState *)opaque;

    ich9_cc_addr_len(&addr, &len);

    memcpy(lpc->chip_config + addr, &val, len);

    pci_bus_fire_intx_routing_notifier(lpc->d.bus);

    ich9_cc_update(lpc);

}


--- a/source.c
+++ b/source.c
@@ -21,9 +21,9 @@
     memory_region_init_io(&s->iomem, OBJECT(s), &sl_ops, s, "sl", 0x40);

     sysbus_init_mmio(dev, &s->iomem);
+
+
+
+    return 0;
+
 }

static int sl_nand_init(SysBusDevice *dev)

{

    SLNANDState *s = SL_NAND(dev);

    DriveInfo *nand;

    s->ctl = 0;

    nand = drive_get(IF_MTD, 0, 0);

    s->nand = nand_init(nand ? blk_bs(blk_by_legacy_dinfo(nand)) : NULL,

                        s->manf_id, s->chip_id);

    memory_region_init_io(&s->iomem, OBJECT(s), &sl_ops, s, "sl", 0x40);

    sysbus_init_mmio(dev, &s->iomem);

    return 0;

}


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

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

+            Range *range = &g_array_index(debug_regions, Range, i);
+
+            if (addr >= range->begin && addr <= range->end - 1) {
+
+                return true;

             }

bool qemu_log_in_addr_range(uint64_t addr)

{

    if (debug_regions) {

        int i = 0;

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

            Range *range = &g_array_index(debug_regions, Range, i);

            if (addr >= range->begin && addr <= range->end - 1) {

                return true;

            }

        }

        return false;

    } else {

        return true;

    }

}


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

     s->write_msgfds_num = num;
+
+
+
+    return 0;
+
 }

static int tcp_set_msgfds(CharDriverState *chr, int *fds, int num)

{

    TCPCharDriver *s = chr->opaque;

    /* clear old pending fd array */

    if (s->write_msgfds) {

        g_free(s->write_msgfds);

    }

    if (num) {

        s->write_msgfds = g_malloc(num * sizeof(int));

        memcpy(s->write_msgfds, fds, num * sizeof(int));

    }

    s->write_msgfds_num = num;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -8,11 +8,11 @@
         if(filter && (!strcmp(target, "all") || !strcmp(target, filter->name) || !strcmp(target, filter->filter->name))){
             AVFilterCommand **queue = &filter->command_queue, *next;
             while (*queue && (*queue)->time <= ts)
+                queue = &(*queue)->next;
+            next = *queue;
+            *queue = av_mallocz(sizeof(AVFilterCommand));
+            (*queue)->command = av_strdup(command);
+            (*queue)->arg     = av_strdup(arg);
             (*queue)->time    = ts;
             (*queue)->flags   = flags;
             (*queue)->next    = next;

int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const char *command, const char *arg, int flags, double ts)
{
    int i;
    if(!graph)
        return 0;
    for (i = 0; i < graph->nb_filters; i++) {
        AVFilterContext *filter = graph->filters[i];
        if(filter && (!strcmp(target, "all") || !strcmp(target, filter->name) || !strcmp(target, filter->filter->name))){
            AVFilterCommand **queue = &filter->command_queue, *next;
            while (*queue && (*queue)->time <= ts)
                queue = &(*queue)->next;
            next = *queue;
            *queue = av_mallocz(sizeof(AVFilterCommand));
            (*queue)->command = av_strdup(command);
            (*queue)->arg     = av_strdup(arg);
            (*queue)->time    = ts;
            (*queue)->flags   = flags;
            (*queue)->next    = next;
            if(flags & AVFILTER_CMD_FLAG_ONE)
                return 0;
        }
    }
    return 0;
}


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

         ret.translated_addr = addr & AMDVI_PAGE_MASK_4K;

+        ret.addr_mask = ~AMDVI_PAGE_MASK_4K;
+
+        ret.perm = IOMMU_RW;
+
+        return ret;

     } else if (amdvi_is_interrupt_addr(addr)) {

static IOMMUTLBEntry amdvi_translate(MemoryRegion *iommu, hwaddr addr,

                                     bool is_write)

{

    AMDVIAddressSpace *as = container_of(iommu, AMDVIAddressSpace, iommu);

    AMDVIState *s = as->iommu_state;

    IOMMUTLBEntry ret = {

        .target_as = &address_space_memory,

        .iova = addr,

        .translated_addr = 0,

        .addr_mask = ~(hwaddr)0,

        .perm = IOMMU_NONE

    };

    if (!s->enabled) {

        /* AMDVI disabled - corresponds to iommu=off not

         * failure to provide any parameter

         */

        ret.iova = addr & AMDVI_PAGE_MASK_4K;

        ret.translated_addr = addr & AMDVI_PAGE_MASK_4K;

        ret.addr_mask = ~AMDVI_PAGE_MASK_4K;

        ret.perm = IOMMU_RW;

        return ret;

    } else if (amdvi_is_interrupt_addr(addr)) {

        ret.iova = addr & AMDVI_PAGE_MASK_4K;

        ret.translated_addr = addr & AMDVI_PAGE_MASK_4K;

        ret.addr_mask = ~AMDVI_PAGE_MASK_4K;

        ret.perm = IOMMU_WO;

        return ret;

    }

    amdvi_do_translate(as, addr, is_write, &ret);

    trace_amdvi_translation_result(as->bus_num, PCI_SLOT(as->devfn),

            PCI_FUNC(as->devfn), addr, ret.translated_addr);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void i82374_init(I82374State *s)
+
 {

     DMA_init(1, NULL);

static void i82374_init(I82374State *s)

{

    DMA_init(1, NULL);

    memset(s->commands, 0, sizeof(s->commands));

}


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

     }

+    memset(output[3], 0, sizeof(output[3]));
+
+    memset(output[4], 0, sizeof(output[4]));
+
+}

static inline void mix_2f_2r_to_dolby(AC3DecodeContext *ctx)

{

    int i;

    float (*output)[256] = ctx->audio_block.block_output;

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

        output[1][i] -= output[3][i];

        output[2][i] += output[4][i];

    }

    memset(output[3], 0, sizeof(output[3]));

    memset(output[4], 0, sizeof(output[4]));

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 int parse_host_src_port(struct sockaddr_in *haddr,
+
                         struct sockaddr_in *saddr,

                         const char *input_str)

int parse_host_src_port(struct sockaddr_in *haddr,

                        struct sockaddr_in *saddr,

                        const char *input_str)

{

    char *str = strdup(input_str);

    char *host_str = str;

    char *src_str;

    const char *src_str2;

    char *ptr;

    /*

     * Chop off any extra arguments at the end of the string which

     * would start with a comma, then fill in the src port information

     * if it was provided else use the "any address" and "any port".

     */

    if ((ptr = strchr(str,',')))

        *ptr = '\0';

    if ((src_str = strchr(input_str,'@'))) {

        *src_str = '\0';

        src_str++;

    }

    if (parse_host_port(haddr, host_str) < 0)

        goto fail;

    src_str2 = src_str;

    if (!src_str || *src_str == '\0')

        src_str2 = ":0";

    if (parse_host_port(saddr, src_str2) < 0)

        goto fail;

    free(str);

    return(0);

fail:

    free(str);

    return -1;

}


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

     int index = IS_USER(s);
+
     s->is_mem = 1;

     switch(opsize) {

+    case OS_BYTE:

         tcg_gen_qemu_st8(val, addr, index);

static inline void gen_store(DisasContext *s, int opsize, TCGv addr, TCGv val)

{

    int index = IS_USER(s);

    s->is_mem = 1;

    switch(opsize) {

    case OS_BYTE:

        tcg_gen_qemu_st8(val, addr, index);

        break;

    case OS_WORD:

        tcg_gen_qemu_st16(val, addr, index);

        break;

    case OS_LONG:

    case OS_SINGLE:

        tcg_gen_qemu_st32(val, addr, index);

        break;

    default:

        qemu_assert(0, "bad store size");

    }

    gen_throws_exception = gen_last_qop;

}


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

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


--- a/source.c
+++ b/source.c
@@ -5,5 +5,5 @@
     assert(src == sextract64(src, 0, 22));

     return tcg_opc_a5(qp, OPC_ADDL_A5, dst, src, TCG_REG_R0);
+
+}

static inline uint64_t tcg_opc_movi_a(int qp, TCGReg dst, int64_t src)

{

    assert(src == sextract64(src, 0, 22));

    return tcg_opc_a5(qp, OPC_ADDL_A5, dst, src, TCG_REG_R0);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int qemu_event_init(void)

 {
+
     int err;

     int fds[2];

static int qemu_event_init(void)

{

    int err;

    int fds[2];

    err = pipe(fds);

    if (err == -1)

        return -errno;

    err = fcntl_setfl(fds[0], O_NONBLOCK);

    if (err < 0)

        goto fail;

    err = fcntl_setfl(fds[1], O_NONBLOCK);

    if (err < 0)

        goto fail;

    qemu_set_fd_handler2(fds[0], NULL, qemu_event_read, NULL,

                         (void *)(unsigned long)fds[0]);

    io_thread_fd = fds[1];

    return 0;

fail:

    close(fds[0]);

    close(fds[1]);

    return err;

}


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

 {

+    target_phys_addr_t addr;
+
+

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

static target_phys_addr_t intel_hda_addr(uint32_t lbase, uint32_t ubase)

{

    target_phys_addr_t addr;

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

    return addr;

}


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

 #if !defined(CONFIG_USER_ONLY)
+
+    if (ctx->mem_idx == 2)

         read_cb = ctx->spr_cb[sprn].hea_read;

     else if (ctx->mem_idx)
+
+        read_cb = ctx->spr_cb[sprn].oea_read;

     else

static inline void gen_op_mfspr(DisasContext *ctx)

{

    void (*read_cb)(void *opaque, int gprn, int sprn);

    uint32_t sprn = SPR(ctx->opcode);

#if !defined(CONFIG_USER_ONLY)

    if (ctx->mem_idx == 2)

        read_cb = ctx->spr_cb[sprn].hea_read;

    else if (ctx->mem_idx)

        read_cb = ctx->spr_cb[sprn].oea_read;

    else

#endif

        read_cb = ctx->spr_cb[sprn].uea_read;

    if (likely(read_cb != NULL)) {

        if (likely(read_cb != SPR_NOACCESS)) {

            (*read_cb)(ctx, rD(ctx->opcode), sprn);

        } else {

            /* Privilege exception */

            /* This is a hack to avoid warnings when running Linux:

             * this OS breaks the PowerPC virtualisation model,

             * allowing userland application to read the PVR

             */

            if (sprn != SPR_PVR) {

                qemu_log("Trying to read privileged spr %d %03x at "

                         TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);

                printf("Trying to read privileged spr %d %03x at "

                       TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);

            }

            gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

        }

    } else {

        /* Not defined */

        qemu_log("Trying to read invalid spr %d %03x at "

                    TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);

        printf("Trying to read invalid spr %d %03x at " TARGET_FMT_lx "\n",

               sprn, sprn, ctx->nip);

        gen_inval_exception(ctx, POWERPC_EXCP_INVAL_SPR);

    }

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
                         struct in6_address *dst_addr)

 {
+
     struct ip6_ext_hdr_routing *rthdr = (struct ip6_ext_hdr_routing *) ext_hdr;

_eth_get_rss_ex_dst_addr(const struct iovec *pkt, int pkt_frags,

                        size_t rthdr_offset,

                        struct ip6_ext_hdr *ext_hdr,

                        struct in6_address *dst_addr)

{

    struct ip6_ext_hdr_routing *rthdr = (struct ip6_ext_hdr_routing *) ext_hdr;

    if ((rthdr->rtype == 2) &&

        (rthdr->len == sizeof(struct in6_address) / 8) &&

        (rthdr->segleft == 1)) {

        size_t input_size = iov_size(pkt, pkt_frags);

        size_t bytes_read;

        if (input_size < rthdr_offset + sizeof(*ext_hdr)) {

            return false;

        }

        bytes_read = iov_to_buf(pkt, pkt_frags,

                                rthdr_offset + sizeof(*ext_hdr),

                                dst_addr, sizeof(*dst_addr));

        return bytes_read == sizeof(dst_addr);

    }

    return false;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void dump_json_image_check(ImageCheck *check, bool quiet)
+
 {

     Error *local_err = NULL;
+
     QString *str;

     QmpOutputVisitor *ov = qmp_output_visitor_new();

static void dump_json_image_check(ImageCheck *check, bool quiet)

{

    Error *local_err = NULL;

    QString *str;

    QmpOutputVisitor *ov = qmp_output_visitor_new();

    QObject *obj;

    visit_type_ImageCheck(qmp_output_get_visitor(ov), NULL, &check,

                          &local_err);

    obj = qmp_output_get_qobject(ov);

    str = qobject_to_json_pretty(obj);

    assert(str != NULL);

    qprintf(quiet, "%s\n", qstring_get_str(str));

    qobject_decref(obj);

    qmp_output_visitor_cleanup(ov);

    QDECREF(str);

}


--- a/source.c
+++ b/source.c
@@ -6,11 +6,11 @@
     uint64_t duration;
     if (trk->entry) {
         ref = trk->cluster[trk->entry - 1].dts;
+    } else if (   trk->start_dts != AV_NOPTS_VALUE
+               && !trk->frag_discont) {
+        ref = trk->start_dts + trk->track_duration;
+    } else
+        ref = pkt->dts; // Skip tests for the first packet
     duration = pkt->dts - ref;
     if (pkt->dts < ref || duration >= INT_MAX) {
         av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" / timestamp: %"PRId64" is out of range for mov/mp4 format\n",

static int check_pkt(AVFormatContext *s, AVPacket *pkt)
{
    MOVMuxContext *mov = s->priv_data;
    MOVTrack *trk = &mov->tracks[pkt->stream_index];
    int64_t ref;
    uint64_t duration;
    if (trk->entry) {
        ref = trk->cluster[trk->entry - 1].dts;
    } else if (   trk->start_dts != AV_NOPTS_VALUE
               && !trk->frag_discont) {
        ref = trk->start_dts + trk->track_duration;
    } else
        ref = pkt->dts; // Skip tests for the first packet
    duration = pkt->dts - ref;
    if (pkt->dts < ref || duration >= INT_MAX) {
        av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" / timestamp: %"PRId64" is out of range for mov/mp4 format\n",
            duration, pkt->dts
        );
        pkt->dts = ref + 1;
        pkt->pts = AV_NOPTS_VALUE;
    if (pkt->duration < 0 || pkt->duration > INT_MAX) {
        av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" is invalid\n", pkt->duration);
        return AVERROR(EINVAL);
    return 0;


--- a/source.c
+++ b/source.c
@@ -5,8 +5,8 @@
     PCIDevice *dev = PCI_DEVICE(info->ring->r);

     size_t size = read_only ? le16_to_cpu(info->desc.tlv_size) :
+
+                              le16_to_cpu(info->desc.buf_size);

char *desc_get_buf(DescInfo *info, bool read_only)

{

    PCIDevice *dev = PCI_DEVICE(info->ring->r);

    size_t size = read_only ? le16_to_cpu(info->desc.tlv_size) :

                              le16_to_cpu(info->desc.buf_size);

    if (size > info->buf_size) {

        info->buf = g_realloc(info->buf, size);

        info->buf_size = size;

    }

    if (!info->buf) {

        return NULL;

    }

    pci_dma_read(dev, le64_to_cpu(info->desc.buf_addr), info->buf, size);

    return info->buf;

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
 static always_inline target_ulong MASK (uint32_t start, uint32_t end)

 {
+
     target_ulong ret;
+

+#if defined(TARGET_PPC64)

+    if (likely(start == 0)) {

         ret = (uint64_t)(-1ULL) << (63 - end);

static always_inline target_ulong MASK (uint32_t start, uint32_t end)

{

    target_ulong ret;

#if defined(TARGET_PPC64)

    if (likely(start == 0)) {

        ret = (uint64_t)(-1ULL) << (63 - end);

    } else if (likely(end == 63)) {

        ret = (uint64_t)(-1ULL) >> start;

    }

#else

    if (likely(start == 0)) {

        ret = (uint32_t)(-1ULL) << (31  - end);

    } else if (likely(end == 31)) {

        ret = (uint32_t)(-1ULL) >> start;

    }

#endif

    else {

        ret = (((target_ulong)(-1ULL)) >> (start)) ^

            (((target_ulong)(-1ULL) >> (end)) >> 1);

        if (unlikely(start > end))

            return ~ret;

    }

    return ret;

}


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

                            uint32_t value)
+
+{
+
+    uint32_t addr;
+
     uint8_t mask;

     uint8_t v;

static void bitband_writeb(void *opaque, target_phys_addr_t offset,

                           uint32_t value)

{

    uint32_t addr;

    uint8_t mask;

    uint8_t v;

    addr = bitband_addr(opaque, offset);

    mask = (1 << ((offset >> 2) & 7));

    cpu_physical_memory_read(addr, &v, 1);

    if (value & 1)

        v |= mask;

    else

        v &= ~mask;

    cpu_physical_memory_write(addr, &v, 1);

}


void ff_simple_idct248_put(uint8_t *dest, int line_size, DCTELEM *block)

{

    int i;

    DCTELEM *ptr;

    /* butterfly */

    ptr = block;

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

        BF(0);

        BF(1);

        BF(2);

        BF(3);

        BF(4);

        BF(5);

        BF(6);

        BF(7);

        ptr += 2 * 8;

    }

    /* IDCT8 on each line */

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

        idctRowCondDC_8(block + i*8);

    }

    /* IDCT4 and store */

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

        idct4col_put(dest + i, 2 * line_size, block + i);

        idct4col_put(dest + line_size + i, 2 * line_size, block + 8 + i);

    }

}


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

     }
+
+    if (pu->prev_pu_offset && pu->prev_pu_offset < 13) {
+
+        av_log(NULL, AV_LOG_ERROR, "prev_pu_offset %d is invalid\n", pu->prev_pu_offset);
+
         return 0;

     }

static int unpack_parse_unit(DiracParseUnit *pu, DiracParseContext *pc,

                             int offset)

{

    int8_t *start;

    if (offset < 0 || pc->index - 13 < offset)

        return 0;

    start = pc->buffer + offset;

    pu->pu_type = start[4];

    pu->next_pu_offset = AV_RB32(start + 5);

    pu->prev_pu_offset = AV_RB32(start + 9);

    if (pu->pu_type == 0x10 && pu->next_pu_offset == 0)

        pu->next_pu_offset = 13;

    if (pu->next_pu_offset && pu->next_pu_offset < 13) {

        av_log(NULL, AV_LOG_ERROR, "next_pu_offset %d is invalid\n", pu->next_pu_offset);

        return 0;

    }

    if (pu->prev_pu_offset && pu->prev_pu_offset < 13) {

        av_log(NULL, AV_LOG_ERROR, "prev_pu_offset %d is invalid\n", pu->prev_pu_offset);

        return 0;

    }

    return 1;

}