grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Kiper <dkiper@net-space.pl>
To: Mate Kukri <mate.kukri@canonical.com>
Cc: grub-devel@gnu.org
Subject: Re: [PATCH] grub-core/net/http.c: Fix gcc-13 errors relating to type signedness
Date: Wed, 29 Nov 2023 20:25:52 +0100	[thread overview]
Message-ID: <20231129192552.l7wxzofjxnmlelt7@tomti.i.net-space.pl> (raw)
In-Reply-To: <20231126095040.45642-1-mate.kukri@canonical.com>

On Sun, Nov 26, 2023 at 09:50:41AM +0000, Mate Kukri wrote:
> Add explicit casts of HTTP_PORT to int to match the type of the port
> variable.
>
> Signed-off-by: Mate Kukri <mate.kukri@canonical.com>
> ---
>  grub-core/net/http.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/grub-core/net/http.c b/grub-core/net/http.c
> index df690acf6..d7b91c1f6 100644
> --- a/grub-core/net/http.c
> +++ b/grub-core/net/http.c
> @@ -405,9 +405,9 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial)
>    grub_memcpy (ptr, "\r\n", 2);
>
>    grub_dprintf ("http", "opening path %s on host %s TCP port %d\n",
> -		data->filename, server, port ? port : HTTP_PORT);
> +		data->filename, server, port ? port : (int) HTTP_PORT);
>    data->sock = grub_net_tcp_open (server,
> -				  port ? port : HTTP_PORT, http_receive,
> +				  port ? port : (int) HTTP_PORT, http_receive,

Why do not define HTTP_PORT as "#define HTTP_PORT ((grub_uint16_t) 80)"?
However, then I would define port as grub_uint16_t too...

Daniel

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

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

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

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=20231129192552.l7wxzofjxnmlelt7@tomti.i.net-space.pl \
    --to=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=mate.kukri@canonical.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).