summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2014-03-01 15:54:43 -0500
committerTavian Barnes <tavianator@tavianator.com>2014-03-01 15:54:43 -0500
commitd2257911e04acab410134d1a3ed79fa569dd941d (patch)
treeaa1bdb577c90552d505c012d4cecdb9ed35e8a64
parent577d01982080e181edeba5172d5a7e007170f4e3 (diff)
downloaddimension-d2257911e04acab410134d1a3ed79fa569dd941d.tar.xz
Fix some warnings found by higher warning levels than -Wall.
-rw-r--r--libdimension-python/Makefile.am3
-rw-r--r--libdimension/png.c4
-rw-r--r--libdimension/profile.c4
-rw-r--r--libdimension/tests/unit-test.c4
4 files changed, 9 insertions, 6 deletions
diff --git a/libdimension-python/Makefile.am b/libdimension-python/Makefile.am
index 7070b70..a4b28ad 100644
--- a/libdimension-python/Makefile.am
+++ b/libdimension-python/Makefile.am
@@ -39,6 +39,9 @@ wrapper_la_SOURCES = dimension.c \
wrapper_la_LDFLAGS = -avoid-version -module
wrapper_la_LIBADD = $(top_builddir)/libdimension/libdimension.la
+dimension.$(OBJEXT): CFLAGS += -Wno-shadow -Wno-sign-compare
+dimension.lo: CFLAGS += -Wno-shadow -Wno-sign-compare
+
EXTRA_DIST = dimension.pyx \
dimension.pxd
diff --git a/libdimension/png.c b/libdimension/png.c
index 62f0fcd..cc8b34f 100644
--- a/libdimension/png.c
+++ b/libdimension/png.c
@@ -181,8 +181,8 @@ dmnsn_png_write_canvas_thread(void *ptr)
if (i->optimizer_fn == dmnsn_rgba16_optimizer_fn) {
for (size_t y = 0; y < height; ++y) {
/* Invert the rows. PNG coordinates are fourth quadrant. */
- uint16_t *row = (uint16_t *)i->ptr + 4*(height - y - 1)*width;
- png_write_row(png_ptr, (png_bytep)row);
+ uint16_t *row_opt = (uint16_t *)i->ptr + 4*(height - y - 1)*width;
+ png_write_row(png_ptr, (png_bytep)row_opt);
dmnsn_future_increment(payload->future);
}
diff --git a/libdimension/profile.c b/libdimension/profile.c
index fcbb423..308c8fb 100644
--- a/libdimension/profile.c
+++ b/libdimension/profile.c
@@ -125,12 +125,12 @@ dmnsn_expect(bool result, bool expected, const char *func, const char *file,
++branch->predicted;
}
} else {
- dmnsn_branch branch = {
+ dmnsn_branch new_branch = {
.location = dmnsn_strdup(key),
.predicted = (result == expected) ? 1 : 0,
.branches = 1
};
- dmnsn_dictionary_insert(thread_profile, key, &branch);
+ dmnsn_dictionary_insert(thread_profile, key, &new_branch);
}
return result;
diff --git a/libdimension/tests/unit-test.c b/libdimension/tests/unit-test.c
index 56908aa..2ba3baf 100644
--- a/libdimension/tests/unit-test.c
+++ b/libdimension/tests/unit-test.c
@@ -75,7 +75,7 @@ dmnsn_add_test_cases(void *ptr)
}
Suite *
-dmnsn_test_suite()
+dmnsn_test_suite(void)
{
dmnsn_suite = suite_create("Dimension");
@@ -87,7 +87,7 @@ dmnsn_test_suite()
}
int
-main()
+main(void)
{
/* Treat warnings as errors for tests */
dmnsn_die_on_warnings(true);