[Libclc-developers] Some more comments to the current CVS tree
Status: Planning
Brought to you by:
augestad
|
From: Jan E. <je...@li...> - 2003-04-02 16:29:16
|
Hi there,
whilst looking through the current CVS snapshots, I stumbled over these issues:
doc/string/clc_stralloc.txt:
char *s = clc_stralloc("foo", "bar", (char *)0);
Can't we assume that NULL is (something casted) 0? Yet,
NULL is defined as (void *)0, but that is not a big difference
to (char *)0. Even (int *)0 would work, wouldn't it?
src/clc_stralloc.c:
va_start() is used two times. IIRC, such use is not recommended,
for whatever reason. IIRC.
They propose va_copy() instead.
src/clc_strcasecmp.c:
for (;; s1++, s2++)
Euh, maybe written as while(1) { ...; ++s1; ++s2 } ?
src/clc_stpcpy.c:
It is using its own copy mechanism. Since strcpy() is defined in ISO
9899 (is that C 89 or C 99 ?), oh well. If strcpy() is C89, wouldn't
it be wiser to stick to that?
src/clc_strdup.c:
I am a great destroyer of readability >:-) so I propose
if((size = strlen(s) + 1) == 0) { p = NULL; }
instead of the two lines
size = strlen(s) + 1
if(size == 0) { p = NULL; }
src/clc_strlcpy.c:
You cannot get rid of me.
- while(*src)
- ++src
+ while(*src++);
src/clc_strltrim.c:
char *cptr;
cptr = s;
while(... && isspace((unsigned char)*cptr))
What if you would make cptr unsigned at the beginning?
unsigned char *cptr;
assert...
cptr=s;
while(...&&isspace(*cptr))
doc/string/clc_strrev.txt
small indent problem if you care ;)
doc/string/*
General indent question. Some files have 4 some have 2 leading.
=)
- Jan Engelhardt
|