| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
fprintf(..) + prepending the environment::getElapsedMillisecond() timestamp
|
|
|
|
| |
and to_decstring(), drop <type>[Hex|Dec]String(..)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'pointer_cast()' and 'bit_cast()' and have all byte-order conversion and get/set functions be of constexpr; Add generalized template [get|put]_value(..) and to_hex_string(..)
Cleanup
- Split basic_types.hpp -> basic_types.hpp + byte_util.hpp + int_types.hpp + string_util.hpp
- Moved nsize_t, snsize_t to int_types.hpp and
using 'uint_fast32_t' and 'int_fast32_t' as natural types.
- Renamed cpp_lang_macros.hpp -> cpp_lang_util.hpp
+++
Add constexpr 'enum class endian', 'pointer_cast()' and 'bit_cast()'
and have all byte-order conversion and get/set functions be of constexpr.
- Exposing '__builtin_bit_cast(Dest_type, arg)' via
'constexpr bool is_builtin_bit_cast_available()' and type traits.
- Adding constexpr bit_cast<>() template for C++17 (a C++20 std),
allowing constexpr type conversion using '__builtin_bit_cast(Dest_type, arg)',
if the latter is available.
- Adding constexpr pointer_cast<>() template,
allowing constexpr pointer type conversion.
Either using '__builtin_bit_cast(Dest_type, arg)' or reinterpret_cast<>().
- Add constexpr 'enum class endian' API,
providing compile-time C++ endian evaluation w/o predefined macros.
Inspired by C++20.
- Replace linux bswap_[16,32,64] with either __builtin_bswap[16,32,64] or own const definition,
both allowing constexpr
- Add unified overloaded 'constexpr bswap(uint[16,32,64,128,192,256]_t const &)'
using constexpr endian API.
- Have all [get|put]_<type>(..) operations be of constexpr,
using pointer_cast<>() instead of plain reinterpret_cast<>()
and the new 'constexpr bswap(..)' methods.
+++
Add generalized template [get|put]_value(..) and to_hex_string(..)
- Add generalized template 'constexpr T [get|put]_value(..) {}' for std::is_standard_layout_v<T>
- Add generalized template 'inline to_hex_string(T const &) {}' for std::is_standard_layout_v<T>
+++
All of the above is covered by unit test 'test_basictypecon.cpp' '-std=c++17':
- gcc 8.3.0 on arm32, arm64: __builtin_bit_cast() not available
- gcc 10.2.1 on amd64: __builtin_bit_cast() not available
- clang 9.0.1 on amd64, arm64: __builtin_bit_cast() is available
- clang 11.0.1 on amd64: __builtin_bit_cast() is available
Full build time (user) incl unit tests (C++ and Java) on GCC
- amd64 gcc 11.0.1, 32 cores: 1m38s
- arm64 gcc 8.3.0, 4 cores: 13m30s
- arm32 gcc 8.3.0, 4 cores: 17m58s
|
|
|
|
| |
always, denoting byte-order in a sensible strict way.
|
|
|
|
|
|
| |
RELEASE: strip native libs, no java debug symbols.
Do not install java sub-modules jaulib_base, jaulib_jni, jaulib_net nor jaulib_pkg.
|
|
|
|
| |
jaulib_pkg (WIP)
|
| |
|
| |
|
|
|
|
| |
authors: Added member function queries w/ return types and args
|
|
|
|
|
|
| |
locally stored std::string
Construct what_ std::string in ctor.
|
|
|
|
| |
user's hosting parent project to use 'add_subdirectory(jaulib)' for testing and header distribution
|
|
|
|
|
|
|
|
|
|
|
|
| |
(shared lib)
As I prepare to add more languages to this utility project, rename from jaucpp -> jaulib.
Also do not distribute a binarie, i.e. no installation of a share lib artifact.
This to emphasize the intention to have artifacts being included in the
user project directly, instead of linking.
This may change, but for now it serves for best efficiency
and removes binary distribution issues with the user's project.
|
| |
|
| |
|
|
|
|
| |
separator output (which depends on LANG and LC_MEASUREMENT environment.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
implementing <type>DecString() inline functions.
This generalizes earlier <type>SeparatedString() type specific functions
by type, minimum width and whether a seperator shall be actually used or not.
Hence allows replacing snprintf(..) for decimals altogether.
Implementation uses new jau::digits10<T>(T v)
as well as std::numeric_limits<T>::digits10 to determine
numbers of decimal digits of:
- the given value
- the maximum value of the integral template type
|
|
|
|
|
|
|
|
|
|
| |
inline (lower-case hex-strings)
Turns out, we could reduce our early implementation using 'snprintf(..)'
using our simple bytesHexString(..) loop and lookup implementation.
This removes 'snprintf(..)' format string parsing at least,
perhaps our bytesHexString(..) is also more optimal in other aspects.
|
|
|
|
| |
have the default output using lower-case hex characters
|
| |
|
|
|
|
|
| |
This revises commit 8e603953e960eb683c7fa00c9cf9fc39ab890c85
to use the smaller footprint nsize_t.
|
|
|
|
| |
avoid.
|
| |
|
| |
|
|
|
|
| |
settings for all, avoiding confusion.
|
|
|
|
| |
adding frames w/o proc-name
|
|
|
|
|
|
|
|
|
|
|
|
| |
__attribute__((__packed__))' access - much cheaper!
Utilizing a no-cost template struct having the __packed__ attribute
utilizes the compiler to generate safe load and store operations.
This is validated via '-Wcast-align=strict', which verifies safe pointer cast for all platforms
on the current compilation host.
This also lead to fixing merge_uint128(*) unsafe cast + assignment.
|
|
|
|
|
|
| |
Full Warnings = Error:
-Wall -Wextra -Wformat=2 -Wformat-overflow=2 -Wformat-nonliteral -Wformat-security
-Wformat-signedness -Wformat-y2k -Wnull-dereference -Winit-self -Werror
|
|
|
|
|
|
|
|
|
|
| |
for 'debug', 'debug_jni' and 'verbose' const fields.
Since environment is intended to be used for any project,
introduce 'root_prefix_domain' as set on the initial environment::get(..) call.
Use lower case 'debug' to avoid collision with DEBUG macro,
hence use all lower case const fields.
|
| |
|
| |
|
|
|
|
| |
jaucpp, namespace jau
|
|
|
|
| |
DBG_JNI_PRINT(); IRQ_PRINT(..) shall not print_backtrace().
|
|
|
|
| |
expose std::string backtrace via get_backtrace()
|
|
|
|
| |
starting @ 1, more efficient local cstr usage
|
|
|
|
|
|
|
|
|
| |
libunwind and abi::__cxa_demangle
The backtrace is used by default for
- direct_bt::ABORT(..)
- direct_bt::ERR_PRINT(..)
- direct_bt::RuntimeException::what()
|
|
|
|
|
|
|
|
|
| |
evaluation if condition is false
Following commit 581260d3f4144df3716eac736c9e8792be264edb
Also reverting COND_PRINT to drop __func__, __FILE__ and __LINE__
as not intended for this verbose ourput instrument (like DBG_PRINT etc).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
preprocessor!
Caught using Valgrind's helgrind 'possible data race' by producing the arguments for COND_PRINT
while condition was false - hence a waste of resources, not efficient.
The 'possible data race' itself was of no interest, just an informal vector<>::size(),
but the COND_PRINT caused to generate std::string instances even if not desired.
Here the preprocessor generates the conditional code and hides the arguments inside the
condition==true block.
Alternatively, we could use stdd::enbale_if<> template and/or lambdas etc,
see <https://en.cppreference.com/w/cpp/types/enable_if>.
However, this does its job.
|
|
|
|
| |
and process aborted; Use it.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
IRQ_PRINT(.. "Interrupted" ), to clarify class of event.
An interruption might not be an error, but expected behavior - e.g. if a device is powered off.
Use IRQ_ERROR in GattHandler on:
- l2cap write error -> disconnect + exception
- l2cap nullptr reply (sendWithReply) -> disconnect + exception
- l2cap read error (l2capReaderThread) -> disconnect
We might find other occassions where this informal output fits.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
uncond INFO_PRINT(..)
Turns out INFO_PRINT(..) is confusing, as it was not clear that it is conditional on DBTEnv::VERBOSE.
Hence rename it to the short English from for Latin 'verbosus',
and hence hinting it is conditional on DBTEnv::VERBOSE.
INFO_PRINT(..) renamed to WORDY_PRINT(..), using prefix 'Wordy:' (Verbose is just too long)
Add unconditional INFO_PRINT(..) for plain informal messages.
Hope this clears up the confusion.
Hint: I was looking for an INFO_PRINT(..) ouput myself ;-)
|
|
|
|
| |
uintXHexString(..) using ERR_PRINT and abort for internal error
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RELEASE Builds w/ -O3:
pre-opt:
2,131,720 dist-amd64/lib/libdirect_bt.so.2.1.20
noexcept round-1: (added OctetTypes _nc methods, hence offsetting reduction)
2,132,112 dist-amd64/lib/libdirect_bt.so.2.1.20
noexcept round-2: (reductions only) ~20k less
2,111,632 dist-amd64/lib/libdirect_bt.so.2.1.20
|
|
|
|
| |
OctetTypes and use them if allowed.
|
| |
|
|
|
|
|
|
| |
proper C++ functions
Dropping inline will also reduce footprint of library.
|
|
|
|
| |
for special cases (e.g. GATT_PRINT, ..)
|
|
|
|
| |
native libs commonly exposed in Java via BluetoothUtils.cxx JNI
|
|
|
|
| |
section with reference to used algo
|