<commit_before>// coding: utf-8
/* Copyright (c) 2015, Roboterclub Aachen e. V.
 * All Rights Reserved.
 *
 * The file is part of the xpcc library and is released under the 3-clause BSD
 * license. See the file `LICENSE` for the full license governing this code.
 */
// ----------------------------------------------------------------------------

#include <stdint.h>
#include <xpcc/io/iostream.hpp>
#include <xpcc/architecture/utils.hpp>
#include <xpcc/architecture/interface/can_message.hpp>

namespace xpcc
{

namespace can
{

xpcc::IOStream&
operator << (xpcc::IOStream& s, const xpcc::can::Message m)
{
    s.printf("id = %04x, len = %2d, flags = %c%c, data = ",
             m.identifier, m.length,
             m.flags.rtr ? 'R' : 'r',
             m.flags.extended ? 'E' : 'e');
    for (uint_fast8_t ii = 0; ii < m.length; ++ii) {
        s.printf("%02x ", m.data[ii]);
    }
    return s;
}

}
}<commit_msg>Avoid buggy implementation of printf.<commit_after>// coding: utf-8
/* Copyright (c) 2015, Roboterclub Aachen e. V.
 * All Rights Reserved.
 *
 * The file is part of the xpcc library and is released under the 3-clause BSD
 * license. See the file `LICENSE` for the full license governing this code.
 */
// ----------------------------------------------------------------------------

#include <stdint.h>
#include <xpcc/io/iostream.hpp>
#include <xpcc/architecture/utils.hpp>
#include <xpcc/architecture/interface/can_message.hpp>

namespace xpcc
{

namespace can
{

xpcc::IOStream&
operator << (xpcc::IOStream& s, const xpcc::can::Message m)
{
    s.printf("id = %04x, len = ", m.identifier);
    s << m.length;
    s.printf(", flags = %c%c, data = ",
             m.flags.rtr ? 'R' : 'r',
             m.flags.extended ? 'E' : 'e');
    for (uint_fast8_t ii = 0; ii < m.length; ++ii) {
        s.printf("%02x ", m.data[ii]);
    }
    return s;
}

}
}
{'fraction_non_alphanumeric': 0.22899946495452114, 'fraction_numerical': 0.01337613697164259, 'mean_word_length': 2.1323283082077054, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6431952', 'n_tokens_mistral': 652, 'n_tokens_neox': 631, 'n_words': 175}