diff --git a/src/apps/terminal/Coding.cpp b/src/apps/terminal/Coding.cpp index 8b8fdb2641..49a4cffb13 100644 --- a/src/apps/terminal/Coding.cpp +++ b/src/apps/terminal/Coding.cpp @@ -5,7 +5,7 @@ struct etable { const char *name; // long name for menu item. const char *shortname; // short name (use for command-line etc.) const char shortcut; // short cut key code - const uint32 id; // encoding id + const int32 id; // encoding id }; @@ -32,7 +32,7 @@ const static etable kEncodingTable[] = {"EUC-kr", "EUCK", 'K', B_EUC_KR_CONVERSION}, - /* Not Implement. + /* Not Implemented. {"EUC-tw", "EUCT", "T", M_EUC_TW}, {"Big5", "Big5", 'B', M_BIG5}, {"ISO-2022-cn", "ISOC", 'C', M_ISO_2022_CN}, @@ -102,6 +102,8 @@ id2longname(int id) return p->name; p++; } + + return kEncodingTable[0].name; } @@ -114,5 +116,6 @@ id2shortcut(int id) return p->shortcut; p++; } + return kEncodingTable[0].shortcut; } diff --git a/src/apps/terminal/Coding.h b/src/apps/terminal/Coding.h index 70f78d8cb9..3c228778d3 100644 --- a/src/apps/terminal/Coding.h +++ b/src/apps/terminal/Coding.h @@ -35,7 +35,7 @@ #include #include -#define M_UTF8 (uint32)(-1) +#define M_UTF8 (-1) status_t get_nth_encoding(int i, int *id); diff --git a/src/apps/terminal/TermBuffer.cpp b/src/apps/terminal/TermBuffer.cpp index 36fb671bc1..5a60e5ea8b 100644 --- a/src/apps/terminal/TermBuffer.cpp +++ b/src/apps/terminal/TermBuffer.cpp @@ -73,18 +73,19 @@ but it font is full width font on preference panel. ************************************************************************/ +#include "TermBuffer.h" + +#include "CurPos.h" +#include "PrefHandler.h" +#include "TermConst.h" + #include #include #include -#include +#include #include -#include -#include "TermBuffer.h" -#include "TermConst.h" -#include "CurPos.h" -#include "PrefHandler.h" #define ARRAY_SIZE 512 #define ROW(x) (((x) + fRowOffset) % fBufferSize) @@ -223,12 +224,10 @@ TermBuffer::GetString(int row, int col, int num, uchar *buf, void TermBuffer::WriteChar(const CurPos &pos, const uchar *u, ushort attr) { - term_buffer *ptr; - const int row = pos.y; const int col = pos.x; - ptr = (fBuffer[ROW(row)] + col); + term_buffer *ptr = (fBuffer[ROW(row)] + col); memcpy ((char *)ptr->code, u, 4); if (IS_WIDTH(attr)) diff --git a/src/apps/terminal/TermBuffer.h b/src/apps/terminal/TermBuffer.h index a63e020d4b..3944452f3a 100644 --- a/src/apps/terminal/TermBuffer.h +++ b/src/apps/terminal/TermBuffer.h @@ -35,9 +35,6 @@ #include "CurPos.h" -#define MIN_COLS 10 -#define MAX_COLS 256 - struct term_buffer { diff --git a/src/apps/terminal/TermConst.h b/src/apps/terminal/TermConst.h index 11bef3c249..357785c19f 100644 --- a/src/apps/terminal/TermConst.h +++ b/src/apps/terminal/TermConst.h @@ -140,6 +140,9 @@ enum{ SCRDOWN }; +#define MIN_COLS 10 +#define MAX_COLS 256 + // Insert mode flag #define MODE_OVER 0 #define MODE_INSERT 1 diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp index ba82130a90..b000ce9719 100644 --- a/src/apps/terminal/TermWindow.cpp +++ b/src/apps/terminal/TermWindow.cpp @@ -6,6 +6,19 @@ * * Distributed unter the terms of the MIT license. */ + +#include "TermWindow.h" + +#include "Coding.h" +#include "ColorWindow.h" +#include "MenuUtil.h" +#include "FindWindow.h" +#include "PrefWindow.h" +#include "PrefView.h" +#include "PrefHandler.h" +#include "TermConst.h" +#include "TermView.h" + #include #include #include @@ -22,23 +35,8 @@ #include #include -#include -#include -#include - -#include "Coding.h" -#include "ColorWindow.h" -#include "MenuUtil.h" -#include "FindWindow.h" -#include "PrefWindow.h" -#include "PrefView.h" -#include "PrefHandler.h" -#include "TermBuffer.h" -#include "TermParse.h" -#include "TermView.h" -#include "TermWindow.h" -#include "TermConst.h" - +#include +#include // // help and GPL URL