fix more unused parameters and variables warnings

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50051 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-11-18 17:53:04 +00:00
parent 6e1609b1e0
commit 31c1cbc7bc
8 changed files with 71 additions and 63 deletions

View File

@@ -1547,6 +1547,8 @@ WXHBITMAP wxBitmap::GetHBITMAP(WXHBITMAP* mask) const
#if !wxMAC_USE_CORE_GRAPHICS
return WXHBITMAP(M_BITMAPDATA->GetHBITMAP((GWorldPtr*)mask));
#else
wxUnusedVar(mask);
return WXHBITMAP(M_BITMAPDATA->GetBitmapContext());
#endif
}

View File

@@ -34,11 +34,6 @@
#include <string.h>
// the trace mask we use with wxLogTrace() - call
// wxLog::AddTraceMask(TRACE_CLIPBOARD) to enable the trace messages from here
// (there will be a *lot* of them!)
static const wxChar *TRACE_CLIPBOARD = wxT("clipboard");
IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
wxClipboard::wxClipboard()

View File

@@ -195,7 +195,7 @@ wxBitmap wxWindowDC::DoGetAsBitmap(const wxRect *subrect) const
// call this method when a Blit is performed with it as a source.
if (!m_window)
return wxNullBitmap;
ControlRef handle = (ControlRef) m_window->GetHandle();
if ( !handle )
return wxNullBitmap;
@@ -226,7 +226,6 @@ wxBitmap wxWindowDC::DoGetAsBitmap(const wxRect *subrect) const
wxBitmap bmp = wxBitmap(width, height, 32);
wxAlphaPixelData pixData(bmp, wxPoint(0,0), wxSize(width, height));
pixData.UseAlpha();
wxAlphaPixelData::Iterator p(pixData);
for (int y=0; y<height; y++) {
wxAlphaPixelData::Iterator rowStart = p;

View File

@@ -212,11 +212,13 @@ wxDropSource::~wxDropSource()
{
}
OSStatus wxMacPromiseKeeper( PasteboardRef inPasteboard, PasteboardItemID inItem, CFStringRef inFlavorType,
void *inContext )
OSStatus wxMacPromiseKeeper(PasteboardRef WXUNUSED(inPasteboard),
PasteboardItemID WXUNUSED(inItem),
CFStringRef WXUNUSED(inFlavorType),
void * WXUNUSED(inContext))
{
OSStatus err = noErr;
// we might add promises here later, inContext is the wxDropSource*
return err;
@@ -233,37 +235,37 @@ wxDragResult wxDropSource::DoDragDrop(int flags)
RgnHandle dragRegion;
OSStatus err = noErr;
PasteboardRef pasteboard;
// add data to drag
err = PasteboardCreate( kPasteboardUniqueName, &pasteboard );
if ( err != noErr )
return wxDragNone;
// we add a dummy promise keeper because of strange messages when linking against carbon debug
err = PasteboardSetPromiseKeeper( pasteboard, wxMacPromiseKeeper, this );
err = PasteboardSetPromiseKeeper( pasteboard, wxMacPromiseKeeper, this );
if ( err != noErr )
{
CFRelease( pasteboard );
return wxDragNone;
}
err = PasteboardClear( pasteboard );
err = PasteboardClear( pasteboard );
if ( err != noErr )
{
CFRelease( pasteboard );
return wxDragNone;
}
PasteboardSynchronize( pasteboard );
PasteboardSynchronize( pasteboard );
m_data->AddToPasteboard( pasteboard, 1 );
if (NewDragWithPasteboard( pasteboard , &theDrag) != noErr)
{
CFRelease( pasteboard );
return wxDragNone;
}
dragRegion = NewRgn();
RgnHandle tempRgn = NewRgn();
@@ -298,7 +300,7 @@ wxDragResult wxDropSource::DoDragDrop(int flags)
gTrackingGlobals.m_flags = flags;
err = TrackDrag( theDrag, &rec, dragRegion );
DisposeRgn( dragRegion );
DisposeDrag( theDrag );
CFRelease( pasteboard );

View File

@@ -574,7 +574,9 @@ wxInt32 wxMenu::MacHandleCommandProcess( wxMenuItem* item, int id, wxWindow* tar
return result;
}
wxInt32 wxMenu::MacHandleCommandUpdateStatus( wxMenuItem* item, int id, wxWindow* targetWindow )
wxInt32 wxMenu::MacHandleCommandUpdateStatus(wxMenuItem* WXUNUSED(item),
int id,
wxWindow* targetWindow)
{
OSStatus result = eventNotHandledErr ;
wxUpdateUIEvent event(id);
@@ -611,7 +613,7 @@ wxInt32 wxMenu::MacHandleCommandUpdateStatus( wxMenuItem* item, int id, wxWindow
{
processed = targetWindow->GetEventHandler()->ProcessEvent(event);
}
if ( processed )
{
// if anything changed, update the changed attribute

View File

@@ -40,15 +40,15 @@ class wxMetafileRefData: public wxGDIRefData
public:
#if wxMAC_USE_CORE_GRAPHICS
// creates a metafile from memory, assumes ownership
wxMetafileRefData(CFDataRef data);
wxMetafileRefData(CFDataRef data);
#else
// creates a metafile from memory, assumes ownership
wxMetafileRefData(PicHandle data);
wxMetafileRefData(PicHandle data);
#endif
// prepares a recording metafile
wxMetafileRefData( int width, int height);
wxMetafileRefData( int width, int height);
// prepares a metafile to be read from a file (if filename is not empty)
wxMetafileRefData( const wxString& filename);
wxMetafileRefData( const wxString& filename);
virtual ~wxMetafileRefData();
void Init();
@@ -188,7 +188,7 @@ void wxMetafileRefData::Close()
CGContextRelease(m_context);
m_context = NULL;
UpdateDocumentFromData();
#else
ClosePicture();
@@ -196,7 +196,7 @@ void wxMetafileRefData::Close()
}
#if wxMAC_USE_CORE_GRAPHICS
void wxMetafileRefData::UpdateDocumentFromData()
void wxMetafileRefData::UpdateDocumentFromData()
{
wxCFRef<CGDataProviderRef> provider(UMACGDataProviderCreateWithCFData(m_data));
m_pdfDoc.reset(CGPDFDocumentCreateWithProvider(provider));
@@ -204,8 +204,8 @@ void wxMetafileRefData::UpdateDocumentFromData()
{
CGPDFPageRef page = CGPDFDocumentGetPage( m_pdfDoc, 1 );
CGRect rect = CGPDFPageGetBoxRect ( page, kCGPDFMediaBox);
m_width = rect.size.width;
m_height = rect.size.height;
m_width = wx_static_cast(int, rect.size.width);
m_height = wx_static_cast(int, rect.size.height);
}
}
#endif
@@ -283,7 +283,8 @@ void wxMetafile::SetPICT(void* pictHandle)
wxCFRef<CGDataProviderRef> provider(UMACGDataProviderCreateWithCFData(data));
QDPictRef pictRef = QDPictCreateWithProvider(provider);
CGRect rect = QDPictGetBounds(pictRef);
m_refData = new wxMetafileRefData( rect.size.width, rect.size.height );
m_refData = new wxMetafileRefData(wx_static_cast(int, rect.size.width),
wx_static_cast(int, rect.size.height));
QDPictDrawToCGContext( ((wxMetafileRefData*) m_refData)->GetContext(), rect, pictRef );
CFRelease( data );
QDPictRelease( pictRef );
@@ -413,14 +414,14 @@ bool wxMetafileDataObject::GetDataHere(void *buf) const
#if wxMAC_USE_CORE_GRAPHICS
wxMetafileRefData* refData = M_METAFILEREFDATA(m_metafile);
if ( refData )
{
{
CFIndex length = refData->GetData().GetLength();
if ( length > 0 )
{
result = true ;
refData->GetData().GetBytes(CFRangeMake(0,length), (UInt8 *) buf);
}
}
}
#else
Handle pictH = (Handle)(*((wxMetafile*)&m_metafile)).GetHMETAFILE();
result = (pictH != NULL);

View File

@@ -1760,11 +1760,11 @@ void wxMacMLTEControl::AdjustCreationAttributes(const wxColour &background,
| kTXNSupportFontCommandProcessing
| kTXNSupportFontCommandUpdating;
// only spell check when not read-only
// only spell check when not read-only
// use system options for the default
bool checkSpelling = false ;
bool checkSpelling = false ;
if ( !(m_windowStyle & wxTE_READONLY) )
{
{
#if wxUSE_SYSTEM_OPTIONS
if ( wxSystemOptions::HasOption( wxMAC_TEXTCONTROL_USE_SPELL_CHECKER ) && (wxSystemOptions::GetOptionInt( wxMAC_TEXTCONTROL_USE_SPELL_CHECKER ) == 1) )
{
@@ -1772,11 +1772,11 @@ void wxMacMLTEControl::AdjustCreationAttributes(const wxColour &background,
}
#endif
}
if ( checkSpelling )
options |=
kTXNSupportSpellCheckCommandProcessing
| kTXNSupportSpellCheckCommandUpdating;
| kTXNSupportSpellCheckCommandUpdating;
TXNSetCommandEventSupport( m_txn , options ) ;
}
@@ -1794,6 +1794,11 @@ void wxMacMLTEControl::SetBackground( const wxBrush &brush )
TXNSetBackground( m_txn , &tback );
}
static inline int wxConvertToTXN(int x)
{
return wx_static_cast(int, x / 254.0 * 72 + 0.5);
}
void wxMacMLTEControl::TXNSetAttribute( const wxTextAttr& style , long from , long to )
{
TXNTypeAttributes typeAttr[4] ;
@@ -1804,9 +1809,9 @@ void wxMacMLTEControl::TXNSetAttribute( const wxTextAttr& style , long from , lo
TXNControlTag controlTags[4];
TXNControlData controlData[4];
size_t controlAttrCount = 0;
TXNTab* tabs = NULL;
bool relayout = false;
if ( style.HasFont() )
@@ -1829,12 +1834,12 @@ void wxMacMLTEControl::TXNSetAttribute( const wxTextAttr& style , long from , lo
typeAttr[typeAttrCount].data.dataPtr = (void*) &color ;
typeAttrCount++ ;
}
if ( style.HasAlignment() )
{
wxASSERT( controlAttrCount < WXSIZEOF(controlTags) );
SInt32 align;
switch ( style.GetAlignment() )
{
case wxTEXT_ALIGNMENT_LEFT:
@@ -1848,13 +1853,13 @@ void wxMacMLTEControl::TXNSetAttribute( const wxTextAttr& style , long from , lo
break;
case wxTEXT_ALIGNMENT_JUSTIFIED:
align = kTXNFullJust;
break;
break;
default :
case wxTEXT_ALIGNMENT_DEFAULT:
align = kTXNFlushDefault;
break;
}
controlTags[controlAttrCount] = kTXNJustificationTag ;
controlData[controlAttrCount].sValue = align ;
controlAttrCount++ ;
@@ -1869,29 +1874,29 @@ void wxMacMLTEControl::TXNSetAttribute( const wxTextAttr& style , long from , lo
&controlTags[controlAttrCount], &controlData[controlAttrCount]) );
if ( style.HasLeftIndent() )
{
margins.leftMargin = style.GetLeftIndent() / 254.0 * 72 + 0.5;
margins.leftMargin = wxConvertToTXN(style.GetLeftIndent());
}
if ( style.HasRightIndent() )
{
margins.rightMargin = style.GetRightIndent() / 254.0 * 72 + 0.5;
margins.rightMargin = wxConvertToTXN(style.GetRightIndent());
}
controlAttrCount++ ;
}
if ( style.HasTabs() )
{
const wxArrayInt& tabarray = style.GetTabs();
// unfortunately Mac only applies a tab distance, not individually different tabs
controlTags[controlAttrCount] = kTXNTabSettingsTag;
if ( tabarray.size() > 0 )
controlData[controlAttrCount].tabValue.value = tabarray[0] / 254.0 * 72 + 0.5;
controlData[controlAttrCount].tabValue.value = wxConvertToTXN(tabarray[0]);
else
controlData[controlAttrCount].tabValue.value = 72 ;
controlData[controlAttrCount].tabValue.value = 72 ;
controlData[controlAttrCount].tabValue.tabType = kTXNLeftTab;
controlAttrCount++ ;
}
// unfortunately the relayout is not automatic
if ( controlAttrCount > 0 )
{
@@ -1899,18 +1904,18 @@ void wxMacMLTEControl::TXNSetAttribute( const wxTextAttr& style , long from , lo
controlTags, controlData) );
relayout = true;
}
if ( typeAttrCount > 0 )
{
verify_noerr( TXNSetTypeAttributes( m_txn , typeAttrCount, typeAttr, from , to ) );
relayout = true;
}
if ( tabs != NULL )
{
delete[] tabs;
}
if ( relayout )
{
TXNRecalcTextLayout( m_txn );
@@ -3095,7 +3100,7 @@ bool wxMacMLTEHIViewControl::HasFocus() const
ControlRef control ;
if ( GetUserFocusWindow() == NULL )
return false;
GetKeyboardFocus( GetUserFocusWindow() , &control ) ;
return control == m_textView ;
}

View File

@@ -140,7 +140,7 @@ void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex inItem , bool enable)
void UMAAppendSubMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , SInt16 id )
{
AppendMenuItemTextWithCFString( menu,
CFSTR("A"), 0, 0,NULL);
CFSTR("A"), 0, 0,NULL);
UMASetMenuItemText( menu, (SInt16) ::CountMenuItems(menu), title , encoding );
SetMenuItemHierarchicalID( menu , CountMenuItems( menu ) , id ) ;
}
@@ -148,8 +148,8 @@ void UMAAppendSubMenuItem( MenuRef menu , const wxString& title, wxFontEncoding
void UMAInsertSubMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , MenuItemIndex item , SInt16 id )
{
InsertMenuItemTextWithCFString( menu,
CFSTR("A"), item, 0, 0);
CFSTR("A"), item, 0, 0);
UMASetMenuItemText( menu, item+1, title , encoding );
SetMenuItemHierarchicalID( menu , item+1 , id ) ;
}
@@ -295,7 +295,7 @@ void UMASetMenuItemShortcut( MenuRef menu , MenuItemIndex item , wxAcceleratorEn
void UMAAppendMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , wxAcceleratorEntry *entry )
{
AppendMenuItemTextWithCFString( menu,
CFSTR("A"), 0, 0,NULL);
CFSTR("A"), 0, 0,NULL);
// don't attempt to interpret metacharacters like a '-' at the beginning (would become a separator otherwise)
ChangeMenuItemAttributes( menu , ::CountMenuItems(menu), kMenuItemAttrIgnoreMeta , 0 ) ;
UMASetMenuItemText(menu, (SInt16) ::CountMenuItems(menu), title , encoding );
@@ -305,7 +305,7 @@ void UMAAppendMenuItem( MenuRef menu , const wxString& title, wxFontEncoding enc
void UMAInsertMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , MenuItemIndex item , wxAcceleratorEntry *entry )
{
InsertMenuItemTextWithCFString( menu,
CFSTR("A"), item, 0, 0);
CFSTR("A"), item, 0, 0);
// don't attempt to interpret metacharacters like a '-' at the beginning (would become a separator otherwise)
ChangeMenuItemAttributes( menu , item+1, kMenuItemAttrIgnoreMeta , 0 ) ;
@@ -584,7 +584,9 @@ size_t UMAPutBytesCFRefCallback( void *info, const void *bytes, size_t count )
return count;
}
void UMAReleaseCFDataProviderCallback( void *info, const void *data, size_t count )
void UMAReleaseCFDataProviderCallback(void *info,
const void *WXUNUSED(data),
size_t WXUNUSED(count))
{
if ( info )
CFRelease( (CFDataRef) info );
@@ -600,7 +602,7 @@ CGDataProviderRef UMACGDataProviderCreateWithCFData( CFDataRef data )
{
if ( data == NULL )
return NULL;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if( &CGDataProviderCreateWithCFData != NULL )
{
@@ -622,7 +624,7 @@ CGDataConsumerRef UMACGDataConsumerCreateWithCFData( CFMutableDataRef data )
{
if ( data == NULL )
return NULL;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if( &CGDataConsumerCreateWithCFData != NULL )
{