<commit_before>#include "YImage.hpp"

#include <iostream>
#include <cassert>
#include <cstdlib>

#include <png.h>
#include <zlib.h> // For Z_BEST_SPEED

// for: #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
// we use this to determine the pixel format on the fly
#include <cstddef>

YImage::YImage()
	: m_width( 0 ), m_height( 0 ), m_data( NULL )
{
	assert( sizeof( YPixel ) == 4 && "YPixel struct shouldn't be padded" ) ;
}

YImage::YImage( const YImage& rhs )
	: m_width( 0 ), m_height( 0 ), m_data( NULL )
{
	*this = rhs ;
}

YImage&
YImage::operator=( const YImage& rhs )
{
    if( !rhs.m_data )
    {
        assert( 0 == rhs.m_width ) ;
        assert( 0 == rhs.m_height ) ;
        
        if( m_data ) free( m_data ) ;<commit_msg>GCC needs cstring for memcpy etc.<commit_after>#include "YImage.hpp"

#include <iostream>
#include <cassert>
#include <cstdlib>
#include <cstring>

#include <png.h>
#include <zlib.h> // For Z_BEST_SPEED

// for: #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
// we use this to determine the pixel format on the fly
#include <cstddef>

YImage::YImage()
	: m_width( 0 ), m_height( 0 ), m_data( NULL )
{
	assert( sizeof( YPixel ) == 4 && "YPixel struct shouldn't be padded" ) ;
}

YImage::YImage( const YImage& rhs )
	: m_width( 0 ), m_height( 0 ), m_data( NULL )
{
	*this = rhs ;
}

YImage&
YImage::operator=( const YImage& rhs )
{
    if( !rhs.m_data )
    {
        assert( 0 == rhs.m_width ) ;
        assert( 0 == rhs.m_height ) ;
        
        if( m_data ) free( m_data ) ;
{'fraction_non_alphanumeric': 0.1650548033526757, 'fraction_numerical': 0.010315925209542231, 'mean_word_length': 3.252054794520548, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 18, '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': '3976920', 'n_tokens_mistral': 621, 'n_tokens_neox': 604, 'n_words': 165}