#how do i make zls not translate my function arguments to const

1 messages · Page 1 of 1 (latest)

edgy cloak
#

i have this c code and i need to call SDL_SetWindowHitTest with correct arguments

void App_setBorder(App* app, Border* border) {
    app->border = border;
    SDL_SetWindowHitTest(app->window, &Border_hitTest, (void*)border);
}

i call the function with SDL_HitTestResult Border_hitTest(SDL_Window* window, SDL_Point* point, void* data) and it's correct, but i get this error

C:\Users\bashref\Desktop\test\src-c\app.c:48:39: error: incompatible function pointer types passing 'SDL_HitTestResult (*)(SDL_Window *, SDL_Point *, void *)' (aka 'enum SDL_HitTestResult (*)(struct SDL_Window *, struct SDL_Point *, void *)') to parameter of type 'SDL_HitTest' (aka 'enum SDL_HitTestResult (*)(struct SDL_Window *, const struct SDL_Point *, void *)')
    SDL_SetWindowHitTest(app->window, &Border_hitTest, (void*)border);

it doesn't like that i pass in (aka 'enum SDL_HitTestResult (*)(struct SDL_Window *, const struct SDL_Point *, void *)')
even tho i passed in (aka 'enum SDL_HitTestResult (*)(struct SDL_Window *, struct SDL_Point *, void *)')

how do i make zls not translate my arguments to constants?

#

how do i make zls not translate my function arguments to const

errant swallow
#

for context we thought you're complaining that

var s = ...;

gets converted to

const s = ...;