summaryrefslogtreecommitdiff
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-01 11:09:25 -0400
committerBrad King <brad.king@kitware.com>2016-09-01 11:10:18 -0400
commit3825a564930ffe09fd681632a905ab9c91c41d98 (patch)
tree2b748d46edc7d906ee8ccea8cec94fc7f3a2b294 /Utilities
parent0c46750d2c4cee401f1cda047a71b0e349678077 (diff)
downloadcmake-3825a564930ffe09fd681632a905ab9c91c41d98.tar.gz
libuv: Simplify variable initializations to satisfy Clang scan-build
The Clang scan-build tool warns about assignments whose values are never used, so initialize local variables at declaration instead.
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmlibuv/src/unix/pipe.c7
-rw-r--r--Utilities/cmlibuv/src/unix/tty.c7
2 files changed, 4 insertions, 10 deletions
diff --git a/Utilities/cmlibuv/src/unix/pipe.c b/Utilities/cmlibuv/src/unix/pipe.c
index b73994cb8d..80f5e6f803 100644
--- a/Utilities/cmlibuv/src/unix/pipe.c
+++ b/Utilities/cmlibuv/src/unix/pipe.c
@@ -42,13 +42,10 @@ int uv_pipe_init(uv_loop_t* loop, uv_pipe_t* handle, int ipc) {
int uv_pipe_bind(uv_pipe_t* handle, const char* name) {
struct sockaddr_un saddr;
- const char* pipe_fname;
- int sockfd;
+ const char* pipe_fname = NULL;
+ int sockfd = -1;
int err;
- pipe_fname = NULL;
- sockfd = -1;
-
/* Already bound? */
if (uv__stream_fd(handle) >= 0)
return -EINVAL;
diff --git a/Utilities/cmlibuv/src/unix/tty.c b/Utilities/cmlibuv/src/unix/tty.c
index b2d37f4c2c..ae1018fc42 100644
--- a/Utilities/cmlibuv/src/unix/tty.c
+++ b/Utilities/cmlibuv/src/unix/tty.c
@@ -58,8 +58,8 @@ static int uv__tty_is_slave(const int fd) {
int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) {
uv_handle_type type;
- int flags;
- int newfd;
+ int flags = 0;
+ int newfd = -1;
int r;
int saved_flags;
char path[256];
@@ -72,9 +72,6 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) {
if (type == UV_FILE || type == UV_UNKNOWN_HANDLE)
return -EINVAL;
- flags = 0;
- newfd = -1;
-
/* Reopen the file descriptor when it refers to a tty. This lets us put the
* tty in non-blocking mode without affecting other processes that share it
* with us.