Browse Source

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

git-svn-id: branches/unicodekvm@48538 -
nickysn 4 years ago
parent
commit
75db39f064

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

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

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

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

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

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

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

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

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

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

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

@@ -103,7 +103,7 @@ CONST
    MaxBytes = 128*1024*1024;                          { Maximum data size }
    MaxBytes = 128*1024*1024;                          { Maximum data size }
 {$ENDIF}
 {$ENDIF}
    MaxWords = MaxBytes DIV SizeOf(Word);              { Max words }
    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 }
    MaxLongs = MaxBytes DIV SizeOf(LongInt);           { Max longints }
    MaxPtrs  = MaxBytes DIV SizeOf(Pointer);           { Max pointers }
    MaxPtrs  = MaxBytes DIV SizeOf(Pointer);           { Max pointers }
    MaxReals = MaxBytes DIV SizeOf(Real);              { Max reals }
    MaxReals = MaxBytes DIV SizeOf(Real);              { Max reals }
@@ -122,7 +122,7 @@ TYPE
    CPUInt = Longint;                                  { CPUInt is 32 bit }
    CPUInt = Longint;                                  { CPUInt is 32 bit }
 {$ELSE}                                               { 16 BIT CODE }
 {$ELSE}                                               { 16 BIT CODE }
    CPUWord = Word;                                    { CPUWord is 16 bit }
    CPUWord = Word;                                    { CPUWord is 16 bit }
-   CPUInt = Integer;                                  { CPUInt is 16 bit }
+   CPUInt = SmallInt;                                 { CPUInt is 16 bit }
 {$ENDIF}
 {$ENDIF}
 
 
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
@@ -131,7 +131,7 @@ TYPE
 TYPE
 TYPE
 {$IFDEF BIT_16}                                       { 16 BIT DEFINITIONS }
 {$IFDEF BIT_16}                                       { 16 BIT DEFINITIONS }
    Sw_Word    = Word;                                 { Standard word }
    Sw_Word    = Word;                                 { Standard word }
-   Sw_Integer = Integer;                              { Standard integer }
+   Sw_Integer = SmallInt;                             { Standard SmallInt }
 {$ENDIF}
 {$ENDIF}
 {$IFDEF BIT_32_OR_MORE}                               { 32 BIT DEFINITIONS }
 {$IFDEF BIT_32_OR_MORE}                               { 32 BIT DEFINITIONS }
    Sw_Word    = Cardinal;                             { Long integer now }
    Sw_Word    = Cardinal;                             { Long integer now }
@@ -148,8 +148,8 @@ TYPE
    TWordArray = ARRAY [0..MaxWords-1] Of Word;        { Word array }
    TWordArray = ARRAY [0..MaxWords-1] Of Word;        { Word array }
    PWordArray = ^TWordArray;                          { Word array pointer }
    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 }
    TLongIntArray = ARRAY [0..MaxLongs-1] Of LongInt;  { LongInt array }
    PLongIntArray = ^TLongIntArray;                    { LongInt array pointer }
    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;
 FUNCTION MaximumOf (A, B: Real): Real;
 
 
 {-MinIntegerOf-------------------------------------------------------
 {-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
 04Oct99 LdB
 ---------------------------------------------------------------------}
 ---------------------------------------------------------------------}
-FUNCTION MinIntegerOf (A, B: Integer): Integer;
+FUNCTION MinIntegerOf (A, B: SmallInt): SmallInt;
 
 
 {-MaxIntegerof-------------------------------------------------------
 {-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
 04Oct99 LdB
 ---------------------------------------------------------------------}
 ---------------------------------------------------------------------}
