Commit Graph

35577 Commits

Author SHA1 Message Date
Nico Vertriest
cb57700456 Doc: Update Find Files example
- review text
- update screenshot

Task-number: QTBUG-60635
Change-Id: I596ce0e08be9ed9aea7834eeda1c3c2c19c28d7a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-04-09 06:50:52 +00:00
Nico Vertriest
23b2d2ada5 Doc: Update Event Transitions Example
- added screenshot
- some modifications to the text

Task-number QTBUG-60635

Change-Id: I57b269f93cdba696b424b5ba008d0f46ac612cda
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-04-09 06:50:21 +00:00
Kai Koehne
335754d0a3 Fix license header for tst_toolingsupport.cpp
Change-Id: Id355afc8eb57a40a0f8d06fa2920f03d94ef9337
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 06:37:01 +00:00
Kari Oikarinen
b49a2e671a tst_QPrinter: Use qWaitForWindowActive() to wait for dialog
Instead of an unconditional wait.

The QSKIP is necessary because the PDF format is non-native and the Windows
implementation of QPrintDialog doesn't work then.

The macOS implementation has the same warning, so add the check for that OS
as well.

The test has previously passed, since it hasn't seen not actually opening the
dialog as an issue.

Change-Id: Ib53e378b232580358f13e0c5206404412f9e6ee2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-09 05:59:39 +00:00
Thiago Macieira
a9d903d18f QSemaphore: Fix 64-bit Linux QSemaphores initialized to non-zero
The original design for the 64-bit futex had the token count replicated
in the high part. But the constructor wasn't setting it. This is one of
the issues I had noticed when investigating QTBUG-66875, but didn't need
to address since the the fix I ended up applying in commit
081c001deb made that unnecessary: the high
part only had the number of waiters.

Unfortunately, when commit f502270c0f06daba75c1da381bd1658d81aa7bba
brought back the token count in the high part, I failed to correct that
problem. As a consequence, every QSemaphore that was initialized in the
constructor to a non-zero value would eventually deadlock.

This commit fixes that oversight.

Task-number: QTBUG-67481
Change-Id: I662b8f168c74440ab1a8fffd1522be6b85adb4d0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io>
2018-04-06 22:46:49 +00:00
Edward Welbourne
28c9ad199c Revise dates of Pacific/Kiritimati's day-skip transition
The TZ database has recently revised its ccount of when they skipped a
day to cross the international date line, from skipping Jan 1st 1995
to skipping December 31st 1994.  So Move the before-days check to
December 30th; and correct the Feb 2nd that was meant to be Jan 2nd
(and does need to remain so, for compatibility with systems with out
of date data).

Task-number: QTBUG-67497
Change-Id: I5b9483c553205817f995f91793662a5a85e03192
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-04-06 18:05:04 +00:00
Johan Klokkhammer Helsing
fbb9c0461c QOpenGLTexture: Set wrap mode if NPOT textures are not fully supported
The OpenGL wrap mode defaults to GL_REPEAT although it is not supported for
non-power-of-two textures on hardware that only has limited support.

I.e. the following would create a texture with an invalid wrap mode:

    auto *t = new QOpenGLTexture(QOpenGLTexture::Target2D);
    t.setSize(123, 456);

This patch adds a check in QOpenGLWindow::setSize to see if it's called with a
non-power-of-two size on hardware without full support, and if so sets wrapMode
to ClampToEdge (which should work on devices with limited support).

Task-number: QTBUG-67418
Change-Id: I56e9f4383dbf5430c2bc5e4e9e585712b3603c13
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-04-06 12:47:11 +00:00
Andy Shaw
d90fb72c20 Pass on local html links with a fragment to openUrl()
If a file link to a html file has a fragment part included then this
will be lost when passed to QDesktopServices::openUrl() as this is not
kept in the conversion of the QUrl. So by checking the filename in the
case of a fragment existing in the url, we can be sure that the
information is passed on correctly for html files.

