dep/rcheevos: Update to ffddcdb

This commit is contained in:
Stenzek
2023-09-06 22:37:42 +10:00
parent 7d178c04d3
commit 58d62e1ab4
13 changed files with 417 additions and 168 deletions

View File

@ -419,6 +419,18 @@ int rc_json_get_required_unum_array(unsigned** entries, unsigned* num_entries, r
}
int rc_json_get_required_array(unsigned* num_entries, rc_json_field_t* array_field, rc_api_response_t* response, const rc_json_field_t* field, const char* field_name) {
#ifndef NDEBUG
if (strcmp(field->name, field_name) != 0)
return 0;
#endif
if (!rc_json_get_optional_array(num_entries, array_field, response, field, field_name))
return rc_json_missing_field(response, field);
return 1;
}
int rc_json_get_optional_array(unsigned* num_entries, rc_json_field_t* array_field, rc_api_response_t* response, const rc_json_field_t* field, const char* field_name) {
#ifndef NDEBUG
if (strcmp(field->name, field_name) != 0)
return 0;
@ -428,7 +440,7 @@ int rc_json_get_required_array(unsigned* num_entries, rc_json_field_t* array_fie
if (!field->value_start || *field->value_start != '[') {
*num_entries = 0;
return rc_json_missing_field(response, field);
return 0;
}
memcpy(array_field, field, sizeof(*array_field));