Skip to content

Commit 0bfbb8c

Browse files
committed
Rename UTC offset variable; update copyrights
Rename global UTC offset from g_nUtcOffset to g_utc_offset across headers and sources (lib-hal/include/{global.h,utc.h}, lib-clib/src/time.cpp) and update all references and Global accessors/mutator to use the new name. Also adjust localtime() to use the renamed variable. Additionally, update copyright/contact mailto in lib-clib/src/strlen.cpp and lib-widget/src/widget.cpp (info@gd32-dmx.org) and bump the copyright year in lib-clib/src/time.cpp to 2026.
1 parent 2a33892 commit 0bfbb8c

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

lib-clib/src/strlen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file strlen.cpp
33
*
44
*/
5-
/* Copyright (C) 2023-2026 by Arjan van Vught mailto:info@orangepi-dmx.nl
5+
/* Copyright (C) 2023-2026 by Arjan van Vught mailto:info@gd32-dmx.org
66
*
77
* Permission is hereby granted, free of charge, to any person obtaining a copy
88
* of this software and associated documentation files (the "Software"), to deal

lib-clib/src/time.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file time.cpp
33
*
44
*/
5-
/* Copyright (C) 2016-2025 by Arjan van Vught mailto:info@gd32-dmx.org
5+
/* Copyright (C) 2016-2026 by Arjan van Vught mailto:info@gd32-dmx.org
66
*
77
* Permission is hereby granted, free of charge, to any person obtaining a copy
88
* of this software and associated documentation files (the "Software"), to deal
@@ -27,7 +27,7 @@
2727
#include <time.h>
2828

2929
namespace global {
30-
int32_t g_nUtcOffset = 0;
30+
int32_t g_utc_offset = 0;
3131
} // namespace global
3232

3333
static constexpr int kDaysOfMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
@@ -56,7 +56,7 @@ struct tm* localtime(const time_t* t) {
5656
return nullptr;
5757
}
5858

59-
auto time = *t + global::g_nUtcOffset;
59+
auto time = *t + global::g_utc_offset;
6060
return gmtime(&time);
6161
}
6262

lib-hal/include/global.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
namespace global
2424
{
25-
extern int32_t g_nUtcOffset;
25+
extern int32_t g_utc_offset;
2626
}
2727

2828
/**
@@ -49,14 +49,14 @@ class Global
4949
* @brief Gets the current UTC offset in seconds.
5050
* @return UTC offset in seconds.
5151
*/
52-
int32_t GetUtcOffset() const { return global::g_nUtcOffset; }
52+
int32_t GetUtcOffset() const { return global::g_utc_offset; }
5353

5454
/**
5555
* @brief Gets the current UTC offset as (hours, minutes).
5656
* @param[out] hours Signed hour component.
5757
* @param[out] minutes Unsigned minute component.
5858
*/
59-
inline void GetUtcOffset(int32_t& hours, uint32_t& minutes) { hal::utc::SplitOffset(global::g_nUtcOffset, hours, minutes); }
59+
inline void GetUtcOffset(int32_t& hours, uint32_t& minutes) { hal::utc::SplitOffset(global::g_utc_offset, hours, minutes); }
6060

6161
/**
6262
* @brief Sets the global UTC offset if the value is valid.
@@ -67,7 +67,7 @@ class Global
6767
{
6868
if (hal::utc::IsValidOffset(utc_offset_seconds))
6969
{
70-
::global::g_nUtcOffset = utc_offset_seconds;
70+
::global::g_utc_offset = utc_offset_seconds;
7171
return true;
7272
}
7373
return false;

lib-hal/include/utc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace global
3737
/**
3838
* @brief The current UTC offset in seconds.
3939
*/
40-
extern int32_t g_nUtcOffset;
40+
extern int32_t g_utc_offset;
4141
} // namespace global
4242

4343
namespace hal::utc

lib-widget/src/widget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* https://wiki.openlighting.org/index.php/USB_Protocol_Extensions
77
*
88
*/
9-
/* Copyright (C) 2015-2026 by Arjan van Vught mailto:info@orangepi-dmx.nl
9+
/* Copyright (C) 2015-2026 by Arjan van Vught mailto:info@gd32-dmx.org
1010
*
1111
* Permission is hereby granted, free of charge, to any person obtaining a copy
1212
* of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)