[svn] gcry - r1130 - trunk/src
svn author mo
cvs at cvs.gnupg.org
Sun Oct 16 11:02:41 CEST 2005
Author: mo
Date: 2005-10-16 11:02:41 +0200 (Sun, 16 Oct 2005)
New Revision: 1130
Modified:
trunk/src/ChangeLog
trunk/src/global.c
Log:
2005-10-16 Moritz Schulte <moritz at g10code.com>
* global.c (global_init): Use gcry_error_t instead of
gcry_err_code_t; use goto instead of if constructs.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2005-10-16 08:46:06 UTC (rev 1129)
+++ trunk/src/ChangeLog 2005-10-16 09:02:41 UTC (rev 1130)
@@ -1,5 +1,8 @@
2005-10-16 Moritz Schulte <moritz at g10code.com>
+ * global.c (global_init): Use gcry_error_t instead of
+ gcry_err_code_t; use goto instead of if constructs.
+
* stdmem.c: Inserted description of the layered memory management
in Libgcrypt.
Modified: trunk/src/global.c
===================================================================
--- trunk/src/global.c 2005-10-16 08:46:06 UTC (rev 1129)
+++ trunk/src/global.c 2005-10-16 09:02:41 UTC (rev 1130)
@@ -58,27 +58,36 @@
static void
global_init (void)
{
- gcry_err_code_t err = GPG_ERR_NO_ERROR;
+ gcry_error_t err = 0;
if (any_init_done)
return;
any_init_done = 1;
err = ath_init ();
- if (! err)
- err = _gcry_cipher_init ();
- if (! err)
- err = _gcry_md_init ();
- if (! err)
- err = _gcry_pk_init ();
+ if (err)
+ goto fail;
+ err = _gcry_cipher_init ();
+ if (err)
+ goto fail;
+ err = _gcry_md_init ();
+ if (err)
+ goto fail;
+ err = _gcry_pk_init ();
+ if (err)
+ goto fail;
#if 0
- if (! err)
- err = _gcry_ac_init ();
+ /* FIXME? */
+ err = _gcry_ac_init ();
+ if (err)
+ goto fail;
#endif
- if (err)
- /* FIXME? */
- BUG ();
+ return;
+
+ fail:
+ /* FIXME: use `err'? */
+ BUG ();
}
More information about the Gnupg-commits
mailing list