Skip to content

Commit 0753992

Browse files
committed
Uncrustify: triggered by comment.
1 parent e5834d8 commit 0753992

File tree

6 files changed

+143
-143
lines changed

6 files changed

+143
-143
lines changed

source/core_mqtt.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ static MQTTStatus_t handleUncleanSessionResumption( MQTTContext_t * pContext );
444444
* @brief Clears existing state records for a clean session.
445445
*
446446
* @param[in] pContext Initialized MQTT context.
447-
*
447+
*
448448
* @return #MQTTPublishClearAllFailed if clearing all the copied publishes fails;
449449
* #MQTTSuccess otherwise.
450450
*/
@@ -1600,11 +1600,11 @@ static MQTTStatus_t handlePublishAcks( MQTTContext_t * pContext,
16001600
}
16011601
}
16021602

1603-
if( ( ackType == MQTTPuback ) || ( ackType == MQTTPubrec ) )
1603+
if( ( ackType == MQTTPuback ) || ( ackType == MQTTPubrec ) )
16041604
{
16051605
if( ( status == MQTTSuccess ) &&
16061606
( pContext->clearFunction != NULL ) &&
1607-
( pContext->clearFunction( pContext, packetIdentifier) != true ) )
1607+
( pContext->clearFunction( pContext, packetIdentifier ) != true ) )
16081608
{
16091609
LogWarn( ( "Clear callback function failed\n" ) );
16101610
}
@@ -2214,7 +2214,7 @@ static MQTTStatus_t sendPublishWithoutCopy( MQTTContext_t * pContext,
22142214

22152215
if( ( pPublishInfo->qos > MQTTQoS0 ) &&
22162216
( pContext->storeFunction != NULL ) &&
2217-
( pContext->storeFunction(pContext, packetId, pIoVector, ioVectorLength) != true ) )
2217+
( pContext->storeFunction( pContext, packetId, pIoVector, ioVectorLength ) != true ) )
22182218
{
22192219
status = MQTTPublishStoreFailed;
22202220
}
@@ -2226,7 +2226,7 @@ static MQTTStatus_t sendPublishWithoutCopy( MQTTContext_t * pContext,
22262226
dupFlagChanged = false;
22272227
}
22282228

2229-
if( ( status == MQTTSuccess ) &&
2229+
if( ( status == MQTTSuccess ) &&
22302230
( sendMessageVector( pContext, pIoVector, ioVectorLength ) != ( int32_t ) totalMessageLength ) )
22312231
{
22322232
status = MQTTSendFailed;
@@ -2514,7 +2514,7 @@ static MQTTStatus_t handleUncleanSessionResumption( MQTTContext_t * pContext )
25142514
MQTTStateCursor_t cursor = MQTT_STATE_CURSOR_INITIALIZER;
25152515
uint16_t packetId = MQTT_PACKET_ID_INVALID;
25162516
MQTTPublishState_t state = MQTTStateNull;
2517-
TransportOutVector_t *pIoVec, *pIoVectIterator;
2517+
TransportOutVector_t * pIoVec, * pIoVectIterator;
25182518
size_t ioVecCount;
25192519
size_t totalMessageLength;
25202520

@@ -2533,38 +2533,38 @@ static MQTTStatus_t handleUncleanSessionResumption( MQTTContext_t * pContext )
25332533
}
25342534

25352535
if( ( status == MQTTSuccess ) &&
2536-
( pContext->retrieveFunction != NULL ))
2536+
( pContext->retrieveFunction != NULL ) )
25372537
{
25382538
cursor = MQTT_STATE_CURSOR_INITIALIZER;
25392539

25402540
packetId = MQTT_PublishToResend( pContext, &cursor );
25412541

25422542
if( ( packetId != MQTT_PACKET_ID_INVALID ) &&
2543-
( pContext->retrieveFunction(pContext, packetId, &pIoVec, &ioVecCount ) != true ) )
2543+
( pContext->retrieveFunction( pContext, packetId, &pIoVec, &ioVecCount ) != true ) )
25442544
{
25452545
status = MQTTPublishRetrieveFailed;
25462546
}
25472547

