Warning fix and source cleaning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34447 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-05-31 12:19:04 +00:00
parent 12cca26a83
commit cb9c71ecca

View File

@@ -101,7 +101,7 @@ OSErr BuildVolumeList(Boolean includeRemote, short *vols,
long *count, long vMAttribMask) { long *count, long vMAttribMask) {
HParamBlockRec volPB; HParamBlockRec volPB;
Boolean isRemote; Boolean isRemote;
OSErr err; OSErr err = noErr;
long nlocal, nremote; long nlocal, nremote;
long vMAttrib; long vMAttrib;
@@ -341,14 +341,14 @@ bool wxFileTypeImpl::SetCommand(const wxString& cmd, const wxString& verb, bool
{ {
wxASSERT_MSG( m_manager != NULL , wxT("Bad wxFileType") ); wxASSERT_MSG( m_manager != NULL , wxT("Bad wxFileType") );
return FALSE; return false;
} }
bool wxFileTypeImpl::SetDefaultIcon(const wxString& strIcon, int index) bool wxFileTypeImpl::SetDefaultIcon(const wxString& strIcon, int index)
{ {
wxASSERT_MSG( m_manager != NULL , wxT("Bad wxFileType") ); wxASSERT_MSG( m_manager != NULL , wxT("Bad wxFileType") );
return FALSE; return false;
} }
bool wxFileTypeImpl::GetOpenCommand(wxString *openCmd, bool wxFileTypeImpl::GetOpenCommand(wxString *openCmd,
@@ -548,10 +548,10 @@ bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const
{ {
mimeTypes.Clear(); mimeTypes.Clear();
mimeTypes.Add(s); mimeTypes.Add(s);
return TRUE; return true;
} }
else else
return FALSE; return false;
} }
bool wxFileTypeImpl::GetIcon(wxIconLocation *WXUNUSED(icon)) const bool wxFileTypeImpl::GetIcon(wxIconLocation *WXUNUSED(icon)) const
@@ -559,7 +559,7 @@ bool wxFileTypeImpl::GetIcon(wxIconLocation *WXUNUSED(icon)) const
wxASSERT_MSG( m_manager != NULL , wxT("Bad wxFileType") ); wxASSERT_MSG( m_manager != NULL , wxT("Bad wxFileType") );
// no such file type or no value or incorrect icon entry // no such file type or no value or incorrect icon entry
return FALSE; return false;
} }
size_t wxFileTypeImpl::GetAllCommands(wxArrayString * verbs, wxArrayString * commands, size_t wxFileTypeImpl::GetAllCommands(wxArrayString * verbs, wxArrayString * commands,
@@ -647,8 +647,7 @@ void wxMimeTypesManagerImpl::Initialize(int mailcapStyles, const wxString& extra
{ {
wxString cmd; wxString cmd;
impl.GetOpenCommand (&cmd, impl.GetOpenCommand (&cmd,
wxFileType::MessageParameters (wxT("http://www.google.com"), wxFileType::MessageParameters (wxT("http://www.google.com")));
_T("")));
wxPrintf(wxT("APP: [%s]\n"), cmd.c_str()); wxPrintf(wxT("APP: [%s]\n"), cmd.c_str());
} }
@@ -1192,8 +1191,7 @@ class wxCFNumber
public: public:
wxCFNumber(int nValue) wxCFNumber(int nValue)
{ {
m_cfnRef = CFNumberCreate(kCFAllocatorDefault, m_cfnRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &nValue);
kCFNumberIntType, &nValue);
} }
wxCFNumber(CFTypeRef ref, bool bRetain = wxCF_RELEASE) : m_cfnRef((CFNumberRef)ref) wxCFNumber(CFTypeRef ref, bool bRetain = wxCF_RELEASE) : m_cfnRef((CFNumberRef)ref)
@@ -1203,7 +1201,10 @@ public:
} }
~wxCFNumber() ~wxCFNumber()
{ if(m_cfnRef) CFRelease(m_cfnRef); } {
if(m_cfnRef)
CFRelease(m_cfnRef);
}
operator CFTypeRef() const operator CFTypeRef() const
@@ -1212,8 +1213,7 @@ public:
int GetValue() int GetValue()
{ {
int nOut; int nOut;
CFNumberGetValue( CFNumberGetValue( m_cfnRef,
m_cfnRef,
kCFNumberIntType, kCFNumberIntType,
&nOut &nOut
); );
@@ -1775,7 +1775,7 @@ wxMimeTypesManagerImpl::Unassociate(wxFileType *pFileType)
if(!asExtensions.GetCount()) if(!asExtensions.GetCount())
{ {
wxLogDebug(wxT("Must have extension to disassociate")); wxLogDebug(wxT("Must have extension to disassociate"));
return FALSE; return false;
} }
//Find and write to Info.plist in main bundle (note that some other //Find and write to Info.plist in main bundle (note that some other
@@ -1937,7 +1937,7 @@ wxMimeTypesManagerImpl::Unassociate(wxFileType *pFileType)
#if defined(__DARWIN__) #if defined(__DARWIN__)
if(!bInfoSuccess) if(!bInfoSuccess)
return FALSE; return false;
#endif #endif
//this should be as easy as removing the entry from the database and then saving //this should be as easy as removing the entry from the database and then saving
@@ -1953,7 +1953,7 @@ wxMimeTypesManagerImpl::Unassociate(wxFileType *pFileType)
// kICAttrNoChange, (Handle) m_hDatabase); // kICAttrNoChange, (Handle) m_hDatabase);
// if(status == noErr) // if(status == noErr)
return TRUE; return true;
// else // else
// { // {
// wxLogDebug(wxString::Format(wxT("%i - %s"), __LINE__, wxT("ICSetPrefHandle failed."))); // wxLogDebug(wxString::Format(wxT("%i - %s"), __LINE__, wxT("ICSetPrefHandle failed.")));
@@ -1965,7 +1965,7 @@ wxMimeTypesManagerImpl::Unassociate(wxFileType *pFileType)
wxLogDebug(wxString::Format(wxT("%i - %s"), __LINE__, wxT("ICDeleteMapEntry failed."))); wxLogDebug(wxString::Format(wxT("%i - %s"), __LINE__, wxT("ICDeleteMapEntry failed.")));
} }
return FALSE; return false;
} }
/* /*
CFWriteStreamRef cfwsInfo = CFWriteStreamCreateWithFile( CFWriteStreamRef cfwsInfo = CFWriteStreamCreateWithFile(