From a14a7a0ccc9de76aeab0b2e4bbf58f1a79deedc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 3 Jul 2024 10:19:30 +0200 Subject: New upstream version 5.3.0GA --- app/dynstring/CMakeLists.txt | 18 ++++++++++++------ app/dynstring/dynstring.c | 7 ++----- app/dynstring/dynstring.h | 2 +- app/dynstring/unittest/CMakeLists.txt | 13 ++++++++++--- 4 files changed, 25 insertions(+), 15 deletions(-) (limited to 'app/dynstring') diff --git a/app/dynstring/CMakeLists.txt b/app/dynstring/CMakeLists.txt index b407805..01aa2b2 100644 --- a/app/dynstring/CMakeLists.txt +++ b/app/dynstring/CMakeLists.txt @@ -1,11 +1,17 @@ # compile the dynstring library -set( SOURCES - dynstring.c ) - add_library(dynstring - ${SOURCES}) + "") + +target_sources(dynstring + PRIVATE + dynstring.c + PUBLIC + dynstring.h +) if(XTRKCAD_TESTING) - add_subdirectory( unittest ) -endif(XTRKCAD_TESTING) \ No newline at end of file + add_subdirectory(unittest) +endif() + +target_include_directories(dynstring PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") \ No newline at end of file diff --git a/app/dynstring/dynstring.c b/app/dynstring/dynstring.c index fd50a0b..ab30f5f 100644 --- a/app/dynstring/dynstring.c +++ b/app/dynstring/dynstring.c @@ -2,9 +2,6 @@ * Library for dynamic string functions */ -#ifdef HAVE_MALLOC_H -#include -#endif #include #include #include @@ -240,7 +237,7 @@ void DynStringFree(DynString *s) /* Create a new string as a copy of an old one */ DynString *DynStringDupStr(DynString *s2, DynString *s) { - DynString nas = NaS; +// DynString nas = NaS; /* Not a string? */ if (isnas(s)) { @@ -445,7 +442,7 @@ void DynStringPrintf(DynString *s, const char *fmt, ...) { va_list v; size_t len; - DynString nas = NaS; +// DynString nas = NaS; /* Are we not a string? */ if (isnas(s)) { diff --git a/app/dynstring/dynstring.h b/app/dynstring/dynstring.h index 0a5b972..6a2eb76 100644 --- a/app/dynstring/dynstring.h +++ b/app/dynstring/dynstring.h @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef HAVE_DYNSTRING_H diff --git a/app/dynstring/unittest/CMakeLists.txt b/app/dynstring/unittest/CMakeLists.txt index 7aad7c1..53b18e1 100644 --- a/app/dynstring/unittest/CMakeLists.txt +++ b/app/dynstring/unittest/CMakeLists.txt @@ -2,7 +2,14 @@ add_executable(dynstringtest DynStringTest.c) target_link_libraries(dynstringtest - dynstring - ${LIBS}) + PRIVATE + dynstring + ${CMOCKA_LIBRARIES} +) -add_test(DynStringTest dynstringtest) \ No newline at end of file +add_test(DynStringTest dynstringtest) + +set_target_properties( + dynstringtest + PROPERTIES FOLDER UnitTests + ) \ No newline at end of file -- cgit v1.2.3