From: kosmirror <kos...@us...> - 2025-09-29 21:29:26
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via c6df54ce9cb887569312e929a59dd12539bf1b85 (commit) via 026575d488a452af85bcec93223265b5818d1064 (commit) via faec4393a9701910544d87a59675572c522a14eb (commit) via 12a1e70747317a978d457e93a7ce2dcd621f7bd9 (commit) via dc6f500d559658cf0deb0876653f2d2b5592240a (commit) via f6b5f2da9abd67d28e45d0f863f91db629ad4179 (commit) via 498d9d3bca9a1a8cdee451fae02d6117500f86f9 (commit) via ba0cb2b6a3583f2d3340f43bbc104d6f315917d8 (commit) from 694e333fa60be8eaf078156c7d89a5e05d369254 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c6df54ce9cb887569312e929a59dd12539bf1b85 Author: QuzarDC <qu...@co...> Date: Thu Sep 25 22:46:29 2025 -0400 libppp: Remove incorrect usages of `__fallthrough` The fallthrough attribute is only correctly used when in a switch statement after a preceeding statement. In these cases there were no preceeding statements, so there will also be no implicit fallthrough warnings. commit 026575d488a452af85bcec93223265b5818d1064 Author: QuzarDC <qu...@co...> Date: Thu Sep 25 21:11:14 2025 -0400 libkosext2fs: Avoid shifting signed values too far. commit faec4393a9701910544d87a59675572c522a14eb Author: QuzarDC <qu...@co...> Date: Thu Sep 25 21:10:30 2025 -0400 net: Set appropriate printf format specifier for size_t values. commit 12a1e70747317a978d457e93a7ce2dcd621f7bd9 Author: QuzarDC <qu...@co...> Date: Thu Sep 25 21:04:46 2025 -0400 fs_pty: Use unsigned int for id value. It's not possible for the id to be set to a negative value, and having it as a signed int created a mismatch with `sscanf`'s prototype. commit dc6f500d559658cf0deb0876653f2d2b5592240a Author: QuzarDC <qu...@co...> Date: Thu Sep 25 20:43:25 2025 -0400 fs_dclsocket: Initialize stat before passing to syscall. commit f6b5f2da9abd67d28e45d0f863f91db629ad4179 Author: QuzarDC <qu...@co...> Date: Thu Sep 25 20:17:20 2025 -0400 entry.s: Add newline to end of file. Assembler was warning about it and inserting one to avoid the file ending with a comment. commit 498d9d3bca9a1a8cdee451fae02d6117500f86f9 Author: QuzarDC <qu...@co...> Date: Thu Sep 25 19:31:25 2025 -0400 fs_dclsocket: Avoid possible null deref. This could happen when building for naomi as no net device is being specified. This code should be unreachable in those cases, but this will quiet the warnings. commit ba0cb2b6a3583f2d3340f43bbc104d6f315917d8 Author: QuzarDC <qu...@co...> Date: Thu Sep 25 15:28:30 2025 -0400 timer: Explicitly cast ticks to `long int` `timespec.tv_nsec` is implemented as a `long int` while our `timer_val_t.ticks` is a `uint32_t`. The value will always be limited to 999999999 as it's a count of ns, but without explicit casting this will trigger a narrowing warning. ----------------------------------------------------------------------- Summary of changes: addons/libkosext2fs/bitops.c | 8 ++++---- addons/libppp/ipcp.c | 3 --- kernel/arch/dreamcast/fs/fs_dclsocket.c | 4 +++- kernel/arch/dreamcast/include/arch/timer.h | 2 +- kernel/arch/dreamcast/kernel/entry.s | 2 +- kernel/fs/fs_pty.c | 6 +++--- kernel/net/net_icmp.c | 4 ++-- kernel/net/net_icmp6.c | 4 ++-- 8 files changed, 16 insertions(+), 17 deletions(-) diff --git a/addons/libkosext2fs/bitops.c b/addons/libkosext2fs/bitops.c index f37ed673..71982e82 100644 --- a/addons/libkosext2fs/bitops.c +++ b/addons/libkosext2fs/bitops.c @@ -18,7 +18,7 @@ uint32_t ext2_bit_find_nonzero(const uint32_t *btbl, uint32_t start, tmp = btbl[i]; if(tmp != 0) { for(; j < 32; ++j) { - if(tmp & (1 << j)) + if(tmp & (1u << j)) return (i << 5) | j; } } @@ -31,7 +31,7 @@ uint32_t ext2_bit_find_nonzero(const uint32_t *btbl, uint32_t start, tmp = btbl[i]; if(tmp != 0) { for(; j < (end & 0x1F); ++j) { - if(tmp & (1 << j)) + if(tmp & (1u << j)) return (i << 5) | j; } } @@ -52,7 +52,7 @@ uint32_t ext2_bit_find_zero(const uint32_t *btbl, uint32_t start, tmp = btbl[i]; if(tmp != 0xFFFFFFFF) { for(; j < 32; ++j) { - if(!(tmp & (1 << j))) + if(!(tmp & (1u << j))) return (i << 5) | j; } } @@ -65,7 +65,7 @@ uint32_t ext2_bit_find_zero(const uint32_t *btbl, uint32_t start, tmp = btbl[i]; if(tmp != 0xFFFFFFFF) { for(; j < (end & 0x1F); ++j) { - if(!(tmp & (1 << j))) + if(!(tmp & (1u << j))) return (i << 5) | j; } } diff --git a/addons/libppp/ipcp.c b/addons/libppp/ipcp.c index 80051b51..a1654882 100644 --- a/addons/libppp/ipcp.c +++ b/addons/libppp/ipcp.c @@ -177,7 +177,6 @@ static int ipcp_handle_configure_req(ppp_protocol_t *self, case PPP_STATE_OPENED: /* XXXX: This layer down. */ - __fallthrough; case PPP_STATE_STOPPED: ipcp_send_client_cfg(self, 0); @@ -390,7 +389,6 @@ static int ipcp_handle_configure_ack(ppp_protocol_t *self, case PPP_STATE_OPENED: /* Uh oh... Something's gone wrong. */ /* XXXX: This layer down. */ - __fallthrough; case PPP_STATE_ACK_RECEIVED: /* Well, this isn't good... Resend the configure request and back @@ -440,7 +438,6 @@ static int ipcp_handle_configure_nak(ppp_protocol_t *self, case PPP_STATE_OPENED: /* XXXX: This layer down. */ - __fallthrough; case PPP_STATE_REQUEST_SENT: case PPP_STATE_ACK_RECEIVED: diff --git a/kernel/arch/dreamcast/fs/fs_dclsocket.c b/kernel/arch/dreamcast/fs/fs_dclsocket.c index 72e32466..b91a6bff 100644 --- a/kernel/arch/dreamcast/fs/fs_dclsocket.c +++ b/kernel/arch/dreamcast/fs/fs_dclsocket.c @@ -171,6 +171,8 @@ static void dcls_recv_loop(void) { while(!escape) { /* If we're in an interrupt, this works differently.... */ if(irq_inside_int()) { + if(!net_default_dev) + break; /* Since we can't count on an interrupt happening, handle it manually, and poll the default device... */ net_default_dev->if_rx_poll(net_default_dev); @@ -512,7 +514,7 @@ static int dcls_unlink(vfs_handler_t *vfs, const char *fn) { static int dcls_stat(vfs_handler_t *vfs, const char *fn, struct stat *rv, int flag) { command_t *cmd = (command_t *)pktbuf; - dcload_stat_t filestat; + dcload_stat_t filestat = { 0 }; (void)flag; diff --git a/kernel/arch/dreamcast/include/arch/timer.h b/kernel/arch/dreamcast/include/arch/timer.h index 99694a32..6a235152 100644 --- a/kernel/arch/dreamcast/include/arch/timer.h +++ b/kernel/arch/dreamcast/include/arch/timer.h @@ -262,7 +262,7 @@ static inline struct timespec arch_timer_gettime(void) { /* Convert from ticks to nanoseconds: each clock tick is 80ns. */ return (struct timespec){ .tv_sec = time.secs, - .tv_nsec = time.ticks * 80, + .tv_nsec = (long int)(time.ticks * 80), }; } diff --git a/kernel/arch/dreamcast/kernel/entry.s b/kernel/arch/dreamcast/kernel/entry.s index 1ee06592..c7416cc7 100644 --- a/kernel/arch/dreamcast/kernel/entry.s +++ b/kernel/arch/dreamcast/kernel/entry.s @@ -342,4 +342,4 @@ _vma_table_400: ! TLB miss exceptions (MMU) _vma_table_600: ! IRQs nop bra _irq_save_regs - mov #3,r4 ! Set exception code \ No newline at end of file + mov #3,r4 ! Set exception code diff --git a/kernel/fs/fs_pty.c b/kernel/fs/fs_pty.c index 11f5c90e..c843fcb2 100644 --- a/kernel/fs/fs_pty.c +++ b/kernel/fs/fs_pty.c @@ -60,7 +60,7 @@ typedef struct ptyhalf { int refcnt; /* When this reaches zero, we close */ - int id; + unsigned int id; mutex_t mutex; condvar_t ready_read, ready_write; @@ -329,7 +329,7 @@ static void *pty_open_file(const char *fn, int mode) { handle fds of our own here thanks to the VFS layer, just reference counting so a pty can be opened by more than one process. */ int master; - int id; + unsigned int id; ptyhalf_t *ph; pipefd_t *fdobj; @@ -678,7 +678,7 @@ static dirent_t *pty_readdir(void *h) { static int pty_stat(vfs_handler_t *vfs, const char *path, struct stat *st, int flag) { ptyhalf_t *ph; - int id; + unsigned int id; int master; size_t len = strlen(path); diff --git a/kernel/net/net_icmp.c b/kernel/net/net_icmp.c index 4559377b..de29f5cc 100644 --- a/kernel/net/net_icmp.c +++ b/kernel/net/net_icmp.c @@ -60,12 +60,12 @@ static void icmp_default_echo_cb(const uint8_t *ip, uint16_t seq, uint64_t delta (void)data; if(delta_us != (uint64_t) - 1) { - printf("%d bytes from %d.%d.%d.%d: icmp_seq=%d ttl=%d time=%.3f ms\n", + printf("%zu bytes from %d.%d.%d.%d: icmp_seq=%d ttl=%d time=%.3f ms\n", data_sz, ip[0], ip[1], ip[2], ip[3], seq, ttl, delta_us / 1000.0); } else { - printf("%d bytes from %d.%d.%d.%d: icmp_seq=%d ttl=%d\n", data_sz, + printf("%zu bytes from %d.%d.%d.%d: icmp_seq=%d ttl=%d\n", data_sz, ip[0], ip[1], ip[2], ip[3], seq, ttl); } } diff --git a/kernel/net/net_icmp6.c b/kernel/net/net_icmp6.c index d3ce4e7d..52cb5111 100644 --- a/kernel/net/net_icmp6.c +++ b/kernel/net/net_icmp6.c @@ -53,11 +53,11 @@ static void icmp6_default_echo_cb(const struct in6_addr *ip, uint16_t seq, inet_ntop(AF_INET6, ip, ipstr, INET6_ADDRSTRLEN); if(delta_us != (uint64_t) - 1) { - printf("%d bytes from %s, icmp_seq=%d hlim=%d time=%.3f ms\n", data_sz, + printf("%zu bytes from %s, icmp_seq=%d hlim=%d time=%.3f ms\n", data_sz, ipstr, seq, hlim, delta_us / 1000.0); } else { - printf("%d bytes from %s, icmp_seq=%d hlim=%d\n", data_sz, ipstr, seq, + printf("%zu bytes from %s, icmp_seq=%d hlim=%d\n", data_sz, ipstr, seq, hlim); } } hooks/post-receive -- A pseudo Operating System for the Dreamcast. |