diff --git a/package/libfreeimage/0004-fixed-C-11-warnings.patch b/package/libfreeimage/0004-fixed-C-11-warnings.patch index 449af621d0..cf9c47303a 100644 --- a/package/libfreeimage/0004-fixed-C-11-warnings.patch +++ b/package/libfreeimage/0004-fixed-C-11-warnings.patch @@ -8,50 +8,50 @@ Index: trunk/Source/FreeImage/CacheFile.cpp --- trunk/Source/FreeImage/CacheFile.cpp (révision 1895) +++ trunk/Source/FreeImage/CacheFile.cpp (révision 1896) @@ -147,10 +147,14 @@ - m_current_block->data = new BYTE[BLOCK_SIZE]; - - fseek(m_file, m_current_block->nr * BLOCK_SIZE, SEEK_SET); -- fread(m_current_block->data, BLOCK_SIZE, 1, m_file); -- -- m_page_cache_mem.splice(m_page_cache_mem.begin(), m_page_cache_disk, it->second); -- m_page_map[nr] = m_page_cache_mem.begin(); -+ if (fread(m_current_block->data, BLOCK_SIZE, 1, m_file) == 1) { -+ m_page_cache_mem.splice(m_page_cache_mem.begin(), m_page_cache_disk, it->second); -+ m_page_map[nr] = m_page_cache_mem.begin(); -+ } -+ else { -+ FreeImage_OutputMessageProc(FIF_UNKNOWN, "Failed to lock a block in CacheFile"); -+ return NULL; -+ } - } - - // if the memory cache size is too large, swap an item to disc + m_current_block->data = new BYTE[BLOCK_SIZE]; + + fseek(m_file, m_current_block->nr * BLOCK_SIZE, SEEK_SET); +- fread(m_current_block->data, BLOCK_SIZE, 1, m_file); +- +- m_page_cache_mem.splice(m_page_cache_mem.begin(), m_page_cache_disk, it->second); +- m_page_map[nr] = m_page_cache_mem.begin(); ++ if (fread(m_current_block->data, BLOCK_SIZE, 1, m_file) == 1) { ++ m_page_cache_mem.splice(m_page_cache_mem.begin(), m_page_cache_disk, it->second); ++ m_page_map[nr] = m_page_cache_mem.begin(); ++ } ++ else { ++ FreeImage_OutputMessageProc(FIF_UNKNOWN, "Failed to lock a block in CacheFile"); ++ return NULL; ++ } + } + + // if the memory cache size is too large, swap an item to disc Index: trunk/Source/FreeImage/MultiPage.cpp =================================================================== --- trunk/Source/FreeImage/MultiPage.cpp (révision 1895) +++ trunk/Source/FreeImage/MultiPage.cpp (révision 1896) @@ -271,8 +271,8 @@ - } - } - -- std::auto_ptr bitmap (new FIMULTIBITMAP); -- std::auto_ptr header (new MULTIBITMAPHEADER); -+ std::unique_ptr bitmap (new FIMULTIBITMAP); -+ std::unique_ptr header (new MULTIBITMAPHEADER); - header->m_filename = filename; - // io is default - header->node = node; + } + } + +- std::auto_ptr bitmap (new FIMULTIBITMAP); +- std::auto_ptr header (new MULTIBITMAPHEADER); ++ std::unique_ptr bitmap (new FIMULTIBITMAP); ++ std::unique_ptr header (new MULTIBITMAPHEADER); + header->m_filename = filename; + // io is default + header->node = node; @@ -339,8 +339,8 @@ - PluginNode *node = list->FindNodeFromFIF(fif); - - if (node) { -- std::auto_ptr bitmap (new FIMULTIBITMAP); -- std::auto_ptr header (new MULTIBITMAPHEADER); -+ std::unique_ptr bitmap (new FIMULTIBITMAP); -+ std::unique_ptr header (new MULTIBITMAPHEADER); - header->io = *io; - header->node = node; - header->fif = fif; + PluginNode *node = list->FindNodeFromFIF(fif); + + if (node) { +- std::auto_ptr bitmap (new FIMULTIBITMAP); +- std::auto_ptr header (new MULTIBITMAPHEADER); ++ std::unique_ptr bitmap (new FIMULTIBITMAP); ++ std::unique_ptr header (new MULTIBITMAPHEADER); + header->io = *io; + header->node = node; + header->fif = fif; Index: trunk/Source/FreeImage/PSDParser.cpp =================================================================== --- trunk/Source/FreeImage/PSDParser.cpp (révision 1895)