diff options
| author | KunoiSayami <[email protected]> | 2023-05-28 17:31:57 +0800 |
|---|---|---|
| committer | KunoiSayami <[email protected]> | 2023-05-28 17:31:57 +0800 |
| commit | 44a035ec3ebb094adb162ba0c0d374a3fe153094 (patch) | |
| tree | 93f94e6129e0e222a0c6b74b1dcce7c6d39271cf /read_helper.h | |
| parent | 91ba3a5cc7703ae3ba37be3ad43692556177a0a7 (diff) | |
feat(exp): Remove useless arguments
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'read_helper.h')
| -rw-r--r-- | read_helper.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/read_helper.h b/read_helper.h index f12f4d9..eb7d2e3 100644 --- a/read_helper.h +++ b/read_helper.h @@ -2,12 +2,11 @@ #ifndef LOCKFREE_READ_HELPER_H #define LOCKFREE_READ_HELPER_H -#include <cassert> #include <cstdio> #include <random> #include <vector> -#ifndef P_EFF -#ifndef NDEBUG +#ifndef P_ERR +#if !(defined(NDEBUG) || defined(READ_NO_OUTPUT)) #define P_ERR(...) fprintf(stderr, __VA_ARGS__) #else #define P_ERR(...) @@ -62,7 +61,11 @@ public: this->population_vector.clear(); auto read_number = 0UL; FILE *file = fopen(filename, "r"); - assert(file); + if (file == nullptr) { + fprintf(stderr, "Unable to open file %s\n", filename); + exit(1); + } + P_ERR("Reading sample"); for (key_type i; read_number < sample_length && fscanf(file, "%lld ", &i) != EOF; |
