]> git.saurik.com Git - wxWidgets.git/commitdiff
Eliminated some warnings under Windows; wxGetHomeDir problem in wxFile;
authorJulian Smart <julian@anthemion.co.uk>
Thu, 10 Sep 1998 11:41:14 +0000 (11:41 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 10 Sep 1998 11:41:14 +0000 (11:41 +0000)
eliminated memory leak report by making class table dynamically allocated/freed;
tidied up names in wxClassInfo.

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

19 files changed:
docs/msw/changes.txt
include/wx/dynlib.h
include/wx/fstream.h
include/wx/object.h
include/wx/socket.h
include/wx/stream.h
src/common/dynlib.cpp
src/common/extended.c
src/common/memory.cpp
src/common/module.cpp
src/common/object.cpp
src/common/socket.cpp
src/common/stream.cpp
src/gtk/app.cpp
src/gtk1/app.cpp
src/msw/app.cpp
src/msw/makefile.nt
user/wxFile/dirctrl.cpp
user/wxFile/wxFile.cpp

index 9e1d0ca6520fdc2482d3a97deead2e18deefd817..e15f54455bf7c97de0dbe14137773af4f5aa1aa5 100644 (file)
@@ -2,6 +2,17 @@
 wxWindows 2.0 for Windows Change Log
 ------------------------------------
 
+Alpha 16, September 8th 1998
+----------------------------
+
+- Added wxSashWindow, wxSashLayoutWindow classes, and sashtest
+  sample.
+- Guilhem's socket classes added, plus wxsocket sample.
+- A few more makefiles added.
+- GnuWin32/BC++ compatibility mods.
+- Further doc updates.
+- wxProp updates for correct working with wxGTK.
+
 Alpha 15, August 31st 1998
 --------------------------
 
index cebc563b7efde284154242c5aa000aac30a17f43..39db5aa6adc5863850ac377b2c610bce8c9a8d36 100644 (file)
 #include <wx/dynarray.h>
 #include <wx/hash.h>
 
+#ifdef LoadLibrary
+#undef LoadLibrary
+#endif
+
 // ---------------------------------------------------------------------------
 // wxLibrary
 
index 0c8dd722961e504fae8ce7206b1d41bd3b0e4b3e..2c1f320f855f8a23a2ba67b98467d59a146671ab 100644 (file)
@@ -8,14 +8,26 @@
 // Copyright:   (c) Guilhem Lavaux
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifndef _WX_WXFSTREAM_H__
 #define _WX_WXFSTREAM_H__
 
+#ifdef __GNUG__
+#pragma interface "fstream.h"
+#endif
+
 #include <wx/object.h>
 #include <wx/string.h>
 #include <wx/stream.h>
 #include <wx/file.h>
 
+// Disable warnings such as
+// 'wxFileStream' : inherits 'wxFileInputStream::Peek' via dominance
+
+#ifdef _MSC_VER
+#pragma warning(disable:4250)
+#endif
+
 class wxFileStreamBase {
 protected:
   wxFile *m_file;
@@ -69,4 +81,8 @@ class wxFileStream: public wxStream,
   virtual ~wxFileStream();
 };
 
+#ifdef _MSC_VER
+#pragma warning(default:4250)
+#endif
+
 #endif
index 314c1c6f5a23bee8cb06b3445a8ea0b1ff72c5c7..83b86a7d086b4228b9764ed81a670b5d99926461 100644 (file)
@@ -45,38 +45,48 @@ typedef wxObject * (*wxObjectConstructorFn) (void);
 class WXDLLEXPORT wxClassInfo
 {
  public:
-   char *className;
-   char *baseClassName1;
-   char *baseClassName2;
-   int objectSize;
-   wxObjectConstructorFn objectConstructor;
-   
-   // Pointers to base wxClassInfos: set in InitializeClasses
-   // called from wx_main.cc
-   wxClassInfo *baseInfo1;
-   wxClassInfo *baseInfo2;
-
-   static wxClassInfo *first;
-   wxClassInfo *next;
-
-   static wxHashTable classTable;
-
    wxClassInfo(char *cName, char *baseName1, char *baseName2, int sz, wxObjectConstructorFn fn);
 
    wxObject *CreateObject(void);
    
-   inline char *GetClassName(void) const { return className; }
-   inline char *GetBaseClassName1(void) const { return baseClassName1; }
-   inline char *GetBaseClassName2(void) const { return baseClassName2; }
-   inline int GetSize(void) const { return objectSize; }
+   inline char *GetClassName(void) const { return m_className; }
+   inline char *GetBaseClassName1(void) const { return m_baseClassName1; }
+   inline char *GetBaseClassName2(void) const { return m_baseClassName2; }
+   inline wxClassInfo* GetBaseClass1() const { return m_baseInfo1; }
+   inline wxClassInfo* GetBaseClass2() const { return m_baseInfo2; }
+   inline int GetSize(void) const { return m_objectSize; }
+   inline wxObjectConstructorFn GetConstructor() const { return m_objectConstructor; }
+   inline wxClassInfo* GetFirst() const { return sm_first; }
+   inline wxClassInfo* GetNext() const { return m_next; }
    bool IsKindOf(wxClassInfo *info);
 
    static wxClassInfo *FindClass(char *c);
-   // Initializes parent pointers for fast searching.
+
+   // Initializes parent pointers and hash table for fast searching.
    static void InitializeClasses(void);
+
+   // Cleans up hash table used for fast searching.
+   static void CleanUpClasses(void);
+
+public:
+   char*                    m_className;
+   char*                    m_baseClassName1;
+   char*                    m_baseClassName2;
+   int                      m_objectSize;
+   wxObjectConstructorFn    m_objectConstructor;
+   
+   // Pointers to base wxClassInfos: set in InitializeClasses
+   // called from wx_main.cc
+   wxClassInfo*             m_baseInfo1;
+   wxClassInfo*             m_baseInfo2;
+
+   static wxClassInfo*      sm_first;
+   wxClassInfo*             m_next;
+
+   static wxHashTable*      sm_classTable;
 };
 
-wxObject* WXDLLEXPORT wxCreateDynamicObject(char *name);
+wxObject* WXDLLEXPORT wxCreateDynamicObject(const char *name);
 
 #ifdef USE_SERIAL
 wxObject* WXDLLEXPORT wxCreateStoredObject( wxInputStream& stream );
@@ -84,9 +94,9 @@ wxObject* WXDLLEXPORT wxCreateStoredObject( wxInputStream& stream );
 
 #define DECLARE_DYNAMIC_CLASS(name) \
  public:\
-  static wxClassInfo class##name;\
+  static wxClassInfo sm_class##name;\
   wxClassInfo *GetClassInfo() \
-   { return &name::class##name; }
+   { return &name::sm_class##name; }
 
 #define DECLARE_ABSTRACT_CLASS(name) DECLARE_DYNAMIC_CLASS(name)
 #define DECLARE_CLASS(name) DECLARE_DYNAMIC_CLASS(name)
@@ -99,13 +109,13 @@ wxObject* WXDLLEXPORT wxCreateStoredObject( wxInputStream& stream );
 #define IMPLEMENT_DYNAMIC_CLASS(name, basename) \
 wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
    { return new name; }\
- wxClassInfo name::class##name((char *) #name, (char *) #basename, (char *) NULL, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
+ wxClassInfo name::sm_class##name((char *) #name, (char *) #basename, (char *) NULL, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
 
 // Multiple inheritance with two base classes
 #define IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) \
 wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
    { return new name; }\
- wxClassInfo name::class##name((char *) #name, (char *) #basename1, (char *) #basename2, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
+ wxClassInfo name::sm_class##name((char *) #name, (char *) #basename1, (char *) #basename2, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
 
 //////
 ////// for abstract classes
@@ -113,17 +123,17 @@ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
 
 // Single inheritance with one base class
 #define IMPLEMENT_ABSTRACT_CLASS(name, basename) \
- wxClassInfo name::class##name((char *) #name, (char *) #basename, \
+ wxClassInfo name::sm_class##name((char *) #name, (char *) #basename, \
                 (char *) NULL, (int) sizeof(name), (wxObjectConstructorFn) NULL);
 
 // Multiple inheritance with two base classes
 #define IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \
- wxClassInfo name::class##name((char *) #name, (char *) #basename1, (char *) #basename2, (int) sizeof(name), (wxObjectConstructorFn) NULL);
+ wxClassInfo name::sm_class##name((char *) #name, (char *) #basename1, (char *) #basename2, (int) sizeof(name), (wxObjectConstructorFn) NULL);
 
 #define IMPLEMENT_CLASS IMPLEMENT_ABSTRACT_CLASS
 #define IMPLEMENT_CLASS2 IMPLEMENT_ABSTRACT_CLASS2
 
-#define CLASSINFO(name) (&name::class##name)
+#define CLASSINFO(name) (&name::sm_class##name)
 
 #else
 
@@ -140,7 +150,7 @@ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
 
 #endif
 
-#define IS_KIND_OF(obj, className) obj->IsKindOf(&className::class##className)
+#define IS_KIND_OF(obj, className) obj->IsKindOf(&className::sm_class##className)
 
 // Unfortunately Borland seems to need this include.
 #ifdef __BORLANDC__
@@ -158,12 +168,12 @@ class WXDLLEXPORT wxObject
  public:
 
   // This is equivalent to using the macro DECLARE_ABSTRACT_CLASS
-  static wxClassInfo classwxObject;
+  static wxClassInfo sm_classwxObject;
 
   wxObject(void);
   virtual ~wxObject(void);
 
-  virtual wxClassInfo *GetClassInfo(void) { return &classwxObject; }
+  virtual wxClassInfo *GetClassInfo(void) { return &sm_classwxObject; }
 
   bool IsKindOf(wxClassInfo *info);
 
@@ -198,9 +208,9 @@ class WXDLLEXPORT wxObject
   inline void SetRefData(wxObjectRefData *data) { m_refData = data; }
 
 protected:
-  wxObjectRefData *m_refData;
+  wxObjectRefData*      m_refData;
 #ifdef USE_SERIAL
-  wxObject_Serialize *m_serialObj;
+  wxObject_Serialize*   m_serialObj;
 #endif
 };
 
index a65b4683cd1102db7664abed20a9459f9dfef217..b81f609ec4c3fd00bc973978e1d1d1ead5d76268 100644 (file)
@@ -8,11 +8,12 @@
 // Copyright:   (c) Guilhem Lavaux
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifndef _WX_NETWORK_SOCKET_H
 #define _WX_NETWORK_SOCKET_H
 
 #ifdef __GNUG__
-#pragma interface
+#pragma interface "socket.h"
 #endif
 
 // ---------------------------------------------------------------------------
index b467990588641fa6b0c43d9b558a80328a4b7299..3013273cba314892e795fb16b2e8087d5cb30b74 100644 (file)
@@ -29,6 +29,13 @@ typedef wxOutputStream& (*__wxOutputManip)(wxOutputStream&);
 
 wxOutputStream& WXDLLEXPORT wxEndL(wxOutputStream& o_stream);
 
+// Disable warnings such as
+// 'wxFilterStream' : inherits 'wxFilterInputStream::Peek' via dominance
+
+#ifdef _MSC_VER
+#pragma warning(disable:4250)
+#endif
+
 // ---------------------------------------------------------------------------
 // Stream buffer
 // ---------------------------------------------------------------------------
@@ -244,4 +251,8 @@ class WXDLLEXPORT wxFilterStream: public wxStream,
   wxFilterStream();
 };
 
