public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: cygwin-patches@cygwin.com
Subject: [PATCH 2/4] Cygwin: errmap[]: reduce value size from 32 to 8 bits
Date: Mon, 26 Feb 2024 15:24:01 +0100	[thread overview]
Message-ID: <218ffbbb-b32b-af96-10b0-f3c1fb27aeaf@t-online.de> (raw)
In-Reply-To: <7f17e15c-ef28-06fd-3a6d-cac60a651960@t-online.de>

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0002-Cygwin-errmap-reduce-value-size-from-32-to-8-bits.patch --]
[-- Type: text/plain, Size: 913 bytes --]

From bebc11c2a9022e61cdc7544ed2cb5101a170ae92 Mon Sep 17 00:00:00 2001
From: Christian Franke <christian.franke@t-online.de>
Date: Mon, 26 Feb 2024 14:01:54 +0100
Subject: [PATCH 2/4] Cygwin: errmap[]: reduce value size from 32 to 8 bits

Overflow would be detected at compile time.

Signed-off-by: Christian Franke <christian.franke@t-online.de>
---
 winsup/cygwin/local_includes/errmap.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/local_includes/errmap.h b/winsup/cygwin/local_includes/errmap.h
index 737c01c8b..eacf9cd1c 100644
--- a/winsup/cygwin/local_includes/errmap.h
+++ b/winsup/cygwin/local_includes/errmap.h
@@ -3,7 +3,7 @@
    to this new array manually on demand. */
 
 /* FIXME: Some of these choices are arbitrary! */
-constexpr int errmap[] =
+constexpr uint8_t errmap[] =
 {
   0,			/* ERROR_SUCCESS */
   EBADRQC,		/* ERROR_INVALID_FUNCTION */
-- 
2.43.0


  reply	other threads:[~2024-02-26 14:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26 14:21 [PATCH 1/4] Cygwin: introduce constexpr errmap_size and errmap[] consistency checks Christian Franke
2024-02-26 14:24 ` Christian Franke [this message]
2024-02-26 14:25 ` [PATCH 3/4] Cygwin: errmap[]: add error numbers to /* ERROR_... */ comments Christian Franke
2024-02-26 14:27 ` [PATCH 4/4] Cygwin: errmap[]: update comments using current winerror.h Christian Franke
2024-02-26 15:48 ` [PATCH 1/4] Cygwin: introduce constexpr errmap_size and errmap[] consistency checks Corinna Vinschen

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=218ffbbb-b32b-af96-10b0-f3c1fb27aeaf@t-online.de \
    --to=christian.franke@t-online.de \
    --cc=cygwin-patches@cygwin.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).