Optimize some code

This commit is contained in:
lazio579 2019-01-09 17:41:14 +08:00
parent e7177a37a0
commit 3a1f8d5616
4 changed files with 4 additions and 6 deletions

View File

@ -1386,7 +1386,7 @@ ecb_binary32_to_binary16 (uint32_t x)
m = frexp (x, &e) * 0x20000000000000U; m = frexp (x, &e) * 0x20000000000000U;
r = m & 0x8000000000000000;; r = m & 0x8000000000000000;
if (r) if (r)
m = -m; m = -m;

View File

@ -80,7 +80,7 @@ static void get_current_time_str(GString *str) {
} }
static struct rfifo *rfifo_alloc(guint size) { static struct rfifo *rfifo_alloc(guint size) {
struct rfifo *ret = (struct rfifo *)g_malloc0(sizeof(struct rfifo));; struct rfifo *ret = (struct rfifo *)g_malloc0(sizeof(struct rfifo));
if (!ret) { if (!ret) {
return NULL; return NULL;

View File

@ -990,10 +990,8 @@ main_cmdline(int argc, char **argv)
opts = chassis_options_new(); opts = chassis_options_new();
opts->ignore_unknown = TRUE; opts->ignore_unknown = TRUE;
srv->options = opts; srv->options = opts;
srv->argv = argv;
srv->argc = argc; srv->argc = argc;
srv->argv = g_new0(char *, argc);
srv->argv = g_new0(char *, argc + 1);
int i; int i;
for (i = 0; i < argc; i++) { for (i = 0; i < argc; i++) {
srv->argv[i] = g_strdup(argv[i]); srv->argv[i] = g_strdup(argv[i]);

View File

@ -3899,7 +3899,7 @@ network_mysqld_process_select_resp(network_mysqld_con *con, network_socket *serv
} else { } else {
network_queue *reserved_queue = con->client->send_queue; network_queue *reserved_queue = con->client->send_queue;
con->client->send_queue = server->recv_queue_raw; con->client->send_queue = server->recv_queue_raw;
server->recv_queue_raw = server->recv_queue;; server->recv_queue_raw = server->recv_queue;
server->recv_queue = reserved_queue; server->recv_queue = reserved_queue;
} }