Re: Towards 64bit DataHandles

On Sat, 21 Jan 2006, Stefan Westerfeld wrote:


the most part of the patch is trivial and can go in.

Index: sfi/sfitypes.h
RCS file: /cvs/gnome/beast/sfi/sfitypes.h,v
retrieving revision 1.17
diff -u -p -r1.17 sfitypes.h
--- sfi/sfitypes.h	20 May 2004 12:23:17 -0000	1.17
+++ sfi/sfitypes.h	20 Jan 2006 20:19:48 -0000
@@ -25,14 +25,30 @@ G_BEGIN_DECLS

/* --- Sfi typedefs --- */
+/* 64 bit types - FIXME: assert in configure script that sizeof (long long) == 8 */
+typedef long long               sfi_int64;
+typedef unsigned long long      sfi_uint64;
+#define SFI_MININT64            (0x8000000000000000LL)
+#define SFI_MAXINT64            (0x7fffffffffffffffLL)
+#define SFI_MAXUINT64           (0xffffffffffffffffULL)
+#if (1) /* internal: do not make these available when compiling third party code */
+#define int64                   sfi_int64
+#define uint64                  sfi_uint64
+#define MININT64                SFI_MININT64
+#define MAXINT64                SFI_MAXINT64
+#define MAXUINT64               SFI_MAXUINT64

eek, the above is a mess, but can go in as a temporary measure
(albeit with as little definitions/typedefs as possible) until
i commit a wider range of new typedefs.
also, you should decide on what constants you want, in the above
code, you used G_MAXINT64, and here you define SFI_MAXINT64 and
MAXINT64, allthough we already have SFI_MAXNUM.

best is probably to keep using G_MAXINT64 and not define SFI_MAXINT64
or MAXINT64 at all.

typedef gboolean		SfiBool;
typedef gint			SfiInt;
#define	SFI_MAXINT		(+2147483647)
#define	SFI_MININT		(-SFI_MAXINT - 1)
-typedef gint64			SfiNum;
-#define	SFI_MAXNUM		((SfiNum) +9223372036854775807LL)
-#define	SFI_MINNUM		(-SFI_MAXNUM - 1)
-typedef gint64			SfiTime;
+typedef sfi_int64		SfiNum;
+typedef sfi_int64		SfiTime;

but please don't mess with the existing definition, touvhing this
code is entirely unneccessary for your changes.

typedef SfiInt			SfiNote;
typedef gdouble			SfiReal;
#define SFI_MINREAL		(2.2250738585072014e-308)	/* IEEE754 double */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]