From 7a98afaeee09141ab36607e898d0e00072d9d930 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Tue, 13 Jun 2017 18:24:42 +0200 Subject: Remove loadsave:do_string() --- src/loadsave.cc | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) diff --git a/src/loadsave.cc b/src/loadsave.cc index 8413086d..fc473e0c 100644 --- a/src/loadsave.cc +++ b/src/loadsave.cc @@ -196,55 +196,6 @@ static void do_s32b(s32b *ip, ls_flag_t flag) do_u32b((u32b *)ip, flag); } -static void save_string(const char *str) -{ - while (*str) - { - do_byte((byte*)str, ls_flag_t::SAVE); - str++; - } - do_byte((byte*)str, ls_flag_t::SAVE); -} - -static void load_string(char *str, int max) -{ - int i; - - /* Read the string */ - for (i = 0; TRUE; i++) - { - byte tmp8u; - - /* Read a byte */ - do_byte(&tmp8u, ls_flag_t::LOAD); - - /* Collect string while legal */ - if (i < max) str[i] = tmp8u; - - /* End of string */ - if (!tmp8u) break; - } - /* Terminate */ - str[max - 1] = '\0'; -} - -static void do_string(char *str, int max, ls_flag_t flag) -/* Max is ignored for writing */ -{ - switch(flag) { - case ls_flag_t::LOAD: - { - load_string(str, max); - return; - } - case ls_flag_t::SAVE: - { - save_string(str); - return; - } - } -} - static void save_std_string(std::string const *s) { // Length prefix. -- cgit v1.2.3