[Patch] new BITxxx functions for ODF 1.2

classic Classic list List threaded Threaded
21 messages Options
Next » 12
Wolfgang Pechlaner-3 Wolfgang Pechlaner-3
Reply | Threaded
Open this post in threaded view
|

[Patch] new BITxxx functions for ODF 1.2

Hi,

I've made the new Functions BITAND, BITOR, BITXOR BITRSHIFT and BITLSHIFT,, how declared in the ODF 1.2 specification. Can anyone have a look on this Patches.

greetings

Wolfgang

 

 

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

0001-BITxxx-functions-for-ODF-1.2.patch (108K) Download Attachment
0001-new-BITxxx_functions.patch (5K) Download Attachment
Thorsten Behrens Thorsten Behrens
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

[hidden email] wrote:
> I've made the new Functions BITAND, BITOR, BITXOR BITRSHIFT
> and BITLSHIFT,, how declared in the ODF 1.2 specification. Can anyone
> have a look on this Patches.
>
Wonderful, great stuff - I have to apologize, the many whitespace
changes in the calc part of the patch are because of my substandard
mentoring - cleaned-up version of the first patch attached.

Cheers,

-- Thorsten

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

0001-BITxxx-functions-for-ODF-1.2.patch (11K) Download Attachment
attachment1 (205 bytes) Download Attachment
Olivier Hallot Olivier Hallot
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

Hi

If pushed, these new functions should be advertised in the Release notes.

Olivier

Em 04-09-2011 09:45, Thorsten Behrens escreveu:
[hidden email] wrote:
I've made the new Functions BITAND, BITOR, BITXOR BITRSHIFT
and BITLSHIFT,, how declared in the ODF 1.2 specification. Can anyone
have a look on this Patches. 

Wonderful, great stuff - I have to apologize, the many whitespace
changes in the calc part of the patch are because of my substandard
mentoring - cleaned-up version of the first patch attached.

Cheers,

-- Thorsten


_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

-- 
Olivier Hallot
Founder, Steering Commitee Member - The Document Foundation
Voicing the enterprise needs
LibreOffice translation leader for Brazilian Portuguese
+55-21-8822-8812

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Eike Rathke Eike Rathke
Reply | Threaded
Open this post in threaded view
|

Re: [Patch] new BITxxx functions for ODF 1.2

In reply to this post by Wolfgang Pechlaner-3
Hi libo,

On Sunday, 2011-09-04 11:28:58 +0200, [hidden email] wrote:

> I've made the new Functions BITAND, BITOR, BITXOR BITRSHIFT
> and BITLSHIFT,, how declared in the ODF 1.2 specification. Can anyone
> have a look on this Patches.

Great! I'll take a look at them tomorrow or the day after.

  Eike

--
 PGP/OpenPGP/GnuPG encrypted mail preferred in all private communication.
 Key ID: 0x293C05FD - 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

signature.asc (205 bytes) Download Attachment
Niko Rönkkö Niko Rönkkö
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

In reply to this post by Thorsten Behrens
Hi

> Wonderful, great stuff - I have to apologize, the many whitespace
> changes in the calc part of the patch are because of my substandard
> mentoring - cleaned-up version of the first patch attached.

I was in the belief that we shall use spaces instead of tabs.

Corrected patches attached.

--
RN

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

0001-BITxxx-functions-for-ODF-1.2.patch (11K) Download Attachment
0001-new-BITxxx_functions.patch (4K) Download Attachment
Korrawit Pruegsanusak Korrawit Pruegsanusak
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

Hello all,

On Tue, Sep 6, 2011 at 20:08, Niko Rönkkö <[hidden email]> wrote:
> Hi
>
>> Wonderful, great stuff - I have to apologize, the many whitespace
>> changes in the calc part of the patch are because of my substandard
>> mentoring - cleaned-up version of the first patch attached.
>
> I was in the belief that we shall use spaces instead of tabs.
>
> Corrected patches attached.

And please s/interger/integer ;)
Also, it seems that you haven't check the range of ishift yet, whether
it is between -48 and 48 (from your description), or it isn't
necessary? I don't have knowledge on this.
My last nitpick, what about the strings capitalization?

Best Regards,
--
Korrawit Pruegsanusak
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Eike Rathke Eike Rathke
Reply | Threaded
Open this post in threaded view
|

Re: [PUSHED] new BITxxx functions for ODF 1.2

In reply to this post by Wolfgang Pechlaner-3
Hi Wolfgang,

On Sunday, 2011-09-04 11:28:58 +0200, [hidden email] wrote:

> I've made the new Functions BITAND, BITOR, BITXOR BITRSHIFT
> and BITLSHIFT,, how declared in the ODF 1.2 specification. Can anyone
> have a look on this Patches.

