diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-10-11 19:24:15 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-10-11 22:10:42 +0200 |
| commit | c4f64cf2556c0f8597e1fbc19d7c664b8da94612 (patch) | |
| tree | 67cf5324d089dc8bafa255a5580556ba44361b0d /tools/tool.h | |
| parent | 4668156da5915c8d7a7b40edaf6617b004547bd7 (diff) | |
| download | nissy-core-c4f64cf2556c0f8597e1fbc19d7c664b8da94612.tar.gz nissy-core-c4f64cf2556c0f8597e1fbc19d7c664b8da94612.zip | |
Added buffer sizes in API args
Diffstat (limited to 'tools/tool.h')
| -rw-r--r-- | tools/tool.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/tool.h b/tools/tool.h index 02ff0f2..2fc0224 100644 --- a/tools/tool.h +++ b/tools/tool.h | |||
| @@ -96,7 +96,7 @@ generatetable(const char *solver, char **buf) | |||
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | *buf = malloc(size); | 98 | *buf = malloc(size); |
| 99 | gensize = nissy_gendata(solver, *buf); | 99 | gensize = nissy_gendata(solver, size, *buf); |
| 100 | 100 | ||
| 101 | if (gensize != size) { | 101 | if (gensize != size) { |
| 102 | printf("Error generating table"); | 102 | printf("Error generating table"); |
| @@ -212,7 +212,7 @@ gendata_run( | |||
| 212 | case -2: | 212 | case -2: |
| 213 | goto gendata_run_finish; | 213 | goto gendata_run_finish; |
| 214 | default: | 214 | default: |
| 215 | nissy_datainfo(buf, write_stdout); | 215 | nissy_datainfo(size, buf, write_stdout); |
| 216 | printf("\n"); | 216 | printf("\n"); |
| 217 | printf("Succesfully generated %" PRId64 " bytes. " | 217 | printf("Succesfully generated %" PRId64 " bytes. " |
| 218 | "See above for details on the tables.\n", size); | 218 | "See above for details on the tables.\n", size); |
| @@ -237,6 +237,7 @@ derivedata_run( | |||
| 237 | int64_t size; | 237 | int64_t size; |
| 238 | char *buf; | 238 | char *buf; |
| 239 | 239 | ||
| 240 | buf = NULL; | ||
| 240 | size = derivetable(solver_large, solver_small, filename_large, &buf); | 241 | size = derivetable(solver_large, solver_small, filename_large, &buf); |
| 241 | switch (size) { | 242 | switch (size) { |
| 242 | case -1: | 243 | case -1: |
| @@ -244,7 +245,7 @@ derivedata_run( | |||
| 244 | case -2: | 245 | case -2: |
| 245 | goto derivedata_run_finish; | 246 | goto derivedata_run_finish; |
| 246 | default: | 247 | default: |
| 247 | nissy_datainfo(buf, write_stdout); | 248 | nissy_datainfo(size, buf, write_stdout); |
| 248 | printf("\n"); | 249 | printf("\n"); |
| 249 | printf("Succesfully generated %" PRId64 " bytes. " | 250 | printf("Succesfully generated %" PRId64 " bytes. " |
| 250 | "See above for details on the tables.\n", size); | 251 | "See above for details on the tables.\n", size); |
