]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/colour.cpp
fixed unreachable code warnings (occurred in MSVC6+Release mode)
[wxWidgets.git] / src / x11 / colour.cpp
index f62111a9098b9a733b655c7733d487c554fd9b33..1951c3e224bc1e37ed5cb2bec29fbf7033df9585 100644 (file)
@@ -1,19 +1,14 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        colour.cpp
+// Name:        src/x11/colour.cpp
 // Purpose:     wxColour class
 // Author:      Julian Smart, Robert Roebling
 // Modified by:
 // Created:     17/09/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart, Robert Roebling
-// Licence:    wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "colour.h"
-#endif
-
 #include "wx/gdicmn.h"
 #include "wx/app.h"
 
@@ -93,8 +88,9 @@ void wxColourRefData::FreeColour()
     if (!m_colormap)
         return;
 #if !wxUSE_NANOX
-    if ((wxTheApp->m_visualInfo->m_visualType == GrayScale) ||
-        (wxTheApp->m_visualInfo->m_visualType == PseudoColor))
+    if ( wxTheApp &&
+         (wxTheApp->m_visualInfo->m_visualType == GrayScale ||
+          wxTheApp->m_visualInfo->m_visualType == PseudoColor) )
     {
         int idx = m_color.pixel;
         colMapAllocCounter[ idx ] = colMapAllocCounter[ idx ] - 1;
@@ -213,7 +209,7 @@ bool wxColour::operator == ( const wxColour& col ) const
 
     return (own->red == other->red)
         && (own->green == other->green)
-        && (own->blue == other->blue)
+        && (own->blue == other->blue) ;
 
 }
 
@@ -231,7 +227,6 @@ void wxColour::Set( unsigned char red, unsigned char green, unsigned char blue )
 {
     AllocExclusive();
 
-    m_refData = new wxColourRefData();
 #if wxUSE_NANOX
     M_COLDATA->m_color.red = ((unsigned short)red) ;
     M_COLDATA->m_color.green = ((unsigned short)green) ;