diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-04 00:37:41 +0100 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-04 00:37:41 +0100 |
commit | d21d4aa636ecf32d47fd667bf97cb4f68d590479 (patch) | |
tree | 630444a2806be98555992312f9d3cb0cdc4756b4 | |
parent | take initial capacity in init function (diff) | |
download | c-hashtable-d21d4aa636ecf32d47fd667bf97cb4f68d590479.tar.gz c-hashtable-d21d4aa636ecf32d47fd667bf97cb4f68d590479.tar.bz2 c-hashtable-d21d4aa636ecf32d47fd667bf97cb4f68d590479.zip |
update zig version
-rw-r--r-- | flake.lock | 88 | ||||
-rw-r--r-- | flake.nix | 4 | ||||
-rw-r--r-- | src/main.zig | 2 |
3 files changed, 91 insertions, 3 deletions
diff --git a/flake.lock b/flake.lock index b18cf2a..88a8993 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,39 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1735617354, @@ -16,9 +50,61 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1708161998, + "narHash": "sha256-6KnemmUorCvlcAvGziFosAVkrlWZGIc6UNT9GUYr0jQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "84d981bae8b5e783b3b548de505b22880559515f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "zig": "zig" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "zig": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1735906289, + "narHash": "sha256-bOjbgbuJvRHtHOFAJ9U+zEajk0N1Z1zG4MNtmsLt55Q=", + "owner": "mitchellh", + "repo": "zig-overlay", + "rev": "7ccbc34001590a16cb94e8be428020099493b190", + "type": "github" + }, + "original": { + "owner": "mitchellh", + "repo": "zig-overlay", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index e3c7a96..a8665e6 100644 --- a/flake.nix +++ b/flake.nix @@ -3,11 +3,13 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + zig.url = "github:mitchellh/zig-overlay"; }; outputs = { self, nixpkgs, + zig, }: let systems = ["x86_64-darwin" "aarch64-darwin" "x86_64-linux"]; createDevShell = system: let @@ -18,7 +20,7 @@ in pkgs.mkShell { buildInputs = with pkgs; [ - zig + zig.packages."${system}".master gcc gnumake valgrind diff --git a/src/main.zig b/src/main.zig index 3a94dee..bc1d662 100644 --- a/src/main.zig +++ b/src/main.zig @@ -38,6 +38,6 @@ test "removing element" { const data: i32 = 4; _ = hashtable.hashtable_put(ht, @constCast("key"), @constCast(&data)); _ = hashtable.hashtable_remove(ht, @constCast("key")); - const res: ?*anyopaque = hashtable.hashtable_get(ht, @constCast("key")); + const res = hashtable.hashtable_get(ht, @constCast("key")); try std.testing.expectEqual(null, res); } |