mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
BUILD: server: check->desc always exists
Clang reports this warning : src/server.c:872:14: warning: address of array 'check->desc' will always evaluate to 'true' [-Wpointer-bool-conversion] Indeed, check->desc used to be a pointer to a dynamically allocated area a long time ago and is now an array. Let's remove the useless test.
This commit is contained in:
parent
1f09467114
commit
358847f026
@ -869,7 +869,6 @@ void srv_set_stopped(struct server *s, const char *reason, struct check *check)
|
|||||||
strlcpy2(s->op_st_chg.reason, reason, sizeof(s->op_st_chg.reason));
|
strlcpy2(s->op_st_chg.reason, reason, sizeof(s->op_st_chg.reason));
|
||||||
}
|
}
|
||||||
else if (check) {
|
else if (check) {
|
||||||
if (check->desc)
|
|
||||||
strlcpy2(s->op_st_chg.reason, check->desc, sizeof(s->op_st_chg.reason));
|
strlcpy2(s->op_st_chg.reason, check->desc, sizeof(s->op_st_chg.reason));
|
||||||
s->op_st_chg.code = check->code;
|
s->op_st_chg.code = check->code;
|
||||||
s->op_st_chg.status = check->status;
|
s->op_st_chg.status = check->status;
|
||||||
@ -908,7 +907,6 @@ void srv_set_running(struct server *s, const char *reason, struct check *check)
|
|||||||
strlcpy2(s->op_st_chg.reason, reason, sizeof(s->op_st_chg.reason));
|
strlcpy2(s->op_st_chg.reason, reason, sizeof(s->op_st_chg.reason));
|
||||||
}
|
}
|
||||||
else if (check) {
|
else if (check) {
|
||||||
if (check->desc)
|
|
||||||
strlcpy2(s->op_st_chg.reason, check->desc, sizeof(s->op_st_chg.reason));
|
strlcpy2(s->op_st_chg.reason, check->desc, sizeof(s->op_st_chg.reason));
|
||||||
s->op_st_chg.code = check->code;
|
s->op_st_chg.code = check->code;
|
||||||
s->op_st_chg.status = check->status;
|
s->op_st_chg.status = check->status;
|
||||||
@ -952,7 +950,6 @@ void srv_set_stopping(struct server *s, const char *reason, struct check *check)
|
|||||||
strlcpy2(s->op_st_chg.reason, reason, sizeof(s->op_st_chg.reason));
|
strlcpy2(s->op_st_chg.reason, reason, sizeof(s->op_st_chg.reason));
|
||||||
}
|
}
|
||||||
else if (check) {
|
else if (check) {
|
||||||
if (check->desc)
|
|
||||||
strlcpy2(s->op_st_chg.reason, check->desc, sizeof(s->op_st_chg.reason));
|
strlcpy2(s->op_st_chg.reason, check->desc, sizeof(s->op_st_chg.reason));
|
||||||
s->op_st_chg.code = check->code;
|
s->op_st_chg.code = check->code;
|
||||||
s->op_st_chg.status = check->status;
|
s->op_st_chg.status = check->status;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user