qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] few compile time warnings removed
@ 2008-09-16 15:06 Stefano Stabellini
  2008-09-22  9:45 ` Stefano Stabellini
  2008-09-25  9:30 ` Stefano Stabellini
  0 siblings, 2 replies; 4+ messages in thread
From: Stefano Stabellini @ 2008-09-16 15:06 UTC (permalink / raw)
  To: qemu-devel

Few small changes to remove some compile time warnings:

- we are not initializing the qemu_alarm_timer pointer in
init_timer_alarm, so I am adding a NULL initialization;

- in the headers include code, we are doing something like:

#ifdef
/* BSD stuff */
#else
#ifndef __sun__
/* linux stuff */
#else
/* sun stuff */
#endif
#endif

that works most of the times but it fails when you try to compile qemu
on mini-os, that is posix but it doesn't define either __sun__ or 
__linux__, so I am changing it to:

#ifdef
/* BSD stuff */
#else
#ifdef __linux__
/* linux stuff */
#endif
#ifdef __sun__
/* sun stuff */
#endif
#endif

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/vl.c b/vl.c
index 0d96401..69aee16 100644
--- a/vl.c
+++ b/vl.c
@@ -70,7 +70,7 @@
 #elif defined (__GLIBC__) && defined (__FreeBSD_kernel__)
 #include <freebsd/stdlib.h>
 #else
-#ifndef __sun__
+#ifdef __linux__
 #include <linux/if.h>
 #include <linux/if_tun.h>
 #include <pty.h>
@@ -84,7 +84,8 @@
 
 #include <linux/ppdev.h>
 #include <linux/parport.h>
-#else
+#endif
+#ifdef __sun__
 #include <sys/stat.h>
 #include <sys/ethernet.h>
 #include <sys/sockio.h>
