Skip to content

Commit 9e3ccfd

Browse files
committed
Update
1 parent 4925e48 commit 9e3ccfd

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

examples/benchmark_read.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ double compute_variance(double* x, size_t n) {
4242

4343
void flush_cache() {
4444
#ifdef __APPLE__
45-
system("bash -c \"sync && sudo purge\"");
45+
int rv = system("bash -c \"sync && sudo purge\"");
4646
#elif __linux__
47-
system("bash -c \"sync\" && sudo sh -c \"/usr/bin/echo 3 > "
48-
"/proc/sys/vm/drop_caches\"");
47+
int rv = system("bash -c \"sync\" && sudo sh -c \"/usr/bin/echo 3 > "
48+
"/proc/sys/vm/drop_caches\"");
4949
#else
5050
static_assert(false);
5151
#endif

examples/benchmark_read_parallel.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ double compute_variance(double* x, size_t n) {
4242

4343
void flush_cache() {
4444
#ifdef __APPLE__
45-
system("bash -c \"sync && sudo purge\"");
45+
int rv = system("bash -c \"sync && sudo purge\"");
4646
#elif __linux__
47-
system("bash -c \"sync\" && sudo sh -c \"/usr/bin/echo 3 > "
48-
"/proc/sys/vm/drop_caches\"");
47+
int rv = system("bash -c \"sync\" && sudo sh -c \"/usr/bin/echo 3 > "
48+
"/proc/sys/vm/drop_caches\"");
4949
#else
5050
static_assert(false);
5151
#endif

examples/benchmark_write.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ double compute_variance(double* x, size_t n) {
4242

4343
void flush_cache() {
4444
#ifdef __APPLE__
45-
system("bash -c \"sync && sudo purge\"");
45+
int rv = system("bash -c \"sync && sudo purge\"");
4646
#elif __linux__
47-
system("bash -c \"sync\" && sudo sh -c \"/usr/bin/echo 3 > "
48-
"/proc/sys/vm/drop_caches\"");
47+
int rv = system("bash -c \"sync\" && sudo sh -c \"/usr/bin/echo 3 > "
48+
"/proc/sys/vm/drop_caches\"");
4949
#else
5050
static_assert(false);
5151
#endif
@@ -54,9 +54,9 @@ void flush_cache() {
5454

5555
void flush_writes() {
5656
#ifdef __APPLE__
57-
system("bash -c \"sync\"");
57+
int rv = system("bash -c \"sync\"");
5858
#elif __linux__
59-
system("bash -c \"sync\"");
59+
int rv = system("bash -c \"sync\"");
6060
#else
6161
static_assert(false);
6262
#endif
@@ -65,7 +65,7 @@ void flush_writes() {
6565
void delete_file(char* file_name) {
6666
char command[2048];
6767
snprintf(command, 2047, "rm %s", file_name);
68-
system(command);
68+
int rv = system(command);
6969
}
7070

7171
int main(int argc, char** argv) {

include/binsparse/detail/shm_tools.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include <stddef.h>
4+
#include <stdio.h>
45
#include <sys/ipc.h>
56
#include <sys/shm.h>
67
#include <sys/stat.h>

include/binsparse/matrix_market/matrix_market_inspector.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ bsp_mm_metadata bsp_mmread_metadata(char* file_path) {
3333

3434
bsp_mm_metadata metadata;
3535

36-
fscanf(f, "%%%%MatrixMarket matrix %s %s %s\n", metadata.format,
37-
metadata.type, metadata.structure);
36+
int read_items = fscanf(f, "%%%%MatrixMarket matrix %s %s %s\n",
37+
metadata.format, metadata.type, metadata.structure);
38+
39+
assert(read_items == 3);
3840

3941
for (size_t i = 0; i < strlen(metadata.structure); i++) {
4042
metadata.structure[i] = tolower(metadata.structure[i]);

0 commit comments

Comments
 (0)