You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by da...@apache.org on 2004/09/06 09:34:12 UTC
cvs commit: ws-axis/c/src/common AxisTime.cpp
damitha 2004/09/06 00:34:12
Modified: c/src/common AxisTime.cpp
Log:
Applied Valentine Kouznetsov's patch to support Solaris
Revision Changes Path
1.27 +15 -15 ws-axis/c/src/common/AxisTime.cpp
Index: AxisTime.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/common/AxisTime.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- AxisTime.cpp 20 Aug 2004 13:03:37 -0000 1.26
+++ AxisTime.cpp 6 Sep 2004 07:34:12 -0000 1.27
@@ -18,7 +18,7 @@
* @author Damitha Kumarage (damitha@opensource.lk, damitha@jkcsworld.com)
*
*/
-
+#include <math.h>
#include <stdio.h>
#include "AxisTime.h"
#include "AxisUtils.h"
@@ -250,18 +250,18 @@
m_TM.tm_year -= 1900;
m_TM.tm_mon--;
m_TM.tm_isdst = -1;
-#if !defined(WIN32) && !defined(AIX) && !defined( __OS400__ )
+#if !defined(WIN32) && !defined(AIX) && !defined( __OS400__ ) && !defined(__sun)
m_TM.tm_zone = NULL;
m_TM.tm_gmtoff = -1;
#endif
- cTemp2 = strpbrk (m_sValue.c_str (), "T");
+ cTemp2 = const_cast<char*>(strpbrk (m_sValue.c_str (), "T"));
cTemp3 = strrchr (cTemp2, ':');
cTemp3[0] = '\0';
intLen = strlen (cTemp2);
cTemp3[0] = ':';
/*if the timezone is represented adding 'Z' at the end */
- if ((cTemp = strpbrk (m_sValue.c_str (), "Z")) != NULL)
+ if ((cTemp = const_cast<char*>(strpbrk (m_sValue.c_str (), "Z"))) != NULL)
{
time_t temp = mktime (&m_TM);
if (temp == -1)
@@ -296,7 +296,7 @@
time_t t = mktime (&m_TM);
if (t == -1)
return AXIS_FAIL;
- t = abs (t - d);
+ t = fabs (t - d);
pTm = gmtime (&t);
memcpy (&m_TMUTC, pTm, sizeof (tm));
}
@@ -329,14 +329,14 @@
m_TM.tm_min = 0;
m_TM.tm_sec = 0;
m_TM.tm_isdst = -1;
-#if !defined(WIN32) && !defined(AIX) && !defined( __OS400__ )
+#if !defined(WIN32) && !defined(AIX) && !defined( __OS400__ ) && !defined(__sun)
m_TM.tm_zone = NULL;
m_TM.tm_gmtoff = -1;
#endif
- cTemp3 = strpbrk (m_sValue.c_str (), ":");
+ cTemp3 = const_cast<char*>(strpbrk (m_sValue.c_str (), ":"));
/* if the timezone is represented adding 'Z' at the end */
- if ((cTemp = strpbrk (m_sValue.c_str (), "Z")) != NULL)
+ if ((cTemp = const_cast<char*>(strpbrk (m_sValue.c_str (), "Z"))) != NULL)
{
time_t timeInSecs = mktime (&m_TM);
if (timeInSecs == -1)
@@ -346,9 +346,9 @@
}
else if (cTemp3 != NULL)
{
- cUtc = strrchr (m_sValue.c_str (), '+');
+ cUtc = const_cast<char*>(strrchr (m_sValue.c_str (), '+'));
if (cUtc == NULL)
- cUtc = strrchr (m_sValue.c_str (), '-');
+ cUtc = const_cast<char*>(strrchr (m_sValue.c_str (), '-'));
time_t timeInSecs = mktime (&m_TM);
if (timeInSecs == -1)
return AXIS_FAIL;
@@ -368,7 +368,7 @@
time_t t = mktime (&m_TM);
if (t == -1)
return AXIS_FAIL;
- t = abs (t - d);
+ t = fabs (t - d);
pTm = gmtime (&t);
memcpy (&m_TMUTC, pTm, sizeof (tm));
}
@@ -399,7 +399,7 @@
m_TM.tm_mon = 0;
m_TM.tm_mday = 1; /* Day of month (1 - 31) */
m_TM.tm_isdst = -1;
-#if !defined(WIN32) && !defined(AIX) && !defined( __OS400__ )
+#if !defined(WIN32) && !defined(AIX) && !defined( __OS400__ ) && !defined(__sun)
m_TM.tm_zone = NULL;
m_TM.tm_gmtoff = -1;
#endif
@@ -417,7 +417,7 @@
cTemp3[0] = ':';
/* if the timezone is represented adding 'Z' at the end */
- if ((cTemp = strpbrk (m_sValue.c_str (), "Z")) != NULL)
+ if ((cTemp = const_cast<char*>(strpbrk (m_sValue.c_str (), "Z"))) != NULL)
{
time_t temp = mktime (&m_TM);
if (temp == -1)
@@ -452,7 +452,7 @@
time_t t = mktime (&m_TM);
if (t == -1)
return AXIS_FAIL;
- t = abs (t - d);
+ t = fabs (t - d);
pTm = gmtime (&t);
memcpy (&m_TMUTC, pTm, sizeof (tm));
}
@@ -583,4 +583,4 @@
}
*/
-AXIS_CPP_NAMESPACE_END
\ No newline at end of file
+AXIS_CPP_NAMESPACE_END