Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Unused variable in sdk\pipedprocess.cpp (C::B rev1985)

(1/1)

Michael:
Hello,

by compiling rev1985, I got a warning about an unused variable:


--- Quote ---sdk\pipedprocess.cpp:63: warning: unused variable 'wbuf'

--- End quote ---

will this variable be successively used or could be just deleted?

[EDIT]: The variable was used in code now commented and it is no mre used (at least actually). So, it could be commented without problems.


--- Code: ---...
// The folowing function was copied verbatim from wxTextStream::NextChar()
        // The only change, is the removal of the MB2WC function
        // With PipedProcess we work with compilers/debuggers which (usually) don't
        // send us unicode (at least GDB).
        wxChar NextChar()
        {
        #if wxUSE_UNICODE
//            wxChar wbuf[2];                          //unused wbuf variable commented
            memset((void*)m_lastBytes, 0, 10);
            for(size_t inlen = 0; inlen < 9; inlen++)
            {
                // actually read the next character
                m_lastBytes[inlen] = m_input.GetC();

                if(m_input.LastRead() <= 0)
                    return wxEOT;
//                int retlen = (int) m_conv.MB2WC(wbuf, m_lastBytes, 2); // returns -1 for failure
//                if(retlen >= 0) // res == 0 could happen for '\0' char
//                    return wbuf[0];
                return m_lastBytes[inlen]; // C::B fix (?)
            }
...

--- End code ---

Best wishes,
Michael

Navigation

[0] Message Index

Go to full version