void-packages/srcpkgs/paraview/patches/vtk-isnan.patch
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: convert patches to -Np1
* par is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

46 lines
1.3 KiB
Diff

--- a/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h 2020-08-04 22:12:01.000000000 +0200
+++ b/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h 2020-08-29 22:33:06.824012475 +0200
@@ -36,20 +36,20 @@
template <typename T>
struct has_NaN<T, true>
{
- static bool isnan(T x) { return std::isnan(x); }
+ static bool vtkisnan(T x) { return std::isnan(x); }
};
template <typename T>
struct has_NaN<T, false>
{
- static bool isnan(T) { return false; }
+ static bool vtkisnan(T) { return false; }
};
template <typename T>
-bool isnan(T x)
+bool vtkisnan(T x)
{
// Select the correct partially specialized type.
- return has_NaN<T, std::numeric_limits<T>::has_quiet_NaN>::isnan(x);
+ return has_NaN<T, std::numeric_limits<T>::has_quiet_NaN>::vtkisnan(x);
}
} // namespace detail
@@ -127,7 +127,7 @@
for (vtkIdType i = 0; i < num; ++i)
{
auto value = this->AssociatedArray->GetValue(i);
- if (::detail::isnan(value))
+ if (::detail::vtkisnan(value))
{
NanIndices.push_back(i);
}
@@ -140,7 +140,7 @@
std::vector<vtkIdType>* FindIndexVec(ValueType value)
{
std::vector<vtkIdType>* indices{ nullptr };
- if (::detail::isnan(value) && !this->NanIndices.empty())
+ if (::detail::vtkisnan(value) && !this->NanIndices.empty())
{
indices = &this->NanIndices;
}