Bug 794240 followup: Fixes implicit function warning that broke linkage + symmetric fixes r=jesup
authorJan-Ivar Bruaroey <jib@mozilla.com>
Wed, 19 Dec 2012 13:00:49 -0500
changeset 125658 bafbc8d9c6b8bd686e0e36d40aa6f9ee600e1ba7
parent 125657 21bd64a6b46d231bfe4b0f881b9ad88b1cb3dce6
child 125659 65b79c7b41050b2340eac68844eb77b8586c47bf
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs794240
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 794240 followup: Fixes implicit function warning that broke linkage + symmetric fixes r=jesup
media/webrtc/signaling/src/sipcc/core/sipstack/sip_platform_task.c
media/webrtc/signaling/src/sipcc/cpr/android/cpr_android_init.c
media/webrtc/signaling/src/sipcc/cpr/android/cpr_android_socket.c
media/webrtc/signaling/src/sipcc/cpr/android/cpr_android_timers_using_select.c
media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_timers_using_select.c
media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_timers_using_select.c
--- a/media/webrtc/signaling/src/sipcc/core/sipstack/sip_platform_task.c
+++ b/media/webrtc/signaling/src/sipcc/core/sipstack/sip_platform_task.c
@@ -17,16 +17,18 @@
 #include "sip_common_transport.h"
 #include "phntask.h"
 #include "phone_debug.h"
 #include "util_string.h"
 #include "ccsip_platform_tcp.h"
 #include "ccsip_task.h"
 #include "sip_socket_api.h"
 #include "platform_api.h"
+#include <sys/stat.h>
+#include "prprf.h"
 
 /*---------------------------------------------------------
  *
  * Definitions
  *
  */
 
 /* The maximum number of messages parsed from the message queue at one time */
--- a/media/webrtc/signaling/src/sipcc/cpr/android/cpr_android_init.c
+++ b/media/webrtc/signaling/src/sipcc/cpr/android/cpr_android_init.c
@@ -172,24 +172,23 @@ cprPreInit (void)
     /*
      * Create message queue list mutex
      */
     returnCode = pthread_mutex_init(&msgQueueListMutex, NULL);
     if (returnCode != 0) {
         CPR_ERROR("%s: MsgQueue Mutex init failure %d\n", fname, returnCode);
         return CPR_FAILURE;
     }
-
+#ifdef CPR_TIMERS_ENABLED
     returnCode = cpr_timer_pre_init();
     if (returnCode != 0) {
         CPR_ERROR("%s: timer pre init failed %d\n", fname, returnCode);
         return CPR_FAILURE;
     }
-
-
+#endif
     return CPR_SUCCESS;
 }
 
 
 /**
  * cprPostInit
  *
  * @brief The cprPostInit function IS called from pSIPCC @b after all the components are initialized.
--- a/media/webrtc/signaling/src/sipcc/cpr/android/cpr_android_socket.c
+++ b/media/webrtc/signaling/src/sipcc/cpr/android/cpr_android_socket.c
@@ -735,26 +735,26 @@ cpr_inet_pton (int af, const char *src, 
 
 
 /**
  *  Utility function that sets up the socket address, using
  *  the name and the pid to guarantee uniqueness
  *
  *  @param[in] addr - socket fd to bind with the IPC address.
  *  @param[in] name - pointer to the name of socket to bind to.
- *
+ *  @param[in] pid  - process id (only used if name contains %d)
  *
  *  @pre  (name != NULL)
  */
 void cpr_set_sockun_addr (cpr_sockaddr_un_t *addr, const char *name, pid_t pid)
 {
     /* Bind to the local socket */
     memset(addr, 0, sizeof(cpr_sockaddr_un_t));
     addr->sun_family = AF_LOCAL;
-    snprintf((char *) addr->sun_path, sizeof(addr->sun_path), "%s_%d", name, pid);
+    snprintf(addr->sun_path, sizeof(addr->sun_path), name, pid);
 }
 
 /* int
  * inet_pton4(src, dst, pton)
  *	when last arg is 0: inet_aton(). with hexadecimal, octal and shorthand.
  *	when last arg is 1: inet_pton(). decimal dotted-quad only.
  * return:
  *	1 if `src' is a valid input, else 0.
--- a/media/webrtc/signaling/src/sipcc/cpr/android/cpr_android_timers_using_select.c
+++ b/media/webrtc/signaling/src/sipcc/cpr/android/cpr_android_timers_using_select.c
@@ -45,16 +45,17 @@
  * @brief The module related to Timer abstraction for the pSIPCC
  * @addtogroup TimerAPIs The Timer APIs
  * @ingroup Timers
  * @brief APIs expected by pSIPCC for using Timers
  *
  */
 
 #include "cpr.h"
