xdiff: move sign comparison warning guard into each file

Allow each file to fix the warnings guarded by the macro separately by moving the definition from the shared xinclude.h into each file that needs it. xmerge.c and xprepare.c do not contain any signed vs. unsigned comparisons so the definition was not included in these files. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

David Aguilar committed Feb 11, 2025 at 22:04 UTC 9d16f8958467be0162441820d56eb7697453e120
5 files changed +9 -2
xdiff/xemit.c
+2
@@ -20,6 +20,8 @@
20 *
21 */
22
23 +#define DISABLE_SIGN_COMPARE_WARNINGS
24 +
25 #include "xinclude.h"
26
27 static long xdl_get_rec(xdfile_t *xdf, long ri, char const **rec) {
xdiff/xhistogram.c
+2
@@ -41,6 +41,8 @@
41 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 */
43
44 +#define DISABLE_SIGN_COMPARE_WARNINGS
45 +
46 #include "xinclude.h"
47
48 #define MAX_PTR UINT_MAX
xdiff/xinclude.h
-2
@@ -23,8 +23,6 @@
23 #if !defined(XINCLUDE_H)
24 #define XINCLUDE_H
25
26 -#define DISABLE_SIGN_COMPARE_WARNINGS
27 -
26 #include "git-compat-util.h"
27 #include "xmacros.h"
28 #include "xdiff.h"
xdiff/xpatience.c
+3
@@ -19,6 +19,9 @@
19 * Davide Libenzi <davidel@xmailserver.org>
20 *
21 */
22 +
23 +#define DISABLE_SIGN_COMPARE_WARNINGS
24 +
25 #include "xinclude.h"
26
27 /*
xdiff/xutils.c
+2
@@ -20,6 +20,8 @@
20 *
21 */
22
23 +#define DISABLE_SIGN_COMPARE_WARNINGS
24 +
25 #include "xinclude.h"
26
27