From b274d18aec525621bcb0a2234fc65e09398616c2 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Tue, 28 Jul 2020 16:32:30 +0200 Subject: Cleanup: correct usage of extern-C blocks in various places This removes extern-C blocks around other includes and adds such blocks for some headers that need them. --- tests/gtests/alembic/abc_export_test.cc | 2 -- tests/gtests/alembic/abc_matrix_test.cc | 2 -- tests/gtests/blenlib/BLI_array_store_test.cc | 2 -- tests/gtests/blenlib/BLI_array_utils_test.cc | 2 -- tests/gtests/blenlib/BLI_delaunay_2d_test.cc | 2 -- tests/gtests/blenlib/BLI_expr_pylike_eval_test.cc | 2 -- tests/gtests/blenlib/BLI_ghash_performance_test.cc | 2 -- tests/gtests/blenlib/BLI_ghash_test.cc | 2 -- tests/gtests/blenlib/BLI_hash_mm2a_test.cc | 2 -- tests/gtests/blenlib/BLI_heap_simple_test.cc | 2 -- tests/gtests/blenlib/BLI_heap_test.cc | 2 -- tests/gtests/blenlib/BLI_kdopbvh_test.cc | 2 -- tests/gtests/blenlib/BLI_listbase_test.cc | 2 -- tests/gtests/blenlib/BLI_memiter_test.cc | 2 -- tests/gtests/blenlib/BLI_path_util_test.cc | 2 -- tests/gtests/blenlib/BLI_polyfill_2d_test.cc | 2 -- tests/gtests/blenlib/BLI_stack_test.cc | 2 -- tests/gtests/blenlib/BLI_string_test.cc | 2 -- tests/gtests/blenlib/BLI_string_utf8_test.cc | 2 -- tests/gtests/blenlib/BLI_task_performance_test.cc | 2 -- tests/gtests/blenlib/BLI_task_test.cc | 2 -- tests/gtests/blenloader/blendfile_loading_base_test.cc | 2 -- tests/gtests/guardedalloc/guardedalloc_alignment_test.cc | 2 -- 23 files changed, 46 deletions(-) (limited to 'tests') diff --git a/tests/gtests/alembic/abc_export_test.cc b/tests/gtests/alembic/abc_export_test.cc index cdc98178550..5c2b505958e 100644 --- a/tests/gtests/alembic/abc_export_test.cc +++ b/tests/gtests/alembic/abc_export_test.cc @@ -4,13 +4,11 @@ #include "exporter/abc_archive.h" #include "intern/abc_util.h" -extern "C" { #include "BKE_main.h" #include "BLI_fileops.h" #include "BLI_math.h" #include "BLI_utildefines.h" #include "DNA_scene_types.h" -} #include "DEG_depsgraph.h" diff --git a/tests/gtests/alembic/abc_matrix_test.cc b/tests/gtests/alembic/abc_matrix_test.cc index fe0635ea7ab..b58e989b1a1 100644 --- a/tests/gtests/alembic/abc_matrix_test.cc +++ b/tests/gtests/alembic/abc_matrix_test.cc @@ -3,10 +3,8 @@ // Keep first since utildefines defines AT which conflicts with STL #include "intern/abc_axis_conversion.h" -extern "C" { #include "BLI_math.h" #include "BLI_utildefines.h" -} namespace blender { namespace io { diff --git a/tests/gtests/blenlib/BLI_array_store_test.cc b/tests/gtests/blenlib/BLI_array_store_test.cc index 5e8548911a2..a1ec8ec7bb3 100644 --- a/tests/gtests/blenlib/BLI_array_store_test.cc +++ b/tests/gtests/blenlib/BLI_array_store_test.cc @@ -4,7 +4,6 @@ #include "MEM_guardedalloc.h" -extern "C" { #include "BLI_array_store.h" #include "BLI_array_utils.h" #include "BLI_listbase.h" @@ -13,7 +12,6 @@ extern "C" { #include "BLI_string.h" #include "BLI_sys_types.h" #include "BLI_utildefines.h" -} /* print memory savings */ // #define DEBUG_PRINT diff --git a/tests/gtests/blenlib/BLI_array_utils_test.cc b/tests/gtests/blenlib/BLI_array_utils_test.cc index d6da9787768..33b4cd35d52 100644 --- a/tests/gtests/blenlib/BLI_array_utils_test.cc +++ b/tests/gtests/blenlib/BLI_array_utils_test.cc @@ -2,11 +2,9 @@ #include "testing/testing.h" -extern "C" { #include "BLI_array_utils.h" #include "BLI_utildefines.h" #include "BLI_utildefines_stack.h" -} /* -------------------------------------------------------------------- */ /* tests */ diff --git a/tests/gtests/blenlib/BLI_delaunay_2d_test.cc b/tests/gtests/blenlib/BLI_delaunay_2d_test.cc index 6065ccc4e57..8d62b111e12 100644 --- a/tests/gtests/blenlib/BLI_delaunay_2d_test.cc +++ b/tests/gtests/blenlib/BLI_delaunay_2d_test.cc @@ -4,13 +4,11 @@ #include "MEM_guardedalloc.h" -extern "C" { #include "BLI_math.h" #include "BLI_rand.h" #include "PIL_time.h" #include "BLI_delaunay_2d.h" -} #include #include diff --git a/tests/gtests/blenlib/BLI_expr_pylike_eval_test.cc b/tests/gtests/blenlib/BLI_expr_pylike_eval_test.cc index 1b17e6d839e..aad21ae4ad4 100644 --- a/tests/gtests/blenlib/BLI_expr_pylike_eval_test.cc +++ b/tests/gtests/blenlib/BLI_expr_pylike_eval_test.cc @@ -4,10 +4,8 @@ #include -extern "C" { #include "BLI_expr_pylike_eval.h" #include "BLI_math.h" -}; #define TRUE_VAL 1.0 #define FALSE_VAL 0.0 diff --git a/tests/gtests/blenlib/BLI_ghash_performance_test.cc b/tests/gtests/blenlib/BLI_ghash_performance_test.cc index 201598869e8..afabbcaae80 100644 --- a/tests/gtests/blenlib/BLI_ghash_performance_test.cc +++ b/tests/gtests/blenlib/BLI_ghash_performance_test.cc @@ -7,13 +7,11 @@ #include "MEM_guardedalloc.h" -extern "C" { #include "BLI_ghash.h" #include "BLI_rand.h" #include "BLI_string.h" #include "BLI_utildefines.h" #include "PIL_time_utildefines.h" -} /* Using http://corpora.uni-leipzig.de/downloads/eng_wikipedia_2010_1M-text.tar.gz * (1 million of words, about 122MB of text) from diff --git a/tests/gtests/blenlib/BLI_ghash_test.cc b/tests/gtests/blenlib/BLI_ghash_test.cc index a4b727e82aa..fcc0512cb9e 100644 --- a/tests/gtests/blenlib/BLI_ghash_test.cc +++ b/tests/gtests/blenlib/BLI_ghash_test.cc @@ -4,11 +4,9 @@ #define GHASH_INTERNAL_API -extern "C" { #include "BLI_ghash.h" #include "BLI_rand.h" #include "BLI_utildefines.h" -} #define TESTCASE_SIZE 10000 diff --git a/tests/gtests/blenlib/BLI_hash_mm2a_test.cc b/tests/gtests/blenlib/BLI_hash_mm2a_test.cc index 4f6570d93ad..c7bea8e15de 100644 --- a/tests/gtests/blenlib/BLI_hash_mm2a_test.cc +++ b/tests/gtests/blenlib/BLI_hash_mm2a_test.cc @@ -2,9 +2,7 @@ #include "testing/testing.h" -extern "C" { #include "BLI_hash_mm2a.h" -} /* Note: Reference results are taken from reference implementation * (cpp code, CMurmurHash2A variant): diff --git a/tests/gtests/blenlib/BLI_heap_simple_test.cc b/tests/gtests/blenlib/BLI_heap_simple_test.cc index f4d614def9e..e717a6e2653 100644 --- a/tests/gtests/blenlib/BLI_heap_simple_test.cc +++ b/tests/gtests/blenlib/BLI_heap_simple_test.cc @@ -5,13 +5,11 @@ #include "MEM_guardedalloc.h" -extern "C" { #include "BLI_compiler_attrs.h" #include "BLI_heap_simple.h" #include "BLI_rand.h" #include "BLI_sys_types.h" #include "BLI_utildefines.h" -}; #define SIZE 1024 diff --git a/tests/gtests/blenlib/BLI_heap_test.cc b/tests/gtests/blenlib/BLI_heap_test.cc index cda13e62bb8..87e68c175a2 100644 --- a/tests/gtests/blenlib/BLI_heap_test.cc +++ b/tests/gtests/blenlib/BLI_heap_test.cc @@ -5,12 +5,10 @@ #include "MEM_guardedalloc.h" -extern "C" { #include "BLI_compiler_attrs.h" #include "BLI_heap.h" #include "BLI_rand.h" #include "BLI_utildefines.h" -}; #define SIZE 1024 diff --git a/tests/gtests/blenlib/BLI_kdopbvh_test.cc b/tests/gtests/blenlib/BLI_kdopbvh_test.cc index 333f7ffbf44..f8a4fc1290a 100644 --- a/tests/gtests/blenlib/BLI_kdopbvh_test.cc +++ b/tests/gtests/blenlib/BLI_kdopbvh_test.cc @@ -6,12 +6,10 @@ #include "MEM_guardedalloc.h" -extern "C" { #include "BLI_compiler_attrs.h" #include "BLI_kdopbvh.h" #include "BLI_math_vector.h" #include "BLI_rand.h" -} #include "stubs/bf_intern_eigen_stubs.h" diff --git a/tests/gtests/blenlib/BLI_listbase_test.cc b/tests/gtests/blenlib/BLI_listbase_test.cc index 32dbd49c8fc..e5b504a0040 100644 --- a/tests/gtests/blenlib/BLI_listbase_test.cc +++ b/tests/gtests/blenlib/BLI_listbase_test.cc @@ -4,13 +4,11 @@ #include "MEM_guardedalloc.h" -extern "C" { #include "BLI_array_utils.h" #include "BLI_listbase.h" #include "BLI_path_util.h" #include "BLI_ressource_strings.h" #include "BLI_string.h" -} /* local validation function */ static bool listbase_is_valid(const ListBase *listbase) diff --git a/tests/gtests/blenlib/BLI_memiter_test.cc b/tests/gtests/blenlib/BLI_memiter_test.cc index 05602dcc1c8..3cc86630005 100644 --- a/tests/gtests/blenlib/BLI_memiter_test.cc +++ b/tests/gtests/blenlib/BLI_memiter_test.cc @@ -4,13 +4,11 @@ #include "MEM_guardedalloc.h" -extern "C" { #include "BLI_array_utils.h" #include "BLI_memiter.h" #include "BLI_ressource_strings.h" #include "BLI_string.h" -} TEST(memiter, Nop) { diff --git a/tests/gtests/blenlib/BLI_path_util_test.cc b/tests/gtests/blenlib/BLI_path_util_test.cc index 734bbc2b31e..c9e6f3357ff 100644 --- a/tests/gtests/blenlib/BLI_path_util_test.cc +++ b/tests/gtests/blenlib/BLI_path_util_test.cc @@ -2,7 +2,6 @@ #include "testing/testing.h" -extern "C" { #include "../../../source/blender/imbuf/IMB_imbuf.h" #include "BLI_fileops.h" #include "BLI_path_util.h" @@ -11,7 +10,6 @@ extern "C" { #ifdef _WIN32 # include "../../../source/blender/blenkernel/BKE_global.h" #endif -} /* -------------------------------------------------------------------- */ /* stubs */ diff --git a/tests/gtests/blenlib/BLI_polyfill_2d_test.cc b/tests/gtests/blenlib/BLI_polyfill_2d_test.cc index 911137bb83b..527a23ac3a8 100644 --- a/tests/gtests/blenlib/BLI_polyfill_2d_test.cc +++ b/tests/gtests/blenlib/BLI_polyfill_2d_test.cc @@ -11,7 +11,6 @@ #include "MEM_guardedalloc.h" -extern "C" { #include "BLI_array_utils.h" #include "BLI_edgehash.h" #include "BLI_math.h" @@ -27,7 +26,6 @@ extern "C" { # include "BLI_memarena.h" # include "BLI_polyfill_2d_beautify.h" #endif -} #include "stubs/bf_intern_eigen_stubs.h" diff --git a/tests/gtests/blenlib/BLI_stack_test.cc b/tests/gtests/blenlib/BLI_stack_test.cc index 359e61c6f47..211916e3193 100644 --- a/tests/gtests/blenlib/BLI_stack_test.cc +++ b/tests/gtests/blenlib/BLI_stack_test.cc @@ -3,11 +3,9 @@ #include "testing/testing.h" #include -extern "C" { #include "BLI_array.h" #include "BLI_stack.h" #include "BLI_utildefines.h" -}; #define SIZE 1024 diff --git a/tests/gtests/blenlib/BLI_string_test.cc b/tests/gtests/blenlib/BLI_string_test.cc index aae0c12c8b2..0358a1611f2 100644 --- a/tests/gtests/blenlib/BLI_string_test.cc +++ b/tests/gtests/blenlib/BLI_string_test.cc @@ -9,12 +9,10 @@ #include #include -extern "C" { #include "BLI_string.h" #include "BLI_string_utf8.h" #include "BLI_string_utils.h" #include "BLI_utildefines.h" -} using std::initializer_list; using std::pair; diff --git a/tests/gtests/blenlib/BLI_string_utf8_test.cc b/tests/gtests/blenlib/BLI_string_utf8_test.cc index 3e2ade40019..c496f918dc0 100644 --- a/tests/gtests/blenlib/BLI_string_utf8_test.cc +++ b/tests/gtests/blenlib/BLI_string_utf8_test.cc @@ -2,11 +2,9 @@ #include "testing/testing.h" -extern "C" { #include "BLI_string.h" #include "BLI_string_utf8.h" #include "BLI_utildefines.h" -} /* Note that 'common' utf-8 variants of string functions (like copy, etc.) are tested in * BLI_string_test.cc However, tests below are specific utf-8 conformance ones, and since they eat diff --git a/tests/gtests/blenlib/BLI_task_performance_test.cc b/tests/gtests/blenlib/BLI_task_performance_test.cc index 06e832bdb5e..208f168b599 100644 --- a/tests/gtests/blenlib/BLI_task_performance_test.cc +++ b/tests/gtests/blenlib/BLI_task_performance_test.cc @@ -9,7 +9,6 @@ #include "MEM_guardedalloc.h" -extern "C" { #include "BLI_utildefines.h" #include "BLI_listbase.h" @@ -17,7 +16,6 @@ extern "C" { #include "BLI_task.h" #include "PIL_time.h" -} #define NUM_RUN_AVERAGED 100 diff --git a/tests/gtests/blenlib/BLI_task_test.cc b/tests/gtests/blenlib/BLI_task_test.cc index ed300b3f238..3abaf6a6c0b 100644 --- a/tests/gtests/blenlib/BLI_task_test.cc +++ b/tests/gtests/blenlib/BLI_task_test.cc @@ -7,13 +7,11 @@ #include "MEM_guardedalloc.h" -extern "C" { #include "BLI_utildefines.h" #include "BLI_listbase.h" #include "BLI_mempool.h" #include "BLI_task.h" -}; #define NUM_ITEMS 10000 diff --git a/tests/gtests/blenloader/blendfile_loading_base_test.cc b/tests/gtests/blenloader/blendfile_loading_base_test.cc index 1f3a312de5d..d74bab4b31c 100644 --- a/tests/gtests/blenloader/blendfile_loading_base_test.cc +++ b/tests/gtests/blenloader/blendfile_loading_base_test.cc @@ -19,7 +19,6 @@ #include "MEM_guardedalloc.h" -extern "C" { #include "BKE_appdir.h" #include "BKE_blender.h" #include "BKE_context.h" @@ -48,7 +47,6 @@ extern "C" { #include "WM_api.h" #include "wm.h" -} BlendfileLoadingBaseTest::~BlendfileLoadingBaseTest() { diff --git a/tests/gtests/guardedalloc/guardedalloc_alignment_test.cc b/tests/gtests/guardedalloc/guardedalloc_alignment_test.cc index 4866ac44e3c..4c676c6cc76 100644 --- a/tests/gtests/guardedalloc/guardedalloc_alignment_test.cc +++ b/tests/gtests/guardedalloc/guardedalloc_alignment_test.cc @@ -2,9 +2,7 @@ #include "testing/testing.h" -extern "C" { #include "BLI_utildefines.h" -} #include "MEM_guardedalloc.h" -- cgit v1.2.3