patch config.h post-configure to avoid stupid warnings.
multiple clang fixes, mostly stolen from more current qucs.
This commit is contained in:
parent
e2c7e696c7
commit
9783b65405
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.9 2017/04/10 11:45:24 sthen Exp $
|
||||
# $OpenBSD: Makefile,v 1.10 2017/05/02 15:13:39 espie Exp $
|
||||
|
||||
PORTROACH= limit:[0-9]\.[0-9]\.[0-9][0-9]$
|
||||
|
||||
@ -6,7 +6,7 @@ COMMENT= graphical circuit design and simulation tool
|
||||
BROKEN-hppa = OOM on hicumL2V2p23.core.o
|
||||
|
||||
DISTNAME= qucs-0.0.16
|
||||
REVISION= 0
|
||||
REVISION= 1
|
||||
CATEGORIES= cad
|
||||
|
||||
HOMEPAGE= http://qucs.sourceforge.net/
|
||||
@ -29,4 +29,9 @@ CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
|
||||
pre-configure:
|
||||
${SUBST_CMD} ${WRKSRC}/configure
|
||||
|
||||
post-configure:
|
||||
perl -pi.bak \
|
||||
-e 's,.*(\#undef __(BEGIN|END)_DECLS).*,$$1,;' \
|
||||
${WRKBUILD}/config.h ${WRKBUILD}/qucs-core/config.h
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
25
cad/qucs/patches/patch-qucs-core_src_math_complex_h
Normal file
25
cad/qucs/patches/patch-qucs-core_src_math_complex_h
Normal file
@ -0,0 +1,25 @@
|
||||
$OpenBSD: patch-qucs-core_src_math_complex_h,v 1.1 2017/05/02 15:13:39 espie Exp $
|
||||
Don't include namespace std with libcxx, ambiguity with vector.
|
||||
Don't multi-declare polar functions, especially ones we don't define
|
||||
(stolen from qucs-current)
|
||||
|
||||
Index: qucs-core/src/math/complex.h
|
||||
--- qucs-core/src/math/complex.h.orig
|
||||
+++ qucs-core/src/math/complex.h
|
||||
@@ -37,7 +37,6 @@ using namespace std::tr1;
|
||||
typedef std::complex<nr_double_t> nr_complex_t;
|
||||
#else
|
||||
#include <complex>
|
||||
-using namespace std;
|
||||
typedef std::complex<nr_double_t> nr_complex_t;
|
||||
#endif
|
||||
|
||||
@@ -118,8 +117,6 @@ nr_complex_t polar (const nr_double_t mag, const nr_
|
||||
|
||||
#ifndef HAVE_CXX_COMPLEX_POLAR_COMPLEX
|
||||
nr_complex_t polar (const nr_complex_t a, const nr_complex_t p);
|
||||
-nr_complex_t polar (const nr_double_t a, const nr_complex_t p);
|
||||
-nr_complex_t polar (const nr_complex_t a, const nr_double_t p = 0.0);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_CXX_COMPLEX_POW
|
14
cad/qucs/patches/patch-qucs-core_src_math_real_cpp
Normal file
14
cad/qucs/patches/patch-qucs-core_src_math_real_cpp
Normal file
@ -0,0 +1,14 @@
|
||||
$OpenBSD: patch-qucs-core_src_math_real_cpp,v 1.1 2017/05/02 15:13:39 espie Exp $
|
||||
|
||||
Index: qucs-core/src/math/real.cpp
|
||||
--- qucs-core/src/math/real.cpp.orig
|
||||
+++ qucs-core/src/math/real.cpp
|
||||
@@ -112,6 +112,8 @@ nr_double_t norm (const nr_double_t r) {
|
||||
\return Modulus of r
|
||||
\todo Why not inline
|
||||
*/
|
||||
+/* prevent collision with the system */
|
||||
+#define abs myabs
|
||||
nr_double_t abs (const nr_double_t r) {
|
||||
return fabs (r);
|
||||
}
|
67
cad/qucs/patches/patch-qucs-core_src_matrix_h
Normal file
67
cad/qucs/patches/patch-qucs-core_src_matrix_h
Normal file
@ -0,0 +1,67 @@
|
||||
$OpenBSD: patch-qucs-core_src_matrix_h,v 1.1 2017/05/02 15:13:39 espie Exp $
|
||||
friend declarations can't have default params.
|
||||
|
||||
Index: qucs-core/src/matrix.h
|
||||
--- qucs-core/src/matrix.h.orig
|
||||
+++ qucs-core/src/matrix.h
|
||||
@@ -29,6 +29,19 @@ class vector;
|
||||
class matrix;
|
||||
|
||||
matrix eye (int);
|
||||
+matrix stos (matrix, nr_complex_t, nr_complex_t z0 = 50.0);
|
||||
+matrix stos (matrix, nr_double_t, nr_double_t z0 = 50.0);
|
||||
+matrix stos (matrix, vector, nr_complex_t z0 = 50.0);
|
||||
+matrix stoz (matrix, nr_complex_t z0 = 50.0);
|
||||
+matrix ztos (matrix, nr_complex_t z0 = 50.0);
|
||||
+matrix stoy (matrix, nr_complex_t z0 = 50.0);
|
||||
+matrix ytos (matrix, nr_complex_t z0 = 50.0);
|
||||
+matrix stoa (matrix, nr_complex_t z1 = 50.0, nr_complex_t z2 = 50.0);
|
||||
+matrix atos (matrix, nr_complex_t z1 = 50.0, nr_complex_t z2 = 50.0);
|
||||
+matrix stoh (matrix, nr_complex_t z1 = 50.0, nr_complex_t z2 = 50.0);
|
||||
+matrix htos (matrix, nr_complex_t z1 = 50.0, nr_complex_t z2 = 50.0);
|
||||
+matrix stog (matrix, nr_complex_t z1 = 50.0, nr_complex_t z2 = 50.0);
|
||||
+matrix gtos (matrix, nr_complex_t z1 = 50.0, nr_complex_t z2 = 50.0);
|
||||
|
||||
/*!\brief Dense complex matrix class */
|
||||
class matrix
|
||||
@@ -92,27 +105,27 @@ class matrix
|
||||
friend matrix inverseLaplace (matrix);
|
||||
friend matrix inverseGaussJordan (matrix);
|
||||
friend matrix inverse (matrix);
|
||||
- friend matrix stos (matrix, nr_complex_t, nr_complex_t z0 = 50.0);
|
||||
- friend matrix stos (matrix, nr_double_t, nr_double_t z0 = 50.0);
|
||||
- friend matrix stos (matrix, vector, nr_complex_t z0 = 50.0);
|
||||
+ friend matrix stos (matrix, nr_complex_t, nr_complex_t z0);
|
||||
+ friend matrix stos (matrix, nr_double_t, nr_double_t z0);
|
||||
+ friend matrix stos (matrix, vector, nr_complex_t z0);
|
||||
friend matrix stos (matrix, nr_complex_t, vector);
|
||||
friend matrix stos (matrix, vector, vector);
|
||||
- friend matrix stoz (matrix, nr_complex_t z0 = 50.0);
|
||||
+ friend matrix stoz (matrix, nr_complex_t z0);
|
||||
friend matrix stoz (matrix, vector);
|
||||
- friend matrix ztos (matrix, nr_complex_t z0 = 50.0);
|
||||
+ friend matrix ztos (matrix, nr_complex_t z0);
|
||||
friend matrix ztos (matrix, vector);
|
||||
friend matrix ztoy (matrix);
|
||||
- friend matrix stoy (matrix, nr_complex_t z0 = 50.0);
|
||||
+ friend matrix stoy (matrix, nr_complex_t z0);
|
||||
friend matrix stoy (matrix, vector);
|
||||
- friend matrix ytos (matrix, nr_complex_t z0 = 50.0);
|
||||
+ friend matrix ytos (matrix, nr_complex_t z0);
|
||||
friend matrix ytos (matrix, vector);
|
||||
friend matrix ytoz (matrix);
|
||||
- friend matrix stoa (matrix, nr_complex_t z1 = 50.0, nr_complex_t z2 = 50.0);
|
||||
- friend matrix atos (matrix, nr_complex_t z1 = 50.0, nr_complex_t z2 = 50.0);
|
||||
- friend matrix stoh (matrix, nr_complex_t z1 = 50.0, nr_complex_t z2 = 50.0);
|
||||
- friend matrix htos (matrix, nr_complex_t z1 = 50.0, nr_complex_t z2 = 50.0);
|
||||
- friend matrix stog (matrix, nr_complex_t z1 = 50.0, nr_complex_t z2 = 50.0);
|
||||
- friend matrix gtos (matrix, nr_complex_t z1 = 50.0, nr_complex_t z2 = 50.0);
|
||||
+ friend matrix stoa (matrix, nr_complex_t z1, nr_complex_t z2);
|
||||
+ friend matrix atos (matrix, nr_complex_t z1, nr_complex_t z2);
|
||||
+ friend matrix stoh (matrix, nr_complex_t z1, nr_complex_t z2);
|
||||
+ friend matrix htos (matrix, nr_complex_t z1, nr_complex_t z2);
|
||||
+ friend matrix stog (matrix, nr_complex_t z1, nr_complex_t z2);
|
||||
+ friend matrix gtos (matrix, nr_complex_t z1, nr_complex_t z2);
|
||||
friend matrix cytocs (matrix, matrix);
|
||||
friend matrix cztocs (matrix, matrix);
|
||||
friend matrix cztocy (matrix, matrix);
|
50
cad/qucs/patches/patch-qucs-core_src_matvec_h
Normal file
50
cad/qucs/patches/patch-qucs-core_src_matvec_h
Normal file
@ -0,0 +1,50 @@
|
||||
$OpenBSD: patch-qucs-core_src_matvec_h,v 1.1 2017/05/02 15:13:39 espie Exp $
|
||||
friend declarations can't have default params.
|
||||
|
||||
Index: qucs-core/src/matvec.h
|
||||
--- qucs-core/src/matvec.h.orig
|
||||
+++ qucs-core/src/matvec.h
|
||||
@@ -26,7 +26,16 @@
|
||||
#define __MATVEC_H__
|
||||
|
||||
class matrix;
|
||||
+class matvec;
|
||||
|
||||
+matvec stos (matvec, nr_complex_t, nr_complex_t z0 = 50.0);
|
||||
+matvec stos (matvec, nr_double_t, nr_double_t z0 = 50.0);
|
||||
+matvec stos (matvec, vector, nr_complex_t z0 = 50.0);
|
||||
+matvec stoz (matvec, nr_complex_t z0 = 50.0);
|
||||
+matvec ztos (matvec, nr_complex_t z0 = 50.0);
|
||||
+matvec stoy (matvec, nr_complex_t z0 = 50.0);
|
||||
+matvec ytos (matvec, nr_complex_t z0 = 50.0);
|
||||
+
|
||||
class matvec
|
||||
{
|
||||
public:
|
||||
@@ -103,19 +112,19 @@ class matvec
|
||||
friend vector rollet (matvec);
|
||||
friend vector b1 (matvec);
|
||||
|
||||
- friend matvec stos (matvec, nr_complex_t, nr_complex_t z0 = 50.0);
|
||||
- friend matvec stos (matvec, nr_double_t, nr_double_t z0 = 50.0);
|
||||
- friend matvec stos (matvec, vector, nr_complex_t z0 = 50.0);
|
||||
+ friend matvec stos (matvec, nr_complex_t, nr_complex_t z0);
|
||||
+ friend matvec stos (matvec, nr_double_t, nr_double_t z0);
|
||||
+ friend matvec stos (matvec, vector, nr_complex_t z0);
|
||||
friend matvec stos (matvec, nr_complex_t, vector);
|
||||
friend matvec stos (matvec, vector, vector);
|
||||
- friend matvec stoz (matvec, nr_complex_t z0 = 50.0);
|
||||
+ friend matvec stoz (matvec, nr_complex_t z0);
|
||||
friend matvec stoz (matvec, vector);
|
||||
- friend matvec ztos (matvec, nr_complex_t z0 = 50.0);
|
||||
+ friend matvec ztos (matvec, nr_complex_t z0);
|
||||
friend matvec ztos (matvec, vector);
|
||||
friend matvec ztoy (matvec);
|
||||
- friend matvec stoy (matvec, nr_complex_t z0 = 50.0);
|
||||
+ friend matvec stoy (matvec, nr_complex_t z0);
|
||||
friend matvec stoy (matvec, vector);
|
||||
- friend matvec ytos (matvec, nr_complex_t z0 = 50.0);
|
||||
+ friend matvec ytos (matvec, nr_complex_t z0);
|
||||
friend matvec ytos (matvec, vector);
|
||||
friend matvec ytoz (matvec);
|
||||
|
51
cad/qucs/patches/patch-qucs-core_src_vector_h
Normal file
51
cad/qucs/patches/patch-qucs-core_src_vector_h
Normal file
@ -0,0 +1,51 @@
|
||||
$OpenBSD: patch-qucs-core_src_vector_h,v 1.1 2017/05/02 15:13:39 espie Exp $
|
||||
friend declarations can't have default params.
|
||||
|
||||
Index: qucs-core/src/vector.h
|
||||
--- qucs-core/src/vector.h.orig
|
||||
+++ qucs-core/src/vector.h
|
||||
@@ -36,6 +36,15 @@
|
||||
class strlist;
|
||||
class vector;
|
||||
|
||||
+vector ztor (vector, nr_complex_t zref = 50.0);
|
||||
+vector rtoz (vector, nr_complex_t zref = 50.0);
|
||||
+vector ytor (vector, nr_complex_t zref = 50.0);
|
||||
+vector rtoy (vector, nr_complex_t zref = 50.0);
|
||||
+vector diff (vector, vector, int n = 1);
|
||||
+vector unwrap (vector,
|
||||
+ nr_double_t tol = M_PI, nr_double_t step = 2 * M_PI);
|
||||
+vector dbm (vector, const nr_complex_t z = 50.0);
|
||||
+
|
||||
vector linspace (nr_double_t, nr_double_t, int);
|
||||
vector logspace (nr_double_t, nr_double_t, int);
|
||||
vector runavg (vector, const int);
|
||||
@@ -82,7 +91,7 @@ class vector : public object
|
||||
friend vector cumsum (vector);
|
||||
friend vector cumprod (vector);
|
||||
friend vector cumavg (vector);
|
||||
- friend vector dbm (vector, const nr_complex_t z = 50.0);
|
||||
+ friend vector dbm (vector, const nr_complex_t z);
|
||||
friend nr_complex_t integrate (vector v, const nr_complex_t);
|
||||
friend nr_double_t integrate (vector v, const nr_double_t);
|
||||
|
||||
@@ -100,13 +109,12 @@ class vector : public object
|
||||
friend vector pow (const nr_complex_t, vector);
|
||||
friend vector pow (const nr_double_t, vector);
|
||||
friend vector pow (vector, vector);
|
||||
- friend vector ztor (vector, nr_complex_t zref = 50.0);
|
||||
- friend vector rtoz (vector, nr_complex_t zref = 50.0);
|
||||
- friend vector ytor (vector, nr_complex_t zref = 50.0);
|
||||
- friend vector rtoy (vector, nr_complex_t zref = 50.0);
|
||||
- friend vector diff (vector, vector, int n = 1);
|
||||
- friend vector unwrap (vector,
|
||||
- nr_double_t tol = M_PI, nr_double_t step = 2 * M_PI);
|
||||
+ friend vector ztor (vector, nr_complex_t zref);
|
||||
+ friend vector rtoz (vector, nr_complex_t zref);
|
||||
+ friend vector ytor (vector, nr_complex_t zref);
|
||||
+ friend vector rtoy (vector, nr_complex_t zref);
|
||||
+ friend vector diff (vector, vector, int n);
|
||||
+ friend vector unwrap (vector, nr_double_t tol, nr_double_t step);
|
||||
|
||||
friend vector polar (vector, const nr_complex_t);
|
||||
friend vector polar (const nr_complex_t, vector);
|
30
cad/qucs/patches/patch-qucs-filter_qf_filter_cpp
Normal file
30
cad/qucs/patches/patch-qucs-filter_qf_filter_cpp
Normal file
@ -0,0 +1,30 @@
|
||||
$OpenBSD: patch-qucs-filter_qf_filter_cpp,v 1.1 2017/05/02 15:13:39 espie Exp $
|
||||
Non-sensical multiple default constructor.
|
||||
sanity fix stolen from qucs-current.
|
||||
|
||||
Index: qucs-filter/qf_filter.cpp
|
||||
--- qucs-filter/qf_filter.cpp.orig
|
||||
+++ qucs-filter/qf_filter.cpp
|
||||
@@ -43,19 +43,19 @@ qf_filter::qf_filter () :
|
||||
ncomp (0), Comp (NULL) {
|
||||
}
|
||||
|
||||
-qf_filter::qf_filter (int n = 3, qfk k = UNDEF, qft t = LOWPASS) :
|
||||
+qf_filter::qf_filter (int n, qfk k = UNDEF, qft t = LOWPASS) :
|
||||
type (t), kind (k), ord (n), fc (0), bw (0), imp (1),
|
||||
ncomp (0), Comp (NULL) {
|
||||
}
|
||||
|
||||
-qf_filter::qf_filter (qfk k = UNDEF, qft t = LOWPASS, qf_double_t r = 1,
|
||||
+qf_filter::qf_filter (qfk k, qft t, qf_double_t r = 1,
|
||||
qf_double_t f = 1, qf_double_t b = 0) :
|
||||
type (t), kind (k), fc (f), bw (b), imp (r), ncomp (0), Comp (NULL) {
|
||||
fstart = fc - bw / 2;
|
||||
fstop = fc + bw / 2;
|
||||
}
|
||||
|
||||
-qf_filter::qf_filter (qfk k = UNDEF, qft t = LOWPASS) :
|
||||
+qf_filter::qf_filter (qfk k, qft t = LOWPASS) :
|
||||
type (t), kind (k), ord (0), fc (0), bw (0), imp (1),
|
||||
ncomp (0), Comp (NULL) {
|
||||
}
|
Loading…
Reference in New Issue
Block a user