summaryrefslogtreecommitdiff
path: root/upb/def.h
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2016-05-12 11:54:34 -0700
committerJoshua Haberman <jhaberman@gmail.com>2016-05-12 11:54:34 -0700
commitfa338b70a602d9f5657528d0322535959a92d4b0 (patch)
treea7ec8b8d61a1ff3657aff99316ec51a8b81726ad /upb/def.h
parente16ed470be7d0d459e85e1d7b43893358a625d34 (diff)
Added UPB_ASSERT() that helps avoid unused var warnings.
* Added UPB_ASSERT() that helps avoid unused var warnings. * Addressed PR comments. * Fixed assert in the JIT.
Diffstat (limited to 'upb/def.h')
-rw-r--r--upb/def.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/upb/def.h b/upb/def.h
index 2cfaebc..b4f2352 100644
--- a/upb/def.h
+++ b/upb/def.h
@@ -186,7 +186,7 @@ UPB_END_EXTERN_C
return (upb_##lower *)def; \
} \
UPB_INLINE const upb_##lower *upb_downcast_##lower(const upb_def *def) { \
- assert(upb_def_type(def) == UPB_DEF_##upper); \
+ UPB_ASSERT(upb_def_type(def) == UPB_DEF_##upper); \
return (const upb_##lower *)def; \
} \
UPB_INLINE upb_##lower *upb_dyncast_##lower##_mutable(upb_def *def) { \
@@ -1420,7 +1420,7 @@ UPB_END_EXTERN_C
#ifdef __cplusplus
UPB_INLINE const char* upb_safecstr(const std::string& str) {
- assert(str.size() == std::strlen(str.c_str()));
+ UPB_ASSERT(str.size() == std::strlen(str.c_str()));
return str.c_str();
}
@@ -1459,19 +1459,19 @@ inline bool FieldDef::CheckIntegerFormat(int32_t val) {
return upb_fielddef_checkintfmt(val);
}
inline FieldDef::Type FieldDef::ConvertType(int32_t val) {
- assert(CheckType(val));
+ UPB_ASSERT(CheckType(val));
return static_cast<FieldDef::Type>(val);
}
inline FieldDef::Label FieldDef::ConvertLabel(int32_t val) {
- assert(CheckLabel(val));
+ UPB_ASSERT(CheckLabel(val));
return static_cast<FieldDef::Label>(val);
}
inline FieldDef::DescriptorType FieldDef::ConvertDescriptorType(int32_t val) {
- assert(CheckDescriptorType(val));
+ UPB_ASSERT(CheckDescriptorType(val));
return static_cast<FieldDef::DescriptorType>(val);
}
inline FieldDef::IntegerFormat FieldDef::ConvertIntegerFormat(int32_t val) {
- assert(CheckIntegerFormat(val));
+ UPB_ASSERT(CheckIntegerFormat(val));
return static_cast<FieldDef::IntegerFormat>(val);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback