You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Frank Huebbers (JIRA)" <ji...@apache.org> on 2008/01/19 00:11:34 UTC

[jira] Created: (AXIS2C-919) primitive types - long vs. int64_t

primitive types - long vs. int64_t
----------------------------------

                 Key: AXIS2C-919
                 URL: https://issues.apache.org/jira/browse/AXIS2C-919
             Project: Axis2-C
          Issue Type: Improvement
          Components: wsdl2c tool
    Affects Versions: Current (Nightly)
            Reporter: Frank Huebbers


I'm running into a problem with Axis2/C regarding the primitive types used in certain situations, especially when using Axis2/C cross platform and cross implementation. Specifically, I have several primitive types which are longs to represent values in excess of 2GB. This works fine on C# and Java (which we are using on our platforms). However, on C++ compiled on a WinXP 32-bit system, the long type is only 4 bytes long (as the int type) and thus not sufficient to represent large numbers.

The way I have gotten around this problem while keeping cross-platform compatibility in mind are the following defines:

#if defined(_WINDOWS)

// Windows doesn't have any of the standard ANSI size invariant
// Ansi types

typedef unsigned __int8  uint8_t;
typedef __int8            int8_t;
typedef unsigned __int16 uint16_t;
typedef __int16           int16_t;
typedef unsigned __int32 uint32_t;
typedef __int32           int32_t;
typedef unsigned __int64 uint64_t;
typedef __int64           int64_t;

#else

// Non Windows platforms should have this header file, which should
// give access to the ansi types like uint8_t etc.
#include <stdint.h>

#endif // !_WINDOWS

Is it possible to use these ansi types instead of types which will invariably truncate very large numbers, such as longs? I would consider this to be a very important improvement to the generated code.

Any further comments are highly appreciated.

Cheers,
Frank


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Commented: (AXIS2C-919) primitive types - long vs. int64_t

Posted by "Dimuthu Gamage (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560920#action_12560920 ] 

Dimuthu Gamage commented on AXIS2C-919:
---------------------------------------

