Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warning with clang shipped with Android NDK r22b #128

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/optick.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ namespace Optick
// Image: http://i.msdn.microsoft.com/dynimg/IC24340.png
struct Color
{
enum
enum : uint32_t
{
Null = 0x00000000,
AliceBlue = 0xFFF0F8FF,
Expand Down
11 changes: 9 additions & 2 deletions src/optick_core.win.h
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ CaptureStatus::Type ETW::Start(Mode::Type mode, int frequency, const ThreadList&

if (mode & Mode::AUTOSAMPLING)
{
TRACE_PROFILE_INTERVAL itnerval = { 0 };
TRACE_PROFILE_INTERVAL itnerval = { 0, 0 };
memset(&itnerval, 0, sizeof(TRACE_PROFILE_INTERVAL));
int step = 10000 * 1000 / frequency; // 1ms = 10000 steps
itnerval.Interval = step; // std::max(1221, std::min(step, 10000));
Expand Down Expand Up @@ -1615,11 +1615,18 @@ struct SYSTEM_MODULE_INFORMATION

#pragma warning (push)
#pragma warning(disable : 4200)
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wc99-extensions"
#endif
struct MODULE_LIST
{
DWORD dwModules;
SYSTEM_MODULE_INFORMATION pModulesInfo[];
};
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#pragma warning (pop)

void WinSymbolEngine::InitSystemModules()
Expand Down Expand Up @@ -1693,7 +1700,7 @@ void WinSymbolEngine::InitApplicationModules()

for (int i = 0; i < moduleCount; ++i)
{
MODULEINFO info = { 0 };
MODULEINFO info = { 0, 0, 0 };
if (GetModuleInformation(processHandle, hModules[i], &info, sizeof(MODULEINFO)))
{
char name[MAX_PATH] = "UnknownModule";
Expand Down
2 changes: 1 addition & 1 deletion src/optick_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ namespace Optick
Allocator(const Allocator<U>&) {}
template<typename U> struct rebind { typedef Allocator<U> other; };

typename std::allocator<T>::pointer allocate(typename std::allocator<T>::size_type n, typename std::allocator<void>::const_pointer = 0)
typename std::allocator<T>::pointer allocate(typename std::allocator<T>::size_type n)
{
return reinterpret_cast<typename std::allocator<T>::pointer>(Memory::Alloc(n * sizeof(T)));
}
Expand Down