[sword-svn] r3750 - in trunk: include src/modules/common tests

scribe at crosswire.org scribe at crosswire.org
Thu Jul 9 17:29:59 EDT 2020


Author: scribe
Date: 2020-07-09 17:29:59 -0400 (Thu, 09 Jul 2020)
New Revision: 3750

Modified:
   trunk/include/bz2comprs.h
   trunk/include/lzsscomprs.h
   trunk/include/swcipher.h
   trunk/include/swcomprs.h
   trunk/include/swversion.h
   trunk/include/xzcomprs.h
   trunk/include/zipcomprs.h
   trunk/src/modules/common/lzsscomprs.cpp
   trunk/src/modules/common/swcipher.cpp
   trunk/src/modules/common/swcomprs.cpp
   trunk/src/modules/common/zipcomprs.cpp
   trunk/tests/complzss.cpp
   trunk/tests/compnone.cpp
   trunk/tests/compzip.cpp
Log:
Refactoring in baby steps as I can't figure out what is breaking my larger refactoring work.  Encode/Decode here.


Modified: trunk/include/bz2comprs.h
===================================================================
--- trunk/include/bz2comprs.h	2020-07-06 23:51:56 UTC (rev 3749)
+++ trunk/include/bz2comprs.h	2020-07-09 21:29:59 UTC (rev 3750)
@@ -37,8 +37,8 @@
 	Bzip2Compress();
 	virtual ~Bzip2Compress();
 
-	virtual void Encode(void);
-	virtual void Decode(void);
+	virtual void encode(void);
+	virtual void decode(void);
 };
 
 SWORD_NAMESPACE_END

Modified: trunk/include/lzsscomprs.h
===================================================================
--- trunk/include/lzsscomprs.h	2020-07-06 23:51:56 UTC (rev 3749)
+++ trunk/include/lzsscomprs.h	2020-07-09 21:29:59 UTC (rev 3750)
@@ -37,8 +37,8 @@
 public:
 	LZSSCompress ();
 	virtual ~LZSSCompress();
-	virtual void Encode(void);
-	virtual void Decode(void);
+	virtual void encode(void);
+	virtual void decode(void);
 };
 
 SWORD_NAMESPACE_END

Modified: trunk/include/swcipher.h
===================================================================
--- trunk/include/swcipher.h	2020-07-06 23:51:56 UTC (rev 3749)
+++ trunk/include/swcipher.h	2020-07-09 21:29:59 UTC (rev 3750)
@@ -47,8 +47,8 @@
     virtual ~ SWCipher ();
   virtual char *Buf (const char *buf = 0, unsigned long len = 0);
   virtual char *cipherBuf (unsigned long *len, const char *buf = 0);
-  virtual void Encode (void);
-  virtual void Decode (void);
+  virtual void encode (void);
+  virtual void decode (void);
   static SWBuf personalize(const SWBuf &buf, bool encode);
 };
 

Modified: trunk/include/swcomprs.h
===================================================================
--- trunk/include/swcomprs.h	2020-07-06 23:51:56 UTC (rev 3749)
+++ trunk/include/swcomprs.h	2020-07-09 21:29:59 UTC (rev 3750)
@@ -43,8 +43,8 @@
   virtual char *zBuf (unsigned long *len, char *buf = 0);
   virtual unsigned long GetChars (char *buf, unsigned long len);	// override for other than buffer compression
   virtual unsigned long SendChars (char *buf, unsigned long len);	// override for other than buffer compression
-  virtual void Encode (void);	// override to provide compression algorythm
-  virtual void Decode (void);	// override to provide compression algorythm
+  virtual void encode (void);	// override to provide compression algorythm
+  virtual void decode (void);	// override to provide compression algorythm
   virtual void setLevel(int l) {level = l;};
   virtual int getLevel() {return level;};
 };

