kalle                                    Fri, 19 Nov 2010 16:03:00 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=305560

Log:
Kill some more constness warnings in com_dotnet/phar/standard

Changed paths:
    U   php/php-src/trunk/ext/com_dotnet/com_handlers.c
    U   php/php-src/trunk/ext/phar/phar_object.c
    U   php/php-src/trunk/ext/phar/util.c
    U   php/php-src/trunk/ext/standard/head.c
    U   php/php-src/trunk/ext/standard/string.c
    U   php/php-src/trunk/ext/standard/type.c
    U   php/php-src/trunk/ext/standard/var.c

Modified: php/php-src/trunk/ext/com_dotnet/com_handlers.c
===================================================================
--- php/php-src/trunk/ext/com_dotnet/com_handlers.c     2010-11-19 15:48:11 UTC 
(rev 305559)
+++ php/php-src/trunk/ext/com_dotnet/com_handlers.c     2010-11-19 16:03:00 UTC 
(rev 305560)
@@ -409,7 +409,7 @@

 #define POPULATE_CTOR(f, fn)   \
        f.type = ZEND_INTERNAL_FUNCTION; \
-       f.function_name = obj->ce->name; \
+       f.function_name = (char *) obj->ce->name; \
        f.scope = obj->ce; \
        f.arg_info = NULL; \
        f.num_args = 0; \

Modified: php/php-src/trunk/ext/phar/phar_object.c
===================================================================
--- php/php-src/trunk/ext/phar/phar_object.c    2010-11-19 15:48:11 UTC (rev 
305559)
+++ php/php-src/trunk/ext/phar/phar_object.c    2010-11-19 16:03:00 UTC (rev 
305560)
@@ -257,7 +257,8 @@

 static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, 
