Skip to content

Commit ceea85e

Browse files
committed
.
2 parents 9120e32 + 7d168a8 commit ceea85e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

CImg.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27104,6 +27104,8 @@ namespace cimg_library {
2710427104
static double mp_erf(_cimg_math_parser& mp) {
2710527105
return std::erf(_mp_arg(2));
2710627106
}
27107+
#else
27108+
static double mp_erf(_cimg_math_parser& mp) { cimg::unused(mp); return cimg::type<double>::nan(); }
2710727109
#endif
2710827110

2710927111
static double mp_erfinv(_cimg_math_parser& mp) {
@@ -27364,6 +27366,8 @@ namespace cimg_library {
2736427366
static double mp_gamma(_cimg_math_parser& mp) {
2736527367
return std::tgamma(_mp_arg(2));
2736627368
}
27369+
#else
27370+
static double mp_gamma(_cimg_math_parser& mp) { cimg::unused(mp); return cimg::type<double>::nan(); }
2736727371
#endif
2736827372

2736927373
static double mp_gauss(_cimg_math_parser& mp) {
@@ -29532,12 +29536,12 @@ namespace cimg_library {
2953229536
sort_index = (int)_mp_arg(8),
2953329537
end_index = starting_index + nb_elts*siz_elt;
2953429538
const bool is_increasing = (bool)_mp_arg(4);
29535-
2953629539
if (starting_index<0 || nb_elts<0 || siz_elt<=0 || sort_index<0 || sort_index>=siz_elt || end_index>siz)
2953729540
throw CImgArgumentException("[" cimg_appname "_math_parser] CImg<%s>: Function 'sort()': "
2953829541
"Invalid arguments 'starting_index=%g', 'nb_elts=%g', 'siz_elt=%g' and "
2953929542
"'sort_index=%g', for sorting a vector of size %u.",
29540-
mp.imgin.pixel_type(),_mp_arg(5),_mp_arg(6),_mp_arg(7),_mp_arg(8),siz);
29543+
mp.imgin.pixel_type(),
29544+
_mp_arg(5),mp.opcode[6]==~0U?siz:_mp_arg(6),_mp_arg(7),_mp_arg(8),siz);
2954129545
if (nb_elts) {
2954229546
if (starting_index>0) // Recopy left side
2954329547
std::memcpy(ptrd,ptrs,starting_index*sizeof(double));

0 commit comments

Comments
 (0)