Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package inih for openSUSE:Factory checked in at 2023-07-08 22:46:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/inih (Old) and /work/SRC/openSUSE:Factory/.inih.new.23466 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "inih" Sat Jul 8 22:46:30 2023 rev:7 rq:1097525 version:57 Changes: -------- --- /work/SRC/openSUSE:Factory/inih/inih.changes 2022-07-21 11:33:17.894943146 +0200 +++ /work/SRC/openSUSE:Factory/.inih.new.23466/inih.changes 2023-07-08 22:46:36.146928335 +0200 @@ -1,0 +2,7 @@ +Fri Jul 7 13:37:21 UTC 2023 - Matthias Bach <ma...@marix.org> - 57 + +- Update to version 57 + * Added a GetUnsigned function for getting unsigned values. + * Added GetInteger64 and GetUnsigned64 to read 64-bit integers. + +------------------------------------------------------------------- @@ -4 +11 @@ -- Update to version 55 +- Update to version 56 @@ -7 +13,0 @@ - Old: ---- inih-r56.tar.gz New: ---- inih-r57.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ inih.spec ++++++ --- /var/tmp/diff_new_pack.Z6PqTt/_old 2023-07-08 22:46:37.314935356 +0200 +++ /var/tmp/diff_new_pack.Z6PqTt/_new 2023-07-08 22:46:37.322935404 +0200 @@ -1,7 +1,7 @@ # # spec file for package inih # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # Copyright (c) 2020 Matthias Bach <ma...@marix.org> # # All modifications and additions to the file contributed by third parties @@ -18,7 +18,7 @@ Name: inih -Version: 56 +Version: 57 Release: 0 Summary: Simple .INI file parser in C, good for embedded systems License: BSD-3-Clause ++++++ inih-r56.tar.gz -> inih-r57.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/inih-r56/cpp/INIReader.cpp new/inih-r57/cpp/INIReader.cpp --- old/inih-r56/cpp/INIReader.cpp 2022-07-12 11:20:53.000000000 +0200 +++ new/inih-r57/cpp/INIReader.cpp 2023-07-07 04:00:45.000000000 +0200 @@ -56,6 +56,36 @@ return end > value ? n : default_value; } +INI_API int64_t INIReader::GetInteger64(const std::string& section, const std::string& name, int64_t default_value) const +{ + string valstr = Get(section, name, ""); + const char* value = valstr.c_str(); + char* end; + // This parses "1234" (decimal) and also "0x4D2" (hex) + int64_t n = strtoll(value, &end, 0); + return end > value ? n : default_value; +} + +unsigned long INIReader::GetUnsigned(const string& section, const string& name, unsigned long default_value) const +{ + string valstr = Get(section, name, ""); + const char* value = valstr.c_str(); + char* end; + // This parses "1234" (decimal) and also "0x4D2" (hex) + unsigned long n = strtoul(value, &end, 0); + return end > value ? n : default_value; +} + +INI_API uint64_t INIReader::GetUnsigned64(const std::string& section, const std::string& name, uint64_t default_value) const +{ + string valstr = Get(section, name, ""); + const char* value = valstr.c_str(); + char* end; + // This parses "1234" (decimal) and also "0x4D2" (hex) + uint64_t n = strtoull(value, &end, 0); + return end > value ? n : default_value; +} + double INIReader::GetReal(const string& section, const string& name, double default_value) const { string valstr = Get(section, name, ""); @@ -69,7 +99,8 @@ { string valstr = Get(section, name, ""); // Convert to lower case to make string comparisons case-insensitive - std::transform(valstr.begin(), valstr.end(), valstr.begin(), ::tolower); + std::transform(valstr.begin(), valstr.end(), valstr.begin(), + [](const unsigned char& ch) { return static_cast<unsigned char>(::tolower(ch)); }); if (valstr == "true" || valstr == "yes" || valstr == "on" || valstr == "1") return true; else if (valstr == "false" || valstr == "no" || valstr == "off" || valstr == "0") @@ -98,7 +129,8 @@ { string key = section + "=" + name; // Convert to lower case to make section/name lookups case-insensitive - std::transform(key.begin(), key.end(), key.begin(), ::tolower); + std::transform(key.begin(), key.end(), key.begin(), + [](const unsigned char& ch) { return static_cast<unsigned char>(::tolower(ch)); }); return key; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/inih-r56/cpp/INIReader.h new/inih-r57/cpp/INIReader.h --- old/inih-r56/cpp/INIReader.h 2022-07-12 11:20:53.000000000 +0200 +++ new/inih-r57/cpp/INIReader.h 2023-07-07 04:00:45.000000000 +0200 @@ -14,6 +14,7 @@ #include <map> #include <string> +#include <cstdint> // Visibility symbols, required for Windows DLLs #ifndef INI_API @@ -66,6 +67,18 @@ // not found or not a valid integer (decimal "1234", "-1234", or hex "0x4d2"). INI_API long GetInteger(const std::string& section, const std::string& name, long default_value) const; + // Get a 64-bit integer (int64_t) value from INI file, returning default_value if + // not found or not a valid integer (decimal "1234", "-1234", or hex "0x4d2"). + INI_API int64_t GetInteger64(const std::string& section, const std::string& name, int64_t default_value) const; + + // Get an unsigned integer (unsigned long) value from INI file, returning default_value if + // not found or not a valid unsigned integer (decimal "1234", or hex "0x4d2"). + INI_API unsigned long GetUnsigned(const std::string& section, const std::string& name, unsigned long default_value) const; + + // Get an unsigned 64-bit integer (uint64_t) value from INI file, returning default_value if + // not found or not a valid unsigned integer (decimal "1234", or hex "0x4d2"). + INI_API uint64_t GetUnsigned64(const std::string& section, const std::string& name, uint64_t default_value) const; + // Get a real (floating point double) value from INI file, returning // default_value if not found or not a valid floating point value // according to strtod(). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/inih-r56/examples/INIReaderExample.cpp new/inih-r57/examples/INIReaderExample.cpp --- old/inih-r56/examples/INIReaderExample.cpp 2022-07-12 11:20:53.000000000 +0200 +++ new/inih-r57/examples/INIReaderExample.cpp 2023-07-07 04:00:45.000000000 +0200 @@ -12,7 +12,10 @@ return 1; } std::cout << "Config loaded from 'test.ini': version=" - << reader.GetInteger("protocol", "version", -1) << ", name=" + << reader.GetInteger("protocol", "version", -1) << ", unsigned version=" + << reader.GetUnsigned("protocol", "version", -1) << ", trillion=" + << reader.GetInteger64("user", "trillion", -1) << ", unsigned trillion=" + << reader.GetUnsigned64("user", "trillion", -1) << ", name=" << reader.Get("user", "name", "UNKNOWN") << ", email=" << reader.Get("user", "email", "UNKNOWN") << ", pi=" << reader.GetReal("user", "pi", -1) << ", active=" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/inih-r56/examples/cpptest.txt new/inih-r57/examples/cpptest.txt --- old/inih-r56/examples/cpptest.txt 2022-07-12 11:20:53.000000000 +0200 +++ new/inih-r57/examples/cpptest.txt 2023-07-07 04:00:45.000000000 +0200 @@ -1,3 +1,3 @@ -Config loaded from 'test.ini': version=6, name=Bob Smith, email=b...@smith.com, pi=3.14159, active=1 +Config loaded from 'test.ini': version=6, unsigned version=6, trillion=1000000000000, unsigned trillion=1000000000000, name=Bob Smith, email=b...@smith.com, pi=3.14159, active=1 Has values: user.name=1, user.nose=0 Has sections: user=1, fizz=0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/inih-r56/examples/test.ini new/inih-r57/examples/test.ini --- old/inih-r56/examples/test.ini 2022-07-12 11:20:53.000000000 +0200 +++ new/inih-r57/examples/test.ini 2023-07-07 04:00:45.000000000 +0200 @@ -1,10 +1,11 @@ ; Test config file for ini_example.c and INIReaderTest.cpp -[protocol] ; Protocol configuration -version=6 ; IPv6 +[protocol] ; Protocol configuration +version=6 ; IPv6 [user] -name = Bob Smith ; Spaces around '=' are stripped -email = b...@smith.com ; And comments (like this) ignored -active = true ; Test a boolean -pi = 3.14159 ; Test a floating point number +name = Bob Smith ; Spaces around '=' are stripped +email = b...@smith.com ; And comments (like this) ignored +active = true ; Test a boolean +pi = 3.14159 ; Test a floating point number +trillion = 1000000000000 ; Test 64-bit integers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/inih-r56/meson.build new/inih-r57/meson.build --- old/inih-r56/meson.build 2022-07-12 11:20:53.000000000 +0200 +++ new/inih-r57/meson.build 2023-07-07 04:00:45.000000000 +0200 @@ -27,7 +27,7 @@ endif sol_comment_prefix = get_option('start-of-line_comment_prefix') if sol_comment_prefix != ';#' - arg_static += ['-DINI_START_COMMENT_PREFIXES="' + start-of-line_comment_prefix + '"'] + arg_static += ['-DINI_START_COMMENT_PREFIXES="' + sol_comment_prefix + '"'] endif if get_option('allow_no_value') arg_static += ['-DINI_ALLOW_NO_VALUE=1']