]> git.saurik.com Git - wxWidgets.git/commitdiff
Helpers in disabling warnings for unused params.
authorWłodzimierz Skiba <abx@abx.art.pl>
Thu, 30 Jun 2005 15:31:20 +0000 (15:31 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Thu, 30 Jun 2005 15:31:20 +0000 (15:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34790 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/defs.h
src/common/filefn.cpp
src/common/imagtiff.cpp
src/msw/menu.cpp
src/msw/utils.cpp

index 48bdab9b33965fbdd61b859cbe4cbb41f5d2e6a8..1cc0b17d7b47fbfa6ffbbc15a7fa82285a4ec461 100644 (file)
@@ -515,6 +515,20 @@ typedef int wxWindowID;
     #define WXUNUSED_UNLESS_DEBUG(param)  WXUNUSED(param)
 #endif
 
+/*  some arguments are not used in unicode mode */
+#if wxUSE_UNICODE
+    #define WXUNUSED_IN_UNICODE(param)  WXUNUSED(param)
+#else
+    #define WXUNUSED_IN_UNICODE(param)  param
+#endif
+
+/*  some arguments are not used in WinCE build */
+#ifdef __WXWINCE__
+    #define WXUNUSED_IN_WINCE(param)  WXUNUSED(param)
+#else
+    #define WXUNUSED_IN_WINCE(param)  param
+#endif
+
 /*  some compilers give warning about a possibly unused variable if it is */
 /*  initialized in both branches of if/else and shut up if it is initialized */
 /*  when declared, but other compilers then give warnings about unused variable */
index f0c139bb788d4abc11aa0151688208eb35d02dcc..7b7a499f5f25168209b3a15b18928c11d53c61ba 100644 (file)
@@ -167,7 +167,7 @@ void wxPathList::Add (const wxString& path)
 }
 
 // Add paths e.g. from the PATH environment variable
-void wxPathList::AddEnvList (const wxString& envVariable)
+void wxPathList::AddEnvList (const wxString& WXUNUSED_IN_WINCE(envVariable))
 {
     // No environment variables on WinCE
 #ifndef __WXWINCE__
@@ -209,9 +209,7 @@ void wxPathList::AddEnvList (const wxString& envVariable)
 
         delete [] s;
     }
-#else // __WXWINCE__
-    wxUnusedVar(envVariable);
-#endif // !__WXWINCE__/__WXWINCE__
+#endif // !__WXWINCE__
 }
 
 // Given a full filename (with path), ensure that that file can
@@ -652,7 +650,9 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
    The call wxExpandPath can convert these back!
  */
 wxChar *
-wxContractPath (const wxString& filename, const wxString& envname, const wxString& user)
+wxContractPath (const wxString& filename,
+                const wxString& WXUNUSED_IN_WINCE(envname),
+                const wxString& user)
 {
   static wxChar dest[_MAXPATHLEN];
 
@@ -678,8 +678,6 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin
         wxStrcat (tcp, wxT("}"));
         wxStrcat (tcp, wxFileFunctionsBuffer);
     }
-#else
-  wxUnusedVar(envname);
 #endif
 
   // Handle User's home (ignore root homes!)
@@ -1641,7 +1639,9 @@ time_t WXDLLEXPORT wxFileModificationTime(const wxString& filename)
 // Returns 0 if none or if there's a problem.
 // filterStr is in the form: "All files (*.*)|*.*|JPEG Files (*.jpeg)|*.jpeg"
 
