Common Versions

Description

Common version this indicates a function that only has one version - it does not have a wide version and a narrow version. There are two different kinds of functions that fall into this category.

1. Functions that do not have any widened parameters. For example, in the following two functions, the valid range of the parameter "dtype" is only 0 to 13 (DTYPE_CHAR to DTYPE_UNSET), which fits easly into a 32-bit int. Therefore the functions were not modified at all for AVS/Express 7.0.

OMset_data_type (OMobj_id id, int dtype);

OMget_data_type (OMobj_id id, int *dtype);

2. Functions that do have a widened parameter, but the conversions can be done automatically by the compiler. In the following function, the "size" parameter has been widened.

OMset_array_size (OMobj_id id, int size); /* AVS/Express 6.3 and earlier */
OMset_array_size (OMobj_id id, xp_long size); /* AVS/Express 7.0 and later */

Pre-existing code that calls this function does not need to be altered as long as the code does not need to handle very large arrays. In the following code fragement, its is valid to use the integer version of "size" as long as the array size is less than 2.3 billion.

OMobj_id id;

xp_long l_size;

int i_size;

int stat;

l_size = 100;

stat = OMset_array_size( id, l_size ); /* Valid */

i_size = 100;

stat = OMset_array_size( id, i_size ); /* Valid - compiler converts i_size */

l_size = 3000000000; /* Valid on a 64-bit platform */

stat = OMset_array_size( id, l_size ); /* Valid */

i_size = 3000000000; /* Error - overflow ! */

stat = OMset_array_size( id, i_size ); /* Run-time error ! */