Changeset 1130 for cpp/common/log.cpp


Ignore:
Timestamp:
04/16/21 15:55:34 (3 years ago)
Author:
Maciej Komosinski
Message:

Used std::min(), std::max() explicitly to avoid compiler confusion. Used std::size() explicitly instead of the equivalent macro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/log.cpp

    r875 r1130  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2019  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    88#include "Convert.h"
    99#include <assert.h>
     10#include <algorithm>
    1011
    1112const char* LOG_LEVEL_ARRAY[] = { "[DEBUG] ", "", "[WARN] ", "[ERROR] ", "[CRITICAL] " };
     
    3637{
    3738        assert((level>=LOG_MIN) && (level<=LOG_MAX));
    38         level = min(LOG_MAX, max(LOG_MIN, level));
     39        level = std::min(LOG_MAX, std::max(LOG_MIN, level));
    3940        return LOG_LEVEL_ARRAY[level + 1];
    4041}
Note: See TracChangeset for help on using the changeset viewer.