On Tuesday, 27 June 2017 at 15:01:41 UTC, Adam D. Ruppe wrote:
On Tuesday, 27 June 2017 at 14:29:05 UTC, FoxyBrown wrote:
D's error messaging is terrible in some ways. I am trying to get some code to work and this is the error:

I agree, that error message is terrible, and that's why I have a PR open to change it.

But this specific case is weird to me too. stb_truetype.d is a port from C code, and I use it without any compile errors. Did you modify the code?

Find the bug!

Even worse, I don't even see an error in that error message. The arguments it lists look acceptable.

Hi Adam,

Yeah, I don't know, I think I had it working before but now it seems a lot of your code is not working. I did not change the std_truetype.d file. Just to make sure I copied and pasted the git source in to the original.

alias STBTT_sort = core.stdc.stdlib.qsort;

Is it possible that core.stdc.stdlib.qsort changed?

void qsort(scope void* base, size_t nmemb, size_t size, _compare_fp_t
compar);


arsd\stb_truetype.d(1251): Error: function core.stdc.stdlib.qsort (scope void* base, uint nmemb, uint size, extern (C) int function(scope const(void*), scope const(void*)) @system compar) is not callable using argument types (void*, uint, uint, extern (C) int function(const(void*) p, const(void*) q))

I changed your variables to size_t and they obviously match. The things that don't match are the scope's.

qsort(scope void* base, uint nmemb, uint size, extern (C) int function(scope const(void*), scope const(void*)) @system compar)

(void*, uint, uint, extern (C) int function(const(void*) p, const(void*) q))



I am also getting a run time error with your png loading module.


                        void popFront () {
                                bufpos = 0;
                                while (plpos != plpos.max && bufpos < 
chunkSize) {
                                        // do we have some bytes in zstream?
                                        if (zs.avail_in > 0) {
                                                // just unpack
                                                zs.next_out = 
cast(typeof(zs.next_out))(buffer.ptr+bufpos);
                                                int rd = chunkSize-bufpos;
                                                zs.avail_out = rd;
                                                auto err = inflate(&zs, 
Z_SYNC_FLUSH);
if (err != Z_STREAM_END && err != Z_OK) throw new Exception("PNG unpack error");

Errors out with unpack error. This code used to work so it is probably on my system.

Reply via email to