[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/13] arctwo, md4, md5, sha1, sha256, sha512: no 'static inline'
From: |
Paul Eggert |
Subject: |
[PATCH 01/13] arctwo, md4, md5, sha1, sha256, sha512: no 'static inline' |
Date: |
Thu, 08 Nov 2012 23:47:06 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 |
[This is a first in a series of patches to omit 'inline'
when it's not needed.]
* lib/arctwo.c (to_uchar):
* lib/md4.c (set_uint32):
* lib/md5.c (set_uint32):
* lib/sha1.c (set_uint32):
* lib/sha256.c (set_uint32):
* lib/sha512.c (set_uint64):
Now static, not static inline. This is a bit simpler, and doesn't
affect performance with GCC and default optimization.
* m4/arctwo.m4 (gl_ARCTWO):
* m4/md4.m4 (gl_MD4):
* m4/md5.m4 (gl_MD5):
* m4/sha1.m4 (gl_SHA1):
* m4/sha256.m4 (gl_SHA256):
* m4/sha512.m4 (gl_SHA512):
Do not require AC_C_INLINE.
---
ChangeLog | 19 +++++++++++++++++++
lib/arctwo.c | 2 +-
lib/md4.c | 2 +-
lib/md5.c | 2 +-
lib/sha1.c | 2 +-
lib/sha256.c | 2 +-
lib/sha512.c | 2 +-
m4/arctwo.m4 | 8 ++------
m4/md4.m4 | 3 +--
m4/md5.m4 | 3 +--
m4/sha1.m4 | 3 +--
m4/sha256.m4 | 3 +--
m4/sha512.m4 | 3 +--
13 files changed, 32 insertions(+), 22 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a89dd0a..dfd70fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2012-11-08 Paul Eggert <address@hidden>
+
+ arctwo, md4, md5, sha1, sha256, sha512: no 'static inline'
+ * lib/arctwo.c (to_uchar):
+ * lib/md4.c (set_uint32):
+ * lib/md5.c (set_uint32):
+ * lib/sha1.c (set_uint32):
+ * lib/sha256.c (set_uint32):
+ * lib/sha512.c (set_uint64):
+ Now static, not static inline. This is a bit simpler, and doesn't
+ affect performance with GCC and default optimization.
+ * m4/arctwo.m4 (gl_ARCTWO):
+ * m4/md4.m4 (gl_MD4):
+ * m4/md5.m4 (gl_MD5):
+ * m4/sha1.m4 (gl_SHA1):
+ * m4/sha256.m4 (gl_SHA256):
+ * m4/sha512.m4 (gl_SHA512):
+ Do not require AC_C_INLINE.
+
2012-11-04 Paul Eggert <address@hidden>
cond, lock, thread: better 'inline'
diff --git a/lib/arctwo.c b/lib/arctwo.c
index 4404936..4cdef6f 100644
--- a/lib/arctwo.c
+++ b/lib/arctwo.c
@@ -67,7 +67,7 @@ static const uint8_t arctwo_sbox[] = {
};
/* C89 compliant way to cast 'char' to 'unsigned char'. */
-static inline unsigned char
+static unsigned char
to_uchar (char ch)
{
return ch;
diff --git a/lib/md4.c b/lib/md4.c
index 3d1c369..ccdaa8b 100644
--- a/lib/md4.c
+++ b/lib/md4.c
@@ -67,7 +67,7 @@ md4_init_ctx (struct md4_ctx *ctx)
/* Copy the 4 byte value from v into the memory location pointed to by *cp,
If your architecture allows unaligned access this is equivalent to
* (uint32_t *) cp = v */
-static inline void
+static void
set_uint32 (char *cp, uint32_t v)
{
memcpy (cp, &v, sizeof v);
diff --git a/lib/md5.c b/lib/md5.c
index 66ede23..3f564d1 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -83,7 +83,7 @@ md5_init_ctx (struct md5_ctx *ctx)
/* Copy the 4 byte value from v into the memory location pointed to by *cp,
If your architecture allows unaligned access this is equivalent to
* (uint32_t *) cp = v */
-static inline void
+static void
set_uint32 (char *cp, uint32_t v)
{
memcpy (cp, &v, sizeof v);
diff --git a/lib/sha1.c b/lib/sha1.c
index db4ab42..1f67184 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -70,7 +70,7 @@ sha1_init_ctx (struct sha1_ctx *ctx)
/* Copy the 4 byte value from v into the memory location pointed to by *cp,
If your architecture allows unaligned access this is equivalent to
* (uint32_t *) cp = v */
-static inline void
+static void
set_uint32 (char *cp, uint32_t v)
{
memcpy (cp, &v, sizeof v);
diff --git a/lib/sha256.c b/lib/sha256.c
index a8d29da..55273c6 100644
--- a/lib/sha256.c
+++ b/lib/sha256.c
@@ -90,7 +90,7 @@ sha224_init_ctx (struct sha256_ctx *ctx)
/* Copy the value from v into the memory location pointed to by *cp,
If your architecture allows unaligned access this is equivalent to
* (uint32_t *) cp = v */
-static inline void
+static void
set_uint32 (char *cp, uint32_t v)
{
memcpy (cp, &v, sizeof v);
diff --git a/lib/sha512.c b/lib/sha512.c
index cf62f20..dfb67a3 100644
--- a/lib/sha512.c
+++ b/lib/sha512.c
@@ -97,7 +97,7 @@ sha384_init_ctx (struct sha512_ctx *ctx)
/* Copy the value from V into the memory location pointed to by *CP,
If your architecture allows unaligned access, this is equivalent to
* (__typeof__ (v) *) cp = v */
-static inline void
+static void
set_uint64 (char *cp, u64 v)
{
memcpy (cp, &v, sizeof v);
diff --git a/m4/arctwo.m4 b/m4/arctwo.m4
index dc04161..c3c7124 100644
--- a/m4/arctwo.m4
+++ b/m4/arctwo.m4
@@ -1,12 +1,8 @@
-# arctwo.m4 serial 4
+# arctwo.m4 serial 5
dnl Copyright (C) 2005-2006, 2009-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Prerequisites of lib/arctwo.c.
-AC_DEFUN([gl_ARCTWO],
-[
- AC_REQUIRE([AC_C_INLINE])
- :
-])
+AC_DEFUN([gl_ARCTWO], [:])
diff --git a/m4/md4.m4 b/m4/md4.m4
index 43cd46a..8e1c279 100644
--- a/m4/md4.m4
+++ b/m4/md4.m4
@@ -1,4 +1,4 @@
-# md4.m4 serial 6
+# md4.m4 serial 7
dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,6 +8,5 @@ dnl Prerequisites of lib/md4.c.
AC_DEFUN([gl_MD4],
[
AC_REQUIRE([gl_BIGENDIAN])
- AC_REQUIRE([AC_C_INLINE])
:
])
diff --git a/m4/md5.m4 b/m4/md5.m4
index e22f7bd..85ed894 100644
--- a/m4/md5.m4
+++ b/m4/md5.m4
@@ -1,4 +1,4 @@
-# md5.m4 serial 12
+# md5.m4 serial 13
dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,6 +8,5 @@ AC_DEFUN([gl_MD5],
[
dnl Prerequisites of lib/md5.c.
AC_REQUIRE([gl_BIGENDIAN])
- AC_REQUIRE([AC_C_INLINE])
:
])
diff --git a/m4/sha1.m4 b/m4/sha1.m4
index 7619825..29fa485 100644
--- a/m4/sha1.m4
+++ b/m4/sha1.m4
@@ -1,4 +1,4 @@
-# sha1.m4 serial 10
+# sha1.m4 serial 11
dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,6 +8,5 @@ AC_DEFUN([gl_SHA1],
[
dnl Prerequisites of lib/sha1.c.
AC_REQUIRE([gl_BIGENDIAN])
- AC_REQUIRE([AC_C_INLINE])
:
])
diff --git a/m4/sha256.m4 b/m4/sha256.m4
index 78cc95e..f75a7fb 100644
--- a/m4/sha256.m4
+++ b/m4/sha256.m4
@@ -1,4 +1,4 @@
-# sha256.m4 serial 5
+# sha256.m4 serial 6
dnl Copyright (C) 2005, 2008-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,5 +8,4 @@ AC_DEFUN([gl_SHA256],
[
dnl Prerequisites of lib/sha256.c.
AC_REQUIRE([gl_BIGENDIAN])
- AC_REQUIRE([AC_C_INLINE])
])
diff --git a/m4/sha512.m4 b/m4/sha512.m4
index 937ea8d..e6e2739 100644
--- a/m4/sha512.m4
+++ b/m4/sha512.m4
@@ -1,4 +1,4 @@
-# sha512.m4 serial 6
+# sha512.m4 serial 7
dnl Copyright (C) 2005-2006, 2008-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,5 +8,4 @@ AC_DEFUN([gl_SHA512],
[
dnl Prerequisites of lib/sha512.c.
AC_REQUIRE([gl_BIGENDIAN])
- AC_REQUIRE([AC_C_INLINE])
])
--
1.7.11.7
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH 01/13] arctwo, md4, md5, sha1, sha256, sha512: no 'static inline',
Paul Eggert <=