summaryrefslogtreecommitdiff
path: root/src/plot
diff options
context:
space:
mode:
Diffstat (limited to 'src/plot')
-rw-r--r--src/plot/16bpp.c8
-rw-r--r--src/plot/32bpp-xbgr8888.c15
-rw-r--r--src/plot/32bpp-xrgb8888.c15
-rw-r--r--src/plot/generic.c14
4 files changed, 27 insertions, 25 deletions
diff --git a/src/plot/16bpp.c b/src/plot/16bpp.c
index d629944..9aa7ab1 100644
--- a/src/plot/16bpp.c
+++ b/src/plot/16bpp.c
@@ -18,23 +18,23 @@
#include "nsfb.h"
#include "plot.h"
-#define UNUSED __attribute__((unused))
-
static inline uint16_t *get_xy_loc(nsfb_t *nsfb, int x, int y)
{
return (void *)(nsfb->ptr + (y * nsfb->linelen) + (x << 1));
}
-static inline nsfb_colour_t pixel_to_colour(UNUSED nsfb_t *nsfb, uint16_t pixel)
+static inline nsfb_colour_t pixel_to_colour(nsfb_t *nsfb, uint16_t pixel)
{
+ UNUSED(nsfb);
return ((pixel & 0x1F) << 19) |
((pixel & 0x7E0) << 5) |
((pixel & 0xF800) >> 8);
}
/* convert a colour value to a 16bpp pixel value ready for screen output */
-static inline uint16_t colour_to_pixel(UNUSED nsfb_t *nsfb, nsfb_colour_t c)
+static inline uint16_t colour_to_pixel(nsfb_t *nsfb, nsfb_colour_t c)
{
+ UNUSED(nsfb);
return ((c & 0xF8) << 8) | ((c & 0xFC00 ) >> 5) | ((c & 0xF80000) >> 19);
}
diff --git a/src/plot/32bpp-xbgr8888.c b/src/plot/32bpp-xbgr8888.c
index 9050903..07613ff 100644
--- a/src/plot/32bpp-xbgr8888.c
+++ b/src/plot/32bpp-xbgr8888.c
@@ -18,36 +18,37 @@
#include "nsfb.h"
#include "plot.h"
-
-#define UNUSED __attribute__((unused))
-
static inline uint32_t *get_xy_loc(nsfb_t *nsfb, int x, int y)
{
return (void *)(nsfb->ptr + (y * nsfb->linelen) + (x << 2));
}
#if __BYTE_ORDER == __BIG_ENDIAN
-static inline nsfb_colour_t pixel_to_colour(UNUSED nsfb_t *nsfb, uint32_t pixel)
+static inline nsfb_colour_t pixel_to_colour(nsfb_t *nsfb, uint32_t pixel)
{
+ UNUSED(nsfb);
/* TODO: FIX */
return (pixel >> 8) & ~0xFF000000U;
}
/* convert a colour value to a 32bpp pixel value ready for screen output */
-static inline uint32_t colour_to_pixel(UNUSED nsfb_t *nsfb, nsfb_colour_t c)
+static inline uint32_t colour_to_pixel(nsfb_t *nsfb, nsfb_colour_t c)
{
+ UNUSED(nsfb);
/* TODO: FIX */
return (c << 8);
}
#else /* __BYTE_ORDER == __BIG_ENDIAN */
-static inline nsfb_colour_t pixel_to_colour(UNUSED nsfb_t *nsfb, uint32_t pixel)
+static inline nsfb_colour_t pixel_to_colour(nsfb_t *nsfb, uint32_t pixel)
{
+ UNUSED(nsfb);
return pixel | 0xFF000000U;
}
/* convert a colour value to a 32bpp pixel value ready for screen output */
-static inline uint32_t colour_to_pixel(UNUSED nsfb_t *nsfb, nsfb_colour_t c)
+static inline uint32_t colour_to_pixel(nsfb_t *nsfb, nsfb_colour_t c)
{
+ UNUSED(nsfb);
return c;
}
#endif
diff --git a/src/plot/32bpp-xrgb8888.c b/src/plot/32bpp-xrgb8888.c
index 548c970..fb69d91 100644
--- a/src/plot/32bpp-xrgb8888.c
+++ b/src/plot/32bpp-xrgb8888.c
@@ -18,36 +18,37 @@
#include "nsfb.h"
#include "plot.h"
-
-#define UNUSED __attribute__((unused))
-
static inline uint32_t *get_xy_loc(nsfb_t *nsfb, int x, int y)
{
return (void *)(nsfb->ptr + (y * nsfb->linelen) + (x << 2));
}
#if __BYTE_ORDER == __BIG_ENDIAN
-static inline nsfb_colour_t pixel_to_colour(UNUSED nsfb_t *nsfb, uint32_t pixel)
+static inline nsfb_colour_t pixel_to_colour(nsfb_t *nsfb, uint32_t pixel)
{
+ UNUSED(nsfb);
return (pixel >> 8) & ~0xFF000000U;
}
/* convert a colour value to a 32bpp pixel value ready for screen output */
-static inline uint32_t colour_to_pixel(UNUSED nsfb_t *nsfb, nsfb_colour_t c)
+static inline uint32_t colour_to_pixel(nsfb_t *nsfb, nsfb_colour_t c)
{
+ UNUSED(nsfb);
return (c << 8);
}
#else /* __BYTE_ORDER == __BIG_ENDIAN */
-static inline nsfb_colour_t pixel_to_colour(UNUSED nsfb_t *nsfb, uint32_t pixel)
+static inline nsfb_colour_t pixel_to_colour(nsfb_t *nsfb, uint32_t pixel)
{
+ UNUSED(nsfb);
return ((pixel & 0xFF) << 16) |
((pixel & 0xFF00)) |
((pixel & 0xFF0000) >> 16);
}
/* convert a colour value to a 32bpp pixel value ready for screen output */
-static inline uint32_t colour_to_pixel(UNUSED nsfb_t *nsfb, nsfb_colour_t c)
+static inline uint32_t colour_to_pixel(nsfb_t *nsfb, nsfb_colour_t c)
{
+ UNUSED(nsfb);
return ((c & 0xff0000) >> 16) | (c & 0xff00) | ((c & 0xff) << 16);
}
#endif
diff --git a/src/plot/generic.c b/src/plot/generic.c
index 0c3d9e8..87c55c5 100644
--- a/src/plot/generic.c
+++ b/src/plot/generic.c
@@ -605,13 +605,13 @@ copy(nsfb_t *nsfb, nsfb_bbox_t *srcbox, nsfb_bbox_t *dstbox)
static bool arc(nsfb_t *nsfb, int x, int y, int radius, int angle1, int angle2, nsfb_colour_t c)
{
- nsfb=nsfb;
- x = x;
- y = y;
- radius = radius;
- c = c;
- angle1=angle1;
- angle2=angle2;
+ UNUSED(nsfb);
+ UNUSED(x);
+ UNUSED(y);
+ UNUSED(radius);
+ UNUSED(c);
+ UNUSED(angle1);
+ UNUSED(angle2);
return true;
}