From: Volker Lendecke Date: Mon, 21 Oct 2019 12:38:47 +0000 (+0200) Subject: smbd: Save 520 bytes of writable memory from every smbd X-Git-Tag: talloc-2.3.1~254 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f37b913348e921afee3e578ff0f14b731157eb03;p=thirdparty%2Fsamba.git smbd: Save 520 bytes of writable memory from every smbd Move what can be const from the "data" to the "text" segment Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Oct 23 02:37:12 UTC 2019 on sn-devel-184 --- diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c index 074794170b4..92319495f2a 100644 --- a/source3/smbd/mangle_hash2.c +++ b/source3/smbd/mangle_hash2.c @@ -195,7 +195,7 @@ static void init_tables(void) * initializers, but I'll leave it in: less surprise. */ -static uint8_t char_flags[256] = { +static const uint8_t char_flags[256] = { 0x80, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, @@ -230,7 +230,7 @@ static uint8_t char_flags[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static uint8_t base_reverse[256] = { +static const uint8_t base_reverse[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -433,7 +433,7 @@ static bool is_mangled(const char *name, const struct share_params *parm) get larger when converted from UNIX to DOS formats) */ -static char force_shortname_chars[] = " +,[];="; +static const char force_shortname_chars[] = " +,[];="; static bool is_8_3(const char *name, bool check_case, bool allow_wildcards, const struct share_params *p) {