63
63
#define PHP_ICONV_IMPL_VALUE "unknown"
64
64
#endif
65
65
66
- static char * get_iconv_version (void ) {
67
- char * version = "unknown" ;
66
+ static const char * get_iconv_version (void ) {
67
+ const char * version = "unknown" ;
68
68
69
69
#ifdef HAVE_LIBICONV
70
70
static char buf [16 ];
71
71
snprintf (buf , sizeof (buf ), "%d.%d" , _libiconv_version >> 8 , _libiconv_version & 0xff );
72
72
version = buf ;
73
73
#elif defined(HAVE_GLIBC_ICONV )
74
- version = ( char * ) gnu_get_libc_version ();
74
+ version = gnu_get_libc_version ();
75
75
#endif
76
76
77
77
return version ;
@@ -243,7 +243,7 @@ PHP_MSHUTDOWN_FUNCTION(miconv)
243
243
/* {{{ PHP_MINFO_FUNCTION */
244
244
PHP_MINFO_FUNCTION (miconv )
245
245
{
246
- zval * iconv_impl , * iconv_ver ;
246
+ const zval * iconv_impl , * iconv_ver ;
247
247
248
248
iconv_impl = zend_get_constant_str ("ICONV_IMPL" , sizeof ("ICONV_IMPL" )- 1 );
249
249
iconv_ver = zend_get_constant_str ("ICONV_VERSION" , sizeof ("ICONV_VERSION" )- 1 );
@@ -308,7 +308,7 @@ static zend_result php_iconv_output_handler(void **nothing, php_output_context *
308
308
309
309
int mimetype_len = 0 ;
310
310
if (SG (sapi_headers ).mimetype && !strncasecmp (SG (sapi_headers ).mimetype , "text/" , 5 )) {
311
- char * s = strchr (SG (sapi_headers ).mimetype ,';' );
311
+ const char * s = strchr (SG (sapi_headers ).mimetype ,';' );
312
312
if (s == NULL ){
313
313
mimetype = SG (sapi_headers ).mimetype ;
314
314
} else {
@@ -321,7 +321,7 @@ static zend_result php_iconv_output_handler(void **nothing, php_output_context *
321
321
322
322
if (mimetype != NULL && (!(output_context -> op & PHP_OUTPUT_HANDLER_CLEAN ) || ((output_context -> op & PHP_OUTPUT_HANDLER_START ) && !(output_context -> op & PHP_OUTPUT_HANDLER_FINAL )))) {
323
323
size_t len ;
324
- char * p = strstr (get_output_encoding (), "//" );
324
+ const char * p = strstr (get_output_encoding (), "//" );
325
325
326
326
if (p ) {
327
327
len = spprintf (& content_type , 0 , "Content-Type:%.*s; charset=%.*s" , mimetype_len ? mimetype_len : (int ) strlen (mimetype ), mimetype , (int ) (p - get_output_encoding ()), get_output_encoding ());
@@ -2577,7 +2577,7 @@ static php_stream_filter *php_iconv_stream_filter_factory_create(const char *nam
2577
2577
{
2578
2578
php_stream_filter * retval = NULL ;
2579
2579
php_iconv_stream_filter * inst ;
2580
- char * from_charset = NULL , * to_charset = NULL ;
2580
+ const char * from_charset = NULL , * to_charset = NULL ;
2581
2581
size_t from_charset_len , to_charset_len ;
2582
2582
2583
2583
if ((from_charset = strchr (name , '.' )) == NULL ) {
0 commit comments