comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » "Array has too many elements" in an anonymous structure
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
"Array has too many elements" in an anonymous structure [message #84634] Thu, 20 October 2011 01:24
franzpx125 is currently offline  franzpx125
Messages: 6
Registered: September 2008
Junior Member
Hi,

I want to build an IDL wrapper for a C function that returns a struct.
This struct contains several arrays and other data. I'm returning an
anonymous structure but for "big" arrays (with "big" I mean about 7000
elements). I get at run-time the error "Array has too many elements".
This is the essential code (for just one array):

static IDL_MEMINT node_dims[IDL_MAX_ARRAY_DIM];

static IDL_STRUCT_TAG_DEF NodeStats_tags[] = {
{ "NODEVOXELS_COUNT", 0, (void *) IDL_TYP_UINT},
{ "NODEVOXELS_WIDTH", node_dims, (void *) IDL_TYP_DOUBLE},
{ 0 }
};


IDL_VPTR p3d_idlFoo(int argc, IDL_VPTR argv[], char* argk) {

...

struct NodeStats stats;


IDL_LONG tmp_dims[IDL_MAX_ARRAY_DIM];
IDL_MEMINT offset;
double* d_tmp_ptr;
unsigned short* us_tmp_ptr;
char* s_data;

...


Skel_tags_node_dims[0] = 1;
Skel_tags_node_dims[1] = (IDL_MEMINT) stats.Node_Counter;

s = IDL_MakeStruct(NULL, SkelStats2_tags);

tmp_dims[0] = 1;
s_data = (char *) IDL_MakeTempStruct(s, 1, tmp_dims, &idl_out_struct,
0);

offset = IDL_StructTagInfoByName(s, "NODEVOXELS_COUNT",
IDL_MSG_LONGJMP, NULL);
us_tmp_ptr = (unsigned short *) (s_data + offset);
*(us_tmp_ptr++) = stats.Node_Counter;

offset = IDL_StructTagInfoByName(s, "NODEVOXELS_WIDTH",
IDL_MSG_LONGJMP, NULL);
d_tmp_ptr = (double *) (s_data + offset);
for (i = 0; i < stats.Node_Counter; i++)
*(d_tmp_ptr++) = stats.Node_Width[i];

...
}


What am I doing wrong? Thanks in advance for any help...

Franz
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ENVI evf File Format
Next Topic: Re: IDL 8.1 is a Piece of Work

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:43:49 PDT 2025

Total time taken to generate the page: 0.00500 seconds