<commit_before>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "../inc/cc.h"
#include "../inc/sizes.h"
#include "cc1.h"

#define NR_SYM_HASH 64

static unsigned curctx;
static short localcnt;
static short globalcnt;

static Symbol *head;
static Symbol *htab[NR_SYM_HASH];

#ifndef NDEBUG
#include <stdio.h>
void
dumpstab(char *msg)
{
	Symbol **bp, *sym;

	fputs(msg, stderr);
	putc('\n', stderr);
	for (bp = htab; bp < &htab[NR_SYM_HASH]; ++bp) {
		if (*bp == NULL)
			continue;
		fprintf(stderr, "%d", bp - htab);
		for (sym = *bp; sym; sym = sym->hash)
			fprintf(stderr, "->%d:%s", sym->ns, sym->name);
		putc('\n', stderr);
	}
}
#endif

static unsigned
hash(const char *s)
{
	unsigned c, h;

	for (h = 0; c = *s; ++s)
		h ^= 33 * c;<commit_msg>Improve dumpstab()<commit_after>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "../inc/cc.h"
#include "../inc/sizes.h"
#include "cc1.h"

#define NR_SYM_HASH 64

static unsigned curctx;
static short localcnt;
static short globalcnt;

static Symbol *head;
static Symbol *htab[NR_SYM_HASH];

#ifndef NDEBUG
void
dumpstab(char *msg)
{
	Symbol **bp, *sym;

	fprintf(stderr, "%s\n", msg);
	for (bp = htab; bp < &htab[NR_SYM_HASH]; ++bp) {
		if (*bp == NULL)
			continue;
		fprintf(stderr, "%d", bp - htab);
		for (sym = *bp; sym; sym = sym->hash)
			fprintf(stderr, "->%d:%s", sym->ns, sym->name);
		putc('\n', stderr);
	}
}
#endif

static unsigned
hash(const char *s)
{
	unsigned c, h;

	for (h = 0; c = *s; ++s)
		h ^= 33 * c;
{'fraction_non_alphanumeric': 0.19756254008980115, 'fraction_numerical': 0.007697241821680564, 'mean_word_length': 3.9523809523809526, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 20, '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': '5341777', 'n_tokens_mistral': 708, 'n_tokens_neox': 667, 'n_words': 179}