Skip to content

Commit

Permalink
blame: avoid -lm by not using log().
Browse files Browse the repository at this point in the history
... as suggested on the list.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Mar 6, 2006
1 parent ea4c7f9 commit a0fb95e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,6 @@ git-rev-list$X: rev-list.o $(LIB_FILE)
$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS) $(OPENSSL_LIBSSL)

git-blame$X: blame.o $(LIB_FILE)
$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS) -lm

init-db.o: init-db.c
$(CC) -c $(ALL_CFLAGS) \
-DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"' $*.c
Expand Down
6 changes: 4 additions & 2 deletions blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ int main(int argc, const char **argv)
usage(blame_usage);
else if(!strcmp(argv[i], "-l") ||
!strcmp(argv[i], "--long")) {
sha1_len = 20;
sha1_len = 40;
continue;
} else if(!strcmp(argv[i], "-c") ||
!strcmp(argv[i], "--compability")) {
Expand Down Expand Up @@ -651,7 +651,9 @@ int main(int argc, const char **argv)
process_commits(&rev, filename, &initial);

buf = blame_contents;
max_digits = 1 + log(num_blame_lines+1)/log(10);
for (max_digits = 1, i = 10; i <= num_blame_lines + 1; max_digits++)
i *= 10;

for (i = 0; i < num_blame_lines; i++) {
struct commit *c = blame_lines[i];
if (!c)
Expand Down

0 comments on commit a0fb95e

Please sign in to comment.