summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-08-05 10:41:11 +0000
committerrodri <rgl@antares-labs.eu>2024-08-05 10:41:11 +0000
commit05ae0d42a944f6c7d940a5e58eb90b619dadbfdb (patch)
treef9b7e7ff1c189ded71d965bdc3eccf27ef26e462 /internal.h
parentc06379ee3aa51d3adf456c8d126feebd1da9de70 (diff)
downloadlibgraphics-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.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal.h b/internal.h
index 6cd512c..8b6784f 100644
--- a/internal.h
+++ b/internal.h
@@ -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;}