openoffice-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis E. Hamilton" <dennis.hamil...@acm.org>
Subject RE: Error on enum statement. Can sombody take a little time and explain the enum and the error?
Date Mon, 02 Jan 2017 06:07:35 GMT


> -----Original Message-----
> From: Peter Kovacs [mailto:leginee@gmail.com]
> Sent: Sunday, January 1, 2017 17:07
> To: dev <dev@openoffice.apache.org>
> Subject: Error on enum statement. Can sombody take a little time and
> explain the enum and the error?
> 
> Hello all,
> 
> 
> I tried to compile the source again. since I had again missing
> definition on trunc I wanted to know if I can build at least the 4.1.3
> release. I checked out the branch and started all over.
> 
> And I ran into following Issue:
> 
> ../inc/basebmp/packedpixeliterator.hxx:80:10: error: enumerator value
> for 'bit_mask' is not an integer constant
> 
> The corresponding code is:
> 
>    enum {
>          /** The number of pixel within a single value_type value
>           */
> num_intraword_positions=sizeof(value_type)*8/bits_per_pixel,
>          /** Bit mask for one pixel (least significant bits)
>           */
>          bit_mask=~(~0 << bits_per_pixel)
[orcmid] 


Try a couple of things:

 1. Put spaces in the "=~" to be something like " = ~" in the definition of bit_mask.

 2. If that makes no difference, try 

          bit_mask = ~ ((value_type)(~0 << bits_per_pixel))

    and if that doesn't work, see if 

          bit_mask = ~ ((int)(~0 << bits_per_pixel))

    or even

          bit_mask = (int) (~(~0 << bits_per_pixel))

    get the job done.

It seems strange for an enum being used this way.  It is a clumsy way to define two numeric
constants that are not involved in an enumeration at all.

>      };
> 
> 
> An explanation would be great. I found [1] on the net, but I am realy
> unsure if this is the same. And I do not understand the code in
> packedpixeliterator at all.
> 
> All the best and thanks for your time.
> 
> Peter
> 
> 
> [1]
> http://stackoverflow.com/questions/18090541/how-to-set-the-value-of-an-
> enumeration-constant-outside-the-range-of-int#18090940
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org



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


Mime
View raw message