From 4a4f4eafea50d69c90bcb9468be6afd3e1d0c434 Mon Sep 17 00:00:00 2001 From: tqfx Date: Wed, 13 Mar 2024 22:39:15 +0800 Subject: [PATCH] change c++ file suffix .cpp to .cc --- javascript/src/{a.cpp => a.cc} | 0 meson.build | 2 +- script/autogen | 19 +++++----- src/{version.cpp => version.cc} | 0 test/CMakeLists.txt | 62 ++++++++++++++++---------------- test/{a.cpp => a.cc} | 0 test/{avl.cpp => avl.cc} | 0 test/{buf.cpp => buf.cc} | 0 test/{complex.cpp => complex.cc} | 0 test/{crc.cpp => crc.cc} | 0 test/{hpf.cpp => hpf.cc} | 0 test/{list.cpp => list.cc} | 0 test/{lpf.cpp => lpf.cc} | 0 test/{math.cpp => math.cc} | 0 test/{mf.cpp => mf.cc} | 0 test/{notefreqs.cpp => notefreqs.cc} | 0 test/{operator.cpp => operator.cc} | 0 test/{pid.cpp => pid.cc} | 0 test/{pid_expert.cpp => pid_expert.cc} | 0 test/{pid_fuzzy.cpp => pid_fuzzy.cc} | 0 test/{pid_neuro.cpp => pid_neuro.cc} | 0 test/{poly.cpp => poly.cc} | 0 test/{que.cpp => que.cc} | 0 test/{rbt.cpp => rbt.cc} | 0 test/{slist.cpp => slist.cc} | 0 test/{str.cpp => str.cc} | 0 test/{test.cpp => test.cc} | 0 test/{tf.cpp => tf.cc} | 0 test/{trajbell.cpp => trajbell.cc} | 0 test/{trajpoly3.cpp => trajpoly3.cc} | 0 test/{trajpoly5.cpp => trajpoly5.cc} | 0 test/{trajpoly7.cpp => trajpoly7.cc} | 0 test/{trajtrap.cpp => trajtrap.cc} | 0 test/{utf.cpp => utf.cc} | 0 test/{vec.cpp => vec.cc} | 0 test/{version.cpp => version.cc} | 0 test/xmake.lua | 64 +++++++++++++++++----------------- xmake.lua | 4 +-- 38 files changed, 74 insertions(+), 77 deletions(-) rename javascript/src/{a.cpp => a.cc} (100%) rename src/{version.cpp => version.cc} (100%) rename test/{a.cpp => a.cc} (100%) rename test/{avl.cpp => avl.cc} (100%) rename test/{buf.cpp => buf.cc} (100%) rename test/{complex.cpp => complex.cc} (100%) rename test/{crc.cpp => crc.cc} (100%) rename test/{hpf.cpp => hpf.cc} (100%) rename test/{list.cpp => list.cc} (100%) rename test/{lpf.cpp => lpf.cc} (100%) rename test/{math.cpp => math.cc} (100%) rename test/{mf.cpp => mf.cc} (100%) rename test/{notefreqs.cpp => notefreqs.cc} (100%) rename test/{operator.cpp => operator.cc} (100%) rename test/{pid.cpp => pid.cc} (100%) rename test/{pid_expert.cpp => pid_expert.cc} (100%) rename test/{pid_fuzzy.cpp => pid_fuzzy.cc} (100%) rename test/{pid_neuro.cpp => pid_neuro.cc} (100%) rename test/{poly.cpp => poly.cc} (100%) rename test/{que.cpp => que.cc} (100%) rename test/{rbt.cpp => rbt.cc} (100%) rename test/{slist.cpp => slist.cc} (100%) rename test/{str.cpp => str.cc} (100%) rename test/{test.cpp => test.cc} (100%) rename test/{tf.cpp => tf.cc} (100%) rename test/{trajbell.cpp => trajbell.cc} (100%) rename test/{trajpoly3.cpp => trajpoly3.cc} (100%) rename test/{trajpoly5.cpp => trajpoly5.cc} (100%) rename test/{trajpoly7.cpp => trajpoly7.cc} (100%) rename test/{trajtrap.cpp => trajtrap.cc} (100%) rename test/{utf.cpp => utf.cc} (100%) rename test/{vec.cpp => vec.cc} (100%) rename test/{version.cpp => version.cc} (100%) diff --git a/javascript/src/a.cpp b/javascript/src/a.cc similarity index 100% rename from javascript/src/a.cpp rename to javascript/src/a.cc diff --git a/meson.build b/meson.build index 69ff8ed..9ccd92b 100644 --- a/meson.build +++ b/meson.build @@ -100,7 +100,7 @@ sources = [ 'src/utf.c', 'src/vec.c', 'src/version.c', - 'src/version.cpp', + 'src/version.cc', ] python = import('python').find_installation() diff --git a/script/autogen b/script/autogen index 808c67a..d4a20ff 100755 --- a/script/autogen +++ b/script/autogen @@ -7,19 +7,16 @@ cd .. cp -r src include/a build cd build -for i in $(find a -regex ".*\.\(h\|hpp\)") -do +for i in $(find a -regex ".*\.\(h\|hh\)"); do HEADERS="$HEADERS $i" done -for i in $(find src -regex ".*\.\(c\|h\)") -do +for i in $(find src -regex ".*\.\(c\|h\)"); do C_SOURCES="$C_SOURCES $i" done -for i in $(find src -regex ".*\.\(cpp\|hpp\)") -do - CPP_SOURCES="$CPP_SOURCES $i" +for i in $(find src -regex ".*\.\(cc\|hh\)"); do + CXX_SOURCES="$CXX_SOURCES $i" done echo "ACLOCAL_AMFLAGS = -I m4 @@ -27,10 +24,10 @@ lib_LTLIBRARIES = liba.la liba_la_CPPFLAGS = -std=c11 liba_la_LDFLAGS = -version-info 1:7:1 liba_la_SOURCES =$C_SOURCES autogen.sh -liba_la_LIBADD = \$(liba__la_OBJECTS) -noinst_LTLIBRARIES = liba+.la -liba__la_CPPFLAGS = -std=c++11 -liba__la_SOURCES =$CPP_SOURCES +liba_la_LIBADD = \$(liba_cc_la_OBJECTS) +noinst_LTLIBRARIES = liba.cc.la +liba_cc_la_CPPFLAGS = -std=c++11 +liba_cc_la_SOURCES =$CXX_SOURCES nobase_include_HEADERS =$HEADERS install-data-hook: \$(INSTALL_DATA) config.h \$(DESTDIR)\$(includedir)/a diff --git a/src/version.cpp b/src/version.cc similarity index 100% rename from src/version.cpp rename to src/version.cc diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c01e197..5da8361 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -148,45 +148,45 @@ if(LIBA_GNUPLOT AND GNUPLOT_FOUND) endfunction() endif() -building(a a.c a.cpp) +building(a a.c a.cc) unittest(a NAME a_for ARGS for 10) unittest(a NAME a_hash_bkdr ARGS hash_bkdr hash_bkdr) unittest(a NAME a_hash_sdbm ARGS hash_sdbm hash_sdbm) unittest(a) -building(avl avl.c avl.cpp) +building(avl avl.c avl.cc) unittest(avl) -building(buf buf.c buf.cpp) +building(buf buf.c buf.cc) unittest(buf) -building(complex complex.c complex.cpp) +building(complex complex.c complex.cc) unittest(complex ARGS -4,3 -2,1) -building(crc crc.c crc.cpp) +building(crc crc.c crc.cc) unittest(crc ARGS crc.c) -building(hpf hpf.c hpf.cpp) +building(hpf hpf.c hpf.cc) unittest(hpf) if(LIBA_GNUPLOT AND GNUPLOT_FOUND) unitplot(hpf 2.gp hpf.csv) endif() -building(list list.c list.cpp) +building(list list.c list.cc) unittest(list) -building(lpf lpf.c lpf.cpp) +building(lpf lpf.c lpf.cc) unittest(lpf) if(LIBA_GNUPLOT AND GNUPLOT_FOUND) unitplot(lpf 3.gp lpf.csv) endif() -building(math math.c math.cpp) +building(math math.c math.cc) unittest(math) -building(mf mf.c mf.cpp) +building(mf mf.c mf.cc) unittest(mf) if(LIBA_GNUPLOT AND GNUPLOT_FOUND) @@ -205,109 +205,109 @@ if(LIBA_GNUPLOT AND GNUPLOT_FOUND) unitplot(mf mf.gp mf_pi.csv -3 3 -2 -1 1 2) endif() -building(notefreqs notefreqs.c notefreqs.cpp) +building(notefreqs notefreqs.c notefreqs.cc) unittest(notefreqs) if(LIBA_GNUPLOT AND GNUPLOT_FOUND) unitplot(notefreqs notefreqs.gp notefreqs.csv) endif() -building(operator operator.c operator.cpp) +building(operator operator.c operator.cc) unittest(operator) -building(pid pid.c pid.cpp) +building(pid pid.c pid.cc) unittest(pid) if(LIBA_GNUPLOT AND GNUPLOT_FOUND) unitplot(pid 3.gp pid.csv) endif() -building(pid_expert pid_expert.c pid_expert.cpp) +building(pid_expert pid_expert.c pid_expert.cc) unittest(pid_expert) if(LIBA_GNUPLOT AND GNUPLOT_FOUND) unitplot(pid_expert 3.gp pid_expert.csv) endif() -building(pid_fuzzy pid_fuzzy.c pid_fuzzy.cpp) +building(pid_fuzzy pid_fuzzy.c pid_fuzzy.cc) unittest(pid_fuzzy) if(LIBA_GNUPLOT AND GNUPLOT_FOUND) unitplot(pid_fuzzy 3.gp pid_fuzzy.csv) endif() -building(pid_neuro pid_neuro.c pid_neuro.cpp) +building(pid_neuro pid_neuro.c pid_neuro.cc) unittest(pid_neuro) if(LIBA_GNUPLOT AND GNUPLOT_FOUND) unitplot(pid_neuro 3.gp pid_neuro.csv) endif() -building(poly poly.c poly.cpp) +building(poly poly.c poly.cc) unittest(poly) -building(que que.c que.cpp) +building(que que.c que.cc) unittest(que) -building(rbt rbt.c rbt.cpp) +building(rbt rbt.c rbt.cc) unittest(rbt) -building(slist slist.c slist.cpp) +building(slist slist.c slist.cc) unittest(slist) -building(str str.c str.cpp) +building(str str.c str.cc) unittest(str) -building(test test.c test.cpp) +building(test test.c test.cc) unittest(test) -building(tf tf.c tf.cpp) +building(tf tf.c tf.cc) unittest(tf) if(LIBA_GNUPLOT AND GNUPLOT_FOUND) unitplot(tf 2.gp tf.csv) endif() -building(trajbell trajbell.c trajbell.cpp) +building(trajbell trajbell.c trajbell.cc) unittest(trajbell ARGS trajbell.csv 3 2 3 0 10) if(LIBA_GNUPLOT AND GNUPLOT_FOUND) unitplot(trajbell traj4.gp trajbell.csv 3 2 3 0 10) endif() -building(trajpoly3 trajpoly3.c trajpoly3.cpp) +building(trajpoly3 trajpoly3.c trajpoly3.cc) unittest(trajpoly3 ARGS trajpoly3.csv 0 10 0 10) if(LIBA_GNUPLOT AND GNUPLOT_FOUND) unitplot(trajpoly3 traj3.gp trajpoly3.csv 0 10 0 10) endif() -building(trajpoly5 trajpoly5.c trajpoly5.cpp) +building(trajpoly5 trajpoly5.c trajpoly5.cc) unittest(trajpoly5 ARGS trajpoly5.csv 0 10 0 10) if(LIBA_GNUPLOT AND GNUPLOT_FOUND) unitplot(trajpoly5 traj3.gp trajpoly5.csv 0 10 0 10) endif() -building(trajpoly7 trajpoly7.c trajpoly7.cpp) +building(trajpoly7 trajpoly7.c trajpoly7.cc) unittest(trajpoly7 ARGS trajpoly7.csv 0 10 0 10) if(LIBA_GNUPLOT AND GNUPLOT_FOUND) unitplot(trajpoly7 traj4.gp trajpoly7.csv 0 10 0 10) endif() -building(trajtrap trajtrap.c trajtrap.cpp) +building(trajtrap trajtrap.c trajtrap.cc) unittest(trajtrap ARGS trajtrap.csv 2 2 -2 0 4) if(LIBA_GNUPLOT AND GNUPLOT_FOUND) unitplot(trajtrap traj3.gp trajtrap.csv 2 2 -2 0 4) endif() -building(utf utf.c utf.cpp) +building(utf utf.c utf.cc) unittest(utf) -building(vec vec.c vec.cpp) +building(vec vec.c vec.cc) unittest(vec) -building(version version.c version.cpp) +building(version version.c version.cc) unittest(version) diff --git a/test/a.cpp b/test/a.cc similarity index 100% rename from test/a.cpp rename to test/a.cc diff --git a/test/avl.cpp b/test/avl.cc similarity index 100% rename from test/avl.cpp rename to test/avl.cc diff --git a/test/buf.cpp b/test/buf.cc similarity index 100% rename from test/buf.cpp rename to test/buf.cc diff --git a/test/complex.cpp b/test/complex.cc similarity index 100% rename from test/complex.cpp rename to test/complex.cc diff --git a/test/crc.cpp b/test/crc.cc similarity index 100% rename from test/crc.cpp rename to test/crc.cc diff --git a/test/hpf.cpp b/test/hpf.cc similarity index 100% rename from test/hpf.cpp rename to test/hpf.cc diff --git a/test/list.cpp b/test/list.cc similarity index 100% rename from test/list.cpp rename to test/list.cc diff --git a/test/lpf.cpp b/test/lpf.cc similarity index 100% rename from test/lpf.cpp rename to test/lpf.cc diff --git a/test/math.cpp b/test/math.cc similarity index 100% rename from test/math.cpp rename to test/math.cc diff --git a/test/mf.cpp b/test/mf.cc similarity index 100% rename from test/mf.cpp rename to test/mf.cc diff --git a/test/notefreqs.cpp b/test/notefreqs.cc similarity index 100% rename from test/notefreqs.cpp rename to test/notefreqs.cc diff --git a/test/operator.cpp b/test/operator.cc similarity index 100% rename from test/operator.cpp rename to test/operator.cc diff --git a/test/pid.cpp b/test/pid.cc similarity index 100% rename from test/pid.cpp rename to test/pid.cc diff --git a/test/pid_expert.cpp b/test/pid_expert.cc similarity index 100% rename from test/pid_expert.cpp rename to test/pid_expert.cc diff --git a/test/pid_fuzzy.cpp b/test/pid_fuzzy.cc similarity index 100% rename from test/pid_fuzzy.cpp rename to test/pid_fuzzy.cc diff --git a/test/pid_neuro.cpp b/test/pid_neuro.cc similarity index 100% rename from test/pid_neuro.cpp rename to test/pid_neuro.cc diff --git a/test/poly.cpp b/test/poly.cc similarity index 100% rename from test/poly.cpp rename to test/poly.cc diff --git a/test/que.cpp b/test/que.cc similarity index 100% rename from test/que.cpp rename to test/que.cc diff --git a/test/rbt.cpp b/test/rbt.cc similarity index 100% rename from test/rbt.cpp rename to test/rbt.cc diff --git a/test/slist.cpp b/test/slist.cc similarity index 100% rename from test/slist.cpp rename to test/slist.cc diff --git a/test/str.cpp b/test/str.cc similarity index 100% rename from test/str.cpp rename to test/str.cc diff --git a/test/test.cpp b/test/test.cc similarity index 100% rename from test/test.cpp rename to test/test.cc diff --git a/test/tf.cpp b/test/tf.cc similarity index 100% rename from test/tf.cpp rename to test/tf.cc diff --git a/test/trajbell.cpp b/test/trajbell.cc similarity index 100% rename from test/trajbell.cpp rename to test/trajbell.cc diff --git a/test/trajpoly3.cpp b/test/trajpoly3.cc similarity index 100% rename from test/trajpoly3.cpp rename to test/trajpoly3.cc diff --git a/test/trajpoly5.cpp b/test/trajpoly5.cc similarity index 100% rename from test/trajpoly5.cpp rename to test/trajpoly5.cc diff --git a/test/trajpoly7.cpp b/test/trajpoly7.cc similarity index 100% rename from test/trajpoly7.cpp rename to test/trajpoly7.cc diff --git a/test/trajtrap.cpp b/test/trajtrap.cc similarity index 100% rename from test/trajtrap.cpp rename to test/trajtrap.cc diff --git a/test/utf.cpp b/test/utf.cc similarity index 100% rename from test/utf.cpp rename to test/utf.cc diff --git a/test/vec.cpp b/test/vec.cc similarity index 100% rename from test/vec.cpp rename to test/vec.cc diff --git a/test/version.cpp b/test/version.cc similarity index 100% rename from test/version.cpp rename to test/version.cc diff --git a/test/xmake.lua b/test/xmake.lua index 7624637..e87ddeb 100644 --- a/test/xmake.lua +++ b/test/xmake.lua @@ -10,132 +10,132 @@ function building(sources) if has_config("liba-cxx") then add_defines("HAS_CXX") else - del_files("*.cpp") + del_files("*.cc") end add_deps("a") add_tests("") end target("test/a") -building({ "a.c", "a.cpp" }) +building({ "a.c", "a.cc" }) target_end() target("test/avl") -building({ "avl.c", "avl.cpp" }) +building({ "avl.c", "avl.cc" }) target_end() target("test/buf") -building({ "buf.c", "buf.cpp" }) +building({ "buf.c", "buf.cc" }) target_end() target("test/complex") -building({ "complex.c", "complex.cpp" }) +building({ "complex.c", "complex.cc" }) target_end() target("test/crc") -building({ "crc.c", "crc.cpp" }) +building({ "crc.c", "crc.cc" }) target_end() target("test/hpf") -building({ "hpf.c", "hpf.cpp" }) +building({ "hpf.c", "hpf.cc" }) target_end() target("test/list") -building({ "list.c", "list.cpp" }) +building({ "list.c", "list.cc" }) target_end() target("test/lpf") -building({ "lpf.c", "lpf.cpp" }) +building({ "lpf.c", "lpf.cc" }) target_end() target("test/math") -building({ "math.c", "math.cpp" }) +building({ "math.c", "math.cc" }) target_end() target("test/mf") -building({ "mf.c", "mf.cpp" }) +building({ "mf.c", "mf.cc" }) target_end() target("test/notefreqs") -building({ "notefreqs.c", "notefreqs.cpp" }) +building({ "notefreqs.c", "notefreqs.cc" }) target_end() target("test/operator") -building({ "operator.c", "operator.cpp" }) +building({ "operator.c", "operator.cc" }) target_end() target("test/pid") -building({ "pid.c", "pid.cpp" }) +building({ "pid.c", "pid.cc" }) target_end() target("test/pid_expert") -building({ "pid_expert.c", "pid_expert.cpp" }) +building({ "pid_expert.c", "pid_expert.cc" }) target_end() target("test/pid_fuzzy") -building({ "pid_fuzzy.c", "pid_fuzzy.cpp" }) +building({ "pid_fuzzy.c", "pid_fuzzy.cc" }) target_end() target("test/pid_neuro") -building({ "pid_neuro.c", "pid_neuro.cpp" }) +building({ "pid_neuro.c", "pid_neuro.cc" }) target_end() target("test/poly") -building({ "poly.c", "poly.cpp" }) +building({ "poly.c", "poly.cc" }) target_end() target("test/que") -building({ "que.c", "que.cpp" }) +building({ "que.c", "que.cc" }) target_end() target("test/rbt") -building({ "rbt.c", "rbt.cpp" }) +building({ "rbt.c", "rbt.cc" }) target_end() target("test/slist") -building({ "slist.c", "slist.cpp" }) +building({ "slist.c", "slist.cc" }) target_end() target("test/str") -building({ "str.c", "str.cpp" }) +building({ "str.c", "str.cc" }) target_end() target("test/test") -building({ "test.c", "test.cpp" }) +building({ "test.c", "test.cc" }) target_end() target("test/tf") -building({ "tf.c", "tf.cpp" }) +building({ "tf.c", "tf.cc" }) target_end() target("test/trajbell") -building({ "trajbell.c", "trajbell.cpp" }) +building({ "trajbell.c", "trajbell.cc" }) target_end() target("test/trajpoly3") -building({ "trajpoly3.c", "trajpoly3.cpp" }) +building({ "trajpoly3.c", "trajpoly3.cc" }) target_end() target("test/trajpoly5") -building({ "trajpoly5.c", "trajpoly5.cpp" }) +building({ "trajpoly5.c", "trajpoly5.cc" }) target_end() target("test/trajpoly7") -building({ "trajpoly7.c", "trajpoly7.cpp" }) +building({ "trajpoly7.c", "trajpoly7.cc" }) target_end() target("test/trajtrap") -building({ "trajtrap.c", "trajtrap.cpp" }) +building({ "trajtrap.c", "trajtrap.cc" }) target_end() target("test/utf") -building({ "utf.c", "utf.cpp" }) +building({ "utf.c", "utf.cc" }) target_end() target("test/vec") -building({ "vec.c", "vec.cpp" }) +building({ "vec.c", "vec.cc" }) target_end() target("test/version") -building({ "version.c", "version.cpp" }) +building({ "version.c", "version.cc" }) target_end() diff --git a/xmake.lua b/xmake.lua index b7340dd..579c632 100644 --- a/xmake.lua +++ b/xmake.lua @@ -127,8 +127,8 @@ add_includedirs("include", { public = true }) add_defines("A_EXPORTS") -- add the common source files add_files("src/**.c") -if not table.empty(os.files("src/**.cpp")) and has_config("liba-cxx") then - add_files("src/**.cpp") +if not table.empty(os.files("src/**.cc")) and has_config("liba-cxx") then + add_files("src/**.cc") end -- add the platform options rpath = get_config("liba-rpath") -- 2.11.4.GIT