[libvirt] [PATCH v3] json: fix interface locale dependency

Martin Kletzander mkletzan at redhat.com
Sun Aug 12 07:55:24 UTC 2012


I'm trying to get a optimized and reusable version of the code fixing
libvirt's locale dependency.

This time I'm sending two versions of the patch:

 v1) adds static function virNumberToStr() that converts one number to
     string base on a parameter defining the format. For float, double
     and long double there are functions that should be used in the code.

 v2) adds function for converting only double to string. This version has
     also a little bit differently separated the conditional code.

I personally like the second version better. for two reasons. 1) it looks
better, 2) there is no need for special-formatting with C locale unless
the result is being parsed by machine in which case the '%lf' is always
sufficient.

Martin Kletzander (1):
  json: fix interface locale dependency

 bootstrap.conf           |    1 +
 configure.ac             |    2 +-
 src/libvirt_private.syms |    3 +
 src/util/json.c          |    2 +-
 src/util/util.c          |  137 ++++++++++++++++++++++++++++++++++++++++++++++
 src/util/util.h          |    7 ++
 6 files changed, 150 insertions(+), 2 deletions(-)

--
1.7.8.6




More information about the libvir-list mailing list