リビジョン | db481e755ad34c73cd77ad6b42f2100026cbd8c3 (tree) |
---|---|
日時 | 2019-03-05 23:01:22 |
作者 | dhrname <dhrname@user...> |
コミッター | dhrname |
Modify the Makefile
@@ -2,8 +2,7 @@ CC = gcc | ||
2 | 2 | DEBUGMODE = -Wall -std=c11 -O0 -g -pg |
3 | 3 | NODEBUGMODE = -Wall -std=c11 -O2 |
4 | 4 | SHELL = /bin/sh |
5 | -.SUFFIXES: | |
6 | -.SUFFIXES: .c .o | |
5 | +HEADERS = shadowstar.h star.h orderedpair/exception.h orderedpair/pair.h orderedpair/list/item.h orderedpair/list/tree/btree.h orderedpair/list/tree/nodelist/ntree.h | |
7 | 6 | |
8 | 7 | all : startest star |
9 | 8 | .PHONY : all |
@@ -11,15 +10,13 @@ all : startest star | ||
11 | 10 | %.o : %.c |
12 | 11 | $(CC) $(NODEBUGMODE) -c $< -o $@ |
13 | 12 | |
14 | -star.o: star.c shadowstar.h star.h orderedpair/exception.h orderedpair/pair.h orderedpair/list/item.h orderedpair/list/tree/btree.h orderedpair/list/tree/nodelist/ntree.h | |
13 | +star.o: $(HEADERS) | |
15 | 14 | |
16 | -shadowstar.o: shadowstar.c shadowstar.h star.h orderedpair/exception.h orderedpair/pair.h orderedpair/list/item.h orderedpair/list/tree/btree.h orderedpair/list/tree/nodelist/ntree.h | |
15 | +shadowstar.o: $(HEADERS) | |
17 | 16 | |
18 | 17 | star: shadowstar.o star.o |
19 | 18 | $(CC) $(NODEBUGMODE) -o ../$@ shadowstar.o star.o |
20 | 19 | |
21 | -startest.o: startest.c | |
22 | - | |
23 | 20 | startest: shadowstar.o startest.o |
24 | 21 | $(CC) $(NODEBUGMODE) -o ../$@ shadowstar.o startest.o |
25 | 22 |
@@ -1359,6 +1359,11 @@ static inline ST_Token_Mode* alloca_tokens(uint_fast64_t filelength) | ||
1359 | 1359 | return s; |
1360 | 1360 | } |
1361 | 1361 | |
1362 | +static inline uint64_t pair (uint64_t x, uint64_t y) | |
1363 | +{ | |
1364 | + return (((x+y) * (x+y+1) / 2 ) + x + 1); | |
1365 | +} | |
1366 | + | |
1362 | 1367 | /*ST_main 関数 |
1363 | 1368 | * 引数sはソースコードの文字列。 |
1364 | 1369 | * 引数filelengthはsの長さ |
@@ -32,3 +32,5 @@ | ||
32 | 32 | #include "orderedpair/list/item.h" |
33 | 33 | |
34 | 34 | #include "orderedpair/list/tree/nodelist/ntree.h" |
35 | + | |
36 | +#include "class/class.h" |
@@ -819,6 +819,14 @@ printf("\n%d\n", i); | ||
819 | 819 | che = "testsuite/f.st"; |
820 | 820 | assert( tests_file_length == ST_readFile(che, tests_callback_file) ); |
821 | 821 | ST_readFile(che, ST_main); |
822 | + tests_file_length = 0; | |
823 | + che = "testsuite/g.st"; | |
824 | + assert( tests_file_length == ST_readFile(che, tests_callback_file) ); | |
825 | + ST_readFile(che, ST_main); | |
826 | + tests_file_length = 0; | |
827 | + che = "testsuite/h.st"; | |
828 | + assert( tests_file_length == ST_readFile(che, tests_callback_file) ); | |
829 | + ST_readFile(che, ST_main); | |
822 | 830 | |
823 | 831 | elapsed = clock() - before; |
824 | 832 | printf("Time is %.3f seconds\n", elapsed/CLOCKS_PER_SEC); |