# HG changeset patch # User Yasutaka Higa # Date 1450252336 -32400 # Node ID 2874954d97b25a6a607ebfbc41e00bb576c1a7ca # Parent d4bc23cb728b132923a4ff66fec22f06dfbc4a6c Fix dpp for cbc using LLVM 3.7 diff -r d4bc23cb728b -r 2874954d97b2 .hgignore --- a/.hgignore Wed Dec 16 15:16:11 2015 +0900 +++ b/.hgignore Wed Dec 16 16:52:16 2015 +0900 @@ -2,3 +2,6 @@ CVS* *.swp *.o +*.s + +dpp diff -r d4bc23cb728b -r 2874954d97b2 Makefile --- a/Makefile Wed Dec 16 15:16:11 2015 +0900 +++ b/Makefile Wed Dec 16 16:52:16 2015 +0900 @@ -1,7 +1,7 @@ -CC=gcc -MCC=mcc +CC=clang +MCC=cbc-clang TARGET=dpp dpp2 tableau tableau2 tableau3 -MCCFLAGS=-s +MCCFLAGS=-S CFLAGS=-I. -g -Wall .SUFFIXES: .cbc .c .o @@ -20,7 +20,7 @@ dpp2: dpp2.o queue.o scheduler.o memory.o crc32.o $(CC) $(CFLAGS) -o $@ $^ -# tableau expansion +# tableau expansion tableau: dpp2.o queue.o tableau.o memory.o state_db.o crc32.o $(CC) $(CFLAGS) -o $@ $^ diff -r d4bc23cb728b -r 2874954d97b2 dpp.cbc --- a/dpp.cbc Wed Dec 16 15:16:11 2015 +0900 +++ b/dpp.cbc Wed Dec 16 16:52:16 2015 +0900 @@ -6,41 +6,41 @@ #include "dpp.h" -code putdown_lfork(PhilsPtr self) +__code putdown_lfork(PhilsPtr self) { printf("%d: putdown_lfork:%d\n", self->id, self->left_fork->id); self->left_fork->owner = NULL; goto thinking(self); } -code putdown_rfork(PhilsPtr self) +__code putdown_rfork(PhilsPtr self) { printf("%d: putdown_rfork:%d\n", self->id, self->right_fork->id); self->right_fork->owner = NULL; goto putdown_lfork(self); } -code eating(PhilsPtr self) +__code eating(PhilsPtr self) { printf("%d: eating\n", self->id); goto putdown_rfork(self); } /* waiting for right fork */ -code hungry2(PhilsPtr self) +__code hungry2(PhilsPtr self) { printf("%d: hungry2\n", self->id); goto pickup_rfork(self); } /* waiting for left fork */ -code hungry1(PhilsPtr self) +__code hungry1(PhilsPtr self) { printf("%d: hungry1\n", self->id); goto pickup_lfork(self); } -code pickup_rfork(PhilsPtr self) +__code pickup_rfork(PhilsPtr self) { if (self->right_fork->owner == NULL) { printf("%d: pickup_rfork:%d\n", self->id, self->right_fork->id); @@ -51,7 +51,7 @@ } } -code pickup_lfork(PhilsPtr self) +__code pickup_lfork(PhilsPtr self) { if (self->left_fork->owner == NULL) { printf("%d: pickup_lfork:%d\n", self->id, self->left_fork->id); @@ -62,7 +62,7 @@ } } -code thinking(PhilsPtr self) +__code thinking(PhilsPtr self) { printf("%d: thinking\n", self->id); goto hungry1(self); diff -r d4bc23cb728b -r 2874954d97b2 dpp.h --- a/dpp.h Wed Dec 16 15:16:11 2015 +0900 +++ b/dpp.h Wed Dec 16 16:52:16 2015 +0900 @@ -4,13 +4,13 @@ #include "dpp_common.h" -extern code putdown_lfork(PhilsPtr self); -extern code putdown_rfork(PhilsPtr self); -extern code eating(PhilsPtr self); -extern code hungry2(PhilsPtr self); -extern code hungry1(PhilsPtr self); -extern code pickup_rfork(PhilsPtr self); -extern code pickup_lfork(PhilsPtr self); -extern code thinking(PhilsPtr self); +extern __code putdown_lfork(PhilsPtr self); +extern __code putdown_rfork(PhilsPtr self); +extern __code eating(PhilsPtr self); +extern __code hungry2(PhilsPtr self); +extern __code hungry1(PhilsPtr self); +extern __code pickup_rfork(PhilsPtr self); +extern __code pickup_lfork(PhilsPtr self); +extern __code thinking(PhilsPtr self); #endif