Various minor style and spacing nits.

This commit is contained in:
nicm 2014-09-01 21:50:18 +00:00
parent e075198049
commit 4e956d545a
14 changed files with 21 additions and 21 deletions

View File

@ -311,7 +311,7 @@ client_main(int argc, char **argv, int flags)
/* Prepare command for server. */ /* Prepare command for server. */
data->argc = argc; data->argc = argc;
if (cmd_pack_argv(argc, argv, (char*)(data + 1), size) != 0) { if (cmd_pack_argv(argc, argv, (char *)(data + 1), size) != 0) {
fprintf(stderr, "command too long\n"); fprintf(stderr, "command too long\n");
free(data); free(data);
return (1); return (1);
@ -393,7 +393,7 @@ client_write_one(enum msgtype type, int fd, const void *buf, size_t len)
int retval; int retval;
retval = imsg_compose(&client_ibuf, type, PROTOCOL_VERSION, -1, fd, retval = imsg_compose(&client_ibuf, type, PROTOCOL_VERSION, -1, fd,
(void*)buf, len); (void *)buf, len);
if (retval != 1) if (retval != 1)
return (-1); return (-1);
return (0); return (0);

View File

@ -24,7 +24,7 @@
#include "tmux.h" #include "tmux.h"
struct cmd_list * struct cmd_list *
cmd_list_parse(int argc, char **argv, const char* file, u_int line, cmd_list_parse(int argc, char **argv, const char *file, u_int line,
char **cause) char **cause)
{ {
struct cmd_list *cmdlist; struct cmd_list *cmdlist;

View File

@ -62,7 +62,7 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
path = args->argv[0]; path = args->argv[0];
if (strcmp(path, "-") == 0) { if (strcmp(path, "-") == 0) {
error = server_set_stdin_callback(c, cmd_load_buffer_callback, error = server_set_stdin_callback(c, cmd_load_buffer_callback,
(void*)bufname, &cause); (void *)bufname, &cause);
if (error != 0) { if (error != 0) {
cmdq_error(cmdq, "%s: %s", path, cause); cmdq_error(cmdq, "%s: %s", path, cause);
free(cause); free(cause);

View File

@ -88,7 +88,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq)
cmd = options_get_string(&s->options, "default-command"); cmd = options_get_string(&s->options, "default-command");
if (cmd != NULL && *cmd != '\0') { if (cmd != NULL && *cmd != '\0') {
argc = 1; argc = 1;
argv = (char**)&cmd; argv = (char **)&cmd;
} else { } else {
argc = 0; argc = 0;
argv = NULL; argv = NULL;

View File

@ -124,14 +124,14 @@ cmdq_guard(struct cmd_q *cmdq, const char *guard, int flags)
struct client *c = cmdq->client; struct client *c = cmdq->client;
if (c == NULL) if (c == NULL)
return 0; return (0);
if (!(c->flags & CLIENT_CONTROL)) if (!(c->flags & CLIENT_CONTROL))
return 0; return (0);
evbuffer_add_printf(c->stdout_data, "%%%s %ld %u %d\n", guard, evbuffer_add_printf(c->stdout_data, "%%%s %ld %u %d\n", guard,
(long) cmdq->time, cmdq->number, flags); (long) cmdq->time, cmdq->number, flags);
server_push_stdout(c); server_push_stdout(c);
return 1; return (1);
} }
/* Add command list to queue and begin processing if needed. */ /* Add command list to queue and begin processing if needed. */

View File

@ -201,7 +201,7 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq)
/* Set user option. */ /* Set user option. */
enum cmd_retval enum cmd_retval
cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char* optstr, cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char *optstr,
const char *valstr) const char *valstr)
{ {
struct args *args = self->args; struct args *args = self->args;
@ -254,7 +254,7 @@ cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char* optstr,
if (args_has(args, 'o') && options_find1(oo, optstr) != NULL) { if (args_has(args, 'o') && options_find1(oo, optstr) != NULL) {
if (!args_has(args, 'q')) { if (!args_has(args, 'q')) {
cmdq_error(cmdq, "already set: %s", optstr); cmdq_error(cmdq, "already set: %s", optstr);
return CMD_RETURN_ERROR; return (CMD_RETURN_ERROR);
} }
return (CMD_RETURN_NORMAL); return (CMD_RETURN_NORMAL);
} }

View File

@ -85,7 +85,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
cmd = options_get_string(&s->options, "default-command"); cmd = options_get_string(&s->options, "default-command");
if (cmd != NULL && *cmd != '\0') { if (cmd != NULL && *cmd != '\0') {
argc = 1; argc = 1;
argv = (char**)&cmd; argv = (char **)&cmd;
} else { } else {
argc = 0; argc = 0;
argv = NULL; argv = NULL;

View File

@ -108,7 +108,7 @@ cmd_wait_for_signal(struct cmd_q *cmdq, const char *name,
if (!wc->locked) { if (!wc->locked) {
RB_REMOVE(wait_channels, &wait_channels, wc); RB_REMOVE(wait_channels, &wait_channels, wc);
free((void*) wc->name); free((void *)wc->name);
free(wc); free(wc);
} }
@ -186,7 +186,7 @@ cmd_wait_for_unlock(struct cmd_q *cmdq, const char *name,
wc->locked = 0; wc->locked = 0;
if (TAILQ_EMPTY(&wc->waiters)) { if (TAILQ_EMPTY(&wc->waiters)) {
RB_REMOVE(wait_channels, &wait_channels, wc); RB_REMOVE(wait_channels, &wait_channels, wc);
free((void*) wc->name); free((void *)wc->name);
free(wc); free(wc);
} }
} }

2
grid.c
View File

@ -572,7 +572,7 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx,
const struct grid_cell *gc; const struct grid_cell *gc;
static struct grid_cell lastgc1; static struct grid_cell lastgc1;
struct utf8_data ud; struct utf8_data ud;
const char* data; const char *data;
char *buf, code[128]; char *buf, code[128];
size_t len, off, size, codelen; size_t len, off, size, codelen;
u_int xx; u_int xx;

View File

@ -102,7 +102,7 @@ paste_get_name(const char *name)
if (name == NULL || *name == '\0') if (name == NULL || *name == '\0')
return (NULL); return (NULL);
pbfind.name = (char*)name; pbfind.name = (char *)name;
return (RB_FIND(paste_name_tree, &paste_by_name, &pbfind)); return (RB_FIND(paste_name_tree, &paste_by_name, &pbfind));
} }
@ -115,7 +115,7 @@ paste_free_name(const char *name)
if (name == NULL || *name == '\0') if (name == NULL || *name == '\0')
return (-1); return (-1);
pbfind.name = (char*)name; pbfind.name = (char *)name;
pb = RB_FIND(paste_name_tree, &paste_by_name, &pbfind); pb = RB_FIND(paste_name_tree, &paste_by_name, &pbfind);
if (pb == NULL) if (pb == NULL)
return (-1); return (-1);

View File

@ -327,7 +327,7 @@ screen_check_selection(struct screen *s, u_int px, u_int py)
return (0); return (0);
if (py == sel->sy && px < sel->sx) if (py == sel->sy && px < sel->sx)
return 0; return (0);
if (py == sel->ey && px > sel->ex) if (py == sel->ey && px > sel->ex)
return (0); return (0);

View File

@ -914,7 +914,7 @@ server_client_msg_command(struct client *c, struct imsg *imsg)
fatalx("bad MSG_COMMAND size"); fatalx("bad MSG_COMMAND size");
memcpy(&data, imsg->data, sizeof data); memcpy(&data, imsg->data, sizeof data);
buf = (char*)imsg->data + sizeof data; buf = (char *)imsg->data + sizeof data;
len = imsg->hdr.len - IMSG_HEADER_SIZE - sizeof data; len = imsg->hdr.len - IMSG_HEADER_SIZE - sizeof data;
if (len > 0 && buf[len - 1] != '\0') if (len > 0 && buf[len - 1] != '\0')
fatalx("bad MSG_COMMAND string"); fatalx("bad MSG_COMMAND string");

2
tmux.h
View File

@ -2325,7 +2325,7 @@ void set_signals(void(*)(int, short, void *));
void clear_signals(int); void clear_signals(int);
/* control.c */ /* control.c */
void control_callback(struct client *, int, void*); void control_callback(struct client *, int, void *);
void printflike2 control_write(struct client *, const char *, ...); void printflike2 control_write(struct client *, const char *, ...);
void control_write_buffer(struct client *, struct evbuffer *); void control_write_buffer(struct client *, struct evbuffer *);

View File

@ -1498,8 +1498,8 @@ window_copy_copy_pipe(struct window_pane *wp, struct session *sess,
void void
window_copy_copy_selection(struct window_pane *wp, const char *bufname) window_copy_copy_selection(struct window_pane *wp, const char *bufname)
{ {
void* buf; void *buf;
size_t len; size_t len;
buf = window_copy_get_selection(wp, &len); buf = window_copy_get_selection(wp, &len);
if (buf == NULL) if (buf == NULL)