Skip to content

Commit d5b90d4

Browse files
committed
some tweaks
1 parent a3e141e commit d5b90d4

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

Diff for: GNUmakefile.in

+7-1
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,18 @@ TEST_EXE= $(patsubst %,%@EXEEXT@,$(TEST_TGT))
8282

8383
ALL_EXE= $(MAIN_EXE) $(UTIL_EXE) $(TEST_EXE)
8484

85-
.PHONY: default all clean distclean depend
85+
.PHONY: default all main util test clean distclean depend
8686

8787
default: $(MAIN_EXE)
8888

8989
all: $(ALL_EXE)
9090

91+
main: $(MAIN_EXE)
92+
93+
util: $(UTIL_EXE)
94+
95+
test: $(TEST_EXE)
96+
9197
mkp224o@EXEEXT@: $(MAIN_OBJ)
9298
$(CC) $(LDFLAGS) $(CFLAGS) -o $@.tmp $^ $(MAIN_LIB) && $(MV) $@.tmp $@
9399

Diff for: calcest.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <stdio.h>
2+
#include <stddef.h>
23
#include <math.h>
34

45
/*
@@ -19,20 +20,20 @@ const int charcounts[] = { 2, 3, 4, 5, 6, 7 };
1920
int main(void)
2021
{
2122
printf(" |");
22-
for (int i = 0; i < sizeof(probs)/sizeof(probs[0]); ++i) {
23+
for (size_t i = 0; i < sizeof(probs)/sizeof(probs[0]); ++i) {
2324
printf(" %11d%% |",(int)((probs[i]*100)+0.5));
2425
}
2526
printf("\n");
2627

2728
printf("---+");
28-
for (int i = 0; i < sizeof(probs)/sizeof(probs[0]); ++i) {
29+
for (size_t i = 0; i < sizeof(probs)/sizeof(probs[0]); ++i) {
2930
printf("--------------+");
3031
}
3132
printf("\n");
3233

33-
for (int i = 0; i < sizeof(charcounts)/sizeof(charcounts[0]); ++i) {
34+
for (size_t i = 0; i < sizeof(charcounts)/sizeof(charcounts[0]); ++i) {
3435
printf("%2d |",charcounts[i]);
35-
for (int j = 0; j < sizeof(probs)/sizeof(probs[0]); ++j) {
36+
for (size_t j = 0; j < sizeof(probs)/sizeof(probs[0]); ++j) {
3637
double t = log2(1 - probs[j]) / log2(1 - (1 / pow(32,charcounts[i])));
3738
printf(" %12.0f |",t);
3839
}

0 commit comments

Comments
 (0)