fix compiling errors by using GCC/Clang

This commit is contained in:
Jinhao
2015-07-28 01:53:41 +08:00
parent 396163c1b7
commit 894e7e61c8
11 changed files with 44 additions and 44 deletions

View File

@@ -8,8 +8,8 @@ namespace nana{ namespace audio
//class audio_stream
bool audio_stream::open(const nana::string& file)
{
std::string fname{nana::charset(file)};//static_cast<std::string>()
fs_.open(fname, std::ios::binary);
std::string fname = nana::charset(file);
fs_.open(fname, std::ios::binary);
if(fs_)
{
wave_spec::master_riff_chunk riff;
@@ -89,4 +89,4 @@ namespace nana{ namespace audio
}//end namespace detail
}//end namespace audio
}//end namespace nana
}//end namespace nana

View File

@@ -1,6 +1,6 @@
/*
* A FileSystem Utility Implementation
* Copyright(C) 2003-2013 Jinhao(cnjinhao@hotmail.com)
* A ISO C++ FileSystem Implementation
* Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
@@ -206,8 +206,8 @@ namespace nana {
struct stat fst;
if (0 == ::stat(static_cast<std::string>(nana::charset(file)).c_str(), &fst))
{
attr.bytes = fst.st_size;
attr.is_directory = (0 != (040000 & fst.st_mode));
attr.size = fst.st_size;
attr.directory = (0 != (040000 & fst.st_mode));
attr.modified = *(::localtime(&fst.st_ctime));
return true;
}
@@ -435,7 +435,7 @@ namespace nana {
#elif defined(NANA_LINUX)
const char * s = ::getenv("PWD");
if (s)
return nana::charset(std::string(s, std::strlen(s)), nana::unicode::utf8);
return static_cast<nana::string>(nana::charset(std::string(s, std::strlen(s)), nana::unicode::utf8));
#endif
return nana::string();
}

View File

@@ -444,7 +444,7 @@ namespace detail
arg.window_handle = reinterpret_cast<window>(wd);
arg.button = ::nana::mouse::any_button;
int mask_state == 0;
int mask_state = 0;
if (ButtonPress == msg || ButtonRelease == msg)
{
mask_state = evt.xbutton.state;
@@ -483,11 +483,11 @@ namespace detail
arg.pos.y = evt.xcrossing.y - wd->pos_root.y;
}
arg.left_button = (Button1Mask & state);
arg.right_button = (Button2Mask & state);
arg.mid_button = (Button3Mask & state);
arg.shift = (ShiftMask & state);
arg.ctrl = (ControlMask & state);
arg.left_button = (Button1Mask & mask_state);
arg.right_button = (Button2Mask & mask_state);
arg.mid_button = (Button3Mask & mask_state);
arg.shift = (ShiftMask & mask_state);
arg.ctrl = (ControlMask & mask_state);
}
@@ -1133,7 +1133,7 @@ namespace detail
brock.emit(event_code::key_release, msgwnd, arg, true, &context);
}
if (context.platform.keychar < keyboard::os_arrow_left || keyboard::os_arrow_down < wParam)
if (context.platform.keychar < keyboard::os_arrow_left || keyboard::os_arrow_down < context.platform.keychar)
brock.delay_restore(2); //Restores while key release
}
else

View File

@@ -163,7 +163,7 @@ namespace nana
btn_folder_.create(*this);
btn_folder_.caption(STR("&New Folder"));
btn_folder_.events().click.connect_unignorable([this](const arg_mouse&)
btn_folder_.events().click.connect_unignorable([this](const arg_click&)
{
form fm(this->handle(), API::make_center(*this, 300, 35));
fm.caption(STR("Name the new folder"));
@@ -179,7 +179,7 @@ namespace nana
button btn_cancel(fm, nana::rectangle(235, 5, 60, 25));
btn_cancel.caption(STR("Cancel"));
btn_cancel.events().click.connect_unignorable([&fm](const arg_mouse&)
btn_cancel.events().click.connect_unignorable([&fm](const arg_click&)
{
fm.close();
});
@@ -288,14 +288,14 @@ namespace nana
btn_ok_.create(*this);
btn_ok_.caption(STR("&OK"));
btn_ok_.events().click.connect_unignorable([this](const arg_mouse&)
btn_ok_.events().click.connect_unignorable([this](const arg_click&)
{
_m_ok();
});
btn_cancel_.create(*this);
btn_cancel_.caption(STR("&Cancel"));
btn_cancel_.events().click.connect_unignorable([this](const arg_mouse&)
btn_cancel_.events().click.connect_unignorable([this](const arg_click&)
{
API::close_window(handle());
});

View File

@@ -48,7 +48,7 @@ namespace nana
{
graph.rectangle(rectangle{0, 0, graph.width(), graph.height() - 50}, true, colors::white);
if(ico_.empty() == false)
ico_.stretch(ico_.size(), graph, rectangle{12, 25, 32, 32});
ico_.stretch(rectangle{ico_.size()}, graph, rectangle{12, 25, 32, 32});
});
unsigned width_pixel = 45;
@@ -57,7 +57,7 @@ namespace nana
place_.bind(*this);
yes_.create(*this);
yes_.events().click.connect_unignorable([this](const arg_mouse& arg)
yes_.events().click.connect_unignorable([this](const arg_click& arg)
{
_m_click(arg);
});
@@ -69,7 +69,7 @@ namespace nana
yes_.caption(STR("Yes"));
no_.create(*this);
no_.caption(STR("No"));
no_.events().click.connect_unignorable([this](const arg_mouse& arg)
no_.events().click.connect_unignorable([this](const arg_click& arg)
{
_m_click(arg);
});
@@ -80,7 +80,7 @@ namespace nana
{
cancel_.create(*this);
cancel_.caption(STR("Cancel"));
cancel_.events().click.connect_unignorable([this](const arg_mouse& arg)
cancel_.events().click.connect_unignorable([this](const arg_click& arg)
{
_m_click(arg);
});
@@ -303,11 +303,11 @@ namespace nana
nana::paint::pixel_buffer pxbuf(32, 32);
pxbuf.put(reinterpret_cast<const unsigned char*>(rawpx), 32, 32, 32, 4*32, true);
ico_.make({32, 32});
pxbuf.paste(ico_.handle(), 0, 0);
pxbuf.paste(ico_.handle(), {});
}
}
void _m_click(const arg_mouse& arg)
void _m_click(const arg_click& arg)
{
if(arg.window_handle == yes_)
pick_ = (no_.empty() ? msgbox::pick_ok : msgbox::pick_yes);

View File

@@ -114,7 +114,7 @@ namespace nana
void load_monitors()
{
displays.clear();
displays.emplace_back(0, primary_monitor_size());
displays.emplace_back(0, rectangle{primary_monitor_size()});
}
#endif

View File

@@ -165,13 +165,13 @@ namespace nana{
return *this;
}
group& group::collocate()
group& group::collocate() throw ()
{
impl_->place_content.collocate();
return *this;
}
group& group::div(const char* div_str)
group& group::div(const char* div_str) throw ()
{
if (div_str)
impl_->usr_div_str = div_str;

View File

@@ -17,6 +17,7 @@
#include <nana/unicode_bidi.hpp>
#include <numeric>
#include <cwctype>
#include <cstring>
#include <set>
#include <algorithm>

View File

@@ -417,7 +417,7 @@ namespace nana{ namespace paint
#elif defined(NANA_X11)
try
{
storage_ = std::make_shared<pixel_buffer_storage>(drawable, sz);
storage_ = std::make_shared<pixel_buffer_storage>(drawable, nana::rectangle{sz});
storage_->detach();
return true;
}