Skip to content

Commit 3273dac

Browse files
committed
fix(examples): use const char* const for global string constants
Pointers to string literals should be immutable themselves, not just the pointed-to data. Applies to all embedded env.hpp/env.cpp.example files and the http_test host constant.
1 parent 2d7422d commit 3273dac

37 files changed

Lines changed: 109 additions & 109 deletions

File tree

examples/embedded/anthropic/agent/include/env.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// User Configuration
1010
// =============================================================================
1111

12-
extern const char* kWifiSsid;
13-
extern const char* kWifiPassword;
14-
extern const char* kAnthropicApiKey;
12+
extern const char* const kWifiSsid;
13+
extern const char* const kWifiPassword;
14+
extern const char* const kAnthropicApiKey;
1515

1616
#endif // EXAMPLE_ENV_HPP

examples/embedded/anthropic/agent/src/env.cpp.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
// User Configuration — Edit these values before compiling
77
// =============================================================================
88

9-
const char* kWifiSsid = "YourSSID";
10-
const char* kWifiPassword = "YourPassword";
11-
const char* kAnthropicApiKey = "YourApiKey";
9+
const char* const kWifiSsid = "YourSSID";
10+
const char* const kWifiPassword = "YourPassword";
11+
const char* const kAnthropicApiKey = "YourApiKey";

examples/embedded/anthropic/chat/include/env.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// User Configuration
1010
// =============================================================================
1111

12-
extern const char* kWifiSsid;
13-
extern const char* kWifiPassword;
14-
extern const char* kAnthropicApiKey;
12+
extern const char* const kWifiSsid;
13+
extern const char* const kWifiPassword;
14+
extern const char* const kAnthropicApiKey;
1515

1616
#endif // EXAMPLE_ENV_HPP

examples/embedded/anthropic/chat/src/env.cpp.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
// User Configuration — Edit these values before compiling
77
// =============================================================================
88

9-
const char* kWifiSsid = "YourSSID";
10-
const char* kWifiPassword = "YourPassword";
11-
const char* kAnthropicApiKey = "YourApiKey";
9+
const char* const kWifiSsid = "YourSSID";
10+
const char* const kWifiPassword = "YourPassword";
11+
const char* const kAnthropicApiKey = "YourApiKey";

examples/embedded/anthropic/structured_output/include/env.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// User Configuration
1010
// =============================================================================
1111

12-
extern const char* kWifiSsid;
13-
extern const char* kWifiPassword;
14-
extern const char* kAnthropicApiKey;
12+
extern const char* const kWifiSsid;
13+
extern const char* const kWifiPassword;
14+
extern const char* const kAnthropicApiKey;
1515

1616
#endif // EXAMPLE_ENV_HPP

examples/embedded/anthropic/structured_output/src/env.cpp.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
// User Configuration — Edit these values before compiling
77
// =============================================================================
88

9-
const char* kWifiSsid = "YourSSID";
10-
const char* kWifiPassword = "YourPassword";
11-
const char* kAnthropicApiKey = "YourApiKey";
9+
const char* const kWifiSsid = "YourSSID";
10+
const char* const kWifiPassword = "YourPassword";
11+
const char* const kAnthropicApiKey = "YourApiKey";

examples/embedded/anthropic/websearch/include/env.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// User Configuration
1010
// =============================================================================
1111

12-
extern const char* kWifiSsid;
13-
extern const char* kWifiPassword;
14-
extern const char* kAnthropicApiKey;
12+
extern const char* const kWifiSsid;
13+
extern const char* const kWifiPassword;
14+
extern const char* const kAnthropicApiKey;
1515

1616
#endif // EXAMPLE_ENV_HPP

examples/embedded/anthropic/websearch/src/env.cpp.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
// User Configuration — Edit these values before compiling
77
// =============================================================================
88

9-
const char* kWifiSsid = "YourSSID";
10-
const char* kWifiPassword = "YourPassword";
11-
const char* kAnthropicApiKey = "YourApiKey";
9+
const char* const kWifiSsid = "YourSSID";
10+
const char* const kWifiPassword = "YourPassword";
11+
const char* const kAnthropicApiKey = "YourApiKey";

examples/embedded/foresthub/agent/include/env.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// User Configuration
1010
// =============================================================================
1111

12-
extern const char* kWifiSsid;
13-
extern const char* kWifiPassword;
14-
extern const char* kForesthubApiKey;
12+
extern const char* const kWifiSsid;
13+
extern const char* const kWifiPassword;
14+
extern const char* const kForesthubApiKey;
1515

1616
#endif // EXAMPLE_ENV_HPP

examples/embedded/foresthub/agent/src/env.cpp.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
// User Configuration — Edit these values before compiling
77
// =============================================================================
88

9-
const char* kWifiSsid = "YourSSID";
10-
const char* kWifiPassword = "YourPassword";
11-
const char* kForesthubApiKey = "YourApiKey";
9+
const char* const kWifiSsid = "YourSSID";
10+
const char* const kWifiPassword = "YourPassword";
11+
const char* const kForesthubApiKey = "YourApiKey";

0 commit comments

Comments
 (0)