libmpm

morphux C package management library
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/libmpm

commit 555ae66d544601fe6b4ec156e31acf6ad109b648
parent 6bf4fab97cc67a8c72326a77e13b0ca278de1ea1
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Mon,  6 Mar 2017 19:29:41 +0100

Fix(Code style): flags{c,h}

Diffstat:
Minc/flags.h | 8++++----
Msrc/flags.c | 4++--
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/inc/flags.h b/inc/flags.h @@ -18,12 +18,12 @@ # define FLAGS_H # include <morphux.h> -enum { +typedef enum flag_index_e { MPM_VERBOSE_LEVEL = 0, MPM_LAST /* Always keep this one last */ -}; +} flag_index_t; -void mpm_set_flag(u8_t flag, u8_t val); -u8_t mpm_get_flag(u8_t flag); +void mpm_set_flag(flag_index_t flag, u8_t val); +u8_t mpm_get_flag(flag_index_t flag); #endif /* FLAGS_H */ diff --git a/src/flags.c b/src/flags.c @@ -25,7 +25,7 @@ static u8_t mpm_flags[MPM_LAST] = {0}; * \note If the flag is greater than MPM_LAST value this function won't do * anything */ -void mpm_set_flag(u8_t flag, u8_t val) { +void mpm_set_flag(flag_index_t flag, u8_t val) { if (flag < MPM_LAST) mpm_flags[flag] = val; } @@ -37,7 +37,7 @@ void mpm_set_flag(u8_t flag, u8_t val) { * \note If the value asked by the caller is higher than MPM_LAST, this function * will raiser an assertion. */ -u8_t mpm_get_flag(u8_t flag) { +u8_t mpm_get_flag(flag_index_t flag) { assert(flag < MPM_LAST); return mpm_flags[flag]; }