From 6e2c9210371141a883f7c3f0863af77c570a0f1d Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Mon, 19 Dec 2011 14:40:06 +0530 Subject: [PATCH] indentation fixes for ac-gfbs --- src/util-mpm-ac-gfbs.c | 70 ++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 40 deletions(-) diff --git a/src/util-mpm-ac-gfbs.c b/src/util-mpm-ac-gfbs.c index 277d521a46..89e6cdbe6e 100644 --- a/src/util-mpm-ac-gfbs.c +++ b/src/util-mpm-ac-gfbs.c @@ -1316,27 +1316,22 @@ uint32_t SCACGfbsSearch(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, temp_state = SC_AC_GFBS_FAIL; } else { buf_local = u8_tolower(buf[i]); - //if (state == 0) { - // ascii_codes = goto_table_mod_pointers[state] + 2; - // temp_state = ((ascii_codes + no_of_entries))[buf_local]; - //} else { - ascii_codes = (uint8_t *)(goto_table_mod_pointers[state & 0x7FFF] + 2); - int low = 0; - int high = no_of_entries; - int mid; - temp_state = SC_AC_GFBS_FAIL; - while (low <= high) { - mid = (low + high) / 2; - if (ascii_codes[mid] == buf_local) { - temp_state = ((uint16_t *)(ascii_codes + ((no_of_entries + 1) & 0xFFE)))[mid]; - break; - } else if (ascii_codes[mid] < buf_local) { - low = mid + 1; - } else { - high = mid - 1; - } + ascii_codes = (uint8_t *)(goto_table_mod_pointers[state & 0x7FFF] + 2); + int low = 0; + int high = no_of_entries; + int mid; + temp_state = SC_AC_GFBS_FAIL; + while (low <= high) { + mid = (low + high) / 2; + if (ascii_codes[mid] == buf_local) { + temp_state = ((uint16_t *)(ascii_codes + ((no_of_entries + 1) & 0xFFE)))[mid]; + break; + } else if (ascii_codes[mid] < buf_local) { + low = mid + 1; + } else { + high = mid - 1; } - //} + } } } while (temp_state == SC_AC_GFBS_FAIL) { @@ -1449,27 +1444,22 @@ uint32_t SCACGfbsSearch(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, temp_state = SC_AC_GFBS_FAIL; } else { buf_local = u8_tolower(buf[i]); - //if (state == 0) { - // ascii_codes = goto_table_mod_pointers[state] + 2; - // temp_state = ((ascii_codes + no_of_entries))[buf_local]; - //} else { - ascii_codes = (uint8_t *)(goto_table_mod_pointers[state & 0x00FFFFFF] + 2); - int low = 0; - int high = no_of_entries; - int mid; - temp_state = SC_AC_GFBS_FAIL; - while (low <= high) { - mid = (low + high) / 2; - if (ascii_codes[mid] == buf_local) { - temp_state = ((uint32_t *)(ascii_codes + ((no_of_entries + 3) & 0xFFC)))[mid]; - break; - } else if (ascii_codes[mid] < buf_local) { - low = mid + 1; - } else { - high = mid - 1; - } + ascii_codes = (uint8_t *)(goto_table_mod_pointers[state & 0x00FFFFFF] + 2); + int low = 0; + int high = no_of_entries; + int mid; + temp_state = SC_AC_GFBS_FAIL; + while (low <= high) { + mid = (low + high) / 2; + if (ascii_codes[mid] == buf_local) { + temp_state = ((uint32_t *)(ascii_codes + ((no_of_entries + 3) & 0xFFC)))[mid]; + break; + } else if (ascii_codes[mid] < buf_local) { + low = mid + 1; + } else { + high = mid - 1; } - //} + } } } while (temp_state == SC_AC_GFBS_FAIL) {