Hi developers,
I don't have a 64-bit machine handy but would like to try to make Pd runnable on 64-bit linux... I looked in Pd-devel and saw that some, but not all, of the "%x" formatting in calls to sys_vgui() was changed to "%lx", like this:
sprintf(buf, ".x%lx", (t_int)owner);
but that most of the time, pointers are simpy fed to "%x" like this:
sys_vgui(".x%x.c focus %s\n", canvas, x->x_tag);
I think the correct thing would be as in,
sys_vgui(".x%lx.c focus %s\n", (t_int)canvas, x->x_tag);
which is to say, explicityly type "canvas" (or other pointers) to pointer-size integers and then feed to "%lx" format. But before I make this change systematically (hundreds of lines affected) I thought I should ask: do we think this is the most portable formulation?
thanks Miller
On Sat, 14 Aug 2004, Miller Puckette wrote:
Hi developers,
I don't have a 64-bit machine handy but would like to try to make Pd runnable on 64-bit linux... I looked in Pd-devel and saw that some, but not all, of the "%x" formatting in calls to sys_vgui() was changed to "%lx", like this:
sprintf(buf, ".x%lx", (t_int)owner);
but that most of the time, pointers are simpy fed to "%x" like this:
sys_vgui(".x%x.c focus %s\n", canvas, x->x_tag);
I think the correct thing would be as in,
sys_vgui(".x%lx.c focus %s\n", (t_int)canvas, x->x_tag);
which is to say, explicityly type "canvas" (or other pointers) to pointer-size integers and then feed to "%lx" format. But before I make this change systematically (hundreds of lines affected) I thought I should ask: do we think this is the most portable formulation?
Hi,
I made pd 64 bit clean for the Debian package and I tested it on my alpha. I have not checked in the changes, though.
Well, basically what I did is changing %x to %lx (for pointers this works without casts). When casts were needed I used (t_int), which I typedef'd to long, because long is the size of a pointer (don't know where this information comes from though, its true in practice, if it is a "C" standard, hmm, don't think so).
If you do not change the typedef in m_pd.h, the compiler complains about int type and long int format.
I will prepare a patch until tomorrow, if you like. Probably this would be a good occasion to import 0.38 into the CVS, I am going to reply on the CVS organisation in my next message.
Guenter
thanks Miller
PD-dev mailing list PD-dev@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-dev
Oh... and alpha's behavior might be different from athlon 64, anyway! But I think if %x to %lx works for you, I should just go through and change all my code... I've done a lot of work already on 0.38 and so patches into 0.37 code probably won't be useful.
Since there will be so many differences anyway, I'm thinking also of expanding all the tabs to spaces, because other people keep proposing code with tabs set to other than 8 chars apiece...
cheers Miller
On Sun, Aug 15, 2004 at 01:34:43PM +0200, guenter geiger wrote:
On Sat, 14 Aug 2004, Miller Puckette wrote:
Hi developers,
I don't have a 64-bit machine handy but would like to try to make Pd runnable on 64-bit linux... I looked in Pd-devel and saw that some, but not all, of the "%x" formatting in calls to sys_vgui() was changed to "%lx", like this:
sprintf(buf, ".x%lx", (t_int)owner);
but that most of the time, pointers are simpy fed to "%x" like this:
sys_vgui(".x%x.c focus %s\n", canvas, x->x_tag);
I think the correct thing would be as in,
sys_vgui(".x%lx.c focus %s\n", (t_int)canvas, x->x_tag);
which is to say, explicityly type "canvas" (or other pointers) to pointer-size integers and then feed to "%lx" format. But before I make this change systematically (hundreds of lines affected) I thought I should ask: do we think this is the most portable formulation?
Hi,
I made pd 64 bit clean for the Debian package and I tested it on my alpha. I have not checked in the changes, though.
Well, basically what I did is changing %x to %lx (for pointers this works without casts). When casts were needed I used (t_int), which I typedef'd to long, because long is the size of a pointer (don't know where this information comes from though, its true in practice, if it is a "C" standard, hmm, don't think so).
If you do not change the typedef in m_pd.h, the compiler complains about int type and long int format.
I will prepare a patch until tomorrow, if you like. Probably this would be a good occasion to import 0.38 into the CVS, I am going to reply on the CVS organisation in my next message.
Guenter
thanks Miller
PD-dev mailing list PD-dev@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-dev
On Sun, 15 Aug 2004, Miller Puckette wrote:
Oh... and alpha's behavior might be different from athlon 64, anyway! But I think if %x to %lx works for you, I should just go through and change all my code... I've done a lot of work already on 0.38 and so patches into 0.37 code probably won't be useful.
Yes, that problem would have been solved by CVS. Anyhow, if you do it on your own you can check the changes at the same time. Its some sort of meditation. I think the 64 bit issues are quite the same on athlon, but there might be additional ones. I know someone with an AMD64 whom I could ask, to be sure.
Guenter
Since there will be so many differences anyway, I'm thinking also of expanding all the tabs to spaces, because other people keep proposing code with tabs set to other than 8 chars apiece...
cheers Miller
On Sun, Aug 15, 2004 at 01:34:43PM +0200, guenter geiger wrote:
On Sat, 14 Aug 2004, Miller Puckette wrote:
Hi developers,
I don't have a 64-bit machine handy but would like to try to make Pd runnable on 64-bit linux... I looked in Pd-devel and saw that some, but not all, of the "%x" formatting in calls to sys_vgui() was changed to "%lx", like this:
sprintf(buf, ".x%lx", (t_int)owner);
but that most of the time, pointers are simpy fed to "%x" like this:
sys_vgui(".x%x.c focus %s\n", canvas, x->x_tag);
I think the correct thing would be as in,
sys_vgui(".x%lx.c focus %s\n", (t_int)canvas, x->x_tag);
which is to say, explicityly type "canvas" (or other pointers) to pointer-size integers and then feed to "%lx" format. But before I make this change systematically (hundreds of lines affected) I thought I should ask: do we think this is the most portable formulation?
Hi,
I made pd 64 bit clean for the Debian package and I tested it on my alpha. I have not checked in the changes, though.
Well, basically what I did is changing %x to %lx (for pointers this works without casts). When casts were needed I used (t_int), which I typedef'd to long, because long is the size of a pointer (don't know where this information comes from though, its true in practice, if it is a "C" standard, hmm, don't think so).
If you do not change the typedef in m_pd.h, the compiler complains about int type and long int format.
I will prepare a patch until tomorrow, if you like. Probably this would be a good occasion to import 0.38 into the CVS, I am going to reply on the CVS organisation in my next message.
Guenter
thanks Miller
PD-dev mailing list PD-dev@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-dev
PD-dev mailing list PD-dev@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-dev
On Sat, 14 Aug 2004, Miller Puckette wrote:
I don't have a 64-bit machine handy but would like to try to make Pd runnable on 64-bit linux... I looked in Pd-devel and saw that some, but not all, of the "%x" formatting in calls to sys_vgui() was changed to "%lx", like this: sprintf(buf, ".x%lx", (t_int)owner); but that most of the time, pointers are simpy fed to "%x" like this: sys_vgui(".x%x.c focus %s\n", canvas, x->x_tag); I think the correct thing would be as in, sys_vgui(".x%lx.c focus %s\n", (t_int)canvas, x->x_tag);
But before I make this change systematically (hundreds of lines affected) I thought I should ask: do we think this is the most portable formulation?
Have you considered %p ?
________________________________________________________________ Mathieu Bouchard http://artengine.ca/matju
Much better. %p it is. Now to see if Microsoft Visual C can deal with it....
cheers MIller
On Mon, Aug 16, 2004 at 10:37:17AM -0400, Mathieu Bouchard wrote:
On Sat, 14 Aug 2004, Miller Puckette wrote:
I don't have a 64-bit machine handy but would like to try to make Pd runnable on 64-bit linux... I looked in Pd-devel and saw that some, but not all, of the "%x" formatting in calls to sys_vgui() was changed to "%lx", like this: sprintf(buf, ".x%lx", (t_int)owner); but that most of the time, pointers are simpy fed to "%x" like this: sys_vgui(".x%x.c focus %s\n", canvas, x->x_tag); I think the correct thing would be as in, sys_vgui(".x%lx.c focus %s\n", (t_int)canvas, x->x_tag);
But before I make this change systematically (hundreds of lines affected) I thought I should ask: do we think this is the most portable formulation?
Have you considered %p ?
Mathieu Bouchard http://artengine.ca/matju
PD-dev mailing list PD-dev@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-dev