Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmundell committed Feb 28, 2025
1 parent c8d1328 commit 4657620
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
33 changes: 18 additions & 15 deletions util/mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,11 @@ mqtt_disconnect (mqtt_t *mqtt)
static void
mqtt_client_destroy (mqtt_t *mqtt)
{
if (mqtt && mqtt->client) {
MQTTClient_destroy (&mqtt->client);
mqtt->client = NULL;
}
if (mqtt && mqtt->client)
{
MQTTClient_destroy (&mqtt->client);
mqtt->client = NULL;
}
}

/**
Expand Down Expand Up @@ -720,12 +721,13 @@ mqtt_unsubscribe (const char *topic)
* application by setting <i>topic</i> to point to the topic.
* @param[out] topic_len The length of the topic.
* @param[out] payload The address of a pointer to the received message. This
* function allocates the memory for the payload and returns
* it to the application by setting <i>payload</i> to point
* to the received message.
* function allocates the memory for the payload and
* returns it to the application by setting
* <i>payload</i> to point to the received message.
* The pointer is set to NULL if the timeout expires.
* @param[out] payload_len The length of the payload.
* @param timeout The length of time to wait for a message in milliseconds.
* @param timeout The length of time to wait for a message in
* milliseconds.
*
* @return 0 on message retrieved, 1 on no message retrieved and -1 on an error.
*/
Expand Down Expand Up @@ -811,17 +813,18 @@ mqtt_retrieve_message_r (mqtt_t *mqtt, char **topic, int *topic_len,
* <b>Important note:</b> The application must free() the memory allocated
* to the topic and payload when processing is complete.
*
* @param[out] topic The address of a pointer to a topic. This function
* allocates the memory for the topic and returns it to the
* application by setting <i>topic</i> to point to the topic.
* @param[out] topic The address of a pointer to a topic. This function
* allocates the memory for the topic and returns it to the
* application by setting <i>topic</i> to point to the topic.
* @param[out] topic_len The length of the topic.
* @param[out] payload The address of a pointer to the received message. This
* function allocates the memory for the payload and returns
* it to the application by setting <i>payload</i> to point
* to the received message.
* function allocates the memory for the payload and
* returns it to the application by setting
* <i>payload</i> to point to the received message.
* The pointer is set to NULL if the timeout expires.
* @param[out] payload_len The length of the payload.
* @param timeout The length of time to wait for a message in milliseconds.
* @param timeout The length of time to wait for a message in
* milliseconds.
*
* @return 0 on message retrieved, 1 on timeout and -1 on an error.
*/
Expand Down
3 changes: 2 additions & 1 deletion util/mqtt_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
#include <cgreen/mocks.h>

void
MQTTClient_destroy (MQTTClient *client) {
MQTTClient_destroy (MQTTClient *client)
{
(void) client;
}

Expand Down

0 comments on commit 4657620

Please sign in to comment.