adb: remove the now unused get_default_int() hook

It is no longer needed, and can be later reintroduced if needed.
cute-signatures
Timo Teräs 2021-07-17 15:09:20 +03:00
parent 3b00c0dc80
commit 94c5e01038
2 changed files with 1 additions and 8 deletions

View File

@ -384,10 +384,7 @@ adb_val_t adb_ro_val(const struct adb_obj *o, unsigned i)
uint32_t adb_ro_int(const struct adb_obj *o, unsigned i)
{
adb_val_t val = adb_ro_val(o, i);
if (val == ADB_NULL && o->schema && o->schema->get_default_int)
return o->schema->get_default_int(i);
return adb_r_int(o->db, val);
return adb_r_int(o->db, adb_ro_val(o, i));
}
apk_blob_t adb_ro_blob(const struct adb_obj *o, unsigned i)
@ -826,9 +823,6 @@ adb_val_t adb_wo_val_fromstring(struct adb_obj *o, unsigned i, apk_blob_t val)
adb_val_t adb_wo_int(struct adb_obj *o, unsigned i, uint32_t v)
{
if (o->schema && o->schema->get_default_int &&
v == o->schema->get_default_int(i))
return ADB_NULL;
return adb_wo_val(o, i, adb_w_int(o->db, v));
}

View File

@ -102,7 +102,6 @@ struct adb_object_schema {
apk_blob_t (*tostring)(struct adb_obj *, char *, size_t);
int (*fromstring)(struct adb_obj *, apk_blob_t);
uint32_t (*get_default_int)(unsigned i);
int (*compare)(const struct adb_obj *, const struct adb_obj *);
void (*pre_commit)(struct adb_obj *);