More internal use of const char* strings

This commit is contained in:
Markus Gans 2020-04-24 00:34:26 +02:00
parent 803e54d456
commit 2b1774e578
22 changed files with 405 additions and 387 deletions

View File

@ -12,8 +12,9 @@ The structure of the Qt framework was originally the inspiration for the C++ cla
| *License* | [![license](https://img.shields.io/github/license/gansm/finalcut.svg?colorA=#333)](COPYING) | | *License* | [![license](https://img.shields.io/github/license/gansm/finalcut.svg?colorA=#333)](COPYING) |
| *Class Reference* | [![documented](https://codedocs.xyz/gansm/finalcut.svg)](https://codedocs.xyz/gansm/finalcut/hierarchy.html) | | *Class Reference* | [![documented](https://codedocs.xyz/gansm/finalcut.svg)](https://codedocs.xyz/gansm/finalcut/hierarchy.html) |
| *Travis CI* | [![Build Status](https://travis-ci.org/gansm/finalcut.svg?branch=master)](https://travis-ci.org/gansm/finalcut) | *Travis CI* | [![Build Status](https://travis-ci.org/gansm/finalcut.svg?branch=master)](https://travis-ci.org/gansm/finalcut)
|*Coverity Scan* | [![Coverity Scan Status](https://img.shields.io/coverity/scan/6508.svg)](https://scan.coverity.com/projects/6508 )| | *Coverity Scan* | [![Coverity Scan Status](https://img.shields.io/coverity/scan/6508.svg)](https://scan.coverity.com/projects/6508 )|
| *LGTM* | [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/gansm/finalcut.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/gansm/finalcut/context:cpp) | | *LGTM* | [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/gansm/finalcut.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/gansm/finalcut/context:cpp) |
| *SonarCloud* | [![Quality gate](https://sonarcloud.io/api/project_badges/measure?project=gansm_finalcut&metric=alert_status)](https://sonarcloud.io/dashboard?id=gansm_finalcut) |
| *CodeFactor* | [![CodeFactor](https://www.codefactor.io/repository/github/gansm/finalcut/badge)](https://www.codefactor.io/repository/github/gansm/finalcut) | | *CodeFactor* | [![CodeFactor](https://www.codefactor.io/repository/github/gansm/finalcut/badge)](https://www.codefactor.io/repository/github/gansm/finalcut) |
## Installation ## Installation

View File

@ -7,6 +7,7 @@ Formatting
* A new line should begin after 72 (max. 80) characters * A new line should begin after 72 (max. 80) characters
* Use 2 spaces indent. Do not use tabs! * Use 2 spaces indent. Do not use tabs!
* Leave a space after the keywords if, switch, while, do, for, and return * Leave a space after the keywords if, switch, while, do, for, and return
* Conditions are placed in parentheses with spaces -> if ( a > 5 )
* Use one blank line before and after a for, if, switch, * Use one blank line before and after a for, if, switch,
while, do..while code block while, do..while code block
* In parameter lists, leave a space after each comma * In parameter lists, leave a space after each comma

View File

@ -128,7 +128,7 @@ class Calc final : public finalcut::FDialog
private: private:
// Typedef and Enumeration // Typedef and Enumeration
typedef void (Calc::*keyFunction)(lDouble&); // Method pointer typedef std::function<void(lDouble&)> keyFunction; // Member function
enum button enum button
{ {
@ -172,37 +172,37 @@ class Calc final : public finalcut::FDialog
// Methods // Methods
void drawDispay(); void drawDispay();
void draw() override; void draw() override;
void clear (lDouble&); void clear (const lDouble&);
void zero (lDouble&); void zero (const lDouble&);
void one (lDouble&); void one (const lDouble&);
void two (lDouble&); void two (const lDouble&);
void three (lDouble&); void three (const lDouble&);
void four (lDouble&); void four (const lDouble&);
void five (lDouble&); void five (const lDouble&);
void six (lDouble&); void six (const lDouble&);
void seven (lDouble&); void seven (const lDouble&);
void eight (lDouble&); void eight (const lDouble&);
void nine (lDouble&); void nine (const lDouble&);
void add (lDouble&); void add (const lDouble&);
void subtract (lDouble&); void subtract (const lDouble&);
void multiply (lDouble&); void multiply (const lDouble&);
void divide (lDouble&); void divide (const lDouble&);
void equals (lDouble&); void equals (const lDouble&);
void change_sign (lDouble&); void change_sign (lDouble&);
void radix_point(lDouble&); void radix_point(const lDouble&);
void reciprocal (lDouble&); void reciprocal (lDouble&);
void percent (lDouble&); void percent (lDouble&);
void pi (lDouble&); void pi (lDouble&);
void open_bracket (lDouble&); void open_bracket (const lDouble&);
void close_bracket (lDouble&); void close_bracket (const lDouble&);
void log_e (lDouble&); void log_e (lDouble&);
void power_e (lDouble&); void power_e (lDouble&);
void log_10 (lDouble&); void log_10 (lDouble&);
void power_10 (lDouble&); void power_10 (lDouble&);
void power (lDouble&); void power (const lDouble&);
void square_root (lDouble&); void square_root (lDouble&);
void hyperbolic (lDouble&); void hyperbolic (const lDouble&);
void arcus (lDouble&); void arcus (const lDouble&);
void sine (lDouble&); void sine (lDouble&);
void cosine (lDouble&); void cosine (lDouble&);
void tangent (lDouble&); void tangent (lDouble&);
@ -373,7 +373,7 @@ void Calc::cb_buttonClicked (const finalcut::FWidget*, FDataPtr data)
const Calc::button& key = *(static_cast<Calc::button*>(data)); const Calc::button& key = *(static_cast<Calc::button*>(data));
// Call the key function // Call the key function
(this->*key_map[key])(x); key_map[key](x);
if ( ! input.isEmpty() ) if ( ! input.isEmpty() )
{ {
@ -467,7 +467,7 @@ void Calc::drawDispay()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::clear (lDouble&) void Calc::clear (const lDouble&)
{ {
error = false; error = false;
arcus_mode = false; arcus_mode = false;
@ -481,7 +481,7 @@ void Calc::clear (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::zero (lDouble&) void Calc::zero (const lDouble&)
{ {
if ( input.getLength() >= max_char ) if ( input.getLength() >= max_char )
return; return;
@ -493,7 +493,7 @@ void Calc::zero (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::one (lDouble&) void Calc::one (const lDouble&)
{ {
if ( input.getLength() >= max_char ) if ( input.getLength() >= max_char )
return; return;
@ -505,7 +505,7 @@ void Calc::one (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::two (lDouble&) void Calc::two (const lDouble&)
{ {
if ( input.getLength() >= max_char ) if ( input.getLength() >= max_char )
return; return;
@ -517,7 +517,7 @@ void Calc::two (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::three (lDouble&) void Calc::three (const lDouble&)
{ {
if ( input.getLength() >= max_char ) if ( input.getLength() >= max_char )
return; return;
@ -529,7 +529,7 @@ void Calc::three (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::four (lDouble&) void Calc::four (const lDouble&)
{ {
if ( input.getLength() >= max_char ) if ( input.getLength() >= max_char )
return; return;
@ -541,7 +541,7 @@ void Calc::four (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::five (lDouble&) void Calc::five (const lDouble&)
{ {
if ( input.getLength() >= max_char ) if ( input.getLength() >= max_char )
return; return;
@ -553,7 +553,7 @@ void Calc::five (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::six (lDouble&) void Calc::six (const lDouble&)
{ {
if ( input.getLength() >= max_char ) if ( input.getLength() >= max_char )
return; return;
@ -565,7 +565,7 @@ void Calc::six (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::seven (lDouble&) void Calc::seven (const lDouble&)
{ {
if ( input.getLength() >= max_char ) if ( input.getLength() >= max_char )
return; return;
@ -577,7 +577,7 @@ void Calc::seven (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::eight (lDouble&) void Calc::eight (const lDouble&)
{ {
if ( input.getLength() >= max_char ) if ( input.getLength() >= max_char )
return; return;
@ -589,7 +589,7 @@ void Calc::eight (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::nine (lDouble&) void Calc::nine (const lDouble&)
{ {
if ( input.getLength() >= max_char ) if ( input.getLength() >= max_char )
return; return;
@ -601,7 +601,7 @@ void Calc::nine (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::add (lDouble&) void Calc::add (const lDouble&)
{ {
if ( ! isOperatorKey(last_key) ) if ( ! isOperatorKey(last_key) )
calcInfixOperator(); calcInfixOperator();
@ -611,7 +611,7 @@ void Calc::add (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::subtract (lDouble&) void Calc::subtract (const lDouble&)
{ {
if ( ! isOperatorKey(last_key) ) if ( ! isOperatorKey(last_key) )
calcInfixOperator(); calcInfixOperator();
@ -621,7 +621,7 @@ void Calc::subtract (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::multiply (lDouble&) void Calc::multiply (const lDouble&)
{ {
if ( ! isOperatorKey(last_key) ) if ( ! isOperatorKey(last_key) )
calcInfixOperator(); calcInfixOperator();
@ -631,7 +631,7 @@ void Calc::multiply (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::divide (lDouble&) void Calc::divide (const lDouble&)
{ {
if ( ! isOperatorKey(last_key) ) if ( ! isOperatorKey(last_key) )
calcInfixOperator(); calcInfixOperator();
@ -641,7 +641,7 @@ void Calc::divide (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::equals (lDouble&) void Calc::equals (const lDouble&)
{ {
infix_operator = last_infix_operator; infix_operator = last_infix_operator;
calcInfixOperator(); calcInfixOperator();
@ -656,7 +656,7 @@ void Calc::change_sign (lDouble& x)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::radix_point (lDouble&) void Calc::radix_point (const lDouble&)
{ {
if ( input.getLength() >= max_char ) if ( input.getLength() >= max_char )
return; return;
@ -698,7 +698,7 @@ void Calc::pi (lDouble& x)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::open_bracket (lDouble&) void Calc::open_bracket (const lDouble&)
{ {
const stack_data d{ a, infix_operator }; const stack_data d{ a, infix_operator };
bracket_stack.push(d); bracket_stack.push(d);
@ -709,7 +709,7 @@ void Calc::open_bracket (lDouble&)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::close_bracket (lDouble&) void Calc::close_bracket (const lDouble&)
{ {
if ( bracket_stack.empty() ) if ( bracket_stack.empty() )
return; return;
@ -768,7 +768,7 @@ void Calc::power_10 (lDouble& x)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::power (lDouble& x) void Calc::power (const lDouble& x)
{ {
if ( ! isOperatorKey(last_key) ) if ( ! isOperatorKey(last_key) )
calcInfixOperator(); calcInfixOperator();
@ -789,7 +789,7 @@ void Calc::square_root (lDouble& x)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::hyperbolic (lDouble& x) void Calc::hyperbolic (const lDouble& x)
{ {
hyperbolic_mode = ! hyperbolic_mode; hyperbolic_mode = ! hyperbolic_mode;
calculator_buttons[Hyperbolic]->setChecked(hyperbolic_mode); calculator_buttons[Hyperbolic]->setChecked(hyperbolic_mode);
@ -797,7 +797,7 @@ void Calc::hyperbolic (lDouble& x)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::arcus (lDouble& x) void Calc::arcus (const lDouble& x)
{ {
arcus_mode = ! arcus_mode; arcus_mode = ! arcus_mode;
calculator_buttons[Arcus]->setChecked(arcus_mode); calculator_buttons[Arcus]->setChecked(arcus_mode);
@ -1133,40 +1133,41 @@ const wchar_t* Calc::getButtonText (const std::size_t key)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Calc::mapKeyFunctions() void Calc::mapKeyFunctions()
{ {
key_map[Sine] = &Calc::sine; // sin #define B(f) std::bind((f), this, std::placeholders::_1) // Bind macro
key_map[Cosine] = &Calc::cosine; // cos key_map[Sine] = B(&Calc::sine); // sin
key_map[Tangent] = &Calc::tangent; // tan key_map[Cosine] = B(&Calc::cosine); // cos
key_map[Reciprocal] = &Calc::reciprocal; // 1/x key_map[Tangent] = B(&Calc::tangent); // tan
key_map[On] = &Calc::clear; // On key_map[Reciprocal] = B(&Calc::reciprocal); // 1/x
key_map[Natural_logarithm] = &Calc::log_e; // ln key_map[On] = B(&Calc::clear); // On
key_map[Powers_of_e] = &Calc::power_e; // eˣ key_map[Natural_logarithm] = B(&Calc::log_e); // ln
key_map[Power] = &Calc::power; // yˣ key_map[Powers_of_e] = B(&Calc::power_e); // eˣ
key_map[Square_root] = &Calc::square_root; // sqrt key_map[Power] = B(&Calc::power); // yˣ
key_map[Divide] = &Calc::divide; // ÷ key_map[Square_root] = B(&Calc::square_root); // sqrt
key_map[Common_logarithm] = &Calc::log_10; // lg key_map[Divide] = B(&Calc::divide); // ÷
key_map[Powers_of_ten] = &Calc::power_10; // 10ˣ key_map[Common_logarithm] = B(&Calc::log_10); // lg
key_map[Parenthese_l] = &Calc::open_bracket; // ( key_map[Powers_of_ten] = B(&Calc::power_10); // 10ˣ
key_map[Parenthese_r] = &Calc::close_bracket; // ) key_map[Parenthese_l] = B(&Calc::open_bracket); // (
key_map[Multiply] = &Calc::multiply; // * key_map[Parenthese_r] = B(&Calc::close_bracket); // )
key_map[Hyperbolic] = &Calc::hyperbolic; // hyp key_map[Multiply] = B(&Calc::multiply); // *
key_map[Seven] = &Calc::seven; // 7 key_map[Hyperbolic] = B(&Calc::hyperbolic); // hyp
key_map[Eight] = &Calc::eight; // 8 key_map[Seven] = B(&Calc::seven); // 7
key_map[Nine] = &Calc::nine; // 9 key_map[Eight] = B(&Calc::eight); // 8
key_map[Subtract] = &Calc::subtract; // - key_map[Nine] = B(&Calc::nine); // 9
key_map[Arcus] = &Calc::arcus; // arc key_map[Subtract] = B(&Calc::subtract); // -
key_map[Four] = &Calc::four; // 4 key_map[Arcus] = B(&Calc::arcus); // arc
key_map[Five] = &Calc::five; // 5 key_map[Four] = B(&Calc::four); // 4
key_map[Six] = &Calc::six; // 6 key_map[Five] = B(&Calc::five); // 5
key_map[Add] = &Calc::add; // + key_map[Six] = B(&Calc::six); // 6
key_map[Pi] = &Calc::pi; // π key_map[Add] = B(&Calc::add); // +
key_map[One] = &Calc::one; // 1 key_map[Pi] = B(&Calc::pi); // π
key_map[Two] = &Calc::two; // 2 key_map[One] = B(&Calc::one); // 1
key_map[Three] = &Calc::three; // 3 key_map[Two] = B(&Calc::two); // 2
key_map[Percent] = &Calc::percent; // % key_map[Three] = B(&Calc::three); // 3
key_map[Zero] = &Calc::zero; // 0 key_map[Percent] = B(&Calc::percent); // %
key_map[Decimal_point] = &Calc::radix_point; // . key_map[Zero] = B(&Calc::zero); // 0
key_map[Change_sign] = &Calc::change_sign; // ± key_map[Decimal_point] = B(&Calc::radix_point); // .
key_map[Equals] = &Calc::equals; // = key_map[Change_sign] = B(&Calc::change_sign); // ±
key_map[Equals] = B(&Calc::equals); // =
} }

View File

@ -122,8 +122,9 @@ void streamingIntoFStringExample()
// ...from wide string // ...from wide string
finalcut::FString streamer3; finalcut::FString streamer3;
const wchar_t* wchar_str{const_cast<wchar_t*>(L"wchar_t*")}; const wchar_t wchar_str[] = L"wchar_t*";
streamer3 << wchar_str; const wchar_t* wchar_str_ptr = wchar_str;
streamer3 << wchar_str_ptr;
std::cout << " stream in: " << streamer3 << std::endl; std::cout << " stream in: " << streamer3 << std::endl;
// ...from c++ string // ...from c++ string
@ -133,8 +134,9 @@ void streamingIntoFStringExample()
// ...from c-string // ...from c-string
finalcut::FString streamer5; finalcut::FString streamer5;
const char* char_str{C_STR("char*")}; const char char_str[] = "char*";
streamer5 << char_str; const char* char_str_ptr = char_str;
streamer5 << char_str_ptr;
std::cout << " stream in: " << streamer5 << std::endl; std::cout << " stream in: " << streamer5 << std::endl;
// ...from wide character // ...from wide character

View File

@ -1,7 +1,21 @@
sonar.projectKey=gansm_finalcut sonar.projectKey=gansm_finalcut
sonar.projectName=finalcut sonar.projectName=finalcut
sonar.projectVersion=0.6.1 sonar.projectVersion=0.6.1
sonar.projectDescription=A text-based widget toolkit
#----------------------------------------------------------------------
# Meta-data
#----------------------------------------------------------------------
sonar.links.homepage=https://github.com/gansm/finalcut
sonar.links.ci=https://travis-ci.org/github/gansm/finalcut
sonar.links.scm=https://github.com/gansm/finalcut
sonar.links.issue=https://github.com/gansm/finalcut/issues
#----------------------------------------------------------------------
# Configuration
#----------------------------------------------------------------------
sonar.sources=. sonar.sources=.
sonar.cfamily.build-wrapper-output=bw-output sonar.cfamily.build-wrapper-output=bw-output
sonar.exclusions=src/include/final/fconfig.h sonar.exclusions=src/include/final/fconfig.h
sonar.coverage.exclusions=**/**

View File

@ -101,7 +101,7 @@ void FOptiAttr::setTermEnvironment (const termEnv& term_env)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_enter_bold_mode (char cap[]) void FOptiAttr::set_enter_bold_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -111,7 +111,7 @@ void FOptiAttr::set_enter_bold_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_exit_bold_mode (char cap[]) void FOptiAttr::set_exit_bold_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -121,7 +121,7 @@ void FOptiAttr::set_exit_bold_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_enter_dim_mode (char cap[]) void FOptiAttr::set_enter_dim_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -131,7 +131,7 @@ void FOptiAttr::set_enter_dim_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_exit_dim_mode (char cap[]) void FOptiAttr::set_exit_dim_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -141,7 +141,7 @@ void FOptiAttr::set_exit_dim_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_enter_italics_mode (char cap[]) void FOptiAttr::set_enter_italics_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -151,7 +151,7 @@ void FOptiAttr::set_enter_italics_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_exit_italics_mode (char cap[]) void FOptiAttr::set_exit_italics_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -161,7 +161,7 @@ void FOptiAttr::set_exit_italics_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_enter_underline_mode (char cap[]) void FOptiAttr::set_enter_underline_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -171,7 +171,7 @@ void FOptiAttr::set_enter_underline_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_exit_underline_mode (char cap[]) void FOptiAttr::set_exit_underline_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -181,7 +181,7 @@ void FOptiAttr::set_exit_underline_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_enter_blink_mode (char cap[]) void FOptiAttr::set_enter_blink_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -191,7 +191,7 @@ void FOptiAttr::set_enter_blink_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_exit_blink_mode (char cap[]) void FOptiAttr::set_exit_blink_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -201,7 +201,7 @@ void FOptiAttr::set_exit_blink_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_enter_reverse_mode (char cap[]) void FOptiAttr::set_enter_reverse_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -211,7 +211,7 @@ void FOptiAttr::set_enter_reverse_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_exit_reverse_mode (char cap[]) void FOptiAttr::set_exit_reverse_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -221,7 +221,7 @@ void FOptiAttr::set_exit_reverse_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_enter_secure_mode (char cap[]) void FOptiAttr::set_enter_secure_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -231,7 +231,7 @@ void FOptiAttr::set_enter_secure_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_exit_secure_mode (char cap[]) void FOptiAttr::set_exit_secure_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -241,7 +241,7 @@ void FOptiAttr::set_exit_secure_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_enter_protected_mode (char cap[]) void FOptiAttr::set_enter_protected_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -251,7 +251,7 @@ void FOptiAttr::set_enter_protected_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_exit_protected_mode (char cap[]) void FOptiAttr::set_exit_protected_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -261,7 +261,7 @@ void FOptiAttr::set_exit_protected_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_enter_crossed_out_mode (char cap[]) void FOptiAttr::set_enter_crossed_out_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -271,7 +271,7 @@ void FOptiAttr::set_enter_crossed_out_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_exit_crossed_out_mode (char cap[]) void FOptiAttr::set_exit_crossed_out_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -281,7 +281,7 @@ void FOptiAttr::set_exit_crossed_out_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_enter_dbl_underline_mode (char cap[]) void FOptiAttr::set_enter_dbl_underline_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -291,7 +291,7 @@ void FOptiAttr::set_enter_dbl_underline_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_exit_dbl_underline_mode (char cap[]) void FOptiAttr::set_exit_dbl_underline_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -301,7 +301,7 @@ void FOptiAttr::set_exit_dbl_underline_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_enter_standout_mode (char cap[]) void FOptiAttr::set_enter_standout_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -311,7 +311,7 @@ void FOptiAttr::set_enter_standout_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_exit_standout_mode (char cap[]) void FOptiAttr::set_exit_standout_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -321,7 +321,7 @@ void FOptiAttr::set_exit_standout_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_set_attributes (char cap[]) void FOptiAttr::set_set_attributes (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -331,7 +331,7 @@ void FOptiAttr::set_set_attributes (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_exit_attribute_mode (char cap[]) void FOptiAttr::set_exit_attribute_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -341,7 +341,7 @@ void FOptiAttr::set_exit_attribute_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_enter_alt_charset_mode (char cap[]) void FOptiAttr::set_enter_alt_charset_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -351,7 +351,7 @@ void FOptiAttr::set_enter_alt_charset_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_exit_alt_charset_mode (char cap[]) void FOptiAttr::set_exit_alt_charset_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -361,7 +361,7 @@ void FOptiAttr::set_exit_alt_charset_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_enter_pc_charset_mode (char cap[]) void FOptiAttr::set_enter_pc_charset_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -371,7 +371,7 @@ void FOptiAttr::set_enter_pc_charset_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_exit_pc_charset_mode (char cap[]) void FOptiAttr::set_exit_pc_charset_mode (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -381,7 +381,7 @@ void FOptiAttr::set_exit_pc_charset_mode (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_a_foreground_color (char cap[]) void FOptiAttr::set_a_foreground_color (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -391,7 +391,7 @@ void FOptiAttr::set_a_foreground_color (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_a_background_color (char cap[]) void FOptiAttr::set_a_background_color (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -401,7 +401,7 @@ void FOptiAttr::set_a_background_color (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_foreground_color (char cap[]) void FOptiAttr::set_foreground_color (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -411,7 +411,7 @@ void FOptiAttr::set_foreground_color (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_background_color (char cap[]) void FOptiAttr::set_background_color (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -421,7 +421,7 @@ void FOptiAttr::set_background_color (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_term_color_pair (char cap[]) void FOptiAttr::set_term_color_pair (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -431,7 +431,7 @@ void FOptiAttr::set_term_color_pair (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_orig_pair (char cap[]) void FOptiAttr::set_orig_pair (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -441,7 +441,7 @@ void FOptiAttr::set_orig_pair (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttr::set_orig_orig_colors (char cap[]) void FOptiAttr::set_orig_orig_colors (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -543,7 +543,7 @@ FColor FOptiAttr::vga2ansi (FColor color)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* FOptiAttr::changeAttribute (FChar*& term, FChar*& next) const char* FOptiAttr::changeAttribute (FChar*& term, FChar*& next)
{ {
const bool next_has_color = hasColor(next); const bool next_has_color = hasColor(next);
fake_reverse = false; fake_reverse = false;

View File

@ -110,7 +110,7 @@ void FOptiMove::setTermEnvironment (const termEnv& term_env)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_cursor_home (char cap[]) void FOptiMove::set_cursor_home (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -127,7 +127,7 @@ void FOptiMove::set_cursor_home (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_cursor_to_ll (char cap[]) void FOptiMove::set_cursor_to_ll (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -144,7 +144,7 @@ void FOptiMove::set_cursor_to_ll (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_carriage_return (char cap[]) void FOptiMove::set_carriage_return (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -161,7 +161,7 @@ void FOptiMove::set_carriage_return (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_tabular (char cap[]) void FOptiMove::set_tabular (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -178,7 +178,7 @@ void FOptiMove::set_tabular (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_back_tab (char cap[]) void FOptiMove::set_back_tab (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -195,7 +195,7 @@ void FOptiMove::set_back_tab (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_cursor_up (char cap[]) void FOptiMove::set_cursor_up (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -212,7 +212,7 @@ void FOptiMove::set_cursor_up (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_cursor_down (char cap[]) void FOptiMove::set_cursor_down (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -229,7 +229,7 @@ void FOptiMove::set_cursor_down (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_cursor_left (char cap[]) void FOptiMove::set_cursor_left (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -246,7 +246,7 @@ void FOptiMove::set_cursor_left (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_cursor_right (char cap[]) void FOptiMove::set_cursor_right (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -263,7 +263,7 @@ void FOptiMove::set_cursor_right (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_cursor_address (char cap[]) void FOptiMove::set_cursor_address (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -281,7 +281,7 @@ void FOptiMove::set_cursor_address (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_column_address (char cap[]) void FOptiMove::set_column_address (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -299,7 +299,7 @@ void FOptiMove::set_column_address (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_row_address (char cap[]) void FOptiMove::set_row_address (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -317,7 +317,7 @@ void FOptiMove::set_row_address (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_parm_up_cursor (char cap[]) void FOptiMove::set_parm_up_cursor (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -335,7 +335,7 @@ void FOptiMove::set_parm_up_cursor (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_parm_down_cursor (char cap[]) void FOptiMove::set_parm_down_cursor (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -353,7 +353,7 @@ void FOptiMove::set_parm_down_cursor (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_parm_left_cursor (char cap[]) void FOptiMove::set_parm_left_cursor (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -371,7 +371,7 @@ void FOptiMove::set_parm_left_cursor (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_parm_right_cursor (char cap[]) void FOptiMove::set_parm_right_cursor (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -389,7 +389,7 @@ void FOptiMove::set_parm_right_cursor (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_erase_chars (char cap[]) void FOptiMove::set_erase_chars (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -407,7 +407,7 @@ void FOptiMove::set_erase_chars (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_repeat_char (char cap[]) void FOptiMove::set_repeat_char (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -425,7 +425,7 @@ void FOptiMove::set_repeat_char (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_clr_bol (char cap[]) void FOptiMove::set_clr_bol (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -442,7 +442,7 @@ void FOptiMove::set_clr_bol (char cap[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiMove::set_clr_eol (char cap[]) void FOptiMove::set_clr_eol (const char cap[])
{ {
if ( cap ) if ( cap )
{ {
@ -482,7 +482,7 @@ void FOptiMove::check_boundaries ( int& xold, int& yold
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* FOptiMove::moveCursor (int xold, int yold, int xnew, int ynew) const char* FOptiMove::moveCursor (int xold, int yold, int xnew, int ynew)
{ {
int method{0}; int method{0};
int move_time{LONG_DURATION}; int move_time{LONG_DURATION};

View File

@ -157,13 +157,13 @@ int FTerm::getTTYFileDescriptor()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* FTerm::getTermType() const char* FTerm::getTermType()
{ {
return data->getTermType(); return data->getTermType();
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* FTerm::getTermFileName() const char* FTerm::getTermFileName()
{ {
return data->getTermFileName(); return data->getTermFileName();
} }
@ -829,7 +829,7 @@ int FTerm::closeConsole()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* FTerm::moveCursorString (int xold, int yold, int xnew, int ynew) const char* FTerm::moveCursorString (int xold, int yold, int xnew, int ynew)
{ {
// Returns the cursor move string // Returns the cursor move string
@ -840,11 +840,11 @@ char* FTerm::moveCursorString (int xold, int yold, int xnew, int ynew)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* FTerm::cursorsVisibilityString (bool enable) const char* FTerm::cursorsVisibilityString (bool enable)
{ {
// Hides or shows the input cursor on the terminal // Hides or shows the input cursor on the terminal
char* visibility_str{nullptr}; const char* visibility_str{nullptr};
if ( data->isCursorHidden() == enable ) if ( data->isCursorHidden() == enable )
return nullptr; return nullptr;
@ -1275,7 +1275,7 @@ void FTerm::initScreenSettings()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* FTerm::changeAttribute (FChar*& term_attr, FChar*& next_attr) const char* FTerm::changeAttribute (FChar*& term_attr, FChar*& next_attr)
{ {
return opti_attr->changeAttribute (term_attr, next_attr); return opti_attr->changeAttribute (term_attr, next_attr);
} }
@ -1940,7 +1940,7 @@ void FTerm::setOverwriteCursorStyle()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* FTerm::enableCursorString() const char* FTerm::enableCursorString()
{ {
// Returns the cursor enable string // Returns the cursor enable string
@ -1977,7 +1977,7 @@ char* FTerm::enableCursorString()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* FTerm::disableCursorString() const char* FTerm::disableCursorString()
{ {
// Returns the cursor disable string // Returns the cursor disable string

View File

@ -342,7 +342,7 @@ void FTermDetection::detectTerminal()
{ {
// Terminal detection // Terminal detection
char* new_termtype{nullptr}; const char* new_termtype{nullptr};
if ( terminal_detection ) if ( terminal_detection )
{ {
@ -388,9 +388,9 @@ void FTermDetection::detectTerminal()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* FTermDetection::init_256colorTerminal() const char* FTermDetection::init_256colorTerminal()
{ {
char* new_termtype{nullptr}; const char* new_termtype{nullptr};
if ( get256colorEnvString() ) if ( get256colorEnvString() )
color256 = true; color256 = true;
@ -451,9 +451,9 @@ bool FTermDetection::get256colorEnvString()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* FTermDetection::termtype_256color_quirks() const char* FTermDetection::termtype_256color_quirks()
{ {
char* new_termtype{nullptr}; const char* new_termtype{nullptr};
if ( color_env.string2 if ( color_env.string2
|| (color_env.string1 || (color_env.string1
@ -504,11 +504,11 @@ char* FTermDetection::termtype_256color_quirks()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* FTermDetection::determineMaxColor (char current_termtype[]) const char* FTermDetection::determineMaxColor (const char current_termtype[])
{ {
// Determine xterm maximum number of colors via OSC 4 // Determine xterm maximum number of colors via OSC 4
char* new_termtype = current_termtype; const char* new_termtype = current_termtype;
if ( ! color256 if ( ! color256
&& ! isCygwinTerminal() && ! isCygwinTerminal()
@ -578,9 +578,9 @@ const FString FTermDetection::getXTermColorName (FColor color)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* FTermDetection::parseAnswerbackMsg (char current_termtype[]) const char* FTermDetection::parseAnswerbackMsg (const char current_termtype[])
{ {
char* new_termtype = current_termtype; const char* new_termtype = current_termtype;
// send ENQ and read the answerback message // send ENQ and read the answerback message
try try
@ -646,7 +646,7 @@ const FString FTermDetection::getAnswerbackMsg()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* FTermDetection::parseSecDA (char current_termtype[]) const char* FTermDetection::parseSecDA (const char current_termtype[])
{ {
// The Linux console and older cygwin terminals knows no Sec_DA // The Linux console and older cygwin terminals knows no Sec_DA
if ( isLinuxTerm() || isCygwinTerminal() ) if ( isLinuxTerm() || isCygwinTerminal() )
@ -694,7 +694,7 @@ char* FTermDetection::parseSecDA (char current_termtype[])
// Read the terminal hardware option // Read the terminal hardware option
secondary_da.terminal_id_hardware = str2int(sec_da_components[2]); secondary_da.terminal_id_hardware = str2int(sec_da_components[2]);
char* new_termtype = secDA_Analysis(current_termtype); const char* new_termtype = secDA_Analysis(current_termtype);
#if DEBUG #if DEBUG
if ( new_termtype ) if ( new_termtype )
@ -771,9 +771,9 @@ const FString FTermDetection::getSecDA()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* FTermDetection::secDA_Analysis (char current_termtype[]) const char* FTermDetection::secDA_Analysis (const char current_termtype[])
{ {
char* new_termtype = current_termtype; const char* new_termtype = current_termtype;
switch ( secondary_da.terminal_id_type ) switch ( secondary_da.terminal_id_type )
{ {
@ -847,11 +847,11 @@ char* FTermDetection::secDA_Analysis (char current_termtype[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FTermDetection::secDA_Analysis_0 (char current_termtype[]) inline const char* FTermDetection::secDA_Analysis_0 (const char current_termtype[])
{ {
// Terminal ID 0 - DEC VT100 // Terminal ID 0 - DEC VT100
char* new_termtype = current_termtype; const char* new_termtype = current_termtype;
if ( secondary_da.terminal_id_version == 115 ) if ( secondary_da.terminal_id_version == 115 )
terminal_type.kde_konsole = true; terminal_type.kde_konsole = true;
@ -867,21 +867,21 @@ inline char* FTermDetection::secDA_Analysis_0 (char current_termtype[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FTermDetection::secDA_Analysis_1 (char current_termtype[]) inline const char* FTermDetection::secDA_Analysis_1 (const char current_termtype[])
{ {
// Terminal ID 1 - DEC VT220 // Terminal ID 1 - DEC VT220
char* new_termtype = current_termtype; const char* new_termtype = current_termtype;
new_termtype = secDA_Analysis_vte(new_termtype); new_termtype = secDA_Analysis_vte(new_termtype);
return new_termtype; return new_termtype;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FTermDetection::secDA_Analysis_24 (char current_termtype[]) inline const char* FTermDetection::secDA_Analysis_24 (const char current_termtype[])
{ {
// Terminal ID 24 - DEC VT320 // Terminal ID 24 - DEC VT320
char* new_termtype = current_termtype; const char* new_termtype = current_termtype;
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST) #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST)
@ -904,17 +904,17 @@ inline char* FTermDetection::secDA_Analysis_24 (char current_termtype[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FTermDetection::secDA_Analysis_32 (const char[]) inline const char* FTermDetection::secDA_Analysis_32 (const char[])
{ {
// Terminal ID 32 - Tera Term // Terminal ID 32 - Tera Term
terminal_type.tera_term = true; terminal_type.tera_term = true;
char* new_termtype = C_STR("teraterm"); const char* new_termtype = C_STR("teraterm");
return new_termtype; return new_termtype;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FTermDetection::secDA_Analysis_65 (char current_termtype[]) inline const char* FTermDetection::secDA_Analysis_65 (const char current_termtype[])
{ {
// Terminal ID 65 - DEC VT525 // Terminal ID 65 - DEC VT525
@ -922,34 +922,34 @@ inline char* FTermDetection::secDA_Analysis_65 (char current_termtype[])
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FTermDetection::secDA_Analysis_67 (const char[]) inline const char* FTermDetection::secDA_Analysis_67 (const char[])
{ {
// Terminal ID 67 - cygwin // Terminal ID 67 - cygwin
terminal_type.cygwin = true; terminal_type.cygwin = true;
char* new_termtype = C_STR("cygwin"); const char* new_termtype = C_STR("cygwin");
std::fflush(stdout); std::fflush(stdout);
return new_termtype; return new_termtype;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FTermDetection::secDA_Analysis_77 (const char[]) inline const char* FTermDetection::secDA_Analysis_77 (const char[])
{ {
// Terminal ID 77 - mintty // Terminal ID 77 - mintty
terminal_type.mintty = true; terminal_type.mintty = true;
decscusr_support = true; decscusr_support = true;
char* new_termtype = C_STR("xterm-256color"); const char* new_termtype = C_STR("xterm-256color");
std::fflush(stdout); std::fflush(stdout);
return new_termtype; return new_termtype;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FTermDetection::secDA_Analysis_82() inline const char* FTermDetection::secDA_Analysis_82()
{ {
// Terminal ID 82 - rxvt // Terminal ID 82 - rxvt
char* new_termtype{}; const char* new_termtype{};
terminal_type.rxvt = true; terminal_type.rxvt = true;
if ( std::strncmp(termtype, "rxvt-cygwin-native", 18) == 0 ) if ( std::strncmp(termtype, "rxvt-cygwin-native", 18) == 0 )
@ -961,32 +961,32 @@ inline char* FTermDetection::secDA_Analysis_82()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FTermDetection::secDA_Analysis_83 (char current_termtype[]) inline const char* FTermDetection::secDA_Analysis_83 (const char current_termtype[])
{ {
// Terminal ID 83 - screen // Terminal ID 83 - screen
char* new_termtype = current_termtype; const char* new_termtype = current_termtype;
terminal_type.screen = true; terminal_type.screen = true;
return new_termtype; return new_termtype;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FTermDetection::secDA_Analysis_84 (char current_termtype[]) inline const char* FTermDetection::secDA_Analysis_84 (const char current_termtype[])
{ {
// Terminal ID 84 - tmux // Terminal ID 84 - tmux
char* new_termtype = current_termtype; const char* new_termtype = current_termtype;
terminal_type.screen = true; terminal_type.screen = true;
terminal_type.tmux = true; terminal_type.tmux = true;
return new_termtype; return new_termtype;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FTermDetection::secDA_Analysis_85() inline const char* FTermDetection::secDA_Analysis_85()
{ {
// Terminal ID 85 - rxvt-unicode // Terminal ID 85 - rxvt-unicode
char* new_termtype{}; const char* new_termtype{};
terminal_type.rxvt = true; terminal_type.rxvt = true;
terminal_type.urxvt = true; terminal_type.urxvt = true;
@ -1004,12 +1004,12 @@ inline char* FTermDetection::secDA_Analysis_85()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FTermDetection::secDA_Analysis_vte (char current_termtype[]) inline const char* FTermDetection::secDA_Analysis_vte (const char current_termtype[])
{ {
// VTE terminal library // VTE terminal library
// (Since VTE ) the terminal ID has changed from 1 to 65) // (Since VTE ) the terminal ID has changed from 1 to 65)
char* new_termtype = current_termtype; const char* new_termtype = current_termtype;
if ( secondary_da.terminal_id_version > 1000 ) if ( secondary_da.terminal_id_version > 1000 )
{ {

View File

@ -94,7 +94,7 @@ void FTermios::storeTTYsettings()
{ {
term_init = getTTY(); term_init = getTTY();
} }
catch (...) catch (const std::system_error&)
{ {
throw std::current_exception(); throw std::current_exception();
} }

View File

@ -238,8 +238,7 @@ std::vector<bool>& FWidget::doubleFlatLine_ref (fc::sides side)
return double_flatline_mask.left; return double_flatline_mask.left;
} }
static std::vector<bool> empty; return double_flatline_mask.top;
return empty;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -30,7 +30,7 @@
#include <final/ftypes.h> #include <final/ftypes.h>
// Typecast to c-string // Typecast to c-string
#define C_STR const_cast<char*> #define C_STR const_cast<const char*>
// ASCII sequences // ASCII sequences
#define ESC "\033" // Escape #define ESC "\033" // Escape

View File

@ -36,7 +36,7 @@
#endif #endif
// Typecast to c-string // Typecast to c-string
#define C_STR const_cast<char*> #define C_STR const_cast<const char*>
#include <assert.h> #include <assert.h>
@ -74,41 +74,41 @@ class FOptiAttr final
// Typedef // Typedef
typedef struct typedef struct
{ {
char* t_enter_bold_mode; const char* t_enter_bold_mode;
char* t_exit_bold_mode; const char* t_exit_bold_mode;
char* t_enter_dim_mode; const char* t_enter_dim_mode;
char* t_exit_dim_mode; const char* t_exit_dim_mode;
char* t_enter_italics_mode; const char* t_enter_italics_mode;
char* t_exit_italics_mode; const char* t_exit_italics_mode;
char* t_enter_underline_mode; const char* t_enter_underline_mode;
char* t_exit_underline_mode; const char* t_exit_underline_mode;
char* t_enter_blink_mode; const char* t_enter_blink_mode;
char* t_exit_blink_mode; const char* t_exit_blink_mode;
char* t_enter_reverse_mode; const char* t_enter_reverse_mode;
char* t_exit_reverse_mode; const char* t_exit_reverse_mode;
char* t_enter_standout_mode; const char* t_enter_standout_mode;
char* t_exit_standout_mode; const char* t_exit_standout_mode;
char* t_enter_secure_mode; const char* t_enter_secure_mode;
char* t_exit_secure_mode; const char* t_exit_secure_mode;
char* t_enter_protected_mode; const char* t_enter_protected_mode;
char* t_exit_protected_mode; const char* t_exit_protected_mode;
char* t_enter_crossed_out_mode; const char* t_enter_crossed_out_mode;
char* t_exit_crossed_out_mode; const char* t_exit_crossed_out_mode;
char* t_enter_dbl_underline_mode; const char* t_enter_dbl_underline_mode;
char* t_exit_dbl_underline_mode; const char* t_exit_dbl_underline_mode;
char* t_set_attributes; const char* t_set_attributes;
char* t_exit_attribute_mode; const char* t_exit_attribute_mode;
char* t_enter_alt_charset_mode; const char* t_enter_alt_charset_mode;
char* t_exit_alt_charset_mode; const char* t_exit_alt_charset_mode;
char* t_enter_pc_charset_mode; const char* t_enter_pc_charset_mode;
char* t_exit_pc_charset_mode; const char* t_exit_pc_charset_mode;
char* t_set_a_foreground; const char* t_set_a_foreground;
char* t_set_a_background; const char* t_set_a_background;
char* t_set_foreground; const char* t_set_foreground;
char* t_set_background; const char* t_set_background;
char* t_set_color_pair; const char* t_set_color_pair;
char* t_orig_pair; const char* t_orig_pair;
char* t_orig_colors; const char* t_orig_colors;
int max_color; int max_color;
int attr_without_color; int attr_without_color;
bool ansi_default_color; bool ansi_default_color;
@ -135,41 +135,41 @@ class FOptiAttr final
void setNoColorVideo (int); void setNoColorVideo (int);
void setDefaultColorSupport(); void setDefaultColorSupport();
void unsetDefaultColorSupport(); void unsetDefaultColorSupport();
void set_enter_bold_mode (char[]); void set_enter_bold_mode (const char[]);
void set_exit_bold_mode (char[]); void set_exit_bold_mode (const char[]);
void set_enter_dim_mode (char[]); void set_enter_dim_mode (const char[]);
void set_exit_dim_mode (char[]); void set_exit_dim_mode (const char[]);
void set_enter_italics_mode (char[]); void set_enter_italics_mode (const char[]);
void set_exit_italics_mode (char[]); void set_exit_italics_mode (const char[]);
void set_enter_underline_mode (char[]); void set_enter_underline_mode (const char[]);
void set_exit_underline_mode (char[]); void set_exit_underline_mode (const char[]);
void set_enter_blink_mode (char[]); void set_enter_blink_mode (const char[]);
void set_exit_blink_mode (char[]); void set_exit_blink_mode (const char[]);
void set_enter_reverse_mode (char[]); void set_enter_reverse_mode (const char[]);
void set_exit_reverse_mode (char[]); void set_exit_reverse_mode (const char[]);
void set_enter_secure_mode (char[]); void set_enter_secure_mode (const char[]);
void set_exit_secure_mode (char[]); void set_exit_secure_mode (const char[]);
void set_enter_protected_mode (char[]); void set_enter_protected_mode (const char[]);
void set_exit_protected_mode (char[]); void set_exit_protected_mode (const char[]);
void set_enter_crossed_out_mode (char[]); void set_enter_crossed_out_mode (const char[]);
void set_exit_crossed_out_mode (char[]); void set_exit_crossed_out_mode (const char[]);
void set_enter_dbl_underline_mode (char[]); void set_enter_dbl_underline_mode (const char[]);
void set_exit_dbl_underline_mode (char[]); void set_exit_dbl_underline_mode (const char[]);
void set_enter_standout_mode (char[]); void set_enter_standout_mode (const char[]);
void set_exit_standout_mode (char[]); void set_exit_standout_mode (const char[]);
void set_set_attributes (char[]); void set_set_attributes (const char[]);
void set_exit_attribute_mode (char[]); void set_exit_attribute_mode (const char[]);
void set_enter_alt_charset_mode (char[]); void set_enter_alt_charset_mode (const char[]);
void set_exit_alt_charset_mode (char[]); void set_exit_alt_charset_mode (const char[]);
void set_enter_pc_charset_mode (char[]); void set_enter_pc_charset_mode (const char[]);
void set_exit_pc_charset_mode (char[]); void set_exit_pc_charset_mode (const char[]);
void set_a_foreground_color (char[]); void set_a_foreground_color (const char[]);
void set_a_background_color (char[]); void set_a_background_color (const char[]);
void set_foreground_color (char[]); void set_foreground_color (const char[]);
void set_background_color (char[]); void set_background_color (const char[]);
void set_term_color_pair (char[]); void set_term_color_pair (const char[]);
void set_orig_pair (char[]); void set_orig_pair (const char[]);
void set_orig_orig_colors (char[]); void set_orig_orig_colors (const char[]);
// Inquiry // Inquiry
static bool isNormal (const FChar* const&); static bool isNormal (const FChar* const&);
@ -177,7 +177,7 @@ class FOptiAttr final
// Methods // Methods
void initialize(); void initialize();
static FColor vga2ansi (FColor); static FColor vga2ansi (FColor);
char* changeAttribute (FChar*&, FChar*&); const char* changeAttribute (FChar*&, FChar*&);
private: private:
// Typedefs and Enumerations // Typedefs and Enumerations
@ -185,7 +185,7 @@ class FOptiAttr final
typedef struct typedef struct
{ {
char* cap; const char* cap;
bool caused_reset; bool caused_reset;
} capability; } capability;

View File

@ -77,26 +77,26 @@ class FOptiMove final
// Typedef // Typedef
typedef struct typedef struct
{ {
char* t_cursor_home; const char* t_cursor_home;
char* t_carriage_return; const char* t_carriage_return;
char* t_cursor_to_ll; const char* t_cursor_to_ll;
char* t_tab; const char* t_tab;
char* t_back_tab; const char* t_back_tab;
char* t_cursor_up; const char* t_cursor_up;
char* t_cursor_down; const char* t_cursor_down;
char* t_cursor_left; const char* t_cursor_left;
char* t_cursor_right; const char* t_cursor_right;
char* t_cursor_address; const char* t_cursor_address;
char* t_column_address; const char* t_column_address;
char* t_row_address; const char* t_row_address;
char* t_parm_up_cursor; const char* t_parm_up_cursor;
char* t_parm_down_cursor; const char* t_parm_down_cursor;
char* t_parm_left_cursor; const char* t_parm_left_cursor;
char* t_parm_right_cursor; const char* t_parm_right_cursor;
char* t_erase_chars; const char* t_erase_chars;
char* t_repeat_char; const char* t_repeat_char;
char* t_clr_bol; const char* t_clr_bol;
char* t_clr_eol; const char* t_clr_eol;
int tabstop; int tabstop;
bool automatic_left_margin; bool automatic_left_margin;
bool eat_nl_glitch; bool eat_nl_glitch;
@ -136,32 +136,32 @@ class FOptiMove final
void setTabStop (int); void setTabStop (int);
void setTermSize (std::size_t, std::size_t); void setTermSize (std::size_t, std::size_t);
void setTermEnvironment (const termEnv&); void setTermEnvironment (const termEnv&);
void set_cursor_home (char[]); void set_cursor_home (const char[]);
void set_cursor_to_ll (char[]); void set_cursor_to_ll (const char[]);
void set_carriage_return (char[]); void set_carriage_return (const char[]);
void set_tabular (char[]); void set_tabular (const char[]);
void set_back_tab (char[]); void set_back_tab (const char[]);
void set_cursor_up (char[]); void set_cursor_up (const char[]);
void set_cursor_down (char[]); void set_cursor_down (const char[]);
void set_cursor_left (char[]); void set_cursor_left (const char[]);
void set_cursor_right (char[]); void set_cursor_right (const char[]);
void set_cursor_address (char[]); void set_cursor_address (const char[]);
void set_column_address (char[]); void set_column_address (const char[]);
void set_row_address (char[]); void set_row_address (const char[]);
void set_parm_up_cursor (char[]); void set_parm_up_cursor (const char[]);
void set_parm_down_cursor (char[]); void set_parm_down_cursor (const char[]);
void set_parm_left_cursor (char[]); void set_parm_left_cursor (const char[]);
void set_parm_right_cursor (char[]); void set_parm_right_cursor (const char[]);
void set_erase_chars (char[]); void set_erase_chars (const char[]);
void set_repeat_char (char[]); void set_repeat_char (const char[]);
void set_clr_bol (char[]); void set_clr_bol (const char[]);
void set_clr_eol (char[]); void set_clr_eol (const char[]);
void set_auto_left_margin (bool); void set_auto_left_margin (bool);
void set_eat_newline_glitch (bool); void set_eat_newline_glitch (bool);
// Methods // Methods
void check_boundaries (int&, int&, int&, int&); void check_boundaries (int&, int&, int&, int&);
char* moveCursor (int, int, int, int); const char* moveCursor (int, int, int, int);
private: private:
// Constant // Constant
@ -170,7 +170,7 @@ class FOptiMove final
// Typedef // Typedef
typedef struct typedef struct
{ {
char* cap; const char* cap;
int duration; int duration;
int length; int length;
} capability; } capability;

View File

@ -178,8 +178,8 @@ class FTerm final
static std::size_t getColumnNumber(); static std::size_t getColumnNumber();
static const FString getKeyName (FKey); static const FString getKeyName (FKey);
static int getTTYFileDescriptor(); static int getTTYFileDescriptor();
static char* getTermType(); static const char* getTermType();
static char* getTermFileName(); static const char* getTermFileName();
static int getTabstop(); static int getTabstop();
static int getMaxColor(); static int getMaxColor();
charSubstitution& getCharSubstitutionMap(); charSubstitution& getCharSubstitutionMap();
@ -259,8 +259,8 @@ class FTerm final
static bool setOldFont(); static bool setOldFont();
static int openConsole(); static int openConsole();
static int closeConsole(); static int closeConsole();
static char* moveCursorString (int, int, int, int); static const char* moveCursorString (int, int, int, int);
static char* cursorsVisibilityString (bool); static const char* cursorsVisibilityString (bool);
static void detectTermSize(); static void detectTermSize();
static void setTermSize (const FSize&); static void setTermSize (const FSize&);
static void setTermTitle (const FString&); static void setTermTitle (const FString&);
@ -290,7 +290,7 @@ class FTerm final
static int putchar_UTF8 (int); static int putchar_UTF8 (int);
static void initScreenSettings(); static void initScreenSettings();
static char* changeAttribute (FChar*&, FChar*&); static const char* changeAttribute (FChar*&, FChar*&);
static void changeTermSizeFinished(); static void changeTermSizeFinished();
static void exitWithMessage (const FString&) static void exitWithMessage (const FString&)
#if defined(__clang__) || defined(__GNUC__) #if defined(__clang__) || defined(__GNUC__)
@ -329,8 +329,8 @@ class FTerm final
static void restoreColorPalette(); static void restoreColorPalette();
static void setInsertCursorStyle(); static void setInsertCursorStyle();
static void setOverwriteCursorStyle(); static void setOverwriteCursorStyle();
static char* enableCursorString(); static const char* enableCursorString();
static char* disableCursorString(); static const char* disableCursorString();
static void enableMouse(); static void enableMouse();
static void disableMouse(); static void disableMouse();
static void enableApplicationEscKey(); static void enableApplicationEscKey();

View File

@ -78,7 +78,7 @@ class FTermcap final
// Typedef // Typedef
typedef struct typedef struct
{ {
char* string; const char* string;
char tname[alignof(char*)]; char tname[alignof(char*)];
} }
tcap_map; tcap_map;

View File

@ -78,8 +78,8 @@ class FTermData final
FRect& getTermGeometry(); FRect& getTermGeometry();
int getTTYFileDescriptor() const; int getTTYFileDescriptor() const;
uInt getBaudrate() const; uInt getBaudrate() const;
char* getTermType(); const char* getTermType();
char* getTermFileName(); const char* getTermFileName();
const FString& getXtermFont() const; const FString& getXtermFont() const;
const FString& getXtermTitle() const; const FString& getXtermTitle() const;
const FString& getExitMessage() const; const FString& getExitMessage() const;
@ -191,11 +191,11 @@ inline uInt FTermData::getBaudrate() const
{ return baudrate; } { return baudrate; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FTermData::getTermType() inline const char* FTermData::getTermType()
{ return termtype; } { return termtype; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FTermData::getTermFileName() inline const char* FTermData::getTermFileName()
{ return termfilename; } { return termfilename; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -92,7 +92,7 @@ class FTermDetection final
// Accessor // Accessor
const FString getClassName() const; const FString getClassName() const;
static char* getTermType(); static const char* getTermType();
static int getGnomeTerminalID(); static int getGnomeTerminalID();
FTerminalType& getTermTypeStruct(); FTerminalType& getTermTypeStruct();
@ -167,29 +167,29 @@ class FTermDetection final
#endif #endif
static void termtypeAnalysis(); static void termtypeAnalysis();
static void detectTerminal(); static void detectTerminal();
static char* init_256colorTerminal(); static const char* init_256colorTerminal();
static bool get256colorEnvString(); static bool get256colorEnvString();
static char* termtype_256color_quirks(); static const char* termtype_256color_quirks();
static char* determineMaxColor (char[]); static const char* determineMaxColor (const char[]);
static const FString getXTermColorName (FColor); static const FString getXTermColorName (FColor);
static char* parseAnswerbackMsg (char[]); static const char* parseAnswerbackMsg (const char[]);
static const FString getAnswerbackMsg(); static const FString getAnswerbackMsg();
static char* parseSecDA (char[]); static const char* parseSecDA (const char[]);
static int str2int (const FString&); static int str2int (const FString&);
static const FString getSecDA(); static const FString getSecDA();
static char* secDA_Analysis (char[]); static const char* secDA_Analysis (const char[]);
static char* secDA_Analysis_0 (char[]); static const char* secDA_Analysis_0 (const char[]);
static char* secDA_Analysis_1 (char[]); static const char* secDA_Analysis_1 (const char[]);
static char* secDA_Analysis_24 (char[]); static const char* secDA_Analysis_24 (const char[]);
static char* secDA_Analysis_32 (const char[]); static const char* secDA_Analysis_32 (const char[]);
static char* secDA_Analysis_65 (char[]); static const char* secDA_Analysis_65 (const char[]);
static char* secDA_Analysis_67 (const char[]); static const char* secDA_Analysis_67 (const char[]);
static char* secDA_Analysis_77 (const char[]); static const char* secDA_Analysis_77 (const char[]);
static char* secDA_Analysis_82 (); static const char* secDA_Analysis_82 ();
static char* secDA_Analysis_83 (char[]); static const char* secDA_Analysis_83 (const char[]);
static char* secDA_Analysis_84 (char[]); static const char* secDA_Analysis_84 (const char[]);
static char* secDA_Analysis_85 (); static const char* secDA_Analysis_85 ();
static char* secDA_Analysis_vte (char[]); static const char* secDA_Analysis_vte (const char[]);
// Data members // Data members
#if DEBUG #if DEBUG
@ -244,7 +244,7 @@ inline const FString FTermDetection::getClassName() const
{ return "FTermDetection"; } { return "FTermDetection"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FTermDetection::getTermType() inline const char* FTermDetection::getTermType()
{ return termtype; } { return termtype; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -99,7 +99,7 @@ inline bool isNegative (const T& x)
template <typename T> template <typename T>
struct getPrecision struct getPrecision
{ {
operator int () constexpr operator int () const
{ {
return std::numeric_limits<T>::digits10; return std::numeric_limits<T>::digits10;
} }
@ -158,7 +158,7 @@ namespace fc
typedef struct typedef struct
{ {
FKey num; FKey num;
char* string; const char* string;
char tname[4]; char tname[4];
} }
FKeyMap; FKeyMap;

View File

@ -153,8 +153,8 @@ class FVTerm
static fc::encoding getEncoding(); static fc::encoding getEncoding();
static std::string getEncodingString(); static std::string getEncodingString();
static const FString getKeyName (FKey); static const FString getKeyName (FKey);
static char* getTermType(); static const char* getTermType();
static char* getTermFileName(); static const char* getTermFileName();
FTerm& getFTerm(); FTerm& getFTerm();
// Mutators // Mutators
@ -699,11 +699,11 @@ inline const FString FVTerm::getKeyName (FKey keynum)
{ return FTerm::getKeyName(keynum); } { return FTerm::getKeyName(keynum); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FVTerm::getTermType() inline const char* FVTerm::getTermType()
{ return FTerm::getTermType(); } { return FTerm::getTermType(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* FVTerm::getTermFileName() inline const char* FVTerm::getTermFileName()
{ return FTerm::getTermFileName(); } { return FTerm::getTermFileName(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2019 Markus Gans * * Copyright 2019-2020 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -114,12 +114,12 @@ class ConEmu
private: private:
// Accessors // Accessors
char* getAnswerback (console); const char* getAnswerback (console);
char* getDSR (console); const char* getDSR (console);
char* getDECID (console); const char* getDECID (console);
char* getDA (console); const char* getDA (console);
char* getDA1 (console); const char* getDA1 (console);
char* getSEC_DA (console); const char* getSEC_DA (console);
// Methods // Methods
bool openMasterPTY(); bool openMasterPTY();
@ -137,7 +137,7 @@ class ConEmu
bool debug{false}; bool debug{false};
char buffer[2048]{}; char buffer[2048]{};
static bool* shared_state; static bool* shared_state;
static char* colorname[]; static const char* colorname[];
}; };
// static class attributes // static class attributes
@ -146,7 +146,7 @@ bool* ConEmu::shared_state = nullptr;
// private data member of ConEmu // private data member of ConEmu
//---------------------------------------------------------------------- //----------------------------------------------------------------------
char* ConEmu::colorname[] = const char* ConEmu::colorname[] =
{ {
C_STR("0000/0000/0000"), // 0 C_STR("0000/0000/0000"), // 0
C_STR("bbbb/0000/0000"), // 1 C_STR("bbbb/0000/0000"), // 1
@ -616,9 +616,9 @@ inline void ConEmu::startConEmuTerminal (console con)
// private methods of ConEmu // private methods of ConEmu
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* ConEmu::getAnswerback (console con) inline const char* ConEmu::getAnswerback (console con)
{ {
static char* Answerback[] = static const char* Answerback[] =
{ {
0, // Ansi, 0, // Ansi,
0, // XTerm 0, // XTerm
@ -646,9 +646,9 @@ inline char* ConEmu::getAnswerback (console con)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* ConEmu::getDSR (console con) inline const char* ConEmu::getDSR (console con)
{ {
static char* DSR[] = static const char* DSR[] =
{ {
0, // Ansi, 0, // Ansi,
C_STR("\033[0n"), // XTerm C_STR("\033[0n"), // XTerm
@ -676,9 +676,9 @@ inline char* ConEmu::getDSR (console con)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* ConEmu::getDECID (console con) inline const char* ConEmu::getDECID (console con)
{ {
static char* DECID[] = static const char* DECID[] =
{ {
0, // Ansi, 0, // Ansi,
C_STR("\033[?63;1;2;6;4;6;9;15;22c"), // XTerm C_STR("\033[?63;1;2;6;4;6;9;15;22c"), // XTerm
@ -706,9 +706,9 @@ inline char* ConEmu::getDECID (console con)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* ConEmu::getDA (console con) inline const char* ConEmu::getDA (console con)
{ {
static char* DA[] = static const char* DA[] =
{ {
0, // Ansi, 0, // Ansi,
C_STR("\033[?63;1;2;6;4;6;9;15;22c"), // XTerm C_STR("\033[?63;1;2;6;4;6;9;15;22c"), // XTerm
@ -736,9 +736,9 @@ inline char* ConEmu::getDA (console con)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* ConEmu::getDA1 (console con) inline const char* ConEmu::getDA1 (console con)
{ {
static char* DA1[] = static const char* DA1[] =
{ {
0, // Ansi, 0, // Ansi,
0, // XTerm 0, // XTerm
@ -766,9 +766,9 @@ inline char* ConEmu::getDA1 (console con)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline char* ConEmu::getSEC_DA (console con) inline const char* ConEmu::getSEC_DA (console con)
{ {
static char* SEC_DA[] = static const char* SEC_DA[] =
{ {
0, // Ansi, 0, // Ansi,
C_STR("\033[>19;312;0c"), // XTerm C_STR("\033[>19;312;0c"), // XTerm
@ -868,7 +868,7 @@ inline void ConEmu::parseTerminalBuffer (std::size_t length, console con)
{ {
if ( buffer[i] == ENQ[0] ) // Enquiry character if ( buffer[i] == ENQ[0] ) // Enquiry character
{ {
char* answer = getAnswerback(con); const char* answer = getAnswerback(con);
if ( answer ) if ( answer )
write(fd_master, answer, std::strlen(answer)); write(fd_master, answer, std::strlen(answer));
@ -877,7 +877,7 @@ inline void ConEmu::parseTerminalBuffer (std::size_t length, console con)
&& buffer[i] == '\033' && buffer[i] == '\033'
&& buffer[i + 1] == 'Z' ) && buffer[i + 1] == 'Z' )
{ {
char* DECID = getDECID(con); const char* DECID = getDECID(con);
if ( DECID ) if ( DECID )
write (fd_master, DECID, std::strlen(DECID)); write (fd_master, DECID, std::strlen(DECID));
@ -890,7 +890,7 @@ inline void ConEmu::parseTerminalBuffer (std::size_t length, console con)
&& buffer[i + 2] == '5' && buffer[i + 2] == '5'
&& buffer[i + 3] == 'n' ) && buffer[i + 3] == 'n' )
{ {
char* DSR = getDSR(con); const char* DSR = getDSR(con);
if ( DSR ) if ( DSR )
write (fd_master, DSR, std::strlen(DSR)); write (fd_master, DSR, std::strlen(DSR));
@ -911,7 +911,7 @@ inline void ConEmu::parseTerminalBuffer (std::size_t length, console con)
&& buffer[i + 1] == '[' && buffer[i + 1] == '['
&& buffer[i + 2] == 'c' ) && buffer[i + 2] == 'c' )
{ {
char* DA = getDA(con); const char* DA = getDA(con);
if ( DA ) if ( DA )
write (fd_master, DA, std::strlen(DA)); write (fd_master, DA, std::strlen(DA));
@ -924,7 +924,7 @@ inline void ConEmu::parseTerminalBuffer (std::size_t length, console con)
&& buffer[i + 2] == '1' && buffer[i + 2] == '1'
&& buffer[i + 3] == 'c' ) && buffer[i + 3] == 'c' )
{ {
char* DA1 = getDA1(con); const char* DA1 = getDA1(con);
if ( DA1 ) if ( DA1 )
write (fd_master, DA1, std::strlen(DA1)); write (fd_master, DA1, std::strlen(DA1));
@ -936,7 +936,7 @@ inline void ConEmu::parseTerminalBuffer (std::size_t length, console con)
&& buffer[i + 2] == '>' && buffer[i + 2] == '>'
&& buffer[i + 3] == 'c' ) && buffer[i + 3] == 'c' )
{ {
char* SEC_DA = getSEC_DA(con); const char* SEC_DA = getSEC_DA(con);
if ( SEC_DA ) if ( SEC_DA )
write (fd_master, SEC_DA, std::strlen(SEC_DA)); write (fd_master, SEC_DA, std::strlen(SEC_DA));

View File

@ -37,7 +37,7 @@ namespace test
typedef struct typedef struct
{ {
int num; int num;
char* string; const char* string;
char tname[4]; char tname[4];
} }
FKeyMap; FKeyMap;