- Convert some impossible conditions into assertions.

- Add missing 'if' in comment.

MFC after:	3 days
This commit is contained in:
Pawel Jakub Dawidek 2011-09-27 08:04:01 +00:00
parent 09c2e8431a
commit 7f46e21d82
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=225784

View File

@ -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' &&