[DGD] LPC error
Felix A. Croes
felix at dworkin.nl
Wed Mar 25 21:32:44 CET 1998
Jason Cone <jcone at cs.tamu.edu> wrote:
> Greetings.
>
> I'm getting a "too many functions declared" error when compiling an object.
> Any words of wisdom regarding this?
DGD has a number of builtin limits:
- at most 255 variable definitions per program
- at most 255 function definitions per program
- at most 32 function arguments/local variables per function
- at most 65535 bytes of code per function
- An object can inherit at most 254 other objects (complication: with
multiple inheritance, an object inherited more than once may count
as more than one)
- strings can be at most 65535 bytes long
- arrays/mappings can have at most 32767 elements/element pairs
There are also some limits that can be extended with appropriate
changes in dgd/src/config.h:
- at most 65535 objects
- at most 65535 swap sectors
Rather than putting 256 or more functions in a single program, you can
split it up into several pieces, inherited by the same object.
Function prototypes also count as function definitions; however, they
are only needed in the following situation: object O inherits M and N,
and M wants to call a function in N or in O. Any other use of
prototypes in LPC (for example, C-style include files with lots of
prototypes for objects that are inherited) are bad programming
practice.
Dworkin
More information about the DGD
mailing list