+#include "cpr_assert.h"
 #include "cpr_socket.h"
 #include "cpr_stdlib.h"
 #include "cpr_stdio.h"
 #include "cpr_threads.h"
 #include "cpr_timers.h"
 #include "cpr_string.h"
 #include "phntask.h"
 #include <errno.h>
@@ -218,57 +219,61 @@ cprSleep (uint32_t duration)
  * applications.
  * @param[in] cprTimerPtr  - timer pointer
  * @param[in] duration     - timer duration in msec.
  * @param[in] data         - opaque data
  * @return  - CPR_SUCCESS or CPR_FAILURE
  */
 static cprRC_t addTimerToList (cpr_timer_t *cprTimerPtr, uint32_t duration, void *data)
 {
-
-    static const char fname[] = "addTimerToList";
+#ifdef CPR_TIMERS_ENABLED
     timer_ipc_t tmr_cmd = {0};
     timer_ipc_t tmr_rsp={0};
 
     API_ENTER();
 
     //CPR_INFO("%s: cprTimerptr=0x%x dur=%d user_data=%x\n",
-    //       fname, cprTimerPtr, duration, data);
+    //       __FUNCTION__, cprTimerPtr, duration, data);
     tmr_cmd.msg_type = TMR_CMD_ADD;
     tmr_cmd.u.cmd.timer_ptr = cprTimerPtr;
     tmr_cmd.u.cmd.user_data_ptr = data;
     tmr_cmd.u.cmd.duration = duration;
 
-//CPR_INFO("%s:sending messge of type=%d\n", fname, tmr_cmd.msg_type);
+//CPR_INFO("%s:sending messge of type=%d\n", __FUNCTION__, tmr_cmd.msg_type);
     /* simply post a request here to the timer service.*/
     if (client_sock != -1) {
         if (sendto(client_sock, &tmr_cmd, sizeof(timer_ipc_t), 0,
                    (struct sockaddr *)&tmr_serv_addr, sizeof(tmr_serv_addr)) < 0) {
             CPR_ERROR("Failed to tx IPC msg to timer service, errno = %s %s\n",
-                   strerror(errno), fname);
+                   strerror(errno), __FUNCTION__);
             API_RETURN(CPR_FAILURE);
         }
 
     } else {
-        CPR_ERROR("can not make IPC connection, client_sock is invalid %s\n", fname);
+        CPR_ERROR("can not make IPC connection, client_sock is invalid %s\n", __FUNCTION__);
         API_RETURN(CPR_FAILURE);
     }
 
     /*
      * wait for the timer service to excute the request
      * so that we get result of operation
      */
 
     if (recvfrom(client_sock, &tmr_rsp, sizeof(timer_ipc_t),0, NULL, NULL) < 0) {
         //CPR_INFO("error in recving the result error=%s\n", strerror(errno));
         API_RETURN(CPR_FAILURE);
     } else {
         //CPR_INFO("received response from the timer result=%d\n", tmr_rsp.u.result);
         API_RETURN(tmr_rsp.u.result);
     }
