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

     qemu_file_set_blocking(mis->from_src_file, true);

+
+
+    /* TODO: COLO checkpoint restore loop */
+
+

 out:

void *colo_process_incoming_thread(void *opaque)

{

    MigrationIncomingState *mis = opaque;

    migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,

                      MIGRATION_STATUS_COLO);

    mis->to_src_file = qemu_file_get_return_path(mis->from_src_file);

    if (!mis->to_src_file) {

        error_report("COLO incoming thread: Open QEMUFile to_src_file failed");

        goto out;

    }

    /*

     * Note: the communication between Primary side and Secondary side

     * should be sequential, we set the fd to unblocked in migration incoming

     * coroutine, and here we are in the COLO incoming thread, so it is ok to

     * set the fd back to blocked.

     */

    qemu_file_set_blocking(mis->from_src_file, true);

    /* TODO: COLO checkpoint restore loop */

out:

    if (mis->to_src_file) {

        qemu_fclose(mis->to_src_file);

    }

    migration_incoming_exit_colo();

    return NULL;

}


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

     qemu_mutex_lock(&v9fs_synth_mutex);
+
+    QLIST_FOREACH(tmp, &parent->child, sibling) {
+
+        if (!strcmp(tmp->name, name)) {
+
             ret = EEXIST;

             goto err_out;

int qemu_v9fs_synth_mkdir(V9fsSynthNode *parent, int mode,

                          const char *name, V9fsSynthNode **result)

{

    int ret;

    V9fsSynthNode *node, *tmp;

    if (!v9fs_synth_fs) {

        return EAGAIN;

    }

    if (!name || (strlen(name) >= NAME_MAX)) {

        return EINVAL;

    }

    if (!parent) {

        parent = &v9fs_synth_root;

    }

    qemu_mutex_lock(&v9fs_synth_mutex);

    QLIST_FOREACH(tmp, &parent->child, sibling) {

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

            ret = EEXIST;

            goto err_out;

        }

    }

    /* Add the name */

    node = v9fs_add_dir_node(parent, mode, name, NULL, v9fs_synth_node_count++);

    v9fs_add_dir_node(node, parent->attr->mode, "..",

                      parent->attr, parent->attr->inode);

    v9fs_add_dir_node(node, node->attr->mode, ".",

                      node->attr, node->attr->inode);

    *result = node;

    ret = 0;

err_out:

    qemu_mutex_unlock(&v9fs_synth_mutex);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -5,5 +5,5 @@
     cpu_abort(env, "cp15 insn %08x\n", insn);

     return 0;
+
+}

uint32_t HELPER(get_cp15)(CPUState *env, uint32_t insn)

{

    cpu_abort(env, "cp15 insn %08x\n", insn);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
     tm.tm_mon = rtas_ld(args, 1) - 1;

     tm.tm_mday = rtas_ld(args, 2);
+
+    tm.tm_hour = rtas_ld(args, 3);
+
+    tm.tm_min = rtas_ld(args, 4);
+
     tm.tm_sec = rtas_ld(args, 5);

static void rtas_set_time_of_day(sPAPREnvironment *spapr,

                                 uint32_t token, uint32_t nargs,

                                 target_ulong args,

                                 uint32_t nret, target_ulong rets)

{

    struct tm tm;

    tm.tm_year = rtas_ld(args, 0) - 1900;

    tm.tm_mon = rtas_ld(args, 1) - 1;

    tm.tm_mday = rtas_ld(args, 2);

    tm.tm_hour = rtas_ld(args, 3);

    tm.tm_min = rtas_ld(args, 4);

    tm.tm_sec = rtas_ld(args, 5);

    /* Just generate a monitor event for the change */

    rtc_change_mon_event(&tm);

    spapr->rtc_offset = qemu_timedate_diff(&tm);

    rtas_st(rets, 0, 0); /* Success */

}


--- a/source.c
+++ b/source.c
@@ -1,19 +1,19 @@
+static int arm_gic_init(SysBusDevice *dev)

+{

+    /* Device instance init function for the GIC sysbus device */

     int i;

     GICState *s = FROM_SYSBUS(GICState, dev);

     ARMGICClass *agc = ARM_GIC_GET_CLASS(s);
+

+
     agc->parent_init(dev);
+

     gic_init_irqs_and_distributor(s, s->num_irq);

static int arm_gic_init(SysBusDevice *dev)

{

    /* Device instance init function for the GIC sysbus device */

    int i;

    GICState *s = FROM_SYSBUS(GICState, dev);

    ARMGICClass *agc = ARM_GIC_GET_CLASS(s);

    agc->parent_init(dev);

    gic_init_irqs_and_distributor(s, s->num_irq);

    /* Memory regions for the CPU interfaces (NVIC doesn't have these):

     * a region for "CPU interface for this core", then a region for

     * "CPU interface for core 0", "for core 1", ...

     * NB that the memory region size of 0x100 applies for the 11MPCore

     * and also cores following the GIC v1 spec (ie A9).

     * GIC v2 defines a larger memory region (0x1000) so this will need

     * to be extended when we implement A15.

     */

    memory_region_init_io(&s->cpuiomem[0], &gic_thiscpu_ops, s,

                          "gic_cpu", 0x100);

    for (i = 0; i < NUM_CPU(s); i++) {

        s->backref[i] = s;

        memory_region_init_io(&s->cpuiomem[i+1], &gic_cpu_ops, &s->backref[i],

                              "gic_cpu", 0x100);

    }

    /* Distributor */

    sysbus_init_mmio(dev, &s->iomem);

    /* cpu interfaces (one for "current cpu" plus one per cpu) */

    for (i = 0; i <= NUM_CPU(s); i++) {

        sysbus_init_mmio(dev, &s->cpuiomem[i]);

    }

    return 0;

}


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

     if (adts->write_adts) {

+        ff_adts_write_frame_header(adts, buf, pkt->size, adts->pce_size);
+
+        avio_write(pb, buf, ADTS_HEADER_SIZE);
+
+        if (adts->pce_size) {

             avio_write(pb, adts->pce_data, adts->pce_size);

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

{

    ADTSContext *adts = s->priv_data;

    AVIOContext *pb = s->pb;

    uint8_t buf[ADTS_HEADER_SIZE];

    if (!pkt->size)

        return 0;

    if (adts->write_adts) {

        ff_adts_write_frame_header(adts, buf, pkt->size, adts->pce_size);

        avio_write(pb, buf, ADTS_HEADER_SIZE);

        if (adts->pce_size) {

            avio_write(pb, adts->pce_data, adts->pce_size);

            adts->pce_size = 0;

        }

    }

    avio_write(pb, pkt->data, pkt->size);

    avio_flush(pb);

    return 0;

}


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

     return net_tx_pkt_parse_headers(pkt) &&
+
+           net_tx_pkt_rebuild_payload(pkt);

 }

bool net_tx_pkt_parse(struct NetTxPkt *pkt)

{

    return net_tx_pkt_parse_headers(pkt) &&

           net_tx_pkt_rebuild_payload(pkt);

}


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

     uint64_t res;
+
     uint64_t x = *data;

static inline void fimd_swap_data(unsigned int swap_ctl, uint64_t *data)

{

    int i;

    uint64_t res;

    uint64_t x = *data;

    if (swap_ctl & FIMD_WINCON_SWAP_BITS) {

        res = 0;

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

            if (x & (1ULL << (64 - i))) {

                res |= (1ULL << i);

            }

        }

        x = res;

    }

    if (swap_ctl & FIMD_WINCON_SWAP_BYTE) {

        x = bswap64(x);

    }

    if (swap_ctl & FIMD_WINCON_SWAP_HWORD) {

        x = ((x & 0x000000000000FFFFULL) << 48) |

            ((x & 0x00000000FFFF0000ULL) << 16) |

            ((x & 0x0000FFFF00000000ULL) >> 16) |

            ((x & 0xFFFF000000000000ULL) >> 48);

    }

    if (swap_ctl & FIMD_WINCON_SWAP_WORD) {

        x = ((x & 0x00000000FFFFFFFFULL) << 32) |

            ((x & 0xFFFFFFFF00000000ULL) >> 32);

    }

    *data = x;

}


void ff_h264_v_lpf_chroma_inter_msa(uint8_t *data, int img_width,

                                    int alpha, int beta, int8_t *tc)

{

    uint8_t bs0 = 1;

    uint8_t bs1 = 1;

    uint8_t bs2 = 1;

    uint8_t bs3 = 1;

    if (tc[0] < 0)

        bs0 = 0;

    if (tc[1] < 0)

        bs1 = 0;

    if (tc[2] < 0)

        bs2 = 0;

    if (tc[3] < 0)

        bs3 = 0;

    avc_loopfilter_cb_or_cr_inter_edge_hor_msa(data,

                                               bs0, bs1, bs2, bs3,

                                               tc[0], tc[1], tc[2], tc[3],

                                               alpha, beta,

                                               img_width);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     if (cpu->stop) {

         cpu->stop = false;
+
         cpu->stopped = true;

         qemu_cond_broadcast(&qemu_pause_cond);

static void qemu_wait_io_event_common(CPUState *cpu)

{

    if (cpu->stop) {

        cpu->stop = false;

        cpu->stopped = true;

        qemu_cond_broadcast(&qemu_pause_cond);

    }

    process_queued_cpu_work(cpu);

    cpu->thread_kicked = false;

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     writable_mask = reg->emu_mask & ~reg->ro_mask & valid_mask;

     cfg_entry->data = XEN_PT_MERGE_VALUE(*val, cfg_entry->data, writable_mask);
+
+    s->msi->addr_lo = cfg_entry->data;
+
+
+
     /* create value for writing to I/O device register */

     *val = XEN_PT_MERGE_VALUE(*val, dev_value, 0);

static int xen_pt_msgaddr32_reg_write(XenPCIPassthroughState *s,

                                      XenPTReg *cfg_entry, uint32_t *val,

                                      uint32_t dev_value, uint32_t valid_mask)

{

    XenPTRegInfo *reg = cfg_entry->reg;

    uint32_t writable_mask = 0;

    uint32_t old_addr = cfg_entry->data;

    /* modify emulate register */

    writable_mask = reg->emu_mask & ~reg->ro_mask & valid_mask;

    cfg_entry->data = XEN_PT_MERGE_VALUE(*val, cfg_entry->data, writable_mask);

    s->msi->addr_lo = cfg_entry->data;

    /* create value for writing to I/O device register */

    *val = XEN_PT_MERGE_VALUE(*val, dev_value, 0);

    /* update MSI */

    if (cfg_entry->data != old_addr) {

        if (s->msi->mapped) {

            xen_pt_msi_update(s);

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static GenericList *qmp_input_next_list(Visitor *v, GenericList **list,

+                                        size_t size)
+
+{
+
+    QmpInputVisitor *qiv = to_qiv(v);

     GenericList *entry;

static GenericList *qmp_input_next_list(Visitor *v, GenericList **list,

                                        size_t size)

{

    QmpInputVisitor *qiv = to_qiv(v);

    GenericList *entry;

    StackObject *so = &qiv->stack[qiv->nb_stack - 1];

    if (!so->entry) {

        return NULL;

    }

    entry = g_malloc0(size);

    if (so->first) {

        *list = entry;

        so->first = false;

    } else {

        (*list)->next = entry;

    }

    return entry;

}


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

     phys_sections_nb = 0;

static void phys_sections_clear(void)

{

    phys_sections_nb = 0;

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     uint32_t offset = find_iso_bc();

     int i;
+

     if (!offset) {
@@ -17,7 +17,7 @@
     }

+
     read_iso_sector(offset, sec, "Failed to read El Torito boot catalog");

static IsoBcSection *find_iso_bc_entry(void)

{

    IsoBcEntry *e = (IsoBcEntry *)sec;

    uint32_t offset = find_iso_bc();

    int i;

    if (!offset) {

        return NULL;

    }

    read_iso_sector(offset, sec, "Failed to read El Torito boot catalog");

    if (!is_iso_bc_valid(e)) {

        /* The validation entry is mandatory */

        virtio_panic("No valid boot catalog found!\n");

        return NULL;

    }

    /*

     * Each entry has 32 bytes size, so one sector cannot contain > 64 entries.

     * We consider only boot catalogs with no more than 64 entries.

     */

    for (i = 1; i < ISO_BC_ENTRY_PER_SECTOR; i++) {

        if (e[i].id == ISO_BC_BOOTABLE_SECTION) {

            if (is_iso_bc_entry_compatible(&e[i].body.sect)) {

                return &e[i].body.sect;

            }

        }

    }

    virtio_panic("No suitable boot entry found on ISO-9660 media!\n");

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -18,11 +18,11 @@
         ch_data->bs_var_bord[1] = get_bits(gb, 2);
         ch_data->bs_num_rel[1]  = get_bits(gb, 2);
         ch_data->bs_num_env[1]  = ch_data->bs_num_rel[1] + 1;
+        for (i = 0; i < ch_data->bs_num_rel[1]; i++)
+            ch_data->bs_rel_bord[1][i] = 2 * get_bits(gb, 2) + 2;
+        ch_data->bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env[1]]);
+        for (i = 0; i < ch_data->bs_num_env[1]; i++)
+            ch_data->bs_freq_res[ch_data->bs_num_env[1] - i] = get_bits1(gb);
         break;
     case VARFIX:
         ch_data->bs_var_bord[0] = get_bits(gb, 2);

static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
                         GetBitContext *gb, SBRData *ch_data)
{
    int i;
    ch_data->bs_freq_res[0] = ch_data->bs_freq_res[ch_data->bs_num_env[1]];
    ch_data->bs_num_env[0] = ch_data->bs_num_env[1];
    ch_data->bs_amp_res = sbr->bs_amp_res_header;
    switch (ch_data->bs_frame_class = get_bits(gb, 2)) {
    case FIXFIX:
        ch_data->bs_num_env[1] = 1 << get_bits(gb, 2);
        if (ch_data->bs_num_env[1] == 1)
            ch_data->bs_amp_res = 0;
        ch_data->bs_freq_res[1] = get_bits1(gb);
        for (i = 1; i < ch_data->bs_num_env[1]; i++)
            ch_data->bs_freq_res[i + 1] = ch_data->bs_freq_res[1];
        break;
    case FIXVAR:
        ch_data->bs_var_bord[1] = get_bits(gb, 2);
        ch_data->bs_num_rel[1]  = get_bits(gb, 2);
        ch_data->bs_num_env[1]  = ch_data->bs_num_rel[1] + 1;
        for (i = 0; i < ch_data->bs_num_rel[1]; i++)
            ch_data->bs_rel_bord[1][i] = 2 * get_bits(gb, 2) + 2;
        ch_data->bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env[1]]);
        for (i = 0; i < ch_data->bs_num_env[1]; i++)
            ch_data->bs_freq_res[ch_data->bs_num_env[1] - i] = get_bits1(gb);
        break;
    case VARFIX:
        ch_data->bs_var_bord[0] = get_bits(gb, 2);
        ch_data->bs_num_rel[0]  = get_bits(gb, 2);
        ch_data->bs_num_env[1]  = ch_data->bs_num_rel[0] + 1;
        for (i = 0; i < ch_data->bs_num_rel[0]; i++)
            ch_data->bs_rel_bord[0][i] = 2 * get_bits(gb, 2) + 2;
        ch_data->bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env[1]]);
        get_bits1_vector(gb, ch_data->bs_freq_res + 1, ch_data->bs_num_env[1]);
        break;
    case VARVAR:
        ch_data->bs_var_bord[0] = get_bits(gb, 2);
        ch_data->bs_var_bord[1] = get_bits(gb, 2);
        ch_data->bs_num_rel[0]  = get_bits(gb, 2);
        ch_data->bs_num_rel[1]  = get_bits(gb, 2);
        ch_data->bs_num_env[1]  = ch_data->bs_num_rel[0] + ch_data->bs_num_rel[1] + 1;
        for (i = 0; i < ch_data->bs_num_rel[0]; i++)
            ch_data->bs_rel_bord[0][i] = 2 * get_bits(gb, 2) + 2;
        for (i = 0; i < ch_data->bs_num_rel[1]; i++)
            ch_data->bs_rel_bord[1][i] = 2 * get_bits(gb, 2) + 2;
        ch_data->bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env[1]]);
        get_bits1_vector(gb, ch_data->bs_freq_res + 1, ch_data->bs_num_env[1]);
        break;
    }
    if (ch_data->bs_pointer > ch_data->bs_num_env[1] + 1) {
        av_log(ac->avccontext, AV_LOG_ERROR,
               "Invalid bitstream, bs_pointer points to a middle noise border outside the time borders table: %d\n",
               ch_data->bs_pointer);
        return -1;
    }
    if (ch_data->bs_frame_class == FIXFIX && ch_data->bs_num_env[1] > 4) {
        av_log(ac->avccontext, AV_LOG_ERROR,
               "Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n",
               ch_data->bs_num_env[1]);
        return -1;
    }
    if (ch_data->bs_frame_class == VARVAR && ch_data->bs_num_env[1] > 5) {
        av_log(ac->avccontext, AV_LOG_ERROR,
               "Invalid bitstream, too many SBR envelopes in VARVAR type SBR frame: %d\n",
               ch_data->bs_num_env[1]);
        return -1;
    }
    ch_data->bs_num_noise = (ch_data->bs_num_env[1] > 1) + 1;
    return 0;
}


S390PCIBusDevice *s390_pci_find_dev_by_fid(uint32_t fid)

{

    S390PCIBusDevice *pbdev;

    int i;

    S390pciState *s = s390_get_phb();

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

        pbdev = s->pbdev[i];

        if (pbdev && pbdev->fid == fid) {

            return pbdev;

        }

    }

    return NULL;

}


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

     TCGv_i32 r_asi = gen_get_asi(dc, insn);

+
+
+    gen_helper_cas_asi(dst, cpu_env, addr, val1, val2, r_asi);
+
+    tcg_temp_free_i32(r_asi);

     gen_store_gpr(dc, rd, dst);

static void gen_cas_asi(DisasContext *dc, TCGv addr, TCGv val2,

                        int insn, int rd)

{

    TCGv val1 = gen_load_gpr(dc, rd);

    TCGv dst = gen_dest_gpr(dc, rd);

    TCGv_i32 r_asi = gen_get_asi(dc, insn);

    gen_helper_cas_asi(dst, cpu_env, addr, val1, val2, r_asi);

    tcg_temp_free_i32(r_asi);

    gen_store_gpr(dc, rd, dst);

}


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

     return simple_limit(p, stride, 2*E+I)

+        && FFABS(p3-p2) <= I && FFABS(p2-p1) <= I && FFABS(p1-p0) <= I
+
+        && FFABS(q3-q2) <= I && FFABS(q2-q1) <= I && FFABS(q1-q0) <= I;

 }

static av_always_inline int normal_limit(uint8_t *p, int stride, int E, int I)

{

    LOAD_PIXELS

    return simple_limit(p, stride, 2*E+I)

        && FFABS(p3-p2) <= I && FFABS(p2-p1) <= I && FFABS(p1-p0) <= I

        && FFABS(q3-q2) <= I && FFABS(q2-q1) <= I && FFABS(q1-q0) <= I;

}


--- a/source.c
+++ b/source.c
@@ -21,10 +21,10 @@
           "hello world \"embedded string\"" },

         { "\"hello world\\nwith new line\"", "hello world\nwith new line" },