+#ifdef _MSC_VER
+#pragma warning(default:4250)
+#endif
+
 #endif
index 9c5a7771099496dcc9bfce8429cf3e37e1702e8a..2fd32ddd586b3d5cade90e041a3e677898061baa 100644 (file)
 #pragma implementation "dynlib.h"
 #endif
 
+#include  "wx/wxprec.h"
+
+#ifdef    __BORLANDC__
+  #pragma hdrstop
+#endif  //__BORLANDC__
+
+#ifndef WX_PRECOMP
+#endif //WX_PRECOMP
+
 #include <wx/dynlib.h>
 #include <wx/filefn.h>
 #include <wx/list.h>
@@ -87,9 +96,9 @@ void wxLibrary::PrepareClasses(wxClassInfo **first)
   wxClassInfo *info = *first;
   while (info)
   {
-    if (info->className)
-      classTable.Put(info->className, (wxObject *)info);
-    info = info->next;
+    if (info->m_className)
+      classTable.Put(info->m_className, (wxObject *)info);
+    info = info->m_next;
   }
 
   // Set base pointers for each wxClassInfo
@@ -97,10 +106,10 @@ void wxLibrary::PrepareClasses(wxClassInfo **first)
   while (info)
   {
     if (info->GetBaseClassName1())
-      info->baseInfo1 = (wxClassInfo *)classTable.Get(info->GetBaseClassName1());
+      info->m_baseInfo1 = (wxClassInfo *)classTable.Get(info->GetBaseClassName1());
     if (info->GetBaseClassName2())
-      info->baseInfo2 = (wxClassInfo *)classTable.Get(info->GetBaseClassName2());
-    info = info->next;
+      info->m_baseInfo2 = (wxClassInfo *)classTable.Get(info->GetBaseClassName2());
+    info = info->m_next;
   }
   *first = NULL;
 }
