projects
/
anna.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clarify
[anna.git]
/
source
/
core
/
functions.cpp
diff --git
a/source/core/functions.cpp
b/source/core/functions.cpp
index
6a660df
..
567fb71
100644
(file)
--- a/
source/core/functions.cpp
+++ b/
source/core/functions.cpp
@@
-37,9
+37,6
@@
using namespace std;
#define PAGE_WIDTH_LENGTH 80
#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::getVersion() throw() {
static const int version = ANNA_VERSION;
string result;
@@
-94,13
+91,12
@@
throw() {
string functions::asString(const S64 number)
throw() {
char aux [24];
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
sprintf (aux, "%ld", number);
#else
sprintf (aux, "%lld", number);
#endif
- */
return string(aux);
}
return string(aux);
}
@@
-114,14
+110,12
@@
throw() {
string functions::asString(const U64 number)
throw() {
char aux [16];
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
#ifdef __anna64__
sprintf (aux, "%lu", number);
#else
sprintf (aux, "%llu", number);
#endif
- */
return string(aux);
}
return string(aux);
}
@@
-171,14
+165,12
@@
throw() {
string functions::asHexString(const S64 number)
throw() {
char aux [32];
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
#ifdef __anna64__
sprintf (aux, "0x%lx", number);
#else
sprintf (aux, "0x%llx", number);
#endif
- */
return string(aux);
}
return string(aux);
}
@@
-239,7
+231,6
@@
throw(RuntimeException) {
const char* src = hexString.data();
unsigned char hex;
int 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)
for(int ii = 1, maxii = hexString.length(); ii < maxii; ii += 2) {
if(isxdigit(aux = src [ii - 1]) == 0)
@@
-310,14
+301,12
@@
throw(RuntimeException) {
S64 functions::asInteger64(const char* str)
throw() {
S64 number = 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
#ifdef __anna64__
sscanf (str, "%ld", &number);
#else
sscanf (str, "%lld", &number);
#endif
- */
return number;
}
return number;
}
@@
-416,8
+405,8
@@
throw() {
int r = -1; // r will be lg(v)
unsigned int t, tt; // temporaries
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];
}
} else {
r = (t = v >> 8) ? 8 + LogTable256[t] : LogTable256[v];
}
@@
-713,7
+702,6
@@
std::string functions::getHostnameIP() throw() {
std::string result = "";
struct hostent *he;
struct in_addr **addr_list;
std::string result = "";
struct hostent *he;
struct in_addr **addr_list;
- struct in_addr ipv4addr;
char hostname[128];
gethostname(hostname, sizeof hostname);
char hostname[128];
gethostname(hostname, sizeof hostname);
@@
-1482,17
+1470,17
@@
void functions::codeIsupNumber(const isup_number_t & isupNumber, bool calledOrCa
bool filler = isupNumber.OddEven;
bool hasDigits = (isupNumber.Digits.size() > 0);
byte = filler ? 0x80 : 0x00;
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;
target += byte;
if(calledOrCalling) {
byte = isupNumber.InternalNetworkNumber << 7;
- byte
= byte
|= (isupNumber.NumberingPlan << 4);
+ byte |= (isupNumber.NumberingPlan << 4);
} else {
byte = isupNumber.NumberIncomplete << 7;
} 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;
}
target += byte;