From e45b50befc3d713009065f68f73168eb965c1767 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Sat, 25 May 2024 15:09:44 +0200 Subject: [PATCH] try switching inserts before end for windows --- src/chat_gui/send_image_popup.cpp | 2 +- src/image_loader_qoi.cpp | 2 +- src/image_loader_sdl_bmp.cpp | 2 +- src/image_loader_sdl_image.cpp | 2 +- src/image_loader_stb.cpp | 4 ++-- src/image_loader_webp.cpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/chat_gui/send_image_popup.cpp b/src/chat_gui/send_image_popup.cpp index 555cba14..ced59079 100644 --- a/src/chat_gui/send_image_popup.cpp +++ b/src/chat_gui/send_image_popup.cpp @@ -152,7 +152,7 @@ void SendImagePopup::sendMemory( // copy paste data to memory original_data.clear(); - original_data.insert(original_data.begin(), data, data+data_size); + original_data.insert(original_data.cend(), data, data+data_size); if (!load()) { std::cerr << "SIP: failed to load image from memory\n"; diff --git a/src/image_loader_qoi.cpp b/src/image_loader_qoi.cpp index bed0fd63..098a3d81 100644 --- a/src/image_loader_qoi.cpp +++ b/src/image_loader_qoi.cpp @@ -41,7 +41,7 @@ ImageLoaderQOI::ImageResult ImageLoaderQOI::loadFromMemoryRGBA(const uint8_t* da auto& new_frame = res.frames.emplace_back(); new_frame.ms = 0; - new_frame.data.insert(new_frame.data.cbegin(), img_data, img_data+(desc.width*desc.height*4)); + new_frame.data.insert(new_frame.data.cend(), img_data, img_data+(desc.width*desc.height*4)); free(img_data); return res; diff --git a/src/image_loader_sdl_bmp.cpp b/src/image_loader_sdl_bmp.cpp index f9f9e56c..4845fc5a 100644 --- a/src/image_loader_sdl_bmp.cpp +++ b/src/image_loader_sdl_bmp.cpp @@ -47,7 +47,7 @@ ImageLoaderSDLBMP::ImageResult ImageLoaderSDLBMP::loadFromMemoryRGBA(const uint8 auto& new_frame = res.frames.emplace_back(); new_frame.ms = 0; - new_frame.data.insert(new_frame.data.cbegin(), (const uint8_t*)conv_surf->pixels, ((const uint8_t*)conv_surf->pixels) + (surf->w*surf->h*4)); + new_frame.data.insert(new_frame.data.cend(), (const uint8_t*)conv_surf->pixels, ((const uint8_t*)conv_surf->pixels) + (surf->w*surf->h*4)); SDL_UnlockSurface(conv_surf); SDL_DestroySurface(conv_surf); diff --git a/src/image_loader_sdl_image.cpp b/src/image_loader_sdl_image.cpp index a1a06d35..a65c7f24 100644 --- a/src/image_loader_sdl_image.cpp +++ b/src/image_loader_sdl_image.cpp @@ -99,7 +99,7 @@ ImageLoaderSDLImage::ImageResult ImageLoaderSDLImage::loadFromMemoryRGBA(const u auto& new_frame = res.frames.emplace_back(); new_frame.ms = anim->delays[i]; - new_frame.data.insert(new_frame.data.cbegin(), (const uint8_t*)conv_surf->pixels, ((const uint8_t*)conv_surf->pixels) + (anim->w*anim->h*4)); + new_frame.data.insert(new_frame.data.cend(), (const uint8_t*)conv_surf->pixels, ((const uint8_t*)conv_surf->pixels) + (anim->w*anim->h*4)); SDL_UnlockSurface(conv_surf); SDL_DestroySurface(conv_surf); diff --git a/src/image_loader_stb.cpp b/src/image_loader_stb.cpp index d983f636..a944595c 100644 --- a/src/image_loader_stb.cpp +++ b/src/image_loader_stb.cpp @@ -41,7 +41,7 @@ ImageLoaderSTB::ImageResult ImageLoaderSTB::loadFromMemoryRGBA(const uint8_t* da for (int i = 0; i < z; i++) { auto& new_frame = res.frames.emplace_back(); new_frame.ms = delays[i]; - new_frame.data.insert(new_frame.data.cbegin(), img_data + (i*stride), img_data + ((i+1)*stride)); + new_frame.data.insert(new_frame.data.cend(), img_data + (i*stride), img_data + ((i+1)*stride)); } stbi_image_free(delays); // hope this is right @@ -62,7 +62,7 @@ ImageLoaderSTB::ImageResult ImageLoaderSTB::loadFromMemoryRGBA(const uint8_t* da auto& new_frame = res.frames.emplace_back(); new_frame.ms = 0; - new_frame.data.insert(new_frame.data.cbegin(), img_data, img_data+(x*y*4)); + new_frame.data.insert(new_frame.data.cend(), img_data, img_data+(x*y*4)); stbi_image_free(img_data); return res; diff --git a/src/image_loader_webp.cpp b/src/image_loader_webp.cpp index 01cd9fb4..eb775030 100644 --- a/src/image_loader_webp.cpp +++ b/src/image_loader_webp.cpp @@ -78,7 +78,7 @@ ImageLoaderWebP::ImageResult ImageLoaderWebP::loadFromMemoryRGBA(const uint8_t* auto& new_frame = res.frames.emplace_back(); new_frame.ms = timestamp-prev_timestamp; prev_timestamp = timestamp; - new_frame.data.insert(new_frame.data.end(), buf, buf+(res.width*res.height*4)); + new_frame.data.insert(new_frame.data.cend(), buf, buf+(res.width*res.height*4)); } assert(anim_info.frame_count == res.frames.size());