-FUNCTION MaxIntegerOf (A, B: Integer): Integer;
+FUNCTION MaxIntegerOf (A, B: SmallInt): SmallInt;
 
 
 {-MinLongIntOf-------------------------------------------------------
 {-MinLongIntOf-------------------------------------------------------
 Given two long integers returns the minimum longint of the two.
 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      }
 {  MinIntegerOf -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 04Oct99 LdB      }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
-FUNCTION MinIntegerOf (A, B: Integer): Integer;
+FUNCTION MinIntegerOf (A, B: SmallInt): SmallInt;
 BEGIN
 BEGIN
    If (B < A) Then MinIntegerOf := B                  { B smaller take it }
    If (B < A) Then MinIntegerOf := B                  { B smaller take it }
      Else MinIntegerOf := A;                          { Else take A }
      Else MinIntegerOf := A;                          { Else take A }
@@ -329,7 +329,7 @@ END;
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
 {  MaxIntegerOf -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 04Oct99 LdB      }
 {  MaxIntegerOf -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 04Oct99 LdB      }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
-FUNCTION MaxIntegerOf (A, B: Integer): Integer;
+FUNCTION MaxIntegerOf (A, B: SmallInt): SmallInt;
 BEGIN
 BEGIN
    If (B > A) Then MaxIntegerOf := B                  { B bigger take it }
    If (B > A) Then MaxIntegerOf := B                  { B bigger take it }
      Else MaxIntegerOf := A;                          { Else take A }
      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
 TInputLong is a derivitave of TInputline designed to accept LongInt
 numeric input.  Since both the upper and lower limit of acceptable numeric
 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
 as well.  Option flag bits allow optional hex input and display.  A blank
 field may optionally be rejected or interpreted as zero.
 field may optionally be rejected or interpreted as zero.
 
 
 Methods
 Methods
 
 
-constructor Init(var R : TRect; AMaxLen : Integer;
+constructor Init(var R : TRect; AMaxLen : SmallInt;
                 LowerLim, UpperLim : LongInt; Flgs : Word);
                 LowerLim, UpperLim : LongInt; Flgs : Word);
 
 
 Calls TInputline.Init and saves the desired limits and Flags.  Flags may
 Calls TInputline.Init and saves the desired limits and Flags.  Flags may
@@ -148,7 +148,7 @@ end;
 
 
 {-------------------TInputLong.GetData}
 {-------------------TInputLong.GetData}
 PROCEDURE TInputLong.GetData(var Rec);
 PROCEDURE TInputLong.GetData(var Rec);
-var code : Integer;
+var code : SmallInt;
 begin
 begin
 Val(Data^, LongInt(Rec), code);
 Val(Data^, LongInt(Rec), code);
 end;
 end;
@@ -203,7 +203,7 @@ end;
 FUNCTION TInputLong.RangeCheck : Boolean;
 FUNCTION TInputLong.RangeCheck : Boolean;
 var
 var
   L : LongInt;
   L : LongInt;
-  code : Integer;
+  code : SmallInt;
 begin
 begin
 if (Data^ = '') and (ILOptions and ilBlankEqZero <> 0) then
 if (Data^ = '') and (ILOptions and ilBlankEqZero <> 0) then
   Data^ := '0';
   Data^ := '0';
@@ -217,7 +217,7 @@ var
   SU, SL : string[40];
   SU, SL : string[40];
   PMyLabel : PLabel;
   PMyLabel : PLabel;
   Labl : string;
   Labl : string;
-  I : Integer;
+  I : SmallInt;
 
 
   function FindIt(P : PView) : boolean;{$ifdef PPC_BP}far;{$endif}
   function FindIt(P : PView) : boolean;{$ifdef PPC_BP}far;{$endif}
   begin
   begin

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

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

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

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

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

@@ -22,8 +22,8 @@ type  Pnode=^Tnode;
         constructor init(var bounds:Trect;
         constructor init(var bounds:Trect;
                          AHscrollbar,AVscrollbar:Pscrollbar);
                          AHscrollbar,AVscrollbar:Pscrollbar);
         procedure adjust(node:pointer;expand:boolean);virtual;
         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;
                              const chars:string):string;
         procedure draw;virtual;
         procedure draw;virtual;
         procedure expandall(node:pointer);
         procedure expandall(node:pointer);
