[PATCH] range-diff: fix some 'hdr-check' and sparse warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ramsay Jones <ramsay@xxxxxxxxxxxxxxxxxxxx>
---

Hi Thomas,

If you need to re-roll your 'tg/range-diff-output-update' branch, could
you please squash (parts) of this into the relevant patches.

The first hunk fixes a couple of 'hdr-check' warnings:

  $ diff nhcout phcout | head
  4a5,13
  > apply.h:146:22: error: ‘GIT_MAX_HEXSZ’ undeclared here (not in a function); did you mean ‘NI_MAXHOST’?
  >   char old_oid_prefix[GIT_MAX_HEXSZ + 1];
  >                       ^~~~~~~~~~~~~
  >                       NI_MAXHOST
  > apply.h:151:19: error: array type has incomplete element type ‘struct object_id’
  >   struct object_id threeway_stage[3];
  >                    ^~~~~~~~~~~~~~
  > Makefile:2775: recipe for target 'apply.hco' failed
  > make: *** [apply.hco] Error 1
  $ 

and needs to be applied to commit b9f62a7e24 ("apply: make parse_git_header
public", 2019-07-08).

The second hunk fixes a sparse 'Using plain integer as NULL pointer'
warning, and needs to be applied to commit 04539fc67b ("range-diff: add
section header instead of diff header", 2019-07-08).

Thanks!

ATB,
Ramsay Jones

 apply.h      | 1 +
 range-diff.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/apply.h b/apply.h
index ade50f66c5..c8c9287cb2 100644
--- a/apply.h
+++ b/apply.h
@@ -3,6 +3,7 @@
 
 #include "lockfile.h"
 #include "string-list.h"
+#include "hash.h"
 
 struct repository;
 
diff --git a/range-diff.c b/range-diff.c
index ba1e9a4265..0f24a4ad12 100644
--- a/range-diff.c
+++ b/range-diff.c
@@ -102,7 +102,7 @@ static int read_patches(const char *range, struct string_list *list)
 		}
 
 		if (starts_with(line, "diff --git")) {
-			struct patch patch = { 0 };
+			struct patch patch = { NULL };
 			struct strbuf root = STRBUF_INIT;
 			int linenr = 0;
 
-- 
2.22.0



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux