Skip to content

Commit 761317e

Browse files
committed
Fixed ISO C90 mixed declarations and code warning.
1 parent 5a6d80d commit 761317e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/gstorage.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ count_bw (int numdate, uint64_t resp_size) {
560560
/* Keep track of all invalid log strings. */
561561
static void
562562
count_invalid (GLog *glog, GLogItem *logitem, const char *line) {
563+
uint8_t idx = 0;
563564
atomic_fetch_add (&glog->invalid, 1);
564565
ht_inc_cnt_overall ("failed_requests", 1);
565566

@@ -570,7 +571,7 @@ count_invalid (GLog *glog, GLogItem *logitem, const char *line) {
570571
if (logitem->errstr) {
571572
pthread_mutex_lock (&glog->error_mutex);
572573

573-
uint8_t idx = atomic_load (&glog->log_erridx);
574+
idx = atomic_load (&glog->log_erridx);
574575
if (idx < MAX_LOG_ERRORS) {
575576
glog->errors[idx] = xstrdup (logitem->errstr);
576577
atomic_store (&glog->log_erridx, idx + 1);

src/parser.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2004,10 +2004,11 @@ validate_and_parse_line (char *line, GLogItem *logitem) {
20042004
/* Collect error messages without incrementing counters (for dry run/testing) */
20052005
static void
20062006
collect_invalid_errors (GLog *glog, GLogItem *logitem) {
2007+
uint8_t idx = 0;
20072008
if (logitem->errstr) {
20082009
pthread_mutex_lock (&glog->error_mutex);
20092010

2010-
uint8_t idx = atomic_load (&glog->log_erridx);
2011+
idx = atomic_load (&glog->log_erridx);
20112012
if (idx < MAX_LOG_ERRORS) {
20122013
glog->errors[idx] = xstrdup (logitem->errstr);
20132014
atomic_store (&glog->log_erridx, idx + 1);

0 commit comments

Comments
 (0)