char *mime_type, int code, char *entry, int entry_len, char *arch, char 
*basename, char *ru, int ru_len TSRMLS_DC) /* {{{ */
 {
-       char *name = NULL, buf[8192], *cwd;
+       char *name = NULL, buf[8192];
+       const char *cwd;
        zend_syntax_highlighter_ini syntax_highlighter_ini;
        sapi_header_line ctr = {0};
        size_t got;
@@ -658,7 +659,8 @@
        zval *mimeoverride = NULL, *rewrite = NULL;
        char *alias = NULL, *error, *index_php = NULL, *f404 = NULL, *ru = NULL;
        int alias_len = 0, ret, f404_len = 0, free_pathinfo = 0, ru_len = 0;
-       char *fname, *basename, *path_info, *mime_type = NULL, *entry, *pt;
+       char *fname, *path_info, *mime_type = NULL, *entry, *pt;
+       const char *basename;
        int fname_len, entry_len, code, index_php_len = 0, not_cgi;
        phar_archive_data *phar = NULL;
        phar_entry_info *info;
@@ -934,7 +936,7 @@
        }

        if (mimeoverride && zend_hash_num_elements(Z_ARRVAL_P(mimeoverride))) {
-               char *ext = zend_memrchr(entry, '.', entry_len);
+               const char *ext = zend_memrchr(entry, '.', entry_len);
                zval **val;

                if (ext) {
@@ -2164,7 +2166,8 @@

 static zval *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool 
compress TSRMLS_DC) /* {{{ */
 {
-       char *oldname = NULL, *oldpath = NULL;
+       const char *oldname = NULL;
+       char *oldpath = NULL;
        char *basename = NULL, *basepath = NULL;
        char *newname = NULL, *newpath = NULL;
        zval *ret, arg1;
@@ -4204,7 +4207,8 @@
        php_stream_statbuf ssb;
        int len;
        php_stream *fp;
-       char *fullpath, *slash;
+       char *fullpath;
+       const char *slash;
        mode_t mode;

        if (entry->is_mounted) {

Modified: php/php-src/trunk/ext/phar/util.c
===================================================================
--- php/php-src/trunk/ext/phar/util.c   2010-11-19 15:48:11 UTC (rev 305559)
+++ php/php-src/trunk/ext/phar/util.c   2010-11-19 16:03:00 UTC (rev 305560)
@@ -2213,7 +2213,7 @@

 void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int 
filename_len TSRMLS_DC) /* {{{ */
 {
-       char *s;
+       const char *s;

        while ((s = zend_memrchr(filename, '/', filename_len))) {
                filename_len = s - filename;

Modified: php/php-src/trunk/ext/standard/head.c
===================================================================
--- php/php-src/trunk/ext/standard/head.c       2010-11-19 15:48:11 UTC (rev 
305559)
+++ php/php-src/trunk/ext/standard/head.c       2010-11-19 16:03:00 UTC (rev 
305560)
@@ -123,7 +123,7 @@
        } else {
                snprintf(cookie, len + 100, "Set-Cookie: %s=%s", name, value ? 
encoded_value : "");
                if (expires > 0) {
-                       char *p;
+                       const char *p;
                        strlcat(cookie, "; expires=", len + 100);
                        dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, 
d-M-Y H:i:s T")-1, expires, 0 TSRMLS_CC);
                        /* check to make sure that the year does not exceed 4 
digits in length */

Modified: php/php-src/trunk/ext/standard/string.c
===================================================================
--- php/php-src/trunk/ext/standard/string.c     2010-11-19 15:48:11 UTC (rev 
305559)
+++ php/php-src/trunk/ext/standard/string.c     2010-11-19 16:03:00 UTC (rev 
305560)
@@ -1489,7 +1489,7 @@
        }

        if ((opt & PHP_PATHINFO_EXTENSION) == PHP_PATHINFO_EXTENSION) {
-               char *p;
+               const char *p;
                int idx;

                if (!have_basename) {
@@ -1505,7 +1505,7 @@
        }

        if ((opt & PHP_PATHINFO_FILENAME) == PHP_PATHINFO_FILENAME) {
-               char *p;
+               const char *p;
                int idx;

                /* Have we alrady looked up the basename? */
@@ -2018,7 +2018,7 @@
 {
        zval *needle;
        char *haystack;
-       char *found = NULL;
+       const char *found = NULL;
        long found_offset;
        int  haystack_len;


Modified: php/php-src/trunk/ext/standard/type.c
===================================================================
--- php/php-src/trunk/ext/standard/type.c       2010-11-19 15:48:11 UTC (rev 
305559)
+++ php/php-src/trunk/ext/standard/type.c       2010-11-19 16:03:00 UTC (rev 
305560)
@@ -72,8 +72,8 @@

                case IS_RESOURCE:
                        {
-                               char *type_name;
-                               type_name = 
zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(arg) TSRMLS_CC);
+                               const char *type_name = 
zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(arg) TSRMLS_CC);
+
                                if (type_name) {
                                        RETVAL_STRING("resource", 1);
                                        break;
@@ -219,8 +219,7 @@
                        }
                }
                if (type == IS_RESOURCE) {
-                       char *type_name;
-                       type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(arg) 
TSRMLS_CC);
+                       const char *type_name = 
zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(arg) TSRMLS_CC);
                        if (!type_name) {
                                RETURN_FALSE;
                        }

Modified: php/php-src/trunk/ext/standard/var.c
===================================================================
--- php/php-src/trunk/ext/standard/var.c        2010-11-19 15:48:11 UTC (rev 
305559)
+++ php/php-src/trunk/ext/standard/var.c        2010-11-19 16:03:00 UTC (rev 
305560)
@@ -156,9 +156,7 @@
                PUTS("}\n");
                break;
        case IS_RESOURCE: {
-               char *type_name;
-
-               type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) 
TSRMLS_CC);
+               const char *type_name = 
zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
                php_printf("%sresource(%ld) of type (%s)\n", COMMON, 
Z_LVAL_PP(struc), type_name ? type_name : "Unknown");
                break;
        }
@@ -306,9 +304,7 @@
                PUTS("}\n");
                break;
        case IS_RESOURCE: {
-               char *type_name;
-
-               type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) 
TSRMLS_CC);
+               const char *type_name = 
zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
                php_printf("%sresource(%ld) of type (%s) refcount(%u)\n", 
COMMON, Z_LVAL_PP(struc), type_name ? type_name : "Unknown", 
Z_REFCOUNT_PP(struc));
                break;
        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to