diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-23 14:32:34 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-23 14:32:34 +0000 |
commit | 48751ab095bbbb23489c2e3243f57571cbfa9153 (patch) | |
tree | 7a15647c01c3acdb2d1c61142bb13616ad03a2aa /cpukit/libmisc/shell/main_mmove.c | |
parent | 2009-07-23 Santosh G Vattam <vattam.santosh@gmail.com> (diff) | |
download | rtems-48751ab095bbbb23489c2e3243f57571cbfa9153.tar.bz2 |
2009-07-23 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/Makefile.am, libmisc/shell/main_chmod.c,
libmisc/shell/main_mdump.c, libmisc/shell/main_medit.c,
libmisc/shell/main_mfill.c, libmisc/shell/main_mmove.c,
libmisc/shell/main_msdosfmt.c, libmisc/shell/main_mwdump.c,
libmisc/shell/main_sleep.c, libmisc/shell/main_umask.c,
libmisc/shell/shell_script.c, libmisc/stringto/stringto.h,
libmisc/stringto/stringto_template.h: Convert return type from bool
to rtems_status_code and add rtems_string_to_pointer. Perform
associated clean up and changes for return type change.
* libmisc/stringto/stringtopointer.c: New file.
Diffstat (limited to 'cpukit/libmisc/shell/main_mmove.c')
-rw-r--r-- | cpukit/libmisc/shell/main_mmove.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/cpukit/libmisc/shell/main_mmove.c b/cpukit/libmisc/shell/main_mmove.c index f68f4a2ab6..30c6629547 100644 --- a/cpukit/libmisc/shell/main_mmove.c +++ b/cpukit/libmisc/shell/main_mmove.c @@ -32,10 +32,10 @@ int rtems_shell_main_mmove( char *argv[] ) { - unsigned long tmp; - uintptr_t src; - uintptr_t dst; - size_t length; + unsigned long tmp; + void *src; + void *dst; + size_t length; if ( argc < 4 ) { fprintf(stderr,"%s: too few arguments\n", argv[0]); @@ -45,19 +45,17 @@ int rtems_shell_main_mmove( /* * Convert arguments into numbers */ - if ( !rtems_string_to_unsigned_long(argv[1], &tmp, NULL, 0) ) { + if ( rtems_string_to_pointer(argv[1], &dst, NULL) ) { printf( "Destination argument (%s) is not a number\n", argv[1] ); return -1; } - dst = (uintptr_t) tmp; - if ( !rtems_string_to_unsigned_long(argv[2], &tmp, NULL, 0) ) { + if ( rtems_string_to_pointer(argv[2], &src, NULL) ) { printf( "Source argument (%s) is not a number\n", argv[2] ); return -1; } - src = (uintptr_t) tmp; - if ( !rtems_string_to_unsigned_long(argv[3], &tmp, NULL, 0) ) { + if ( rtems_string_to_unsigned_long(argv[3], &tmp, NULL, 0) ) { printf( "Length argument (%s) is not a number\n", argv[3] ); return -1; } @@ -66,7 +64,7 @@ int rtems_shell_main_mmove( /* * Now copy the memory. */ - memcpy((unsigned char*)dst, (unsigned char*)src, length); + memcpy(dst, src, length); return 0; } |