Re: [Massembly-devel] Linux diff, part 1
Status: Alpha
Brought to you by:
doczoid
From: Yannick H. <yan...@gm...> - 2004-08-06 23:17:46
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> </head> <body> Hi!<br> <br> Obwohl ich nach deiner Mail vermute, dass englisch für Mailing-Lists wohl die Sprache der Wahl ist, werde ich in anbetracht der Uhrzeit deutsch vorziehen.<br> <br> Freut mich, dass nach einigen Änderungen zumindest ein kleiner Teil kompilierbar war :-) Der Code ist schnell recht Portabel geworden, aber ein letzter (fein?)schliff ist unumgänglich. Zu den Änderungen:<br> <br> - UINT kann überall in unsigned int geändert werden. DWORD ist ebenfalls unsigned int, nicht int! Wenn Variablen von DWORD nach unsigned int geändert werden, dann bitte den Präfix ebenfalls von dw nach ui ändern.<br> - __int64 kann nicht in "long long" geändert werden, das versteht MS garnicht. Da long long aus zwei Wörtern besteht, kann ich das dem Microsoft-Compiler nicht ohne weiteres beibringen (vielleicht gibt es hier ein service pack?). Bitte, wenn möglich, für's Erste in nicht-win-Umgebungen __int64 per define in long long konvertieren.<br> - mich wundert, dass wxWidgets unter Linux mehr Header braucht als unter win. Die sollten aber nicht stören. Ebenso sehe ich beim Rest keine Probleme.<br> <br> <br> Gruß & viel Erfolg<br> Yannick<br> <br> Nils Faerber schrieb:<br> <blockquote type="cite" cite="mid20040806213918.GA7581@smtp"> <pre wrap="">Hi! Tonight I had my first go at compiling MAP for Linux but failed ;) I changewd some things in some files to get it at least to compile a little. I have attached an appropriate diff for your review (I cannot cross check with Win). CU nils </pre> <pre wrap=""> <hr width="90%" size="4"> ? map.diff Index: ClientDefs.h =================================================================== RCS file: /cvsroot/massembly/MAPEditor/ClientDefs.h,v retrieving revision 1.4 diff -c -r1.4 ClientDefs.h *** ClientDefs.h 1 Aug 2004 21:56:42 -0000 1.4 --- ClientDefs.h 6 Aug 2004 21:34:38 -0000 *************** *** 11,19 **** #include "Common/Defs.h" ! /***************************************/ ! /** class declarations ! /***************************************/ class CCoordinate; class CRoadSegment; --- 11,19 ---- #include "Common/Defs.h" ! /*************************************** ! * class declarations ! ***************************************/ class CCoordinate; class CRoadSegment; *************** *** 25,33 **** class CMAPEditorView; class CMainFrame; ! /***************************************/ ! /** hard-coded setting ! /***************************************/ //max number of GPS-points #define MAX_NGPSPOINTS 131072 --- 25,33 ---- class CMAPEditorView; class CMainFrame; ! /*************************************** ! * hard-coded setting ! ***************************************/ //max number of GPS-points #define MAX_NGPSPOINTS 131072 *************** *** 51,59 **** #define SCALE_MAXWIDTH 250 #define SCALE_HEIGHT 10 ! /***************************************/ ! /** macros ! /***************************************/ #define ValIsID(x) ((DWORD)(x)&0x80000000) #define ValIsPtr(x) (!ValIsID(x)) --- 51,59 ---- #define SCALE_MAXWIDTH 250 #define SCALE_HEIGHT 10 ! /*************************************** ! * macros ! ***************************************/ #define ValIsID(x) ((DWORD)(x)&0x80000000) #define ValIsPtr(x) (!ValIsID(x)) *************** *** 63,71 **** //calculate a triangle's hypotenuse #define DISTANCE(x,y) (sqrt(pow((x), 2)+pow((y), 2))) ! /***************************************/ ! /** structures ! /***************************************/ struct SETTINGS { --- 63,71 ---- //calculate a triangle's hypotenuse #define DISTANCE(x,y) (sqrt(pow((x), 2)+pow((y), 2))) ! /*************************************** ! * structures ! ***************************************/ struct SETTINGS { *************** *** 125,133 **** }; #endif ! /***************************************/ ! /** Some cool distance functions ! /***************************************/ double DistanceLineToPoint(DWORD dwLatitudeLineStart, DWORD dwLongitudeLineStart, long lAltitudeLineStart, DWORD dwLatitudeLineEnd, DWORD dwLongitudeLineEnd, long lAltitudeLineEnd, --- 125,133 ---- }; #endif ! /*************************************** ! * Some cool distance functions ! ***************************************/ double DistanceLineToPoint(DWORD dwLatitudeLineStart, DWORD dwLongitudeLineStart, long lAltitudeLineStart, DWORD dwLatitudeLineEnd, DWORD dwLongitudeLineEnd, long lAltitudeLineEnd, *************** *** 164,172 **** double DistanceToAngle(double dDistance); ! /***************************************/ ! /** Global variable declarations ! /***************************************/ //Global file pointer extern CFile* pFileCoordinates; --- 164,172 ---- double DistanceToAngle(double dDistance); ! /*************************************** ! * Global variable declarations ! ***************************************/ //Global file pointer extern CFile* pFileCoordinates; *************** *** 184,200 **** extern CMAPEditorView* _pView; extern CMainFrame* _pMainFrame; ! /***************************************/ ! /** Global function declarations ! /***************************************/ //Thread-function for GPS-COM-Input ! UINT GPSCOMRoutine(LPVOID pParam); ! /***************************************/ ! /** User-defined Messages ! /***************************************/ #define WM_PANVIEW (wxID_HIGHEST+1) --- 184,201 ---- extern CMAPEditorView* _pView; extern CMainFrame* _pMainFrame; ! /*************************************** ! * Global function declarations ! ***************************************/ //Thread-function for GPS-COM-Input ! //UINT GPSCOMRoutine(LPVOID pParam); ! unsigned int GPSCOMRoutine(void *pParam); ! /*************************************** ! * User-defined Messages ! ***************************************/ #define WM_PANVIEW (wxID_HIGHEST+1) Index: Coordinate.cpp =================================================================== RCS file: /cvsroot/massembly/MAPEditor/Coordinate.cpp,v retrieving revision 1.2 diff -c -r1.2 Coordinate.cpp *** Coordinate.cpp 21 Jul 2004 22:42:31 -0000 1.2 --- Coordinate.cpp 6 Aug 2004 21:34:38 -0000 *************** *** 61,68 **** else if (dHDOP<=GetHDOP()*1.25) { int iHDOP=(int)(10*dHDOP); ! m_Point.Offset((__int64)dwLongitude-(((__int64)m_Point.Longitude*m_byNumberOfHUpdates*m_byHDOP+dwLongitude*DDOP2IDOP(dHDOP))/(m_byNumberOfHUpdates*DDOP2IDOP(GetHDOP())+DDOP2IDOP(dHDOP))), ! dwLatitude-(DWORD)(((__int64)m_Point.Latitude*m_byNumberOfHUpdates*m_byHDOP+dwLatitude*DDOP2IDOP(dHDOP))/(m_byNumberOfHUpdates*DDOP2IDOP(GetHDOP())+DDOP2IDOP(dHDOP)))); SetHDOP((GetHDOP()*m_byNumberOfHUpdates+dHDOP)/(m_byNumberOfHUpdates+1)); bUpdated=true; } --- 61,68 ---- else if (dHDOP<=GetHDOP()*1.25) { int iHDOP=(int)(10*dHDOP); ! m_Point.Offset((long long)dwLongitude-(((long long)m_Point.Longitude*m_byNumberOfHUpdates*m_byHDOP+dwLongitude*DDOP2IDOP(dHDOP))/(m_byNumberOfHUpdates*DDOP2IDOP(GetHDOP())+DDOP2IDOP(dHDOP))), ! dwLatitude-(DWORD)(((long long)m_Point.Latitude*m_byNumberOfHUpdates*m_byHDOP+dwLatitude*DDOP2IDOP(dHDOP))/(m_byNumberOfHUpdates*DDOP2IDOP(GetHDOP())+DDOP2IDOP(dHDOP)))); SetHDOP((GetHDOP()*m_byNumberOfHUpdates+dHDOP)/(m_byNumberOfHUpdates+1)); bUpdated=true; } *************** *** 84,90 **** } else if (dVDOP<GetVDOP()*1.25) { ! SetAltitude(lAltitude+m_lAltitude-(long)(((__int64)m_lAltitude*m_byNumberOfVUpdates*GetVDOP()+lAltitude*dVDOP)/(m_byNumberOfVUpdates*GetVDOP()+dVDOP))); SetVDOP((GetVDOP()*m_byNumberOfVUpdates+dVDOP)/(m_byNumberOfVUpdates+1)); bUpdated=true; } --- 84,90 ---- } else if (dVDOP<GetVDOP()*1.25) { ! SetAltitude(lAltitude+m_lAltitude-(long)(((long long)m_lAltitude*m_byNumberOfVUpdates*GetVDOP()+lAltitude*dVDOP)/(m_byNumberOfVUpdates*GetVDOP()+dVDOP))); SetVDOP((GetVDOP()*m_byNumberOfVUpdates+dVDOP)/(m_byNumberOfVUpdates+1)); bUpdated=true; } Index: MAPEditor.cpp =================================================================== RCS file: /cvsroot/massembly/MAPEditor/MAPEditor.cpp,v retrieving revision 1.6 diff -c -r1.6 MAPEditor.cpp *** MAPEditor.cpp 1 Aug 2004 21:59:46 -0000 1.6 --- MAPEditor.cpp 6 Aug 2004 21:34:39 -0000 *************** *** 9,16 **** #include "MAPEditorDoc.h" #include "MAPEditorView.h" #include "Common/Transaction.h" ! #include "wx/cmdline.h" ! #include "wx/filename.h" #if !wxUSE_DOC_VIEW_ARCHITECTURE #error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h! --- 9,19 ---- #include "MAPEditorDoc.h" #include "MAPEditorView.h" #include "Common/Transaction.h" ! #include <wx/cmdline.h> ! #include <wx/filename.h> ! #include <wx/menu.h> ! #include <wx/intl.h> ! #include <wx/log.h> #if !wxUSE_DOC_VIEW_ARCHITECTURE #error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h! *************** *** 150,160 **** // CMAPEditorApp-Nachrichtenbehandlungsroutinen ! UINT GPSCOMRoutine(LPVOID pParam) { CMAPEditorDoc* pDoc = (CMAPEditorDoc*)pParam; ! DWORD dwRead; ! UINT uiErrorCode=0; int nErrornous=0; wxLogDebug("COM-Thread started"); while (1) --- 153,163 ---- // CMAPEditorApp-Nachrichtenbehandlungsroutinen ! unsigned int GPSCOMRoutine(void *pParam) { CMAPEditorDoc* pDoc = (CMAPEditorDoc*)pParam; ! long dwRead; ! unsigned int uiErrorCode=0; int nErrornous=0; wxLogDebug("COM-Thread started"); while (1) Index: MAPEditor.h =================================================================== RCS file: /cvsroot/massembly/MAPEditor/MAPEditor.h,v retrieving revision 1.2 diff -c -r1.2 MAPEditor.h *** MAPEditor.h 16 Jul 2004 07:03:12 -0000 1.2 --- MAPEditor.h 6 Aug 2004 21:34:39 -0000 *************** *** 5,11 **** #define _GPSTRACKER_H__INCLUDED_ #include "ClientDefs.h" ! #include "wx/docview.h" #include "resource.h" // Hauptsymbole ///////////////////////////////////////////////////////////////////////////// --- 5,12 ---- #define _GPSTRACKER_H__INCLUDED_ #include "ClientDefs.h" ! #include <wx/docview.h> ! #include <wx/app.h> #include "resource.h" // Hauptsymbole ///////////////////////////////////////////////////////////////////////////// Index: MAPEditorDoc.h =================================================================== RCS file: /cvsroot/massembly/MAPEditor/MAPEditorDoc.h,v retrieving revision 1.5 diff -c -r1.5 MAPEditorDoc.h *** MAPEditorDoc.h 1 Aug 2004 21:57:50 -0000 1.5 --- MAPEditorDoc.h 6 Aug 2004 21:34:39 -0000 *************** *** 5,13 **** #if !defined(_GPSTRACKERDOC_H__INCLUDED_) #define _GPSTRACKERDOC_H__INCLUDED_ ! #include "wx/wxprec.h" #include "ClientDefs.h" ! #include "wx/docview.h" class CMAPEditorDoc : public wxDocument { --- 5,17 ---- #if !defined(_GPSTRACKERDOC_H__INCLUDED_) #define _GPSTRACKERDOC_H__INCLUDED_ ! #include <wx/wxprec.h> #include "ClientDefs.h" ! #include <wx/docview.h> ! ! #ifndef HANDLE ! #define HANDLE int ! #endif class CMAPEditorDoc : public wxDocument { Index: RoadPropertiesDlg.h =================================================================== RCS file: /cvsroot/massembly/MAPEditor/RoadPropertiesDlg.h,v retrieving revision 1.2 diff -c -r1.2 RoadPropertiesDlg.h *** RoadPropertiesDlg.h 1 Aug 2004 21:47:59 -0000 1.2 --- RoadPropertiesDlg.h 6 Aug 2004 21:34:39 -0000 *************** *** 4,11 **** // RoadPropertiesDlg.h : Header-Datei // #include "ClientDefs.h" ! #include "wx/ListCtrl.h" ! #include "wx/TreeCtrl.h" #include "res/CRoadPropertiesDlgBase.h" ///////////////////////////////////////////////////////////////////////////// --- 4,11 ---- // RoadPropertiesDlg.h : Header-Datei // #include "ClientDefs.h" ! #include <wx/listctrl.h> ! #include <wx/treectrl.h> #include "res/CRoadPropertiesDlgBase.h" ///////////////////////////////////////////////////////////////////////////// Index: World.h =================================================================== RCS file: /cvsroot/massembly/MAPEditor/World.h,v retrieving revision 1.3 diff -c -r1.3 World.h *** World.h 1 Aug 2004 21:54:21 -0000 1.3 --- World.h 6 Aug 2004 21:34:39 -0000 *************** *** 28,34 **** DWORD m_pBigRegions [180][360]; // 1? * 1? DWORD* m_pMedRegions; // 1/2? * 1/2? DWORD* m_pSmallRegions; // 1/4? * 1/4? ! __int64 m_IDMapVersion; IDSNAPSHOT m_NextLocalIDs; public: CTransactionHandler* m_pTH; --- 28,34 ---- DWORD m_pBigRegions [180][360]; // 1? * 1? DWORD* m_pMedRegions; // 1/2? * 1/2? DWORD* m_pSmallRegions; // 1/4? * 1/4? ! long long m_IDMapVersion; IDSNAPSHOT m_NextLocalIDs; public: CTransactionHandler* m_pTH; *************** *** 56,59 **** CRoad* AddRoad(CRoad* pRoad, WORD wSegment); }; ! #endif \ No newline at end of file --- 56,59 ---- CRoad* AddRoad(CRoad* pRoad, WORD wSegment); }; ! #endif Index: Common/Defs.h =================================================================== RCS file: /cvsroot/massembly/MAPEditor/Common/Defs.h,v retrieving revision 1.2 diff -c -r1.2 Defs.h *** Common/Defs.h 1 Aug 2004 22:02:22 -0000 1.2 --- Common/Defs.h 6 Aug 2004 21:34:40 -0000 *************** *** 5,11 **** #pragma once #endif // _MSC_VER > 1000 ! #include "wx\\wxprec.h" #include "math.h" #include "float.h" --- 5,12 ---- #pragma once #endif // _MSC_VER > 1000 ! #include <wx/wxprec.h> ! #include <wx/string.h> #include "math.h" #include "float.h" *************** *** 21,29 **** #include "TransferDefs.h" ! /***************************************/ ! /** hard-coded setting ! /***************************************/ //max number of RoadSegments attached to one coordinate #define MAX_ROADSEGMENTS_PER_COORDINATE 40 --- 22,30 ---- #include "TransferDefs.h" ! /*************************************** ! * hard-coded setting ! ***************************************/ //max number of RoadSegments attached to one coordinate #define MAX_ROADSEGMENTS_PER_COORDINATE 40 *************** *** 40,48 **** #define M_PI 3.14159265358979323846 #endif ! /***************************************/ ! /** Flags ! /***************************************/ // defines for SegmentFlags #define RSF_ONEWAY 0x01 --- 41,49 ---- #define M_PI 3.14159265358979323846 #endif ! /*************************************** ! * Flags ! ***************************************/ // defines for SegmentFlags #define RSF_ONEWAY 0x01 *************** *** 65,73 **** //max weight (free for adjacent owner), 1-400, default 400, wVal #define RSPT_MAXWEIGHTFAO 0x84 ! /***************************************/ ! /** macros ! /***************************************/ //compress a DOP-value so that it fits in a BYTE #define DOP2BYTE(x) ((BYTE)(((x)>20)?(((x)-20.0)/30.0*55.0+200):((x)*10))) --- 66,74 ---- //max weight (free for adjacent owner), 1-400, default 400, wVal #define RSPT_MAXWEIGHTFAO 0x84 ! /*************************************** ! * macros ! ***************************************/ //compress a DOP-value so that it fits in a BYTE #define DOP2BYTE(x) ((BYTE)(((x)>20)?(((x)-20.0)/30.0*55.0+200):((x)*10))) *************** *** 80,88 **** #define RESULTINGTRUSTLEVEL(x) ((x<=50000)?(100000000/(x+50000)-1000):x) ! /***************************************/ ! /** transaction-defs ! /***************************************/ class CTransaction; class CTransactionHandler; --- 81,89 ---- #define RESULTINGTRUSTLEVEL(x) ((x<=50000)?(100000000/(x+50000)-1000):x) ! /*************************************** ! * transaction-defs ! ***************************************/ class CTransaction; class CTransactionHandler; *************** *** 112,120 **** #define SER_GET4(x) *(DWORD*)(&x)=*(DWORD*)(pbyBuffer+iSize), iSize+=4 #define SER_GETS(x) memcpy(x.GetWriteBuf(pbyBuffer[iSize]), pbyBuffer+iSize+1, pbyBuffer[iSize]); iSize+=pbyBuffer[iSize]+1; x.UngetWriteBuf() ! /***************************************/ ! /** structures & enums ! /***************************************/ struct SEGMENTPROPERTY { --- 113,121 ---- #define SER_GET4(x) *(DWORD*)(&x)=*(DWORD*)(pbyBuffer+iSize), iSize+=4 #define SER_GETS(x) memcpy(x.GetWriteBuf(pbyBuffer[iSize]), pbyBuffer+iSize+1, pbyBuffer[iSize]); iSize+=pbyBuffer[iSize]+1; x.UngetWriteBuf() ! /*************************************** ! * structures & enums ! ***************************************/ struct SEGMENTPROPERTY { *************** *** 198,206 **** DelCoordinate }; ! /***************************************/ ! /** global classes ! /***************************************/ class CoordPoint { --- 199,207 ---- DelCoordinate }; ! /*************************************** ! * global classes ! ***************************************/ class CoordPoint { *************** *** 210,216 **** CoordPoint() {Latitude=0; Longitude=0;}; CoordPoint(DWORD dwLat, DWORD dwLong) {Latitude=dwLat, Longitude=dwLong;}; CoordPoint& operator= (CoordPoint p) {Latitude=p.Latitude, Longitude=p.Longitude; return *this;}; ! void Offset(__int64 x, int y) { wxASSERT(Latitude<1800000000 && Latitude>0 && Longitude<3600000000); if (y>=1800000000) y=1799999999; else if (y<=-1800000000) y=-1799999999; --- 211,217 ---- CoordPoint() {Latitude=0; Longitude=0;}; CoordPoint(DWORD dwLat, DWORD dwLong) {Latitude=dwLat, Longitude=dwLong;}; CoordPoint& operator= (CoordPoint p) {Latitude=p.Latitude, Longitude=p.Longitude; return *this;}; ! void Offset(long long x, int y) { wxASSERT(Latitude<1800000000 && Latitude>0 && Longitude<3600000000); if (y>=1800000000) y=1799999999; else if (y<=-1800000000) y=-1799999999; *************** *** 236,242 **** DWORD Width() {return Right-Left+((Left>Right)?3600000000:0);}; DWORD HCenter() {DWORD dwWidth=Width()/2+Left; return (dwWidth>=3600000000 || dwWidth<Left)?dwWidth-3600000000:dwWidth;}; DWORD VCenter() {return Height()/2+Bottom;}; ! void OffsetRect(__int64 x, int y) { wxASSERT(Top>=Bottom && Top<1800000000 && Bottom>0 && Left<3600000000 && Right<3600000000); if (y>=1800000000) y=1799999999; else if (y<=-1800000000) y=-1799999999; --- 237,243 ---- DWORD Width() {return Right-Left+((Left>Right)?3600000000:0);}; DWORD HCenter() {DWORD dwWidth=Width()/2+Left; return (dwWidth>=3600000000 || dwWidth<Left)?dwWidth-3600000000:dwWidth;}; DWORD VCenter() {return Height()/2+Bottom;}; ! void OffsetRect(long long x, int y) { wxASSERT(Top>=Bottom && Top<1800000000 && Bottom>0 && Left<3600000000 && Right<3600000000); if (y>=1800000000) y=1799999999; else if (y<=-1800000000) y=-1799999999; Index: Common/Transaction.h =================================================================== RCS file: /cvsroot/massembly/MAPEditor/Common/Transaction.h,v retrieving revision 1.2 diff -c -r1.2 Transaction.h *** Common/Transaction.h 1 Aug 2004 22:02:22 -0000 1.2 --- Common/Transaction.h 6 Aug 2004 21:34:40 -0000 *************** *** 57,60 **** }; ! #endif \ No newline at end of file --- 57,60 ---- }; ! #endif Index: Common/TransferDefs.h =================================================================== RCS file: /cvsroot/massembly/MAPEditor/Common/TransferDefs.h,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 TransferDefs.h *** Common/TransferDefs.h 13 Jul 2004 22:25:18 -0000 1.1.1.1 --- Common/TransferDefs.h 6 Aug 2004 21:34:40 -0000 *************** *** 13,21 **** ! /***************************************/ ! /** Client Messages Server->Client ! /***************************************/ //Server is full, no message yet #define CMSG_QUEUEFULL 0 --- 13,21 ---- ! /*************************************** ! * Client Messages Server->Client ! ***************************************/ //Server is full, no message yet #define CMSG_QUEUEFULL 0 *************** *** 44,52 **** //[01] x : Transaction data #define CMSG_TRANSACTIONDATA 6 ! /***************************************/ ! /** Client Messages Client->Server ! /***************************************/ //Attempt a login. //[01] 2 : Major version --- 44,52 ---- //[01] x : Transaction data #define CMSG_TRANSACTIONDATA 6 ! /*************************************** ! * Client Messages Client->Server ! ***************************************/ //Attempt a login. //[01] 2 : Major version </pre> </blockquote> <br> </body> </html> |