Commit Graph

4099 Commits

Author SHA1 Message Date
Andrew Kelley
b883bc873d
breaking API changes to all readInt/writeInt functions & more
* add `@bswap` builtin function. See #767
 * comptime evaluation facilities are improved to be able to
   handle a `@ptrCast` with a backing array.
 * `@truncate` allows "truncating" a u0 value to any integer
   type, and the result is always comptime known to be `0`.
 * when specifying pointer alignment in a type expression,
   the alignment value of pointers which do not have addresses
   at runtime is ignored, and always has the default/ABI alignment
 * threw in a fix to freebsd/x86_64.zig to update syntax from
   language changes
 * some improvements are pending #863

closes #638
closes #1733

std lib API changes
 * io.InStream().readIntNe renamed to readIntNative
 * io.InStream().readIntLe renamed to readIntLittle
 * io.InStream().readIntBe renamed to readIntBig
 * introduced io.InStream().readIntForeign
 * io.InStream().readInt has parameter order changed
 * io.InStream().readVarInt has parameter order changed
 * io.InStream().writeIntNe renamed to writeIntNative
 * introduced io.InStream().writeIntForeign
 * io.InStream().writeIntLe renamed to writeIntLittle
 * io.InStream().writeIntBe renamed to writeIntBig
 * io.InStream().writeInt has parameter order changed
 * mem.readInt has different parameters and semantics
 * introduced mem.readIntNative
 * introduced mem.readIntForeign
 * mem.readIntBE renamed to mem.readIntBig and different API
 * mem.readIntLE renamed to mem.readIntLittle and different API
 * introduced mem.readIntSliceNative
 * introduced mem.readIntSliceForeign
 * introduced mem.readIntSliceLittle
 * introduced mem.readIntSliceBig
 * introduced mem.readIntSlice
 * mem.writeInt has different parameters and semantics
 * introduced mem.writeIntNative
 * introduced mem.writeIntForeign
 * mem.writeIntBE renamed to mem.readIntBig and different semantics
 * mem.writeIntLE renamed to mem.readIntLittle and different semantics
 * introduced mem.writeIntSliceForeign
 * introduced mem.writeIntSliceNative
 * introduced mem.writeIntSliceBig
 * introduced mem.writeIntSliceLittle
 * introduced mem.writeIntSlice
 * removed mem.endianSwapIfLe
 * removed mem.endianSwapIfBe
 * removed mem.endianSwapIf
 * added mem.littleToNative
 * added mem.bigToNative
 * added mem.toNative
 * added mem.nativeTo
 * added mem.nativeToLittle
 * added mem.nativeToBig
2018-12-12 20:35:04 -05:00
Wink Saville
634d11ab28 Add add compiler_rt routines for float to signed integer conversion
And add std.math.f128_* constants.

The routines are:

  __fixdfdi, __fixdfsi, __fixdfti,
  __fixsfdi, __fixsfsi, __fixsfti,
  __fixtfdi, __fixtfsi, __fixtfti.

These all call fixint which is a generic zig function that does the
conversion:

  pub fn fixint(comptime fp_t: type, comptime fixint_t: type, a: fp_t) fixint_t

There are also a set tests:

  __fixdfdi_test, __fixdfsi_test, __fixdfti_test,
  __fixsfdi_test, __fixsfsi_test, __fixsfti_test,
  __fixtfdi_test, __fixtfsi_test, __fixtfti_test.
2018-12-12 00:21:42 -05:00
Jay Weisskopf
5f5364ad73 font-family fallbacks for unsupported system-ui 2018-12-11 01:44:48 -05:00
Jay Weisskopf
57113bab2f docs: Prefer system-ui font-family
system-ui is a new generic font-family for matching the font used in the operating system's native user interface. E.g. Roboto on Android, San Francisco on macOS, Segoe UI on Windows, etc.

https://caniuse.com/#search=system-ui
2018-12-11 01:44:48 -05:00
Henry Nelson
68b0fce62f Document explicitly ignoring expression values 2018-12-11 01:42:54 -05:00
Andrew Kelley
1b0f4d5976
implement compile error note for function parameter type mismatch 2018-12-05 15:32:25 -05:00
Jimmi Holst Christensen
518ff33e64 Allow packages in TestStep 2018-12-05 14:10:09 +01:00
Andrew Kelley
9ac838c8e3
LLD patch: allow non-allocated sections to go into allocated sections
Patch submitted upstream: https://reviews.llvm.org/D55276
2018-12-04 11:42:22 -05:00
Andrew Kelley
3a1612a0f5
std.debug: fix some issues with freestanding debug info 2018-12-02 23:46:45 -05:00
Andrew Kelley
5c3b8cb365
expose std.debug.DwarfInfo and delete unused function 2018-12-02 20:08:06 -05:00
Andrew Kelley
a436d2ab8c
std.debug.printSourceAtAddressDwarf
which works in freestanding mode
2018-12-02 19:34:11 -05:00
Andrew Kelley
4292ed9571
std.debug.StackIterator 2018-12-02 18:54:04 -05:00
Andrew Kelley
a40d160a5c
introduce std.io.SeekableStream
Relevant #764

