[Mapguide_dev] svn commit: r1034 - Miscellaneous code cleanups and
fixes.
Steve Dang
steve.dang at autodesk.com
Fri Jan 5 15:52:58 EST 2007
Revision: 1034
Author: stevedang
Date: 2:38:18 PM, Friday, January 05, 2007
Message:
MG456 (Miscellaneous code cleanups and fixes)
- Added MG_UNUSED_ARG macro to keep compilers quiet about unused
parameters.
- Removed all other UNUSED macros.
----
Modified : /trunk/MgDev/Common/Foundation/FoundationDefs.h
Modified :
/trunk/MgDev/Common/MapGuideCommon/Services/ConnectionProperties.cpp
Modified :
/trunk/MgDev/Common/MapGuideCommon/Services/ServerConnectionImp.cpp
Modified : /trunk/MgDev/Common/PlatformBase/Services/FeatureSet.cpp
Modified : /trunk/MgDev/Server/src/Gws/GwsCommon/GwsCommon.cpp
Modified : /trunk/MgDev/Server/src/Gws/GwsCommon/GwsCommonFdoUtils.cpp
Modified : /trunk/MgDev/Server/src/Gws/GwsCommon/GwsObjectImpl.cpp
Modified : /trunk/MgDev/Server/src/Gws/GwsCommon/GwsXmlUtils.cpp
Modified : /trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsFdoCommand.cpp
Modified : /trunk/MgDev/Web/src/HttpHandler/HttpHeader.cpp
Index: C:/Projects/MgDev/OS/Common/PlatformBase/Services/FeatureSet.cpp
===================================================================
--- C:/Projects/MgDev/OS/Common/PlatformBase/Services/FeatureSet.cpp
(revision 1033)
+++ C:/Projects/MgDev/OS/Common/PlatformBase/Services/FeatureSet.cpp
(revision 1034)
@@ -46,7 +46,7 @@
/// set based on the result of a select command</remarks>
void MgFeatureSet::FromReader(MgFeatureReader* featureReader)
{
- UNUSED(featureReader);
+ MG_UNUSED_ARG(featureReader);
}
//////////////////////////////////////////////////////////////////
Index:
C:/Projects/MgDev/OS/Common/MapGuideCommon/Services/ConnectionProperties
.cpp
===================================================================
---
C:/Projects/MgDev/OS/Common/MapGuideCommon/Services/ConnectionProperties
.cpp (revision 1033)
+++
C:/Projects/MgDev/OS/Common/MapGuideCommon/Services/ConnectionProperties
.cpp (revision 1034)
@@ -177,7 +177,7 @@
/// </summary>
void MgConnectionProperties::Serialize(MgStream* stream)
{
- UNUSED(stream);
+ MG_UNUSED_ARG(stream);
}
/// <summary>
@@ -185,7 +185,7 @@
/// </summary>
void MgConnectionProperties::Deserialize(MgStream* stream)
{
- UNUSED(stream);
+ MG_UNUSED_ARG(stream);
}
/// \brief
Index:
C:/Projects/MgDev/OS/Common/MapGuideCommon/Services/ServerConnectionImp.
cpp
===================================================================
---
C:/Projects/MgDev/OS/Common/MapGuideCommon/Services/ServerConnectionImp.
cpp (revision 1033)
+++
C:/Projects/MgDev/OS/Common/MapGuideCommon/Services/ServerConnectionImp.
cpp (revision 1034)
@@ -104,7 +104,7 @@
if (-1 == connectResult)
{
int err = ACE_OS::last_error();
- UNUSED(err);
+ MG_UNUSED_ARG(err);
// Could not connect
delete mServer;
mServer = NULL;
Index: C:/Projects/MgDev/OS/Common/Foundation/FoundationDefs.h
===================================================================
--- C:/Projects/MgDev/OS/Common/Foundation/FoundationDefs.h (revision
1033)
+++ C:/Projects/MgDev/OS/Common/Foundation/FoundationDefs.h
(revision 1034)
@@ -168,16 +168,7 @@
/// Byte array.
typedef unsigned char* BYTE_ARRAY_OUT;
-#ifdef _WIN32
-#define UNUSED(var)
-#define UNUSED_BOOL(var)
-#define UNUSED_ENUM(var, type)
-#define UNUSED_STR(var)
-#else
-#define UNUSED(var) (var=0)
-#define UNUSED_BOOL(var) (var=false)
-#define UNUSED_ENUM(var, type) (var=(type)0)
-#define UNUSED_STR(var) (var.length())
-#endif
+// Keep compilers quiet about unused parameters.
+#define MG_UNUSED_ARG(a) static_cast<void>(&(a))
-#endif // MGCOMMONDEFS_H_
+#endif // MGFOUNDATIONDEFS_H_
Index: C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsXmlUtils.cpp
===================================================================
--- C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsXmlUtils.cpp
(revision 1033)
+++ C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsXmlUtils.cpp
(revision 1034)
@@ -65,7 +65,7 @@
void CGwsStringCollectionSaxHandler::XmlCharacters(FdoXmlSaxContext*
ctx, FdoString* chars)
{
- ctx = 0; // For "unreferenced formal parameter" warning
+ static_cast<void>(&(ctx)); // For "unreferenced formal parameter"
warning
if (m_strcoll) {
FdoPtr<FdoStringCollection> tcoll = FdoStringCollection::Create
(chars, m_sdelimiter);
Index: C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsCommon.cpp
===================================================================
--- C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsCommon.cpp
(revision 1033)
+++ C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsCommon.cpp
(revision 1034)
@@ -22,8 +22,8 @@
LPVOID lpReserved
)
{
- hModule = 0; // For "unreferenced formal parameter" warning
- lpReserved = 0; // For "unreferenced formal parameter" warning
+ static_cast<void>(&(hModule)); // For "unreferenced formal
parameter" warning
+ static_cast<void>(&(lpReserved)); // For "unreferenced formal
parameter" warning
switch (ul_reason_for_call)
{
Index: C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsObjectImpl.cpp
===================================================================
--- C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsObjectImpl.cpp
(revision 1033)
+++ C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsObjectImpl.cpp
(revision 1034)
@@ -276,7 +276,7 @@
void CGwsObject::Write (FdoXmlWriter * writer)
{
- writer = 0; // For "unreferenced formal parameter" warning
+ static_cast<void>(&(writer)); // For "unreferenced formal
parameter" warning
}
Index:
C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsCommonFdoUtils.cpp
===================================================================
--- C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsCommonFdoUtils.cpp
(revision 1033)
+++ C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsCommonFdoUtils.cpp
(revision 1034)
@@ -749,7 +749,7 @@
const wchar_t * ltname
)
{
- ltname; // For "unreferenced formal parameter" warning
+ static_cast<void>(&(ltname)); // For "unreferenced formal
parameter" warning
static GWSExtendedFeatureId s_fid;
Index:
C:/Projects/MgDev/OS/Server/src/Gws/GwsQueryEngine/GwsFdoCommand.cpp
===================================================================
--- C:/Projects/MgDev/OS/Server/src/Gws/GwsQueryEngine/GwsFdoCommand.cpp
(revision 1033)
+++ C:/Projects/MgDev/OS/Server/src/Gws/GwsQueryEngine/GwsFdoCommand.cpp
(revision 1034)
@@ -76,7 +76,7 @@
////////////////////////////////////////////////////////////////////////
///////
EGwsStatus CGwsFdoCommand::Init (const wchar_t* pFDOCommandClass
/*NULL*/)
{
- pFDOCommandClass; // For "unreferenced formal parameter" warning
+ static_cast<void>(&(pFDOCommandClass)); // For "unreferenced formal
parameter" warning
// initilaize class definition
if(m_classDef == NULL)
@@ -193,7 +193,7 @@
////////////////////////////////////////////////////////////////////////
///////
EGwsStatus CGwsFdoCommand::Execute (CGwsMutableFeature & feature)
{
- feature; // For "unreferenced formal parameter" warning
+ static_cast<void>(&(feature)); // For "unreferenced formal
parameter" warning
return eGwsNotSupported;
}
@@ -211,7 +211,7 @@
////////////////////////////////////////////////////////////////////////
///////
EGwsStatus CGwsFdoCommand::Execute (const GWSFeatureId & featid)
{
- featid; // For "unreferenced formal parameter" warning
+ static_cast<void>(&(featid)); // For "unreferenced formal
parameter" warning
return eGwsNotSupported;
}
@@ -228,9 +228,9 @@
int ubound
)
{
- featids; // For "unreferenced formal parameter" warning
- lbound; // For "unreferenced formal parameter" warning
- ubound; // For "unreferenced formal parameter" warning
+ static_cast<void>(&(featids)); // For "unreferenced formal
parameter" warning
+ static_cast<void>(&(lbound)); // For "unreferenced formal
parameter" warning
+ static_cast<void>(&(ubound)); // For "unreferenced formal
parameter" warning
return eGwsNotSupported;
}
Index: C:/Projects/MgDev/OS/Web/src/HttpHandler/HttpHeader.cpp
===================================================================
--- C:/Projects/MgDev/OS/Web/src/HttpHandler/HttpHeader.cpp
(revision 1033)
+++ C:/Projects/MgDev/OS/Web/src/HttpHandler/HttpHeader.cpp (revision
1034)
@@ -206,7 +206,7 @@
/// </returns>
MgStringCollection* MgHttpHeader::GetHeaders(CREFSTRING name)
{
- UNUSED_STR(name);
+ MG_UNUSED_ARG(name);
// TODO: Return proper string collection here
Ptr<MgStringCollection> mgsCollection;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-internals/attachments/20070105/247dbbfe/attachment.html
More information about the Mapguide-internals
mailing list