<commit_before>#include <limits.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>

#define BUFFER_SIZE 65536

unsigned int group_size;
unsigned int groups_per_line;
unsigned int skip;
unsigned int counter;

char* usage_string = "bd [-g N] [-l N] [-s N] [file]\n";
char* unknown_error_string = "ERROR: unknown error during option parsing\n";
char* unknown_opt_string = "ERROR: unknown option ";

static void
print_bytes(char* buffer, ssize_t n_bytes)
{
	ssize_t i;
	int bit;

	for (i = 0; i < n_bytes * CHAR_BIT; i++, counter++) {
		if (counter < skip)
			continue;

		bit = !!(buffer[i/8] & (1 << (i % CHAR_BIT)));
		write(STDOUT_FILENO, bit ? "1" : "0", 1);

		if (((counter+1) % (group_size * groups_per_line)) == 0)
			write(STDOUT_FILENO, "\n", 1);
		else if ((counter+1) % group_size == 0)
			write(STDOUT_FILENO, " ", 1);
	}
}
<commit_msg>added const qualifiers<commit_after>#include <limits.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>

#define BUFFER_SIZE 65536

unsigned int group_size;
unsigned int groups_per_line;
unsigned int skip;
unsigned int counter;

const char* usage_string = "bd [-g N] [-l N] [-s N] [file]\n";
const char* unknown_error_string = "ERROR: unknown error during option parsing\n";
const char* unknown_opt_string = "ERROR: unknown option ";

static void
print_bytes(char* buffer, ssize_t n_bytes)
{
	ssize_t i;
	int bit;

	for (i = 0; i < n_bytes * CHAR_BIT; i++, counter++) {
		if (counter < skip)
			continue;

		bit = !!(buffer[i/8] & (1 << (i % CHAR_BIT)));
		write(STDOUT_FILENO, bit ? "1" : "0", 1);

		if (((counter+1) % (group_size * groups_per_line)) == 0)
			write(STDOUT_FILENO, "\n", 1);
		else if ((counter+1) % group_size == 0)
			write(STDOUT_FILENO, " ", 1);
	}
}

{'fraction_non_alphanumeric': 0.16712479384277076, 'fraction_numerical': 0.018691588785046728, 'mean_word_length': 4.416666666666667, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 15, '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': '1380870', 'n_tokens_mistral': 765, 'n_tokens_neox': 700, 'n_words': 199}