1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-22 09:23:02 +01:00

Use (void) in prototypes instead of ().

Also, removed `__inline` from an extern function (why was it there?).
Also, moved one extern declaration to a header file. There are lots of
these that need to be moved, but one thing at a time.
This commit is contained in:
iphydf 2018-09-13 23:47:47 +00:00
parent bebff3be0e
commit d62902ffb3
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
19 changed files with 32 additions and 31 deletions

View File

@ -85,7 +85,7 @@ extern struct CallControl CallControl;
/* You will have to pass pointer to first member of 'windows' declared in windows.c */
ToxAV *init_audio(ToxWindow *self, Tox *tox);
void terminate_audio();
void terminate_audio(void);
int start_transmission(ToxWindow *self, Call *call);
int stop_transmission(Call *call, uint32_t friend_number);
void stop_current_call(ToxWindow *self);

View File

@ -58,11 +58,11 @@ typedef void (*DataHandleCallback)(const int16_t *, uint32_t size, void *data);
#ifdef AUDIO
DeviceError init_devices(ToxAV *av);
#else
DeviceError init_devices();
DeviceError init_devices(void);
#endif /* AUDIO */
void get_devices_names();
DeviceError terminate_devices();
void get_devices_names(void);
DeviceError terminate_devices(void);
/* Callback handles ready data from INPUT device */
DeviceError register_device_callback(int32_t friend_number, uint32_t device_idx, DataHandleCallback callback,

View File

@ -936,7 +936,7 @@ static void draw_infobox(ToxWindow *self)
wattron(infobox->win, A_BOLD);
wprintw(infobox->win, " VAD level: ");
wattroff(infobox->win, A_BOLD);
wprintw(infobox->win, "%.2f\n", infobox->vad_lvl);
wprintw(infobox->win, "%.2f\n", (double) infobox->vad_lvl);
wborder(infobox->win, ACS_VLINE, ' ', ACS_HLINE, ACS_HLINE, ACS_TTEE, ' ', ACS_LLCORNER, ' ');
wnoutrefresh(infobox->win);

View File

@ -125,7 +125,7 @@ void cmd_join_group(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar
TOX_ERR_CONFERENCE_JOIN err;
uint32_t groupnum = tox_conference_join(m, self->num, (uint8_t *) groupkey, length, &err);
uint32_t groupnum = tox_conference_join(m, self->num, (const uint8_t *) groupkey, length, &err);
if (err != TOX_ERR_CONFERENCE_JOIN_OK) {
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat instance failed to initialize (error %d)", err);

View File

@ -41,7 +41,6 @@
extern char *DATA_FILE;
extern ToxWindow *prompt;
extern FriendsList Friends;
extern FriendRequests FrndRequests;
/* command functions */
void cmd_accept(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE])
@ -94,7 +93,7 @@ void cmd_add_helper(ToxWindow *self, Tox *m, const char *id_bin, const char *msg
const char *errmsg;
TOX_ERR_FRIEND_ADD err;
uint32_t f_num = tox_friend_add(m, (uint8_t *) id_bin, (uint8_t *) msg, strlen(msg), &err);
uint32_t f_num = tox_friend_add(m, (const uint8_t *) id_bin, (const uint8_t *) msg, strlen(msg), &err);
switch (err) {
case TOX_ERR_FRIEND_ADD_TOO_LONG:

View File

@ -439,10 +439,10 @@ static void groupchat_onGroupPeerNameChange(ToxWindow *self, Tox *m, uint32_t gr
get_time_str(timefrmt, sizeof(timefrmt));
char tmp_event[TOXIC_MAX_NAME_LENGTH * 2 + 32];
snprintf(tmp_event, sizeof(tmp_event), "is now known as %s", (char *) name);
snprintf(tmp_event, sizeof(tmp_event), "is now known as %s", (const char *) name);
write_to_log(tmp_event, peer->name, ctx->log, true);
line_info_add(self, timefrmt, peer->name, (char *) name, NAME_CHANGE, 0, 0, " is now known as ");
line_info_add(self, timefrmt, peer->name, (const char *) name, NAME_CHANGE, 0, 0, " is now known as ");
break;
}

View File

@ -42,7 +42,7 @@ extern struct Winthread Winthread;
#define MAX_DOMAIN_SIZE 32
#define MAX_SERVER_LINE MAX_DOMAIN_SIZE + (SERVER_KEY_SIZE * 2) + 3
struct Nameservers {
static struct Nameservers {
int lines;
char names[MAX_SERVERS][MAX_DOMAIN_SIZE];
char keys[MAX_SERVERS][SERVER_KEY_SIZE];

View File

@ -64,7 +64,7 @@
extern struct user_settings *user_settings;
struct Control {
static struct Control {
time_t cooldown;
time_t notif_timeout;
@ -79,7 +79,7 @@ struct Control {
#endif /* SOUND_NOTIFY */
} Control = {0};
struct _ActiveNotifications {
static struct _ActiveNotifications {
#ifdef SOUND_NOTIFY
uint32_t source;
uint32_t buffer;

View File

@ -60,7 +60,7 @@ typedef enum _Flags {
} Flags;
int init_notify(int login_cooldown, int notification_timeout);
void terminate_notify();
void terminate_notify(void);
int sound_notify(ToxWindow *self, Notification notif, uint64_t flags, int *id_indicator);
int sound_notify2(ToxWindow *self, Notification notif, uint64_t flags, int id);

View File

@ -45,7 +45,7 @@ void bgrtoyuv420(uint8_t *plane_y, uint8_t *plane_u, uint8_t *plane_v, uint8_t *
#endif /* __OBJC__ */
int osx_video_init(char **device_names, int *size);
void osx_video_release();
void osx_video_release(void);
/* Start device */
int osx_video_open_device(uint32_t selection, uint16_t *width, uint16_t *height);
/* Stop device */

View File

@ -160,7 +160,7 @@ void prompt_update_statusmessage(ToxWindow *prompt, Tox *m, const char *statusms
statusbar->statusmsg_len = len;
TOX_ERR_SET_INFO err;
tox_self_set_status_message(m, (uint8_t *) statusmsg, len, &err);
tox_self_set_status_message(m, (const uint8_t *) statusmsg, len, &err);
if (err != TOX_ERR_SET_INFO_OK) {
line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to set note (error %d)\n", err);

View File

@ -40,6 +40,8 @@ typedef struct {
struct friend_request request[MAX_FRIEND_REQUESTS];
} FriendRequests;
extern FriendRequests FrndRequests;
ToxWindow new_prompt(void);
void prep_prompt_win(void);

View File

@ -29,7 +29,7 @@
*/
int init_mplex_away_timer(Tox *m);
void lock_status();
void unlock_status();
void lock_status(void);
void unlock_status(void);
#endif /* #define TERM_MPLEX_H */

View File

@ -96,8 +96,8 @@ typedef enum _FATAL_ERRS {
Uncomment if necessary */
/* #define URXVT_FIX */
void lock_status();
void unlock_status();
void lock_status(void);
void unlock_status(void);
void exit_toxic_success(Tox *m);
void exit_toxic_err(const char *errmsg, int errcode);

View File

@ -31,7 +31,7 @@
/* You will have to pass pointer to first member of 'windows' declared in windows.c */
ToxAV *init_video(ToxWindow *self, Tox *tox);
void terminate_video();
void terminate_video(void);
int start_video_transmission(ToxWindow *self, ToxAV *av, Call *call);
int stop_video_transmission(Call *call, int friend_number);
void stop_video_stream(ToxWindow *self);

View File

@ -591,7 +591,7 @@ VideoDeviceError open_video_device(VideoDeviceType type, int32_t selection, uint
return vde_None;
}
__inline VideoDeviceError write_video_out(uint16_t width, uint16_t height,
VideoDeviceError write_video_out(uint16_t width, uint16_t height,
uint8_t const *y, uint8_t const *u, uint8_t const *v,
int32_t ystride, int32_t ustride, int32_t vstride,
void *user_data)

View File

@ -51,10 +51,10 @@ typedef void (*VideoDataHandleCallback)(int16_t width, int16_t height, const uin
#ifdef VIDEO
VideoDeviceError init_video_devices(ToxAV *av);
#else
VideoDeviceError init_video_devices();
VideoDeviceError init_video_devices(void);
#endif /* VIDEO */
VideoDeviceError terminate_video_devices();
VideoDeviceError terminate_video_devices(void);
/* Callback handles ready data from INPUT device */
VideoDeviceError register_video_device_callback(int32_t call_idx, uint32_t device_idx, VideoDataHandleCallback callback,

View File

@ -34,8 +34,8 @@ DropType;
typedef void (*drop_callback)(const char *, DropType);
int init_xtra(drop_callback d);
void terminate_xtra();
long unsigned int focused_window_id();
int is_focused(); /* returns bool */
void terminate_xtra(void);
long unsigned int focused_window_id(void);
int is_focused(void); /* returns bool */
#endif /* XTRA_H */