<commit_before>#ifndef DEDICATED_ONLY

#include "sound_sample_openal.h"
#include "gusanos/resource_list.h"
#include "game/CGameObject.h"
#include "gusanos/allegro.h"

#ifdef __APPLE__
#ifndef __MACOSX__
#define __MACOSX__
#endif
#endif

#include <vorbis/vorbisfile.h>
#include <AL/al.h>
#include <AL/alut.h>
#include <stdio.h>
#include <vector>
#include <string>
#include <iostream>
#include <boost/algorithm/string.hpp>


using namespace std;


namespace
{
	const int BUFFER_SIZE = 32768;       // 32 KB buffers
}


// This function loads a .ogg file into a memory buffer and returns
// the format and frequency.
static bool LoadOGG(const char *fileName, vector<char> &buffer, ALenum &format, ALsizei &freq) {
    int endian = 0;                         // 0 for Little-Endian, 1 for Big-Endian
    int bitStream;
    long bytes;
    char array[BUFFER_SIZE];                // Local fixed size array
    FILE *f;
	
    // Open for binary reading
    f = OpenGameFile(fileName, "rb");
	
    if (f == NULL)
	{
        //cerr << "Cannot open " << fileName << " for reading..." << endl;
        return false;
	}
    // end if
	
    vorbis_info *pInfo = NULL;
    OggVorbis_File oggFile;
	
    // Try opening the given file
	// Note: Use ov_open_callbacks instead of ov_open to avoid problems
	// on Windows when linked to different libc versions.
    if (ov_open_callbacks(f, &oggFile, NULL, 0, OV_CALLBACKS_DEFAULT) != 0)
	{
        errors << "Error opening " << fileName << " for decoding..." << endl;
        return false;
	}
    // end if
	
    // Get some information about the OGG file
    pInfo = ov_info(&oggFile, -1);
	
    // Check the number of channels... always use 16-bit samples
    if (pInfo->channels == 1)
        format = AL_FORMAT_MONO16;
    else
        format = AL_FORMAT_STEREO16;
    // end if
	
    // The frequency of the sampling rate
    freq = pInfo->rate;
	
    // Keep reading until all is read
    do
	{
        // Read up to a buffer's worth of decoded sound data
        bytes = ov_read(&oggFile, array, BUFFER_SIZE, endian, 2, 1, &bitStream);
		
        if (bytes < 0)
		{
            ov_clear(&oggFile);
            errors << "Error decoding " << fileName << "..." << endl;
			return false;
		}
        // end if
		
        // Append to end of buffer
        buffer.insert(buffer.end(), array, array + bytes);
	}
    while (bytes > 0);<commit_msg>fix warning<commit_after>#ifndef DEDICATED_ONLY

#include "sound_sample_openal.h"
#include "gusanos/resource_list.h"
#include "game/CGameObject.h"
#include "gusanos/allegro.h"

#ifdef __APPLE__
#ifndef __MACOSX__
#define __MACOSX__
#endif
#endif

#include <vorbis/vorbisfile.h>
#include <AL/al.h>
#include <AL/alut.h>
#include <stdio.h>
#include <vector>
#include <string>
#include <iostream>
#include <boost/algorithm/string.hpp>


using namespace std;


namespace
{
	const int BUFFER_SIZE = 32768;       // 32 KB buffers
}


// This function loads a .ogg file into a memory buffer and returns
// the format and frequency.
static bool LoadOGG(const char *fileName, vector<char> &buffer, ALenum &format, ALsizei &freq) {
    int endian = 0;                         // 0 for Little-Endian, 1 for Big-Endian
    int bitStream;
    long bytes;
    char array[BUFFER_SIZE];                // Local fixed size array
    FILE *f;
	
    // Open for binary reading
    f = OpenGameFile(fileName, "rb");
	
    if (f == NULL)
	{
        //cerr << "Cannot open " << fileName << " for reading..." << endl;
        return false;
	}
    // end if
	
    vorbis_info *pInfo = NULL;
    OggVorbis_File oggFile;
	
    // Try opening the given file
	// Note: Use ov_open_callbacks instead of ov_open to avoid problems
	// on Windows when linked to different libc versions.
    if (ov_open_callbacks(f, &oggFile, NULL, 0, OV_CALLBACKS_DEFAULT) != 0)
	{
        errors << "Error opening " << fileName << " for decoding..." << endl;
        return false;
	}
    // end if
	
    // Get some information about the OGG file
    pInfo = ov_info(&oggFile, -1);
	
    // Check the number of channels... always use 16-bit samples
    if (pInfo->channels == 1)
        format = AL_FORMAT_MONO16;
    else
        format = AL_FORMAT_STEREO16;
    // end if
	
    // The frequency of the sampling rate
    freq = (ALsizei) pInfo->rate;
	
    // Keep reading until all is read
    do
	{
        // Read up to a buffer's worth of decoded sound data
        bytes = ov_read(&oggFile, array, BUFFER_SIZE, endian, 2, 1, &bitStream);
		
        if (bytes < 0)
		{
            ov_clear(&oggFile);
            errors << "Error decoding " << fileName << "..." << endl;
			return false;
		}
        // end if
		
        // Append to end of buffer
        buffer.insert(buffer.end(), array, array + bytes);
	}
    while (bytes > 0);
{'fraction_non_alphanumeric': 0.11740041928721175, 'fraction_numerical': 0.010062893081761006, 'mean_word_length': 2.400570206699929, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 27, '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': '908651', 'n_tokens_mistral': 1633, 'n_tokens_neox': 1528, 'n_words': 495}