delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/16/22:35:04

From: George Foot <mert0407 AT sable DOT ox DOT ac DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: [Allegro] Datafile problem HELP!
Date: 15 Jun 1998 03:00:03 GMT
Organization: Oxford University, England
Lines: 29
Message-ID: <6m22nj$q5k$1@news.ox.ac.uk>
References: <35845170 DOT 2FA584AD AT netrover DOT com>
NNTP-Posting-Host: sable.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Sun, 14 Jun 1998 18:40:50 -0400 in comp.os.msdos.djgpp Nicolas
Blais <eletech AT netrover DOT com> wrote:

: When I load a datafile within my program, it goes fine, but when I try
: to access data out of it, it gives me Warning : Ansi C++ forbids
: implicit conversion from 'Void *' in argument passing.  This warning
: appears on every line I try to access some BMP or a midi file in the
: example below.

In C++, you must make the conversions explicit, like this:

: MIDI * the_music = datafile[Main].dat;

becomes:  MIDI * the_music = (MIDI *)datafile[Main].dat;

: show_centered_bmp(datafile[Title_Main].dat,100);

becomes:  show_centred_bmp ((BITMAP *)datafile[Title_Main].dat, 100);

This is mentioned in the Allegro documentation (under "Datafiles"), in
the Allegro file `tools/grabber.txt' which is more detailed
documentation on datafiles, and in Allegro Vivace chapter 10
("Datafiles"), specifically subsection 10.3.1 ("Loading an entire
datafile").

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

xu do tavla fo la lojban  --  http://xiron.pc.helsinki.fi/lojban/lojban.html

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019