--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void dec_scall(DisasContext *dc)

 {
+
+    TCGv t0;
+
+    int l1;
+

     if (dc->imm5 == 7) {

static void dec_scall(DisasContext *dc)

{

    TCGv t0;

    int l1;

    if (dc->imm5 == 7) {

        LOG_DIS("scall\n");

    } else if (dc->imm5 == 2) {

        LOG_DIS("break\n");

    } else {

        cpu_abort(dc->env, "invalid opcode\n");

    }

    t0 = tcg_temp_new();

    l1 = gen_new_label();

    if (dc->imm5 == 7) {

        tcg_gen_movi_tl(cpu_pc, dc->pc);

        t_gen_raise_exception(dc, EXCP_SYSTEMCALL);

    } else {

        tcg_gen_movi_tl(cpu_pc, dc->pc);

        t_gen_raise_exception(dc, EXCP_BREAKPOINT);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 int av_asrc_buffer_add_buffer(AVFilterContext *ctx,
+
                               uint8_t *buf, int buf_size, int sample_rate,

                               int sample_fmt, int64_t channel_layout, int planar,

int av_asrc_buffer_add_buffer(AVFilterContext *ctx,

                              uint8_t *buf, int buf_size, int sample_rate,

                              int sample_fmt, int64_t channel_layout, int planar,

                              int64_t pts, int av_unused flags)

{

    uint8_t *data[8];

    int linesize[8];

    int nb_channels = av_get_channel_layout_nb_channels(channel_layout),

        nb_samples  = buf_size / nb_channels / av_get_bytes_per_sample(sample_fmt);

    av_samples_fill_arrays(data, linesize,

                           buf, nb_channels, nb_samples,

                           sample_fmt, 16);

    return av_asrc_buffer_add_samples(ctx,

                                      data, linesize, nb_samples,

                                      sample_rate,

                                      sample_fmt, channel_layout, planar,

                                      pts, flags);

}


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

+{

+    DeviceClass *dc = DEVICE_CLASS(klass);
+
     SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);

     ARMGICClass *agc = ARM_GIC_CLASS(klass);

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);

    ARMGICClass *agc = ARM_GIC_CLASS(klass);

    agc->parent_init = sbc->init;

    sbc->init = arm_gic_init;

    dc->no_user = 1;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+void qemu_set_log_filename(const char *filename)

 {

     char *pidstr;

+    g_free(logfilename);
+

     pidstr = strstr(filename, "%");

void qemu_set_log_filename(const char *filename)

{

    char *pidstr;

    g_free(logfilename);

    pidstr = strstr(filename, "%");

    if (pidstr) {

        /* We only accept one %d, no other format strings */

        if (pidstr[1] != 'd' || strchr(pidstr + 2, '%')) {

            error_report("Bad logfile format: %s", filename);

            logfilename = NULL;

        } else {

            logfilename = g_strdup_printf(filename, getpid());

        }

    } else {

        logfilename = g_strdup(filename);

    }

    qemu_log_close();

    qemu_set_log(qemu_loglevel);

}


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

 {

+    int action;
+
+    char *qapi_value;
+
+

     qapi_value = g_ascii_strdown(p, -1);

int select_watchdog_action(const char *p)

{

    int action;

    char *qapi_value;

    qapi_value = g_ascii_strdown(p, -1);

    action = qapi_enum_parse(&WatchdogAction_lookup, qapi_value, -1, NULL);

    g_free(qapi_value);

    if (action < 0)

        return -1;

    watchdog_action = action;

    return 0;

}


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

     static int device_id = 1;
+
     PCIQXLDevice *qxl = PCI_QXL(dev);

static void qxl_realize_secondary(PCIDevice *dev, Error **errp)

{

    static int device_id = 1;

    PCIQXLDevice *qxl = PCI_QXL(dev);

    qxl->id = device_id++;

    qxl_init_ramsize(qxl);

    memory_region_init_ram(&qxl->vga.vram, OBJECT(dev), "qxl.vgavram",

                           qxl->vga.vram_size, &error_abort);

    vmstate_register_ram(&qxl->vga.vram, &qxl->pci.qdev);

    qxl->vga.vram_ptr = memory_region_get_ram_ptr(&qxl->vga.vram);

    qxl->vga.con = graphic_console_init(DEVICE(dev), 0, &qxl_ops, qxl);

    qxl_realize_common(qxl, errp);

}


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

     AVStream *st;
+

     /* if bit_rate is already set, we believe it */

static void estimate_timings_from_bit_rate(AVFormatContext *ic)

{

    int64_t filesize, duration;

    int i;

    AVStream *st;

    /* if bit_rate is already set, we believe it */

    if (ic->bit_rate <= 0) {

        int bit_rate = 0;

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

            st = ic->streams[i];

            if (st->codec->bit_rate > 0) {

                if (INT_MAX - st->codec->bit_rate > bit_rate) {

                    bit_rate = 0;

                    break;

                }

                bit_rate += st->codec->bit_rate;

            }

        }

        ic->bit_rate = bit_rate;

    }

    /* if duration is already set, we believe it */

    if (ic->duration == AV_NOPTS_VALUE &&

        ic->bit_rate != 0) {

        filesize = ic->pb ? avio_size(ic->pb) : 0;

        if (filesize > 0) {

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

                st = ic->streams[i];

                duration= av_rescale(8*filesize, st->time_base.den, ic->bit_rate*(int64_t)st->time_base.num);

                if (st->duration == AV_NOPTS_VALUE)

                    st->duration = duration;

            }

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 int qemu_uuid_parse(const char *str, QemuUUID *uuid)

 {
+
     unsigned char *uu = &uuid->data[0];

     int ret;

int qemu_uuid_parse(const char *str, QemuUUID *uuid)

{

    unsigned char *uu = &uuid->data[0];

    int ret;

    if (strlen(str) != 36) {

        return -1;

    }

    ret = sscanf(str, UUID_FMT, &uu[0], &uu[1], &uu[2], &uu[3],

                 &uu[4], &uu[5], &uu[6], &uu[7], &uu[8], &uu[9],

                 &uu[10], &uu[11], &uu[12], &uu[13], &uu[14],

                 &uu[15]);

    if (ret != 16) {

        return -1;

    }

    return 0;

}


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

         for (i = 0; i < nevents; i++) {
+
+            struct iocb *iocb = events[i].obj;
+
+            struct qemu_laiocb *laiocb =
+
                     container_of(iocb, struct qemu_laiocb, iocb);

static void qemu_laio_completion_cb(void *opaque)

{

    struct qemu_laio_state *s = opaque;

    while (1) {

        struct io_event events[MAX_EVENTS];

        uint64_t val;

        ssize_t ret;

        struct timespec ts = { 0 };

        int nevents, i;

        do {

            ret = read(s->efd, &val, sizeof(val));

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

        if (ret == -1 && errno == EAGAIN)

            break;

        if (ret != 8)

            break;

        do {

            nevents = io_getevents(s->ctx, val, MAX_EVENTS, events, &ts);

        } while (nevents == -EINTR);

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

            struct iocb *iocb = events[i].obj;

            struct qemu_laiocb *laiocb =

                    container_of(iocb, struct qemu_laiocb, iocb);

            laiocb->ret = io_event_ret(&events[i]);

            qemu_laio_enqueue_completed(s, laiocb);

        }

    }

}


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

     fd = qemu_chr_fe_get_msgfd(cur_mon->chr);

+    if (fd == -1) {
+
+        error_set(errp, QERR_FD_NOT_SUPPLIED);
+
+        return;

     }

void qmp_getfd(const char *fdname, Error **errp)

{

    mon_fd_t *monfd;

    int fd;

    fd = qemu_chr_fe_get_msgfd(cur_mon->chr);

    if (fd == -1) {

        error_set(errp, QERR_FD_NOT_SUPPLIED);

        return;

    }

    if (qemu_isdigit(fdname[0])) {

        error_set(errp, QERR_INVALID_PARAMETER_VALUE, "fdname",

                  "a name not starting with a digit");

        return;

    }

    QLIST_FOREACH(monfd, &cur_mon->fds, next) {

        if (strcmp(monfd->name, fdname) != 0) {

            continue;

        }

        close(monfd->fd);

        monfd->fd = fd;

        return;

    }

    monfd = g_malloc0(sizeof(mon_fd_t));

    monfd->name = g_strdup(fdname);

    monfd->fd = fd;

    QLIST_INSERT_HEAD(&cur_mon->fds, monfd, next);

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     CPUS390XState *env = &cpu->env;

     static bool inited;
+
+    static int cpu_num = 0;
+
+#if !defined(CONFIG_USER_ONLY)
+
     struct tm tm;

 #endif

static void s390_cpu_initfn(Object *obj)

{

    CPUState *cs = CPU(obj);

    S390CPU *cpu = S390_CPU(obj);

    CPUS390XState *env = &cpu->env;

    static bool inited;

    static int cpu_num = 0;

#if !defined(CONFIG_USER_ONLY)

    struct tm tm;

#endif

    cs->env_ptr = env;

    cpu_exec_init(env);

#if !defined(CONFIG_USER_ONLY)

    qemu_register_reset(s390_cpu_machine_reset_cb, cpu);

    qemu_get_timedate(&tm, 0);

    env->tod_offset = TOD_UNIX_EPOCH +

                      (time2tod(mktimegm(&tm)) * 1000000000ULL);

    env->tod_basetime = 0;

    env->tod_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu);

    env->cpu_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_cpu_timer, cpu);

    s390_cpu_set_state(CPU_STATE_STOPPED, cpu);

#endif

    env->cpu_num = cpu_num++;

    env->ext_index = -1;

    if (tcg_enabled() && !inited) {

        inited = true;

        s390x_translate_init();

    }

}


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

+{
+
+#if CONFIG_NETWORK
+
     ff_network_close();

     ff_tls_deinit();

int avformat_network_deinit(void)

{

#if CONFIG_NETWORK

    ff_network_close();

    ff_tls_deinit();

    ff_network_inited_globally = 0;

#endif

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static size_t curl_size_cb(void *ptr, size_t size, size_t nmemb, void *opaque)
+
 {
+
+    CURLState *s = ((CURLState*)opaque);
+
     size_t realsize = size * nmemb;

     size_t fsize;

static size_t curl_size_cb(void *ptr, size_t size, size_t nmemb, void *opaque)

{

    CURLState *s = ((CURLState*)opaque);

    size_t realsize = size * nmemb;

    size_t fsize;

    if(sscanf(ptr, "Content-Length: %zd", &fsize) == 1) {

        s->s->len = fsize;

    }

    return realsize;

}


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

                                 const struct iovec *iov, int iovcnt,

+                                size_t iovoff, bool strip_vlan)

+{

     uint16_t tci = 0;

void net_rx_pkt_attach_iovec(struct NetRxPkt *pkt,

                                const struct iovec *iov, int iovcnt,

                                size_t iovoff, bool strip_vlan)

{

    uint16_t tci = 0;

    uint16_t ploff = iovoff;

    assert(pkt);

    pkt->vlan_stripped = false;

    if (strip_vlan) {

        pkt->vlan_stripped = eth_strip_vlan(iov, iovcnt, iovoff, pkt->ehdr_buf,

                                            &ploff, &tci);

    }

    pkt->tci = tci;

    net_rx_pkt_pull_data(pkt, iov, iovcnt, ploff);

}


int64_t object_property_get_int(Object *obj, const char *name,

                                Error **errp)

{

    QObject *ret = object_property_get_qobject(obj, name, errp);

    QInt *qint;

    int64_t retval;

    if (!ret) {

        return -1;

    }

    qint = qobject_to_qint(ret);

    if (!qint) {

        error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, "int");

        retval = -1;

    } else {

        retval = qint_get_int(qint);

    }

    QDECREF(qint);

    return retval;

}


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

+
+    usb_bus_new(&s->bus, sizeof(s->bus), s->companion_enable ?
+
+                &ehci_bus_ops_companion : &ehci_bus_ops_standalone, dev);
+
     for (i = 0; i < s->portnr; i++) {

         usb_register_port(&s->bus, &s->ports[i], s, i, &ehci_port_ops,

void usb_ehci_realize(EHCIState *s, DeviceState *dev, Error **errp)

{

    int i;

    if (s->portnr > NB_PORTS) {

        error_setg(errp, "Too many ports! Max. port number is %d.",

                   NB_PORTS);

    usb_bus_new(&s->bus, sizeof(s->bus), s->companion_enable ?

                &ehci_bus_ops_companion : &ehci_bus_ops_standalone, dev);

    for (i = 0; i < s->portnr; i++) {

        usb_register_port(&s->bus, &s->ports[i], s, i, &ehci_port_ops,

                          USB_SPEED_MASK_HIGH);

        s->ports[i].dev = 0;

    s->frame_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, ehci_work_timer, s);

    s->async_bh = qemu_bh_new(ehci_work_bh, s);

    s->device = dev;

    s->vmstate = qemu_add_vm_change_state_handler(usb_ehci_vm_state_change, s);


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

 {

+    int ret = qcow2_check_refcounts(bs, result, fix);

     if (ret < 0) {

static int qcow2_check(BlockDriverState *bs, BdrvCheckResult *result,

                       BdrvCheckMode fix)

{

    int ret = qcow2_check_refcounts(bs, result, fix);

    if (ret < 0) {

        return ret;

    }

    if (fix && result->check_errors == 0 && result->corruptions == 0) {

        return qcow2_mark_clean(bs);

    }

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -17,11 +17,11 @@
             run_length *=2;
         if (color) {
             memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length);
+            if (half_vert)
+                memset(s->frame.data[0] + (y+1)*s->frame.linesize[0] + x, color, run_length);
+        }
+        x+= run_length;
+        if (x >= s->avctx->width) {
             x=0;
             y += 1 + half_vert;
         }

static void mm_decode_intra(MmContext * s, int half_horiz, int half_vert, const uint8_t *buf, int buf_size)
{
    int i, x, y;
    i=0; x=0; y=0;
    while(i<buf_size) {
        int run_length, color;
        if (buf[i] & 0x80) {
            run_length = 1;
            color = buf[i];
            i++;
        }else{
            run_length = (buf[i] & 0x7f) + 2;
            color = buf[i+1];
            i+=2;
        }
        if (half_horiz)
            run_length *=2;
        if (color) {
            memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length);
            if (half_vert)
                memset(s->frame.data[0] + (y+1)*s->frame.linesize[0] + x, color, run_length);
        }
        x+= run_length;
        if (x >= s->avctx->width) {
            x=0;
            y += 1 + half_vert;
        }
    }
}


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

     else {

+        monitor_printf(mon, "VNC server active on: ");
+
+        monitor_print_filename(mon, vnc_display->display);
+
+        monitor_printf(mon, "\n");

void do_info_vnc(Monitor *mon)

{

    if (vnc_display == NULL || vnc_display->display == NULL)

        monitor_printf(mon, "VNC server disabled\n");

    else {

        monitor_printf(mon, "VNC server active on: ");

        monitor_print_filename(mon, vnc_display->display);

        monitor_printf(mon, "\n");

	if (vnc_display->clients == NULL)

            monitor_printf(mon, "No client connected\n");

	else

	    monitor_printf(mon, "Client connected\n");

    }

}


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

+    for (y = 0; y <= s->regs[R_VMESHLAST]; y++) {

         for (x = 0; x <= s->regs[R_HMESHLAST]; x++) {

static void pfpu_start(MilkymistPFPUState *s)

{

    int x, y;

    int i;

    for (y = 0; y <= s->regs[R_VMESHLAST]; y++) {

        for (x = 0; x <= s->regs[R_HMESHLAST]; x++) {

            D_EXEC(qemu_log("\nprocessing x=%d y=%d\n", x, y));

            /* set current position */

            s->gp_regs[GPR_X] = x;

            s->gp_regs[GPR_Y] = y;

            /* run microcode on this position */

            i = 0;

            while (pfpu_decode_insn(s)) {

                /* decode at most MICROCODE_WORDS instructions */

                if (i++ >= MICROCODE_WORDS) {

                    error_report("milkymist_pfpu: too many instructions "

                            "executed in microcode. No VECTOUT?");

                    break;

                }

            }

            /* reset pc for next run */

            s->regs[R_PC] = 0;

        }

    }

    s->regs[R_VERTICES] = x * y;

    trace_milkymist_pfpu_pulse_irq();

    qemu_irq_pulse(s->irq);

}


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

     static const enum AVPixelFormat pix_fmts[] = {

+        AV_PIX_FMT_GRAY8,
+
+        AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
+
+        AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,

         AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,

static int query_formats(AVFilterContext *ctx)

{

    static const enum AVPixelFormat pix_fmts[] = {

        AV_PIX_FMT_GRAY8,

        AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,

        AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,

        AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,

        AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,

        AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,

        AV_PIX_FMT_YUVJ411P,

        AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,

        AV_PIX_FMT_NONE

    };

    AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);

    if (!fmts_list)

        return AVERROR(ENOMEM);

    ff_set_common_formats(ctx, fmts_list);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void adb_kbd_realizefn(DeviceState *dev, Error **errp)
+
+{
+
     ADBKeyboardClass *akc = ADB_KEYBOARD_GET_CLASS(dev);

     akc->parent_realize(dev, errp);

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

{

    ADBKeyboardClass *akc = ADB_KEYBOARD_GET_CLASS(dev);

    akc->parent_realize(dev, errp);

    qemu_input_handler_register(dev, &adb_keyboard_handler);

}


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

+    master_fd = qemu_openpty_raw(&slave_fd, pty_name);

     if (master_fd < 0) {

static CharDriverState *qemu_chr_open_pty(const char *id,

                                          ChardevReturn *ret)

{

    CharDriverState *chr;

    PtyCharDriver *s;

    int master_fd, slave_fd;

    char pty_name[PATH_MAX];

    master_fd = qemu_openpty_raw(&slave_fd, pty_name);

    if (master_fd < 0) {

        return NULL;

    }

    close(slave_fd);

    qemu_set_nonblock(master_fd);

    chr = qemu_chr_alloc();

    chr->filename = g_strdup_printf("pty:%s", pty_name);

    ret->pty = g_strdup(pty_name);

    ret->has_pty = true;

    fprintf(stderr, "char device redirected to %s (label %s)\n",

            pty_name, id);

    s = g_malloc0(sizeof(PtyCharDriver));

    chr->opaque = s;

    chr->chr_write = pty_chr_write;

    chr->chr_update_read_handler = pty_chr_update_read_handler;

    chr->chr_close = pty_chr_close;

    chr->chr_add_watch = pty_chr_add_watch;

    chr->explicit_be_open = true;

    s->fd = io_channel_from_fd(master_fd);

    s->timer_tag = 0;

    return chr;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static void pci_bridge_region_init(PCIBridge *br)

 {
+
+    PCIBus *parent = br->dev.bus;
+
     uint16_t cmd = pci_get_word(br->dev.config + PCI_COMMAND);

static void pci_bridge_region_init(PCIBridge *br)

{

    PCIBus *parent = br->dev.bus;

    uint16_t cmd = pci_get_word(br->dev.config + PCI_COMMAND);

    pci_bridge_init_alias(br, &br->alias_pref_mem,

                          PCI_BASE_ADDRESS_MEM_PREFETCH,

                          "pci_bridge_pref_mem",

                          &br->address_space_mem,

                          parent->address_space_mem,

                          cmd & PCI_COMMAND_MEMORY);

    pci_bridge_init_alias(br, &br->alias_mem,

                          PCI_BASE_ADDRESS_SPACE_MEMORY,

                          "pci_bridge_mem",

                          &br->address_space_mem,

                          parent->address_space_mem,

                          cmd & PCI_COMMAND_MEMORY);

    pci_bridge_init_alias(br, &br->alias_io,

                          PCI_BASE_ADDRESS_SPACE_IO,

                          "pci_bridge_io",

                          &br->address_space_io,

                          parent->address_space_io,

                          cmd & PCI_COMMAND_IO);

   /* TODO: optinal VGA and VGA palette snooping support. */

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
 static int64_t get_pts(const char *buf, int *duration)
+
+{

+    int i, hour, min, sec, hsec;
+
+    int he, me, se, mse;
+
+
+
+    for (i=0; i<2; i++) {
+
         int64_t start, end;

         if (sscanf(buf, "%d:%2d:%2d%*1[,.]%3d --> %d:%2d:%2d%*1[,.]%3d",

static int64_t get_pts(const char *buf, int *duration)

{

    int i, hour, min, sec, hsec;

    int he, me, se, mse;

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

        int64_t start, end;

        if (sscanf(buf, "%d:%2d:%2d%*1[,.]%3d --> %d:%2d:%2d%*1[,.]%3d",

                   &hour, &min, &sec, &hsec, &he, &me, &se, &mse) == 8) {

            min += 60*hour;

            sec += 60*min;

            start = sec*1000+hsec;

            me += 60*he;

            se += 60*me;

            end = se*1000+mse;

            *duration = end - start;

            return start;

        }

        buf += strcspn(buf, "\n") + 1;

    }

    return AV_NOPTS_VALUE;

}


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

+
+    return ret < 0 ? ret : ret * BDRV_SECTOR_SIZE;
+
 }

int64_t bdrv_getlength(BlockDriverState *bs)

{

    int64_t ret = bdrv_nb_sectors(bs);

    return ret < 0 ? ret : ret * BDRV_SECTOR_SIZE;

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     unsigned char pixel, count;

     unsigned char *orig = out_buf;
+

     while (1) {

static int expand_rle_row(SgiState *s, uint8_t *out_buf,

                          uint8_t *out_end, int pixelstride)

{

    unsigned char pixel, count;

    unsigned char *orig = out_buf;

    while (1) {

        if (bytestream2_get_bytes_left(&s->g) < 1)

            return AVERROR_INVALIDDATA;

        pixel = bytestream2_get_byteu(&s->g);

        if (!(count = (pixel & 0x7f))) {

            return (out_buf - orig) / pixelstride;

        }

        /* Check for buffer overflow. */

        if(out_buf + pixelstride * count >= out_end) return -1;

        if (pixel & 0x80) {

            while (count--) {

                *out_buf = bytestream2_get_byte(&s->g);

                out_buf += pixelstride;

            }

        } else {

            pixel = bytestream2_get_byte(&s->g);

            while (count--) {

                *out_buf = pixel;

                out_buf += pixelstride;

            }

        }

    }

}


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

         /* TODO inverted pulse on timer->out_val == 1?  */
+
+        qemu_irq_pulse(timer->out);
+
+}

static inline void omap_gp_timer_trigger(struct omap_gp_timer_s *timer)

{

    if (timer->pt)

        /* TODO in overflow-and-match mode if the first event to

         * occurs is the match, don't toggle.  */

        omap_gp_timer_out(timer, !timer->out_val);

    else

        /* TODO inverted pulse on timer->out_val == 1?  */

        qemu_irq_pulse(timer->out);

}


--- a/source.c
+++ b/source.c
@@ -11,7 +11,7 @@
         error_setg(errp, "can't create backend with size 0");

         return;
+
     }

     if (!fb->mem_path) {

file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)

{

    HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(backend);

    if (!backend->size) {

        error_setg(errp, "can't create backend with size 0");

        return;

    }

    if (!fb->mem_path) {

        error_setg(errp, "mem-path property not set");

        return;

    }

#ifndef CONFIG_LINUX

    error_setg(errp, "-mem-path not supported on this host");

#else

    if (!memory_region_size(&backend->mr)) {

        backend->force_prealloc = mem_prealloc;

        memory_region_init_ram_from_file(&backend->mr, OBJECT(backend),

                                 object_get_canonical_path(OBJECT(backend)),

                                 backend->size, fb->share,

                                 fb->mem_path, errp);

    }

#endif

}


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

+                                 ptrdiff_t stride)
+
 {

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

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

                                 ptrdiff_t stride)

{

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

}


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

     int used, off;

+    void *free_func = mq->free_func;

void av_thread_message_flush(AVThreadMessageQueue *mq)

{

#if HAVE_THREADS

    int used, off;

    void *free_func = mq->free_func;

    pthread_mutex_lock(&mq->lock);

    used = av_fifo_size(mq->fifo);

    if (free_func)

        for (off = 0; off < used; off += mq->elsize)

            av_fifo_generic_peek_at(mq->fifo, mq, off, mq->elsize, free_func_wrap);

    av_fifo_drain(mq->fifo, used);

    pthread_cond_broadcast(&mq->cond);

    pthread_mutex_unlock(&mq->lock);

#endif /* HAVE_THREADS */

}


static void dequantization_float(int x, int y, Jpeg2000Cblk *cblk,

                                 Jpeg2000Component *comp,

                                 Jpeg2000T1Context *t1, Jpeg2000Band *band)

{

    int i, j;

    int w = cblk->coord[0][1] - cblk->coord[0][0];

    for (j = 0; j < (cblk->coord[1][1] - cblk->coord[1][0]); ++j) {

        float *datap = &comp->f_data[(comp->coord[0][1] - comp->coord[0][0]) * (y + j) + x];

        int *src = t1->data[j];

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

            datap[i] = src[i] * band->f_stepsize;

    }

}


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

         s->ar = (value >> 1) & 1;

+        s->st = value & 1;
+
+        omap_timer_update(s);
+
+        return;

static void omap_mpu_timer_write(void *opaque, target_phys_addr_t addr,

                                 uint64_t value, unsigned size)

{

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

    if (size != 4) {

        return omap_badwidth_write32(opaque, addr, value);

    }

    switch (addr) {

    case 0x00:	/* CNTL_TIMER */

        omap_timer_sync(s);

        s->enable = (value >> 5) & 1;

        s->ptv = (value >> 2) & 7;

        s->ar = (value >> 1) & 1;

        s->st = value & 1;

        omap_timer_update(s);

        return;

    case 0x04:	/* LOAD_TIM */

        s->reset_val = value;

        return;

    case 0x08:	/* READ_TIM */

        OMAP_RO_REG(addr);

        break;

    default:

        OMAP_BAD_REG(addr);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static inline uint16_t vring_avail_flags(VirtQueue *vq)
+
 {

     VRingMemoryRegionCaches *caches = atomic_rcu_read(&vq->vring.caches);

static inline uint16_t vring_avail_flags(VirtQueue *vq)

{

    VRingMemoryRegionCaches *caches = atomic_rcu_read(&vq->vring.caches);

    hwaddr pa = offsetof(VRingAvail, flags);

    return virtio_lduw_phys_cached(vq->vdev, &caches->avail, pa);

}


--- a/source.c
+++ b/source.c
@@ -7,5 +7,5 @@
     }
     flatview_unref(as->current_map);
     g_free(as->name);
+    g_free(as->ioeventfds);
+}

static void do_address_space_destroy(AddressSpace *as)
{
    MemoryListener *listener;
    address_space_destroy_dispatch(as);
    QTAILQ_FOREACH(listener, &memory_listeners, link) {
        assert(listener->address_space_filter != as);
    }
    flatview_unref(as->current_map);
    g_free(as->name);
    g_free(as->ioeventfds);
}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     PnvChipClass *pcc = PNV_CHIP_GET_CLASS(chip);
     char *typename = pnv_core_typename(pcc->cpu_model);
     size_t typesize = object_type_get_instance_size(typename);
+    int i, core_hwid;
+    if (!object_class_by_name(typename)) {
+        error_setg(errp, "Unable to find PowerNV CPU Core '%s'", typename);
+    /* Cores */
+    pnv_chip_core_sanitize(chip, &error);
     chip->cores = g_malloc0(typesize * chip->nr_cores);
     for (i = 0, core_hwid = 0; (core_hwid < sizeof(chip->cores_mask) * 8)
              && (i < chip->nr_cores); core_hwid++) {

static void pnv_chip_realize(DeviceState *dev, Error **errp)
{
    PnvChip *chip = PNV_CHIP(dev);
    Error *error = NULL;
    PnvChipClass *pcc = PNV_CHIP_GET_CLASS(chip);
    char *typename = pnv_core_typename(pcc->cpu_model);
    size_t typesize = object_type_get_instance_size(typename);
    int i, core_hwid;
    if (!object_class_by_name(typename)) {
        error_setg(errp, "Unable to find PowerNV CPU Core '%s'", typename);
    /* Cores */
    pnv_chip_core_sanitize(chip, &error);
    chip->cores = g_malloc0(typesize * chip->nr_cores);
    for (i = 0, core_hwid = 0; (core_hwid < sizeof(chip->cores_mask) * 8)
             && (i < chip->nr_cores); core_hwid++) {
        char core_name[32];
        void *pnv_core = chip->cores + i * typesize;
        if (!(chip->cores_mask & (1ull << core_hwid))) {
            continue;
        object_initialize(pnv_core, typesize, typename);
        snprintf(core_name, sizeof(core_name), "core[%d]", core_hwid);
        object_property_add_child(OBJECT(chip), core_name, OBJECT(pnv_core),
                                  &error_fatal);
        object_property_set_int(OBJECT(pnv_core), smp_threads, "nr-threads",
                                &error_fatal);
        object_property_set_int(OBJECT(pnv_core), core_hwid,
                                CPU_CORE_PROP_CORE_ID, &error_fatal);
        object_property_set_int(OBJECT(pnv_core),
                                pcc->core_pir(chip, core_hwid),
                                "pir", &error_fatal);
        object_property_set_bool(OBJECT(pnv_core), true, "realized",
                                 &error_fatal);
        object_unref(OBJECT(pnv_core));
        i++;
    g_free(typename);


--- a/source.c
+++ b/source.c
@@ -15,7 +15,7 @@
     /* blk_new_open() is mainly used in .bdrv_create implementations and the

      * tools where sharing isn't a concern because the BDS stays private, so we
+
      * just request permission according to the flags.

      *

BlockBackend *blk_new_open(const char *filename, const char *reference,

                           QDict *options, int flags, Error **errp)

{

    BlockBackend *blk;

    BlockDriverState *bs;

    uint64_t perm;

    /* blk_new_open() is mainly used in .bdrv_create implementations and the

     * tools where sharing isn't a concern because the BDS stays private, so we

     * just request permission according to the flags.

     *

     * The exceptions are xen_disk and blockdev_init(); in these cases, the

     * caller of blk_new_open() doesn't make use of the permissions, but they

     * shouldn't hurt either. We can still share everything here because the

     * guest devices will add their own blockers if they can't share. */

    perm = BLK_PERM_CONSISTENT_READ;

    if (flags & BDRV_O_RDWR) {

        perm |= BLK_PERM_WRITE;

    }

    if (flags & BDRV_O_RESIZE) {

        perm |= BLK_PERM_RESIZE;

    }

    blk = blk_new(perm, BLK_PERM_ALL);

    bs = bdrv_open(filename, reference, options, flags, errp);

    if (!bs) {

        blk_unref(blk);

        return NULL;

    }

    blk->root = bdrv_root_attach_child(bs, "root", &child_root,

                                       perm, BLK_PERM_ALL, blk, &error_abort);

    return blk;

}


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

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

     }

static av_cold int gif_encode_init(AVCodecContext *avctx)

{

    GIFContext *s = avctx->priv_data;

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

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

        return AVERROR(EINVAL);

    }

#if FF_API_CODED_FRAME

FF_DISABLE_DEPRECATION_WARNINGS

    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;

    avctx->coded_frame->key_frame = 1;

FF_ENABLE_DEPRECATION_WARNINGS

#endif

    s->transparent_index = -1;

    s->lzw = av_mallocz(ff_lzw_encode_state_size);

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

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

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

        return AVERROR(ENOMEM);

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

        av_assert0(avctx->pix_fmt == AV_PIX_FMT_PAL8);

    return 0;

}


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

     const NetdevVdeOptions *vde;

+
+
+    assert(opts->type == NET_CLIENT_OPTIONS_KIND_VDE);
+
+    vde = opts->u.vde;

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

                 NetClientState *peer, Error **errp)

{

    /* FIXME error_setg(errp, ...) on failure */

    const NetdevVdeOptions *vde;

    assert(opts->type == NET_CLIENT_OPTIONS_KIND_VDE);

    vde = opts->u.vde;

    /* missing optional values have been initialized to "all bits zero" */

    if (net_vde_init(peer, "vde", name, vde->sock, vde->port, vde->group,

                     vde->has_mode ? vde->mode : 0700) == -1) {

        return -1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     char proto_str[128], *q;

+
     p = filename;

     q = proto_str;

int url_open(URLContext **puc, const char *filename, int flags)

{

    URLProtocol *up;

    const char *p;

    char proto_str[128], *q;

    p = filename;

    q = proto_str;

    while (*p != '\0' && *p != ':') {

        /* protocols can only contain alphabetic chars */

        if (!isalpha(*p))

            goto file_proto;

        if ((q - proto_str) < sizeof(proto_str) - 1)

            *q++ = *p;

        p++;

    }

    /* if the protocol has length 1, we consider it is a dos drive */

    if (*p == '\0' || (q - proto_str) <= 1) {

    file_proto:

        strcpy(proto_str, "file");

    } else {

        *q = '\0';

    }

    up = first_protocol;

    while (up != NULL) {

        if (!strcmp(proto_str, up->name))

            return url_open_protocol (puc, up, filename, flags);

        up = up->next;

    }

    *puc = NULL;

    return AVERROR(ENOENT);

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+AioContext *aio_context_new(void)

 {

     AioContext *ctx;

     ctx = (AioContext *) g_source_new(&aio_source_funcs, sizeof(AioContext));
+
+    ctx->pollfds = g_array_new(FALSE, FALSE, sizeof(GPollFD));

     ctx->thread_pool = NULL;

AioContext *aio_context_new(void)

{

    AioContext *ctx;

    ctx = (AioContext *) g_source_new(&aio_source_funcs, sizeof(AioContext));

    ctx->pollfds = g_array_new(FALSE, FALSE, sizeof(GPollFD));

    ctx->thread_pool = NULL;

    qemu_mutex_init(&ctx->bh_lock);

    rfifolock_init(&ctx->lock, aio_rfifolock_cb, ctx);

    event_notifier_init(&ctx->notifier, false);

    aio_set_event_notifier(ctx, &ctx->notifier,

                           (EventNotifierHandler *)

                           event_notifier_test_and_clear);

    timerlistgroup_init(&ctx->tlg, aio_timerlist_notify, ctx);

    return ctx;

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     *pcyls = bs->cyls;

     *pheads = bs->heads;
+
+    *psecs = bs->secs;
+
 }

void bdrv_get_geometry_hint(BlockDriverState *bs,

                            int *pcyls, int *pheads, int *psecs)

{

    *pcyls = bs->cyls;

    *pheads = bs->heads;

    *psecs = bs->secs;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+DriveInfo *add_init_drive(const char *optstr)

+{

     DriveInfo *dinfo;
+
     QemuOpts *opts;

     MachineClass *mc;

DriveInfo *add_init_drive(const char *optstr)

{

    DriveInfo *dinfo;

    QemuOpts *opts;

    MachineClass *mc;

    opts = drive_def(optstr);

    if (!opts)

        return NULL;

    mc = MACHINE_GET_CLASS(current_machine);

    dinfo = drive_new(opts, mc->block_default_type);

    if (!dinfo) {

        qemu_opts_del(opts);

        return NULL;

    }

    return dinfo;

}


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

     tcg_gen_andi_tl(cpu_xer, src,

static void gen_write_xer(TCGv src)

{

    tcg_gen_andi_tl(cpu_xer, src,

                    ~((1u << XER_SO) | (1u << XER_OV) | (1u << XER_CA)));

    tcg_gen_extract_tl(cpu_so, src, XER_SO, 1);

    tcg_gen_extract_tl(cpu_ov, src, XER_OV, 1);

    tcg_gen_extract_tl(cpu_ca, src, XER_CA, 1);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static RemoveResult remove_hpte(PowerPCCPU *cpu, target_ulong ptex,
+
+                                target_ulong avpn,
+
+                                target_ulong flags,
+
                                 target_ulong *vp, target_ulong *rp)

 {

static RemoveResult remove_hpte(PowerPCCPU *cpu, target_ulong ptex,

                                target_ulong avpn,

                                target_ulong flags,

                                target_ulong *vp, target_ulong *rp)

{

    CPUPPCState *env = &cpu->env;

    uint64_t token;

    target_ulong v, r;

    if (!valid_pte_index(env, ptex)) {

        return REMOVE_PARM;

    }

    token = ppc_hash64_start_access(cpu, ptex);

    v = ppc_hash64_load_hpte0(cpu, token, 0);

    r = ppc_hash64_load_hpte1(cpu, token, 0);

    ppc_hash64_stop_access(token);

    if ((v & HPTE64_V_VALID) == 0 ||

        ((flags & H_AVPN) && (v & ~0x7fULL) != avpn) ||

        ((flags & H_ANDCOND) && (v & avpn) != 0)) {

        return REMOVE_NOT_FOUND;

    }

    *vp = v;

    *rp = r;

    ppc_hash64_store_hpte(cpu, ptex, HPTE64_V_HPTE_DIRTY, 0);

    ppc_hash64_tlb_flush_hpte(cpu, ptex, v, r);

    return REMOVE_SUCCESS;

}


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

                                int32_t arg2, int const_arg2, int label)

+{
+
+    tcg_out_cmp(s, arg1, arg2, const_arg2);

     tcg_out_bpcc(s, tcg_cond_to_bcond[cond], BPCC_ICC | BPCC_PT, label);

static void tcg_out_brcond_i32(TCGContext *s, TCGCond cond, TCGReg arg1,

                               int32_t arg2, int const_arg2, int label)

{

    tcg_out_cmp(s, arg1, arg2, const_arg2);

    tcg_out_bpcc(s, tcg_cond_to_bcond[cond], BPCC_ICC | BPCC_PT, label);

    tcg_out_nop(s);

}


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

     }

+    s->me.mv_penalty= default_mv_penalty;
+
+    s->fcode_tab= default_fcode_tab;
+
+}

static void MPV_encode_defaults(MpegEncContext *s){

    static int done=0;

    MPV_common_defaults(s);

    if(!done){

        int i;

        done=1;

        for(i=-16; i<16; i++){

            default_fcode_tab[i + MAX_MV]= 1;

        }

    }

    s->me.mv_penalty= default_mv_penalty;

    s->fcode_tab= default_fcode_tab;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void qpci_pc_config_writel(QPCIBus *bus, int devfn, uint8_t offset, uint32_t value)
+
 {

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

static void qpci_pc_config_writel(QPCIBus *bus, int devfn, uint8_t offset, uint32_t value)

{

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

    outl(0xcfc, value);

}


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

+    /* Determine the security model */
+
     if (fs_ctx->fs_sm == SM_MAPPED) {
+
         err = mknod(rpath(fs_ctx, path), SM_LOCAL_MODE_BITS|S_IFREG, 0);

         if (err == -1) {

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

{

    int err = -1;

    int serrno = 0;

    /* Determine the security model */

    if (fs_ctx->fs_sm == SM_MAPPED) {

        err = mknod(rpath(fs_ctx, path), SM_LOCAL_MODE_BITS|S_IFREG, 0);

        if (err == -1) {

            return err;

        }

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

        if (err == -1) {

            serrno = errno;

            goto err_end;

        }

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

        err = mknod(rpath(fs_ctx, path), credp->fc_mode, credp->fc_rdev);

        if (err == -1) {

            return err;

        }

        err = local_post_create_passthrough(fs_ctx, path, credp);

        if (err == -1) {

            serrno = errno;

            goto err_end;

        }

    }

    return err;

err_end:

    remove(rpath(fs_ctx, path));

    errno = serrno;

    return err;

}


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

         switch (ret) {

+        case -EEXIST:
+
+            fprintf(stderr, "property \"%s.%s\": \"%s\" is already in use\n",
+
+                    dev->info->name, name, value);

             break;

int qdev_prop_parse(DeviceState *dev, const char *name, const char *value)

{

    Property *prop;

    int ret;

    prop = qdev_prop_find(dev, name);

    if (!prop) {

        fprintf(stderr, "property \"%s.%s\" not found\n",

                dev->info->name, name);

        return -1;

    }

    if (!prop->info->parse) {

        fprintf(stderr, "property \"%s.%s\" has no parser\n",

                dev->info->name, name);

        return -1;

    }

    ret = prop->info->parse(dev, prop, value);

    if (ret < 0) {

        switch (ret) {

        case -EEXIST:

            fprintf(stderr, "property \"%s.%s\": \"%s\" is already in use\n",

                    dev->info->name, name, value);

            break;

        default:

        case -EINVAL:

            fprintf(stderr, "property \"%s.%s\": failed to parse \"%s\"\n",

                    dev->info->name, name, value);

            break;

        case -ENOENT:

            fprintf(stderr, "property \"%s.%s\": could not find \"%s\"\n",

                    dev->info->name, name, value);

            break;

        }

        return -1;

    }

    return 0;

}


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

+
+        ret = kvm_vm_ioctl(s, KVM_UNREGISTER_COALESCED_MMIO, &zone);
+
+    }
+

     return ret;

int kvm_uncoalesce_mmio_region(target_phys_addr_t start, ram_addr_t size)

{

    int ret = -ENOSYS;

    KVMState *s = kvm_state;

    if (s->coalesced_mmio) {

        struct kvm_coalesced_mmio_zone zone;

        zone.addr = start;

        zone.size = size;

        ret = kvm_vm_ioctl(s, KVM_UNREGISTER_COALESCED_MMIO, &zone);

    }

    return ret;

}


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

 {

+    qemu_put_byte(f, v >> 8);
+
     qemu_put_byte(f, v);

 }

void qemu_put_be16(QEMUFile *f, unsigned int v)

{

    qemu_put_byte(f, v >> 8);

    qemu_put_byte(f, v);

}


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

     assert(pointer_size == 1 || pointer_size == 2 ||

+           pointer_size == 4 || pointer_size == 8);
+
+
+
+    g_array_append_val(linker, entry);

 }

void bios_linker_loader_add_pointer(GArray *linker,

                                    const char *dest_file,

                                    const char *src_file,

                                    GArray *table, void *pointer,

                                    uint8_t pointer_size)

{

    BiosLinkerLoaderEntry entry;

    memset(&entry, 0, sizeof entry);

    strncpy(entry.pointer.dest_file, dest_file,

            sizeof entry.pointer.dest_file - 1);

    strncpy(entry.pointer.src_file, src_file,

            sizeof entry.pointer.src_file - 1);

    entry.command = cpu_to_le32(BIOS_LINKER_LOADER_COMMAND_ADD_POINTER);

    entry.pointer.offset = cpu_to_le32((gchar *)pointer - table->data);

    entry.pointer.size = pointer_size;

    assert(pointer_size == 1 || pointer_size == 2 ||

           pointer_size == 4 || pointer_size == 8);

    g_array_append_val(linker, entry);

}


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

                                 unsigned size)
+
+{

     return 0;

static uint64_t mips_qemu_read (void *opaque, target_phys_addr_t addr,

                                unsigned size)

{

    return 0;

}


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

 {

+    QDECREF(lexer->token);

 }

void json_lexer_destroy(JSONLexer *lexer)

{

    QDECREF(lexer->token);

}


int64 float32_to_int64_round_to_zero( float32 a STATUS_PARAM )

{

    flag aSign;

    int16 aExp, shiftCount;

    bits32 aSig;

    bits64 aSig64;

    int64 z;

    aSig = extractFloat32Frac( a );

    aExp = extractFloat32Exp( a );

    aSign = extractFloat32Sign( a );

    shiftCount = aExp - 0xBE;

    if ( 0 <= shiftCount ) {

        if ( a != 0xDF000000 ) {

            float_raise( float_flag_invalid STATUS_VAR);

            if ( ! aSign || ( ( aExp == 0xFF ) && aSig ) ) {

                return LIT64( 0x7FFFFFFFFFFFFFFF );

            }

        }

        return (sbits64) LIT64( 0x8000000000000000 );

    }

    else if ( aExp <= 0x7E ) {

        if ( aExp | aSig ) STATUS(float_exception_flags) |= float_flag_inexact;

        return 0;

    }

    aSig64 = aSig | 0x00800000;

    aSig64 <<= 40;

    z = aSig64>>( - shiftCount );

    if ( (bits64) ( aSig64<<( shiftCount & 63 ) ) ) {

        STATUS(float_exception_flags) |= float_flag_inexact;

    }

    if ( aSign ) z = - z;

    return z;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static always_inline void gen_op_subfeo (void)
+
 {
+
     gen_op_move_T2_T0();

     gen_op_subfe();

static always_inline void gen_op_subfeo (void)

{

    gen_op_move_T2_T0();

    gen_op_subfe();

    gen_op_check_subfo();

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 int bdrv_write_zeroes(BlockDriverState *bs, int64_t sector_num,

                       int nb_sectors, BdrvRequestFlags flags)
+
+{

     return bdrv_rw_co(bs, sector_num, NULL, nb_sectors, true,

int bdrv_write_zeroes(BlockDriverState *bs, int64_t sector_num,

                      int nb_sectors, BdrvRequestFlags flags)

{

    return bdrv_rw_co(bs, sector_num, NULL, nb_sectors, true,

                      BDRV_REQ_ZERO_WRITE | flags);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int get_cox(J2kDecoderContext *s, J2kCodingStyle *c)
+
 {

     if (s->buf_end - s->buf < 5)
+
         return AVERROR(EINVAL);

           c->nreslevels = bytestream_get_byte(&s->buf) + 1; // num of resolution levels - 1
@@ -11,7 +11,7 @@
      c->log2_cblk_width = bytestream_get_byte(&s->buf) + 2; // cblk width

     c->log2_cblk_height = bytestream_get_byte(&s->buf) + 2; // cblk height
+

     c->cblk_style = bytestream_get_byte(&s->buf);

static int get_cox(J2kDecoderContext *s, J2kCodingStyle *c)

{

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

        return AVERROR(EINVAL);

          c->nreslevels = bytestream_get_byte(&s->buf) + 1; // num of resolution levels - 1

     c->log2_cblk_width = bytestream_get_byte(&s->buf) + 2; // cblk width

    c->log2_cblk_height = bytestream_get_byte(&s->buf) + 2; // cblk height

    c->cblk_style = bytestream_get_byte(&s->buf);

    if (c->cblk_style != 0){ // cblk style

        av_log(s->avctx, AV_LOG_WARNING, "extra cblk styles %X\n", c->cblk_style);

    }

    c->transform = bytestream_get_byte(&s->buf); // transformation

    if (c->csty & J2K_CSTY_PREC) {

        int i;

        for (i = 0; i < c->nreslevels; i++)

            bytestream_get_byte(&s->buf);

    }

    return 0;

}


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

         if (ret < 0) {

+            qemu_file_set_error(f, ret);
+
+        }
+
+    } else {

         qemu_file_set_error(f, ret);

void ram_control_load_hook(QEMUFile *f, uint64_t flags)

{

    int ret = 0;

    if (f->ops->hook_ram_load) {

        ret = f->ops->hook_ram_load(f, f->opaque, flags);

        if (ret < 0) {

            qemu_file_set_error(f, ret);

        }

    } else {

        qemu_file_set_error(f, ret);

    }

}


--- a/source.c
+++ b/source.c
@@ -35,9 +35,9 @@
             pos += ts->raw_packet_size;

         }
+
+
+
+    return AV_NOPTS_VALUE;
+
 }

static int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index,

                              int64_t *ppos, int64_t pos_limit)

{

    MpegTSContext *ts = s->priv_data;

    int64_t pos, timestamp;

    uint8_t buf[TS_PACKET_SIZE];

    int pcr_l, pcr_pid = ((PESContext*)s->streams[stream_index]->priv_data)->pcr_pid;

    pos = ((*ppos  + ts->raw_packet_size - 1 - ts->pos47) / ts->raw_packet_size) * ts->raw_packet_size + ts->pos47;

        while(pos < pos_limit) {

            avio_seek(s->pb, pos, SEEK_SET);

            if (avio_read(s->pb, buf, TS_PACKET_SIZE) != TS_PACKET_SIZE)

                return AV_NOPTS_VALUE;

            if ((pcr_pid < 0 || (AV_RB16(buf + 1) & 0x1fff) == pcr_pid) &&

                parse_pcr(&timestamp, &pcr_l, buf) == 0) {

                *ppos = pos;

                return timestamp;

            }

            pos += ts->raw_packet_size;

        }

    return AV_NOPTS_VALUE;

}


--- a/source.c
+++ b/source.c
@@ -24,11 +24,11 @@
         goto out_nofid;
     }
     err = v9fs_co_fstat(pdu, fidp->fs.fd, &stbuf);
+    if (err < 0) {
+        goto out;
+    }
+    status = P9_LOCK_SUCCESS;
+out:
     put_fid(pdu, fidp);
 out_nofid:
     err = offset;

static void v9fs_lock(void *opaque)
{
    int8_t status;
    V9fsFlock *flock;
    size_t offset = 7;
    struct stat stbuf;
    V9fsFidState *fidp;
    int32_t fid, err = 0;
    V9fsPDU *pdu = opaque;
    V9fsState *s = pdu->s;
    flock = g_malloc(sizeof(*flock));
    pdu_unmarshal(pdu, offset, "dbdqqds", &fid, &flock->type,
                  &flock->flags, &flock->start, &flock->length,
                  &flock->proc_id, &flock->client_id);
    status = P9_LOCK_ERROR;
    /* We support only block flag now (that too ignored currently) */
    if (flock->flags & ~P9_LOCK_FLAGS_BLOCK) {
        err = -EINVAL;
        goto out_nofid;
    }
    fidp = get_fid(pdu, fid);
    if (fidp == NULL) {
        err = -ENOENT;
        goto out_nofid;
    }
    err = v9fs_co_fstat(pdu, fidp->fs.fd, &stbuf);
    if (err < 0) {
        goto out;
    }
    status = P9_LOCK_SUCCESS;
out:
    put_fid(pdu, fidp);
out_nofid:
    err = offset;
    err += pdu_marshal(pdu, offset, "b", status);
    trace_v9fs_lock_return(pdu->tag, pdu->id, status);
    complete_pdu(s, pdu, err);
    v9fs_string_free(&flock->client_id);
    g_free(flock);
}


--- a/source.c
+++ b/source.c
@@ -53,11 +53,11 @@
                 s->decoded[channel][sample] = get_sbits(&s->gb, tmp);

+        else
+
+        {
+
+//            av_log(s->avctx, AV_LOG_DEBUG, "rice coded partition k=%d\n", tmp);

             for (; i < samples; i++, sample++){

static int decode_residuals(FLACContext *s, int channel, int pred_order)

{

    int i, tmp, partition, method_type, rice_order;

    int sample = 0, samples;

    method_type = get_bits(&s->gb, 2);

    if (method_type != 0){

        av_log(s->avctx, AV_LOG_DEBUG, "illegal residual coding method %d\n", method_type);

    rice_order = get_bits(&s->gb, 4);

    samples= s->blocksize >> rice_order;

    sample=

    i= pred_order;

    for (partition = 0; partition < (1 << rice_order); partition++)

    {

        tmp = get_bits(&s->gb, 4);

        if (tmp == 15)

        {

            av_log(s->avctx, AV_LOG_DEBUG, "fixed len partition\n");

            tmp = get_bits(&s->gb, 5);

            for (; i < samples; i++, sample++)

                s->decoded[channel][sample] = get_sbits(&s->gb, tmp);

        else

        {

//            av_log(s->avctx, AV_LOG_DEBUG, "rice coded partition k=%d\n", tmp);

            for (; i < samples; i++, sample++){

                s->decoded[channel][sample] = get_sr_golomb_flac(&s->gb, tmp, INT_MAX, 0);

        i= 0;

//    av_log(s->avctx, AV_LOG_DEBUG, "partitions: %d, samples: %d\n", 1 << rice_order, sample);

    return 0;


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 static inline void RENAME(bgr15ToY)(uint8_t *dst, uint8_t *src, int width)
+
+{

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

 		int d= ((uint16_t*)src)[i];

static inline void RENAME(bgr15ToY)(uint8_t *dst, uint8_t *src, int width)

{

	int i;

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

	{

		int d= ((uint16_t*)src)[i];

		int b= d&0x1F;

		int g= (d>>5)&0x1F;

		int r= (d>>10)&0x1F;

		dst[i]= ((RY*r + GY*g + BY*b)>>(RGB2YUV_SHIFT-3)) + 16;

	}

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static inline uint64_t ram_chunk_index(const uint8_t *start,
+
+                                       const uint8_t *host)

 {

static inline uint64_t ram_chunk_index(const uint8_t *start,

                                       const uint8_t *host)

{

    return ((uintptr_t) host - (uintptr_t) start) >> RDMA_REG_CHUNK_SHIFT;

}


--- a/source.c
+++ b/source.c
@@ -1,23 +1,23 @@
 void hmp_drive_add(Monitor *mon, const QDict *qdict)
+
 {

     DriveInfo *dinfo = NULL;
+
     const char *opts = qdict_get_str(qdict, "opts");

+

     dinfo = add_init_drive(opts);
+
     if (!dinfo) {
+
+        goto err;
+
     }

     if (dinfo->devaddr) {
+
         monitor_printf(mon, "Parameter addr not supported\n");

         goto err;

void hmp_drive_add(Monitor *mon, const QDict *qdict)

{

    DriveInfo *dinfo = NULL;

    const char *opts = qdict_get_str(qdict, "opts");

    dinfo = add_init_drive(opts);

    if (!dinfo) {

        goto err;

    }

    if (dinfo->devaddr) {

        monitor_printf(mon, "Parameter addr not supported\n");

        goto err;

    }

    switch (dinfo->type) {

    case IF_NONE:

        monitor_printf(mon, "OK\n");

        break;

    default:

        if (pci_drive_hot_add(mon, qdict, dinfo)) {

            goto err;

        }

    }

    return;

err:

    if (dinfo) {

        blk_unref(blk_by_legacy_dinfo(dinfo));

    }

}


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

     AHCIPortRegs *pr = &ad->port_regs;

+

     if (ad->init_d2h_sent) {

static void ahci_init_d2h(AHCIDevice *ad)

{

    IDEState *ide_state = &ad->port.ifs[0];

    AHCIPortRegs *pr = &ad->port_regs;

    if (ad->init_d2h_sent) {

        return;

    }

    if (ahci_write_fis_d2h(ad)) {

        ad->init_d2h_sent = true;

        /* We're emulating receiving the first Reg H2D Fis from the device;

         * Update the SIG register, but otherwise proceed as normal. */

        pr->sig = (ide_state->hcyl << 24) |

            (ide_state->lcyl << 16) |

            (ide_state->sector << 8) |

            (ide_state->nsector & 0xFF);

    }

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     int height = FFMIN(avctx->height, C64YRES);

     int width  = FFMIN(avctx->width , C64XRES);
+
     uint8_t *src = p->data[0];

static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest)

{

    int blockx, blocky, x, y;

    int luma = 0;

    int height = FFMIN(avctx->height, C64YRES);

    int width  = FFMIN(avctx->width , C64XRES);

    uint8_t *src = p->data[0];

    for (blocky = 0; blocky < C64YRES; blocky += 8) {

        for (blockx = 0; blockx < C64XRES; blockx += 8) {

            for (y = blocky; y < blocky + 8 && y < C64YRES; y++) {

                for (x = blockx; x < blockx + 8 && x < C64XRES; x += 2) {

                    if(x < width && y < height) {

                        /* build average over 2 pixels */

                        luma = (src[(x + 0 + y * p->linesize[0])] +

                                src[(x + 1 + y * p->linesize[0])]) / 2;

                        /* write blocks as linear data now so they are suitable for elbg */

                        dest[0] = luma;

                    }

                    dest++;

                }

            }

        }

    }

}


static int t15(InterplayACMContext *s, unsigned ind, unsigned col)

{

    GetBitContext *gb = &s->gb;

    unsigned i, b;

    int n1, n2, n3;

    for (i = 0; i < s->rows; i++) {

        /* b = (x1) + (x2 * 3) + (x3 * 9) */

        b = get_bits(gb, 5);

        n1 =  (mul_3x3[b] & 0x0F) - 1;

        n2 = ((mul_3x3[b] >> 4) & 0x0F) - 1;

        n3 = ((mul_3x3[b] >> 8) & 0x0F) - 1;

        set_pos(s, i++, col, n1);

        if (i >= s->rows)

            break;

        set_pos(s, i++, col, n2);

        if (i >= s->rows)

            break;

        set_pos(s, i, col, n3);

    return 0;


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
     /* Clean up all causes that may be delayed */

     core->delayed_causes |= *causes & delayable_causes;
+
+    *causes &= ~delayable_causes;
+
+
+
     /* If there are causes that cannot be delayed */

     if (causes != 0) {

e1000e_intrmgr_delay_tx_causes(E1000ECore *core, uint32_t *causes)

{

    static const uint32_t delayable_causes = E1000_ICR_TXQ0 |

                                             E1000_ICR_TXQ1 |

                                             E1000_ICR_TXQE |

                                             E1000_ICR_TXDW;

    if (msix_enabled(core->owner)) {

        return false;

    }

    /* Clean up all causes that may be delayed */

    core->delayed_causes |= *causes & delayable_causes;

    *causes &= ~delayable_causes;

    /* If there are causes that cannot be delayed */

    if (causes != 0) {

        return false;

    }

    /* All causes delayed */

    e1000e_intrmgr_rearm_timer(&core->tidv);

    if (!core->tadv.running && (core->mac[TADV] != 0)) {

        e1000e_intrmgr_rearm_timer(&core->tadv);

    }

    return true;

}


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

 {

+    EventNotifierTestData data = { .n = 0, .active = 1 };

     event_notifier_init(&data.e, false);

static void test_wait_event_notifier(void)

{

    EventNotifierTestData data = { .n = 0, .active = 1 };

    event_notifier_init(&data.e, false);

    aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb);

    g_assert(aio_poll(ctx, false));

    g_assert_cmpint(data.n, ==, 0);

    g_assert_cmpint(data.active, ==, 1);

    event_notifier_set(&data.e);

    g_assert(aio_poll(ctx, false));

    g_assert_cmpint(data.n, ==, 1);

    g_assert_cmpint(data.active, ==, 0);

    g_assert(!aio_poll(ctx, false));

    g_assert_cmpint(data.n, ==, 1);

    g_assert_cmpint(data.active, ==, 0);

    aio_set_event_notifier(ctx, &data.e, NULL, NULL);

    g_assert(!aio_poll(ctx, false));

    g_assert_cmpint(data.n, ==, 1);

    event_notifier_cleanup(&data.e);

}


--- a/source.c
+++ b/source.c
@@ -27,11 +27,11 @@
     c = strchr(filename, ':');

     if (c == NULL) {
+
+        return -EINVAL;
+
+    }
+

     raw = strdup(filename);

static int blkverify_open(BlockDriverState *bs, const char *filename, int flags)

{

    BDRVBlkverifyState *s = bs->opaque;

    int ret;

    char *raw, *c;

    /* Parse the blkverify: prefix */

    if (strncmp(filename, "blkverify:", strlen("blkverify:"))) {

        return -EINVAL;

    }

    filename += strlen("blkverify:");

    /* Parse the raw image filename */

    c = strchr(filename, ':');

    if (c == NULL) {

        return -EINVAL;

    }

    raw = strdup(filename);

    raw[c - filename] = '\0';

    ret = bdrv_file_open(&bs->file, raw, flags);

    free(raw);

    if (ret < 0) {

        return ret;

    }

    filename = c + 1;

    /* Open the test file */

    s->test_file = bdrv_new("");

    ret = bdrv_open(s->test_file, filename, flags, NULL);

    if (ret < 0) {

        bdrv_delete(s->test_file);

        s->test_file = NULL;

        return ret;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void rtas_ibm_os_term(PowerPCCPU *cpu,

+                            sPAPRMachineState *spapr,

                             uint32_t token, uint32_t nargs,

static void rtas_ibm_os_term(PowerPCCPU *cpu,

                            sPAPRMachineState *spapr,

                            uint32_t token, uint32_t nargs,

                            target_ulong args,

                            uint32_t nret, target_ulong rets)

{

    target_ulong ret = 0;

    qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_PAUSE, &error_abort);

    rtas_st(rets, 0, ret);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int vid_probe(AVProbeData *p)
+
+{
+
     // little endian VID tag, file starts with "VID\0"

     if (p->buf_size < 4 || AV_RL32(p->buf) != MKTAG('V', 'I', 'D', 0))

static int vid_probe(AVProbeData *p)

{

    // little endian VID tag, file starts with "VID\0"

    if (p->buf_size < 4 || AV_RL32(p->buf) != MKTAG('V', 'I', 'D', 0))

        return 0;

    return AVPROBE_SCORE_MAX;

}


static av_cold int validate_options(AVCodecContext *avctx, AC3EncodeContext *s)

{

    int i, j;

    if (!avctx->channel_layout) {

        av_log(avctx, AV_LOG_WARNING, "No channel layout specified. The "

                                      "encoder will guess the layout, but it "

                                      "might be incorrect.\n");

    }

    if (set_channel_info(s, avctx->channels, &avctx->channel_layout)) {

        av_log(avctx, AV_LOG_ERROR, "invalid channel layout\n");

        return -1;

    }

    /* frequency */

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

        for (j = 0; j < 3; j++)

            if ((ff_ac3_sample_rate_tab[j] >> i) == avctx->sample_rate)

                goto found;

    }

    return -1;

 found:

    s->sample_rate        = avctx->sample_rate;

    s->bit_alloc.sr_shift = i;

    s->bit_alloc.sr_code  = j;

    s->bitstream_id       = 8 + s->bit_alloc.sr_shift;

    s->bitstream_mode     = 0; /* complete main audio service */

    /* bitrate & frame size */

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

        if ((ff_ac3_bitrate_tab[i] >> s->bit_alloc.sr_shift)*1000 == avctx->bit_rate)

            break;

    }

    if (i == 19)

        return -1;

    s->bit_rate        = avctx->bit_rate;

    s->frame_size_code = i << 1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static uint32_t virtio_net_bad_features(VirtIODevice *vdev)

 {
+
+    uint32_t features = 0;
+
+

     /* Linux kernel 2.6.25.  It understood MAC (as everyone must),

static uint32_t virtio_net_bad_features(VirtIODevice *vdev)

{

    uint32_t features = 0;

    /* Linux kernel 2.6.25.  It understood MAC (as everyone must),

     * but also these: */

    features |= (1 << VIRTIO_NET_F_MAC);

    features |= (1 << VIRTIO_NET_F_GUEST_CSUM);

    features |= (1 << VIRTIO_NET_F_GUEST_TSO4);

    features |= (1 << VIRTIO_NET_F_GUEST_TSO6);

    features |= (1 << VIRTIO_NET_F_GUEST_ECN);

    return features & virtio_net_get_features(vdev);

}


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

+    magic = ldl_be_p(buf);
+
+    request->flags  = lduw_be_p(buf + 4);
+
+    request->type   = lduw_be_p(buf + 6);

     request->handle = ldq_be_p(buf + 8);

static ssize_t nbd_receive_request(QIOChannel *ioc, NBDRequest *request)

{

    uint8_t buf[NBD_REQUEST_SIZE];

    uint32_t magic;

    ssize_t ret;

    ret = read_sync(ioc, buf, sizeof(buf), NULL);

    if (ret < 0) {

        return ret;

    }

    /* Request

       [ 0 ..  3]   magic   (NBD_REQUEST_MAGIC)

       [ 4 ..  5]   flags   (NBD_CMD_FLAG_FUA, ...)

       [ 6 ..  7]   type    (NBD_CMD_READ, ...)

       [ 8 .. 15]   handle

       [16 .. 23]   from

       [24 .. 27]   len

     */

    magic = ldl_be_p(buf);

    request->flags  = lduw_be_p(buf + 4);

    request->type   = lduw_be_p(buf + 6);

    request->handle = ldq_be_p(buf + 8);

    request->from   = ldq_be_p(buf + 16);

    request->len    = ldl_be_p(buf + 24);

    TRACE("Got request: { magic = 0x%" PRIx32 ", .flags = %" PRIx16

          ", .type = %" PRIx16 ", from = %" PRIu64 ", len = %" PRIu32 " }",

          magic, request->flags, request->type, request->from, request->len);

    if (magic != NBD_REQUEST_MAGIC) {

        LOG("invalid magic (got 0x%" PRIx32 ")", magic);

        return -EINVAL;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void bdrv_error_action(BlockDriverState *bs, BlockErrorAction action,

+                       bool is_read, int error)

+{

     assert(error >= 0);

void bdrv_error_action(BlockDriverState *bs, BlockErrorAction action,

                       bool is_read, int error)

{

    assert(error >= 0);

    bdrv_emit_qmp_error_event(bs, QEVENT_BLOCK_IO_ERROR, action, is_read);

    if (action == BDRV_ACTION_STOP) {

        vm_stop(RUN_STATE_IO_ERROR);

        bdrv_iostatus_set_err(bs, error);

    }

}


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

 {

+    static int count = SELF_ANNOUNCE_ROUNDS;
+
+    QEMUTimer *timer = *(QEMUTimer **)opaque;
+
+

     qemu_foreach_nic(qemu_announce_self_iter, NULL);

static void qemu_announce_self_once(void *opaque)

{

    static int count = SELF_ANNOUNCE_ROUNDS;

    QEMUTimer *timer = *(QEMUTimer **)opaque;

    qemu_foreach_nic(qemu_announce_self_iter, NULL);

    if (--count) {

        /* delay 50ms, 150ms, 250ms, ... */

        qemu_mod_timer(timer, qemu_get_clock(rt_clock) +

                       50 + (SELF_ANNOUNCE_ROUNDS - count - 1) * 100);

    } else {

	    qemu_del_timer(timer);

	    qemu_free_timer(timer);

    }

}


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

     CPUState *cs = CPU(obj);
+
     OpenRISCCPU *cpu = OPENRISC_CPU(obj);

     static int inited;

static void openrisc_cpu_initfn(Object *obj)

{

    CPUState *cs = CPU(obj);

    OpenRISCCPU *cpu = OPENRISC_CPU(obj);

    static int inited;

    cs->env_ptr = &cpu->env;

    cpu_exec_init(cs, &error_abort);

#ifndef CONFIG_USER_ONLY

    cpu_openrisc_mmu_init(cpu);

#endif

    if (tcg_enabled() && !inited) {

        inited = 1;

        openrisc_translate_init();

    }

}


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

     dev = qvirtio_mmio_init_device(MMIO_DEV_BASE_ADDR, MMIO_PAGE_SIZE);
+
     g_assert(dev != NULL);

     g_assert_cmphex(dev->vdev.device_type, ==, VIRTIO_ID_BLOCK);

static void mmio_basic(void)

{

    QVirtioMMIODevice *dev;

    QVirtQueue *vq;

    QGuestAllocator *alloc;

    int n_size = TEST_IMAGE_SIZE / 2;

    uint64_t capacity;

    arm_test_start();

    dev = qvirtio_mmio_init_device(MMIO_DEV_BASE_ADDR, MMIO_PAGE_SIZE);

    g_assert(dev != NULL);

    g_assert_cmphex(dev->vdev.device_type, ==, VIRTIO_ID_BLOCK);

    qvirtio_reset(&qvirtio_mmio, &dev->vdev);

    qvirtio_set_acknowledge(&qvirtio_mmio, &dev->vdev);

    qvirtio_set_driver(&qvirtio_mmio, &dev->vdev);

    alloc = generic_alloc_init(MMIO_RAM_ADDR, MMIO_RAM_SIZE, MMIO_PAGE_SIZE);

    vq = qvirtqueue_setup(&qvirtio_mmio, &dev->vdev, alloc, 0);

    test_basic(&qvirtio_mmio, &dev->vdev, alloc, vq,

                            QVIRTIO_MMIO_DEVICE_SPECIFIC);

    qmp("{ 'execute': 'block_resize', 'arguments': { 'device': 'drive0', "

                                                    " 'size': %d } }", n_size);

    qvirtio_wait_queue_isr(&qvirtio_mmio, &dev->vdev, vq,

                           QVIRTIO_BLK_TIMEOUT_US);

    capacity = qvirtio_config_readq(&qvirtio_mmio, &dev->vdev,

                                                QVIRTIO_MMIO_DEVICE_SPECIFIC);

    g_assert_cmpint(capacity, ==, n_size / 512);

    /* End test */

    guest_free(alloc, vq->desc);

    generic_alloc_uninit(alloc);

    g_free(dev);

    test_end();

}


static int ppc_hash32_check_prot(int prot, int rwx)

{

    int ret;

    if (rwx == 2) {

        if (prot & PAGE_EXEC) {

            ret = 0;

        } else {

            ret = -2;

        }

    } else if (rwx) {

        if (prot & PAGE_WRITE) {

            ret = 0;

        } else {

            ret = -2;

        }

    } else {

        if (prot & PAGE_READ) {

            ret = 0;

        } else {

            ret = -2;

        }

    }

    return ret;

}


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

     int start, i, j, w;

+

     if (sce->ics.clip_avoidance_factor < 1.0f) {

static void avoid_clipping(AACEncContext *s, SingleChannelElement *sce)

{

    int start, i, j, w;

    if (sce->ics.clip_avoidance_factor < 1.0f) {

        for (w = 0; w < sce->ics.num_windows; w++) {

            start = 0;

            for (i = 0; i < sce->ics.max_sfb; i++) {

                float *swb_coeffs = sce->coeffs + start + w*128;

                for (j = 0; j < sce->ics.swb_sizes[i]; j++)

                    swb_coeffs[j] *= sce->ics.clip_avoidance_factor;

                start += sce->ics.swb_sizes[i];

            }

        }

    }

}


static int rm_probe(AVProbeData *p)

{

    /* check file header */

    if (p->buf_size <= 32)

        return 0;

    if ((p->buf[0] == '.' && p->buf[1] == 'R' &&

         p->buf[2] == 'M' && p->buf[3] == 'F' &&

         p->buf[4] == 0 && p->buf[5] == 0) ||

        (p->buf[0] == '.' && p->buf[1] == 'r' &&

         p->buf[2] == 'a' && p->buf[3] == 0xfd))

        return AVPROBE_SCORE_MAX;

    else

        return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,16 +1,16 @@
 static void v4l2_free_buffer(void *opaque, uint8_t *unused)

 {
+
+    V4L2Buffer* avbuf = opaque;
+
     V4L2m2mContext *s = buf_to_m2mctx(avbuf);

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

+    if (s->reinit) {

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

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

{

    V4L2Buffer* avbuf = opaque;

    V4L2m2mContext *s = buf_to_m2mctx(avbuf);

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

    if (s->reinit) {

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

            sem_post(&s->refsync);

        return;

    }

    if (avbuf->context->streamon) {

        ff_v4l2_buffer_enqueue(avbuf);

        return;

    }

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

        ff_v4l2_m2m_codec_end(s->avctx);

}


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

 {

+    memory_region_init_io(&mpu->pin_cfg_iomem, &omap_pin_cfg_ops, mpu,
+
+                          "omap-pin-cfg", 0x800);
+
     memory_region_add_subregion(system_memory, base, &mpu->pin_cfg_iomem);

     omap_pin_cfg_reset(mpu);

static void omap_pin_cfg_init(MemoryRegion *system_memory,

                target_phys_addr_t base,

                struct omap_mpu_state_s *mpu)

{

    memory_region_init_io(&mpu->pin_cfg_iomem, &omap_pin_cfg_ops, mpu,

                          "omap-pin-cfg", 0x800);

    memory_region_add_subregion(system_memory, base, &mpu->pin_cfg_iomem);

    omap_pin_cfg_reset(mpu);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     assert(gsi < s->max_gsi);

+
+    s->used_gsi_bitmap[gsi / 32] |= 1U << (gsi % 32);

 }

static void set_gsi(KVMState *s, unsigned int gsi)

{

    assert(gsi < s->max_gsi);

    s->used_gsi_bitmap[gsi / 32] |= 1U << (gsi % 32);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static void spapr_phb_reset(DeviceState *qdev)
+
+{

     SysBusDevice *s = SYS_BUS_DEVICE(qdev);

static void spapr_phb_reset(DeviceState *qdev)

{

    SysBusDevice *s = SYS_BUS_DEVICE(qdev);

    sPAPRPHBState *sphb = SPAPR_PCI_HOST_BRIDGE(s);

    /* Reset the IOMMU state */

    spapr_tce_reset(sphb->tcet);

}