summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Nurmenniemi <sami.nurmenniemi@qt.io>2017-06-26 11:18:33 +0300
committerSami Nurmenniemi <sami.nurmenniemi@qt.io>2017-06-27 09:13:25 +0000
commit75e933c612b63bd130c19078fdc1201738745e3e (patch)
tree7ef4022271a32c1f9d708230c6395f1b24d7c7ff
parent2aa2a2c7e893a456be4fffdc8ae96810c3517e9a (diff)
Fix QNdefNfcActRecord::action for platforms with unsigned char
QByteArray operator [] has return type of char whose signedness is dependendent on platform and compiler. Casting char to an enum with negative value does not work on configurations with unsigned char type. Fixed by explicitly casting action to signed char before converting it to enum. Task-number: QTBUG-60268 Change-Id: I733520a70c321c3b8dac9c67cfb096ac97a64b94 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/nfc/qndefnfcsmartposterrecord.cpp2
-rw-r--r--tests/auto/qndefnfcsmartposterrecord/BLACKLIST3
2 files changed, 1 insertions, 4 deletions
diff --git a/src/nfc/qndefnfcsmartposterrecord.cpp b/src/nfc/qndefnfcsmartposterrecord.cpp
index bc369980..5f2de2cc 100644
--- a/src/nfc/qndefnfcsmartposterrecord.cpp
+++ b/src/nfc/qndefnfcsmartposterrecord.cpp
@@ -720,7 +720,7 @@ QNdefNfcSmartPosterRecord::Action QNdefNfcActRecord::action() const
QNdefNfcSmartPosterRecord::UnspecifiedAction;
if (!p.isEmpty())
- value = QNdefNfcSmartPosterRecord::Action(p[0]);
+ value = QNdefNfcSmartPosterRecord::Action(static_cast<signed char>(p[0]));
return value;
}
diff --git a/tests/auto/qndefnfcsmartposterrecord/BLACKLIST b/tests/auto/qndefnfcsmartposterrecord/BLACKLIST
deleted file mode 100644
index 05536220..00000000
--- a/tests/auto/qndefnfcsmartposterrecord/BLACKLIST
+++ /dev/null
@@ -1,3 +0,0 @@
-[tst_action]
-# QTBUG-20268
-b2qt