<commit_before>#ifndef PIXMAP_HPP
#define PIXMAP_HPP
#include <cstddef>
#include <cstdlib>
namespace Seven {

class Pixmap {
    unsigned char *data_;
    int width_;
    int height_;
    std::size_t rowbytes_;
    int channel_count_;

    void zero() {
        data_ = nullptr;
        width_ = 0;
        height_ = 0;
        rowbytes_ = 0;
        channel_count_ = 0;
    }

public:
    static const int MAX_SIZE = 32768;

    std::size_t calculate_rowbytes(int width, int channel_count);

    Pixmap() { zero(); }
    Pixmap(const Pixmap &) = delete;
    Pixmap(Pixmap &&p)
        : data_(p.data_), width_(p.width_), height_(p.height_),
          rowbytes_(p.rowbytes_), channel_count_(p.channel_count_) {
        p.zero();
    }
    Pixmap(int width, int height, int channel_count);

    Pixmap &operator=(const Pixmap &) = delete;
    Pixmap &operator=(Pixmap &&p) {
        std::free(data_);
        data_ = p.data_;
        width_ = p.width_;
        height_ = p.height_;
        rowbytes_ = p.rowbytes_;
        channel_count_ = p.channel_count_;
        p.zero();
        return *this;
    }
    ~Pixmap() {
        std::free(data_);
    }

    void clear() {
        std::free(data_);
        zero();
    }

    bool empty() const { return data_ == nullptr; }
    const unsigned char *data() const { return data_; }
    unsigned char *data() { return data_; }
    const unsigned char *row(int i) const { return data_ + rowbytes_ * i; }
    unsigned char *row(int i) { return data_ + rowbytes_ * i; }
    int width() const { return width_; }
    int height() const { return height_; }
    int rowbytes() const { return rowbytes_; }
    int channel_count() const { return channel_count_; }

    void premultiply_alpha();
};

namespace PNG {
Pixmap load(const void *data, std::size_t size);
}

}
#endif<commit_msg>Fix return type of Pixmap::rowbytes()<commit_after>#ifndef PIXMAP_HPP
#define PIXMAP_HPP
#include <cstddef>
#include <cstdlib>
namespace Seven {

class Pixmap {
    unsigned char *data_;
    int width_;
    int height_;
    std::size_t rowbytes_;
    int channel_count_;

    void zero() {
        data_ = nullptr;
        width_ = 0;
        height_ = 0;
        rowbytes_ = 0;
        channel_count_ = 0;
    }

public:
    static const int MAX_SIZE = 32768;

    std::size_t calculate_rowbytes(int width, int channel_count);

    Pixmap() { zero(); }
    Pixmap(const Pixmap &) = delete;
    Pixmap(Pixmap &&p)
        : data_(p.data_), width_(p.width_), height_(p.height_),
          rowbytes_(p.rowbytes_), channel_count_(p.channel_count_) {
        p.zero();
    }
    Pixmap(int width, int height, int channel_count);

    Pixmap &operator=(const Pixmap &) = delete;
    Pixmap &operator=(Pixmap &&p) {
        std::free(data_);
        data_ = p.data_;
        width_ = p.width_;
        height_ = p.height_;
        rowbytes_ = p.rowbytes_;
        channel_count_ = p.channel_count_;
        p.zero();
        return *this;
    }
    ~Pixmap() {
        std::free(data_);
    }

    void clear() {
        std::free(data_);
        zero();
    }

    bool empty() const { return data_ == nullptr; }
    const unsigned char *data() const { return data_; }
    unsigned char *data() { return data_; }
    const unsigned char *row(int i) const { return data_ + rowbytes_ * i; }
    unsigned char *row(int i) { return data_ + rowbytes_ * i; }
    int width() const { return width_; }
    int height() const { return height_; }
    std::size_t rowbytes() const { return rowbytes_; }
    int channel_count() const { return channel_count_; }

    void premultiply_alpha();
};

namespace PNG {
Pixmap load(const void *data, std::size_t size);
}

}
#endif
{'fraction_non_alphanumeric': 0.12398042414355628, 'fraction_numerical': 0.004893964110929853, 'mean_word_length': 2.547733847637416, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1250083', 'n_tokens_mistral': 1253, 'n_tokens_neox': 1185, 'n_words': 321}