Ignore:
Timestamp:
2012-12-17T14:22:49+01:00 (2 years ago)
Author:
moo
Message:

fix some 64bit warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/head.m4

    r1135 r1201  
    8989struct _xc_processor_t {
    9090    char *p;
    91     zend_uint size;
     91    size_t size;
    9292    HashTable strings;
    9393    HashTable zvalptrs;
     
    159159#endif
    160160/* {{{ xc_zstrlen_char */
    161 static inline int xc_zstrlen_char(const_zstr s)
     161static inline size_t xc_zstrlen_char(const_zstr s)
    162162{
    163163    return strlen(ZSTR_S(s));
     
    166166#ifdef IS_UNICODE
    167167/* {{{ xc_zstrlen_uchar */
    168 static inline int xc_zstrlen_uchar(zstr s)
     168static inline size_t xc_zstrlen_uchar(zstr s)
    169169{
    170170    return u_strlen(ZSTR_U(s));
     
    172172/* }}} */
    173173/* {{{ xc_zstrlen */
    174 static inline int xc_zstrlen(int type, const_zstr s)
     174static inline size_t xc_zstrlen(int type, const_zstr s)
    175175{
    176176    return type == IS_UNICODE ? xc_zstrlen_uchar(s) : xc_zstrlen_char(s);
     
    192192static inline void xc_calc_string_n(xc_processor_t *processor, zend_uchar type, const_zstr str, long size IFAUTOCHECK(`, int relayline')) {
    193193    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);
    195195    long dummy = 1;
    196196
     
    198198        ALLOC(, char, realsize)
    199199    }
    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) {
    201201        /* new string */
    202202        ALLOC(, char, realsize)
     
    214214static inline zstr xc_store_string_n(xc_processor_t *processor, zend_uchar type, const_zstr str, long size IFAUTOCHECK(`, int relayline')) {
    215215    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);
    217217    zstr ret, *pret;
    218218
     
    223223    }
    224224
    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) {
    226226        return *pret;
    227227    }
     
    230230    ALLOC(ZSTR_V(ret), char, realsize)
    231231    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);
    233233    return ret;
    234234
     
    239239 * return class_index + 1
    240240 */
    241 static zend_ulong xc_get_class_num(xc_processor_t *processor, zend_class_entry *ce) {
    242     zend_ulong i;
     241static zend_uint xc_get_class_num(xc_processor_t *processor, zend_class_entry *ce) {
     242    zend_uint i;
    243243    const xc_entry_data_php_t *php = processor->php_src;
    244244    zend_class_entry *ceptr;
     
    357357/* {{{ field name checker */
    358358IFAUTOCHECK(`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)
     359static int xc_check_names(const char *file, int line, const char *functionName, const char **assert_names, size_t assert_names_count, HashTable *done_names)
    360360{
    361361    int errors = 0;
    362362    if (assert_names_count) {
    363         int i;
     363        size_t i;
    364364        Bucket *b;
    365365
    366366        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)) {
    368368                fprintf(stderr
    369369                    , "Error: missing field at %s `#'%d %s`' : %s\n"
Note: See TracChangeset for help on using the changeset viewer.