This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 5/5] Refactor tst-strtod-round.c for type-generic-ness


On Mon, 16 May 2016, Paul E. Murphy wrote:

> +  FTYPE f = strto ## FSUF (s, NULL);				\
> +  if (f != expected-> FSUF					\
> +      || (copysign ## CSUF)(1.0 ## LSUF, f)			\
> +	 != (copysign ## CSUF)(1.0 ## LSUF, expected-> FSUF))	\

Missing space between ')' and '(' in function call.  Spurious space after 
"->".

> +      FTOSTR(efstr, FSTRLENMAX, "%" FTOSTRM "a", expected-> FSUF); \
> +      FTOSTR(fstr, FSTRLENMAX, "%" FTOSTRM "a", f);		\

More missing and spurious spaces

> +      printf ("strto" #FSUF "(%s) returned %s not %s"		\
> +	      "(%s)\n", s, fstr, efstr, mode_name);		\
> +      if ((round_ok & RND_OK ## FSUF) != 0  || exact-> FSUF)	\

Another spurious space, and should only have one space before "||".

> +    ((ROUNDING_TESTS(float, m) ? RND_OKf : 0)  |	    \
> +    (ROUNDING_TESTS(double, m) ? RND_OKd : 0)  |	    \
> +    (ROUNDING_TESTS(long double, m) ? _RND_OKld : 0 ))

Missing spaces in macro calls.  Operators go at the start of the line, not 
at the end of the line.

> +/* Declare a member element for each floating point type
> +   with a suffix matching FSUF above.  */
> +#define STRUCT_FOREACH_TYPE(n)	\
> +  float n ## f;			\
> +  double n ## d;		\
> +  long double n ## ld;		\

The last line of a macro definition should not have a backslash-newline 
that effectively continues it onto the following blank line.

> +struct test_exactness
> +  {
> +  STRUCT_FOREACH_TYPE( )
> +  };
> +
> +struct test_results
> +  {
> +  STRUCT_FOREACH_TYPE( )

Missing space before '(', spurious space inside parentheses.

Please send an updated patch series with fixes for the various issues 
noted.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]