+#else
+    cprAssert(FALSE, CPR_FAILURE);
+    CPR_ERROR("CPR Timers are disabled! %s\n", __FUNCTION__);
+    return CPR_SUCCESS;
+#endif
 }
 
 
 /**
  * addTimer
  *
  * Add a timer to the timer linked list.
  * This function is only called by CPR functions and is not visible to external
--- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_timers_using_select.c
+++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_timers_using_select.c
@@ -265,18 +265,18 @@ static cprRC_t addTimerToList (cpr_timer
         API_RETURN(CPR_FAILURE);
     } else {
         //CPR_INFO("received response from the timer result=%d\n", tmr_rsp.u.result);
         API_RETURN(tmr_rsp.u.result);
     }
 #else
     cprAssert(FALSE, CPR_FAILURE);
     CPR_ERROR("CPR Timers are disabled! %s\n", __FUNCTION__);
+    return CPR_SUCCESS;
 #endif
-    return CPR_SUCCESS;
 }
 
 
 /**
  * addTimer
  *
  * Add a timer to the timer linked list.
  * This function is only called by CPR functions and is not visible to external
--- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_timers_using_select.c
+++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_timers_using_select.c
@@ -45,16 +45,17 @@
  * @brief The module related to Timer abstraction for the pSIPCC
  * @addtogroup TimerAPIs The Timer APIs
  * @ingroup Timers
  * @brief APIs expected by pSIPCC for using Timers
  *
  */
 
 #include "cpr.h"
+#include "cpr_assert.h"
 #include "cpr_socket.h"
 #include "cpr_stdlib.h"
 #include "cpr_stdio.h"
 #include "cpr_threads.h"
 #include "cpr_timers.h"
 #include "cpr_string.h"
 #include "phntask.h"
 #include <errno.h>
@@ -218,57 +219,61 @@ cprSleep (uint32_t duration)
  * applications.
  * @param[in] cprTimerPtr  - timer pointer
  * @param[in] duration     - timer duration in msec.
  * @param[in] data         - opaque data
  * @return  - CPR_SUCCESS or CPR_FAILURE
  */
 static cprRC_t addTimerToList (cpr_timer_t *cprTimerPtr, uint32_t duration, void *data)
 {
-
-    static const char fname[] = "addTimerToList";
+#ifdef CPR_TIMERS_ENABLED
     timer_ipc_t tmr_cmd = {0};
     timer_ipc_t tmr_rsp={0};
 
     API_ENTER();
 
     //CPR_INFO("%s: cprTimerptr=0x%x dur=%d user_data=%x\n",
-    //       fname, cprTimerPtr, duration, data);
+    //       __FUNCTION__, cprTimerPtr, duration, data);
     tmr_cmd.msg_type = TMR_CMD_ADD;
     tmr_cmd.u.cmd.timer_ptr = cprTimerPtr;
     tmr_cmd.u.cmd.user_data_ptr = data;
     tmr_cmd.u.cmd.duration = duration;
 
-//CPR_INFO("%s:sending messge of type=%d\n", fname, tmr_cmd.msg_type);
+//CPR_INFO("%s:sending messge of type=%d\n", __FUNCTION__, tmr_cmd.msg_type);
     /* simply post a request here to the timer service.*/
     if (client_sock != -1) {
         if (sendto(client_sock, &tmr_cmd, sizeof(timer_ipc_t), 0,
                    (struct sockaddr *)&tmr_serv_addr, sizeof(tmr_serv_addr)) < 0) {
             CPR_ERROR("Failed to tx IPC msg to timer service, errno = %s %s\n",
-                   strerror(errno), fname);
+                   strerror(errno), __FUNCTION__);
             API_RETURN(CPR_FAILURE);
         }
 
     } else {
-        CPR_ERROR("can not make IPC connection, client_sock is invalid %s\n", fname);
+        CPR_ERROR("can not make IPC connection, client_sock is invalid %s\n", __FUNCTION__);
         API_RETURN(CPR_FAILURE);
     }
 
     /*
      * wait for the timer service to excute the request
      * so that we get result of operation
      */
 
     if (recvfrom(client_sock, &tmr_rsp, sizeof(timer_ipc_t),0, NULL, NULL) < 0) {
         //CPR_INFO("error in recving the result error=%s\n", strerror(errno));
         API_RETURN(CPR_FAILURE);
     } else {
         //CPR_INFO("received response from the timer result=%d\n", tmr_rsp.u.result);
         API_RETURN(tmr_rsp.u.result);
     }
+#else
+    cprAssert(FALSE, CPR_FAILURE);
+    CPR_ERROR("CPR Timers are disabled! %s\n", __FUNCTION__);
+    return CPR_SUCCESS;
+#endif
 }
 
 
 /**
  * addTimer
  *
  * Add a timer to the timer linked list.
  * This function is only called by CPR functions and is not visible to external