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

     tcsetattr(0, TCSANOW, &oldtty);

static void term_exit(void)

{

    tcsetattr(0, TCSANOW, &oldtty);

}


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

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

+            metadata_parse(s);
+
+        }
+
+    }

static av_cold int flac_decode_init(AVCodecContext *avctx)

{

    FLACContext *s = avctx->priv_data;

    s->avctx = avctx;

    avctx->sample_fmt = SAMPLE_FMT_S16;

    if (avctx->extradata_size > 4) {

        /* initialize based on the demuxer-supplied streamdata header */

        if (avctx->extradata_size == FLAC_STREAMINFO_SIZE) {

            ff_flac_parse_streaminfo(avctx, (FLACStreaminfo *)s,

                                     avctx->extradata);

            allocate_buffers(s);

        } else {

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

            metadata_parse(s);

        }

    }

    return 0;

}


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

     union {
+
         double d;

         uint64_t i;

void do_fctiw (void)

{

    union {

        double d;

        uint64_t i;

    } p;

    /* XXX: higher bits are not supposed to be significant.

     *     to make tests easier, return the same as a real PowerPC 750 (aka G3)

     */

    p.i = float64_to_int32(FT0, &env->fp_status);

    p.i |= 0xFFF80000ULL << 32;

    FT0 = p.d;

}


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

     int max_rows;
+
+
+
+    if (vs->clientds.pf.bytes_per_pixel == 4 && vs->clientds.pf.rmax == 0xFF &&
+
         vs->clientds.pf.bmax == 0xFF && vs->clientds.pf.gmax == 0xFF) {

         vs->tight_pixel24 = true;

int vnc_tight_send_framebuffer_update(VncState *vs, int x, int y,

                                      int w, int h)

{

    int max_rows;

    if (vs->clientds.pf.bytes_per_pixel == 4 && vs->clientds.pf.rmax == 0xFF &&

        vs->clientds.pf.bmax == 0xFF && vs->clientds.pf.gmax == 0xFF) {

        vs->tight_pixel24 = true;

    } else {

        vs->tight_pixel24 = false;

    }

    if (w * h < VNC_TIGHT_MIN_SPLIT_RECT_SIZE)

        return send_rect_simple(vs, x, y, w, h);

    /* Calculate maximum number of rows in one non-solid rectangle. */

    max_rows = tight_conf[vs->tight_compression].max_rect_size;

    max_rows /= MIN(tight_conf[vs->tight_compression].max_rect_width, w);

    return find_large_solid_color_rect(vs, x, y, w, h, max_rows);

}


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

+    /* return image */
+
+    *data_size = sizeof(AVFrame);
+
+    *(AVFrame*)data= s->picture;

static int dvvideo_decode_frame(AVCodecContext *avctx,

                                 void *data, int *data_size,

                                 uint8_t *buf, int buf_size)

{

    DVVideoContext *s = avctx->priv_data;

    /* special case for last picture */

    if(buf_size==0)

        return 0;

    s->sys = dv_frame_profile(buf);

    if (!s->sys || buf_size < s->sys->frame_size)

        return -1; /* NOTE: we only accept several full frames */

    if(s->picture.data[0])

        avctx->release_buffer(avctx, &s->picture);

    s->picture.reference = 0;

    avctx->pix_fmt = s->sys->pix_fmt;

    avctx->width = s->sys->width;

    avctx->height = s->sys->height;

    if(avctx->get_buffer(avctx, &s->picture) < 0) {

        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");

        return -1;

    }

    s->picture.interlaced_frame = 1;

    s->picture.top_field_first = 0;

    s->buf = buf;

    avctx->execute(avctx, dv_decode_mt, (void**)&dv_anchor[0], NULL,

	           s->sys->difseg_size * 27);

    emms_c();

    /* return image */

    *data_size = sizeof(AVFrame);

    *(AVFrame*)data= s->picture;

    return s->sys->frame_size;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void acpi_gpe_init(ACPIREGS *ar, uint8_t len)

+{
+
     ar->gpe.len = len;

     ar->gpe.sts = g_malloc0(len / 2);

void acpi_gpe_init(ACPIREGS *ar, uint8_t len)

{

    ar->gpe.len = len;

    ar->gpe.sts = g_malloc0(len / 2);

    ar->gpe.en = g_malloc0(len / 2);

}


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

     SLAVIO_INTCTLState *s = opaque;
+
+
+
+    DPRINTF("Set cpu %d irq %d level %d\n", s->target_cpu, irq, level);
+
     if (irq < 32) {

 	uint32_t mask = 1 << irq;

static void slavio_set_irq(void *opaque, int irq, int level)

{

    SLAVIO_INTCTLState *s = opaque;

    DPRINTF("Set cpu %d irq %d level %d\n", s->target_cpu, irq, level);

    if (irq < 32) {

	uint32_t mask = 1 << irq;

	uint32_t pil = s->intbit_to_level[irq];

	if (pil > 0) {

	    if (level) {

		s->intregm_pending |= mask;

		s->intreg_pending[s->target_cpu] |= 1 << pil;

		slavio_check_interrupts(s);

	    }

	    else {

		s->intregm_pending &= ~mask;

		s->intreg_pending[s->target_cpu] &= ~(1 << pil);

	    }

	}

    }

}


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

 #if defined(cpudef_setup)

+    cpudef_setup(); /* parse cpu definitions in target config file */
+
 #endif

 }

static void cpudef_init(void)

{

#if defined(cpudef_setup)

    cpudef_setup(); /* parse cpu definitions in target config file */

#endif

}


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

 #endif

+
+
+    while (len) {
+
+        if (dma->translate(dma, addr, &paddr, &plen, dir) != 0) {

             return false;

bool iommu_dma_memory_valid(DMAContext *dma, dma_addr_t addr, dma_addr_t len,

                            DMADirection dir)

{

    target_phys_addr_t paddr, plen;

#ifdef DEBUG_IOMMU

    fprintf(stderr, "dma_memory_check context=%p addr=0x" DMA_ADDR_FMT

            " len=0x" DMA_ADDR_FMT " dir=%d\n", dma, addr, len, dir);

#endif

    while (len) {

        if (dma->translate(dma, addr, &paddr, &plen, dir) != 0) {

            return false;

        }

        /* The translation might be valid for larger regions. */

        if (plen > len) {

            plen = len;

        }

        len -= plen;

        addr += plen;

    }

    return true;

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+uint64_t HELPER(neon_sub_saturate_u64)(uint64_t src1, uint64_t src2)
+
+{
+
+    uint64_t res;

+

+    if (src1 < src2) {

         env->QF = 1;

uint64_t HELPER(neon_sub_saturate_u64)(uint64_t src1, uint64_t src2)

{

    uint64_t res;

    if (src1 < src2) {

        env->QF = 1;

        res = 0;

    } else {

        res = src1 - src2;

    }

    return res;

}


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

     return client->recv_coroutine || client->nb_requests < MAX_NBD_REQUESTS;
+
+}

static int nbd_can_read(void *opaque)

{

    NBDClient *client = opaque;

    return client->recv_coroutine || client->nb_requests < MAX_NBD_REQUESTS;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void get_sensor_type(IPMIBmcSim *ibs,

                                uint8_t *cmd, unsigned int cmd_len,
+
                                uint8_t *rsp, unsigned int *rsp_len,

                                unsigned int max_rsp_len)

static void get_sensor_type(IPMIBmcSim *ibs,

                               uint8_t *cmd, unsigned int cmd_len,

                               uint8_t *rsp, unsigned int *rsp_len,

                               unsigned int max_rsp_len)

{

    IPMISensor *sens;

    IPMI_CHECK_CMD_LEN(3);

    if ((cmd[2] > MAX_SENSORS) ||

            !IPMI_SENSOR_GET_PRESENT(ibs->sensors + cmd[2])) {

        rsp[2] = IPMI_CC_REQ_ENTRY_NOT_PRESENT;

        return;

    }

    sens = ibs->sensors + cmd[2];

    IPMI_ADD_RSP_DATA(sens->sensor_type);

    IPMI_ADD_RSP_DATA(sens->evt_reading_type_code);

}


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

     if (!swr_is_initialized(s)) {
+
         if ((ret = swr_config_frame(s, out, in)) < 0)

             return ret;

int swr_convert_frame(SwrContext *s,

                      AVFrame *out, const AVFrame *in)

{

    int ret, setup = 0;

    if (!swr_is_initialized(s)) {

        if ((ret = swr_config_frame(s, out, in)) < 0)

            return ret;

        if ((ret = swr_init(s)) < 0)

            return ret;

        setup = 1;

    } else {

        // return as is or reconfigure for input changes?

        if ((ret = config_changed(s, out, in)))

            return ret;

    }

    if (out) {

        if (!out->linesize[0]) {

            out->nb_samples =   swr_get_delay(s, s->out_sample_rate)

                              + in->nb_samples*(int64_t)s->out_sample_rate / s->in_sample_rate

                              + 3;

            if ((ret = av_frame_get_buffer(out, 0)) < 0) {

                if (setup)

                    swr_close(s);

                return ret;

            }

        } else {

            if (!out->nb_samples)

                out->nb_samples = available_samples(out);

        }

    }

    return convert_frame(s, out, in);

}


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

     uint32_t mask;

+    int rv, i;
+
+    struct model_features_t ft[] = {
+
+        {&guest_def->features, &host_def.features,

             ~0, feature_name, 0x00000000},

static int check_features_against_host(x86_def_t *guest_def)

{

    x86_def_t host_def;

    uint32_t mask;

    int rv, i;

    struct model_features_t ft[] = {

        {&guest_def->features, &host_def.features,

            ~0, feature_name, 0x00000000},

        {&guest_def->ext_features, &host_def.ext_features,

            ~CPUID_EXT_HYPERVISOR, ext_feature_name, 0x00000001},

        {&guest_def->ext2_features, &host_def.ext2_features,

            ~PPRO_FEATURES, ext2_feature_name, 0x80000000},

        {&guest_def->ext3_features, &host_def.ext3_features,

            ~CPUID_EXT3_SVM, ext3_feature_name, 0x80000001}};

    cpu_x86_fill_host(&host_def);

    for (rv = 0, i = 0; i < ARRAY_SIZE(ft); ++i)

        for (mask = 1; mask; mask <<= 1)

            if (ft[i].check_feat & mask && *ft[i].guest_feat & mask &&

                !(*ft[i].host_feat & mask)) {

                    unavailable_host_feature(&ft[i], mask);

                    rv = 1;

                }

    return rv;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void ppc_set_irq(PowerPCCPU *cpu, int n_IRQ, int level)

 {
+
     CPUState *cs = CPU(cpu);

     CPUPPCState *env = &cpu->env;

void ppc_set_irq(PowerPCCPU *cpu, int n_IRQ, int level)

{

    CPUState *cs = CPU(cpu);

    CPUPPCState *env = &cpu->env;

    unsigned int old_pending = env->pending_interrupts;

    if (level) {

        env->pending_interrupts |= 1 << n_IRQ;

        cpu_interrupt(cs, CPU_INTERRUPT_HARD);

    } else {

        env->pending_interrupts &= ~(1 << n_IRQ);

        if (env->pending_interrupts == 0) {

            cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);

        }

    }

    if (old_pending != env->pending_interrupts) {

#ifdef CONFIG_KVM

        kvmppc_set_interrupt(cpu, n_IRQ, level);

#endif

    }

    LOG_IRQ("%s: %p n_IRQ %d level %d => pending %08" PRIx32

                "req %08x\n", __func__, env, n_IRQ, level,

                env->pending_interrupts, CPU(cpu)->interrupt_request);

}


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

         rc = nbd_send_reply(csock, reply);

+    } else {
+
+        socket_set_cork(csock, 1);
+
+        rc = nbd_send_reply(csock, reply);

         if (rc >= 0) {

static ssize_t nbd_co_send_reply(NBDRequest *req, struct nbd_reply *reply,

                                 int len)

{

    NBDClient *client = req->client;

    int csock = client->sock;

    ssize_t rc, ret;

    qemu_co_mutex_lock(&client->send_lock);

    qemu_set_fd_handler2(csock, nbd_can_read, nbd_read,

                         nbd_restart_write, client);

    client->send_coroutine = qemu_coroutine_self();

    if (!len) {

        rc = nbd_send_reply(csock, reply);

    } else {

        socket_set_cork(csock, 1);

        rc = nbd_send_reply(csock, reply);

        if (rc >= 0) {

            ret = qemu_co_send(csock, req->data, len);

            if (ret != len) {

                rc = -EIO;

            }

        }

        socket_set_cork(csock, 0);

    }

    client->send_coroutine = NULL;

    qemu_set_fd_handler2(csock, nbd_can_read, nbd_read, NULL, client);

    qemu_co_mutex_unlock(&client->send_lock);

    return rc;

}


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

         len = sg[i].iov_len;

+        sg[i].iov_base = dma_memory_map(vdev->dma_as,
+
+                                        addr[i], &len, is_write ?
+
+                                        DMA_DIRECTION_FROM_DEVICE :

                                         DMA_DIRECTION_TO_DEVICE);

static void virtqueue_map_iovec(VirtIODevice *vdev, struct iovec *sg,

                                hwaddr *addr, unsigned int *num_sg,

                                unsigned int max_size, int is_write)

{

    unsigned int i;

    hwaddr len;

    /* Note: this function MUST validate input, some callers

     * are passing in num_sg values received over the network.

     */

    /* TODO: teach all callers that this can fail, and return failure instead

     * of asserting here.

     * When we do, we might be able to re-enable NDEBUG below.

     */

#ifdef NDEBUG

#error building with NDEBUG is not supported

#endif

    assert(*num_sg <= max_size);

    for (i = 0; i < *num_sg; i++) {

        len = sg[i].iov_len;

        sg[i].iov_base = dma_memory_map(vdev->dma_as,

                                        addr[i], &len, is_write ?

                                        DMA_DIRECTION_FROM_DEVICE :

                                        DMA_DIRECTION_TO_DEVICE);

        if (!sg[i].iov_base) {

            error_report("virtio: error trying to map MMIO memory");

            exit(1);

        }

        if (len != sg[i].iov_len) {

            error_report("virtio: unexpected memory split");

            exit(1);

        }

    }

}


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

+
+    snprintf(buf, sizeof(buf), "%s.%d", model, id);
+
+
+
     return g_strdup(buf);

 }

static char *assign_name(NetClientState *nc1, const char *model)

{

    NetClientState *nc;

    char buf[256];

    int id = 0;

    QTAILQ_FOREACH(nc, &net_clients, next) {

        if (nc == nc1) {

            continue;

        }

        /* For compatibility only bump id for net clients on a vlan */

        if (strcmp(nc->model, model) == 0 &&

            net_hub_id_for_client(nc, NULL) == 0) {

            id++;

        }

    }

    snprintf(buf, sizeof(buf), "%s.%d", model, id);

    return g_strdup(buf);

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
                     if (half_vert) {
                         s->frame.data[0][(y+1)*s->frame.linesize[0] + x] = color;
                         if (half_horiz)
+                            s->frame.data[0][(y+1)*s->frame.linesize[0] + x + 1] = color;
+                    }
+                    d++;
+                }
+                x += 1 + half_horiz;
             }
         }
         r += length;

static void mm_decode_inter(MmContext * s, int half_horiz, int half_vert, const uint8_t *buf, int buf_size)
{
    const int data_ptr = 2 + AV_RL16(&buf[0]);
    int d, r, y;
    d = data_ptr; r = 2; y = 0;
    while(r < data_ptr) {
        int i, j;
        int length = buf[r] & 0x7f;
        int x = buf[r+1] + ((buf[r] & 0x80) << 1);
        r += 2;
        if (length==0) {
            y += x;
            continue;
        }
        for(i=0; i<length; i++) {
            for(j=0; j<8; j++) {
                int replace = (buf[r+i] >> (7-j)) & 1;
                if (replace) {
                    int color = buf[d];
                    s->frame.data[0][y*s->frame.linesize[0] + x] = color;
                    if (half_horiz)
                        s->frame.data[0][y*s->frame.linesize[0] + x + 1] = color;
                    if (half_vert) {
                        s->frame.data[0][(y+1)*s->frame.linesize[0] + x] = color;
                        if (half_horiz)
                            s->frame.data[0][(y+1)*s->frame.linesize[0] + x + 1] = color;
                    }
                    d++;
                }
                x += 1 + half_horiz;
            }
        }
        r += length;
        y += 1 + half_vert;
    }
}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static int decode_residual_block(AVSContext *h, GetBitContext *gb,

+                                 const dec_2dvlc_t *r, int esc_golomb_order,
+
                                  int qp, uint8_t *dst, int stride) {

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

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

                                 const dec_2dvlc_t *r, int esc_golomb_order,

                                 int qp, uint8_t *dst, int stride) {

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

    DCTELEM level_buf[64];

    uint8_t run_buf[64];

    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->s.dsp.cavs_idct8_add(dst,block,stride);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -3,21 +3,21 @@
                                                  const siginfo_t *info)

 {
+
+    int sig = host_to_target_signal(info->si_signo);
+
+    tinfo->si_signo = sig;
+
+    tinfo->si_errno = 0;
+
+    tinfo->si_code = info->si_code;
+
+
+
+    if (sig == TARGET_SIGILL || sig == TARGET_SIGFPE || sig == TARGET_SIGSEGV
+
+            || sig == TARGET_SIGBUS || sig == TARGET_SIGTRAP) {
+
         /* Should never come here, but who knows. The information for

            the target is irrelevant.  */

static inline void host_to_target_siginfo_noswap(target_siginfo_t *tinfo,

                                                 const siginfo_t *info)

{

    int sig = host_to_target_signal(info->si_signo);

    tinfo->si_signo = sig;

    tinfo->si_errno = 0;

    tinfo->si_code = info->si_code;

    if (sig == TARGET_SIGILL || sig == TARGET_SIGFPE || sig == TARGET_SIGSEGV

            || sig == TARGET_SIGBUS || sig == TARGET_SIGTRAP) {

        /* Should never come here, but who knows. The information for

           the target is irrelevant.  */

        tinfo->_sifields._sigfault._addr = 0;

    } else if (sig == TARGET_SIGIO) {

        tinfo->_sifields._sigpoll._band = info->si_band;

        tinfo->_sifields._sigpoll._fd = info->si_fd;

    } else if (sig == TARGET_SIGCHLD) {

        tinfo->_sifields._sigchld._pid = info->si_pid;

        tinfo->_sifields._sigchld._uid = info->si_uid;

        tinfo->_sifields._sigchld._status

                = host_to_target_waitstatus(info->si_status);

        tinfo->_sifields._sigchld._utime = info->si_utime;

        tinfo->_sifields._sigchld._stime = info->si_stime;

    } else if (sig >= TARGET_SIGRTMIN) {

        tinfo->_sifields._rt._pid = info->si_pid;

        tinfo->_sifields._rt._uid = info->si_uid;

        /* XXX: potential problem if 64 bit */

        tinfo->_sifields._rt._sigval.sival_ptr

                = (abi_ulong)(unsigned long)info->si_value.sival_ptr;

    }

}


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

     /* Initialise controller registers */

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

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

                 (opp->vid << FREP_VID_SHIFT);

static void openpic_reset(DeviceState *d)

{

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

    int i;

    opp->glbc = GLBC_RESET;

    /* Initialise controller registers */

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

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

                (opp->vid << FREP_VID_SHIFT);

    opp->pint = 0;

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

    opp->tifr = opp->tifr_reset;

    /* Initialise IRQ sources */

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

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

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

    }

    /* Initialise IRQ destinations */

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

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

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

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

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

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

    }

    /* Initialise timers */

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

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

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

    }

    /* Go out of RESET state */

    opp->glbc = 0;

}


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

     unsigned i = HBITMAP_LEVELS - 1;

+

     unsigned long cur;
+
     do {

         cur = hbi->cur[--i];

unsigned long hbitmap_iter_skip_words(HBitmapIter *hbi)

{

    size_t pos = hbi->pos;

    const HBitmap *hb = hbi->hb;

    unsigned i = HBITMAP_LEVELS - 1;

    unsigned long cur;

    do {

        cur = hbi->cur[--i];

        pos >>= BITS_PER_LEVEL;

    } while (cur == 0);

    /* Check for end of iteration.  We always use fewer than BITS_PER_LONG

     * bits in the level 0 bitmap; thus we can repurpose the most significant

     * bit as a sentinel.  The sentinel is set in hbitmap_alloc and ensures

     * that the above loop ends even without an explicit check on i.

     */

    if (i == 0 && cur == (1UL << (BITS_PER_LONG - 1))) {

        return 0;

    }

    for (; i < HBITMAP_LEVELS - 1; i++) {

        /* Shift back pos to the left, matching the right shifts above.

         * The index of this word's least significant set bit provides

         * the low-order bits.

         */

        pos = (pos << BITS_PER_LEVEL) + ffsl(cur) - 1;

        hbi->cur[i] = cur & (cur - 1);

        /* Set up next level for iteration.  */

        cur = hb->levels[i + 1][pos];

    }

    hbi->pos = pos;

    trace_hbitmap_iter_skip_words(hbi->hb, hbi, pos, cur);

    assert(cur);

    return cur;

}


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

         return -1;

+
+
+    c->dstFormatBpp = av_get_bits_per_pixel(desc_dst);
+
+    c->srcFormatBpp = av_get_bits_per_pixel(desc_src);

int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],

                             int srcRange, const int table[4], int dstRange,

                             int brightness, int contrast, int saturation)

{

    const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(c->dstFormat);

    const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(c->srcFormat);

    memcpy(c->srcColorspaceTable, inv_table, sizeof(int) * 4);

    memcpy(c->dstColorspaceTable, table, sizeof(int) * 4);

    c->brightness = brightness;

    c->contrast   = contrast;

    c->saturation = saturation;

    c->srcRange   = srcRange;

    c->dstRange   = dstRange;

    if (isYUV(c->dstFormat) || isGray(c->dstFormat))

        return -1;

    c->dstFormatBpp = av_get_bits_per_pixel(desc_dst);

    c->srcFormatBpp = av_get_bits_per_pixel(desc_src);

    ff_yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness,

                             contrast, saturation);

    // FIXME factorize

    if (HAVE_ALTIVEC && av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)

        ff_yuv2rgb_init_tables_altivec(c, inv_table, brightness,

                                       contrast, saturation);

    return 0;

}


void bt_device_done(struct bt_device_s *dev)

{

    struct bt_device_s **p = &dev->net->slave;

    while (*p && *p != dev)

        p = &(*p)->next;

    if (*p != dev) {

        fprintf(stderr, "%s: bad bt device \"%s\"\n", __FUNCTION__,

                        dev->lmp_name ?: "(null)");

        exit(-1);

    }

    *p = dev->next;

}


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

+{
+
     ssize_t ret;

 #ifdef CONFIG_VNC_TLS

+    if (vs->tls.session) {

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

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

{

    ssize_t ret;

#ifdef CONFIG_VNC_TLS

    if (vs->tls.session) {

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

    } else {

#endif /* CONFIG_VNC_TLS */

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

#ifdef CONFIG_VNC_TLS

    }

#endif /* CONFIG_VNC_TLS */

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

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

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
         NVDIMMDevice *nvd = list->data;

         int slot = object_property_get_int(OBJECT(nvd), PC_DIMM_SLOT_PROP,
+
+                                           NULL);
+
+
+
         if (nvdimm_slot_to_handle(slot) == handle) {

             nvdimm = nvd;

static NVDIMMDevice *nvdimm_get_device_by_handle(uint32_t handle)

{

    NVDIMMDevice *nvdimm = NULL;

    GSList *list, *device_list = nvdimm_get_plugged_device_list();

    for (list = device_list; list; list = list->next) {

        NVDIMMDevice *nvd = list->data;

        int slot = object_property_get_int(OBJECT(nvd), PC_DIMM_SLOT_PROP,

                                           NULL);

        if (nvdimm_slot_to_handle(slot) == handle) {

            nvdimm = nvd;

            break;

        }

    }

    g_slist_free(device_list);

    return nvdimm;

}


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

     phdr.p_type = cpu_convert_to_target32(PT_LOAD, endian);

+    phdr.p_offset = cpu_convert_to_target32(offset, endian);
+
+    phdr.p_paddr = cpu_convert_to_target32(memory_mapping->phys_addr, endian);
+
+    if (offset == -1) {

         /* When the memory is not stored into vmcore, offset will be -1 */

static int write_elf32_load(DumpState *s, MemoryMapping *memory_mapping,

                            int phdr_index, hwaddr offset)

{

    Elf32_Phdr phdr;

    int ret;

    int endian = s->dump_info.d_endian;

    memset(&phdr, 0, sizeof(Elf32_Phdr));

    phdr.p_type = cpu_convert_to_target32(PT_LOAD, endian);

    phdr.p_offset = cpu_convert_to_target32(offset, endian);

    phdr.p_paddr = cpu_convert_to_target32(memory_mapping->phys_addr, endian);

    if (offset == -1) {

        /* When the memory is not stored into vmcore, offset will be -1 */

        phdr.p_filesz = 0;

    } else {

        phdr.p_filesz = cpu_convert_to_target32(memory_mapping->length, endian);

    }

    phdr.p_memsz = cpu_convert_to_target32(memory_mapping->length, endian);

    phdr.p_vaddr = cpu_convert_to_target32(memory_mapping->virt_addr, endian);

    ret = fd_write_vmcore(&phdr, sizeof(Elf32_Phdr), s);

    if (ret < 0) {

        dump_error(s, "dump: failed to write program header table.\n");

        return -1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -5,10 +5,10 @@
     struct target_rt_sigframe *frame;

     abi_ulong frame_addr;
+
     sigset_t blocked;

+    target_ulong r0;

long do_rt_sigreturn(CPUSH4State *regs)

{

    struct target_rt_sigframe *frame;

    abi_ulong frame_addr;

    sigset_t blocked;

    target_ulong r0;

#if defined(DEBUG_SIGNAL)

    fprintf(stderr, "do_rt_sigreturn\n");

#endif

    frame_addr = regs->gregs[15];

    if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1))

   	goto badframe;

    target_to_host_sigset(&blocked, &frame->uc.tuc_sigmask);

    do_sigprocmask(SIG_SETMASK, &blocked, NULL);

    if (restore_sigcontext(regs, &frame->uc.tuc_mcontext, &r0))

        goto badframe;

    if (do_sigaltstack(frame_addr +

		       offsetof(struct target_rt_sigframe, uc.tuc_stack),

		       0, get_sp_from_cpustate(regs)) == -EFAULT)

        goto badframe;

    unlock_user_struct(frame, frame_addr, 0);

    return r0;

badframe:

    unlock_user_struct(frame, frame_addr, 0);

    force_sig(TARGET_SIGSEGV);

    return 0;

}


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

     env->insns_flags &= PPC_TCG_INSNS;

+    env->insns_flags2 &= PPC_TCG_INSNS2;
+
+    return 0;
+
+}

static int ppc_fixup_cpu(PowerPCCPU *cpu)

{

    CPUPPCState *env = &cpu->env;

    /* TCG doesn't (yet) emulate some groups of instructions that

     * are implemented on some otherwise supported CPUs (e.g. VSX

     * and decimal floating point instructions on POWER7).  We

     * remove unsupported instruction groups from the cpu state's

     * instruction masks and hope the guest can cope.  For at

     * least the pseries machine, the unavailability of these

     * instructions can be advertised to the guest via the device

     * tree. */

    if ((env->insns_flags & ~PPC_TCG_INSNS)

        || (env->insns_flags2 & ~PPC_TCG_INSNS2)) {

        fprintf(stderr, "Warning: Disabling some instructions which are not "

                "emulated by TCG (0x%" PRIx64 ", 0x%" PRIx64 ")\n",

                env->insns_flags & ~PPC_TCG_INSNS,

                env->insns_flags2 & ~PPC_TCG_INSNS2);

    }

    env->insns_flags &= PPC_TCG_INSNS;

    env->insns_flags2 &= PPC_TCG_INSNS2;

    return 0;

}


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

     uint32_t io_int_word = (isc << 27) | IO_INT_WORD_AI;

+
+
+    trace_css_adapter_interrupt(isc);

     s390_io_interrupt(cpu, 0, 0, 0, io_int_word);

void css_adapter_interrupt(uint8_t isc)

{

    S390CPU *cpu = s390_cpu_addr2state(0);

    uint32_t io_int_word = (isc << 27) | IO_INT_WORD_AI;

    trace_css_adapter_interrupt(isc);

    s390_io_interrupt(cpu, 0, 0, 0, io_int_word);

}


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

         if (s->regs[R_CR] & CR_STOP) {

+            ptimer_stop(s->ptimer);
+
+        }
+
+        break;

     case R_PERIOD:

static void timer_write(void *opaque, target_phys_addr_t addr,

                        uint64_t value, unsigned size)

{

    LM32TimerState *s = opaque;

    trace_lm32_timer_memory_write(addr, value);

    addr >>= 2;

    switch (addr) {

    case R_SR:

        s->regs[R_SR] &= ~SR_TO;

        break;

    case R_CR:

        s->regs[R_CR] = value;

        if (s->regs[R_CR] & CR_START) {

            ptimer_run(s->ptimer, 1);

        }

        if (s->regs[R_CR] & CR_STOP) {

            ptimer_stop(s->ptimer);

        }

        break;

    case R_PERIOD:

        s->regs[R_PERIOD] = value;

        ptimer_set_count(s->ptimer, value);

        break;

    case R_SNAPSHOT:

        error_report("lm32_timer: write access to read only register 0x"

                TARGET_FMT_plx, addr << 2);

        break;

    default:

        error_report("lm32_timer: write access to unknown register 0x"

                TARGET_FMT_plx, addr << 2);

        break;

    }

    timer_update_irq(s);

}


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

     MPADecodeContext s1, *s = &s1;

+    s1.avctx = avctx;
+
+
+
+    if (ff_mpa_check_header(head) != 0)

         return -1;

int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate)

{

    MPADecodeContext s1, *s = &s1;

    s1.avctx = avctx;

    if (ff_mpa_check_header(head) != 0)

        return -1;

    if (ff_mpegaudio_decode_header(s, head) != 0) {

        return -1;

    }

    switch(s->layer) {

    case 1:

        avctx->frame_size = 384;

        break;

    case 2:

        avctx->frame_size = 1152;

        break;

    default:

    case 3:

        if (s->lsf)

            avctx->frame_size = 576;

        else

            avctx->frame_size = 1152;

        break;

    }

    *sample_rate = s->sample_rate;

    avctx->channels = s->nb_channels;

    avctx->bit_rate = s->bit_rate;

    avctx->sub_id = s->layer;

    return s->frame_size;

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
         | (!!conf.buffer_size_in_overridden << 1);

+
+    if (alsa_open (1, &req, &obt, &handle)) {
+
+        return -1;
+
     }

static int alsa_init_in (HWVoiceIn *hw, audsettings_t *as)

{

    ALSAVoiceIn *alsa = (ALSAVoiceIn *) hw;

    struct alsa_params_req req;

    struct alsa_params_obt obt;

    snd_pcm_t *handle;

    audsettings_t obt_as;

    req.fmt = aud_to_alsafmt (as->fmt);

    req.freq = as->freq;

    req.nchannels = as->nchannels;

    req.period_size = conf.period_size_in;

    req.buffer_size = conf.buffer_size_in;

    req.size_in_usec = conf.size_in_usec_in;

    req.override_mask = !!conf.period_size_in_overridden

        | (!!conf.buffer_size_in_overridden << 1);

    if (alsa_open (1, &req, &obt, &handle)) {

        return -1;

    }

    obt_as.freq = obt.freq;

    obt_as.nchannels = obt.nchannels;

    obt_as.fmt = obt.fmt;

    obt_as.endianness = obt.endianness;

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

    hw->samples = obt.samples;

    alsa->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift);

    if (!alsa->pcm_buf) {

        dolog ("Could not allocate ADC buffer (%d samples, each %d bytes)\n",

               hw->samples, 1 << hw->info.shift);

        alsa_anal_close (&handle);

        return -1;

    }

    alsa->handle = handle;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     __org_qemu_x_Union1 *ret = g_new0(__org_qemu_x_Union1, 1);

+
+    ret->kind = ORG_QEMU_X_UNION1_KIND___ORG_QEMU_X_BRANCH;
+
+    ret->__org_qemu_x_branch = strdup("blah1");
+

     return ret;

__org_qemu_x_Union1 *qmp___org_qemu_x_command(__org_qemu_x_EnumList *a,

                                              __org_qemu_x_StructList *b,

                                              __org_qemu_x_Union2 *c,

                                              __org_qemu_x_Alt *d,

                                              Error **errp)

{

    __org_qemu_x_Union1 *ret = g_new0(__org_qemu_x_Union1, 1);

    ret->kind = ORG_QEMU_X_UNION1_KIND___ORG_QEMU_X_BRANCH;

    ret->__org_qemu_x_branch = strdup("blah1");

    return ret;

}


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

     int j;

+

     if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {

AVRational ff_choose_timebase(AVFormatContext *s, AVStream *st, int min_precission)

{

    AVRational q;

    int j;

    if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {

        q = (AVRational){1, st->codec->sample_rate};

    } else {

        q = st->codec->time_base;

    }

    for (j=2; j<2000; j+= 1+(j>2))

        while (q.den / q.num < min_precission && q.num % j == 0)

            q.num /= j;

    while (q.den / q.num < min_precission && q.den < (1<<24))

        q.den <<= 1;

    return q;

}


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

+    /* XXX: suppress this malloc */
+
+    buf1= (uint8_t*) av_malloc( size * sizeof(uint8_t) );
+
+

     write_packet_header(s, stream, size, stream->enc->coded_frame->key_frame);

static int rm_write_audio(AVFormatContext *s, const uint8_t *buf, int size)

{

    uint8_t *buf1;

    RMContext *rm = s->priv_data;

    ByteIOContext *pb = &s->pb;

    StreamInfo *stream = rm->audio_stream;

    int i;

    /* XXX: suppress this malloc */

    buf1= (uint8_t*) av_malloc( size * sizeof(uint8_t) );

    write_packet_header(s, stream, size, stream->enc->coded_frame->key_frame);

    /* for AC3, the words seems to be reversed */

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

        buf1[i] = buf[i+1];

        buf1[i+1] = buf[i];

    }

    put_buffer(pb, buf1, size);

    put_flush_packet(pb);

    stream->nb_frames++;

    av_free(buf1);

    return 0;

}


static void gdb_chr_receive(void *opaque, const uint8_t *buf, int size)

{

    GDBState *s = opaque;

    int i;

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

        gdb_read_byte(s, buf[i]);

    }

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     DB_PRINT("realized spips\n");

+
+    s->spi = g_new(SSIBus *, s->num_busses);
+
+    for (i = 0; i < s->num_busses; ++i) {
+
         char bus_name[16];

         snprintf(bus_name, 16, "spi%d", i);

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

{

    XilinxSPIPS *s = XILINX_SPIPS(dev);

    SysBusDevice *sbd = SYS_BUS_DEVICE(dev);

    XilinxSPIPSClass *xsc = XILINX_SPIPS_GET_CLASS(s);

    int i;

    DB_PRINT("realized spips\n");

    s->spi = g_new(SSIBus *, s->num_busses);

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

        char bus_name[16];

        snprintf(bus_name, 16, "spi%d", i);

        s->spi[i] = ssi_create_bus(dev, bus_name);

    }

    s->cs_lines = g_new0(qemu_irq, s->num_cs * s->num_busses);

    ssi_auto_connect_slaves(DEVICE(s), s->cs_lines, s->spi[0]);

    ssi_auto_connect_slaves(DEVICE(s), s->cs_lines, s->spi[1]);

    sysbus_init_irq(sbd, &s->irq);

    for (i = 0; i < s->num_cs * s->num_busses; ++i) {

        sysbus_init_irq(sbd, &s->cs_lines[i]);

    }

    memory_region_init_io(&s->iomem, &spips_ops, s, "spi", R_MAX*4);

    sysbus_init_mmio(sbd, &s->iomem);

    s->irqline = -1;

    fifo8_create(&s->rx_fifo, xsc->rx_fifo_size);

    fifo8_create(&s->tx_fifo, xsc->tx_fifo_size);

}


static int probe(AVProbeData *p)

{

    if (p->buf_size < 13)

        return 0;

    if (p->buf[0] == 0x01 && p->buf[1] == 0x00 &&

        p->buf[4] == 0x01 + p->buf[2] &&

        p->buf[8] == p->buf[4] + p->buf[6] &&

        p->buf[12] == p->buf[8] + p->buf[10])

        return AVPROBE_SCORE_MAX;

    return 0;

}


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

         return 1;

+    }
+
+    tb = tb_find_pc(pc);
+
+    if (tb) {

         /* the PC is inside the translated code. It means that we have

static inline int handle_cpu_signal(unsigned long pc, unsigned long address,

                                    int is_write, sigset_t *old_set)

{

    TranslationBlock *tb;

    int ret;

    uint32_t found_pc;

#if defined(DEBUG_SIGNAL)

    printf("qemu: SIGSEGV pc=0x%08lx address=%08lx wr=%d oldset=0x%08lx\n",

           pc, address, is_write, *(unsigned long *)old_set);

#endif

    /* XXX: locking issue */

    if (is_write && page_unprotect(address)) {

        return 1;

    }

    tb = tb_find_pc(pc);

    if (tb) {

        /* the PC is inside the translated code. It means that we have

           a virtual CPU fault */

        ret = cpu_x86_search_pc(tb, &found_pc, pc);

        if (ret < 0)

            return 0;

        env->eip = found_pc - tb->cs_base;

        env->cr2 = address;

        /* we restore the process signal mask as the sigreturn should

           do it (XXX: use sigsetjmp) */

        sigprocmask(SIG_SETMASK, old_set, NULL);

        raise_exception_err(EXCP0E_PAGE, 4 | (is_write << 1));

        /* never comes here */

        return 1;

    } else {

        return 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
      * which are in an 'UNUSABLE' allocation state. (PAPR 2.7,

      * 13.5.3.5)
+
+     */
+
+    if (!drc->dev ||
+
         drc->allocation_state == SPAPR_DR_ALLOCATION_STATE_UNUSABLE) {

         return RTAS_OUT_NO_SUCH_INDICATOR;

static uint32_t drc_unisolate_logical(sPAPRDRConnector *drc)

{

    /* cannot unisolate a non-existent resource, and, or resources

     * which are in an 'UNUSABLE' allocation state. (PAPR 2.7,

     * 13.5.3.5)

     */

    if (!drc->dev ||

        drc->allocation_state == SPAPR_DR_ALLOCATION_STATE_UNUSABLE) {

        return RTAS_OUT_NO_SUCH_INDICATOR;

    }

    drc->isolation_state = SPAPR_DR_ISOLATION_STATE_UNISOLATED;

    return RTAS_OUT_SUCCESS;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void push_output_configuration(AACContext *ac) {

     if (ac->oc[1].status == OC_LOCKED || ac->oc[0].status == OC_NONE) {

static void push_output_configuration(AACContext *ac) {

    if (ac->oc[1].status == OC_LOCKED || ac->oc[0].status == OC_NONE) {

        ac->oc[0] = ac->oc[1];

    }

    ac->oc[1].status = OC_NONE;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void vmxnet3_update_pm_state(VMXNET3State *s)

+{
+
+    struct Vmxnet3_VariableLenConfDesc pm_descr;

static void vmxnet3_update_pm_state(VMXNET3State *s)

{

    struct Vmxnet3_VariableLenConfDesc pm_descr;

    pm_descr.confLen =

        VMXNET3_READ_DRV_SHARED32(s->drv_shmem, devRead.pmConfDesc.confLen);

    pm_descr.confVer =

        VMXNET3_READ_DRV_SHARED32(s->drv_shmem, devRead.pmConfDesc.confVer);

    pm_descr.confPA =

        VMXNET3_READ_DRV_SHARED64(s->drv_shmem, devRead.pmConfDesc.confPA);

    vmxnet3_dump_conf_descr("PM State", &pm_descr);

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
                               AVFormatContext *s)

 {
+
+    offset_t pos = url_ftell(pb);
+
+    int i;
+

     put_be32(pb, 0); /* size */

static int mov_write_udta_tag(ByteIOContext *pb, MOVContext* mov,

                              AVFormatContext *s)

{

    offset_t pos = url_ftell(pb);

    int i;

    put_be32(pb, 0); /* size */

    put_tag(pb, "udta");

    /* iTunes meta data */

    mov_write_meta_tag(pb, mov, s);

  if(mov->mode == MODE_MOV){ // the title field breaks gtkpod with mp4 and my suspicion is that stuff isnt valid in mp4

    /* Requirements */

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

        if(mov->tracks[i].entry <= 0) continue;

        if (mov->tracks[i].enc->codec_id == CODEC_ID_AAC ||

            mov->tracks[i].enc->codec_id == CODEC_ID_MPEG4) {

            mov_write_string_tag(pb, "\251req", "QuickTime 6.0 or greater", 0);

            break;

        }

    }

    mov_write_string_tag(pb, "\251nam", s->title         , 0);

    mov_write_string_tag(pb, "\251aut", s->author        , 0);

    mov_write_string_tag(pb, "\251alb", s->album         , 0);

    mov_write_day_tag(pb, s->year, 0);

    if(mov->tracks[0].enc && !(mov->tracks[0].enc->flags & CODEC_FLAG_BITEXACT))

        mov_write_string_tag(pb, "\251enc", LIBAVFORMAT_IDENT, 0);

    mov_write_string_tag(pb, "\251des", s->comment       , 0);

    mov_write_string_tag(pb, "\251gen", s->genre         , 0);

  }

    return updateSize(pb, pos);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void ff_aac_coder_init_mips(AACEncContext *c) {
+
 #if HAVE_INLINE_ASM

     AACCoefficientsEncoder *e = c->coder;

void ff_aac_coder_init_mips(AACEncContext *c) {

#if HAVE_INLINE_ASM

    AACCoefficientsEncoder *e = c->coder;

    int option = c->options.aac_coder;

    if (option == 2) {

        e->quantize_and_encode_band = quantize_and_encode_band_mips;

        e->encode_window_bands_info = codebook_trellis_rate;

#if HAVE_MIPSFPU

        e->search_for_quantizers    = search_for_quantizers_twoloop;

#endif /* HAVE_MIPSFPU */

    }

#if HAVE_MIPSFPU

    e->search_for_ms            = search_for_ms_mips;

#endif /* HAVE_MIPSFPU */

#endif /* HAVE_INLINE_ASM */

}


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

+
+
+read_end:
+
+    return realsize;

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

{

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

    size_t realsize = size * nmemb;

    int i;

    DPRINTF("CURL: Just reading %zd bytes\n", realsize);

    if (!s || !s->orig_buf)

        goto read_end;

    memcpy(s->orig_buf + s->buf_off, ptr, realsize);

    s->buf_off += realsize;

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

        CURLAIOCB *acb = s->acb[i];

        if (!acb)

            continue;

        if ((s->buf_off >= acb->end)) {

            qemu_iovec_from_buf(acb->qiov, 0, s->orig_buf + acb->start,

                                acb->end - acb->start);

            acb->common.cb(acb->common.opaque, 0);

            qemu_aio_release(acb);

            s->acb[i] = NULL;

read_end:

    return realsize;


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void core_begin(MemoryListener *listener)

 {
+
+    destroy_all_mappings();
+
+    phys_sections_clear();

     phys_map.ptr = PHYS_MAP_NODE_NIL;

static void core_begin(MemoryListener *listener)

{

    destroy_all_mappings();

    phys_sections_clear();

    phys_map.ptr = PHYS_MAP_NODE_NIL;

    phys_section_unassigned = dummy_section(&io_mem_unassigned);

    phys_section_notdirty = dummy_section(&io_mem_notdirty);

    phys_section_rom = dummy_section(&io_mem_rom);

    phys_section_watch = dummy_section(&io_mem_watch);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 bool qpci_msix_pending(QPCIDevice *dev, uint16_t entry)

 {
+
     uint32_t pba_entry;
+
+    uint8_t bit_n = entry % 32;

     void *addr = dev->msix_pba + (entry / 32) * PCI_MSIX_ENTRY_SIZE / 4;

bool qpci_msix_pending(QPCIDevice *dev, uint16_t entry)

{

    uint32_t pba_entry;

    uint8_t bit_n = entry % 32;

    void *addr = dev->msix_pba + (entry / 32) * PCI_MSIX_ENTRY_SIZE / 4;

    g_assert(dev->msix_enabled);

    pba_entry = qpci_io_readl(dev, addr);

    qpci_io_writel(dev, addr, pba_entry & ~(1 << bit_n));

    return (pba_entry & (1 << bit_n)) != 0;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     ObjectProperty *prop = object_property_find(parent, part, NULL);

     if (prop == NULL) {
+
+        return NULL;
+
+    }
+

     if (object_property_is_link(prop)) {

Object *object_resolve_path_component(Object *parent, const gchar *part)

{

    ObjectProperty *prop = object_property_find(parent, part, NULL);

    if (prop == NULL) {

        return NULL;

    }

    if (object_property_is_link(prop)) {

        LinkProperty *lprop = prop->opaque;

        return *lprop->child;

    } else if (object_property_is_child(prop)) {

        return prop->opaque;

    } else {

        return NULL;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static inline bool use_goto_tb(DisasContext *s, int n, uint64_t dest)
+
 {

     /* No direct tb linking with singlestep (either QEMU's or the ARM

static inline bool use_goto_tb(DisasContext *s, int n, uint64_t dest)

{

    /* No direct tb linking with singlestep (either QEMU's or the ARM

     * debug architecture kind) or deterministic io

     */

    if (s->base.singlestep_enabled || s->ss_active || (s->base.tb->cflags & CF_LAST_IO)) {

        return false;

    }

#ifndef CONFIG_USER_ONLY

    /* Only link tbs from inside the same guest page */

    if ((s->base.tb->pc & TARGET_PAGE_MASK) != (dest & TARGET_PAGE_MASK)) {

        return false;

    }

#endif

    return true;

}


--- a/source.c
+++ b/source.c
@@ -5,12 +5,12 @@
     DWTELEM *b0= cs->b0;

     DWTELEM *b1= cs->b1;
+
+    DWTELEM *b2= buffer + mirror(y+1, height-1)*stride;

     DWTELEM *b3= buffer + mirror(y+2, height-1)*stride;
+
+

 {START_TIMER

static void spatial_compose53i_dy(dwt_compose_t *cs, DWTELEM *buffer, int width, int height, int stride){

    int y= cs->y;

    DWTELEM *b0= cs->b0;

    DWTELEM *b1= cs->b1;

    DWTELEM *b2= buffer + mirror(y+1, height-1)*stride;

    DWTELEM *b3= buffer + mirror(y+2, height-1)*stride;

{START_TIMER

        if(b1 <= b3) vertical_compose53iL0(b1, b2, b3, width);

        if(b0 <= b2) vertical_compose53iH0(b0, b1, b2, width);

STOP_TIMER("vertical_compose53i*")}

{START_TIMER

        if(y-1 >= 0) horizontal_compose53i(b0, width);

        if(b0 <= b2) horizontal_compose53i(b1, width);

STOP_TIMER("horizontal_compose53i")}

    cs->b0 = b2;

    cs->b1 = b3;

    cs->y += 2;

}


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

     errno = ENOTSUP;
+
+    return -1;

 }

static int v9fs_synth_lremovexattr(FsContext *ctx,

                                   V9fsPath *path, const char *name)

{

    errno = ENOTSUP;

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     const char *arch = qtest_get_arch();

     QDict *response, *minfo;
+
     QList *list;

     const QListEntry *p;
@@ -20,7 +20,7 @@

     qtest_start("-machine none");

+    response = qmp("{ 'execute': 'query-machines' }");

     g_assert(response);

static void add_machine_test_cases(void)

{

    const char *arch = qtest_get_arch();

    QDict *response, *minfo;

    QList *list;

    const QListEntry *p;

    QObject *qobj;

    QString *qstr;

    const char *mname, *path;

    qtest_start("-machine none");

    response = qmp("{ 'execute': 'query-machines' }");

    g_assert(response);

    list = qdict_get_qlist(response, "return");

    g_assert(list);

    for (p = qlist_first(list); p; p = qlist_next(p)) {

        minfo = qobject_to_qdict(qlist_entry_obj(p));

        g_assert(minfo);

        qobj = qdict_get(minfo, "name");

        g_assert(qobj);

        qstr = qobject_to_qstring(qobj);

        g_assert(qstr);

        mname = qstring_get_str(qstr);

        if (!is_blacklisted(arch, mname)) {

            path = g_strdup_printf("qom/%s", mname);

            qtest_add_data_func(path, g_strdup(mname), test_machine);

        }

    }

    qtest_end();

    QDECREF(response);

}


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

 {

+    if (object_dynamic_cast(OBJECT(session->creds),

                             TYPE_QCRYPTO_TLS_CREDS_ANON)) {

qcrypto_tls_session_check_credentials(QCryptoTLSSession *session,

                                      Error **errp)

{

    if (object_dynamic_cast(OBJECT(session->creds),

                            TYPE_QCRYPTO_TLS_CREDS_ANON)) {

        return 0;

    } else if (object_dynamic_cast(OBJECT(session->creds),

                            TYPE_QCRYPTO_TLS_CREDS_X509)) {

        if (session->creds->verifyPeer) {

            return qcrypto_tls_session_check_certificate(session,

                                                         errp);

        } else {

            return 0;

        }

    } else {

        error_setg(errp, "Unexpected credential type %s",

                   object_get_typename(OBJECT(session->creds)));

        return -1;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static bool gen_rsr_ccount(DisasContext *dc, TCGv_i32 d, uint32_t sr)
+
 {

     if (dc->tb->cflags & CF_USE_ICOUNT) {

static bool gen_rsr_ccount(DisasContext *dc, TCGv_i32 d, uint32_t sr)

{

    if (dc->tb->cflags & CF_USE_ICOUNT) {

        gen_io_start();

    }

    gen_helper_update_ccount(cpu_env);

    tcg_gen_mov_i32(d, cpu_SR[sr]);

    if (dc->tb->cflags & CF_USE_ICOUNT) {

        gen_io_end();

        return true;

    }

    return false;

}


static void ff_h264_idct_dc_add_mmx2(uint8_t *dst, int16_t *block, int stride)

{

    int dc = (block[0] + 32) >> 6;

    __asm__ volatile(

        "movd          %0, %%mm0 \n\t"

        "pshufw $0, %%mm0, %%mm0 \n\t"

        "pxor       %%mm1, %%mm1 \n\t"

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

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

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

        ::"r"(dc)

    );

    __asm__ volatile(

        "movd          %0, %%mm2 \n\t"

        "movd          %1, %%mm3 \n\t"

        "movd          %2, %%mm4 \n\t"

        "movd          %3, %%mm5 \n\t"

        "paddusb    %%mm0, %%mm2 \n\t"

        "paddusb    %%mm0, %%mm3 \n\t"

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

        "paddusb    %%mm0, %%mm5 \n\t"

        "psubusb    %%mm1, %%mm2 \n\t"

        "psubusb    %%mm1, %%mm3 \n\t"

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

        "psubusb    %%mm1, %%mm5 \n\t"

        "movd       %%mm2, %0    \n\t"

        "movd       %%mm3, %1    \n\t"

        "movd       %%mm4, %2    \n\t"

        "movd       %%mm5, %3    \n\t"

        :"+m"(*(uint32_t*)(dst+0*stride)),

         "+m"(*(uint32_t*)(dst+1*stride)),

         "+m"(*(uint32_t*)(dst+2*stride)),

         "+m"(*(uint32_t*)(dst+3*stride))

    );

}


--- a/source.c
+++ b/source.c
@@ -51,11 +51,11 @@
             monitor_printf(mon, "Start migration for %s with shared base "

                                 "image\n",
+
+                           bs->device_name);
+
+        } else {
+
             monitor_printf(mon, "Start full migration for %s\n",

                            bs->device_name);

static void init_blk_migration_it(void *opaque, BlockDriverState *bs)

{

    Monitor *mon = opaque;

    BlkMigDevState *bmds;

    int64_t sectors;

    if (!bdrv_is_read_only(bs)) {

        sectors = bdrv_getlength(bs) >> BDRV_SECTOR_BITS;

        if (sectors <= 0) {

            return;

        }

        bmds = g_malloc0(sizeof(BlkMigDevState));

        bmds->bs = bs;

        bmds->bulk_completed = 0;

        bmds->total_sectors = sectors;

        bmds->completed_sectors = 0;

        bmds->shared_base = block_mig_state.shared_base;

        alloc_aio_bitmap(bmds);

        drive_get_ref(drive_get_by_blockdev(bs));

        bdrv_set_in_use(bs, 1);

        block_mig_state.total_sector_sum += sectors;

        if (bmds->shared_base) {

            monitor_printf(mon, "Start migration for %s with shared base "

                                "image\n",

                           bs->device_name);

        } else {

            monitor_printf(mon, "Start full migration for %s\n",

                           bs->device_name);

        }

        QSIMPLEQ_INSERT_TAIL(&block_mig_state.bmds_list, bmds, entry);

    }

}


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

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

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

 }

void bios_linker_loader_add_pointer(GArray *linker,

                                    const char *dest_file,

                                    const char *src_file,

                                    GArray *table, void *pointer,

                                    uint8_t pointer_size)

{

    BiosLinkerLoaderEntry entry;

    memset(&entry, 0, sizeof entry);

    strncpy(entry.pointer.dest_file, dest_file,

            sizeof entry.pointer.dest_file - 1);

    strncpy(entry.pointer.src_file, src_file,

            sizeof entry.pointer.src_file - 1);

    entry.command = cpu_to_le32(BIOS_LINKER_LOADER_COMMAND_ADD_POINTER);

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

    entry.pointer.size = pointer_size;

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

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

    g_array_append_val(linker, entry);

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     assert(ts);

     if (idx < s->nb_globals) {
+
+        pstrcpy(buf, buf_size, ts->name);
+
+    } else {
+
         if (ts->temp_local)

             snprintf(buf, buf_size, "loc%d", idx - s->nb_globals);

static char *tcg_get_arg_str_idx(TCGContext *s, char *buf, int buf_size,

                                 int idx)

{

    TCGTemp *ts;

    assert(idx >= 0 && idx < s->nb_temps);

    ts = &s->temps[idx];

    assert(ts);

    if (idx < s->nb_globals) {

        pstrcpy(buf, buf_size, ts->name);

    } else {

        if (ts->temp_local)

            snprintf(buf, buf_size, "loc%d", idx - s->nb_globals);

        else

            snprintf(buf, buf_size, "tmp%d", idx - s->nb_globals);

    }

    return buf;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int load_refcount_block(BlockDriverState *bs,
+
+                               int64_t refcount_block_offset,
+
+                               void **refcount_block)
+
 {

     BDRVQcow2State *s = bs->opaque;

static int load_refcount_block(BlockDriverState *bs,

                               int64_t refcount_block_offset,

                               void **refcount_block)

{

    BDRVQcow2State *s = bs->opaque;

    int ret;

    BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_LOAD);

    ret = qcow2_cache_get(bs, s->refcount_block_cache, refcount_block_offset,

        refcount_block);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 void helper_ldl_raw(uint64_t t0, uint64_t t1)

 {
+
     ldl_raw(t1, t0);

 }

void helper_ldl_raw(uint64_t t0, uint64_t t1)

{

    ldl_raw(t1, t0);

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
         return wrid_desc[RDMA_WRID_RECV_CONTROL];

     }
+
+    return wrid_desc[wrid];
+
 }

const char *print_wrid(int wrid)

{

    if (wrid >= RDMA_WRID_RECV_CONTROL) {

        return wrid_desc[RDMA_WRID_RECV_CONTROL];

    }

    return wrid_desc[wrid];

}


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

 {

+    int64_t overlap_offset = req->offset & ~(align - 1);
+
+    unsigned int overlap_bytes = ROUND_UP(req->offset + req->bytes, align)
+
+                               - overlap_offset;

static void mark_request_serialising(BdrvTrackedRequest *req, uint64_t align)

{

    int64_t overlap_offset = req->offset & ~(align - 1);

    unsigned int overlap_bytes = ROUND_UP(req->offset + req->bytes, align)

                               - overlap_offset;

    if (!req->serialising) {

        req->bs->serialising_in_flight++;

        req->serialising = true;

    }

    req->overlap_offset = MIN(req->overlap_offset, overlap_offset);

    req->overlap_bytes = MAX(req->overlap_bytes, overlap_bytes);

}


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

 {

+    AVFilterLink *out = NULL;

void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref)

{

    AVFilterLink *out = NULL;

    if(link->dst->output_count)

        out = link->dst->outputs[0];

    if(out) {

        out->outpic      = avfilter_get_video_buffer(out, AV_PERM_WRITE, link->w, link->h);

        out->outpic->pts = picref->pts;

        avfilter_start_frame(out, avfilter_ref_pic(out->outpic, ~0));

    }

}


static inline int onenand_prog_spare(OneNANDState *s, int sec, int secn,

                void *src)

{

    int result = 0;

    if (secn > 0) {

        const uint8_t *sp = (const uint8_t *)src;

        uint8_t *dp = 0, *dpp = 0;

        if (s->blk_cur) {

            dp = g_malloc(512);

            if (!dp

                || blk_read(s->blk_cur, s->secs_cur + (sec >> 5), dp, 1) < 0) {

                result = 1;

            } else {

                dpp = dp + ((sec & 31) << 4);

            }

        } else {

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

                result = 1;

            } else {

                dpp = s->current + (s->secs_cur << 9) + (sec << 4);

            }

        }

        if (!result) {

            uint32_t i;

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

                dpp[i] &= sp[i];

            }

            if (s->blk_cur) {

                result = blk_write(s->blk_cur, s->secs_cur + (sec >> 5),

                                   dp, 1) < 0;

            }

        }

        g_free(dp);

    }

    return result;

}


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

             return NULL;

+
+
         c->phase_shift   = phase_shift;

         c->phase_mask    = phase_count - 1;

AVResampleContext *swr_resample_init(AVResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff){

    double factor= FFMIN(out_rate * cutoff / in_rate, 1.0);

    int phase_count= 1<<phase_shift;

    if (!c || c->phase_shift != phase_shift || c->linear!=linear || c->factor != factor

           || c->filter_length != FFMAX((int)ceil(filter_size/factor), 1)) {

        c = av_mallocz(sizeof(AVResampleContext));

        if (!c)

            return NULL;

        c->phase_shift   = phase_shift;

        c->phase_mask    = phase_count - 1;

        c->linear        = linear;

        c->factor        = factor;

        c->filter_length = FFMAX((int)ceil(filter_size/factor), 1);

        c->filter_bank   = av_mallocz(c->filter_length*(phase_count+1)*sizeof(FELEM));

        if (!c->filter_bank)

            goto error;

        if (build_filter(c->filter_bank, factor, c->filter_length, phase_count, 1<<FILTER_SHIFT, WINDOW_TYPE))

            goto error;

        memcpy(&c->filter_bank[c->filter_length*phase_count+1], c->filter_bank, (c->filter_length-1)*sizeof(FELEM));

        c->filter_bank[c->filter_length*phase_count]= c->filter_bank[c->filter_length - 1];

    }

    c->compensation_distance= 0;

    c->src_incr= out_rate;

    c->ideal_dst_incr= c->dst_incr= in_rate * phase_count;

    c->index= -phase_count*((c->filter_length-1)/2);

    c->frac= 0;

    return c;

error:

    av_free(c->filter_bank);

    av_free(c);

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -17,9 +17,9 @@
     ptr = __coverity_alloc__(size);

     __coverity_mark_as_uninitialized_buffer__(ptr);
+
+    __coverity_mark_as_afm_allocated__(ptr, AFM_free);
+
+    return ptr;
+
 }

void *g_malloc_n(size_t nmemb, size_t size)

{

    size_t sz;

    void *ptr;

    __coverity_negative_sink__(nmemb);

    __coverity_negative_sink__(size);

    sz = nmemb * size;

    ptr = __coverity_alloc__(size);

    __coverity_mark_as_uninitialized_buffer__(ptr);

    __coverity_mark_as_afm_allocated__(ptr, AFM_free);

    return ptr;

}


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

 	cris_alu(dc, CC_OP_MOVE,

+		    cpu_R[dc->op2], cpu_R[dc->op1], t0, 4);
+
+	tcg_temp_free(t0);
+
+	return 2;

 }

static unsigned int dec_movs_r(DisasContext *dc)

{

	TCGv t0;

	int size = memsize_z(dc);

	DIS(fprintf (logfile, "movs.%c $r%u, $r%u\n",

		    memsize_char(size),

		    dc->op1, dc->op2));

	cris_cc_mask(dc, CC_MASK_NZ);

	t0 = tcg_temp_new(TCG_TYPE_TL);

	/* Size can only be qi or hi.  */

	t_gen_sext(t0, cpu_R[dc->op1], size);

	cris_alu(dc, CC_OP_MOVE,

		    cpu_R[dc->op2], cpu_R[dc->op1], t0, 4);

	tcg_temp_free(t0);

	return 2;

}


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

+    /* streaminfo metadata block */
+
+    put_bits(&pb, 16, s->avctx->frame_size);
+
+    put_bits(&pb, 16, s->avctx->frame_size);

     put_bits(&pb, 24, 0);

static void write_streaminfo(FlacEncodeContext *s, uint8_t *header)

{

    PutBitContext pb;

    memset(header, 0, FLAC_STREAMINFO_SIZE);

    init_put_bits(&pb, header, FLAC_STREAMINFO_SIZE);

    /* streaminfo metadata block */

    put_bits(&pb, 16, s->avctx->frame_size);

    put_bits(&pb, 16, s->avctx->frame_size);

    put_bits(&pb, 24, 0);

    put_bits(&pb, 24, s->max_framesize);

    put_bits(&pb, 20, s->samplerate);

    put_bits(&pb, 3, s->channels-1);

    put_bits(&pb, 5, 15);       /* bits per sample - 1 */

    /* write 36-bit sample count in 2 put_bits() calls */

    put_bits(&pb, 24, (s->sample_count & 0xFFFFFF000LL) >> 12);

    put_bits(&pb, 12,  s->sample_count & 0x000000FFFLL);

    flush_put_bits(&pb);

    /* MD5 signature = 0 */

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void usage(const char *cmd)
+
 {

     printf(

static void usage(const char *cmd)

{

    printf(

"Usage: %s [-m <method> -p <path>] [<options>]\n"

"QEMU Guest Agent %s\n"

"\n"

"  -m, --method      transport method: one of unix-listen, virtio-serial, or\n"

"                    isa-serial (virtio-serial is the default)\n"

"  -p, --path        device/socket path (the default for virtio-serial is:\n"

"                    %s)\n"

"  -l, --logfile     set logfile path, logs to stderr by default\n"

"  -f, --pidfile     specify pidfile (default is %s)\n"

"  -v, --verbose     log extra debugging information\n"

"  -V, --version     print version information and exit\n"

"  -d, --daemonize   become a daemon\n"

#ifdef _WIN32

"  -s, --service     service commands: install, uninstall\n"

#endif

"  -b, --blacklist   comma-separated list of RPCs to disable (no spaces, \"?\"\n"

"                    to list available RPCs)\n"

"  -h, --help        display this help and exit\n"

"\n"

"Report bugs to <mdroth@linux.vnet.ibm.com>\n"

    , cmd, QGA_VERSION, QGA_VIRTIO_PATH_DEFAULT, QGA_PIDFILE_DEFAULT);

}


static int dv_extract_audio(uint8_t* frame, uint8_t* ppcm[4],
                            const DVprofile *sys)
{
    int size, chan, i, j, d, of, smpls, freq, quant, half_ch;
    uint16_t lc, rc;
    const uint8_t* as_pack;
    uint8_t *pcm, ipcm;
    as_pack = dv_extract_pack(frame, dv_audio_source);
    if (!as_pack)    /* No audio ? */
        return 0;
    smpls =  as_pack[1] & 0x3f;       /* samples in this frame - min. samples */
    freq  = (as_pack[4] >> 3) & 0x07; /* 0 - 48kHz, 1 - 44,1kHz, 2 - 32kHz */
    quant =  as_pack[4] & 0x07;       /* 0 - 16bit linear, 1 - 12bit nonlinear */
    if (quant > 1)
        return -1; /* unsupported quantization */
    if (freq >= FF_ARRAY_ELEMS(dv_audio_frequency))
    size = (sys->audio_min_samples[freq] + smpls) * 4; /* 2ch, 2bytes */
    half_ch = sys->difseg_size / 2;
    /* We work with 720p frames split in half, thus even frames have
     * channels 0,1 and odd 2,3. */
    ipcm = (sys->height == 720 && !(frame[1] & 0x0C)) ? 2 : 0;
    /* for each DIF channel */
    for (chan = 0; chan < sys->n_difchan; chan++) {
        av_assert0(ipcm<4);
        pcm = ppcm[ipcm++];
        if (!pcm)
            break;
        /* for each DIF segment */
        for (i = 0; i < sys->difseg_size; i++) {
            frame += 6 * 80; /* skip DIF segment header */
            if (quant == 1 && i == half_ch) {
                /* next stereo channel (12bit mode only) */
                av_assert0(ipcm<4);
                pcm = ppcm[ipcm++];
                if (!pcm)
                    break;
            /* for each AV sequence */
            for (j = 0; j < 9; j++) {
                for (d = 8; d < 80; d += 2) {
                    if (quant == 0) {  /* 16bit quantization */
                        of = sys->audio_shuffle[i][j] + (d - 8) / 2 * sys->audio_stride;
                        if (of*2 >= size)
                            continue;
                        pcm[of*2]   = frame[d+1]; // FIXME: maybe we have to admit
                        pcm[of*2+1] = frame[d];   //        that DV is a big-endian PCM
                        if (pcm[of*2+1] == 0x80 && pcm[of*2] == 0x00)
                            pcm[of*2+1] = 0;
                    } else {           /* 12bit quantization */
                        lc = ((uint16_t)frame[d]   << 4) |
                             ((uint16_t)frame[d+2] >> 4);
                        rc = ((uint16_t)frame[d+1] << 4) |
                             ((uint16_t)frame[d+2] & 0x0f);
                        lc = (lc == 0x800 ? 0 : dv_audio_12to16(lc));
                        rc = (rc == 0x800 ? 0 : dv_audio_12to16(rc));
                        of = sys->audio_shuffle[i%half_ch][j] + (d - 8) / 3 * sys->audio_stride;
                        if (of*2 >= size)
                            continue;
                        pcm[of*2]   = lc & 0xff; // FIXME: maybe we have to admit
                        pcm[of*2+1] = lc >> 8;   //        that DV is a big-endian PCM
                        of = sys->audio_shuffle[i%half_ch+half_ch][j] +
                            (d - 8) / 3 * sys->audio_stride;
                        pcm[of*2]   = rc & 0xff; // FIXME: maybe we have to admit
                        pcm[of*2+1] = rc >> 8;   //        that DV is a big-endian PCM
                        ++d;
                frame += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */
    return size;


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

     int frame_number;

+    double ti1, bitrate, avg_bitrate;

static void do_video_stats(OutputStream *ost, int frame_size)

{

    AVCodecContext *enc;

    int frame_number;

    double ti1, bitrate, avg_bitrate;

    /* this is executed just the first time do_video_stats is called */

    if (!vstats_file) {

        vstats_file = fopen(vstats_filename, "w");

        if (!vstats_file) {

            perror("fopen");

            exit(1);

        }

    }

    enc = ost->st->codec;

    if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {

        frame_number = ost->frame_number;

        fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality / (float)FF_QP2LAMBDA);

        if (enc->flags&CODEC_FLAG_PSNR)

            fprintf(vstats_file, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0] / (enc->width * enc->height * 255.0 * 255.0)));

        fprintf(vstats_file,"f_size= %6d ", frame_size);

        /* compute pts value */

        ti1 = ost->sync_opts * av_q2d(enc->time_base);

        if (ti1 < 0.01)

            ti1 = 0.01;

        bitrate     = (frame_size * 8) / av_q2d(enc->time_base) / 1000.0;

        avg_bitrate = (double)(video_size * 8) / ti1 / 1000.0;

        fprintf(vstats_file, "s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s ",

               (double)video_size / 1024, ti1, bitrate, avg_bitrate);

        fprintf(vstats_file, "type= %c\n", av_get_picture_type_char(enc->coded_frame->pict_type));

    }

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     ARMCPU *cpu = opaque;

     CPUARMState *env = &cpu->env;
+
+
+
     return arm_feature(env, ARM_FEATURE_PMSA) &&

            arm_feature(env, ARM_FEATURE_V7);

static bool pmsav7_needed(void *opaque)

{

    ARMCPU *cpu = opaque;

    CPUARMState *env = &cpu->env;

    return arm_feature(env, ARM_FEATURE_PMSA) &&

           arm_feature(env, ARM_FEATURE_V7);

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
         qemu_co_queue_wait(&bs->throttled_reqs[is_write]);

     }
+
+
+
+    /* the IO will be executed, do the accounting */
+
     throttle_account(&bs->throttle_state,

                      is_write,

static void bdrv_io_limits_intercept(BlockDriverState *bs,

                                     int nb_sectors,

                                     bool is_write)

{

    /* does this io must wait */

    bool must_wait = throttle_schedule_timer(&bs->throttle_state, is_write);

    /* if must wait or any request of this type throttled queue the IO */

    if (must_wait ||

        !qemu_co_queue_empty(&bs->throttled_reqs[is_write])) {

        qemu_co_queue_wait(&bs->throttled_reqs[is_write]);

    }

    /* the IO will be executed, do the accounting */

    throttle_account(&bs->throttle_state,

                     is_write,

                     nb_sectors * BDRV_SECTOR_SIZE);

    /* if the next request must wait -> do nothing */

    if (throttle_schedule_timer(&bs->throttle_state, is_write)) {

        return;

    }

    /* else queue next request for execution */

    qemu_co_queue_next(&bs->throttled_reqs[is_write]);

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 int avformat_network_init(void)
+
+{
+
+#if CONFIG_NETWORK
+
     int ret;

     ff_network_inited_globally = 1;

int avformat_network_init(void)

{

#if CONFIG_NETWORK

    int ret;

    ff_network_inited_globally = 1;

    if ((ret = ff_network_init()) < 0)

        return ret;

    if ((ret = ff_tls_init()) < 0)

        return ret;

#endif

    return 0;

}


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

         if(nnzc[ scan8[i] ])

+            ff_h264_idct_add_mmx    (dest[(i&4)>>2] + block_offset[i], block + i*16, stride);
+
+        else if(block[i*16])
+
             ff_h264_idct_dc_add_mmx2(dest[(i&4)>>2] + block_offset[i], block + i*16, stride);

     }

static void ff_h264_idct_add8_mmx2(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){

    int i;

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

        if(nnzc[ scan8[i] ])

            ff_h264_idct_add_mmx    (dest[(i&4)>>2] + block_offset[i], block + i*16, stride);

        else if(block[i*16])

            ff_h264_idct_dc_add_mmx2(dest[(i&4)>>2] + block_offset[i], block + i*16, stride);

    }

}


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

                         tmp.w[FP_ENDIAN_IDX], tmp.d,                    \

+                        (double)tmp.fd,                                 \
+
+                        (double)tmp.fs[FP_ENDIAN_IDX],                  \
+
+                        (double)tmp.fs[!FP_ENDIAN_IDX]);                \

         }                                                               \

static void fpu_dump_state(CPUState *env, FILE *f,

                           int (*fpu_fprintf)(FILE *f, const char *fmt, ...),

                           int flags)

{

    int i;

    int is_fpu64 = !!(env->hflags & MIPS_HFLAG_F64);

#define printfpr(fp)                                                    \

    do {                                                                \

        if (is_fpu64)                                                   \

            fpu_fprintf(f, "w:%08x d:%016" PRIx64                       \

                        " fd:%13g fs:%13g psu: %13g\n",                 \

                        (fp)->w[FP_ENDIAN_IDX], (fp)->d,                \

                        (double)(fp)->fd,                               \

                        (double)(fp)->fs[FP_ENDIAN_IDX],                \

                        (double)(fp)->fs[!FP_ENDIAN_IDX]);              \

        else {                                                          \

            fpr_t tmp;                                                  \

            tmp.w[FP_ENDIAN_IDX] = (fp)->w[FP_ENDIAN_IDX];              \

            tmp.w[!FP_ENDIAN_IDX] = ((fp) + 1)->w[FP_ENDIAN_IDX];       \

            fpu_fprintf(f, "w:%08x d:%016" PRIx64                       \

                        " fd:%13g fs:%13g psu:%13g\n",                  \

                        tmp.w[FP_ENDIAN_IDX], tmp.d,                    \

                        (double)tmp.fd,                                 \

                        (double)tmp.fs[FP_ENDIAN_IDX],                  \

                        (double)tmp.fs[!FP_ENDIAN_IDX]);                \

        }                                                               \

    } while(0)

    fpu_fprintf(f, "CP1 FCR0 0x%08x  FCR31 0x%08x  SR.FR %d  fp_status 0x%08x(0x%02x)\n",

                env->active_fpu.fcr0, env->active_fpu.fcr31, is_fpu64, env->active_fpu.fp_status,

                get_float_exception_flags(&env->active_fpu.fp_status));

    for (i = 0; i < 32; (is_fpu64) ? i++ : (i += 2)) {

        fpu_fprintf(f, "%3s: ", fregnames[i]);

        printfpr(&env->active_fpu.fpr[i]);

    }

#undef printfpr

}


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

     VirtIOBalloon *s = opaque;

+
+
+    if (version_id != 1)
+
         return -EINVAL;

static int virtio_balloon_load(QEMUFile *f, void *opaque, int version_id)

{

    VirtIOBalloon *s = opaque;

    if (version_id != 1)

        return -EINVAL;

    virtio_load(&s->vdev, f);

    s->num_pages = qemu_get_be32(f);

    s->actual = qemu_get_be32(f);

    qemu_get_buffer(f, (uint8_t *)&s->stats_vq_elem, sizeof(VirtQueueElement));

    qemu_get_buffer(f, (uint8_t *)&s->stats_vq_offset, sizeof(size_t));

    qemu_get_buffer(f, (uint8_t *)&s->stats_callback, sizeof(MonitorCompletion));

    qemu_get_buffer(f, (uint8_t *)&s->stats_opaque_callback_data, sizeof(void));

    return 0;

}


static void tcg_out_insn_3401(TCGContext *s, AArch64Insn insn, TCGType ext,

                              TCGReg rd, TCGReg rn, uint64_t aimm)

{

    if (aimm > 0xfff) {

        assert((aimm & 0xfff) == 0);

        aimm >>= 12;

        assert(aimm <= 0xfff);

        aimm |= 1 << 12;  /* apply LSL 12 */

    }

    tcg_out32(s, insn | ext << 31 | aimm << 10 | rn << 5 | rd);

}


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

     int cpu_flags = av_get_cpu_flags();

+
+
+    if (INLINE_MMX(cpu_flags))
+
+        hpeldsp_init_mmx(c, flags);

av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)

{

    int cpu_flags = av_get_cpu_flags();

    if (INLINE_MMX(cpu_flags))

        hpeldsp_init_mmx(c, flags);

    if (EXTERNAL_AMD3DNOW(cpu_flags))

        hpeldsp_init_3dnow(c, flags);

    if (EXTERNAL_MMXEXT(cpu_flags))

        hpeldsp_init_mmxext(c, flags);

    if (EXTERNAL_SSE2_FAST(cpu_flags))

        hpeldsp_init_sse2_fast(c, flags);

    if (CONFIG_VP3_DECODER)

        ff_hpeldsp_vp3_init_x86(c, cpu_flags, flags);

}


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

     SysBusDevice *s;
+

     dev = qdev_create(NULL, "SUNW,tcx");

static void tcx_init(target_phys_addr_t addr, int vram_size, int width,

                     int height, int depth)

{

    DeviceState *dev;

    SysBusDevice *s;

    dev = qdev_create(NULL, "SUNW,tcx");

    qdev_prop_set_taddr(dev, "addr", addr);

    qdev_prop_set_uint32(dev, "vram_size", vram_size);

    qdev_prop_set_uint16(dev, "width", width);

    qdev_prop_set_uint16(dev, "height", height);

    qdev_prop_set_uint16(dev, "depth", depth);

    qdev_init(dev);

    s = sysbus_from_qdev(dev);

    /* 8-bit plane */

    sysbus_mmio_map(s, 0, addr + 0x00800000ULL);

    /* DAC */

    sysbus_mmio_map(s, 1, addr + 0x00200000ULL);

    /* TEC (dummy) */

    sysbus_mmio_map(s, 2, addr + 0x00700000ULL);

    /* THC 24 bit: NetBSD writes here even with 8-bit display: dummy */

    sysbus_mmio_map(s, 3, addr + 0x00301000ULL);

    if (depth == 24) {

        /* 24-bit plane */

        sysbus_mmio_map(s, 4, addr + 0x02000000ULL);

        /* Control plane */

        sysbus_mmio_map(s, 5, addr + 0x0a000000ULL);

    } else {

        /* THC 8 bit (dummy) */

        sysbus_mmio_map(s, 4, addr + 0x00300000ULL);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+uint32_t kvmppc_get_vmx(void)

 {

uint32_t kvmppc_get_vmx(void)

{

    return kvmppc_read_int_cpu_dt("ibm,vmx");

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     TCGv_i64 tcg_rd = cpu_reg(s, rd);

     TCGv_i64 tcg_tmp = tcg_temp_new_i64();
+
+    TCGv_i64 tcg_rn = read_cpu_reg(s, rn, sf);
+
+    TCGv_i64 mask = tcg_const_i64(sf ? 0x00ff00ff00ff00ffull : 0x00ff00ff);
+

     tcg_gen_shri_i64(tcg_tmp, tcg_rn, 8);

static void handle_rev16(DisasContext *s, unsigned int sf,

                         unsigned int rn, unsigned int rd)

{

    TCGv_i64 tcg_rd = cpu_reg(s, rd);

    TCGv_i64 tcg_tmp = tcg_temp_new_i64();

    TCGv_i64 tcg_rn = read_cpu_reg(s, rn, sf);

    TCGv_i64 mask = tcg_const_i64(sf ? 0x00ff00ff00ff00ffull : 0x00ff00ff);

    tcg_gen_shri_i64(tcg_tmp, tcg_rn, 8);

    tcg_gen_and_i64(tcg_rd, tcg_rn, mask);

    tcg_gen_and_i64(tcg_tmp, tcg_tmp, mask);

    tcg_gen_shli_i64(tcg_rd, tcg_rd, 8);

    tcg_gen_or_i64(tcg_rd, tcg_rd, tcg_tmp);

    tcg_temp_free_i64(tcg_tmp);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static void scsi_aio_complete(void *opaque, int ret)
+
+{
+
+    SCSIDiskReq *r = (SCSIDiskReq *)opaque;

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

static void scsi_aio_complete(void *opaque, int ret)

{

    SCSIDiskReq *r = (SCSIDiskReq *)opaque;

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

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

    r->req.aiocb = NULL;

    block_acct_done(bdrv_get_stats(s->qdev.conf.bs), &r->acct);

    if (r->req.io_canceled) {

        scsi_req_cancel_complete(&r->req);

        goto done;

    }

    if (ret < 0) {

        if (scsi_handle_rw_error(r, -ret)) {

            goto done;

        }

    }

    scsi_req_complete(&r->req, GOOD);

done:

    scsi_req_unref(&r->req);

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     gchar *command;
     const char *qemu_binary;
     qemu_binary = getenv("QTEST_QEMU_BINARY");
+    g_assert(qemu_binary != NULL);
+    s = g_malloc(sizeof(*s));
+    socket_path = g_strdup_printf("/tmp/qtest-%d.sock", getpid());
+    qmp_socket_path = g_strdup_printf("/tmp/qtest-%d.qmp", getpid());
+    sock = init_socket(socket_path);
     qmpsock = init_socket(qmp_socket_path);
     qtest_add_abrt_handler(kill_qemu_hook_func, s);
     s->qemu_pid = fork();

QTestState *qtest_init_without_qmp_handshake(const char *extra_args)
{
    QTestState *s;
    int sock, qmpsock, i;
    gchar *socket_path;
    gchar *qmp_socket_path;
    gchar *command;
    const char *qemu_binary;
    qemu_binary = getenv("QTEST_QEMU_BINARY");
    g_assert(qemu_binary != NULL);
    s = g_malloc(sizeof(*s));
    socket_path = g_strdup_printf("/tmp/qtest-%d.sock", getpid());
    qmp_socket_path = g_strdup_printf("/tmp/qtest-%d.qmp", getpid());
    sock = init_socket(socket_path);
    qmpsock = init_socket(qmp_socket_path);
    qtest_add_abrt_handler(kill_qemu_hook_func, s);
    s->qemu_pid = fork();
    if (s->qemu_pid == 0) {
        setenv("QEMU_AUDIO_DRV", "none", true);
        command = g_strdup_printf("exec %s "
                                  "-qtest unix:%s,nowait "
                                  "-qtest-log %s "
                                  "-qmp unix:%s,nowait "
                                  "-machine accel=qtest "
                                  "-display none "
                                  "%s", qemu_binary, socket_path,
                                  getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null",
                                  qmp_socket_path,
                                  extra_args ?: "");
        execlp("/bin/sh", "sh", "-c", command, NULL);
        exit(1);
    }
    s->fd = socket_accept(sock);
    if (s->fd >= 0) {
        s->qmp_fd = socket_accept(qmpsock);
    }
    g_free(socket_path);
    g_free(qmp_socket_path);
    g_assert(s->fd >= 0 && s->qmp_fd >= 0);
    s->rx = g_string_new("");
    for (i = 0; i < MAX_IRQ; i++) {
        s->irq_level[i] = false;
    }
    if (getenv("QTEST_STOP")) {
        kill(s->qemu_pid, SIGSTOP);
    }
    /* ask endianness of the target */
    s->big_endian = qtest_query_target_endianness(s);
    return s;
}


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

     vbi_version(&maj, &min, &rev);

+    if (!(maj > 0 || min > 2 || min == 2 && rev >= 26)) {

         av_log(avctx, AV_LOG_ERROR, "decoder needs zvbi version >= 0.2.26.\n");

static int teletext_init_decoder(AVCodecContext *avctx)

{

    TeletextContext *ctx = avctx->priv_data;

    unsigned int maj, min, rev;

    vbi_version(&maj, &min, &rev);

    if (!(maj > 0 || min > 2 || min == 2 && rev >= 26)) {

        av_log(avctx, AV_LOG_ERROR, "decoder needs zvbi version >= 0.2.26.\n");

        return AVERROR_EXTERNAL;

    }

    if (ctx->format_id == 0) {

        avctx->width  = 41 * BITMAP_CHAR_WIDTH;

        avctx->height = 25 * BITMAP_CHAR_HEIGHT;

    }

    ctx->dx = NULL;

    ctx->vbi = NULL;

    ctx->pts = AV_NOPTS_VALUE;

#ifdef DEBUG

    {

        char *t;

        ctx->ex = vbi_export_new("text", &t);

    }

#endif

    av_log(avctx, AV_LOG_VERBOSE, "page filter: %s\n", ctx->pgno);

    return (ctx->format_id == 1) ? ff_ass_subtitle_header_default(avctx) : 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 void hmp_info_memdev(Monitor *mon, const QDict *qdict)
 {
     Error *err = NULL;
+    MemdevList *memdev_list = qmp_query_memdev(&err);
+    MemdevList *m = memdev_list;
+    StringOutputVisitor *ov;
+    char *str;
+    int i = 0;
     while (m) {
         ov = string_output_visitor_new(false);
         visit_type_uint16List(string_output_get_visitor(ov),

void hmp_info_memdev(Monitor *mon, const QDict *qdict)
{
    Error *err = NULL;
    MemdevList *memdev_list = qmp_query_memdev(&err);
    MemdevList *m = memdev_list;
    StringOutputVisitor *ov;
    char *str;
    int i = 0;
    while (m) {
        ov = string_output_visitor_new(false);
        visit_type_uint16List(string_output_get_visitor(ov),
                              &m->value->host_nodes, NULL, NULL);
        monitor_printf(mon, "memory backend: %d\n", i);
        monitor_printf(mon, "  size:  %" PRId64 "\n", m->value->size);
        monitor_printf(mon, "  merge: %s\n",
                       m->value->merge ? "true" : "false");
        monitor_printf(mon, "  dump: %s\n",
                       m->value->dump ? "true" : "false");
        monitor_printf(mon, "  prealloc: %s\n",
                       m->value->prealloc ? "true" : "false");
        monitor_printf(mon, "  policy: %s\n",
                       HostMemPolicy_lookup[m->value->policy]);
        str = string_output_get_string(ov);
        monitor_printf(mon, "  host nodes: %s\n", str);
        g_free(str);
        string_output_visitor_cleanup(ov);
        m = m->next;
        i++;
    }
    monitor_printf(mon, "\n");
}


static void show_parts(const char *device)

{

    if (fork() == 0) {

        int nbd;

        /* linux just needs an open() to trigger

         * the partition table update

         * but remember to load the module with max_part != 0 :

         *     modprobe nbd max_part=63

         */

        nbd = open(device, O_RDWR);

        if (nbd != -1)

              close(nbd);

        exit(0);

    }

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                              socklen_t *addr_len, const char *localaddr)

 {
+
     int udp_fd = -1;

     struct addrinfo *res0 = NULL, *res = NULL;

static int udp_socket_create(UDPContext *s, struct sockaddr_storage *addr,

                             socklen_t *addr_len, const char *localaddr)

{

    int udp_fd = -1;

    struct addrinfo *res0 = NULL, *res = NULL;

    int family = AF_UNSPEC;

    if (((struct sockaddr *) &s->dest_addr)->sa_family)

        family = ((struct sockaddr *) &s->dest_addr)->sa_family;

    res0 = udp_resolve_host(localaddr[0] ? localaddr : NULL, s->local_port,

                            SOCK_DGRAM, family, AI_PASSIVE);

    if (res0 == 0)

        goto fail;

    for (res = res0; res; res=res->ai_next) {

        udp_fd = ff_socket(res->ai_family, SOCK_DGRAM, 0);

        if (udp_fd != -1) break;

        log_net_error(NULL, AV_LOG_ERROR, "socket");

    }

    if (udp_fd < 0)

        goto fail;

    memcpy(addr, res->ai_addr, res->ai_addrlen);

    *addr_len = res->ai_addrlen;

    freeaddrinfo(res0);

    return udp_fd;

 fail:

    if (udp_fd >= 0)

        closesocket(udp_fd);

    if(res0)

        freeaddrinfo(res0);

    return -1;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void check_guest_output(const testdef_t *test, int fd)

+{

     bool output_ok = false;
+
     int i, nbr, pos = 0;

     char ch;

static void check_guest_output(const testdef_t *test, int fd)

{

    bool output_ok = false;

    int i, nbr, pos = 0;

    char ch;

    /* Poll serial output... Wait at most 60 seconds */

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

        while ((nbr = read(fd, &ch, 1)) == 1) {

            if (ch == test->expect[pos]) {

                pos += 1;

                if (test->expect[pos] == '\0') {

                    /* We've reached the end of the expected string! */

                    output_ok = true;

                    goto done;

                }

            } else {

                pos = 0;

            }

        }

        g_assert(nbr >= 0);

        g_usleep(10000);

    }

done:

    g_assert(output_ok);

}


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

         ga_channel_listen_close(c);

void ga_channel_free(GAChannel *c)

{

    if (c->method == GA_CHANNEL_UNIX_LISTEN

        && c->listen_channel) {

        ga_channel_listen_close(c);

    }

    if (c->client_channel) {

        ga_channel_client_close(c);

    }

    g_free(c);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static inline bool extended_addresses_enabled(CPUARMState *env)

 {
+
+    return arm_el_is_aa64(env, 1)

         || ((arm_feature(env, ARM_FEATURE_LPAE)

static inline bool extended_addresses_enabled(CPUARMState *env)

{

    return arm_el_is_aa64(env, 1)

        || ((arm_feature(env, ARM_FEATURE_LPAE)

             && (env->cp15.c2_control & (1U << 31))));

}


--- a/source.c
+++ b/source.c
@@ -1,22 +1,22 @@
 static void vnc_dpy_switch(DisplayChangeListener *dcl,
+
                            DisplaySurface *surface)

 {

+    VncDisplay *vd = container_of(dcl, VncDisplay, dcl);

     VncState *vs;

+
     vnc_abort_display_jobs(vd);

     /* server surface */

+    qemu_pixman_image_unref(vd->server);

     vd->ds = surface;

static void vnc_dpy_switch(DisplayChangeListener *dcl,

                           DisplaySurface *surface)

{

    VncDisplay *vd = container_of(dcl, VncDisplay, dcl);

    VncState *vs;

    vnc_abort_display_jobs(vd);

    /* server surface */

    qemu_pixman_image_unref(vd->server);

    vd->ds = surface;

    vd->server = pixman_image_create_bits(VNC_SERVER_FB_FORMAT,

                                          surface_width(vd->ds),

                                          surface_height(vd->ds),

                                          NULL, 0);

    /* guest surface */

#if 0 /* FIXME */

    if (ds_get_bytes_per_pixel(ds) != vd->guest.ds->pf.bytes_per_pixel)

        console_color_init(ds);

#endif

    qemu_pixman_image_unref(vd->guest.fb);

    vd->guest.fb = pixman_image_ref(surface->image);

    vd->guest.format = surface->format;

    VNC_SET_VISIBLE_PIXELS_DIRTY(vd->guest.dirty,

                                 surface_width(vd->ds),

                                 surface_height(vd->ds));

    QTAILQ_FOREACH(vs, &vd->clients, next) {

        vnc_colordepth(vs);

        vnc_desktop_resize(vs);

        if (vs->vd->cursor) {

            vnc_cursor_define(vs);

        }

        VNC_SET_VISIBLE_PIXELS_DIRTY(vs->dirty,

                                     surface_width(vd->ds),

                                     surface_height(vd->ds));

    }

}


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

     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
+
+    int max_step     [4];       /* max pixel step for each plane */
+
+    int max_step_comp[4];       /* the component for each plane which has the max pixel step */
+

     if ((unsigned)pix_fmt >= AV_PIX_FMT_NB || desc->flags & AV_PIX_FMT_FLAG_HWACCEL)

int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane)

{

    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);

    int max_step     [4];       /* max pixel step for each plane */

    int max_step_comp[4];       /* the component for each plane which has the max pixel step */

    if ((unsigned)pix_fmt >= AV_PIX_FMT_NB || desc->flags & AV_PIX_FMT_FLAG_HWACCEL)

        return AVERROR(EINVAL);

    av_image_fill_max_pixsteps(max_step, max_step_comp, desc);

    return image_get_linesize(width, plane, max_step[plane], max_step_comp[plane], desc);

}


void check_audio_video_inputs(int *has_video_ptr, int *has_audio_ptr)

{

    int has_video, has_audio, i, j;

    AVFormatContext *ic;

    has_video = 0;

    has_audio = 0;

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

        ic = input_files[j];

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

            AVCodecContext *enc = &ic->streams[i]->codec;

            switch(enc->codec_type) {

            case CODEC_TYPE_AUDIO:

                has_audio = 1;

                break;

            case CODEC_TYPE_VIDEO:

                has_video = 1;

                break;

            default:

                abort();

            }

        }

    }

    *has_video_ptr = has_video;

    *has_audio_ptr = has_audio;

}


--- a/source.c
+++ b/source.c
@@ -7,5 +7,5 @@
     qemu_get_sbe32s(f, v);

     return 0;
+
+}

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

{

    int32_t *v = pv;

    qemu_get_sbe32s(f, v);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static int64_t coroutine_fn qcow_co_get_block_status(BlockDriverState *bs,

+        int64_t sector_num, int nb_sectors, int *pnum, BlockDriverState **file)

 {
+
     BDRVQcowState *s = bs->opaque;

     int index_in_cluster, n;

static int64_t coroutine_fn qcow_co_get_block_status(BlockDriverState *bs,

        int64_t sector_num, int nb_sectors, int *pnum, BlockDriverState **file)

{

    BDRVQcowState *s = bs->opaque;

    int index_in_cluster, n;

    uint64_t cluster_offset;

    qemu_co_mutex_lock(&s->lock);

    cluster_offset = get_cluster_offset(bs, sector_num << 9, 0, 0, 0, 0);

    qemu_co_mutex_unlock(&s->lock);

    index_in_cluster = sector_num & (s->cluster_sectors - 1);

    n = s->cluster_sectors - index_in_cluster;

    if (n > nb_sectors)

        n = nb_sectors;

    *pnum = n;

    if (!cluster_offset) {

        return 0;

    }

    if ((cluster_offset & QCOW_OFLAG_COMPRESSED) || s->crypto) {

        return BDRV_BLOCK_DATA;

    }

    cluster_offset |= (index_in_cluster << BDRV_SECTOR_BITS);

    *file = bs->file->bs;

    return BDRV_BLOCK_DATA | BDRV_BLOCK_OFFSET_VALID | cluster_offset;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void remote_block_to_network(RDMARemoteBlock *rb)
+
+{
+
     rb->remote_host_addr = htonll(rb->remote_host_addr);

     rb->offset = htonll(rb->offset);

static void remote_block_to_network(RDMARemoteBlock *rb)

{

    rb->remote_host_addr = htonll(rb->remote_host_addr);

    rb->offset = htonll(rb->offset);

    rb->length = htonll(rb->length);

    rb->remote_rkey = htonl(rb->remote_rkey);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+PPC_OP(subfeo)
+
+{

     do_subfeo();

PPC_OP(subfeo)

{

    do_subfeo();

    RETURN();

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void tcg_target_qemu_prologue(TCGContext *s)
+
 {

+    /* stmdb sp!, { r9 - r11, lr } */

     tcg_out32(s, (COND_AL << 28) | 0x092d4e00);

void tcg_target_qemu_prologue(TCGContext *s)

{

    /* stmdb sp!, { r9 - r11, lr } */

    tcg_out32(s, (COND_AL << 28) | 0x092d4e00);

    tcg_out_bx(s, COND_AL, TCG_REG_R0);

    tb_ret_addr = s->code_ptr;

    /* ldmia sp!, { r9 - r11, pc } */

    tcg_out32(s, (COND_AL << 28) | 0x08bd8e00);

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
         ctx->thread_pool = thread_pool_new(ctx);

     }
+
+    return ctx->thread_pool;
+
 }

ThreadPool *aio_get_thread_pool(AioContext *ctx)

{

    if (!ctx->thread_pool) {

        ctx->thread_pool = thread_pool_new(ctx);

    }

    return ctx->thread_pool;

}


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

         const int q1 = pix[1*xstride];

+
+
+        if( FFABS( p0 - q0 ) < alpha &&
+
+            FFABS( p1 - p0 ) < beta &&

             FFABS( q1 - q0 ) < beta ) {

static inline void h264_loop_filter_chroma_intra_c(uint8_t *pix, int xstride, int ystride, int alpha, int beta)

{

    int d;

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

        const int p0 = pix[-1*xstride];

        const int p1 = pix[-2*xstride];

        const int q0 = pix[0];

        const int q1 = pix[1*xstride];

        if( FFABS( p0 - q0 ) < alpha &&

            FFABS( p1 - p0 ) < beta &&

            FFABS( q1 - q0 ) < beta ) {

            pix[-xstride] = ( 2*p1 + p0 + q1 + 2 ) >> 2;   /* p0' */

            pix[0]        = ( 2*q1 + q0 + p1 + 2 ) >> 2;   /* q0' */

        }

        pix += ystride;

    }

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
         ide_atapi_cmd_error(s, SENSE_NOT_READY, ASC_MEDIUM_NOT_PRESENT);

         return;
+
+    }
+
+
+
     lba = ube32_to_cpu(buf + 2);

     if (lba >= total_sectors) {

static void cmd_seek(IDEState *s, uint8_t* buf)

{

    unsigned int lba;

    uint64_t total_sectors = s->nb_sectors >> 2;

    if (total_sectors == 0) {

        ide_atapi_cmd_error(s, SENSE_NOT_READY, ASC_MEDIUM_NOT_PRESENT);

        return;

    }

    lba = ube32_to_cpu(buf + 2);

    if (lba >= total_sectors) {

        ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST, ASC_LOGICAL_BLOCK_OOR);

        return;

    }

    ide_atapi_cmd_ok(s);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void pty_chr_close(struct CharDriverState *chr)

 {
+
     PtyCharDriver *s = chr->opaque;

     int fd;

static void pty_chr_close(struct CharDriverState *chr)

{

    PtyCharDriver *s = chr->opaque;

    int fd;

    remove_fd_in_watch(chr);

    fd = g_io_channel_unix_get_fd(s->fd);

    g_io_channel_unref(s->fd);

    close(fd);

    if (s->timer_tag) {

        g_source_remove(s->timer_tag);

        s->timer_tag = 0;

    }

    g_free(s);

    qemu_chr_be_event(chr, CHR_EVENT_CLOSED);

}


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

     if (!*filename) {

+        error_report("character device specification needed");
+
+        return NULL;
+
+    }

     filename++;

static USBDevice *usb_serial_init(USBBus *bus, const char *filename)

{

    USBDevice *dev;

    Chardev *cdrv;

    char label[32];

    static int index;

    while (*filename && *filename != ':') {

        const char *p;

        if (strstart(filename, "vendorid=", &p)) {

            error_report("vendorid is not supported anymore");

            return NULL;

        } else if (strstart(filename, "productid=", &p)) {

            error_report("productid is not supported anymore");

            return NULL;

        } else {

            error_report("unrecognized serial USB option %s", filename);

            return NULL;

        }

        while(*filename == ',')

            filename++;

    }

    if (!*filename) {

        error_report("character device specification needed");

        return NULL;

    }

    filename++;

    snprintf(label, sizeof(label), "usbserial%d", index++);

    cdrv = qemu_chr_new(label, filename);

    if (!cdrv)

        return NULL;

    dev = usb_create(bus, "usb-serial");

    qdev_prop_set_chr(&dev->qdev, "chardev", cdrv);

    return dev;

}


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

                       int nb_sectors, BdrvRequestFlags flags)
+
+{

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

int bdrv_write_zeroes(BlockDriverState *bs, int64_t sector_num,

                      int nb_sectors, BdrvRequestFlags flags)

{

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

                      BDRV_REQ_ZERO_WRITE | flags);

}


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

     }
+
+
+
+    ret = qemu_config_parse(f, config_groups, filename);
+
     if (ret < 0) {

         error_setg(errp, "Could not parse blkdebug config file");

static int read_config(BDRVBlkdebugState *s, const char *filename, Error **errp)

{

    FILE *f;

    int ret;

    struct add_rule_data d;

    f = fopen(filename, "r");

    if (f == NULL) {

        error_setg_errno(errp, errno, "Could not read blkdebug config file");

        return -errno;

    }

    ret = qemu_config_parse(f, config_groups, filename);

    if (ret < 0) {

        error_setg(errp, "Could not parse blkdebug config file");

        ret = -EINVAL;

        goto fail;

    }

    d.s = s;

    d.action = ACTION_INJECT_ERROR;

    qemu_opts_foreach(&inject_error_opts, add_rule, &d, 0);

    d.action = ACTION_SET_STATE;

    qemu_opts_foreach(&set_state_opts, add_rule, &d, 0);

    ret = 0;

fail:

    qemu_opts_reset(&inject_error_opts);

    qemu_opts_reset(&set_state_opts);

    fclose(f);

    return ret;

}


static int rle_unpack(unsigned char *src, unsigned char *dest, int len)

{

    unsigned char *ps;

    unsigned char *pd;

    int i, l;

    ps = src;

    pd = dest;

    if (len & 1)

        *pd++ = *ps++;

    len >>= 1;

    i = 0;

    do {

        l = *ps++;

        if (l & 0x80) {

            l = (l & 0x7F) * 2;

            memcpy(pd, ps, l);

            ps += l;

            pd += l;

        } else {

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

                *pd++ = ps[0];

                *pd++ = ps[1];

            }

            ps += 2;

        }

        i += l;

    } while (i < len);

    return (ps - src);

}