Skip to content

Commit 9a25b8d

Browse files
committed
more lint fixes.
1 parent 123843d commit 9a25b8d

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

‎nav2_amcl/src/include/portable_utils.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ extern "C" {
1212
// Use rand, and srand for such system.
1313
static double drand48(void)
1414
{
15-
return ((double)rand())/RAND_MAX;
15+
return ((double)rand())/RAND_MAX;
1616
}
1717

1818
static void srand48(long int seedval)
1919
{
20-
srand(seedval);
20+
srand(seedval);
2121
}
2222
#endif
2323

‎nav2_map_server/src/map_io.cpp‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,30 +50,32 @@
5050
#ifdef _WIN32
5151
// https://github.com/rtv/Stage/blob/master/replace/dirname.c
5252
static
53-
char * dirname(char *path)
53+
char * dirname(char * path)
5454
{
5555
static const char dot[] = ".";
56-
char *last_slash;
56+
char * last_slash;
5757

5858
/* Find last '/'. */
59-
last_slash = path != NULL ? strrchr (path, '/') : NULL;
59+
last_slash = path != NULL ? strrchr(path, '/') : NULL;
6060

61-
if (last_slash == path)
61+
if (last_slash == path) {
6262
/* The last slash is the first character in the string. We have to
6363
return "/". */
6464
++last_slash;
65-
else if (last_slash != NULL && last_slash[1] == '\0')
65+
} else if (last_slash != NULL && last_slash[1] == '\0') {
6666
/* The '/' is the last character, we have to look further. */
6767
last_slash = reinterpret_cast<char *>(memchr(path, last_slash - path, '/'));
68+
}
6869

69-
if (last_slash != NULL)
70+
if (last_slash != NULL) {
7071
/* Terminate the path. */
7172
last_slash[0] = '\0';
72-
else
73+
} else {
7374
/* This assignment is ill-designed but the XPG specs require to
7475
return a string containing "." in any case no directory part is
7576
found and so a static and constant string is required. */
7677
path = reinterpret_cast<char *>(dot);
78+
}
7779

7880
return path;
7981
}

‎nav2_util/src/dump_params.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,9 @@ validate(
389389
}
390390

391391
#ifdef _WIN32
392-
static const char * basename(const char *filepath)
392+
static const char * basename(const char * filepath)
393393
{
394-
const char* base = std::strrchr(filepath, '/');
394+
const char * base = std::strrchr(filepath, '/');
395395
return base ? (base + 1) : filepath;
396396
}
397397
#endif

0 commit comments

Comments
 (0)