lib: make buf arg const in write_fd pointer

For capn_write_fd() the write() function would be ideal to pass as
write_fd, but write() has type ssize_t (*)(int, const void *, size_t),
whereas write_fd expects ssize_t (*)(int, void *, size_t). Passing
write() directly with GCC 5.4 causes a warning
-Wincompatible-pointer-types (on by default).
This commit is contained in:
Theo Hill 2016-08-06 17:42:19 -07:00
parent 75f79010f6
commit 7b7346a73c
2 changed files with 3 additions and 3 deletions

View file

@ -266,7 +266,7 @@ int capn_init_mem(struct capn *c, const uint8_t *p, size_t sz, int packed);
*/
/* TODO */
/*int capn_write_fp(struct capn *c, FILE *f, int packed);*/
int capn_write_fd(struct capn *c, ssize_t (*write_fd)(int fd, void *p, size_t count), int fd, int packed);
int capn_write_fd(struct capn *c, ssize_t (*write_fd)(int fd, const void *p, size_t count), int fd, int packed);
int capn_write_mem(struct capn *c, uint8_t *p, size_t sz, int packed);
void capn_free(struct capn *c);