| 997 | } /* dlamc5_ */ |
| 998 | |
| 999 | logical lsame_(char *ca, char *cb) |
| 1000 | { |
| 1001 | /* System generated locals */ |
| 1002 | logical ret_val; |
| 1003 | |
| 1004 | /* Local variables */ |
| 1005 | static integer inta, intb, zcode; |
| 1006 | |
| 1007 | |
| 1008 | /* |
| 1009 | -- LAPACK auxiliary routine (version 3.2) -- |
| 1010 | Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. |
| 1011 | November 2006 |
| 1012 | |
| 1013 | |
| 1014 | Purpose |
| 1015 | ======= |
| 1016 | |
| 1017 | LSAME returns .TRUE. if CA is the same letter as CB regardless of |
| 1018 | case. |
| 1019 | |
| 1020 | Arguments |
| 1021 | ========= |
| 1022 | |
| 1023 | CA (input) CHARACTER*1 |
| 1024 | CB (input) CHARACTER*1 |
| 1025 | CA and CB specify the single characters to be compared. |
| 1026 | |
| 1027 | ===================================================================== |
| 1028 | |
| 1029 | |
| 1030 | Test if the characters are equal |
| 1031 | */ |
| 1032 | |
| 1033 | ret_val = *(unsigned char *)ca == *(unsigned char *)cb; |
| 1034 | if (ret_val) { |
| 1035 | return ret_val; |
| 1036 | } |
| 1037 | |
| 1038 | /* Now test for equivalence if both characters are alphabetic. */ |
| 1039 | |
| 1040 | zcode = 'Z'; |
| 1041 | |
| 1042 | /* |
| 1043 | Use 'Z' rather than 'A' so that ASCII can be detected on Prime |
| 1044 | machines, on which ICHAR returns a value with bit 8 set. |
| 1045 | ICHAR('A') on Prime machines returns 193 which is the same as |
| 1046 | ICHAR('A') on an EBCDIC machine. |
| 1047 | */ |
| 1048 | |
| 1049 | inta = *(unsigned char *)ca; |
| 1050 | intb = *(unsigned char *)cb; |
| 1051 | |
| 1052 | if (zcode == 90 || zcode == 122) { |
| 1053 | |
| 1054 | /* |
| 1055 | ASCII is assumed - ZCODE is the ASCII code of either lower or |
| 1056 | upper case 'Z'. |
no outgoing calls
no test coverage detected