diff options
author | pjd <pjd@FreeBSD.org> | 2011-09-27 08:04:01 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2011-09-27 08:04:01 +0000 |
commit | ac89e4145a68b6d2054b679cb6dafa28b53823ea (patch) | |
tree | 3e604a42e144d67fb1a9b0c818af9d8932f1b7ea | |
parent | b294ac14be9c7c1d73ee7cef2ff48f305282b8de (diff) | |
download | FreeBSD-src-ac89e4145a68b6d2054b679cb6dafa28b53823ea.zip FreeBSD-src-ac89e4145a68b6d2054b679cb6dafa28b53823ea.tar.gz |
- Convert some impossible conditions into assertions.
- Add missing 'if' in comment.
MFC after: 3 days
-rw-r--r-- | sbin/hastd/parse.y | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/sbin/hastd/parse.y b/sbin/hastd/parse.y index e5c25a4..01e8593a 100644 --- a/sbin/hastd/parse.y +++ b/sbin/hastd/parse.y @@ -472,8 +472,8 @@ replication_statement: REPLICATION replication_type depth0_replication = $2; break; case 1: - if (curres != NULL) - curres->hr_replication = $2; + PJDLOG_ASSERT(curres != NULL); + curres->hr_replication = $2; break; default: PJDLOG_ABORT("replication at wrong depth level"); @@ -496,8 +496,8 @@ checksum_statement: CHECKSUM checksum_type depth0_checksum = $2; break; case 1: - if (curres != NULL) - curres->hr_checksum = $2; + PJDLOG_ASSERT(curres != NULL); + curres->hr_checksum = $2; break; default: PJDLOG_ABORT("checksum at wrong depth level"); @@ -520,8 +520,8 @@ compression_statement: COMPRESSION compression_type depth0_compression = $2; break; case 1: - if (curres != NULL) - curres->hr_compression = $2; + PJDLOG_ASSERT(curres != NULL); + curres->hr_compression = $2; break; default: PJDLOG_ABORT("compression at wrong depth level"); @@ -548,8 +548,8 @@ timeout_statement: TIMEOUT NUM depth0_timeout = $2; break; case 1: - if (curres != NULL) - curres->hr_timeout = $2; + PJDLOG_ASSERT(curres != NULL); + curres->hr_timeout = $2; break; default: PJDLOG_ABORT("timeout at wrong depth level"); @@ -569,8 +569,7 @@ exec_statement: EXEC STR } break; case 1: - if (curres == NULL) - break; + PJDLOG_ASSERT(curres != NULL); if (strlcpy(curres->hr_exec, $2, sizeof(curres->hr_exec)) >= sizeof(curres->hr_exec)) { @@ -639,7 +638,7 @@ resource_statement: RESOURCE resource_start OB resource_entries CB } /* - * Let's see there are some resource-level settings + * Let's see if there are some resource-level settings * that we can use for node-level settings. */ if (curres->hr_provname[0] == '\0' && |