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/Neighborhood/neighborhood.c | 77 +++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 45 deletions(-) (limited to 'dis/Neighborhood/neighborhood.c') diff --git a/dis/Neighborhood/neighborhood.c b/dis/Neighborhood/neighborhood.c index 23f3a8e..614b8e8 100644 --- a/dis/Neighborhood/neighborhood.c +++ b/dis/Neighborhood/neighborhood.c @@ -1,12 +1,12 @@ /* * Sample code for the DIS Neighborhood 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. @@ -17,19 +17,18 @@ * 06/2020 Joshua Bakita Include image creation time in timing */ +#include "DISstressmarkRNG.h" +#include "extra.h" +#include "utili.h" +#include #include #include #include -#include -#include "DISstressmarkRNG.h" -#include "utili.h" -#include "extra.h" -/* +/* * main() */ -int main(int argc, char** argv) -{ +int main(int argc, char **argv) { long int seed; int dimension; int numberLines; @@ -46,10 +45,9 @@ int main(int argc, char** argv) time_t endTime; SET_UP - assert(fscanf(stdin, "%ld %d %d %d %d %d %d %d", - &seed, &bitDepth, &dimension, &numberLines, - &minThickness, &maxThickness, - &distanceShort, &distanceLong) == 8); + assert(fscanf(stdin, "%ld %d %d %d %d %d %d %d", &seed, &bitDepth, &dimension, + &numberLines, &minThickness, &maxThickness, &distanceShort, + &distanceLong) == 8); assert((seed >= MIN_SEED) && (seed <= MAX_SEED)); assert((dimension > 0) && (dimension <= MAX_DIMENSION)); @@ -67,43 +65,32 @@ int main(int argc, char** argv) beginTime = time(NULL); START_LOOP - createImage(image, dimension, maxPixel, numberLines, - minThickness, maxThickness); + createImage(image, dimension, maxPixel, numberLines, minThickness, + maxThickness); - neighborhoodCalculation(image, dimension, - distanceShort, distanceLong, &values, maxPixel); + neighborhoodCalculation(image, dimension, distanceShort, distanceLong, + &values, maxPixel); STOP_LOOP endTime = time(NULL); WRITE_TO_FILE -// printf(" end time is %d\n", endTime); + // printf(" end time is %d\n", endTime); - fprintf(stdout, "%9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e", - values.distShort.deg0.entropy, - values.distShort.deg0.energy, - values.distShort.deg45.entropy, - values.distShort.deg45.energy, - values.distShort.deg90.entropy, - values.distShort.deg90.energy, - values.distShort.deg135.entropy, - values.distShort.deg135.energy); + fprintf(stdout, "%9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e", + values.distShort.deg0.entropy, values.distShort.deg0.energy, + values.distShort.deg45.entropy, values.distShort.deg45.energy, + values.distShort.deg90.entropy, values.distShort.deg90.energy, + values.distShort.deg135.entropy, values.distShort.deg135.energy); - fprintf(stdout,"%9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e", - values.distLong.deg0.entropy, - values.distLong.deg0.energy,values.distShort.deg45.entropy, - values.distLong.deg45.energy, - values.distLong.deg90.entropy, - values.distLong.deg90.energy, - values.distLong.deg135.entropy, - values.distLong.deg135.energy); + fprintf(stdout, "%9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e", + values.distLong.deg0.entropy, values.distLong.deg0.energy, + values.distShort.deg45.entropy, values.distLong.deg45.energy, + values.distLong.deg90.entropy, values.distLong.deg90.energy, + values.distLong.deg135.entropy, values.distLong.deg135.energy); fprintf(stderr, "time for neghborhood stressmark = %f seconds.\n", - difftime(endTime, beginTime)); - + difftime(endTime, beginTime)); + free((Pixel *)image); return (SUCCESS); - } - - - - +} -- cgit v1.2.2