lxqt / qtermwidget

The terminal widget for QTerminal
https://lxqt.github.io
GNU General Public License v2.0
485 stars 247 forks source link

Fix unsage mix of bool and int warning. #510

Closed doug1234 closed 1 year ago

yan12125 commented 1 year ago

Thanks good catch! But looks like there are still bool to int conversion?

By the way, how did you get the warning?

doug1234 commented 1 year ago

These were the only two my compiler flagged as a concern. I am up for fixing more bool conversion issues if you think its appropriate for this PR. I got the warning because I build on a compiler you don't normally support (Visual Sudio 2022). But I thought you may appreciate this change anyway.

yan12125 commented 1 year ago

Maybe visual studio somehow accepts booleans for the bitwise or operator, which is designed for integers. How about switching to more verbose yet simpler codes? (not tested)

if (newLine[x].rendition & RE_BLINK) {
    _hasBlinker = true;
}

By the way, I think visual studio is for Windows applications only? There is no plan to support Windows yet: https://github.com/lxqt/qtermwidget/issues/42.

doug1234 commented 1 year ago

I like your suggestion and I made the change.

I have been able to build on Visual Studio with only a few features unavailable. If you are interested, I can send a PR your way when I have time.

yan12125 commented 1 year ago

Thanks!

I have been able to build on Visual Studio with only a few features unavailable. If you are interested, I can send a PR your way when I have time.

Trivial fixes like this are welcome. If there are non-trivial changes, please discuss at https://github.com/lxqt/qtermwidget/issues/42 first. I will reopen that issue if needed.