<commit_before>#include <stdio.h>
#include <malloc.h>
#include <dirent.h>
#include <sys/stat.h>
#include <string.h>
#include <errno.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/param.h>
#include "dragonfs.h"
#include "dfsinternal.h"

#if BYTE_ORDER == BIG_ENDIAN
#define SWAPLONG(i) (i)
#else
#define SWAPLONG(i) (((uint32_t)(i & 0xFF000000) >> 24) | ((uint32_t)(i & 0x00FF0000) >>  8) | ((uint32_t)(i & 0x0000FF00) <<  8) | ((uint32_t)(i & 0x000000FF) << 24))
#endif

uint8_t *dfs = NULL;
uint32_t fs_size = 0;

/* Offset from start of filesystem */
inline int32_t sector_offset(void *sector)
{
    uint32_t x = (uint32_t)sector - (uint32_t)dfs;

    return x;
}

inline void *sector_to_memory(uint32_t offset)
{
    return (void *)(dfs + offset);
}

/* Add a new sector to the filesystem, return that sector pointer */
uint32_t new_sector()
{
    void *end;

    if(!dfs)
    {
        dfs = malloc(SECTOR_SIZE);
        fs_size = SECTOR_SIZE;

        end = dfs;
    }
    else
    {
        dfs = realloc(dfs, fs_size + SECTOR_SIZE);
<commit_msg>Fixes compiler warning that led to compile error.<commit_after>#include <stdio.h>
#include <malloc.h>
#include <dirent.h>
#include <sys/stat.h>
#include <string.h>
#include <errno.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/param.h>
#include "dragonfs.h"
#include "dfsinternal.h"

#if BYTE_ORDER == BIG_ENDIAN
#define SWAPLONG(i) (i)
#else
#define SWAPLONG(i) (((uint32_t)(i & 0xFF000000) >> 24) | ((uint32_t)(i & 0x00FF0000) >>  8) | ((uint32_t)(i & 0x0000FF00) <<  8) | ((uint32_t)(i & 0x000000FF) << 24))
#endif

uint8_t *dfs = NULL;
uint32_t fs_size = 0;

/* Offset from start of filesystem */
inline uint32_t sector_offset(void *sector)
{
    uint32_t x = (uint8_t *)sector - dfs;

    return x;
}

inline void *sector_to_memory(uint32_t offset)
{
    return (void *)(dfs + offset);
}

/* Add a new sector to the filesystem, return that sector pointer */
uint32_t new_sector()
{
    void *end;

    if(!dfs)
    {
        dfs = malloc(SECTOR_SIZE);
        fs_size = SECTOR_SIZE;

        end = dfs;
    }
    else
    {
        dfs = realloc(dfs, fs_size + SECTOR_SIZE);

{'fraction_non_alphanumeric': 0.1556997219647822, 'fraction_numerical': 0.052363299351251155, 'mean_word_length': 3.5741525423728815, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '5961793', 'n_tokens_mistral': 971, 'n_tokens_neox': 868, 'n_words': 208}