void
check_ligature_infinite_loops(void)
{
    unsigned key;

    for (key = 0; key < PRIME; key++) {
        hash_list tt = hash_table[key];
        while (tt != NULL) {
            if (tt->new_class > LIG_SIMPLE)
                l_f(tt, tt->x, tt->y);
            tt = tt->ptr;
        }
    }

    if (y_lig_cycle != CHAR_BOUNDARY) {
        if (x_lig_cycle == CHAR_BOUNDARY) {
            warning_1("Infinite ligature loop starting with boundary and %d",
                      y_lig_cycle);
        } else {
            warning_2("Infinite ligature loop starting with %d and %d",
                      x_lig_cycle, y_lig_cycle);
        }
        clear_ligature_entries();
        nl = 0; bchar = CHAR_BOUNDARY; bchar_label = MAX_LABEL;
    }
}
static int
l_eval(unsigned x, unsigned y)
{
    hash_list h;

    if ((x==CHAR_ERROR) || (y==CHAR_ERROR)) return CHAR_ERROR;
    h = l_hash_lookup(x, y);
    if (h == NULL) return y;
    return l_f(h, x, y);
}
Exemple #3
0
size_t File::bz2CompressFile(const wstring& p_file, const wstring& p_file_bz2)
{
	size_t l_outSize = 0;
	int64_t l_size = File::getSize(p_file);
	if (l_size > 0)
	{
		unique_ptr<byte[]> l_inData(new byte[l_size]);
		File l_f(p_file, File::READ, File::OPEN, false);
		size_t l_read_size = l_size;
		l_f.read(l_inData.get(), l_read_size);
		if (l_read_size == static_cast<uint64_t>(l_size))
		{
			unique_ptr<OutputStream> l_outFilePtr(new File(p_file_bz2, File::WRITE, File::TRUNCATE | File::CREATE, false));
			FilteredOutputStream<BZFilter, false> l_outFile(l_outFilePtr.get());
			l_outSize += l_outFile.write(l_inData.get(), l_size);
			l_outSize += l_outFile.flush();
		}
	}
	return l_outSize;
}