<commit_before>#include <DrawingAlgoApp.h>

#include <algorithm>

#include <SFML/OpenGL.hpp>

// signum function
template <typename T> int sgn(T val) {
    return (T(0) < val) - (val < T(0));
}

//
// Pixel struct definition
DrawingAlgoApp::Pixel::Pixel()
    : R(0), G(0), B(0)
{}

DrawingAlgoApp::Pixel::Pixel(uint R, uint G, uint B)
    : R(R), G(G), B(B)
{}

DrawingAlgoApp::Pixel::Pixel(uint hex) {
    R = (hex & 0xFF0000) >> 2*8;
    G = (hex & 0x00FF00) >> 8;
    B = hex & 0x0000FF;
}

//
// DrawingAlgoApp class definition
DrawingAlgoApp::DrawingAlgoApp()
    : _width(800u),
    _height(600u),
    _num_pixels(_width*_height),
    _draw_type(DrawingType::None),
    _mouse_pos_cache(0, 0)
{
    _pixel_data.reset(new Pixel[_width*_height]);

    // clear pixel data
    memset(_pixel_data.get(), 0, _width*_height);
}
<commit_msg>fixed wrong initialization of the _pixel_data array<commit_after>#include <DrawingAlgoApp.h>

#include <algorithm>

#include <SFML/OpenGL.hpp>

// signum function
template <typename T> int sgn(T val) {
    return (T(0) < val) - (val < T(0));
}

//
// Pixel struct definition
DrawingAlgoApp::Pixel::Pixel()
    : R(0), G(0), B(0)
{}

DrawingAlgoApp::Pixel::Pixel(uint R, uint G, uint B)
    : R(R), G(G), B(B)
{}

DrawingAlgoApp::Pixel::Pixel(uint hex) {
    R = (hex & 0xFF0000) >> 2*8;
    G = (hex & 0x00FF00) >> 8;
    B = hex & 0x0000FF;
}

//
// DrawingAlgoApp class definition
DrawingAlgoApp::DrawingAlgoApp()
    : _width(800u),
    _height(600u),
    _num_pixels(_width*_height),
    _draw_type(DrawingType::None),
    _mouse_pos_cache(0, 0)
{
    _pixel_data.reset(new Pixel[_width*_height]);

    // clear pixel data
    memset(_pixel_data.get(), 0, sizeof(Pixel)*_width*_height);
}

{'fraction_non_alphanumeric': 0.17243367935409457, 'fraction_numerical': 0.03690888119953864, 'mean_word_length': 3.832869080779944, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, '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': '3304194', 'n_tokens_mistral': 730, 'n_tokens_neox': 685, 'n_words': 138}