@@ -111,7 +120,7 @@ void *wxLibrary::GetSymbol(const wxString& symbname)
   return dlsym(m_handle, WXSTRINGCAST symbname);
 #endif
 #ifdef __WINDOWS__
-  return GetProcAddress(m_handle, WXSTRINGCAST symbname);
+  return GetProcAddress((HINSTANCE) m_handle, WXSTRINGCAST symbname);
 #endif
   return NULL;
 }
index d77950456dd9ab6f6b7af40e839ccb913f1cc0bf..ff117982e01fa2246820a974e776d850edf30038 100644 (file)
@@ -84,14 +84,14 @@ void ConvertToIeeeExtended(double num, unsigned char *bytes)
 
        bytes[0] = expon >> 8;
        bytes[1] = expon;
-       bytes[2] = hiMant >> 24;
-       bytes[3] = hiMant >> 16;
-       bytes[4] = hiMant >> 8;
-       bytes[5] = hiMant;
-       bytes[6] = loMant >> 24;
-       bytes[7] = loMant >> 16;
-       bytes[8] = loMant >> 8;
-       bytes[9] = loMant;
+       bytes[2] = (unsigned char) hiMant >> 24;
+       bytes[3] = (unsigned char) hiMant >> 16;
+       bytes[4] = (unsigned char) hiMant >> 8;
+       bytes[5] = (unsigned char) hiMant;
+       bytes[6] = (unsigned char) loMant >> 24;
+       bytes[7] = (unsigned char) loMant >> 16;
+       bytes[8] = (unsigned char) loMant >> 8;
+       bytes[9] = (unsigned char) loMant;
 }
 
 /*
index a3dbce75165a34f77a74b07efdebfbe4d4bac270..01f70591f97eb8440e360a1cdfd91ce3c713ea1a 100644 (file)
@@ -788,8 +788,8 @@ bool wxDebugContext::PrintClasses(void)
   wxNode *node;
   wxClassInfo *info;
 
-  wxClassInfo::classTable.BeginFind();
-  node = wxClassInfo::classTable.Next();
+  wxClassInfo::sm_classTable->BeginFind();
+  node = wxClassInfo::sm_classTable->Next();
   while (node)
   {
     info = (wxClassInfo *)node->Data();
@@ -801,7 +801,7 @@ bool wxDebugContext::PrintClasses(void)
         wxTrace("is a %s", info->GetBaseClassName1());
       else if (info->GetBaseClassName1() && info->GetBaseClassName2())
         wxTrace("is a %s, %s", info->GetBaseClassName1(), info->GetBaseClassName2());
-      if (info->objectConstructor)
+      if (info->GetConstructor())
         wxTrace(": dynamic\n");
       else
         wxTrace("\n");
index 57c8a312cce40270e7a4977fc9a54fe8ca3738b9..b18af89b14b42598130b0b76fe178dd5a3e885c9 100644 (file)
@@ -39,18 +39,18 @@ bool wxModule::RegisterModules(void)
     wxNode *node;
     wxClassInfo* classInfo;
 
-    wxClassInfo::classTable.BeginFind();
-    node = wxClassInfo::classTable.Next();
+    wxClassInfo::sm_classTable->BeginFind();
+    node = wxClassInfo::sm_classTable->Next();
     while (node)
     {
         classInfo = (wxClassInfo *)node->Data();
-        if ((classInfo != (& (wxModule::classwxModule))) &&
+        if ((classInfo != (& (wxModule::sm_classwxModule))) &&
             classInfo->IsKindOf(CLASSINFO(wxModule)))
         {
             wxModule* module = (wxModule*) classInfo->CreateObject();
             RegisterModule(module);
         }
-        node = wxClassInfo::classTable.Next();
+        node = wxClassInfo::sm_classTable->Next();
     }
     return TRUE;
 }
index 8cbdcef7c4b6b5cda369163ad7c8b02d64ec9f84..6d293b0569bbd1e9f1e350bffbab9905c3c877c5 100644 (file)
@@ -41,9 +41,9 @@
 #endif
 
 #if !USE_SHARED_LIBRARY
-wxClassInfo wxObject::classwxObject((char *) "wxObject", (char *) NULL, (char *) NULL, (int ) sizeof(wxObject), (wxObjectConstructorFn) NULL);
-wxClassInfo *wxClassInfo::first = (wxClassInfo *) NULL;
-wxHashTable wxClassInfo::classTable(wxKEY_STRING);
+wxClassInfo wxObject::sm_classwxObject((char *) "wxObject", (char *) NULL, (char *) NULL, (int ) sizeof(wxObject), (wxObjectConstructorFn) NULL);
+wxClassInfo* wxClassInfo::sm_first = (wxClassInfo *) NULL;
+wxHashTable* wxClassInfo::sm_classTable = (wxHashTable*) NULL;
 #endif
 
 /*
@@ -130,36 +130,36 @@ void wxObject::operator delete[] (void * buf)
 
 wxClassInfo::wxClassInfo(char *cName, char *baseName1, char *baseName2, int sz, wxObjectConstructorFn constr)
 {
-  className = cName;
-  baseClassName1 = baseName1;
-  baseClassName2 = baseName2;
+  m_className = cName;
+  m_baseClassName1 = baseName1;
+  m_baseClassName2 = baseName2;
 
-  objectSize = sz;
-  objectConstructor = constr;
+  m_objectSize = sz;
+  m_objectConstructor = constr;
   
-  next = first;
-  first = this;
+  m_next = sm_first;
+  sm_first = this;
 
-  baseInfo1 = (wxClassInfo *) NULL;
-  baseInfo2 = (wxClassInfo *) NULL;
+  m_baseInfo1 = (wxClassInfo *) NULL;
+  m_baseInfo2 = (wxClassInfo *) NULL;
 }
 
 wxObject *wxClassInfo::CreateObject(void)
 {
-  if (objectConstructor)
-    return (wxObject *)(*objectConstructor)();
+  if (m_objectConstructor)
+    return (wxObject *)(*m_objectConstructor)();
   else
     return (wxObject *) NULL;
 }
 
 wxClassInfo *wxClassInfo::FindClass(char *c)
 {
-  wxClassInfo *p = first;
+  wxClassInfo *p = sm_first;
   while (p)
   {
     if (p && p->GetClassName() && strcmp(p->GetClassName(), c) == 0)
       return p;
-    p = p->next;
+    p = p->m_next;
   }
   return (wxClassInfo *) NULL;
 }
@@ -174,20 +174,22 @@ bool wxClassInfo::IsKindOf(wxClassInfo *info)
   // For some reason, when making/using a DLL, static data has to be included
   // in both the DLL and the application. This can lead to duplicate
   // wxClassInfo objects, so we have to test the name instead of the pointers.
+  // PROBABLY NO LONGER TRUE now I've done DLL creation right.
+/*
 #if WXMAKINGDLL
   if (GetClassName() && info->GetClassName() && (strcmp(GetClassName(), info->GetClassName()) == 0))
     return TRUE;
 #else
+*/
   if (this == info)
     return TRUE;