Task-number: QTBUG-14460
Change-Id: I8167d8c164713dd999603ba9e74150f4f1a4abea
Reviewed-by: David Faure <david.faure@kdab.com>
2018-04-06 12:45:02 +00:00
Andy Shaw
ec23d96c86 oci: Use OCIBindByPos2 to accommodate data longer than USHRT_MAX
OCIBindByPos2 is only needed when using execBatch(), binding data that
is longer than USHRT_MAX works for exec() so this is left unchanged.

Change-Id: Ifdcf91939d184f225d24c13052ea0b81611ecf91
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-06 12:44:37 +00:00
Kari Oikarinen
fd87c8da82 tests/auto/other: Avoid unconditional qWait()s
There is no need to qWait() before a QTRY_VERIFY. qWait() will also
intermittently handle events while waiting, so calling it in a loop isn't
necessary.

Change-Id: Ica7fbf18c03e673213dd9b72f31f71937cdcb145
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-06 07:19:19 +00:00
David Faure
a1b1dd3b84 QMimeDatabase: fix assert when fetching data for invalid mimetype
The Q_ASSERT(mimePrivate.fromCache) at qmimedatabase.cpp:218
which I added in commit 7a5644d648, was being triggered when calling comment()
for invalid mimetypes such as db.mimeTypeForName("").

Change-Id: I8037041a4b435d2a5ba24ec94b7858e38b2f0bf2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-06 07:19:01 +00:00
David Faure
e729ac6dc5 QSqlDatabase: Skip confusing thread warning on invalid QSqlDatabase
If the db isn't valid, then that's the actual issue, not the fact that we're
getting the same invalid db (with the same driver QSqlNullDriver) in
multiple threads.

Change-Id: I95490818ed78e741c3823e115f139c2cff01b0b1
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-04-06 07:18:03 +00:00
Eirik Aavitsland
cab5f37ef4 Fix visual artifacts in diffuse image dithering (the default)
The distributed error fractions in the Floyd-Steinberg dithering
algorithm were not computed precisely. In particular, rounding errors
could be accumulated, leading to visual artifacts.

Task-number: QTBUG-67425
Change-Id: I77b48c3cab3e66ca161721d14b58fcc4188e74a8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-04-06 06:40:37 +00:00
Joerg Bornemann
0ee5cbb1a4 Set WindowsTargetPlatform[Min]Version if WindowsSDKVersion is set
This fixes qmake-generated project files for Visual Studio 2017 for
setups where the Windows 8.1 SDK is not installed.

Task-number: QTBUG-66265
Change-Id: I67712019f7142e40262f171eb23f9f1e6ab3a251
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-04-06 06:18:00 +00:00
Kari Oikarinen
b32d16d468 tst_QLocale: Avoid manual deletes
Also use data-driven test to reduce duplication.

Change-Id: I9516e52267cb3c7b239030fd73dbbf23ac8f52f7
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-06 05:44:50 +00:00
Oliver Wolff
11adeb24ff winrt: socket engine: Replace last occurrences of old connect syntax
Change-Id: I1d2f3b0b39de252f5392a2411ff4e3d94fd8593b
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-04-06 05:31:05 +00:00
Oliver Wolff
a634f01402 winrt: Properly deinitialize socket on connection failure
Change-Id: I4dde73423111ca4af386fa76ac26d1a1161fe493
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-04-06 05:31:04 +00:00
Oliver Wolff
29b21e83ba winrt: process pending data before closing a socket connection
If data is received and the remote immediately closes the connection,
it was possible that data was lost. If a remote closes the connection
make sure that any pending data is processed, before signaling closing
of the socket.

Change-Id: Ia94a616a31184fd28695919baaff99811fe0f1dd
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-04-06 05:31:03 +00:00
Kai Koehne
20d2f02485 Doc: Remove section about Qt Gui in Qt 4 from overview page
Qt 5 is now old enough that the delta to Qt 4 doesn't need to be on
the central module page anymore. This is best left to

   https://doc.qt.io/qt-5/portingguide.html

