mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 22:45:39 +00:00
Fix modern gcc warning
Review: https://reviewboard.asterisk.org/r/1767 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369602 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -425,7 +425,7 @@ int decodeDynBitString (OOCTXT* pctxt, ASN1DynBitStr* pBitStr)
|
|||||||
if (pctxt->flags & ASN1FASTCOPY) {
|
if (pctxt->flags & ASN1FASTCOPY) {
|
||||||
/* check is it possible to do optimized decoding */
|
/* check is it possible to do optimized decoding */
|
||||||
|
|
||||||
ASN1OCTET bit;
|
ASN1OCTET bit = 0;
|
||||||
ASN1UINT byteIndex = pctxt->buffer.byteIndex; /* save byte index */
|
ASN1UINT byteIndex = pctxt->buffer.byteIndex; /* save byte index */
|
||||||
ASN1USINT bitOffset = pctxt->buffer.bitOffset; /* save bit offset */
|
ASN1USINT bitOffset = pctxt->buffer.bitOffset; /* save bit offset */
|
||||||
|
|
||||||
@@ -499,7 +499,7 @@ int decodeDynOctetString (OOCTXT* pctxt, ASN1DynOctStr* pOctStr)
|
|||||||
if (pctxt->flags & ASN1FASTCOPY) {
|
if (pctxt->flags & ASN1FASTCOPY) {
|
||||||
/* check if it is possible to do optimized decoding */
|
/* check if it is possible to do optimized decoding */
|
||||||
|
|
||||||
ASN1OCTET bit;
|
ASN1OCTET bit = 0;
|
||||||
ASN1UINT byteIndex = pctxt->buffer.byteIndex; /* save byte index */
|
ASN1UINT byteIndex = pctxt->buffer.byteIndex; /* save byte index */
|
||||||
ASN1USINT bitOffset = pctxt->buffer.bitOffset; /* save bit offset */
|
ASN1USINT bitOffset = pctxt->buffer.bitOffset; /* save bit offset */
|
||||||
|
|
||||||
|
@@ -1104,14 +1104,14 @@ struct H245AudioCapability* ooCapabilityCreateNonStandardCapability
|
|||||||
(ooH323EpCapability *epCap, OOCTXT* pctxt, int dir)
|
(ooH323EpCapability *epCap, OOCTXT* pctxt, int dir)
|
||||||
{
|
{
|
||||||
H245AudioCapability *pAudio=NULL;
|
H245AudioCapability *pAudio=NULL;
|
||||||
OOCapParams *params;
|
|
||||||
if(!epCap || !epCap->params)
|
if(!epCap || !epCap->params)
|
||||||
{
|
{
|
||||||
OOTRACEERR1("Error:Invalid capability parameters to "
|
OOTRACEERR1("Error:Invalid capability parameters to "
|
||||||
"ooCapabilityCreateSimpleCapability.\n");
|
"ooCapabilityCreateSimpleCapability.\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
params =(OOCapParams*)epCap->params;
|
|
||||||
pAudio = (H245AudioCapability*)memAlloc(pctxt,
|
pAudio = (H245AudioCapability*)memAlloc(pctxt,
|
||||||
sizeof(H245AudioCapability));
|
sizeof(H245AudioCapability));
|
||||||
if(!pAudio)
|
if(!pAudio)
|
||||||
@@ -1228,15 +1228,15 @@ struct H245DataApplicationCapability* ooCapabilityCreateT38Capability
|
|||||||
(ooH323EpCapability *epCap, OOCTXT* pctxt, int dir)
|
(ooH323EpCapability *epCap, OOCTXT* pctxt, int dir)
|
||||||
{
|
{
|
||||||
H245DataApplicationCapability *pT38=NULL;
|
H245DataApplicationCapability *pT38=NULL;
|
||||||
OOCapParams *params;
|
|
||||||
H245DataMode_application *pT38app;
|
H245DataMode_application *pT38app;
|
||||||
|
|
||||||
if(!epCap || !epCap->params)
|
if(!epCap || !epCap->params)
|
||||||
{
|
{
|
||||||
OOTRACEERR1("Error:Invalid capability parameters to "
|
OOTRACEERR1("Error:Invalid capability parameters to "
|
||||||
"ooCapabilityCreateSimpleCapability.\n");
|
"ooCapabilityCreateSimpleCapability.\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
params =(OOCapParams*)epCap->params;
|
|
||||||
pT38 = (H245DataApplicationCapability*)memAlloc(pctxt,
|
pT38 = (H245DataApplicationCapability*)memAlloc(pctxt,
|
||||||
sizeof(H245DataApplicationCapability));
|
sizeof(H245DataApplicationCapability));
|
||||||
if(!pT38)
|
if(!pT38)
|
||||||
|
@@ -249,7 +249,6 @@ int ooSocketCreate (OOSOCKET* psocket, int family)
|
|||||||
int ooSocketCreateUDP (OOSOCKET* psocket, int family)
|
int ooSocketCreateUDP (OOSOCKET* psocket, int family)
|
||||||
{
|
{
|
||||||
int on;
|
int on;
|
||||||
struct linger linger;
|
|
||||||
OOSOCKET sock;
|
OOSOCKET sock;
|
||||||
|
|
||||||
if (family == 6)
|
if (family == 6)
|
||||||
@@ -273,9 +272,11 @@ int ooSocketCreateUDP (OOSOCKET* psocket, int family)
|
|||||||
OOTRACEERR1("Error:Failed to set socket option SO_REUSEADDR\n");
|
OOTRACEERR1("Error:Failed to set socket option SO_REUSEADDR\n");
|
||||||
return ASN_E_INVSOCKET;
|
return ASN_E_INVSOCKET;
|
||||||
}
|
}
|
||||||
|
// may be will use later
|
||||||
|
/*
|
||||||
linger.l_onoff = 1;
|
linger.l_onoff = 1;
|
||||||
linger.l_linger = 0;
|
linger.l_linger = 0;
|
||||||
/*if (setsockopt (sock, SOL_SOCKET, SO_LINGER,
|
if (setsockopt (sock, SOL_SOCKET, SO_LINGER,
|
||||||
(const char* ) &linger, sizeof (linger)) == -1)
|
(const char* ) &linger, sizeof (linger)) == -1)
|
||||||
return ASN_E_INVSOCKET;
|
return ASN_E_INVSOCKET;
|
||||||
*/
|
*/
|
||||||
|
@@ -101,7 +101,6 @@ OOBOOL ooTimerExpired (OOTimer* pTimer)
|
|||||||
void ooTimerFireExpired (OOCTXT* pctxt, DList *pList)
|
void ooTimerFireExpired (OOCTXT* pctxt, DList *pList)
|
||||||
{
|
{
|
||||||
OOTimer* pTimer;
|
OOTimer* pTimer;
|
||||||
int stat;
|
|
||||||
|
|
||||||
while (pList->count > 0) {
|
while (pList->count > 0) {
|
||||||
pTimer = (OOTimer*) pList->head->data;
|
pTimer = (OOTimer*) pList->head->data;
|
||||||
@@ -113,8 +112,6 @@ void ooTimerFireExpired (OOCTXT* pctxt, DList *pList)
|
|||||||
*/
|
*/
|
||||||
if (pTimer->reRegister) ooTimerReset (pctxt, pList, pTimer);
|
if (pTimer->reRegister) ooTimerReset (pctxt, pList, pTimer);
|
||||||
|
|
||||||
stat = (*pTimer->timeoutCB)(pTimer->cbData);
|
|
||||||
|
|
||||||
if (!pTimer->reRegister) {
|
if (!pTimer->reRegister) {
|
||||||
ooTimerDelete (pctxt, pList, pTimer);
|
ooTimerDelete (pctxt, pList, pTimer);
|
||||||
}
|
}
|
||||||
|
@@ -2239,7 +2239,7 @@ int ooH323HandleCallFwdRequest(OOH323CallData *call)
|
|||||||
ooAliases *pNewAlias=NULL, *alias=NULL;
|
ooAliases *pNewAlias=NULL, *alias=NULL;
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
int i=0, irand=0, ret = OO_OK;
|
int i=0, irand=0;
|
||||||
/* Note: We keep same callToken, for new call which is going
|
/* Note: We keep same callToken, for new call which is going
|
||||||
to replace an existing call, thus treating it as a single call.*/
|
to replace an existing call, thus treating it as a single call.*/
|
||||||
|
|
||||||
@@ -2291,7 +2291,7 @@ int ooH323HandleCallFwdRequest(OOH323CallData *call)
|
|||||||
{
|
{
|
||||||
/* No need to check registration status here as it is already checked for
|
/* No need to check registration status here as it is already checked for
|
||||||
MakeCall command */
|
MakeCall command */
|
||||||
ret = ooGkClientSendAdmissionRequest(gH323ep.gkClient, fwdedCall, FALSE);
|
ooGkClientSendAdmissionRequest(gH323ep.gkClient, fwdedCall, FALSE);
|
||||||
fwdedCall->callState = OO_CALL_WAITING_ADMISSION;
|
fwdedCall->callState = OO_CALL_WAITING_ADMISSION;
|
||||||
ast_mutex_lock(&fwdedCall->Lock);
|
ast_mutex_lock(&fwdedCall->Lock);
|
||||||
tv = ast_tvnow();
|
tv = ast_tvnow();
|
||||||
@@ -2305,7 +2305,7 @@ int ooH323HandleCallFwdRequest(OOH323CallData *call)
|
|||||||
}
|
}
|
||||||
if (fwdedCall->callState < OO_CALL_CLEAR) {
|
if (fwdedCall->callState < OO_CALL_CLEAR) {
|
||||||
ast_mutex_lock(&fwdedCall->Lock);
|
ast_mutex_lock(&fwdedCall->Lock);
|
||||||
ret = ooH323CallAdmitted (fwdedCall);
|
ooH323CallAdmitted (fwdedCall);
|
||||||
ast_mutex_unlock(&fwdedCall->Lock);
|
ast_mutex_unlock(&fwdedCall->Lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2332,7 +2332,6 @@ int ooH323NewCall(char *callToken) {
|
|||||||
|
|
||||||
int ooH323MakeCall(char *dest, char *callToken, ooCallOptions *opts)
|
int ooH323MakeCall(char *dest, char *callToken, ooCallOptions *opts)
|
||||||
{
|
{
|
||||||
OOCTXT *pctxt;
|
|
||||||
OOH323CallData *call;
|
OOH323CallData *call;
|
||||||
int ret=OO_OK, i=0, irand=0;
|
int ret=OO_OK, i=0, irand=0;
|
||||||
char tmp[2+8*4+7]="\0";
|
char tmp[2+8*4+7]="\0";
|
||||||
@@ -2360,7 +2359,6 @@ int ooH323MakeCall(char *dest, char *callToken, ooCallOptions *opts)
|
|||||||
return OO_FAILED;
|
return OO_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
pctxt = call->pctxt;
|
|
||||||
if(opts)
|
if(opts)
|
||||||
{
|
{
|
||||||
if(opts->fastStart)
|
if(opts->fastStart)
|
||||||
|
@@ -168,7 +168,7 @@ Asn1SizeCnst* getSizeConstraint (OOCTXT* pctxt, ASN1BOOL extbit)
|
|||||||
int checkSizeConstraint(OOCTXT* pctxt, int size)
|
int checkSizeConstraint(OOCTXT* pctxt, int size)
|
||||||
{
|
{
|
||||||
Asn1SizeCnst* pSize;
|
Asn1SizeCnst* pSize;
|
||||||
ASN1UINT lower, upper;
|
ASN1UINT upper;
|
||||||
ASN1BOOL extbit;
|
ASN1BOOL extbit;
|
||||||
int stat;
|
int stat;
|
||||||
|
|
||||||
@@ -186,7 +186,6 @@ int checkSizeConstraint(OOCTXT* pctxt, int size)
|
|||||||
|
|
||||||
pSize = getSizeConstraint (pctxt, extbit);
|
pSize = getSizeConstraint (pctxt, extbit);
|
||||||
|
|
||||||
lower = (pSize) ? pSize->lower : 0;
|
|
||||||
upper = (pSize) ? pSize->upper : ASN1UINT_MAX;
|
upper = (pSize) ? pSize->upper : ASN1UINT_MAX;
|
||||||
|
|
||||||
if (upper < (ASN1UINT)size) {
|
if (upper < (ASN1UINT)size) {
|
||||||
|
@@ -82,7 +82,7 @@ void* ooh323c_call_thread(void* dummy)
|
|||||||
struct callthread* mycthread = (struct callthread *)dummy;
|
struct callthread* mycthread = (struct callthread *)dummy;
|
||||||
struct pollfd pfds[1];
|
struct pollfd pfds[1];
|
||||||
char c;
|
char c;
|
||||||
int res;
|
int res = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ void* ooh323c_call_thread(void* dummy)
|
|||||||
ast_mutex_unlock(&mycthread->lock);
|
ast_mutex_unlock(&mycthread->lock);
|
||||||
ast_mutex_unlock(&callThreadsLock);
|
ast_mutex_unlock(&callThreadsLock);
|
||||||
|
|
||||||
} while (mycthread->call != NULL);
|
} while (mycthread->call != NULL && res == 0);
|
||||||
|
|
||||||
|
|
||||||
ast_mutex_destroy(&mycthread->lock);
|
ast_mutex_destroy(&mycthread->lock);
|
||||||
@@ -129,7 +129,6 @@ void* ooh323c_call_thread(void* dummy)
|
|||||||
|
|
||||||
int ooh323c_start_call_thread(ooCallData *call) {
|
int ooh323c_start_call_thread(ooCallData *call) {
|
||||||
char c = 'c';
|
char c = 'c';
|
||||||
int res;
|
|
||||||
struct callthread *cur = callThreads;
|
struct callthread *cur = callThreads;
|
||||||
|
|
||||||
ast_mutex_lock(&callThreadsLock);
|
ast_mutex_lock(&callThreadsLock);
|
||||||
@@ -138,10 +137,12 @@ int ooh323c_start_call_thread(ooCallData *call) {
|
|||||||
}
|
}
|
||||||
ast_mutex_unlock(&callThreadsLock);
|
ast_mutex_unlock(&callThreadsLock);
|
||||||
|
|
||||||
if (cur != NULL && cur->inUse) {
|
if (cur != NULL) {
|
||||||
|
if (cur->inUse || write(cur->thePipe[1], &c, 1) < 0) {
|
||||||
ast_mutex_unlock(&cur->lock);
|
ast_mutex_unlock(&cur->lock);
|
||||||
cur = NULL;
|
cur = NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* make new thread */
|
/* make new thread */
|
||||||
if (cur == NULL) {
|
if (cur == NULL) {
|
||||||
@@ -181,7 +182,6 @@ int ooh323c_start_call_thread(ooCallData *call) {
|
|||||||
ast_debug(1,"using existing call thread for call %s\n", call->callToken);
|
ast_debug(1,"using existing call thread for call %s\n", call->callToken);
|
||||||
cur->inUse = TRUE;
|
cur->inUse = TRUE;
|
||||||
cur->call = call;
|
cur->call = call;
|
||||||
res = write(cur->thePipe[1], &c, 1);
|
|
||||||
ast_mutex_unlock(&cur->lock);
|
ast_mutex_unlock(&cur->lock);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user