-#endif
 
-  if (baseInfo1)
-    if (baseInfo1->IsKindOf(info))
+  if (m_baseInfo1)
+    if (m_baseInfo1->IsKindOf(info))
       return TRUE;
 
-  if (baseInfo2)
-    return baseInfo2->IsKindOf(info);
+  if (m_baseInfo2)
+    return m_baseInfo2->IsKindOf(info);
 
   return FALSE;
 }
@@ -195,37 +197,58 @@ bool wxClassInfo::IsKindOf(wxClassInfo *info)
 // Set pointers to base class(es) to speed up IsKindOf
 void wxClassInfo::InitializeClasses(void)
 {
+  wxClassInfo::sm_classTable = new wxHashTable(wxKEY_STRING);
+
   // Index all class infos by their class name
-  wxClassInfo *info = first;
+  wxClassInfo *info = sm_first;
   while (info)
   {
-    if (info->className)
-      classTable.Put(info->className, (wxObject *)info);
-    info = info->next;
+    if (info->m_className)
+      sm_classTable->Put(info->m_className, (wxObject *)info);
+    info = info->m_next;
   }
 
   // Set base pointers for each wxClassInfo
-  info = first;
+  info = sm_first;
   while (info)
   {
     if (info->GetBaseClassName1())
-      info->baseInfo1 = (wxClassInfo *)classTable.Get(info->GetBaseClassName1());
+      info->m_baseInfo1 = (wxClassInfo *)sm_classTable->Get(info->GetBaseClassName1());
     if (info->GetBaseClassName2())
-      info->baseInfo2 = (wxClassInfo *)classTable.Get(info->GetBaseClassName2());
-    info = info->next;
+      info->m_baseInfo2 = (wxClassInfo *)sm_classTable->Get(info->GetBaseClassName2());
+    info = info->m_next;
   }
-  first = NULL;
 }
 
