--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
                               uint8_t *dst[], int dstStride[])

 {
+
     int i, j;

     int srcstr = srcStride[0] >> 1;

static int packed_16bpc_bswap(SwsContext *c, const uint8_t *src[],

                              int srcStride[], int srcSliceY, int srcSliceH,

                              uint8_t *dst[], int dstStride[])

{

    int i, j;

    int srcstr = srcStride[0] >> 1;

    int dststr = dstStride[0] >> 1;

    uint16_t       *dstPtr =       (uint16_t *) dst[0];

    const uint16_t *srcPtr = (const uint16_t *) src[0];

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

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

            dstPtr[j] = av_bswap16(srcPtr[j]);

        }

        srcPtr += srcstr;

        dstPtr += dststr;

    }

    return srcSliceH;

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     return simple_limit(p, stride, E)

         && 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, ptrdiff_t stride, int E, int I)

{

    LOAD_PIXELS

    return simple_limit(p, stride, E)

        && 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 void vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride, int mode, int rnd)

{

    int i, j;

    uint8_t tmp[8*11], *tptr;

    int m, r;

    m = (mode & 3);

    r = rnd;

    src -= stride;

    tptr = tmp;

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

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

            tptr[i] = vc1_mspel_filter(src + i, 1, m, r);

        src += stride;

        tptr += 8;

    }

    r = 1 - rnd;

    m = (mode >> 2) & 3;

    tptr = tmp + 8;

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

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

            dst[i] = vc1_mspel_filter(tptr + i, 8, m, r);

        dst += stride;

        tptr += 8;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
 static CharDriverState *qmp_chardev_open_file(ChardevFile *file, Error **errp)
+
 {

+    int flags, in = -1, out = -1;

     flags = O_WRONLY | O_TRUNC | O_CREAT | O_BINARY;

+    out = qmp_chardev_open_file_source(file->out, flags, errp);

     if (error_is_set(errp)) {

static CharDriverState *qmp_chardev_open_file(ChardevFile *file, Error **errp)

{

    int flags, in = -1, out = -1;

    flags = O_WRONLY | O_TRUNC | O_CREAT | O_BINARY;

    out = qmp_chardev_open_file_source(file->out, flags, errp);

    if (error_is_set(errp)) {

        return NULL;

    }

    if (file->has_in) {

        flags = O_RDONLY;

        in = qmp_chardev_open_file_source(file->in, flags, errp);

        if (error_is_set(errp)) {

            qemu_close(out);

            return NULL;

        }

    }

    return qemu_chr_open_fd(in, out);

}


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

                                      Error **errp)

{

    QObjectInputVisitor *qiv = to_qiv(v);

    QObject *qobj = qobject_input_get_object(qiv, name, true, errp);

    QInt *qint;

    QFloat *qfloat;

    if (!qobj) {

        return;

    }

    qint = qobject_to_qint(qobj);

    if (qint) {

        *obj = qint_get_int(qobject_to_qint(qobj));

        return;

    }

    qfloat = qobject_to_qfloat(qobj);

    if (qfloat) {

        *obj = qfloat_get_double(qobject_to_qfloat(qobj));

        return;

    }

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

               "number");

}


--- a/source.c
+++ b/source.c
@@ -68,11 +68,11 @@
     if(build_huff_tree(vlc, nodes, nb_codes*2-2) < 0){

         av_log(avctx, AV_LOG_ERROR, "Error building tree\n");
+
+        return -1;
+
+    }
+
     return 0;

 }

int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes,

                       Node *nodes, huff_cmp_t cmp, int hnode_first)

{

    int i, j;

    int cur_node;

    int64_t sum = 0;

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

        nodes[i].sym = i;

        nodes[i].n0 = -2;

        sum += nodes[i].count;

    }

    if(sum >> 31) {

        av_log(avctx, AV_LOG_ERROR, "Too high symbol frequencies. Tree construction is not possible\n");

        return -1;

    }

    qsort(nodes, nb_codes, sizeof(Node), cmp);

    cur_node = nb_codes;

    for(i = 0; i < nb_codes*2-1; i += 2){

        nodes[cur_node].sym = HNODE;

        nodes[cur_node].count = nodes[i].count + nodes[i+1].count;

        nodes[cur_node].n0 = i;

        for(j = cur_node; j > 0; j--){

            if(nodes[j].count > nodes[j-1].count ||

               (nodes[j].count == nodes[j-1].count &&

                (!hnode_first || nodes[j].n0==j-1 || nodes[j].n0==j-2 ||

                 (nodes[j].sym!=HNODE && nodes[j-1].sym!=HNODE))))

                break;

            FFSWAP(Node, nodes[j], nodes[j-1]);

        }

        cur_node++;

    }

    if(build_huff_tree(vlc, nodes, nb_codes*2-2) < 0){

        av_log(avctx, AV_LOG_ERROR, "Error building tree\n");

        return -1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     VirtIOCryptoCcw *dev = VIRTIO_CRYPTO_CCW(obj);

     VirtioCcwDevice *ccw_dev = VIRTIO_CCW_DEVICE(obj);
+
+
+
+    ccw_dev->force_revision_1 = true;
+
     virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),

                                 TYPE_VIRTIO_CRYPTO);

static void virtio_ccw_crypto_instance_init(Object *obj)

{

    VirtIOCryptoCcw *dev = VIRTIO_CRYPTO_CCW(obj);

    VirtioCcwDevice *ccw_dev = VIRTIO_CCW_DEVICE(obj);

    ccw_dev->force_revision_1 = true;

    virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),

                                TYPE_VIRTIO_CRYPTO);

    object_property_add_alias(obj, "cryptodev", OBJECT(&dev->vdev),

                              "cryptodev", &error_abort);

}


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

         if (!strcmp(channel_layout_map[i].name, name))

+            return channel_layout_map[i].layout;
+
+        i++;
+
+    } while (channel_layout_map[i].name);

int64_t av_get_channel_layout(const char *name)

{

    int i = 0;

    do {

        if (!strcmp(channel_layout_map[i].name, name))

            return channel_layout_map[i].layout;

        i++;

    } while (channel_layout_map[i].name);

    return 0;

}


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

     int ret = avformat_open_input(&rdt->rmctx, "", &ff_rdt_demuxer, NULL);
+
+    if (ret < 0) {
+
+        av_free(rdt);
+
         return NULL;

     }

rdt_new_context (void)

