Re: Strange function

2019-11-12 Thread Orfeo via Digitalmars-d-learn

On Tuesday, 12 November 2019 at 21:05:35 UTC, Adam D. Ruppe wrote:

On Tuesday, 12 November 2019 at 20:45:11 UTC, Orfeo wrote:

In druntime (core/bitop.d line 302) I found this function


it is a magic function that the compiler recognizes and outputs 
a cpu instruction instead of a regular call.


core.bitop has a few of those.


Wow! Thank you very much


Re: Strange function

2019-11-12 Thread Adam D. Ruppe via Digitalmars-d-learn

On Tuesday, 12 November 2019 at 20:45:11 UTC, Orfeo wrote:

In druntime (core/bitop.d line 302) I found this function


it is a magic function that the compiler recognizes and outputs a 
cpu instruction instead of a regular call.


core.bitop has a few of those.



Strange function

2019-11-12 Thread Orfeo via Digitalmars-d-learn

In druntime (core/bitop.d line 302) I found this function

```
/**
 * Tests and resets (sets to 0) the bit.
 */
int btr(size_t* p, size_t bitnum) pure @system;

```



Honestly don't understand: where is the body of the function?

I thought I could find something like that:

```
int btr(size_t* p, size_t bitnum) pure @system {
  // body
}


Thank you







Re: really strange function errors

2010-07-23 Thread Trass3r

wtf? we can't diagnose errors w/o context.
Show the relative code.


yeah, was accidentally sent too soon ^^


Re: really strange function errors

2010-07-23 Thread div0

On 23/07/2010 23:39, Trass3r wrote:

Getting a bunch of strange errors, anybody got an inkling what the cause
might be?


Error: function Sprite.size () is not callable using argument types ()
- wtf?

Error: function Sprite.getPixel (uint x, uint y) is not callable using
argument types (uint,uint) const

Error: function Sprite.rotation (float angle) is not callable using
argument types ()
- even though there is a rotation()!


wtf? we can't diagnose errors w/o context.
Show the relative code.

--
My enormous talent is exceeded only by my outrageous laziness.
http://www.ssTk.co.uk


really strange function errors

2010-07-23 Thread Trass3r
Getting a bunch of strange errors, anybody got an inkling what the cause  
might be?



Error: function Sprite.size () is not callable using argument types () -  
wtf?


Error: function Sprite.getPixel (uint x, uint y) is not callable using  
argument types (uint,uint) const


Error: function Sprite.rotation (float angle) is not callable using  
argument types ()

- even though there is a rotation()!


Re: really strange function errors

2010-07-23 Thread Trass3r
Getting a bunch of strange errors, anybody got an inkling what the cause  
might be?


Error: function Sprite.size () is not callable using argument types ()


Ok, this was caused by calling sprite.rotation; on a const Sprite while  
rotation() wasn't marked as const.

The rest is probably similar errors.

The error message is really inexpressive though.


Re: really strange function errors

2010-07-23 Thread bearophile
Trass3r:
 The error message is really inexpressive though.

Can you write a minimal example? This can be good for bugzilla (I have added 
there several bad error message errors).

Bye,
bearophile