Skip to content

Commit

Permalink
Clang-formated all files
Browse files Browse the repository at this point in the history
  • Loading branch information
FuturePhisicist committed Oct 31, 2024
1 parent 7ff8224 commit 846c40a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
printrandom
*.o
.clang-format

*.o
2 changes: 1 addition & 1 deletion linear.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

#include "random_source.h"

RandomSource *random_linear_factory(const char *params);
RandomSource *random_linear_factory(const char *params);
10 changes: 3 additions & 7 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,19 @@ main(int argc, char **argv)

const char *SEED = argv[3];
RandomSource *generator = fn(SEED);
if (generator == NULL)
{
if (generator == NULL) {
fprintf(stderr, "Error making generator\n");

goto emergency_exit;
}


for (int i = 0; i < n; ++i) {
printf("%.10g\n", generator->ops->next(generator));
}

generator = generator->ops->destroy(generator);

if (dlclose(handle) != 0)
{
if (dlclose(handle) != 0) {
fprintf(stderr, "Error closing shared object\n");

goto emergency_exit;
Expand All @@ -90,8 +87,7 @@ main(int argc, char **argv)
return EXIT_SUCCESS;

emergency_exit:
if (dlclose(handle) != 0)
{
if (dlclose(handle) != 0) {
fprintf(stderr, "Error closing shared object\n");
}

Expand Down
2 changes: 1 addition & 1 deletion mt.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

#include "random_source.h"

RandomSource *random_mt_factory(const char *params);
RandomSource *random_mt_factory(const char *params);
2 changes: 1 addition & 1 deletion random_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ typedef struct RandomSource
enum
{
DEC_RADIX = 10,
};
};

0 comments on commit 846c40a

Please sign in to comment.