magiblot / turbo

An experimental text editor based on Scintilla and Turbo Vision.
Other
461 stars 35 forks source link

few warnings #7

Open okbob opened 3 years ago

okbob commented 3 years ago

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 commented 3 years ago

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

Cheers.

okbob commented 3 years ago

po 23. 11. 2020 v 19:09 odesílatel magiblot notifications@github.com napsal:

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

yes, it looks like that. I'll close this issue.

I would like to check Turbo editor. Looks nice, but still I use my mcedit :). Postgres project uses 4 spaces tabs in C code, and I need a blue background.

Regards

Pavel

Cheers.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/magiblot/turbo/issues/7#issuecomment-732333575, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEFO42NUMITLQ25EZFOT63SRKQN7ANCNFSM4T7Y6Z4A .

magiblot commented 3 years ago

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 commented 3 years ago

I'll check it