Skip to content

Commit

Permalink
Simplify warning suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Apr 11, 2020
1 parent bbb6b35 commit 8cd8ef0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 2 additions & 8 deletions include/fmt/core.h
Expand Up @@ -192,21 +192,15 @@
#endif

#if !defined(FMT_HEADER_ONLY) && defined(_WIN32)
# if FMT_MSC_VER
# define FMT_NO_W4275 __pragma(warning(suppress : 4275))
# else
# define FMT_NO_W4275
# endif
# define FMT_CLASS_API FMT_NO_W4275
# define FMT_CLASS_API FMT_SUPPRESS_MSC_WARNING(4275)
# ifdef FMT_EXPORT
# define FMT_API __declspec(dllexport)
# define FMT_EXTERN_TEMPLATE_API FMT_API
# elif defined(FMT_SHARED)
# define FMT_API __declspec(dllimport)
# define FMT_EXTERN_TEMPLATE_API FMT_API
# endif
#endif
#ifndef FMT_CLASS_API
#else
# define FMT_CLASS_API
#endif
#ifndef FMT_API
Expand Down
4 changes: 2 additions & 2 deletions include/fmt/format.h
Expand Up @@ -189,7 +189,7 @@ inline uint32_t clz(uint32_t x) {
// Static analysis complains about using uninitialized data
// "r", but the only way that can happen is if "x" is 0,
// which the callers guarantee to not happen.
# pragma warning(suppress : 6102)
FMT_SUPPRESS_MSC_WARNING(6102)
return 31 - r;
}
# define FMT_BUILTIN_CLZ(n) internal::clz(n)
Expand All @@ -214,7 +214,7 @@ inline uint32_t clzll(uint64_t x) {
// Static analysis complains about using uninitialized data
// "r", but the only way that can happen is if "x" is 0,
// which the callers guarantee to not happen.
# pragma warning(suppress : 6102)
FMT_SUPPRESS_MSC_WARNING(6102)
return 63 - r;
}
# define FMT_BUILTIN_CLZLL(n) internal::clzll(n)
Expand Down

0 comments on commit 8cd8ef0

Please sign in to comment.