Преглед изворни кода

* all integers replaced with smallint, in order to be able to introduce objfpc mode

git-svn-id: branches/unicodekvm@48538 -
nickysn пре 4 година
родитељ
комит
75db39f064

+ 8 - 8
packages/fv/src/app.pas

@@ -347,7 +347,7 @@ CONST
 {                       INITIALIZED PUBLIC VARIABLES                        }
 {---------------------------------------------------------------------------}
 CONST
-   AppPalette: Integer = apColor;                     { Application colour }
+   AppPalette: SmallInt = apColor;                    { Application colour }
    Desktop: PDeskTop = Nil;                           { Desktop object }
    MenuBar: PMenuView = Nil;                          { Application menu }
    StatusLine: PStatusLine = Nil;                     { App status line }
@@ -401,8 +401,8 @@ END;
 {---------------------------------------------------------------------------}
 {  MostEqualDivisors -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 22Oct99 LdB }
 {---------------------------------------------------------------------------}
-PROCEDURE MostEqualDivisors (N: Integer; Var X, Y: Integer; FavorY: Boolean);
-VAR I: Integer;
+PROCEDURE MostEqualDivisors (N: SmallInt; Var X, Y: SmallInt; FavorY: Boolean);
+VAR I: SmallInt;
 BEGIN
    I := ISqr(N);                                      { Int square of N }
    If ((N MOD I) <> 0) Then                           { Initial guess }
@@ -515,9 +515,9 @@ END;
 {  Tile -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 22Oct99 LdB              }
 {---------------------------------------------------------------------------}
 PROCEDURE TDeskTop.Tile (Var R: TRect);
-VAR NumCols, NumRows, NumTileable, LeftOver, TileNum: Integer;
+VAR NumCols, NumRows, NumTileable, LeftOver, TileNum: SmallInt;
 
-   FUNCTION DividerLoc (Lo, Hi, Num, Pos: Integer): Integer;
+   FUNCTION DividerLoc (Lo, Hi, Num, Pos: SmallInt): SmallInt;
    BEGIN
      DividerLoc := LongInt( LongInt(Hi - Lo) * Pos)
        DIV Num + Lo;                                  { Calc position }
@@ -528,8 +528,8 @@ VAR NumCols, NumRows, NumTileable, LeftOver, TileNum: Integer;
      If Tileable(P) Then Inc(NumTileable);            { Count tileable views }
    END;
 
-   PROCEDURE CalcTileRect (Pos: Integer; Var NR: TRect);
-   VAR X, Y, D: Integer;
+   PROCEDURE CalcTileRect (Pos: SmallInt; Var NR: TRect);
+   VAR X, Y, D: SmallInt;
    BEGIN
      D := (NumCols - LeftOver) * NumRows;             { Calc d value }
      If (Pos<D) Then Begin
@@ -596,7 +596,7 @@ END;
 {  Cascade -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 22Oct99 LdB           }
 {---------------------------------------------------------------------------}
 PROCEDURE TDeskTop.Cascade (Var R: TRect);
-VAR CascadeNum: Integer; LastView: PView; Min, Max: TPoint;
+VAR CascadeNum: SmallInt; LastView: PView; Min, Max: TPoint;
 
    PROCEDURE DoCount (P: PView); {$IFNDEF PPC_FPC}FAR;{$ENDIF}
    BEGIN

+ 1 - 1
packages/fv/src/asciitab.pas

@@ -171,7 +171,7 @@ var
   CurrentPos : TPoint;
   Handled : boolean;
 
-  procedure SetTo(xpos, ypos : sw_integer;press:integer);
+  procedure SetTo(xpos, ypos : sw_integer;press:SmallInt);
   var
     newchar : ptrint;
   begin

+ 7 - 7
packages/fv/src/dialogs.pas

@@ -666,17 +666,17 @@ TYPE
 
   PEditListBox = ^TEditListBox;
   TEditListBox = Object(TListBox)
-    CurrentField : Integer;
+    CurrentField : SmallInt;
     constructor Init (Bounds : TRect; ANumCols: Word;
       AVScrollBar : PScrollBar);
     constructor Load (var S : TStream);
     function  FieldValidator : PValidator; virtual;
-    function  FieldWidth : Integer; virtual;
+    function  FieldWidth : SmallInt; virtual;
     procedure GetField (InputLine : PInputLine); virtual;
     function  GetPalette : PPalette; virtual;
     procedure HandleEvent (var Event : TEvent); virtual;
     procedure SetField (InputLine : PInputLine); virtual;
-    function  StartColumn : Integer; virtual;
+    function  StartColumn : SmallInt; virtual;
       PRIVATE
     procedure EditField (var Event : TEvent);
   end;  { of TEditListBox }
@@ -3757,7 +3757,7 @@ end;
 {****************************************************************************}
 { TEditListBox.FieldWidth                                                    }
 {****************************************************************************}
-function TEditListBox.FieldWidth : Integer;
+function TEditListBox.FieldWidth : SmallInt;
   { In a multiple field listbox FieldWidth should return the width }
   { appropriate for CurrentField.                                  }
 begin
@@ -3815,7 +3815,7 @@ end;
 {****************************************************************************}
 { TEditListBox.StartColumn                                                   }
 {****************************************************************************}
-function TEditListBox.StartColumn : Integer;
+function TEditListBox.StartColumn : SmallInt;
 begin
   StartColumn := Origin.X;
 end;
@@ -3833,7 +3833,7 @@ var
   Bounds: TRect;
   b: Byte;
   ButtonCount: Byte;
-  i, j, Gap, Line: Integer;
+  i, j, Gap, Line: SmallInt;
   Scrollbar: PScrollbar;
   HasFrame: Boolean;
   HasButtons: Boolean;
