SPL to HP C/XL Migration Guide (30231-90001)
11-4
The following are HP C/XL reserved words. Examine the SPL source for any
use of these words as variable names.
auto default extern int sizeof union
break do float long static unsigned
case double for register struct void
char else goto return switch while
continue enum if short typedef
You should also avoid the following proposed ANSI C reserved words:
const signed volatile
SPL array declarations should be examined for cases that have a nonzero
lower bound. This is not allowed in HP C/XL, and should be recoded to
work properly with a lower bound of zero. Remember that indirect (and
many direct) arrays can be coded in HP C/XL with a pointer to cell zero.
BYTE arrays used for storing ASCII strings should be examined for how
they are used and, if possible, a NUL ('\0', numeric value zero) should
be placed in the last byte. This is done to facilitate later use of the
HP C/XL convention, which expects a NUL to terminate a string.
Be especially careful with cases where word pointers were converted to
byte pointers (and vice versa) by means of shift, multiply, or divide
operations. All pointers in HP C/XL will refer to byte addresses, so
these operations will rarely translate without careful recoding.
Bit operations in SPL are performed for two reasons. One is to unpack
data words read by the program from external files, and the other to
conserve data storage for variables used by the program. In the latter
case, consider declaring whole words for the individual fields and
eliminating the bit operations entirely.
The SPL switch declaration may be left alone at this stage. It will be
converted into an HP C/XL #define macro directive in step 3. See "GO TO
Statement" and "CASE Statement".
Certain operations, such as passing labels as parameters, are not
permitted in HP C/XL, so now could be the time to recode the necessary
operation in more translatable constructs. In general, operations that
use extra data segments and split stack operations, should be removed
and rewritten (if possible), or at least isolated into separate proce-
dures.
As a final consideration to HP C/XL, move all of the SPL program's outer
block executable statements into a new procedure named main, and make
the new outer block consist of a single statement, calling this proce-
dure. These changes will bring an SPL program as close to HP C/XL con-
ventions as possible, and should be thoroughly tested in this form
before making the plunge into HP C/XL itself.