<commit_before>//
//  HHArray.c
//  HHArray
//
//  Created by <NAME> on 4/21/15.
//  Copyright (c) 2015 harlanhaskins. All rights reserved.
//

#include <stdlib.h>
#include <string.h>
#include "utilities.h"

#define ITEM_SIZE sizeof(void *)

typedef struct HHArray_S {
    size_t size;
    size_t capacity;
    void **values;
} *HHArray;

#define _HHARRAY_DEFINED_
#include "HHArray.h"
#undef _HHARRAY_DEFINED_

const size_t DEFAULT_CAPACITY = 10;
const size_t HHArrayNotFound = SIZE_MAX;
const double RESIZE_FACTOR = 1.5;
const double LOAD_THRESHOLD = 0.75;


/**
 * Asserts that 'index' is less than 'highest', and otherwise causes an error and exits.
 */
static void assert_index(HHArray array, size_t highest, size_t index) {
    if (index > highest) {
        fprintf(stderr, "Array index %zu higher than highest index %zu.", index, highest);
        hharray_destroy(array);<commit_msg>Added stdint for SIZE_MAX<commit_after>//
//  HHArray.c
//  HHArray
//
//  Created by <NAME> on 4/21/15.
//  Copyright (c) 2015 harlanhaskins. All rights reserved.
//

#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "utilities.h"

#define ITEM_SIZE sizeof(void *)

typedef struct HHArray_S {
    size_t size;
    size_t capacity;
    void **values;
} *HHArray;

#define _HHARRAY_DEFINED_
#include "HHArray.h"
#undef _HHARRAY_DEFINED_

const size_t DEFAULT_CAPACITY = 10;
const size_t HHArrayNotFound = SIZE_MAX;
const double RESIZE_FACTOR = 1.5;
const double LOAD_THRESHOLD = 0.75;


/**
 * Asserts that 'index' is less than 'highest', and otherwise causes an error and exits.
 */
static void assert_index(HHArray array, size_t highest, size_t index) {
    if (index > highest) {
        fprintf(stderr, "Array index %zu higher than highest index %zu.", index, highest);
        hharray_destroy(array);
{'fraction_non_alphanumeric': 0.11576626240352811, 'fraction_numerical': 0.017640573318632856, 'mean_word_length': 3.7889182058047495, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 12, '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': '1819736', 'n_tokens_mistral': 687, 'n_tokens_neox': 627, 'n_words': 190}