From 480288ca001564fa8c9fbdd72be442bbe7ee3d97 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Thu, 3 Sep 2015 11:25:52 +0200 Subject: Adds compilation options, renames preprocessor macros to avoid collisions. --- src/axis.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'src/axis.c') diff --git a/src/axis.c b/src/axis.c index bf9a6fc..74f1d7e 100644 --- a/src/axis.c +++ b/src/axis.c @@ -6,41 +6,41 @@ #include "error.h" /* - * Implementation note: _IS_PREFIX, as its name implies, is checking for a + * Implementation note: RELABSD_IS_PREFIX, as its name implies, is checking for a * prefix, not an equal value. This could cause issues if there were axes * with name prefixed by another axis name. */ enum relabsd_axis relabsd_axis_from_name (const char * const name) { - if (_IS_PREFIX("X", name)) + if (RELABSD_IS_PREFIX("X", name)) { return RELABSD_X; } - else if (_IS_PREFIX("Y", name)) + else if (RELABSD_IS_PREFIX("Y", name)) { return RELABSD_Y; } - else if (_IS_PREFIX("Z", name)) + else if (RELABSD_IS_PREFIX("Z", name)) { return RELABSD_Z; } - else if (_IS_PREFIX("RX", name)) + else if (RELABSD_IS_PREFIX("RX", name)) { return RELABSD_RX; } - else if (_IS_PREFIX("RY", name)) + else if (RELABSD_IS_PREFIX("RY", name)) { return RELABSD_RY; } - else if (_IS_PREFIX("RZ", name)) + else if (RELABSD_IS_PREFIX("RZ", name)) { return RELABSD_RZ; } - else if (_IS_PREFIX("WL", name)) + else if (RELABSD_IS_PREFIX("WL", name)) { return RELABSD_WHEEL; } - else if (_IS_PREFIX("MC", name)) + else if (RELABSD_IS_PREFIX("MC", name)) { return RELABSD_MISC; } @@ -83,7 +83,7 @@ char * relabsd_axis_to_name (enum relabsd_axis const e) break; } - _S_PROG_ERROR("relabsd_axis_to_name is missing at least 1 case."); + RELABSD_S_PROG_ERROR("relabsd_axis_to_name is missing at least 1 case."); return ".."; } @@ -162,14 +162,17 @@ unsigned int relabsd_axis_to_rel (enum relabsd_axis const e) return REL_MISC; case RELABSD_UNKNOWN: - _S_PROG_ERROR("relabsd_axis_to_rel(RELABSD_UNKNOWN) is forbidden."); + RELABSD_S_PROG_ERROR + ( + "relabsd_axis_to_rel(RELABSD_UNKNOWN) is forbidden." + ); return REL_MAX; default: break; } - _S_PROG_ERROR("relabsd_axis_to_rel is missing at least 1 case."); + RELABSD_S_PROG_ERROR("relabsd_axis_to_rel is missing at least 1 case."); return REL_MAX; } @@ -203,14 +206,17 @@ unsigned int relabsd_axis_to_abs (enum relabsd_axis const e) return ABS_MISC; case RELABSD_UNKNOWN: - _S_PROG_ERROR("relabsd_axis_to_abs(RELABSD_UNKNOWN) is forbidden."); + RELABSD_S_PROG_ERROR + ( + "relabsd_axis_to_abs(RELABSD_UNKNOWN) is forbidden." + ); return ABS_MAX; default: break; } - _S_PROG_ERROR("relabsd_axis_to_rel is missing at least 1 case."); + RELABSD_S_PROG_ERROR("relabsd_axis_to_abs is missing at least 1 case."); return REL_MAX; } -- cgit v1.2.3-70-g09d2