--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
     ff_set_sar(avctx, av_div_q(
         (AVRational){ format->display_aspect_ratio.x, format->display_aspect_ratio.y },
         (AVRational){ avctx->width, avctx->height }));
+    if (!format->progressive_sequence)
+        avctx->flags |= AV_CODEC_FLAG_INTERLACED_DCT;
+    else
+        avctx->flags &= ~AV_CODEC_FLAG_INTERLACED_DCT;
+    if (format->video_signal_description.video_full_range_flag)
         avctx->color_range = AVCOL_RANGE_JPEG;
     else
         avctx->color_range = AVCOL_RANGE_MPEG;

static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* format)
{
    AVCodecContext *avctx = opaque;
    CuvidContext *ctx = avctx->priv_data;
    AVHWFramesContext *hwframe_ctx = (AVHWFramesContext*)ctx->hwframe->data;
    CUVIDDECODECREATEINFO cuinfo;
    av_log(avctx, AV_LOG_TRACE, "pfnSequenceCallback\n");
    ctx->internal_error = 0;
    avctx->width = format->display_area.right;
    avctx->height = format->display_area.bottom;
    ff_set_sar(avctx, av_div_q(
        (AVRational){ format->display_aspect_ratio.x, format->display_aspect_ratio.y },
        (AVRational){ avctx->width, avctx->height }));
    if (!format->progressive_sequence)
        avctx->flags |= AV_CODEC_FLAG_INTERLACED_DCT;
    else
        avctx->flags &= ~AV_CODEC_FLAG_INTERLACED_DCT;
    if (format->video_signal_description.video_full_range_flag)
        avctx->color_range = AVCOL_RANGE_JPEG;
    else
        avctx->color_range = AVCOL_RANGE_MPEG;
    avctx->color_primaries = format->video_signal_description.color_primaries;
    avctx->color_trc = format->video_signal_description.transfer_characteristics;
    avctx->colorspace = format->video_signal_description.matrix_coefficients;
    if (format->bitrate)
        avctx->bit_rate = format->bitrate;
    if (format->frame_rate.numerator && format->frame_rate.denominator) {
        avctx->framerate.num = format->frame_rate.numerator;
        avctx->framerate.den = format->frame_rate.denominator;
    if (ctx->cudecoder
            && avctx->coded_width == format->coded_width
            && avctx->coded_height == format->coded_height
            && ctx->chroma_format == format->chroma_format
            && ctx->codec_type == format->codec)
        return 1;
    if (ctx->cudecoder) {
        av_log(avctx, AV_LOG_ERROR, "re-initializing decoder is not supported\n");
    if (hwframe_ctx->pool && !ctx->ever_flushed) {
        av_log(avctx, AV_LOG_ERROR, "AVHWFramesContext is already initialized\n");
    avctx->coded_width = format->coded_width;
    avctx->coded_height = format->coded_height;
    ctx->chroma_format = format->chroma_format;
    memset(&cuinfo, 0, sizeof(cuinfo));
    cuinfo.CodecType = ctx->codec_type = format->codec;
    cuinfo.ChromaFormat = format->chroma_format;
    cuinfo.OutputFormat = cudaVideoSurfaceFormat_NV12;
    cuinfo.ulWidth = avctx->coded_width;
    cuinfo.ulHeight = avctx->coded_height;
    cuinfo.ulTargetWidth = cuinfo.ulWidth;
    cuinfo.ulTargetHeight = cuinfo.ulHeight;
    cuinfo.target_rect.left = 0;
    cuinfo.target_rect.top = 0;
    cuinfo.target_rect.right = cuinfo.ulWidth;
    cuinfo.target_rect.bottom = cuinfo.ulHeight;
    cuinfo.ulNumDecodeSurfaces = MAX_FRAME_COUNT;
    cuinfo.ulNumOutputSurfaces = 1;
    cuinfo.ulCreationFlags = cudaVideoCreate_PreferCUVID;
    cuinfo.DeinterlaceMode = cudaVideoDeinterlaceMode_Weave;
    ctx->internal_error = CHECK_CU(cuvidCreateDecoder(&ctx->cudecoder, &cuinfo));
    if (ctx->internal_error < 0)
    if (!hwframe_ctx->pool) {
        hwframe_ctx->format = AV_PIX_FMT_CUDA;
        hwframe_ctx->sw_format = AV_PIX_FMT_NV12;
        hwframe_ctx->width = FFALIGN(avctx->coded_width, 32);
        hwframe_ctx->height = FFALIGN(avctx->coded_height, 32);
        if ((ctx->internal_error = av_hwframe_ctx_init(ctx->hwframe)) < 0) {
            av_log(avctx, AV_LOG_ERROR, "av_hwframe_ctx_init failed\n");
    return 1;


static int default_fdset_dup_fd_remove(int dup_fd)

{

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+void qemu_unregister_clock_reset_notifier(QEMUClock *clock,
+
                                           Notifier *notifier)

 {

void qemu_unregister_clock_reset_notifier(QEMUClock *clock,

                                          Notifier *notifier)

{

    qemu_clock_unregister_reset_notifier(clock->type, notifier);

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
     QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {

         if (bmds->dirty_bitmap) {
+
+            bdrv_release_dirty_bitmap(bmds->bs, bmds->dirty_bitmap);
+
+        }
+
     }

     return ret;

static int set_dirty_tracking(void)

{

    BlkMigDevState *bmds;

    int ret;

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

        bmds->dirty_bitmap = bdrv_create_dirty_bitmap(bmds->bs, BLOCK_SIZE,

                                                      NULL);

        if (!bmds->dirty_bitmap) {

            ret = -errno;

            goto fail;

        }

    }

    return 0;

fail:

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

        if (bmds->dirty_bitmap) {

            bdrv_release_dirty_bitmap(bmds->bs, bmds->dirty_bitmap);

        }

    }

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static bool sd_get_inserted(SDState *sd)

 {
+
     return blk_is_inserted(sd->blk);

 }

static bool sd_get_inserted(SDState *sd)

{

    return blk_is_inserted(sd->blk);

}


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

 {

+    env->banked_r13[bank_number(mode)] = val;

 }

void HELPER(set_r13_banked)(CPUState *env, uint32_t mode, uint32_t val)

{

    env->banked_r13[bank_number(mode)] = val;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int thread_execute(AVFilterContext *ctx, avfilter_action_func *func,

+                          void *arg, int *ret, int nb_jobs)

 {

@@ -8,12 +8,12 @@

     int dummy_ret;

+
+
+    if (nb_jobs <= 0)

+        return 0;
+

     pthread_mutex_lock(&c->current_job_lock);

static int thread_execute(AVFilterContext *ctx, avfilter_action_func *func,

                          void *arg, int *ret, int nb_jobs)

{

    ThreadContext *c = ctx->graph->internal->thread;

    int dummy_ret;

    if (nb_jobs <= 0)

        return 0;

    pthread_mutex_lock(&c->current_job_lock);

    c->current_job = c->nb_threads;

    c->nb_jobs     = nb_jobs;

    c->ctx         = ctx;

    c->arg         = arg;

    c->func        = func;

    if (ret) {

        c->rets    = ret;

        c->nb_rets = nb_jobs;

    } else {

        c->rets    = &dummy_ret;

        c->nb_rets = 1;

    }

    c->current_execute++;

    pthread_cond_broadcast(&c->current_job_cond);

    slice_thread_park_workers(c);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -4,11 +4,11 @@
     uint16_t (*buffer)[4];
     int left[4], top[4], topleft[4];
     const int linesize = s->linesize[0];
+    const int mask     = (1 << s->bits) - 1;
+    int resync_mb_y = 0;
+    int resync_mb_x = 0;
+    s->restart_count = s->restart_interval;
+    av_fast_malloc(&s->ljpeg_buffer, &s->ljpeg_buffer_size,
                    (unsigned)s->mb_width * 4 * sizeof(s->ljpeg_buffer[0][0]));
     buffer = s->ljpeg_buffer;
     for (i = 0; i < 4; i++)

static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int predictor, int point_transform)
{
    int i, mb_x, mb_y;
    uint16_t (*buffer)[4];
    int left[4], top[4], topleft[4];
    const int linesize = s->linesize[0];
    const int mask     = (1 << s->bits) - 1;
    int resync_mb_y = 0;
    int resync_mb_x = 0;
    s->restart_count = s->restart_interval;
    av_fast_malloc(&s->ljpeg_buffer, &s->ljpeg_buffer_size,
                   (unsigned)s->mb_width * 4 * sizeof(s->ljpeg_buffer[0][0]));
    buffer = s->ljpeg_buffer;
    for (i = 0; i < 4; i++)
        buffer[0][i] = 1 << (s->bits - 1);
    for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
        uint8_t *ptr = s->picture.data[0] + (linesize * mb_y);
        if (s->interlaced && s->bottom_field)
            ptr += linesize >> 1;
        for (i = 0; i < 4; i++)
            top[i] = left[i] = topleft[i] = buffer[0][i];
        for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
            int modified_predictor = predictor;
            if (s->restart_interval && !s->restart_count){
                s->restart_count = s->restart_interval;
                resync_mb_x = mb_x;
                resync_mb_y = mb_y;
                for(i=0; i<4; i++)
                    top[i] = left[i]= topleft[i]= 1 << (s->bits - 1);
            }
            if (mb_y == resync_mb_y || mb_y == resync_mb_y+1 && mb_x < resync_mb_x || !mb_x)
                modified_predictor = 1;
            for (i=0;i<nb_components;i++) {
                int pred, dc;
                topleft[i] = top[i];
                top[i]     = buffer[mb_x][i];
                PREDICT(pred, topleft[i], top[i], left[i], modified_predictor);
                dc = mjpeg_decode_dc(s, s->dc_index[i]);
                if(dc == 0xFFFF)
                    return -1;
                left[i] = buffer[mb_x][i] =
                    mask & (pred + (dc << point_transform));
            }
            if (s->restart_interval && !--s->restart_count) {
                align_get_bits(&s->gb);
                skip_bits(&s->gb, 16); /* skip RSTn */
            }
        }
        if (s->nb_components == 4) {
            for(i=0; i<nb_components; i++) {
                int c= s->comp_index[i];
                for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
                    ptr[4*mb_x+3-c] = buffer[mb_x][i];
                }
            }
        } else if (s->rct) {
            for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
                ptr[3*mb_x + 1] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2] - 0x200) >> 2);
                ptr[3*mb_x + 0] = buffer[mb_x][1] + ptr[3*mb_x + 1];
                ptr[3*mb_x + 2] = buffer[mb_x][2] + ptr[3*mb_x + 1];
            }
        } else if (s->pegasus_rct) {
            for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
                ptr[3*mb_x + 1] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2]) >> 2);
                ptr[3*mb_x + 0] = buffer[mb_x][1] + ptr[3*mb_x + 1];
                ptr[3*mb_x + 2] = buffer[mb_x][2] + ptr[3*mb_x + 1];
            }
        } else {
            for(i=0; i<nb_components; i++) {
                int c= s->comp_index[i];
                for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
                    ptr[3*mb_x+2-c] = buffer[mb_x][i];
                }
            }
        }
    }
    return 0;
}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
             url_fseek(pb, -TS_PACKET_SIZE, SEEK_CUR);

             if (mpegts_resync(pb) < 0)