As you suggested according to the  xmlschema (http://www.w3.org/TR/xmlschema-2/#long)  spec 

Long  -  -2^63 and 2^63-1
unsigned long = 2^64

It s better if these types are defined in the util library in platform independent manner. I think it is appropriate if we can use the types int64_5, uint64_t as it is in the generated code.

Senaka , can you give a try to test and add the Frank's code to the util.

Thanks
Dimuthu

> primitive types - long vs. int64_t
> ----------------------------------
>
>                 Key: AXIS2C-919
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-919
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: wsdl2c tool
>    Affects Versions: Current (Nightly)
>            Reporter: Frank Huebbers
>
> I'm running into a problem with Axis2/C regarding the primitive types used in certain situations, especially when using Axis2/C cross platform and cross implementation. Specifically, I have several primitive types which are longs to represent values in excess of 2GB. This works fine on C# and Java (which we are using on our platforms). However, on C++ compiled on a WinXP 32-bit system, the long type is only 4 bytes long (as the int type) and thus not sufficient to represent large numbers.
> The way I have gotten around this problem while keeping cross-platform compatibility in mind are the following defines:
> #if defined(_WINDOWS)
> // Windows doesn't have any of the standard ANSI size invariant
> // Ansi types
> typedef unsigned __int8  uint8_t;
> typedef __int8            int8_t;
> typedef unsigned __int16 uint16_t;
> typedef __int16           int16_t;
> typedef unsigned __int32 uint32_t;
> typedef __int32           int32_t;
> typedef unsigned __int64 uint64_t;
> typedef __int64           int64_t;
> #else
> // Non Windows platforms should have this header file, which should
> // give access to the ansi types like uint8_t etc.
> #include <stdint.h>
> #endif // !_WINDOWS
> Is it possible to use these ansi types instead of types which will invariably truncate very large numbers, such as longs? I would consider this to be a very important improvement to the generated code.
> Any further comments are highly appreciated.
> Cheers,
> Frank

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Resolved: (AXIS2C-919) primitive types - long vs. int64_t

Posted by "Senaka Fernando (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Senaka Fernando resolved AXIS2C-919.
------------------------------------

    Resolution: Fixed

Fixed Issue in util. Raised another issue, AXIS2C-964 for getting this done at WSDL2C level.

> primitive types - long vs. int64_t
> ----------------------------------
>
>                 Key: AXIS2C-919
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-919
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: wsdl2c tool
>    Affects Versions: Current (Nightly)
>            Reporter: Frank Huebbers
>            Assignee: Senaka Fernando
>
> I'm running into a problem with Axis2/C regarding the primitive types used in certain situations, especially when using Axis2/C cross platform and cross implementation. Specifically, I have several primitive types which are longs to represent values in excess of 2GB. This works fine on C# and Java (which we are using on our platforms). However, on C++ compiled on a WinXP 32-bit system, the long type is only 4 bytes long (as the int type) and thus not sufficient to represent large numbers.
> The way I have gotten around this problem while keeping cross-platform compatibility in mind are the following defines:
> #if defined(_WINDOWS)
> // Windows doesn't have any of the standard ANSI size invariant
> // Ansi types
> typedef unsigned __int8  uint8_t;
> typedef __int8            int8_t;
> typedef unsigned __int16 uint16_t;
> typedef __int16           int16_t;
> typedef unsigned __int32 uint32_t;
> typedef __int32           int32_t;
> typedef unsigned __int64 uint64_t;
> typedef __int64           int64_t;
> #else
> // Non Windows platforms should have this header file, which should
> // give access to the ansi types like uint8_t etc.
> #include <stdint.h>
> #endif // !_WINDOWS
> Is it possible to use these ansi types instead of types which will invariably truncate very large numbers, such as longs? I would consider this to be a very important improvement to the generated code.
> Any further comments are highly appreciated.
> Cheers,
> Frank

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Assigned: (AXIS2C-919) primitive types - long vs. int64_t

Posted by "Senaka Fernando (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Senaka Fernando reassigned AXIS2C-919:
--------------------------------------

    Assignee: Senaka Fernando

> primitive types - long vs. int64_t
> ----------------------------------
>
>                 Key: AXIS2C-919
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-919
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: wsdl2c tool
>    Affects Versions: Current (Nightly)
>            Reporter: Frank Huebbers
>            Assignee: Senaka Fernando
>
> I'm running into a problem with Axis2/C regarding the primitive types used in certain situations, especially when using Axis2/C cross platform and cross implementation. Specifically, I have several primitive types which are longs to represent values in excess of 2GB. This works fine on C# and Java (which we are using on our platforms). However, on C++ compiled on a WinXP 32-bit system, the long type is only 4 bytes long (as the int type) and thus not sufficient to represent large numbers.
> The way I have gotten around this problem while keeping cross-platform compatibility in mind are the following defines:
> #if defined(_WINDOWS)
> // Windows doesn't have any of the standard ANSI size invariant
> // Ansi types
> typedef unsigned __int8  uint8_t;
> typedef __int8            int8_t;
> typedef unsigned __int16 uint16_t;
> typedef __int16           int16_t;
> typedef unsigned __int32 uint32_t;
> typedef __int32           int32_t;
> typedef unsigned __int64 uint64_t;
> typedef __int64           int64_t;
> #else
> // Non Windows platforms should have this header file, which should
> // give access to the ansi types like uint8_t etc.
> #include <stdint.h>
> #endif // !_WINDOWS
> Is it possible to use these ansi types instead of types which will invariably truncate very large numbers, such as longs? I would consider this to be a very important improvement to the generated code.
> Any further comments are highly appreciated.
> Cheers,
> Frank

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Closed: (AXIS2C-919) primitive types - long vs. int64_t

Posted by "Frank Huebbers (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Huebbers closed AXIS2C-919.
---------------------------------


Everything works great here with a snapshot build from 7/2/2008

> primitive types - long vs. int64_t
> ----------------------------------
>
>                 Key: AXIS2C-919
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-919
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: wsdl2c tool
>    Affects Versions: Current (Nightly)
>            Reporter: Frank Huebbers
>            Assignee: Senaka Fernando
>
> I'm running into a problem with Axis2/C regarding the primitive types used in certain situations, especially when using Axis2/C cross platform and cross implementation. Specifically, I have several primitive types which are longs to represent values in excess of 2GB. This works fine on C# and Java (which we are using on our platforms). However, on C++ compiled on a WinXP 32-bit system, the long type is only 4 bytes long (as the int type) and thus not sufficient to represent large numbers.
> The way I have gotten around this problem while keeping cross-platform compatibility in mind are the following defines:
> #if defined(_WINDOWS)
> // Windows doesn't have any of the standard ANSI size invariant
> // Ansi types
> typedef unsigned __int8  uint8_t;
> typedef __int8            int8_t;
> typedef unsigned __int16 uint16_t;
> typedef __int16           int16_t;
> typedef unsigned __int32 uint32_t;
> typedef __int32           int32_t;
> typedef unsigned __int64 uint64_t;
> typedef __int64           int64_t;
> #else
> // Non Windows platforms should have this header file, which should
> // give access to the ansi types like uint8_t etc.
> #include <stdint.h>
> #endif // !_WINDOWS
> Is it possible to use these ansi types instead of types which will invariably truncate very large numbers, such as longs? I would consider this to be a very important improvement to the generated code.
> Any further comments are highly appreciated.
> Cheers,
> Frank

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Commented: (AXIS2C-919) primitive types - long vs. int64_t

Posted by "Senaka Fernando (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560704#action_12560704 ] 

Senaka Fernando commented on AXIS2C-919:
----------------------------------------

Hi Frank,

I believe that it can be added. Plus any other standard types, so that users can make use of these. However, the names of types may require to be changed according to axis2/c conventions. And, we'll have to consider using long vs. uint64_t at all occurrences, because the longer the type, the greater the overhead.

I believe it would be better if you could suggest exactly what location(s) do you want this replacement to be made. I don't think we need to be replacing all.

Regards,
Senaka

> primitive types - long vs. int64_t
> ----------------------------------
>
>                 Key: AXIS2C-919
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-919
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: wsdl2c tool
>    Affects Versions: Current (Nightly)
>            Reporter: Frank Huebbers
>
> I'm running into a problem with Axis2/C regarding the primitive types used in certain situations, especially when using Axis2/C cross platform and cross implementation. Specifically, I have several primitive types which are longs to represent values in excess of 2GB. This works fine on C# and Java (which we are using on our platforms). However, on C++ compiled on a WinXP 32-bit system, the long type is only 4 bytes long (as the int type) and thus not sufficient to represent large numbers.
> The way I have gotten around this problem while keeping cross-platform compatibility in mind are the following defines:
> #if defined(_WINDOWS)
> // Windows doesn't have any of the standard ANSI size invariant
> // Ansi types
> typedef unsigned __int8  uint8_t;
> typedef __int8            int8_t;
> typedef unsigned __int16 uint16_t;
> typedef __int16           int16_t;
> typedef unsigned __int32 uint32_t;
> typedef __int32           int32_t;
> typedef unsigned __int64 uint64_t;
> typedef __int64           int64_t;
> #else
> // Non Windows platforms should have this header file, which should
> // give access to the ansi types like uint8_t etc.
> #include <stdint.h>
> #endif // !_WINDOWS
> Is it possible to use these ansi types instead of types which will invariably truncate very large numbers, such as longs? I would consider this to be a very important improvement to the generated code.
> Any further comments are highly appreciated.
> Cheers,
> Frank

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Commented: (AXIS2C-919) primitive types - long vs. int64_t

Posted by "Senaka Fernando (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12565415#action_12565415 ] 

Senaka Fernando commented on AXIS2C-919:
----------------------------------------

Hi Dimuthu,

I will add these to the util. I hope you can give a hand in getting this right on the WSDL2C tool side.

Thanks,
Senaka

> primitive types - long vs. int64_t
> ----------------------------------
>
>                 Key: AXIS2C-919
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-919
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: wsdl2c tool
>    Affects Versions: Current (Nightly)
>            Reporter: Frank Huebbers
>            Assignee: Senaka Fernando
>
> I'm running into a problem with Axis2/C regarding the primitive types used in certain situations, especially when using Axis2/C cross platform and cross implementation. Specifically, I have several primitive types which are longs to represent values in excess of 2GB. This works fine on C# and Java (which we are using on our platforms). However, on C++ compiled on a WinXP 32-bit system, the long type is only 4 bytes long (as the int type) and thus not sufficient to represent large numbers.
> The way I have gotten around this problem while keeping cross-platform compatibility in mind are the following defines:
> #if defined(_WINDOWS)
> // Windows doesn't have any of the standard ANSI size invariant
> // Ansi types
> typedef unsigned __int8  uint8_t;
> typedef __int8            int8_t;
> typedef unsigned __int16 uint16_t;
> typedef __int16           int16_t;
> typedef unsigned __int32 uint32_t;
> typedef __int32           int32_t;
> typedef unsigned __int64 uint64_t;
> typedef __int64           int64_t;
> #else
> // Non Windows platforms should have this header file, which should
> // give access to the ansi types like uint8_t etc.
> #include <stdint.h>
> #endif // !_WINDOWS
> Is it possible to use these ansi types instead of types which will invariably truncate very large numbers, such as longs? I would consider this to be a very important improvement to the generated code.
> Any further comments are highly appreciated.
> Cheers,
> Frank

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Commented: (AXIS2C-919) primitive types - long vs. int64_t

Posted by "Frank Huebbers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560860#action_12560860 ] 

Frank Huebbers commented on AXIS2C-919:
---------------------------------------

Hi Senaka,

I need these type defs especially for long (int64_t) and unsigned longs (uint64_t). We have several member variables with very large values, i.e., they need more than 4 bytes to be represented. In the current form, these values would be truncated on 32-bit windows machines which is not acceptable.

The other primitive types would be nice to have defined as I have suggested as well because it would give the programmer a choice to further optimize the code. But I see that in some situations it is better to leave them as they are. 

To give the typedefs more flexibility, it might make sense to add another option on the WSDL2C tool which would allow someone to either use the primitive types as they are now (i.e., int, and longs) or using ansi fixed sized types (int32_t, int64_t, ...). This would probably be the best solution.

Let me know your thoughts.

Thanks Senaka.

Cheers,
Frank

> primitive types - long vs. int64_t
> ----------------------------------
>
>                 Key: AXIS2C-919
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-919
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: wsdl2c tool
>    Affects Versions: Current (Nightly)
>            Reporter: Frank Huebbers
>
> I'm running into a problem with Axis2/C regarding the primitive types used in certain situations, especially when using Axis2/C cross platform and cross implementation. Specifically, I have several primitive types which are longs to represent values in excess of 2GB. This works fine on C# and Java (which we are using on our platforms). However, on C++ compiled on a WinXP 32-bit system, the long type is only 4 bytes long (as the int type) and thus not sufficient to represent large numbers.
> The way I have gotten around this problem while keeping cross-platform compatibility in mind are the following defines:
> #if defined(_WINDOWS)
> // Windows doesn't have any of the standard ANSI size invariant
> // Ansi types
> typedef unsigned __int8  uint8_t;
> typedef __int8            int8_t;
> typedef unsigned __int16 uint16_t;
> typedef __int16           int16_t;
> typedef unsigned __int32 uint32_t;
> typedef __int32           int32_t;
> typedef unsigned __int64 uint64_t;
> typedef __int64           int64_t;
> #else
> // Non Windows platforms should have this header file, which should
> // give access to the ansi types like uint8_t etc.
> #include <stdint.h>
> #endif // !_WINDOWS
> Is it possible to use these ansi types instead of types which will invariably truncate very large numbers, such as longs? I would consider this to be a very important improvement to the generated code.
> Any further comments are highly appreciated.
> Cheers,
> Frank

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Issue Comment Edited: (AXIS2C-919) primitive types - long vs. int64_t

Posted by "Senaka Fernando (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12565424#action_12565424 ] 

senakafdo edited comment on AXIS2C-919 at 2/4/08 9:31 AM:
----------------------------------------------------------------

Fixed Issue in util. Raised another issue, AXIS2C-964 for getting this done at WSDL2C level. Thanks, Frank for the input.

Regards,
Senaka

      was (Author: senakafdo):
    Fixed Issue in util. Raised another issue, AXIS2C-964 for getting this done at WSDL2C level.
  
> primitive types - long vs. int64_t
> ----------------------------------
>
>                 Key: AXIS2C-919
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-919
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: wsdl2c tool
>    Affects Versions: Current (Nightly)
>            Reporter: Frank Huebbers
>            Assignee: Senaka Fernando
>
> I'm running into a problem with Axis2/C regarding the primitive types used in certain situations, especially when using Axis2/C cross platform and cross implementation. Specifically, I have several primitive types which are longs to represent values in excess of 2GB. This works fine on C# and Java (which we are using on our platforms). However, on C++ compiled on a WinXP 32-bit system, the long type is only 4 bytes long (as the int type) and thus not sufficient to represent large numbers.
> The way I have gotten around this problem while keeping cross-platform compatibility in mind are the following defines:
> #if defined(_WINDOWS)
> // Windows doesn't have any of the standard ANSI size invariant
> // Ansi types
> typedef unsigned __int8  uint8_t;
> typedef __int8            int8_t;
> typedef unsigned __int16 uint16_t;
> typedef __int16           int16_t;
> typedef unsigned __int32 uint32_t;
> typedef __int32           int32_t;
> typedef unsigned __int64 uint64_t;
> typedef __int64           int64_t;
> #else
> // Non Windows platforms should have this header file, which should
> // give access to the ansi types like uint8_t etc.
> #include <stdint.h>
> #endif // !_WINDOWS
> Is it possible to use these ansi types instead of types which will invariably truncate very large numbers, such as longs? I would consider this to be a very important improvement to the generated code.
> Any further comments are highly appreciated.
> Cheers,
> Frank

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org