summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
authordef <dennis@felsin9.de>2015-02-18 21:13:01 +0100
committerdef <dennis@felsin9.de>2015-02-18 21:13:01 +0100
commitecfaab68f176651e2b836423cdc5682046bbd409 (patch)
treee591ee144ac050ddb6cd1844d073e9fcf7d57076 /lib/system.nim
parent358d4b958c46fdc740be647ee27ecdbba15597f3 (diff)
downloadNim-ecfaab68f176651e2b836423cdc5682046bbd409.tar.gz
Make readBytes and writeBytes work with uint8
So far only openarray[int8] worked. Now it's openarray[int8|uint8]. This
should make sense, since uint8 is comfortable to represent a byte
(0-255) and there is already type byte* = uint8 in system.
Diffstat (limited to 'lib/system.nim')
-rw-r--r--lib/system.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim
index accc2ef25..a71699cae 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -2457,7 +2457,7 @@ when not defined(JS): #and not defined(NimrodVM):
     proc getFileSize*(f: File): int64 {.tags: [ReadIOEffect], benign.}
       ## retrieves the file size (in bytes) of `f`.
 
-    proc readBytes*(f: File, a: var openArray[int8], start, len: int): int {.
+    proc readBytes*(f: File, a: var openArray[int8|uint8], start, len: int): int {.
       tags: [ReadIOEffect], benign.}
       ## reads `len` bytes into the buffer `a` starting at ``a[start]``. Returns
       ## the actual number of bytes that have been read which may be less than
@@ -2475,7 +2475,7 @@ when not defined(JS): #and not defined(NimrodVM):
       ## the actual number of bytes that have been read which may be less than
       ## `len` (if not as many bytes are remaining), but not greater.
 
-    proc writeBytes*(f: File, a: openArray[int8], start, len: int): int {.
+    proc writeBytes*(f: File, a: openArray[int8|uint8], start, len: int): int {.
       tags: [WriteIOEffect], benign.}
       ## writes the bytes of ``a[start..start+len-1]`` to the file `f`. Returns
       ## the number of actual written bytes, which may be less than `len` in case