* [Qemu-devel] PATCH: uint32_t for pointer arithmetic?
@ 2004-09-18 10:31 Pavel Janík
2004-09-18 11:10 ` malc
0 siblings, 1 reply; 7+ messages in thread
From: Pavel Janík @ 2004-09-18 10:31 UTC (permalink / raw)
To: qemu-devel
Hi,
oss.c is IMHO unnecessary retyping pointers to uint32_t and only after that
to void *. This means that this will issue two warnings on 64bit platforms:
/home/pavel/QEMU/qemu-cvs/oss.c: In function `AUD_run':
/home/pavel/QEMU/qemu-cvs/oss.c:406: warning: cast from pointer to integer of different size
/home/pavel/QEMU/qemu-cvs/oss.c:406: warning: cast to pointer from integer of different size
--- oss.c.~1.5.~ 2004-07-08 21:13:39.000000000 +0200
+++ oss.c 2004-09-18 12:23:57.017793080 +0200
@@ -403,7 +403,7 @@
left = oss.bufsize - oss.rpos;
play = MIN (left, bytes);
- written = write (oss.fd, (void *) ((uint32_t) oss.buf + oss.rpos), play);
+ written = write (oss.fd, (void *) (oss.buf + oss.rpos), play);
if (-1 == written) {
if (EAGAIN == errno || EINTR == errno) {
--
Pavel Janík
...... is one of the good guys, even though his user interface could stand
improvement.
-- Larry McVoy in linux-kernel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] PATCH: uint32_t for pointer arithmetic?
2004-09-18 10:31 [Qemu-devel] PATCH: uint32_t for pointer arithmetic? Pavel Janík
@ 2004-09-18 11:10 ` malc
2004-09-18 14:25 ` Pavel Janík
0 siblings, 1 reply; 7+ messages in thread
From: malc @ 2004-09-18 11:10 UTC (permalink / raw)
To: qemu-devel
On Sat, 18 Sep 2004, [iso-8859-2] Pavel Jan?k wrote:
> Hi,
>
> oss.c is IMHO unnecessary retyping pointers to uint32_t and only after that
> to void *. This means that this will issue two warnings on 64bit platforms:
>
> /home/pavel/QEMU/qemu-cvs/oss.c: In function `AUD_run':
> /home/pavel/QEMU/qemu-cvs/oss.c:406: warning: cast from pointer to integer of different size
> /home/pavel/QEMU/qemu-cvs/oss.c:406: warning: cast to pointer from integer of different size
>
> --- oss.c.~1.5.~ 2004-07-08 21:13:39.000000000 +0200
> +++ oss.c 2004-09-18 12:23:57.017793080 +0200
> @@ -403,7 +403,7 @@
>
> left = oss.bufsize - oss.rpos;
> play = MIN (left, bytes);
> - written = write (oss.fd, (void *) ((uint32_t) oss.buf + oss.rpos), play);
> + written = write (oss.fd, (void *) (oss.buf + oss.rpos), play);
>
> if (-1 == written) {
> if (EAGAIN == errno || EINTR == errno) {
oss.c in CVS, is obsolete(from my point of view anyhow), i would apreciate
if you check following though.
http://www.boblycat.org/~malc/code/patches/qemu/7b_aqemu.patch.gz
--
mailto:malc@pulsesoft.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] PATCH: uint32_t for pointer arithmetic?
2004-09-18 11:10 ` malc
@ 2004-09-18 14:25 ` Pavel Janík
2004-09-18 15:09 ` malc
0 siblings, 1 reply; 7+ messages in thread
From: Pavel Janík @ 2004-09-18 14:25 UTC (permalink / raw)
To: qemu-devel
From: malc <malc@pulsesoft.com>
Date: Sat, 18 Sep 2004 15:10:27 +0400 (MSD)
Hi,
> oss.c in CVS, is obsolete(from my point of view anyhow), i would apreciate
> if you check following though.
>
> http://www.boblycat.org/~malc/code/patches/qemu/7b_aqemu.patch.gz
/home/pavel/QEMU/qemu-cvs/oss.c:318: error: conflicting types for `AUD_open'
/home/pavel/QEMU/qemu-cvs/vl.h:562: error: previous declaration of `AUD_open'
/home/pavel/QEMU/qemu-cvs/oss.c:323: error: conflicting types for `AUD_write'
/home/pavel/QEMU/qemu-cvs/vl.h:563: error: previous declaration of `AUD_write'
...
--
Pavel Janík
Well, after spending a lot of time hacking on Emacs you develop
a particular intimacy with point. A sort of friendship which
doesn't allow for "the" to appear in front of "point" any more.
-- Stefan Monnier in comp.emacs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] PATCH: uint32_t for pointer arithmetic?
2004-09-18 14:25 ` Pavel Janík
@ 2004-09-18 15:09 ` malc
2004-09-18 18:03 ` Sylvain Petreolle
0 siblings, 1 reply; 7+ messages in thread
From: malc @ 2004-09-18 15:09 UTC (permalink / raw)
To: qemu-devel
On Sat, 18 Sep 2004, [iso-8859-2] Pavel Jan?k wrote:
> From: malc <malc@pulsesoft.com>
> Date: Sat, 18 Sep 2004 15:10:27 +0400 (MSD)
>
> Hi,
>
> > oss.c in CVS, is obsolete(from my point of view anyhow), i would apreciate
> > if you check following though.
> >
> > http://www.boblycat.org/~malc/code/patches/qemu/7b_aqemu.patch.gz
>
> /home/pavel/QEMU/qemu-cvs/oss.c:318: error: conflicting types for `AUD_open'
> /home/pavel/QEMU/qemu-cvs/vl.h:562: error: previous declaration of `AUD_open'
> /home/pavel/QEMU/qemu-cvs/oss.c:323: error: conflicting types for `AUD_write'
> /home/pavel/QEMU/qemu-cvs/vl.h:563: error: previous declaration of `AUD_write'
> ...
I just did cvs up on qemu, copied the tree to separate directory
applied the patch (sucess with two hunks merged) did a ./configure
--target-list=i386-softmmu followed by a make. Build was successful
with some warnings (in mixeng.cpp). Sound is playing...
malc$ gcc -v
Reading specs from /net/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/specs
Configured with: ../gcc-3.3.2/configure --prefix=/net --program-suffix=3.3.2
Thread model: posix
gcc version 3.3.2
0b7c85ab08d0b8ba93e98a7b4fc1e1d9 /mnt/big/npf/code/www/code/patches/qemu/7b_aqemu.patch.gz
Basically i can not reproduce errors you are seeing.
--
mailto:malc@pulsesoft.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] PATCH: uint32_t for pointer arithmetic?
2004-09-18 15:09 ` malc
@ 2004-09-18 18:03 ` Sylvain Petreolle
2004-09-18 21:37 ` Pavel Janík
0 siblings, 1 reply; 7+ messages in thread
From: Sylvain Petreolle @ 2004-09-18 18:03 UTC (permalink / raw)
To: qemu-devel
> > /home/pavel/QEMU/qemu-cvs/oss.c:318: error: conflicting types for `AUD_open'
> > /home/pavel/QEMU/qemu-cvs/vl.h:562: error: previous declaration of `AUD_open'
> > /home/pavel/QEMU/qemu-cvs/oss.c:323: error: conflicting types for `AUD_write'
> > /home/pavel/QEMU/qemu-cvs/vl.h:563: error: previous declaration of `AUD_write'
Pavel, were you compiling all targets ?
Im getting errors too if the ppc targets are enabled.
Using i386* targets only leads me to a successfull compilation. (as malc does)
> I just did cvs up on qemu, copied the tree to separate directory
> applied the patch (sucess with two hunks merged) did a ./configure
> --target-list=i386-softmmu followed by a make. Build was successful
> with some warnings (in mixeng.cpp). Sound is playing...
>
> malc$ gcc -v
> Reading specs from /net/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/specs
> Configured with: ../gcc-3.3.2/configure --prefix=/net --program-suffix=3.3.2
> Thread model: posix
> gcc version 3.3.2
>
> 0b7c85ab08d0b8ba93e98a7b4fc1e1d9 /mnt/big/npf/code/www/code/patches/qemu/7b_aqemu.patch.gz
>
> Basically i can not reproduce errors you are seeing.
>
> --
> mailto:malc@pulsesoft.com
>
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>
=====
Sylvain Petreolle (spetreolle_at_users_dot_sourceforge_dot_net)
Say NO to software patents
Dites NON aux brevets logiciels
"You believe it's the year 1984, when in fact, its closer to 2184"1984 / Matrix
Vous manquez despace pour stocker vos mails ?
Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis. A télécharger gratuitement sur http://fr.messenger.yahoo.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] PATCH: uint32_t for pointer arithmetic?
2004-09-18 18:03 ` Sylvain Petreolle
@ 2004-09-18 21:37 ` Pavel Janík
2004-09-18 22:01 ` malc
0 siblings, 1 reply; 7+ messages in thread
From: Pavel Janík @ 2004-09-18 21:37 UTC (permalink / raw)
To: qemu-devel
From: Sylvain Petreolle <spetreolle@yahoo.fr>
Date: Sat, 18 Sep 2004 20:03:47 +0200 (CEST)
Hi,
> Pavel, were you compiling all targets ?
> Im getting errors too if the ppc targets are enabled.
> Using i386* targets only leads me to a successfull compilation. (as malc does)
yes, I also build PPC (ppc-softmmu).
--
Pavel Janík
Beware of bugs in the above code; I have only proved it correct, not
tried it.
-- Donald Knuth
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] PATCH: uint32_t for pointer arithmetic?
2004-09-18 21:37 ` Pavel Janík
@ 2004-09-18 22:01 ` malc
0 siblings, 0 replies; 7+ messages in thread
From: malc @ 2004-09-18 22:01 UTC (permalink / raw)
To: qemu-devel
On Sat, 18 Sep 2004, [iso-8859-2] Pavel Jan?k wrote:
> From: Sylvain Petreolle <spetreolle@yahoo.fr>
> Date: Sat, 18 Sep 2004 20:03:47 +0200 (CEST)
>
> Hi,
>
> > Pavel, were you compiling all targets ?
> > Im getting errors too if the ppc targets are enabled.
> > Using i386* targets only leads me to a successfull compilation. (as malc does)
>
> yes, I also build PPC (ppc-softmmu).
>
vl.h
void *AUD_open (void *opaque, const char *name, int freq, int nchannels, audfmt_e fmt);
oss.c
void *AUD_open (void *opaque, const char *name, int freq, int nchannels, audfmt_e fmt)
I fail to see how these can be incompatible even on PPC
--
mailto:malc@pulsesoft.com
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-09-18 22:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-18 10:31 [Qemu-devel] PATCH: uint32_t for pointer arithmetic? Pavel Janík
2004-09-18 11:10 ` malc
2004-09-18 14:25 ` Pavel Janík
2004-09-18 15:09 ` malc
2004-09-18 18:03 ` Sylvain Petreolle
2004-09-18 21:37 ` Pavel Janík
2004-09-18 22:01 ` malc
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).