commit 5988e42: [Minor] Fight lost: alignof -> _Alignof

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Jul 9 11:56:04 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-07-09 12:53:30 +0100
URL: https://github.com/rspamd/rspamd/commit/5988e42fbf670eae5d3839e517915917d45a7ec2 (HEAD -> master)

[Minor] Fight lost: alignof -> _Alignof

---
 src/libcryptobox/cryptobox.c | 10 +++++-----
 src/libserver/re_cache.c     |  2 +-
 src/libutil/multipattern.c   |  4 ++--
 src/lua/lua_cryptobox.c      |  4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/libcryptobox/cryptobox.c b/src/libcryptobox/cryptobox.c
index c8560925d..0a3939e54 100644
--- a/src/libcryptobox/cryptobox.c
+++ b/src/libcryptobox/cryptobox.c
@@ -576,7 +576,7 @@ static gsize
 rspamd_cryptobox_auth_ctx_len (enum rspamd_cryptobox_mode mode)
 {
 	if (G_LIKELY (mode == RSPAMD_CRYPTOBOX_MODE_25519)) {
-		return sizeof (crypto_onetimeauth_state) + alignof (crypto_onetimeauth_state);
+		return sizeof (crypto_onetimeauth_state) + _Alignof (crypto_onetimeauth_state);
 	}
 	else {
 #ifndef HAVE_USABLE_OPENSSL
@@ -1429,13 +1429,13 @@ rspamd_cryptobox_hash_init (void *p, const guchar *key, gsize keylen)
 {
 	if (key != NULL && keylen > 0) {
 		crypto_generichash_blake2b_state *st = cryptobox_align_ptr (p,
-				alignof(crypto_generichash_blake2b_state));
+				_Alignof(crypto_generichash_blake2b_state));
 		crypto_generichash_blake2b_init (st, key, keylen,
 				crypto_generichash_blake2b_BYTES_MAX);
 	}
 	else {
 		crypto_generichash_blake2b_state *st = cryptobox_align_ptr (p,
-				alignof(crypto_generichash_blake2b_state));
+				_Alignof(crypto_generichash_blake2b_state));
 		crypto_generichash_blake2b_init (st, key, keylen,
 				crypto_generichash_blake2b_BYTES_MAX);
 	}
@@ -1448,7 +1448,7 @@ void
 rspamd_cryptobox_hash_update (void *p, const guchar *data, gsize len)
 {
 	crypto_generichash_blake2b_state *st = cryptobox_align_ptr (p,
-			alignof(crypto_generichash_blake2b_state));
+			_Alignof(crypto_generichash_blake2b_state));
 	crypto_generichash_blake2b_update (st, data, len);
 }
 
@@ -1459,7 +1459,7 @@ void
 rspamd_cryptobox_hash_final (void *p, guchar *out)
 {
 	crypto_generichash_blake2b_state *st = cryptobox_align_ptr (p,
-			alignof(crypto_generichash_blake2b_state));
+			_Alignof(crypto_generichash_blake2b_state));
 	crypto_generichash_blake2b_final (st, out, crypto_generichash_blake2b_BYTES_MAX);
 }
 
diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c
index 5377e77ae..5517ad875 100644
--- a/src/libserver/re_cache.c
+++ b/src/libserver/re_cache.c
@@ -386,7 +386,7 @@ rspamd_re_cache_init (struct rspamd_re_cache *cache, struct rspamd_config *cfg)
 		rspamd_regexp_set_cache_id (re, i);
 
 		if (re_class->st == NULL) {
-			posix_memalign ((void **)&re_class->st, alignof (rspamd_cryptobox_hash_state_t),
+			posix_memalign ((void **)&re_class->st, _Alignof (rspamd_cryptobox_hash_state_t),
 			 		sizeof (*re_class->st));
 			g_assert (re_class->st != NULL);
 			rspamd_cryptobox_hash_init (re_class->st, NULL, 0);
diff --git a/src/libutil/multipattern.c b/src/libutil/multipattern.c
index d353c08e1..b2cdc6645 100644
--- a/src/libutil/multipattern.c
+++ b/src/libutil/multipattern.c
@@ -242,7 +242,7 @@ rspamd_multipattern_create (enum rspamd_multipattern_flags flags)
 	struct rspamd_multipattern *mp;
 
 	/* Align due to blake2b state */
-	posix_memalign((void **)&mp, alignof (struct rspamd_multipattern),
+	posix_memalign((void **)&mp, _Alignof (struct rspamd_multipattern),
 			sizeof (*mp));
 	g_assert (mp != NULL);
 	memset (mp, 0, sizeof (*mp));
@@ -271,7 +271,7 @@ rspamd_multipattern_create_sized (guint npatterns,
 	struct rspamd_multipattern *mp;
 
 	/* Align due to blake2b state */
-	posix_memalign((void **)&mp, alignof (struct rspamd_multipattern), sizeof (*mp));
+	posix_memalign((void **)&mp, _Alignof (struct rspamd_multipattern), sizeof (*mp));
 	g_assert (mp != NULL);
 	memset (mp, 0, sizeof (*mp));
 	mp->flags = flags;
diff --git a/src/lua/lua_cryptobox.c b/src/lua/lua_cryptobox.c
index 125cdab8e..35faa0037 100644
--- a/src/lua/lua_cryptobox.c
+++ b/src/lua/lua_cryptobox.c
@@ -990,7 +990,7 @@ rspamd_lua_hash_create (const gchar *type)
 		}
 		else if (g_ascii_strcasecmp (type, "blake2") == 0) {
 			h->type = LUA_CRYPTOBOX_HASH_BLAKE2;
-			posix_memalign ((void **)&h->content.h, alignof (rspamd_cryptobox_hash_state_t),
+			posix_memalign ((void **)&h->content.h, _Alignof (rspamd_cryptobox_hash_state_t),
 					sizeof (*h->content.h));
 			g_assert (h->content.h != NULL);
 			rspamd_cryptobox_hash_init (h->content.h, NULL, 0);
@@ -1027,7 +1027,7 @@ rspamd_lua_hash_create (const gchar *type)
 	}
 	else {
 		h->type = LUA_CRYPTOBOX_HASH_BLAKE2;
-		posix_memalign ((void **)&h->content.h, alignof (rspamd_cryptobox_hash_state_t),
+		posix_memalign ((void **)&h->content.h, _Alignof (rspamd_cryptobox_hash_state_t),
 				sizeof (*h->content.h));
 		g_assert (h->content.h != NULL);
 		rspamd_cryptobox_hash_init (h->content.h, NULL, 0);


More information about the Commits mailing list