Modified: trunk/include/swversion.h
===================================================================
--- trunk/include/swversion.h	2020-07-06 23:51:56 UTC (rev 3749)
+++ trunk/include/swversion.h	2020-07-09 21:29:59 UTC (rev 3750)
@@ -24,12 +24,12 @@
 #ifndef SWVERSION_H
 #define SWVERSION_H
 
-#define SWORD_VERSION_NUM 1089003744
-#define SWORD_VERSION_STR "1.8.900.3744"
+#define SWORD_VERSION_NUM 1089003749
+#define SWORD_VERSION_STR "1.8.900.3749"
 #define SWORD_VERSION_MAJOR 1
 #define SWORD_VERSION_MINOR 8
 #define SWORD_VERSION_MICRO 900
-#define SWORD_VERSION_NANO 3744
+#define SWORD_VERSION_NANO 3749
 
 #include <defs.h>
 SWORD_NAMESPACE_START

Modified: trunk/include/xzcomprs.h
===================================================================
--- trunk/include/xzcomprs.h	2020-07-06 23:51:56 UTC (rev 3749)
+++ trunk/include/xzcomprs.h	2020-07-09 21:29:59 UTC (rev 3750)
@@ -38,8 +38,8 @@
 	XzCompress();
 	virtual ~XzCompress();
 
-	virtual void Encode(void);
-	virtual void Decode(void);
+	virtual void encode(void);
+	virtual void decode(void);
 	virtual void setLevel(int l);
 private:
 	SW_u64 memlimit; // memory usage limit during decompression

Modified: trunk/include/zipcomprs.h
===================================================================
--- trunk/include/zipcomprs.h	2020-07-06 23:51:56 UTC (rev 3749)
+++ trunk/include/zipcomprs.h	2020-07-09 21:29:59 UTC (rev 3750)
@@ -37,8 +37,8 @@
 	ZipCompress();
 	virtual ~ZipCompress();
 
-	virtual void Encode(void);
-	virtual void Decode(void);
+	virtual void encode(void);
+	virtual void decode(void);
 };
 
 SWORD_NAMESPACE_END

Modified: trunk/src/modules/common/lzsscomprs.cpp
===================================================================
--- trunk/src/modules/common/lzsscomprs.cpp	2020-07-06 23:51:56 UTC (rev 3749)
+++ trunk/src/modules/common/lzsscomprs.cpp	2020-07-09 21:29:59 UTC (rev 3750)
@@ -355,7 +355,7 @@
 
 
 /******************************************************************************
- * LZSSCompress::Encode	- This function "encodes" the input stream into the
+ * LZSSCompress::encode	- This function "encodes" the input stream into the
  *						output stream.
  *						The GetChars() and SendChars() functions are
  *						used to separate this method from the actual
@@ -364,7 +364,7 @@
  * 						compressed buffer.
  */
 
-void LZSSCompress::Encode(void)
+void LZSSCompress::encode(void)
 {
 	short int i;						// an iterator
 	short int r;						// node number in the binary tree
@@ -601,14 +601,14 @@
 
 
 /******************************************************************************
- * LZSSCompress::Decode	- This function "decodes" the input stream into the
+ * LZSSCompress::decode	- This function "decodes" the input stream into the
  *						output stream.
  *						The GetChars() and SendChars() functions are
  *						used to separate this method from the actual
  *						i/o.
  */
 
-void LZSSCompress::Decode(void)
+void LZSSCompress::decode(void)
 {
 	int k;
 	int r;							  // node number

Modified: trunk/src/modules/common/swcipher.cpp
===================================================================
--- trunk/src/modules/common/swcipher.cpp	2020-07-06 23:51:56 UTC (rev 3749)
+++ trunk/src/modules/common/swcipher.cpp	2020-07-09 21:29:59 UTC (rev 3750)
@@ -82,7 +82,7 @@
 		cipher = false;
 	}
 
-	Decode();
+	decode();
 
 	return buf;
 }
