commit 3f83a8777307cf21dc38204b68d2e9f909b1c887
parent bff08f1ac6d9130e163b44192badced563064baa
Author: hhvn <dev@hhvn.uk>
Date: Fri, 12 Nov 2021 15:23:19 +0000
{chan,handle,hist,main,nick,serv,ui}.c hirc.h: remove trailing whitespace
Diffstat:
8 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/chan.c b/chan.c
@@ -123,7 +123,7 @@ chan_remove(struct Channel **head, char *name) {
chan_free(p);
return 1;
}
-
+
p->prev->next = p->next;
if (p->next != NULL)
p->next->prev = p->prev;
diff --git a/handle.c b/handle.c
@@ -263,7 +263,7 @@ handle_NICK(char *msg, char **params, struct Server *server, time_t timestamp) {
if (strcmp(nick->nick, newnick) == 0)
return;
-
+
if (nick_isself(nick)) {
nick_free(server->self);
server->self = nick_create(newnick, ' ', server);
@@ -272,7 +272,7 @@ handle_NICK(char *msg, char **params, struct Server *server, time_t timestamp) {
for (chan = server->channels; chan; chan = chan->next) {
if ((chnick = nick_get(&chan->nicks, nick->nick)) != NULL) {
- snprintf(prefix, sizeof(prefix), ":%s!%s@%s",
+ snprintf(prefix, sizeof(prefix), ":%s!%s@%s",
newnick, chnick->ident, chnick->host);
nick_add(&chan->nicks, prefix, chnick->priv, server);
nick_remove(&chan->nicks, nick->nick);
diff --git a/hirc.h b/hirc.h
@@ -55,10 +55,10 @@ void hist_free(struct History *history);
void hist_free_list(struct HistInfo *histinfo);
struct History *hist_create(struct HistInfo *histinfo, struct Nick *from, char *msg,
char **params, enum Activity activity, time_t timestamp, enum HistOpt options);
-struct History *hist_add(struct HistInfo *histinfo,
- struct Nick *from, char *msg, char **params, enum Activity activity,
+struct History *hist_add(struct HistInfo *histinfo,
+ struct Nick *from, char *msg, char **params, enum Activity activity,
time_t timestamp, enum HistOpt options);
-struct History *hist_format(struct HistInfo *history, enum Activity activity,
+struct History *hist_format(struct HistInfo *history, enum Activity activity,
enum HistOpt options, char *format, ...);
int hist_len(struct History **history);
int hist_log(char *msg, struct Nick *from, time_t timestamp, struct Server *server);
@@ -70,7 +70,7 @@ struct Server * serv_create(char *name, char *host, char *port, char *nick,
char *username, char *realname, int tls, int tls_verify);
struct Server * serv_get(struct Server **head, char *name);
struct Server * serv_get_byrfd(struct Server **head, int rfd);
-struct Server * serv_add(struct Server **head, char *name, char *host,
+struct Server * serv_add(struct Server **head, char *name, char *host,
char *port, char *nick, char *username, char *realname, int tls, int tls_verify);
int serv_len(struct Server **head);
int serv_poll(struct Server **head, int timeout);
diff --git a/hist.c b/hist.c
@@ -33,8 +33,8 @@ hist_free_list(struct HistInfo *histinfo) {
}
struct History *
-hist_create(struct HistInfo *histinfo, struct Nick *from, char *msg,
- char **params, enum Activity activity,
+hist_create(struct HistInfo *histinfo, struct Nick *from, char *msg,
+ char **params, enum Activity activity,
time_t timestamp, enum HistOpt options) {
struct History *new;
@@ -59,8 +59,8 @@ hist_create(struct HistInfo *histinfo, struct Nick *from, char *msg,
}
struct History *
-hist_add(struct HistInfo *histinfo, struct Nick *from,
- char *msg, char **params, enum Activity activity,
+hist_add(struct HistInfo *histinfo, struct Nick *from,
+ char *msg, char **params, enum Activity activity,
time_t timestamp, enum HistOpt options) {
struct History *new, *p;
int i;
diff --git a/main.c b/main.c
@@ -61,7 +61,7 @@ param_free(char **params) {
int
param_len(char **params) {
int i;
-
+
for (i=0; params && *params; i++, params++);
return i;
}
@@ -242,13 +242,13 @@ main(int argc, char **argv) {
ircprintf(sp, "PING :ground control to Major Tom\r\n");
sp->pingsent = time(NULL);
} else if (sp->pingsent && (time(NULL) - sp->pingsent) >= pinginact) {
- /* haven't gotten a response in pinginact seconds since
+ /* haven't gotten a response in pinginact seconds since
* sending ping, this connexion is probably dead now */
serv_disconnect(sp, 1, "Eead Rror");
hist_format(sp->history, Activity_error, HIST_SHOW,
"SELF_CONNECTLOST %s %s %s :No ping reply in %d seconds",
sp->name, sp->host, sp->port, pinginact);
- } else if (sp->status == ConnStatus_notconnected && sp->reconnect &&
+ } else if (sp->status == ConnStatus_notconnected && sp->reconnect &&
(time(NULL) - sp->lastconnected) >= (sp->connectfail * reconnectinterval)) {
/* time since last connected is sufficient to initiate reconnect */
serv_connect(sp);
diff --git a/nick.c b/nick.c
@@ -261,11 +261,11 @@ nick_sort(struct Nick **head, struct Server *server) {
['|'] = S_pipe, ['\\'] = S_pipe,
['`'] = S_grave,
['^'] = S_caret,
- ['a'] = S_a, S_b, S_c, S_d, S_e, S_f, S_g, S_h, S_i, S_j,
- S_k, S_l, S_m, S_n, S_o, S_p, S_q, S_r, S_s, S_t,
+ ['a'] = S_a, S_b, S_c, S_d, S_e, S_f, S_g, S_h, S_i, S_j,
+ S_k, S_l, S_m, S_n, S_o, S_p, S_q, S_r, S_s, S_t,
S_u, S_v, S_w, S_x, S_y, S_z,
- ['A'] = S_a, S_b, S_c, S_d, S_e, S_f, S_g, S_h, S_i, S_j,
- S_k, S_l, S_m, S_n, S_o, S_p, S_q, S_r, S_s, S_t,
+ ['A'] = S_a, S_b, S_c, S_d, S_e, S_f, S_g, S_h, S_i, S_j,
+ S_k, S_l, S_m, S_n, S_o, S_p, S_q, S_r, S_s, S_t,
S_u, S_v, S_w, S_x, S_y, S_z,
['0'] = S_0, S_1, S_2, S_3, S_4, S_5, S_6, S_7, S_8, S_9,
};
diff --git a/serv.c b/serv.c
@@ -41,7 +41,7 @@ serv_free(struct Server *server) {
}
struct Server *
-serv_create(char *name, char *host, char *port, char *nick,
+serv_create(char *name, char *host, char *port, char *nick,
char *username, char *realname, int tls, int tls_verify) {
struct Server *server;
struct tls_config *conf;
@@ -114,7 +114,7 @@ serv_create(char *name, char *host, char *port, char *nick,
}
struct Server *
-serv_add(struct Server **head, char *name, char *host, char *port,
+serv_add(struct Server **head, char *name, char *host, char *port,
char *nick, char *username, char *realname, int tls, int tls_verify) {
struct Server *new, *p;
@@ -145,7 +145,7 @@ serv_get(struct Server **head, char *name) {
if (strcmp(p->name, name) == 0)
return p;
}
-
+
return NULL;
}
@@ -160,7 +160,7 @@ serv_get_byrfd(struct Server **head, int rfd) {
if (p->rfd == rfd)
return p;
}
-
+
return NULL;
}
@@ -222,7 +222,7 @@ serv_connect(struct Server *server) {
freeaddrinfo(ai);
ircprintf(server, "NICK %s\r\n", server->self->nick);
- ircprintf(server, "USER %s * * :%s\r\n",
+ ircprintf(server, "USER %s * * :%s\r\n",
server->username ? server->username : server->self->nick,
server->realname ? server->realname : server->self->nick);
@@ -262,7 +262,7 @@ serv_poll(struct Server **head, int timeout) {
ret = 0;
for (i=0, sp = *head; sp; sp = sp->next, i++)
- if (sp->status == ConnStatus_connecting
+ if (sp->status == ConnStatus_connecting
|| sp->status == ConnStatus_connected)
sp->rpollfd->revents = fds[i].revents;
diff --git a/ui.c b/ui.c
@@ -17,7 +17,7 @@ static unsigned short colourmap[HIRC_COLOURS] = {
/* original 16 mirc colours
* some clients use the first 16 ansi colours for this,
* but here I use the 256 colours to ensure terminal-agnosticism */
- [0] = 255, 16, 19, 46, 124, 88, 127, 184,
+ [0] = 255, 16, 19, 46, 124, 88, 127, 184,
[8] = 208, 46, 45, 51, 21, 201, 240, 255,
/* extended */
@@ -56,7 +56,7 @@ ui_error_(char *file, int line, char *format, ...) {
va_end(ap);
hist_format(main_buf, Activity_error, HIST_SHOW,
- "SELF_ERROR %s %d :%s",
+ "SELF_ERROR %s %d :%s",
file, line, msg);
}
@@ -478,7 +478,7 @@ ui_wprintc(struct Window *window, int lines, char *format, ...) {
va_list ap;
int ret;
attr_t curattr;
- int temp; /* used only for wattr_get,
+ int temp; /* used only for wattr_get,
because ncurses is dumb */
int cc, lc, elc, utfc;
char colourbuf[2][3];
@@ -557,7 +557,7 @@ ui_wprintc(struct Window *window, int lines, char *format, ...) {
underline = 0;
reverse = 0;
italic = 0;
- /* Setting A_NORMAL turns everything off,
+ /* Setting A_NORMAL turns everything off,
* without using 5 different attroffs */
wattrset(window->window, A_NORMAL);
break;