fix some compiler errors and warnings
This commit is contained in:
parent
b1ce0eaff2
commit
043ebad317
@ -1117,9 +1117,9 @@ namespace nana
|
|||||||
delete impl_;
|
delete impl_;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto menu::append(std::string text_utf8, const menu::event_fn_t& f) -> item_proxy
|
auto menu::append(std::string text_utf8, const menu::event_fn_t& callback) -> item_proxy
|
||||||
{
|
{
|
||||||
impl_->mbuilder.data().items.emplace_back(new item_type(std::move(text_utf8, callback));
|
impl_->mbuilder.data().items.emplace_back(new item_type(std::move(text_utf8), callback));
|
||||||
return item_proxy(size() - 1, *impl_->mbuilder.data().items.back());
|
return item_proxy(size() - 1, *impl_->mbuilder.data().items.back());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1159,7 +1159,7 @@ namespace nana
|
|||||||
|
|
||||||
void menu::text(std::size_t index, std::string text_utf8)
|
void menu::text(std::size_t index, std::string text_utf8)
|
||||||
{
|
{
|
||||||
impl_->mbuilder.data().items.at(index).text.swap(text_utf8);
|
impl_->mbuilder.data().items.at(index)->text.swap(text_utf8);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool menu::link(std::size_t index, menu& menu_obj)
|
bool menu::link(std::size_t index, menu& menu_obj)
|
||||||
|
@ -235,15 +235,14 @@ public:
|
|||||||
if (!file.is_open()) return false;
|
if (!file.is_open()) return false;
|
||||||
|
|
||||||
// allocates a buffer for the image
|
// allocates a buffer for the image
|
||||||
std::streampos size = 0;
|
|
||||||
file.seekg(0, std::ios::end);
|
file.seekg(0, std::ios::end);
|
||||||
size = file.tellg() - size;
|
const auto bytes = static_cast<std::size_t>(file.tellg());
|
||||||
file.seekg(0, std::ios::beg);
|
file.seekg(0, std::ios::beg);
|
||||||
auto buffer = new char[size];
|
auto buffer = new char[bytes];
|
||||||
|
|
||||||
// read data from the file and set them in the buffer
|
// read data from the file and set them in the buffer
|
||||||
file.read(buffer, size);
|
file.read(buffer, bytes);
|
||||||
auto okret = _m_read_ico(buffer, size);
|
auto okret = _m_read_ico(buffer, bytes);
|
||||||
|
|
||||||
// delete buffer and return
|
// delete buffer and return
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user