[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Cvs-dev] C89 vs OpenPGP need for 'long long'
From: |
Mark D. Baushke |
Subject: |
[Cvs-dev] C89 vs OpenPGP need for 'long long' |
Date: |
Wed, 24 May 2006 02:07:17 -0700 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Folks,
The Windows platform apparently does not support a 'long long' type:
.\src\log.c(1710) : error C2632: 'long' followed by 'long' is illegal
.\src\log.c(1710) : warning C4244: 'initializing' : conversion from 'unsigned
__int64 ' to 'unsigned long ', possible loss of data
However, it appears that the current top-of-tree sources are using both
'long long' and 'unsigned long long' now. It should be noted that C89
supports
integral types:
char
signed char
unsigned char
short, signed short, short int, signed short int
unsigned short, or unsigned short int
int, signed, signed int
unsigned, unsigned int
long, signed long, long int, signed long int
unsigned long, unsigned long int
The extended types:
long long, signed long long
unsigned long long
are extensions introduced by C99.
As a part of our sources, we have a HAVE_LONG_LONG macro and a
HAVE_UNSIGNED_LONG_LONG macro.
The typical method of dealing with a 64-bit quantity in C89 is to use a
structure to keep the high and the low part of the integer and use
functions to do the math on them.
How do you think we should address this situation?
-- Mark
% grep -R 'long long' src
src/rcs.c: finfo->fullname, rev, (unsigned long long)keyid);
src/rcs.c: char *hexid1 = Xasprintf ("0x%llx", (unsigned long long) keyid);
src/rcs.c: char *hexid2 = Xasprintf ("0x%llx", (unsigned long long)
sig.keyid);
src/rcs.c: char *hexid = Xasprintf ("0x%llx", (unsigned long long) keyid);
src/sign.c: long long tmp;
src/subr.c: length = sizeof (long long);
src/subr.c: case sizeof(long long):
src/subr.c: long long arg_long_long = va_arg (args, long
long);
src/ChangeLog: * ls.c (dircount): s/long long/long/ for Windows.
src/log.c: unsigned long long printablesig = sig.keyid & 0xFFFFFFFF;
%
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (FreeBSD)
iD8DBQFEdCJFCg7APGsDnFERAjvgAKCYZCk12XDja1e66djrIbrLrXJYAwCfbgN9
c7GeqH4HqAF7/ptjin3Qys0=
=5yrm
-----END PGP SIGNATURE-----
- [Cvs-dev] C89 vs OpenPGP need for 'long long',
Mark D. Baushke <=