Correct property integer types to unsigned #559

This commit is contained in:
Ian Craggs 2019-07-23 12:22:06 +01:00
parent e748cd886b
commit 282b54c3a9
4 changed files with 10 additions and 10 deletions

View File

@ -957,7 +957,7 @@ int MQTTPacket_VBIlen(int rem_len)
* @param value the decoded length returned
* @return the number of bytes read from the socket
*/
int MQTTPacket_VBIdecode(int (*getcharfn)(char*, int), int* value)
int MQTTPacket_VBIdecode(int (*getcharfn)(char*, int), unsigned int* value)
{
char c;
int multiplier = 1;
@ -997,7 +997,7 @@ int bufchar(char* c, int count)
}
int MQTTPacket_decodeBuf(char* buf, int* value)
int MQTTPacket_decodeBuf(char* buf, unsigned int* value)
{
bufptr = buf;
return MQTTPacket_VBIdecode(bufchar, value);

View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2009, 2018 IBM Corp.
* Copyright (c) 2009, 2019 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@ -263,7 +263,7 @@ int readInt4(char** pptr);
void writeMQTTLenString(char** pptr, MQTTLenString lenstring);
int MQTTLenStringRead(MQTTLenString* lenstring, char** pptr, char* enddata);
int MQTTPacket_VBIlen(int rem_len);
int MQTTPacket_decodeBuf(char* buf, int* value);
int MQTTPacket_decodeBuf(char* buf, unsigned int* value);
#include "MQTTPacketOut.h"

View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2018 IBM Corp.
* Copyright (c) 2017, 2019 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@ -273,7 +273,7 @@ int MQTTProperty_read(MQTTProperty* prop, char** pptr, char* enddata)
int MQTTProperties_read(MQTTProperties* properties, char** pptr, char* enddata)
{
int rc = 0;
int remlength = 0;
unsigned int remlength = 0;
FUNC_ENTRY;
/* we assume an initialized properties structure */

View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2018 IBM Corp.
* Copyright (c) 2017, 2019 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@ -102,9 +102,9 @@ typedef struct
enum MQTTPropertyCodes identifier; /**< The MQTT V5 property id. A multi-byte integer. */
/** The value of the property, as a union of the different possible types. */
union {
char byte; /**< holds the value of a byte property type */
short integer2; /**< holds the value of a 2 byte integer property type */
int integer4; /**< holds the value of a 4 byte integer property type */
unsigned char byte; /**< holds the value of a byte property type */
unsigned short integer2; /**< holds the value of a 2 byte integer property type */
unsigned int integer4; /**< holds the value of a 4 byte integer property type */
struct {
MQTTLenString data; /**< The value of a string property, or the name of a user property. */
MQTTLenString value; /**< The value of a user property. */