From 239c55bd3c92bd0a52836daa5f31e18d28c21006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rgen=20Brandt?= Date: Tue, 31 Dec 2024 08:12:18 +0100 Subject: [PATCH 1/4] fix Python and cmake-related warnings in build process --- fst/CMakeLists.txt | 2 +- setup.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fst/CMakeLists.txt b/fst/CMakeLists.txt index 8942a14..10c5fd1 100644 --- a/fst/CMakeLists.txt +++ b/fst/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.0) +cmake_minimum_required (VERSION 3.10) project (fstlib) diff --git a/setup.py b/setup.py index da49ef5..1d84e22 100644 --- a/setup.py +++ b/setup.py @@ -5,6 +5,7 @@ import pathlib import sys +import shutil from setuptools import setup, find_packages from distutils import spawn import distutils.command.build as _build @@ -17,7 +18,7 @@ def libfstapi_cmake_build(package_name): class build(_build.build): def run(self): - if spawn.find_executable("cmake") is None: + if shutil.which("cmake") is None: sys.stderr.write("CMake is required to build this package.\n") sys.exit(-1) try: From b30f3795153f623557c9a6d72604d92625afcd4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rgen=20Brandt?= Date: Tue, 31 Dec 2024 11:44:54 +0100 Subject: [PATCH 2/4] fix fstVcdIDForFwrite by limiting id length to 14 --- fst/fstapi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fst/fstapi.c b/fst/fstapi.c index b19e0bc..f14b4e4 100644 --- a/fst/fstapi.c +++ b/fst/fstapi.c @@ -3902,16 +3902,18 @@ while (value) static int fstVcdIDForFwrite(char *buf, unsigned int value) { char *pnt = buf; +int len = 0; /* zero is illegal for a value...it is assumed they start at one */ -while (value) +while (value && len <= 14) { value--; + ++len; *(pnt++) = (char)('!' + value % 94); value = value / 94; } -return(pnt - buf); +return len; } From 248515ea089381f9a032894821a1d9a6855b05af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rgen=20Brandt?= Date: Tue, 7 Jan 2025 20:48:16 +0100 Subject: [PATCH 3/4] revert changes to libfst --- fst/CMakeLists.txt | 2 +- fst/fstapi.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fst/CMakeLists.txt b/fst/CMakeLists.txt index 10c5fd1..8942a14 100644 --- a/fst/CMakeLists.txt +++ b/fst/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.10) +cmake_minimum_required (VERSION 3.0) project (fstlib) diff --git a/fst/fstapi.c b/fst/fstapi.c index f14b4e4..112982e 100644 --- a/fst/fstapi.c +++ b/fst/fstapi.c @@ -3902,10 +3902,9 @@ while (value) static int fstVcdIDForFwrite(char *buf, unsigned int value) { char *pnt = buf; -int len = 0; /* zero is illegal for a value...it is assumed they start at one */ -while (value && len <= 14) +while (value) { value--; ++len; @@ -3913,7 +3912,7 @@ while (value && len <= 14) value = value / 94; } -return len; + return(pnt - buf); } From 25d41496b604f69b81581c7482384b1701dd760e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rgen=20Brandt?= Date: Tue, 7 Jan 2025 20:48:58 +0100 Subject: [PATCH 4/4] revert --- fst/fstapi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fst/fstapi.c b/fst/fstapi.c index 112982e..b19e0bc 100644 --- a/fst/fstapi.c +++ b/fst/fstapi.c @@ -3907,12 +3907,11 @@ char *pnt = buf; while (value) { value--; - ++len; *(pnt++) = (char)('!' + value % 94); value = value / 94; } - return(pnt - buf); +return(pnt - buf); }