So you successfully waded your way through, good :)

As a basis for the commit I used the version without whitespace changes
and with blanks instead of tabs provided by Thorsten and Niko (thanks
guys!). It seems you were working on a rather old version of the split
repositories, I suggest you upgrade to the "OneGit" core repository, see
http://www.libreoffice.org/get-involved/developers/

For my usual nitpicks and changes ;-) please see
http://cgit.freedesktop.org/libreoffice/core/commit/?id=c6b49f9098fb6c9816202e8d465c342788736af5

Please also confirm that you contribute this and future patches licensed
under LGPLv3+ and MPL 1.1

Thanks
  Eike

--
 PGP/OpenPGP/GnuPG encrypted mail preferred in all private communication.
 Key ID: 0x293C05FD - 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

signature.asc (205 bytes) Download Attachment
Eike Rathke Eike Rathke
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

In reply to this post by Korrawit Pruegsanusak
Hi Korrawit,

On Tuesday, 2011-09-06 21:52:46 +0700, Korrawit Pruegsanusak wrote:

> And please s/interger/integer ;)

Did that in the commit.

> Also, it seems that you haven't check the range of ishift yet, whether
> it is between -48 and 48 (from your description), or it isn't
> necessary? I don't have knowledge on this.

Actually those don't have to be restricted and I implemented another
algorithm to support larger values.

> My last nitpick, what about the strings capitalization?

Also did that.

  Eike

--
 PGP/OpenPGP/GnuPG encrypted mail preferred in all private communication.
 Key ID: 0x293C05FD - 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

signature.asc (205 bytes) Download Attachment
Eike Rathke Eike Rathke
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

In reply to this post by Olivier Hallot
Hi Olivier,

On Sunday, 2011-09-04 16:42:38 -0300, Olivier Hallot wrote:

> If pushed, these new functions should be advertised in the Release notes.

What's the procedure for that?

  Eike

--
 PGP/OpenPGP/GnuPG encrypted mail preferred in all private communication.
 Key ID: 0x293C05FD - 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

signature.asc (205 bytes) Download Attachment
Regina Henschel Regina Henschel
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

In reply to this post by Eike Rathke
Hi Eike,

I see a lot of sal_uInt64 in the code. Is that supported for Windows? As
far as I know at least the MSVC Express has only 4Byte long.

Kind regards
Regina

Eike Rathke schrieb:

> Hi Korrawit,
>
> On Tuesday, 2011-09-06 21:52:46 +0700, Korrawit Pruegsanusak wrote:
>
>> And please s/interger/integer ;)
>
> Did that in the commit.
>
>> Also, it seems that you haven't check the range of ishift yet, whether
>> it is between -48 and 48 (from your description), or it isn't
>> necessary? I don't have knowledge on this.
>
> Actually those don't have to be restricted and I implemented another
> algorithm to support larger values.
>
>> My last nitpick, what about the strings capitalization?
>
> Also did that.
>
>    Eike
>
>
>
>
> _______________________________________________
> LibreOffice mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/libreoffice

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Eike Rathke Eike Rathke
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

Hi Regina,

On Wednesday, 2011-09-07 15:04:47 +0200, Regina Henschel wrote:

> I see a lot of sal_uInt64 in the code. Is that supported for
> Windows? As far as I know at least the MSVC Express has only 4Byte
> long.

Umm.. now that you mention.. sal/inc/sal/types.h has

#if (_MSC_VER >= 1000)
    typedef __int64                  sal_Int64;
    typedef unsigned __int64         sal_uInt64;

so what evaluates _MSC_VER to in MSVCE?

Also noticing there

    #define SAL_CONST_UINT64(x)      x##ui64

so the constant I introduced probably should use that.

If MSVCE doesn't support 64bit values I might do some tricks using the
double mantissa.

  Eike

--
 PGP/OpenPGP/GnuPG encrypted mail preferred in all private communication.
 Key ID: 0x293C05FD - 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

signature.asc (205 bytes) Download Attachment
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

On 09/07/2011 04:37 PM, Eike Rathke wrote:

> Hi Regina,
>
> On Wednesday, 2011-09-07 15:04:47 +0200, Regina Henschel wrote:
>
>> I see a lot of sal_uInt64 in the code. Is that supported for
>> Windows? As far as I know at least the MSVC Express has only 4Byte
>> long.
>
> Umm.. now that you mention.. sal/inc/sal/types.h has
>
> #if (_MSC_VER>= 1000)
>      typedef __int64                  sal_Int64;
>      typedef unsigned __int64         sal_uInt64;
>
> so what evaluates _MSC_VER to in MSVCE?
>
> Also noticing there
>
>      #define SAL_CONST_UINT64(x)      x##ui64
>
> so the constant I introduced probably should use that.
>
> If MSVCE doesn't support 64bit values I might do some tricks using the
> double mantissa.

