Commit 87cb36e4 authored by Albert Astals Cid's avatar Albert Astals Cid

Fix compilation: Adapt to kentities.cc change

Sorry ^_^
parent ff5f23eb
......@@ -48,17 +48,9 @@
#include <kdebug.h>
#include <stdlib.h>
#ifdef __GNUC__
// The main tokenizer includes this too so we are getting two copies of the data. However, this way the code gets inlined.
#include "kentities.c"
#else
// Not inlined for non-GCC compilers
struct entity {
const char* name;
int code;
};
const struct entity *kde_findEntity (register const char *str, register unsigned int len);
#endif
namespace Aux {
#include "kentities.cc"
}
#define PRELOAD_DEBUG 0
......@@ -265,7 +257,7 @@ unsigned ProspectiveTokenizer::consumeEntity(TokenizerString& source, bool& notE
// This is the attribute only version, generic version matches somewhat differently
while (entityName.size() <= 8) {
if (cc == ';') {
const entity* e = kde_findEntity(entityName.data(), entityName.size());
const Aux::entity* e = Aux::Perfect_Hash::kde_findEntity(entityName.data(), entityName.size());
if (e) {
source.advance();
return e->code;
......@@ -273,7 +265,7 @@ unsigned ProspectiveTokenizer::consumeEntity(TokenizerString& source, bool& notE
break;
}
if (!(cc >= 'a' && cc <= 'z') && !(cc >= 'A' && cc <= 'Z') && !(cc >= '0' && cc <= '9')) {
const entity* e = kde_findEntity(entityName.data(), entityName.size());
const Aux::entity* e = Aux::Perfect_Hash::kde_findEntity(entityName.data(), entityName.size());
if (e)
return e->code;
break;
......
......@@ -53,7 +53,7 @@
#include <config.h>
#include "kentities.c"
#include "kentities.cc"
#include "htmlprospectivetokenizer.h"
#define PROSPECTIVE_TOKENIZER_ENABLED 1
......@@ -1014,7 +1014,7 @@ void HTMLTokenizer::parseEntity(TokenizerString &src, QChar *&dest, bool start)
// be IE compatible and interpret even unterminated entities
// outside tags. like "foo &nbspstuff bla".
if ( tag == NoTag ) {
const entity* e = kde_findEntity(cBuffer, cBufferPos);
const entity* e = Perfect_Hash::kde_findEntity(cBuffer, cBufferPos);
if ( e && e->code < 256 ) {
EntityChar = e->code;
entityLen = cBufferPos;
......@@ -1024,7 +1024,7 @@ void HTMLTokenizer::parseEntity(TokenizerString &src, QChar *&dest, bool start)
if(cBufferPos == 9) Entity = SearchSemicolon;
if(Entity == SearchSemicolon) {
if(cBufferPos > 1) {
const entity *e = kde_findEntity(cBuffer, cBufferPos);
const entity *e = Perfect_Hash::kde_findEntity(cBuffer, cBufferPos);
// IE only accepts unterminated entities < 256,
// Gecko accepts them all, but only outside tags
if(e && ( tag == NoTag || e->code < 256 || *src == ';' )) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment