author | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 7 Mar 2007 01:44:17 +0000 (20:44 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 7 Mar 2007 18:47:10 +0000 (10:47 -0800) | ||
commit | 3a55602eeca4ac8670e8698a7187e18b95683344 | |
tree | 625a8af9c4655ace00b275c3e272c2764db3bcb8 | tree | snapshot |
parent | ff1f99453f1fe2fd9470f6ea268aed5a1839bd09 | commit | diff |
General const correctness fixes
We shouldn't attempt to assign constant strings into char*, as the
string is not writable at runtime. Likewise we should always be
treating unsigned values as unsigned values, not as signed values.
Most of these are very straightforward. The only exception is the
(unnecessary) xstrdup/free in builtin-branch.c for the detached
head case. Since this is a user-level interactive type program
and that particular code path is executed no more than once, I feel
that the extra xstrdup call is well worth the easy elimination of
this warning.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
We shouldn't attempt to assign constant strings into char*, as the
string is not writable at runtime. Likewise we should always be
treating unsigned values as unsigned values, not as signed values.
Most of these are very straightforward. The only exception is the
(unnecessary) xstrdup/free in builtin-branch.c for the detached
head case. Since this is a user-level interactive type program
and that particular code path is executed no more than once, I feel
that the extra xstrdup call is well worth the easy elimination of
this warning.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
16 files changed:
builtin-blame.c | diff | blob | history | |
builtin-branch.c | diff | blob | history | |
builtin-for-each-ref.c | diff | blob | history | |
builtin-mailinfo.c | diff | blob | history | |
builtin-shortlog.c | diff | blob | history | |
builtin-show-branch.c | diff | blob | history | |
cache.h | diff | blob | history | |
commit.c | diff | blob | history | |
convert-objects.c | diff | blob | history | |
environment.c | diff | blob | history | |
fast-import.c | diff | blob | history | |
index-pack.c | diff | blob | history | |
interpolate.c | diff | blob | history | |
interpolate.h | diff | blob | history | |
path.c | diff | blob | history | |
sha1_file.c | diff | blob | history |