@@ -4100,7 +4100,7 @@ end;
 { TModalInputLine.SetState                                                   }
 {****************************************************************************}
 procedure TModalInputLine.SetState (AState : Word; Enable : Boolean);
-var Pos : Integer;
+var Pos : SmallInt;
 begin
   if (AState = sfSelected)
      then begin

+ 2 - 2
packages/fv/src/drivers.pas

@@ -296,7 +296,7 @@ TYPE
             0: (InfoPtr: Pointer);                    { Message pointer }
             1: (InfoLong: Longint);                   { Message longint }
             2: (InfoWord: Word);                      { Message Sw_Word }
-            3: (InfoInt: Integer);                    { Message Sw_Integer }
+            3: (InfoInt: SmallInt);                   { Message Sw_Integer }
             4: (InfoByte: Byte);                      { Message byte }
             5: (InfoChar: Char));                     { Message character }
    END;
@@ -1462,7 +1462,7 @@ END;
 {---------------------------------------------------------------------------}
 procedure FormatStr (Var Result: String; CONST Format: String; Var Params);
 TYPE TLongArray = Array[0..0] Of PtrInt;
-VAR W, ResultLength : integer;
+VAR W, ResultLength : SmallInt;
     FormatIndex, Justify, Wth: Byte;
     Fill: Char; S: String;
 

+ 14 - 14
packages/fv/src/editors.pas

@@ -84,7 +84,7 @@ const
   CMemo      = #26#27;
 
 type
-  TEditorDialog = function (Dialog : Integer; Info : Pointer) : Word;
+  TEditorDialog = function (Dialog : SmallInt; Info : Pointer) : Word;
 
   PIndicator = ^TIndicator;
   TIndicator = object (TView)
@@ -156,7 +156,7 @@ type
     BlankLine          : Sw_Word; { First blank line after a paragraph. }
     Word_Wrap          : Boolean; { Added boolean to toggle wordwrap on/off. }
     Line_Number        : string[8]; { Holds line number to jump to. }
-    Right_Margin       : Sw_Integer; { Added integer to set right margin. }
+    Right_Margin       : Sw_Integer; { Added SmallInt to set right margin. }
     Tab_Settings       : String[Tab_Stop_Length]; { Added string to hold tab stops. }
 
     constructor Init (var Bounds : TRect; AHScrollBar, AVScrollBar : PScrollBar;
@@ -192,7 +192,7 @@ type
     function   Valid (Command : Word) : Boolean; virtual;
 
   private
-    KeyState       : Integer;
+    KeyState       : SmallInt;
     LockCount      : Byte;
     UpdateFlags    : Byte;
     Place_Marker   : Array [1..10] of Sw_Word; { Inserted array to hold place markers. }
@@ -287,7 +287,7 @@ type
   PEditWindow = ^TEditWindow;
   TEditWindow = object (TWindow)
     Editor : PFileEditor;
-    constructor Init (var Bounds : TRect; FileName : FNameStr; ANumber : Integer);
+    constructor Init (var Bounds : TRect; FileName : FNameStr; ANumber : SmallInt);
     constructor Load (var S : Objects.TStream);
     procedure   Close; virtual;
     function    GetTitle (MaxSize : Sw_Integer) : TTitleStr; virtual;
@@ -297,14 +297,14 @@ type
   end;
 
 
-function DefEditorDialog (Dialog : Integer; Info : Pointer) : Word;
+function DefEditorDialog (Dialog : SmallInt; Info : Pointer) : Word;
 function CreateFindDialog: PDialog;
 function CreateReplaceDialog: PDialog;
 function JumpLineDialog : PDialog;
 function ReformDocDialog : PDialog;
 function RightMarginDialog : PDialog;
 function TabStopDialog : Dialogs.PDialog;
-function StdEditorDialog(Dialog: Integer; Info: Pointer): Word;
+function StdEditorDialog(Dialog: SmallInt; Info: Pointer): Word;
 
 const
   WordChars    : set of Char = ['!'..#255];
@@ -605,7 +605,7 @@ CONST
                                  Dialogs
 ****************************************************************************}
 
-function DefEditorDialog (Dialog : Integer; Info : Pointer) : Word;
+function DefEditorDialog (Dialog : SmallInt; Info : Pointer) : Word;
 begin
   DefEditorDialog := cmCancel;
 end; { DefEditorDialog }
@@ -893,7 +893,7 @@ Begin
 end { TabStopDialog };
 
 
-function StdEditorDialog(Dialog: Integer; Info: Pointer): Word;
+function StdEditorDialog(Dialog: SmallInt; Info: Pointer): Word;
 var
   R: TRect;
   T: TPoint;
@@ -2338,7 +2338,7 @@ procedure TEditor.Jump_To_Line (Select_Mode : Byte);
 { This function brings up a dialog box that allows }
 { the user to select a line number to jump to.     }
 VAR
-  Code       : Integer;         { Used for Val conversion.      }
+  Code       : SmallInt;         { Used for Val conversion.      }
   Temp_Value : Longint;         { Holds converted dialog value. }
 begin
   if EditorDialog (edJumpToLine, @Line_Number) <> cmCancel then
@@ -3055,7 +3055,7 @@ procedure TEditor.Set_Right_Margin;
 { that allows the user to set Right_Margin. }
 { Values must be < MaxLineLength and > 9.   }
 VAR
-  Code        : Integer;          { Used for Val conversion.      }
+  Code        : SmallInt;          { Used for Val conversion.      }
   Margin_Data : TRightMarginRec;  { Holds dialog results.         }
   Temp_Value  : Sw_Integer;       { Holds converted dialog value. }
 begin
@@ -3344,7 +3344,7 @@ begin
                 Place_marker[Element] := 0
               else
                 begin
-                  if integer (Place_Marker[Element]) - integer (KillCount) > 0 then
+                  if SmallInt (Place_Marker[Element]) - SmallInt (KillCount) > 0 then
                     Place_Marker[Element] := Place_Marker[Element] - KillCount
                   else
                     Place_Marker[Element] := 0;
@@ -3356,7 +3356,7 @@ begin
     BlankLine := BlankLine + AddCount
   else
     begin
-      if integer (BlankLine) - Integer (KillCount) > 0 then
+      if SmallInt (BlankLine) - SmallInt (KillCount) > 0 then
         BlankLine := BlankLine - KillCount
       else
         BlankLine := 0;
@@ -3659,7 +3659,7 @@ end; { TFileEditor.UpdateCommands }
 
 function TFileEditor.Valid (Command : Word) : Boolean;
 VAR
-  D : Integer;
+  D : SmallInt;
 begin
   if Command = cmValid then
     Valid := IsValid
@@ -3688,7 +3688,7 @@ end; { TFileEditor.Valid }
 
 constructor TEditWindow.Init (var Bounds   : TRect;
                                   FileName : Objects.FNameStr;
-                                  ANumber  : Integer);
+                                  ANumber  : SmallInt);
 var
   HScrollBar : PScrollBar;
   VScrollBar : PScrollBar;

