From: Jeff Hostetler Date: Thu, 03 Mar 2022 18:00:08 GMT Subject: Re: [PATCH 19/23] fsm-health-win32: force shutdown daemon if worktree root moves Message-ID: <2812e2af-4a63-09ae-89c9-bab8fb487100@jeffhostetler.com> In-Reply-To: On 2/24/22 11:09 AM, Derrick Stolee wrote: > On 2/15/2022 10:59 AM, Jeff Hostetler via GitGitGadget wrote: >> From: Jeff Hostetler >> diff --git a/compat/fsmonitor/fsm-health-win32.c b/compat/fsmonitor/fsm-health-win32.c >> index 3c3453369cd..2526ad9194f 100644 >> --- a/compat/fsmonitor/fsm-health-win32.c >> +++ b/compat/fsmonitor/fsm-health-win32.c >> @@ -14,7 +14,10 @@ enum interval_fn_ctx { CTX_INIT = 0, CTX_TERM, CTX_TIMER }; >> typedef int (interval_fn)(struct fsmonitor_daemon_state *state, >> enum interval_fn_ctx ctx); >> >> +static interval_fn has_worktree_moved; >> + >> static interval_fn *table[] = { >> + has_worktree_moved, >> NULL, /* must be last */ >> }; > > Looking at this now, I think table[] should be defined immediately > before fsm_health__loop() so it is easier to see how they interact. > It also avoids this static declaration of the function before its > implementation. > > Or, is there a reason it is so high up in the file? I don't think so. I was trying to keep all of the public API routines at the bottom, but all of the static stuff is pretty much free to move around. I'll revisit. Thanks Jeff