@@ -31,7 +31,7 @@ type  Pnode=^Tnode;
         procedure focused(i:sw_integer);virtual;
         procedure focused(i:sw_integer);virtual;
         procedure foreach(action:codepointer);
         procedure foreach(action:codepointer);
         function getchild(node:pointer;i:sw_integer):pointer;virtual;
         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 getnode(i:sw_integer):pointer;virtual;
         function getnumchildren(node:pointer):sw_integer;virtual;
         function getnumchildren(node:pointer):sw_integer;virtual;
         function getpalette:Ppalette;virtual;
         function getpalette:Ppalette;virtual;
@@ -132,8 +132,8 @@ begin
   abstract;
   abstract;
 end;
 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 Chars: String): String;
 const
 const
   FillerOrBar  = 0;
   FillerOrBar  = 0;
@@ -204,7 +204,7 @@ function Toutlineviewer.do_recurse(action:codepointer;callerframe:pointer;
 var position:sw_integer;
 var position:sw_integer;
     r:pointer;
     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;
   var i,childcount:sw_integer;
       child:pointer;
       child:pointer;
@@ -374,7 +374,7 @@ begin
   abstract;
   abstract;
 end;
 end;
 
 
-function Toutlineviewer.getgraph(level:integer;lines:longint;
+function Toutlineviewer.getgraph(level:SmallInt;lines:longint;
                                  flags:word):string;
                                  flags:word):string;
 
 
 begin
 begin

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

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

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

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

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

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

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

@@ -52,14 +52,14 @@ type
     PTab = ^TTab;
     PTab = ^TTab;
     TTab = object(TGroup)
     TTab = object(TGroup)
       TabDefs   : PTabDef;
       TabDefs   : PTabDef;
-      ActiveDef : integer;
+      ActiveDef : SmallInt;
       DefCount  : word;
       DefCount  : word;
       constructor Init(var Bounds: TRect; ATabDef: PTabDef);
       constructor Init(var Bounds: TRect; ATabDef: PTabDef);
       constructor Load (var S: TStream);
       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);
       procedure   Store (var S: TStream);
-      function    TabCount: integer;
+      function    TabCount: SmallInt;
       function    Valid(Command: Word): Boolean; virtual;
       function    Valid(Command: Word): Boolean; virtual;
       procedure   ChangeBounds(var Bounds: TRect); virtual;
       procedure   ChangeBounds(var Bounds: TRect); virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
@@ -224,8 +224,8 @@ begin
   DoStoreTabDefs (TabDefs);
   DoStoreTabDefs (TabDefs);
 end;
 end;
 
 
-function TTab.TabCount: integer;
-var i: integer;
+function TTab.TabCount: SmallInt;
+var i: SmallInt;
     P: PTabDef;
     P: PTabDef;
 begin
 begin
   I:=0; P:=TabDefs;
   I:=0; P:=TabDefs;
@@ -238,8 +238,8 @@ begin
 end;
 end;
 
 
 
 
-function TTab.AtTab(Index: integer): PTabDef;
-var i: integer;
+function TTab.AtTab(Index: SmallInt): PTabDef;
+var i: SmallInt;
     P: PTabDef;
     P: PTabDef;
 begin
 begin
   i:=0; P:=TabDefs;
   i:=0; P:=TabDefs;
@@ -252,7 +252,7 @@ begin
   AtTab:=P;
   AtTab:=P;
 end;
 end;
 
 
-procedure TTab.SelectTab(Index: integer);
+procedure TTab.SelectTab(Index: SmallInt);
 var P: PTabItem;
 var P: PTabItem;
     V: PView;
     V: PView;
 begin
 begin
@@ -305,7 +305,7 @@ begin
 end;
 end;
 var
 var
     P: PTabItem;
     P: PTabItem;
-    I: integer;
+    I: SmallInt;
 begin
 begin
   D.X := Bounds.B.X - Bounds.A.X - Size.X;
   D.X := Bounds.B.X - Bounds.A.X - Size.X;
   D.Y := Bounds.B.Y - Bounds.A.Y - Size.Y;
   D.Y := Bounds.B.Y - Bounds.A.Y - Size.Y;
