From 66b3f4b8d9f1b606eb4a6e893db9f293cbeb95a3 Mon Sep 17 00:00:00 2001 From: Leo Date: Tue, 6 Jul 2010 03:44:13 +0000 Subject: Fixes for VC8. git-svn-id: http://svn.leocad.org/branches/leocad-0.75@953 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- win/Clrpick.cpp | 2 +- win/Clrpopup.cpp | 2 +- win/Colorlst.cpp | 2 +- win/Figdlg.cpp | 6 +++--- win/Flatbar.cpp | 2 +- win/Libdlg.cpp | 3 ++- win/Piecebar.cpp | 2 +- win/Piecebar.h | 2 +- win/Print.cpp | 4 ++-- win/Tools.cpp | 2 +- win/arraydlg.cpp | 8 ++++---- win/disabtab.cpp | 2 +- win/prevview.cpp | 1 + win/rmodel.h | 2 +- win/terrctrl.cpp | 24 ++++++++++++------------ 15 files changed, 33 insertions(+), 31 deletions(-) (limited to 'win') diff --git a/win/Clrpick.cpp b/win/Clrpick.cpp index 1d920fa..e9103c4 100644 --- a/win/Clrpick.cpp +++ b/win/Clrpick.cpp @@ -147,7 +147,7 @@ void CColorPicker::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) if (y == rect.top) y += x%4; pDC->SetPixel (x,y,RGB(255,255,255)); } - for (y = rect.bottom; y > rect.top; y-=4) + for (int y = rect.bottom; y > rect.top; y-=4) { if (y == rect.bottom) y-= x%4; pDC->SetPixel (x,y,RGB(255,255,255)); diff --git a/win/Clrpopup.cpp b/win/Clrpopup.cpp index aa3daa9..2c3b563 100644 --- a/win/Clrpopup.cpp +++ b/win/Clrpopup.cpp @@ -788,7 +788,7 @@ void CColorPopup::DrawCell(CDC* pDC, int nIndex) if (y == rect.top) y += x%4; pDC->SetPixel (x,y,RGB(255,255,255)); } - for (y = rect.bottom; y > rect.top; y-=4) + for (int y = rect.bottom; y > rect.top; y-=4) { if (y == rect.bottom) y-= x%4; pDC->SetPixel (x,y,RGB(255,255,255)); diff --git a/win/Colorlst.cpp b/win/Colorlst.cpp index 06eb038..e2ede84 100644 --- a/win/Colorlst.cpp +++ b/win/Colorlst.cpp @@ -67,7 +67,7 @@ void CColorsList::DrawItem(LPDRAWITEMSTRUCT lpDIS) if (y == lpDIS->rcItem.top) y += x%4; SetPixelV (lpDIS->hDC, x,y,RGB(255,255,255)); } - for (y = lpDIS->rcItem.bottom; y > lpDIS->rcItem.top; y-=4) + for (int y = lpDIS->rcItem.bottom; y > lpDIS->rcItem.top; y-=4) { if (y == lpDIS->rcItem.bottom) y-= x%4; SetPixelV (lpDIS->hDC, x,y,RGB(255,255,255)); diff --git a/win/Figdlg.cpp b/win/Figdlg.cpp index 3b78e52..6a41613 100644 --- a/win/Figdlg.cpp +++ b/win/Figdlg.cpp @@ -102,7 +102,7 @@ LRESULT CALLBACK GLWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara for (int i = 0; i < LC_MFW_NUMITEMS; i++) ((CColorPicker*)GetDlgItem (IDC_MF_HATCOLOR+i))->SetColorIndex (m_pMinifig->m_Colors[i]); - for (i = 0; i < LC_MFW_NUMITEMS; i++) + for (int i = 0; i < LC_MFW_NUMITEMS; i++) { CComboBox* pCombo = (CComboBox*)GetDlgItem(i+IDC_MF_HAT); char **names; @@ -118,13 +118,13 @@ LRESULT CALLBACK GLWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara char *names[LC_MFW_NUMITEMS]; m_pMinifig->GetSelections (names); - for (i = 0; i < LC_MFW_NUMITEMS; i++) + for (int i = 0; i < LC_MFW_NUMITEMS; i++) { CComboBox* pCombo = (CComboBox*)GetDlgItem(i+IDC_MF_HAT); pCombo->SetCurSel (pCombo->FindString (-1, names[i])); } - for (i = IDC_MF_HATSPIN; i <= IDC_MF_SHOERSPIN; i++) + for (int i = IDC_MF_HATSPIN; i <= IDC_MF_SHOERSPIN; i++) ((CSpinButtonCtrl*)GetDlgItem(i))->SetRange(-360, 360); return TRUE; // return TRUE unless you set the focus to a control diff --git a/win/Flatbar.cpp b/win/Flatbar.cpp index 4f6de8e..48a5513 100644 --- a/win/Flatbar.cpp +++ b/win/Flatbar.cpp @@ -488,7 +488,7 @@ CSize CFlatToolBar::CalcLayout(DWORD dwMode, int nLength) if ((m_dwStyle & CBRS_FLOATING) && (m_dwStyle & CBRS_SIZE_DYNAMIC)) m_nMRUWidth = sizeResult.cx; - for (i = 0; i < nCount; i++) + for (int i = 0; i < nCount; i++) SetButton(i, &pData[i]); // **PD** renamed from _SetButton if (nControlCount > 0) diff --git a/win/Libdlg.cpp b/win/Libdlg.cpp index 7fb05b3..17a0964 100644 --- a/win/Libdlg.cpp +++ b/win/Libdlg.cpp @@ -382,8 +382,9 @@ void CLibraryDlg::UpdateList() for (int i = 0; i < Lib->GetPieceCount(); i++) { PieceInfo* Info = Lib->GetPieceInfo(i); + int j; - for (int j = 0; j < Lib->GetNumCategories(); j++) + for (j = 0; j < Lib->GetNumCategories(); j++) { if (Lib->PieceInCategory(Info, Lib->GetCategoryKeywords(j))) break; diff --git a/win/Piecebar.cpp b/win/Piecebar.cpp index b72b5c5..6c949cd 100644 --- a/win/Piecebar.cpp +++ b/win/Piecebar.cpp @@ -434,7 +434,7 @@ void CPiecesBar::OnPaint() CPaintDC dc(this); } -UINT CPiecesBar::OnNcHitTest(CPoint point) +LRESULT CPiecesBar::OnNcHitTest(CPoint point) { if (IsFloating()) return CControlBar::OnNcHitTest(point); diff --git a/win/Piecebar.h b/win/Piecebar.h index 609419f..683d7eb 100644 --- a/win/Piecebar.h +++ b/win/Piecebar.h @@ -111,7 +111,7 @@ protected: afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); afx_msg void OnRButtonDown(UINT nFlags, CPoint point); afx_msg void OnCaptureChanged(CWnd *pWnd); - afx_msg UINT OnNcHitTest(CPoint point); + afx_msg LRESULT OnNcHitTest(CPoint point); afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); diff --git a/win/Print.cpp b/win/Print.cpp index 6f693f8..496f891 100644 --- a/win/Print.cpp +++ b/win/Print.cpp @@ -204,7 +204,7 @@ static void PrintCatalogThread (CWnd* pParent, CFrameWnd* pMainFrame) start.next = NULL; - for (j = 0; j < pLib->GetPieceCount (); j++) + for (int j = 0; j < pLib->GetPieceCount (); j++) { char* desc = pLib->GetPieceInfo(j)->m_strDescription; @@ -231,7 +231,7 @@ static void PrintCatalogThread (CWnd* pParent, CFrameWnd* pMainFrame) if (PD->PrintRange()) { - for (j = 0; j < (int)(nStartPage - 1)*rows*cols; j++) + for (int j = 0; j < (int)(nStartPage - 1)*rows*cols; j++) if (node) node = node->next; } diff --git a/win/Tools.cpp b/win/Tools.cpp index cdf49a4..bff5672 100644 --- a/win/Tools.cpp +++ b/win/Tools.cpp @@ -559,7 +559,7 @@ void Export3DStudio() } info += *info + 1; - for (k = 0; k < *info; k += 3) + for (UINT k = 0; k < *info; k += 3) { mobj->matarray[i].faceindex[facecount] = curface; facecount++; diff --git a/win/arraydlg.cpp b/win/arraydlg.cpp index f033510..3d16bb5 100644 --- a/win/arraydlg.cpp +++ b/win/arraydlg.cpp @@ -93,7 +93,7 @@ BOOL CArrayDlg::OnInitDialog() for (int i = 0; i < 3; i++) ((CSpinButtonCtrl*)GetDlgItem(IDs[i]))->SetRange(1, 1000); - for (i = 3; i < 15; i++) + for (int i = 3; i < 15; i++) ((CSpinButtonCtrl*)GetDlgItem(IDs[i]))->SetRange(-1000, 1000); m_bInitDone = TRUE; @@ -109,11 +109,11 @@ void CArrayDlg::OnArrayDimension() UpdateData(); for (UINT u = IDC_ARRAY_2D_COUNT; u <= IDC_ARRAY_2D_Z; u++) GetDlgItem(u)->EnableWindow(m_nArrayDimension > 0); - for (u = IDC_ARRAY_2D_X_SPIN; u <= IDC_ARRAY_2D_Z_SPIN; u++) + for (UINT u = IDC_ARRAY_2D_X_SPIN; u <= IDC_ARRAY_2D_Z_SPIN; u++) GetDlgItem(u)->EnableWindow(m_nArrayDimension > 0); - for (u = IDC_ARRAY_3D_COUNT; u <= IDC_ARRAY_3D_Z; u++) + for (UINT u = IDC_ARRAY_3D_COUNT; u <= IDC_ARRAY_3D_Z; u++) GetDlgItem(u)->EnableWindow(m_nArrayDimension > 1); - for (u = IDC_ARRAY_3D_X_SPIN; u <= IDC_ARRAY_3D_Z_SPIN; u++) + for (UINT u = IDC_ARRAY_3D_X_SPIN; u <= IDC_ARRAY_3D_Z_SPIN; u++) GetDlgItem(u)->EnableWindow(m_nArrayDimension > 1); OnChangeArrayCount(); } diff --git a/win/disabtab.cpp b/win/disabtab.cpp index 930a686..69e5a74 100644 --- a/win/disabtab.cpp +++ b/win/disabtab.cpp @@ -32,7 +32,7 @@ CTabCtrlWithDisable::~CTabCtrlWithDisable() } // Subclass the tab control: also make ownder-draw -CTabCtrlWithDisable::SubclassDlgItem(UINT nID, CWnd* pParent) +BOOL CTabCtrlWithDisable::SubclassDlgItem(UINT nID, CWnd* pParent) { if (!CTabCtrl::SubclassDlgItem(nID, pParent)) return FALSE; diff --git a/win/prevview.cpp b/win/prevview.cpp index 798c132..9d45137 100644 --- a/win/prevview.cpp +++ b/win/prevview.cpp @@ -11,6 +11,7 @@ #if _MFC_VER < 0x0710 #include <../src/afximpl.h> #else +#include #include <../src/mfc/afximpl.h> #endif diff --git a/win/rmodel.h b/win/rmodel.h index 5a110cc..c81dcbe 100644 --- a/win/rmodel.h +++ b/win/rmodel.h @@ -86,7 +86,7 @@ protected: int build_hierarchy(); - friend RAPID_Collide(double R1[3][3], double T1[3], double s1, CRModel *RAPID_model1, + friend int RAPID_Collide(double R1[3][3], double T1[3], double s1, CRModel *RAPID_model1, double R2[3][3], double T2[3], double s2, CRModel *RAPID_model2, int flag); }; diff --git a/win/terrctrl.cpp b/win/terrctrl.cpp index 853138f..9fcb8a3 100644 --- a/win/terrctrl.cpp +++ b/win/terrctrl.cpp @@ -510,8 +510,8 @@ void CTerrainCtrl::OnDraw(CDC* pDC) maxVisibleCol = VisCellRange.GetMaxCol(); */ // calc bottom - int bottom = GetFixedRowHeight(); - for (int i = idTopLeft.row; i < m_nRows; i++) + int i, bottom = GetFixedRowHeight(); + for (i = idTopLeft.row; i < m_nRows; i++) { bottom += GetRowHeight(i); if (bottom >= clientRect.bottom) @@ -1292,8 +1292,8 @@ CELLID CTerrainCtrl::GetCellFromPt(CPoint point, BOOL bAllowFixedCellCheck) cellID.col = -1; else if (point.x < fixedColWidth) // in fixed col { - int xpos = 0; - for (int col = 0; col < m_nFixedCols; col++) + int col, xpos = 0; + for (col = 0; col < m_nFixedCols; col++) { xpos += GetColumnWidth(col); if (xpos > point.x) break; @@ -1302,8 +1302,8 @@ CELLID CTerrainCtrl::GetCellFromPt(CPoint point, BOOL bAllowFixedCellCheck) } else // in non-fixed col { - int xpos = fixedColWidth; - for (int col = idTopLeft.col; col < m_nCols; col++) + int col, xpos = fixedColWidth; + for (col = idTopLeft.col; col < m_nCols; col++) { xpos += GetColumnWidth(col); if (xpos > point.x) break; @@ -1321,8 +1321,8 @@ CELLID CTerrainCtrl::GetCellFromPt(CPoint point, BOOL bAllowFixedCellCheck) cellID.row = -1; else if (point.y < fixedRowHeight) // in fixed col { - int ypos = 0; - for (int row = 0; row < m_nFixedRows; row++) + int row, ypos = 0; + for (row = 0; row < m_nFixedRows; row++) { ypos += GetRowHeight(row); if (ypos > point.y) break; @@ -1331,8 +1331,8 @@ CELLID CTerrainCtrl::GetCellFromPt(CPoint point, BOOL bAllowFixedCellCheck) } else { - int ypos = fixedRowHeight; - for (int row = idTopLeft.row; row < GetRowCount(); row++) + int row, ypos = fixedRowHeight; + for (row = idTopLeft.row; row < GetRowCount(); row++) { ypos += GetRowHeight(row); if (ypos > point.y) break; @@ -1791,8 +1791,8 @@ void CTerrainCtrl::EnsureVisible(int nRow, int nCol) CELLID idTopLeft = GetTopleftNonFixedCell(); // calc bottom - int bottom = GetFixedRowHeight(); - for (int i = idTopLeft.row; i < m_nRows; i++) + int i, bottom = GetFixedRowHeight(); + for (i = idTopLeft.row; i < m_nRows; i++) { bottom += GetRowHeight(i); if (bottom >= rect.bottom) -- cgit v1.2.3