
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tlug] c++ compile prolem
- Date: Fri, 28 Feb 2003 09:54:41 +0000
- From: Brett Robson <b-robson@example.com>
- Subject: [tlug] c++ compile prolem
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2a) Gecko/20020910
Sorry to ask such a basic question, but short of learning c++
there's not much I can do.
I need to install some c++ programmes and I've hit a compile error.
----------------------------------------------------
XMap.cc: In method `XMap::XMap(int)':
XMap.cc:32: ANSI C++ forbids implicit conversion from `void *' in
assignment
*** Error code 1
Stop in /web/standard/www.pacifica.co.jp/temporary/freya-0.92.4/src.
----------------------------------------------------
Using:
gcc version 2.95.3 20010315 (release) [FreeBSD]
This is code section below, the error line, line 32, is
higlighted with *** I assume off_t is standard type, it's not
defined in the source anywhere. I've fiddled with compile options
to no avail.
Thanks,
Brett
----------------------------------------------------
XMap::XMap(int filedesc)
: fd(filedesc)
{
struct stat st;
fstat(fd, &st);
mapsize = st.st_size;
entryNum = mapsize / ENTRYSIZE - 1;
mapaddr = mmap(NULL, // start address (hint)
mapsize, // size
PROT_READ, // protection
MAP_SHARED, // flags
fd, // file descriptor
*** (off_t)0 ); // file offset
if((caddr_t)(-1) == mapaddr)
PRINTERRMSG("mmap() failed.");
maxoffset = getbase(entryNum); //
\xbe\xef\xa4\xcb\xc5\xf9\xa4\xb7\xa4\xa4
scores = new int[TYPENUM + 1];
short int *p = (short int *)((char *)mapaddr +
ENTRYSIZE * entryNum +
sizeof(pos_t));
scores[0] = 1;
for(int i = 0; i < TYPENUM; i++)
scores[i+1] = p[i];
}
----------------------------------------------------
Home |
Main Index |
Thread Index