]> git.saurik.com Git - wxWidgets.git/commitdiff
some really minor changes (the most important one: small memory hole in
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 12 Jan 1999 23:44:03 +0000 (23:44 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 12 Jan 1999 23:44:03 +0000 (23:44 +0000)
wxList plugged)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/tlog.tex
src/common/file.cpp
src/common/list.cpp
src/common/resource.cpp
src/msw/window.cpp

index 0cb7fccfcf4e671a2529a6a5e7d43b7018287cb9..0cdc28760775c2d531a6142edb50f6fa24cda434 100644 (file)
@@ -1,11 +1,10 @@
 \section{Log classes overview}\label{wxlogoverview}
 
-Classes: \helpref{wxLog}{wxlog}
-
-%\helpref{wxLogStderr}{wxlogstderr},%
-%\helpref{wxLogOstream}{wxlogostream}, \helpref{wxLogTextCtrl}{wxlogtextctrl},%
-%\helpref{wxLogWindow}{wxlogwindow}, \helpref{wxLogGui}{wxloggui},%
-%\helpref{wxLogNull}{wxlognull}%
+Classes: \helpref{wxLog}{wxlog}\\
+\helpref{wxLogStderr}{wxlogstderr},\\
+\helpref{wxLogOstream}{wxlogostream}, \helpref{wxLogTextCtrl}{wxlogtextctrl},\\
+\helpref{wxLogWindow}{wxlogwindow}, \helpref{wxLogGui}{wxloggui},\\
+\helpref{wxLogNull}{wxlognull}
 
 This is a general overview of logging classes provided by wxWindows. The word
 logging here has a broad sense, including all of the program output, not only
@@ -126,8 +125,8 @@ clear the log, close it completely or save all messages to file.
 \item{\bf wxLogNull} The last log class is quite particular: it doesn't do
 anything. The objects of this class may be instantiated to (temporarily)
 suppress output of {\it wxLogXXX()} functions. As an example, trying to open a
-non-existing file will usually provoke an error message, but if you for some
-reason it's unwanted, just use this construction:
+non-existing file will usually provoke an error message, but if for some
+reasons it's unwanted, just use this construction:
 
 {\small
 \begin{verbatim}
index 9a8684002bf177287cd0b9c5da1fd133af6c3a7b..016c199ca16f93ca29cda0a84b2ff30de81be300 100644 (file)
@@ -301,12 +301,15 @@ size_t wxFile::Write(const void *pBuf, size_t nCount)
 bool wxFile::Flush()
 {
   if ( IsOpened() ) {
-               // @@@ fsync() is not ANSI (BSDish)
-//    if ( fsync(m_fd) == -1 ) { // TODO
-      if (wxTrue) {
-      wxLogSysError(_("can't flush file descriptor %d"), m_fd);
-      return FALSE;
-    }
+    #if defined(_MSC_VER) || wxHAVE_FSYNC
+        if ( fsync(m_fd) == -1 )
+        {
+            wxLogSysError(_("can't flush file descriptor %d"), m_fd);
+            return FALSE;
+        }
+    #else // no fsync
+        // just do nothing
+    #endif // fsync
   }
 
   return TRUE;
index 4cb8cf8f7539c2a23c72f9ed8b9de529ed4db5d6..4eeacc5bb3f56023b76f295decb6c4ef4f2f9ea2 100644 (file)
@@ -120,6 +120,11 @@ wxNodeBase::~wxNodeBase()
     // compatibility with old code
     if ( m_list != NULL )
     {
+        if ( m_list->m_keyType == wxKEY_STRING )
+        {
+            free(m_key.string);
+        }
+
         m_list->DetachNode(this);
     }
 }
@@ -348,6 +353,8 @@ void wxListBase::DoDeleteNode(wxNodeBase *node)
         node->DeleteData();
     }
 
+    // so that the node knows that it's being deleted by the list
+    node->m_list = NULL;
     delete node;
 }
 
