util: refactor intmin/max to standalone file
This commit is contained in:
parent
dfce649314
commit
d6ae83b0a8
@ -4,6 +4,7 @@
|
||||
#include "color.h"
|
||||
#include "unifont.h"
|
||||
#include "../runtime/stdio.h"
|
||||
#include "../util/minmax.h"
|
||||
#include <efiprot.h>
|
||||
|
||||
#include <assert.h>
|
||||
@ -159,10 +160,6 @@ void graphics_ClearBuffer(const HelosGraphics_Color *color) {
|
||||
}
|
||||
}
|
||||
|
||||
static inline size_t min(size_t x, size_t y) {
|
||||
return x < y ? x : y;
|
||||
}
|
||||
|
||||
void graphics_SwapBuffer() {
|
||||
memcpy(graphics_DeviceFramebuffer, graphics_Framebuffer, graphics_FramebufferSize);
|
||||
|
||||
|
10
util/minmax.h
Normal file
10
util/minmax.h
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
static inline int intmin(int x, int y) {
|
||||
return x < y ? x : y;
|
||||
}
|
||||
|
||||
static inline int intmax(int x, int y) {
|
||||
return x > y ? x : y;
|
||||
}
|
Loading…
Reference in New Issue
Block a user