aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2007-04-15 11:03:21 +0000
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2007-04-15 11:03:21 +0000
commitb396a9e677b1a0b591acb191bfb294fad161d31d (patch)
tree6f460101cb00ec9bb93443c805965814b7a55884
parent0d6870c6a17028e2575586816cae9f53e74dc496 (diff)
Replace 14 for loops (each setting an array of integers to 0) with a memset
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21441 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r--tap-h225counter.c47
1 files changed, 4 insertions, 43 deletions
diff --git a/tap-h225counter.c b/tap-h225counter.c
index 29afbdacec..19495b80fa 100644
--- a/tap-h225counter.c
+++ b/tap-h225counter.c
@@ -84,50 +84,11 @@ static void
h225counter_reset(void *phs)
{
h225counter_t *hs=(h225counter_t *)phs;
- int i;
+ char *save_filter = hs->filter;
- for(i=0;i<=RAS_MSG_TYPES;i++) {
- hs->ras_msg[i] = 0;
- }
- for(i=0;i<=CS_MSG_TYPES;i++) {
- hs->cs_msg[i] = 0;
- }
- for(i=0;i<=GRJ_REASONS;i++) {
- hs->grj_reason[i] = 0;
- }
- for(i=0;i<=RRJ_REASONS;i++) {
- hs->rrj_reason[i] = 0;
- }
- for(i=0;i<=URQ_REASONS;i++) {
- hs->urq_reason[i] = 0;
- }
- for(i=0;i<=URJ_REASONS;i++) {
- hs->urj_reason[i] = 0;
- }
- for(i=0;i<=ARJ_REASONS;i++) {
- hs->arj_reason[i] = 0;
- }
- for(i=0;i<=BRJ_REASONS;i++) {
- hs->brj_reason[i] = 0;
- }
- for(i=0;i<=DRQ_REASONS;i++) {
- hs->drq_reason[i] = 0;
- }
- for(i=0;i<=DRJ_REASONS;i++) {
- hs->drj_reason[i] = 0;
- }
- for(i=0;i<=LRJ_REASONS;i++) {
- hs->lrj_reason[i] = 0;
- }
- for(i=0;i<=IRQNAK_REASONS;i++) {
- hs->irqnak_reason[i] = 0;
- }
- for(i=0;i<=REL_CMP_REASONS;i++) {
- hs->rel_cmp_reason[i] = 0;
- }
- for(i=0;i<=FACILITY_REASONS;i++) {
- hs->facility_reason[i] = 0;
- }
+ memset(hs, 0, sizeof(h225counter_t));
+
+ hs->filter = save_filter;
}
static int