summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2011-02-24 12:53:39 +0100
committerAndrea Canciani <ranma42@gmail.com>2011-02-28 10:38:02 +0100
commit9ebde285fa990bfa1524f166fbfb1368c346b14a (patch)
tree9aa3df38ee24e849d84410a219049eb3bc225354
parent8868778ea1fdc8e70da76b3b00ea78106c5840d8 (diff)
test: Silence MSVC warnings
MSVC does not notice non-returning functions (abort() / assert(0)) and warns about paths which end with them in non-void functions: c:\cygwin\home\ranma42\code\fdo\pixman\test\fetch-test.c(114) : warning C4715: 'reader' : not all control paths return a value c:\cygwin\home\ranma42\code\fdo\pixman\test\stress-test.c(133) : warning C4715: 'real_reader' : not all control paths return a value c:\cygwin\home\ranma42\code\fdo\pixman\test\composite.c(431) : warning C4715: 'calc_op' : not all control paths return a value These warnings can be silenced by adding a return after the termination call.
-rw-r--r--test/composite.c1
-rw-r--r--test/fetch-test.c1
-rw-r--r--test/stress-test.c2
3 files changed, 3 insertions, 1 deletions
diff --git a/test/composite.c b/test/composite.c
index 08c6689d..a86e5ed6 100644
--- a/test/composite.c
+++ b/test/composite.c
@@ -426,6 +426,7 @@ calc_op (pixman_op_t op, double src, double dst, double srca, double dsta)
case PIXMAN_OP_HSL_LUMINOSITY:
default:
abort();
+ return 0; /* silence MSVC */
}
#undef mult_chan
}
diff --git a/test/fetch-test.c b/test/fetch-test.c
index 314a0727..60bc765f 100644
--- a/test/fetch-test.c
+++ b/test/fetch-test.c
@@ -110,6 +110,7 @@ reader (const void *src, int size)
return *(uint32_t *)src;
default:
assert(0);
+ return 0; /* silence MSVC */
}
}
diff --git a/test/stress-test.c b/test/stress-test.c
index bcbc1f86..166dc6d2 100644
--- a/test/stress-test.c
+++ b/test/stress-test.c
@@ -128,7 +128,7 @@ real_reader (const void *src, int size)
return *(uint32_t *)src;
default:
assert (0);
- break;
+ return 0; /* silence MSVC */
}
}