diff options
author | Mattias Andrée <maandree@kth.se> | 2016-07-10 22:15:24 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-07-10 22:15:24 +0200 |
commit | a7f0392ccb88f7faa7ca3f15d4ccfcf637896d1d (patch) | |
tree | 000db8e2281e951d432b5da7ae212dfc65c6ceb6 /src/filter.c | |
parent | Add makefile (diff) | |
download | coopgammad-a7f0392ccb88f7faa7ca3f15d4ccfcf637896d1d.tar.gz coopgammad-a7f0392ccb88f7faa7ca3f15d4ccfcf637896d1d.tar.bz2 coopgammad-a7f0392ccb88f7faa7ca3f15d4ccfcf637896d1d.tar.xz |
Fix warnings (and two errors)
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/filter.c')
-rw-r--r-- | src/filter.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/filter.c b/src/filter.c index 80e3ed1..508fd5f 100644 --- a/src/filter.c +++ b/src/filter.c @@ -89,7 +89,7 @@ size_t filter_marshal(const struct filter* this, char* buf, size_t ramps_size) { if (buf != NULL) memcpy(buf + off, this->ramps, ramps_size); - off += n; + off += ramps_size; } return off; @@ -116,10 +116,10 @@ size_t filter_unmarshal(struct filter* this, const char* buf, size_t ramps_size) this->class = NULL; this->ramps = NULL; - this->priority = *(int64_t*)(buf + off); + this->priority = *(const int64_t*)(buf + off); off += sizeof(int64_t); - this->lifespan = *(enum lifespan*)(buf + off); + this->lifespan = *(const enum lifespan*)(buf + off); off += sizeof(enum lifespan); if (nonnulls & 1) @@ -142,7 +142,7 @@ size_t filter_unmarshal(struct filter* this, const char* buf, size_t ramps_size) { if (!(this->ramps = memdup(buf + off, ramps_size))) goto fail; - off += n; + off += ramps_size; } return off; |