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

 {

+    UserDefTwo *udp = NULL;
+
+    Visitor *v;
+
+

     v = visitor_input_test_init(data, "{ 'string0': 'string0', "

static void test_visitor_in_struct_nested(TestInputVisitorData *data,

                                          const void *unused)

{

    UserDefTwo *udp = NULL;

    Visitor *v;

    v = visitor_input_test_init(data, "{ 'string0': 'string0', "

                                "'dict1': { 'string1': 'string1', "

                                "'dict2': { 'userdef': { 'integer': 42, "

                                "'string': 'string' }, 'string': 'string2'}}}");

    visit_type_UserDefTwo(v, NULL, &udp, &error_abort);

    g_assert_cmpstr(udp->string0, ==, "string0");

    g_assert_cmpstr(udp->dict1->string1, ==, "string1");

    g_assert_cmpint(udp->dict1->dict2->userdef->integer, ==, 42);

    g_assert_cmpstr(udp->dict1->dict2->userdef->string, ==, "string");

    g_assert_cmpstr(udp->dict1->dict2->string, ==, "string2");

    g_assert(udp->dict1->has_dict3 == false);

    qapi_free_UserDefTwo(udp);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 int ffurl_get_short_seek(URLContext *h)

+{
+
     if (!h->prot->url_get_short_seek)

         return AVERROR(ENOSYS);

int ffurl_get_short_seek(URLContext *h)

{

    if (!h->prot->url_get_short_seek)

        return AVERROR(ENOSYS);

    return h->prot->url_get_short_seek(h);

}


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

+                                ptrdiff_t stride)
+
 {

     avc_luma_midv_qrt_4w_msa(src - (2 * stride) - 2, stride, dst, stride, 4, 1);

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

                                ptrdiff_t stride)

{

    avc_luma_midv_qrt_4w_msa(src - (2 * stride) - 2, stride, dst, stride, 4, 1);

}


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

+
+    for (multiple8_cnt = 4; multiple8_cnt--;) {
+
+        avc_luma_midh_qrt_4w_msa(src, src_stride, dst, dst_stride, height,
+
                                  horiz_offset);

static void avc_luma_midh_qrt_16w_msa(const uint8_t *src, int32_t src_stride,

                                      uint8_t *dst, int32_t dst_stride,

                                      int32_t height, uint8_t horiz_offset)

{

    uint32_t multiple8_cnt;

    for (multiple8_cnt = 4; multiple8_cnt--;) {

        avc_luma_midh_qrt_4w_msa(src, src_stride, dst, dst_stride, height,

                                 horiz_offset);

        src += 4;

        dst += 4;

    }

}


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

     GMainLoop *loop;

static void *thread_function(void *data)

{

    GMainLoop *loop;

    loop = g_main_loop_new(NULL, FALSE);

    g_main_loop_run(loop);

    return NULL;

}


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

     injected = false;

+    s->new_state = s->state;
+
+    QLIST_FOREACH(rule, &s->rules[event], next) {
+
+        injected = process_rule(bs, rule, injected);

     }

static void blkdebug_debug_event(BlockDriverState *bs, BlkDebugEvent event)

{

    BDRVBlkdebugState *s = bs->opaque;

    struct BlkdebugRule *rule;

    bool injected;

    assert((int)event >= 0 && event < BLKDBG_EVENT_MAX);

    injected = false;

    s->new_state = s->state;

    QLIST_FOREACH(rule, &s->rules[event], next) {

        injected = process_rule(bs, rule, injected);

    }

    s->state = s->new_state;

}


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

         return -VTD_FR_IR_IRTE_RSVD;

+    }
+
+
+
+    /*

      * TODO: Check Source-ID corresponds to SVT (Source Validation

static int vtd_irte_get(IntelIOMMUState *iommu, uint16_t index,

                        VTD_IRTE *entry)

{

    dma_addr_t addr = 0x00;

    addr = iommu->intr_root + index * sizeof(*entry);

    if (dma_memory_read(&address_space_memory, addr, entry,

                        sizeof(*entry))) {

        VTD_DPRINTF(GENERAL, "error: fail to access IR root at 0x%"PRIx64

                    " + %"PRIu16, iommu->intr_root, index);

        return -VTD_FR_IR_ROOT_INVAL;

    }

    if (!entry->present) {

        VTD_DPRINTF(GENERAL, "error: present flag not set in IRTE"

                    " entry index %u value 0x%"PRIx64 " 0x%"PRIx64,

                    index, le64_to_cpu(entry->data[1]),

                    le64_to_cpu(entry->data[0]));

        return -VTD_FR_IR_ENTRY_P;

    }

    if (entry->__reserved_0 || entry->__reserved_1 || \

        entry->__reserved_2) {

        VTD_DPRINTF(GENERAL, "error: IRTE entry index %"PRIu16

                    " reserved fields non-zero: 0x%"PRIx64 " 0x%"PRIx64,

                    index, le64_to_cpu(entry->data[1]),

                    le64_to_cpu(entry->data[0]));

        return -VTD_FR_IR_IRTE_RSVD;

    }

    /*

     * TODO: Check Source-ID corresponds to SVT (Source Validation

     * Type) bits

     */

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void phys_sections_clear(PhysPageMap *map)

+{
+
+    while (map->sections_nb > 0) {
+
         MemoryRegionSection *section = &map->sections[--map->sections_nb];

         phys_section_destroy(section->mr);

static void phys_sections_clear(PhysPageMap *map)

{

    while (map->sections_nb > 0) {

        MemoryRegionSection *section = &map->sections[--map->sections_nb];

        phys_section_destroy(section->mr);

    }

    g_free(map->sections);

    g_free(map->nodes);

}


--- a/source.c
+++ b/source.c
@@ -49,11 +49,11 @@
         /* An higher priority IRQ is already raised */

         DPRINTF("%s: IRQ %d is hidden by raised IRQ %d on CPU %d\n",
+
+                __func__, n_IRQ, dst->raised.next, n_CPU);
+
+        return;
+
     }

     IRQ_get_next(opp, &dst->raised);

static void IRQ_local_pipe (openpic_t *opp, int n_CPU, int n_IRQ)

{

    IRQ_dst_t *dst;

    IRQ_src_t *src;

    int priority;

    dst = &opp->dst[n_CPU];

    src = &opp->src[n_IRQ];

    priority = IPVP_PRIORITY(src->ipvp);

    if (priority <= dst->pctp) {

        /* Too low priority */

        DPRINTF("%s: IRQ %d has too low priority on CPU %d\n",

                __func__, n_IRQ, n_CPU);

        return;

    }

    if (IRQ_testbit(&dst->raised, n_IRQ)) {

        /* Interrupt miss */

        DPRINTF("%s: IRQ %d was missed on CPU %d\n",

                __func__, n_IRQ, n_CPU);

        return;

    }

    set_bit(&src->ipvp, IPVP_ACTIVITY);

    IRQ_setbit(&dst->raised, n_IRQ);

    if (priority < dst->raised.priority) {

        /* An higher priority IRQ is already raised */

        DPRINTF("%s: IRQ %d is hidden by raised IRQ %d on CPU %d\n",

                __func__, n_IRQ, dst->raised.next, n_CPU);

        return;

    }

    IRQ_get_next(opp, &dst->raised);

    if (IRQ_get_next(opp, &dst->servicing) != -1 &&

        priority <= dst->servicing.priority) {

        DPRINTF("%s: IRQ %d is hidden by servicing IRQ %d on CPU %d\n",

                __func__, n_IRQ, dst->servicing.next, n_CPU);

        /* Already servicing a higher priority IRQ */

        return;

    }

    DPRINTF("Raise OpenPIC INT output cpu %d irq %d\n", n_CPU, n_IRQ);

    opp->irq_raise(opp, n_CPU, src);

}


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

     /* Update the floating-point exception summary */

+    env->fpscr |= 1 << FPSCR_FX;
+
+    if (fpscr_ze != 0) {
+
+        /* Update the floating-point enabled exception summary */

         env->fpscr |= 1 << FPSCR_FEX;

static always_inline uint64_t float_zero_divide_excp (uint64_t arg1, uint64_t arg2)

{

    env->fpscr |= 1 << FPSCR_ZX;

    env->fpscr &= ~((1 << FPSCR_FR) | (1 << FPSCR_FI));

    /* Update the floating-point exception summary */

    env->fpscr |= 1 << FPSCR_FX;

    if (fpscr_ze != 0) {

        /* Update the floating-point enabled exception summary */

        env->fpscr |= 1 << FPSCR_FEX;

        if (msr_fe0 != 0 || msr_fe1 != 0) {

            helper_raise_exception_err(POWERPC_EXCP_PROGRAM,

                                       POWERPC_EXCP_FP | POWERPC_EXCP_FP_ZX);

        }

    } else {

        /* Set the result to infinity */

        arg1 = ((arg1 ^ arg2) & 0x8000000000000000ULL);

        arg1 |= 0x7FFULL << 52;

    }

    return arg1;

}


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

     const H264Context *h = sl->h264;
+
+    int alloc_size = FFALIGN(FFABS(linesize) + 32, 32);

static int alloc_scratch_buffers(H264SliceContext *sl, int linesize)

{

    const H264Context *h = sl->h264;

    int alloc_size = FFALIGN(FFABS(linesize) + 32, 32);

    av_fast_malloc(&sl->bipred_scratchpad, &sl->bipred_scratchpad_allocated, 16 * 6 * alloc_size);

    // edge emu needs blocksize + filter length - 1

    // (= 21x21 for  h264)

    av_fast_malloc(&sl->edge_emu_buffer, &sl->edge_emu_buffer_allocated, alloc_size * 2 * 21);

    av_fast_malloc(&sl->top_borders[0], &sl->top_borders_allocated[0],

                   h->mb_width * 16 * 3 * sizeof(uint8_t) * 2);

    av_fast_malloc(&sl->top_borders[1], &sl->top_borders_allocated[1],

                   h->mb_width * 16 * 3 * sizeof(uint8_t) * 2);

    if (!sl->bipred_scratchpad || !sl->edge_emu_buffer ||

        !sl->top_borders[0]    || !sl->top_borders[1]) {

        av_freep(&sl->bipred_scratchpad);

        av_freep(&sl->edge_emu_buffer);

        av_freep(&sl->top_borders[0]);

        av_freep(&sl->top_borders[1]);

        sl->bipred_scratchpad_allocated = 0;

        sl->edge_emu_buffer_allocated   = 0;

        sl->top_borders_allocated[0]    = 0;

        sl->top_borders_allocated[1]    = 0;

        return AVERROR(ENOMEM);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
 " Example:\n"

 " 'multiwrite 512 1k 1k ; 4k 1k' \n"
+
+"  writes 2 kB at 512 bytes and 1 kB at 4 kB into the open file\n"
+
+"\n"
+
 " Writes into a segment of the currently open file, using a buffer\n"

 " filled with a set pattern (0xcdcdcdcd). The pattern byte is increased\n"

static void multiwrite_help(void)

{

    printf(

"\n"

" writes a range of bytes from the given offset source from multiple buffers,\n"

" in a batch of requests that may be merged by qemu\n"

"\n"

" Example:\n"

" 'multiwrite 512 1k 1k ; 4k 1k' \n"

"  writes 2 kB at 512 bytes and 1 kB at 4 kB into the open file\n"

"\n"

" Writes into a segment of the currently open file, using a buffer\n"

" filled with a set pattern (0xcdcdcdcd). The pattern byte is increased\n"

" by one for each request contained in the multiwrite command.\n"

" -P, -- use different pattern to fill file\n"

" -C, -- report statistics in a machine parsable format\n"

" -q, -- quiet mode, do not show I/O statistics\n"

"\n");

}


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

     if (!(s->mac_reg[TCTL] & E1000_TCTL_EN)) {

+        DBGOUT(TX, "tx disabled\n");

         return;

start_xmit(E1000State *s)

{

    PCIDevice *d = PCI_DEVICE(s);

    dma_addr_t base;

    struct e1000_tx_desc desc;

    uint32_t tdh_start = s->mac_reg[TDH], cause = E1000_ICS_TXQE;

    if (!(s->mac_reg[TCTL] & E1000_TCTL_EN)) {

        DBGOUT(TX, "tx disabled\n");

        return;

    }

    while (s->mac_reg[TDH] != s->mac_reg[TDT]) {

        base = tx_desc_base(s) +

               sizeof(struct e1000_tx_desc) * s->mac_reg[TDH];

        pci_dma_read(d, base, &desc, sizeof(desc));

        DBGOUT(TX, "index %d: %p : %x %x\n", s->mac_reg[TDH],

               (void *)(intptr_t)desc.buffer_addr, desc.lower.data,

               desc.upper.data);

        process_tx_desc(s, &desc);

        cause |= txdesc_writeback(s, base, &desc);

        if (++s->mac_reg[TDH] * sizeof(desc) >= s->mac_reg[TDLEN])

            s->mac_reg[TDH] = 0;

        /*

         * the following could happen only if guest sw assigns

         * bogus values to TDT/TDLEN.

         * there's nothing too intelligent we could do about this.

         */

        if (s->mac_reg[TDH] == tdh_start) {

            DBGOUT(TXERR, "TDH wraparound @%x, TDT %x, TDLEN %x\n",

                   tdh_start, s->mac_reg[TDT], s->mac_reg[TDLEN]);

            break;

        }

    }

    set_ics(s, 0, cause);

}


--- a/source.c
+++ b/source.c
@@ -1,16 +1,16 @@
+static CharDriverState *net_vhost_parse_chardev(

+    const NetdevVhostUserOptions *opts, Error **errp)

 {

     CharDriverState *chr = qemu_chr_find(opts->chardev);
+
+    VhostUserChardevProps props;

+
+    if (chr == NULL) {

         error_setg(errp, "chardev \"%s\" not found", opts->chardev);

static CharDriverState *net_vhost_parse_chardev(

    const NetdevVhostUserOptions *opts, Error **errp)

{

    CharDriverState *chr = qemu_chr_find(opts->chardev);

    VhostUserChardevProps props;

    if (chr == NULL) {

        error_setg(errp, "chardev \"%s\" not found", opts->chardev);

        return NULL;

    }

    /* inspect chardev opts */

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

    if (qemu_opt_foreach(chr->opts, net_vhost_chardev_opts, &props, errp)) {

        return NULL;

    }

    if (!props.is_socket || !props.is_unix) {

        error_setg(errp, "chardev \"%s\" is not a unix socket",

                   opts->chardev);

        return NULL;

    }

    qemu_chr_fe_claim_no_fail(chr);

    return chr;

}


void FUNCC(ff_h264_luma_dc_dequant_idct)(int16_t *_output, int16_t *_input, int qmul){

#define stride 16

    int i;

    int temp[16];

    static const uint8_t x_offset[4]={0, 2*stride, 8*stride, 10*stride};

    dctcoef *input = (dctcoef*)_input;

    dctcoef *output = (dctcoef*)_output;

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

        const int z0= input[4*i+0] + input[4*i+1];

        const int z1= input[4*i+0] - input[4*i+1];

        const int z2= input[4*i+2] - input[4*i+3];

        const int z3= input[4*i+2] + input[4*i+3];

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

        temp[4*i+1]= z0-z3;

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

        temp[4*i+3]= z1+z2;

    }

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

        const int offset= x_offset[i];

        const int z0= temp[4*0+i] + temp[4*2+i];

        const int z1= temp[4*0+i] - temp[4*2+i];

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

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

        output[stride* 0+offset]= ((((z0 + z3)*qmul + 128 ) >> 8));

        output[stride* 1+offset]= ((((z1 + z2)*qmul + 128 ) >> 8));

        output[stride* 4+offset]= ((((z1 - z2)*qmul + 128 ) >> 8));

        output[stride* 5+offset]= ((((z0 - z3)*qmul + 128 ) >> 8));

    }

#undef stride

}


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

+    assert(opts->type == NET_CLIENT_OPTIONS_KIND_VHOST_USER);
+
     vhost_user_opts = opts->u.vhost_user;

int net_init_vhost_user(const NetClientOptions *opts, const char *name,

                        NetClientState *peer, Error **errp)

{

    int queues;

    const NetdevVhostUserOptions *vhost_user_opts;

    CharDriverState *chr;

    assert(opts->type == NET_CLIENT_OPTIONS_KIND_VHOST_USER);

    vhost_user_opts = opts->u.vhost_user;

    chr = net_vhost_parse_chardev(vhost_user_opts, errp);

    if (!chr) {

        return -1;

    }

    /* verify net frontend */

    if (qemu_opts_foreach(qemu_find_opts("device"), net_vhost_check_net,

                          (char *)name, errp)) {

        return -1;

    }

    queues = vhost_user_opts->has_queues ? vhost_user_opts->queues : 1;

    if (queues < 1) {

        error_setg(errp,

                   "vhost-user number of queues must be bigger than zero");

        return -1;

    }

    return net_vhost_user_init(peer, "vhost_user", name, chr, queues);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int nbd_co_writev_1(NbdClientSession *client, int64_t sector_num,
+
                            int nb_sectors, QEMUIOVector *qiov,

+                           int offset)

 {

static int nbd_co_writev_1(NbdClientSession *client, int64_t sector_num,

                           int nb_sectors, QEMUIOVector *qiov,

                           int offset)

{

    struct nbd_request request;

    struct nbd_reply reply;

    ssize_t ret;

    request.type = NBD_CMD_WRITE;

    if (!bdrv_enable_write_cache(client->bs) &&

        (client->nbdflags & NBD_FLAG_SEND_FUA)) {

        request.type |= NBD_CMD_FLAG_FUA;

    }

    request.from = sector_num * 512;

    request.len = nb_sectors * 512;

    nbd_coroutine_start(client, &request);

    ret = nbd_co_send_request(client, &request, qiov, offset);

    if (ret < 0) {

        reply.error = -ret;

    } else {

        nbd_co_receive_reply(client, &request, &reply, NULL, 0);

    }

    nbd_coroutine_end(client, &request);

    return -reply.error;

}


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

     MilkymistMinimac2State *s = MILKYMIST_MINIMAC2(dev);

+    size_t buffers_size = TARGET_PAGE_ALIGN(3 * MINIMAC2_BUFFER_SIZE);

static int milkymist_minimac2_init(SysBusDevice *sbd)

{

    DeviceState *dev = DEVICE(sbd);

    MilkymistMinimac2State *s = MILKYMIST_MINIMAC2(dev);

    size_t buffers_size = TARGET_PAGE_ALIGN(3 * MINIMAC2_BUFFER_SIZE);

    sysbus_init_irq(sbd, &s->rx_irq);

    sysbus_init_irq(sbd, &s->tx_irq);

    memory_region_init_io(&s->regs_region, OBJECT(dev), &minimac2_ops, s,

                          "milkymist-minimac2", R_MAX * 4);

    sysbus_init_mmio(sbd, &s->regs_region);

    /* register buffers memory */

    memory_region_init_ram(&s->buffers, OBJECT(dev), "milkymist-minimac2.buffers",

                           buffers_size, &error_abort);

    vmstate_register_ram_global(&s->buffers);

    s->rx0_buf = memory_region_get_ram_ptr(&s->buffers);

    s->rx1_buf = s->rx0_buf + MINIMAC2_BUFFER_SIZE;

    s->tx_buf = s->rx1_buf + MINIMAC2_BUFFER_SIZE;

    sysbus_init_mmio(sbd, &s->buffers);

    qemu_macaddr_default_if_unset(&s->conf.macaddr);

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

                          object_get_typename(OBJECT(dev)), dev->id, s);

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

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static void akita_init(int ram_size, int vga_ram_size, int boot_device,
+
+                DisplayState *ds, const char **fd_filename, int snapshot,

                 const char *kernel_filename, const char *kernel_cmdline,

static void akita_init(int ram_size, int vga_ram_size, int boot_device,

                DisplayState *ds, const char **fd_filename, int snapshot,

                const char *kernel_filename, const char *kernel_cmdline,

                const char *initrd_filename, const char *cpu_model)

{

    spitz_common_init(ram_size, vga_ram_size, ds, kernel_filename,

                kernel_cmdline, initrd_filename, akita, 0x2e8);

}


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

                                 uint32_t val, int len)

+{
+
+    DPRINTF("Warning: attempted write of 0x%x to physical "

             "address 0x" TARGET_FMT_plx " in xen platform mmio space\n",

static void platform_mmio_write(ReadWriteHandler *handler, pcibus_t addr,

                                uint32_t val, int len)

{

    DPRINTF("Warning: attempted write of 0x%x to physical "

            "address 0x" TARGET_FMT_plx " in xen platform mmio space\n",

            val, addr);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+int kvm_set_ioeventfd_pio_word(int fd, uint16_t addr, uint16_t val, bool assign)
+
+{
+
+    struct kvm_ioeventfd kick = {

         .datamatch = val,

int kvm_set_ioeventfd_pio_word(int fd, uint16_t addr, uint16_t val, bool assign)

{

    struct kvm_ioeventfd kick = {

        .datamatch = val,

        .addr = addr,

        .len = 2,

        .flags = KVM_IOEVENTFD_FLAG_DATAMATCH | KVM_IOEVENTFD_FLAG_PIO,

        .fd = fd,

    };

    int r;

    if (!kvm_enabled())

        return -ENOSYS;

    if (!assign)

        kick.flags |= KVM_IOEVENTFD_FLAG_DEASSIGN;

    r = kvm_vm_ioctl(kvm_state, KVM_IOEVENTFD, &kick);

    if (r < 0)

        return r;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static int ipmovie_probe(AVProbeData *p)
+
+{
+
     if (p->buf_size < IPMOVIE_SIGNATURE_SIZE)

         return 0;

static int ipmovie_probe(AVProbeData *p)

{

    if (p->buf_size < IPMOVIE_SIGNATURE_SIZE)

        return 0;

    if (strncmp(p->buf, IPMOVIE_SIGNATURE, IPMOVIE_SIGNATURE_SIZE) != 0)

        return 0;

    return AVPROBE_SCORE_MAX;

}


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

                                           CPUMIPSState *env)
+
+{

     int16_t tempS;

static inline int16_t mipsdsp_sat_add_i16(int16_t a, int16_t b,

                                          CPUMIPSState *env)

{

    int16_t tempS;

    tempS = a + b;

    if (MIPSDSP_OVERFLOW(a, b, tempS, 0x8000)) {

        if (a > 0) {

            tempS = 0x7FFF;

        } else {

            tempS = 0x8000;

        }

        set_DSPControl_overflow_flag(1, 20, env);

    }

    return tempS;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 int avfilter_default_query_formats(AVFilterContext *ctx)
+
 {

     enum AVMediaType type = ctx->inputs [0] ? ctx->inputs [0]->type :

int avfilter_default_query_formats(AVFilterContext *ctx)

{

    enum AVMediaType type = ctx->inputs [0] ? ctx->inputs [0]->type :

                            ctx->outputs[0] ? ctx->outputs[0]->type :

                            AVMEDIA_TYPE_VIDEO;

    avfilter_set_common_formats(ctx, avfilter_all_formats(type));

    return 0;

}


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

     len = qemu_chr_can_read(s->chr);

+    if (len > s->out_fifo.count)
+
+        len = s->out_fifo.count;
+
+    if (len > 0) {

         if (len > sizeof(buf))

static void kbd_send_chars(void *opaque)

{

    TextConsole *s = opaque;

    int len;

    uint8_t buf[16];

    len = qemu_chr_can_read(s->chr);

    if (len > s->out_fifo.count)

        len = s->out_fifo.count;

    if (len > 0) {

        if (len > sizeof(buf))

            len = sizeof(buf);

        qemu_fifo_read(&s->out_fifo, buf, len);

        qemu_chr_read(s->chr, buf, len);

    }

    /* characters are pending: we send them a bit later (XXX:

       horrible, should change char device API) */

    if (s->out_fifo.count > 0) {

        qemu_mod_timer(s->kbd_timer, qemu_get_clock(rt_clock) + 1);

    }

}


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

+    guest_rtc = s->base_rtc * NANOSECONDS_PER_SECOND +
+
+        guest_clock - s->last_update + s->offset;
+
     return guest_rtc;

 }

static uint64_t get_guest_rtc_ns(RTCState *s)

{

    uint64_t guest_rtc;

    uint64_t guest_clock = qemu_clock_get_ns(rtc_clock);

    guest_rtc = s->base_rtc * NANOSECONDS_PER_SECOND +

        guest_clock - s->last_update + s->offset;

    return guest_rtc;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static uint64_t omap_tipb_bridge_read(void *opaque, target_phys_addr_t addr,

                                       unsigned size)
+
+{
+
+    struct omap_tipb_bridge_s *s = (struct omap_tipb_bridge_s *) opaque;
+

     if (size < 2) {

static uint64_t omap_tipb_bridge_read(void *opaque, target_phys_addr_t addr,

                                      unsigned size)

{

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

    if (size < 2) {

        return omap_badwidth_read16(opaque, addr);

    }

    switch (addr) {

    case 0x00:	/* TIPB_CNTL */

        return s->control;

    case 0x04:	/* TIPB_BUS_ALLOC */

        return s->alloc;

    case 0x08:	/* MPU_TIPB_CNTL */

        return s->buffer;

    case 0x0c:	/* ENHANCED_TIPB_CNTL */

        return s->enh_control;

    case 0x10:	/* ADDRESS_DBG */

    case 0x14:	/* DATA_DEBUG_LOW */

    case 0x18:	/* DATA_DEBUG_HIGH */

        return 0xffff;

    case 0x1c:	/* DEBUG_CNTR_SIG */

        return 0x00f8;

    }

    OMAP_BAD_REG(addr);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,

                    uint8_t *properties)
+
 {
+
+    Jpeg2000CodingStyle tmp;
+
     int compno;

static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,

                   uint8_t *properties)

{

    Jpeg2000CodingStyle tmp;

    int compno;

    if (s->buf_end - s->buf < 5)

        return AVERROR_INVALIDDATA;

    tmp.log2_prec_width  =

    tmp.log2_prec_height = 15;

    tmp.csty = bytestream_get_byte(&s->buf);

    // get progression order

    tmp.prog_order = bytestream_get_byte(&s->buf);

    tmp.nlayers = bytestream_get_be16(&s->buf);

    tmp.mct     = bytestream_get_byte(&s->buf); // multiple component transformation

    get_cox(s, &tmp);

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

        if (!(properties[compno] & HAD_COC))

            memcpy(c + compno, &tmp, sizeof(tmp));

    return 0;

}


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

+                                 ptrdiff_t stride)
+
 {

     avc_luma_hv_qrt_16w_msa(src - 2,

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

                                 ptrdiff_t stride)

{

    avc_luma_hv_qrt_16w_msa(src - 2,

                            src - (stride * 2), stride, dst, stride, 16);

}


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

 {
+
+    const char *device = qemu_opt_get(opts, "path");
+
+
+
     if (device == NULL) {

         error_setg(errp, "chardev: serial/tty: no device path given");

static void qemu_chr_parse_serial(QemuOpts *opts, ChardevBackend *backend,

                                  Error **errp)

{

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

    if (device == NULL) {

        error_setg(errp, "chardev: serial/tty: no device path given");

        return;

    }

    backend->serial = g_new0(ChardevHostdev, 1);

    backend->serial->device = g_strdup(device);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 const char *qdict_get_str(const QDict *qdict, const char *key)
+
+{

     QObject *obj = qdict_get_obj(qdict, key, QTYPE_QSTRING);

const char *qdict_get_str(const QDict *qdict, const char *key)

{

    QObject *obj = qdict_get_obj(qdict, key, QTYPE_QSTRING);

    return qstring_get_str(qobject_to_qstring(obj));

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     Error *err = NULL;

+
+    qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus));
+
+    object_property_set_bool(OBJECT(vdev), true, "realized", &err);
+
     if (err) {

         error_propagate(errp, err);

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

{

    VirtIOBlkCcw *dev = VIRTIO_BLK_CCW(ccw_dev);

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

    Error *err = NULL;

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

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

    if (err) {

        error_propagate(errp, err);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void json_end_object(QJSON *json)

 {
+
+    qstring_append(json->str, " }");

     json->omit_comma = false;

void json_end_object(QJSON *json)

{

    qstring_append(json->str, " }");

    json->omit_comma = false;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int cmp(const void *a, const void *b)
+
+{

     const double va = *(const double *)a, vb = *(const double *)b;

static int cmp(const void *a, const void *b)

{

    const double va = *(const double *)a, vb = *(const double *)b;

    return va < vb ? -1 : ( va > vb ? 1 : 0 );

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int rv40_h_loop_filter_strength(uint8_t *src, int stride,

                                        int beta, int beta2, int edge,

static int rv40_h_loop_filter_strength(uint8_t *src, int stride,

                                       int beta, int beta2, int edge,

                                       int *p1, int *q1)

{

    return rv40_loop_filter_strength(src, stride, 1, beta, beta2, edge, p1, q1);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+int net_init_bridge(QemuOpts *opts, const char *name, VLANState *vlan)

 {

@@ -9,7 +9,7 @@

     if (!qemu_opt_get(opts, "br")) {
+
         qemu_opt_set(opts, "br", DEFAULT_BRIDGE_INTERFACE);

     }

int net_init_bridge(QemuOpts *opts, const char *name, VLANState *vlan)

{

    TAPState *s;

    int fd, vnet_hdr;

    if (!qemu_opt_get(opts, "br")) {

        qemu_opt_set(opts, "br", DEFAULT_BRIDGE_INTERFACE);

    }

    if (!qemu_opt_get(opts, "helper")) {

        qemu_opt_set(opts, "helper", DEFAULT_BRIDGE_HELPER);

    }

    fd = net_bridge_run_helper(qemu_opt_get(opts, "helper"),

                               qemu_opt_get(opts, "br"));

    if (fd == -1) {

        return -1;

    }

    fcntl(fd, F_SETFL, O_NONBLOCK);

    vnet_hdr = tap_probe_vnet_hdr(fd);

    s = net_tap_fd_init(vlan, "bridge", name, fd, vnet_hdr);

    if (!s) {

        close(fd);

        return -1;

    }

    snprintf(s->nc.info_str, sizeof(s->nc.info_str), "helper=%s,br=%s",

             qemu_opt_get(opts, "helper"), qemu_opt_get(opts, "br"));

    return 0;

}


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

     default:
+
+        fprintf(stderr, "op_to_movi: unexpected return value of "
+
+                "function op_bits.\n");
+
         tcg_abort();

     }

static int op_to_movi(int op)

{

    switch (op_bits(op)) {

    case 32:

        return INDEX_op_movi_i32;

#if TCG_TARGET_REG_BITS == 64

    case 64:

        return INDEX_op_movi_i64;

#endif

    default:

        fprintf(stderr, "op_to_movi: unexpected return value of "

                "function op_bits.\n");

        tcg_abort();

    }

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
                                     int64_t pos)

 {
+
+    QEMUFileSocket *s = opaque;
+
+    ssize_t len;
+
     ssize_t size = iov_size(iov, iovcnt);

static ssize_t socket_writev_buffer(void *opaque, struct iovec *iov, int iovcnt,

                                    int64_t pos)

{

    QEMUFileSocket *s = opaque;

    ssize_t len;

    ssize_t size = iov_size(iov, iovcnt);

    len = iov_send(s->fd, iov, iovcnt, 0, size);

    if (len < size) {

        len = -socket_error();

    }

    return len;

}


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

     spcr->base_address.address = cpu_to_le64(uart_memmap->base);

+
+
+    spcr->interrupt_types = (1 << 3); /* Bit[3] ARMH GIC interrupt */
+
+    spcr->gsi = cpu_to_le32(irq);  /* Global System Interrupt */

build_spcr(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info)

{

    AcpiSerialPortConsoleRedirection *spcr;

    const MemMapEntry *uart_memmap = &guest_info->memmap[VIRT_UART];

    int irq = guest_info->irqmap[VIRT_UART] + ARM_SPI_BASE;

    spcr = acpi_data_push(table_data, sizeof(*spcr));

    spcr->interface_type = 0x3;    /* ARM PL011 UART */

    spcr->base_address.space_id = AML_SYSTEM_MEMORY;

    spcr->base_address.bit_width = 8;

    spcr->base_address.bit_offset = 0;

    spcr->base_address.access_width = 1;

    spcr->base_address.address = cpu_to_le64(uart_memmap->base);

    spcr->interrupt_types = (1 << 3); /* Bit[3] ARMH GIC interrupt */

    spcr->gsi = cpu_to_le32(irq);  /* Global System Interrupt */

    spcr->baud = 3;                /* Baud Rate: 3 = 9600 */

    spcr->parity = 0;              /* No Parity */

    spcr->stopbits = 1;            /* 1 Stop bit */

    spcr->flowctrl = (1 << 1);     /* Bit[1] = RTS/CTS hardware flow control */

    spcr->term_type = 0;           /* Terminal Type: 0 = VT100 */

    spcr->pci_device_id = 0xffff;  /* PCI Device ID: not a PCI device */

    spcr->pci_vendor_id = 0xffff;  /* PCI Vendor ID: not a PCI device */

    build_header(linker, table_data, (void *)spcr, "SPCR", sizeof(*spcr), 2,

                 NULL);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void ga_channel_free(GAChannel *c)
+
+{
+
+    if (c->method == GA_CHANNEL_UNIX_LISTEN
+
         && c->listen_channel) {

         ga_channel_listen_close(c);

void ga_channel_free(GAChannel *c)

{

    if (c->method == GA_CHANNEL_UNIX_LISTEN

        && c->listen_channel) {

        ga_channel_listen_close(c);

    }

    if (c->client_channel) {

        ga_channel_client_close(c);

    }

    g_free(c);

}


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

     if (!master || !second) {
+
+        ret = AVERROR_BUG;
+
+        goto error;
+
     }

     if (!s->palette_loaded) {

static int load_apply_palette(FFFrameSync *fs)

{

    AVFilterContext *ctx = fs->parent;

    AVFilterLink *inlink = ctx->inputs[0];

    PaletteUseContext *s = ctx->priv;

    AVFrame *master, *second, *out;

    int ret;

    // writable for error diffusal dithering

    ret = ff_framesync_dualinput_get_writable(fs, &master, &second);

    if (ret < 0)

        return ret;

    if (!master || !second) {

        ret = AVERROR_BUG;

        goto error;

    }

    if (!s->palette_loaded) {

        load_palette(s, second);

    }

    out = apply_palette(inlink, master);

    return ff_filter_frame(ctx->outputs[0], out);

error:

    av_frame_free(&master);

    av_frame_free(&second);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
         assert(bytes <= bs->bl.max_transfer);

     }
+
+
+
+    QSIMPLEQ_FOREACH(rule, &s->active_rules, active_next) {
+
         uint64_t inject_offset = rule->options.inject.offset;

blkdebug_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes,

                   QEMUIOVector *qiov, int flags)

{

    BDRVBlkdebugState *s = bs->opaque;

    BlkdebugRule *rule = NULL;

    /* Sanity check block layer guarantees */

    assert(QEMU_IS_ALIGNED(offset, bs->bl.request_alignment));

    assert(QEMU_IS_ALIGNED(bytes, bs->bl.request_alignment));

    if (bs->bl.max_transfer) {

        assert(bytes <= bs->bl.max_transfer);

    }

    QSIMPLEQ_FOREACH(rule, &s->active_rules, active_next) {

        uint64_t inject_offset = rule->options.inject.offset;

        if (inject_offset == -1 ||

            (inject_offset >= offset && inject_offset < offset + bytes))

        {

            break;

        }

    }

    if (rule && rule->options.inject.error) {

        return inject_error(bs, rule);

    }

    return bdrv_co_preadv(bs->file, offset, bytes, qiov, flags);

}


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

 {
+
     ThreadPoolCo *co = opaque;

static void thread_pool_co_cb(void *opaque, int ret)

{

    ThreadPoolCo *co = opaque;

    co->ret = ret;

    qemu_coroutine_enter(co->co, NULL);

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+static long gethugepagesize(const char *path, Error **errp)

 {

+    struct statfs fs;

     int ret;
+
+

     do {

static long gethugepagesize(const char *path, Error **errp)

{

    struct statfs fs;

    int ret;

    do {

        ret = statfs(path, &fs);

    } while (ret != 0 && errno == EINTR);

    if (ret != 0) {

        error_setg_errno(errp, errno, "failed to get page size of file %s",

                         path);

        return 0;

    }

    return fs.f_bsize;

}


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

     ETRAXSerial *s = opaque;
+
     uint32_t value = val64;

     unsigned char ch = val64;

ser_write(void *opaque, hwaddr addr,

          uint64_t val64, unsigned int size)

{

    ETRAXSerial *s = opaque;

    uint32_t value = val64;

    unsigned char ch = val64;

    D(qemu_log("%s " TARGET_FMT_plx "=%x\n",  __func__, addr, value));

    addr >>= 2;

    switch (addr)

    {

        case RW_DOUT:

            qemu_chr_fe_write(s->chr, &ch, 1);

            s->regs[R_INTR] |= 3;

            s->pending_tx = 1;

            s->regs[addr] = value;

            break;

        case RW_ACK_INTR:

            if (s->pending_tx) {

                value &= ~1;

                s->pending_tx = 0;

                D(qemu_log("fixedup value=%x r_intr=%x\n",

                           value, s->regs[R_INTR]));

            }

            s->regs[addr] = value;

            s->regs[R_INTR] &= ~value;

            D(printf("r_intr=%x\n", s->regs[R_INTR]));

            break;

        default:

            s->regs[addr] = value;

            break;

    }

    ser_update_irq(s);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static void netmap_update_fd_handler(NetmapState *s)
+
+{

     qemu_set_fd_handler2(s->me.fd,

static void netmap_update_fd_handler(NetmapState *s)

{

    qemu_set_fd_handler2(s->me.fd,

                         s->read_poll  ? netmap_can_send : NULL,

                         s->read_poll  ? netmap_send     : NULL,

                         s->write_poll ? netmap_writable : NULL,

                         s);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static av_always_inline void fic_idct(int16_t *blk, int step, int shift, int rnd)
+
+{
+
+    const int t0 =  27246 * blk[3 * step] + 18405 * blk[5 * step];
+
+    const int t1 =  27246 * blk[5 * step] - 18405 * blk[3 * step];

     const int t2 =   6393 * blk[7 * step] + 32139 * blk[1 * step];

static av_always_inline void fic_idct(int16_t *blk, int step, int shift, int rnd)

{

    const int t0 =  27246 * blk[3 * step] + 18405 * blk[5 * step];

    const int t1 =  27246 * blk[5 * step] - 18405 * blk[3 * step];

    const int t2 =   6393 * blk[7 * step] + 32139 * blk[1 * step];

    const int t3 =   6393 * blk[1 * step] - 32139 * blk[7 * step];

    const unsigned t4 = 5793U * (t2 + t0 + 0x800 >> 12);

    const unsigned t5 = 5793U * (t3 + t1 + 0x800 >> 12);

    const unsigned t6 = t2 - t0;

    const unsigned t7 = t3 - t1;

    const unsigned t8 =  17734 * blk[2 * step] - 42813 * blk[6 * step];

    const unsigned t9 =  17734 * blk[6 * step] + 42814 * blk[2 * step];

    const unsigned tA = (blk[0 * step] - blk[4 * step]) * 32768 + rnd;

    const unsigned tB = (blk[0 * step] + blk[4 * step]) * 32768 + rnd;

    blk[0 * step] = (int)(  t4       + t9 + tB) >> shift;

    blk[1 * step] = (int)(  t6 + t7  + t8 + tA) >> shift;

    blk[2 * step] = (int)(  t6 - t7  - t8 + tA) >> shift;

    blk[3 * step] = (int)(  t5       - t9 + tB) >> shift;

    blk[4 * step] = (int)( -t5       - t9 + tB) >> shift;

    blk[5 * step] = (int)(-(t6 - t7) - t8 + tA) >> shift;

    blk[6 * step] = (int)(-(t6 + t7) + t8 + tA) >> shift;

    blk[7 * step] = (int)( -t4       + t9 + tB) >> shift;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static char *var_read_string(AVIOContext *pb, int size)

 {
+
+    int n;
+
+    char *str = av_malloc(size + 1);
+
     if (!str)

         return NULL;

static char *var_read_string(AVIOContext *pb, int size)

{

    int n;

    char *str = av_malloc(size + 1);

    if (!str)

        return NULL;

    n = avio_get_str(pb, size, str, size + 1);

    if (n < size)

        avio_skip(pb, size - n);

    return str;

}


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

     cpu_physical_memory_write(addr, &hdr, sizeof(hdr));
+
+    cpu_physical_memory_write(addr + sizeof(hdr), fdt, fdt_totalsize(fdt));
+
+    trace_spapr_cas_continue(fdt_totalsize(fdt) + sizeof(hdr));
+
     g_free(fdt);

int spapr_h_cas_compose_response(target_ulong addr, target_ulong size)

{

    void *fdt, *fdt_skel;

    sPAPRDeviceTreeUpdateHeader hdr = { .version_id = 1 };

    size -= sizeof(hdr);

    /* Create sceleton */

    fdt_skel = g_malloc0(size);

    _FDT((fdt_create(fdt_skel, size)));

    _FDT((fdt_begin_node(fdt_skel, "")));

    _FDT((fdt_end_node(fdt_skel)));

    _FDT((fdt_finish(fdt_skel)));

    fdt = g_malloc0(size);

    _FDT((fdt_open_into(fdt_skel, fdt, size)));

    g_free(fdt_skel);

    /* Place to make changes to the tree */

    /* Pack resulting tree */

    _FDT((fdt_pack(fdt)));

    if (fdt_totalsize(fdt) + sizeof(hdr) > size) {

        trace_spapr_cas_failed(size);

        return -1;

    }

    cpu_physical_memory_write(addr, &hdr, sizeof(hdr));

    cpu_physical_memory_write(addr + sizeof(hdr), fdt, fdt_totalsize(fdt));

    trace_spapr_cas_continue(fdt_totalsize(fdt) + sizeof(hdr));

    g_free(fdt);

    return 0;

}


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

         break;

+    case AVCOL_RANGE_JPEG:
+
+        *off = 0;
+
+        *y_rng = *uv_rng = (256 << (depth - 8)) - 1;

         break;

static int get_range_off(int *off, int *y_rng, int *uv_rng,

                         enum AVColorRange rng, int depth)

{

    switch (rng) {

    case AVCOL_RANGE_MPEG:

        *off = 16 << (depth - 8);

        *y_rng = 219 << (depth - 8);

        *uv_rng = 224 << (depth - 8);

        break;

    case AVCOL_RANGE_JPEG:

        *off = 0;

        *y_rng = *uv_rng = (256 << (depth - 8)) - 1;

        break;

    default:

        return AVERROR(EINVAL);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -28,11 +28,11 @@
         if (bkt->avg > THROTTLE_VALUE_MAX || bkt->max > THROTTLE_VALUE_MAX) {
             error_setg(errp, "bps/iops/max values must be within [0, %lld]",
                        THROTTLE_VALUE_MAX);
+        if (!bkt->burst_length) {
+            error_setg(errp, "the burst length cannot be 0");
+        if (bkt->burst_length > 1 && !bkt->max) {
+            error_setg(errp, "burst length set without burst rate");
+        if (bkt->max && !bkt->avg) {
             error_setg(errp, "bps_max/iops_max require corresponding"
                        " bps/iops values");
         if (bkt->max && bkt->max < bkt->avg) {

bool throttle_is_valid(ThrottleConfig *cfg, Error **errp)
{
    int i;
    bool bps_flag, ops_flag;
    bool bps_max_flag, ops_max_flag;
    bps_flag = cfg->buckets[THROTTLE_BPS_TOTAL].avg &&
               (cfg->buckets[THROTTLE_BPS_READ].avg ||
                cfg->buckets[THROTTLE_BPS_WRITE].avg);
    ops_flag = cfg->buckets[THROTTLE_OPS_TOTAL].avg &&
               (cfg->buckets[THROTTLE_OPS_READ].avg ||
                cfg->buckets[THROTTLE_OPS_WRITE].avg);
    bps_max_flag = cfg->buckets[THROTTLE_BPS_TOTAL].max &&
                  (cfg->buckets[THROTTLE_BPS_READ].max  ||
                   cfg->buckets[THROTTLE_BPS_WRITE].max);
    ops_max_flag = cfg->buckets[THROTTLE_OPS_TOTAL].max &&
                   (cfg->buckets[THROTTLE_OPS_READ].max ||
                   cfg->buckets[THROTTLE_OPS_WRITE].max);
    if (bps_flag || ops_flag || bps_max_flag || ops_max_flag) {
        error_setg(errp, "bps/iops/max total values and read/write values"
                   " cannot be used at the same time");
    if (cfg->op_size &&
        !cfg->buckets[THROTTLE_OPS_TOTAL].avg &&
        !cfg->buckets[THROTTLE_OPS_READ].avg &&
        !cfg->buckets[THROTTLE_OPS_WRITE].avg) {
        error_setg(errp, "iops size requires an iops value to be set");
    for (i = 0; i < BUCKETS_COUNT; i++) {
        LeakyBucket *bkt = &cfg->buckets[i];
        if (bkt->avg > THROTTLE_VALUE_MAX || bkt->max > THROTTLE_VALUE_MAX) {
            error_setg(errp, "bps/iops/max values must be within [0, %lld]",
                       THROTTLE_VALUE_MAX);
        if (!bkt->burst_length) {
            error_setg(errp, "the burst length cannot be 0");
        if (bkt->burst_length > 1 && !bkt->max) {
            error_setg(errp, "burst length set without burst rate");
        if (bkt->max && !bkt->avg) {
            error_setg(errp, "bps_max/iops_max require corresponding"
                       " bps/iops values");
        if (bkt->max && bkt->max < bkt->avg) {
            error_setg(errp, "bps_max/iops_max cannot be lower than bps/iops");
    return true;


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static inline uint64_t cksm_overflow(uint64_t cksm)
+
+{
+
     if (cksm > 0xffffffffULL) {
+
         cksm &= 0xffffffffULL;

         cksm++;

static inline uint64_t cksm_overflow(uint64_t cksm)

{

    if (cksm > 0xffffffffULL) {

        cksm &= 0xffffffffULL;

        cksm++;

    }

    return cksm;

}


void do_td (int flags)

{

    if (!likely(!(((int64_t)T0 < (int64_t)T1 && (flags & 0x10)) ||

                  ((int64_t)T0 > (int64_t)T1 && (flags & 0x08)) ||

                  ((int64_t)T0 == (int64_t)T1 && (flags & 0x04)) ||

                  ((uint64_t)T0 < (uint64_t)T1 && (flags & 0x02)) ||

                  ((uint64_t)T0 > (uint64_t)T1 && (flags & 0x01)))))

        do_raise_exception_err(EXCP_PROGRAM, EXCP_TRAP);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static void memory_region_read_accessor(MemoryRegion *mr,
+
                                         hwaddr addr,

                                         uint64_t *value,
+
                                         unsigned size,

                                         unsigned shift,

static void memory_region_read_accessor(MemoryRegion *mr,

                                        hwaddr addr,

                                        uint64_t *value,

                                        unsigned size,

                                        unsigned shift,

                                        uint64_t mask)

{

    uint64_t tmp;

    if (mr->flush_coalesced_mmio) {

        qemu_flush_coalesced_mmio_buffer();

    }

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

    trace_memory_region_ops_read(mr, addr, tmp, size);

    *value |= (tmp & mask) << shift;

}


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

     /* Initialise controller registers */

+    opp->frep = ((opp->nb_irqs - 1) << FREP_NIRQ_SHIFT) |

+                ((opp->nb_cpus - 1) << FREP_NCPU_SHIFT) |

                 (opp->vid << FREP_VID_SHIFT);

static void openpic_reset(DeviceState *d)

{

    OpenPICState *opp = FROM_SYSBUS(typeof (*opp), sysbus_from_qdev(d));

    int i;

    opp->glbc = GLBC_RESET;

    /* Initialise controller registers */

    opp->frep = ((opp->nb_irqs - 1) << FREP_NIRQ_SHIFT) |

                ((opp->nb_cpus - 1) << FREP_NCPU_SHIFT) |

                (opp->vid << FREP_VID_SHIFT);

    opp->pint = 0;

    opp->spve = -1 & opp->vector_mask;

    opp->tifr = opp->tifr_reset;

    /* Initialise IRQ sources */

    for (i = 0; i < opp->max_irq; i++) {

        opp->src[i].ipvp = opp->ipvp_reset;

        opp->src[i].ide  = opp->ide_reset;

    }

    /* Initialise IRQ destinations */

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

        opp->dst[i].pctp      = 15;

        memset(&opp->dst[i].raised, 0, sizeof(IRQ_queue_t));

        opp->dst[i].raised.next = -1;

        memset(&opp->dst[i].servicing, 0, sizeof(IRQ_queue_t));

        opp->dst[i].servicing.next = -1;

    }

    /* Initialise timers */

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

        opp->timers[i].ticc = 0;

        opp->timers[i].tibc = TIBC_CI;

    }

    /* Go out of RESET state */

    opp->glbc = 0;

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
         mmubooke_dump_mmu(f, cpu_fprintf, env);

         break;
+
+    case POWERPC_MMU_BOOKE206:
+
+        mmubooke206_dump_mmu(f, cpu_fprintf, env);
+
         break;

     case POWERPC_MMU_SOFT_6xx:

void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUPPCState *env)

{

    switch (env->mmu_model) {

    case POWERPC_MMU_BOOKE:

        mmubooke_dump_mmu(f, cpu_fprintf, env);

        break;

    case POWERPC_MMU_BOOKE206:

        mmubooke206_dump_mmu(f, cpu_fprintf, env);

        break;

    case POWERPC_MMU_SOFT_6xx:

    case POWERPC_MMU_SOFT_74xx:

        mmu6xx_dump_mmu(f, cpu_fprintf, env);

        break;

#if defined(TARGET_PPC64)

    case POWERPC_MMU_64B:

    case POWERPC_MMU_2_03:

    case POWERPC_MMU_2_06:

    case POWERPC_MMU_2_07:

        dump_slb(f, cpu_fprintf, env);

        break;

#endif

    default:

        qemu_log_mask(LOG_UNIMP, "%s: unimplemented\n", __func__);

    }

}


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

     int index = IS_USER(s);

+    s->is_mem = 1;

     tmp = tcg_temp_new_i32();

     switch(opsize) {

+    case OS_BYTE:

         if (sign)

static inline TCGv gen_load(DisasContext * s, int opsize, TCGv addr, int sign)

{

    TCGv tmp;

    int index = IS_USER(s);

    s->is_mem = 1;

    tmp = tcg_temp_new_i32();

    switch(opsize) {

    case OS_BYTE:

        if (sign)

            tcg_gen_qemu_ld8s(tmp, addr, index);

        else

            tcg_gen_qemu_ld8u(tmp, addr, index);

        break;

    case OS_WORD:

        if (sign)

            tcg_gen_qemu_ld16s(tmp, addr, index);

        else

            tcg_gen_qemu_ld16u(tmp, addr, index);

        break;

    case OS_LONG:

    case OS_SINGLE:

        tcg_gen_qemu_ld32u(tmp, addr, index);

        break;

    default:

        qemu_assert(0, "bad load size");

    }

    gen_throws_exception = gen_last_qop;

    return tmp;

}


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

     g_source_unref(&ctx->source);

+}

void aio_context_unref(AioContext *ctx)

{

    g_source_unref(&ctx->source);

}


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

+
+    ide_cmd_lba48_transform(s, lba48);
+
+    ide_sector_start_dma(s, IDE_DMA_READ);
+

     return false;

static bool cmd_read_dma(IDEState *s, uint8_t cmd)

{

    bool lba48 = (cmd == WIN_READDMA_EXT);

    if (!s->bs) {

        ide_abort_command(s);

        return true;

    }

    ide_cmd_lba48_transform(s, lba48);

    ide_sector_start_dma(s, IDE_DMA_READ);

    return false;

}


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

         fprintf(stderr, "emulation failure\n");

+        if (!kvm_arch_stop_on_emulation_error(env)) {
+
+            cpu_dump_state(env, stderr, fprintf, CPU_DUMP_CODE);
+
+            return 0;

         }

static int kvm_handle_internal_error(CPUState *env, struct kvm_run *run)

{

    fprintf(stderr, "KVM internal error.");

    if (kvm_check_extension(kvm_state, KVM_CAP_INTERNAL_ERROR_DATA)) {

        int i;

        fprintf(stderr, " Suberror: %d\n", run->internal.suberror);

        for (i = 0; i < run->internal.ndata; ++i) {

            fprintf(stderr, "extra data[%d]: %"PRIx64"\n",

                    i, (uint64_t)run->internal.data[i]);

        }

    } else {

        fprintf(stderr, "\n");

    }

    if (run->internal.suberror == KVM_INTERNAL_ERROR_EMULATION) {

        fprintf(stderr, "emulation failure\n");

        if (!kvm_arch_stop_on_emulation_error(env)) {

            cpu_dump_state(env, stderr, fprintf, CPU_DUMP_CODE);

            return 0;

        }

    }

    /* FIXME: Should trigger a qmp message to let management know

     * something went wrong.

     */

    return -1;

}


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

     qemu_get_buffer(f, (uint8_t *)&data, sizeof(VirtQueueElementOld));

+
+
+    elem = virtqueue_alloc_element(sz, data.out_num, data.in_num);
+
+    elem->index = data.index;

void *qemu_get_virtqueue_element(QEMUFile *f, size_t sz)

{

    VirtQueueElement *elem;

    VirtQueueElementOld data;

    int i;

    qemu_get_buffer(f, (uint8_t *)&data, sizeof(VirtQueueElementOld));

    elem = virtqueue_alloc_element(sz, data.out_num, data.in_num);

    elem->index = data.index;

    for (i = 0; i < elem->in_num; i++) {

        elem->in_addr[i] = data.in_addr[i];

    }

    for (i = 0; i < elem->out_num; i++) {

        elem->out_addr[i] = data.out_addr[i];

    }

    for (i = 0; i < elem->in_num; i++) {

        /* Base is overwritten by virtqueue_map.  */

        elem->in_sg[i].iov_base = 0;

        elem->in_sg[i].iov_len = data.in_sg[i].iov_len;

    }

    for (i = 0; i < elem->out_num; i++) {

        /* Base is overwritten by virtqueue_map.  */

        elem->out_sg[i].iov_base = 0;

        elem->out_sg[i].iov_len = data.out_sg[i].iov_len;

    }

    virtqueue_map(elem);

    return elem;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static uint16_t qpci_pc_config_readw(QPCIBus *bus, int devfn, uint8_t offset)
+
 {

     outl(0xcf8, (1 << 31) | (devfn << 8) | offset);

static uint16_t qpci_pc_config_readw(QPCIBus *bus, int devfn, uint8_t offset)

{

    outl(0xcf8, (1 << 31) | (devfn << 8) | offset);

    return inw(0xcfc);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void softusb_usbdev_datain(void *opaque)

 {
+
+    MilkymistSoftUsbState *s = opaque;
+
+

     USBPacket p;

static void softusb_usbdev_datain(void *opaque)

{

    MilkymistSoftUsbState *s = opaque;

    USBPacket p;

    p.pid = USB_TOKEN_IN;

    p.devep = 1;

    p.data = s->kbd_usb_buffer;

    p.len = sizeof(s->kbd_usb_buffer);

    s->usbdev->info->handle_data(s->usbdev, &p);

    softusb_kbd_changed(s);

}


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

   s = &gdbserver_state;

+  if (gdbserver_fd < 0 || s->fd < 0)
+
+    return;
+
+

   snprintf(buf, sizeof(buf), "W%02x", code);

void gdb_exit(CPUState *env, int code)

{

  GDBState *s;

  char buf[4];

  s = &gdbserver_state;

  if (gdbserver_fd < 0 || s->fd < 0)

    return;

  snprintf(buf, sizeof(buf), "W%02x", code);

  put_packet(s, buf);

}


--- a/source.c
+++ b/source.c
@@ -11,7 +11,7 @@
         vnc_dpy_resize(vd->ds);

         vnc_refresh(vd);
+
+    }
+
+}

static void vnc_init_timer(VncDisplay *vd)

{

    vd->timer_interval = VNC_REFRESH_INTERVAL_BASE;

    if (vd->timer == NULL && !QTAILQ_EMPTY(&vd->clients)) {

        vd->timer = qemu_new_timer(rt_clock, vnc_refresh, vd);

        vnc_dpy_resize(vd->ds);

        vnc_refresh(vd);

    }

}


--- a/source.c
+++ b/source.c
@@ -24,9 +24,9 @@
     d->length = o->stat.st_size;

     d->alloc  = 512;
+
+    d->data   = g_malloc(d->alloc);
+
+    return d;
+
 }

static MTPData *usb_mtp_get_object(MTPState *s, MTPControl *c,

                                   MTPObject *o)

{

    MTPData *d = usb_mtp_data_alloc(c);

    trace_usb_mtp_op_get_object(s->dev.addr, o->handle, o->path);

    d->fd = open(o->path, O_RDONLY);

    if (d->fd == -1) {

        return NULL;

    }

    d->length = o->stat.st_size;

    d->alloc  = 512;

    d->data   = g_malloc(d->alloc);

    return d;

}


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

 {

+    return timerlist_run_timers(main_loop_tlg.tl[type]);

 }

bool qemu_clock_run_timers(QEMUClockType type)

{

    return timerlist_run_timers(main_loop_tlg.tl[type]);

}


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

     }

+
+
+    memory_region_init_alias(&nvdimm->nvdimm_mr, OBJECT(dimm),
+
+                             "nvdimm-memory", mr, 0, pmem_size);

     nvdimm->nvdimm_mr.align = align;

static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp)

{

    MemoryRegion *mr = host_memory_backend_get_memory(dimm->hostmem, errp);

    NVDIMMDevice *nvdimm = NVDIMM(dimm);

    uint64_t align, pmem_size, size = memory_region_size(mr);

    align = memory_region_get_alignment(mr);

    pmem_size = size - nvdimm->label_size;

    nvdimm->label_data = memory_region_get_ram_ptr(mr) + pmem_size;

    pmem_size = QEMU_ALIGN_DOWN(pmem_size, align);

    if (size <= nvdimm->label_size || !pmem_size) {

        HostMemoryBackend *hostmem = dimm->hostmem;

        char *path = object_get_canonical_path_component(OBJECT(hostmem));

        error_setg(errp, "the size of memdev %s (0x%" PRIx64 ") is too "

                   "small to contain nvdimm label (0x%" PRIx64 ") and "

                   "aligned PMEM (0x%" PRIx64 ")",

                   path, memory_region_size(mr), nvdimm->label_size, align);

        return;

    }

    memory_region_init_alias(&nvdimm->nvdimm_mr, OBJECT(dimm),

                             "nvdimm-memory", mr, 0, pmem_size);

    nvdimm->nvdimm_mr.align = align;

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     mmu_idx = cpu_mmu_index(env);

     index = (virtaddr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
+
+ redo:
+
+    tlb_addr = env->tlb_table[mmu_idx][index].addr_write;
+
     if ((virtaddr & TARGET_PAGE_MASK) ==

         (tlb_addr & (TARGET_PAGE_MASK | TLB_INVALID_MASK))) {

uint64_t helper_st_virt_to_phys (uint64_t virtaddr)

{

    uint64_t tlb_addr, physaddr;

    int index, mmu_idx;

    void *retaddr;

    mmu_idx = cpu_mmu_index(env);

    index = (virtaddr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);

 redo:

    tlb_addr = env->tlb_table[mmu_idx][index].addr_write;

    if ((virtaddr & TARGET_PAGE_MASK) ==

        (tlb_addr & (TARGET_PAGE_MASK | TLB_INVALID_MASK))) {

        physaddr = virtaddr + env->tlb_table[mmu_idx][index].addend;

    } else {

        /* the page is not in the TLB : fill it */

        retaddr = GETPC();

        tlb_fill(virtaddr, 1, mmu_idx, retaddr);

        goto redo;

    }

    return physaddr;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 SDState *sd_init(BlockDriverState *bs, bool is_spi)

+{

     SDState *sd;

SDState *sd_init(BlockDriverState *bs, bool is_spi)

{

    SDState *sd;

    if (bdrv_is_read_only(bs)) {

        fprintf(stderr, "sd_init: Cannot use read-only drive\n");

        return NULL;

    }

    sd = (SDState *) g_malloc0(sizeof(SDState));

    sd->buf = qemu_blockalign(bs, 512);

    sd->spi = is_spi;

    sd->enable = true;

    sd_reset(sd, bs);

    if (sd->bdrv) {

        bdrv_attach_dev_nofail(sd->bdrv, sd);

        bdrv_set_dev_ops(sd->bdrv, &sd_block_ops, sd);

    }

    vmstate_register(NULL, -1, &sd_vmstate, sd);

    return sd;

}


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

             uint64_t min1v = h[0].val;

+            up[h[0].name] = next;
+
+            h[0].val = INT64_MAX;
+
+            heap_sift(h, 0, size);

             up[h[0].name] = next;

static void generate_len_table(uint8_t *dst, uint64_t *stats, int size){

    heap_elem_t h[size];

    int up[2*size];

    int len[2*size];

    int offset, i, next;

    for(offset=1; ; offset<<=1){

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

            h[i].name = i;

            h[i].val = (stats[i] << 8) + offset;

        }

        for(i=size/2-1; i>=0; i--)

            heap_sift(h, i, size);

        for(next=size; next<size*2-1; next++){

            // merge the two smallest entries, and put it back in the heap

            uint64_t min1v = h[0].val;

            up[h[0].name] = next;

            h[0].val = INT64_MAX;

            heap_sift(h, 0, size);

            up[h[0].name] = next;

            h[0].name = next;

            h[0].val += min1v;

            heap_sift(h, 0, size);

        }

        len[2*size-2] = 0;

        for(i=2*size-3; i>=size; i--)

            len[i] = len[up[i]] + 1;

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

            dst[i] = len[up[i]] + 1;

            if(dst[i] > 32) break;

        }

        if(i==size) break;

    }

}


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

     fail_unless(qobject_to_qdict(QOBJECT(tests_dict)) == tests_dict);

START_TEST(qobject_to_qdict_test)

{

    fail_unless(qobject_to_qdict(QOBJECT(tests_dict)) == tests_dict);

}


--- a/source.c
+++ b/source.c
@@ -43,10 +43,10 @@
                 goto fail;
             av_set_pts_info(st, 64, framerate.den, framerate.num);
             st->codec->width  = width;
+            st->codec->height = height;
+            st->codec->pix_fmt = pix_fmt;
+fail:
+            return ret;
+        default:
             return -1;
     return 0;

int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
    AVStream *st;
    enum CodecID id;
    st = avformat_new_stream(s, NULL);
    if (!st)
        return AVERROR(ENOMEM);
        id = s->iformat->value;
        if (id == CODEC_ID_RAWVIDEO) {
            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
        } else {
            st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
        st->codec->codec_id = id;
        switch(st->codec->codec_type) {
        case AVMEDIA_TYPE_AUDIO: {
            RawAudioDemuxerContext *s1 = s->priv_data;
            st->codec->channels = 1;
            if (id == CODEC_ID_ADPCM_G722)
                st->codec->sample_rate = 16000;
            if (s1 && s1->sample_rate)
                st->codec->sample_rate = s1->sample_rate;
            if (s1 && s1->channels)
                st->codec->channels    = s1->channels;
            st->codec->bits_per_coded_sample = av_get_bits_per_sample(st->codec->codec_id);
            assert(st->codec->bits_per_coded_sample > 0);
            st->codec->block_align = st->codec->bits_per_coded_sample*st->codec->channels/8;
            av_set_pts_info(st, 64, 1, st->codec->sample_rate);
            break;
        case AVMEDIA_TYPE_VIDEO: {
            FFRawVideoDemuxerContext *s1 = s->priv_data;
            int width = 0, height = 0, ret = 0;
            enum PixelFormat pix_fmt;
            AVRational framerate;
            if (s1->video_size && (ret = av_parse_video_size(&width, &height, s1->video_size)) < 0) {
                av_log(s, AV_LOG_ERROR, "Couldn't parse video size.\n");
                goto fail;
            if ((pix_fmt = av_get_pix_fmt(s1->pixel_format)) == PIX_FMT_NONE) {
                av_log(s, AV_LOG_ERROR, "No such pixel format: %s.\n", s1->pixel_format);
                ret = AVERROR(EINVAL);
                goto fail;
            if ((ret = av_parse_video_rate(&framerate, s1->framerate)) < 0) {
                av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s1->framerate);
                goto fail;
            av_set_pts_info(st, 64, framerate.den, framerate.num);
            st->codec->width  = width;
            st->codec->height = height;
            st->codec->pix_fmt = pix_fmt;
fail:
            return ret;
        default:
            return -1;
    return 0;


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

                                          ptrdiff_t stride)

+{
+
+    int x, y;
+
+    pixel *dst = (pixel *)_dst;

static void FUNC(transquant_bypass32x32)(uint8_t *_dst, int16_t *coeffs,

                                         ptrdiff_t stride)

{

    int x, y;

    pixel *dst = (pixel *)_dst;

    stride /= sizeof(pixel);

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

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

            dst[x] += *coeffs;

            coeffs++;

        }

        dst += stride;

    }

}


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

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

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

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

{

    int i, idx = 0, sum = 0;

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

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

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

        sum += FFABS(y[i]);

    }

    av_assert0(sum == K);

    return idx;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static inline int get_len(LZOContext *c, int x, int mask)

 {
+
     int cnt = x & mask;

     if (!cnt) {

static inline int get_len(LZOContext *c, int x, int mask)

{

    int cnt = x & mask;

    if (!cnt) {

        while (!(x = get_byte(c)))

            cnt += 255;

        cnt += mask + x;

    }

    return cnt;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static inline int64_t bs_get_v(const uint8_t **bs)
+
 {

     int64_t v = 0;

static inline int64_t bs_get_v(const uint8_t **bs)

{

    int64_t v = 0;

    int br = 0;

    int c;

    do {

        c = **bs; (*bs)++;

        v <<= 7;

        v |= c & 0x7F;

        br++;

        if (br > 10)

            return -1;

    } while (c & 0x80);

    return v - br;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static const char *local_mapped_attr_path(FsContext *ctx,

+                                          const char *path, char *buffer)

 {

     char *dir_name;
+
     char *tmp_path = strdup(path);

     char *base_name = basename(tmp_path);

static const char *local_mapped_attr_path(FsContext *ctx,

                                          const char *path, char *buffer)

{

    char *dir_name;

    char *tmp_path = strdup(path);

    char *base_name = basename(tmp_path);

    /* NULL terminate the directory */

    dir_name = tmp_path;

    *(base_name - 1) = '\0';

    snprintf(buffer, PATH_MAX, "%s/%s/%s/%s",

             ctx->fs_root, dir_name, VIRTFS_META_DIR, base_name);

    free(tmp_path);

    return buffer;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+int virtio_bus_device_plugged(VirtIODevice *vdev)

 {

@@ -6,11 +6,11 @@

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

+    VirtioBusState *bus = VIRTIO_BUS(qbus);

     VirtioBusClass *klass = VIRTIO_BUS_GET_CLASS(bus);

+    VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev);

int virtio_bus_device_plugged(VirtIODevice *vdev)

{

    DeviceState *qdev = DEVICE(vdev);

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

    VirtioBusState *bus = VIRTIO_BUS(qbus);

    VirtioBusClass *klass = VIRTIO_BUS_GET_CLASS(bus);

    VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev);

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

    if (klass->device_plugged != NULL) {

        klass->device_plugged(qbus->parent);

    }

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

    assert(vdc->get_features != NULL);

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

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_t *dst, int stride,

                              const uint8_t *table)

static void ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_t *dst, int stride,

                             const uint8_t *table)

{

    int j;

    int out = 0;

    int c;

    int t;

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

        out = 0;

        while (out < width){

            c = ir2_get_code(&ctx->gb);

            if(c > 0x80) { /* we have a skip */

                c -= 0x80;

                out += c * 2;

            } else { /* add two deltas from table */

                t = dst[out] + (table[c * 2] - 128);

                CLAMP_TO_BYTE(t);

                dst[out] = t;

                out++;

                t = dst[out] + (table[(c * 2) + 1] - 128);

                CLAMP_TO_BYTE(t);

                dst[out] = t;

                out++;

            }

        }

        dst += stride;

    }

}


static void virtio_blk_dma_restart_cb(void *opaque, int running,

                                      RunState state)

{

    VirtIOBlock *s = opaque;

    if (!running) {

        return;

    }

    if (!s->bh) {

        s->bh = qemu_bh_new(virtio_blk_dma_restart_bh, s);

        qemu_bh_schedule(s->bh);

    }

}


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

         dexp[i++] = ungroup_3_in_7_bits_tab[expacc][0];

+        dexp[i++] = ungroup_3_in_7_bits_tab[expacc][1];
+
+        dexp[i++] = ungroup_3_in_7_bits_tab[expacc][2];
+
+    }

static int decode_exponents(GetBitContext *gbc, int exp_strategy, int ngrps,

                            uint8_t absexp, int8_t *dexps)

{

    int i, j, grp, group_size;

    int dexp[256];

    int expacc, prevexp;

    /* unpack groups */

    group_size = exp_strategy + (exp_strategy == EXP_D45);

    for(grp=0,i=0; grp<ngrps; grp++) {

        expacc = get_bits(gbc, 7);

        dexp[i++] = ungroup_3_in_7_bits_tab[expacc][0];

        dexp[i++] = ungroup_3_in_7_bits_tab[expacc][1];

        dexp[i++] = ungroup_3_in_7_bits_tab[expacc][2];

    }

    /* convert to absolute exps and expand groups */

    prevexp = absexp;

    for(i=0,j=0; i<ngrps*3; i++) {

        prevexp += dexp[i] - 2;

        if (prevexp < 0 || prevexp > 24)

            return -1;

        switch (group_size) {

            case 4: dexps[j++] = prevexp;

                    dexps[j++] = prevexp;

            case 2: dexps[j++] = prevexp;

            case 1: dexps[j++] = prevexp;

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
         DPRINTF("Unable to set nonblocking mode on file descriptor\n");

         goto err_after_open;
+
+    }
+
+
+
     s->get_error = fd_errno;

     s->write = fd_write;

int fd_start_outgoing_migration(MigrationState *s, const char *fdname)

{

    s->fd = monitor_get_fd(s->mon, fdname);

    if (s->fd == -1) {

        DPRINTF("fd_migration: invalid file descriptor identifier\n");

        goto err_after_get_fd;

    }

    if (fcntl(s->fd, F_SETFL, O_NONBLOCK) == -1) {

        DPRINTF("Unable to set nonblocking mode on file descriptor\n");

        goto err_after_open;

    }

    s->get_error = fd_errno;

    s->write = fd_write;

    s->close = fd_close;

    migrate_fd_connect(s);

    return 0;

err_after_open:

    close(s->fd);

err_after_get_fd:

    return -1;

}


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

     asf->last_indexed_pts = 0;

+    asf->index_ptr = (ASFIndex*)av_malloc( sizeof(ASFIndex) * ASF_INDEX_BLOCK );
+
+    asf->nb_index_memory_alloc = ASF_INDEX_BLOCK;
+
+    asf->nb_index_count = 0;

     asf->maximum_packet = 0;

static int asf_write_header(AVFormatContext *s)

{

    ASFContext *asf = s->priv_data;

    asf->packet_size = PACKET_SIZE;

    asf->nb_packets = 0;

    asf->last_indexed_pts = 0;

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

    asf->nb_index_memory_alloc = ASF_INDEX_BLOCK;

    asf->nb_index_count = 0;

    asf->maximum_packet = 0;

    /* the data-chunk-size has to be 50, which is data_size - asf->data_offset

     *  at the moment this function is done. It is needed to use asf as

     *  streamable format. */

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

        //av_free(asf);

        return -1;

    }

    put_flush_packet(s->pb);

    asf->packet_nb_payloads = 0;

    asf->packet_timestamp_start = -1;

    asf->packet_timestamp_end = -1;

    init_put_byte(&asf->pb, asf->packet_buf, asf->packet_size, 1,

                  NULL, NULL, NULL, NULL);

    return 0;

}


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

     AVDictionaryEntry *tag = NULL;

+    char val_str[128];
+
+    int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1;
+
+

     print_format_entry(NULL, "[FORMAT]");

static void show_format(AVFormatContext *fmt_ctx)

{

    AVDictionaryEntry *tag = NULL;

    char val_str[128];

    int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1;

    print_format_entry(NULL, "[FORMAT]");

    print_format_entry("filename",         fmt_ctx->filename);

    snprintf(val_str, sizeof(val_str) - 1, "%d", fmt_ctx->nb_streams);

    print_format_entry("nb_streams",       val_str);

    print_format_entry("format_name",      fmt_ctx->iformat->name);

    print_format_entry("format_long_name", fmt_ctx->iformat->long_name);

    print_format_entry("start_time",

                       time_value_string(val_str, sizeof(val_str),

                                         fmt_ctx->start_time, &AV_TIME_BASE_Q));

    print_format_entry("duration",

                       time_value_string(val_str, sizeof(val_str),

                                         fmt_ctx->duration, &AV_TIME_BASE_Q));

    print_format_entry("size",

                       size >= 0 ? value_string(val_str, sizeof(val_str),

                                                size, unit_byte_str)

                                  : "unknown");

    print_format_entry("bit_rate",

                       value_string(val_str, sizeof(val_str),

                                    fmt_ctx->bit_rate, unit_bit_per_second_str));

    while ((tag = av_dict_get(fmt_ctx->metadata, "", tag,

                              AV_DICT_IGNORE_SUFFIX))) {

        snprintf(val_str, sizeof(val_str) - 1, "TAG:%s", tag->key);

        print_format_entry(val_str, tag->value);

    }

    print_format_entry(NULL, "[/FORMAT]");

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void gif_fill_rect(AVFrame *picture, uint32_t color, int l, int t, int w, int h)

 {
+
     const int linesize = picture->linesize[0] / sizeof(uint32_t);

     const uint32_t *py = (uint32_t *)picture->data[0] + t * linesize;

static void gif_fill_rect(AVFrame *picture, uint32_t color, int l, int t, int w, int h)

{

    const int linesize = picture->linesize[0] / sizeof(uint32_t);

    const uint32_t *py = (uint32_t *)picture->data[0] + t * linesize;

    const uint32_t *pr, *pb = py + (t + h) * linesize;

    uint32_t *px;

    for (; py < pb; py += linesize) {

        px = (uint32_t *)py + l;

        pr = px + w;

        for (; px < pr; px++)

            *px = color;

    }

}


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

+    tb = env->current_tb;
+
+    /* if the cpu is currently executing code, we must unlink it and
+
+       all the potentially executing TB */

     if (tb && !testandset(&interrupt_lock)) {

static void cpu_unlink_tb(CPUState *env)

{

#if defined(CONFIG_USE_NPTL)

    /* FIXME: TB unchaining isn't SMP safe.  For now just ignore the

       problem and hope the cpu will stop of its own accord.  For userspace

       emulation this often isn't actually as bad as it sounds.  Often

       signals are used primarily to interrupt blocking syscalls.  */

#else

    TranslationBlock *tb;

    static spinlock_t interrupt_lock = SPIN_LOCK_UNLOCKED;

    tb = env->current_tb;

    /* if the cpu is currently executing code, we must unlink it and

       all the potentially executing TB */

    if (tb && !testandset(&interrupt_lock)) {

        env->current_tb = NULL;

        tb_reset_jump_recursive(tb);

        resetlock(&interrupt_lock);

    }

#endif

}


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

        return sys;

+
+
+   return NULL;
+
+}

const DVprofile* avpriv_dv_frame_profile(const DVprofile *sys,

                                  const uint8_t* frame, unsigned buf_size)

{

   int i;

   int dsf = (frame[3] & 0x80) >> 7;

   int stype = frame[80*5 + 48 + 3] & 0x1f;

   /* 576i50 25Mbps 4:1:1 is a special case */

   if (dsf == 1 && stype == 0 && frame[4] & 0x07 /* the APT field */) {

       return &dv_profiles[2];

   }

   for (i=0; i<FF_ARRAY_ELEMS(dv_profiles); i++)

       if (dsf == dv_profiles[i].dsf && stype == dv_profiles[i].video_stype)

           return &dv_profiles[i];

   /* check if old sys matches and assumes corrupted input */

   if (sys && buf_size == sys->frame_size)

       return sys;

   return NULL;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     ssize_t ret = qemu_paio_return(aiocb);

+
+    if (ret < 0)
+
+        ret = -ret;
+
     else

         ret = 0;

int qemu_paio_error(struct qemu_paiocb *aiocb)

{

    ssize_t ret = qemu_paio_return(aiocb);

    if (ret < 0)

        ret = -ret;

    else

        ret = 0;

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void cris_alu(DisasContext *dc, int op,

+			       TCGv d, TCGv op_a, TCGv op_b, int size)
+
+{
+
+	TCGv tmp;

 	int writeback;

static void cris_alu(DisasContext *dc, int op,

			       TCGv d, TCGv op_a, TCGv op_b, int size)

{

	TCGv tmp;

	int writeback;

	writeback = 1;

	if (op == CC_OP_BOUND || op == CC_OP_BTST)

		tmp = tcg_temp_local_new(TCG_TYPE_TL);

	if (op == CC_OP_CMP) {

		tmp = tcg_temp_new(TCG_TYPE_TL);

		writeback = 0;

	} else if (size == 4) {

		tmp = d;

		writeback = 0;

	} else

		tmp = tcg_temp_new(TCG_TYPE_TL);

	cris_pre_alu_update_cc(dc, op, op_a, op_b, size);

	cris_alu_op_exec(dc, op, tmp, op_a, op_b, size);

	cris_update_result(dc, tmp);

	/* Writeback.  */

	if (writeback) {

		if (size == 1)

			tcg_gen_andi_tl(d, d, ~0xff);

		else

			tcg_gen_andi_tl(d, d, ~0xffff);

		tcg_gen_or_tl(d, d, tmp);

	}

	if (GET_TCGV(tmp) != GET_TCGV(d))

		tcg_temp_free(tmp);

}


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

+    blankbuf = g_malloc(512);

     tmpbuf = g_malloc(512);
+
     memset(blankbuf, 0xff, 512);

     for (; num > 0; num--, sec++) {
+
         if (s->blk_cur) {

             int erasesec = s->secs_cur + (sec >> 5);

static inline int onenand_erase(OneNANDState *s, int sec, int num)

{

    uint8_t *blankbuf, *tmpbuf;

    blankbuf = g_malloc(512);

    tmpbuf = g_malloc(512);

    memset(blankbuf, 0xff, 512);

    for (; num > 0; num--, sec++) {

        if (s->blk_cur) {

            int erasesec = s->secs_cur + (sec >> 5);

            if (blk_write(s->blk_cur, sec, blankbuf, 1) < 0) {

                goto fail;

            }

            if (blk_read(s->blk_cur, erasesec, tmpbuf, 1) < 0) {

                goto fail;

            }

            memcpy(tmpbuf + ((sec & 31) << 4), blankbuf, 1 << 4);

            if (blk_write(s->blk_cur, erasesec, tmpbuf, 1) < 0) {

                goto fail;

            }

        } else {

            if (sec + 1 > s->secs_cur) {

                goto fail;

            }

            memcpy(s->current + (sec << 9), blankbuf, 512);

            memcpy(s->current + (s->secs_cur << 9) + (sec << 4),

                   blankbuf, 1 << 4);

        }

    }

    g_free(tmpbuf);

    g_free(blankbuf);

    return 0;

fail:

    g_free(tmpbuf);

    g_free(blankbuf);

    return 1;

}


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

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

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

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

{

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

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

    regs->ARM_cpsr = 0x10;

    regs->ARM_pc = infop->entry;

    regs->ARM_sp = infop->start_stack;

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

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

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

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

}


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

         return;

+    }
+
+    len = r->io_header.dxfer_len - r->io_header.resid;
+
+    DPRINTF("Data ready tag=0x%x len=%d\n", r->req.tag, len);

static void scsi_read_complete(void * opaque, int ret)

{

    SCSIGenericReq *r = (SCSIGenericReq *)opaque;

    SCSIDevice *s = r->req.dev;

    int len;

    r->req.aiocb = NULL;

    if (ret || r->req.io_canceled) {

        scsi_command_complete(r, ret);

        return;

    }

    len = r->io_header.dxfer_len - r->io_header.resid;

    DPRINTF("Data ready tag=0x%x len=%d\n", r->req.tag, len);

    r->len = -1;

    if (len == 0) {

        scsi_command_complete(r, 0);

    } else {

        /* Snoop READ CAPACITY output to set the blocksize.  */

        if (r->req.cmd.buf[0] == READ_CAPACITY_10 &&

            (ldl_be_p(&r->buf[0]) != 0xffffffffU || s->max_lba == 0)) {

            s->blocksize = ldl_be_p(&r->buf[4]);

            s->max_lba = ldl_be_p(&r->buf[0]) & 0xffffffffULL;

        } else if (r->req.cmd.buf[0] == SERVICE_ACTION_IN_16 &&

                   (r->req.cmd.buf[1] & 31) == SAI_READ_CAPACITY_16) {

            s->blocksize = ldl_be_p(&r->buf[8]);

            s->max_lba = ldq_be_p(&r->buf[0]);

        }

        bdrv_set_guest_block_size(s->conf.bs, s->blocksize);

        scsi_req_data(&r->req, len);

        scsi_req_unref(&r->req);

    }

}


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

     UnsharpContext *unsharp = ctx->priv;

+    int lmsize_x = 5, cmsize_x = 0;

     int lmsize_y = 5, cmsize_y = 0;

static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)

{

    UnsharpContext *unsharp = ctx->priv;

    int lmsize_x = 5, cmsize_x = 0;

    int lmsize_y = 5, cmsize_y = 0;

    double lamount = 1.0f, camount = 0.0f;

    if (args)

        sscanf(args, "%d:%d:%lf:%d:%d:%lf", &lmsize_x, &lmsize_y, &lamount,

                                            &cmsize_x, &cmsize_y, &camount);

    if (lmsize_x < 2 || lmsize_y < 2 || cmsize_x < 2 || cmsize_y < 2) {

        av_log(ctx, AV_LOG_ERROR,

               "Invalid value <2 for lmsize_x:%d or lmsize_y:%d or cmsize_x:%d or cmsize_y:%d\n",

               lmsize_x, lmsize_y, cmsize_x, cmsize_y);

        return AVERROR(EINVAL);

    }

    set_filter_param(&unsharp->luma,   lmsize_x, lmsize_y, lamount);

    set_filter_param(&unsharp->chroma, cmsize_x, cmsize_y, camount);

    return 0;

}


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

     BlockDriverInfo bdi;

+
+
+    if (bs->backing_hd) {
+
+        return false;

     }

bool bdrv_unallocated_blocks_are_zero(BlockDriverState *bs)

{

    BlockDriverInfo bdi;

    if (bs->backing_hd) {

        return false;

    }

    if (bdrv_get_info(bs, &bdi) == 0) {

        return bdi.unallocated_blocks_are_zero;

    }

    return false;

}


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

     if (tcet->nb_table) {

+        error_report("Warning: trying to enable already enabled TCE table");
+
+        return;
+
+    }

void spapr_tce_table_enable(sPAPRTCETable *tcet,

                            uint32_t page_shift, uint64_t bus_offset,

                            uint32_t nb_table)

{

    if (tcet->nb_table) {

        error_report("Warning: trying to enable already enabled TCE table");

        return;

    }

    tcet->bus_offset = bus_offset;

    tcet->page_shift = page_shift;

    tcet->nb_table = nb_table;

    tcet->table = spapr_tce_alloc_table(tcet->liobn,

                                        tcet->page_shift,

                                        tcet->bus_offset,

                                        tcet->nb_table,

                                        &tcet->fd,

                                        tcet->need_vfio);

    memory_region_set_size(&tcet->iommu,

                           (uint64_t)tcet->nb_table << tcet->page_shift);

    memory_region_add_subregion(&tcet->root, tcet->bus_offset, &tcet->iommu);

}


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

+{

 #if defined(CONFIG_USER_ONLY)

static void gen_msgclr(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    GEN_PRIV;

#else

    CHK_SV;

    gen_helper_msgclr(cpu_env, cpu_gpr[rB(ctx->opcode)]);

#endif /* defined(CONFIG_USER_ONLY) */

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 ssize_t vnc_client_read_buf(VncState *vs, uint8_t *data, size_t datalen)

+{
+
     ssize_t ret;

 #ifdef CONFIG_VNC_TLS

+    if (vs->tls.session) {

         ret = vnc_client_read_tls(&vs->tls.session, data, datalen);

ssize_t vnc_client_read_buf(VncState *vs, uint8_t *data, size_t datalen)

{

    ssize_t ret;

#ifdef CONFIG_VNC_TLS

    if (vs->tls.session) {

        ret = vnc_client_read_tls(&vs->tls.session, data, datalen);

    } else {

#endif /* CONFIG_VNC_TLS */

        ret = qemu_recv(vs->csock, data, datalen, 0);

#ifdef CONFIG_VNC_TLS

    }

#endif /* CONFIG_VNC_TLS */

    VNC_DEBUG("Read wire %p %zd -> %ld\n", data, datalen, ret);

    return vnc_client_io_error(vs, ret, socket_error());

}