Hello Paul!
PE> it. Here's the problem. A simple last callers pex is
PE> supplied with ProBoard but its in C and not C++. The only
PE> way I can get it to compile is by forcing borland to
PE> compile C and not C++. If I try to use C++ I get the error: -
PE> Borland C++ 4.51 Copyright (c) 1987, 1994 Borland International
PE> _lc.c:
PE> Error _lc.c 57: Cannot convert 'void *' to 'BINLOG *' in
PE> function main(int,char
PE> * *)
PE> *** 1 errors in Compile ***
PE> Here's a copy of line 57: -
PE> bl = malloc( lc_num * sizeof(BINLOG));
I'm not familiar with the ProBoard source code, but I assume that bl is
declared as a pointer to a BINLOG structure? Further, I assume that BINLOG
is a POD (C-type Plain Ol' Data) structure?
If so, the problem is that malloc returns a void*, which must be explicitly
cast to a BINLOG*
The simple fix is to replace the line by
bl = (BINLOG*) malloc( lc_num * sizeof(BINLOG));
However, since you are doing this as C++, rather than C, why are you using
malloc anyway? I'd completely replace this line with
bl = new BINLOG[lc_num];
and replace the later call to free(bl) by
delete[] bl;
-Ron (ron-bass@ti.com)
--- EZPoint V2.2
---------------
* Origin: There's a point here, somewhere... (1:128/13.3)
|