JDimproved / JDim

2ch browser for linux
https://jdimproved.github.io/JDim/
GNU General Public License v2.0
44 stars 11 forks source link

Fix compiler warnings for -Wold-style-cast part4,5,6,7,8 #1387

Closed ma8ma closed 2 months ago

ma8ma commented 2 months ago

Fix compiler warning for -Wold-style-cast part4

C言語スタイルのキャストを使用しているとclangに指摘されたためC++スタイルのキャストstatic_cast<...>(value)に変更してコンパイラー警告を修正します。

clang-17のレポート (file pathを一部省略)

src/dbtree/articlebase.cpp:1513:25: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/articlebase.cpp:1523:30: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/articlebase.cpp:721:50: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/board2chcompati.cpp:310:23: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/boardjbbs.cpp:292:23: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/misccharcode.cpp:150:13: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/misccharcode.cpp:157:21: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/misccharcode.cpp:158:21: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/misccharcode.cpp:164:21: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/misccharcode.cpp:165:21: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/misccharcode.cpp:166:21: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/misccharcode.cpp:172:21: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/misccharcode.cpp:173:21: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/misccharcode.cpp:213:20: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/misccharcode.cpp:259:13: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/misccharcode.cpp:264:18: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/misccharcode.cpp:271:21: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/misccharcode.cpp:272:21: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/misccharcode.cpp:326:13: warning: use of old-style cast [-Wold-style-cast]

Fix compiler warning for -Wold-style-cast part5

C言語スタイルのキャストを使用しているとclangに指摘されたためC++スタイルのキャストstatic_cast<...>(value)に変更したり変数の型を変更してコンパイラー警告を修正します。

clang-17のレポート (file pathを一部省略)

src/dbtree/nodetreebase.cpp:2992:22: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/nodetreebase.cpp:2992:59: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/nodetreebase.cpp:2993:25: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/nodetreebase.cpp:3016:18: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/nodetreebase.cpp:3016:55: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/nodetreebase.cpp:3017:21: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/nodetreebase.cpp:3037:55: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/nodetreebase.cpp:3078:14: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/nodetreebase.cpp:3078:52: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/nodetreebase.cpp:3079:17: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/nodetreebase.cpp:3082:14: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/nodetreebase.cpp:3082:52: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/nodetreebase.cpp:3083:17: warning: use of old-style cast [-Wold-style-cast]
src/dbtree/nodetreebase.cpp:3104:12: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/tfidf.cpp:120:21: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/tfidf.cpp:175:25: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/tfidf.cpp:178:59: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/tfidf.cpp:255:12: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/tfidf.cpp:55:21: warning: use of old-style cast [-Wold-style-cast]
src/jdlib/tfidf.cpp:80:35: warning: use of old-style cast [-Wold-style-cast]

Fix compiler warning for -Wold-style-cast part6

C言語スタイルのキャストを使用しているとclangに指摘されたためC++スタイルのキャストstatic_cast<...>(value)に変更してコンパイラー警告を修正します。

clang-17のレポート (file pathを一部省略)

src/skeleton/dragnote.cpp:423:28: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/dragnote.cpp:423:61: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/dragnote.cpp:450:19: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/dragnote.cpp:451:19: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/dragnote.cpp:455:28: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/dragnote.cpp:455:61: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/dragtreeview.cpp:274:52: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/dragtreeview.cpp:274:67: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/dragtreeview.cpp:317:52: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/dragtreeview.cpp:317:67: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/dragtreeview.cpp:445:52: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/dragtreeview.cpp:445:67: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/edittreeview.cpp:230:34: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/edittreeview.cpp:236:35: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/edittreeview.cpp:239:32: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/edittreeview.cpp:239:65: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/edittreeview.cpp:255:27: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/edittreeview.cpp:291:26: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/menubutton.cpp:190:21: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/menubutton.cpp:210:21: warning: use of old-style cast [-Wold-style-cast]

Fix compiler warning for -Wold-style-cast part7

C言語スタイルのキャストを使用しているとclangに指摘されたためC++スタイルのキャストstatic_cast<...>(value)reinterpret_cast<...>(value)に変更してコンパイラー警告を修正します。

clang-17のレポート (file pathを一部省略)

src/aamanager.cpp:230:15: warning: use of old-style cast [-Wold-style-cast]
src/aamanager.cpp:236:15: warning: use of old-style cast [-Wold-style-cast]
src/aamanager.cpp:246:15: warning: use of old-style cast [-Wold-style-cast]
src/main.cpp:148:65: warning: cast from 'gboolean (*)(GIOChannel *, GIOCondition, XSMPDATA *)' (aka 'int (*)(_GIOChannel *, GIOCondition, XSMPDATA *)') to 'GIOFunc' (aka 'int (*)(_GIOChannel *, GIOCondition, void *)') converts to incompatible function type [-Wcast-function-type-strict]
src/main.cpp:148:65: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/edittreeview.cpp:292:26: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/menubutton.cpp:210:21: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/tabnote.cpp:328:25: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/tabnote.cpp:328:32: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/tabnote.cpp:388:39: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/tabnote.cpp:388:46: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/treeviewbase.cpp:243:48: warning: use of old-style cast [-Wold-style-cast]
src/skeleton/treeviewbase.cpp:266:39: warning: use of old-style cast [-Wold-style-cast]
src/usrcmdpref.cpp:160:53: warning: use of old-style cast [-Wold-style-cast]
src/usrcmdpref.cpp:160:68: warning: use of old-style cast [-Wold-style-cast]

Fix compiler warning for -Wold-style-cast part8

C言語スタイルのキャストを使用しているとclangに指摘されたためC++スタイルのキャストstatic_cast<...>(value)に変更してコンパイラー警告を修正します。

clang-17のレポート (file pathを一部省略)

src/cssmanager.cpp:383:44: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:384:45: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:385:43: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:386:46: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:400:126: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:401:134: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:402:128: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:403:137: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:436:35: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:437:36: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:438:34: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:439:37: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:454:108: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:455:116: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:456:110: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:457:119: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:479:39: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:480:40: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:481:38: warning: use of old-style cast [-Wold-style-cast]
src/cssmanager.cpp:482:41: warning: use of old-style cast [-Wold-style-cast]