@@ -1676,7 +1677,7 @@ static void win32_rearm_timer(struct qemu_alarm_timer *t)
 
 static void init_timer_alarm(void)
 {
-    struct qemu_alarm_timer *t;
+    struct qemu_alarm_timer *t = NULL;
     int i, err = -1;
 
     for (i = 0; alarm_timers[i].name; i++) {

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] few compile time warnings removed
  2008-09-16 15:06 [Qemu-devel] [PATCH] few compile time warnings removed Stefano Stabellini
@ 2008-09-22  9:45 ` Stefano Stabellini
  2008-09-25  9:30 ` Stefano Stabellini
  1 sibling, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2008-09-22  9:45 UTC (permalink / raw)
  To: qemu-devel

Any news on this?

Stefano Stabellini wrote:

> Few small changes to remove some compile time warnings:
> 
> - we are not initializing the qemu_alarm_timer pointer in
> init_timer_alarm, so I am adding a NULL initialization;
> 
> - in the headers include code, we are doing something like:
> 
> #ifdef
> /* BSD stuff */
> #else
> #ifndef __sun__
> /* linux stuff */
> #else
> /* sun stuff */
> #endif
> #endif
> 
> that works most of the times but it fails when you try to compile qemu
> on mini-os, that is posix but it doesn't define either __sun__ or 
> __linux__, so I am changing it to:
> 
> #ifdef
> /* BSD stuff */
> #else
> #ifdef __linux__
> /* linux stuff */
> #endif
> #ifdef __sun__
> /* sun stuff */
> #endif
> #endif
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/vl.c b/vl.c
> index 0d96401..69aee16 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -70,7 +70,7 @@
>  #elif defined (__GLIBC__) && defined (__FreeBSD_kernel__)
>  #include <freebsd/stdlib.h>
>  #else
> -#ifndef __sun__
> +#ifdef __linux__
>  #include <linux/if.h>
>  #include <linux/if_tun.h>
>  #include <pty.h>
> @@ -84,7 +84,8 @@
>  
>  #include <linux/ppdev.h>
>  #include <linux/parport.h>
> -#else
> +#endif
> +#ifdef __sun__
>  #include <sys/stat.h>
>  #include <sys/ethernet.h>
>  #include <sys/sockio.h>
> @@ -1676,7 +1677,7 @@ static void win32_rearm_timer(struct qemu_alarm_timer *t)
>  
>  static void init_timer_alarm(void)
>  {
> -    struct qemu_alarm_timer *t;
> +    struct qemu_alarm_timer *t = NULL;
>      int i, err = -1;
>  
>      for (i = 0; alarm_timers[i].name; i++) {
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] few compile time warnings removed
  2008-09-16 15:06 [Qemu-devel] [PATCH] few compile time warnings removed Stefano Stabellini
  2008-09-22  9:45 ` Stefano Stabellini
@ 2008-09-25  9:30 ` Stefano Stabellini
  2008-09-25 16:39   ` Blue Swirl
  1 sibling, 1 reply; 4+ messages in thread
From: Stefano Stabellini @ 2008-09-25  9:30 UTC (permalink / raw)
  To: qemu-devel

Could someone take a look at this patch, please?
It should only take few minutes.

Stefano Stabellini wrote:

> Few small changes to remove some compile time warnings:
> 
> - we are not initializing the qemu_alarm_timer pointer in
> init_timer_alarm, so I am adding a NULL initialization;
> 
> - in the headers include code, we are doing something like:
> 
> #ifdef
> /* BSD stuff */
> #else
> #ifndef __sun__
> /* linux stuff */
> #else
> /* sun stuff */
> #endif
> #endif
> 
> that works most of the times but it fails when you try to compile qemu
> on mini-os, that is posix but it doesn't define either __sun__ or 
> __linux__, so I am changing it to:
> 
> #ifdef
> /* BSD stuff */
> #else
> #ifdef __linux__
> /* linux stuff */
> #endif
> #ifdef __sun__
> /* sun stuff */
> #endif
> #endif
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/vl.c b/vl.c
> index 0d96401..69aee16 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -70,7 +70,7 @@
>  #elif defined (__GLIBC__) && defined (__FreeBSD_kernel__)
>  #include <freebsd/stdlib.h>
>  #else
> -#ifndef __sun__
> +#ifdef __linux__
>  #include <linux/if.h>
>  #include <linux/if_tun.h>
>  #include <pty.h>
> @@ -84,7 +84,8 @@
>  
>  #include <linux/ppdev.h>
>  #include <linux/parport.h>
> -#else
> +#endif
> +#ifdef __sun__
>  #include <sys/stat.h>
>  #include <sys/ethernet.h>
>  #include <sys/sockio.h>
> @@ -1676,7 +1677,7 @@ static void win32_rearm_timer(struct qemu_alarm_timer *t)
>  
>  static void init_timer_alarm(void)
>  {
> -    struct qemu_alarm_timer *t;
> +    struct qemu_alarm_timer *t = NULL;
>      int i, err = -1;
>  
>      for (i = 0; alarm_timers[i].name; i++) {
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] few compile time warnings removed
  2008-09-25  9:30 ` Stefano Stabellini
@ 2008-09-25 16:39   ` Blue Swirl
  0 siblings, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2008-09-25 16:39 UTC (permalink / raw)
  To: qemu-devel

On 9/25/08, Stefano Stabellini <stefano.stabellini@eu.citrix.com> wrote:
> Could someone take a look at this patch, please?
>  It should only take few minutes.
>
>  Stefano Stabellini wrote:
>
>  > Few small changes to remove some compile time warnings:

Looks OK. Anybody mind if I commit it?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-09-25 16:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-16 15:06 [Qemu-devel] [PATCH] few compile time warnings removed Stefano Stabellini
2008-09-22  9:45 ` Stefano Stabellini
2008-09-25  9:30 ` Stefano Stabellini
2008-09-25 16:39   ` Blue Swirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).