From 44123c1d28ea107052100a6c4ec9d9fb8d728010 Mon Sep 17 00:00:00 2001 From: johnoel Date: Fri, 1 Dec 2023 14:46:06 -1000 Subject: [PATCH] Fix printf format string warnings. --- src/df1b2-separable/df1b2im5.cpp | 2 +- src/linad99/fmmtr1.cpp | 4 ++-- src/linad99/newfmin.cpp | 4 ++-- src/nh99/lmnewton.cpp | 8 ++++---- src/nh99/randeff.cpp | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/df1b2-separable/df1b2im5.cpp b/src/df1b2-separable/df1b2im5.cpp index 6145ef928..90c42220c 100644 --- a/src/df1b2-separable/df1b2im5.cpp +++ b/src/df1b2-separable/df1b2im5.cpp @@ -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); diff --git a/src/linad99/fmmtr1.cpp b/src/linad99/fmmtr1.cpp index 81eabb762..57492e19c 100644 --- a/src/linad99/fmmtr1.cpp +++ b/src/linad99/fmmtr1.cpp @@ -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); @@ -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); diff --git a/src/linad99/newfmin.cpp b/src/linad99/newfmin.cpp index 676644043..aa73b9e3e 100644 --- a/src/linad99/newfmin.cpp +++ b/src/linad99/newfmin.cpp @@ -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); } } @@ -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 diff --git a/src/nh99/lmnewton.cpp b/src/nh99/lmnewton.cpp index b3f9f29a6..b12bade5b 100644 --- a/src/nh99/lmnewton.cpp +++ b/src/nh99/lmnewton.cpp @@ -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) @@ -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", @@ -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) @@ -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", diff --git a/src/nh99/randeff.cpp b/src/nh99/randeff.cpp index f3c718b88..d78520466 100644 --- a/src/nh99/randeff.cpp +++ b/src/nh99/randeff.cpp @@ -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) @@ -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",