--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
         retval = 0;

         break;
+
+    case MFI_OMSG0:
+
+    case MFI_OSP0:
+
         retval = (megasas_use_msix(s) ? MFI_FWSTATE_MSIX_SUPPORTED : 0) |

             (s->fw_state & MFI_FWSTATE_MASK) |

static uint64_t megasas_mmio_read(void *opaque, target_phys_addr_t addr,

                                  unsigned size)

{

    MegasasState *s = opaque;

    uint32_t retval = 0;

    switch (addr) {

    case MFI_IDB:

        retval = 0;

        break;

    case MFI_OMSG0:

    case MFI_OSP0:

        retval = (megasas_use_msix(s) ? MFI_FWSTATE_MSIX_SUPPORTED : 0) |

            (s->fw_state & MFI_FWSTATE_MASK) |

            ((s->fw_sge & 0xff) << 16) |

            (s->fw_cmds & 0xFFFF);

        break;

    case MFI_OSTS:

        if (megasas_intr_enabled(s) && s->doorbell) {

            retval = MFI_1078_RM | 1;

        }

        break;

    case MFI_OMSK:

        retval = s->intr_mask;

        break;

    case MFI_ODCR0:

        retval = s->doorbell;

        break;

    default:

        trace_megasas_mmio_invalid_readl(addr);

        break;

    }

    trace_megasas_mmio_readl(addr, retval);

    return retval;

}


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

                "error initializing filter '%s' with args '%s'\n", name, args);

+        return NULL;
+
+    }
+
+

     return filt;

static AVFilterContext *create_filter(AVFilterGraph *ctx, int index,

                                      const char *name, const char *args,

                                      AVClass *log_ctx)