+
+                return AVERROR_INVALIDDATA;
+
+            else
+
                 continue;

         } else {

static int read_packet(ByteIOContext *pb, uint8_t *buf, int raw_packet_size)

{

    int skip, len;

    for(;;) {

        len = get_buffer(pb, buf, TS_PACKET_SIZE);

        if (len != TS_PACKET_SIZE)

            return AVERROR(EIO);

        /* check paquet sync byte */

        if (buf[0] != 0x47) {

            /* find a new packet start */

            url_fseek(pb, -TS_PACKET_SIZE, SEEK_CUR);

            if (mpegts_resync(pb) < 0)

                return AVERROR_INVALIDDATA;

            else

                continue;

        } else {

            skip = raw_packet_size - TS_PACKET_SIZE;

            if (skip > 0)

                url_fskip(pb, skip);

            break;

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+bool memory_region_present(MemoryRegion *container, hwaddr addr)
+
+{
+
     MemoryRegion *mr = memory_region_find(container, addr, 1).mr;
+
+    if (!mr || (mr == container)) {

         return false;

bool memory_region_present(MemoryRegion *container, hwaddr addr)

{

    MemoryRegion *mr = memory_region_find(container, addr, 1).mr;

    if (!mr || (mr == container)) {

        return false;

    }

    memory_region_unref(mr);

    return true;

}


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

     env->asi = 0x82; // Primary no-fault

+#endif
+
+#else
+
+    env->psret = 0;

     env->psrs = 1;

void cpu_reset(CPUSPARCState *env)

{

    tlb_flush(env, 1);

    env->cwp = 0;

    env->wim = 1;

    env->regwptr = env->regbase + (env->cwp * 16);

#if defined(CONFIG_USER_ONLY)

    env->user_mode_only = 1;

#ifdef TARGET_SPARC64

    env->cleanwin = env->nwindows - 2;

    env->cansave = env->nwindows - 2;

    env->pstate = PS_RMO | PS_PEF | PS_IE;

    env->asi = 0x82; // Primary no-fault

#endif

#else

    env->psret = 0;

    env->psrs = 1;

    env->psrps = 1;

#ifdef TARGET_SPARC64

    env->pstate = PS_PRIV;

    env->hpstate = HS_PRIV;

    env->pc = 0x1fff0000020ULL; // XXX should be different for system_reset

    env->tsptr = &env->ts[env->tl];

#else

    env->pc = 0;

    env->mmuregs[0] &= ~(MMU_E | MMU_NF);

    env->mmuregs[0] |= env->mmu_bm;

#endif

    env->npc = env->pc + 4;

#endif

}


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

 {

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

                                 ptrdiff_t stride)

{

    avc_luma_midv_qrt_16w_msa(src - (2 * stride) - 2,

                              stride, dst, stride, 16, 0);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void usb_mtp_handle_reset(USBDevice *dev)

 {
+
     MTPState *s = USB_MTP(dev);

static void usb_mtp_handle_reset(USBDevice *dev)

{

    MTPState *s = USB_MTP(dev);

    trace_usb_mtp_reset(s->dev.addr);

#ifdef __linux__

    usb_mtp_inotify_cleanup(s);

#endif

    usb_mtp_object_free(s, QTAILQ_FIRST(&s->objects));

    s->session = 0;

    usb_mtp_data_free(s->data_in);

    s->data_in = NULL;

    usb_mtp_data_free(s->data_out);

    s->data_out = NULL;

    g_free(s->result);

    s->result = NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void qed_aio_write_alloc(QEDAIOCB *acb, size_t len)

+{

     BDRVQEDState *s = acb_to_s(acb);

static void qed_aio_write_alloc(QEDAIOCB *acb, size_t len)

{

    BDRVQEDState *s = acb_to_s(acb);

    /* Freeze this request if another allocating write is in progress */

    if (acb != QSIMPLEQ_FIRST(&s->allocating_write_reqs)) {

        QSIMPLEQ_INSERT_TAIL(&s->allocating_write_reqs, acb, next);

    }

    if (acb != QSIMPLEQ_FIRST(&s->allocating_write_reqs)) {

        return; /* wait for existing request to finish */

    }

    acb->cur_nclusters = qed_bytes_to_clusters(s,

            qed_offset_into_cluster(s, acb->cur_pos) + len);

    acb->cur_cluster = qed_alloc_clusters(s, acb->cur_nclusters);

    qemu_iovec_copy(&acb->cur_qiov, acb->qiov, acb->qiov_offset, len);

    if (qed_should_set_need_check(s)) {

        s->header.features |= QED_F_NEED_CHECK;

        qed_write_header(s, qed_aio_write_prefill, acb);

    } else {

        qed_aio_write_prefill(acb, 0);

    }

}


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

 {
+
+    if (cryptodev_backend_is_used(CRYPTODEV_BACKEND(val))) {
+
+        char *path = object_get_canonical_path_component(val);
+
         error_setg(errp,

             "can't use already used cryptodev backend: %s", path);

virtio_crypto_check_cryptodev_is_used(const Object *obj, const char *name,

                                      Object *val, Error **errp)

{

    if (cryptodev_backend_is_used(CRYPTODEV_BACKEND(val))) {

        char *path = object_get_canonical_path_component(val);

        error_setg(errp,

            "can't use already used cryptodev backend: %s", path);

        g_free(path);

    } else {

        qdev_prop_allow_set_link_before_realize(obj, name, val, errp);

    }

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     EventNotifierTestData data = { .n = 0, .active = 10, .auto_set = true };

     event_notifier_init(&data.e, false);
+
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb);
+
+    g_assert(!aio_poll(ctx, false));
+
     g_assert_cmpint(data.n, ==, 0);

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

static void test_flush_event_notifier(void)

{

    EventNotifierTestData data = { .n = 0, .active = 10, .auto_set = true };

    event_notifier_init(&data.e, false);

    aio_set_event_notifier(ctx, &data.e, event_ready_cb);

    g_assert(!aio_poll(ctx, false));

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

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

    event_notifier_set(&data.e);

    g_assert(aio_poll(ctx, false));

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

    g_assert_cmpint(data.active, ==, 9);

    g_assert(aio_poll(ctx, false));

    wait_until_inactive(&data);

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

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

    g_assert(!aio_poll(ctx, false));

    aio_set_event_notifier(ctx, &data.e, NULL);

    g_assert(!aio_poll(ctx, false));

    event_notifier_cleanup(&data.e);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 int kvm_arch_process_async_events(CPUState *env)

+{

     return 0;

int kvm_arch_process_async_events(CPUState *env)

{

    return 0;

}


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

 {
+
     return qemu_aio_context;

 }

AioContext *qemu_get_aio_context(void)

{

    return qemu_aio_context;

}


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

 {

+    if (vnc_set_x509_credential(vs, certdir, X509_CA_CERT_FILE, &vs->x509cacert, 0) < 0)
+
+	goto cleanup;
+
+    if (vnc_set_x509_credential(vs, certdir, X509_CA_CRL_FILE, &vs->x509cacrl, 1) < 0)

 	goto cleanup;

static int vnc_set_x509_credential_dir(VncDisplay *vs,

				       const char *certdir)

{

    if (vnc_set_x509_credential(vs, certdir, X509_CA_CERT_FILE, &vs->x509cacert, 0) < 0)

	goto cleanup;

    if (vnc_set_x509_credential(vs, certdir, X509_CA_CRL_FILE, &vs->x509cacrl, 1) < 0)

	goto cleanup;

    if (vnc_set_x509_credential(vs, certdir, X509_SERVER_CERT_FILE, &vs->x509cert, 0) < 0)

	goto cleanup;

    if (vnc_set_x509_credential(vs, certdir, X509_SERVER_KEY_FILE, &vs->x509key, 0) < 0)

	goto cleanup;

    return 0;

 cleanup:

    qemu_free(vs->x509cacert);

    qemu_free(vs->x509cacrl);

    qemu_free(vs->x509cert);

    qemu_free(vs->x509key);

    vs->x509cacert = vs->x509cacrl = vs->x509cert = vs->x509key = NULL;

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
                  "Number of SMBIOS Type 4 tables must match cpu count.\n");

         exit(1);
+
+    }
+
 }

static void smbios_validate_table(void)

{

    if (smbios_type4_count && smbios_type4_count != smp_cpus) {

         fprintf(stderr,

                 "Number of SMBIOS Type 4 tables must match cpu count.\n");

        exit(1);

    }

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
 {
     char buf[256];
     int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
+    AVStream *st = ic->streams[i];
+    int g = av_gcd(st->time_base.num, st->time_base.den);
+    AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
+    avcodec_string(buf, sizeof(buf), st->codec, is_output);
+    av_log(NULL, AV_LOG_INFO, "    Stream #%d:%d", index, i);
     /* the pid is an important information, so we display it */
     /* XXX: add a generic system */
     if (flags & AVFMT_SHOW_IDS)

static void dump_stream_format(AVFormatContext *ic, int i,
                               int index, int is_output)
{
    char buf[256];
    int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
    AVStream *st = ic->streams[i];
    int g = av_gcd(st->time_base.num, st->time_base.den);
    AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
    avcodec_string(buf, sizeof(buf), st->codec, is_output);
    av_log(NULL, AV_LOG_INFO, "    Stream #%d:%d", index, i);
    /* the pid is an important information, so we display it */
    /* XXX: add a generic system */
    if (flags & AVFMT_SHOW_IDS)
        av_log(NULL, AV_LOG_INFO, "[0x%x]", st->id);
    if (lang)
        av_log(NULL, AV_LOG_INFO, "(%s)", lang->value);
    av_log(NULL, AV_LOG_DEBUG, ", %d, %d/%d", st->codec_info_nb_frames,
           st->time_base.num / g, st->time_base.den / g);
    av_log(NULL, AV_LOG_INFO, ": %s", buf);
    if (st->sample_aspect_ratio.num && // default
        av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) {
        AVRational display_aspect_ratio;
        av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
                  st->codec->width  * st->sample_aspect_ratio.num,
                  st->codec->height * st->sample_aspect_ratio.den,
                  1024 * 1024);
        av_log(NULL, AV_LOG_INFO, ", SAR %d:%d DAR %d:%d",
               st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
               display_aspect_ratio.num, display_aspect_ratio.den);
    }
    if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
        if (st->avg_frame_rate.den && st->avg_frame_rate.num)
            print_fps(av_q2d(st->avg_frame_rate), "fps");
#if FF_API_R_FRAME_RATE
        if (st->r_frame_rate.den && st->r_frame_rate.num)
            print_fps(av_q2d(st->r_frame_rate), "tbr");
#endif
        if (st->time_base.den && st->time_base.num)
            print_fps(1 / av_q2d(st->time_base), "tbn");
        if (st->codec->time_base.den && st->codec->time_base.num)
            print_fps(1 / av_q2d(st->codec->time_base), "tbc");
    }
    if (st->disposition & AV_DISPOSITION_DEFAULT)
        av_log(NULL, AV_LOG_INFO, " (default)");
    if (st->disposition & AV_DISPOSITION_DUB)
        av_log(NULL, AV_LOG_INFO, " (dub)");
    if (st->disposition & AV_DISPOSITION_ORIGINAL)
        av_log(NULL, AV_LOG_INFO, " (original)");
    if (st->disposition & AV_DISPOSITION_COMMENT)
        av_log(NULL, AV_LOG_INFO, " (comment)");
    if (st->disposition & AV_DISPOSITION_LYRICS)
        av_log(NULL, AV_LOG_INFO, " (lyrics)");
    if (st->disposition & AV_DISPOSITION_KARAOKE)
        av_log(NULL, AV_LOG_INFO, " (karaoke)");
    if (st->disposition & AV_DISPOSITION_FORCED)
        av_log(NULL, AV_LOG_INFO, " (forced)");
    if (st->disposition & AV_DISPOSITION_HEARING_IMPAIRED)
        av_log(NULL, AV_LOG_INFO, " (hearing impaired)");
    if (st->disposition & AV_DISPOSITION_VISUAL_IMPAIRED)
        av_log(NULL, AV_LOG_INFO, " (visual impaired)");
    if (st->disposition & AV_DISPOSITION_CLEAN_EFFECTS)
        av_log(NULL, AV_LOG_INFO, " (clean effects)");
    av_log(NULL, AV_LOG_INFO, "\n");
    dump_metadata(NULL, st->metadata, "    ");
    dump_sidedata(NULL, st, "    ");
}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     *pcyls = bs->cyls;

     *pheads = bs->heads;
+
+    *psecs = bs->secs;
+
 }

void bdrv_get_geometry_hint(BlockDriverState *bs,

                            int *pcyls, int *pheads, int *psecs)

{

    *pcyls = bs->cyls;

    *pheads = bs->heads;

    *psecs = bs->secs;

}


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

     V9fsString target;

+    int32_t fid;
+
+    int err = 0;
+
+    V9fsFidState *fidp;

static void v9fs_readlink(void *opaque)

{

    V9fsPDU *pdu = opaque;

    size_t offset = 7;

    V9fsString target;

    int32_t fid;

    int err = 0;

    V9fsFidState *fidp;

    pdu_unmarshal(pdu, offset, "d", &fid);

    fidp = get_fid(pdu, fid);

    if (fidp == NULL) {

        err = -ENOENT;

        goto out_nofid;

    }

    v9fs_string_init(&target);

    err = v9fs_co_readlink(pdu, &fidp->path, &target);

    if (err < 0) {

        goto out;

    }

    offset += pdu_marshal(pdu, offset, "s", &target);

    err = offset;

    v9fs_string_free(&target);

out:

    put_fid(pdu, fidp);

out_nofid:

    trace_v9fs_readlink_return(pdu->tag, pdu->id, target.data);

    complete_pdu(pdu->s, pdu, err);

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     switch (saddr) {

     case BONITO_INTISR:
+
+        return s->regs[saddr];
+
+    default:
+
         return s->regs[saddr];

     }

static uint64_t bonito_readl(void *opaque, target_phys_addr_t addr,

                             unsigned size)

{

    PCIBonitoState *s = opaque;

    uint32_t saddr;

    saddr = (addr - BONITO_REGBASE) >> 2;

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

    switch (saddr) {

    case BONITO_INTISR:

        return s->regs[saddr];

    default:

        return s->regs[saddr];

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void put_uint32(QEMUFile *f, void *pv, size_t size)

+{
+
     uint32_t *v = pv;

     qemu_put_be32s(f, v);

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

{

    uint32_t *v = pv;

    qemu_put_be32s(f, v);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     Error *local_err = NULL;

     USBDevice *dev;
+
     QemuOpts *opts;

     int idx;
@@ -17,7 +17,7 @@
     if (!opts) {

         return NULL;
+
     }

     qemu_opt_set(opts, "type", "nic");

static USBDevice *usb_net_init(USBBus *bus, const char *cmdline)

{

    Error *local_err = NULL;

    USBDevice *dev;

    QemuOpts *opts;

    int idx;

    opts = qemu_opts_parse(qemu_find_opts("net"), cmdline, 0);

    if (!opts) {

        return NULL;

    }

    qemu_opt_set(opts, "type", "nic");

    qemu_opt_set(opts, "model", "usb");

    idx = net_client_init(opts, 0, &local_err);

    if (local_err) {

        error_report("%s", error_get_pretty(local_err));

        error_free(local_err);

        return NULL;

    }

    dev = usb_create(bus, "usb-net");

    qdev_set_nic_properties(&dev->qdev, &nd_table[idx]);

    qdev_init_nofail(&dev->qdev);

    return dev;

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     AVFilterContext *ctx  = inlink->dst;

     ConcatContext *cat    = ctx->priv;
+
     unsigned in_no = FF_INLINK_IDX(inlink);

static void process_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)

{

    AVFilterContext *ctx  = inlink->dst;

    ConcatContext *cat    = ctx->priv;

    unsigned in_no = FF_INLINK_IDX(inlink);

    if (in_no < cat->cur_idx) {

        av_log(ctx, AV_LOG_ERROR, "Frame after EOF on input %s\n",

               ctx->input_pads[in_no].name);

        avfilter_unref_buffer(buf);

    } if (in_no >= cat->cur_idx + ctx->nb_outputs) {

        ff_bufqueue_add(ctx, &cat->in[in_no].queue, buf);

    } else {

        push_frame(ctx, in_no, buf);

    }

}


--- a/source.c
+++ b/source.c
@@ -18,11 +18,11 @@
             break;
         for (i = 0; i < s->terms; i++) {
             t = s->decorr[i].value;
+            if (t > 8) {
+                if (t & 1)
+                    A =  2 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1];
+                else
+                    A = (3 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1;
                 s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0];
                 j                        = 0;
             } else {

static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb,
                                 void *dst, const int type)
{
    int i, j, count = 0;
    int last, t;
    int A, S, T;
    int pos                  = s->pos;
    uint32_t crc             = s->sc.crc;
    uint32_t crc_extra_bits  = s->extra_sc.crc;
    int16_t *dst16           = dst;
    int32_t *dst32           = dst;
    float *dstfl             = dst;
    s->one = s->zero = s->zeroes = 0;
    do {
        T = wv_get_value(s, gb, 0, &last);
        S = 0;
        if (last)
            break;
        for (i = 0; i < s->terms; i++) {
            t = s->decorr[i].value;
            if (t > 8) {
                if (t & 1)
                    A =  2 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1];
                else
                    A = (3 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1;
                s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0];
                j                        = 0;
            } else {
                A = s->decorr[i].samplesA[pos];
                j = (pos + t) & 7;
            if (type != AV_SAMPLE_FMT_S16P)
                S = T + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10);
            else
                S = T + ((s->decorr[i].weightA * A + 512) >> 10);
            if (A && T)
                s->decorr[i].weightA -= ((((T ^ A) >> 30) & 2) - 1) * s->decorr[i].delta;
            s->decorr[i].samplesA[j] = T = S;
        pos = (pos + 1) & 7;
        crc = crc * 3 + S;
        if (type == AV_SAMPLE_FMT_FLTP) {
            *dstfl++ = wv_get_value_float(s, &crc_extra_bits, S);
        } else if (type == AV_SAMPLE_FMT_S32P) {
            *dst32++ = wv_get_value_integer(s, &crc_extra_bits, S);
        } else {
            *dst16++ = wv_get_value_integer(s, &crc_extra_bits, S);
        count++;
    } while (!last && count < s->samples);
    wv_reset_saved_context(s);
    if (s->avctx->err_recognition & AV_EF_CRCCHECK) {
        int ret = wv_check_crc(s, crc, crc_extra_bits);
        if (ret < 0 && s->avctx->err_recognition & AV_EF_EXPLODE)
            return ret;
    return 0;


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 int unix_connect_opts(QemuOpts *opts)

+{
+
+    struct sockaddr_un un;
+
+    const char *path = qemu_opt_get(opts, "path");

     int sock;

int unix_connect_opts(QemuOpts *opts)

{

    struct sockaddr_un un;

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

    int sock;

    if (NULL == path) {

        fprintf(stderr, "unix connect: no path specified\n");

        return -1;

    }

    sock = qemu_socket(PF_UNIX, SOCK_STREAM, 0);

    if (sock < 0) {

        perror("socket(unix)");

        return -1;

    }

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

    un.sun_family = AF_UNIX;

    snprintf(un.sun_path, sizeof(un.sun_path), "%s", path);

    if (connect(sock, (struct sockaddr*) &un, sizeof(un)) < 0) {

        fprintf(stderr, "connect(unix:%s): %s\n", path, strerror(errno));

	return -1;

    }

    if (sockets_debug)

        fprintf(stderr, "connect(unix:%s): OK\n", path);

    return sock;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 QBool *qobject_to_qbool(const QObject *obj)
+
 {

     if (qobject_type(obj) != QTYPE_QBOOL)

QBool *qobject_to_qbool(const QObject *obj)

{

    if (qobject_type(obj) != QTYPE_QBOOL)

        return NULL;

    return container_of(obj, QBool, base);

}


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

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

+        if(nnzc[ scan8[i] ])
+
+            ff_h264_idct_add_mmx(dst + block_offset[i], block + i*16, stride);

     }

static void ff_h264_idct_add16_mmx(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++){

        if(nnzc[ scan8[i] ])

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

    }

}


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

     assert(tos && !tos->entry);
+
     if (qiv->strict) {

         GHashTable *const top_ht = tos->h;

static void qobject_input_check_struct(Visitor *v, Error **errp)

{

    QObjectInputVisitor *qiv = to_qiv(v);

    StackObject *tos = QSLIST_FIRST(&qiv->stack);

    assert(tos && !tos->entry);

    if (qiv->strict) {

        GHashTable *const top_ht = tos->h;

        if (top_ht) {

            GHashTableIter iter;

            const char *key;

            g_hash_table_iter_init(&iter, top_ht);

            if (g_hash_table_iter_next(&iter, (void **)&key, NULL)) {

                error_setg(errp, "Parameter '%s' is unexpected", key);

            }

        }

    }

}


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

         ((env->tr.flags >> DESC_TYPE_SHIFT) & 0xf) != 9 ||

+        env->tr.limit < 103) {
+
+        goto fail;
+
+    }

     io_offset = cpu_lduw_kernel(env, env->tr.base + 0x66);

static inline void check_io(CPUX86State *env, int addr, int size)

{

    int io_offset, val, mask;

    /* TSS must be a valid 32 bit one */

    if (!(env->tr.flags & DESC_P_MASK) ||

        ((env->tr.flags >> DESC_TYPE_SHIFT) & 0xf) != 9 ||

        env->tr.limit < 103) {

        goto fail;

    }

    io_offset = cpu_lduw_kernel(env, env->tr.base + 0x66);

    io_offset += (addr >> 3);

    /* Note: the check needs two bytes */

    if ((io_offset + 1) > env->tr.limit) {

        goto fail;

    }

    val = cpu_lduw_kernel(env, env->tr.base + io_offset);

    val >>= (addr & 7);

    mask = (1 << size) - 1;

    /* all bits must be zero to allow the I/O */

    if ((val & mask) != 0) {

    fail:

        raise_exception_err(env, EXCP0D_GPF, 0);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void breakpoint_invalidate(CPUState *env, target_ulong pc)
+
+{
+
     target_ulong phys_addr;

static void breakpoint_invalidate(CPUState *env, target_ulong pc)

{

    target_ulong phys_addr;

    phys_addr = cpu_get_phys_page_debug(env, pc);

    tb_invalidate_phys_page_range(phys_addr, phys_addr + 1, 0);

}


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

 {
+
     NamedGPIOList *ngl, *next;

static void device_finalize(Object *obj)

{

    NamedGPIOList *ngl, *next;

    DeviceState *dev = DEVICE(obj);

    qemu_opts_del(dev->opts);

    QLIST_FOREACH_SAFE(ngl, &dev->gpios, node, next) {

        QLIST_REMOVE(ngl, node);

        qemu_free_irqs(ngl->in, ngl->num_in);

        g_free(ngl->name);

        g_free(ngl);

        /* ngl->out irqs are owned by the other end and should not be freed

         * here

         */

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 target_phys_addr_t cpu_get_phys_page_debug (CPUState *env, target_ulong addr)

+{

     mmu_ctx_t ctx;

target_phys_addr_t cpu_get_phys_page_debug (CPUState *env, target_ulong addr)

{

    mmu_ctx_t ctx;

    if (unlikely(get_physical_address(env, &ctx, addr, 0, ACCESS_INT, 1) != 0))

        return -1;

    return ctx.raddr & TARGET_PAGE_MASK;

}


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

         src = frame_src;

+        frame_ant = *frame_ant_ptr;
+
+    }
+
+

     if (spatial[0])

static void denoise_depth(HQDN3DContext *s,

                          uint8_t *src, uint8_t *dst,

                          uint16_t *line_ant, uint16_t **frame_ant_ptr,

                          int w, int h, int sstride, int dstride,

                          int16_t *spatial, int16_t *temporal, int depth)

{

    // FIXME: For 16bit depth, frame_ant could be a pointer to the previous

    // filtered frame rather than a separate buffer.

    long x, y;

    uint16_t *frame_ant = *frame_ant_ptr;

    if (!frame_ant) {

        uint8_t *frame_src = src;

        *frame_ant_ptr = frame_ant = av_malloc(w*h*sizeof(uint16_t));

        for (y = 0; y < h; y++, src += sstride, frame_ant += w)

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

                frame_ant[x] = LOAD(x);

        src = frame_src;

        frame_ant = *frame_ant_ptr;

    }

    if (spatial[0])

        denoise_spatial(s, src, dst, line_ant, frame_ant,

                        w, h, sstride, dstride, spatial, temporal, depth);

    else

        denoise_temporal(src, dst, frame_ant,

                         w, h, sstride, dstride, temporal, depth);

    emms_c();

}


int qemu_set_fd_handler2(int fd,

                         IOCanReadHandler *fd_read_poll,

                         IOHandler *fd_read,

                         IOHandler *fd_write,

                         void *opaque)

{

    IOHandlerRecord *ioh;

    assert(fd >= 0);

    if (!fd_read && !fd_write) {

        QLIST_FOREACH(ioh, &io_handlers, next) {

            if (ioh->fd == fd) {

                ioh->deleted = 1;

                break;

            }

        }

    } else {

        QLIST_FOREACH(ioh, &io_handlers, next) {

            if (ioh->fd == fd)

                goto found;

        }

        ioh = g_malloc0(sizeof(IOHandlerRecord));

        QLIST_INSERT_HEAD(&io_handlers, ioh, next);

    found:

        ioh->fd = fd;

        ioh->fd_read_poll = fd_read_poll;

        ioh->fd_read = fd_read;

        ioh->fd_write = fd_write;

        ioh->opaque = opaque;

        ioh->pollfds_idx = -1;

        ioh->deleted = 0;

        qemu_notify_event();

    }

    return 0;

}


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

     }

+    x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI);
+
+    enable_compat_apic_id_mode();
+
+    pc_init1(machine, 0, 1);

 }

static void pc_init_isa(MachineState *machine)

{

    has_pci_info = false;

    has_acpi_build = false;

    smbios_defaults = false;

    if (!machine->cpu_model) {

        machine->cpu_model = "486";

    }

    x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI);

    enable_compat_apic_id_mode();

    pc_init1(machine, 0, 1);

}


--- a/source.c
+++ b/source.c
@@ -4,11 +4,11 @@
 {
     VDPAUHWContext *hwctx = avctx->hwaccel_context;
     VDPAUContext *vdctx = avctx->internal->hwaccel_priv_data;
+    VdpDecoderCreate *create;
+    void *func;
+    VdpStatus status;
+    /* See vdpau/vdpau.h for alignment constraints. */
+    uint32_t width  = (avctx->coded_width + 1) & ~1;
     uint32_t height = (avctx->coded_height + 3) & ~3;
     if (hwctx->context.decoder != VDP_INVALID_HANDLE) {
         vdctx->decoder = hwctx->context.decoder;

MAKE_ACCESSORS(AVVDPAUContext, vdpau_hwaccel, AVVDPAU_Render2, render2)
int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile,
                         int level)
{
    VDPAUHWContext *hwctx = avctx->hwaccel_context;
    VDPAUContext *vdctx = avctx->internal->hwaccel_priv_data;
    VdpDecoderCreate *create;
    void *func;
    VdpStatus status;
    /* See vdpau/vdpau.h for alignment constraints. */
    uint32_t width  = (avctx->coded_width + 1) & ~1;
    uint32_t height = (avctx->coded_height + 3) & ~3;
    if (hwctx->context.decoder != VDP_INVALID_HANDLE) {
        vdctx->decoder = hwctx->context.decoder;
        vdctx->render  = hwctx->context.render;
        return 0; /* Decoder created by user */
    vdctx->device           = hwctx->device;
    vdctx->get_proc_address = hwctx->get_proc_address;
    status = vdctx->get_proc_address(vdctx->device, VDP_FUNC_ID_DECODER_CREATE,
                                     &func);
    if (status != VDP_STATUS_OK)
        return vdpau_error(status);
    else
        create = func;
    status = vdctx->get_proc_address(vdctx->device, VDP_FUNC_ID_DECODER_RENDER,
                                     &func);
    if (status != VDP_STATUS_OK)
        return vdpau_error(status);
    else
        vdctx->render = func;
    status = create(vdctx->device, profile, width, height, avctx->refs,
                    &vdctx->decoder);
    return vdpau_error(status);


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void init_2d_vlc_rl(RLTable *rl)

+{
+
     int i;

static void init_2d_vlc_rl(RLTable *rl)

{

    int i;

    init_vlc(&rl->vlc, TEX_VLC_BITS, rl->n + 2,

             &rl->table_vlc[0][1], 4, 2,

             &rl->table_vlc[0][0], 4, 2);

    rl->rl_vlc[0]= av_malloc(rl->vlc.table_size*sizeof(RL_VLC_ELEM));

    for(i=0; i<rl->vlc.table_size; i++){

        int code= rl->vlc.table[i][0];

        int len = rl->vlc.table[i][1];

        int level, run;

        if(len==0){ // illegal code

            run= 65;

            level= MAX_LEVEL;

        }else if(len<0){ //more bits needed

            run= 0;

            level= code;

        }else{

            if(code==rl->n){ //esc

                run= 65;

                level= 0;

            }else if(code==rl->n+1){ //eob

                run= 0;

                level= 127;

            }else{

                run=   rl->table_run  [code] + 1;

                level= rl->table_level[code];

            }

        }

        rl->rl_vlc[0][i].len= len;

        rl->rl_vlc[0][i].level= level;

        rl->rl_vlc[0][i].run= run;

    }

}


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

     p = &first_avcodec;

+    while (*p != NULL) p = &(*p)->next;
+
+    *p = codec;
+
     codec->next = NULL;

 }

void register_avcodec(AVCodec *codec)

{

    AVCodec **p;

    p = &first_avcodec;

    while (*p != NULL) p = &(*p)->next;

    *p = codec;

    codec->next = NULL;

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     int i, idx = 0, sum = 0;

     for (i = N - 1; i >= 0; i--) {
+
         const uint32_t i_s = CELT_PVQ_U(N - i, sum + FFABS(y[i]) + 1);

         idx += CELT_PVQ_U(N - i, sum) + (y[i] < 0)*i_s;

static inline uint32_t celt_icwrsi(uint32_t N, uint32_t K, const int *y)

{

    int i, idx = 0, sum = 0;

    for (i = N - 1; i >= 0; i--) {

        const uint32_t i_s = CELT_PVQ_U(N - i, sum + FFABS(y[i]) + 1);

        idx += CELT_PVQ_U(N - i, sum) + (y[i] < 0)*i_s;

        sum += FFABS(y[i]);

    }

    av_assert0(sum == K);

    return idx;

}


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

     QmpInputVisitor *qiv = to_qiv(v);

static void qmp_input_end_struct(Visitor *v, Error **errp)

{

    QmpInputVisitor *qiv = to_qiv(v);

    qmp_input_pop(qiv, errp);

}


static void svq3_add_idct_c(uint8_t *dst, int16_t *block,

                            int stride, int qp, int dc)

{

    const int qmul = svq3_dequant_coeff[qp];

    int i;

    if (dc) {

        dc       = 13 * 13 * (dc == 1 ? 1538U* block[0]

                                      : qmul * (block[0] >> 3) / 2);

        block[0] = 0;

    }

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

        const int z0 = 13 * (block[0 + 4 * i] +      block[2 + 4 * i]);

        const int z1 = 13 * (block[0 + 4 * i] -      block[2 + 4 * i]);

        const int z2 =  7 *  block[1 + 4 * i] - 17 * block[3 + 4 * i];

        const int z3 = 17 *  block[1 + 4 * i] +  7 * block[3 + 4 * i];

        block[0 + 4 * i] = z0 + z3;

        block[1 + 4 * i] = z1 + z2;

        block[2 + 4 * i] = z1 - z2;

        block[3 + 4 * i] = z0 - z3;

    }

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

        const unsigned z0 = 13 * (block[i + 4 * 0] +      block[i + 4 * 2]);

        const unsigned z1 = 13 * (block[i + 4 * 0] -      block[i + 4 * 2]);

        const unsigned z2 =  7 *  block[i + 4 * 1] - 17 * block[i + 4 * 3];

        const unsigned z3 = 17 *  block[i + 4 * 1] +  7 * block[i + 4 * 3];

        const int rr = (dc + 0x80000);

        dst[i + stride * 0] = av_clip_uint8(dst[i + stride * 0] + ((int)((z0 + z3) * qmul + rr) >> 20));

        dst[i + stride * 1] = av_clip_uint8(dst[i + stride * 1] + ((int)((z1 + z2) * qmul + rr) >> 20));

        dst[i + stride * 2] = av_clip_uint8(dst[i + stride * 2] + ((int)((z1 - z2) * qmul + rr) >> 20));

        dst[i + stride * 3] = av_clip_uint8(dst[i + stride * 3] + ((int)((z0 - z3) * qmul + rr) >> 20));

    }

    memset(block, 0, 16 * sizeof(int16_t));

}


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

+    rs->hist_entry = -1;
+
+    rs->mon = mon;
+
+    rs->completion_finder = completion_finder;

ReadLineState *readline_init(Monitor *mon,

                             ReadLineCompletionFunc *completion_finder)

{

    ReadLineState *rs = g_malloc0(sizeof(*rs));

    rs->hist_entry = -1;

    rs->mon = mon;

    rs->completion_finder = completion_finder;

    return rs;

}


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

+{

     IDEState *s = opaque;

static void cd_read_sector_cb(void *opaque, int ret)

{

    IDEState *s = opaque;

    block_acct_done(blk_get_stats(s->blk), &s->acct);

#ifdef DEBUG_IDE_ATAPI

    printf("cd_read_sector_cb: lba=%d ret=%d\n", s->lba, ret);

#endif

    if (ret < 0) {

        ide_atapi_io_error(s, ret);

        return;

    }

    if (s->cd_sector_size == 2352) {

        cd_data_to_raw(s->io_buffer, s->lba);

    }

    s->lba++;

    s->io_buffer_index = 0;

    s->status &= ~BUSY_STAT;

    ide_atapi_cmd_reply_end(s);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void aarch64_cpu_register(const ARMCPUInfo *info)
+
+{
+
+    TypeInfo type_info = {

         .parent = TYPE_AARCH64_CPU,

static void aarch64_cpu_register(const ARMCPUInfo *info)

{

    TypeInfo type_info = {

        .parent = TYPE_AARCH64_CPU,

        .instance_size = sizeof(ARMCPU),

        .instance_init = info->initfn,

        .class_size = sizeof(ARMCPUClass),

        .class_init = info->class_init,

    };

    /* TODO: drop when we support more CPUs - all entries will have name set */

    if (!info->name) {

        return;

    }

    type_info.name = g_strdup_printf("%s-" TYPE_ARM_CPU, info->name);

    type_register(&type_info);

    g_free((void *)type_info.name);

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+static void nbd_teardown_connection(NbdClientSession *client)

 {
+
+    struct nbd_request request = {
+
+        .type = NBD_CMD_DISC,
+
+        .from = 0,

         .len = 0

static void nbd_teardown_connection(NbdClientSession *client)

{

    struct nbd_request request = {

        .type = NBD_CMD_DISC,

        .from = 0,

        .len = 0

    };

    nbd_send_request(client->sock, &request);

    /* finish any pending coroutines */

    shutdown(client->sock, 2);

    nbd_recv_coroutines_enter_all(client);

    qemu_aio_set_fd_handler(client->sock, NULL, NULL, NULL);

    closesocket(client->sock);

    client->sock = -1;

}


--- a/source.c
+++ b/source.c
@@ -43,11 +43,11 @@
         virtio_blk_init_request(s, virtio_get_queue(vdev, vq_idx), req);

         req->next = s->rq;
+
+        s->rq = req;
+
+    }
+

     return 0;

static int virtio_blk_load_device(VirtIODevice *vdev, QEMUFile *f,

                                  int version_id)

{

    VirtIOBlock *s = VIRTIO_BLK(vdev);

    while (qemu_get_sbyte(f)) {

        unsigned nvqs = s->conf.num_queues;

        unsigned vq_idx = 0;

        VirtIOBlockReq *req;

        if (nvqs > 1) {

            vq_idx = qemu_get_be32(f);

            if (vq_idx >= nvqs) {

                error_report("Invalid virtqueue index in request list: %#x",

                             vq_idx);

                return -EINVAL;

            }

        }

        req = qemu_get_virtqueue_element(f, sizeof(VirtIOBlockReq));

        virtio_blk_init_request(s, virtio_get_queue(vdev, vq_idx), req);

        req->next = s->rq;

        s->rq = req;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static av_cold int truemotion1_decode_init(AVCodecContext *avctx)
+
+{
+
+    TrueMotion1Context *s = avctx->priv_data;

static av_cold int truemotion1_decode_init(AVCodecContext *avctx)

{

    TrueMotion1Context *s = avctx->priv_data;

    s->avctx = avctx;

    // FIXME: it may change ?

//    if (avctx->bits_per_sample == 24)

//        avctx->pix_fmt = AV_PIX_FMT_RGB24;

//    else

//        avctx->pix_fmt = AV_PIX_FMT_RGB555;

    s->frame.data[0] = NULL;

    /* there is a vertical predictor for each pixel in a line; each vertical

     * predictor is 0 to start with */

    av_fast_malloc(&s->vert_pred, &s->vert_pred_size, s->avctx->width * sizeof(unsigned int));

    return 0;

}


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

 {

+    cpu_outb(addr & IOPORTS_MASK, val);
+
 }

static void isa_mmio_writeb (void *opaque, target_phys_addr_t addr,

                                  uint32_t val)

{

    cpu_outb(addr & IOPORTS_MASK, val);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static uint64_t master_abort_mem_read(void *opaque, hwaddr addr, unsigned size)
+
 {

    return -1ULL;

static uint64_t master_abort_mem_read(void *opaque, hwaddr addr, unsigned size)

{

   return -1ULL;

}


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

         return;

+
+
+    if ((*wctx)->writer->uninit)
+
+        (*wctx)->writer->uninit(*wctx);

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

static void writer_close(WriterContext **wctx)

{

    int i;

    if (!*wctx)

        return;

    if ((*wctx)->writer->uninit)

        (*wctx)->writer->uninit(*wctx);

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

        av_bprint_finalize(&(*wctx)->section_pbuf[i], NULL);

    if ((*wctx)->writer->priv_class)

        av_opt_free((*wctx)->priv);

    av_freep(&((*wctx)->priv));

    av_freep(wctx);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void vfio_exitfn(PCIDevice *pdev)

+{

     VFIOPCIDevice *vdev = DO_UPCAST(VFIOPCIDevice, pdev, pdev);

@@ -9,10 +9,10 @@

     vfio_unregister_err_notifier(vdev);
+
+    pci_device_set_intx_routing_notifier(&vdev->pdev, NULL);
+
+    vfio_disable_interrupts(vdev);

     if (vdev->intx.mmap_timer) {

static void vfio_exitfn(PCIDevice *pdev)

{

    VFIOPCIDevice *vdev = DO_UPCAST(VFIOPCIDevice, pdev, pdev);

    VFIOGroup *group = vdev->vbasedev.group;

    vfio_unregister_err_notifier(vdev);

    pci_device_set_intx_routing_notifier(&vdev->pdev, NULL);

    vfio_disable_interrupts(vdev);

    if (vdev->intx.mmap_timer) {

        timer_free(vdev->intx.mmap_timer);

    }

    vfio_teardown_msi(vdev);

    vfio_unmap_bars(vdev);

    g_free(vdev->emulated_config_bits);

    g_free(vdev->rom);

    vfio_put_device(vdev);

    vfio_put_group(group);

}


--- a/source.c
+++ b/source.c
@@ -1,19 +1,19 @@
+static void adb_keyboard_event(DeviceState *dev, QemuConsole *src,
+
+                               InputEvent *evt)
+
+{

     KBDState *s = (KBDState *)dev;
+
     int qcode, keycode;
+

     qcode = qemu_input_key_value_to_qcode(evt->u.key.data->key);

     if (qcode >= ARRAY_SIZE(qcode_to_adb_keycode)) {
+
         return;

     }

static void adb_keyboard_event(DeviceState *dev, QemuConsole *src,

                               InputEvent *evt)

{

    KBDState *s = (KBDState *)dev;

    int qcode, keycode;

    qcode = qemu_input_key_value_to_qcode(evt->u.key.data->key);

    if (qcode >= ARRAY_SIZE(qcode_to_adb_keycode)) {

        return;

    }

    /* FIXME: take handler into account when translating qcode */

    keycode = qcode_to_adb_keycode[qcode];

    if (keycode == NO_KEY) {  /* We don't want to send this to the guest */

        ADB_DPRINTF("Ignoring NO_KEY\n");

        return;

    }

    if (evt->u.key.data->down == false) { /* if key release event */

        keycode = keycode | 0x80;   /* create keyboard break code */

    }

    adb_kbd_put_keycode(s, keycode);

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
 void rgb15tobgr16(const uint8_t *src, uint8_t *dst, long src_size)
+
+{
+
 	long i;
+
+	long num_pixels = src_size >> 1;
+
+
+
+	for(i=0; i<num_pixels; i++)
+
 	{

 	    unsigned b,g,r;

void rgb15tobgr16(const uint8_t *src, uint8_t *dst, long src_size)

{

	long i;

	long num_pixels = src_size >> 1;

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

	{

	    unsigned b,g,r;

	    register uint16_t rgb;

	    rgb = src[2*i];

	    r = rgb&0x1F;

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

	    b = (rgb&0x7C00)>>10;

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

	}

}


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

 {

+    DeviceState *dev = DEVICE(obj);

     Property *prop = opaque;

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

                          const char *name, Error **errp)

{

    DeviceState *dev = DEVICE(obj);

    Property *prop = opaque;

    uint32_t *ptr = qdev_get_prop_ptr(dev, prop);

    unsigned int slot, fn, n;

    Error *local_err = NULL;

    char *str = (char *)"";

    if (dev->state != DEV_STATE_CREATED) {

        error_set(errp, QERR_PERMISSION_DENIED);

        return;

    }

    visit_type_str(v, &str, name, &local_err);

    if (local_err) {

        error_free(local_err);

        return set_int32(obj, v, opaque, name, errp);

    }

    if (sscanf(str, "%x.%x%n", &slot, &fn, &n) != 2) {

        fn = 0;

        if (sscanf(str, "%x%n", &slot, &n) != 1) {

            goto invalid;

        }

    }

    if (str[n] != '\0' || fn > 7 || slot > 31) {

        goto invalid;

    }

    *ptr = slot << 3 | fn;

    return;

invalid:

    error_set_from_qdev_prop_error(errp, EINVAL, dev, prop, str);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int ebml_read_binary(AVIOContext *pb, int length, EbmlBin *bin)

+{

     av_free(bin->data);

static int ebml_read_binary(AVIOContext *pb, int length, EbmlBin *bin)

{

    av_free(bin->data);

    if (!(bin->data = av_malloc(length)))

        return AVERROR(ENOMEM);

    bin->size = length;

    bin->pos  = avio_tell(pb);

    if (avio_read(pb, bin->data, length) != length) {

        av_freep(&bin->data);

        return AVERROR(EIO);

    }

    return 0;

}


static target_ulong helper_udiv_common(CPUSPARCState *env, target_ulong a,

                                       target_ulong b, int cc)

{

    SPARCCPU *cpu = sparc_env_get_cpu(env);

    int overflow = 0;

    uint64_t x0;

    uint32_t x1;

    x0 = (a & 0xffffffff) | ((int64_t) (env->y) << 32);

    x1 = (b & 0xffffffff);

    if (x1 == 0) {

        cpu_restore_state(CPU(cpu), GETPC());

        helper_raise_exception(env, TT_DIV_ZERO);

    }

    x0 = x0 / x1;

    if (x0 > 0xffffffff) {

        x0 = 0xffffffff;

        overflow = 1;

    }

    if (cc) {

        env->cc_dst = x0;

        env->cc_src2 = overflow;

        env->cc_op = CC_OP_DIV;

    }

    return x0;

}


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

+{

     QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;

static uint32_t qvirtio_pci_get_features(QVirtioDevice *d)

{

    QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;

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

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     Aml *var = aml_opcode(0x79 /* ShiftLeftOp */);

     aml_append(var, arg1);
+
+    aml_append(var, count);
+
     build_append_byte(var->buf, 0x00); /* NullNameOp */

     return var;

Aml *aml_shiftleft(Aml *arg1, Aml *count)

{

    Aml *var = aml_opcode(0x79 /* ShiftLeftOp */);

    aml_append(var, arg1);

    aml_append(var, count);

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

    return var;

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
         BlockErrorAction action;

+
+        bdrv_set_dirty_bitmap(s->dirty_bitmap, op->sector_num, op->nb_sectors);
+
+        action = mirror_error_action(s, false, -ret);
+
         if (action == BLOCK_ERROR_ACTION_REPORT && s->ret >= 0) {

             s->ret = ret;

static void mirror_write_complete(void *opaque, int ret)

{

    MirrorOp *op = opaque;

    MirrorBlockJob *s = op->s;

    aio_context_acquire(blk_get_aio_context(s->common.blk));

    if (ret < 0) {

        BlockErrorAction action;

        bdrv_set_dirty_bitmap(s->dirty_bitmap, op->sector_num, op->nb_sectors);

        action = mirror_error_action(s, false, -ret);

        if (action == BLOCK_ERROR_ACTION_REPORT && s->ret >= 0) {

            s->ret = ret;

        }

    }

    mirror_iteration_done(op, ret);

    aio_context_release(blk_get_aio_context(s->common.blk));

}


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

         vdst+= chromStride;

+    }
+
+#if COMPILE_TEMPLATE_MMX
+
+    __asm__(

             EMMS"       \n\t"

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

                                      long width, long height,

                                      long lumStride, long chromStride, long srcStride)

{

    long y;

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

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

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

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

        src += srcStride;

        ydst+= lumStride;

        udst+= chromStride;

        vdst+= chromStride;

    }

#if COMPILE_TEMPLATE_MMX

    __asm__(

            EMMS"       \n\t"

            SFENCE"     \n\t"

            ::: "memory"

        );

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 print_syscall_ret_addr(const struct syscallname *name, abi_long ret)

+{
+
     char *errstr = NULL;
+
+

     if (ret == -1) {

print_syscall_ret_addr(const struct syscallname *name, abi_long ret)

{

    char *errstr = NULL;

    if (ret == -1) {

        errstr = target_strerror(errno);

    }

    if ((ret == -1) && errstr) {

        gemu_log(" = -1 errno=%d (%s)\n", errno, errstr);

    } else {

        gemu_log(" = 0x" TARGET_ABI_FMT_lx "\n", ret);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
+
                                         int jobnr, int threadnr)

 {

static void vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,

                                        int jobnr, int threadnr)

{

    decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, 0);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int oma_read_seek(struct AVFormatContext *s,

+                         int stream_index, int64_t timestamp, int flags)

 {

static int oma_read_seek(struct AVFormatContext *s,

                         int stream_index, int64_t timestamp, int flags)

{

    OMAContext *oc = s->priv_data;

    int err = ff_pcm_read_seek(s, stream_index, timestamp, flags);

    if (!oc->encrypted)

        return err;

    /* readjust IV for CBC */

    if (err || avio_tell(s->pb) < oc->content_start)

        goto wipe;

    if ((err = avio_seek(s->pb, -8, SEEK_CUR)) < 0)

        goto wipe;

    if ((err = avio_read(s->pb, oc->iv, 8)) < 8) {

        if (err >= 0)

            err = AVERROR_EOF;

        goto wipe;

    }

    return 0;

wipe:

    memset(oc->iv, 0, 8);

    return err;

}


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

     sc->chunk_count = entries;
+
+
+
+    if      (atom.type == MKTAG('s','t','c','o'))
+
         for(i=0; i<entries; i++)

             sc->chunk_offsets[i] = get_be32(pb);

static int mov_read_stco(MOVContext *c, ByteIOContext *pb, MOVAtom atom)

{

    AVStream *st = c->fc->streams[c->fc->nb_streams-1];

    MOVStreamContext *sc = st->priv_data;

    unsigned int i, entries;

    get_byte(pb); /* version */

    get_be24(pb); /* flags */

    entries = get_be32(pb);

    if(entries >= UINT_MAX/sizeof(int64_t))

        return -1;

    sc->chunk_offsets = av_malloc(entries * sizeof(int64_t));

    if (!sc->chunk_offsets)

        return AVERROR(ENOMEM);

    sc->chunk_count = entries;

    if      (atom.type == MKTAG('s','t','c','o'))

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

            sc->chunk_offsets[i] = get_be32(pb);

    else if (atom.type == MKTAG('c','o','6','4'))

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

            sc->chunk_offsets[i] = get_be64(pb);

    else

        return -1;

    return 0;

}


void module_call_init(module_init_type type)

{

    ModuleTypeList *l;

    ModuleEntry *e;

    l = find_type(type);

    TAILQ_FOREACH(e, l, node) {

        e->init();

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int vqf_probe(AVProbeData *probe_packet)
 {
+    if (AV_RL32(probe_packet->buf) != MKTAG('T','W','I','N'))
+        return 0;
     if (!memcmp(probe_packet->buf + 4, "97012000", 8))
         return AVPROBE_SCORE_MAX;
     if (!memcmp(probe_packet->buf + 4, "00052200", 8))

static int vqf_probe(AVProbeData *probe_packet)
{
    if (AV_RL32(probe_packet->buf) != MKTAG('T','W','I','N'))
        return 0;
    if (!memcmp(probe_packet->buf + 4, "97012000", 8))
        return AVPROBE_SCORE_MAX;
    if (!memcmp(probe_packet->buf + 4, "00052200", 8))
        return AVPROBE_SCORE_MAX;
    return AVPROBE_SCORE_EXTENSION;
}


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

 {

@@ -11,9 +11,9 @@
     QListEntry *entry;

+
     g_test_message("Obtaining properties of %s", path);
+
     response = qmp("{ 'execute': 'qom-list',"

                    "  'arguments': { 'path': '%s' } }", path);

static void test_properties(const char *path)

{

    char *child_path;

    QDict *response, *tuple;

    QList *list;

    QListEntry *entry;

    g_test_message("Obtaining properties of %s", path);

    response = qmp("{ 'execute': 'qom-list',"

                   "  'arguments': { 'path': '%s' } }", path);

    g_assert(response);

    g_assert(qdict_haskey(response, "return"));

    list = qobject_to_qlist(qdict_get(response, "return"));

    QLIST_FOREACH_ENTRY(list, entry) {

        tuple = qobject_to_qdict(qlist_entry_obj(entry));

        if (strstart(qdict_get_str(tuple, "type"), "child<", NULL)) {

            child_path = g_strdup_printf("%s/%s",

                                         path, qdict_get_str(tuple, "name"));

            test_properties(child_path);

            g_free(child_path);

        } else {

            const char *prop = qdict_get_str(tuple, "name");

            g_test_message("Testing property %s.%s", path, prop);

            response = qmp("{ 'execute': 'qom-get',"

                           "  'arguments': { 'path': '%s',"

                           "                 'property': '%s' } }",

                           path, prop);

            /* qom-get may fail but should not, e.g., segfault. */

            g_assert(response);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void add_sel_entry(IPMIBmcSim *ibs,
+
                           uint8_t *cmd, unsigned int cmd_len,

                           uint8_t *rsp, unsigned int *rsp_len,

static void add_sel_entry(IPMIBmcSim *ibs,

                          uint8_t *cmd, unsigned int cmd_len,

                          uint8_t *rsp, unsigned int *rsp_len,

                          unsigned int max_rsp_len)

{

    IPMI_CHECK_CMD_LEN(18);

    if (sel_add_event(ibs, cmd + 2)) {

        rsp[2] = IPMI_CC_OUT_OF_SPACE;

        return;

    }

    /* sel_add_event fills in the record number. */

    IPMI_ADD_RSP_DATA(cmd[2]);

    IPMI_ADD_RSP_DATA(cmd[3]);

}


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

             prevframe_index += line_inc;

+            prevframe_x = 0;
+
+        }
+
+    }

 }

static inline void xan_wc3_copy_pixel_run(XanContext *s,

    int x, int y, int pixel_count, int motion_x, int motion_y)

{

    int stride;

    int line_inc;

    int curframe_index, prevframe_index;

    int curframe_x, prevframe_x;

    int width = s->avctx->width;

    unsigned char *palette_plane, *prev_palette_plane;

    palette_plane = s->current_frame.data[0];

    prev_palette_plane = s->last_frame.data[0];

    stride = s->current_frame.linesize[0];

    line_inc = stride - width;

    curframe_index = y * stride + x;

    curframe_x = x;

    prevframe_index = (y + motion_y) * stride + x + motion_x;

    prevframe_x = x + motion_x;

    while(pixel_count && (curframe_index < s->frame_size)) {

        int count = FFMIN3(pixel_count, width - curframe_x, width - prevframe_x);

        memcpy(palette_plane + curframe_index, prev_palette_plane + prevframe_index, count);

        pixel_count     -= count;

        curframe_index  += count;

        prevframe_index += count;

        curframe_x      += count;

        prevframe_x     += count;

        if (curframe_x >= width) {

            curframe_index += line_inc;

            curframe_x = 0;

        }

        if (prevframe_x >= width) {

            prevframe_index += line_inc;

            prevframe_x = 0;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int parse_meter(DBEContext *s)
+
+{

     if (s->meter_size)

static int parse_meter(DBEContext *s)

{

    if (s->meter_size)

        skip_input(s, s->key_present + s->meter_size + 1);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -45,11 +45,11 @@
     s->nic = qemu_new_nic(&net_dp83932_info, &s->conf, nd->model, nd->name, s);

+
+    qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a);
+
+    qemu_register_reset(nic_reset, s);
+
     nic_reset(s);

void dp83932_init(NICInfo *nd, target_phys_addr_t base, int it_shift,

                  MemoryRegion *address_space,

                  qemu_irq irq, void* mem_opaque,

                  void (*memory_rw)(void *opaque, target_phys_addr_t addr, uint8_t *buf, int len, int is_write))

{

    dp8393xState *s;

    qemu_check_nic_model(nd, "dp83932");

    s = g_malloc0(sizeof(dp8393xState));

    s->address_space = address_space;

    s->mem_opaque = mem_opaque;

    s->memory_rw = memory_rw;

    s->it_shift = it_shift;

    s->irq = irq;

    s->watchdog = qemu_new_timer_ns(vm_clock, dp8393x_watchdog, s);

    s->regs[SONIC_SR] = 0x0004; /* only revision recognized by Linux */

    s->conf.macaddr = nd->macaddr;

    s->conf.peer = nd->netdev;

    s->nic = qemu_new_nic(&net_dp83932_info, &s->conf, nd->model, nd->name, s);

    qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a);

    qemu_register_reset(nic_reset, s);

    nic_reset(s);

    memory_region_init_io(&s->mmio, &dp8393x_ops, s,

                          "dp8393x", 0x40 << it_shift);

    memory_region_add_subregion(address_space, base, &s->mmio);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+uint16_t qpci_io_readw(QPCIDevice *dev, void *data)
+
+{
+
     uintptr_t addr = (uintptr_t)data;

+

     if (addr < QPCI_PIO_LIMIT) {

uint16_t qpci_io_readw(QPCIDevice *dev, void *data)

{

    uintptr_t addr = (uintptr_t)data;

    if (addr < QPCI_PIO_LIMIT) {

        return dev->bus->pio_readw(dev->bus, addr);

    } else {

        uint16_t val;

        dev->bus->memread(dev->bus, addr, &val, sizeof(val));

        return le16_to_cpu(val);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static QOSState *pci_test_start(int socket)

 {
+
+    const char *cmd = "-netdev socket,fd=%d,id=hs0 -device "
+
                       "virtio-net-pci,netdev=hs0";

static QOSState *pci_test_start(int socket)

{

    const char *cmd = "-netdev socket,fd=%d,id=hs0 -device "

                      "virtio-net-pci,netdev=hs0";

    return qtest_pc_boot(cmd, socket);

}


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

+    /* vram (surfaces, 64bit, bar 4+5) */
+
+    if (qxl->vram_size_mb != -1) {
+
+        qxl->vram_size = qxl->vram_size_mb * 1024 * 1024;

     if (qxl->vram_size < qxl->vram32_size) {

static void qxl_init_ramsize(PCIQXLDevice *qxl)

{

    /* vga mode framebuffer / primary surface (bar 0, first part) */

    if (qxl->vgamem_size_mb < 8) {

        qxl->vgamem_size_mb = 8;

    qxl->vgamem_size = qxl->vgamem_size_mb * 1024 * 1024;

    /* vga ram (bar 0, total) */

    if (qxl->ram_size_mb != -1) {

        qxl->vga.vram_size = qxl->ram_size_mb * 1024 * 1024;

    if (qxl->vga.vram_size < qxl->vgamem_size * 2) {

        qxl->vga.vram_size = qxl->vgamem_size * 2;

    /* vram32 (surfaces, 32bit, bar 1) */

    if (qxl->vram32_size_mb != -1) {

        qxl->vram32_size = qxl->vram32_size_mb * 1024 * 1024;

    if (qxl->vram32_size < 4096) {

        qxl->vram32_size = 4096;

    /* vram (surfaces, 64bit, bar 4+5) */

    if (qxl->vram_size_mb != -1) {

        qxl->vram_size = qxl->vram_size_mb * 1024 * 1024;

    if (qxl->vram_size < qxl->vram32_size) {

        qxl->vram_size = qxl->vram32_size;

    if (qxl->revision == 1) {

        qxl->vram32_size = 4096;

        qxl->vram_size = 4096;

    qxl->vgamem_size = msb_mask(qxl->vgamem_size * 2 - 1);

    qxl->vga.vram_size = msb_mask(qxl->vga.vram_size * 2 - 1);

    qxl->vram32_size = msb_mask(qxl->vram32_size * 2 - 1);

    qxl->vram_size = msb_mask(qxl->vram_size * 2 - 1);


--- a/source.c
+++ b/source.c
@@ -11,7 +11,7 @@
     sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);

+
+    drck->detach(drc, DEVICE(pdev), spapr_phb_remove_pci_device_cb, phb, errp);
+
+}

static void spapr_phb_remove_pci_device(sPAPRDRConnector *drc,

                                        sPAPRPHBState *phb,

                                        PCIDevice *pdev,

                                        Error **errp)

{

    sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);

    drck->detach(drc, DEVICE(pdev), spapr_phb_remove_pci_device_cb, phb, errp);

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
 #if HAVE_ALTIVEC

     if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
+
+        return;
+
+
+
     fdsp->vector_fmul = ff_vector_fmul_altivec;

     fdsp->vector_fmul_add = ff_vector_fmul_add_altivec;

av_cold void ff_float_dsp_init_ppc(AVFloatDSPContext *fdsp, int bit_exact)

{

#if HAVE_ALTIVEC

    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))

        return;

    fdsp->vector_fmul = ff_vector_fmul_altivec;

    fdsp->vector_fmul_add = ff_vector_fmul_add_altivec;

    fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_altivec;

    if (!bit_exact) {

        fdsp->vector_fmul_window = ff_vector_fmul_window_altivec;

    }

#endif

}


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

 	unsigned i;

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

{

	unsigned i;

	unsigned num_pixels = src_size >> 1;

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

	{

	    unsigned b,g,r;

	    register uint16_t rgb;

	    rgb = src[2*i];

	    r = rgb&0x1F;

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

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

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

	}

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 int ff_mpeg_ref_picture(MpegEncContext *s, Picture *dst, Picture *src)

+{
+
+    int ret;
+

     av_assert0(!dst->f.buf[0]);

int ff_mpeg_ref_picture(MpegEncContext *s, Picture *dst, Picture *src)

{

    int ret;

    av_assert0(!dst->f.buf[0]);

    av_assert0(src->f.buf[0]);

    src->tf.f = &src->f;

    dst->tf.f = &dst->f;

    ret = ff_thread_ref_frame(&dst->tf, &src->tf);

    if (ret < 0)

        goto fail;

    ret = update_picture_tables(dst, src);

    if (ret < 0)

        goto fail;

    if (src->hwaccel_picture_private) {

        dst->hwaccel_priv_buf = av_buffer_ref(src->hwaccel_priv_buf);

        if (!dst->hwaccel_priv_buf)

            goto fail;

        dst->hwaccel_picture_private = dst->hwaccel_priv_buf->data;

    }

    dst->field_picture           = src->field_picture;

    dst->mb_var_sum              = src->mb_var_sum;

    dst->mc_mb_var_sum           = src->mc_mb_var_sum;

    dst->b_frame_score           = src->b_frame_score;

    dst->needs_realloc           = src->needs_realloc;

    dst->reference               = src->reference;

    dst->shared                  = src->shared;

    return 0;

fail:

    ff_mpeg_unref_picture(s, dst);

    return ret;

}


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

     kqemu_comm_base = 0xff000000 | 1;

+    qpi_io_memory = cpu_register_io_memory(
+
+                                           qpi_mem_read,
+
                                            qpi_mem_write, NULL);

     cpu_register_physical_memory(kqemu_comm_base & ~0xfff,

static void qpi_init(void)

{

    kqemu_comm_base = 0xff000000 | 1;

    qpi_io_memory = cpu_register_io_memory(

                                           qpi_mem_read,

                                           qpi_mem_write, NULL);

    cpu_register_physical_memory(kqemu_comm_base & ~0xfff,

                                 0x1000, qpi_io_memory);

}


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

     Error *errp = NULL;

+

     if (!filename) {

void hmp_drive_mirror(Monitor *mon, const QDict *qdict)

{

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

    const char *filename = qdict_get_str(qdict, "target");

    const char *format = qdict_get_try_str(qdict, "format");

    int reuse = qdict_get_try_bool(qdict, "reuse", 0);

    int full = qdict_get_try_bool(qdict, "full", 0);

    enum NewImageMode mode;

    Error *errp = NULL;

    if (!filename) {

        error_set(&errp, QERR_MISSING_PARAMETER, "target");

        hmp_handle_error(mon, &errp);

        return;

    }

    if (reuse) {

        mode = NEW_IMAGE_MODE_EXISTING;

    } else {

        mode = NEW_IMAGE_MODE_ABSOLUTE_PATHS;

    }

    qmp_drive_mirror(device, filename, !!format, format,

                     full ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP,

                     true, mode, false, 0, &errp);

    hmp_handle_error(mon, &errp);

}


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

     gen_load_fpr32(t0, fs);

+    gen_store_fpr32(t0, fd);
+
+    gen_set_label(l1);
+
+

     tcg_gen_andi_i32(t0, fpu_fcr31, 1 << get_fp_bit(cc+1));

static inline void gen_movcf_ps(DisasContext *ctx, int fs, int fd,

                                int cc, int tf)

{

    int cond;

    TCGv_i32 t0 = tcg_temp_new_i32();

    int l1 = gen_new_label();

    int l2 = gen_new_label();

    if (tf)

        cond = TCG_COND_EQ;

    else

        cond = TCG_COND_NE;

    tcg_gen_andi_i32(t0, fpu_fcr31, 1 << get_fp_bit(cc));

    tcg_gen_brcondi_i32(cond, t0, 0, l1);

    gen_load_fpr32(t0, fs);

    gen_store_fpr32(t0, fd);

    gen_set_label(l1);

    tcg_gen_andi_i32(t0, fpu_fcr31, 1 << get_fp_bit(cc+1));

    tcg_gen_brcondi_i32(cond, t0, 0, l2);

    gen_load_fpr32h(ctx, t0, fs);

    gen_store_fpr32h(ctx, t0, fd);

    tcg_temp_free_i32(t0);

    gen_set_label(l2);

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
+static uint64_t ppc_hash64_page_shift(ppc_slb_t *slb)
+
+{
+
+    uint64_t epnshift;
+

+
     /* Page size according to the SLB, which we use to generate the
+
      * EPN for hash table lookup..  When we implement more recent MMU

      * extensions this might be different from the actual page size

static uint64_t ppc_hash64_page_shift(ppc_slb_t *slb)

{

    uint64_t epnshift;

    /* Page size according to the SLB, which we use to generate the

     * EPN for hash table lookup..  When we implement more recent MMU

     * extensions this might be different from the actual page size

     * encoded in the PTE */

    if ((slb->vsid & SLB_VSID_LLP_MASK) == SLB_VSID_4K) {

        epnshift = TARGET_PAGE_BITS;

    } else if ((slb->vsid & SLB_VSID_LLP_MASK) == SLB_VSID_64K) {

        epnshift = TARGET_PAGE_BITS_64K;

    } else {

        epnshift = TARGET_PAGE_BITS_16M;

    }

    return epnshift;

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
              if(c->format == AV_SAMPLE_FMT_S16P && (mm_flags&AV_CPU_FLAG_MMX2 )){
                  ret= swri_resample_int16_mmx2 (c, (int16_t*)dst->ch[i], (const int16_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
                  need_emms= 1;
+             } else
+#endif
+             if(c->format == AV_SAMPLE_FMT_S16P) ret= swri_resample_int16(c, (int16_t*)dst->ch[i], (const int16_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
+        else if(c->format == AV_SAMPLE_FMT_S32P) ret= swri_resample_int32(c, (int32_t*)dst->ch[i], (const int32_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
+#if HAVE_AVX_INLINE
         else if(c->format == AV_SAMPLE_FMT_FLTP && (mm_flags&AV_CPU_FLAG_AVX))
                                                  ret= swri_resample_float_avx (c, (float*)dst->ch[i], (const float*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
 #endif

static int multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, AudioData *src, int src_size, int *consumed){
    int i, ret= -1;
    int av_unused mm_flags = av_get_cpu_flags();
    int need_emms= 0;
    if (c->compensation_distance)
        dst_size = FFMIN(dst_size, c->compensation_distance);
    for(i=0; i<dst->ch_count; i++){
#if HAVE_MMXEXT_INLINE
#if HAVE_SSE2_INLINE
             if(c->format == AV_SAMPLE_FMT_S16P && (mm_flags&AV_CPU_FLAG_SSE2)) ret= swri_resample_int16_sse2 (c, (int16_t*)dst->ch[i], (const int16_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
        else
#endif
             if(c->format == AV_SAMPLE_FMT_S16P && (mm_flags&AV_CPU_FLAG_MMX2 )){
                 ret= swri_resample_int16_mmx2 (c, (int16_t*)dst->ch[i], (const int16_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
                 need_emms= 1;
             } else
#endif
             if(c->format == AV_SAMPLE_FMT_S16P) ret= swri_resample_int16(c, (int16_t*)dst->ch[i], (const int16_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
        else if(c->format == AV_SAMPLE_FMT_S32P) ret= swri_resample_int32(c, (int32_t*)dst->ch[i], (const int32_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
#if HAVE_AVX_INLINE
        else if(c->format == AV_SAMPLE_FMT_FLTP && (mm_flags&AV_CPU_FLAG_AVX))
                                                 ret= swri_resample_float_avx (c, (float*)dst->ch[i], (const float*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
#endif
#if HAVE_SSE_INLINE
        else if(c->format == AV_SAMPLE_FMT_FLTP && (mm_flags&AV_CPU_FLAG_SSE))
                                                 ret= swri_resample_float_sse (c, (float*)dst->ch[i], (const float*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
#endif
        else if(c->format == AV_SAMPLE_FMT_FLTP) ret= swri_resample_float(c, (float  *)dst->ch[i], (const float  *)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
#if HAVE_SSE2_INLINE
        else if(c->format == AV_SAMPLE_FMT_DBLP && (mm_flags&AV_CPU_FLAG_SSE2))
                                                 ret= swri_resample_double_sse2(c,(double *)dst->ch[i], (const double *)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
#endif
        else if(c->format == AV_SAMPLE_FMT_DBLP) ret= swri_resample_double(c,(double *)dst->ch[i], (const double *)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
    if(need_emms)
        emms_c();
    return ret;


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 bool virtio_scsi_handle_event_vq(VirtIOSCSI *s, VirtQueue *vq)
+
 {

+    virtio_scsi_acquire(s);

     if (s->events_dropped) {
+
         virtio_scsi_push_event(s, NULL, VIRTIO_SCSI_T_NO_EVENT, 0);

         virtio_scsi_release(s);

bool virtio_scsi_handle_event_vq(VirtIOSCSI *s, VirtQueue *vq)

{

    virtio_scsi_acquire(s);

    if (s->events_dropped) {

        virtio_scsi_push_event(s, NULL, VIRTIO_SCSI_T_NO_EVENT, 0);

        virtio_scsi_release(s);

        return true;

    }

    virtio_scsi_release(s);

    return false;

}


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

     k->init = virtio_serial_init_pci;
+
+    k->exit = virtio_serial_exit_pci;
+
+    k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
+
     k->device_id = PCI_DEVICE_ID_VIRTIO_CONSOLE;

     k->revision = VIRTIO_PCI_ABI_VERSION;

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);

    k->init = virtio_serial_init_pci;

    k->exit = virtio_serial_exit_pci;

    k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;

    k->device_id = PCI_DEVICE_ID_VIRTIO_CONSOLE;

    k->revision = VIRTIO_PCI_ABI_VERSION;

    k->class_id = PCI_CLASS_COMMUNICATION_OTHER;

    dc->alias = "virtio-serial";

    dc->reset = virtio_pci_reset;

    dc->props = virtio_serial_properties;

}


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

 {

+    bool progress = false;

     AioHandler *node;

static bool run_poll_handlers_once(AioContext *ctx)

{

    bool progress = false;

    AioHandler *node;

    QLIST_FOREACH_RCU(node, &ctx->aio_handlers, node) {

        if (!node->deleted && node->io_poll &&

                node->io_poll(node->opaque)) {

            progress = true;

        }

        /* Caller handles freeing deleted nodes.  Don't do it here. */

    }

    return progress;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 void visit_start_alternate(Visitor *v, const char *name,

                            GenericAlternate **obj, size_t size,
+
                            bool promote_int, Error **errp)

 {
+
     Error *err = NULL;

void visit_start_alternate(Visitor *v, const char *name,

                           GenericAlternate **obj, size_t size,

                           bool promote_int, Error **errp)

{

    Error *err = NULL;

    assert(obj && size >= sizeof(GenericAlternate));

    assert(v->type != VISITOR_OUTPUT || *obj);

    if (v->start_alternate) {

        v->start_alternate(v, name, obj, size, promote_int, &err);

    }

    if (v->type == VISITOR_INPUT) {

        assert(v->start_alternate && !err != !*obj);

    }

    error_propagate(errp, err);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+int fw_cfg_add_bytes(FWCfgState *s, uint16_t key, uint8_t *data, uint32_t len)

 {
+
     int arch = !!(key & FW_CFG_ARCH_LOCAL);

+

     key &= FW_CFG_ENTRY_MASK;

int fw_cfg_add_bytes(FWCfgState *s, uint16_t key, uint8_t *data, uint32_t len)

{

    int arch = !!(key & FW_CFG_ARCH_LOCAL);

    key &= FW_CFG_ENTRY_MASK;

    if (key >= FW_CFG_MAX_ENTRY)

        return 0;

    s->entries[arch][key].data = data;

    s->entries[arch][key].len = len;

    return 1;

}


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

                     target_ulong alignment)

+{

     if ((VLAN_BD_ADDR(bd) % alignment)
+
         || (VLAN_BD_LEN(bd) % alignment)) {

         return -1;

static int check_bd(VIOsPAPRVLANDevice *dev, vlan_bd_t bd,

                    target_ulong alignment)

{

    if ((VLAN_BD_ADDR(bd) % alignment)

        || (VLAN_BD_LEN(bd) % alignment)) {

        return -1;

    }

    if (spapr_vio_check_tces(&dev->sdev, VLAN_BD_ADDR(bd),

                             VLAN_BD_LEN(bd), SPAPR_TCE_RW) != 0) {

        return -1;

    }

    return 0;

}


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
@@ -1,12 +1,12 @@
+static void socket_sendf(int fd, const char *fmt, va_list ap)
+
+{
+
+    gchar *str;

     size_t size, offset;

+

     str = g_strdup_vprintf(fmt, ap);

static void socket_sendf(int fd, const char *fmt, va_list ap)

{

    gchar *str;

    size_t size, offset;

    str = g_strdup_vprintf(fmt, ap);

    size = strlen(str);

    offset = 0;

    while (offset < size) {

        ssize_t len;

        len = write(fd, str + offset, size - offset);

        if (len == -1 && errno == EINTR) {

            continue;

        }

        g_assert_no_errno(len);

        g_assert_cmpint(len, >, 0);

        offset += len;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 void helper_done(void)
+
+{
+
+    env->pc = env->tsptr->tpc;
+
+    env->npc = env->tsptr->tnpc + 4;

+    PUT_CCR(env, env->tsptr->tstate >> 32);

     env->asi = (env->tsptr->tstate >> 24) & 0xff;

void helper_done(void)

{

    env->pc = env->tsptr->tpc;

    env->npc = env->tsptr->tnpc + 4;

    PUT_CCR(env, env->tsptr->tstate >> 32);

    env->asi = (env->tsptr->tstate >> 24) & 0xff;

    change_pstate((env->tsptr->tstate >> 8) & 0xf3f);

    PUT_CWP64(env, env->tsptr->tstate & 0xff);

    env->tl--;

    env->tsptr = &env->ts[env->tl & MAXTL_MASK];

}


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

     int i, j;
+
     struct Track *track = tracks->tracks[main];

     for (i = 0; i < track->chunks; i++) {

static void print_track_chunks(FILE *out, struct Tracks *tracks, int main,

                               const char *type)

{

    int i, j;

    struct Track *track = tracks->tracks[main];

    for (i = 0; i < track->chunks; i++) {

        for (j = main + 1; j < tracks->nb_tracks; j++) {

            if (tracks->tracks[j]->is_audio == track->is_audio &&

                track->offsets[i].duration != tracks->tracks[j]->offsets[i].duration)

                fprintf(stderr, "Mismatched duration of %s chunk %d in %s and %s\n",

                        type, i, track->name, tracks->tracks[j]->name);

        }

        fprintf(out, "\t\t<c n=\"%d\" d=\"%d\" />\n",

                i, track->offsets[i].duration);

    }

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                                     uint16List **list, Error **errp)

 {
+
     StringOutputVisitor *ov;

     StringInputVisitor *iv;

void object_property_get_uint16List(Object *obj, const char *name,

                                    uint16List **list, Error **errp)

{

    StringOutputVisitor *ov;

    StringInputVisitor *iv;

    ov = string_output_visitor_new(false);

    object_property_get(obj, string_output_get_visitor(ov),

                        name, errp);

    iv = string_input_visitor_new(string_output_get_string(ov));

    visit_type_uint16List(string_input_get_visitor(iv),

                          list, NULL, errp);

    string_output_visitor_cleanup(ov);

    string_input_visitor_cleanup(iv);

}


--- a/source.c
+++ b/source.c
@@ -57,11 +57,11 @@
     if (ret < 0) {
         goto fail;
     g_free(s->l1_table);
+    old_l1_table_offset = s->l1_table_offset;
+    s->l1_table_offset = new_l1_table_offset;
+    s->l1_table = new_l1_table;
+    old_l1_size = s->l1_size;
+    s->l1_size = new_l1_size;
     qcow2_free_clusters(bs, old_l1_table_offset, old_l1_size * sizeof(uint64_t),
                         QCOW2_DISCARD_OTHER);
     return 0;

int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size,
                        bool exact_size)
{
    BDRVQcowState *s = bs->opaque;
    int new_l1_size2, ret, i;
    uint64_t *new_l1_table;
    int64_t old_l1_table_offset, old_l1_size;
    int64_t new_l1_table_offset, new_l1_size;
    uint8_t data[12];
    if (min_size <= s->l1_size)
        return 0;
    if (exact_size) {
        new_l1_size = min_size;
    } else {
        /* Bump size up to reduce the number of times we have to grow */
        new_l1_size = s->l1_size;
        if (new_l1_size == 0) {
            new_l1_size = 1;
        while (min_size > new_l1_size) {
            new_l1_size = (new_l1_size * 3 + 1) / 2;
    if (new_l1_size > INT_MAX / sizeof(uint64_t)) {
#ifdef DEBUG_ALLOC2
    fprintf(stderr, "grow l1_table from %d to %" PRId64 "\n",
            s->l1_size, new_l1_size);
#endif
    new_l1_size2 = sizeof(uint64_t) * new_l1_size;
    new_l1_table = g_malloc0(align_offset(new_l1_size2, 512));
    memcpy(new_l1_table, s->l1_table, s->l1_size * sizeof(uint64_t));
    /* write new table (align to cluster) */
    BLKDBG_EVENT(bs->file, BLKDBG_L1_GROW_ALLOC_TABLE);
    new_l1_table_offset = qcow2_alloc_clusters(bs, new_l1_size2);
    if (new_l1_table_offset < 0) {
        g_free(new_l1_table);
        return new_l1_table_offset;
    ret = qcow2_cache_flush(bs, s->refcount_block_cache);
    if (ret < 0) {
        goto fail;
    /* the L1 position has not yet been updated, so these clusters must
     * indeed be completely free */
    ret = qcow2_pre_write_overlap_check(bs, 0, new_l1_table_offset,
                                        new_l1_size2);
    if (ret < 0) {
        goto fail;
    BLKDBG_EVENT(bs->file, BLKDBG_L1_GROW_WRITE_TABLE);
    for(i = 0; i < s->l1_size; i++)
        new_l1_table[i] = cpu_to_be64(new_l1_table[i]);
    ret = bdrv_pwrite_sync(bs->file, new_l1_table_offset, new_l1_table, new_l1_size2);
    if (ret < 0)
        goto fail;
    for(i = 0; i < s->l1_size; i++)
        new_l1_table[i] = be64_to_cpu(new_l1_table[i]);
    /* set new table */
    BLKDBG_EVENT(bs->file, BLKDBG_L1_GROW_ACTIVATE_TABLE);
    cpu_to_be32w((uint32_t*)data, new_l1_size);
    stq_be_p(data + 4, new_l1_table_offset);
    ret = bdrv_pwrite_sync(bs->file, offsetof(QCowHeader, l1_size), data,sizeof(data));
    if (ret < 0) {
        goto fail;
    g_free(s->l1_table);
    old_l1_table_offset = s->l1_table_offset;
    s->l1_table_offset = new_l1_table_offset;
    s->l1_table = new_l1_table;
    old_l1_size = s->l1_size;
    s->l1_size = new_l1_size;
    qcow2_free_clusters(bs, old_l1_table_offset, old_l1_size * sizeof(uint64_t),
                        QCOW2_DISCARD_OTHER);
    return 0;
 fail:
    g_free(new_l1_table);
    qcow2_free_clusters(bs, new_l1_table_offset, new_l1_size2,
                        QCOW2_DISCARD_OTHER);
    return ret;


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static inline void range_dec_normalize(APEContext *ctx)

 {
+
+    while (ctx->rc.range <= BOTTOM_VALUE) {

         ctx->rc.buffer <<= 8;

static inline void range_dec_normalize(APEContext *ctx)

{

    while (ctx->rc.range <= BOTTOM_VALUE) {

        ctx->rc.buffer <<= 8;

        if(ctx->ptr < ctx->data_end)

            ctx->rc.buffer += *ctx->ptr;

        ctx->ptr++;

        ctx->rc.low    = (ctx->rc.low << 8)    | ((ctx->rc.buffer >> 1) & 0xFF);

        ctx->rc.range  <<= 8;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
+void qemu_del_vlan_client(VLANClientState *vc)

 {

+    if (vc->vlan) {
+
         QTAILQ_REMOVE(&vc->vlan->clients, vc, next);

+    } else {
+
         if (vc->send_queue) {

             qemu_del_net_queue(vc->send_queue);

void qemu_del_vlan_client(VLANClientState *vc)

{

    if (vc->vlan) {

        QTAILQ_REMOVE(&vc->vlan->clients, vc, next);

    } else {

        if (vc->send_queue) {

            qemu_del_net_queue(vc->send_queue);

        }

        QTAILQ_REMOVE(&non_vlan_clients, vc, next);

        if (vc->peer) {

            vc->peer->peer = NULL;

        }

    }

    if (vc->info->cleanup) {

        vc->info->cleanup(vc);

    }

    qemu_free(vc->name);

    qemu_free(vc->model);

    qemu_free(vc);

}


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

 {

+    VirtIOBlockReq *req = opaque;
+
+
+
+    trace_virtio_blk_rw_complete(req, ret);

static void virtio_blk_rw_complete(void *opaque, int ret)

{

    VirtIOBlockReq *req = opaque;

    trace_virtio_blk_rw_complete(req, ret);

    if (ret) {

        int p = virtio_ldl_p(VIRTIO_DEVICE(req->dev), &req->out.type);

        bool is_read = !(p & VIRTIO_BLK_T_OUT);

        if (virtio_blk_handle_rw_error(req, -ret, is_read))

            return;

    }

    virtio_blk_req_complete(req, VIRTIO_BLK_S_OK);

    block_acct_done(bdrv_get_stats(req->dev->bs), &req->acct);

    virtio_blk_free_request(req);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void omap_badwidth_write16(void *opaque, target_phys_addr_t addr,
+
+                uint32_t value)
+
 {

     uint16_t val16 = value;

void omap_badwidth_write16(void *opaque, target_phys_addr_t addr,

                uint32_t value)

{

    uint16_t val16 = value;

    OMAP_16B_REG(addr);

    cpu_physical_memory_write(addr, (void *) &val16, 2);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+av_cold void ff_schro_queue_init(FFSchroQueue *queue)
+
+{

     queue->p_head = queue->p_tail = NULL;

av_cold void ff_schro_queue_init(FFSchroQueue *queue)

{

    queue->p_head = queue->p_tail = NULL;

    queue->size = 0;

}


--- a/source.c
+++ b/source.c
@@ -1,1 +1,1 @@
+static void null_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) { }


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static int nbd_co_send_reply(NBDRequest *req, struct nbd_reply *reply,

                              int len)
+
 {

     NBDClient *client = req->client;

static int nbd_co_send_reply(NBDRequest *req, struct nbd_reply *reply,

                             int len)

{

    NBDClient *client = req->client;

    int csock = client->sock;

    int rc, ret;

    qemu_co_mutex_lock(&client->send_lock);

    qemu_set_fd_handler2(csock, nbd_can_read, nbd_read,

                         nbd_restart_write, client);

    client->send_coroutine = qemu_coroutine_self();

    if (!len) {

        rc = nbd_send_reply(csock, reply);

        if (rc == -1) {

            rc = -errno;

        }

    } else {

        socket_set_cork(csock, 1);

        rc = nbd_send_reply(csock, reply);

        if (rc != -1) {

            ret = qemu_co_send(csock, req->data, len);

            if (ret != len) {

                errno = EIO;

                rc = -1;

            }

        }

        if (rc == -1) {

            rc = -errno;

        }

        socket_set_cork(csock, 0);

    }

    client->send_coroutine = NULL;

    qemu_set_fd_handler2(csock, nbd_can_read, nbd_read, NULL, client);

    qemu_co_mutex_unlock(&client->send_lock);

    return rc;

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     int frame_size = 1 << (venc->log2_blocksize[1] - 1);

     int subframes = frame_size / sf_size;
+
+
+
+    for (int sf = 0; sf < subframes; sf++) {
+
         cur = ff_bufqueue_get(&venc->bufqueue);

         *samples += cur->nb_samples;

static void move_audio(vorbis_enc_context *venc, float *audio, int *samples, int sf_size)

{

    AVFrame *cur = NULL;

    int frame_size = 1 << (venc->log2_blocksize[1] - 1);

    int subframes = frame_size / sf_size;

    for (int sf = 0; sf < subframes; sf++) {

        cur = ff_bufqueue_get(&venc->bufqueue);

        *samples += cur->nb_samples;

        for (int ch = 0; ch < venc->channels; ch++) {

            const float *input = (float *) cur->extended_data[ch];

            const size_t len  = cur->nb_samples * sizeof(float);

            memcpy(audio + ch*frame_size + sf*sf_size, input, len);

        }

        av_frame_free(&cur);

    }

}


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

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

uint64_t hbitmap_serialization_granularity(const HBitmap *hb)

{

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

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

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

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

     * hosts. */

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

}


--- a/source.c
+++ b/source.c
@@ -5,8 +5,8 @@
     int compno, ret;
     if ((ret = get_qcx(s, n, &tmp)) < 0)
         return ret;
+    for (compno = 0; compno < s->ncomponents; compno++)
+        if (!(properties[compno] & HAD_QCC))
+            memcpy(q + compno, &tmp, sizeof(tmp));
     return 0;
 }

static int get_qcd(Jpeg2000DecoderContext *s, int n, Jpeg2000QuantStyle *q,
                   uint8_t *properties)
{
    Jpeg2000QuantStyle tmp;
    int compno, ret;
    if ((ret = get_qcx(s, n, &tmp)) < 0)
        return ret;
    for (compno = 0; compno < s->ncomponents; compno++)
        if (!(properties[compno] & HAD_QCC))
            memcpy(q + compno, &tmp, sizeof(tmp));
    return 0;
}


--- 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
@@ -7,11 +7,11 @@
     VirtIOBlock *s = VIRTIO_BLK(dev);

+
+    remove_migration_state_change_notifier(&s->migration_state_notifier);
+
+    virtio_blk_data_plane_destroy(s->dataplane);
+
     s->dataplane = NULL;

     qemu_del_vm_change_state_handler(s->change);

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

{

    VirtIODevice *vdev = VIRTIO_DEVICE(dev);

    VirtIOBlock *s = VIRTIO_BLK(dev);

    remove_migration_state_change_notifier(&s->migration_state_notifier);

    virtio_blk_data_plane_destroy(s->dataplane);

    s->dataplane = NULL;

    qemu_del_vm_change_state_handler(s->change);

    unregister_savevm(dev, "virtio-blk", s);

    blockdev_mark_auto_del(s->bs);

    virtio_cleanup(vdev);

}


--- a/source.c
+++ b/source.c
@@ -4,11 +4,11 @@
     dev_st = get_boot_device(0);
     if (dev_st) {
         VirtioCcwDevice *virtio_ccw_dev = (VirtioCcwDevice *)
+            object_dynamic_cast(OBJECT(qdev_get_parent_bus(dev_st)->parent),
+                TYPE_VIRTIO_CCW_DEVICE);
+        SCSIDevice *sd = (SCSIDevice *) object_dynamic_cast(OBJECT(dev_st),
+                                                            TYPE_SCSI_DEVICE);
+        if (virtio_ccw_dev) {
             CcwDevice *ccw_dev = CCW_DEVICE(virtio_ccw_dev);
             ipl->iplb.len = cpu_to_be32(S390_IPLB_MIN_CCW_LEN);
             ipl->iplb.blk0_len =

static bool s390_gen_initial_iplb(S390IPLState *ipl)
{
    DeviceState *dev_st;
    dev_st = get_boot_device(0);
    if (dev_st) {
        VirtioCcwDevice *virtio_ccw_dev = (VirtioCcwDevice *)
            object_dynamic_cast(OBJECT(qdev_get_parent_bus(dev_st)->parent),
                TYPE_VIRTIO_CCW_DEVICE);
        SCSIDevice *sd = (SCSIDevice *) object_dynamic_cast(OBJECT(dev_st),
                                                            TYPE_SCSI_DEVICE);
        if (virtio_ccw_dev) {
            CcwDevice *ccw_dev = CCW_DEVICE(virtio_ccw_dev);
            ipl->iplb.len = cpu_to_be32(S390_IPLB_MIN_CCW_LEN);
            ipl->iplb.blk0_len =
                cpu_to_be32(S390_IPLB_MIN_CCW_LEN - S390_IPLB_HEADER_LEN);
            ipl->iplb.pbt = S390_IPL_TYPE_CCW;
            ipl->iplb.ccw.devno = cpu_to_be16(ccw_dev->sch->devno);
            ipl->iplb.ccw.ssid = ccw_dev->sch->ssid & 3;
            return true;
        } else if (sd) {
            SCSIBus *bus = scsi_bus_from_device(sd);
            VirtIOSCSI *vdev = container_of(bus, VirtIOSCSI, bus);
            VirtIOSCSICcw *scsi_ccw = container_of(vdev, VirtIOSCSICcw, vdev);
            CcwDevice *ccw_dev = CCW_DEVICE(scsi_ccw);
            ipl->iplb.len = cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN);
            ipl->iplb.blk0_len =
                cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN - S390_IPLB_HEADER_LEN);
            ipl->iplb.pbt = S390_IPL_TYPE_QEMU_SCSI;
            ipl->iplb.scsi.lun = cpu_to_be32(sd->lun);
            ipl->iplb.scsi.target = cpu_to_be16(sd->id);
            ipl->iplb.scsi.channel = cpu_to_be16(sd->channel);
            ipl->iplb.scsi.devno = cpu_to_be16(ccw_dev->sch->devno);
            ipl->iplb.scsi.ssid = ccw_dev->sch->ssid & 3;
            return true;
    return false;


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     CPUState *cpu;

     TaskState *ts;
+

     rcu_register_thread();

static void *clone_func(void *arg)

{

    new_thread_info *info = arg;

    CPUArchState *env;

    CPUState *cpu;

    TaskState *ts;

    rcu_register_thread();

    env = info->env;

    cpu = ENV_GET_CPU(env);

    thread_cpu = cpu;

    ts = (TaskState *)cpu->opaque;

    info->tid = gettid();

    cpu->host_tid = info->tid;

    task_settid(ts);

    if (info->child_tidptr)

        put_user_u32(info->tid, info->child_tidptr);

    if (info->parent_tidptr)

        put_user_u32(info->tid, info->parent_tidptr);

    /* Enable signals.  */

    sigprocmask(SIG_SETMASK, &info->sigmask, NULL);

    /* Signal to the parent that we're ready.  */

    pthread_mutex_lock(&info->mutex);

    pthread_cond_broadcast(&info->cond);

    pthread_mutex_unlock(&info->mutex);

    /* Wait until the parent has finshed initializing the tls state.  */

    pthread_mutex_lock(&clone_lock);

    pthread_mutex_unlock(&clone_lock);

    cpu_loop(env);

    /* never exits */

    return NULL;

}