From: Willy Tarreau Date: Wed, 22 May 2019 07:30:09 +0000 (+0200) Subject: CLEANUP: objtype: make obj_type() and obj_type_name() take consts X-Git-Tag: v2.0-dev4~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6ea63c301dd8d743fe7d63b8268428325c64d7a9;p=thirdparty%2Fhaproxy.git CLEANUP: objtype: make obj_type() and obj_type_name() take consts There is no reason for them to require a writable area. --- diff --git a/include/proto/obj_type.h b/include/proto/obj_type.h index afb8d90475..cc35d5cddd 100644 --- a/include/proto/obj_type.h +++ b/include/proto/obj_type.h @@ -33,14 +33,14 @@ #include #include -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) return OBJ_TYPE_NONE; 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)) { case OBJ_TYPE_NONE: return "NONE";