-wxObject *wxCreateDynamicObject(char *name)
+// Clean up hash table
+void wxClassInfo::CleanUpClasses(void)
 {
-  wxClassInfo *info;
+    delete wxClassInfo::sm_classTable;
+    wxClassInfo::sm_classTable = NULL;
+}
 
-  info = (wxClassInfo *)wxClassInfo::classTable.Get(name);
-  if (!info)
-    return (wxObject *)NULL;
+wxObject *wxCreateDynamicObject(const char *name)
+{
+    if (wxClassInfo::sm_classTable)
+    {
+        wxClassInfo *info = (wxClassInfo *)wxClassInfo::sm_classTable->Get(name);
+        if (!info)
+            return (wxObject *)NULL;
 
-  return info->CreateObject();
+        return info->CreateObject();
+    }
+    else
+    {
+        wxClassInfo *info = wxClassInfo::sm_first;
+        while (info)
+        {
+            if (info->m_className && strcmp(info->m_className, name) == 0)
+                return info->CreateObject();
+            info = info->m_next;
+        }
+        return (wxObject*) NULL;
+    }
+    return (wxObject*) NULL;
 }
 
 #ifdef USE_SERIAL
index 9375df80d8e75a00de3f9a80016be392cb65f571..8e33001a6aaef7e702cb45060b9714c0e7420b78 100644 (file)
@@ -11,8 +11,8 @@
 ////////////////////////////////////////////////////////////////////////////////
 #ifdef __GNUG__     
 #pragma implementation "socket.h"
