[warnings] fix warnings across the entire code base

Fix or squelch all warnings in all code covered by buildall.
This commit is contained in:
Travis Geiselbrecht
2018-12-16 17:33:22 -08:00
parent e608867d71
commit f98cef7992
19 changed files with 52 additions and 38 deletions

View File

@@ -247,7 +247,7 @@ __NO_INLINE static void bench_sincos(void)
#endif // WITH_LIB_LIBM
void benchmarks(void)
int benchmarks(int argc, const cmd_args *argv)
{
bench_set_overhead();
bench_memset();
@@ -269,5 +269,7 @@ void benchmarks(void)
#if WITH_LIB_LIBM
bench_sincos();
#endif
return NO_ERROR;
}

View File

@@ -30,7 +30,7 @@
#include <kernel/event.h>
#include <platform.h>
void clock_tests(void)
int clock_tests(int argc, const cmd_args *argv)
{
uint32_t c;
lk_time_t t;
@@ -118,4 +118,6 @@ void clock_tests(void)
cycles = arch_cycle_count() - cycles;
printf("%u cycles per second\n", cycles);
}
return NO_ERROR;
}

View File

@@ -27,13 +27,13 @@
int cbuf_tests(int argc, const cmd_args *argv);
int fibo(int argc, const cmd_args *argv);
int port_tests(void);
int port_tests(int argc, const cmd_args *argv);
int spinner(int argc, const cmd_args *argv);
int thread_tests(void);
void benchmarks(void);
void clock_tests(void);
void printf_tests(void);
void printf_tests_float(void);
int thread_tests(int argc, const cmd_args *argv);
int benchmarks(int argc, const cmd_args *argv);
int clock_tests(int argc, const cmd_args *argv);
int printf_tests(int argc, const cmd_args *argv);
int printf_tests_float(int argc, const cmd_args *argv);
#endif

View File

@@ -21,11 +21,12 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <app/tests.h>
#include <err.h>
#include <stdio.h>
#include <string.h>
#include <debug.h>
void printf_tests(void)
int printf_tests(int argc, const cmd_args *argv)
{
printf("printf tests\n");
@@ -116,11 +117,13 @@ void printf_tests(void)
err = snprintf(buf, 15, "0123456789abcdef012345678");
printf("snprintf returns %d\n", err);
hexdump8(buf, sizeof(buf));
return NO_ERROR;
}
#include "float_test_vec.c"
void printf_tests_float(void)
int printf_tests_float(int argc, const cmd_args *argv)
{
printf("floating point printf tests\n");
@@ -128,6 +131,7 @@ void printf_tests_float(void)
PRINT_FLOAT;
}
return NO_ERROR;
}

View File

@@ -29,14 +29,14 @@
#include <lib/console.h>
STATIC_COMMAND_START
STATIC_COMMAND("printf_tests", "test printf", (console_cmd)&printf_tests)
STATIC_COMMAND("printf_tests_float", "test printf with floating point", (console_cmd)&printf_tests_float)
STATIC_COMMAND("thread_tests", "test the scheduler", (console_cmd)&thread_tests)
STATIC_COMMAND("port_tests", "test the ports", (console_cmd)&port_tests)
STATIC_COMMAND("clock_tests", "test clocks", (console_cmd)&clock_tests)
STATIC_COMMAND("bench", "miscellaneous benchmarks", (console_cmd)&benchmarks)
STATIC_COMMAND("fibo", "threaded fibonacci", (console_cmd)&fibo)
STATIC_COMMAND("spinner", "create a spinning thread", (console_cmd)&spinner)
STATIC_COMMAND("printf_tests", "test printf", &printf_tests)
STATIC_COMMAND("printf_tests_float", "test printf with floating point", &printf_tests_float)
STATIC_COMMAND("thread_tests", "test the scheduler", &thread_tests)
STATIC_COMMAND("port_tests", "test the ports", &port_tests)
STATIC_COMMAND("clock_tests", "test clocks", &clock_tests)
STATIC_COMMAND("bench", "miscellaneous benchmarks", &benchmarks)
STATIC_COMMAND("fibo", "threaded fibonacci", &fibo)
STATIC_COMMAND("spinner", "create a spinning thread", &spinner)
STATIC_COMMAND("cbuf_tests", "test lib/cbuf", &cbuf_tests)
STATIC_COMMAND_END(tests);
@@ -48,6 +48,6 @@ static void tests_init(const struct app_descriptor *app)
APP_START(tests)
.init = tests_init,
.flags = 0,
APP_END
.flags = 0,
APP_END

View File

@@ -616,7 +616,7 @@ static void spinlock_test(void)
#undef COUNT
}
int thread_tests(void)
int thread_tests(int argc, const cmd_args *argv)
{
mutex_test();
semaphore_test();