Squash warnings

This commit is contained in:
cpq 2021-06-10 19:37:03 +01:00
parent 3deafaea7f
commit f46453f80f
2 changed files with 2 additions and 2 deletions

View File

@ -1923,7 +1923,7 @@ static void mqtt_login(struct mg_connection *c, const char *url,
void mg_mqtt_pub(struct mg_connection *c, struct mg_str *topic,
struct mg_str *data, int qos, bool retain) {
uint8_t flags = (uint8_t)((qos & 3) << 1) | (retain ? 1 : 0);
uint8_t flags = (uint8_t)(((qos & 3) << 1) | (retain ? 1 : 0));
uint32_t total_len = 2 + (uint32_t) topic->len + (uint32_t) data->len;
LOG(LL_DEBUG, ("%lu [%.*s] -> [%.*s]", c->id, (int) topic->len,
(char *) topic->ptr, (int) data->len, (char *) data->ptr));

View File

@ -83,7 +83,7 @@ static void mqtt_login(struct mg_connection *c, const char *url,
void mg_mqtt_pub(struct mg_connection *c, struct mg_str *topic,
struct mg_str *data, int qos, bool retain) {
uint8_t flags = (uint8_t)((qos & 3) << 1) | (retain ? 1 : 0);
uint8_t flags = (uint8_t)(((qos & 3) << 1) | (retain ? 1 : 0));
uint32_t total_len = 2 + (uint32_t) topic->len + (uint32_t) data->len;
LOG(LL_DEBUG, ("%lu [%.*s] -> [%.*s]", c->id, (int) topic->len,
(char *) topic->ptr, (int) data->len, (char *) data->ptr));