git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] refs.h: make all flags arguments unsigned

From
Han-Wen Nienhuys <hanwen@google.com>
Date
Feb 3, 2022, 18:16 UTC
Message-ID
<CAFQ2z_NWM0F1uY==rCrc2pvJYjgPyOHz5aLFLSng-DvgiQVxqw@mail.gmail.com>
In-Reply-To
<220203.8635kz6d2o.gmgdl@evledraar.gmail.com>
On Thu, Feb 3, 2022 at 7:05 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> > I proposed both options because a distinct typename lets me jump to
> > the definition of the flags easily through ctags.
>
> I'm not sure I understand you here. I use ctags (via Emacs) and it's

"I proposed both options" (ie. enum or typedef) , so we are in resounding agreement.

Show 11 quoted lines
> > Another idea is to mark the type of the flags by its name, eg.
> > transaction_flags, resolve_flags, reftype_flags etc. This wouldn't
> > help with ctags, but it does help with readability.
>
> Yes, enums or not, what I was also pointing out in
> https://lore.kernel.org/git/220201.86ilty9vq2.gmgdl@evledraar.gmail.com/
> is that changing just one logical set of flags at a time would make this
> much easier to review.
>
> It doesn't matter for the end result as long as we end up with "unsigned
> int" everywhere, but would with enums.

Not sure if you need to review it in that detail. If you change a definition in the .h file, the compiler will complain about all mismatches. So it doesn't need human verification once you know it compiles.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 10 of 17 in “refs.h: make all flags arguments unsigned”
  1. refs.h: make all flags arguments unsignedHan-Wen Nienhuys via GitGitGadget, Jan 31, 2022
  2. Junio C HamanoFeb 1, 2022
  3. Han-Wen NienhuysFeb 1, 2022
  4. Junio C HamanoFeb 1, 2022
  5. refs.h: make all flags arguments unsignedHan-Wen Nienhuys via GitGitGadget, Feb 1, 2022
  6. Ævar Arnfjörð BjarmasonFeb 1, 2022
  7. Junio C HamanoFeb 1, 2022
  8. Han-Wen NienhuysFeb 3, 2022
  9. Ævar Arnfjörð BjarmasonFeb 3, 2022
  10. Han-Wen NienhuysFeb 3, 2022
  11. Ævar Arnfjörð BjarmasonFeb 3, 2022
  12. Junio C HamanoFeb 3, 2022
  13. Han-Wen NienhuysFeb 3, 2022
  14. Junio C HamanoFeb 3, 2022
  15. 0/2 refs.h: make all flags arguments unsignedHan-Wen Nienhuys via GitGitGadget, Feb 3, 2022
  16. 1/2 refs.h: make all flags arguments unsignedHan-Wen Nienhuys via GitGitGadget, Feb 3, 2022
  17. 2/2 Uniformize flag argument naming to `flags` or `unused_flags`Han-Wen Nienhuys via GitGitGadget, Feb 3, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.