From 6802c00bb064ac718fbf9cfd08fd10e6fa9f9a06 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 8 Jan 2019 14:27:40 -0500 Subject: remove byte-wise ctx hash --- src/libsok/sok-ctx-hash.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/libsok/sok-ctx-hash.c b/src/libsok/sok-ctx-hash.c index a3a32c7..cf0f270 100644 --- a/src/libsok/sok-ctx-hash.c +++ b/src/libsok/sok-ctx-hash.c @@ -22,36 +22,6 @@ fnv1a( return hash; } -#if 0 -uint64_t -sok_ctx_hash( - const sok_ctx_t * const ctx -) { - uint8_t buf[1024] = { - (ctx->home.x) & 0xff, - (ctx->home.x >> 16) & 0xff, - (ctx->home.y) & 0xff, - (ctx->home.y >> 16) & 0xff, - 0, - }; - - for (size_t i = 0; i < ctx->level.num_boxes; i++) { - buf[(4 * (i + 1) + 0)] = ctx->boxes[i].x & 0xff; - buf[(4 * (i + 1) + 1)] = (ctx->boxes[i].x >> 16) & 0xff; - buf[(4 * (i + 1) + 2)] = ctx->boxes[i].y & 0xff; - buf[(4 * (i + 1) + 3)] = (ctx->boxes[i].y >> 16) & 0xff; - } - - // calculate buffer length - const size_t used = 2 * (ctx->level.num_boxes + 1) * sizeof(uint16_t); - const size_t len = (used < sizeof(buf)) ? used : sizeof(buf); - - const uint64_t hash = fnv1a((uint8_t*) buf, len); - fprintf(stderr, "hash = %lx, used = %zu, len = %zu\n", hash, used, len); - return hash; -} -#endif /* 0 */ - uint64_t sok_ctx_hash( const sok_ctx_t * const ctx -- cgit v1.2.3