-#pragma interface
-#pragma implementation "socket.cpp"
+// #pragma interface
+// #pragma implementation "socket.cpp"
 #endif
 
 // For compilers that support precompilation, includes "wx.h".
@@ -92,6 +92,9 @@
 #ifdef __WINDOWS__
 #define close closesocket
 #define ioctl ioctlsocket
+#ifdef errno
+#undef errno
+#endif
 #define errno WSAGetLastError()
 #ifdef EWOULDBLOCK
 #undef EWOULDBLOCK
@@ -369,26 +372,26 @@ wxSocketBase& wxSocketBase::WriteMsg(const char *buffer, size_t nbytes)
 {
   SockMsg msg;
   
-  msg.sig[0] = 0xad;
-  msg.sig[1] = 0xde;
-  msg.sig[2] = 0xed;
-  msg.sig[3] = 0xfe;
+  msg.sig[0] = (char) 0xad;
+  msg.sig[1] = (char) 0xde;
+  msg.sig[2] = (char) 0xed;
+  msg.sig[3] = (char) 0xfe;
 
-  msg.len[0] = nbytes & 0xff;
-  msg.len[1] = (nbytes >> 8) & 0xff;
-  msg.len[2] = (nbytes >> 16) & 0xff;
-  msg.len[3] = (nbytes >> 24) & 0xff;
+  msg.len[0] = (char) nbytes & 0xff;
+  msg.len[1] = (char) (nbytes >> 8) & 0xff;
+  msg.len[2] = (char) (nbytes >> 16) & 0xff;
+  msg.len[3] = (char) (nbytes >> 24) & 0xff;
 
   if (Write((char *)&msg, sizeof(msg)).LastCount() < sizeof(msg))
     return *this;
   if (Write(buffer, nbytes).LastCount() < nbytes)
     return *this; 
 
-  msg.sig[0] = 0xed;
-  msg.sig[1] = 0xfe;
-  msg.sig[2] = 0xad;
-  msg.sig[3] = 0xde;
-  msg.len[0] = msg.len[1] = msg.len[2] = msg.len[3] = 0; 
+  msg.sig[0] = (char) 0xed;
+  msg.sig[1] = (char) 0xfe;
+  msg.sig[2] = (char) 0xad;
+  msg.sig[3] = (char) 0xde;
+  msg.len[0] = msg.len[1] = msg.len[2] = msg.len[3] = (char) 0;
   Write((char *)&msg, sizeof(msg));
 
   return *this;
@@ -415,7 +418,7 @@ bool wxSocketBase::IsData() const
   FD_ZERO(&sock_set);
   FD_SET(m_fd, &sock_set);
   select(FD_SETSIZE, &sock_set, NULL, NULL, &tv);
-  return FD_ISSET(m_fd, &sock_set);
+  return (FD_ISSET(m_fd, &sock_set) != 0);
 }
 
 // ---------------------------------------------------------------------
