From e27a6872a6331dd662c13a537c9886c25f70e563 Mon Sep 17 00:00:00 2001 From: Martin Baute Date: Tue, 1 Mar 2016 08:56:11 +0100 Subject: [PATCH] Compiler warnings regarding const > non-const assignments. Fixed. --- functions/string/strcoll.c | 2 +- functions/string/strxfrm.c | 2 +- opt/basecodecs/_PDCLIB_utf8.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/functions/string/strcoll.c b/functions/string/strcoll.c index b6a4cd6..ebe9a45 100644 --- a/functions/string/strcoll.c +++ b/functions/string/strcoll.c @@ -14,7 +14,7 @@ int strcoll( const char * s1, const char * s2 ) { - _PDCLIB_ctype_t * ctype = _PDCLIB_threadlocale()->_CType; + const _PDCLIB_ctype_t * ctype = _PDCLIB_threadlocale()->_CType; while ( ( *s1 ) && ( ctype[(unsigned char)*s1].collation == ctype[(unsigned char)*s2].collation ) ) { diff --git a/functions/string/strxfrm.c b/functions/string/strxfrm.c index 3ea8d0f..db3ad48 100644 --- a/functions/string/strxfrm.c +++ b/functions/string/strxfrm.c @@ -14,7 +14,7 @@ size_t strxfrm( char * _PDCLIB_restrict s1, const char * _PDCLIB_restrict s2, size_t n ) { - _PDCLIB_ctype_t *ctype = _PDCLIB_threadlocale()->_CType; + const _PDCLIB_ctype_t *ctype = _PDCLIB_threadlocale()->_CType; size_t len = strlen( s2 ); if ( len < n ) { diff --git a/opt/basecodecs/_PDCLIB_utf8.c b/opt/basecodecs/_PDCLIB_utf8.c index 22fa808..7966d88 100644 --- a/opt/basecodecs/_PDCLIB_utf8.c +++ b/opt/basecodecs/_PDCLIB_utf8.c @@ -254,11 +254,11 @@ int main( void ) char32_t c32out[8]; - char32_t *c32ptr = &c32out[0]; - size_t c32rem = 8; - char *chrptr = (char*) &input[0]; - size_t chrrem = strlen(input); - mbstate_t mbs = { 0 }; + char32_t *c32ptr = &c32out[0]; + size_t c32rem = 8; + const char *chrptr = (char*) &input[0]; + size_t chrrem = strlen(input); + mbstate_t mbs = { 0 }; TESTCASE(utf8toc32(&c32ptr, &c32rem, &chrptr, &chrrem, &mbs)); TESTCASE(c32rem == 0); -- 2.40.0