Skip to content

Commit

Permalink
Merge branch 'jk/maybe-unused-cleanup' into next
Browse files Browse the repository at this point in the history
Code clean-up.

* jk/maybe-unused-cleanup:
  grep: prefer UNUSED to MAYBE_UNUSED for pcre allocators
  gc: drop MAYBE_UNUSED annotation from used parameter
  • Loading branch information
gitster committed Aug 30, 2024
2 parents a2a2aa6 + 516a9ec commit 0ff6ea5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion builtin/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ static int pack_refs_condition(UNUSED struct gc_config *cfg)
return 1;
}

static int maintenance_task_pack_refs(MAYBE_UNUSED struct maintenance_run_opts *opts,
static int maintenance_task_pack_refs(struct maintenance_run_opts *opts,
UNUSED struct gc_config *cfg)
{
struct child_process cmd = CHILD_PROCESS_INIT;
Expand Down
4 changes: 2 additions & 2 deletions grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ static int is_fixed(const char *s, size_t len)
#ifdef USE_LIBPCRE2
#define GREP_PCRE2_DEBUG_MALLOC 0

static void *pcre2_malloc(PCRE2_SIZE size, MAYBE_UNUSED void *memory_data)
static void *pcre2_malloc(PCRE2_SIZE size, void *memory_data UNUSED)
{
void *pointer = malloc(size);
#if GREP_PCRE2_DEBUG_MALLOC
Expand All @@ -255,7 +255,7 @@ static void *pcre2_malloc(PCRE2_SIZE size, MAYBE_UNUSED void *memory_data)
return pointer;
}

static void pcre2_free(void *pointer, MAYBE_UNUSED void *memory_data)
static void pcre2_free(void *pointer, void *memory_data UNUSED)
{
#if GREP_PCRE2_DEBUG_MALLOC
static int count = 1;
Expand Down

0 comments on commit 0ff6ea5

Please sign in to comment.