All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mate Kukri <mate.kukri@canonical.com>
To: grub-devel@gnu.org
Cc: Mate Kukri <mate.kukri@canonical.com>
Subject: [PATCH v2] grub-core/net/http.c: Fix gcc-13 errors relating to type signedness
Date: Wed, 29 Nov 2023 19:58:25 +0000	[thread overview]
Message-ID: <20231129195824.205158-1-mate.kukri@canonical.com> (raw)

Replace definition of `HTTP_PORT` with a pre-processor macro that converts
the constant to the correct type `grub_uint16_t`.

Change the defintion of local variable `port` in `http_establish()` to
have the same type.

Signed-off-by: Mate Kukri <mate.kukri@canonical.com>
---
 grub-core/net/http.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/grub-core/net/http.c b/grub-core/net/http.c
index df690acf6..1a73abfda 100644
--- a/grub-core/net/http.c
+++ b/grub-core/net/http.c
@@ -29,11 +29,7 @@
 
 GRUB_MOD_LICENSE ("GPLv3+");
 
-enum
-  {
-    HTTP_PORT = 80
-  };
-
+#define HTTP_PORT ((grub_uint16_t) 80)
 
 typedef struct http_data
 {
@@ -319,7 +315,7 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial)
   struct grub_net_buff *nb;
   grub_err_t err;
   char *server = file->device->net->server;
-  int port = file->device->net->port;
+  grub_uint16_t port = file->device->net->port;
 
   nb = grub_netbuff_alloc (GRUB_NET_TCP_RESERVE_SIZE
 			   + sizeof ("GET ") - 1
-- 
2.39.2


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

             reply	other threads:[~2023-11-29 19:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 19:58 Mate Kukri [this message]
2023-12-01 16:58 ` [PATCH v2] grub-core/net/http.c: Fix gcc-13 errors relating to type signedness Daniel Kiper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231129195824.205158-1-mate.kukri@canonical.com \
    --to=mate.kukri@canonical.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.