Fixes:
AmUtils.cpp: In function ‘bool str2int(const std::string&, double&)’:
AmUtils.cpp:286:21: warning: catching polymorphic type ‘const class std::invalid_argument’ by value [-Wcatch-value=]
286 | catch (const std::invalid_argument)
| ^~~~~~~~~~~~~~~~
AmUtils.cpp:290:21: warning: catching polymorphic type ‘const class std::out_of_range’ by value [-Wcatch-value=]
290 | catch (const std::out_of_range)
| ^~~~~~~~~~~~
Change-Id: I3d112aff65ea6e90803b6be7c138227a36975d9f
It's been noticed actually no result is written
by the reference given to a funciton helper.
Also it's not convenient with a rest of other
helpers, which return either true/false
on successfull or failed conversion, but just
directly return the result of atof() as a bool,
which is a mistake.
Also add a comment to a function declaration.
Change-Id: I4f18ce527638a3575ef7446a549650a951a0b583
Use a template to cover all signed- and unsigned- int-to-string
conversions. Based on a quick benchmark, this is the fastest alternative
(faster than sprintf and faster than using div/abs).
Change existing wrapper functions to use this template and let the
compiler optimise.
Change-Id: Id0512d0777407c8be442de0920f45d0751132ced
Use overloading for the various flavours of str2int functions. This has
the benefit of automatically choosing the appropriate function for
aliased types that may be one or the other underlying type, such as
size_t.
Do a mass renaming of all relevant instances.
Change-Id: I7abb6b9031ee53332d2b04a6cba4a6cc667a4807
SDP session origin id and version are limited by it's size
to 64 bits (8 bytes), that is because we are using `unsigned long long`
type for both id and version. Hence the maximum value it can hold
is two sixty-forth power, so equals: 18,446,744,073,709,551,615
In case one intentionally sets it to something like:
"o=- 18446744073709551615 18446744073709551615 IN IP4 192.168.0.1"
SEMS gets overwhelmed with that conversion inside the code make
it just to a string literal 'F'.
To overcome it, just use __uint128 (which is of 128bits size)
for the session origin id and version.
Change-Id: I2ad9659aa81dad79969749053dc3fd0d69e2cbd2
Use `unsigned long long` for SDP session id and version
instead of unsigned int.
Refactor all usage of them accordingly.
Additionally intrdouce new utils functions for conversion:
- `ulonglong2str()` - converts `unsigned long long` to `string`
- `str2ull()` - converts `string` to `unsigned long long`
Change-Id: I4210349a5442d4173b14227497f4a01d68cad7a4
- regex maps are files with regex=>value entries which,
once loaded, can be used with $M(key=>mapname) pattern replacement
- it is now possible to use replacements in active_profile, and
also a list of profiles can be specified here - the first matching
will be used
- static library sip_stack.a (with dependencies on the core).
- removed AmServer and moved SipCtrlInterface into the core directory.
- TODO:
- CMake support to make core/sip/sip_stack.a and link against it in the core.
- merge AmSipRequest/AmSipReply and sip_msg structures.
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1758 8eb893ce-cfd4-0310-b710-fb5ebe64c474