Re: [Libclc-developers] new function: clc_strrev
Status: Planning
Brought to you by:
augestad
|
From: Hallvard B F. <h.b...@us...> - 2003-03-23 17:19:32
|
Bj=F8rn Augestad writes:
> How about renaming clc_strnrev() to clc_memrev()?
Done.
> Oh well, your version looks better so we=20
> keep that one. Please update libclc/src/string/clc_strrev.c
Done.
> Speaking of optimizations, any opinions on code like this?
>=20
> int clc_ultostr(char *ptr, size_t size, unsigned long num, int base)
> {
> const char *sym =3D "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
> char* sp;
>=20
> #ifdef CLC_FAST
> if(base =3D=3D 2) { (...) return num =3D=3D 0; }
> #endif
> .... /* regular version goes here */
> }
Since the _whole_ base2 function is special-cased, I think it's better
to provide a separate base2 function. Then the library still gets
bigger like you say, but not the application using it.
--=20
Hallvard
|