aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/defs.h
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-04-23 19:58:13 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-04-23 23:44:32 +0200
commit2ed91f222f1dddda10fbdc9cb80df2be7d4c2da3 (patch)
treea5448dfc1bd0440167cdfad4e3041ca1548bbf52 /src/nvim/api/private/defs.h
parent62c3f436a96e2102ec5c1e3af974c8e57fe4e76c (diff)
downloadrneovim-2ed91f222f1dddda10fbdc9cb80df2be7d4c2da3.tar.gz
rneovim-2ed91f222f1dddda10fbdc9cb80df2be7d4c2da3.tar.bz2
rneovim-2ed91f222f1dddda10fbdc9cb80df2be7d4c2da3.zip
api/internal: Remove `set` field from Error type.
Diffstat (limited to 'src/nvim/api/private/defs.h')
-rw-r--r--src/nvim/api/private/defs.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h
index a07422bd12..60bf38265f 100644
--- a/src/nvim/api/private/defs.h
+++ b/src/nvim/api/private/defs.h
@@ -8,9 +8,11 @@
#define ARRAY_DICT_INIT {.size = 0, .capacity = 0, .items = NULL}
#define STRING_INIT {.data = NULL, .size = 0}
#define OBJECT_INIT { .type = kObjectTypeNil }
-#define ERROR_INIT { .set = false, .msg = NULL }
+#define ERROR_INIT { .type = kErrorTypeNone, .msg = NULL }
#define REMOTE_TYPE(type) typedef handle_T type
+#define ERROR_SET(e) ((e)->type != kErrorTypeNone)
+
#ifdef INCLUDE_GENERATED_DECLARATIONS
# define ArrayOf(...) Array
# define DictionaryOf(...) Dictionary
@@ -20,6 +22,7 @@ typedef int handle_T;
// Basic types
typedef enum {
+ kErrorTypeNone = -1,
kErrorTypeException,
kErrorTypeValidation
} ErrorType;
@@ -39,7 +42,6 @@ typedef enum {
typedef struct {
ErrorType type;
char *msg;
- bool set;
} Error;
typedef bool Boolean;