gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] Internal error


From: Martin Kalbfuß
Subject: [Gm2] Internal error
Date: Sat, 12 Dec 2009 00:01:09 +0100

Hallo,

I get

gm2 -c -fmakeall0 -Wpedantic -Wpedantic-cast -Wstudents
-Wpedantic-param-names -ftarget-ranlib=/usr/bin/ranlib
-ftarget-ar=/usr/bin/ar
-fobject-path=../src/sk:/home/martin/opt/lib/gcc/i686-pc-linux-gnu/4.1.2/gm2/iso:/home/martin/opt/lib/gcc/i686-pc-linux-gnu/4.1.2/gm2/pim
 -fiso -fmakeall -fcheck-all 
-I../src/sk:/home/martin/opt/lib/gcc/i686-pc-linux-gnu/4.1.2/gm2/iso:/home/martin/opt/lib/gcc/i686-pc-linux-gnu/4.1.2/gm2/pim
 test.mod
Internal error: Speicherzugriffsfehler
Please report this crash to the GNU Modula-2 mailing list
<address@hidden>
make[2]: *** [test.o] Fehler 1
make[2]: Leaving directory
`/home/martin/Desktop/schwarzerkaffee/examples'
make[1]: *** [test] Fehler 1
make[1]: Leaving directory
`/home/martin/Desktop/schwarzerkaffee/examples'
make: *** [all-recursive] Fehler 1

This only appears when using

M2CFLAGS = -fcheck-all \
        -Wpedantic \
        -Wpedantic-cast \
        -Wstudents \
        -Wpedantic-param-names

The code is

======================================================

MODULE test;

IMPORT SYSTEM,
       Storage,
       SKVideo,
       SKTime,
       VideoBase;

TYPE DragonPtr = POINTER TO Dragon;
     Dragon = RECORD
          position : SKVideo.Rect;
          source   : SKVideo.Rect;
          surface  : SKVideo.SurfacePtr;
     END;

VAR  screen           : SKVideo.SurfacePtr;
     colorKey         : SYSTEM.CARDINAL32;
     walkingTimer     : SKTime.TimerID;
     animationTimer   : SKTime.TimerID;
     dragon           : Dragon;

PROCEDURE Walk(interval : SYSTEM.CARDINAL32; dragon : DragonPtr) :
SYSTEM.CARDINAL32;
BEGIN
     IF dragon^.position.x <= (320 - 32) THEN
          INC(dragon^.position.x);
     END;
RETURN interval;
END Walk;

PROCEDURE Animate(interval : SYSTEM.CARDINAL32; dragon: DragonPtr) :
SYSTEM.CARDINAL32;
BEGIN
     IF dragon^.source.x = 1 THEN
          dragon^.source.x := 34;
     ELSE
          dragon^.source.x := 1;
     END;
RETURN interval;
END Animate;

BEGIN
     screen := SKVideo.SetVideoMode(320, 200, 16, SKVideo.HwSurface);

     dragon.surface := SKVideo.LoadDisplayFormatedBMP('test.bmp');

     colorKey := SKVideo.MapRGB(dragon.surface^.format, 255, 0, 255);
     SKVideo.SetColorKey(dragon.surface, SKVideo.SrcColorKey +
SKVideo.RLEAccel, colorKey);

     walkingTimer := SKTime.AddTimer(20, Walk, SYSTEM.ADR(dragon));
     animationTimer := SKTime.AddTimer(200, Animate,
SYSTEM.ADR(dragon));

     dragon.position := SKVideo.Rect{0, 0, 0, 0};
     dragon.source := SKVideo.Rect{34, 1, 32, 32};

     WHILE 1 DO
          SKVideo.BlitSurface(dragon.surface, dragon.source, screen,
dragon.position);
          SKVideo.Flip(screen);
          SKVideo.FillRect(screen, screen^.clipRect, 0); 
     END;

     SKTime.RemoveTimer(walkingTimer);
     SKTime.RemoveTimer(animationTimer);
     SKVideo.FreeSurface(dragon.surface);
END test.

===========================================================================

The latest release is attached.

Attachment: sk-0.1.tar.gz
Description: application/compressed-tar


reply via email to

[Prev in Thread] Current Thread [Next in Thread]