+
         { "\"single byte utf-8 \\u0020\"", "single byte utf-8  ", .skip = 1 },

+        { "\"double byte utf-8 \\u00A2\"", "double byte utf-8 \xc2\xa2" },

         { "\"triple byte utf-8 \\u20AC\"", "triple byte utf-8 \xe2\x82\xac" },

START_TEST(escaped_string)

{

    int i;

    struct {

        const char *encoded;

        const char *decoded;

        int skip;

    } test_cases[] = {

        { "\"\\\"\"", "\"" },

        { "\"hello world \\\"embedded string\\\"\"",

          "hello world \"embedded string\"" },

        { "\"hello world\\nwith new line\"", "hello world\nwith new line" },

        { "\"single byte utf-8 \\u0020\"", "single byte utf-8  ", .skip = 1 },

        { "\"double byte utf-8 \\u00A2\"", "double byte utf-8 \xc2\xa2" },

        { "\"triple byte utf-8 \\u20AC\"", "triple byte utf-8 \xe2\x82\xac" },

        {}

    };

    for (i = 0; test_cases[i].encoded; i++) {

        QObject *obj;

        QString *str;

        obj = qobject_from_json(test_cases[i].encoded);

        fail_unless(obj != NULL);

        fail_unless(qobject_type(obj) == QTYPE_QSTRING);

        str = qobject_to_qstring(obj);

        fail_unless(strcmp(qstring_get_str(str), test_cases[i].decoded) == 0);

        if (test_cases[i].skip == 0) {

            str = qobject_to_json(obj);

            fail_unless(strcmp(qstring_get_str(str), test_cases[i].encoded) == 0);

            qobject_decref(obj);

        }

        QDECREF(str);

    }

}


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

     i += split_field_half_ref_list(dest, dest_len, src + long_i,

+                                   src_len - long_i, parity);
+
+    return i;
+
+}

static int split_field_ref_list(Picture *dest, int dest_len,

                                Picture *src,  int src_len,

                                int parity,    int long_i){

    int i = split_field_half_ref_list(dest, dest_len, src, long_i, parity);

    dest += i;

    dest_len -= i;

    i += split_field_half_ref_list(dest, dest_len, src + long_i,

                                   src_len - long_i, parity);

    return i;

}


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

     qemu_mod_timer(timer->timer, qemu_get_clock(rt_clock) + ms);

+}

static void timer_start(SpiceTimer *timer, uint32_t ms)

{

    qemu_mod_timer(timer->timer, qemu_get_clock(rt_clock) + ms);

}


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

 {

+    tcg_gen_ld_tl(cpu_gpr[gprn], cpu_env, offsetof(CPUState, sdr1));

 }

static void spr_read_sdr1 (void *opaque, int gprn, int sprn)

