pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:56:    struct pike_string str;    struct pike_string *parent;   };      /*** Main string hash function ***/      #define StrHash(s,len) low_do_hash(s,len,0)   #define low_do_hash(STR,LEN,SHIFT) low_hashmem( (STR), (LEN)<<(SHIFT), hash_prefix_len<<(SHIFT), hashkey )   #define do_hash(STR) low_do_hash(STR->str,STR->len,STR->size_shift)    - static INLINE int string_is_block_allocated(const struct pike_string * s) { + static inline int string_is_block_allocated(const struct pike_string * s) {    return (s->alloc_type == STRING_ALLOC_BA);   }    - static INLINE int PIKE_UNUSED_ATTRIBUTE string_is_malloced(const struct pike_string * s) { + static inline int PIKE_UNUSED_ATTRIBUTE string_is_malloced(const struct pike_string * s) {    return (s->alloc_type == STRING_ALLOC_MALLOC);   }    - static INLINE int string_is_static(const struct pike_string * s) { + static inline int string_is_static(const struct pike_string * s) {    return s->alloc_type == STRING_ALLOC_STATIC;   }    - static INLINE int string_is_substring(const struct pike_string * s) { + static inline int string_is_substring(const struct pike_string * s) {    return s->alloc_type == STRING_ALLOC_SUBSTRING;   }      static struct pike_string *substring_content_string(const struct pike_string *s)   {    return ((struct substring_pike_string*)s)->parent;   }    - static INLINE int string_may_modify(const struct pike_string * s) + static inline int string_may_modify(const struct pike_string * s)   {    return !string_is_static(s) && !string_is_substring(s)    && s->refs == 1;   }    - static INLINE int string_may_modify_len(const struct pike_string * s) + static inline int string_may_modify_len(const struct pike_string * s)   {    return s->refs == 1;   }         /* Returns true if str could contain n. */   PMOD_EXPORT int string_range_contains( struct pike_string *str, int n )   {    INT32 min, max;    check_string_range( str, 1, &min, &max );
pike.git/src/stralloc.c:233:    }    str->min = (unsigned INT32)s_min / (1 << 24);    str->max = (unsigned INT32)s_max / (1 << 24);    break;    }    }    if( min ) *min = s_min;    if( max ) *max = s_max;   }    - static INLINE int find_magnitude1(const p_wchar1 *s, ptrdiff_t len) + static inline int find_magnitude1(const p_wchar1 *s, ptrdiff_t len)   {    const p_wchar1 *e=s+len;    while(s<e)    if(*s++>=256)    return 1;    return 0;   }    - static INLINE int find_magnitude2(const p_wchar2 *s, ptrdiff_t len) + static inline int find_magnitude2(const p_wchar2 *s, ptrdiff_t len)   {    const p_wchar2 *e=s+len;    while(s<e)    {    if((unsigned INT32)*s>=256)    {    do    {    if((unsigned INT32)*s++>=65536)    return 2;    }while(s<e);    return 1;    }    s++;    }    return 0;   }    - static INLINE enum size_shift min_magnitude(const unsigned c) + static inline enum size_shift min_magnitude(const unsigned c)   {    return LIKELY(c<256) ? 0 : LIKELY(c<65536) ? 1 : 2;   }      void low_set_index(struct pike_string *s, ptrdiff_t pos, int value)   {   #ifdef PIKE_DEBUG    if(pos > s->len || pos<0) {    if (s->len) {    Pike_fatal("String index %"PRINTPTRDIFFT"d is out of "