Skip to content

Commit

Permalink
o Small fixes to make the compiler complain less
Browse files Browse the repository at this point in the history
o Change internal build to 507
  • Loading branch information
Mike Miller committed Dec 25, 2023
1 parent 6028ba8 commit 10088a3
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 23 deletions.
7 changes: 4 additions & 3 deletions fs/fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ int fd_close(struct fd *fd) {
if (fd->mount)
mount_release(fd->mount);
free(fd);
fd = NULL; // KLUGE?
}
return err;
}
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions fs/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion fs/proc/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
26 changes: 12 additions & 14 deletions iSH-AOK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,6 @@
5D8ACEFB284CE096003C50D3 /* sys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sys.h; sourceTree = "<group>"; };
5D8ACEFC284CE096003C50D3 /* sys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sys.c; sourceTree = "<group>"; };
5D8C94D3287E53AD0095EDEE /* fp_sync.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fp_sync.c; sourceTree = "<group>"; };
5D8CEFF92894C81400D24ED8 /* resource_locking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resource_locking.h; sourceTree = "<group>"; };
5D8CFA842B1198B300D50E57 /* RTCDevice.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RTCDevice.m; sourceTree = "<group>"; };
5D8CFA882B1198DB00D50E57 /* RTCDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RTCDevice.h; sourceTree = "<group>"; };
5D9897CE28B6B953003D3670 /* AppStore.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = AppStore.xcconfig; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1145,7 +1144,6 @@
BB7D933C2087C2880008DA78 /* kernel */ = {
isa = PBXGroup;
children = (
5D8CEFF92894C81400D24ED8 /* resource_locking.h */,
497F6C9F254E5C9800C82F46 /* calls.c */,
497F6C7B254E5C9700C82F46 /* calls.h */,
497F6C82254E5C9700C82F46 /* elf.h */,
Expand Down Expand Up @@ -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)",
Expand All @@ -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)",
Expand Down Expand Up @@ -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)",
Expand All @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -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)",
Expand All @@ -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";
Expand All @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions kernel/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 10088a3

Please # to comment.