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

typedef struct
{
	int *head;
	int length, capacity;
} array_t;

void die(void)
{
	perror("Whoops!");
	exit(1);
}

array_t *createArray(void)
{
	array_t newArray;
	newArray.length = 0;
	newArray.capacity = 4;
	newArray.head = calloc(sizeof(int), newArray.capacity);
	if(newArray.head == NULL) die();
	return &newArray;
}

int appendNumber(int x, array_t **target)
{
	if(((array_t *)*target)->length == ((array_t *)*target)->capacity)
	{
		array_t *newArray = realloc((array_t *)*target, sizeof(int) * ((array_t *)*target)->capacity * 2);
		if(newArray == NULL) return 0;
		*target = newArray;
		((array_t *)*target)->capacity = ((array_t *)*target)->capacity * 2;
	}
	((array_t *)*target)->head[((array_t *)*target)->length++] = x;
	return 1;
}

int main(void)
{
	array_t *myArray = createArray();

	printf("%d\n", myArray->head[0]);
	printf("%p\n", myArray->head);
	printf("%p\n", myArray);

	if(appendNumber(5, &myArray))
	{
		printf("Success!\n");
		printf("%p\n", myArray);
		printf("%p\n", myArray->head);
		printf("%d\n", myArray->head[0]);
	}
	return 0;
}
<commit_msg>Changed some stuff.<commit_after>#include <stdio.h>
#include <stdlib.h>

typedef struct
{
	int *head;
	int length, capacity;
} array_t;

void die(void)
{
	perror("Whoops!");
	exit(1);
}

array_t *createArray(void)
{
	array_t *newArray = calloc(sizeof(array_t), 1);
	newArray->length = 0;
	newArray->capacity = 4;
	newArray->head = calloc(sizeof(int), newArray.capacity);
	if(newArray->head == NULL) die();
	return newArray;
}

int appendNumber(int x, array_t *target)
{
	if(target->length == target->capacity)
	{
		void *temp = realloc(target->head, sizeof(int) * target->capacity * 2);
		if(temp == NULL) return 0;
		target->head = temp;
	}
	target->head[length++] = x;
	return 1;
}

int main(void)
{
	array_t *myArray = createArray();

	printf("%d\n", myArray->head[0]);
	printf("%p\n", myArray->head);
	printf("%p\n", myArray);

	if(appendNumber(5, &myArray))
	{
		printf("Success!\n");
		printf("%p\n", myArray);
		printf("%p\n", myArray->head);
		printf("%d\n", myArray->head[0]);
	}
	return 0;
}

{'fraction_non_alphanumeric': 0.21304551853589865, 'fraction_numerical': 0.010323791647114031, 'mean_word_length': 4.841095890410959, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 32, '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': '218086', 'n_tokens_mistral': 883, 'n_tokens_neox': 841, 'n_words': 169}