octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help needed with suspicious code in KeyboardTranslater.cpp


From: John W. Eaton
Subject: Help needed with suspicious code in KeyboardTranslater.cpp
Date: Wed, 24 Feb 2016 12:53:28 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0

Clang is producing this warning:

KeyboardTranslator.cpp:656:37: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
    result.replace(i,1,"\\x"+QByteArray(1,ch).toInt(0, 16));
                                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
KeyboardTranslator.cpp:656:37: note: use array indexing to silence this warning
    result.replace(i,1,"\\x"+QByteArray(1,ch).toInt(0, 16));
                            ^
                       &    [                             ]

Huh?  It seems to me like the intent is something like

  \\x"+QByteArray::number(QByteArray(1,ch).toInt(0, 16))

Does that look right?

jwe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]