2548-
/* Resend all the PUBLISH for which PUBCK/PUBREC is not received
2548+
/* Resend all the PUBLISH for which PUBCK/PUBREC is not received
25492549
* after session is reestablished. */
25502550
while( ( packetId != MQTT_PACKET_ID_INVALID ) &&
2551-
( status == MQTTSuccess ) )
2551+
( status == MQTTSuccess ) )
25522552
{
25532553
totalMessageLength = 0;
25542554

25552555
for( pIoVectIterator = pIoVec; pIoVectIterator <= &( pIoVec[ ioVecCount - 1U ] ); pIoVectIterator++ )
25562556
{
25572557
totalMessageLength += pIoVectIterator->iov_len;
25582558
}
2559-
2560-
MQTT_PRE_STATE_UPDATE_HOOK(pContext);
2559+
2560+
MQTT_PRE_STATE_UPDATE_HOOK( pContext );
25612561

25622562
if( sendMessageVector( pContext, pIoVec, ioVecCount ) != ( int32_t ) totalMessageLength )
25632563
{
25642564
status = MQTTSendFailed;
25652565
}
25662566

2567-
MQTT_POST_STATE_UPDATE_HOOK(pContext);
2567+
MQTT_POST_STATE_UPDATE_HOOK( pContext );
25682568

25692569
packetId = MQTT_PublishToResend( pContext, &cursor );
25702570

@@ -2778,7 +2778,7 @@ MQTTStatus_t MQTT_InitRetransmits( MQTTContext_t * pContext,
27782778
MQTTRetransmitStorePacket storeFunction,
27792779
MQTTRetransmitRetrievePacket retrieveFunction,
27802780
MQTTRetransmitClearPacket clearFunction,
2781-
MQTTRetransmitClearAllPackets clearAllFunction )
2781+
MQTTRetransmitClearAllPackets clearAllFunction )
27822782
{
27832783
MQTTStatus_t status = MQTTSuccess;
27842784

@@ -3699,15 +3699,15 @@ const char * MQTT_Status_strerror( MQTTStatus_t status )
36993699
case MQTTStatusDisconnectPending:
37003700
str = "MQTTStatusDisconnectPending";
37013701
break;
3702-
3702+
37033703
case MQTTPublishStoreFailed:
37043704
str = "MQTTPublishStoreFailed";
37053705
break;
3706-
3706+
37073707
case MQTTPublishRetrieveFailed:
37083708
str = "MQTTPublishRetrieveFailed";
37093709
break;
3710-
3710+
37113711
case MQTTPublishClearAllFailed:
37123712
str = "MQTTPublishClearAllFailed";
37133713
break;

source/core_mqtt_serializer.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
/**
105105
* @brief Set a bit in an 8-bit unsigned integer.
106106
*/
107-
#define UINT8_CLEAR_BIT( x, position ) ( ( x ) = ( uint8_t ) ( ( x ) & ( ~ ( 0x01U << ( position ) ) ) ) )
107+
#define UINT8_CLEAR_BIT( x, position ) ( ( x ) = ( uint8_t ) ( ( x ) & ( ~( 0x01U << ( position ) ) ) ) )
108108

109109
/**
110110
* @brief Macro for checking if a bit is set in a 1-byte unsigned int.
@@ -2628,26 +2628,27 @@ MQTTStatus_t MQTT_GetIncomingPacketTypeAndLength( TransportRecv_t readFunc,
26282628

26292629
/*-----------------------------------------------------------*/
26302630

2631-
MQTTStatus_t MQTT_UpdateDuplicatePublishFlag( uint8_t * pHeader , bool set)
2631+
MQTTStatus_t MQTT_UpdateDuplicatePublishFlag( uint8_t * pHeader,
2632+
bool set )
26322633
{
26332634
MQTTStatus_t status = MQTTSuccess;
26342635

2635-
if(pHeader == NULL)
2636+
if( pHeader == NULL )
26362637
{
26372638
status = MQTTBadParameter;
2638-
}
2639+
}
26392640
else if( ( ( *pHeader ) & MQTT_PACKET_TYPE_PUBLISH ) == 0 )
26402641
{
26412642
status = MQTTBadParameter;
2642-
}
2643+
}
26432644
else if( set )
26442645
{
26452646
UINT8_SET_BIT( *pHeader, MQTT_PUBLISH_FLAG_DUP );
2646-
}
2647+
}
26472648
else
26482649
{
26492650
UINT8_CLEAR_BIT( *pHeader, MQTT_PUBLISH_FLAG_DUP );
2650-
}
2651+
}
26512652

