-
-
Notifications
You must be signed in to change notification settings - Fork 129
Updating for latest github macos image. #1965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a759cb8
d911c2b
5cb9084
27e6fab
00bd1db
d56b30e
c319254
909eb22
a7035f3
d6e1526
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,18 +101,18 @@ static const struct Device s_cdromDevice = { | |
| .desc = "CD-ROM", | ||
| .init = (void (*)())psxdummy, | ||
| .open = dev_cd_open, | ||
| .action = psxdummy, | ||
| .close = psxdummy, | ||
| .ioctl = psxdummy, | ||
| .action = (int (*)(struct File *, enum FileAction))psxdummy, | ||
| .close = (int (*)(struct File *))psxdummy, | ||
| .ioctl = (int (*)(struct File *, int, int))psxdummy, | ||
| .read = dev_cd_read, | ||
| .write = psxdummy, | ||
| .erase = psxdummy, | ||
| .write = (int (*)(struct File *, void *, int))psxdummy, | ||
| .erase = (int (*)(struct File *, const char *))psxdummy, | ||
| .undelete = psxdummy, | ||
| .firstFile = dev_cd_firstFile, | ||
| .nextFile = dev_cd_nextFile, | ||
| .format = psxdummy, | ||
| .format = (int (*)(struct File *))psxdummy, | ||
| .chdir = dev_cd_chdir, | ||
| .rename = psxdummy, | ||
| .rename = (int (*)(struct File *, const char *, struct File *, const char *))psxdummy, | ||
| .deinit = deinitCDRom, | ||
|
Comment on lines
+105
to
116
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainReplace repeated casts with correctly-typed stubs to avoid UB and reduce warning surface. Multiple fields cast Apply within this block: - .action = (int (*)(struct File *, enum FileAction))psxdummy,
- .close = (int (*)(struct File *))psxdummy,
- .ioctl = (int (*)(struct File *, int, int))psxdummy,
+ .action = cd_action_noop,
+ .close = cd_close_noop,
+ .ioctl = cd_ioctl_noop,
.read = dev_cd_read,
- .write = (int (*)(struct File *, void *, int))psxdummy,
- .erase = (int (*)(struct File *, const char *))psxdummy,
+ .write = cd_write_noop,
+ .erase = cd_erase_noop,
.undelete = psxdummy,
.firstFile = dev_cd_firstFile,
.nextFile = dev_cd_nextFile,
- .format = (int (*)(struct File *))psxdummy,
+ .format = cd_format_noop,
.chdir = dev_cd_chdir,
- .rename = (int (*)(struct File *, const char *, struct File *, const char *))psxdummy,
+ .rename = cd_rename_noop,Add near the top of this file (or shared): static int cd_action_noop(struct File *f, enum FileAction a){ (void)f; (void)a; return 0; }
static int cd_close_noop(struct File *f){ (void)f; return 0; }
static int cd_ioctl_noop(struct File *f, int a, int b){ (void)f; (void)a; (void)b; return 0; }
static int cd_write_noop(struct File *f, void *buf, int sz){ (void)f; (void)buf; (void)sz; return -1; } // write not supported
static int cd_erase_noop(struct File *f, const char *p){ (void)f; (void)p; return -1; }
static int cd_format_noop(struct File *f){ (void)f; return -1; }
static int cd_rename_noop(struct File *f, const char *o, struct File *u, const char *n){
(void)f; (void)o; (void)u; (void)n; return -1;
}Verification: run a quick scan to catch any remaining casts so we can standardize on wrappers. 🏁 Script executed: #!/bin/bash
# Find device initializers still casting psxdummy
rg -nP '\.\s*(action|close|ioctl|write|erase|format|rename)\s*=\s*\([^)]*\)\s*psxdummy' -C2 src | sed -n '1,200p'Length of output: 113 🏁 Script executed: #!/bin/bash
# List all occurrences of psxdummy casts or assignments in the CD-ROM driver
rg -n 'psxdummy' -C2 src/mips/openbios/cdrom/cdrom.cLength of output: 867 🏁 Script executed: #!/bin/bash
# Show the struct initializer context in cdrom.c to identify field types
sed -n '1,50p' src/mips/openbios/cdrom/cdrom.cLength of output: 2153 🏁 Script executed: #!/bin/bash
# Display the struct initializer for the CD-ROM device to inspect all psxdummy assignments
sed -n '80,150p' src/mips/openbios/cdrom/cdrom.cLength of output: 1994 Replace all static void cd_init_noop(struct Device *d){ (void)d; }
static int cd_action_noop(struct File *f, enum FileAction a){ (void)f; (void)a; return 0; }
static int cd_close_noop(struct File *f){ (void)f; return 0; }
static int cd_ioctl_noop(struct File *f, int a, int b){ (void)f; (void)a; (void)b; return 0; }
static ssize_t cd_read_noop(struct File *f, void *buf, int sz){ (void)f; (void)buf; (void)sz; return -1; }
static int cd_erase_noop(struct File *f, const char *p){ (void)f; (void)p; return -1; }
static int cd_format_noop(struct File *f){ (void)f; return -1; }
static int cd_undelete_noop(struct File *f){ (void)f; return 0; }
static int cd_rename_noop(struct File *f, const char *o, struct File *u, const char *n){
(void)f; (void)o; (void)u; (void)n; return -1;
}
static int cd_check_noop(void){ return 0; }Then update each initializer field in |
||
| .check = psxdummy, | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,16 +1,18 @@ | ||||||||||||
| class MipselNoneElfGcc < Formula | ||||||||||||
| desc "The GNU compiler collection for mipsel" | ||||||||||||
| homepage "https://gcc.gnu.org" | ||||||||||||
| url "https://ftpmirror.gnu.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz" | ||||||||||||
| mirror "https://mirrors.kernel.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz" | ||||||||||||
| sha256 "a7b39bc69cbf9e25826c5a60ab26477001f7c08d85cec04bc0e29cabed6f3cc9" | ||||||||||||
| url "https://ftpmirror.gnu.org/gnu/gcc/gcc-15.2.0/gcc-15.2.0.tar.xz" | ||||||||||||
| mirror "https://mirrors.kernel.org/gnu/gcc/gcc-15.2.0/gcc-15.2.0.tar.xz" | ||||||||||||
| sha256 "438fd996826b0c82485a29da03a72d71d6e3541a83ec702df4271f6fe025d24e" | ||||||||||||
|
|
||||||||||||
| depends_on "gmp" | ||||||||||||
| depends_on "mipsel-none-elf-binutils" | ||||||||||||
| depends_on "libmpc" | ||||||||||||
| depends_on "mpfr" | ||||||||||||
| depends_on "gnu-sed" | ||||||||||||
|
|
||||||||||||
| patch :DATA | ||||||||||||
|
|
||||||||||||
| def install | ||||||||||||
| ENV.prepend_path "PATH", Formula["gnu-sed"].opt_libexec/"gnubin" | ||||||||||||
| mkdir "mipsel-none-elf-gcc-build" do | ||||||||||||
|
|
@@ -50,3 +52,47 @@ def install | |||||||||||
| system "#{bin}/mipsel-none-elf-gcc", "-c", "-o", "test-c.o", "test-c.c" | ||||||||||||
| end | ||||||||||||
| end | ||||||||||||
|
|
||||||||||||
| __END__ | ||||||||||||
| diff --git a/zlib/zutil.h b/zlib/zutil.h | ||||||||||||
| index 0bd2dbcba..bb513cb4b 100644 | ||||||||||||
| --- a/zlib/zutil.h | ||||||||||||
| +++ b/zlib/zutil.h | ||||||||||||
| @@ -130,17 +130,8 @@ | ||||||||||||
| # endif | ||||||||||||
| #endif | ||||||||||||
|
|
||||||||||||
| -#if defined(MACOS) || defined(TARGET_OS_MAC) | ||||||||||||
| +#if defined(MACOS) | ||||||||||||
| # define OS_CODE 7 | ||||||||||||
|
Comment on lines
+65
to
+67
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restore TARGET_OS_MAC in zlib’s MAC guard. Same concern as the VSCode script: keep TARGET_OS_MAC to avoid OS_CODE/behavior changes on Apple. -#if defined(MACOS)
+#if defined(MACOS) || defined(TARGET_OS_MAC)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| -# ifndef Z_SOLO | ||||||||||||
| -# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os | ||||||||||||
| -# include <unix.h> /* for fdopen */ | ||||||||||||
| -# else | ||||||||||||
| -# ifndef fdopen | ||||||||||||
| -# define fdopen(fd,mode) NULL /* No fdopen() */ | ||||||||||||
| -# endif | ||||||||||||
| -# endif | ||||||||||||
| -# endif | ||||||||||||
| #endif | ||||||||||||
|
|
||||||||||||
| #ifdef __acorn | ||||||||||||
| @@ -163,19 +154,12 @@ | ||||||||||||
| # define OS_CODE 19 | ||||||||||||
| #endif | ||||||||||||
|
|
||||||||||||
| -#if defined(_BEOS_) || defined(RISCOS) | ||||||||||||
| -# define fdopen(fd,mode) NULL /* No fdopen() */ | ||||||||||||
| -#endif | ||||||||||||
| - | ||||||||||||
| #if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX | ||||||||||||
| # if defined(_WIN32_WCE) | ||||||||||||
| -# define fdopen(fd,mode) NULL /* No fdopen() */ | ||||||||||||
| # ifndef _PTRDIFF_T_DEFINED | ||||||||||||
| typedef int ptrdiff_t; | ||||||||||||
| # define _PTRDIFF_T_DEFINED | ||||||||||||
| # endif | ||||||||||||
| -# else | ||||||||||||
| -# define fdopen(fd,type) _fdopen(fd,type) | ||||||||||||
| # endif | ||||||||||||
| #endif | ||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| From 4bd9a71f3539b5ce47f0c67ab5e01f3196dc8ef9 Mon Sep 17 00:00:00 2001 | ||
| From: Mark Adler <[email protected]> | ||
| Date: Tue, 12 Dec 2023 22:19:05 -0600 | ||
| Subject: [PATCH] Remove fdopen #defines in zutil.h. | ||
|
|
||
| fdopen() is not used by zlib anymore. The #defines are vestigial. | ||
| --- | ||
| zutil.h | 23 +---------------------- | ||
| 1 file changed, 1 insertion(+), 22 deletions(-) | ||
|
|
||
| diff --git a/zutil.h b/zutil.h | ||
| index 0bd2dbcba..bb513cb4b 100644 | ||
| --- a/zutil.h | ||
| +++ b/zutil.h | ||
| @@ -137,17 +137,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ | ||
| # endif | ||
| #endif | ||
|
|
||
| -#if defined(MACOS) || defined(TARGET_OS_MAC) | ||
| +#if defined(MACOS) | ||
| # define OS_CODE 7 | ||
|
Comment on lines
+19
to
+21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Retain TARGET_OS_MAC in the condition. Same rationale as in the embedded patches: avoid changing OS_CODE semantics on Apple hosts. -#if defined(MACOS)
+#if defined(MACOS) || defined(TARGET_OS_MAC)🤖 Prompt for AI Agents |
||
| -# ifndef Z_SOLO | ||
| -# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os | ||
| -# include <unix.h> /* for fdopen */ | ||
| -# else | ||
| -# ifndef fdopen | ||
| -# define fdopen(fd,mode) NULL /* No fdopen() */ | ||
| -# endif | ||
| -# endif | ||
| -# endif | ||
| #endif | ||
|
|
||
| #ifdef __acorn | ||
| @@ -170,18 +161,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ | ||
| # define OS_CODE 19 | ||
| #endif | ||
|
|
||
| -#if defined(_BEOS_) || defined(RISCOS) | ||
| -# define fdopen(fd,mode) NULL /* No fdopen() */ | ||
| -#endif | ||
| - | ||
| -#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX | ||
| -# if defined(_WIN32_WCE) | ||
| -# define fdopen(fd,mode) NULL /* No fdopen() */ | ||
| -# else | ||
| -# define fdopen(fd,type) _fdopen(fd,type) | ||
| -# endif | ||
| -#endif | ||
| - | ||
| #if defined(__BORLANDC__) && !defined(MSDOS) | ||
| #pragma warn -8004 | ||
| #pragma warn -8008 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Pin the tap commit to avoid supply-chain drift.
Installing the external brew command from a moving tap HEAD can break CI unexpectedly. Pin the tap to a known commit, then install the formula.
Replace with the tested revision.
📝 Committable suggestion
🤖 Prompt for AI Agents