Browse Source

* remove unused vars
* renamed to .pp

peter 25 years ago
parent
commit
7257089815

+ 9 - 5
install/demo/fpctris.pp

@@ -556,11 +556,11 @@ BEGIN
  ShowHighScore;
  ShowHighScore;
 END;
 END;
 
 
-VAR gd,gm : INTEGER;
-    Error : LONGINT;
-    {$IFDEF UseGraphics}
+{$IFDEF UseGraphics}
+VAR
+    gd,gm : INTEGER;
     Pal   : PaletteType;
     Pal   : PaletteType;
-    {$ENDIF}
+{$ENDIF}
 
 
 BEGIN
 BEGIN
  {$IFDEF UseGraphics}
  {$IFDEF UseGraphics}
@@ -812,7 +812,11 @@ END.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.4  2000-01-14 22:03:07  marco
+  Revision 1.5  2000-01-21 00:44:51  peter
+    * remove unused vars
+    * renamed to .pp
+
+  Revision 1.4  2000/01/14 22:03:07  marco
    * Changed some comments
    * Changed some comments
 
 
   Revision 1.3  1999/12/31 17:03:50  marco
   Revision 1.3  1999/12/31 17:03:50  marco

+ 9 - 10
install/demo/gameunit.pp

@@ -29,6 +29,9 @@ INTERFACE
 {$ifdef linux}
 {$ifdef linux}
   {$define MouseAPI}
   {$define MouseAPI}
 {$endif}
 {$endif}
+{$ifdef win32}
+  {$define MouseAPI}
+{$endif}
 {$IFDEF Ver70}
 {$IFDEF Ver70}
   {$define MouseAPI}
   {$define MouseAPI}
   {$G+}
   {$G+}
@@ -156,11 +159,6 @@ CONST
   InitNames : ARRAY[0..9] OF String[12] = ('Carl','Daniel','Florian','Jonas','John','Marco','Michael (3x)',
   InitNames : ARRAY[0..9] OF String[12] = ('Carl','Daniel','Florian','Jonas','John','Marco','Michael (3x)',
                                            'Peter','Pierre','Thomas' );
                                            'Peter','Pierre','Thomas' );
 
 
-{$IFDEF MouseAPI}
-
-VAR MouseBuffer : LONGINT;
-{$ENDIF}
-
 FUNCTION MousePresent : BOOLEAN;
 FUNCTION MousePresent : BOOLEAN;
 
 
 BEGIN
 BEGIN
@@ -842,7 +840,7 @@ END;
    db $66; shr dx,16              { shr edx, 16 }
    db $66; shr dx,16              { shr edx, 16 }
    { return: ax=low word, dx=hi word }
    { return: ax=low word, dx=hi word }
  END;
  END;
