Skip to content

Commit

Permalink
Rename variables to avoid use of reserved identifiers.
Browse files Browse the repository at this point in the history
Fix from upstream: matplotlib/matplotlib#2463
  • Loading branch information
wiedi committed Feb 26, 2014
1 parent c8f93ec commit 44fc49d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
4 changes: 3 additions & 1 deletion graphics/py-matplotlib/distinfo
@@ -1,6 +1,8 @@
$NetBSD: distinfo,v 1.21 2014/01/21 21:14:06 drochner Exp $
$NetBSD: distinfo,v 1.22 2014/02/26 10:36:58 wiedi Exp $

SHA1 (matplotlib-1.3.1.tar.gz) = 8578afc86424392591c0ee03f7613ffa9b6f68ee
RMD160 (matplotlib-1.3.1.tar.gz) = 7c2647ae1d6aafdc1c32e47183239c7da0d91956
Size (matplotlib-1.3.1.tar.gz) = 42163182 bytes
SHA1 (patch-ab) = 416ceee9a060b98b615ef9a98ac8cab25fa9f408
SHA1 (patch-lib_matplotlib_tri___tri.cpp) = ca21c3045eef3dae741ad2b4403f78b505e0b579
SHA1 (patch-lib_matplotlib_tri___tri.h) = f51cf95eed8e2a490d366ce39730587c944c60f4
24 changes: 24 additions & 0 deletions graphics/py-matplotlib/patches/patch-lib_matplotlib_tri___tri.cpp
@@ -0,0 +1,24 @@
$NetBSD: patch-lib_matplotlib_tri___tri.cpp,v 1.1 2014/02/26 10:36:58 wiedi Exp $

Rename C++ variables to avoid use of reserved identifiers
See: https://github.com/matplotlib/matplotlib/issues/2463
--- lib/matplotlib/tri/_tri.cpp.orig 2013-10-10 12:42:48.000000000 +0000
+++ lib/matplotlib/tri/_tri.cpp
@@ -2177,14 +2177,14 @@ TrapezoidMapTriFinder::Trapezoid::set_up


RandomNumberGenerator::RandomNumberGenerator(unsigned long seed)
- : _M(21870), _A(1291), _C(4621), _seed(seed % _M)
+ : _m(21870), _a(1291), _c(4621), _seed(seed % _m)
{}

unsigned long
RandomNumberGenerator::operator()(unsigned long max_value)
{
- _seed = (_seed*_A + _C) % _M;
- return (_seed*max_value) / _M;
+ _seed = (_seed*_a + _c) % _m;
+ return (_seed*max_value) / _m;
}


15 changes: 15 additions & 0 deletions graphics/py-matplotlib/patches/patch-lib_matplotlib_tri___tri.h
@@ -0,0 +1,15 @@
$NetBSD: patch-lib_matplotlib_tri___tri.h,v 1.1 2014/02/26 10:36:58 wiedi Exp $

Rename C++ variables to avoid use of reserved identifiers
See: https://github.com/matplotlib/matplotlib/issues/2463
--- lib/matplotlib/tri/_tri.h.orig 2013-10-10 12:42:48.000000000 +0000
+++ lib/matplotlib/tri/_tri.h
@@ -818,7 +818,7 @@ public:
unsigned long operator()(unsigned long max_value);

private:
- const unsigned long _M, _A, _C;
+ const unsigned long _m, _a, _c;
unsigned long _seed;
};

0 comments on commit 44fc49d

Please sign in to comment.