forked from microsoft/calculator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalcErr.h
85 lines (73 loc) · 2.59 KB
/
CalcErr.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
// CalcErr.h
//
// Defines the error codes thrown by ratpak and caught by Calculator
//
//
// Ratpak errors are 32 bit values laid out as follows:
//
// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
// +-+-------+---------------------+-------------------------------+
// |S| R | Facility | Code |
// +-+-------+---------------------+-------------------------------+
//
// where
//
// S - Severity - indicates success/fail
//
// 0 - Success
// 1 - Fail
//
// R - Reserved - not currently used for anything
//
// r - reserved portion of the facility code. Reserved for internal
// use. Used to indicate int32_t values that are not status
// values, but are instead message ids for display strings.
//
// Facility - is the facility code
//
// Code - is the actual error code
//
// This format is based loosely on an OLE HRESULT and is compatible with the
// SUCCEEDED and FAILED macros as well as the HRESULT_CODE macro
typedef int32_t ResultCode;
// CALC_E_DIVIDEBYZERO
//
// The current operation would require a divide by zero to complete
static constexpr uint32_t CALC_E_DIVIDEBYZERO = (uint32_t)0x80000000;
// CALC_E_DOMAIN
//
// The given input is not within the domain of this function
static constexpr uint32_t CALC_E_DOMAIN = (uint32_t)0x80000001;
// CALC_E_INDEFINITE
//
// The result of this function is undefined
static constexpr uint32_t CALC_E_INDEFINITE = (uint32_t)0x80000002;
// CALC_E_POSINFINITY
//
// The result of this function is Positive Infinity.
static constexpr uint32_t CALC_E_POSINFINITY = (uint32_t)0x80000003;
// CALC_E_NEGINFINITY
//
// The result of this function is Negative Infinity
static constexpr uint32_t CALC_E_NEGINFINITY = (uint32_t)0x80000004;
// CALC_E_INVALIDRANGE
//
// The given input is within the domain of the function but is beyond
// the range for which calc can successfully compute the answer
static constexpr uint32_t CALC_E_INVALIDRANGE = (uint32_t)0x80000006;
// CALC_E_OUTOFMEMORY
//
// There is not enough free memory to complete the requested function
static constexpr uint32_t CALC_E_OUTOFMEMORY = (uint32_t)0x80000007;
// CALC_E_OVERFLOW
//
// The result of this operation is an overflow
static constexpr uint32_t CALC_E_OVERFLOW = (uint32_t)0x80000008;
// CALC_E_NORESULT
//
// The result of this operation is undefined
static constexpr uint32_t CALC_E_NORESULT = (uint32_t)0x80000009;