Fix docker build (#3792)

Fix "non-trivial designated initializers"
Fix "invalid conversion"
This commit is contained in:
billow 2023-08-26 16:25:36 +08:00 committed by GitHub
parent 40b67c2f6d
commit 0c1690a7fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -731,14 +731,14 @@ typedef enum {
} RzAnalysisVarOriginKind;
static const char *RzAnalysisVarKind_strings[] = {
[RZ_ANALYSIS_VAR_KIND_INVALID] = "invalid",
[RZ_ANALYSIS_VAR_KIND_FORMAL_PARAMETER] = "formal_parameter",
[RZ_ANALYSIS_VAR_KIND_VARIABLE] = "variable",
[RZ_ANALYSIS_VAR_KIND_INVALID] = "invalid",
};
static const char *RzAnalysisVarOriginKind_strings[] = {
[RZ_ANALYSIS_VAR_ORIGIN_DWARF] = "DWARF",
[RZ_ANALYSIS_VAR_ORIGIN_NONE] = "none",
[RZ_ANALYSIS_VAR_ORIGIN_DWARF] = "DWARF",
};
#define RZ_ANALYSIS_AS_STRING_IMPL(T, name, strings) \
@ -751,10 +751,10 @@ static const char *RzAnalysisVarOriginKind_strings[] = {
static inline T rz_analysis_##name##_from_string(const char *s) { \
for (int i = 0; i < RZ_ARRAY_SIZE(strings); ++i) { \
if (RZ_STR_EQ(s, strings[i])) { \
return i; \
return (T)i; \
} \
} \
return 0; \
return (T)0; \
}
RZ_ANALYSIS_AS_STRING_IMPL(RzAnalysisVarKind, var_kind, RzAnalysisVarKind_strings);