On Tue, Jun 06, 2006 at 10:51:25AM +0200, Abdelrazak Younes wrote:
> >Why is it a performance warning?
>
> Because you loose precision: 32 bits -> 1 bit
And that loses performance how?
Andre' [Not discussing '32' and '1' here]
On Wed, Jun 07, 2006 at 12:39:04AM +0200, Peter Kümmel wrote:
> Lars Gullik Bjønnes wrote:
>
> > | Obviously, I'm in a pedantic mood. These two are casts:
> > |(bool)1;
> > |static_cast(1);
> > | This one isn't:
> > |bool(1);
> >
> > I think I still prefere this last one.
>
> When we
On Sun, Jun 04, 2006 at 02:06:50PM +0200, Peter Kümmel wrote:
> Index: DepTable.C
> ===
> --- DepTable.C(Revision 13994)
> +++ DepTable.C(Arbeitskopie)
> @@ -253,5 +253,5 @@
> }
> deplist[nom
On Sun, Jun 04, 2006 at 02:06:50PM +0200, Peter Kümmel wrote:
> And here a patch which removes a lot of
> warning about performance
Btw MSVC's 'performance warnings' when usinh int in place of bools are
bogus. Should be silenced on the command line.
Andre'
On Tue, Jun 06, 2006 at 09:40:27AM +, Angus Leeming wrote:
> Abdelrazak Younes <[EMAIL PROTECTED]> writes:
> > > | > (the warning was:
> > > | > ..\..\lyx-devel\src\lyxtextclass.C(1065) : warning C4800: 'int' :
> > > | > forcing value to bool 'true' or 'false' (performance warning)
> > > | > )
Lars Gullik Bjønnes wrote:
> Peter Kümmel <[EMAIL PROTECTED]> writes:
>
> | When we use a C compiler then it uses the C-style cast (bool),
> | so I think the correctest way is to use static_cast,
> | but this is so ugly that I would prefer (bool).
>
> C-style casts are just too powerful... don't
Peter Kümmel <[EMAIL PROTECTED]> writes:
| When we use a C compiler then it uses the C-style cast (bool),
| so I think the correctest way is to use static_cast,
| but this is so ugly that I would prefer (bool).
C-style casts are just too powerful... don't use them.
| I'm not sure if the bool con
Lars Gullik Bjønnes wrote:
> | Obviously, I'm in a pedantic mood. These two are casts:
> |(bool)1;
> |static_cast(1);
> | This one isn't:
> |bool(1);
>
> I think I still prefere this last one.
When we compile with a C++ compiler then it casts with
a static_cast a int to bool, therefo
Lars Gullik Bjønnes wrote:
> Why is it a performance warning?
It means: be careful, it will be maybe too fast :)
Angus Leeming <[EMAIL PROTECTED]> writes:
| Testing this out on:
| * an x86 box running Windows and compiling with MSVC2005
| * an x86 box running Linux and compiling with g++ 4.0.2
| * a 64 bit Dec Alpha box running Linux and compiling with g++ 4.0.3
|
| All three produce the output:
| sizeof(bo
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
> > | > (the warning was:
> > | > ..\..\lyx-devel\src\lyxtextclass.C(1065) : warning C4800: 'int' :
> > | > forcing value to bool 'true' or 'false' (performance warning)
> > | > )
> > Why is it a performance warning?
> Because you loose precision: 32 bi
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
| > | Ain't C++ funky? ;-)
| > | | > (the warning was:
| > | > ..\..\lyx-devel\src\lyxtextclass.C(1065) : warning C4800: 'int' :
| > | > forcing value to bool 'true' or 'false' (performance warning)
| > | > )
| > Why is it a performance warning?
|
| B
Lars Gullik Bjønnes wrote:
Angus Leeming <[EMAIL PROTECTED]> writes:
| Peter Kümmel <[EMAIL PROTECTED]> writes:
| > > Yes, it's MSVC. It's a performance warning about possibly loosing
| > > precision due to the automatic cast. You can get rid of the warning via
| > > an explicit cast.
| > >
|
Angus Leeming <[EMAIL PROTECTED]> writes:
| Peter Kümmel <[EMAIL PROTECTED]> writes:
| > > Yes, it's MSVC. It's a performance warning about possibly loosing
| > > precision due to the automatic cast. You can get rid of the warning via
| > > an explicit cast.
| > >
| > > + return bool(provi
Peter Kümmel <[EMAIL PROTECTED]> writes:
| And here a patch which removes a lot of
| warning about performance and some
| signed/unsigned mismatches.
What compiler is this Ãand what warnings do you actually see?
In particualr the performance warnings.
It seems that you compiler is to chatty.
T
Angus Leeming wrote:
> Peter Kümmel <[EMAIL PROTECTED]> writes:
>>> Yes, it's MSVC. It's a performance warning about possibly loosing
>>> precision due to the automatic cast. You can get rid of the warning via
>>> an explicit cast.
>>>
>>> + return bool(provides_ & p);
>> Yes, that's a better
Peter Kümmel <[EMAIL PROTECTED]> writes:
> > Yes, it's MSVC. It's a performance warning about possibly loosing
> > precision due to the automatic cast. You can get rid of the warning via
> > an explicit cast.
> >
> > + return bool(provides_ & p);
>
> Yes, that's a better solution.
It's cer
Abdelrazak Younes wrote:
> Angus Leeming wrote:
>> Georg Baum <[EMAIL PROTECTED]> writes:
- return provides_ & p;
+ return (provides_ & p) != 0;
}
>>
>>> I have the feeling that you will get objections for things like this
>>> from others.
>>
>> Ceratinly, it seems unnce
Angus Leeming wrote:
Georg Baum <[EMAIL PROTECTED]> writes:
- return provides_ & p;
+ return (provides_ & p) != 0;
}
I have the feeling that you will get objections for things like this from
others.
Ceratinly, it seems unncesessary. C++ (unlike C#) has an implicit cast from int
Georg Baum <[EMAIL PROTECTED]> writes:
> > + return deplist.size() != 0;
>
> We use
> + return !deplist.empty();
> all over the place.
Right. And using "empty()" is often much faster than "size() != 0", so it's a
good habbit to get into.
> > - return provides_ & p;
> > +
Am Sonntag, 4. Juni 2006 14:06 schrieb Peter Kümmel:
> And here a patch which removes a lot of
> warning about performance and some
> signed/unsigned mismatches.
I see the signed/unsigned things, but which changes should have something
to do with performance? Which compiler is that?
> Index: D
Peter Kümmel wrote:
And here a patch which removes a lot of
warning about performance and some
signed/unsigned mismatches.
They all seems safe.
Abdel.
And here a patch which removes a lot of
warning about performance and some
signed/unsigned mismatches.
Peter
Index: DepTable.C
===
--- DepTable.C (Revision 13994)
+++ DepTable.C (Arbeitskopie)
@@ -253,5 +253,5 @@
}
23 matches
Mail list logo