A simple DLM question [message #81248] |
Mon, 27 August 2012 10:13 |
Xin Tao
Messages: 40 Registered: April 2011
|
Member |
|
|
Hi,
I'm having trouble figuring out the problem of the following DLM code:
/* The c routine */
void simple(int argc, IDL_VPTR argv[])
{
IDL_VPTR v;
v = IDL_BasicTypeConversion(1, &argv[0], IDL_TYP_DOUBLE);
IDL_DELTMP(v);
}
This routine just takes its input and convert it to double. After converting it to a DLM, however, I seem to see strange results.
IDL> simple, 1.0d
% Loaded DLM: TESTMODULE.
IDL> simple, -1.0d
Bus error
That is: if I give it 1.0d as input, then the code is fine. However, if I use -1.0d, then there is a BUS error, presumably from IDL_DELTMP(v). I really don't understand why this is the case. Isn't IDL_DELTMP supposed to decide first whether v is a temporary variable or not? If I remove IDL_DELTMP, of course, I'll frequently get the annoying warning message "% Temporary variables are still checked out - cleaning up...".
Please give me some help. Thanks.
|
|
|