Refinements / bug fixes of the changes introduced in the previous commit:

- Only replace sBUG/sBUG_ON by BUG/BUG_ON when this macro is being used, not
  in its definition.
- Fixed bugs in algorithm for preserving the original code during a sparse run.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1076 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2009-09-06 11:09:21 +00:00
parent bea5b6dfc8
commit 9d4e2f9399
2 changed files with 23 additions and 8 deletions

View File

@@ -224,6 +224,7 @@ function handle_if()
function process_preprocessor_statement() {
last_if_nesting_level = if_nesting_level
orig_stmnt = $0
evaluated = evaluate($0)
condition = 1
delete_next_blank_line = 0
@@ -263,7 +264,7 @@ function process_preprocessor_statement() {
}
if (delete_disabled_code == 0 || (output && (! condition || condition && matching_if !~ "^+#if [01]")))
{
line[lines++]=$0
line[lines++] = orig_stmnt
}
else if (evaluated ~ "^+#define SCSI_EXEC_REQ_FIFO_DEFINED$" \
|| evaluated ~ "^+#define SCST_IO_CONTEXT$")
@@ -314,6 +315,8 @@ BEGIN {
printf "Error: kernel version (%s) is out of range.\n", kernel_version
exit 1
}
if (delete_disabled_code != 0 && delete_disabled_code != 1)
delete_disabled_code = 0
# Variable initialization.
lines = 0
@@ -346,7 +349,7 @@ BEGIN {
dump_lines()
match($0, "^@@ -([0-9]*),([0-9]*) \\+([0-9]*),([0-9]*) @@(.*)$", h)
}
else if (delete_disabled_output && delete_next_blank_line && match($0, "^+$"))
else if (delete_disabled_code && delete_next_blank_line && match($0, "^+$"))
{
lines_deleted++
delete_next_blank_line = 0
@@ -358,7 +361,7 @@ BEGIN {
{
process_preprocessor_statement()
}
else if (delete_disabled_output == 0 || output)
else if (delete_disabled_code == 0 || output)
{
# Store the line that was just read.
line[lines++]=$0