@@ -40,7 +40,7 @@ Error FileAccessWindowsPipe::open_existing(HANDLE p_rfd, HANDLE p_wfd, bool p_bl
40
40
_close ();
41
41
42
42
path_src = String ();
43
- ERR_FAIL_COND_V_MSG (fd[0 ] != 0 || fd[1 ] != 0 , ERR_ALREADY_IN_USE, " Pipe is already in use." );
43
+ ERR_FAIL_COND_V_MSG (fd[0 ] != nullptr || fd[1 ] != nullptr , ERR_ALREADY_IN_USE, " Pipe is already in use." );
44
44
fd[0 ] = p_rfd;
45
45
fd[1 ] = p_wfd;
46
46
@@ -58,18 +58,18 @@ Error FileAccessWindowsPipe::open_internal(const String &p_path, int p_mode_flag
58
58
_close ();
59
59
60
60
path_src = p_path;
61
- ERR_FAIL_COND_V_MSG (fd[0 ] != 0 || fd[1 ] != 0 , ERR_ALREADY_IN_USE, " Pipe is already in use." );
61
+ ERR_FAIL_COND_V_MSG (fd[0 ] != nullptr || fd[1 ] != nullptr , ERR_ALREADY_IN_USE, " Pipe is already in use." );
62
62
63
63
path = String (" \\\\ .\\ pipe\\ LOCAL\\ " ) + p_path.replace (" pipe://" , " " ).replace (" /" , " _" );
64
64
65
- HANDLE h = CreateFileW ((LPCWSTR)path.utf16 ().get_data (), GENERIC_READ | GENERIC_WRITE, 0 , nullptr , OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
65
+ HANDLE h = CreateFileW ((LPCWSTR)path.utf16 ().get_data (), GENERIC_READ | GENERIC_WRITE, 0 , nullptr , OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr );
66
66
if (h == INVALID_HANDLE_VALUE) {
67
67
h = CreateNamedPipeW ((LPCWSTR)path.utf16 ().get_data (), PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_NOWAIT, 1 , 4096 , 4096 , 0 , nullptr );
68
68
if (h == INVALID_HANDLE_VALUE) {
69
69
last_error = ERR_FILE_CANT_OPEN;
70
70
return last_error;
71
71
}
72
- ConnectNamedPipe (h, NULL );
72
+ ConnectNamedPipe (h, nullptr );
73
73
}
74
74
fd[0 ] = h;
75
75
fd[1 ] = h;
@@ -79,19 +79,19 @@ Error FileAccessWindowsPipe::open_internal(const String &p_path, int p_mode_flag
79
79
}
80
80
81
81
void FileAccessWindowsPipe::_close () {
82
- if (fd[0 ] == 0 ) {
82
+ if (fd[0 ] == nullptr ) {
83
83
return ;
84
84
}
85
85
if (fd[1 ] != fd[0 ]) {
86
86
CloseHandle (fd[1 ]);
87
87
}
88
88
CloseHandle (fd[0 ]);
89
- fd[0 ] = 0 ;
90
- fd[1 ] = 0 ;
89
+ fd[0 ] = nullptr ;
90
+ fd[1 ] = nullptr ;
91
91
}
92
92
93
93
bool FileAccessWindowsPipe::is_open () const {
94
- return (fd[0 ] != 0 || fd[1 ] != 0 );
94
+ return (fd[0 ] != nullptr || fd[1 ] != nullptr );
95
95
}
96
96
97
97
String FileAccessWindowsPipe::get_path () const {
@@ -103,7 +103,7 @@ String FileAccessWindowsPipe::get_path_absolute() const {
103
103
}
104
104
105
105
uint64_t FileAccessWindowsPipe::get_buffer (uint8_t *p_dst, uint64_t p_length) const {
106
- ERR_FAIL_COND_V_MSG (fd[0 ] == 0 , -1 , " Pipe must be opened before use." );
106
+ ERR_FAIL_COND_V_MSG (fd[0 ] == nullptr , -1 , " Pipe must be opened before use." );
107
107
ERR_FAIL_COND_V (!p_dst && p_length > 0 , -1 );
108
108
109
109
DWORD read = 0 ;
@@ -120,7 +120,7 @@ Error FileAccessWindowsPipe::get_error() const {
120
120
}
121
121
122
122
void FileAccessWindowsPipe::store_buffer (const uint8_t *p_src, uint64_t p_length) {
123
- ERR_FAIL_COND_MSG (fd[1 ] == 0 , " Pipe must be opened before use." );
123
+ ERR_FAIL_COND_MSG (fd[1 ] == nullptr , " Pipe must be opened before use." );
124
124
ERR_FAIL_COND (!p_src && p_length > 0 );
125
125
126
126
DWORD read = -1 ;
0 commit comments