summaryrefslogtreecommitdiff
path: root/src/adb_walk_genadb.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2021-07-21 20:09:18 +0300
committerTimo Teräs <timo.teras@iki.fi>2021-07-22 16:14:49 +0300
commite2ebd761a5bd1352211340e1265e37ab62f09bed (patch)
tree142d80e473cc79b3b45b0e25d210f6a1d2348904 /src/adb_walk_genadb.c
parent2f1186aa404ea86eb53ad89ec2df315e607f90aa (diff)
downloadapk-tools-e2ebd761a5bd1352211340e1265e37ab62f09bed.tar.gz
apk-tools-e2ebd761a5bd1352211340e1265e37ab62f09bed.tar.bz2
apk-tools-e2ebd761a5bd1352211340e1265e37ab62f09bed.tar.xz
apk-tools-e2ebd761a5bd1352211340e1265e37ab62f09bed.zip
adb: refactor struct adb_header to adb_file_header
In struct adb, do not keep the whole header, just the schema in host byte order.
Diffstat (limited to 'src/adb_walk_genadb.c')
-rw-r--r--src/adb_walk_genadb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/adb_walk_genadb.c b/src/adb_walk_genadb.c
index 4788d5f..46700bb 100644
--- a/src/adb_walk_genadb.c
+++ b/src/adb_walk_genadb.c
@@ -7,7 +7,7 @@ static int adb_walk_genadb_schema(struct adb_walk *d, uint32_t schema_id)
struct adb_walk_genadb *dt = container_of(d, struct adb_walk_genadb, d);
const struct adb_db_schema *s;
- dt->db.hdr.schema = htole32(schema_id);
+ dt->db.schema = schema_id;
for (s = d->schemas; s->magic; s++)
if (s->magic == schema_id) break;
if (!s) return -APKE_ADB_SCHEMA;
@@ -29,7 +29,7 @@ static int adb_walk_genadb_start_object(struct adb_walk *d)
{
struct adb_walk_genadb *dt = container_of(d, struct adb_walk_genadb, d);
- if (!dt->db.hdr.schema) return -APKE_ADB_SCHEMA;
+ if (!dt->db.schema) return -APKE_ADB_SCHEMA;
if (dt->nest >= ARRAY_SIZE(dt->objs)) return -APKE_ADB_LIMIT;
if (dt->curkey[dt->nest] == 0 &&
@@ -45,7 +45,7 @@ static int adb_walk_genadb_start_object(struct adb_walk *d)
struct adb_adb_schema *schema = container_of(&dt->objs[dt->nest-1].schema->kind, struct adb_adb_schema, kind);
if (dt->nestdb >= ARRAY_SIZE(dt->idb)) return -APKE_ADB_LIMIT;
adb_reset(&dt->idb[dt->nestdb]);
- dt->idb[dt->nestdb].hdr.schema = htole32(schema->schema_id);
+ dt->idb[dt->nestdb].schema = schema->schema_id;
dt->objs[dt->nest].db = &dt->idb[dt->nestdb];
dt->nestdb++;
}