Skip to content

Commit

Permalink
Fix printf format string warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnoel committed Dec 2, 2023
1 parent 6fdc457 commit 44123c1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/df1b2-separable/df1b2im5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ double calculate_importance_sample_block_diagonal_option_antithetical
//int offset=0;
for (int ic=1;ic<=nsc;ic++)
{
int lus=lrea(ic);
//int lus=lrea(ic);
// assumes that all spearable calls have the same number of
// random effects
dvector e= (*pmin->lapprox->antiepsilon)(is);
Expand Down
4 changes: 2 additions & 2 deletions src/linad99/fmmtr1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void fmmt1::fmin(const double& _f, const dvector & _x, const dvector& _g)
label7003:
if (iprint!=0)
{
printf("%d variables; iteration %ld; function evaluation %ld\n",
printf("%d variables; iteration %d; function evaluation %ld\n",
n, itn, ifn);
printf("Function value %12.4le; maximum gradient component mag %12.4le\n",
f, gmax);
Expand Down Expand Up @@ -503,7 +503,7 @@ label21 :
}
if(iprint == 0) goto label777;
printf(" - final statistics:\n");
printf("%d variables; iteration %ld; function evaluation %ld\n",
printf("%d variables; iteration %d; function evaluation %ld\n",
n, itn, ifn);
printf("Function value %12.4le; maximum gradient component mag %12.4le\n",
f, gmax);
Expand Down
4 changes: 2 additions & 2 deletions src/linad99/newfmin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ void fmm::fmin(const double& _f, const dvector &_x, const dvector& _g)
adstring maxparname = get_maxparname(maxpar);
if (itn % iprint == 0)
{
printf("phase=%2d | nvar=%3d | iter=%3d | nll=%.2e | mag=%.2e | par[%3d]=%s\n",
printf("phase=%2d | nvar=%3d | iter=%3ld | nll=%.2e | mag=%.2e | par[%3d]=%s\n",
initial_params::current_phase, n, itn, double(f), fabs(double(gmax)), maxpar, (char*)maxparname);
}
}
Expand Down Expand Up @@ -993,7 +993,7 @@ if (iprint>0)
int maxpar = get_maxpar(g);
adstring maxparname = get_maxparname(maxpar);
if(iprint>0)
printf("phase=%2d | nvar=%3d | iter=%3d | nll=%.2e | mag=%.2e | par[%3d]=%s\n",
printf("phase=%2d | nvar=%3d | iter=%3ld | nll=%.2e | mag=%.2e | par[%3d]=%s\n",
initial_params::current_phase, n, itn, double(f), fabs(double(gmax)), maxpar, (char*)maxparname);

// only print global stuff if in last phase
Expand Down
8 changes: 4 additions & 4 deletions src/nh99/lmnewton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void function_minimizer::limited_memory_quasi_newton(
}

printf(
"%d variables; iteration %ld; function evaluation %ld\n",
"%d variables; iteration %d; function evaluation %d\n",
nvar, itn, ifn);

if (!itn)
Expand Down Expand Up @@ -215,7 +215,7 @@ void function_minimizer::limited_memory_quasi_newton(
printf("\nfinal statistics: ");

printf(
"%d variables; iteration %ld; function evaluation %ld\n",
"%d variables; iteration %d; function evaluation %d\n",
nvar, itn, ifn);
printf(
"Function value %12.4le; maximum gradient component mag %12.4le\n",
Expand Down Expand Up @@ -319,7 +319,7 @@ void function_minimizer::limited_memory_quasi_newton
}

printf(
"%d variables; iteration %ld; function evaluation %ld\n",
"%d variables; iteration %d; function evaluation %d\n",
nvar, itn, ifn);

if (!itn)
Expand Down Expand Up @@ -367,7 +367,7 @@ void function_minimizer::limited_memory_quasi_newton
if (iprint>0)
{
printf("\nfinal statistics: ");
printf("%d variables; iteration %ld; function evaluation %ld\n",
printf("%d variables; iteration %d; function evaluation %d\n",
nvar, itn, ifn);
printf(
"Function value %12.4le; maximum gradient component mag %12.4le\n",
Expand Down
4 changes: 2 additions & 2 deletions src/nh99/randeff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ dvariable function_minimizer::random_effects_maximization(const dvar_vector& _x)
printf("\nIntermediate statistics: ");
}

printf("%d variables; iteration %ld; function evaluation %ld\n",
printf("%d variables; iteration %d; function evaluation %d\n",
nvar, itn, ifn);

if (!itn)
Expand Down Expand Up @@ -220,7 +220,7 @@ dvariable function_minimizer::random_effects_maximization(const dvar_vector& _x)
double xf=value(f);
double xg=max(value(g));
printf("\nfinal statistics: ");
printf("%d variables; iteration %ld; function evaluation %ld\n",
printf("%d variables; iteration %d; function evaluation %d\n",
nvar, itn, ifn);
printf(
"Function value %12.4le; maximum gradient component mag %12.4le\n",
Expand Down

0 comments on commit 44123c1

Please sign in to comment.