updates.
authorPekka Riikonen <priikone@silcnet.org>
Tue, 3 Apr 2001 19:17:05 +0000 (19:17 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 3 Apr 2001 19:17:05 +0000 (19:17 +0000)
CHANGES
TODO
acconfig.h
apps/silc/clientconfig.c
configure.in.pre
includes/silcincludes.h

diff --git a/CHANGES b/CHANGES
index 7976d137ad530b3420c8971d131ea5dc3dfd6ae1..6f092368ff366bcecc5c841c717c7a4fbf1d67ad 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+Tue Apr  3 21:52:42 EEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
+
+       * Defined uint8, int8, uint16, int16, uint32, int32, uint64 and
+         int64 of at least the xintXX size.  If void * is less that 4
+         bytes uint32 * will be used.  Defined bool as boolean.
+
 Tue Apr  3 16:39:19 EEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
 
        * Implemented the sending of the SERVER_SIGNOFF notify in the
diff --git a/TODO b/TODO
index f0871b358508113bb9cfb2c9f49d1f8114476d87..f69b4ef64a406cbe44f2aec8e80fc9f576a8b384 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,13 +1,3 @@
-TODO General
-============
-
- o We should replace all short, int, long, unsigned short, unsigned int,
-   unsigned long with some pre-defined datatypes that really are what
-   we want on all platforms.  int16, uint16, int32, uint32 etc. are
-   what we could use or maybe SilcInt16, SilcUInt16 etc.  Also, boolean
-   datatype should be defined.
-
-
 TODO/bugs In SILC Client Library
 ================================
 
index 17c67b0e4877211b6c5c30fc20b2620db7354db9..76a52fb3330476c0b124b1eecbf29ce0f5b56b72 100644 (file)
 #undef HAVE_RTLD_NOW
 #undef HAVE_RTLD_LAZY
 
+/* Types */
+#undef SILC_SIZEOF_LONG_LONG
+#undef SILC_SIZEOF_LONG
+#undef SILC_SIZEOF_INT
+#undef SILC_SIZEOF_SHORT
+#undef SILC_SIZEOF_CHAR
+#undef SILC_SIZEOF_VOID_P
+
 /* Redefs for SOCKS5 library */
 #undef SOCKS
 #undef SOCKS5
index ed7e4b7a0f72f70e124995af04de1a53f348bc3e..6834ddb369b7c8fe18d75505ca8e081415d087e2 100644 (file)
@@ -97,7 +97,7 @@ int silc_client_config_parse(SilcClientConfig config, SilcBuffer buffer,
                             SilcClientConfigParse *return_config)
 {
   int i, begin;
-  unsigned int linenum;
+  int linenum;
   char line[1024], *cp;
   SilcClientConfigSection *cptr = NULL;
   SilcClientConfigParse parse = *return_config, first = NULL;
index f8d93555b2065b8f990622255a48d98e38fcdf88..ef6b11a0a4d4165b73c4dc69ad874016d9299186 100644 (file)
@@ -80,6 +80,19 @@ AC_TYPE_MODE_T
 AC_TYPE_UID_T
 AC_TYPE_PID_T
 
+AC_CHECK_SIZEOF(long long, 0)
+AC_DEFINE_UNQUOTED(SILC_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long)
+AC_CHECK_SIZEOF(long, 0)
+AC_DEFINE_UNQUOTED(SILC_SIZEOF_LONG, $ac_cv_sizeof_long)
+AC_CHECK_SIZEOF(int, 0)
+AC_DEFINE_UNQUOTED(SILC_SIZEOF_INT, $ac_cv_sizeof_int)
+AC_CHECK_SIZEOF(short, 0)
+AC_DEFINE_UNQUOTED(SILC_SIZEOF_SHORT, $ac_cv_sizeof_short)
+AC_CHECK_SIZEOF(char, 0)
+AC_DEFINE_UNQUOTED(SILC_SIZEOF_CHAR, $ac_cv_sizeof_char)
+AC_CHECK_SIZEOF(void *, 0)
+AC_DEFINE_UNQUOTED(SILC_SIZEOF_VOID_P, $ac_cv_sizeof_void_p)
+
 # Function checking
 AC_CHECK_FUNCS(chmod stat fstat getenv putenv strerror ctime gettimeofday)
 AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid)
index 09da825b65a76b5fa4ef3771f70c8c67405716a6..224525d5887fd4f81576604c983cff119e8d32cb 100644 (file)
 #define FALSE 0
 #endif
 
+/* Define types. The types must be at least of the specified size */
+#undef uint8
+#undef uint16
+#undef uint32
+#undef uin64
+#undef int8
+#undef int16
+#undef int32
+#undef int64
+
+typedef unsigned char uint8;
+typedef signed char int8;
+
+#if SILC_SIZEOF_SHORT > 2
+#error "size of the short must be 2 bytes"
+#endif
+
+typedef unsigned short uint16;
+typedef signed short int16;
+
+#if SILC_SIZEOF_LONG == 4
+typedef unsigned long uint32;
+typedef signed long int32;
+#else
+#if SILC_SIZEOF_INT == 4
+typedef unsigned long uint32;
+typedef signed long int32;
+#else
+#if SILC_SIZEOF_LONG_LONG >= 4
+typedef unsigned long long uint32;
+typedef signed long long int32;
+#endif
+#endif
+#endif
+
+#if SILC_SIZEOF_LONG >= 8
+typedef unsigned long uint64;
+typedef signed long int64;
+#else
+#if SILC_SIZEOF_LONG_LONG >= 8
+typedef unsigned long long uint64;
+typedef signed long long int64;
+#else
+typedef uint32 uint64;
+typedef int32 int64;
+#endif
+#endif
+
+#if SILC_SIZEOF_VOID_P < 4
+typedef uint32 * void *;
+#endif
+
+#ifndef bool
+#define bool unsigned char
+#endif
+
 /* Generic global SILC includes */
 #include "bitmove.h"