Skip to content

Commit

Permalink
Match parameter names in declarations with their definitions.
Browse files Browse the repository at this point in the history
The parameter names were taken from function definitions to update the names in
function declarations (prototypes).
  • Loading branch information
iphydf committed Sep 1, 2016
1 parent 576f130 commit 9e6e8af
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 105 deletions.
2 changes: 1 addition & 1 deletion toxav/rtp.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ typedef struct {
} RTPSession;


RTPSession *rtp_new (int payload_type, Messenger *m, uint32_t friend_num,
RTPSession *rtp_new (int payload_type, Messenger *m, uint32_t friendnumber,
BWController *bwc, void *cs,
int (*mcb) (void *, struct RTPMessage *));
void rtp_kill (RTPSession *session);
Expand Down
20 changes: 10 additions & 10 deletions toxav/toxav.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@ bool toxav_call(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate, uint

return rc == TOXAV_ERR_CALL_OK;
}
void toxav_callback_call(ToxAV *av, toxav_call_cb *function, void *user_data)
void toxav_callback_call(ToxAV *av, toxav_call_cb *callback, void *user_data)
{
pthread_mutex_lock(av->mutex);
av->ccb.first = function;
av->ccb.first = callback;
av->ccb.second = user_data;
pthread_mutex_unlock(av->mutex);
}
Expand Down Expand Up @@ -386,10 +386,10 @@ bool toxav_answer(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate, ui

return rc == TOXAV_ERR_ANSWER_OK;
}
void toxav_callback_call_state(ToxAV *av, toxav_call_state_cb *function, void *user_data)
void toxav_callback_call_state(ToxAV *av, toxav_call_state_cb *callback, void *user_data)
{
pthread_mutex_lock(av->mutex);
av->scb.first = function;
av->scb.first = callback;
av->scb.second = user_data;
pthread_mutex_unlock(av->mutex);
}
Expand Down Expand Up @@ -662,10 +662,10 @@ bool toxav_bit_rate_set(ToxAV *av, uint32_t friend_number, int32_t audio_bit_rat

return rc == TOXAV_ERR_BIT_RATE_SET_OK;
}
void toxav_callback_bit_rate_status(ToxAV *av, toxav_bit_rate_status_cb *function, void *user_data)
void toxav_callback_bit_rate_status(ToxAV *av, toxav_bit_rate_status_cb *callback, void *user_data)
{
pthread_mutex_lock(av->mutex);
av->bcb.first = function;
av->bcb.first = callback;
av->bcb.second = user_data;
pthread_mutex_unlock(av->mutex);
}
Expand Down Expand Up @@ -854,17 +854,17 @@ bool toxav_video_send_frame(ToxAV *av, uint32_t friend_number, uint16_t width, u

return rc == TOXAV_ERR_SEND_FRAME_OK;
}
void toxav_callback_audio_receive_frame(ToxAV *av, toxav_audio_receive_frame_cb *function, void *user_data)
void toxav_callback_audio_receive_frame(ToxAV *av, toxav_audio_receive_frame_cb *callback, void *user_data)
{
pthread_mutex_lock(av->mutex);
av->acb.first = function;
av->acb.first = callback;
av->acb.second = user_data;
pthread_mutex_unlock(av->mutex);
}
void toxav_callback_video_receive_frame(ToxAV *av, toxav_video_receive_frame_cb *function, void *user_data)
void toxav_callback_video_receive_frame(ToxAV *av, toxav_video_receive_frame_cb *callback, void *user_data)
{
pthread_mutex_lock(av->mutex);
av->vcb.first = function;
av->vcb.first = callback;
av->vcb.second = user_data;
pthread_mutex_unlock(av->mutex);
}
Expand Down
42 changes: 20 additions & 22 deletions toxav/toxav.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ ToxAV *toxav_new(Tox *tox, TOXAV_ERR_NEW *error);
* notifying peers. After calling this function, no other functions may be
* called and the av pointer becomes invalid.
*/
void toxav_kill(ToxAV *toxAV);
void toxav_kill(ToxAV *av);

/**
* Returns the Tox instance the A/V object was created for.
*/
Tox *toxav_get_tox(const ToxAV *toxAV);
Tox *toxav_get_tox(const ToxAV *av);


/*******************************************************************************
Expand All @@ -232,14 +232,14 @@ Tox *toxav_get_tox(const ToxAV *toxAV);
* Returns the interval in milliseconds when the next toxav_iterate call should
* be. If no call is active at the moment, this function returns 200.
*/
uint32_t toxav_iteration_interval(const ToxAV *toxAV);
uint32_t toxav_iteration_interval(const ToxAV *av);

/**
* Main loop for the session. This function needs to be called in intervals of
* toxav_iteration_interval() milliseconds. It is best called in the separate
* thread from tox_iterate.
*/
void toxav_iterate(ToxAV *toxAV);
void toxav_iterate(ToxAV *av);


/*******************************************************************************
Expand Down Expand Up @@ -306,7 +306,7 @@ typedef enum TOXAV_ERR_CALL {
* @param video_bit_rate Video bit rate in Kb/sec. Set this to 0 to disable
* video sending.
*/
bool toxav_call(ToxAV *toxAV, uint32_t friend_number, uint32_t audio_bit_rate, uint32_t video_bit_rate,
bool toxav_call(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate, uint32_t video_bit_rate,
TOXAV_ERR_CALL *error);

/**
Expand All @@ -316,15 +316,14 @@ bool toxav_call(ToxAV *toxAV, uint32_t friend_number, uint32_t audio_bit_rate, u
* @param audio_enabled True if friend is sending audio.
* @param video_enabled True if friend is sending video.
*/
typedef void toxav_call_cb(ToxAV *toxAV, uint32_t friend_number, bool audio_enabled, bool video_enabled,
void *user_data);
typedef void toxav_call_cb(ToxAV *av, uint32_t friend_number, bool audio_enabled, bool video_enabled, void *user_data);


/**
* Set the callback for the `call` event. Pass NULL to unset.
*
*/
void toxav_callback_call(ToxAV *toxAV, toxav_call_cb *callback, void *user_data);
void toxav_callback_call(ToxAV *av, toxav_call_cb *callback, void *user_data);

typedef enum TOXAV_ERR_ANSWER {

Expand Down Expand Up @@ -377,7 +376,7 @@ typedef enum TOXAV_ERR_ANSWER {
* @param video_bit_rate Video bit rate in Kb/sec. Set this to 0 to disable
* video sending.
*/
bool toxav_answer(ToxAV *toxAV, uint32_t friend_number, uint32_t audio_bit_rate, uint32_t video_bit_rate,
bool toxav_answer(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate, uint32_t video_bit_rate,
TOXAV_ERR_ANSWER *error);


Expand Down Expand Up @@ -438,14 +437,14 @@ enum TOXAV_FRIEND_CALL_STATE {
* paused. The bitmask represents all the activities currently performed by the
* friend.
*/
typedef void toxav_call_state_cb(ToxAV *toxAV, uint32_t friend_number, uint32_t state, void *user_data);
typedef void toxav_call_state_cb(ToxAV *av, uint32_t friend_number, uint32_t state, void *user_data);


/**
* Set the callback for the `call_state` event. Pass NULL to unset.
*
*/
void toxav_callback_call_state(ToxAV *toxAV, toxav_call_state_cb *callback, void *user_data);
void toxav_callback_call_state(ToxAV *av, toxav_call_state_cb *callback, void *user_data);


/*******************************************************************************
Expand Down Expand Up @@ -543,8 +542,7 @@ typedef enum TOXAV_ERR_CALL_CONTROL {
*
* @return true on success.
*/
bool toxav_call_control(ToxAV *toxAV, uint32_t friend_number, TOXAV_CALL_CONTROL control,
TOXAV_ERR_CALL_CONTROL *error);
bool toxav_call_control(ToxAV *av, uint32_t friend_number, TOXAV_CALL_CONTROL control, TOXAV_ERR_CALL_CONTROL *error);


/*******************************************************************************
Expand Down Expand Up @@ -601,7 +599,7 @@ typedef enum TOXAV_ERR_BIT_RATE_SET {
* video sending. Set to -1 to leave unchanged.
*
*/
bool toxav_bit_rate_set(ToxAV *toxAV, uint32_t friend_number, int32_t audio_bit_rate, int32_t video_bit_rate,
bool toxav_bit_rate_set(ToxAV *av, uint32_t friend_number, int32_t audio_bit_rate, int32_t video_bit_rate,
TOXAV_ERR_BIT_RATE_SET *error);

/**
Expand All @@ -614,15 +612,15 @@ bool toxav_bit_rate_set(ToxAV *toxAV, uint32_t friend_number, int32_t audio_bit_
* @param audio_bit_rate Suggested maximum audio bit rate in Kb/sec.
* @param video_bit_rate Suggested maximum video bit rate in Kb/sec.
*/
typedef void toxav_bit_rate_status_cb(ToxAV *toxAV, uint32_t friend_number, uint32_t audio_bit_rate,
typedef void toxav_bit_rate_status_cb(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate,
uint32_t video_bit_rate, void *user_data);


/**
* Set the callback for the `bit_rate_status` event. Pass NULL to unset.
*
*/
void toxav_callback_bit_rate_status(ToxAV *toxAV, toxav_bit_rate_status_cb *callback, void *user_data);
void toxav_callback_bit_rate_status(ToxAV *av, toxav_bit_rate_status_cb *callback, void *user_data);


/*******************************************************************************
Expand Down Expand Up @@ -701,7 +699,7 @@ typedef enum TOXAV_ERR_SEND_FRAME {
* @param sampling_rate Audio sampling rate used in this frame. Valid sampling
* rates are 8000, 12000, 16000, 24000, or 48000.
*/
bool toxav_audio_send_frame(ToxAV *toxAV, uint32_t friend_number, const int16_t *pcm, size_t sample_count,
bool toxav_audio_send_frame(ToxAV *av, uint32_t friend_number, const int16_t *pcm, size_t sample_count,
uint8_t channels, uint32_t sampling_rate, TOXAV_ERR_SEND_FRAME *error);

/**
Expand All @@ -719,7 +717,7 @@ bool toxav_audio_send_frame(ToxAV *toxAV, uint32_t friend_number, const int16_t
* @param u U (Chroma) plane data.
* @param v V (Chroma) plane data.
*/
bool toxav_video_send_frame(ToxAV *toxAV, uint32_t friend_number, uint16_t width, uint16_t height, const uint8_t *y,
bool toxav_video_send_frame(ToxAV *av, uint32_t friend_number, uint16_t width, uint16_t height, const uint8_t *y,
const uint8_t *u, const uint8_t *v, TOXAV_ERR_SEND_FRAME *error);


Expand All @@ -743,15 +741,15 @@ bool toxav_video_send_frame(ToxAV *toxAV, uint32_t friend_number, uint16_t width
* @param sampling_rate Sampling rate used in this frame.
*
*/
typedef void toxav_audio_receive_frame_cb(ToxAV *toxAV, uint32_t friend_number, const int16_t *pcm, size_t sample_count,
typedef void toxav_audio_receive_frame_cb(ToxAV *av, uint32_t friend_number, const int16_t *pcm, size_t sample_count,
uint8_t channels, uint32_t sampling_rate, void *user_data);


/**
* Set the callback for the `audio_receive_frame` event. Pass NULL to unset.
*
*/
void toxav_callback_audio_receive_frame(ToxAV *toxAV, toxav_audio_receive_frame_cb *callback, void *user_data);
void toxav_callback_audio_receive_frame(ToxAV *av, toxav_audio_receive_frame_cb *callback, void *user_data);

/**
* The function type for the video_receive_frame callback.
Expand All @@ -774,7 +772,7 @@ void toxav_callback_audio_receive_frame(ToxAV *toxAV, toxav_audio_receive_frame_
* image is bottom-up hence why you MUST abs() it when
* calculating plane buffer size.
*/
typedef void toxav_video_receive_frame_cb(ToxAV *toxAV, uint32_t friend_number, uint16_t width, uint16_t height,
typedef void toxav_video_receive_frame_cb(ToxAV *av, uint32_t friend_number, uint16_t width, uint16_t height,
const uint8_t *y, const uint8_t *u, const uint8_t *v, int32_t ystride, int32_t ustride, int32_t vstride,
void *user_data);

Expand All @@ -783,7 +781,7 @@ typedef void toxav_video_receive_frame_cb(ToxAV *toxAV, uint32_t friend_number,
* Set the callback for the `video_receive_frame` event. Pass NULL to unset.
*
*/
void toxav_callback_video_receive_frame(ToxAV *toxAV, toxav_video_receive_frame_cb *callback, void *user_data);
void toxav_callback_video_receive_frame(ToxAV *av, toxav_video_receive_frame_cb *callback, void *user_data);

/**
* NOTE Compatibility with old toxav group calls TODO remove
Expand Down
4 changes: 2 additions & 2 deletions toxcore/assoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ typedef struct Assoc_close_entries {
* the caller is assumed to be registered from Assoc_register_callback()
* if they aren't, they should copy the Client_data and call Assoc_client_drop()
*/
uint8_t Assoc_get_close_entries(Assoc *assoc, Assoc_close_entries *close_entries);
uint8_t Assoc_get_close_entries(Assoc *assoc, Assoc_close_entries *state);

/*****************************************************************************/

Expand All @@ -91,7 +91,7 @@ Assoc *new_Assoc_default(Logger *log, const uint8_t *public_id);
Assoc *new_Assoc(Logger *log, size_t bits, size_t entries, const uint8_t *public_id);

/* public_id changed (loaded), update which entry isn't stored */
void Assoc_self_client_id_changed(Assoc *assoc, const uint8_t *public_id);
void Assoc_self_client_id_changed(Assoc *assoc, const uint8_t *id);

/* every 45s send out a getnodes() for a "random" bucket */
#define ASSOC_BUCKET_REFRESH 45
Expand Down
2 changes: 1 addition & 1 deletion toxcore/net_crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ int get_random_tcp_con_number(Net_Crypto *c);
* return 0 on success.
* return -1 on failure.
*/
int send_tcp_onion_request(Net_Crypto *c, unsigned int TCP_conn_number, const uint8_t *data, uint16_t length);
int send_tcp_onion_request(Net_Crypto *c, unsigned int tcp_connections_number, const uint8_t *data, uint16_t length);

/* Copy a maximum of num TCP relays we are connected to to tcp_relays.
* NOTE that the family of the copied ip ports will be set to TCP_INET or TCP_INET6.
Expand Down
Loading

0 comments on commit 9e6e8af

Please sign in to comment.