pike.git/
src/
stralloc.c
Branch:
Tag:
Non-build tags
All tags
No tags
2014-12-04
2014-12-04 19:26:15 by Per Hedbor <ph@opera.com>
a0f2756e745cb934d1f296a02bcf2513fe8264c3 (
9
lines) (+
6
/-
3
)
[
Show
|
Annotate
]
Branch:
bill/master_archive_support
Some fixes to binary_findstring
Mainly avoid type warnings by casting everything to void*.
531:
int in = foo.shift; void *tmp = NULL; struct pike_string *res;
+
if( !foo.shift )
+
return binary_findstring( (void*)foo.ptr, l );
-
if( foo.shift == 2 )
+
if(
UNLIKELY(
foo.shift == 2
)
)
foo.shift=find_magnitude2( (void*)foo.ptr, l ); else if( foo.shift == 1 ) foo.shift=find_magnitude1( (void*)foo.ptr, l );
-
if( foo.shift != in )
+
if(
UNLIKELY(
foo.shift != in
)
)
{ tmp = malloc( l * (1<<foo.shift) ); switch(in)
554:
foo.ptr = tmp; }
-
res=internal_findstring(foo.ptr, l, foo.shift,
+
res=internal_findstring(
(void*)
foo.ptr, l, foo.shift,
low_do_hash(foo.ptr,l,foo.shift)); if( tmp )