Skip to content

Commit

Permalink
fix: Fix conflicting declarations and incompatible ptr types
Browse files Browse the repository at this point in the history
  • Loading branch information
robinlinden committed Feb 1, 2024
1 parent 1f551d4 commit 84bec64
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/autocomplete.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*
*/

#include "autocomplete.h"

#include <limits.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion src/autocomplete.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*
* Note: This function should not be called directly. Use complete_line() and complete_path() instead.
*/
int complete_line(ToxWindow *self, Toxic *toxic, const char **list, size_t n_items);
int complete_line(ToxWindow *self, Toxic *toxic, const char *const *list, size_t n_items);

/* Attempts to match /command "<incomplete-dir>" line to matching directories.
* If there is only one match the line is auto-completed.
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*
*/

#include "bootstrap.h"

#include <arpa/inet.h>
#include <limits.h>
#include <netinet/in.h>
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#ifndef BOOTSTRAP_H
#define BOOTSTRAP_H

#include "toxic.h"

/* Manages connection to the Tox DHT network. */
void do_tox_connection(Toxic *toxic);

Expand Down
2 changes: 2 additions & 0 deletions src/chat.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#define _GNU_SOURCE /* needed for wcswidth() */
#endif

#include "chat.h"

#include <limits.h>
#include <stdlib.h>
#include <string.h>
Expand Down
4 changes: 2 additions & 2 deletions src/chat.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/* set CTRL to -1 if we don't want to send a control signal.
set msg to NULL if we don't want to display a message */
void chat_close_file_receiver(Tox *tox, int filenum, int friendnum, int CTRL);
void kill_chat_window(ToxWindow *self, Tox *tox);
ToxWindow *new_chat(Tox *tox, int32_t friendnum);
void kill_chat_window(ToxWindow *self, Toxic *tox);
ToxWindow *new_chat(Tox *tox, uint32_t friendnum);

#endif /* end of include guard: CHAT_H */
2 changes: 2 additions & 0 deletions src/chat_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*
*/

#include "chat_commands.h"

#include <stdlib.h>
#include <string.h>

Expand Down
2 changes: 2 additions & 0 deletions src/conference_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*
*/

#include "conference_commands.h"

#include <stdlib.h>
#include <string.h>

Expand Down
2 changes: 1 addition & 1 deletion src/friendlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ static void delete_friend(Toxic *toxic, uint32_t f_num)
ToxWindow *toxwin = get_window_ptr(Friends.list[f_num].chatwin);

if (toxwin != NULL) {
kill_chat_window(toxwin, tox);
kill_chat_window(toxwin, toxic);
set_active_window_index(1); /* keep friendlist focused */
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/global_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*
*/

#include "global_commands.h"

#include <stdlib.h>
#include <string.h>

Expand Down
2 changes: 2 additions & 0 deletions src/groupchat_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*
*/

#include "groupchat_commands.h"

#include <string.h>
#include <stdlib.h>

Expand Down
2 changes: 2 additions & 0 deletions src/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#define _GNU_SOURCE /* needed for wcwidth() */
#endif

#include "input.h"

#include <wchar.h>

#include "conference.h"
Expand Down
1 change: 1 addition & 0 deletions src/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define INPUT_H

#include "settings.h"
#include "windows.h"

/* add a char to input field and buffer for given chatcontext */
void input_new_char(ToxWindow *self, const Client_Config *c_config, wint_t key, int x, int mx_x);
Expand Down
2 changes: 2 additions & 0 deletions src/name_lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*
*/

#include "name_lookup.h"

#include <curl/curl.h>
#include <stdarg.h>
#include <stdlib.h>
Expand Down
5 changes: 5 additions & 0 deletions src/name_lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
#ifndef NAME_LOOKUP
#define NAME_LOOKUP

#include "toxic.h"
#include "windows.h"

#include <stdbool.h>

/* Initializes http based name lookups. Note: This function must be called only once before additional
* threads are spawned.
*
Expand Down
2 changes: 1 addition & 1 deletion src/windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ void kill_all_windows(Toxic *toxic)

switch (w->type) {
case WINDOW_TYPE_CHAT: {
kill_chat_window(w, toxic->tox);
kill_chat_window(w, toxic);
break;
}

Expand Down

0 comments on commit 84bec64

Please sign in to comment.