From f77daa3a70f98f764775bdc3cc627ece450bf5a8 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 21 Jun 2010 09:41:39 +0200 Subject: [PATCH] Changed: #853 Compilation on 64-bits platforms --- code/nel/tools/3d/object_viewer/particle_dlg.cpp | 4 ++-- .../tools/3d/object_viewer/particle_tree_ctrl.cpp | 2 +- code/nel/tools/3d/object_viewer/pick_sound.cpp | 2 +- code/nel/tools/3d/object_viewer/pick_sound.h | 4 ++-- .../nel/tools/3d/object_viewer/snapshot_tool_dlg.cpp | 2 +- code/nel/tools/3d/object_viewer/snapshot_tool_dlg.h | 2 +- code/nel/tools/3d/object_viewer/vegetable_dlg.cpp | 12 ++++++------ code/nel/tools/3d/zviewer/zviewer.cpp | 2 +- .../tools/misc/branch_patcher/branch_patcherDlg.cpp | 8 ++++---- code/nel/tools/misc/data_mirror/data_mirror.cpp | 4 ++-- code/nel/tools/misc/log_analyser/ViewDialog.cpp | 6 +++--- code/nel/tools/misc/log_analyser/ViewDialog.h | 2 +- code/nel/tools/misc/log_analyser/log_analyser.cpp | 8 +------- code/nel/tools/misc/log_analyser/log_analyserDlg.cpp | 10 +++++----- 14 files changed, 31 insertions(+), 37 deletions(-) diff --git a/code/nel/tools/3d/object_viewer/particle_dlg.cpp b/code/nel/tools/3d/object_viewer/particle_dlg.cpp index 8c5eca4bb..28eed1e38 100644 --- a/code/nel/tools/3d/object_viewer/particle_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/particle_dlg.cpp @@ -535,7 +535,7 @@ void CParticleDlg::OnCreateNewPsWorkspace() checkModifiedWorkSpace(); // ask name of the new workspace to create CCreateFileDlg cf(getStrRsc(IDS_CHOOSE_WORKSPACE_NAME), "", "pws"); - int result = cf.DoModal(); + INT_PTR result = cf.DoModal(); if (result = IDOK) { if (cf.touchFile()) @@ -566,7 +566,7 @@ void CParticleDlg::OnLoadPSWorkspace() checkModifiedWorkSpace(); static const char BASED_CODE szFilter[] = "particle workspaces(*.pws)|*.pws||"; CFileDialog fd( TRUE, ".pws", "*.pws", 0, szFilter); - int result = fd.DoModal(); + INT_PTR result = fd.DoModal(); if (result != IDOK) return; loadWorkspace((LPCTSTR) fd.GetPathName()); } diff --git a/code/nel/tools/3d/object_viewer/particle_tree_ctrl.cpp b/code/nel/tools/3d/object_viewer/particle_tree_ctrl.cpp index 74da89331..8eca57843 100644 --- a/code/nel/tools/3d/object_viewer/particle_tree_ctrl.cpp +++ b/code/nel/tools/3d/object_viewer/particle_tree_ctrl.cpp @@ -885,7 +885,7 @@ BOOL CParticleTreeCtrl::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHA nlassert(nt->Type = CNodeType::locatedBindable); nlassert(nt->Bind); CLBExternIDDlg dlg(nt->Bind->getExternID()); - int res = dlg.DoModal(); + INT_PTR res = dlg.DoModal(); if ( res == IDOK ) { nt->Bind->setExternID( dlg.getNewID() ); diff --git a/code/nel/tools/3d/object_viewer/pick_sound.cpp b/code/nel/tools/3d/object_viewer/pick_sound.cpp index 03353684c..e9b56a5b7 100644 --- a/code/nel/tools/3d/object_viewer/pick_sound.cpp +++ b/code/nel/tools/3d/object_viewer/pick_sound.cpp @@ -127,7 +127,7 @@ void CPickSound::OnPlaySound() } //======================================================================================== -void CPickSound::OnTimer(UINT nIDEvent) +void CPickSound::OnTimer(UINT_PTR nIDEvent) { CSoundSystem::poll(); diff --git a/code/nel/tools/3d/object_viewer/pick_sound.h b/code/nel/tools/3d/object_viewer/pick_sound.h index d5f688273..c0215d52f 100644 --- a/code/nel/tools/3d/object_viewer/pick_sound.h +++ b/code/nel/tools/3d/object_viewer/pick_sound.h @@ -65,7 +65,7 @@ protected: TNameVect _Names; NLMISC::TStringId _CurrName; - UINT _Timer; + UINT_PTR _Timer; NLMISC::CVector _BackupVel; float _BackupGain; @@ -76,7 +76,7 @@ protected: virtual BOOL OnInitDialog(); afx_msg void OnSelchange(); afx_msg void OnPlaySound(); - afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg void OnDestroy(); afx_msg void OnDblclkList(); afx_msg void OnClose(); diff --git a/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.cpp b/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.cpp index 7daf47f2a..7e4a569f4 100644 --- a/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.cpp @@ -559,7 +559,7 @@ std::string CSnapshotToolDlg::viewToString(uint view) } //**************************************************************************************** -void CSnapshotToolDlg::OnTimer(UINT nIDEvent) +void CSnapshotToolDlg::OnTimer(UINT_PTR nIDEvent) { if (_FilteredFiles.empty()) return; if (nIDEvent == 1) diff --git a/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.h b/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.h index e7839a768..43296ae55 100644 --- a/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.h +++ b/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.h @@ -101,7 +101,7 @@ protected: afx_msg void OnSelchangeOutputpathOption(); afx_msg void OnSelchangeFormat(); afx_msg void OnCloseButton(); - afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg void OnStopSnapshots(); afx_msg void OnViewFront(); afx_msg void OnViewLeft(); diff --git a/code/nel/tools/3d/object_viewer/vegetable_dlg.cpp b/code/nel/tools/3d/object_viewer/vegetable_dlg.cpp index e9c60e115..e66d30f12 100644 --- a/code/nel/tools/3d/object_viewer/vegetable_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/vegetable_dlg.cpp @@ -166,7 +166,7 @@ void CVegetableDlg::setVegetableToEdit(NL3D::CVegetable *vegetable) // *************************************************************************** uint CVegetableDlg::getNumVegetables() const { - return _Vegetables.size(); + return (uint)_Vegetables.size(); } // *************************************************************************** std::string CVegetableDlg::getVegetableName(uint id) const @@ -286,7 +286,7 @@ void CVegetableDlg::CVegetableDesc::updateVegetableName() } else { - sint pos= Vegetable->ShapeName.find(".veget"); + std::string::size_type pos= Vegetable->ShapeName.find(".veget"); VegetableName= Vegetable->ShapeName.substr(0, pos); // And (to be clearer) append distance of creation. char str[256]; @@ -380,7 +380,7 @@ void CVegetableDlg::buildVegetableSet(NL3D::CTileVegetableDesc &vegetSet, bool vegetables.push_back(*_Vegetables[i].Vegetable); // get dst index. - uint dstId= vegetables.size()-1; + uint dstId= (uint)vegetables.size()-1; // transform degrees in radians. vegetables[dstId].Rx.Abs*= degToRad; vegetables[dstId].Rx.Rand*= degToRad; @@ -422,7 +422,7 @@ void CVegetableDlg::appendVegetableSet(NL3D::CTileVegetableDesc &vegetSet) // Add a new vegetable to the list. _Vegetables.push_back( CVegetableDesc ()); - uint id= _Vegetables.size()-1; + uint id= (uint)_Vegetables.size()-1; _Vegetables[id].initVegetable(veget); // update view @@ -512,7 +512,7 @@ void CVegetableDlg::OnButtonVegetableAdd() { // Add a new vegetable to the list. _Vegetables.push_back(CVegetableDesc ()); - uint id= _Vegetables.size()-1; + uint id= (uint)_Vegetables.size()-1; _Vegetables[id].initDefaultVegetable(); // update view @@ -607,7 +607,7 @@ void CVegetableDlg::OnButtonVegetableLoadDesc() f.serial(veget); // Add a new vegetable to the list. _Vegetables.push_back(CVegetableDesc ()); - uint id= _Vegetables.size()-1; + uint id= (uint)_Vegetables.size()-1; _Vegetables[id].initVegetable(veget); // update view diff --git a/code/nel/tools/3d/zviewer/zviewer.cpp b/code/nel/tools/3d/zviewer/zviewer.cpp index a89123af0..1250aac38 100644 --- a/code/nel/tools/3d/zviewer/zviewer.cpp +++ b/code/nel/tools/3d/zviewer/zviewer.cpp @@ -376,7 +376,7 @@ void displayZones() if (ViewerCfg.AllPathRelative) Landscape->Landscape.TileBank.makeAllPathRelative(); - sint idx = (sint)ViewerCfg.Bank.find("."); + string::size_type idx = ViewerCfg.Bank.find("."); string farBank = ViewerCfg.Bank.substr(0,idx); farBank += ".farbank"; diff --git a/code/nel/tools/misc/branch_patcher/branch_patcherDlg.cpp b/code/nel/tools/misc/branch_patcher/branch_patcherDlg.cpp index aadb71491..7a7a1de50 100644 --- a/code/nel/tools/misc/branch_patcher/branch_patcherDlg.cpp +++ b/code/nel/tools/misc/branch_patcher/branch_patcherDlg.cpp @@ -342,7 +342,7 @@ void CBranch_patcherDlg::OnButtonPatch() } -static DWORD CALLBACK MyStreamInCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) +static unsigned long CALLBACK MyStreamInCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) { CFile* pFile = (CFile*) dwCookie; *pcb = pFile->Read(pbBuff, cb); @@ -350,7 +350,7 @@ static DWORD CALLBACK MyStreamInCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, } -static DWORD CALLBACK MyStreamOutCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) +static unsigned long CALLBACK MyStreamOutCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) { CFile* pFile = (CFile*) dwCookie; pFile->Write(pbBuff, cb); @@ -363,7 +363,7 @@ void CBranch_patcherDlg::displayFile( const CString& filename ) { CFile cFile( filename, CFile::modeRead ); EDITSTREAM es; - es.dwCookie = (DWORD) &cFile; + es.dwCookie = (DWORD_PTR) &cFile; es.pfnCallback = MyStreamInCallback; m_Display->StreamIn( SF_TEXT, es ); } @@ -373,7 +373,7 @@ void CBranch_patcherDlg::saveFile( const CString& filename ) { CFile cFile( filename, CFile::modeCreate | CFile::modeWrite ); EDITSTREAM es; - es.dwCookie = (DWORD) &cFile; + es.dwCookie = (DWORD_PTR) &cFile; es.pfnCallback = MyStreamOutCallback; m_Display->StreamOut( SF_TEXT, es ); } diff --git a/code/nel/tools/misc/data_mirror/data_mirror.cpp b/code/nel/tools/misc/data_mirror/data_mirror.cpp index 9659ea3ab..dc3d2b7e6 100644 --- a/code/nel/tools/misc/data_mirror/data_mirror.cpp +++ b/code/nel/tools/misc/data_mirror/data_mirror.cpp @@ -62,7 +62,7 @@ BOOL CData_mirrorApp::InitInstance() { if (exePath[0] == '\"') { - uint end=exePath.find ('\"', 1); + string::size_type end=exePath.find ('\"', 1); if (end != string::npos) { exePath = exePath.substr (1, end-1); @@ -74,7 +74,7 @@ BOOL CData_mirrorApp::InitInstance() } else { - uint end=exePath.find (' ', 1); + string::size_type end=exePath.find (' ', 1); exePath = exePath.substr (0, end); } } diff --git a/code/nel/tools/misc/log_analyser/ViewDialog.cpp b/code/nel/tools/misc/log_analyser/ViewDialog.cpp index 8c083f84b..489556f03 100644 --- a/code/nel/tools/misc/log_analyser/ViewDialog.cpp +++ b/code/nel/tools/misc/log_analyser/ViewDialog.cpp @@ -781,7 +781,7 @@ void CViewDialog::resizeView( int nbViews, int top, int left ) */ int CViewDialog::getNbLines() const { - return Buffer.size(); + return (int)Buffer.size(); } @@ -812,7 +812,7 @@ void CViewDialog::fillGaps( int maxNbLines ) */ void CViewDialog::commitAddedLines() { - m_ListCtrl.SetItemCount( Buffer.size() ); + m_ListCtrl.SetItemCount( (int)Buffer.size() ); m_ListCtrl.SetColumnWidth( 0, LVSCW_AUTOSIZE ); } @@ -1124,7 +1124,7 @@ bool matchString( const CString& str, const CString& substr, bool matchCase, int /* * */ -afx_msg LONG CViewDialog::OnFindReplace(WPARAM wParam, LPARAM lParam) +afx_msg LRESULT CViewDialog::OnFindReplace(WPARAM wParam, LPARAM lParam) { // Test 'Cancel' if ( FindDialog->IsTerminating() ) diff --git a/code/nel/tools/misc/log_analyser/ViewDialog.h b/code/nel/tools/misc/log_analyser/ViewDialog.h index 8b8e99b06..10069539d 100644 --- a/code/nel/tools/misc/log_analyser/ViewDialog.h +++ b/code/nel/tools/misc/log_analyser/ViewDialog.h @@ -175,7 +175,7 @@ public: // Implementation protected: - afx_msg LONG OnFindReplace(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnFindReplace(WPARAM wParam, LPARAM lParam); // Generated message map functions //{{AFX_MSG(CViewDialog) diff --git a/code/nel/tools/misc/log_analyser/log_analyser.cpp b/code/nel/tools/misc/log_analyser/log_analyser.cpp index 21f3069b8..1ed0774df 100644 --- a/code/nel/tools/misc/log_analyser/log_analyser.cpp +++ b/code/nel/tools/misc/log_analyser/log_analyser.cpp @@ -46,15 +46,9 @@ BOOL CLog_analyserApp::InitInstance() // 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 - CLog_analyserDlg dlg; m_pMainWnd = &dlg; - int nResponse = dlg.DoModal(); + INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is diff --git a/code/nel/tools/misc/log_analyser/log_analyserDlg.cpp b/code/nel/tools/misc/log_analyser/log_analyserDlg.cpp index d99f32dd3..8103090c8 100644 --- a/code/nel/tools/misc/log_analyser/log_analyserDlg.cpp +++ b/code/nel/tools/misc/log_analyser/log_analyserDlg.cpp @@ -403,7 +403,7 @@ void CLog_analyserDlg::addView( std::vector& pathNames ) { // Ensure that a log file without number comes *after* the ones with a number string name = string(pathNames[i]); - unsigned int dotpos = name.find_last_of('.'); + string::size_type dotpos = name.find_last_of('.'); if ( (dotpos!=string::npos) && (dotpos > 2) ) { if ( ! (isNumberChar(name[dotpos-1]) && isNumberChar(name[dotpos-2]) && isNumberChar(name[dotpos-3])) ) @@ -418,7 +418,7 @@ void CLog_analyserDlg::addView( std::vector& pathNames ) { // Set the original names back string name = pathNames[i]; - unsigned int tokenpos = name.find( "ZZZ." ); + string::size_type tokenpos = name.find( "ZZZ." ); if ( tokenpos != string::npos ) { name = name.substr( 0, tokenpos ) + name.substr( tokenpos + 3 ); @@ -487,7 +487,7 @@ CViewDialog *CLog_analyserDlg::onAddCommon( const vector& filenames ) // Create view CViewDialog *view = new CViewDialog(); view->Create( IDD_View, this ); - view->Index = Views.size(); + view->Index = (int)Views.size(); RECT editRect; m_Edit.GetWindowRect( &editRect ); ScreenToClient( &editRect ); @@ -498,7 +498,7 @@ CViewDialog *CLog_analyserDlg::onAddCommon( const vector& filenames ) for ( i=0; i!=(int)Views.size(); ++i ) { Views[i]->WidthR = 1.0f/(float)Views.size(); - Views[i]->resizeView( Views.size(), editRect.bottom+10, w ); + Views[i]->resizeView( (int)Views.size(), editRect.bottom+10, w ); w += (int)(Views[i]->WidthR*(parentRect.right-32)); } view->ShowWindow( SW_SHOW ); @@ -901,7 +901,7 @@ void CLog_analyserDlg::resizeViews() int i, w = 0; for ( i=0; i!=(int)Views.size(); ++i ) { - Views[i]->resizeView( Views.size(), editRect.bottom+10, w ); + Views[i]->resizeView( (int)Views.size(), editRect.bottom+10, w ); w += (int)(Views[i]->WidthR*(parentRect.right-32)); } }