From 1120161286ee5c855b630bccc9e0b37bb8a3ee65 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Sat, 17 Oct 2020 19:07:11 -0400 Subject: Fix DIS coding style by running them all through clang-format Also fixes a missing header in DISstressmarkRNG.h and the "all" make target. No functional changes. --- dis/Transitive/DISstressmarkRNG.h | 1 + dis/Transitive/transitive.c | 103 ++++++++++++++++++-------------------- 2 files changed, 49 insertions(+), 55 deletions(-) (limited to 'dis/Transitive') diff --git a/dis/Transitive/DISstressmarkRNG.h b/dis/Transitive/DISstressmarkRNG.h index 4aa2620..6243606 100644 --- a/dis/Transitive/DISstressmarkRNG.h +++ b/dis/Transitive/DISstressmarkRNG.h @@ -1,3 +1,4 @@ +#include #include #define IA 16807 diff --git a/dis/Transitive/transitive.c b/dis/Transitive/transitive.c index 303216f..51805a6 100644 --- a/dis/Transitive/transitive.c +++ b/dis/Transitive/transitive.c @@ -1,12 +1,12 @@ /* * Sample code for the DIS Transitive Stressmark * - * This source code is the completely correct source code based on - * the example codes provided by Atlantic Aerospace Division, Titan + * This source code is the completely correct source code based on + * the example codes provided by Atlantic Aerospace Division, Titan * Systems Corporation, 2000. - * - * If you just compile and generate the executables from this source - * code, this code would be enough. However, if you wish to get a complete + * + * If you just compile and generate the executables from this source + * code, this code would be enough. However, if you wish to get a complete * understanding of this stressmark, it is strongly suggested that you * read the Benchmark Analysis and Specifications Document Version 1.0 * before going on since the detailed comments are given in this documents. @@ -16,12 +16,12 @@ * Joshua Bakita, 05/30/2020: Fixed out-of-bounds randInt call */ -#include -#include -#include -#include #include "DISstressmarkRNG.h" #include "extra.h" +#include +#include +#include +#include #define MIN_VERTICES 8 #define MAX_VERTICES 16384 @@ -34,11 +34,11 @@ #define MIN_EDGS 0 #define MAX_EDGE 255 -/* +/* * main() */ -int main(int argc, char** argv){ +int main(int argc, char **argv) { unsigned int *din, *dout; unsigned int n; unsigned int m; @@ -49,46 +49,46 @@ int main(int argc, char** argv){ unsigned int sum; volatile int realRes = 0; - assert(fscanf(stdin,"%d %d %d", &n, &m, &seed) == 3); + assert(fscanf(stdin, "%d %d %d", &n, &m, &seed) == 3); assert((n >= MIN_VERTICES) && (n <= MAX_VERTICES)); assert((m >= MIN_EDGES) && (m <= MAX_EDGES)); - assert(m <= n*n); + assert(m <= n * n); assert((seed >= MIN_SEED) && (seed <= MAX_SEED)); - if ((din = (unsigned int *)malloc(n*n*sizeof(unsigned int))) == NULL) - return (-1); - if ((dout = (unsigned int *)malloc(n*n*sizeof(unsigned int))) == NULL) - return (-1); + if ((din = (unsigned int *)malloc(n * n * sizeof(unsigned int))) == NULL) + return (-1); + if ((dout = (unsigned int *)malloc(n * n * sizeof(unsigned int))) == NULL) + return (-1); - for (i=0; i