git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Tan <jonathantanmy@google.com>
To: wambui.karugax@gmail.com
Cc: jonathantanmy@google.com, gitster@pobox.com, git@vger.kernel.org
Subject: Re: [Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums
Date: Mon, 14 Oct 2019 14:46:29 -0700	[thread overview]
Message-ID: <20191014214629.134882-1-jonathantanmy@google.com> (raw)
In-Reply-To: <20191014193734.GA13706@wambui>

> > 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.

  reply	other threads:[~2019-10-14 21:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10 11:52 [Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums Wambui Karuga
2019-10-10 18:44 ` Jonathan Tan
2019-10-11  4:13   ` Junio C Hamano
2019-10-11 18:44     ` Jonathan Tan
2019-10-12  0:30       ` Junio C Hamano
2019-10-14 18:27         ` Jonathan Tan
2019-10-14 19:37           ` Wambui Karuga
2019-10-14 21:46             ` Jonathan Tan [this message]
2019-10-15 12:06               ` Wambui Karuga
2019-10-15  8:45           ` SZEDER Gábor
2019-10-11  8:52   ` Wambui Karuga
2019-10-11 18:48     ` Jonathan Tan
2019-10-11 20:04       ` Wambui Karuga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191014214629.134882-1-jonathantanmy@google.com \
    --to=jonathantanmy@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=wambui.karugax@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).