<commit_before>//
//  DynamicArray.c
//
//
//  Created by <NAME> on 8/11/15.
//
//

#include "DynamicArray.h"

#pragma mark - Inner Function

static void *itemAt(const Array *pArr, int index) {
    return pArr->pData + index * pArr->itemSize;
}

#pragma mark - Make Array

Array *ArrayInit(int itemSize) {
    if (itemSize <= 0) {
        return NULL;
    }
    
    Array *pArr = (Array *)malloc(sizeof(Array));
    if (!pArr) {
        return NULL;
    }
    
    pArr->pData = NULL;
    pArr->itemSize = itemSize;
    pArr->length = 0;
    
    return pArr;
}

Array *ArrayInitWithLength(int itemSize, int initLen) {
    if (initLen < 0) {
        return NULL;
    }<commit_msg>adjust to fit in VS<commit_after>//
//  DynamicArray.c
//
//
//  Created by <NAME> on 8/11/15.
//
//

#include "DynamicArray.h"

#pragma mark - Inner Function

static void *itemAt(const Array *pArr, int index) {
    return (void *)((char *)(pArr->pData) + index * pArr->itemSize);
}

#pragma mark - Make Array

Array *ArrayInit(int itemSize) {
    if (itemSize <= 0) {
        return NULL;
    }
    
    Array *pArr = (Array *)malloc(sizeof(Array));
    if (!pArr) {
        return NULL;
    }
    
    pArr->pData = NULL;
    pArr->itemSize = itemSize;
    pArr->length = 0;
    
    return pArr;
}

Array *ArrayInitWithLength(int itemSize, int initLen) {
    if (initLen < 0) {
        return NULL;
    }
{'fraction_non_alphanumeric': 0.14697406340057637, 'fraction_numerical': 0.011527377521613832, 'mean_word_length': 2.268235294117647, 'pattern_counts': {'":': 0, '<': 9, '<?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': '452698', 'n_tokens_mistral': 518, 'n_tokens_neox': 500, 'n_words': 130}