File:  [cvs.NetBSD.org] / pkgsrc / graphics / py-matplotlib / patches / patch-src___image__wrapper.cpp
Revision 1.1: download - view: text, annotated - select for diffs
Tue Jun 30 10:18:27 2026 UTC (4 months, 2 weeks ago) by ryoon
Branches: MAIN
CVS tags: pkgsrc-2026Q3-base, pkgsrc-2026Q3, HEAD
graphics/py-matplotlib: Fix build under NetBSD/amd64 11.99.6 at least

* C function abs() returns int value and it causes fingerprint mismatch
  of std:clamp() C++ function. Use std:abs() for C++ instead.

$NetBSD: patch-src___image__wrapper.cpp,v 1.1 2026/06/30 10:18:27 ryoon Exp $

* Fix fingerprint mismatch for std::clamp().
  abs() returns int, not double.

--- src/_image_wrapper.cpp.orig	2026-06-30 09:58:33.168256719 +0000
+++ src/_image_wrapper.cpp
@@ -266,7 +266,7 @@ calculate_rms_and_diff(py::array_t<unsigned char> expe
 
                 if (k != 3) { // Hard-code a fully solid alpha channel by omitting it.
                     diff(i, j, k) = static_cast<unsigned char>(std::clamp(
-                        abs(pixel_diff) * 10, // Expand differences in luminance domain.
+                        std::abs(pixel_diff) * 10, // Expand differences in luminance domain.
                         0.0, 255.0));
                 }
             }

CVSweb <webmaster@jp.NetBSD.org>