index 1b0e66c82e04fe62c60f3f2429ce43890f2ae7a7..b749b6029f338281830b2ea02579bc4dea839aaf 100644 (file)
@@ -348,7 +348,7 @@ wxInputStream& wxInputStream::operator>>(float& f)
   }
 
   if (c == '.') {
-    float f_multiplicator = 0.1;
+    float f_multiplicator = (float) 0.1;
     c = GetC();
 
     while (isdigit(c)) {
index dbe4a42999a4d52ec8ca4939a57cd7fd05421ce1..291a4e878958bccc3dc934ca9397e177c5b4dfce 100644 (file)
@@ -293,6 +293,8 @@ void wxApp::CommonCleanUp(void)
   wxCleanUpResourceSystem();
 
   wxSystemSettings::Done();
+
+  wxClassInfo::CleanUpClasses();
 }
 
 wxLog *wxApp::CreateLogTarget()
index dbe4a42999a4d52ec8ca4939a57cd7fd05421ce1..291a4e878958bccc3dc934ca9397e177c5b4dfce 100644 (file)
@@ -293,6 +293,8 @@ void wxApp::CommonCleanUp(void)
   wxCleanUpResourceSystem();
 
   wxSystemSettings::Done();
+
+  wxClassInfo::CleanUpClasses();
 }
 
 wxLog *wxApp::CreateLogTarget()
