ewah: drop ewah_serialize_native function

We don't call this function, and never have. The on-disk bitmap format uses network-byte-order integers, meaning that we cannot use the native-byte-order format written here. Let's drop it in the name of simplicity. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jun 14, 2018 at 23:32 UTC 26675087a58e1e7dd54bc0f059ad2f831c6e3fbf
2 files changed -27
ewah/ewah_io.c
-26
@@ -20,32 +20,6 @@
20 #include "ewok.h"
21 #include "strbuf.h"
22
23 -int ewah_serialize_native(struct ewah_bitmap *self, int fd)
24 -{
25 - uint32_t write32;
26 - size_t to_write = self->buffer_size * 8;
27 -
28 - /* 32 bit -- bit size for the map */
29 - write32 = (uint32_t)self->bit_size;
30 - if (write(fd, &write32, 4) != 4)
31 - return -1;
32 -
33 - /** 32 bit -- number of compressed 64-bit words */
34 - write32 = (uint32_t)self->buffer_size;
35 - if (write(fd, &write32, 4) != 4)
36 - return -1;
37 -
38 - if (write(fd, self->buffer, to_write) != to_write)
39 - return -1;
40 -
41 - /** 32 bit -- position for the RLW */
42 - write32 = self->rlw - self->buffer;
43 - if (write(fd, &write32, 4) != 4)
44 - return -1;
45 -
46 - return (3 * 4) + to_write;
47 -}
48 -
23 int ewah_serialize_to(struct ewah_bitmap *self,
24 int (*write_fun)(void *, const void *, size_t),
25 void *data)
ewah/ewok.h
-1
@@ -86,7 +86,6 @@ void ewah_free(struct ewah_bitmap *self);
86 int ewah_serialize_to(struct ewah_bitmap *self,
87 int (*write_fun)(void *out, const void *buf, size_t len),
88 void *out);
89 -int ewah_serialize_native(struct ewah_bitmap *self, int fd);
89 int ewah_serialize_strbuf(struct ewah_bitmap *self, struct strbuf *);
90
91 ssize_t ewah_read_mmap(struct ewah_bitmap *self, const void *map, size_t len);