mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-06 11:08:54 +08:00
Code style fixes
This commit is contained in:
@@ -51,6 +51,6 @@ __EXPORT extern const char *px4_git_tag;
|
||||
__EXPORT extern const char *os_git_tag;
|
||||
__EXPORT extern const uint32_t px4_board_version;
|
||||
|
||||
__EXPORT uint32_t version_tag_to_number(const char* tag);
|
||||
__EXPORT uint32_t version_tag_to_number(const char *tag);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
@@ -73,7 +73,7 @@ __EXPORT const uint32_t px4_board_version = 1;
|
||||
/**
|
||||
* Convert a version tag string to a number
|
||||
*/
|
||||
uint32_t version_tag_to_number(const char* tag)
|
||||
uint32_t version_tag_to_number(const char *tag)
|
||||
{
|
||||
uint32_t ver = 0;
|
||||
unsigned len = strlen(tag);
|
||||
@@ -86,11 +86,14 @@ uint32_t version_tag_to_number(const char* tag)
|
||||
|
||||
ver += number * mag;
|
||||
mag *= 10;
|
||||
|
||||
} else if (tag[i] == '.') {
|
||||
continue;
|
||||
|
||||
} else if (ver > 100 && dotparsed) {
|
||||
/* this is a full version and we have enough digits */
|
||||
return ver;
|
||||
|
||||
} else if (tag[i] != 'v') {
|
||||
/* reset, because we don't have a full tag but
|
||||
* are seeing non-numeric characters again
|
||||
|
||||
Reference in New Issue
Block a user