Merge lp:~paul-lucas/zorba/bug-1075106 into lp:zorba

Proposed by Paul J. Lucas
Status: Merged
Approved by: Paul J. Lucas
Approved revision: 11128
Merged at revision: 11126
Proposed branch: lp:~paul-lucas/zorba/bug-1075106
Merge into: lp:zorba
Diff against target: 58 lines (+20/-4)
2 files modified
src/zorbatypes/integer.cpp (+8/-0)
src/zorbatypes/integer.h (+12/-4)
To merge this branch: bzr merge lp:~paul-lucas/zorba/bug-1075106
Reviewer Review Type Date Requested Status
Matthias Brantner Needs Fixing
David Graf (community) Approve
Paul J. Lucas Approve
Review via email: mp+133612@code.launchpad.net

Commit message

Fixed sign extension.

Description of the change

Fixed sign extension.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
Revision history for this message
David Graf (davidagraf) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-1075106-2012-11-09T14-28-50.881Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

ChangeLog entry is missing.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/zorbatypes/integer.cpp'
--- src/zorbatypes/integer.cpp 2012-09-19 21:16:15 +0000
+++ src/zorbatypes/integer.cpp 2012-11-09 03:22:22 +0000
@@ -77,6 +77,14 @@
77 value_ = ztd::itoa( n, buf );77 value_ = ztd::itoa( n, buf );
78}78}
7979
80#if ZORBA_SIZEOF_INT == ZORBA_SIZEOF_LONG
81TEMPLATE_DECL(T)
82INTEGER_IMPL(T)::IntegerImpl( unsigned int n ) {
83 ztd::itoa_buf_type buf;
84 value_ = ztd::itoa( n, buf );
85}
86#endif /* ZORBA_SIZEOF_INT == ZORBA_SIZEOF_LONG */
87
80IntegerImpl::IntegerImpl( unsigned long n ) {88IntegerImpl::IntegerImpl( unsigned long n ) {
81 ztd::itoa_buf_type buf;89 ztd::itoa_buf_type buf;
82 value_ = ztd::itoa( n, buf );90 value_ = ztd::itoa( n, buf );
8391
=== modified file 'src/zorbatypes/integer.h'
--- src/zorbatypes/integer.h 2012-10-30 21:26:12 +0000
+++ src/zorbatypes/integer.h 2012-11-09 03:22:22 +0000
@@ -578,23 +578,31 @@
578578
579TEMPLATE_DECL(I)579TEMPLATE_DECL(I)
580inline INTEGER_IMPL(I)::IntegerImpl( unsigned char c ) :580inline INTEGER_IMPL(I)::IntegerImpl( unsigned char c ) :
581 value_( static_cast<long>( c ) )581 value_( static_cast<long>( (unsigned long)c ) )
582{582{
583}583}
584584
585TEMPLATE_DECL(I)585TEMPLATE_DECL(I)
586inline INTEGER_IMPL(I)::IntegerImpl( unsigned short n ) :586inline INTEGER_IMPL(I)::IntegerImpl( unsigned short n ) :
587 value_( static_cast<long>( n ) )587 value_( static_cast<long>( (unsigned long)n ) )
588{588{
589}589}
590590
591#ifdef ZORBA_WITH_BIG_INTEGER
592#if ZORBA_SIZEOF_INT != ZORBA_SIZEOF_LONG
593TEMPLATE_DECL(T)
594inline INTEGER_IMPL(T)::IntegerImpl( unsigned int n ) :
595 value_( static_cast<long>( (unsigned long)n ) )
596{
597}
598#endif /* ZORBA_SIZEOF_INT == ZORBA_SIZEOF_LONG */
599#else /* ZORBA_WITH_BIG_INTEGER */
591TEMPLATE_DECL(I)600TEMPLATE_DECL(I)
592inline INTEGER_IMPL(I)::IntegerImpl( unsigned int n ) :601inline INTEGER_IMPL(I)::IntegerImpl( unsigned int n ) :
593 value_( static_cast<long>( n ) )602 value_( static_cast<value_type>( n ) )
594{603{
595}604}
596605
597#ifndef ZORBA_WITH_BIG_INTEGER
598TEMPLATE_DECL(I)606TEMPLATE_DECL(I)
599inline INTEGER_IMPL(I)::IntegerImpl( unsigned long n ) :607inline INTEGER_IMPL(I)::IntegerImpl( unsigned long n ) :
600 value_( static_cast<value_type>( n ) )608 value_( static_cast<value_type>( n ) )

Subscribers

People subscribed via source and target branches