diff --git a/include/nana/gui/widgets/skeletons/text_token_stream.hpp b/include/nana/gui/widgets/skeletons/text_token_stream.hpp index a34183ce..3807ac16 100644 --- a/include/nana/gui/widgets/skeletons/text_token_stream.hpp +++ b/include/nana/gui/widgets/skeletons/text_token_stream.hpp @@ -665,8 +665,7 @@ namespace nana{ namespace widgets{ namespace skeletons case token::eof: return; default: - int * debug = 0; //for debug. - *debug = 0; + throw std::runtime_error("invalid token"); } } } diff --git a/source/gui/detail/window_manager.cpp b/source/gui/detail/window_manager.cpp index 0af79eb8..2fedf0d7 100644 --- a/source/gui/detail/window_manager.cpp +++ b/source/gui/detail/window_manager.cpp @@ -293,7 +293,7 @@ namespace detail auto result = native_interface::create_window(native, nested, r, app); if (result.native_handle) { - core_window_t* wd = new core_window_t(owner, widget_notifier_interface::get_notifier(wdg), (category::root_tag**)nullptr); + auto wd = new core_window_t(owner, widget_notifier_interface::get_notifier(wdg), (category::root_tag**)nullptr); if (nested) { wd->owner = nullptr; diff --git a/source/gui/widgets/skeletons/text_editor.cpp b/source/gui/widgets/skeletons/text_editor.cpp index 09a1c556..3a594643 100644 --- a/source/gui/widgets/skeletons/text_editor.cpp +++ b/source/gui/widgets/skeletons/text_editor.cpp @@ -1312,7 +1312,7 @@ namespace nana{ namespace widgets void text_editor::set_highlight(const std::string& name, const ::nana::color& fgcolor, const ::nana::color& bgcolor) { - if (fgcolor.invisible() && fgcolor.invisible()) + if (fgcolor.invisible() && bgcolor.invisible()) { keywords_->schemes.erase(name); return; @@ -3259,7 +3259,7 @@ namespace nana{ namespace widgets else if (pos <= a.x && a.x < str_end) { //Partial selected int endpos = static_cast(b.x < str_end ? b.x : str_end); - std::unique_ptr pxbuf_ptr(new unsigned[len]); + std::unique_ptr pxbuf_ptr(new unsigned[len]); unsigned * pxbuf = pxbuf_ptr.get(); if (graph_.glyph_pixels(ent.begin, len, pxbuf)) {