From 62da8e34800afb658a19037fa37715c869311fae Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Fri, 10 Nov 2017 22:23:53 +0100 Subject: 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 --- src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib') 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)); -- cgit v1.2.3