Change-Id: If65ef91765e1aca37fd7f107c2334ac65e403cd3
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-04-06 05:29:53 +00:00
Jan Grulich
470a50375a Avoid multiple connections to same response in FileChooser portal
When not specified, xdg-desktop-portal keeps using same Request object
over and over when returning response, causing multiple connections
to same slot on same DBus object. While this is not problem when using
FileDialog just once, it is a problem for QML FileDialog which is
usually reused. For this purpose x-d-p provides handle_token option
where you can specify token to be used when creating Request objects.

Change-Id: Ie6569700c48e05fcefa4d5c22c921410f87ea7ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-06 05:07:05 +00:00
Gabriel de Dietrich
b6f7230cda configure: Detect Cocoa instead of Carbon
Change-Id: I9d1ff47481ad450b4b57c82e15186657eb7dcf93
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-05 21:04:22 +00:00
Gabriel de Dietrich
8396162027 QTabBar: Repaint when releasing mouse on selected tab
Some styles, most notably QMacStyle, require this to
properly reflect the pressed state.

Change-Id: Ie841d97afbe3cfdfde1254a7069876a1a0af2e52
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-05 21:04:06 +00:00
Gabriel de Dietrich
cff9142942 QMacStyle: Fix "on" toggle button text color
Change-Id: I344c63debdcf012a16305f1b2124e8ad0785d982
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-05 21:03:57 +00:00
David Edmundson
63a433f6c8 Make nvidia resets opt-in based on QSurfaceFormat::ResetNotification
We can't be sure every user will check the return value from makeCurrent
and reset appropriately.
Even though after a reset a user will be left with the same garbage as
before, it's safer than a potential infinite loop.

Change-Id: I5b328c654ad2a89c5b8c4399e2eb38150f4f384b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-04-05 19:57:09 +00:00
Timur Pocheptsov
1c463000ed HTTP/2 - treat HEADERS frames as valid for streams in 'open' state
Previously, I erroneously expected HEADERS frame only on a stream,
which is in half-closed (local) or reserved (remote) state. But
'open' state is also valid (RFC7540, 6.2). For example, we start
uploading some data, we have sent HEADERS frame and now are
sending DATA frames, without END_STREAM flag set yet; this stream
is in 'open' state. If a server wants to reply with some error
status code or redirect - it does not have to wait for our END_STREAM
flag, reading all this data that will be discarded anyway.

Task-number: QTBUG-67469
Change-Id: I53e3a5e9b2ab7f7917ae083ba44e862a227db238
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-05 19:56:55 +00:00
Edward Welbourne
3c8181de70 Kludge QLocale test order to fix fall-out from setDefault()
This makes an irreversible global change: tests that do it will mess
with other tests.  So make sure they're all last.  This required
splitting up one test; and revealed another that secretly depended on
being run with C as default locale.

Task-number: QTBUG-67276
Change-Id: Ic24ef48b2c9bd5c37c1f11260b437628019624ca
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
2018-04-05 19:56:47 +00:00
David Edmundson
f1fc449016 Support graphics reset status for offscreen surfaces in XCB-GLX
I originally didn't to match the ANGLE code, however it's important for
all surfaces to be able to know to reset if their makeContext fails.

This is espcially relevant on some Linux nvidia drivers which has a bug
where while(glGetError()) won't ever clear whilst a reset is in
progress.

Change-Id: Iae3502168cda748c601a9aee1497e40c6d82cd83
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-04-05 14:50:51 +00:00
Mitch Curtis
a14bfea500 Improve QAbstractSpinBox::stepBy() docs
Change-Id: I28e942b6b2952205641c751e4c120cb38ae13fd6
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2018-04-05 14:50:30 +00:00
Friedemann Kleint
2823cc6d4b Windows QPA: Fix override cursor not working when re-entering the window
Return early from QWindowsWindow::applyCursor() when an override cursor
is set.

