From: Stefan Csomor Date: Sat, 24 Aug 2002 20:20:04 +0000 (+0000) Subject: getting rid of warnings X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3340066af696862df9394469b341b700fe4e3a68 getting rid of warnings git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16747 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/timercmn.cpp b/src/common/timercmn.cpp index ed6e8c0071..3bf88317e8 100644 --- a/src/common/timercmn.cpp +++ b/src/common/timercmn.cpp @@ -350,6 +350,7 @@ wxLongLong wxGetLocalTimeMillis() millival += upTime.lo / 1000 ; millival += ( ( (UInt64) upTime.hi ) << 32 ) / 1000 ; val = millival ; + return val ; #else // no gettimeofday() nor ftime() // We use wxGetLocalTime() to get the seconds since // 00:00:00 Jan 1st 1970 and then whatever is available diff --git a/src/mac/carbon/clipbrd.cpp b/src/mac/carbon/clipbrd.cpp index a85398f27f..ff814a588c 100644 --- a/src/mac/carbon/clipbrd.cpp +++ b/src/mac/carbon/clipbrd.cpp @@ -202,8 +202,6 @@ bool wxClipboard::AddData( wxDataObject *data ) wxCHECK_MSG( data, FALSE, wxT("data is invalid") ); - wxDataFormat format = data->GetPreferredFormat(); - /* we can only store one wxDataObject */ Clear(); @@ -336,7 +334,7 @@ bool wxClipboard::GetData( wxDataObject& data ) { wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") ); - int formatcount = data.GetFormatCount() + 1 ; + size_t formatcount = data.GetFormatCount() + 1 ; wxDataFormat *array = new wxDataFormat[ formatcount ]; array[0] = data.GetPreferredFormat(); data.GetAllFormats( &array[1] ); diff --git a/src/mac/carbon/combobox.cpp b/src/mac/carbon/combobox.cpp index 0aa01b1a2b..22924613ea 100644 --- a/src/mac/carbon/combobox.cpp +++ b/src/mac/carbon/combobox.cpp @@ -262,10 +262,6 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxValidator& validator, const wxString& name) { - - Rect bounds ; - Str255 title ; - if ( !wxControl::Create(parent, id, wxDefaultPosition, wxDefaultSize, style , wxDefaultValidator, name) ) { diff --git a/src/mac/carbon/control.cpp b/src/mac/carbon/control.cpp index c3c915f85b..5998a660fc 100644 --- a/src/mac/carbon/control.cpp +++ b/src/mac/carbon/control.cpp @@ -819,7 +819,6 @@ void wxControl::OnMouseEvent( wxMouseEvent &event ) ControlHandle control ; Point localwhere ; SInt16 controlpart ; - WindowRef window = (WindowRef) MacGetRootWindow() ; localwhere.h = x ; localwhere.v = y ; @@ -840,20 +839,7 @@ void wxControl::OnMouseEvent( wxMouseEvent &event ) if ( event.m_metaDown ) modifiers |= cmdKey ; -/* -#if TARGET_CARBON - control = FindControlUnderMouse( localwhere , window , &controlpart ) ; -#else - controlpart = FindControl( localwhere , window , &control ) ; -#endif -*/ { - /* - if ( AcceptsFocus() && FindFocus() != this ) - { - SetFocus() ; - } - */ control = (ControlHandle) m_macControl ; if ( control && ::IsControlActive( control ) ) { diff --git a/src/mac/carbon/dc.cpp b/src/mac/carbon/dc.cpp index 206e960450..ef065b7ac1 100644 --- a/src/mac/carbon/dc.cpp +++ b/src/mac/carbon/dc.cpp @@ -958,8 +958,8 @@ void wxDC::DoDrawPolygon(int n, wxPoint points[], PolyHandle polygon = OpenPoly(); - x1 = XLOG2DEVMAC(points[0].x + xoffset); - y1 = YLOG2DEVMAC(points[0].y + yoffset); + x2 = x1 = XLOG2DEVMAC(points[0].x + xoffset); + y2 = y1 = YLOG2DEVMAC(points[0].y + yoffset); ::MoveTo(x1,y1); for (int i = 1; i < n; i++) @@ -1439,7 +1439,7 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y, if ( 0 ) { m_macFormerAliasState = IsAntiAliasedTextEnabled(&m_macFormerAliasSize); - SetAntiAliasedTextEnabled(true, m_scaleY * font->m_macFontSize); + SetAntiAliasedTextEnabled(true, SInt16(m_scaleY * font->m_macFontSize)); m_macAliasWasEnabled = true ; } @@ -1467,9 +1467,10 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y, &chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ; wxASSERT_MSG( status == noErr , "couldn't create the layout of the rotated text" ); - if ( abs(angle) > 0 ) + int iAngle = int( angle ); + if ( abs(iAngle) > 0 ) { - Fixed atsuAngle = IntToFixed( angle ) ; + Fixed atsuAngle = IntToFixed( iAngle ) ; ByteCount angleSize = sizeof(Fixed) ; ATSUAttributeTag rotationTag = kATSULineRotationTag ; ATSUAttributeValuePtr angleValue = &atsuAngle ; @@ -1865,7 +1866,7 @@ void wxDC::MacInstallFont() const OSStatus status = noErr ; - Fixed atsuSize = IntToFixed(m_scaleY * font->m_macFontSize) ; + Fixed atsuSize = IntToFixed( int(m_scaleY * font->m_macFontSize) ) ; Style qdStyle = font->m_macFontStyle ; ATSUFontID atsuFont = font->m_macATSUFontID ; @@ -1934,13 +1935,13 @@ void wxDC::MacInstallFont() const Pattern gHatchPatterns[] = { - { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF } , - { 0x01 , 0x02 , 0x04 , 0x08 , 0x10 , 0x20 , 0x40 , 0x80 } , - { 0x80 , 0x40 , 0x20 , 0x10 , 0x08 , 0x04 , 0x02 , 0x01 } , - { 0x10 , 0x10 , 0x10 , 0xFF , 0x10 , 0x10 , 0x10 , 0x10 } , - { 0x00 , 0x00 , 0x00 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 } , - { 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 } , - { 0x81 , 0x42 , 0x24 , 0x18 , 0x18 , 0x24 , 0x42 , 0x81 } , + { { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF } }, + { { 0x01 , 0x02 , 0x04 , 0x08 , 0x10 , 0x20 , 0x40 , 0x80 } }, + { { 0x80 , 0x40 , 0x20 , 0x10 , 0x08 , 0x04 , 0x02 , 0x01 } }, + { { 0x10 , 0x10 , 0x10 , 0xFF , 0x10 , 0x10 , 0x10 , 0x10 } }, + { { 0x00 , 0x00 , 0x00 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 } }, + { { 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 } }, + { { 0x81 , 0x42 , 0x24 , 0x18 , 0x18 , 0x24 , 0x42 , 0x81 } } } ; static void wxMacGetHatchPattern(int hatchStyle, Pattern *pattern) @@ -2040,7 +2041,6 @@ void wxDC::MacInstallPen() const case wxUSER_DASH : { wxDash* dash ; - int number = m_pen.GetDashes(&dash) ; // right now we don't allocate larger pixmaps for ( int i = 0 ; i < 8 ; ++i ) { diff --git a/src/mac/carbon/dcprint.cpp b/src/mac/carbon/dcprint.cpp index 1f36616c8f..6c32de8ad0 100644 --- a/src/mac/carbon/dcprint.cpp +++ b/src/mac/carbon/dcprint.cpp @@ -150,8 +150,8 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata) m_ok = FALSE; return; } - 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 ; diff --git a/src/mac/carbon/dirmac.cpp b/src/mac/carbon/dirmac.cpp index 129f61a754..0ccaf0b8e9 100644 --- a/src/mac/carbon/dirmac.cpp +++ b/src/mac/carbon/dirmac.cpp @@ -119,6 +119,7 @@ wxDirData::wxDirData(const wxString& dirname) m_index = 0 ; OSErr err = FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ; + wxASSERT_MSG( err == noErr , "Error accessing directory") ; } wxDirData::~wxDirData() diff --git a/src/mac/carbon/frame.cpp b/src/mac/carbon/frame.cpp index 4fe1aec422..4d83421744 100644 --- a/src/mac/carbon/frame.cpp +++ b/src/mac/carbon/frame.cpp @@ -132,7 +132,8 @@ bool wxFrame::Enable(bool enable) if ( m_frameMenuBar && m_frameMenuBar == wxMenuBar::MacGetInstalledMenuBar() ) { - for ( int i = 0 ; i < m_frameMenuBar->GetMenuCount() ; ++ i ) + int iMaxMenu = m_frameMenuBar->GetMenuCount(); + for ( int i = 0 ; i < iMaxMenu ; ++ i ) { m_frameMenuBar->EnableTop( i , enable ) ; } diff --git a/src/mac/carbon/gsocket.c b/src/mac/carbon/gsocket.c index bbeaa29fcf..b96cd92358 100644 --- a/src/mac/carbon/gsocket.c +++ b/src/mac/carbon/gsocket.c @@ -473,9 +473,6 @@ GAddress *GSocket_GetPeer(GSocket *socket) */ GSocketError GSocket_SetServer(GSocket *sck) { - int type; - int arg = 1; - assert(sck != NULL); /* must not be in use */ @@ -545,9 +542,6 @@ GSocketError GSocket_SetServer(GSocket *sck) GSocket *GSocket_WaitConnection(GSocket *socket) { GSocket *connection = NULL ; - GSocketError err; - - int arg = 1; assert(socket != NULL); @@ -640,8 +634,6 @@ GSocket *GSocket_WaitConnection(GSocket *socket) */ GSocketError GSocket_SetNonOriented(GSocket *sck) { - int arg = 1; - assert(sck != NULL); if (sck->m_endpoint != kOTInvalidEndpointRef ) @@ -726,12 +718,9 @@ GSocketError GSocket_SetNonOriented(GSocket *sck) */ GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream) { - int ret; - int arg = 1; InetAddress addr ; TEndpointInfo info; - OTFlags flags = 0; - OSStatus err = kOTNoError; + OSStatus err = kOTNoError; TCall peer ; assert(sck != NULL); @@ -932,7 +921,6 @@ int GSocket_Write(GSocket *socket, const char *buffer, int size) */ GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags) { - OTResult state ; assert(socket != NULL); wxMacProcessNotifierEvents() ; /* @@ -1327,8 +1315,6 @@ GSocketError GAddress_INET_SetAnyAddress(GAddress *address) GSocketError GAddress_INET_SetHostAddress(GAddress *address, unsigned long hostaddr) { - struct in_addr *addr; - assert(address != NULL); CHECK_ADDRESS(address, INET, GSOCK_INVADDR); @@ -1354,7 +1340,6 @@ service_entry gServices[] = GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port, const char *protocol) { - InetAddress *addr; int i ; assert(address != NULL); @@ -1389,8 +1374,6 @@ GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port, GSocketError GAddress_INET_SetPort(GAddress *address, unsigned short port) { - InetAddress *addr; - assert(address != NULL); CHECK_ADDRESS(address, INET, GSOCK_INVADDR); address->m_port = port ; diff --git a/src/mac/clipbrd.cpp b/src/mac/clipbrd.cpp index a85398f27f..ff814a588c 100644 --- a/src/mac/clipbrd.cpp +++ b/src/mac/clipbrd.cpp @@ -202,8 +202,6 @@ bool wxClipboard::AddData( wxDataObject *data ) wxCHECK_MSG( data, FALSE, wxT("data is invalid") ); - wxDataFormat format = data->GetPreferredFormat(); - /* we can only store one wxDataObject */ Clear(); @@ -336,7 +334,7 @@ bool wxClipboard::GetData( wxDataObject& data ) { wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") ); - int formatcount = data.GetFormatCount() + 1 ; + size_t formatcount = data.GetFormatCount() + 1 ; wxDataFormat *array = new wxDataFormat[ formatcount ]; array[0] = data.GetPreferredFormat(); data.GetAllFormats( &array[1] ); diff --git a/src/mac/combobox.cpp b/src/mac/combobox.cpp index 0aa01b1a2b..22924613ea 100644 --- a/src/mac/combobox.cpp +++ b/src/mac/combobox.cpp @@ -262,10 +262,6 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxValidator& validator, const wxString& name) { - - Rect bounds ; - Str255 title ; - if ( !wxControl::Create(parent, id, wxDefaultPosition, wxDefaultSize, style , wxDefaultValidator, name) ) { diff --git a/src/mac/control.cpp b/src/mac/control.cpp index c3c915f85b..5998a660fc 100644 --- a/src/mac/control.cpp +++ b/src/mac/control.cpp @@ -819,7 +819,6 @@ void wxControl::OnMouseEvent( wxMouseEvent &event ) ControlHandle control ; Point localwhere ; SInt16 controlpart ; - WindowRef window = (WindowRef) MacGetRootWindow() ; localwhere.h = x ; localwhere.v = y ; @@ -840,20 +839,7 @@ void wxControl::OnMouseEvent( wxMouseEvent &event ) if ( event.m_metaDown ) modifiers |= cmdKey ; -/* -#if TARGET_CARBON - control = FindControlUnderMouse( localwhere , window , &controlpart ) ; -#else - controlpart = FindControl( localwhere , window , &control ) ; -#endif -*/ { - /* - if ( AcceptsFocus() && FindFocus() != this ) - { - SetFocus() ; - } - */ control = (ControlHandle) m_macControl ; if ( control && ::IsControlActive( control ) ) { diff --git a/src/mac/dc.cpp b/src/mac/dc.cpp index 206e960450..ef065b7ac1 100644 --- a/src/mac/dc.cpp +++ b/src/mac/dc.cpp @@ -958,8 +958,8 @@ void wxDC::DoDrawPolygon(int n, wxPoint points[], PolyHandle polygon = OpenPoly(); - x1 = XLOG2DEVMAC(points[0].x + xoffset); - y1 = YLOG2DEVMAC(points[0].y + yoffset); + x2 = x1 = XLOG2DEVMAC(points[0].x + xoffset); + y2 = y1 = YLOG2DEVMAC(points[0].y + yoffset); ::MoveTo(x1,y1); for (int i = 1; i < n; i++) @@ -1439,7 +1439,7 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y, if ( 0 ) { m_macFormerAliasState = IsAntiAliasedTextEnabled(&m_macFormerAliasSize); - SetAntiAliasedTextEnabled(true, m_scaleY * font->m_macFontSize); + SetAntiAliasedTextEnabled(true, SInt16(m_scaleY * font->m_macFontSize)); m_macAliasWasEnabled = true ; } @@ -1467,9 +1467,10 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y, &chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ; wxASSERT_MSG( status == noErr , "couldn't create the layout of the rotated text" ); - if ( abs(angle) > 0 ) + int iAngle = int( angle ); + if ( abs(iAngle) > 0 ) { - Fixed atsuAngle = IntToFixed( angle ) ; + Fixed atsuAngle = IntToFixed( iAngle ) ; ByteCount angleSize = sizeof(Fixed) ; ATSUAttributeTag rotationTag = kATSULineRotationTag ; ATSUAttributeValuePtr angleValue = &atsuAngle ; @@ -1865,7 +1866,7 @@ void wxDC::MacInstallFont() const OSStatus status = noErr ; - Fixed atsuSize = IntToFixed(m_scaleY * font->m_macFontSize) ; + Fixed atsuSize = IntToFixed( int(m_scaleY * font->m_macFontSize) ) ; Style qdStyle = font->m_macFontStyle ; ATSUFontID atsuFont = font->m_macATSUFontID ; @@ -1934,13 +1935,13 @@ void wxDC::MacInstallFont() const Pattern gHatchPatterns[] = { - { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF } , - { 0x01 , 0x02 , 0x04 , 0x08 , 0x10 , 0x20 , 0x40 , 0x80 } , - { 0x80 , 0x40 , 0x20 , 0x10 , 0x08 , 0x04 , 0x02 , 0x01 } , - { 0x10 , 0x10 , 0x10 , 0xFF , 0x10 , 0x10 , 0x10 , 0x10 } , - { 0x00 , 0x00 , 0x00 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 } , - { 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 } , - { 0x81 , 0x42 , 0x24 , 0x18 , 0x18 , 0x24 , 0x42 , 0x81 } , + { { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF } }, + { { 0x01 , 0x02 , 0x04 , 0x08 , 0x10 , 0x20 , 0x40 , 0x80 } }, + { { 0x80 , 0x40 , 0x20 , 0x10 , 0x08 , 0x04 , 0x02 , 0x01 } }, + { { 0x10 , 0x10 , 0x10 , 0xFF , 0x10 , 0x10 , 0x10 , 0x10 } }, + { { 0x00 , 0x00 , 0x00 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 } }, + { { 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 } }, + { { 0x81 , 0x42 , 0x24 , 0x18 , 0x18 , 0x24 , 0x42 , 0x81 } } } ; static void wxMacGetHatchPattern(int hatchStyle, Pattern *pattern) @@ -2040,7 +2041,6 @@ void wxDC::MacInstallPen() const case wxUSER_DASH : { wxDash* dash ; - int number = m_pen.GetDashes(&dash) ; // right now we don't allocate larger pixmaps for ( int i = 0 ; i < 8 ; ++i ) { diff --git a/src/mac/dcprint.cpp b/src/mac/dcprint.cpp index 1f36616c8f..6c32de8ad0 100644 --- a/src/mac/dcprint.cpp +++ b/src/mac/dcprint.cpp @@ -150,8 +150,8 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata) m_ok = FALSE; return; } - 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 ; diff --git a/src/mac/dirmac.cpp b/src/mac/dirmac.cpp index 129f61a754..0ccaf0b8e9 100644 --- a/src/mac/dirmac.cpp +++ b/src/mac/dirmac.cpp @@ -119,6 +119,7 @@ wxDirData::wxDirData(const wxString& dirname) m_index = 0 ; OSErr err = FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ; + wxASSERT_MSG( err == noErr , "Error accessing directory") ; } wxDirData::~wxDirData() diff --git a/src/mac/frame.cpp b/src/mac/frame.cpp index 4fe1aec422..4d83421744 100644 --- a/src/mac/frame.cpp +++ b/src/mac/frame.cpp @@ -132,7 +132,8 @@ bool wxFrame::Enable(bool enable) if ( m_frameMenuBar && m_frameMenuBar == wxMenuBar::MacGetInstalledMenuBar() ) { - for ( int i = 0 ; i < m_frameMenuBar->GetMenuCount() ; ++ i ) + int iMaxMenu = m_frameMenuBar->GetMenuCount(); + for ( int i = 0 ; i < iMaxMenu ; ++ i ) { m_frameMenuBar->EnableTop( i , enable ) ; } diff --git a/src/mac/gsocket.c b/src/mac/gsocket.c index bbeaa29fcf..b96cd92358 100644 --- a/src/mac/gsocket.c +++ b/src/mac/gsocket.c @@ -473,9 +473,6 @@ GAddress *GSocket_GetPeer(GSocket *socket) */ GSocketError GSocket_SetServer(GSocket *sck) { - int type; - int arg = 1; - assert(sck != NULL); /* must not be in use */ @@ -545,9 +542,6 @@ GSocketError GSocket_SetServer(GSocket *sck) GSocket *GSocket_WaitConnection(GSocket *socket) { GSocket *connection = NULL ; - GSocketError err; - - int arg = 1; assert(socket != NULL); @@ -640,8 +634,6 @@ GSocket *GSocket_WaitConnection(GSocket *socket) */ GSocketError GSocket_SetNonOriented(GSocket *sck) { - int arg = 1; - assert(sck != NULL); if (sck->m_endpoint != kOTInvalidEndpointRef ) @@ -726,12 +718,9 @@ GSocketError GSocket_SetNonOriented(GSocket *sck) */ GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream) { - int ret; - int arg = 1; InetAddress addr ; TEndpointInfo info; - OTFlags flags = 0; - OSStatus err = kOTNoError; + OSStatus err = kOTNoError; TCall peer ; assert(sck != NULL); @@ -932,7 +921,6 @@ int GSocket_Write(GSocket *socket, const char *buffer, int size) */ GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags) { - OTResult state ; assert(socket != NULL); wxMacProcessNotifierEvents() ; /* @@ -1327,8 +1315,6 @@ GSocketError GAddress_INET_SetAnyAddress(GAddress *address) GSocketError GAddress_INET_SetHostAddress(GAddress *address, unsigned long hostaddr) { - struct in_addr *addr; - assert(address != NULL); CHECK_ADDRESS(address, INET, GSOCK_INVADDR); @@ -1354,7 +1340,6 @@ service_entry gServices[] = GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port, const char *protocol) { - InetAddress *addr; int i ; assert(address != NULL); @@ -1389,8 +1374,6 @@ GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port, GSocketError GAddress_INET_SetPort(GAddress *address, unsigned short port) { - InetAddress *addr; - assert(address != NULL); CHECK_ADDRESS(address, INET, GSOCK_INVADDR); address->m_port = port ; diff --git a/src/mac/morefile/DirectoryCopy.c b/src/mac/morefile/DirectoryCopy.c index ed9c834718..dd484c9b2c 100644 --- a/src/mac/morefile/DirectoryCopy.c +++ b/src/mac/morefile/DirectoryCopy.c @@ -260,7 +260,7 @@ static void CopyLevel(long sourceDirID, long dstDirID, EnumerateGlobals *theGlobals) { - long currentSrcDirID; + long currentSrcDirID = 0 ; long newDirID; short index = 1; @@ -325,6 +325,7 @@ static void CopyLevel(long sourceDirID, } else /* error handling for DirCreate */ { + /* note that currentSrcDirID has not been initialised when entering this execution path */ if ( theGlobals->errorHandler != NULL ) { theGlobals->bailout = CallCopyErrProc(theGlobals->errorHandler, theGlobals->error, dirCreateOp, diff --git a/src/mac/morefile/Search.c b/src/mac/morefile/Search.c index 6f7953b830..d03154a5ee 100644 --- a/src/mac/morefile/Search.c +++ b/src/mac/morefile/Search.c @@ -762,7 +762,7 @@ pascal OSErr IndexedSearch(CSParamPtr pb, static Size searchStackSize = 0; /* size of static handle */ SearchPositionRecPtr catPosition; long modDate; - short index; + short index = -1 ; ExtendedTMTask timerTask; OSErr result; short realVRefNum;