From 05ec537e64f916c4054b3a999235ae7f5fe85595 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Wed, 5 Aug 2020 13:42:43 +0100 Subject: [PATCH] Use static_assert instead of DALI_COMPILE_TIME_ASSERT Change-Id: I0602a19c8e1271eb18dc8619dc488384f6f2257e --- dali/internal/imaging/common/loader-astc.cpp | 3 +-- dali/internal/imaging/common/loader-ktx.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/dali/internal/imaging/common/loader-astc.cpp b/dali/internal/imaging/common/loader-astc.cpp index 1371a65..e63d846 100755 --- a/dali/internal/imaging/common/loader-astc.cpp +++ b/dali/internal/imaging/common/loader-astc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ // EXTERNAL INCLUDES #include -#include #include #include #include diff --git a/dali/internal/imaging/common/loader-ktx.cpp b/dali/internal/imaging/common/loader-ktx.cpp index e431239..09116b6 100755 --- a/dali/internal/imaging/common/loader-ktx.cpp +++ b/dali/internal/imaging/common/loader-ktx.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ // EXTERNAL INCLUDES #include -#include #include #include #include @@ -209,7 +208,7 @@ bool CheckFileIdentifier(const Byte * const signature) { const unsigned signatureSize = BYTES_IN_SIGNATURE; const unsigned identifierSize = sizeof(FileIdentifier); - DALI_COMPILE_TIME_ASSERT(signatureSize == identifierSize); + static_assert(signatureSize == identifierSize); const bool signatureGood = 0 == memcmp( signature, FileIdentifier, std::min( signatureSize, identifierSize ) ); return signatureGood; } @@ -535,8 +534,8 @@ bool LoadKtxHeader( const Dali::ImageLoader::Input& input, unsigned int& width, // File loading API entry-point: bool LoadBitmapFromKtx( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap ) { - DALI_COMPILE_TIME_ASSERT( sizeof(Byte) == 1); - DALI_COMPILE_TIME_ASSERT( sizeof(uint32_t) == 4); + static_assert(sizeof(Byte) == 1); + static_assert(sizeof(uint32_t) == 4); FILE* const fp = input.file; if( fp == NULL ) -- 2.7.4