]> git.saurik.com Git - wxWidgets.git/commitdiff
more Sun C++ compiler warning fixes: in particular, added an ugly but
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 11 Jan 2002 19:33:37 +0000 (19:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 11 Jan 2002 19:33:37 +0000 (19:33 +0000)
necessary workaround for avoiding warning in the .xpm files

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

17 files changed:
include/wx/geometry.h
src/common/filefn.cpp
src/common/http.cpp
src/generic/filedlgg.cpp
src/generic/proplist.cpp
src/generic/tipdlg.cpp
src/gtk/app.cpp
src/gtk/listbox.cpp
src/gtk/window.cpp
src/gtk1/app.cpp
src/gtk1/listbox.cpp
src/gtk1/window.cpp
src/html/helpfrm.cpp
src/html/htmlhelp.cpp
src/motif/app.cpp
src/unix/fontutil.cpp
src/unix/threadpsx.cpp

index d619b6cafa85ac95ca16953945d644f41fdd3186..0aafb0f855b7b3e2f8030a1f59375df05bca7a9b 100644 (file)
@@ -99,16 +99,16 @@ public :
     wxInt32 m_y;
 };
 
-wxPoint2DInt operator+(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
-wxPoint2DInt operator-(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
-wxPoint2DInt operator*(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
-wxPoint2DInt operator*(wxInt32 n , const wxPoint2DInt& pt);
-wxPoint2DInt operator*(wxInt32 n , const wxPoint2DInt& pt);
-wxPoint2DInt operator*(const wxPoint2DInt& pt , wxInt32 n);
-wxPoint2DInt operator*(const wxPoint2DInt& pt , wxInt32 n);
-wxPoint2DInt operator/(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
-wxPoint2DInt operator/(const wxPoint2DInt& pt , wxInt32 n);
-wxPoint2DInt operator/(const wxPoint2DInt& pt , wxInt32 n);
+inline wxPoint2DInt operator+(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
+inline wxPoint2DInt operator-(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
+inline wxPoint2DInt operator*(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
+inline wxPoint2DInt operator*(wxInt32 n , const wxPoint2DInt& pt);
+inline wxPoint2DInt operator*(wxInt32 n , const wxPoint2DInt& pt);
+inline wxPoint2DInt operator*(const wxPoint2DInt& pt , wxInt32 n);
+inline wxPoint2DInt operator*(const wxPoint2DInt& pt , wxInt32 n);
+inline wxPoint2DInt operator/(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
+inline wxPoint2DInt operator/(const wxPoint2DInt& pt , wxInt32 n);
+inline wxPoint2DInt operator/(const wxPoint2DInt& pt , wxInt32 n);
 
 inline wxPoint2DInt::wxPoint2DInt()
 {
index 79c63f4bade52bbc06c08b246cde8471097c3137..13fafb9b9f013ecb282c27a1570d58a1751e0aad 100644 (file)
@@ -567,7 +567,6 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
 
     /* Expand ~ and ~user */
     nm = lnm;
-    s = wxT("");
     if (nm[0] == wxT('~') && !q)
     {
         /* prefix ~ */
@@ -591,7 +590,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
             if ((home = WXSTRINGCAST wxGetUserHome(wxString(nm + 1))) == NULL) {
                if (was_sep) /* replace only if it was there: */
                    *s = SEP;
-                s = wxT("");
+                s = NULL;
             } else {
                 nm = nnm;
                 s = home;
index 55b44ed76d61747dbd706fd3035c77e827eab319..b98d6c83af9c3a6dae459c1a4c3bf2b7d66607f7 100644 (file)
@@ -205,11 +205,11 @@ bool wxHTTP::Connect(wxSockAddress& addr, bool WXUNUSED(wait))
 
 bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req)
 {
-  wxChar *tmp_buf;
+  const wxChar *request;
 
   switch (req) {
   case wxHTTP_GET:
-    tmp_buf = wxT("GET");
+    request = wxT("GET");
     break;
   default:
     return FALSE;
@@ -224,7 +224,7 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req)
   Notify(FALSE);
 
   wxString buf;
-  buf.Printf(wxT("%s %s HTTP/1.0\r\n"), tmp_buf, path.c_str());
+  buf.Printf(wxT("%s %s HTTP/1.0\r\n"), request, path.c_str());
   const wxWX2MBbuf pathbuf = wxConvLibc.cWX2MB(buf);
   Write(pathbuf, strlen(wxMBSTRINGCAST pathbuf));
   SendHeaders();
index 3132890a00793859f98b97878d928c444f266fa8..5630801c60932f99306ab2f3b9b615f02f03a268 100644 (file)
@@ -69,6 +69,9 @@
 # include <time.h>
 #include <unistd.h>
 
+// XPM hack: make the arrays const
+#define static static const
+
 #ifndef __DOS__
 #include "wx/generic/home.xpm"
 #endif
@@ -80,6 +83,8 @@
 #include "wx/generic/deffile.xpm"
 #include "wx/generic/exefile.xpm"
 
+#undef static
+
 //-----------------------------------------------------------------------------
 //  wxFileData
 //-----------------------------------------------------------------------------
index 55722a5c10817961542531e10d1d7ec3945deb4a..adff29386fe053beb247f401e575382bf72b8066 100644 (file)
 // XPMs
 // ----------------------------------------------------------------------------
 
+// XPM hack: make the arrays const
+#define static static const
+
 #ifndef __WXMSW__
     #include "wx/generic/cross.xpm"
     #include "wx/generic/tick.xpm"
 #endif
 
+#undef static
+
 // ----------------------------------------------------------------------------
 // accessor functions for the bitmaps (may return NULL, check for it!)
 // ----------------------------------------------------------------------------
index 6f9ba6f7df64556d91d501446f5a84e069ffa4dd..33a019fc1181eafca3a5229bb7054c9de028e0de 100644 (file)
@@ -198,7 +198,13 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
 #if defined(__WXMSW__) || defined(__WXPM__)
     wxIcon icon("wxICON_TIP");
 #else
+    // XPM hack: make the arrays const
+    #define static static const
+
     #include "wx/generic/tip.xpm"
+
+    #undef static
+
     wxIcon icon(tipIcon);
 #endif
     wxStaticBitmap *bmp = new wxStaticBitmap(this, -1, icon);
index daa4e27b35c0bdee775358aa3093577dad8bee4b..3390312177e198bf645b99061fb39a38dc57fed1 100644 (file)
@@ -868,11 +868,16 @@ int wxEntry( int argc, char *argv[] )
 
 #ifndef __WXUNIVERSAL__
 
+// XPM hack: make the arrays const
+#define static static const
+
 #include "wx/gtk/info.xpm"
 #include "wx/gtk/error.xpm"
 #include "wx/gtk/question.xpm"
 #include "wx/gtk/warning.xpm"
 
+#undef static
+
 wxIcon wxApp::GetStdIcon(int which) const
 {
     switch(which)
index de25cc767e69da38ed150f6a3b268457f7f4ad91..56089bfd2c1e6a2358c03b5ccd813038bafb1689 100644 (file)
@@ -84,7 +84,7 @@ struct wxlistbox_idle_struct
     gint         m_tag;
 };
 
-static gint wxlistbox_idle_callback( gpointer gdata )
+extern "C" gint wxlistbox_idle_callback( gpointer gdata )
 {
     wxlistbox_idle_struct* data = (wxlistbox_idle_struct*) gdata;
     gdk_threads_enter();
index ccb09b9a12abb22bac1d52c5cf0a9d5fe37a2079..475c60be0fab591dd3059c2d77dccb9580b71099 100644 (file)
@@ -3755,9 +3755,9 @@ static void SetInvokingWindow( wxMenu *menu, wxWindowGTK *win )
 static gint gs_pop_x = 0;
 static gint gs_pop_y = 0;
 
-static void wxPopupMenuPositionCallback( GtkMenu *menu,
-                                         gint *x, gint *y,
-                                         gpointer WXUNUSED(user_data) )
+extern "C" void wxPopupMenuPositionCallback( GtkMenu *menu,
+                                             gint *x, gint *y,
+                                             gpointer WXUNUSED(user_data) )
 {
     // ensure that the menu appears entirely on screen
     GtkRequisition req;
index daa4e27b35c0bdee775358aa3093577dad8bee4b..3390312177e198bf645b99061fb39a38dc57fed1 100644 (file)
@@ -868,11 +868,16 @@ int wxEntry( int argc, char *argv[] )
 
 #ifndef __WXUNIVERSAL__
 
+// XPM hack: make the arrays const
+#define static static const
+
 #include "wx/gtk/info.xpm"
 #include "wx/gtk/error.xpm"
 #include "wx/gtk/question.xpm"
 #include "wx/gtk/warning.xpm"
 
+#undef static
+
 wxIcon wxApp::GetStdIcon(int which) const
 {
     switch(which)
index de25cc767e69da38ed150f6a3b268457f7f4ad91..56089bfd2c1e6a2358c03b5ccd813038bafb1689 100644 (file)
@@ -84,7 +84,7 @@ struct wxlistbox_idle_struct
     gint         m_tag;
 };
 
-static gint wxlistbox_idle_callback( gpointer gdata )
+extern "C" gint wxlistbox_idle_callback( gpointer gdata )
 {
     wxlistbox_idle_struct* data = (wxlistbox_idle_struct*) gdata;
     gdk_threads_enter();
index ccb09b9a12abb22bac1d52c5cf0a9d5fe37a2079..475c60be0fab591dd3059c2d77dccb9580b71099 100644 (file)
@@ -3755,9 +3755,9 @@ static void SetInvokingWindow( wxMenu *menu, wxWindowGTK *win )
 static gint gs_pop_x = 0;
 static gint gs_pop_y = 0;
 
-static void wxPopupMenuPositionCallback( GtkMenu *menu,
-                                         gint *x, gint *y,
-                                         gpointer WXUNUSED(user_data) )
+extern "C" void wxPopupMenuPositionCallback( GtkMenu *menu,
+                                             gint *x, gint *y,
+                                             gpointer WXUNUSED(user_data) )
 {
     // ensure that the menu appears entirely on screen
     GtkRequisition req;
index d317e2a5b738f6242e026925188e72e401107967..f35c4ce23b8d17df7717aa1bbf12277746530b3b 100644 (file)
 // Bitmaps:
 
 #ifndef __WXMSW__
-#include "bitmaps/wpanel.xpm"
-#include "bitmaps/wback.xpm"
-#include "bitmaps/wforward.xpm"
-#include "bitmaps/wbook.xpm"
-#include "bitmaps/woptions.xpm"
-#include "bitmaps/wfolder.xpm"
-#include "bitmaps/wpage.xpm"
-#include "bitmaps/whelp.xpm"
-#include "bitmaps/whlproot.xpm"
-#include "bitmaps/wbkadd.xpm"
-#include "bitmaps/wbkdel.xpm"
-#include "bitmaps/wup.xpm"
-#include "bitmaps/wupnode.xpm"
-#include "bitmaps/wdown.xpm"
-#include "bitmaps/wopen.xpm"
-#include "bitmaps/wprint.xpm"
-#endif
-
+    // XPM hack: make the arrays const
+    #define static static const
+
+    #include "bitmaps/wpanel.xpm"
+    #include "bitmaps/wback.xpm"
+    #include "bitmaps/wforward.xpm"
+    #include "bitmaps/wbook.xpm"
+    #include "bitmaps/woptions.xpm"
+    #include "bitmaps/wfolder.xpm"
+    #include "bitmaps/wpage.xpm"
+    #include "bitmaps/whelp.xpm"
+    #include "bitmaps/whlproot.xpm"
+    #include "bitmaps/wbkadd.xpm"
+    #include "bitmaps/wbkdel.xpm"
+    #include "bitmaps/wup.xpm"
+    #include "bitmaps/wupnode.xpm"
+    #include "bitmaps/wdown.xpm"
+    #include "bitmaps/wopen.xpm"
+    #include "bitmaps/wprint.xpm"
+
+    #undef static
+#endif // __WXMSW__
 
 // what is considered "small index"?
 #define INDEX_IS_SMALL 100
index da6c47706c39383fd7956e3d9f74d508a701297d..8ea6466640006bbe1f3631d162daa0803eb4ee6c 100644 (file)
@@ -42,12 +42,17 @@ file is only left to point out the problem and will be removed r.s.n.
 // Bitmaps:
 
 #ifndef __WXMSW__
-#include "bitmaps/panel.xpm"
-#include "bitmaps/back.xpm"
-#include "bitmaps/forward.xpm"
-#include "bitmaps/book.xpm"
-#include "bitmaps/folder.xpm"
-#include "bitmaps/page.xpm"
+    // XPM hack: make the arrays const
+    #define static static const
+
+    #include "bitmaps/panel.xpm"
+    #include "bitmaps/back.xpm"
+    #include "bitmaps/forward.xpm"
+    #include "bitmaps/book.xpm"
+    #include "bitmaps/folder.xpm"
+    #include "bitmaps/page.xpm"
+
+    #undef static
 #endif
 
 #include "search.h"
@@ -192,12 +197,12 @@ bool wxHtmlHelpController::AddBook(const wxString& book, bool show_wait_msg)
     int sz;
     char *buff, *lineptr;
     char linebuf[300];
-     
+
     wxString title = _("noname"),
              safetitle,
              start = wxEmptyString,
              contents = wxEmptyString, index = wxEmptyString;
-    
+
     if (wxIsAbsolutePath(book)) bookFull = book;
     else bookFull = wxGetCwd() + "/" + book;
 
@@ -257,7 +262,7 @@ bool wxHtmlHelpController::AddBook(const wxString& book, bool show_wait_msg)
     m_BookRecords.Add(bookr);
     if (m_IndexCnt > 0)
         qsort(m_Index, m_IndexCnt, sizeof(HtmlContentsItem), IndexCompareFunc);
-    
+
     return TRUE;
 }
 
@@ -374,14 +379,15 @@ class MyProgressDlg : public wxDialog
     public:
         bool m_Canceled;
 
-        MyProgressDlg(wxWindow *parent) : wxDialog(parent, -1, 
-                     _("Searching..."), 
-                     wxPoint(0, 0), 
+        MyProgressDlg(wxWindow *parent) : wxDialog(parent, -1,
+                     _("Searching..."),
+                     wxPoint(0, 0),
 #ifdef __WXGTK__
-                     wxSize(300, 110)
+                     wxSize(300, 110)
 #else
-                     wxSize(300, 130)
+                     wxSize(300, 130)
 #endif
+              )
                      {m_Canceled = FALSE;}
         void OnCancel(wxCommandEvent& event) {m_Canceled = TRUE;}
         DECLARE_EVENT_TABLE()
@@ -392,7 +398,7 @@ END_EVENT_TABLE()
 
 #endif
 
-       
+
 bool wxHtmlHelpController::KeywordSearch(const wxString& keyword)
 {
     int foundcnt = 0;
index fbe1d763fc41a8f652af4312caaba43c49105762..8b019fdf6e64ab9c51d6ee1082329f777fefe230 100644 (file)
@@ -753,11 +753,16 @@ bool wxApp::Yield(bool onlyIfNeeded)
 
 // TODO use XmGetPixmap (?) to get the really standard icons!
 
+// XPM hack: make the arrays const
+#define static static const
+
 #include "wx/generic/info.xpm"
 #include "wx/generic/error.xpm"
 #include "wx/generic/question.xpm"
 #include "wx/generic/warning.xpm"
 
+#undef static
+
 wxIcon
 wxApp::GetStdIcon(int which) const
 {
index 841e90bf64bc01654817a231c721505caf86a453..0da307c8d5a65b5277bb30c4b133d971155a258b 100644 (file)
@@ -196,10 +196,10 @@ wxString wxNativeFontInfo::ToUserString() const
     return GetXFontName();
 }
 
-bool wxNativeFontInfo::FromXFontName(const wxString& xFontName)
+bool wxNativeFontInfo::FromXFontName(const wxString& fontname)
 {
     // TODO: we should be able to handle the font aliases here, but how?
-    wxStringTokenizer tokenizer(xFontName, _T("-"), wxTOKEN_STRTOK);
+    wxStringTokenizer tokenizer(fontname, _T("-"), wxTOKEN_STRTOK);
 
     for ( size_t n = 0; n < WXSIZEOF(fontElements); n++ )
     {
index fd9b12c7313d37038187ffddb9ff6db8db336e59..f47319d5e34363772336f5246c0b1f5dc35ee1d0 100644 (file)
@@ -490,12 +490,18 @@ void wxCondition::Broadcast()
 // wxThread (Posix implementation)
 //--------------------------------------------------------------------
 
+// the thread callback functions must have the C linkage
+extern "C"
+{
+
 #if HAVE_THREAD_CLEANUP_FUNCTIONS
+    // thread exit function
+    void wxPthreadCleanup(void *ptr);
+#endif // HAVE_THREAD_CLEANUP_FUNCTIONS
 
-// thread exit function
-extern "C" void wxPthreadCleanup(void *ptr);
+void *wxPthreadStart(void *ptr);
 
-#endif // HAVE_THREAD_CLEANUP_FUNCTIONS
+} // extern "C"
 
 class wxThreadInternal
 {
@@ -504,7 +510,7 @@ public:
     ~wxThreadInternal();
 
     // thread entry function
-    static void *PthreadStart(void *ptr);
+    static void *PthreadStart(wxThread *thread);
 
     // thread actions
         // start the thread
@@ -600,9 +606,13 @@ private:
 // thread startup and exit functions
 // ----------------------------------------------------------------------------
 
-void *wxThreadInternal::PthreadStart(void *ptr)
+void *wxPthreadStart(void *ptr)
+{
+    return wxThreadInternal::PthreadStart((wxThread *)ptr);
+}
+
+void *wxThreadInternal::PthreadStart(wxThread *thread)
 {
-    wxThread *thread = (wxThread *)ptr;
     wxThreadInternal *pthread = thread->m_internal;
 
     // associate the thread pointer with the newly created thread so that
@@ -622,7 +632,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(wxPthreadCleanup, ptr);
+    pthread_cleanup_push(wxPthreadCleanup, thread);
 #endif // HAVE_THREAD_CLEANUP_FUNCTIONS
 
     // wait for the condition to be signaled from Run()
@@ -1042,7 +1052,7 @@ wxThreadError wxThread::Create(unsigned int WXUNUSED(stackSize))
              (
                 m_internal->GetIdPtr(),
                 &attr,
-                wxThreadInternal::PthreadStart,
+                wxPthreadStart,
                 (void *)this
              );