瀏覽代碼

Restrict the visibility of these two to the TU

No need to make these global

Before
$ nm ./CMakeFiles/open62541-plugins.dir/plugins/ua_config_default.c.o
000000000000089d t addDefaultNetworkLayers
...
0000000000000000 D usernamePasswords
0000000000000060 R usernamePasswordsSize

After
$ nm ./CMakeFiles/open62541-plugins.dir/plugins/ua_config_default.c.o
0000000000000000 d usernamePasswords
0000000000000060 r usernamePasswordsSize
Frank Meerkoetter 6 年之前
父節點
當前提交
e32595ecc4
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      plugins/ua_config_default.c

+ 2 - 2
plugins/ua_config_default.c

@@ -97,8 +97,8 @@ UA_ServerConfig_set_customHostname(UA_ServerConfig *config, const UA_String cust
     UA_String_copy(&customHostname, &config->customHostname);
 }
 
-const size_t usernamePasswordsSize = 2;
-UA_UsernamePasswordLogin usernamePasswords[2] = {
+static const size_t usernamePasswordsSize = 2;
+static UA_UsernamePasswordLogin usernamePasswords[2] = {
     {UA_STRING_STATIC("user1"), UA_STRING_STATIC("password")},
     {UA_STRING_STATIC("user2"), UA_STRING_STATIC("password1")}};