| 2145 | |
| 2146 | |
| 2147 | dsc* evlAsciiVal(thread_db* tdbb, const SysFunction*, const NestValueArray& args, |
| 2148 | impure_value* impure) |
| 2149 | { |
| 2150 | fb_assert(args.getCount() == 1); |
| 2151 | |
| 2152 | Request* request = tdbb->getRequest(); |
| 2153 | |
| 2154 | const dsc* value = EVL_expr(tdbb, request, args[0]); |
| 2155 | if (request->req_flags & req_null) // return NULL if value is NULL |
| 2156 | return NULL; |
| 2157 | |
| 2158 | const CharSet* cs = INTL_charset_lookup(tdbb, value->getCharSet()); |
| 2159 | |
| 2160 | UCHAR* p; |
| 2161 | MoveBuffer temp; |
| 2162 | int length = MOV_make_string2(tdbb, value, value->getCharSet(), &p, temp); |
| 2163 | |
| 2164 | if (length == 0) |
| 2165 | impure->vlu_misc.vlu_short = 0; |
| 2166 | else |
| 2167 | { |
| 2168 | UCHAR dummy[4]; |
| 2169 | |
| 2170 | if (cs->substring(length, p, sizeof(dummy), dummy, 0, 1) != 1) |
| 2171 | status_exception::raise(Arg::Gds(isc_arith_except) << Arg::Gds(isc_transliteration_failed)); |
| 2172 | |
| 2173 | impure->vlu_misc.vlu_short = p[0]; |
| 2174 | } |
| 2175 | |
| 2176 | impure->vlu_desc.makeShort(0, &impure->vlu_misc.vlu_short); |
| 2177 | |
| 2178 | return &impure->vlu_desc; |
| 2179 | } |
| 2180 | |
| 2181 | |
| 2182 | dsc* evlAtan2(thread_db* tdbb, const SysFunction* function, const NestValueArray& args, |
nothing calls this directly
no test coverage detected