Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 31095) +++ trunk/src/gui_act.c (revision 31096) @@ -623,8 +623,6 @@ return 0; } -#define istrue(s) ((*(s) == '1') || (*(s) == 'y') || (*(s) == 'Y') || (*(s) == 't') || (*(s) == 'T')) - static const char pcb_acts_EditLayer[] = "Editlayer([@layer], [name=text|auto=[0|1]|sub=[0|1])]\nEditlayer([@layer], attrib, key=value)"; static const char pcb_acth_EditLayer[] = "Change a property or attribute of a layer. If the first argument starts with @, it is taken as the layer name to manipulate, else the action uses the current layer. Without arguments or if only a layer name is specified, interactive runs editing."; static fgw_error_t pcb_act_EditLayer(fgw_arg_t *res, int argc, fgw_arg_t *argv) @@ -651,7 +649,7 @@ } else if (strncmp(arg, "auto=", 5) == 0) { interactive = 0; - if (istrue(arg+5)) + if (rnd_istrue(arg+5)) ly->comb |= PCB_LYC_AUTO; else ly->comb &= ~PCB_LYC_AUTO; @@ -659,7 +657,7 @@ } else if (strncmp(arg, "sub=", 4) == 0) { interactive = 0; - if (istrue(arg+4)) + if (rnd_istrue(arg+4)) ly->comb |= PCB_LYC_SUB; else ly->comb &= ~PCB_LYC_SUB; Index: trunk/src/librnd/core/misc_util.h =================================================================== --- trunk/src/librnd/core/misc_util.h (revision 31095) +++ trunk/src/librnd/core/misc_util.h (revision 31096) @@ -83,4 +83,7 @@ b = __tmp__; \ } while(0) +#define rnd_istrue(s) (((s) != NULL) && ((*(s) == '1') || (*(s) == 'y') || (*(s) == 'Y') || (*(s) == 't') || (*(s) == 'T'))) + + #endif Index: trunk/src/obj_common.c =================================================================== --- trunk/src/obj_common.c (revision 31095) +++ trunk/src/obj_common.c (revision 31096) @@ -161,8 +161,6 @@ } } -#define istrue(s) ((*(s) == '1') || (*(s) == 'y') || (*(s) == 'Y') || (*(s) == 't') || (*(s) == 'T')) - void pcb_obj_attrib_post_change(rnd_attribute_list_t *list, const char *name, const char *value) { pcb_any_obj_t *obj = (pcb_any_obj_t *)(((char *)list) - offsetof(pcb_any_obj_t, Attributes)); @@ -210,7 +208,7 @@ } else if ((obj->type == PCB_OBJ_TEXT) && (strcmp(name, "tight_clearance") == 0)) { pcb_text_t *t = (pcb_text_t *)obj; - t->tight_clearance = value == NULL ? 0 : istrue(value); + t->tight_clearance = rnd_istrue(value); } }