diff options
author | rodri <rgl@antares-labs.eu> | 2024-08-05 10:41:11 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-08-05 10:41:11 +0000 |
commit | 05ae0d42a944f6c7d940a5e58eb90b619dadbfdb (patch) | |
tree | f9b7e7ff1c189ded71d965bdc3eccf27ef26e462 /internal.h | |
parent | c06379ee3aa51d3adf456c8d126feebd1da9de70 (diff) | |
download | libgraphics-05ae0d42a944f6c7d940a5e58eb90b619dadbfdb.tar.gz libgraphics-05ae0d42a944f6c7d940a5e58eb90b619dadbfdb.tar.bz2 libgraphics-05ae0d42a944f6c7d940a5e58eb90b619dadbfdb.zip |
fix a double-free. add a generic value-swapping macro.
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -45,7 +45,6 @@ void rmfbctl(Framebufctl*); /* vertex */ Vertex dupvertex(Vertex*); -void swapvertex(Vertex*, Vertex*); void lerpvertex(Vertex*, Vertex*, Vertex*, double); void berpvertex(Vertex*, Vertex*, Vertex*, Vertex*, Point3); void delvattrs(Vertex*); @@ -58,8 +57,6 @@ int rectclipline(Rectangle, Point*, Point*, Vertex*, Vertex*); /* util */ int min(int, int); int max(int, int); -void swapi(int*, int*); -void swappt(Point*, Point*); void memsetf(void*, float, usize); void memsetl(void*, ulong, usize); @@ -70,3 +67,6 @@ uvlong nanosec(void); #define getpixel(fb, p) (((fb)->cb)[Dx((fb)->r)*(p).y + (p).x]) /* void putpixel(Framebuf *fb, Point p, ulong c) */ #define putpixel(fb, p, c) (((fb)->cb)[Dx((fb)->r)*(p).y + (p).x] = (c)) + +/* void SWAP(type t, type *a, type *b) */ +#define SWAP(t, a, b) {t tmp; tmp = *(a); *(a) = *(b); *(b) = tmp;} |