diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-10-21 20:13:41 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-10-22 13:27:02 +0200 |
commit | 3cafbf3cfe5c58a6988dbfc4c29148ebb804f5c2 (patch) | |
tree | 881da180b8d801c38ba0fbad2fc9f387a70ec016 /src/ipcpd/normal/shm_pci.c | |
parent | d5a52f3951fff7ee272bd0d4cd95cd122d07fa64 (diff) | |
download | ouroboros-3cafbf3cfe5c58a6988dbfc4c29148ebb804f5c2.tar.gz ouroboros-3cafbf3cfe5c58a6988dbfc4c29148ebb804f5c2.zip |
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.
Diffstat (limited to 'src/ipcpd/normal/shm_pci.c')
-rw-r--r-- | src/ipcpd/normal/shm_pci.c | 16 |
1 files changed, 8 insertions, 8 deletions
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; |