From 36dfb0d718e964dae418192550f2cfe9a5583c35 Mon Sep 17 00:00:00 2001 From: maoqian Date: Thu, 30 Dec 2021 03:15:51 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=E9=9D=99=E6=80=81=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=20Signed-off-by:=20maoqian=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ai/asr/keyword_spotting/audio_cache.h | 3 --- ai/asr/keyword_spotting/kws_manager.h | 2 +- ai/cv/image_classification/picture_utils.cpp | 4 ++-- ai/cv/image_classification/picture_utils.h | 4 ++-- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/ai/asr/keyword_spotting/audio_cache.h b/ai/asr/keyword_spotting/audio_cache.h index 6e4f1a6..9665663 100644 --- a/ai/asr/keyword_spotting/audio_cache.h +++ b/ai/asr/keyword_spotting/audio_cache.h @@ -16,9 +16,6 @@ #ifndef AUDIO_CACHE_H #define AUDIO_CACHE_H -#include -#include - namespace KWS { class AudioCache { public: diff --git a/ai/asr/keyword_spotting/kws_manager.h b/ai/asr/keyword_spotting/kws_manager.h index 17c9b89..0746247 100644 --- a/ai/asr/keyword_spotting/kws_manager.h +++ b/ai/asr/keyword_spotting/kws_manager.h @@ -40,7 +40,7 @@ const std::vector WORD_CONTENT = { "Unknown" }; -enum KwsStatus { +enum KwsStatus : int { IDLE = 1000, PREPARED, RUNNING, diff --git a/ai/cv/image_classification/picture_utils.cpp b/ai/cv/image_classification/picture_utils.cpp index c6b222c..36af8d0 100644 --- a/ai/cv/image_classification/picture_utils.cpp +++ b/ai/cv/image_classification/picture_utils.cpp @@ -59,7 +59,7 @@ int WriteJpegFile(const string &filename, int quality, } jpeg_finish_compress(&cinfo); - fclose(outfile); + (void)fclose(outfile); jpeg_destroy_compress(&cinfo); return IC_RETCODE_SUCCESS; } @@ -135,7 +135,7 @@ uint8_t *ReadJpegFile(const string &filename, int &srcWidth, int &srcHeight) (void)jpeg_finish_decompress(&cinfo); jpeg_destroy_decompress(&cinfo); - fclose(infile); + (void)fclose(infile); return buffer; } diff --git a/ai/cv/image_classification/picture_utils.h b/ai/cv/image_classification/picture_utils.h index dad7381..927701d 100644 --- a/ai/cv/image_classification/picture_utils.h +++ b/ai/cv/image_classification/picture_utils.h @@ -32,14 +32,14 @@ struct MyErrorMgr { using MyErrorPtr = MyErrorMgr *; // The index order of BGR format -enum BgrIndex { +enum BgrIndex : int { BGR_BLUE = 0, BGR_GREEN, BGR_RED, }; // The index order of RGB format -enum RgbIndex { +enum RgbIndex : int { RGB_RED = 0, RGB_GREEN, RGB_BLUE, -- Gitee From 6c1a008aa15f319e01298cacecd98d243f26baec Mon Sep 17 00:00:00 2001 From: maoqian Date: Thu, 30 Dec 2021 04:20:16 +0000 Subject: [PATCH 2/3] Static check modification Signed-off-by: maoqian --- ai/asr/keyword_spotting/audio_cache.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ai/asr/keyword_spotting/audio_cache.h b/ai/asr/keyword_spotting/audio_cache.h index 9665663..2e2ab98 100644 --- a/ai/asr/keyword_spotting/audio_cache.h +++ b/ai/asr/keyword_spotting/audio_cache.h @@ -16,6 +16,8 @@ #ifndef AUDIO_CACHE_H #define AUDIO_CACHE_H +#include + namespace KWS { class AudioCache { public: -- Gitee From 849cae55a52144342eb44fce08eadfd3ad5fd439 Mon Sep 17 00:00:00 2001 From: maoqian Date: Thu, 30 Dec 2021 05:51:04 +0000 Subject: [PATCH 3/3] Static compilation modification Signed-off-by: maoqian --- ai/asr/keyword_spotting/audio_cache.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ai/asr/keyword_spotting/audio_cache.h b/ai/asr/keyword_spotting/audio_cache.h index 2e2ab98..6e4f1a6 100644 --- a/ai/asr/keyword_spotting/audio_cache.h +++ b/ai/asr/keyword_spotting/audio_cache.h @@ -17,6 +17,7 @@ #define AUDIO_CACHE_H #include +#include namespace KWS { class AudioCache { -- Gitee