Move clamp() to screen.c.

This commit is contained in:
Andrew Alderwick 2022-01-20 01:24:13 +00:00
parent cf84a5d661
commit cd0ca2eb17
3 changed files with 7 additions and 6 deletions

View File

@ -108,6 +108,12 @@ screen_redraw(UxnScreen *p, Uint32 *pixels)
p->fg.changed = p->bg.changed = 0;
}
int
clamp(int val, int min, int max)
{
return (val >= min) ? (val <= max) ? val : max : min;
}
/* IO */
Uint8

View File

@ -34,3 +34,4 @@ void screen_redraw(UxnScreen *p, Uint32 *pixels);
Uint8 screen_dei(Device *d, Uint8 port);
void screen_deo(Device *d, Uint8 port);
int clamp(int val, int min, int max);

View File

@ -46,12 +46,6 @@ static Device *devscreen, *devmouse, *devctrl, *devaudio0;
static Uint8 zoom = 1;
static Uint32 stdin_event, audio0_event;
static int
clamp(int val, int min, int max)
{
return (val >= min) ? (val <= max) ? val : max : min;
}
static int
error(char *msg, const char *err)
{