From 921c1304f4fa68a4deac1c592c2be7b7dd52c78b Mon Sep 17 00:00:00 2001 From: liyaoyao777 Date: Tue, 27 Aug 2024 11:36:20 +0800 Subject: [PATCH] Rectify namespace irregularities Signed-off-by: liyaoyao777 --- vibration_convert/core/native/test/unittest/data.h | 4 ++-- .../core/native/test/unittest/generate_json_test.cpp | 4 ++-- vibration_convert/core/utils/include/audio_utils.h | 8 ++++---- vibration_convert/core/utils/include/utils.h | 6 +++--- vibration_convert/core/utils/src/audio_utils.cpp | 6 +++--- vibration_convert/core/utils/src/utils.cpp | 6 +++--- .../interfaces/js/include/vibrator_convert_js.h | 4 ++-- .../interfaces/js/include/vibrator_convert_napi_utils.h | 4 ++-- .../interfaces/js/src/vibrator_convert_js.cpp | 6 +++--- .../interfaces/js/src/vibrator_convert_napi_utils.cpp | 6 +++--- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/vibration_convert/core/native/test/unittest/data.h b/vibration_convert/core/native/test/unittest/data.h index 40960a2f..e44b7c0a 100644 --- a/vibration_convert/core/native/test/unittest/data.h +++ b/vibration_convert/core/native/test/unittest/data.h @@ -38,6 +38,6 @@ std::vector AudioSrcDatas = { 0.00393714383244514, 0.0 }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // UT_TEST_DATA_H \ No newline at end of file diff --git a/vibration_convert/core/native/test/unittest/generate_json_test.cpp b/vibration_convert/core/native/test/unittest/generate_json_test.cpp index f0e430da..67bdca09 100644 --- a/vibration_convert/core/native/test/unittest/generate_json_test.cpp +++ b/vibration_convert/core/native/test/unittest/generate_json_test.cpp @@ -103,5 +103,5 @@ HWTEST_F(GenerateJsonFileTest, GenerateJsonFileTest_002, TestSize.Level1) int32_t ret = vibrationConvertCore.ConvertAudioToHaptic(audioSetting, data, vtEvents); EXPECT_EQ(ret, 0); } -} // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace Sensors +} // namespace OHOS \ No newline at end of file diff --git a/vibration_convert/core/utils/include/audio_utils.h b/vibration_convert/core/utils/include/audio_utils.h index 57e3f681..808cd821 100644 --- a/vibration_convert/core/utils/include/audio_utils.h +++ b/vibration_convert/core/utils/include/audio_utils.h @@ -34,7 +34,7 @@ namespace Sensors { namespace { constexpr double DB_TO_AMP_COEF { 0.05 }; constexpr double AMP_TO_DB_COEF { 20.0 }; -} // namespace +} // namespace /** *@brief Basic processing of audio, called by other modules. @@ -102,6 +102,6 @@ public: */ std::vector PadData(const std::vector &data, int32_t hopLength); }; -} // namespace Sensors -} // namespace OHOS -#endif \ No newline at end of file +} // namespace Sensors +} // namespace OHOS +#endif // AUDIO_UTILS_H \ No newline at end of file diff --git a/vibration_convert/core/utils/include/utils.h b/vibration_convert/core/utils/include/utils.h index 07689309..e51fa056 100644 --- a/vibration_convert/core/utils/include/utils.h +++ b/vibration_convert/core/utils/include/utils.h @@ -47,7 +47,7 @@ constexpr double F_THREE = 3.0; constexpr double SAMPLE_IN_MS = 1000.0; constexpr double INTERSITY_BOUNDARY_POINT = 0.25; constexpr double INTERSITY_NUMBER_BOUNDARY_POINT = 0.75; -} // namespace +} // namespace enum WindowType { WND_TYPE_BARTLETT = 1, @@ -205,6 +205,6 @@ inline double ConvertHtkHz(double mels) } return freqs; } -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // CONVERSION_UTILS_H \ No newline at end of file diff --git a/vibration_convert/core/utils/src/audio_utils.cpp b/vibration_convert/core/utils/src/audio_utils.cpp index 4445058a..890bed1f 100644 --- a/vibration_convert/core/utils/src/audio_utils.cpp +++ b/vibration_convert/core/utils/src/audio_utils.cpp @@ -39,7 +39,7 @@ constexpr double MTOF_ARRAY[MTOF_ARRAY_SIZE + 1] = { 3729.31, 3951.066406, 4186.009277, 4434.921875, 4698.63623, 4978.031738, 5274.041016, 5587.651855, 5919.910645, 6271.926758, 6644.875, 7040., 7458.620117, 7902.132812, 8372.018555, 8869.84375, 9397.272461, 9956.063477, 10548.082031, 11175.303711, 11839.821289, 12543.853516, 13289.75 }; -} // namespace +} // namespace double AudioUtils::ConvertMtof(int32_t midinote) { @@ -61,5 +61,5 @@ std::vector AudioUtils::PadData(const std::vector &data, int32_t paddingData.insert(paddingData.end(), hopLength / 2, 0); return paddingData; } -} // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace Sensors +} // namespace OHOS \ No newline at end of file diff --git a/vibration_convert/core/utils/src/utils.cpp b/vibration_convert/core/utils/src/utils.cpp index dded5ba1..12d09759 100644 --- a/vibration_convert/core/utils/src/utils.cpp +++ b/vibration_convert/core/utils/src/utils.cpp @@ -37,7 +37,7 @@ namespace{ constexpr double PERCENTAGE_RANGE = 100.0; constexpr int32_t VOICE_MIN_INTENSITY_NORM = 25; constexpr size_t MAX_SIZE = 26460000; -} // namespace +} // namespace bool IsPowerOfTwo(uint32_t x) { @@ -259,5 +259,5 @@ std::vector ObtainAmplitudeEnvelop(const std::vector &data, size } return enery; } -} // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace Sensors +} // namespace OHOS \ No newline at end of file diff --git a/vibration_convert/interfaces/js/include/vibrator_convert_js.h b/vibration_convert/interfaces/js/include/vibrator_convert_js.h index 5ee8b6ba..92f4429a 100644 --- a/vibration_convert/interfaces/js/include/vibrator_convert_js.h +++ b/vibration_convert/interfaces/js/include/vibrator_convert_js.h @@ -45,6 +45,6 @@ private: std::mutex mutex_; napi_ref contextRef_ { nullptr }; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // VIBRATOR_CONVERT_JS_H \ No newline at end of file diff --git a/vibration_convert/interfaces/js/include/vibrator_convert_napi_utils.h b/vibration_convert/interfaces/js/include/vibrator_convert_napi_utils.h index 81129bc8..a847c903 100644 --- a/vibration_convert/interfaces/js/include/vibrator_convert_napi_utils.h +++ b/vibration_convert/interfaces/js/include/vibrator_convert_napi_utils.h @@ -82,6 +82,6 @@ napi_value GetAudioToHapticInfo(sptr asyncCallbackInfo); void EmitHapticAsyncCallbackWork(sptr async_callback_info); void EmitHapticPromiseWork(sptr asyncCallbackInfo); int64_t GetFileSize(int32_t fd); -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // VIBRATOR_CONVERT_NAPI_UTILS_H \ No newline at end of file diff --git a/vibration_convert/interfaces/js/src/vibrator_convert_js.cpp b/vibration_convert/interfaces/js/src/vibrator_convert_js.cpp index 617dec03..8dc769a8 100644 --- a/vibration_convert/interfaces/js/src/vibrator_convert_js.cpp +++ b/vibration_convert/interfaces/js/src/vibrator_convert_js.cpp @@ -30,7 +30,7 @@ namespace Sensors { namespace { const char* CONVERT = "convert"; const char* CONVERT_CLASS = "convert_class"; -} // namespace +} // namespace std::shared_ptr VibratorConvert::GetInterfaces() { @@ -295,5 +295,5 @@ napi_value VibratorConvert::ConvertAudioToHaptic(napi_env env, napi_callback_inf EmitHapticPromiseWork(asyncCallbackInfo); return promise; } -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS diff --git a/vibration_convert/interfaces/js/src/vibrator_convert_napi_utils.cpp b/vibration_convert/interfaces/js/src/vibrator_convert_napi_utils.cpp index 3aa211ae..ad158a5c 100644 --- a/vibration_convert/interfaces/js/src/vibrator_convert_napi_utils.cpp +++ b/vibration_convert/interfaces/js/src/vibrator_convert_napi_utils.cpp @@ -33,7 +33,7 @@ namespace Sensors { namespace { constexpr int32_t RESULT_LENGTH = 2; constexpr int64_t INVALID_FILE_SIZE = -1; -} // namespace +} // namespace AsyncCallbackInfo::~AsyncCallbackInfo() { @@ -385,5 +385,5 @@ void EmitHapticPromiseWork(sptr asyncCallbackInfo) asyncCallbackInfo->DecStrongRef(nullptr); } } -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS -- Gitee