mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-14 09:41:19 +00:00
Replace INT_MAX with std::numeric_limits<int>::max()
This commit is contained in:
parent
c8c688beb2
commit
2bee243c39
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
// Copyright (C) 2001-2017 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "palette_size.xml.h"
|
||||
|
||||
#include <climits>
|
||||
#include <limits>
|
||||
|
||||
namespace app {
|
||||
|
||||
@ -63,7 +63,7 @@ void PaletteSizeCommand::onExecute(Context* context)
|
||||
if (ncolors == palette.size())
|
||||
return;
|
||||
|
||||
palette.resize(MID(1, ncolors, INT_MAX));
|
||||
palette.resize(MID(1, ncolors, std::numeric_limits<int>::max()));
|
||||
|
||||
ContextWriter writer(reader);
|
||||
Transaction transaction(context, "Palette Size", ModifyDocument);
|
||||
|
@ -71,6 +71,7 @@
|
||||
#include "ui/tooltips.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
|
||||
namespace app {
|
||||
|
||||
@ -220,7 +221,8 @@ ColorBar::ColorBar(int align)
|
||||
m_bgColor.resetSizeHint();
|
||||
m_fgColor.setSizeHint(0, m_fgColor.sizeHint().h);
|
||||
m_bgColor.setSizeHint(0, m_bgColor.sizeHint().h);
|
||||
m_buttons.setMaxSize(gfx::Size(INT_MAX, INT_MAX)); // TODO add resetMaxSize
|
||||
m_buttons.setMaxSize(gfx::Size(std::numeric_limits<int>::max(),
|
||||
std::numeric_limits<int>::max())); // TODO add resetMaxSize
|
||||
m_buttons.setMaxSize(gfx::Size(m_buttons.sizeHint().w,
|
||||
16*ui::guiscale()));
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "ui/slider.h"
|
||||
#include "ui/theme.h"
|
||||
|
||||
#include <climits>
|
||||
#include <limits>
|
||||
|
||||
namespace app {
|
||||
|
||||
@ -376,7 +376,8 @@ void ColorSliders::addSlider(const Channel channel,
|
||||
item.relSlider->setExpansive(true);
|
||||
item.relSlider->setVisible(false);
|
||||
|
||||
gfx::Size sz(INT_MAX, SkinTheme::instance()->dimensions.colorSliderHeight());
|
||||
gfx::Size sz(std::numeric_limits<int>::max(),
|
||||
SkinTheme::instance()->dimensions.colorSliderHeight());
|
||||
item.label->setMaxSize(sz);
|
||||
item.box->setMaxSize(sz);
|
||||
item.entry->setMaxSize(sz);
|
||||
|
@ -45,10 +45,10 @@
|
||||
#include "ui/ui.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <climits>
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
#include <vector>
|
||||
|
||||
namespace app {
|
||||
@ -718,7 +718,8 @@ void StatusBar::onInitTheme(ui::InitThemeEvent& ev)
|
||||
setBgColor(theme->colors.statusBarFace());
|
||||
setBorder(gfx::Border(6*guiscale(), 0, 6*guiscale(), 0));
|
||||
setMinSize(Size(0, textHeight()+8*guiscale()));
|
||||
setMaxSize(Size(INT_MAX, textHeight()+8*guiscale()));
|
||||
setMaxSize(Size(std::numeric_limits<int>::max(),
|
||||
textHeight()+8*guiscale()));
|
||||
|
||||
m_newFrame->setStyle(theme->styles.newFrameButton());
|
||||
m_commandsBox->setBorder(gfx::Border(2, 1, 2, 2)*guiscale());
|
||||
|
@ -32,10 +32,10 @@
|
||||
|
||||
#include "tinyxml.h"
|
||||
|
||||
#include <climits>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
|
||||
namespace app {
|
||||
|
||||
@ -593,14 +593,15 @@ void WidgetLoader::fillWidgetWithXmlElementAttributes(const TiXmlElement* elem,
|
||||
widget->InitTheme.connect(
|
||||
[widget, minw, minh, maxw, maxh]{
|
||||
widget->setMinSize(gfx::Size(0, 0));
|
||||
widget->setMaxSize(gfx::Size(INT_MAX, INT_MAX));
|
||||
widget->setMaxSize(gfx::Size(std::numeric_limits<int>::max(),
|
||||
std::numeric_limits<int>::max()));
|
||||
const gfx::Size reqSize = widget->sizeHint();
|
||||
widget->setMinSize(
|
||||
gfx::Size((minw > 0 ? guiscale()*minw: reqSize.w),
|
||||
(minh > 0 ? guiscale()*minh: reqSize.h)));
|
||||
widget->setMaxSize(
|
||||
gfx::Size((maxw > 0 ? guiscale()*maxw: INT_MAX),
|
||||
(maxh > 0 ? guiscale()*maxh: INT_MAX)));
|
||||
gfx::Size((maxw > 0 ? guiscale()*maxw: std::numeric_limits<int>::max()),
|
||||
(maxh > 0 ? guiscale()*maxh: std::numeric_limits<int>::max())));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -35,10 +35,10 @@
|
||||
#include "ui/window.h"
|
||||
|
||||
#include <cctype>
|
||||
#include <climits>
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
#include <queue>
|
||||
#include <sstream>
|
||||
|
||||
@ -72,7 +72,8 @@ Widget::Widget(WidgetType type)
|
||||
, m_sizeHint(nullptr)
|
||||
, m_mnemonic(0)
|
||||
, m_minSize(0, 0)
|
||||
, m_maxSize(INT_MAX, INT_MAX)
|
||||
, m_maxSize(std::numeric_limits<int>::max(),
|
||||
std::numeric_limits<int>::max())
|
||||
, m_childSpacing(0)
|
||||
{
|
||||
details::addWidget(this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user