ReactOS 0.4.15-dev-7942-gd23573b
_handle_error.c File Reference
#include <math.h>
Include dependency graph for _handle_error.c:

Go to the source code of this file.

Functions

int __cdecl _invoke_matherr (int type, char *name, double arg1, double arg2, double retval)
 
double __cdecl _handle_error (char *fname, int opcode, unsigned long long value, int type, int flags, int error, double arg1, double arg2, int nargs)
 Handles an error condition.
 
float __cdecl _handle_errorf (char *fname, int opcode, unsigned long long value, int type, int flags, int error, float arg1, float arg2, int nargs)
 

Function Documentation

◆ _handle_error()

double __cdecl _handle_error ( char fname,
int  opcode,
unsigned long long  value,
int  type,
int  flags,
int  error,
double  arg1,
double  arg2,
int  nargs 
)

Handles an error condition.

Parameters
fname- The name of the function that caused the error.
opcode- Opcode of the function that cause the error (see OP_* consants in fpieee.h).
value- The value to be returned, encoded as uint64_t.
type- The type of error (see _DOMAIN, ... in math.h)
flags- Exception flags (see AMD_F_* constants).
error- Specifies the CRT error code (EDOM, ...).
arg1- First parameter to the function that cause the error.
arg2- Second parameter to the function that cause the error.
nargs- Number of parameters to the function that cause the error.
Returns
The value to be returned.

Definition at line 34 of file _handle_error.c.

44{
45 float retval = *(double*)&value;
46
47 _invoke_matherr(type, fname, arg1, arg2, retval);
48
49 return retval;
50}
int __cdecl _invoke_matherr(int type, char *name, double arg1, double arg2, double retval)
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint GLuint GLuint arg1
Definition: glext.h:9513
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
Definition: pdh_main.c:94

Referenced by _exp2(), _exp_special(), _hypot(), _log_special_common(), _logb(), _pow_special(), _sincos_special(), acos(), asin(), atan(), atan2(), ceil(), cosh(), floor(), remainder(), sinh(), sqrt(), tan(), and tanh().

◆ _handle_errorf()

float __cdecl _handle_errorf ( char fname,
int  opcode,
unsigned long long  value,
int  type,
int  flags,
int  error,
float  arg1,
float  arg2,
int  nargs 
)

Definition at line 56 of file _handle_error.c.

66{
67 float retval = *(float*)&value;
68
69 _invoke_matherr(type, fname, arg1, arg2, retval);
70
71 return retval;
72}

Referenced by _expf_special(), _hypotf(), _logbf(), _logf_special_common(), _powf_special(), _sincosf_special(), acosf(), asinf(), atan2f(), atanf(), ceilf(), coshf(), floorf(), remainderf(), sinhf(), sqrtf(), tanf(), and tanhf().

◆ _invoke_matherr()

int __cdecl _invoke_matherr ( int  type,
char name,
double  arg1,
double  arg2,
double  retval 
)

Definition at line 24 of file _invoke_matherr.c.

30{
31 if (user_matherr != NULL)
32 {
33 struct _exception excpt;
34 excpt.type = type;
35 excpt.name = name;
36 excpt.arg1 = arg1;
37 excpt.arg2 = arg2;
38 excpt.retval = retval;
39 return user_matherr(&excpt);
40 }
41 else
42 {
43 return 0;
44 }
45}
static _UserMathErrorFunctionPointer user_matherr
#define NULL
Definition: types.h:112
double retval
Definition: math.h:25
char * name
Definition: math.h:22
int type
Definition: math.h:21

Referenced by _handle_error(), and _handle_errorf().