From acc5b501679d20c456cd275ed3f9c5ee2010aff2 Mon Sep 17 00:00:00 2001
From: Vit Rosin <vit_r@list.ru>
Date: Mon, 22 Mar 2010 22:08:37 +0000
Subject: [PATCH] some trivial corrections
---
lib/util.h | 2 +-
src/charsets.h | 3 ++-
src/complete.c | 12 ++++++++----
src/cons.handler.c | 6 ++++--
src/dialog.h | 6 +++---
src/editor/etags.c | 1 -
src/main.c | 8 +++++---
src/viewer/nroff.c | 2 ++
8 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/lib/util.h b/lib/util.h
index 606449c..c588434 100644
a
|
b
|
static inline char * str_move(char * dest, const char * src) |
288 | 288 | |
289 | 289 | n = strlen (src) + 1; /* + '\0' */ |
290 | 290 | |
291 | | return memmove (dest, src, n); |
| 291 | return ((char *) memmove (dest, src, n)); |
292 | 292 | } |
293 | 293 | |
294 | 294 | gboolean mc_util_make_backup_if_possible (const char *, const char *); |
diff --git a/src/charsets.h b/src/charsets.h
index 98186b8..cb9c7ef 100644
a
|
b
|
convert_to_display_c (int c) |
69 | 69 | { |
70 | 70 | if (c < 0 || c >= 256) |
71 | 71 | return c; |
72 | | return conv_displ[c]; |
| 72 | |
| 73 | return ((int) conv_displ[c]); |
73 | 74 | } |
74 | 75 | |
75 | 76 | static inline int |
diff --git a/src/complete.c b/src/complete.c
index abe0668..2cd098f 100644
a
|
b
|
command_completion_function (const char *_text, int state, INPUT_COMPLETE_FLAGS |
520 | 520 | switch (phase) { |
521 | 521 | case 0: /* Reserved words */ |
522 | 522 | while (*words) { |
523 | | if (!strncmp (*words, text, text_len)) |
524 | | return g_strdup (*(words++)); |
| 523 | if (!strncmp (*words, text, text_len)) { |
| 524 | g_free (text); |
| 525 | return g_strdup (*(words++)); |
| 526 | } |
525 | 527 | words++; |
526 | 528 | } |
527 | 529 | phase++; |
528 | 530 | words = bash_builtins; |
529 | 531 | case 1: /* Builtin commands */ |
530 | 532 | while (*words) { |
531 | | if (!strncmp (*words, text, text_len)) |
532 | | return g_strdup (*(words++)); |
| 533 | if (!strncmp (*words, text, text_len)) { |
| 534 | g_free (text); |
| 535 | return g_strdup (*(words++)); |
| 536 | } |
533 | 537 | words++; |
534 | 538 | } |
535 | 539 | phase++; |
diff --git a/src/cons.handler.c b/src/cons.handler.c
index bb4674b..a65b1a5 100644
a
|
b
|
handle_console_linux (unsigned char action) |
107 | 107 | switch (action) { |
108 | 108 | case CONSOLE_INIT: |
109 | 109 | /* Close old pipe ends in case it is the 2nd time we run cons.saver */ |
110 | | close (pipefd1[1]); |
111 | | close (pipefd2[0]); |
| 110 | if (pipefd1[1] > 2) { |
| 111 | close (pipefd1[1]); |
| 112 | close (pipefd2[0]); |
| 113 | } |
112 | 114 | /* Create two pipes for communication */ |
113 | 115 | pipe (pipefd1); |
114 | 116 | pipe (pipefd2); |
diff --git a/src/dialog.h b/src/dialog.h
index c40dd5f..514b6a7 100644
a
|
b
|
send_message (Widget *w, widget_msg_t msg, int parm) |
235 | 235 | return (*(w->callback)) (w, msg, parm); |
236 | 236 | } |
237 | 237 | |
238 | | /* Return 1 if the widget is active, 0 otherwise */ |
239 | | static inline int |
| 238 | /* Return TRUE if the widget is active, FALSE otherwise */ |
| 239 | static inline gboolean |
240 | 240 | dlg_widget_active (void *w) |
241 | 241 | { |
242 | 242 | Widget *w1 = (Widget *) w; |
243 | | return (w1->parent->current == w1); |
| 243 | return ((gboolean) (w1->parent->current == w1)); |
244 | 244 | } |
245 | 245 | |
246 | 246 | void dlg_replace_widget (Widget *old, Widget *new); |
diff --git a/src/editor/etags.c b/src/editor/etags.c
index e5d0a81..945f597 100644
a
|
b
|
static gboolean parse_define(char *buf, char **long_name, char **short_name, lon |
110 | 110 | *short_name = g_strdup (shortdef); |
111 | 111 | *line = atol (linedef); |
112 | 112 | return TRUE; |
113 | | break; |
114 | 113 | } |
115 | 114 | buf++; |
116 | 115 | c = *buf; |
diff --git a/src/main.c b/src/main.c
index 27e34b7..c01d453 100644
a
|
b
|
init_xterm_support (void) |
1388 | 1388 | const char *termvalue; |
1389 | 1389 | |
1390 | 1390 | termvalue = getenv ("TERM"); |
1391 | | if (!termvalue || !(*termvalue)) { |
| 1391 | if (termvalue == NULL || *termvalue == '\0') { |
1392 | 1392 | fputs (_("The TERM environment variable is unset!\n"), stderr); |
1393 | | exit (1); |
| 1393 | exit (EXIT_FAILURE); |
1394 | 1394 | } |
1395 | 1395 | |
1396 | 1396 | /* Check mouse capabilities */ |
… |
… |
mc_main__setup_by_args (int argc, char *argv[]) |
2040 | 2040 | * in error messages and warnings. It is supported so that |
2041 | 2041 | * users can quickly copy and paste file locations. |
2042 | 2042 | */ |
2043 | | char *end = tmp + strlen (tmp), *p = end; |
| 2043 | char *end = tmp + strlen (tmp); |
| 2044 | char *p = end; |
| 2045 | |
2044 | 2046 | if (p > tmp && p[-1] == ':') |
2045 | 2047 | p--; |
2046 | 2048 | while (p > tmp && g_ascii_isdigit ((gchar) p[-1])) |
diff --git a/src/viewer/nroff.c b/src/viewer/nroff.c
index 95d743f..4411a1d 100644
a
|
b
|
mcview_nroff_seq_free (mcview_nroff_t ** nroff) |
277 | 277 | { |
278 | 278 | if (nroff == NULL || *nroff == NULL) |
279 | 279 | return; |
| 280 | |
| 281 | g_free ((*nroff)->view); |
280 | 282 | g_free (*nroff); |
281 | 283 | nroff = NULL; |
282 | 284 | } |