mirror of https://github.com/eclipse/paho.mqtt.c
Use macros instead of constants to eliminate compile warnings
This commit is contained in:
parent
695ef2cbd9
commit
02db68bf76
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2009, 2025 IBM Corp. and Ian Craggs
|
* Copyright (c) 2009, 2026 IBM Corp. and Ian Craggs
|
||||||
*
|
*
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v2.0
|
* are made available under the terms of the Eclipse Public License v2.0
|
||||||
|
|
@ -945,11 +945,7 @@ int MQTTPacket_send_publish(Publish* pack, int dup, int qos, int retained, netwo
|
||||||
memcpy(pack->mask, packetbufs.mask, sizeof(pack->mask));
|
memcpy(pack->mask, packetbufs.mask, sizeof(pack->mask));
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
#if defined(_WIN32)
|
|
||||||
#define buflen 30
|
#define buflen 30
|
||||||
#else
|
|
||||||
const int buflen = 30;
|
|
||||||
#endif
|
|
||||||
char buf[buflen];
|
char buf[buflen];
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2009, 2023 IBM Corp.
|
* Copyright (c) 2009, 2026 IBM Corp.
|
||||||
*
|
*
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v2.0
|
* are made available under the terms of the Eclipse Public License v2.0
|
||||||
|
|
@ -655,14 +655,10 @@ void MQTTPersistence_wrapMsgID(Clients *client)
|
||||||
|
|
||||||
|
|
||||||
#if !defined(NO_PERSISTENCE)
|
#if !defined(NO_PERSISTENCE)
|
||||||
|
#define KEYSIZE PERSISTENCE_MAX_KEY_LENGTH + 1
|
||||||
int MQTTPersistence_unpersistQueueEntry(Clients* client, MQTTPersistence_qEntry* qe)
|
int MQTTPersistence_unpersistQueueEntry(Clients* client, MQTTPersistence_qEntry* qe)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
#if defined(_WIN32)
|
|
||||||
#define KEYSIZE PERSISTENCE_MAX_KEY_LENGTH + 1
|
|
||||||
#else
|
|
||||||
const size_t KEYSIZE = PERSISTENCE_MAX_KEY_LENGTH + 1;
|
|
||||||
#endif
|
|
||||||
char key[KEYSIZE];
|
char key[KEYSIZE];
|
||||||
int chars = 0;
|
int chars = 0;
|
||||||
|
|
||||||
|
|
@ -688,9 +684,6 @@ int MQTTPersistence_persistQueueEntry(Clients* aclient, MQTTPersistence_qEntry*
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
int bufindex = 0;
|
int bufindex = 0;
|
||||||
#if !defined(_WIN32)
|
|
||||||
const size_t KEYSIZE = PERSISTENCE_MAX_KEY_LENGTH + 1;
|
|
||||||
#endif
|
|
||||||
char key[KEYSIZE];
|
char key[KEYSIZE];
|
||||||
int chars = 0;
|
int chars = 0;
|
||||||
int lens[MAX_NO_OF_BUFFERS];
|
int lens[MAX_NO_OF_BUFFERS];
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2009, 2024 IBM Corp. and Ian Craggs
|
* Copyright (c) 2009, 2026 IBM Corp. and Ian Craggs
|
||||||
*
|
*
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v2.0
|
* are made available under the terms of the Eclipse Public License v2.0
|
||||||
|
|
@ -334,11 +334,7 @@ int MQTTProtocol_handlePublishes(void* pack, SOCKET sock)
|
||||||
|
|
||||||
/* Format and print publish data to trace */
|
/* Format and print publish data to trace */
|
||||||
{
|
{
|
||||||
#if defined(_WIN32)
|
|
||||||
#define buflen 30
|
#define buflen 30
|
||||||
#else
|
|
||||||
const int buflen = 30;
|
|
||||||
#endif
|
|
||||||
char buf[buflen];
|
char buf[buflen];
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue