2017-09-08 16:00 UTC Viktor Szakats (vszakats users.noreply.github.com)
* *
* partial sync with the 3.4 fork codebase. These are the things
synces for the most part:
- copyright headers
- grammar/typos in comments and some readmes
- comment/whitespace/decorations
- variable scoping in C files
- DO CASE/SWITCH and some other alternate syntax usage
- minimal amount of human readable text in strings
- minor code updates
- HB_TRACE() void * casts for pointers and few other changes to
avoid C compiler warnings
- various other, minor code cleanups
- only Harbour/C code/headers were touched in src, utils, contrib,
include. No 3rd party code, no make files, and with just a few
exceptions, no 'tests' code was touched.
- certain components were not touched were 3.4 diverged too much
already, like f.e. hbmk2, hbssl, hbcurl, hbexpat
- the goal was that no actual program logic should be altered by
these changes. Except some possible minor exceptions, any such
change is probably a bug in this patch.
It's a massive patch, if you find anything broken after it, please
open an Issue with the details. Build test was done on macOS.
The goal is make it easier to see what actual code/logic was changed
in 3.4 compared to 3.2 and to make patches easier to apply in both
ways.
This commit is contained in:
@@ -45,13 +45,13 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
patterm format:
|
||||
pattern format:
|
||||
'%' [<flags>*] [<field width>] [.<precision>] [<length modifier>]
|
||||
<conversion specifier>
|
||||
*/
|
||||
|
||||
/*
|
||||
The folowwing conversions are not explicitly supported:
|
||||
The following conversions are not explicitly supported:
|
||||
A, a
|
||||
E, e
|
||||
G, g
|
||||
@@ -62,7 +62,7 @@
|
||||
S (or Ls)
|
||||
These are wide character conversions and needs locale settings.
|
||||
|
||||
double conversion if not necessary can be disabled to not create unnencessary
|
||||
double conversion if not necessary can be disabled to not create unnecessary
|
||||
overhead and/or references to math library by
|
||||
#define __NO_DOUBLE__
|
||||
It can be also greatly optimized anyhow it will increase dependences list and
|
||||
@@ -109,7 +109,7 @@
|
||||
|
||||
/* few macros for some platform dependent floating point functions/macros */
|
||||
|
||||
#if ( defined( __BORLANDC__ ) && __BORLANDC__ < 0x582 ) || \
|
||||
#if ( defined( __BORLANDC__ ) && __BORLANDC__ < 0x0582 ) || \
|
||||
( defined( __WATCOMC__ ) && __WATCOMC__ < 1270 ) || \
|
||||
defined( HB_OS_QNX ) || defined( HB_OS_SYMBIAN ) || \
|
||||
defined( __DCC__ ) || defined( __TINYC__ ) || \
|
||||
@@ -411,8 +411,7 @@ static size_t put_octal( char *buffer, size_t bufsize, size_t size,
|
||||
uintmax_t value, int flags, int width, int precision )
|
||||
{
|
||||
uintmax_t v = value;
|
||||
int nums = 0, n;
|
||||
char c;
|
||||
int nums = 0;
|
||||
|
||||
while( v )
|
||||
{
|
||||
@@ -439,10 +438,10 @@ static size_t put_octal( char *buffer, size_t bufsize, size_t size,
|
||||
}
|
||||
if( nums )
|
||||
{
|
||||
n = nums;
|
||||
int n = nums;
|
||||
do
|
||||
{
|
||||
c = ( char ) ( value & 0x7 ) + '0';
|
||||
char c = ( char ) ( value & 0x7 ) + '0';
|
||||
value >>= 3;
|
||||
--n;
|
||||
if( size + n < bufsize )
|
||||
@@ -467,8 +466,7 @@ static size_t put_dec( char *buffer, size_t bufsize, size_t size,
|
||||
int sign )
|
||||
{
|
||||
uintmax_t v = value;
|
||||
int nums = 0, n;
|
||||
char c;
|
||||
int nums = 0;
|
||||
|
||||
while( v )
|
||||
{
|
||||
@@ -499,15 +497,15 @@ static size_t put_dec( char *buffer, size_t bufsize, size_t size,
|
||||
if( ( flags & ( _F_SPACE | _F_SIGN ) ) || sign )
|
||||
{
|
||||
if( size < bufsize )
|
||||
buffer[ size ] = sign ? '-' : ( flags & _F_SIGN ? '+' : ' ' );
|
||||
buffer[ size ] = sign ? '-' : ( ( flags & _F_SIGN ) ? '+' : ' ' );
|
||||
++size;
|
||||
}
|
||||
if( nums )
|
||||
{
|
||||
n = nums;
|
||||
int n = nums;
|
||||
do
|
||||
{
|
||||
c = ( char ) ( value % 10 ) + '0';
|
||||
char c = ( char ) ( value % 10 ) + '0';
|
||||
value /= 10;
|
||||
--n;
|
||||
if( size + n < bufsize )
|
||||
@@ -571,7 +569,7 @@ static size_t put_dbl( char *buffer, size_t bufsize, size_t size,
|
||||
while( value >= 1 );
|
||||
width -= nums;
|
||||
c = ( ( flags & ( _F_SPACE | _F_SIGN ) ) || sign ) ?
|
||||
( buffer[ size ] = sign ? '-' : ( flags & _F_SIGN ? '+' : ' ' ) ) : 0;
|
||||
( buffer[ size ] = sign ? '-' : ( ( flags & _F_SIGN ) ? '+' : ' ' ) ) : 0;
|
||||
if( ( flags & _F_LEFTADJUSTED ) == 0 && width > 0 )
|
||||
{
|
||||
if( c && ( flags & _F_ZEROPADED ) )
|
||||
@@ -592,7 +590,7 @@ static size_t put_dbl( char *buffer, size_t bufsize, size_t size,
|
||||
if( c )
|
||||
{
|
||||
if( size < bufsize )
|
||||
buffer[ size ] = sign ? '-' : ( flags & _F_SIGN ? '+' : ' ' );
|
||||
buffer[ size ] = sign ? '-' : ( ( flags & _F_SIGN ) ? '+' : ' ' );
|
||||
++size;
|
||||
}
|
||||
|
||||
@@ -640,8 +638,7 @@ static size_t put_hex( char *buffer, size_t bufsize, size_t size,
|
||||
int upper )
|
||||
{
|
||||
uintmax_t v = value;
|
||||
int nums = 0, n;
|
||||
char c;
|
||||
int nums = 0;
|
||||
|
||||
while( v )
|
||||
{
|
||||
@@ -687,10 +684,10 @@ static size_t put_hex( char *buffer, size_t bufsize, size_t size,
|
||||
}
|
||||
if( nums )
|
||||
{
|
||||
n = nums;
|
||||
int n = nums;
|
||||
do
|
||||
{
|
||||
c = ( char ) ( value & 0x0f ) + '0';
|
||||
char c = ( char ) ( value & 0x0f ) + '0';
|
||||
if( c > '9' )
|
||||
c += upper ? 'A' - '9' - 1 : 'a' - '9' - 1;
|
||||
value >>= 4;
|
||||
@@ -1233,14 +1230,14 @@ int hb_vsnprintf( char * buffer, size_t bufsize, const char * format, va_list ap
|
||||
if( value & _HB_NUM_NAN )
|
||||
size = put_str( buffer, bufsize, size,
|
||||
c == 'f' ?
|
||||
( flags & _F_SIGN ? "+nan": "nan" ) :
|
||||
( flags & _F_SIGN ? "+NAN": "NAN" ) ,
|
||||
( ( flags & _F_SIGN ) ? "+nan": "nan" ) :
|
||||
( ( flags & _F_SIGN ) ? "+NAN": "NAN" ) ,
|
||||
flags, width, -1 );
|
||||
else if( value & _HB_NUM_PINF )
|
||||
size = put_str( buffer, bufsize, size,
|
||||
c == 'f' ?
|
||||
( flags & _F_SIGN ? "+inf": "inf" ) :
|
||||
( flags & _F_SIGN ? "+INF": "INF" ),
|
||||
( ( flags & _F_SIGN ) ? "+inf": "inf" ) :
|
||||
( ( flags & _F_SIGN ) ? "+INF": "INF" ),
|
||||
flags, width, -1 );
|
||||
else if( value & _HB_NUM_NINF )
|
||||
size = put_str( buffer, bufsize, size,
|
||||
|
||||
Reference in New Issue
Block a user