Skip to content

Commit bab5364

Browse files
committed
fix clang warnings
1 parent 45e5ea9 commit bab5364

File tree

5 files changed

+25
-16
lines changed

5 files changed

+25
-16
lines changed

auto_tests/conference_simple_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <stdio.h>
66
#include <stdlib.h>
7+
#include <string.h>
78
#include <sodium.h>
89

910
#include "../testing/misc_tools.h"

toxav/codecs/h264/codec.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ void my_log_callback(void *ptr, int level, const char *fmt, va_list vargs)
371371
// LOGGER_WARNING(global__log, fmt, vargs);
372372
}
373373

374+
#ifdef X264_ENCODE_USED
375+
#else
374376
static int exists_encoder_codec_by_name(char *codec_name)
375377
{
376378
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
@@ -386,7 +388,10 @@ static int exists_encoder_codec_by_name(char *codec_name)
386388

387389
return 0;
388390
}
391+
#endif
389392

393+
#ifdef X264_ENCODE_USED
394+
#else
390395
static int works_encoder_codec_by_name(char *codec_name)
391396
{
392397
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
@@ -466,6 +471,7 @@ static int works_encoder_codec_by_name(char *codec_name)
466471

467472
return 0;
468473
}
474+
#endif
469475

470476
VCSession *vc_new_h264(Logger *log, ToxAV *av, uint32_t friend_number, toxav_video_receive_frame_cb *cb, void *cb_data,
471477
VCSession *vc)

toxav/toxav.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,14 +319,14 @@ void toxav_iterate(ToxAV *av)
319319

320320
ToxAVCall *i = av->calls[av->calls_head];
321321

322-
LOGGER_API_DEBUG(av->tox, "iterate:000:START:h=%d t=%d i=%p", av->calls_head, av->calls_tail, i);
322+
LOGGER_API_DEBUG(av->tox, "iterate:000:START:h=%d t=%d i=%p", av->calls_head, av->calls_tail, (void *)i);
323323
uint32_t dummy_counter = 0;
324324
for (; i; i = i->next) {
325325
dummy_counter++;
326326

327327
audio_iterations = 0;
328328

329-
LOGGER_API_DEBUG(av->tox, "iterate:001:%d:i->active=%d i=%p", dummy_counter, (int)i->active, i);
329+
LOGGER_API_DEBUG(av->tox, "iterate:001:%d:i->active=%d i=%p", dummy_counter, (int)i->active, (void *)i);
330330

331331
if (i->active) {
332332

@@ -336,7 +336,7 @@ void toxav_iterate(ToxAV *av)
336336
pthread_mutex_unlock(av->mutex);
337337

338338
uint32_t fid = i->friend_number;
339-
LOGGER_API_DEBUG(av->tox, "iterate:002:%d:fnum=%d i=%p", dummy_counter, fid, i);
339+
LOGGER_API_DEBUG(av->tox, "iterate:002:%d:fnum=%d i=%p", dummy_counter, fid, (void *)i);
340340

341341
if ((!i->msi_call) || (i->active == 0))
342342
{

toxav/ts_buffer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ static bool tsb_return_oldest_entry_in_range(TSBuffer *b, Logger *log, void **p,
339339
return false;
340340
}
341341

342+
#if 0
342343
static bool tsb_return_newest_entry_in_range(TSBuffer *b, Logger *log, void **p, uint64_t *data_type,
343344
uint32_t *timestamp_out,
344345
const uint32_t timestamp_in, const uint32_t timestamp_range)
@@ -399,6 +400,7 @@ static bool tsb_return_newest_entry_in_range(TSBuffer *b, Logger *log, void **p,
399400
*p = NULL;
400401
return false;
401402
}
403+
#endif
402404

403405
bool tsb_read(TSBuffer *b, Logger *log, void **p, uint64_t *data_type, uint32_t *timestamp_out,
404406
const uint32_t timestamp_in, const uint32_t timestamp_range,

toxcore/Messenger.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2924,19 +2924,19 @@ uint32_t messenger_run_interval(const Messenger *m)
29242924
return crypto_interval;
29252925
}
29262926

2927-
static void m_tox_lock(pthread_mutex_t *mutex)
2928-
{
2929-
if (mutex != nullptr) {
2930-
pthread_mutex_lock(mutex);
2931-
}
2932-
}
2933-
2934-
static void m_tox_unlock(pthread_mutex_t *mutex)
2935-
{
2936-
if (mutex != nullptr) {
2937-
pthread_mutex_unlock(mutex);
2938-
}
2939-
}
2927+
// static void m_tox_lock(pthread_mutex_t *mutex)
2928+
// {
2929+
// if (mutex != nullptr) {
2930+
// pthread_mutex_lock(mutex);
2931+
// }
2932+
// }
2933+
2934+
// static void m_tox_unlock(pthread_mutex_t *mutex)
2935+
// {
2936+
// if (mutex != nullptr) {
2937+
// pthread_mutex_unlock(mutex);
2938+
// }
2939+
// }
29402940

29412941
// #define DEBUG_DO_MESSENGER 1
29422942

0 commit comments

Comments
 (0)