Browse Source

* integer -> smallint to overcome -S2 switch needed for ggi version

peter 26 years ago
parent
commit
62bd7e53ee

+ 7 - 4
rtl/inc/graph/clip.inc

@@ -26,8 +26,8 @@ const
 
 
 
 
 
 
-  function LineClipped(var x1, y1,x2,y2: integer; xmin, ymin,
-      xmax, ymax:integer): boolean;
+  function LineClipped(var x1, y1,x2,y2: smallint; xmin, ymin,
+      xmax, ymax:smallint): boolean;
   {********************************************************}
   {********************************************************}
   { Function LineClipped()                                 }
   { Function LineClipped()                                 }
   {--------------------------------------------------------}
   {--------------------------------------------------------}
@@ -45,7 +45,7 @@ const
    newx,newy: word;
    newx,newy: word;
 
 
 
 
-    function outcode(x,y:integer): longint;
+    function outcode(x,y:smallint): longint;
     {********************************************************}
     {********************************************************}
     { Function OutCode()                                     }
     { Function OutCode()                                     }
     {--------------------------------------------------------}
     {--------------------------------------------------------}
@@ -142,7 +142,10 @@ end;
 
 
 {
 {
 $Log$
 $Log$
-Revision 1.6  1999-09-27 12:35:27  jonas
+Revision 1.7  1999-12-20 11:22:35  peter
+  * integer -> smallint to overcome -S2 switch needed for ggi version
+
+Revision 1.6  1999/09/27 12:35:27  jonas
   * execute multiplications before divisions in lineclipped to avoid rounding errors
   * execute multiplications before divisions in lineclipped to avoid rounding errors
 
 
 Revision 1.5  1999/09/18 22:21:09  jonas
 Revision 1.5  1999/09/18 22:21:09  jonas

+ 19 - 16
rtl/inc/graph/fills.inc

@@ -50,8 +50,8 @@ type
   too mixed, it is fastest (?). Rather than sorting the active edge table
   too mixed, it is fastest (?). Rather than sorting the active edge table
   this way, it is recommened to implement this using a linked list (not
   this way, it is recommened to implement this using a linked list (not
   nearly as much memory is transfered then) }
   nearly as much memory is transfered then) }
-   procedure bsort(p : pointer; number : integer; sizeelem :
-      integer; c : compareproc);
+   procedure bsort(p : pointer; number : smallint; sizeelem :
+      smallint; c : compareproc);
    var    i : graph_int;
    var    i : graph_int;
            swap : boolean;
            swap : boolean;
        temp : pointer;
        temp : pointer;
@@ -277,9 +277,9 @@ end;
 
 
 type
 type
   TFloodLine = record
   TFloodLine = record
-    x1 : Integer;
-    x2 : Integer;
-    y  : Integer;
+    x1 : smallint;
+    x2 : smallint;
+    y  : smallint;
   end;
   end;
 
 
   TDrawnList  = Array[0..StdBuffersize] of TFloodLine;
   TDrawnList  = Array[0..StdBuffersize] of TFloodLine;
@@ -298,7 +298,7 @@ var
   s1, s2, s3 : PWordArray;                { Three buffers for scanlines                 }
   s1, s2, s3 : PWordArray;                { Three buffers for scanlines                 }
 
 
 
 
