--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 yuv2rgb48_2_c_template(SwsContext *c, const int32_t *buf[2],

+                       const int32_t *ubuf[2], const int32_t *vbuf[2],
+
                        const int32_t *abuf[2], uint16_t *dest, int dstW,

                        int yalpha, int uvalpha, int y,

yuv2rgb48_2_c_template(SwsContext *c, const int32_t *buf[2],

                       const int32_t *ubuf[2], const int32_t *vbuf[2],

                       const int32_t *abuf[2], uint16_t *dest, int dstW,

                       int yalpha, int uvalpha, int y,

                       enum PixelFormat target)

{

    const int32_t *buf0  = buf[0],  *buf1  = buf[1],

                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],

                  *vbuf0 = vbuf[0], *vbuf1 = vbuf[1];

    int  yalpha1 = 4095 - yalpha;

    int uvalpha1 = 4095 - uvalpha;

    int i;

    for (i = 0; i < ((dstW + 1) >> 1); i++) {

        int Y1 = (buf0[i * 2]     * yalpha1  + buf1[i * 2]     * yalpha) >> 14;

        int Y2 = (buf0[i * 2 + 1] * yalpha1  + buf1[i * 2 + 1] * yalpha) >> 14;

        int U  = (ubuf0[i]        * uvalpha1 + ubuf1[i]        * uvalpha + (-128 << 23)) >> 14;

        int V  = (vbuf0[i]        * uvalpha1 + vbuf1[i]        * uvalpha + (-128 << 23)) >> 14;

        int R, G, B;

        Y1 -= c->yuv2rgb_y_offset;

        Y2 -= c->yuv2rgb_y_offset;

        Y1 *= c->yuv2rgb_y_coeff;

        Y2 *= c->yuv2rgb_y_coeff;

        Y1 += 1 << 13;

        Y2 += 1 << 13;

        R = V * c->yuv2rgb_v2r_coeff;

        G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;

        B =                            U * c->yuv2rgb_u2b_coeff;

        output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);

        output_pixel(&dest[1], av_clip_uintp2(  G + Y1, 30) >> 14);

        output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);

        output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14);

        output_pixel(&dest[4], av_clip_uintp2(  G + Y2, 30) >> 14);

        output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14);

        dest += 6;

    }

}


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

     if (qobject_type(obj) != QTYPE_QFLOAT)

QFloat *qobject_to_qfloat(const QObject *obj)

