From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does the UI editor not permit setting size_t / ssize_t?

Solved!
Go to solution

Programmatically it's possible to set VAL_SIZE_T, VAL_SSIZE_T, ..., VAL_INTPTR_T, VAL_UINTPTR_T...

0 Kudos
Message 1 of 8
(4,614 Views)

Hello Wolfgang,

in which context you want to use size_t or ssize_t?

0 Kudos
Message 2 of 8
(4,591 Views)

when writing code that should work both in 32 bit and 64 bit, as recommended by NI Smiley Wink

0 Kudos
Message 3 of 8
(4,589 Views)

Please give me an example.

0 Kudos
Message 4 of 8
(4,580 Views)

I am not sure what kind of example you expect...

 

I have an integer variable representing the number of recorded events of a measurement; in the 32 bit version this is limited to 4*10^9 events which can be a restriction. So for computers running a 64 bit system I'd like to extend it to larger numbers; hence I replaced int by ssize_t and want to dispay this number in a table cell.

 

This is the same transformation that was applied to most CVI library routines in 2010, e.g. PlotXY now expects ssize_t for the number of points to plot.

 

This issue has been already discussed March 2010 with respect to numeric controls here, but it seems that nothing has changed for the better the last four years - the UI editor is still useless in such cases Smiley Sad

0 Kudos
Message 5 of 8
(4,559 Views)
Solution
Accepted by topic author Wolfgang

Hi Wolfgang,

 

The UI editor uses intptr_t and unsigned intptr_t for that purpose. Those types are functionally identical to size_t and ssize_t and so there is no need for all four of them to be in the editor.

 

Luis

Message 6 of 8
(4,528 Views)

Thanks Luis for the extra serivce Smiley Happy

 

Unfortunately this is not mentioned anywhere (I was searching the help)..., and interestingly it is possible to set the type to size_t or to intptr_t programmatically... so I would say I either missed some documentation or systematics Smiley Wink

 

I also had a look into the include file and had the impression that both definitions should be equivalent, but since I encountered a problem (here) I wasn't so sure... So now my conclusion is that the issue reported seems to be a bug...

 

Thanks (and happy holidays)

0 Kudos
Message 7 of 8
(4,522 Views)

That's a valid point. We'll address that in the help (465997).

 

Happy holidays to you as well.

 

Luis

Message 8 of 8
(4,513 Views)