fix some compiler warnings and errors for GCC
This commit is contained in:
		
							parent
							
								
									b23cfc8888
								
							
						
					
					
						commit
						abe2f0687f
					
				| @ -331,6 +331,8 @@ namespace nana | |||||||
| 			impl_->set_icon(image_ico); | 			impl_->set_icon(image_ico); | ||||||
| 			impl_->icon = image_ico; | 			impl_->icon = image_ico; | ||||||
| 		} | 		} | ||||||
|  | #else | ||||||
|  | 		static_cast<void>(icon_file);	//eliminate unused parameter warning
 | ||||||
| #endif | #endif | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| @ -341,6 +343,8 @@ namespace nana | |||||||
| 		auto icon_handle = paint::image_accessor::icon(image_ico); | 		auto icon_handle = paint::image_accessor::icon(image_ico); | ||||||
| 		if (icon_handle) | 		if (icon_handle) | ||||||
| 			impl_->icons.emplace_back(static_cast<paint::image&&>(image_ico)); | 			impl_->icons.emplace_back(static_cast<paint::image&&>(image_ico)); | ||||||
|  | #else | ||||||
|  | 		static_cast<void>(icon_file);	//eliminate unused parameter warning
 | ||||||
| #endif | #endif | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -472,8 +472,6 @@ namespace nana | |||||||
| 		if (depth < 0 || start_pos >= div.length()) | 		if (depth < 0 || start_pos >= div.length()) | ||||||
| 			return{}; | 			return{}; | ||||||
| 
 | 
 | ||||||
| 		const char* p = div.c_str() + start_pos; |  | ||||||
| 
 |  | ||||||
| 		while (depth >= 0) | 		while (depth >= 0) | ||||||
| 		{ | 		{ | ||||||
| 			auto pos = div.find_last_of("<>", start_pos); | 			auto pos = div.find_last_of("<>", start_pos); | ||||||
|  | |||||||
| @ -57,7 +57,7 @@ typedef struct | |||||||
| class image_ico_ex | class image_ico_ex | ||||||
| 	: public basic_image_pixbuf | 	: public basic_image_pixbuf | ||||||
| { | { | ||||||
| 	bool _m_read_ico(const void* data, std::size_t size) | 	bool _m_read_ico(const void* data, std::size_t /*size*/) | ||||||
| 	{ | 	{ | ||||||
| 		auto width = 0; | 		auto width = 0; | ||||||
| 		auto height = 0; | 		auto height = 0; | ||||||
| @ -94,7 +94,7 @@ class image_ico_ex | |||||||
| 		cursor += offset; | 		cursor += offset; | ||||||
| 		auto icon = reinterpret_cast<ICONIMAGE*>(cursor); | 		auto icon = reinterpret_cast<ICONIMAGE*>(cursor); | ||||||
| 		auto realBitsCount = static_cast<int>(icon->icHeader.biBitCount); | 		auto realBitsCount = static_cast<int>(icon->icHeader.biBitCount); | ||||||
| 		auto hasAndMask = (realBitsCount < 32) && (height != icon->icHeader.biHeight); | 		auto hasAndMask = (realBitsCount < 32) && (height != static_cast<int>(icon->icHeader.biHeight)); | ||||||
| 		cursor += 40; | 		cursor += 40; | ||||||
| 		pixbuf_.open(width, height); | 		pixbuf_.open(width, height); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -363,8 +363,9 @@ namespace paint | |||||||
| 						if (!ptr && bytes > 40 /* sizeof(BITMAPINFOHEADER) */ && (40 == *reinterpret_cast<const uint32_t*>(data))) { | 						if (!ptr && bytes > 40 /* sizeof(BITMAPINFOHEADER) */ && (40 == *reinterpret_cast<const uint32_t*>(data))) { | ||||||
| 							ptr = std::make_shared<detail::image_ico>(true); | 							ptr = std::make_shared<detail::image_ico>(true); | ||||||
| 						} | 						} | ||||||
|  | 						else | ||||||
| #endif | #endif | ||||||
| 						else if (!ptr && bytes > 40 && (0x00010000 == *reinterpret_cast<const unsigned*>(data))) | 						if (!ptr && bytes > 40 && (0x00010000 == *reinterpret_cast<const unsigned*>(data))) | ||||||
| 							ptr = std::make_shared<detail::image_ico_ex>(); | 							ptr = std::make_shared<detail::image_ico_ex>(); | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jinhao
						Jinhao