aboutsummaryrefslogtreecommitdiffstats
path: root/net/sipxportlib
diff options
context:
space:
mode:
authormiwi <miwi@FreeBSD.org>2007-04-10 01:29:42 +0800
committermiwi <miwi@FreeBSD.org>2007-04-10 01:29:42 +0800
commitb331edb6ea14353741b76a13c52b0be404b49921 (patch)
tree67f6f38b37fca2e5a29b83b5a76da19ac519a218 /net/sipxportlib
parent5fee692029ed35b871a974ff15bc0615b82f23ab (diff)
downloadfreebsd-ports-graphics-b331edb6ea14353741b76a13c52b0be404b49921.tar.gz
freebsd-ports-graphics-b331edb6ea14353741b76a13c52b0be404b49921.tar.zst
freebsd-ports-graphics-b331edb6ea14353741b76a13c52b0be404b49921.zip
- Fix build with gcc 4.1
Notes: sipxportlib contains numerous cases of casting a pointer to an int. Gcc 4.1 does not like this on amd64 systems. I have silenced the compilation error by first typecasting through a uintptr_t. This does not fix any underlying problems, but at least the code compiles. Approved by: maintainer
Diffstat (limited to 'net/sipxportlib')
-rw-r--r--net/sipxportlib/files/patch-src_os_OsMsg.cpp28
-rw-r--r--net/sipxportlib/files/patch-src_os_OsMsgQ.cpp19
-rw-r--r--net/sipxportlib/files/patch-src_os_OsStunAgentTask.cpp25
-rw-r--r--net/sipxportlib/files/patch-src_os_OsStunDatagramSocket.cpp28
-rw-r--r--net/sipxportlib/files/patch-src_os_OsSysLogTask.cpp24
-rw-r--r--net/sipxportlib/files/patch-src_os_OsTask.cpp19
-rw-r--r--net/sipxportlib/files/patch-src_os_OsTimer.cpp28
-rw-r--r--net/sipxportlib/files/patch-src_os_OsTimerTask.cpp19
-rw-r--r--net/sipxportlib/files/patch-src_os_linux_AdapterInfo.cpp32
-rw-r--r--net/sipxportlib/files/patch-src_os_linux_OsBSemLinux.cpp19
-rw-r--r--net/sipxportlib/files/patch-src_os_linux_OsTaskLinux.cpp74
-rw-r--r--net/sipxportlib/files/patch-src_utl_UtlContainable.cpp19
-rw-r--r--net/sipxportlib/files/patch-src_utl_UtlContainer.cpp29
-rw-r--r--net/sipxportlib/files/patch-src_utl_UtlVoidPtr.cpp28
14 files changed, 388 insertions, 3 deletions
diff --git a/net/sipxportlib/files/patch-src_os_OsMsg.cpp b/net/sipxportlib/files/patch-src_os_OsMsg.cpp
new file mode 100644
index 00000000000..e9389386ea9
--- /dev/null
+++ b/net/sipxportlib/files/patch-src_os_OsMsg.cpp
@@ -0,0 +1,28 @@
+--- src/os/OsMsg.cpp.orig Sat Apr 7 18:07:29 2007
++++ src/os/OsMsg.cpp Sat Apr 7 18:08:23 2007
+@@ -8,6 +8,7 @@
+
+ // SYSTEM INCLUDES
+ #include <assert.h>
++#include <stdint.h>
+
+ // APPLICATION INCLUDES
+ #include "os/OsMsg.h"
+@@ -150,7 +151,7 @@
+ //! Implements the interface for a UtlContainable
+ unsigned OsMsg::hash() const
+ {
+- return (unsigned) this;
++ return (unsigned) ((uintptr_t)this);
+ }
+
+ UtlContainableType OsMsg::getContainableType() const
+@@ -160,7 +161,7 @@
+
+ int OsMsg::compareTo(UtlContainable const* other) const
+ {
+- return ((unsigned) this) - ((unsigned) other);
++ return ((unsigned) ((uintptr_t)this)) - ((unsigned) ((uintptr_t)other));
+ }
+
+
diff --git a/net/sipxportlib/files/patch-src_os_OsMsgQ.cpp b/net/sipxportlib/files/patch-src_os_OsMsgQ.cpp
new file mode 100644
index 00000000000..8eee3a3f8a8
--- /dev/null
+++ b/net/sipxportlib/files/patch-src_os_OsMsgQ.cpp
@@ -0,0 +1,19 @@
+--- src/os/OsMsgQ.cpp.orig Sat Apr 7 18:13:52 2007
++++ src/os/OsMsgQ.cpp Sat Apr 7 18:14:22 2007
+@@ -11,6 +11,7 @@
+ #ifdef __pingtel_on_posix__
+ # include <pthread.h>
+ #endif
++#include <stdint.h>
+
+ #include "utl/UtlRscTrace.h"
+
+@@ -41,7 +42,7 @@
+ mName(name)
+ {
+ if (mName != "")
+- OsUtil::insertKeyValue(MSGQ_PREFIX, mName, (int) this);
++ OsUtil::insertKeyValue(MSGQ_PREFIX, mName, (int) ((uintptr_t)this));
+ }
+
+ // Destructor
diff --git a/net/sipxportlib/files/patch-src_os_OsStunAgentTask.cpp b/net/sipxportlib/files/patch-src_os_OsStunAgentTask.cpp
new file mode 100644
index 00000000000..82b556e54cd
--- /dev/null
+++ b/net/sipxportlib/files/patch-src_os_OsStunAgentTask.cpp
@@ -0,0 +1,25 @@
+--- src/os/OsStunAgentTask.cpp.orig Sat Apr 7 19:49:56 2007
++++ src/os/OsStunAgentTask.cpp Sat Apr 7 19:57:37 2007
+@@ -9,6 +9,7 @@
+
+ // SYSTEM INCLUDES
+ #include <assert.h>
++#include <stdint.h>
+
+ // APPLICATION INCLUDES
+ #include "os/OsStunAgentTask.h"
+@@ -374,12 +375,12 @@
+ pQueuedEvent = (OsQueuedEvent*) pTimer->getNotifier() ;
+ if (pQueuedEvent)
+ {
+- pQueuedEvent->setUserData((int) pSocket) ;
++ pQueuedEvent->setUserData((int) ((uintptr_t)pSocket)) ;
+ }
+ }
+ else
+ {
+- pTimer = new OsTimer(getMessageQueue(), (int) pSocket) ;
++ pTimer = new OsTimer(getMessageQueue(), (int) ((uintptr_t)pSocket)) ;
+ pQueuedEvent = (OsQueuedEvent*)pTimer->getNotifier();
+ }
+
diff --git a/net/sipxportlib/files/patch-src_os_OsStunDatagramSocket.cpp b/net/sipxportlib/files/patch-src_os_OsStunDatagramSocket.cpp
new file mode 100644
index 00000000000..02b77f8d378
--- /dev/null
+++ b/net/sipxportlib/files/patch-src_os_OsStunDatagramSocket.cpp
@@ -0,0 +1,28 @@
+--- src/os/OsStunDatagramSocket.cpp.orig Sat Apr 7 20:05:25 2007
++++ src/os/OsStunDatagramSocket.cpp Sat Apr 7 20:06:07 2007
+@@ -13,6 +13,7 @@
+ #ifndef _WIN32
+ #include <netinet/in.h>
+ #endif
++#include <stdint.h>
+
+ // APPLICATION INCLUDES
+ #include "os/OsStunDatagramSocket.h"
+@@ -61,7 +62,7 @@
+ mpNotification = pNotification ;
+ mStunOptions = iStunOptions ;
+
+- mpTimer = new OsTimer(pStunAgent->getMessageQueue(), (int) this) ;
++ mpTimer = new OsTimer(pStunAgent->getMessageQueue(), (int) ((uintptr_t)this)) ;
+
+ // If enabled, kick off first stun request
+ if (mbEnabled)
+@@ -602,7 +603,7 @@
+ pContact->eContactType = NAT_MAPPED;
+ pContact->iPort = mStunPort;
+
+- mpNotification->signal((int)pContact) ;
++ mpNotification->signal((int)((uintptr_t)pContact)) ;
+ mpNotification = NULL ;
+ }
+ }
diff --git a/net/sipxportlib/files/patch-src_os_OsSysLogTask.cpp b/net/sipxportlib/files/patch-src_os_OsSysLogTask.cpp
new file mode 100644
index 00000000000..0f09897dc7a
--- /dev/null
+++ b/net/sipxportlib/files/patch-src_os_OsSysLogTask.cpp
@@ -0,0 +1,24 @@
+--- src/os/OsSysLogTask.cpp.orig Sat Apr 7 18:56:44 2007
++++ src/os/OsSysLogTask.cpp Sat Apr 7 18:58:16 2007
+@@ -273,10 +273,10 @@
+ processConsoleEnable(FALSE);
+ break ;
+ case OsSysLogMsg::HEAD:
+- processHeadCommand((int) pSysLogMsg->getData());
++ processHeadCommand((int) ((uintptr_t)pSysLogMsg->getData()));
+ break ;
+ case OsSysLogMsg::TAIL:
+- processTailCommand((int) pSysLogMsg->getData());
++ processTailCommand((int) ((uintptr_t)pSysLogMsg->getData()));
+ break ;
+ case OsSysLogMsg::ADD_SOCKET:
+ data = (char*) pSysLogMsg->getData();
+@@ -298,7 +298,7 @@
+ processSetCallback((OsSysLogCallback) pSysLogMsg->getData());
+ break ;
+ case OsSysLogMsg::SET_FLUSH_PERIOD:
+- processSetFlushPeriod((int) pSysLogMsg->getData()) ;
++ processSetFlushPeriod((int) ((uintptr_t)pSysLogMsg->getData())) ;
+ break ;
+ case OsSysLogMsg::FLUSH_LOG:
+ processFlushLog((OsEvent*) pSysLogMsg->getData());
diff --git a/net/sipxportlib/files/patch-src_os_OsTask.cpp b/net/sipxportlib/files/patch-src_os_OsTask.cpp
new file mode 100644
index 00000000000..2049239dcc3
--- /dev/null
+++ b/net/sipxportlib/files/patch-src_os_OsTask.cpp
@@ -0,0 +1,19 @@
+--- src/os/OsTask.cpp.orig Sat Apr 7 19:13:07 2007
++++ src/os/OsTask.cpp Sat Apr 7 19:19:35 2007
+@@ -15,6 +15,7 @@
+
+ #include <stdio.h>
+ #include <stdarg.h>
++#include <stdint.h>
+
+ // APPLICATION INCLUDES
+ #include "os/OsExcept.h"
+@@ -168,7 +169,7 @@
+ mName.append(nameBuffer);
+
+ if (mName != "")
+- OsUtil::insertKeyValue(TASK_PREFIX, mName, (int) this);
++ OsUtil::insertKeyValue(TASK_PREFIX, mName, (int) ((uintptr_t)this));
+ }
+
+ // Destructor
diff --git a/net/sipxportlib/files/patch-src_os_OsTimer.cpp b/net/sipxportlib/files/patch-src_os_OsTimer.cpp
new file mode 100644
index 00000000000..4fa500b394a
--- /dev/null
+++ b/net/sipxportlib/files/patch-src_os_OsTimer.cpp
@@ -0,0 +1,28 @@
+--- src/os/OsTimer.cpp.orig Sat Apr 7 19:28:31 2007
++++ src/os/OsTimer.cpp Sat Apr 7 19:29:10 2007
+@@ -9,6 +9,7 @@
+
+ // SYSTEM INCLUDES
+ #include <assert.h>
++#include <stdint.h>
+
+ // APPLICATION INCLUDES
+ #include "os/OsTimer.h"
+@@ -256,7 +257,7 @@
+
+ unsigned OsTimer::hash() const
+ {
+- return (unsigned) this;
++ return (unsigned) ((uintptr_t)this);
+ }
+
+
+@@ -280,7 +281,7 @@
+
+ if (inVal->isInstanceOf(OsTimer::TYPE))
+ {
+- result = ((unsigned) this) - ((unsigned) inVal);
++ result = ((unsigned) ((uintptr_t)this)) - ((unsigned) ((uintptr_t)inVal));
+ }
+ else
+ {
diff --git a/net/sipxportlib/files/patch-src_os_OsTimerTask.cpp b/net/sipxportlib/files/patch-src_os_OsTimerTask.cpp
new file mode 100644
index 00000000000..8eb3c93d5bd
--- /dev/null
+++ b/net/sipxportlib/files/patch-src_os_OsTimerTask.cpp
@@ -0,0 +1,19 @@
+--- src/os/OsTimerTask.cpp.orig Sat Apr 7 19:40:53 2007
++++ src/os/OsTimerTask.cpp Sat Apr 7 19:41:56 2007
+@@ -9,6 +9,7 @@
+
+ // SYSTEM INCLUDES
+ #include <assert.h>
++#include <stdint.h>
+
+ // APPLICATION INCLUDES
+ #include "os/OsEvent.h"
+@@ -377,7 +378,7 @@
+ // Call the event routine if we are supposed to.
+ if (report)
+ {
+- timer->mpNotifier->signal((int) timer);
++ timer->mpNotifier->signal((int) ((uintptr_t)timer));
+ }
+ }
+
diff --git a/net/sipxportlib/files/patch-src_os_linux_AdapterInfo.cpp b/net/sipxportlib/files/patch-src_os_linux_AdapterInfo.cpp
index 8b6385adeda..78e7f7473d1 100644
--- a/net/sipxportlib/files/patch-src_os_linux_AdapterInfo.cpp
+++ b/net/sipxportlib/files/patch-src_os_linux_AdapterInfo.cpp
@@ -1,6 +1,14 @@
---- ./src/os/linux/AdapterInfo.cpp.orig Tue Jan 2 17:19:45 2007
-+++ ./src/os/linux/AdapterInfo.cpp Tue Jan 2 17:20:04 2007
-@@ -68,7 +68,7 @@
+--- src/os/linux/AdapterInfo.cpp.orig Wed Aug 30 01:18:24 2006
++++ src/os/linux/AdapterInfo.cpp Sat Apr 7 20:15:33 2007
+@@ -21,6 +21,7 @@
+ #include <sys/types.h>
+ #include <unistd.h>
+ #include <net/if.h>
++#include <stdint.h>
+
+ // APPLICATION INCLUDES
+ #include <os/HostAdapterAddress.h>
+@@ -68,7 +69,7 @@
else
{
rc = TRUE;
@@ -9,3 +17,21 @@
// Get the number of returned addresses from ifc_len.
numAddresses = ifconf_structure.ifc_len / sizeof (struct ifreq);
int j = 0;
+@@ -94,7 +95,7 @@
+ numAddresses = j;
+ #else
+ void* ptr;
+- for (ptr = ifreq_array; (int) ptr < ((int) ifreq_array) + ifconf_structure.ifc_len; )
++ for (ptr = ifreq_array; (uintptr_t) ptr < ((uintptr_t) ifreq_array) + ifconf_structure.ifc_len; )
+ {
+ struct ifreq* ifr = (struct ifreq*) ptr;
+
+@@ -102,7 +103,7 @@
+ if (ifr->ifr_addr.sa_len > sizeof(struct sockaddr))
+ len = ifr->ifr_addr.sa_len;
+
+- ptr = (void *) ((int) ptr + sizeof(ifr->ifr_name) + len);
++ ptr = (void *) ((uintptr_t) ptr + sizeof(ifr->ifr_name) + len);
+
+ // The body of this if statement should mirror the for loop above...
+ if (ifr->ifr_addr.sa_family == AF_INET)
diff --git a/net/sipxportlib/files/patch-src_os_linux_OsBSemLinux.cpp b/net/sipxportlib/files/patch-src_os_linux_OsBSemLinux.cpp
new file mode 100644
index 00000000000..0f2af2d321a
--- /dev/null
+++ b/net/sipxportlib/files/patch-src_os_linux_OsBSemLinux.cpp
@@ -0,0 +1,19 @@
+--- src/os/linux/OsBSemLinux.cpp.orig Sat Apr 7 20:19:17 2007
++++ src/os/linux/OsBSemLinux.cpp Sat Apr 7 20:19:47 2007
+@@ -7,6 +7,7 @@
+
+ // SYSTEM INCLUDES
+ #include <assert.h>
++#include <stdint.h>
+
+ // APPLICATION INCLUDES
+ #include "os/OsDefs.h"
+@@ -58,7 +59,7 @@
+ {
+ OsSysLog::add(FAC_KERNEL, PRI_ERR,
+ "OsBSemLinux::~OsBSemLinux pt_sem_destroy returned %d in task %u",
+- res, (unsigned int)pthread_self()
++ res, (unsigned int)((uintptr_t)pthread_self())
+ );
+ }
+ # ifdef OS_SYNC_DEBUG
diff --git a/net/sipxportlib/files/patch-src_os_linux_OsTaskLinux.cpp b/net/sipxportlib/files/patch-src_os_linux_OsTaskLinux.cpp
new file mode 100644
index 00000000000..c25e43d6806
--- /dev/null
+++ b/net/sipxportlib/files/patch-src_os_linux_OsTaskLinux.cpp
@@ -0,0 +1,74 @@
+--- src/os/linux/OsTaskLinux.cpp.orig Sat Apr 7 21:29:21 2007
++++ src/os/linux/OsTaskLinux.cpp Sat Apr 7 21:32:30 2007
+@@ -321,14 +321,14 @@
+ {
+ int taskId;
+
+- taskId = (int)pthread_self();
++ taskId = (int)((uintptr_t)pthread_self());
+ return OsTaskLinux::getTaskById(taskId);
+ }
+
+ // Return an Id of the currently executing task
+ OsStatus OsTaskLinux::getCurrentTaskId(int &rid)
+ {
+- rid = (int)pthread_self();
++ rid = (int)((uintptr_t)pthread_self());
+ return OS_SUCCESS;
+ }
+
+@@ -435,7 +435,7 @@
+
+ //if started, return the taskId, otherwise return -1
+ if (isStarted())
+- rId = (int)mTaskId;
++ rId = (int)((uintptr_t)mTaskId);
+ else
+ {
+ retVal = OS_TASK_NOT_STARTED;
+@@ -510,8 +510,8 @@
+ {
+ // Enter the thread id into the global name database so that given the
+ // thread id we will be able to find the corresponding OsTask object
+- sprintf(idString, "%d", (int)mTaskId); // convert the id to a string
+- OsUtil::insertKeyValue(TASKID_PREFIX, idString, (int) this);
++ sprintf(idString, "%d", (int)((uintptr_t)mTaskId)); // convert the id to a string
++ OsUtil::insertKeyValue(TASKID_PREFIX, idString, (int) ((uintptr_t)this));
+
+ mState = STARTED;
+ return TRUE;
+@@ -531,10 +531,10 @@
+
+ OsSysLog::add(FAC_KERNEL, PRI_DEBUG,
+ "OsTaskLinux::doLinuxTerminateTask, deleting task thread: %x,"
+- " force = %d", (int)mTaskId, doForce);
++ " force = %d", (int)((uintptr_t)mTaskId), doForce);
+
+ // if there is no low-level task, or entry in the name database, just return
+- if ((mState != UNINITIALIZED) && ((int)mTaskId != 0))
++ if ((mState != UNINITIALIZED) && ((int)((uintptr_t)mTaskId) != 0))
+ {
+ // DEBUGGING HACK: Suspend requestor if target is suspended $$$
+ while (isSuspended())
+@@ -695,10 +695,10 @@
+ OsStatus res;
+ char idString[15];
+
+- if ( 0 != (int)mTaskId )
++ if ( 0 != (uintptr_t)mTaskId )
+ {
+ // Remove the key from the internal task list, before terminating it
+- sprintf(idString, "%d", (int)mTaskId); // convert the id to a string
++ sprintf(idString, "%d", (int)((uintptr_t)mTaskId)); // convert the id to a string
+ res = OsUtil::deleteKeyValue(TASKID_PREFIX, idString);
+ }
+ else
+@@ -710,7 +710,7 @@
+ {
+ OsSysLog::add(FAC_KERNEL, PRI_ERR, "OsTaskLinux::doLinuxTerminateTask, failed to delete"
+ " mTaskId = 0x%08x, key '%s', returns %d",
+- (int) mTaskId, idString, res);
++ (int) ((uintptr_t)mTaskId), idString, res);
+ }
+ mTaskId = 0;
+
diff --git a/net/sipxportlib/files/patch-src_utl_UtlContainable.cpp b/net/sipxportlib/files/patch-src_utl_UtlContainable.cpp
new file mode 100644
index 00000000000..9ed6c347e28
--- /dev/null
+++ b/net/sipxportlib/files/patch-src_utl_UtlContainable.cpp
@@ -0,0 +1,19 @@
+--- src/utl/UtlContainable.cpp.orig Sat Apr 7 17:08:53 2007
++++ src/utl/UtlContainable.cpp Sat Apr 7 17:09:20 2007
+@@ -8,6 +8,7 @@
+
+ // SYSTEM INCLUDES
+ #include <string.h>
++#include <stdint.h>
+
+ // APPLICATION INCLUDES
+ #include "utl/UtlContainable.h"
+@@ -60,7 +61,7 @@
+ /// Provides a hash function that uses the object pointer as the hash value.
+ unsigned UtlContainable::directHash() const
+ {
+- return (unsigned) this;
++ return (unsigned) ((uintptr_t)this);
+ }
+
+ /// Provides a hash function appropriate for null-terminated string values.
diff --git a/net/sipxportlib/files/patch-src_utl_UtlContainer.cpp b/net/sipxportlib/files/patch-src_utl_UtlContainer.cpp
new file mode 100644
index 00000000000..4ef9c29cc2e
--- /dev/null
+++ b/net/sipxportlib/files/patch-src_utl_UtlContainer.cpp
@@ -0,0 +1,29 @@
+--- src/utl/UtlContainer.cpp.orig Sat Apr 7 17:16:07 2007
++++ src/utl/UtlContainer.cpp Sat Apr 7 17:16:47 2007
+@@ -7,6 +7,8 @@
+ //////
+
+ // SYSTEM INCLUDES
++#include <stdint.h>
++
+ // APPLICATION INCLUDES
+ #include "utl/UtlContainer.h"
+ #include "utl/UtlLink.h"
+@@ -86,7 +88,7 @@
+ unsigned UtlContainer::hash() const
+ {
+ // default implementation
+- return (unsigned) this;
++ return (unsigned) ((uintptr_t)this);
+ }
+
+
+@@ -109,7 +111,7 @@
+ */
+ int UtlContainer::compareTo(const UtlContainable* otherObject) const
+ {
+- return ((unsigned) this) - ((unsigned) otherObject);
++ return ((unsigned) ((uintptr_t)this)) - ((unsigned) ((uintptr_t)otherObject));
+ }
+
+
diff --git a/net/sipxportlib/files/patch-src_utl_UtlVoidPtr.cpp b/net/sipxportlib/files/patch-src_utl_UtlVoidPtr.cpp
new file mode 100644
index 00000000000..d4301e0d027
--- /dev/null
+++ b/net/sipxportlib/files/patch-src_utl_UtlVoidPtr.cpp
@@ -0,0 +1,28 @@
+--- src/utl/UtlVoidPtr.cpp.orig Sat Apr 7 16:57:45 2007
++++ src/utl/UtlVoidPtr.cpp Sat Apr 7 17:00:29 2007
+@@ -8,6 +8,7 @@
+
+ // SYSTEM INCLUDES
+ #include <string.h>
++#include <stdint.h>
+
+ // APPLICATION INCLUDES
+ #include "utl/UtlInt.h"
+@@ -57,7 +58,7 @@
+
+ unsigned UtlVoidPtr::hash() const
+ {
+- return (unsigned) mpValue ;
++ return (unsigned) ((uintptr_t)mpValue) ;
+ }
+
+
+@@ -75,7 +76,7 @@
+
+ if (inVal->isInstanceOf(UtlVoidPtr::TYPE))
+ {
+- result = ((unsigned) mpValue) - ((unsigned) ((UtlVoidPtr*) inVal)->mpValue);
++ result = ((unsigned) ((uintptr_t)mpValue)) - ((unsigned) ((uintptr_t)((UtlVoidPtr*) inVal)->mpValue));
+ }
+ else
+ {