Fix FFTW build-tree header wiring and two MSVC warnings

FFTW exposes fftw3.h only via $<INSTALL_INTERFACE:include>, so consuming
fftw3f from the build tree (FetchContent) leaves FFTIndexerCPU.h unable to
find the header. A system-installed fftw3.h masks this on Linux, so it only
bit on Windows; add the source-tree api/ dir to fftw3f's interface includes.

Also two viewer-reachable warnings:
- time_utc.h (C4477): %03ld was fed a chrono milliseconds::rep (64-bit), not
  a long; cast the 0-999 value to int and use %03d.
- HDF5Objects.h (C4700): value-initialize the scalar read buffer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-20 07:15:47 +02:00
co-authored by Claude Opus 4.8
parent b888c53509
commit 4a39f2cfcf
3 changed files with 6 additions and 2 deletions
+4
View File
@@ -207,6 +207,10 @@ FetchContent_Declare(fftw
URL_HASH SHA256=56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467
EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(fftw)
# FFTW exposes fftw3.h only via $<INSTALL_INTERFACE:include>, so consuming fftw3f straight from
# the build tree (FetchContent) leaves the header unreachable. On Linux a system-installed
# fftw3.h masks this; on Windows it does not. Add the source-tree api/ dir for build-tree use.
TARGET_INCLUDE_DIRECTORIES(fftw3f INTERFACE $<BUILD_INTERFACE:${fftw_SOURCE_DIR}/api>)
ADD_COMPILE_DEFINITIONS(JFJOCH_USE_FFTW)
IF (JFJOCH_VIEWER_ONLY)
+1 -1
View File
@@ -27,7 +27,7 @@ inline std::string time_UTC(const std::chrono::time_point<std::chrono::system_cl
throw std::runtime_error("gmtime failed");
strftime(buf1, sizeof(buf1), "%FT%T", &tm_utc);
snprintf(buf2, sizeof(buf2), ".%03ld", time_ms % 1000);
snprintf(buf2, sizeof(buf2), ".%03d", static_cast<int>(time_ms % 1000));
return std::string(buf1) + std::string(buf2) + "Z";
}
+1 -1
View File
@@ -264,7 +264,7 @@ public:
if (file_space.GetNumOfDimensions() != 0)
throw JFJochException(JFJochExceptionCategory::HDF5, "Dataset tries to read scalar from vector dataset");;
T output;
T output{};
if (H5Dread(id, HDF5DataType(output).GetID(), mem_space.GetID(), H5S_ALL, H5P_DEFAULT, &output) < 0)
throw JFJochException(JFJochExceptionCategory::HDF5, dataset_name + ": read unsuccessful");
return output;