From 099da513ff2b41ea97cb1563a5c8fb56db9d7d7e Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Thu, 16 Jan 2020 16:18:08 -0500 Subject: [PATCH] Remove some unused misc.cpp functions (encode/decode) These were unused and throwing warnings, so throw them away! --- common/misc.cpp | 61 ------------------------------------------------- common/misc.h | 7 ------ 2 files changed, 68 deletions(-) diff --git a/common/misc.cpp b/common/misc.cpp index 792dfcbab..b9dc31d28 100644 --- a/common/misc.cpp +++ b/common/misc.cpp @@ -19,9 +19,6 @@ #include "types.h" #include -#define ENC(c) (((c) & 0x3f) + ' ') -#define DEC(c) (((c) - ' ') & 0x3f) - std::map DBFieldNames; #ifndef WIN32 @@ -333,64 +330,6 @@ void LoadItemDBFieldNames() { DBFieldNames[113]="unknown115"; // ? (end quote) } -void encode_length(unsigned long length, char *out) -{ -char buf[4]; - memcpy(buf,&length,sizeof(unsigned long)); - encode_chunk(buf,3,out); -} - -unsigned long encode(char *in, unsigned long length, char *out) -{ -unsigned long used=0,len=0; - while(used> 2); - *(out+1)=ENC((in[0] << 4)|(((len<2 ? 0 : in[1]) >> 4) & 0xF)); - *(out+2)=ENC(((len<2 ? 0 : in[1]) << 2)|(((len<3 ? 0 : in[2]) >> 6) & 0x3)); - *(out+3)=ENC((len<3 ? 0 : in[2])); -} - -void decode_chunk(char *in, char *out) -{ - *out = DEC(*in) << 2 | DEC(in[1]) >> 4; - *(out+1) = DEC(in[1]) << 4 | DEC(in[2]) >> 2; - *(out+2) = DEC(in[2]) << 6 | DEC(in[3]); -} - void dump_message_column(unsigned char *buffer, unsigned long length, std::string leader, FILE *to) { unsigned long i,j; diff --git a/common/misc.h b/common/misc.h index b33f2f32d..a099ab823 100644 --- a/common/misc.h +++ b/common/misc.h @@ -17,13 +17,6 @@ int Tokenize(std::string s, std::map & tokens, char delim='|'); void LoadItemDBFieldNames(); -void encode_length(unsigned long length, char *out); -unsigned long decode_length(char *in); -unsigned long encode(char *in, unsigned long length, char *out); -void decode(char *in, char *out); -void encode_chunk(char *in, int len, char *out); -void decode_chunk(char *in, char *out); - #ifndef WIN32 int print_stacktrace(); #endif