LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a bug in arrresize.c and in the documentation?

Hi all!

Here a some code from  C:\Program Files\National Instruments\LabVIEW 2009\CCodeGen\libsrc\lvanalysis\arrresize.c

 

NumericArrayResize function:

 

if (! *ap) return mgArgErr;                                  
p = **ap;                                                    
arr = (int32 *)p;                                            
                                                             
if (n == 0 && *ap == NULL) {                                 
    *ap = (UHandle)DSNewHClr( (size_t)(nd * sizeof(int32)) );
    if (! *ap) {                                            
        SetError(kArresizeModNum, kMemFail);                
        return mFullErr;                                    
    }                                                       
    return noErr;                                           
}                                                            

 

Does anybody see  an error?

And here NumericArrayResize (CIN Function):

If *dataHP is NULL, LabVIEW allocates a new array handle in *dataHP.

0 Kudos
Message 1 of 9
(5,006 Views)

this is ok:

p = **ap;
arr =(int32 *)p;

compiler optimize it...

 

but here I'm weeping:

if ((dt == doubleDataType || dt == cmplx128DataType) && (nd % 2)) {
  newSize += 4; //allow for 8 byte alignment of doubles
}

 

0 Kudos
Message 2 of 9
(4,993 Views)

are you sure that int32 is a valid identifier in CVI?

0 Kudos
Message 3 of 9
(4,991 Views)
Please read more closely!
0 Kudos
Message 4 of 9
(4,989 Views)
 it appears to me that your example code refers to LabView, not CVI
0 Kudos
Message 5 of 9
(4,985 Views)

You are in part right! But all this functions developed to use in CVI. See the forum please.

0 Kudos
Message 6 of 9
(4,980 Views)

If somebody bring me that LabWindows/CVI has NumericArrayResize implementation which is differ from LabView's one, I'll move the post with a Bug to LabView's branch immediately.

 

Message Edited by kolan on 02-27-2010 12:08 PM
0 Kudos
Message 7 of 9
(4,952 Views)

Hey Kolan,

I did some searching on the CCodeGen directory as I don't have this or the file here on my machine so I could test the behavior. It looks like this directory is usually present, however, if you are using any of our LabVIEW Embedded products such as LV for ARM, LV for Blackfin, or Microprocessor SDK. If this is the case, then there is actually another forum where they should be able to help you further. Here is the link:

 

LabVIEW Embedded Forum

http://forums.ni.com/ni/board?board.id=420

 

Lars

 

0 Kudos
Message 8 of 9
(4,881 Views)

Lars_L, Thanks! The topic continues here.

0 Kudos
Message 9 of 9
(4,863 Views)