From 038531520068b251cda1951d860098783e797eee Mon Sep 17 00:00:00 2001 From: jfreegman Date: Tue, 4 Jan 2022 11:36:28 -0500 Subject: [PATCH] Make struct typedefs have the same name as their struct --- toxav/audio.h | 2 +- toxav/bwcontroller.c | 4 ++-- toxav/bwcontroller.h | 2 +- toxav/msi.h | 12 ++++++------ toxav/toxav.c | 8 ++++---- toxav/video.h | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/toxav/audio.h b/toxav/audio.h index 6d609ee7e0..2a5ebd697d 100644 --- a/toxav/audio.h +++ b/toxav/audio.h @@ -34,7 +34,7 @@ #define AUDIO_MAX_BUFFER_SIZE_PCM16 ((AUDIO_MAX_SAMPLE_RATE * AUDIO_MAX_FRAME_DURATION_MS) / 1000) #define AUDIO_MAX_BUFFER_SIZE_BYTES (AUDIO_MAX_BUFFER_SIZE_PCM16 * 2) -typedef struct ACSession_s { +typedef struct ACSession { Mono_Time *mono_time; const Logger *log; diff --git a/toxav/bwcontroller.c b/toxav/bwcontroller.c index 001649a595..2d40ffe3c8 100644 --- a/toxav/bwcontroller.c +++ b/toxav/bwcontroller.c @@ -34,7 +34,7 @@ typedef struct BWCRcvPkt { RingBuffer *rb; } BWCRcvPkt; -struct BWController_s { +struct BWController { m_cb *mcb; void *mcb_user_data; @@ -62,7 +62,7 @@ static void send_update(BWController *bwc); BWController *bwc_new(Messenger *m, Tox *tox, uint32_t friendnumber, m_cb *mcb, void *mcb_user_data, Mono_Time *bwc_mono_time) { - BWController *retu = (BWController *)calloc(sizeof(struct BWController_s), 1); + BWController *retu = (BWController *)calloc(sizeof(BWController), 1); if (retu == nullptr) { return nullptr; diff --git a/toxav/bwcontroller.h b/toxav/bwcontroller.h index 4cd25bd1dc..628b385604 100644 --- a/toxav/bwcontroller.h +++ b/toxav/bwcontroller.h @@ -8,7 +8,7 @@ #include "../toxcore/Messenger.h" #include "../toxcore/tox.h" -typedef struct BWController_s BWController; +typedef struct BWController BWController; typedef void m_cb(BWController *bwc, uint32_t friend_number, float todo, void *user_data); diff --git a/toxav/msi.h b/toxav/msi.h index 5809228db2..5837fb6104 100644 --- a/toxav/msi.h +++ b/toxav/msi.h @@ -64,8 +64,8 @@ typedef enum MSICallbackID { /** * The call struct. Please do not modify outside msi.c */ -typedef struct MSICall_s { - struct MSISession_s *session; /* Session pointer */ +typedef struct MSICall { + struct MSISession *session; /* Session pointer */ MSICallState state; uint8_t peer_capabilities; /* Peer capabilities */ @@ -74,10 +74,10 @@ typedef struct MSICall_s { uint32_t friend_number; /* Index of this call in MSISession */ MSIError error; /* Last error */ - struct ToxAVCall_s *av_call; /* Pointer to av call handler */ + struct ToxAVCall *av_call; /* Pointer to av call handler */ - struct MSICall_s *next; - struct MSICall_s *prev; + struct MSICall *next; + struct MSICall *prev; } MSICall; @@ -91,7 +91,7 @@ typedef int msi_action_cb(void *av, MSICall *call); /** * Control session struct. Please do not modify outside msi.c */ -typedef struct MSISession_s { +typedef struct MSISession { /* Call handlers */ MSICall **calls; uint32_t calls_tail; diff --git a/toxav/toxav.c b/toxav/toxav.c index b5ff245b0b..020c1b6a18 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c @@ -34,7 +34,7 @@ // iteration interval that is used when no call is active #define IDLE_ITERATION_INTERVAL_MS 200 -typedef struct ToxAVCall_s { +typedef struct ToxAVCall { ToxAV *av; pthread_mutex_t mutex_audio[1]; @@ -59,13 +59,13 @@ typedef struct ToxAVCall_s { pthread_mutex_t toxav_call_mutex[1]; - struct ToxAVCall_s *prev; - struct ToxAVCall_s *next; + struct ToxAVCall *prev; + struct ToxAVCall *next; } ToxAVCall; /** Decode time statistics */ -typedef struct DecodeTimeStats_s { +typedef struct DecodeTimeStats { /** Measure count */ int32_t count; /** Last cycle total */ diff --git a/toxav/video.h b/toxav/video.h index 6be9ac7544..7b3fa5988a 100644 --- a/toxav/video.h +++ b/toxav/video.h @@ -22,7 +22,7 @@ #include -typedef struct VCSession_s { +typedef struct VCSession { /* encoding */ vpx_codec_ctx_t encoder[1]; uint32_t frame_counter;