summaryrefslogtreecommitdiff
path: root/libsmartcols
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2016-02-24 13:51:10 +0100
committerKarel Zak <kzak@redhat.com>2016-02-24 13:51:10 +0100
commitb64dc52a53fe33286d305f5e3af4dbe4afdf6fff (patch)
tree0c462b24a18066a78770d10c0f6b7d5d7ac57dc5 /libsmartcols
parent1c3ed5bf17503e22ef8da306dfaae14b27cd323d (diff)
parent2013b33f40cbd88def30725da84e4dff2f534632 (diff)
downloadutil-linux-b64dc52a53fe33286d305f5e3af4dbe4afdf6fff.tar.gz
Merge branch 'ldadd-cflags-warnings' of https://github.com/rudimeier/util-linux
* 'ldadd-cflags-warnings' of https://github.com/rudimeier/util-linux: build-sys: disable unused parameter warnings for some test progs misc: fix compiler warnungs (unsigned/signed) misc: fix warnings "unused parameter" [-Wunused-parameter] libfdisk: fix warnings, "redundant redeclaration" [-Wredundant-decls] tests: fix compiler warnings [-Wmissing-prototypes] libfdisk: fix compiler warnings [-Wmissing-prototypes] libfdisk: fix missing symbol libblkid: fix compiler warnings [-Wmissing-prototypes] libmount: add mnt_fs_set_priority() build-sys: always add AM_CFLAGS build-sys: always use global LDADD
Diffstat (limited to 'libsmartcols')
-rw-r--r--libsmartcols/samples/Makemodule.am20
-rw-r--r--libsmartcols/samples/wrap.c2
-rw-r--r--libsmartcols/src/Makemodule.am1
-rw-r--r--libsmartcols/src/table.c4
-rw-r--r--libsmartcols/src/table_print.c7
5 files changed, 19 insertions, 15 deletions
diff --git a/libsmartcols/samples/Makemodule.am b/libsmartcols/samples/Makemodule.am
index 9c8869208..be74fc393 100644
--- a/libsmartcols/samples/Makemodule.am
+++ b/libsmartcols/samples/Makemodule.am
@@ -5,19 +5,23 @@ check_PROGRAMS += \
sample-scols-wrap \
sample-scols-continuous
+sample_scols_cflags = $(AM_CFLAGS) $(NO_UNUSED_WARN_CFLAGS) \
+ -I$(ul_libsmartcols_incdir)
+sample_scols_ldadd = $(LDADD) libsmartcols.la
+
sample_scols_tree_SOURCES = libsmartcols/samples/tree.c
-sample_scols_tree_LDADD = libsmartcols.la libcommon.la
-sample_scols_tree_CFLAGS = -I$(ul_libsmartcols_incdir)
+sample_scols_tree_LDADD = $(sample_scols_ldadd) libcommon.la
+sample_scols_tree_CFLAGS = $(sample_scols_cflags)
sample_scols_title_SOURCES = libsmartcols/samples/title.c
-sample_scols_title_LDADD = libsmartcols.la
-sample_scols_title_CFLAGS = -I$(ul_libsmartcols_incdir)
+sample_scols_title_LDADD = $(sample_scols_ldadd)
+sample_scols_title_CFLAGS = $(sample_scols_cflags)
sample_scols_wrap_SOURCES = libsmartcols/samples/wrap.c
-sample_scols_wrap_LDADD = libsmartcols.la
-sample_scols_wrap_CFLAGS = -I$(ul_libsmartcols_incdir)
+sample_scols_wrap_LDADD = $(sample_scols_ldadd)
+sample_scols_wrap_CFLAGS = $(sample_scols_cflags)
sample_scols_continuous_SOURCES = libsmartcols/samples/continuous.c
-sample_scols_continuous_LDADD = libsmartcols.la libcommon.la
-sample_scols_continuous_CFLAGS = -I$(ul_libsmartcols_incdir)
+sample_scols_continuous_LDADD = $(sample_scols_ldadd) libcommon.la
+sample_scols_continuous_CFLAGS = $(sample_scols_cflags)
diff --git a/libsmartcols/samples/wrap.c b/libsmartcols/samples/wrap.c
index 2a476fbe9..96cdff31c 100644
--- a/libsmartcols/samples/wrap.c
+++ b/libsmartcols/samples/wrap.c
@@ -46,7 +46,7 @@ static char *gen_text(const char *prefix, const char *sub_prefix, char *buf, siz
{
int x = snprintf(buf, sz, "%s-%s-", prefix, sub_prefix);
- for ( ; x < sz - 1; x++)
+ for ( ; (size_t)x < sz - 1; x++)
buf[x] = *prefix;
buf[x++] = 'x';
diff --git a/libsmartcols/src/Makemodule.am b/libsmartcols/src/Makemodule.am
index 257d46dcb..248faa9e0 100644
--- a/libsmartcols/src/Makemodule.am
+++ b/libsmartcols/src/Makemodule.am
@@ -25,6 +25,7 @@ nodist_libsmartcols_la_SOURCES = libsmartcols/src/smartcolsP.h
libsmartcols_la_LIBADD = libcommon.la
libsmartcols_la_CFLAGS = \
+ $(AM_CFLAGS) \
$(SOLIB_CFLAGS) \
-I$(ul_libsmartcols_incdir) \
-I$(top_srcdir)/libsmartcols/src
diff --git a/libsmartcols/src/table.c b/libsmartcols/src/table.c
index d4261c067..251fe2169 100644
--- a/libsmartcols/src/table.c
+++ b/libsmartcols/src/table.c
@@ -332,7 +332,7 @@ int scols_table_next_column(struct libscols_table *tb,
*/
int scols_table_get_ncols(struct libscols_table *tb)
{
- return tb ? tb->ncols : -EINVAL;
+ return tb ? (int)tb->ncols : -EINVAL;
}
/**
@@ -343,7 +343,7 @@ int scols_table_get_ncols(struct libscols_table *tb)
*/
int scols_table_get_nlines(struct libscols_table *tb)
{
- return tb ? tb->nlines : -EINVAL;
+ return tb ? (int)tb->nlines : -EINVAL;
}
/**
diff --git a/libsmartcols/src/table_print.c b/libsmartcols/src/table_print.c
index 96ec13759..d1dcb65bd 100644
--- a/libsmartcols/src/table_print.c
+++ b/libsmartcols/src/table_print.c
@@ -281,8 +281,7 @@ static const char *get_cell_color(struct libscols_table *tb,
static void print_newline_padding(struct libscols_table *tb,
struct libscols_column *cl,
struct libscols_line *ln, /* optional */
- size_t bufsz,
- size_t len)
+ size_t bufsz)
{
size_t i;
@@ -509,7 +508,7 @@ static int print_data(struct libscols_table *tb,
return 0;
if (len > width && !scols_column_is_trunc(cl))
- print_newline_padding(tb, cl, ln, buf->bufsz, len); /* next column starts on next line */
+ print_newline_padding(tb, cl, ln, buf->bufsz); /* next column starts on next line */
else
fputs(colsep(tb), tb->out); /* columns separator */
@@ -751,7 +750,7 @@ static int print_title(struct libscols_table *tb)
&width, align,
0, (int) *tb->symbols->title_padding);
- if (rc == (size_t) -1) {
+ if (rc == -1) {
rc = -EINVAL;
goto done;
}