compilation warnings fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20818 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-06-01 15:16:07 +00:00
parent 550e6c014c
commit 5be55d562f
14 changed files with 144 additions and 128 deletions

View File

@@ -237,7 +237,6 @@ wxSize wxChoice::DoGetBestSize() const
#endif #endif
{ {
wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetRootWindow() ) ) ; wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetRootWindow() ) ) ;
Rect drawRect ;
wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ; wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
if ( font ) if ( font )
{ {
@@ -273,7 +272,6 @@ wxSize wxChoice::DoGetBestSize() const
// Add room for the popup arrow // Add room for the popup arrow
lbWidth += 2 * lbHeight ; lbWidth += 2 * lbHeight ;
// And just a bit more // And just a bit more
int cy = 12 ;
int cx = ::TextWidth( "X" , 0 , 1 ) ; int cx = ::TextWidth( "X" , 0 , 1 ) ;
lbWidth += cx ; lbWidth += cx ;

View File

@@ -1322,7 +1322,10 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
#else #else
TECObjectRef ec; TECObjectRef ec;
status = TECCreateConverter(&ec, status = TECCreateConverter(&ec,
wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman, kTextEncodingUnicodeDefault); wxApp::s_macDefaultEncodingIsPC
? (int)kTextEncodingWindowsLatin1
: (int)kTextEncodingMacRoman,
kTextEncodingUnicodeDefault);
wxASSERT_MSG( status == noErr , wxT("couldn't start converter") ) ; wxASSERT_MSG( status == noErr , wxT("couldn't start converter") ) ;
ByteCount byteOutLen ; ByteCount byteOutLen ;
@@ -1369,8 +1372,8 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
status = ::ATSUMeasureText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd, status = ::ATSUMeasureText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
&textBefore , &textAfter, &ascent , &descent ); &textBefore , &textAfter, &ascent , &descent );
drawX += sin(angle/RAD2DEG) * FixedToInt(ascent) ; drawX += (int)(sin(angle/RAD2DEG) * FixedToInt(ascent));
drawY += cos(angle/RAD2DEG) * FixedToInt(ascent) ; drawY += (int)(cos(angle/RAD2DEG) * FixedToInt(ascent));
status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd, status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
IntToFixed(drawX) , IntToFixed(drawY) ); IntToFixed(drawX) , IntToFixed(drawY) );
wxASSERT_MSG( status == noErr , wxT("couldn't draw the rotated text") ); wxASSERT_MSG( status == noErr , wxT("couldn't draw the rotated text") );
@@ -1808,7 +1811,7 @@ void wxDC::MacInstallFont() const
} ; } ;
Boolean kTrue = true ; Boolean kTrue = true ;
Boolean kFalse = false ; Boolean kFalse = false ;
BslnBaselineClass kBaselineDefault = kBSLNHangingBaseline ; //BslnBaselineClass kBaselineDefault = kBSLNHangingBaseline ;
ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal; ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal;
ATSUAttributeValuePtr atsuValues[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] = ATSUAttributeValuePtr atsuValues[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] =
{ {

View File

@@ -363,7 +363,7 @@ void wxMenu::MacEnableMenu( bool bDoEnable )
void wxMenu::MacBeforeDisplay( bool isSubMenu ) void wxMenu::MacBeforeDisplay( bool isSubMenu )
{ {
wxMenuItem* previousItem = NULL ; wxMenuItem* previousItem = NULL ;
int pos ; size_t pos ;
wxMenuItemList::Node *node; wxMenuItemList::Node *node;
wxMenuItem *item; wxMenuItem *item;
for (pos = 0, node = GetMenuItems().GetFirst(); node; node = node->GetNext(), pos++) for (pos = 0, node = GetMenuItems().GetFirst(); node; node = node->GetNext(), pos++)
@@ -382,7 +382,9 @@ void wxMenu::MacBeforeDisplay( bool isSubMenu )
if ( item->GetId() == wxApp::s_macPreferencesMenuItemId || item->GetId() == wxApp::s_macExitMenuItemId) if ( item->GetId() == wxApp::s_macPreferencesMenuItemId || item->GetId() == wxApp::s_macExitMenuItemId)
{ {
ChangeMenuItemAttributes( MAC_WXHMENU( GetHMenu() ) , pos + 1, kMenuItemAttrHidden, 0 ); ChangeMenuItemAttributes( MAC_WXHMENU( GetHMenu() ) , pos + 1, kMenuItemAttrHidden, 0 );
if ( GetMenuItems().GetCount() == pos + 1 && previousItem != NULL && previousItem->IsSeparator() ) if ( GetMenuItems().GetCount() == pos + 1 &&
previousItem != NULL &&
previousItem->IsSeparator() )
{ {
ChangeMenuItemAttributes( MAC_WXHMENU( GetHMenu() ) , pos , kMenuItemAttrHidden, 0 ); ChangeMenuItemAttributes( MAC_WXHMENU( GetHMenu() ) , pos , kMenuItemAttrHidden, 0 );
} }

View File

@@ -234,8 +234,8 @@ void wxMacCarbonPrintData::TransferTo( wxPageSetupData* data )
(int)(((double) rPage.top - rPaper.top ) * pt2mm) ) ) ; (int)(((double) rPage.top - rPaper.top ) * pt2mm) ) ) ;
data->SetMinMarginBottomRight( wxPoint ( data->SetMinMarginBottomRight( wxPoint (
((double) rPaper.right - rPage.right ) * pt2mm , (wxCoord)(((double) rPaper.right - rPage.right ) * pt2mm),
((double) rPaper.bottom - rPage.bottom ) * pt2mm ) ) ; (wxCoord)(((double) rPaper.bottom - rPage.bottom ) * pt2mm)) ) ;
} }
} }
} }