index 436565d0ed2c7220c76ebf0fa6a5036fa4396980..031a211c74df3753e26ec98207bcbd638238b8d6 100644 (file)
@@ -559,17 +559,33 @@ bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db)
   return TRUE;
 }
 
-static char *g_ValidControlClasses[] = { "wxButton", "wxBitmapButton", "wxMessage",
- "wxStaticText", "wxStaticBitmap", "wxText", "wxTextCtrl", "wxMultiText",
- "wxListBox", "wxRadioBox", "wxRadioButton", "wxCheckBox", "wxBitmapCheckBox",
- "wxGroupBox", "wxStaticBox", "wxSlider", "wxGauge", "wxScrollBar",
- "wxChoice", "wxComboBox" } ;
-static int g_ValidControlClassesCount = sizeof(g_ValidControlClasses) / sizeof(char *) ;
+static const char *g_ValidControlClasses[] =
+{
+    "wxButton",
+    "wxBitmapButton",
+    "wxMessage",
+    "wxStaticText",
+    "wxStaticBitmap",
+    "wxText",
+    "wxTextCtrl",
+    "wxMultiText",
+    "wxListBox",
+    "wxRadioBox",
+    "wxRadioButton",
+    "wxCheckBox",
+    "wxBitmapCheckBox",
+    "wxGroupBox",
+    "wxStaticBox",
+    "wxSlider",
+    "wxGauge",
+    "wxScrollBar",
+    "wxChoice",
+    "wxComboBox"
+};
 
 static bool wxIsValidControlClass(const wxString& c)
 {
-   int i;
-   for ( i = 0; i < g_ValidControlClassesCount; i++)
+   for ( size_t i = 0; i < WXSIZEOF(g_ValidControlClasses); i++ )
    {
       if ( c == g_ValidControlClasses[i] )
          return TRUE;
index 2d3212aaedf3e51959d375af150d153c0091ac72..f8b44aa487282c94db6da5872e30ce8b425d8325 100644 (file)
@@ -17,7 +17,7 @@
 #include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
-#pragma hdrstop
+    #pragma hdrstop
 #endif
 
 #ifndef WX_PRECOMP
 #endif
 
 #if     wxUSE_OWNER_DRAWN
-#include "wx/ownerdrw.h"
+    #include "wx/ownerdrw.h"
 #endif
 
 #if     wxUSE_DRAG_AND_DROP
-#include "wx/msw/ole/droptgt.h"
+    #include "wx/msw/ole/droptgt.h"
 #endif
 
 #include "wx/menuitem.h"
@@ -82,7 +82,7 @@
 #endif
 
 #ifdef  __WXDEBUG__
-const char *wxGetMessageName(int message);
+    const char *wxGetMessageName(int message);
 #endif  //__WXDEBUG__
 
 #define WINDOW_MARGIN 3 // This defines sensitivity of Leave events
@@ -841,7 +841,6 @@ LRESULT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
         wxWndHook = NULL;
         wnd->m_hWnd = (WXHWND) hWnd;
     }
-    //    wxDebugMsg("hWnd = %d, m_hWnd = %d, msg = %d\n", hWnd, m_hWnd, message);
 
     // Stop right here if we don't have a valid handle
     // in our wxWnd object.
@@ -866,17 +865,16 @@ LRESULT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
 
 // Should probably have a test for 'genuine' NT
 #if defined(__WIN32__)
-#define DIMENSION_TYPE short
+    #define DIMENSION_TYPE short
 #else
-#define DIMENSION_TYPE int
+    #define DIMENSION_TYPE int
 #endif
 
 // Main Windows 3 window proc
 long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
 {
     wxASSERT( m_lastMsg == message &&
-        m_lastWParam == wParam &&
-        m_lastLParam == lParam );
+              m_lastWParam == wParam && m_lastLParam == lParam );
 
 #ifdef __WXDEBUG__
     wxLogTrace(wxTraceMessages, "Processing %s(%lx, %lx)",