groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Strange error messages from Groff 1.22.3


From: Werner LEMBERG
Subject: Re: [Groff] Strange error messages from Groff 1.22.3
Date: Sun, 09 Nov 2014 08:46:21 +0100 (CET)

>> I was imagining something primitive, e.g. a working equivalent to
>> 
>>   #if defined(__MSDOS__) || (defined(_WIN32) && !defined(__CYGWIN__))
>>   # define DOS2UNIX_FILENAME(f) dos2unix_filename(f)
>>   #else
>>   # define DOS2UNIX_FILENAME(f) (f)
>>   #endif
> 
> But then the non-Windows code will have to call strsave and strcpy
> unnecessarily, because we cannot modify 'const char *' strings.  If
> that's okay with you, doing the above is easy; I was trying not to
> incur that overhead on Posix platforms.

Well, `do_file' is the function called in the top-level loop, called
once per file, thus the overhead is very small – and the slight
degradation of efficiency in `table.cpp' is OK with me.

I suggest to use a `string' object for the filename string so that we
have automatic deallocation; dos2unix_file can then use a `string &'
parameter to get a slight C++ touch :-)


    Werner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]