Int32 ConvertStringToInt32(constwchar_t *s, constwchar_t **end) throw()
{ if (end)
*end = s; constwchar_t *s2 = s; if (*s == '-')
s2++; if (*s2 == 0) return 0; constwchar_t *end2;
UInt32 res = ConvertStringToUInt32(s2, &end2); if (*s == '-')
{ if (res > ((UInt32)1 << (32 - 1))) return 0;
} elseif ((res & ((UInt32)1 << (32 - 1))) != 0) return 0; if (end)
*end = end2; if (*s == '-') return -(Int32)res; return (Int32)res;
}
UInt32 ConvertOctStringToUInt32(constchar *s, constchar **end) throw()
{ if (end)
*end = s;
UInt32 res = 0; for (;; s++)
{ unsigned c = (unsignedchar)*s; if (c < '0' || c > '7')
{ if (end)
*end = s; return res;
} if ((res & (UInt32)7 << (32 - 3)) != 0) return 0;
res <<= 3;
res |= (unsigned)(c - '0');
}
}
UInt64 ConvertOctStringToUInt64(constchar *s, constchar **end) throw()
{ if (end)
*end = s;
UInt64 res = 0; for (;; s++)
{ unsigned c = (unsignedchar)*s; if (c < '0' || c > '7')
{ if (end)
*end = s; return res;
} if ((res & (UInt64)7 << (64 - 3)) != 0) return 0;
res <<= 3;
res |= (unsigned)(c - '0');
}
}
UInt32 ConvertHexStringToUInt32(constchar *s, constchar **end) throw()
{ if (end)
*end = s;
UInt32 res = 0; for (;; s++)
{ unsigned c = (Byte)*s; unsigned v; if (c >= '0' && c <= '9') v = (c - '0'); elseif (c >= 'A' && c <= 'F') v = 10 + (c - 'A'); elseif (c >= 'a' && c <= 'f') v = 10 + (c - 'a'); else
{ if (end)
*end = s; return res;
} if ((res & (UInt32)0xF << (32 - 4)) != 0) return 0;
res <<= 4;
res |= v;
}
}
UInt64 ConvertHexStringToUInt64(constchar *s, constchar **end) throw()
{ if (end)
*end = s;
UInt64 res = 0; for (;; s++)
{ unsigned c = (Byte)*s; unsigned v; if (c >= '0' && c <= '9') v = (c - '0'); elseif (c >= 'A' && c <= 'F') v = 10 + (c - 'A'); elseif (c >= 'a' && c <= 'f') v = 10 + (c - 'a'); else
{ if (end)
*end = s; return res;
} if ((res & (UInt64)0xF << (64 - 4)) != 0) return 0;
res <<= 4;
res |= v;
}
}
Messung V0.5
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.1Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.