[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] error with ARRAY OF CHAR
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] error with ARRAY OF CHAR |
Date: |
Thu, 26 Nov 2009 18:43:00 +0000 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Martin Kalbfuß <address@hidden> writes:
> the following code doesn't work
>
> -- module test --
>
> testSurface := SKVideo.LoadBMP('test.bmp');
>
> -- module SKVideo --
>
> PROCEDURE LoadBMP(file : ARRAY OF CHAR) : VideoBase.SurfacePtr;
> VAR
> src : VideoBase.RWOpS;
> BMP : VideoBase.SurfacePtr;
> BEGIN
> src := VideoBase.SDL_RWFromFile(file, 'rb');
> IF src = NIL THEN
> SKGeneral.Raise();
> END;
>
> BMP := VideoBase.SDL_LoadBMP_RW(src , 0);
> IF BMP = NIL THEN
> SKGeneral.Raise();
> END;
> RETURN BMP;
> END LoadBMP;
>
> -- C module VideoBase --
>
> PROCEDURE SDL_LoadBMP_RW(src : RWOpS; freesrc : INTEGER) :
> SurfacePtr;
Hi Martin,
>
> PROCEDURE SDL_RWFromFile(file, mode : ARRAY OF CHAR) : RWOpS;
>
> I get:
>
> terminate called after throwing an instance of 'int'
>
> If I pass 'test.bmp' directly to SDL_RWFromFile inside LoadBMP it works.
> Doing STextIO.WriteString(file); inside LoadBMP shows the correct
> string. Looks like a problem with modules and ARRAY OF CHAR But I have
> no idea what's wrong.
thanks for the report - I'll reproduce the problem and get back to
you.. (have you tried single stepping the code in gdb to see the
parameters being passed and where the exception is thrown?)
regards,
Gaius