Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

CVS update of carob/src (SQLDataSerialization.cpp): msg#00189

db.carob.cvs

Subject: CVS update of carob/src (SQLDataSerialization.cpp)

Date: Thursday, January 26, 2006 @ 17:23:36
Author: marc
Path: /cvsroot/carob/carob/src

Modified: SQLDataSerialization.cpp (1.20 -> 1.21)

full & simplified comparison now using std::string in ints_little_endianness()


--------------------------+
SQLDataSerialization.cpp | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)


Index: carob/src/SQLDataSerialization.cpp
diff -u carob/src/SQLDataSerialization.cpp:1.20
carob/src/SQLDataSerialization.cpp:1.21
--- carob/src/SQLDataSerialization.cpp:1.20 Thu Jan 26 17:16:50 2006
+++ carob/src/SQLDataSerialization.cpp Thu Jan 26 17:23:36 2006
@@ -386,21 +386,24 @@
const char *i_uc = reinterpret_cast<const char*>(&I);
const char *l_uc = reinterpret_cast<const char*>(&L);

- // then check if we have an classical MSB-float arch
- // (sign, exponent, fraction)
+ using std::string;
+
+ // then check if we have an classical MSB arch
// UNTESTED
- if (i_uc[0] == 1
- && i_uc[3] == 2
- && l_uc[0] == 1
- && l_uc[7] == 2)
+ const char i_msbf[] = { 1, 0, 0, 2 };
+ const char l_msbf[] = { 1, 0, 0, 0, 0, 0, 0, 2 };
+
+ if (string(i_uc, 4) == string(i_msbf, 4)
+ && string(l_uc, 8) == string(l_msbf, 8))
return false;

- // else check if we have an classical LSB-float arch
+ // else check if we have an classical LSB arch
// TESTED (on IA32)
- if (i_uc[3] == 1
- && i_uc[0] == 2
- && l_uc[7] == 1
- && l_uc[0] == 2)
+ const char i_lsbf[] = { 2, 0, 0, 1 };
+ const char l_lsbf[] = { 2, 0, 0, 0, 0, 0, 0, 1 };
+
+ if (string(i_uc, 4) == string(i_lsbf, 4)
+ && string(l_uc, 8) == string(l_lsbf, 8))
return true;

// else weird unsupported arch, abort


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | advertise | OSDir is an inevitable website. super tiny logo