Commit graph

91 commits

Author SHA1 Message Date
Dennis Korpel
94890e03dc Fix std.mmap documentation 2024-01-16 17:59:49 +01:00
Dennis Korpel
fc804bb8da Fix 24339 - std.mmfile has poor documentation 2024-01-14 13:20:01 +01:00
Walter Bright
28bf65292c add scope to MmFile constructors 2022-05-30 05:43:57 +00:00
Iain Buclaw
213660d9bd std.mmfile: Add testmmfile from dmd testsuite as a unittest 2021-08-26 12:17:32 +00:00
Steven Schveighoffer
0de8d8d4e1 We should not be promoting using GC.free casually. 2021-01-26 22:29:30 +01:00
Roman Kashitsyn
6f130cf4e2 std.mmfile: correct the documented type of thrown exceptions
MmFile.this claims that it throws std.file.FileException.
However, that never happens in practice:
  * On POSIX, ErrnoException is thrown (due to use of errnoEnforce).
  * On Windows, WindowsException is thrown (due to use of wenforce).

This change updates the documentation to reflect real types of
exceptions thrown by the constructors.

Another alternative is to change the MmFile itself to throw
FileException as it claims to do, but this will break backward
compatibility with existing programs.
2020-12-31 09:25:30 +01:00
Geod24
04f3979317 Replace 'Issue XXX' with Bugzilla links
Make the links clickable, as was done in the DMD repository.
Also avoids any ambiguity w.r.t. where the issue is stored.
2020-04-13 16:28:09 +09:00
Iain Buclaw
712545cc80 std.mmfile: MAP_ANON is only defined in core.sys.posix.sys.mman 2019-04-29 23:42:41 +02:00
Hiroki Noda
a9c4da88c0 Fix for lint 2018-12-26 10:16:44 +09:00
Hiroki Noda
03a39ede8e [trivial] unittest: set pagesize by using sysconf(_SC_PAGESIZE) on posix platform
getpagesize is not defined but sysconf(_SC_PAGESIZE) can be used.
2018-12-26 10:10:10 +09:00
Nathan Sashihara
6ffd4e7f28 Replace imports of core.sys.windows.windows to speed up compilation 2018-12-17 21:03:31 -05:00
Iain Buclaw
fd5facfe04 posix.mak: Enforce whitespace before opening parenthesis for version conditions 2018-09-22 16:57:24 +02:00
Walter Bright
33cceac7ac switch Digital Mars copyright to D Language Foundation 2018-09-05 13:49:46 -07:00
Sebastian Wilzbach
c324714fde Remove a few cases of underscore escaping 2018-06-04 13:05:01 +02:00
Basile Burg
ba8134876b [trivial] fix issue 18837 - MMFile should have opDollar 2018-05-26 04:17:28 +02:00
Basile Burg
2b316c62bd
style, switches in MmFile can be final 2017-09-13 19:12:48 +02:00
Sebastian Wilzbach
70f06b2357 Remove old, redundant private import access specifier
Very very old versions of D (well into 0.x) had imports public by default,
like C header files. This modernizes the codebase and removes the
redundant `private` access specifier.
This has been done with:

sed "s/private import/import/g" -i **/*.d
2017-07-11 12:28:39 +02:00
Sebastian Wilzbach
61717ecc7d Sort imports 2017-06-12 07:54:38 +02:00
Sebastian Wilzbach
c36f95280c Remove quickIndex for modules with booktables or only one symbol 2017-03-01 03:59:22 +01:00
Sebastian Wilzbach
203755d296 Automatically add spaces to binary operators (>>)
command:

sed -E "s/([[:alnum:]]) >> ([[:alnum:]])/\1 >> \2/g" -i **/*.d
sed -E "s/([[:alnum:]])>> ([[:alnum:]])/\1 >> \2/g" -i **/*.d
sed -E "s/([[:alnum:]]) >>([[:alnum:]])/\1 >> \2/g" -i **/*.d
2017-02-23 00:57:47 +01:00
Sebastian Wilzbach
805c720595 Unify Phobos by ensuring there's always a space after cast(...)
Command:

