All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] libgcrypt: avoid -Wsign-compare in rijndael do_setkey
@ 2021-08-13 12:47 Heinrich Schuchardt
  2021-08-13 13:29 ` Daniel Kiper
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2021-08-13 12:47 UTC (permalink / raw)
  To: Daniel Kiper; +Cc: grub-devel, heinrich . schuchardt, Heinrich Schuchardt

Avoid a warning

lib/libgcrypt-grub/cipher/rijndael.c:352:21: warning:
comparison of integer expressions of different signedness:
‘int’ and ‘unsigned int’ [-Wsign-compare]
  352 |       for (i = 0; i < keylen; i++)
      |

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 grub-core/lib/libgcrypt/cipher/rijndael.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/grub-core/lib/libgcrypt/cipher/rijndael.c b/grub-core/lib/libgcrypt/cipher/rijndael.c
index 9d884c9d3..acb6ca66e 100644
--- a/grub-core/lib/libgcrypt/cipher/rijndael.c
+++ b/grub-core/lib/libgcrypt/cipher/rijndael.c
@@ -181,7 +181,8 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
   static int initialized = 0;
   static const char *selftest_failed=0;
   int rounds;
-  int i,j, r, t, rconpointer = 0;
+  unsigned i;
+  int j, r, t, rconpointer = 0;
   int KC;
   union
   {
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] libgcrypt: avoid -Wsign-compare in rijndael do_setkey
  2021-08-13 12:47 [PATCH 1/1] libgcrypt: avoid -Wsign-compare in rijndael do_setkey Heinrich Schuchardt
@ 2021-08-13 13:29 ` Daniel Kiper
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Kiper @ 2021-08-13 13:29 UTC (permalink / raw)
  To: Heinrich Schuchardt; +Cc: grub-devel, heinrich . schuchardt

On Fri, Aug 13, 2021 at 02:47:45PM +0200, Heinrich Schuchardt wrote:
> Avoid a warning
>
> lib/libgcrypt-grub/cipher/rijndael.c:352:21: warning:
> comparison of integer expressions of different signedness:
> ‘int’ and ‘unsigned int’ [-Wsign-compare]
>   352 |       for (i = 0; i < keylen; i++)
>       |
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

One nit below. Otherwise: Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

> ---
>  grub-core/lib/libgcrypt/cipher/rijndael.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/grub-core/lib/libgcrypt/cipher/rijndael.c b/grub-core/lib/libgcrypt/cipher/rijndael.c
> index 9d884c9d3..acb6ca66e 100644
> --- a/grub-core/lib/libgcrypt/cipher/rijndael.c
> +++ b/grub-core/lib/libgcrypt/cipher/rijndael.c
> @@ -181,7 +181,8 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
>    static int initialized = 0;
>    static const char *selftest_failed=0;
>    int rounds;
> -  int i,j, r, t, rconpointer = 0;
> +  unsigned i;

s/unsigned/unsigned int/

I will fix it before committing.

> +  int j, r, t, rconpointer = 0;
>    int KC;
>    union
>    {

Daniel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-13 13:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13 12:47 [PATCH 1/1] libgcrypt: avoid -Wsign-compare in rijndael do_setkey Heinrich Schuchardt
2021-08-13 13:29 ` Daniel Kiper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.