smbd: Save 520 bytes of writable memory from every smbd
authorVolker Lendecke <vl@samba.org>
Mon, 21 Oct 2019 12:38:47 +0000 (14:38 +0200)
committerMartin Schwenke <martins@samba.org>
Wed, 23 Oct 2019 02:37:12 +0000 (02:37 +0000)
Move what can be const from the "data" to the "text" segment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Oct 23 02:37:12 UTC 2019 on sn-devel-184

source3/smbd/mangle_hash2.c

index 074794170b4e5e9b09996b6901b550c980a7aa82..92319495f2a7f1edc8cc0f1e10d14b5928beef6a 100644 (file)
@@ -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)
 {