axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject cvs commit: ws-axis/c/src/engine Axis.cpp
Date Thu, 23 Dec 2004 09:14:26 GMT
samisa      2004/12/23 01:14:26

  Modified:    c/include/axis TypeMapping.hpp
               c/src/common TypeMapping.cpp
               c/src/engine Axis.cpp
  Log:
  Minor fixes to get rid of "Potential Leak" messages by purifier tool.
  I also replaced the macro and also used direct type instead of defined types to make the
code more readable.
  CVS: ----------------------------------------------------------------------
  CVS: PR:
  CVS:   If this change addresses a PR in the problem report tracking
  CVS:   database, then enter the PR number(s) here.
  CVS: Obtained from:
  CVS:   If this change has been taken from another system, such as NCSA,
  CVS:   then name the system in this line, otherwise delete it.
  CVS: Submitted by:
  CVS:   If this code has been contributed to Apache by someone else; i.e.,
  CVS:   they sent us a patch or a new module, then include their name/email
  CVS:   address here. If this is your work then delete this line.
  CVS: Reviewed by:
  CVS:   If we are doing pre-commit code reviews and someone else has
  CVS:   reviewed your changes, include their name(s) here.
  CVS:   If you have not had it reviewed then delete this line.
  
  Revision  Changes    Path
  1.3       +3 -2      ws-axis/c/include/axis/TypeMapping.hpp
  
  Index: TypeMapping.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/TypeMapping.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TypeMapping.hpp	17 Dec 2004 11:49:44 -0000	1.2
  +++ TypeMapping.hpp	23 Dec 2004 09:14:26 -0000	1.3
  @@ -56,11 +56,12 @@
   public:
       static XSDTYPE map(const AxisXMLCh* sType);
       static void initialize();
  +	static void uninitialize();
   
   #if (defined(AIX) || (defined(_MSC_VER) && _MSC_VER >= 1300) || defined( __OS400__
) || defined(__sun))
  -    static std::map<AxisXMLString, XSDTYPE> m_sTypeMap;
  +	static std::map<std::string, XSDTYPE> m_sTypeMap;
   #else
  -    static std::map<const AxisXMLString, XSDTYPE> m_sTypeMap;
  +	static std::map<const std::string, XSDTYPE> m_sTypeMap;
   #endif
       static volatile bool m_bInit;
       TypeMapping();
  
  
  
  1.20      +39 -29    ws-axis/c/src/common/TypeMapping.cpp
  
  Index: TypeMapping.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/TypeMapping.cpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- TypeMapping.cpp	23 Nov 2004 17:21:02 -0000	1.19
  +++ TypeMapping.cpp	23 Dec 2004 09:14:26 -0000	1.20
  @@ -50,42 +50,52 @@
   {
       if (!m_bInit)
       {
  -        m_sTypeMap[__TRC ("int")] = XSD_INT;
  -        m_sTypeMap[__TRC ("boolean")] = XSD_BOOLEAN;
  -        m_sTypeMap[__TRC ("unsignedInt")] = XSD_UNSIGNEDINT;
  -        m_sTypeMap[__TRC ("short")] = XSD_SHORT;
  -        m_sTypeMap[__TRC ("unsignedShort")] = XSD_UNSIGNEDSHORT;
  -        m_sTypeMap[__TRC ("byte")] = XSD_BYTE;
  -        m_sTypeMap[__TRC ("unsignedByte")] = XSD_UNSIGNEDBYTE;
  -        m_sTypeMap[__TRC ("long")] = XSD_LONG;
  -        m_sTypeMap[__TRC ("integer")] = XSD_INTEGER;
  -        m_sTypeMap[__TRC ("unsignedLong")] = XSD_UNSIGNEDLONG;
  -        m_sTypeMap[__TRC ("float")] = XSD_FLOAT;
  -        m_sTypeMap[__TRC ("double")] = XSD_DOUBLE;
  -        m_sTypeMap[__TRC ("decimal")] = XSD_DECIMAL;
  -        m_sTypeMap[__TRC ("string")] = XSD_STRING;
  -        m_sTypeMap[__TRC ("base64Binary")] = XSD_BASE64BINARY;
  -        m_sTypeMap[__TRC ("hexBinary")] = XSD_HEXBINARY;
  -        m_sTypeMap[__TRC ("anyURI")] = XSD_ANYURI;
  -        m_sTypeMap[__TRC ("QName")] = XSD_QNAME;
  -        m_sTypeMap[__TRC ("duration")] = XSD_DURATION;
  -        m_sTypeMap[__TRC ("dateTime")] = XSD_DATETIME;
  -        m_sTypeMap[__TRC ("date")] = XSD_DATE;
  -        m_sTypeMap[__TRC ("time")] = XSD_TIME;
  -        m_sTypeMap[__TRC ("gYearMonth")] = XSD_YEARMONTH;
  -        m_sTypeMap[__TRC ("gYear")] = XSD_YEAR;
  -        m_sTypeMap[__TRC ("gMonthDay")] = XSD_MONTHDAY;
  -        m_sTypeMap[__TRC ("gDay")] = XSD_DAY;
  -        m_sTypeMap[__TRC ("gMonth")] = XSD_MONTH;
  +        m_sTypeMap[std::string ("int")] = XSD_INT;
  +        m_sTypeMap[std::string ("boolean")] = XSD_BOOLEAN;
  +        m_sTypeMap[std::string ("unsignedInt")] = XSD_UNSIGNEDINT;
  +        m_sTypeMap[std::string ("short")] = XSD_SHORT;
  +        m_sTypeMap[std::string ("unsignedShort")] = XSD_UNSIGNEDSHORT;
  +        m_sTypeMap[std::string ("byte")] = XSD_BYTE;
  +        m_sTypeMap[std::string ("unsignedByte")] = XSD_UNSIGNEDBYTE;
  +        m_sTypeMap[std::string ("long")] = XSD_LONG;
  +        m_sTypeMap[std::string ("integer")] = XSD_INTEGER;
  +        m_sTypeMap[std::string ("unsignedLong")] = XSD_UNSIGNEDLONG;
  +        m_sTypeMap[std::string ("float")] = XSD_FLOAT;
  +        m_sTypeMap[std::string ("double")] = XSD_DOUBLE;
  +        m_sTypeMap[std::string ("decimal")] = XSD_DECIMAL;
  +        m_sTypeMap[std::string ("std::string")] = XSD_STRING;
  +        m_sTypeMap[std::string ("base64Binary")] = XSD_BASE64BINARY;
  +        m_sTypeMap[std::string ("hexBinary")] = XSD_HEXBINARY;
  +        m_sTypeMap[std::string ("anyURI")] = XSD_ANYURI;
  +        m_sTypeMap[std::string ("QName")] = XSD_QNAME;
  +        m_sTypeMap[std::string ("duration")] = XSD_DURATION;
  +        m_sTypeMap[std::string ("dateTime")] = XSD_DATETIME;
  +        m_sTypeMap[std::string ("date")] = XSD_DATE;
  +        m_sTypeMap[std::string ("time")] = XSD_TIME;
  +        m_sTypeMap[std::string ("gYearMonth")] = XSD_YEARMONTH;
  +        m_sTypeMap[std::string ("gYear")] = XSD_YEAR;
  +        m_sTypeMap[std::string ("gMonthDay")] = XSD_MONTHDAY;
  +        m_sTypeMap[std::string ("gDay")] = XSD_DAY;
  +        m_sTypeMap[std::string ("gMonth")] = XSD_MONTH;
           m_bInit = true;
       }
   }
   
  +void TypeMapping::uninitialize()
  +{
  +    if (m_bInit)
  +	{
  +        m_sTypeMap.clear();
  +		m_bInit = false;
  +	}
  +}
  +
  +
   XSDTYPE TypeMapping::map (const AxisXMLCh* sType)
   {
  -    if (m_sTypeMap.find (sType) != m_sTypeMap.end ())
  +    if (m_sTypeMap.find (std::string(sType)) != m_sTypeMap.end ())
       {
  -        return m_sTypeMap[sType];
  +        return m_sTypeMap[std::string(sType)];
       }
       return XSD_UNKNOWN;
   }
  
  
  
  1.86      +1 -0      ws-axis/c/src/engine/Axis.cpp
  
  Index: Axis.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/engine/Axis.cpp,v
  retrieving revision 1.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- Axis.cpp	20 Dec 2004 07:26:14 -0000	1.85
  +++ Axis.cpp	23 Dec 2004 09:14:26 -0000	1.86
  @@ -395,6 +395,7 @@
   int uninitialize_module ()
   {
       g_bModuleInitialize = false;
  +	TypeMapping::uninitialize();
       SOAPTransportFactory::uninitialize();
       ModuleUnInitialize ();
       SoapKeywordMapping::uninitialize ();
  
  
  

Mime
View raw message