next up previous 86
Next: About this document ...
Up: GENERIC A Utility for Preprocessing Generic Fortran and C Subroutines
Previous: A Full Table of Token Translations


A Full List of Conversion Functions

This appendix gives the conversion functions which are available using the DCV utility, and describes which ones are statement functions and which ones are external.

The following conversions are defined as in-line statement functions in `DCV_FUN'. (They are either trivial, or are mentioned in the Fortran manual as legal conversions).

Function name Conversion  
DCV_BTOB BYTE to BYTE  
DCV_UBTOUB UNSIGNED BYTE to UNSIGNED BYTE  
DCV_UBTOD UNSIGNED BYTE to DOUBLE PRECISION  
DCV_DTOD DOUBLE PRECISION to DOUBLE PRECISION  
DCV_ITOD INTEGER to DOUBLE PRECISION  
DCV_RTOD REAL to DOUBLE PRECISION  
DCV_WTOD WORD to DOUBLE PRECISION  
DCV_UWTOD UNSIGNED WORD to DOUBLE PRECISION  
DCV_UBTOI UNSIGNED BYTE to INTEGER  
DCV_DTOI DOUBLE PRECISION to INTEGER  
DCV_ITOI INTEGER to INTEGER  
DCV_RTOI REAL to INTEGER  
DCV_UWTOI UNSIGNED WORD to INTEGER  
DCV_UBTOR UNSIGNED BYTE to REAL  
DCV_DTOR DOUBLE PRECISION to REAL  
DCV_ITOR INTEGER to REAL  
DCV_RTOR REAL to REAL  
DCV_WTOR WORD to REAL  
DCV_UWTOR UNSIGNED WORD to REAL  
DCV_UBTOW UNSIGNED BYTE to WORD  
DCV_DTOW DOUBLE PRECISION to WORD ***
DCV_RTOW REAL to WORD ***
DCV_WTOW WORD to WORD  
DCV_UBTOUW UNSIGNED BYTE to UNSIGNED WORD  
DCV_UWTOUW UNSIGNED WORD to UNSIGNED WORD  

Overflow errors are possible from the conversions marked ``***''

The following conversions are also defined as in-line statement functions in `DCV_FUN'. However, they are not mentioned in the Fortran manual and should be used with caution. Trial and error has shown that the Fortran compliers on all Starlink supported systems will make the conversions successfully :-

Function name Conversion  
DCV_UBTOB UNSIGNED BYTE to BYTE ***
DCV_DTOB DOUBLE PRECISION to BYTE ***
DCV_ITOB INTEGER to BYTE ***
DCV_RTOB REAL to BYTE ***
DCV_WTOB WORD to BYTE ***
DCV_UWTOB UNSIGNED WORD to BYTE ***
DCV_BTOD BYTE to DOUBLE PRECISION  
DCV_BTOI BYTE to INTEGER  
DCV_WTOI WORD to INTEGER  
DCV_BTOR BYTE to REAL  
DCV_BTOW BYTE to WORD  
DCV_ITOW INTEGER to WORD ***

Overflow errors are possible from the conversions marked ``***''

The following conversions are defined as external functions in the DCV object library :-

Function name Conversion
DCV_BTOUB BYTE to UNSIGNED BYTE
DCV_DTOUB DOUBLE PRECISION to UNSIGNED BYTE
DCV_ITOUB INTEGER to UNSIGNED BYTE
DCV_RTOUB REAL to UNSIGNED BYTE
DCV_WTOUB WORD to UNSIGNED BYTE
DCV_UWTOUB UNSIGNED WORD to UNSIGNED BYTE
DCV_BTOUW BYTE to UNSIGNED WORD
DCV_UBTOUW UNSIGNED BYTE to UNSIGNED WORD
DCV_DTOUW DOUBLE PRECISION to UNSIGNED WORD
DCV_ITOUW INTEGER to UNSIGNED WORD
DCV_RTOUW REAL to UNSIGNED WORD
DCV_WTOUW WORD to UNSIGNED WORD

Overflow errors are possible in ALL these conversions, so range checking is essential.



next up previous 86
Next: About this document ...
Up: GENERIC A Utility for Preprocessing Generic Fortran and C Subroutines
Previous: A Full Table of Token Translations

GENERIC --- A Utility for Preprocessing Generic Fortran and C Subroutines
Starlink User Note 7
S M Beard
P M Allan
Malcolm J. Currie
Peter W. Draper
2006 May 8
E-mail:starlink@jiscmail.ac.uk

Copyright © 2013 Science and Technology Facilities Council