[dovecot-cvs] dovecot/src/lib compat.h,1.8,1.9 hostpid.c,1.2,1.3 lib.h,1.8,1.9 strfuncs.c,1.17,1.18 strfuncs.h,1.8,1.9
cras at procontrol.fi
cras at procontrol.fi
Tue Nov 26 15:07:55 EET 2002
Update of /home/cvs/dovecot/src/lib
In directory danu:/tmp/cvs-serv25042/src/lib
Modified Files:
compat.h hostpid.c lib.h strfuncs.c strfuncs.h
Log Message:
Renamed largest_t to uintmax_t which already exists in C99.
Index: compat.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/compat.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- compat.h 4 Nov 2002 05:20:42 -0000 1.8
+++ compat.h 26 Nov 2002 13:07:53 -0000 1.9
@@ -17,12 +17,16 @@
# error uoff_t size not set
#endif
-#if defined (LARGEST_T_LONG)
-typedef unsigned long largest_t;
-#elif defined (LARGEST_T_LONG_LONG)
-typedef unsigned long long largest_t;
-#else
-# error largest_t size not set
+#ifndef HAVE_UINTMAX_T
+# if SIZEOF_LONG_LONG > 0
+typedef unsigned long long uintmax_t;
+# else
+typedef unsigned long uintmax_t;
+# endif
+#endif
+
+#ifndef HAVE_SOCKLEN_T
+typedef int socklen_t;
#endif
/* memmove() */
Index: hostpid.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/hostpid.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hostpid.c 8 Sep 2002 11:36:03 -0000 1.2
+++ hostpid.c 26 Nov 2002 13:07:53 -0000 1.3
@@ -33,7 +33,7 @@
void hostpid_init(void)
{
- static char hostname[256], pid[MAX_LARGEST_T_STRLEN];
+ static char hostname[256], pid[MAX_INT_STRLEN];
if (my_hostname == NULL) {
hostname[sizeof(hostname)-1] = '\0';
Index: lib.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/lib.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- lib.h 13 Oct 2002 23:49:11 -0000 1.8
+++ lib.h 26 Nov 2002 13:07:53 -0000 1.9
@@ -13,6 +13,10 @@
#include <errno.h> /* error checking is good */
#include <sys/types.h> /* many other includes want this */
+#ifdef HAVE_STDINT_H
+# include <stdint.h> /* C99 int types, we mostly need uintmax_t */
+#endif
+
typedef struct _IOLoop *IOLoop;
typedef struct _IO *IO;
typedef struct _Timeout *Timeout;
Index: strfuncs.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/strfuncs.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- strfuncs.c 4 Nov 2002 05:33:48 -0000 1.17
+++ strfuncs.c 26 Nov 2002 13:07:53 -0000 1.18
@@ -883,7 +883,7 @@
}
static size_t dec2str_recurse(char *buffer, size_t pos, size_t size,
- largest_t number)
+ uintmax_t number)
{
if (number == 0)
return 0;
@@ -894,7 +894,7 @@
return pos + 1;
}
-void dec2str(char *buffer, size_t size, largest_t number)
+void dec2str(char *buffer, size_t size, uintmax_t number)
{
size_t pos;
Index: strfuncs.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/strfuncs.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- strfuncs.h 4 Nov 2002 05:33:48 -0000 1.8
+++ strfuncs.h 26 Nov 2002 13:07:53 -0000 1.9
@@ -55,8 +55,8 @@
const char *t_strjoin_replace(char *const args[], char separator,
int replacearg, const char *replacedata);
-#define MAX_LARGEST_T_STRLEN ((sizeof(largest_t) * CHAR_BIT + 2) / 3 + 1)
-void dec2str(char *buffer, size_t size, largest_t number);
+#define MAX_INT_STRLEN ((sizeof(uintmax_t) * CHAR_BIT + 2) / 3 + 1)
+void dec2str(char *buffer, size_t size, uintmax_t number);
/* INTERNAL */
const char *temp_strconcat(const char *str1, va_list args, size_t *ret_len);
More information about the dovecot-cvs
mailing list