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

Re: [Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Oct 14, 2019, 21:46 UTC
Message-ID
<20191014214629.134882-1-jonathantanmy@google.com>
In-Reply-To
<20191014193734.GA13706@wambui>
Show 14 quoted lines
> > Well, I agree that it could be better, but with the C language as we
> > have it now, I still slightly prefer an enum to a list of #define. Both
> > ways, we still have to manually enter values for each flag, but with
> > enum, we get better debugger display (at least in gdb) and in the
> > function declaration and definition, we can put a specific type (instead
> > of "unsigned" or "int"). gdb supports the notion that a few people use
> > enums this way too, but if we decide as a project to not use enums in
> > this way, that's fine too. For what it's worth, I tried doing a search
> > online, but most of the results I got was for C# (where it is
> > recommended - they have a "[Flags]" attribute for enums), so maybe I am
> > indeed in the minority.
> 
> I'll try to pick another set of constants to convert - before this is
> agreed on.

Thanks - perhaps that's the best way to proceed for now. Do you remember where you found the idea to convert #define to enum? Maybe I could add a note there to avoid converting bitsets/bitflags.

Previous: Wambui KarugaNext: Wambui Karuga
Message 8 of 13 in “blame: Convert pickaxe_blame defined constants to enums”
  1. Wambui KarugaOct 10, 2019
  2. Jonathan TanOct 10, 2019
  3. Junio C HamanoOct 11, 2019
  4. Jonathan TanOct 11, 2019
  5. Junio C HamanoOct 12, 2019
  6. Jonathan TanOct 14, 2019
  7. Wambui KarugaOct 14, 2019
  8. Jonathan TanOct 14, 2019
  9. Wambui KarugaOct 15, 2019
  10. SZEDER GáborOct 15, 2019
  11. Wambui KarugaOct 11, 2019
  12. Jonathan TanOct 11, 2019
  13. Wambui KarugaOct 11, 2019

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.