File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 11
11
///
12
12
/// Either of the `NSTD_FILE_WRITE` or `NSTD_FILE_APPEND` options must also be toggled for the file
13
13
/// to be created.
14
- #define NSTD_FILE_CREATE 0b00000001
14
+ #define NSTD_FILE_CREATE 1
15
15
16
16
/// Open a file in read mode.
17
- #define NSTD_FILE_READ 0b00000010
17
+ #define NSTD_FILE_READ (1 << 1)
18
18
19
19
/// Open a file in write mode.
20
- #define NSTD_FILE_WRITE 0b00000100
20
+ #define NSTD_FILE_WRITE (1 << 2)
21
21
22
22
/// Open a file in writing mode without overwriting saved data.
23
- #define NSTD_FILE_APPEND 0b00001000
23
+ #define NSTD_FILE_APPEND (1 << 3)
24
24
25
25
/// Open a file in truncate mode, this will set the file's length to 0 upon opening.
26
- #define NSTD_FILE_TRUNC 0b00010000
26
+ #define NSTD_FILE_TRUNC (1 << 4)
27
27
28
28
/// A handle to an opened file.
29
29
typedef NSTDAnyMut NSTDFile ;
Original file line number Diff line number Diff line change @@ -15,19 +15,19 @@ use std::fs::File;
15
15
///
16
16
/// Either of the `NSTD_FILE_WRITE` or `NSTD_FILE_APPEND` options must also be toggled for the file
17
17
/// to be created.
18
- pub const NSTD_FILE_CREATE : NSTDUInt8 = 0b00000001 ;
18
+ pub const NSTD_FILE_CREATE : NSTDUInt8 = 1 ;
19
19
20
20
/// Open a file in read mode.
21
- pub const NSTD_FILE_READ : NSTDUInt8 = 0b00000010 ;
21
+ pub const NSTD_FILE_READ : NSTDUInt8 = 1 << 1 ;
22
22
23
23
/// Open a file in write mode.
24
- pub const NSTD_FILE_WRITE : NSTDUInt8 = 0b00000100 ;
24
+ pub const NSTD_FILE_WRITE : NSTDUInt8 = 1 << 2 ;
25
25
26
26
/// Open a file in writing mode without overwriting saved data.
27
- pub const NSTD_FILE_APPEND : NSTDUInt8 = 0b00001000 ;
27
+ pub const NSTD_FILE_APPEND : NSTDUInt8 = 1 << 3 ;
28
28
29
29
/// Open a file in truncate mode, this will set the file's length to 0 upon opening.
30
- pub const NSTD_FILE_TRUNC : NSTDUInt8 = 0b00010000 ;
30
+ pub const NSTD_FILE_TRUNC : NSTDUInt8 = 1 << 4 ;
31
31
32
32
/// A handle to an opened file.
33
33
pub type NSTDFile = Box < File > ;
You can’t perform that action at this time.
0 commit comments