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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 14, 2019 at 02:46:29PM -0700, Jonathan Tan wrote:
> > > 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.

I found it in a mailing list thread[1], but seems that a comment on bit
field values was added to a similar issue on GitGitGadget[2].

[1] https://public-inbox.org/git/20190923180649.GA2886@xxxxxxxxxx/
[2] https://github.com/gitgitgadget/git/issues/357




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux