updated top-level README and version_decl for V4.4.2 (#1795)
[WRF.git] / external / io_grib2 / g2lib / mova2i.c
bloba6d35395736f621659959c7ea5f1a10b0c8902fc
1 /*$$$ SUBPROGRAM DOCUMENTATION BLOCK
2 C . . . .
3 C SUBPROGRAM: mova2i Moves a bit string from a char*1 to int
4 C PRGMMR: Gilbert ORG: W/NP11 DATE: 02-08-15
6 C ABSTRACT: This Function copies a bit string from a Character*1 variable
7 C to an integer variable. It is intended to replace the Fortran Intrinsic
8 C Function ICHAR, which only supports 0 <= ICHAR(a) <= 127 on the
9 C IBM SP. If "a" is greater than 127 in the collating sequence,
10 C ICHAR(a) does not return the expected bit value.
11 C This function can be used for all values 0 <= ICHAR(a) <= 255.
13 C PROGRAM HISTORY LOG:
14 C 98-12-15 Gilbert
16 C USAGE: I = mova2i(a)
18 C INPUT ARGUMENT :
20 C a - Character*1 variable that holds the bitstring to extract
22 C RETURN ARGUMENT :
24 C mova2i - Integer value of the bitstring in character a
26 C REMARKS:
28 C None
30 C ATTRIBUTES:
31 C LANGUAGE: C
32 C MACHINE: IBM SP
35 C$$$i*/
37 #include "proto.h"
39 int MOVA2I(unsigned char *a)
41 return (int)(*a);