From 1a329214f52e0e926d025c5954edd6423ba54348 Mon Sep 17 00:00:00 2001 From: Francesco Cozzuto Date: Fri, 14 Jan 2022 19:31:20 +0100 Subject: [PATCH] reorganized files --- time.c => benchmarks/time.c | 2 ++ build.sh | 5 ++--- lina.c => src/lina.c | 2 +- lina.h => src/lina.h | 0 test.c => tests/test.c | 0 test2.c => tests/test2.c | 0 6 files changed, 5 insertions(+), 4 deletions(-) rename time.c => benchmarks/time.c (96%) rename lina.c => src/lina.c (99%) rename lina.h => src/lina.h (100%) rename test.c => tests/test.c (100%) rename test2.c => tests/test2.c (100%) diff --git a/time.c b/benchmarks/time.c similarity index 96% rename from time.c rename to benchmarks/time.c index a2b827a..e5159aa 100644 --- a/time.c +++ b/benchmarks/time.c @@ -7,6 +7,8 @@ /* This program compares the lina_transpose ** implementation against the naive implementation. +** Build it with: +** $ gcc time.c lina.c -o time -Wall -Wextra -O3 */ #define check assert diff --git a/build.sh b/build.sh index 196d641..c8d3ed7 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,2 @@ -gcc test.c lina.c -o test -Wall -Wextra -g -gcc test2.c lina.c -o test2 -Wall -Wextra -g -gcc time.c lina.c -o time -Wall -Wextra -O3 \ No newline at end of file +gcc tests/test.c src/lina.c -o test -Wall -Wextra -g -Isrc/ +gcc tests/test2.c src/lina.c -o test2 -Wall -Wextra -g -Isrc/ diff --git a/lina.c b/src/lina.c similarity index 99% rename from lina.c rename to src/lina.c index e173195..b2fd407 100644 --- a/lina.c +++ b/src/lina.c @@ -191,7 +191,7 @@ static int scanValue(FILE *fp, char *buffer, int max_length, char first, char *f double *lina_loadMatrixFromStream(FILE *fp, int *width, int *height, char **error) { assert(width != NULL && height != NULL); - + if(fp == NULL) fp = stdin; diff --git a/lina.h b/src/lina.h similarity index 100% rename from lina.h rename to src/lina.h diff --git a/test.c b/tests/test.c similarity index 100% rename from test.c rename to tests/test.c diff --git a/test2.c b/tests/test2.c similarity index 100% rename from test2.c rename to tests/test2.c