aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2019-08-05 21:11:15 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2019-08-05 21:12:04 +0200
commit96803ab69db013383fa8575529545fb14affc774 (patch)
treec312d7dfac895d95423b1f62a82078a7b8b1110b
parent66f4b6b7495cda05fed904c53dd8d04e35538653 (diff)
downloadd2tk-96803ab69db013383fa8575529545fb14affc774.tar.xz
backend fixed for last commit.
-rw-r--r--VERSION2
-rw-r--r--d2tk/hash.h4
-rw-r--r--src/backend_cairo.c4
-rw-r--r--src/backend_nanovg.c4
-rw-r--r--src/mum.c4
5 files changed, 9 insertions, 9 deletions
diff --git a/VERSION b/VERSION
index 75dd97f..eddad3c 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.775
+0.1.779
diff --git a/d2tk/hash.h b/d2tk/hash.h
index be69e92..52cf33e 100644
--- a/d2tk/hash.h
+++ b/d2tk/hash.h
@@ -35,10 +35,10 @@ struct _d2tk_hash_dict_t {
};
D2TK_API uint64_t
-d2tk_hash(const void *data, ssize_t nbytes);
+d2tk_hash(const void *data, size_t nbytes);
D2TK_API uint64_t
-d2tk_hash_foreach(const void *data, ssize_t nbytes, ...) __attribute__((sentinel));
+d2tk_hash_foreach(const void *data, size_t nbytes, ...) __attribute__((sentinel));
D2TK_API uint64_t
d2tk_hash_dict(const d2tk_hash_dict_t *dict);
diff --git a/src/backend_cairo.c b/src/backend_cairo.c
index 0cfadb3..0c9bcd9 100644
--- a/src/backend_cairo.c
+++ b/src/backend_cairo.c
@@ -570,7 +570,7 @@ d2tk_cairo_process(void *data, d2tk_core_t *core, const d2tk_com_t *com,
{
const d2tk_body_font_face_t *body = &com->body->font_face;
- const uint64_t hash = d2tk_hash(body->face, -1);
+ const uint64_t hash = d2tk_hash(body->face, strlen(body->face));
uintptr_t *sprite = d2tk_core_get_sprite(core, hash, SPRITE_TYPE_FONT);
assert(sprite);
@@ -649,7 +649,7 @@ d2tk_cairo_process(void *data, d2tk_core_t *core, const d2tk_com_t *com,
{
const d2tk_body_image_t *body = &com->body->image;
- const uint64_t hash = d2tk_hash(body->path, -1);
+ const uint64_t hash = d2tk_hash(body->path, strlen(body->path));
uintptr_t *sprite = d2tk_core_get_sprite(core, hash, SPRITE_TYPE_SURF);
assert(sprite);
diff --git a/src/backend_nanovg.c b/src/backend_nanovg.c
index fe5d377..1086d94 100644
--- a/src/backend_nanovg.c
+++ b/src/backend_nanovg.c
@@ -651,7 +651,7 @@ d2tk_nanovg_process(void *data, d2tk_core_t *core, const d2tk_com_t *com,
{
const d2tk_body_font_face_t *body = &com->body->font_face;
- const uint64_t hash = d2tk_hash(body->face, -1);
+ const uint64_t hash = d2tk_hash(body->face, strlen(body->face));
uintptr_t *sprite = d2tk_core_get_sprite(core, hash, SPRITE_TYPE_FONT);
assert(sprite);
@@ -723,7 +723,7 @@ d2tk_nanovg_process(void *data, d2tk_core_t *core, const d2tk_com_t *com,
{
const d2tk_body_image_t *body = &com->body->image;
- const uint64_t hash = d2tk_hash(body->path, -1);
+ const uint64_t hash = d2tk_hash(body->path, strlen(body->path));
uintptr_t *sprite = d2tk_core_get_sprite(core, hash, SPRITE_TYPE_IMG);
assert(sprite);
diff --git a/src/mum.c b/src/mum.c
index 49825a3..358a3dc 100644
--- a/src/mum.c
+++ b/src/mum.c
@@ -32,13 +32,13 @@ _d2tk_hash(uint64_t hash, const void *key, size_t len)
}
D2TK_API uint64_t
-d2tk_hash(const void *key, ssize_t len)
+d2tk_hash(const void *key, size_t len)
{
return mum_hash(key, len, SEED);
}
D2TK_API uint64_t
-d2tk_hash_foreach(const void *key, ssize_t len, ...)
+d2tk_hash_foreach(const void *key, size_t len, ...)
{
va_list args;
uint64_t hash = mum_hash_init(SEED);