Task-number: QTBUG-67467
Change-Id: I0d3ceead8bbbd3c6295c216a944a1ef15b6f8190
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-04-05 09:00:51 +00:00
Friedemann Kleint
f2fd5f390c tst_QCursor::equality(): Silence warnings
Silence numerous warnings:
QCursor: Cannot create bitmap cursor; invalid bitmap(s)

Amends 6445aa4b06.

Change-Id: I7b467cdeeaa7a854c2878cf1ed2a6113d8c96059
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-04-05 09:00:39 +00:00
Harald Brinkmann
c067083057 Fix memory corruption in heightForWidth cache
Overflowing q_firstCachedHfw caused memory to be overwritten
before q_cachedHfws.

Change-Id: Ibbcc72380f426550cc0569a05c54cd1acd878b33
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-04-05 08:58:48 +00:00
Kai Koehne
18a1cfaba3 Doc: Add missing punctuation in qCritical, qFatal documentation
Change-Id: If4175502f81e569f031d97da6cc7f5d46428442a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-04-05 05:40:16 +00:00
Kai Koehne
50d301cfdd Hide global qtlogging.ini from autotest
Do not let a global qtlogging.ini interfere with an autotest.
This works around an issue on Ubuntu 17.10

Task-number: QTBUG-67385
Change-Id: I0d02835eb7a561b43fe0b98f4383c170c6d51303
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joni Jäntti <joni.jantti@qt.io>
2018-04-05 05:40:07 +00:00
Allan Sandfeld Jensen
4b4870a12c Parse XDG_SESSION_TYPE and use that to determine default platform
Makes Qt application try to launch using wayland in a wayland session,
even if it was a default desktop build.

Change-Id: Ib7d4a79fbe777527d1862bd775627afae10b1e9e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-04 22:26:01 +00:00
Jarek Kobus
ab7d48625a Fix read-only text browser sometimes jump to the top of the document
Respect the inputMethodAccepted() attribute of QPlatformInputContext in
the ibus input context plugin. This is what for example the windows
input context plugin does, too.

A text browser that is read-only should not receive input method events
that include a cursor placement. So when it receives the focus, we must
only convey the received-focus information to the input method if the
widget is editable (or accepts input method events generally speaking),
because as soon as the ibus process learns about it, it will send an
input method event that looks like a "let us reset the state a clean
start and place the cursor at the beginning" message. We are not
interested in reaching that state with the ibus process.

Task-number: QTBUG-63066
Change-Id: I1b0e5f8a396bc31169d6081f9325092b447cf60a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-04-04 08:53:35 +00:00
Eskil Abrahamsen Blomfeldt
c53b86444f macOS: Document availability of freetype font engine
Since we have this documentation for the Windows platform plugin,
it makes sense to also have it for Cocoa.

Task-number: QTBUG-67372
Change-Id: I170ae251572c8e209643a582cdd7350aaf5c7ccd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-04-04 08:52:36 +00:00
Andy Shaw
33e5b55b7e Check if the movie's current pixmap is null before drawing it
Change-Id: I87ed9998108961775f8f424bfbb4b957c0b03d8a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-04 08:42:52 +00:00
Allan Sandfeld Jensen
559964849a Add lancelot based benchmark
Uses the scripts and tests we already have for lancelot as a painting
benchmark.

Change-Id: Idf8a55e2261162e619f6dbb567dc19f8dc96da4e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-04-04 08:17:43 +00:00
Kari Oikarinen
3e1ecdd74c tst_QStateMachine: Don't use unconditional waits
Instead use QSignalSpy to wait directly for the expected events.

