diff options
author | cvs2svn <admin@example.com> | 2012-07-13 17:49:56 +0000 |
---|---|---|
committer | cvs2svn <admin@example.com> | 2012-07-13 17:49:56 +0000 |
commit | 6f82d0e8f9756938f04071892206a5af85e676f0 (patch) | |
tree | 821921a1dd0a5a3cece91121e121cc63c4b68128 /src/regress/lib/libc/cephes/mtherr.c | |
parent | 9204e59073bcf27e1487ec4ac46e981902ddd904 (diff) | |
download | openbsd-eric_g2k12.tar.gz openbsd-eric_g2k12.tar.bz2 openbsd-eric_g2k12.zip |
This commit was manufactured by cvs2git to create tag 'eric_g2k12'.eric_g2k12
Diffstat (limited to 'src/regress/lib/libc/cephes/mtherr.c')
-rw-r--r-- | src/regress/lib/libc/cephes/mtherr.c | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/src/regress/lib/libc/cephes/mtherr.c b/src/regress/lib/libc/cephes/mtherr.c deleted file mode 100644 index 9a47a198bd..0000000000 --- a/src/regress/lib/libc/cephes/mtherr.c +++ /dev/null | |||
@@ -1,114 +0,0 @@ | |||
1 | /* $OpenBSD: mtherr.c,v 1.1 2011/07/02 18:11:01 martynas Exp $ */ | ||
2 | |||
3 | /* | ||
4 | * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> | ||
5 | * | ||
6 | * Permission to use, copy, modify, and distribute this software for any | ||
7 | * purpose with or without fee is hereby granted, provided that the above | ||
8 | * copyright notice and this permission notice appear in all copies. | ||
9 | * | ||
10 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
15 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
16 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
17 | */ | ||
18 | |||
19 | /* mtherr.c | ||
20 | * | ||
21 | * Library common error handling routine | ||
22 | * | ||
23 | * | ||
24 | * | ||
25 | * SYNOPSIS: | ||
26 | * | ||
27 | * char *fctnam; | ||
28 | * int code; | ||
29 | * int mtherr(); | ||
30 | * | ||
31 | * mtherr( fctnam, code ); | ||
32 | * | ||
33 | * | ||
34 | * | ||
35 | * DESCRIPTION: | ||
36 | * | ||
37 | * This routine may be called to report one of the following | ||
38 | * error conditions (in the include file mconf.h). | ||
39 | * | ||
40 | * Mnemonic Value Significance | ||
41 | * | ||
42 | * DOMAIN 1 argument domain error | ||
43 | * SING 2 function singularity | ||
44 | * OVERFLOW 3 overflow range error | ||
45 | * UNDERFLOW 4 underflow range error | ||
46 | * TLOSS 5 total loss of precision | ||
47 | * PLOSS 6 partial loss of precision | ||
48 | * EDOM 33 Unix domain error code | ||
49 | * ERANGE 34 Unix range error code | ||
50 | * | ||
51 | * The default version of the file prints the function name, | ||
52 | * passed to it by the pointer fctnam, followed by the | ||
53 | * error condition. The display is directed to the standard | ||
54 | * output device. The routine then returns to the calling | ||
55 | * program. Users may wish to modify the program to abort by | ||
56 | * calling exit() under severe error conditions such as domain | ||
57 | * errors. | ||
58 | * | ||
59 | * Since all error conditions pass control to this function, | ||
60 | * the display may be easily changed, eliminated, or directed | ||
61 | * to an error logging device. | ||
62 | * | ||
63 | * SEE ALSO: | ||
64 | * | ||
65 | * mconf.h | ||
66 | * | ||
67 | */ | ||
68 | |||
69 | #include <stdio.h> | ||
70 | #include "mconf.h" | ||
71 | |||
72 | int merror = 0; | ||
73 | |||
74 | /* Notice: the order of appearance of the following | ||
75 | * messages is bound to the error codes defined | ||
76 | * in mconf.h. | ||
77 | */ | ||
78 | static char *ermsg[7] = { | ||
79 | "unknown", /* error code 0 */ | ||
80 | "domain", /* error code 1 */ | ||
81 | "singularity", /* et seq. */ | ||
82 | "overflow", | ||
83 | "underflow", | ||
84 | "total loss of precision", | ||
85 | "partial loss of precision" | ||
86 | }; | ||
87 | |||
88 | |||
89 | int mtherr( name, code ) | ||
90 | char *name; | ||
91 | int code; | ||
92 | { | ||
93 | |||
94 | /* Display string passed by calling program, | ||
95 | * which is supposed to be the name of the | ||
96 | * function in which the error occurred: | ||
97 | */ | ||
98 | printf( "\n%s ", name ); | ||
99 | |||
100 | /* Set global error message word */ | ||
101 | merror = code; | ||
102 | |||
103 | /* Display error message defined | ||
104 | * by the code argument. | ||
105 | */ | ||
106 | if( (code <= 0) || (code >= 7) ) | ||
107 | code = 0; | ||
108 | printf( "%s error\n", ermsg[code] ); | ||
109 | |||
110 | /* Return to calling | ||
111 | * program | ||
112 | */ | ||
113 | return( 0 ); | ||
114 | } | ||