public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Orgad Shaneh <orgads@gmail.com>
To: gdb-patches@sourceware.org
Cc: Orgad Shaneh <orgads@gmail.com>
Subject: [PATCH] sim/erc32: Rename EVENT_MAX -> MAX_EVENTS
Date: Sun,  3 Mar 2024 12:22:14 +0200	[thread overview]
Message-ID: <20240303102235.1264-1-orgad.shaneh@audiocodes.com> (raw)

From: Orgad Shaneh <orgads@gmail.com>

EVENT_MAX is defined as 0x7FFFFFFF (INT_MAX) in winuser.h, so when
building on Windows, the value is overridden and compilation fails
because the array size of evbuf is too large.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28476
---
 sim/erc32/func.c | 6 +++---
 sim/erc32/sis.h  | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sim/erc32/func.c b/sim/erc32/func.c
index 972a636e619..80f416d87d7 100644
--- a/sim/erc32/func.c
+++ b/sim/erc32/func.c
@@ -697,7 +697,7 @@ init_signals(void)
 extern struct disassemble_info dinfo;
 
 struct estate   ebase;
-struct evcell   evbuf[EVENT_MAX];
+struct evcell   evbuf[MAX_EVENTS];
 struct irqcell  irqarr[16];
 
 static int
@@ -864,10 +864,10 @@ init_event(void)
 
     ebase.eq.nxt = NULL;
     ebase.freeq = evbuf;
-    for (i = 0; i < EVENT_MAX; i++) {
+    for (i = 0; i < MAX_EVENTS; i++) {
 	evbuf[i].nxt = &evbuf[i + 1];
     }
-    evbuf[EVENT_MAX - 1].nxt = NULL;
+    evbuf[MAX_EVENTS - 1].nxt = NULL;
 }
 
 void
diff --git a/sim/erc32/sis.h b/sim/erc32/sis.h
index 504d7e69c77..cf44ddfb7fe 100644
--- a/sim/erc32/sis.h
+++ b/sim/erc32/sis.h
@@ -31,7 +31,7 @@
 #define I_ACC_EXC 1
 
 /* Maximum events in event queue */
-#define EVENT_MAX	256
+#define MAX_EVENTS	256
 
 /* Maximum # of floating point queue */
 #define FPUQN	1
-- 
2.40.1


             reply	other threads:[~2024-03-03 10:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-03 10:22 Orgad Shaneh [this message]
2024-03-08 17:23 ` Tom Tromey
2024-03-21  6:37   ` Orgad Shaneh
2024-03-21 16:49     ` Tom Tromey

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=20240303102235.1264-1-orgad.shaneh@audiocodes.com \
    --to=orgads@gmail.com \
    --cc=gdb-patches@sourceware.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 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).