Changeset 917 for trunk/xcache.c


Ignore:
Timestamp:
2012-06-23T06:49:59+02:00 (3 years ago)
Author:
moo
Message:

kill sign/const warning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache.c

    r916 r917  
    3838#include "utils.h"
    3939
    40 #define VAR_ENTRY_EXPIRED(pentry) ((pentry)->ttl && XG(request_time) > (pentry)->ctime + (pentry)->ttl)
     40#define VAR_ENTRY_EXPIRED(pentry) ((pentry)->ttl && XG(request_time) > (pentry)->ctime + (time_t) (pentry)->ttl)
    4141#define CHECK(x, e) do { if ((x) == NULL) { zend_error(E_ERROR, "XCache: " e); goto err; } } while (0)
    4242#define LOCK(x) xc_lock((x)->lck)
     
    464464{
    465465    TRACE("ttl %lu, %lu %lu", (zend_ulong) XG(request_time), (zend_ulong) entry->atime, xc_php_ttl);
    466     if (XG(request_time) > entry->atime + xc_php_ttl) {
     466    if (XG(request_time) > entry->atime + (time_t) xc_php_ttl) {
    467467        return 1;
    468468    }
     
    481481{
    482482    TRACE("interval %lu, %lu %lu", (zend_ulong) XG(request_time), (zend_ulong) cache->last_gc_expires, gc_interval);
    483     if (XG(request_time) - cache->last_gc_expires >= gc_interval) {
     483    if (XG(request_time) >= cache->last_gc_expires + (time_t) gc_interval) {
    484484        ENTER_LOCK(cache) {
    485             if (XG(request_time) - cache->last_gc_expires >= gc_interval) {
     485            if (XG(request_time) >= cache->last_gc_expires + (time_t) gc_interval) {
    486486                cache->last_gc_expires = XG(request_time);
    487487                xc_entry_apply_unlocked(type, cache, apply_func TSRMLS_CC);
     
    11921192    ulong           old_rsid = EG(regular_list).nNextFreeElement;
    11931193
    1194     stream = php_stream_open_wrapper(ZEND_24(NOTHING, (char *)) compiler->filename, "rb", USE_PATH | REPORT_ERRORS | ENFORCE_SAFE_MODE | STREAM_DISABLE_OPEN_BASEDIR, NULL);
     1194    stream = php_stream_open_wrapper((char *) compiler->filename, "rb", USE_PATH | REPORT_ERRORS | ENFORCE_SAFE_MODE | STREAM_DISABLE_OPEN_BASEDIR, NULL);
    11951195    if (!stream) {
    11961196        return FAILURE;
     
    12401240{
    12411241    char *class_name;
    1242     int i, class_len;
     1242    zend_uint i;
     1243    int class_len;
    12431244    xc_cest_t cest;
    12441245    xc_entry_data_php_t *php = (xc_entry_data_php_t *) data;
     
    12851286static void xc_collect_op_array_info(xc_compiler_t *compiler, xc_const_usage_t *usage, xc_op_array_info_t *op_array_info, zend_op_array *op_array TSRMLS_DC) /* {{{ */
    12861287{
    1287     int i;
     1288#ifdef ZEND_ENGINE_2_4
     1289    int literalindex;
     1290#else
     1291    zend_uint oplinenum;
     1292#endif
    12881293    xc_vector_t details;
    12891294
     
    13151320
    13161321#ifdef ZEND_ENGINE_2_4
    1317     for (i = 0; i < op_array->last_literal; i++) {
    1318         zend_literal *literal = &op_array->literals[i];
     1322    for (literalindex = 0; literalindex < op_array->last_literal; literalindex++) {
     1323        zend_literal *literal = &op_array->literals[literalindex];
    13191324        zend_uint literalinfo = 0;
    13201325        if (Z_TYPE(literal->constant) == IS_STRING) {
     
    13301335        if (literalinfo) {
    13311336            xc_op_array_info_detail_t detail;
    1332             detail.index = i;
     1337            detail.index = literalindex;
    13331338            detail.info  = literalinfo;
    13341339            xc_vector_add(xc_op_array_info_detail_t, &details, detail);
     
    13391344    op_array_info->literalinfos    = xc_vector_detach(xc_op_array_info_detail_t, &details);
    13401345#else /* ZEND_ENGINE_2_4 */
    1341     for (i = 0; i < op_array->last; i++) {
    1342         zend_op *opline = &op_array->opcodes[i];
     1346    for (oplinenum = 0; oplinenum < op_array->last; oplinenum++) {
     1347        zend_op *opline = &op_array->opcodes[oplinenum];
    13431348        zend_uint oplineinfo = 0;
    13441349        if (Z_OP_TYPE(opline->op1) == IS_CONST) {
     
    13701375        if (oplineinfo) {
    13711376            xc_op_array_info_detail_t detail;
    1372             detail.index = i;
     1377            detail.index = oplinenum;
    13731378            detail.info  = oplineinfo;
    13741379            xc_vector_add(xc_op_array_info_detail_t, &details, detail);
     
    13841389void xc_fix_op_array_info(const xc_entry_php_t *entry_php, const xc_entry_data_php_t *php, zend_op_array *op_array, int shallow_copy, const xc_op_array_info_t *op_array_info TSRMLS_DC) /* {{{ */
    13851390{
    1386     int i;
    1387 
    13881391#ifdef ZEND_ENGINE_2_4
    1389     for (i = 0; i < op_array_info->literalinfo_cnt; ++i) {
    1390         int index = op_array_info->literalinfos[i].index;
    1391         int literalinfo = op_array_info->literalinfos[i].info;
     1392    int linteralindex;
     1393
     1394    for (linteralindex = 0; linteralindex < op_array_info->literalinfo_cnt; ++linteralindex) {
     1395        int index = op_array_info->literalinfos[linteralindex].index;
     1396        int literalinfo = op_array_info->literalinfos[linteralindex].info;
    13921397        zend_literal *literal = &op_array->literals[index];
    13931398        if ((literalinfo & xcache_literal_is_file)) {
     
    14301435        }
    14311436    }
    1432 #else
    1433     for (i = 0; i < op_array_info->oplineinfo_cnt; ++i) {
    1434         int oplineno = op_array_info->oplineinfos[i].index;
    1435         int oplineinfo = op_array_info->oplineinfos[i].info;
     1437#else /* ZEND_ENGINE_2_4 */
     1438    zend_uint oplinenum;
     1439
     1440    for (oplinenum = 0; oplinenum < op_array_info->oplineinfo_cnt; ++oplinenum) {
     1441        int oplineno = op_array_info->oplineinfos[oplinenum].index;
     1442        int oplineinfo = op_array_info->oplineinfos[oplinenum].info;
    14361443        zend_op *opline = &op_array->opcodes[oplineno];
    14371444        if ((oplineinfo & xcache_op1_is_file)) {
     
    15171524        }
    15181525    }
    1519 #endif
     1526#endif /* ZEND_ENGINE_2_4 */
    15201527}
    15211528/* }}} */
     
    15351542static void xc_free_php(xc_entry_data_php_t *php TSRMLS_DC) /* {{{ */
    15361543{
    1537     int i;
     1544    zend_uint i;
    15381545    if (php->classinfos) {
    15391546        for (i = 0; i < php->classinfo_cnt; i ++) {
    15401547            xc_classinfo_t *classinfo = &php->classinfos[i];
    1541             int j;
     1548            zend_uint j;
     1549
    15421550            for (j = 0; j < classinfo->methodinfo_cnt; j ++) {
    15431551                xc_free_op_array_info(&classinfo->methodinfos[j] TSRMLS_CC);
     
    15761584{
    15771585    zend_op_array *op_array;
    1578     int old_constinfo_cnt, old_funcinfo_cnt, old_classinfo_cnt;
     1586    zend_uint old_constinfo_cnt, old_funcinfo_cnt, old_classinfo_cnt;
    15791587    zend_bool catched = 0;
    15801588
     
    16571665    /* {{{ shallow copy, pointers only */ {
    16581666        Bucket *b;
    1659         unsigned int i;
    1660         unsigned int j;
     1667        zend_uint i;
     1668        zend_uint j;
    16611669
    16621670#define COPY_H(vartype, var, cnt, name, datatype) do {        \
     
    17791787    compiler->new_php.have_early_binding = 0;
    17801788    {
    1781         int i;
     1789        zend_uint i;
    17821790        for (i = 0; i < compiler->new_php.classinfo_cnt; i ++) {
    17831791            compiler->new_php.classinfos[i].oplineno = -1;
     
    21252133{
    21262134    xc_shm_t *shm;
    2127     int i;
     2135    size_t i;
    21282136
    21292137    if (xc_php_caches) {
     
    21502158{
    21512159    xc_shm_t *shm;
    2152     int i;
     2160    size_t i;
    21532161
    21542162    if (xc_php_caches) {
     
    22492257static xc_shm_t *xc_cache_destroy(xc_cache_t **caches, xc_hash_t *hcache) /* {{{ */
    22502258{
    2251     int i;
     2259    size_t i;
    22522260    xc_cache_t *cache;
    22532261    xc_shm_t *shm;
     
    22822290    xc_mem_t *mem;
    22832291    time_t now = time(NULL);
    2284     int i;
     2292    size_t i;
    22852293    xc_memsize_t memsize;
    22862294
     
    24052413static void xc_request_init(TSRMLS_D) /* {{{ */
    24062414{
    2407     int i;
     2415    size_t i;
    24082416
    24092417    if (!XG(internal_table_copied)) {
     
    24992507#endif
    25002508{
    2501     int i;
     2509    size_t i;
    25022510
    25032511    if (xcache_globals->php_holds != NULL) {
     
    37153723static int xc_config_hash(xc_hash_t *p, char *name, char *default_value) /* {{{ */
    37163724{
    3717     int bits, size;
     3725    size_t bits, size;
    37183726    char *value;
    37193727
Note: See TracChangeset for help on using the changeset viewer.