thegooglecodearchive / sfepy

Automatically exported from code.google.com/p/sfepy
0 stars 0 forks source link

fix C types for 64bit architectures #72

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Having

sfepy/fem/extmods/types.h - typedef int int32;

causes that nm.int32 cannot be used where it should (have to use int).

Original issue reported on code.google.com by robert.c...@gmail.com on 18 Dec 2008 at 12:12

GoogleCodeExporter commented 9 years ago
Which is the lesser of the two evils?:

typedef int int32
typedef long int32

"cannot be used where it should" - please elaborate.

Original comment by freevryh...@gmail.com on 18 May 2010 at 4:03

GoogleCodeExporter commented 9 years ago
The definition as it is now causes the int32 in C to be, in fact, int64 on 64bit
machines, so it is not possible to pass nm.int32 arrays into C int32 arrays 
(which
are, in fact int64...). Instead, we have to use nm.int arrays, whose bit width 
follow
the C int bit width.

The correct way is to make sure the C int32 is really 32 bits no matter what
architecture.

As numpy guys surely know how to do this in a portable way, and we depend on 
numpy
headers anyway, an easy solution might be to use int32 from the numpy headers.

Original comment by robert.c...@gmail.com on 18 May 2010 at 1:08

GoogleCodeExporter commented 9 years ago
Done!

Original comment by robert.c...@gmail.com on 21 Oct 2011 at 9:15

GoogleCodeExporter commented 9 years ago
Migrated to http://github.com/sfepy/sfepy/issues/76

Original comment by robert.c...@gmail.com on 30 Jan 2012 at 10:25