Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

few warnings #7

Open
okbob opened this issue Nov 23, 2020 · 4 comments
Open

few warnings #7

okbob opened this issue Nov 23, 2020 · 4 comments

Comments

@okbob
Copy link

okbob commented Nov 23, 2020

I have a fedora33

[ 60%] Built target tvision
Scanning dependencies of target scintilla
[ 61%] Building CXX object CMakeFiles/scintilla.dir/Unity/unity_5_cxx.cxx.o
[ 61%] Building CXX object CMakeFiles/scintilla.dir/Unity/unity_4_cxx.cxx.o
[ 61%] Building CXX object CMakeFiles/scintilla.dir/Unity/unity_3_cxx.cxx.o
[ 62%] Building CXX object CMakeFiles/scintilla.dir/Unity/unity_2_cxx.cxx.o
In file included from /home/pavel/src/turbo/CMakeFiles/scintilla.dir/Unity/unity_2_cxx.cxx:10:
/home/pavel/src/turbo/scintilla/src/EditView.cxx: In member function ‘void Scintilla::EditView::DrawForeground(Scintilla::Surface*, const Scintilla::EditModel&, const Scintilla::ViewStyle&, const Scintilla::LineLayout*, Sci::Line, Scintilla::PRectangle, Scintilla::Range, Sci::Position, int, int, Scintilla::ColourOptional)’:
/home/pavel/src/turbo/scintilla/src/EditView.cxx:1770:13: warning: unused variable ‘drawWhitespaceBackground’ [-Wunused-variable]
1770 | const bool drawWhitespaceBackground = vsDraw.WhitespaceBackgroundDrawn() && !background.isSet;
| ^~~~~~~~~~~~~~~~~~~~~~~~
/home/pavel/src/turbo/scintilla/src/EditView.cxx:1774:19: warning: unused variable ‘indentWidth’ [-Wunused-variable]
1774 | const XYPOSITION indentWidth = model.pdoc->IndentSize() * vsDraw.spaceWidth;
| ^~~~~~~~~~~
In file included from /home/pavel/src/turbo/CMakeFiles/scintilla.dir/Unity/unity_2_cxx.cxx:10:
/home/pavel/src/turbo/scintilla/src/EditView.cxx: At global scope:
/home/pavel/src/turbo/scintilla/src/EditView.cxx:294:13: warning: ‘void DrawTabArrow(Scintilla::Surface*, Scintilla::PRectangle, int, const Scintilla::ViewStyle&)’ defined but not used [-Wunused-function]
294 | static void DrawTabArrow(Surface *surface, PRectangle rcTab, int ymid, const ViewStyle &vsDraw) {
| ^~~~~~~~~~~~
[ 62%] Building CXX object CMakeFiles/scintilla.dir/Unity/unity_1_cxx.cxx.o
[ 62%] Building CXX object CMakeFiles/scintilla.dir/Unity/unity_0_cxx.cxx.o
[ 63%] Linking CXX static library libscintilla.a
[ 63%] Built target scintilla
Scanning dependencies of target scilexers

/home/pavel/src/turbo/scintilla/lexers/LexDMIS.cxx: In member function ‘virtual void LexerDMIS::Lex(Sci_PositionU, Sci_Position, int, Scintilla::IDocument*)’:
/home/pavel/src/turbo/scintilla/lexers/LexDMIS.cxx:253:13: warning: ‘char* strncpy(char*, const char*, size_t)’ source argument is the same as destination [-Wrestrict]
253 | strncpy(tmpStr, this->UpperCase(tmpStr), (MAX_STR_LEN-1));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 73%] Building CXX object CMakeFiles/scilexers.dir/scintilla/lexers/LexDataflex.cxx.o
[ 74%] Building CXX object CMakeFiles/scilexers.dir/scintilla/lexers/LexDiff.cxx.o
[ 74%] Building CXX object CMakeFiles/scilexers.dir/scintilla/lexers/LexECL.cxx.o

@magiblot
Copy link
Owner

Hi Pavel, long time no see. I tried to fix this in 0e8d7cf, but right after this issue was posted I pushed commit 469e279 which brings another submodule. That submodule may generate other warnings which are not my responsibility.

Cheers.

@okbob
Copy link
Author

okbob commented Nov 23, 2020 via email

@magiblot
Copy link
Owner

magiblot commented Nov 23, 2020

I suggest you try to customize the default style to your liking.

At the moment, the style is still chosen at compile time. It's defined in src/styles.cc:

static const TCellAttribs styleDefaults[] = {
    /* sNormal           */ {0x07, afFgDefault | afBgDefault    },
    /* sSelection        */ {0x71                               },
    /* sWhitespace       */ {0x05, afBgDefault                  },
    /* sCtrlChar         */ {0x0D, afBgDefault                  },
    /* sLineNums         */ {0x06, afBgDefault                  },
    /* sKeyword1         */ {0x0E, afBgDefault                  },
    /* sKeyword2         */ {0x0A, afBgDefault                  },
    /* sMisc             */ {0x09, afBgDefault                  },
    /* sPreprocessor     */ {0x02, afBgDefault                  },
    /* sOperator         */ {0x0D, afBgDefault                  },
    /* sComment          */ {0x06, afBgDefault                  },
    /* sStringLiteral    */ {0x0C, afBgDefault                  },
    /* sCharLiteral      */ {0x0C, afBgDefault                  },
    /* sNumberLiteral    */ {0x03, afBgDefault                  },
    /* sEscapeSequence   */ {0x0B, afBgDefault                  },
    /* sError            */ {0x30,                              },
};

The colors follow the 8 bit BIOS color attributes format. The highest bit is not "blinking" but "bright background".

The additional flags (afFgDefault, afBgDefault) are defined in <tvision/scrncell.h>. You won't need afFgDefault nor afBgDefault, but you may use afBold, afItalic or afUnderline if you wish.

If you come up with a nice style, I will try to add it into Turbo and make it configurable.

@okbob
Copy link
Author

okbob commented Nov 23, 2020

I'll check it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants