1911 Commits

Author SHA1 Message Date
Andrew Kelley
7cfe854359
clean up std.Buffer.print 2020-02-24 22:34:06 -05:00
vegecode
6fa143355f
Add formatted printing directly into std.Buffer 2020-02-24 22:30:23 -05:00
Andrew Kelley
5503f3f7c4
Merge pull request #4544 from BarabasGitHub/zeroes-for-non-extern-types
implement zeroes for non extern structs and native types
2020-02-24 22:01:56 -05:00
Andrew Kelley
61a50a23e8
Merge pull request #4547 from Vexu/deprecate
Remove deprecated builtins
2020-02-24 21:57:29 -05:00
Andrew Kelley
544bc42fd9
expose --verbose-llvm-cpu-features to zig build 2020-02-24 20:11:33 -05:00
Vexu
538d9a5dd8
remove uses of @ArgType and @IntType 2020-02-24 23:39:03 +02:00
Bas van den Berg
f7aa4f5280 Processed review comments. Updated documentation, used the typinfo for field access, generate compile error on allowzero and set C poitners to null 2020-02-24 22:15:04 +01:00
Vexu
45da72c5b6
remove usages of @typeId, @memberCount, @memberName and @memberType 2020-02-24 23:09:01 +02:00
Bas van den Berg
195195d238 vectors do not support iterating, do not support them (for now) 2020-02-24 20:50:51 +01:00
Bas van den Berg
0972b2a8fe implement zeroes for non extern structs and native types 2020-02-24 20:38:33 +01:00
Andrew Kelley
1d06c82c3b
Merge pull request #4516 from xackus/remove-bytes-to-slice
remove @bytesToSlice, @sliceToBytes from the language
2020-02-24 13:51:47 -05:00
J.W
5275b01202 hashing algorithms: fix logic and index out of bounds 2020-02-24 13:43:54 -05:00
Heide Onas Auri
907c5589ae
std.time.Timer.lap: only read system time once (#4533)
Calling Timer.lap queried the system time twice; once to compute the lap
time and once to reset the timer. This can lead to time discrepancies
between actual and computed durations when summing the result of
Timer.lap in a loop. This commit fixes that.

also fix Timer.read to not require a pointer
2020-02-23 18:25:52 -05:00
LemonBoy
08047cd6d7 correct test expectations 2020-02-23 22:47:48 +01:00
xackus
7664c3bc11 remove @bytesToSlice, @sliceToBytes from tests, docs 2020-02-23 18:03:50 +01:00
Andrew Kelley
cfe1fbad0f
Merge pull request #4304 from daurnimator/auto-json
Add "automatic" JSON facilities
2020-02-23 11:25:15 -05:00
frmdstryr
597648231b Format decmial 0.0 with no precision as just 0 2020-02-23 11:17:06 -05:00
Andrew Kelley
94c3dbf9e3
remove no-longer-valid defer 2020-02-23 01:07:19 -05:00
Andrew Kelley
767f041068 std.process: fix typo 2020-02-22 17:49:52 -05:00
Andrew Kelley
cfffb9c5e9
improve handling of environment variables on Windows
std.os.getenv and std.os.getenvZ have nice compile errors when not linking
libc and using Windows.

std.os.getenvW is provided as a Windows-only API that does not require
an allocator. It uses the Process Environment Block.
std.process.getEnvVarOwned is improved to be a simple wrapper on top of
std.os.getenvW.

std.process.getEnvMap is improved to use the Process Environment Block
rather than calling GetEnvironmentVariableW.

std.zig.system.NativePaths uses process.getEnvVarOwned instead of
std.os.getenvZ, which works on Windows as well as POSIX.
2020-02-22 17:35:36 -05:00
Andrew Kelley
936d0b18b1
update std lib to integrate with libc for environ
closes #3511
2020-02-22 15:59:13 -05:00
Andrew Kelley
0cd89e9176
std.os.execvpeZ_expandArg0: fix not restoring argv[0]
This function expands argv[0] into the absolute path resolved with PATH
environment variable before making the execve syscall. However, in case
the execve fails, e.g. with ENOENT, it did not restore argv to how it
was before it was passed in. This resulted in the caller performing an
invalid free.

This commit also adds verbose debug info when native system C compiler
detection fails. See #4521.
2020-02-22 13:56:02 -05:00
LemonBoy
495e894225 delete extra code, more forgiveness 2020-02-22 12:44:21 +01:00
LemonBoy
41bca1ce76 unification: windows debug info 2020-02-22 12:05:50 +01:00
LemonBoy
c060cae3ce unification: osx debug info 2020-02-22 11:51:45 +01:00
Andrew Kelley
6305ce828b
fix regression in standardTargetOptions 2020-02-21 19:22:50 -05:00
Andrew Kelley
6aecc268fd
remove the allocator from std.event.Loop
closes #3539
2020-02-21 15:20:36 -05:00
Andrew Kelley
dff7ca6784
annotate TODO comment with bug tracker link 2020-02-21 14:20:07 -05:00
xackus
783e8ad031 remove @bytesToSlice, @sliceToBytes from std lib 2020-02-21 19:46:53 +01:00
xackus
fdae5f5a07 implement bytesAsSlice, sliceAsBytes 2020-02-21 19:40:29 +01:00
Andrew Kelley
71573584cd
std.Target.parse gives parsing diagnostics 2020-02-21 13:34:55 -05:00
Andrew Kelley
7da7fbb912
update ARM cpu models to correctly include the sub-arch 2020-02-21 12:29:27 -05:00
Andrew Kelley
ab56d3e18c
fix std.Target unit tests 2020-02-21 11:07:56 -05:00
LemonBoy
8df4d7e4f4 unsure 2020-02-21 12:11:04 +01:00
Andrew Kelley
a391a82e49
fix zig build adding invalid cli args 2020-02-21 01:58:40 -05:00
Andrew Kelley
2de7d0b10c
fix zig build, ABI ABI, and update tests to new Target layout 2020-02-20 18:50:20 -05:00
Andrew Kelley
903127f36c
Merge remote-tracking branch 'origin/master' into sub-architecture-annihilation 2020-02-20 18:36:04 -05:00
Andrew Kelley
0f016b368d
support -mcpu=baseline, both in stage1 and stage2
See e381a42de9c0f0c5439a926b0ac99026a0373f49 for more details.
This is set up so that if we wish to make "baseline" depend on the
OS in the future, it is possible to do that.
2020-02-20 18:31:17 -05:00
Andrew Kelley
b0d2ebe529 remove std.io.readLine
This was deceptive. It was always meant to be sort of a "GNU readline"
sort of thing where it provides a Command Line Interface to input text.
However that functionality did not exist and it was basically a red
herring for people trying to read line-delimited input from a stream.

In this commit the API is deleted, so that people can find the proper
API more easily.

A CLI text input abstraction would be useful but may not even need to be
in the standard library. As you can see in this commit, the guess_number
CLI game gets by just fine by using `std.fs.File.read`.
2020-02-20 15:30:00 -05:00
Andrew Kelley
33c69d5cb6
arm: clarify which CPU features are sub-architectures
versus which ones are instruction sets.
2020-02-20 15:27:42 -05:00
LemonBoy
a4d0d7f1de soldier on 2020-02-20 20:48:54 +01:00
LemonBoy
342a274948 tidy interface, const correctness 2020-02-20 20:18:51 +01:00
LemonBoy
ce2efbdca6 Correctly count all the loaded modules on Windows 2020-02-20 19:41:29 +01:00
LemonBoy
d5b583008a sudoku 2020-02-20 19:41:29 +01:00
LemonBoy
fabab58528 less hideous 2020-02-20 19:41:29 +01:00
LemonBoy
b9c02e4076 elvis entered the building 2020-02-20 19:41:29 +01:00
LemonBoy
2a350cf174 osx 2020-02-20 19:41:29 +01:00
LemonBoy
b3f728585a windows widestring 2020-02-20 19:41:29 +01:00
LemonBoy
463f704431 wide 2020-02-20 19:41:29 +01:00
LemonBoy
99649794e9 win 2020-02-20 19:41:29 +01:00