delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/22/19:49:26

From: "doug" <deleveld AT dds DOT nl>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: djgpp strangeness
Date: 23 Dec 1999 00:05:14 GMT
Organization: none
Lines: 39
Message-ID: <01bf4cda$41f7bec0$69247d81@doug>
References: <tmU74.34$Fc6 DOT 1542 AT weber DOT videotron DOT net> <14684.897$Qz2 DOT 16629 AT wagner DOT videotron DOT net>
NNTP-Posting-Host: client36-105.oprit.rug.nl
X-Trace: info.service.rug.nl 945907514 7979 129.125.36.105 (23 Dec 1999 00:05:14 GMT)
X-Complaints-To: newsmaster AT rug DOT nl
NNTP-Posting-Date: 23 Dec 1999 00:05:14 GMT
X-Newsreader: Microsoft Internet News 4.70.1155
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Valkir <jfd50 AT videotron DOT ca> schreef in artikel
<14684.897$Qz2 DOT 16629 AT wagner DOT videotron DOT net>...
> Here's the code:
> int main()
> {long x,y;
>  uchar *Video;
>  Buffer=(uchar *)malloc(1920000);
>  cVesa *Vesa=(cVesa *)malloc(sizeof(cVesa));

So Vesa is a pointer to some unknown struct to some allocated memory here.

>  Video=Vesa->InitVesa();

Maybe my brain is going funny here, but you are calling a function pointer
that 
is part of the struct, but the struct has not been initialized yet.  I take
it that InitVesa 
is a function pointer that is part of the struct.  Where is this InitVesa 
function and what does it look like?

> //////// cDesktop *Deskt=(cDesktop *)malloc(sizeof(cDesktop));
>  for(x=0;x<800;x++)
>   for(y=0;y<2400;y++)
>    *(Buffer+y*800+x)=x;
> 
>  memcpy(Video,Buffer,1920000);
>  getkey();
>  Vesa->Close();

Another function call to the struct that is (as far as I can tell)
is still unitialized, i.e. filled with garbage.

>  return(0);
> }

I hope this helps

Doug Eleveld

- Raw text -


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