diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-09-18 01:31:55 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-09-24 21:53:50 +0100 |
commit | 15cb4261665bab4ef02a5b1b9db48b9477c9b87a (patch) | |
tree | d0c40a45afa19fff26ce1eb5bb703e18a9acdd4a /toxav/rtp.c | |
parent | 0d347c2b2e69aa09b079f6daaa00007fef4fe52f (diff) |
Make toxcore code C++ compatible.
It is still C code, so still compatible with C compilers as well. This
change lets us see more clearly where implicit conversions occur by
making them explicit.
Diffstat (limited to 'toxav/rtp.c')
-rw-r--r-- | toxav/rtp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/toxav/rtp.c b/toxav/rtp.c index 534efc1a..edab1b1c 100644 --- a/toxav/rtp.c +++ b/toxav/rtp.c | |||
@@ -46,7 +46,7 @@ RTPSession *rtp_new(int payload_type, Messenger *m, uint32_t friendnumber, | |||
46 | assert(cs); | 46 | assert(cs); |
47 | assert(m); | 47 | assert(m); |
48 | 48 | ||
49 | RTPSession *retu = calloc(1, sizeof(RTPSession)); | 49 | RTPSession *retu = (RTPSession *)calloc(1, sizeof(RTPSession)); |
50 | 50 | ||
51 | if (!retu) { | 51 | if (!retu) { |
52 | LOGGER_WARNING(m->log, "Alloc failed! Program might misbehave!"); | 52 | LOGGER_WARNING(m->log, "Alloc failed! Program might misbehave!"); |
@@ -219,7 +219,8 @@ static struct RTPMessage *new_message(size_t allocate_len, const uint8_t *data, | |||
219 | { | 219 | { |
220 | assert(allocate_len >= data_length); | 220 | assert(allocate_len >= data_length); |
221 | 221 | ||
222 | struct RTPMessage *msg = calloc(sizeof(struct RTPMessage) + (allocate_len - sizeof(struct RTPHeader)), 1); | 222 | struct RTPMessage *msg = (struct RTPMessage *)calloc(sizeof(struct RTPMessage) + (allocate_len - sizeof( |
223 | struct RTPHeader)), 1); | ||
223 | 224 | ||
224 | msg->len = data_length - sizeof(struct RTPHeader); | 225 | msg->len = data_length - sizeof(struct RTPHeader); |
225 | memcpy(&msg->header, data, data_length); | 226 | memcpy(&msg->header, data, data_length); |
@@ -238,7 +239,7 @@ int handle_rtp_packet(Messenger *m, uint32_t friendnumber, const uint8_t *data, | |||
238 | (void) m; | 239 | (void) m; |
239 | (void) friendnumber; | 240 | (void) friendnumber; |
240 | 241 | ||
241 | RTPSession *session = object; | 242 | RTPSession *session = (RTPSession *)object; |
242 | 243 | ||
243 | data ++; | 244 | data ++; |
244 | length--; | 245 | length--; |