2299 Commits

Author SHA1 Message Date
dec05eba
f93498d2d8 Fix start index if @sizeOf(T) > 1 2020-09-05 15:31:22 +02:00
dec05eba
3a6e6bd538 Check if the type has unique bit representation to see if it can be compared byte-wise 2020-09-05 15:20:48 +02:00
dec05eba
db51821a97 Remove type size check, looks like its not needed
Add check if the type is float. Float byte comparison doesn't work
because +0.0 and -0.0 are considered equal but their byte
representations are not equal.
2020-09-05 14:56:59 +02:00
dec05eba
997451da03 Make preprocess function take comptime sized slice 2020-09-05 14:25:44 +02:00
dec05eba
a394a6300c Fix lastIndexOf and add tests that do not fallback to linear search
Use sliceAsBytes to convert []const T to []const u8.
Cleanup.
2020-09-05 14:17:38 +02:00
dec05eba
f65f3d24f8 Only use boyer-moore-horsepool for types that are power of 2 2020-09-05 12:57:05 +02:00
dec05eba
d012507a8f Use boyer-moore-horspool with all types of T 2020-09-05 12:02:18 +02:00
dec05eba
e297b4815c Create skipping table
Also fallback to naive implementation if haystack is small
or if the needle is small or if sizeof type is not 1.
2020-09-05 11:24:05 +02:00
dec05eba
50c52e0135 Use boyer-moore-horspool algorithm for indexOfPos and lastIndexOf 2020-09-05 11:22:12 +02:00
Andrew Kelley
cff14dc2c6
Merge pull request #6247 from alexnask/stage2_pe
Added a basic Portable Executable linker to stage2
2020-09-04 16:05:58 -04:00
Andrew Kelley
209a3da4f7 provide default implementation of std.log on freestanding
closes #6252
2020-09-04 13:00:10 -07:00
yettinmoor
0c43b6ef5c
document how to escape curly braces in fmt.format 2020-09-04 22:11:09 +03:00
Alexandros Naskos
e9807418e7 Added .pe ObjectFormat
MachO linker no longer collects unused dwarf debug information
2020-09-04 05:22:26 +03:00
Alexandros Naskos
e9b137f23a Completed basic PE linker for stage2
Added std.coff.MachineType
Added image characteristic and section flag valued to std.coff
Added std.Target.Cpu.Arch.toCoffMachine
Fixed stage2 --watch flag on windows
2020-09-04 05:15:03 +03:00
Felix (xq) Queißner
88724b2a89 Introduces a space after the ellipsis for test and progress. 2020-09-03 18:07:30 -04:00
Andrew Kelley
1034459170
Merge pull request #6243 from ifreund/uid-gid-cleanup
std: clean up usage of uid_t/gid_t, add seteuid/setegid to std.os
2020-09-03 18:05:59 -04:00
Andrew Kelley
f2bbd8a548
Merge pull request #6242 from Vexu/stage2
Stage2: slicing and split container scope from file scope
2020-09-03 17:22:57 -04:00
Lachlan Easton
2a58e30bd5 std meta: fix use of alignOf in meta.cast 2020-09-03 14:11:04 -04:00
Andrew Kelley
39a80cf59e
Merge pull request #6238 from Aransentin/master
Add the "sync" family of functions
2020-09-03 14:07:36 -04:00
Kenta Iwasaki
50e3906951
os: return error.SocketNotListening for EINVAL on accept (#6226) 2020-09-03 13:57:08 -04:00
LemonBoy
969547902b std: Fix silent overflow in float parsing code
A u64 can only hold 19 decimal digits, adjust the limit.
2020-09-03 18:14:19 +03:00
Isaac Freund
d0d6647fdb
std: add seteuid/setegid to std.os
Currently these are only implemented for linux.
2020-09-03 15:22:43 +02:00
Isaac Freund
01a365f1b0
std: ensure seteuid/setegid do not change saved id 2020-09-03 15:16:26 +02:00
Isaac Freund
e8a2aecd2f
std: fix linux uid_t, use uid_t/gid_t in std.os
- correct uid_t from i32 to u32 on linux
- define uid_t and gid_t for OSes missing definitions
- use uid_t/gid_t instead of plain u32s throughout std.os
2020-09-03 15:08:37 +02:00
Vexu
1174cb1517
stage2: fix tokenizer float bug 2020-09-03 15:05:47 +03:00
Jens Goldberg
68818983ae Split the sync tests into sync and fsync 2020-09-03 09:52:26 +00:00
Jens Goldberg
e747d2ba17 Add C declarations and tests for the sync functions 2020-09-03 07:49:18 +00:00
daurnimator
fb3c5b84ed std: add fmt option to escape non-printable characters 2020-09-02 19:18:36 -04:00
Andrew Kelley
c86108dd63
Merge pull request #6229 from LemonBoy/fix-6054
ir: Typecheck the sentinel value in *[N:S1]T to [S2]T casts
2020-09-02 19:13:21 -04:00
Aransentin
25f6663304 Add the sync functions 2020-09-02 22:16:40 +00:00
Andrew Kelley
405c7215a8
Merge pull request #6194 from LakeByTheWoods/fmt_indentation
Refactor zig fmt indentation. Remove indent from rendering code
2020-09-02 18:14:28 -04:00
Lachlan Easton
bb848dbeee zig fmt: Patch rename stream to ais (auto indenting stream) & other small refactors 2020-09-02 20:16:28 +10:00
Sahnvour
90ace40e07
Merge pull request #5999 from Sahnvour/hashmap
New hashmap implementation
2020-09-02 08:52:32 +02:00
Tadeo Kondrak
1b2154dfe2 builtin: Add TypeInfo.StructField.is_comptime 2020-09-02 00:17:59 -04:00
Sahnvour
575fbd5e35 hash_map: rename to ArrayHashMap and add new HashMap implementation 2020-09-02 00:17:50 +02:00
LemonBoy
dd4994a4e4 std: Fix C-string with missing NUL terminator
Spotted thanks to the stricter conversion rules.
2020-09-01 18:45:35 +02:00
Lachlan Easton
7841c9b7d1 zig fmt: Fix merge errors 2020-09-01 21:59:27 +10:00
Lachlan Easton
671b3abe5d Merge remote-tracking branch 'ziglang/master' into fmt_indentation 2020-09-01 18:41:23 +10:00
Lachlan Easton
bc24b86d82 zig fmt: Fix regression not covered by testing 2020-09-01 13:19:34 +10:00
Jan200101
2148336a81 follow filesystem hierarchy standard when adding lib directories 2020-08-31 17:44:43 -04:00
Andrew Kelley
8dc58a4e94
Merge pull request #6208 from tadeokondrak/remove-@OpaqueType
Remove @OpaqueType
2020-08-31 17:44:03 -04:00
Andrew Kelley
0d94cb932f
Merge pull request #6197 from LemonBoy/fix-6049
gpa: Fix bookkeeping logic
2020-08-31 17:38:17 -04:00
Lachlan Easton
029ec456bc zig fmt: Set indent_delta to 2 when rendering inline asm 2020-08-31 23:39:50 +10:00
Lachlan Easton
5aca3baea6 zig fmt: Remove dynamic stack from auto-indenting-stream 2020-08-31 23:39:50 +10:00
LemonBoy
29de809a92 gpa: Don't leak memory when the upper bound is hit 2020-08-31 12:35:25 +02:00
Tadeo Kondrak
96e46cdd6e
std.zig.render: specify when rewrite should be removed 2020-08-30 23:45:47 -06:00
Tadeo Kondrak
c51de3c266
std.zig.render: rewrite @OpaqueType() to @Type(.Opaque) 2020-08-30 23:41:40 -06:00
Andrew Kelley
43ac5e5dac
Merge pull request #6184 from tadeokondrak/TrailerFlags-update
std.meta.TrailerFlags: use @Type to improve API
2020-08-31 01:00:23 -04:00
Tadeo Kondrak
d3e5105ecc
std.zig.ast: make getTrailer/setTrailer private and add getters/setters 2020-08-30 17:18:25 -06:00
daurnimator
1bb30c5e22 std.ChildProcess: pass CLOEXEC when creating error pipe 2020-08-30 14:21:14 -04:00