+ if (!string) {
+ BT_LOGW_STR("Invalid parameter: string is NULL.");
+ ret = -1;
+ goto end;
+ }
+
+ if (type->frozen) {
+ BT_LOGW("Invalid parameter: field type is frozen: addr=%p",
+ type);
+ ret = -1;
+ goto end;
+ }
+
+ if (type->id != BT_CTF_FIELD_TYPE_ID_ENUM) {
+ BT_LOGW("Invalid parameter: field type is not an enumeration field type: "
+ "addr=%p, ft-id=%s", type,
+ bt_ctf_field_type_id_string(type->id));
+ ret = -1;
+ goto end;
+ }
+
+ if (range_end < range_start) {
+ BT_LOGW("Invalid parameter: range's end is lesser than range's start: "
+ "addr=%p, range-start=%" PRId64 ", range-end=%" PRId64,
+ type, range_start, range_end);
+ ret = -1;
+ goto end;
+ }
+
+ if (strlen(string) == 0) {
+ BT_LOGW("Invalid parameter: mapping name is an empty string: "
+ "enum-ft-addr=%p, mapping-name-addr=%p", type,
+ string);