compile on windows

This commit is contained in:
David Rose 2007-12-20 02:02:25 +00:00
parent 5afa502948
commit 56e4178f2d
3 changed files with 10 additions and 10 deletions

View File

@ -238,7 +238,7 @@ get_int64_word(int n) const {
// return a partial answer if there was one. // return a partial answer if there was one.
if (has_string_word(n)) { if (has_string_word(n)) {
((ConfigDeclaration *)this)->check_int64_word(n); ((ConfigDeclaration *)this)->check_int64_word(n);
return _words[n]._int64; return _words[n]._int_64;
} }
return 0; return 0;
} }

View File

@ -136,7 +136,7 @@ set_int64_word(int n, PN_int64 value) {
set_string_word(n, strm.str()); set_string_word(n, strm.str());
_words[n]._flags |= (F_checked_int64 | F_valid_int64); _words[n]._flags |= (F_checked_int64 | F_valid_int64);
_words[n]._int64 = value; _words[n]._int_64 = value;
invalidate_cache(); invalidate_cache();
} }
@ -331,7 +331,7 @@ check_int64_word(int n) {
if ((word._flags & F_checked_int64) == 0) { if ((word._flags & F_checked_int64) == 0) {
word._flags |= F_checked_int64; word._flags |= F_checked_int64;
word._int64 = 0; word._int_64 = 0;
bool overflow = false; bool overflow = false;
string::const_iterator pi = word._str.begin(); string::const_iterator pi = word._str.begin();
@ -339,24 +339,24 @@ check_int64_word(int n) {
++pi; ++pi;
// Negative number. // Negative number.
while (pi != word._str.end() && isdigit(*pi)) { while (pi != word._str.end() && isdigit(*pi)) {
PN_int64 next = word._int64 * 10 - (int)((*pi) - '0'); PN_int64 next = word._int_64 * 10 - (int)((*pi) - '0');
if ((PN_int64)(next / 10) != word._int64) { if ((PN_int64)(next / 10) != word._int_64) {
// Overflow. // Overflow.
overflow = true; overflow = true;
} }
word._int64 = next; word._int_64 = next;
++pi; ++pi;
} }
} else { } else {
// Positive number. // Positive number.
while (pi != word._str.end() && isdigit(*pi)) { while (pi != word._str.end() && isdigit(*pi)) {
PN_int64 next = word._int64 * 10 + (int)((*pi) - '0'); PN_int64 next = word._int_64 * 10 + (int)((*pi) - '0');
if ((PN_int64)(next / 10) != word._int64) { if ((PN_int64)(next / 10) != word._int_64) {
// Overflow. // Overflow.
overflow = true; overflow = true;
} }
word._int64 = next; word._int_64 = next;
++pi; ++pi;
} }
} }

View File

@ -111,7 +111,7 @@ private:
string _str; string _str;
bool _bool; bool _bool;
int _int; int _int;
PN_int64 _int64; PN_int64 _int_64;
double _double; double _double;
short _flags; short _flags;
}; };