From: Windl, Ulrich Date: Fri, 31 Oct 2025 10:28:47 GMT Subject: RE: [EXT] [PATCH v3 6/6] add-patch: reset "permitted" at loop start Message-ID: <77991a11c53f40b8b0a050a4d081809a@ukr.de> In-Reply-To: Just a comment of personal taste: I think declaring an anonymous enum inside a loop is just bad style. I think that gcc is smart enough to optimize if "permitted" is declared outside the loop, or make the "permitted" use a typedef for a "named enum" (declared outside the loop while the variable may be inside the loop). > -----Original Message----- > From: René Scharfe > Sent: Monday, October 6, 2025 7:24 PM > To: git@vger.kernel.org > Cc: Windl, Ulrich ; Junio C Hamano ; > Phillip Wood > Subject: [EXT] [PATCH v3 6/6] add-patch: reset "permitted" at loop start > [...] > for (;;) { > + enum { > + ALLOW_GOTO_PREVIOUS_HUNK = 1 << 0, > + ALLOW_GOTO_PREVIOUS_UNDECIDED_HUNK = 1 << > 1, > + ALLOW_GOTO_NEXT_HUNK = 1 << 2, > + ALLOW_GOTO_NEXT_UNDECIDED_HUNK = 1 << 3, > + ALLOW_SEARCH_AND_GOTO = 1 << 4, > + ALLOW_SPLIT = 1 << 5, > + ALLOW_EDIT = 1 << 6 > + } permitted = 0; > + > if (hunk_index >= file_diff->hunk_nr) > hunk_index = 0; > hunk = file_diff->hunk_nr