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

DM Smith dmsmith at crosswire.org
Mon Mar 17 03:45:04 MST 2014


Chris,
I thought that the \r\n was part of the module specification. I'll need to verify that such a change doesn't hurt JSword. I don't think it will.
DM

On Mar 17, 2014, at 5:30 AM, chrislit at crosswire.org wrote:

> Author: chrislit
> Date: 2014-03-17 02:30:15 -0700 (Mon, 17 Mar 2014)
> New Revision: 3134
> 
> Modified:
>   trunk/include/rawstr.h
>   trunk/include/rawstr4.h
>   trunk/include/rawverse.h
>   trunk/include/rawverse4.h
>   trunk/src/modules/common/rawstr.cpp
>   trunk/src/modules/common/rawstr4.cpp
>   trunk/src/modules/common/rawverse.cpp
>   trunk/src/modules/common/rawverse4.cpp
> Log:
> regularized declaration/use of nl constant in the four classes that use it (We should consider sticking this somewhere else common to all four classes.)
> regularized nl to '\n' (It was occasionally "\r\n".)
> 
> 
> Modified: trunk/include/rawstr.h
> ===================================================================
> --- trunk/include/rawstr.h	2014-03-17 07:44:26 UTC (rev 3133)
> +++ trunk/include/rawstr.h	2014-03-17 09:30:15 UTC (rev 3134)
> @@ -49,7 +49,7 @@
> 	static const int IDXENTRYSIZE;
> 
> public:
> -	static char nl;
> +	static const char nl;
> 	RawStr(const char *ipath, int fileMode = -1, bool caseSensitive = false);
> 	virtual ~RawStr();
> 	void getIDXBuf(long ioffset, char **buf) const;
> 
> Modified: trunk/include/rawstr4.h
> ===================================================================
> --- trunk/include/rawstr4.h	2014-03-17 07:44:26 UTC (rev 3133)
> +++ trunk/include/rawstr4.h	2014-03-17 09:30:15 UTC (rev 3134)
> @@ -48,7 +48,7 @@
> 	void doSetText(const char *key, const char *buf, long len = -1);
> 	void doLinkEntry(const char *destkey, const char *srckey);
> public:
> -	char nl;
> +	static const char nl;
> 	RawStr4(const char *ipath, int fileMode = -1, bool caseSensitive = false);
> 	virtual ~RawStr4();
> 	void getIDXBuf(long ioffset, char **buf) const;
> 
> Modified: trunk/include/rawverse.h
> ===================================================================
> --- trunk/include/rawverse.h	2014-03-17 07:44:26 UTC (rev 3133)
> +++ trunk/include/rawverse.h	2014-03-17 09:30:15 UTC (rev 3134)
> @@ -47,7 +47,7 @@
> 	void doLinkEntry(char testmt, long destidxoff, long srcidxoff);
> 
> public:
> -	static const char *nl;
> +	static const char nl;
> 	RawVerse(const char *ipath, int fileMode = -1);
> 	virtual ~RawVerse();
> 	void findOffset(char testmt, long idxoff, long *start,	unsigned short *end) const;
> 
> Modified: trunk/include/rawverse4.h
> ===================================================================
> --- trunk/include/rawverse4.h	2014-03-17 07:44:26 UTC (rev 3133)
> +++ trunk/include/rawverse4.h	2014-03-17 09:30:15 UTC (rev 3134)
> @@ -48,7 +48,7 @@
> 	void doLinkEntry(char testmt, long destidxoff, long srcidxoff);
> 
> public:
> -	static const char *nl;
> +	static const char nl;
> 	RawVerse4(const char *ipath, int fileMode = -1);
> 	virtual ~RawVerse4();
> 	void findOffset(char testmt, long idxoff, long *start,	unsigned long *end) const;
> 
> Modified: trunk/src/modules/common/rawstr.cpp
> ===================================================================
> --- trunk/src/modules/common/rawstr.cpp	2014-03-17 07:44:26 UTC (rev 3133)
> +++ trunk/src/modules/common/rawstr.cpp	2014-03-17 09:30:15 UTC (rev 3134)
> @@ -43,7 +43,7 @@
>  */
> 
> int RawStr::instance = 0;
> -char RawStr::nl = '\n';
> +const char RawStr::nl = '\n';
> const int RawStr::IDXENTRYSIZE = 6;
> 
> 
> @@ -372,7 +372,6 @@
> 	__s32 shiftSize;
> 	__u16 size;
> 	__u16 outsize;
> -	static const char nl[] = {13, 10};
> 	char *tmpbuf = 0;
> 	char *key = 0;
> 	char *dbKey = 0;
> @@ -452,7 +451,7 @@
> 		datfd->write(outbuf, (int)size);
> 
> 		// add a new line to make data file easier to read in an editor
> -		datfd->write(&nl, 2);
> +		datfd->write(&nl, 1);
> 		
> 		idxfd->write(&outstart, 4);
> 		idxfd->write(&outsize, 2);
> 
> Modified: trunk/src/modules/common/rawstr4.cpp
> ===================================================================
> --- trunk/src/modules/common/rawstr4.cpp	2014-03-17 07:44:26 UTC (rev 3133)
> +++ trunk/src/modules/common/rawstr4.cpp	2014-03-17 09:30:15 UTC (rev 3134)
> @@ -44,6 +44,7 @@
>  */
> 
> int RawStr4::instance = 0;
> +const char RawStr4::nl = '\n';
> const int RawStr4::IDXENTRYSIZE = 8;
> 
> 
> @@ -59,7 +60,6 @@
> {
> 	SWBuf buf;
> 
> -	nl = '\n';
> 	lastoff = -1;
> 	path = 0;
> 	stdstr(&path, ipath);
> @@ -380,7 +380,6 @@
> 	__s32 shiftSize;
> 	__u32 size;
> 	__u32 outsize;
> -	static const char nl[] = {13, 10};
> 	char *tmpbuf = 0;
> 	char *key = 0;
> 	char *dbKey = 0;
> @@ -460,7 +459,7 @@
> 		datfd->write(outbuf, (long)size);
> 
> 		// add a new line to make data file easier to read in an editor
> -		datfd->write(&nl, 2);
> +		datfd->write(&nl, 1);
> 		
> 		idxfd->write(&outstart, 4);
> 		idxfd->write(&outsize, 4);
> 
> Modified: trunk/src/modules/common/rawverse.cpp
> ===================================================================
> --- trunk/src/modules/common/rawverse.cpp	2014-03-17 07:44:26 UTC (rev 3133)
> +++ trunk/src/modules/common/rawverse.cpp	2014-03-17 09:30:15 UTC (rev 3134)
> @@ -45,7 +45,7 @@
>  */
> 
> int RawVerse::instance = 0;
> -const char *RawVerse::nl = "\r\n";
> +const char RawVerse::nl = '\n';
> 
> 
> /******************************************************************************
> @@ -194,7 +194,7 @@
> 		textfp[testmt-1]->write(buf, (int)size);
> 
> 		// add a new line to make data file easier to read in an editor
> -		textfp[testmt-1]->write(nl, 2);
> +		textfp[testmt-1]->write(&nl, 1);
> 	}
> 	else {
> 		start = 0;
> 
> Modified: trunk/src/modules/common/rawverse4.cpp
> ===================================================================
> --- trunk/src/modules/common/rawverse4.cpp	2014-03-17 07:44:26 UTC (rev 3133)
> +++ trunk/src/modules/common/rawverse4.cpp	2014-03-17 09:30:15 UTC (rev 3134)
> @@ -46,7 +46,7 @@
>  */
> 
> int RawVerse4::instance = 0;
> -const char *RawVerse4::nl = "\r\n";
> +const char RawVerse4::nl = '\n';
> 
> 
> /******************************************************************************
> @@ -195,7 +195,7 @@
> 		textfp[testmt-1]->write(buf, (int)size);
> 
> 		// add a new line to make data file easier to read in an editor
> -		textfp[testmt-1]->write(nl, 2);
> +		textfp[testmt-1]->write(&nl, 1);
> 	}
> 	else {
> 		start = 0;
> 
> 
> _______________________________________________
> sword-cvs mailing list
> sword-cvs at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-cvs

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4145 bytes
Desc: not available
URL: <http://www.crosswire.org/pipermail/sword-cvs/attachments/20140317/182144d3/attachment.p7s>


More information about the sword-cvs mailing list