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

     res = float64_sub(a, b, &env->fp_status);

+    if (float64_is_nan(res)) {
+
+        /* +/-inf compares equal against itself, but sub returns nan.  */
+
+        if (!float64_is_nan(a)

             && !float64_is_nan(b)) {

float64 HELPER(sub_cmp_f64)(CPUState *env, float64 a, float64 b)

{

    /* ??? This may incorrectly raise exceptions.  */

    /* ??? Should flush denormals to zero.  */

    float64 res;

    res = float64_sub(a, b, &env->fp_status);

    if (float64_is_nan(res)) {

        /* +/-inf compares equal against itself, but sub returns nan.  */

        if (!float64_is_nan(a)

            && !float64_is_nan(b)) {

            res = float64_zero;

            if (float64_lt_quiet(a, res, &env->fp_status))

                res = float64_chs(res);

        }

    }

    return res;

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
     if (index == MAX_SCLP_CONSOLES) {

         fprintf(stderr, "qemu: too many sclp consoles\n");
+
+        exit(1);
+
+    }
+

     assert(arch_type == QEMU_ARCH_S390X);

static int sclp_parse(const char *devname)

{

    QemuOptsList *device = qemu_find_opts("device");

    static int index = 0;

    char label[32];

    QemuOpts *dev_opts;

    if (strcmp(devname, "none") == 0) {

        return 0;

    }

    if (index == MAX_SCLP_CONSOLES) {

        fprintf(stderr, "qemu: too many sclp consoles\n");

        exit(1);

    }

    assert(arch_type == QEMU_ARCH_S390X);

    dev_opts = qemu_opts_create(device, NULL, 0, NULL);

    qemu_opt_set(dev_opts, "driver", "sclpconsole", &error_abort);

    snprintf(label, sizeof(label), "sclpcon%d", index);

    sclp_hds[index] = qemu_chr_new(label, devname, NULL);

    if (!sclp_hds[index]) {

        fprintf(stderr, "qemu: could not connect sclp console"

                " to character backend '%s'\n", devname);

        return -1;

    }

    qemu_opt_set(dev_opts, "chardev", label, &error_abort);

    index++;

    return 0;

}


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

 {

+    AVStream *st;

@@ -13,7 +13,7 @@
     st = c->fc->streams[c->fc->nb_streams-1];

+
     if ((uint64_t)atom.size > (1<<30))

         return AVERROR_INVALIDDATA;

static int mov_read_glbl(MOVContext *c, AVIOContext *pb, MOVAtom atom)

{

    AVStream *st;

    if (c->fc->nb_streams < 1)

        return 0;

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

    if ((uint64_t)atom.size > (1<<30))

        return AVERROR_INVALIDDATA;

    if (atom.size >= 10) {

        // Broken files created by legacy versions of libavformat will

        // wrap a whole fiel atom inside of a glbl atom.

        unsigned size = avio_rb32(pb);

        unsigned type = avio_rl32(pb);

        avio_seek(pb, -8, SEEK_CUR);

        if (type == MKTAG('f','i','e','l') && size == atom.size)

            return mov_read_default(c, pb, atom);

    }

    av_free(st->codec->extradata);

    st->codec->extradata = av_mallocz(atom.size + FF_INPUT_BUFFER_PADDING_SIZE);

    if (!st->codec->extradata)

        return AVERROR(ENOMEM);

    st->codec->extradata_size = atom.size;

    avio_read(pb, st->codec->extradata, atom.size);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void mips_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,

                          int flags)
+
 {
+
     MIPSCPU *cpu = MIPS_CPU(cs);

     CPUMIPSState *env = &cpu->env;
@@ -13,8 +13,8 @@

     cpu_fprintf(f, "pc=0x" TARGET_FMT_lx " HI=0x" TARGET_FMT_lx
+
+                " LO=0x" TARGET_FMT_lx " ds %04x "

                 TARGET_FMT_lx " " TARGET_FMT_ld "\n",

void mips_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,

                         int flags)

{

    MIPSCPU *cpu = MIPS_CPU(cs);

    CPUMIPSState *env = &cpu->env;

    int i;

    cpu_fprintf(f, "pc=0x" TARGET_FMT_lx " HI=0x" TARGET_FMT_lx

                " LO=0x" TARGET_FMT_lx " ds %04x "

                TARGET_FMT_lx " " TARGET_FMT_ld "\n",

                env->active_tc.PC, env->active_tc.HI[0], env->active_tc.LO[0],

                env->hflags, env->btarget, env->bcond);

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

        if ((i & 3) == 0)

            cpu_fprintf(f, "GPR%02d:", i);

        cpu_fprintf(f, " %s " TARGET_FMT_lx, regnames[i], env->active_tc.gpr[i]);

        if ((i & 3) == 3)

            cpu_fprintf(f, "\n");

    }

    cpu_fprintf(f, "CP0 Status  0x%08x Cause   0x%08x EPC    0x" TARGET_FMT_lx "\n",

                env->CP0_Status, env->CP0_Cause, env->CP0_EPC);

    cpu_fprintf(f, "    Config0 0x%08x Config1 0x%08x LLAddr 0x%016"

                PRIx64 "\n",

                env->CP0_Config0, env->CP0_Config1, env->lladdr);

    cpu_fprintf(f, "    Config2 0x%08x Config3 0x%08x\n",

                env->CP0_Config2, env->CP0_Config3);

    cpu_fprintf(f, "    Config4 0x%08x Config5 0x%08x\n",

                env->CP0_Config4, env->CP0_Config5);

    if (env->hflags & MIPS_HFLAG_FPU)

        fpu_dump_state(env, f, cpu_fprintf, flags);

#if defined(TARGET_MIPS64) && defined(MIPS_DEBUG_SIGN_EXTENSIONS)

    cpu_mips_check_sign_extensions(env, f, cpu_fprintf, flags);

#endif

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
     r->req.aiocb = bdrv_aio_ioctl(bdrv, SG_IO, &r->io_header, complete, r);

     if (r->req.aiocb == NULL) {
+
+        return -EIO;
+
+    }
+

     return 0;

static int execute_command(BlockDriverState *bdrv,

                           SCSIGenericReq *r, int direction,

                           BlockCompletionFunc *complete)

{

    r->io_header.interface_id = 'S';

    r->io_header.dxfer_direction = direction;

    r->io_header.dxferp = r->buf;

    r->io_header.dxfer_len = r->buflen;

    r->io_header.cmdp = r->req.cmd.buf;

    r->io_header.cmd_len = r->req.cmd.len;

    r->io_header.mx_sb_len = sizeof(r->req.sense);

    r->io_header.sbp = r->req.sense;

    r->io_header.timeout = MAX_UINT;

    r->io_header.usr_ptr = r;

    r->io_header.flags |= SG_FLAG_DIRECT_IO;

    r->req.aiocb = bdrv_aio_ioctl(bdrv, SG_IO, &r->io_header, complete, r);

    if (r->req.aiocb == NULL) {

        return -EIO;

    }

    return 0;

}


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

     int fd, ret;

+
+
+    av_strstart(filename, "unix:", &filename);

     s->addr.sun_family = AF_UNIX;

static int unix_open(URLContext *h, const char *filename, int flags)

{

    UnixContext *s = h->priv_data;

    int fd, ret;

    av_strstart(filename, "unix:", &filename);

    s->addr.sun_family = AF_UNIX;

    av_strlcpy(s->addr.sun_path, filename, sizeof(s->addr.sun_path));

    if ((fd = ff_socket(AF_UNIX, s->type, 0)) < 0)

        return ff_neterrno();

    if (s->listen) {

        fd = ff_listen_bind(fd, (struct sockaddr *)&s->addr,

                            sizeof(s->addr), s->timeout, h);

        if (fd < 0) {

            ret = fd;

            goto fail;

        }

    } else {

        ret = ff_listen_connect(fd, (struct sockaddr *)&s->addr,

                                sizeof(s->addr), s->timeout, h, 0);

        if (ret < 0)

            goto fail;

    }

    s->fd = fd;

    return 0;

fail:

    if (s->listen && AVUNERROR(ret) != EADDRINUSE)

        unlink(s->addr.sun_path);

    if (fd >= 0)

        closesocket(fd);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void xtensa_lx60_init(MachineState *machine)

 {
+
+    static const LxBoardDesc lx60_board = {
+
+        .flash_base = 0xf8000000,

         .flash_size = 0x00400000,

static void xtensa_lx60_init(MachineState *machine)

{

    static const LxBoardDesc lx60_board = {

        .flash_base = 0xf8000000,

        .flash_size = 0x00400000,

        .flash_sector_size = 0x10000,

        .sram_size = 0x20000,

    };

    lx_init(&lx60_board, machine);

}


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

                     omap_rtc_writefn, s, DEVICE_NATIVE_ENDIAN);

+    cpu_register_physical_memory(base, 0x800, iomemtype);
+
+
+
+    return s;

 }

static struct omap_rtc_s *omap_rtc_init(target_phys_addr_t base,

                qemu_irq *irq, omap_clk clk)

{

    int iomemtype;

    struct omap_rtc_s *s = (struct omap_rtc_s *)

            qemu_mallocz(sizeof(struct omap_rtc_s));

    s->irq = irq[0];

    s->alarm = irq[1];

    s->clk = qemu_new_timer(rt_clock, omap_rtc_tick, s);

    omap_rtc_reset(s);

    iomemtype = cpu_register_io_memory(omap_rtc_readfn,

                    omap_rtc_writefn, s, DEVICE_NATIVE_ENDIAN);

    cpu_register_physical_memory(base, 0x800, iomemtype);

    return s;

}


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

     test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_NUMBER);
+
+}

static void test_visitor_out_native_list_number(TestOutputVisitorData *data,

                                                const void *unused)

{

    test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_NUMBER);

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     AlphaCPU *cpu;

     ObjectClass *cpu_class;
+
+
+
+    cpu_class = alpha_cpu_class_by_name(cpu_model);
+
     if (cpu_class == NULL) {

         /* Default to ev67; no reason not to emulate insns by default.  */

AlphaCPU *cpu_alpha_init(const char *cpu_model)

{

    AlphaCPU *cpu;

    ObjectClass *cpu_class;

    cpu_class = alpha_cpu_class_by_name(cpu_model);

    if (cpu_class == NULL) {

        /* Default to ev67; no reason not to emulate insns by default.  */

        cpu_class = object_class_by_name(TYPE("ev67"));

    }

    cpu = ALPHA_CPU(object_new(object_class_get_name(cpu_class)));

    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);

    return cpu;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void vfio_msix_enable(VFIOPCIDevice *vdev)

+{

     vfio_disable_interrupts(vdev);

static void vfio_msix_enable(VFIOPCIDevice *vdev)

{

    vfio_disable_interrupts(vdev);

    vdev->msi_vectors = g_malloc0(vdev->msix->entries * sizeof(VFIOMSIVector));

    vdev->interrupt = VFIO_INT_MSIX;

    /*

     * Some communication channels between VF & PF or PF & fw rely on the

     * physical state of the device and expect that enabling MSI-X from the

     * guest enables the same on the host.  When our guest is Linux, the

     * guest driver call to pci_enable_msix() sets the enabling bit in the

     * MSI-X capability, but leaves the vector table masked.  We therefore

     * can't rely on a vector_use callback (from request_irq() in the guest)

     * to switch the physical device into MSI-X mode because that may come a

     * long time after pci_enable_msix().  This code enables vector 0 with

     * triggering to userspace, then immediately release the vector, leaving

     * the physical device with no vectors enabled, but MSI-X enabled, just

     * like the guest view.

     */

    vfio_msix_vector_do_use(&vdev->pdev, 0, NULL, NULL);

    vfio_msix_vector_release(&vdev->pdev, 0);

    if (msix_set_vector_notifiers(&vdev->pdev, vfio_msix_vector_use,

                                  vfio_msix_vector_release, NULL)) {

        error_report("vfio: msix_set_vector_notifiers failed");

    }

    trace_vfio_msix_enable(vdev->vbasedev.name);

}


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

     }
+
+    ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE);
+
+}

static void stream_set_speed(BlockJob *job, int64_t speed, Error **errp)

{

    StreamBlockJob *s = container_of(job, StreamBlockJob, common);

    if (speed < 0) {

        error_set(errp, QERR_INVALID_PARAMETER, "speed");

        return;

    }

    ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE);

}


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

         QTAILQ_FOREACH(port, &vser->ports, next) {
+
+            if (!strcmp(port->name, name)) {
+
+                return port;
+
             }

         }

static VirtIOSerialPort *find_port_by_name(char *name)

{

    VirtIOSerial *vser;

    QLIST_FOREACH(vser, &vserdevices.devices, next) {

        VirtIOSerialPort *port;

        QTAILQ_FOREACH(port, &vser->ports, next) {

            if (!strcmp(port->name, name)) {

                return port;

            }

        }

    }

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void audio_init(ISABus *isa_bus, PCIBus *pci_bus)
+
 {

 }

void audio_init(ISABus *isa_bus, PCIBus *pci_bus)

{

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     const void *val;

     int err, ssf;
+

     if (!vs->sasl.wantSSF)

static int vnc_auth_sasl_check_ssf(VncState *vs)

{

    const void *val;

    int err, ssf;

    if (!vs->sasl.wantSSF)

        return 1;

    err = sasl_getprop(vs->sasl.conn, SASL_SSF, &val);

    if (err != SASL_OK)

        return 0;

    ssf = *(const int *)val;

    VNC_DEBUG("negotiated an SSF of %d\n", ssf);

    if (ssf < 56)

        return 0; /* 56 is good for Kerberos */

    /* Only setup for read initially, because we're about to send an RPC

     * reply which must be in plain text. When the next incoming RPC

     * arrives, we'll switch on writes too

     *

     * cf qemudClientReadSASL  in qemud.c

     */

    vs->sasl.runSSF = 1;

    /* We have a SSF that's good enough */

    return 1;

}


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

     assert(vdc->get_features != NULL);

+    vdev->host_features = vdc->get_features(vdev, vdev->host_features,
+
+                                            errp);
+
+    if (klass->post_plugged != NULL) {

         klass->post_plugged(qbus->parent, errp);

void virtio_bus_device_plugged(VirtIODevice *vdev, Error **errp)

{

    DeviceState *qdev = DEVICE(vdev);

    BusState *qbus = BUS(qdev_get_parent_bus(qdev));

    VirtioBusState *bus = VIRTIO_BUS(qbus);

    VirtioBusClass *klass = VIRTIO_BUS_GET_CLASS(bus);

    VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev);

    DPRINTF("%s: plug device.\n", qbus->name);

    if (klass->device_plugged != NULL) {

        klass->device_plugged(qbus->parent, errp);

    }

    /* Get the features of the plugged device. */

    assert(vdc->get_features != NULL);

    vdev->host_features = vdc->get_features(vdev, vdev->host_features,

                                            errp);

    if (klass->post_plugged != NULL) {

        klass->post_plugged(qbus->parent, errp);

    }

}


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

     exp->ctx = blk_get_aio_context(blk);

+    blk_ref(blk);
+
+    blk_add_aio_context_notifier(blk, blk_aio_attached, blk_aio_detach, exp);
+
+

     exp->eject_notifier.notify = nbd_eject_notifier;

NBDExport *nbd_export_new(BlockBackend *blk, off_t dev_offset, off_t size,

                          uint32_t nbdflags, void (*close)(NBDExport *),

                          Error **errp)

{

    NBDExport *exp = g_malloc0(sizeof(NBDExport));

    exp->refcount = 1;

    QTAILQ_INIT(&exp->clients);

    exp->blk = blk;

    exp->dev_offset = dev_offset;

    exp->nbdflags = nbdflags;

    exp->size = size < 0 ? blk_getlength(blk) : size;

    if (exp->size < 0) {

        error_setg_errno(errp, -exp->size,

                         "Failed to determine the NBD export's length");

        goto fail;

    }

    exp->size -= exp->size % BDRV_SECTOR_SIZE;

    exp->close = close;

    exp->ctx = blk_get_aio_context(blk);

    blk_ref(blk);

    blk_add_aio_context_notifier(blk, blk_aio_attached, blk_aio_detach, exp);

    exp->eject_notifier.notify = nbd_eject_notifier;

    blk_add_remove_bs_notifier(blk, &exp->eject_notifier);

    /*

     * NBD exports are used for non-shared storage migration.  Make sure

     * that BDRV_O_INACTIVE is cleared and the image is ready for write

     * access since the export could be available before migration handover.

     */

    aio_context_acquire(exp->ctx);

    blk_invalidate_cache(blk, NULL);

    aio_context_release(exp->ctx);

    return exp;

fail:

    g_free(exp);

    return NULL;

}


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

     if (s->mtd_ext_size)

static int parse_metadata_ext(DBEContext *s)

{

    if (s->mtd_ext_size)

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

    return 0;

}


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

     if (serial && object_property_find(OBJECT(dev), "serial", NULL)) {

+        qdev_prop_set_string(dev, "serial", serial);
+
+    }
+
+    if (qdev_prop_set_drive(dev, "drive", bdrv) < 0) {

         error_setg(errp, "Setting drive property failed");

SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockDriverState *bdrv,

                                      int unit, bool removable, int bootindex,

                                      const char *serial, Error **errp)

{

    const char *driver;

    DeviceState *dev;

    Error *err = NULL;

    driver = bdrv_is_sg(bdrv) ? "scsi-generic" : "scsi-disk";

    dev = qdev_create(&bus->qbus, driver);

    qdev_prop_set_uint32(dev, "scsi-id", unit);

    if (bootindex >= 0) {

        object_property_set_int(OBJECT(dev), bootindex, "bootindex",

                                &error_abort);

    }

    if (object_property_find(OBJECT(dev), "removable", NULL)) {

        qdev_prop_set_bit(dev, "removable", removable);

    }

    if (serial && object_property_find(OBJECT(dev), "serial", NULL)) {

        qdev_prop_set_string(dev, "serial", serial);

    }

    if (qdev_prop_set_drive(dev, "drive", bdrv) < 0) {

        error_setg(errp, "Setting drive property failed");

        object_unparent(OBJECT(dev));

        return NULL;

    }

    object_property_set_bool(OBJECT(dev), true, "realized", &err);

    if (err != NULL) {

        error_propagate(errp, err);

        object_unparent(OBJECT(dev));

        return NULL;

    }

    return SCSI_DEVICE(dev);

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
                                int64_t count, int64_t *total)

 {
+
+    int ret;
+
+
+
     if (count >> 9 > INT_MAX) {

         return -ERANGE;

static int do_write_compressed(BlockBackend *blk, char *buf, int64_t offset,

                               int64_t count, int64_t *total)

{

    int ret;

    if (count >> 9 > INT_MAX) {

        return -ERANGE;

    }

    ret = blk_write_compressed(blk, offset >> 9, (uint8_t *)buf, count >> 9);

    if (ret < 0) {

        return ret;

    }

    *total = count;

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void HELPER(stfl)(CPUS390XState *env)

 {
+
     uint64_t words[MAX_STFL_WORDS];

void HELPER(stfl)(CPUS390XState *env)

{

    uint64_t words[MAX_STFL_WORDS];

    do_stfle(env, words);

    cpu_stl_data(env, 200, words[0] >> 32);

}


--- a/source.c
+++ b/source.c
@@ -1,17 +1,17 @@
+static int qemu_chr_open_tty(QemuOpts *opts, CharDriverState **_chr)

 {

+    const char *filename = qemu_opt_get(opts, "path");
+
+    CharDriverState *chr;

     int fd;

+    TFR(fd = qemu_open(filename, O_RDWR | O_NONBLOCK));
+
     if (fd < 0) {

         return -errno;

static int qemu_chr_open_tty(QemuOpts *opts, CharDriverState **_chr)

{

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

    CharDriverState *chr;

    int fd;

    TFR(fd = qemu_open(filename, O_RDWR | O_NONBLOCK));

    if (fd < 0) {

        return -errno;

    }

    tty_serial_init(fd, 115200, 'N', 8, 1);

    chr = qemu_chr_open_fd(fd, fd);

    chr->chr_ioctl = tty_serial_ioctl;

    chr->chr_close = qemu_chr_close_tty;

    *_chr = chr;

    return 0;

}


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

     }

+    memset(s->mb_band.state, 0, sizeof(s->mb_band.state));
+
+    memset(s->mv_band[0].state, 0, sizeof(s->mv_band[0].state));
+
+    memset(s->mv_band[1].state, 0, sizeof(s->mv_band[1].state));

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

static void reset_contexts(SnowContext *s){

    int plane_index, level, orientation;

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

        for(level=0; level<s->spatial_decomposition_count; level++){

            for(orientation=level ? 1:0; orientation<4; orientation++){

                memset(s->plane[plane_index].band[level][orientation].state, 0, sizeof(s->plane[plane_index].band[level][orientation].state));

            }

        }

    }

    memset(s->mb_band.state, 0, sizeof(s->mb_band.state));

    memset(s->mv_band[0].state, 0, sizeof(s->mv_band[0].state));

    memset(s->mv_band[1].state, 0, sizeof(s->mv_band[1].state));

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

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void rv34_idct_add_c(uint8_t *dst, int stride, DCTELEM *block){

     int      temp[16];

static void rv34_idct_add_c(uint8_t *dst, int stride, DCTELEM *block){

    int      temp[16];

    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

    int      i;

    rv34_row_transform(temp, block);

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

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

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

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

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

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

        dst[0] = cm[ dst[0] + ( (z0 + z3) >> 10 ) ];

        dst[1] = cm[ dst[1] + ( (z1 + z2) >> 10 ) ];

        dst[2] = cm[ dst[2] + ( (z1 - z2) >> 10 ) ];

        dst[3] = cm[ dst[3] + ( (z0 - z3) >> 10 ) ];

        dst  += stride;

    }

}


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

     val = cpu_inb(addr & IOPORTS_MASK);

+    return val;
+
+}

static uint32_t pci_apb_ioreadb (void *opaque, target_phys_addr_t addr)

{

    uint32_t val;

    val = cpu_inb(addr & IOPORTS_MASK);

    return val;

}


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

 {

+    /* FIXME: this is not exactly optimal solution since VirtualAlloc

        has 64Kb granularity, but at least it guarantees us that the

void *qemu_vmalloc(size_t size)

{

    /* FIXME: this is not exactly optimal solution since VirtualAlloc

       has 64Kb granularity, but at least it guarantees us that the

       memory is page aligned. */

    if (!size) {

        abort();

    }

    return oom_check(VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE));

}


static void vfio_pci_reset_handler(void *opaque)

{

    VFIOGroup *group;

    VFIOPCIDevice *vdev;

    QLIST_FOREACH(group, &group_list, next) {

        QLIST_FOREACH(vdev, &group->device_list, next) {

            if (!vdev->reset_works || (!vdev->has_flr && vdev->has_pm_reset)) {

                vdev->needs_reset = true;

            }

        }

    }

    QLIST_FOREACH(group, &group_list, next) {

        QLIST_FOREACH(vdev, &group->device_list, next) {

            if (vdev->needs_reset) {

                vfio_pci_hot_reset_multi(vdev);

            }

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -27,11 +27,11 @@
     wp->vaddr = addr;

     wp->len = len;
+
+    wp->flags = flags;
+
+
+
     /* keep all GDB-injected watchpoints in front */

     if (flags & BP_GDB) {

int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,

                          int flags, CPUWatchpoint **watchpoint)

{

    CPUWatchpoint *wp;

    /* forbid ranges which are empty or run off the end of the address space */

    if (len == 0 || (addr + len - 1) <= addr) {

        error_report("tried to set invalid watchpoint at %"

                     VADDR_PRIx ", len=%" VADDR_PRIu, addr, len);

        return -EINVAL;

    }

    wp = g_malloc(sizeof(*wp));

    wp->vaddr = addr;

    wp->len = len;

    wp->flags = flags;

    /* keep all GDB-injected watchpoints in front */

    if (flags & BP_GDB) {

        QTAILQ_INSERT_HEAD(&cpu->watchpoints, wp, entry);

    } else {

        QTAILQ_INSERT_TAIL(&cpu->watchpoints, wp, entry);

    }

    tlb_flush_page(cpu, addr);

    if (watchpoint)

        *watchpoint = wp;

    return 0;

}


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

+    if (iov_to_buf(req->elem.out_sg, req->elem.out_num, 0,
+
+                &type, sizeof(type)) < sizeof(type)) {
+
+        virtio_scsi_bad_req();

         return;

void virtio_scsi_handle_ctrl_req(VirtIOSCSI *s, VirtIOSCSIReq *req)

{

    VirtIODevice *vdev = (VirtIODevice *)s;

    int type;

    int r = 0;

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

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

        virtio_scsi_bad_req();

        return;

    }

    virtio_tswap32s(vdev, &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 {

            r = 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;

        }

    }

    if (r == 0) {

        virtio_scsi_complete_req(req);

    } else {

        assert(r == -EINPROGRESS);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 RTCState *rtc_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq,

+                      int base_year)
+
+{
+
+    RTCState *s;

     int io_memory;

RTCState *rtc_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq,

                      int base_year)

{

    RTCState *s;

    int io_memory;

    s = qemu_mallocz(sizeof(RTCState));

    s->irq = irq;

    s->cmos_data[RTC_REG_A] = 0x26;

    s->cmos_data[RTC_REG_B] = 0x02;

    s->cmos_data[RTC_REG_C] = 0x00;

    s->cmos_data[RTC_REG_D] = 0x80;

    s->base_year = base_year;

    rtc_set_date_from_host(s);

    s->periodic_timer = qemu_new_timer(rtc_clock, rtc_periodic_timer, s);

    s->second_timer = qemu_new_timer(rtc_clock, rtc_update_second, s);

    s->second_timer2 = qemu_new_timer(rtc_clock, rtc_update_second2, s);

    s->next_second_time =

        qemu_get_clock(rtc_clock) + (get_ticks_per_sec() * 99) / 100;

    qemu_mod_timer(s->second_timer2, s->next_second_time);

    io_memory = cpu_register_io_memory(rtc_mm_read, rtc_mm_write, s);

    cpu_register_physical_memory(base, 2 << it_shift, io_memory);

    register_savevm("mc146818rtc", base, 1, rtc_save, rtc_load, s);

#ifdef TARGET_I386

    if (rtc_td_hack)

        register_savevm("mc146818rtc-td", base, 1, rtc_save_td, rtc_load_td, s);

#endif

    qemu_register_reset(rtc_reset, s);

    return s;

}


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

     if (CONFIG_D3D11VA)
+
+        return avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD;
+
     else

         return 0;

int ff_dxva2_is_d3d11(const AVCodecContext *avctx)

{

    if (CONFIG_D3D11VA)

        return avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD;

    else

        return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int ffm_is_avail_data(AVFormatContext *s, int size)

+{
+
+    FFMContext *ffm = s->priv_data;
+
+    int64_t pos, avail_size;

     int len;

static int ffm_is_avail_data(AVFormatContext *s, int size)

{

    FFMContext *ffm = s->priv_data;

    int64_t pos, avail_size;

    int len;

    len = ffm->packet_end - ffm->packet_ptr;

    if (size <= len)

        return 1;

    pos = url_ftell(s->pb);

    if (!ffm->write_index) {

        if (pos == ffm->file_size);

            return AVERROR_EOF;

        avail_size = ffm->file_size - pos;

    } else {

    if (pos == ffm->write_index) {

        /* exactly at the end of stream */

        return AVERROR(EAGAIN);

    } else if (pos < ffm->write_index) {

        avail_size = ffm->write_index - pos;

    } else {

        avail_size = (ffm->file_size - pos) + (ffm->write_index - FFM_PACKET_SIZE);

    }

    }

    avail_size = (avail_size / ffm->packet_size) * (ffm->packet_size - FFM_HEADER_SIZE) + len;

    if (size <= avail_size)

        return 1;

    else

        return AVERROR(EAGAIN);

}


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

         mask |= float_flag_underflow;

+    if (val & FPCR_INED)
+
+        mask |= float_flag_inexact;
+
+    env->fp_status.float_exception_mask = mask;

void cpu_alpha_store_fpcr (CPUState *env, uint64_t val)

{

    int round_mode, mask;

    set_float_exception_flags((val >> 52) & 0x3F, &env->fp_status);

    mask = 0;

    if (val & FPCR_INVD)

        mask |= float_flag_invalid;

    if (val & FPCR_DZED)

        mask |= float_flag_divbyzero;

    if (val & FPCR_OVFD)

        mask |= float_flag_overflow;

    if (val & FPCR_UNFD)

        mask |= float_flag_underflow;

    if (val & FPCR_INED)

        mask |= float_flag_inexact;

    env->fp_status.float_exception_mask = mask;

    switch ((val >> FPCR_DYN_SHIFT) & 3) {

    case 0:

        round_mode = float_round_to_zero;

        break;

    case 1:

        round_mode = float_round_down;

        break;

    case 2:

        round_mode = float_round_nearest_even;

        break;

    case 3:

        round_mode = float_round_up;

        break;

    }

    set_float_rounding_mode(round_mode, &env->fp_status);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static int usb_uhci_piix4_initfn(PCIDevice *dev)
+
+{
+
     UHCIState *s = DO_UPCAST(UHCIState, dev, dev);

     uint8_t *pci_conf = s->dev.config;

static int usb_uhci_piix4_initfn(PCIDevice *dev)

{

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

    uint8_t *pci_conf = s->dev.config;

    pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL);

    pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82371AB_2);

    return usb_uhci_common_initfn(s);

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
                                             size_t *naddrs,

                                             SocketAddress ***addrs,
+
+                                            Error **errp)
+
+{
+
     *naddrs = 1;

     *addrs = g_new0(SocketAddress *, 1);

static int qio_dns_resolver_lookup_sync_nop(QIODNSResolver *resolver,

                                            SocketAddress *addr,

                                            size_t *naddrs,

                                            SocketAddress ***addrs,

                                            Error **errp)

{

    *naddrs = 1;

    *addrs = g_new0(SocketAddress *, 1);

    (*addrs)[0] = QAPI_CLONE(SocketAddress, addr);

    return 0;

}


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

     ret = opt->value.uint;

+    if (del) {
+
+        qemu_opt_del_all(opts, name);
+
+    }

     return ret;

static uint64_t qemu_opt_get_number_helper(QemuOpts *opts, const char *name,

                                           uint64_t defval, bool del)

{

    QemuOpt *opt = qemu_opt_find(opts, name);

    uint64_t ret = defval;

    if (opt == NULL) {

        const QemuOptDesc *desc = find_desc_by_name(opts->list->desc, name);

        if (desc && desc->def_value_str) {

            parse_option_number(name, desc->def_value_str, &ret, &error_abort);

        }

        return ret;

    }

    assert(opt->desc && opt->desc->type == QEMU_OPT_NUMBER);

    ret = opt->value.uint;

    if (del) {

        qemu_opt_del_all(opts, name);

    }

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 unsigned avutil_version(void)
 {
+    av_assert0(AV_PIX_FMT_VDA_VLD == 81); //check if the pix fmt enum has not had anything inserted or removed by mistake
+    av_assert0(AV_SAMPLE_FMT_DBLP == 9);
     av_assert0(AVMEDIA_TYPE_ATTACHMENT == 4);
     av_assert0(AV_PICTURE_TYPE_BI == 7);
     av_assert0(LIBAVUTIL_VERSION_MICRO >= 100);

unsigned avutil_version(void)
{
    av_assert0(AV_PIX_FMT_VDA_VLD == 81); //check if the pix fmt enum has not had anything inserted or removed by mistake
    av_assert0(AV_SAMPLE_FMT_DBLP == 9);
    av_assert0(AVMEDIA_TYPE_ATTACHMENT == 4);
    av_assert0(AV_PICTURE_TYPE_BI == 7);
    av_assert0(LIBAVUTIL_VERSION_MICRO >= 100);
    av_assert0(HAVE_MMX2 == HAVE_MMXEXT);
    return LIBAVUTIL_VERSION_INT;


--- a/source.c
+++ b/source.c
@@ -5,10 +5,10 @@
     struct ip_pseudo_header ipph;

     ipph.ip_src = iphdr->ip_src;
+
+    ipph.ip_dst = iphdr->ip_dst;
+
+    ipph.ip_payload = cpu_to_be16(csl);

     ipph.ip_proto = iphdr->ip_p;

eth_calc_pseudo_hdr_csum(struct ip_header *iphdr, uint16_t csl)

{

    struct ip_pseudo_header ipph;

    ipph.ip_src = iphdr->ip_src;

    ipph.ip_dst = iphdr->ip_dst;

    ipph.ip_payload = cpu_to_be16(csl);

    ipph.ip_proto = iphdr->ip_p;

    ipph.zeros = 0;

    return net_checksum_add(sizeof(ipph), (uint8_t *) &ipph);

}


--- a/source.c
+++ b/source.c
@@ -9,9 +9,9 @@
     pci_config_set_device_id(d->config, PCI_DEVICE_ID_DEC_21154);

     pci_set_byte(d->config + PCI_REVISION_ID, 0x02);
+
+    pci_config_set_class(d->config, PCI_CLASS_BRIDGE_PCI);
+
+    return 0;

 }

static int dec_21154_pci_host_init(PCIDevice *d)

{

    /* PCI2PCI bridge same values as PearPC - check this */

    pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_DEC);

    pci_config_set_device_id(d->config, PCI_DEVICE_ID_DEC_21154);

    pci_set_byte(d->config + PCI_REVISION_ID, 0x02);

    pci_config_set_class(d->config, PCI_CLASS_BRIDGE_PCI);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -16,11 +16,11 @@
     }
     trace_usb_uas_command(uas->dev.addr, req->tag,
                           usb_uas_get_lun(req->lun),
+                          req->lun >> 32, req->lun & 0xffffffff);
+    QTAILQ_INSERT_TAIL(&uas->requests, req, next);
+    if (uas_using_streams(uas) && uas->data3[req->tag] != NULL) {
+        req->data = uas->data3[req->tag];
+        req->data_async = true;
         uas->data3[req->tag] = NULL;
     }
     req->req = scsi_req_new(req->dev, req->tag,

static void usb_uas_command(UASDevice *uas, uas_ui *ui)
{
    UASRequest *req;
    uint32_t len;
    uint16_t tag = be16_to_cpu(ui->hdr.tag);
    if (uas_using_streams(uas) && tag > UAS_MAX_STREAMS) {
        goto invalid_tag;
    }
    req = usb_uas_find_request(uas, tag);
    if (req) {
        goto overlapped_tag;
    }
    req = usb_uas_alloc_request(uas, ui);
    if (req->dev == NULL) {
        goto bad_target;
    }
    trace_usb_uas_command(uas->dev.addr, req->tag,
                          usb_uas_get_lun(req->lun),
                          req->lun >> 32, req->lun & 0xffffffff);
    QTAILQ_INSERT_TAIL(&uas->requests, req, next);
    if (uas_using_streams(uas) && uas->data3[req->tag] != NULL) {
        req->data = uas->data3[req->tag];
        req->data_async = true;
        uas->data3[req->tag] = NULL;
    }
    req->req = scsi_req_new(req->dev, req->tag,
                            usb_uas_get_lun(req->lun),
                            ui->command.cdb, req);
    if (uas->requestlog) {
        scsi_req_print(req->req);
    }
    len = scsi_req_enqueue(req->req);
    if (len) {
        req->data_size = len;
        scsi_req_continue(req->req);
    }
overlapped_tag:
    usb_uas_queue_fake_sense(uas, tag, sense_code_OVERLAPPED_COMMANDS);
bad_target:
    usb_uas_queue_fake_sense(uas, tag, sense_code_LUN_NOT_SUPPORTED);
    g_free(req);
}


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

     } else {

+        qmp_output_add(qov, name, qstring_from_str(""));
+
+    }
+
 }

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

                                Error **errp)

{

    QmpOutputVisitor *qov = to_qov(v);

    if (*obj) {

        qmp_output_add(qov, name, qstring_from_str(*obj));

    } else {

        qmp_output_add(qov, name, qstring_from_str(""));

    }

}


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

         }
+
+        virtio_pci_vq_vector_mask(proxy, index, vector);
+
+        vq = virtio_vector_next_queue(vq);
+
     }

 }

static void virtio_pci_vector_mask(PCIDevice *dev, unsigned vector)

{

    VirtIOPCIProxy *proxy = container_of(dev, VirtIOPCIProxy, pci_dev);

    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);

    VirtQueue *vq = virtio_vector_first_queue(vdev, vector);

    int index;

    while (vq) {

        index = virtio_get_queue_index(vq);

        if (!virtio_queue_get_num(vdev, index)) {

            break;

        }

        virtio_pci_vq_vector_mask(proxy, index, vector);

        vq = virtio_vector_next_queue(vq);

    }

}


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

     get_bits(gb, 4); // active_video_parameter_set_id

+    get_bits(gb, 1); // self_contained_cvs_flag
+
+    get_bits(gb, 1); // num_sps_ids_minus1
+
+    num_sps_ids_minus1 = get_ue_golomb_long(gb); // num_sps_ids_minus1

static void active_parameter_sets(HEVCContext *s)

{

    GetBitContext *gb = &s->HEVClc->gb;

    int num_sps_ids_minus1;

    int i;

    get_bits(gb, 4); // active_video_parameter_set_id

    get_bits(gb, 1); // self_contained_cvs_flag

    get_bits(gb, 1); // num_sps_ids_minus1

    num_sps_ids_minus1 = get_ue_golomb_long(gb); // num_sps_ids_minus1

    s->active_seq_parameter_set_id = get_ue_golomb_long(gb);

    for (i = 1; i <= num_sps_ids_minus1; i++)

        get_ue_golomb_long(gb); // active_seq_parameter_set_id[i]

}


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

     pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_HITACHI);
+
+    pci_config_set_device_id(d->config, PCI_DEVICE_ID_HITACHI_SH7751R);
+
+    pci_set_word(d->config + PCI_COMMAND, PCI_COMMAND_WAIT);

     pci_set_word(d->config + PCI_STATUS, PCI_STATUS_CAP_LIST |

static int sh_pci_host_init(PCIDevice *d)

{

    pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_HITACHI);

    pci_config_set_device_id(d->config, PCI_DEVICE_ID_HITACHI_SH7751R);

    pci_set_word(d->config + PCI_COMMAND, PCI_COMMAND_WAIT);

    pci_set_word(d->config + PCI_STATUS, PCI_STATUS_CAP_LIST |

                 PCI_STATUS_FAST_BACK | PCI_STATUS_DEVSEL_MEDIUM);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     int bytes_remaining = len;

+
+    if (len < UINT_MAX / 4) {
+
+        ret = dst = av_malloc(len * 4 / 3 + 12);
+
     } else

         return NULL;

char *av_base64_encode(uint8_t * src, int len)

{

    static const char b64[] =

        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

    char *ret, *dst;

    unsigned i_bits = 0;

    int i_shift = 0;

    int bytes_remaining = len;

    if (len < UINT_MAX / 4) {

        ret = dst = av_malloc(len * 4 / 3 + 12);

    } else

        return NULL;

    if (len) {                  // special edge case, what should we really do here?

        while (bytes_remaining) {

            i_bits = (i_bits << 8) + *src++;

            bytes_remaining--;

            i_shift += 8;

            do {

                *dst++ = b64[(i_bits << 6 >> i_shift) & 0x3f];

                i_shift -= 6;

            } while (i_shift > 6 || (bytes_remaining == 0 && i_shift > 0));

        }

        while ((dst - ret) & 3)

            *dst++ = '=';

    }

    *dst = '\0';

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 int qcow2_alloc_clusters_at(BlockDriverState *bs, uint64_t offset,
     int nb_clusters)
+{
+    BDRVQcowState *s = bs->opaque;
+    uint64_t cluster_index;
+    uint64_t old_free_cluster_index;
+    int i, refcount, ret;
     /* Check how many clusters there are free */
     cluster_index = offset >> s->cluster_bits;
     for(i = 0; i < nb_clusters; i++) {

int qcow2_alloc_clusters_at(BlockDriverState *bs, uint64_t offset,
    int nb_clusters)
{
    BDRVQcowState *s = bs->opaque;
    uint64_t cluster_index;
    uint64_t old_free_cluster_index;
    int i, refcount, ret;
    /* Check how many clusters there are free */
    cluster_index = offset >> s->cluster_bits;
    for(i = 0; i < nb_clusters; i++) {
        refcount = get_refcount(bs, cluster_index++);
        if (refcount < 0) {
            return refcount;
        } else if (refcount != 0) {
            break;
        }
    }
    /* And then allocate them */
    ret = update_refcount(bs, offset, i << s->cluster_bits, 1);
    if (ret < 0) {
        return ret;
    }
    return i;
}


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

     MonFdsetFd *mon_fdset_fd;
+
+    MonFdsetFd *mon_fdset_fd_next;
+
+
+
     QLIST_FOREACH_SAFE(mon_fdset_fd, &mon_fdset->fds, next, mon_fdset_fd_next) {

         if (mon_fdset_fd->removed ||

static void monitor_fdset_cleanup(MonFdset *mon_fdset)

{

    MonFdsetFd *mon_fdset_fd;

    MonFdsetFd *mon_fdset_fd_next;

    QLIST_FOREACH_SAFE(mon_fdset_fd, &mon_fdset->fds, next, mon_fdset_fd_next) {

        if (mon_fdset_fd->removed ||

                (QLIST_EMPTY(&mon_fdset->dup_fds) && mon_refcount == 0)) {

            close(mon_fdset_fd->fd);

            g_free(mon_fdset_fd->opaque);

            QLIST_REMOVE(mon_fdset_fd, next);

            g_free(mon_fdset_fd);

        }

    }

    if (QLIST_EMPTY(&mon_fdset->fds) && QLIST_EMPTY(&mon_fdset->dup_fds)) {

        QLIST_REMOVE(mon_fdset, next);

        g_free(mon_fdset);

    }

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     if(v){

         const int a= FFABS(v);
+
+        const int e= av_log2(a);
+
+        put_rac(c, state+0, 0);
+

         assert(e<=9);

static inline void put_symbol_inline(RangeCoder *c, uint8_t *state, int v, int is_signed){

    int i;

    if(v){

        const int a= FFABS(v);

        const int e= av_log2(a);

        put_rac(c, state+0, 0);

        assert(e<=9);

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

            put_rac(c, state+1+i, 1);  //1..10

        }

        put_rac(c, state+1+i, 0);

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

            put_rac(c, state+22+i, (a>>i)&1); //22..31

        }

        if(is_signed)

            put_rac(c, state+11 + e, v < 0); //11..21

    }else{

        put_rac(c, state+0, 1);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static int find_tag(ByteIOContext *pb, uint32_t tag1)

+{

     unsigned int tag;

@@ -8,7 +8,7 @@

+    for(;;) {

         if (url_feof(pb))

static int find_tag(ByteIOContext *pb, uint32_t tag1)

{

    unsigned int tag;

    int size;

    for(;;) {

        if (url_feof(pb))

            return -1;

        tag = get_le32(pb);

        size = get_le32(pb);

        if (tag == tag1)

            break;

        url_fseek(pb, size, SEEK_CUR);

    }

    if (size < 0)

        size = 0x7fffffff;

    return size;

}


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

 {

+    return blk_cfg.geometry.cylinders;

 }

uint16_t virtio_get_cylinders(void)

{

    return blk_cfg.geometry.cylinders;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int cmd_valid_while_locked(SDState *sd, SDRequest *req)
+
 {

     /* Valid commands in locked state:

static int cmd_valid_while_locked(SDState *sd, SDRequest *req)

{

    /* Valid commands in locked state:

     * basic class (0)

     * lock card class (7)

     * CMD16

     * implicitly, the ACMD prefix CMD55

     * ACMD41 and ACMD42

     * Anything else provokes an "illegal command" response.

     */

    if (sd->card_status & APP_CMD) {

        return req->cmd == 41 || req->cmd == 42;

    }

    if (req->cmd == 16 || req->cmd == 55) {

        return 1;

    }

    return sd_cmd_class[req->cmd] == 0 || sd_cmd_class[req->cmd] == 7;

}


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

     if (!req) {
+
+        return;
+
+    }
+
     if (req->dev->resetting) {

         req->resp.cmd->response = VIRTIO_SCSI_S_RESET;

static void virtio_scsi_request_cancelled(SCSIRequest *r)

{

    VirtIOSCSIReq *req = r->hba_private;

    if (!req) {

        return;

    }

    if (req->dev->resetting) {

        req->resp.cmd->response = VIRTIO_SCSI_S_RESET;

    } else {

        req->resp.cmd->response = VIRTIO_SCSI_S_ABORTED;

    }

    virtio_scsi_complete_cmd_req(req);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void cpu_exit_tb_from_sighandler(CPUState *cpu, void *puc)
+
+{
+
+#ifdef __linux__
+
     struct ucontext *uc = puc;

 #elif defined(__OpenBSD__)

static void cpu_exit_tb_from_sighandler(CPUState *cpu, void *puc)

{

#ifdef __linux__

    struct ucontext *uc = puc;

#elif defined(__OpenBSD__)

    struct sigcontext *uc = puc;

#endif

    /* XXX: use siglongjmp ? */

#ifdef __linux__

#ifdef __ia64

    sigprocmask(SIG_SETMASK, (sigset_t *)&uc->uc_sigmask, NULL);

#else

    sigprocmask(SIG_SETMASK, &uc->uc_sigmask, NULL);

#endif

#elif defined(__OpenBSD__)

    sigprocmask(SIG_SETMASK, &uc->sc_mask, NULL);

#endif

    cpu_resume_from_signal(cpu, NULL);

}


--- a/source.c
+++ b/source.c
@@ -4,8 +4,8 @@
     int nr;
     BlockDriverState *file;
     int64_t res;
+    if (!count) {
+        return true;
     res = bdrv_get_block_status_above(bs, NULL, start, count,
                                       &nr, &file);
     return res >= 0 && (res & BDRV_BLOCK_ZERO) && nr == count;

static bool is_zero_sectors(BlockDriverState *bs, int64_t start,
                            uint32_t count)
{
    int nr;
    BlockDriverState *file;
    int64_t res;
    if (!count) {
        return true;
    res = bdrv_get_block_status_above(bs, NULL, start, count,
                                      &nr, &file);
    return res >= 0 && (res & BDRV_BLOCK_ZERO) && nr == count;


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

 {

+    MIPSnetState *s = opaque;
+
+

     if (s->busy)

static int mipsnet_can_receive(void *opaque)

{

    MIPSnetState *s = opaque;

    if (s->busy)

        return 0;

    return !mipsnet_buffer_full(s);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 void qmp_block_job_complete(const char *device, Error **errp)

+{
+
+    BlockJob *job = find_block_job(device);
+
+

     if (!job) {

void qmp_block_job_complete(const char *device, Error **errp)

{

    BlockJob *job = find_block_job(device);

    if (!job) {

        error_set(errp, QERR_BLOCK_JOB_NOT_ACTIVE, device);

        return;

    }

    trace_qmp_block_job_complete(job);

    block_job_complete(job, errp);

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
     ret |= taihu_cpld_readb(opaque, addr + 1) << 16;

     ret |= taihu_cpld_readb(opaque, addr + 2) << 8;
+
+    ret |= taihu_cpld_readb(opaque, addr + 3);
+
+
+
     return ret;

 }

static uint32_t taihu_cpld_readl (void *opaque, hwaddr addr)

{

    uint32_t ret;

    ret = taihu_cpld_readb(opaque, addr) << 24;

    ret |= taihu_cpld_readb(opaque, addr + 1) << 16;

    ret |= taihu_cpld_readb(opaque, addr + 2) << 8;

    ret |= taihu_cpld_readb(opaque, addr + 3);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -19,9 +19,9 @@
 #ifdef DEBUG_SEEK

     av_log(s, AV_LOG_DEBUG, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos);
+
+#endif
+
+    url_fseek(pb, pos, SEEK_SET);
+
 }

static void ffm_seek1(AVFormatContext *s, int64_t pos1)

{

    FFMContext *ffm = s->priv_data;

    ByteIOContext *pb = s->pb;

    int64_t pos;

    pos = pos1 + ffm->write_index;

    if (pos >= ffm->file_size)

        pos -= (ffm->file_size - FFM_PACKET_SIZE);

#ifdef DEBUG_SEEK

    av_log(s, AV_LOG_DEBUG, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos);

#endif

    url_fseek(pb, pos, SEEK_SET);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void do_inject_mce(Monitor *mon, const QDict *qdict)
+
+{
+
+    CPUState *cenv;

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

static void do_inject_mce(Monitor *mon, const QDict *qdict)

{

    CPUState *cenv;

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

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

    uint64_t status = qdict_get_int(qdict, "status");

    uint64_t mcg_status = qdict_get_int(qdict, "mcg_status");

    uint64_t addr = qdict_get_int(qdict, "addr");

    uint64_t misc = qdict_get_int(qdict, "misc");

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

    for (cenv = first_cpu; cenv != NULL; cenv = cenv->next_cpu) {

        if (cenv->cpu_index == cpu_index && cenv->mcg_cap) {

            cpu_x86_inject_mce(cenv, bank, status, mcg_status, addr, misc,

                               broadcast);

            break;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+START_TEST(qint_destroy_test)
+
 {

     QInt *qi = qint_from_int(0);

START_TEST(qint_destroy_test)

{

    QInt *qi = qint_from_int(0);

    QDECREF(qi);

}


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

     if (dc->rd) {

+        gen_load(dc, cpu_R[dc->rd], *addr, size);
+
+    } else {
+
+        gen_load(dc, env_imm, *addr, size);

static void dec_load(DisasContext *dc)

{

    TCGv t, *addr;

    unsigned int size;

    size = 1 << (dc->opcode & 3);

    LOG_DIS("l %x %d\n", dc->opcode, size);

    t_sync_flags(dc);

    addr = compute_ldst_addr(dc, &t);

    /* If we get a fault on a dslot, the jmpstate better be in sync.  */

    sync_jmpstate(dc);

    /* Verify alignment if needed.  */

    if ((dc->env->pvr.regs[2] & PVR2_UNALIGNED_EXC_MASK) && size > 1) {

        gen_helper_memalign(*addr, tcg_const_tl(dc->rd),

                            tcg_const_tl(0), tcg_const_tl(size - 1));

    if (dc->rd) {

        gen_load(dc, cpu_R[dc->rd], *addr, size);

    } else {

        gen_load(dc, env_imm, *addr, size);

    if (addr == &t)

        tcg_temp_free(t);


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
     c->name = g_strdup(name);

     c->saddr = socket_parse(host_str, &local_error);
+
+    if (c->saddr == NULL) {
+
+        goto err;
+
     }

static int net_socket_connect_init(NetClientState *peer,

                                   const char *model,

                                   const char *name,

                                   const char *host_str)

{

    socket_connect_data *c = g_new0(socket_connect_data, 1);

    int fd = -1;

    Error *local_error = NULL;

    c->peer = peer;

    c->model = g_strdup(model);

    c->name = g_strdup(name);

    c->saddr = socket_parse(host_str, &local_error);

    if (c->saddr == NULL) {

        goto err;

    }

    fd = socket_connect(c->saddr, net_socket_connected, c, &local_error);

    if (fd < 0) {

        goto err;

    }

    return 0;

err:

    error_report_err(local_error);

    socket_connect_data_free(c);

    return -1;

}


AVFormatContext *avformat_alloc_context(void)

{

    AVFormatContext *ic;

    ic = av_malloc(sizeof(AVFormatContext));

    if (!ic) return ic;

    avformat_get_context_defaults(ic);

    ic->internal = av_mallocz(sizeof(*ic->internal));

    if (!ic->internal) {

        avformat_free_context(ic);

        return NULL;

    }

    return ic;

}


--- a/source.c
+++ b/source.c
@@ -1,17 +1,17 @@
+static inline TCGOp *tcg_emit_op(TCGOpcode opc)
+
+{
+
+    TCGContext *ctx = tcg_ctx;
+
+    int oi = ctx->gen_next_op_idx;
+
+    int ni = oi + 1;
+
+    int pi = oi - 1;
+
+    TCGOp *op = &ctx->gen_op_buf[oi];
+

     tcg_debug_assert(oi < OPC_BUF_SIZE);

static inline TCGOp *tcg_emit_op(TCGOpcode opc)

{

    TCGContext *ctx = tcg_ctx;

    int oi = ctx->gen_next_op_idx;

    int ni = oi + 1;

    int pi = oi - 1;

    TCGOp *op = &ctx->gen_op_buf[oi];

    tcg_debug_assert(oi < OPC_BUF_SIZE);

    ctx->gen_op_buf[0].prev = oi;

    ctx->gen_next_op_idx = ni;

    memset(op, 0, offsetof(TCGOp, args));

    op->opc = opc;

    op->prev = pi;

    op->next = ni;

    return op;

}


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

     CPUState *cs = CPU(cpu);
+
     CPUPPCState *env = &cpu->env;

     struct kvm_debug_exit_arch *arch_info = &run->debug.arch;

static int kvm_handle_debug(PowerPCCPU *cpu, struct kvm_run *run)

{

    CPUState *cs = CPU(cpu);

    CPUPPCState *env = &cpu->env;

    struct kvm_debug_exit_arch *arch_info = &run->debug.arch;

    int handle = 0;

    if (kvm_find_sw_breakpoint(cs, arch_info->address)) {

        handle = 1;

    } else {

        /* QEMU is not able to handle debug exception, so inject

         * program exception to guest;

         * Yes program exception NOT debug exception !!

         * For software breakpoint QEMU uses a privileged instruction;

         * So there cannot be any reason that we are here for guest

         * set debug exception, only possibility is guest executed a

         * privileged / illegal instruction and that's why we are

         * injecting a program interrupt.

         */

        cpu_synchronize_state(cs);

        /* env->nip is PC, so increment this by 4 to use

         * ppc_cpu_do_interrupt(), which set srr0 = env->nip - 4.

         */

        env->nip += 4;

        cs->exception_index = POWERPC_EXCP_PROGRAM;

        env->error_code = POWERPC_EXCP_INVAL;

        ppc_cpu_do_interrupt(cs);

    }

    return handle;

}


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

     ISADevice *isadev = ISA_DEVICE(dev);
+
     FDCtrlISABus *isa = ISA_FDC(dev);

     FDCtrl *fdctrl = &isa->state;

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

{

    ISADevice *isadev = ISA_DEVICE(dev);

    FDCtrlISABus *isa = ISA_FDC(dev);

    FDCtrl *fdctrl = &isa->state;

    Error *err = NULL;

    isa_register_portio_list(isadev, isa->iobase, fdc_portio_list, fdctrl,

                             "fdc");

    isa_init_irq(isadev, &fdctrl->irq, isa->irq);

    fdctrl->dma_chann = isa->dma;

    if (fdctrl->dma_chann != -1) {

        fdctrl->dma = isa_get_dma(isa_bus_from_device(isadev), isa->dma);

        assert(fdctrl->dma);

    }

    qdev_set_legacy_instance_id(dev, isa->iobase, 2);

    fdctrl_realize_common(fdctrl, &err);

    if (err != NULL) {

        error_propagate(errp, err);

        return;

    }

}


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

                                      const uint8_t *buf, int nb_sectors)

+{
+
+    int ret;
+
     BDRVCowState *s = bs->opaque;

     qemu_co_mutex_lock(&s->lock);

static coroutine_fn int cow_co_write(BlockDriverState *bs, int64_t sector_num,

                                     const uint8_t *buf, int nb_sectors)

{

    int ret;

    BDRVCowState *s = bs->opaque;

    qemu_co_mutex_lock(&s->lock);

    ret = cow_write(bs, sector_num, buf, nb_sectors);

    qemu_co_mutex_unlock(&s->lock);

    return ret;

}


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

     int i, bytes = 1;

+    while (val >> bytes*8) bytes++;
+
+
+
     put_ebml_id(pb, elementid);

     put_ebml_num(pb, bytes, 0);

static void put_ebml_uint(ByteIOContext *pb, unsigned int elementid, uint64_t val)

{

    int i, bytes = 1;

    while (val >> bytes*8) bytes++;

    put_ebml_id(pb, elementid);

    put_ebml_num(pb, bytes, 0);

    for (i = bytes - 1; i >= 0; i--)

        put_byte(pb, val >> i*8);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void hybrid4_8_12_cx(float (*in)[2], float (*out)[32][2], const float (*filter)[7][2], int N, int len)

+{
+
+    int i, j, ssb;
+
+

     for (i = 0; i < len; i++, in++) {

static void hybrid4_8_12_cx(float (*in)[2], float (*out)[32][2], const float (*filter)[7][2], int N, int len)

{

    int i, j, ssb;

    for (i = 0; i < len; i++, in++) {

        for (ssb = 0; ssb < N; ssb++) {

            float sum_re = filter[ssb][6][0] * in[6][0], sum_im = filter[ssb][6][0] * in[6][1];

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

                float in0_re = in[j][0];

                float in0_im = in[j][1];

                float in1_re = in[12-j][0];

                float in1_im = in[12-j][1];

                sum_re += filter[ssb][j][0] * (in0_re + in1_re) - filter[ssb][j][1] * (in0_im - in1_im);

                sum_im += filter[ssb][j][0] * (in0_im + in1_im) + filter[ssb][j][1] * (in0_re - in1_re);

            }

            out[ssb][i][0] = sum_re;

            out[ssb][i][1] = sum_im;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static inline void neon_load_reg64(TCGv var, int reg)

+{

     tcg_gen_ld_i64(var, cpu_env, vfp_reg_offset(1, reg));

static inline void neon_load_reg64(TCGv var, int reg)

{

    tcg_gen_ld_i64(var, cpu_env, vfp_reg_offset(1, reg));

}


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

     case SOCKET_ADDRESS_FLAT_TYPE_VSOCK:

+        addr->type = SOCKET_ADDRESS_KIND_VSOCK;
+
+        addr->u.vsock.data = QAPI_CLONE(VsockSocketAddress,
+
+                                        &addr_flat->u.vsock);

         break;

SocketAddress *socket_address_crumple(SocketAddressFlat *addr_flat)

{

    SocketAddress *addr = g_new(SocketAddress, 1);

    switch (addr_flat->type) {

    case SOCKET_ADDRESS_FLAT_TYPE_INET:

        addr->type = SOCKET_ADDRESS_KIND_INET;

        addr->u.inet.data = QAPI_CLONE(InetSocketAddress,

                                       &addr_flat->u.inet);

        break;

    case SOCKET_ADDRESS_FLAT_TYPE_UNIX:

        addr->type = SOCKET_ADDRESS_KIND_UNIX;

        addr->u.q_unix.data = QAPI_CLONE(UnixSocketAddress,

                                         &addr_flat->u.q_unix);

        break;

    case SOCKET_ADDRESS_FLAT_TYPE_VSOCK:

        addr->type = SOCKET_ADDRESS_KIND_VSOCK;

        addr->u.vsock.data = QAPI_CLONE(VsockSocketAddress,

                                        &addr_flat->u.vsock);

        break;

    case SOCKET_ADDRESS_FLAT_TYPE_FD:

        addr->type = SOCKET_ADDRESS_KIND_FD;

        addr->u.fd.data = QAPI_CLONE(String, &addr_flat->u.fd);

        break;

    default:

        abort();

    }

    return addr;

}


void check_values (eq2_param_t *par)

{

  /* yuck! floating point comparisons... */

  if ((par->c == 1.0) && (par->b == 0.0) && (par->g == 1.0)) {

    par->adjust = NULL;

  }

#if HAVE_MMX && HAVE_6REGS

  else if (par->g == 1.0 && ff_gCpuCaps.hasMMX) {

    par->adjust = &affine_1d_MMX;

  }

#endif

  else {

    par->adjust = &apply_lut;

  }

}


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

     CPUAddressSpace *cpuas;

+    AddressSpaceDispatch *d;

static void tcg_commit(MemoryListener *listener)

{

    CPUAddressSpace *cpuas;

    AddressSpaceDispatch *d;

    /* since each CPU stores ram addresses in its TLB cache, we must

       reset the modified entries */

    cpuas = container_of(listener, CPUAddressSpace, tcg_as_listener);

    cpu_reloading_memory_map();

    /* The CPU and TLB are protected by the iothread lock.

     * We reload the dispatch pointer now because cpu_reloading_memory_map()

     * may have split the RCU critical section.

     */

    d = atomic_rcu_read(&cpuas->as->dispatch);

    cpuas->memory_dispatch = d;

    tlb_flush(cpuas->cpu, 1);

}


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

         int x, y;

+        uint8_t *pin, *pout;
+
+        for (y = y0; y < (y0 + h); y++) {

             pin = cur_buf->data[0] + y * cur_buf->linesize[0] + extract->rgba_map[A];

static int draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir)

{

    AlphaExtractContext *extract = inlink->dst->priv;

    AVFilterBufferRef *cur_buf = inlink->cur_buf;

    AVFilterBufferRef *out_buf = inlink->dst->outputs[0]->out_buf;

    if (extract->is_packed_rgb) {

        int x, y;

        uint8_t *pin, *pout;

        for (y = y0; y < (y0 + h); y++) {

            pin = cur_buf->data[0] + y * cur_buf->linesize[0] + extract->rgba_map[A];

            pout = out_buf->data[0] + y * out_buf->linesize[0];

            for (x = 0; x < out_buf->video->w; x++) {

                *pout = *pin;

                pout += 1;

                pin += 4;

            }

        }

    } else if (cur_buf->linesize[A] == out_buf->linesize[Y]) {

        const int linesize = cur_buf->linesize[A];

        memcpy(out_buf->data[Y] + y0 * linesize,

               cur_buf->data[A] + y0 * linesize,

               linesize * h);

    } else {

        const int linesize = FFMIN(out_buf->linesize[Y], cur_buf->linesize[A]);

        int y;

        for (y = y0; y < (y0 + h); y++) {

            memcpy(out_buf->data[Y] + y * out_buf->linesize[Y],

                   cur_buf->data[A] + y * cur_buf->linesize[A],

                   linesize);

        }

    }

    return ff_draw_slice(inlink->dst->outputs[0], y0, h, slice_dir);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void set_next_tick(rc4030State *s)

+{
+
+    qemu_irq_lower(s->timer_irq);

     uint32_t hz;

static void set_next_tick(rc4030State *s)

{

    qemu_irq_lower(s->timer_irq);

    uint32_t hz;

    hz = 1000 / (s->itr + 1);

    qemu_mod_timer(s->periodic_timer, qemu_get_clock(vm_clock) + ticks_per_sec / hz);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 SocketAddress *socket_address_flatten(SocketAddressLegacy *addr_legacy)
+
 {

     SocketAddress *addr = g_new(SocketAddress, 1);

SocketAddress *socket_address_flatten(SocketAddressLegacy *addr_legacy)

{

    SocketAddress *addr = g_new(SocketAddress, 1);

    if (!addr_legacy) {

        return NULL;

    }

    switch (addr_legacy->type) {

    case SOCKET_ADDRESS_LEGACY_KIND_INET:

        addr->type = SOCKET_ADDRESS_TYPE_INET;

        QAPI_CLONE_MEMBERS(InetSocketAddress, &addr->u.inet,

                           addr_legacy->u.inet.data);

        break;

    case SOCKET_ADDRESS_LEGACY_KIND_UNIX:

        addr->type = SOCKET_ADDRESS_TYPE_UNIX;

        QAPI_CLONE_MEMBERS(UnixSocketAddress, &addr->u.q_unix,

                           addr_legacy->u.q_unix.data);

        break;

    case SOCKET_ADDRESS_LEGACY_KIND_VSOCK:

        addr->type = SOCKET_ADDRESS_TYPE_VSOCK;

        QAPI_CLONE_MEMBERS(VsockSocketAddress, &addr->u.vsock,

                           addr_legacy->u.vsock.data);

        break;

    case SOCKET_ADDRESS_LEGACY_KIND_FD:

        addr->type = SOCKET_ADDRESS_TYPE_FD;

        QAPI_CLONE_MEMBERS(String, &addr->u.fd, addr_legacy->u.fd.data);

        break;

    default:

        abort();

    }

    return addr;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void virtio_scsi_handle_cmd_req_submit(VirtIOSCSI *s, VirtIOSCSIReq *req)
+
+{

+    if (scsi_req_enqueue(req->sreq)) {
+
         scsi_req_continue(req->sreq);

     }

void virtio_scsi_handle_cmd_req_submit(VirtIOSCSI *s, VirtIOSCSIReq *req)

{

    if (scsi_req_enqueue(req->sreq)) {

        scsi_req_continue(req->sreq);

    }

    bdrv_io_unplug(req->sreq->dev->conf.bs);

    scsi_req_unref(req->sreq);

}


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

 {

+    static const int rv30_p_types[6] = { RV34_MB_SKIP, RV34_MB_P_16x16, RV34_MB_P_8x8, -1, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 };
+
+    static const int rv30_b_types[6] = { RV34_MB_SKIP, RV34_MB_B_DIRECT, RV34_MB_B_FORWARD, RV34_MB_B_BACKWARD, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 };
+
+    MpegEncContext *s = &r->s;

     GetBitContext *gb = &s->gb;

static int rv30_decode_mb_info(RV34DecContext *r)

{

    static const int rv30_p_types[6] = { RV34_MB_SKIP, RV34_MB_P_16x16, RV34_MB_P_8x8, -1, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 };

    static const int rv30_b_types[6] = { RV34_MB_SKIP, RV34_MB_B_DIRECT, RV34_MB_B_FORWARD, RV34_MB_B_BACKWARD, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 };

    MpegEncContext *s = &r->s;

    GetBitContext *gb = &s->gb;

    int code = svq3_get_ue_golomb(gb);

    if(code > 11){

        av_log(s->avctx, AV_LOG_ERROR, "Incorrect MB type code\n");

        return -1;

    }

    if(code > 5){

        av_log(s->avctx, AV_LOG_ERROR, "dquant needed\n");

        code -= 6;

    }

    if(s->pict_type != AV_PICTURE_TYPE_B)

        return rv30_p_types[code];

    else

        return rv30_b_types[code];

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline bool gluster_supports_zerofill(void)

 {

static inline bool gluster_supports_zerofill(void)

{

    return 0;

}


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

     TPMInfo *info = g_new0(TPMInfo, 1);

+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
     TPMIfClass *tic = TPM_IF_GET_CLASS(s->tpmif);

TPMInfo *tpm_backend_query_tpm(TPMBackend *s)

{

    TPMInfo *info = g_new0(TPMInfo, 1);

    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);

    TPMIfClass *tic = TPM_IF_GET_CLASS(s->tpmif);

    info->id = g_strdup(s->id);

    info->model = tic->model;

    if (k->get_tpm_options) {

        info->options = k->get_tpm_options(s);

    }

    return info;

}


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

     int64_t v;

+    uint_fast16_t res;

     v = float32_to_int64_round_to_zero(a STATUS_VAR);
+
     if (v < 0) {

         res = 0;

uint_fast16_t float32_to_uint16_round_to_zero(float32 a STATUS_PARAM)

{

    int64_t v;

    uint_fast16_t res;

    v = float32_to_int64_round_to_zero(a STATUS_VAR);

    if (v < 0) {

        res = 0;

        float_raise( float_flag_invalid STATUS_VAR);

    } else if (v > 0xffff) {

        res = 0xffff;

        float_raise( float_flag_invalid STATUS_VAR);

    } else {

        res = v;

    }

    return res;

}


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

 {

int qemu_bh_poll(void)

{

    return aio_bh_poll(qemu_aio_context);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static void tlb_info(Monitor *mon)
+
 {

+    CPUState *env;
+
+    int l1, l2;

     uint32_t pgd, pde, pte;

@@ -13,7 +13,7 @@
     env = mon_get_cpu();

+
     if (!(env->cr[0] & CR0_PG_MASK)) {

         monitor_printf(mon, "PG disabled\n");

static void tlb_info(Monitor *mon)

{

    CPUState *env;

    int l1, l2;

    uint32_t pgd, pde, pte;

    env = mon_get_cpu();

    if (!(env->cr[0] & CR0_PG_MASK)) {

        monitor_printf(mon, "PG disabled\n");

        return;

    }

    pgd = env->cr[3] & ~0xfff;

    for(l1 = 0; l1 < 1024; l1++) {

        cpu_physical_memory_read(pgd + l1 * 4, (uint8_t *)&pde, 4);

        pde = le32_to_cpu(pde);

        if (pde & PG_PRESENT_MASK) {

            if ((pde & PG_PSE_MASK) && (env->cr[4] & CR4_PSE_MASK)) {

                print_pte(mon, (l1 << 22), pde, ~((1 << 20) - 1));

            } else {

                for(l2 = 0; l2 < 1024; l2++) {

                    cpu_physical_memory_read((pde & ~0xfff) + l2 * 4,

                                             (uint8_t *)&pte, 4);

                    pte = le32_to_cpu(pte);

                    if (pte & PG_PRESENT_MASK) {

                        print_pte(mon, (l1 << 22) + (l2 << 12),

                                  pte & ~PG_PSE_MASK,

                                  ~0xfff);

                    }

                }

            }

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void do_rfi (void)
+
+{

     env->nip = env->spr[SPR_SRR0] & ~0x00000003;
+
     T0 = env->spr[SPR_SRR1] & ~0xFFFF0000UL;

     do_store_msr(env, T0);

void do_rfi (void)

{

    env->nip = env->spr[SPR_SRR0] & ~0x00000003;

    T0 = env->spr[SPR_SRR1] & ~0xFFFF0000UL;

    do_store_msr(env, T0);

#if defined (DEBUG_OP)

    dump_rfi();

#endif

    env->interrupt_request |= CPU_INTERRUPT_EXITTB;

}


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

 {

+    FrameThreadContext *fctx = avctx->thread_opaque;

void ff_thread_flush(AVCodecContext *avctx)

{

    FrameThreadContext *fctx = avctx->thread_opaque;

    if (!avctx->thread_opaque) return;

    park_frame_worker_threads(fctx, avctx->thread_count);

    if (fctx->prev_thread)

        update_context_from_thread(fctx->threads->avctx, fctx->prev_thread->avctx, 0);

    fctx->next_decoding = fctx->next_finished = 0;

    fctx->delaying = 1;

    fctx->prev_thread = NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 BlockDeviceInfoList *qmp_query_named_block_nodes(Error **errp)
+
 {

     return bdrv_named_nodes_list();

BlockDeviceInfoList *qmp_query_named_block_nodes(Error **errp)

{

    return bdrv_named_nodes_list();

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+void visit_start_list(Visitor *v, const char *name, Error **errp)

 {

void visit_start_list(Visitor *v, const char *name, Error **errp)

{

    v->start_list(v, name, errp);

}


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

 {

+    struct endp_data *endp = priv;

     USBRedirDevice *dev = endp->dev;
+
+    struct buf_packet *bufp;

+    int i = 0;

static void usbredir_put_bufpq(QEMUFile *f, void *priv, size_t unused)

{

    struct endp_data *endp = priv;

    USBRedirDevice *dev = endp->dev;

    struct buf_packet *bufp;

    int i = 0;

    qemu_put_be32(f, endp->bufpq_size);

    QTAILQ_FOREACH(bufp, &endp->bufpq, next) {

        DPRINTF("put_bufpq %d/%d len %d status %d\n", i + 1, endp->bufpq_size,

                bufp->len, bufp->status);

        qemu_put_be32(f, bufp->len);

        qemu_put_be32(f, bufp->status);

        qemu_put_buffer(f, bufp->data, bufp->len);

        i++;

    }

    assert(i == endp->bufpq_size);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+void migrate_fd_error(MigrationState *s)
+
 {

     trace_migrate_fd_error();

void migrate_fd_error(MigrationState *s)

{

    trace_migrate_fd_error();

    assert(s->to_dst_file == NULL);

    migrate_set_state(&s->state, MIGRATION_STATUS_SETUP,

                      MIGRATION_STATUS_FAILED);

    notifier_list_notify(&migration_state_notifiers, s);

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
         gen_op_addq_EDI_T0();

     } else
+
+#endif
+
+    if (s->aflag) {
+
         gen_op_addl_ESI_T0();

         gen_op_addl_EDI_T0();

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

{

    gen_string_movl_A0_ESI(s);

    gen_op_ld_T0_A0(ot + s->mem_index);

    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_ESI_T0();

        gen_op_addq_EDI_T0();

    } else

#endif

    if (s->aflag) {

        gen_op_addl_ESI_T0();

        gen_op_addl_EDI_T0();

    } else {

        gen_op_addw_ESI_T0();

        gen_op_addw_EDI_T0();

    }

}


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

             int i;

+            float *x = s->tmp_output+128;
+
+            for(i=0; i<128; i++)
+
+                x[i] = s->transform_coeffs[ch][2*i];

             ff_imdct_half(&s->imdct_256, s->tmp_output, x);

static inline void do_imdct(AC3DecodeContext *s, int channels)

{

    int ch;

    for (ch=1; ch<=channels; ch++) {

        if (s->block_switch[ch]) {

            int i;

            float *x = s->tmp_output+128;

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

                x[i] = s->transform_coeffs[ch][2*i];

            ff_imdct_half(&s->imdct_256, s->tmp_output, x);

            s->dsp.vector_fmul_window(s->output[ch-1], s->delay[ch-1], s->tmp_output, s->window, s->add_bias, 128);

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

                x[i] = s->transform_coeffs[ch][2*i+1];

            ff_imdct_half(&s->imdct_256, s->delay[ch-1], x);

        } else {

            ff_imdct_half(&s->imdct_512, s->tmp_output, s->transform_coeffs[ch]);

            s->dsp.vector_fmul_window(s->output[ch-1], s->delay[ch-1], s->tmp_output, s->window, s->add_bias, 128);

            memcpy(s->delay[ch-1], s->tmp_output+128, 128*sizeof(float));

        }

    }

}


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

+    for (i = 0; i < MAX_NBD_REQUESTS; i++) {
+
+        if (s->recv_coroutine[i]) {
+
+            qemu_coroutine_enter(s->recv_coroutine[i]);

         }

static void nbd_recv_coroutines_enter_all(BlockDriverState *bs)

{

    NBDClientSession *s = nbd_get_client_session(bs);

    int i;

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

        if (s->recv_coroutine[i]) {

            qemu_coroutine_enter(s->recv_coroutine[i]);

        }

    }

    BDRV_POLL_WHILE(bs, s->read_reply_co);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void pmuserenr_write(CPUARMState *env, const ARMCPRegInfo *ri,
+
                             uint64_t value)

 {

static void pmuserenr_write(CPUARMState *env, const ARMCPRegInfo *ri,

                            uint64_t value)

{

    env->cp15.c9_pmuserenr = value & 1;

}


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

     const int32_t *q;

+    int val, pos = 1;
+
+
+
+    memset(block, 0, 64 * sizeof(*block));

static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64],

                           int qsel, int is_chroma, int is_hqa)

{

    const int32_t *q;

    int val, pos = 1;

    memset(block, 0, 64 * sizeof(*block));

    if (!is_hqa) {

        block[0] = get_sbits(gb, 9) << 6;

        q = ff_hq_quants[qsel][is_chroma][get_bits(gb, 2)];

    } else {

        q = ff_hq_quants[qsel][is_chroma][get_bits(gb, 2)];

        block[0] = get_sbits(gb, 9) << 6;

    }

    for (;;) {

        val  = get_vlc2(gb, c->hq_ac_vlc.table, 9, 2);

        pos += ff_hq_ac_skips[val];

        if (pos >= 64)

            break;

        block[ff_zigzag_direct[pos]] = (ff_hq_ac_syms[val] * q[pos]) >> 12;

        pos++;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -11,7 +11,7 @@
     int scale = AV_RB16(in);

     int i;
+
     int s0, s1, s2, d;

static int adx_decode(ADXContext *c, int16_t *out, int offset,

                      const uint8_t *in, int ch)

{

    ADXChannelState *prev = &c->prev[ch];

    GetBitContext gb;

    int scale = AV_RB16(in);

    int i;

    int s0, s1, s2, d;

    /* check if this is an EOF packet */

    if (scale & 0x8000)

        return -1;

    init_get_bits(&gb, in + 2, (BLOCK_SIZE - 2) * 8);

    out += offset;

    s1 = prev->s1;

    s2 = prev->s2;

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

        d  = get_sbits(&gb, 4);

        s0 = ((d << COEFF_BITS) * scale + c->coeff[0] * s1 + c->coeff[1] * s2) >> COEFF_BITS;

        s2 = s1;

        s1 = av_clip_int16(s0);

        *out++ = s1;

    }

    prev->s1 = s1;

    prev->s2 = s2;

    return 0;

}


static int xen_9pfs_free(struct XenDevice *xendev)

{

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     uint32_t *pal = ctx->pal + 256 - ctx->free_colours;

+
     if (!ctx->free_colours)

         return 0;

static int decode_pal(MSS12Context *ctx, ArithCoder *acoder)

{

    int i, ncol, r, g, b;

    uint32_t *pal = ctx->pal + 256 - ctx->free_colours;

    if (!ctx->free_colours)

        return 0;

    ncol = arith_get_number(acoder, ctx->free_colours + 1);

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

        r = arith_get_bits(acoder, 8);

        g = arith_get_bits(acoder, 8);

        b = arith_get_bits(acoder, 8);

        *pal++ = (0xFF << 24) | (r << 16) | (g << 8) | b;

    }

    return !!ncol;

}


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

+
+
+    /* then build the huffman tree accodring to probabilities */
+
+    ff_huff_build_tree(s->avctx, vlc, size, nodes, vp6_huff_cmp,

                        FF_HUFFMAN_FLAG_HNODE_FIRST);

static void vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[],

                                const uint8_t *map, unsigned size, VLC *vlc)

{

    Node nodes[2*size], *tmp = &nodes[size];

    int a, b, i;

    /* first compute probabilities from model */

    tmp[0].count = 256;

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

        a = tmp[i].count *        coeff_model[i]  >> 8;

        b = tmp[i].count * (255 - coeff_model[i]) >> 8;

        nodes[map[2*i  ]].count = a + !a;

        nodes[map[2*i+1]].count = b + !b;

    }

    /* then build the huffman tree accodring to probabilities */

    ff_huff_build_tree(s->avctx, vlc, size, nodes, vp6_huff_cmp,

                       FF_HUFFMAN_FLAG_HNODE_FIRST);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void ff_avg_h264_qpel16_mc31_msa(uint8_t *dst, const uint8_t *src,

+                                 ptrdiff_t stride)
+
+{

     avc_luma_hv_qrt_and_aver_dst_16x16_msa(src - 2,

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

                                 ptrdiff_t stride)

{

    avc_luma_hv_qrt_and_aver_dst_16x16_msa(src - 2,

                                           src - (stride * 2) +

                                           sizeof(uint8_t), stride,

                                           dst, stride);

}


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

         return CP_ACCESS_TRAP_UNCATEGORIZED;

+    }
+
+    return CP_ACCESS_OK;
+
+}

static CPAccessResult ats_access(CPUARMState *env, const ARMCPRegInfo *ri)

{

    if (ri->opc2 & 4) {

        /* Other states are only available with TrustZone; in

         * a non-TZ implementation these registers don't exist

         * at all, which is an Uncategorized trap. This underdecoding

         * is safe because the reginfo is NO_MIGRATE.

         */

        return CP_ACCESS_TRAP_UNCATEGORIZED;

    }

    return CP_ACCESS_OK;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+int check_intra_pred8x8_mode_emuedge(int mode, int mb_x, int mb_y)

 {
+
+    switch (mode) {
+
     case DC_PRED8x8:

         return check_dc_pred8x8_mode(mode, mb_x, mb_y);

int check_intra_pred8x8_mode_emuedge(int mode, int mb_x, int mb_y)

{

    switch (mode) {

    case DC_PRED8x8:

        return check_dc_pred8x8_mode(mode, mb_x, mb_y);

    case VERT_PRED8x8:

        return !mb_y ? DC_127_PRED8x8 : mode;

    case HOR_PRED8x8:

        return !mb_x ? DC_129_PRED8x8 : mode;

    case PLANE_PRED8x8: /* TM */

        return check_tm_pred8x8_mode(mode, mb_x, mb_y);

    }

    return mode;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void do_change_vnc(const char *target)

 {
+
+    if (strcmp(target, "passwd") == 0 ||

 	strcmp(target, "password") == 0) {

static void do_change_vnc(const char *target)

{

    if (strcmp(target, "passwd") == 0 ||

	strcmp(target, "password") == 0) {

	char password[9];

	monitor_readline("Password: ", 1, password, sizeof(password)-1);

	password[sizeof(password)-1] = '\0';

	if (vnc_display_password(NULL, password) < 0)

	    term_printf("could not set VNC server password\n");

    } else {

	if (vnc_display_open(NULL, target) < 0)

	    term_printf("could not start VNC server on %s\n", target);

    }

}


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

 {

+    struct IscsiTask *iTask = opaque;

     iTask->complete = 1;

static void iscsi_retry_timer_expired(void *opaque)

{

    struct IscsiTask *iTask = opaque;

    iTask->complete = 1;

    if (iTask->co) {

        qemu_coroutine_enter(iTask->co, NULL);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static uint64_t watch_mem_read(void *opaque, hwaddr addr,
+
                                unsigned size)
+
+{
+
     check_watchpoint(addr & ~TARGET_PAGE_MASK, size, BP_MEM_READ);

     switch (size) {

static uint64_t watch_mem_read(void *opaque, hwaddr addr,

                               unsigned size)

{

    check_watchpoint(addr & ~TARGET_PAGE_MASK, size, BP_MEM_READ);

    switch (size) {

    case 1: return ldub_phys(&address_space_memory, addr);

    case 2: return lduw_phys(&address_space_memory, addr);

    case 4: return ldl_phys(&address_space_memory, addr);

    default: abort();

    }

}


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

     pps_size = AV_RB16(&codec->extradata[9 + sps_size]);

+    if (11 + sps_size + pps_size > codec->extradata_size)
+
+        goto fail;
+
+    avio_wb32(io, 0x00000001);

     avio_write(io, &codec->extradata[11 + sps_size], pps_size);

static int get_video_private_data(struct VideoFile *vf, AVCodecContext *codec)

{

    AVIOContext *io = NULL;

    uint16_t sps_size, pps_size;

    int err = AVERROR(EINVAL);

    if (codec->codec_id == AV_CODEC_ID_VC1)

        return get_private_data(vf, codec);

    avio_open_dyn_buf(&io);

    if (codec->extradata_size < 11 || codec->extradata[0] != 1)

        goto fail;

    sps_size = AV_RB16(&codec->extradata[6]);

    if (11 + sps_size > codec->extradata_size)

        goto fail;

    avio_wb32(io, 0x00000001);

    avio_write(io, &codec->extradata[8], sps_size);

    pps_size = AV_RB16(&codec->extradata[9 + sps_size]);

    if (11 + sps_size + pps_size > codec->extradata_size)

        goto fail;

    avio_wb32(io, 0x00000001);

    avio_write(io, &codec->extradata[11 + sps_size], pps_size);

    err = 0;

fail:

    vf->codec_private_size = avio_close_dyn_buf(io, &vf->codec_private);

    return err;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static unsigned tget(GetByteContext *gb, int type, int le)
+
+{
+
+    switch (type) {

     case TIFF_BYTE : return bytestream2_get_byteu(gb);

static unsigned tget(GetByteContext *gb, int type, int le)

{

    switch (type) {

    case TIFF_BYTE : return bytestream2_get_byteu(gb);

    case TIFF_SHORT: return tget_short(gb, le);

    case TIFF_LONG : return tget_long(gb, le);

    default        : return UINT_MAX;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,29 +1,29 @@
 static int vnc_start_vencrypt_handshake(VncState *vs)
+
+{
+
+    int ret;
+
+
+
     if ((ret = gnutls_handshake(vs->tls.session)) < 0) {
+
+       if (!gnutls_error_is_fatal(ret)) {
+
            VNC_DEBUG("Handshake interrupted (blocking)\n");
+
+           if (!gnutls_record_get_direction(vs->tls.session))
+
+               qemu_set_fd_handler(vs->csock, vnc_tls_handshake_io, NULL, vs);
+
            else
+
                qemu_set_fd_handler(vs->csock, NULL, vnc_tls_handshake_io, vs);

+           return 0;
+
+       }
+
        VNC_DEBUG("Handshake failed %s\n", gnutls_strerror(ret));

        vnc_client_error(vs);

static int vnc_start_vencrypt_handshake(VncState *vs)

{

    int ret;

    if ((ret = gnutls_handshake(vs->tls.session)) < 0) {

       if (!gnutls_error_is_fatal(ret)) {

           VNC_DEBUG("Handshake interrupted (blocking)\n");

           if (!gnutls_record_get_direction(vs->tls.session))

               qemu_set_fd_handler(vs->csock, vnc_tls_handshake_io, NULL, vs);

           else

               qemu_set_fd_handler(vs->csock, NULL, vnc_tls_handshake_io, vs);

           return 0;

       }

       VNC_DEBUG("Handshake failed %s\n", gnutls_strerror(ret));

       vnc_client_error(vs);

       return -1;

    }

    if (vs->vd->tls.x509verify) {

        if (vnc_tls_validate_certificate(vs) < 0) {

            VNC_DEBUG("Client verification failed\n");

            vnc_client_error(vs);

            return -1;

        } else {

            VNC_DEBUG("Client verification passed\n");

        }

    }

    VNC_DEBUG("Handshake done, switching to TLS data mode\n");

    qemu_set_fd_handler(vs->csock, vnc_client_read, vnc_client_write, vs);

    start_auth_vencrypt_subauth(vs);

    return 0;

}


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

                                                 void *opaque, Error **errp)

+{
+
+    PCIHostState *h = PCI_HOST_BRIDGE(obj);
+
+    Range w64;

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

                                                const char *name,

                                                void *opaque, Error **errp)

{

    PCIHostState *h = PCI_HOST_BRIDGE(obj);

    Range w64;

    pci_bus_get_w64_range(h->bus, &w64);

    visit_type_uint64(v, name, &w64.begin, errp);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 int s390_virtio_hypercall(CPUS390XState *env)
+
+{
+
     s390_virtio_fn fn = s390_diag500_table[env->regs[1]];
+

     if (!fn) {

int s390_virtio_hypercall(CPUS390XState *env)

{

    s390_virtio_fn fn = s390_diag500_table[env->regs[1]];

    if (!fn) {

        return -EINVAL;

    }

    return fn(&env->regs[2]);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen)

 {
+
     int ret;

+
 #ifdef CONFIG_ACCEPT4

     ret = accept4(s, addr, addrlen, SOCK_CLOEXEC);

int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen)

{

    int ret;

#ifdef CONFIG_ACCEPT4

    ret = accept4(s, addr, addrlen, SOCK_CLOEXEC);

#else

    ret = accept(s, addr, addrlen);

    if (ret >= 0) {

        qemu_set_cloexec(ret);

    }

#endif

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -3,10 +3,10 @@
                 BlockDriverCompletionFunc *cb,
                 void *opaque)
 {
+    IscsiLun *iscsilun = bs->opaque;
+    IscsiAIOCB *acb;
+    acb = qemu_aio_get(&iscsi_aiocb_info, bs, cb, opaque);
+    trace_iscsi_aio_readv(iscsilun->iscsi, sector_num, nb_sectors, opaque, acb);
     acb->nb_sectors  = nb_sectors;
     acb->sector_num  = sector_num;
     acb->iscsilun    = iscsilun;

iscsi_aio_readv(BlockDriverState *bs, int64_t sector_num,
                QEMUIOVector *qiov, int nb_sectors,
                BlockDriverCompletionFunc *cb,
                void *opaque)
{
    IscsiLun *iscsilun = bs->opaque;
    IscsiAIOCB *acb;
    acb = qemu_aio_get(&iscsi_aiocb_info, bs, cb, opaque);
    trace_iscsi_aio_readv(iscsilun->iscsi, sector_num, nb_sectors, opaque, acb);
    acb->nb_sectors  = nb_sectors;
    acb->sector_num  = sector_num;
    acb->iscsilun    = iscsilun;
    acb->qiov        = qiov;
    acb->retries     = ISCSI_CMD_RETRIES;
    if (iscsi_aio_readv_acb(acb) != 0) {
        qemu_aio_release(acb);
    iscsi_set_events(iscsilun);
    return &acb->common;


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

+
+    QLIST_FOREACH(rec, &child_watches, next) {
+
+        if (rec->pid == pid) {
+
             return 1;

         }

int qemu_add_child_watch(pid_t pid)

{

    ChildProcessRecord *rec;

    if (!sigchld_bh) {

        qemu_init_child_watch();

    }

    QLIST_FOREACH(rec, &child_watches, next) {

        if (rec->pid == pid) {

            return 1;

        }

    }

    rec = g_malloc0(sizeof(ChildProcessRecord));

    rec->pid = pid;

    QLIST_INSERT_HEAD(&child_watches, rec, next);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 void *qemu_ram_ptr_length(target_phys_addr_t addr, target_phys_addr_t *size)

 {
+
+    if (xen_enabled()) {
+
+        return xen_map_cache(addr, *size, 1);
+
     } else {

         RAMBlock *block;

void *qemu_ram_ptr_length(target_phys_addr_t addr, target_phys_addr_t *size)

{

    if (xen_enabled()) {

        return xen_map_cache(addr, *size, 1);

    } else {

        RAMBlock *block;

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

            if (addr - block->offset < block->length) {

                if (addr - block->offset + *size > block->length)

                    *size = block->length - addr + block->offset;

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

            }

        }

        fprintf(stderr, "Bad ram offset %" PRIx64 "\n", (uint64_t)addr);

        abort();

        *size = 0;

        return NULL;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,23 +1,23 @@
+static int adb_mouse_poll(ADBDevice *d, uint8_t *obuf)
+
+{
+
+    MouseState *s = ADB_MOUSE(d);
+
+    int dx, dy;
+
+
+
+    if (s->last_buttons_state == s->buttons_state &&
+
+        s->dx == 0 && s->dy == 0)
+
+        return 0;
+
+
+
+    dx = s->dx;
+
     if (dx < -63)

         dx = -63;

static int adb_mouse_poll(ADBDevice *d, uint8_t *obuf)

{

    MouseState *s = ADB_MOUSE(d);

    int dx, dy;

    if (s->last_buttons_state == s->buttons_state &&

        s->dx == 0 && s->dy == 0)

        return 0;

    dx = s->dx;

    if (dx < -63)

        dx = -63;

    else if (dx > 63)

        dx = 63;

    dy = s->dy;

    if (dy < -63)

        dy = -63;

    else if (dy > 63)

        dy = 63;

    s->dx -= dx;

    s->dy -= dy;

    s->last_buttons_state = s->buttons_state;

    dx &= 0x7f;

    dy &= 0x7f;

    if (!(s->buttons_state & MOUSE_EVENT_LBUTTON))

        dy |= 0x80;

    if (!(s->buttons_state & MOUSE_EVENT_RBUTTON))

        dx |= 0x80;

    obuf[0] = dy;

    obuf[1] = dx;

    return 2;

}


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

     sc = I2C_SLAVE_GET_CLASS(QLIST_FIRST(&bus->current_devs)->elt);
+
+    if (sc->recv) {
+
+        return sc->recv(QLIST_FIRST(&bus->current_devs)->elt);
+
     }

     return -1;

int i2c_recv(I2CBus *bus)

{

    I2CSlaveClass *sc;

    if ((QLIST_EMPTY(&bus->current_devs)) || (bus->broadcast)) {

        return -1;

    }

    sc = I2C_SLAVE_GET_CLASS(QLIST_FIRST(&bus->current_devs)->elt);

    if (sc->recv) {

        return sc->recv(QLIST_FIRST(&bus->current_devs)->elt);

    }

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void memory_region_finalize(Object *obj)
+
+{
+
+    MemoryRegion *mr = MEMORY_REGION(obj);
+

     assert(QTAILQ_EMPTY(&mr->subregions));

static void memory_region_finalize(Object *obj)

{

    MemoryRegion *mr = MEMORY_REGION(obj);

    assert(QTAILQ_EMPTY(&mr->subregions));

    assert(memory_region_transaction_depth == 0);

    mr->destructor(mr);

    memory_region_clear_coalescing(mr);

    g_free((char *)mr->name);

    g_free(mr->ioeventfds);

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     DeviceState *vdev = DEVICE(&dev->vdev);

     DeviceState *proxy = DEVICE(ccw_dev);
+
+    Error *err = NULL;
+
+    char *bus_name;
+

     /*

static void virtio_ccw_serial_realize(VirtioCcwDevice *ccw_dev, Error **errp)

{

    VirtioSerialCcw *dev = VIRTIO_SERIAL_CCW(ccw_dev);

    DeviceState *vdev = DEVICE(&dev->vdev);

    DeviceState *proxy = DEVICE(ccw_dev);

    Error *err = NULL;

    char *bus_name;

    /*

     * For command line compatibility, this sets the virtio-serial-device bus

     * name as before.

     */

    if (proxy->id) {

        bus_name = g_strdup_printf("%s.0", proxy->id);

        virtio_device_set_child_bus_name(VIRTIO_DEVICE(vdev), bus_name);

        g_free(bus_name);

    }

    qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus));

    object_property_set_bool(OBJECT(vdev), true, "realized", &err);

    if (err) {

        error_propagate(errp, err);

    }

}


--- a/source.c
+++ b/source.c
@@ -56,11 +56,11 @@
         }
         for(i=max_order-1; i>0; i--)
             ref[i] = ref[i-1] - ref[i];
+    }
+    opt_order = max_order;
+    if(omethod == ORDER_METHOD_EST) {
+        opt_order = estimate_best_order(ref, min_order, max_order);
+        i = opt_order-1;
         quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i], max_shift, zero_shift);
     } else {
         for(i=min_order-1; i<max_order; i++) {

int ff_lpc_calc_coefs(LPCContext *s,
                      const int32_t *samples, int blocksize, int min_order,
                      int max_order, int precision,
                      int32_t coefs[][MAX_LPC_ORDER], int *shift,
                      enum FFLPCType lpc_type, int lpc_passes,
                      int omethod, int max_shift, int zero_shift)
{
    double autoc[MAX_LPC_ORDER+1];
    double ref[MAX_LPC_ORDER];
    double lpc[MAX_LPC_ORDER][MAX_LPC_ORDER];
    int i, j, pass;
    int opt_order;
    av_assert2(max_order >= MIN_LPC_ORDER && max_order <= MAX_LPC_ORDER &&
           lpc_type > FF_LPC_TYPE_FIXED);
    /* reinit LPC context if parameters have changed */
    if (blocksize != s->blocksize || max_order != s->max_order ||
        lpc_type  != s->lpc_type) {
        ff_lpc_end(s);
        ff_lpc_init(s, blocksize, max_order, lpc_type);
    }
    if (lpc_type == FF_LPC_TYPE_LEVINSON) {
        double *windowed_samples = s->windowed_samples + max_order;
        s->lpc_apply_welch_window(samples, blocksize, windowed_samples);
        s->lpc_compute_autocorr(windowed_samples, blocksize, max_order, autoc);
        compute_lpc_coefs(autoc, max_order, &lpc[0][0], MAX_LPC_ORDER, 0, 1);
        for(i=0; i<max_order; i++)
            ref[i] = fabs(lpc[i][i]);
    } else if (lpc_type == FF_LPC_TYPE_CHOLESKY) {
        LLSModel m[2];
        double var[MAX_LPC_ORDER+1], av_uninit(weight);
        for(pass=0; pass<lpc_passes; pass++){
            av_init_lls(&m[pass&1], max_order);
            weight=0;
            for(i=max_order; i<blocksize; i++){
                for(j=0; j<=max_order; j++)
                    var[j]= samples[i-j];
                if(pass){
                    double eval, inv, rinv;
                    eval= av_evaluate_lls(&m[(pass-1)&1], var+1, max_order-1);
                    eval= (512>>pass) + fabs(eval - var[0]);
                    inv = 1/eval;
                    rinv = sqrt(inv);
                    for(j=0; j<=max_order; j++)
                        var[j] *= rinv;
                    weight += inv;
                }else
                    weight++;
                av_update_lls(&m[pass&1], var, 1.0);
            }
            av_solve_lls(&m[pass&1], 0.001, 0);
        }
        for(i=0; i<max_order; i++){
            for(j=0; j<max_order; j++)
                lpc[i][j]=-m[(pass-1)&1].coeff[i][j];
            ref[i]= sqrt(m[(pass-1)&1].variance[i] / weight) * (blocksize - max_order) / 4000;
        }
        for(i=max_order-1; i>0; i--)
            ref[i] = ref[i-1] - ref[i];
    }
    opt_order = max_order;
    if(omethod == ORDER_METHOD_EST) {
        opt_order = estimate_best_order(ref, min_order, max_order);
        i = opt_order-1;
        quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i], max_shift, zero_shift);
    } else {
        for(i=min_order-1; i<max_order; i++) {
            quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i], max_shift, zero_shift);
        }
    }
    return opt_order;
}


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

     aio_context_acquire(bdrv_get_aio_context(s->bs));

+    bdrv_set_enable_write_cache(s->bs, blkcfg.wce != 0);
+
+    aio_context_release(bdrv_get_aio_context(s->bs));
+
+}

static void virtio_blk_set_config(VirtIODevice *vdev, const uint8_t *config)

{

    VirtIOBlock *s = VIRTIO_BLK(vdev);

    struct virtio_blk_config blkcfg;

    memcpy(&blkcfg, config, sizeof(blkcfg));

    aio_context_acquire(bdrv_get_aio_context(s->bs));

    bdrv_set_enable_write_cache(s->bs, blkcfg.wce != 0);

    aio_context_release(bdrv_get_aio_context(s->bs));

}


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

                 "data: %"PRIx64", count: %" FMT_ioreq_size ", size: %" FMT_ioreq_size "\n",

+                req->state, req->data_is_ptr, req->addr,
+
+                req->data, req->count, req->size);
+
+        return NULL;

     }

static ioreq_t *cpu_get_ioreq_from_shared_memory(XenIOState *state, int vcpu)

{

    ioreq_t *req = xen_vcpu_ioreq(state->shared_page, vcpu);

    if (req->state != STATE_IOREQ_READY) {

        DPRINTF("I/O request not ready: "

                "%x, ptr: %x, port: %"PRIx64", "

                "data: %"PRIx64", count: %" FMT_ioreq_size ", size: %" FMT_ioreq_size "\n",

                req->state, req->data_is_ptr, req->addr,

                req->data, req->count, req->size);

        return NULL;

    }

    xen_rmb(); /* see IOREQ_READY /then/ read contents of ioreq */

    req->state = STATE_IOREQ_INPROCESS;

    return req;

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
 static char *sysbus_get_fw_dev_path(DeviceState *dev)

+{
+
+    SysBusDevice *s = SYS_BUS_DEVICE(dev);

+    char path[40];
+
+    int off;

+

     off = snprintf(path, sizeof(path), "%s", qdev_fw_name(dev));

static char *sysbus_get_fw_dev_path(DeviceState *dev)

{

    SysBusDevice *s = SYS_BUS_DEVICE(dev);

    char path[40];

    int off;

    off = snprintf(path, sizeof(path), "%s", qdev_fw_name(dev));

    if (s->num_mmio) {

        snprintf(path + off, sizeof(path) - off, "@"TARGET_FMT_plx,

                 s->mmio[0].addr);

    } else if (s->num_pio) {

        snprintf(path + off, sizeof(path) - off, "@i%04x", s->pio[0]);

    }

    return g_strdup(path);

}


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

     /* setup pci memory mapping */

+    pc_pci_as_mapping_init(OBJECT(mch), mch->system_memory,

                            mch->pci_address_space);

static void mch_realize(PCIDevice *d, Error **errp)

{

    int i;

    MCHPCIState *mch = MCH_PCI_DEVICE(d);

    /* setup pci memory mapping */

    pc_pci_as_mapping_init(OBJECT(mch), mch->system_memory,

                           mch->pci_address_space);

    /* smram */

    cpu_smm_register(&mch_set_smm, mch);

    memory_region_init_alias(&mch->smram_region, OBJECT(mch), "smram-region",

                             mch->pci_address_space, 0xa0000, 0x20000);

    memory_region_add_subregion_overlap(mch->system_memory, 0xa0000,

                                        &mch->smram_region, 1);

    memory_region_set_enabled(&mch->smram_region, false);

    init_pam(DEVICE(mch), mch->ram_memory, mch->system_memory,

             mch->pci_address_space, &mch->pam_regions[0],

             PAM_BIOS_BASE, PAM_BIOS_SIZE);

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

        init_pam(DEVICE(mch), mch->ram_memory, mch->system_memory,

                 mch->pci_address_space, &mch->pam_regions[i+1],

                 PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE, PAM_EXPAN_SIZE);

    }

    /* Intel IOMMU (VT-d) */

    if (qemu_opt_get_bool(qemu_get_machine_opts(), "iommu", false)) {

        mch_init_dmar(mch);

    }

}


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

     qvirtqueue_cleanup(v9p->dev->bus, v9p->vq, v9p->alloc);
+
+    pc_alloc_uninit(v9p->alloc);
+
+    qvirtio_pci_device_disable(container_of(v9p->dev, QVirtioPCIDevice, vdev));

     g_free(v9p->dev);

static void qvirtio_9p_pci_free(QVirtIO9P *v9p)

{

    qvirtqueue_cleanup(v9p->dev->bus, v9p->vq, v9p->alloc);

    pc_alloc_uninit(v9p->alloc);

    qvirtio_pci_device_disable(container_of(v9p->dev, QVirtioPCIDevice, vdev));

    g_free(v9p->dev);

    qpci_free_pc(v9p->bus);

    g_free(v9p);

}


static void dec_divu(DisasContext *dc)

{

    int l1;

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

    if (!(dc->env->features & LM32_FEATURE_DIVIDE)) {

        cpu_abort(dc->env, "hardware divider is not available\n");

    }

    l1 = gen_new_label();

    tcg_gen_brcondi_tl(TCG_COND_NE, cpu_R[dc->r1], 0, l1);

    tcg_gen_movi_tl(cpu_pc, dc->pc);

    t_gen_raise_exception(dc, EXCP_DIVIDE_BY_ZERO);

    gen_set_label(l1);

    tcg_gen_divu_tl(cpu_R[dc->r2], cpu_R[dc->r0], cpu_R[dc->r1]);

}


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

                                            uint64_t ram_size)

+{

     if (mem_path) {

 #ifdef __linux__
+
         Error *err = NULL;

         memory_region_init_ram_from_file(mr, owner, name, ram_size, false,

static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,

                                           const char *name,

                                           uint64_t ram_size)

{

    if (mem_path) {

#ifdef __linux__

        Error *err = NULL;

        memory_region_init_ram_from_file(mr, owner, name, ram_size, false,

                                         mem_path, &err);

        /* Legacy behavior: if allocation failed, fall back to

         * regular RAM allocation.

         */

        if (err) {

            error_report_err(err);

            memory_region_init_ram(mr, owner, name, ram_size, &error_abort);

        }

#else

        fprintf(stderr, "-mem-path not supported on this host\n");

        exit(1);

#endif

    } else {

        memory_region_init_ram(mr, owner, name, ram_size, &error_abort);

    }

    vmstate_register_ram_global(mr);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static OfDpaGroup *of_dpa_group_alloc(uint32_t id)
+
 {

     OfDpaGroup *group = g_malloc0(sizeof(OfDpaGroup));

static OfDpaGroup *of_dpa_group_alloc(uint32_t id)

{

    OfDpaGroup *group = g_malloc0(sizeof(OfDpaGroup));

    if (!group) {

        return NULL;

    }

    group->id = id;

    return group;

}