Andrea Orru
79d77faebf
More type cast fixes
2018-08-06 02:42:12 -04:00
Andrea Orru
641066d82e
Fix casts
2018-08-06 02:29:11 -04:00
Andrea Orru
d2f5e57b68
Merge branch 'master' into zen_stdlib
2018-08-06 01:43:19 -04:00
Matthew D. Steele
dcaaa241df
Fix a type error in std.os.linux.getpid() ( #1326 )
...
syscall0() returns usize, but we were trying to @bitCast to i32.
2018-08-03 11:45:23 -04:00
Matthew D. Steele
c2a08d7c51
Fix the start-less-than-end assertion in std.rand.Random.range ( #1325 )
...
The function returns a value in [start, end), but was asserting
start <= end instead of start < end. With this fix, range(1, 1)
will now assertion error instead of dividing by zero.
2018-08-03 11:44:39 -04:00
Andrew Kelley
895f262a55
pull request fixups
...
* clean up parser code
* fix stage2 parse and render code
* remove redundant test
* make stage1 compile tests leaner
2018-08-02 14:15:31 -04:00
Andrew Kelley
44fd3045ce
Merge branch 'handle-builtin-issue1296' of https://github.com/kristate/zig into kristate-handle-builtin-issue1296
2018-08-02 13:37:24 -04:00
Andrew Kelley
729f2aceb0
fix API of RtlGenRandom
2018-08-02 13:34:31 -04:00
Andrew Kelley
cbca434cf0
Merge branch 'windows-RtlGenRandom-issue1318' of https://github.com/kristate/zig into pr-1319
2018-08-02 13:26:02 -04:00
kristopher tate
782043e2e6
std/os/windows/util.zig: SKIP instead of PASS on non-windows systems;
...
Tracking Issue #1318 ;
2018-08-03 02:16:49 +09:00
kristopher tate
dde7eb45c5
std/os/index.zig: call getRandomBytes() twice and compare;
...
Tracking Issue #1318 ;
2018-08-03 02:16:19 +09:00
kristopher tate
c44653f40f
std/os/index.zig: swap CryptGetRandom() with RtlGenRandom();
...
Tracking Issue #1318 ;
2018-08-03 02:14:52 +09:00
kristopher tate
22fd359e2c
std/os/windows/advapi32.zig: add SystemFunction036;
...
Tracking Issue #1318 ;
2018-08-03 02:14:06 +09:00
kristopher tate
432b7685bf
std/os/index.zig: use "hw.logicalcpu" instead of "hw.ncpu" in macOS; ( #1317 )
...
Tracking Issue #1252 ;
hw.ncpu was deprecated in macOS. Among 4 new options available (hw.{physicalcpu, physicalcpu_max, logicalcpu, logicalcpu_max}), hw.logicalcpu was chosen because it actually reflects the number of logical cores the OS sees.
2018-08-02 12:59:59 -04:00
kristopher tate
96a94e7da9
std/event: directly return @handle();
...
Tracking Issue #1296 ;
2018-08-02 17:52:40 +09:00
kristopher tate
bc032a89cc
std/zig/parser_test.zig: update test to reflect that the promise symbol is no in scope with suspend;
...
Tracking Issue #1296 ;
2018-08-02 16:59:11 +09:00
kristopher tate
9fe140abad
std/event/tcp.zig: remove promise_symbol from suspend and use @handle();
...
Tracking Issue #1296 ;
2018-08-02 16:59:11 +09:00
kristopher tate
a3705b4251
std/event/loop.zig: remove promise_symbol from suspend and use @handle();
...
Tracking Issue #1296 ;
2018-08-02 16:59:11 +09:00
kristopher tate
efec3a0e34
std/event/lock.zig: remove promise_symbol from suspend and use @handle();
...
Tracking Issue #1296 ;
2018-08-02 16:59:11 +09:00
kristopher tate
b4ff464d39
std/event/group.zig: remove promise_symbol from suspend and use @handle();
...
Tracking Issue #1296 ;
2018-08-02 16:59:11 +09:00
kristopher tate
244a7fdafb
std/event/future.zig: remove promise_symbol from suspend and use @handle();
...
Tracking Issue #1296 ;
2018-08-02 16:59:11 +09:00
kristopher tate
29057e5511
std/event/channel.zig: remove promise_symbol from suspend and use @handle();
...
Tracking Issue #1296 ;
2018-08-02 16:59:11 +09:00
Marc Tiehuis
e66f538972
Add integer binary output format ( #1313 )
2018-08-01 11:38:04 -04:00
Andrew Kelley
de949b72c7
simpler std.event.Lock implementation
2018-07-31 19:57:46 -04:00
Andrew Kelley
058bfb254c
std.fmt.format: add '*' for formatting things as pointers
...
closes #1285
2018-07-31 11:36:57 -04:00
Andrew Kelley
5d4a02c350
Merge pull request #1307 from ziglang/cancel-semantics
...
improved coroutine cancel semantics
2018-07-30 13:42:26 -04:00
Andrew Kelley
09304aab77
fix cancel and await semantics
2018-07-29 23:25:40 -04:00
dbandstra
608ff52dc3
add SliceOutStream, rename SliceStream to SliceInStream ( #1301 )
2018-07-29 14:52:10 -04:00
dbandstra
f36faa32c4
add skipBytes function to InStream
...
this reads N bytes, discarding their values
2018-07-28 17:34:28 -07:00
dbandstra
3ce0ea884f
add int writing functions to OutStream
...
added: writeInt, writeIntLe, and writeIntBe
2018-07-28 17:30:05 -07:00
Andrew Kelley
05456eb275
make some functions in std.event.Loop public
2018-07-28 12:53:33 -04:00
Andrew Kelley
02713e8d8a
fix race conditions in self-hosted compiler; add test
...
* fix race condition in std.event.Channel deinit
* add support to zig build for --no-rosegment
* add passing self-hosted compare-output test for calling a function
* put a global lock on LLD linking because it's not thread safe
2018-07-24 21:28:54 -04:00
Nathan Sharp
0046551852
std.io: PeekStream and SliceStream
...
SliceStream is a read-only stream wrapper around a slice of bytes. It
allows adapting algorithms which work on InStreams to in-memory data.
PeekStream is a stream wrapper which allows "putting back" bytes into
the stream so that they can be read again. This will help make
look-ahead parsers easier to write.
2018-07-23 23:30:40 -07:00
Andrew Kelley
72599d420b
self-hosted: find all libc paths; windows linker code
2018-07-24 00:06:34 -04:00
Andrew Kelley
7dbbddf2a6
macho backtraces - use std.sort.sort instead of insertion sort
...
it's way faster
2018-07-23 15:36:45 -04:00
Andrew Kelley
5a919dd82d
Merge remote-tracking branch 'origin/master' into self-hosted-libc-hello-world
2018-07-23 14:32:13 -04:00
Andrew Kelley
10d2f08d37
self-hosted: fix error messages not cleaning up correctly
2018-07-23 14:28:14 -04:00
Andrew Kelley
d767fae47e
self-hosted: add first compare-output test
2018-07-23 00:35:53 -04:00
Andrew Kelley
93e78ee722
self-hosted can compile libc hello world
2018-07-22 23:28:53 -04:00
Andrew Kelley
99153ac0aa
add std.math.big.Int.fitsInTwosComp
...
so that we can pass runtime-known values
2018-07-22 10:58:45 -04:00
Marc Tiehuis
d53fae3551
Add big int fits function ( #1279 )
...
Returns whether the current value in an Int fits in the requested type.
2018-07-22 10:11:27 -04:00
Marc Tiehuis
07b6a3d335
Tighten Int.to bounds and add twos-complement bitcount
2018-07-22 17:47:57 +12:00
Andrew Kelley
20f286f22a
re-organize std lib darwin files
2018-07-22 00:04:24 -04:00
Andrew Kelley
f72f46e912
Merge branch 'posix-darwin-issue1271' of https://github.com/kristate/zig into kristate-posix-darwin-issue1271
2018-07-21 23:59:35 -04:00
Andrew Kelley
4d9964a457
rename error.skip to error.SkipZigTest
...
also print stats at the end of test runner
2018-07-21 23:43:43 -04:00
kristopher tate
c5c053b6fd
std.event.tcp: add switch statement in preparation for building-out abstractions;
...
depends on issue #1274 ;
2018-07-22 03:11:55 +09:00
kristopher tate
bc411af4ff
std.event.tcp: SKIP test instead of OKing test;
...
tracking issue #1274 ;
2018-07-22 02:21:52 +09:00
kristopher tate
df574ccf86
std.special.test_runner.zig: make tests skippable;
...
tracking issue #1274 ;
tests can be skipped by returnning `error.skip` :
2018-07-22 02:20:03 +09:00
kristopher tate
460c266216
std.os.posix: Add SOCK_* for darwin;
...
Tracking issue #1271 ;
2018-07-21 19:15:03 +09:00
kristopher tate
8062afcb31
std.os.posix: Add SYSPROTO_* for darwin;
...
Tracking issue #1271 ;
2018-07-21 19:14:40 +09:00