26522653
return status;
26532654
}

source/include/core_mqtt.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ typedef void (* MQTTEventCallback_t )( struct MQTTContext * pContext,
102102
struct MQTTDeserializedInfo * pDeserializedInfo );
103103

104104
/**
105-
* @brief User defined API used to store outgoing publishes. Used to track any publish
105+
* @brief User defined API used to store outgoing publishes. Used to track any publish
106106
* retransmit on an unclean session connection.
107107
*
108108
* @param[in] pContext Initialised MQTT Context.
@@ -114,13 +114,13 @@ typedef void (* MQTTEventCallback_t )( struct MQTTContext * pContext,
114114
*/
115115
/* @[define_mqtt_retransmitstorepacket] */
116116
typedef bool ( * MQTTRetransmitStorePacket)( struct MQTTContext * pContext,
117-
uint16_t packetId,
118-
TransportOutVector_t * pIoVec,
119-
size_t ioVecCount );
117+
uint16_t packetId,
118+
TransportOutVector_t * pIoVec,
119+
size_t ioVecCount );
120120
/* @[define_mqtt_retransmitstorepacket] */
121121

122122
/**
123-
* @brief User defined API used to retreive a copied publish for resend operation. Used to
123+
* @brief User defined API used to retreive a copied publish for resend operation. Used to
124124
* track any publish retransmit on an unclean session connection.
125125
*
126126
* @param[in] pContext Initialised MQTT Context.
@@ -132,13 +132,13 @@ typedef bool ( * MQTTRetransmitStorePacket)( struct MQTTContext * pContext,
132132
*/
133133
/* @[define_mqtt_retransmitretrievepacket] */
134134
typedef bool ( * MQTTRetransmitRetrievePacket)( struct MQTTContext * pContext,
135-
uint16_t packetId,
136-
TransportOutVector_t ** pIoVec,
137-
size_t * ioVecCount );
135+
uint16_t packetId,
136+
TransportOutVector_t ** pIoVec,
137+
size_t * ioVecCount );
138138
/* @[define_mqtt_retransmitretrievepacket] */
139139

140140
/**
141-
* @brief User defined API used to clear a particular copied publish packet. Used to
141+
* @brief User defined API used to clear a particular copied publish packet. Used to
142142
* track any publish retransmit on an unclean session connection.
143143
*
144144
* @param[in] pContext Initialised MQTT Context.
@@ -147,20 +147,20 @@ typedef bool ( * MQTTRetransmitRetrievePacket)( struct MQTTContext * pContext,
147147
* @return True if the clear is successful else false.
148148
*/
149149
/* @[define_mqtt_retransmitclearpacket] */
150-
typedef bool (*MQTTRetransmitClearPacket)( struct MQTTContext * pContext,
151-
uint16_t packetId );
150+
typedef bool (* MQTTRetransmitClearPacket)( struct MQTTContext * pContext,
151+
uint16_t packetId );
152152
/* @[define_mqtt_retransmitclearpacket] */
153153