Change-Id: I319302ea7177fe690b5d885347c505454904518e
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2018-04-04 07:07:40 +00:00
Leena Miettinen
051228c9ba Doc: Increment copyright year in global doc templates
Change-Id: I687ea95c0985c361ffb75ea3c162615b0abbb7f7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-04-04 06:56:00 +00:00
Kari Oikarinen
d31a68146d Narrow tst_QDnsLookup::lookup blacklist to only CI
It is suspected that the fault actually lies in CI infra.

Amends e3cf2a1ae9.

Task-number: QTBUG-66311
Change-Id: I967da283f0b94be1d0b99481d0cbd15ca7f98d45
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-04 05:05:51 +00:00
Gabriel de Dietrich
6d644c7a77 QWidget: Fix typo in Mac size propagation
This amends commit f8b6d104b9.

Change-Id: I77a48e68ec7db791b843fe4dfeddc4c6fedf6380
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-04 02:41:33 +00:00
Kari Oikarinen
c7dac6469c tst_QThread: Use QTRY_VERIFY instead of qWaits
These two places were sort of manually implementing QTRY_VERIFY except that they
never time out.

Change-Id: I136e6c7400194327c0475c6acfc019825ccec1b5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
2018-04-03 10:20:36 +00:00
Kari Oikarinen
231ac1b878 tst_QFutureWatcher: Avoid unconditional qWait()s
Use QSignalSpy::wait or QTRY_VERIFY instead. This shaved off ~200 ms of the
running time of the test and is more reliable.

Some unconditional qWait()s still remain in this test. They are giving an
opportunity for the wrong thing to happen and thus are not waiting for any
specific condition to be fulfilled.

Task-number: QTBUG-63992
Change-Id: I25a4470fe8d6a5b8b5039b3ed77321d24faa1707
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-03 10:20:27 +00:00
Kari Oikarinen
8b9a9651d6 Fix typoed integrity condition
Amends 594fe5c463.

Change-Id: I0fb5ab79d895cfd9698db9b4a4394481299a7e1a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-03 10:20:18 +00:00
Morten Johan Sørvig
306df144b4 Cocoa: Make QMacNativeWidget paint correctly
QWindows with transparent pixels (of which QMacNativeWidget
is an example) must be composited, even if they are
content views.

This will display the NSWindow background instead
of solid black for the areas where the Qt backingstore
has transparent pixels.

Change-Id: Ibee1327e11bc64975900b4c5d632dd5f103da4c8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-04-03 06:03:40 +00:00
Gabriel de Dietrich
dbdd5f0ffb QCoreTextFontEngine: Fix build with Xcode 9.3
Apple LLVM version 9.1.0 (clang-902.0.39.1)

Error message:

.../qfontengine_coretext.mm:827:20: error: qualified reference to
      'QFixed' is a constructor name rather than a type in this context
    return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));

Change-Id: Iebe26b3b087a16b10664208fc8851cbddb47f043
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2018-03-30 19:17:46 +00:00
Simon Hausmann
84c71207ae Fix debug_and_release builds with CONFIG += qtquickcompiler
For correct debug/ and release/ suffix substitution and thus avoid
concurrent access to generated files, we have to declare the output
directory variable used by qtquickcompiler.prf in qtdeclarative here and
enable it for substitution.

Change-Id: Id8483daffdf1b9990396c55f7bc0d08a2f65cafd
Task-number: QTBUG-66675
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-03-29 23:24:24 +00:00
Friedemann Kleint
f3a461c4a2 Stabilize tst_QGraphicsProxyWidget::tooltip_basic()
Use QTRY_VERIFY instead of hard-coded wait for the tooltip to appear.
Also use QTRY_VERIFY to verify that no top level widgets are left over
to account for tooltips and effect windows.

Change-Id: Ia9835fdc480c6abb034f6fc4ad3d6b32751ee536
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
2018-03-29 20:50:00 +00:00
Samuel Gaist
62da8e3480 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>
2018-03-29 19:12:07 +00:00