summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@edeltech.ch>2017-11-10 22:23:53 +0100
committerSamuel Gaist <samuel.gaist@edeltech.ch>2018-03-29 19:12:07 +0000
commit62da8e34800afb658a19037fa37715c869311fae (patch)
treea1a681b9e2fd70bbb273f8578fa409d865de80fa
parent1c4cae62771eb53987cc0684dcb662732a8509a9 (diff)
doc: Improve QByteArray::fromRawData snippet
The current snippet uses integer literals that will trigger the Wnarrowing warning with recent version of gcc. This patch replaces them with character literals to fix this warning. Change-Id: Iffad495f24cc9d4c1674a7fe3f6b45c46a625ff8 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp
index a17e541df3..d163129d54 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp
@@ -395,10 +395,10 @@ QByteArray ba = QByteArray::number(12.3456, 'E', 3);
//! [43]
static const char mydata[] = {
- 0x00, 0x00, 0x03, 0x84, 0x78, 0x9c, 0x3b, 0x76,
- 0xec, 0x18, 0xc3, 0x31, 0x0a, 0xf1, 0xcc, 0x99,
+ '\x00', '\x00', '\x03', '\x84', '\x78', '\x9c', '\x3b', '\x76',
+ '\xec', '\x18', '\xc3', '\x31', '\x0a', '\xf1', '\xcc', '\x99',
...
- 0x6d, 0x5b
+ '\x6d', '\x5b'
};
QByteArray data = QByteArray::fromRawData(mydata, sizeof(mydata));