- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Migrating source code from 32 to 64 bits
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2008 04:57 AM
тАО10-09-2008 04:57 AM
Re: Migrating source code from 32 to 64 bits
This is not a long in your database. This is an int32_t. You should get used to using explicit sizes in your port, especially if you have existing data files.
>field = *(long*)std_outp->V[0];
>it's a conversion from 'char**' to 'long'.
Why do you think this is a char**? Is V a char***?
>compiled under 64 bits, it gives me:
> std_outp->V[0] = '989999'
> field = 4252013328072704
You should debug this by printing both in hex.
>I find this conversion, via 'int', something 'horrible', I think that there has to be another way more 'beautiful' to do the cast.
Cast to int32_t*.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2008 10:47 PM
тАО10-09-2008 10:47 PM
Re: Migrating source code from 32 to 64 bits
Sorry, but i was a bit lost. Re-reading my question i realize than i was explaining so horrible. I was mixing concepts.
Well, SQLDA->V is a char**:
struct SQLDA {
/* ub4 */ int N;
/* text** */ char **V;
/* ub4* */ int *L;
/* sb2* */ short *T;
/* sb2** */ short **I;
/* sb4 */ int F;
/* text** */ char **S;
/* ub2* */ short *M;
/* ub2* */ short *C;
/* text** */ char **X;
/* ub2* */ short *Y;
/* ub2* */ short *Z;
};
In an Oracle's example, it uses also this cast (to convert to '%d' value to printf):
*(int *)select_dp->V[i]
when the field has a NUMBER value.
If Oracle does it, i'll do it.
Thanks a lot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2008 11:04 PM
тАО10-09-2008 11:04 PM
Re: Migrating source code from 32 to 64 bits
So V[0] is a char* and you were converting a char* to a long*, then dereferencing it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2008 01:42 AM
тАО10-10-2008 01:42 AM
Re: Migrating source code from 32 to 64 bits
But i have important news: my customer hear my words (i'm influential...) and we discard at the moment migrate the application to 64-bit.
And now we have a trouble:
Anybody knows something about the future of 32-bit in HP-UX? If the HP's future plan is not include 32-bit compatibility, we can think about 64-bit porting.
Thanks a lot, people!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2008 12:03 PM
тАО10-10-2008 12:03 PM
Re: Migrating source code from 32 to 64 bits
There are no current plans to change this.
Perhaps when there are 128 bit computers. :-)
- « Previous
-
- 1
- 2
- Next »