From: Jonathan McDowell Date: Mon, 31 May 2004 23:48:26 +0000 (+0000) Subject: cscvs to tla changeset 134 X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/commitdiff_plain/08de0b57479d159b443adfee3e0e3b5bfcc4bbd1?ds=sidebyside;hp=b3e534f945ae56605bc5309e7c5af020c797a69b cscvs to tla changeset 134 Author: noodles Date: 2004/05/27 22:02:05 Fix various preprocessor warnings. --- diff --git a/Makefile b/Makefile index 733daf4..fee9fde 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # # Makefile for onak. # -# $Id: Makefile,v 1.20 2004/05/27 03:33:24 noodles Exp $ +# $Id: Makefile,v 1.21 2004/05/27 22:02:05 noodles Exp $ # CC = gcc @@ -10,7 +10,7 @@ CFLAGS += -Wall -pedantic -g -I/usr/local/include # Uncomment to enable profiling. #LDFLAGS += -pg # Can be "pg" for Postgresql, "file" for flat files or "db2" for pksd db2 style. -DBTYPE = fs +DBTYPE = db3 # If using DBTYPE of "file" then comment the following line out. #LIBS = -L/usr/local/lib -lpq LIBS = -L/usr/local/lib -ldb3 @@ -22,7 +22,7 @@ CORE_OBJS = armor.o charfuncs.o decodekey.o getcgi.o hash.o keydb_$(DBTYPE).o \ OBJS = merge.o stats.o sendsync.o $(CORE_OBJS) SRCS = armor.c parsekey.c merge.c keyid.c md5.c sha.c main.c getcgi.c stats.c \ keyindex.c mem.c lookup.c add.c keydb_$(DBTYPE).c ll.c hash.c \ - gpgwww.c onak-conf.c charfuncs.c sendsync.c log.c photoid.c wordlist.o + gpgwww.c onak-conf.c charfuncs.c sendsync.c log.c photoid.c wordlist.c all: .depend $(PROGS) testparse maxpath sixdegrees splitkeys diff --git a/md5.c b/md5.c index 7673af2..5a0785d 100644 --- a/md5.c +++ b/md5.c @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Id: md5.c,v 1.3 2003/10/04 10:21:41 noodles Exp $ + * $Id: md5.c,v 1.4 2004/05/27 22:02:05 noodles Exp $ */ /* Written by Ulrich Drepper , 1995. */ /* heavily modified for GnuPG by */ @@ -264,12 +264,12 @@ void md5_final( MD5_CONTEXT *hd ) /*#define X(a) do { *(u32*)p = hd->##a ; p += 4; } while(0)*/ /* Unixware's cpp doesn't like the above construct so we do it his way: * (reported by Allan Clark) */ - #define X(a) do { *(unsigned int *)p = (*hd).a ; p += 4; } while(0) +#define X(a) do { *(unsigned int *)p = (*hd).a ; p += 4; } while(0) X(A); X(B); X(C); X(D); - #undef X +#undef X } diff --git a/sha.c b/sha.c index 90f22e8..1625cda 100644 --- a/sha.c +++ b/sha.c @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: sha.c,v 1.2 2003/06/04 20:57:12 noodles Exp $ + * $Id: sha.c,v 1.3 2004/05/27 22:02:06 noodles Exp $ */ /* This file was copied from GnuPG */ @@ -64,9 +64,9 @@ static void transform( SHA1_CONTEXT *hd, uint8_t *data ) d = hd->h3; e = hd->h4; - #ifdef BIG_ENDIAN_HOST +#ifdef BIG_ENDIAN_HOST memcpy( x, data, 64 ); - #else +#else { int i; uint8_t *p2; for(i=0, p2=(unsigned char*)x; i < 16; i++, p2 += 4 ) { @@ -76,7 +76,7 @@ static void transform( SHA1_CONTEXT *hd, uint8_t *data ) p2[0] = *data++; } } - #endif +#endif #define K1 0x5A827999L @@ -273,18 +273,18 @@ void sha1_final(SHA1_CONTEXT *hd) transform( hd, hd->buf ); p = hd->buf; - #ifdef BIG_ENDIAN_HOST - #define X(a) do { *(uint32_t *)p = hd->h##a ; p += 4; } while(0) - #else /* little endian */ - #define X(a) do { *p++ = hd->h##a >> 24; *p++ = hd->h##a >> 16; \ +#ifdef BIG_ENDIAN_HOST +#define X(a) do { *(uint32_t *)p = hd->h##a ; p += 4; } while(0) +#else /* little endian */ +#define X(a) do { *p++ = hd->h##a >> 24; *p++ = hd->h##a >> 16; \ *p++ = hd->h##a >> 8; *p++ = hd->h##a; } while(0) - #endif +#endif X(0); X(1); X(2); X(3); X(4); - #undef X +#undef X }