Make global configs as static (#1159)

Don't expose static configs symbol, and make configEnumGetValue as
static function.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
This commit is contained in:
zhenwei pi 2024-12-31 04:58:06 +08:00 committed by GitHub
parent e4179f1f3b
commit a136ad9a50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -283,7 +283,7 @@ struct standardConfig {
void *privdata; /* privdata for this config, for module configs this is a ModuleConfig struct */
};
dict *configs = NULL; /* Runtime config values */
static dict *configs = NULL; /* Runtime config values */
/* Lookup a config by the provided sds string name, or return NULL
* if the config does not exist */
@ -297,7 +297,7 @@ static standardConfig *lookupConfig(sds name) {
*----------------------------------------------------------------------------*/
/* Get enum value from name. If there is no match INT_MIN is returned. */
int configEnumGetValue(configEnum *ce, sds *argv, int argc, int bitflags) {
static int configEnumGetValue(configEnum *ce, sds *argv, int argc, int bitflags) {
if (argc == 0 || (!bitflags && argc != 1)) return INT_MIN;
int values = 0;
for (int i = 0; i < argc; i++) {