mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-24 02:12:08 +08:00
Include missing <string.h> and <limits.h>
Fix warnings. Update #2132. Update #2133.
This commit is contained in:
parent
34ff390b09
commit
666a56883a
@ -44,6 +44,9 @@
|
|||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
#include <sys/stdint.h> /* for people using printf mainly */
|
#include <sys/stdint.h> /* for people using printf mainly */
|
||||||
|
#ifdef __rtems__
|
||||||
|
#include <string.h>
|
||||||
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
__NULLABILITY_PRAGMA_PUSH
|
__NULLABILITY_PRAGMA_PUSH
|
||||||
|
|
||||||
|
@ -51,6 +51,8 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/kbio.h>
|
#include <sys/kbio.h>
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
#include <dev/kbd/kbdreg.h>
|
#include <dev/kbd/kbdreg.h>
|
||||||
|
|
||||||
#include <net80211/ieee80211_freebsd.h>
|
#include <net80211/ieee80211_freebsd.h>
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <dev/evdev/input.h>
|
#include <dev/evdev/input.h>
|
||||||
@ -293,7 +294,7 @@ check_device_type(char* device)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static void
|
||||||
scan_for_devices(void)
|
scan_for_devices(void)
|
||||||
{
|
{
|
||||||
int device_count;
|
int device_count;
|
||||||
@ -318,7 +319,7 @@ evdev_scan_task(rtems_task_argument arg)
|
|||||||
{
|
{
|
||||||
rtems_status_code sc;
|
rtems_status_code sc;
|
||||||
struct evdev_test_message msg;
|
struct evdev_test_message msg;
|
||||||
uint32_t size;
|
size_t size;
|
||||||
|
|
||||||
otask_active = true;
|
otask_active = true;
|
||||||
kill_otask = false;
|
kill_otask = false;
|
||||||
@ -350,7 +351,7 @@ evdev_keyboard_task(rtems_task_argument arg)
|
|||||||
struct input_event buffer[32];
|
struct input_event buffer[32];
|
||||||
rtems_status_code sc;
|
rtems_status_code sc;
|
||||||
struct evdev_test_message msg;
|
struct evdev_test_message msg;
|
||||||
uint32_t size;
|
size_t size;
|
||||||
|
|
||||||
ktask_active = true;
|
ktask_active = true;
|
||||||
kill_ktask = false;
|
kill_ktask = false;
|
||||||
@ -433,7 +434,7 @@ evdev_mouse_task(rtems_task_argument arg)
|
|||||||
struct input_event buffer[32];
|
struct input_event buffer[32];
|
||||||
rtems_status_code sc;
|
rtems_status_code sc;
|
||||||
struct evdev_test_message msg;
|
struct evdev_test_message msg;
|
||||||
uint32_t size;
|
size_t size;
|
||||||
|
|
||||||
mtask_active = true;
|
mtask_active = true;
|
||||||
kill_mtask = false;
|
kill_mtask = false;
|
||||||
@ -510,7 +511,7 @@ evdev_touch_task(rtems_task_argument arg)
|
|||||||
struct input_event buffer[32];
|
struct input_event buffer[32];
|
||||||
rtems_status_code sc;
|
rtems_status_code sc;
|
||||||
struct evdev_test_message msg;
|
struct evdev_test_message msg;
|
||||||
uint32_t size;
|
size_t size;
|
||||||
|
|
||||||
ttask_active = true;
|
ttask_active = true;
|
||||||
kill_ttask = false;
|
kill_ttask = false;
|
||||||
@ -648,16 +649,16 @@ Init(rtems_task_argument arg)
|
|||||||
);
|
);
|
||||||
assert(sc == RTEMS_SUCCESSFUL);
|
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);
|
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);
|
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);
|
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);
|
assert(sc == RTEMS_SUCCESSFUL);
|
||||||
|
|
||||||
sc = rtems_bsd_initialize();
|
sc = rtems_bsd_initialize();
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <rtems.h>
|
#include <rtems.h>
|
||||||
#include <rtems/ftpd.h>
|
#include <rtems/ftpd.h>
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <rtems/bdbuf.h>
|
#include <rtems/bdbuf.h>
|
||||||
#include <rtems/console.h>
|
#include <rtems/console.h>
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <rtems/telnetd.h>
|
#include <rtems/telnetd.h>
|
||||||
#include <rtems/ftpd.h>
|
#include <rtems/ftpd.h>
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
@ -1149,7 +1149,6 @@ static void
|
|||||||
test_pipe_close(test_context *ctx)
|
test_pipe_close(test_context *ctx)
|
||||||
{
|
{
|
||||||
int rfd = ctx->pfd[0];
|
int rfd = ctx->pfd[0];
|
||||||
int wfd = ctx->pfd[1];
|
|
||||||
struct pollfd pfd = {
|
struct pollfd pfd = {
|
||||||
.fd = rfd,
|
.fd = rfd,
|
||||||
.events = POLLIN
|
.events = POLLIN
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <rtems.h>
|
#include <rtems.h>
|
||||||
#include <rtems/shell.h>
|
#include <rtems/shell.h>
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include <sys/tty.h>
|
#include <sys/tty.h>
|
||||||
#include <sys/serial.h>
|
#include <sys/serial.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <string.h>
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
|
|
||||||
#include "../termios/test_termios_driver.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);
|
tty_makedev( tp, NULL, "%s", TERMIOS_TEST_DRIVER_TTY_PREFIX TERMIOS_TEST_DRIVER_TTY_UNIT);
|
||||||
assert(tp != NULL);
|
assert(tp != NULL);
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,10 @@
|
|||||||
#define TTYDEFCHARS
|
#define TTYDEFCHARS
|
||||||
#include <sys/ttydefaults.h>
|
#include <sys/ttydefaults.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
@ -576,8 +578,6 @@ static void
|
|||||||
test_main(void)
|
test_main(void)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
rtems_status_code sc;
|
|
||||||
rtems_device_major_number registered;
|
|
||||||
int test;
|
int test;
|
||||||
struct termios t;
|
struct termios t;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
@ -687,4 +687,4 @@ test_main(void)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <rtems/bsd/test/default-termios-init.h>
|
#include <rtems/bsd/test/default-termios-init.h>
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
@ -56,7 +57,8 @@ static void
|
|||||||
usb_serial_read_task(rtems_task_argument arg)
|
usb_serial_read_task(rtems_task_argument arg)
|
||||||
{
|
{
|
||||||
struct usb_test_message msg;
|
struct usb_test_message msg;
|
||||||
uint32_t size, end_time;
|
size_t size;
|
||||||
|
uint32_t end_time;
|
||||||
int bytes, index;
|
int bytes, index;
|
||||||
|
|
||||||
rtask_active = true;
|
rtask_active = true;
|
||||||
@ -90,7 +92,7 @@ static void
|
|||||||
usb_serial_write_task(rtems_task_argument arg)
|
usb_serial_write_task(rtems_task_argument arg)
|
||||||
{
|
{
|
||||||
struct usb_test_message msg;
|
struct usb_test_message msg;
|
||||||
uint32_t size;
|
size_t size;
|
||||||
int bytes, write_len, count = 0;
|
int bytes, write_len, count = 0;
|
||||||
|
|
||||||
wtask_active = true;
|
wtask_active = true;
|
||||||
@ -121,7 +123,7 @@ usb_serial_open_task(rtems_task_argument arg)
|
|||||||
rtems_status_code sc;
|
rtems_status_code sc;
|
||||||
struct usb_test_message msg;
|
struct usb_test_message msg;
|
||||||
struct termios t;
|
struct termios t;
|
||||||
uint32_t size;
|
size_t size;
|
||||||
int fd, iret;
|
int fd, iret;
|
||||||
|
|
||||||
fd = -2;
|
fd = -2;
|
||||||
@ -173,7 +175,6 @@ Init(rtems_task_argument arg)
|
|||||||
{
|
{
|
||||||
rtems_status_code sc;
|
rtems_status_code sc;
|
||||||
struct usb_test_message msg;
|
struct usb_test_message msg;
|
||||||
int ii;
|
|
||||||
|
|
||||||
(void) arg;
|
(void) arg;
|
||||||
puts("*** " TEST_NAME " TEST ***");
|
puts("*** " TEST_NAME " TEST ***");
|
||||||
@ -235,13 +236,13 @@ Init(rtems_task_argument arg)
|
|||||||
);
|
);
|
||||||
assert(sc == RTEMS_SUCCESSFUL);
|
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);
|
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);
|
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);
|
assert(sc == RTEMS_SUCCESSFUL);
|
||||||
|
|
||||||
sc = rtems_bsd_initialize();
|
sc = rtems_bsd_initialize();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user