diff options
author | iphydf <iphydf@users.noreply.github.com> | 2020-03-18 03:41:02 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2020-03-18 15:14:31 +0000 |
commit | 84e6a8d05704d9f4db79898984af861d759c478a (patch) | |
tree | 199269e7142a5ad4417e1405f4ff4350d7bad1fa /toxav/toxav.c | |
parent | 36cb30d47d84619c41cfea755a6122f3c2e7c75c (diff) |
Make function defns match their decls regarding storage class.
We want functions declared as `static` to also be defined as `static`.
Diffstat (limited to 'toxav/toxav.c')
-rw-r--r-- | toxav/toxav.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/toxav/toxav.c b/toxav/toxav.c index a30bd7fb..2d753176 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c | |||
@@ -956,7 +956,7 @@ void toxav_callback_video_receive_frame(ToxAV *av, toxav_video_receive_frame_cb | |||
956 | * :: Internal | 956 | * :: Internal |
957 | * | 957 | * |
958 | ******************************************************************************/ | 958 | ******************************************************************************/ |
959 | void callback_bwc(BWController *bwc, uint32_t friend_number, float loss, void *user_data) | 959 | static void callback_bwc(BWController *bwc, uint32_t friend_number, float loss, void *user_data) |
960 | { | 960 | { |
961 | /* Callback which is called when the internal measure mechanism reported packet loss. | 961 | /* Callback which is called when the internal measure mechanism reported packet loss. |
962 | * We report suggested lowered bitrate to an app. If app is sending both audio and video, | 962 | * We report suggested lowered bitrate to an app. If app is sending both audio and video, |
@@ -1001,7 +1001,7 @@ void callback_bwc(BWController *bwc, uint32_t friend_number, float loss, void *u | |||
1001 | 1001 | ||
1002 | pthread_mutex_unlock(call->av->mutex); | 1002 | pthread_mutex_unlock(call->av->mutex); |
1003 | } | 1003 | } |
1004 | int callback_invite(void *toxav_inst, MSICall *call) | 1004 | static int callback_invite(void *toxav_inst, MSICall *call) |
1005 | { | 1005 | { |
1006 | ToxAV *toxav = (ToxAV *)toxav_inst; | 1006 | ToxAV *toxav = (ToxAV *)toxav_inst; |
1007 | pthread_mutex_lock(toxav->mutex); | 1007 | pthread_mutex_lock(toxav->mutex); |
@@ -1029,7 +1029,7 @@ int callback_invite(void *toxav_inst, MSICall *call) | |||
1029 | pthread_mutex_unlock(toxav->mutex); | 1029 | pthread_mutex_unlock(toxav->mutex); |
1030 | return 0; | 1030 | return 0; |
1031 | } | 1031 | } |
1032 | int callback_start(void *toxav_inst, MSICall *call) | 1032 | static int callback_start(void *toxav_inst, MSICall *call) |
1033 | { | 1033 | { |
1034 | ToxAV *toxav = (ToxAV *)toxav_inst; | 1034 | ToxAV *toxav = (ToxAV *)toxav_inst; |
1035 | pthread_mutex_lock(toxav->mutex); | 1035 | pthread_mutex_lock(toxav->mutex); |
@@ -1057,7 +1057,7 @@ int callback_start(void *toxav_inst, MSICall *call) | |||
1057 | pthread_mutex_unlock(toxav->mutex); | 1057 | pthread_mutex_unlock(toxav->mutex); |
1058 | return 0; | 1058 | return 0; |
1059 | } | 1059 | } |
1060 | int callback_end(void *toxav_inst, MSICall *call) | 1060 | static int callback_end(void *toxav_inst, MSICall *call) |
1061 | { | 1061 | { |
1062 | ToxAV *toxav = (ToxAV *)toxav_inst; | 1062 | ToxAV *toxav = (ToxAV *)toxav_inst; |
1063 | pthread_mutex_lock(toxav->mutex); | 1063 | pthread_mutex_lock(toxav->mutex); |
@@ -1072,7 +1072,7 @@ int callback_end(void *toxav_inst, MSICall *call) | |||
1072 | pthread_mutex_unlock(toxav->mutex); | 1072 | pthread_mutex_unlock(toxav->mutex); |
1073 | return 0; | 1073 | return 0; |
1074 | } | 1074 | } |
1075 | int callback_error(void *toxav_inst, MSICall *call) | 1075 | static int callback_error(void *toxav_inst, MSICall *call) |
1076 | { | 1076 | { |
1077 | ToxAV *toxav = (ToxAV *)toxav_inst; | 1077 | ToxAV *toxav = (ToxAV *)toxav_inst; |
1078 | pthread_mutex_lock(toxav->mutex); | 1078 | pthread_mutex_lock(toxav->mutex); |
@@ -1087,7 +1087,7 @@ int callback_error(void *toxav_inst, MSICall *call) | |||
1087 | pthread_mutex_unlock(toxav->mutex); | 1087 | pthread_mutex_unlock(toxav->mutex); |
1088 | return 0; | 1088 | return 0; |
1089 | } | 1089 | } |
1090 | int callback_capabilites(void *toxav_inst, MSICall *call) | 1090 | static int callback_capabilites(void *toxav_inst, MSICall *call) |
1091 | { | 1091 | { |
1092 | ToxAV *toxav = (ToxAV *)toxav_inst; | 1092 | ToxAV *toxav = (ToxAV *)toxav_inst; |
1093 | pthread_mutex_lock(toxav->mutex); | 1093 | pthread_mutex_lock(toxav->mutex); |
@@ -1109,14 +1109,14 @@ int callback_capabilites(void *toxav_inst, MSICall *call) | |||
1109 | pthread_mutex_unlock(toxav->mutex); | 1109 | pthread_mutex_unlock(toxav->mutex); |
1110 | return 0; | 1110 | return 0; |
1111 | } | 1111 | } |
1112 | bool audio_bit_rate_invalid(uint32_t bit_rate) | 1112 | static bool audio_bit_rate_invalid(uint32_t bit_rate) |
1113 | { | 1113 | { |
1114 | /* Opus RFC 6716 section-2.1.1 dictates the following: | 1114 | /* Opus RFC 6716 section-2.1.1 dictates the following: |
1115 | * Opus supports all bit rates from 6 kbit/s to 510 kbit/s. | 1115 | * Opus supports all bit rates from 6 kbit/s to 510 kbit/s. |
1116 | */ | 1116 | */ |
1117 | return bit_rate < 6 || bit_rate > 510; | 1117 | return bit_rate < 6 || bit_rate > 510; |
1118 | } | 1118 | } |
1119 | bool video_bit_rate_invalid(uint32_t bit_rate) | 1119 | static bool video_bit_rate_invalid(uint32_t bit_rate) |
1120 | { | 1120 | { |
1121 | /* https://www.webmproject.org/docs/webm-sdk/structvpx__codec__enc__cfg.html shows the following: | 1121 | /* https://www.webmproject.org/docs/webm-sdk/structvpx__codec__enc__cfg.html shows the following: |
1122 | * unsigned int rc_target_bitrate | 1122 | * unsigned int rc_target_bitrate |
@@ -1127,7 +1127,7 @@ bool video_bit_rate_invalid(uint32_t bit_rate) | |||
1127 | */ | 1127 | */ |
1128 | return bit_rate > UINT_MAX; | 1128 | return bit_rate > UINT_MAX; |
1129 | } | 1129 | } |
1130 | bool invoke_call_state_callback(ToxAV *av, uint32_t friend_number, uint32_t state) | 1130 | static bool invoke_call_state_callback(ToxAV *av, uint32_t friend_number, uint32_t state) |
1131 | { | 1131 | { |
1132 | if (av->scb) { | 1132 | if (av->scb) { |
1133 | av->scb(av, friend_number, state, av->scb_user_data); | 1133 | av->scb(av, friend_number, state, av->scb_user_data); |
@@ -1138,7 +1138,7 @@ bool invoke_call_state_callback(ToxAV *av, uint32_t friend_number, uint32_t stat | |||
1138 | return true; | 1138 | return true; |
1139 | } | 1139 | } |
1140 | 1140 | ||
1141 | ToxAVCall *call_new(ToxAV *av, uint32_t friend_number, Toxav_Err_Call *error) | 1141 | static ToxAVCall *call_new(ToxAV *av, uint32_t friend_number, Toxav_Err_Call *error) |
1142 | { | 1142 | { |
1143 | /* Assumes mutex locked */ | 1143 | /* Assumes mutex locked */ |
1144 | Toxav_Err_Call rc = TOXAV_ERR_CALL_OK; | 1144 | Toxav_Err_Call rc = TOXAV_ERR_CALL_OK; |
@@ -1228,7 +1228,7 @@ RETURN: | |||
1228 | return call; | 1228 | return call; |
1229 | } | 1229 | } |
1230 | 1230 | ||
1231 | ToxAVCall *call_get(ToxAV *av, uint32_t friend_number) | 1231 | static ToxAVCall *call_get(ToxAV *av, uint32_t friend_number) |
1232 | { | 1232 | { |
1233 | /* Assumes mutex locked */ | 1233 | /* Assumes mutex locked */ |
1234 | if (av->calls == nullptr || av->calls_tail < friend_number) { | 1234 | if (av->calls == nullptr || av->calls_tail < friend_number) { |
@@ -1238,7 +1238,7 @@ ToxAVCall *call_get(ToxAV *av, uint32_t friend_number) | |||
1238 | return av->calls[friend_number]; | 1238 | return av->calls[friend_number]; |
1239 | } | 1239 | } |
1240 | 1240 | ||
1241 | ToxAVCall *call_remove(ToxAVCall *call) | 1241 | static ToxAVCall *call_remove(ToxAVCall *call) |
1242 | { | 1242 | { |
1243 | if (call == nullptr) { | 1243 | if (call == nullptr) { |
1244 | return nullptr; | 1244 | return nullptr; |
@@ -1288,7 +1288,7 @@ CLEAR: | |||
1288 | return nullptr; | 1288 | return nullptr; |
1289 | } | 1289 | } |
1290 | 1290 | ||
1291 | bool call_prepare_transmission(ToxAVCall *call) | 1291 | static bool call_prepare_transmission(ToxAVCall *call) |
1292 | { | 1292 | { |
1293 | /* Assumes mutex locked */ | 1293 | /* Assumes mutex locked */ |
1294 | 1294 | ||
@@ -1371,7 +1371,7 @@ FAILURE_2: | |||
1371 | return false; | 1371 | return false; |
1372 | } | 1372 | } |
1373 | 1373 | ||
1374 | void call_kill_transmission(ToxAVCall *call) | 1374 | static void call_kill_transmission(ToxAVCall *call) |
1375 | { | 1375 | { |
1376 | if (call == nullptr || call->active == 0) { | 1376 | if (call == nullptr || call->active == 0) { |
1377 | return; | 1377 | return; |