8
0
Files
nodejs-electron/half_float-Wstrict-aliasing.patch
Bruno Pitrus d43d7ad921 Accepting request 1031228 from home:dziobian:gulgul-ultron:19
- Enable LTO on x64 (Tumbleweed and Fedora only) now that it works correctly.
  * add seccomp_pbf-no-lto.patch
- Do not build some chromium features unused in Electron.
- Remove upstream's tinkering with optimization flags.
  * change chromium-102-compiler.patch
- Remove upstream's warning suppression
  * change chromium-102-compiler.patch
  * add -Wno-class-memaccess due to log spam
  * add -Wno-error=narrowing due to non-compliant generated code
- Add -DIS_SERIAL_ENABLED_PLATFORM to work around upstream C++ ODR error.
- Build main binary as PIE instead of PIC.
  * change chromium-102-compiler.patch
  * add fpic.patch
- Compile with gcc11 (was 10) on Leap now that it's available.
- Add backported patches
  * compact_enc_det_generated_tables-Wnarrowing.patch
  * half_float-Wstrict-aliasing.patch
  * ipcz-buffer_id-Wnarrowing.patch
  * select_file_dialog_linux_kde-Wodr.patch
  * string_hasher-type-pun-UB-causes-heap-corruption.patch
  * unzip-Wsubobject-linkage.patch
  * web_contents_impl-Wsubobject-linkage.patch
- Add patches to fix C++ bugs and submit them upstream
  * swiftshader-Constants-Wstrict-aliasing.patch
  * swiftshader-Half-Wstrict-aliasing.patch
  * v8_initializer-PageAllocator-fpermissive.patch

OBS-URL: https://build.opensuse.org/request/show/1031228
OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=42
2022-10-26 04:51:48 +00:00

23 lines
726 B
Diff

--- src/ui/gfx/half_float.cc.orig 2022-10-12 18:06:39.635381500 +0200
+++ src/ui/gfx/half_float.cc 2022-10-19 21:43:26.484063300 +0200
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <cstring>
+
#include "ui/gfx/half_float.h"
namespace gfx {
@@ -9,7 +11,9 @@
void FloatToHalfFloat(const float* input, HalfFloat* output, size_t num) {
for (size_t i = 0; i < num; i++) {
float tmp = input[i] * 1.9259299444e-34f;
- uint32_t tmp2 = *reinterpret_cast<uint32_t*>(&tmp) + (1 << 12);
+ uint32_t tmp2;
+ std::memcpy(&tmp2, &tmp, 4);
+ tmp2 += (1 << 12);
output[i] = (tmp2 & 0x80000000UL) >> 16 | (tmp2 >> 13);
}
}