]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
net/http: Fix gcc-13 errors relating to type signedness
authorMate Kukri <mate.kukri@canonical.com>
Wed, 29 Nov 2023 19:58:25 +0000 (19:58 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 5 Dec 2023 14:55:10 +0000 (15:55 +0100)
Replace definition of HTTP_PORT with a pre-processor macro that converts
the constant to the correct grub_uint16_t type.

Change "port" local variable definition in http_establish() to have the
same type.

Signed-off-by: Mate Kukri <mate.kukri@canonical.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com
grub-core/net/http.c

index df690acf6716831bcf074bcd4eb8d9b504e55330..f389bf03d96282a212bb9904d310328a6ca13650 100644 (file)
 
 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