Changeset 1201
- Timestamp:
- 2012-12-17T14:22:49+01:00 (5 months ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
devel/run (modified) (1 diff)
-
mod_cacher/xc_cache.h (modified) (1 diff)
-
mod_cacher/xc_cacher.c (modified) (11 diffs)
-
mod_coverager/xc_coverager.c (modified) (9 diffs)
-
processor/hashtable.m4 (modified) (1 diff)
-
processor/head.m4 (modified) (11 diffs)
-
processor/main.m4 (modified) (1 diff)
-
processor/processor.m4 (modified) (1 diff)
-
xcache.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/devel/run
r1193 r1201 171 171 phpize --clean \ 172 172 && phpize \ 173 && CFLAGS="-g -O0 $pedanti -Wno-variadic-macros -Wno-long-long -Wall -Wno-unused-parameter -Wno-unused-function -W -Wshadow -Werror=implicit-function-declaration -std=c89 -D_GNU_SOURCE -D_POSIX_SOURCE -Dinline=" ./configure \173 && CFLAGS="-g -O0 $pedantic -Wno-variadic-macros -Wno-long-long -Wall -Wno-unused-parameter -Wno-unused-function -W -Wshadow -Werror=implicit-function-declaration -Wconversion -std=c89 -D_GNU_SOURCE -D_POSIX_SOURCE -Dinline=" ./configure \ 174 174 --enable-xcache-cacher \ 175 175 --enable-xcache-optimizer \ -
trunk/mod_cacher/xc_cache.h
r1188 r1201 155 155 time_t file_mtime; 156 156 size_t file_size; 157 int file_device;158 int file_inode;159 160 intfilepath_len;157 size_t file_device; 158 size_t file_inode; 159 160 size_t filepath_len; 161 161 ZEND_24(NOTHING, const) char *filepath; 162 intdirpath_len;162 size_t dirpath_len; 163 163 char *dirpath; 164 164 #ifdef IS_UNICODE -
trunk/mod_cacher/xc_cacher.c
r1199 r1201 411 411 time_t n = XG(request_time) / interval; 412 412 if (*curtime != n) { 413 zend_uint target_slot = n% count;413 zend_uint target_slot = ((zend_uint) n) % count; 414 414 zend_uint slot; 415 415 for (slot = advance_wrapped(*curslot, count); … … 449 449 { 450 450 xc_entry_t *p, **pp; 451 int i, c;451 size_t i, c; 452 452 453 453 for (i = 0, c = cache->hentry->size; i < c; i ++) { … … 517 517 static void xc_gc_expires_var(TSRMLS_D) /* {{{ */ 518 518 { 519 int i, c;519 size_t i, c; 520 520 521 521 if (!xc_var_gc_interval || !xc_var_caches) { … … 736 736 { 737 737 zval* list; 738 int i, c;738 size_t i, c; 739 739 xc_entry_t *e; 740 740 … … 934 934 char *tokbuf; 935 935 size_t path_buffer_len; 936 int size;936 size_t size; 937 937 char tokens[] = { DEFAULT_DIR_SEPARATOR, '\0' }; 938 938 int ret; … … 969 969 if (zend_is_executing(TSRMLS_C)) { 970 970 const char *executing_filename = zend_get_executed_filename(TSRMLS_C); 971 int dirname_len = strlen(executing_filename);971 int dirname_len = (int) strlen(executing_filename); 972 972 size_t filename_len = strlen(filepath); 973 973 … … 1066 1066 1067 1067 compiler->new_entry.entry.name.str.val = xc_expand_url(filepath, compiler->opened_path_buffer TSRMLS_CC); 1068 compiler->new_entry.entry.name.str.len = strlen(compiler->new_entry.entry.name.str.val);1068 compiler->new_entry.entry.name.str.len = (int) strlen(compiler->new_entry.entry.name.str.val); 1069 1069 1070 1070 *entry_checker_data->stored_entry = (xc_entry_php_t *) xc_entry_find_unlocked( … … 1144 1144 else { 1145 1145 #ifdef ZEND_ENGINE_2_3 1146 char *opened_path = php_resolve_path(compiler->filename, compiler->filename_len, PG(include_path) TSRMLS_CC);1146 char *opened_path = php_resolve_path(compiler->filename, (int) compiler->filename_len, PG(include_path) TSRMLS_CC); 1147 1147 if (opened_path) { 1148 1148 strcpy(compiler->opened_path_buffer, opened_path); … … 1182 1182 1183 1183 delta = XG(request_time) - buf.st_mtime; 1184 if (abs( delta) < 2 && !xc_test) {1184 if (abs((int) delta) < 2 && !xc_test) { 1185 1185 return FAILURE; 1186 1186 } … … 1214 1214 ++basename_begin; 1215 1215 1216 basename_hash_value = HASH_STR_L(basename_begin, filename_end - basename_begin);1216 basename_hash_value = HASH_STR_L(basename_begin, (uint) (filename_end - basename_begin)); 1217 1217 } 1218 1218 … … 1254 1254 1255 1255 PHP_MD5Init(&context); 1256 while ((n = php_stream_read(stream, (char *) buf, sizeof(buf))) > 0) {1256 while ((n = php_stream_read(stream, (char *) buf, (int) sizeof(buf))) > 0) { 1257 1257 PHP_MD5Update(&context, buf, n); 1258 1258 } -
trunk/mod_coverager/xc_coverager.c
r1151 r1201 40 40 } 41 41 /* }}} */ 42 static void xcache_mkdirs_ex(char *root, int rootlen, char *path, intpathlen TSRMLS_DC) /* {{{ */42 static void xcache_mkdirs_ex(char *root, long rootlen, char *path, long pathlen TSRMLS_DC) /* {{{ */ 43 43 { 44 44 char *fullpath; … … 76 76 long covlines, *phits; 77 77 int fd = -1; 78 int size;78 size_t size; 79 79 int newfile; 80 80 struct stat srcstat, outstat; … … 277 277 zstr s; 278 278 char *outfilename; 279 int dumpdir_len, outfilelen, alloc_len = 0;279 size_t dumpdir_len, outfilelen, alloc_len = 0; 280 280 uint size; 281 281 HashPosition pos; … … 334 334 zend_hash_move_forward_ex(cov, &pos2); 335 335 } 336 add_assoc_zval_ex(return_value, ZSTR_S(filename), strlen(ZSTR_S(filename)) + 1, lines);336 add_assoc_zval_ex(return_value, ZSTR_S(filename), (uint) strlen(ZSTR_S(filename)) + 1, lines); 337 337 338 338 zend_hash_move_forward_ex(XG(coverages), &pos); … … 357 357 static coverager_t xc_coverager_get(const char *filename TSRMLS_DC) /* {{{ */ 358 358 { 359 int len =strlen(filename) + 1;359 uint len = (uint) strlen(filename) + 1; 360 360 coverager_t cov, *pcov; 361 361 … … 473 473 if (XG(coverages) && XG(coverager_started)) { 474 474 int size = xc_coverager_get_op_array_size_no_tail(op_array); 475 int oplineno = ( *EG(opline_ptr)) - op_array->opcodes;475 int oplineno = (int) ((*EG(opline_ptr)) - op_array->opcodes); 476 476 if (oplineno < size) { 477 477 xc_coverager_add_hits(xc_coverager_get(op_array->filename TSRMLS_CC), (*EG(opline_ptr))->lineno, 1 TSRMLS_CC); … … 498 498 499 499 p = (long*) str; 500 len -= sizeof(long);500 len -= (int) sizeof(long); 501 501 if (len < 0) { 502 502 return; … … 507 507 } 508 508 509 for (; len >= (int) sizeof(long) * 2; len -= sizeof(long) * 2, p += 2) {509 for (; len >= (int) sizeof(long) * 2; len -= (int) sizeof(long) * 2, p += 2) { 510 510 add_index_long(return_value, p[0], p[1] < 0 ? 0 : p[1]); 511 511 } … … 658 658 659 659 if (cfg_get_string("xcache.coveragedump_directory", &xc_coveragedump_dir) == SUCCESS && xc_coveragedump_dir) { 660 int len;660 size_t len; 661 661 xc_coveragedump_dir = pestrdup(xc_coveragedump_dir, 1); 662 662 len = strlen(xc_coveragedump_dir); -
trunk/processor/hashtable.m4
r932 r1201 72 72 dnl only used for copy 73 73 IFCOPY(`uint n;') 74 IFCALCCOPY(` int bucketsize;')74 IFCALCCOPY(`size_t bucketsize;') 75 75 76 76 #if defined(HARDENING_PATCH_HASH_PROTECT) && HARDENING_PATCH_HASH_PROTECT -
trunk/processor/head.m4
r1135 r1201 89 89 struct _xc_processor_t { 90 90 char *p; 91 zend_uint size;91 size_t size; 92 92 HashTable strings; 93 93 HashTable zvalptrs; … … 159 159 #endif 160 160 /* {{{ xc_zstrlen_char */ 161 static inline int xc_zstrlen_char(const_zstr s)161 static inline size_t xc_zstrlen_char(const_zstr s) 162 162 { 163 163 return strlen(ZSTR_S(s)); … … 166 166 #ifdef IS_UNICODE 167 167 /* {{{ xc_zstrlen_uchar */ 168 static inline int xc_zstrlen_uchar(zstr s)168 static inline size_t xc_zstrlen_uchar(zstr s) 169 169 { 170 170 return u_strlen(ZSTR_U(s)); … … 172 172 /* }}} */ 173 173 /* {{{ xc_zstrlen */ 174 static inline int xc_zstrlen(int type, const_zstr s)174 static inline size_t xc_zstrlen(int type, const_zstr s) 175 175 { 176 176 return type == IS_UNICODE ? xc_zstrlen_uchar(s) : xc_zstrlen_char(s); … … 192 192 static inline void xc_calc_string_n(xc_processor_t *processor, zend_uchar type, const_zstr str, long size IFAUTOCHECK(`, int relayline')) { 193 193 pushdef(`__LINE__', `relayline') 194 int realsize = UNISW(size, (type == IS_UNICODE) ? UBYTES(size) : size);194 size_t realsize = UNISW(size, (type == IS_UNICODE) ? UBYTES(size) : size); 195 195 long dummy = 1; 196 196 … … 198 198 ALLOC(, char, realsize) 199 199 } 200 else if (zend_u_hash_add(&processor->strings, type, str, size, (void *) &dummy, sizeof(dummy), NULL) == SUCCESS) {200 else if (zend_u_hash_add(&processor->strings, type, str, (uint) size, (void *) &dummy, sizeof(dummy), NULL) == SUCCESS) { 201 201 /* new string */ 202 202 ALLOC(, char, realsize) … … 214 214 static inline zstr xc_store_string_n(xc_processor_t *processor, zend_uchar type, const_zstr str, long size IFAUTOCHECK(`, int relayline')) { 215 215 pushdef(`__LINE__', `relayline') 216 int realsize = UNISW(size, (type == IS_UNICODE) ? UBYTES(size) : size);216 size_t realsize = UNISW(size, (type == IS_UNICODE) ? UBYTES(size) : size); 217 217 zstr ret, *pret; 218 218 … … 223 223 } 224 224 225 if (zend_u_hash_find(&processor->strings, type, str, size, (void **) &pret) == SUCCESS) {225 if (zend_u_hash_find(&processor->strings, type, str, (uint) size, (void **) &pret) == SUCCESS) { 226 226 return *pret; 227 227 } … … 230 230 ALLOC(ZSTR_V(ret), char, realsize) 231 231 memcpy(ZSTR_V(ret), ZSTR_V(str), realsize); 232 zend_u_hash_add(&processor->strings, type, str, size, (void *) &ret, sizeof(zstr), NULL);232 zend_u_hash_add(&processor->strings, type, str, (uint) size, (void *) &ret, sizeof(zstr), NULL); 233 233 return ret; 234 234 … … 239 239 * return class_index + 1 240 240 */ 241 static zend_u longxc_get_class_num(xc_processor_t *processor, zend_class_entry *ce) {242 zend_u longi;241 static zend_uint xc_get_class_num(xc_processor_t *processor, zend_class_entry *ce) { 242 zend_uint i; 243 243 const xc_entry_data_php_t *php = processor->php_src; 244 244 zend_class_entry *ceptr; … … 357 357 /* {{{ field name checker */ 358 358 IFAUTOCHECK(`dnl 359 static int xc_check_names(const char *file, int line, const char *functionName, const char **assert_names, int assert_names_count, HashTable *done_names)359 static int xc_check_names(const char *file, int line, const char *functionName, const char **assert_names, size_t assert_names_count, HashTable *done_names) 360 360 { 361 361 int errors = 0; 362 362 if (assert_names_count) { 363 int i;363 size_t i; 364 364 Bucket *b; 365 365 366 366 for (i = 0; i < assert_names_count; ++i) { 367 if (!zend_u_hash_exists(done_names, IS_STRING, assert_names[i], strlen(assert_names[i]) + 1)) {367 if (!zend_u_hash_exists(done_names, IS_STRING, assert_names[i], (uint) strlen(assert_names[i]) + 1)) { 368 368 fprintf(stderr 369 369 , "Error: missing field at %s `#'%d %s`' : %s\n" -
trunk/processor/main.m4
r1132 r1201 207 207 dnl {{{ DONE_* 208 208 define(`DONE_SIZE', `IFAUTOCHECK(`dnl 209 xc_autocheck_done_size += $1`';209 xc_autocheck_done_size += (int) $1`'; 210 210 xc_autocheck_done_count ++; 211 211 ')') -
trunk/processor/processor.m4
r1196 r1201 1178 1178 PROCESS(time_t, file_mtime) 1179 1179 PROCESS(size_t, file_size) 1180 PROCESS( int, file_device)1181 PROCESS( int, file_inode)1182 1183 PROCESS( int, filepath_len)1180 PROCESS(size_t, file_device) 1181 PROCESS(size_t, file_inode) 1182 1183 PROCESS(size_t, filepath_len) 1184 1184 IFRESTORE(`COPY(filepath)', `PROC_STRING_L(filepath, filepath_len)') 1185 PROCESS( int, dirpath_len)1185 PROCESS(size_t, dirpath_len) 1186 1186 IFRESTORE(`COPY(dirpath)', `PROC_STRING_L(dirpath, dirpath_len)') 1187 1187 #ifdef IS_UNICODE -
trunk/xcache.c
r1182 r1201 248 248 if (name) { 249 249 /* RETURN_STRING */ 250 int len = strlen(name);250 int len = (int) strlen(name); 251 251 return_value->value.str.len = len; 252 252 return_value->value.str.val = estrndup(name, len); … … 754 754 char *env; 755 755 if ((env = getenv("XCACHE_TEST")) != NULL) { 756 xc_test = atoi(env);756 xc_test = (zend_bool) atoi(env); 757 757 } 758 758 }
Note: See TracChangeset
for help on using the changeset viewer.