-int WXDLLEXPORT wxParseCommonDialogsFilter(const wxString& filterStr, wxArrayString& descriptions, wxArrayString& filters)
+int WXDLLEXPORT wxParseCommonDialogsFilter(const wxString& filterStr,
+                                           wxArrayString& descriptions,
+                                           wxArrayString& filters)
 {
     descriptions.Clear();
     filters.Clear();
index e1cfedc79523e63119b527eb5eeb1c18b19367ec..30865e12bdc6ed8624e3bac34abcfb5d4957ef6d 100644 (file)
@@ -137,7 +137,9 @@ _tiffUnmapProc(thandle_t WXUNUSED(handle),
 }
 
 static void
-TIFFwxWarningHandler(const char* module, const char* fmt, va_list ap)
+TIFFwxWarningHandler(const char* module,
+                     const char* WXUNUSED_IN_UNICODE(fmt),
+                     va_list WXUNUSED_IN_UNICODE(ap))
 {
     if (module != NULL)
         wxLogWarning(_("tiff module: %s"), wxString::FromAscii(module).c_str());
@@ -151,7 +153,9 @@ TIFFwxWarningHandler(const char* module, const char* fmt, va_list ap)
 }
 
 static void
-TIFFwxErrorHandler(const char* module, const char* fmt, va_list ap)
+TIFFwxErrorHandler(const char* module,
+                   const char* WXUNUSED_IN_UNICODE(fmt),
+                   va_list WXUNUSED_IN_UNICODE(ap))
 {
     if (module != NULL)
         wxLogError(_("tiff module: %s"), wxString::FromAscii(module).c_str());
index d18f97c893e5fabcca8be218c8396395a0feb08f..ddc8094612af2662ea4585d690e04e943d4996ed 100644 (file)
@@ -89,7 +89,8 @@ static const int idMenuTitle = -3;
 // ----------------------------------------------------------------------------
 
 // make the given menu item default
-static void SetDefaultMenuItem(HMENU hmenu, UINT id)
+static void SetDefaultMenuItem(HMENU WXUNUSED_IN_WINCE(hmenu),
+                               UINT WXUNUSED_IN_WINCE(id))
 {
 #ifndef __WXWINCE__
     MENUITEMINFO mii;
@@ -102,9 +103,6 @@ static void SetDefaultMenuItem(HMENU hmenu, UINT id)
     {
         wxLogLastError(wxT("SetMenuItemInfo"));
     }
-#else
-    wxUnusedVar(hmenu);
-    wxUnusedVar(id);
 #endif
 }
 
index 99ff5278878f351f865d5d7d8e0c7fd4b72e9b5e..ead9e70d1c0fa56b25d7ff099aa61b0883e6ce2a 100644 (file)
@@ -122,12 +122,11 @@ static const wxChar eUSERNAME[]  = wxT("UserName");
 // ----------------------------------------------------------------------------
 
 // Get hostname only (without domain name)
-bool wxGetHostName(wxChar *buf, int maxSize)
+bool wxGetHostName(wxChar *WXUNUSED_IN_WINCE(buf),
+                   int WXUNUSED_IN_WINCE(maxSize))
 {
 #if defined(__WXWINCE__)
     // TODO-CE
-    wxUnusedVar(buf);
-    wxUnusedVar(maxSize);
     return false;
 #elif defined(__WIN32__) && !defined(__WXMICROWIN__)
     DWORD nSize = maxSize;
@@ -237,12 +236,11 @@ bool wxGetFullHostName(wxChar *buf, int maxSize)
 }
 
 // Get user ID e.g. jacs
-bool wxGetUserId(wxChar *buf, int maxSize)
+bool wxGetUserId(wxChar *WXUNUSED_IN_WINCE(buf),
+                 int WXUNUSED_IN_WINCE(maxSize))
 {
 #if defined(__WXWINCE__)
     // TODO-CE
-    wxUnusedVar(buf);
-    wxUnusedVar(maxSize);
     return false;
 #elif defined(__WIN32__) && !defined(__WXMICROWIN__)
     DWORD nSize = maxSize;
@@ -280,12 +278,11 @@ bool wxGetUserId(wxChar *buf, int maxSize)
 }
 
 // Get user name e.g. Julian Smart
-bool wxGetUserName(wxChar *buf, int maxSize)
+bool wxGetUserName(wxChar *WXUNUSED_IN_WINCE(buf),
+                   int WXUNUSED_IN_WINCE(maxSize))
 {
 #if defined(__WXWINCE__)
     // TODO-CE
-    wxUnusedVar(buf);
-    wxUnusedVar(maxSize);
     return false;
 #elif defined(USE_NET_API)
     CHAR szUserName[256];
@@ -467,13 +464,12 @@ wxChar *wxGetUserHome(const wxString& WXUNUSED(user))
     return (wxChar *)wxGetHomeDir(&s_home);
 }
 
-bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
+bool wxGetDiskSpace(const wxString& WXUNUSED_IN_WINCE(path),
+                    wxLongLong *WXUNUSED_IN_WINCE(pTotal),
+                    wxLongLong *WXUNUSED_IN_WINCE(pFree))
 {
 #ifdef __WXWINCE__
     // TODO-CE
-    wxUnusedVar(path);
-    wxUnusedVar(pTotal);
-    wxUnusedVar(pFree);
     return false;
 #else
     if ( path.empty() )
@@ -583,12 +579,11 @@ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
 // env vars
 // ----------------------------------------------------------------------------
 
-bool wxGetEnv(const wxString& var, wxString *value)
+bool wxGetEnv(const wxString& WXUNUSED_IN_WINCE(var),
+              wxString *WXUNUSED_IN_WINCE(value))
 {
 #ifdef __WXWINCE__
     // no environment variables under CE
-    wxUnusedVar(var);
-    wxUnusedVar(value);
     return false;
 #else // Win32
     // first get the size of the buffer
@@ -609,11 +604,15 @@ bool wxGetEnv(const wxString& var, wxString *value)
 #endif // WinCE/32
 }
 
-bool wxSetEnv(const wxString& var, const wxChar *value)
+bool wxSetEnv(const wxString& WXUNUSED_IN_WINCE(var),
+              const wxChar *WXUNUSED_IN_WINCE(value))
 {
     // some compilers have putenv() or _putenv() or _wputenv() but it's better
     // to always use Win32 function directly instead of dealing with them
-#if defined(__WIN32__) && !defined(__WXWINCE__)
+#ifdef __WXWINCE__
+    // no environment variables under CE
+    return false;
+#else
     if ( !::SetEnvironmentVariable(var, value) )
     {
         wxLogLastError(_T("SetEnvironmentVariable"));
@@ -622,11 +621,6 @@ bool wxSetEnv(const wxString& var, const wxChar *value)
     }
 
     return true;
-#else // no way to set env vars
-    // no environment variables under CE
-    wxUnusedVar(var);
-    wxUnusedVar(value);
-    return false;
 #endif
 }
 
@@ -946,11 +940,10 @@ bool wxShell(const wxString& command)
 }
 
 // Shutdown or reboot the PC
-bool wxShutdown(wxShutdownFlags wFlags)
+bool wxShutdown(wxShutdownFlags WXUNUSED_IN_WINCE(wFlags))
 {
 #ifdef __WXWINCE__
     // TODO-CE
-    wxUnusedVar(wFlags);
     return false;
 #elif defined(__WIN32__)
     bool bOK = true;