dwarf debug info is modified to use this instead of std.os.File
directly to make it easier for bare metal projects to take advantage
of debug info parsing
2018-12-02 18:36:18 -05:00
Andrew Kelley
6f5e7ee09c
make std.unicode.Utf8Iterator public 2018-12-01 02:14:17 -05:00
Andrew Kelley
a9eab69b58
zig build: addStaticExecutable 2018-12-01 01:21:59 -05:00
Suirad
cf266ff80a Update tests 2018-11-30 02:15:33 -06:00
Suirad
e8e6ae57d4 Find CI env variables 2018-11-30 02:08:34 -06:00
Suirad
1fa2217c10 Simplify implementation 2018-11-30 02:08:34 -06:00
Suirad
24592d0216 Add more padding to parse buffer 2018-11-30 02:08:34 -06:00
Suirad
0abd5520bd Platform specific tests 2018-11-30 02:08:34 -06:00
Suirad
5dfca87a65 Update windows imports 2018-11-30 02:08:33 -06:00
Jimmi Holst Christensen
823969a5a4
Implemented new more flexible readLineFrom (#1801) 2018-11-29 22:38:39 +01:00
Andrew Kelley
b29769532b
ci: workaround azure quirk for windows too 2018-11-29 14:54:23 -05:00
Andrew Kelley
bbdc12891b
ci: workaround azure quirk with set -x 2018-11-29 11:05:56 -05:00
dbandstra
53766e7a3a make parseUnsigned handle types <8 bits wide 2018-11-29 09:53:43 -05:00
daurnimator
4ecb3ceafb Add std.LinkedList.concat 2018-11-29 09:44:24 -05:00
Andrew Kelley
7005ec5efe
Revert "Add math min/max for Float and Value"
This reverts commit 078a0a6999.

On closer inspection, I'm not sure these values for float min/max
make sense. Why is it max instead of true_max? Why isn't it positive
and negative infinity?

Let's discuss further before committing to these changes.
2018-11-29 09:33:47 -05:00
Jimmi Holst Christensen
f74320d56d Implemented getOrPutValue which wraps getOrPut 2018-11-29 09:10:15 +01:00
Wink Saville
078a0a6999 Add math min/max for Float and Value 2018-11-28 23:13:12 -05:00
Andrew Kelley
c54fe0d3ae
work around to support debian's fork of llvm 7.0.1
it has a patch that adds an OS type, breaking the public API
this commit avoids depending on the last os type enum item,
but retains the safety assertion checks.

closes #1788
2018-11-28 22:58:52 -05:00
Josh Wolfe
11e8afb37c fix child_process piped streams not getting closed 2018-11-28 18:33:55 -05:00
Andrew Kelley
57f44eb2bd
Merge branch 'freebsd2'
Tier 2 support for FreeBSD
2018-11-27 21:06:35 -05:00
Andrew Kelley
dd2450b1b2
tier 2 support for freebsd 2018-11-27 20:56:43 -05:00
Andrew Kelley
e3bf40742d
Merge branch 'master' into freebsd2 2018-11-27 20:36:44 -05:00
Sahnvour
1fb15be05f stack traces: fix for windows 2018-11-27 20:34:55 -05:00
Andrew Kelley
3c4965a616
readme: update support table 2018-11-27 11:27:45 -05:00
daurnimator
2baf0e2ffc add std.math.IntFittingRange 2018-11-27 10:19:06 -05:00
Andrew Kelley
6bbe4cf9f7
Merge branch 'winksaville-Fix-pushToParent-to-work-for-arrays-of-Objects' 2018-11-27 00:53:09 -05:00
Andrew Kelley
a5b79017a3
fix regression from d5648d26
thanks Wink Saville for the test case.
2018-11-27 00:52:32 -05:00
Andrew Kelley
7818550edc
Merge branch 'Fix-pushToParent-to-work-for-arrays-of-Objects' of https://github.com/winksaville/zig into winksaville-Fix-pushToParent-to-work-for-arrays-of-Objects 2018-11-27 00:45:46 -05:00
Andrew Kelley
0860be03b1
Merge branch 'kristate-zig-backport-os_file_read-EISDIR' 2018-11-26 20:07:19 -05:00
Andrew Kelley
67a39a4c99
stage1: better file path handling
* better message printed when cache hash fails
 * better handling of '/' as root source file
 * os_path_split parses '/' and '/a' correctly

closes #1693
closes #1746
2018-11-26 20:04:35 -05:00
Andrew Kelley
d2ed4d3dd3
Merge branch 'zig-backport-os_file_read-EISDIR' of https://github.com/kristate/zig into kristate-zig-backport-os_file_read-EISDIR 2018-11-26 19:59:58 -05:00
daurnimator
f6cd02be65 add std.meta.stringToEnum 2018-11-25 11:48:11 -05:00
Andrew Kelley
a07490a4bc
Merge pull request #1783 from ziglang/rand-range
Use better rand range implementations
2018-11-25 11:44:08 -05:00
Josh Wolfe
9ae5200bd2 factor out and expose biased range limiting function 2018-11-24 22:25:21 -05:00
Josh Wolfe
eed7b48fe3 test lots of types 2018-11-24 22:25:21 -05:00
Josh Wolfe
49b49618d2 add biased random range api 2018-11-24 22:25:21 -05:00
Josh Wolfe
1924ffa67d better debiased random range implementation 2018-11-24 22:25:21 -05:00
Andrew Kelley
4d747d452f
update zen os std lib for latest zig changes 2018-11-24 16:51:52 -05:00