git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: sheikh hamza <sheikhhamza012@gmail.com>
To: git@vger.kernel.org
Cc: sheikh hamza <sheikhhamza012@gmail.com>
Subject: [GSoC] cache.h: change READ_GITFILE_ERR constants group to enum
Date: Sun, 22 Mar 2020 22:34:53 +0500	[thread overview]
Message-ID: <1584898493-27180-1-git-send-email-sheikhhamza012@gmail.com> (raw)
In-Reply-To: <sheikhhamza012@gmail.com>

this patch is my microproject for the GSoC i converted
the group of constants in cache.h on line 573 to an enum
named read_gitfile_err to follow newer coding convension
i intend to contribute as much to git as i can and this is
my initial contribution i hope to get guidance for future
contribution. i would be working on the GSoC proposal any
help would be appreciated, Thank you

Signed-off-by: Muhammad Hamza <sheikhhamza012@gmail.com>
---
 cache.h | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/cache.h b/cache.h
index 37c899b..6aae035 100644
--- a/cache.h
+++ b/cache.h
@@ -570,14 +570,17 @@ static inline enum object_type object_type(unsigned int mode)
  */
 int is_nonbare_repository_dir(struct strbuf *path);
 
-#define READ_GITFILE_ERR_STAT_FAILED 1
-#define READ_GITFILE_ERR_NOT_A_FILE 2
-#define READ_GITFILE_ERR_OPEN_FAILED 3
-#define READ_GITFILE_ERR_READ_FAILED 4
-#define READ_GITFILE_ERR_INVALID_FORMAT 5
-#define READ_GITFILE_ERR_NO_PATH 6
-#define READ_GITFILE_ERR_NOT_A_REPO 7
-#define READ_GITFILE_ERR_TOO_LARGE 8
+enum read_gitfile_err {
+	READ_GITFILE_ERR_STAT_FAILED = 1,
+	READ_GITFILE_ERR_NOT_A_FILE = 2,
+	READ_GITFILE_ERR_OPEN_FAILED = 3,
+	READ_GITFILE_ERR_READ_FAILED = 4,
+	READ_GITFILE_ERR_INVALID_FORMAT = 5,
+	READ_GITFILE_ERR_NO_PATH = 6,
+	READ_GITFILE_ERR_NOT_A_REPO = 7,
+	READ_GITFILE_ERR_TOO_LARGE = 8,
+};
+
 void read_gitfile_error_die(int error_code, const char *path, const char *dir);
 const char *read_gitfile_gently(const char *path, int *return_error_code);
 #define read_gitfile(path) read_gitfile_gently((path), NULL)
-- 
1.9.1


             reply	other threads:[~2020-03-22 17:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-22 17:34 sheikh hamza [this message]
2020-03-22 23:38 ` [GSoC] cache.h: change READ_GITFILE_ERR constants group to enum Junio C Hamano

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

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

  git send-email \
    --in-reply-to=1584898493-27180-1-git-send-email-sheikhhamza012@gmail.com \
    --to=sheikhhamza012@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).