Commit 72b169e6 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Fix compiler warnings.

parent df890213
Pipeline #77 passed with stage
......@@ -189,6 +189,8 @@ void PrrtBlock_encode(PrrtBlock *block_ptr, uint16_t *seqno)
bool PrrtBlock_decode(PrrtBlock *block_ptr)
{
int i, j = 0;
gf **fec = NULL;
int *idx_p = NULL;
uint8_t n = block_ptr->codingParams.n;
uint8_t k = block_ptr->codingParams.k;
uint16_t baseSequenceNumber = block_ptr->baseSequenceNumber;
......@@ -198,13 +200,13 @@ bool PrrtBlock_decode(PrrtBlock *block_ptr)
PrrtCoder_get_coder(&coder, n, k);
gf **fec = calloc(k, sizeof(gf *));
fec = calloc(k, sizeof(gf *));
check_mem(fec);
for(i = 0; i < k; i++) {
fec[i] = calloc(block_ptr->largestDataLength, sizeof(gf));
}
int *idx_p = calloc(k, sizeof(int));
idx_p = calloc(k, sizeof(int));
check_mem(idx_p);
for(i = 0; i < k; i++) {
idx_p[i] = -1;
......@@ -246,4 +248,4 @@ bool PrrtBlock_decode(PrrtBlock *block_ptr)
PrrtPacket *PrrtBlock_get_first_red_data(PrrtBlock *block_ptr)
{
return List_shift(block_ptr->redundancyPackets);
}
\ No newline at end of file
}
......@@ -3,7 +3,7 @@
#include "../defines.h"
#include "coding_params.h"
PrrtCodingParams *PrrtCodingParams_create()
PrrtCodingParams *PrrtCodingParams_create(void)
{
PrrtCodingParams *cpar = calloc(1, sizeof(PrrtCodingParams));
check_mem(cpar);
......@@ -23,4 +23,5 @@ PrrtCodingParams *PrrtCodingParams_create()
bool PrrtCodingParams_destroy(PrrtCodingParams * cpar) {
pthread_mutex_destroy(&cpar->lock);
free(cpar);
}
\ No newline at end of file
return true;
}
......@@ -13,8 +13,7 @@ typedef struct prrtCodingParams {
uint8_t n_p;
} PrrtCodingParams;
PrrtCodingParams * PrrtCodingParams_create();
PrrtCodingParams * PrrtCodingParams_create(void);
bool PrrtCodingParams_destroy(PrrtCodingParams * cpar);
#endif //PRRT_CODING_PARAMS_H
#include <netdb.h>
#include <stdio.h>
#include <arpa/inet.h>
#include <src/prrt/clock.h>
#include "../../defines.h"
#include "../../util/dbg.h"
#include "../../util/common.h"
#include "../socket.h"
#include "../block.h"
#include "../clock.h"
#include "../socket.h"
#include "data_receiver.h"
void retrieve_data_blocks(PrrtSocket *sock_ptr, uint16_t base_seqno, uint8_t k, const PrrtBlock *block)
......@@ -183,4 +183,4 @@ void *receive_data_loop(void *ptr)
error:
PNOTIMPLEMENTED("SHOULD IMPLEMENT ERROR HANDLER HERE");
}
\ No newline at end of file
}
......@@ -15,6 +15,7 @@ PrrtReceiver *PrrtReceiver_create(const char *host, uint16_t port)
error:
if(recv != NULL) { free(recv); }
PERROR("Memory issue.%s","");
return NULL;
}
bool PrrtReceiver_destroy(PrrtReceiver *receiver)
......
Supports Markdown
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