rename global version_information and its struct type

This commit is contained in:
Philippe Teuwen 2021-08-21 20:11:14 +02:00
parent 1d11e6d153
commit 8280fc3c07
9 changed files with 11 additions and 11 deletions

View file

@ -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);

View file

@ -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) {

View file

@ -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);

View file

@ -11,12 +11,12 @@
#include <string.h>
/* 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) {

View file

@ -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 ...

View file

@ -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 */

View file

@ -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 */

View file

@ -73,7 +73,7 @@ print <<EOF
#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,
1,

View file

@ -57,7 +57,7 @@ cat <<EOF
#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,
1,