#define PAGE_WIDTH_LENGTH 80
-ExclusiveHash <std::string> functions::st_stringExclusiveHash;
-ExclusiveHash <std::string, int> functions::st_string2intExclusiveHash;
-
string functions::getVersion() throw() {
static const int version = ANNA_VERSION;
string result;
string functions::asString(const S64 number)
throw() {
char aux [24];
- sprintf(aux, "%lld", number);
- /*#ifdef __anna64__
+ //sprintf(aux, "%lld", number);
+ #ifdef __anna64__
sprintf (aux, "%ld", number);
#else
sprintf (aux, "%lld", number);
#endif
- */
return string(aux);
}
string functions::asString(const U64 number)
throw() {
char aux [16];
- sprintf(aux, "%llu", number);
- /*
+ //sprintf(aux, "%llu", number);
#ifdef __anna64__
sprintf (aux, "%lu", number);
#else
sprintf (aux, "%llu", number);
#endif
- */
return string(aux);
}
string functions::asHexString(const S64 number)
throw() {
char aux [32];
- sprintf(aux, "0x%llx", number);
- /*
+ //sprintf(aux, "0x%llx", number);
#ifdef __anna64__
sprintf (aux, "0x%lx", number);
#else
sprintf (aux, "0x%llx", number);
#endif
- */
return string(aux);
}
const char* src = hexString.data();
unsigned char hex;
int aux;
- int j = 0;
for(int ii = 1, maxii = hexString.length(); ii < maxii; ii += 2) {
if(isxdigit(aux = src [ii - 1]) == 0)
S64 functions::asInteger64(const char* str)
throw() {
S64 number = 0;
- sscanf(str, "%lld", &number);
- /*
+ //sscanf(str, "%lld", &number);
#ifdef __anna64__
sscanf (str, "%ld", &number);
#else
sscanf (str, "%lld", &number);
#endif
- */
return number;
}
int r = -1; // r will be lg(v)
unsigned int t, tt; // temporaries
- if(tt = v >> 16) {
- r = (t = tt >> 8) ? 24 + LogTable256[t] : 16 + LogTable256[tt];
+ if((tt = v >> 16)) {
+ r = ((t = tt >> 8)) ? 24 + LogTable256[t] : 16 + LogTable256[tt];
} else {
r = (t = v >> 8) ? 8 + LogTable256[t] : LogTable256[v];
}
std::string result = "";
struct hostent *he;
struct in_addr **addr_list;
- struct in_addr ipv4addr;
char hostname[128];
gethostname(hostname, sizeof hostname);
bool filler = isupNumber.OddEven;
bool hasDigits = (isupNumber.Digits.size() > 0);
byte = filler ? 0x80 : 0x00;
- byte = byte |= isupNumber.NatureOfAddress;
+ byte |= isupNumber.NatureOfAddress;
target += byte;
if(calledOrCalling) {
byte = isupNumber.InternalNetworkNumber << 7;
- byte = byte |= (isupNumber.NumberingPlan << 4);
+ byte |= (isupNumber.NumberingPlan << 4);
} else {
byte = isupNumber.NumberIncomplete << 7;
- byte = byte |= (isupNumber.NumberingPlan << 4);
- byte = byte |= (isupNumber.AddressPresentationRestricted << 2);
- byte = byte |= isupNumber.Screening;
+ byte |= (isupNumber.NumberingPlan << 4);
+ byte |= (isupNumber.AddressPresentationRestricted << 2);
+ byte |= isupNumber.Screening;
}
target += byte;