{

    AVFilterContext *filt;

    AVFilter *filterdef;

    char inst_name[30];

    snprintf(inst_name, sizeof(inst_name), "Parsed filter %d", index);

    if(!(filterdef = avfilter_get_by_name(name))) {

        av_log(log_ctx, AV_LOG_ERROR,

               "no such filter: '%s'\n", name);

        return NULL;

    }

    if(!(filt = avfilter_open(filterdef, inst_name))) {

        av_log(log_ctx, AV_LOG_ERROR,

               "error creating filter '%s'\n", name);

        return NULL;

    }

    if(avfilter_graph_add_filter(ctx, filt) < 0)

        return NULL;

    if(avfilter_init_filter(filt, args, NULL)) {

        av_log(log_ctx, AV_LOG_ERROR,

               "error initializing filter '%s' with args '%s'\n", name, args);

        return NULL;

    }

    return filt;

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
 static int dump_iterate(DumpState *s)
+
 {

     RAMBlock *block;
+
+    int64_t size;

     int ret;
+
+

     while (1) {

static int dump_iterate(DumpState *s)

{

    RAMBlock *block;

    int64_t size;

    int ret;

    while (1) {

        block = s->block;

        size = block->length;

        if (s->has_filter) {

            size -= s->start;

            if (s->begin + s->length < block->offset + block->length) {

                size -= block->offset + block->length - (s->begin + s->length);

            }

        }

        ret = write_memory(s, block, s->start, size);

        if (ret == -1) {

            return ret;

        }

        ret = get_next_block(s, block);

        if (ret == 1) {

            dump_completed(s);

            return 0;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -35,11 +35,11 @@
     env->excp_vectors[POWERPC_EXCP_DSTLB]    = 0x00001200;

     env->excp_vectors[POWERPC_EXCP_IABR]     = 0x00001300;
+
+    env->excp_vectors[POWERPC_EXCP_SMI]      = 0x00001400;
+
+    env->excp_vectors[POWERPC_EXCP_WDT]      = 0x00001500;
+
     env->excp_vectors[POWERPC_EXCP_EMUL]     = 0x00001600;

     env->excp_prefix = 0xFFF00000UL;

static void init_excp_602 (CPUPPCState *env)

{

#if !defined(CONFIG_USER_ONLY)

    env->excp_vectors[POWERPC_EXCP_RESET]    = 0x00000100;

    env->excp_vectors[POWERPC_EXCP_MCHECK]   = 0x00000200;

    env->excp_vectors[POWERPC_EXCP_DSI]      = 0x00000300;

    env->excp_vectors[POWERPC_EXCP_ISI]      = 0x00000400;

    env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;

    env->excp_vectors[POWERPC_EXCP_ALIGN]    = 0x00000600;

    env->excp_vectors[POWERPC_EXCP_PROGRAM]  = 0x00000700;

    env->excp_vectors[POWERPC_EXCP_FPU]      = 0x00000800;

    env->excp_vectors[POWERPC_EXCP_DECR]     = 0x00000900;

    env->excp_vectors[POWERPC_EXCP_SYSCALL]  = 0x00000C00;

    env->excp_vectors[POWERPC_EXCP_TRACE]    = 0x00000D00;

    env->excp_vectors[POWERPC_EXCP_FPA]      = 0x00000E00;

    env->excp_vectors[POWERPC_EXCP_IFTLB]    = 0x00001000;

    env->excp_vectors[POWERPC_EXCP_DLTLB]    = 0x00001100;

    env->excp_vectors[POWERPC_EXCP_DSTLB]    = 0x00001200;

    env->excp_vectors[POWERPC_EXCP_IABR]     = 0x00001300;

    env->excp_vectors[POWERPC_EXCP_SMI]      = 0x00001400;

    env->excp_vectors[POWERPC_EXCP_WDT]      = 0x00001500;

    env->excp_vectors[POWERPC_EXCP_EMUL]     = 0x00001600;

    env->excp_prefix = 0xFFF00000UL;

    /* Hardware reset vector */

    env->hreset_vector = 0xFFFFFFFCUL;

#endif

}


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

+    qemu_iovec_init_external(&qiov, &iov, 1);
+
+    return bdrv_pwritev(bs, offset, &qiov);
+
+}

int bdrv_pwrite(BlockDriverState *bs, int64_t offset,

                const void *buf, int bytes)

{

    QEMUIOVector qiov;

    struct iovec iov = {

        .iov_base   = (void *) buf,

        .iov_len    = bytes,

    };

    if (bytes < 0) {

        return -EINVAL;

    }

    qemu_iovec_init_external(&qiov, &iov, 1);

    return bdrv_pwritev(bs, offset, &qiov);

}


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

     }

+
+
+
+    ctxt->free = qcrypto_cipher_free_aes;
+
     ctxt->setiv = qcrypto_cipher_setiv_aes;

     ctxt->encrypt = qcrypto_cipher_encrypt_aes;

static int qcrypto_cipher_init_aes(QCryptoCipher *cipher,

                                   const uint8_t *key, size_t nkey,

                                   Error **errp)

{

    QCryptoCipherBuiltin *ctxt;

    if (cipher->mode != QCRYPTO_CIPHER_MODE_CBC &&

        cipher->mode != QCRYPTO_CIPHER_MODE_ECB) {

        error_setg(errp, "Unsupported cipher mode %d", cipher->mode);

        return -1;

    }

    ctxt = g_new0(QCryptoCipherBuiltin, 1);

    if (AES_set_encrypt_key(key, nkey * 8, &ctxt->state.aes.encrypt_key) != 0) {

        error_setg(errp, "Failed to set encryption key");

        goto error;

    }

    if (AES_set_decrypt_key(key, nkey * 8, &ctxt->state.aes.decrypt_key) != 0) {

        error_setg(errp, "Failed to set decryption key");

        goto error;

    }

    ctxt->free = qcrypto_cipher_free_aes;

    ctxt->setiv = qcrypto_cipher_setiv_aes;

    ctxt->encrypt = qcrypto_cipher_encrypt_aes;

    ctxt->decrypt = qcrypto_cipher_decrypt_aes;

    cipher->opaque = ctxt;

    return 0;

 error:

    g_free(ctxt);

    return -1;

}


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

     int output = (s->clk && s->enable) ? s->level : 0;
+
+
+
+    if (output != s->output) {

         s->output = output;

static void omap_pwl_update(struct omap_pwl_s *s)

{

    int output = (s->clk && s->enable) ? s->level : 0;

    if (output != s->output) {

        s->output = output;

        printf("%s: Backlight now at %i/256\n", __FUNCTION__, output);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int css_add_virtual_chpid(uint8_t cssid, uint8_t chpid, uint8_t type)

 {
+
+    CssImage *css;

static int css_add_virtual_chpid(uint8_t cssid, uint8_t chpid, uint8_t type)

{

    CssImage *css;

    trace_css_chpid_add(cssid, chpid, type);

    if (cssid > MAX_CSSID) {

        return -EINVAL;

    }

    css = channel_subsys.css[cssid];

    if (!css) {

        return -EINVAL;

    }

    if (css->chpids[chpid].in_use) {

        return -EEXIST;

    }

    css->chpids[chpid].in_use = 1;

    css->chpids[chpid].type = type;

    css->chpids[chpid].is_virtual = 1;

    css_generate_chp_crws(cssid, chpid);

    return 0;

}


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

     case TIFF_LONG : return tget_long(p, le);

+    default        : return UINT_MAX;
+
+    }
+
 }

static unsigned tget(const uint8_t **p, int type, int le)

{

    switch (type) {

    case TIFF_BYTE : return *(*p)++;

    case TIFF_SHORT: return tget_short(p, le);

    case TIFF_LONG : return tget_long(p, le);

    default        : return UINT_MAX;

    }

}


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

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

+                                          KVM_MP_STATE_UNINITIALIZED;
+
+    } else {
+
+        env->mp_state = KVM_MP_STATE_RUNNABLE;

     }

void kvm_arch_reset_vcpu(CPUX86State *env)

{

    env->exception_injected = -1;

    env->interrupt_injected = -1;

    env->xcr0 = 1;

    if (kvm_irqchip_in_kernel()) {

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

                                          KVM_MP_STATE_UNINITIALIZED;

    } else {

        env->mp_state = KVM_MP_STATE_RUNNABLE;

    }

}


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

     cpu_flags = get_cpu_flags() & mask;

void av_set_cpu_flags_mask(int mask)

{

    cpu_flags = get_cpu_flags() & mask;

}


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

     if (report && (t->running_async || t->running_retry)) {

+        t->status = report;
+
+        xhci_xfer_report(t);
+
+    }

static int xhci_ep_nuke_one_xfer(XHCITransfer *t, TRBCCode report)

{

    int killed = 0;

    if (report && (t->running_async || t->running_retry)) {

        t->status = report;

        xhci_xfer_report(t);

    }

    if (t->running_async) {

        usb_cancel_packet(&t->packet);

        t->running_async = 0;

        killed = 1;

    }

    if (t->running_retry) {

        XHCIEPContext *epctx = t->xhci->slots[t->slotid-1].eps[t->epid-1];

        if (epctx) {

            epctx->retry = NULL;

            timer_del(epctx->kick_timer);

        }

        t->running_retry = 0;

        killed = 1;

    }

    g_free(t->trbs);

    t->trbs = NULL;

    t->trb_count = t->trb_alloced = 0;

    return killed;

}


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

     fd = open(filename, O_WRONLY | O_BINARY);
+
+    if (fd < 0)
+
+        return -EIO;
+

     if (fstat(fd, &stat_buf) < 0)

static int hdev_create(const char *filename, QEMUOptionParameter *options)

{

    int fd;

    int ret = 0;

    struct stat stat_buf;

    int64_t total_size = 0;

    /* Read out options */

    while (options && options->name) {

        if (!strcmp(options->name, "size")) {

            total_size = options->value.n / 512;

        }

        options++;

    }

    fd = open(filename, O_WRONLY | O_BINARY);

    if (fd < 0)

        return -EIO;

    if (fstat(fd, &stat_buf) < 0)

        ret = -EIO;

    else if (!S_ISBLK(stat_buf.st_mode))

        ret = -EIO;

    else if (lseek(fd, 0, SEEK_END) < total_size * 512)

        ret = -ENOSPC;

    close(fd);

    return ret;

}


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

                                             QEMUIOVector *qiov,
+
                                             int nb_sectors,
+
                                             BlockDriverCompletionFunc *cb,

                                             void *opaque,

static BlockDriverAIOCB *bdrv_aio_rw_vector(BlockDriverState *bs,

                                            int64_t sector_num,

                                            QEMUIOVector *qiov,

                                            int nb_sectors,

                                            BlockDriverCompletionFunc *cb,

                                            void *opaque,

                                            int is_write)

{

    BlockDriverAIOCBSync *acb;

    acb = qemu_aio_get(&bdrv_em_aiocb_info, bs, cb, opaque);

    acb->is_write = is_write;

    acb->qiov = qiov;

    acb->bounce = qemu_blockalign(bs, qiov->size);

    acb->bh = aio_bh_new(bdrv_get_aio_context(bs), bdrv_aio_bh_cb, acb);

    if (is_write) {

        qemu_iovec_to_buf(acb->qiov, 0, acb->bounce, qiov->size);

        acb->ret = bs->drv->bdrv_write(bs, sector_num, acb->bounce, nb_sectors);

    } else {

        acb->ret = bs->drv->bdrv_read(bs, sector_num, acb->bounce, nb_sectors);

    }

    qemu_bh_schedule(acb->bh);

    return &acb->common;

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
     s->pins = qemu_allocate_irqs(omap_set_intr, s, nbanks * 32);

     if (pins)
+
+        *pins = s->pins;
+
+
+
     memory_region_init_io(&s->mmio, &omap_inth_mem_ops, s, "omap-intc", size);

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

struct omap_intr_handler_s *omap_inth_init(target_phys_addr_t base,

                unsigned long size, unsigned char nbanks, qemu_irq **pins,

                qemu_irq parent_irq, qemu_irq parent_fiq, omap_clk clk)

{

    struct omap_intr_handler_s *s = (struct omap_intr_handler_s *)

            g_malloc0(sizeof(struct omap_intr_handler_s) +

                            sizeof(struct omap_intr_handler_bank_s) * nbanks);

    s->parent_intr[0] = parent_irq;

    s->parent_intr[1] = parent_fiq;

    s->nbanks = nbanks;

    s->pins = qemu_allocate_irqs(omap_set_intr, s, nbanks * 32);

    if (pins)

        *pins = s->pins;

    memory_region_init_io(&s->mmio, &omap_inth_mem_ops, s, "omap-intc", size);

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

    omap_inth_reset(s);

    return s;

}


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

 	    unsigned b,g,r;

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

{

	long i;

	long num_pixels = src_size >> 1;

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

	{

	    unsigned b,g,r;

	    register uint16_t rgb;

	    rgb = src[2*i];

	    r = rgb&0x1F;

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

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

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

	}

}


--- a/source.c
+++ b/source.c
@@ -9,8 +9,8 @@
     USBDevice *dev;

+
+    dev = USB_DEVICE(qdev_try_create(&bus->qbus, name));

     if (!dev) {

static USBDevice *usb_try_create_simple(USBBus *bus, const char *name,

                                        Error **errp)

{

    Error *err = NULL;

    USBDevice *dev;

    dev = USB_DEVICE(qdev_try_create(&bus->qbus, name));

    if (!dev) {

        error_setg(errp, "Failed to create USB device '%s'", name);

        return NULL;

    }

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

    if (err) {

        error_propagate(errp, err);

        error_prepend(errp, "Failed to initialize USB device '%s': ",

                      name);

        object_unparent(OBJECT(dev));

        return NULL;

    }

    return dev;

}


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

     uint16_t *prev = prev1;

+    uint16_t *cur  = cur1;
+
+    uint16_t *next = next1;
+
     int x;

     uint16_t *prev2 = parity ? prev : cur ;

static void filter_edges_16bit(void *dst1, void *prev1, void *cur1, void *next1,

                               int w, int prefs, int mrefs, int parity, int mode)

{

    uint16_t *dst  = dst1;

    uint16_t *prev = prev1;

    uint16_t *cur  = cur1;

    uint16_t *next = next1;

    int x;

    uint16_t *prev2 = parity ? prev : cur ;

    uint16_t *next2 = parity ? cur  : next;

    mrefs /= 2;

    prefs /= 2;

    FILTER(0, 3, 0)

    dst   = (uint16_t*)dst1  + w - 3;

    prev  = (uint16_t*)prev1 + w - 3;

    cur   = (uint16_t*)cur1  + w - 3;

    next  = (uint16_t*)next1 + w - 3;

    prev2 = (uint16_t*)(parity ? prev : cur);

    next2 = (uint16_t*)(parity ? cur  : next);

    FILTER(w - 3, w, 0)

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void blkverify_err(BlkverifyAIOCB *acb, const char *fmt, ...)

 {
+
     va_list ap;

static void blkverify_err(BlkverifyAIOCB *acb, const char *fmt, ...)

{

    va_list ap;

    va_start(ap, fmt);

    fprintf(stderr, "blkverify: %s sector_num=%ld nb_sectors=%d ",

            acb->is_write ? "write" : "read", acb->sector_num,

            acb->nb_sectors);

    vfprintf(stderr, fmt, ap);

    fprintf(stderr, "\n");

    va_end(ap);

    exit(1);

}


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

+    generate_joint_tables(s);
+
+
+
+    return 0;

 }

static int read_old_huffman_tables(HYuvContext *s)

{

    GetBitContext gb;

    int i;

    init_get_bits(&gb, classic_shift_luma,

                  classic_shift_luma_table_size * 8);

    if (read_len_table(s->len[0], &gb) < 0)

        return -1;

    init_get_bits(&gb, classic_shift_chroma,

                  classic_shift_chroma_table_size * 8);

    if (read_len_table(s->len[1], &gb) < 0)

        return -1;

    for(i=0; i<256; i++) s->bits[0][i] = classic_add_luma  [i];

    for(i=0; i<256; i++) s->bits[1][i] = classic_add_chroma[i];

    if (s->bitstream_bpp >= 24) {

        memcpy(s->bits[1], s->bits[0], 256 * sizeof(uint32_t));

        memcpy(s->len[1] , s->len [0], 256 * sizeof(uint8_t));

    }

    memcpy(s->bits[2], s->bits[1], 256 * sizeof(uint32_t));

    memcpy(s->len[2] , s->len [1], 256 * sizeof(uint8_t));

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

        ff_free_vlc(&s->vlc[i]);

        init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1,

                 s->bits[i], 4, 4, 0);

    }

    generate_joint_tables(s);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
     ret->av_class = &avfilter_class;

     ret->filter   = filter;
+
+    ret->name     = inst_name ? av_strdup(inst_name) : NULL;
+
+    if (filter->priv_size)
+
         ret->priv     = av_mallocz(filter->priv_size);

int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name)

{

    AVFilterContext *ret;

    *filter_ctx = NULL;

    if (!filter)

        return AVERROR(EINVAL);

    ret = av_mallocz(sizeof(AVFilterContext));

    ret->av_class = &avfilter_class;

    ret->filter   = filter;

    ret->name     = inst_name ? av_strdup(inst_name) : NULL;

    if (filter->priv_size)

        ret->priv     = av_mallocz(filter->priv_size);

    ret->input_count  = pad_count(filter->inputs);

    if (ret->input_count) {

        ret->input_pads   = av_malloc(sizeof(AVFilterPad) * ret->input_count);

        memcpy(ret->input_pads, filter->inputs, sizeof(AVFilterPad) * ret->input_count);

        ret->inputs       = av_mallocz(sizeof(AVFilterLink*) * ret->input_count);

    }

    ret->output_count = pad_count(filter->outputs);

    if (ret->output_count) {

        ret->output_pads  = av_malloc(sizeof(AVFilterPad) * ret->output_count);

        memcpy(ret->output_pads, filter->outputs, sizeof(AVFilterPad) * ret->output_count);

        ret->outputs      = av_mallocz(sizeof(AVFilterLink*) * ret->output_count);

    }

    *filter_ctx = ret;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 static void qmp_input_type_number(Visitor *v, double *obj, const char *name,

+                                  Error **errp)
+
+{

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

static void qmp_input_type_number(Visitor *v, double *obj, const char *name,

                                  Error **errp)

{

    QmpInputVisitor *qiv = to_qiv(v);

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

    if (!qobj || (qobject_type(qobj) != QTYPE_QFLOAT &&

        qobject_type(qobj) != QTYPE_QINT)) {

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

                   "number");

        return;

    }

    if (qobject_type(qobj) == QTYPE_QINT) {

        *obj = qint_get_int(qobject_to_qint(qobj));

    } else {

        *obj = qfloat_get_double(qobject_to_qfloat(qobj));

    }

}


--- a/source.c
+++ b/source.c
@@ -39,9 +39,9 @@
     }

     seek_data = g_new0(GuestFileSeek, 1);
+
+    seek_data->position = new_pos.QuadPart;
+
+    return seek_data;
+
 }

GuestFileSeek *qmp_guest_file_seek(int64_t handle, int64_t offset,

                                   int64_t whence, Error **errp)

{

    GuestFileHandle *gfh;

    GuestFileSeek *seek_data;

    HANDLE fh;

    LARGE_INTEGER new_pos, off_pos;

    off_pos.QuadPart = offset;

    BOOL res;

    gfh = guest_file_handle_find(handle, errp);

    if (!gfh) {

        return NULL;

    }

    fh = gfh->fh;

    res = SetFilePointerEx(fh, off_pos, &new_pos, whence);

    if (!res) {

        error_setg_win32(errp, GetLastError(), "failed to seek file");

        return NULL;

    }

    seek_data = g_new0(GuestFileSeek, 1);

    seek_data->position = new_pos.QuadPart;

    return seek_data;

}


static void tgen_branch(TCGContext *s, int cc, int labelno)

{

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

    if (l->has_value) {

        tgen_gotoi(s, cc, l->u.value_ptr);

    } else if (USE_LONG_BRANCHES) {

        tcg_out16(s, RIL_BRCL | (cc << 4));

        tcg_out_reloc(s, s->code_ptr, R_390_PC32DBL, labelno, -2);

        s->code_ptr += 2;

    } else {

        tcg_out16(s, RI_BRC | (cc << 4));

        tcg_out_reloc(s, s->code_ptr, R_390_PC16DBL, labelno, -2);

        s->code_ptr += 1;

    }

}


static uint32_t adler32(uint32_t adler, const uint8_t *buf, unsigned int len)

{

    unsigned long s1 = adler & 0xffff;

    unsigned long s2 = (adler >> 16) & 0xffff;

    int k;

    if (buf == NULL) return 1L;

    while (len > 0) {

        k = len < NMAX ? len : NMAX;

        len -= k;

        while (k >= 16) {

            DO16(buf);

            k -= 16;

        }

        if (k != 0) do {

            DO1(buf);

        } while (--k);

        s1 %= BASE;

        s2 %= BASE;

    }

    return (s2 << 16) | s1;

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
 static void booke_update_fixed_timer(CPUPPCState         *env,

+                                     uint8_t           target_bit,

+                                     uint64_t          *next,

                                      struct QEMUTimer *timer)

+{
+
     ppc_tb_t *tb_env = env->tb_env;

     uint64_t lapse;

static void booke_update_fixed_timer(CPUPPCState         *env,

                                     uint8_t           target_bit,

                                     uint64_t          *next,

                                     struct QEMUTimer *timer)

{

    ppc_tb_t *tb_env = env->tb_env;

    uint64_t lapse;

    uint64_t tb;

    uint64_t period = 1 << (target_bit + 1);

    uint64_t now;

    now = qemu_get_clock_ns(vm_clock);

    tb  = cpu_ppc_get_tb(tb_env, now, tb_env->tb_offset);

    lapse = period - ((tb - (1 << target_bit)) & (period - 1));

    *next = now + muldiv64(lapse, get_ticks_per_sec(), tb_env->tb_freq);

    /* XXX: If expire time is now. We can't run the callback because we don't

     * have access to it. So we just set the timer one nanosecond later.

     */

    if (*next == now) {

        (*next)++;

    }

    qemu_mod_timer(timer, *next);

}


--- a/source.c
+++ b/source.c
@@ -26,11 +26,11 @@
      * 10 - Epoch start, previous objects and palettes can be released
      * 11 - Epoch continue, previous objects and palettes can be released
      *
+     * reserved 6 bits discarded
+     */
+    state = bytestream_get_byte(&buf) >> 6;
+    if (state != 0) {
+        flush_cache(avctx);
     /*
      * skip palette_update_flag (0x80),
      */

static int parse_presentation_segment(AVCodecContext *avctx,
                                      const uint8_t *buf, int buf_size,
                                      int64_t pts)
{
    PGSSubContext *ctx = avctx->priv_data;
    int i, state, ret;
    const uint8_t *buf_end = buf + buf_size;
    // Video descriptor
    int w = bytestream_get_be16(&buf);
    int h = bytestream_get_be16(&buf);
    uint16_t object_index;
    ctx->presentation.pts = pts;
    av_dlog(avctx, "Video Dimensions %dx%d\n",
            w, h);
    ret = ff_set_dimensions(avctx, w, h);
    if (ret < 0)
        return ret;
    /* Skip 1 bytes of unknown, frame rate */
    buf++;
    // Composition descriptor
    ctx->presentation.id_number = bytestream_get_be16(&buf);
    /*
     * state is a 2 bit field that defines pgs epoch boundaries
     * 00 - Normal, previously defined objects and palettes are still valid
     * 01 - Acquisition point, previous objects and palettes can be released
     * 10 - Epoch start, previous objects and palettes can be released
     * 11 - Epoch continue, previous objects and palettes can be released
     *
     * reserved 6 bits discarded
     */
    state = bytestream_get_byte(&buf) >> 6;
    if (state != 0) {
        flush_cache(avctx);
    /*
     * skip palette_update_flag (0x80),
     */
    buf += 1;
    ctx->presentation.palette_id = bytestream_get_byte(&buf);
    ctx->presentation.object_count = bytestream_get_byte(&buf);
    if (ctx->presentation.object_count > MAX_OBJECT_REFS) {
        av_log(avctx, AV_LOG_ERROR,
               "Invalid number of presentation objects %d\n",
               ctx->presentation.object_count);
        ctx->presentation.object_count = 2;
        if (avctx->err_recognition & AV_EF_EXPLODE) {
    for (i = 0; i < ctx->presentation.object_count; i++)
    {
        ctx->presentation.objects[i].id = bytestream_get_be16(&buf);
        ctx->presentation.objects[i].window_id = bytestream_get_byte(&buf);
        ctx->presentation.objects[i].composition_flag = bytestream_get_byte(&buf);
        ctx->presentation.objects[i].x = bytestream_get_be16(&buf);
        ctx->presentation.objects[i].y = bytestream_get_be16(&buf);
        // If cropping
        if (ctx->presentation.objects[i].composition_flag & 0x80) {
            ctx->presentation.objects[i].crop_x = bytestream_get_be16(&buf);
            ctx->presentation.objects[i].crop_y = bytestream_get_be16(&buf);
            ctx->presentation.objects[i].crop_w = bytestream_get_be16(&buf);
            ctx->presentation.objects[i].crop_h = bytestream_get_be16(&buf);
        av_dlog(avctx, "Subtitle Placement x=%d, y=%d\n",
                ctx->presentation.objects[i].x, ctx->presentation.objects[i].y);
        if (ctx->presentation.objects[i].x > avctx->width ||
            ctx->presentation.objects[i].y > avctx->height) {
            av_log(avctx, AV_LOG_ERROR, "Subtitle out of video bounds. x = %d, y = %d, video width = %d, video height = %d.\n",
                   ctx->presentation.objects[i].x,
                   ctx->presentation.objects[i].y,
                    avctx->width, avctx->height);
            ctx->presentation.objects[i].x = 0;
            ctx->presentation.objects[i].y = 0;
            if (avctx->err_recognition & AV_EF_EXPLODE) {
    return 0;


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

         fprintf(stderr, "qemu: tried to set invalid watchpoint at "

+                TARGET_FMT_lx ", len=" TARGET_FMT_lu "\n", addr, len);
+
+        return -EINVAL;
+
+    }

     wp = qemu_malloc(sizeof(*wp));

int cpu_watchpoint_insert(CPUState *env, target_ulong addr, target_ulong len,

                          int flags, CPUWatchpoint **watchpoint)

{

    target_ulong len_mask = ~(len - 1);

    CPUWatchpoint *wp;

    /* sanity checks: allow power-of-2 lengths, deny unaligned watchpoints */

    if ((len != 1 && len != 2 && len != 4 && len != 8) || (addr & ~len_mask)) {

        fprintf(stderr, "qemu: tried to set invalid watchpoint at "

                TARGET_FMT_lx ", len=" TARGET_FMT_lu "\n", addr, len);

        return -EINVAL;

    }

    wp = qemu_malloc(sizeof(*wp));

    wp->vaddr = addr;

    wp->len_mask = len_mask;

    wp->flags = flags;

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

    if (flags & BP_GDB)

        TAILQ_INSERT_HEAD(&env->watchpoints, wp, entry);

    else

        TAILQ_INSERT_TAIL(&env->watchpoints, wp, entry);

    tlb_flush_page(env, addr);

    if (watchpoint)

        *watchpoint = wp;

    return 0;

}


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

             info->server = qmp_query_server_entry(

+                vd->lwebsock, true, info->server);
+
+        }
+
+

         item = g_new0(VncInfo2List, 1);

VncInfo2List *qmp_query_vnc_servers(Error **errp)

{

    VncInfo2List *item, *prev = NULL;

    VncInfo2 *info;

    VncDisplay *vd;

    DeviceState *dev;

    QTAILQ_FOREACH(vd, &vnc_displays, next) {

        info = g_new0(VncInfo2, 1);

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

        info->clients = qmp_query_client_list(vd);

        qmp_query_auth(vd, info);

        if (vd->dcl.con) {

            dev = DEVICE(object_property_get_link(OBJECT(vd->dcl.con),

                                                  "device", NULL));

            info->has_display = true;

            info->display = g_strdup(dev->id);

        }

        if (vd->lsock != NULL) {

            info->server = qmp_query_server_entry(

                vd->lsock, false, info->server);

        }

        if (vd->lwebsock != NULL) {

            info->server = qmp_query_server_entry(

                vd->lwebsock, true, info->server);

        }

        item = g_new0(VncInfo2List, 1);

        item->value = info;

        item->next = prev;

        prev = item;

    }

    return prev;

}


--- a/source.c
+++ b/source.c
@@ -11,7 +11,7 @@
     DeviceState *dev;

     Error *err = NULL;
+

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

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) {

        qdev_prop_set_int32(dev, "bootindex", bootindex);

    }

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

        qdev_prop_set_bit(dev, "removable", removable);

    }

    if (serial) {

        qdev_prop_set_string(dev, "serial", serial);

    }

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

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

        qdev_free(dev);

        return NULL;

    }

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

    if (err != NULL) {

        error_propagate(errp, err);

        qdev_free(dev);

        return NULL;

    }

    return SCSI_DEVICE(dev);

}


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

     /* revision */

+    d->config[0x08] = 0x00;
+
+    pci_config_set_class(d->config, PCI_CLASS_BRIDGE_HOST);
+
+    /* cache line size */

     d->config[0x0C] = 0x08;

static int u3_agp_pci_host_init(PCIDevice *d)

{

    pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_APPLE);

    pci_config_set_device_id(d->config, PCI_DEVICE_ID_APPLE_U3_AGP);

    /* revision */

    d->config[0x08] = 0x00;

    pci_config_set_class(d->config, PCI_CLASS_BRIDGE_HOST);

    /* cache line size */

    d->config[0x0C] = 0x08;

    /* latency timer */

    d->config[0x0D] = 0x10;

    return 0;

}


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

+{
+
     Coroutine *coroutine;

static void test_self(void)

{

    Coroutine *coroutine;

    coroutine = qemu_coroutine_create(verify_self);

    qemu_coroutine_enter(coroutine, &coroutine);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+static void nbd_client_close(NBDClient *client)
+
+{
+
     qemu_set_fd_handler2(client->sock, NULL, NULL, NULL, NULL);

     close(client->sock);
+
     client->sock = -1;

     if (client->close) {

static void nbd_client_close(NBDClient *client)

{

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

    close(client->sock);

    client->sock = -1;

    if (client->close) {

        client->close(client);

    }

    nbd_client_put(client);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int line_out_init (HWVoiceOut *hw, struct audsettings *as)

 {

static int line_out_init (HWVoiceOut *hw, struct audsettings *as)

{

    SpiceVoiceOut *out = container_of (hw, SpiceVoiceOut, hw);

    struct audsettings settings;

#if SPICE_INTERFACE_PLAYBACK_MAJOR > 1 || SPICE_INTERFACE_PLAYBACK_MINOR >= 3

    settings.freq       = spice_server_get_best_playback_rate(NULL);

#else

    settings.freq       = SPICE_INTERFACE_PLAYBACK_FREQ;

#endif

    settings.nchannels  = SPICE_INTERFACE_PLAYBACK_CHAN;

    settings.fmt        = AUD_FMT_S16;

    settings.endianness = AUDIO_HOST_ENDIANNESS;

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

    hw->samples = LINE_OUT_SAMPLES;

    out->active = 0;

    out->sin.base.sif = &playback_sif.base;

    qemu_spice_add_interface (&out->sin.base);

#if SPICE_INTERFACE_PLAYBACK_MAJOR > 1 || SPICE_INTERFACE_PLAYBACK_MINOR >= 3

    spice_server_set_playback_rate(&out->sin, settings.freq);

#endif

    return 0;

}


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

     assert(!(size & (size - 1)));       /* power of 2 */
+
     assert(size >= PCIE_MMCFG_SIZE_MIN);

     assert(size <= PCIE_MMCFG_SIZE_MAX);

void pcie_host_mmcfg_init(PCIExpressHost *e, uint32_t size)

{

    assert(!(size & (size - 1)));       /* power of 2 */

    assert(size >= PCIE_MMCFG_SIZE_MIN);

    assert(size <= PCIE_MMCFG_SIZE_MAX);

    e->size = size;

    memory_region_init_io(&e->mmio, OBJECT(e), &pcie_mmcfg_ops, e,

                          "pcie-mmcfg", e->size);

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                                        gpointer user_data)

 {
+
+    return g_io_watch_funcs.dispatch(source, callback, user_data);

 }

static gboolean io_watch_poll_dispatch(GSource *source, GSourceFunc callback,

                                       gpointer user_data)

{

    return g_io_watch_funcs.dispatch(source, callback, user_data);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int decode_mb(MadContext *s, AVFrame *frame, int inter)

+{

     int mv_map = 0;

static int decode_mb(MadContext *s, AVFrame *frame, int inter)

{

    int mv_map = 0;

    int mv_x, mv_y;

    int j;

    if (inter) {

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

        if (v < 2) {

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

            mv_x = decode_motion(&s->gb);

            mv_y = decode_motion(&s->gb);

        }

    }

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

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

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

            if (s->last_frame->data[0])

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

        } else {

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

            if(decode_block_intra(s, s->block) < 0)

                return -1;

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

        }

    }

    return 0;

}


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

     socklen_t addrlen;

+    int ret;

static int socket_accept(int sock)

{

    struct sockaddr_un addr;

    socklen_t addrlen;

    int ret;

    addrlen = sizeof(addr);

    do {

        ret = accept(sock, (struct sockaddr *)&addr, &addrlen);

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

    g_assert_no_errno(ret);

    close(sock);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 CPUDebugExcpHandler *cpu_set_debug_excp_handler(CPUDebugExcpHandler *handler)

+{
+
+    CPUDebugExcpHandler *old_handler = debug_excp_handler;

CPUDebugExcpHandler *cpu_set_debug_excp_handler(CPUDebugExcpHandler *handler)

{

    CPUDebugExcpHandler *old_handler = debug_excp_handler;

    debug_excp_handler = handler;

    return old_handler;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void virtio_gpu_cleanup_mapping(struct virtio_gpu_simple_resource *res)

+{

     virtio_gpu_cleanup_mapping_iov(res->iov, res->iov_cnt);

static void virtio_gpu_cleanup_mapping(struct virtio_gpu_simple_resource *res)

{

    virtio_gpu_cleanup_mapping_iov(res->iov, res->iov_cnt);

    g_free(res->iov);

    res->iov = NULL;

    res->iov_cnt = 0;

}


--- a/source.c
+++ b/source.c
@@ -14,11 +14,11 @@
         r->req.resid -= r->req.sg->size;
         r->req.aiocb = dma_bdrv_read(s->qdev.conf.bs, r->req.sg, r->sector,
                                      scsi_dma_complete, r);
+    } else {
+        n = scsi_init_iovec(r, SCSI_DMA_BUF_SIZE);
+        bdrv_acct_start(s->qdev.conf.bs, &r->acct, n * BDRV_SECTOR_SIZE, BDRV_ACCT_READ);
+        r->req.aiocb = bdrv_aio_readv(s->qdev.conf.bs, r->sector, &r->qiov, n,
+                                      scsi_read_complete, r);
 done:
     if (!r->req.io_canceled) {
         scsi_req_unref(&r->req);

static void scsi_do_read(void *opaque, int ret)
{
    SCSIDiskReq *r = opaque;
    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
    uint32_t n;
    if (r->req.aiocb != NULL) {
        r->req.aiocb = NULL;
        bdrv_acct_done(s->qdev.conf.bs, &r->acct);
    if (ret < 0) {
        if (scsi_handle_rw_error(r, -ret)) {
            goto done;
    if (r->req.sg) {
        dma_acct_start(s->qdev.conf.bs, &r->acct, r->req.sg, BDRV_ACCT_READ);
        r->req.resid -= r->req.sg->size;
        r->req.aiocb = dma_bdrv_read(s->qdev.conf.bs, r->req.sg, r->sector,
                                     scsi_dma_complete, r);
    } else {
        n = scsi_init_iovec(r, SCSI_DMA_BUF_SIZE);
        bdrv_acct_start(s->qdev.conf.bs, &r->acct, n * BDRV_SECTOR_SIZE, BDRV_ACCT_READ);
        r->req.aiocb = bdrv_aio_readv(s->qdev.conf.bs, r->sector, &r->qiov, n,
                                      scsi_read_complete, r);
done:
    if (!r->req.io_canceled) {
        scsi_req_unref(&r->req);


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+static void watch_mem_write(void *opaque, hwaddr addr,
+
                             uint64_t val, unsigned size)
+
 {
+
     check_watchpoint(addr & ~TARGET_PAGE_MASK, size, BP_MEM_WRITE);
+
     switch (size) {

     case 1:

static void watch_mem_write(void *opaque, hwaddr addr,

                            uint64_t val, unsigned size)

{

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

    switch (size) {

    case 1:

        stb_phys(&address_space_memory, addr, val);

        break;

    case 2:

        stw_phys(&address_space_memory, addr, val);

        break;

    case 4:

        stl_phys(&address_space_memory, addr, val);

        break;

    default: abort();

    }

}


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

     cf->idx_ref = av_buffer_pool_get(ctx->decoder_pool);

+    if (!cf->idx_ref) {
+
+        av_log(avctx, AV_LOG_ERROR, "No decoder surfaces left\n");
+
+        ret = AVERROR(ENOMEM);

         goto fail;

int ff_nvdec_start_frame(AVCodecContext *avctx, AVFrame *frame)

{

    NVDECContext *ctx = avctx->internal->hwaccel_priv_data;

    FrameDecodeData *fdd = (FrameDecodeData*)frame->private_ref->data;

    NVDECFrame *cf = NULL;

    int ret;

    ctx->bitstream_len = 0;

    ctx->nb_slices     = 0;

    if (fdd->hwaccel_priv)

        return 0;

    cf = av_mallocz(sizeof(*cf));

    if (!cf)

        return AVERROR(ENOMEM);

    cf->decoder_ref = av_buffer_ref(ctx->decoder_ref);

    if (!cf->decoder_ref)

        goto fail;

    cf->idx_ref = av_buffer_pool_get(ctx->decoder_pool);

    if (!cf->idx_ref) {

        av_log(avctx, AV_LOG_ERROR, "No decoder surfaces left\n");

        ret = AVERROR(ENOMEM);

        goto fail;

    }

    cf->idx = *(unsigned int*)cf->idx_ref->data;

    fdd->hwaccel_priv      = cf;

    fdd->hwaccel_priv_free = nvdec_fdd_priv_free;

    fdd->post_process      = nvdec_retrieve_data;

    return 0;

fail:

    nvdec_fdd_priv_free(cf);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     case DCA_SYNCWORD_CORE_14B_LE:

         return avpriv_dca_convert_bitstream(src, src_size, dst, max_size);
+
+    default:
+
+        return AVERROR_INVALIDDATA;
+
     }

 }

static int convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst, int max_size)

{

    switch (AV_RB32(src)) {

    case DCA_SYNCWORD_CORE_BE:

    case DCA_SYNCWORD_SUBSTREAM:

        memcpy(dst, src, src_size);

        return src_size;

    case DCA_SYNCWORD_CORE_LE:

    case DCA_SYNCWORD_CORE_14B_BE:

    case DCA_SYNCWORD_CORE_14B_LE:

        return avpriv_dca_convert_bitstream(src, src_size, dst, max_size);

    default:

        return AVERROR_INVALIDDATA;

    }

}


static void arm_cache_flush(abi_ulong start, abi_ulong last)

{

    abi_ulong addr, last1;

    if (last < start)

        return;

    addr = start;

    for(;;) {

        last1 = ((addr + TARGET_PAGE_SIZE) & TARGET_PAGE_MASK) - 1;

        if (last1 > last)

            last1 = last;

        tb_invalidate_page_range(addr, last1 + 1);

        if (last1 == last)

            break;

        addr = last1 + 1;

    }

}


static void FUNCC(pred8x8l_horizontal)(uint8_t *p_src, int has_topleft, int has_topright, int p_stride)

{

    pixel *src = (pixel*)p_src;

    int stride = p_stride>>(sizeof(pixel)-1);

    PREDICT_8x8_LOAD_LEFT;

#define ROW(y) ((pixel4*)(src+y*stride))[0] =\

               ((pixel4*)(src+y*stride))[1] = PIXEL_SPLAT_X4(l##y)

    ROW(0); ROW(1); ROW(2); ROW(3); ROW(4); ROW(5); ROW(6); ROW(7);

#undef ROW

}


--- a/source.c
+++ b/source.c
@@ -33,9 +33,9 @@
     str = "crap";

     res = qemu_strtosz(str, &endptr);
+
+    g_assert_cmpint(res, ==, -EINVAL);
+
+    g_assert(endptr == str);
+
 }

static void test_qemu_strtosz_invalid(void)

{

    const char *str;

    char *endptr = NULL;

    int64_t res;

    str = "";

    res = qemu_strtosz(str, &endptr);

    g_assert_cmpint(res, ==, -EINVAL);

    g_assert(endptr == str);

    str = " \t ";

    res = qemu_strtosz(str, &endptr);

    g_assert_cmpint(res, ==, -EINVAL);

    g_assert(endptr == str);

    str = "crap";

    res = qemu_strtosz(str, &endptr);

    g_assert_cmpint(res, ==, -EINVAL);

    g_assert(endptr == str);

}


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

                    const uint8_t *src_data[4], const int src_linesizes[4],

+                   enum AVPixelFormat pix_fmt, int width, int height)
+
+{
+
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);

void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],

                   const uint8_t *src_data[4], const int src_linesizes[4],

                   enum AVPixelFormat pix_fmt, int width, int height)

{

    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);

    if (!desc || desc->flags & PIX_FMT_HWACCEL)

    if (desc->flags & PIX_FMT_PAL ||

        desc->flags & PIX_FMT_PSEUDOPAL) {

        av_image_copy_plane(dst_data[0], dst_linesizes[0],

                            src_data[0], src_linesizes[0],

                            width, height);

        /* copy the palette */

        memcpy(dst_data[1], src_data[1], 4*256);

    } else {

        int i, planes_nb = 0;

        for (i = 0; i < desc->nb_components; i++)

            planes_nb = FFMAX(planes_nb, desc->comp[i].plane + 1);

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

            int h = height;

            int bwidth = av_image_get_linesize(pix_fmt, width, i);

            if (i == 1 || i == 2) {

                h= -((-height)>>desc->log2_chroma_h);

            av_image_copy_plane(dst_data[i], dst_linesizes[i],

                                src_data[i], src_linesizes[i],

                                bwidth, h);


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

+    default: /* Should not be possible, but just in case */
+
+       VNC_DEBUG("Reject subauth %d server bug\n", vs->vd->auth);
+
+       vnc_write_u8(vs, 1);

        if (vs->minor >= 8) {

static void start_auth_vencrypt_subauth(VncState *vs)

{

    switch (vs->vd->subauth) {

    case VNC_AUTH_VENCRYPT_TLSNONE:

    case VNC_AUTH_VENCRYPT_X509NONE:

       VNC_DEBUG("Accept TLS auth none\n");

       vnc_write_u32(vs, 0); /* Accept auth completion */

       start_client_init(vs);

       break;

    case VNC_AUTH_VENCRYPT_TLSVNC:

    case VNC_AUTH_VENCRYPT_X509VNC:

       VNC_DEBUG("Start TLS auth VNC\n");

       start_auth_vnc(vs);

       break;

#ifdef CONFIG_VNC_SASL

    case VNC_AUTH_VENCRYPT_TLSSASL:

    case VNC_AUTH_VENCRYPT_X509SASL:

      VNC_DEBUG("Start TLS auth SASL\n");

      return start_auth_sasl(vs);

#endif /* CONFIG_VNC_SASL */

    default: /* Should not be possible, but just in case */

       VNC_DEBUG("Reject subauth %d server bug\n", vs->vd->auth);

       vnc_write_u8(vs, 1);

       if (vs->minor >= 8) {

           static const char err[] = "Unsupported authentication type";

           vnc_write_u32(vs, sizeof(err));

           vnc_write(vs, err, sizeof(err));

       }

       vnc_client_error(vs);

    }

}


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

         return 0;

+
+
+    n->has_ufo = qemu_peer_has_ufo(qemu_get_queue(n->nic));
+

     return n->has_ufo;

static int peer_has_ufo(VirtIONet *n)

{

    if (!peer_has_vnet_hdr(n))

        return 0;

    n->has_ufo = qemu_peer_has_ufo(qemu_get_queue(n->nic));

    return n->has_ufo;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void pcx_palette(const uint8_t **src, uint32_t *dst, unsigned int pallen) {
+
     unsigned int i;
+

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

static void pcx_palette(const uint8_t **src, uint32_t *dst, unsigned int pallen) {

    unsigned int i;

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

        *dst++ = 0xFF000000 | bytestream_get_be24(src);

    if (pallen < 256)

        memset(dst, 0, (256 - pallen) * sizeof(*dst));

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void gen_tlbsync(DisasContext *ctx)

 {
+
 #if defined(CONFIG_USER_ONLY)

     GEN_PRIV;

static void gen_tlbsync(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    GEN_PRIV;

#else

    CHK_HV;

    /* tlbsync is a nop for server, ptesync handles delayed tlb flush,

     * embedded however needs to deal with tlbsync. We don't try to be

     * fancy and swallow the overhead of checking for both.

     */

    gen_check_tlb_flush(ctx);

#endif /* defined(CONFIG_USER_ONLY) */

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static int av_thread_message_queue_recv_locked(AVThreadMessageQueue *mq,

                                                void *msg,
+
                                                unsigned flags)

 {
+
     while (!mq->err_recv && av_fifo_size(mq->fifo) < mq->elsize) {

         if ((flags & AV_THREAD_MESSAGE_NONBLOCK))

static int av_thread_message_queue_recv_locked(AVThreadMessageQueue *mq,

                                               void *msg,

                                               unsigned flags)

{

    while (!mq->err_recv && av_fifo_size(mq->fifo) < mq->elsize) {

        if ((flags & AV_THREAD_MESSAGE_NONBLOCK))

            return AVERROR(EAGAIN);

        pthread_cond_wait(&mq->cond, &mq->lock);

    }

    if (av_fifo_size(mq->fifo) < mq->elsize)

        return mq->err_recv;

    av_fifo_generic_read(mq->fifo, msg, mq->elsize, NULL);

    pthread_cond_signal(&mq->cond);

    return 0;

}


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

     struct QOSState *qs = g_malloc(sizeof(QOSState));

+
+
+    cmdline = g_strdup_vprintf(cmdline_fmt, ap);
+
+    qs->qts = qtest_start(cmdline);

     qs->ops = ops;

QOSState *qtest_vboot(QOSOps *ops, const char *cmdline_fmt, va_list ap)

{

    char *cmdline;

    struct QOSState *qs = g_malloc(sizeof(QOSState));

    cmdline = g_strdup_vprintf(cmdline_fmt, ap);

    qs->qts = qtest_start(cmdline);

    qs->ops = ops;

    qtest_irq_intercept_in(global_qtest, "ioapic");

    if (ops && ops->init_allocator) {

        qs->alloc = ops->init_allocator(ALLOC_NO_FLAGS);

    }

    g_free(cmdline);

    return qs;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int mov_read_wide(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)

+{

     int err;

@@ -11,7 +11,7 @@
 #ifdef DEBUG

     print_atom("wide", atom);
+
     debug_indent++;

 #endif

static int mov_read_wide(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)

{

    int err;

    uint32_t type;

#ifdef DEBUG

    print_atom("wide", atom);

    debug_indent++;

#endif

    if (atom.size < 8)

        return 0; /* continue */

    if (get_be32(pb) != 0) { /* 0 sized mdat atom... use the 'wide' atom size */

        url_fskip(pb, atom.size - 4);

        return 0;

    }

    atom.type = get_le32(pb);

    atom.offset += 8;

    atom.size -= 8;

    if (type != MKTAG('m', 'd', 'a', 't')) {

        url_fskip(pb, atom.size);

        return 0;

    }

    err = mov_read_mdat(c, pb, atom);

#ifdef DEBUG

    debug_indent--;

#endif

    return err;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void AcpiCpuHotplug_add(ACPIGPE *gpe, AcpiCpuHotplug *g, CPUState *cpu)

+{
+
+    CPUClass *k = CPU_GET_CLASS(cpu);
+
     int64_t cpu_id;

void AcpiCpuHotplug_add(ACPIGPE *gpe, AcpiCpuHotplug *g, CPUState *cpu)

{

    CPUClass *k = CPU_GET_CLASS(cpu);

    int64_t cpu_id;

    *gpe->sts = *gpe->sts | ACPI_CPU_HOTPLUG_STATUS;

    cpu_id = k->get_arch_id(CPU(cpu));

    g->sts[cpu_id / 8] |= (1 << (cpu_id % 8));

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
         } else {

             tmp = (tmp & 0x00ff) | (value << 8);
+
+        }
+
+        m5206_mbar_writew(opaque, offset & ~1, tmp);
+
         return;

     }

static void m5206_mbar_writeb(void *opaque, target_phys_addr_t offset,

                              uint32_t value)

{

    m5206_mbar_state *s = (m5206_mbar_state *)opaque;

    int width;

    offset &= 0x3ff;

    if (offset >= 0x200) {

        hw_error("Bad MBAR write offset 0x%x", (int)offset);

    }

    width = m5206_mbar_width[offset >> 2];

    if (width > 1) {

        uint32_t tmp;

        tmp = m5206_mbar_readw(opaque, offset & ~1);

        if (offset & 1) {

            tmp = (tmp & 0xff00) | value;

        } else {

            tmp = (tmp & 0x00ff) | (value << 8);

        }

        m5206_mbar_writew(opaque, offset & ~1, tmp);

        return;

    }

    m5206_mbar_write(s, offset, value, 1);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static inline void writer_print_string(WriterContext *wctx,

+                                       const char *key, const char *val)
+
 {

     wctx->writer->print_string(wctx, key, val);

static inline void writer_print_string(WriterContext *wctx,

                                       const char *key, const char *val)

{

    wctx->writer->print_string(wctx, key, val);

    wctx->nb_item++;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 DriveInfo *drive_get_by_id(const char *id)

+{
+
+    DriveInfo *dinfo;
+
+

     TAILQ_FOREACH(dinfo, &drives, next) {

DriveInfo *drive_get_by_id(const char *id)

{

    DriveInfo *dinfo;

    TAILQ_FOREACH(dinfo, &drives, next) {

        if (strcmp(id, dinfo->id))

            continue;

        return dinfo;

    }

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -27,11 +27,11 @@
      * that the guest is currently busy-looping. Yield control back to the

      * top level loop so that a more deserving VCPU has a chance to run.
+
+     */
+
+    cs->exception_index = EXCP_YIELD;
+
     cpu_loop_exit(cs);

 }

void HELPER(yield)(CPUARMState *env)

{

    ARMCPU *cpu = arm_env_get_cpu(env);

    CPUState *cs = CPU(cpu);

    /* When running in MTTCG we don't generate jumps to the yield and

     * WFE helpers as it won't affect the scheduling of other vCPUs.

     * If we wanted to more completely model WFE/SEV so we don't busy

     * spin unnecessarily we would need to do something more involved.

     */

    g_assert(!parallel_cpus);

    /* This is a non-trappable hint instruction that generally indicates

     * that the guest is currently busy-looping. Yield control back to the

     * top level loop so that a more deserving VCPU has a chance to run.

     */

    cs->exception_index = EXCP_YIELD;

    cpu_loop_exit(cs);

}


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

     TCGv tmpl;

+    TCGv tmph;
+

     /* Load 64-bit value rd:rn.  */

static void gen_addq(DisasContext *s, TCGv_i64 val, int rlow, int rhigh)

{

    TCGv_i64 tmp;

    TCGv tmpl;

    TCGv tmph;

    /* Load 64-bit value rd:rn.  */

    tmpl = load_reg(s, rlow);

    tmph = load_reg(s, rhigh);

    tmp = tcg_temp_new_i64();

    tcg_gen_concat_i32_i64(tmp, tmpl, tmph);

    dead_tmp(tmpl);

    dead_tmp(tmph);

    tcg_gen_add_i64(val, val, tmp);

    tcg_temp_free_i64(tmp);

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     CPUWatchpoint *wp_hit = cs->watchpoint_hit;

+
+    if (wp_hit && wp_hit->flags & BP_CPU) {
+
+        /* FIXME: When the storage-alteration-space control bit is set,
+
            the exception should only be triggered if the memory access

            is done using an address space with the storage-alteration-event

void s390x_cpu_debug_excp_handler(CPUState *cs)

{

    S390CPU *cpu = S390_CPU(cs);

    CPUS390XState *env = &cpu->env;

    CPUWatchpoint *wp_hit = cs->watchpoint_hit;

    if (wp_hit && wp_hit->flags & BP_CPU) {

        /* FIXME: When the storage-alteration-space control bit is set,

           the exception should only be triggered if the memory access

           is done using an address space with the storage-alteration-event

           bit set.  We have no way to detect that with the current

           watchpoint code.  */

        cs->watchpoint_hit = NULL;

        env->per_address = env->psw.addr;

        env->per_perc_atmid |= PER_CODE_EVENT_STORE | get_per_atmid(env);

        /* FIXME: We currently no way to detect the address space used

           to trigger the watchpoint.  For now just consider it is the

           current default ASC. This turn to be true except when MVCP

           and MVCS instrutions are not used.  */

        env->per_perc_atmid |= env->psw.mask & (PSW_MASK_ASC) >> 46;

        /* Remove all watchpoints to re-execute the code.  A PER exception

           will be triggered, it will call load_psw which will recompute

           the watchpoints.  */

        cpu_watchpoint_remove_all(cs, BP_CPU);

        cpu_resume_from_signal(cs, NULL);

    }

}


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

+    if (avctx->width > 65535 || avctx->height > 65535) {
+
+        av_log(avctx, AV_LOG_ERROR, "GIF does not support resolutions above 65535x65535\n");
+
+        return AVERROR(EINVAL);

     }

static av_cold int gif_encode_init(AVCodecContext *avctx)

{

    GIFContext *s = avctx->priv_data;

    if (avctx->width > 65535 || avctx->height > 65535) {

        av_log(avctx, AV_LOG_ERROR, "GIF does not support resolutions above 65535x65535\n");

        return AVERROR(EINVAL);

    }

#if FF_API_CODED_FRAME

FF_DISABLE_DEPRECATION_WARNINGS

    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;

    avctx->coded_frame->key_frame = 1;

FF_ENABLE_DEPRECATION_WARNINGS

#endif

    s->transparent_index = -1;

    s->lzw = av_mallocz(ff_lzw_encode_state_size);

    s->buf = av_malloc(avctx->width*avctx->height*2);

    s->tmpl = av_malloc(avctx->width);

    if (!s->tmpl || !s->buf || !s->lzw)

        return AVERROR(ENOMEM);

    if (avpriv_set_systematic_pal2(s->palette, avctx->pix_fmt) < 0)

        av_assert0(avctx->pix_fmt == AV_PIX_FMT_PAL8);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -11,7 +11,7 @@
     int x, y;

     pixel        *src       = (pixel*)_src;
+
     ptrdiff_t     srcstride = _srcstride / sizeof(pixel);

     pixel *dst          = (pixel *)_dst;

static void FUNC(put_hevc_qpel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,

                                       int16_t *src2,

                                       int height, int denom, int wx0, int wx1,

                                       int ox0, int ox1, intptr_t mx, intptr_t my, int width)

{

    int x, y;

    pixel        *src       = (pixel*)_src;

    ptrdiff_t     srcstride = _srcstride / sizeof(pixel);

    pixel *dst          = (pixel *)_dst;

    ptrdiff_t dststride = _dststride / sizeof(pixel);

    const int8_t *filter    = ff_hevc_qpel_filters[my - 1];

    int shift = 14 + 1 - BIT_DEPTH;

    int log2Wd = denom + shift - 1;

    ox0     = ox0 * (1 << (BIT_DEPTH - 8));

    ox1     = ox1 * (1 << (BIT_DEPTH - 8));

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

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

            dst[x] = av_clip_pixel(((QPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) * wx1 + src2[x] * wx0 +

                                    ((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1));

        src  += srcstride;

        dst  += dststride;

        src2 += MAX_PB_SIZE;

    }

}


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

 {

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

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

static inline void mix_3f_2r_to_stereo(AC3DecodeContext *ctx)

{

    int i;

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

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

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

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

    }

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

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

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

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void init_proc_750cx (CPUPPCState *env)

 {
+
     gen_spr_ne_601(env);

     gen_spr_7xx(env);

static void init_proc_750cx (CPUPPCState *env)

{

    gen_spr_ne_601(env);

    gen_spr_7xx(env);

    /* XXX : not implemented */

    spr_register(env, SPR_L2CR, "L2CR",

                 SPR_NOACCESS, SPR_NOACCESS,

                 &spr_read_generic, NULL,

                 0x00000000);

    /* Time base */

    gen_tbl(env);

    /* Thermal management */

    gen_spr_thrm(env);

    /* This register is not implemented but is present for compatibility */

    spr_register(env, SPR_SDA, "SDA",

                 SPR_NOACCESS, SPR_NOACCESS,

                 &spr_read_generic, &spr_write_generic,

                 0x00000000);

    /* Hardware implementation registers */

    /* XXX : not implemented */

    spr_register(env, SPR_HID0, "HID0",

                 SPR_NOACCESS, SPR_NOACCESS,

                 &spr_read_generic, &spr_write_generic,

                 0x00000000);

    /* XXX : not implemented */

    spr_register(env, SPR_HID1, "HID1",

                 SPR_NOACCESS, SPR_NOACCESS,

                 &spr_read_generic, &spr_write_generic,

                 0x00000000);

    /* Memory management */

    gen_low_BATs(env);

    /* PowerPC 750cx has 8 DBATs and 8 IBATs */

    gen_high_BATs(env);

    init_excp_750cx(env);

    env->dcache_line_size = 32;

    env->icache_line_size = 32;

    /* Allocate hardware IRQ controller */

    ppc6xx_irq_init(env);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 int do_balloon(Monitor *mon, const QDict *params,

+	       MonitorCompletion cb, void *opaque)
+
+{
+
+    int ret;

int do_balloon(Monitor *mon, const QDict *params,

	       MonitorCompletion cb, void *opaque)

{

    int ret;

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

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

        return -1;

    }

    ret = qemu_balloon(qdict_get_int(params, "value"));

    if (ret == 0) {

        qerror_report(QERR_DEVICE_NOT_ACTIVE, "balloon");

        return -1;

    }

    cb(opaque, NULL);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+void OPPROTO op_movl_npc_T0(void)

 {

void OPPROTO op_movl_npc_T0(void)

{

    env->npc = T0;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     VirtIONet *n = VIRTIO_NET(vdev);

     int i;
+
+
+
+    virtio_net_set_multiqueue(n,
+
                               __virtio_has_feature(features, VIRTIO_NET_F_MQ));

static void virtio_net_set_features(VirtIODevice *vdev, uint64_t features)

{

    VirtIONet *n = VIRTIO_NET(vdev);

    int i;

    virtio_net_set_multiqueue(n,

                              __virtio_has_feature(features, VIRTIO_NET_F_MQ));

    virtio_net_set_mrg_rx_bufs(n,

                               __virtio_has_feature(features,

                                                    VIRTIO_NET_F_MRG_RXBUF),

                               __virtio_has_feature(features,

                                                    VIRTIO_F_VERSION_1));

    if (n->has_vnet_hdr) {

        n->curr_guest_offloads =

            virtio_net_guest_offloads_by_features(features);

        virtio_net_apply_guest_offloads(n);

    }

    for (i = 0;  i < n->max_queues; i++) {

        NetClientState *nc = qemu_get_subqueue(n->nic, i);

        if (!get_vhost_net(nc->peer)) {

            continue;

        }

        vhost_net_ack_features(get_vhost_net(nc->peer), features);

    }

    if (__virtio_has_feature(features, VIRTIO_NET_F_CTRL_VLAN)) {

        memset(n->vlans, 0, MAX_VLAN >> 3);

    } else {

        memset(n->vlans, 0xff, MAX_VLAN >> 3);

    }

}


--- a/source.c
+++ b/source.c
@@ -11,9 +11,9 @@
         subpage_t *subpage = container_of(mr, subpage_t, iomem);

         object_unref(OBJECT(&subpage->iomem));
+
+        g_free(subpage);
+
+    }

 }

static void phys_section_destroy(MemoryRegion *mr)

{

    memory_region_unref(mr);

    if (mr->subpage) {

        subpage_t *subpage = container_of(mr, subpage_t, iomem);

        object_unref(OBJECT(&subpage->iomem));

        g_free(subpage);

    }

}


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

         cpu_to_be16wu((uint16_t *)(data + sloc),

+                      do_cksum(data + css, data + n));
+
+}

putsum(uint8_t *data, uint32_t n, uint32_t sloc, uint32_t css, uint32_t cse)

{

    if (cse && cse < n)

        n = cse + 1;

    if (sloc < n-1)

        cpu_to_be16wu((uint16_t *)(data + sloc),

                      do_cksum(data + css, data + n));

}


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

+    if ((nvram->size < MIN_NVRAM_SIZE) || (nvram->size > MAX_NVRAM_SIZE)) {
+
+        fprintf(stderr, "spapr-nvram must be between %d and %d bytes in size\n",
+
+                MIN_NVRAM_SIZE, MAX_NVRAM_SIZE);

         return -1;

static int spapr_nvram_init(VIOsPAPRDevice *dev)

{

    sPAPRNVRAM *nvram = VIO_SPAPR_NVRAM(dev);

    if (nvram->drive) {

        nvram->size = bdrv_getlength(nvram->drive);

    } else {

        nvram->size = DEFAULT_NVRAM_SIZE;

        nvram->buf = g_malloc0(nvram->size);

    }

    if ((nvram->size < MIN_NVRAM_SIZE) || (nvram->size > MAX_NVRAM_SIZE)) {

        fprintf(stderr, "spapr-nvram must be between %d and %d bytes in size\n",

                MIN_NVRAM_SIZE, MAX_NVRAM_SIZE);

        return -1;

    }

    spapr_rtas_register(RTAS_NVRAM_FETCH, "nvram-fetch", rtas_nvram_fetch);

    spapr_rtas_register(RTAS_NVRAM_STORE, "nvram-store", rtas_nvram_store);

    return 0;

}


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

     const int b_stride= s->b_width << s->block_max_depth;

+    BlockNode *block= &s->block[mb_x + mb_y * b_stride];

     BlockNode backup[4]= {block[0], block[1], block[b_stride], block[b_stride+1]};

static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int ref, int *best_rd){

    const int b_stride= s->b_width << s->block_max_depth;

    BlockNode *block= &s->block[mb_x + mb_y * b_stride];

    BlockNode backup[4]= {block[0], block[1], block[b_stride], block[b_stride+1]};

    int rd, index, value;

    assert(mb_x>=0 && mb_y>=0);

    assert(mb_x<b_stride);

    assert(((mb_x|mb_y)&1) == 0);

    index= (p0 + 31*p1) & (ME_CACHE_SIZE-1);

    value= s->me_cache_generation + (p0>>10) + (p1<<6) + (block->ref<<12);

    if(s->me_cache[index] == value)

        return 0;

    s->me_cache[index]= value;

    block->mx= p0;

    block->my= p1;

    block->ref= ref;

    block->type &= ~BLOCK_INTRA;

    block[1]= block[b_stride]= block[b_stride+1]= *block;

    rd= get_4block_rd(s, mb_x, mb_y, 0);

//FIXME chroma

    if(rd < *best_rd){

        *best_rd= rd;

        return 1;

    }else{

        block[0]= backup[0];

        block[1]= backup[1];

        block[b_stride]= backup[2];

        block[b_stride+1]= backup[3];

        return 0;

    }

}


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

     unsupported_encoding(s, insn);
+
 }

static void disas_fp_2src(DisasContext *s, uint32_t insn)

{

    unsupported_encoding(s, insn);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int fifo_put(SerialState *s, int fifo, uint8_t chr)

+{
+
+    SerialFIFO *f = (fifo) ? &s->recv_fifo : &s->xmit_fifo;

static int fifo_put(SerialState *s, int fifo, uint8_t chr)

{

    SerialFIFO *f = (fifo) ? &s->recv_fifo : &s->xmit_fifo;

    f->data[f->head++] = chr;

    if (f->head == UART_FIFO_LENGTH)

        f->head = 0;

    f->count++;

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void access_with_adjusted_size(hwaddr addr,

                                       uint64_t *value,

@@ -12,11 +12,11 @@

                                                      hwaddr addr,

+                                                     uint64_t *value,

                                                      unsigned size,

+                                                     unsigned shift,

                                                      uint64_t mask),

static void access_with_adjusted_size(hwaddr addr,

                                      uint64_t *value,

                                      unsigned size,

                                      unsigned access_size_min,

                                      unsigned access_size_max,

                                      void (*access)(MemoryRegion *mr,

                                                     hwaddr addr,

                                                     uint64_t *value,

                                                     unsigned size,

                                                     unsigned shift,

                                                     uint64_t mask),

                                      MemoryRegion *mr)

{

    uint64_t access_mask;

    unsigned access_size;

    unsigned i;

    if (!access_size_min) {

        access_size_min = 1;

    }

    if (!access_size_max) {

        access_size_max = 4;

    }

    /* FIXME: support unaligned access? */

    access_size = MAX(MIN(size, access_size_max), access_size_min);

    access_mask = -1ULL >> (64 - access_size * 8);

    if (memory_region_big_endian(mr)) {

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

            access(mr, addr + i, value, access_size,

                   (size - access_size - i) * 8, access_mask);

        }

    } else {

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

            access(mr, addr + i, value, access_size, i * 8, access_mask);

        }

    }

}


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

     g_free(vs->display);

+    vs->display = NULL;
+
+    if (vs->lsock != -1) {
+
+        qemu_set_fd_handler2(vs->lsock, NULL, NULL, NULL, NULL);

         close(vs->lsock);

static void vnc_display_close(VncDisplay *vs)

{

    if (!vs)

        return;

    g_free(vs->display);

    vs->display = NULL;

    if (vs->lsock != -1) {

        qemu_set_fd_handler2(vs->lsock, NULL, NULL, NULL, NULL);

        close(vs->lsock);

        vs->lsock = -1;

    }

#ifdef CONFIG_VNC_WS

    g_free(vs->ws_display);

    vs->ws_display = NULL;

    if (vs->lwebsock != -1) {

        qemu_set_fd_handler2(vs->lwebsock, NULL, NULL, NULL, NULL);

        close(vs->lwebsock);

        vs->lwebsock = -1;

    }

#endif /* CONFIG_VNC_WS */

    vs->auth = VNC_AUTH_INVALID;

#ifdef CONFIG_VNC_TLS

    vs->subauth = VNC_AUTH_INVALID;

    vs->tls.x509verify = 0;

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
+static inline void cvtyuvtoRGB (SwsContext *c,
+
+			   vector signed short Y, vector signed short U, vector signed short V,
+
+			   vector signed short *R, vector signed short *G, vector signed short *B)
+
+{
+
+  vector signed   short vx,ux,uvx;
+
+

   Y = vec_mradds (Y, c->CY, c->OY);

static inline void cvtyuvtoRGB (SwsContext *c,

			   vector signed short Y, vector signed short U, vector signed short V,

			   vector signed short *R, vector signed short *G, vector signed short *B)

{

  vector signed   short vx,ux,uvx;

  Y = vec_mradds (Y, c->CY, c->OY);

  U  = vec_sub (U,(vector signed short)

  			vec_splat((vector signed short)AVV(128),0));

  V  = vec_sub (V,(vector signed short)

  			vec_splat((vector signed short)AVV(128),0));

  //   ux  = (CBU*(u<<c->CSHIFT)+0x4000)>>15;

  ux = vec_sl (U, c->CSHIFT);

  *B = vec_mradds (ux, c->CBU, Y);

  // vx  = (CRV*(v<<c->CSHIFT)+0x4000)>>15;

  vx = vec_sl (V, c->CSHIFT);

  *R = vec_mradds (vx, c->CRV, Y);

  // uvx = ((CGU*u) + (CGV*v))>>15;

  uvx = vec_mradds (U, c->CGU, Y);

  *G = vec_mradds (V, c->CGV, uvx);

}


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

     uint8_t *config;

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

     config = qemu_malloc(size);

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

{

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

    uint8_t *config;

    int i;

    assert(size == pci_config_size(s));

    config = qemu_malloc(size);

    qemu_get_buffer(f, config, size);

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

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

            qemu_free(config);

            return -EINVAL;

        }

    }

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

    pci_update_mappings(s);

    qemu_free(config);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
     case 0x14:	/* EMIFS_CS1_CONFIG */

     case 0x18:	/* EMIFS_CS2_CONFIG */
+
+    case 0x1c:	/* EMIFS_CS3_CONFIG */
+
+    case 0x24:	/* EMIFF_MRS */
+
     case 0x28:	/* TIMEOUT1 */

     case 0x2c:	/* TIMEOUT2 */

static uint64_t omap_tcmi_read(void *opaque, target_phys_addr_t addr,

                               unsigned size)

{

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

    uint32_t ret;

    if (size != 4) {

        return omap_badwidth_read32(opaque, addr);

    }

    switch (addr) {

    case 0x00:	/* IMIF_PRIO */

    case 0x04:	/* EMIFS_PRIO */

    case 0x08:	/* EMIFF_PRIO */

    case 0x0c:	/* EMIFS_CONFIG */

    case 0x10:	/* EMIFS_CS0_CONFIG */

    case 0x14:	/* EMIFS_CS1_CONFIG */

    case 0x18:	/* EMIFS_CS2_CONFIG */

    case 0x1c:	/* EMIFS_CS3_CONFIG */

    case 0x24:	/* EMIFF_MRS */

    case 0x28:	/* TIMEOUT1 */

    case 0x2c:	/* TIMEOUT2 */

    case 0x30:	/* TIMEOUT3 */

    case 0x3c:	/* EMIFF_SDRAM_CONFIG_2 */

    case 0x40:	/* EMIFS_CFG_DYN_WAIT */

        return s->tcmi_regs[addr >> 2];

    case 0x20:	/* EMIFF_SDRAM_CONFIG */

        ret = s->tcmi_regs[addr >> 2];

        s->tcmi_regs[addr >> 2] &= ~1; /* XXX: Clear SLRF on SDRAM access */

        /* XXX: We can try using the VGA_DIRTY flag for this */

        return ret;

    }

    OMAP_BAD_REG(addr);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void flash_sync_page(Flash *s, int page)
+
 {

     QEMUIOVector *iov = g_new(QEMUIOVector, 1);

static void flash_sync_page(Flash *s, int page)

{

    QEMUIOVector *iov = g_new(QEMUIOVector, 1);

    if (!s->blk || blk_is_read_only(s->blk)) {

        return;

    }

    qemu_iovec_init(iov, 1);

    qemu_iovec_add(iov, s->storage + page * s->pi->page_size,

                   s->pi->page_size);

    blk_aio_pwritev(s->blk, page * s->pi->page_size, iov, 0,

                    blk_sync_complete, iov);

}


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

     while (len > 0) {

+        ret = qemu_chr_fe_write(scon->chr, buf, len);
+
+        if (ret == 0) {
+
+            /* a pty doesn't seem to be connected - no error */

             len = 0;

static int write_console_data(SCLPEvent *event, const uint8_t *buf, int len)

{

    int ret = 0;

    const uint8_t *buf_offset;

    SCLPConsoleLM *scon = SCLPLM_CONSOLE(event);

    if (!scon->chr) {

        /* If there's no backend, we can just say we consumed all data. */

        return len;

    }

    buf_offset = buf;

    while (len > 0) {

        ret = qemu_chr_fe_write(scon->chr, buf, len);

        if (ret == 0) {

            /* a pty doesn't seem to be connected - no error */

            len = 0;

        } else if (ret == -EAGAIN || (ret > 0 && ret < len)) {

            len -= ret;

            buf_offset += ret;

        } else {

            len = 0;

        }

    }

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -55,11 +55,11 @@
     VNC_DEBUG("Handshake done, switching to TLS data mode\n");

     qemu_set_fd_handler2(vs->csock, NULL, vnc_client_read, vnc_client_write, vs);
+
+
+
+    start_auth_vencrypt_subauth(vs);
+

     return 0;

static int vnc_start_vencrypt_handshake(struct 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_handler2(vs->csock, NULL, vnc_client_read, vnc_client_write, vs);

    start_auth_vencrypt_subauth(vs);

    return 0;

}


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

     pci_mem_config = cpu_register_io_memory(pci_unin_config_read,

+                                            pci_unin_config_write, s);
+
+    pci_mem_data = cpu_register_io_memory(pci_unin_read,
+
+                                          pci_unin_write, s);

     sysbus_init_mmio(dev, 0x1000, pci_mem_config);

static int pci_unin_internal_init_device(SysBusDevice *dev)

{

    UNINState *s;

    int pci_mem_config, pci_mem_data;

    /* Uninorth internal bus */

    s = FROM_SYSBUS(UNINState, dev);

    pci_mem_config = cpu_register_io_memory(pci_unin_config_read,

                                            pci_unin_config_write, s);

    pci_mem_data = cpu_register_io_memory(pci_unin_read,

                                          pci_unin_write, s);

    sysbus_init_mmio(dev, 0x1000, pci_mem_config);

    sysbus_init_mmio(dev, 0x1000, pci_mem_data);

    return 0;

}


static void conv411(uint8_t *dst, int dst_wrap,
                    uint8_t *src, int src_wrap,
                    int width, int height)
{
    int w, c;
    uint8_t *s1, *s2, *d;
    for(;height > 0; height--) {
        s1 = src;
        s2 = src + src_wrap;
        d = dst;
        for(w = width;w > 0; w--) {
            c = (s1[0] + s2[0]) >> 1;
            d[0] = c;
            d[1] = c;
            s1++;
            s2++;
            d += 2;
        }
        src += src_wrap * 2;
        dst += dst_wrap;
    }
}


static int spapr_check_htab_fd(sPAPRMachineState *spapr)

{

    int rc = 0;

    if (spapr->htab_fd_stale) {

        close(spapr->htab_fd);

        spapr->htab_fd = kvmppc_get_htab_fd(false);

        if (spapr->htab_fd < 0) {

            error_report("Unable to open fd for reading hash table from KVM: "

                         "%s", strerror(errno));

            rc = -1;

        }

        spapr->htab_fd_stale = false;

    }

    return rc;

}


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

+    ret = entry->value;
+
+
+
+    return ret;

 }

QObject *qlist_peek(QList *qlist)

{

    QListEntry *entry;

    QObject *ret;

    if (qlist == NULL || QTAILQ_EMPTY(&qlist->head)) {

        return NULL;

    }

    entry = QTAILQ_FIRST(&qlist->head);

    ret = entry->value;

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
     fdsp->vector_dmul_scalar(odst, v1, scale, LEN);

+
+    if (ret = compare_doubles(cdst, odst, LEN, DBL_EPSILON))
+
+        av_log(NULL, AV_LOG_ERROR, "vector_dmul_scalar failed\n");
+

     return ret;

static int test_vector_dmul_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,

                                   const double *v1, double scale)

{

    LOCAL_ALIGNED(32, double, cdst, [LEN]);

    LOCAL_ALIGNED(32, double, odst, [LEN]);

    int ret;

    cdsp->vector_dmul_scalar(cdst, v1, scale, LEN);

    fdsp->vector_dmul_scalar(odst, v1, scale, LEN);

    if (ret = compare_doubles(cdst, odst, LEN, DBL_EPSILON))

        av_log(NULL, AV_LOG_ERROR, "vector_dmul_scalar failed\n");

    return ret;

}


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

 {

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

                                ptrdiff_t stride)

{

    avc_luma_hz_qrt_4w_msa(src - 2, stride, dst, stride, 4, 1);

}


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

 {

+    if (!rom_enable_driver_roms)
+
         return 0;

     return rom_add_file(file, "vgaroms", file, 0);

int rom_add_vga(const char *file)

{

    if (!rom_enable_driver_roms)

        return 0;

    return rom_add_file(file, "vgaroms", file, 0);

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
                       const uint16_t *abuf1, uint8_t *dest, int dstW,

                       int yalpha, int uvalpha, int y,
+
+                      enum PixelFormat target)
+
+{
+
     const uint8_t * const d128 = dither_8x8_220[y & 7];

     uint8_t *g = c->table_gU[128] + c->table_gV[128];

yuv2mono_2_c_template(SwsContext *c, const uint16_t *buf0,

                      const uint16_t *buf1, const uint16_t *ubuf0,

                      const uint16_t *ubuf1, const uint16_t *vbuf0,

                      const uint16_t *vbuf1, const uint16_t *abuf0,

                      const uint16_t *abuf1, uint8_t *dest, int dstW,

                      int yalpha, int uvalpha, int y,

                      enum PixelFormat target)

{

    const uint8_t * const d128 = dither_8x8_220[y & 7];

    uint8_t *g = c->table_gU[128] + c->table_gV[128];

    int  yalpha1 = 4095 - yalpha;

    int i;

    for (i = 0; i < dstW - 7; i += 8) {

        int acc =    g[((buf0[i    ] * yalpha1 + buf1[i    ] * yalpha) >> 19) + d128[0]];

        acc += acc + g[((buf0[i + 1] * yalpha1 + buf1[i + 1] * yalpha) >> 19) + d128[1]];

        acc += acc + g[((buf0[i + 2] * yalpha1 + buf1[i + 2] * yalpha) >> 19) + d128[2]];

        acc += acc + g[((buf0[i + 3] * yalpha1 + buf1[i + 3] * yalpha) >> 19) + d128[3]];

        acc += acc + g[((buf0[i + 4] * yalpha1 + buf1[i + 4] * yalpha) >> 19) + d128[4]];

        acc += acc + g[((buf0[i + 5] * yalpha1 + buf1[i + 5] * yalpha) >> 19) + d128[5]];

        acc += acc + g[((buf0[i + 6] * yalpha1 + buf1[i + 6] * yalpha) >> 19) + d128[6]];

        acc += acc + g[((buf0[i + 7] * yalpha1 + buf1[i + 7] * yalpha) >> 19) + d128[7]];

        output_pixel(*dest++, acc);

    }

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     const uint32_t broadcast_addr =

         ~slirp->vnetwork_mask.s_addr | slirp->vnetwork_addr.s_addr;
+
     ArpTable *arptbl = &slirp->arp_table;

     int i;

void arp_table_add(Slirp *slirp, uint32_t ip_addr, uint8_t ethaddr[ETH_ALEN])

{

    const uint32_t broadcast_addr =

        ~slirp->vnetwork_mask.s_addr | slirp->vnetwork_addr.s_addr;

    ArpTable *arptbl = &slirp->arp_table;

    int i;

    DEBUG_CALL("arp_table_add");

    DEBUG_ARG("ip = 0x%x", ip_addr);

    DEBUG_ARGS((dfd, " hw addr = %02x:%02x:%02x:%02x:%02x:%02x\n",

                ethaddr[0], ethaddr[1], ethaddr[2],

                ethaddr[3], ethaddr[4], ethaddr[5]));

    /* Check 0.0.0.0/8 invalid source-only addresses */

    assert((ip_addr & htonl(~(0xf << 28))) != 0);

    if (ip_addr == 0xffffffff || ip_addr == broadcast_addr) {

        /* Do not register broadcast addresses */

        return;

    }

    /* Search for an entry */

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

        if (arptbl->table[i].ar_sip == ip_addr) {

            /* Update the entry */

            memcpy(arptbl->table[i].ar_sha, ethaddr, ETH_ALEN);

            return;

        }

    }

    /* No entry found, create a new one */

    arptbl->table[arptbl->next_victim].ar_sip = ip_addr;

    memcpy(arptbl->table[arptbl->next_victim].ar_sha,  ethaddr, ETH_ALEN);

    arptbl->next_victim = (arptbl->next_victim + 1) % ARP_TABLE_SIZE;

}


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

+
     for (i = 0; i < ctx->nb_outputs; i++) {

         av_freep(&ctx->output_pads[i].name);

static av_cold void movie_uninit(AVFilterContext *ctx)

{

    MovieContext *movie = ctx->priv;

    int i;

    for (i = 0; i < ctx->nb_outputs; i++) {

        av_freep(&ctx->output_pads[i].name);

        if (movie->st[i].st)

            avcodec_close(movie->st[i].st->codec);

    }

    av_freep(&movie->st);

    av_freep(&movie->out_index);

    av_frame_free(&movie->frame);

    if (movie->format_ctx)

        avformat_close_input(&movie->format_ctx);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 AioContext *bdrv_get_aio_context(BlockDriverState *bs)
+
+{

     /* Currently BlockDriverState always uses the main loop AioContext */

AioContext *bdrv_get_aio_context(BlockDriverState *bs)

{

    /* Currently BlockDriverState always uses the main loop AioContext */

    return qemu_get_aio_context();

}


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

                                  NBDRequest *request,

+                                 NBDReply *reply,

                                  QEMUIOVector *qiov)

static void nbd_co_receive_reply(NBDClientSession *s,

                                 NBDRequest *request,

                                 NBDReply *reply,

                                 QEMUIOVector *qiov)

{

    int ret;

    /* Wait until we're woken up by nbd_read_reply_entry.  */

    qemu_coroutine_yield();

    *reply = s->reply;

    if (reply->handle != request->handle ||

        !s->ioc) {

        reply->error = EIO;

    } else {

        if (qiov && reply->error == 0) {

            ret = nbd_rwv(s->ioc, qiov->iov, qiov->niov, request->len, true,

                          NULL);

            if (ret != request->len) {

                reply->error = EIO;

            }

        }

        /* Tell the read handler to read another header.  */

        s->reply.handle = 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void vp8_h_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, int flim)
+
+{
+
     int i;

static void vp8_h_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, int flim)

{

    int i;

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

        if (simple_limit(dst + i * stride, 1, flim))

            filter_common(dst + i * stride, 1, 1);

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+static void adb_kbd_reset(DeviceState *dev)
+
+{
+
+    ADBDevice *d = ADB_DEVICE(dev);
+
+    KBDState *s = ADB_KEYBOARD(dev);
+
+

     d->handler = 1;

static void adb_kbd_reset(DeviceState *dev)

{

    ADBDevice *d = ADB_DEVICE(dev);

    KBDState *s = ADB_KEYBOARD(dev);

    d->handler = 1;

    d->devaddr = ADB_DEVID_KEYBOARD;

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

    s->rptr = 0;

    s->wptr = 0;

    s->count = 0;

}


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

 {

+    bool progress;
+
+
+
     progress = aio_bh_poll(ctx);

     progress |= aio_dispatch_handlers(ctx, INVALID_HANDLE_VALUE);

bool aio_dispatch(AioContext *ctx)

{

    bool progress;

    progress = aio_bh_poll(ctx);

    progress |= aio_dispatch_handlers(ctx, INVALID_HANDLE_VALUE);

    progress |= timerlistgroup_run_timers(&ctx->tlg);

    return progress;

}


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

         .has_format = has_format,

+        .format = (char *) format,
+
+        .has_mode = has_mode,
+
+        .mode = mode,

     };

void qmp_blockdev_snapshot_sync(bool has_device, const char *device,

                                bool has_node_name, const char *node_name,

                                const char *snapshot_file,

                                bool has_snapshot_node_name,

                                const char *snapshot_node_name,

                                bool has_format, const char *format,

                                bool has_mode, NewImageMode mode, Error **errp)

{

    BlockdevSnapshotSync snapshot = {

        .has_device = has_device,

        .device = (char *) device,

        .has_node_name = has_node_name,

        .node_name = (char *) node_name,

        .snapshot_file = (char *) snapshot_file,

        .has_snapshot_node_name = has_snapshot_node_name,

        .snapshot_node_name = (char *) snapshot_node_name,

        .has_format = has_format,

        .format = (char *) format,

        .has_mode = has_mode,

        .mode = mode,

    };

    TransactionAction action = {

        .type = TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT_SYNC,

        .u.blockdev_snapshot_sync = &snapshot,

    };

    blockdev_do_action(&action, errp);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline void check_privileged(DisasContext *s)

 {

static inline void check_privileged(DisasContext *s)

{

    if (s->tb->flags & (PSW_MASK_PSTATE >> 32)) {

        gen_program_exception(s, PGM_PRIVILEGED);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int rso_read_packet(AVFormatContext *s, AVPacket *pkt)

+{
+
+    int bps = av_get_bits_per_sample(s->streams[0]->codec->codec_id);
+
+    int ret = av_get_packet(s->pb, pkt, BLOCK_SIZE * bps >> 3);

static int rso_read_packet(AVFormatContext *s, AVPacket *pkt)

{

    int bps = av_get_bits_per_sample(s->streams[0]->codec->codec_id);

    int ret = av_get_packet(s->pb, pkt, BLOCK_SIZE * bps >> 3);

    if (ret < 0)

        return ret;

    pkt->stream_index = 0;

    /* note: we need to modify the packet size here to handle the last packet */

    pkt->size = ret;

    return 0;

}


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

         if (s->tile[tileno].comp) {

+            for (compno = 0; compno < s->ncomponents; compno++) {
+
+                Jpeg2000Component *comp     = s->tile[tileno].comp   + compno;
+
+                Jpeg2000CodingStyle *codsty = s->tile[tileno].codsty + compno;

static void jpeg2000_dec_cleanup(Jpeg2000DecoderContext *s)

{

    int tileno, compno;

    for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++) {

        if (s->tile[tileno].comp) {

            for (compno = 0; compno < s->ncomponents; compno++) {

                Jpeg2000Component *comp     = s->tile[tileno].comp   + compno;

                Jpeg2000CodingStyle *codsty = s->tile[tileno].codsty + compno;

                ff_jpeg2000_cleanup(comp, codsty);

            }

            av_freep(&s->tile[tileno].comp);

        }

    }

    av_freep(&s->tile);

    s->numXtiles = s->numYtiles = 0;

}


--- a/source.c
+++ b/source.c
@@ -29,11 +29,11 @@
                 SDHC_DATA_INHIBIT | SDHC_DAT_LINE_ACTIVE);

         s->blkgap &= ~(SDHC_STOP_AT_GAP_REQ | SDHC_CONTINUE_REQ);
+
+        s->stopped_state = sdhc_not_stopped;
+
+        s->norintsts &= ~(SDHC_NIS_WBUFRDY | SDHC_NIS_RBUFRDY |
+
                 SDHC_NIS_DMA | SDHC_NIS_TRSCMP | SDHC_NIS_BLKGAP);

         break;

static inline void sdhci_reset_write(SDHCIState *s, uint8_t value)

{

    switch (value) {

    case SDHC_RESET_ALL:

        DEVICE_GET_CLASS(s)->reset(DEVICE(s));

        break;

    case SDHC_RESET_CMD:

        s->prnsts &= ~SDHC_CMD_INHIBIT;

        s->norintsts &= ~SDHC_NIS_CMDCMP;

        break;

    case SDHC_RESET_DATA:

        s->data_count = 0;

        s->prnsts &= ~(SDHC_SPACE_AVAILABLE | SDHC_DATA_AVAILABLE |

                SDHC_DOING_READ | SDHC_DOING_WRITE |

                SDHC_DATA_INHIBIT | SDHC_DAT_LINE_ACTIVE);

        s->blkgap &= ~(SDHC_STOP_AT_GAP_REQ | SDHC_CONTINUE_REQ);

        s->stopped_state = sdhc_not_stopped;

        s->norintsts &= ~(SDHC_NIS_WBUFRDY | SDHC_NIS_RBUFRDY |

                SDHC_NIS_DMA | SDHC_NIS_TRSCMP | SDHC_NIS_BLKGAP);

        break;

    }

}


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

+
+    crypto = qcrypto_block_create(create_opts,
+
+                                  block_crypto_init_func,
+
                                   block_crypto_write_func,

                                   &data,

static int block_crypto_create_generic(QCryptoBlockFormat format,

                                       const char *filename,

                                       QemuOpts *opts,

                                       Error **errp)

{

    int ret = -EINVAL;

    QCryptoBlockCreateOptions *create_opts = NULL;

    QCryptoBlock *crypto = NULL;

    struct BlockCryptoCreateData data = {

        .size = ROUND_UP(qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0),

                         BDRV_SECTOR_SIZE),

        .opts = opts,

        .filename = filename,

    };

    create_opts = block_crypto_create_opts_init(format, opts, errp);

    if (!create_opts) {

        return -1;

    }

    crypto = qcrypto_block_create(create_opts,

                                  block_crypto_init_func,

                                  block_crypto_write_func,

                                  &data,

                                  errp);

    if (!crypto) {

        ret = -EIO;

        goto cleanup;

    }

    ret = 0;

 cleanup:

    qcrypto_block_free(crypto);

    blk_unref(data.blk);

    qapi_free_QCryptoBlockCreateOptions(create_opts);

    return ret;

}


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

 #ifdef DEBUG
+
+    int ii;
+

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

static void h264_free_context(PayloadContext *data)

{

#ifdef DEBUG

    int ii;

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

        if (data->packet_types_received[ii])

            av_log(NULL, AV_LOG_DEBUG, "Received %d packets of type %d\n",

                   data->packet_types_received[ii], ii);

    }

#endif

    assert(data);

    assert(data->cookie == MAGIC_COOKIE);

    // avoid stale pointers (assert)

    data->cookie = DEAD_COOKIE;

    // and clear out this...

    av_free(data);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void pred8x8_left_dc_rv40_c(uint8_t *src, int stride){

+    int i;

     int dc0;

static void pred8x8_left_dc_rv40_c(uint8_t *src, int stride){

    int i;

    int dc0;

    dc0=0;

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

        dc0+= src[-1+i*stride];

    dc0= 0x01010101*((dc0 + 4)>>3);

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

        ((uint32_t*)(src+i*stride))[0]=

        ((uint32_t*)(src+i*stride))[1]= dc0;

    }

}


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

+    if (r->req.io_canceled) {
+
+        scsi_req_cancel_complete(&r->req);
+
+        goto done;

     }

static void scsi_do_read(SCSIDiskReq *r, int ret)

{

    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);

    SCSIDiskClass *sdc = (SCSIDiskClass *) object_get_class(OBJECT(s));

    assert (r->req.aiocb == NULL);

    if (r->req.io_canceled) {

        scsi_req_cancel_complete(&r->req);

        goto done;

    }

    if (ret < 0) {

        if (scsi_handle_rw_error(r, -ret, false)) {

            goto done;

        }

    }

    /* The request is used as the AIO opaque value, so add a ref.  */

    scsi_req_ref(&r->req);

    if (r->req.sg) {

        dma_acct_start(s->qdev.conf.blk, &r->acct, r->req.sg, BLOCK_ACCT_READ);

        r->req.resid -= r->req.sg->size;

        r->req.aiocb = dma_blk_io(blk_get_aio_context(s->qdev.conf.blk),

                                  r->req.sg, r->sector << BDRV_SECTOR_BITS,

                                  sdc->dma_readv, r, scsi_dma_complete, r,

                                  DMA_DIRECTION_FROM_DEVICE);

    } else {

        scsi_init_iovec(r, SCSI_DMA_BUF_SIZE);

        block_acct_start(blk_get_stats(s->qdev.conf.blk), &r->acct,

                         r->qiov.size, BLOCK_ACCT_READ);

        r->req.aiocb = sdc->dma_readv(r->sector, &r->qiov,

                                      scsi_read_complete, r, r);

    }

done:

    scsi_req_unref(&r->req);

}


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

     const char *endptr = &f;

+    unsigned long res = 999;
+
+    int err;
+
+

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

static void test_qemu_strtoul_max(void)

{

    char *str = g_strdup_printf("%lu", ULONG_MAX);

    char f = 'X';

    const char *endptr = &f;

    unsigned long res = 999;

    int err;

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

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, ULONG_MAX);

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

    g_free(str);

}


static void kvm_do_inject_x86_mce(void *_data)

{

    struct kvm_x86_mce_data *data = _data;

    int r;

    /* If there is an MCE exception being processed, ignore this SRAO MCE */

    if ((data->env->mcg_cap & MCG_SER_P) &&

        !(data->mce->status & MCI_STATUS_AR)) {

        r = kvm_mce_in_exception(data->env);

        if (r == -1) {

            fprintf(stderr, "Failed to get MCE status\n");

        } else if (r) {

            return;

        }

    }

    r = kvm_set_mce(data->env, data->mce);

    if (r < 0) {

        perror("kvm_set_mce FAILED");

        if (data->abort_on_error) {

            abort();

        }

    }

}


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

+{

+    DeviceClass *dc = DEVICE_CLASS(klass);

     sPAPRPHBClass *spc = SPAPR_PCI_HOST_BRIDGE_CLASS(klass);

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    sPAPRPHBClass *spc = SPAPR_PCI_HOST_BRIDGE_CLASS(klass);

    dc->props = spapr_phb_vfio_properties;

    spc->finish_realize = spapr_phb_vfio_finish_realize;

}


--- a/source.c
+++ b/source.c
@@ -59,11 +59,11 @@
             if (bs0->drv && bs0->backing_hd) {
                 bs0 = bs0->backing_hd;
                 (*p_image_info)->has_backing_image = true;
+                p_image_info = &((*p_image_info)->backing_image);
+            } else {
+                break;
+            }
+        }
     }
     *p_info = info;
     return;

void bdrv_query_info(BlockDriverState *bs,
                     BlockInfo **p_info,
                     Error **errp)
{
    BlockInfo *info = g_malloc0(sizeof(*info));
    BlockDriverState *bs0;
    ImageInfo **p_image_info;
    Error *local_err = NULL;
    info->device = g_strdup(bs->device_name);
    info->type = g_strdup("unknown");
    info->locked = bdrv_dev_is_medium_locked(bs);
    info->removable = bdrv_dev_has_removable_media(bs);
    if (bdrv_dev_has_removable_media(bs)) {
        info->has_tray_open = true;
        info->tray_open = bdrv_dev_is_tray_open(bs);
    }
    if (bdrv_iostatus_is_enabled(bs)) {
        info->has_io_status = true;
        info->io_status = bs->iostatus;
    }
    if (bs->dirty_bitmap) {
        info->has_dirty = true;
        info->dirty = g_malloc0(sizeof(*info->dirty));
        info->dirty->count = bdrv_get_dirty_count(bs) * BDRV_SECTOR_SIZE;
        info->dirty->granularity =
         ((int64_t) BDRV_SECTOR_SIZE << hbitmap_granularity(bs->dirty_bitmap));
    }
    if (bs->drv) {
        info->has_inserted = true;
        info->inserted = g_malloc0(sizeof(*info->inserted));
        info->inserted->file = g_strdup(bs->filename);
        info->inserted->ro = bs->read_only;
        info->inserted->drv = g_strdup(bs->drv->format_name);
        info->inserted->encrypted = bs->encrypted;
        info->inserted->encryption_key_missing = bdrv_key_required(bs);
        if (bs->backing_file[0]) {
            info->inserted->has_backing_file = true;
            info->inserted->backing_file = g_strdup(bs->backing_file);
        }
        info->inserted->backing_file_depth = bdrv_get_backing_file_depth(bs);
        if (bs->io_limits_enabled) {
            ThrottleConfig cfg;
            throttle_get_config(&bs->throttle_state, &cfg);
            info->inserted->bps     = cfg.buckets[THROTTLE_BPS_TOTAL].avg;
            info->inserted->bps_rd  = cfg.buckets[THROTTLE_BPS_READ].avg;
            info->inserted->bps_wr  = cfg.buckets[THROTTLE_BPS_WRITE].avg;
            info->inserted->iops    = cfg.buckets[THROTTLE_OPS_TOTAL].avg;
            info->inserted->iops_rd = cfg.buckets[THROTTLE_OPS_READ].avg;
            info->inserted->iops_wr = cfg.buckets[THROTTLE_OPS_WRITE].avg;
        }
        bs0 = bs;
        p_image_info = &info->inserted->image;
        while (1) {
            bdrv_query_image_info(bs0, p_image_info, &local_err);
            if (error_is_set(&local_err)) {
                error_propagate(errp, local_err);
                goto err;
            }
            if (bs0->drv && bs0->backing_hd) {
                bs0 = bs0->backing_hd;
                (*p_image_info)->has_backing_image = true;
                p_image_info = &((*p_image_info)->backing_image);
            } else {
                break;
            }
        }
    }
    *p_info = info;
    return;
 err:
    qapi_free_BlockInfo(info);
}