+ 11 - 11
packages/fv/src/fvcommon.pas

@@ -103,7 +103,7 @@ CONST
    MaxBytes = 128*1024*1024;                          { Maximum data size }
 {$ENDIF}
    MaxWords = MaxBytes DIV SizeOf(Word);              { Max words }
-   MaxInts  = MaxBytes DIV SizeOf(Integer);           { Max integers }
+   MaxInts  = MaxBytes DIV SizeOf(SmallInt);          { Max integers }
    MaxLongs = MaxBytes DIV SizeOf(LongInt);           { Max longints }
    MaxPtrs  = MaxBytes DIV SizeOf(Pointer);           { Max pointers }
    MaxReals = MaxBytes DIV SizeOf(Real);              { Max reals }
@@ -122,7 +122,7 @@ TYPE
    CPUInt = Longint;                                  { CPUInt is 32 bit }
 {$ELSE}                                               { 16 BIT CODE }
    CPUWord = Word;                                    { CPUWord is 16 bit }
-   CPUInt = Integer;                                  { CPUInt is 16 bit }
+   CPUInt = SmallInt;                                 { CPUInt is 16 bit }
 {$ENDIF}
 
 {---------------------------------------------------------------------------}
@@ -131,7 +131,7 @@ TYPE
 TYPE
 {$IFDEF BIT_16}                                       { 16 BIT DEFINITIONS }
    Sw_Word    = Word;                                 { Standard word }
-   Sw_Integer = Integer;                              { Standard integer }
+   Sw_Integer = SmallInt;                             { Standard SmallInt }
 {$ENDIF}
 {$IFDEF BIT_32_OR_MORE}                               { 32 BIT DEFINITIONS }
    Sw_Word    = Cardinal;                             { Long integer now }
@@ -148,8 +148,8 @@ TYPE
    TWordArray = ARRAY [0..MaxWords-1] Of Word;        { Word array }
    PWordArray = ^TWordArray;                          { Word array pointer }
 
-   TIntegerArray = ARRAY [0..MaxInts-1] Of Integer;   { Integer array }
-   PIntegerArray = ^TIntegerArray;                    { Integer array pointer }
+   TIntegerArray = ARRAY [0..MaxInts-1] Of SmallInt;  { SmallInt array }
+   PIntegerArray = ^TIntegerArray;                    { SmallInt array pointer }
 
    TLongIntArray = ARRAY [0..MaxLongs-1] Of LongInt;  { LongInt array }
    PLongIntArray = ^TLongIntArray;                    { LongInt array pointer }
@@ -200,16 +200,16 @@ Given two real numbers returns the maximum real of the two.
 FUNCTION MaximumOf (A, B: Real): Real;
 
 {-MinIntegerOf-------------------------------------------------------
-Given two integer values returns the lowest integer of the two.
+Given two SmallInt values returns the lowest SmallInt of the two.
 04Oct99 LdB
 ---------------------------------------------------------------------}
-FUNCTION MinIntegerOf (A, B: Integer): Integer;
+FUNCTION MinIntegerOf (A, B: SmallInt): SmallInt;
 
 {-MaxIntegerof-------------------------------------------------------
-Given two integer values returns the biggest integer of the two.
+Given two SmallInt values returns the biggest SmallInt of the two.
 04Oct99 LdB
 ---------------------------------------------------------------------}