- 
+
  PROCEDURE  outportl(portx : word;data : longint); ASSEMBLER;
  PROCEDURE  outportl(portx : word;data : longint); ASSEMBLER;
  ASM
  ASM
    { we cant use the 32 bit operand prefix for loading the longint -
    { we cant use the 32 bit operand prefix for loading the longint -
@@ -855,15 +853,16 @@ END;
 {$ENDIF}
 {$ENDIF}
 
 
 BEGIN
 BEGIN
- {$IFDEF MouseAPI}
-  MouseBuffer:=0;
- {$ENDIF}
   DefColor:=TextAttr;                { Save the current attributes, to restore}
   DefColor:=TextAttr;                { Save the current attributes, to restore}
   Negative:=FALSE;                    { Negative=true-> better scores are lower}
   Negative:=FALSE;                    { Negative=true-> better scores are lower}
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.5  2000-01-14 22:03:43  marco
+  Revision 1.6  2000-01-21 00:44:51  peter
+    * remove unused vars
+    * renamed to .pp
+
+  Revision 1.5  2000/01/14 22:03:43  marco
    * Change Lee's first name to John :-)
    * Change Lee's first name to John :-)
 
 
   Revision 1.4  2000/01/01 14:54:16  marco
   Revision 1.4  2000/01/01 14:54:16  marco

+ 4 - 7
install/demo/maze.pas → install/demo/maze.pp

@@ -271,7 +271,6 @@ procedure branch(x, y : word);  { make a new branch of the tree }
 var
 var
   runnum : word;
   runnum : word;
   d      : byte;
   d      : byte;
-  i      : boolean;
 begin
 begin
   runnum := maxrun;      { max number of tree cells to add to a branch }
   runnum := maxrun;      { max number of tree cells to add to a branch }
   connect(x, y);        { first connect frontier cell to the tree }
   connect(x, y);        { first connect frontier cell to the tree }
@@ -283,7 +282,7 @@ begin
       d := randomdir;
       d := randomdir;
     until d and runset > 0;  { pick random direction to known frontier }
     until d and runset > 0;  { pick random direction to known frontier }
     rembar(x, y, d);          {    and make it part of the tree }
     rembar(x, y, d);          {    and make it part of the tree }
-    i := adjust(x, y, d);
+    adjust(x, y, d);
     addfront(x, y);      { then pick up the neighboring frontier cells }
     addfront(x, y);      { then pick up the neighboring frontier cells }
     dec(runnum);
     dec(runnum);
   end;
   end;
@@ -329,7 +328,6 @@ procedure solve(x, y, endx, endy : word);
 var
 var
   j, k : word;
   j, k : word;
   d    : byte;
   d    : byte;
-  i    : boolean;
 begin
 begin
   d := rightdir;  { starting from left side of maze going right }
   d := rightdir;  { starting from left side of maze going right }
   while (x <> endx) or (y <> endy) do
   while (x <> endx) or (y <> endy) do
@@ -346,7 +344,7 @@ begin
     end;
     end;
     j := x;
     j := x;
     k := y;
     k := y;
-    i := adjust(x, y, d);         { go in that direction }
+    adjust(x, y, d);         { go in that direction }
     with cell^[j,k] do
     with cell^[j,k] do
     begin    { turn on dot, off if we were here before }
     begin    { turn on dot, off if we were here before }
       flags := ((((cell^[x,y].flags xor $80) xor flags) and $80) xor flags);
       flags := ((((cell^[x,y].flags xor $80) xor flags) and $80) xor flags);
@@ -408,7 +406,6 @@ var
   x, y,
   x, y,
   endx,
   endx,
   endy : word;
   endy : word;
-  ch   : char;
 begin
 begin
   x := 1;                         { pick random start on left side wall }
   x := 1;                         { pick random start on left side wall }
   y := random(height) + 1;
   y := random(height) + 1;
@@ -419,8 +416,8 @@ begin
   mansolve(x, y, endx, endy);      { try it manually }
   mansolve(x, y, endx, endy);      { try it manually }
   solve(x, y, endx, endy);         { show how when he gives up }
   solve(x, y, endx, endy);         { show how when he gives up }
   while keypressed do
   while keypressed do
-    ch := readkey;
-  ch := readkey;
+   readkey;
+  readkey;
 end;
 end;
 
 
 
 

+ 3 - 7
install/demo/quad.pas → install/demo/quad.pp

@@ -93,16 +93,12 @@ End;
 
 
 Procedure ginit640x480x16(direc:String);
 Procedure ginit640x480x16(direc:String);
 
 
-Var grd,grmode,errcode: integer;
+Var grd,grmode: integer;
 Begin
 Begin
   closegraph;
   closegraph;
   grd := 9;{ detect;}
   grd := 9;{ detect;}
   grmode := 2;{ m800x600x16;}
   grmode := 2;{ m800x600x16;}
   initgraph(grd,grmode,direc);
   initgraph(grd,grmode,direc);
-{  ErrCode := GraphResult;
-  If ErrCode <> grOk Then fatal(
-                       'PROC[GINIT640X480X16]- CANNOT INITIALIZE 640x480x16 GRAPHICS MODE'
-    );}
   setgraphmode(2);
   setgraphmode(2);
 End;
 End;
 
 
@@ -298,7 +294,7 @@ Procedure fire_works;
 Const
 Const
   nof = 30;
   nof = 30;
 
 
-Type 
+Type
   fires = Record
   fires = Record
             x,y: Longint;
             x,y: Longint;
             direct: longint;
             direct: longint;
@@ -659,7 +655,7 @@ Begin
 End;
 End;
 
 
 Begin
 Begin
-  
+
   clean;
   clean;
   Repeat
   Repeat
     interpret;
     interpret;

+ 10 - 9
install/demo/samegame.pp

@@ -104,7 +104,9 @@ END;
 PROCEDURE ShowHelp;
 PROCEDURE ShowHelp;
 {Shows some explanation of the game and waits for a key}
 {Shows some explanation of the game and waits for a key}
 
 
+{$ifndef UseGraphics}
 VAR I : LONGINT;
 VAR I : LONGINT;
+{$endif}
 
 
 BEGIN
 BEGIN
  {$IFDEF UseGraphics}
  {$IFDEF UseGraphics}
@@ -206,8 +208,9 @@ END;
 PROCEDURE ShowScore;
 PROCEDURE ShowScore;
 {Simply procedure to update the score}
 {Simply procedure to update the score}
 
 
- VAR S : String;
-
+{$IFDEF UseGraphics}
+VAR S : String;
+{$ENDIF}
 BEGIN
 BEGIN
  {$IFDEF UseGraphics}
  {$IFDEF UseGraphics}
   Str(Score:5,S);
   Str(Score:5,S);
@@ -374,7 +377,6 @@ VAR X,Y,
     MX,MY,MState,Dummy : LONGINT;
     MX,MY,MState,Dummy : LONGINT;
     EndOfGame          : LONGINT;
     EndOfGame          : LONGINT;
     S                  : String;
     S                  : String;
-    DoneSomething      : BOOLEAN;
 
 
 BEGIN
 BEGIN
  RANDOMIZE;
  RANDOMIZE;
@@ -391,7 +393,6 @@ BEGIN
     X:=MX SHR 3;
     X:=MX SHR 3;
     Y:=MY SHR 3;
     Y:=MY SHR 3;
    {$ENDIF}
    {$ENDIF}
-   DoneSomething:=FALSE;
    IF PlayFieldPiecesLeft=0 THEN
    IF PlayFieldPiecesLeft=0 THEN
     BEGIN
     BEGIN
      INC(Score,1000);
      INC(Score,1000);
@@ -413,7 +414,6 @@ BEGIN
       BEGIN
       BEGIN
          IF (MState AND LButton) <>0 THEN {If leftbutton pressed,}
          IF (MState AND LButton) <>0 THEN {If leftbutton pressed,}
           BEGIN
           BEGIN
-           DoneSomething:=TRUE;
            IF Y=4 THEN
            IF Y=4 THEN
             EndOfGame:=1;
             EndOfGame:=1;
            IF Y=6 THEN
            IF Y=6 THEN
@@ -444,7 +444,6 @@ BEGIN
        BEGIN
        BEGIN
         IF MarkField[X,Y]<>4 THEN
         IF MarkField[X,Y]<>4 THEN
          BEGIN
          BEGIN
-          DoneSomething:=TRUE;
           MarkField:=PlayField;
           MarkField:=PlayField;
           MarkAfield(X,Y);
           MarkAfield(X,Y);
           DisplayPlayField(MarkField);
           DisplayPlayField(MarkField);
@@ -457,7 +456,6 @@ BEGIN
         IF (MarkField[X,Y]=4) AND ((MState AND LButton) <>0) THEN
         IF (MarkField[X,Y]=4) AND ((MState AND LButton) <>0) THEN
                                    {If leftbutton pressed,}
                                    {If leftbutton pressed,}
          BEGIN
          BEGIN
-          DoneSomething:=TRUE;
           REPEAT                            {wait untill it's released.
           REPEAT                            {wait untill it's released.
                                            The moment of pressing counts}
                                            The moment of pressing counts}
            GetMouseState(X,Y,Dummy);
            GetMouseState(X,Y,Dummy);
@@ -499,7 +497,6 @@ END;
 CONST FileName='samegame.scr';
 CONST FileName='samegame.scr';
 
 
 VAR I : LONGINT;
 VAR I : LONGINT;
-    Error : LONGINT;
     {$IFDEF UseGraphics}
     {$IFDEF UseGraphics}
     gd,gm : INTEGER;
     gd,gm : INTEGER;
     Pal   : PaletteType;
     Pal   : PaletteType;
@@ -550,7 +547,11 @@ BEGIN
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1999-12-31 17:04:22  marco
+  Revision 1.4  2000-01-21 00:44:51  peter
+    * remove unused vars
+    * renamed to .pp
+
+  Revision 1.3  1999/12/31 17:04:22  marco
 
 
 
 
   Graphical version
   Graphical version

+ 15 - 12
install/demo/win32/menu.pp

@@ -66,19 +66,19 @@ Var AMessage: Msg;
     WindowClass: WndClass;
     WindowClass: WndClass;
     Menu: hMenu;
     Menu: hMenu;
 
 
-Const 
+Const
   EditMenus: Array[201..203] Of pchar = ('Cut','copy','paste');
   EditMenus: Array[201..203] Of pchar = ('Cut','copy','paste');
 
 
-Type 
+Type
   TFileName = Array[0..Max_Path] Of Char;
   TFileName = Array[0..Max_Path] Of Char;
 
 
 Function SelectFile(Var FName:TFileName; Open:Boolean): Boolean;
 Function SelectFile(Var FName:TFileName; Open:Boolean): Boolean;
 
 
-Const 
+Const
   Filter: PChar = 'Text files (*.txt)'#0'*.txt'#0'All files (*.*)'#0'*.*'#0;
   Filter: PChar = 'Text files (*.txt)'#0'*.txt'#0'All files (*.*)'#0'*.*'#0;
   Ext: PChar = 'txt';
   Ext: PChar = 'txt';
 
 
-Var 
+Var
   NameRec: OpenFileName;
   NameRec: OpenFileName;
 Begin
 Begin
   FillChar(NameRec,SizeOf(NameRec),0);
   FillChar(NameRec,SizeOf(NameRec),0);
@@ -137,7 +137,7 @@ End;
 
 
 Procedure LoadText;
 Procedure LoadText;
 
 
-Var 
+Var
   FName: TFileName;
   FName: TFileName;
   F: File;
   F: File;
   Len: LongInt;
   Len: LongInt;
@@ -160,7 +160,7 @@ End;
 
 
 Procedure NewText;
 Procedure NewText;
 
 
-Const 
+Const
   Empty: PChar = '';
   Empty: PChar = '';
 Begin
 Begin
   AskSave;
   AskSave;
@@ -171,8 +171,7 @@ Function WindowProc (Window:HWnd;AMessage,WParam,LParam:Longint): Longint;
 stdcall;
 stdcall;
 export;
 export;
 
 
-Var dc: hdc;
-    ps: paintstruct;
+Var ps: paintstruct;
     r: rect;
     r: rect;
     StatH: Word;
     StatH: Word;
     nrmenu : longint;
     nrmenu : longint;
@@ -181,7 +180,7 @@ Begin
   Case AMessage Of
   Case AMessage Of
     wm_Paint:
     wm_Paint:
               Begin
               Begin
-                dc := BeginPaint(Window,@ps);
+                BeginPaint(Window,@ps);
                 GetClientRect(Window,@r);
                 GetClientRect(Window,@r);
                 EndPaint(Window,ps);
                 EndPaint(Window,ps);
                 Exit;
                 Exit;
@@ -240,11 +239,11 @@ End;
 
 
 Function EditCreate(ParentWindow,Status:HWnd): HWnd;
 Function EditCreate(ParentWindow,Status:HWnd): HWnd;
 
 
-Const 
+Const
   CS_Start = WS_Child or WS_HScroll or WS_VScroll or ES_MultiLine or ES_Left;
   CS_Start = WS_Child or WS_HScroll or WS_VScroll or ES_MultiLine or ES_Left;
   EdiTText: PChar = '';
   EdiTText: PChar = '';
 
 
-Var 
+Var
   HEdit: HWND;
   HEdit: HWND;
   R: TRect;
   R: TRect;
   StatH: Word;
   StatH: Word;
@@ -337,7 +336,11 @@ End.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.6  1999-08-10 08:21:45  michael
+  Revision 1.7  2000-01-21 00:44:51  peter
+    * remove unused vars
+    * renamed to .pp
+
+  Revision 1.6  1999/08/10 08:21:45  michael
   + Log keyword placement correction.
   + Log keyword placement correction.
 
 
   Revision 1.5  1999/08/10 08:20:49  michael
   Revision 1.5  1999/08/10 08:20:49  michael

+ 6 - 1
install/demo/win32/testdll.pp

@@ -34,6 +34,7 @@ var
   p : pointer;
   p : pointer;
 begin
 begin
   p:=Addr(T);
   p:=Addr(T);
+  p:=p;
 end;
 end;
 
 
 procedure P4(x1:pointer);export;
 procedure P4(x1:pointer);export;
@@ -61,7 +62,11 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1999-10-26 12:33:53  peter
+  Revision 1.4  2000-01-21 00:44:51  peter
+    * remove unused vars
+    * renamed to .pp
+
+  Revision 1.3  1999/10/26 12:33:53  peter
     * fixed illegal expr
     * fixed illegal expr
 
 
   Revision 1.2  1999/06/30 22:04:56  michael
   Revision 1.2  1999/06/30 22:04:56  michael