From: Vinayak Dev <vinayakdev.sci@gmail.com>
To: sunshine@sunshineco.com
Cc: git@vger.kernel.org, Vinayak Dev <vinayakdev.sci@gmail.com>
Subject: [PATCH v2 3/3] {apply,alias}: convert pre-processor macros to enums
Date: Fri, 10 Feb 2023 22:43:38 +0530 [thread overview]
Message-ID: <20230210171338.81906-4-vinayakdev.sci@gmail.com> (raw)
In-Reply-To: <20230210171338.81906-1-vinayakdev.sci@gmail.com>
Change variables int side and int patch_method to enum in apply.c.
This allows for proper listing of enum constants during debugging.
Signed-off-by: Vinayak Dev <vinayakdev.sci@gmail.com>
---
apply.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/apply.c b/apply.c
index 1e9cf2f4f2..8612bd44c8 100644
--- a/apply.c
+++ b/apply.c
@@ -205,9 +205,6 @@ struct fragment {
* or deflated "literal".
*/
#define binary_patch_method leading
-/* #define BINARY_DELTA_DEFLATED 1 */
-/* #define BINARY_LITERAL_DEFLATED 2 */
-
enum binary_type_deflated {
BINARY_DELTA_DEFLATED = 1,
BINARY_LITERAL_DEFLATED
@@ -924,9 +921,6 @@ static int gitdiff_hdrend(struct gitdiff_data *state UNUSED,
* to make sure..
*/
-/* #define DIFF_OLD_NAME 0 */
-/* #define DIFF_NEW_NAME 1 */
-
enum diff_name {
DIFF_OLD_NAME = 0,
DIFF_NEW_NAME
@@ -936,7 +930,7 @@ static int gitdiff_verify_name(struct gitdiff_data *state,
const char *line,
int isnull,
char **name,
- int side)
+ enum diff_name side)
{
if (!*name && !isnull) {
*name = find_name(state->root, line, NULL, state->p_value, TERM_TAB);
@@ -1921,7 +1915,7 @@ static struct fragment *parse_binary_hunk(struct apply_state *state,
int llen, used;
unsigned long size = *sz_p;
char *buffer = *buf_p;
- int patch_method;
+ enum binary_type_deflated patch_method;
unsigned long origlen;
char *data = NULL;
int hunk_size = 0;
--
2.39.1
next prev parent reply other threads:[~2023-02-10 17:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 17:13 [PATCH v2 0/3] {apply,alias}: convert pre-processor macros to enums Vinayak Dev
2023-02-10 17:13 ` [PATCH v2 1/3] " Vinayak Dev
2023-02-10 17:13 ` [PATCH v2 2/3] " Vinayak Dev
2023-02-10 17:13 ` Vinayak Dev [this message]
2023-02-10 22:01 ` [PATCH v2 0/3] " Junio C Hamano
2023-02-11 4:00 ` Vinayak Dev
2023-02-15 0:04 ` Eric Sunshine
2023-02-15 8:19 ` Vinayak Dev
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=20230210171338.81906-4-vinayakdev.sci@gmail.com \
--to=vinayakdev.sci@gmail.com \
--cc=git@vger.kernel.org \
--cc=sunshine@sunshineco.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.
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).