summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpgen <p.gen.progs@gmail.com>2019-03-29 22:42:45 +0100
committerpgen <p.gen.progs@gmail.com>2019-03-30 11:39:03 +0100
commitae76ad0e8df96a5e6ea0b503b0c4015659bfe3ea (patch)
tree2a08e533413b2ab45a90f44b27f1d8401c05964c
parentc264b6de8a6cd615bc32f056cc11ff4c578af580 (diff)
Silent compiler warnings
-rw-r--r--getopt.h22
-rw-r--r--list.c4
-rw-r--r--list.h4
-rw-r--r--smenu.c25
-rw-r--r--smenu.h6
5 files changed, 32 insertions, 29 deletions
diff --git a/getopt.h b/getopt.h
index fef745f..ebae451 100644
--- a/getopt.h
+++ b/getopt.h
@@ -15,16 +15,18 @@
/* setting of 'opterr' and 'opterrfd'). Note that this version of */
/* TELL() doesn't require the existence of stdio.h. */
/* """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" */
-#define TELL(S) \
- { \
- ssize_t dummy_rc; \
- if (eopterr && eopterrfd >= 0) \
- { \
- char option = (char)eoptopt; \
- dummy_rc = write(eopterrfd, (S), strlen(S)); \
- dummy_rc = write(eopterrfd, &option, 1); \
- dummy_rc = write(eopterrfd, "\n", 1); \
- } \
+#define TELL(S) \
+ { \
+ if (eopterr && eopterrfd >= 0) \
+ { \
+ char option = (char)eoptopt; \
+ if (write(eopterrfd, (S), strlen(S))) \
+ ; \
+ if (write(eopterrfd, &option, 1)) \
+ ; \
+ if (write(eopterrfd, "\n", 1)) \
+ ; \
+ } \
}
int
diff --git a/list.c b/list.c
index b217492..2757cb3 100644
--- a/list.c
+++ b/list.c
@@ -190,7 +190,7 @@ ll_insert_after(ll_t * const list, ll_node_t * node, void * const data)
/* Based on code found here: */
/* http://www.geeksforgeeks.org/quicksort-for-linked-list */
/* ====================================================== */
-static ll_node_t *
+ll_node_t *
ll_partition(ll_node_t * l, ll_node_t * h, int (*comp)(void *, void *),
void (*swap)(void *, void *))
{
@@ -225,7 +225,7 @@ ll_partition(ll_node_t * l, ll_node_t * h, int (*comp)(void *, void *),
/* ======================================================= */
/* A recursive implementation of quicksort for linked list */
/* ======================================================= */
-static void
+void
ll_quicksort(ll_node_t * l, ll_node_t * h, int (*comp)(void *, void *),
void (*swap)(void * a, void *))
{
diff --git a/list.h b/list.h
index bbb506c..2dd906a 100644
--- a/list.h
+++ b/list.h
@@ -43,11 +43,11 @@ ll_insert_before(ll_t * const list, ll_node_t * node, void * const data);
void
ll_insert_after(ll_t * const list, ll_node_t * node, void * const data);
-static ll_node_t *
+ll_node_t *
ll_partition(ll_node_t * l, ll_node_t * h, int (*comp)(void *, void *),
void (*swap)(void *, void *));
-static void
+void
ll_quicksort(ll_node_t * l, ll_node_t * h, int (*comp)(void *, void *),
void (*swap)(void * a, void *));
diff --git a/smenu.c b/smenu.c
index 629ded7..647262e 100644
--- a/smenu.c
+++ b/smenu.c
@@ -939,7 +939,7 @@ update_bitmaps(search_mode_t mode, search_data_t * data,
/* starts points to the first UTF-8 glyph og the word */
/* """""""""""""""""""""""""""""""""""""""""""""""""" */
- while (start - str < word_a[n].len - daccess.flength)
+ while ((size_t)(start - str) < word_a[n].len - daccess.flength)
{
/* Reset the bitmap */
/* """""""""""""""" */
@@ -4184,8 +4184,7 @@ get_line_last_word(long line, long last_line)
/* the variable 'current' if an adequate word is found. */
/* ==================================================================== */
int
-find_best_word_upward(win_t * win, term_t * term, long line, long last_word,
- long s, long e)
+find_best_word_upward(long last_word, long s, long e)
{
int found = 0;
long index;
@@ -4260,8 +4259,7 @@ find_best_word_upward(win_t * win, term_t * term, long line, long last_word,
/* the variable 'current' if an adequate word is found. */
/* ==================================================================== */
int
-find_best_word_downward(win_t * win, term_t * term, long line, long last_word,
- long s, long e)
+find_best_word_downward(long last_word, long s, long e)
{
int found = 0;
long index;
@@ -4419,7 +4417,7 @@ move_up(win_t * win, term_t * term, toggle_t * toggle,
/* """""""""""""""""""""""""""""""""""""""""""""" */
line = first_selectable_line;
last_word = get_line_last_word(line, last_line);
- find_best_word_upward(win, term, line, last_word, s, e);
+ find_best_word_upward(last_word, s, e);
}
else
{
@@ -4434,7 +4432,7 @@ move_up(win_t * win, term_t * term, toggle_t * toggle,
{
line = first_selectable_line;
last_word = get_line_last_word(line, last_line);
- find_best_word_upward(win, term, line, last_word, s, e);
+ find_best_word_upward(last_word, s, e);
}
else
{
@@ -4445,7 +4443,7 @@ move_up(win_t * win, term_t * term, toggle_t * toggle,
{
last_word = get_line_last_word(line, last_line);
- if (find_best_word_upward(win, term, line, last_word, s, e))
+ if (find_best_word_upward(last_word, s, e))
{
found = 1;
break;
@@ -4584,7 +4582,7 @@ move_down(win_t * win, term_t * term, toggle_t * toggle,
/* """""""""""""""""""""""""""""""""""""""""""""" */
line = last_selectable_line;
last_word = get_line_last_word(line, last_line);
- find_best_word_downward(win, term, line, last_word, s, e);
+ find_best_word_downward(last_word, s, e);
}
else
{
@@ -4599,7 +4597,7 @@ move_down(win_t * win, term_t * term, toggle_t * toggle,
{
line = last_selectable_line;
last_word = get_line_last_word(line, last_line);
- find_best_word_downward(win, term, line, last_word, s, e);
+ find_best_word_downward(last_word, s, e);
}
else
{
@@ -4610,7 +4608,7 @@ move_down(win_t * win, term_t * term, toggle_t * toggle,
{
last_word = get_line_last_word(line, last_line);
- if (find_best_word_downward(win, term, line, last_word, s, e))
+ if (find_best_word_downward(last_word, s, e))
{
found = 1;
break;
@@ -6682,6 +6680,11 @@ main(int argc, char * argv[])
strcat(timeout_message, timeout_word);
strcat(timeout_message, "\"]");
break;
+
+ default:
+ /* The other cases are impossible due to options analysis */
+ /* '''''''''''''''''''''''''''''''''''''''''''''''''''''' */
+ timeout_message = xstrdup(" "); /* Just in case. */
}
timeout_seconds = xcalloc(1, 6);
diff --git a/smenu.h b/smenu.h
index ba8a420..584c5cb 100644
--- a/smenu.h
+++ b/smenu.h
@@ -234,12 +234,10 @@ move_right(win_t * win, term_t * term, toggle_t * toggle,
long last_line, char * tmp_word);
int
-find_best_word_upward(win_t * win, term_t * term, long line, long last_word,
- long s, long e);
+find_best_word_upward(long last_word, long s, long e);
int
-find_best_word_downward(win_t * win, term_t * term, long line, long last_word,
- long s, long e);
+find_best_word_downward(long last_word, long s, long e);
void
move_up(win_t * win, term_t * term, toggle_t * toggle,