From 23dec99195c6d93631449f33346e60f913bf5464 Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Sat, 13 May 2017 22:10:45 +0300 Subject: [PATCH] (parm_table[]): Make const to relocate 13624 bytes from .data to .text. (init_globals): fstring is enough for "%d.%d". (*): Remove nmbd code. Signed-off-by: Andrew V. Samoilov --- src/vfs/smbfs/helpers/param/loadparm.c | 89 ++-------------------------------- 1 file changed, 3 insertions(+), 86 deletions(-) diff --git a/src/vfs/smbfs/helpers/param/loadparm.c b/src/vfs/smbfs/helpers/param/loadparm.c index 9035a1d36..5e384d1d9 100644 --- a/src/vfs/smbfs/helpers/param/loadparm.c +++ b/src/vfs/smbfs/helpers/param/loadparm.c @@ -448,9 +448,7 @@ static int iNumServices = 0; static int iServiceIndex = 0; static BOOL bInGlobalSection = True; static BOOL bGlobalOnly = False; -#if 0 -static int default_server_announce; -#endif /* 0 */ + #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct)) /* prototypes for the special type handlers */ @@ -544,7 +542,7 @@ static struct enum_list const enum_ssl_version[] = { {SMB_SSL_V2, "ssl2"}, {SMB_ #define PARM_SEPARATOR(label) {label, P_SEP, P_SEPARATOR, NULL, NULL, NULL, 0, {0}} /* note that we do not initialise the defaults union - it is not allowed in ANSI C */ -static struct parm_struct parm_table[] = { +static struct parm_struct const parm_table[] = { PARM_SEPARATOR ("Base Options"), {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT, {0}}, @@ -911,7 +909,7 @@ static void init_globals (void) { static BOOL done_init = False; - pstring s; + fstring s; if (!done_init) { @@ -2506,87 +2504,6 @@ volume_label (int snum) return (ret); } #endif /* 0 */ -#if 0 -/******************************************************************* - Set the server type we will announce as via nmbd. -********************************************************************/ -static void -set_default_server_announce_type (void) -{ - default_server_announce = (SV_TYPE_WORKSTATION | SV_TYPE_SERVER | - SV_TYPE_SERVER_UNIX | SV_TYPE_PRINTQ_SERVER); - if (lp_announce_as () == ANNOUNCE_AS_NT_SERVER) - default_server_announce |= (SV_TYPE_SERVER_NT | SV_TYPE_NT); - if (lp_announce_as () == ANNOUNCE_AS_NT_WORKSTATION) - default_server_announce |= SV_TYPE_NT; - else if (lp_announce_as () == ANNOUNCE_AS_WIN95) - default_server_announce |= SV_TYPE_WIN95_PLUS; - else if (lp_announce_as () == ANNOUNCE_AS_WFW) - default_server_announce |= SV_TYPE_WFW; - default_server_announce |= (lp_time_server ()? SV_TYPE_TIME_SOURCE : 0); -} - - -/******************************************************************* - Get the default server type we will announce as via nmbd. -********************************************************************/ -int -lp_default_server_announce (void) -{ - return default_server_announce; -} - - -/******************************************************************* - Split the announce version into major and minor numbers. -********************************************************************/ -int -lp_major_announce_version (void) -{ - static BOOL got_major = False; - static int major_version = DEFAULT_MAJOR_VERSION; - char *vers; - char *p; - - if (got_major) - return major_version; - - got_major = True; - if ((vers = lp_announce_version ()) == NULL) - return major_version; - - if ((p = strchr (vers, '.')) == 0) - return major_version; - - *p = '\0'; - major_version = atoi (vers); - return major_version; -} - - -int -lp_minor_announce_version (void) -{ - static BOOL got_minor = False; - static int minor_version = DEFAULT_MINOR_VERSION; - char *vers; - char *p; - - if (got_minor) - return minor_version; - - got_minor = True; - if ((vers = lp_announce_version ()) == NULL) - return minor_version; - - if ((p = strchr (vers, '.')) == 0) - return minor_version; - - p++; - minor_version = atoi (p); - return minor_version; -} -#endif /* 0 */ /*********************************************************** Set the global name resolution order (used in smbclient). -- 2.11.4.GIT