warning fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19482 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2003-03-04 13:37:51 +00:00
parent 26e8b4d3af
commit d659a731e3
14 changed files with 36 additions and 37 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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 ;

View File

@@ -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)] =
{

View File

@@ -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
}

View File

@@ -527,6 +527,8 @@ pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, Wind
cursor.MacInstall() ;
}
break ;
default :
break ;
}
}
}

View File

@@ -36,7 +36,7 @@
#include <OpenTransportProviders.h>
#include <OpenTptInternet.h>
#endif
#if TARGET_CARBON
#if TARGET_CARBON && !defined(OTAssert)
#define OTAssert( str , cond ) /* does not exists in Carbon */
#endif

View File

@@ -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 ) ;

View File

@@ -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 ;

View File

@@ -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)] =
{

View File

@@ -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
}

View File

@@ -527,6 +527,8 @@ pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, Wind
cursor.MacInstall() ;
}
break ;
default :
break ;
}
}
}

View File

@@ -36,7 +36,7 @@
#include <OpenTransportProviders.h>
#include <OpenTptInternet.h>
#endif
#if TARGET_CARBON
#if TARGET_CARBON && !defined(OTAssert)
#define OTAssert( str , cond ) /* does not exists in Carbon */
#endif

View File

@@ -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 ) ;