Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: "Niki W. Waibel" <niki.waibel@newlogic.com>
To: Robert Williams <bob@bob.usuhs.mil>
Cc: axp-list@redhat.com
Subject: RE: Porting issue: 32 to 64 bit pointer conversions
Date: Fri, 06 Oct 2000 17:26:41 +0200 (MEST)	[thread overview]
Message-ID: <XFMail.001006172641.niki.waibel@newlogic.com> (raw)
In-Reply-To: <39DDC987.5DC049F4@bob.usuhs.mil>

hi,

i am currently porting glidev2.
there are also a lot of troubles with pointer <-> int conversions.
i defined
  __64BIT_POINTER
and
  __64BIT_LONG
for the compilation on alpha.
(you have to pass -D__64BIT_POINTER and -D__64BIT_LONG to gcc).

then i compiled - checked where the warnings came from and inserted
#ifndef __64BIT_POINTER
   /* old (32bit) code */
#else
   /* new (64bit) code */
#endif
this way the programm compiles normal on 32bit cpus and with the new code
on 64bit cpus.
the __64BIT_LONG is defined because for example on sparc cpus
long is 32 bit and 'long long' is 64bit.
on alpha: long = 64bit and 'long long' is also 64bit.

hope this helps, niki


On 06-Oct-00 Robert Williams wrote:
> I'm trying to port malsync ( http://www.tomw.org/malsync/ )
> to the alpha.  There appear to be some 64 bit issues.
> The distributed code doesn't work on alpha.
> 
> My question:
> What is the best way to handle
> 64 bit pointer to 32 bit integer conversions:
> 
> The complaint:
> 
> MAL31DBConfig.c: In function `MAL31DBConfigWriteData':
> MAL31DBConfig.c:68: warning: cast from pointer to integer of different
> size
> 
> The code:
> 
> 65       count = AGArrayCount(dbconfig->newids);
> 66        AGWriteCompactInt(w, count);
> 67        for(i = 0; i < count; i++)
> 68              AGWriteInt32(w, (uint32)(this is a
> long)AGArrayElementAt(dbconfig->newids, i));
> 
> Bob Williams




  reply	other threads:[~2000-10-06 15:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-06 12:45 Porting issue: 32 to 64 bit pointer conversions Robert Williams
2000-10-06 15:26 ` Niki W. Waibel [this message]
2000-10-06 16:01   ` Robert Williams
2000-10-06 16:12     ` Chris Eleveld (Sector 7 Group)
2000-10-06 17:09       ` Michal Jaegermann
2000-10-06 18:31         ` Matt Wilson
2000-10-06 20:20         ` Robert Williams
2000-10-06 21:28           ` Matt Wilson
2000-10-06 21:47           ` Michal Jaegermann
2000-10-07 16:15         ` Brad Lucier
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox