diff options
author | Paul Duncan <pabs@pablotron.org> | 2019-01-08 14:27:40 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2019-01-08 14:27:40 -0500 |
commit | 6802c00bb064ac718fbf9cfd08fd10e6fa9f9a06 (patch) | |
tree | d98a1fc3515db3a29872bbd3fb6835463b72d0c6 | |
parent | 8c17e9d9473ced08c37aad7705e0a9f9c4873577 (diff) | |
download | sok-6802c00bb064ac718fbf9cfd08fd10e6fa9f9a06.tar.bz2 sok-6802c00bb064ac718fbf9cfd08fd10e6fa9f9a06.zip |
remove byte-wise ctx hash
-rw-r--r-- | src/libsok/sok-ctx-hash.c | 30 |
1 files changed, 0 insertions, 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 |