static const char VALUE_TAG[] = "<value>";
static const char VALUE_ETAG[] = "</value>";
static const char BOOLEAN_TAG[] = "<boolean>";
static const char BOOLEAN_ETAG[] = "</boolean>";
static const char DOUBLE_TAG[] = "<double>";
static const char DOUBLE_ETAG[] = "</double>";
static const char INT_TAG[] = "<int>";
static const char INT_ETAG[] = "</int>";
static const char I4_TAG[] = "<i4>";
static const char I4_ETAG[] = "</i4>";
static const char STRING_TAG[] = "<string>";
static const char STRING_ETAG[] = "</string>";
static const char DATETIME_TAG[] = "<dateTime.iso8601>";
* Licence (BSD):
* ==============
{
private static final char[] CA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray();
private static final int[] IA = new int[256];
static {
Arrays.fill(IA, -1);
for (int i = 0, iS = CA.length; i < iS; i++)
IA[CA[i]] = i;
IA['='] = 0;
}
{
return encodeToByte(sArr, 0, sArr != null ? sArr.length : 0, lineSep);
// Encode the int into four chars
dArr[d++] = (byte) CA[(i >>> 18) & 0x3f];
//=========================================================================
// STRINGUTIL.CC - part of
//
//=========================================================================
{
if (txt!=NULL)
for (const char *s = txt; *s; s++)
if (!opp_isspace(*s))
return "";
while (opp_isspace(*txt))
txt++;
const char *end = txt + strlen(txt);
while (end>txt && opp_isspace(*(end-1)))
end--;
const char *endp;
std::string ret = opp_parsequotedstr(txt, endp);
* the parser will see the following XML-stream:
* <data name="n1">
* <data name="n2">
* <data name="n3" />
* as equivalent to the following XML-stream:
* <data name="n1" />
* <data name="n2" />
* <data name="n3" />
* This can be useful for badly-formed XML-streams but prevent the use
* have the same names):
* <data name="n1">
* <data name="n2">
* <data name="n3" />
* </data>
// for SPARC processors: wchar_t* buffers must always be alligned, otherwise it's a char* buffer.
if ((((unsigned long)b)%sizeof(wchar_t))!=0) return FALSE;
static bool g_clockInSync = false;
bool g_clockNeedsUpdate = true;
bool isClockInSync() {
if ( g_hostdb.m_initialized && g_hostdb.m_hostId == 0 ) return true;
bool print96 ( char *k ) {
key_t *kp = (key_t *)k;
printf("n1=0x%"XINT32" n0=0x%"XINT64"\n",(int32_t)kp->n1,(int64_t)kp->n0);
return true;
bool print96 ( key_t *kp ) {
printf("n1=0x%"XINT32" n0=0x%"XINT64"\n",(int32_t)kp->n1,(int64_t)kp->n0);
bool print128 ( char *k ) {
key128_t *kp = (key128_t *)k;
printf("n1=0x%"XINT64" n0=0x%"XINT64"\n",(int64_t)kp->n1,(int64_t)kp->n0);
const char g_map_is_upper[] = {
const void* SK_RESTRICT src, int n) {
SkASSERT(n > 0 && n <= 15);
uint8_t* d = (uint8_t*)dst;
switch (n) {
case 15: *d++ = *s++;
case 14: *d++ = *s++;
case 13: *d++ = *s++;
case 12: *d++ = *s++;
case 11: *d++ = *s++;
case 10: *d++ = *s++;
case 9: *d++ = *s++;
case 8: *d++ = *s++;
case 7: *d++ = *s++;
case 6: *d++ = *s++;
case 5: *d++ = *s++;
case 4: *d++ = *s++;
case 3: *d++ = *s++;
void CreatePaletteLut(Pixel24 *c, GPalette *Pal, int Scale = 255)
{
uchar *DivLut = Div255Lut;
for (int i=0; i<256; i++)
{
GdcRGB *p = (Pal) ? (*Pal)[i] : 0;
{
c[i].r = DivLut[p->R * Scale];
c[i].g = DivLut[p->G * Scale];
c[i].b = DivLut[p->B * Scale];
}
{
c[i].r = DivLut[i * Scale];
c[i].g = c[i].r;
* Licence (BSD):
* ==============
{
private static final char[] CA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray();
private static final int[] IA = new int[256];
static {
Arrays.fill(IA, -1);
for (int i = 0, iS = CA.length; i < iS; i++)
IA[CA[i]] = i;
IA['='] = 0;
}
// Check special case
int sLen = sArr != null ? sArr.length : 0;
if (sLen == 0)
// Encode the int into four chars
dArr[d++] = CA[(i >>> 18) & 0x3f];
* Licence (BSD):
* ==============
{
private static final char[] CA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray();
private static final int[] IA = new int[256];
static {
Arrays.fill(IA, -1);
for (int i = 0, iS = CA.length; i < iS; i++)
IA[CA[i]] = i;
IA['='] = 0;
}
// Check special case
int sLen = sArr != null ? sArr.length : 0;
if (sLen == 0)
// Encode the int into four chars
dArr[d++] = CA[(i >>> 18) & 0x3f];
* @author Mikael Grev
* @author <a href="http://restfb.com">Mark Allen</a>
public static byte[] decodeBase64(String base64) {
if (base64 == null)
base64 = padBase64(base64);
private static String padBase64(String base64) {
String padding = "";
int remainder = base64.length() % 4;
if (remainder == 1)
padding = "===";
else if (remainder == 2)
padding = "==";
else if (remainder == 3)
* the parser will see the following XML-stream:
* <data name="n1">
* <data name="n2">
* <data name="n3" />
* as equivalent to the following XML-stream:
* <data name="n1" />
* <data name="n2" />
* <data name="n3" />
* This can be useful for badly-formed XML-streams but prevent the use
* <data name="n1">
* <data name="n2">
* <data name="n3" />
#ifndef _XMLUNICODE
// If "strictUTF8Parsing=0" then we assume that all characters have the same length of 1 byte.
// If "strictUTF8Parsing=1" then the characters have different lengths (from 1 byte to 4 bytes).
* the parser will see the following XML-stream:
* <data name="n1">
* <data name="n2">
* <data name="n3" />
* as equivalent to the following XML-stream:
* <data name="n1" />
* <data name="n2" />
* <data name="n3" />
* This can be useful for badly-formed XML-streams but prevent the use
* have the same names):
* <data name="n1">
* <data name="n2">
* <data name="n3" />
typedef struct { XMLCSTR s; int l; XMLCHAR c;} XMLCharacterEntity;
static XMLCharacterEntity XMLEntities[] =
// For conversion from UTF16 to UTF32
const FXint SURROGATE_OFFSET=0x10000-(0xD800<<10)-0xDC00;
// For conversion of UTF32 to UTF16
const FXint LEAD_OFFSET=0xD800-(0x10000>>10);
// Empty string
static const FXint emptystring[2]={0,0};
// Special NULL string
const FXchar FXString::null[4]={0,0,0,0};
// Numbers for hexadecimal
const FXchar FXString::hex[17]={'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f',0};
const FXchar FXString::HEX[17]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F',0};
// Length of a utf8 character representation
const signed char FXString::utfBytes[256]={
static inline FXint strlen(const FXwchar *src){
register FXint i=0;
while(src[i]) i++;
Screen_LoL::Screen_LoL(LoLEngine *vm, OSystem *system) : Screen_v2(vm, system, vm->gameFlags().use16ColorMode ? _screenDimTable16C : _screenDimTable256C, _screenDimTableCount) {
_paletteOverlay1 = new uint8[0x100];
_paletteOverlay2 = new uint8[0x100];
_grayOverlay = new uint8[0x100];
memset(_paletteOverlay1, 0, 0x100);
for (int i = 0; i < 8; i++)
_levelOverlays[i] = new uint8[256];
_fadeFlag = 2;
Screen_LoL::~Screen_LoL() {
for (int i = 0; i < 8; i++)
if (flags & 1)
x -= (getTextWidth(string) >> 1);
if (flags & 2)
x -= getTextWidth(string);
const void* SK_RESTRICT src, int n) {
SkASSERT(n > 0 && n <= 15);
uint8_t* d = (uint8_t*)dst;
switch (n) {
case 15: *d++ = *s++;
case 14: *d++ = *s++;
case 13: *d++ = *s++;
case 12: *d++ = *s++;
case 11: *d++ = *s++;
case 10: *d++ = *s++;
case 9: *d++ = *s++;
case 8: *d++ = *s++;
case 7: *d++ = *s++;
case 6: *d++ = *s++;
case 5: *d++ = *s++;
case 4: *d++ = *s++;
case 3: *d++ = *s++;
const void* SK_RESTRICT src, int n) {
SkASSERT(n > 0 && n <= 15);
uint8_t* d = (uint8_t*)dst;
switch (n) {
case 15: *d++ = *s++;
case 14: *d++ = *s++;
case 13: *d++ = *s++;
case 12: *d++ = *s++;
case 11: *d++ = *s++;
case 10: *d++ = *s++;
case 9: *d++ = *s++;
case 8: *d++ = *s++;
case 7: *d++ = *s++;
case 6: *d++ = *s++;
case 5: *d++ = *s++;
case 4: *d++ = *s++;
case 3: *d++ = *s++;
*
* Licence (BSD): ==============
{
private static final char[] CA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
.toCharArray();
private static final int[] IA = new int[256];
Arrays.fill(IA, -1);
for (int i = 0, iS = CA.length; i < iS; i++)
IA[CA[i]] = i;
// Encode even 24-bits
for (int s = 0, d = 0, cc = 0; s < eLen;)
// to sign.
int i = (sArr[s++] & 0xff) << 16 | (sArr[s++] & 0xff) << 8
// Encode the int into four chars
dArr[d++] = CA[(i >>> 18) & 0x3f];
{
wchar_t *save = destination;
for (; *destination; ++destination);
while ((*destination++ = *source++));
for (;*string ; ++string)
if (*string == c)
{
while (*string1 == *string2++)
if (*string1++ == 0)
return (0);
{
wchar_t *save = destination;
{
const wchar_t *scan1 = s;
const wchar_t *scan2 = t;
const unsigned int OFStandard::ftoa_format_e = 0x01;
const unsigned int OFStandard::ftoa_format_f = 0x02;
const unsigned int OFStandard::ftoa_uppercase = 0x04;
const unsigned int OFStandard::ftoa_alternate = 0x08;
const unsigned int OFStandard::ftoa_leftadj = 0x10;
const unsigned int OFStandard::ftoa_zeropad = 0x20;
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred.
{
if ((*d++ = *s++) == 0)
break;
} while (--n != 0);