fusionlanguage / fut

Fusion programming language. Transpiling to C, C++, C#, D, Java, JavaScript, Python, Swift, TypeScript and OpenCL C.
https://fusion-lang.org
GNU General Public License v3.0
1.76k stars 55 forks source link

Use `size_t` instead of `const int` to get rid of these warnings #97

Closed ghost closed 1 year ago

ghost commented 1 year ago
libfut.cpp: In member function 'void FuSema::fillGenericClass(FuClassType*, const FuClass*, const FuAggregateInitializer*)':
libfut.cpp:5465:29: warning: comparison of integer expressions of different signedness: 'std::vector<std::shared_ptr<FuType> >::size_type' {aka 'long long unsigned int'} and 'const int' [-Wsign-compare]
 5465 |         if (typeArgs.size() != klass->typeParameterCount) {
      |             ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
libfut.cpp: In member function 'void FuSema::resolveConst(FuConst*)':
libfut.cpp:5984:54: warning: comparison of integer expressions of different signedness: 'const int' and 'std::vector<std::shared_ptr<FuExpr> >::size_type' {aka 'long long unsigned int'} [-Wsign-compare]
 5984 |                                 if (arrayStg->length != coll->items.size())
      |                                     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
pfusik commented 1 year ago

Basically same problem as #96. const is irrelevant here.