Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix log formatting warnings #151

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/cellular_3gpp_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ static CellularPktStatus_t _parseTimeZoneInfo( char * pTimeZoneResp,

if( pktStatus == CELLULAR_PKT_STATUS_OK )
{
LogDebug( ( "TimeZoneInfo: Timezone %d Year %d Month %d day %d,", pTimeInfo->timeZone,
LogDebug( ( "TimeZoneInfo: Timezone %ld Year %d Month %d day %d,", pTimeInfo->timeZone,
pTimeInfo->year,
pTimeInfo->month,
pTimeInfo->day ) );
Expand Down
6 changes: 3 additions & 3 deletions source/cellular_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ CellularError_t _Cellular_RemoveSocketData( CellularContext_t * pContext,

if( socketHandle->socketState == SOCKETSTATE_CONNECTING )
{
LogWarn( ( "_Cellular_RemoveSocket, socket is connecting state [%u]", socketHandle->socketId ) );
LogWarn( ( "_Cellular_RemoveSocket, socket is connecting state [%lu]", socketHandle->socketId ) );
}

taskENTER_CRITICAL();
Expand Down Expand Up @@ -652,7 +652,7 @@ CellularError_t _Cellular_IsValidSocket( const CellularContext_t * pContext,
{
if( ( sockIndex >= CELLULAR_NUM_SOCKET_MAX ) || ( pContext->pSocketData[ sockIndex ] == NULL ) )
{
LogError( ( "_Cellular_IsValidSocket, invalid socket handle %u", sockIndex ) );
LogError( ( "_Cellular_IsValidSocket, invalid socket handle %lu", sockIndex ) );
cellularStatus = CELLULAR_BAD_PARAMETER;
}
}
Expand Down Expand Up @@ -916,7 +916,7 @@ CellularSocketContext_t * _Cellular_GetSocketData( const CellularContext_t * pCo
{
if( ( sockIndex >= CELLULAR_NUM_SOCKET_MAX ) || ( pContext->pSocketData[ sockIndex ] == NULL ) )
{
LogError( ( "_Cellular_GetSocketData, invalid socket handle %u", sockIndex ) );
LogError( ( "_Cellular_GetSocketData, invalid socket handle %lu", sockIndex ) );
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions source/cellular_common_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static CellularError_t _socketSetSockOptLevelTransport( CellularSocketOption_t o
}
else
{
LogError( ( "Cellular_SocketSetSockOpt: Cannot change the contextID in this state %d or length %d is invalid.",
LogError( ( "Cellular_SocketSetSockOpt: Cannot change the contextID in this state %d or length %ld is invalid.",
guillaumeVolery marked this conversation as resolved.
Show resolved Hide resolved
socketHandle->socketState, optionValueLength ) );
cellularStatus = CELLULAR_INTERNAL_FAILURE;
}
Expand All @@ -123,7 +123,7 @@ static CellularError_t _socketSetSockOptLevelTransport( CellularSocketOption_t o
}
else
{
LogError( ( "Cellular_SocketSetSockOpt: Cannot change the localPort in this state %d or length %d is invalid.",
LogError( ( "Cellular_SocketSetSockOpt: Cannot change the localPort in this state %d or length %ld is invalid.",
guillaumeVolery marked this conversation as resolved.
Show resolved Hide resolved
socketHandle->socketState, optionValueLength ) );
cellularStatus = CELLULAR_INTERNAL_FAILURE;
}
Expand Down
4 changes: 2 additions & 2 deletions source/cellular_pkthandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ CellularPktStatus_t _Cellular_AtParseInit( const CellularContext_t * pContext )

if( result >= 0 )
{
LogError( ( "AtParseFail for %u: %d %s %s", i, result,
LogError( ( "AtParseFail for %lu: %ld %s %s", i, result,
pTokenMap[ i ].pStrValue, pTokenMap[ i + 1U ].pStrValue ) );
finit = false;
}
Expand All @@ -836,7 +836,7 @@ CellularPktStatus_t _Cellular_AtParseInit( const CellularContext_t * pContext )

for( i = 0; i < tokenMapSize; i++ )
{
LogDebug( ( "Callbacks setup for %u : %s", i, pTokenMap[ i ].pStrValue ) );
LogDebug( ( "Callbacks setup for %lu : %s", i, pTokenMap[ i ].pStrValue ) );
}
}
else
Expand Down
18 changes: 9 additions & 9 deletions source/cellular_pktio.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static void _saveData( char * pLine,

( void ) dataLen;

LogDebug( ( "_saveData : Save data %p with length %d", pLine, dataLen ) );
LogDebug( ( "_saveData : Save data %p with length %lu", pLine, dataLen ) );

pNew = ( CellularATCommandLine_t * ) Platform_Malloc( sizeof( CellularATCommandLine_t ) );
configASSERT( ( pNew != NULL ) );
Expand Down Expand Up @@ -174,7 +174,7 @@ static void _saveRawData( char * pLine,
CellularATCommandResponse_t * pResp,
uint32_t dataLen )
{
LogDebug( ( "Save [%p] %d data to pResp", pLine, dataLen ) );
LogDebug( ( "Save [%p] %ld data to pResp", pLine, dataLen ) );
guillaumeVolery marked this conversation as resolved.
Show resolved Hide resolved
_saveData( pLine, pResp, dataLen );
}

Expand All @@ -183,7 +183,7 @@ static void _saveRawData( char * pLine,
static void _saveATData( char * pLine,
CellularATCommandResponse_t * pResp )
{
LogDebug( ( "Save [%s] %lu AT data to pResp", pLine, strlen( pLine ) ) );
LogDebug( ( "Save [%s] %u AT data to pResp", pLine, strlen( pLine ) ) );
_saveData( pLine, pResp, ( uint32_t ) ( strlen( pLine ) + 1U ) );
}

Expand Down Expand Up @@ -546,7 +546,7 @@ static char * _handleLeftoverBuffer( CellularContext_t * pContext )
/* Move the leftover data or AT command response to the start of buffer.
* Set the pRead pointer to the empty buffer space. */

LogDebug( ( "moved the partial line/data from %p to %p %d",
LogDebug( ( "moved the partial line/data from %p to %p %ld",
guillaumeVolery marked this conversation as resolved.
Show resolved Hide resolved
pContext->pPktioReadPtr, pContext->pktioReadBuf, pContext->partialDataRcvdLen ) );

( void ) memmove( pContext->pktioReadBuf, pContext->pPktioReadPtr, pContext->partialDataRcvdLen );
Expand Down Expand Up @@ -617,7 +617,7 @@ static char * _Cellular_ReadLine( CellularContext_t * pContext,
/* Add a NULL after the bytesRead. This is required for further processing. */
pRead[ bytesRead ] = '\0';

LogDebug( ( "AT Read %d bytes, data[%p]", bytesRead, pRead ) );
LogDebug( ( "AT Read %ld bytes, data[%p]", bytesRead, pRead ) );
guillaumeVolery marked this conversation as resolved.
Show resolved Hide resolved
/* Set the pBytesRead only when actual bytes read from comm interface. */
*pBytesRead = bytesRead + partialDataRead;

Expand Down Expand Up @@ -670,7 +670,7 @@ static CellularPktStatus_t _handleData( char * pStartOfData,
/* There are more bytes after the data. */
*pBytesLeft = ( bytesDataAndLeft - pContext->dataLength );

LogDebug( ( "_handleData : read buffer buffer %p start %p prefix %d left %d, read total %d",
LogDebug( ( "_handleData : read buffer buffer %p start %p prefix %ld left %ld, read total %ld",
guillaumeVolery marked this conversation as resolved.
Show resolved Hide resolved
pContext->pktioReadBuf,
pStartOfData,
bytesBeforeData,
Expand Down Expand Up @@ -885,7 +885,7 @@ static bool _preprocessInputBuffer( CellularContext_t * pContext,
else if( bufferLength > *pBytesRead )
{
/* The input buffer callback returns incorrect buffer length. */
LogError( ( "Input buffer callback returns bufferLength %u. Modem returns length %u. Clean the read buffer.",
LogError( ( "Input buffer callback returns bufferLength %lu. Modem returns length %lu. Clean the read buffer.",
bufferLength, *pBytesRead ) );

/* Clean the read buffer and read pointer. */
Expand Down Expand Up @@ -1026,7 +1026,7 @@ static bool _handleDataResult( CellularContext_t * pContext,
else
{
*pBytesRead = bytesLeft;
LogDebug( ( "_handleData okay, keep processing %u bytes %p", bytesLeft, *ppLine ) );
LogDebug( ( "_handleData okay, keep processing %lu bytes %p", bytesLeft, *ppLine ) );
}

return keepProcess;
Expand Down Expand Up @@ -1427,7 +1427,7 @@ uint32_t _Cellular_PktioSendData( CellularContext_t * pContext,
dataLen, CELLULAR_COMM_IF_SEND_TIMEOUT_MS, &sentLen );
}

LogDebug( ( "PktioSendData sent %d bytes", sentLen ) );
LogDebug( ( "PktioSendData sent %ld bytes", sentLen ) );
guillaumeVolery marked this conversation as resolved.
Show resolved Hide resolved
return sentLen;
}

Expand Down