Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
flagarde committed May 14, 2024
1 parent b171b95 commit 2783874
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions include/Khaos/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
#ifndef KHAOS_VERSION_H_
#define KHAOS_VERSION_H_

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wc++98-compat"
#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
#endif

/*!
* \file Version.h
* \brief Define macros to set, get versions.
Expand Down Expand Up @@ -49,7 +43,7 @@
* #define KHAOS_DEFINE_name_VERSION_PRIVATE() SET_VERSION(2,3,4,5)
* \endcode
*/
#define SET_VERSION(major, minor, patch, tweak) ((((major)*1ULL % (1 << 16)) << 48) + (((minor)*1ULL % (1 << 16)) << 32) + (((patch)*1ULL % (1 << 16)) << 16) + ((tweak)*1ULL % (1 << 16))) /* //NOSONAR */
#define SET_VERSION(major, minor, patch, tweak) ((((major)*1UL % (1 << 16)) << 48) + (((minor)*1UL % (1 << 16)) << 32) + (((patch)*1UL % (1 << 16)) << 16) + ((tweak)*1UL % (1 << 16))) /* //NOSONAR */

/*!
* \hideinitializer
Expand All @@ -58,7 +52,7 @@
*
* \note Value can be directly used in both preprocessor and compiler expressions for comparison to other similarly defined values.
*/
#define GET_VERSION_MAJOR(name) ((((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1ULL) >> 48) % (1 << 16)) /* //NOSONAR */
#define GET_VERSION_MAJOR(name) ((((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1UL) >> 48) % (1 << 16)) /* //NOSONAR */

/*!
* \hideinitializer
Expand All @@ -67,7 +61,7 @@
*
* \note Value can be directly used in both preprocessor and compiler expressions for comparison to other similarly defined values.
*/
#define GET_VERSION_MINOR(name) ((((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1ULL) >> 32) % (1 << 16)) /* //NOSONAR */
#define GET_VERSION_MINOR(name) ((((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1UL) >> 32) % (1 << 16)) /* //NOSONAR */

/*!
* \hideinitializer
Expand All @@ -76,7 +70,7 @@
*
* \note Value can be directly used in both preprocessor and compiler expressions for comparison to other similarly defined values.
*/
#define GET_VERSION_PATCH(name) ((((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1ULL) >> 16) % (1 << 16)) /* //NOSONAR */
#define GET_VERSION_PATCH(name) ((((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1UL) >> 16) % (1 << 16)) /* //NOSONAR */

/*!
* \hideinitializer
Expand All @@ -85,10 +79,6 @@
*
* \note Value can be directly used in both preprocessor and compiler expressions for comparison to other similarly defined values.
*/
#define GET_VERSION_TWEAK(name) (((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1ULL) % (1 << 16)) /* //NOSONAR */

#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#define GET_VERSION_TWEAK(name) (((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1UL) % (1 << 16)) /* //NOSONAR */

#endif /* KHAOS_VERSION_H_ */

0 comments on commit 2783874

Please sign in to comment.