2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

Avoid shadowing local variable names.

All of these changes avoid using the same name for two local variables
within a same function.  None of them are actual bugs as far as I can tell,
but any of them could be confusing to the casual reader.

The one in lib/ovsdb-idl.c is particularly brilliant: inner and outer
loops both using (different) variables named 'i'.

Found with GCC -Wshadow.
This commit is contained in:
Ben Pfaff
2010-09-02 10:09:09 -07:00
parent 1089aab713
commit 2a022368f4
19 changed files with 41 additions and 60 deletions

View File

@@ -385,7 +385,7 @@ do_ca_cert_bootstrap(struct stream *stream)
file = fdopen(fd, "w");
if (!file) {
int error = errno;
error = errno;
VLOG_ERR("could not bootstrap CA cert: fdopen failed: %s",
strerror(error));
unlink(ca_cert.file_name);
@@ -402,7 +402,7 @@ do_ca_cert_bootstrap(struct stream *stream)
}
if (fclose(file)) {
int error = errno;
error = errno;
VLOG_ERR("could not bootstrap CA cert: writing %s failed: %s",
ca_cert.file_name, strerror(error));
unlink(ca_cert.file_name);
@@ -921,7 +921,7 @@ pssl_accept(struct pstream *pstream, struct stream **new_streamp)
new_fd = accept(pssl->fd, &sin, &sin_len);
if (new_fd < 0) {
int error = errno;
error = errno;
if (error != EAGAIN) {
VLOG_DBG_RL(&rl, "accept: %s", strerror(error));
}