Skip to content

Commit c6fccea

Browse files
heartwilltellclaude
andcommitted
Fix clang-tidy: explicit casts for pointer conversion and narrowing
- Cast q->buf to (void *) in memset to avoid bugprone-multi-level-implicit-pointer-conversion - Use (greg_t)(uintptr_t) cast in SIGURG handler to avoid bugprone-narrowing-conversions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 17d3326 commit c6fccea

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/runtime/run_scheduler.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ bool run_g_queue_remove(run_g_queue_t *q, run_g_t *g) {
168168
void run_local_queue_init(run_local_queue_t *q) {
169169
atomic_store_explicit(&q->head, 0, memory_order_relaxed);
170170
atomic_store_explicit(&q->tail, 0, memory_order_relaxed);
171-
memset(q->buf, 0, sizeof(q->buf));
171+
memset((void *)q->buf, 0, sizeof(q->buf));
172172
}
173173

174174
bool run_local_queue_push(run_local_queue_t *q, run_g_t *g) {
@@ -1193,7 +1193,7 @@ static void sigurg_handler(int sig, siginfo_t *info, void *uctx) {
11931193
#if defined(__aarch64__)
11941194
uc->uc_mcontext.pc = (uint64_t)run_async_preempt;
11951195
#else
1196-
uc->uc_mcontext.gregs[REG_RIP] = (uint64_t)run_async_preempt;
1196+
uc->uc_mcontext.gregs[REG_RIP] = (greg_t)(uintptr_t)run_async_preempt;
11971197
#endif
11981198
#endif
11991199
}

0 commit comments

Comments
 (0)