{

    PayloadContext *rdt = av_mallocz(sizeof(PayloadContext));

    int ret = avformat_open_input(&rdt->rmctx, "", &ff_rdt_demuxer, NULL);

    if (ret < 0) {

        av_free(rdt);

        return NULL;

    }

    return rdt;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int get_packetheader(NUTContext *nut, ByteIOContext *bc, int calculate_checksum)

 {
+
     int64_t start, size;

 //    start= url_ftell(bc) - 8;

static int get_packetheader(NUTContext *nut, ByteIOContext *bc, int calculate_checksum)

{

    int64_t start, size;

//    start= url_ftell(bc) - 8;

    size= get_v(bc);

    init_checksum(bc, calculate_checksum ? av_crc04C11DB7_update : NULL, 1);

//    nut->packet_start[2] = start;

//    nut->written_packet_size= size;

    return size;

}


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

     const void *val;

+    int err;

     int allow;

+

     err = sasl_getprop(vs->sasl.conn, SASL_USERNAME, &val);
+
     if (err != SASL_OK) {

+        VNC_DEBUG("cannot query SASL username on connection %d (%s), denying access\n",

                   err, sasl_errstring(err, NULL, NULL));

+        return -1;

     }

static int vnc_auth_sasl_check_access(VncState *vs)

{

    const void *val;

    int err;

    int allow;

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

    if (err != SASL_OK) {

        VNC_DEBUG("cannot query SASL username on connection %d (%s), denying access\n",

                  err, sasl_errstring(err, NULL, NULL));

        return -1;

    }

    if (val == NULL) {

        VNC_DEBUG("no client username was found, denying access\n");

        return -1;

    }

    VNC_DEBUG("SASL client username %s\n", (const char *)val);

    vs->sasl.username = g_strdup((const char*)val);

    if (vs->vd->sasl.acl == NULL) {

        VNC_DEBUG("no ACL activated, allowing access\n");

        return 0;

    }

    allow = qemu_acl_party_is_allowed(vs->vd->sasl.acl, vs->sasl.username);

    VNC_DEBUG("SASL client %s %s by ACL\n", vs->sasl.username,

              allow ? "allowed" : "denied");

    return allow ? 0 : -1;

}


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

     uint64_t addr;

+

     if (size % SPAPR_MEMORY_BLOCK_SIZE) {

static void spapr_memory_plug(HotplugHandler *hotplug_dev, DeviceState *dev,

                              uint32_t node, Error **errp)

{

    Error *local_err = NULL;

    sPAPRMachineState *ms = SPAPR_MACHINE(hotplug_dev);

    PCDIMMDevice *dimm = PC_DIMM(dev);

    PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);

    MemoryRegion *mr = ddc->get_memory_region(dimm);

    uint64_t align = memory_region_get_alignment(mr);

    uint64_t size = memory_region_size(mr);

    uint64_t addr;

    if (size % SPAPR_MEMORY_BLOCK_SIZE) {

        error_setg(&local_err, "Hotplugged memory size must be a multiple of "

                      "%lld MB", SPAPR_MEMORY_BLOCK_SIZE/M_BYTE);

        goto out;

    }

    pc_dimm_memory_plug(dev, &ms->hotplug_memory, mr, align, &local_err);

    if (local_err) {

        goto out;

    }

    addr = object_property_get_int(OBJECT(dimm), PC_DIMM_ADDR_PROP, &local_err);

    if (local_err) {

        pc_dimm_memory_unplug(dev, &ms->hotplug_memory, mr);

        goto out;

    }

    spapr_add_lmbs(dev, addr, size, node, &error_abort);

out:

    error_propagate(errp, local_err);

}


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

+    if (!d->enabled)

         return;

static void i6300esb_restart_timer(I6300State *d, int stage)

{

    int64_t timeout;

    if (!d->enabled)

        return;

    d->stage = stage;

    if (d->stage <= 1)

        timeout = d->timer1_preload;

    else

        timeout = d->timer2_preload;

    if (d->clock_scale == CLOCK_SCALE_1KHZ)

        timeout <<= 15;

    else

        timeout <<= 5;

    /* Get the timeout in units of ticks_per_sec. */

    timeout = get_ticks_per_sec() * timeout / 33000000;

    i6300esb_debug("stage %d, timeout %" PRIi64 "\n", d->stage, timeout);

    timer_mod(d->timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + timeout);

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     CPUBreakpoint *bp;

+
+    QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {
+
+        if (bp->pc == pc && bp->flags == flags) {
+
             cpu_breakpoint_remove_by_ref(cpu, bp);

             return 0;

int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags)

{

#if defined(TARGET_HAS_ICE)

    CPUBreakpoint *bp;

    QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {

        if (bp->pc == pc && bp->flags == flags) {

            cpu_breakpoint_remove_by_ref(cpu, bp);

            return 0;

        }

    }

    return -ENOENT;

#else

    return -ENOSYS;

#endif

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int write_number(void *obj, const AVOption *o, void *dst, double num, int den, int64_t intnum)

+{

     if (o->max*den < num*intnum || o->min*den > num*intnum) {

static int write_number(void *obj, const AVOption *o, void *dst, double num, int den, int64_t intnum)

{

    if (o->max*den < num*intnum || o->min*den > num*intnum) {

        av_log(obj, AV_LOG_ERROR, "Value %f for parameter '%s' out of range\n",

               num*intnum/den, o->name);

        return AVERROR(ERANGE);

    }

    switch (o->type) {

    case AV_OPT_TYPE_FLAGS:

    case AV_OPT_TYPE_INT:   *(int       *)dst= llrint(num/den)*intnum; break;

    case AV_OPT_TYPE_INT64: *(int64_t   *)dst= llrint(num/den)*intnum; break;

    case AV_OPT_TYPE_FLOAT: *(float     *)dst= num*intnum/den;         break;

    case AV_OPT_TYPE_DOUBLE:*(double    *)dst= num*intnum/den;         break;

    case AV_OPT_TYPE_RATIONAL:

        if ((int)num == num) *(AVRational*)dst= (AVRational){num*intnum, den};

        else                 *(AVRational*)dst= av_d2q(num*intnum/den, 1<<24);

        break;

    default:

        return AVERROR(EINVAL);

    }

    return 0;

}


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

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

     g_assert(endptr == str + 5);

static void test_qemu_strtoul_correct(void)

{

    const char *str = "12345 foo";

    char f = 'X';

    const char *endptr = &f;

    unsigned long res = 999;

    int err;

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

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, 12345);

    g_assert(endptr == str + 5);

}


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

     } else {

+        tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_T1, offset);
+
+        tcg_out_ldst_rr(s, ret, addr, TCG_REG_T1, op);
+
+    }

 }

static inline void tcg_out_ldst(TCGContext *s, int ret, int addr,

                                int offset, int op)

{

    if (check_fit_tl(offset, 13)) {

        tcg_out32(s, op | INSN_RD(ret) | INSN_RS1(addr) |

                  INSN_IMM13(offset));

    } else {

        tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_T1, offset);

        tcg_out_ldst_rr(s, ret, addr, TCG_REG_T1, op);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static void qemu_kvm_init_cpu_signals(CPUState *env)
+
 {

     int r;

     sigset_t set;
+
     struct sigaction sigact;

@@ -13,15 +13,15 @@
     memset(&sigact, 0, sizeof(sigact));

     sigact.sa_handler = dummy_signal;
+
+    sigaction(SIG_IPI, &sigact, NULL);
+
+
+
 #ifdef CONFIG_IOTHREAD
+
+    pthread_sigmask(SIG_BLOCK, NULL, &set);
+
     sigdelset(&set, SIG_IPI);

     sigdelset(&set, SIGBUS);

static void qemu_kvm_init_cpu_signals(CPUState *env)

{

    int r;

    sigset_t set;

    struct sigaction sigact;

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

    sigact.sa_handler = dummy_signal;

    sigaction(SIG_IPI, &sigact, NULL);

#ifdef CONFIG_IOTHREAD

    pthread_sigmask(SIG_BLOCK, NULL, &set);

    sigdelset(&set, SIG_IPI);

    sigdelset(&set, SIGBUS);

    r = kvm_set_signal_mask(env, &set);

    if (r) {

        fprintf(stderr, "kvm_set_signal_mask: %s\n", strerror(-r));

        exit(1);

    }

#else

    sigemptyset(&set);

    sigaddset(&set, SIG_IPI);

    sigaddset(&set, SIGIO);

    sigaddset(&set, SIGALRM);

    pthread_sigmask(SIG_BLOCK, &set, NULL);

    pthread_sigmask(SIG_BLOCK, NULL, &set);

    sigdelset(&set, SIGIO);

    sigdelset(&set, SIGALRM);

#endif

    sigdelset(&set, SIG_IPI);

    sigdelset(&set, SIGBUS);

    r = kvm_set_signal_mask(env, &set);

    if (r) {

        fprintf(stderr, "kvm_set_signal_mask: %s\n", strerror(-r));

        exit(1);

    }

}


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

     trace_qio_channel_socket_listen_complete(ioc, fd);
+
+    if (qio_channel_socket_set_fd(ioc, fd, errp) < 0) {
+
+        close(fd);
+
         return -1;

     }

int qio_channel_socket_listen_sync(QIOChannelSocket *ioc,

                                   SocketAddressLegacy *addr,

                                   Error **errp)

{

    int fd;

    trace_qio_channel_socket_listen_sync(ioc, addr);

    fd = socket_listen(addr, errp);

    if (fd < 0) {

        trace_qio_channel_socket_listen_fail(ioc);

        return -1;

    }

    trace_qio_channel_socket_listen_complete(ioc, fd);

    if (qio_channel_socket_set_fd(ioc, fd, errp) < 0) {

        close(fd);

        return -1;

    }

    qio_channel_set_feature(QIO_CHANNEL(ioc), QIO_CHANNEL_FEATURE_LISTEN);

    return 0;

}


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

 {

+    h264_loop_filter_chroma_intra_c(pix, 1, stride, alpha, beta);

 }

static void h264_h_loop_filter_chroma_intra_c(uint8_t *pix, int stride, int alpha, int beta)

{

    h264_loop_filter_chroma_intra_c(pix, 1, stride, alpha, beta);

}


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

 {

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

                                ptrdiff_t stride)

{

    avc_luma_hv_qrt_and_aver_dst_8x8_msa(src + stride - 2,

                                         src - (stride * 2) +

                                         sizeof(uint8_t), stride, dst, stride);

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
     case 270:

         if (move->axis == INPUT_AXIS_X) {
+
+            move->axis = INPUT_AXIS_Y;
+
+            move->value = INPUT_EVENT_ABS_SIZE - 1 - move->value;
+
         } else if (move->axis == INPUT_AXIS_Y) {

             move->axis = INPUT_AXIS_X;

static void qemu_input_transform_abs_rotate(InputEvent *evt)

{

    InputMoveEvent *move = evt->u.abs;

    switch (graphic_rotate) {

    case 90:

        if (move->axis == INPUT_AXIS_X) {

            move->axis = INPUT_AXIS_Y;

        } else if (move->axis == INPUT_AXIS_Y) {

            move->axis = INPUT_AXIS_X;

            move->value = INPUT_EVENT_ABS_SIZE - 1 - move->value;

        }

        break;

    case 180:

        move->value = INPUT_EVENT_ABS_SIZE - 1 - move->value;

        break;

    case 270:

        if (move->axis == INPUT_AXIS_X) {

            move->axis = INPUT_AXIS_Y;

            move->value = INPUT_EVENT_ABS_SIZE - 1 - move->value;

        } else if (move->axis == INPUT_AXIS_Y) {

            move->axis = INPUT_AXIS_X;

        }

        break;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int mp_pacl_setxattr(FsContext *ctx, const char *path, const char *name,

                             void *value, size_t size, int flags)
+
+{
+
     char buffer[PATH_MAX];

     return lsetxattr(rpath(ctx, path, buffer), MAP_ACL_ACCESS, value,

static int mp_pacl_setxattr(FsContext *ctx, const char *path, const char *name,

                            void *value, size_t size, int flags)

{

    char buffer[PATH_MAX];

    return lsetxattr(rpath(ctx, path, buffer), MAP_ACL_ACCESS, value,

            size, flags);

}


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

     avctx->coded_frame = av_frame_alloc();
+
+    if (!avctx->coded_frame)
+
+        return AVERROR(ENOMEM);
+

     avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;

static av_cold int pnm_encode_init(AVCodecContext *avctx)

{

    avctx->coded_frame = av_frame_alloc();

    if (!avctx->coded_frame)

        return AVERROR(ENOMEM);

    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;

    avctx->coded_frame->key_frame = 1;

    return 0;

}


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

         level_buf[i] = level;

+        run_buf[i] = run;
+
+    }
+
+    if(dequant(h,level_buf, run_buf, block, ff_cavs_dequant_mul[qp],

                ff_cavs_dequant_shift[qp], i))

static int decode_residual_block(AVSContext *h, GetBitContext *gb,

                                 const struct dec_2dvlc *r, int esc_golomb_order,

                                 int qp, uint8_t *dst, int stride) {

    int i, level_code, esc_code, level, run, mask;

    DCTELEM level_buf[65];

    uint8_t run_buf[65];

    DCTELEM *block = h->block;

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

        level_code = get_ue_code(gb,r->golomb_order);

        if(level_code >= ESCAPE_CODE) {

            run = ((level_code - ESCAPE_CODE) >> 1) + 1;

            esc_code = get_ue_code(gb,esc_golomb_order);

            level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);

            while(level > r->inc_limit)

                r++;

            mask = -(level_code & 1);

            level = (level^mask) - mask;

        } else {

            level = r->rltab[level_code][0];

            if(!level) //end of block signal

                break;

            run   = r->rltab[level_code][1];

            r += r->rltab[level_code][2];

        }

        level_buf[i] = level;

        run_buf[i] = run;

    }

    if(dequant(h,level_buf, run_buf, block, ff_cavs_dequant_mul[qp],

               ff_cavs_dequant_shift[qp], i))

        return -1;

    h->cdsp.cavs_idct8_add(dst,block,stride);

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

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int check_video_codec_tag(int codec_tag) {
+
+    if (codec_tag <= 0 || codec_tag > 15) {

+        return AVERROR(ENOSYS);

     } else

static int check_video_codec_tag(int codec_tag) {

    if (codec_tag <= 0 || codec_tag > 15) {

        return AVERROR(ENOSYS);

    } else

        return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+void kvm_arm_reset_vcpu(ARMCPU *cpu)
+
+{
+
     /* Feed the kernel back its initial register state */

     memmove(cpu->cpreg_values, cpu->cpreg_reset_values,

void kvm_arm_reset_vcpu(ARMCPU *cpu)

{

    /* Feed the kernel back its initial register state */

    memmove(cpu->cpreg_values, cpu->cpreg_reset_values,

            cpu->cpreg_array_len * sizeof(cpu->cpreg_values[0]));

    if (!write_list_to_kvmstate(cpu)) {

        abort();

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static bool raw_is_inserted(BlockDriverState *bs)

 {

static bool raw_is_inserted(BlockDriverState *bs)

{

    return bdrv_is_inserted(bs->file->bs);

}


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

     if (env->external_htab == MMU_HASH64_KVM_MANAGED_HPT) {

+        kvmppc_write_hpte(ptex, pte0, pte1);
+
+        return;
+
+    }

void ppc_hash64_store_hpte(PowerPCCPU *cpu, hwaddr ptex,

                           uint64_t pte0, uint64_t pte1)

{

    CPUPPCState *env = &cpu->env;

    hwaddr offset = ptex * HASH_PTE_SIZE_64;

    if (env->external_htab == MMU_HASH64_KVM_MANAGED_HPT) {

        kvmppc_write_hpte(ptex, pte0, pte1);

        return;

    }

    if (env->external_htab) {

        stq_p(env->external_htab + offset, pte0);

        stq_p(env->external_htab + offset + HASH_PTE_SIZE_64 / 2, pte1);

    } else {

        hwaddr base = ppc_hash64_hpt_base(cpu);

        stq_phys(CPU(cpu)->as, base + offset, pte0);

        stq_phys(CPU(cpu)->as, base + offset + HASH_PTE_SIZE_64 / 2, pte1);

    }

}


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

 {

+    assigned_dev_ioport_rw(opaque, addr, size, &data);
+
 }

static void assigned_dev_ioport_write(void *opaque, target_phys_addr_t addr,

                                      uint64_t data, unsigned size)

{

    assigned_dev_ioport_rw(opaque, addr, size, &data);

}


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

     trace_bdrv_co_writev(bs, sector_num, nb_sectors);
+
+
+
     return bdrv_co_do_writev(bs, sector_num, nb_sectors, qiov, 0);

 }

int coroutine_fn bdrv_co_writev(BlockDriverState *bs, int64_t sector_num,

    int nb_sectors, QEMUIOVector *qiov)

{

    trace_bdrv_co_writev(bs, sector_num, nb_sectors);

    return bdrv_co_do_writev(bs, sector_num, nb_sectors, qiov, 0);

}


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

     if (oc != NULL && object_class_dynamic_cast(oc, TYPE_ALPHA_CPU) != NULL &&

+        !object_class_is_abstract(oc)) {
+
+        return oc;
+
+    }

static ObjectClass *alpha_cpu_class_by_name(const char *cpu_model)

{

    ObjectClass *oc = NULL;

    char *typename;

    int i;

    if (cpu_model == NULL) {

        return NULL;

    }

    oc = object_class_by_name(cpu_model);

    if (oc != NULL && object_class_dynamic_cast(oc, TYPE_ALPHA_CPU) != NULL &&

        !object_class_is_abstract(oc)) {

        return oc;

    }

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

        if (strcmp(cpu_model, alpha_cpu_aliases[i].alias) == 0) {

            oc = object_class_by_name(alpha_cpu_aliases[i].typename);

            assert(oc != NULL && !object_class_is_abstract(oc));

            return oc;

        }

    }

    typename = g_strdup_printf("%s-" TYPE_ALPHA_CPU, cpu_model);

    oc = object_class_by_name(typename);

    g_free(typename);

    if (oc != NULL && object_class_is_abstract(oc)) {

        oc = NULL;

    }

    return oc;

}


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

+
+
+    if (rtl8139_cp_receiver_enabled(s)) {
+
+        /* ??? Flow control not implemented in c+ mode.

            This is a hack to work around slirp deficiencies anyway.  */

static int rtl8139_can_receive(VLANClientState *nc)

{

    RTL8139State *s = DO_UPCAST(NICState, nc, nc)->opaque;

    int avail;

    /* Receive (drop) packets if card is disabled.  */

    if (!s->clock_enabled)

      return 1;

    if (!rtl8139_receiver_enabled(s))

      return 1;

    if (rtl8139_cp_receiver_enabled(s)) {

        /* ??? Flow control not implemented in c+ mode.

           This is a hack to work around slirp deficiencies anyway.  */

        return 1;

    } else {

        avail = MOD2(s->RxBufferSize + s->RxBufPtr - s->RxBufAddr,

                     s->RxBufferSize);

        return (avail == 0 || avail >= 1514);

    }

}


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

                       cook_gains *gains, float *previous_buffer,

+                      int16_t *out, int chan)
+
+{
+
+    int j;

mlt_compensate_output(COOKContext *q, float *decode_buffer,

                      cook_gains *gains, float *previous_buffer,

                      int16_t *out, int chan)

{

    int j;

    cook_imlt(q, decode_buffer, q->mono_mdct_output);

    gain_compensate(q, gains, previous_buffer);

    /* Clip and convert floats to 16 bits.

     */

    for (j = 0; j < q->samples_per_channel; j++) {

        out[chan + q->nb_channels * j] =

          av_clip(lrintf(q->mono_mdct_output[j]), -32768, 32767);

    }

}


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

+    avio_skip(pb, 1); /* one byte has been read ahead */

     avio_skip(pb, 2);

static int msnwc_tcp_read_packet(AVFormatContext *ctx, AVPacket *pkt)

{

    AVIOContext *pb = ctx->pb;

    uint16_t keyframe;

    uint32_t size, timestamp;

    avio_skip(pb, 1); /* one byte has been read ahead */

    avio_skip(pb, 2);

    avio_skip(pb, 2);

    keyframe = avio_rl16(pb);

    size = avio_rl32(pb);

    avio_skip(pb, 4);

    avio_skip(pb, 4);

    timestamp = avio_rl32(pb);

    if(!size || av_get_packet(pb, pkt, size) != size)

        return -1;

    avio_skip(pb, 1); /* Read ahead one byte of struct size like read_header */

    pkt->pts = timestamp;

    pkt->dts = timestamp;

    pkt->stream_index = 0;

    /* Some aMsn generated videos (or was it Mercury Messenger?) don't set

     * this bit and rely on the codec to get keyframe information */

    if(keyframe&1)

        pkt->flags |= AV_PKT_FLAG_KEY;

    return HEADER_SIZE + size;

}


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

     VIRTIO_GPU_FILL_CMD(info);
+
+
+
+
+    if (info.capset_index == 0) {

         resp.capset_id = VIRTIO_GPU_CAPSET_VIRGL;

static void virgl_cmd_get_capset_info(VirtIOGPU *g,

                                      struct virtio_gpu_ctrl_command *cmd)

{

    struct virtio_gpu_get_capset_info info;

    struct virtio_gpu_resp_capset_info resp;

    VIRTIO_GPU_FILL_CMD(info);

    if (info.capset_index == 0) {

        resp.capset_id = VIRTIO_GPU_CAPSET_VIRGL;

        virgl_renderer_get_cap_set(resp.capset_id,

                                   &resp.capset_max_version,

                                   &resp.capset_max_size);

    } else {

        resp.capset_max_version = 0;

        resp.capset_max_size = 0;

    }

    resp.hdr.type = VIRTIO_GPU_RESP_OK_CAPSET_INFO;

    virtio_gpu_ctrl_response(g, cmd, &resp.hdr, sizeof(resp));

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void balloon_stats_get_all(Object *obj, struct Visitor *v,
+
                                   void *opaque, const char *name, Error **errp)

 {
@@ -8,17 +8,17 @@

     VirtIOBalloon *s = opaque;

+    int i;

     if (!s->stats_last_update) {

         error_setg(errp, "guest hasn't updated any stats yet");
+
         return;

+    }

static void balloon_stats_get_all(Object *obj, struct Visitor *v,

                                  void *opaque, const char *name, Error **errp)

{

    Error *err = NULL;

    VirtIOBalloon *s = opaque;

    int i;

    if (!s->stats_last_update) {

        error_setg(errp, "guest hasn't updated any stats yet");

        return;

    }

    visit_start_struct(v, NULL, "guest-stats", name, 0, &err);

    if (err) {

        goto out;

    }

    visit_type_int(v, &s->stats_last_update, "last-update", &err);

    visit_start_struct(v, NULL, NULL, "stats", 0, &err);

    if (err) {

        goto out_end;

    }

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

        visit_type_int64(v, (int64_t *) &s->stats[i], balloon_stat_names[i],

                         &err);

    }

    visit_end_struct(v, &err);

out_end:

    visit_end_struct(v, &err);

out:

    error_propagate(errp, err);

}


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

 {

+    int work[10];

     int b = NBLOCKS - a;

static int interp(RA144Context *ractx, int16_t *out, int a,

                  int copyold, int energy)

{

    int work[10];

    int b = NBLOCKS - a;

    int i;

    // Interpolate block coefficients from the this frame's forth block and

    // last frame's forth block.

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

        out[i] = (a * ractx->lpc_coef[0][i] + b * ractx->lpc_coef[1][i])>> 2;

    if (eval_refl(work, out, ractx)) {

        // The interpolated coefficients are unstable, copy either new or old

        // coefficients.

        int_to_int16(out, ractx->lpc_coef[copyold]);

        return rescale_rms(ractx->lpc_refl_rms[copyold], energy);

    } else {

        return rescale_rms(rms(work), energy);

    }

}


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

             return d;

+        }
+
+        default: {
+
+            double d = eval_expr(p, e->param[0]);

             double d2 = eval_expr(p, e->param[1]);

static double eval_expr(Parser * p, AVEvalExpr * e) {

    switch (e->type) {

        case e_value:  return e->value;

        case e_const:  return e->value * p->const_value[e->a.const_index];

        case e_func0:  return e->value * e->a.func0(eval_expr(p, e->param[0]));

        case e_func1:  return e->value * e->a.func1(p->opaque, eval_expr(p, e->param[0]));

        case e_func2:  return e->value * e->a.func2(p->opaque, eval_expr(p, e->param[0]), eval_expr(p, e->param[1]));

        case e_squish: return 1/(1+exp(4*eval_expr(p, e->param[0])));

        case e_gauss: { double d = eval_expr(p, e->param[0]); return exp(-d*d/2)/sqrt(2*M_PI); }

        case e_ld:     return e->value * p->var[clip(eval_expr(p, e->param[0]), 0, VARS-1)];

        case e_while: {

            double d;

            while(eval_expr(p, e->param[0]))

                d=eval_expr(p, e->param[1]);

            return d;

        }

        default: {

            double d = eval_expr(p, e->param[0]);

            double d2 = eval_expr(p, e->param[1]);

            switch (e->type) {

                case e_mod: return e->value * (d - floor(d/d2)*d2);

                case e_max: return e->value * (d >  d2 ?   d : d2);

                case e_min: return e->value * (d <  d2 ?   d : d2);

                case e_eq:  return e->value * (d == d2 ? 1.0 : 0.0);

                case e_gt:  return e->value * (d >  d2 ? 1.0 : 0.0);

                case e_gte: return e->value * (d >= d2 ? 1.0 : 0.0);

                case e_pow: return e->value * pow(d, d2);

                case e_mul: return e->value * (d * d2);

                case e_div: return e->value * (d / d2);

                case e_add: return e->value * (d + d2);

                case e_last:return d2;

                case e_st : return e->value * (p->var[clip(d, 0, VARS-1)]= d2);

            }

        }

    }

    return NAN;

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     GlobalProperty *g;

     ObjectClass *oc;
+

     g = g_malloc0(sizeof(*g));

static int qdev_add_one_global(QemuOpts *opts, void *opaque)

{

    GlobalProperty *g;

    ObjectClass *oc;

    g = g_malloc0(sizeof(*g));

    g->driver   = qemu_opt_get(opts, "driver");

    g->property = qemu_opt_get(opts, "property");

    g->value    = qemu_opt_get(opts, "value");

    oc = object_class_by_name(g->driver);

    if (oc) {

        DeviceClass *dc = DEVICE_CLASS(oc);

        if (dc->hotpluggable) {

            /* If hotpluggable then skip not_used checking. */

            g->not_used = false;

        } else {

            /* Maybe a typo. */

            g->not_used = true;

        }

    } else {

        /* Maybe a typo. */

        g->not_used = true;

    }

    qdev_prop_register_global(g);

    return 0;

}


int check_migratable(Object *obj, Error **err)

{

    return 0;

}


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

     }
+
+    else
+
+        link->cur_pic = picref;
+

     start_frame(link, link->cur_pic);

void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref)

{

    void (*start_frame)(AVFilterLink *, AVFilterPicRef *);

    AVFilterPad *dst = &link_dpad(link);

    if(!(start_frame = dst->start_frame))

        start_frame = avfilter_default_start_frame;

    /* prepare to copy the picture if it has insufficient permissions */

    if((dst->min_perms & picref->perms) != dst->min_perms ||

        dst->rej_perms & picref->perms) {

        /*

        av_log(link->dst, AV_LOG_INFO,

                "frame copy needed (have perms %x, need %x, reject %x)\n",

                picref->perms,

                link_dpad(link).min_perms, link_dpad(link).rej_perms);

        */

        link->cur_pic = avfilter_default_get_video_buffer(link, dst->min_perms);

        link->srcpic = picref;

        link->cur_pic->pts = link->srcpic->pts;

    }

    else

        link->cur_pic = picref;

    start_frame(link, link->cur_pic);

}


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

     av_freep(&st->codec->extradata);

+    st->codec->extradata_size = 0;
+
+    st->codec->extradata = av_mallocz(strlen(buf) + FF_INPUT_BUFFER_PADDING_SIZE);
+
+    if (!st->codec->extradata)

         return AVERROR(ENOMEM);

static int mov_rewrite_dvd_sub_extradata(AVStream *st)

{

    char pal_s[256];

    char buf[256];

    int pal_s_pos = 0;

    uint8_t *src = st->codec->extradata;

    int i;

    if (st->codec->extradata_size != 64)

        return 0;

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

        uint32_t yuv = AV_RB32(src + i * 4);

        uint32_t rgba = yuv_to_rgba(yuv);

        snprintf(pal_s + pal_s_pos, sizeof(pal_s) - pal_s_pos, "%06x%s", rgba,

                 i != 15 ? ", " : "");

        pal_s_pos = strlen(pal_s);

        if (pal_s_pos >= sizeof(pal_s))

            return 0;

    }

    snprintf(buf, sizeof(buf), "size: %dx%d\npalette: %s\n",

             st->codec->width, st->codec->height, pal_s);

    av_freep(&st->codec->extradata);

    st->codec->extradata_size = 0;

    st->codec->extradata = av_mallocz(strlen(buf) + FF_INPUT_BUFFER_PADDING_SIZE);

    if (!st->codec->extradata)

        return AVERROR(ENOMEM);

    st->codec->extradata_size = strlen(buf);

    memcpy(st->codec->extradata, buf, st->codec->extradata_size);

    return 0;

}


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

     put_flush_packet(bc);

+    nut->last_packet_start= nut->packet_start;
+
+    nut->packet_start+= nut->written_packet_size;
+
+    nut->packet_size_pos = url_ftell(bc);

     nut->written_packet_size = max_size;

static int put_packetheader(NUTContext *nut, ByteIOContext *bc, int max_size)

{

    put_flush_packet(bc);

    nut->last_packet_start= nut->packet_start;

    nut->packet_start+= nut->written_packet_size;

    nut->packet_size_pos = url_ftell(bc);

    nut->written_packet_size = max_size;

    /* packet header */

    put_v(bc, nut->written_packet_size); /* forward ptr */

    put_v(bc, nut->packet_start - nut->last_packet_start); /* backward ptr */

    return 0;

}


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

 {

void OPPROTO op_decq_ECX(void)

{

    ECX--;

}


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

     uint8_t *status = shpc->config + SHPC_SLOT_STATUS(slot);

+    pci_word_test_and_clear_mask(status, msk);
+
+    pci_word_test_and_set_mask(status, value << (ffs(msk) - 1));

 }

static void shpc_set_status(SHPCDevice *shpc,

                            int slot, uint8_t value, uint16_t msk)

{

    uint8_t *status = shpc->config + SHPC_SLOT_STATUS(slot);

    pci_word_test_and_clear_mask(status, msk);

    pci_word_test_and_set_mask(status, value << (ffs(msk) - 1));

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void ehci_port_test(struct qhc *hc, int port, uint32_t expect)
+
+{

     void *addr = hc->base + 0x64 + 4 * port;

static void ehci_port_test(struct qhc *hc, int port, uint32_t expect)

{

    void *addr = hc->base + 0x64 + 4 * port;

    uint32_t value = qpci_io_readl(hc->dev, addr);

    uint16_t mask = ~(PORTSC_CSC | PORTSC_PEDC | PORTSC_OCC);

#if 0

    fprintf(stderr, "%s: %d, have 0x%08x, want 0x%08x\n",

            __func__, port, value & mask, expect & mask);

#endif

    g_assert((value & mask) == (expect & mask));

}


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

             val += src[abs(sample_index + i)] * (FELEM2)filter[i];

+            v2  += src[abs(sample_index + i)] * (FELEM2)filter[i + c->filter_length];
+
+        }
+
+        val += (v2 - val) * (FELEML)frac / c->src_incr;

     } else {

static void SET_TYPE(resample_one)(ResampleContext *c,

                                   void *dst0, int dst_index, const void *src0,

                                   int src_size, int index, int frac)

{

    FELEM *dst = dst0;

    const FELEM *src = src0;

    int i;

    int sample_index = index >> c->phase_shift;

    FELEM2 val = 0;

    FELEM *filter = ((FELEM *)c->filter_bank) +

                    c->filter_length * (index & c->phase_mask);

    if (sample_index < 0) {

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

            val += src[FFABS(sample_index + i) % src_size] *

                   (FELEM2)filter[i];

    } else if (c->linear) {

        FELEM2 v2 = 0;

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

            val += src[abs(sample_index + i)] * (FELEM2)filter[i];

            v2  += src[abs(sample_index + i)] * (FELEM2)filter[i + c->filter_length];

        }

        val += (v2 - val) * (FELEML)frac / c->src_incr;

    } else {

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

            val += src[sample_index + i] * (FELEM2)filter[i];

    }

    OUT(dst[dst_index], val);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 int attribute_align_arg av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flags)

+{
+
+    BufferSinkContext *buf = ctx->priv;
+
+    AVFilterLink *inlink = ctx->inputs[0];

     int ret;

int attribute_align_arg av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flags)

{

    BufferSinkContext *buf = ctx->priv;

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

    int ret;

    AVFrame *cur_frame;

    /* no picref available, fetch it from the filterchain */

    if (!av_fifo_size(buf->fifo)) {

        if (flags & AV_BUFFERSINK_FLAG_NO_REQUEST)

            return AVERROR(EAGAIN);

        if ((ret = ff_request_frame(inlink)) < 0)

            return ret;

    }

    if (!av_fifo_size(buf->fifo))

        return AVERROR(EINVAL);

    if (flags & AV_BUFFERSINK_FLAG_PEEK) {

        cur_frame = *((AVFrame **)av_fifo_peek2(buf->fifo, 0));

        av_frame_ref(frame, cur_frame); /* TODO check failure */

    } else {

        av_fifo_generic_read(buf->fifo, &cur_frame, sizeof(cur_frame), NULL);

        av_frame_move_ref(frame, cur_frame);

        av_frame_free(&cur_frame);

    }

    return 0;

}


static void kvm_io_ioeventfd_add(MemoryListener *listener,

                                 MemoryRegionSection *section,

                                 bool match_data, uint64_t data,

                                 EventNotifier *e)

{

    int fd = event_notifier_get_fd(e);

    int r;

    r = kvm_set_ioeventfd_pio(fd, section->offset_within_address_space,

                              data, true, int128_get64(section->size),

                              match_data);

    if (r < 0) {

        abort();

    }

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     if (!vec)

         return NULL;
+
+
+
+    for (i = 0; i < length; i++) {
+
         double dist = i - middle;

         vec->coeff[i] = exp(-dist * dist / (2 * variance * variance)) /

SwsVector *sws_getGaussianVec(double variance, double quality)

{

    const int length = (int)(variance * quality + 0.5) | 1;

    int i;

    double middle  = (length - 1) * 0.5;

    SwsVector *vec = sws_allocVec(length);

    if (!vec)

        return NULL;

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

        double dist = i - middle;

        vec->coeff[i] = exp(-dist * dist / (2 * variance * variance)) /

                        sqrt(2 * variance * M_PI);

    }

    sws_normalizeVec(vec, 1.0);

    return vec;

}


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

 #endif

+    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R13);
+
+
+
+    tcg_add_target_add_op_defs(ppc_op_defs);

 }

static void tcg_target_init(TCGContext *s)

{

#ifdef CONFIG_GETAUXVAL

    unsigned long hwcap = getauxval(AT_HWCAP);

    if (hwcap & PPC_FEATURE_ARCH_2_06) {

        have_isa_2_06 = true;

    }

#endif

    tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffffffff);

    tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I64], 0, 0xffffffff);

    tcg_regset_set32(tcg_target_call_clobber_regs, 0,

                     (1 << TCG_REG_R0) |

#ifdef __APPLE__

                     (1 << TCG_REG_R2) |

#endif

                     (1 << TCG_REG_R3) |

                     (1 << TCG_REG_R4) |

                     (1 << TCG_REG_R5) |

                     (1 << TCG_REG_R6) |

                     (1 << TCG_REG_R7) |

                     (1 << TCG_REG_R8) |

                     (1 << TCG_REG_R9) |

                     (1 << TCG_REG_R10) |

                     (1 << TCG_REG_R11) |

                     (1 << TCG_REG_R12)

        );

    tcg_regset_clear(s->reserved_regs);

    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R0);

    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R1);

#ifndef __APPLE__

    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R2);

#endif

    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R13);

    tcg_add_target_add_op_defs(ppc_op_defs);

}


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

     if ((error = pa_simple_write(s->pa, buf, size, &error))) {
+
+        av_log(s, AV_LOG_ERROR, "pa_simple_write failed: %s\n", pa_strerror(error));
+
+        return AVERROR(EIO);
+
     }

static int pulse_write_packet(AVFormatContext *h, AVPacket *pkt)

{

    PulseData *s = h->priv_data;

    int size     = pkt->size;

    uint8_t *buf = pkt->data;

    int error;

    if (s->stream_index != pkt->stream_index)

        return 0;

    if ((error = pa_simple_write(s->pa, buf, size, &error))) {

        av_log(s, AV_LOG_ERROR, "pa_simple_write failed: %s\n", pa_strerror(error));

        return AVERROR(EIO);

    }

    return 0;

}


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

     }

+
+
+    if (!handled && propagate_accel) {
+
+        handled = gtk_window_activate_key(GTK_WINDOW(widget), key);

     }

static gboolean gd_window_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)

{

    GtkDisplayState *s = opaque;

    GtkAccelGroupEntry *entries;

    guint n_entries = 0;

    gboolean propagate_accel = TRUE;

    gboolean handled = FALSE;

    entries = gtk_accel_group_query(s->accel_group, key->keyval,

                                    key->state, &n_entries);

    if (n_entries) {

        const char *quark = g_quark_to_string(entries[0].accel_path_quark);

        if (gd_is_grab_active(s) && strstart(quark, "<QEMU>/File/", NULL)) {

            propagate_accel = FALSE;

        }

    }

    if (!handled && propagate_accel) {

        handled = gtk_window_activate_key(GTK_WINDOW(widget), key);

    }

    if (handled) {

        gtk_release_modifiers(s);

    } else {

        handled = gtk_window_propagate_key_event(GTK_WINDOW(widget), key);

    }

    return handled;

}


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

     DeviceClass *dc = DEVICE_CLASS(oc);

static void pxa2xx_pcmcia_class_init(ObjectClass *oc, void *data)

{

    DeviceClass *dc = DEVICE_CLASS(oc);

    dc->realize = pxa2xx_pcmcia_realize;

}


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

 {
+
     DeviceClass *dc = DEVICE_CLASS(klass);

     VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);

    dc->exit = virtio_blk_device_exit;

    dc->props = virtio_blk_properties;

    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);

    vdc->init = virtio_blk_device_init;

    vdc->get_config = virtio_blk_update_config;

    vdc->set_config = virtio_blk_set_config;

    vdc->get_features = virtio_blk_get_features;

    vdc->set_status = virtio_blk_set_status;

    vdc->reset = virtio_blk_reset;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int rtc_start_timer(struct qemu_alarm_timer *t)

 {
+
     int rtc_fd;

     unsigned long current_rtc_freq = 0;

static int rtc_start_timer(struct qemu_alarm_timer *t)

{

    int rtc_fd;

    unsigned long current_rtc_freq = 0;

    TFR(rtc_fd = open("/dev/rtc", O_RDONLY));

    if (rtc_fd < 0)

        return -1;

    ioctl(rtc_fd, RTC_IRQP_READ, &current_rtc_freq);

    if (current_rtc_freq != RTC_FREQ &&

        ioctl(rtc_fd, RTC_IRQP_SET, RTC_FREQ) < 0) {

        fprintf(stderr, "Could not configure '/dev/rtc' to have a 1024 Hz timer. This is not a fatal\n"

                "error, but for better emulation accuracy either use a 2.6 host Linux kernel or\n"

                "type 'echo 1024 > /proc/sys/dev/rtc/max-user-freq' as root.\n");

        goto fail;

    }

    if (ioctl(rtc_fd, RTC_PIE_ON, 0) < 0) {

    fail:

        close(rtc_fd);

        return -1;

    }

    enable_sigio_timer(rtc_fd);

    t->priv = (void *)(long)rtc_fd;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 MemTxResult memory_region_dispatch_write(MemoryRegion *mr,
                                          hwaddr addr,
                                          uint64_t data,
+                                         unsigned size,
+                                         MemTxAttrs attrs)
+{
+    if (!memory_region_access_valid(mr, addr, size, true)) {
+        unassigned_mem_write(mr, addr, data, size);
         return MEMTX_DECODE_ERROR;
     adjust_endianness(mr, &data, size);
     if (mr->ops->write) {

MemTxResult memory_region_dispatch_write(MemoryRegion *mr,
                                         hwaddr addr,
                                         uint64_t data,
                                         unsigned size,
                                         MemTxAttrs attrs)
{
    if (!memory_region_access_valid(mr, addr, size, true)) {
        unassigned_mem_write(mr, addr, data, size);
        return MEMTX_DECODE_ERROR;
    adjust_endianness(mr, &data, size);
    if (mr->ops->write) {
        return access_with_adjusted_size(addr, &data, size,
                                         mr->ops->impl.min_access_size,
                                         mr->ops->impl.max_access_size,
                                         memory_region_write_accessor, mr,
                                         attrs);
    } else if (mr->ops->write_with_attrs) {
        return
            access_with_adjusted_size(addr, &data, size,
                                      mr->ops->impl.min_access_size,
                                      mr->ops->impl.max_access_size,
                                      memory_region_write_with_attrs_accessor,
                                      mr, attrs);
    } else {
        return access_with_adjusted_size(addr, &data, size, 1, 4,
                                         memory_region_oldmmio_write_accessor,
                                         mr, attrs);


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static inline void set_p_mv_tables(MpegEncContext * s, int mx, int my)
+
+{
+
+    const int xy= s->mb_x + 1 + (s->mb_y + 1)*(s->mb_width + 2);
+

     s->p_mv_table[xy][0] = mx;

static inline void set_p_mv_tables(MpegEncContext * s, int mx, int my)

{

    const int xy= s->mb_x + 1 + (s->mb_y + 1)*(s->mb_width + 2);

    s->p_mv_table[xy][0] = mx;

    s->p_mv_table[xy][1] = my;

    /* has allready been set to the 4 MV if 4MV is done */

    if(!(s->flags&CODEC_FLAG_4MV)){

        int mot_xy= s->block_index[0];

        s->motion_val[mot_xy  ][0]= mx;

        s->motion_val[mot_xy  ][1]= my;

        s->motion_val[mot_xy+1][0]= mx;

        s->motion_val[mot_xy+1][1]= my;

        mot_xy += s->block_wrap[0];

        s->motion_val[mot_xy  ][0]= mx;

        s->motion_val[mot_xy  ][1]= my;

        s->motion_val[mot_xy+1][0]= mx;

        s->motion_val[mot_xy+1][1]= my;

    }

}


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

     MoxieCPUClass *mcc = MOXIE_CPU_GET_CLASS(dev);

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

{

    MoxieCPU *cpu = MOXIE_CPU(dev);

    MoxieCPUClass *mcc = MOXIE_CPU_GET_CLASS(dev);

    cpu_reset(CPU(cpu));

    mcc->parent_realize(dev, errp);

}


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

+    qemu_mod_timer(xen_poll, qemu_get_clock(rt_clock) + 1000);
+
+    return;
+
+

 quit:

static void xen_domain_poll(void *opaque)

{

    struct xc_dominfo info;

    int rc;

    rc = xc_domain_getinfo(xen_xc, xen_domid, 1, &info);

    if ((rc != 1) || (info.domid != xen_domid)) {

        qemu_log("xen: domain %d is gone\n", xen_domid);

        goto quit;

    }

    if (info.dying) {

        qemu_log("xen: domain %d is dying (%s%s)\n", xen_domid,

                 info.crashed  ? "crashed"  : "",

                 info.shutdown ? "shutdown" : "");

        goto quit;

    }

    qemu_mod_timer(xen_poll, qemu_get_clock(rt_clock) + 1000);

    return;

quit:

    qemu_system_shutdown_request();

    return;

}


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

+    return fileno(s->stdio_file);
+
 }

static int stdio_get_fd(void *opaque)

{

    QEMUFileStdio *s = opaque;

    return fileno(s->stdio_file);

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     cvalue->type = kind;

     init_native_list(cvalue);
+
+
+
+    visit_type_UserDefNativeListUnion(data->ov, NULL, &cvalue, &error_abort);
+

     obj = visitor_get(data);

static void test_native_list(TestOutputVisitorData *data,

                             const void *unused,

                             UserDefNativeListUnionKind kind)

{

    UserDefNativeListUnion *cvalue = g_new0(UserDefNativeListUnion, 1);

    QObject *obj;

    cvalue->type = kind;

    init_native_list(cvalue);

    visit_type_UserDefNativeListUnion(data->ov, NULL, &cvalue, &error_abort);

    obj = visitor_get(data);

    check_native_list(obj, cvalue->type);

    qapi_free_UserDefNativeListUnion(cvalue);

}


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

+{

     AFXState *s = TCX_AFX(dev);

static int afx_init1(SysBusDevice *dev)

{

    AFXState *s = TCX_AFX(dev);

    memory_region_init_ram(&s->mem, OBJECT(s), "sun4m.afx", 4, &error_abort);

    vmstate_register_ram_global(&s->mem);

    sysbus_init_mmio(dev, &s->mem);

    return 0;

}


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

     obj = user_creatable_add_type(type, id, pdict, v, errp);

+    visit_free(v);
+
+
+
+    QDECREF(pdict);

     return obj;

Object *user_creatable_add_opts(QemuOpts *opts, Error **errp)

{

    Visitor *v;

    QDict *pdict;

    Object *obj;

    const char *id = qemu_opts_id(opts);

    const char *type = qemu_opt_get(opts, "qom-type");

    if (!type) {

        error_setg(errp, QERR_MISSING_PARAMETER, "qom-type");

        return NULL;

    }

    if (!id) {

        error_setg(errp, QERR_MISSING_PARAMETER, "id");

        return NULL;

    }

    pdict = qemu_opts_to_qdict(opts, NULL);

    qdict_del(pdict, "qom-type");

    qdict_del(pdict, "id");

    v = opts_visitor_new(opts);

    obj = user_creatable_add_type(type, id, pdict, v, errp);

    visit_free(v);

    QDECREF(pdict);

    return obj;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void tpm_backend_cancel_cmd(TPMBackend *s)

+{

     TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);

void tpm_backend_cancel_cmd(TPMBackend *s)

{

    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);

    assert(k->cancel_cmd);

    k->cancel_cmd(s);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static bool sd_get_inserted(SDState *sd)

 {
+
     return blk_is_inserted(sd->blk);

 }

static bool sd_get_inserted(SDState *sd)

{

    return blk_is_inserted(sd->blk);

}


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

     USBDeviceClass *uc = USB_DEVICE_CLASS(klass);

+
+
+    uc->realize = usb_msd_realize_bot;

     uc->attached_settable = true;

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

{

    USBDeviceClass *uc = USB_DEVICE_CLASS(klass);

    uc->realize = usb_msd_realize_bot;

    uc->attached_settable = true;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static void device_set_hotplugged(Object *obj, bool value, Error **err)
+
+{

     DeviceState *dev = DEVICE(obj);

static void device_set_hotplugged(Object *obj, bool value, Error **err)

{

    DeviceState *dev = DEVICE(obj);

    dev->hotplugged = value;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static int coroutine_fn bdrv_co_writev_em(BlockDriverState *bs,
+
                                          int64_t sector_num, int nb_sectors,

                                          QEMUIOVector *iov)

static int coroutine_fn bdrv_co_writev_em(BlockDriverState *bs,

                                         int64_t sector_num, int nb_sectors,

                                         QEMUIOVector *iov)

{

    return bdrv_co_io_em(bs, sector_num, nb_sectors, iov, true);

}


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

     DBDMA_DPRINTF("dbdma_cmdptr_load 0x%08x\n",

+                  be32_to_cpu(ch->regs[DBDMA_CMDPTR_LO]));
+
+    cpu_physical_memory_read(be32_to_cpu(ch->regs[DBDMA_CMDPTR_LO]),

                              (uint8_t*)&ch->current, sizeof(dbdma_cmd));

static void dbdma_cmdptr_load(DBDMA_channel *ch)

{

    DBDMA_DPRINTF("dbdma_cmdptr_load 0x%08x\n",

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

    cpu_physical_memory_read(be32_to_cpu(ch->regs[DBDMA_CMDPTR_LO]),

                             (uint8_t*)&ch->current, sizeof(dbdma_cmd));

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int64_t cvtnum(const char *s)

 {
+
+    char *end;

     return qemu_strtosz_suffix(s, &end, QEMU_STRTOSZ_DEFSUFFIX_B);

static int64_t cvtnum(const char *s)

{

    char *end;

    return qemu_strtosz_suffix(s, &end, QEMU_STRTOSZ_DEFSUFFIX_B);

}


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

+
     init_get_bits(&gb, buf, size * 8);

     adts->objecttype = get_bits(&gb, 5) - 1;

static int decode_extradata(AVFormatContext *s, ADTSContext *adts, uint8_t *buf, int size)

{

    GetBitContext gb;

    init_get_bits(&gb, buf, size * 8);

    adts->objecttype = get_bits(&gb, 5) - 1;

    adts->sample_rate_index = get_bits(&gb, 4);

    adts->channel_conf = get_bits(&gb, 4);

    if (adts->objecttype > 3) {

        av_log(s, AV_LOG_ERROR, "MPEG-4 AOT %d is not allowed in ADTS\n", adts->objecttype);

        return -1;

    }

    if (adts->sample_rate_index == 15) {

        av_log(s, AV_LOG_ERROR, "Escape sample rate index illegal in ADTS\n");

        return -1;

    }

    if (adts->channel_conf == 0) {

        ff_log_missing_feature(s, "PCE based channel configuration", 0);

        return -1;

    }

    adts->write_adts = 1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static inline void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0,
+
                                        const uint16_t *ubuf0, const uint16_t *ubuf1,

+                                       const uint16_t *vbuf0, const uint16_t *vbuf1,

+                                       const uint16_t *abuf0, uint8_t *dest,

                                        int dstW, int uvalpha, enum PixelFormat dstFormat,

static inline void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0,

                                       const uint16_t *ubuf0, const uint16_t *ubuf1,

                                       const uint16_t *vbuf0, const uint16_t *vbuf1,

                                       const uint16_t *abuf0, uint8_t *dest,

                                       int dstW, int uvalpha, enum PixelFormat dstFormat,

                                       int flags, int y)

{

    x86_reg uv_off = c->uv_off << 1;

    const uint16_t *buf1= buf0; //FIXME needed for RGB1/BGR1

    if (uvalpha < 2048) { // note this is not correct (shifts chrominance by 0.5 pixels) but it is a bit faster

        __asm__ volatile(

            "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"

            "mov        %4, %%"REG_b"               \n\t"

            "push %%"REG_BP"                        \n\t"

            YSCALEYUV2RGB1(%%REGBP, %5, %6)

            "pxor    %%mm7, %%mm7                   \n\t"

            WRITEBGR24(%%REGb, 8280(%5), %%REGBP)

            "pop %%"REG_BP"                         \n\t"

            "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"

            :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),

               "a" (&c->redDither), "m"(uv_off)

        );

    } else {

        __asm__ volatile(

            "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"

            "mov        %4, %%"REG_b"               \n\t"

            "push %%"REG_BP"                        \n\t"

            YSCALEYUV2RGB1b(%%REGBP, %5, %6)

            "pxor    %%mm7, %%mm7                   \n\t"

            WRITEBGR24(%%REGb, 8280(%5), %%REGBP)

            "pop %%"REG_BP"                         \n\t"

            "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"

            :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),

               "a" (&c->redDither), "m"(uv_off)

        );

    }

}


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

     }
+
+    qemu_put_be32(f, blen);
+
+    f->buf_index += blen;
+
     return blen + sizeof(int32_t);

 }

ssize_t qemu_put_compression_data(QEMUFile *f, const uint8_t *p, size_t size,

                                  int level)

{

    ssize_t blen = IO_BUF_SIZE - f->buf_index - sizeof(int32_t);

    if (blen < compressBound(size)) {

        return 0;

    }

    if (compress2(f->buf + f->buf_index + sizeof(int32_t), (uLongf *)&blen,

                  (Bytef *)p, size, level) != Z_OK) {

        error_report("Compress Failed!");

        return 0;

    }

    qemu_put_be32(f, blen);

    f->buf_index += blen;

    return blen + sizeof(int32_t);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int sys_utimensat(int dirfd, const char *pathname,

     const struct timespec times[2], int flags)
+
+{

   return (utimensat(dirfd, pathname, times, flags));

static int sys_utimensat(int dirfd, const char *pathname,

    const struct timespec times[2], int flags)

{

  return (utimensat(dirfd, pathname, times, flags));

}


--- a/source.c
+++ b/source.c
@@ -2,6 +2,6 @@
                         DeviceState *dev, Error **errp)
 {
     MachineState *ms = MACHINE(hotplug_dev);
+    S390CPU *cpu = S390_CPU(dev);
     g_assert(!ms->possible_cpus->cpus[cpu->env.core_id].cpu);
     ms->possible_cpus->cpus[cpu->env.core_id].cpu = OBJECT(dev);

static void s390_cpu_plug(HotplugHandler *hotplug_dev,
                        DeviceState *dev, Error **errp)
{
    MachineState *ms = MACHINE(hotplug_dev);
    S390CPU *cpu = S390_CPU(dev);
    g_assert(!ms->possible_cpus->cpus[cpu->env.core_id].cpu);
    ms->possible_cpus->cpus[cpu->env.core_id].cpu = OBJECT(dev);


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

     ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP8, 8, 1);

+    ff_vp8dsp_init(&s->vp8dsp);
+
+
+
+    if ((ret = vp8_init_frames(s)) < 0) {

         ff_vp8_decode_free(avctx);

av_cold int ff_vp8_decode_init(AVCodecContext *avctx)

{

    VP8Context *s = avctx->priv_data;

    int ret;

    s->avctx = avctx;

    avctx->pix_fmt = AV_PIX_FMT_YUV420P;

    avctx->internal->allocate_progress = 1;

    ff_videodsp_init(&s->vdsp, 8);

    ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP8, 8, 1);

    ff_vp8dsp_init(&s->vp8dsp);

    if ((ret = vp8_init_frames(s)) < 0) {

        ff_vp8_decode_free(avctx);

        return ret;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,22 +1,22 @@
+static int read_rle_sgi(unsigned char* out_buf, const uint8_t *in_buf,

                         const uint8_t *in_end, SgiState* s)
+
 {

+    uint8_t *dest_row;

     unsigned int len = s->height * s->depth * 4;
+
     const uint8_t *start_table = in_buf;

     unsigned int y, z;

+    unsigned int start_offset;
+
+

+    /* size of  RLE offset and length tables */

     if(len * 2  > in_end - in_buf) {

static int read_rle_sgi(unsigned char* out_buf, const uint8_t *in_buf,

                        const uint8_t *in_end, SgiState* s)

{

    uint8_t *dest_row;

    unsigned int len = s->height * s->depth * 4;

    const uint8_t *start_table = in_buf;

    unsigned int y, z;

    unsigned int start_offset;

    /* size of  RLE offset and length tables */

    if(len * 2  > in_end - in_buf) {

        return AVERROR_INVALIDDATA;

    }

    in_buf -= SGI_HEADER_SIZE;

    for (z = 0; z < s->depth; z++) {

        dest_row = out_buf;

        for (y = 0; y < s->height; y++) {

            dest_row -= s->linesize;

            start_offset = bytestream_get_be32(&start_table);

            if(start_offset > in_end - in_buf) {

                return AVERROR_INVALIDDATA;

            }

            if (expand_rle_row(in_buf + start_offset, in_end, dest_row + z,

                dest_row + FFABS(s->linesize), s->depth) != s->width)

                return AVERROR_INVALIDDATA;

        }

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
                         int flag)

 {
+
+#ifdef KVM_CAP_MCE
+
+    struct kvm_x86_mce mce = {
+
         .bank = bank,

         .status = status,

void kvm_inject_x86_mce(CPUState *cenv, int bank, uint64_t status,

                        uint64_t mcg_status, uint64_t addr, uint64_t misc,

                        int flag)

{

#ifdef KVM_CAP_MCE

    struct kvm_x86_mce mce = {

        .bank = bank,

        .status = status,

        .mcg_status = mcg_status,

        .addr = addr,

        .misc = misc,

    };

    if (flag & MCE_BROADCAST) {

        kvm_mce_broadcast_rest(cenv);

    }

    kvm_inject_x86_mce_on(cenv, &mce, flag);

#else /* !KVM_CAP_MCE*/

    if (flag & ABORT_ON_ERROR) {

        abort();

    }

#endif /* !KVM_CAP_MCE*/

}


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

+    if (nb_input_files == 1)

         return 0;

static int init_input_threads(void)

{

    int i, ret;

    if (nb_input_files == 1)

        return 0;

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

        InputFile *f = input_files[i];

        if (f->ctx->pb ? !f->ctx->pb->seekable :

            strcmp(f->ctx->iformat->name, "lavfi"))

            f->non_blocking = 1;

        ret = av_thread_message_queue_alloc(&f->in_thread_queue,

                                            8, sizeof(AVPacket));

        if (ret < 0)

            return ret;

        if ((ret = pthread_create(&f->thread, NULL, input_thread, f)))

            return AVERROR(ret);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int64_t find_best_filter(const DCAADPCMEncContext *s, const int32_t *in, int len)

 {
+
     const premultiplied_coeffs *precalc_data = s->private_data;

     int i, j, k = 0;

static int64_t find_best_filter(const DCAADPCMEncContext *s, const int32_t *in, int len)

{

    const premultiplied_coeffs *precalc_data = s->private_data;

    int i, j, k = 0;

    int vq;

    int64_t err;

    int64_t min_err = 1ll << 62;

    int64_t corr[15];

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

        for (j = i; j <= DCA_ADPCM_COEFFS; j++)

            corr[k++] = calc_corr(in+4, len, i, j);

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

        err = apply_filter(ff_dca_adpcm_vb[i], corr, *precalc_data);

        if (err < min_err) {

            min_err = err;

            vq = i;

        }

        precalc_data++;

    }

    return vq;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 int av_get_cpu_flags(void)
+
 {

+    int flags = cpu_flags;

     if (flags == -1) {

int av_get_cpu_flags(void)

{

    int flags = cpu_flags;

    if (flags == -1) {

        flags = get_cpu_flags();

        cpu_flags = flags;

    }

    return flags;

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 TPMVersion tpm_backend_get_tpm_version(TPMBackend *s)

+{

     TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);

TPMVersion tpm_backend_get_tpm_version(TPMBackend *s)

{

    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);

    assert(k->get_tpm_version);

    return k->get_tpm_version(s);

}


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

     bs->zero_beyond_eof = zero_beyond_eof;

+
+
+    /* bdrv_co_do_writev will have increased the total_sectors value to include
+
+     * the VM state - the VM state is however not an actual part of the block

      * device, therefore, we need to restore the old value. */

static int qcow2_save_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,

                              int64_t pos)

{

    BDRVQcow2State *s = bs->opaque;

    int64_t total_sectors = bs->total_sectors;

    bool zero_beyond_eof = bs->zero_beyond_eof;

    int ret;

    BLKDBG_EVENT(bs->file, BLKDBG_VMSTATE_SAVE);

    bs->zero_beyond_eof = false;

    ret = bdrv_pwritev(bs, qcow2_vm_state_offset(s) + pos, qiov);

    bs->zero_beyond_eof = zero_beyond_eof;

    /* bdrv_co_do_writev will have increased the total_sectors value to include

     * the VM state - the VM state is however not an actual part of the block

     * device, therefore, we need to restore the old value. */

    bs->total_sectors = total_sectors;

    return ret;

}


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

     int ch;

+
+
+    if (!c->header_parsed) {
+
+        int hdrsize = adx_encode_header(avctx, dst, buf_size);

         dst += hdrsize;

static int adx_encode_frame(AVCodecContext *avctx, uint8_t *frame,

                            int buf_size, void *data)

{

    ADXContext *c          = avctx->priv_data;

    const int16_t *samples = data;

    uint8_t *dst           = frame;

    int ch;

    if (!c->header_parsed) {

        int hdrsize = adx_encode_header(avctx, dst, buf_size);

        dst += hdrsize;

        c->header_parsed = 1;

    }

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

        adx_encode(c, dst, samples + ch, &c->prev[ch], avctx->channels);

        dst += BLOCK_SIZE;

    }

    return dst - frame;

}


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

+
+    if (cpu->irqstate_saved_size == 0) {
+
+        return 0;
+
     }

     irq_state.buf = (uint64_t) cpu->irqstate;

int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu)

{

    CPUState *cs = CPU(cpu);

    struct kvm_s390_irq_state irq_state;

    int r;

    if (!kvm_check_extension(kvm_state, KVM_CAP_S390_IRQ_STATE)) {

        return -ENOSYS;

    }

    if (cpu->irqstate_saved_size == 0) {

        return 0;

    }

    irq_state.buf = (uint64_t) cpu->irqstate;

    irq_state.len = cpu->irqstate_saved_size;

    r = kvm_vcpu_ioctl(cs, KVM_S390_SET_IRQ_STATE, &irq_state);

    if (r) {

        error_report("Setting interrupt state failed %d", r);

    }

    return r;

}


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

     uint8_t buffer[4096];
+
+    size_t offset = 0;
+
+    int i;
+

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

static ssize_t vc_sendv_compat(VLANClientState *vc, const struct iovec *iov,

                               int iovcnt)

{

    uint8_t buffer[4096];

    size_t offset = 0;

    int i;

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

        size_t len;

        len = MIN(sizeof(buffer) - offset, iov[i].iov_len);

        memcpy(buffer + offset, iov[i].iov_base, len);

        offset += len;

    }

    vc->receive(vc->opaque, buffer, offset);

    return offset;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int packed_16bpc_bswap(SwsContext *c, const uint8_t *src[],
+
+                              int srcStride[], int srcSliceY, int srcSliceH,
+
+                              uint8_t *dst[], int dstStride[])

 {

static int packed_16bpc_bswap(SwsContext *c, const uint8_t *src[],

                              int srcStride[], int srcSliceY, int srcSliceH,

                              uint8_t *dst[], int dstStride[])

{

    int i, j, p;

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

        int srcstr = srcStride[p] >> 1;

        int dststr = dstStride[p] >> 1;

        uint16_t       *dstPtr =       (uint16_t *) dst[p];

        const uint16_t *srcPtr = (const uint16_t *) src[p];

        int min_stride         = FFMIN(srcstr, dststr);

        if(!dstPtr || !srcPtr)

            continue;

        for (i = 0; i < (srcSliceH >> c->chrDstVSubSample); i++) {

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

                dstPtr[j] = av_bswap16(srcPtr[j]);

            }

            srcPtr += srcstr;

            dstPtr += dststr;

        }

    }

    return srcSliceH;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+int bdrv_open_backing_file(BlockDriverState *bs)

 {

@@ -6,7 +6,7 @@

     int back_flags, ret;

+    BlockDriver *back_drv = NULL;

@@ -15,7 +15,7 @@
         return 0;

     }
+

     bs->open_flags &= ~BDRV_O_NO_BACKING;

int bdrv_open_backing_file(BlockDriverState *bs)

{

    char backing_filename[PATH_MAX];

    int back_flags, ret;

    BlockDriver *back_drv = NULL;

    if (bs->backing_hd != NULL) {

        return 0;

    }

    bs->open_flags &= ~BDRV_O_NO_BACKING;

    if (bs->backing_file[0] == '\0') {

        return 0;

    }

    bs->backing_hd = bdrv_new("");

    bdrv_get_full_backing_filename(bs, backing_filename,

                                   sizeof(backing_filename));

    if (bs->backing_format[0] != '\0') {

        back_drv = bdrv_find_format(bs->backing_format);

    }

    /* backing files always opened read-only */

    back_flags = bs->open_flags & ~(BDRV_O_RDWR | BDRV_O_SNAPSHOT);

    ret = bdrv_open(bs->backing_hd, backing_filename, NULL,

                    back_flags, back_drv);

    if (ret < 0) {

        bdrv_delete(bs->backing_hd);

        bs->backing_hd = NULL;

        bs->open_flags |= BDRV_O_NO_BACKING;

        return ret;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                                         int64_t sector_num, int nb_sectors,

                                         QEMUIOVector *iov)
+
 {

     NFSClient *client = bs->opaque;

static int coroutine_fn nfs_co_writev(BlockDriverState *bs,

                                        int64_t sector_num, int nb_sectors,

                                        QEMUIOVector *iov)

{

    NFSClient *client = bs->opaque;

    NFSRPC task;

    char *buf = NULL;

    nfs_co_init_task(client, &task);

    buf = g_malloc(nb_sectors * BDRV_SECTOR_SIZE);

    qemu_iovec_to_buf(iov, 0, buf, nb_sectors * BDRV_SECTOR_SIZE);

    if (nfs_pwrite_async(client->context, client->fh,

                         sector_num * BDRV_SECTOR_SIZE,

                         nb_sectors * BDRV_SECTOR_SIZE,

                         buf, nfs_co_generic_cb, &task) != 0) {

        g_free(buf);

        return -ENOMEM;

    }

    while (!task.complete) {

        nfs_set_events(client);

        qemu_coroutine_yield();

    }

    g_free(buf);

    if (task.ret != nb_sectors * BDRV_SECTOR_SIZE) {

        return task.ret < 0 ? task.ret : -EIO;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     int err = 0;

     if (!nptr) {
+
         if (endptr) {

             *endptr = nptr;

int qemu_strtol(const char *nptr, const char **endptr, int base,

                long *result)

{

    char *p;

    int err = 0;

    if (!nptr) {

        if (endptr) {

            *endptr = nptr;

        }

        err = -EINVAL;

    } else {

        errno = 0;

        *result = strtol(nptr, &p, base);

        err = check_strtox_error(endptr, p, errno);

    }

    return err;

}


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

                          int secondary_ide_enabled)

+{

     PCIDevice *dev;

void pci_cmd646_ide_init(PCIBus *bus, DriveInfo **hd_table,

                         int secondary_ide_enabled)

{

    PCIDevice *dev;

    dev = pci_create(bus, -1, "CMD646 IDE");

    qdev_prop_set_uint32(&dev->qdev, "secondary", secondary_ide_enabled);

    qdev_init(&dev->qdev);

    pci_ide_create_devs(dev, hd_table);

}


static void pci_piix_init_ports(PCIIDEState *d) {

    int i;

    struct {

        int iobase;

        int iobase2;

        int isairq;

    } port_info[] = {

        {0x1f0, 0x3f6, 14},

        {0x170, 0x376, 15},

    };

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

        ide_bus_new(&d->bus[i], &d->dev.qdev, i);

        ide_init_ioport(&d->bus[i], port_info[i].iobase, port_info[i].iobase2);

        ide_init2(&d->bus[i], isa_reserve_irq(port_info[i].isairq));

        bmdma_init(&d->bus[i], &d->bmdma[i]);

        d->bmdma[i].bus = &d->bus[i];

        qemu_add_vm_change_state_handler(d->bus[i].dma->ops->restart_cb,

                                         &d->bmdma[i].dma);

    }

}


--- a/source.c
+++ b/source.c
@@ -5,10 +5,10 @@
     const RunStateTransition *p;

+
+    memset(&runstate_valid_transitions, 0, sizeof(runstate_valid_transitions));
+
+

     for (p = &runstate_transitions_def[0]; p->from != RUN_STATE_MAX; p++) {

static void runstate_init(void)

{

    const RunStateTransition *p;

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

    for (p = &runstate_transitions_def[0]; p->from != RUN_STATE_MAX; p++) {

        runstate_valid_transitions[p->from][p->to] = true;

    }

}


--- a/source.c
+++ b/source.c
@@ -16,11 +16,11 @@
            x265pic.stride[i] = pic->linesize[i];
         }
         x265pic.pts = pic->pts;
+    }
+    ret = x265_encoder_encode(ctx->encoder, &nal, &nnal,
+                              pic ? &x265pic : NULL, &x265pic_out);
+    if (ret < 0)
+        return AVERROR_UNKNOWN;
     if (!nnal)
         return 0;
     for (i = 0; i < nnal; i++)

static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
                                const AVFrame *pic, int *got_packet)
{
    libx265Context *ctx = avctx->priv_data;
    x265_picture x265pic;
    x265_picture x265pic_out = { { 0 } };
    x265_nal *nal;
    uint8_t *dst;
    int payload = 0;
    int nnal;
    int ret;
    int i;
    if (pic) {
        for (i = 0; i < 3; i++) {
           x265pic.planes[i] = pic->data[i];
           x265pic.stride[i] = pic->linesize[i];
        }
        x265pic.pts = pic->pts;
    }
    ret = x265_encoder_encode(ctx->encoder, &nal, &nnal,
                              pic ? &x265pic : NULL, &x265pic_out);
    if (ret < 0)
        return AVERROR_UNKNOWN;
    if (!nnal)
        return 0;
    for (i = 0; i < nnal; i++)
        payload += nal[i].sizeBytes;
    payload += ctx->header_size;
    ret = ff_alloc_packet(pkt, payload);
    if (ret < 0) {
        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
        return ret;
    }
    dst = pkt->data;
    if (ctx->header) {
        memcpy(dst, ctx->header, ctx->header_size);
        dst += ctx->header_size;
        av_freep(&ctx->header);
        ctx->header_size = 0;
    }
    for (i = 0; i < nnal; i++) {
        memcpy(dst, nal[i].payload, nal[i].sizeBytes);
        dst += nal[i].sizeBytes;
        if (is_keyframe(nal[i].type))
            pkt->flags |= AV_PKT_FLAG_KEY;
    }
    pkt->pts = x265pic_out.pts;
    pkt->dts = x265pic_out.dts;
    *got_packet = 1;
    return 0;
}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void virtio_rng_initfn(Object *obj)

+{

     VirtIORNG *vrng = VIRTIO_RNG(obj);

static void virtio_rng_initfn(Object *obj)

{

    VirtIORNG *vrng = VIRTIO_RNG(obj);

    object_property_add_link(obj, "rng", TYPE_RNG_BACKEND,

                             (Object **)&vrng->conf.rng, NULL);

}


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

         }

+        if (ret & BDRV_BLOCK_ZERO) {
+
+            sector_num += n;
+
+            continue;

         }

int bdrv_make_zero(BlockDriverState *bs, BdrvRequestFlags flags)

{

    int64_t target_sectors, ret, nb_sectors, sector_num = 0;

    int n;

    target_sectors = bdrv_nb_sectors(bs);

    if (target_sectors < 0) {

        return target_sectors;

    }

    for (;;) {

        nb_sectors = target_sectors - sector_num;

        if (nb_sectors <= 0) {

            return 0;

        }

        if (nb_sectors > INT_MAX / BDRV_SECTOR_SIZE) {

            nb_sectors = INT_MAX / BDRV_SECTOR_SIZE;

        }

        ret = bdrv_get_block_status(bs, sector_num, nb_sectors, &n);

        if (ret < 0) {

            error_report("error getting block status at sector %" PRId64 ": %s",

                         sector_num, strerror(-ret));

            return ret;

        }

        if (ret & BDRV_BLOCK_ZERO) {

            sector_num += n;

            continue;

        }

        ret = bdrv_write_zeroes(bs, sector_num, n, flags);

        if (ret < 0) {

            error_report("error writing zeroes at sector %" PRId64 ": %s",

                         sector_num, strerror(-ret));

            return ret;

        }

        sector_num += n;

    }

}


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

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

static void test_qemu_strtoul_max(void)

{

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

    char f = 'X';

    const char *endptr = &f;

    unsigned long res = 999;

    int err;

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

    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, ULONG_MAX);

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

}


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

     pos = FFMAX(pos, FFM_PACKET_SIZE);

+    av_dlog(s, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos);
+
+    return avio_seek(pb, pos, SEEK_SET);
+
+}

static int64_t ffm_seek1(AVFormatContext *s, int64_t pos1)

{

    FFMContext *ffm = s->priv_data;

    AVIOContext *pb = s->pb;

    int64_t pos;

    pos = FFMIN(pos1, ffm->file_size - FFM_PACKET_SIZE);

    pos = FFMAX(pos, FFM_PACKET_SIZE);

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

    return avio_seek(pb, pos, SEEK_SET);

}


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

     vmstop_requested = state;

void qemu_system_vmstop_request(RunState state)

{

    vmstop_requested = state;

    qemu_notify_event();

}


static void add_bytes_l2_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w)

{

    long i;

    for (i = 0; i <= w - sizeof(long); i += sizeof(long)) {

        long a = *(long *)(src1 + i);

        long b = *(long *)(src2 + i);

        *(long *)(dst + i) = ((a & pb_7f) + (b & pb_7f)) ^ ((a ^ b) & pb_80);

    }

    for (; i < w; i++)

        dst[i] = src1[i] + src2[i];

}


--- a/source.c
+++ b/source.c
@@ -39,11 +39,11 @@
     if (get_buffer(pb, (uint8_t *) *str, size) != size) {

         offset_t pos = url_ftell(pb);
+
+        av_log(matroska->ctx, AV_LOG_ERROR,
+
+               "Read error at pos. %"PRIu64" (0x%"PRIx64")\n", pos, pos);
+

         return AVERROR(EIO);

ebml_read_ascii (MatroskaDemuxContext *matroska,

                 uint32_t             *id,

                 char                **str)

{

    ByteIOContext *pb = matroska->ctx->pb;

    int size, res;

    uint64_t rlength;

    if ((res = ebml_read_element_id(matroska, id, NULL)) < 0 ||

        (res = ebml_read_element_length(matroska, &rlength)) < 0)

        return res;

    size = rlength;

    /* ebml strings are usually not 0-terminated, so we allocate one

     * byte more, read the string and NULL-terminate it ourselves. */

    if (size < 0 || !(*str = av_malloc(size + 1))) {

        av_log(matroska->ctx, AV_LOG_ERROR, "Memory allocation failed\n");

        return AVERROR(ENOMEM);

    }

    if (get_buffer(pb, (uint8_t *) *str, size) != size) {

        offset_t pos = url_ftell(pb);

        av_log(matroska->ctx, AV_LOG_ERROR,

               "Read error at pos. %"PRIu64" (0x%"PRIx64")\n", pos, pos);

        return AVERROR(EIO);

    }

    (*str)[size] = '\0';

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int stride, int n){

     MpegEncContext * const s= &w->s;
+
+

     switch(w->abt_type_table[n]){

static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int stride, int n){

    MpegEncContext * const s= &w->s;

    switch(w->abt_type_table[n]){

    case 0:

        if (s->block_last_index[n] >= 0) {

            s->dsp.idct_add (dst, stride, block1);

        }

        break;

    case 1:

        simple_idct84_add(dst           , stride, block1);

        simple_idct84_add(dst + 4*stride, stride, w->abt_block2[n]);

        memset(w->abt_block2[n], 0, 64*sizeof(DCTELEM));

        break;

    case 2:

        simple_idct48_add(dst           , stride, block1);

        simple_idct48_add(dst + 4       , stride, w->abt_block2[n]);

        memset(w->abt_block2[n], 0, 64*sizeof(DCTELEM));

        break;

    default:

        av_log(s->avctx, AV_LOG_ERROR, "internal error in WMV2 abt\n");

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void usb_cancel_packet(USBPacket * p)
+
+{
+
     assert(p->owner != NULL);

     usb_device_cancel_packet(p->owner->dev, p);

void usb_cancel_packet(USBPacket * p)

{

    assert(p->owner != NULL);

    usb_device_cancel_packet(p->owner->dev, p);

    p->owner = NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,28 +1,28 @@
 static int net_dump_init(VLANState *vlan, const char *device,

                          const char *name, const char *filename, int len)
+
+{
+
     struct pcap_file_hdr hdr;

     DumpState *s;
+

     s = qemu_malloc(sizeof(DumpState));

+
     s->fd = open(filename, O_CREAT | O_WRONLY | O_BINARY, 0644);
+
     if (s->fd < 0) {
+
+        qemu_error("-net dump: can't open %s\n", filename);

         return -1;
+
+    }

static int net_dump_init(VLANState *vlan, const char *device,

                         const char *name, const char *filename, int len)

{

    struct pcap_file_hdr hdr;

    DumpState *s;

    s = qemu_malloc(sizeof(DumpState));

    s->fd = open(filename, O_CREAT | O_WRONLY | O_BINARY, 0644);

    if (s->fd < 0) {

        qemu_error("-net dump: can't open %s\n", filename);

        return -1;

    }

    s->pcap_caplen = len;

    hdr.magic = PCAP_MAGIC;

    hdr.version_major = 2;

    hdr.version_minor = 4;

    hdr.thiszone = 0;

    hdr.sigfigs = 0;

    hdr.snaplen = s->pcap_caplen;

    hdr.linktype = 1;

    if (write(s->fd, &hdr, sizeof(hdr)) < sizeof(hdr)) {

        qemu_error("-net dump write error: %s\n", strerror(errno));

        close(s->fd);

        qemu_free(s);

        return -1;

    }

    s->pcap_vc = qemu_new_vlan_client(NET_CLIENT_TYPE_DUMP,

                                      vlan, NULL, device, name, NULL,

                                      dump_receive, NULL, NULL,

                                      net_dump_cleanup, s);

    snprintf(s->pcap_vc->info_str, sizeof(s->pcap_vc->info_str),

             "dump to %s (len=%d)", filename, len);

    return 0;

}


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

     if (const_arg) {
+
+        assert(const_arg == 1);
+
+        tcg_out8(s, TCG_CONST);

         tcg_out32(s, arg);

static void tcg_out_ri32(TCGContext *s, int const_arg, TCGArg arg)

{

    if (const_arg) {

        assert(const_arg == 1);

        tcg_out8(s, TCG_CONST);

        tcg_out32(s, arg);

    } else {

        tcg_out_r(s, arg);

    }

}


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

     else if (ds_get_bytes_per_pixel(vs->ds) == 4)

+        jpeg_prepare_row32(vs, dst, x, y, count);
+
+    else
+
         jpeg_prepare_row16(vs, dst, x, y, count);

 }

static void jpeg_prepare_row(VncState *vs, uint8_t *dst, int x, int y,

                                       int count)

{

    if (vs->tight_pixel24)

        jpeg_prepare_row24(vs, dst, x, y, count);

    else if (ds_get_bytes_per_pixel(vs->ds) == 4)

        jpeg_prepare_row32(vs, dst, x, y, count);

    else

        jpeg_prepare_row16(vs, dst, x, y, count);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 CPUSPARCState *cpu_sparc_init(void)
+
+{
+
+    CPUSPARCState *env;
+

     cpu_exec_init();

CPUSPARCState *cpu_sparc_init(void)

{

    CPUSPARCState *env;

    cpu_exec_init();

    if (!(env = malloc(sizeof(CPUSPARCState))))

	return (NULL);

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

    env->cwp = 0;

    env->wim = 1;

    env->regwptr = env->regbase + (env->cwp * 16);

    env->access_type = ACCESS_DATA;

#if defined(CONFIG_USER_ONLY)

    env->user_mode_only = 1;

#else

    /* Emulate Prom */

    env->psrs = 1;

    env->pc = 0x4000;

    env->npc = env->pc + 4;

    env->mmuregs[0] = (0x10<<24) | MMU_E; /* Impl 1, ver 0, MMU Enabled */

    env->mmuregs[1] = 0x3000 >> 4; /* MMU Context table */

#endif

    cpu_single_env = env;

    return (env);

}


--- a/source.c
+++ b/source.c
@@ -1,25 +1,25 @@
+static int ram_load_dead(QEMUFile *f, void *opaque)
+
+{
+
+    RamDecompressState s1, *s = &s1;
+
+    uint8_t buf[10];
+
+    ram_addr_t i;

+
+
+    if (ram_decompress_open(s, f) < 0)
+
         return -EINVAL;

+    for(i = 0; i < last_ram_offset; i+= BDRV_HASH_BLOCK_SIZE) {
+
         if (ram_decompress_buf(s, buf, 1) < 0) {

+            fprintf(stderr, "Error while reading ram block header\n");
+
             goto error;

         }

static int ram_load_dead(QEMUFile *f, void *opaque)

{

    RamDecompressState s1, *s = &s1;

    uint8_t buf[10];

    ram_addr_t i;

    if (ram_decompress_open(s, f) < 0)

        return -EINVAL;

    for(i = 0; i < last_ram_offset; i+= BDRV_HASH_BLOCK_SIZE) {

        if (ram_decompress_buf(s, buf, 1) < 0) {

            fprintf(stderr, "Error while reading ram block header\n");

            goto error;

        }

        if (buf[0] == 0) {

            if (ram_decompress_buf(s, qemu_get_ram_ptr(i),

                                   BDRV_HASH_BLOCK_SIZE) < 0) {

                fprintf(stderr, "Error while reading ram block address=0x%08" PRIx64, (uint64_t)i);

                goto error;

            }

        } else {

        error:

            printf("Error block header\n");

            return -EINVAL;

        }

    }

    ram_decompress_close(s);

    return 0;

}


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

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

     if (!job) {

void qmp_block_job_set_speed(const char *device, int64_t value, Error **errp)

{

    BlockJob *job = find_block_job(device);

    if (!job) {

        error_set(errp, QERR_DEVICE_NOT_ACTIVE, device);

        return;

    }

    if (block_job_set_speed(job, value) < 0) {

        error_set(errp, QERR_NOT_SUPPORTED);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 av_cold void ff_blockdsp_init_x86(BlockDSPContext *c,

                                   AVCodecContext *avctx)
+
+#else
+
+av_cold void ff_blockdsp_init_x86(BlockDSPContext *c)
+
 #endif /* FF_API_XVMC */

 {

av_cold void ff_blockdsp_init_x86(BlockDSPContext *c,

                                  AVCodecContext *avctx)

#else

av_cold void ff_blockdsp_init_x86(BlockDSPContext *c)

#endif /* FF_API_XVMC */

{

#if HAVE_INLINE_ASM

    int cpu_flags = av_get_cpu_flags();

    if (INLINE_MMX(cpu_flags)) {

        c->clear_block  = clear_block_mmx;

        c->clear_blocks = clear_blocks_mmx;

    }

#if FF_API_XVMC

FF_DISABLE_DEPRECATION_WARNINGS

    /* XvMCCreateBlocks() may not allocate 16-byte aligned blocks */

    if (CONFIG_MPEG_XVMC_DECODER && avctx->xvmc_acceleration > 1)

        return;

FF_ENABLE_DEPRECATION_WARNINGS

#endif /* FF_API_XVMC */

    if (INLINE_SSE(cpu_flags)) {

        c->clear_block  = clear_block_sse;

        c->clear_blocks = clear_blocks_sse;

    }

#endif /* HAVE_INLINE_ASM */

}


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

 {
+
     DeviceClass *dc = DEVICE_CLASS(klass);

     VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);

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

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);

    dc->exit = virtio_serial_device_exit;

    dc->props = virtio_serial_properties;

    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);

    vdc->init = virtio_serial_device_init;

    vdc->get_features = get_features;

    vdc->get_config = get_config;

    vdc->set_config = set_config;

    vdc->set_status = set_status;

    vdc->reset = vser_reset;

}


--- a/source.c
+++ b/source.c
@@ -49,11 +49,11 @@
         memcpy(hid->dataout.buffer, hid->intrdataout.buffer,

                         hid->dataout.len = hid->intrdataout.len);
+
+        bt_hid_out(hid);
+
+    }
+

     return;

static void bt_hid_interrupt_sdu(void *opaque, const uint8_t *data, int len)

{

    struct bt_hid_device_s *hid = opaque;

    if (len > BT_HID_MTU || len < 1)

        goto bad;

    if ((data[0] & 3) != BT_DATA_OUTPUT)

        goto bad;

    if ((data[0] >> 4) == BT_DATA) {

        if (hid->intr_state)

            goto bad;

        hid->data_type = BT_DATA_OUTPUT;

        hid->intrdataout.len = 0;

    } else if ((data[0] >> 4) == BT_DATC) {

        if (!hid->intr_state)

            goto bad;

    } else

        goto bad;

    memcpy(hid->intrdataout.buffer + hid->intrdataout.len, data + 1, len - 1);

    hid->intrdataout.len += len - 1;

    hid->intr_state = (len == BT_HID_MTU);

    if (!hid->intr_state) {

        memcpy(hid->dataout.buffer, hid->intrdataout.buffer,

                        hid->dataout.len = hid->intrdataout.len);

        bt_hid_out(hid);

    }

    return;

bad:

    fprintf(stderr, "%s: bad transaction on Interrupt channel.\n",

                    __func__);

}


static void m5206_mbar_update(m5206_mbar_state *s)

{

    int irq;

    int vector;

    int level;

    irq = m5206_find_pending_irq(s);

    if (irq) {

        int tmp;

        tmp = s->icr[irq];

        level = (tmp >> 2) & 7;

        if (tmp & 0x80) {

            /* Autovector.  */

            vector = 24 + level;

        } else {

            switch (irq) {

            case 8: /* SWT */

                vector = s->swivr;

                break;

            case 12: /* UART1 */

                vector = s->uivr[0];

                break;

            case 13: /* UART2 */

                vector = s->uivr[1];

                break;

            default:

                /* Unknown vector.  */

                fprintf(stderr, "Unhandled vector for IRQ %d\n", irq);

                vector = 0xf;

                break;

            }

        }

    } else {

        level = 0;

        vector = 0;

    }

    m68k_set_irq_level(s->cpu, level, vector);

}


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

             mode = TOP_DC_PRED8x8;

+    }
+
+    return mode;
+
+}

static int check_intra_pred_mode(int mode, int mb_x, int mb_y)

{

    if (mode == DC_PRED8x8) {

        if (!(mb_x|mb_y))

            mode = DC_128_PRED8x8;

        else if (!mb_y)

            mode = LEFT_DC_PRED8x8;

        else if (!mb_x)

            mode = TOP_DC_PRED8x8;

    }

    return mode;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void add_query_tests(QmpSchema *schema)

 {
+
     SchemaInfoList *tail;

     SchemaInfo *si, *arg_type, *ret_type;

static void add_query_tests(QmpSchema *schema)

{

    SchemaInfoList *tail;

    SchemaInfo *si, *arg_type, *ret_type;

    const char *test_name;

    /* Test the query-like commands */

    for (tail = schema->list; tail; tail = tail->next) {

        si = tail->value;

        if (si->meta_type != SCHEMA_META_TYPE_COMMAND) {

            continue;

        }

        if (query_is_blacklisted(si->name)) {

            continue;

        }

        arg_type = qmp_schema_lookup(schema, si->u.command.arg_type);

        if (object_type_has_mandatory_members(arg_type)) {

            continue;

        }

        ret_type = qmp_schema_lookup(schema, si->u.command.ret_type);

        if (ret_type->meta_type == SCHEMA_META_TYPE_OBJECT

            && !ret_type->u.object.members) {

            continue;

        }

        test_name = g_strdup_printf("qmp/%s", si->name);

        qtest_add_data_func(test_name, si->name, test_query);

    }

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
     /* use a common default */

     error_report("warning: Invalid RAM size 0x%" PRIx64
+
+                 ". Using default 512M", s->ram_size);
+
+    s->ram_size = 512 << 20;
+
     return ASPEED_SDMC_AST2500_512MB;

 }

static int ast2500_rambits(AspeedSDMCState *s)

{

    switch (s->ram_size >> 20) {

    case 128:

        return ASPEED_SDMC_AST2500_128MB;

    case 256:

        return ASPEED_SDMC_AST2500_256MB;

    case 512:

        return ASPEED_SDMC_AST2500_512MB;

    case 1024:

        return ASPEED_SDMC_AST2500_1024MB;

    default:

        break;

    }

    /* use a common default */

    error_report("warning: Invalid RAM size 0x%" PRIx64

                 ". Using default 512M", s->ram_size);

    s->ram_size = 512 << 20;

    return ASPEED_SDMC_AST2500_512MB;

}


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

 {

+    TCGv_i64 tmp1 = tcg_temp_new_i64();

+    TCGv_i64 tmp2 = tcg_temp_new_i64();

static TCGv_i64 gen_muls_i64_i32(TCGv a, TCGv b)

{

    TCGv_i64 tmp1 = tcg_temp_new_i64();

    TCGv_i64 tmp2 = tcg_temp_new_i64();

    tcg_gen_ext_i32_i64(tmp1, a);

    dead_tmp(a);

    tcg_gen_ext_i32_i64(tmp2, b);

    dead_tmp(b);

    tcg_gen_mul_i64(tmp1, tmp1, tmp2);

    tcg_temp_free_i64(tmp2);

    return tmp1;

}


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

     *result = NULL;

+    v->result = result;
+
+
+
+    return &v->visitor;

 }

Visitor *qmp_output_visitor_new(QObject **result)

{

    QmpOutputVisitor *v;

    v = g_malloc0(sizeof(*v));

    v->visitor.type = VISITOR_OUTPUT;

    v->visitor.start_struct = qmp_output_start_struct;

    v->visitor.end_struct = qmp_output_end_struct;

    v->visitor.start_list = qmp_output_start_list;

    v->visitor.next_list = qmp_output_next_list;

    v->visitor.end_list = qmp_output_end_list;

    v->visitor.type_int64 = qmp_output_type_int64;

    v->visitor.type_uint64 = qmp_output_type_uint64;

    v->visitor.type_bool = qmp_output_type_bool;

    v->visitor.type_str = qmp_output_type_str;

    v->visitor.type_number = qmp_output_type_number;

    v->visitor.type_any = qmp_output_type_any;

    v->visitor.type_null = qmp_output_type_null;

    v->visitor.complete = qmp_output_complete;

    v->visitor.free = qmp_output_free;

    *result = NULL;

    v->result = result;

    return &v->visitor;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 void cache_fini(PageCache *cache)

 {
+
+    int64_t i;
+
+
+
     g_assert(cache);

     g_assert(cache->page_cache);

void cache_fini(PageCache *cache)

{

    int64_t i;

    g_assert(cache);

    g_assert(cache->page_cache);

    for (i = 0; i < cache->max_num_items; i++) {

        g_free(cache->page_cache[i].it_data);

    }

    g_free(cache->page_cache);

    cache->page_cache = NULL;

}


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

+    ahci_clean_mem(ahci);
+
+    free_ahci_device(ahci->dev);
+
     g_free(ahci);

     qtest_shutdown(qs);

static void ahci_shutdown(AHCIQState *ahci)

{

    QOSState *qs = ahci->parent;

    ahci_clean_mem(ahci);

    free_ahci_device(ahci->dev);

    g_free(ahci);

    qtest_shutdown(qs);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void device_finalize(Object *obj)

 {
+
     NamedGPIOList *ngl, *next;

static void device_finalize(Object *obj)

{

    NamedGPIOList *ngl, *next;

    DeviceState *dev = DEVICE(obj);

    qemu_opts_del(dev->opts);

    QLIST_FOREACH_SAFE(ngl, &dev->gpios, node, next) {

        QLIST_REMOVE(ngl, node);

        qemu_free_irqs(ngl->in, ngl->num_in);

        g_free(ngl->name);

        g_free(ngl);

        /* ngl->out irqs are owned by the other end and should not be freed

         * here

         */

    }

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
+static int gif_read_packet(AVFormatContext * s1,
+
+                           AVPacket * pkt)
+
+{
+
+    GifState *s = s1->priv_data;

+    int ret;
+
+

     ret = gif_parse_next_image(s);

static int gif_read_packet(AVFormatContext * s1,

                           AVPacket * pkt)

{

    GifState *s = s1->priv_data;

    int ret;

    ret = gif_parse_next_image(s);

    if (ret < 0)

        return ret;

    /* XXX: avoid copying */

    if (av_new_packet(pkt, s->screen_width * s->screen_height * 3)) {

        return AVERROR(EIO);

    }

    pkt->stream_index = 0;

    memcpy(pkt->data, s->image_buf, s->screen_width * s->screen_height * 3);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 static int qio_channel_buffer_close(QIOChannel *ioc,

                                     Error **errp)
+
+{
+
+    QIOChannelBuffer *bioc = QIO_CHANNEL_BUFFER(ioc);
+

     g_free(bioc->data);

static int qio_channel_buffer_close(QIOChannel *ioc,

                                    Error **errp)

{

    QIOChannelBuffer *bioc = QIO_CHANNEL_BUFFER(ioc);

    g_free(bioc->data);

    bioc->capacity = bioc->usage = bioc->offset = 0;

    return 0;

}