From 3cafbf3cfe5c58a6988dbfc4c29148ebb804f5c2 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Fri, 21 Oct 2016 20:13:41 +0200 Subject: build: Compile with strict conversion This has the code checked with -Wcast-qual and -Wconversion flags. These flags were removed because SWIG generated code fails. --- src/ipcpd/normal/shm_pci.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/ipcpd/normal/shm_pci.c') diff --git a/src/ipcpd/normal/shm_pci.c b/src/ipcpd/normal/shm_pci.c index 3a16a2da..aa18fa38 100644 --- a/src/ipcpd/normal/shm_pci.c +++ b/src/ipcpd/normal/shm_pci.c @@ -39,13 +39,12 @@ #define TTL_SIZE 1 #define CHK_SIZE 4 -static int shm_pci_head_size(struct dt_const * dtc) +static size_t shm_pci_head_size(struct dt_const * dtc) { - int len = 0; + size_t len = 0; len = dtc->addr_size * 2 + dtc->cep_id_size * 2 - + dtc->pdu_length_size + dtc->seqno_size - + QOS_ID_SIZE; + + dtc->pdu_length_size + dtc->seqno_size + QOS_ID_SIZE; if (dtc->has_ttl) len += TTL_SIZE; @@ -53,7 +52,7 @@ static int shm_pci_head_size(struct dt_const * dtc) return len; } -static int shm_pci_tail_size(struct dt_const * dtc) +static size_t shm_pci_tail_size(struct dt_const * dtc) { return dtc->has_chk ? CHK_SIZE : 0; } @@ -162,10 +161,11 @@ struct pci * shm_pci_des(struct shm_du_buff * sdb) int offset = 0; struct dt_const * dtc; - head = shm_du_buff_head(sdb); - if (head == NULL) + if (sdb == NULL) return NULL; + head = shm_du_buff_head(sdb); + dtc = ribmgr_dt_const(); if (dtc == NULL) return NULL; @@ -221,7 +221,7 @@ int shm_pci_shrink(struct shm_du_buff * sdb) int shm_pci_dec_ttl(struct shm_du_buff * sdb) { struct dt_const * dtc; - int offset = 0; + size_t offset = 0; uint8_t * head; uint8_t * tail; -- cgit v1.2.3