Index: ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/io/serial/current/ChangeLog,v retrieving revision 1.65 diff -u -r1.65 ChangeLog --- ChangeLog 30 Jul 2005 11:52:40 -0000 1.65 +++ ChangeLog 3 Aug 2005 21:00:06 -0000 @@ -3,7 +3,9 @@ * src/common/tty.c (tty_write): * src/common/haldiag.c (haldiag_getc): Fixed pointer signness to avoid compiler warnings. - + * tests/*.c msglen should by an unsigned int to avoid compiler + warnings. + 2005-07-21 Andrew Lunn * src/common/termiostty.c: Removed errbuf from priv. It was never Index: tests/ser_test_protocol.inl =================================================================== RCS file: /cvs/ecos/ecos/packages/io/serial/current/tests/ser_test_protocol.inl,v retrieving revision 1.30 diff -u -r1.30 ser_test_protocol.inl --- tests/ser_test_protocol.inl 23 May 2002 23:06:28 -0000 1.30 +++ tests/ser_test_protocol.inl 3 Aug 2005 21:00:08 -0000 @@ -144,12 +144,12 @@ #define TEST_CRASH(__h, __code, __msg, args...) \ CYG_MACRO_START \ - int __len = 1; \ + cyg_uint32 __len = 1; \ /* Try to flush remaining input */ \ cyg_thread_delay(50); \ cyg_io_get_config(__h, CYG_IO_GET_CONFIG_SERIAL_INPUT_FLUSH, \ 0, &__len); \ - diag_printf("FAILCODE:<" TEST_CRASH_ID ":%04x:" __code, ## args); \ + diag_printf("FAILCODE:<" TEST_CRASH_ID ":%04x:" __code, ## args); \ diag_printf("!>\n"); \ CYG_FAIL(__msg); \ hang(); \ @@ -189,7 +189,7 @@ #endif cyg_uint8 in_buffer[IN_BUFFER_SIZE]; -cyg_int8 cmd_buffer[128]; +char cmd_buffer[128]; //---------------------------------------------------------------------------- // Some types specific to the testing protocol. @@ -368,7 +368,7 @@ do_abort(void *handle) { cyg_io_handle_t io_handle = (cyg_io_handle_t)handle; - cyg_int32 len = 1; // Need something here + cyg_uint32 len = 1; // Need something here cyg_io_get_config(io_handle, CYG_IO_GET_CONFIG_SERIAL_ABORT, 0, &len); aborted = 1; } @@ -505,9 +505,10 @@ cyg_serial_info_t old_cfg, new_cfg; const char cmd[] = "@CONFIG:"; char reply[2]; - int msglen; - int res, len; - cyg_uint8 *p1; + cyg_uint32 msglen; + int res; + cyg_uint32 len; + char *p1; // Prepare the command. p1 = &cmd_buffer[0]; @@ -525,7 +526,7 @@ *p1 = 0; // note: we may append to this later // Tell user what we're up to. - CYG_TEST_INFO(&cmd_buffer[1]); + CYG_TEST_INFO((char *)&cmd_buffer[1]); // Change to new config and then back to determine if the driver likes it. len = sizeof(old_cfg); @@ -610,7 +611,7 @@ int change_succeeded = 0; int using_old_config = 0; char in_buf[1]; - int len; + cyg_uint32 len; int saw_host_sync; for (;;) { @@ -637,7 +638,7 @@ } else if ('S' == in_buf[0] && !saw_host_sync) { // In sync - reply to host if we haven't already char ok_msg[2] = "OK"; - int ok_len = 2; + cyg_uint32 ok_len = 2; Tcyg_io_write(handle, ok_msg, &ok_len); saw_host_sync = 1; } else if ('D' == in_buf[0] && saw_host_sync) { @@ -683,7 +684,8 @@ int read_host_crc(cyg_io_handle_t handle) { - int crc, len; + int crc; + cyg_uint32 len; cyg_uint8 ch; crc = 0; @@ -744,10 +746,10 @@ test_binary(cyg_io_handle_t handle, int size, cyg_mode_t mode) { const char cmd[] = "@BINARY:"; - int msglen; + cyg_uint32 msglen; cyg_uint32 xcrc; int icrc, host_crc; - cyg_uint8 *p1; + char *p1; cyg_int8 host_status = 'O'; // host is happy by default // Verify that the test can be run with available ressources. @@ -777,7 +779,8 @@ case MODE_NO_ECHO: { // Break transfers into chunks no larger than the buffer size. - int tx_len, chunk_len, i; + int tx_len, i; + cyg_uint32 chunk_len; while (size > 0) { chunk_len = min(IN_BUFFER_SIZE, size); tx_len = chunk_len; @@ -803,7 +806,8 @@ case MODE_EOP_ECHO: { // We have already checked that the in buffer is large enough. - int i, tx_len, chunk_len; + int i, tx_len; + cyg_uint32 chunk_len; chunk_len = tx_len = size; Tcyg_io_read(handle, &in_buffer[0], &chunk_len); @@ -831,7 +835,7 @@ break; case MODE_DUPLEX_ECHO: { - int chunk_len; + cyg_uint32 chunk_len; int block_size = 64; // This is a simple implementation (maybe too simple). @@ -953,7 +957,7 @@ { char msg[] = "@PING:" TEST_CRASH_ID "!"; char msg2[] = "\n"; - int msglen = strlen(msg); + cyg_uint32 msglen = strlen(msg); int res; msglen = strlen(msg); @@ -985,8 +989,8 @@ test_options(cyg_io_handle_t handle, int count, cyg_uint32* options) { const char cmd[] = "@OPT:"; - int msglen; - cyg_uint8 *p1; + cyg_uint32 msglen; + char *p1; // Prepare and send the command. p1 = &cmd_buffer[0]; Index: tests/serial1.c =================================================================== RCS file: /cvs/ecos/ecos/packages/io/serial/current/tests/serial1.c,v retrieving revision 1.7 diff -u -r1.7 serial1.c --- tests/serial1.c 23 May 2002 23:06:29 -0000 1.7 +++ tests/serial1.c 3 Aug 2005 21:00:08 -0000 @@ -76,7 +76,8 @@ serial_api_test(int dummy) { cyg_io_handle_t handle; - int res, len; + int res; + cyg_uint32 len; unsigned char buffer[16]; // Always return... Index: tests/serial2.c =================================================================== RCS file: /cvs/ecos/ecos/packages/io/serial/current/tests/serial2.c,v retrieving revision 1.6 diff -u -r1.6 serial2.c --- tests/serial2.c 23 May 2002 23:06:29 -0000 1.6 +++ tests/serial2.c 3 Aug 2005 21:00:08 -0000 @@ -74,7 +74,7 @@ { char test_msg1[]="This is a test message!\n"; char test_msg2[]="$O5468697320697320612074657374206d657373616765210d0a#12"; - int msglen; + cyg_uint32 msglen; cyg_io_handle_t ser_handle; test_open_ser(&ser_handle); Index: tests/serial4.c =================================================================== RCS file: /cvs/ecos/ecos/packages/io/serial/current/tests/serial4.c,v retrieving revision 1.7 diff -u -r1.7 serial4.c --- tests/serial4.c 23 May 2002 23:06:29 -0000 1.7 +++ tests/serial4.c 3 Aug 2005 21:00:08 -0000 @@ -92,7 +92,7 @@ int i; int count = sizeof(test_configs) / sizeof(cyg_ser_cfg_t); char msg[] = "This is a test\n"; - int msglen = strlen(msg); + cyg_uint32 msglen = strlen(msg); for (i = 0; i < count; i++){ if (ENOERR == change_config(ser_handle, &test_configs[i])) { Index: tests/tty1.c =================================================================== RCS file: /cvs/ecos/ecos/packages/io/serial/current/tests/tty1.c,v retrieving revision 1.6 diff -u -r1.6 tty1.c --- tests/tty1.c 23 May 2002 23:06:29 -0000 1.6 +++ tests/tty1.c 3 Aug 2005 21:00:08 -0000 @@ -75,7 +75,8 @@ void tty_api_test(cyg_io_handle_t* handle) { - int res, len; + int res; + cyg_uint32 len; unsigned char buffer[16]; // Always return... Index: tests/tty2.c =================================================================== RCS file: /cvs/ecos/ecos/packages/io/serial/current/tests/tty2.c,v retrieving revision 1.6 diff -u -r1.6 tty2.c --- tests/tty2.c 23 May 2002 23:06:30 -0000 1.6 +++ tests/tty2.c 3 Aug 2005 21:00:08 -0000 @@ -75,7 +75,7 @@ { char test_msg1[]="This is a test message!\n"; char test_msg2[]="$O5468697320697320612074657374206d657373616765210d0a#12"; - int msglen; + cyg_uint32 msglen; cyg_io_handle_t tty_handle; test_open_tty(&tty_handle);