-  Procedure PushPoint (x, y : Integer);
+  Procedure PushPoint (x, y : smallint);
   {********************************************************}
   {********************************************************}
   { Adds a  point to the list of points to check if we     }
   { Adds a  point to the list of points to check if we     }
   { need to draw. Doesn't add the point if there is a      }
   { need to draw. Doesn't add the point if there is a      }
@@ -313,7 +313,7 @@ var
      End
      End
   End;
   End;
 
 
-  Procedure PopPoint (Var x, y : Integer);
+  Procedure PopPoint (Var x, y : smallint);
   {********************************************************}
   {********************************************************}
   { Removes a point from the list of points to check, if   }
   { Removes a point from the list of points to check, if   }
   { we try to access an illegal point, then the routine    }
   { we try to access an illegal point, then the routine    }
@@ -345,7 +345,7 @@ var
   { drawn to the screen. The line added is on the specified}
   { drawn to the screen. The line added is on the specified}
   { Y axis, from the x1 to x2 coordinates.                 }
   { Y axis, from the x1 to x2 coordinates.                 }
   {********************************************************}
   {********************************************************}
-  Procedure AddLinePoints(x1,x2,y: integer);
+  Procedure AddLinePoints(x1,x2,y: smallint);
    begin
    begin
      DrawnList[DrawnIndex].x1 := x1;
      DrawnList[DrawnIndex].x1 := x1;
      DrawnList[DrawnIndex].x2 := x2;
      DrawnList[DrawnIndex].x2 := x2;
@@ -365,9 +365,9 @@ var
   { Return TRUE if the point is already in the segment list}
   { Return TRUE if the point is already in the segment list}
   { to draw, otherwise returns FALSE.                      }
   { to draw, otherwise returns FALSE.                      }
   {********************************************************}
   {********************************************************}
-  Function AlreadyDrawn(x, y: integer): boolean;
+  Function AlreadyDrawn(x, y: smallint): boolean;
    var
    var
-    LocalIndex : integer;
+    LocalIndex : smallint;
    begin
    begin
     AlreadyDrawn := FALSE;
     AlreadyDrawn := FALSE;
     LocalIndex := 0;
     LocalIndex := 0;
@@ -389,7 +389,7 @@ var
    end;
    end;
 
 
 
 
-  Procedure FloodFill (x, y : Integer; Border: word);
+  Procedure FloodFill (x, y : smallint; Border: word);
   {********************************************************}
   {********************************************************}
   { Procedure FloodFill()                                  }
   { Procedure FloodFill()                                  }
   {--------------------------------------------------------}
   {--------------------------------------------------------}
@@ -400,12 +400,12 @@ var
   {********************************************************}
   {********************************************************}
   Var
   Var
    stemp: PWordArray;
    stemp: PWordArray;
-   Beginx : Integer;
+   Beginx : smallint;
    d, e : Byte;
    d, e : Byte;
    Cont : Boolean;
    Cont : Boolean;
    BackupColor : Word;
    BackupColor : Word;
-   x1, x2, prevy: integer;
-   Index : Integer;
+   x1, x2, prevy: smallint;
+   Index : smallint;
   Begin
   Begin
     { init prevy }
     { init prevy }
     prevy := 32767;
     prevy := 32767;
@@ -509,9 +509,12 @@ var
 
 
 {
 {
 $Log$
 $Log$
-Revision 1.12  1999-12-11 23:41:38  jonas
+Revision 1.13  1999-12-20 11:22:36  peter
+  * integer -> smallint to overcome -S2 switch needed for ggi version
+
+Revision 1.12  1999/12/11 23:41:38  jonas
   * changed definition of getscanlineproc to "getscanline(x1,x2,y:
   * changed definition of getscanlineproc to "getscanline(x1,x2,y:
-    integer; var data);" so it can be used by getimage too
+    smallint; var data);" so it can be used by getimage too
   * changed getimage so it uses getscanline
   * changed getimage so it uses getscanline
   * changed floodfill, getscanline16 and definitions in Linux
   * changed floodfill, getscanline16 and definitions in Linux
     include files so they use this new format
     include files so they use this new format

+ 177 - 174
rtl/inc/graph/graph.pp

@@ -351,9 +351,9 @@ Interface
 
 
     type
     type
        RGBRec = packed record
        RGBRec = packed record
-         Red: integer;
-         Green: integer;
-         Blue : integer;
+         Red: smallint;
+         Green: smallint;
+         Blue : smallint;
        end;
        end;
 
 
        PaletteType = record
        PaletteType = record
@@ -383,27 +383,27 @@ Interface
        FillPatternType = array[1..8] of byte;
        FillPatternType = array[1..8] of byte;
 
 
        PointType = record
        PointType = record
-             x,y : integer;
+             x,y : smallint;
        end;
        end;
 
 
        ViewPortType = record
        ViewPortType = record
-             x1,y1,x2,y2 : integer;
+             x1,y1,x2,y2 : smallint;
              Clip : boolean;
              Clip : boolean;
        end;
        end;
 
 
        ArcCoordsType = record
        ArcCoordsType = record
-             x,y : integer;
-             xstart,ystart : integer;
-             xend,yend : integer;
+             x,y : smallint;
+             xstart,ystart : smallint;
+             xend,yend : smallint;
        end;
        end;
 
 
 {$IFDEF FPC}
 {$IFDEF FPC}
-        graph_int = longint;      { platform specific integer used for indexes;
+        graph_int = longint;      { platform specific smallint used for indexes;
                                     should be 16 bits on TP/BP and 32 bits on every-
                                     should be 16 bits on TP/BP and 32 bits on every-
                                     thing else for speed reasons }
                                     thing else for speed reasons }
         graph_float = single;   { the platform's preferred floating point size }
         graph_float = single;   { the platform's preferred floating point size }
 {$ELSE}
 {$ELSE}
-        graph_int = integer;    { platform specific integer used for indexes;
+        graph_int = smallint;    { platform specific smallint used for indexes;
                                   should be 16 bits on TP/BP and 32 bits on every-
                                   should be 16 bits on TP/BP and 32 bits on every-
                                   thing else for speed reasons }
                                   thing else for speed reasons }
         graph_float = real;     { the platform's preferred floating point size }
         graph_float = real;     { the platform's preferred floating point size }
@@ -441,19 +441,19 @@ TYPE
        { drawing routines, it will use the viewport settings, as    }
        { drawing routines, it will use the viewport settings, as    }
        { well as clip, and use the current foreground color to plot }
        { well as clip, and use the current foreground color to plot }
        { the desired pixel.                                         }
        { the desired pixel.                                         }
-       defpixelproc = procedure(X,Y: Integer);
+       defpixelproc = procedure(X,Y: smallint);
 
 
        { standard plot and get pixel                                }
        { standard plot and get pixel                                }
-       getpixelproc = function(X,Y: Integer): word;
-       putpixelproc = procedure(X,Y: Integer; Color: Word);
+       getpixelproc = function(X,Y: smallint): word;
+       putpixelproc = procedure(X,Y: smallint; Color: Word);
 
 
        { clears the viewport, also used to clear the device         }
        { clears the viewport, also used to clear the device         }
        clrviewproc  = procedure;
        clrviewproc  = procedure;
 
 
        { putimage procedure, can be hooked to accomplish transparency }
        { putimage procedure, can be hooked to accomplish transparency }
-       putimageproc = procedure (X,Y: Integer; var Bitmap; BitBlt: Word);
-       getimageproc = procedure(X1,Y1,X2,Y2: Integer; Var Bitmap);
-       imagesizeproc= function (X1,Y1,X2,Y2: Integer): longint;
+       putimageproc = procedure (X,Y: smallint; var Bitmap; BitBlt: Word);
+       getimageproc = procedure(X1,Y1,X2,Y2: smallint; Var Bitmap);
+       imagesizeproc= function (X1,Y1,X2,Y2: smallint): longint;
 
 
        graphfreememprc = procedure (var P: Pointer; size: word);
        graphfreememprc = procedure (var P: Pointer; size: word);
        graphgetmemprc  = procedure (var P: pointer; size: word);
        graphgetmemprc  = procedure (var P: pointer; size: word);
@@ -462,29 +462,29 @@ TYPE
 
 
        { draw filled horizontal lines using current color }
        { draw filled horizontal lines using current color }
        { on entry coordinates are already clipped.        }
        { on entry coordinates are already clipped.        }
-       hlineproc = procedure (x, x2,y : integer);
+       hlineproc = procedure (x, x2,y : smallint);
        { on entry coordinates are already clipped.        }
        { on entry coordinates are already clipped.        }
        { draw filled vertical line using current color    }
        { draw filled vertical line using current color    }
-       vlineproc = procedure (x,y,y2: integer);
+       vlineproc = procedure (x,y,y2: smallint);
 
 
        { this routine is used to draw filled patterns for all routines }
        { this routine is used to draw filled patterns for all routines }
        { that require it. (FillPoly, FloodFill, Sector, etc...         }
        { that require it. (FillPoly, FloodFill, Sector, etc...         }
        { clipping is verified, uses current Fill settings for drawing  }
        { clipping is verified, uses current Fill settings for drawing  }
-       patternlineproc = procedure (x1,x2,y: integer);
+       patternlineproc = procedure (x1,x2,y: smallint);
 
 
        { this routine is used to draw all circles/ellipses/sectors     }
        { this routine is used to draw all circles/ellipses/sectors     }
        { more info... on this later...                                 }
        { more info... on this later...                                 }
-       ellipseproc = procedure (X,Y: Integer;XRadius: word;
+       ellipseproc = procedure (X,Y: smallint;XRadius: word;
          YRadius:word; stAngle,EndAngle: word; fp: PatternLineProc);
          YRadius:word; stAngle,EndAngle: word; fp: PatternLineProc);
 
 
        { Line routine - draws lines thick/norm widths with current     }
        { Line routine - draws lines thick/norm widths with current     }
        { color and line style - LINE must be clipped here.             }
        { color and line style - LINE must be clipped here.             }
-       lineproc = procedure (X1, Y1, X2, Y2 : Integer);
+       lineproc = procedure (X1, Y1, X2, Y2 : smallint);
 
 
        { this routine is used for FloodFill - it returns an entire      }
        { this routine is used for FloodFill - it returns an entire      }
        { screen scan line with a word for each pixel in the scanline.   }
        { screen scan line with a word for each pixel in the scanline.   }
        { Also handy for GetImage, so I added x coords as well (JM)      }
        { Also handy for GetImage, so I added x coords as well (JM)      }
-       getscanlineproc = procedure (X1, X2, Y : integer; var data);
+       getscanlineproc = procedure (X1, X2, Y : smallint; var data);
 
 
        { changes the active display screen where we draw to... }
        { changes the active display screen where we draw to... }
        setactivepageproc = procedure (page: word);
        setactivepageproc = procedure (page: word);
@@ -502,12 +502,12 @@ TYPE
 
 
        { This routine is a hook for SetRGBPalette                       }
        { This routine is a hook for SetRGBPalette                       }
        setrgbpaletteproc =
        setrgbpaletteproc =
-         procedure(ColorNum, RedValue, GreenValue, BlueValue: Integer);
+         procedure(ColorNum, RedValue, GreenValue, BlueValue: smallint);
 
 
        { This routine is a hook for GetRGBPalette                       }
        { This routine is a hook for GetRGBPalette                       }
        getrgbpaletteproc =
        getrgbpaletteproc =
-         procedure(ColorNum: integer; var
-            RedValue, GreenValue, BlueValue: Integer);
+         procedure(ColorNum: smallint; var
+            RedValue, GreenValue, BlueValue: smallint);
 
 
 
 
 TYPE
 TYPE
@@ -524,14 +524,14 @@ TYPE
     {-----------------------------------}
     {-----------------------------------}
     PModeInfo = ^TModeInfo;
     PModeInfo = ^TModeInfo;
     TModeInfo = record
     TModeInfo = record
-      DriverNumber: Integer;
-      ModeNumber: Integer;
+      DriverNumber: smallint;
+      ModeNumber: smallint;
       MaxColor: Longint;            { Maximum colors on screen        }
       MaxColor: Longint;            { Maximum colors on screen        }
       PaletteSize : Longint;        { Maximum palette entry we can change }
       PaletteSize : Longint;        { Maximum palette entry we can change }
-      XAspect : Integer;            { XAspect ratio correction factor }
-      YAspect : Integer;            { YAspect ratio correction factor }
-      MaxX: Integer;                { Max-X row                       }
-      MaxY: Integer;                { Max. column.                    }
+      XAspect : smallint;            { XAspect ratio correction factor }
+      YAspect : smallint;            { YAspect ratio correction factor }
+      MaxX: smallint;                { Max-X row                       }
+      MaxY: smallint;                { Max. column.                    }
       DirectColor: boolean;         { Is this a direct color mode??   }
       DirectColor: boolean;         { Is this a direct color mode??   }
       Hardwarepages: byte;          { total number of image pages - 1 }
       Hardwarepages: byte;          { total number of image pages - 1 }
       ModeName: String[18];
       ModeName: String[18];
@@ -590,35 +590,35 @@ VAR
 
 
 Procedure Closegraph;
 Procedure Closegraph;
 procedure SetLineStyle(LineStyle: word; Pattern: word; Thickness: word);
 procedure SetLineStyle(LineStyle: word; Pattern: word; Thickness: word);
-function  GraphErrorMsg(ErrorCode: Integer): string;
-Function  GetMaxX: Integer;
-Function  GetMaxY: Integer;
-Procedure SetViewPort(X1, Y1, X2, Y2: Integer; Clip: Boolean);
-Function  GraphResult: Integer;
-function  GetModeName(ModeNumber: integer): string;
-procedure SetGraphMode(Mode: Integer);
-function GetGraphMode: Integer;
+function  GraphErrorMsg(ErrorCode: smallint): string;
+Function  GetMaxX: smallint;
+Function  GetMaxY: smallint;
+Procedure SetViewPort(X1, Y1, X2, Y2: smallint; Clip: Boolean);
+Function  GraphResult: smallint;
+function  GetModeName(ModeNumber: smallint): string;
+procedure SetGraphMode(Mode: smallint);
+function GetGraphMode: smallint;
 function GetMaxMode: word;
 function GetMaxMode: word;
 procedure RestoreCrtMode;
 procedure RestoreCrtMode;
-procedure GetModeRange(GraphDriver: Integer; var LoMode, HiMode: Integer);
-Function  GetX: Integer;
-Function  GetY: Integer;
+procedure GetModeRange(GraphDriver: smallint; var LoMode, HiMode: smallint);
+Function  GetX: smallint;
+Function  GetY: smallint;
 procedure GraphDefaults;
 procedure GraphDefaults;
 procedure ClearDevice;
 procedure ClearDevice;
 procedure GetViewSettings(var viewport : ViewPortType);
 procedure GetViewSettings(var viewport : ViewPortType);
-procedure SetWriteMode(WriteMode : integer);
+procedure SetWriteMode(WriteMode : smallint);
 procedure GetFillSettings(var Fillinfo:Fillsettingstype);
 procedure GetFillSettings(var Fillinfo:Fillsettingstype);
 procedure GetFillPattern(var FillPattern:FillPatternType);
 procedure GetFillPattern(var FillPattern:FillPatternType);
 procedure GetLineSettings(var ActiveLineInfo : LineSettingsType);
 procedure GetLineSettings(var ActiveLineInfo : LineSettingsType);
-procedure InitGraph(var GraphDriver:Integer;var GraphMode:Integer;const PathToDriver:String);
-procedure DetectGraph(var GraphDriver:Integer;var GraphMode:Integer);
-function InstallUserDriver(Name: string; AutoDetectPtr: Pointer): integer;
-function RegisterBGIDriver(driver: pointer): integer;
+procedure InitGraph(var GraphDriver:smallint;var GraphMode:smallint;const PathToDriver:String);
+procedure DetectGraph(var GraphDriver:smallint;var GraphMode:smallint);
+function InstallUserDriver(Name: string; AutoDetectPtr: Pointer): smallint;
+function RegisterBGIDriver(driver: pointer): smallint;
 procedure SetFillStyle(Pattern : word; Color: word);
 procedure SetFillStyle(Pattern : word; Color: word);
 procedure SetFillPattern(Pattern: FillPatternType; Color: word);
 procedure SetFillPattern(Pattern: FillPatternType; Color: word);
 Function GetDriverName: string;
 Function GetDriverName: string;
- procedure MoveRel(Dx, Dy: Integer);
- procedure MoveTo(X,Y: Integer);
+ procedure MoveRel(Dx, Dy: smallint);
+ procedure MoveTo(X,Y: smallint);
 
 
  procedure SetDirectVideo(DirectAccess: boolean);
  procedure SetDirectVideo(DirectAccess: boolean);
  function GetDirectVideo: boolean;
  function GetDirectVideo: boolean;
@@ -633,19 +633,19 @@ Function GetDriverName: string;
  procedure SetAllPalette(var Palette:PaletteType);
  procedure SetAllPalette(var Palette:PaletteType);
  procedure SetPalette(ColorNum: word; Color: shortint);
  procedure SetPalette(ColorNum: word; Color: shortint);
  procedure GetPalette(var Palette: PaletteType);
  procedure GetPalette(var Palette: PaletteType);
- function GetPaletteSize: integer;
+ function GetPaletteSize: smallint;
  procedure GetDefaultPalette(var Palette: PaletteType);
  procedure GetDefaultPalette(var Palette: PaletteType);
 
 
 
 
  { -------------------- Shapes/Lines -------------------------------- }
  { -------------------- Shapes/Lines -------------------------------- }
- procedure Rectangle(x1,y1,x2,y2:integer);
- procedure Bar(x1,y1,x2,y2:integer);
- procedure Bar3D(x1, y1, x2, y2 : integer;depth : word;top : boolean);
+ procedure Rectangle(x1,y1,x2,y2:smallint);
+ procedure Bar(x1,y1,x2,y2:smallint);
+ procedure Bar3D(x1, y1, x2, y2 : smallint;depth : word;top : boolean);
  procedure FillPoly(NumPoints: word; Var PolyPoints);
  procedure FillPoly(NumPoints: word; Var PolyPoints);
  procedure DrawPoly(NumPoints : word;var polypoints);
  procedure DrawPoly(NumPoints : word;var polypoints);
- procedure LineRel(Dx, Dy: Integer);
- procedure LineTo(X,Y : Integer);
- procedure FloodFill(x : integer; y : integer; Border: word);
+ procedure LineRel(Dx, Dy: smallint);
+ procedure LineTo(X,Y : smallint);
+ procedure FloodFill(x : smallint; y : smallint; Border: word);
 
 
  { -------------------- Circle related routines --------------------- }
  { -------------------- Circle related routines --------------------- }
  procedure GetAspectRatio(var Xasp,Yasp : word);
  procedure GetAspectRatio(var Xasp,Yasp : word);
@@ -653,17 +653,17 @@ Function GetDriverName: string;
  procedure GetArcCoords(var ArcCoords: ArcCoordsType);
  procedure GetArcCoords(var ArcCoords: ArcCoordsType);
 
 
 
 
- procedure Arc(X,Y : Integer; StAngle,EndAngle,Radius: word);
- procedure PieSlice(X,Y,stangle,endAngle:integer;Radius: Word);
- procedure FillEllipse(X, Y: Integer; XRadius, YRadius: Word);
- procedure Circle(X, Y: Integer; Radius:Word);
- procedure Sector(x, y: Integer; StAngle,EndAngle, XRadius, YRadius: Word);
- procedure Ellipse(X,Y : Integer; stAngle, EndAngle: word; XRadius,
+ procedure Arc(X,Y : smallint; StAngle,EndAngle,Radius: word);
+ procedure PieSlice(X,Y,stangle,endAngle:smallint;Radius: Word);
+ procedure FillEllipse(X, Y: smallint; XRadius, YRadius: Word);
+ procedure Circle(X, Y: smallint; Radius:Word);
+ procedure Sector(x, y: smallint; StAngle,EndAngle, XRadius, YRadius: Word);
+ procedure Ellipse(X,Y : smallint; stAngle, EndAngle: word; XRadius,
    YRadius: word);
    YRadius: word);
 
 
  { --------------------- Text related routines --------------------- }
  { --------------------- Text related routines --------------------- }
- function  InstallUserFont(const FontFileName : string) : integer;
- function  RegisterBGIfont(font : pointer) : integer;
+ function  InstallUserFont(const FontFileName : string) : smallint;
+ function  RegisterBGIfont(font : pointer) : smallint;
  procedure GetTextSettings(var TextInfo : TextSettingsType);
  procedure GetTextSettings(var TextInfo : TextSettingsType);
  function  TextHeight(const TextString : string) : word;
  function  TextHeight(const TextString : string) : word;
  function  TextWidth(const TextString : string) : word;
  function  TextWidth(const TextString : string) : word;
@@ -671,7 +671,7 @@ Function GetDriverName: string;
  procedure SetTextStyle(font,direction : word;charsize : word);
  procedure SetTextStyle(font,direction : word;charsize : word);
  procedure SetUserCharSize(Multx,Divx,Multy,Divy : word);
  procedure SetUserCharSize(Multx,Divx,Multy,Divy : word);
 
 
- procedure OutTextXY(x,y : integer;const TextString : string);
+ procedure OutTextXY(x,y : smallint;const TextString : string);
  procedure OutText(const TextString : string);
  procedure OutText(const TextString : string);
 
 
 { Load extra graph additions per system like mode constants }
 { Load extra graph additions per system like mode constants }
@@ -729,7 +729,7 @@ const
 type
 type
 
 
 
 
-  tinttable = array[0..16383] of integer;
+  tinttable = array[0..16383] of smallint;
   pinttable = ^tinttable;
   pinttable = ^tinttable;
 
 
   WordArray = Array [0..StdbufferSize] Of word;
   WordArray = Array [0..StdbufferSize] Of word;
@@ -762,16 +762,16 @@ const
 var
 var
   CurrentColor:     Word;
   CurrentColor:     Word;
   CurrentBkColor: Word;
   CurrentBkColor: Word;
-  CurrentX : Integer;   { viewport relative }
-  CurrentY : Integer;   { viewport relative }
+  CurrentX : smallint;   { viewport relative }
+  CurrentY : smallint;   { viewport relative }
 
 
   ClipPixels: Boolean;  { Should cliiping be enabled }
   ClipPixels: Boolean;  { Should cliiping be enabled }
 
 
 
 
-  CurrentWriteMode: Integer;
+  CurrentWriteMode: smallint;
 
 
 
 
-  _GraphResult : Integer;
+  _GraphResult : smallint;
 
 
 
 
   LineInfo : LineSettingsType;
   LineInfo : LineSettingsType;
@@ -783,10 +783,10 @@ var
   installedfonts: longint;  { Number of installed fonts }
   installedfonts: longint;  { Number of installed fonts }
 
 
 
 
-  StartXViewPort: Integer; { absolute }
-  StartYViewPort: Integer; { absolute }
-  ViewWidth : Integer;
-  ViewHeight: Integer;
+  StartXViewPort: smallint; { absolute }
+  StartYViewPort: smallint; { absolute }
+  ViewWidth : smallint;
+  ViewHeight: smallint;
 
 
 
 
   IsGraphMode : Boolean; { Indicates if we are in graph mode or not }
   IsGraphMode : Boolean; { Indicates if we are in graph mode or not }
@@ -799,12 +799,12 @@ var
 
 
   { ******************** HARDWARE INFORMATION ********************* }
   { ******************** HARDWARE INFORMATION ********************* }
   { Should be set in InitGraph once only.                           }
   { Should be set in InitGraph once only.                           }
-  IntCurrentMode : Integer;
-  IntCurrentDriver : Integer;       { Currently loaded driver          }
-  XAspect : Integer;
-  YAspect : Integer;
-  MaxX : Integer;       { Maximum resolution - ABSOLUTE }
-  MaxY : Integer;       { Maximum resolution - ABSOLUTE }
+  IntCurrentMode : smallint;
+  IntCurrentDriver : smallint;       { Currently loaded driver          }
+  XAspect : smallint;
+  YAspect : smallint;
+  MaxX : smallint;       { Maximum resolution - ABSOLUTE }
+  MaxY : smallint;       { Maximum resolution - ABSOLUTE }
   MaxColor : Longint;
   MaxColor : Longint;
   PaletteSize : longint; { Maximum palette entry we can set, usually equal}
   PaletteSize : longint; { Maximum palette entry we can set, usually equal}
                          { maxcolor.                                      }
                          { maxcolor.                                      }
@@ -825,10 +825,10 @@ var
 
 
   {$i clip.inc}
   {$i clip.inc}
 
 
-  procedure HLineDefault(x,x2,y: integer); {$ifndef fpc}far;{$endif fpc}
+  procedure HLineDefault(x,x2,y: smallint); {$ifndef fpc}far;{$endif fpc}
 
 
    var
    var
-    xtmp: integer;
+    xtmp: smallint;
    Begin
    Begin
 
 
     { must we swap the values? }
     { must we swap the values? }
@@ -853,10 +853,10 @@ var
    end;
    end;
 
 
 
 
-  procedure VLineDefault(x,y,y2: integer); {$ifndef fpc}far;{$endif fpc}
+  procedure VLineDefault(x,y,y2: smallint); {$ifndef fpc}far;{$endif fpc}
 
 
    var
    var
-    ytmp: integer;
+    ytmp: smallint;
   Begin
   Begin
     { must we swap the values? }
     { must we swap the values? }
     if y >= y2 then
     if y >= y2 then
@@ -878,7 +878,7 @@ var
     for y := y to y2 do Directputpixel(x,y)
     for y := y to y2 do Directputpixel(x,y)
   End;
   End;
 
 
-  Procedure DirectPutPixelClip(x,y: Integer);
+  Procedure DirectPutPixelClip(x,y: smallint);
   { for thickwidth lines, because they may call DirectPutPixel for coords }
   { for thickwidth lines, because they may call DirectPutPixel for coords }
   { outside the current viewport (bug found by CEC)                       }
   { outside the current viewport (bug found by CEC)                       }
   Begin
   Begin
@@ -890,22 +890,22 @@ var
       End
       End
   End;
   End;
 
 
-  procedure LineDefault(X1, Y1, X2, Y2: Integer); {$ifndef fpc}far;{$endif fpc}
+  procedure LineDefault(X1, Y1, X2, Y2: smallint); {$ifndef fpc}far;{$endif fpc}
 
 
-  var X, Y :           Integer;
-      deltax, deltay : Integer;
-      d, dinc1, dinc2: Integer;
-      xinc1          : Integer;
-      xinc2          : Integer;
-      yinc1          : Integer;
-      yinc2          : Integer;
-      i              : Integer;
+  var X, Y :           smallint;
+      deltax, deltay : smallint;
+      d, dinc1, dinc2: smallint;
+      xinc1          : smallint;
+      xinc2          : smallint;
+      yinc1          : smallint;
+      yinc2          : smallint;
+      i              : smallint;
       Flag           : Boolean; { determines pixel direction in thick lines }
       Flag           : Boolean; { determines pixel direction in thick lines }
-      NumPixels      : Integer;
-      PixelCount     : Integer;
+      NumPixels      : smallint;
+      PixelCount     : smallint;
       OldCurrentColor: Word;
       OldCurrentColor: Word;
-      swtmp          : integer;
-      TmpNumPixels   : integer;
+      swtmp          : smallint;
+      TmpNumPixels   : smallint;
  begin
  begin
 {******************************************}
 {******************************************}
 {  SOLID LINES                             }
 {  SOLID LINES                             }
@@ -1303,7 +1303,7 @@ var
   { can be passed as a patternlineproc for non-filled      }
   { can be passed as a patternlineproc for non-filled      }
   { ellipses                                               }
   { ellipses                                               }
   {********************************************************}
   {********************************************************}
-  Procedure DummyPatternLine(x1, x2, y: integer); {$ifdef tp} far; {$endif tp}
+  Procedure DummyPatternLine(x1, x2, y: smallint); {$ifdef tp} far; {$endif tp}
   begin
   begin
   end;
   end;
 
 
@@ -1329,7 +1329,7 @@ var
   {       -                                                }
   {       -                                                }
   {********************************************************}
   {********************************************************}
 
 
-  Procedure InternalEllipseDefault(X,Y: Integer;XRadius: word;
+  Procedure InternalEllipseDefault(X,Y: smallint;XRadius: word;
     YRadius:word; stAngle,EndAngle: word; pl: PatternLineProc); {$ifndef fpc}far;{$endif fpc}
     YRadius:word; stAngle,EndAngle: word; pl: PatternLineProc); {$ifndef fpc}far;{$endif fpc}
    Const ConvFac = Pi/180.0;
    Const ConvFac = Pi/180.0;
 
 
@@ -1338,7 +1338,7 @@ var
     NumOfPixels: longint;
     NumOfPixels: longint;
     TempTerm: graph_float;
     TempTerm: graph_float;
     xtemp, ytemp, xp, yp, xm, ym, xnext, ynext,
     xtemp, ytemp, xp, yp, xm, ym, xnext, ynext,
-      plxpyp, plxmyp, plxpym, plxmym: integer;
+      plxpyp, plxmyp, plxpym, plxmym: smallint;
     BackupColor, DeltaAngle, TmpAngle, OldLineWidth: word;
     BackupColor, DeltaAngle, TmpAngle, OldLineWidth: word;
   Begin
   Begin
    If LineInfo.ThickNess = ThickWidth Then
    If LineInfo.ThickNess = ThickWidth Then
@@ -1432,10 +1432,10 @@ var
      xm := x - xtemp;
      xm := x - xtemp;
      yp := y + ytemp;
      yp := y + ytemp;
      ym := y - ytemp;
      ym := y - ytemp;
-     plxpyp := maxint;
-     plxmyp := -maxint-1;
-     plxpym := maxint;
-     plxmym := -maxint-1;
+     plxpyp := maxsmallint;
+     plxmyp := -maxsmallint-1;
+     plxpym := maxsmallint;
+     plxmym := -maxsmallint-1;
      If (j >= StAngle) and (j <= EndAngle) then
      If (j >= StAngle) and (j <= EndAngle) then
        begin
        begin
          plxpyp := xp;
          plxpyp := xp;
@@ -1487,14 +1487,14 @@ var
   {       - Angles must both be between 0 and 360          }
   {       - Angles must both be between 0 and 360          }
   {********************************************************}
   {********************************************************}
 (*
 (*
-Procedure InternalEllipseDefault (x, y : integer;
+Procedure InternalEllipseDefault (x, y : smallint;
     xradius, yradius, stAngle, EndAngle : Word; pl: PatternLineProc); {$ifndef fpc} far; {$endif fpc}
     xradius, yradius, stAngle, EndAngle : Word; pl: PatternLineProc); {$ifndef fpc} far; {$endif fpc}
 { Draw an ellipse arc. Crude but it works (anyone have a better one?) }
 { Draw an ellipse arc. Crude but it works (anyone have a better one?) }
 Var
 Var
   aSqr, bSqr, twoaSqr, twobSqr, xa, ya, twoXbSqr, twoYaSqr, error : LongInt;
   aSqr, bSqr, twoaSqr, twobSqr, xa, ya, twoXbSqr, twoYaSqr, error : LongInt;
   Alpha, TempTerm : graph_float;
   Alpha, TempTerm : graph_float;
   BackupColor: Word;
   BackupColor: Word;
-  plxpyp, plxmyp, plxpym, plxmym: integer;
+  plxpyp, plxmyp, plxpym, plxmym: smallint;
 const
 const
   RadToDeg = 180/Pi;
   RadToDeg = 180/Pi;
 
 
@@ -1502,18 +1502,18 @@ const
 Procedure PlotPoints;
 Procedure PlotPoints;
 
 
 var
 var
- i,j: integer;
- xm, ym: integer;
- xp, yp: integer;
+ i,j: smallint;
+ xm, ym: smallint;
+ xp, yp: smallint;
 Begin
 Begin
    ym := y-ya;
    ym := y-ya;
    yp := y+ya;
    yp := y+ya;
    xm := x-xa;
    xm := x-xa;
    xp := x+xa;
    xp := x+xa;
-   plxpyp := maxint;
-   plxmyp := -maxint-1;
-   plxpym := maxint;
-   plxmym := -maxint-1;
+   plxpyp := maxsmallint;
+   plxmyp := -maxsmallint-1;
+   plxpym := maxsmallint;
+   plxmym := -maxsmallint-1;
    if LineInfo.Thickness = Normwidth then
    if LineInfo.Thickness = Normwidth then
      Begin
      Begin
        If (Alpha+270>=StAngle) And (Alpha+270<=EndAngle) then
        If (Alpha+270>=StAngle) And (Alpha+270<=EndAngle) then
@@ -1655,7 +1655,7 @@ Begin
   End;
   End;
 End;
 End;
 *)
 *)
-  procedure PatternLineDefault(x1,x2,y: integer); {$ifndef fpc}far;{$endif fpc}
+  procedure PatternLineDefault(x1,x2,y: smallint); {$ifndef fpc}far;{$endif fpc}
   {********************************************************}
   {********************************************************}
   { Draws a horizontal patterned line according to the     }
   { Draws a horizontal patterned line according to the     }
   { current Fill Settings.                                 }
   { current Fill Settings.                                 }
@@ -1665,9 +1665,9 @@ End;
   {    this routine.                                       }
   {    this routine.                                       }
   {********************************************************}
   {********************************************************}
    var
    var
-    NrIterations: Integer;
-    i           : Integer;
-    j           : Integer;
+    NrIterations: smallint;
+    i           : smallint;
+    j           : smallint;
     TmpFillPattern : byte;
     TmpFillPattern : byte;
     OldWriteMode : word;
     OldWriteMode : word;
     OldCurrentColor : word;
     OldCurrentColor : word;
@@ -1741,7 +1741,7 @@ End;
 
 
 
 
 
 
-  procedure LineRel(Dx, Dy: Integer);
+  procedure LineRel(Dx, Dy: smallint);
 
 
    Begin
    Begin
      Line(CurrentX, CurrentY, CurrentX + Dx, CurrentY + Dy);
      Line(CurrentX, CurrentY, CurrentX + Dx, CurrentY + Dy);
@@ -1750,7 +1750,7 @@ End;
    end;
    end;
 
 
 
 
-  procedure LineTo(x,y : Integer);
+  procedure LineTo(x,y : smallint);
 
 
    Begin
    Begin
      Line(CurrentX, CurrentY, X, Y);
      Line(CurrentX, CurrentY, X, Y);
@@ -1761,7 +1761,7 @@ End;
 
 
 
 
 
 
-  procedure Rectangle(x1,y1,x2,y2:integer);
+  procedure Rectangle(x1,y1,x2,y2:smallint);
 
 
    begin
    begin
      { Do not draw the end points }
      { Do not draw the end points }
@@ -1825,7 +1825,7 @@ End;
 
 
 Procedure ClearViewPortDefault; {$ifndef fpc}far;{$endif fpc}
 Procedure ClearViewPortDefault; {$ifndef fpc}far;{$endif fpc}
 var
 var
- j: integer;
+ j: smallint;
  OldWriteMode, OldCurColor: word;
  OldWriteMode, OldCurColor: word;
  LineSets : LineSettingsType;
  LineSets : LineSettingsType;
 Begin
 Begin
@@ -1852,7 +1852,7 @@ Begin
 end;
 end;
 
 
 
 
-Procedure SetViewPort(X1, Y1, X2, Y2: Integer; Clip: Boolean);
+Procedure SetViewPort(X1, Y1, X2, Y2: smallint; Clip: Boolean);
 Begin
 Begin
   if (X1 > GetMaxX) or (X2 > GetMaxX) or (X1 > X2) or (X1 < 0) then
   if (X1 > GetMaxX) or (X2 > GetMaxX) or (X1 > X2) or (X1 < 0) then
   Begin
   Begin
@@ -1921,7 +1921,7 @@ end;
 {--------------------------------------------------------------------------}
 {--------------------------------------------------------------------------}
 
 
 
 
-  Procedure GetScanlineDefault (X1, X2, Y : Integer; Var Data); {$ifndef fpc}far;{$endif fpc}
+  Procedure GetScanlineDefault (X1, X2, Y : smallint; Var Data); {$ifndef fpc}far;{$endif fpc}
   {**********************************************************}
   {**********************************************************}
   { Procedure GetScanLine()                                  }
   { Procedure GetScanLine()                                  }
   {----------------------------------------------------------}
   {----------------------------------------------------------}
@@ -1935,7 +1935,7 @@ end;
 
 
 
 
   Var
   Var
-    x : Integer;
+    x : smallint;
   Begin
   Begin
      For x:=X1 to X2 Do
      For x:=X1 to X2 Do
        WordArray(Data)[x-x1]:=GetPixel(x, y);
        WordArray(Data)[x-x1]:=GetPixel(x, y);
@@ -1943,21 +1943,21 @@ end;
 
 
 
 
 
 
-Function DefaultImageSize(X1,Y1,X2,Y2: Integer): longint; {$ifndef fpc}far;{$endif fpc}
+Function DefaultImageSize(X1,Y1,X2,Y2: smallint): longint; {$ifndef fpc}far;{$endif fpc}
 Begin
 Begin
   { each pixel uses two bytes, to enable modes with colors up to 64K }
   { each pixel uses two bytes, to enable modes with colors up to 64K }
   { to work.                                                         }
   { to work.                                                         }
   DefaultImageSize := 12 + (((X2-X1+1)*(Y2-Y1+1))*2);
   DefaultImageSize := 12 + (((X2-X1+1)*(Y2-Y1+1))*2);
 end;
 end;
 
 
-Procedure DefaultPutImage(X,Y: Integer; var Bitmap; BitBlt: Word); {$ifndef fpc}far;{$endif fpc}
+Procedure DefaultPutImage(X,Y: smallint; var Bitmap; BitBlt: Word); {$ifndef fpc}far;{$endif fpc}
 type
 type
   pt = array[0..$fffffff] of word;
   pt = array[0..$fffffff] of word;
   ptw = array[0..2] of longint;
   ptw = array[0..2] of longint;
 var
 var
   k: longint;
   k: longint;
   oldCurrentColor, color: word;
   oldCurrentColor, color: word;
-  oldCurrentWriteMode, i, j, y1, x1, deltaX, deltaX1, deltaY: Integer;
+  oldCurrentWriteMode, i, j, y1, x1, deltaX, deltaX1, deltaY: smallint;
 Begin
 Begin
 {$ifdef logging}
 {$ifdef logging}
   LogLn('putImage at ('+strf(x)+','+strf(y)+') with width '+strf(ptw(Bitmap)[0])+
   LogLn('putImage at ('+strf(x)+','+strf(y)+') with width '+strf(ptw(Bitmap)[0])+
@@ -2015,12 +2015,12 @@ Begin
   currentColor := oldCurrentColor;
   currentColor := oldCurrentColor;
 end;
 end;
 
 
-Procedure DefaultGetImage(X1,Y1,X2,Y2: Integer; Var Bitmap); {$ifndef fpc}far;{$endif fpc}
+Procedure DefaultGetImage(X1,Y1,X2,Y2: smallint; Var Bitmap); {$ifndef fpc}far;{$endif fpc}
 type
 type
   pt = array[0..$fffffff] of word;
   pt = array[0..$fffffff] of word;
   ptw = array[0..2] of longint;
   ptw = array[0..2] of longint;
 var
 var
-  i,j: integer;
+  i,j: smallint;
   k: longint;
   k: longint;
 Begin
 Begin
   k:= 3 * Sizeof(longint) div sizeof(word); { Three reserved longs at start of bitmap }
   k:= 3 * Sizeof(longint) div sizeof(word); { Three reserved longs at start of bitmap }
@@ -2060,29 +2060,29 @@ end;
    begin
    begin
    end;
    end;
 
 
-  procedure DirectPutPixelDefault(X,Y: Integer);
+  procedure DirectPutPixelDefault(X,Y: smallint);
    begin
    begin
      RunError(218);
      RunError(218);
    end;
    end;
 
 
-  function GetPixelDefault(X,Y: Integer): word;
+  function GetPixelDefault(X,Y: smallint): word;
    begin
    begin
      RunError(218);
      RunError(218);
      exit(0); { avoid warning }
      exit(0); { avoid warning }
    end;
    end;
 
 
-  procedure PutPixelDefault(X,Y: Integer; Color: Word);
+  procedure PutPixelDefault(X,Y: smallint; Color: Word);
    begin
    begin
      RunError(218);
      RunError(218);
    end;
    end;
 
 
-  procedure SetRGBPaletteDefault(ColorNum, RedValue, GreenValue, BlueValue: Integer);
+  procedure SetRGBPaletteDefault(ColorNum, RedValue, GreenValue, BlueValue: smallint);
    begin
    begin
      RunError(218);
      RunError(218);
    end;
    end;
 
 
-  procedure GetRGBPaletteDefault(ColorNum: integer; var
-            RedValue, GreenValue, BlueValue: Integer);
+  procedure GetRGBPaletteDefault(ColorNum: smallint; var
+            RedValue, GreenValue, BlueValue: smallint);
    begin
    begin
      RunError(218);
      RunError(218);
    end;
    end;
@@ -2183,13 +2183,13 @@ end;
 {$i palette.inc}
 {$i palette.inc}
 {$i graph.inc}
 {$i graph.inc}
 
 
-  function InstallUserDriver(Name: string; AutoDetectPtr: Pointer): integer;
+  function InstallUserDriver(Name: string; AutoDetectPtr: Pointer): smallint;
    begin
    begin
      _graphResult := grError;
      _graphResult := grError;
      InstallUserDriver:=grError;
      InstallUserDriver:=grError;
    end;
    end;
 
 
-  function RegisterBGIDriver(driver: pointer): integer;
+  function RegisterBGIDriver(driver: pointer): smallint;
 
 
    begin
    begin
      _graphResult := grError;
      _graphResult := grError;
@@ -2201,7 +2201,7 @@ end;
 { ----------------------------------------------------------------- }
 { ----------------------------------------------------------------- }
 
 
 
 
-  Procedure Arc(X,Y : Integer; StAngle,EndAngle,Radius: word);
+  Procedure Arc(X,Y : smallint; StAngle,EndAngle,Radius: word);
 
 
 {   var
 {   var
     OldWriteMode: word;}
     OldWriteMode: word;}
@@ -2221,7 +2221,7 @@ end;
    end;
    end;
 
 
 
 
- procedure Ellipse(X,Y : Integer; stAngle, EndAngle: word; XRadius,YRadius: word);
+ procedure Ellipse(X,Y : smallint; stAngle, EndAngle: word; XRadius,YRadius: word);
   Begin
   Begin
 {$ifdef fpc}
 {$ifdef fpc}
      InternalEllipse(X,Y,XRadius,YRadius,StAngle,Endangle,@DummyPatternLine);
      InternalEllipse(X,Y,XRadius,YRadius,StAngle,Endangle,@DummyPatternLine);
@@ -2231,7 +2231,7 @@ end;
   end;
   end;
 
 
 
 
- procedure FillEllipse(X, Y: Integer; XRadius, YRadius: Word);
+ procedure FillEllipse(X, Y: smallint; XRadius, YRadius: Word);
   {********************************************************}
   {********************************************************}
   { Procedure FillEllipse()                                }
   { Procedure FillEllipse()                                }
   {--------------------------------------------------------}
   {--------------------------------------------------------}
@@ -2246,7 +2246,7 @@ end;
 
 
 
 
 
 
- procedure Circle(X, Y: Integer; Radius:Word);
+ procedure Circle(X, Y: smallint; Radius:Word);
   {********************************************************}
   {********************************************************}
   { Draws a circle centered at X,Y with the given Radius.  }
   { Draws a circle centered at X,Y with the given Radius.  }
   {********************************************************}
   {********************************************************}
@@ -2289,8 +2289,8 @@ end;
      move(OriginalArcInfo, ArcCall,sizeof(ArcCall));
      move(OriginalArcInfo, ArcCall,sizeof(ArcCall));
  end;
  end;
 
 
- procedure SectorPL(x1,x2,y: Integer); {$ifndef fpc}far;{$endif fpc}
- var plx1, plx2: integer;
+ procedure SectorPL(x1,x2,y: smallint); {$ifndef fpc}far;{$endif fpc}
+ var plx1, plx2: smallint;
 {$ifdef sectorpldebug}
 {$ifdef sectorpldebug}
      t : text;
      t : text;
 {$endif sectorpldebug}
 {$endif sectorpldebug}
@@ -2301,8 +2301,8 @@ end;
    writeln(t,'Got here for line ',y);
    writeln(t,'Got here for line ',y);
    close(t);
    close(t);
 {$endif sectorpldebug}
 {$endif sectorpldebug}
-   If (x1 = -maxint) Then
-     If (x2 = maxint-1) Then
+   If (x1 = -maxsmallint) Then
+     If (x2 = maxsmallint-1) Then
        { no ellipse points drawn on this line }
        { no ellipse points drawn on this line }
        If (((Y < ArcCall.Y) and (Y > ArcCall.YStart)) or
        If (((Y < ArcCall.Y) and (Y > ArcCall.YStart)) or
           ((Y > ArcCall.Y) and (Y < ArcCall.YStart))) Then
           ((Y > ArcCall.Y) and (Y < ArcCall.YStart))) Then
@@ -2391,7 +2391,7 @@ end;
 {$endif sectorpldebug}
 {$endif sectorpldebug}
        End
        End
    Else
    Else
-     If (x2 = maxint-1) Then
+     If (x2 = maxsmallint-1) Then
        { the arc is plotted at the left side, but not at the rigth side.   }
        { the arc is plotted at the left side, but not at the rigth side.   }
        { the right limit can be either the first or second line. Just take }
        { the right limit can be either the first or second line. Just take }
        { the closest one, but watch out for division by zero!              }
        { the closest one, but watch out for division by zero!              }
@@ -2454,7 +2454,7 @@ end;
      end;
      end;
  end;
  end;
 
 
- procedure Sector(x, y: Integer; StAngle,EndAngle, XRadius, YRadius: Word);
+ procedure Sector(x, y: smallint; StAngle,EndAngle, XRadius, YRadius: Word);
 (*  var angle : graph_float;
 (*  var angle : graph_float;
       writemode : word; *)
       writemode : word; *)
   begin
   begin
@@ -2492,7 +2492,7 @@ end;
   { it can still be used with SetFillStyle(UserFill,Color) }
   { it can still be used with SetFillStyle(UserFill,Color) }
   {********************************************************}
   {********************************************************}
    var
    var
-    i: integer;
+    i: smallint;
 
 
    begin
    begin
      if Color > GetMaxColor then
      if Color > GetMaxColor then
@@ -2510,16 +2510,16 @@ end;
 
 
    end;
    end;
 
 
-  procedure Bar(x1,y1,x2,y2:integer);
+  procedure Bar(x1,y1,x2,y2:smallint);
   {********************************************************}
   {********************************************************}
   { Important notes for compatibility with BP:             }
   { Important notes for compatibility with BP:             }
   {     - WriteMode is always CopyPut                      }
   {     - WriteMode is always CopyPut                      }
   {     - No contour is drawn for the lines                }
   {     - No contour is drawn for the lines                }
   {********************************************************}
   {********************************************************}
-  var y               : Integer;
+  var y               : smallint;
       origcolor       : longint;
       origcolor       : longint;
       origlinesettings: Linesettingstype;
       origlinesettings: Linesettingstype;
-      origwritemode   : Integer;
+      origwritemode   : smallint;
    begin
    begin
      origlinesettings:=lineinfo;
      origlinesettings:=lineinfo;
      origcolor:=CurrentColor;
      origcolor:=CurrentColor;
@@ -2566,10 +2566,10 @@ end;
 
 
 
 
 
 
-procedure bar3D(x1, y1, x2, y2 : integer;depth : word;top : boolean);
+procedure bar3D(x1, y1, x2, y2 : smallint;depth : word;top : boolean);
 var
 var
- origwritemode : integer;
- OldX, OldY : integer;
+ origwritemode : smallint;
+ OldX, OldY : smallint;
 begin
 begin
   origwritemode := CurrentWriteMode;
   origwritemode := CurrentWriteMode;
   CurrentWriteMode := CopyPut;
   CurrentWriteMode := CopyPut;
@@ -2661,13 +2661,13 @@ end;
 
 
 
 
 
 
-   Procedure MoveRel(Dx, Dy: Integer);
+   Procedure MoveRel(Dx, Dy: smallint);
     Begin
     Begin
      CurrentX := CurrentX + Dx;
      CurrentX := CurrentX + Dx;
      CurrentY := CurrentY + Dy;
      CurrentY := CurrentY + Dy;
    end;
    end;
 
 
-   Procedure MoveTo(X,Y: Integer);
+   Procedure MoveTo(X,Y: smallint);
   {********************************************************}
   {********************************************************}
   { Procedure MoveTo()                                     }
   { Procedure MoveTo()                                     }
   {--------------------------------------------------------}
   {--------------------------------------------------------}
@@ -2680,7 +2680,7 @@ end;
     end;
     end;
 
 
 
 
-function GraphErrorMsg(ErrorCode: Integer): string;
+function GraphErrorMsg(ErrorCode: smallint): string;
 Begin
 Begin
  GraphErrorMsg:='';
  GraphErrorMsg:='';
  case ErrorCode of
  case ErrorCode of
@@ -2701,13 +2701,13 @@ end;
 
 
 
 
 
 
-  Function GetMaxX: Integer;
+  Function GetMaxX: smallint;
   { Routine checked against VGA driver - CEC }
   { Routine checked against VGA driver - CEC }
    Begin
    Begin
      GetMaxX := MaxX;
      GetMaxX := MaxX;
    end;
    end;
 
 
-  Function GetMaxY: Integer;
+  Function GetMaxY: smallint;
   { Routine checked against VGA driver - CEC }
   { Routine checked against VGA driver - CEC }
    Begin
    Begin
     GetMaxY := MaxY;
     GetMaxY := MaxY;
@@ -2716,20 +2716,20 @@ end;
 
 
 
 
 
 
-Function GraphResult: Integer;
+Function GraphResult: smallint;
 Begin
 Begin
   GraphResult := _GraphResult;
   GraphResult := _GraphResult;
   _GraphResult := grOk;
   _GraphResult := grOk;
 end;
 end;
 
 
 
 
-  Function GetX: Integer;
+  Function GetX: smallint;
    Begin
    Begin
      GetX := CurrentX;
      GetX := CurrentX;
    end;
    end;
 
 
 
 
-  Function GetY: Integer;
+  Function GetY: smallint;
    Begin
    Begin
      GetY := CurrentY;
      GetY := CurrentY;
    end;
    end;
@@ -2746,7 +2746,7 @@ end;
    { returned values even if GraphDefaults is called in    }
    { returned values even if GraphDefaults is called in    }
    { between.                                              }
    { between.                                              }
     var
     var
-     i: integer;
+     i: smallint;
    begin
    begin
      lineinfo.linestyle:=solidln;
      lineinfo.linestyle:=solidln;
      lineinfo.thickness:=normwidth;
      lineinfo.thickness:=normwidth;
@@ -2806,7 +2806,7 @@ end;
   end;
   end;
 
 
 
 
-  procedure SetWriteMode(WriteMode : integer);
+  procedure SetWriteMode(WriteMode : smallint);
   { TP sets the writemodes according to the following scheme (JM) }
   { TP sets the writemodes according to the following scheme (JM) }
    begin
    begin
      Case writemode of
      Case writemode of
@@ -2854,7 +2854,7 @@ end;
     end;
     end;
 
 
 
 
-  procedure PieSlice(X,Y,stangle,endAngle:integer;Radius: Word);
+  procedure PieSlice(X,Y,stangle,endAngle:smallint;Radius: Word);
   begin
   begin
     Sector(x,y,stangle,endangle,radius,radius);
     Sector(x,y,stangle,endangle,radius,radius);
   end;
   end;
@@ -2863,10 +2863,10 @@ end;
 {$i gtext.inc}
 {$i gtext.inc}
 
 
 
 
-  procedure DetectGraph(var GraphDriver:Integer;var GraphMode:Integer);
-  var LoMode, HiMode: Integer;
-      CpyMode: Integer;
-      CpyDriver: Integer;
+  procedure DetectGraph(var GraphDriver:smallint;var GraphMode:smallint);
+  var LoMode, HiMode: smallint;
+      CpyMode: smallint;
+      CpyDriver: smallint;
   begin
   begin
     HiMode := -1;
     HiMode := -1;
     LoMode := -1;
     LoMode := -1;
@@ -2896,7 +2896,7 @@ end;
     GraphMode := CpyMode;
     GraphMode := CpyMode;
   end;
   end;
 
 
-  procedure InitGraph(var GraphDriver:Integer;var GraphMode:Integer;
+  procedure InitGraph(var GraphDriver:smallint;var GraphMode:smallint;
     const PathToDriver:String);
     const PathToDriver:String);
   begin
   begin
     InitVars;
     InitVars;
@@ -3034,7 +3034,10 @@ SetGraphBufSize
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.47  1999-12-12 13:34:20  jonas
+  Revision 1.48  1999-12-20 11:22:36  peter
+    * integer -> smallint to overcome -S2 switch needed for ggi version
+
+  Revision 1.47  1999/12/12 13:34:20  jonas
     * putimage now performs the lipping itself and uses directputpixel
     * putimage now performs the lipping itself and uses directputpixel
       (note: this REQUIRES or/and/notput support in directputpixel,
       (note: this REQUIRES or/and/notput support in directputpixel,
       this is not yet the case in the assembler versions!)
       this is not yet the case in the assembler versions!)
@@ -3043,7 +3046,7 @@ SetGraphBufSize
 
 
   Revision 1.46  1999/12/11 23:41:38  jonas
   Revision 1.46  1999/12/11 23:41:38  jonas
     * changed definition of getscanlineproc to "getscanline(x1,x2,y:
     * changed definition of getscanlineproc to "getscanline(x1,x2,y:
-      integer; var data);" so it can be used by getimage too
+      smallint; var data);" so it can be used by getimage too
     * changed getimage so it uses getscanline
     * changed getimage so it uses getscanline
     * changed floodfill, getscanline16 and definitions in Linux
     * changed floodfill, getscanline16 and definitions in Linux
       include files so they use this new format
       include files so they use this new format
@@ -3071,7 +3074,7 @@ SetGraphBufSize
    * memory corruption within GetImage removed
    * memory corruption within GetImage removed
 
 
   Revision 1.39  1999/11/24 23:42:31  pierre
   Revision 1.39  1999/11/24 23:42:31  pierre
-    * PutImage used an integer index that became negative !!!!
+    * PutImage used an smallint index that became negative !!!!
     * Default needed procedure now genrate a RTE 218 instead of a
     * Default needed procedure now genrate a RTE 218 instead of a
       GPF by call to nil pointer !
       GPF by call to nil pointer !
 
 

+ 45 - 45
rtl/inc/graph/graph.tex

@@ -310,7 +310,7 @@ are also possible for those who wish to optimize the speed of the unit.
 -------------------------------------------------------------
 -------------------------------------------------------------
 \begin{function}{GetModeName}
 \begin{function}{GetModeName}
 \Declaration
 \Declaration
-Function GetModeName (ModeNumber : Integer) : String;
+Function GetModeName (ModeNumber : smallint) : String;
 
 
 \Description
 \Description
 
 
@@ -430,7 +430,7 @@ None.
 ---------------------------
 ---------------------------
 \begin{procedure}{GetRGBPalette}
 \begin{procedure}{GetRGBPalette}
 \Declaration
 \Declaration
-Procedure GetRGBPalette (ColorNum: intege; var Red,Green,Blue : Integer);
+Procedure GetRGBPalette (ColorNum: intege; var Red,Green,Blue : smallint);
 
 
 \Description
 \Description
 \var{GetRGBPalette} gets the \var{ColorNum}-th entry in the palette.
 \var{GetRGBPalette} gets the \var{ColorNum}-th entry in the palette.
@@ -522,7 +522,7 @@ None.
 \subsection{Types}
 \subsection{Types}
 \begin{verbatim}
 \begin{verbatim}
 ArcCoordsType = record
 ArcCoordsType = record
- X,Y,Xstart,Ystart,Xend,Yend : Integer;
+ X,Y,Xstart,Ystart,Xend,Yend : smallint;
 end;
 end;
 FillPatternType = Array [1..8] of Byte;
 FillPatternType = Array [1..8] of Byte;
 FillSettingsType = Record
 FillSettingsType = Record
@@ -535,13 +535,13 @@ end;
 
 
 
 
 PointType = Record
 PointType = Record
-  X,Y : Integer;
+  X,Y : smallint;
 end;
 end;
 TextSettingsType = Record
 TextSettingsType = Record
  Font,Direction, CharSize, Horiz, Vert : Word
  Font,Direction, CharSize, Horiz, Vert : Word
 end;
 end;
 ViewPortType = Record
 ViewPortType = Record
-  X1,Y1,X2,Y2 : Integer;
+  X1,Y1,X2,Y2 : smallint;
   Clip : Boolean
   Clip : Boolean
 end;
 end;
 \end{verbatim}
 \end{verbatim}
@@ -566,7 +566,7 @@ across different hardware platforms.
 
 
 \begin{procedure}{Arc}
 \begin{procedure}{Arc}
 \Declaration
 \Declaration
-Procedure Arc (X,Y : Integer; stAngle,Endangle, radius : Word);
+Procedure Arc (X,Y : smallint; stAngle,Endangle, radius : Word);
 
 
 \Description
 \Description
  \var{Arc} draws part of a circle with center at \var{(X,Y)}, radius
  \var{Arc} draws part of a circle with center at \var{(X,Y)}, radius
@@ -582,7 +582,7 @@ None.
 
 
 \begin{procedure}{Bar}
 \begin{procedure}{Bar}
 \Declaration
 \Declaration
-Procedure Bar (X1,Y1,X2,Y2 : Integer);
+Procedure Bar (X1,Y1,X2,Y2 : smallint);
 
 
 \Description
 \Description
 Draws a rectangle with corners at \var{(X1,Y1)} and \var{(X2,Y2)}
 Draws a rectangle with corners at \var{(X1,Y1)} and \var{(X2,Y2)}
@@ -596,7 +596,7 @@ None.
 
 
 \begin{procedure}{Bar3D}
 \begin{procedure}{Bar3D}
 \Declaration
 \Declaration
-Procedure Bar3D (X1,Y1,X2,Y2 : Integer; depth : Word; Top : Boolean);
+Procedure Bar3D (X1,Y1,X2,Y2 : smallint; depth : Word; Top : Boolean);
 
 
 \Description
 \Description
 Draws a 3-dimensional Bar  with corners at \var{(X1,Y1)} and \var{(X2,Y2)}
 Draws a 3-dimensional Bar  with corners at \var{(X1,Y1)} and \var{(X2,Y2)}
@@ -612,7 +612,7 @@ None.
 
 
 \begin{procedure}{Circle}
 \begin{procedure}{Circle}
 \Declaration
 \Declaration
-Procedure Circle (X,Y : Integer; Radius : Word);
+Procedure Circle (X,Y : smallint; Radius : Word);
 
 
 \Description
 \Description
  \var{Circle} draws part of a circle with center at \var{(X,Y)}, radius
  \var{Circle} draws part of a circle with center at \var{(X,Y)}, radius
@@ -667,7 +667,7 @@ None.
 
 
 \begin{procedure}{DetectGraph}
 \begin{procedure}{DetectGraph}
 \Declaration
 \Declaration
-Procedure DetectGraph (Var Driver, Modus : Integer);
+Procedure DetectGraph (Var Driver, Modus : smallint);
 
 
 \Description
 \Description
  Checks the hardware in the PC and determines the driver and screen-modus to
  Checks the hardware in the PC and determines the driver and screen-modus to
@@ -701,7 +701,7 @@ None.
 
 
 \begin{procedure}{Ellipse}
 \begin{procedure}{Ellipse}
 \Declaration
 \Declaration
-Procedure Ellipse (X,Y : Integer; StAngle,EndAngle,XRadius,YRadius : Word);
+Procedure Ellipse (X,Y : smallint; StAngle,EndAngle,XRadius,YRadius : Word);
 
 
 \Description
 \Description
  \var{Ellipse} draws part of an ellipse with center at \var{(X,Y)}.
  \var{Ellipse} draws part of an ellipse with center at \var{(X,Y)}.
@@ -719,7 +719,7 @@ None.
 \end{procedure}
 \end{procedure}
 \begin{procedure}{FillEllipse}
 \begin{procedure}{FillEllipse}
 \Declaration
 \Declaration
-Procedure FillEllipse (X,Y : Integer; Xradius,YRadius: Word);
+Procedure FillEllipse (X,Y : smallint; Xradius,YRadius: Word);
 
 
 \Description
 \Description
  \var{Ellipse} draws an ellipse with center at \var{(X,Y)}.
  \var{Ellipse} draws an ellipse with center at \var{(X,Y)}.
@@ -750,7 +750,7 @@ None.
 \end{procedure}
 \end{procedure}
 \begin{procedure}{FloodFill}
 \begin{procedure}{FloodFill}
 \Declaration
 \Declaration
-Procedure FloodFill (X,Y : Integer; BorderColor : Word);
+Procedure FloodFill (X,Y : smallint; BorderColor : Word);
 
 
 \Description
 \Description
 
 
@@ -846,7 +846,7 @@ None.
 
 
 \begin{function}{GetGraphMode}
 \begin{function}{GetGraphMode}
 \Declaration
 \Declaration
-Function GetGraphMode  : Integer;
+Function GetGraphMode  : smallint;
 
 
 \Description
 \Description
 \var{GetGraphMode} returns the current graphical mode. This value is
 \var{GetGraphMode} returns the current graphical mode. This value is
@@ -862,7 +862,7 @@ None.
 
 
 \begin{procedure}{GetImage}
 \begin{procedure}{GetImage}
 \Declaration
 \Declaration
-Procedure GetImage (X1,Y1,X2,Y2 : Integer, Var Bitmap);
+Procedure GetImage (X1,Y1,X2,Y2 : smallint, Var Bitmap);
 
 
 \Description
 \Description
 \var{GetImage}
 \var{GetImage}
@@ -954,7 +954,7 @@ None.
 
 
 \begin{procedure}{GetModeRange}
 \begin{procedure}{GetModeRange}
 \Declaration
 \Declaration
-Procedure GetModeRange (GraphDriver : Integer; var LoMode, HiMode: Integer);
+Procedure GetModeRange (GraphDriver : smallint; var LoMode, HiMode: smallint);
 
 
 \Description
 \Description
 \var{GetModeRange} returns the Lowest and Highest mode of the currently
 \var{GetModeRange} returns the Lowest and Highest mode of the currently
@@ -985,7 +985,7 @@ None.
 \end{function}
 \end{function}
 \begin{function}{GetPixel}
 \begin{function}{GetPixel}
 \Declaration
 \Declaration
-Function GetPixel (X,Y : Integer) : Word;
+Function GetPixel (X,Y : smallint) : Word;
 
 
 \Description
 \Description
 \var{GetPixel} returns the color
 \var{GetPixel} returns the color
@@ -1029,7 +1029,7 @@ None.
 
 
 \begin{function}{GetX}
 \begin{function}{GetX}
 \Declaration
 \Declaration
-Function GetX  : Integer;
+Function GetX  : smallint;
 
 
 \Description
 \Description
 \var{GetX} returns the X-coordinate of the current pointer. This value is
 \var{GetX} returns the X-coordinate of the current pointer. This value is
@@ -1041,7 +1041,7 @@ None.
 \end{function}
 \end{function}
 \begin{function}{GetY}
 \begin{function}{GetY}
 \Declaration
 \Declaration
-Function GetY  : Integer;
+Function GetY  : smallint;
 
 
 \Description
 \Description
 \var{GetY} returns the Y-coordinate of the current pointer. This value is
 \var{GetY} returns the Y-coordinate of the current pointer. This value is
@@ -1084,7 +1084,7 @@ None.
 
 
 \begin{function}{GraphErrorMsg}
 \begin{function}{GraphErrorMsg}
 \Declaration
 \Declaration
-Function GraphErrorMsg (ErrorCode : Integer) : String;
+Function GraphErrorMsg (ErrorCode : smallint) : String;
 
 
 \Description
 \Description
 \var{GraphErrorMsg}
 \var{GraphErrorMsg}
@@ -1097,7 +1097,7 @@ None.
 \end{function}
 \end{function}
 \begin{function}{GraphResult}
 \begin{function}{GraphResult}
 \Declaration
 \Declaration
-Function GraphResult  : Integer;
+Function GraphResult  : smallint;
 
 
 \Description
 \Description
 \var{GraphResult} returns an error-code for
 \var{GraphResult} returns an error-code for
@@ -1119,7 +1119,7 @@ None.
 
 
 \begin{function}{ImageSize}
 \begin{function}{ImageSize}
 \Declaration
 \Declaration
-Function ImageSize (X1,Y1,X2,Y2 : Integer) : longint;
+Function ImageSize (X1,Y1,X2,Y2 : smallint) : longint;
 
 
 \Description
 \Description
 \var{ImageSize} returns the number of bytes needed to store the image
 \var{ImageSize} returns the number of bytes needed to store the image
@@ -1141,7 +1141,7 @@ None.
 
 
 \begin{procedure}{InitGraph}
 \begin{procedure}{InitGraph}
 \Declaration
 \Declaration
-Procedure InitGraph (var GraphDriver,GraphModus : integer;\\
+Procedure InitGraph (var GraphDriver,GraphModus : smallint;\\
 const PathToDriver : string);
 const PathToDriver : string);
 
 
 \Description
 \Description
@@ -1183,7 +1183,7 @@ Introduction, (page \pageref{se:Introduction}),
 Example:
 Example:
 \begin{verbatim}
 \begin{verbatim}
 var
 var
-   gd,gm : integer;
+   gd,gm : smallint;
    PathToDriver : string;
    PathToDriver : string;
 begin
 begin
    gd:=detect; { highest possible resolution }
    gd:=detect; { highest possible resolution }
@@ -1199,7 +1199,7 @@ end.
 
 
 \begin{function}{InstallUserDriver}
 \begin{function}{InstallUserDriver}
 \Declaration
 \Declaration
-Function InstallUserDriver (DriverPath : String; AutoDetectPtr: Pointer) : Integer;
+Function InstallUserDriver (DriverPath : String; AutoDetectPtr: Pointer) : smallint;
 
 
 \Description
 \Description
 This routine is not supported in FPC, it is here only for compatiblity and
 This routine is not supported in FPC, it is here only for compatiblity and
@@ -1212,7 +1212,7 @@ None.
 \end{function}
 \end{function}
 \begin{function}{InstallUserFont}
 \begin{function}{InstallUserFont}
 \Declaration
 \Declaration
-Function InstallUserFont (FontPath : String) : Integer;
+Function InstallUserFont (FontPath : String) : smallint;
 
 
 \Description
 \Description
 \var{InstallUserFont} adds the font in \var{FontPath} to the list of fonts
 \var{InstallUserFont} adds the font in \var{FontPath} to the list of fonts
@@ -1225,7 +1225,7 @@ None.
 \end{function}
 \end{function}
 \begin{procedure}{Line}
 \begin{procedure}{Line}
 \Declaration
 \Declaration
-Procedure Line (X1,Y1,X2,Y2 : Integer);
+Procedure Line (X1,Y1,X2,Y2 : smallint);
 
 
 \Description
 \Description
 \var{Line} draws a line starting from
 \var{Line} draws a line starting from
@@ -1244,7 +1244,7 @@ None.
 \end{procedure}
 \end{procedure}
 \begin{procedure}{LineRel}
 \begin{procedure}{LineRel}
 \Declaration
 \Declaration
-Procedure LineRel (DX,DY : Integer);
+Procedure LineRel (DX,DY : smallint);
 
 
 \Description
 \Description
 \var{LineRel} draws a line starting from
 \var{LineRel} draws a line starting from
@@ -1258,7 +1258,7 @@ None.
 \end{procedure}
 \end{procedure}
 \begin{procedure}{LineTo}
 \begin{procedure}{LineTo}
 \Declaration
 \Declaration
-Procedure LineTo (DX,DY : Integer);
+Procedure LineTo (DX,DY : smallint);
 
 
 \Description
 \Description
 \var{LineTo} draws a line starting from
 \var{LineTo} draws a line starting from
@@ -1272,7 +1272,7 @@ None.
 \end{procedure}
 \end{procedure}
 \begin{procedure}{MoveRel}
 \begin{procedure}{MoveRel}
 \Declaration
 \Declaration
-Procedure MoveRel (DX,DY : Integer;
+Procedure MoveRel (DX,DY : smallint;
 
 
 \Description
 \Description
 \var{MoveRel} moves the current pointer to the
 \var{MoveRel} moves the current pointer to the
@@ -1285,7 +1285,7 @@ None.
 \end{procedure}
 \end{procedure}
 \begin{procedure}{MoveTo}
 \begin{procedure}{MoveTo}
 \Declaration
 \Declaration
-Procedure MoveTo (X,Y : Integer);
+Procedure MoveTo (X,Y : smallint);
 
 
 \Description
 \Description
 \var{MoveTo} moves the current pointer to the
 \var{MoveTo} moves the current pointer to the
@@ -1317,7 +1317,7 @@ None.
 \end{procedure}
 \end{procedure}
 \begin{procedure}{OutTextXY}
 \begin{procedure}{OutTextXY}
 \Declaration
 \Declaration
-Procedure OutTextXY (X,Y : Integer; Const TextString : String);
+Procedure OutTextXY (X,Y : smallint; Const TextString : String);
 
 
 \Description
 \Description
 \var{OutText} puts \var{TextString} on the screen, at position \var{(X,Y)},
 \var{OutText} puts \var{TextString} on the screen, at position \var{(X,Y)},
@@ -1335,7 +1335,7 @@ None.
 \end{procedure}
 \end{procedure}
 \begin{procedure}{PieSlice}
 \begin{procedure}{PieSlice}
 \Declaration
 \Declaration
-Procedure PieSlice (X,Y,stangle,endAngle:integer;Radius: Word);
+Procedure PieSlice (X,Y,stangle,endAngle:smallint;Radius: Word);
 
 
 \Description
 \Description
 \var{PieSlice}
 \var{PieSlice}
@@ -1350,7 +1350,7 @@ None.
 \end{procedure}
 \end{procedure}
 \begin{procedure}{PutImage}
 \begin{procedure}{PutImage}
 \Declaration
 \Declaration
-Procedure PutImage (X,Y: Integer; var Bitmap; BitBlt: Word);
+Procedure PutImage (X,Y: smallint; var Bitmap; BitBlt: Word);
 
 
 \Description
 \Description
 \var{PutImage}
 \var{PutImage}
@@ -1377,7 +1377,7 @@ None
 \end{procedure}
 \end{procedure}
 \begin{procedure}{PutPixel}
 \begin{procedure}{PutPixel}
 \Declaration
 \Declaration
-Procedure PutPixel (X,Y : Integer; Color : Word);
+Procedure PutPixel (X,Y : smallint; Color : Word);
 
 
 \Description
 \Description
 Puts a point at
 Puts a point at
@@ -1390,7 +1390,7 @@ None.
 \end{procedure}
 \end{procedure}
 \begin{procedure}{Rectangle}
 \begin{procedure}{Rectangle}
 \Declaration
 \Declaration
-Procedure Rectangle (X1,Y1,X2,Y2 : Integer);
+Procedure Rectangle (X1,Y1,X2,Y2 : smallint);
 
 
 \Description
 \Description
 Draws a rectangle with
 Draws a rectangle with
@@ -1403,7 +1403,7 @@ None.
 \end{procedure}
 \end{procedure}
 \begin{function}{RegisterBGIDriver}
 \begin{function}{RegisterBGIDriver}
 \Declaration
 \Declaration
-Function RegisterBGIDriver (Driver : Pointer) : Integer;
+Function RegisterBGIDriver (Driver : Pointer) : smallint;
 
 
 \Description
 \Description
 This routine is not supported in FPC. It is here for compatibility and it
 This routine is not supported in FPC. It is here for compatibility and it
@@ -1416,7 +1416,7 @@ None.
 \end{function}
 \end{function}
 \begin{function}{RegisterBGIFont}
 \begin{function}{RegisterBGIFont}
 \Declaration
 \Declaration
-Function RegisterBGIFont (Font : Pointer) : Integer;
+Function RegisterBGIFont (Font : Pointer) : smallint;
 
 
 \Description
 \Description
 This routine permits the user to add a font to the list of known fonts
 This routine permits the user to add a font to the list of known fonts
@@ -1460,8 +1460,8 @@ Example:
 uses Graph;
 uses Graph;
 
 
 var
 var
- Gd, Gm: Integer;
- Mode: Integer;
+ Gd, Gm: smallint;
+ Mode: smallint;
 begin
 begin
  Gd := Detect;
  Gd := Detect;
  InitGraph(Gd, Gm, ' ');
  InitGraph(Gd, Gm, ' ');
@@ -1482,7 +1482,7 @@ end.
 \end{verbatim}
 \end{verbatim}
 \begin{procedure}{Sector}
 \begin{procedure}{Sector}
 \Declaration
 \Declaration
-Procedure Sector (X,Y : Integer; StAngle,EndAngle,XRadius,YRadius : Word);
+Procedure Sector (X,Y : smallint; StAngle,EndAngle,XRadius,YRadius : Word);
 
 
 \Description
 \Description
 \var{Sector}
 \var{Sector}
@@ -1661,7 +1661,7 @@ None.
 \end{procedure}
 \end{procedure}
 \begin{procedure}{SetGraphMode}
 \begin{procedure}{SetGraphMode}
 \Declaration
 \Declaration
-Procedure SetGraphMode (Mode : Integer);
+Procedure SetGraphMode (Mode : smallint);
 
 
 \Description
 \Description
 \var{SetGraphMode} sets the
 \var{SetGraphMode} sets the
@@ -1738,7 +1738,7 @@ None.
 \end{procedure}
 \end{procedure}
 \begin{procedure}{SetRGBPalette}
 \begin{procedure}{SetRGBPalette}
 \Declaration
 \Declaration
-Procedure SetRGBPalette (ColorNum,Red,Green,Blue : Integer);
+Procedure SetRGBPalette (ColorNum,Red,Green,Blue : smallint);
 
 
 \Description
 \Description
 \var{SetRGBPalette} sets the \var{ColorNum}-th entry in the palette to the
 \var{SetRGBPalette} sets the \var{ColorNum}-th entry in the palette to the
@@ -1838,7 +1838,7 @@ None.
 \end{procedure}
 \end{procedure}
 \begin{procedure}{SetViewPort}
 \begin{procedure}{SetViewPort}
 \Declaration
 \Declaration
-Procedure SetViewPort (X1,Y1,X2,Y2 : Integer; Clip : Boolean);
+Procedure SetViewPort (X1,Y1,X2,Y2 : smallint; Clip : Boolean);
 
 
 \Description
 \Description
 Sets the current graphical view-port (window) to the rectangle defined by
 Sets the current graphical view-port (window) to the rectangle defined by
@@ -1864,7 +1864,7 @@ None
 \end{procedure}
 \end{procedure}
 \begin{procedure}{SetWriteMode}
 \begin{procedure}{SetWriteMode}
 \Declaration
 \Declaration
-Procedure SetWriteMode (Mode : Integer);
+Procedure SetWriteMode (Mode : smallint);
 
 
 \Description
 \Description
 \var{SetWriteMode} controls the drawing of lines on the screen. It controls
 \var{SetWriteMode} controls the drawing of lines on the screen. It controls

+ 31 - 28
rtl/inc/graph/gtext.inc

@@ -43,10 +43,10 @@
       PHeader = ^THeader;
       PHeader = ^THeader;
       THeader = packed record
       THeader = packed record
         Signature:  char;     { signature byte                        }
         Signature:  char;     { signature byte                        }
-        Nr_chars:   integer;  { number of characters in file          }
+        Nr_chars:   smallint;  { number of characters in file          }
         Reserved:   byte;
         Reserved:   byte;
         First_char: byte;     { first character in file               }
         First_char: byte;     { first character in file               }
-        cdefs :     integer;  { offset to character definitions       }
+        cdefs :     smallint;  { offset to character definitions       }
         scan_flag:  byte;     { TRUE if char is scanable              }
         scan_flag:  byte;     { TRUE if char is scanable              }
         org_to_cap: shortint;     { Height from origin to top of capitol  }
         org_to_cap: shortint;     { Height from origin to top of capitol  }
         org_to_base:shortint;     { Height from origin to baseline        }
         org_to_base:shortint;     { Height from origin to baseline        }
@@ -56,7 +56,7 @@
       end;
       end;
 
 
 
 
-      TOffsetTable =array[0..MaxChars] of Integer;
+      TOffsetTable =array[0..MaxChars] of smallint;
       TWidthTable  =array[0..MaxChars] of byte;
       TWidthTable  =array[0..MaxChars] of byte;
 
 
       tfontrec = packed record
       tfontrec = packed record
@@ -74,8 +74,8 @@
       pStroke = ^TStroke;
       pStroke = ^TStroke;
       TStroke = packed record
       TStroke = packed record
         opcode: byte;
         opcode: byte;
-        x: integer;  { relative x offset character }
-        y: integer;  { relative y offset character }
+        x: smallint;  { relative x offset character }
+        y: smallint;  { relative y offset character }
       end;
       end;
 
 
 
 
@@ -87,7 +87,7 @@
     var
     var
        fonts : array[1..maxfonts] of tfontrec;
        fonts : array[1..maxfonts] of tfontrec;
        Strokes: TStrokes; {* Stroke Data Base           *}
        Strokes: TStrokes; {* Stroke Data Base           *}
-       Stroke_count: Array[0..MaxChars] of integer; {* Stroke Count Table *}
+       Stroke_count: Array[0..MaxChars] of smallint; {* Stroke Count Table *}
 
 
 {***************************************************************************}
 {***************************************************************************}
 {                         Internal support routines                         }
 {                         Internal support routines                         }
@@ -103,7 +103,7 @@
       end;
       end;
 
 
 
 
-    function InstallUserFont(const FontFileName : string) : integer;
+    function InstallUserFont(const FontFileName : string) : smallint;
 
 
       begin
       begin
          _graphresult:=grOk;
          _graphresult:=grOk;
@@ -122,7 +122,7 @@
       end;
       end;
 
 
 
 
-    function Decode(byte1,byte2: char; var x,y: integer): integer;
+    function Decode(byte1,byte2: char; var x,y: smallint): smallint;
     { This routines decoes a signle word in a font opcode section  }
     { This routines decoes a signle word in a font opcode section  }
     { to a stroke record.                                          }
     { to a stroke record.                                          }
       var
       var
@@ -131,7 +131,7 @@
        b1:=shortint(byte1);
        b1:=shortint(byte1);
        b2:=shortint(byte2);
        b2:=shortint(byte2);
        { Decode the CHR OPCODE }
        { Decode the CHR OPCODE }
-       Decode:=integer(((b1 and $80) shr 6)+((b2 and $80) shr 7));
+       Decode:=smallint(((b1 and $80) shr 6)+((b2 and $80) shr 7));
        { Now get the X,Y coordinates        }
        { Now get the X,Y coordinates        }
        { bit 0..7 only which are considered }
        { bit 0..7 only which are considered }
        { signed values.                     }
        { signed values.                     }
@@ -143,23 +143,23 @@
        { sign extend it...                      }
        { sign extend it...                      }
        if (b1 and $40)<>0 then b1:=b1 or $80;
        if (b1 and $40)<>0 then b1:=b1 or $80;
        if (b2 and $40)<>0 then b2:=b2 or $80;
        if (b2 and $40)<>0 then b2:=b2 or $80;
-       x:=integer(b1);
-       y:=integer(b2);
+       x:=smallint(b1);
+       y:=smallint(b2);
 {$ifdef debug}
 {$ifdef debug}
 {$R+}
 {$R+}
 {$endif debug}
 {$endif debug}
      end;
      end;
 
 
 
 
-    function unpack(buf: pchar; index: integer; var Stroke: TStrokes): integer;
+    function unpack(buf: pchar; index: smallint; var Stroke: TStrokes): smallint;
 
 
      var
      var
       po: TStrokes;
       po: TStrokes;
-      num_ops: integer;
+      num_ops: smallint;
       opcode, i, opc: word;
       opcode, i, opc: word;
-      counter: integer;
-      lindex: integer;
-      jx, jy: integer;
+      counter: smallint;
+      lindex: smallint;
+      jx, jy: smallint;
      begin
      begin
        num_ops := 0;
        num_ops := 0;
        counter := index;
        counter := index;
@@ -254,7 +254,7 @@
 {***************************************************************************}
 {***************************************************************************}
 
 
 
 
-    function RegisterBGIfont(font : pointer) : integer;
+    function RegisterBGIfont(font : pointer) : smallint;
 
 
       var
       var
          hp : pchar;
          hp : pchar;
@@ -283,8 +283,8 @@
                      begin
                      begin
                         move(FHeader,fonts[b].PHeader,sizeof(FHeader));
                         move(FHeader,fonts[b].PHeader,sizeof(FHeader));
                         move(Header,fonts[b].Header,sizeof(Header));
                         move(Header,fonts[b].Header,sizeof(Header));
-                        move(hp[i],Fonts[b].Offsets[Fonts[b].Header.First_Char],Fonts[b].Header.Nr_chars*sizeof(integer));
-                        Inc(i,Fonts[b].Header.Nr_chars*sizeof(integer));
+                        move(hp[i],Fonts[b].Offsets[Fonts[b].Header.First_Char],Fonts[b].Header.Nr_chars*sizeof(smallint));
+                        Inc(i,Fonts[b].Header.Nr_chars*sizeof(smallint));
                         move(hp[i],Fonts[b].Widths[Fonts[b].Header.First_Char],Fonts[b].Header.Nr_chars*sizeof(byte));
                         move(hp[i],Fonts[b].Widths[Fonts[b].Header.First_Char],Fonts[b].Header.Nr_chars*sizeof(byte));
                         Inc(i,Fonts[b].Header.Nr_chars*sizeof(byte));
                         Inc(i,Fonts[b].Header.Nr_chars*sizeof(byte));
                         counter:=Fonts[b].PHeader.font_size+PREFIX_SIZE-i;
                         counter:=Fonts[b].PHeader.font_size+PREFIX_SIZE-i;
@@ -330,7 +330,7 @@
       end;
       end;
 
 
     function TextWidth(const TextString : string) : word;
     function TextWidth(const TextString : string) : word;
-      var i,x : Integer;
+      var i,x : smallint;
           c   : byte;
           c   : byte;
       begin
       begin
          x := 0;
          x := 0;
@@ -353,22 +353,22 @@
       end;
       end;
 
 
 
 
-    procedure OutTextXY(x,y : integer;const TextString : string);
+    procedure OutTextXY(x,y : smallint;const TextString : string);
 
 
       type
       type
        Tpoint = record
        Tpoint = record
-         X,Y: Integer;
+         X,Y: smallint;
        end;
        end;
       var
       var
          i,j,k,c       : longint;
          i,j,k,c       : longint;
          xpos,ypos     : longint;
          xpos,ypos     : longint;
          counter       : longint;
          counter       : longint;
          FontBitmap    : TBitmapChar;
          FontBitmap    : TBitmapChar;
-         cnt1,cnt2     : integer;
-         cnt3,cnt4     : integer;
+         cnt1,cnt2     : smallint;
+         cnt3,cnt4     : smallint;
          charsize      : word;
          charsize      : word;
          WriteMode     : word;
          WriteMode     : word;
-         CurX, CurY    : integer;
+         CurX, CurY    : smallint;
          oldvalues     : linesettingstype;
          oldvalues     : linesettingstype;
          chr           : char;
          chr           : char;
 
 
@@ -546,7 +546,7 @@
 
 
 
 
     procedure OutText(const TextString : string);
     procedure OutText(const TextString : string);
-      var x,y:integer;
+      var x,y:smallint;
       begin
       begin
          { Save CP }
          { Save CP }
          x:=CurrentX;
          x:=CurrentX;
@@ -681,7 +681,7 @@
               BlockRead(F,fonts[font].Header,Sizeof(THeader));
               BlockRead(F,fonts[font].Header,Sizeof(THeader));
               Base := FilePos(F);     {* Remember the address of table*}
               Base := FilePos(F);     {* Remember the address of table*}
 
 
-              BlockRead(F,Fonts[font].Offsets[Fonts[font].Header.First_Char],Fonts[font].Header.Nr_chars*sizeof(integer));
+              BlockRead(F,Fonts[font].Offsets[Fonts[font].Header.First_Char],Fonts[font].Header.Nr_chars*sizeof(smallint));
 
 
               {*        Load the character width table into memory.                     *}
               {*        Load the character width table into memory.                     *}
 
 
@@ -731,7 +731,10 @@
 
 
 {
 {
 $Log$
 $Log$
-Revision 1.8  1999-11-11 22:29:21  florian
+Revision 1.9  1999-12-20 11:22:36  peter
+  * integer -> smallint to overcome -S2 switch needed for ggi version
+
+Revision 1.8  1999/11/11 22:29:21  florian
   * the writing of the default font was wrong when doing scaling:
   * the writing of the default font was wrong when doing scaling:
     the last colunm/row wasn't drawn
     the last colunm/row wasn't drawn
 
 

+ 11 - 8
rtl/inc/graph/modes.inc

@@ -59,7 +59,7 @@
    end;
    end;
 
 
 
 
-   function searchmode(ReqDriver : integer; reqmode: integer): PModeInfo;
+   function searchmode(ReqDriver : smallint; reqmode: smallint): PModeInfo;
   {********************************************************}
   {********************************************************}
   { Procedure SearchMode()                                 }
   { Procedure SearchMode()                                 }
   {--------------------------------------------------------}
   {--------------------------------------------------------}
@@ -104,7 +104,7 @@
 {                          External routines                            }
 {                          External routines                            }
 {-----------------------------------------------------------------------}
 {-----------------------------------------------------------------------}
 
 
-   function GetModeName(ModeNumber: integer): string;
+   function GetModeName(ModeNumber: smallint): string;
   {********************************************************}
   {********************************************************}
   { Function GetModeName()                                 }
   { Function GetModeName()                                 }
   {--------------------------------------------------------}
   {--------------------------------------------------------}
@@ -124,7 +124,7 @@
          _GraphResult := grInvalidMode;
          _GraphResult := grInvalidMode;
     end;
     end;
 
 
-   function GetGraphMode: Integer;
+   function GetGraphMode: smallint;
      begin
      begin
       GetGraphMode := IntCurrentMode;
       GetGraphMode := IntCurrentMode;
      end;
      end;
@@ -150,10 +150,10 @@
     end;
     end;
 
 
 
 
-    procedure GetModeRange(GraphDriver: Integer; var LoMode,
-      HiMode: Integer);
+    procedure GetModeRange(GraphDriver: smallint; var LoMode,
+      HiMode: smallint);
       var
       var
-       i : integer;
+       i : smallint;
        mode : PModeInfo;
        mode : PModeInfo;
      begin
      begin
        {$ifdef logging}
        {$ifdef logging}
@@ -187,7 +187,7 @@
      end;
      end;
 
 
 
 
-  procedure SetGraphMode(mode: Integer);
+  procedure SetGraphMode(mode: smallint);
     var
     var
      modeinfo: PModeInfo;
      modeinfo: PModeInfo;
     begin
     begin
@@ -341,7 +341,10 @@
 
 
 {
 {
 $Log$
 $Log$
-Revision 1.14  1999-12-04 21:20:04  michael
+Revision 1.15  1999-12-20 11:22:36  peter
+  * integer -> smallint to overcome -S2 switch needed for ggi version
+
+Revision 1.14  1999/12/04 21:20:04  michael
 + Additional logging
 + Additional logging
 
 
 Revision 1.13  1999/11/28 16:13:55  jonas
 Revision 1.13  1999/11/28 16:13:55  jonas

+ 5 - 2
rtl/inc/graph/palette.inc

@@ -366,7 +366,7 @@ CONST
              Palette.Colors[i].Blue);
              Palette.Colors[i].Blue);
       end;
       end;
 
 
-    function GetPaletteSize: integer;
+    function GetPaletteSize: smallint;
      begin
      begin
        GetPaletteSize := PaletteSize;
        GetPaletteSize := PaletteSize;
      end;
      end;
@@ -382,7 +382,10 @@ CONST
 
 
 {
 {
 $Log$
 $Log$
-Revision 1.4  1999-07-12 13:27:15  jonas
+Revision 1.5  1999-12-20 11:22:36  peter
+  * integer -> smallint to overcome -S2 switch needed for ggi version
+
+Revision 1.4  1999/07/12 13:27:15  jonas
   + added Log and Id tags
   + added Log and Id tags
   * added first FPC support, only VGA works to some extend for now
   * added first FPC support, only VGA works to some extend for now
   * use -dasmgraph to use assembler routines, otherwise Pascal
   * use -dasmgraph to use assembler routines, otherwise Pascal