comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Does mmap gives a right result?!
Date: Sun, 03 Oct 2010 10:04:47 -0700
Date: 2010-10-03T10:04:47-07:00	[thread overview]
Message-ID: <i8ad40$l8e$1@tornado.tornevall.net> (raw)
In-Reply-To: <459d08e4-1370-4925-9d9f-64ee0f472c19@f25g2000yqc.googlegroups.com>

On 10/03/2010 04:27 AM, Francesco PIRANEO GIULIANO wrote:
>
>        fbindex := mmap(0, fbhandler.fixinfo.smem_len,
> fbhandler.PROT_READ + fbhandler.PROT_WRITE, fbhandler.MAP_FILE +
> fbhandler.MAP_SHARED, fbid, 0);
>
>        if integer(fbindex) = -1 then
> 	     raise BADMMAPRESULT;
>        end if;
>
> ...seems to be the most logical comparision BUT the following error in
> compile phase appears: "illegal operand for numeric conversion" -- Any
> help is really apreciated here! :-)

Fbindex is an object of an access type. Access values are not numeric, and there 
is no conversion defined to numeric types for them.

Is mmap really defined as returning void*?

You could use Unchecked_Conversion to treat the internal representation of 
Fbindex as the representation of an Integer.

You could define Mmap to return Interfaces.C.Int.

> When commenting out the above instructions and starting the compiled
> application, everything goes right except, when I try to draw inside
> the first location the program hungs with the following:
>
> raised STORAGE_ERROR : stack overflow (or erroneous memory access)

I'm not familiar with mmap, but it appears you are trying to access memory 
address zero, which is protected.

-- 
Jeff Carter
"What lazy lout left these wires all over the lawn?"
Poppy
98



  reply	other threads:[~2010-10-03 17:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-03 11:27 Does mmap gives a right result?! Francesco PIRANEO GIULIANO
2010-10-03 17:04 ` Jeffrey Carter [this message]
2010-10-03 17:49 ` Björn
2010-10-03 19:22   ` Francesco PIRANEO GIULIANO
2010-10-03 19:32     ` Shark8
2010-10-11  3:03       ` David Thompson
2010-10-04  8:05 ` Ludovic Brenta
2010-10-04 21:11   ` Francesco PIRANEO GIULIANO
2010-10-04  9:06 ` Jacob Sparre Andersen
2010-10-04 21:08   ` Francesco PIRANEO GIULIANO
2010-10-05  8:19     ` Ludovic Brenta
2010-10-05 13:17     ` Jacob Sparre Andersen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox