From: David James Sherman Date: Wed, 21 Jun 2017 15:09:02 +0000 (+0200) Subject: Resolve GitLab issue #3. Applies MISRA and CERT guidelines. X-Git-Tag: 1.1~176 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=82f162dc3246f17ee08579ee5aa755937fd4bf09;p=open-adventure.git Resolve GitLab issue #3. Applies MISRA and CERT guidelines. MISRA C++:2008, 2-13-4 - Literal suffixes shall be upper case MISRA C:2012, 7.3 - The lowercase character "l" shall not be used in a literal suffix CERT DCL16-C. - Use "L," not "l," to indicate a long value CERT DCL16-CPP. - Use "L," not "l," to indicate a long value CERT, DCL50-J. - Use visually distinct identifiers --- diff --git a/dungeon.c b/dungeon.c index a39e413..e92dcc9 100644 --- a/dungeon.c +++ b/dungeon.c @@ -54,7 +54,7 @@ long ACTSPK[VRBSIZ + 1]; static bool is_set(long var, long position) { - long mask = 1l << position; + long mask = 1L << position; bool result = (var & mask) == mask; return (result); } @@ -308,7 +308,7 @@ static void read_conditions(FILE* database) while ((loc = GETNUM(NULL)) != 0) { if (is_set(COND[loc], K)) BUG(LOCATION_HAS_CONDITION_BIT_BEING_SET_TWICE); - COND[loc] = COND[loc] + (1l << K); + COND[loc] = COND[loc] + (1L << K); } } }