------------------------------------------------------------------ */ decContextSetStatusFromStringQuiet -- set status from a string */ / context is the context structure to be updated */ string is a string exactly equal to one that might be returned */ by decContextStatusToString */ / The status bit corresponding to the string is set; no trap
| 279 | /* returned. */ |
| 280 | /* ------------------------------------------------------------------ */ |
| 281 | decContext * decContextSetStatusFromStringQuiet(decContext *context, |
| 282 | const char *string) { |
| 283 | if (strcmp(string, DEC_Condition_CS)==0) |
| 284 | return decContextSetStatusQuiet(context, DEC_Conversion_syntax); |
| 285 | if (strcmp(string, DEC_Condition_DZ)==0) |
| 286 | return decContextSetStatusQuiet(context, DEC_Division_by_zero); |
| 287 | if (strcmp(string, DEC_Condition_DI)==0) |
| 288 | return decContextSetStatusQuiet(context, DEC_Division_impossible); |
| 289 | if (strcmp(string, DEC_Condition_DU)==0) |
| 290 | return decContextSetStatusQuiet(context, DEC_Division_undefined); |
| 291 | if (strcmp(string, DEC_Condition_IE)==0) |
| 292 | return decContextSetStatusQuiet(context, DEC_Inexact); |
| 293 | if (strcmp(string, DEC_Condition_IS)==0) |
| 294 | return decContextSetStatusQuiet(context, DEC_Insufficient_storage); |
| 295 | if (strcmp(string, DEC_Condition_IC)==0) |
| 296 | return decContextSetStatusQuiet(context, DEC_Invalid_context); |
| 297 | if (strcmp(string, DEC_Condition_IO)==0) |
| 298 | return decContextSetStatusQuiet(context, DEC_Invalid_operation); |
| 299 | #if DECSUBSET |
| 300 | if (strcmp(string, DEC_Condition_LD)==0) |
| 301 | return decContextSetStatusQuiet(context, DEC_Lost_digits); |
| 302 | #endif |
| 303 | if (strcmp(string, DEC_Condition_OV)==0) |
| 304 | return decContextSetStatusQuiet(context, DEC_Overflow); |
| 305 | if (strcmp(string, DEC_Condition_PA)==0) |
| 306 | return decContextSetStatusQuiet(context, DEC_Clamped); |
| 307 | if (strcmp(string, DEC_Condition_RO)==0) |
| 308 | return decContextSetStatusQuiet(context, DEC_Rounded); |
| 309 | if (strcmp(string, DEC_Condition_SU)==0) |
| 310 | return decContextSetStatusQuiet(context, DEC_Subnormal); |
| 311 | if (strcmp(string, DEC_Condition_UN)==0) |
| 312 | return decContextSetStatusQuiet(context, DEC_Underflow); |
| 313 | if (strcmp(string, DEC_Condition_ZE)==0) |
| 314 | return context; |
| 315 | return NULL; // Multiple status, or unknown |
| 316 | } // decContextSetStatusFromStringQuiet |
| 317 | |
| 318 | /* ------------------------------------------------------------------ */ |
| 319 | /* decContextSetStatusQuiet -- set status without trap */ |
nothing calls this directly
no test coverage detected