/+ SDL3 has a function
bool SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha);
which has a Uint8 for one of its parameters. So I try to use a ubyte
+/


void main()
{
    ubyte a;
a = a + 5; // onlineapp.d(11): Error: cannot implicitly convert expression `cast(int)a +
                  5` of type `int` to `ubyte`

    import core.stdc.stdint;
    uint8_t b;
b = b + 5; // onlineapp.d(17): Error: cannot implicitly convert expression `cast(int)b +
                  5` of type `int` to `ubyte`

cast(uint8_t) b = cast(uint8_t) b + cast(uint8_t) 5; // onlineapp.d(19): Error: cannot implicitly convert expression `cast(int)b + 5` of type `int` to `ubyte`

}

Reply via email to