tUse fprintf instead of dprintf to suppress warnings on linux - cngf-pf - continuum model for granular flows with pore-pressure dynamics (renamed from 1d_fd_simple_shear)
HTML git clone git://src.adamsgaard.dk/cngf-pf
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 7e9abfc893a8e6fbb4e1a9bd83669a41c484fd8d
DIR parent fec480511e3311648d8d56575bbc37bfcc6e1c44
HTML Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 2 Apr 2020 10:08:23 +0200
Use fprintf instead of dprintf to suppress warnings on linux
Diffstat:
M 1d_fd_simple_shear.c | 10 +++++-----
M max_depth_simple_shear.c | 2 +-
M shear_flux.c | 2 +-
M simulation.c | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
---
DIR diff --git a/1d_fd_simple_shear.c b/1d_fd_simple_shear.c
t@@ -32,7 +32,7 @@ struct simulation sim;
static void
usage(void)
{
- dprintf(2, "usage: %s "
+ fprintf(stderr, "usage: %s "
"[-A grain-nonlocal-ampl] "
"[-a fluid-pressure-ampl] "
"[-b grain-rate-dependence] "
t@@ -86,7 +86,7 @@ main(int argc, char* argv[])
#ifdef __OpenBSD__
if (pledge("stdio wpath cpath", NULL) == -1) {
- dprintf(2, "error: pledge failed");
+ fprintf(stderr, "error: pledge failed");
exit(1);
}
#endif
t@@ -188,7 +188,7 @@ main(int argc, char* argv[])
else if (!strncmp(argv[1], "square", 6))
sim.p_f_mod_pulse_shape = 1;
else {
- dprintf(2, "error: invalid pulse shape '%s'\n",
+ fprintf(stderr, "error: invalid pulse shape '%s'\n",
argv[1]);
return 1;
}
t@@ -292,8 +292,8 @@ main(int argc, char* argv[])
}
if (++stressiter > MAX_ITER_STRESS) {
- dprintf(2, "error: stress solution did not converge:\n");
- dprintf(2, "v_x=%g, v_x_fix=%g, v_x_limit=%g, "
+ fprintf(stderr, "error: stress solution did not converge:\n");
+ fprintf(stderr, "v_x=%g, v_x_fix=%g, v_x_limit=%g, "
"res_norm=%g, mu_wall=%g\n",
sim.v_x[sim.nz-1], sim.v_x_fix, sim.v_x_limit,
res_norm, sim.mu_wall);
DIR diff --git a/max_depth_simple_shear.c b/max_depth_simple_shear.c
t@@ -28,7 +28,7 @@ struct simulation sim;
static void
usage(void)
{
- dprintf(2, "usage: %s "
+ fprintf(stderr, "usage: %s "
"[-a fluid-pressure-ampl] "
"[-C fluid-compressibility] "
"[-g gravity-accel] "
DIR diff --git a/shear_flux.c b/shear_flux.c
t@@ -10,7 +10,7 @@ char *argv0;
static void
usage(void)
{
- dprintf(2, "usage: %s "
+ fprintf(stderr, "usage: %s "
"[-v] "
"[-h] "
"[file ...] "
DIR diff --git a/simulation.c b/simulation.c
t@@ -500,7 +500,7 @@ write_output_file(const int normalize)
print_output(fp, normalize);
fclose(fp);
} else {
- dprintf(2, "could not open output file: %s", outfile);
+ fprintf(stderr, "could not open output file: %s", outfile);
exit(1);
}
}