cvs: pecl /phar dirstream.c func_interceptors.c phar.c phar_internal.h phar_object.c tar.c util.c zip.c
| From: | Greg Beaver | Date: | Sat, 22 Mar 2008 22:11:48 +0000 |
| Subject: | cvs: pecl /phar dirstream.c func_interceptors.c phar.c phar_internal.h phar_object.c tar.c util.c zip.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-10020@lists.php.net to get a copy of this message | ||
cellog Sat Mar 22 22:11:48 2008 UTC
Modified files:
/pecl/phar dirstream.c func_interceptors.c phar.c phar_internal.h
phar_object.c tar.c util.c zip.c
Log:
move all blah++ to ++blah where possible for those with crapass compilers
http://cvs.php.net/viewvc.cgi/pecl/phar/dirstream.c?r1=1.11&r2=1.12&diff_format=u Index: pecl/phar/dirstream.c diff -u pecl/phar/dirstream.c:1.11 pecl/phar/dirstream.c:1.12 --- pecl/phar/dirstream.c:1.11 Sun Feb 24 22:29:05 2008 +++ pecl/phar/dirstream.c Sat Mar 22 22:11:48 2008 @@ -79,7 +79,7 @@ } else { *newoffset = 0; while (*newoffset < offset && zend_hash_move_forward(data) == SUCCESS) { - (*newoffset)++; + ++(*newoffset); } return 0; } http://cvs.php.net/viewvc.cgi/pecl/phar/func_interceptors.c?r1=1.8&r2=1.9&diff_format=u Index: pecl/phar/func_interceptors.c diff -u pecl/phar/func_interceptors.c:1.8 pecl/phar/func_interceptors.c:1.9 --- pecl/phar/func_interceptors.c:1.8 Thu Mar 20 23:59:06 2008 +++ pecl/phar/func_interceptors.c Sat Mar 22 22:11:48 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: func_interceptors.c,v 1.8 2008/03/20 23:59:06 cellog Exp $ */ +/* $Id: func_interceptors.c,v 1.9 2008/03/22 22:11:48 cellog Exp $ */ #include "phar_internal.h" @@ -337,7 +337,7 @@ if(groups > 0) { gids=(gid_t *)safe_emalloc(groups, sizeof(gid_t), 0); n=getgroups(groups, gids); - for(i=0;i<n;i++){ + for(i=0;i<n;++i){ if(stat_sb->st_gid==gids[i]) { rmask=S_IRGRP; wmask=S_IWGRP; http://cvs.php.net/viewvc.cgi/pecl/phar/phar.c?r1=1.318&r2=1.319&diff_format=u Index: pecl/phar/phar.c diff -u pecl/phar/phar.c:1.318 pecl/phar/phar.c:1.319 --- pecl/phar/phar.c:1.318 Sat Mar 22 21:54:54 2008 +++ pecl/phar/phar.c Sat Mar 22 22:11:48 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: phar.c,v 1.318 2008/03/22 21:54:54 cellog Exp $ */ +/* $Id: phar.c,v 1.319 2008/03/22 22:11:48 cellog Exp $ */ #define PHAR_MAIN 1 #include "phar_internal.h" @@ -141,7 +141,7 @@ if (val) { *val++ = '\0'; - for (q = key; *q; q++) { + for (q = key; *q; ++q) { *q = tolower(*q); } if (sapi_module.phpinfo_as_text) { @@ -554,10 +554,10 @@ if (EOF == (nextchar = php_stream_getc(fp)) || (char)nextchar != '\n') { MAPPHAR_ALLOC_FAIL("internal corruption of phar \"%s\" (truncated manifest at stub end)") } - halt_offset++; + ++halt_offset; } if ((char) nextchar == '\n') { - halt_offset++; + ++halt_offset; } } /* make sure we are at the right location to read the manifest */ @@ -862,7 +862,7 @@ entry.phar = mydata; entry.fp_type = PHAR_FP; - for (manifest_index = 0; manifest_index < manifest_count; manifest_index++) { + for (manifest_index = 0; manifest_index < manifest_count; ++manifest_index) { if (buffer + 4 > endbuffer) { MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)") } @@ -1436,7 +1436,7 @@ if (*delim == ch) { return 1; } - delim++; + ++delim; } return 0; } @@ -1450,7 +1450,7 @@ } while (*s && in_character_class(*s, delim)) { - s++; + ++s; } if (!*s) { return NULL; @@ -1459,7 +1459,7 @@ token = s; while (*s && !in_character_class(*s, delim)) { - s++; + ++s; } if (!*s) { *last = s; @@ -1540,8 +1540,7 @@ if (new_phar_len == 0) { new_phar = (char *) erealloc(new_phar, new_phar_len+1+1); new_phar[new_phar_len] = '/'; - new_phar[new_phar_len+1] = '\0'; - new_phar_len++; + new_phar[++new_phar_len] = '\0'; } *new_len = new_phar_len; return new_phar; @@ -2042,7 +2041,7 @@ } newcrc32 = ~0; mytime = entry->uncompressed_filesize; - for (loc = 0;loc < mytime; loc++) { + for (loc = 0;loc < mytime; ++loc) { CRC32(newcrc32, php_stream_getc(file)); } entry->crc32 = ~newcrc32; @@ -2828,7 +2827,7 @@ php_info_print_table_header(2, "Phar: PHP Archive support", "enabled"); php_info_print_table_row(2, "Phar EXT version", PHP_PHAR_VERSION); php_info_print_table_row(2, "Phar API version", PHP_PHAR_API_VERSION); - php_info_print_table_row(2, "CVS revision", "$Revision: 1.318 $"); + php_info_print_table_row(2, "CVS revision", "$Revision: 1.319 $"); php_info_print_table_row(2, "Phar-based phar archives", "enabled"); php_info_print_table_row(2, "Tar-based phar archives", "enabled"); php_info_print_table_row(2, "ZIP-based phar archives", "enabled"); http://cvs.php.net/viewvc.cgi/pecl/phar/phar_internal.h?r1=1.95&r2=1.96&diff_format=u Index: pecl/phar/phar_internal.h diff -u pecl/phar/phar_internal.h:1.95 pecl/phar/phar_internal.h:1.96 --- pecl/phar/phar_internal.h:1.95 Sat Mar 22 21:54:14 2008 +++ pecl/phar/phar_internal.h Sat Mar 22 22:11:48 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: phar_internal.h,v 1.95 2008/03/22 21:54:14 sfox Exp $ */ +/* $Id: phar_internal.h,v 1.96 2008/03/22 22:11:48 cellog Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -354,7 +354,7 @@ char *s; /* unixify win paths */ - for (s = path; s - path < path_len; s++) { + for (s = path; s - path < path_len; ++s) { if (*s == '\\') { *s = '/'; } http://cvs.php.net/viewvc.cgi/pecl/phar/phar_object.c?r1=1.185&r2=1.186&diff_format=u Index: pecl/phar/phar_object.c diff -u pecl/phar/phar_object.c:1.185 pecl/phar/phar_object.c:1.186 --- pecl/phar/phar_object.c:1.185 Sat Mar 22 22:04:20 2008 +++ pecl/phar/phar_object.c Sat Mar 22 22:11:48 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: phar_object.c,v 1.185 2008/03/22 22:04:20 cellog Exp $ */ +/* $Id: phar_object.c,v 1.186 2008/03/22 22:11:48 cellog Exp $ */ #include "phar_internal.h" #include "func_interceptors.h" @@ -66,7 +66,7 @@ /* no file extension = assume text/plain */ return PHAR_MIME_OTHER; } - ext++; + ++ext; if (SUCCESS != zend_hash_find(mimes, ext, strlen(ext), (void **) &mime)) { *mime_type = "application/octet-stream"; return PHAR_MIME_OTHER; @@ -392,7 +392,7 @@ if (u) { u[0] = '/'; *ru = estrndup(u, u_len+1); - u_len++; + ++u_len; u[0] = '\0'; } else { *ru = NULL; @@ -534,7 +534,7 @@ if (!basename) { basename = fname; } else { - basename++; + ++basename; } if ((strlen(sapi_module.name) == sizeof("cgi-fcgi")-1 && !strncmp(sapi_module.name, "cgi-fcgi", sizeof("cgi-fcgi")-1)) @@ -598,7 +598,7 @@ fci.param_count = 1; fci.params = zp; #if PHP_VERSION_ID < 50300 - params->refcount++; + ++(params->refcount); #else Z_ADDREF_P(params); #endif @@ -657,7 +657,7 @@ entry_len = index_php_len; if (entry[0] != '/') { spprintf(&entry, 0, "/%s", index_php); - entry_len++; + ++entry_len; } } else { /* assume "index.php" is starting point */ @@ -1094,7 +1094,7 @@ { phar_archive_data *phar_data = (phar_archive_data *) dst->oth; - phar_data->refcount++; + ++(phar_data->refcount); } /* }}} */ @@ -1179,7 +1179,7 @@ } is_data = phar_data->is_data; - phar_data->refcount++; + ++(phar_data->refcount); phar_obj->arc.archive = phar_data; phar_obj->spl.oth_handler = &phar_spl_foreign_handler; http://cvs.php.net/viewvc.cgi/pecl/phar/tar.c?r1=1.36&r2=1.37&diff_format=u Index: pecl/phar/tar.c diff -u pecl/phar/tar.c:1.36 pecl/phar/tar.c:1.37 --- pecl/phar/tar.c:1.36 Mon Mar 3 08:41:14 2008 +++ pecl/phar/tar.c Sat Mar 22 22:11:48 2008 @@ -25,13 +25,13 @@ int i = 0; while (i < len && buf[i] == ' ') { - i++; + ++i; } while (i < len && buf[i] >= '0' && buf[i] <= '7') { num = num * 8 + (buf[i] - '0'); - i++; + ++i; } return num; } @@ -91,7 +91,7 @@ while (buf != end) { sum += (unsigned char)*buf; - buf++; + ++buf; } return sum; } http://cvs.php.net/viewvc.cgi/pecl/phar/util.c?r1=1.30&r2=1.31&diff_format=u Index: pecl/phar/util.c diff -u pecl/phar/util.c:1.30 pecl/phar/util.c:1.31 --- pecl/phar/util.c:1.30 Sat Mar 22 21:54:54 2008 +++ pecl/phar/util.c Sat Mar 22 22:11:48 2008 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: util.c,v 1.30 2008/03/22 21:54:54 cellog Exp $ */ +/* $Id: util.c,v 1.31 2008/03/22 22:11:48 cellog Exp $ */ #include "phar_internal.h" #if !defined(PHP_VERSION_ID) || PHP_VERSION_ID < 50300 @@ -137,12 +137,12 @@ } if (ext[0] == '.') { - ext++; + ++ext; } oldpath = estrndup(phar->fname, phar->fname_len); oldname = strrchr(phar->fname, '/'); - oldname++; + ++oldname; basename = estrndup(oldname, strlen(oldname)); spprintf(&newname, 0, "%s.%s", strtok(basename, "."), ext); @@ -361,7 +361,7 @@ } } /* test for stream wrappers and return */ - for (p = filename; p - filename < filename_len && (isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'); p++, n++); + for (p = filename; p - filename < filename_len && (isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'); ++p, ++n); if (n < filename_len - 3 && (*p == ':') && (!strncmp("//", p+1, 2) || ( filename_len > 4 && !memcmp("data", filename, 4)))) { /* found stream wrapper, this is an absolute path until stream wrappers implement realpath */ return estrndup(filename, filename_len); @@ -378,7 +378,7 @@ maybe_stream = 0; goto not_stream; } - for (p = ptr, n = 0; p < end && (isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'); p++, n++); + for (p = ptr, n = 0; p < end && (isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'); ++p, ++n); if (n == end - ptr && *p && !strncmp("//", p+1, 2)) { is_stream_wrapper = 1; @@ -413,9 +413,7 @@ if (!is_stream_wrapper && maybe_stream) { /* search for stream wrapper */ - for (p = trypath, n = 0; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++) { - n++; - } + for (p = trypath, n = 0; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; ++p, ++n); } if (is_stream_wrapper || (n < len - 3 && (*p == ':') && (n > 1) && (!strncmp("//", p+1, 2) || !memcmp("data", trypath, 4)))) { @@ -475,7 +473,7 @@ memcpy(trypath+exec_fname_length + 1, filename, filename_len+1); /* search for stream wrapper */ - for (p = trypath; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++, n++); + for (p = trypath; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; ++p, ++n); if (n < exec_fname_length - 3 && (*p == ':') && (n > 1) && (!strncmp("//", p+1, 2) || !memcmp("data", trypath, 4))) { char *actual; @@ -582,8 +580,8 @@ (*ret)->internal_file = entry; (*ret)->is_zip = entry->is_zip; (*ret)->is_tar = entry->is_tar; - entry->phar->refcount++; - entry->fp_refcount++; + ++(entry->phar->refcount); + ++(entry->fp_refcount); return SUCCESS; } if (entry->fp_type == PHAR_MOD) { @@ -620,8 +618,8 @@ (*ret)->is_tar = entry->is_tar; (*ret)->fp = phar_get_efp(entry TSRMLS_CC); (*ret)->zero = entry->offset; - entry->fp_refcount++; - entry->phar->refcount++; + ++(entry->fp_refcount); + ++(entry->phar->refcount); return SUCCESS; } /* }}} */ @@ -701,7 +699,7 @@ return NULL; } - phar->refcount++; + ++(phar->refcount); ret->phar = phar; ret->fp = entry->fp; ret->position = ret->zero = 0; http://cvs.php.net/viewvc.cgi/pecl/phar/zip.c?r1=1.23&r2=1.24&diff_format=u Index: pecl/phar/zip.c diff -u pecl/phar/zip.c:1.23 pecl/phar/zip.c:1.24 --- pecl/phar/zip.c:1.23 Mon Mar 3 08:41:14 2008 +++ pecl/phar/zip.c Sat Mar 22 22:11:48 2008 @@ -233,7 +233,7 @@ return FAILURE /* add each central directory item to the manifest */ - for (i = 0; i < locator.count; i++) { + for (i = 0; i < locator.count; ++i) { phar_zip_central_dir_file zipentry; if (sizeof(zipentry) != php_stream_read(fp, (char *) &zipentry, sizeof(zipentry))) { @@ -485,7 +485,7 @@ efp = phar_get_efp(entry TSRMLS_CC); newcrc32 = ~0; - for (loc = 0;loc < entry->uncompressed_filesize; loc++) { + for (loc = 0;loc < entry->uncompressed_filesize; ++loc) { CRC32(newcrc32, php_stream_getc(efp)); } entry->crc32 = ~newcrc32;
http://cvs.php.net/viewvc.cgi/pecl/phar/dirstream.c?r1=1.11&r2=1.12&diff_format=u Index: pecl/phar/dirstream.c diff -u pecl/phar/dirstream.c:1.11 pecl/phar/dirstream.c:1.12 --- pecl/phar/dirstream.c:1.11 Sun Feb 24 22:29:05 2008 +++ pecl/phar/dirstream.c Sat Mar 22 22:11:48 2008 @@ -79,7 +79,7 @@ } else { *newoffset = 0; while (*newoffset < offset && zend_hash_move_forward(data) == SUCCESS) { - (*newoffset)++; + ++(*newoffset); } return 0; } http://cvs.php.net/viewvc.cgi/pecl/phar/func_interceptors.c?r1=1.8&r2=1.9&diff_format=u Index: pecl/phar/func_interceptors.c diff -u pecl/phar/func_interceptors.c:1.8 pecl/phar/func_interceptors.c:1.9 --- pecl/phar/func_interceptors.c:1.8 Thu Mar 20 23:59:06 2008 +++ pecl/phar/func_interceptors.c Sat Mar 22 22:11:48 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: func_interceptors.c,v 1.8 2008/03/20 23:59:06 cellog Exp $ */ +/* $Id: func_interceptors.c,v 1.9 2008/03/22 22:11:48 cellog Exp $ */ #include "phar_internal.h" @@ -337,7 +337,7 @@ if(groups > 0) { gids=(gid_t *)safe_emalloc(groups, sizeof(gid_t), 0); n=getgroups(groups, gids); - for(i=0;i<n;i++){ + for(i=0;i<n;++i){ if(stat_sb->st_gid==gids[i]) { rmask=S_IRGRP; wmask=S_IWGRP; http://cvs.php.net/viewvc.cgi/pecl/phar/phar.c?r1=1.318&r2=1.319&diff_format=u Index: pecl/phar/phar.c diff -u pecl/phar/phar.c:1.318 pecl/phar/phar.c:1.319 --- pecl/phar/phar.c:1.318 Sat Mar 22 21:54:54 2008 +++ pecl/phar/phar.c Sat Mar 22 22:11:48 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: phar.c,v 1.318 2008/03/22 21:54:54 cellog Exp $ */ +/* $Id: phar.c,v 1.319 2008/03/22 22:11:48 cellog Exp $ */ #define PHAR_MAIN 1 #include "phar_internal.h" @@ -141,7 +141,7 @@ if (val) { *val++ = '\0'; - for (q = key; *q; q++) { + for (q = key; *q; ++q) { *q = tolower(*q); } if (sapi_module.phpinfo_as_text) { @@ -554,10 +554,10 @@ if (EOF == (nextchar = php_stream_getc(fp)) || (char)nextchar != '\n') { MAPPHAR_ALLOC_FAIL("internal corruption of phar \"%s\" (truncated manifest at stub end)") } - halt_offset++; + ++halt_offset; } if ((char) nextchar == '\n') { - halt_offset++; + ++halt_offset; } } /* make sure we are at the right location to read the manifest */ @@ -862,7 +862,7 @@ entry.phar = mydata; entry.fp_type = PHAR_FP; - for (manifest_index = 0; manifest_index < manifest_count; manifest_index++) { + for (manifest_index = 0; manifest_index < manifest_count; ++manifest_index) { if (buffer + 4 > endbuffer) { MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)") } @@ -1436,7 +1436,7 @@ if (*delim == ch) { return 1; } - delim++; + ++delim; } return 0; } @@ -1450,7 +1450,7 @@ } while (*s && in_character_class(*s, delim)) { - s++; + ++s; } if (!*s) { return NULL; @@ -1459,7 +1459,7 @@ token = s; while (*s && !in_character_class(*s, delim)) { - s++; + ++s; } if (!*s) { *last = s; @@ -1540,8 +1540,7 @@ if (new_phar_len == 0) { new_phar = (char *) erealloc(new_phar, new_phar_len+1+1); new_phar[new_phar_len] = '/'; - new_phar[new_phar_len+1] = '\0'; - new_phar_len++; + new_phar[++new_phar_len] = '\0'; } *new_len = new_phar_len; return new_phar; @@ -2042,7 +2041,7 @@ } newcrc32 = ~0; mytime = entry->uncompressed_filesize; - for (loc = 0;loc < mytime; loc++) { + for (loc = 0;loc < mytime; ++loc) { CRC32(newcrc32, php_stream_getc(file)); } entry->crc32 = ~newcrc32; @@ -2828,7 +2827,7 @@ php_info_print_table_header(2, "Phar: PHP Archive support", "enabled"); php_info_print_table_row(2, "Phar EXT version", PHP_PHAR_VERSION); php_info_print_table_row(2, "Phar API version", PHP_PHAR_API_VERSION); - php_info_print_table_row(2, "CVS revision", "$Revision: 1.318 $"); + php_info_print_table_row(2, "CVS revision", "$Revision: 1.319 $"); php_info_print_table_row(2, "Phar-based phar archives", "enabled"); php_info_print_table_row(2, "Tar-based phar archives", "enabled"); php_info_print_table_row(2, "ZIP-based phar archives", "enabled"); http://cvs.php.net/viewvc.cgi/pecl/phar/phar_internal.h?r1=1.95&r2=1.96&diff_format=u Index: pecl/phar/phar_internal.h diff -u pecl/phar/phar_internal.h:1.95 pecl/phar/phar_internal.h:1.96 --- pecl/phar/phar_internal.h:1.95 Sat Mar 22 21:54:14 2008 +++ pecl/phar/phar_internal.h Sat Mar 22 22:11:48 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: phar_internal.h,v 1.95 2008/03/22 21:54:14 sfox Exp $ */ +/* $Id: phar_internal.h,v 1.96 2008/03/22 22:11:48 cellog Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -354,7 +354,7 @@ char *s; /* unixify win paths */ - for (s = path; s - path < path_len; s++) { + for (s = path; s - path < path_len; ++s) { if (*s == '\\') { *s = '/'; } http://cvs.php.net/viewvc.cgi/pecl/phar/phar_object.c?r1=1.185&r2=1.186&diff_format=u Index: pecl/phar/phar_object.c diff -u pecl/phar/phar_object.c:1.185 pecl/phar/phar_object.c:1.186 --- pecl/phar/phar_object.c:1.185 Sat Mar 22 22:04:20 2008 +++ pecl/phar/phar_object.c Sat Mar 22 22:11:48 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: phar_object.c,v 1.185 2008/03/22 22:04:20 cellog Exp $ */ +/* $Id: phar_object.c,v 1.186 2008/03/22 22:11:48 cellog Exp $ */ #include "phar_internal.h" #include "func_interceptors.h" @@ -66,7 +66,7 @@ /* no file extension = assume text/plain */ return PHAR_MIME_OTHER; } - ext++; + ++ext; if (SUCCESS != zend_hash_find(mimes, ext, strlen(ext), (void **) &mime)) { *mime_type = "application/octet-stream"; return PHAR_MIME_OTHER; @@ -392,7 +392,7 @@ if (u) { u[0] = '/'; *ru = estrndup(u, u_len+1); - u_len++; + ++u_len; u[0] = '\0'; } else { *ru = NULL; @@ -534,7 +534,7 @@ if (!basename) { basename = fname; } else { - basename++; + ++basename; } if ((strlen(sapi_module.name) == sizeof("cgi-fcgi")-1 && !strncmp(sapi_module.name, "cgi-fcgi", sizeof("cgi-fcgi")-1)) @@ -598,7 +598,7 @@ fci.param_count = 1; fci.params = zp; #if PHP_VERSION_ID < 50300 - params->refcount++; + ++(params->refcount); #else Z_ADDREF_P(params); #endif @@ -657,7 +657,7 @@ entry_len = index_php_len; if (entry[0] != '/') { spprintf(&entry, 0, "/%s", index_php); - entry_len++; + ++entry_len; } } else { /* assume "index.php" is starting point */ @@ -1094,7 +1094,7 @@ { phar_archive_data *phar_data = (phar_archive_data *) dst->oth; - phar_data->refcount++; + ++(phar_data->refcount); } /* }}} */ @@ -1179,7 +1179,7 @@ } is_data = phar_data->is_data; - phar_data->refcount++; + ++(phar_data->refcount); phar_obj->arc.archive = phar_data; phar_obj->spl.oth_handler = &phar_spl_foreign_handler; http://cvs.php.net/viewvc.cgi/pecl/phar/tar.c?r1=1.36&r2=1.37&diff_format=u Index: pecl/phar/tar.c diff -u pecl/phar/tar.c:1.36 pecl/phar/tar.c:1.37 --- pecl/phar/tar.c:1.36 Mon Mar 3 08:41:14 2008 +++ pecl/phar/tar.c Sat Mar 22 22:11:48 2008 @@ -25,13 +25,13 @@ int i = 0; while (i < len && buf[i] == ' ') { - i++; + ++i; } while (i < len && buf[i] >= '0' && buf[i] <= '7') { num = num * 8 + (buf[i] - '0'); - i++; + ++i; } return num; } @@ -91,7 +91,7 @@ while (buf != end) { sum += (unsigned char)*buf; - buf++; + ++buf; } return sum; } http://cvs.php.net/viewvc.cgi/pecl/phar/util.c?r1=1.30&r2=1.31&diff_format=u Index: pecl/phar/util.c diff -u pecl/phar/util.c:1.30 pecl/phar/util.c:1.31 --- pecl/phar/util.c:1.30 Sat Mar 22 21:54:54 2008 +++ pecl/phar/util.c Sat Mar 22 22:11:48 2008 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: util.c,v 1.30 2008/03/22 21:54:54 cellog Exp $ */ +/* $Id: util.c,v 1.31 2008/03/22 22:11:48 cellog Exp $ */ #include "phar_internal.h" #if !defined(PHP_VERSION_ID) || PHP_VERSION_ID < 50300 @@ -137,12 +137,12 @@ } if (ext[0] == '.') { - ext++; + ++ext; } oldpath = estrndup(phar->fname, phar->fname_len); oldname = strrchr(phar->fname, '/'); - oldname++; + ++oldname; basename = estrndup(oldname, strlen(oldname)); spprintf(&newname, 0, "%s.%s", strtok(basename, "."), ext); @@ -361,7 +361,7 @@ } } /* test for stream wrappers and return */ - for (p = filename; p - filename < filename_len && (isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'); p++, n++); + for (p = filename; p - filename < filename_len && (isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'); ++p, ++n); if (n < filename_len - 3 && (*p == ':') && (!strncmp("//", p+1, 2) || ( filename_len > 4 && !memcmp("data", filename, 4)))) { /* found stream wrapper, this is an absolute path until stream wrappers implement realpath */ return estrndup(filename, filename_len); @@ -378,7 +378,7 @@ maybe_stream = 0; goto not_stream; } - for (p = ptr, n = 0; p < end && (isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'); p++, n++); + for (p = ptr, n = 0; p < end && (isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'); ++p, ++n); if (n == end - ptr && *p && !strncmp("//", p+1, 2)) { is_stream_wrapper = 1; @@ -413,9 +413,7 @@ if (!is_stream_wrapper && maybe_stream) { /* search for stream wrapper */ - for (p = trypath, n = 0; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++) { - n++; - } + for (p = trypath, n = 0; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; ++p, ++n); } if (is_stream_wrapper || (n < len - 3 && (*p == ':') && (n > 1) && (!strncmp("//", p+1, 2) || !memcmp("data", trypath, 4)))) { @@ -475,7 +473,7 @@ memcpy(trypath+exec_fname_length + 1, filename, filename_len+1); /* search for stream wrapper */ - for (p = trypath; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++, n++); + for (p = trypath; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; ++p, ++n); if (n < exec_fname_length - 3 && (*p == ':') && (n > 1) && (!strncmp("//", p+1, 2) || !memcmp("data", trypath, 4))) { char *actual; @@ -582,8 +580,8 @@ (*ret)->internal_file = entry; (*ret)->is_zip = entry->is_zip; (*ret)->is_tar = entry->is_tar; - entry->phar->refcount++; - entry->fp_refcount++; + ++(entry->phar->refcount); + ++(entry->fp_refcount); return SUCCESS; } if (entry->fp_type == PHAR_MOD) { @@ -620,8 +618,8 @@ (*ret)->is_tar = entry->is_tar; (*ret)->fp = phar_get_efp(entry TSRMLS_CC); (*ret)->zero = entry->offset; - entry->fp_refcount++; - entry->phar->refcount++; + ++(entry->fp_refcount); + ++(entry->phar->refcount); return SUCCESS; } /* }}} */ @@ -701,7 +699,7 @@ return NULL; } - phar->refcount++; + ++(phar->refcount); ret->phar = phar; ret->fp = entry->fp; ret->position = ret->zero = 0; http://cvs.php.net/viewvc.cgi/pecl/phar/zip.c?r1=1.23&r2=1.24&diff_format=u Index: pecl/phar/zip.c diff -u pecl/phar/zip.c:1.23 pecl/phar/zip.c:1.24 --- pecl/phar/zip.c:1.23 Mon Mar 3 08:41:14 2008 +++ pecl/phar/zip.c Sat Mar 22 22:11:48 2008 @@ -233,7 +233,7 @@ return FAILURE /* add each central directory item to the manifest */ - for (i = 0; i < locator.count; i++) { + for (i = 0; i < locator.count; ++i) { phar_zip_central_dir_file zipentry; if (sizeof(zipentry) != php_stream_read(fp, (char *) &zipentry, sizeof(zipentry))) { @@ -485,7 +485,7 @@ efp = phar_get_efp(entry TSRMLS_CC); newcrc32 = ~0; - for (loc = 0;loc < entry->uncompressed_filesize; loc++) { + for (loc = 0;loc < entry->uncompressed_filesize; ++loc) { CRC32(newcrc32, php_stream_getc(efp)); } entry->crc32 = ~newcrc32;