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

astyle --options=tools/astylerc -r ./*.{c,h}

This commit is contained in:
irungentoo 2013-08-20 19:37:05 -04:00
parent 05fd02767f
commit 43d0d7a1c0
4 changed files with 30 additions and 24 deletions

View File

@ -365,7 +365,9 @@ static void execute(ToxWindow *self, Messenger *m, char *u_cmd)
cmd[i] = '\0'; cmd[i] = '\0';
int j = i; int j = i;
while (++j < MAX_STR_SIZE && isspace(cmd[j])); while (++j < MAX_STR_SIZE && isspace(cmd[j]));
i = j - 1; i = j - 1;
numargs++; numargs++;

View File

@ -90,11 +90,13 @@ int add_window(Messenger *m, ToxWindow w)
return -1; return -1;
int i; int i;
for (i = 0; i < MAX_WINDOWS_NUM; i++) { for (i = 0; i < MAX_WINDOWS_NUM; i++) {
if (windows[i].window) if (windows[i].window)
continue; continue;
w.window = newwin(LINES - 2, COLS, 0, 0); w.window = newwin(LINES - 2, COLS, 0, 0);
if (w.window == NULL) if (w.window == NULL)
return -1; return -1;
@ -113,8 +115,10 @@ void del_window(ToxWindow *w)
{ {
active_window = windows; // Go to prompt screen active_window = windows; // Go to prompt screen
delwin(w->window); delwin(w->window);
if (w->x) if (w->x)
free(w->x); free(w->x);
w->window = NULL; w->window = NULL;
memset(w, 0, sizeof(ToxWindow)); memset(w, 0, sizeof(ToxWindow));
clear(); clear();
@ -126,12 +130,12 @@ void set_next_window(int ch)
{ {
ToxWindow *end = windows + MAX_WINDOWS_NUM - 1; ToxWindow *end = windows + MAX_WINDOWS_NUM - 1;
ToxWindow *inf = active_window; ToxWindow *inf = active_window;
while (true) { while (true) {
if (ch == '\t') { if (ch == '\t') {
if (++active_window > end) if (++active_window > end)
active_window = windows; active_window = windows;
} else } else if (--active_window < windows)
if (--active_window < windows)
active_window = end; active_window = end;
if (active_window->window) if (active_window->window)