From: stevenj Date: Tue, 7 Dec 2010 20:18:02 +0000 (-0500) Subject: deprecated API should support xtol_abs==NULL (for 0 tol) for backward compatibility X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=f73aa5488f1321b4b4112d58b87e877c4d99899b;p=nlopt.git deprecated API should support xtol_abs==NULL (for 0 tol) for backward compatibility darcs-hash:20101207201802-c8de0-d0e23236914bbfae02d15c5f0c3ee61361a9da79.gz --- diff --git a/api/deprecated.c b/api/deprecated.c index 54da189..1f7dde9 100644 --- a/api/deprecated.c +++ b/api/deprecated.c @@ -119,7 +119,7 @@ NLOPT_STDCALL nlopt_minimize_econstrained( ret = nlopt_set_xtol_rel(opt, xtol_rel); if (ret != NLOPT_SUCCESS) { nlopt_destroy(opt); return ret; } - ret = nlopt_set_xtol_abs(opt, xtol_abs); + if (xtol_abs) ret = nlopt_set_xtol_abs(opt, xtol_abs); if (ret != NLOPT_SUCCESS) { nlopt_destroy(opt); return ret; } ret = nlopt_set_maxeval(opt, maxeval);