sed -E 's/([^"])cast\(([^)]*?)\)([[:alnum:]])/\1cast(\2) \3/g' -i **/*.d
2017-02-21 16:40:20 +01:00
Jack Stouffer
9d8cb9fda2 Removed uses of the delete keyword from std.mmfile 2016-10-27 16:30:30 +01:00
Atila Neves
46e433b99b Add @system to std.mmfile unit tests 2016-07-01 10:26:08 +02:00
Sebastian Wilzbach
ec47ac4224 Remove the WEB macro in favor of HTTP
replacement: sed 's/\$(WEB/\$(HTTP/g' -i **/*.d
2016-06-16 00:14:51 +02:00
Sebastian Wilzbach
1d34a121e9 apply all-man braces in Phobos
// find common cases
sed -E "s/^(\s*)((if|static if|for|foreach|foreach_reverse|while|unittest|switch|else|version).*)\s*\{$/\1\2\n\1{/" -i **/*.d
// catch else-if
sed -E "s/^(\s*)} (else static if| if|else if|else)(.*)\s*\{$/\1}\n\1\2\3\n\1{/" -i **/*.d
// remove created trailing whitespace
sed -i 's/[ \t]*$//' **/*.d
2016-05-31 13:07:53 +02:00
Sebastian Wilzbach
18b8abf60a remove the deprecated wiki macros 2016-05-27 05:52:23 +02:00
Nikolay Tolstokulakov
eff74ed2a2 netbsd patch 2016-03-11 10:10:47 +06:00
Vladimir Panteleev
290a94243f fix Issue 14995 - std.mmfile incorrectly handles errors in ctor 2015-09-02 01:57:34 +00:00
Vladimir Panteleev
836be856fa fix Issue 14994 - std.mmfile incorrectly handles map failure 2015-09-01 11:31:44 +00:00
Vladimir Panteleev
1fc0fa1fa9 fix Issue 14868 - MmFile destructor seems to corrupt memory 2015-09-01 07:42:27 +00:00
Vladimir Panteleev
2dc53b839a Revert "mmfile.d: MmFile destructor changed not to cal enforce"
This reverts commit 4f3b3f4f1c.

> This fix is incorrect and dangerous. You've removed a potential
> InvalidMemoryOperationError, which is deadly but easy to detect,
> but retained the possibility of closing the file handle of a
> completely unrelated file, if that file handle has since been
> reused. With this change, the bug will always be silent and much
> harder to find the real cause of.
2015-09-01 07:42:22 +00:00
Sergei Degtiarev
4f3b3f4f1c mmfile.d: MmFile destructor changed not to cal enforce
commented code removed
2015-08-11 13:33:01 -04:00
Joakim
3352c90c2e Separate linux kernel, glibc, and bionic APIs where appropriate 2015-05-27 21:54:52 -05:00
k-hara
e7b3d834d7 detab and remove trailing whitespaces 2015-02-10 00:56:40 +09:00
Daniel Murphy
6af3fb5525 Remove implicit conversions from array to bool 2015-01-27 21:55:00 +11:00
Martin Nowak
c855945f46 Merge pull request #2614 from Geod24/fix-license-doc
[DDOC] Usage of WEB macro for License everywhere
2014-10-17 00:16:49 +02:00
Daniel Murphy
af0629ec7c Merge pull request #2337 from joakim-noah/deprecate_std_c
Deprecate std.c.* and move all remaining declarations to core.stdc.*
2014-10-16 01:17:40 +11:00
Geod24
0fb95b8c27 Usage of WEB macro for License everywhere 2014-10-15 11:30:42 +02:00
Joakim
093d636de4 Deprecate std.c.* and move all remaining declarations to core.stdc.* 2014-10-14 09:26:21 -05:00
Vladimir Panteleev
b4afbeaf2d std.mmfile: Fix Windows anonymous mapping creation to conform to MSDN 2014-10-04 14:58:06 +00:00
Vladimir Panteleev
4a97eab1a0 std.mmfile: Improve error handling
Use wenforce instead of (inappropriately) errno.
Switch from if blocks to scope blocks.
2014-10-04 14:50:09 +00:00
k-hara
afbe12f1b1 fix property enforcement 2014-09-06 08:57:15 +09:00
Denis Shelomovskij
ff144b0ae0 Replace most toStringz/toUTF16z/toUTFz usages with tempCString* ones.
Only non-trivial cases left when a refactoring is required to use a temporary buffer.
Also add `nothrow`/`@nogc` attributes.
2014-08-23 17:23:13 +04:00
Joakim
60cfc11a11 Make all tests that create a temporary file in the local directory get the path from one central function, so they can be made to use an absolute path 2014-08-04 23:33:25 -05:00
Adam Saka
afb10ade85 Changed tabs to spaces 2014-07-07 09:57:09 +10:00
Adam Saka
e05a7a1230 Issue 8370 - Fix deprecated message during Linux Phobos build.
This change fixes Linux builds only. Other Posix based OS's will still use the deprecated alias from the Posix module. (This is the same behavior as the garbage collector module.)
2014-07-02 22:51:50 +10:00
Denis Shelomovskij
a81c4127f2 Use Unicode version of CreateFileMapping in std.mmfile.MmFile constructor.
It's a bad style to use ANSI WinAPI function and may cause problems in future.
2014-06-12 17:42:09 +04:00
Ben Grabham
b462d98887 fix Issue 7822 - lseek cast(int)offset should be lseek cast(off_t)offset 2014-05-28 01:32:59 +01:00
Daniel Murphy
13f343334c Remove cases where an array is used in a boolean context 2013-11-27 18:23:07 +11:00
Daniel Murphy
1754eed7f6 Fix cases where goto skips initialization of variables 2013-11-20 00:20:33 +11:00