diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 3113dd14f..422bdd229 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -282,7 +282,7 @@ static void SendVersion(void) { strncat(VersionString, "\n", sizeof(VersionString) - strlen(VersionString) - 1); } - FormatVersionInformation(temp, sizeof(temp), " os: ", &version_information); + FormatVersionInformation(temp, sizeof(temp), " os: ", &g_version_information); strncat(VersionString, temp, sizeof(VersionString) - strlen(VersionString) - 1); strncat(VersionString, "\n", sizeof(VersionString) - strlen(VersionString) - 1); diff --git a/client/android/pm3_main.c b/client/android/pm3_main.c index 1fe2f7d32..1b40603c7 100644 --- a/client/android/pm3_main.c +++ b/client/android/pm3_main.c @@ -38,7 +38,7 @@ static char *g_android_executable_directory = NULL; static char *g_android_user_directory = NULL; -char version_information[] = {""}; +char g_version_information[] = {""}; const char *get_my_executable_directory(void) { if (g_android_executable_directory == NULL) { diff --git a/client/src/cmdhw.c b/client/src/cmdhw.c index d475ba76e..53c029dd9 100644 --- a/client/src/cmdhw.c +++ b/client/src/cmdhw.c @@ -970,7 +970,7 @@ void pm3_version(bool verbose, bool oneliner) { if (oneliner) { // For "proxmark3 -v", simple printf, avoid logging char temp[PM3_CMD_DATA_SIZE - 12]; // same limit as for ARM image - FormatVersionInformation(temp, sizeof(temp), "Client: ", &version_information); + FormatVersionInformation(temp, sizeof(temp), "Client: ", &g_version_information); PrintAndLogEx(NORMAL, "%s compiled with " PM3CLIENTCOMPILER __VERSION__ PM3HOSTOS PM3HOSTARCH "\n", temp); return; } @@ -986,7 +986,7 @@ void pm3_version(bool verbose, bool oneliner) { char temp[PM3_CMD_DATA_SIZE - 12]; // same limit as for ARM image PrintAndLogEx(NORMAL, "\n [ " _CYAN_("Proxmark3 RFID instrument") " ]"); PrintAndLogEx(NORMAL, "\n [ " _YELLOW_("CLIENT") " ]"); - FormatVersionInformation(temp, sizeof(temp), " client: ", &version_information); + FormatVersionInformation(temp, sizeof(temp), " client: ", &g_version_information); PrintAndLogEx(NORMAL, "%s", temp); PrintAndLogEx(NORMAL, " compiled with " PM3CLIENTCOMPILER __VERSION__ PM3HOSTOS PM3HOSTARCH); diff --git a/common/commonutil.c b/common/commonutil.c index cbc2afb99..1eb62b826 100644 --- a/common/commonutil.c +++ b/common/commonutil.c @@ -11,12 +11,12 @@ #include /* Similar to FpgaGatherVersion this formats stored version information - * into a string representation. It takes a pointer to the struct version_information, + * into a string representation. It takes a pointer to the struct version_information_t, * verifies the magic properties, then stores a formatted string, prefixed by * prefix in dst. */ void FormatVersionInformation(char *dst, int len, const char *prefix, void *version_info) { - struct version_information *v = (struct version_information *)version_info; + struct version_information_t *v = (struct version_information_t *)version_info; dst[0] = 0; strncat(dst, prefix, len - 1); if (v->magic != VERSION_INFORMATION_MAGIC) { diff --git a/common/commonutil.h b/common/commonutil.h index d751f4d6b..7b548bd15 100644 --- a/common/commonutil.h +++ b/common/commonutil.h @@ -41,7 +41,7 @@ # define NTIME(n) for (int _index = 0; _index < n; _index++) #endif -extern struct version_information version_information; +extern struct version_information_t g_version_information; void FormatVersionInformation(char *dst, int len, const char *prefix, void *version_info); uint32_t reflect(uint32_t v, int b); // used in crc.c ... diff --git a/common/default_version_pm3.c b/common/default_version_pm3.c index 8547182dc..1f3f32415 100644 --- a/common/default_version_pm3.c +++ b/common/default_version_pm3.c @@ -6,7 +6,7 @@ #define SECTVERSINFO __attribute__((section(".version_information"))) #endif -const struct version_information SECTVERSINFO version_information = { +const struct version_information_t SECTVERSINFO g_version_information = { VERSION_INFORMATION_MAGIC, 1, /* version 1 */ 0, /* version information not present */ diff --git a/include/common.h b/include/common.h index 95784acee..af8e5ca3b 100644 --- a/include/common.h +++ b/include/common.h @@ -39,7 +39,7 @@ #define PACKED __attribute__((packed)) #define VERSION_INFORMATION_MAGIC 0x56334d50 // "PM3V" -struct version_information { +struct version_information_t { int magic; /* Magic sequence to identify this as a correct version information structure. Must be VERSION_INFORMATION_MAGIC */ char versionversion; /* Must be 1 */ char present; /* 1 if the version information could be created at compile time, otherwise 0 and the remaining fields (except for magic) are empty */ diff --git a/tools/mkversion.pl b/tools/mkversion.pl index cba8fb298..a87c862fc 100755 --- a/tools/mkversion.pl +++ b/tools/mkversion.pl @@ -73,7 +73,7 @@ print <