index ecc96327226c7998eee85816d9eda60bb4e19460..b1cf6da60f3d1be4793412d7d075d4511731654a 100644 (file)
@@ -337,6 +337,8 @@ void wxApp::CleanUp()
   if (wxWinHandleList)
     delete wxWinHandleList ;
 
+  wxClassInfo::CleanUpClasses();
+
   // do it as the very last thing because everything else can log messages
   wxLog::DontCreateOnDemand();
   delete wxLog::SetActiveTarget(NULL);
index a84f84dfdcaba69ad5ea22ca714236a6aeae5813..2e1d142c74f135914129a8f499a379cf68f87032 100644 (file)
@@ -81,6 +81,7 @@ COMMONOBJS = \
   $(COMMDIR)\docview.obj \
   $(COMMDIR)\docmdi.obj \
   $(COMMDIR)\dynarray.obj \
+  $(COMMDIR)\dynlib.obj \
   $(COMMDIR)\event.obj \
   $(COMMDIR)\file.obj \
   $(COMMDIR)\filefn.obj \
@@ -770,6 +771,11 @@ $(COMMDIR)/dynarray.obj:     $*.$(SRCSUFF)
 $(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
 <<
 
+$(COMMDIR)/dynlib.obj:     $*.$(SRCSUFF)
+        cl @<<
+$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
+<<
+
 $(COMMDIR)/event.obj:     $*.$(SRCSUFF)
         cl @<<
 $(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
index 98b18d709c2cd378d62909e86aacfa41c052cf0a..0b2c446216f0e343bb7167508983e035f9c94110 100644 (file)
@@ -34,9 +34,9 @@ wxDirInfo::wxDirInfo( const wxString &path )
   {
     m_name = "My Home";
     m_path += "/";
-    char buf[300];
-    wxGetHomeDir( buf );
-    m_path = buf;
+    wxString str;
+    wxGetHomeDir( & str );
+    m_path = str;
   }
   else
   if (m_path == "/proc") m_name = "Info Filesystem";
index 63c3ed03f6e17c2306418d6d46923e0c36d7291e..01b66dd1224ef62eda5c97a112529cd4d127f031 100644 (file)
@@ -156,9 +156,9 @@ MyFrame::MyFrame(void) :
   m_dir = new wxDirCtrl( m_splitter, ID_DIRCTRL, "/", wxPoint(10,45), wxSize(200,330) );
   
   wxString homepath( "/home" );
-  char buf[300];
-  wxGetHomeDir( buf );
-  homepath = buf;
+  wxString str;
+  wxGetHomeDir( & str );
+  homepath = str;
   m_rightFile = new wxFileCtrl( m_splitter, ID_FILECTRL, homepath, wxPoint(220,5), wxSize(200,330) );
    
   m_leftFile = new wxFileCtrl( m_splitter, ID_FILECTRL, homepath, wxPoint(0,5), wxSize(200,330) );