ptrdiff_t, not ssize_t

* src/buffer.c (bufmap_reset, _flush_write):
Use ptrdiff_t, not ssize_t, to record pointer differences.
POSIX allows systems where size_t is 64 bits but ssize_t is only 32;
Ultrix used to do that, though no current systems do.
This commit is contained in:
Paul Eggert
2024-08-01 07:15:01 -07:00
parent a9372cf08a
commit bf195d4ae4

View File

@@ -195,7 +195,7 @@ bufmap_free (struct bufmap *mark)
}
static void
bufmap_reset (struct bufmap *map, ssize_t fixup)
bufmap_reset (struct bufmap *map, ptrdiff_t fixup)
{
bufmap_free (map);
if (map)
@@ -877,7 +877,7 @@ _flush_write (void)
if (map)
{
size_t delta = status - map->start * BLOCKSIZE;
ssize_t diff;
ptrdiff_t diff;
map->nblocks += delta / BLOCKSIZE;
if (delta > map->sizeleft)
delta = map->sizeleft;