2014-12-04
2014-12-04 19:26:00 by Martin Nilsson <nilsson@opera.com>
-
b81a1dad883d72fe3cff9eef009a19368eed83fe
(16 lines)
(+7/-9)
[
Show
| Annotate
]
Branch: bill/master_archive_support
mallocs nowdays return void*, so no need to case.
669:
#endif
if (len <= SHORT_STRING_THRESHOLD)
{
- t=(struct pike_string *)ba_alloc(&string_allocator);
+ t=ba_alloc(&string_allocator);
t->flags = STRING_NOT_HASHED | STRING_NOT_SHARED | STRING_IS_SHORT;
} else
{
- t=(struct pike_string *)xalloc(len + 1 + sizeof(struct pike_string_hdr));
+ t=xalloc(len + 1 + sizeof(struct pike_string_hdr));
t->flags = STRING_NOT_HASHED | STRING_NOT_SHARED;
}
#ifdef ATOMIC_SVALUE
806: Inside #if defined(PIKE_DEBUG)
if (shift > 2)
Pike_fatal("Unsupported string shift: %d\n", shift);
#endif /* PIKE_DEBUG */
- t=(struct pike_string *)ba_alloc(&string_allocator);
+ t=ba_alloc(&string_allocator);
t->flags = STRING_NOT_HASHED|STRING_NOT_SHARED|STRING_IS_SHORT;
} else {
- t=(struct pike_string *)xalloc(((len + 1)<<shift) +
- sizeof(struct pike_string_hdr));
+ t=xalloc(((len + 1)<<shift) + sizeof(struct pike_string_hdr));
t->flags = STRING_NOT_HASHED|STRING_NOT_SHARED;
}
#ifdef ATOMIC_SVALUE
1733:
return a;
}
} else {
- r=(struct pike_string *)realloc((char *)a,
- sizeof(struct pike_string_hdr)+
- ((size+1)<<a->size_shift));
+ r=realloc(a, sizeof(struct pike_string_hdr)+((size+1)<<a->size_shift));
}
if(!r)
2229: Inside #if defined(PIKE_RUN_UNLOCKED)
#ifdef PIKE_RUN_UNLOCKED
{
int h;
- bucket_locks=(PIKE_MUTEX_T *)xalloc(sizeof(PIKE_MUTEX_T)*BUCKET_LOCKS);
+ bucket_locks=xalloc(sizeof(PIKE_MUTEX_T)*BUCKET_LOCKS);
for(h=0;h<BUCKET_LOCKS;h++) mt_init(bucket_locks + h);
}
#endif