Skip to content

Commit 2667508

Browse files
peffgitster
authored andcommitted
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>
1 parent caa8814 commit 2667508

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

ewah/ewah_io.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,6 @@
2020
#include "ewok.h"
2121
#include "strbuf.h"
2222

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-
4923
int ewah_serialize_to(struct ewah_bitmap *self,
5024
int (*write_fun)(void *, const void *, size_t),
5125
void *data)

ewah/ewok.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ void ewah_free(struct ewah_bitmap *self);
8686
int ewah_serialize_to(struct ewah_bitmap *self,
8787
int (*write_fun)(void *out, const void *buf, size_t len),
8888
void *out);
89-
int ewah_serialize_native(struct ewah_bitmap *self, int fd);
9089
int ewah_serialize_strbuf(struct ewah_bitmap *self, struct strbuf *);
9190

9291
ssize_t ewah_read_mmap(struct ewah_bitmap *self, const void *map, size_t len);

0 commit comments

Comments
 (0)