[rtems-libbsd commit] Include missing <string.h> and <limits.h>
Sebastian Huber
sebh at rtems.org
Fri Aug 25 12:24:03 UTC 2017
Module: rtems-libbsd
Branch: master
Commit: 666a56883ad2ae7757689f28cee2b9b80582bcd6
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=666a56883ad2ae7757689f28cee2b9b80582bcd6
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Aug 25 14:23:18 2017 +0200
Include missing <string.h> and <limits.h>
Fix warnings.
Update #2132.
Update #2133.
---
freebsd/sys/sys/systm.h | 3 +++
rtemsbsd/rtems/rtems-kernel-init.c | 2 ++
testsuite/evdev01/init.c | 19 ++++++++++---------
testsuite/ftpd02/test_main.c | 1 +
testsuite/media01/test_main.c | 1 +
testsuite/pf01/test_main.c | 1 +
testsuite/pf02/test_main.c | 1 +
testsuite/program01/test_main.c | 1 +
testsuite/selectpollkqueue01/test_main.c | 1 -
testsuite/telnetd01/test_main.c | 1 +
testsuite/termios/test_termios_driver.c | 3 ++-
testsuite/termios01/test_main.c | 6 +++---
testsuite/usbserial01/init.c | 15 ++++++++-------
13 files changed, 34 insertions(+), 21 deletions(-)
diff --git a/freebsd/sys/sys/systm.h b/freebsd/sys/sys/systm.h
index ee79932..90c11bb 100644
--- a/freebsd/sys/sys/systm.h
+++ b/freebsd/sys/sys/systm.h
@@ -44,6 +44,9 @@
#include <sys/cdefs.h>
#include <sys/queue.h>
#include <sys/stdint.h> /* for people using printf mainly */
+#ifdef __rtems__
+#include <string.h>
+#endif /* __rtems__ */
__NULLABILITY_PRAGMA_PUSH
diff --git a/rtemsbsd/rtems/rtems-kernel-init.c b/rtemsbsd/rtems/rtems-kernel-init.c
index 4138bc1..8432d5d 100644
--- a/rtemsbsd/rtems/rtems-kernel-init.c
+++ b/rtemsbsd/rtems/rtems-kernel-init.c
@@ -51,6 +51,8 @@
#include <sys/stat.h>
#include <sys/kbio.h>
+#include <limits.h>
+
#include <dev/kbd/kbdreg.h>
#include <net80211/ieee80211_freebsd.h>
diff --git a/testsuite/evdev01/init.c b/testsuite/evdev01/init.c
index fa16e61..935596a 100644
--- a/testsuite/evdev01/init.c
+++ b/testsuite/evdev01/init.c
@@ -28,6 +28,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include <dev/evdev/input.h>
@@ -293,7 +294,7 @@ check_device_type(char* device)
return ret;
}
-static int
+static void
scan_for_devices(void)
{
int device_count;
@@ -318,7 +319,7 @@ evdev_scan_task(rtems_task_argument arg)
{
rtems_status_code sc;
struct evdev_test_message msg;
- uint32_t size;
+ size_t size;
otask_active = true;
kill_otask = false;
@@ -350,7 +351,7 @@ evdev_keyboard_task(rtems_task_argument arg)
struct input_event buffer[32];
rtems_status_code sc;
struct evdev_test_message msg;
- uint32_t size;
+ size_t size;
ktask_active = true;
kill_ktask = false;
@@ -433,7 +434,7 @@ evdev_mouse_task(rtems_task_argument arg)
struct input_event buffer[32];
rtems_status_code sc;
struct evdev_test_message msg;
- uint32_t size;
+ size_t size;
mtask_active = true;
kill_mtask = false;
@@ -510,7 +511,7 @@ evdev_touch_task(rtems_task_argument arg)
struct input_event buffer[32];
rtems_status_code sc;
struct evdev_test_message msg;
- uint32_t size;
+ size_t size;
ttask_active = true;
kill_ttask = false;
@@ -648,16 +649,16 @@ Init(rtems_task_argument arg)
);
assert(sc == RTEMS_SUCCESSFUL);
- sc = rtems_task_start(oid, evdev_scan_task, NULL);
+ sc = rtems_task_start(oid, evdev_scan_task, 0);
assert(sc == RTEMS_SUCCESSFUL);
- sc = rtems_task_start(kid, evdev_keyboard_task, NULL);
+ sc = rtems_task_start(kid, evdev_keyboard_task, 0);
assert(sc == RTEMS_SUCCESSFUL);
- sc = rtems_task_start(mid, evdev_mouse_task, NULL);
+ sc = rtems_task_start(mid, evdev_mouse_task, 0);
assert(sc == RTEMS_SUCCESSFUL);
- sc = rtems_task_start(tid, evdev_touch_task, NULL);
+ sc = rtems_task_start(tid, evdev_touch_task, 0);
assert(sc == RTEMS_SUCCESSFUL);
sc = rtems_bsd_initialize();
diff --git a/testsuite/ftpd02/test_main.c b/testsuite/ftpd02/test_main.c
index 457192b..3eb079d 100644
--- a/testsuite/ftpd02/test_main.c
+++ b/testsuite/ftpd02/test_main.c
@@ -33,6 +33,7 @@
#include <fcntl.h>
#include <assert.h>
#include <stdlib.h>
+#include <string.h>
#include <rtems.h>
#include <rtems/ftpd.h>
diff --git a/testsuite/media01/test_main.c b/testsuite/media01/test_main.c
index df4cf21..b808ad6 100644
--- a/testsuite/media01/test_main.c
+++ b/testsuite/media01/test_main.c
@@ -32,6 +32,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <rtems/bdbuf.h>
#include <rtems/console.h>
diff --git a/testsuite/pf01/test_main.c b/testsuite/pf01/test_main.c
index 51c8839..9421f0e 100644
--- a/testsuite/pf01/test_main.c
+++ b/testsuite/pf01/test_main.c
@@ -33,6 +33,7 @@
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <netinet/in.h>
diff --git a/testsuite/pf02/test_main.c b/testsuite/pf02/test_main.c
index e81d204..98c512b 100644
--- a/testsuite/pf02/test_main.c
+++ b/testsuite/pf02/test_main.c
@@ -32,6 +32,7 @@
#include <assert.h>
#include <fcntl.h>
#include <stdlib.h>
+#include <string.h>
#include <rtems/telnetd.h>
#include <rtems/ftpd.h>
diff --git a/testsuite/program01/test_main.c b/testsuite/program01/test_main.c
index a670afe..ac72627 100644
--- a/testsuite/program01/test_main.c
+++ b/testsuite/program01/test_main.c
@@ -33,6 +33,7 @@
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include <syslog.h>
#include <sys/socket.h>
diff --git a/testsuite/selectpollkqueue01/test_main.c b/testsuite/selectpollkqueue01/test_main.c
index 8af59bf..6473c6c 100755
--- a/testsuite/selectpollkqueue01/test_main.c
+++ b/testsuite/selectpollkqueue01/test_main.c
@@ -1149,7 +1149,6 @@ static void
test_pipe_close(test_context *ctx)
{
int rfd = ctx->pfd[0];
- int wfd = ctx->pfd[1];
struct pollfd pfd = {
.fd = rfd,
.events = POLLIN
diff --git a/testsuite/telnetd01/test_main.c b/testsuite/telnetd01/test_main.c
index c85a896..489f244 100644
--- a/testsuite/telnetd01/test_main.c
+++ b/testsuite/telnetd01/test_main.c
@@ -30,6 +30,7 @@
*/
#include <assert.h>
+#include <string.h>
#include <rtems.h>
#include <rtems/shell.h>
diff --git a/testsuite/termios/test_termios_driver.c b/testsuite/termios/test_termios_driver.c
index 35637b9..1e57a01 100644
--- a/testsuite/termios/test_termios_driver.c
+++ b/testsuite/termios/test_termios_driver.c
@@ -13,6 +13,7 @@
#include <sys/tty.h>
#include <sys/serial.h>
#include <assert.h>
+#include <string.h>
#include <rtems/seterr.h>
#include "../termios/test_termios_driver.h"
@@ -133,4 +134,4 @@ test_termios_make_dev(void)
tty_makedev( tp, NULL, "%s", TERMIOS_TEST_DRIVER_TTY_PREFIX TERMIOS_TEST_DRIVER_TTY_UNIT);
assert(tp != NULL);
-}
\ No newline at end of file
+}
diff --git a/testsuite/termios01/test_main.c b/testsuite/termios01/test_main.c
index 0ed991d..e00ff86 100644
--- a/testsuite/termios01/test_main.c
+++ b/testsuite/termios01/test_main.c
@@ -10,8 +10,10 @@
#define TTYDEFCHARS
#include <sys/ttydefaults.h>
#include <assert.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
@@ -576,8 +578,6 @@ static void
test_main(void)
{
int rc;
- rtems_status_code sc;
- rtems_device_major_number registered;
int test;
struct termios t;
int index = 0;
@@ -687,4 +687,4 @@ test_main(void)
exit(0);
}
-#include <rtems/bsd/test/default-termios-init.h>
\ No newline at end of file
+#include <rtems/bsd/test/default-termios-init.h>
diff --git a/testsuite/usbserial01/init.c b/testsuite/usbserial01/init.c
index eee027f..4e2209f 100644
--- a/testsuite/usbserial01/init.c
+++ b/testsuite/usbserial01/init.c
@@ -28,6 +28,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <errno.h>
#include <fcntl.h>
@@ -56,7 +57,8 @@ static void
usb_serial_read_task(rtems_task_argument arg)
{
struct usb_test_message msg;
- uint32_t size, end_time;
+ size_t size;
+ uint32_t end_time;
int bytes, index;
rtask_active = true;
@@ -90,7 +92,7 @@ static void
usb_serial_write_task(rtems_task_argument arg)
{
struct usb_test_message msg;
- uint32_t size;
+ size_t size;
int bytes, write_len, count = 0;
wtask_active = true;
@@ -121,7 +123,7 @@ usb_serial_open_task(rtems_task_argument arg)
rtems_status_code sc;
struct usb_test_message msg;
struct termios t;
- uint32_t size;
+ size_t size;
int fd, iret;
fd = -2;
@@ -173,7 +175,6 @@ Init(rtems_task_argument arg)
{
rtems_status_code sc;
struct usb_test_message msg;
- int ii;
(void) arg;
puts("*** " TEST_NAME " TEST ***");
@@ -235,13 +236,13 @@ Init(rtems_task_argument arg)
);
assert(sc == RTEMS_SUCCESSFUL);
- sc = rtems_task_start(rid, usb_serial_read_task, NULL);
+ sc = rtems_task_start(rid, usb_serial_read_task, 0);
assert(sc == RTEMS_SUCCESSFUL);
- sc = rtems_task_start(oid, usb_serial_open_task, NULL);
+ sc = rtems_task_start(oid, usb_serial_open_task, 0);
assert(sc == RTEMS_SUCCESSFUL);
- sc = rtems_task_start(wid, usb_serial_write_task, NULL);
+ sc = rtems_task_start(wid, usb_serial_write_task, 0);
assert(sc == RTEMS_SUCCESSFUL);
sc = rtems_bsd_initialize();
More information about the vc
mailing list