Commit Graph

17716 Commits

Author SHA1 Message Date
Araq
40969296e9 fixes #15207 [backport:1.2] 2020-08-26 15:27:15 +02:00
Araq
71025b8a8f deleted dead code, writetracking.nim was replaced by varpartitions.nim 2020-08-26 15:27:15 +02:00
Miran
5163fe7d87 remove deprecation from math.round (#15224) 2020-08-25 15:59:42 +02:00
Bung
7cee63bba3 avoid #8231, bitwise move to mul,div (#15070)
* avoid #8231, bitwise move to mul,div

* add test for #8231

* fix bitwise move when div result is float

* bitwise move depends on typ.size
2020-08-25 09:58:32 +02:00
Miran
15ff89cec1 [backport] fix #15064, strscans.scanf edge case for '$+' (#15223) 2020-08-25 09:57:15 +02:00
narimiran
5651a2f711 PRs with no activity in last year are marked as stale 2020-08-24 13:44:19 +02:00
Jon
8321617a78 fix in doc: incomplete output (#15222) [ci skip] 2020-08-24 08:33:51 +02:00
Mamy Ratsimbazafy
07d82b5cc4 Use more lent in options (#15208) 2020-08-24 08:05:17 +02:00
alaviss
575697e1f4 doc/nimdoc.css: align field names to the right (#15217) 2020-08-23 09:48:37 +02:00
wltsmrz
9bae1ed205 Unsigned iovlen (#15216) 2020-08-22 23:14:50 +02:00
John Dupuy
66eba3388a Added more SSL documentation to net module. (#15206)
* Added more SSL documentation to `net` module.

* Changed two of the net.nim doc refs to links.

* Update lib/pure/net.nim doc wording.

Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>

* Update lib/pure/net.nim - added space to doc URI

Co-authored-by: alaviss <leorize+oss@disroot.org>

* Fixed another doc URI in net module.

* For net module doc added warning to connect procedure.

* Update net.nim

Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
Co-authored-by: alaviss <leorize+oss@disroot.org>
2020-08-22 11:00:38 +01:00
Elijah Shaw-Rutschman
8a004e2fc0 Add test coverage for atomics (#15193)
* Add test coverage for atomics

Signed-off-by: Elijah Shaw-Rutschman <elijahr@gmail.com>

* Fix compareExchange bugs for non-trivial objects

Bugs fixed:

1. compareExchange would not set the desired value in the success case.
2. compareExchange would not set var expected to the found value in the failure case.
3. withLock would spin forever running the unit tests. try..body..finally prevents this. Not sure why this makes a difference, since an exception wasn’t being raised, but clearing the guard in a finally block seems correct anyways.

Signed-off-by: Elijah Shaw-Rutschman <elijahr@gmail.com>
2020-08-18 18:02:10 +02:00
Andreas Rumpf
ddff13f01b better strict funcs, WIP (#15199)
* better strict funcs, WIP

* progress
2020-08-18 12:45:22 +02:00
jcosborn
e194cb41a4 fix overloading issue with generic invocation (#15135)
* fix overloading issue with generic alias

* add test for inheritance depth
2020-08-18 08:23:19 +02:00
alaviss
e9df8ebcfd gc_regions: cleanup & fixes for deallocation (#11920)
* gc_regions: withRegion nows return the modified MemRegion

* gc_regions: make withScratchRegion dealloc correctly

* tests/gc: add tregionleak test

This test checks if memory within regions are freed properly.
2020-08-17 20:20:48 +02:00
Andreas Rumpf
6feb3900b1 fixes #15177, the error message is now what it should have been (#15195) 2020-08-17 14:32:52 +02:00
Bung
cd28fe2ef7 add openssl missing procs (#15180) 2020-08-17 10:54:34 +02:00
narimiran
39906c52c4 stale bot is now active only for pull requests 2020-08-17 09:11:33 +02:00
Juan Carlos
c9fdad2c21 db_postgres document how to use it with unix socket (#15187) 2020-08-17 08:39:58 +02:00
slangmgh
ba042af9cc std/with support field assign (#14484)
* std/with support filed assign

* add changelog

* add support x.dup.with

* add example

* revert support x.dup.with; add example

* update changelog; fix assignment in parameter

* Update changelog.md

* add example for assignment in parameter

* Remove colon style assign

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-08-15 01:33:21 +02:00
alaviss
957bf15a08 asyncnet: don't try to close the socket again [backport] (#15174)
The closed flag isn't a good design by any means, but let's have this
working first before I get rid of the flag and potentially create a
non-backportable commit.
2020-08-12 08:04:54 +02:00
Cléber Zavadniak
ce2da87eca Fix typo on CoroutineRef* doc (#15179)
Just a small fix for a typo ("for for").
2020-08-12 04:46:16 +02:00
Clyybber
2cea52ee7e Allow pragmas on parameters (#15178) 2020-08-11 22:28:49 +02:00
Andreas Rumpf
813f16a2a3 Fix #8473 (#15169)
* Make explicit {.nimcall.} a seperate calling convention

* Add testcase for #5688

* Fix bootstrapping

* Remove little lies :)

* Use typeflag instead
2020-08-11 14:50:46 +02:00
Silvio
963db9e7da docs: dlimport -> dynlib (#15175) 2020-08-11 14:49:57 +02:00
Ico Doornekamp
2260ede247 Added array type definition to manual (#15173)
Co-authored-by: Ico Doornekamp <git@zevv.nl>
2020-08-10 14:01:47 +02:00
Clyybber
b022576ce9 Use typeflag instead 2020-08-10 12:57:32 +02:00
haxscramper
e5dbdc1d37 [FIX] strtabs interpolation in nimscript (#15172)
* [FIX] strtabs interpolation in nimscript

* [TEST] Use `static` in strtabs test
2020-08-09 14:12:53 +02:00
Andreas Rumpf
2a8bf470af fixes #15101 [backport] (#15171) 2020-08-08 23:08:34 +02:00
Clyybber
26a867c83c Remove little lies :) 2020-08-08 13:22:53 +02:00
Clyybber
2a8d010742 Fix bootstrapping 2020-08-08 12:50:06 +02:00
Clyybber
78b2012a92 Add testcase for #5688 2020-08-08 12:45:07 +02:00
Clyybber
38068f9778 Make explicit {.nimcall.} a seperate calling convention 2020-08-08 12:36:20 +02:00
c-blake
0bc8dd0b00 Add iterator inotify_events which is *almost always* needed logic for (#15152)
client code since Linux `inotify` is much like Linux `getdents64`.

Expanding on "almost always"..The only time that this `iterator` logic
is ***not*** needed on the output of a `read` from inotify fd's is when
one passes a length to `read` *guaranteed* to only pass one event struct
in the buffer.  That unusual circumstance requires (at least!) knowing
the length of the delivered filename before an event occurs, and the
filename itself is optional for some event types.

It is *far* more common to not know lengths in advance which means one
passes a buffer big enough for at least one maximum length directory
entry (256 bytes) which is then also big enough for *many* "typical"
length entries and therefore many events.  In such more common scenarios
this iterator logic is definitely needed.

Further, not using this logic, yet treating the return from read as "the
whole answer" can test ok on "thin" event streams (e.g. 1 event per ms),
hiding a latent bug of processing only the first event.
2020-08-08 07:26:20 +02:00
flywind
eee3b189ff fix #15148 (#15149)
* fix #15148

Co-authored-by: alaviss <leorize+oss@disroot.org>
2020-08-08 07:24:54 +02:00
ee7
6f482ab934 deques.nim: Refactor the toDeque functionality (#15166)
This commit polishes the new proc introduced by d9ed816b10.

Changes:
- Rename to `toDeque` for more consistency with well-known procs like
  `toHashSet` and `toTable`.
- Rename the `openArray` parameter. The name `arr` was potentially less
  clear given that the proc can be used with a seq (or string).
- Add a `since` annotation.
- Reword the doc comment, and clarify that ordering is preserved.
- Add runnableExamples.
- Add "see also" cross linking between `initDeque` and `toDeque`.
- Remove duplicate `nextPowerOfTwo`. The `initImpl` template already
  includes it.
- Implement the proc using the `items` iterator, rather than indexing.
  This matches the implementation of `sets.toHashSet` and
  `tables.toTable`.
- Add a test within `when isMainModule`.
- Add a changelog entry.
2020-08-07 22:54:34 +02:00
cooldome
a528382e05 fix sqlgetdata regression in odbc (#15161)
* fix sqlgetdata import

* fix db_odbc

* more fixes

* fix style
2020-08-07 22:37:54 +02:00
archnim
d9ed816b10 Added the ability to initialize a deque with an openArray (#15138)
* Add ability to initialize a deque with a sequence

Example:
var dq = initDeque[char](@['a', 'b', 'c'])

* Update deques.nim

* Optimized deque initialization

* Sequence replaced by open array in deque initialization
2020-08-05 12:41:42 -04:00
cooldome
ef6358f0b0 implement (#15153) 2020-08-04 19:22:35 +02:00
narimiran
eb3ba0ae5f limit stalebot a bit more 2020-08-04 13:00:09 +02:00
Andreas Rumpf
64aec6eb85 fixes a collect() bug reported on the forum (#15156) [backport:1.2] 2020-08-04 12:45:15 +02:00
flywind
2d494f42f3 minor improvement (#15155) 2020-08-04 11:29:57 +02:00
narimiran
836660a297 put stale limit at 3 years
It needs to be slowly brought down to limit the notifications
and prevent excessive spamming.
2020-08-04 11:00:04 +02:00
narimiran
e4710f893e stalebot: don't send messages to keep spam down 2020-08-04 10:47:16 +02:00
narimiran
9b08c7b375 add stale bot 2020-08-04 09:03:20 +02:00
Andreas Rumpf
d6161e7e9e fixes #15129 [backport:1.2] (#15144) 2020-08-01 22:03:15 +02:00
sschwarzer
98eb8410f2 Remove noSideEffect pragmas (#15143)
These don't seem to make sense for the purpose of the procs and lead
to errors when the `--experimental:strictFuncs` feature is enabled.

See also https://github.com/nim-lang/Nim/issues/15142
2020-08-01 22:00:25 +02:00
alaviss
c619cedd7c net: allow close() to ignore SSL failures due to disconnections (#15120)
* net: allow close() to ignore SSL failures due to disconnections

Comes with this PR is also a SIGPIPE handling contraption.

* net: don't do selectSigpipe() on macOS

macOS sockets have SO_NOSIGPIPE set, so an EPIPE doesn't necessary mean
that a SIGPIPE happened.

* net: fix alreadyBlocked logic

* net: WSAESHUTDOWN is also a disconnection error
2020-08-01 21:27:55 +02:00
flywind
3ce32a7e40 export asyncdispatch handles (#15140)
* improve epoll docs

* export handles

* add comments and changelog
2020-08-01 21:27:21 +02:00
Andreas Rumpf
8e3f51f06c fixes #15130 (#15141)
* fixes #15130

* you really have to copy from cursors
2020-08-01 18:04:04 +02:00