{

    tcg_gen_ld_tl(cpu_gpr[gprn], cpu_env, offsetof(CPUState, sdr1));

}


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

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


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 size_t mptsas_config_manufacturing_1(MPTSASState *s, uint8_t **data, int address)
+
 {

     /* VPD - all zeros */

size_t mptsas_config_manufacturing_1(MPTSASState *s, uint8_t **data, int address)

{

    /* VPD - all zeros */

    return MPTSAS_CONFIG_PACK(1, MPI_CONFIG_PAGETYPE_MANUFACTURING, 0x00,

                              "s256");

}


--- a/source.c
+++ b/source.c
@@ -22,7 +22,7 @@
     } else if (strstart(uri, "fd:", &p)) {
         s = fd_start_outgoing_migration(mon, p, max_throttle, detach,
                                         blk, inc);
+#endif
     } else {
         monitor_printf(mon, "unknown migration protocol: %s\n", uri);
     if (s == NULL) {

int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
    MigrationState *s = NULL;
    const char *p;
    int detach = qdict_get_try_bool(qdict, "detach", 0);
    int blk = qdict_get_try_bool(qdict, "blk", 0);
    int inc = qdict_get_try_bool(qdict, "inc", 0);
    const char *uri = qdict_get_str(qdict, "uri");
    if (current_migration &&
        current_migration->get_status(current_migration) == MIG_STATE_ACTIVE) {
        monitor_printf(mon, "migration already in progress\n");
    if (strstart(uri, "tcp:", &p)) {
        s = tcp_start_outgoing_migration(mon, p, max_throttle, detach,
                                         blk, inc);
#if !defined(WIN32)
    } else if (strstart(uri, "exec:", &p)) {
        s = exec_start_outgoing_migration(mon, p, max_throttle, detach,
                                          blk, inc);
    } else if (strstart(uri, "unix:", &p)) {
        s = unix_start_outgoing_migration(mon, p, max_throttle, detach,
                                          blk, inc);
    } else if (strstart(uri, "fd:", &p)) {
        s = fd_start_outgoing_migration(mon, p, max_throttle, detach,
                                        blk, inc);
#endif
    } else {
        monitor_printf(mon, "unknown migration protocol: %s\n", uri);
    if (s == NULL) {
        monitor_printf(mon, "migration failed\n");
    if (current_migration) {
        current_migration->release(current_migration);
    current_migration = s;
    return 0;


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void vp8_idct_dc_add4y_c(uint8_t *dst, int16_t block[4][16],
+
+                                ptrdiff_t stride)
+
+{

     vp8_idct_dc_add_c(dst +  0, block[0], stride);

static void vp8_idct_dc_add4y_c(uint8_t *dst, int16_t block[4][16],

                                ptrdiff_t stride)

{

    vp8_idct_dc_add_c(dst +  0, block[0], stride);

    vp8_idct_dc_add_c(dst +  4, block[1], stride);

    vp8_idct_dc_add_c(dst +  8, block[2], stride);

    vp8_idct_dc_add_c(dst + 12, block[3], stride);

}


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

                                   BlockDriverState *bs,

+                                  int64_t sector_num,
+
+                                  int nb_sectors, bool is_write)
+
+{

     *req = (BdrvTrackedRequest){

static void tracked_request_begin(BdrvTrackedRequest *req,

                                  BlockDriverState *bs,

                                  int64_t sector_num,

                                  int nb_sectors, bool is_write)

{

    *req = (BdrvTrackedRequest){

        .bs = bs,

        .sector_num = sector_num,

        .nb_sectors = nb_sectors,

        .is_write = is_write,

    };

    qemu_co_queue_init(&req->wait_queue);

    QLIST_INSERT_HEAD(&bs->tracked_requests, req, list);

}


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

 {

+    VirtIOSCSI *s = container_of(bus, VirtIOSCSI, bus);
+
+
+
+    if (((s->vdev.guest_features >> VIRTIO_SCSI_F_CHANGE) & 1) &&

         (s->vdev.status & VIRTIO_CONFIG_S_DRIVER_OK) &&

static void virtio_scsi_change(SCSIBus *bus, SCSIDevice *dev, SCSISense sense)

{

    VirtIOSCSI *s = container_of(bus, VirtIOSCSI, bus);

    if (((s->vdev.guest_features >> VIRTIO_SCSI_F_CHANGE) & 1) &&

        (s->vdev.status & VIRTIO_CONFIG_S_DRIVER_OK) &&

        dev->type != TYPE_ROM) {

        virtio_scsi_push_event(s, dev, VIRTIO_SCSI_T_PARAM_CHANGE,

                               sense.asc | (sense.ascq << 8));

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void gen_logicq_cc(TCGv_i64 val)
+
 {

+    TCGv tmp = new_tmp();

     gen_helper_logicq_cc(tmp, val);

static void gen_logicq_cc(TCGv_i64 val)

{

    TCGv tmp = new_tmp();

    gen_helper_logicq_cc(tmp, val);

    gen_logic_CC(tmp);

    dead_tmp(tmp);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+void register_watchdogs(void)
+
+{

     wdt_ib700_init();

void register_watchdogs(void)

{

    wdt_ib700_init();

    wdt_i6300esb_init();

}


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

     unsigned long *bmp = pv;
+
+    int i, idx = 0;
+
+    for (i = 0; i < BITS_TO_U64S(size); i++) {
+
         uint64_t w = qemu_get_be64(f);

         bmp[idx++] = w;

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

{

    unsigned long *bmp = pv;

    int i, idx = 0;

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

        uint64_t w = qemu_get_be64(f);

        bmp[idx++] = w;

        if (sizeof(unsigned long) == 4 && idx < BITS_TO_LONGS(size)) {

            bmp[idx++] = w >> 32;

        }

    }

    return 0;

}


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

     pixel *src = (pixel*)_src;

+    int stride = _stride/sizeof(pixel);

     const int dc= (  src[-stride] + src[1-stride] + src[2-stride] + src[3-stride] + 2) >>2;

static void FUNCC(pred4x4_top_dc)(uint8_t *_src, const uint8_t *topright, int _stride){

    pixel *src = (pixel*)_src;

    int stride = _stride/sizeof(pixel);

    const int dc= (  src[-stride] + src[1-stride] + src[2-stride] + src[3-stride] + 2) >>2;

    ((pixel4*)(src+0*stride))[0]=

    ((pixel4*)(src+1*stride))[0]=

    ((pixel4*)(src+2*stride))[0]=

    ((pixel4*)(src+3*stride))[0]= PIXEL_SPLAT_X4(dc);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void next(DBDMA_channel *ch)
+
+{
+
     uint32_t cp;

static void next(DBDMA_channel *ch)

{

    uint32_t cp;

    ch->regs[DBDMA_STATUS] &= cpu_to_be32(~BT);

    cp = be32_to_cpu(ch->regs[DBDMA_CMDPTR_LO]);

    ch->regs[DBDMA_CMDPTR_LO] = cpu_to_be32(cp + sizeof(dbdma_cmd));

    dbdma_cmdptr_load(ch);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static uint32_t bonito_spciconf_readl(void *opaque, target_phys_addr_t addr)

+{
+
+    PCIBonitoState *s = opaque;
+
+    PCIDevice *d = PCI_DEVICE(s);

     PCIHostState *phb = PCI_HOST_BRIDGE(s->pcihost);

static uint32_t bonito_spciconf_readl(void *opaque, target_phys_addr_t addr)

{

    PCIBonitoState *s = opaque;

    PCIDevice *d = PCI_DEVICE(s);

    PCIHostState *phb = PCI_HOST_BRIDGE(s->pcihost);

    uint32_t pciaddr;

    uint16_t status;

    DPRINTF("bonito_spciconf_readl "TARGET_FMT_plx"\n", addr);

    assert((addr & 0x3) == 0);

    pciaddr = bonito_sbridge_pciaddr(s, addr);

    if (pciaddr == 0xffffffff) {

        return 0xffffffff;

    }

    /* set the pci address in s->config_reg */

    phb->config_reg = (pciaddr) | (1u << 31);

    /* clear PCI_STATUS_REC_MASTER_ABORT and PCI_STATUS_REC_TARGET_ABORT */

    status = pci_get_word(d->config + PCI_STATUS);

    status &= ~(PCI_STATUS_REC_MASTER_ABORT | PCI_STATUS_REC_TARGET_ABORT);

    pci_set_word(d->config + PCI_STATUS, status);

    return pci_data_read(phb->bus, phb->config_reg, 4);

}


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

     /* the descriptor offset = 0x200 */
+
     if (bdrv_pread(bs->file, 0x200, desc, DESC_SIZE) != DESC_SIZE)

         return -1;

static int vmdk_write_cid(BlockDriverState *bs, uint32_t cid)

{

    char desc[DESC_SIZE], tmp_desc[DESC_SIZE];

    char *p_name, *tmp_str;

    /* the descriptor offset = 0x200 */

    if (bdrv_pread(bs->file, 0x200, desc, DESC_SIZE) != DESC_SIZE)

        return -1;

    tmp_str = strstr(desc,"parentCID");

    pstrcpy(tmp_desc, sizeof(tmp_desc), tmp_str);

    if ((p_name = strstr(desc,"CID")) != NULL) {

        p_name += sizeof("CID");

        snprintf(p_name, sizeof(desc) - (p_name - desc), "%x\n", cid);

        pstrcat(desc, sizeof(desc), tmp_desc);

    }

    if (bdrv_pwrite(bs->file, 0x200, desc, DESC_SIZE) != DESC_SIZE)

        return -1;

    return 0;

}


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

         default: abort();

+        }

     } else {

static inline void gen_neon_widen(TCGv_i64 dest, TCGv src, int size, int u)

{

    if (u) {

        switch (size) {

        case 0: gen_helper_neon_widen_u8(dest, src); break;

        case 1: gen_helper_neon_widen_u16(dest, src); break;

        case 2: tcg_gen_extu_i32_i64(dest, src); break;

        default: abort();

        }

    } else {

        switch (size) {

        case 0: gen_helper_neon_widen_s8(dest, src); break;

        case 1: gen_helper_neon_widen_s16(dest, src); break;

        case 2: tcg_gen_ext_i32_i64(dest, src); break;

        default: abort();

        }

    }

    dead_tmp(src);

}


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

 #ifdef CONFIG_PPOLL
+
+    if (timeout < 0) {
+
+        return ppoll((struct pollfd *)fds, nfds, NULL, NULL);
+
     } else {

         struct timespec ts;

int qemu_poll_ns(GPollFD *fds, guint nfds, int64_t timeout)

{

#ifdef CONFIG_PPOLL

    if (timeout < 0) {

        return ppoll((struct pollfd *)fds, nfds, NULL, NULL);

    } else {

        struct timespec ts;

        int64_t tvsec = timeout / 1000000000LL;

        /* Avoid possibly overflowing and specifying a negative number of

         * seconds, which would turn a very long timeout into a busy-wait.

         */

        if (tvsec > (int64_t)INT32_MAX) {

            tvsec = INT32_MAX;

        }

        ts.tv_sec = tvsec;

        ts.tv_nsec = timeout % 1000000000LL;

        return ppoll((struct pollfd *)fds, nfds, &ts, NULL);

    }

#else

    return g_poll(fds, nfds, qemu_timeout_ns_to_ms(timeout));

#endif

}


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

+    if (avctx->width > 4095 || avctx->height > 4095) {
+
+        av_log(avctx, AV_LOG_ERROR,
+
+               "Input dimensions too large, input must be max 4096x4096 !\n");

         return AVERROR_INVALIDDATA;

static av_cold int flashsv_encode_init(AVCodecContext *avctx)

{

    FlashSVContext *s = avctx->priv_data;

    s->avctx = avctx;

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

        av_log(avctx, AV_LOG_ERROR,

               "Input dimensions too large, input must be max 4096x4096 !\n");

        return AVERROR_INVALIDDATA;

    }

    // Needed if zlib unused or init aborted before deflateInit

    memset(&s->zstream, 0, sizeof(z_stream));

    s->last_key_frame = 0;

    s->image_width  = avctx->width;

    s->image_height = avctx->height;

    s->tmpblock  = av_mallocz(3 * 256 * 256);

    s->encbuffer = av_mallocz(s->image_width * s->image_height * 3);

    if (!s->tmpblock || !s->encbuffer) {

        av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n");

        return AVERROR(ENOMEM);

    }

    avctx->coded_frame = av_frame_alloc();

    if (!avctx->coded_frame) {

        flashsv_encode_end(avctx);

        return AVERROR(ENOMEM);

    }

    return 0;

}


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

     HCIInfo *hci;

+    const char *name = "usb-bt-dongle";

+    if (*cmdline) {
+
         hci = hci_init(cmdline);

     } else {

static USBDevice *usb_bt_init(USBBus *bus, const char *cmdline)

{

    USBDevice *dev;

    struct USBBtState *s;

    HCIInfo *hci;

    const char *name = "usb-bt-dongle";

    if (*cmdline) {

        hci = hci_init(cmdline);

    } else {

        hci = bt_new_hci(qemu_find_bt_vlan(0));

    }

    if (!hci)

        return NULL;

    dev = usb_create(bus, name);

    s = DO_UPCAST(struct USBBtState, dev, dev);

    s->hci = hci;

    if (qdev_init(&dev->qdev) < 0) {

        error_report("Failed to initialize USB device '%s'", name);

        return NULL;

    }

    return dev;

}


static void qvirtio_scsi_stop(void)

{

    qtest_end();

}


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

 	}

+    }
+
+    if (oops) /* should not happen */
+
+        xen_pv_printf(&xenfb->c.xendev, 0, "%s: oops: convert %d -> %d bpp?\n",

                       __FUNCTION__, xenfb->depth, bpp);

static void xenfb_guest_copy(struct XenFB *xenfb, int x, int y, int w, int h)

{

    DisplaySurface *surface = qemu_console_surface(xenfb->c.con);

    int line, oops = 0;

    int bpp = surface_bits_per_pixel(surface);

    int linesize = surface_stride(surface);

    uint8_t *data = surface_data(surface);

    if (!is_buffer_shared(surface)) {

        switch (xenfb->depth) {

        case 8:

            if (bpp == 16) {

                BLT(uint8_t, uint16_t,   3, 3, 2,   5, 6, 5);

            } else if (bpp == 32) {

                BLT(uint8_t, uint32_t,   3, 3, 2,   8, 8, 8);

            } else {

                oops = 1;

            }

            break;

        case 24:

            if (bpp == 16) {

                BLT(uint32_t, uint16_t,  8, 8, 8,   5, 6, 5);

            } else if (bpp == 32) {

                BLT(uint32_t, uint32_t,  8, 8, 8,   8, 8, 8);

            } else {

                oops = 1;

            }

            break;

        default:

            oops = 1;

	}

    }

    if (oops) /* should not happen */

        xen_pv_printf(&xenfb->c.xendev, 0, "%s: oops: convert %d -> %d bpp?\n",

                      __FUNCTION__, xenfb->depth, bpp);

    dpy_gfx_update(xenfb->c.con, x, y, w, h);

}


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

     return av_str2id(img_tags, filename);
+
 }

enum AVCodecID ff_guess_image2_codec(const char *filename)

{

    return av_str2id(img_tags, filename);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static AVCodec *AVCodecInitialize(enum AVCodecID codec_id)

+{

     AVCodec *res;

static AVCodec *AVCodecInitialize(enum AVCodecID codec_id)

{

    AVCodec *res;

    avcodec_register_all();

    av_log_set_level(AV_LOG_PANIC);

    res = avcodec_find_decoder(codec_id);

    if (!res)

        error("Failed to find decoder");

    return res;

}


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

     pstrcpy(bs->backing_format, sizeof(bs->backing_format),

+            backing_hd->drv ? backing_hd->drv->format_name : "");
+
+
+
+    bdrv_op_block_all(backing_hd, bs->backing_blocker);

     /* Otherwise we won't be able to commit due to check in bdrv_commit */

void bdrv_set_backing_hd(BlockDriverState *bs, BlockDriverState *backing_hd)

{

    if (backing_hd) {

        bdrv_ref(backing_hd);

    }

    if (bs->backing) {

        assert(bs->backing_blocker);

        bdrv_op_unblock_all(bs->backing->bs, bs->backing_blocker);

        bdrv_unref_child(bs, bs->backing);

    } else if (backing_hd) {

        error_setg(&bs->backing_blocker,

                   "node is used as backing hd of '%s'",

                   bdrv_get_device_or_node_name(bs));

    }

    if (!backing_hd) {

        error_free(bs->backing_blocker);

        bs->backing_blocker = NULL;

        bs->backing = NULL;

        goto out;

    }

    bs->backing = bdrv_attach_child(bs, backing_hd, &child_backing);

    bs->open_flags &= ~BDRV_O_NO_BACKING;

    pstrcpy(bs->backing_file, sizeof(bs->backing_file), backing_hd->filename);

    pstrcpy(bs->backing_format, sizeof(bs->backing_format),

            backing_hd->drv ? backing_hd->drv->format_name : "");

    bdrv_op_block_all(backing_hd, bs->backing_blocker);

    /* Otherwise we won't be able to commit due to check in bdrv_commit */

    bdrv_op_unblock(backing_hd, BLOCK_OP_TYPE_COMMIT_TARGET,

                    bs->backing_blocker);

out:

    bdrv_refresh_limits(bs, NULL);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static bool is_sector_request_lun_aligned(int64_t sector_num, int nb_sectors,
+
                                           IscsiLun *iscsilun)

 {

static bool is_sector_request_lun_aligned(int64_t sector_num, int nb_sectors,

                                          IscsiLun *iscsilun)

{

    assert(nb_sectors < BDRV_REQUEST_MAX_SECTORS);

    return is_byte_request_lun_aligned(sector_num << BDRV_SECTOR_BITS,

                                       nb_sectors << BDRV_SECTOR_BITS,

                                       iscsilun);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void tcg_exec_init(unsigned long tb_size)

+{

     cpu_gen_init();
+
     code_gen_alloc(tb_size);

     page_init();

void tcg_exec_init(unsigned long tb_size)

{

    cpu_gen_init();

    code_gen_alloc(tb_size);

    page_init();

#if defined(CONFIG_SOFTMMU)

    /* There's no guest base to take into account, so go ahead and

       initialize the prologue now.  */

    tcg_prologue_init(&tcg_ctx);

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 set_phy_ctrl(E1000State *s, int index, uint16_t val)

 {
+
+    /*
+
+     * QEMU 1.3 does not support link auto-negotiation emulation, so if we
+
      * migrate during auto negotiation, after migration the link will be

      * down.

set_phy_ctrl(E1000State *s, int index, uint16_t val)

{

    /*

     * QEMU 1.3 does not support link auto-negotiation emulation, so if we

     * migrate during auto negotiation, after migration the link will be

     * down.

     */

    if (!(s->compat_flags & E1000_FLAG_AUTONEG)) {

        return;

    }

    if ((val & MII_CR_AUTO_NEG_EN) && (val & MII_CR_RESTART_AUTO_NEG)) {

        e1000_link_down(s);

        DBGOUT(PHY, "Start link auto negotiation\n");

        timer_mod(s->autoneg_timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 500);

    }

}


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

     if (s->last_rtcp_ntp_time != AV_NOPTS_VALUE) {
+
         int64_t addend;

         int delta_timestamp;

static void finalize_packet(RTPDemuxContext *s, AVPacket *pkt, uint32_t timestamp)

{

    if (s->last_rtcp_ntp_time != AV_NOPTS_VALUE) {

        int64_t addend;

        int delta_timestamp;

        /* compute pts from timestamp with received ntp_time */

        delta_timestamp = timestamp - s->last_rtcp_timestamp;

        /* convert to the PTS timebase */

        addend = av_rescale(s->last_rtcp_ntp_time - s->first_rtcp_ntp_time, s->st->time_base.den, (uint64_t)s->st->time_base.num << 32);

        pkt->pts = addend + delta_timestamp;

    }

}


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

+    return bdrv_co_pwritev(child->bs, sector_num << BDRV_SECTOR_BITS,
+
+                           nb_sectors << BDRV_SECTOR_BITS, qiov, flags);
+
+}

static int coroutine_fn bdrv_co_do_writev(BdrvChild *child,

    int64_t sector_num, int nb_sectors, QEMUIOVector *qiov,

    BdrvRequestFlags flags)

{

    if (nb_sectors < 0 || nb_sectors > BDRV_REQUEST_MAX_SECTORS) {

        return -EINVAL;

    }

    return bdrv_co_pwritev(child->bs, sector_num << BDRV_SECTOR_BITS,

                           nb_sectors << BDRV_SECTOR_BITS, qiov, flags);

}


--- a/source.c
+++ b/source.c
@@ -11,9 +11,9 @@
         scsi_req_build_sense(req, req->bus->unit_attention);

     }
+
+    scsi_req_complete(req, CHECK_CONDITION);
+
+    return 0;

 }

static int32_t scsi_unit_attention(SCSIRequest *req, uint8_t *buf)

{

    if (req->dev && req->dev->unit_attention.key == UNIT_ATTENTION) {

        scsi_req_build_sense(req, req->dev->unit_attention);

    } else if (req->bus->unit_attention.key == UNIT_ATTENTION) {

        scsi_req_build_sense(req, req->bus->unit_attention);

    }

    scsi_req_complete(req, CHECK_CONDITION);

    return 0;

}


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

     relation = float32_compare(t0, t1, &env->fp_status);

+    if (unlikely(relation == float_relation_unordered)) {
+
+        update_fpscr(env, GETPC());
+
+    } else {

         env->sr_t = (relation == float_relation_equal);

void helper_fcmp_eq_FT(CPUSH4State *env, float32 t0, float32 t1)

{

    int relation;

    set_float_exception_flags(0, &env->fp_status);

    relation = float32_compare(t0, t1, &env->fp_status);

    if (unlikely(relation == float_relation_unordered)) {

        update_fpscr(env, GETPC());

    } else {

        env->sr_t = (relation == float_relation_equal);

    }

}


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

     stream->last_pts= pts;

+    if(    nut->frame_code[frame_code].flags & FLAG_PTS
+
+        && nut->frame_code[frame_code].flags & FLAG_FULL_PTS)
+
+        stream->last_full_pts= pts;

 }

static void update(NUTContext *nut, int stream_index, int64_t frame_start, int frame_type, int frame_code, int key_frame, int size, int64_t pts){

    StreamContext *stream= &nut->stream[stream_index];

    stream->last_key_frame= key_frame;

    nut->last_frame_start[ frame_type ]= frame_start;

    update_lru(stream->lru_pts_delta, pts - stream->last_pts, 3);

    update_lru(stream->lru_size     ,                   size, 2);

    stream->last_pts= pts;

    if(    nut->frame_code[frame_code].flags & FLAG_PTS

        && nut->frame_code[frame_code].flags & FLAG_FULL_PTS)

        stream->last_full_pts= pts;

}


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

 {

+    int iomemtype;
+
+    struct omap_lpg_s *s = (struct omap_lpg_s *)
+
+            qemu_mallocz(sizeof(struct omap_lpg_s));

static struct omap_lpg_s *omap_lpg_init(target_phys_addr_t base, omap_clk clk)

{

    int iomemtype;

    struct omap_lpg_s *s = (struct omap_lpg_s *)

            qemu_mallocz(sizeof(struct omap_lpg_s));

    s->tm = qemu_new_timer(rt_clock, omap_lpg_tick, s);

    omap_lpg_reset(s);

    iomemtype = cpu_register_io_memory(omap_lpg_readfn,

                    omap_lpg_writefn, s, DEVICE_NATIVE_ENDIAN);

    cpu_register_physical_memory(base, 0x800, iomemtype);

    omap_clk_adduser(clk, qemu_allocate_irqs(omap_lpg_clk_update, s, 1)[0]);

    return s;

}


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

                    av_pix_fmt_descriptors[st->codec->pix_fmt].name,

+                   codec->name,
+
+                   av_pix_fmt_descriptors[codec->pix_fmts[0]].name);
+
+            st->codec->pix_fmt = codec->pix_fmts[0];

         }

static void choose_pixel_fmt(AVStream *st, AVCodec *codec)

{

    if(codec && codec->pix_fmts){

        const enum PixelFormat *p= codec->pix_fmts;

        if(st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL){

            if(st->codec->codec_id==CODEC_ID_MJPEG){

                p= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE};

            }else if(st->codec->codec_id==CODEC_ID_LJPEG){

                p= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ444P, PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_BGRA, PIX_FMT_NONE};

            }

        }

        for(; *p!=-1; p++){

            if(*p == st->codec->pix_fmt)

                break;

        }

        if (*p == -1) {

            av_log(NULL, AV_LOG_WARNING,

                   "Incompatible pixel format '%s' for codec '%s', auto-selecting format '%s'\n",

                   av_pix_fmt_descriptors[st->codec->pix_fmt].name,

                   codec->name,

                   av_pix_fmt_descriptors[codec->pix_fmts[0]].name);

            st->codec->pix_fmt = codec->pix_fmts[0];

        }

    }

}


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

 {

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

     CharDriverState *chr;

static CharDriverState *qemu_chr_open_tty(QemuOpts *opts)

{

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

    CharDriverState *chr;

    int fd;

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

    if (fd < 0) {

        return NULL;

    }

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

    chr = qemu_chr_open_fd(fd, fd);

    if (!chr) {

        close(fd);

        return NULL;

    }

    chr->chr_ioctl = tty_serial_ioctl;

    chr->chr_close = qemu_chr_close_tty;

    return chr;

}


--- a/source.c
+++ b/source.c
@@ -3,8 +3,8 @@
                          const char *name,

                          MemoryRegion *address_space_mem,
+
+                         MemoryRegion *address_space_io,

                          uint8_t devfn_min)

static void pci_bus_init(PCIBus *bus, DeviceState *parent,

                         const char *name,

                         MemoryRegion *address_space_mem,

                         MemoryRegion *address_space_io,

                         uint8_t devfn_min)

{

    assert(PCI_FUNC(devfn_min) == 0);

    bus->devfn_min = devfn_min;

    bus->address_space_mem = address_space_mem;

    bus->address_space_io = address_space_io;

    memory_region_init_io(&bus->master_abort_mem, OBJECT(bus),

                          &master_abort_mem_ops, bus, "pci-master-abort",

                          memory_region_size(bus->address_space_mem));

    memory_region_add_subregion_overlap(bus->address_space_mem,

                                        0, &bus->master_abort_mem,

                                        MASTER_ABORT_MEM_PRIORITY);

    /* host bridge */

    QLIST_INIT(&bus->child);

    pci_host_bus_register(bus, parent);

    vmstate_register(NULL, -1, &vmstate_pcibus, bus);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static struct pathelem *add_entry(struct pathelem *root, const char *name)

 {
+
+    root->num_entries++;

static struct pathelem *add_entry(struct pathelem *root, const char *name)

{

    root->num_entries++;

    root = realloc(root, sizeof(*root)

                   + sizeof(root->entries[0])*root->num_entries);

    root->entries[root->num_entries-1] = new_entry(root->pathname, root, name);

    root->entries[root->num_entries-1]

        = add_dir_maybe(root->entries[root->num_entries-1]);

    return root;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 void qmp_cont(Error **errp)

+{
+
     Error *local_err = NULL;
+

     if (runstate_check(RUN_STATE_INMIGRATE)) {
@@ -16,7 +16,7 @@

                runstate_check(RUN_STATE_SHUTDOWN)) {

+        error_set(errp, QERR_RESET_REQUIRED);

         return;

void qmp_cont(Error **errp)

{

    Error *local_err = NULL;

    if (runstate_check(RUN_STATE_INMIGRATE)) {

        error_set(errp, QERR_MIGRATION_EXPECTED);

        return;

    } else if (runstate_check(RUN_STATE_INTERNAL_ERROR) ||

               runstate_check(RUN_STATE_SHUTDOWN)) {

        error_set(errp, QERR_RESET_REQUIRED);

        return;

    } else if (runstate_check(RUN_STATE_SUSPENDED)) {

        return;

    }

    bdrv_iterate(iostatus_bdrv_it, NULL);

    bdrv_iterate(encrypted_bdrv_it, &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        return;

    }

    vm_start();

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void inner_add_yblock_bw_16_obmc_32_mmx(const uint8_t *obmc, const long obmc_stride, uint8_t * * block, int b_w, long b_h,
+
                       int src_x, int src_y, long src_stride, slice_buffer * sb, int add, uint8_t * dst8){

 snow_inner_add_yblock_mmx_header

static void inner_add_yblock_bw_16_obmc_32_mmx(const uint8_t *obmc, const long obmc_stride, uint8_t * * block, int b_w, long b_h,

                      int src_x, int src_y, long src_stride, slice_buffer * sb, int add, uint8_t * dst8){

snow_inner_add_yblock_mmx_header

snow_inner_add_yblock_mmx_start("mm1", "mm5", "3", "0", "0")

snow_inner_add_yblock_mmx_accum("2", "16", "0")

snow_inner_add_yblock_mmx_accum("1", "512", "0")

snow_inner_add_yblock_mmx_accum("0", "528", "0")

snow_inner_add_yblock_mmx_mix("0", "0")

snow_inner_add_yblock_mmx_start("mm1", "mm5", "3", "8", "8")

snow_inner_add_yblock_mmx_accum("2", "24", "8")

snow_inner_add_yblock_mmx_accum("1", "520", "8")

snow_inner_add_yblock_mmx_accum("0", "536", "8")

snow_inner_add_yblock_mmx_mix("32", "8")

snow_inner_add_yblock_mmx_end("32")

}


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

     arm_mptimer_state *s = (arm_mptimer_state *)opaque;

static void arm_thiswdog_write(void *opaque, target_phys_addr_t addr,

                               uint64_t value, unsigned size)

{

    arm_mptimer_state *s = (arm_mptimer_state *)opaque;

    int id = get_current_cpu(s);

    timerblock_write(&s->timerblock[id * 2 + 1], addr, value, size);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void fdt_add_gic_node(const VirtBoardInfo *vbi)

 {

static void fdt_add_gic_node(const VirtBoardInfo *vbi)

{

    uint32_t gic_phandle;

    gic_phandle = qemu_fdt_alloc_phandle(vbi->fdt);

    qemu_fdt_setprop_cell(vbi->fdt, "/", "interrupt-parent", gic_phandle);

    qemu_fdt_add_subnode(vbi->fdt, "/intc");

    /* 'cortex-a15-gic' means 'GIC v2' */

    qemu_fdt_setprop_string(vbi->fdt, "/intc", "compatible",

                            "arm,cortex-a15-gic");

    qemu_fdt_setprop_cell(vbi->fdt, "/intc", "#interrupt-cells", 3);

    qemu_fdt_setprop(vbi->fdt, "/intc", "interrupt-controller", NULL, 0);

    qemu_fdt_setprop_sized_cells(vbi->fdt, "/intc", "reg",

                                     2, vbi->memmap[VIRT_GIC_DIST].base,

                                     2, vbi->memmap[VIRT_GIC_DIST].size,

                                     2, vbi->memmap[VIRT_GIC_CPU].base,

                                     2, vbi->memmap[VIRT_GIC_CPU].size);

    qemu_fdt_setprop_cell(vbi->fdt, "/intc", "phandle", gic_phandle);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static char *qemu_rbd_parse_clientname(const char *conf, char *clientname)
+
+{
+
+    const char *p = conf;

static char *qemu_rbd_parse_clientname(const char *conf, char *clientname)

{

    const char *p = conf;

    while (*p) {

        int len;

        const char *end = strchr(p, ':');

        if (end) {

            len = end - p;

        } else {

            len = strlen(p);

        }

        if (strncmp(p, "id=", 3) == 0) {

            len -= 3;

            strncpy(clientname, p + 3, len);

            clientname[len] = '\0';

            return clientname;

        }

        if (end == NULL) {

            break;

        }

        p = end + 1;

    }

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void usb_hid_changed(HIDState *hs)
+
+{
+
+    USBHIDState *us = container_of(hs, USBHIDState, hid);

static void usb_hid_changed(HIDState *hs)

{

    USBHIDState *us = container_of(hs, USBHIDState, hid);

    us->changed = 1;

    if (us->datain) {

        us->datain(us->datain_opaque);

    }

    usb_wakeup(&us->dev);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 GACommandState *ga_command_state_new(void)
+
 {

     GACommandState *cs = g_malloc0(sizeof(GACommandState));

GACommandState *ga_command_state_new(void)

{

    GACommandState *cs = g_malloc0(sizeof(GACommandState));

    cs->groups = NULL;

    return cs;

}


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

 {

+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(klass);
+
+

     hc->root_bus_path = i440fx_pcihost_root_bus_path;

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(klass);

    hc->root_bus_path = i440fx_pcihost_root_bus_path;

    dc->realize = i440fx_pcihost_realize;

    dc->fw_name = "pci";

    dc->props = i440fx_props;

}


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

+
+
+    avctx->priv_data = gsm_create();
+
+

     switch(avctx->codec_id) {

static av_cold int libgsm_encode_init(AVCodecContext *avctx) {

    if (avctx->channels > 1) {

        av_log(avctx, AV_LOG_ERROR, "Mono required for GSM, got %d channels\n",

               avctx->channels);

        return -1;

    if (avctx->sample_rate != 8000) {

        av_log(avctx, AV_LOG_ERROR, "Sample rate 8000Hz required for GSM, got %dHz\n",

               avctx->sample_rate);

        if (avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL)

            return -1;

    if (avctx->bit_rate != 13000 /* Official */ &&

        avctx->bit_rate != 13200 /* Very common */ &&

        avctx->bit_rate != 0 /* Unknown; a.o. mov does not set bitrate when decoding */ ) {

        av_log(avctx, AV_LOG_ERROR, "Bitrate 13000bps required for GSM, got %dbps\n",

               avctx->bit_rate);

        if (avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL)

            return -1;

    avctx->priv_data = gsm_create();

    switch(avctx->codec_id) {

    case CODEC_ID_GSM:

        avctx->frame_size = GSM_FRAME_SIZE;

        avctx->block_align = GSM_BLOCK_SIZE;

        break;

    case CODEC_ID_GSM_MS: {

        int one = 1;

        gsm_option(avctx->priv_data, GSM_OPT_WAV49, &one);

        avctx->frame_size = 2*GSM_FRAME_SIZE;

        avctx->block_align = GSM_MS_BLOCK_SIZE;

    avctx->coded_frame= avcodec_alloc_frame();

    return 0;


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void chomp6(ChannelData *ctx, int16_t *output, uint8_t val,

+                   const uint16_t tab1[],

                    const int16_t *tab2, int tab2_stride,

static void chomp6(ChannelData *ctx, int16_t *output, uint8_t val,

                   const uint16_t tab1[],

                   const int16_t *tab2, int tab2_stride,

                   uint32_t numChannels)

{

    int16_t current;

    current = tab2[((ctx->index & 0x7f0) >> 4)*tab2_stride + val];

    if ((ctx->previous ^ current) >= 0) {

        ctx->factor = FFMIN(ctx->factor + 506, 32767);

    } else {

        if (ctx->factor - 314 < -32768)

            ctx->factor = -32767;

        else

            ctx->factor -= 314;

    }

    current = mace_broken_clip_int16(current + ctx->level);

    ctx->level = ((current*ctx->factor) >> 15);

    current >>= 1;

    output[0] = QT_8S_2_16S(ctx->previous + ctx->prev2 -

                            ((ctx->prev2-current) >> 2));

    output[numChannels] = QT_8S_2_16S(ctx->previous + current +

                                      ((ctx->prev2-current) >> 2));

    ctx->prev2 = ctx->previous;

    ctx->previous = current;

    if ((ctx->index += tab1[val] - (ctx->index >> 5)) < 0)

        ctx->index = 0;

}


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

+    /* Now we can tell the host to read */
+
+    vring_wait_reply(&block, 0);
+
+

     drain_irqs(block.schid);

static int virtio_read_many(ulong sector, void *load_addr, int sec_num)

{

    struct virtio_blk_outhdr out_hdr;

    u8 status;

    /* Tell the host we want to read */

    out_hdr.type = VIRTIO_BLK_T_IN;

    out_hdr.ioprio = 99;

    out_hdr.sector = sector;

    vring_send_buf(&block, &out_hdr, sizeof(out_hdr), VRING_DESC_F_NEXT);

    /* This is where we want to receive data */

    vring_send_buf(&block, load_addr, SECTOR_SIZE * sec_num,

                   VRING_DESC_F_WRITE | VRING_HIDDEN_IS_CHAIN |

                   VRING_DESC_F_NEXT);

    /* status field */

    vring_send_buf(&block, &status, sizeof(u8), VRING_DESC_F_WRITE |

                   VRING_HIDDEN_IS_CHAIN);

    /* Now we can tell the host to read */

    vring_wait_reply(&block, 0);

    drain_irqs(block.schid);

    return status;

}


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

     kroute.gsi = virq;
+
+    kroute.type = KVM_IRQ_ROUTING_MSI;
+
+    kroute.flags = 0;
+
     kroute.u.msi.address_lo = (uint32_t)msg.address;

     kroute.u.msi.address_hi = msg.address >> 32;

int kvm_irqchip_add_msi_route(KVMState *s, MSIMessage msg)

{

    struct kvm_irq_routing_entry kroute;

    int virq;

    if (!kvm_gsi_routing_enabled()) {

        return -ENOSYS;

    }

    virq = kvm_irqchip_get_virq(s);

    if (virq < 0) {

        return virq;

    }

    kroute.gsi = virq;

    kroute.type = KVM_IRQ_ROUTING_MSI;

    kroute.flags = 0;

    kroute.u.msi.address_lo = (uint32_t)msg.address;

    kroute.u.msi.address_hi = msg.address >> 32;

    kroute.u.msi.data = msg.data;

    kvm_add_routing_entry(s, &kroute);

    return virq;

}


--- a/source.c
+++ b/source.c
@@ -19,11 +19,11 @@
     tcase_add_test(qlist_public_tcase, qlist_new_test);

     tcase_add_test(qlist_public_tcase, qlist_append_test);
+
+    tcase_add_test(qlist_public_tcase, qobject_to_qlist_test);
+
+    tcase_add_test(qlist_public_tcase, qlist_destroy_test);
+
     tcase_add_test(qlist_public_tcase, qlist_iter_test);

static Suite *QList_suite(void)

{

    Suite *s;

    TCase *qlist_public_tcase;

    s = suite_create("QList suite");

    qlist_public_tcase = tcase_create("Public Interface");

    suite_add_tcase(s, qlist_public_tcase);

    tcase_add_test(qlist_public_tcase, qlist_new_test);

    tcase_add_test(qlist_public_tcase, qlist_append_test);

    tcase_add_test(qlist_public_tcase, qobject_to_qlist_test);

    tcase_add_test(qlist_public_tcase, qlist_destroy_test);

    tcase_add_test(qlist_public_tcase, qlist_iter_test);

    return s;

}


--- a/source.c
+++ b/source.c
@@ -22,11 +22,11 @@
         bus = sysbus_get_default();

+
+
+    qdev_set_parent_bus(dev, bus);
+
+    qdev_prop_set_globals(dev);

DeviceState *qdev_try_create(BusState *bus, const char *name)

{

    DeviceState *dev;

    dev = DEVICE(object_new(name));

    if (!dev) {

    if (!bus) {

        bus = sysbus_get_default();

    qdev_set_parent_bus(dev, bus);

    qdev_prop_set_globals(dev);

    return dev;


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

     if (!src->buf) {
+
+        ret = packet_alloc(&dst->buf, src->size);
+
+        if (ret < 0)
+
             goto fail;

         memcpy(dst->buf->data, src->data, src->size);

int av_packet_ref(AVPacket *dst, AVPacket *src)

{

    int ret;

    ret = av_packet_copy_props(dst, src);

    if (ret < 0)

        return ret;

    if (!src->buf) {

        ret = packet_alloc(&dst->buf, src->size);

        if (ret < 0)

            goto fail;

        memcpy(dst->buf->data, src->data, src->size);

    } else

        dst->buf = av_buffer_ref(src->buf);

    dst->size = src->size;

    dst->data = dst->buf->data;

    return 0;

fail:

    av_packet_free_side_data(dst);

    return ret;

}


int omap_validate_tipb_mpui_addr(struct omap_mpu_state_s *s,

                target_phys_addr_t addr)

{

    return addr >= 0xe1010000 && addr < 0xe1020004;

}


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

+
+    filter(ctx);
+
+
+
     return ff_filter_frame(ctx->outputs[0], av_frame_clone(idet->cur));

 }

static int filter_frame(AVFilterLink *link, AVFrame *picref)

{

    AVFilterContext *ctx = link->dst;

    IDETContext *idet = ctx->priv;

    if (idet->prev)

        av_frame_free(&idet->prev);

    idet->prev = idet->cur;

    idet->cur  = idet->next;

    idet->next = picref;

    if (!idet->cur)

        return 0;

    if (!idet->prev)

        idet->prev = av_frame_clone(idet->cur);

    if (!idet->csp)

        idet->csp = av_pix_fmt_desc_get(link->format);

    if (idet->csp->comp[0].depth_minus1 / 8 == 1){

        idet->filter_line = (ff_idet_filter_func)ff_idet_filter_line_c_16bit;

        if (ARCH_X86)

            ff_idet_init_x86(idet, 1);

    }

    filter(ctx);

    return ff_filter_frame(ctx->outputs[0], av_frame_clone(idet->cur));

}


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

                      NetClientState *peer, Error **errp)

+{
+
+    const NetdevHubPortOptions *hubport;
+
+

     assert(opts->type == NET_CLIENT_OPTIONS_KIND_HUBPORT);

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

                     NetClientState *peer, Error **errp)

{

    const NetdevHubPortOptions *hubport;

    assert(opts->type == NET_CLIENT_OPTIONS_KIND_HUBPORT);

    assert(!peer);

    hubport = opts->u.hubport;

    net_hub_add_port(hubport->hubid, name);

    return 0;

}


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

     r->io_header.dxfer_direction = direction;

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

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

static int execute_command(BlockDriverState *bdrv,

                           SCSIGenericReq *r, int direction,

			   BlockDriverCompletionFunc *complete)

{

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

    r->io_header.interface_id = 'S';

    r->io_header.dxfer_direction = direction;

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

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

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

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

    r->io_header.mx_sb_len = sizeof(s->sensebuf);

    r->io_header.sbp = s->sensebuf;

    r->io_header.timeout = MAX_UINT;

    r->io_header.usr_ptr = r;

    r->io_header.flags |= SG_FLAG_DIRECT_IO;

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

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

        BADF("execute_command: read failed !\n");

        return -1;

    }

    return 0;

}


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

     env->gpr[3] = spapr_hypercall(env, env->gpr[3], &env->gpr[4]);

static void emulate_spapr_hypercall(CPUPPCState *env)

{

    env->gpr[3] = spapr_hypercall(env, env->gpr[3], &env->gpr[4]);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void mips_cpu_realizefn(DeviceState *dev, Error **errp)
+
 {
+
     MIPSCPU *cpu = MIPS_CPU(dev);

     MIPSCPUClass *mcc = MIPS_CPU_GET_CLASS(dev);

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

{

    MIPSCPU *cpu = MIPS_CPU(dev);

    MIPSCPUClass *mcc = MIPS_CPU_GET_CLASS(dev);

    cpu_reset(CPU(cpu));

    mcc->parent_realize(dev, errp);

}


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

     Coroutine *co = opaque;

static void error_callback_bh(void *opaque)

{

    Coroutine *co = opaque;

    qemu_coroutine_enter(co);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
 {
+    HEVCLocalContext *lc = s->HEVClc;
+    int *ret = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
+    int *arg = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
+    int offset;
+    int startheader, cmpt = 0;
     int i, j, res = 0;
     if (!s->sList[1]) {
         ff_alloc_entries(s->avctx, s->sh.num_entry_point_offsets + 1);

static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
{
    HEVCLocalContext *lc = s->HEVClc;
    int *ret = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
    int *arg = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
    int offset;
    int startheader, cmpt = 0;
    int i, j, res = 0;
    if (!s->sList[1]) {
        ff_alloc_entries(s->avctx, s->sh.num_entry_point_offsets + 1);
        for (i = 1; i < s->threads_number; i++) {
            s->sList[i] = av_malloc(sizeof(HEVCContext));
            memcpy(s->sList[i], s, sizeof(HEVCContext));
            s->HEVClcList[i] = av_mallocz(sizeof(HEVCLocalContext));
            s->sList[i]->HEVClc = s->HEVClcList[i];
    offset = (lc->gb.index >> 3);
    for (j = 0, cmpt = 0, startheader = offset + s->sh.entry_point_offset[0]; j < s->skipped_bytes; j++) {
        if (s->skipped_bytes_pos[j] >= offset && s->skipped_bytes_pos[j] < startheader) {
            startheader--;
            cmpt++;
    for (i = 1; i < s->sh.num_entry_point_offsets; i++) {
        offset += (s->sh.entry_point_offset[i - 1] - cmpt);
        for (j = 0, cmpt = 0, startheader = offset
             + s->sh.entry_point_offset[i]; j < s->skipped_bytes; j++) {
            if (s->skipped_bytes_pos[j] >= offset && s->skipped_bytes_pos[j] < startheader) {
                startheader--;
                cmpt++;
        s->sh.size[i - 1] = s->sh.entry_point_offset[i] - cmpt;
        s->sh.offset[i - 1] = offset;
    if (s->sh.num_entry_point_offsets != 0) {
        offset += s->sh.entry_point_offset[s->sh.num_entry_point_offsets - 1] - cmpt;
        s->sh.size[s->sh.num_entry_point_offsets - 1] = length - offset;
        s->sh.offset[s->sh.num_entry_point_offsets - 1] = offset;
    s->data = nal;
    for (i = 1; i < s->threads_number; i++) {
        s->sList[i]->HEVClc->first_qp_group = 1;
        s->sList[i]->HEVClc->qp_y = s->sList[0]->HEVClc->qp_y;
        memcpy(s->sList[i], s, sizeof(HEVCContext));
        s->sList[i]->HEVClc = s->HEVClcList[i];
    avpriv_atomic_int_set(&s->wpp_err, 0);
    ff_reset_entries(s->avctx);
    for (i = 0; i <= s->sh.num_entry_point_offsets; i++) {
        arg[i] = i;
        ret[i] = 0;
    if (s->pps->entropy_coding_sync_enabled_flag)
        s->avctx->execute2(s->avctx, (void *) hls_decode_entry_wpp, arg, ret, s->sh.num_entry_point_offsets + 1);
    for (i = 0; i <= s->sh.num_entry_point_offsets; i++)
        res += ret[i];
    return res;


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

     for (p = devices; *p != '\0'; p++) {

+        /* Allowed boot devices are:
+
+         * a-b: floppy disk drives
+
+         * c-f: IDE disk drives

          * g-m: machine implementation dependent drives

static void validate_bootdevices(char *devices)

{

    /* We just do some generic consistency checks */

    const char *p;

    int bitmap = 0;

    for (p = devices; *p != '\0'; p++) {

        /* Allowed boot devices are:

         * a-b: floppy disk drives

         * c-f: IDE disk drives

         * g-m: machine implementation dependent drives

         * n-p: network devices

         * It's up to each machine implementation to check if the given boot

         * devices match the actual hardware implementation and firmware

         * features.

         */

        if (*p < 'a' || *p > 'p') {

            fprintf(stderr, "Invalid boot device '%c'\n", *p);

            exit(1);

        }

        if (bitmap & (1 << (*p - 'a'))) {

            fprintf(stderr, "Boot device '%c' was given twice\n", *p);

            exit(1);

        }

        bitmap |= 1 << (*p - 'a');

    }

}


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

     return SIZE_BUFFER_VT220 - scon->iov_data_len;
+
+}

static int chr_can_read(void *opaque)

{

    SCLPConsole *scon = opaque;

    return SIZE_BUFFER_VT220 - scon->iov_data_len;

}


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

     s->slice_height = s->mb_height / code;

+
+
+    if(s->avctx->debug&FF_DEBUG_PICT_INFO){
+
+        av_log(s->avctx, AV_LOG_DEBUG, "fps:%d, br:%d, qpbit:%d, abt_flag:%d, j_type_bit:%d, tl_mv_flag:%d, mbrl_bit:%d, code:%d, flag3:%d, slices:%d\n",

         fps, s->bit_rate, w->mspel_bit, w->abt_flag, w->j_type_bit, w->top_left_mv_flag, w->per_mb_rl_bit, code, w->flag3,

static int decode_ext_header(Wmv2Context *w){

    MpegEncContext * const s= &w->s;

    GetBitContext gb;

    int fps;

    int code;

    if(s->avctx->extradata_size<4) return -1;

    init_get_bits(&gb, s->avctx->extradata, s->avctx->extradata_size*8);

    fps                = get_bits(&gb, 5);

    s->bit_rate        = get_bits(&gb, 11)*1024;

    w->mspel_bit       = get_bits1(&gb);

    w->flag3           = get_bits1(&gb);

    w->abt_flag        = get_bits1(&gb);

    w->j_type_bit      = get_bits1(&gb);

    w->top_left_mv_flag= get_bits1(&gb);

    w->per_mb_rl_bit   = get_bits1(&gb);

    code               = get_bits(&gb, 3);

    if(code==0) return -1;

    s->slice_height = s->mb_height / code;

    if(s->avctx->debug&FF_DEBUG_PICT_INFO){

        av_log(s->avctx, AV_LOG_DEBUG, "fps:%d, br:%d, qpbit:%d, abt_flag:%d, j_type_bit:%d, tl_mv_flag:%d, mbrl_bit:%d, code:%d, flag3:%d, slices:%d\n",

        fps, s->bit_rate, w->mspel_bit, w->abt_flag, w->j_type_bit, w->top_left_mv_flag, w->per_mb_rl_bit, code, w->flag3,

        code);

    }

    return 0;

}


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

     sc->realize      = scsi_block_realize;

+    sc->unrealize    = scsi_unrealize;
+
+    sc->alloc_req    = scsi_block_new_request;
+
+    sc->parse_cdb    = scsi_block_parse_cdb;

     dc->fw_name = "disk";

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    SCSIDeviceClass *sc = SCSI_DEVICE_CLASS(klass);

    sc->realize      = scsi_block_realize;

    sc->unrealize    = scsi_unrealize;

    sc->alloc_req    = scsi_block_new_request;

    sc->parse_cdb    = scsi_block_parse_cdb;

    dc->fw_name = "disk";

    dc->desc = "SCSI block device passthrough";

    dc->reset = scsi_disk_reset;

    dc->props = scsi_block_properties;

    dc->vmsd  = &vmstate_scsi_disk_state;

}


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

     int i, bytes = 1;

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

     put_ebml_num(pb, bytes, 0);

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

{

    int i, bytes = 1;

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

    put_ebml_id(pb, elementid);

    put_ebml_num(pb, bytes, 0);

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

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

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void palette8torgb15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
+
+{
+
 	long i;

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

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

{

	long i;

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

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

}


--- a/source.c
+++ b/source.c
@@ -27,9 +27,9 @@
             ERROR("Device no longer matches filter after interface info "

                   "change, disconnecting!\n");
+
+        }
+
+    }
+
 }

static void usbredir_interface_info(void *priv,

    struct usb_redir_interface_info_header *interface_info)

{

    USBRedirDevice *dev = priv;

    dev->interface_info = *interface_info;

    /*

     * If we receive interface info after the device has already been

     * connected (ie on a set_config), re-check the filter.

     */

    if (qemu_timer_pending(dev->attach_timer) || dev->dev.attached) {

        if (usbredir_check_filter(dev)) {

            ERROR("Device no longer matches filter after interface info "

                  "change, disconnecting!\n");

        }

    }

}


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

     vnc_write_u8(vs, 2);

+
+
+    vnc_read_when(vs, protocol_client_vencrypt_init, 2);
+
     return 0;

 }

static int start_auth_vencrypt(VncState *vs)

{

    /* Send VeNCrypt version 0.2 */

    vnc_write_u8(vs, 0);

    vnc_write_u8(vs, 2);

    vnc_read_when(vs, protocol_client_vencrypt_init, 2);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int avs_probe(AVProbeData * p)

+{
+
+    const uint8_t *d;
+
+

     if (p->buf_size < 2)

static int avs_probe(AVProbeData * p)

{

    const uint8_t *d;

    if (p->buf_size < 2)

        return 0;

    d = p->buf;

    if (d[0] == 'w' && d[1] == 'W' && d[2] == 0x10 && d[3] == 0)

        return 50;

    return 0;

}


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

 {
+
+    struct AsyncContext *new = qemu_mallocz(sizeof(*new));
+
     new->parent = async_context;

     new->id = async_context->id + 1;

void async_context_push(void)

{

    struct AsyncContext *new = qemu_mallocz(sizeof(*new));

    new->parent = async_context;

    new->id = async_context->id + 1;

    async_context = new;

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width)
+
+{
+
 #ifdef HAVE_MMX
+
+	asm volatile(

+		"movq "MANGLE(bm01010101)", %%mm4\n\t"

 		"mov %0, %%"REG_a"		\n\t"

static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width)

{

#ifdef HAVE_MMX

	asm volatile(

		"movq "MANGLE(bm01010101)", %%mm4\n\t"

		"mov %0, %%"REG_a"		\n\t"

		"1:				\n\t"

		"movq (%1, %%"REG_a",4), %%mm0	\n\t"

		"movq 8(%1, %%"REG_a",4), %%mm1	\n\t"

		"pand %%mm4, %%mm0		\n\t"

		"pand %%mm4, %%mm1		\n\t"

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

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

		"psrlw $8, %%mm0		\n\t"

		"pand %%mm4, %%mm1		\n\t"

		"packuswb %%mm0, %%mm0		\n\t"

		"packuswb %%mm1, %%mm1		\n\t"

		"movd %%mm0, (%3, %%"REG_a")	\n\t"

		"movd %%mm1, (%2, %%"REG_a")	\n\t"

		"add $4, %%"REG_a"		\n\t"

		" js 1b				\n\t"

		: : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width)

		: "%"REG_a

	);

#else

	int i;

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

	{

		dstU[i]= src1[4*i + 0];

		dstV[i]= src1[4*i + 2];

	}

#endif

        assert(src1 == src2);

}


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

     return bs->enable_write_cache;

+}

int bdrv_enable_write_cache(BlockDriverState *bs)

{

    return bs->enable_write_cache;

}


--- a/source.c
+++ b/source.c
@@ -1,13 +1,13 @@
 target_ulong helper_evpe(CPUMIPSState *env)
+
 {

+    CPUMIPSState *other_cpu = first_cpu;
+
     target_ulong prev = env->mvp->CP0_MVPControl;

+
+
     do {

         if (other_cpu != env

target_ulong helper_evpe(CPUMIPSState *env)

{

    CPUMIPSState *other_cpu = first_cpu;

    target_ulong prev = env->mvp->CP0_MVPControl;

    do {

        if (other_cpu != env

           /* If the VPE is WFI, don't disturb its sleep.  */

           && !mips_vpe_is_wfi(other_cpu)) {

            /* Enable the VPE.  */

            other_cpu->mvp->CP0_MVPControl |= (1 << CP0MVPCo_EVP);

            mips_vpe_wake(other_cpu); /* And wake it up.  */

        }

        other_cpu = other_cpu->next_cpu;

    } while (other_cpu);

    return prev;

}


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

 {

+    PCIBonitoState *s = opaque;
+
+

     ((uint32_t *)(&s->boncop))[addr/sizeof(uint32_t)] = val & 0xffffffff;

static void bonito_cop_writel(void *opaque, target_phys_addr_t addr,

                              uint64_t val, unsigned size)

{

    PCIBonitoState *s = opaque;

    ((uint32_t *)(&s->boncop))[addr/sizeof(uint32_t)] = val & 0xffffffff;

}


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

     entry.cksum.offset = cpu_to_le32(checksum - (uint8_t *)table);

+    entry.cksum.start = cpu_to_le32((uint8_t *)start - (uint8_t *)table);
+
+    entry.cksum.length = cpu_to_le32(size);
+
+

     g_array_append_val(linker, entry);

void bios_linker_loader_add_checksum(GArray *linker, const char *file,

                                     void *table,

                                     void *start, unsigned size,

                                     uint8_t *checksum)

{

    BiosLinkerLoaderEntry entry;

    memset(&entry, 0, sizeof entry);

    strncpy(entry.cksum.file, file, sizeof entry.cksum.file - 1);

    entry.command = cpu_to_le32(BIOS_LINKER_LOADER_COMMAND_ADD_CHECKSUM);

    entry.cksum.offset = cpu_to_le32(checksum - (uint8_t *)table);

    entry.cksum.start = cpu_to_le32((uint8_t *)start - (uint8_t *)table);

    entry.cksum.length = cpu_to_le32(size);

    g_array_append_val(linker, entry);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static inline int get_ue_code(GetBitContext *gb, int order)

+{
+
     if (order) {
+
         int ret = get_ue_golomb(gb) << order;

         return ret + get_bits(gb, order);

static inline int get_ue_code(GetBitContext *gb, int order)

{

    if (order) {

        int ret = get_ue_golomb(gb) << order;

        return ret + get_bits(gb, order);

    }

    return get_ue_golomb(gb);

}


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

     s = qemu_mallocz(sizeof(MIPSnetState));
+

     register_ioport_write(base, 36, 1, mipsnet_ioport_write, s);

void mipsnet_init (int base, qemu_irq irq, NICInfo *nd)

{

    MIPSnetState *s;

    qemu_check_nic_model(nd, "mipsnet");

    s = qemu_mallocz(sizeof(MIPSnetState));

    register_ioport_write(base, 36, 1, mipsnet_ioport_write, s);

    register_ioport_read(base, 36, 1, mipsnet_ioport_read, s);

    register_ioport_write(base, 36, 2, mipsnet_ioport_write, s);

    register_ioport_read(base, 36, 2, mipsnet_ioport_read, s);

    register_ioport_write(base, 36, 4, mipsnet_ioport_write, s);

    register_ioport_read(base, 36, 4, mipsnet_ioport_read, s);

    s->io_base = base;

    s->irq = irq;

    if (nd && nd->vlan) {

        s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,

                                     mipsnet_can_receive, mipsnet_receive, NULL,

                                     mipsnet_cleanup, s);

    } else {

        s->vc = NULL;

    }

    qemu_format_nic_info_str(s->vc, nd->macaddr);

    mipsnet_reset(s);

    register_savevm("mipsnet", 0, 0, mipsnet_save, mipsnet_load, s);

}


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

     s->priv_data = dv_init_mux(s);

static int dv_write_header(AVFormatContext *s)

{

    s->priv_data = dv_init_mux(s);

    if (!s->priv_data) {

        av_log(s, AV_LOG_ERROR, "Can't initialize DV format!\n"

                    "Make sure that you supply exactly two streams:\n"

                    "     video: 25fps or 29.97fps, audio: 2ch/48Khz/PCM\n"

                    "     (50Mbps allows an optional second audio stream)\n");

        return -1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void use_high_update_speed(WmallDecodeCtx *s, int ich)

 {
+
     int ilms, recent, icoef;

     s->update_speed[ich] = 16;

static void use_high_update_speed(WmallDecodeCtx *s, int ich)

{

    int ilms, recent, icoef;

    s->update_speed[ich] = 16;

    for (ilms = s->cdlms_ttl[ich]; ilms >= 0; ilms--) {

        recent = s->cdlms[ich][ilms].recent;

        if (s->bV3RTM) {

            for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)

                s->cdlms[ich][ilms].lms_updates[icoef + recent] *= 2;

        } else {

            for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)

                s->cdlms[ich][ilms].lms_updates[icoef] *= 2;

        }

    }

}


void OPPROTO op_decw_ECX(void)

{

    ECX = (ECX & ~0xffff) | ((ECX - 1) & 0xffff);

}


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

     if (val)
+
+        val |= E1000_ICR_INT_ASSERTED;
+
     s->mac_reg[ICR] = val;

     s->mac_reg[ICS] = val;

set_interrupt_cause(E1000State *s, int index, uint32_t val)

{

    if (val)

        val |= E1000_ICR_INT_ASSERTED;

    s->mac_reg[ICR] = val;

    s->mac_reg[ICS] = val;

    qemu_set_irq(s->dev.irq[0], (s->mac_reg[IMS] & s->mac_reg[ICR]) != 0);

}


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

+    start >>= hb->granularity;
+
+    last >>= hb->granularity;
+
+    count = last - start + 1;

void hbitmap_set(HBitmap *hb, uint64_t start, uint64_t count)

{

    /* Compute range in the last layer.  */

    uint64_t last = start + count - 1;

    trace_hbitmap_set(hb, start, count,

                      start >> hb->granularity, last >> hb->granularity);

    start >>= hb->granularity;

    last >>= hb->granularity;

    count = last - start + 1;

    hb->count += count - hb_count_between(hb, start, last);

    hb_set_between(hb, HBITMAP_LEVELS - 1, start, last);

}


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

 {

+    AVDictionary *tmp = NULL;
+
+    int ret;
+
+

     av_dict_copy(&tmp, c->avio_opts, 0);

static int open_in(HLSContext *c, AVIOContext **in, const char *url)

{

    AVDictionary *tmp = NULL;

    int ret;

    av_dict_copy(&tmp, c->avio_opts, 0);

    ret = avio_open2(in, url, AVIO_FLAG_READ, c->interrupt_callback, &tmp);

    av_dict_free(&tmp);

    return ret;

}


static void net_socket_accept(void *opaque)

{

    NetSocketListenState *s = opaque;

    NetSocketState *s1;

    struct sockaddr_in saddr;

    socklen_t len;

    int fd;

    for(;;) {

        len = sizeof(saddr);

        fd = qemu_accept(s->fd, (struct sockaddr *)&saddr, &len);

        if (fd < 0 && errno != EINTR) {

            return;

        } else if (fd >= 0) {

            break;

        }

    }

    s1 = net_socket_fd_init(s->peer, s->model, s->name, fd, 1);

    if (s1) {

        snprintf(s1->nc.info_str, sizeof(s1->nc.info_str),

                 "socket: connection from %s:%d",

                 inet_ntoa(saddr.sin_addr), ntohs(saddr.sin_port));

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void stop(DBDMA_channel *ch)
+
 {

     ch->regs[DBDMA_STATUS] &= cpu_to_be32(~(ACTIVE|DEAD|FLUSH));

static void stop(DBDMA_channel *ch)

{

    ch->regs[DBDMA_STATUS] &= cpu_to_be32(~(ACTIVE|DEAD|FLUSH));

    /* the stop command does not increment command pointer */

}


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

 {

+    int16_t *samples = data;

+    MACEContext *ctx = avctx->priv_data;

     int i, j;

static int mace6_decode_frame(AVCodecContext *avctx,

                              void *data, int *data_size,

                              const uint8_t *buf, int buf_size)

{

    int16_t *samples = data;

    MACEContext *ctx = avctx->priv_data;

    int i, j;

    for(i = 0; i < avctx->channels; i++) {

        int16_t *output = samples + i;

        for (j = 0; j < buf_size / avctx->channels; j++) {

            uint8_t pkt = buf[i + j*avctx->channels];

            chomp6(&ctx->chd[i], output, pkt >> 5     , MACEtab1, MACEtab2,

                   8, avctx->channels);

            output += avctx->channels << 1;

            chomp6(&ctx->chd[i], output,(pkt >> 3) & 3, MACEtab3, MACEtab4,

                   4, avctx->channels);

            output += avctx->channels << 1;

            chomp6(&ctx->chd[i], output, pkt       & 7, MACEtab1, MACEtab2,

                   8, avctx->channels);

            output += avctx->channels << 1;

        }

    }

    *data_size = 2 * 6 * buf_size;

    return buf_size;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 hwaddr get_pteg_offset32(PowerPCCPU *cpu, hwaddr hash)
+
+{

     CPUPPCState *env = &cpu->env;

hwaddr get_pteg_offset32(PowerPCCPU *cpu, hwaddr hash)

{

    CPUPPCState *env = &cpu->env;

    return (hash * HASH_PTEG_SIZE_32) & env->htab_mask;

}


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

     rsp = qmp_dispatch(QOBJECT(req));

+    if (rsp) {
+
+        ret = send_response(s, rsp);
+
+        if (ret) {

             g_warning("error sending response: %s", strerror(ret));

static void process_command(GAState *s, QDict *req)

{

    QObject *rsp = NULL;

    int ret;

    g_assert(req);

    g_debug("processing command");

    rsp = qmp_dispatch(QOBJECT(req));

    if (rsp) {

        ret = send_response(s, rsp);

        if (ret) {

            g_warning("error sending response: %s", strerror(ret));

        }

        qobject_decref(rsp);

    } else {

        g_warning("error getting response");

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static BlockAIOCB *bdrv_aio_writev_em(BlockDriverState *bs,

+        int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
+
         BlockCompletionFunc *cb, void *opaque)

 {

static BlockAIOCB *bdrv_aio_writev_em(BlockDriverState *bs,

        int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,

        BlockCompletionFunc *cb, void *opaque)

{

    return bdrv_aio_rw_vector(bs, sector_num, qiov, nb_sectors, cb, opaque, 1);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int mov_write_single_packet(AVFormatContext *s, AVPacket *pkt)
+{
+        MOVMuxContext *mov = s->priv_data;
+        MOVTrack *trk = &mov->tracks[pkt->stream_index];
+        AVCodecParameters *par = trk->par;
+        int64_t frag_duration = 0;
         int size = pkt->size;
         if (mov->flags & FF_MOV_FLAG_FRAG_DISCONT) {
             int i;

static int mov_write_single_packet(AVFormatContext *s, AVPacket *pkt)
{
        MOVMuxContext *mov = s->priv_data;
        MOVTrack *trk = &mov->tracks[pkt->stream_index];
        AVCodecParameters *par = trk->par;
        int64_t frag_duration = 0;
        int size = pkt->size;
        if (mov->flags & FF_MOV_FLAG_FRAG_DISCONT) {
            int i;
            for (i = 0; i < s->nb_streams; i++)
                mov->tracks[i].frag_discont = 1;
            mov->flags &= ~FF_MOV_FLAG_FRAG_DISCONT;
        }
        if (!pkt->size) {
            if (trk->start_dts == AV_NOPTS_VALUE && trk->frag_discont) {
                trk->start_dts = pkt->dts;
                if (pkt->pts != AV_NOPTS_VALUE)
                    trk->start_cts = pkt->pts - pkt->dts;
                else
                    trk->start_cts = 0;
            }
            if (trk->par->codec_id == AV_CODEC_ID_MP4ALS) {
                int side_size = 0;
                uint8_t *side = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &side_size);
                if (side && side_size > 0 && (side_size != par->extradata_size || memcmp(side, par->extradata, side_size))) {
                    void *newextra = av_mallocz(side_size + AV_INPUT_BUFFER_PADDING_SIZE);
                    if (!newextra)
                        return AVERROR(ENOMEM);
                    av_free(par->extradata);
                    par->extradata = newextra;
                    memcpy(par->extradata, side, side_size);
                    par->extradata_size = side_size;
                    mov->need_rewrite_extradata = 1;
                }
            }
            return 0;             /* Discard 0 sized packets */
        }
        if (trk->entry && pkt->stream_index < s->nb_streams)
            frag_duration = av_rescale_q(pkt->dts - trk->cluster[0].dts,
                                         s->streams[pkt->stream_index]->time_base,
                                         AV_TIME_BASE_Q);
        if ((mov->max_fragment_duration &&
             frag_duration >= mov->max_fragment_duration) ||
             (mov->max_fragment_size && mov->mdat_size + size >= mov->max_fragment_size) ||
             (mov->flags & FF_MOV_FLAG_FRAG_KEYFRAME &&
              par->codec_type == AVMEDIA_TYPE_VIDEO &&
              trk->entry && pkt->flags & AV_PKT_FLAG_KEY)) {
            if (frag_duration >= mov->min_fragment_duration) {
                // Set the duration of this track to line up with the next
                // sample in this track. This avoids relying on AVPacket
                // duration, but only helps for this particular track, not
                // for the other ones that are flushed at the same time.
                trk->track_duration = pkt->dts - trk->start_dts;
                if (pkt->pts != AV_NOPTS_VALUE)
                    trk->end_pts = pkt->pts;
                else
                    trk->end_pts = pkt->dts;
                trk->end_reliable = 1;
                mov_auto_flush_fragment(s, 0);
            }
        }
        return ff_mov_write_packet(s, pkt);
}


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

 	    dinfo->bus == bus &&

+	    dinfo->unit == unit)
+
+            return dinfo;
+
+    }

DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit)

{

    DriveInfo *dinfo;

    /* seek interface, bus and unit */

    TAILQ_FOREACH(dinfo, &drives, next) {

        if (dinfo->type == type &&

	    dinfo->bus == bus &&

	    dinfo->unit == unit)

            return dinfo;

    }

    return NULL;

}


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

     register const uint8_t *src = c->in;

+    register uint8_t *dst       = c->out;
+
+
+    if (cnt > c->in_end - src) {
+
         cnt       = FFMAX(c->in_end - src, 0);

         c->error |= AV_LZO_INPUT_DEPLETED;

static inline void copy(LZOContext *c, int cnt)

{

    register const uint8_t *src = c->in;

    register uint8_t *dst       = c->out;

    if (cnt > c->in_end - src) {

        cnt       = FFMAX(c->in_end - src, 0);

        c->error |= AV_LZO_INPUT_DEPLETED;

    }

    if (cnt > c->out_end - dst) {

        cnt       = FFMAX(c->out_end - dst, 0);

        c->error |= AV_LZO_OUTPUT_FULL;

    }

#if defined(INBUF_PADDED) && defined(OUTBUF_PADDED)

    AV_COPY32U(dst, src);

    src += 4;

    dst += 4;

    cnt -= 4;

    if (cnt > 0)

#endif

    memcpy(dst, src, cnt);

    c->in  = src + cnt;

    c->out = dst + cnt;

}


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

     for(i=0; i<bytes; i++) put_bits(pb, 16, be2me_16(((uint16_t*)src)[i]));
+
+    put_bits(pb, bits, be2me_16(((uint16_t*)src)[i])>>(16-bits));
+
+#else
+
     int bytes= length>>3;

     int bits= length&7;

static void copy_bits(PutBitContext *pb, UINT8 *src, int length)

{

#if 1

    int bytes= length>>4;

    int bits= length&15;

    int i;

    for(i=0; i<bytes; i++) put_bits(pb, 16, be2me_16(((uint16_t*)src)[i]));

    put_bits(pb, bits, be2me_16(((uint16_t*)src)[i])>>(16-bits));

#else

    int bytes= length>>3;

    int bits= length&7;

    int i;

    for(i=0; i<bytes; i++) put_bits(pb, 8, src[i]);

    put_bits(pb, bits, src[i]>>(8-bits));

#endif

}


static uint64_t log16(uint64_t a){

    int i;

    int out=0;

    assert(a >= (1<<16));

    a<<=16;

    for(i=19;i>=0;i--){

        if(a<(exp16_table[i]<<16)) continue;

        out |= 1<<i;

        a = ((a<<16) + exp16_table[i]/2)/exp16_table[i];

    }

    return out;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     uint32_t *capabilities = (incoming->capabilities);

     int num_capabilities =
+
+        1 + ((mhHeader->length - sizeof(VSCMsgInit)) / sizeof(uint32_t));
+
+    int i;
+
     QemuThread thread_id;

on_host_init(VSCMsgHeader *mhHeader, VSCMsgInit *incoming)

{

    uint32_t *capabilities = (incoming->capabilities);

    int num_capabilities =

        1 + ((mhHeader->length - sizeof(VSCMsgInit)) / sizeof(uint32_t));

    int i;

    QemuThread thread_id;

    incoming->version = ntohl(incoming->version);

    if (incoming->version != VSCARD_VERSION) {

        if (verbose > 0) {

            printf("warning: host has version %d, we have %d\n",

                verbose, VSCARD_VERSION);

        }

    }

    if (incoming->magic != VSCARD_MAGIC) {

        printf("unexpected magic: got %d, expected %d\n",

            incoming->magic, VSCARD_MAGIC);

        return -1;

    }

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

        capabilities[i] = ntohl(capabilities[i]);

    }

    /* Future: check capabilities */

    /* remove whatever reader might be left in qemu,

     * in case of an unclean previous exit. */

    send_msg(VSC_ReaderRemove, VSCARD_MINIMAL_READER_ID, NULL, 0);

    /* launch the event_thread. This will trigger reader adds for all the

     * existing readers */

    qemu_thread_create(&thread_id, "vsc/event", event_thread, NULL, 0);

    return 0;

}


static void qio_channel_websock_finalize(Object *obj)

{

    QIOChannelWebsock *ioc = QIO_CHANNEL_WEBSOCK(obj);

    buffer_free(&ioc->encinput);

    buffer_free(&ioc->encoutput);

    buffer_free(&ioc->rawinput);

    buffer_free(&ioc->rawoutput);

    object_unref(OBJECT(ioc->master));

    if (ioc->io_tag) {

        g_source_remove(ioc->io_tag);

    }

    if (ioc->io_err) {

        error_free(ioc->io_err);

    }

}


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

+    virtio_reset(schid);
+
+
+
+    config.index = 0;

     if (run_ccw(schid, CCW_CMD_READ_VQ_CONF, &config, sizeof(config))) {

void virtio_setup_block(struct subchannel_id schid)

{

    struct vq_info_block info;

    struct vq_config_block config = {};

    virtio_reset(schid);

    config.index = 0;

    if (run_ccw(schid, CCW_CMD_READ_VQ_CONF, &config, sizeof(config))) {

        virtio_panic("Could not get block device configuration\n");

    }

    vring_init(&block, config.num, (void*)(100 * 1024 * 1024),

               KVM_S390_VIRTIO_RING_ALIGN);

    info.queue = (100ULL * 1024ULL* 1024ULL);

    info.align = KVM_S390_VIRTIO_RING_ALIGN;

    info.index = 0;

    info.num = config.num;

    block.schid = schid;

    if (!run_ccw(schid, CCW_CMD_SET_VQ, &info, sizeof(info))) {

        virtio_set_status(schid, VIRTIO_CONFIG_S_DRIVER_OK);

    }

}


static void minimac2_cleanup(NetClientState *nc)

{

    MilkymistMinimac2State *s = qemu_get_nic_opaque(nc);

    s->nic = NULL;

}


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

 {

+    DPRINTF("Command complete tag=0x%x status=%d sense=%d\n",

             r->req.tag, status, sense);

static void scsi_command_complete(SCSIDiskReq *r, int status, int sense)

{

    DPRINTF("Command complete tag=0x%x status=%d sense=%d\n",

            r->req.tag, status, sense);

    scsi_req_set_status(r, status, sense);

    scsi_req_complete(&r->req);

    scsi_remove_request(r);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+void cpu_reset(CPUM68KState *env)
+{
+    memset(env, 0, offsetof(CPUM68KState, breakpoints));
 #if !defined (CONFIG_USER_ONLY)
     env->sr = 0x2700;
 #endif

void cpu_reset(CPUM68KState *env)
{
    memset(env, 0, offsetof(CPUM68KState, breakpoints));
#if !defined (CONFIG_USER_ONLY)
    env->sr = 0x2700;
#endif
    m68k_switch_sp(env);
    /* ??? FP regs should be initialized to NaN.  */
    env->cc_op = CC_OP_FLAGS;
    /* TODO: We should set PC from the interrupt vector.  */
    env->pc = 0;
    tlb_flush(env, 1);


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
         if (pvr == ppc_defs[i].pvr) {

             return &ppc_defs[i];
+
+        }
+
+    }
+

     return NULL;

static const ppc_def_t *ppc_find_by_pvr (uint32_t pvr)

{

    int i;

    for (i = 0; i < ARRAY_SIZE(ppc_defs); i++) {

        /* If we have an exact match, we're done */

        if (pvr == ppc_defs[i].pvr) {

            return &ppc_defs[i];

        }

    }

    return NULL;

}


OP(zerof64)

{

    set_opf64(PARAM1, 0);

    FORCE_RET();

}


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

 {
+
     FFMContext *ffm = s->priv_data;

     int64_t pos, avail_size;

static int ffm_is_avail_data(AVFormatContext *s, int size)

{

    FFMContext *ffm = s->priv_data;

    int64_t pos, avail_size;

    int len;

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

    if (size <= len)

        return 1;

    pos = avio_tell(s->pb);

    if (!ffm->write_index) {

        if (pos == ffm->file_size)

            return AVERROR_EOF;

        avail_size = ffm->file_size - pos;

    } else {

    if (pos == ffm->write_index) {

        /* exactly at the end of stream */

        if (ffm->server_attached)

            return AVERROR(EAGAIN);

        else

            return AVERROR_INVALIDDATA;

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

        avail_size = ffm->write_index - pos;

    } else {

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

    }

    }

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

    if (size <= avail_size)

        return 1;

    else if (ffm->server_attached)

        return AVERROR(EAGAIN);

    else

        return AVERROR_INVALIDDATA;

}


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

     QEMUClockType type;

+    for (type = 0; type < QEMU_CLOCK_MAX; type++) {
+
+        tlg->tl[type] = timerlist_new(type, cb, opaque);

     }

void timerlistgroup_init(QEMUTimerListGroup *tlg,

                         QEMUTimerListNotifyCB *cb, void *opaque)

{

    QEMUClockType type;

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

        tlg->tl[type] = timerlist_new(type, cb, opaque);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 int av_write_frame(AVFormatContext *s, AVPacket *pkt)

+{

     int ret;

int av_write_frame(AVFormatContext *s, AVPacket *pkt)

{

    int ret;

    compute_pkt_fields2(s->streams[pkt->stream_index], pkt);

    truncate_ts(s->streams[pkt->stream_index], pkt);

    ret= s->oformat->write_packet(s, pkt);

    if(!ret)

        ret= url_ferror(&s->pb);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static ssize_t mp_pacl_getxattr(FsContext *ctx, const char *path,

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

     char buffer[PATH_MAX];

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

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

{

    char buffer[PATH_MAX];

    return lgetxattr(rpath(ctx, path, buffer), MAP_ACL_ACCESS, value, size);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void visit_optional(Visitor *v, bool *present, const char *name,
+
                     Error **errp)

 {

void visit_optional(Visitor *v, bool *present, const char *name,

                    Error **errp)

{

    if (!error_is_set(errp) && v->optional) {

        v->optional(v, present, name, errp);

    }

}


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

 {

+    GetByteContext gb;
+
+    uint8_t *data = st->codecpar->extradata;
+
+    int data_size = st->codecpar->extradata_size;

     int tag, offset;

static int avi_extract_stream_metadata(AVFormatContext *s, AVStream *st)

{

    GetByteContext gb;

    uint8_t *data = st->codecpar->extradata;

    int data_size = st->codecpar->extradata_size;

    int tag, offset;

    if (!data || data_size < 8) {

        return AVERROR_INVALIDDATA;

    }

    bytestream2_init(&gb, data, data_size);

    tag = bytestream2_get_le32(&gb);

    switch (tag) {

    case MKTAG('A', 'V', 'I', 'F'):

        // skip 4 byte padding

        bytestream2_skip(&gb, 4);

        offset = bytestream2_tell(&gb);

        bytestream2_init(&gb, data + offset, data_size - offset);

        // decode EXIF tags from IFD, AVI is always little-endian

        return avpriv_exif_decode_ifd(s, &gb, 1, 0, &st->metadata);

        break;

    case MKTAG('C', 'A', 'S', 'I'):

        avpriv_request_sample(s, "RIFF stream data tag type CASI (%u)", tag);

        break;

    case MKTAG('Z', 'o', 'r', 'a'):

        avpriv_request_sample(s, "RIFF stream data tag type Zora (%u)", tag);

        break;

    default:

        break;

    }

    return 0;

}


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

                              IOHandler *io_write,

+                             AioFlushHandler *io_flush,
+
+                             void *opaque)
+
+{

     aio_set_fd_handler(qemu_aio_context, fd, io_read, io_write, io_flush,

void qemu_aio_set_fd_handler(int fd,

                             IOHandler *io_read,

                             IOHandler *io_write,

                             AioFlushHandler *io_flush,

                             void *opaque)

{

    aio_set_fd_handler(qemu_aio_context, fd, io_read, io_write, io_flush,

                       opaque);

    qemu_set_fd_handler2(fd, NULL, io_read, io_write, opaque);

}