Skip to content

Commit 495fe32

Browse files
Merge pull request #3587 from lemenkov/bool_keywords
Both true and false are now reserved words in a modern ANSI C
2 parents 73ab11a + 810b277 commit 495fe32

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

modules/statistics/statistics.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ union stat_series_slot {
9898
unsigned int nr;
9999
} avg;
100100
struct {
101-
unsigned long true;
102-
unsigned long false;
101+
unsigned long t;
102+
unsigned long f;
103103
} perc;
104104
long acc;
105105
};
@@ -919,8 +919,8 @@ inline static void reset_stat_series_slot(struct stat_series *ss, union stat_ser
919919
ss->cache.acc -= slot->acc;
920920
break;
921921
case STAT_ALG_PERC:
922-
ss->cache.perc.true -= slot->perc.true;
923-
ss->cache.perc.false -= slot->perc.false;
922+
ss->cache.perc.t -= slot->perc.t;
923+
ss->cache.perc.f -= slot->perc.f;
924924
break;
925925
default:
926926
LM_ERR("unknown profile algorithm %d\n", ss->profile->algorithm);
@@ -984,9 +984,9 @@ static unsigned long get_stat_series(struct stat_series *ss)
984984
ret = ss->cache.acc;
985985
break;
986986
case STAT_ALG_PERC:
987-
total = ss->cache.perc.true + ss->cache.perc.false;
987+
total = ss->cache.perc.t + ss->cache.perc.f;
988988
if (total != 0)
989-
ret = ss->cache.perc.true * ss->profile->factor / total;
989+
ret = ss->cache.perc.t * ss->profile->factor / total;
990990
break;
991991
default:
992992
LM_ERR("unknown profile algorithm %d\n", ss->profile->algorithm);
@@ -1072,11 +1072,11 @@ static int update_stat_series(struct stat_series *ss, int value)
10721072
break;
10731073
case STAT_ALG_PERC:
10741074
if (value > 0) {
1075-
s->perc.true += value;
1076-
ss->cache.perc.true += value;
1075+
s->perc.t += value;
1076+
ss->cache.perc.t += value;
10771077
} else {
1078-
s->perc.false -= value;
1079-
ss->cache.perc.false -= value;
1078+
s->perc.f -= value;
1079+
ss->cache.perc.f -= value;
10801080
}
10811081
break;
10821082
default:

0 commit comments

Comments
 (0)