You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(20) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(6) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
From: <dd...@us...> - 2003-10-13 14:54:47
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/STL In directory sc8-pr-cvs1:/tmp/cvs-serv26700/STL Log Message: Directory /cvsroot/babylonlib/_SrcPool/Cpp/STL added to the repository |
Update of /cvsroot/babylonlib/_SrcPool/Cpp/16 In directory sc8-pr-cvs1:/tmp/cvs-serv23436/Cpp/16 Modified Files: KBeep.cpp KFileGetF.cpp KFileGetS.cpp KFileN16.cpp KFileN16.inl KioPIT.h KioPPI.h Log Message: formatting Index: KBeep.cpp =================================================================== RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/16/KBeep.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** KBeep.cpp 28 Jan 2003 04:42:21 -0000 1.1 --- KBeep.cpp 13 Oct 2003 14:37:28 -0000 1.2 *************** *** 205,216 **** /***************************************************************************** * $Log: ! * 7 Biblioteka1.6 11/10/2002 1:33:30 PMDarko Kolakovic ! * 6 Biblioteka1.5 10/10/2002 7:26:06 PMDarko Kolakovic Fixed x86 * version (16-bit) ! * 5 Biblioteka1.4 19/09/2002 4:37:37 PMDarko Kolakovic ! * 4 Biblioteka1.3 19/09/2002 12:14:36 AMDarko ! * 3 Biblioteka1.2 18/09/2002 5:13:35 PMDarko Kolakovic Start() /Win9x ! * 2 Biblioteka1.1 17/09/2002 1:36:45 PMDarko Kolakovic Added KioPIT.h ! * 1 Biblioteka1.0 16/09/2002 4:57:06 PMDarko Kolakovic * $ *****************************************************************************/ --- 205,216 ---- /***************************************************************************** * $Log: ! * 7 Biblioteka1.6 11/10/2002 2:33:30 PMDarko Kolakovic ! * 6 Biblioteka1.5 10/10/2002 8:26:06 PMDarko Kolakovic Fixed x86 * version (16-bit) ! * 5 Biblioteka1.4 19/09/2002 5:37:37 PMDarko Kolakovic ! * 4 Biblioteka1.3 19/09/2002 1:14:36 AMDarko ! * 3 Biblioteka1.2 18/09/2002 6:13:35 PMDarko Kolakovic Start() /Win9x ! * 2 Biblioteka1.1 17/09/2002 2:36:45 PMDarko Kolakovic Added KioPIT.h ! * 1 Biblioteka1.0 16/09/2002 5:57:06 PMDarko Kolakovic * $ *****************************************************************************/ Index: KFileGetF.cpp =================================================================== RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/16/KFileGetF.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** KFileGetF.cpp 28 Jan 2003 04:42:21 -0000 1.3 --- KFileGetF.cpp 13 Oct 2003 14:37:28 -0000 1.4 *************** *** 115,119 **** /***************************************************************************** * $Log: ! * 1 Biblioteka1.0 27/08/2002 4:04:31 PMDarko Kolakovic * $ * Jan 93 Darko Kolakovic --- 115,119 ---- /***************************************************************************** * $Log: ! * 1 Biblioteka1.0 27/08/2002 5:04:31 PMDarko Kolakovic * $ * Jan 93 Darko Kolakovic Index: KFileGetS.cpp =================================================================== RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/16/KFileGetS.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** KFileGetS.cpp 28 Jan 2003 04:42:21 -0000 1.3 --- KFileGetS.cpp 13 Oct 2003 14:37:28 -0000 1.4 *************** *** 61,65 **** /***************************************************************************** * $Log: ! * 1 Biblioteka1.0 27/08/2002 4:04:34 PMDarko Kolakovic * $ * Jan 93 Darko Kolakovic --- 61,65 ---- /***************************************************************************** * $Log: ! * 1 Biblioteka1.0 27/08/2002 5:04:34 PMDarko Kolakovic * $ * Jan 93 Darko Kolakovic Index: KFileN16.cpp =================================================================== RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/16/KFileN16.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** KFileN16.cpp 28 Jan 2003 04:42:21 -0000 1.3 --- KFileN16.cpp 13 Oct 2003 14:37:28 -0000 1.4 *************** *** 71,75 **** /***************************************************************************** * $Log: ! * 1 Biblioteka1.0 27/08/2002 4:04:37 PMDarko Kolakovic * $ * May 98 Created Win32 version D.K. --- 71,75 ---- /***************************************************************************** * $Log: ! * 1 Biblioteka1.0 27/08/2002 5:04:37 PMDarko Kolakovic * $ * May 98 Created Win32 version D.K. Index: KFileN16.inl =================================================================== RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/16/KFileN16.inl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** KFileN16.inl 28 Jan 2003 04:42:21 -0000 1.3 --- KFileN16.inl 13 Oct 2003 14:37:28 -0000 1.4 *************** *** 55,59 **** /***************************************************************************** * $Log: ! * 1 Biblioteka1.0 27/08/2002 4:04:41 PMDarko Kolakovic * $ * May 98 Created Win32 version D.K. --- 55,59 ---- /***************************************************************************** * $Log: ! * 1 Biblioteka1.0 27/08/2002 5:04:41 PMDarko Kolakovic * $ * May 98 Created Win32 version D.K. Index: KioPIT.h =================================================================== RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/16/KioPIT.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KioPIT.h 28 Jan 2003 04:42:21 -0000 1.2 --- KioPIT.h 13 Oct 2003 14:37:28 -0000 1.3 *************** *** 61,74 **** Bits 7,6 Counter Select Bits ! 00 select Counter 0 ! 01 select Counter 1 ! 10 select Counter 2 ! 11 read back command (8254 only, illegal on 8253, see below) Bits 5,4 Read/Write/Latch Format Bits ! 00 latch present counter value ! 01 read/write of Most Significant Bit (MSB) only ! 10 read/write of Least Significant Bit (LSB) only ! 11 read/write LSB, followed by write of MSB Bits 3,2,1 Counter Mode Bits --- 61,74 ---- Bits 7,6 Counter Select Bits ! 00 select Counter 0 ! 01 select Counter 1 ! 10 select Counter 2 ! 11 read back command (8254 only, illegal on 8253, see below) Bits 5,4 Read/Write/Latch Format Bits ! 00 latch present counter value ! 01 read/write of Most Significant Bit (MSB) only ! 10 read/write of Least Significant Bit (LSB) only ! 11 read/write LSB, followed by write of MSB Bits 3,2,1 Counter Mode Bits Index: KioPPI.h =================================================================== RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/16/KioPPI.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** KioPPI.h 28 Jan 2003 04:42:21 -0000 1.3 --- KioPPI.h 13 Oct 2003 14:37:28 -0000 1.4 *************** *** 33,45 **** Bits 7,6 Number of Disk Drives Bits ! 00 1 disk drive ! 01 2 disk drives ! 10 3 disk drives ! 11 4 disk drives Bits 4,5 Video Mode Bits ! 01 Color (40 rows x 25 columns) ! 10 Color (80 rows x 25 columns) ! 11 Monochrome (80 row x 25 col) */ const int IOC_PPI_PORT_A = 0x60; --- 33,45 ---- Bits 7,6 Number of Disk Drives Bits ! 00 1 disk drive ! 01 2 disk drives ! 10 3 disk drives ! 11 4 disk drives Bits 4,5 Video Mode Bits ! 01 Color (40 rows x 25 columns) ! 10 Color (80 rows x 25 columns) ! 11 Monochrome (80 row x 25 col) */ const int IOC_PPI_PORT_A = 0x60; *************** *** 82,89 **** Bits 7,6 Number of Disk Drives Bits ! 00 1 disk drive ! 01 2 disk drives ! 10 3 disk drives ! 11 4 disk drives */ const uint8 IOC_PPI_PORT_A_DISKCNT = 0xC0; --- 82,89 ---- Bits 7,6 Number of Disk Drives Bits ! 00 1 disk drive ! 01 2 disk drives ! 10 3 disk drives ! 11 4 disk drives */ const uint8 IOC_PPI_PORT_A_DISKCNT = 0xC0; *************** *** 91,97 **** Bits 4,5 Video Mode Bits ! 01 Color (40 rows x 25 columns) ! 10 Color (80 rows x 25 columns) ! 11 Monochrome (80 row x 25 col) */ const uint8 IOC_PPI_PORT_A_VIDEO = 0x30; --- 91,97 ---- Bits 4,5 Video Mode Bits ! 01 Color (40 rows x 25 columns) ! 10 Color (80 rows x 25 columns) ! 11 Monochrome (80 row x 25 col) */ const uint8 IOC_PPI_PORT_A_VIDEO = 0x30; *************** *** 125,137 **** Bits 7,6 Number of Disk Drives Bits ! 00 1 disk drive ! 01 2 disk drives ! 10 3 disk drives ! 11 4 disk drives Bits 4,5 Video Mode Bits ! 01 Color (40 rows x 25 columns) ! 10 Color (80 rows x 25 columns) ! 11 Monochrome (80 row x 25 col) Port B Mode Control Register: --- 125,137 ---- Bits 7,6 Number of Disk Drives Bits ! 00 1 disk drive ! 01 2 disk drives ! 10 3 disk drives ! 11 4 disk drives Bits 4,5 Video Mode Bits ! 01 Color (40 rows x 25 columns) ! 10 Color (80 rows x 25 columns) ! 11 Monochrome (80 row x 25 col) Port B Mode Control Register: *************** *** 172,178 **** If bit 3 of Port B (Port C Mode - XT) is set to 1, returns Video Mode Status: ! 01 Color (40 rows x 25 columns) ! 10 Color (80 rows x 25 columns) ! 11 Monochrome (80 row x 25 col) If bit 3 of Port B (Port C Mode - XT) is set to 0, returns values of Configuration Jumpers (Switches) 2 and 1. --- 172,178 ---- If bit 3 of Port B (Port C Mode - XT) is set to 1, returns Video Mode Status: ! 01 Color (40 rows x 25 columns) ! 10 Color (80 rows x 25 columns) ! 11 Monochrome (80 row x 25 col) If bit 3 of Port B (Port C Mode - XT) is set to 0, returns values of Configuration Jumpers (Switches) 2 and 1. *************** *** 181,188 **** If bit 3 of Port B (Port C Mode - XT) is set to 1, returns Number of Disk Drives: ! 00 1 disk drive ! 01 2 disk drives ! 10 3 disk drives ! 11 4 disk drives If bit 3 of Port B (Port C Mode - XT) is set to 0, returns values of Configuration Jumpers (Switches) 4 and 3. --- 181,188 ---- If bit 3 of Port B (Port C Mode - XT) is set to 1, returns Number of Disk Drives: ! 00 1 disk drive ! 01 2 disk drives ! 10 3 disk drives ! 11 4 disk drives If bit 3 of Port B (Port C Mode - XT) is set to 0, returns values of Configuration Jumpers (Switches) 4 and 3. *************** *** 213,217 **** /****************************************************************************** *$Log: ! * 1 Biblioteka1.0 18/09/2002 5:12:32 PMDarko Kolakovic *$ *****************************************************************************/ --- 213,217 ---- /****************************************************************************** *$Log: ! * 1 Biblioteka1.0 18/09/2002 6:12:32 PMDarko Kolakovic *$ *****************************************************************************/ |
From: <dd...@us...> - 2003-06-12 22:51:02
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/_LibraryTest In directory sc8-pr-cvs1:/tmp/cvs-serv24434/Cpp/Samples/_LibraryTest Added Files: _LibraryTest.vcproj Log Message: |
From: <dd...@us...> - 2003-06-12 22:50:12
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/_LibraryTest In directory sc8-pr-cvs1:/tmp/cvs-serv24154 Removed Files: LibraryTest.log Log Message: no message --- LibraryTest.log DELETED --- |
From: <dd...@us...> - 2003-06-12 22:49:45
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/_LibraryTest In directory sc8-pr-cvs1:/tmp/cvs-serv23960/Cpp/Samples/_LibraryTest Removed Files: _LibraryTest.vcproj Log Message: --- _LibraryTest.vcproj DELETED --- |
From: <dd...@us...> - 2003-06-12 22:17:54
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Timer In directory sc8-pr-cvs1:/tmp/cvs-serv11218/Cpp/Samples/Timer Added Files: resource.h StdAfx.cpp StdAfx.h Timer.cpp Timer.dsp Timer.dsw Timer.h Timer.rc TimerDlg.cpp TimerDlg.h TimerProc.cpp Log Message: Win resizble dlg. sample --- NEW FILE: resource.h --- //{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by Timer.rc // #define ID_TIMER1 3 #define ID_TIMER2 4 #define IDM_ABOUTBOX 0x0010 #define IDD_ABOUTBOX 100 #define IDS_ABOUTBOX 101 #define IDD_TIMER_DIALOG 102 #define IDS_ELAPSEDTIME 102 #define IDR_MAINFRAME 128 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 129 #define _APS_NEXT_COMMAND_VALUE 32771 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif --- NEW FILE: StdAfx.cpp --- // stdafx.cpp : source file that includes just the standard includes // Timer.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "StdAfx.h" #include "KTimer.h" //CTimer class /////////////////////////////////////////////////////////////////////////////// // Globals CTimer* g_pctTimer1 = NULL; CTimer* g_pctTimer2 = NULL; --- NEW FILE: StdAfx.h --- // stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #if !defined(AFX_STDAFX_H__383E4A3F_64E2_11D5_AB38_000103BE4653__INCLUDED_) #define AFX_STDAFX_H__383E4A3F_64E2_11D5_AB38_000103BE4653__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #include <afxwin.h> // MFC core and standard components #include <afxext.h> // MFC extensions #include <afxdisp.h> // MFC Automation classes #include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls #ifndef _AFX_NO_AFXCMN_SUPPORT #include <afxcmn.h> // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_STDAFX_H__383E4A3F_64E2_11D5_AB38_000103BE4653__INCLUDED_) --- NEW FILE: Timer.cpp --- // Timer.cpp : Defines the class behaviors for the application. // #include "stdafx.h" #include "Timer.h" #include "TimerDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CTimerApp BEGIN_MESSAGE_MAP(CTimerApp, CWinApp) //{{AFX_MSG_MAP(CTimerApp) // NOTE - the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code! //}}AFX_MSG ON_COMMAND(ID_HELP, CWinApp::OnHelp) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CTimerApp construction //##ModelId=3ECE70890304 CTimerApp::CTimerApp() { // TODO: add construction code here, // Place all significant initialization in InitInstance } ///////////////////////////////////////////////////////////////////////////// // The one and only CTimerApp object CTimerApp theApp; ///////////////////////////////////////////////////////////////////////////// // CTimerApp initialization //##ModelId=3ECE70890305 BOOL CTimerApp::InitInstance() { AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif CTimerDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; } --- NEW FILE: Timer.dsp --- # Microsoft Developer Studio Project File - Name="Timer" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=Timer - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "Timer.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "Timer.mak" CFG="Timer - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "Timer - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "Timer - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "Timer - Win32 Release" # PROP BASE Use_MFC 6 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 6 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Obj\Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" # ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 # ADD LINK32 /nologo /subsystem:windows /machine:I386 !ELSEIF "$(CFG)" == "Timer - Win32 Debug" # PROP BASE Use_MFC 6 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 6 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Obj\Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" # ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "Timer - Win32 Release" # Name "Timer - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\KTaskIco.cpp !IF "$(CFG)" == "Timer - Win32 Release" !ELSEIF "$(CFG)" == "Timer - Win32 Debug" # SUBTRACT CPP /YX /Yc /Yu !ENDIF # End Source File # Begin Source File SOURCE=..\..\KTimer.cpp !IF "$(CFG)" == "Timer - Win32 Release" !ELSEIF "$(CFG)" == "Timer - Win32 Debug" # SUBTRACT CPP /YX /Yc /Yu !ENDIF # End Source File # Begin Source File SOURCE=..\..\KTimerW.cpp !IF "$(CFG)" == "Timer - Win32 Release" !ELSEIF "$(CFG)" == "Timer - Win32 Debug" # SUBTRACT CPP /YX /Yc /Yu !ENDIF # End Source File # Begin Source File SOURCE=.\StdAfx.cpp # ADD CPP /Yc"stdafx.h" # End Source File # Begin Source File SOURCE=.\Timer.cpp # End Source File # Begin Source File SOURCE=.\Timer.rc # End Source File # Begin Source File SOURCE=.\TimerDlg.cpp # End Source File # Begin Source File SOURCE=.\TimerProc.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\KTaskIco.h # End Source File # Begin Source File SOURCE=..\..\KTimer.h # End Source File # Begin Source File SOURCE=..\..\KTimerW.h # End Source File # Begin Source File SOURCE=.\Resource.h # End Source File # Begin Source File SOURCE=.\StdAfx.h # End Source File # Begin Source File SOURCE=.\Timer.h # End Source File # Begin Source File SOURCE=.\TimerDlg.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # Begin Source File SOURCE=.\res\Timer.ico # End Source File # Begin Source File SOURCE=.\res\Timer.rc2 # End Source File # End Group # Begin Source File SOURCE=.\ReadMe.txt # End Source File # End Target # End Project --- NEW FILE: Timer.dsw --- Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "Timer"=.\Timer.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### --- NEW FILE: Timer.h --- // Timer.h : main header file for the TIMER application // #if !defined(AFX_TIMER_H__383E4A3B_64E2_11D5_AB38_000103BE4653__INCLUDED_) #define AFX_TIMER_H__383E4A3B_64E2_11D5_AB38_000103BE4653__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #ifndef __AFXWIN_H__ #error include 'stdafx.h' before including this file for PCH #endif #include "resource.h" // main symbols ///////////////////////////////////////////////////////////////////////////// // CTimerApp: // See Timer.cpp for the implementation of this class // //##ModelId=3ECE708902E6 class CTimerApp : public CWinApp { public: //##ModelId=3ECE70890304 CTimerApp(); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CTimerApp) public: //##ModelId=3ECE70890305 virtual BOOL InitInstance(); //}}AFX_VIRTUAL // Implementation //{{AFX_MSG(CTimerApp) // NOTE - the ClassWizard will add and remove member functions here. // DO NOT EDIT what you see in these blocks of generated code ! //}}AFX_MSG DECLARE_MESSAGE_MAP() }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_TIMER_H__383E4A3B_64E2_11D5_AB38_000103BE4653__INCLUDED_) --- NEW FILE: Timer.rc --- //Microsoft Developer Studio generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) #endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END 2 TEXTINCLUDE DISCARDABLE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE DISCARDABLE BEGIN "#define _AFX_NO_SPLITTER_RESOURCES\r\n" "#define _AFX_NO_OLE_RESOURCES\r\n" "#define _AFX_NO_TRACKER_RESOURCES\r\n" "#define _AFX_NO_PROPERTY_RESOURCES\r\n" "\r\n" "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" "#ifdef _WIN32\r\n" "LANGUAGE 9, 1\r\n" "#pragma code_page(1252)\r\n" "#endif //_WIN32\r\n" "#include ""res\\Timer.rc2"" // non-Microsoft Visual C++ edited resources\r\n" "#include ""afxres.rc"" // Standard components\r\n" "#endif\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Icon // // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDR_MAINFRAME ICON DISCARDABLE "res\\Timer.ico" ///////////////////////////////////////////////////////////////////////////// // // Dialog // IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "About Timer" FONT 8, "MS Sans Serif" BEGIN ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 LTEXT "Timer Version 1.0",IDC_STATIC,40,10,119,8,SS_NOPREFIX LTEXT "Copyright (C) 2001",IDC_STATIC,40,25,119,8 DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP END IDD_TIMER_DIALOG DIALOGEX 0, 0, 219, 58 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_APPWINDOW CAPTION "Timer" FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "Start Timer",IDOK,7,7,50,14 PUSHBUTTON "Cancel",IDCANCEL,162,38,50,14 DEFPUSHBUTTON "Timer 1",ID_TIMER1,7,23,102,14 DEFPUSHBUTTON "Timer 2",ID_TIMER2,7,37,102,14 END #ifndef _MAC ///////////////////////////////////////////////////////////////////////////// // // Version // VS_VERSION_INFO VERSIONINFO FILEVERSION 1,0,0,1 PRODUCTVERSION 1,0,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS 0x4L FILETYPE 0x1L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "Timer MFC Application\0" VALUE "FileVersion", "1, 0, 0, 1\0" VALUE "InternalName", "Timer\0" VALUE "LegalCopyright", "Copyright (C) 2001\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "Timer.EXE\0" VALUE "ProductName", "Timer Application\0" VALUE "ProductVersion", "1, 0, 0, 1\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END #endif // !_MAC ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO // #ifdef APSTUDIO_INVOKED GUIDELINES DESIGNINFO DISCARDABLE BEGIN IDD_ABOUTBOX, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 228 TOPMARGIN, 7 BOTTOMMARGIN, 48 END IDD_TIMER_DIALOG, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 212 TOPMARGIN, 7 BOTTOMMARGIN, 51 END END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // String Table // STRINGTABLE DISCARDABLE BEGIN IDS_ABOUTBOX "&About Timer..." IDS_ELAPSEDTIME "elapsed time = %f [s]" END #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // #define _AFX_NO_SPLITTER_RESOURCES #define _AFX_NO_OLE_RESOURCES #define _AFX_NO_TRACKER_RESOURCES #define _AFX_NO_PROPERTY_RESOURCES #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE 9, 1 #pragma code_page(1252) #endif //_WIN32 #include "res\Timer.rc2" // non-Microsoft Visual C++ edited resources #include "afxres.rc" // Standard components #endif ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED --- NEW FILE: TimerDlg.cpp --- // TimerDlg.cpp : implementation file // #include "StdAfx.h" #include "Timer.h" #include "TimerDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CAboutDlg dialog used for App About //##ModelId=3ECE708B01DA class CAboutDlg : public CDialog { public: //##ModelId=3ECE708B01F8 CAboutDlg(); // Dialog Data //{{AFX_DATA(CAboutDlg) enum { IDD = IDD_ABOUTBOX }; //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CAboutDlg) protected: //##ModelId=3ECE708B0202 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: //{{AFX_MSG(CAboutDlg) //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //##ModelId=3ECE708B01F8 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) { //{{AFX_DATA_INIT(CAboutDlg) //}}AFX_DATA_INIT } //##ModelId=3ECE708B0202 void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CAboutDlg) //}}AFX_DATA_MAP } /////////////////////////////////////////////////////////////////////////////// const int TIME_OUT = 1000;//time interval [ms] BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) //{{AFX_MSG_MAP(CAboutDlg) // No message handlers //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CTimerDlg dialog //##ModelId=3ECE708901CD CTimerDlg::CTimerDlg(CWnd* pParent /*=NULL*/) : CDialog(CTimerDlg::IDD, pParent) { //{{AFX_DATA_INIT(CTimerDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } //##ModelId=3ECE708901D7 void CTimerDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CTimerDlg) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CTimerDlg, CDialog) //{{AFX_MSG_MAP(CTimerDlg) ON_WM_SYSCOMMAND() ON_WM_PAINT() ON_WM_QUERYDRAGICON() ON_BN_CLICKED(ID_TIMER1, OnTimer1) ON_BN_CLICKED(ID_TIMER2, OnTimer2) ON_WM_TIMER() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CTimerDlg message handlers //CTimerW* pTimer = NULL; //##ModelId=3ECE7089023B BOOL CTimerDlg::OnInitDialog() { CDialog::OnInitDialog(); // Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { CString strAboutMenu; strAboutMenu.LoadString(IDS_ABOUTBOX); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon m_ctwTimer1.Start(2*TIME_OUT, GetSafeHwnd(), CTimerDlg::IDD); m_ctwTimer2.Start(3*TIME_OUT, GetSafeHwnd(), CTimerDlg::IDD+1); // TODO: Add extra initialization here return TRUE; // return TRUE unless you set the focus to a control } //##ModelId=3ECE70890250 void CTimerDlg::OnSysCommand(UINT nID, LPARAM lParam) { if ((nID & 0xFFF0) == IDM_ABOUTBOX) { CAboutDlg dlgAbout; dlgAbout.DoModal(); } else { CDialog::OnSysCommand(nID, lParam); } } // If you add a minimize button to your dialog, you will need the code below // to draw the icon. For MFC applications using the document/view model, // this is automatically done for you by the framework. //##ModelId=3ECE70890265 void CTimerDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Center icon in client rectangle int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon dc.DrawIcon(x, y, m_hIcon); } else { CDialog::OnPaint(); } } // The system calls this to obtain the cursor to display while the user drags // the minimized window. //##ModelId=3ECE70890278 HCURSOR CTimerDlg::OnQueryDragIcon() { return (HCURSOR) m_hIcon; } //::OnOK()--------------------------------------------------------------------- #include "KTimer.h" //CTimer class /*Called when the user clicks the OK button (the button with an ID of IDOK). Creates new timers. */ //##ModelId=3ECE70890282 void CTimerDlg::OnOK() { TRACE0("CTimerDlg::OnOK()\n"); CreateCallbackTimer(); } //::CreateCallbackTimer()-------------------------------------------------------------- /*Testing creation of new timers. The timers are using callback function. System uses DWORD value to pass time elapsed since it was started and will wrap to zero after 49.7 days. */ //##ModelId=3ECE70890231 void CTimerDlg::CreateCallbackTimer() { TRACE0("CTimerDlg::CreateCallbackTimer()\n"); //Create simple timers with assigned callback function extern VOID CALLBACK MyTimerProc(HWND hWnd,UINT uMsg,UINT nTimerID,DWORD dwTime); extern CTimer* g_pctTimer1; extern CTimer* g_pctTimer2; //Initialize timers if (g_pctTimer1 == NULL) g_pctTimer1 = new CTimer(); if (g_pctTimer2 == NULL) { g_pctTimer2 = new CTimer(MyTimerProc); g_pctTimer1->SetTimerProc(MyTimerProc); } //Run timers g_pctTimer1->Start(TIME_OUT); g_pctTimer2->Start(4*TIME_OUT); } //::OnCancel()----------------------------------------------------------------- /*Called when the user clicks the Cancel button (the button with an ID of IDCANCEL). Deletes timers. */ //##ModelId=3ECE7089028D void CTimerDlg::OnCancel() { TRACE0("CTimerDlg::OnCancel()\n"); extern CTimer* g_pctTimer1; extern CTimer* g_pctTimer2; if (g_pctTimer1 != NULL) { #ifdef _DEBUG g_pctTimer1->Dump(); #endif delete g_pctTimer1; g_pctTimer1 = NULL; } if (g_pctTimer2 != NULL) { #ifdef _DEBUG g_pctTimer2->Dump(); #endif delete g_pctTimer2; g_pctTimer2 = NULL; } m_ctwTimer1.Stop(); m_ctwTimer2.Stop(); CDialog::OnCancel(); } //::OnTimer1()----------------------------------------------------------------- /*Called when the user clicks the Timer 1 button (the button with an ID of ID_TIMER1). Stops or starts first callback timer. */ //##ModelId=3ECE708902A0 void CTimerDlg::OnTimer1() { extern CTimer* g_pctTimer1; if (g_pctTimer1 != NULL) { if(g_pctTimer1->IsStarted()) g_pctTimer1->Stop(); else g_pctTimer1->Start(TIME_OUT); } } //::OnTimer2()----------------------------------------------------------------- /*Called when the user clicks the Timer 2 button (the button with an ID of ID_TIMER2). Stops or starts second callback timer. */ //##ModelId=3ECE708902AA void CTimerDlg::OnTimer2() { extern CTimer* g_pctTimer2; if (g_pctTimer2 != NULL) { if(g_pctTimer2->IsStarted()) g_pctTimer2->Stop(); else g_pctTimer2->Start(4*TIME_OUT); } } //::OnTimer()-------------------------------------------------------- /*Handles WM_TIMER messages sent by m_ctwTimer2. */ //##ModelId=3ECE708902B5 void CTimerDlg::OnTimer(UINT nIDEvent) { TRACE1("CTimerDlg::OnTimer(ID = %d)\n",nIDEvent); switch(nIDEvent) { case CTimerDlg::IDD: break; case (CTimerDlg::IDD +1): break; } CDialog::OnTimer(nIDEvent); } --- NEW FILE: TimerDlg.h --- // TimerDlg.h : header file // #if !defined(AFX_TIMERDLG_H__383E4A3D_64E2_11D5_AB38_000103BE4653__INCLUDED_) #define AFX_TIMERDLG_H__383E4A3D_64E2_11D5_AB38_000103BE4653__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "KTimerW.h" //CTimerW class ///////////////////////////////////////////////////////////////////////////// // CTimerDlg dialog //##ModelId=3ECE708901B0 class CTimerDlg : public CDialog { // Construction public: //##ModelId=3ECE708901CD CTimerDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CTimerDlg) enum { IDD = IDD_TIMER_DIALOG }; // NOTE: the ClassWizard will add data members here //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CTimerDlg) protected: //##ModelId=3ECE708901D7 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: //##ModelId=3ECE708901EB HICON m_hIcon; //##ModelId=3ECE70890200 CTimerW m_ctwTimer1; //first timer with private message loop //##ModelId=3ECE7089021E CTimerW m_ctwTimer2; //second timer //##ModelId=3ECE70890231 void CreateCallbackTimer(); // Generated message map functions //{{AFX_MSG(CTimerDlg) //##ModelId=3ECE7089023B virtual BOOL OnInitDialog(); //##ModelId=3ECE70890250 afx_msg void OnSysCommand(UINT nID, LPARAM lParam); //##ModelId=3ECE70890265 afx_msg void OnPaint(); //##ModelId=3ECE70890278 afx_msg HCURSOR OnQueryDragIcon(); //##ModelId=3ECE70890282 virtual void OnOK(); //##ModelId=3ECE7089028D virtual void OnCancel(); //##ModelId=3ECE708902A0 afx_msg void OnTimer1(); //##ModelId=3ECE708902AA afx_msg void OnTimer2(); //##ModelId=3ECE708902B5 afx_msg void OnTimer(UINT nIDEvent); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_TIMERDLG_H__383E4A3D_64E2_11D5_AB38_000103BE4653__INCLUDED_) --- NEW FILE: TimerProc.cpp --- // TimerProc.cpp : implementation file // #include "StdAfx.h" #include "KTimer.h" //CTimer class #include "Resource.h" #include "TimerDlg.h" //CTimerDlg class #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif /*Timer procedure used as an example for timer callaback function. The timer procedure is an application-defined callback function that processes WM_TIMER messages. Note: The elapsed time is stored as a DWORD value. Therefore, the time will wrap around to zero if the system is run continuously for 49.7 days. See also: TIMERPROC */ VOID CALLBACK MyTimerProc(HWND hWnd, //handle of window processing timer messages UINT uMsg, //WM_TIMER message UINT nTimerID, //timer identifier DWORD dwTime //number of milliseconds that have //elapsed since the system was started ) { TRACE2("MyTimerProc(hWnd = %x, ID = %d, elapsed time = ",hWnd,nTimerID); extern CTimer* g_pctTimer1; extern CTimer* g_pctTimer2; CTimerDlg* pMainWnd = (CTimerDlg*)AfxGetMainWnd(); ASSERT(pMainWnd != NULL); DWORD dwElapsedTime; //elapsed time [ms] CString strOutput; //output text CWnd* pWnd; //output control if (nTimerID == g_pctTimer1->GetID()) { dwElapsedTime = g_pctTimer1->GetElapsedTime(dwTime); pWnd = pMainWnd->GetDlgItem(ID_TIMER1); TRACE1("%u [ms])\n",dwElapsedTime); } else if (nTimerID == g_pctTimer2->GetID()) { dwElapsedTime = g_pctTimer2->GetElapsedTime(dwTime); pWnd = pMainWnd->GetDlgItem(ID_TIMER2); TRACE1("%u [ms])\n",dwElapsedTime); MessageBeep(MB_OK); } strOutput.Format(IDS_ELAPSEDTIME,(double)dwElapsedTime/1000.); pWnd->SetWindowText((LPCTSTR)strOutput); } |
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Stream In directory sc8-pr-cvs1:/tmp/cvs-serv9108 Added Files: Resource.h StdAfx.cpp StdAfx.h Stream.clw Stream.cpp Stream.dsp Stream.h Stream.rc TsFileHanling.cpp Log Message: New sample (STL) --- NEW FILE: Resource.h --- //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by Stream.rc // #define IDS_HELLO 1 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif --- NEW FILE: StdAfx.cpp --- // stdafx.cpp : source file that includes just the standard includes // Stream.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file --- NEW FILE: StdAfx.h --- // stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #if !defined(AFX_STDAFX_H__894836F2_3581_4248_881D_B32255767D58__INCLUDED_) #define AFX_STDAFX_H__894836F2_3581_4248_881D_B32255767D58__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #include <afx.h> #include <afxwin.h> // MFC core and standard components #include <afxext.h> // MFC extensions #include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls #ifndef _AFX_NO_AFXCMN_SUPPORT #include <afxcmn.h> // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT #include <iostream> // TODO: reference additional headers your program requires here //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_STDAFX_H__894836F2_3581_4248_881D_B32255767D58__INCLUDED_) --- NEW FILE: Stream.clw --- ; CLW file contains information for the MFC ClassWizard [General Info] Version=1 LastClass= LastTemplate=CDialog NewFileInclude1=#include "stdafx.h" NewFileInclude2=#include "Stream.h" LastPage=0 ClassCount=0 ResourceCount=0 --- NEW FILE: Stream.cpp --- // Stream.cpp : Defines the entry point for the console application. // // Group=Examples #include "StdAfx.h" #include "Stream.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif extern bool TestFileHandling(); ///////////////////////////////////////////////////////////////////////////// // The one and only application object CWinApp theApp; using namespace std; //_tmain()--------------------------------------------------------------------- /* */ int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { int nRetCode = EXIT_SUCCESS; //Initialize MFC and print and error on failure if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0)) { cerr << _T("Fatal Error: MFC initialization failed") << endl; nRetCode = EXIT_FAILURE; } else { // TODO: code your application's behavior here. CString strHello; strHello.LoadString(IDS_HELLO); cout << (LPCTSTR)strHello << endl; if (!TestFileHandling()) { cout << _T(" Failed!") << endl; nRetCode = EXIT_FAILURE; } } return nRetCode; } --- NEW FILE: Stream.dsp --- # Microsoft Developer Studio Project File - Name="Stream" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=Stream - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "Stream.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "Stream.mak" CFG="Stream - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "Stream - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "Stream - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "Stream - Win32 Release" # PROP BASE Use_MFC 2 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 2 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../.." /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c # ADD BASE RSC /l 0x1009 /d "NDEBUG" /d "_AFXDLL" # ADD RSC /l 0x1009 /d "NDEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "Stream - Win32 Debug" # PROP BASE Use_MFC 2 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 2 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../.." /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /FR /Yu"stdafx.h" /FD /GZ /c # ADD BASE RSC /l 0x1009 /d "_DEBUG" /d "_AFXDLL" # ADD RSC /l 0x1009 /d "_DEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "Stream - Win32 Release" # Name "Stream - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\KFileExtR.cpp !IF "$(CFG)" == "Stream - Win32 Release" !ELSEIF "$(CFG)" == "Stream - Win32 Debug" # SUBTRACT CPP /YX /Yc /Yu !ENDIF # End Source File # Begin Source File SOURCE=..\..\KFileFindOld.cpp # SUBTRACT CPP /YX /Yc /Yu # End Source File # Begin Source File SOURCE=..\..\KFileNam.cpp !IF "$(CFG)" == "Stream - Win32 Release" !ELSEIF "$(CFG)" == "Stream - Win32 Debug" # SUBTRACT CPP /YX /Yc /Yu !ENDIF # End Source File # Begin Source File SOURCE=..\..\KFileNmB.cpp !IF "$(CFG)" == "Stream - Win32 Release" !ELSEIF "$(CFG)" == "Stream - Win32 Debug" # SUBTRACT CPP /YX /Yc /Yu !ENDIF # End Source File # Begin Source File SOURCE=..\..\KFileNmF.cpp # End Source File # Begin Source File SOURCE=..\..\KFileShortcut.cpp # SUBTRACT CPP /YX /Yc /Yu # End Source File # Begin Source File SOURCE=..\..\KFileTmpName.cpp !IF "$(CFG)" == "Stream - Win32 Release" !ELSEIF "$(CFG)" == "Stream - Win32 Debug" # SUBTRACT CPP /YX /Yc /Yu !ENDIF # End Source File # Begin Source File SOURCE=..\..\KGetLine.cpp # End Source File # Begin Source File SOURCE=.\StdAfx.cpp # ADD CPP /Yc"StdAfx.h" # End Source File # Begin Source File SOURCE=.\Stream.cpp # End Source File # Begin Source File SOURCE=.\Stream.rc # End Source File # Begin Source File SOURCE=.\TsFileHanling.cpp # ADD CPP /Yu"StdAfx.h" # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\KFileExtR.h # End Source File # Begin Source File SOURCE=..\..\KFileHnd.inl # End Source File # Begin Source File SOURCE=..\..\KFileN32.inl # End Source File # Begin Source File SOURCE=..\..\KFileNam.h # End Source File # Begin Source File SOURCE=..\..\KFileNmB.h # End Source File # Begin Source File SOURCE=..\..\KFileShortcut.h # End Source File # Begin Source File SOURCE=..\..\KFileTimeCm.h # End Source File # Begin Source File SOURCE=.\Resource.h # End Source File # Begin Source File SOURCE=.\StdAfx.h # End Source File # Begin Source File SOURCE=.\Stream.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # Begin Source File SOURCE=.\ReadMe.txt # End Source File # End Target # End Project --- NEW FILE: Stream.h --- #if !defined(AFX_STREAM_H__C200E54E_0A0F_491D_B54A_052886A73BFF__INCLUDED_) #define AFX_STREAM_H__C200E54E_0A0F_491D_B54A_052886A73BFF__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "resource.h" #endif // !defined(AFX_STREAM_H__C200E54E_0A0F_491D_B54A_052886A73BFF__INCLUDED_) --- NEW FILE: Stream.rc --- //Microsoft Visual C++ generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE 9, 1 #pragma code_page(1252) #endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END 2 TEXTINCLUDE DISCARDABLE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // String Table // STRINGTABLE DISCARDABLE BEGIN IDS_HELLO "Hello from MFC!" END #endif ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED --- NEW FILE: TsFileHanling.cpp --- /*$Workfile: TsFileHanling.cpp$: implementation file $Revision: 3$ $Date: 16/07/2002 12:41:55 AM$ $Author: Darko$ Test file handling Copyright: CommonSoft Inc. Mar 2k2 D.Kolakovic */ // Group=Examples #include "StdAfx.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[] = __FILE__; #ifdef _MSC_VER /*MS VC/C++ - Disable warning */ //Fix for the warning(4786) cannot debug code with symbols longer //than 255 characters #pragma warning (disable: 4786) #endif #endif #include <vector> #include <iostream> #include <iomanip.h> //std::endl #include "KFileNmB.h" //CFileNameBrowser class extern CString FindOldestFile(LPCTSTR strDirectoryPath,LPCTSTR strFileExt); extern LPCTSTR CreateTmpFileName(CString& strResult, LPCTSTR strPrefix); //TestFileHandling()----------------------------------------------------------- /*Test file handling functions. */ bool TestFileHandling() { cout << endl << "====================" << endl; cout << "TestFileHandling()" << endl; bool bResult = true; std::vector<std::string> listFileNames; //Test browsing a directory CFileNameBrowser FileName("*"); while(!FileName.IsLastFileFound()) { listFileNames.push_back(++FileName); cout << listFileNames.size() << ".\t" << (LPCTSTR)FileName << (FileName.IsDirectory()? _T(" directory ") : _T("")) << endl; } //Find oldest file CString strOldFile; CString strDirectory = "./"; strOldFile = FindOldestFile(strDirectory,NULL); if ((GetLastError() == ERROR_SUCCESS) && !strOldFile.IsEmpty()) { strDirectory += strOldFile; cout << _T("oldest file is ") << (LPCTSTR)strDirectory << endl; } //Create Tmp File Name LPCTSTR szTmpFileName = CreateTmpFileName(strDirectory,"New"); if( szTmpFileName != NULL ) cout << _T("Unique file name is ") << szTmpFileName << endl; else bResult = false; return bResult; } /////////////////////////////////////////////////////////////////////////////// /****************************************************************************** *$Log: * 3 Biblioteka1.2 16/07/2002 12:41:55 AMDarko Fixed VSS Log * tag * 2 Biblioteka1.1 04/04/2002 11:49:18 PMDarko * CreateTmpFileName() * 1 Biblioteka1.0 12/03/2002 10:01:17 PMDarko *$ *****************************************************************************/ |
From: <dd...@us...> - 2003-06-12 21:41:16
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Stream In directory sc8-pr-cvs1:/tmp/cvs-serv29058/Stream Log Message: Directory /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Stream added to the repository |
From: <dd...@us...> - 2003-01-31 03:17:01
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/StlTools/Src In directory sc8-pr-cvs1:/tmp/cvs-serv25379/Cpp/Samples/StlTools/Src Added Files: StlMain.cpp stdafx.h stdafx.cpp Log Message: Created --- NEW FILE: StlMain.cpp --- /*$Workfile: S:\_SrcPool\Cpp\Samples\_LibraryTest\Src\_TestMain.cpp$: implementation file $Revision: 1.1 $ $Date: 2003/01/31 03:16:58 $ $Author: ddarko $ Defines the entry point for the console application used to test libray functionality. Jan. 90 Darko Kolakovic */ // Group=Examples #ifdef _MSC_VER /*Microsoft Visual Studio C/C++ compiler */ #ifndef _CONSOLE #error "define _CONSOLE macro in the project" #endif #endif #ifdef __GNUG__ /*GNU C++ compiler */ #ifndef _CONSOLE #warning "define _CONSOLE macro in the project" #endif #endif #include "stdafx.h" #include "KTrace.h" //TRACE macro #include "KTypedef.h" //BOOL typedef extern bool TestLeapYear(); //main()----------------------------------------------------------------------- /*Validates different date and time routines. Returns: EXIT_SUCCESS, which represents a value of 0, if successful. Otherwise a non-zero error code is returned. */ int _tmain(int argc, TCHAR* argv[] ) { cout << _T("Start Date and Time String") << endl << endl; if(TestLeapYear()) cout << "Succeeded." << endl << endl; else { cout << "Failed!" << endl; return EXIT_FAILURE + 1; } return EXIT_SUCCESS; } --- NEW FILE: stdafx.h --- /*$Workfile: S:\_SrcPool\Cpp\Samples\_LibraryTest\Src\stdafx.h$ : include file for standard system include files, or project specific include files that are used frequently, but are changed infrequently $Revision: 1.1 $ $Date: 2003/01/31 03:16:58 $ $Author: ddarko $ StdAfx.h, StdAfx.cpp These files are used to build a precompiled header (PCH) file named _LibraryTest.pch and a precompiled types file named StdAfx.obj. Files are generated by Microsoft Visual Studio */ #pragma once #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include <stdio.h> #ifdef __cplusplus #include <string> //std::string #include <iostream> //std::cout #include <iomanip.h> //std::endl #include "KTypedef.h" //Type definitions #include "KTChar.h" //Unicode mapping layer #include "KTrace.h" //debugging tools #include "KString.h" //CString #endif //__cplusplus // TODO: reference additional headers your program requires here --- NEW FILE: stdafx.cpp --- /*$Workfile: S:\_SrcPool\Cpp\Samples\_LibraryTest\Src\stdafx.cpp$ : source file that includes just the standard includes _LibraryTest.pch will be the pre-compiled header stdafx.obj will contain the pre-compiled type information $Revision: 1.1 $ $Date: 2003/01/31 03:16:58 $ $Author: ddarko $ StdAfx.h, StdAfx.cpp These files are used to build a precompiled header (PCH) file named _LibraryTest.pch and a precompiled types file named StdAfx.obj. Files are generated by Microsoft Visual Studio */ #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file |
From: <dd...@us...> - 2003-01-31 03:16:14
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/StlTools In directory sc8-pr-cvs1:/tmp/cvs-serv25145/Cpp/Samples/StlTools Added Files: StlTools.vcproj Log Message: Created --- NEW FILE: StlTools.vcproj --- <?xml version="1.0" encoding = "Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.00" Name="StlTools" ProjectGUID="{03B2D78C-C3AE-4AA1-9F05-7E2C9CA4EAE5}" Keyword="ManagedCProj"> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="Debug" IntermediateDirectory="Debug" ConfigurationType="1" CharacterSet="2" ManagedExtensions="TRUE"> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG" MinimalRebuild="FALSE" BasicRuntimeChecks="0" RuntimeLibrary="1" UsePrecompiledHeader="3" WarningLevel="3" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" OutputFile="$(OutDir)/StlTools.exe" LinkIncremental="2" GenerateDebugInformation="TRUE"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="Release" IntermediateDirectory="Release" ConfigurationType="1" CharacterSet="2" ManagedExtensions="TRUE"> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" PreprocessorDefinitions="WIN32;NDEBUG" MinimalRebuild="FALSE" RuntimeLibrary="0" UsePrecompiledHeader="3" WarningLevel="3" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" OutputFile="$(OutDir)/StlTools.exe" LinkIncremental="1" GenerateDebugInformation="TRUE"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> </Configurations> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> <File RelativePath="AssemblyInfo.cpp"> </File> <File RelativePath="StlTools.cpp"> </File> <File RelativePath="stdafx.cpp"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc"> <File RelativePath="stdafx.h"> </File> </Filter> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;r"> </Filter> <File RelativePath="ReadMe.txt"> </File> </Files> <Globals> </Globals> </VisualStudioProject> |
From: <dd...@us...> - 2003-01-31 03:15:46
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/StlTools/Src In directory sc8-pr-cvs1:/tmp/cvs-serv24981/Src Log Message: Directory /cvsroot/babylonlib/_SrcPool/Cpp/Samples/StlTools/Src added to the repository |
From: <dd...@us...> - 2003-01-31 03:15:29
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/StlTools In directory sc8-pr-cvs1:/tmp/cvs-serv24923/StlTools Log Message: Directory /cvsroot/babylonlib/_SrcPool/Cpp/Samples/StlTools added to the repository |
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Images/Src In directory sc8-pr-cvs1:/tmp/cvs-serv24634/Cpp/Samples/Images/Src Added Files: TestGifViewer.cpp TestBasicBarsBmp.c TestGifConversion.cpp TestGifCreate.cpp ImagesTest.cpp Log Message: Created --- NEW FILE: TestGifViewer.cpp --- /*$Workfile: TestGifViewer.cpp$: implementation file $Revision: 1.1 $ $Date: 2003/01/31 03:14:23 $ $Author: ddarko $ Test of GIF image decoder Mar 2k2 D. Kolakovic */ // Group=Examples #include <iostream> #include <iomanip.h> #include "KGifViewer.h" //CGifViewer class #include "KTrace.h" //TRACE macros #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif //TestGifViewer()--------------------------------------------------------------- /*Test of GIF image decoder Returns: true if successful, otherwise returns false */ bool TestGifViewer(char* szImageFileName, int iColors //[in] number of colors in the test image //palette or -1 to skip testing of palette //size ) { cout << "TestGifViewer(" << szImageFileName << ')' <<endl; bool bRes = false; //Create empty GIF object cout << " Read GIF file" << endl; CGifViewer gifImage; if (gifImage.Load(szImageFileName)) { gifImage.Dump(); if (gifImage.HasGlobalColorTable()) { if ( (iColors < 0) || //Skip test (gifImage.GetGlobalColorTable().GetSize() == (uint32)iColors) ) bRes = true; } } cout << endl << "======================" << endl; return bRes; } // Get File Size long GetFileSize(char* pszFile) { long lRes = 0; FILE* fileStream; #ifdef __MSDOS__ #define OPEN_FLAGS "rb" #else #define OPEN_FLAGS "r" #endif if( (fileStream=fopen(pszFile, OPEN_FLAGS)) != NULL ) { fseek(fileStream,0,SEEK_END); //Move pointer to end of file lRes = ftell(fileStream); //Get current file position fclose(fileStream); } return lRes; } //caller deletest the buffer BYTE* Load(char* pszFile) { BYTE* pResult = NULL; long lSize = GetFileSize(pszFile); if (lSize > 0) { FILE* fileStream = fopen(pszFile, "rb"); if (fileStream != NULL) { pResult = new BYTE[lSize]; if(pResult != NULL) { //Copy the filr to the buffer if(fread(pResult, sizeof(BYTE), lSize, fileStream) != (size_t)lSize) { //Failure delete[] pResult; pResult = NULL; perror(pszFile); } } fclose (fileStream); } else perror(pszFile); } return pResult; } //TestGifDecoder()------------------------------------------------------------- /*Test of decoding a GIF image. An image is stored complete in a continuous block in memory. Returns: true if successful, otherwise returns false */ bool TestGifDecoder(char* szImageFileName) { cout << "TestGifDecoder(" << szImageFileName << ')' <<endl; BYTE* pGifStream = Load(szImageFileName); if (pGifStream == NULL) return false; //Failed to open or read the file long lSize = GetFileSize(szImageFileName); CGifViewer gifDecoder; bool bRes = gifDecoder.Decode(pGifStream, lSize); delete pGifStream; //Free allocated memory cout << endl << "======================" << endl; return bRes; } /////////////////////////////////////////////////////////////////////////////// /****************************************************************************** *$Log: * 4 Biblioteka1.3 05/08/2002 10:33:46 AMDarko Fixed bug in * SeekImagePos * 3 Biblioteka1.2 31/07/2002 4:30:21 PMDarko Kolakovic * SeekImageDescriptor inserted * 2 Biblioteka1.1 16/07/2002 7:57:08 PMDarko Kolakovic Added * TestGifCreate() * 1 Biblioteka1.0 16/07/2002 12:48:21 AMDarko *$ *****************************************************************************/ --- NEW FILE: TestBasicBarsBmp.c --- /*$Workfile: TestBasicBarsBmp.c$: implementation file $Revision: 1.1 $ $Date: 2003/01/31 03:14:23 $ $Author: ddarko $ Microsoft DIB bitmap example June 2k2 D. Kolakovic */ /* Group=Images */ #include "KTypedef.h" //BYTE definition /*Monochrome bitmap that contains black and white horizontal strips. Size of bitmap stream is 142 bytes. Size of the image is 20 by 20 pixels. */ BYTE g_bmpBasicBars[] = { /*BITMAPFILEHEADER 14 bytes */ 0x42, 0x4D, /*bfType 'B','M'. Specifies the type of file */ 0x8E, 0x00, 0x00, 0x00, /*bfSize 142 bytes. Specifies the size of the file */ 0x00, 0x00, /*bfReserved1. Must be set to zero */ 0x00, 0x00, /*bfReserved2. Must be set to zero */ 0x3E, 0x00, 0x00, 0x00, /*bfOffBits 62 bytes Offset to image data bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD[]) */ /*BITMAPINFOHEADER 40 bytes */ 0x28, 0x00, 0x00, 0x00, /*biSize sizeof(BITMAPINFOHEADER) = 40 bytes */ 0x14, 0x00, 0x00, 0x00, /*biWidth 20 pixels. Image width */ 0x14, 0x00, 0x00, 0x00, /*biHeight 20 pixels. Image height */ 0x01, 0x00, /*biPlanes must be set to 1. Number of planes */ 0x01, 0x00, /*biBitCount 1 bit. Number of bits per pixel */ 0x00, 0x00, 0x00, 0x00, /*biCompression 0 = none. Compression type */ 0x50, 0x00, 0x00, 0x00, /*biSizeImage 80 bytes. Size of the image */ 0x13, 0x0B, 0x00, 0x00, /*biXPelsPerMeter 2835 px/m. Horizontal resolution */ 0x13, 0x0B, 0x00, 0x00, /*biYPelsPerMeter 2835 pixel/m. Vertical resolution*/ 0x02, 0x00, 0x00, 0x00, /*biClrUsed 2. Number of colors actually used */ 0x02, 0x00, 0x00, 0x00, /*biClrImportant 2. Number of important colors */ /*RGBQUAD[] 8 bytes. Pallete */ 0x00, 0x00, 0x00, 0x00, /*0. ( 0, 0, 0) black */ 0xFF, 0xFF, 0xFF, 0x00, /*1. (255,255,255) white */ /*BYTE[] 80 bytes. Image data */ 0xFF, 0xFF, 0xF0, 0x00, /*1111 1111 1111 1111 1111 */ 0x00, 0x00, 0x00, 0x00, /*0000 0000 0000 0000 0000 */ 0xFF, 0xFF, 0xF0, 0x00, /*1111 1111 1111 1111 1111 */ 0x00, 0x00, 0x00, 0x00, /*0000 0000 0000 0000 0000 */ 0xFF, 0xFF, 0xF0, 0x00, /*1111 1111 1111 1111 1111 */ 0x00, 0x00, 0x00, 0x00, /*0000 0000 0000 0000 0000 */ 0xFF, 0xFF, 0xF0, 0x00, /*1111 1111 1111 1111 1111 */ 0x00, 0x00, 0x00, 0x00, /*0000 0000 0000 0000 0000 */ 0xFF, 0xFF, 0xF0, 0x00, /*1111 1111 1111 1111 1111 */ 0x00, 0x00, 0x00, 0x00, /*0000 0000 0000 0000 0000 */ 0xFF, 0xFF, 0xF0, 0x00, /*1111 1111 1111 1111 1111 */ 0x00, 0x00, 0x00, 0x00, /*0000 0000 0000 0000 0000 */ 0xFF, 0xFF, 0xF0, 0x00, /*1111 1111 1111 1111 1111 */ 0x00, 0x00, 0x00, 0x00, /*0000 0000 0000 0000 0000 */ 0xFF, 0xFF, 0xF0, 0x00, /*1111 1111 1111 1111 1111 */ 0x00, 0x00, 0x00, 0x00, /*0000 0000 0000 0000 0000 */ 0xFF, 0xFF, 0xF0, 0x00, /*1111 1111 1111 1111 1111 */ 0x00, 0x00, 0x00, 0x00, /*0000 0000 0000 0000 0000 */ 0xFF, 0xFF, 0xF0, 0x00, /*1111 1111 1111 1111 1111 */ 0x00, 0x00, 0x00, 0x00 /*0000 0000 0000 0000 0000 */ }; /* ///////////////////////////////////////////////////////////////////////// */ /*Monochrome bitmap that contains black triangle. Size of bitmap stream is 446 bytes. Size of the image is 48 by 48 pixels. */ BYTE g_bmpDiagonal[] = { /*BITMAPFILEHEADER 14 bytes */ 0x42, 0x4D, 0xBE, 0x01, 0x00, 0x00, //446 bytes 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, //62 bytes 0x28, 0x00, 0x00, 0x00, //40 0x30, 0x00, 0x00, 0x00, //48 0x30, 0x00, 0x00, 0x00, //48 0x01, 0x00, //1 0x01, 0x00, // 1 bits/pixel 0x00, 0x00, 0x00, 0x00, // 0 compression 0x00, 0x00, 0x00, 0x00, //calculate image size 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //black 0xFF, 0xFF, 0xFF, 0x00, //white /*BYTE[] 384 bytes. Image data */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, /* 0. */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, /* 1. */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, /* 2. */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, /* 3. */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, /* 4. */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, /* 5. */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, /* 6. */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, /* 7. */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, /* 8. */ 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, /* 9. */ 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, /*10. */ 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, /*11. */ 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, /*12. */ 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, /*13. */ 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, /*14. */ 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, /*15. */ 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, /*16. */ 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, /*17. */ 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, /*18. */ 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, /*19. */ 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, /*20. */ 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, /*21. */ 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, /*22. */ 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, /*23. */ 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*24. */ 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*25. */ 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*26. */ 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*27. */ 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*28. */ 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*29. */ 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*30. */ 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*31. */ 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*32. */ 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*33. */ 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*34. */ 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*35. */ 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*36. */ 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*37. */ 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*38. */ 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*39. */ 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*40. */ 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*41. */ 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*42. */ 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*43. */ 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*44. */ 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*45. */ 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*46. */ 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF /*47. */ }; --- NEW FILE: TestGifConversion.cpp --- /*$Workfile: TestGifConversion.cpp$: implementation file $Revision: 1.1 $ $Date: 2003/01/31 03:14:23 $ $Author: ddarko $ Test GIF primitive conversons Mar 2k2 D. Kolakovic */ // Group=Examples #include <iostream> #include <iomanip.h> #include "KProgCst.h" //_ENDIAN_ORDER_ #include "KGif.h" //CGif class #include "KTrace.h" //TRACE macros #if (_ENDIAN_ORDER_ == _ENDIAN_BIG_) #pragma message ("Include Big Endian Swap files") #include "KSwpByte.h" #endif #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif //TestGifConversion()--------------------------------------------------------------- /*Test of GIF primitive conversions Returns: true if successful, otherwise returns false */ bool TestGifConversion() { cout << "TestGifConversion()" << endl; bool bRes = false; //Convert CGifColor to RGBQUAD cout << "Convert CGifColor to RGBQUAD" << endl; CGifColor gifColor(0x10, 0x20, 0x30); DWORD dwColorQ = (DWORD)gifColor; if (bRes = (dwColorQ == 0x00102030)) { #if (_ENDIAN_ORDER_ == _ENDIAN_BIG_) dwColorQ = SwapByteOrder(dwColorQ); #endif RGBQUAD* rgbColor = (RGBQUAD*)&dwColorQ; if (bRes = (rgbColor->rgbRed == gifColor.m_cRed)) if (bRes = (rgbColor->rgbBlue == gifColor.m_cBlue)) bRes = (rgbColor->rgbGreen == gifColor.m_cGreen); } cout << endl << "======================" << endl; return bRes; } /////////////////////////////////////////////////////////////////////////////// /****************************************************************************** *$Log: * 2 Biblioteka1.1 05/08/2002 10:33:43 AMDarko Fixed bug in * SeekImagePos * 1 Biblioteka1.0 02/08/2002 9:25:18 PMDarko Kolakovic *$ *****************************************************************************/ --- NEW FILE: TestGifCreate.cpp --- /*$Workfile: TestGifCreate.cpp$: implementation file $Revision: 1.1 $ $Date: 2003/01/31 03:14:23 $ $Author: ddarko $ Test GIF object initialization Mar 2k2 D. Kolakovic */ // Group=Examples #include "KGif.h" //CGif class #include "KTrace.h" //TRACE macros #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif //TestGifCreate()--------------------------------------------------------------- /*Test of GIF object initialization Returns: true if successful, otherwise returns false */ bool TestGifCreate() { TRACE0("TestGifCreate()\n"); bool bRes = false; //Create empty GIF object TRACE0(" Create empty GIF container\n"); CGif gifImage; if (gifImage.IsValid()) { if (!gifImage.HasGlobalColorTable()) { if (gifImage.GetGlobalColorTable().GetSize() == 0) bRes = true; } } if (!bRes) gifImage.Dump(); return bRes; } /////////////////////////////////////////////////////////////////////////////// /****************************************************************************** *$Log: * 1 Biblioteka1.0 16/07/2002 7:55:57 PMDarko Kolakovic *$ *****************************************************************************/ --- NEW FILE: ImagesTest.cpp --- /*$Workfile: ImagesTest.cpp$: implementation file $Revision: 1.1 $ $Date: 2003/01/31 03:14:23 $ $Author: ddarko $ Test of image decoders and viewers Copyright: CommonSoft Inc Mar 2k2 D. Kolakovic */ // Group=Examples #include <stdlib.h> //EXIT_SUCCESS definition #include <fstream.h> #include "KTrace.h" //TRACE0 macros #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif extern bool TestGifCreate(); extern bool TestGifConversion(); extern bool TestGifViewer(char* szImageFileName, int iColors); extern bool TestGifDecoder(char* szImageFileName); extern "C" const char* gifscan (FILE* infp /* infp = stdin;*/ ); //Image Test results struct TestImages { char* m_szImagePath; //file directory int m_iColorNo; //number of colors in color palette, table or map; //if -1, any number of colors is valid bool m_bTestResult; //result of successful test }; //Table of test images TestImages g_testImages[] = { {".\\Res\\TestBasicBars.gif" , 2, true}, // 0 {".\\Res\\TestRedWhite.gif" , 2, true}, // 1 {".\\Res\\TestTriangle.gif" , 2, true}, // 2 {".\\Res\\TestDiagonalGray.gif" , 16, true}, // 3 {".\\Res\\TestDiagonal.gif" , 16, true}, // 4 {".\\Res\\TestFourSeasons.gif" , 4, true}, // 5 {".\\Res\\TestInterlace.gif" , 4, true}, // 6 {".\\Res\\TestRainbow.gif" ,256, true}, // 7 {".\\Res\\TestBars.gif" , 16, true}, // 8 {".\\Res\\TestColor.gif" ,256, true}, // 9 {".\\Res\\TestGlobeAni.gif" ,256, true}, //10 {".\\Res\\TestTrueColor.gif" ,256, true}, //11 {".\\Res\\TestCorruptedBlock.gif", 2, false}, //12 {".\\Res\\TestAntialiasing.gif" ,256, true}, //13 {NULL , 0, false} //end of automated test }; //main()----------------------------------------------------------------------- /*Defines the entry point for the console application. Test of decoding and encoding various image formats. Returns: EXIT_SUCCESS if successful, otherwise returns EXIT_FAILURE. */ int main(int argc, char* argv[] //[in] 1st argument: file name ) { cout << "Validation of image decoding and converting\n\n" << endl; const int ARG_FILENAME = 1; //index of 'file name' argument if(argc <= ARG_FILENAME) { cerr << "Usage: Images [file_name]" << endl; cerr << "Proceeding with sample " << g_testImages[0].m_szImagePath << endl; } else { g_testImages[0].m_szImagePath = argv[ARG_FILENAME]; g_testImages[0].m_iColorNo = -1; g_testImages[1].m_szImagePath = NULL; g_testImages[1].m_iColorNo = 0; } if(!TestGifCreate()) { cout << " Failure!" << endl; return EXIT_FAILURE; } else cout << " Success." << endl; if(!TestGifConversion()) { cout << " Failure!" << endl; return EXIT_FAILURE; } else cout << " Success." << endl; //Test all images form a table int i = 0; while (g_testImages[i].m_szImagePath != NULL) { FILE *file; file = fopen(g_testImages[i].m_szImagePath, "rb"); if (file == NULL) return EXIT_FAILURE; cout << endl << i << ". " << g_testImages[i].m_szImagePath << " -------------------------" << endl; gifscan(file); cout << i << ". -------------------------" << endl; fclose(file); if(TestGifViewer(g_testImages[i].m_szImagePath, g_testImages[i].m_iColorNo) != true) { cout << " Failure!" << endl; return EXIT_FAILURE; } else cout << " Success." << endl; if( TestGifDecoder(g_testImages[i].m_szImagePath) != g_testImages[i].m_bTestResult) { cout << " Failure!" << endl; return EXIT_FAILURE; } else cout << " Success." << endl; i++; } cout << endl << "======================" << endl; return EXIT_SUCCESS; } /////////////////////////////////////////////////////////////////////////////// /****************************************************************************** *$Log: * 8 Biblioteka1.7 19/08/2002 9:45:15 AMDarko Kolakovic * 7 Biblioteka1.6 13/08/2002 8:12:42 AMDarko Kolakovic * 6 Biblioteka1.5 06/08/2002 3:36:10 PMDarko Kolakovic Added more * diagnostic information * 5 Biblioteka1.4 05/08/2002 10:33:30 AMDarko Fixed bug in * SeekImagePos * 4 Biblioteka1.3 02/08/2002 9:26:14 PMDarko Kolakovic * 3 Biblioteka1.2 31/07/2002 4:30:02 PMDarko Kolakovic * SeekImageDescriptor inserted * 2 Biblioteka1.1 16/07/2002 7:57:04 PMDarko Kolakovic Added * TestGifCreate() * 1 Biblioteka1.0 16/07/2002 12:48:19 AMDarko *$ *****************************************************************************/ |
From: <dd...@us...> - 2003-01-31 03:13:32
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Images/Res In directory sc8-pr-cvs1:/tmp/cvs-serv24351/Cpp/Samples/Images/Res Added Files: TestEdge.bmp Log Message: Just added --- NEW FILE: TestEdge.bmp --- (This appears to be a binary file; contents omitted.) |
From: <dd...@us...> - 2003-01-31 03:09:59
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Images/Src In directory sc8-pr-cvs1:/tmp/cvs-serv23347/Src Log Message: Directory /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Images/Src added to the repository |
From: <dd...@us...> - 2003-01-31 03:09:06
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/DateTime/Src In directory sc8-pr-cvs1:/tmp/cvs-serv23165/Cpp/Samples/DateTime/Src Modified Files: TsLeapYear.cpp Log Message: Write result to the test log Index: TsLeapYear.cpp =================================================================== RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/Samples/DateTime/Src/TsLeapYear.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TsLeapYear.cpp 30 Jan 2003 03:40:22 -0000 1.2 --- TsLeapYear.cpp 31 Jan 2003 03:09:03 -0000 1.3 *************** *** 16,22 **** --- 16,28 ---- #include "KTime.h" //IsLeapYear() #include "KTChar.h" //TCHAR typedef + #include "KTestLog.h" //TESTENTRY struct extern bool TsWriteToView(LPCTSTR lszText); + #ifdef _DEBUG + #undef THIS_FILE + static char THIS_FILE[] = __FILE__; + #endif + //TestLeapYear()------------------------------------------------------------ /*Function validates leap years. *************** *** 27,30 **** --- 33,39 ---- { TsWriteToView(_T("TestLeapYear()\r\n")); + TESTENTRY logEntry = + {_T("IsLeapYear()"), _T("KTime.h"), false}; + bool bRes = true; const int TESTCOUNT = 19; *************** *** 111,114 **** --- 120,128 ---- } + //Write test log + logEntry.m_bResult = bRes; + LogTest(&logEntry); + logEntry.m_szObjectName = _T("IS_LEAP_YEAR()"); + LogTest(&logEntry); TsWriteToView(_T("======================\r\n")); return bRes; *************** *** 118,121 **** --- 132,137 ---- /***************************************************************************** * $Log: + * 4 Biblioteka1.3 30/01/2003 9:47:38 PMDarko Write results + * to the test log * 3 Biblioteka1.2 22/01/2003 10:23:23 PMDarko Unicode * 2 Biblioteka1.1 20/01/2003 3:15:36 AMDarko Replaced BOOL |
From: <dd...@us...> - 2003-01-31 03:08:08
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Complex/Src In directory sc8-pr-cvs1:/tmp/cvs-serv22909/Cpp/Samples/Complex/Src Modified Files: StdAfx.h TestApp.cpp TsComplex.cpp Log Message: Replaced BOOL with bool Index: StdAfx.h =================================================================== RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Complex/Src/StdAfx.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StdAfx.h 28 Jan 2003 05:46:55 -0000 1.1 --- StdAfx.h 31 Jan 2003 03:08:05 -0000 1.2 *************** *** 1,20 **** ! // StdAfx.h : include file for standard system include files, ! // or project specific include files that are used frequently, but ! // are changed infrequently ! // ! ! #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers ! #define _AFX_NO_BSTR_SUPPORT //Bug fix: BSTR Redefinition generates error C2371 (article Q132966) ! ! #include <AfxWin.h> // MFC core and standard components ! #include <AfxExt.h> // MFC extensions ! #ifndef _AFX_NO_AFXCMN_SUPPORT ! #include <AfxCmn.h> // MFC support for Windows 95 Common Controls ! #endif // _AFX_NO_AFXCMN_SUPPORT ! ! #pragma comment( user, "Compiled on " __DATE__ " at " __TIME__ ) ! ! /////////////////////////////////////////////////////////////////////////////// ! //Function declarations ! BOOL TestComplex(); ! void TestPointToComplex(CPoint& ptPos); --- 1,20 ---- ! // StdAfx.h : include file for standard system include files, ! // or project specific include files that are used frequently, but ! // are changed infrequently ! // ! ! #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers ! #define _AFX_NO_BSTR_SUPPORT //Bug fix: BSTR Redefinition generates error C2371 (article Q132966) ! ! #include <AfxWin.h> // MFC core and standard components ! #include <AfxExt.h> // MFC extensions ! #ifndef _AFX_NO_AFXCMN_SUPPORT ! #include <AfxCmn.h> // MFC support for Windows 95 Common Controls ! #endif // _AFX_NO_AFXCMN_SUPPORT ! ! #pragma comment( user, "Compiled on " __DATE__ " at " __TIME__ ) ! ! /////////////////////////////////////////////////////////////////////////////// ! //Function declarations ! bool TestComplex(); ! void TestPointToComplex(CPoint& ptPos); Index: TestApp.cpp =================================================================== RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Complex/Src/TestApp.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestApp.cpp 28 Jan 2003 05:46:55 -0000 1.1 --- TestApp.cpp 31 Jan 2003 03:08:05 -0000 1.2 *************** *** 1,134 **** ! // Test.cpp : Defines the class behaviors for the application. ! // ! // Darko Kolakovic ! // Jan. 2k ! ! #include "StdAfx.h" ! #include "TestApp.h" ! ! #include "MainFrm.h" ! #include "TestDoc.h" ! #include "TestView.h" ! ! #ifdef _DEBUG ! #define new DEBUG_NEW ! #undef THIS_FILE ! static char THIS_FILE[] = __FILE__; ! #endif ! ! #if _MSC_VER == 1000 ! #pragma message ("Microsoft Visual C++ 4.0") ! #if _MFC_VER == 0x400 ! #pragma message ("MFC 4.0") ! #pragma message ("Support for Win32s included") ! #endif ! #endif ! ! #if _MSC_VER == 1200 ! #pragma message ("Microsoft Visual C++ 6.0") ! #if _MFC_VER == 0x600 ! #pragma message ("MFC 4.2") ! #endif ! #endif ! ! ///////////////////////////////////////////////////////////////////////////// ! // CTestApp ! ! BEGIN_MESSAGE_MAP(CTestApp, CWinApp) ! //{{AFX_MSG_MAP(CTestApp) ! ON_COMMAND(ID_APP_ABOUT, OnAppAbout) ! //}}AFX_MSG_MAP ! // Standard file based document commands ! END_MESSAGE_MAP() ! ! ///////////////////////////////////////////////////////////////////////////// ! ! //::CTestApp()------------------------------------------------------------- ! /*CTestApp construction ! */ ! CTestApp::CTestApp() ! { ! } ! ! ///////////////////////////////////////////////////////////////////////////// ! // The one and only CTestApp object ! CTestApp theApp; ! ! ///////////////////////////////////////////////////////////////////////////// ! // CTestApp initialization ! ! //::InitInstance()------------------------------------------------------------- ! /*Instance initialization that runs each time a copy of the program runs, ! including the first time. The frameworks implementation of WinMain calls ! this function. ! ! Note: The following Win32 features are not currently supported for Win32s ! ! MAPI ! RPC ! Console APIs ! Unicode APIs (Win32s does support Code Page/Unicode translation APIs) ! Security APIs ! Comm APIs ! Asynchronous File I/O ! Threads ! Paths (graphics object) ! Enhanced Metafiles ! Bezier curves ! */ ! BOOL CTestApp::InitInstance() ! { ! // Standard initialization ! ! LoadStdProfileSettings(0); // Load standard INI file options (including MRU) ! ! // Register document templates ! ! CSingleDocTemplate* pDocTemplate; ! pDocTemplate = new CSingleDocTemplate(IDR_MAINFRAME, ! RUNTIME_CLASS(CTestDoc), ! RUNTIME_CLASS(CMainFrame), // main SDI frame window ! RUNTIME_CLASS(CTestView)); ! AddDocTemplate(pDocTemplate); ! EnableShellOpen(); //Enable DDE Execute open ! // Parse command line for standard shell commands, DDE, file open ! CCommandLineInfo cmdInfo; ! ParseCommandLine(cmdInfo); ! ! // Dispatch commands specified on the command line ! // Create new document, main frame and view object, initialize m_pMainWnd ! if (!ProcessShellCommand(cmdInfo)) ! return FALSE; ! //Execute initial testing ! if (!DoTestInit()) ! return FALSE; ! return TRUE; ! } ! ! ! /////////////////////////////////////////////////////////////////////////////// ! // Operations ! ! //::DoTestInit()--------------------------------------------------------------- ! /*Execute a test during instance initialization. ! Returns FALSE if testing is unsuccesfull. ! */ ! BOOL CTestApp::DoTestInit() ! { ! //Evaluate complex numbers operations ! return TestComplex(); ! } ! ! ///////////////////////////////////////////////////////////////////////////// ! // CTestApp commands ! ! ! //::OnAppAbout()---------------------------------------------------------------- ! #include "TestAbout.h" //CAboutDlg class ! /*Open About dialog box ! */ ! void CTestApp::OnAppAbout() ! { ! CAboutDlg aboutDlg; ! aboutDlg.DoModal(); ! } --- 1,141 ---- ! // Test.cpp : Defines the class behaviors for the application. ! // ! // Darko Kolakovic ! // Jan. 2k ! ! #include "StdAfx.h" ! #include "TestApp.h" ! ! #include "MainFrm.h" ! #include "TestDoc.h" ! #include "TestView.h" ! ! #ifdef _DEBUG ! #define new DEBUG_NEW ! #undef THIS_FILE ! static char THIS_FILE[] = __FILE__; ! #endif ! ! #if _MSC_VER == 1000 ! #pragma message ("Microsoft Visual C++ 4.0") ! #if _MFC_VER == 0x400 ! #pragma message ("MFC 4.0") ! #pragma message ("Support for Win32s included") ! #endif ! #endif ! ! #if _MSC_VER == 1200 ! #pragma message ("Microsoft Visual C++ 6.0") ! #if _MFC_VER == 0x600 ! #pragma message ("MFC 4.2") ! #endif ! #endif ! ! #if _MSC_VER == 1300 ! #pragma message ("Microsoft Visual C++.Net 7.0") ! #if _MFC_VER == 0x600 ! #pragma message ("MFC 4.2") ! #endif ! #endif ! ! ///////////////////////////////////////////////////////////////////////////// ! // CTestApp ! ! BEGIN_MESSAGE_MAP(CTestApp, CWinApp) ! //{{AFX_MSG_MAP(CTestApp) ! ON_COMMAND(ID_APP_ABOUT, OnAppAbout) ! //}}AFX_MSG_MAP ! // Standard file based document commands ! END_MESSAGE_MAP() ! ! ///////////////////////////////////////////////////////////////////////////// ! ! //::CTestApp()------------------------------------------------------------- ! /*CTestApp construction ! */ ! CTestApp::CTestApp() ! { ! } ! ! ///////////////////////////////////////////////////////////////////////////// ! // The one and only CTestApp object ! CTestApp theApp; ! ! ///////////////////////////////////////////////////////////////////////////// ! // CTestApp initialization ! ! //::InitInstance()------------------------------------------------------------- ! /*Instance initialization that runs each time a copy of the program runs, ! including the first time. The frameworks implementation of WinMain calls ! this function. ! ! Note: The following Win32 features are not currently supported for Win32s ! ! MAPI ! RPC ! Console APIs ! Unicode APIs (Win32s does support Code Page/Unicode translation APIs) ! Security APIs ! Comm APIs ! Asynchronous File I/O ! Threads ! Paths (graphics object) ! Enhanced Metafiles ! Bezier curves ! */ ! BOOL CTestApp::InitInstance() ! { ! // Standard initialization ! ! LoadStdProfileSettings(0); // Load standard INI file options (including MRU) ! ! // Register document templates ! ! CSingleDocTemplate* pDocTemplate; ! pDocTemplate = new CSingleDocTemplate(IDR_MAINFRAME, ! RUNTIME_CLASS(CTestDoc), ! RUNTIME_CLASS(CMainFrame), // main SDI frame window ! RUNTIME_CLASS(CTestView)); ! AddDocTemplate(pDocTemplate); ! EnableShellOpen(); //Enable DDE Execute open ! // Parse command line for standard shell commands, DDE, file open ! CCommandLineInfo cmdInfo; ! ParseCommandLine(cmdInfo); ! ! // Dispatch commands specified on the command line ! // Create new document, main frame and view object, initialize m_pMainWnd ! if (!ProcessShellCommand(cmdInfo)) ! return FALSE; ! //Execute initial testing ! if (!DoTestInit()) ! return FALSE; ! return TRUE; ! } ! ! ! /////////////////////////////////////////////////////////////////////////////// ! // Operations ! ! //::DoTestInit()--------------------------------------------------------------- ! /*Execute a test during instance initialization. ! Returns FALSE if testing is unsuccesfull. ! */ ! BOOL CTestApp::DoTestInit() ! { ! //Evaluate complex numbers operations ! return TestComplex(); ! } ! ! ///////////////////////////////////////////////////////////////////////////// ! // CTestApp commands ! ! ! //::OnAppAbout()---------------------------------------------------------------- ! #include "TestAbout.h" //CAboutDlg class ! /*Open About dialog box ! */ ! void CTestApp::OnAppAbout() ! { ! CAboutDlg aboutDlg; ! aboutDlg.DoModal(); ! } Index: TsComplex.cpp =================================================================== RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Complex/Src/TsComplex.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TsComplex.cpp 30 Jan 2003 03:39:44 -0000 1.2 --- TsComplex.cpp 31 Jan 2003 03:08:05 -0000 1.3 *************** *** 12,15 **** --- 12,16 ---- #include "stdafx.h" #include "KComplex.h" //CComplex class + #include "KTestLog.h" //TESTENTRY struct #ifdef _DEBUG *************** *** 32,39 **** bool TestComplex() { ! CString strResult; ! #ifdef _COMPLEX_DEFINED //included <Math.h> ! //Complex number as structure defined in <Math.h> TsWriteToView(_T("_cabs() calculates the absolute value of a _complex number.\r\n")); _complex B; --- 33,45 ---- bool TestComplex() { ! TCHAR szText[512]; ! bool bRes = true; ! TESTENTRY logEntry = ! {_T("CComplex"), _T("KComplex.h"), false}; ! TESTENTRY logEntryBase = ! {_T("TComplexBase"), _T("KComplxB.h"), false}; ! #ifdef _COMPLEX_DEFINED //included <math.h> ! //Complex number as structure defined in <math.h> TsWriteToView(_T("_cabs() calculates the absolute value of a _complex number.\r\n")); _complex B; *************** *** 45,56 **** if ( dRho != HUGE_VAL) //Check for overflow { ! strResult.Format(_T("|B| = |%.2f+i%.2f| = %.2f\r\n"),B.x,B.y,dRho); ! TsWriteToView((LPCTSTR)strResult); } #else //<Math.h> not included TsWriteToView(_T("Complex numbers are not supported.\r\n")); TComplexBase<double>B(3.2,4.2); //Initialize B = x +iy #endif //_COMPLEX_DEFINED #ifdef __STD_COMPLEX //included <complex> --- 51,68 ---- if ( dRho != HUGE_VAL) //Check for overflow { ! _stprintf(szText, _T("|B| = |%.2f+i%.2f| = %.2f\r\n"),B.x,B.y,dRho); ! TsWriteToView(szText); } + + logEntryBase.m_bResult = true; + logEntryBase.m_szObjectName = _T("_complex"); #else //<Math.h> not included TsWriteToView(_T("Complex numbers are not supported.\r\n")); TComplexBase<double>B(3.2,4.2); //Initialize B = x +iy + + logEntryBase.m_bResult = true; #endif //_COMPLEX_DEFINED + LogTest(&logEntryBase); #ifdef __STD_COMPLEX //included <complex> *************** *** 60,68 **** std::complex<int> A(5,6); A << B; //Copy complex numbers ! strResult.Format(_T("std::complex<int> A = (int)B = %d+i%d\r\n"),A.real(),A.imag()); ! TsWriteToView((LPCTSTR)strResult); //The std::abs(A) function returns the magnitude of A ! strResult.Format(_T("|%d+i%d| = %d\r\n"),A.real(),A.imag(),std::abs(A)); ! TsWriteToView((LPCTSTR)strResult); #else //<complex> not included TComplexBase<double>A(5,6); //Initialize A = x +iy --- 72,82 ---- std::complex<int> A(5,6); A << B; //Copy complex numbers ! _stprintf(szText, _T("std::complex<int> A = (int)B = %d+i%d\r\n"),A.real(),A.imag()); ! TsWriteToView(szText); //The std::abs(A) function returns the magnitude of A ! _stprintf(szText, _T("|%d+i%d| = %d\r\n"),A.real(),A.imag(),std::abs(A)); ! TsWriteToView(szText); ! logEntryBase.m_szObjectName = _T("std::complex"); ! logEntryBase.m_bResult = true; #else //<complex> not included TComplexBase<double>A(5,6); //Initialize A = x +iy *************** *** 71,78 **** A1 = 56; //A1 = CONST + i0 A1 /= 4; ! strResult.Format(_T("|%.2f+i%.2f| = %.2f\r\n"),A1.real(),A1.imag(),abs(A1)); ! TsWriteToView((LPCTSTR)strResult); #endif //__STD_COMPLEX CComplex C(B.x, B.y); C = B; --- 85,95 ---- A1 = 56; //A1 = CONST + i0 A1 /= 4; ! _stprintf(szText, _T("|%.2f+i%.2f| = %.2f\r\n"),A1.real(),A1.imag(),abs(A1)); ! TsWriteToView(szText); ! logEntryBase.m_bResult = true; #endif //__STD_COMPLEX + LogTest(&logEntryBase); + CComplex C(B.x, B.y); C = B; *************** *** 80,92 **** CComplex D(-4.3,6.1); ! strResult.Format(_T("C = %f+i%f D = %f+i%f "),C.real(),C.imag(),D.real(),D.imag()); ! TsWriteToView((LPCTSTR)strResult); C = D / C ; ! strResult.Format(_T("D/C = %f+i%f\r\n"),C.real(),C.imag()); ! TsWriteToView((LPCTSTR)strResult); ! C = exp10(D); //The function returns exponential of D, for base 10. ! strResult.Format(_T("D E(10) = %f+i%f\r\n"),C.real(),C.imag()); ! TsWriteToView((LPCTSTR)strResult); TComplex<int> A2(-1,7); --- 97,113 ---- CComplex D(-4.3,6.1); ! _stprintf(szText, _T("C = %f+i%f D = %f+i%f "),C.real(),C.imag(),D.real(),D.imag()); ! TsWriteToView(szText); C = D / C ; ! _stprintf(szText, _T("D/C = %f+i%f\r\n"),C.real(),C.imag()); ! TsWriteToView(szText); ! logEntry.m_bResult = true; ! LogTest(&logEntry); ! ! //The function returns exponential of D, for base 10. ! C = exp10(D); ! _stprintf(szText, _T("D E(10) = %f+i%f\r\n"),C.real(),C.imag()); ! TsWriteToView(szText); TComplex<int> A2(-1,7); *************** *** 95,141 **** TRACE2(_T(" A E(10) = %d +j%d\n"),A2.real(),A2.imag()); ! D = CComplex(1.2,2.8); ! strResult.Format(_T("D = %f+i%f\r\n"),D.real(),D.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); ! C = cos(D); //The function returns cosine of D ! strResult.Format(_T("cos(D) = %f+i%f "),C.real(),C.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); C = acos(C); ! strResult.Format(_T("acos(C) = %f+i%f\r\n"),C.real(),C.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); C = sin(D); //The function returns sine of D ! strResult.Format(_T("sin(D) = %f+i%f "),C.real(),C.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); C = asin(C); ! strResult.Format(_T("asin(C) = %f+i%f\r\n"),C.real(),C.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); TComplex<float> Phi(.94F,1.78F); ! strResult.Format(_T("Phi = %f+i%f\r\n"),Phi.real(),Phi.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); TComplex<float> X = tan(Phi); //The function returns tangent of Phi ! strResult.Format(_T("tan(Phi) = %f+i%f "),X.real(),X.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); X = atan(X); ! strResult.Format(_T("atan(X) = %f+i%f\r\n"),X.real(),X.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); X = tanh(Phi); //The function returns hyperbolic tangent of Phi ! strResult.Format(_T("tanh(Phi) = %f+i%f "),X.real(),X.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); X = atanh(X); ! strResult.Format(_T("atanh(X) = %f+i%f\r\n"),X.real(),X.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); //Dividing two complex numbers --- 116,200 ---- TRACE2(_T(" A E(10) = %d +j%d\n"),A2.real(),A2.imag()); ! logEntry.m_bResult = true; ! logEntry.m_szObjectName = _T("exp10()"); ! LogTest(&logEntry); ! ! //Test acos ! D = CComplex(1.2,2.8); //The function returns cosine of D ! _stprintf(szText, _T("D = %f+i%f\r\n"),D.real(),D.imag()); ! TRACE0(szText); ! TsWriteToView(szText); ! C = cos(D); ! _stprintf(szText, _T("cos(D) = %f+i%f "),C.real(),C.imag()); ! TRACE0(szText); ! TsWriteToView(szText); C = acos(C); ! _stprintf(szText, _T("acos(C) = %f+i%f\r\n"),C.real(),C.imag()); ! TRACE0(szText); ! TsWriteToView(szText); ! ! bRes = bRes && (C.real() > 1.19999) && (C.real() < 1.20001) && ! (C.imag() > 2.79999) && (C.imag() < 2.80001); //result and previous result ! logEntry.m_bResult = bRes; ! logEntry.m_szObjectName = _T("acos()"); ! LogTest(&logEntry); + //Test asine + D = CComplex(1.2,2.8); C = sin(D); //The function returns sine of D ! _stprintf(szText, _T("sin(D) = %f+i%f "),C.real(),C.imag()); ! TRACE0(szText); ! TsWriteToView(szText); C = asin(C); ! _stprintf(szText, _T("asin(C) = %f+i%f\r\n"),C.real(),C.imag()); ! TRACE0(szText); ! TsWriteToView(szText); ! ! bRes = bRes && (C.real() > 1.19999) && (C.real() < 1.20001) && ! (C.imag() > 2.79999) && (C.imag() < 2.80001); //result and previous result ! logEntry.m_bResult = bRes; ! logEntry.m_szObjectName = _T("asin()"); ! LogTest(&logEntry); + //Test atan TComplex<float> Phi(.94F,1.78F); ! _stprintf(szText, _T("Phi = %f+i%f\r\n"),Phi.real(),Phi.imag()); ! TRACE0(szText); ! TsWriteToView(szText); TComplex<float> X = tan(Phi); //The function returns tangent of Phi ! _stprintf(szText, _T("tan(Phi) = %f+i%f "),X.real(),X.imag()); ! TRACE0(szText); ! TsWriteToView(szText); X = atan(X); ! _stprintf(szText, _T("atan(X) = %f+i%f\r\n"),X.real(),X.imag()); ! TRACE0(szText); ! TsWriteToView(szText); + bRes = bRes && (X.real() > 0.93999) && (X.real() < 0.94001) && + (X.imag() > 1.77999) && (X.imag() < 1.78001); //result and previous result + logEntry.m_bResult = bRes; + logEntry.m_szObjectName = _T("tan()"); + LogTest(&logEntry); + logEntry.m_szObjectName = _T("atan()"); + LogTest(&logEntry); + + //Test atanh X = tanh(Phi); //The function returns hyperbolic tangent of Phi ! _stprintf(szText, _T("tanh(Phi) = %f+i%f "),X.real(),X.imag()); ! TRACE0(szText); ! TsWriteToView(szText); X = atanh(X); ! _stprintf(szText, _T("atanh(X) = %f+i%f\r\n"),X.real(),X.imag()); ! TRACE0(szText); ! TsWriteToView(szText); ! ! bRes = bRes && (X.real() > 0.93999) && (X.real() < 0.94001) && ! (X.imag() > 1.77999) && (X.imag() < 1.78001); //result and previous result ! logEntry.m_bResult = bRes; ! logEntry.m_szObjectName = _T("tanh()"); ! LogTest(&logEntry); ! logEntry.m_szObjectName = _T("atanh()"); ! LogTest(&logEntry); ! //Dividing two complex numbers *************** *** 144,155 **** D.real( .4); D.imag(- .4); ! strResult.Format(_T("C = %.3f + i%.3f D = %.3f + i%.3f\r\n"), C.real(),C.imag(),D.real(),D.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); C/=D; ! strResult.Format(_T("C / D = %f + i%f\r\n"),C.real(),C.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); C.real(-3.2); --- 203,214 ---- D.real( .4); D.imag(- .4); ! _stprintf(szText, _T("C = %.3f + i%.3f D = %.3f + i%.3f\r\n"), C.real(),C.imag(),D.real(),D.imag()); ! TRACE0(szText); ! TsWriteToView(szText); C/=D; ! _stprintf(szText, _T("C / D = %f + i%f\r\n"),C.real(),C.imag()); ! TRACE0(szText); ! TsWriteToView(szText); C.real(-3.2); *************** *** 158,164 **** C *= conj(D); C /= dTemp; ! strResult.Format(_T("C / D = %f + i%f\r\n"),C.real(),C.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); //Multiplying two complex numbers --- 217,223 ---- C *= conj(D); C /= dTemp; ! _stprintf(szText, _T("C / D = %f + i%f\r\n"),C.real(),C.imag()); ! TRACE0(szText); ! TsWriteToView(szText); //Multiplying two complex numbers *************** *** 166,172 **** C.imag(-4.8); C *= D; ! strResult.Format(_T("C * D = %f + i%f\r\n"),C.real(),C.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); C.real(-3.2); --- 225,231 ---- C.imag(-4.8); C *= D; ! _stprintf(szText, _T("C * D = %f + i%f\r\n"),C.real(),C.imag()); ! TRACE0(szText); ! TsWriteToView(szText); C.real(-3.2); *************** *** 175,193 **** C.imag(C.imag()*D.real() + C.real()*D.imag()); C.real(dTemp); ! strResult.Format(_T("C * D = %f + i%f\r\n"),C.real(),C.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); if (C != D) //Test comparison { D = sqrt(C); //Test square root function ! strResult.Format(_T("D = C**0.5 = %f + i%f\r\n"),D.real(),D.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); C = pow(D,2); ! strResult.Format(_T("D**2 = %f + i%f\r\n"),C.real(),C.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); } --- 234,252 ---- C.imag(C.imag()*D.real() + C.real()*D.imag()); C.real(dTemp); ! _stprintf(szText, _T("C * D = %f + i%f\r\n"),C.real(),C.imag()); ! TRACE0(szText); ! TsWriteToView(szText); if (C != D) //Test comparison { D = sqrt(C); //Test square root function ! _stprintf(szText, _T("D = C**0.5 = %f + i%f\r\n"),D.real(),D.imag()); ! TRACE0(szText); ! TsWriteToView(szText); C = pow(D,2); ! _stprintf(szText, _T("D**2 = %f + i%f\r\n"),C.real(),C.imag()); ! TRACE0(szText); ! TsWriteToView(szText); } *************** *** 195,218 **** double dEff = 48; D = polar(dEff); ! strResult.Format(_T("Rho = %.0f D = %f + i%f\r\n"),dEff,D.real(),D.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); dEff = 220; int iNom = 3; double dPhi = CST_PI/iNom; D = polar(dEff,dPhi); //D = 220*e(i*60[deg]) ! strResult.Format(_T("D = %.0fe**(i3.14/%d) = %f + i%f\r\n"),dEff,iNom,D.real(),D.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); D = logN(C,2); //Returns the logarithm to base 2 ! strResult.Format(_T("D = log2(C) = %f + i%f\r\n"),D.real(),D.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); D = acoth(C); //Returns the hyperbolic arcus cosecant ! strResult.Format(_T("acoth(C) = %f + i%f\r\n"),D.real(),D.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); //Calculate line input impedance --- 254,287 ---- double dEff = 48; D = polar(dEff); ! _stprintf(szText, _T("Rho = %.0f D = %f + i%f\r\n"),dEff,D.real(),D.imag()); ! TRACE0(szText); ! TsWriteToView(szText); dEff = 220; int iNom = 3; double dPhi = CST_PI/iNom; D = polar(dEff,dPhi); //D = 220*e(i*60[deg]) ! _stprintf(szText, _T("D = %.0fe**(i3.14/%d) = %f + i%f\r\n"),dEff,iNom,D.real(),D.imag()); ! TRACE0(szText); ! TsWriteToView(szText); + //Test log2 D = logN(C,2); //Returns the logarithm to base 2 ! _stprintf(szText, _T("D = log2(C) = %f + i%f\r\n"),D.real(),D.imag()); ! TRACE0(szText); ! TsWriteToView(szText); ! logEntryBase.m_bResult = true; ! logEntryBase.m_szObjectName = _T("logN()"); ! logEntryBase.m_szFileName = _T("KMathCst.inl"); ! LogTest(&logEntryBase); + //Test acoth D = acoth(C); //Returns the hyperbolic arcus cosecant ! _stprintf(szText, _T("acoth(C) = %f + i%f\r\n"),D.real(),D.imag()); ! TRACE0(szText); ! TsWriteToView(szText); ! ! logEntry.m_bResult = bRes; ! logEntry.m_szObjectName = _T("acoth()"); ! LogTest(&logEntry); //Calculate line input impedance *************** *** 223,257 **** D = GetLineZin(C, CComplex(50.0,0), 2.5,CST_PI/2.,10); ! strResult.Format(_T("Load = %f + i%f, Zin = %f + i%f\r\n"), C.real(),C.imag(),D.real(),D.imag()); ! TRACE0((LPCTSTR)strResult); ! TsWriteToView((LPCTSTR)strResult); ! return TRUE; ! } //TestPointToComplex()------------------------------------------------------ /*Test conversion from CPoint to complex number */ ! void TestPointToComplex(CPoint& ptPos) ! { ! CComplex ccPos = ptPos; ! double dRho; //magnitude ! double dAngle; //phase angle ! dRho = ccPos.Rho(); //The function returns the magnitude of ccPos ! dAngle = ccPos.Angle(); //The function returns the phase angle of ccPos ! TRACE2(_T("ccPos = %f e(j%f)\n"),abs(ccPos),arg(ccPos)); ! TsWriteToView(_T("Mouse position is ")); ! CString strResult; ! strResult.Format(_T("%.2f+i%.2f = %.2fe(i%.2f)\r\n"),ccPos.real(),ccPos.imag(),dRho,dAngle); ! TsWriteToView((LPCTSTR)strResult); ! } /////////////////////////////////////////////////////////////////////////////// /***************************************************************************** * $Log: * 4 Biblioteka1.3 22/01/2003 10:22:35 PMDarko * 3 Biblioteka1.2 20/01/2003 3:15:32 AMDarko Replaced BOOL --- 292,370 ---- D = GetLineZin(C, CComplex(50.0,0), 2.5,CST_PI/2.,10); ! _stprintf(szText, _T("Load = %f + i%f, Zin = %f + i%f\r\n"), C.real(),C.imag(),D.real(),D.imag()); ! TRACE0(szText); ! TsWriteToView(szText); ! logEntryBase.m_bResult = (D.real() > 49.68300) && (D.real() < 49.68500) && ! (D.imag() > -0.00001) && (D.imag() < 0.00001); //result and previous result ! logEntryBase.m_bResult = true; ! logEntryBase.m_szObjectName = _T("GetLineZin()"); ! logEntryBase.m_szFileName = _T("KZLineIn.cpp"); ! LogTest(&logEntryBase); ! bRes = bRes && logEntryBase.m_bResult; + return bRes; + } //TestPointToComplex()------------------------------------------------------ /*Test conversion from CPoint to complex number */ ! #ifndef _CONSOLE //GUI application ! bool TestPointToComplex(CPoint& ptPos //[in] current pointer position ! ) ! { ! bool bRes = true; ! CComplex ccPos = ptPos; ! double dRho; //magnitude ! double dAngle; //phase angle ! dRho = ccPos.Rho(); //The function returns the magnitude of ccPos ! dAngle = ccPos.Angle(); //The function returns the phase angle of ccPos ! TRACE2(_T("ccPos = %f e(j%f)\n"),abs(ccPos),arg(ccPos)); ! TsWriteToView(_T("Mouse position is ")); ! TCHAR szText[512]; ! _stprintf(szText, _T("%.2f+i%.2f = %.2fe(i%.2f)\r\n"),ccPos.real(),ccPos.imag(),dRho,dAngle); ! TsWriteToView(szText); ! return bRes; ! } ! #else ! bool TestPointToComplex() ! { ! bool bRes = true; ! TESTENTRY logEntry = ! {_T("CComplex"), _T("KComplex.h"), false}; ! ! CComplex ccPos(220,50); ! double dRho; //magnitude ! double dAngle; //phase angle ! ! dRho = ccPos.Rho(); //The function returns the magnitude of ccPos ! bRes = (dRho > 225.61028) && (dRho < 225.610285); ! logEntry.m_bResult = bRes; ! logEntry.m_szObjectName = _T("Rho()"); ! LogTest(&logEntry); ! ! dAngle = ccPos.Angle(); //The function returns the phase angle of ccPos ! logEntry.m_bResult = (dAngle > 0.22340) && (dAngle < 0.22349); ! logEntry.m_szObjectName = _T("Angle()"); ! LogTest(&logEntry); ! bRes = bRes && logEntry.m_bResult; ! ! TRACE2(_T("ccPos = %f e(j%f)\n"),abs(ccPos),arg(ccPos)); ! TsWriteToView(_T("Coordinates are ")); ! TCHAR szText[512]; ! _stprintf(szText, _T("%.2f+i%.2f = %.2fe(i%.2f)\r\n"),ccPos.real(),ccPos.imag(),dRho,dAngle); ! TsWriteToView(szText); ! return bRes; ! } ! #endif //_CONSOLE /////////////////////////////////////////////////////////////////////////////// /***************************************************************************** * $Log: + * 5 Biblioteka1.4 30/01/2003 9:47:32 PMDarko Write results + * to the test log * 4 Biblioteka1.3 22/01/2003 10:22:35 PMDarko * 3 Biblioteka1.2 20/01/2003 3:15:32 AMDarko Replaced BOOL |
From: <dd...@us...> - 2003-01-31 03:07:26
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Calc/Src In directory sc8-pr-cvs1:/tmp/cvs-serv22770/Cpp/Samples/Calc/Src Modified Files: TsCalc.cpp Log Message: Replaced BOOL with bool Index: TsCalc.cpp =================================================================== RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Calc/Src/TsCalc.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TsCalc.cpp 28 Jan 2003 05:42:12 -0000 1.2 --- TsCalc.cpp 31 Jan 2003 03:07:23 -0000 1.3 *************** *** 10,16 **** // Group=Examples ! #include "StdAfx.h" #include "KProgCst.h" ! #include "KString.h" //CString #ifdef _DEBUG --- 10,16 ---- // Group=Examples ! #include "stdafx.h" #include "KProgCst.h" ! #include "KTestLog.h" //TESTENTRY struct #ifdef _DEBUG *************** *** 20,25 **** #endif ! void TestRealConversion(); extern bool TsWriteToView(LPCTSTR lszText); #pragma message ("Compiler option:") --- 20,28 ---- #endif ! bool TestRealConversion(); extern bool TsWriteToView(LPCTSTR lszText); + static TESTENTRY s_logEntry = + {_T("NULL"), _T("KProgCst.h"), false}; + #pragma message ("Compiler option:") *************** *** 43,110 **** bool TestCalculus() { ! TsWriteToView(_T("\tTestCalculus:\r\n")); ! CString strText; double dTest = log(0); ! bool bRes = IsNaN(dTest); ! strText.Format(_T("Is log(0) undefined? %s\r\n"),bRes ? _T("Yes"):_T("No")); ! TsWriteToView((LPCTSTR)strText); ! dTest *= 0.0; ! bRes = IsNaN(dTest); ! strText.Format(_T("Is 0*log(0) undefined? %s\r\n"),bRes ? _T("Yes"):_T("No")); ! TsWriteToView((LPCTSTR)strText); ! //String presentations of NaNs ! dTest = 0; ! dTest = CST_dNaN.dValue; ! strText.Format(_T("Quiet NaN %f\r\n"),dTest); ! TsWriteToView((LPCTSTR)strText); ! dTest = (double)CST_dSNaN; ! strText.Format(_T("Signaling NaN %f\r\n"),dTest); ! TsWriteToView((LPCTSTR)strText); ! dTest = (double)CST_dINF; ! strText.Format(_T("Positive Infinity %f\r\n"),dTest); ! TsWriteToView((LPCTSTR)strText); ! TestRealConversion(); ! return TRUE; } - //TestPoint()------------------------------------------------------ #include "KPoint.h" #include "KPair.h" - static fPOINT ptOldPos(0.0F,0.0F); //Old position /*Test of point functions */ ! void TestPoint(const CPoint& point) { ! TsWriteToView(_T("\tTestPoint:\r\n")); ! fPOINT ptPos(point); float fDeg;//[°] float fMin;//['] float fSec;//["] ! Rad2DegMinSec((float)ptPos.Angle(), fDeg, fMin,fSec); ! ! CString strText; ! strText.Format(_T("Cursor at P(%.2f,%.2f) r=%.2f,angle =%.2f°%.2f'%.2f\"\r\n"), ptPos.x,ptPos.y,ptPos.Distance(),fDeg, fMin,fSec); ! TsWriteToView((LPCTSTR)strText); ! fPOINT ptDistance(ptPos - ptOldPos); //Get difference between points ! strText.Format(_T("Distance between new and old position is %.2f units\r\n"), ! ptDistance.Distance()); ! TsWriteToView((LPCTSTR)strText); ! ptOldPos = ptPos; //Save current position ! //Compare points ! TPair<LONG> P(point.x, point.y); ! bool bRes = P > TPair<LONG>(40,120); ! strText.Format("P(%d,%d) %s x(40,120)\r\n",P.x,P.y,bRes?">":"<="); ! TsWriteToView((LPCTSTR)strText); } //TestRealConversion()--------------------------------------------------------- --- 46,203 ---- bool TestCalculus() { ! TsWriteToView(_T("TestCalculus()\r\n")); ! TCHAR szText[512]; ! double dTest = log(0); ! bool bRes = IsNaN(dTest); //log(0) is defined number ! _stprintf(szText, _T("Is log(0) undefined? %s\r\n"),bRes ? _T("Yes"):_T("No")); ! TsWriteToView(szText); //Output: Is log(0) undefined? No ! if (bRes == false) //Validate result ! { ! dTest *= 0.0; ! bRes = IsNaN(dTest); //0*log(0) is undefined number ! _stprintf(szText, _T("Is 0*log(0) undefined? %s\r\n"),bRes ? _T("Yes"):_T("No")); ! TsWriteToView(szText); //Output: Is 0*log(0) undefined? Yes ! } ! s_logEntry.m_szObjectName = _T("IsNaN()"); ! s_logEntry.m_szFileName = _T("KProgCst.inl"); ! s_logEntry.m_bResult = bRes; ! LogTest(&s_logEntry); + if (bRes == true) //Validate previous result + { + //String presentations of NaNs + dTest = 0; + dTest = CST_dNaN.dValue; + _stprintf(szText,_T("Quiet NaN %f\r\n"),dTest); + TsWriteToView(szText); //Output: Quiet NaN -1.#IND00 + _stprintf(szText,_T("%f"),dTest); + bRes = (_tcsncmp(szText,_T("-1.#IND00"), 9) == 0); + s_logEntry.m_szObjectName = _T("CST_dNaN"); + s_logEntry.m_bResult = bRes; + LogTest(&s_logEntry); ! if (bRes) ! { ! dTest = (double)CST_dSNaN; ! _stprintf(szText,_T("Signaling NaN %f\r\n"),dTest); ! TsWriteToView(szText); //Output: Signaling NaN -1.#INF00 ! _stprintf(szText,_T("%f"),dTest); ! bRes = (_tcsncmp(szText,_T("-1.#INF00"), 9) == 0); ! } ! s_logEntry.m_szObjectName = _T("CST_dSNaN"); ! s_logEntry.m_bResult = bRes; ! LogTest(&s_logEntry); + if (bRes) + { + dTest = (double)CST_dINF; + _stprintf(szText,_T("Positive Infinity %f\r\n"),dTest); + TsWriteToView(szText); //Output: Positive Infinity 1.#INF00 + _stprintf(szText,_T("%f"),dTest); + bRes = (_tcsncmp(szText,_T("1.#INF00"), 8) == 0); + } + s_logEntry.m_szObjectName = _T("CST_dINF"); + s_logEntry.m_bResult = bRes; + LogTest(&s_logEntry); + } ! if (bRes) ! bRes = TestRealConversion(); ! return bRes; } //TestPoint()------------------------------------------------------ #include "KPoint.h" #include "KPair.h" /*Test of point functions */ ! bool TestPoint() { ! TsWriteToView(_T("TestPoint()\r\n")); ! TCHAR szBuff[512]; ! bool bRes = false; ! ! fPOINT ptPos(400, 500); ! fPOINT ptOldPos(0.0F,0.0F); //Old position float fDeg;//[°] float fMin;//['] float fSec;//["] ! Rad2DegMinSec((float)ptPos.Angle(), fDeg, fMin, fSec); ! _stprintf(szBuff,_T("Point at P(%.2f,%.2f) r=%.2f,angle =%.2f°%.2f'%.2f\"\r\n"), ptPos.x,ptPos.y,ptPos.Distance(),fDeg, fMin,fSec); ! TsWriteToView(szBuff); ! bRes = ((fDeg == 51.F) && (fMin == 20.F) && (fSec >= 24.693F) && (fSec < 24.694F) ); ! s_logEntry.m_bResult = bRes; ! s_logEntry.m_szFileName = _T("KMathCst.inl"); ! s_logEntry.m_szObjectName = _T("Rad2DegMinSec()"); ! LogTest(&s_logEntry); ! if (bRes) ! { ! fPOINT ptDistance(ptPos - ptOldPos); //Get difference between points ! double dDistance = ptDistance.Distance(); ! _stprintf(szBuff,_T("Distance between new and old position is %.2f units\r\n"), ! dDistance); ! TsWriteToView(szBuff); ! bRes = ((dDistance >= 640.312) && (dDistance < 640.313)) ; ! } ! ! if (bRes) ! { ! //Compare points ! TPair<LONG> P(240,180); ! bRes = P > TPair<LONG>(40,120); ! _stprintf(szBuff,_T("P(%d,%d) %s x(40,120)\r\n"),P.x,P.y,bRes?">":"<="); ! TsWriteToView(szBuff); ! //Validate comparaison ! bRes = (bRes == true); ! s_logEntry.m_bResult = bRes; ! s_logEntry.m_szFileName = _T("KPair.h"); ! s_logEntry.m_szObjectName = _T("TPair"); ! LogTest(&s_logEntry); ! } ! ! s_logEntry.m_bResult = bRes; ! s_logEntry.m_szFileName = _T("KPoint.h"); ! s_logEntry.m_szObjectName = _T("TPoint"); ! LogTest(&s_logEntry); ! return bRes; } + #ifndef _CONSOLE //GUI Application + static fPOINT ptOldPos(0.0F,0.0F); //Old position + /*Test calculation of the distance between two pointer positions + */ + bool TestPoint(const CPoint& point) + { + TsWriteToView(_T("\tTestPoint:\r\n")); + fPOINT ptPos(point); + + float fDeg;//[°] + float fMin;//['] + float fSec;//["] + Rad2DegMinSec((float)ptPos.Angle(), fDeg, fMin, fSec); + + CString szText; + szText.Format(_T("Cursor at P(%.2f,%.2f) r=%.2f,angle =%.2f°%.2f'%.2f\"\r\n"), + ptPos.x,ptPos.y,ptPos.Distance(),fDeg, fMin,fSec); + TsWriteToView((LPCTSTR)szText); + + fPOINT ptDistance(ptPos - ptOldPos); //Get difference between points + szText.Format(_T("Distance between new and old position is %.2f units\r\n"), + ptDistance.Distance()); + TsWriteToView((LPCTSTR)szText); + + ptOldPos = ptPos; //Save current position + //Compare points + TPair<LONG> P(point.x, point.y); + bool bRes = P > TPair<LONG>(40,120); + szText.Format("P(%d,%d) %s x(40,120)\r\n",P.x,P.y,bRes?">":"<="); + TsWriteToView((LPCTSTR)szText); + } + #endif //GUI Application //TestRealConversion()--------------------------------------------------------- *************** *** 112,127 **** /*Test floating-point conversions */ ! void TestRealConversion() { ! TsWriteToView(_T("\tTestRealConversion:\r\n")); ! CString strText; float fTemp = 273.15F; CFloatIEEE cfTemp(fTemp); ! strText.Format(_T("Temperature = %.2fK = %s%d exp(%d)\r\n"), fTemp, ((cfTemp.iSign < 0) ? _T("-") :_T("+")), cfTemp.lMantissa,cfTemp.iExponent); ! TsWriteToView((LPCTSTR)strText); fTemp = (float)cfTemp; } --- 205,228 ---- /*Test floating-point conversions */ ! bool TestRealConversion() { ! TsWriteToView(_T("\r\nTestRealConversion()\r\n")); ! TCHAR szText[512]; ! bool bRes = false; float fTemp = 273.15F; CFloatIEEE cfTemp(fTemp); ! _stprintf(szText, _T("Temperature = %.2fK = %s%d exp(%d)\r\n"), fTemp, ((cfTemp.iSign < 0) ? _T("-") :_T("+")), cfTemp.lMantissa,cfTemp.iExponent); ! TsWriteToView(szText); ! bRes = ((cfTemp.lMantissa == 561971) && (cfTemp.iExponent == 8)); ! //Typecast test fTemp = (float)cfTemp; + s_logEntry.m_bResult = bRes; + s_logEntry.m_szFileName = _T("KReal4IE.h"); + s_logEntry.m_szObjectName = _T("CFloatIEEE"); + LogTest(&s_logEntry); + return bRes; } *************** *** 129,148 **** /*Test findig the roots of a quadratic equation. */ ! void TestQuadraticEquation() { ! TsWriteToView(_T("\tTestQuadraticEquation:\r\n")); ! CString strText; double dA, dB, dC; //coeficients double dX1, dX2; //roots extern bool funcQuadratic(double a,double b,double c,double& x1,double& x2); dA = 1.; dB = 5.; dC = 0.; ! strText.Format(_T("%.2fX^2 + %.2fX + %.2f = 0 have roots:\r\n"),dA, dB, dC); ! TsWriteToView((LPCTSTR)strText); ! if (funcQuadratic(dA, dB, dC, dX1, dX2)) { ! strText.Format(_T("\tx1=%.2f, x2=%.2f\r\n"),dX1, dX2); } else //Roots are complex numbers --- 230,253 ---- /*Test findig the roots of a quadratic equation. */ ! bool TestQuadraticEquation() { ! TsWriteToView(_T("TestQuadraticEquation()")); ! TCHAR szText[512]; ! bool bRes = false; double dA, dB, dC; //coeficients double dX1, dX2; //roots + const bool ROOTS_REAL = true; + const bool ROOTS_COMPLEX = false; + extern bool funcQuadratic(double a,double b,double c,double& x1,double& x2); dA = 1.; dB = 5.; dC = 0.; ! _stprintf(szText, _T("%.2fX^2 + %.2fX + %.2f = 0 have roots:\r\n"),dA, dB, dC); ! TsWriteToView((LPCTSTR)szText); ! if (bRes = funcQuadratic(dA, dB, dC, dX1, dX2)) { ! _stprintf(szText, _T("\tx1=%.2f, x2=%.2f\r\n"),dX1, dX2); } else //Roots are complex numbers *************** *** 150,164 **** if (!IsNaN(dX2)) { ! strText.Format(_T("\tX1=%.2f + i%.2f\r\n"),dX1, dX2); ! TsWriteToView((LPCTSTR)strText); ! strText.Format(_T("\tX2=%.2f - i%.2f\r\n"),dX1, dX2); } else { ! strText =_T("undefined (divide by zero error)\r\n"); } } ! TsWriteToView((LPCTSTR)strText); } --- 255,277 ---- if (!IsNaN(dX2)) { ! _stprintf(szText, _T("\tX1=%.2f + i%.2f\r\n"),dX1, dX2); ! TsWriteToView((LPCTSTR)szText); ! _stprintf(szText, _T("\tX2=%.2f - i%.2f\r\n"),dX1, dX2); } else { ! _stprintf(szText,_T("undefined (divide by zero error)\r\n")); } } + bRes = ((bRes == ROOTS_REAL) && (dX1 == 0.) && (dX2 == -5.)); ! //TODO: test of complex roots ! TsWriteToView((LPCTSTR)szText); ! s_logEntry.m_bResult = bRes; ! s_logEntry.m_szFileName = _T("KfQuadEq.cpp"); ! s_logEntry.m_szObjectName = _T("funcQuadratic()"); ! LogTest(&s_logEntry); ! ! return bRes; } *************** *** 166,169 **** --- 279,284 ---- /***************************************************************************** * $Log: + * 4 Biblioteka1.3 30/01/2003 9:47:24 PMDarko Write results + * to the test log * 3 Biblioteka1.2 20/01/2003 3:15:29 AMDarko Replaced BOOL * with bool |
From: <dd...@us...> - 2003-01-31 03:06:07
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Calc In directory sc8-pr-cvs1:/tmp/cvs-serv22478/Cpp/Samples/Calc Added Files: Calc.vcproj Log Message: Created --- NEW FILE: Calc.vcproj --- <?xml version="1.0" encoding = "Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.00" Name="Calc" ProjectGUID="{4E372AE9-21FD-4367-B61A-5C9A2251F79A}" SccProjectName="" SccLocalPath="" Keyword="MFCProj"> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory=".\WinDbg" IntermediateDirectory=".\ObjDbg" ConfigurationType="1" UseOfMFC="2" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\.." PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="3" PrecompiledHeaderThrough="StdAfx.h" PrecompiledHeaderFile=".\ObjDbg/Calc.pch" AssemblerListingLocation=".\ObjDbg/" ObjectFile=".\ObjDbg/" ProgramDataBaseFileName=".\ObjDbg/" BrowseInformation="1" WarningLevel="4" SuppressStartupBanner="TRUE" DebugInformationFormat="4" CompileAs="0"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" OutputFile=".\WinDbg/Calc.exe" Version="1.0" LinkIncremental="2" SuppressStartupBanner="TRUE" GenerateDebugInformation="TRUE" ProgramDatabaseFile=".\WinDbg/Calc.pdb" SubSystem="2"/> <Tool Name="VCMIDLTool" PreprocessorDefinitions="_DEBUG" MkTypLibCompatible="TRUE" SuppressStartupBanner="TRUE" TargetEnvironment="1" TypeLibraryName=".\WinDbg/Calc.tlb"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_AFXDLL;_DEBUG" Culture="1033"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> <Configuration Name="DbgUniCode|Win32" OutputDirectory="DbgUniCode" IntermediateDirectory="DbgUniCode" ConfigurationType="1" UseOfMFC="2" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\.." PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="3" PrecompiledHeaderThrough="StdAfx.h" PrecompiledHeaderFile=".\ObjDbg/Calc.pch" AssemblerListingLocation=".\ObjDbg/" ObjectFile=".\ObjDbg/" ProgramDataBaseFileName=".\ObjDbg/" BrowseInformation="1" WarningLevel="4" SuppressStartupBanner="TRUE" DebugInformationFormat="4" CompileAs="0"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" OutputFile=".\WinDbg/Calc.exe" Version="1.0" LinkIncremental="2" SuppressStartupBanner="TRUE" GenerateDebugInformation="TRUE" ProgramDatabaseFile=".\WinDbg/Calc.pdb" SubSystem="2"/> <Tool Name="VCMIDLTool" PreprocessorDefinitions="_DEBUG" MkTypLibCompatible="TRUE" SuppressStartupBanner="TRUE" TargetEnvironment="1" TypeLibraryName=".\WinDbg/Calc.tlb"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_AFXDLL;_DEBUG" Culture="1033"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> <Configuration Name="RelUnicode|Win32" OutputDirectory="RelUnicode" IntermediateDirectory="RelUnicode" ConfigurationType="1" UseOfMFC="2" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\.." PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="3" PrecompiledHeaderThrough="StdAfx.h" PrecompiledHeaderFile=".\ObjDbg/Calc.pch" AssemblerListingLocation=".\ObjDbg/" ObjectFile=".\ObjDbg/" ProgramDataBaseFileName=".\ObjDbg/" BrowseInformation="1" WarningLevel="4" SuppressStartupBanner="TRUE" DebugInformationFormat="4" CompileAs="0"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" OutputFile=".\WinDbg/Calc.exe" Version="1.0" LinkIncremental="2" SuppressStartupBanner="TRUE" GenerateDebugInformation="TRUE" ProgramDatabaseFile=".\WinDbg/Calc.pdb" SubSystem="2"/> <Tool Name="VCMIDLTool" PreprocessorDefinitions="_DEBUG" MkTypLibCompatible="TRUE" SuppressStartupBanner="TRUE" TargetEnvironment="1" TypeLibraryName=".\WinDbg/Calc.tlb"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_AFXDLL;_DEBUG" Culture="1033"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> </Configurations> <Files> <Filter Name="Resources" Filter="*.ico;*.bmp;*.rc2;*.rc"> <File RelativePath=".\Res\TestApp.ico"> </File> <File RelativePath=".\Src\TestApp.rc"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCResourceCompilerTool" AdditionalIncludeDirectories="Src;$(NoInherit)"/> </FileConfiguration> <FileConfiguration Name="DbgUniCode|Win32"> <Tool Name="VCResourceCompilerTool" AdditionalIncludeDirectories="Src;$(NoInherit)"/> </FileConfiguration> <FileConfiguration Name="RelUnicode|Win32"> <Tool Name="VCResourceCompilerTool" AdditionalIncludeDirectories="Src;$(NoInherit)"/> </FileConfiguration> </File> <File RelativePath=".\Res\TestApp.rc2"> </File> <File RelativePath=".\Res\TestAppDoc.ico"> </File> </Filter> <Filter Name="Headers" Filter="*.h;*.inl"> <File RelativePath="..\..\KMathCst.h"> </File> <File RelativePath="..\..\KPair.h"> </File> <File RelativePath="..\..\KPoint.h"> </File> <File RelativePath="..\..\KProgCst.h"> </File> <File RelativePath="..\..\KReal4Cv.h"> </File> <File RelativePath="..\..\KReal4IE.h"> </File> <File RelativePath="..\..\KReal8Cv.h"> </File> <File RelativePath=".\Src\MainFrm.h"> </File> <File RelativePath=".\Src\StdAfx.h"> </File> <File RelativePath=".\Src\TestAbout.h"> </File> <File RelativePath=".\Src\TestApp.h"> </File> <File RelativePath=".\Src\TestDoc.h"> </File> <File RelativePath=".\Src\TestView.h"> </File> </Filter> <Filter Name="Source" Filter="cpp,c"> <File RelativePath="..\..\KMathCst.inl"> </File> <File RelativePath="..\..\KfQuadEq.cpp"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="DbgUniCode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="RelUnicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> </File> <File RelativePath=".\Src\MainFrm.cpp"> </File> <File RelativePath=".\Src\StdAfx.cpp"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> <FileConfiguration Name="DbgUniCode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> <FileConfiguration Name="RelUnicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> </File> <File RelativePath=".\Src\TestAbout.cpp"> </File> <File RelativePath=".\Src\TestApp.cpp"> </File> <File RelativePath=".\Src\TestDoc.cpp"> </File> <File RelativePath=".\Src\TestView.cpp"> </File> <File RelativePath=".\Src\TsCalc.cpp"> </File> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> |
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/_LibraryTest/Src In directory sc8-pr-cvs1:/tmp/cvs-serv22342/Cpp/Samples/_LibraryTest/Src Added Files: TsWriteTxt.cpp KTestLog.cpp KTestLog.h stdafx.cpp stdafx.h _TestMain.cpp Log Message: Created --- NEW FILE: TsWriteTxt.cpp --- /*$Workfile: S:\_SrcPool\Cpp\Samples\_LibraryTest\Src\TsWriteTxt.cpp$: implementation file $Revision: 1.1 $ $Date: 2003/01/31 03:05:28 $ $Author: ddarko $ Outputs text to stdout stream Copyright: CommonSoft Inc. Jan. 2k2 Darko Kolakovic */ // Group=Examples #include "stdafx.h" #ifdef _CONSOLE //TsWriteToView()-------------------------------------------------------------- /*Writes a character string at the console standard output stream. Returns: true always. Note: uses Standard Template Library (STL). */ bool TsWriteToView(LPCTSTR lszText) { if (lszText != NULL) cout << lszText; else cout << _T("<null>"); cout.flush(); return true; } #endif //_CONSOLE /////////////////////////////////////////////////////////////////////////////// /***************************************************************************** * $Log: * 1 Biblioteka1.0 27/01/2003 9:37:26 PMDarko * $ *****************************************************************************/ --- NEW FILE: KTestLog.cpp --- /*$Workfile: S:\_SrcPool\Cpp\Samples\_LibraryTest\Src\KTestLog.cpp$: implementation file $Revision: 1.1 $ $Date: 2003/01/31 03:05:28 $ $Author: ddarko $ Outputs test data to file Copyright: CommonSoft Inc. Darko Kolakovic 2003-01 */ // Group=Diagnostic /*Note: MS VC/C++ - Disable precompiled headers (/Yu"StdAfx.h" option) */ #include <stdio.h> //fopen() #include "KStrings.h" //BoolToA() #include "KTestLog.h" //TESTENTRY struct #include "KDbgMacr.h" static bool s_bTestLogInitalized = false; //'Test Log initialization passed' flag static FILE* s_fileTestLog; //test log file handler #ifndef UNICODE static LPCTSTR TESTLOGNAME = _T("LibraryTest.log"); //default test //log file name #else static LPCTSTR TESTLOGNAME = _T("LibraryTestUni.log"); //default Unicode test //log file name #endif //InitLogTest()---------------------------------------------------------------- /*Initalizes test log file and writes data about testing environment. */ void InitLogTest() { if (!s_bTestLogInitalized) //Initialize only once { //Open an empty file for reading and writing s_fileTestLog = fopen(TESTLOGNAME,"w+"); if (s_fileTestLog != NULL) { s_bTestLogInitalized = true; LPTSTR szEntry; //Write log header: date and time fwrite(_T(__DATE__), sizeof(TCHAR), _tcslen(__DATE__), s_fileTestLog); fwrite(_T("\t"), sizeof(TCHAR), 1, s_fileTestLog); fwrite(_T(__TIME__), sizeof(TCHAR), _tcslen(__TIME__), s_fileTestLog); fwrite(_T("\n"), sizeof(TCHAR), 1, s_fileTestLog); #ifdef __STDC__ szEntry = _T("ANSI C compliance\n"); fwrite(szEntry, sizeof(TCHAR), _tcslen(szEntry), s_fileTestLog); #endif #ifdef UNICODE szEntry = _T("Unicode\n"); fwrite(szEntry, sizeof(TCHAR), _tcslen(szEntry), s_fileTestLog); #endif #ifdef _CONSOLE szEntry = _T("Console\n"); #else szEntry = _T("GUI\n"); #endif fwrite(szEntry, sizeof(TCHAR), _tcslen(szEntry), s_fileTestLog); TESTENTRY logEntry = {_T("Predefined macros"), _T("KDbgMacr.h"), true}; LogTest(&logEntry); logEntry.m_szObjectName = _T("BoolToA()"); logEntry.m_szFileName = _T("KStrings.h"); logEntry.m_bResult = true; LogTest(&logEntry); logEntry.m_szObjectName = _T("InitLogTest()"); logEntry.m_szFileName = _T("KTestLog.h"); logEntry.m_bResult = true; LogTest(&logEntry); logEntry.m_szObjectName = _T("LogTest()"); logEntry.m_szFileName = _T("KTestLog.h"); logEntry.m_bResult = true; LogTest(&logEntry); logEntry.m_szObjectName = _T("CloseLogTest()"); logEntry.m_szFileName = _T("KTestLog.h"); logEntry.m_bResult = true; LogTest(&logEntry); logEntry.m_szObjectName = _T("CTestLog"); logEntry.m_szFileName = _T("KTestLog.h"); logEntry.m_bResult = true; LogTest(&logEntry); } } } //LogTest()-------------------------------------------------------------------- /*Writes test data to the test log in the following format: SourceCodeFileName \t ObjectName \t Result \n */ void LogTest(const PTESTENTRY pTestLog) { if (!s_bTestLogInitalized) InitLogTest(); if ((pTestLog != NULL) && (s_fileTestLog != NULL)) { //Write source code file name fwrite(pTestLog->m_szFileName, sizeof(TCHAR), _tcslen(pTestLog->m_szFileName), s_fileTestLog); fwrite(_T("\t"), sizeof(TCHAR), 1, s_fileTestLog); //Write name of the tested object fwrite(pTestLog->m_szObjectName, sizeof(TCHAR), _tcslen(pTestLog->m_szObjectName), s_fileTestLog); fwrite(_T("\t"), sizeof(TCHAR), 1, s_fileTestLog); //Write test results LPCTSTR szResult = BoolToA(pTestLog->m_bResult); fwrite(szResult, sizeof(TCHAR), _tcslen(szResult), s_fileTestLog); fwrite(_T("\n"), sizeof(TCHAR), 1, s_fileTestLog); } } //CloseLogTest()--------------------------------------------------------------- /*Closes the test log. */ void CloseLogTest() { if (s_fileTestLog != NULL) { fflush(s_fileTestLog); fclose(s_fileTestLog); } } /////////////////////////////////////////////////////////////////////////////// /***************************************************************************** * $Log: * 1 Biblioteka1.0 30/01/2003 9:44:58 PMDarko * $ *****************************************************************************/ --- NEW FILE: KTestLog.h --- /*$Workfile: S:\_SrcPool\Cpp\Samples\_LibraryTest\Src\KTestLog.h$: header file $Revision: 1.1 $ $Date: 2003/01/31 03:05:28 $ $Author: ddarko $ Collect some information about code testing Copyright: CommonSoft Inc. Darko Kolakovic 2003-01 */ /* Group=Diagnostic */ #ifndef __KTESTLOG_H__ /*KTestLog.h sentry */ #define __KTESTLOG_H__ #include "KTChar.h" /*LPCTSTR */ /*Container holding basic information about tested subject. */ struct tagTestEntry { LPCTSTR m_szObjectName; /*name of the tested function or object */ LPCTSTR m_szFileName; /*function or object file name */ bool m_bResult; /*result of the test */ }; typedef struct tagTestEntry TESTENTRY; /*Basic test data */ typedef struct tagTestEntry* PTESTENTRY; /*Pointer to test data container */ /* ///////////////////////////////////////////////////////////////////////// */ /*Declarations */ #ifdef __cplusplus extern "C" { #endif void InitLogTest(); void LogTest(const PTESTENTRY pTestLog); void CloseLogTest(); #ifdef __cplusplus } #endif /* ///////////////////////////////////////////////////////////////////////// */ /* C++ encapsulation */ #ifdef __cplusplus class CTestLog : public tagTestEntry { public: CTestLog(); ~CTestLog(); void LogTest(TESTENTRY& testLog) const; }; inline CTestLog::CTestLog() { ::InitLogTest(); } inline CTestLog::~CTestLog() { ::CloseLogTest(); } //LogTest()------------------------------------------------------------------ /*Writes an entry to the Test log. */ inline void CTestLog::LogTest(TESTENTRY& testLog //[in] test log entry ) const { ::LogTest(&testLog); } #endif /* ///////////////////////////////////////////////////////////////////////// */ #endif /*__KTESTLOG_H__ */ /****************************************************************************** * $Log: * 1 Biblioteka1.0 30/01/2003 9:45:02 PMDarko * $ *****************************************************************************/ --- NEW FILE: stdafx.cpp --- /*$Workfile: S:\_SrcPool\Cpp\Samples\_LibraryTest\Src\stdafx.cpp$ : source file that includes just the standard includes _LibraryTest.pch will be the pre-compiled header stdafx.obj will contain the pre-compiled type information $Revision: 1.1 $ $Date: 2003/01/31 03:05:28 $ $Author: ddarko $ StdAfx.h, StdAfx.cpp These files are used to build a precompiled header (PCH) file named _LibraryTest.pch and a precompiled types file named StdAfx.obj. Files are generated by Microsoft Visual Studio */ #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file --- NEW FILE: stdafx.h --- /*$Workfile: stdafx.h$ : include file for standard system include files, or project specific include files that are used frequently, but are changed infrequently $Revision: 1.1 $ $Date: 2003/01/31 03:05:28 $ $Author: ddarko $ StdAfx.h, StdAfx.cpp These files are used to build a precompiled header (PCH) file named _LibraryTest.pch and a precompiled types file named StdAfx.obj. Files are generated by Microsoft Visual Studio */ #pragma once #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include <stdio.h> #ifdef __cplusplus #include <string> //std::string #include <iostream> //std::cout #include <iomanip.h> //std::endl #include "KTypedef.h" //Type definitions #include "KTChar.h" //Unicode mapping layer #include "KTrace.h" //debugging tools #include "KString.h" //CString #include "KTestLog.h" //CTestLog #endif //__cplusplus // TODO: reference additional headers your program requires here --- NEW FILE: _TestMain.cpp --- /*$Workfile: _TestMain.cpp$: implementation file $Revision: 1.1 $ $Date: 2003/01/31 03:05:28 $ $Author: ddarko $ Defines the entry point for the console application used to test libray functionality. 2003-01 Darko Kolakovic */ // Group=Examples #ifdef _MSC_VER /*Microsoft Visual Studio C/C++ compiler */ #ifndef _CONSOLE #error "define _CONSOLE macro in the project" #endif #endif #ifdef __GNUG__ /*GNU C++ compiler */ #ifndef _CONSOLE #warning "define _CONSOLE macro in the project" #endif #endif #include "stdafx.h" #include "KTrace.h" //TRACE macro #include "KTypedef.h" //BOOL typedef extern bool TestCalculus(); extern bool TestPoint(); extern bool TestQuadraticEquation(); extern bool TestComplex(); extern bool TestPointToComplex(); extern bool TestLeapYear(); //main()----------------------------------------------------------------------- /*Validates different date and time routines. Returns: EXIT_SUCCESS, which represents a value of 0, if successful. Otherwise a non-zero error code is returned. */ int _tmain(int argc, TCHAR* argv[] ) { cout << _T("Libarary validation") << endl << endl; CTestLog logTest; cout << _T("Start Calculus test") << endl << endl; if(TestCalculus()) cout << "Succeeded." << endl << endl; else { cout << "Failed!" << endl; return EXIT_FAILURE + 1; } if(TestPoint()) cout << "Succeeded." << endl << endl; else { cout << "Failed!" << endl; return EXIT_FAILURE + 2; } if(TestQuadraticEquation()) cout << "Succeeded." << endl << endl; else { cout << "Failed!" << endl; return EXIT_FAILURE + 3; } cout << _T("Start Complex number test") << endl << endl; if(TestComplex()) cout << "Succeeded." << endl << endl; else { cout << "Failed!" << endl; //TODO: return EXIT_FAILURE + 4; } if(TestPointToComplex()) cout << "Succeeded." << endl << endl; else { cout << "Failed!" << endl; return EXIT_FAILURE + 5; } cout << _T("Start Date and Time String test") << endl << endl; if(TestLeapYear()) cout << "Succeeded." << endl << endl; else { cout << "Failed!" << endl; return EXIT_FAILURE + 6; } return EXIT_SUCCESS; } /////////////////////////////////////////////////////////////////////////////// |
From: <dd...@us...> - 2003-01-31 03:05:01
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/_LibraryTest/Src In directory sc8-pr-cvs1:/tmp/cvs-serv22178/Src Log Message: Directory /cvsroot/babylonlib/_SrcPool/Cpp/Samples/_LibraryTest/Src added to the repository |
From: <dd...@us...> - 2003-01-31 03:04:25
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/_LibraryTest In directory sc8-pr-cvs1:/tmp/cvs-serv22037/Cpp/Samples/_LibraryTest Added Files: LibraryTest.log Log Message: Build results --- NEW FILE: LibraryTest.log --- Jan 30 2003 17:36:56 Console KDbgMacr.h Predefined macros true KStrings.h BoolToA() true KTestLog.h InitLogTest() true KTestLog.h LogTest() true KTestLog.h CloseLogTest() true KTestLog.h CTestLog true KProgCst.inl IsNaN() true KProgCst.inl CST_dNaN true KProgCst.inl CST_dSNaN true KProgCst.inl CST_dINF true KReal4IE.h CFloatIEEE true KMathCst.inl Rad2DegMinSec() true KPair.h TPair true KPoint.h TPoint true KfQuadEq.cpp funcQuadratic() true KComplxB.h _complex true KComplxB.h std::complex true KComplex.h CComplex true KComplex.h exp10() true KComplex.h acos() true KComplex.h asin() true KComplex.h tan() true KComplex.h atan() true KComplex.h tanh() false KComplex.h atanh() false KMathCst.inl logN() true KComplex.h acoth() false KZLineIn.cpp GetLineZin() true KComplex.h Rho() true KComplex.h Angle() true KTime.h IsLeapYear() true KTime.h IS_LEAP_YEAR() true |
From: <dd...@us...> - 2003-01-31 03:03:57
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/_LibraryTest In directory sc8-pr-cvs1:/tmp/cvs-serv21831/Cpp/Samples/_LibraryTest Added Files: _LibraryTest.vcproj Log Message: Test library build --- NEW FILE: _LibraryTest.vcproj --- <?xml version="1.0" encoding = "Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.00" Name="_LibraryTest" ProjectGUID="{5462D664-95DE-47E9-A9EB-92BEA93AB198}" Keyword="Win32Proj"> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="Debug\Win32" IntermediateDirectory="Obj\Win32\Debug" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\_LibraryTest\Src;..\.." PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="5" UsePrecompiledHeader="3" BrowseInformation="1" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" OutputFile="$(OutDir)/_LibraryTest.exe" LinkIncremental="2" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/_LibraryTest.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="Release\Win32" IntermediateDirectory="Obj\Win32\Release" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="TRUE" AdditionalIncludeDirectories="..\_LibraryTest\Src;..\.." PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="4" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" OutputFile="$(OutDir)/_LibraryTest.exe" LinkIncremental="1" GenerateDebugInformation="TRUE" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> <Configuration Name="DbgUnicode|Win32" OutputDirectory="Debug\Win32\Unicode" IntermediateDirectory="Obj\Win32\Unicode" ConfigurationType="1" CharacterSet="1"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\_LibraryTest\Src;..\.." PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_UNICODE" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="5" UsePrecompiledHeader="3" BrowseInformation="1" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" OutputFile="$(OutDir)/_LibraryTest.exe" LinkIncremental="2" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/_LibraryTest.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> <Configuration Name="RelUnicode|Win32" OutputDirectory="Release\Win32\Unicode" IntermediateDirectory="Obj\Win32\Unicode" ConfigurationType="1" CharacterSet="1"> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="TRUE" AdditionalIncludeDirectories="..\_LibraryTest\Src;..\.." PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_UNICODE" StringPooling="TRUE" RuntimeLibrary="4" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" OutputFile="$(OutDir)/_LibraryTest.exe" LinkIncremental="1" GenerateDebugInformation="TRUE" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> </Configurations> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> <File RelativePath="Src\KTestLog.cpp"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> </File> <File RelativePath="..\..\KZLineIn.cpp"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="DbgUnicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="RelUnicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> </File> <File RelativePath="..\..\KfQuadEq.cpp"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="DbgUnicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="RelUnicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> </File> <File RelativePath="..\Calc\Src\TsCalc.cpp"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="3"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="3"/> </FileConfiguration> <FileConfiguration Name="DbgUnicode|Win32" ExcludedFromBuild="TRUE"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="3"/> </FileConfiguration> <FileConfiguration Name="RelUnicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="3"/> </FileConfiguration> </File> <File RelativePath="..\Complex\Src\TsComplex.cpp"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> <FileConfiguration Name="DbgUnicode|Win32"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> <FileConfiguration Name="RelUnicode|Win32"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> </File> <File RelativePath="..\DateTime\Src\TsLeapYear.cpp"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="DbgUnicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="RelUnicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> </File> <File RelativePath="Src\TsWriteTxt.cpp"> <FileConfiguration Name="DbgUnicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="3"/> </FileConfiguration> </File> <File RelativePath="Src\_TestMain.cpp"> </File> <File RelativePath="Src\stdafx.cpp"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> <FileConfiguration Name="DbgUnicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> <FileConfiguration Name="RelUnicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc"> <File RelativePath="..\..\KProgCst.inl"> </File> <File RelativePath="..\..\KTChar.h"> </File> <File RelativePath="Src\KTestLog.h"> </File> <File RelativePath="..\..\KTrace.h"> </File> <File RelativePath="..\..\KTypedef.h"> </File> <File RelativePath="Src\stdafx.h"> </File> </Filter> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> </Filter> <File RelativePath="LibraryTest.log"> </File> </Files> <Globals> </Globals> </VisualStudioProject> |
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 |
From: <dd...@us...> - 2003-01-31 03:01:16
|
Update of /cvsroot/babylonlib/_SrcPool In directory sc8-pr-cvs1:/tmp/cvs-serv20833 Added Files: SrcPool.vcproj SrcPool.suo Log Message: Created VC++.Net projects --- NEW FILE: SrcPool.vcproj --- <?xml version="1.0" encoding = "Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.00" Name="SrcPool" ProjectGUID="{77A2663B-2F61-4667-9646-AC27D1A13FEB}" SccProjectName="" SccLocalPath="" Keyword="MFCProj"> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Release|Win32" OutputDirectory=".\Win32\Release" IntermediateDirectory=".\Obj\Release" ConfigurationType="4" UseOfMFC="2" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" StringPooling="TRUE" RuntimeLibrary="2" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="2" PrecompiledHeaderFile=".\Obj\Release/SrcPool.pch" AssemblerListingLocation=".\Obj\Release/" ObjectFile=".\Obj\Release/" ProgramDataBaseFileName=".\Obj\Release/" WarningLevel="3" SuppressStartupBanner="TRUE"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLibrarianTool" OutputFile=".\Win32\Release\SrcPool.lib" SuppressStartupBanner="TRUE"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_AFXDLL;NDEBUG" Culture="1033"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> </Configuration> <Configuration Name="Debug|Win32" OutputDirectory=".\Win32\Debug" IntermediateDirectory=".\Obj\Debug" ConfigurationType="4" UseOfMFC="2" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="2" PrecompiledHeaderFile=".\Obj\Debug/SrcPool.pch" AssemblerListingLocation=".\Obj\Debug/" ObjectFile=".\Obj\Debug/" ProgramDataBaseFileName=".\Obj\Debug/" BrowseInformation="1" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLibrarianTool" OutputFile=".\Win32\Debug\SrcPool.lib" SuppressStartupBanner="TRUE"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_AFXDLL;_DEBUG" Culture="1033"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> </Configuration> </Configurations> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> <File RelativePath=".\Cpp\KApnSyMn.cpp"> </File> <File RelativePath="Cpp\KBmpViewer.cpp"> </File> <File RelativePath=".\Cpp\KClipCBm.cpp"> </File> <File RelativePath=".\Cpp\KClipCTx.cpp"> </File> <File RelativePath=".\Cpp\KDateCrl.cpp"> <FileConfiguration Name="Debug|Win32" ExcludedFromBuild="TRUE"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> </File> <File RelativePath=".\Cpp\KDateStr.cpp"> </File> <File RelativePath=".\Cpp\KDateTm.c"> </File> <File RelativePath=".\Cpp\KDbgBtnS.cpp"> </File> <File RelativePath=".\Cpp\KDbgDCAt.cpp"> </File> <File RelativePath=".\Cpp\KDbgFILE.c"> </File> <File RelativePath=".\Cpp\KDbgFVSI.cpp"> </File> <File RelativePath=".\Cpp\KDbgGUID.cpp"> </File> <File RelativePath=".\Cpp\KDbgLDLL.cpp"> </File> <File RelativePath=".\Cpp\KDbgMapM.cpp"> </File> <File RelativePath=".\Cpp\KDbgOSVI.cpp"> </File> <File RelativePath=".\Cpp\KDbgPrpS.cpp"> </File> <File RelativePath=".\Cpp\KDbgRASS.cpp"> </File> <File RelativePath=".\Cpp\KDbgREFIID.cpp"> </File> <File RelativePath=".\Cpp\KDbgTLog.cpp"> </File> <File RelativePath=".\Cpp\KDbgVerI.cpp"> </File> <File RelativePath=".\Cpp\KDirName.cpp"> </File> <File RelativePath=".\Cpp\KDlgItLs.cpp"> </File> <File RelativePath=".\Cpp\KDlgItem.cpp"> </File> <File RelativePath=".\Cpp\KDlgRsiz.cpp"> </File> <File RelativePath=".\Cpp\KDlgTmIt.cpp"> </File> <File RelativePath=".\Cpp\KDlgTmpl.cpp"> </File> <File RelativePath=".\Cpp\KDockBar.cpp"> </File> <File RelativePath=".\Cpp\KFileExtR.cpp"> </File> <File RelativePath=".\Cpp\KFileFindOld.cpp"> </File> <File RelativePath=".\Cpp\KFileNam.cpp"> </File> <File RelativePath=".\Cpp\KFileNmB.cpp"> </File> <File RelativePath=".\Cpp\KFileNmF.cpp"> </File> <File RelativePath=".\Cpp\KFileRead.cpp"> </File> <File RelativePath=".\Cpp\KFileSetTime.cpp"> </File> <File RelativePath=".\Cpp\KFileShortcut.cpp"> </File> <File RelativePath="Cpp\KFileTime.cpp"> </File> <File RelativePath=".\Cpp\KFileTmpName.cpp"> </File> <File RelativePath=".\Cpp\KFindEdt.cpp"> </File> <File RelativePath=".\Cpp\KGetLRC.cpp"> </File> <File RelativePath=".\Cpp\KGetLine.cpp"> </File> <File RelativePath=".\Cpp\KGetLines.cpp"> </File> <File RelativePath=".\Cpp\KGetPrSu.cpp"> </File> <File RelativePath=".\Cpp\KGetPrTy.cpp"> </File> <File RelativePath=".\Cpp\KGetShel.cpp"> </File> <File RelativePath=".\Cpp\KGif.cpp"> </File> <File RelativePath=".\Cpp\KGifImageData.cpp"> </File> <File RelativePath=".\Cpp\KGifImageDescriptor.cpp"> </File> <File RelativePath=".\Cpp\KGifLzw.cpp"> </File> <File RelativePath=".\Cpp\KGifViewer.cpp"> </File> <File RelativePath=".\Cpp\KHypLink.cpp"> </File> <File RelativePath=".\Cpp\KIsFileNameValid.cpp"> </File> <File RelativePath=".\Cpp\KIsLRC.cpp"> </File> <File RelativePath=".\Cpp\KIsPrimeNo.cpp"> </File> <File RelativePath=".\Cpp\KIsProdS.cpp"> </File> <File RelativePath=".\Cpp\KIsRASCo.cpp"> </File> <File RelativePath=".\Cpp\KIsSrvce.cpp"> </File> <File RelativePath=".\Cpp\KIsTerm.cpp"> </File> <File RelativePath=".\Cpp\KItoA.c"> </File> <File RelativePath=".\Cpp\KItoOct.c"> </File> <File RelativePath=".\Cpp\KLogoOut.cpp"> <FileConfiguration Name="Release|Win32" ExcludedFromBuild="TRUE"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> <FileConfiguration Name="Debug|Win32" ExcludedFromBuild="TRUE"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> </File> <File RelativePath="Cpp\KMatFact.cpp"> </File> <File RelativePath=".\Cpp\KPropPgR.cpp"> </File> <File RelativePath=".\Cpp\KPropShR.cpp"> </File> <File RelativePath=".\Cpp\KRandomGauss.cpp"> </File> <File RelativePath=".\Cpp\KRandomUniform.cpp"> </File> <File RelativePath=".\Cpp\KRegExt.cpp"> </File> <File RelativePath=".\Cpp\KRegKey.cpp"> </File> <File RelativePath=".\Cpp\KSkipWSp.cpp"> </File> <File RelativePath=".\Cpp\KSpwnURL.cpp"> </File> <File RelativePath=".\Cpp\KStrBtoA.c"> </File> <File RelativePath=".\Cpp\KStrBtoH.cpp"> </File> <File RelativePath=".\Cpp\KStrBtoU.c"> </File> <File RelativePath=".\Cpp\KStrCatV.c"> </File> <File RelativePath=".\Cpp\KStrCtoA.c"> </File> <File RelativePath=".\Cpp\KStrDup.c"> </File> <File RelativePath=".\Cpp\KStrEnum.cpp"> </File> <File RelativePath=".\Cpp\KStrExC.cpp"> </File> <File RelativePath=".\Cpp\KStrFit.cpp"> </File> <File RelativePath=".\Cpp\KStrGSu.cpp"> </File> <File RelativePath=".\Cpp\KStrGetF.cpp"> </File> <File RelativePath=".\Cpp\KStrGetLine.cpp"> </File> <File RelativePath=".\Cpp\KStrGetS.cpp"> </File> <File RelativePath=".\Cpp\KStrGetW.cpp"> </File> <File RelativePath=".\Cpp\KStrHtoL.c"> </File> <File RelativePath=".\Cpp\KStrICmp.c"> </File> <File RelativePath=".\Cpp\KStrLowC.c"> </File> <File RelativePath=".\Cpp\KStrOtoL.c"> </File> <File RelativePath=".\Cpp\KStrPCpy.c"> </File> <File RelativePath=".\Cpp\KStrRTab.c"> </File> <File RelativePath=".\Cpp\KStrRpl.cpp"> </File> <File RelativePath=".\Cpp\KStrRplEOL.cpp"> </File> <File RelativePath=".\Cpp\KStrRplEscSeq.cpp"> </File> <File RelativePath=".\Cpp\KStrRplSpaces.cpp"> </File> <File RelativePath=".\Cpp\KStrRplT.cpp"> </File> <File RelativePath=".\Cpp\KStrStream.cpp"> </File> <File RelativePath=".\Cpp\KStrTrSl.c"> </File> <File RelativePath=".\Cpp\KStrTrim.cpp"> </File> <File RelativePath=".\Cpp\KStrUppr.cpp"> </File> <File RelativePath=".\Cpp\KStrUtDJ.c"> </File> <File RelativePath=".\Cpp\KStrUtoD.c"> </File> <File RelativePath=".\Cpp\KString.cpp"> </File> <File RelativePath=".\Cpp\KSysErrM.cpp"> </File> <File RelativePath=".\Cpp\KTaskIco.cpp"> </File> <File RelativePath=".\Cpp\KTimer.cpp"> </File> <File RelativePath=".\Cpp\KTimerW.cpp"> </File> <File RelativePath=".\Cpp\KTipBox.cpp"> <FileConfiguration Name="Debug|Win32" ExcludedFromBuild="TRUE"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> </File> <File RelativePath=".\Cpp\KTmCmp.c"> </File> <File RelativePath=".\Cpp\KVerInfo.cpp"> </File> <File RelativePath=".\Cpp\KWinFWIs.cpp"> </File> <File RelativePath=".\Cpp\KWinPlac.cpp"> </File> <File RelativePath=".\Cpp\KWinVerG.cpp"> </File> <File RelativePath=".\Cpp\KWinVers.cpp"> </File> <File RelativePath=".\Cpp\KZLineIn.cpp"> </File> <File RelativePath="Cpp\KfKepler.cpp"> </File> <File RelativePath=".\Cpp\KfNewtRp.cpp"> </File> <File RelativePath=".\Cpp\KfQuadEq.cpp"> </File> <File RelativePath=".\Cpp\SrcPool.rc"> <FileConfiguration Name="Release|Win32"> <Tool Name="VCResourceCompilerTool" AdditionalIncludeDirectories="Cpp;$(NoInherit)"/> </FileConfiguration> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCResourceCompilerTool" AdditionalIncludeDirectories="Cpp;$(NoInherit)"/> </FileConfiguration> </File> <File RelativePath="Cpp\StdAfx.cpp"> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl"> <File RelativePath=".\Cpp\KBeep.h"> </File> <File RelativePath=".\Cpp\KBitMan.h"> </File> <File RelativePath=".\Cpp\KBitmap.h"> </File> <File RelativePath="Cpp\KBmpViewer.h"> </File> <File RelativePath=".\Cpp\KCharCst.h"> </File> <File RelativePath=".\Cpp\KChecksum.h"> </File> <File RelativePath=".\Cpp\KColorCt.h"> </File> <File RelativePath=".\Cpp\KComplex.h"> </File> <File RelativePath=".\Cpp\KComplxB.h"> </File> <File RelativePath=".\Cpp\KCrc32.h"> </File> <File RelativePath=".\Cpp\KDateCrl.h"> </File> <File RelativePath=".\Cpp\KDbgDump.h"> </File> <File RelativePath=".\Cpp\KDbgMacr.h"> </File> <File RelativePath="Cpp\KDbgStlA.h"> </File> <File RelativePath=".\Cpp\KDlgItLs.h"> </File> <File RelativePath=".\Cpp\KDlgItem.h"> </File> <File RelativePath=".\Cpp\KDlgRsiz.h"> </File> <File RelativePath=".\Cpp\KDlgTmIt.h"> </File> <File RelativePath=".\Cpp\KDlgTmpl.h"> </File> <File RelativePath=".\Cpp\KFileExtR.h"> </File> <File RelativePath=".\Cpp\KFileHnd.inl"> </File> <File RelativePath=".\Cpp\KFileN32.inl"> </File> <File RelativePath=".\Cpp\KFileNam.h"> </File> <File RelativePath=".\Cpp\KFileNmB.h"> </File> <File RelativePath=".\Cpp\KFileShortcut.h"> </File> <File RelativePath=".\Cpp\KFileSys.h"> </File> <File RelativePath="Cpp\KFileTime.h"> </File> <File RelativePath="Cpp\KFileTimeCm.h"> </File> <File RelativePath=".\Cpp\KFindRes.h"> </File> <File RelativePath=".\Cpp\KGif.h"> </File> <File RelativePath=".\Cpp\KGifImageData.h"> </File> <File RelativePath=".\CPP\KGifImageDescriptor.h"> </File> <File RelativePath=".\CPP\KGifLzw.h"> </File> <File RelativePath=".\CPP\KGifViewer.h"> </File> <File RelativePath=".\Cpp\KHypLink.h"> </File> <File RelativePath=".\Cpp\KIPAddress.h"> </File> <File RelativePath=".\Cpp\KMatLog2.inl"> </File> <File RelativePath=".\Cpp\KMathCst.h"> </File> <File RelativePath=".\Cpp\KMathCst.inl"> </File> <File RelativePath=".\Cpp\KNLSCst.h"> </File> <File RelativePath=".\Cpp\KNetByte.h"> </File> <File RelativePath=".\Cpp\KPair.h"> </File> <File RelativePath=".\Cpp\KPhysCst.h"> </File> <File RelativePath=".\Cpp\KPoint.h"> </File> <File RelativePath=".\Cpp\KProgCst.h"> </File> <File RelativePath=".\Cpp\KProgCst.inl"> </File> <File RelativePath=".\Cpp\KPropPgR.h"> </File> <File RelativePath=".\Cpp\KPropShR.h"> </File> <File RelativePath=".\Cpp\KRandom.h"> </File> <File RelativePath=".\Cpp\KRandomCongr.h"> </File> <File RelativePath=".\Cpp\KRandomGauss.h"> </File> <File RelativePath=".\Cpp\KRandomUniform.h"> </File> <File RelativePath=".\Cpp\KReal4Cv.h"> </File> <File RelativePath=".\Cpp\KReal4IE.h"> </File> <File RelativePath=".\Cpp\KReal8Cv.h"> </File> <File RelativePath=".\Cpp\KRegExt.h"> </File> <File RelativePath=".\Cpp\KRegKey.h"> </File> <File RelativePath=".\Cpp\KSound.inl"> </File> <File RelativePath=".\Cpp\KStrExt.h"> </File> <File RelativePath=".\Cpp\KString.h"> </File> <File RelativePath=".\Cpp\KStrings.h"> </File> <File RelativePath=".\Cpp\KSwpByte.h"> </File> <File RelativePath=".\Cpp\KSwpByteOrder.h"> </File> <File RelativePath=".\Cpp\KSwpElements.h"> </File> <File RelativePath=".\Cpp\KSwpRows.h"> </File> <File RelativePath=".\Cpp\KTChar.h"> </File> <File RelativePath=".\Cpp\KTaskIco.h"> </File> <File RelativePath=".\Cpp\KTime.h"> </File> <File RelativePath=".\Cpp\KTimer.h"> </File> <File RelativePath=".\Cpp\KTimerW.h"> </File> <File RelativePath=".\Cpp\KTipBox.h"> </File> <File RelativePath=".\Cpp\KTrace.h"> </File> <File RelativePath=".\Cpp\KType32.h"> </File> <File RelativePath=".\Cpp\KTypedef.h"> </File> <File RelativePath=".\Cpp\KVerInfo.h"> </File> <File RelativePath=".\Cpp\KWinPlac.h"> </File> <File RelativePath=".\Cpp\KWinVerG.inl"> </File> <File RelativePath=".\Cpp\KWinVers.h"> </File> <File RelativePath=".\Cpp\KWinVers.inl"> </File> <File RelativePath=".\Cpp\16\KioPIT.h"> </File> <File RelativePath=".\Cpp\16\KioPPI.h"> </File> <File RelativePath=".\Cpp\StdAfx.h"> </File> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: SrcPool.suo --- (This appears to be a binary file; contents omitted.) |