View File

@@ -325,8 +325,6 @@ bool wxToolBar::Realize()
node = node->GetNext(); node = node->GetNext();
} }
int separatorSize = GetToolSize().x / 4 ;
node = m_tools.GetFirst(); node = m_tools.GetFirst();
while (node) while (node)
{ {

View File

@@ -844,7 +844,7 @@ void wxTopLevelWindowMac::MacFireMouseEvent(
if ( kind == mouseDown ) if ( kind == mouseDown )
{ {
if ( timestamp - gs_lastWhen <= GetDblTime() ) if ( timestamp - gs_lastWhen <= (long) GetDblTime() )
{ {
if ( abs( localwhere.h - gs_lastWhere.h ) < 3 && abs( localwhere.v - gs_lastWhere.v ) < 3 ) if ( abs( localwhere.h - gs_lastWhere.h ) < 3 && abs( localwhere.v - gs_lastWhere.v ) < 3 )
{ {

View File

@@ -617,25 +617,33 @@ TECObjectRef s_TECPlatformToNativeC = NULL ;
TECObjectRef s_TECNativeCToPlatform = NULL ; TECObjectRef s_TECNativeCToPlatform = NULL ;
void wxMacSetupConverters() void wxMacSetupConverters()
{ {
// if we assume errors are happening here we need low level debugging since the high level assert will use the encoders that // if we assume errors are happening here we need low level debugging
// are not yet setup... // since the high level assert will use the encoders that are not yet
// setup...
const int kEncoding = wxApp::s_macDefaultEncodingIsPC
? (int)kTextEncodingWindowsLatin1
: (int)kTextEncodingMacRoman;
OSStatus status = noErr ; OSStatus status = noErr ;
status = TECCreateConverter(&s_TECNativeCToUnicode, status = TECCreateConverter(&s_TECNativeCToUnicode,
wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman, kTextEncodingUnicodeDefault); kEncoding,
kTextEncodingUnicodeDefault);
status = TECCreateConverter(&s_TECUnicodeToNativeC, status = TECCreateConverter(&s_TECUnicodeToNativeC,
kTextEncodingUnicodeDefault, wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman); kTextEncodingUnicodeDefault,
kEncoding);
if ( wxApp::s_macDefaultEncodingIsPC ) if ( wxApp::s_macDefaultEncodingIsPC )
{ {
status = TECCreateConverter(&s_TECPlatformToNativeC, status = TECCreateConverter(&s_TECPlatformToNativeC,
kTextEncodingMacRoman, wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman); kTextEncodingMacRoman,
kTextEncodingWindowsLatin1);
status = TECCreateConverter(&s_TECNativeCToPlatform, status = TECCreateConverter(&s_TECNativeCToPlatform,
wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman , kTextEncodingMacRoman ); kTextEncodingWindowsLatin1,
kTextEncodingMacRoman);
} }
} }
@@ -685,7 +693,6 @@ wxString wxMacMakeStringFromCString( const char * from , int len )
memcpy( buf , from , len ) ; memcpy( buf , from , len ) ;
else else
{ {
OSStatus status = noErr ;
ByteCount byteOutLen ; ByteCount byteOutLen ;
ByteCount byteInLen = len ; ByteCount byteInLen = len ;
ByteCount byteBufferLen = byteInLen ; ByteCount byteBufferLen = byteInLen ;

View File

@@ -237,7 +237,6 @@ wxSize wxChoice::DoGetBestSize() const
#endif #endif
{ {
wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetRootWindow() ) ) ; wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetRootWindow() ) ) ;
Rect drawRect ;
wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ; wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
if ( font ) if ( font )
{ {
@@ -273,7 +272,6 @@ wxSize wxChoice::DoGetBestSize() const
// Add room for the popup arrow // Add room for the popup arrow
lbWidth += 2 * lbHeight ; lbWidth += 2 * lbHeight ;
// And just a bit more // And just a bit more
int cy = 12 ;
int cx = ::TextWidth( "X" , 0 , 1 ) ; int cx = ::TextWidth( "X" , 0 , 1 ) ;
lbWidth += cx ; lbWidth += cx ;

View File

@@ -1322,7 +1322,10 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
#else #else
TECObjectRef ec; TECObjectRef ec;
status = TECCreateConverter(&ec, status = TECCreateConverter(&ec,
wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman, kTextEncodingUnicodeDefault); wxApp::s_macDefaultEncodingIsPC
? (int)kTextEncodingWindowsLatin1
: (int)kTextEncodingMacRoman,
kTextEncodingUnicodeDefault);
wxASSERT_MSG( status == noErr , wxT("couldn't start converter") ) ; wxASSERT_MSG( status == noErr , wxT("couldn't start converter") ) ;
ByteCount byteOutLen ; ByteCount byteOutLen ;
@@ -1369,8 +1372,8 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
status = ::ATSUMeasureText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd, status = ::ATSUMeasureText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
&textBefore , &textAfter, &ascent , &descent ); &textBefore , &textAfter, &ascent , &descent );
drawX += sin(angle/RAD2DEG) * FixedToInt(ascent) ; drawX += (int)(sin(angle/RAD2DEG) * FixedToInt(ascent));
drawY += cos(angle/RAD2DEG) * FixedToInt(ascent) ; drawY += (int)(cos(angle/RAD2DEG) * FixedToInt(ascent));
status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd, status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
IntToFixed(drawX) , IntToFixed(drawY) ); IntToFixed(drawX) , IntToFixed(drawY) );
wxASSERT_MSG( status == noErr , wxT("couldn't draw the rotated text") ); wxASSERT_MSG( status == noErr , wxT("couldn't draw the rotated text") );
@@ -1808,7 +1811,7 @@ void wxDC::MacInstallFont() const
} ; } ;
Boolean kTrue = true ; Boolean kTrue = true ;
Boolean kFalse = false ; Boolean kFalse = false ;
BslnBaselineClass kBaselineDefault = kBSLNHangingBaseline ; //BslnBaselineClass kBaselineDefault = kBSLNHangingBaseline ;
ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal; ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal;
ATSUAttributeValuePtr atsuValues[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] = ATSUAttributeValuePtr atsuValues[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] =
{ {

View File

@@ -363,7 +363,7 @@ void wxMenu::MacEnableMenu( bool bDoEnable )
void wxMenu::MacBeforeDisplay( bool isSubMenu ) void wxMenu::MacBeforeDisplay( bool isSubMenu )
{ {
wxMenuItem* previousItem = NULL ; wxMenuItem* previousItem = NULL ;
int pos ; size_t pos ;
wxMenuItemList::Node *node; wxMenuItemList::Node *node;
wxMenuItem *item; wxMenuItem *item;
for (pos = 0, node = GetMenuItems().GetFirst(); node; node = node->GetNext(), pos++) for (pos = 0, node = GetMenuItems().GetFirst(); node; node = node->GetNext(), pos++)
@@ -382,7 +382,9 @@ void wxMenu::MacBeforeDisplay( bool isSubMenu )
if ( item->GetId() == wxApp::s_macPreferencesMenuItemId || item->GetId() == wxApp::s_macExitMenuItemId) if ( item->GetId() == wxApp::s_macPreferencesMenuItemId || item->GetId() == wxApp::s_macExitMenuItemId)
{ {
ChangeMenuItemAttributes( MAC_WXHMENU( GetHMenu() ) , pos + 1, kMenuItemAttrHidden, 0 ); ChangeMenuItemAttributes( MAC_WXHMENU( GetHMenu() ) , pos + 1, kMenuItemAttrHidden, 0 );
if ( GetMenuItems().GetCount() == pos + 1 && previousItem != NULL && previousItem->IsSeparator() ) if ( GetMenuItems().GetCount() == pos + 1 &&
previousItem != NULL &&
previousItem->IsSeparator() )
{ {
ChangeMenuItemAttributes( MAC_WXHMENU( GetHMenu() ) , pos , kMenuItemAttrHidden, 0 ); ChangeMenuItemAttributes( MAC_WXHMENU( GetHMenu() ) , pos , kMenuItemAttrHidden, 0 );
} }

View File

@@ -234,8 +234,8 @@ void wxMacCarbonPrintData::TransferTo( wxPageSetupData* data )
(int)(((double) rPage.top - rPaper.top ) * pt2mm) ) ) ; (int)(((double) rPage.top - rPaper.top ) * pt2mm) ) ) ;
data->SetMinMarginBottomRight( wxPoint ( data->SetMinMarginBottomRight( wxPoint (
((double) rPaper.right - rPage.right ) * pt2mm , (wxCoord)(((double) rPaper.right - rPage.right ) * pt2mm),
((double) rPaper.bottom - rPage.bottom ) * pt2mm ) ) ; (wxCoord)(((double) rPaper.bottom - rPage.bottom ) * pt2mm)) ) ;
} }
} }
} }

View File

@@ -325,8 +325,6 @@ bool wxToolBar::Realize()
node = node->GetNext(); node = node->GetNext();
} }
int separatorSize = GetToolSize().x / 4 ;
node = m_tools.GetFirst(); node = m_tools.GetFirst();
while (node) while (node)
{ {

View File

@@ -844,7 +844,7 @@ void wxTopLevelWindowMac::MacFireMouseEvent(
if ( kind == mouseDown ) if ( kind == mouseDown )
{ {
if ( timestamp - gs_lastWhen <= GetDblTime() ) if ( timestamp - gs_lastWhen <= (long) GetDblTime() )
{ {
if ( abs( localwhere.h - gs_lastWhere.h ) < 3 && abs( localwhere.v - gs_lastWhere.v ) < 3 ) if ( abs( localwhere.h - gs_lastWhere.h ) < 3 && abs( localwhere.v - gs_lastWhere.v ) < 3 )
{ {

View File

@@ -617,25 +617,33 @@ TECObjectRef s_TECPlatformToNativeC = NULL ;
TECObjectRef s_TECNativeCToPlatform = NULL ; TECObjectRef s_TECNativeCToPlatform = NULL ;
void wxMacSetupConverters() void wxMacSetupConverters()
{ {
// if we assume errors are happening here we need low level debugging since the high level assert will use the encoders that // if we assume errors are happening here we need low level debugging
// are not yet setup... // since the high level assert will use the encoders that are not yet
// setup...
const int kEncoding = wxApp::s_macDefaultEncodingIsPC
? (int)kTextEncodingWindowsLatin1
: (int)kTextEncodingMacRoman;
OSStatus status = noErr ; OSStatus status = noErr ;
status = TECCreateConverter(&s_TECNativeCToUnicode, status = TECCreateConverter(&s_TECNativeCToUnicode,
wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman, kTextEncodingUnicodeDefault); kEncoding,
kTextEncodingUnicodeDefault);
status = TECCreateConverter(&s_TECUnicodeToNativeC, status = TECCreateConverter(&s_TECUnicodeToNativeC,
kTextEncodingUnicodeDefault, wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman); kTextEncodingUnicodeDefault,
kEncoding);
if ( wxApp::s_macDefaultEncodingIsPC ) if ( wxApp::s_macDefaultEncodingIsPC )
{ {
status = TECCreateConverter(&s_TECPlatformToNativeC, status = TECCreateConverter(&s_TECPlatformToNativeC,
kTextEncodingMacRoman, wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman); kTextEncodingMacRoman,
kTextEncodingWindowsLatin1);
status = TECCreateConverter(&s_TECNativeCToPlatform, status = TECCreateConverter(&s_TECNativeCToPlatform,
wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman , kTextEncodingMacRoman ); kTextEncodingWindowsLatin1,
kTextEncodingMacRoman);
} }
} }
@@ -685,7 +693,6 @@ wxString wxMacMakeStringFromCString( const char * from , int len )
memcpy( buf , from , len ) ; memcpy( buf , from , len ) ;
else else
{ {
OSStatus status = noErr ;
ByteCount byteOutLen ; ByteCount byteOutLen ;
ByteCount byteInLen = len ; ByteCount byteInLen = len ;
ByteCount byteBufferLen = byteInLen ; ByteCount byteBufferLen = byteInLen ;