diff mbox series

commit-slab-decl.h: fix define gaurds

Message ID 20200516172837.2872-1-abhishekkumar8222@gmail.com
State New, archived
Headers show
Series commit-slab-decl.h: fix define gaurds | expand

Commit Message

Abhishek Kumar May 16, 2020, 5:28 p.m. UTC
commit-slab was split into commit-slab-decl and commit-slab-impl header
files by a9f1f1f9f8 ("commit-slab.h: code split", 2018-05-19). The
define guards for commit-slab-decl stll use "COMMIT_SLAB_HDR_H", which
no longer matches the file name. Let's fix this.

Signed-off-by: Abhishek Kumar <abhishekkumar8222@gmail.com>
---
 commit-slab-decl.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Junio C Hamano May 17, 2020, 3:44 p.m. UTC | #1
Abhishek Kumar <abhishekkumar8222@gmail.com> writes:

That's "guard" ;-)

> commit-slab was split into commit-slab-decl and commit-slab-impl header
> files by a9f1f1f9f8 ("commit-slab.h: code split", 2018-05-19). The
> define guards for commit-slab-decl stll use "COMMIT_SLAB_HDR_H", which
> no longer matches the file name. Let's fix this.

It would have been helpful to explain that the split did not break
anything because the other half of the split started using a new and
different proprocessor macro before saying "Let's fix".

It would have been "broken" that needs "fixing" if two headers
inherited the use of the same _HDR_H preprocessor macro, of course.

The patch obviously looks good.

> Signed-off-by: Abhishek Kumar <abhishekkumar8222@gmail.com>
> ---
>  commit-slab-decl.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/commit-slab-decl.h b/commit-slab-decl.h
> index adc7b46c83..bfbed1516a 100644
> --- a/commit-slab-decl.h
> +++ b/commit-slab-decl.h
> @@ -1,5 +1,5 @@
> -#ifndef COMMIT_SLAB_HDR_H
> -#define COMMIT_SLAB_HDR_H
> +#ifndef COMMIT_SLAB_DECL_H
> +#define COMMIT_SLAB_DECL_H
>  
>  /* allocate ~512kB at once, allowing for malloc overhead */
>  #ifndef COMMIT_SLAB_SIZE
> @@ -40,4 +40,4 @@ elemtype *slabname## _peek(struct slabname *s, const struct commit *c)
>  	declare_commit_slab(slabname, elemtype); \
>  	declare_commit_slab_prototypes(slabname, elemtype)
>  
> -#endif /* COMMIT_SLAB_HDR_H */
> +#endif /* COMMIT_SLAB_DECL_H */
diff mbox series

Patch

diff --git a/commit-slab-decl.h b/commit-slab-decl.h
index adc7b46c83..bfbed1516a 100644
--- a/commit-slab-decl.h
+++ b/commit-slab-decl.h
@@ -1,5 +1,5 @@ 
-#ifndef COMMIT_SLAB_HDR_H
-#define COMMIT_SLAB_HDR_H
+#ifndef COMMIT_SLAB_DECL_H
+#define COMMIT_SLAB_DECL_H
 
 /* allocate ~512kB at once, allowing for malloc overhead */
 #ifndef COMMIT_SLAB_SIZE
@@ -40,4 +40,4 @@  elemtype *slabname## _peek(struct slabname *s, const struct commit *c)
 	declare_commit_slab(slabname, elemtype); \
 	declare_commit_slab_prototypes(slabname, elemtype)
 
-#endif /* COMMIT_SLAB_HDR_H */
+#endif /* COMMIT_SLAB_DECL_H */