Skip to content
Snippets Groups Projects
Commit 7b9ceda1 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Added String.__HAVE_SPRINTF_NEGATIVE_F__ to indicate litte endian support for %F.

Updated Autodoc.

Rev: lib/modules/String.pmod/module.pmod:1.33
Rev: src/modules/sprintf/sprintf.c:1.165
parent 3822e2d1
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,8 @@ constant string2hex = __builtin.string2hex; ...@@ -18,7 +18,8 @@ constant string2hex = __builtin.string2hex;
constant hex2string = __builtin.hex2string; constant hex2string = __builtin.hex2string;
constant secure = __builtin.string_secure; constant secure = __builtin.string_secure;
constant __HAVE_SPRINTF_STAR_MAPPING__ = global.sprintf.__HAVE_SPRINTF_STAR_MAPPING__; constant __HAVE_SPRINTF_STAR_MAPPING__ = 1;
constant __HAVE_SPRINTF_NEGATIVE_F__ = 1;
//! This function implodes a list of words to a readable string, e.g. //! This function implodes a list of words to a readable string, e.g.
//! @expr{({"straw","berry","pie"})@} becomes //! @expr{({"straw","berry","pie"})@} becomes
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
|| This file is part of Pike. For copyright information see COPYRIGHT. || This file is part of Pike. For copyright information see COPYRIGHT.
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
|| for more information. || for more information.
|| $Id: sprintf.c,v 1.164 2009/04/19 19:17:31 grubba Exp $ || $Id: sprintf.c,v 1.165 2009/04/19 19:34:15 grubba Exp $
*/ */
/* TODO: use ONERROR to cleanup fsp */ /* TODO: use ONERROR to cleanup fsp */
...@@ -164,7 +164,9 @@ ...@@ -164,7 +164,9 @@
*! Like @tt{%e@}, but uses uppercase @tt{E@} for exponent. *! Like @tt{%e@}, but uses uppercase @tt{E@} for exponent.
*! @value 'F' *! @value 'F'
*! Binary IEEE representation of float (@tt{%4F@} gives *! Binary IEEE representation of float (@tt{%4F@} gives
*! single precision, @tt{%8F@} gives double precision.) *! single precision, @tt{%8F@} gives double precision)
*! in network (big endian) byte order. To get little endian
*! byte order, negate the field size.
*! @value 's' *! @value 's'
*! String. *! String.
*! @value 'q' *! @value 'q'
...@@ -213,6 +215,11 @@ ...@@ -213,6 +215,11 @@
*! This support can be tested for with the constant *! This support can be tested for with the constant
*! @[String.__HAVE_SPRINTF_STAR_MAPPING__]. *! @[String.__HAVE_SPRINTF_STAR_MAPPING__].
*! *!
*! @note
*! Support for specifying little endian byte order to @expr{'F'@}
*! was added in Pike 7.8. This support can be tested for with the
*! constant @[String.__HAVE_SPRINTF_NEGATIVE_F__].
*!
*! @example *! @example
*! @code *! @code
*! Pike v7.4 release 13 running Hilfe v3.5 (Incremental Pike Frontend) *! Pike v7.4 release 13 running Hilfe v3.5 (Incremental Pike Frontend)
...@@ -311,7 +318,8 @@ ...@@ -311,7 +318,8 @@
*! *!
*! @seealso *! @seealso
*! @[lfun::_sprintf()], @[strict_sprintf_format], @[sprintf_format], *! @[lfun::_sprintf()], @[strict_sprintf_format], @[sprintf_format],
*! @[sprintf_args], @[String.__HAVE_SPRINTF_STAR_MAPPING__]. *! @[sprintf_args], @[String.__HAVE_SPRINTF_STAR_MAPPING__],
*! @[String.__HAVE_SPRINTF_NEGATIVE_F__].
*/ */
#include "global.h" #include "global.h"
#include "pike_error.h" #include "pike_error.h"
...@@ -2614,6 +2622,15 @@ void f___handle_sprintf_format(INT32 args) ...@@ -2614,6 +2622,15 @@ void f___handle_sprintf_format(INT32 args)
*! @[sprintf()], @[lfun::_sprintf()] *! @[sprintf()], @[lfun::_sprintf()]
*/ */
/*! @decl constant __HAVE_SPRINTF_NEGATIVE_F__ = 1
*!
*! Presence of this symbol indicates that @[sprintf()] supports
*! little endian output for the @tt{'F'@}-format specifier.
*!
*! @seealso
*! @[sprintf()], @[lfun::_sprintf()]
*/
/*! @endmodule /*! @endmodule
*/ */
...@@ -2660,8 +2677,6 @@ PIKE_MODULE_INIT ...@@ -2660,8 +2677,6 @@ PIKE_MODULE_INIT
OPT_TRY_OPTIMIZE, OPT_TRY_OPTIMIZE,
optimize_sprintf, optimize_sprintf,
0); 0);
add_integer_constant("__HAVE_SPRINTF_STAR_MAPPING__",1,0);
} }
PIKE_MODULE_EXIT PIKE_MODULE_EXIT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment