mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
CLEANUP: objtype: make obj_type() and obj_type_name() take consts
There is no reason for them to require a writable area.
This commit is contained in:
parent
9b7a976cd6
commit
6ea63c301d
@ -33,14 +33,14 @@
|
|||||||
#include <types/stream.h>
|
#include <types/stream.h>
|
||||||
#include <types/stream_interface.h>
|
#include <types/stream_interface.h>
|
||||||
|
|
||||||
static inline enum obj_type obj_type(enum obj_type *t)
|
static inline enum obj_type obj_type(const enum obj_type *t)
|
||||||
{
|
{
|
||||||
if (!t || *t >= OBJ_TYPE_ENTRIES)
|
if (!t || *t >= OBJ_TYPE_ENTRIES)
|
||||||
return OBJ_TYPE_NONE;
|
return OBJ_TYPE_NONE;
|
||||||
return *t;
|
return *t;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline const char *obj_type_name(enum obj_type *t)
|
static inline const char *obj_type_name(const enum obj_type *t)
|
||||||
{
|
{
|
||||||
switch (obj_type(t)) {
|
switch (obj_type(t)) {
|
||||||
case OBJ_TYPE_NONE: return "NONE";
|
case OBJ_TYPE_NONE: return "NONE";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user