--- a/source.c
+++ b/source.c
@@ -49,11 +49,11 @@
         g_free(blk->buf);

         g_free(blk);
+
+
+
+        block_mig_state.read_done--;
+
         block_mig_state.transferred++;

         assert(block_mig_state.read_done >= 0);

static int flush_blks(QEMUFile *f)

{

    BlkMigBlock *blk;

    int ret = 0;

    DPRINTF("%s Enter submitted %d read_done %d transferred %d\n",

            __FUNCTION__, block_mig_state.submitted, block_mig_state.read_done,

            block_mig_state.transferred);

    blk_mig_lock();

    while ((blk = QSIMPLEQ_FIRST(&block_mig_state.blk_list)) != NULL) {

        if (qemu_file_rate_limit(f)) {

            break;

        }

        if (blk->ret < 0) {

            ret = blk->ret;

            break;

        }

        QSIMPLEQ_REMOVE_HEAD(&block_mig_state.blk_list, entry);

        blk_mig_unlock();

        blk_send(f, blk);

        blk_mig_lock();

        g_free(blk->buf);

        g_free(blk);

        block_mig_state.read_done--;

        block_mig_state.transferred++;

        assert(block_mig_state.read_done >= 0);

    }

    blk_mig_unlock();

    DPRINTF("%s Exit submitted %d read_done %d transferred %d\n", __FUNCTION__,

            block_mig_state.submitted, block_mig_state.read_done,

            block_mig_state.transferred);

    return ret;

}


static void vscsi_send_request_sense(VSCSIState *s, vscsi_req *req)

{

    SCSIDevice *sdev = req->sdev;

    uint8_t *cdb = req->iu.srp.cmd.cdb;

    int n;

    cdb[0] = 3;

    cdb[1] = 0;

    cdb[2] = 0;

    cdb[3] = 0;

    cdb[4] = 96;

    cdb[5] = 0;

    req->sensing = 1;

    n = sdev->info->send_command(sdev, req->qtag, cdb, req->lun);

    dprintf("VSCSI: Queued request sense tag 0x%x\n", req->qtag);

    if (n < 0) {

        fprintf(stderr, "VSCSI: REQUEST_SENSE wants write data !?!?!?\n");

        sdev->info->cancel_io(sdev, req->qtag);

        vscsi_makeup_sense(s, req, HARDWARE_ERROR, 0, 0);

        vscsi_send_rsp(s, req, CHECK_CONDITION, 0, 0);

        vscsi_put_req(s, req);

        return;

    } else if (n == 0) {

        return;

    }

    sdev->info->read_data(sdev, req->qtag);

}


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

   return cpu_single_env->cpu_index;

static int get_current_cpu(void)

{

  return cpu_single_env->cpu_index;

}


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

+        if (glyph->bitmap.pixel_mode != FT_PIXEL_MODE_MONO &&
+
+            glyph->bitmap.pixel_mode != FT_PIXEL_MODE_GRAY)
+
+            return AVERROR(EINVAL);

static int draw_glyphs(DrawTextContext *s, AVFrame *frame,

                       int width, int height,

                       const uint8_t rgbcolor[4], const uint8_t yuvcolor[4],

                       int x, int y)

