From 3ce39c273fcc98392b71e2bd9486a4823d55d975 Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Tue, 5 Aug 2014 15:28:19 -0400 Subject: [PATCH] use compatible type max definitions UINT8_MAX/UINT16_MAX only work on osx and glibc builds with certain defines. --- src/amqp_table.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/amqp_table.cpp b/src/amqp_table.cpp index 3bcd654..daf8cad 100644 --- a/src/amqp_table.cpp +++ b/src/amqp_table.cpp @@ -90,9 +90,9 @@ void Table::writeFieldValue(QDataStream &stream, const QVariant &value) case QMetaType::Int: { int i = qAbs(value.toInt()); - if (i <= qint8(UINT8_MAX)) { + if (i <= qint8(SCHAR_MAX)) { type = ShortShortInt; - } else if (i <= qint16(UINT16_MAX)) { + } else if (i <= qint16(SHRT_MAX)) { type = ShortInt; } else { type = LongInt; @@ -105,9 +105,9 @@ void Table::writeFieldValue(QDataStream &stream, const QVariant &value) case QMetaType::UInt: { int i = value.toInt(); - if (i <= qint8(UINT8_MAX)) { + if (i <= qint8(SCHAR_MAX)) { type = ShortShortInt; - } else if (i <= qint16(UINT16_MAX)) { + } else if (i <= qint16(SHRT_MAX)) { type = ShortInt; } else { type = LongInt;