<commit_before>"use strict";

/**
 * Class for reading DDS files
 *
 * Class for reading compressed texture data from microsoft Direct Draw Surface
 * files.
 */
function DDS(data)
{
	/// Width of the texture, in pixels
	this.width = 0;
	/// Height of the texture, in pixels
	this.height = 0;
	/// Format code of the data
	this.format = -1;
	/// Byte arrays for the compressed texture data, for each mipmap level
	this.mipmaps = [];
	/// Flag indicating whether the data was sucessfully loaded
	this.ok = false;

	var header = new Uint32Array(data, 0, DDS.header_length+1);
	if (header[0] != fourCC("DDS "))
	{
		logError("Not a DDS file");
		return;
	}

	var pixelFlags = header[20];
	if (!(pixelFlags & DDS.PixelFlags.DDPF_FOURCC))
	{
		logError("Unsupported DDS format (no fourCC code available");
		return;
	}

	this.format = unfourCC(header[21]);
	var blockSize = 0;
	switch (this.format)
	{
		case "DXT1":
			blockSize = 8;
			break;
		case "DXT5":
			blockSize = 16;
			break;
		default:
			logError("Unsupported DDS format " + format);
			return;
	}

	var nrMipmaps = 1;
	var flags = header[2];
	if (flags & DDS.Flags.DDSD_MIPMAPCOUNT)
		nrMipmaps = Math.max(nrMipmaps, header[7]);

	this.height = header[3];
	this.width = header[4];
<commit_msg>Fix reference to unidentified variable<commit_after>"use strict";

/**
 * Class for reading DDS files
 *
 * Class for reading compressed texture data from microsoft Direct Draw Surface
 * files.
 */
function DDS(data)
{
	/// Width of the texture, in pixels
	this.width = 0;
	/// Height of the texture, in pixels
	this.height = 0;
	/// Format code of the data
	this.format = -1;
	/// Byte arrays for the compressed texture data, for each mipmap level
	this.mipmaps = [];
	/// Flag indicating whether the data was sucessfully loaded
	this.ok = false;

	var header = new Uint32Array(data, 0, DDS.header_length+1);
	if (header[0] != fourCC("DDS "))
	{
		logError("Not a DDS file");
		return;
	}

	var pixelFlags = header[20];
	if (!(pixelFlags & DDS.PixelFlags.DDPF_FOURCC))
	{
		logError("Unsupported DDS format (no fourCC code available");
		return;
	}

	this.format = unfourCC(header[21]);
	var blockSize = 0;
	switch (this.format)
	{
		case "DXT1":
			blockSize = 8;
			break;
		case "DXT5":
			blockSize = 16;
			break;
		default:
			logError("Unsupported DDS format " + this.format);
			return;
	}

	var nrMipmaps = 1;
	var flags = header[2];
	if (flags & DDS.Flags.DDSD_MIPMAPCOUNT)
		nrMipmaps = Math.max(nrMipmaps, header[7]);

	this.height = header[3];
	this.width = header[4];

{'fraction_non_alphanumeric': 0.13041765169424743, 'fraction_numerical': 0.018124507486209612, 'mean_word_length': 3.4700704225352115, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, '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': '1471125', 'n_tokens_mistral': 983, 'n_tokens_neox': 904, 'n_words': 270}