diff --git a/configure.ac b/configure.ac index e17e4b4..68a99e8 100644 --- a/configure.ac +++ b/configure.ac @@ -428,7 +428,7 @@ if test "x$BUILD_AV" = "xyes"; then AC_CHECK_HEADER([tox/toxav.h], [ # Place define for audio support - AC_DEFINE([_SUPPORT_AUDIO], [], [If audio supported]) + AC_DEFINE([_SUPPORT_AUDIO], [], [Is audio supported]) AC_MSG_NOTICE([Building with audio support]) ], [ @@ -448,10 +448,6 @@ fi AM_CONDITIONAL(BUILD_AV, test "x$BUILD_AV" = "xyes") - -#debug mode -CFLAGS="-ggdb3 -O0 -pg" - TOXIC_VERSION="$PACKAGE_VERSION" AC_PATH_PROG([GIT], [git], [no]) if test "x$GIT" != "xno"; then diff --git a/src/execute.c b/src/execute.c index 3be7619..62581ad 100644 --- a/src/execute.c +++ b/src/execute.c @@ -20,8 +20,13 @@ * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include +#include #include "toxic_windows.h" #include "execute.h" diff --git a/src/global_commands.c b/src/global_commands.c index e0a7c78..cb2a993 100644 --- a/src/global_commands.c +++ b/src/global_commands.c @@ -378,10 +378,10 @@ void cmd_prompt_help(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*a wprintw(window, " /clear : Clear the window\n"); wprintw(window, " /quit or /exit : Exit Toxic\n"); - #ifdef _SUPPORT_AUDIO +#ifdef _SUPPORT_AUDIO wprintw(window, " /lsdev : List devices where type: in|out\n"); wprintw(window, " /sdev : Set active device\n"); - #endif /* _SUPPORT_AUDIO */ +#endif /* _SUPPORT_AUDIO */ wattron(window, COLOR_PAIR(CYAN) | A_BOLD); wprintw(window, " * Argument messages must be enclosed in quotation marks.\n"); diff --git a/src/groupchat.c b/src/groupchat.c index 2f30ff9..86cbd11 100644 --- a/src/groupchat.c +++ b/src/groupchat.c @@ -43,7 +43,7 @@ static GroupChat groupchats[MAX_WINDOWS_NUM]; static int max_groupchat_index = 0; /* temporary until group chats have unique commands */ -extern glob_cmd_list[AC_NUM_GLOB_COMMANDS][MAX_CMDNAME_SIZE]; +extern const uint8_t glob_cmd_list[AC_NUM_GLOB_COMMANDS][MAX_CMDNAME_SIZE]; int init_groupchat_win(ToxWindow *prompt, Tox *m, int groupnum) { diff --git a/src/main.c b/src/main.c index 57ae644..2b57c08 100644 --- a/src/main.c +++ b/src/main.c @@ -68,6 +68,10 @@ #define PACKAGE_DATADIR "." #endif +#ifdef _SUPPORT_AUDIO + ToxAv* av; +#endif /* _SUPPORT_AUDIO */ + /* Export for use in Callbacks */ char *DATA_FILE = NULL; ToxWindow *prompt = NULL; @@ -405,6 +409,9 @@ void exit_toxic(Tox *m) free(prompt->promptbuf->log); free(prompt->promptbuf); tox_kill(m); + #ifdef _SUPPORT_AUDIO + terminate_audio(prompt, av); + #endif /* _SUPPORT_AUDIO */ endwin(); exit(EXIT_SUCCESS); } @@ -486,7 +493,7 @@ int main(int argc, char *argv[]) wprintw(prompt->window, "Starting audio...\n"); attroff(COLOR_PAIR(RED) | A_BOLD); - ToxAv* av = init_audio(prompt, m); + av = init_audio(prompt, m); if ( errors() == NoError ) wprintw(prompt->window, "Audio started with no problems.\n"); @@ -518,10 +525,6 @@ int main(int argc, char *argv[]) while (true) do_toxic(m, prompt); - -#ifdef _SUPPORT_AUDIO - terminate_audio(prompt, av); -#endif /* _SUPPORT_AUDIO */ - + return 0; }