{

    char *text = HAVE_LOCALTIME_R ? s->expanded_text : s->text;

    uint32_t code = 0;

    int i;

    uint8_t *p;

    Glyph *glyph = NULL;

    for (i = 0, p = text; *p; i++) {

        Glyph dummy = { 0 };

        GET_UTF8(code, *p++, continue;);

        /* skip new line chars, just go to new line */

        if (code == '\n' || code == '\r' || code == '\t')

            continue;

        dummy.code = code;

        glyph = av_tree_find(s->glyphs, &dummy, (void *)glyph_cmp, NULL);

        if (glyph->bitmap.pixel_mode != FT_PIXEL_MODE_MONO &&

            glyph->bitmap.pixel_mode != FT_PIXEL_MODE_GRAY)

            return AVERROR(EINVAL);

        if (s->is_packed_rgb) {

            draw_glyph_rgb(frame, &glyph->bitmap,

                           s->positions[i].x+x, s->positions[i].y+y, width, height,

                           s->pixel_step[0], rgbcolor, s->rgba_map, s->alpha);

        } else {

            draw_glyph_yuv(frame, &glyph->bitmap,

                           s->positions[i].x+x, s->positions[i].y+y, width, height,

                           yuvcolor, s->hsub, s->vsub, s->alpha);

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static inline void test_server_connect(TestServer *server)
+
 {

     test_server_create_chr(server, ",reconnect=1");

static inline void test_server_connect(TestServer *server)

{

    test_server_create_chr(server, ",reconnect=1");

}


--- a/source.c
+++ b/source.c
@@ -27,11 +27,11 @@
                 ipts_min = ipts;

                 file_index = ist->file_index;
+
+            }
+
+        }
+
     }

static int select_input_file(uint8_t *no_packet)

{

    int64_t ipts_min = INT64_MAX;

    int i, file_index = -1;

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

        InputStream *ist = input_streams[i];

        int64_t ipts     = ist->pts;

        if (ist->discard || no_packet[ist->file_index])

            continue;

        if (!input_files[ist->file_index]->eof_reached) {

            if (ipts < ipts_min) {

                ipts_min = ipts;

                file_index = ist->file_index;

            }

        }

    }

    return file_index;

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     const gchar *class, *desc;

+
     ret = qmp_fd(fixture->fd, "{'execute': 'guest-ping', "

                  "'arguments': {'foo': 42 }}");

static void test_qga_invalid_args(gconstpointer fix)

{

    const TestFixture *fixture = fix;

    QDict *ret, *error;

    const gchar *class, *desc;

    ret = qmp_fd(fixture->fd, "{'execute': 'guest-ping', "

                 "'arguments': {'foo': 42 }}");

    g_assert_nonnull(ret);

    error = qdict_get_qdict(ret, "error");

    class = qdict_get_try_str(error, "class");

    desc = qdict_get_try_str(error, "desc");

    g_assert_cmpstr(class, ==, "GenericError");

    g_assert_cmpstr(desc, ==, "QMP input object member 'foo' is unexpected");

    QDECREF(ret);

}


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

         VNC_DEBUG("Start TLS VeNCrypt handshake process\n");
+
+        if (vnc_start_vencrypt_handshake(vs) < 0) {
+
+            VNC_DEBUG("Failed to start TLS handshake\n");
+
             return 0;

         }

static int protocol_client_vencrypt_auth(VncState *vs, uint8_t *data, size_t len)

{

    int auth = read_u32(data, 0);

    if (auth != vs->vd->subauth) {

        VNC_DEBUG("Rejecting auth %d\n", auth);

        vnc_write_u8(vs, 0); /* Reject auth */

        vnc_flush(vs);

        vnc_client_error(vs);

    } else {

        VNC_DEBUG("Accepting auth %d, setting up TLS for handshake\n", auth);

        vnc_write_u8(vs, 1); /* Accept auth */

        vnc_flush(vs);

        if (vnc_tls_client_setup(vs, NEED_X509_AUTH(vs)) < 0) {

            VNC_DEBUG("Failed to setup TLS\n");

            return 0;

        }

        VNC_DEBUG("Start TLS VeNCrypt handshake process\n");

        if (vnc_start_vencrypt_handshake(vs) < 0) {

            VNC_DEBUG("Failed to start TLS handshake\n");

            return 0;

        }

    }

    return 0;

}


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

+    if (l->has_value) {
+
+        tcg_out_goto(s, cond, l->u.value_ptr);
+
+    } else {

         tcg_out_reloc(s, s->code_ptr, R_ARM_PC24, label_index, 0);

static inline void tcg_out_goto_label(TCGContext *s, int cond, int label_index)

{

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

    if (l->has_value) {

        tcg_out_goto(s, cond, l->u.value_ptr);

    } else {

        tcg_out_reloc(s, s->code_ptr, R_ARM_PC24, label_index, 0);

        tcg_out_b_noaddr(s, cond);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int get_riff(AVFormatContext *s, AVIOContext *pb)

+{

     AVIContext *avi = s->priv_data;

static int get_riff(AVFormatContext *s, AVIOContext *pb)

{

    AVIContext *avi = s->priv_data;

    char header[8];

    int i;

    /* check RIFF header */

    avio_read(pb, header, 4);

    avi->riff_end  = avio_rl32(pb); /* RIFF chunk size */

    avi->riff_end += avio_tell(pb); /* RIFF chunk end */

    avio_read(pb, header + 4, 4);

    for (i = 0; avi_headers[i][0]; i++)

        if (!memcmp(header, avi_headers[i], 8))

            break;

    if (!avi_headers[i][0])

        return AVERROR_INVALIDDATA;

    if (header[7] == 0x19)

        av_log(s, AV_LOG_INFO,

               "This file has been generated by a totally broken muxer.\n");

    return 0;

}


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

 	size_t envname_len;

+
+
+	if ((envlist == NULL) || (env == NULL))
+
+		return (EINVAL);

envlist_unsetenv(envlist_t *envlist, const char *env)

{

	struct envlist_entry *entry;

	size_t envname_len;

	if ((envlist == NULL) || (env == NULL))

		return (EINVAL);

	/* env is not allowed to contain '=' */

	if (strchr(env, '=') != NULL)

		return (EINVAL);

	/*

	 * Find out the requested entry and remove

	 * it from the list.

	 */

	envname_len = strlen(env);

	for (entry = envlist->el_entries.lh_first; entry != NULL;

	    entry = entry->ev_link.le_next) {

		if (strncmp(entry->ev_var, env, envname_len) == 0)

			break;

	}

	if (entry != NULL) {

		LIST_REMOVE(entry, ev_link);

		free((char *)entry->ev_var);

		free(entry);

		envlist->el_count--;

	}

	return (0);

}


--- a/source.c
+++ b/source.c
@@ -45,11 +45,11 @@
             ff_h264dsp_init(&h->h264dsp, h->sps.bit_depth_luma,

                             h->sps.chroma_format_idc);
+
+            ff_h264chroma_init(&h->h264chroma, h->sps.bit_depth_chroma);
+
+            ff_h264qpel_init(&h->h264qpel, h->sps.bit_depth_luma);
+
             ff_h264_pred_init(&h->hpc, h->avctx->codec_id, h->sps.bit_depth_luma,

                               h->sps.chroma_format_idc);

int ff_h264_set_parameter_from_sps(H264Context *h)

{

    if (h->flags & CODEC_FLAG_LOW_DELAY ||

        (h->sps.bitstream_restriction_flag &&

         !h->sps.num_reorder_frames)) {

        if (h->avctx->has_b_frames > 1 || h->delayed_pic[0])

            av_log(h->avctx, AV_LOG_WARNING, "Delayed frames seen. "

                   "Reenabling low delay requires a codec flush.\n");

        else

            h->low_delay = 1;

    }

    if (h->avctx->has_b_frames < 2)

        h->avctx->has_b_frames = !h->low_delay;

    if (h->avctx->bits_per_raw_sample != h->sps.bit_depth_luma ||

        h->cur_chroma_format_idc      != h->sps.chroma_format_idc) {

        if (h->sps.bit_depth_luma >= 8 && h->sps.bit_depth_luma <= 10) {

            h->avctx->bits_per_raw_sample = h->sps.bit_depth_luma;

            h->cur_chroma_format_idc      = h->sps.chroma_format_idc;

            h->pixel_shift                = h->sps.bit_depth_luma > 8;

            ff_h264dsp_init(&h->h264dsp, h->sps.bit_depth_luma,

                            h->sps.chroma_format_idc);

            ff_h264chroma_init(&h->h264chroma, h->sps.bit_depth_chroma);

            ff_h264qpel_init(&h->h264qpel, h->sps.bit_depth_luma);

            ff_h264_pred_init(&h->hpc, h->avctx->codec_id, h->sps.bit_depth_luma,

                              h->sps.chroma_format_idc);

            if (CONFIG_ERROR_RESILIENCE)

                ff_me_cmp_init(&h->mecc, h->avctx);

            ff_videodsp_init(&h->vdsp, h->sps.bit_depth_luma);

        } else {

            av_log(h->avctx, AV_LOG_ERROR, "Unsupported bit depth %d\n",

                   h->sps.bit_depth_luma);

            return AVERROR_INVALIDDATA;

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+int pt_setxattr(FsContext *ctx, const char *path, const char *name, void *value,
+
+                size_t size, int flags)
+
+{
+
+    char *buffer;

     int ret;

int pt_setxattr(FsContext *ctx, const char *path, const char *name, void *value,

                size_t size, int flags)

{

    char *buffer;

    int ret;

    buffer = rpath(ctx, path);

    ret = lsetxattr(buffer, name, value, size, flags);

    g_free(buffer);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -21,9 +21,9 @@
 	tcg_gen_and_tl(t0, t0, d);

 	tcg_gen_xor_tl(d, d, t0);
+
+	tcg_temp_free(t0);
+
+	tcg_temp_free(t_31);
+
 }

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

{

	TCGv t0, t_31;

	t0 = tcg_temp_new(TCG_TYPE_TL);

	t_31 = tcg_const_tl(31);

	tcg_gen_shl_tl(d, a, b);

	tcg_gen_sub_tl(t0, t_31, b);

	tcg_gen_sar_tl(t0, t0, t_31);

	tcg_gen_and_tl(t0, t0, d);

	tcg_gen_xor_tl(d, d, t0);

	tcg_temp_free(t0);

	tcg_temp_free(t_31);

}


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

     v = float64_to_int64((a + v) STATUS_VAR);

+
+
+    return v - INT64_MIN;
+
 }

uint64_t float64_to_uint64 (float64 a STATUS_PARAM)

{

    int64_t v;

    v = int64_to_float64(INT64_MIN STATUS_VAR);

    v = float64_to_int64((a + v) STATUS_VAR);

    return v - INT64_MIN;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void store_booke_tsr (CPUState *env, target_ulong val)
+
+{
+
     LOG_TB("%s: val " TARGET_FMT_lx "\n", __func__, val);

     env->spr[SPR_40x_TSR] &= ~(val & 0xFC000000);

void store_booke_tsr (CPUState *env, target_ulong val)

{

    LOG_TB("%s: val " TARGET_FMT_lx "\n", __func__, val);

    env->spr[SPR_40x_TSR] &= ~(val & 0xFC000000);

    if (val & 0x80000000)

        ppc_set_irq(env, PPC_INTERRUPT_PIT, 0);

}


--- a/source.c
+++ b/source.c
@@ -43,11 +43,11 @@
             /* it don't have a valid subsection name */

             return 0;
+
+        }
+
+        sub_vmsd = vmstate_get_subsection(vmsd->subsections, idstr);
+
         if (sub_vmsd == NULL) {

             return -ENOENT;

static int vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd,

                                   void *opaque)

{

    while (qemu_peek_byte(f, 0) == QEMU_VM_SUBSECTION) {

        char idstr[256];

        int ret;

        uint8_t version_id, len, size;

        const VMStateDescription *sub_vmsd;

        len = qemu_peek_byte(f, 1);

        if (len < strlen(vmsd->name) + 1) {

            /* subsection name has be be "section_name/a" */

            return 0;

        }

        size = qemu_peek_buffer(f, (uint8_t *)idstr, len, 2);

        if (size != len) {

            return 0;

        }

        idstr[size] = 0;

        if (strncmp(vmsd->name, idstr, strlen(vmsd->name)) != 0) {

            /* it don't have a valid subsection name */

            return 0;

        }

        sub_vmsd = vmstate_get_subsection(vmsd->subsections, idstr);

        if (sub_vmsd == NULL) {

            return -ENOENT;

        }

        qemu_file_skip(f, 1); /* subsection */

        qemu_file_skip(f, 1); /* len */

        qemu_file_skip(f, len); /* idstr */

        version_id = qemu_get_be32(f);

        ret = vmstate_load_state(f, sub_vmsd, opaque, version_id);

        if (ret) {

            return ret;

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 float128 float128_scalbn( float128 a, int n STATUS_PARAM )

+{

     flag aSign;

float128 float128_scalbn( float128 a, int n STATUS_PARAM )

{

    flag aSign;

    int32 aExp;

    uint64_t aSig0, aSig1;

    aSig1 = extractFloat128Frac1( a );

    aSig0 = extractFloat128Frac0( a );

    aExp = extractFloat128Exp( a );

    aSign = extractFloat128Sign( a );

    if ( aExp == 0x7FFF ) {

        return a;

    }

    if ( aExp != 0 )

        aSig0 |= LIT64( 0x0001000000000000 );

    else if ( aSig0 == 0 && aSig1 == 0 )

        return a;

    aExp += n - 1;

    return normalizeRoundAndPackFloat128( aSign, aExp, aSig0, aSig1

                                          STATUS_VAR );

}


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

 {

+    if (use_icount) {
+
         return cpu_get_icount();
+
+    }
+
+    if (!timers_state.cpu_ticks_enabled) {

+        return timers_state.cpu_ticks_offset;
+
     } else {

         int64_t ticks;

int64_t cpu_get_ticks(void)

{

    if (use_icount) {

        return cpu_get_icount();

    }

    if (!timers_state.cpu_ticks_enabled) {

        return timers_state.cpu_ticks_offset;

    } else {

        int64_t ticks;

        ticks = cpu_get_real_ticks();

        if (timers_state.cpu_ticks_prev > ticks) {

            /* Note: non increasing ticks may happen if the host uses

               software suspend */

            timers_state.cpu_ticks_offset += timers_state.cpu_ticks_prev - ticks;

        }

        timers_state.cpu_ticks_prev = ticks;

        return ticks + timers_state.cpu_ticks_offset;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,16 +1,16 @@
 static int qxl_init_primary(PCIDevice *dev)

 {
+
     PCIQXLDevice *qxl = DO_UPCAST(PCIQXLDevice, pci, dev);

     VGACommonState *vga = &qxl->vga;

     PortioList *qxl_vga_port_list = g_new(PortioList, 1);

+    int rc;
+
+

     qxl->id = 0;

static int qxl_init_primary(PCIDevice *dev)

{

    PCIQXLDevice *qxl = DO_UPCAST(PCIQXLDevice, pci, dev);

    VGACommonState *vga = &qxl->vga;

    PortioList *qxl_vga_port_list = g_new(PortioList, 1);

    int rc;

    qxl->id = 0;

    qxl_init_ramsize(qxl);

    vga->vram_size_mb = qxl->vga.vram_size >> 20;

    vga_common_init(vga, OBJECT(dev), true);

    vga_init(vga, OBJECT(dev),

             pci_address_space(dev), pci_address_space_io(dev), false);

    portio_list_init(qxl_vga_port_list, OBJECT(dev), qxl_vga_portio_list,

                     vga, "vga");

    portio_list_set_flush_coalesced(qxl_vga_port_list);

    portio_list_add(qxl_vga_port_list, pci_address_space_io(dev), 0x3b0);

    vga->con = graphic_console_init(DEVICE(dev), 0, &qxl_ops, qxl);

    qemu_spice_display_init_common(&qxl->ssd);

    rc = qxl_init_common(qxl);

    if (rc != 0) {

        return rc;

    }

    qxl->ssd.dcl.ops = &display_listener_ops;

    qxl->ssd.dcl.con = vga->con;

    register_displaychangelistener(&qxl->ssd.dcl);

    return rc;

}


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

 {

+    TCGv_i64 tmp1 = tcg_temp_new_i64();

+    TCGv_i64 tmp2 = tcg_temp_new_i64();

static TCGv_i64 gen_muls_i64_i32(TCGv a, TCGv b)

{

    TCGv_i64 tmp1 = tcg_temp_new_i64();

    TCGv_i64 tmp2 = tcg_temp_new_i64();

    tcg_gen_ext_i32_i64(tmp1, a);

    dead_tmp(a);

    tcg_gen_ext_i32_i64(tmp2, b);

    dead_tmp(b);

    tcg_gen_mul_i64(tmp1, tmp1, tmp2);

    tcg_temp_free_i64(tmp2);

    return tmp1;

}


PPC_OP(test_ctrz)

{

    T0 = (regs->ctr == 0);

    RETURN();

}


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

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

     SysBusDevice *sbd = SYS_BUS_DEVICE(obj);

static void xilinx_enet_init(Object *obj)

{

    XilinxAXIEnet *s = XILINX_AXI_ENET(obj);

    SysBusDevice *sbd = SYS_BUS_DEVICE(obj);

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

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

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

                             TYPE_STREAM_SLAVE,

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

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

                      TYPE_XILINX_AXI_ENET_DATA_STREAM);

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

                      TYPE_XILINX_AXI_ENET_CONTROL_STREAM);

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

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

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

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

    sysbus_init_irq(sbd, &s->irq);

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

    sysbus_init_mmio(sbd, &s->iomem);

}


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

     check_ieee_exceptions(env);

+    return ret;
+
+}

float32 helper_fqtos(CPUSPARCState *env)

{

    float32 ret;

    clear_float_exceptions(env);

    ret = float128_to_float32(QT1, &env->fp_status);

    check_ieee_exceptions(env);

    return ret;

}


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

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

             *endptr = nptr;

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

                  uint64_t *result)

{

    char *p;

    int err = 0;

    if (!nptr) {

        if (endptr) {

            *endptr = nptr;

        }

        err = -EINVAL;

    } else {

        errno = 0;

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

        err = check_strtox_error(endptr, p, errno);

    }

    return err;

}


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

 {

+    const uint8_t *buf = avpkt->data;

+    int buf_size = avpkt->size;

+    IdcinContext *s = avctx->priv_data;

     const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);

static int idcin_decode_frame(AVCodecContext *avctx,

                              void *data, int *data_size,

                              AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size = avpkt->size;

    IdcinContext *s = avctx->priv_data;

    const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);

    s->buf = buf;

    s->size = buf_size;

    if (s->frame.data[0])

        avctx->release_buffer(avctx, &s->frame);

    if (avctx->get_buffer(avctx, &s->frame)) {

        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");

        return -1;

    }

    idcin_decode_vlcs(s);

    if (pal) {

        s->frame.palette_has_changed = 1;

        memcpy(s->pal, pal, AVPALETTE_SIZE);

    }

    /* make the palette available on the way out */

    memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);

    *data_size = sizeof(AVFrame);

    *(AVFrame*)data = s->frame;

    /* report that the buffer was completely consumed */

    return buf_size;

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
+static int alloc_audio_output_buf(AVCodecContext *dec, AVCodecContext *enc,
+
+                                  int nb_samples, int *buf_linesize)
+
 {
+
+    int64_t audio_buf_samples;
+
+    int audio_buf_size;
+
+
+
     /* calculate required number of samples to allocate */

     audio_buf_samples = ((int64_t)nb_samples * enc->sample_rate + dec->sample_rate) /

static int alloc_audio_output_buf(AVCodecContext *dec, AVCodecContext *enc,

                                  int nb_samples, int *buf_linesize)

{

    int64_t audio_buf_samples;

    int audio_buf_size;

    /* calculate required number of samples to allocate */

    audio_buf_samples = ((int64_t)nb_samples * enc->sample_rate + dec->sample_rate) /

                        dec->sample_rate;

    audio_buf_samples = 4 * audio_buf_samples + 10000; // safety factors for resampling

    audio_buf_samples = FFMAX(audio_buf_samples, enc->frame_size);

    if (audio_buf_samples > INT_MAX)

        return AVERROR(EINVAL);

    audio_buf_size = av_samples_get_buffer_size(buf_linesize, enc->channels,

                                                audio_buf_samples,

                                                enc->sample_fmt, 0);

    if (audio_buf_size < 0)

        return audio_buf_size;

    av_fast_malloc(&audio_buf, &allocated_audio_buf_size, audio_buf_size);

    if (!audio_buf)

        return AVERROR(ENOMEM);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
+static int ram_save_host_page(RAMState *rs, PageSearchStatus *pss,

                               bool last_stage,

+                              ram_addr_t dirty_ram_abs)

 {

     int tmppages, pages = 0;

+    size_t pagesize = qemu_ram_pagesize(pss->block);

static int ram_save_host_page(RAMState *rs, PageSearchStatus *pss,

                              bool last_stage,

                              ram_addr_t dirty_ram_abs)

{

    int tmppages, pages = 0;

    size_t pagesize = qemu_ram_pagesize(pss->block);

    do {

        tmppages = ram_save_target_page(rs, pss, last_stage, dirty_ram_abs);

        if (tmppages < 0) {

            return tmppages;

        }

        pages += tmppages;

        pss->offset += TARGET_PAGE_SIZE;

        dirty_ram_abs += TARGET_PAGE_SIZE;

    } while (pss->offset & (pagesize - 1));

    /* The offset we leave with is the last one we looked at */

    pss->offset -= TARGET_PAGE_SIZE;

    return pages;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+void pcie_aer_inject_error_print(Monitor *mon, const QObject *data)
+
+{
+
+    QDict *qdict;
+
+    int devfn;

     assert(qobject_type(data) == QTYPE_QDICT);

void pcie_aer_inject_error_print(Monitor *mon, const QObject *data)

{

    QDict *qdict;

    int devfn;

    assert(qobject_type(data) == QTYPE_QDICT);

    qdict = qobject_to_qdict(data);

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

    monitor_printf(mon, "OK id: %s root bus: %s, bus: %x devfn: %x.%x\n",

                   qdict_get_str(qdict, "id"),

                   qdict_get_str(qdict, "root_bus"),

                   (int) qdict_get_int(qdict, "bus"),

                   PCI_SLOT(devfn), PCI_FUNC(devfn));

}


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

     int i, ret;

+
+
+    printf("password: ");
+
+    fflush(stdout);

     term_init();

static int read_password(char *buf, int buf_size)

{

    uint8_t ch;

    int i, ret;

    printf("password: ");

    fflush(stdout);

    term_init();

    i = 0;

    for(;;) {

        ret = read(0, &ch, 1);

        if (ret == -1) {

            if (errno == EAGAIN || errno == EINTR) {

                continue;

            } else {

                break;

            }

        } else if (ret == 0) {

            ret = -1;

            break;

        } else {

            if (ch == '\r') {

                ret = 0;

                break;

            }

            if (i < (buf_size - 1))

                buf[i++] = ch;

        }

    }

    term_exit();

    buf[i] = '\0';

    printf("\n");

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -4,10 +4,10 @@
     AVDictionary    *tmp = NULL;
     int ret = 0;
     while ((t = av_dict_get(*options, "", t, AV_DICT_IGNORE_SUFFIX))) {
+        ret = av_opt_set(obj, t->key, t->value, 0);
+        if (ret == AVERROR_OPTION_NOT_FOUND)
+            av_dict_set(&tmp, t->key, t->value, 0);
+        else if (ret < 0) {
             av_log(obj, AV_LOG_ERROR, "Error setting option %s to value %s.\n", t->key, t->value);
             break;
         }

int av_opt_set_dict(void *obj, AVDictionary **options)
{
    AVDictionaryEntry *t = NULL;
    AVDictionary    *tmp = NULL;
    int ret = 0;
    while ((t = av_dict_get(*options, "", t, AV_DICT_IGNORE_SUFFIX))) {
        ret = av_opt_set(obj, t->key, t->value, 0);
        if (ret == AVERROR_OPTION_NOT_FOUND)
            av_dict_set(&tmp, t->key, t->value, 0);
        else if (ret < 0) {
            av_log(obj, AV_LOG_ERROR, "Error setting option %s to value %s.\n", t->key, t->value);
            break;
        }
        ret = 0;
    }
    av_dict_free(options);
    *options = tmp;
    return ret;
}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     ICH9LPCState *lpc = arg;

+
     /* ACPI specs 3.0, 4.7.2.5 */

     acpi_pm1_cnt_update(&lpc->pm.acpi_regs,

static void ich9_apm_ctrl_changed(uint32_t val, void *arg)

{

    ICH9LPCState *lpc = arg;

    /* ACPI specs 3.0, 4.7.2.5 */

    acpi_pm1_cnt_update(&lpc->pm.acpi_regs,

                        val == ICH9_APM_ACPI_ENABLE,

                        val == ICH9_APM_ACPI_DISABLE);

    if (val == ICH9_APM_ACPI_ENABLE || val == ICH9_APM_ACPI_DISABLE) {

        return;

    }

    /* SMI_EN = PMBASE + 30. SMI control and enable register */

    if (lpc->pm.smi_en & ICH9_PMIO_SMI_EN_APMC_EN) {

        cpu_interrupt(current_cpu, CPU_INTERRUPT_SMI);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,35 +1,35 @@
+int qemu_read_password(char *buf, int buf_size)
+
+{
+
+    uint8_t ch;
+
+    int i, ret;
+
+
+
+    printf("password: ");
+
     fflush(stdout);
+
     term_init();
+
+    i = 0;
+
     for (;;) {
+
+        ret = read(0, &ch, 1);

         if (ret == -1) {
+
+            if (errno == EAGAIN || errno == EINTR) {

                 continue;

+            } else {
+
+                break;
+
             }

         } else if (ret == 0) {

int qemu_read_password(char *buf, int buf_size)

{

    uint8_t ch;

    int i, ret;

    printf("password: ");

    fflush(stdout);

    term_init();

    i = 0;

    for (;;) {

        ret = read(0, &ch, 1);

        if (ret == -1) {

            if (errno == EAGAIN || errno == EINTR) {

                continue;

            } else {

                break;

            }

        } else if (ret == 0) {

            ret = -1;

            break;

        } else {

            if (ch == '\r' ||

                ch == '\n') {

                ret = 0;

                break;

            }

            if (i < (buf_size - 1)) {

                buf[i++] = ch;

            }

        }

    }

    term_exit();

    buf[i] = '\0';

    printf("\n");

    return ret;

}


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

         features++;

+    }
+
+
+
+    oc = cpu_class_by_name(TYPE_S390_CPU, name);

     if (!oc) {

S390CPU *cpu_s390x_create(const char *cpu_model, Error **errp)

{

    static bool features_parsed;

    char *name, *features;

    const char *typename;

    ObjectClass *oc;

    CPUClass *cc;

    name = g_strdup(cpu_model);

    features = strchr(name, ',');

    if (features) {

        features[0] = 0;

        features++;

    }

    oc = cpu_class_by_name(TYPE_S390_CPU, name);

    if (!oc) {

        error_setg(errp, "Unknown CPU definition \'%s\'", name);

        g_free(name);

        return NULL;

    }

    typename = object_class_get_name(oc);

    if (!features_parsed) {

        features_parsed = true;

        cc = CPU_CLASS(oc);

        cc->parse_features(typename, features, errp);

    }

    g_free(name);

    if (*errp) {

        return NULL;

    }

    return S390_CPU(CPU(object_new(typename)));

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int vmdk_L2update(BlockDriverState *bs, VmdkMetaData *m_data)

+{

     BDRVVmdkState *s = bs->opaque;
+

     /* update L2 table */

static int vmdk_L2update(BlockDriverState *bs, VmdkMetaData *m_data)

{

    BDRVVmdkState *s = bs->opaque;

    /* update L2 table */

    if (bdrv_pwrite(bs->file, ((int64_t)m_data->l2_offset * 512) + (m_data->l2_index * sizeof(m_data->offset)),

                    &(m_data->offset), sizeof(m_data->offset)) != sizeof(m_data->offset))

        return -1;

    /* update backup L2 table */

    if (s->l1_backup_table_offset != 0) {

        m_data->l2_offset = s->l1_backup_table[m_data->l1_index];

        if (bdrv_pwrite(bs->file, ((int64_t)m_data->l2_offset * 512) + (m_data->l2_index * sizeof(m_data->offset)),

                        &(m_data->offset), sizeof(m_data->offset)) != sizeof(m_data->offset))

            return -1;

    }

    return 0;

}


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

     ctxt->free(cipher);
+
+    g_free(cipher);
+
+}

void qcrypto_cipher_free(QCryptoCipher *cipher)

{

    QCryptoCipherBuiltin *ctxt = cipher->opaque;

    if (!cipher) {

        return;

    }

    ctxt->free(cipher);

    g_free(cipher);

}


static void init_proc_620 (CPUPPCState *env)

{

    gen_spr_ne_601(env);

    gen_spr_620(env);

    /* Time base */

    gen_tbl(env);

    /* Hardware implementation registers */

    /* XXX : not implemented */

    spr_register(env, SPR_HID0, "HID0",

                 SPR_NOACCESS, SPR_NOACCESS,

                 &spr_read_generic, &spr_write_generic,

                 0x00000000);

    /* Memory management */

    gen_low_BATs(env);

    gen_high_BATs(env);

    init_excp_620(env);

    env->dcache_line_size = 64;

    env->icache_line_size = 64;

    /* XXX: TODO: initialize internal interrupt controller */

}


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

 	tcg_gen_mov_tl(org_s, s);

+
+
+	tcg_gen_shli_tl(t, org_s,  bitrev[0].shift);
+
+	tcg_gen_andi_tl(d, t,  bitrev[0].mask);

 	for (i = 1; i < sizeof bitrev / sizeof bitrev[0]; i++) {

static inline void t_gen_swapr(TCGv d, TCGv s)

{

	struct {

		int shift; /* LSL when positive, LSR when negative.  */

		uint32_t mask;

	} bitrev [] = {

		{7, 0x80808080},

		{5, 0x40404040},

		{3, 0x20202020},

		{1, 0x10101010},

		{-1, 0x08080808},

		{-3, 0x04040404},

		{-5, 0x02020202},

		{-7, 0x01010101}

	};

	int i;

	TCGv t, org_s;

	/* d and s refer the same object.  */

	t = tcg_temp_new(TCG_TYPE_TL);

	org_s = tcg_temp_new(TCG_TYPE_TL);

	tcg_gen_mov_tl(org_s, s);

	tcg_gen_shli_tl(t, org_s,  bitrev[0].shift);

	tcg_gen_andi_tl(d, t,  bitrev[0].mask);

	for (i = 1; i < sizeof bitrev / sizeof bitrev[0]; i++) {

		if (bitrev[i].shift >= 0) {

			tcg_gen_shli_tl(t, org_s,  bitrev[i].shift);

		} else {

			tcg_gen_shri_tl(t, org_s,  -bitrev[i].shift);

		}

		tcg_gen_andi_tl(t, t,  bitrev[i].mask);

		tcg_gen_or_tl(d, d, t);

	}

	tcg_temp_free(t);

	tcg_temp_free(org_s);

}


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

     return g_strdup(bdrv_get_device_name(ptr));
+
 }

static char *print_drive(void *ptr)

{

    return g_strdup(bdrv_get_device_name(ptr));

}


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

     struct socket *so;

+    struct socket *head = (is_udp ? &udb : &tcb);
+
+    struct sockaddr_in addr;
+
+    int port = htons(host_port);

     socklen_t addr_len;

int slirp_remove_hostfwd(int is_udp, struct in_addr host_addr, int host_port)

{

    struct socket *so;

    struct socket *head = (is_udp ? &udb : &tcb);

    struct sockaddr_in addr;

    int port = htons(host_port);

    socklen_t addr_len;

    int n = 0;

 loop_again:

    for (so = head->so_next; so != head; so = so->so_next) {

        addr_len = sizeof(addr);

        if (getsockname(so->s, (struct sockaddr *)&addr, &addr_len) == 0 &&

            addr.sin_addr.s_addr == host_addr.s_addr &&

            addr.sin_port == port) {

            close(so->s);

            sofree(so);

            n++;

            goto loop_again;

        }

    }

    return n;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void ff_jref_idct1_put(uint8_t *dest, int line_size, DCTELEM *block)
+
+{

     uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

static void ff_jref_idct1_put(uint8_t *dest, int line_size, DCTELEM *block)

{

    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

    dest[0] = cm[(block[0] + 4)>>3];

}


--- a/source.c
+++ b/source.c
@@ -1,31 +1,31 @@
 static int print_device_sinks(AVOutputFormat *fmt, AVDictionary *opts)

+{

+    int ret, i;

     AVFormatContext *dev = NULL;

     AVDeviceInfoList *device_list = NULL;

+    AVDictionary *tmp_opts = NULL;

+
+
     if (!fmt || !fmt->priv_class  || !AV_IS_OUTPUT_DEVICE(fmt->priv_class->category))

+        return AVERROR(EINVAL);
+
+

     printf("Audo-detected sinks for %s:\n", fmt->name);

     if (!fmt->get_device_list) {

         ret = AVERROR(ENOSYS);
+
         printf("Cannot list sinks. Not implemented.\n");
+
         goto fail;

     }

static int print_device_sinks(AVOutputFormat *fmt, AVDictionary *opts)

{

    int ret, i;

    AVFormatContext *dev = NULL;

    AVDeviceInfoList *device_list = NULL;

    AVDictionary *tmp_opts = NULL;

    if (!fmt || !fmt->priv_class  || !AV_IS_OUTPUT_DEVICE(fmt->priv_class->category))

        return AVERROR(EINVAL);

    printf("Audo-detected sinks for %s:\n", fmt->name);

    if (!fmt->get_device_list) {

        ret = AVERROR(ENOSYS);

        printf("Cannot list sinks. Not implemented.\n");

        goto fail;

    }

    if ((ret = avformat_alloc_output_context2(&dev, fmt, NULL, NULL)) < 0) {

        printf("Cannot open device: %s.\n", fmt->name);

        goto fail;

    }

    av_dict_copy(&tmp_opts, opts, 0);

    av_opt_set_dict2(dev, &tmp_opts, AV_OPT_SEARCH_CHILDREN);

    if ((ret = avdevice_list_devices(dev, &device_list)) < 0) {

        printf("Cannot list sinks.\n");

        goto fail;

    }

    for (i = 0; i < device_list->nb_devices; i++) {

        printf("%s %s [%s]\n", device_list->default_device == i ? "*" : " ",

               device_list->devices[i]->device_name, device_list->devices[i]->device_description);

    }

  fail:

    av_dict_free(&tmp_opts);

    avdevice_free_list_devices(&device_list);

    avformat_free_context(dev);

    return ret;

}


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

+
+    tmp = (*value >> shift) & mask;
+
+    if (mr->subpage) {
+
         trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size);

static MemTxResult memory_region_write_accessor(MemoryRegion *mr,

                                                hwaddr addr,

                                                uint64_t *value,

                                                unsigned size,

                                                unsigned shift,

                                                uint64_t mask,

                                                MemTxAttrs attrs)

{

    uint64_t tmp;

    tmp = (*value >> shift) & mask;

    if (mr->subpage) {

        trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size);

    } else if (TRACE_MEMORY_REGION_OPS_WRITE_ENABLED) {

        hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);

        trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size);

    }

    mr->ops->write(mr->opaque, addr, tmp, size);

    return MEMTX_OK;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id)

 {
+
     VirtIOBlock *s = opaque;

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

{

    VirtIOBlock *s = opaque;

    if (version_id != 2)

        return -EINVAL;

    virtio_load(&s->vdev, f);

    while (qemu_get_sbyte(f)) {

        VirtIOBlockReq *req = virtio_blk_alloc_request(s);

        qemu_get_buffer(f, (unsigned char*)&req->elem, sizeof(req->elem));

        req->next = s->rq;

        s->rq = req;

        virtqueue_map_sg(req->elem.in_sg, req->elem.in_addr,

            req->elem.in_num, 1);

        virtqueue_map_sg(req->elem.out_sg, req->elem.out_addr,

            req->elem.out_num, 0);

    }

    return 0;

}


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

 {

static void fw_cfg_ctl_mem_write(void *opaque, target_phys_addr_t addr,

                                 uint64_t value, unsigned size)

{

    fw_cfg_select(opaque, (uint16_t)value);

}


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

     env->exception_injected = -1;
+
+    env->interrupt_injected = -1;
+
+    env->xcr0 = 1;
+
     if (kvm_irqchip_in_kernel()) {

         env->mp_state = cpu_is_bsp(cpu) ? KVM_MP_STATE_RUNNABLE :

void kvm_arch_reset_vcpu(X86CPU *cpu)

{

    CPUX86State *env = &cpu->env;

    env->exception_injected = -1;

    env->interrupt_injected = -1;

    env->xcr0 = 1;

    if (kvm_irqchip_in_kernel()) {

        env->mp_state = cpu_is_bsp(cpu) ? KVM_MP_STATE_RUNNABLE :

                                          KVM_MP_STATE_UNINITIALIZED;

    } else {

        env->mp_state = KVM_MP_STATE_RUNNABLE;

    }

    if (cpu->hyperv_synic) {

        int i;

        for (i = 0; i < ARRAY_SIZE(env->msr_hv_synic_sint); i++) {

            env->msr_hv_synic_sint[i] = HV_SINT_MASKED;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void add_user_command(char *optarg)
+
 {

     cmdline = g_realloc(cmdline, ++ncmdline * sizeof(char *));

static void add_user_command(char *optarg)

{

    cmdline = g_realloc(cmdline, ++ncmdline * sizeof(char *));

    cmdline[ncmdline-1] = optarg;

}


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

 {

+    /* XXX: restore cpu registers saved in host registers */
+
+

     cpu->exception_index = -1;

void cpu_resume_from_signal(CPUState *cpu, void *puc)

{

    /* XXX: restore cpu registers saved in host registers */

    cpu->exception_index = -1;

    siglongjmp(cpu->jmp_env, 1);

}


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

     XMVDemuxContext *xmv = s->priv_data;
+
+    int result;
+
+
+
     if (xmv->video.current_frame == xmv->video.frame_count) {

         /* No frames left in this packet, so we fetch a new one */

static int xmv_read_packet(AVFormatContext *s,

                           AVPacket *pkt)

{

    XMVDemuxContext *xmv = s->priv_data;

    int result;

    if (xmv->video.current_frame == xmv->video.frame_count) {

        /* No frames left in this packet, so we fetch a new one */

        result = xmv_fetch_new_packet(s);

        if (result)

            return result;

    }

    if (xmv->current_stream == 0) {

        /* Fetch a video frame */

        result = xmv_fetch_video_packet(s, pkt);

    } else {

        /* Fetch an audio frame */

        result = xmv_fetch_audio_packet(s, pkt, xmv->current_stream - 1);

    }

    if (result)

        return result;

    /* Increase our counters */

    if (++xmv->current_stream >= xmv->stream_count) {

        xmv->current_stream       = 0;

        xmv->video.current_frame += 1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
 DIRAC_PIXOP(avg, ff_avg, mmxext)

+
+void ff_put_dirac_pixels16_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h)
+
+{
+
     if (h&3)

         ff_put_dirac_pixels16_c(dst, src, stride, h);

DIRAC_PIXOP(put, ff_put, mmx)

DIRAC_PIXOP(avg, ff_avg, mmx)

DIRAC_PIXOP(avg, ff_avg, mmxext)

void ff_put_dirac_pixels16_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h)

{

    if (h&3)

        ff_put_dirac_pixels16_c(dst, src, stride, h);

    else

    ff_put_pixels16_sse2(dst, src[0], stride, h);

}


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

     if (frame_padright < 0) {

+        fprintf(stderr, "Incorrect right pad size\n");
+
+        av_exit(1);

     }

static void opt_frame_pad_right(const char *arg)

{

    frame_padright = atoi(arg);

    if (frame_padright < 0) {

        fprintf(stderr, "Incorrect right pad size\n");

        av_exit(1);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int ram_load(QEMUFile *f, void *opaque, int version_id)
+
+{
+
+    ram_addr_t addr;
+
     int flags;

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

{

    ram_addr_t addr;

    int flags;

    if (version_id != 3)

        return -EINVAL;

    do {

        addr = qemu_get_be64(f);

        flags = addr & ~TARGET_PAGE_MASK;

        addr &= TARGET_PAGE_MASK;

        if (flags & RAM_SAVE_FLAG_MEM_SIZE) {

            if (addr != last_ram_offset)

                return -EINVAL;

        }

        if (flags & RAM_SAVE_FLAG_COMPRESS) {

            uint8_t ch = qemu_get_byte(f);

            memset(qemu_get_ram_ptr(addr), ch, TARGET_PAGE_SIZE);

#ifndef _WIN32

            if (ch == 0 &&

                (!kvm_enabled() || kvm_has_sync_mmu())) {

                madvise(qemu_get_ram_ptr(addr), TARGET_PAGE_SIZE, MADV_DONTNEED);

            }

#endif

        } else if (flags & RAM_SAVE_FLAG_PAGE) {

            qemu_get_buffer(f, qemu_get_ram_ptr(addr), TARGET_PAGE_SIZE);

        }

        if (qemu_file_has_error(f)) {

            return -EIO;

        }

    } while (!(flags & RAM_SAVE_FLAG_EOS));

    return 0;

}


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

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

             break;

static int64_t coroutine_fn bdrv_co_get_block_status_above(BlockDriverState *bs,

        BlockDriverState *base,

        int64_t sector_num,

        int nb_sectors,

        int *pnum,

        BlockDriverState **file)

{

    BlockDriverState *p;

    int64_t ret = 0;

    bool first = true;

    assert(bs != base);

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

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

        if (ret < 0) {

            break;

        }

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

            /*

             * Reading beyond the end of the file continues to read

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

             * unallocated length we learned from an earlier

             * iteration.

             */

            *pnum = nb_sectors;

        }

        if (ret & (BDRV_BLOCK_ZERO | BDRV_BLOCK_DATA)) {

            break;

        }

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

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

        nb_sectors = MIN(nb_sectors, *pnum);

        first = false;

    }

    return ret;

}


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

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

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

         ctx->rc.range  <<= 8;

static inline void range_dec_normalize(APEContext * ctx)

{

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

        ctx->rc.buffer = (ctx->rc.buffer << 8) | bytestream_get_byte(&ctx->ptr);

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

        ctx->rc.range  <<= 8;

    }

}


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

         tmp = gen_muls_i64_i32(a, b);

+        tcg_gen_mov_i64(dest, tmp);
+
+
+        break;
+
     case 5:

         tmp = gen_mulu_i64_i32(a, b);

static inline void gen_neon_mull(TCGv_i64 dest, TCGv a, TCGv b, int size, int u)

{

    TCGv_i64 tmp;

    switch ((size << 1) | u) {

    case 0: gen_helper_neon_mull_s8(dest, a, b); break;

    case 1: gen_helper_neon_mull_u8(dest, a, b); break;

    case 2: gen_helper_neon_mull_s16(dest, a, b); break;

    case 3: gen_helper_neon_mull_u16(dest, a, b); break;

    case 4:

        tmp = gen_muls_i64_i32(a, b);

        tcg_gen_mov_i64(dest, tmp);

        break;

    case 5:

        tmp = gen_mulu_i64_i32(a, b);

        tcg_gen_mov_i64(dest, tmp);

        break;

    default: abort();

    }

    /* gen_helper_neon_mull_[su]{8|16} do not free their parameters.

       Don't forget to clean them now.  */

    if (size < 2) {

        tcg_temp_free_i32(a);

        tcg_temp_free_i32(b);

    }

}


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

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

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

static void test_acpi_asl(test_data *data)

{

    int i;

    AcpiSdtTable *sdt, *exp_sdt;

    test_data exp_data;

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

    exp_data.ssdt_tables = load_expected_aml(data);

    dump_aml_files(data);

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

        GString *asl, *exp_asl;

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

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

        load_asl(data->ssdt_tables, sdt);

        asl = normalize_asl(sdt->asl);

        load_asl(exp_data.ssdt_tables, exp_sdt);

        exp_asl = normalize_asl(exp_sdt->asl);

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

        g_string_free(asl, true);

        g_string_free(exp_asl, true);

    }

    free_test_data(&exp_data);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+void bdrv_eject(BlockDriverState *bs, int eject_flag)

 {

void bdrv_eject(BlockDriverState *bs, int eject_flag)

{

    BlockDriver *drv = bs->drv;

    int ret;

    if (!drv || !drv->bdrv_eject) {

        ret = -ENOTSUP;

    } else {

        ret = drv->bdrv_eject(bs, eject_flag);

    }

    if (ret == -ENOTSUP) {

        if (eject_flag)

            bdrv_close(bs);

    }

}


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

     case 0:

+        tmp = gen_ld8u(addr, IS_USER(s));

         break;
+
     case 1:

         tmp = gen_ld16u(addr, IS_USER(s));

static void gen_load_exclusive(DisasContext *s, int rt, int rt2,

                               TCGv addr, int size)

{

    TCGv tmp;

    switch (size) {

    case 0:

        tmp = gen_ld8u(addr, IS_USER(s));

        break;

    case 1:

        tmp = gen_ld16u(addr, IS_USER(s));

        break;

    case 2:

    case 3:

        tmp = gen_ld32(addr, IS_USER(s));

        break;

    default:

        abort();

    }

    tcg_gen_mov_i32(cpu_exclusive_val, tmp);

    store_reg(s, rt, tmp);

    if (size == 3) {

        TCGv tmp2 = new_tmp();

        tcg_gen_addi_i32(tmp2, addr, 4);

        tmp = gen_ld32(tmp2, IS_USER(s));

        dead_tmp(tmp2);

        tcg_gen_mov_i32(cpu_exclusive_high, tmp);

        store_reg(s, rt2, tmp);

    }

    tcg_gen_mov_i32(cpu_exclusive_addr, addr);

}


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

                    NonBlockingConnectHandler *callback, void *opaque)

+{
+
+    QemuOpts *opts;
+
+    int fd;

int socket_connect(SocketAddress *addr, Error **errp,

                   NonBlockingConnectHandler *callback, void *opaque)

{

    QemuOpts *opts;

    int fd;

    opts = qemu_opts_create_nofail(&socket_optslist);

    switch (addr->kind) {

    case SOCKET_ADDRESS_KIND_INET:

        inet_addr_to_opts(opts, addr->inet);

        fd = inet_connect_opts(opts, errp, callback, opaque);

        break;

    case SOCKET_ADDRESS_KIND_UNIX:

        qemu_opt_set(opts, "path", addr->q_unix->path);

        fd = unix_connect_opts(opts, errp, callback, opaque);

        break;

    case SOCKET_ADDRESS_KIND_FD:

        fd = monitor_get_fd(cur_mon, addr->fd->str, errp);

        if (callback) {

            callback(fd, opaque);

        }

        break;

    default:

        abort();

    }

    qemu_opts_del(opts);

    return fd;

}


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

     d->mv_dir= s->mv_dir;

+    d->pb= s->pb;
+
+    d->block= s->block;
+
+    for(i=0; i<6; i++)

         d->block_last_index[i]= s->block_last_index[i];

static void copy_context_after_encode(MpegEncContext *d, MpegEncContext *s, int type){

    int i;

    memcpy(d->mv, s->mv, 2*4*2*sizeof(int));

    memcpy(d->last_mv, s->last_mv, 2*2*2*sizeof(int)); //FIXME is memcpy faster then a loop?

    /* mpeg1 */

    d->mb_incr= s->mb_incr;

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

        d->last_dc[i]= s->last_dc[i];

    /* statistics */

    d->mv_bits= s->mv_bits;

    d->i_tex_bits= s->i_tex_bits;

    d->p_tex_bits= s->p_tex_bits;

    d->i_count= s->i_count;

    d->p_count= s->p_count;

    d->skip_count= s->skip_count;

    d->misc_bits= s->misc_bits;

    d->mb_intra= s->mb_intra;

    d->mb_skiped= s->mb_skiped;

    d->mv_type= s->mv_type;

    d->mv_dir= s->mv_dir;

    d->pb= s->pb;

    d->block= s->block;

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

        d->block_last_index[i]= s->block_last_index[i];

}


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

+
+    if (dev->pdev->msix_enabled) {

         g_assert_cmpint(dev->config_msix_entry, !=, -1);

static bool qvirtio_pci_get_config_isr_status(QVirtioDevice *d)

{

    QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;

    uint32_t data;

    if (dev->pdev->msix_enabled) {

        g_assert_cmpint(dev->config_msix_entry, !=, -1);

        if (qpci_msix_masked(dev->pdev, dev->config_msix_entry)) {

            /* No ISR checking should be done if masked, but read anyway */

            return qpci_msix_pending(dev->pdev, dev->config_msix_entry);

        } else {

            data = readl(dev->config_msix_addr);

            writel(dev->config_msix_addr, 0);

            return data == dev->config_msix_data;

        }

    } else {

        return qpci_io_readb(dev->pdev, dev->addr + QVIRTIO_PCI_ISR_STATUS) & 2;

    }

}


static uint64_t omap_uwire_read(void *opaque, target_phys_addr_t addr,

                                unsigned size)

{

    struct omap_uwire_s *s = (struct omap_uwire_s *) opaque;

    int offset = addr & OMAP_MPUI_REG_MASK;

    if (size != 2) {

        return omap_badwidth_read16(opaque, addr);

    }

    switch (offset) {

    case 0x00:	/* RDR */

        s->control &= ~(1 << 15);			/* RDRB */

        return s->rxbuf;

    case 0x04:	/* CSR */

        return s->control;

    case 0x08:	/* SR1 */

        return s->setup[0];

    case 0x0c:	/* SR2 */

        return s->setup[1];

    case 0x10:	/* SR3 */

        return s->setup[2];

    case 0x14:	/* SR4 */

        return s->setup[3];

    case 0x18:	/* SR5 */

        return s->setup[4];

    }

    OMAP_BAD_REG(addr);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void qapi_dealloc_type_str(Visitor *v, char **obj, const char *name,
+
+                                  Error **errp)

 {

static void qapi_dealloc_type_str(Visitor *v, char **obj, const char *name,

                                  Error **errp)

{

    g_free(*obj);

}


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

 {

+    DeviceState *dev;

     SysBusDevice *s;

static void lx60_net_init(MemoryRegion *address_space,

        hwaddr base,

        hwaddr descriptors,

        hwaddr buffers,

        qemu_irq irq, NICInfo *nd)

{

    DeviceState *dev;

    SysBusDevice *s;

    MemoryRegion *ram;

    dev = qdev_create(NULL, "open_eth");

    qdev_set_nic_properties(dev, nd);

    qdev_init_nofail(dev);

    s = SYS_BUS_DEVICE(dev);

    sysbus_connect_irq(s, 0, irq);

    memory_region_add_subregion(address_space, base,

            sysbus_mmio_get_region(s, 0));

    memory_region_add_subregion(address_space, descriptors,

            sysbus_mmio_get_region(s, 1));

    ram = g_malloc(sizeof(*ram));

    memory_region_init_ram(ram, OBJECT(s), "open_eth.ram", 16384, &error_abort);

    vmstate_register_ram_global(ram);

    memory_region_add_subregion(address_space, buffers, ram);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 ram_addr_t qemu_ram_alloc(ram_addr_t size, MemoryRegion *mr, Error **errp)

+{

     return qemu_ram_alloc_from_ptr(size, NULL, mr, errp);

ram_addr_t qemu_ram_alloc(ram_addr_t size, MemoryRegion *mr, Error **errp)

{

    return qemu_ram_alloc_from_ptr(size, NULL, mr, errp);

}


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

         blk_mig_cleanup();

+        return ret;
+
+    }
+
+

     blk_mig_reset_dirty_cursor();

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

{

    int ret;

    DPRINTF("Enter save live complete submitted %d transferred %d\n",

            block_mig_state.submitted, block_mig_state.transferred);

    ret = flush_blks(f);

    if (ret) {

        blk_mig_cleanup();

        return ret;

    }

    blk_mig_reset_dirty_cursor();

    /* we know for sure that save bulk is completed and

       all async read completed */

    assert(block_mig_state.submitted == 0);

    do {

        ret = blk_mig_save_dirty_block(f, 0);

    } while (ret == 0);

    blk_mig_cleanup();

    if (ret) {

        return ret;

    }

    /* report completion */

    qemu_put_be64(f, (100 << BDRV_SECTOR_BITS) | BLK_MIG_FLAG_PROGRESS);

    DPRINTF("Block migration completed\n");

    qemu_put_be64(f, BLK_MIG_FLAG_EOS);

    return 0;

}


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

     spr_register_kvm(env, SPR_FSCR, "FSCR",

static void gen_spr_power8_fscr(CPUPPCState *env)

{

    spr_register_kvm(env, SPR_FSCR, "FSCR",

                     SPR_NOACCESS, SPR_NOACCESS,

                     &spr_read_generic, &spr_write_generic,

                     KVM_REG_PPC_FSCR, 0x00000000);

}


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

     cc->do_interrupt = ppc_cpu_do_interrupt;

+    cc->dump_state = ppc_cpu_dump_state;
+
+    cc->dump_statistics = ppc_cpu_dump_statistics;
+
+    cc->set_pc = ppc_cpu_set_pc;

     cc->gdb_read_register = ppc_cpu_gdb_read_register;

static void ppc_cpu_class_init(ObjectClass *oc, void *data)

{

    PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);

    CPUClass *cc = CPU_CLASS(oc);

    DeviceClass *dc = DEVICE_CLASS(oc);

    pcc->parent_realize = dc->realize;

    dc->realize = ppc_cpu_realizefn;

    dc->unrealize = ppc_cpu_unrealizefn;

    pcc->parent_reset = cc->reset;

    cc->reset = ppc_cpu_reset;

    cc->class_by_name = ppc_cpu_class_by_name;

    cc->do_interrupt = ppc_cpu_do_interrupt;

    cc->dump_state = ppc_cpu_dump_state;

    cc->dump_statistics = ppc_cpu_dump_statistics;

    cc->set_pc = ppc_cpu_set_pc;

    cc->gdb_read_register = ppc_cpu_gdb_read_register;

    cc->gdb_write_register = ppc_cpu_gdb_write_register;

#ifndef CONFIG_USER_ONLY

    cc->get_phys_page_debug = ppc_cpu_get_phys_page_debug;

    cc->vmsd = &vmstate_ppc_cpu;

    cc->gdb_num_core_regs = 71;

    cc->gdb_core_xml_file = "power64-core.xml";

#else

    cc->gdb_core_xml_file = "power-core.xml";

}


--- a/source.c
+++ b/source.c
@@ -1,29 +1,29 @@
 int qcow2_alloc_clusters_at(BlockDriverState *bs, uint64_t offset,

     int nb_clusters)
+
 {

     BDRVQcowState *s = bs->opaque;

+    uint64_t cluster_index;

+    uint64_t old_free_cluster_index;
+
+    uint64_t i;
+
+    int refcount, ret;
+
+

     assert(nb_clusters >= 0);
+
+    if (nb_clusters == 0) {
+
         return 0;

     }
+

     /* Check how many clusters there are free */

int qcow2_alloc_clusters_at(BlockDriverState *bs, uint64_t offset,

    int nb_clusters)

{

    BDRVQcowState *s = bs->opaque;

    uint64_t cluster_index;

    uint64_t old_free_cluster_index;

    uint64_t i;

    int refcount, ret;

    assert(nb_clusters >= 0);

    if (nb_clusters == 0) {

        return 0;

    }

    /* Check how many clusters there are free */

    cluster_index = offset >> s->cluster_bits;

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

        refcount = get_refcount(bs, cluster_index++);

        if (refcount < 0) {

            return refcount;

        } else if (refcount != 0) {

            break;

        }

    }

    /* And then allocate them */

    old_free_cluster_index = s->free_cluster_index;

    s->free_cluster_index = cluster_index + i;

    ret = update_refcount(bs, offset, i << s->cluster_bits, 1,

                          QCOW2_DISCARD_NEVER);

    if (ret < 0) {

        return ret;

    }

    s->free_cluster_index = old_free_cluster_index;

    return i;

}


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

                          int coef_begin, int coef_end)

+{
+
+    int icoef, pred, ilms, num_lms, residue, input;
+
+

     num_lms = s->cdlms_ttl[ch];

static void revert_cdlms(WmallDecodeCtx *s, int ch,

                         int coef_begin, int coef_end)

{

    int icoef, pred, ilms, num_lms, residue, input;

    num_lms = s->cdlms_ttl[ch];

    for (ilms = num_lms - 1; ilms >= 0; ilms--) {

        for (icoef = coef_begin; icoef < coef_end; icoef++) {

            pred = 1 << (s->cdlms[ch][ilms].scaling - 1);

            residue = s->channel_residues[ch][icoef];

            pred += s->dsp.scalarproduct_and_madd_int16(s->cdlms[ch][ilms].coefs,

                                                        s->cdlms[ch][ilms].lms_prevvalues

                                                            + s->cdlms[ch][ilms].recent,

                                                        s->cdlms[ch][ilms].lms_updates

                                                            + s->cdlms[ch][ilms].recent,

                                                        s->cdlms[ch][ilms].order,

                                                        WMASIGN(residue));

            input = residue + (pred >> s->cdlms[ch][ilms].scaling);

            lms_update(s, ch, ilms, input);

            s->channel_residues[ch][icoef] = input;

        }

    }

}


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

     dc->vmsd = &pci_vpb_vmstate;

+    dc->props = pci_vpb_properties;
+
+    /* Reason: object_unref() hangs */
+
+    dc->cannot_destroy_with_object_finalize_yet = true;

 }

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    dc->realize = pci_vpb_realize;

    dc->reset = pci_vpb_reset;

    dc->vmsd = &pci_vpb_vmstate;

    dc->props = pci_vpb_properties;

    /* Reason: object_unref() hangs */

    dc->cannot_destroy_with_object_finalize_yet = true;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static float quantize_band_cost(struct AACEncContext *s, const float *in,
+
                                 const float *scaled, int size, int scale_idx,

                                 int cb, const float lambda, const float uplim,

static float quantize_band_cost(struct AACEncContext *s, const float *in,

                                const float *scaled, int size, int scale_idx,

                                int cb, const float lambda, const float uplim,

                                int *bits, int rtz)

{

    return get_band_cost(s, NULL, in, scaled, size, scale_idx, cb, lambda, uplim, bits);

}


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

     assert(!error_is_set(errp));

void visit_end_struct(Visitor *v, Error **errp)

{

    assert(!error_is_set(errp));

    v->end_struct(v, errp);

}


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

         int len = strlen(p) * 6 / 8;

+        char *buf = av_mallocz(len);
+
+        av_base64_decode(buf, p, len);
+
+

         if (rtp_asf_fix_header(buf, len) < 0)

int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)

{

    int ret = 0;

    if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {

        AVIOContext pb;

        RTSPState *rt = s->priv_data;

        AVDictionary *opts = NULL;

        int len = strlen(p) * 6 / 8;

        char *buf = av_mallocz(len);

        av_base64_decode(buf, p, len);

        if (rtp_asf_fix_header(buf, len) < 0)

            av_log(s, AV_LOG_ERROR,

                   "Failed to fix invalid RTSP-MS/ASF min_pktsize\n");

        init_packetizer(&pb, buf, len);

        if (rt->asf_ctx) {

            avformat_close_input(&rt->asf_ctx);

        }

        if (!(rt->asf_ctx = avformat_alloc_context()))

            return AVERROR(ENOMEM);

        rt->asf_ctx->pb      = &pb;

        av_dict_set(&opts, "no_resync_search", "1", 0);

        ret = avformat_open_input(&rt->asf_ctx, "", &ff_asf_demuxer, &opts);

        av_dict_free(&opts);

        if (ret < 0)

            return ret;

        av_dict_copy(&s->metadata, rt->asf_ctx->metadata, 0);

        rt->asf_pb_pos = avio_tell(&pb);

        av_free(buf);

        rt->asf_ctx->pb = NULL;

    }

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static inline void expand_category(COOKContext *q, int *category,

                                    int *category_index)
+
 {

     int i;

static inline void expand_category(COOKContext *q, int *category,

                                   int *category_index)

{

    int i;

    for (i = 0; i < q->num_vectors; i++)

        ++category[category_index[i]];

}


--- a/source.c
+++ b/source.c
@@ -39,11 +39,11 @@
     dsp->vp8_v_loop_filter_simple = vp8_v_loop_filter_simple_c;

     dsp->vp8_h_loop_filter_simple = vp8_h_loop_filter_simple_c;
+
+
+
+    VP8_MC_FUNC(0, 16);
+
     VP8_MC_FUNC(1, 8);

     VP8_MC_FUNC(2, 4);

av_cold void ff_vp8dsp_init(VP8DSPContext *dsp)

{

    dsp->vp8_luma_dc_wht    = vp8_luma_dc_wht_c;

    dsp->vp8_luma_dc_wht_dc = vp8_luma_dc_wht_dc_c;

    dsp->vp8_idct_add       = vp8_idct_add_c;

    dsp->vp8_idct_dc_add    = vp8_idct_dc_add_c;

    dsp->vp8_idct_dc_add4y  = vp8_idct_dc_add4y_c;

    dsp->vp8_idct_dc_add4uv = vp8_idct_dc_add4uv_c;

    dsp->vp8_v_loop_filter16y = vp8_v_loop_filter16_c;

    dsp->vp8_h_loop_filter16y = vp8_h_loop_filter16_c;

    dsp->vp8_v_loop_filter8uv = vp8_v_loop_filter8uv_c;

    dsp->vp8_h_loop_filter8uv = vp8_h_loop_filter8uv_c;

    dsp->vp8_v_loop_filter16y_inner = vp8_v_loop_filter16_inner_c;

    dsp->vp8_h_loop_filter16y_inner = vp8_h_loop_filter16_inner_c;

    dsp->vp8_v_loop_filter8uv_inner = vp8_v_loop_filter8uv_inner_c;

    dsp->vp8_h_loop_filter8uv_inner = vp8_h_loop_filter8uv_inner_c;

    dsp->vp8_v_loop_filter_simple = vp8_v_loop_filter_simple_c;

    dsp->vp8_h_loop_filter_simple = vp8_h_loop_filter_simple_c;

    VP8_MC_FUNC(0, 16);

    VP8_MC_FUNC(1, 8);

    VP8_MC_FUNC(2, 4);

    VP8_BILINEAR_MC_FUNC(0, 16);

    VP8_BILINEAR_MC_FUNC(1, 8);

    VP8_BILINEAR_MC_FUNC(2, 4);

    if (ARCH_ARM)

        ff_vp8dsp_init_arm(dsp);

    if (ARCH_PPC)

        ff_vp8dsp_init_ppc(dsp);

    if (ARCH_X86)

        ff_vp8dsp_init_x86(dsp);

}


--- a/source.c
+++ b/source.c
@@ -27,11 +27,11 @@
     s->filter = 0;

     s->vendorid = 0x1234;
+
+
+
+    qemu_macaddr_default_if_unset(&s->conf.macaddr);
+
     s->nic = qemu_new_nic(&net_usbnet_info, &s->conf,

                           s->dev.qdev.info->name, s->dev.qdev.id, s);

static int usb_net_initfn(USBDevice *dev)

{

    USBNetState *s = DO_UPCAST(USBNetState, dev, dev);

    s->dev.speed  = USB_SPEED_FULL;

    s->rndis = 1;

    s->rndis_state = RNDIS_UNINITIALIZED;

    QTAILQ_INIT(&s->rndis_resp);

    s->medium = 0;	/* NDIS_MEDIUM_802_3 */

    s->speed = 1000000; /* 100MBps, in 100Bps units */

    s->media_state = 0;	/* NDIS_MEDIA_STATE_CONNECTED */;

    s->filter = 0;

    s->vendorid = 0x1234;

    qemu_macaddr_default_if_unset(&s->conf.macaddr);

    s->nic = qemu_new_nic(&net_usbnet_info, &s->conf,

                          s->dev.qdev.info->name, s->dev.qdev.id, s);

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

    snprintf(s->usbstring_mac, sizeof(s->usbstring_mac),

             "%02x%02x%02x%02x%02x%02x",

             0x40,

             s->conf.macaddr.a[1],

             s->conf.macaddr.a[2],

             s->conf.macaddr.a[3],

             s->conf.macaddr.a[4],

             s->conf.macaddr.a[5]);

    usb_desc_set_string(dev, STRING_ETHADDR, s->usbstring_mac);

    add_boot_device_path(s->conf.bootindex, &dev->qdev, "/ethernet@0");

    return 0;

}


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

 POWERPC_TBL_START_COUNT(altivec_put_pixels16_num, 1);
+
+
+
+    for(i=0; i<h; i++) {
+
       *((uint32_t*)(block )) = (((const struct unaligned_32 *) (pixels))->l);

       *((uint32_t*)(block+4)) = (((const struct unaligned_32 *) (pixels+4))->l);

void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)

{

POWERPC_TBL_DECLARE(altivec_put_pixels16_num, 1);

#ifdef ALTIVEC_USE_REFERENCE_C_CODE

    int i;

POWERPC_TBL_START_COUNT(altivec_put_pixels16_num, 1);

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

      *((uint32_t*)(block )) = (((const struct unaligned_32 *) (pixels))->l);

      *((uint32_t*)(block+4)) = (((const struct unaligned_32 *) (pixels+4))->l);

      *((uint32_t*)(block+8)) = (((const struct unaligned_32 *) (pixels+8))->l);

      *((uint32_t*)(block+12)) = (((const struct unaligned_32 *) (pixels+12))->l);

      pixels+=line_size;

      block +=line_size;

    }

POWERPC_TBL_STOP_COUNT(altivec_put_pixels16_num, 1);

#else /* ALTIVEC_USE_REFERENCE_C_CODE */

    register vector unsigned char pixelsv1, pixelsv2;

    register vector unsigned char perm = vec_lvsl(0, pixels);

    int i;

POWERPC_TBL_START_COUNT(altivec_put_pixels16_num, 1);

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

      pixelsv1 = vec_ld(0, (unsigned char*)pixels);

      pixelsv2 = vec_ld(16, (unsigned char*)pixels);

      vec_st(vec_perm(pixelsv1, pixelsv2, perm),

             0, (unsigned char*)block);

      pixels+=line_size;

      block +=line_size;

    }

POWERPC_TBL_STOP_COUNT(altivec_put_pixels16_num, 1);

#endif /* ALTIVEC_USE_REFERENCE_C_CODE */

}


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

     XCBGrabContext *c = s->priv_data;
+
     uint32_t mask     = XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK;

     uint32_t values[] = { 1,

static void setup_window(AVFormatContext *s)

{

    XCBGrabContext *c = s->priv_data;

    uint32_t mask     = XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK;

    uint32_t values[] = { 1,

                          XCB_EVENT_MASK_EXPOSURE |

                          XCB_EVENT_MASK_STRUCTURE_NOTIFY };

    xcb_rectangle_t rect = { 0, 0, c->width, c->height };

    c->window = xcb_generate_id(c->conn);

    xcb_create_window(c->conn, XCB_COPY_FROM_PARENT,

                      c->window,

                      c->screen->root,

                      c->x - c->region_border,

                      c->y - c->region_border,

                      c->width + c->region_border * 2,

                      c->height + c->region_border * 2,

                      0,

                      XCB_WINDOW_CLASS_INPUT_OUTPUT,

                      XCB_COPY_FROM_PARENT,

                      mask, values);

#if CONFIG_LIBXCB_SHAPE

    xcb_shape_rectangles(c->conn, XCB_SHAPE_SO_SUBTRACT,

                         XCB_SHAPE_SK_BOUNDING, XCB_CLIP_ORDERING_UNSORTED,

                         c->window,

                         c->region_border, c->region_border,

                         1, &rect);

#endif

    xcb_map_window(c->conn, c->window);

    draw_rectangle(s);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static uint16List **host_memory_append_node(uint16List **node,
+
+                                            unsigned long value)
+
 {

      *node = g_malloc0(sizeof(**node));

static uint16List **host_memory_append_node(uint16List **node,

                                            unsigned long value)

{

     *node = g_malloc0(sizeof(**node));

     (*node)->value = value;

     return &(*node)->next;

}


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

                                  void *opaque, Error **errp)

+{

     DeviceState *dev = DEVICE(obj);
+
+    Property *prop = opaque;

     PCIHostDeviceAddress *addr = qdev_get_prop_ptr(dev, prop);

static void get_pci_host_devaddr(Object *obj, Visitor *v, const char *name,

                                 void *opaque, Error **errp)

{

    DeviceState *dev = DEVICE(obj);

    Property *prop = opaque;

    PCIHostDeviceAddress *addr = qdev_get_prop_ptr(dev, prop);

    char buffer[] = "xxxx:xx:xx.x";

    char *p = buffer;

    int rc = 0;

    rc = snprintf(buffer, sizeof(buffer), "%04x:%02x:%02x.%d",

                  addr->domain, addr->bus, addr->slot, addr->function);

    assert(rc == sizeof(buffer) - 1);

    visit_type_str(v, name, &p, errp);

}


--- a/source.c
+++ b/source.c
@@ -17,9 +17,9 @@
                 MAX(bs->bl.write_zeroes_alignment,

                     s->extents[i].cluster_sectors);
+
+        }
+
+    }
+
 }

static void vmdk_refresh_limits(BlockDriverState *bs, Error **errp)

{

    BDRVVmdkState *s = bs->opaque;

    int i;

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

        if (!s->extents[i].flat) {

            bs->bl.write_zeroes_alignment =

                MAX(bs->bl.write_zeroes_alignment,

                    s->extents[i].cluster_sectors);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
 void palette8torgb32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
+
+{

+	long i;
+
+
+
+/*
+
+	for(i=0; i<num_pixels; i++)

 		((unsigned *)dst)[i] = ((unsigned *)palette)[ src[i] ];

void palette8torgb32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)

{

	long i;

/*

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

		((unsigned *)dst)[i] = ((unsigned *)palette)[ src[i] ];

*/

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

	{

		#ifdef WORDS_BIGENDIAN

			dst[3]= palette[ src[i]*4+2 ];

			dst[2]= palette[ src[i]*4+1 ];

			dst[1]= palette[ src[i]*4+0 ];

		#else

		//FIXME slow?

			dst[0]= palette[ src[i]*4+2 ];

			dst[1]= palette[ src[i]*4+1 ];

			dst[2]= palette[ src[i]*4+0 ];

			//dst[3]= 0; /* do we need this cleansing? */

		#endif

		dst+= 4;

	}

}


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

         output[1][i] += (output[2][i] + output[3][i]);

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

 }

static inline void mix_2f_1r_to_mono(AC3DecodeContext *ctx)

{

    int i;

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

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

        output[1][i] += (output[2][i] + output[3][i]);

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

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

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static inline int is_bit_set(BlockDriverState *bs, int64_t bitnum)

 {
+
+    uint64_t offset = sizeof(struct cow_header_v2) + bitnum / 8;

     uint8_t bitmap;

static inline int is_bit_set(BlockDriverState *bs, int64_t bitnum)

{

    uint64_t offset = sizeof(struct cow_header_v2) + bitnum / 8;

    uint8_t bitmap;

    if (bdrv_pread(bs->file, offset, &bitmap, sizeof(bitmap)) !=

	    sizeof(bitmap)) {

       return -errno;

    }

    return !!(bitmap & (1 << (bitnum % 8)));

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static const AVOption *av_set_number(void *obj, const char *name, double num, int den, int64_t intnum){

     const AVOption *o= av_find_opt(obj, name, NULL, 0, 0);
+
     void *dst;

     if(!o || o->offset<=0)
@@ -17,7 +17,7 @@
         return NULL;

     }
+

     dst= ((uint8_t*)obj) + o->offset;

static const AVOption *av_set_number(void *obj, const char *name, double num, int den, int64_t intnum){

    const AVOption *o= av_find_opt(obj, name, NULL, 0, 0);

    void *dst;

    if(!o || o->offset<=0)

        return NULL;

    if(o->max*den < num*intnum || o->min*den > num*intnum) {

        av_log(NULL, AV_LOG_ERROR, "Value %lf for parameter '%s' out of range\n", num, name);

        return NULL;

    }

    dst= ((uint8_t*)obj) + o->offset;

    switch(o->type){

    case FF_OPT_TYPE_FLAGS:

    case FF_OPT_TYPE_INT:   *(int       *)dst= llrint(num/den)*intnum; break;

    case FF_OPT_TYPE_INT64: *(int64_t   *)dst= llrint(num/den)*intnum; break;

    case FF_OPT_TYPE_FLOAT: *(float     *)dst= num*intnum/den;         break;

    case FF_OPT_TYPE_DOUBLE:*(double    *)dst= num*intnum/den;         break;

    case FF_OPT_TYPE_RATIONAL:

        if((int)num == num) *(AVRational*)dst= (AVRational){num*intnum, den};

        else                *(AVRational*)dst= av_d2q(num*intnum/den, 1<<24);

        break;

    default:

        return NULL;

    }

    return o;

}


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

     QObject *event_data;

+    VirtIONet *n = qemu_get_nic_opaque(nc);

+

     if (nc->rxfilter_notify_enabled) {

static void rxfilter_notify(NetClientState *nc)

{

    QObject *event_data;

    VirtIONet *n = qemu_get_nic_opaque(nc);

    if (nc->rxfilter_notify_enabled) {

        if (n->netclient_name) {

            event_data = qobject_from_jsonf("{ 'name': %s, 'path': %s }",

                                    n->netclient_name,

                                    object_get_canonical_path(OBJECT(n->qdev)));

        } else {

            event_data = qobject_from_jsonf("{ 'path': %s }",

                                    object_get_canonical_path(OBJECT(n->qdev)));

        }

        monitor_protocol_event(QEVENT_NIC_RX_FILTER_CHANGED, event_data);

        qobject_decref(event_data);

        /* disable event notification to avoid events flooding */

        nc->rxfilter_notify_enabled = 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 bool timerlistgroup_run_timers(QEMUTimerListGroup *tlg)

+{
+
+    QEMUClockType type;
+
     bool progress = false;

     for (type = 0; type < QEMU_CLOCK_MAX; type++) {

bool timerlistgroup_run_timers(QEMUTimerListGroup *tlg)

{

    QEMUClockType type;

    bool progress = false;

    for (type = 0; type < QEMU_CLOCK_MAX; type++) {

        progress |= timerlist_run_timers(tlg->tl[type]);

    }

    return progress;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void rocker_class_init(ObjectClass *klass, void *data)

 {
+
     DeviceClass *dc = DEVICE_CLASS(klass);

     PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);

    k->init = pci_rocker_init;

    k->exit = pci_rocker_uninit;

    k->vendor_id = PCI_VENDOR_ID_REDHAT;

    k->device_id = PCI_DEVICE_ID_REDHAT_ROCKER;

    k->revision = ROCKER_PCI_REVISION;

    k->class_id = PCI_CLASS_NETWORK_OTHER;

    set_bit(DEVICE_CATEGORY_NETWORK, dc->categories);

    dc->desc = "Rocker Switch";

    dc->reset = rocker_reset;

    dc->props = rocker_properties;

    dc->vmsd = &rocker_vmsd;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int pci_apb_map_irq(PCIDevice *pci_dev, int irq_num)

 {
+
     return ((pci_dev->devfn & 0x18) >> 1) + irq_num;

 }

static int pci_apb_map_irq(PCIDevice *pci_dev, int irq_num)

{

    return ((pci_dev->devfn & 0x18) >> 1) + irq_num;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int read_dcs(AVCodecContext *avctx, GetBitContext *gb, Bundle *b,

+                    int start_bits, int has_sign)

 {

static int read_dcs(AVCodecContext *avctx, GetBitContext *gb, Bundle *b,

                    int start_bits, int has_sign)

{

    int i, j, len, len2, bsize, sign, v, v2;

    int16_t *dst = (int16_t*)b->cur_dec;

    CHECK_READ_VAL(gb, b, len);

    v = get_bits(gb, start_bits - has_sign);

    if (v && has_sign) {

        sign = -get_bits1(gb);

        v = (v ^ sign) - sign;

    }

    *dst++ = v;

    len--;

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

        len2 = FFMIN(len - i, 8);

        bsize = get_bits(gb, 4);

        if (bsize) {

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

                v2 = get_bits(gb, bsize);

                if (v2) {

                    sign = -get_bits1(gb);

                    v2 = (v2 ^ sign) - sign;

                }

                v += v2;

                *dst++ = v;

                if (v < -32768 || v > 32767) {

                    av_log(avctx, AV_LOG_ERROR, "DC value went out of bounds: %d\n", v);

                    return -1;

                }

            }

        } else {

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

                *dst++ = v;

        }

    }

    b->cur_dec = (uint8_t*)dst;

    return 0;

}


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

     HotplugHandlerClass *hdc = HOTPLUG_HANDLER_GET_CLASS(plug_handler);

+
+
+    if (hdc->post_plug) {
+
         hdc->post_plug(plug_handler, plugged_dev, errp);

     }

void hotplug_handler_post_plug(HotplugHandler *plug_handler,

                               DeviceState *plugged_dev,

                               Error **errp)

{

    HotplugHandlerClass *hdc = HOTPLUG_HANDLER_GET_CLASS(plug_handler);

    if (hdc->post_plug) {

        hdc->post_plug(plug_handler, plugged_dev, errp);

    }

}


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

                                          uint64_t data,
+
+                                         unsigned size)
+
+{
+
     if (!memory_region_access_valid(mr, addr, size, true)) {

         return; /* FIXME: better signalling */

static void memory_region_dispatch_write(MemoryRegion *mr,

                                         hwaddr addr,

                                         uint64_t data,

                                         unsigned size)

{

    if (!memory_region_access_valid(mr, addr, size, true)) {

        return; /* FIXME: better signalling */

    }

    adjust_endianness(mr, &data, size);

    if (!mr->ops->write) {

        mr->ops->old_mmio.write[bitops_ctzl(size)](mr->opaque, addr, data);

        return;

    }

    /* FIXME: support unaligned access */

    access_with_adjusted_size(addr, &data, size,

                              mr->ops->impl.min_access_size,

                              mr->ops->impl.max_access_size,

                              memory_region_write_accessor, mr);

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
     *value = base_address_with_flags(&s->real_device.io_regions[index]);

+
+    /* set emulate mask depend on BAR flag */
+
+    switch (s->bases[index].bar_flag) {
+
     case XEN_PT_BAR_FLAG_MEM:

         bar_emu_mask = XEN_PT_BAR_MEM_EMU_MASK;

static int xen_pt_bar_reg_read(XenPCIPassthroughState *s, XenPTReg *cfg_entry,

                               uint32_t *value, uint32_t valid_mask)

{

    XenPTRegInfo *reg = cfg_entry->reg;

    uint32_t valid_emu_mask = 0;

    uint32_t bar_emu_mask = 0;

    int index;

    /* get BAR index */

    index = xen_pt_bar_offset_to_index(reg->offset);

    if (index < 0 || index >= PCI_NUM_REGIONS - 1) {

        XEN_PT_ERR(&s->dev, "Internal error: Invalid BAR index [%d].\n", index);

        return -1;

    }

    /* use fixed-up value from kernel sysfs */

    *value = base_address_with_flags(&s->real_device.io_regions[index]);

    /* set emulate mask depend on BAR flag */

    switch (s->bases[index].bar_flag) {

    case XEN_PT_BAR_FLAG_MEM:

        bar_emu_mask = XEN_PT_BAR_MEM_EMU_MASK;

        break;

    case XEN_PT_BAR_FLAG_IO:

        bar_emu_mask = XEN_PT_BAR_IO_EMU_MASK;

        break;

    case XEN_PT_BAR_FLAG_UPPER:

        bar_emu_mask = XEN_PT_BAR_ALLF;

        break;

    default:

        break;

    }

    /* emulate BAR */

    valid_emu_mask = bar_emu_mask & valid_mask;

    *value = XEN_PT_MERGE_VALUE(*value, cfg_entry->data, ~valid_emu_mask);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
     regs->ARM_pc = infop->entry;

     regs->ARM_sp = infop->start_stack;
+
+    regs->ARM_r2 = tswapl(stack[2]); /* envp */
+
+    regs->ARM_r1 = tswapl(stack[1]); /* argv */
+
     /* XXX: it seems that r0 is zeroed after ! */

     //    regs->ARM_r0 = tswapl(stack[0]); /* argc */

static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)

{

    target_long *stack = (void *)infop->start_stack;

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

    regs->ARM_cpsr = 0x10;

    regs->ARM_pc = infop->entry;

    regs->ARM_sp = infop->start_stack;

    regs->ARM_r2 = tswapl(stack[2]); /* envp */

    regs->ARM_r1 = tswapl(stack[1]); /* argv */

    /* XXX: it seems that r0 is zeroed after ! */

    //    regs->ARM_r0 = tswapl(stack[0]); /* argc */

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static uint64_t fw_cfg_data_mem_read(void *opaque, hwaddr addr,

+                                     unsigned size)
+
 {

     return fw_cfg_read(opaque);

static uint64_t fw_cfg_data_mem_read(void *opaque, hwaddr addr,

                                     unsigned size)

{

    return fw_cfg_read(opaque);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static inline uint16_t mipsdsp_sat16_sub(int16_t a, int16_t b,

                                          CPUMIPSState *env)
+
+{

     int16_t  temp;

static inline uint16_t mipsdsp_sat16_sub(int16_t a, int16_t b,

                                         CPUMIPSState *env)

{

    int16_t  temp;

    temp = a - b;

    if (MIPSDSP_OVERFLOW(a, -b, temp, 0x8000)) {

        if (a > 0) {

            temp = 0x7FFF;

        } else {

            temp = 0x8000;

        }

        set_DSPControl_overflow_flag(1, 20, env);

    }

    return temp;

}


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

     uint64_t value;
+
+    int r = read(e->fd, &value, sizeof(value));

     return r == sizeof(value);

int event_notifier_test_and_clear(EventNotifier *e)

{

    uint64_t value;

    int r = read(e->fd, &value, sizeof(value));

    return r == sizeof(value);

}


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

     ST(PARAM1) /= ST0;

void OPPROTO op_fdiv_STN_ST0(void)

{

    ST(PARAM1) /= ST0;

}


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

     qemu_mutex_init(&fit_buf->lock);
+
+    fit_buf->fit = g_array_new(false, true /* clear */, 1);

 }

static void nvdimm_init_fit_buffer(NvdimmFitBuffer *fit_buf)

{

    qemu_mutex_init(&fit_buf->lock);

    fit_buf->fit = g_array_new(false, true /* clear */, 1);

}


--- a/source.c
+++ b/source.c
@@ -7,10 +7,10 @@
     const char *device = qdict_get_str(qdict, "device");

     const char *base = qdict_get_try_str(qdict, "base");
+
+
+
+    qmp_block_stream(device, base != NULL, base, &error);

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

{

    Error *error = NULL;

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

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

    qmp_block_stream(device, base != NULL, base, &error);

    hmp_handle_error(mon, &error);

}


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

     default:
+
+        printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr);
+
+        break;
+
     }

 }

static void pxa2xx_cm_write(void *opaque, hwaddr addr,

                            uint64_t value, unsigned size)

{

    PXA2xxState *s = (PXA2xxState *) opaque;

    switch (addr) {

    case CCCR:

    case CKEN:

        s->cm_regs[addr >> 2] = value;

        break;

    case OSCC:

        s->cm_regs[addr >> 2] &= ~0x6c;

        s->cm_regs[addr >> 2] |= value & 0x6e;

        if ((value >> 1) & 1)			/* OON */

            s->cm_regs[addr >> 2] |= 1 << 0;	/* Oscillator is now stable */

        break;

    default:

        printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr);

        break;

    }

}


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

             PRINT_DEBUG_EXTEND("%s [0x%04x] -> 0x%04x\n", reg_p->name,

+                                   (uint32_t)offset, s->reg[i]);
+
+            return s->reg[i];
+
+        }

         reg_p++;

static uint64_t exynos4210_pmu_read(void *opaque, target_phys_addr_t offset,

                                    unsigned size)

{

    Exynos4210PmuState *s = (Exynos4210PmuState *)opaque;

    unsigned i;

    const Exynos4210PmuReg *reg_p = exynos4210_pmu_regs;

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

        if (reg_p->offset == offset) {

            PRINT_DEBUG_EXTEND("%s [0x%04x] -> 0x%04x\n", reg_p->name,

                                   (uint32_t)offset, s->reg[i]);

            return s->reg[i];

        }

        reg_p++;

    }

    PRINT_DEBUG("QEMU PMU ERROR: bad read offset 0x%04x\n", (uint32_t)offset);

    return 0;

}


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

     xen_be_printf(xendev, 2, "bind evtchn port %d\n", xendev->local_port);
+
+    qemu_set_fd_handler(xc_evtchn_fd(xendev->evtchndev),
+
+                        xen_be_evtchn_event, NULL, xendev);
+
     return 0;

 }

int xen_be_bind_evtchn(struct XenDevice *xendev)

{

    if (xendev->local_port != -1) {

        return 0;

    }

    xendev->local_port = xc_evtchn_bind_interdomain

        (xendev->evtchndev, xendev->dom, xendev->remote_port);

    if (xendev->local_port == -1) {

        xen_be_printf(xendev, 0, "xc_evtchn_bind_interdomain failed\n");

        return -1;

    }

    xen_be_printf(xendev, 2, "bind evtchn port %d\n", xendev->local_port);

    qemu_set_fd_handler(xc_evtchn_fd(xendev->evtchndev),

                        xen_be_evtchn_event, NULL, xendev);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
     if (isabus->assigned & (1 << isairq)) {

         hw_error("isa irq %d already assigned", isairq);
+
+    }
+
+    isabus->assigned |= (1 << isairq);
+
     return isabus->irqs[isairq];

 }

qemu_irq isa_reserve_irq(int isairq)

{

    if (isairq < 0 || isairq > 15) {

        hw_error("isa irq %d invalid", isairq);

    }

    if (isabus->assigned & (1 << isairq)) {

        hw_error("isa irq %d already assigned", isairq);

    }

    isabus->assigned |= (1 << isairq);

    return isabus->irqs[isairq];

}


static void tcx_stip_writel(void *opaque, hwaddr addr,

                            uint64_t val, unsigned size)

{

    TCXState *s = opaque;

    int i;

    uint32_t col;

    if (!(addr & 4)) {

        s->tmpblit = val;

    } else {

        addr = (addr >> 3) & 0xfffff;

        col = cpu_to_be32(s->tmpblit);

        if (s->depth == 24) {

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

                if (val & 0x80000000) {

                    s->vram[addr + i] = s->tmpblit;

                    s->vram24[addr + i] = col;

                }

                val <<= 1;

            }

        } else {

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

                if (val & 0x80000000) {

                    s->vram[addr + i] = s->tmpblit;

                }

                val <<= 1;

            }

        }

        memory_region_set_dirty(&s->vram_mem, addr, 32);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static enum AVHWDeviceType hw_device_match_type_by_hwaccel(enum HWAccelID hwaccel_id)
+
+{
+
+    int i;

     if (hwaccel_id == HWACCEL_NONE)

static enum AVHWDeviceType hw_device_match_type_by_hwaccel(enum HWAccelID hwaccel_id)

{

    int i;

    if (hwaccel_id == HWACCEL_NONE)

        return AV_HWDEVICE_TYPE_NONE;

    for (i = 0; hwaccels[i].name; i++) {

        if (hwaccels[i].id == hwaccel_id)

            return hwaccels[i].device_type;

    }

    return AV_HWDEVICE_TYPE_NONE;

}


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

 {

static void error_mem_write(void *opaque, hwaddr addr,

                            uint64_t value, unsigned size)

{

    abort();

}


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

+    DPRINTF("Cancel tag=0x%x\n", req->tag);
+
+    if (r->req.aiocb) {
+
+        bdrv_aio_cancel(r->req.aiocb);

static void scsi_cancel_io(SCSIRequest *req)

{

    SCSIDiskReq *r = DO_UPCAST(SCSIDiskReq, req, req);

    DPRINTF("Cancel tag=0x%x\n", req->tag);

    if (r->req.aiocb) {

        bdrv_aio_cancel(r->req.aiocb);

        /* This reference was left in by scsi_*_data.  We take ownership of

         * it the moment scsi_req_cancel is called, independent of whether

         * bdrv_aio_cancel completes the request or not.  */

        scsi_req_unref(&r->req);

    }

    r->req.aiocb = NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static void adb_mouse_event(void *opaque,
+
+                            int dx1, int dy1, int dz1, int buttons_state)
+
+{
+
     MouseState *s = opaque;

static void adb_mouse_event(void *opaque,

                            int dx1, int dy1, int dz1, int buttons_state)

{

    MouseState *s = opaque;

    s->dx += dx1;

    s->dy += dy1;

    s->dz += dz1;

    s->buttons_state = buttons_state;

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     bkt.max = 15;
     bkt.level = 1.5;
     /* leak an op work of time */
+    throttle_leak_bucket(&bkt, NANOSECONDS_PER_SECOND / 150);
+    g_assert(bkt.avg == 150);
+    g_assert(bkt.max == 15);
+    g_assert(double_cmp(bkt.level, 0.5));
+    /* leak again emptying the bucket */
     throttle_leak_bucket(&bkt, NANOSECONDS_PER_SECOND / 150);
     g_assert(bkt.avg == 150);
     g_assert(bkt.max == 15);

static void test_leak_bucket(void)
{
    throttle_config_init(&cfg);
    bkt = cfg.buckets[THROTTLE_BPS_TOTAL];
    /* set initial value */
    bkt.avg = 150;
    bkt.max = 15;
    bkt.level = 1.5;
    /* leak an op work of time */
    throttle_leak_bucket(&bkt, NANOSECONDS_PER_SECOND / 150);
    g_assert(bkt.avg == 150);
    g_assert(bkt.max == 15);
    g_assert(double_cmp(bkt.level, 0.5));
    /* leak again emptying the bucket */
    throttle_leak_bucket(&bkt, NANOSECONDS_PER_SECOND / 150);
    g_assert(bkt.avg == 150);
    g_assert(bkt.max == 15);
    g_assert(double_cmp(bkt.level, 0));
    /* check that the bucket level won't go lower */
    throttle_leak_bucket(&bkt, NANOSECONDS_PER_SECOND / 150);
    g_assert(bkt.avg == 150);
    g_assert(bkt.max == 15);
    g_assert(double_cmp(bkt.level, 0));
}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int smc_decode_init(AVCodecContext *avctx)
+
+{
+
+    SmcContext *s = avctx->priv_data;
+

     s->avctx = avctx;

static int smc_decode_init(AVCodecContext *avctx)

{

    SmcContext *s = avctx->priv_data;

    s->avctx = avctx;

    avctx->pix_fmt = PIX_FMT_PAL8;

    dsputil_init(&s->dsp, avctx);

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

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,28 +1,28 @@
 static void adx_decode(short *out,const unsigned char *in,PREV *prev)
+
+{
+
+	int scale = ((in[0]<<8)|(in[1]));
+
+	int i;
+
+	int s0,s1,s2,d;
+
+
+
+//	printf("%x ",scale);
+
+

+	in+=2;

 	s1 = prev->s1;

 	s2 = prev->s2;

 	for(i=0;i<16;i++) {
+
+		d = in[i];

 		// d>>=4; if (d&8) d-=16;

static void adx_decode(short *out,const unsigned char *in,PREV *prev)

{

	int scale = ((in[0]<<8)|(in[1]));

	int i;

	int s0,s1,s2,d;

//	printf("%x ",scale);

	in+=2;

	s1 = prev->s1;

	s2 = prev->s2;

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

		d = in[i];

		// d>>=4; if (d&8) d-=16;

		d = ((signed char)d >> 4);

		s0 = (BASEVOL*d*scale + SCALE1*s1 - SCALE2*s2)>>14;

		CLIP(s0);

		*out++=s0;

		s2 = s1;

		s1 = s0;

		d = in[i];

		//d&=15; if (d&8) d-=16;

		d = ((signed char)(d<<4) >> 4);

		s0 = (BASEVOL*d*scale + SCALE1*s1 - SCALE2*s2)>>14;

		CLIP(s0);

		*out++=s0;

		s2 = s1;

		s1 = s0;

	}

	prev->s1 = s1;

	prev->s2 = s2;

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 float64 float64_scalbn( float64 a, int n STATUS_PARAM )

+{

     flag aSign;

     int16 aExp;

+    uint64_t aSig;

float64 float64_scalbn( float64 a, int n STATUS_PARAM )

{

    flag aSign;

    int16 aExp;

    uint64_t aSig;

    a = float64_squash_input_denormal(a STATUS_VAR);

    aSig = extractFloat64Frac( a );

    aExp = extractFloat64Exp( a );

    aSign = extractFloat64Sign( a );

    if ( aExp == 0x7FF ) {

        return a;

    }

    if ( aExp != 0 )

        aSig |= LIT64( 0x0010000000000000 );

    else if ( aSig == 0 )

        return a;

    aExp += n - 1;

    aSig <<= 10;

    return normalizeRoundAndPackFloat64( aSign, aExp, aSig STATUS_VAR );

}


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

 {
+
+    uint8_t *v = pv;

     qemu_put_buffer(f, v, size);

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

{

    uint8_t *v = pv;

    qemu_put_buffer(f, v, size);

}


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

 {

+    IscsiLun *iscsilun = opaque;
+
+
+
+    aio_context_acquire(iscsilun->aio_context);

     if (iscsi_get_nops_in_flight(iscsilun->iscsi) >= MAX_NOP_FAILURES) {

static void iscsi_nop_timed_event(void *opaque)

{

    IscsiLun *iscsilun = opaque;

    aio_context_acquire(iscsilun->aio_context);

    if (iscsi_get_nops_in_flight(iscsilun->iscsi) >= MAX_NOP_FAILURES) {

        error_report("iSCSI: NOP timeout. Reconnecting...");

        iscsilun->request_timed_out = true;

    } else if (iscsi_nop_out_async(iscsilun->iscsi, NULL, NULL, 0, NULL) != 0) {

        error_report("iSCSI: failed to sent NOP-Out. Disabling NOP messages.");

        goto out;

    }

    timer_mod(iscsilun->nop_timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + NOP_INTERVAL);

    iscsi_set_events(iscsilun);

out:

    aio_context_release(iscsilun->aio_context);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static block_number_t eckd_block_num(BootMapPointer *p)
+
+{
+
+    const uint64_t sectors = virtio_get_sectors();
+
     const uint64_t heads = virtio_get_heads();

     const uint64_t cylinder = p->eckd.cylinder

static block_number_t eckd_block_num(BootMapPointer *p)

{

    const uint64_t sectors = virtio_get_sectors();

    const uint64_t heads = virtio_get_heads();

    const uint64_t cylinder = p->eckd.cylinder

                            + ((p->eckd.head & 0xfff0) << 12);

    const uint64_t head = p->eckd.head & 0x000f;

    const block_number_t block = sectors * heads * cylinder

                               + sectors * head

                               + p->eckd.sector

                               - 1; /* block nr starts with zero */

    return block;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static inline uint32_t efsctui(uint32_t val)
+
+{
+
+    CPU_FloatU u;
+

     u.l = val;

static inline uint32_t efsctui(uint32_t val)

{

    CPU_FloatU u;

    u.l = val;

    /* NaN are not treated the same way IEEE 754 does */

    if (unlikely(float32_is_nan(u.f)))

        return 0;

    return float32_to_uint32(u.f, &env->vec_status);

}


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

     s->create_type = g_strdup(ct);
+
+    s->desc_offset = 0;
+
+    ret = vmdk_parse_extents(buf, bs, bs->file->exact_filename, errp);
+
 exit:

     return ret;

static int vmdk_open_desc_file(BlockDriverState *bs, int flags, char *buf,

                               Error **errp)

{

    int ret;

    char ct[128];

    BDRVVmdkState *s = bs->opaque;

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

        error_setg(errp, "invalid VMDK image descriptor");

        ret = -EINVAL;

        goto exit;

    }

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

        strcmp(ct, "vmfs") &&

        strcmp(ct, "vmfsSparse") &&

        strcmp(ct, "twoGbMaxExtentSparse") &&

        strcmp(ct, "twoGbMaxExtentFlat")) {

        error_setg(errp, "Unsupported image type '%s'", ct);

        ret = -ENOTSUP;

        goto exit;

    }

    s->create_type = g_strdup(ct);

    s->desc_offset = 0;

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

exit:

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
+static XICSState *xics_system_init(int nr_servers, int nr_irqs)

 {
+
+    XICSState *icp = NULL;
+

+
     if (kvm_enabled()) {

+        QemuOpts *machine_opts = qemu_get_machine_opts();

         bool irqchip_allowed = qemu_opt_get_bool(machine_opts,

static XICSState *xics_system_init(int nr_servers, int nr_irqs)

{

    XICSState *icp = NULL;

    if (kvm_enabled()) {

        QemuOpts *machine_opts = qemu_get_machine_opts();

        bool irqchip_allowed = qemu_opt_get_bool(machine_opts,

                                                "kernel_irqchip", true);

        bool irqchip_required = qemu_opt_get_bool(machine_opts,

                                                  "kernel_irqchip", false);

        Error *err = NULL;

        if (irqchip_allowed) {

            icp = try_create_xics(TYPE_KVM_XICS, nr_servers, nr_irqs, &err);

        }

        if (irqchip_required && !icp) {

            error_report("kernel_irqchip requested but unavailable: %s",

                         error_get_pretty(err));

        }

    }

    if (!icp) {

        icp = try_create_xics(TYPE_XICS, nr_servers, nr_irqs, &error_abort);

    }

    return icp;

}


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

     QmpInputVisitor *qiv = to_qiv(v);
+
+    const QObject *qobj = qmp_input_get_object(qiv, name);

static void qmp_input_start_struct(Visitor *v, void **obj, const char *kind,

                                   const char *name, size_t size, Error **errp)

{

    QmpInputVisitor *qiv = to_qiv(v);

    const QObject *qobj = qmp_input_get_object(qiv, name);

    if (!qobj || qobject_type(qobj) != QTYPE_QDICT) {

        error_set(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",

                  "QDict");

        return;

    }

    qmp_input_push(qiv, qobj, errp);

    if (error_is_set(errp)) {

        return;

    }

    if (obj) {

        *obj = g_malloc0(size);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void buffer_append(Buffer *buffer, const void *data, size_t len)

 {

static void buffer_append(Buffer *buffer, const void *data, size_t len)

{

    memcpy(buffer->buffer + buffer->offset, data, len);

    buffer->offset += len;

}