But we use sal_[u]Int64 all over the code base, and the default case in
sal/types.h (to typedef it to a struct of smaller ints) is long gone, so
I would assume _MSC_VER>=1000 really means any _MSC_VER here.

-Stephan
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Noel Grandin Noel Grandin
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

In reply to this post by Eike Rathke
Visual Studio has supported 64-bit int types (long long) since at least Visual Studio 2005. See here:
http://msdn.microsoft.com/en-us/library/s3f49ktz(v=vs.80).aspx

_MSC_VER evaluates to the version of the Visual Studio compiler. See here:
http://msdn.microsoft.com/en-us/library/b0084kay(v=VS.80).aspx

Eike Rathke wrote:
Hi Regina,

On Wednesday, 2011-09-07 15:04:47 +0200, Regina Henschel wrote:

I see a lot of sal_uInt64 in the code. Is that supported for
Windows? As far as I know at least the MSVC Express has only 4Byte
long.
Umm.. now that you mention.. sal/inc/sal/types.h has

#if (_MSC_VER >= 1000)
    typedef __int64                  sal_Int64;
    typedef unsigned __int64         sal_uInt64;

so what evaluates _MSC_VER to in MSVCE?

Also noticing there

    #define SAL_CONST_UINT64(x)      x##ui64

so the constant I introduced probably should use that.

If MSVCE doesn't support 64bit values I might do some tricks using the
double mantissa.

  Eike



_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice




Disclaimer: http://www.peralex.com/disclaimer.html


_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Regina Henschel Regina Henschel
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

In reply to this post by Eike Rathke
Hi Eike,

Eike Rathke schrieb:

> Hi Regina,
>
> On Wednesday, 2011-09-07 15:04:47 +0200, Regina Henschel wrote:
>
>> I see a lot of sal_uInt64 in the code. Is that supported for
>> Windows? As far as I know at least the MSVC Express has only 4Byte
>> long.
>
> Umm.. now that you mention.. sal/inc/sal/types.h has
>
> #if (_MSC_VER>= 1000)
>      typedef __int64                  sal_Int64;
>      typedef unsigned __int64         sal_uInt64;
>
> so what evaluates _MSC_VER to in MSVCE?

How can I get that information?

In Env.Host.sh I get the lines:
SIZEOF_SHORT="2"
SIZEOF_INT="4"
SIZEOF_LONG="4"
SIZEOF_LONGLONG="8"
SIZEOF_POINTER="4"


Kind regards
Regina
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Dennis E. Hamilton Dennis E. Hamilton
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

In reply to this post by Thorsten Behrens
Hmm,    MSC_VER 1600 is VC++ 2010
                1500 is VC++ 2008

I don't have any older versions installed at the moment.  (The enclosed program I used to find these has CRLF for newlines and probably no tabs.)

 - Dennis
                 

-----Original Message-----
From: libreoffice-bounces+dennis.hamilton=[hidden email] [mailto:libreoffice-bounces+dennis.hamilton=[hidden email]] On Behalf Of Regina Henschel
Sent: Wednesday, September 07, 2011 07:58
To: Korrawit Pruegsanusak; [hidden email]; Thorsten Behrens; [hidden email]
Subject: Re: [Libreoffice] Updated [Patch] new BITxxx functions for ODF 1.2

Hi Eike,

Eike Rathke schrieb:

> Hi Regina,
>
> On Wednesday, 2011-09-07 15:04:47 +0200, Regina Henschel wrote:
>
>> I see a lot of sal_uInt64 in the code. Is that supported for
>> Windows? As far as I know at least the MSVC Express has only 4Byte
>> long.
>
> Umm.. now that you mention.. sal/inc/sal/types.h has
>
> #if (_MSC_VER>= 1000)
>      typedef __int64                  sal_Int64;
>      typedef unsigned __int64         sal_uInt64;
>
> so what evaluates _MSC_VER to in MSVCE?
How can I get that information?

In Env.Host.sh I get the lines:
SIZEOF_SHORT="2"
SIZEOF_INT="4"
SIZEOF_LONG="4"
SIZEOF_LONGLONG="8"
SIZEOF_POINTER="4"


Kind regards
Regina
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

showdefs.c (4K) Download Attachment
Dennis E. Hamilton Dennis E. Hamilton
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

In reply to this post by Thorsten Behrens
Um, of course, having 64 bit integers and having the bit-wise functions work on them at full width is a bit different.  Easy to test though.

The Visual C++ Express Editions have had the same 64-bit (long long) support as the full-up Visual Studio Professional editions, etc., since the first (Visual C++ Express Edition 2005).

 - Dennis

