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. */
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");
free(data);
return (1);
@ -393,7 +393,7 @@ client_write_one(enum msgtype type, int fd, const void *buf, size_t len)
int retval;
retval = imsg_compose(&client_ibuf, type, PROTOCOL_VERSION, -1, fd,
(void*)buf, len);
(void *)buf, len);
if (retval != 1)
return (-1);
return (0);

View File

@ -24,7 +24,7 @@
#include "tmux.h"
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)
{
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];
if (strcmp(path, "-") == 0) {
error = server_set_stdin_callback(c, cmd_load_buffer_callback,
(void*)bufname, &cause);
(void *)bufname, &cause);
if (error != 0) {
cmdq_error(cmdq, "%s: %s", path, 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");
if (cmd != NULL && *cmd != '\0') {
argc = 1;
argv = (char**)&cmd;
argv = (char **)&cmd;
} else {
argc = 0;
argv = NULL;

View File

@ -124,14 +124,14 @@ cmdq_guard(struct cmd_q *cmdq, const char *guard, int flags)
struct client *c = cmdq->client;
if (c == NULL)
return 0;
return (0);
if (!(c->flags & CLIENT_CONTROL))
return 0;
return (0);
evbuffer_add_printf(c->stdout_data, "%%%s %ld %u %d\n", guard,
(long) cmdq->time, cmdq->number, flags);
server_push_stdout(c);
return 1;
return (1);
}
/* 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. */
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)
{
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, 'q')) {
cmdq_error(cmdq, "already set: %s", optstr);
return CMD_RETURN_ERROR;
return (CMD_RETURN_ERROR);
}
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");
if (cmd != NULL && *cmd != '\0') {
argc = 1;
argv = (char**)&cmd;
argv = (char **)&cmd;
} else {
argc = 0;
argv = NULL;

View File

@ -108,7 +108,7 @@ cmd_wait_for_signal(struct cmd_q *cmdq, const char *name,
if (!wc->locked) {
RB_REMOVE(wait_channels, &wait_channels, wc);
free((void*) wc->name);
free((void *)wc->name);
free(wc);
}
@ -186,7 +186,7 @@ cmd_wait_for_unlock(struct cmd_q *cmdq, const char *name,
wc->locked = 0;
if (TAILQ_EMPTY(&wc->waiters)) {
RB_REMOVE(wait_channels, &wait_channels, wc);
free((void*) wc->name);
free((void *)wc->name);
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;
static struct grid_cell lastgc1;
struct utf8_data ud;
const char* data;
const char *data;
char *buf, code[128];
size_t len, off, size, codelen;
u_int xx;

View File

@ -102,7 +102,7 @@ paste_get_name(const char *name)
if (name == NULL || *name == '\0')
return (NULL);
pbfind.name = (char*)name;
pbfind.name = (char *)name;
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')
return (-1);
pbfind.name = (char*)name;
pbfind.name = (char *)name;
pb = RB_FIND(paste_name_tree, &paste_by_name, &pbfind);
if (pb == NULL)
return (-1);

View File

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

View File

@ -914,7 +914,7 @@ server_client_msg_command(struct client *c, struct imsg *imsg)
fatalx("bad MSG_COMMAND size");
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;
if (len > 0 && buf[len - 1] != '\0')
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);
/* 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 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
window_copy_copy_selection(struct window_pane *wp, const char *bufname)
{
void* buf;
size_t len;
void *buf;
size_t len;
buf = window_copy_get_selection(wp, &len);
if (buf == NULL)