[svn] dirmngr - r341 - in trunk: . src
svn author wk
cvs at cvs.gnupg.org
Sat Mar 13 10:12:28 CET 2010
Author: wk
Date: 2010-03-13 10:12:28 +0100 (Sat, 13 Mar 2010)
New Revision: 341
Modified:
trunk/NEWS
trunk/configure.ac
trunk/src/ChangeLog
trunk/src/certcache.c
trunk/src/dirmngr.c
Log:
Fix compiler warnings
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2010-03-09 13:57:55 UTC (rev 340)
+++ trunk/src/ChangeLog 2010-03-13 09:12:28 UTC (rev 341)
@@ -1,3 +1,10 @@
+2010-03-13 Werner Koch <wk at g10code.com>
+
+ * dirmngr.c (int_and_ptr_u): New.
+ (pid_suffix_callback): Trick out compiler.
+ (start_connection_thread): Ditto.
+ (handle_connections): Ditto.
+
2010-03-09 Werner Koch <wk at g10code.com>
* dirmngr.c (set_debug): Allow numerical values.
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2010-03-09 13:57:55 UTC (rev 340)
+++ trunk/NEWS 2010-03-13 09:12:28 UTC (rev 341)
@@ -9,7 +9,9 @@
* New option --ignore-cert-extension.
+ * Make use of libassuan 2.0 which is available as a DSO.
+
Noteworthy changes in version 1.0.3 (2009-06-17)
------------------------------------------------
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2010-03-09 13:57:55 UTC (rev 340)
+++ trunk/configure.ac 2010-03-13 09:12:28 UTC (rev 341)
@@ -27,8 +27,8 @@
# Remember to change the version number immediately *after* a release.
# Set my_issvn to "yes" for non-released code. Remember to run an
# "svn up" and "autogen.sh" right before creating a distribution.
-m4_define([my_version], [1.1.0rc1])
-m4_define([my_issvn], [no])
+m4_define([my_version], [1.1.0])
+m4_define([my_issvn], [yes])
m4_define([svn_revision], m4_esyscmd([printf "%d" $( (svn info 2>/dev/null \
|| echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')]))
Modified: trunk/src/certcache.c
===================================================================
--- trunk/src/certcache.c 2010-03-09 13:57:55 UTC (rev 340)
+++ trunk/src/certcache.c 2010-03-13 09:12:28 UTC (rev 341)
@@ -183,7 +183,7 @@
char numbuf[40];
len = unhexify (NULL, hexsn);
- snprintf (numbuf, sizeof numbuf, "(%u:", len);
+ snprintf (numbuf, sizeof numbuf, "(%u:", (unsigned int)len);
buffer = xtrymalloc (strlen (numbuf) + len + 2 );
if (!buffer)
return NULL;
Modified: trunk/src/dirmngr.c
===================================================================
--- trunk/src/dirmngr.c 2010-03-09 13:57:55 UTC (rev 340)
+++ trunk/src/dirmngr.c 2010-03-13 09:12:28 UTC (rev 341)
@@ -239,7 +239,18 @@
#define TIMERTICK_INTERVAL (2) /* Seconds. */
#endif
+/* This union is used to avoid compiler warnings in case a pointer is
+ 64 bit and an int 32 bit. We store an integer in a pointer and get
+ it back later (pth_key_getdata et al.). */
+union int_and_ptr_u
+{
+ int aint;
+ assuan_fd_t afd;
+ void *aptr;
+};
+
+
/* The key used to store the current file descriptor in the thread
local storage. We use this in conjunction with the
log_set_pid_suffix_cb feature.. */
@@ -576,7 +587,10 @@
static int
pid_suffix_callback (int *r_suffix)
{
- *r_suffix = (int)pth_key_getdata (my_tlskey_current_fd);
+ union int_and_ptr_u value;
+
+ value.aptr = pth_key_getdata (my_tlskey_current_fd);
+ *r_suffix = value.aint;
return (*r_suffix != -1);
}
#endif /*!HAVE_W32_SYSTEM*/
@@ -1704,13 +1718,17 @@
static void *
start_connection_thread (void *arg)
{
- assuan_fd_t fd = (assuan_fd_t) arg;
+ union int_and_ptr_u argval;
+ assuan_fd_t fd;
+ argval.aptr = arg;
+ fd = argval.afd;
+
if (check_nonce (fd, &socket_nonce))
return NULL;
#ifndef HAVE_W32_SYSTEM
- pth_key_setdata (my_tlskey_current_fd, (void*)FD2INT (fd));
+ pth_key_setdata (my_tlskey_current_fd, argval.aptr);
#endif
active_connections++;
@@ -1724,7 +1742,8 @@
active_connections--;
#ifndef HAVE_W32_SYSTEM
- pth_key_setdata (my_tlskey_current_fd, (void*)(-1));
+ argval.afd = ASSUAN_INVALID_FD;
+ pth_key_setdata (my_tlskey_current_fd, argval.aptr);
#endif
return NULL;
@@ -1827,13 +1846,18 @@
pth_sigmask (SIG_BLOCK, &sigs, &oldsigs);
/* Create thread to handle this connection. */
- if (!pth_spawn (tattr, start_connection_thread, (void*)fd))
- {
- log_error (_("error spawning connection handler: %s\n"),
- strerror (errno) );
- assuan_sock_close (fd);
- }
+ {
+ union int_and_ptr_u argval;
+ argval.afd = fd;
+ if (!pth_spawn (tattr, start_connection_thread, argval.aptr))
+ {
+ log_error (_("error spawning connection handler: %s\n"),
+ strerror (errno) );
+ assuan_sock_close (fd);
+ }
+ }
+
/* Restore the signal mask. */
pth_sigmask (SIG_SETMASK, &oldsigs, NULL);
}
More information about the Gnupg-commits
mailing list