@@ -349,9 +349,9 @@ begin
 end;
 end;
 
 
 procedure TTab.HandleEvent(var Event: TEvent);
 procedure TTab.HandleEvent(var Event: TEvent);
-var Index : integer;
-    I     : integer;
-    X     : integer;
+var Index : SmallInt;
+    I     : SmallInt;
+    X     : SmallInt;
     Len   : byte;
     Len   : byte;
     P     : TPoint;
     P     : TPoint;
     V     : PView;
     V     : PView;
@@ -467,16 +467,16 @@ const
 
 
 
 
 var B     : TDrawBuffer;
 var B     : TDrawBuffer;
-    i     : integer;
+    i     : SmallInt;
     C1,C2,C3,C : word;
     C1,C2,C3,C : word;
-    HeaderLen  : integer;
-    X,X2       : integer;
+    HeaderLen  : SmallInt;
+    X,X2       : SmallInt;
     Name       : PString;
     Name       : PString;
-    ActiveKPos : integer;
-    ActiveVPos : integer;
+    ActiveKPos : SmallInt;
+    ActiveVPos : SmallInt;
     FC   : char;
     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
 begin
   if Y+H>Size.Y then H:=Size.Y-Y;
   if Y+H>Size.Y then H:=Size.Y-Y;
   if X+W>Size.X then W:=Size.X-X;
   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;
      END;
 
 
      PROCEDURE ToGroupEnd (Var I: Byte);
      PROCEDURE ToGroupEnd (Var I: Byte);
-     VAR BrkLevel, BrcLevel: Integer;
+     VAR BrkLevel, BrcLevel: SmallInt;
      BEGIN
      BEGIN
        BrkLevel := 0;                                 { Zero bracket level }
        BrkLevel := 0;                                 { Zero bracket level }
        BrcLevel := 0;                                 { Zero bracket level }
        BrcLevel := 0;                                 { Zero bracket level }
@@ -711,7 +711,7 @@ VAR I, J: Byte; Rslt: TPicResult; Reprocess: Boolean;
    END;
    END;
 
 
    FUNCTION SyntaxCheck: Boolean;
    FUNCTION SyntaxCheck: Boolean;
-   VAR I, BrkLevel, BrcLevel: Integer;
+   VAR I, BrkLevel, BrcLevel: SmallInt;
    Begin
    Begin
      SyntaxCheck := False;                            { Preset false result }
      SyntaxCheck := False;                            { Preset false result }
      If (Pic^ <> '') AND (Pic^[Length(Pic^)] <> ';')  { Name is valid }
      If (Pic^ <> '') AND (Pic^[Length(Pic^)] <> ';')  { Name is valid }
@@ -818,7 +818,7 @@ END;
 {  IsValid -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 18May98 LdB           }
 {  IsValid -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 18May98 LdB           }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
 FUNCTION TFilterValidator.IsValid (Const S: String): Boolean;
 FUNCTION TFilterValidator.IsValid (Const S: String): Boolean;
-VAR I: Integer;
+VAR I: SmallInt;
 BEGIN
 BEGIN
    I := 1;                                            { Start at position 1 }
    I := 1;                                            { Start at position 1 }
    While S[I] In ValidChars Do Inc(I);                { Check each char }
    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      }
 {  IsValidInput -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 18May98 LdB      }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
 FUNCTION TFilterValidator.IsValidInput (Var S: String; SuppressFill: Boolean): Boolean;
 FUNCTION TFilterValidator.IsValidInput (Var S: String; SuppressFill: Boolean): Boolean;
-VAR I: Integer;
+VAR I: SmallInt;
 BEGIN
 BEGIN
    I := 1;                                            { Start at position 1 }
    I := 1;                                            { Start at position 1 }
    While S[I] In ValidChars Do Inc(I);                { Check each char }
    While S[I] In ValidChars Do Inc(I);                { Check each char }

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

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