1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00

Added -Wall to GCC options

Fixed compiler warnings
This commit is contained in:
James Booth 2012-09-10 22:57:42 +01:00
parent b7c1209744
commit 6b1b035d92
7 changed files with 17 additions and 27 deletions

View File

@ -42,7 +42,7 @@ PKG_CHECK_MODULES([DEPS], [openssl glib-2.0 libcurl])
PKG_CHECK_MODULES([NOTIFY], [libnotify], [], PKG_CHECK_MODULES([NOTIFY], [libnotify], [],
[AC_MSG_NOTICE([libnotify module not found])]) [AC_MSG_NOTICE([libnotify module not found])])
AM_CFLAGS="-O3 " AM_CFLAGS="-O3 -Wall"
AM_CFLAGS="$AM_CFLAGS -lstrophe -lxml2 -lexpat -lncurses -lcurl -lresolv " AM_CFLAGS="$AM_CFLAGS -lstrophe -lxml2 -lexpat -lncurses -lcurl -lresolv "
AM_CFLAGS="$AM_CFLAGS $DEPS_LIBS $NOTIFY_LIBS" AM_CFLAGS="$AM_CFLAGS $DEPS_LIBS $NOTIFY_LIBS"

View File

@ -81,9 +81,9 @@ create_input_window(void)
void void
inp_win_resize(const char * const input, const int size) inp_win_resize(const char * const input, const int size)
{ {
int rows, cols, inp_x, inp_y; int rows, cols, inp_x;
getmaxyx(stdscr, rows, cols); getmaxyx(stdscr, rows, cols);
getyx(inp_win, inp_y, inp_x); inp_x = getcurx(inp_win);
// if lost cursor off screen, move contents to show it // if lost cursor off screen, move contents to show it
if (inp_x >= pad_start + cols) { if (inp_x >= pad_start + cols) {

View File

@ -124,7 +124,7 @@ p_history_previous(PHistory history, char *item)
_create_session(history); _create_session(history);
// add the new item // add the new item
g_list_append(history->session.items, copied); history->session.items = g_list_append(history->session.items, copied);
history->session.sess_new = g_list_last(history->session.items); history->session.sess_new = g_list_last(history->session.items);
char *result = strdup(history->session.sess_curr->data); char *result = strdup(history->session.sess_curr->data);

View File

@ -122,8 +122,7 @@ status_bar_inactive(const int win)
int active_pos = 1 + ((win -1) * 3); int active_pos = 1 + ((win -1) * 3);
int rows, cols; int cols = getmaxx(stdscr);
getmaxyx(stdscr, rows, cols);
mvwaddch(status_bar, 0, cols - 29 + active_pos, ' '); mvwaddch(status_bar, 0, cols - 29 + active_pos, ' ');
if (win == 9) if (win == 9)
@ -140,8 +139,7 @@ status_bar_active(const int win)
int active_pos = 1 + ((win -1) * 3); int active_pos = 1 + ((win -1) * 3);
int rows, cols; int cols = getmaxx(stdscr);
getmaxyx(stdscr, rows, cols);
wattron(status_bar, COLOUR_BAR_DRAW); wattron(status_bar, COLOUR_BAR_DRAW);
if (win < 9) if (win < 9)
@ -161,8 +159,7 @@ status_bar_new(const int win)
int active_pos = 1 + ((win -1) * 3); int active_pos = 1 + ((win -1) * 3);
int rows, cols; int cols = getmaxx(stdscr);
getmaxyx(stdscr, rows, cols);
wattron(status_bar, COLOUR_BAR_TEXT); wattron(status_bar, COLOUR_BAR_TEXT);
wattron(status_bar, A_BLINK); wattron(status_bar, A_BLINK);
@ -212,8 +209,8 @@ status_bar_clear(void)
wclear(status_bar); wclear(status_bar);
int rows, cols; int cols = getmaxx(stdscr);
getmaxyx(stdscr, rows, cols);
wattron(status_bar, COLOUR_BAR_DRAW); wattron(status_bar, COLOUR_BAR_DRAW);
mvwprintw(status_bar, 0, cols - 29, _active); mvwprintw(status_bar, 0, cols - 29, _active);
wattroff(status_bar, COLOUR_BAR_DRAW); wattroff(status_bar, COLOUR_BAR_DRAW);

View File

@ -49,7 +49,6 @@ tinyurl_get(char *url)
g_string_append(full_url, url); g_string_append(full_url, url);
CURL *handle = curl_easy_init(); CURL *handle = curl_easy_init();
CURLcode result;
struct curl_data_t output; struct curl_data_t output;
output.buffer = NULL; output.buffer = NULL;
output.size = 0; output.size = 0;
@ -58,7 +57,7 @@ tinyurl_get(char *url)
curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, _data_callback); curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, _data_callback);
curl_easy_setopt(handle, CURLOPT_WRITEDATA, (void *)&output); curl_easy_setopt(handle, CURLOPT_WRITEDATA, (void *)&output);
result = curl_easy_perform(handle); curl_easy_perform(handle);
curl_easy_cleanup(handle); curl_easy_cleanup(handle);
output.buffer[output.size++] = '\0'; output.buffer[output.size++] = '\0';

View File

@ -39,8 +39,7 @@ static void _title_bar_draw_status(void);
void void
create_title_bar(void) create_title_bar(void)
{ {
int rows, cols; int cols = getmaxx(stdscr);
getmaxyx(stdscr, rows, cols);
title_bar = newwin(1, cols, 0, 0); title_bar = newwin(1, cols, 0, 0);
wbkgd(title_bar, COLOUR_BAR_DEF); wbkgd(title_bar, COLOUR_BAR_DEF);
@ -61,8 +60,7 @@ title_bar_title(void)
void void
title_bar_resize(void) title_bar_resize(void)
{ {
int rows, cols; int cols = getmaxx(stdscr);
getmaxyx(stdscr, rows, cols);
wresize(title_bar, 1, cols); wresize(title_bar, 1, cols);
wbkgd(title_bar, COLOUR_BAR_DEF); wbkgd(title_bar, COLOUR_BAR_DEF);
@ -173,8 +171,7 @@ title_bar_draw(void)
static void static void
_title_bar_draw_status(void) _title_bar_draw_status(void)
{ {
int rows, cols; int cols = getmaxx(stdscr);
getmaxyx(stdscr, rows, cols);
wattron(title_bar, COLOUR_BAR_DRAW); wattron(title_bar, COLOUR_BAR_DRAW);
mvwaddch(title_bar, 0, cols - 14, '['); mvwaddch(title_bar, 0, cols - 14, '[');

View File

@ -619,12 +619,10 @@ win_handle_special_keys(const int * const ch)
void void
win_page_off(void) win_page_off(void)
{ {
int rows, cols; int rows = getmaxy(stdscr);
getmaxyx(stdscr, rows, cols);
_wins[_curr_prof_win].paged = 0; _wins[_curr_prof_win].paged = 0;
int y, x; int y = getcury(_wins[_curr_prof_win].win);
getyx(_wins[_curr_prof_win].win, y, x);
int size = rows - 3; int size = rows - 3;
@ -947,9 +945,8 @@ _win_handle_switch(const int * const ch)
static void static void
_win_handle_page(const int * const ch) _win_handle_page(const int * const ch)
{ {
int rows, cols, y, x; int rows = getmaxy(stdscr);
getmaxyx(stdscr, rows, cols); int y = getcury(_wins[_curr_prof_win].win);
getyx(_wins[_curr_prof_win].win, y, x);
int page_space = rows - 4; int page_space = rows - 4;
int *page_start = &_wins[_curr_prof_win].y_pos; int *page_start = &_wins[_curr_prof_win].y_pos;