@@ -101,7 +101,7 @@
 		cipher = true;
 	}
 
-	Encode();
+	encode();
 
 	*ilen = len;
 	return buf;
@@ -109,14 +109,14 @@
 
 
 /******************************************************************************
- * SWCipher::Encode	- This function "encodes" the input stream into the
+ * SWCipher::encode	- This function "encodes" the input stream into the
  *						output stream.
  *						The GetChars() and SendChars() functions are
  *						used to separate this method from the actual
  *						i/o.
  */
 
-void SWCipher::Encode(void)
+void SWCipher::encode(void)
 {
 	if (!cipher) {
 		work = master;
@@ -128,14 +128,14 @@
 
 
 /******************************************************************************
- * SWCipher::Decode	- This function "decodes" the input stream into the
+ * SWCipher::decode	- This function "decodes" the input stream into the
  *						output stream.
  *						The GetChars() and SendChars() functions are
  *						used to separate this method from the actual
  *						i/o.
  */
 
-void SWCipher::Decode(void)
+void SWCipher::decode(void)
 {
 	if (cipher) {
 		work = master;

Modified: trunk/src/modules/common/swcomprs.cpp
===================================================================
--- trunk/src/modules/common/swcomprs.cpp	2020-07-06 23:51:56 UTC (rev 3749)
+++ trunk/src/modules/common/swcomprs.cpp	2020-07-09 21:29:59 UTC (rev 3750)
@@ -85,7 +85,7 @@
 	if (!buf) {
 		buf = (char *)calloc(1,1); // be sure we at least allocate an empty buf for return;
 		direct = 1;
-		Decode();
+		decode();
 //		slen = strlen(buf);
 		if (len)
 			*len = slen;
@@ -107,7 +107,7 @@
 	// getting a compressed buffer
 	if (!zbuf) {
 		direct = 0;
-		Encode();
+		encode();
 	}
 
 	*len = zlen;
@@ -176,21 +176,21 @@
  *						i/o.
  */
 
-void SWCompress::Encode(void)
+void SWCompress::encode(void)
 {
 	cycleStream();
 }
 
 
 /******************************************************************************
- * SWCompress::Decode	- This function "decodes" the input stream into the
+ * SWCompress::decode	- This function "decodes" the input stream into the
  *						output stream.
  *						The GetChars() and SendChars() functions are
  *						used to separate this method from the actual
  *						i/o.
  */
 
-void SWCompress::Decode(void)
+void SWCompress::decode(void)
 {
 	cycleStream();
 }

Modified: trunk/src/modules/common/zipcomprs.cpp
===================================================================
--- trunk/src/modules/common/zipcomprs.cpp	2020-07-06 23:51:56 UTC (rev 3749)
+++ trunk/src/modules/common/zipcomprs.cpp	2020-07-09 21:29:59 UTC (rev 3750)
@@ -51,7 +51,7 @@
 
 
 /******************************************************************************
- * ZipCompress::Encode	- This function "encodes" the input stream into the
+ * ZipCompress::encode	- This function "encodes" the input stream into the
  *						output stream.
  *						The GetChars() and SendChars() functions are
  *						used to separate this method from the actual
@@ -60,7 +60,7 @@
  * 						compressed buffer.
  */
 
-void ZipCompress::Encode(void)
+void ZipCompress::encode(void)
 {
 /*
 ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
@@ -119,14 +119,14 @@
 
 
 /******************************************************************************
- * ZipCompress::Decode	- This function "decodes" the input stream into the
+ * ZipCompress::decode	- This function "decodes" the input stream into the
  *						output stream.
  *						The GetChars() and SendChars() functions are
  *						used to separate this method from the actual
  *						i/o.
  */
 
-void ZipCompress::Decode(void)
+void ZipCompress::decode(void)
 {
 /*
 ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,

Modified: trunk/tests/complzss.cpp
===================================================================
--- trunk/tests/complzss.cpp	2020-07-06 23:51:56 UTC (rev 3749)
+++ trunk/tests/complzss.cpp	2020-07-09 21:29:59 UTC (rev 3750)
@@ -52,8 +52,8 @@
 	~FileCompress();
 	unsigned long GetChars(char *, unsigned long len);
 	unsigned long SendChars(char *, unsigned long len);
-	void Encode();
-	void Decode();
+	void encode();
+	void decode();
 };
 
 
@@ -87,21 +87,21 @@
 }
 
 
-void FileCompress::Encode() 
+void FileCompress::encode() 
 {
 	ifd = ufd;
 	ofd = zfd;
 
-	LZSSCompress::Encode();
+	LZSSCompress::encode();
 }
 
 
-void FileCompress::Decode() 
+void FileCompress::decode() 
 {
 	ifd = zfd;
 	ofd = ufd;
 
-	LZSSCompress::Decode();
+	LZSSCompress::decode();
 }
 
 
@@ -125,8 +125,8 @@
 	fobj = new FileCompress(argv[1]);
 	
 	if (decomp)
-		fobj->Decode();
-	else fobj->Encode();
+		fobj->decode();
+	else fobj->encode();
 
 	delete fobj;
 }

Modified: trunk/tests/compnone.cpp
===================================================================
--- trunk/tests/compnone.cpp	2020-07-06 23:51:56 UTC (rev 3749)
+++ trunk/tests/compnone.cpp	2020-07-09 21:29:59 UTC (rev 3750)
@@ -52,8 +52,8 @@
 	~FileCompress();
 	unsigned long GetChars(char *, unsigned long len);
 	unsigned long SendChars(char *, unsigned long len);
-	void Encode();
-	void Decode();
+	void encode();
+	void decode();
 };
 
 
@@ -87,21 +87,21 @@
 }
 
 
-void FileCompress::Encode() 
+void FileCompress::encode() 
 {
 	ifd = ufd;
 	ofd = zfd;
 
-	SWCompress::Encode();
+	SWCompress::encode();
 }
 
 
-void FileCompress::Decode() 
+void FileCompress::decode() 
 {
 	ifd = zfd;
 	ofd = ufd;
 
-	SWCompress::Decode();
+	SWCompress::decode();
 }
 
 
@@ -125,8 +125,8 @@
 	fobj = new FileCompress(argv[1]);
 	
 	if (decomp)
-		fobj->Decode();
-	else fobj->Encode();
+		fobj->decode();
+	else fobj->encode();
 
 	delete fobj;
 }

Modified: trunk/tests/compzip.cpp
===================================================================
--- trunk/tests/compzip.cpp	2020-07-06 23:51:56 UTC (rev 3749)
+++ trunk/tests/compzip.cpp	2020-07-09 21:29:59 UTC (rev 3750)
@@ -50,8 +50,8 @@
 	~FileCompress();
 	unsigned long GetChars(char *, unsigned long len);
 	unsigned long SendChars(char *, unsigned long len);
-	void Encode();
-	void Decode();
+	void encode();
+	void decode();
 };
 
 
@@ -85,21 +85,21 @@
 }
 
 
-void FileCompress::Encode() 
+void FileCompress::encode() 
 {
 	ifd = ufd;
 	ofd = zfd;
 
-	ZipCompress::Encode();
+	ZipCompress::encode();
 }
 
 
-void FileCompress::Decode() 
+void FileCompress::decode() 
 {
 	ifd = zfd;
 	ofd = ufd;
 
-	ZipCompress::Decode();
+	ZipCompress::decode();
 }
 
 
@@ -123,8 +123,8 @@
 	fobj = new FileCompress(argv[1]);
 	
 	if (decomp)
-		fobj->Decode();
-	else fobj->Encode();
+		fobj->decode();
+	else fobj->encode();
 
 	delete fobj;
 	return 0;



More information about the sword-cvs mailing list