Skip to content

Commit

Permalink
Silence a clang-tidy about uninitialized variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
vgvassilev committed Jan 3, 2024
1 parent fb542b9 commit a1f5390
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions include/clad/Differentiator/Differentiator.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ template <typename T, typename U> struct ValueAndAdjoint {

/// \returns the size of a c-style string
inline CUDA_HOST_DEVICE unsigned int GetLength(const char* code) {
unsigned int count;
const char* code_copy = code;
#ifdef __CUDACC__
count = 0;
unsigned int count = 0;
while (*code_copy != '\0') {
count++;
code_copy++;
}
#else
count = strlen(code_copy);
unsigned int count = strlen(code_copy);
#endif
return count;
}
Expand Down

0 comments on commit a1f5390

Please sign in to comment.