154154
/**
155-
* @brief User defined API used to clear all copied publish packets. Used to
155+
* @brief User defined API used to clear all copied publish packets. Used to
156156
* when connecting with a clean session.
157157
*
158158
* @param[in] pContext Initialised MQTT Context.
159159
*
160160
* @return True if the clear all is successful else false.
161161
*/
162162
/* @[define_mqtt_retransmitclearallpackets] */
163-
typedef bool (*MQTTRetransmitClearAllPackets)( struct MQTTContext * pContext );
163+
typedef bool (* MQTTRetransmitClearAllPackets)( struct MQTTContext * pContext );
164164
/* @[define_mqtt_retransmitclearallpackets] */
165165

166166
/**
@@ -323,7 +323,7 @@ typedef struct MQTTContext
323323
/**
324324
* @brief User defined API used to clear a particular copied publish packet.
325325
*/
326-
MQTTRetransmitClearPacket clearFunction;
326+
MQTTRetransmitClearPacket clearFunction;
327327

328328
/**
329329
* @brief User defined API used to clear all copied publish packets.
@@ -510,7 +510,7 @@ MQTTStatus_t MQTT_InitStatefulQoS( MQTTContext_t * pContext,
510510
*
511511
* @return #MQTTBadParameter if invalid parameters are passed;
512512
* #MQTTSuccess otherwise.
513-
*
513+
*
514514
* @endcode
515515
*/
516516

source/include/core_mqtt_serializer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ typedef enum MQTTStatus
102102
MQTTStatusConnected, /**< MQTT connection is established with the broker */
103103
MQTTStatusNotConnected, /**< MQTT connection is not established with the broker */
104104
MQTTStatusDisconnectPending, /**< Transport Interface has failed and MQTT connection needs to be closed */
105-
MQTTPublishStoreFailed, /**< User provided API to store a copy of outgoing publish for retransmission purposes,
105+
MQTTPublishStoreFailed, /**< User provided API to store a copy of outgoing publish for retransmission purposes,
106106
has failed */
107-
MQTTPublishRetrieveFailed, /**< User provided API to retrieve the copy of a publish while reconnecting
107+
MQTTPublishRetrieveFailed, /**< User provided API to retrieve the copy of a publish while reconnecting
108108
with an unclean session has failed */
109-
MQTTPublishClearAllFailed /**< User provided API to clear all the copies of publishes while connecting with a clean
109+
MQTTPublishClearAllFailed /**< User provided API to clear all the copies of publishes while connecting with a clean
110110
session has failed */
111111
} MQTTStatus_t;
112112

test/unit-test/core_mqtt_serializer_utest.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2910,12 +2910,12 @@ void test_MQTT_UpdateDuplicatePublishFlag_Happy_Path()
29102910
/* Test to set the flag. */
29112911
mqttStatus = MQTT_UpdateDuplicatePublishFlag( &pHeader, true );
29122912
TEST_ASSERT_EQUAL( MQTTSuccess, mqttStatus );
2913-
TEST_ASSERT_NOT_EQUAL_INT( (pHeader) & ( 0x01U << ( 3 ) ), 0 );
2913+
TEST_ASSERT_NOT_EQUAL_INT( ( pHeader ) & ( 0x01U << ( 3 ) ), 0 );
29142914

29152915
/* Test to clear the flag. */
29162916
mqttStatus = MQTT_UpdateDuplicatePublishFlag( &pHeader, false );
29172917
TEST_ASSERT_EQUAL( MQTTSuccess, mqttStatus );
2918-
TEST_ASSERT_EQUAL_INT( (pHeader) & ( 0x01U << ( 3 ) ), 0 );
2918+
TEST_ASSERT_EQUAL_INT( ( pHeader ) & ( 0x01U << ( 3 ) ), 0 );
29192919
}
29202920

29212921
/* ========================================================================== */

0 commit comments

Comments
 (0)