From 10088a31d288cc2740c8f17836652f027811514a Mon Sep 17 00:00:00 2001 From: Mike Miller Date: Sun, 24 Dec 2023 19:22:30 -0800 Subject: [PATCH] o Small fixes to make the compiler complain less o Change internal build to 507 --- fs/fd.c | 7 ++++--- fs/generic.c | 6 +++--- fs/proc/pid.c | 2 +- iSH-AOK.xcodeproj/project.pbxproj | 26 ++++++++++++-------------- kernel/resource.c | 4 ++-- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/fs/fd.c b/fs/fd.c index d49808815d..f0612654a9 100644 --- a/fs/fd.c +++ b/fs/fd.c @@ -49,6 +49,7 @@ int fd_close(struct fd *fd) { if (fd->mount) mount_release(fd->mount); free(fd); + fd = NULL; // KLUGE? } return err; } @@ -161,7 +162,7 @@ struct fd *f_get(fd_t f) { static fd_t f_install_start(struct fd *fd, fd_t start) { assert(start >= 0); struct fdtable *table = current->files; - unsigned size = rlimit(RLIMIT_NOFILE_); + unsigned size = (unsigned)rlimit(RLIMIT_NOFILE_); if (size > table->size) size = table->size; @@ -341,8 +342,8 @@ dword_t sys_fcntl(fd_t f, dword_t cmd, dword_t arg) { if (err >= 0) { flock32.type = flock.type; flock32.whence = flock.whence; - flock32.start = flock.start; - flock32.len = flock.len; + flock32.start = (unsigned)flock.start; + flock32.len = (unsigned)flock.len; flock32.pid = flock.pid; if (user_write(arg, &flock32, sizeof(flock32))) return _EFAULT; diff --git a/fs/generic.c b/fs/generic.c index 532e4a8aeb..1c317f0fc0 100644 --- a/fs/generic.c +++ b/fs/generic.c @@ -23,7 +23,7 @@ struct mount *find_mount_and_trim_path(char *path) { bool contains_mount_point(const char *path) { struct mount *mount; list_for_each_entry(&mounts, mount, mounts) { - int n = strlen(path); + int n = (int)strlen(path); if (strncmp(path, mount->point, n) == 0 && (mount->point[n] == '\0' || mount->point[n] == '/')) return true; @@ -79,7 +79,7 @@ struct fd *generic_openat(struct fd *at, const char *path_raw, int flags, int mo type = DEV_BLOCK; else type = DEV_CHAR; - err = dev_open(dev_major(stat.rdev), dev_minor(stat.rdev), type, fd); + err = dev_open(dev_major((int)stat.rdev), dev_minor((int)stat.rdev), type, fd); if (err < 0) goto error; } @@ -259,7 +259,7 @@ ssize_t generic_readlinkat(struct fd *at, const char *path_raw, char *buf, size_ struct mount *mount = find_mount_and_trim_path(path); err = _EINVAL; if (mount->fs->readlink) - err = mount->fs->readlink(mount, path, buf, bufsize); + err = (int)mount->fs->readlink(mount, path, buf, bufsize); mount_release(mount); return err; } diff --git a/fs/proc/pid.c b/fs/proc/pid.c index b36ac83495..e7e9d4c0c8 100644 --- a/fs/proc/pid.c +++ b/fs/proc/pid.c @@ -281,7 +281,7 @@ static bool proc_pid_fd_readdir(struct proc_entry *entry, unsigned long *index, lock(&task->files->lock, 0); while (*index < task->files->size && task->files->files[*index] == NULL) (*index)++; - fd_t f = (*index)++; + fd_t f = (int)(*index)++; bool any_left = (unsigned) f < task->files->size; unlock(&task->files->lock); proc_put_task(task); diff --git a/iSH-AOK.xcodeproj/project.pbxproj b/iSH-AOK.xcodeproj/project.pbxproj index 78ff01c86a..4cf1b430a3 100644 --- a/iSH-AOK.xcodeproj/project.pbxproj +++ b/iSH-AOK.xcodeproj/project.pbxproj @@ -599,7 +599,6 @@ 5D8ACEFB284CE096003C50D3 /* sys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sys.h; sourceTree = ""; }; 5D8ACEFC284CE096003C50D3 /* sys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sys.c; sourceTree = ""; }; 5D8C94D3287E53AD0095EDEE /* fp_sync.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fp_sync.c; sourceTree = ""; }; - 5D8CEFF92894C81400D24ED8 /* resource_locking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resource_locking.h; sourceTree = ""; }; 5D8CFA842B1198B300D50E57 /* RTCDevice.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RTCDevice.m; sourceTree = ""; }; 5D8CFA882B1198DB00D50E57 /* RTCDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RTCDevice.h; sourceTree = ""; }; 5D9897CE28B6B953003D3670 /* AppStore.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = AppStore.xcconfig; sourceTree = ""; }; @@ -1145,7 +1144,6 @@ BB7D933C2087C2880008DA78 /* kernel */ = { isa = PBXGroup; children = ( - 5D8CEFF92894C81400D24ED8 /* resource_locking.h */, 497F6C9F254E5C9800C82F46 /* calls.c */, 497F6C7B254E5C9700C82F46 /* calls.h */, 497F6C82254E5C9700C82F46 /* elf.h */, @@ -2572,7 +2570,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 506; + CURRENT_PROJECT_VERSION = 507; DEVELOPMENT_TEAM = UYU5FM4LQ4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -2598,7 +2596,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 506; + CURRENT_PROJECT_VERSION = 507; DEVELOPMENT_TEAM = UYU5FM4LQ4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -2633,7 +2631,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 506; + CURRENT_PROJECT_VERSION = 507; DEVELOPMENT_TEAM = UYU5FM4LQ4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -2657,7 +2655,7 @@ buildSettings = { CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 506; + CURRENT_PROJECT_VERSION = 507; DEVELOPMENT_TEAM = UYU5FM4LQ4; MARKETING_VERSION = 1.3; PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK"; @@ -2682,7 +2680,7 @@ CODE_SIGN_ENTITLEMENTS = app/FileProvider/iSHFileProvider.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 506; + CURRENT_PROJECT_VERSION = 507; DEVELOPMENT_TEAM = UYU5FM4LQ4; INFOPLIST_FILE = app/FileProvider/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK.FileProvider"; @@ -2793,7 +2791,7 @@ CODE_SIGN_ENTITLEMENTS = app/FileProvider/iSHFileProvider.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 506; + CURRENT_PROJECT_VERSION = 507; DEVELOPMENT_TEAM = UYU5FM4LQ4; INFOPLIST_FILE = app/FileProvider/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK.FileProvider"; @@ -2811,7 +2809,7 @@ CODE_SIGN_ENTITLEMENTS = iSHFileProviderRelease.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 506; + CURRENT_PROJECT_VERSION = 507; DEVELOPMENT_TEAM = UYU5FM4LQ4; INFOPLIST_FILE = app/FileProvider/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK.FileProvider"; @@ -2914,7 +2912,7 @@ buildSettings = { CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 506; + CURRENT_PROJECT_VERSION = 507; DEVELOPMENT_TEAM = UYU5FM4LQ4; MARKETING_VERSION = 1.3; PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK"; @@ -2929,7 +2927,7 @@ buildSettings = { CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 506; + CURRENT_PROJECT_VERSION = 507; DEVELOPMENT_TEAM = UYU5FM4LQ4; MARKETING_VERSION = 1.3; PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK"; @@ -2957,7 +2955,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 506; + CURRENT_PROJECT_VERSION = 507; DEVELOPMENT_TEAM = UYU5FM4LQ4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -2980,7 +2978,7 @@ buildSettings = { CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 506; + CURRENT_PROJECT_VERSION = 507; DEVELOPMENT_TEAM = UYU5FM4LQ4; MARKETING_VERSION = 1.3; PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK"; @@ -3005,7 +3003,7 @@ CODE_SIGN_ENTITLEMENTS = app/FileProvider/iSHFileProvider.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 506; + CURRENT_PROJECT_VERSION = 507; DEVELOPMENT_TEAM = UYU5FM4LQ4; INFOPLIST_FILE = app/FileProvider/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK.FileProvider"; diff --git a/kernel/resource.c b/kernel/resource.c index 4785f94869..b2fedb0c17 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -53,8 +53,8 @@ static int do_getrlimit32(int resource, struct rlimit32_ *rlimit32) { return err; STRACE(" {cur=%#x, max=%#x}", rlimit.cur, rlimit.max); - rlimit32->max = rlimit.max; - rlimit32->cur = rlimit.cur; + rlimit32->max = (unsigned)rlimit.max; + rlimit32->cur = (unsigned)rlimit.cur; return 0; }