Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify parameter type from reference to value #344

Merged
merged 1 commit into from Jun 14, 2020

Conversation

ma8ma
Copy link
Collaborator

@ma8ma ma8ma commented Jun 14, 2020

関数の引数にconst修飾子を付けることができるとcppcheckに指摘されたため整数の参照渡しを値渡しに変更します。

cppcheckのレポート

src/jdlib/misccharcode.cpp:43:47: style: Parameter 'read_byte' can be declared with const [constParameter]
bool MISC::is_euc( const char* input, size_t& read_byte )
                                              ^
src/jdlib/misccharcode.cpp:134:48: style: Parameter 'read_byte' can be declared with const [constParameter]
bool MISC::is_sjis( const char* input, size_t& read_byte )
                                               ^
src/jdlib/misccharcode.cpp:190:47: style: Parameter 'read_byte' can be declared with const [constParameter]
bool MISC::is_utf( const char* input, size_t& read_byte )
                                              ^

関数の引数にconst修飾子を付けることができるとcppcheckに指摘されたため
整数の参照渡しを値渡しに変更します。

cppcheckのレポート
```
src/jdlib/misccharcode.cpp:43:47: style: Parameter 'read_byte' can be declared with const [constParameter]
bool MISC::is_euc( const char* input, size_t& read_byte )
                                              ^
src/jdlib/misccharcode.cpp:134:48: style: Parameter 'read_byte' can be declared with const [constParameter]
bool MISC::is_sjis( const char* input, size_t& read_byte )
                                               ^
src/jdlib/misccharcode.cpp:190:47: style: Parameter 'read_byte' can be declared with const [constParameter]
bool MISC::is_utf( const char* input, size_t& read_byte )
                                              ^
```
@ma8ma ma8ma added the refactoring コードの整理 (バグ修正でも機能変更でもない) label Jun 14, 2020
@ma8ma ma8ma merged commit 1eb0bac into JDimproved:master Jun 14, 2020
@ma8ma ma8ma added this to Done in State of JDim-v0.3.0+ via automation Jun 14, 2020
@ma8ma ma8ma deleted the modify-param-type-from-ref-to-val branch June 14, 2020 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring コードの整理 (バグ修正でも機能変更でもない)
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant