diff options
| author | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-19 01:09:53 -0400 |
|---|---|---|
| committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-19 01:09:53 -0400 |
| commit | a71fc97fd262e1b5770f827047ea60bbaf38d9a2 (patch) | |
| tree | b45ef48c63a35817f2db93dd2fec718778f58b99 /all_pairs/source | |
| parent | 41358857592f1908d0c0f9898b6c9acabc1ad161 (diff) | |
Unify all the versions of extra.h into a single multipurpose header
There was previously a huge amount of shared code that had to be
copied back and forth. This should reduce the maintenance burden
by containing all future changes to a single file.
New unified library is fully backwards-compatible but also
introduces and the easy-to-use `for_each_job` macro which
replaces the specific `for(...) START_LOOP ... STOP_LOOP`
format requirement and is generally much harder to abuse.
New unified library also automatically cleans up its shared memory
and semaphores, so this commit also removes the separate
`cleanupSemaphores` binary.
I also found a precursor of `extra.h` written by Sims in
`litmusStuff.h`. This code is only interesting for historical
purposes, so it is also removed in this commit.
This commit also adds debug options to all the Makefiles and
silences rm's complaints about non-existent files in make clean.
Diffstat (limited to 'all_pairs/source')
26 files changed, 24 insertions, 241 deletions
diff --git a/all_pairs/source/adpcm_dec/adpcm_dec.c b/all_pairs/source/adpcm_dec/adpcm_dec.c index 04a5746..368e98d 100644 --- a/all_pairs/source/adpcm_dec/adpcm_dec.c +++ b/all_pairs/source/adpcm_dec/adpcm_dec.c | |||
| @@ -35,7 +35,7 @@ | |||
| 35 | Forward declaration of functions | 35 | Forward declaration of functions |
| 36 | */ | 36 | */ |
| 37 | 37 | ||
| 38 | #include "../extra.h" | 38 | #include "extra.h" |
| 39 | 39 | ||
| 40 | void adpcm_dec_decode( int ); | 40 | void adpcm_dec_decode( int ); |
| 41 | int adpcm_dec_filtez( int *bpl, int *dlt ); | 41 | int adpcm_dec_filtez( int *bpl, int *dlt ); |
diff --git a/all_pairs/source/adpcm_enc/adpcm_enc.c b/all_pairs/source/adpcm_enc/adpcm_enc.c index 464768f..777aaf5 100644 --- a/all_pairs/source/adpcm_enc/adpcm_enc.c +++ b/all_pairs/source/adpcm_enc/adpcm_enc.c | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | 29 | ||
| 30 | /* common sampling rate for sound cards on IBM/PC */ | 30 | /* common sampling rate for sound cards on IBM/PC */ |
| 31 | 31 | ||
| 32 | #include "../extra.h" | 32 | #include "extra.h" |
| 33 | #define SAMPLE_RATE 11025 | 33 | #define SAMPLE_RATE 11025 |
| 34 | 34 | ||
| 35 | #define PI 3141 | 35 | #define PI 3141 |
diff --git a/all_pairs/source/ammunition/ammunition.c b/all_pairs/source/ammunition/ammunition.c index 269f4c0..052520e 100644 --- a/all_pairs/source/ammunition/ammunition.c +++ b/all_pairs/source/ammunition/ammunition.c | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | */ | 25 | */ |
| 26 | 26 | ||
| 27 | #include "../extra.h" | 27 | #include "extra.h" |
| 28 | #include "bits.h" | 28 | #include "bits.h" |
| 29 | #include "arithm.h" | 29 | #include "arithm.h" |
| 30 | #include "ammunition_stdlib.h" | 30 | #include "ammunition_stdlib.h" |
diff --git a/all_pairs/source/anagram/anagram.c b/all_pairs/source/anagram/anagram.c index b458fd2..5c1f29a 100644 --- a/all_pairs/source/anagram/anagram.c +++ b/all_pairs/source/anagram/anagram.c | |||
| @@ -157,7 +157,7 @@ | |||
| 157 | steps to FindAnagram. | 157 | steps to FindAnagram. |
| 158 | */ | 158 | */ |
| 159 | 159 | ||
| 160 | #include "../extra.h" | 160 | #include "extra.h" |
| 161 | #include "anagram_ctype.h" | 161 | #include "anagram_ctype.h" |
| 162 | #include "anagram_stdlib.h" | 162 | #include "anagram_stdlib.h" |
| 163 | #include "anagram_strings.h" | 163 | #include "anagram_strings.h" |
diff --git a/all_pairs/source/audiobeam/audiobeam.c b/all_pairs/source/audiobeam/audiobeam.c index 208de80..50ebfff 100644 --- a/all_pairs/source/audiobeam/audiobeam.c +++ b/all_pairs/source/audiobeam/audiobeam.c | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | Include section | 23 | Include section |
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #include "../extra.h" | 26 | #include "extra.h" |
| 27 | #include "audiobeamlibm.h" | 27 | #include "audiobeamlibm.h" |
| 28 | #include "audiobeamlibmalloc.h" | 28 | #include "audiobeamlibmalloc.h" |
| 29 | #include "audiobeam.h" | 29 | #include "audiobeam.h" |
diff --git a/all_pairs/source/cjpeg_transupp/cjpeg_transupp.c b/all_pairs/source/cjpeg_transupp/cjpeg_transupp.c index 3f48539..5ec7e5e 100644 --- a/all_pairs/source/cjpeg_transupp/cjpeg_transupp.c +++ b/all_pairs/source/cjpeg_transupp/cjpeg_transupp.c | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | Include section | 29 | Include section |
| 30 | */ | 30 | */ |
| 31 | 31 | ||
| 32 | #include "../extra.h" | 32 | #include "extra.h" |
| 33 | #include "jpeglib.h" | 33 | #include "jpeglib.h" |
| 34 | 34 | ||
| 35 | 35 | ||
diff --git a/all_pairs/source/cjpeg_wrbmp/cjpeg_wrbmp.c b/all_pairs/source/cjpeg_wrbmp/cjpeg_wrbmp.c index 278725c..3c8d7ec 100644 --- a/all_pairs/source/cjpeg_wrbmp/cjpeg_wrbmp.c +++ b/all_pairs/source/cjpeg_wrbmp/cjpeg_wrbmp.c | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | */ | 25 | */ |
| 26 | 26 | ||
| 27 | #include "../extra.h" | 27 | #include "extra.h" |
| 28 | #include "cdjpeg.h" | 28 | #include "cdjpeg.h" |
| 29 | 29 | ||
| 30 | #ifdef CJPEG_WRBMP_BMP_SUPPORTED | 30 | #ifdef CJPEG_WRBMP_BMP_SUPPORTED |
diff --git a/all_pairs/source/cleanupSemaphores.c b/all_pairs/source/cleanupSemaphores.c deleted file mode 100644 index dde2bb3..0000000 --- a/all_pairs/source/cleanupSemaphores.c +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #include <semaphore.h> | ||
| 2 | |||
| 3 | int main(){ | ||
| 4 | sem_unlink("/firstTacleSem"); | ||
| 5 | sem_unlink("/secondTacleSem"); | ||
| 6 | } | ||
diff --git a/all_pairs/source/dijkstra/dijkstra.c b/all_pairs/source/dijkstra/dijkstra.c index 1b6a52f..333fd43 100644 --- a/all_pairs/source/dijkstra/dijkstra.c +++ b/all_pairs/source/dijkstra/dijkstra.c | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | */ | 18 | */ |
| 19 | 19 | ||
| 20 | #include "../extra.h" | 20 | #include "extra.h" |
| 21 | #include "input.h" | 21 | #include "input.h" |
| 22 | 22 | ||
| 23 | /* | 23 | /* |
diff --git a/all_pairs/source/empty.c b/all_pairs/source/empty.c index c7c5f5d..6681ba7 100644 --- a/all_pairs/source/empty.c +++ b/all_pairs/source/empty.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | #include "../extra.h" | 1 | #include "extra.h" |
| 2 | 2 | ||
| 3 | int main(int argc, char **argv) | 3 | int main(int argc, char **argv) |
| 4 | { | 4 | { |
diff --git a/all_pairs/source/epic/epic.c b/all_pairs/source/epic/epic.c index e258a4a..a1e344c 100644 --- a/all_pairs/source/epic/epic.c +++ b/all_pairs/source/epic/epic.c | |||
| @@ -35,7 +35,7 @@ | |||
| 35 | */ | 35 | */ |
| 36 | 36 | ||
| 37 | 37 | ||
| 38 | #include "../extra.h" | 38 | #include "extra.h" |
| 39 | #include "epic.h" | 39 | #include "epic.h" |
| 40 | 40 | ||
| 41 | #define X_SIZE 64 | 41 | #define X_SIZE 64 |
diff --git a/all_pairs/source/extra.h b/all_pairs/source/extra.h deleted file mode 100644 index 0681250..0000000 --- a/all_pairs/source/extra.h +++ /dev/null | |||
| @@ -1,211 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * Copyright 2019 Sims Hill Osborne and Joshua Bakita | ||
| 3 | * | ||
| 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 5 | * of this software and associated documentation files (the "Software"), to deal | ||
| 6 | * in the Software without restriction, including without limitation the rights | ||
| 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 8 | * copies of the Software, and to permit persons to whom the Software is | ||
| 9 | * furnished to do so, subject to the following conditions: | ||
| 10 | * | ||
| 11 | * The above copyright notice and this permission notice shall be included in | ||
| 12 | * all copies or substantial portions of the Software. | ||
| 13 | * | ||
| 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 17 | |||
