Liste des Groupes | Revenir à cl c |
On 14/06/2024 00:55, Ben Bacarisse wrote:Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:But these are not Baby X functions.
On 13/06/2024 19:01, bart wrote:This is how C works. There's no point in moaning about it. Use anotherAnd here it just gets even uglier. You also get situations like this:Exactly. We can't have this just to print out an integer.
uint64_t i=0;
printf("%lld\n", i);
This compiles OK with gcc -Wall, on Windows64. But compile under Linux64
and it complains the format should be %ld. Change it to %ld, and it
complains under Windows.
It can't tell you that you should be using one of those ludicrous macros.
I've also just noticed that 'i' is unsigned but the format calls for
signed. That may or may not be deliberate, but the compiler didn't say
anything.
>
language or do what you have to in C.
In Baby X I provide a function called bbx_malloc(). It's is guaranteedAnd if you need to change the size?
never to return null. Currently it just calls exit() on allocation failure.
But it also limits allocation to slightly under INT_MAX. Which should be
plenty for a Baby program, and if you want more, you always have big boy's
malloc.
But at a stroke, that gets rid of any need for size_t,But sizeof, strlen (and friends like the mbs... and wcs... functions),
strspn (and friend), strftime, fread, fwrite. etc. etc. all return
size_t.
No, because we store images as unsigned char buffers. But it's convenientand long is veryIsn't that rather wasteful when long is 64 bits?
special purpose (it holds the 32 bit rgba values).
to pass around coulor values in a single variable.
However there is the worry that accessing rgba channels as bytes rather
than insisting that the buffer be aligned, and accessing as a 32-bit
value,
Les messages affichés proviennent d'usenet.