cholla-hydro/cholla

Convert all indexing variables to `size_t`/`ptrdiff_t`

Open

#271 aperta il 21 mar 2023

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)C++ (41 fork)auto 404
code cleanupenhancementgood first issuerefactor

Metriche repository

Star
 (74 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Currently many of the indexing variables we use are of type 'int' when they should be size_t (or ptrdiff_t if they're a difference). This could potentially lead to issues with the range of int as the size of VRAM on GPUs grows and this change would allow us to enable the following clang-tidy checks:

  • bugprone-implicit-widening-of-multiplication-result
  • bugprone-narrowing-conversions (alias of cppcoreguidelines-narrowing-conversions)

This conversion wouldn't be too difficult but would be time consuming and would be a good project for a new student/collaborator to become familiar with the code.

See this discussion for the original discussion on the topic.

Guida contributor