src/misc/dbg_helpers.h
changeset 7122 444ddcad8909
parent 7118 78372bbb200b
child 9111 48ce04029fe4
equal deleted inserted replaced
7121:ac2b3710f262 7122:444ddcad8909
     1 /* $Id:$ */
     1 /* $Id$ */
     2 
     2 
     3 /** @file dbg_helpers.h */
     3 /** @file dbg_helpers.h */
     4 
     4 
     5 #ifndef DBG_HELPERS
     5 #ifndef DBG_HELPERS
     6 #define DBG_HELPERS
     6 #define DBG_HELPERS
    65 	if (value == val_inv) {
    65 	if (value == val_inv) {
    66 		out = name_inv;
    66 		out = name_inv;
    67 	} else if (value == 0) {
    67 	} else if (value == 0) {
    68 		out = "<none>";
    68 		out = "<none>";
    69 	} else {
    69 	} else {
    70 		for (int i = 0; i < ArrayT<T>::length; i++) {
    70 		for (size_t i = 0; i < ArrayT<T>::length; i++) {
    71 			if ((value & (1 << i)) == 0) continue;
    71 			if ((value & (1 << i)) == 0) continue;
    72 			out.AddFormat("%s%s", (out.Size() > 0 ? "+" : ""), t[i]);
    72 			out.AddFormat("%s%s", (out.Size() > 0 ? "+" : ""), t[i]);
    73 			value &= ~(E)(1 << i);
    73 			value &= ~(E)(1 << i);
    74 		}
    74 		}
    75 		if (value != 0) out.AddFormat("%s%s", (out.Size() > 0 ? "+" : ""), t_unk);
    75 		if (value != 0) out.AddFormat("%s%s", (out.Size() > 0 ? "+" : ""), t_unk);