Skip to content

Commit

Permalink
Make struct typedefs have the same name as their struct
Browse files Browse the repository at this point in the history
  • Loading branch information
JFreegman committed Jan 4, 2022
1 parent e848853 commit 4b49d00
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion toxav/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions toxav/bwcontroller.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ typedef struct BWCRcvPkt {
RingBuffer *rb;
} BWCRcvPkt;

struct BWController_s {
struct BWController {
m_cb *mcb;
void *mcb_user_data;

Expand Down Expand Up @@ -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(struct BWController), 1);

if (retu == nullptr) {
return nullptr;
Expand Down
2 changes: 1 addition & 1 deletion toxav/bwcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
12 changes: 6 additions & 6 deletions toxav/msi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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;


Expand All @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions toxav/toxav.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion toxav/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <pthread.h>

typedef struct VCSession_s {
typedef struct VCSession {
/* encoding */
vpx_codec_ctx_t encoder[1];
uint32_t frame_counter;
Expand Down

0 comments on commit 4b49d00

Please sign in to comment.