]> git.ipfire.org Git - thirdparty/git.git/commitdiff
xdiff: use ssize_t for dstart/dend, make them last in xdfile_t
authorEzekiel Newren <ezekielnewren@gmail.com>
Wed, 29 Oct 2025 22:19:40 +0000 (22:19 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Oct 2025 14:13:34 +0000 (07:13 -0700)
ssize_t is appropriate for dstart and dend because they both describe
positive or negative offsets relative to a pointer.

A future patch will move these fields to a different struct. Moving
them to the end of xdfile_t now, means the field order of xdfile_t will
be disturbed less.

Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
xdiff/xtypes.h

index f145abba3ea8a30f859dca127e3dda43fca8e07d..7c8c057bca16e96b2f28f40af249cd852722164e 100644 (file)
@@ -47,10 +47,10 @@ typedef struct s_xrecord {
 typedef struct s_xdfile {
        xrecord_t *recs;
        long nrec;
-       long dstart, dend;
        bool *changed;
        long *rindex;
        long nreff;
+       ptrdiff_t dstart, dend;
 } xdfile_t;
 
 typedef struct s_xdfenv {