lib stringc cleanup restore useful memmove const
Subsystems (2)
PATCH 1/1 lib stringc cleanup restore useful memmove const
A couple of (char *) casts removed in a previous cleanup patch in lib/string.c:memmove() were actually useful, as they suppressed a couple of warnings:
assignment discards qualifiers from pointer target type
Fix by declaring the local variable const in the first place, so casts aren't needed to strip the const qualifier.
---
lib/string.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-)
lib/string.c +2 -1
@@ -488,7 +488,8 @@ EXPORT_SYMBOL(memcpy);*/ void *memmove (void *dest,const void *src,size_t count) { -char *tmp, *s; +char *tmp; +const char *s;if (dest <= src) { tmp = dest;
Signature · 3 lines
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.650.933.1373Quoted 4 lines · Paul Jackson
A couple of (char *) casts removed in a previous cleanup patch in lib/string.c:memmove() were actually useful, as they suppressed a couple of warnings:
Hmm, you are right, I shouldn't have missed that, my bad.
Quoted 5 lines
assignment discards qualifiers from pointer target type
Fix by declaring the local variable const in the first place, so casts aren't needed to strip the const qualifier.
Looks good to me, thank you for fixing that up.
Quoted 1 line
Signed-off-by Paul Jackson <[email protected]>
--
Jesper Juhl <[email protected]>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html