diff options
author | 2017-11-06 12:50:14 -0800 | |
---|---|---|
committer | 2017-11-06 12:50:14 -0800 | |
commit | 0be9ad440878b94d9a68f35992c23e7f99375dbc (patch) | |
tree | 9ce37a5e50f1ee47df6d42ef3e44d63160e8d0dc /src/core/lib/iomgr/error.h | |
parent | c60659ad023d01f8d0f6ad0f87fefbd3740002d0 (diff) | |
parent | e759d2ad7abdb0702970eeccc5f033ff4b2a4c7f (diff) |
Merge github.com:grpc/grpc into lfe3
Diffstat (limited to 'src/core/lib/iomgr/error.h')
-rw-r--r-- | src/core/lib/iomgr/error.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h index b36330a7ab..36ba440c8a 100644 --- a/src/core/lib/iomgr/error.h +++ b/src/core/lib/iomgr/error.h @@ -122,15 +122,15 @@ typedef enum { /// They are always even so that other code (particularly combiner locks, /// polling engines) can safely use the lower bit for themselves. -#define GRPC_ERROR_NONE ((grpc_error *)NULL) -#define GRPC_ERROR_OOM ((grpc_error *)2) -#define GRPC_ERROR_CANCELLED ((grpc_error *)4) +#define GRPC_ERROR_NONE ((grpc_error*)NULL) +#define GRPC_ERROR_OOM ((grpc_error*)2) +#define GRPC_ERROR_CANCELLED ((grpc_error*)4) -const char *grpc_error_string(grpc_error *error); +const char* grpc_error_string(grpc_error* error); /// Create an error - but use GRPC_ERROR_CREATE instead -grpc_error *grpc_error_create(const char *file, int line, grpc_slice desc, - grpc_error **referencing, size_t num_referencing); +grpc_error* grpc_error_create(const char* file, int line, grpc_slice desc, + grpc_error** referencing, size_t num_referencing); /// Create an error (this is the preferred way of generating an error that is /// not due to a system call - for system calls, use GRPC_OS_ERROR or /// GRPC_WSA_ERROR as appropriate) @@ -156,44 +156,44 @@ grpc_error *grpc_error_create(const char *file, int line, grpc_slice desc, errs, count) #ifndef NDEBUG -grpc_error *grpc_error_ref(grpc_error *err, const char *file, int line); -void grpc_error_unref(grpc_error *err, const char *file, int line); +grpc_error* grpc_error_ref(grpc_error* err, const char* file, int line); +void grpc_error_unref(grpc_error* err, const char* file, int line); #define GRPC_ERROR_REF(err) grpc_error_ref(err, __FILE__, __LINE__) #define GRPC_ERROR_UNREF(err) grpc_error_unref(err, __FILE__, __LINE__) #else -grpc_error *grpc_error_ref(grpc_error *err); -void grpc_error_unref(grpc_error *err); +grpc_error* grpc_error_ref(grpc_error* err); +void grpc_error_unref(grpc_error* err); #define GRPC_ERROR_REF(err) grpc_error_ref(err) #define GRPC_ERROR_UNREF(err) grpc_error_unref(err) #endif -grpc_error *grpc_error_set_int(grpc_error *src, grpc_error_ints which, +grpc_error* grpc_error_set_int(grpc_error* src, grpc_error_ints which, intptr_t value) GRPC_MUST_USE_RESULT; -bool grpc_error_get_int(grpc_error *error, grpc_error_ints which, intptr_t *p); -grpc_error *grpc_error_set_str(grpc_error *src, grpc_error_strs which, +bool grpc_error_get_int(grpc_error* error, grpc_error_ints which, intptr_t* p); +grpc_error* grpc_error_set_str(grpc_error* src, grpc_error_strs which, grpc_slice str) GRPC_MUST_USE_RESULT; /// Returns false if the specified string is not set. /// Caller does NOT own the slice. -bool grpc_error_get_str(grpc_error *error, grpc_error_strs which, - grpc_slice *s); +bool grpc_error_get_str(grpc_error* error, grpc_error_strs which, + grpc_slice* s); /// Add a child error: an error that is believed to have contributed to this /// error occurring. Allows root causing high level errors from lower level /// errors that contributed to them. -grpc_error *grpc_error_add_child(grpc_error *src, - grpc_error *child) GRPC_MUST_USE_RESULT; -grpc_error *grpc_os_error(const char *file, int line, int err, - const char *call_name) GRPC_MUST_USE_RESULT; +grpc_error* grpc_error_add_child(grpc_error* src, + grpc_error* child) GRPC_MUST_USE_RESULT; +grpc_error* grpc_os_error(const char* file, int line, int err, + const char* call_name) GRPC_MUST_USE_RESULT; /// create an error associated with errno!=0 (an 'operating system' error) #define GRPC_OS_ERROR(err, call_name) \ grpc_os_error(__FILE__, __LINE__, err, call_name) -grpc_error *grpc_wsa_error(const char *file, int line, int err, - const char *call_name) GRPC_MUST_USE_RESULT; +grpc_error* grpc_wsa_error(const char* file, int line, int err, + const char* call_name) GRPC_MUST_USE_RESULT; /// windows only: create an error associated with WSAGetLastError()!=0 #define GRPC_WSA_ERROR(err, call_name) \ grpc_wsa_error(__FILE__, __LINE__, err, call_name) -bool grpc_log_if_error(const char *what, grpc_error *error, const char *file, +bool grpc_log_if_error(const char* what, grpc_error* error, const char* file, int line); #define GRPC_LOG_IF_ERROR(what, error) \ grpc_log_if_error((what), (error), __FILE__, __LINE__) |