]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: objtype: make obj_type() and obj_type_name() take consts
authorWilly Tarreau <w@1wt.eu>
Wed, 22 May 2019 07:30:09 +0000 (09:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 May 2019 09:50:48 +0000 (11:50 +0200)
There is no reason for them to require a writable area.

include/proto/obj_type.h

index afb8d90475f570a0b62aad8e377ed74aa8461220..cc35d5cddd53b996d9b5e82035ae2b0c928ace19 100644 (file)
 #include <types/stream.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)
                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";