diff options
| author | Damien Laniel <dlaniel@entrouvert.com> | 2007-07-27 17:24:38 +0000 |
|---|---|---|
| committer | Damien Laniel <dlaniel@entrouvert.com> | 2007-07-27 17:24:38 +0000 |
| commit | 63c4824b46830dc4b5dde443acc4205fc0471064 (patch) | |
| tree | 46bd80ba9689534333131b4efa115600629ee4d9 | |
| parent | 573b8e3d401bb8ff27ae5369cafa5c41a8dbaab3 (diff) | |
use a constant for node_infos size
| -rw-r--r-- | swig/Lasso.i | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/swig/Lasso.i b/swig/Lasso.i index 09e867b2..9f817842 100644 --- a/swig/Lasso.i +++ b/swig/Lasso.i @@ -537,7 +537,8 @@ typedef struct node_info { #endif } node_info; -static node_info node_infos[250]; /* FIXME: Size should be computed */ +#define NODE_INFOS_SIZE 250 +static node_info node_infos[NODE_INFOS_SIZE]; /* FIXME: Size should be computed */ /* Cast a LassoNode into the appropriate derivated class. */ static swig_type_info *dynamic_cast_node(void **nodePointer) { @@ -594,8 +595,9 @@ static void set_node_info(node_info *info, char *name, char *superName, swig_typ info->php = php; #endif node_info_count++; - if (node_info_count > 249) { - fprintf(stderr, "node_infos has reached its limit. Call Fred to fix this bug."); + if (node_info_count >= NODE_INFOS_SIZE) { + fprintf(stderr, "node_infos has reached its limit. This is a know bug. \ +It should be dynamically reallocated"); abort(); } } |