-----Original Message-----
From: libreoffice-bounces+dennis.hamilton=[hidden email] [mailto:libreoffice-bounces+dennis.hamilton=[hidden email]] On Behalf Of Noel Grandin
Sent: Wednesday, September 07, 2011 07:49
To: Regina Henschel; Korrawit Pruegsanusak; [hidden email]; Thorsten Behrens; [hidden email]
Subject: Re: [Libreoffice] Updated [Patch] new BITxxx functions for ODF 1.2

Visual Studio has supported 64-bit int types (long long) since at least Visual Studio 2005. See here:
http://msdn.microsoft.com/en-us/library/s3f49ktz(v=vs.80).aspx <http://msdn.microsoft.com/en-us/library/s3f49ktz%28v=vs.80%29.aspx>

_MSC_VER evaluates to the version of the Visual Studio compiler. See here:
http://msdn.microsoft.com/en-us/library/b0084kay(v=VS.80).aspx <http://msdn.microsoft.com/en-us/library/b0084kay%28v=VS.80%29.aspx>

Eike Rathke wrote:

        Hi Regina,
       
        On Wednesday, 2011-09-07 15:04:47 +0200, Regina Henschel wrote:
       

                I see a lot of sal_uInt64 in the code. Is that supported for
                Windows? As far as I know at least the MSVC Express has only 4Byte
                long.

       
        Umm.. now that you mention.. sal/inc/sal/types.h has
       
        #if (_MSC_VER >= 1000)
            typedef __int64                  sal_Int64;
            typedef unsigned __int64         sal_uInt64;
       
        so what evaluates _MSC_VER to in MSVCE?
       
        Also noticing there
       
            #define SAL_CONST_UINT64(x)      x##ui64
       
        so the constant I introduced probably should use that.
       
        If MSVCE doesn't support 64bit values I might do some tricks using the
        double mantissa.
       
          Eike
       

         
       
        _______________________________________________
        LibreOffice mailing list
        [hidden email]
        http://lists.freedesktop.org/mailman/listinfo/libreoffice




________________________________

Disclaimer: http://www.peralex.com/disclaimer.html



_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Regina Henschel Regina Henschel
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

Hi Dennis,

Dennis E. Hamilton schrieb:
> Um, of course, having 64 bit integers and having the bit-wise
> functions work on them at full width is a bit different.  Easy to
> test though.
>
> The Visual C++ Express Editions have had the same 64-bit (long long)
> support as the full-up Visual Studio Professional editions, etc.,
> since the first (Visual C++ Express Edition 2005).
>

Thanks, I didn't know, that is works in Express Editions too. When my
build is finished, I can try the new functions nevertheless and report,
if I get an error.

Kind regards
Regina


_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Olivier Hallot Olivier Hallot
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

In reply to this post by Eike Rathke
Hi Eike

Well... no specific procedure, except to edit the wiki as I did (just to
not
forget it):

http://wiki.documentfoundation.org/ReleaseNotes/3.5#Calc

Olivier

Em 07-09-2011 09:51, Eike Rathke escreveu:
> Hi Olivier,
>
> On Sunday, 2011-09-04 16:42:38 -0300, Olivier Hallot wrote:
>
>> If pushed, these new functions should be advertised in the Release notes.
> What's the procedure for that?
>
>    Eike
>

--
Olivier Hallot
Founder, Steering Commitee Member - The Document Foundation
Voicing the enterprise needs
LibreOffice translation leader for Brazilian Portuguese
+55-21-8822-8812

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Tor Lillqvist-2 Tor Lillqvist-2
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

In reply to this post by Noel Grandin
> Visual Studio has supported 64-bit int types (long long) since at least
> Visual Studio 2005.

Isn't "__int64" (and "unsigned __int64") the more traditional name for
the 64-bit integer types in MSVC? "long long" is newer in MSVC; in
other compilers it is of course the "normal" one.

--tml
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Eike Rathke Eike Rathke
Reply | Threaded
Open this post in threaded view
|

Re: Updated [Patch] new BITxxx functions for ODF 1.2

In reply to this post by Olivier Hallot
Hi Olivier,

On Wednesday, 2011-09-07 15:59:29 -0300, Olivier Hallot wrote:

> Well... no specific procedure, except to edit the wiki as I did
> (just to not
> forget it):
>
> http://wiki.documentfoundation.org/ReleaseNotes/3.5#Calc

Thanks, just needed a pointer..

  Eike

--
 PGP/OpenPGP/GnuPG encrypted mail preferred in all private communication.
 Key ID: 0x293C05FD - 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

signature.asc (205 bytes) Download Attachment
Next » 12