Commit e83e7afe authored by Andreas Schmidt's avatar Andreas Schmidt

Fix compiler warnings.

parent 9681988e
......@@ -9,7 +9,7 @@
void gather_redundancy_packets(const PrrtBlock *block_ptr, gf *const *fec, int *idx_p)
{
int i;
uint32_t i;
uint32_t m = List_count(block_ptr->dataPackets);
PrrtPacket *packet = NULL;
......@@ -25,7 +25,7 @@ void gather_redundancy_packets(const PrrtBlock *block_ptr, gf *const *fec, int *
void gather_data_packets(PrrtBlock *block_ptr, gf *const *fec, int *idx_p)
{
int m = 0;
uint32_t m = 0;
uint32_t dataBlocks = List_count(block_ptr->dataPackets);
for(m = 0; m < dataBlocks; m++) {
PrrtPacket *packet = List_shift(block_ptr->dataPackets);
......
......@@ -104,6 +104,7 @@ PrrtPacket *PrrtPacket_copy(PrrtPacket *original)
return newPacket;
error:
PERROR("Not enough memory for packet copies.%s", "");
return NULL;
}
PrrtPacket *create_header(uint8_t priority, uint16_t seqno, uint32_t size, uint8_t type, uint8_t index)
......@@ -121,6 +122,7 @@ PrrtPacket *create_header(uint8_t priority, uint16_t seqno, uint32_t size, uint8
error:
PERROR("Could not create packet.%s", "");
return NULL;
}
int PrrtPacket_encode(void *buf_ptr, uint16_t buf_size, PrrtPacket *packet_ptr)
......@@ -422,6 +424,7 @@ PrrtPacket *PrrtPacket_create_data_packet(uint8_t priority, const void *payloadP
error:
PERROR("Could not create packet.%s","");
return NULL;
}
PrrtPacket *PrrtPacket_create_redundancy_packet(uint8_t priority, void *payloadPointer, uint32_t payloadLength,
......
......@@ -82,7 +82,7 @@ void * send_data_loop(void *ptr) {
PrrtBlock_insert_data_packet(block, packet);
if (PrrtBlock_encode_ready(block)) {
int j = 0;
uint32_t j = 0;
PrrtBlock_encode(block, &sock_ptr->sequenceNumberRedundancy);
uint32_t redundancyBlocks = List_count(block->redundancyPackets);
......
......@@ -134,7 +134,7 @@ int32_t PrrtSocket_recv(PrrtSocket *sock_ptr, void *buf_ptr) {
return len;
}
error:
PERROR("Wrong socket type.", "");
PERROR("Wrong socket type.%s", "");
return -1;
}
......@@ -171,6 +171,7 @@ int PrrtSocket_interrupt(PrrtSocket *sock_ptr) {
sock_ptr->receiveFeedbackThread = 0;
}
debug("Interrupted all threads.");
return EXIT_SUCCESS;
}
int PrrtSocket_close(PrrtSocket *sock_ptr) {
......
......@@ -3,13 +3,14 @@
#include "common.h"
// Taken from: http://c.learncodethehardway.org/book/ex32.html
List *List_create()
List *List_create(void)
{
void *p = calloc(1, sizeof(List));
check_mem(p);
return p;
error:
PERROR("Could not create necessary list%s.", "");
PERROR("Could not create necessary list%s.", "");
return NULL;
}
void List_destroy(const List *list)
......@@ -60,7 +61,8 @@ void List_push(List *list, const void *value)
return;
error:
PERROR("Cannot add necessary list item: %p.", value);
PERROR("Cannot add necessary list item: %p.", value);
return;
}
void *List_pop(const List *list)
......@@ -89,7 +91,8 @@ void List_unshift(List *list, const void *value)
return;
error:
PERROR("Cannot add necessary list item: %p.", value);
PERROR("Cannot add necessary list item: %p.", value);
return;
}
void *List_shift(const List *list)
......@@ -112,7 +115,7 @@ void *List_remove(List *list, const ListNode *node)
list->first = node->next;
list->first->prev = NULL;
check(list->first != NULL, "Invalid list, somehow got a first that is NULL.");
} else if (node == list->last) {
} else if(node == list->last) {
list->last = node->prev;
list->last->next = NULL;
check(list->last != NULL, "Invalid list, somehow got a next that is NULL.");
......@@ -129,5 +132,6 @@ void *List_remove(List *list, const ListNode *node)
return result;
error:
PERROR("Cannot remove list item: %p.", node);
PERROR("Cannot remove list item: %p.", node);
return NULL;
}
\ No newline at end of file
......@@ -20,7 +20,7 @@ typedef struct list {
ListNode *last;
} List;
List *List_create();
List *List_create(void);
void List_destroy(const List *list);
void List_clear(const List *list);
void List_clear_destroy(const List *list);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment