зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1039917 - Fix clang and gcc warnings in webrtc/signaling. r=jesup
This commit is contained in:
Родитель
5104db1529
Коммит
d433ecea90
|
@ -17,7 +17,10 @@
|
|||
#endif
|
||||
|
||||
static int gWebRtcTraceLoggingOn = 0;
|
||||
|
||||
#ifndef ANDROID
|
||||
static const char *default_log = "WebRTC.log";
|
||||
#endif
|
||||
|
||||
static PRLogModuleInfo* GetWebRtcTraceLog()
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@ int ccsdpAttrGetFmtpInst(void *sdp_ptr, u16 level, u16 payload_num)
|
|||
{
|
||||
cc_sdp_t *sdpp = sdp_ptr;
|
||||
if ( sdpp->dest_sdp == NULL ) {
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
return sdp_find_fmtp_inst(sdpp->dest_sdp, level, payload_num);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ static sdp_result_e next_token(const char **string_of_tokens, char *token, unsig
|
|||
{
|
||||
int flag2moveon = 0;
|
||||
const char *str = *string_of_tokens;
|
||||
char *token_start = token;
|
||||
const char *token_end = token + token_max_len - 1;
|
||||
const char *next_delim;
|
||||
|
||||
if (!string_of_tokens || !*string_of_tokens || !token || !delim) {
|
||||
|
@ -89,7 +89,7 @@ static sdp_result_e next_token(const char **string_of_tokens, char *token, unsig
|
|||
/* Now locate end of token */
|
||||
flag2moveon = 0;
|
||||
|
||||
while (((token-token_start) < token_max_len - 1) &&
|
||||
while ((token < token_end) &&
|
||||
(*str != '\0') && (*str != '\n') && (*str != '\r')) {
|
||||
for (next_delim=delim; *next_delim; next_delim++) {
|
||||
if (*str == *next_delim) {
|
||||
|
|
|
@ -9156,7 +9156,7 @@ sip_sm_request_check_and_store (ccsipCCB_t *ccb, sipMessage_t *request,
|
|||
if ((size_t) content_length != strlen(request->raw_body)) {
|
||||
CCSIP_DEBUG_ERROR(SIP_F_PREFIX"\n Mismatched Content length and "
|
||||
"Actual message body length:content length=%d\n"
|
||||
"and message as %s\n and strlen of messagebody = %lu\n",
|
||||
"and message as %s\n and strlen of messagebody = %zu\n",
|
||||
fname, content_length, request->raw_body,
|
||||
strlen(request->raw_body));
|
||||
*request_check_reason_code = SIP_WARN_MISC;
|
||||
|
|
|
@ -4712,7 +4712,7 @@ sippmh_parse_supported_require (const char *header, char **punsupported_tokens)
|
|||
size = strlen(header) + 1;
|
||||
temp_header = (char *) cpr_malloc(size);
|
||||
if (temp_header == NULL) {
|
||||
CCSIP_DEBUG_ERROR("%s: malloc failed for strlen(header)=%lu", fname,
|
||||
CCSIP_DEBUG_ERROR("%s: malloc failed for strlen(header)=%zu", fname,
|
||||
strlen(header));
|
||||
return tags;
|
||||
}
|
||||
|
|
|
@ -2676,7 +2676,7 @@ subsmanager_handle_ev_sip_subscribe (sipMessage_t *pSipMessage,
|
|||
CCSIP_DEBUG_ERROR(SIP_F_PREFIX"\n Mismatched Content length and \
|
||||
Actual message body length:content length=%u \
|
||||
\n and message as %s \
|
||||
\n and strlenof messagebody = %lu", fname,
|
||||
\n and strlenof messagebody = %zu", fname,
|
||||
content_length, pSipMessage->raw_body,
|
||||
strlen(pSipMessage->raw_body));
|
||||
if (sipSPISendErrorResponse(pSipMessage, SIP_CLI_ERR_BAD_REQ,
|
||||
|
|
|
@ -271,6 +271,12 @@ cprCreateMessageQueue (const char *name, uint16_t depth)
|
|||
{
|
||||
cpr_msg_queue_t *msgq;
|
||||
|
||||
#ifndef SIP_OS_WINDOWS
|
||||
static int key_id = 100; /* arbitrary starting number */
|
||||
pthread_cond_t _cond = PTHREAD_COND_INITIALIZER;
|
||||
pthread_mutex_t _lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
#endif
|
||||
|
||||
msgq = cpr_calloc(1, sizeof(cpr_msg_queue_t));
|
||||
if (msgq == NULL) {
|
||||
printf("%s: Malloc failed: %s\n", __FUNCTION__,
|
||||
|
@ -282,10 +288,6 @@ cprCreateMessageQueue (const char *name, uint16_t depth)
|
|||
msgq->name = name ? name : "unnamed";
|
||||
|
||||
#ifndef SIP_OS_WINDOWS
|
||||
static int key_id = 100; /* arbitrary starting number */
|
||||
pthread_cond_t _cond = PTHREAD_COND_INITIALIZER;
|
||||
pthread_mutex_t _lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
msgq->queueId = key_id++;
|
||||
msgq->cond = _cond;
|
||||
msgq->mutex = _lock;
|
||||
|
@ -365,6 +367,12 @@ cprGetMessage (cprMsgQueue_t msgQueue, boolean waitForever, void **ppUserData)
|
|||
cpr_msg_queue_t *pCprMsgQueue;
|
||||
MSG msg;
|
||||
cpr_thread_t *pThreadPtr;
|
||||
#else
|
||||
cpr_msg_queue_t *msgq = (cpr_msg_queue_t *) msgQueue;
|
||||
cpr_msgq_node_t *node;
|
||||
struct timespec timeout;
|
||||
struct timeval tv;
|
||||
struct timezone tz;
|
||||
#endif
|
||||
|
||||
if (!msgQueue) {
|
||||
|
@ -444,14 +452,6 @@ cprGetMessage (cprMsgQueue_t msgQueue, boolean waitForever, void **ppUserData)
|
|||
break;
|
||||
}
|
||||
#else
|
||||
cpr_msg_queue_t *msgq;
|
||||
cpr_msgq_node_t *node;
|
||||
struct timespec timeout;
|
||||
struct timeval tv;
|
||||
struct timezone tz;
|
||||
|
||||
msgq = (cpr_msg_queue_t *) msgQueue;
|
||||
|
||||
/*
|
||||
* If waitForever is set, block on the message queue
|
||||
* until a message is received, else return after
|
||||
|
@ -544,6 +544,12 @@ cprSendMessage (cprMsgQueue_t msgQueue, void *msg, void **ppUserData)
|
|||
struct msgbuffer *sendMsg;
|
||||
cpr_thread_t *pCprThread;
|
||||
HANDLE *hThread;
|
||||
#else
|
||||
static const char error_str[] = "%s: Msg not sent to %s queue: %s\n";
|
||||
cpr_msgq_post_result_e rc;
|
||||
cpr_msg_queue_t *msgq = (cpr_msg_queue_t *) msgQueue;
|
||||
int16_t attemptsToSend = CPR_ATTEMPTS_TO_SEND;
|
||||
uint16_t numAttempts = 0;
|
||||
#endif
|
||||
|
||||
if (!msgQueue) {
|
||||
|
@ -592,14 +598,6 @@ cprSendMessage (cprMsgQueue_t msgQueue, void *msg, void **ppUserData)
|
|||
return CPR_SUCCESS;
|
||||
|
||||
#else
|
||||
static const char error_str[] = "%s: Msg not sent to %s queue: %s\n";
|
||||
cpr_msgq_post_result_e rc;
|
||||
cpr_msg_queue_t *msgq;
|
||||
int16_t attemptsToSend = CPR_ATTEMPTS_TO_SEND;
|
||||
uint16_t numAttempts = 0;
|
||||
|
||||
msgq = (cpr_msg_queue_t *) msgQueue;
|
||||
|
||||
/*
|
||||
* Attempt to send message
|
||||
*/
|
||||
|
|
|
@ -560,7 +560,7 @@ void CC_SIPCCService::endAllActiveCalls()
|
|||
{
|
||||
CC_DeviceInfoPtr deviceInfo = device->getDeviceInfo();
|
||||
vector<CC_CallPtr> calls = deviceInfo->getCalls();
|
||||
CSFLogInfo( logTag, "endAllActiveCalls(): %lu calls to be ended.", calls.size());
|
||||
CSFLogInfo( logTag, "endAllActiveCalls(): %zu calls to be ended.", calls.size());
|
||||
for(vector<CC_CallPtr>::iterator it = calls.begin(); it != calls.end(); it++)
|
||||
{
|
||||
// For each active call, if it can be ended, do so.
|
||||
|
|
Загрузка…
Ссылка в новой задаче