small fixes in the code, mainly to ensure things work properly.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include <features.h>
|
||||
#if _POSIX_C_SOURCE >= 199309L
|
||||
# include <bits/time.h>
|
||||
# include <errno.h>
|
||||
# include <limits.h>
|
||||
#include <linux/time.h>
|
||||
# include <stdarg.h>
|
||||
# include <stdint.h>
|
||||
# include <stdio.h>
|
||||
@@ -31,7 +33,7 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
// if we have input; perform coin flips for those times
|
||||
for (uint32_t i = 1; i < argc; ++i) {
|
||||
for (uint32_t i = 1; i < (unsigned)argc; ++i) {
|
||||
int n = 0; // contains the random data
|
||||
uint64_t headsc = 0; // amount of heads
|
||||
uint64_t tailsc = 0; // amount of tails
|
||||
@@ -53,3 +55,6 @@ int main(int argc, char** argv) {
|
||||
printf("results:\n heads: %lu\n tails: %lu\n", headsc, tailsc);
|
||||
}
|
||||
}
|
||||
#else
|
||||
# error "platform unsupported"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user