From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id 8852230738 for ; Fri, 6 Oct 2000 11:26:57 -0400 (EDT) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id e96FQv907008 for axp-list@listman.redhat.com; Fri, 6 Oct 2000 11:26:57 -0400 Received: from enterprise2.newlogic.com (enterprise2.newlogic.at [194.208.88.1]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id e96FQuD07004 for ; Fri, 6 Oct 2000 11:26:56 -0400 Received: from ultra80-1.newlogic.at (ultra80-1.newlogic.at [194.208.88.81]) by enterprise2.newlogic.com (8.9.2/8.9.2) with ESMTP id RAA17271; Fri, 6 Oct 2000 17:26:49 +0200 (MET DST) Received: (from nwaibel@localhost) by ultra80-1.newlogic.at (8.9.3+Sun/8.9.3) id RAA29563; Fri, 6 Oct 2000 17:26:41 +0200 (MEST) Message-ID: X-Mailer: XFMail 1.2 [p0] on Solaris X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <39DDC987.5DC049F4@bob.usuhs.mil> Date: Fri, 06 Oct 2000 17:26:41 +0200 (MEST) From: "Niki W. Waibel" To: Robert Williams Subject: RE: Porting issue: 32 to 64 bit pointer conversions Cc: axp-list@redhat.com X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0beta4 Precedence: bulk Reply-To: axp-list@redhat.com List-Id: Linux and Red Hat on Alpha processors 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