[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-177-gdb8ae36
by Werner Koch
cvs at cvs.gnupg.org
Mon Mar 16 11:53:26 CET 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU crypto library".
The branch, master has been updated
via db8ae3616987fa288173446398a107e31e2e28aa (commit)
via f0f60c1a04d664936bcf52e8f46705bdc63e7ad9 (commit)
from 97db8e1a6400d711da65eff93bb418cf55bba12e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit db8ae3616987fa288173446398a107e31e2e28aa
Author: Werner Koch <wk at gnupg.org>
Date: Mon Mar 16 11:50:23 2015 +0100
Use well defined type instead of size_t in secmem.c
* src/secmem.c (ptr_into_pool_p): Replace size_t by uintptr_t.
--
This is more or less cosmetic.
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/src/secmem.c b/src/secmem.c
index df15df0..d75c14c 100644
--- a/src/secmem.c
+++ b/src/secmem.c
@@ -105,14 +105,13 @@ static int
ptr_into_pool_p (const void *p)
{
/* We need to convert pointers to addresses. This is required by
- C-99 6.5.8 to avoid undefined behaviour. Using size_t is at
- least only implementation defined. See also
+ C-99 6.5.8 to avoid undefined behaviour. See also
http://lists.gnupg.org/pipermail/gcrypt-devel/2007-February/001102.html
*/
- size_t p_addr = (size_t)p;
- size_t pool_addr = (size_t)pool;
+ uintptr_t p_addr = (uintptr_t)p;
+ uintptr_t pool_addr = (uintptr_t)pool;
- return p_addr >= pool_addr && p_addr < pool_addr+pool_size;
+ return p_addr >= pool_addr && p_addr < pool_addr + pool_size;
}
/* Update the stats. */
commit f0f60c1a04d664936bcf52e8f46705bdc63e7ad9
Author: Werner Koch <wk at gnupg.org>
Date: Mon Mar 16 11:32:07 2015 +0100
Make uintptr_t global available.
* cipher/bufhelp.h: Move include for uintptr_t to ...
* src/types.h: here. Check that config.h has been included.
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/cipher/bithelp.h b/cipher/bithelp.h
index 2220bc8..258ab2f 100644
--- a/cipher/bithelp.h
+++ b/cipher/bithelp.h
@@ -4,7 +4,7 @@
* This file is part of Libgcrypt.
*
* Libgcrypt is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser general Public License as
+ * it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
@@ -14,11 +14,10 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef G10_BITHELP_H
-#define G10_BITHELP_H
+#ifndef GCRYPT_BITHELP_H
+#define GCRYPT_BITHELP_H
#include "types.h"
@@ -122,4 +121,4 @@ _gcry_ctz64(u64 x)
#endif /*HAVE_U64_TYPEDEF*/
-#endif /*G10_BITHELP_H*/
+#endif /*GCRYPT_BITHELP_H*/
diff --git a/cipher/bufhelp.h b/cipher/bufhelp.h
index a372acb..c6bedc5 100644
--- a/cipher/bufhelp.h
+++ b/cipher/bufhelp.h
@@ -4,7 +4,7 @@
* This file is part of Libgcrypt.
*
* Libgcrypt is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser general Public License as
+ * it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
@@ -14,21 +14,11 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef G10_BUFHELP_H
-#define G10_BUFHELP_H
+#ifndef GCRYPT_BUFHELP_H
+#define GCRYPT_BUFHELP_H
-#include <config.h>
-
-#ifdef HAVE_STDINT_H
-# include <stdint.h> /* uintptr_t */
-#elif defined(HAVE_INTTYPES_H)
-# include <inttypes.h>
-#else
-/* In this case, uintptr_t is provided by config.h. */
-#endif
#include "bithelp.h"
@@ -409,4 +399,4 @@ static inline void buf_put_le64(void *_buf, u64 val)
#endif /*BUFHELP_FAST_UNALIGNED_ACCESS*/
-#endif /*G10_BITHELP_H*/
+#endif /*GCRYPT_BUFHELP_H*/
diff --git a/src/types.h b/src/types.h
index 561b74d..dcdba4f 100644
--- a/src/types.h
+++ b/src/types.h
@@ -21,6 +21,9 @@
#ifndef GCRYPT_TYPES_H
#define GCRYPT_TYPES_H
+#ifndef _GCRYPT_CONFIG_H_INCLUDED
+# error config.h must be included before types.h
+#endif
/* The AC_CHECK_SIZEOF() in configure fails for some machines.
* we provide some fallback values here */
@@ -40,6 +43,16 @@
#include <sys/types.h>
+/* Provide uintptr_t */
+#ifdef HAVE_STDINT_H
+# include <stdint.h> /* uintptr_t */
+#elif defined(HAVE_INTTYPES_H)
+# include <inttypes.h>
+#else
+/* In this case, uintptr_t is provided by config.h. */
+#endif
+
+
#ifndef HAVE_BYTE_TYPEDEF
# undef byte /* In case there is a macro with that name. */
-----------------------------------------------------------------------
Summary of changes:
cipher/bithelp.h | 11 +++++------
cipher/bufhelp.h | 20 +++++---------------
src/secmem.c | 9 ++++-----
src/types.h | 13 +++++++++++++
4 files changed, 27 insertions(+), 26 deletions(-)
hooks/post-receive
--
The GNU crypto library
http://git.gnupg.org
_______________________________________________
Gnupg-commits mailing list
Gnupg-commits at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits
More information about the Gcrypt-devel
mailing list