]> git.saurik.com Git - wxWidgets.git/commitdiff
fixes for the compilation warnings with Sun CC:
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 9 Jan 2002 12:49:12 +0000 (12:49 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 9 Jan 2002 12:49:12 +0000 (12:49 +0000)
1. some fixes for "String literal to char * conversion" warnings (many
   more left in the *.xpm files)
2. fixes for "assignment of function to extern "C" function"
3. a few other miscellaneous ones

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

43 files changed:
include/wx/db.h
include/wx/defs.h
include/wx/dynarray.h
include/wx/geometry.h
include/wx/html/htmltag.h
include/wx/list.h
src/common/cshelp.cpp
src/common/db.cpp
src/common/encconv.cpp
src/common/imagjpeg.cpp
src/common/imagpng.cpp
src/common/imagtiff.cpp
src/common/list.cpp
src/common/resource.cpp
src/common/socket.cpp
src/common/string.cpp
src/common/wxexpr.cpp
src/common/xpmdecod.cpp
src/generic/dirctrlg.cpp
src/generic/listctrl.cpp
src/gtk/app.cpp
src/gtk/dnd.cpp
src/gtk/menu.cpp
src/gtk/minifram.cpp
src/gtk/timer.cpp
src/gtk/toplevel.cpp
src/gtk/utilsgtk.cpp
src/gtk/win_gtk.c
src/gtk/window.cpp
src/gtk1/app.cpp
src/gtk1/dnd.cpp
src/gtk1/menu.cpp
src/gtk1/minifram.cpp
src/gtk1/timer.cpp
src/gtk1/toplevel.cpp
src/gtk1/utilsgtk.cpp
src/gtk1/win_gtk.c
src/gtk1/window.cpp
src/html/helpdata.cpp
src/html/htmlpars.cpp
src/html/htmltag.cpp
src/unix/threadpsx.cpp
src/unix/utilsunx.cpp

index cc2c1d84e8e1f1f3c5c465a449ca519ed7bb0e93..1de7c38f108dd566827dff58cb2f350b994ab6ae 100644 (file)
@@ -706,8 +706,10 @@ int   WXDLLEXPORT  wxDbConnectionsInUse(void);
 
 // Writes a message to the wxLog window (stdout usually) when an internal error
 // situation occurs.  This function only works in DEBUG builds
-const wxChar WXDLLEXPORT *wxDbLogExtendedErrorMsg(const wxChar *userText, wxDb *pDb,
-                                                  wxChar *ErrFile, int ErrLine);
+const wxChar WXDLLEXPORT *wxDbLogExtendedErrorMsg(const wxChar *userText,
+                                                  wxDb *pDb,
+                                                  const wxChar *ErrFile,
+                                                  int ErrLine);
 
 
 // This function sets the sql log state for all open wxDb objects
index 9b52f03dc5974141082b5e3befe5a5e86a2897de..5ea5a2b7820ceeb1d584e7a42ca890df9628a5f0 100644 (file)
@@ -235,16 +235,19 @@ typedef int wxWindowID;
     #define wxCALLBACK
 #endif // platform
 
-// callling convention for the qsort(3) callback
+// generic calling convention for the extern "C" functions
 
 #if defined(__VISUALC__)
-  #define   wxCMPFUNC_CONV    _cdecl
+  #define   wxC_CALLING_CONV    _cdecl
 #elif defined(__VISAGECPP__)
-  #define   wxCMPFUNC_CONV    _Optlink
+  #define   wxC_CALLING_CONV    _Optlink
 #else   // !Visual C++
-  #define   wxCMPFUNC_CONV
+  #define   wxC_CALLING_CONV
 #endif  // compiler
 
+// callling convention for the qsort(3) callback
+#define wxCMPFUNC_CONV wxC_CALLING_CONV
+
 // compatibility :-(
 #define CMPFUNC_CONV wxCMPFUNC_CONV
 
index 9a00c3a7bdc86aa2ff34aeec0a5d18ebdedade1b..e010339d8b113dadc3683a362ad7698936940948 100644 (file)
  callback compare function for quick sort
  must return negative value, 0 or positive value if pItem1 <, = or > pItem2
  */
+extern "C"
+{
 typedef int (wxCMPFUNC_CONV *CMPFUNC)(const void* pItem1, const void* pItem2);
+}
 
 // ----------------------------------------------------------------------------
 /**
index d8d0a8a22647c668d16900eb0b25e632345a4e12..5d91ae5ed2521e3ffec4d9f986cd8c87dde2aa3b 100644 (file)
@@ -97,16 +97,16 @@ public :
     wxDouble m_y;
 };
 
-wxPoint2DDouble operator+(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
-wxPoint2DDouble operator-(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
-wxPoint2DDouble operator*(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
-wxPoint2DDouble operator*(wxDouble n , const wxPoint2DDouble& pt);
-wxPoint2DDouble operator*(wxInt32 n , const wxPoint2DDouble& pt);
-wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxDouble n);
-wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxInt32 n);
-wxPoint2DDouble operator/(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
-wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxDouble n);
-wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxInt32 n);
+inline wxPoint2DDouble operator+(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
+inline wxPoint2DDouble operator-(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
+inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
+inline wxPoint2DDouble operator*(wxDouble n , const wxPoint2DDouble& pt);
+inline wxPoint2DDouble operator*(wxInt32 n , const wxPoint2DDouble& pt);
+inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxDouble n);
+inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxInt32 n);
+inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
+inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxDouble n);
+inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxInt32 n);
 
 inline wxPoint2DDouble::wxPoint2DDouble()
 {
index 981f2374e54571db7686c9f8697dc1ef476aa539..758e1d3a0e9d3a24c896c25444cb8694aa01a351 100644 (file)
@@ -107,7 +107,7 @@ public:
     // (like sscanf() does)
     // NOTE: unlike scanf family, this function only accepts
     //       *one* parameter !
-    int ScanParam(const wxString& par, wxChar *format, void *param) const;
+    int ScanParam(const wxString& par, const wxChar *format, void *param) const;
 
     // Returns string containing all params.
     wxString GetAllParams() const;
index 477e4fc48da46113cfd595e91af545af3c08667a..cfccbf371d7a38344669439a93541bbfadce4f7a 100644 (file)
@@ -64,7 +64,10 @@ enum wxKeyType
 // type of compare function for list sort operation (as in 'qsort'): it should
 // return a negative value, 0 or positive value if the first element is less
 // than, equal or greater than the second
+extern "C"
+{
 typedef int (* LINKAGEMODE wxSortCompareFunction)(const void *elem1, const void *elem2);
+}
 
 //
 typedef int (* LINKAGEMODE wxListIterateFunction)(void *current);
index ba35623830a676c58ae3cdb2e13611f5c421a81b..e2737d2ed1fdf2fa8618f552d9d92827e9cf0e44 100644 (file)
@@ -218,7 +218,7 @@ bool wxContextHelp::DispatchEvent(wxWindow* win, const wxPoint& pt)
  */
 
 #if !defined(__WXMSW__)
-static char * csquery_xpm[] = {
+static const char * csquery_xpm[] = {
 "12 11 2 1",
 "  c None",
 ". c #000000",
index f32276faf062f9380722bbaabbd11af834f1cc7a..065a0ac9d59dd3d03f754f7e00dabdf2573c0cdc 100644 (file)
@@ -3721,8 +3721,10 @@ int WXDLLEXPORT wxDbConnectionsInUse(void)
 
 /********** wxDbLogExtendedErrorMsg() **********/
 // DEBUG ONLY function
-const wxChar WXDLLEXPORT *wxDbLogExtendedErrorMsg(const wxChar *userText, wxDb *pDb,
-                             wxChar *ErrFile, int ErrLine)
+const wxChar WXDLLEXPORT *wxDbLogExtendedErrorMsg(const wxChar *userText,
+                                                  wxDb *pDb,
+                                                  const wxChar *ErrFile,
+                                                  int ErrLine)
 {
     static wxString msg;
     msg = userText;
index a266d02c918e6a670dba6ab5efa357b0227d5b57..8422433e81fd9f7f0c7daf8ffd6802771c135857 100644 (file)
@@ -54,7 +54,7 @@ typedef struct {
 
 
 
-static int LINKAGEMODE CompareCharsetItems(const void *i1, const void *i2)
+extern "C" int LINKAGEMODE CompareCharsetItems(const void *i1, const void *i2)
 {
     return ( ((CharsetItem*)i1) -> u - ((CharsetItem*)i2) -> u );
 }
index 2f5cd0a432b3c636152079d6c346e8fe32474ff3..d16360ce1732f58a22ad0fea6da623c71a3624c1 100644 (file)
@@ -58,6 +58,11 @@ extern "C"
 #endif
 #endif
 
+// we can't use METHODDEF here as it includes static yet the functions must be
+// extern "C" and these can't be used together!
+#undef METHODDEF
+#define METHODDEF(type) extern "C" wxC_CALLING_CONV type
+
 //-----------------------------------------------------------------------------
 // wxJPEGHandler
 //-----------------------------------------------------------------------------
@@ -125,29 +130,6 @@ METHODDEF(void) my_term_source ( j_decompress_ptr cinfo )
     delete[] src->buffer;
 }
 
-void jpeg_wxio_src( j_decompress_ptr cinfo, wxInputStream& infile )
-{
-    my_src_ptr src;
-
-    if (cinfo->src == NULL) {    /* first time for this JPEG object? */
-        cinfo->src = (struct jpeg_source_mgr *)
-            (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
-            sizeof(my_source_mgr));
-        src = (my_src_ptr) cinfo->src;
-    }
-    src = (my_src_ptr) cinfo->src;
-    src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
-    src->buffer = new JOCTET[JPEG_IO_BUFFER_SIZE];
-    src->pub.next_input_byte = NULL; /* until buffer loaded */
-    src->stream = &infile;
-
-    src->pub.init_source = my_init_source;
-    src->pub.fill_input_buffer = my_fill_input_buffer;
-    src->pub.skip_input_data = my_skip_input_data;
-    src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
-    src->pub.term_source = my_term_source;
-}
-
 
 // JPEG error manager:
 
@@ -163,8 +145,7 @@ typedef struct my_error_mgr * my_error_ptr;
  * Here's the routine that will replace the standard error_exit method:
  */
 
-METHODDEF(void)
-my_error_exit (j_common_ptr cinfo)
+METHODDEF(void) my_error_exit (j_common_ptr cinfo)
 {
   /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */
   my_error_ptr myerr = (my_error_ptr) cinfo->err;
@@ -177,6 +158,30 @@ my_error_exit (j_common_ptr cinfo)
   longjmp(myerr->setjmp_buffer, 1);
 }
 
+void jpeg_wxio_src( j_decompress_ptr cinfo, wxInputStream& infile )
+{
+    my_src_ptr src;
+
+    if (cinfo->src == NULL) {    /* first time for this JPEG object? */
+        cinfo->src = (struct jpeg_source_mgr *)
+            (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+            sizeof(my_source_mgr));
+        src = (my_src_ptr) cinfo->src;
+    }
+    src = (my_src_ptr) cinfo->src;
+    src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
+    src->buffer = new JOCTET[JPEG_IO_BUFFER_SIZE];
+    src->pub.next_input_byte = NULL; /* until buffer loaded */
+    src->stream = &infile;
+
+    src->pub.init_source = my_init_source;
+    src->pub.fill_input_buffer = my_fill_input_buffer;
+    src->pub.skip_input_data = my_skip_input_data;
+    src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
+    src->pub.term_source = my_term_source;
+}
+
+
 // temporarily disable the warning C4611 (interaction between '_setjmp' and
 // C++ object destruction is non-portable) - I don't see any dtors here
 #ifdef __VISUALC__
index c8054c25e4b789f5abb64ed06b940d459bd317c2..b41838fa22506c618095de94ee3cb7975773f19c 100644 (file)
@@ -60,12 +60,15 @@ IMPLEMENT_DYNAMIC_CLASS(wxPNGHandler,wxImageHandler)
   #define PNGLINKAGEMODE LINKAGEMODE
 #endif
 
-static void PNGLINKAGEMODE _PNG_stream_reader( png_structp png_ptr, png_bytep data, png_size_t length )
+extern "C"
+{
+
+void PNGLINKAGEMODE _PNG_stream_reader( png_structp png_ptr, png_bytep data, png_size_t length )
 {
     ((wxInputStream*) png_get_io_ptr( png_ptr )) -> Read(data, length);
 }
 
-static void PNGLINKAGEMODE _PNG_stream_writer( png_structp png_ptr, png_bytep data, png_size_t length )
+void PNGLINKAGEMODE _PNG_stream_writer( png_structp png_ptr, png_bytep data, png_size_t length )
 {
     ((wxOutputStream*) png_get_io_ptr( png_ptr )) -> Write(data, length);
 }
@@ -91,6 +94,8 @@ PNGLINKAGEMODE png_silent_warning(png_structp WXUNUSED(png_ptr), png_const_charp
 {
 }
 
+} // extern "C"
+
 // temporarily disable the warning C4611 (interaction between '_setjmp' and
 // C++ object destruction is non-portable) - I don't see any dtors here
 #ifdef __VISUALC__
index 989a1600a203b92e0486fa7418a562cc8fdd76bf..0c741c92c1725465379fbfc19bdeb9d7da841607 100644 (file)
@@ -47,7 +47,10 @@ extern "C"
 
 IMPLEMENT_DYNAMIC_CLASS(wxTIFFHandler,wxImageHandler)
 
-static tsize_t TIFFLINKAGEMODE
+extern "C"
+{
+
+tsize_t TIFFLINKAGEMODE
 _tiffNullProc(thandle_t WXUNUSED(handle),
           tdata_t WXUNUSED(buf),
           tsize_t WXUNUSED(size))
@@ -55,7 +58,7 @@ _tiffNullProc(thandle_t WXUNUSED(handle),
     return (tsize_t) -1;
 }
 
-static tsize_t TIFFLINKAGEMODE
+tsize_t TIFFLINKAGEMODE
 _tiffReadProc(thandle_t handle, tdata_t buf, tsize_t size)
 {
     wxInputStream *stream = (wxInputStream*) handle;
@@ -63,7 +66,7 @@ _tiffReadProc(thandle_t handle, tdata_t buf, tsize_t size)
     return stream->LastRead();
 }
 
-static tsize_t TIFFLINKAGEMODE
+tsize_t TIFFLINKAGEMODE
 _tiffWriteProc(thandle_t handle, tdata_t buf, tsize_t size)
 {
     wxOutputStream *stream = (wxOutputStream*) handle;
@@ -71,7 +74,7 @@ _tiffWriteProc(thandle_t handle, tdata_t buf, tsize_t size)
     return stream->LastWrite();
 }
 
-static toff_t TIFFLINKAGEMODE
+toff_t TIFFLINKAGEMODE
 _tiffSeekIProc(thandle_t handle, toff_t off, int whence)
 {
     wxInputStream *stream = (wxInputStream*) handle;
@@ -87,7 +90,7 @@ _tiffSeekIProc(thandle_t handle, toff_t off, int whence)
     return (toff_t)stream->SeekI( (off_t)off, mode );
 }
 
-static toff_t TIFFLINKAGEMODE
+toff_t TIFFLINKAGEMODE
 _tiffSeekOProc(thandle_t handle, toff_t off, int whence)
 {
     wxOutputStream *stream = (wxOutputStream*) handle;
@@ -103,20 +106,20 @@ _tiffSeekOProc(thandle_t handle, toff_t off, int whence)
     return (toff_t)stream->SeekO( (off_t)off, mode );
 }
 
-static int TIFFLINKAGEMODE
+int TIFFLINKAGEMODE
 _tiffCloseProc(thandle_t WXUNUSED(handle))
 {
     return 0;  // ?
 }
 
-static toff_t TIFFLINKAGEMODE
+toff_t TIFFLINKAGEMODE
 _tiffSizeProc(thandle_t handle)
 {
     wxStreamBase *stream = (wxStreamBase*) handle;
     return (toff_t) stream->GetSize();
 }
 
-static int TIFFLINKAGEMODE
+int TIFFLINKAGEMODE
 _tiffMapProc(thandle_t WXUNUSED(handle),
              tdata_t* WXUNUSED(pbase),
              toff_t* WXUNUSED(psize))
@@ -124,13 +127,15 @@ _tiffMapProc(thandle_t WXUNUSED(handle),
     return 0;
 }
 
-static void TIFFLINKAGEMODE
+void TIFFLINKAGEMODE
 _tiffUnmapProc(thandle_t WXUNUSED(handle),
                tdata_t WXUNUSED(base),
                toff_t WXUNUSED(size))
 {
 }
 
+} // extern "C"
+
 TIFF*
 TIFFwxOpen(wxInputStream &stream, const char* name, const char* mode)
 {
index 1d647ddd273249276ef893ca71eaa872492513b7..018d554addc56270f8ced71bb4366f1c4e401dde 100644 (file)
@@ -640,7 +640,7 @@ bool wxStringList::Member(const wxChar *s) const
     return FALSE;
 }
 
-static int LINKAGEMODE
+extern "C" int LINKAGEMODE
 wx_comparestrings(const void *arg1, const void *arg2)
 {
   wxChar **s1 = (wxChar **) arg1;
index a6446d9710e5a85ed71eca96b533c303c3c19071..e012fd8929013c6bf1397bec481b1517ae2bc58a 100644 (file)
@@ -2049,7 +2049,7 @@ wxChar* wxResourceParseWord(wxChar*s, int *i)
 
 struct wxResourceBitListStruct
 {
-    wxChar *word;
+    const wxChar *word;
     long bits;
 };
 
index 003bd9dbcfb3afccda8e45f3cf037ae82951ccc5..9df24e42c9453decd31c6c67e986efef935c3a57 100644 (file)
@@ -862,9 +862,10 @@ char *wxSocketBase::CallbackData(char *data)
 // decoupled from wx_socket_callback and thus they suffer from a variety
 // of problems. Avoid them where possible and use events instead.
 
-static void LINKAGEMODE wx_socket_callback(GSocket * WXUNUSED(socket),
-                                           GSocketEvent notification,
-                                           char *cdata)
+extern "C"
+void LINKAGEMODE wx_socket_callback(GSocket * WXUNUSED(socket),
+                                    GSocketEvent notification,
+                                    char *cdata)
 {
   wxSocketBase *sckobj = (wxSocketBase *)cdata;
 
index b1349cf7316ea4fb1b3fdb2e2176b423667242ac..6bc1683a231dd9be84803472d10b0c8b5c94a253 100644 (file)
@@ -2240,7 +2240,8 @@ static wxArrayString::CompareFunction gs_compareFunction = NULL;
 static bool gs_sortAscending = TRUE;
 
 // function which is called by quick sort
-static int LINKAGEMODE wxStringCompareFunction(const void *first, const void *second)
+extern "C" int LINKAGEMODE
+wxStringCompareFunction(const void *first, const void *second)
 {
   wxString *strFirst = (wxString *)first;
   wxString *strSecond = (wxString *)second;
index 6f67df37a2286570e2a54615f1e34c10dce00330..01784063b201679dadd4d948c9236fdd6438926f 100644 (file)
@@ -1255,7 +1255,7 @@ void process_command(char * cexpr)
 void syntax_error(char *WXUNUSED(s))
 {
   if (currentwxExprErrorHandler)
-    (void)(*(currentwxExprErrorHandler))(WXEXPR_ERROR_SYNTAX, "syntax error");
+    (void)(*(currentwxExprErrorHandler))(WXEXPR_ERROR_SYNTAX, (char *)"syntax error");
   if (thewxExprDatabase) thewxExprDatabase->noErrors += 1;
 }
 
index 6f593fc98923b4a45c587ac8de5eb425df41b438..05113e9ab8b470b5ba645fd9530e1d7d0b0e218b 100644 (file)
@@ -263,7 +263,7 @@ wxImage wxXPMDecoder::ReadFile(wxInputStream& stream)
 
 typedef struct
 {
-    char *name;
+    const char *name;
     wxUint32 rgb;
 } rgbRecord;
 
index 9049f96c275e6a81da82b21b52bf96da067f17bc..c0016cef7960c8a511300bc67ce70fe6659b9f6d 100644 (file)
@@ -90,7 +90,7 @@
 #endif
 
 /* Closed folder */
-static char * icon1_xpm[] = {
+static const char * icon1_xpm[] = {
 /* width height ncolors chars_per_pixel */
 "16 16 6 1",
 /* colors */
@@ -119,7 +119,7 @@ static char * icon1_xpm[] = {
 "                "};
 
 /* Open folder */
-static char * icon2_xpm[] = {
+static const char * icon2_xpm[] = {
 /* width height ncolors chars_per_pixel */
 "16 16 6 1",
 /* colors */
@@ -148,7 +148,7 @@ static char * icon2_xpm[] = {
 "                "};
 
 /* File */
-static char * icon3_xpm[] = {
+static const char * icon3_xpm[] = {
 /* width height ncolors chars_per_pixel */
 "16 16 3 1",
 /* colors */
@@ -174,7 +174,7 @@ static char * icon3_xpm[] = {
 "                "};
 
 /* Computer */
-static char * icon4_xpm[] = {
+static const char * icon4_xpm[] = {
 "16 16 7 1",
 "     s None    c None",
 ".    c #808080",
@@ -201,7 +201,7 @@ static char * icon4_xpm[] = {
 "............o   "};
 
 /* Drive */
-static char * icon5_xpm[] = {
+static const char * icon5_xpm[] = {
 "16 16 7 1",
 "     s None    c None",
 ".    c #808080",
@@ -228,7 +228,7 @@ static char * icon5_xpm[] = {
 "                "};
 
 /* CD-ROM */
-static char *icon6_xpm[] = {
+static const char *icon6_xpm[] = {
 "16 16 10 1",
 "     s None    c None",
 ".    c #808080",
@@ -258,7 +258,7 @@ static char *icon6_xpm[] = {
 "                "};
 
 /* Floppy */
-static char * icon7_xpm[] = {
+static const char * icon7_xpm[] = {
 "16 16 7 1",
 "     s None    c None",
 ".    c #808080",
@@ -285,7 +285,7 @@ static char * icon7_xpm[] = {
 "                "};
 
 /* Removeable */
-static char * icon8_xpm[] = {
+static const char * icon8_xpm[] = {
 "16 16 7 1",
 "     s None    c None",
 ".    c #808080",
index f61435dac07279023a4b26e14c263be115ac3c0f..9e22abf5a0c4d574441a09eb4e08efcefce51a14 100644 (file)
@@ -1804,7 +1804,8 @@ void wxListHeaderWindow::DoDrawRect( wxDC *dc, int x, int y, int w, int h )
 
     gtk_paint_box (m_wxwindow->style, GTK_PIZZA(m_wxwindow)->bin_window,
                    state, GTK_SHADOW_OUT,
-                   (GdkRectangle*) NULL, m_wxwindow, "button",
+                   (GdkRectangle*) NULL, m_wxwindow,
+                   (char *)"button", // const_cast
                    x-1, y-1, w+2, h+2);
 #elif defined( __WXMAC__  )
     const int m_corner = 1;
index f66454123e78bad7151c392bda628ccb7c573670..daa4e27b35c0bdee775358aa3093577dad8bee4b 100644 (file)
@@ -61,14 +61,15 @@ static GtkWidget *gs_RootWindow = (GtkWidget*) NULL;
 // local functions
 //-----------------------------------------------------------------------------
 
-/* forward declaration */
-gint   wxapp_idle_callback( gpointer WXUNUSED(data) );
-gint   wxapp_pending_callback( gpointer WXUNUSED(data) );
-void   wxapp_install_idle_handler();
+extern "C"
+{
+    gint wxapp_idle_callback( gpointer WXUNUSED(data) );
+    gint wxapp_pending_callback( gpointer WXUNUSED(data) );
+}
 
-#if wxUSE_THREADS
-gint   wxapp_wakeup_timerout_callback( gpointer WXUNUSED(data) );
-#endif
+void wxapp_install_thread_wakeup();
+void wxapp_uninstall_thread_wakeup();
+void wxapp_install_idle_handler();
 
 //-----------------------------------------------------------------------------
 // wxExit
@@ -163,6 +164,28 @@ void wxWakeUpIdle()
 // local functions
 //-----------------------------------------------------------------------------
 
+void wxapp_install_idle_handler()
+{
+    wxASSERT_MSG( wxTheApp->m_idleTag == 0, wxT("attempt to install idle handler twice") );
+
+    g_isIdle = FALSE;
+
+    if (g_pendingTag == 0)
+        g_pendingTag = gtk_idle_add_priority( 900, wxapp_pending_callback, (gpointer) NULL );
+
+    /* This routine gets called by all event handlers
+       indicating that the idle is over. It may also
+       get called from other thread for sending events
+       to the main thread (and processing these in
+       idle time). Very low priority. */
+
+    wxTheApp->m_idleTag = gtk_idle_add_priority( 1000, wxapp_idle_callback, (gpointer) NULL );
+}
+
+// the callback functions must be extern "C" to comply with GTK+ declarations
+extern "C"
+{
+
 gint wxapp_pending_callback( gpointer WXUNUSED(data) )
 {
     if (!wxTheApp) return TRUE;
@@ -230,24 +253,42 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) )
     return FALSE;
 }
 
-void wxapp_install_idle_handler()
+#if wxUSE_THREADS
+
+gint wxapp_wakeup_timerout_callback( gpointer WXUNUSED(data) )
 {
-    wxASSERT_MSG( wxTheApp->m_idleTag == 0, wxT("attempt to install idle handler twice") );
+    // when getting called from GDK's time-out handler
+    // we are no longer within GDK's grab on the GUI
+    // thread so we must lock it here ourselves
+    gdk_threads_enter();
 
-    g_isIdle = FALSE;
+    wxapp_uninstall_thread_wakeup();
 
-    if (g_pendingTag == 0)
-        g_pendingTag = gtk_idle_add_priority( 900, wxapp_pending_callback, (gpointer) NULL );
+    // unblock other threads wishing to do some GUI things
+    wxMutexGuiLeave();
 
-    /* This routine gets called by all event handlers
-       indicating that the idle is over. It may also
-       get called from other thread for sending events
-       to the main thread (and processing these in
-       idle time). Very low priority. */
+    g_mainThreadLocked = TRUE;
 
-    wxTheApp->m_idleTag = gtk_idle_add_priority( 1000, wxapp_idle_callback, (gpointer) NULL );
+    // wake up other threads
+    wxUsleep( 1 );
+
+    // block other thread again
+    wxMutexGuiEnter();
+
+    g_mainThreadLocked = FALSE;
+
+    wxapp_install_thread_wakeup();
+
+    // release lock again
+    gdk_threads_leave();
+
+    return TRUE;
 }
 
+#endif // wxUSE_THREADS
+
+} // extern "C"
+
 #if wxUSE_THREADS
 
 static int g_threadUninstallLevel = 0;
@@ -275,36 +316,6 @@ void wxapp_uninstall_thread_wakeup()
     wxTheApp->m_wakeUpTimerTag = 0;
 }
 
-gint wxapp_wakeup_timerout_callback( gpointer WXUNUSED(data) )
-{
-    // when getting called from GDK's time-out handler
-    // we are no longer within GDK's grab on the GUI
-    // thread so we must lock it here ourselves
-    gdk_threads_enter();
-
-    wxapp_uninstall_thread_wakeup();
-
-    // unblock other threads wishing to do some GUI things
-    wxMutexGuiLeave();
-
-    g_mainThreadLocked = TRUE;
-
-    // wake up other threads
-    wxUsleep( 1 );
-
-    // block other thread again
-    wxMutexGuiEnter();
-
-    g_mainThreadLocked = FALSE;
-
-    wxapp_install_thread_wakeup();
-
-    // release lock again
-    gdk_threads_leave();
-
-    return TRUE;
-}
-
 #endif // wxUSE_THREADS
 
 //-----------------------------------------------------------------------------
index 5d4111c304504f143a1528ded43805aa478e8d3d..59a3c3a9478a289eb64f9f9c7e0d86a0f9cd5b85 100644 (file)
@@ -60,7 +60,7 @@ static const wxChar *TRACE_DND = _T("dnd");
 //----------------------------------------------------------------------------
 
 /* XPM */
-static char * page_xpm[] = {
+static const char * page_xpm[] = {
 /* width height ncolors chars_per_pixel */
 "32 32 5 1",
 /* colors */
index 9c28eb232c8167e38cb46d64e9582ac334fdbcfd..77ac32a68d628eda479bca2fe4829be9ae5e9139 100644 (file)
@@ -322,7 +322,7 @@ bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title)
     entry.accelerator = (gchar*) NULL;
     entry.callback = (GtkItemFactoryCallback) NULL;
     entry.callback_action = 0;
-    entry.item_type = "<Branch>";
+    entry.item_type = (char *)"<Branch>";
 
     gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 );  /* what is 2 ? */
     /* in order to get the pointer to the item we need the item text _without_ underscores */
@@ -886,10 +886,10 @@ void wxMenu::Init()
     if(m_style & wxMENU_TEAROFF)
     {
        GtkItemFactoryEntry entry;
-       entry.path = "/tearoff";
+       entry.path = (char *)"/tearoff";
        entry.callback = (GtkItemFactoryCallback) NULL;
        entry.callback_action = 0;
-       entry.item_type = "<Tearoff>";
+       entry.item_type = (char *)"<Tearoff>";
        entry.accelerator = (gchar*) NULL;
        gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 );  /* what is 2 ? */
        //GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, "<main>/tearoff" );
@@ -923,10 +923,10 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
     {
 #if (GTK_MINOR_VERSION > 0)
         GtkItemFactoryEntry entry;
-        entry.path = "/sep";
+        entry.path = (char *)"/sep";
         entry.callback = (GtkItemFactoryCallback) NULL;
         entry.callback_action = 0;
-        entry.item_type = "<Separator>";
+        entry.item_type = (char *)"<Separator>";
         entry.accelerator = (gchar*) NULL;
 
         gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 );  /* what is 2 ? */
@@ -952,7 +952,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
         entry.path = buf;
         entry.callback = (GtkItemFactoryCallback) 0;
         entry.callback_action = 0;
-        entry.item_type = "<Branch>";
+        entry.item_type = (char *)"<Branch>";
         entry.accelerator = (gchar*) NULL;
 
         gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 );  /* what is 2 ? */
@@ -1022,9 +1022,9 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
         entry.callback = (GtkItemFactoryCallback) gtk_menu_clicked_callback;
         entry.callback_action = 0;
         if ( mitem->IsCheckable() )
-            entry.item_type = "<CheckItem>";
+            entry.item_type = (char *)"<CheckItem>";
         else
-            entry.item_type = "<Item>";
+            entry.item_type = (char *)"<Item>";
         entry.accelerator = (gchar*) NULL;
 
 #if wxUSE_ACCEL
@@ -1251,6 +1251,9 @@ static wxString GetHotKey( const wxMenuItem& item )
 #include <gtk/gtkmenu.h>
 #include <gtk/gtkcontainer.h>
 
+extern "C"
+{
+
 static void gtk_pixmap_menu_item_class_init    (GtkPixmapMenuItemClass *klass);
 static void gtk_pixmap_menu_item_init          (GtkPixmapMenuItem      *menu_item);
 static void gtk_pixmap_menu_item_draw          (GtkWidget              *widget,
@@ -1276,6 +1279,8 @@ static void changed_have_pixmap_status         (GtkPixmapMenuItem *menu_item);
 
 static GtkMenuItemClass *parent_class = NULL;
 
+}
+
 #define BORDER_SPACING  3
 #define PMAP_WIDTH 20
 
@@ -1288,7 +1293,7 @@ gtk_pixmap_menu_item_get_type (void)
     {
       GtkTypeInfo pixmap_menu_item_info =
       {
-        "GtkPixmapMenuItem",
+        (char *)"GtkPixmapMenuItem",
         sizeof (GtkPixmapMenuItem),
         sizeof (GtkPixmapMenuItemClass),
         (GtkClassInitFunc) gtk_pixmap_menu_item_class_init,
index 8e823f312b67a635080fe5126066797c3fcd6e35..53d01860b9c86552f945c785208fad415add3e7c 100644 (file)
@@ -270,7 +270,7 @@ static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxMiniFram
 // wxMiniFrame
 //-----------------------------------------------------------------------------
 
-static char *cross_xpm[] = {
+static const char *cross_xpm[] = {
 /* columns rows colors chars-per-pixel */
 "5 5 16 1",
 "  c Gray0",
@@ -321,7 +321,13 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
         ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT)))
     {
         GdkBitmap *mask = (GdkBitmap*) NULL;
-        GdkPixmap *pixmap = gdk_pixmap_create_from_xpm_d( wxGetRootWindow()->window, &mask, NULL, cross_xpm );
+        GdkPixmap *pixmap = gdk_pixmap_create_from_xpm_d
+                            (
+                                wxGetRootWindow()->window,
+                                &mask,
+                                NULL,
+                                (char **)cross_xpm
+                            );
 
         GtkWidget *pw = gtk_pixmap_new( pixmap, mask );
         gdk_bitmap_unref( mask );
index 2afdb78df9d716d3fd4dacd2196b2b7e546bc8d0..a8514f8cd169098e08cfc5694cc2b6b332396a63 100644 (file)
@@ -26,7 +26,7 @@
 
 IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject)
 
-static gint timeout_callback( gpointer data )
+extern "C" gint timeout_callback( gpointer data )
 {
     wxTimer *timer = (wxTimer*)data;
 
index 499a36e6899c14cc2bfb52212e85fb1264abbf17..28f810cdf24f48fec61eed522a46c47bf42d74d4 100644 (file)
@@ -245,8 +245,13 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
 {
     GtkPizza *pizza = GTK_PIZZA(widget);
 
-    gtk_paint_flat_box (win->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
-                GTK_SHADOW_NONE, &gdk_event->area, win->m_widget, "base", 0, 0, -1, -1);
+    gtk_paint_flat_box (win->m_widget->style,
+                        pizza->bin_window, GTK_STATE_NORMAL,
+                        GTK_SHADOW_NONE,
+                        &gdk_event->area,
+                        win->m_widget,
+                        (char *)"base",
+                        0, 0, -1, -1);
 
     return TRUE;
 }
@@ -260,8 +265,13 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
 {
     GtkPizza *pizza = GTK_PIZZA(widget);
 
-    gtk_paint_flat_box (win->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
-                GTK_SHADOW_NONE, rect, win->m_widget, "base", 0, 0, -1, -1);
+    gtk_paint_flat_box (win->m_widget->style,
+                        pizza->bin_window, GTK_STATE_NORMAL,
+                        GTK_SHADOW_NONE,
+                        rect,
+                        win->m_widget,
+                        (char *)"base",
+                        0, 0, -1, -1);
 }
 
 // ----------------------------------------------------------------------------
index 1296a0f7624cf22a7ceae8a9546d8464f27ceffd..1bc1106f93e420c45945d76e6a8c140b809139cd 100644 (file)
@@ -139,8 +139,9 @@ wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
 // subprocess routines
 // ----------------------------------------------------------------------------
 
-static void GTK_EndProcessDetector(gpointer data, gint source,
-                                   GdkInputCondition WXUNUSED(condition) )
+extern "C"
+void GTK_EndProcessDetector(gpointer data, gint source,
+                            GdkInputCondition WXUNUSED(condition) )
 {
    wxEndProcessData *proc_data = (wxEndProcessData *)data;
 
index 2f41b1064c65305f1bee0d49d7716acc33cc4626..db9045e73ed25f8212c93c4a3ffda55c850ffadc 100644 (file)
@@ -852,7 +852,7 @@ gtk_pizza_forall (GtkContainer *container,
 
     g_return_if_fail (container != NULL);
     g_return_if_fail (GTK_IS_PIZZA (container));
-    g_return_if_fail (callback != NULL);
+    g_return_if_fail (callback != (GtkCallback)NULL);
 
     pizza = GTK_PIZZA (container);
 
index d3f6cf1e1c2ca37c41fb16ee47dd350c9d012b9e..ccb09b9a12abb22bac1d52c5cf0a9d5fe37a2079 100644 (file)
@@ -785,8 +785,14 @@ static int gtk_window_expose_callback( GtkWidget *widget,
         if (!parent)
             parent = win;
 
-        gtk_paint_flat_box (parent->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
-            GTK_SHADOW_NONE, &gdk_event->area, parent->m_widget, "base", 0, 0, -1, -1);
+        gtk_paint_flat_box (parent->m_widget->style,
+                            pizza->bin_window,
+                            GTK_STATE_NORMAL,
+                            GTK_SHADOW_NONE,
+                            &gdk_event->area,
+                            parent->m_widget,
+                            (char *)"base",
+                            0, 0, -1, -1);
     }
 
     win->GetUpdateRegion().Union( gdk_event->area.x,
@@ -928,8 +934,14 @@ static void gtk_window_draw_callback( GtkWidget *widget,
         if (!parent)
             parent = win;
 
-        gtk_paint_flat_box (parent->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
-            GTK_SHADOW_NONE, rect, parent->m_widget, "base", 0, 0, -1, -1);
+        gtk_paint_flat_box (parent->m_widget->style,
+                            pizza->bin_window,
+                            GTK_STATE_NORMAL,
+                            GTK_SHADOW_NONE,
+                            rect,
+                            parent->m_widget,
+                            (char *)"base",
+                            0, 0, -1, -1);
     }
 
 
@@ -3713,7 +3725,8 @@ void wxWindowGTK::ApplyWidgetStyle()
 
 #if wxUSE_MENUS_NATIVE
 
-static void gtk_pop_hide_callback( GtkWidget *WXUNUSED(widget), bool* is_waiting  )
+extern "C"
+void gtk_pop_hide_callback( GtkWidget *WXUNUSED(widget), bool* is_waiting  )
 {
     *is_waiting = FALSE;
 }
@@ -3775,8 +3788,10 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y )
 
     bool is_waiting = TRUE;
 
-    gtk_signal_connect( GTK_OBJECT(menu->m_menu), "hide",
-      GTK_SIGNAL_FUNC(gtk_pop_hide_callback), (gpointer)&is_waiting );
+    gtk_signal_connect( GTK_OBJECT(menu->m_menu),
+                        "hide",
+                        GTK_SIGNAL_FUNC(gtk_pop_hide_callback),
+                        (gpointer)&is_waiting );
 
     gtk_menu_popup(
                   GTK_MENU(menu->m_menu),
index f66454123e78bad7151c392bda628ccb7c573670..daa4e27b35c0bdee775358aa3093577dad8bee4b 100644 (file)
@@ -61,14 +61,15 @@ static GtkWidget *gs_RootWindow = (GtkWidget*) NULL;
 // local functions
 //-----------------------------------------------------------------------------
 
-/* forward declaration */
-gint   wxapp_idle_callback( gpointer WXUNUSED(data) );
-gint   wxapp_pending_callback( gpointer WXUNUSED(data) );
-void   wxapp_install_idle_handler();
+extern "C"
+{
+    gint wxapp_idle_callback( gpointer WXUNUSED(data) );
+    gint wxapp_pending_callback( gpointer WXUNUSED(data) );
+}
 
-#if wxUSE_THREADS
-gint   wxapp_wakeup_timerout_callback( gpointer WXUNUSED(data) );
-#endif
+void wxapp_install_thread_wakeup();
+void wxapp_uninstall_thread_wakeup();
+void wxapp_install_idle_handler();
 
 //-----------------------------------------------------------------------------
 // wxExit
@@ -163,6 +164,28 @@ void wxWakeUpIdle()
 // local functions
 //-----------------------------------------------------------------------------
 
+void wxapp_install_idle_handler()
+{
+    wxASSERT_MSG( wxTheApp->m_idleTag == 0, wxT("attempt to install idle handler twice") );
+
+    g_isIdle = FALSE;
+
+    if (g_pendingTag == 0)
+        g_pendingTag = gtk_idle_add_priority( 900, wxapp_pending_callback, (gpointer) NULL );
+
+    /* This routine gets called by all event handlers
+       indicating that the idle is over. It may also
+       get called from other thread for sending events
+       to the main thread (and processing these in
+       idle time). Very low priority. */
+
+    wxTheApp->m_idleTag = gtk_idle_add_priority( 1000, wxapp_idle_callback, (gpointer) NULL );
+}
+
+// the callback functions must be extern "C" to comply with GTK+ declarations
+extern "C"
+{
+
 gint wxapp_pending_callback( gpointer WXUNUSED(data) )
 {
     if (!wxTheApp) return TRUE;
@@ -230,24 +253,42 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) )
     return FALSE;
 }
 
-void wxapp_install_idle_handler()
+#if wxUSE_THREADS
+
+gint wxapp_wakeup_timerout_callback( gpointer WXUNUSED(data) )
 {
-    wxASSERT_MSG( wxTheApp->m_idleTag == 0, wxT("attempt to install idle handler twice") );
+    // when getting called from GDK's time-out handler
+    // we are no longer within GDK's grab on the GUI
+    // thread so we must lock it here ourselves
+    gdk_threads_enter();
 
-    g_isIdle = FALSE;
+    wxapp_uninstall_thread_wakeup();
 
-    if (g_pendingTag == 0)
-        g_pendingTag = gtk_idle_add_priority( 900, wxapp_pending_callback, (gpointer) NULL );
+    // unblock other threads wishing to do some GUI things
+    wxMutexGuiLeave();
 
-    /* This routine gets called by all event handlers
-       indicating that the idle is over. It may also
-       get called from other thread for sending events
-       to the main thread (and processing these in
-       idle time). Very low priority. */
+    g_mainThreadLocked = TRUE;
 
-    wxTheApp->m_idleTag = gtk_idle_add_priority( 1000, wxapp_idle_callback, (gpointer) NULL );
+    // wake up other threads
+    wxUsleep( 1 );
+
+    // block other thread again
+    wxMutexGuiEnter();
+
+    g_mainThreadLocked = FALSE;
+
+    wxapp_install_thread_wakeup();
+
+    // release lock again
+    gdk_threads_leave();
+
+    return TRUE;
 }
 
+#endif // wxUSE_THREADS
+
+} // extern "C"
+
 #if wxUSE_THREADS
 
 static int g_threadUninstallLevel = 0;
@@ -275,36 +316,6 @@ void wxapp_uninstall_thread_wakeup()
     wxTheApp->m_wakeUpTimerTag = 0;
 }
 
-gint wxapp_wakeup_timerout_callback( gpointer WXUNUSED(data) )
-{
-    // when getting called from GDK's time-out handler
-    // we are no longer within GDK's grab on the GUI
-    // thread so we must lock it here ourselves
-    gdk_threads_enter();
-
-    wxapp_uninstall_thread_wakeup();
-
-    // unblock other threads wishing to do some GUI things
-    wxMutexGuiLeave();
-
-    g_mainThreadLocked = TRUE;
-
-    // wake up other threads
-    wxUsleep( 1 );
-
-    // block other thread again
-    wxMutexGuiEnter();
-
-    g_mainThreadLocked = FALSE;
-
-    wxapp_install_thread_wakeup();
-
-    // release lock again
-    gdk_threads_leave();
-
-    return TRUE;
-}
-
 #endif // wxUSE_THREADS
 
 //-----------------------------------------------------------------------------
index 5d4111c304504f143a1528ded43805aa478e8d3d..59a3c3a9478a289eb64f9f9c7e0d86a0f9cd5b85 100644 (file)
@@ -60,7 +60,7 @@ static const wxChar *TRACE_DND = _T("dnd");
 //----------------------------------------------------------------------------
 
 /* XPM */
-static char * page_xpm[] = {
+static const char * page_xpm[] = {
 /* width height ncolors chars_per_pixel */
 "32 32 5 1",
 /* colors */
index 9c28eb232c8167e38cb46d64e9582ac334fdbcfd..77ac32a68d628eda479bca2fe4829be9ae5e9139 100644 (file)
@@ -322,7 +322,7 @@ bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title)
     entry.accelerator = (gchar*) NULL;
     entry.callback = (GtkItemFactoryCallback) NULL;
     entry.callback_action = 0;
-    entry.item_type = "<Branch>";
+    entry.item_type = (char *)"<Branch>";
 
     gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 );  /* what is 2 ? */
     /* in order to get the pointer to the item we need the item text _without_ underscores */
@@ -886,10 +886,10 @@ void wxMenu::Init()
     if(m_style & wxMENU_TEAROFF)
     {
        GtkItemFactoryEntry entry;
-       entry.path = "/tearoff";
+       entry.path = (char *)"/tearoff";
        entry.callback = (GtkItemFactoryCallback) NULL;
        entry.callback_action = 0;
-       entry.item_type = "<Tearoff>";
+       entry.item_type = (char *)"<Tearoff>";
        entry.accelerator = (gchar*) NULL;
        gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 );  /* what is 2 ? */
        //GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, "<main>/tearoff" );
@@ -923,10 +923,10 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
     {
 #if (GTK_MINOR_VERSION > 0)
         GtkItemFactoryEntry entry;
-        entry.path = "/sep";
+        entry.path = (char *)"/sep";
         entry.callback = (GtkItemFactoryCallback) NULL;
         entry.callback_action = 0;
-        entry.item_type = "<Separator>";
+        entry.item_type = (char *)"<Separator>";
         entry.accelerator = (gchar*) NULL;
 
         gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 );  /* what is 2 ? */
@@ -952,7 +952,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
         entry.path = buf;
         entry.callback = (GtkItemFactoryCallback) 0;
         entry.callback_action = 0;
-        entry.item_type = "<Branch>";
+        entry.item_type = (char *)"<Branch>";
         entry.accelerator = (gchar*) NULL;
 
         gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 );  /* what is 2 ? */
@@ -1022,9 +1022,9 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
         entry.callback = (GtkItemFactoryCallback) gtk_menu_clicked_callback;
         entry.callback_action = 0;
         if ( mitem->IsCheckable() )
-            entry.item_type = "<CheckItem>";
+            entry.item_type = (char *)"<CheckItem>";
         else
-            entry.item_type = "<Item>";
+            entry.item_type = (char *)"<Item>";
         entry.accelerator = (gchar*) NULL;
 
 #if wxUSE_ACCEL
@@ -1251,6 +1251,9 @@ static wxString GetHotKey( const wxMenuItem& item )
 #include <gtk/gtkmenu.h>
 #include <gtk/gtkcontainer.h>
 
+extern "C"
+{
+
 static void gtk_pixmap_menu_item_class_init    (GtkPixmapMenuItemClass *klass);
 static void gtk_pixmap_menu_item_init          (GtkPixmapMenuItem      *menu_item);
 static void gtk_pixmap_menu_item_draw          (GtkWidget              *widget,
@@ -1276,6 +1279,8 @@ static void changed_have_pixmap_status         (GtkPixmapMenuItem *menu_item);
 
 static GtkMenuItemClass *parent_class = NULL;
 
+}
+
 #define BORDER_SPACING  3
 #define PMAP_WIDTH 20
 
@@ -1288,7 +1293,7 @@ gtk_pixmap_menu_item_get_type (void)
     {
       GtkTypeInfo pixmap_menu_item_info =
       {
-        "GtkPixmapMenuItem",
+        (char *)"GtkPixmapMenuItem",
         sizeof (GtkPixmapMenuItem),
         sizeof (GtkPixmapMenuItemClass),
         (GtkClassInitFunc) gtk_pixmap_menu_item_class_init,
index 8e823f312b67a635080fe5126066797c3fcd6e35..53d01860b9c86552f945c785208fad415add3e7c 100644 (file)
@@ -270,7 +270,7 @@ static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxMiniFram
 // wxMiniFrame
 //-----------------------------------------------------------------------------
 
-static char *cross_xpm[] = {
+static const char *cross_xpm[] = {
 /* columns rows colors chars-per-pixel */
 "5 5 16 1",
 "  c Gray0",
@@ -321,7 +321,13 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
         ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT)))
     {
         GdkBitmap *mask = (GdkBitmap*) NULL;
-        GdkPixmap *pixmap = gdk_pixmap_create_from_xpm_d( wxGetRootWindow()->window, &mask, NULL, cross_xpm );
+        GdkPixmap *pixmap = gdk_pixmap_create_from_xpm_d
+                            (
+                                wxGetRootWindow()->window,
+                                &mask,
+                                NULL,
+                                (char **)cross_xpm
+                            );
 
         GtkWidget *pw = gtk_pixmap_new( pixmap, mask );
         gdk_bitmap_unref( mask );
index 2afdb78df9d716d3fd4dacd2196b2b7e546bc8d0..a8514f8cd169098e08cfc5694cc2b6b332396a63 100644 (file)
@@ -26,7 +26,7 @@
 
 IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject)
 
-static gint timeout_callback( gpointer data )
+extern "C" gint timeout_callback( gpointer data )
 {
     wxTimer *timer = (wxTimer*)data;
 
index 499a36e6899c14cc2bfb52212e85fb1264abbf17..28f810cdf24f48fec61eed522a46c47bf42d74d4 100644 (file)
@@ -245,8 +245,13 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
 {
     GtkPizza *pizza = GTK_PIZZA(widget);
 
-    gtk_paint_flat_box (win->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
-                GTK_SHADOW_NONE, &gdk_event->area, win->m_widget, "base", 0, 0, -1, -1);
+    gtk_paint_flat_box (win->m_widget->style,
+                        pizza->bin_window, GTK_STATE_NORMAL,
+                        GTK_SHADOW_NONE,
+                        &gdk_event->area,
+                        win->m_widget,
+                        (char *)"base",
+                        0, 0, -1, -1);
 
     return TRUE;
 }
@@ -260,8 +265,13 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
 {
     GtkPizza *pizza = GTK_PIZZA(widget);
 
-    gtk_paint_flat_box (win->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
-                GTK_SHADOW_NONE, rect, win->m_widget, "base", 0, 0, -1, -1);
+    gtk_paint_flat_box (win->m_widget->style,
+                        pizza->bin_window, GTK_STATE_NORMAL,
+                        GTK_SHADOW_NONE,
+                        rect,
+                        win->m_widget,
+                        (char *)"base",
+                        0, 0, -1, -1);
 }
 
 // ----------------------------------------------------------------------------
index 1296a0f7624cf22a7ceae8a9546d8464f27ceffd..1bc1106f93e420c45945d76e6a8c140b809139cd 100644 (file)
@@ -139,8 +139,9 @@ wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
 // subprocess routines
 // ----------------------------------------------------------------------------
 
-static void GTK_EndProcessDetector(gpointer data, gint source,
-                                   GdkInputCondition WXUNUSED(condition) )
+extern "C"
+void GTK_EndProcessDetector(gpointer data, gint source,
+                            GdkInputCondition WXUNUSED(condition) )
 {
    wxEndProcessData *proc_data = (wxEndProcessData *)data;
 
index 2f41b1064c65305f1bee0d49d7716acc33cc4626..db9045e73ed25f8212c93c4a3ffda55c850ffadc 100644 (file)
@@ -852,7 +852,7 @@ gtk_pizza_forall (GtkContainer *container,
 
     g_return_if_fail (container != NULL);
     g_return_if_fail (GTK_IS_PIZZA (container));
-    g_return_if_fail (callback != NULL);
+    g_return_if_fail (callback != (GtkCallback)NULL);
 
     pizza = GTK_PIZZA (container);
 
index d3f6cf1e1c2ca37c41fb16ee47dd350c9d012b9e..ccb09b9a12abb22bac1d52c5cf0a9d5fe37a2079 100644 (file)
@@ -785,8 +785,14 @@ static int gtk_window_expose_callback( GtkWidget *widget,
         if (!parent)
             parent = win;
 
-        gtk_paint_flat_box (parent->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
-            GTK_SHADOW_NONE, &gdk_event->area, parent->m_widget, "base", 0, 0, -1, -1);
+        gtk_paint_flat_box (parent->m_widget->style,
+                            pizza->bin_window,
+                            GTK_STATE_NORMAL,
+                            GTK_SHADOW_NONE,
+                            &gdk_event->area,
+                            parent->m_widget,
+                            (char *)"base",
+                            0, 0, -1, -1);
     }
 
     win->GetUpdateRegion().Union( gdk_event->area.x,
@@ -928,8 +934,14 @@ static void gtk_window_draw_callback( GtkWidget *widget,
         if (!parent)
             parent = win;
 
-        gtk_paint_flat_box (parent->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
-            GTK_SHADOW_NONE, rect, parent->m_widget, "base", 0, 0, -1, -1);
+        gtk_paint_flat_box (parent->m_widget->style,
+                            pizza->bin_window,
+                            GTK_STATE_NORMAL,
+                            GTK_SHADOW_NONE,
+                            rect,
+                            parent->m_widget,
+                            (char *)"base",
+                            0, 0, -1, -1);
     }
 
 
@@ -3713,7 +3725,8 @@ void wxWindowGTK::ApplyWidgetStyle()
 
 #if wxUSE_MENUS_NATIVE
 
-static void gtk_pop_hide_callback( GtkWidget *WXUNUSED(widget), bool* is_waiting  )
+extern "C"
+void gtk_pop_hide_callback( GtkWidget *WXUNUSED(widget), bool* is_waiting  )
 {
     *is_waiting = FALSE;
 }
@@ -3775,8 +3788,10 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y )
 
     bool is_waiting = TRUE;
 
-    gtk_signal_connect( GTK_OBJECT(menu->m_menu), "hide",
-      GTK_SIGNAL_FUNC(gtk_pop_hide_callback), (gpointer)&is_waiting );
+    gtk_signal_connect( GTK_OBJECT(menu->m_menu),
+                        "hide",
+                        GTK_SIGNAL_FUNC(gtk_pop_hide_callback),
+                        (gpointer)&is_waiting );
 
     gtk_menu_popup(
                   GTK_MENU(menu->m_menu),
index 11af5d51dc81a27e1d7ac9004af5cd73fd2056bc..acb90ff60c421c9abe05471b1d2c247b41cfb7c7 100644 (file)
@@ -61,7 +61,8 @@ static char* ReadLine(char *line, char *buf)
 
 
 
-static int LINKAGEMODE IndexCompareFunc(const void *a, const void *b)
+extern "C" int LINKAGEMODE
+wxHtmlHelpIndexCompareFunc(const void *a, const void *b)
 {
     return wxStricmp(((wxHtmlContentsItem*)a)->m_Name, ((wxHtmlContentsItem*)b)->m_Name);
 }
@@ -524,7 +525,7 @@ bool wxHtmlHelpData::AddBookParam(const wxFSFile& bookfile,
 
     m_BookRecords.Add(bookr);
     if (m_IndexCnt > 0)
-        qsort(m_Index, m_IndexCnt, sizeof(wxHtmlContentsItem), IndexCompareFunc);
+        qsort(m_Index, m_IndexCnt, sizeof(wxHtmlContentsItem), wxHtmlHelpIndexCompareFunc);
 
     return TRUE;
 }
index 09f7c0ecd96041630d469b283e8613f609ab4cfa..9efd706bea25ea4cc7502432fc690ef4515efdb7 100644 (file)
@@ -491,7 +491,7 @@ struct wxHtmlEntityInfo
     unsigned code;
 };
 
-static int LINKAGEMODE compar_entity(const void *key, const void *item)
+extern "C" int LINKAGEMODE wxHtmlEntityCompare(const void *key, const void *item)
 {
     return wxStrcmp((wxChar*)key, ((wxHtmlEntityInfo*)item)->name);
 }
@@ -801,7 +801,7 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity)
         info = (wxHtmlEntityInfo*) bsearch(entity.c_str(), substitutions,
                                            substitutions_cnt,
                                            sizeof(wxHtmlEntityInfo),
-                                           compar_entity);
+                                           wxHtmlEntityCompare);
         if (info)
             code = info->code;
     }
index e725a033abcfcc975c0d444338749d000bc0fca8..85fa7286ee5bb4ad1dfd91fb14db3464f9bca16b 100644 (file)
@@ -332,7 +332,9 @@ wxString wxHtmlTag::GetParam(const wxString& par, bool with_commas) const
         return m_ParamValues[index];
 }
 
-int wxHtmlTag::ScanParam(const wxString& par, wxChar *format, void *param) const
+int wxHtmlTag::ScanParam(const wxString& par,
+                         const wxChar *format,
+                         void *param) const
 {
     wxString parval = GetParam(par);
     return wxSscanf(parval, format, param);
index 14edbfc078eda8438069adf7cae8ceca650bd00b..fd9b12c7313d37038187ffddb9ff6db8db336e59 100644 (file)
@@ -490,6 +490,13 @@ void wxCondition::Broadcast()
 // wxThread (Posix implementation)
 //--------------------------------------------------------------------
 
+#if HAVE_THREAD_CLEANUP_FUNCTIONS
+
+// thread exit function
+extern "C" void wxPthreadCleanup(void *ptr);
+
+#endif // HAVE_THREAD_CLEANUP_FUNCTIONS
+
 class wxThreadInternal
 {
 public:
@@ -499,11 +506,6 @@ public:
     // thread entry function
     static void *PthreadStart(void *ptr);
 
-#if HAVE_THREAD_CLEANUP_FUNCTIONS
-    // thread exit function
-    static void PthreadCleanup(void *ptr);
-#endif
-
     // thread actions
         // start the thread
     wxThreadError Run();
@@ -549,6 +551,11 @@ public:
         // sometimes - tell the thread that it should do it
     void Notify() { m_shouldBroadcast = TRUE; }
 
+#if HAVE_THREAD_CLEANUP_FUNCTIONS
+    // this is used by wxPthreadCleanup() only
+    static void Cleanup(wxThread *thread);
+#endif // HAVE_THREAD_CLEANUP_FUNCTIONS
+
 private:
     pthread_t     m_threadId;   // id of the thread
     wxThreadState m_state;      // see wxThreadState enum
@@ -615,7 +622,7 @@ void *wxThreadInternal::PthreadStart(void *ptr)
 #if HAVE_THREAD_CLEANUP_FUNCTIONS
     // install the cleanup handler which will be called if the thread is
     // cancelled
-    pthread_cleanup_push(wxThreadInternal::PthreadCleanup, ptr);
+    pthread_cleanup_push(wxPthreadCleanup, ptr);
 #endif // HAVE_THREAD_CLEANUP_FUNCTIONS
 
     // wait for the condition to be signaled from Run()
@@ -645,7 +652,7 @@ void *wxThreadInternal::PthreadStart(void *ptr)
                        pthread->GetId());
 
             // change the state of the thread to "exited" so that
-            // PthreadCleanup handler won't do anything from now (if it's
+            // wxPthreadCleanup handler won't do anything from now (if it's
             // called before we do pthread_cleanup_pop below)
             pthread->SetState(STATE_EXITED);
         }
@@ -679,10 +686,13 @@ void *wxThreadInternal::PthreadStart(void *ptr)
 #if HAVE_THREAD_CLEANUP_FUNCTIONS
 
 // this handler is called when the thread is cancelled
-void wxThreadInternal::PthreadCleanup(void *ptr)
+extern "C" void wxPthreadCleanup(void *ptr)
 {
-    wxThread *thread = (wxThread *) ptr;
+    wxThreadInternal::Cleanup((wxThread *)ptr);
+}
 
+void wxThreadInternal::Cleanup(wxThread *thread)
+{
     {
         wxCriticalSectionLocker lock(thread->m_critsect);
         if ( thread->m_internal->GetState() == STATE_EXITED )
@@ -1284,7 +1294,7 @@ wxThreadError wxThread::Kill()
             if ( m_isDetached )
             {
                 // if we use cleanup function, this will be done from
-                // PthreadCleanup()
+                // wxPthreadCleanup()
 #if !HAVE_THREAD_CLEANUP_FUNCTIONS
                 ScheduleThreadForDeletion();
 
index 8247bb6f9fd704f3975a52f5bed8be0ae2c5fb6f..6fdbc765eb491206f5fd11929e60d9300c556bbe 100644 (file)
@@ -1093,7 +1093,7 @@ bool wxSetEnv(const wxString& variable, const wxChar *value)
 
 #include <signal.h>
 
-static void wxFatalSignalHandler(wxTYPE_SA_HANDLER)
+extern "C" void wxFatalSignalHandler(wxTYPE_SA_HANDLER)
 {
     if ( wxTheApp )
     {