diff options
| author | 2023-12-06 22:45:00 +0100 | |
|---|---|---|
| committer | 2023-12-06 22:45:00 +0100 | |
| commit | 3d8e617c43d047b87bcbf74e9b6d26caf9f3f4f0 (patch) | |
| tree | 97fcd33314eb1a6e7309c19bb7233f00ed717832 | |
| parent | Merge pull request #146 from Krvopije/master (diff) | |
| download | zig-sqlite-3d8e617c43d047b87bcbf74e9b6d26caf9f3f4f0.tar.gz zig-sqlite-3d8e617c43d047b87bcbf74e9b6d26caf9f3f4f0.tar.xz zig-sqlite-3d8e617c43d047b87bcbf74e9b6d26caf9f3f4f0.zip | |
fix for latest zig
| -rw-r--r-- | sqlite.zig | 2 | ||||
| -rw-r--r-- | vtab.zig | 4 |
2 files changed, 3 insertions, 3 deletions
| @@ -1282,7 +1282,7 @@ pub fn Iterator(comptime Type: type) type { | |||
| 1282 | const sentinel = @as(*const ptr_info.child, @ptrCast(sentinel_ptr)).*; | 1282 | const sentinel = @as(*const ptr_info.child, @ptrCast(sentinel_ptr)).*; |
| 1283 | 1283 | ||
| 1284 | const slice = try allocator.alloc(u8, data.len + 1); | 1284 | const slice = try allocator.alloc(u8, data.len + 1); |
| 1285 | mem.copy(u8, slice, data); | 1285 | mem.copyForwards(u8, slice, data); |
| 1286 | slice[data.len] = sentinel; | 1286 | slice[data.len] = sentinel; |
| 1287 | 1287 | ||
| 1288 | return slice[0..data.len :sentinel]; | 1288 | return slice[0..data.len :sentinel]; |
| @@ -35,7 +35,7 @@ pub const ModuleContext = struct { | |||
| 35 | fn dupeToSQLiteString(s: []const u8) [*c]const u8 { | 35 | fn dupeToSQLiteString(s: []const u8) [*c]const u8 { |
| 36 | var buffer: [*c]u8 = @ptrCast(c.sqlite3_malloc(@intCast(s.len + 1))); | 36 | var buffer: [*c]u8 = @ptrCast(c.sqlite3_malloc(@intCast(s.len + 1))); |
| 37 | 37 | ||
| 38 | mem.copy(u8, buffer[0..s.len], s); | 38 | mem.copyForwards(u8, buffer[0..s.len], s); |
| 39 | buffer[s.len] = 0; | 39 | buffer[s.len] = 0; |
| 40 | 40 | ||
| 41 | return buffer; | 41 | return buffer; |
| @@ -253,7 +253,7 @@ pub const BestIndexBuilder = struct { | |||
| 253 | // Must always be NULL-terminated so add 1 | 253 | // Must always be NULL-terminated so add 1 |
| 254 | const tmp: [*c]u8 = @ptrCast(c.sqlite3_malloc(@intCast(self.id.str.len + 1))); | 254 | const tmp: [*c]u8 = @ptrCast(c.sqlite3_malloc(@intCast(self.id.str.len + 1))); |
| 255 | 255 | ||
| 256 | mem.copy(u8, tmp[0..self.id.str.len], self.id.str); | 256 | mem.copyForwards(u8, tmp[0..self.id.str.len], self.id.str); |
| 257 | tmp[self.id.str.len] = 0; | 257 | tmp[self.id.str.len] = 0; |
| 258 | 258 | ||
| 259 | index_info.idxStr = tmp; | 259 | index_info.idxStr = tmp; |