Update of /cvsroot/babylonlib/_SrcPool/Cpp
In directory sc8-pr-cvs1:/tmp/cvs-serv21270/Cpp
Modified Files:
KComplex.h KDbgMacr.h KPair.h KProgCst.inl KReal4IE.h KTrace.h
KZLineIn.cpp KfQuadEq.cpp
Log Message:
Replaced BOOL with bool
Index: KComplex.h
===================================================================
RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/KComplex.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** KComplex.h 28 Jan 2003 05:29:46 -0000 1.4
--- KComplex.h 31 Jan 2003 03:02:24 -0000 1.5
***************
*** 30,35 ****
//To allow direct access to the members of complex class, _Re and _Im are
//redefined as _ccR and _ccI
! #define _ccR _Re
! #define _ccI _Im
using namespace std;
#endif //_MSC_VER
--- 30,44 ----
//To allow direct access to the members of complex class, _Re and _Im are
//redefined as _ccR and _ccI
! #if _MSC_VER < 1300
! #define _ccR _Re
! #define _ccI _Im
! #endif
!
! //_Real and _Imag are defined in the <complex> header file (VC++.Net v7.0)
! #if _MSC_VER >= 1300
! #define _ccR _Real
! #define _ccI _Imag
! #endif
!
using namespace std;
#endif //_MSC_VER
Index: KDbgMacr.h
===================================================================
RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/KDbgMacr.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** KDbgMacr.h 28 Jan 2003 05:35:50 -0000 1.4
--- KDbgMacr.h 31 Jan 2003 03:02:24 -0000 1.5
***************
*** 42,46 ****
ANSI Standard C. (Whether that is actually true depends on what
C compiler will operate on the output from the preprocessor.) */
! #warning "ANSI C complience"
#endif
#ifdef __STDC_VERSION__
--- 42,46 ----
ANSI Standard C. (Whether that is actually true depends on what
C compiler will operate on the output from the preprocessor.) */
! #warning "ANSI C compliance"
#endif
#ifdef __STDC_VERSION__
***************
*** 424,428 ****
#ifdef __STDC__
/*Indicates full conformance with the ANSI C standard. */
! #pragma message ("ANSI C complience")
#endif
#ifdef __STDC_VERSION__
--- 424,428 ----
#ifdef __STDC__
/*Indicates full conformance with the ANSI C standard. */
! #pragma message ("ANSI C compliance")
#endif
#ifdef __STDC_VERSION__
***************
*** 437,448 ****
#pragma message ("Release version")
#endif
! #if _MSC_VER >= 800
! #pragma message ("Microsoft Visual C/C++ compiler")
#else
! #if _MSC_VER > 600
! #pragma message ("Microsoft C/C++ compiler")
! #else
! #pragma message ("Microsoft C compiler")
! #endif
#endif
--- 437,453 ----
#pragma message ("Release version")
#endif
!
! #if _MSC_VER >= 1300
! #pragma message ("Microsoft Visual C++.NET compiler")
#else
! #if _MSC_VER >= 800
! #pragma message ("Microsoft Visual C/C++ compiler")
! #else
! #if _MSC_VER > 600
! #pragma message ("Microsoft C/C++ compiler")
! #else
! #pragma message ("Microsoft C compiler")
! #endif
! #endif
#endif
***************
*** 498,502 ****
#pragma message ("ver. 6.0")
#endif
! #if _MSC_VER > 1200
#pragma message ("ver. unknown")
#endif
--- 503,513 ----
#pragma message ("ver. 6.0")
#endif
! #if _MSC_VER == 1210
! #pragma message ("ver. 6.1")
! #endif
! #if _MSC_VER == 1300
! #pragma message ("ver. 7.0")
! #endif
! #if _MSC_VER > 1300
#pragma message ("ver. unknown")
#endif
Index: KPair.h
===================================================================
RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/KPair.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** KPair.h 28 Jan 2003 05:37:43 -0000 1.3
--- KPair.h 31 Jan 2003 03:02:24 -0000 1.4
***************
*** 31,38 ****
//Operations
public:
! BOOL operator < (const TPair<TYPE>& Point) const;
! BOOL operator <=(const TPair<TYPE>& Point) const;
! BOOL operator >=(const TPair<TYPE>& Point) const;
! BOOL operator > (const TPair<TYPE>& Point) const;
};
--- 31,38 ----
//Operations
public:
! bool operator < (const TPair<TYPE>& Point) const;
! bool operator <=(const TPair<TYPE>& Point) const;
! bool operator >=(const TPair<TYPE>& Point) const;
! bool operator > (const TPair<TYPE>& Point) const;
};
***************
*** 76,80 ****
*/
template <class TYPE>
! BOOL TPair<TYPE>::operator < (const TPair<TYPE>& tptPoint) const
{
return ((x < tptPoint.x) || (x == tptPoint.x && y < tptPoint.y));
--- 76,80 ----
*/
template <class TYPE>
! bool TPair<TYPE>::operator < (const TPair<TYPE>& tptPoint) const
{
return ((x < tptPoint.x) || (x == tptPoint.x && y < tptPoint.y));
***************
*** 87,91 ****
*/
template <class TYPE>
! BOOL TPair<TYPE>::operator <= (const TPair<TYPE>& tptPoint) const
{
return ((x < tptPoint.x) || (x == tptPoint.x && y <= tptPoint.y));
--- 87,91 ----
*/
template <class TYPE>
! bool TPair<TYPE>::operator <= (const TPair<TYPE>& tptPoint) const
{
return ((x < tptPoint.x) || (x == tptPoint.x && y <= tptPoint.y));
***************
*** 98,102 ****
*/
template <class TYPE>
! BOOL TPair<TYPE>::operator > (const TPair<TYPE>& tptPoint) const
{
return ((x > tptPoint.x) || (x == tptPoint.x && y > tptPoint.y));
--- 98,102 ----
*/
template <class TYPE>
! bool TPair<TYPE>::operator > (const TPair<TYPE>& tptPoint) const
{
return ((x > tptPoint.x) || (x == tptPoint.x && y > tptPoint.y));
***************
*** 109,113 ****
*/
template <class TYPE>
! BOOL TPair<TYPE>::operator >= (const TPair<TYPE>& tptPoint) const
{
return ((x > tptPoint.x) || (x == tptPoint.x && y >= tptPoint.y));
--- 109,113 ----
*/
template <class TYPE>
! bool TPair<TYPE>::operator >= (const TPair<TYPE>& tptPoint) const
{
return ((x > tptPoint.x) || (x == tptPoint.x && y >= tptPoint.y));
Index: KProgCst.inl
===================================================================
RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/KProgCst.inl,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** KProgCst.inl 28 Jan 2003 05:37:44 -0000 1.3
--- KProgCst.inl 31 Jan 2003 03:02:25 -0000 1.4
***************
*** 115,119 ****
#ifdef _MSC_VER //Microsoft VC++
#include <Float.h>
! #define IsNaN(dvalue) (BOOL)_isnan(dvalue)
#else
#define _KEXAMIN_NAN_FUNC 1
--- 115,119 ----
#ifdef _MSC_VER //Microsoft VC++
#include <Float.h>
! #define IsNaN(dvalue) (bool)_isnan(dvalue)
#else
#define _KEXAMIN_NAN_FUNC 1
Index: KReal4IE.h
===================================================================
RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/KReal4IE.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** KReal4IE.h 28 Jan 2003 05:37:44 -0000 1.3
--- KReal4IE.h 31 Jan 2003 03:02:25 -0000 1.4
***************
*** 124,128 ****
//::operator double()-----------------------------------------------------------
#include "KReal8Cv.h" //UReal8Conversion union
! /*TODO: Next time
*/
inline CFloatIEEE::operator double()
--- 124,128 ----
//::operator double()-----------------------------------------------------------
#include "KReal8Cv.h" //UReal8Conversion union
! /*TODO: finsh implementation
*/
inline CFloatIEEE::operator double()
Index: KTrace.h
===================================================================
RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/KTrace.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** KTrace.h 28 Jan 2003 05:39:56 -0000 1.4
--- KTrace.h 31 Jan 2003 03:02:25 -0000 1.5
***************
*** 18,22 ****
/*Compile-time assertion produces compiler error if expression is false.
*/
! #define ASSERT_C(expr) typedef char __AssertCompiler__[(expr) ? 1 : -1]
/* ======================================================================= */
--- 18,22 ----
/*Compile-time assertion produces compiler error if expression is false.
*/
! #define ASSERT_CL(expr) typedef char __AssertCompiler__[(expr) ? 1 : -1]
/* ======================================================================= */
***************
*** 90,101 ****
extern FILE* DbgStdOut;
#endif
#undef TRACE0
#undef TRACE1
#undef TRACE2
#undef TRACE3
! #define TRACE0(format) fprintf(DbgStdOut,format);fflush(DbgStdOut)
! #define TRACE1(format, p1) fprintf(DbgStdOut,format, p1);fflush(DbgStdOut)
! #define TRACE2(format, p1, p2) fprintf(DbgStdOut,format, p1, p2);fflush(DbgStdOut)
! #define TRACE3(format, p1, p2, p3) fprintf(DbgStdOut,format, p1, p2, p3);fflush(DbgStdOut)
/* ----------------------------------------------------------------------- */
--- 90,103 ----
extern FILE* DbgStdOut;
#endif
+ #undef TRACE
#undef TRACE0
#undef TRACE1
#undef TRACE2
#undef TRACE3
! #define TRACE fprintf
! #define TRACE0(format) TRACE(DbgStdOut,format);fflush(DbgStdOut)
! #define TRACE1(format, p1) TRACE(DbgStdOut,format, p1);fflush(DbgStdOut)
! #define TRACE2(format, p1, p2) TRACE(DbgStdOut,format, p1, p2);fflush(DbgStdOut)
! #define TRACE3(format, p1, p2, p3) TRACE(DbgStdOut,format, p1, p2, p3);fflush(DbgStdOut)
/* ----------------------------------------------------------------------- */
***************
*** 106,112 ****
--- 108,139 ----
#ifdef _MSC_VER /*Microsoft Visual Studio*/
//D.K. 12.2.2k2 #ifdef __cplusplus
+ //TODO: separate C and C++ traces (replace fprintf with a class Trace)
#ifndef __AFX_H__ /*MFC not included and all TRACE macros are undefined*/
#define THIS_FILE __FILE__
+
+ /*Only if Mac or Win32 targets are supported*/
+ #if defined(_WIN32) || defined(_MAC)
+ #include <CrtDbg.h> /*_CrtDbgReport()*/
+
+ /*Evaluates an expression when the _DEBUG flag has been defined and
+ if the result is FALSE, prints a diagnostic message and aborts
+ the program.
+ */
+ #define ASSERT(expr) \
+ do{ if (!(expr) && \
+ (1 == _CrtDbgReport(_CRT_ASSERT, THIS_FILE, __LINE__, NULL, NULL))) \
+ _CrtDbgBreak(); \
+ } while (0)
+
+ #define TRACE0( szMsg) \
+ _CrtDbgReport( _CRT_WARN, NULL, 0, NULL, "%s\n", szMsg)
+
+ #endif /*Mac or Win32*/
+ #ifdef _DOS
+ #include <assert.h>
+ #define ASSERT(expr) ( (expr) ? (void) 0 : _assert(expr, __FILE__, __LINE__) )
+ #endif /*_DOS*/
+
#include <stdio.h> /*fprintf()*/
/*In the Debug environment, the TRACE macro output goes to Standard
***************
*** 141,164 ****
#endif
- /*Only Mac or Win32 targets are supported*/
- #if defined(_WIN32) || defined(_MAC)
- #include <CrtDbg.h> /*_CrtDbgReport()*/
-
- /*Evaluates an expression when the _DEBUG flag has been defined and
- if the result is FALSE, prints a diagnostic message and aborts
- the program.
- */
- #define ASSERT(expr) \
- do{ if (!(expr) && \
- (1 == _CrtDbgReport(_CRT_ASSERT, THIS_FILE, __LINE__, NULL, NULL))) \
- _CrtDbgBreak(); \
- } while (0)
- #endif /*Mac or Win32*/
-
- #ifdef _DOS
- #include <assert.h>
- #define ASSERT(expr) ( (expr) ? (void) 0 : _assert(expr, __FILE__, __LINE__) )
- #endif /*_DOS*/
-
#endif /*!__AFX_H__ */
//D.K. 12.2.2k2 #endif /*__cplusplus*/
--- 168,171 ----
***************
*** 252,256 ****
#endif /*_MSC_VER */
! #define ASSERT_C ASSERT
#endif /*!_DEBUG */
--- 259,263 ----
#endif /*_MSC_VER */
! #define ASSERT_CL ASSERT
#endif /*!_DEBUG */
Index: KZLineIn.cpp
===================================================================
RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/KZLineIn.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** KZLineIn.cpp 28 Jan 2003 05:39:56 -0000 1.3
--- KZLineIn.cpp 31 Jan 2003 03:02:25 -0000 1.4
***************
*** 29,33 ****
Feb 2k D.K.
*/
! #include "StdAfx.h"
#include "KComplex.h" //CComplex class
--- 29,37 ----
Feb 2k D.K.
*/
! #if (_MSC_VER >= 1200) //VC++ 6.0
! #if (_MSC_VER < 1300) //VC++.Net 7.0
! #include "stdafx.h"
! #endif
! #endif
#include "KComplex.h" //CComplex class
***************
*** 65,75 ****
| +---------+
*/
! CComplex GetLineZin(CComplex Zt, //terminating impedance
! const CComplex& Zline, //line characteristic impedance
! double dAttenuation,//line attenuation per unit of
//length [dB/length_unit]
! double dPhaseShift, //phase shift per unit of
//length [rad/length_unit]
! const double& dLineLength //line length [length_unit]
)
{
--- 69,79 ----
| +---------+
*/
! CComplex GetLineZin(CComplex Zt, //[in] terminating impedance
! const CComplex& Zline, //[in] line characteristic impedance
! double dAttenuation,//[in] line attenuation per unit of
//length [dB/length_unit]
! double dPhaseShift, //[in] phase shift per unit of
//length [rad/length_unit]
! const double& dLineLength //[in] line length [length_unit]
)
{
***************
*** 101,103 ****
}
! ///////////////////////////////////////////////////////////////////////////////
\ No newline at end of file
--- 105,107 ----
}
! ///////////////////////////////////////////////////////////////////////////////
Index: KfQuadEq.cpp
===================================================================
RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/KfQuadEq.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** KfQuadEq.cpp 28 Jan 2003 05:36:18 -0000 1.3
--- KfQuadEq.cpp 31 Jan 2003 03:02:25 -0000 1.4
***************
*** 15,20 ****
//unreferenced inline function has been removed
#include <Math.h>
! #ifndef BOOL
! #include "KTypedef.h" //BOOL
#endif
#include "KMathCst.inl"
--- 15,20 ----
//unreferenced inline function has been removed
#include <Math.h>
! #ifndef bool
! #include "KTypedef.h" //bool
#endif
#include "KMathCst.inl"
***************
*** 62,66 ****
and some boundary conditions.
! Returns TRUE if equation solutions are real numbers. If solutions are complex
numbers returns FALSE and real part as x1 , absolute value of imaginary part
as x2 :
--- 62,66 ----
and some boundary conditions.
! Returns true if equation solutions are real numbers. If solutions are complex
numbers returns FALSE and real part as x1 , absolute value of imaginary part
as x2 :
***************
*** 95,99 ****
*/
! BOOL funcQuadratic(double a, //[in] coefficient 2
double b, //[in] coefficient 1
double c, //[in] coefficient 0
--- 95,99 ----
*/
! bool funcQuadratic(double a, //[in] coefficient 2
double b, //[in] coefficient 1
double c, //[in] coefficient 0
|