-FUNCTION MaxIntegerOf (A, B: Integer): Integer;
+FUNCTION MaxIntegerOf (A, B: SmallInt): SmallInt;
 
 {-MinLongIntOf-------------------------------------------------------
 Given two long integers returns the minimum longint of the two.
@@ -320,7 +320,7 @@ END;
 {---------------------------------------------------------------------------}
 {  MinIntegerOf -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 04Oct99 LdB      }
 {---------------------------------------------------------------------------}
-FUNCTION MinIntegerOf (A, B: Integer): Integer;
+FUNCTION MinIntegerOf (A, B: SmallInt): SmallInt;
 BEGIN
    If (B < A) Then MinIntegerOf := B                  { B smaller take it }
      Else MinIntegerOf := A;                          { Else take A }
@@ -329,7 +329,7 @@ END;
 {---------------------------------------------------------------------------}
 {  MaxIntegerOf -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 04Oct99 LdB      }
 {---------------------------------------------------------------------------}
-FUNCTION MaxIntegerOf (A, B: Integer): Integer;
+FUNCTION MaxIntegerOf (A, B: SmallInt): SmallInt;
 BEGIN
    If (B > A) Then MaxIntegerOf := B                  { B bigger take it }
      Else MaxIntegerOf := A;                          { Else take A }

+ 5 - 5
packages/fv/src/inplong.pas

@@ -3,13 +3,13 @@ Unit InpLong;
 (*--
 TInputLong is a derivitave of TInputline designed to accept LongInt
 numeric input.  Since both the upper and lower limit of acceptable numeric
-input can be set, TInputLong may be used for Integer, Word, or Byte input
+input can be set, TInputLong may be used for SmallInt, Word, or Byte input
 as well.  Option flag bits allow optional hex input and display.  A blank
 field may optionally be rejected or interpreted as zero.
 
 Methods
 
-constructor Init(var R : TRect; AMaxLen : Integer;
+constructor Init(var R : TRect; AMaxLen : SmallInt;
                 LowerLim, UpperLim : LongInt; Flgs : Word);
 
 Calls TInputline.Init and saves the desired limits and Flags.  Flags may
@@ -148,7 +148,7 @@ end;
 
 {-------------------TInputLong.GetData}
 PROCEDURE TInputLong.GetData(var Rec);
-var code : Integer;
+var code : SmallInt;
 begin
 Val(Data^, LongInt(Rec), code);
 end;
@@ -203,7 +203,7 @@ end;
 FUNCTION TInputLong.RangeCheck : Boolean;
 var
   L : LongInt;
-  code : Integer;
+  code : SmallInt;
 begin
 if (Data^ = '') and (ILOptions and ilBlankEqZero <> 0) then
   Data^ := '0';
@@ -217,7 +217,7 @@ var
   SU, SL : string[40];
   PMyLabel : PLabel;
   Labl : string;
-  I : Integer;
+  I : SmallInt;
 
   function FindIt(P : PView) : boolean;{$ifdef PPC_BP}far;{$endif}
   begin

+ 2 - 2
packages/fv/src/memory.pas

@@ -278,7 +278,7 @@ CONST
    DisablePool: Boolean = False;                      { Disable safety pool }
    SafetyPool : Pointer = Nil;                        { Safety pool memory }
 {$IFDEF PROC_REAL}                                    { REAL MODE DOS CODE }
-   HeapResult: Integer = 0;                           { Heap result }
+   HeapResult: SmallInt = 0;                          { Heap result }
    BufHeapPtr: Word = 0;                              { Heap position }
    BufHeapEnd: Word = 0;                              { Heap end }
    CachePtr  : Pointer = Nil;                         { Cache list }
@@ -443,7 +443,7 @@ END;
 {---------------------------------------------------------------------------}
 {  HeapNotify -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 01Oct99 LdB        }
 {---------------------------------------------------------------------------}
-FUNCTION HeapNotify (Size: Word): Integer; {$IFNDEF PPC_FPC}FAR;{$ENDIF}
+FUNCTION HeapNotify (Size: Word): SmallInt; {$IFNDEF PPC_FPC}FAR;{$ENDIF}
 {$IFDEF PROC_REAL}                                    { REAL MODE DOS CODE }
 ASSEMBLER;
 ASM

+ 11 - 11
packages/fv/src/menus.pas

@@ -107,7 +107,7 @@ TYPE
      Disabled: Boolean;                               { Menu item state }
      KeyCode: Word;                                   { Menu item keycode }
      HelpCtx: Word;                                   { Menu item help ctx }
-     Case Integer Of
+     Case SmallInt Of
        0: (Param: PString);
        1: (SubMenu: PMenu);
    END;
@@ -709,7 +709,7 @@ END;
 {  FindItem -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 11May98 LdB          }
 {---------------------------------------------------------------------------}
 FUNCTION TMenuView.FindItem (Ch: Char): PMenuItem;
-VAR I: Integer; P: PMenuItem;
+VAR I: SmallInt; P: PMenuItem;
 BEGIN
    Ch := UpCase(Ch);                                  { Upper case of char }
    P := Menu^.Items;                                  { First menu item }
@@ -947,7 +947,7 @@ END;
 {  GetItemRectX -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 08May98 LdB      }
 {---------------------------------------------------------------------------}
 PROCEDURE TMenuBar.GetItemRectX (Item: PMenuItem; Var R: TRect);
-VAR I: Integer; P: PMenuItem;
+VAR I: SmallInt; P: PMenuItem;
 BEGIN
    I := 0;                                            { Preset to zero }
    R.Assign(0, 0, 0, 1);                     { Initial rect size }
@@ -972,7 +972,7 @@ END;
 {---------------------------------------------------------------------------}
 CONSTRUCTOR TMenuBox.Init (Var Bounds: TRect; AMenu: PMenu;
   AParentMenu: PMenuView);
-VAR W, H, L: Integer; S: String; P: PMenuItem; R: TRect;
+VAR W, H, L: SmallInt; S: String; P: PMenuItem; R: TRect;
 BEGIN
    W := 0;                                            { Clear initial width }
    H := 2;                                            { Set initial height }
@@ -1008,7 +1008,7 @@ END;
 {  Draw -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 11May98 LdB              }
 {---------------------------------------------------------------------------}
 PROCEDURE TMenuBox.Draw;
-VAR CNormal, CSelect, CSelectDisabled, CDisabled, Color: Word; Index, Y: Integer;
+VAR CNormal, CSelect, CSelectDisabled, CDisabled, Color: Word; Index, Y: SmallInt;
     S: String; P: PMenuItem; B: TDrawBuffer;
 Type
    FrameLineType = (UpperLine,NormalLine,SeparationLine,LowerLine);
@@ -1085,7 +1085,7 @@ END;
 {  GetItemRectX -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 11May98 LdB      }
 {---------------------------------------------------------------------------}
 PROCEDURE TMenuBox.GetItemRectX (Item: PMenuItem; Var R: TRect);
-VAR X, Y: Integer; P: PMenuItem;
+VAR X, Y: SmallInt; P: PMenuItem;
 BEGIN
    Y := 1;                                   { Initial y position }
    P := Menu^.Items;                                  { Initial item }
@@ -1165,7 +1165,7 @@ END;
 CONSTRUCTOR TStatusLine.Load (Var S: TStream);
 
    FUNCTION DoLoadStatusItems: PStatusItem;
-   VAR Count: Integer; Cur, First: PStatusItem; Last: ^PStatusItem;
+   VAR Count: SmallInt; Cur, First: PStatusItem; Last: ^PStatusItem;
    BEGIN
      Cur := Nil;                                      { Preset nil }
      Last := @First;                                  { Start on first item }
@@ -1186,7 +1186,7 @@ CONSTRUCTOR TStatusLine.Load (Var S: TStream);
    END;
 
    FUNCTION DoLoadStatusDefs: PStatusDef;
-   VAR Count: Integer; Cur, First: PStatusDef; Last: ^PStatusDef;
+   VAR Count: SmallInt; Cur, First: PStatusDef; Last: ^PStatusDef;
    BEGIN
      Last := @First;                                  { Start on first }
      S.Read(Count, SizeOf(Count));                    { Read item count }
@@ -1290,7 +1290,7 @@ END;
 PROCEDURE TStatusLine.Store (Var S: TStream);
 
    PROCEDURE DoStoreStatusItems (Cur: PStatusItem);
-   VAR Count: Integer; T: PStatusItem;
+   VAR Count: SmallInt; T: PStatusItem;
    BEGIN
      Count := 0;                                      { Clear count }
      T := Cur;                                        { Start on current }
@@ -1308,7 +1308,7 @@ PROCEDURE TStatusLine.Store (Var S: TStream);
    END;
 
    PROCEDURE DoStoreStatusDefs (Cur: PStatusDef);
-   VAR Count: Integer; T: PStatusDef;
+   VAR Count: SmallInt; T: PStatusDef;
    BEGIN
      Count := 0;                                      { Clear count }
      T := Cur;                                        { Current status item }
@@ -1425,7 +1425,7 @@ END;
 {  DrawSelect -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 11May98 LdB        }
 {---------------------------------------------------------------------------}
 PROCEDURE TStatusLine.DrawSelect (Selected: PStatusItem);
-VAR I, L: Integer; Color, CSelect, CNormal, CSelDisabled, CNormDisabled: Word;
+VAR I, L: SmallInt; Color, CSelect, CNormal, CSelDisabled, CNormDisabled: Word;
     HintBuf: String; B: TDrawBuffer; T: PStatusItem;
 BEGIN
    CNormal := GetColor($0301);                        { Normal colour }

+ 1 - 1
packages/fv/src/msgbox.pas

@@ -204,7 +204,7 @@ END;
 
 FUNCTION MessageBoxRectDlg (Dlg: PDialog; Var R: TRect; Const Msg: String;
   Params: Pointer; AOptions: Word): Word;
-VAR I, X, ButtonCount: Integer; S: String; Control: PView;
+VAR I, X, ButtonCount: SmallInt; S: String; Control: PView;
     ButtonList: Array[0..4] Of PView;
 BEGIN
    With Dlg^ Do Begin

+ 7 - 7
packages/fv/src/outline.pas

@@ -22,8 +22,8 @@ type  Pnode=^Tnode;
         constructor init(var bounds:Trect;
                          AHscrollbar,AVscrollbar:Pscrollbar);
         procedure adjust(node:pointer;expand:boolean);virtual;
-        function creategraph(level:integer;lines:longint;
-                             flags:word;levwidth,endwidth:integer;
+        function creategraph(level:SmallInt;lines:longint;
+                             flags:word;levwidth,endwidth:SmallInt;
                              const chars:string):string;
         procedure draw;virtual;
         procedure expandall(node:pointer);
@@ -31,7 +31,7 @@ type  Pnode=^Tnode;
         procedure focused(i:sw_integer);virtual;
         procedure foreach(action:codepointer);
         function getchild(node:pointer;i:sw_integer):pointer;virtual;
-        function getgraph(level:integer;lines:longint;flags:word):string;
+        function getgraph(level:SmallInt;lines:longint;flags:word):string;
         function getnode(i:sw_integer):pointer;virtual;
         function getnumchildren(node:pointer):sw_integer;virtual;
         function getpalette:Ppalette;virtual;
@@ -132,8 +132,8 @@ begin
   abstract;
 end;
 
-function TOutlineViewer.CreateGraph(Level: Integer; Lines: LongInt;
-  Flags: Word; LevWidth, EndWidth: Integer;
+function TOutlineViewer.CreateGraph(Level: SmallInt; Lines: LongInt;
+  Flags: Word; LevWidth, EndWidth: SmallInt;
   const Chars: String): String;
 const
   FillerOrBar  = 0;
@@ -204,7 +204,7 @@ function Toutlineviewer.do_recurse(action:codepointer;callerframe:pointer;
 var position:sw_integer;
     r:pointer;
 
-  function recurse(cur:pointer;level:integer;lines:longint;lastchild:boolean):pointer;
+  function recurse(cur:pointer;level:SmallInt;lines:longint;lastchild:boolean):pointer;
 
   var i,childcount:sw_integer;
       child:pointer;
@@ -374,7 +374,7 @@ begin
   abstract;
 end;
 
-function Toutlineviewer.getgraph(level:integer;lines:longint;
+function Toutlineviewer.getgraph(level:SmallInt;lines:longint;
                                  flags:word):string;
 
 begin

+ 2 - 2
packages/fv/src/resource.pas

@@ -326,7 +326,7 @@ end;
 procedure TConstant.SetValue (AValue: string);
 var
   N: Word;
-  ErrorCode: Integer;
+  ErrorCode: SmallInt;
 begin
   Val(AValue,N,ErrorCode);
   if ErrorCode = 0 then
@@ -529,7 +529,7 @@ var
   var
     i, j: Byte;
     N: Byte;
-    ErrorCode: Integer;
+    ErrorCode: SmallInt;
     S: string;
   begin
     with Constant^ do

+ 14 - 14
packages/fv/src/statuses.pas

@@ -197,7 +197,7 @@ type
         Event.Command field against Command before handling the event. }
       {#X HandleEvent }
     constructor Init (R : TRect; ACommand : Word; AText : String;
-                      AParamCount : Integer);
+                      AParamCount : SmallInt);
       { Init calls the inherited constructor then sets #Command# to ACommand.
 
         If an error occurs Init fails. }
@@ -471,7 +471,7 @@ Min = XXX  Max = XXX  Current = XXX }
   TPercentGauge = Object(TGauge)
     { A TPercentGauge displays a numerical percentage as returned by
       #Percent# followed by a '%' sign. }
-    function Percent : Integer; virtual;
+    function Percent : SmallInt; virtual;
       { Percent returns the whole number value of (Current / Max) * 100. }
       {#X TGauge.Current TGauge.Max }
     procedure Draw; virtual;
@@ -505,7 +505,7 @@ Min = XXX  Max = XXX  Current = XXX }
   TSpinnerGauge = Object(TGauge)
     { A TSpinnerGauge displays a series of characters in one spot on the
       screen giving the illusion of a spinning line. }
-    constructor Init (X, Y : Integer; ACommand : Word);
+    constructor Init (X, Y : SmallInt; ACommand : Word);
       { Init calls the inherited constructor with AMin set to 0 and AMax set
         to 4. }
     procedure Draw; virtual;
@@ -545,7 +545,7 @@ Min = XXX  Max = XXX  Current = XXX }
       memory.  It responds to a cmStatusUpdate event by calling MaxAvail and
       comparing the result to #Max#, then updating the view if necessary. }
     {#X THeapMemAvail }
-    constructor Init (X, Y : Integer);
+    constructor Init (X, Y : SmallInt);
       { Init creates the view with the following text:
 
         MaxAvail = xxxx
@@ -570,7 +570,7 @@ Min = XXX  Max = XXX  Current = XXX }
       MemAvail and comparing the result to #Max#, then updating the view if
       necessary. }
     {#X THeapMaxAvail }
-    constructor Init (X, Y : Integer);
+    constructor Init (X, Y : SmallInt);
       { Init creates the view with the following text:
 
         MemAvail = xxxx
@@ -922,7 +922,7 @@ end;
 {****************************************************************************}
 { THeapMaxAvail.Init                                                         }
 {****************************************************************************}
-constructor THeapMaxAvail.Init (X, Y : Integer);
+constructor THeapMaxAvail.Init (X, Y : SmallInt);
 var
   R : TRect;
 begin
@@ -953,7 +953,7 @@ end;
 {****************************************************************************}
 { THeapMemAvail.Init                                                         }
 {****************************************************************************}
-constructor THeapMemAvail.Init (X, Y : Integer);
+constructor THeapMemAvail.Init (X, Y : SmallInt);
 var
   R : TRect;
 begin
@@ -991,7 +991,7 @@ var
   C : Word;
   S : String;
   PercentDone : LongInt;
-  FillSize : Integer;
+  FillSize : SmallInt;
 begin
   C := GetColor(1);
   MoveChar(B,' ',C,Size.X);
@@ -1005,8 +1005,8 @@ end;
 {****************************************************************************}
 { TPercentGauge.Percent                                                      }
 {****************************************************************************}
-function TPercentGauge.Percent : Integer;
-  { Returns percent as a whole integer Current of Max }
+function TPercentGauge.Percent : SmallInt;
+  { Returns percent as a whole SmallInt Current of Max }
 begin
   Percent := Round((Current/Max) * 100);
 end;
@@ -1018,7 +1018,7 @@ end;
 {****************************************************************************}
 { TSpinnerGauge.Init                                                         }
 {****************************************************************************}
-constructor TSpinnerGauge.Init (X, Y : Integer; ACommand : Word);
+constructor TSpinnerGauge.Init (X, Y : SmallInt; ACommand : Word);
 var R : TRect;
 begin
   R.Assign(X,Y,X+1,Y+1);
@@ -1067,7 +1067,7 @@ end;
 { TStatus.Init                                                               }
 {****************************************************************************}
 constructor TStatus.Init (R : TRect; ACommand : Word; AText : String;
-                          AParamCount : Integer);
+                          AParamCount : SmallInt);
 begin
   if (not TParamText.Init(R,AText,AParamCount)) then
     Fail;
@@ -1295,7 +1295,7 @@ var
   R : TRect;
   P : PButton;
   Buttons : Byte;
-  X, Y, Gap : Integer;
+  X, Y, Gap : SmallInt;
   i : Word;
 begin
   Buttons := Byte(((AFlags and sdCancelButton) = sdCancelButton));
@@ -1354,7 +1354,7 @@ constructor TStatusMessageDlg.Init (ATitle : TTitleStr; AStatus : PStatus;
                                     AFlags : Word; AMessage : String);
 var
   P : PStaticText;
-  X, Y : Integer;
+  X, Y : SmallInt;
   R : TRect;
 begin
   if not TStatusDlg.Init(ATitle,AStatus,AFlags) then

+ 1 - 1
packages/fv/src/stddlg.pas

@@ -925,7 +925,7 @@ begin
 end;
 
 function MatchesMaskList(What, MaskList: string): boolean;
-var P: integer;
+var P: SmallInt;
     Match: boolean;
 begin
   Match:=false;

+ 20 - 20
packages/fv/src/tabs.pas

@@ -52,14 +52,14 @@ type
     PTab = ^TTab;
     TTab = object(TGroup)
       TabDefs   : PTabDef;
-      ActiveDef : integer;
+      ActiveDef : SmallInt;
       DefCount  : word;
       constructor Init(var Bounds: TRect; ATabDef: PTabDef);
       constructor Load (var S: TStream);
-      function    AtTab(Index: integer): PTabDef; virtual;
-      procedure   SelectTab(Index: integer); virtual;
+      function    AtTab(Index: SmallInt): PTabDef; virtual;
+      procedure   SelectTab(Index: SmallInt); virtual;
       procedure   Store (var S: TStream);
-      function    TabCount: integer;
+      function    TabCount: SmallInt;
       function    Valid(Command: Word): Boolean; virtual;
       procedure   ChangeBounds(var Bounds: TRect); virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
@@ -224,8 +224,8 @@ begin
   DoStoreTabDefs (TabDefs);
 end;
 
-function TTab.TabCount: integer;
-var i: integer;
+function TTab.TabCount: SmallInt;
+var i: SmallInt;
     P: PTabDef;
 begin
   I:=0; P:=TabDefs;
@@ -238,8 +238,8 @@ begin
 end;
 
 
-function TTab.AtTab(Index: integer): PTabDef;
-var i: integer;
+function TTab.AtTab(Index: SmallInt): PTabDef;
+var i: SmallInt;
     P: PTabDef;
 begin
   i:=0; P:=TabDefs;
@@ -252,7 +252,7 @@ begin
   AtTab:=P;
 end;
 
-procedure TTab.SelectTab(Index: integer);
+procedure TTab.SelectTab(Index: SmallInt);
 var P: PTabItem;
     V: PView;
 begin
@@ -305,7 +305,7 @@ begin
 end;
 var
     P: PTabItem;
-    I: integer;
+    I: SmallInt;
 begin
   D.X := Bounds.B.X - Bounds.A.X - Size.X;
   D.Y := Bounds.B.Y - Bounds.A.Y - Size.Y;
@@ -349,9 +349,9 @@ begin
 end;
 
 procedure TTab.HandleEvent(var Event: TEvent);
-var Index : integer;
-    I     : integer;
-    X     : integer;
+var Index : SmallInt;
+    I     : SmallInt;
+    X     : SmallInt;
     Len   : byte;
     P     : TPoint;
     V     : PView;
@@ -467,16 +467,16 @@ const
 
 
 var B     : TDrawBuffer;
-    i     : integer;
+    i     : SmallInt;
     C1,C2,C3,C : word;
-    HeaderLen  : integer;
-    X,X2       : integer;
+    HeaderLen  : SmallInt;
+    X,X2       : SmallInt;
     Name       : PString;
-    ActiveKPos : integer;
-    ActiveVPos : integer;
+    ActiveKPos : SmallInt;
+    ActiveVPos : SmallInt;
     FC   : char;
-procedure SWriteBuf(X,Y,W,H: integer; var Buf);
-var i: integer;
+procedure SWriteBuf(X,Y,W,H: SmallInt; var Buf);
+var i: SmallInt;
 begin
   if Y+H>Size.Y then H:=Size.Y-Y;
   if X+W>Size.X then W:=Size.X-X;

+ 4 - 4
packages/fv/src/validate.pas

@@ -497,7 +497,7 @@ VAR I, J: Byte; Rslt: TPicResult; Reprocess: Boolean;
      END;
 
      PROCEDURE ToGroupEnd (Var I: Byte);
-     VAR BrkLevel, BrcLevel: Integer;
+     VAR BrkLevel, BrcLevel: SmallInt;
      BEGIN
        BrkLevel := 0;                                 { Zero bracket level }
        BrcLevel := 0;                                 { Zero bracket level }
@@ -711,7 +711,7 @@ VAR I, J: Byte; Rslt: TPicResult; Reprocess: Boolean;
    END;
 
    FUNCTION SyntaxCheck: Boolean;
-   VAR I, BrkLevel, BrcLevel: Integer;
+   VAR I, BrkLevel, BrcLevel: SmallInt;
    Begin
      SyntaxCheck := False;                            { Preset false result }
      If (Pic^ <> '') AND (Pic^[Length(Pic^)] <> ';')  { Name is valid }
@@ -818,7 +818,7 @@ END;
 {  IsValid -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 18May98 LdB           }
 {---------------------------------------------------------------------------}
 FUNCTION TFilterValidator.IsValid (Const S: String): Boolean;
-VAR I: Integer;
+VAR I: SmallInt;
 BEGIN
    I := 1;                                            { Start at position 1 }
    While S[I] In ValidChars Do Inc(I);                { Check each char }
@@ -830,7 +830,7 @@ END;
 {  IsValidInput -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 18May98 LdB      }
 {---------------------------------------------------------------------------}
 FUNCTION TFilterValidator.IsValidInput (Var S: String; SuppressFill: Boolean): Boolean;
-VAR I: Integer;
+VAR I: SmallInt;
 BEGIN
    I := 1;                                            { Start at position 1 }
    While S[I] In ValidChars Do Inc(I);                { Check each char }

+ 14 - 14
packages/fv/src/views.pas

@@ -822,7 +822,7 @@ CONST
 type
   TstatVar2 = record
     target : PView;
-    offset,y : integer;
+    offset,y : SmallInt;
   end;
 
 var
@@ -889,7 +889,7 @@ end;
 
 TYPE
    ViewPortType = RECORD
-     X1, Y1, X2, Y2: Integer;                         { Corners of viewport }
+     X1, Y1, X2, Y2: SmallInt;                        { Corners of viewport }
      Clip          : Boolean;                         { Clip status }
    END;
 
@@ -907,7 +907,7 @@ END;
 {---------------------------------------------------------------------------}
 {  SetViewPort -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 05Dec2000 LdB     }
 {---------------------------------------------------------------------------}
-PROCEDURE SetViewPort (X1, Y1, X2, Y2: Integer; Clip: Boolean);
+PROCEDURE SetViewPort (X1, Y1, X2, Y2: SmallInt; Clip: Boolean);
 BEGIN
      If (X1 < 0) Then X1 := 0;                        { X1 negative fix }
      If (X1 >ScreenWidth) Then
@@ -962,7 +962,7 @@ END;
 {  supported but it should work as per original TV code.                    }
 {---------------------------------------------------------------------------}
 CONSTRUCTOR TView.Load (Var S: TStream);
-VAR i: Integer;
+VAR i: SmallInt;
 BEGIN
    Inherited Init;                                    { Call ancestor }
    S.Read(i, SizeOf(i)); Origin.X:=i;                 { Read origin x value }
@@ -1682,7 +1682,7 @@ END;
 {---------------------------------------------------------------------------}
 PROCEDURE TView.Store (Var S: TStream);
 VAR SaveState: Word;
-    i: integer;
+    i: SmallInt;
 BEGIN
    SaveState := State;                                { Hold current state }
    State := State AND NOT (sfActive OR sfSelected OR
@@ -1867,7 +1867,7 @@ END;
 {  GetPeerViewPtr -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 12Sep97 LdB    }
 {---------------------------------------------------------------------------}
 PROCEDURE TView.GetPeerViewPtr (Var S: TStream; Var P);
-VAR Index: Integer;
+VAR Index: SmallInt;
 BEGIN
    Index := 0;                                        { Zero index value }
    S.Read(Index, SizeOf(Index));                      { Read view index }
@@ -1882,7 +1882,7 @@ END;
 {  PutPeerViewPtr -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 12Sep97 LdB    }
 {---------------------------------------------------------------------------}
 PROCEDURE TView.PutPeerViewPtr (Var S: TStream; P: PView);
-VAR Index: Integer;
+VAR Index: SmallInt;
 BEGIN
    If (P = Nil) OR (OwnerGroup = Nil) Then Index := 0 { Return zero index }
      Else Index := OwnerGroup^.IndexOf(P);            { Return view index }
@@ -2738,7 +2738,7 @@ const
 var
   FrameMask : array[0..MaxViewWidth-1] of Byte;
   ColorMask : word;
-  i,j,k     : {Sw_  lo and hi are used !! }integer;
+  i,j,k     : {Sw_  lo and hi are used !! }SmallInt;
   CurrView  : PView;
   p         : Pchar;
 begin
@@ -3035,7 +3035,7 @@ END;
 {   scrollbar id set to zero.                                               }
 {---------------------------------------------------------------------------}
 CONSTRUCTOR TScrollBar.Load (Var S: TStream);
-VAR i: Integer;
+VAR i: SmallInt;
 BEGIN
    Inherited Load(S);                                 { Call ancestor }
    S.Read(i, SizeOf(i)); Value:=i;                    { Read current value }
@@ -3139,7 +3139,7 @@ END;
 {  routine and resetting the ofGrafVersion flag after the call.             }
 {---------------------------------------------------------------------------}
 PROCEDURE TScrollBar.Store (Var S: TStream);
-VAR i: Integer;
+VAR i: SmallInt;
 BEGIN
    TView.Store(S);                                    { TView.Store called }
    i:=Value;S.Write(i, SizeOf(i));                    { Write current value }
@@ -3354,7 +3354,7 @@ END;
 {   as the new graphical scroller views.                                    }
 {---------------------------------------------------------------------------}
 CONSTRUCTOR TScroller.Load (Var S: TStream);
-VAR i: Integer;
+VAR i: SmallInt;
 BEGIN
    Inherited Load(S);                                 { Call ancestor }
    GetPeerViewPtr(S, HScrollBar);                     { Load horz scrollbar }
@@ -3413,7 +3413,7 @@ END;
 {  The scroller is saved to the stream compatable with the old TV object.   }
 {---------------------------------------------------------------------------}
 PROCEDURE TScroller.Store (Var S: TStream);
-VAR i: Integer;
+VAR i: SmallInt;
 BEGIN
    TView.Store(S);                                    { Call TView explicitly }
    PutPeerViewPtr(S, HScrollBar);                     { Store horz bar }
@@ -3813,7 +3813,7 @@ END;
 {   although a frame view is read for compatability it is disposed of.      }
 {---------------------------------------------------------------------------}
 CONSTRUCTOR TWindow.Load (Var S: TStream);
-VAR I: Integer;
+VAR I: SmallInt;
 BEGIN
    Inherited Load(S);                                 { Call ancestor }
    S.Read(Flags, SizeOf(Flags));                      { Read window flags }
@@ -3945,7 +3945,7 @@ END;
 {  routine and resetting the ofGrafVersion flag after the call.             }
 {---------------------------------------------------------------------------}
 PROCEDURE TWindow.Store (Var S: TStream);
-VAR i: Integer;
+VAR i: SmallInt;
 BEGIN
    TGroup.Store(S);                                   { Call group store }
    S.Write(Flags, SizeOf(Flags));                     { Write window flags }