Mercurial > ecos
changeset 2056:49468ab5b6f7
* tests/socket.c (SHOW_RESULT): Add a cast to avoid compiler
warnings about the format string not matching the parameters.
* tests/testfs.c: rename strcmp and strcpy to mystrcmp and
mystrcpy to avoid clashes with the normal implementations.
| author | asl |
|---|---|
| date | Wed, 03 Aug 2005 21:05:16 +0000 |
| parents | fc88957d075c |
| children | c361afcb9db3 |
| files | packages/io/fileio/current/ChangeLog packages/io/fileio/current/tests/socket.c packages/io/fileio/current/tests/testfs.c |
| diffstat | 3 files changed, 16 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/io/fileio/current/ChangeLog +++ b/packages/io/fileio/current/ChangeLog @@ -1,3 +1,10 @@ +2005-08-02 Andrew Lunn <andrew.lunn@ascom.ch> + + * tests/socket.c (SHOW_RESULT): Add a cast to avoid compiler + warnings about the format string not matching the parameters. + * tests/testfs.c: rename strcmp and strcpy to mystrcmp and + mystrcpy to avoid clashes with the normal implementations. + 2005-05-13 Peter Korsgaard <jacmet@sunsite.dk> * src/devfs.cxx (dev_stat, dev_fo_fstat): Corrected mode for block
--- a/packages/io/fileio/current/tests/socket.c +++ b/packages/io/fileio/current/tests/socket.c @@ -101,7 +101,7 @@ //-------------------------------------------------------------------------- #define SHOW_RESULT( _fn, _res ) \ -diag_printf(#_fn " returned %d %s\n", _res, _res<0?strerror(errno):""); +diag_printf(#_fn " returned %d %s\n", (int) _res, _res<0?strerror(errno):""); //-------------------------------------------------------------------------- // Thread stack.
--- a/packages/io/fileio/current/tests/testfs.c +++ b/packages/io/fileio/current/tests/testfs.c @@ -257,7 +257,7 @@ static cyg_fileops testfs_dirops = // ------------------------------------------------------------------------- // Local strcmp() and strcpy() -static int strcmp( const char *s1, const char *s2 ) +static int mystrcmp( const char *s1, const char *s2 ) { while( *s1 == *s2 && *s1 != '\0' && *s2 != '\0' ) s1++, s2++; @@ -265,7 +265,7 @@ static int strcmp( const char *s1, const return (*s2)-(*s1); } -static char *strcpy( char *s1, const char *s2 ) +static char *mystrcpy( char *s1, const char *s2 ) { char *s = s1; while( (*s1++ = *s2++) != 0); @@ -325,7 +325,7 @@ static int testfs_find( testfs_node *dir if( n == NULL ) continue; - if( strcmp( name, n->name ) == 0 ) + if( mystrcmp( name, n->name ) == 0 ) { nd1 = n; break; @@ -448,7 +448,7 @@ static int testfs_mount ( cyg_fstab_e root->next = root; // form circular list root->parent = root; // I'm my own parent! root->refcnt = 1; // don't want to ever lose root - strcpy( root->name, "root"); + mystrcpy( root->name, "root"); root->status.st_mode = __stat_mode_DIR; root->status.st_ino = root-&node[0]; root->status.st_dev = 0; @@ -529,7 +529,7 @@ static int testfs_open ( cyg_mtab_en // Fill in details nd->parent = parent; nd->refcnt = 1; // 1 for directory reference - strcpy( nd->name, name); + mystrcpy( nd->name, name); nd->status.st_mode = __stat_mode_REG; nd->status.st_ino = nd-&node[0]; nd->status.st_dev = 0; @@ -647,7 +647,7 @@ static int testfs_mkdir ( cyg_mtab_en // Fill in details nd->parent = parent; nd->refcnt = 1; // 1 for directory reference - strcpy( nd->name, name); + mystrcpy( nd->name, name); nd->status.st_mode = __stat_mode_DIR; nd->status.st_ino = nd-&node[0]; nd->status.st_dev = 0; @@ -762,7 +762,7 @@ static int testfs_rename ( cyg_mtab_en nd1->parent = parent2; // And give it a new name. - strcpy( nd1->name, name2 ); + mystrcpy( nd1->name, name2 ); return err; } @@ -1121,7 +1121,7 @@ static int testfs_fo_dirread (struc if( nd->u.dir.nodes[pos] != NULL ) { struct dirent *ent = (struct dirent *)buf; - strcpy( ent->d_name, nd->u.dir.nodes[pos]->name ); + mystrcpy( ent->d_name, nd->u.dir.nodes[pos]->name ); uio->uio_resid -= sizeof(struct dirent); break; }
