summaryrefslogtreecommitdiff
path: root/src/repo_write.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-03-16 14:36:04 +0100
committerMichael Schroeder <mls@suse.de>2012-03-16 14:36:04 +0100
commitdded4a474cf14c128379ca092da9b5cd5c192c0e (patch)
treeb743203b9e742dc04b91750e9f0706211a24794b /src/repo_write.c
parentb5b31f19e6682fc56978ce00dc0f797c7cd1af62 (diff)
downloadlibsolv-dded4a474cf14c128379ca092da9b5cd5c192c0e.tar.gz
libsolv-dded4a474cf14c128379ca092da9b5cd5c192c0e.tar.bz2
libsolv-dded4a474cf14c128379ca092da9b5cd5c192c0e.zip
- advance num64 support. For now, we store the high 32 bits in kv->num2 to stay somewhat compatible
Diffstat (limited to 'src/repo_write.c')
-rw-r--r--src/repo_write.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/repo_write.c b/src/repo_write.c
index 23c2a43..1db6c50 100644
--- a/src/repo_write.c
+++ b/src/repo_write.c
@@ -426,6 +426,24 @@ data_addideof(struct extdata *xd, Id x, int eof)
data_addid(xd, (eof ? x: x | 64));
}
+static void
+data_addid64(struct extdata *xd, unsigned int x, unsigned int hx)
+{
+ if (hx)
+ {
+ if (hx > 7)
+ {
+ data_addid(xd, (Id)(hx >> 3));
+ xd->buf[xd->len - 1] |= 128;
+ hx &= 7;
+ }
+ data_addid(xd, (Id)(x | 0x80000000));
+ xd->buf[xd->len - 5] = (x >> 28) | (hx << 4) | 128;
+ }
+ else
+ data_addid(xd, (Id)x);
+}
+
static void
data_addidarray_sort(struct extdata *xd, Pool *pool, NeedId *needid, Id *ids, Id marker)
{
@@ -786,7 +804,7 @@ repo_write_adddata(struct cbdata *cbdata, Repodata *data, Repokey *key, KeyValue
data_addblob(xd, v, 4);
break;
case REPOKEY_TYPE_NUM:
- data_addid(xd, kv->num);
+ data_addid64(xd, kv->num, kv->num2);
break;
case REPOKEY_TYPE_DIR:
id = kv->id;