diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index fa729d693f..9d78f6b9e5 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -1481,11 +1481,11 @@ void wxPageSetupDialogData::ConvertFromNative() OSStatus err = PMGetAdjustedPaperRect((PMPageFormat)m_printData.m_macPageFormat, &rPaper); if ( err == noErr ) { - m_paperSize.x = ((double) rPaper.right - rPaper.left ) * pt2mm; - m_paperSize.y = ((double) rPaper.bottom - rPaper.top ) * pt2mm; + m_paperSize.x = int(( rPaper.right - rPaper.left ) * pt2mm); + m_paperSize.y = int(( rPaper.bottom - rPaper.top ) * pt2mm); - m_minMarginTopLeft.x = ((double) - rPaper.left ) * pt2mm; - m_minMarginTopLeft.y = ((double) - rPaper.top ) * pt2mm; + m_minMarginTopLeft.x = int( ( - rPaper.left ) * pt2mm ); + m_minMarginTopLeft.y = int( ( - rPaper.top ) * pt2mm ); // m_minMarginBottomRight.x = ((double) rPaper.right - (**(THPrint)m_printData.m_macPrintSettings).prInfo.rPage.right ) * pt2mm; // m_minMarginBottomRight.y = ((double)(**(THPrint)m_printData.m_macPrintSettings).rPaper.bottom - (**(THPrint)m_printData.m_macPrintSettings).prInfo.rPage.bottom ) * pt2mm; diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index 0115fce66c..a7c9e246b0 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -337,7 +337,8 @@ wxProgressDialog::Update(int value, const wxString& newmsg) if ( (m_elapsed || m_remaining || m_estimated) && (value != 0) ) { unsigned long elapsed = wxGetCurrentTime() - m_timeStart; - unsigned long estimated = ( (double) elapsed * m_maximum ) / ((double)value) ; + unsigned long estimated = (unsigned long)( ( (double) elapsed * m_maximum ) + / ((double)value) ) ; unsigned long remaining = estimated - elapsed; SetTimeLabel(elapsed, m_elapsed); diff --git a/src/mac/carbon/choice.cpp b/src/mac/carbon/choice.cpp index e2ce6fe4cf..630cb59b8b 100644 --- a/src/mac/carbon/choice.cpp +++ b/src/mac/carbon/choice.cpp @@ -244,7 +244,6 @@ wxSize wxChoice::DoGetBestSize() const #endif { wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetRootWindow() ) ) ; - Rect drawRect ; wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ; @@ -272,7 +271,6 @@ wxSize wxChoice::DoGetBestSize() const lbWidth += 2 * lbHeight ; // And just a bit more - int cy = 12 ; int cx = ::TextWidth( "X" , 0 , 1 ) ; lbWidth += cx ; diff --git a/src/mac/carbon/dc.cpp b/src/mac/carbon/dc.cpp index fa13147e03..b98c6ef4df 100644 --- a/src/mac/carbon/dc.cpp +++ b/src/mac/carbon/dc.cpp @@ -82,7 +82,6 @@ wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win ) SetClip( m_newClip ) ; DisposeRgn( insidergn ) ; #endif - RgnHandle insidergn = NewRgn() ; int x = 0 , y = 0; win->MacWindowToRootWindow( &x,&y ) ; CopyRgn( (RgnHandle) ((wxWindow*)win)->MacGetVisibleRegion().GetWXHRGN() , m_newClip ) ; @@ -1305,8 +1304,8 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y, status = ::ATSUMeasureText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd, &textBefore , &textAfter, &ascent , &descent ); - drawX += sin(angle/RAD2DEG) * FixedToInt(ascent) ; - drawY += cos(angle/RAD2DEG) * FixedToInt(ascent) ; + drawX += (int)( sin(angle/RAD2DEG) * FixedToInt(ascent) ) ; + drawY += (int)( cos(angle/RAD2DEG) * FixedToInt(ascent) ) ; status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd, IntToFixed(drawX) , IntToFixed(drawY) ); wxASSERT_MSG( status == noErr , "couldn't draw the rotated text" ); @@ -1735,7 +1734,7 @@ void wxDC::MacInstallFont() const } ; Boolean kTrue = true ; Boolean kFalse = false ; - BslnBaselineClass kBaselineDefault = kBSLNHangingBaseline ; +// BslnBaselineClass kBaselineDefault = kBSLNHangingBaseline ; ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal; ATSUAttributeValuePtr atsuValues[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] = { diff --git a/src/mac/carbon/dcprint.cpp b/src/mac/carbon/dcprint.cpp index fef7ded4f5..8d809ced36 100644 --- a/src/mac/carbon/dcprint.cpp +++ b/src/mac/carbon/dcprint.cpp @@ -171,7 +171,7 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata) wxPrinterDC::~wxPrinterDC(void) { - OSStatus err ; +// OSStatus err ; wxString message ; #if !TARGET_CARBON if ( m_ok ) @@ -258,7 +258,7 @@ bool wxPrinterDC::StartDoc( const wxString& WXUNUSED(message) ) if ( err != noErr || m_macPrintSessionPort == kPMNoReference ) #endif { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; dialog.ShowModal(); #if TARGET_CARBON && PM_USE_SESSION_APIS @@ -280,7 +280,7 @@ bool wxPrinterDC::StartDoc( const wxString& WXUNUSED(message) ) err = PMGetAdjustedPaperRect((PMPageFormat)m_printData.m_macPageFormat, &rPaper); if ( err != noErr ) { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; dialog.ShowModal(); #if TARGET_CARBON && PM_USE_SESSION_APIS @@ -291,8 +291,8 @@ bool wxPrinterDC::StartDoc( const wxString& WXUNUSED(message) ) m_ok = FALSE; return m_ok; } - m_maxX = rPaper.right - rPaper.left ; - m_maxY = rPaper.bottom - rPaper.top ; + m_maxX = (wxCoord)(rPaper.right - rPaper.left) ; + m_maxY = (wxCoord)(rPaper.bottom - rPaper.top) ; #else m_maxX = (**(THPrint)m_printData.m_macPrintSettings).rPaper.right - (**(THPrint)m_printData.m_macPrintSettings).rPaper.left ; m_maxY = (**(THPrint)m_printData.m_macPrintSettings).rPaper.bottom - (**(THPrint)m_printData.m_macPrintSettings).rPaper.top ; @@ -321,7 +321,7 @@ void wxPrinterDC::EndDoc(void) #endif if ( err != noErr ) { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; dialog.ShowModal(); } @@ -402,8 +402,8 @@ void wxPrinterDC::StartPage(void) err = PMGetAdjustedPaperRect((PMPageFormat)m_printData.m_macPageFormat, &rPaper); if ( !err ) { - m_macLocalOrigin.x = rPaper.left ; - m_macLocalOrigin.y = rPaper.top ; + m_macLocalOrigin.x = (int) (rPaper.left) ; + m_macLocalOrigin.y = (int) (rPaper.top) ; } #endif } diff --git a/src/mac/carbon/dnd.cpp b/src/mac/carbon/dnd.cpp index 7e80e83525..598284893d 100644 --- a/src/mac/carbon/dnd.cpp +++ b/src/mac/carbon/dnd.cpp @@ -527,6 +527,8 @@ pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, Wind cursor.MacInstall() ; } break ; + default : + break ; } } } diff --git a/src/mac/carbon/gsocket.c b/src/mac/carbon/gsocket.c index 50086739cf..f3985aee92 100644 --- a/src/mac/carbon/gsocket.c +++ b/src/mac/carbon/gsocket.c @@ -36,7 +36,7 @@ #include #include #endif -#if TARGET_CARBON +#if TARGET_CARBON && !defined(OTAssert) #define OTAssert( str , cond ) /* does not exists in Carbon */ #endif diff --git a/src/mac/carbon/notebmac.cpp b/src/mac/carbon/notebmac.cpp index 2f8f53b786..4f590e8b6c 100644 --- a/src/mac/carbon/notebmac.cpp +++ b/src/mac/carbon/notebmac.cpp @@ -383,7 +383,7 @@ void wxNotebook::MacSetupTabs() ControlButtonContentInfo info ; wxMacCreateBitmapButton( &info , *GetImageList()->GetBitmap( GetPageImage(ii ) ) , kControlContentPictHandle) ; IconFamilyHandle iconFamily = (IconFamilyHandle) NewHandle(0) ; - OSErr err = SetIconFamilyData( iconFamily, 'PICT' , (Handle) info.u.picture ) ; + err = SetIconFamilyData( iconFamily, 'PICT' , (Handle) info.u.picture ) ; wxASSERT_MSG( err == noErr , "Error when adding bitmap" ) ; IconRef iconRef ; err = RegisterIconRefFromIconFamily( 'WXNG' , (OSType) 1 , iconFamily, &iconRef ) ; diff --git a/src/mac/choice.cpp b/src/mac/choice.cpp index e2ce6fe4cf..630cb59b8b 100644 --- a/src/mac/choice.cpp +++ b/src/mac/choice.cpp @@ -244,7 +244,6 @@ wxSize wxChoice::DoGetBestSize() const #endif { wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetRootWindow() ) ) ; - Rect drawRect ; wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ; @@ -272,7 +271,6 @@ wxSize wxChoice::DoGetBestSize() const lbWidth += 2 * lbHeight ; // And just a bit more - int cy = 12 ; int cx = ::TextWidth( "X" , 0 , 1 ) ; lbWidth += cx ; diff --git a/src/mac/dc.cpp b/src/mac/dc.cpp index fa13147e03..b98c6ef4df 100644 --- a/src/mac/dc.cpp +++ b/src/mac/dc.cpp @@ -82,7 +82,6 @@ wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win ) SetClip( m_newClip ) ; DisposeRgn( insidergn ) ; #endif - RgnHandle insidergn = NewRgn() ; int x = 0 , y = 0; win->MacWindowToRootWindow( &x,&y ) ; CopyRgn( (RgnHandle) ((wxWindow*)win)->MacGetVisibleRegion().GetWXHRGN() , m_newClip ) ; @@ -1305,8 +1304,8 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y, status = ::ATSUMeasureText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd, &textBefore , &textAfter, &ascent , &descent ); - drawX += sin(angle/RAD2DEG) * FixedToInt(ascent) ; - drawY += cos(angle/RAD2DEG) * FixedToInt(ascent) ; + drawX += (int)( sin(angle/RAD2DEG) * FixedToInt(ascent) ) ; + drawY += (int)( cos(angle/RAD2DEG) * FixedToInt(ascent) ) ; status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd, IntToFixed(drawX) , IntToFixed(drawY) ); wxASSERT_MSG( status == noErr , "couldn't draw the rotated text" ); @@ -1735,7 +1734,7 @@ void wxDC::MacInstallFont() const } ; Boolean kTrue = true ; Boolean kFalse = false ; - BslnBaselineClass kBaselineDefault = kBSLNHangingBaseline ; +// BslnBaselineClass kBaselineDefault = kBSLNHangingBaseline ; ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal; ATSUAttributeValuePtr atsuValues[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] = { diff --git a/src/mac/dcprint.cpp b/src/mac/dcprint.cpp index fef7ded4f5..8d809ced36 100644 --- a/src/mac/dcprint.cpp +++ b/src/mac/dcprint.cpp @@ -171,7 +171,7 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata) wxPrinterDC::~wxPrinterDC(void) { - OSStatus err ; +// OSStatus err ; wxString message ; #if !TARGET_CARBON if ( m_ok ) @@ -258,7 +258,7 @@ bool wxPrinterDC::StartDoc( const wxString& WXUNUSED(message) ) if ( err != noErr || m_macPrintSessionPort == kPMNoReference ) #endif { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; dialog.ShowModal(); #if TARGET_CARBON && PM_USE_SESSION_APIS @@ -280,7 +280,7 @@ bool wxPrinterDC::StartDoc( const wxString& WXUNUSED(message) ) err = PMGetAdjustedPaperRect((PMPageFormat)m_printData.m_macPageFormat, &rPaper); if ( err != noErr ) { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; dialog.ShowModal(); #if TARGET_CARBON && PM_USE_SESSION_APIS @@ -291,8 +291,8 @@ bool wxPrinterDC::StartDoc( const wxString& WXUNUSED(message) ) m_ok = FALSE; return m_ok; } - m_maxX = rPaper.right - rPaper.left ; - m_maxY = rPaper.bottom - rPaper.top ; + m_maxX = (wxCoord)(rPaper.right - rPaper.left) ; + m_maxY = (wxCoord)(rPaper.bottom - rPaper.top) ; #else m_maxX = (**(THPrint)m_printData.m_macPrintSettings).rPaper.right - (**(THPrint)m_printData.m_macPrintSettings).rPaper.left ; m_maxY = (**(THPrint)m_printData.m_macPrintSettings).rPaper.bottom - (**(THPrint)m_printData.m_macPrintSettings).rPaper.top ; @@ -321,7 +321,7 @@ void wxPrinterDC::EndDoc(void) #endif if ( err != noErr ) { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; dialog.ShowModal(); } @@ -402,8 +402,8 @@ void wxPrinterDC::StartPage(void) err = PMGetAdjustedPaperRect((PMPageFormat)m_printData.m_macPageFormat, &rPaper); if ( !err ) { - m_macLocalOrigin.x = rPaper.left ; - m_macLocalOrigin.y = rPaper.top ; + m_macLocalOrigin.x = (int) (rPaper.left) ; + m_macLocalOrigin.y = (int) (rPaper.top) ; } #endif } diff --git a/src/mac/dnd.cpp b/src/mac/dnd.cpp index 7e80e83525..598284893d 100644 --- a/src/mac/dnd.cpp +++ b/src/mac/dnd.cpp @@ -527,6 +527,8 @@ pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, Wind cursor.MacInstall() ; } break ; + default : + break ; } } } diff --git a/src/mac/gsocket.c b/src/mac/gsocket.c index 50086739cf..f3985aee92 100644 --- a/src/mac/gsocket.c +++ b/src/mac/gsocket.c @@ -36,7 +36,7 @@ #include #include #endif -#if TARGET_CARBON +#if TARGET_CARBON && !defined(OTAssert) #define OTAssert( str , cond ) /* does not exists in Carbon */ #endif diff --git a/src/mac/notebmac.cpp b/src/mac/notebmac.cpp index 2f8f53b786..4f590e8b6c 100644 --- a/src/mac/notebmac.cpp +++ b/src/mac/notebmac.cpp @@ -383,7 +383,7 @@ void wxNotebook::MacSetupTabs() ControlButtonContentInfo info ; wxMacCreateBitmapButton( &info , *GetImageList()->GetBitmap( GetPageImage(ii ) ) , kControlContentPictHandle) ; IconFamilyHandle iconFamily = (IconFamilyHandle) NewHandle(0) ; - OSErr err = SetIconFamilyData( iconFamily, 'PICT' , (Handle) info.u.picture ) ; + err = SetIconFamilyData( iconFamily, 'PICT' , (Handle) info.u.picture ) ; wxASSERT_MSG( err == noErr , "Error when adding bitmap" ) ; IconRef iconRef ; err = RegisterIconRefFromIconFamily( 'WXNG' , (OSType) 1 , iconFamily, &iconRef ) ;