{

    if (qobject_type(obj) != QTYPE_QFLOAT)

        return NULL;

    return container_of(obj, QFloat, base);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+int qemu_fclose(QEMUFile *f)

+{
+
     int ret = 0;

     qemu_fflush(f);

int qemu_fclose(QEMUFile *f)

{

    int ret = 0;

    qemu_fflush(f);

    if (f->close)

        ret = f->close(f->opaque);

    g_free(f);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+int vnc_display_pw_expire(DisplayState *ds, time_t expires)
 {
     VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
     vs->expires = expires;

int vnc_display_pw_expire(DisplayState *ds, time_t expires)
{
    VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
    vs->expires = expires;
    return 0;


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

 {

+    int64_t now, last;
+
+    QEMUClock *clock = qemu_clock_ptr(type);
+
+

     switch (type) {

int64_t qemu_clock_get_ns(QEMUClockType type)

{

    int64_t now, last;

    QEMUClock *clock = qemu_clock_ptr(type);

    switch (type) {

    case QEMU_CLOCK_REALTIME:

        return get_clock();

    default:

    case QEMU_CLOCK_VIRTUAL:

        if (use_icount) {

            return cpu_get_icount();

        } else {

            return cpu_get_clock();

        }

    case QEMU_CLOCK_HOST:

        now = get_clock_realtime();

        last = clock->last;

        clock->last = now;

        if (now < last) {

            notifier_list_notify(&clock->reset_notifiers, &now);

        }

        return now;

    case QEMU_CLOCK_VIRTUAL_RT:

        return cpu_get_clock();

    }

}


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

         break;

+    case SOCKET_ADDRESS_KIND_UNIX:
+
+        return snprintf(dest, max_len, "%sunix:%s%s", prefix,
+
+                        addr->u.q_unix->path, is_listen ? ",server" : "");

         break;

static int SocketAddress_to_str(char *dest, int max_len,

                                const char *prefix, SocketAddress *addr,

                                bool is_listen, bool is_telnet)

{

    switch (addr->type) {

    case SOCKET_ADDRESS_KIND_INET:

        return snprintf(dest, max_len, "%s%s:%s:%s%s", prefix,

                        is_telnet ? "telnet" : "tcp", addr->u.inet->host,

                        addr->u.inet->port, is_listen ? ",server" : "");

        break;

    case SOCKET_ADDRESS_KIND_UNIX:

        return snprintf(dest, max_len, "%sunix:%s%s", prefix,

                        addr->u.q_unix->path, is_listen ? ",server" : "");

        break;

    case SOCKET_ADDRESS_KIND_FD:

        return snprintf(dest, max_len, "%sfd:%s%s", prefix, addr->u.fd->str,

                        is_listen ? ",server" : "");

        break;

    default:

        abort();

    }

}


static uint16_t pci_req_id_cache_extract(PCIReqIDCache *cache)

{

    uint8_t bus_n;

    uint16_t result;

    switch (cache->type) {

    case PCI_REQ_ID_BDF:

        result = pci_get_bdf(cache->dev);

        break;

    case PCI_REQ_ID_SECONDARY_BUS:

        bus_n = pci_bus_num(cache->dev->bus);

        result = PCI_BUILD_BDF(bus_n, 0);

        break;

    default:

        error_printf("Invalid PCI requester ID cache type: %d\n",

                     cache->type);

        exit(1);

        break;

    }

    return result;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 int qemu_opt_foreach(QemuOpts *opts, qemu_opt_loopfunc func, void *opaque,
+
+                     int abort_on_failure)
+
+{
+
     QemuOpt *opt;

     int rc = 0;

int qemu_opt_foreach(QemuOpts *opts, qemu_opt_loopfunc func, void *opaque,

                     int abort_on_failure)

{

    QemuOpt *opt;

    int rc = 0;

    TAILQ_FOREACH(opt, &opts->head, next) {

        rc = func(opt->name, opt->str, opaque);

        if (abort_on_failure  &&  rc != 0)

            break;

    }

    return rc;

}


--- a/source.c
+++ b/source.c
@@ -9,10 +9,10 @@
         cur = pktl;

         pktl = cur->next;
+
+        av_free_packet(&cur->pkt);
+
+        av_free(cur);

     }

static void free_packet_list(AVPacketList *pktl)

{

    AVPacketList *cur;

    while (pktl) {

        cur = pktl;

        pktl = cur->next;

        av_free_packet(&cur->pkt);

        av_free(cur);

    }

}


--- a/source.c
+++ b/source.c
@@ -5,5 +5,5 @@
     return (s->compat_flags & E1000_FLAG_AUTONEG) &&

            (s->phy_reg[PHY_CTRL] & MII_CR_AUTO_NEG_EN);
+
+}

have_autoneg(E1000State *s)

{

    return (s->compat_flags & E1000_FLAG_AUTONEG) &&

           (s->phy_reg[PHY_CTRL] & MII_CR_AUTO_NEG_EN);

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
 #endif

     if (s->aflag) {
+
+        gen_op_addl_EDI_T0();
+
+    } else {
+
         gen_op_addw_EDI_T0();

     }

static inline void gen_scas(DisasContext *s, int ot)

{

    gen_op_mov_TN_reg(OT_LONG, 0, R_EAX);

    gen_string_movl_A0_EDI(s);

    gen_op_ld_T1_A0(ot + s->mem_index);

    gen_op_cmpl_T0_T1_cc();

    gen_op_movl_T0_Dshift[ot]();

#ifdef TARGET_X86_64

    if (s->aflag == 2) {

        gen_op_addq_EDI_T0();

    } else

#endif

    if (s->aflag) {

        gen_op_addl_EDI_T0();

    } else {

        gen_op_addw_EDI_T0();

    }

}


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

static void breakpoint_invalidate(CPUState *env, target_ulong pc)

{

    target_ulong phys_addr;

    phys_addr = cpu_get_phys_page_debug(env, pc);

    tb_invalidate_phys_page_range(phys_addr, phys_addr + 1, 0);

}


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

     av_freep(&ctx->qmatrix_l);

+    av_freep(&ctx->qmatrix_c16);
+
+    av_freep(&ctx->qmatrix_l16);
+
+

     for (i = 1; i < avctx->thread_count; i++)

static av_cold int dnxhd_encode_end(AVCodecContext *avctx)

{

    DNXHDEncContext *ctx = avctx->priv_data;

    int max_level        = 1 << (ctx->cid_table->bit_depth + 2);

    int i;

    av_free(ctx->vlc_codes - max_level * 2);

    av_free(ctx->vlc_bits - max_level * 2);

    av_freep(&ctx->run_codes);

    av_freep(&ctx->run_bits);

    av_freep(&ctx->mb_bits);

    av_freep(&ctx->mb_qscale);

    av_freep(&ctx->mb_rc);

    av_freep(&ctx->mb_cmp);

    av_freep(&ctx->slice_size);

    av_freep(&ctx->slice_offs);

    av_freep(&ctx->qmatrix_c);

    av_freep(&ctx->qmatrix_l);

    av_freep(&ctx->qmatrix_c16);

    av_freep(&ctx->qmatrix_l16);

    for (i = 1; i < avctx->thread_count; i++)

        av_freep(&ctx->thread[i]);

    av_frame_free(&avctx->coded_frame);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -29,11 +29,11 @@
     avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);

     avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
+
+    avctx->coded_frame= avcodec_alloc_frame();
+
+
+

     return 0;

static av_cold int pcm_encode_init(AVCodecContext *avctx)

{

    avctx->frame_size = 0;

    switch(avctx->codec->id) {

    case CODEC_ID_PCM_ALAW:

        pcm_alaw_tableinit();

        break;

    case CODEC_ID_PCM_MULAW:

        pcm_ulaw_tableinit();

        break;

    default:

        break;

    }

    avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);

    avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;

    avctx->coded_frame= avcodec_alloc_frame();

    return 0;

}


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

     RamDevice *d;

+

     /* allocate RAM */

static void ram_init(target_phys_addr_t addr, ram_addr_t RAM_size,

                     uint64_t max_mem)

{

    DeviceState *dev;

    SysBusDevice *s;

    RamDevice *d;

    /* allocate RAM */

    if ((uint64_t)RAM_size > max_mem) {

        fprintf(stderr,

                "qemu: Too much memory for this machine: %d, maximum %d\n",

                (unsigned int)(RAM_size / (1024 * 1024)),

                (unsigned int)(max_mem / (1024 * 1024)));

        exit(1);

    }

    dev = qdev_create(NULL, "memory");

    s = sysbus_from_qdev(dev);

    d = FROM_SYSBUS(RamDevice, s);

    d->size = RAM_size;

    qdev_init(dev);

    sysbus_mmio_map(s, 0, addr);

}


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

+    if (len == 2)
+
+        return avio_rl16(bc);
+
+    else if (len == 4)

         return avio_rl32(bc);

static uint64_t get_fourcc(AVIOContext *bc)

{

    unsigned int len = ffio_read_varlen(bc);

    if (len == 2)

        return avio_rl16(bc);

    else if (len == 4)

        return avio_rl32(bc);

    else

        return -1;

}


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

+    printf("Reset PowerPC chip\n");

     cpu_ppc_reset(env);

void ppc40x_chip_reset (CPUState *env)

{

    target_ulong dbsr;

    printf("Reset PowerPC chip\n");

    cpu_ppc_reset(env);

    /* XXX: TODO reset all internal peripherals */

    dbsr = env->spr[SPR_40x_DBSR];

    dbsr &= ~0x00000300;

    dbsr |= 0x00000200;

    env->spr[SPR_40x_DBSR] = dbsr;

    cpu_loop_exit();

}


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

                                  void *data, int *data_size,

+                                 AVPacket *avpkt)

 {

static int dvvideo_decode_frame(AVCodecContext *avctx,

                                 void *data, int *data_size,

                                 AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size = avpkt->size;

    DVVideoContext *s = avctx->priv_data;

    s->sys = dv_frame_profile(buf);

    if (!s->sys || buf_size < s->sys->frame_size || dv_init_dynamic_tables(s->sys))

        return -1; /* NOTE: we only accept several full frames */

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

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

    s->picture.reference = 0;

    s->picture.key_frame = 1;

    s->picture.pict_type = FF_I_TYPE;

    avctx->pix_fmt   = s->sys->pix_fmt;

    avctx->time_base = s->sys->time_base;

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

    if (avctx->get_buffer(avctx, &s->picture) < 0) {

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

        return -1;

    }

    s->picture.interlaced_frame = 1;

    s->picture.top_field_first  = 0;

    s->buf = buf;

    avctx->execute(avctx, dv_decode_video_segment, s->sys->work_chunks, NULL,

                   dv_work_pool_size(s->sys), sizeof(DVwork_chunk));

    emms_c();

    /* return image */

    *data_size = sizeof(AVFrame);

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

    return s->sys->frame_size;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int16_t square_root(int val)

 {

static int16_t square_root(int val)

{

    return (ff_sqrt(val << 1) >> 1) & (~1);

}


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

 {

+    DeviceState *dev = DEVICE(sbd);

     OMAPI2CState *s = OMAP_I2C(dev);
+

     if (!s->fclk) {

static int omap_i2c_init(SysBusDevice *sbd)

{

    DeviceState *dev = DEVICE(sbd);

    OMAPI2CState *s = OMAP_I2C(dev);

    if (!s->fclk) {

        hw_error("omap_i2c: fclk not connected\n");

    }

    if (s->revision >= OMAP2_INTR_REV && !s->iclk) {

        /* Note that OMAP1 doesn't have a separate interface clock */

        hw_error("omap_i2c: iclk not connected\n");

    }

    sysbus_init_irq(sbd, &s->irq);

    sysbus_init_irq(sbd, &s->drq[0]);

    sysbus_init_irq(sbd, &s->drq[1]);

    memory_region_init_io(&s->iomem, OBJECT(s), &omap_i2c_ops, s, "omap.i2c",

                          (s->revision < OMAP2_INTR_REV) ? 0x800 : 0x1000);

    sysbus_init_mmio(sbd, &s->iomem);

    s->bus = i2c_init_bus(dev, NULL);

    return 0;

}


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

 {

+    received_sigterm = sig;

     received_nb_signals++;

sigterm_handler(int sig)

{

    received_sigterm = sig;

    received_nb_signals++;

    term_exit_sigsafe();

    if(received_nb_signals > 3)

        exit_program(123);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static float get_band_cost_ZERO_mips(struct AACEncContext *s,

                                      PutBitContext *pb, const float *in,

static float get_band_cost_ZERO_mips(struct AACEncContext *s,

                                     PutBitContext *pb, const float *in,

                                     const float *scaled, int size, int scale_idx,

                                     int cb, const float lambda, const float uplim,

                                     int *bits)

{

    int i;

    float cost = 0;

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

        cost += in[i  ] * in[i  ];

        cost += in[i+1] * in[i+1];

        cost += in[i+2] * in[i+2];

        cost += in[i+3] * in[i+3];

    }

    if (bits)

        *bits = 0;

    return cost * lambda;

}


static inline unsigned long align_sigframe(unsigned long sp)

{

    unsigned long i;

    i = sp & ~3UL;

    return i;

}


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

                                                USBPacket *p, uint8_t ep)

+{
+
     /* Output interrupt endpoint, normal async operation */

     struct usb_redir_interrupt_packet_header interrupt_packet;
@@ -12,7 +12,7 @@

+    DPRINTF("interrupt-out ep %02X len %zd id %"PRIu64"\n", ep,

             p->iov.size, p->id);

static void usbredir_handle_interrupt_out_data(USBRedirDevice *dev,

                                               USBPacket *p, uint8_t ep)

{

    /* Output interrupt endpoint, normal async operation */

    struct usb_redir_interrupt_packet_header interrupt_packet;

    uint8_t buf[p->iov.size];

    DPRINTF("interrupt-out ep %02X len %zd id %"PRIu64"\n", ep,

            p->iov.size, p->id);

    if (usbredir_already_in_flight(dev, p->id)) {

        p->status = USB_RET_ASYNC;

        return;

    }

    interrupt_packet.endpoint  = ep;

    interrupt_packet.length    = p->iov.size;

    usb_packet_copy(p, buf, p->iov.size);

    usbredir_log_data(dev, "interrupt data out:", buf, p->iov.size);

    usbredirparser_send_interrupt_packet(dev->parser, p->id,

                                    &interrupt_packet, buf, p->iov.size);

    usbredirparser_do_write(dev->parser);

    p->status = USB_RET_ASYNC;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,

                                    struct in_addr my_ip)
+
+{
+
+    AVFormatContext *avc;
+
     AVStream avs[MAX_STREAMS];

     int i;

static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,

                                   struct in_addr my_ip)

{

    AVFormatContext *avc;

    AVStream avs[MAX_STREAMS];

    int i;

    avc =  avformat_alloc_context();

    if (avc == NULL) {

        return -1;

    }

    av_metadata_set2(&avc->metadata, "title",

                     stream->title[0] ? stream->title : "No Title", 0);

    avc->nb_streams = stream->nb_streams;

    if (stream->is_multicast) {

        snprintf(avc->filename, 1024, "rtp://%s:%d?multicast=1?ttl=%d",

                 inet_ntoa(stream->multicast_ip),

                 stream->multicast_port, stream->multicast_ttl);

    } else {

        snprintf(avc->filename, 1024, "rtp://0.0.0.0");

    }

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

        avc->streams[i] = &avs[i];

        avc->streams[i]->codec = stream->streams[i]->codec;

    }

    *pbuffer = av_mallocz(2048);

    avf_sdp_create(&avc, 1, *pbuffer, 2048);

    av_free(avc);

    return strlen(*pbuffer);

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
                                                         bool resolve_subpage)

 {
+
+    MemoryRegionSection *section;
+
+    subpage_t *subpage;
+

     section = phys_page_find(d->phys_map, addr, d->map.nodes, d->map.sections);

static MemoryRegionSection *address_space_lookup_region(AddressSpaceDispatch *d,

                                                        hwaddr addr,

                                                        bool resolve_subpage)

{

    MemoryRegionSection *section;

    subpage_t *subpage;

    section = phys_page_find(d->phys_map, addr, d->map.nodes, d->map.sections);

    if (resolve_subpage && section->mr->subpage) {

        subpage = container_of(section->mr, subpage_t, iomem);

        section = &d->map.sections[subpage->sub_section[SUBPAGE_IDX(addr)]];

    }

    return section;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+void bdrv_set_dirty(BlockDriverState *bs, int64_t cur_sector,

                     int nr_sectors)

void bdrv_set_dirty(BlockDriverState *bs, int64_t cur_sector,

                    int nr_sectors)

{

    BdrvDirtyBitmap *bitmap;

    QLIST_FOREACH(bitmap, &bs->dirty_bitmaps, list) {

        hbitmap_set(bitmap->bitmap, cur_sector, nr_sectors);

    }

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     if (ranges_overlap(address, len, PIIX_PIRQC, 4)) {

         PIIX3State *piix3 = PIIX3_PCI_DEVICE(dev);
+
+        int pic_irq;
+
+
+
         pci_bus_fire_intx_routing_notifier(piix3->dev.bus);

         piix3_update_irq_levels(piix3);

static void piix3_write_config(PCIDevice *dev,

                               uint32_t address, uint32_t val, int len)

{

    pci_default_write_config(dev, address, val, len);

    if (ranges_overlap(address, len, PIIX_PIRQC, 4)) {

        PIIX3State *piix3 = PIIX3_PCI_DEVICE(dev);

        int pic_irq;

        pci_bus_fire_intx_routing_notifier(piix3->dev.bus);

        piix3_update_irq_levels(piix3);

        for (pic_irq = 0; pic_irq < PIIX_NUM_PIC_IRQS; pic_irq++) {

            piix3_set_irq_pic(piix3, pic_irq);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -25,11 +25,11 @@
                 TAPState *s = vc->opaque;

+
+                if (strcmp(vc->model, "tap") == 0 &&
+
+                    sscanf(vc->info_str, "ifname=%63s ", ifname) == 1 &&
+
                     s->down_script[0])

                     launch_script(s->down_script, ifname, s->fd);

void net_cleanup(void)

{

    VLANState *vlan;

#if !defined(_WIN32)

    /* close network clients */

    for(vlan = first_vlan; vlan != NULL; vlan = vlan->next) {

        VLANClientState *vc;

        for(vc = vlan->first_client; vc != NULL; vc = vc->next) {

            if (vc->fd_read == tap_receive) {

                char ifname[64];

                TAPState *s = vc->opaque;

                if (strcmp(vc->model, "tap") == 0 &&

                    sscanf(vc->info_str, "ifname=%63s ", ifname) == 1 &&

                    s->down_script[0])

                    launch_script(s->down_script, ifname, s->fd);

            }

#if defined(CONFIG_VDE)

            if (vc->fd_read == vde_from_qemu) {

                VDEState *s = vc->opaque;

                vde_close(s->vde);

            }

#endif

        }

    }

#endif

}


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

                      const char *kind, const char *name,

+                     Error **errp)
+
 {

     int64_t value = 0;

+    char *enum_str;

void input_type_enum(Visitor *v, int *obj, const char *strings[],

                     const char *kind, const char *name,

                     Error **errp)

{

    int64_t value = 0;

    char *enum_str;

    assert(strings);

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

    if (error_is_set(errp)) {

        return;

    }

    while (strings[value] != NULL) {

        if (strcmp(strings[value], enum_str) == 0) {

            break;

        }

        value++;

    }

    if (strings[value] == NULL) {

        error_set(errp, QERR_INVALID_PARAMETER, enum_str);

        g_free(enum_str);

        return;

    }

    g_free(enum_str);

    *obj = value;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     rgb15to16       = RENAME(rgb15to16);

     rgb15tobgr24    = RENAME(rgb15tobgr24);
+
+    rgb15to32       = RENAME(rgb15to32);
+
+    rgb16tobgr24    = RENAME(rgb16tobgr24);
+
     rgb16to32       = RENAME(rgb16to32);

     rgb16to15       = RENAME(rgb16to15);

static inline void RENAME(rgb2rgb_init)(void)

{

    rgb15to16       = RENAME(rgb15to16);

    rgb15tobgr24    = RENAME(rgb15tobgr24);

    rgb15to32       = RENAME(rgb15to32);

    rgb16tobgr24    = RENAME(rgb16tobgr24);

    rgb16to32       = RENAME(rgb16to32);

    rgb16to15       = RENAME(rgb16to15);

    rgb24tobgr16    = RENAME(rgb24tobgr16);

    rgb24tobgr15    = RENAME(rgb24tobgr15);

    rgb24tobgr32    = RENAME(rgb24tobgr32);

    rgb32to16       = RENAME(rgb32to16);

    rgb32to15       = RENAME(rgb32to15);

    rgb32tobgr24    = RENAME(rgb32tobgr24);

    rgb24to15       = RENAME(rgb24to15);

    rgb24to16       = RENAME(rgb24to16);

    rgb24tobgr24    = RENAME(rgb24tobgr24);

    shuffle_bytes_2103 = RENAME(shuffle_bytes_2103);

    rgb32tobgr16    = RENAME(rgb32tobgr16);

    rgb32tobgr15    = RENAME(rgb32tobgr15);

    yv12toyuy2      = RENAME(yv12toyuy2);

    yv12touyvy      = RENAME(yv12touyvy);

    yuv422ptoyuy2   = RENAME(yuv422ptoyuy2);

    yuv422ptouyvy   = RENAME(yuv422ptouyvy);

    yuy2toyv12      = RENAME(yuy2toyv12);

    planar2x        = RENAME(planar2x);

    rgb24toyv12     = RENAME(rgb24toyv12);

    interleaveBytes = RENAME(interleaveBytes);

    vu9_to_vu12     = RENAME(vu9_to_vu12);

    yvu9_to_yuy2    = RENAME(yvu9_to_yuy2);

    uyvytoyuv420    = RENAME(uyvytoyuv420);

    uyvytoyuv422    = RENAME(uyvytoyuv422);

    yuyvtoyuv420    = RENAME(yuyvtoyuv420);

    yuyvtoyuv422    = RENAME(yuyvtoyuv422);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     char buffer[32];

     AVStream *st;
+
     int bps, channels, sample_rate;

static int pvf_read_header(AVFormatContext *s)

{

    char buffer[32];

    AVStream *st;

    int bps, channels, sample_rate;

    avio_skip(s->pb, 5);

    ff_get_line(s->pb, buffer, sizeof(buffer));

    if (sscanf(buffer, "%d %d %d",

               &channels,

               &sample_rate,

               &bps) != 3)

        return AVERROR_INVALIDDATA;

    if (channels <= 0 || bps <= 0 || sample_rate <= 0)

        return AVERROR_INVALIDDATA;

    st = avformat_new_stream(s, NULL);

    if (!st)

        return AVERROR(ENOMEM);

    st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;

    st->codecpar->channels    = channels;

    st->codecpar->sample_rate = sample_rate;

    st->codecpar->codec_id    = ff_get_pcm_codec_id(bps, 0, 1, 0xFFFF);

    st->codecpar->bits_per_coded_sample = bps;

    st->codecpar->block_align = bps * st->codecpar->channels / 8;

    avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 void qemu_savevm_state_header(QEMUFile *f)

 {
+
+    trace_savevm_state_header();
+
+    qemu_put_be32(f, QEMU_VM_FILE_MAGIC);
+
     qemu_put_be32(f, QEMU_VM_FILE_VERSION);

void qemu_savevm_state_header(QEMUFile *f)

{

    trace_savevm_state_header();

    qemu_put_be32(f, QEMU_VM_FILE_MAGIC);

    qemu_put_be32(f, QEMU_VM_FILE_VERSION);

    if (migrate_get_current()->send_configuration ||

        enforce_config_section()) {

        qemu_put_byte(f, QEMU_VM_CONFIGURATION);

        vmstate_save_state(f, &vmstate_configuration, &savevm_state, 0);

    }

}


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

     BDRVQcowState *s = bs->opaque;
+
     uint32_t l1_length = s->l1_size * sizeof(uint64_t);

     int ret;

static int qcow_make_empty(BlockDriverState *bs)

{

    BDRVQcowState *s = bs->opaque;

    uint32_t l1_length = s->l1_size * sizeof(uint64_t);

    int ret;

    memset(s->l1_table, 0, l1_length);

    if (bdrv_pwrite(bs->file, s->l1_table_offset, s->l1_table, l1_length) < 0)

	return -1;

    ret = bdrv_truncate(bs->file, s->l1_table_offset + l1_length);

    if (ret < 0)

        return ret;

    memset(s->l2_cache, 0, s->l2_size * L2_CACHE_SIZE * sizeof(uint64_t));

    memset(s->l2_cache_offsets, 0, L2_CACHE_SIZE * sizeof(uint64_t));

    memset(s->l2_cache_counts, 0, L2_CACHE_SIZE * sizeof(uint32_t));

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 void blk_remove_bs(BlockBackend *blk)

+{

+    BlockDriverState *bs;
+
     ThrottleTimers *tt;

+

     notifier_list_notify(&blk->remove_bs_notifiers, blk);

void blk_remove_bs(BlockBackend *blk)

{

    BlockDriverState *bs;

    ThrottleTimers *tt;

    notifier_list_notify(&blk->remove_bs_notifiers, blk);

    if (blk->public.throttle_group_member.throttle_state) {

        tt = &blk->public.throttle_group_member.throttle_timers;

        bs = blk_bs(blk);

        bdrv_drained_begin(bs);

        throttle_timers_detach_aio_context(tt);

        bdrv_drained_end(bs);

    }

    blk_update_root_state(blk);

    bdrv_root_unref_child(blk->root);

    blk->root = NULL;

}


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

     int len, ret;

+

     while (c->buffer_ptr >= c->buffer_end) {

static int http_send_data(HTTPContext *c)

{

    int len, ret;

    while (c->buffer_ptr >= c->buffer_end) {

        ret = http_prepare_data(c);

        if (ret < 0)

            return -1;

        else if (ret == 0) {

            break;

        } else {

            /* state change requested */

            return 0;

        }

    }

    if (c->buffer_end > c->buffer_ptr) {

        len = write(c->fd, c->buffer_ptr, c->buffer_end - c->buffer_ptr);

        if (len < 0) {

            if (errno != EAGAIN && errno != EINTR) {

                /* error : close connection */

                return -1;

            }

        } else {

            c->buffer_ptr += len;

            c->data_count += len;

        }

    }

    return 0;

}


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

     /* Iteration header */

+    if (!spapr->htab_shift) {
+
+        qemu_put_be32(f, -1);
+
+        return 0;

     } else {

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

{

    sPAPRMachineState *spapr = opaque;

    int fd;

    int rc = 0;

    /* Iteration header */

    if (!spapr->htab_shift) {

        qemu_put_be32(f, -1);

        return 0;

    } else {

        qemu_put_be32(f, 0);

    }

    if (!spapr->htab) {

        assert(kvm_enabled());

        fd = get_htab_fd(spapr);

        if (fd < 0) {

            return fd;

        }

        rc = kvmppc_save_htab(f, fd, MAX_KVM_BUF_SIZE, MAX_ITERATION_NS);

        if (rc < 0) {

            return rc;

        }

    } else  if (spapr->htab_first_pass) {

        htab_save_first_pass(f, spapr, MAX_ITERATION_NS);

    } else {

        rc = htab_save_later_pass(f, spapr, MAX_ITERATION_NS);

    }

    /* End marker */

    qemu_put_be32(f, 0);

    qemu_put_be16(f, 0);

    qemu_put_be16(f, 0);

    return rc;

}


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

+{
+
+    struct gpio_state_t *s = opaque;
+
+    uint32_t r = 0;

static uint64_t gpio_read(void *opaque, target_phys_addr_t addr, unsigned size)

{

    struct gpio_state_t *s = opaque;

    uint32_t r = 0;

    addr >>= 2;

    switch (addr)

    {

        case R_PA_DIN:

            r = s->regs[RW_PA_DOUT] & s->regs[RW_PA_OE];

            /* Encode pins from the nand.  */

            r |= s->nand->rdy << 7;

            break;

        case R_PD_DIN:

            r = s->regs[RW_PD_DOUT] & s->regs[RW_PD_OE];

            /* Encode temp sensor pins.  */

            r |= (!!(s->tempsensor.shiftreg & 0x10000)) << 4;

            break;

        default:

            r = s->regs[addr];

            break;

    }

    return r;

    D(printf("%s %x=%x\n", __func__, addr, r));

}


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

                                     const AVDXVAContext *ctx,

+                                    const AVFrame *frame)

 {

unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx,

                                    const AVDXVAContext *ctx,

                                    const AVFrame *frame)

{

    void *surface = ff_dxva2_get_surface(frame);

    unsigned i;

    for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++)

        if (DXVA_CONTEXT_SURFACE(avctx, ctx, i) == surface)

            return i;

    assert(0);

    return 0;

}


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

     stfs->f_fsid.__val[0] = prstfs->f_fsid[0] & 0xFFFFFFFFU;

+    stfs->f_fsid.__val[1] = prstfs->f_fsid[1] >> 32 & 0xFFFFFFFFU;
+
+    stfs->f_namelen = prstfs->f_namelen;
+
+    stfs->f_frsize = prstfs->f_frsize;

 }

static void prstatfs_to_statfs(struct statfs *stfs, ProxyStatFS *prstfs)

{

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

    stfs->f_type = prstfs->f_type;

    stfs->f_bsize = prstfs->f_bsize;

    stfs->f_blocks = prstfs->f_blocks;

    stfs->f_bfree = prstfs->f_bfree;

    stfs->f_bavail = prstfs->f_bavail;

    stfs->f_files = prstfs->f_files;

    stfs->f_ffree = prstfs->f_ffree;

    stfs->f_fsid.__val[0] = prstfs->f_fsid[0] & 0xFFFFFFFFU;

    stfs->f_fsid.__val[1] = prstfs->f_fsid[1] >> 32 & 0xFFFFFFFFU;

    stfs->f_namelen = prstfs->f_namelen;

    stfs->f_frsize = prstfs->f_frsize;

}


static inline void downmix_3f_to_mono(float *samples)

{

    int i;

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

        samples[i] += (samples[i + 256] + samples[i + 512]);

        samples[i + 256] = samples[i + 512] = 0;

    }

}


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

     uint8_t *config;

+    int i;
+
+
+
+    assert(size == pci_config_size(s));

     config = qemu_malloc(size);

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

{

    PCIDevice *s = container_of(pv, PCIDevice, config);

    uint8_t *config;

    int i;

    assert(size == pci_config_size(s));

    config = qemu_malloc(size);

    qemu_get_buffer(f, config, size);

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

        if ((config[i] ^ s->config[i]) & s->cmask[i] & ~s->wmask[i]) {

            qemu_free(config);

            return -EINVAL;

        }

    }

    memcpy(s->config, config, size);

    pci_update_mappings(s);

    qemu_free(config);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void ff_generate_sliding_window_mmcos(H264Context *h, int first_slice)
+
+{
+
+    MpegEncContext * const s = &h->s;
+
     MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = first_slice ? h->mmco : mmco_temp;

     int mmco_index = 0, i;

void ff_generate_sliding_window_mmcos(H264Context *h, int first_slice)

{

    MpegEncContext * const s = &h->s;

    MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = first_slice ? h->mmco : mmco_temp;

    int mmco_index = 0, i;

    assert(h->long_ref_count + h->short_ref_count <= h->sps.ref_frame_count);

    if (h->short_ref_count &&

        h->long_ref_count + h->short_ref_count == h->sps.ref_frame_count &&

        !(FIELD_PICTURE && !s->first_field &&

          s->current_picture_ptr->f.reference)) {

        mmco[0].opcode = MMCO_SHORT2UNUSED;

        mmco[0].short_pic_num = h->short_ref[h->short_ref_count - 1]->frame_num;

        mmco_index = 1;

        if (FIELD_PICTURE) {

            mmco[0].short_pic_num *= 2;

            mmco[1].opcode = MMCO_SHORT2UNUSED;

            mmco[1].short_pic_num = mmco[0].short_pic_num + 1;

            mmco_index = 2;

        }

    }

    if (first_slice) {

        h->mmco_index = mmco_index;

    } else if (!first_slice && mmco_index >= 0 &&

               (mmco_index != h->mmco_index ||

                (i = check_opcodes(h->mmco, mmco_temp, mmco_index)))) {

        av_log(h->s.avctx, AV_LOG_ERROR,

               "Inconsistent MMCO state between slices [%d, %d, %d]\n",

               mmco_index, h->mmco_index, i);

        return AVERROR_INVALIDDATA;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int vqf_read_seek(AVFormatContext *s,

                          int stream_index, int64_t timestamp, int flags)
+
 {

     VqfContext *c = s->priv_data;

static int vqf_read_seek(AVFormatContext *s,

                         int stream_index, int64_t timestamp, int flags)

{

    VqfContext *c = s->priv_data;

    AVStream *st;

    int ret;

    int64_t pos;

    st = s->streams[stream_index];

    pos = av_rescale_rnd(timestamp * st->codec->bit_rate,

                         st->time_base.num,

                         st->time_base.den * (int64_t)c->frame_bit_len,

                         (flags & AVSEEK_FLAG_BACKWARD) ?

                                                   AV_ROUND_DOWN : AV_ROUND_UP);

    pos *= c->frame_bit_len;

    st->cur_dts = av_rescale(pos, st->time_base.den,

                             st->codec->bit_rate * (int64_t)st->time_base.num);

    if ((ret = avio_seek(s->pb, ((pos-7) >> 3) + s->internal->data_offset, SEEK_SET)) < 0)

        return ret;

    c->remaining_bits = -7 - ((pos-7)&7);

    return 0;

}


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

     gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

@@ -11,7 +11,7 @@
     TCGv t0;

     if (unlikely(ctx->pr)) {
+
         gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

         return;

static void gen_wrtee(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

#else

    TCGv t0;

    if (unlikely(ctx->pr)) {

        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

        return;

    }

    t0 = tcg_temp_new();

    tcg_gen_andi_tl(t0, cpu_gpr[rD(ctx->opcode)], (1 << MSR_EE));

    tcg_gen_andi_tl(cpu_msr, cpu_msr, ~(1 << MSR_EE));

    tcg_gen_or_tl(cpu_msr, cpu_msr, t0);

    tcg_temp_free(t0);

    /* Stop translation to have a chance to raise an exception

     * if we just set msr_ee to 1

     */

    gen_stop_exception(ctx);

#endif

}


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

         socket_set_cork(csock, 0);

+    }
+
+
+
+    client->send_coroutine = NULL;

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

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

                             int len)

{

    NBDClient *client = req->client;

    int csock = client->sock;

    int rc, ret;

    qemu_co_mutex_lock(&client->send_lock);

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

    client->send_coroutine = qemu_coroutine_self();

    if (!len) {

        rc = nbd_send_reply(csock, reply);

        if (rc == -1) {

            rc = -errno;

        }

    } else {

        socket_set_cork(csock, 1);

        rc = nbd_send_reply(csock, reply);

        if (rc != -1) {

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

            if (ret != len) {

                errno = EIO;

                rc = -1;

            }

        }

        if (rc == -1) {

            rc = -errno;

        }

        socket_set_cork(csock, 0);

    }

    client->send_coroutine = NULL;

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

    qemu_co_mutex_unlock(&client->send_lock);

    return rc;

}


--- a/source.c
+++ b/source.c
@@ -40,11 +40,11 @@
                           0x01, 0x7e, 0x43, 0x00, 0x555, 0x2aa, 1);
     /* create irq lines */
     cpu_irq = qemu_allocate_irqs(cpu_irq_handler, cpu, 1);
+    env->pic_state = lm32_pic_init(*cpu_irq);
+    for (i = 0; i < 32; i++) {
+        irq[i] = qdev_get_gpio_in(env->pic_state, i);
+    sysbus_create_simple("lm32-uart", uart0_base, irq[uart0_irq]);
+    sysbus_create_simple("lm32-timer", timer0_base, irq[timer0_irq]);
     sysbus_create_simple("lm32-timer", timer1_base, irq[timer1_irq]);
     /* make sure juart isn't the first chardev */
     env->juart_state = lm32_juart_init();

static void lm32_evr_init(QEMUMachineInitArgs *args)
{
    const char *cpu_model = args->cpu_model;
    const char *kernel_filename = args->kernel_filename;
    LM32CPU *cpu;
    CPULM32State *env;
    DriveInfo *dinfo;
    MemoryRegion *address_space_mem =  get_system_memory();
    MemoryRegion *phys_ram = g_new(MemoryRegion, 1);
    qemu_irq *cpu_irq, irq[32];
    ResetInfo *reset_info;
    int i;
    /* memory map */
    hwaddr flash_base  = 0x04000000;
    size_t flash_sector_size       = 256 * 1024;
    size_t flash_size              = 32 * 1024 * 1024;
    hwaddr ram_base    = 0x08000000;
    size_t ram_size                = 64 * 1024 * 1024;
    hwaddr timer0_base = 0x80002000;
    hwaddr uart0_base  = 0x80006000;
    hwaddr timer1_base = 0x8000a000;
    int uart0_irq                  = 0;
    int timer0_irq                 = 1;
    int timer1_irq                 = 3;
    reset_info = g_malloc0(sizeof(ResetInfo));
    if (cpu_model == NULL) {
        cpu_model = "lm32-full";
    cpu = cpu_lm32_init(cpu_model);
    env = &cpu->env;
    reset_info->cpu = cpu;
    reset_info->flash_base = flash_base;
    memory_region_init_ram(phys_ram, NULL, "lm32_evr.sdram", ram_size);
    vmstate_register_ram_global(phys_ram);
    memory_region_add_subregion(address_space_mem, ram_base, phys_ram);
    dinfo = drive_get(IF_PFLASH, 0, 0);
    /* Spansion S29NS128P */
    pflash_cfi02_register(flash_base, NULL, "lm32_evr.flash", flash_size,
                          dinfo ? dinfo->bdrv : NULL, flash_sector_size,
                          flash_size / flash_sector_size, 1, 2,
                          0x01, 0x7e, 0x43, 0x00, 0x555, 0x2aa, 1);
    /* create irq lines */
    cpu_irq = qemu_allocate_irqs(cpu_irq_handler, cpu, 1);
    env->pic_state = lm32_pic_init(*cpu_irq);
    for (i = 0; i < 32; i++) {
        irq[i] = qdev_get_gpio_in(env->pic_state, i);
    sysbus_create_simple("lm32-uart", uart0_base, irq[uart0_irq]);
    sysbus_create_simple("lm32-timer", timer0_base, irq[timer0_irq]);
    sysbus_create_simple("lm32-timer", timer1_base, irq[timer1_irq]);
    /* make sure juart isn't the first chardev */
    env->juart_state = lm32_juart_init();
    reset_info->bootstrap_pc = flash_base;
    if (kernel_filename) {
        uint64_t entry;
        int kernel_size;
        kernel_size = load_elf(kernel_filename, NULL, NULL, &entry, NULL, NULL,
                               1, ELF_MACHINE, 0);
        reset_info->bootstrap_pc = entry;
        if (kernel_size < 0) {
            kernel_size = load_image_targphys(kernel_filename, ram_base,
                                              ram_size);
            reset_info->bootstrap_pc = ram_base;
        if (kernel_size < 0) {
            fprintf(stderr, "qemu: could not load kernel '%s'\n",
                    kernel_filename);
    qemu_register_reset(main_cpu_reset, reset_info);


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

 {

+    g_assert(c->method == GA_CHANNEL_UNIX_LISTEN);
+
+    g_assert(c->listen_channel);

     g_io_channel_shutdown(c->listen_channel, true, NULL);

static void ga_channel_listen_close(GAChannel *c)

{

    g_assert(c->method == GA_CHANNEL_UNIX_LISTEN);

    g_assert(c->listen_channel);

    g_io_channel_shutdown(c->listen_channel, true, NULL);

    g_io_channel_unref(c->listen_channel);

    c->listen_channel = NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void kvmppc_timer_hack(void *opaque)
+
+{

     qemu_service_io();

static void kvmppc_timer_hack(void *opaque)

{

    qemu_service_io();

    qemu_mod_timer(kvmppc_timer, qemu_get_clock_ns(vm_clock) + kvmppc_timer_rate);

}


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

+    if (have_armv6(cpu_flags))
+
+        ff_vp8dsp_init_armv6(dsp);
+
     if (have_neon(cpu_flags))

         ff_vp8dsp_init_neon(dsp);

av_cold void ff_vp8dsp_init_arm(VP8DSPContext *dsp)

{

    int cpu_flags = av_get_cpu_flags();

    if (have_armv6(cpu_flags))

        ff_vp8dsp_init_armv6(dsp);

    if (have_neon(cpu_flags))

        ff_vp8dsp_init_neon(dsp);

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     int ret;

+
+    if (bytes < 0) {
+
+        return -EINVAL;
+
     }

int bdrv_pread(BlockDriverState *bs, int64_t offset, void *buf, int bytes)

{

    QEMUIOVector qiov;

    struct iovec iov = {

        .iov_base = (void *)buf,

        .iov_len = bytes,

    };

    int ret;

    if (bytes < 0) {

        return -EINVAL;

    }

    qemu_iovec_init_external(&qiov, &iov, 1);

    ret = bdrv_prwv_co(bs, offset, &qiov, false, 0);

    if (ret < 0) {

        return ret;

    }

    return bytes;

}


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

     SaveStateEntry *se;
+
+    int ret = 1;
+
+
+
     TAILQ_FOREACH(se, &savevm_handlers, entry) {

         if (se->save_live_state == NULL)

int qemu_savevm_state_iterate(QEMUFile *f)

{

    SaveStateEntry *se;

    int ret = 1;

    TAILQ_FOREACH(se, &savevm_handlers, entry) {

        if (se->save_live_state == NULL)

            continue;

        /* Section type */

        qemu_put_byte(f, QEMU_VM_SECTION_PART);

        qemu_put_be32(f, se->section_id);

        ret &= !!se->save_live_state(f, QEMU_VM_SECTION_PART, se->opaque);

    }

    if (ret)

        return 1;

    if (qemu_file_has_error(f))

        return -EIO;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static bool use_goto_tb(DisasContext *ctx, target_ulong dest)
+
 {

     /* Suppress goto_tb in the case of single-steping and IO.  */

static bool use_goto_tb(DisasContext *ctx, target_ulong dest)

{

    /* Suppress goto_tb in the case of single-steping and IO.  */

    if ((ctx->base.tb->cflags & CF_LAST_IO) || ctx->base.singlestep_enabled) {

        return false;

    }

    return true;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 void pcie_aer_root_init(PCIDevice *dev)

+{
+
+    uint16_t pos = dev->exp.aer_cap;
+
+

     pci_set_long(dev->wmask + pos + PCI_ERR_ROOT_COMMAND,

void pcie_aer_root_init(PCIDevice *dev)

{

    uint16_t pos = dev->exp.aer_cap;

    pci_set_long(dev->wmask + pos + PCI_ERR_ROOT_COMMAND,

                 PCI_ERR_ROOT_CMD_EN_MASK);

    pci_set_long(dev->w1cmask + pos + PCI_ERR_ROOT_STATUS,

                 PCI_ERR_ROOT_STATUS_REPORT_MASK);

}


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

 {

+    CharDriverState *chr = opaque;
+
+
+
+    if (cond != G_IO_HUP) {

         return FALSE;

static gboolean tcp_chr_chan_close(GIOChannel *channel, GIOCondition cond,

                                   void *opaque)

{

    CharDriverState *chr = opaque;

    if (cond != G_IO_HUP) {

        return FALSE;

    }

    /* connection closed */

    tcp_chr_disconnect(chr);

    if (chr->fd_hup_tag) {

        g_source_remove(chr->fd_hup_tag);

        chr->fd_hup_tag = 0;

    }

    return TRUE;

}


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

     ASFContext *asf = s->priv_data;

+
+
+    s->packet_size  = PACKET_SIZE;
+
+    s->max_interleave_delta = 0;

     asf->nb_packets = 0;

static int asf_write_header(AVFormatContext *s)

{

    ASFContext *asf = s->priv_data;

    s->packet_size  = PACKET_SIZE;

    s->max_interleave_delta = 0;

    asf->nb_packets = 0;

    asf->index_ptr             = av_malloc(sizeof(ASFIndex) * ASF_INDEX_BLOCK);

    asf->nb_index_memory_alloc = ASF_INDEX_BLOCK;

    asf->maximum_packet        = 0;

    /* the data-chunk-size has to be 50 (DATA_HEADER_SIZE), which is

     * data_size - asf->data_offset at the moment this function is done.

     * It is needed to use asf as a streamable format. */

    if (asf_write_header1(s, 0, DATA_HEADER_SIZE) < 0) {

        //av_free(asf);

        return -1;

    }

    avio_flush(s->pb);

    asf->packet_nb_payloads     = 0;

    asf->packet_timestamp_start = -1;

    asf->packet_timestamp_end   = -1;

    ffio_init_context(&asf->pb, asf->packet_buf, s->packet_size, 1,

                      NULL, NULL, NULL, NULL);

    if (s->avoid_negative_ts < 0)

        s->avoid_negative_ts = 1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 libAVFilter_QueryVendorInfo(libAVFilter *this, wchar_t **info)

 {
+
+    dshowdebug("libAVFilter_QueryVendorInfo(%p)\n", this);

libAVFilter_QueryVendorInfo(libAVFilter *this, wchar_t **info)

{

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

    if (!info)

        return E_POINTER;

    *info = wcsdup(L"libAV");

    return S_OK;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static int mxf_read_primer_pack(MXFContext *mxf)
+
 {

     ByteIOContext *pb = mxf->fc->pb;

static int mxf_read_primer_pack(MXFContext *mxf)

{

    ByteIOContext *pb = mxf->fc->pb;

    int item_num = get_be32(pb);

    int item_len = get_be32(pb);

    if (item_len != 18) {

        av_log(mxf->fc, AV_LOG_ERROR, "unsupported primer pack item length\n");

        return -1;

    }

    if (item_num > UINT_MAX / item_len)

        return -1;

    mxf->local_tags_count = item_num;

    mxf->local_tags = av_malloc(item_num*item_len);

    if (!mxf->local_tags)

        return -1;

    get_buffer(pb, mxf->local_tags, item_num*item_len);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     AcpiTableMcfg *mcfg;

     const char *sig;
+
+    int len = sizeof(*mcfg) + 1 * sizeof(mcfg->allocation[0]);
+
+
+
     mcfg = acpi_data_push(table_data, len);

     mcfg->allocation[0].address = cpu_to_le64(info->mcfg_base);

build_mcfg_q35(GArray *table_data, GArray *linker, AcpiMcfgInfo *info)

{

    AcpiTableMcfg *mcfg;

    const char *sig;

    int len = sizeof(*mcfg) + 1 * sizeof(mcfg->allocation[0]);

    mcfg = acpi_data_push(table_data, len);

    mcfg->allocation[0].address = cpu_to_le64(info->mcfg_base);

    /* Only a single allocation so no need to play with segments */

    mcfg->allocation[0].pci_segment = cpu_to_le16(0);

    mcfg->allocation[0].start_bus_number = 0;

    mcfg->allocation[0].end_bus_number = PCIE_MMCFG_BUS(info->mcfg_size - 1);

    /* MCFG is used for ECAM which can be enabled or disabled by guest.

     * To avoid table size changes (which create migration issues),

     * always create the table even if there are no allocations,

     * but set the signature to a reserved value in this case.

     * ACPI spec requires OSPMs to ignore such tables.

     */

    if (info->mcfg_base == PCIE_BASE_ADDR_UNMAPPED) {

        /* Reserved signature: ignored by OSPM */

        sig = "QEMU";

    } else {

        sig = "MCFG";

    }

    build_header(linker, table_data, (void *)mcfg, sig, len, 1, NULL, NULL);

}


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

 {

+    int i;
+
+    if (term_outbuf_index > 0) {
+
         for (i = 0; i < MAX_MON; i++)

             if (monitor_hd[i] && monitor_hd[i]->focus == 0)

void monitor_flush(Monitor *mon)

{

    int i;

    if (term_outbuf_index > 0) {

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

            if (monitor_hd[i] && monitor_hd[i]->focus == 0)

                qemu_chr_write(monitor_hd[i], term_outbuf, term_outbuf_index);

        term_outbuf_index = 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -15,9 +15,9 @@
                 "-device scsi-hd,bus=vs0.0,drive=drv0 %s",

                 extra_opts ? : "");
+
+    qtest_start(cmdline);
+
+    g_free(cmdline);
+
 }

static void qvirtio_scsi_start(const char *extra_opts)

{

    char *cmdline;

    cmdline = g_strdup_printf(

                "-drive id=drv0,if=none,file=/dev/null,format=raw "

                "-device virtio-scsi-pci,id=vs0 "

                "-device scsi-hd,bus=vs0.0,drive=drv0 %s",

                extra_opts ? : "");

    qtest_start(cmdline);

    g_free(cmdline);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void xtensa_cpu_list(FILE *f, fprintf_function cpu_fprintf)

 {
+
+    cpu_fprintf(f, "Available CPUs:\n"

             "  Xtensa core\n");

void xtensa_cpu_list(FILE *f, fprintf_function cpu_fprintf)

{

    cpu_fprintf(f, "Available CPUs:\n"

            "  Xtensa core\n");

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void float_to_int16_sse(int16_t *dst, const float *src, long len){

+    int i;
+
+    for(i=0; i<len; i+=4) {
+
+        asm volatile(

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

static void float_to_int16_sse(int16_t *dst, const float *src, long len){

    int i;

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

        asm volatile(

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

            "cvtps2pi    %2, %%mm1 \n\t"

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

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

            :"=m"(dst[i])

            :"m"(src[i]), "m"(src[i+2])

        );

    }

    asm volatile("emms");

}


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

     const char *str = "";
+
+    unsigned long res = 999;

     int err;

static void test_qemu_strtoul_full_empty(void)

{

    const char *str = "";

    unsigned long res = 999;

    int err;

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

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, 0);

}


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

     if (data->qiv) {
+
+        visit_free(data->qiv);
+
+        data->qiv = NULL;
+
     }

 }

static void validate_teardown(TestInputVisitorData *data,

                               const void *unused)

{

    qobject_decref(data->obj);

    data->obj = NULL;

    if (data->qiv) {

        visit_free(data->qiv);

        data->qiv = NULL;

    }

}


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

         } else {

+            dc->pc = dc->npc;
+
+            dc->npc = target;
+
+            tcg_gen_mov_tl(cpu_pc, cpu_npc);

         }

static void do_branch(DisasContext *dc, int32_t offset, uint32_t insn, int cc,

                      TCGv r_cond)

{

    unsigned int cond = GET_FIELD(insn, 3, 6), a = (insn & (1 << 29));

    target_ulong target = dc->pc + offset;

    if (cond == 0x0) {

        /* unconditional not taken */

        if (a) {

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

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

        } else {

            dc->pc = dc->npc;

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

        }

    } else if (cond == 0x8) {

        /* unconditional taken */

        if (a) {

            dc->pc = target;

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

        } else {

            dc->pc = dc->npc;

            dc->npc = target;

            tcg_gen_mov_tl(cpu_pc, cpu_npc);

        }

    } else {

        flush_cond(dc, r_cond);

        gen_cond(r_cond, cc, cond, dc);

        if (a) {

            gen_branch_a(dc, target, dc->npc, r_cond);

            dc->is_br = 1;

        } else {

            dc->pc = dc->npc;

            dc->jump_pc[0] = target;

            dc->jump_pc[1] = dc->npc + 4;

            dc->npc = JUMP_PC;

        }

    }

}


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

         *section_size = bytestream2_get_le32(gbc);
+
+    }
+
+
+
     if (*section_size > bytestream2_get_bytes_left(gbc))

         return AVERROR_INVALIDDATA;

static int parse_section_header(GetByteContext *gbc, int *section_size,

                                enum HapSectionType *section_type)

{

    if (bytestream2_get_bytes_left(gbc) < 4)

        return AVERROR_INVALIDDATA;

    *section_size = bytestream2_get_le24(gbc);

    *section_type = bytestream2_get_byte(gbc);

    if (*section_size == 0) {

        if (bytestream2_get_bytes_left(gbc) < 4)

            return AVERROR_INVALIDDATA;

        *section_size = bytestream2_get_le32(gbc);

    }

    if (*section_size > bytestream2_get_bytes_left(gbc))

        return AVERROR_INVALIDDATA;

    else

        return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+void init_rl(RLTable *rl)

 {

@@ -20,11 +20,11 @@

             end = rl->last;

+        } else {

+            start = rl->last;

+            end = rl->n;

         }

void init_rl(RLTable *rl)

{

    int8_t max_level[MAX_RUN+1], max_run[MAX_LEVEL+1];

    uint8_t index_run[MAX_RUN+1];

    int last, run, level, start, end, i;

    /* compute max_level[], max_run[] and index_run[] */

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

        if (last == 0) {

            start = 0;

            end = rl->last;

        } else {

            start = rl->last;

            end = rl->n;

        }

        memset(max_level, 0, MAX_RUN + 1);

        memset(max_run, 0, MAX_LEVEL + 1);

        memset(index_run, rl->n, MAX_RUN + 1);

        for(i=start;i<end;i++) {

            run = rl->table_run[i];

            level = rl->table_level[i];

            if (index_run[run] == rl->n)

                index_run[run] = i;

            if (level > max_level[run])

                max_level[run] = level;

            if (run > max_run[level])

                max_run[level] = run;

        }

        rl->max_level[last] = av_malloc(MAX_RUN + 1);

        memcpy(rl->max_level[last], max_level, MAX_RUN + 1);

        rl->max_run[last] = av_malloc(MAX_LEVEL + 1);

        memcpy(rl->max_run[last], max_run, MAX_LEVEL + 1);

        rl->index_run[last] = av_malloc(MAX_RUN + 1);

        memcpy(rl->index_run[last], index_run, MAX_RUN + 1);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static void blkdebug_refresh_limits(BlockDriverState *bs, Error **errp)
+
+{

     BDRVBlkdebugState *s = bs->opaque;

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

{

    BDRVBlkdebugState *s = bs->opaque;

    if (s->align) {

        bs->request_alignment = s->align;

    }

}


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

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

+        if (v == c) {
+
+            /* Character found.  Set R1 to the location; R2 is unmodified.  */
+
+            env->cc_op = 1;

             set_address(env, r1, str + len);

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

{

    uintptr_t ra = GETPC();

    uint32_t len;

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

    uint64_t end, str, adj_end;

    /* Bits 32-47 of R0 must be zero.  */

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

        cpu_restore_state(ENV_GET_CPU(env), ra);

        program_interrupt(env, PGM_SPECIFICATION, 6);

    }

    str = get_address(env, r2);

    end = get_address(env, r1);

    /* If the LSB of the two addresses differ, use one extra byte.  */

    adj_end = end + ((str ^ end) & 1);

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

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

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

        if (str + len == adj_end) {

            /* End of input found.  */

            env->cc_op = 2;

            return;

        }

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

        if (v == c) {

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

            env->cc_op = 1;

            set_address(env, r1, str + len);

            return;

        }

    }

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

    env->cc_op = 3;

    set_address(env, r2, str + len);

}


--- a/source.c
+++ b/source.c
@@ -43,11 +43,11 @@
         cpu_synchronize_state(cs);

         kvm_s390_store_status(cpu, KVM_S390_STORE_STATUS_DEF_ADDR, true);
+
+        break;
+
+    }
+
     si->cc = SIGP_CC_ORDER_CODE_ACCEPTED;

 }

static void sigp_stop_and_store_status(CPUState *cs, run_on_cpu_data arg)

{

    S390CPU *cpu = S390_CPU(cs);

    SigpInfo *si = arg.host_ptr;

    struct kvm_s390_irq irq = {

        .type = KVM_S390_SIGP_STOP,

    };

    /* disabled wait - sleeping in user space */

    if (s390_cpu_get_state(cpu) == CPU_STATE_OPERATING && cs->halted) {

        s390_cpu_set_state(CPU_STATE_STOPPED, cpu);

    }

    switch (s390_cpu_get_state(cpu)) {

    case CPU_STATE_OPERATING:

        cpu->env.sigp_order = SIGP_STOP_STORE_STATUS;

        kvm_s390_vcpu_interrupt(cpu, &irq);

        /* store will be performed when handling the stop intercept */

        break;

    case CPU_STATE_STOPPED:

        /* already stopped, just store the status */

        cpu_synchronize_state(cs);

        kvm_s390_store_status(cpu, KVM_S390_STORE_STATUS_DEF_ADDR, true);

        break;

    }

    si->cc = SIGP_CC_ORDER_CODE_ACCEPTED;

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
         | (!!conf.buffer_size_in_overridden << 1);

+
+    if (alsa_open (1, &req, &obt, &handle)) {
+
+        return -1;
+
     }

static int alsa_init_in (HWVoiceIn *hw, audsettings_t *as)

{

    ALSAVoiceIn *alsa = (ALSAVoiceIn *) hw;

    struct alsa_params_req req;

    struct alsa_params_obt obt;

    snd_pcm_t *handle;

    audsettings_t obt_as;

    req.fmt = aud_to_alsafmt (as->fmt);

    req.freq = as->freq;

    req.nchannels = as->nchannels;

    req.period_size = conf.period_size_in;

    req.buffer_size = conf.buffer_size_in;

    req.size_in_usec = conf.size_in_usec_in;

    req.override_mask = !!conf.period_size_in_overridden

        | (!!conf.buffer_size_in_overridden << 1);

    if (alsa_open (1, &req, &obt, &handle)) {

        return -1;

    }

    obt_as.freq = obt.freq;

    obt_as.nchannels = obt.nchannels;

    obt_as.fmt = obt.fmt;

    obt_as.endianness = obt.endianness;

    audio_pcm_init_info (&hw->info, &obt_as);

    hw->samples = obt.samples;

    alsa->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift);

    if (!alsa->pcm_buf) {

        dolog ("Could not allocate ADC buffer (%d samples, each %d bytes)\n",

               hw->samples, 1 << hw->info.shift);

        alsa_anal_close (&handle);

        return -1;

    }

    alsa->handle = handle;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
                               enum AVIODataMarkerType type, int64_t time)

 {
+
+    char timebuf[30], content[5] = { 0 };
+
+    const char *str;
+
     switch (type) {

     case AVIO_DATA_MARKER_HEADER:         str = "header";   break;

static int io_write_data_type(void *opaque, uint8_t *buf, int size,

                              enum AVIODataMarkerType type, int64_t time)

{

    char timebuf[30], content[5] = { 0 };

    const char *str;

    switch (type) {

    case AVIO_DATA_MARKER_HEADER:         str = "header";   break;

    case AVIO_DATA_MARKER_SYNC_POINT:     str = "sync";     break;

    case AVIO_DATA_MARKER_BOUNDARY_POINT: str = "boundary"; break;

    case AVIO_DATA_MARKER_UNKNOWN:        str = "unknown";  break;

    case AVIO_DATA_MARKER_TRAILER:        str = "trailer";  break;

    }

    if (time == AV_NOPTS_VALUE)

        snprintf(timebuf, sizeof(timebuf), "nopts");

    else

        snprintf(timebuf, sizeof(timebuf), "%"PRId64, time);

    // There can be multiple header/trailer callbacks, only log the box type

    // for header at out_size == 0

    if (type != AVIO_DATA_MARKER_UNKNOWN &&

        type != AVIO_DATA_MARKER_TRAILER &&

        (type != AVIO_DATA_MARKER_HEADER || out_size == 0) &&

        size >= 8)

        memcpy(content, &buf[4], 4);

    else

        snprintf(content, sizeof(content), "-");

    printf("write_data len %d, time %s, type %s atom %s\n", size, timebuf, str, content);

    return io_write(opaque, buf, size);

}


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

     g_free(s->cluster_cache);
+
+    qemu_vfree(s->cluster_data);
+
+    qcow2_refcount_close(bs);
+
     qcow2_free_snapshots(bs);

 }

static void qcow2_close(BlockDriverState *bs)

{

    BDRVQcow2State *s = bs->opaque;

    qemu_vfree(s->l1_table);

    /* else pre-write overlap checks in cache_destroy may crash */

    s->l1_table = NULL;

    if (!(s->flags & BDRV_O_INACTIVE)) {

        qcow2_inactivate(bs);

    }

    cache_clean_timer_del(bs);

    qcow2_cache_destroy(bs, s->l2_table_cache);

    qcow2_cache_destroy(bs, s->refcount_block_cache);

    qcrypto_cipher_free(s->cipher);

    s->cipher = NULL;

    g_free(s->unknown_header_fields);

    cleanup_unknown_header_ext(bs);

    g_free(s->image_backing_file);

    g_free(s->image_backing_format);

    g_free(s->cluster_cache);

    qemu_vfree(s->cluster_data);

    qcow2_refcount_close(bs);

    qcow2_free_snapshots(bs);

}


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

     }

+
+
+    return lgetxattr(rpath(ctx, path), name, value, size);
+
+}

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

                               const char *name, void *value, size_t size)

{

    if ((ctx->fs_sm == SM_MAPPED) &&

        (strncmp(name, "user.virtfs.", 12) == 0)) {

        /*

         * Don't allow fetch of user.virtfs namesapce

         * in case of mapped security

         */

        errno = ENOATTR;

        return -1;

    }

    return lgetxattr(rpath(ctx, path), name, value, size);

}


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

         fprintf(stderr, "%s: stray LMP_accepted received, fixme\n",
+
+                        __func__);
+
+    exit(-1);

 }

static void bt_dummy_lmp_connection_complete(struct bt_link_s *link)

{

    if (link->slave->reject_reason)

        fprintf(stderr, "%s: stray LMP_not_accepted received, fixme\n",

                        __func__);

    else

        fprintf(stderr, "%s: stray LMP_accepted received, fixme\n",

                        __func__);

    exit(-1);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static int check_opts(QemuOptsList *opts_list, QDict *args)
+
 {

     assert(!opts_list->desc->name);

static int check_opts(QemuOptsList *opts_list, QDict *args)

{

    assert(!opts_list->desc->name);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -37,9 +37,9 @@
         monitor_printf(mon, ",%s=%s", prop->name, str);

         g_free(str);
+
+    }
+
+    monitor_printf(mon, "\n");
+
 }

static void netfilter_print_info(Monitor *mon, NetFilterState *nf)

{

    char *str;

    ObjectProperty *prop;

    ObjectPropertyIterator iter;

    StringOutputVisitor *ov;

    /* generate info str */

    object_property_iter_init(&iter, OBJECT(nf));

    while ((prop = object_property_iter_next(&iter))) {

        if (!strcmp(prop->name, "type")) {

            continue;

        }

        ov = string_output_visitor_new(false);

        object_property_get(OBJECT(nf), string_output_get_visitor(ov),

                            prop->name, NULL);

        str = string_output_get_string(ov);

        visit_free(string_output_get_visitor(ov));

        monitor_printf(mon, ",%s=%s", prop->name, str);

        g_free(str);

    }

    monitor_printf(mon, "\n");

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void helper_ldq_data(uint64_t t0, uint64_t t1)
+
 {

     ldq_data(t1, t0);

void helper_ldq_data(uint64_t t0, uint64_t t1)

{

    ldq_data(t1, t0);

}


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

+
     set_label_data = (NvdimmFuncSetLabelDataIn *)in->arg3;

static void nvdimm_dsm_set_label_data(NVDIMMDevice *nvdimm, NvdimmDsmIn *in,

                                      hwaddr dsm_mem_addr)

{

    NVDIMMClass *nvc = NVDIMM_GET_CLASS(nvdimm);

    NvdimmFuncSetLabelDataIn *set_label_data;

    uint32_t status;

    set_label_data = (NvdimmFuncSetLabelDataIn *)in->arg3;

    le32_to_cpus(&set_label_data->offset);

    le32_to_cpus(&set_label_data->length);

    nvdimm_debug("Write Label Data: offset %#x length %#x.\n",

                 set_label_data->offset, set_label_data->length);

    status = nvdimm_rw_label_data_check(nvdimm, set_label_data->offset,

                                        set_label_data->length);

    if (status != 0 /* Success */) {

        nvdimm_dsm_no_payload(status, dsm_mem_addr);

        return;

    }

    assert(sizeof(*in) + sizeof(*set_label_data) + set_label_data->length <=

           4096);

    nvc->write_label_data(nvdimm, set_label_data->in_buf,

                          set_label_data->length, set_label_data->offset);

    nvdimm_dsm_no_payload(0 /* Success */, dsm_mem_addr);

}


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

     atempo->frag[0].position[1] = 0;

+    atempo->frag[0].nsamples    = 0;
+
+
+
+    atempo->frag[1].position[0] = 0;

     atempo->frag[1].position[1] = 0;

static void yae_clear(ATempoContext *atempo)

{

    atempo->size = 0;

    atempo->head = 0;

    atempo->tail = 0;

    atempo->drift = 0;

    atempo->nfrag = 0;

    atempo->state = YAE_LOAD_FRAGMENT;

    atempo->position[0] = 0;

    atempo->position[1] = 0;

    atempo->frag[0].position[0] = 0;

    atempo->frag[0].position[1] = 0;

    atempo->frag[0].nsamples    = 0;

    atempo->frag[1].position[0] = 0;

    atempo->frag[1].position[1] = 0;

    atempo->frag[1].nsamples    = 0;

    // shift left position of 1st fragment by half a window

    // so that no re-normalization would be required for

    // the left half of the 1st fragment:

    atempo->frag[0].position[0] = -(int64_t)(atempo->window / 2);

    atempo->frag[0].position[1] = -(int64_t)(atempo->window / 2);

    av_frame_free(&atempo->dst_buffer);

    atempo->dst     = NULL;

    atempo->dst_end = NULL;

    atempo->request_fulfilled = 0;

    atempo->nsamples_in       = 0;

    atempo->nsamples_out      = 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void HELPER(cpsr_write_eret)(CPUARMState *env, uint32_t val)
 {
+    cpsr_write(env, val, CPSR_ERET_MASK, CPSRWriteExceptionReturn);
     arm_call_el_change_hook(arm_env_get_cpu(env));
 }

void HELPER(cpsr_write_eret)(CPUARMState *env, uint32_t val)
{
    cpsr_write(env, val, CPSR_ERET_MASK, CPSRWriteExceptionReturn);
    arm_call_el_change_hook(arm_env_get_cpu(env));
}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static inline void RENAME(yuv2nv12X)(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
+
 				     int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,

 				     uint8_t *dest, uint8_t *uDest, int dstW, int chrDstW, int dstFormat)

static inline void RENAME(yuv2nv12X)(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,

				     int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,

				     uint8_t *dest, uint8_t *uDest, int dstW, int chrDstW, int dstFormat)

{

yuv2nv12XinC(lumFilter, lumSrc, lumFilterSize,

	     chrFilter, chrSrc, chrFilterSize,

	     dest, uDest, dstW, chrDstW, dstFormat);

}


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

+    pc_dimm_memory_unplug(dev, &pcms->hotplug_memory, mr);
+
+    object_unparent(OBJECT(dev));
+
+

  out:

static void pc_dimm_unplug(HotplugHandler *hotplug_dev,

                           DeviceState *dev, Error **errp)

{

    PCMachineState *pcms = PC_MACHINE(hotplug_dev);

    PCDIMMDevice *dimm = PC_DIMM(dev);

    PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);

    MemoryRegion *mr = ddc->get_memory_region(dimm);

    HotplugHandlerClass *hhc;

    Error *local_err = NULL;

    if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) {

        error_setg(&local_err,

                   "nvdimm device hot unplug is not supported yet.");

        goto out;

    }

    hhc = HOTPLUG_HANDLER_GET_CLASS(pcms->acpi_dev);

    hhc->unplug(HOTPLUG_HANDLER(pcms->acpi_dev), dev, &local_err);

    if (local_err) {

        goto out;

    }

    pc_dimm_memory_unplug(dev, &pcms->hotplug_memory, mr);

    object_unparent(OBJECT(dev));

 out:

    error_propagate(errp, local_err);

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
         proxy->class_code = PCI_CLASS_STORAGE_SCSI;

+
+    if (!proxy->block.bs) {
+
+        error_report("virtio-blk-pci: drive property not set");
+

     vdev = virtio_blk_init(&pci_dev->qdev, &proxy->block);

static int virtio_blk_init_pci(PCIDevice *pci_dev)

{

    VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);

    VirtIODevice *vdev;

    if (proxy->class_code != PCI_CLASS_STORAGE_SCSI &&

        proxy->class_code != PCI_CLASS_STORAGE_OTHER)

        proxy->class_code = PCI_CLASS_STORAGE_SCSI;

    if (!proxy->block.bs) {

        error_report("virtio-blk-pci: drive property not set");

    vdev = virtio_blk_init(&pci_dev->qdev, &proxy->block);

    vdev->nvectors = proxy->nvectors;

    virtio_init_pci(proxy, vdev,

                    PCI_VENDOR_ID_REDHAT_QUMRANET,

                    PCI_DEVICE_ID_VIRTIO_BLOCK,

                    proxy->class_code, 0x00);

    /* make the actual value visible */

    proxy->nvectors = vdev->nvectors;

    return 0;


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

     CPUX86State *env;

+    static int inited;
+
+
+
+    cpu = X86_CPU(object_new(TYPE_X86_CPU));

     env = &cpu->env;

X86CPU *cpu_x86_init(const char *cpu_model)

{

    X86CPU *cpu;

    CPUX86State *env;

    static int inited;

    cpu = X86_CPU(object_new(TYPE_X86_CPU));

    env = &cpu->env;

    env->cpu_model_str = cpu_model;

    /* init various static tables used in TCG mode */

    if (tcg_enabled() && !inited) {

        inited = 1;

        optimize_flags_init();

#ifndef CONFIG_USER_ONLY

        prev_debug_excp_handler =

            cpu_set_debug_excp_handler(breakpoint_handler);

#endif

    }

    if (cpu_x86_register(cpu, cpu_model) < 0) {

        object_delete(OBJECT(cpu));

        return NULL;

    }

    x86_cpu_realize(OBJECT(cpu), NULL);

    return cpu;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void write_dump_header(DumpState *s, Error **errp)
+
+{
+
+     Error *local_err = NULL;
+

     if (s->dump_info.d_class == ELFCLASS32) {

static void write_dump_header(DumpState *s, Error **errp)

{

     Error *local_err = NULL;

    if (s->dump_info.d_class == ELFCLASS32) {

        create_header32(s, &local_err);

    } else {

        create_header64(s, &local_err);

    }

    if (local_err) {

        error_propagate(errp, local_err);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static inline void downmix_2f_1r_to_mono(float *samples)

 {
+
+    int i;
+
+

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

static inline void downmix_2f_1r_to_mono(float *samples)

{

    int i;

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

        samples[i] += (samples[i + 256] + samples[i + 512]);

        samples[i + 256] = samples[i + 512] = 0;

    }

}


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

 {

void omap_badwidth_write8(void *opaque, target_phys_addr_t addr,

                uint32_t value)

{

    uint8_t val8 = value;

    OMAP_8B_REG(addr);

    cpu_physical_memory_write(addr, (void *) &val8, 1);

}


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

         if (!av_strncasecmp(name, names, len))

+            return 1;
+
+        names = p + 1;
+
+    }

     return !av_strcasecmp(name, names);

static int match_format(const char *name, const char *names)

{

    const char *p;

    int len, namelen;

    if (!name || !names)

        return 0;

    namelen = strlen(name);

    while ((p = strchr(names, ','))) {

        len = FFMAX(p - names, namelen);

        if (!av_strncasecmp(name, names, len))

            return 1;

        names = p + 1;

    }

    return !av_strcasecmp(name, names);

}


--- a/source.c
+++ b/source.c
@@ -1,17 +1,17 @@
 static void inc_refcounts(BlockDriverState *bs,

+                          BdrvCheckResult *res,
+
                           uint16_t *refcount_table,

                           int refcount_table_size,

                           int64_t offset, int64_t size)

+{
+
+    BDRVQcowState *s = bs->opaque;
+
     int64_t start, last, cluster_offset;

     int k;

static void inc_refcounts(BlockDriverState *bs,

                          BdrvCheckResult *res,

                          uint16_t *refcount_table,

                          int refcount_table_size,

                          int64_t offset, int64_t size)

{

    BDRVQcowState *s = bs->opaque;

    int64_t start, last, cluster_offset;

    int k;

    if (size <= 0)

        return;

    start = start_of_cluster(s, offset);

    last = start_of_cluster(s, offset + size - 1);

    for(cluster_offset = start; cluster_offset <= last;

        cluster_offset += s->cluster_size) {

        k = cluster_offset >> s->cluster_bits;

        if (k < 0) {

            fprintf(stderr, "ERROR: invalid cluster offset=0x%" PRIx64 "\n",

                cluster_offset);

            res->corruptions++;

        } else if (k >= refcount_table_size) {

            fprintf(stderr, "Warning: cluster offset=0x%" PRIx64 " is after "

                "the end of the image file, can't properly check refcounts.\n",

                cluster_offset);

            res->check_errors++;

        } else {

            if (++refcount_table[k] == 0) {

                fprintf(stderr, "ERROR: overflow cluster offset=0x%" PRIx64

                    "\n", cluster_offset);

                res->corruptions++;

            }

        }

    }

}


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

     /*

+     * the max data ACPI can write one time which is transferred by
+
+     * 'Set Namespace Label Data' function.
+
+     */

     max_set_size = dsm_memory_size - offsetof(NvdimmDsmIn, arg3) -

static uint32_t nvdimm_get_max_xfer_label_size(void)

{

    uint32_t max_get_size, max_set_size, dsm_memory_size = 4096;

    /*

     * the max data ACPI can read one time which is transferred by

     * the response of 'Get Namespace Label Data' function.

     */

    max_get_size = dsm_memory_size - sizeof(NvdimmFuncGetLabelDataOut);

    /*

     * the max data ACPI can write one time which is transferred by

     * 'Set Namespace Label Data' function.

     */

    max_set_size = dsm_memory_size - offsetof(NvdimmDsmIn, arg3) -

                   sizeof(NvdimmFuncSetLabelDataIn);

    return MIN(max_get_size, max_set_size);

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
     cc->gdb_read_register = s390_cpu_gdb_read_register;

     cc->gdb_write_register = s390_cpu_gdb_write_register;
+
+#ifndef CONFIG_USER_ONLY
+
+    cc->get_phys_page_debug = s390_cpu_get_phys_page_debug;
+

 #endif

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

{

    S390CPUClass *scc = S390_CPU_CLASS(oc);

    CPUClass *cc = CPU_CLASS(scc);

    DeviceClass *dc = DEVICE_CLASS(oc);

    scc->parent_realize = dc->realize;

    dc->realize = s390_cpu_realizefn;

    scc->parent_reset = cc->reset;

    cc->reset = s390_cpu_reset;

    cc->do_interrupt = s390_cpu_do_interrupt;

    cc->dump_state = s390_cpu_dump_state;

    cc->set_pc = s390_cpu_set_pc;

    cc->gdb_read_register = s390_cpu_gdb_read_register;

    cc->gdb_write_register = s390_cpu_gdb_write_register;

#ifndef CONFIG_USER_ONLY

    cc->get_phys_page_debug = s390_cpu_get_phys_page_debug;

#endif

    dc->vmsd = &vmstate_s390_cpu;

    cc->gdb_num_core_regs = S390_NUM_REGS;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void sd_response_r1_make(SDState *sd, uint8_t *response)

+{

     uint32_t status = sd->card_status;

static void sd_response_r1_make(SDState *sd, uint8_t *response)

{

    uint32_t status = sd->card_status;

    /* Clear the "clear on read" status bits (except APP_CMD) */

    sd->card_status &= ~CARD_STATUS_C | APP_CMD;

    response[0] = (status >> 24) & 0xff;

    response[1] = (status >> 16) & 0xff;

    response[2] = (status >> 8) & 0xff;

    response[3] = (status >> 0) & 0xff;

}


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

     switch (index) {
+
+    case 0x0004:
+
+        length = usb_desc_msos_compat(desc, buf);
+
         break;

     case 0x0005:

int usb_desc_msos(const USBDesc *desc,  USBPacket *p,

                  int index, uint8_t *dest, size_t len)

{

    void *buf = g_malloc0(4096);

    int length = 0;

    switch (index) {

    case 0x0004:

        length = usb_desc_msos_compat(desc, buf);

        break;

    case 0x0005:

        length = usb_desc_msos_prop(desc, buf);

        break;

    }

    if (length > len) {

        length = len;

    }

    memcpy(dest, buf, length);

    free(buf);

    p->actual_length = length;

    return 0;

}


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

 {

+    return ((uint64_t)pci_get_word(d->config + base) & PCI_MEMORY_RANGE_MASK)
+
         << 16;

 }

static uint64_t pci_config_get_memory_base(PCIDevice *d, uint32_t base)

{

    return ((uint64_t)pci_get_word(d->config + base) & PCI_MEMORY_RANGE_MASK)

        << 16;

}


static void decode_mb(MadContext *t, int inter)

{

    MpegEncContext *s = &t->s;

    int mv_map = 0;

    int mv_x, mv_y;

    int j;

    if (inter) {

        int v = decode210(&s->gb);

        if (v < 2) {

            mv_map = v ? get_bits(&s->gb, 6) : 63;

            mv_x = decode_motion(&s->gb);

            mv_y = decode_motion(&s->gb);

        } else {

            mv_map = 0;

        }

    }

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

        if (mv_map & (1<<j)) {  // mv_x and mv_y are guarded by mv_map

            int add = 2*decode_motion(&s->gb);

            comp_block(t, s->mb_x, s->mb_y, j, mv_x, mv_y, add);

        } else {

            s->dsp.clear_block(t->block);

            decode_block_intra(t, t->block);

            idct_put(t, t->block, s->mb_x, s->mb_y, j);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static bool use_exit_tb(DisasContext *s)
+
 {

     return (s->singlestep_enabled ||

static bool use_exit_tb(DisasContext *s)

{

    return (s->singlestep_enabled ||

            (s->tb->cflags & CF_LAST_IO) ||

            (s->tb->flags & FLAG_MASK_PER));

}


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

     case R_LCR:
+
+    case R_MCR:
+
+    case R_DIV:
+
         error_report("lm32_uart: read access to write only register 0x"

                 TARGET_FMT_plx, addr << 2);

static uint64_t uart_read(void *opaque, target_phys_addr_t addr,

                          unsigned size)

{

    LM32UartState *s = opaque;

    uint32_t r = 0;

    addr >>= 2;

    switch (addr) {

    case R_RXTX:

        r = s->regs[R_RXTX];

        s->regs[R_LSR] &= ~LSR_DR;

        uart_update_irq(s);

        break;

    case R_IIR:

    case R_LSR:

    case R_MSR:

        r = s->regs[addr];

        break;

    case R_IER:

    case R_LCR:

    case R_MCR:

    case R_DIV:

        error_report("lm32_uart: read access to write only register 0x"

                TARGET_FMT_plx, addr << 2);

        break;

    default:

        error_report("lm32_uart: read access to unknown register 0x"

                TARGET_FMT_plx, addr << 2);

        break;

    }

    trace_lm32_uart_memory_read(addr << 2, r);

    return r;

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 int ff_unlock_avcodec(const AVCodec *codec)
+
 {

     if (codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE || !codec->init)
+
+        return 0;

+

     av_assert0(ff_avcodec_locked);

int ff_unlock_avcodec(const AVCodec *codec)

{

    if (codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE || !codec->init)

        return 0;

    av_assert0(ff_avcodec_locked);

    ff_avcodec_locked = 0;

    atomic_fetch_add(&entangled_thread_counter, -1);

    if (lockmgr_cb) {

        if ((*lockmgr_cb)(&codec_mutex, AV_LOCK_RELEASE))

            return -1;

    }

    return 0;

}


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

 {

+    DeviceClass *dc = DEVICE_CLASS(klass);

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    dc->realize = pit_common_realize;

    dc->vmsd = &vmstate_pit_common;

    dc->no_user = 1;

}


--- a/source.c
+++ b/source.c
@@ -27,11 +27,11 @@
         if (ret != 0)

             av_log(h, AV_LOG_ERROR, "pthread_join(): %s\n", strerror(ret));
+
+    }
+
+
+
     pthread_mutex_destroy(&s->mutex);

     pthread_cond_destroy(&s->cond);

static int udp_close(URLContext *h)

{

    UDPContext *s = h->priv_data;

    int ret;

    if (s->is_multicast && (h->flags & AVIO_FLAG_READ))

        udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr);

    closesocket(s->udp_fd);

    av_fifo_free(s->fifo);

#if HAVE_PTHREADS

    if (s->thread_started) {

        pthread_cancel(s->circular_buffer_thread);

        ret = pthread_join(s->circular_buffer_thread, NULL);

        if (ret != 0)

            av_log(h, AV_LOG_ERROR, "pthread_join(): %s\n", strerror(ret));

    }

    pthread_mutex_destroy(&s->mutex);

    pthread_cond_destroy(&s->cond);

#endif

    return 0;

}


--- 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
@@ -6,10 +6,10 @@

 {

+    sigset_t set, oldset;
+
+    int err;
+
     pthread_attr_t attr;

void qemu_thread_create(QemuThread *thread, const char *name,

                       void *(*start_routine)(void*),

                       void *arg, int mode)

{

    sigset_t set, oldset;

    int err;

    pthread_attr_t attr;

    err = pthread_attr_init(&attr);

    if (err) {

        error_exit(err, __func__);

    }

    if (mode == QEMU_THREAD_DETACHED) {

        err = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);

        if (err) {

            error_exit(err, __func__);

        }

    }

    /* Leave signal handling to the iothread.  */

    sigfillset(&set);

    pthread_sigmask(SIG_SETMASK, &set, &oldset);

    err = pthread_create(&thread->thread, &attr, start_routine, arg);

    if (err)

        error_exit(err, __func__);

    if (name_threads) {

        qemu_thread_set_name(thread, name);

    }

    pthread_sigmask(SIG_SETMASK, &oldset, NULL);

    pthread_attr_destroy(&attr);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void kvm_irqchip_add_irq_route(KVMState *s, int irq, int irqchip, int pin)
+
 {

     struct kvm_irq_routing_entry e;

void kvm_irqchip_add_irq_route(KVMState *s, int irq, int irqchip, int pin)

{

    struct kvm_irq_routing_entry e;

    assert(pin < s->gsi_count);

    e.gsi = irq;

    e.type = KVM_IRQ_ROUTING_IRQCHIP;

    e.flags = 0;

    e.u.irqchip.irqchip = irqchip;

    e.u.irqchip.pin = pin;

    kvm_add_routing_entry(s, &e);

}


--- a/source.c
+++ b/source.c
@@ -43,11 +43,11 @@
     if (block_mig_state.total_sector_sum != 0) {

         progress = completed_sector_sum * 100 /
+
+                   block_mig_state.total_sector_sum;
+
+    } else {
+
         progress = 100;

     }

static int blk_mig_save_bulked_block(QEMUFile *f)

{

    int64_t completed_sector_sum = 0;

    BlkMigDevState *bmds;

    int progress;

    int ret = 0;

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

        if (bmds->bulk_completed == 0) {

            if (mig_save_device_bulk(f, bmds) == 1) {

                /* completed bulk section for this device */

                bmds->bulk_completed = 1;

            }

            completed_sector_sum += bmds->completed_sectors;

            ret = 1;

            break;

        } else {

            completed_sector_sum += bmds->completed_sectors;

        }

    }

    if (block_mig_state.total_sector_sum != 0) {

        progress = completed_sector_sum * 100 /

                   block_mig_state.total_sector_sum;

    } else {

        progress = 100;

    }

    if (progress != block_mig_state.prev_progress) {

        block_mig_state.prev_progress = progress;

        qemu_put_be64(f, (progress << BDRV_SECTOR_BITS)

                         | BLK_MIG_FLAG_PROGRESS);

        DPRINTF("Completed %d %%\r", progress);

    }

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -24,11 +24,11 @@
         assert(client->info.flags & NBD_FLAG_SEND_FUA);

         request.flags |= NBD_CMD_FLAG_FUA;
+
+    }
+
+
+
     assert(bytes <= NBD_MAX_BUFFER_SIZE);

int nbd_client_co_pwritev(BlockDriverState *bs, uint64_t offset,

                          uint64_t bytes, QEMUIOVector *qiov, int flags)

{

    NBDClientSession *client = nbd_get_client_session(bs);

    NBDRequest request = {

        .type = NBD_CMD_WRITE,

        .from = offset,

        .len = bytes,

    };

    if (flags & BDRV_REQ_FUA) {

        assert(client->info.flags & NBD_FLAG_SEND_FUA);

        request.flags |= NBD_CMD_FLAG_FUA;

    }

    assert(bytes <= NBD_MAX_BUFFER_SIZE);

    return nbd_co_request(bs, &request, qiov);

}


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

     switch (AV_RL32(&p->buf[0])) {
+
     case ISNh_TAG:

     case SCHl_TAG:

static int ea_probe(AVProbeData *p)

{

    switch (AV_RL32(&p->buf[0])) {

    case ISNh_TAG:

    case SCHl_TAG:

    case SEAD_TAG:

    case SHEN_TAG:

    case kVGT_TAG:

    case MADk_TAG:

    case MPCh_TAG:

    case MVhd_TAG:

    case MVIh_TAG:

        break;

    default:

        return 0;

    }

    if (AV_RL32(&p->buf[4]) > 0xfffff && AV_RB32(&p->buf[4]) > 0xfffff)

        return 0;

    return AVPROBE_SCORE_MAX;

}


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

             if (!atomic_load(&s->refcount))

+                sem_post(&s->refsync);
+
+        } else if (avbuf->context->streamon)
+
+            ff_v4l2_buffer_enqueue(avbuf);

static void v4l2_free_buffer(void *opaque, uint8_t *unused)

{

    V4L2Buffer* avbuf = opaque;

    V4L2m2mContext *s = buf_to_m2mctx(avbuf);

    if (atomic_fetch_sub(&avbuf->context_refcount, 1) == 1) {

        atomic_fetch_sub_explicit(&s->refcount, 1, memory_order_acq_rel);

        if (s->reinit) {

            if (!atomic_load(&s->refcount))

                sem_post(&s->refsync);

        } else if (avbuf->context->streamon)

            ff_v4l2_buffer_enqueue(avbuf);

        av_buffer_unref(&avbuf->context_ref);

    }

}


--- a/source.c
+++ b/source.c
@@ -35,11 +35,11 @@
     job->opaque        = opaque;

     job->busy          = true;
+
+    bs->job = job;
+
+
+
     /* Only set speed when necessary to avoid NotSupported error */

     if (speed != 0) {

void *block_job_create(const BlockJobDriver *driver, BlockDriverState *bs,

                       int64_t speed, BlockDriverCompletionFunc *cb,

                       void *opaque, Error **errp)

{

    BlockJob *job;

    if (bs->job || bdrv_in_use(bs)) {

        error_set(errp, QERR_DEVICE_IN_USE, bdrv_get_device_name(bs));

        return NULL;

    }

    bdrv_ref(bs);

    bdrv_set_in_use(bs, 1);

    job = g_malloc0(driver->instance_size);

    job->driver        = driver;

    job->bs            = bs;

    job->cb            = cb;

    job->opaque        = opaque;

    job->busy          = true;

    bs->job = job;

    /* Only set speed when necessary to avoid NotSupported error */

    if (speed != 0) {

        Error *local_err = NULL;

        block_job_set_speed(job, speed, &local_err);

        if (local_err) {

            bs->job = NULL;

            g_free(job);

            bdrv_set_in_use(bs, 0);

            error_propagate(errp, local_err);

            return NULL;

        }

    }

    return job;

}


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

+    /* Decorrelate and scale to output depth */
+
+    while (count--) {
+
+        left = *decoded1 - (*decoded0 / 2);

         right = left + *decoded0;

static void ape_unpack_stereo(APEContext *ctx, int count)

{

    int32_t left, right;

    int32_t *decoded0 = ctx->decoded[0];

    int32_t *decoded1 = ctx->decoded[1];

    if (ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) {

        /* We are pure silence, so we're done. */

        av_log(ctx->avctx, AV_LOG_DEBUG, "pure silence stereo\n");

        return;

    }

    entropy_decode(ctx, count, 1);

    ape_apply_filters(ctx, decoded0, decoded1, count);

    /* Now apply the predictor decoding */

    predictor_decode_stereo(ctx, count);

    /* Decorrelate and scale to output depth */

    while (count--) {

        left = *decoded1 - (*decoded0 / 2);

        right = left + *decoded0;

        *(decoded0++) = left;

        *(decoded1++) = right;

    }

}


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

     pci_config_set_vendor_id(dev->config, PCI_VENDOR_ID_DEC);
+
+    pci_config_set_device_id(dev->config, PCI_DEVICE_ID_DEC_21154);
+
+    return 0;
+
 }

static int dec_21154_initfn(PCIDevice *dev)

{

    int rc;

    rc = pci_bridge_initfn(dev);

    if (rc < 0) {

        return rc;

    }

    pci_config_set_vendor_id(dev->config, PCI_VENDOR_ID_DEC);

    pci_config_set_device_id(dev->config, PCI_DEVICE_ID_DEC_21154);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
             continue;

         }
+
+
+
+        tswap32s(&req->req.tmf->type);
+
         if (req->req.tmf->type == VIRTIO_SCSI_T_TMF) {

             if (virtio_scsi_parse_req(req, sizeof(VirtIOSCSICtrlTMFReq),

static void virtio_scsi_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq)

{

    VirtIOSCSI *s = (VirtIOSCSI *)vdev;

    VirtIOSCSIReq *req;

    while ((req = virtio_scsi_pop_req(s, vq))) {

        int type;

        if (iov_to_buf(req->elem.out_sg, req->elem.out_num, 0,

                       &type, sizeof(type)) < sizeof(type)) {

            virtio_scsi_bad_req();

            continue;

        }

        tswap32s(&req->req.tmf->type);

        if (req->req.tmf->type == VIRTIO_SCSI_T_TMF) {

            if (virtio_scsi_parse_req(req, sizeof(VirtIOSCSICtrlTMFReq),

                                      sizeof(VirtIOSCSICtrlTMFResp)) < 0) {

                virtio_scsi_bad_req();

            } else {

                virtio_scsi_do_tmf(s, req);

            }

        } else if (req->req.tmf->type == VIRTIO_SCSI_T_AN_QUERY ||

                   req->req.tmf->type == VIRTIO_SCSI_T_AN_SUBSCRIBE) {

            if (virtio_scsi_parse_req(req, sizeof(VirtIOSCSICtrlANReq),

                                      sizeof(VirtIOSCSICtrlANResp)) < 0) {

                virtio_scsi_bad_req();

            } else {

                req->resp.an->event_actual = 0;

                req->resp.an->response = VIRTIO_SCSI_S_OK;

            }

        }

        virtio_scsi_complete_req(req);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void matroska_merge_packets(AVPacket *out, AVPacket *in)
+
 {

     out->data = av_realloc(out->data, out->size+in->size);

static void matroska_merge_packets(AVPacket *out, AVPacket *in)

{

    out->data = av_realloc(out->data, out->size+in->size);

    memcpy(out->data+out->size, in->data, in->size);

    out->size += in->size;

    av_destruct_packet(in);

    av_free(in);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void breakpoint_invalidate(CPUArchState *env, target_ulong pc)
+
 {

     tb_invalidate_phys_addr(cpu_get_phys_page_debug(env, pc));

static void breakpoint_invalidate(CPUArchState *env, target_ulong pc)

{

    tb_invalidate_phys_addr(cpu_get_phys_page_debug(env, pc));

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     uint16_t rc;

     BusChild *kid;
+
     SCLPEvent *event;

     SCLPEventClass *ec;

static uint16_t handle_write_event_buf(SCLPEventFacility *ef,

                                       EventBufferHeader *event_buf, SCCB *sccb)

{

    uint16_t rc;

    BusChild *kid;

    SCLPEvent *event;

    SCLPEventClass *ec;

    QTAILQ_FOREACH(kid, &ef->sbus.qbus.children, sibling) {

        DeviceState *qdev = kid->child;

        event = (SCLPEvent *) qdev;

        ec = SCLP_EVENT_GET_CLASS(event);

        rc = SCLP_RC_INVALID_FUNCTION;

        if (ec->write_event_data &&

            ec->event_type() == event_buf->type) {

            rc = ec->write_event_data(event, event_buf);

            break;

        }

    }

    return rc;

}


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

     if ((credp->fc_uid == -1 && credp->fc_gid == -1) ||
+
             (fs_ctx->fs_sm == SM_PASSTHROUGH)) {

         return lchown(rpath(fs_ctx, path), credp->fc_uid, credp->fc_gid);

static int local_chown(FsContext *fs_ctx, const char *path, FsCred *credp)

{

    if ((credp->fc_uid == -1 && credp->fc_gid == -1) ||

            (fs_ctx->fs_sm == SM_PASSTHROUGH)) {

        return lchown(rpath(fs_ctx, path), credp->fc_uid, credp->fc_gid);

    } else if (fs_ctx->fs_sm == SM_MAPPED) {

        return local_set_xattr(rpath(fs_ctx, path), credp);

    } else if (fs_ctx->fs_sm == SM_PASSTHROUGH) {

        return lchown(rpath(fs_ctx, path), credp->fc_uid, credp->fc_gid);

    }

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void set_sigmask(const sigset_t *set)
+
 {

     do_sigprocmask(SIG_SETMASK, set, NULL);

static void set_sigmask(const sigset_t *set)

{

    do_sigprocmask(SIG_SETMASK, set, NULL);

}


--- a/source.c
+++ b/source.c
@@ -9,9 +9,9 @@
     pc_find_cpu_slot(MACHINE(pcms), cpu->apic_id, &idx);
     assert(idx != -1);
     if (idx == 0) {
+        error_setg(&local_err, "Boot CPU is unpluggable");
+    hhc = HOTPLUG_HANDLER_GET_CLASS(pcms->acpi_dev);
+    hhc->unplug_request(HOTPLUG_HANDLER(pcms->acpi_dev), dev, &local_err);
+    if (local_err) {
  out:
     error_propagate(errp, local_err);

static void pc_cpu_unplug_request_cb(HotplugHandler *hotplug_dev,
                                     DeviceState *dev, Error **errp)
{
    int idx = -1;
    HotplugHandlerClass *hhc;
    Error *local_err = NULL;
    X86CPU *cpu = X86_CPU(dev);
    PCMachineState *pcms = PC_MACHINE(hotplug_dev);
    pc_find_cpu_slot(MACHINE(pcms), cpu->apic_id, &idx);
    assert(idx != -1);
    if (idx == 0) {
        error_setg(&local_err, "Boot CPU is unpluggable");
    hhc = HOTPLUG_HANDLER_GET_CLASS(pcms->acpi_dev);
    hhc->unplug_request(HOTPLUG_HANDLER(pcms->acpi_dev), dev, &local_err);
    if (local_err) {
 out:
    error_propagate(errp, local_err);


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

     err = qemu_strtoull(str, &endptr, 0, &res);
+
+
+
+    g_assert_cmpint(err, ==, 0);
+
     g_assert_cmpint(res, ==, -321);

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

static void test_qemu_strtoull_negative(void)

{

    const char *str = "  \t -321";

    char f = 'X';

    const char *endptr = &f;

    uint64_t res = 999;

    int err;

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

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, -321);

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

}


static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){

    if(get_rac(c, state+0))

        return 0;

    else{

        int i, e, a;

        e= 0;

        while(get_rac(c, state+1 + e)){ //1..10

            e++;

        }

        assert(e<=9);

        a= 1;

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

            a += a + get_rac(c, state+22 + i); //22..31

        }

        if(is_signed && get_rac(c, state+11 + e)) //11..21

            return -a;

        else

            return a;

    }

}


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

 {

+    SysBusESPState *sysbus = opaque;
+
+    uint32_t saddr;
+

     saddr = addr >> sysbus->it_shift;

static void sysbus_esp_mem_write(void *opaque, target_phys_addr_t addr,

                                 uint64_t val, unsigned int size)

{

    SysBusESPState *sysbus = opaque;

    uint32_t saddr;

    saddr = addr >> sysbus->it_shift;

    esp_reg_write(&sysbus->esp, saddr, val);

}


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

             ret = 0;

+        } else if (ret >= 0) {

             /* Short reads mean EOF, pad with zeros. */

static void qemu_laio_process_completion(struct qemu_laiocb *laiocb)

{

    int ret;

    ret = laiocb->ret;

    if (ret != -ECANCELED) {

        if (ret == laiocb->nbytes) {

            ret = 0;

        } else if (ret >= 0) {

            /* Short reads mean EOF, pad with zeros. */

            if (laiocb->is_read) {

                qemu_iovec_memset(laiocb->qiov, ret, 0,

                    laiocb->qiov->size - ret);

            } else {

                ret = -ENOSPC;

            }

        }

    }

    laiocb->ret = ret;

    if (laiocb->co) {

        /* Jump and continue completion for foreign requests, don't do

         * anything for current request, it will be completed shortly. */

        if (laiocb->co != qemu_coroutine_self()) {

            qemu_coroutine_enter(laiocb->co);

        }

    } else {

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

        qemu_aio_unref(laiocb);

    }

}


--- a/source.c
+++ b/source.c
@@ -4,4 +4,4 @@
     QmpInputVisitor *qiv = to_qiv(v);
     QObject *qobj = qmp_input_get_object(qiv, name, true);
     qobject_incref(qobj);
+    *obj = qobj;

static void qmp_input_type_any(Visitor *v, const char *name, QObject **obj,
                               Error **errp)
{
    QmpInputVisitor *qiv = to_qiv(v);
    QObject *qobj = qmp_input_get_object(qiv, name, true);
    qobject_incref(qobj);
    *obj = qobj;