mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
mm, audio, crypto, graphics: Fix various spacing/alignment issues
This commit is contained in:
@@ -85,16 +85,18 @@
|
||||
int nxbe_colormap(FAR NX_DRIVERTYPE *dev)
|
||||
{
|
||||
struct fb_cmap_s cmap;
|
||||
uint8_t *alloc;
|
||||
uint8_t *red;
|
||||
uint8_t *green;
|
||||
uint8_t *blue;
|
||||
FAR uint8_t *alloc;
|
||||
FAR uint8_t *red;
|
||||
FAR uint8_t *green;
|
||||
FAR uint8_t *blue;
|
||||
uint8_t rval;
|
||||
uint8_t gval;
|
||||
int size;
|
||||
int ndx;
|
||||
int ret;
|
||||
int i, j, k;
|
||||
int i;
|
||||
int j;
|
||||
int k;
|
||||
|
||||
/* Allocate the color map tables in one allocation:
|
||||
*
|
||||
@@ -102,7 +104,7 @@ int nxbe_colormap(FAR NX_DRIVERTYPE *dev)
|
||||
*/
|
||||
|
||||
size = 3 * CONFIG_NX_NCOLORS * sizeof(uint8_t);
|
||||
alloc = (uint8_t*)kmm_malloc(size);
|
||||
alloc = (FAR uint8_t *)kmm_malloc(size);
|
||||
if (alloc == NULL)
|
||||
{
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void NXGL_FUNCNAME(nxgl_copyrectangle,NXGLIB_SUFFIX)
|
||||
void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX)
|
||||
(FAR struct fb_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *dest,
|
||||
FAR const void *src, FAR const struct nxgl_point_s *origin,
|
||||
unsigned int srcstride)
|
||||
@@ -131,7 +131,7 @@ void NXGL_FUNCNAME(nxgl_copyrectangle,NXGLIB_SUFFIX)
|
||||
|
||||
/* Then copy the image */
|
||||
|
||||
sline = (const uint8_t*)src + NXGL_SCALEX(dest->pt1.x - origin->x) + (dest->pt1.y - origin->y) * srcstride;
|
||||
sline = (FAR const uint8_t *)src + NXGL_SCALEX(dest->pt1.x - origin->x) + (dest->pt1.y - origin->y) * srcstride;
|
||||
dline = pinfo->fbmem + dest->pt1.y * deststride + NXGL_SCALEX(dest->pt1.x);
|
||||
|
||||
while (rows--)
|
||||
@@ -171,7 +171,7 @@ void NXGL_FUNCNAME(nxgl_copyrectangle,NXGLIB_SUFFIX)
|
||||
#else
|
||||
/* Copy the whole line */
|
||||
|
||||
NXGL_MEMCPY((NXGL_PIXEL_T*)dline, (NXGL_PIXEL_T*)sline, width);
|
||||
NXGL_MEMCPY((NXGL_PIXEL_T *)dline, (NXGL_PIXEL_T *)sline, width);
|
||||
#endif
|
||||
dline += deststride;
|
||||
sline += srcstride;
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void NXGL_FUNCNAME(nxgl_fillrectangle,NXGLIB_SUFFIX)
|
||||
void NXGL_FUNCNAME(nxgl_fillrectangle, NXGLIB_SUFFIX)
|
||||
(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *rect,
|
||||
NXGL_PIXEL_T color)
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX)(
|
||||
void NXGL_FUNCNAME(nxgl_filltrapezoid, NXGLIB_SUFFIX)(
|
||||
FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_trapezoid_s *trap,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
|
||||
@@ -127,7 +127,7 @@ static inline void nxgl_lowresmemcpy(FAR uint8_t *dline, FAR const uint8_t *slin
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void NXGL_FUNCNAME(nxgl_getrectangle,NXGLIB_SUFFIX)
|
||||
void NXGL_FUNCNAME(nxgl_getrectangle, NXGLIB_SUFFIX)
|
||||
(FAR struct fb_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect,
|
||||
FAR void *dest, unsigned int deststride)
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void NXGL_FUNCNAME(nxgl_setpixel,NXGLIB_SUFFIX)
|
||||
void NXGL_FUNCNAME(nxgl_setpixel, NXGLIB_SUFFIX)
|
||||
(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_point_s *pos,
|
||||
NXGL_PIXEL_T color)
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void NXGL_FUNCNAME(nxgl_copyrectangle,NXGLIB_SUFFIX)
|
||||
void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX)
|
||||
(FAR struct lcd_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *dest,
|
||||
FAR const void *src, FAR const struct nxgl_point_s *origin,
|
||||
unsigned int srcstride)
|
||||
@@ -103,7 +103,7 @@ void NXGL_FUNCNAME(nxgl_copyrectangle,NXGLIB_SUFFIX)
|
||||
/* Set up to copy the image */
|
||||
|
||||
xoffset = dest->pt1.x - origin->x;
|
||||
sline = (const uint8_t*)src + NXGL_SCALEX(xoffset) + (dest->pt1.y - origin->y) * srcstride;
|
||||
sline = (FAR const uint8_t *)src + NXGL_SCALEX(xoffset) + (dest->pt1.y - origin->y) * srcstride;
|
||||
#if NXGLIB_BITSPERPIXEL < 8
|
||||
remainder = NXGL_REMAINDERX(xoffset);
|
||||
#endif
|
||||
@@ -119,7 +119,7 @@ void NXGL_FUNCNAME(nxgl_copyrectangle,NXGLIB_SUFFIX)
|
||||
|
||||
if (remainder != 0)
|
||||
{
|
||||
NXGL_FUNCNAME(nxgl_copyrun,NXGLIB_SUFFIX)(sline, pinfo->buffer, remainder, ncols);
|
||||
NXGL_FUNCNAME(nxgl_copyrun, NXGLIB_SUFFIX)(sline, pinfo->buffer, remainder, ncols);
|
||||
(void)pinfo->putrun(row, dest->pt1.x, pinfo->buffer, ncols);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void NXGL_FUNCNAME(nxgl_fillrectangle,NXGLIB_SUFFIX)
|
||||
void NXGL_FUNCNAME(nxgl_fillrectangle, NXGLIB_SUFFIX)
|
||||
(FAR struct lcd_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *rect,
|
||||
NXGL_PIXEL_T color)
|
||||
@@ -98,7 +98,7 @@ void NXGL_FUNCNAME(nxgl_fillrectangle,NXGLIB_SUFFIX)
|
||||
|
||||
/* Fill the run buffer with the selected color */
|
||||
|
||||
NXGL_FUNCNAME(nxgl_fillrun,NXGLIB_SUFFIX)((NXGLIB_RUNTYPE*)pinfo->buffer, color, ncols);
|
||||
NXGL_FUNCNAME(nxgl_fillrun, NXGLIB_SUFFIX)((NXGLIB_RUNTYPE *)pinfo->buffer, color, ncols);
|
||||
|
||||
/* Then fill the rectangle line-by-line */
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX)
|
||||
void NXGL_FUNCNAME(nxgl_filltrapezoid, NXGLIB_SUFFIX)
|
||||
(FAR struct lcd_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_trapezoid_s *trap,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
@@ -215,7 +215,7 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX)
|
||||
ncols = botw;
|
||||
}
|
||||
|
||||
NXGL_FUNCNAME(nxgl_fillrun,NXGLIB_SUFFIX)((NXGLIB_RUNTYPE*)pinfo->buffer, color, ncols);
|
||||
NXGL_FUNCNAME(nxgl_fillrun, NXGLIB_SUFFIX)((NXGLIB_RUNTYPE *)pinfo->buffer, color, ncols);
|
||||
|
||||
/* Then fill the trapezoid row-by-row */
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void NXGL_FUNCNAME(nxgl_getrectangle,NXGLIB_SUFFIX)
|
||||
void NXGL_FUNCNAME(nxgl_getrectangle, NXGLIB_SUFFIX)
|
||||
(FAR struct lcd_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect,
|
||||
FAR void *dest, unsigned int deststride)
|
||||
{
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void NXGL_FUNCNAME(nxgl_moverectangle,NXGLIB_SUFFIX)
|
||||
void NXGL_FUNCNAME(nxgl_moverectangle, NXGLIB_SUFFIX)
|
||||
(FAR struct lcd_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect,
|
||||
FAR struct nxgl_point_s *offset)
|
||||
{
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void NXGL_FUNCNAME(nxgl_setpixel,NXGLIB_SUFFIX)
|
||||
void NXGL_FUNCNAME(nxgl_setpixel, NXGLIB_SUFFIX)
|
||||
(FAR struct lcd_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_point_s *pos,
|
||||
NXGL_PIXEL_T color)
|
||||
|
||||
@@ -214,7 +214,7 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev,
|
||||
attr.mq_msgsize = NX_MXSVRMSGLEN;
|
||||
attr.mq_flags = 0;
|
||||
|
||||
fe->conn.crdmq = mq_open(mqname, O_RDONLY|O_CREAT, 0666, &attr);
|
||||
fe->conn.crdmq = mq_open(mqname, O_RDONLY | O_CREAT, 0666, &attr);
|
||||
if (fe->conn.crdmq == (mqd_t)-1)
|
||||
{
|
||||
gdbg("mq_open(%s) failed: %d\n", mqname, errno);
|
||||
@@ -245,7 +245,7 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev,
|
||||
/* Initialize the non-NULL elements of the background window */
|
||||
|
||||
fe->be.bkgd.conn = &fe->conn;
|
||||
fe->be.bkgd.be = (FAR struct nxbe_state_s*)fe;
|
||||
fe->be.bkgd.be = (FAR struct nxbe_state_s *)fe;
|
||||
|
||||
fe->be.bkgd.bounds.pt2.x = fe->be.vinfo.xres - 1;
|
||||
fe->be.bkgd.bounds.pt2.y = fe->be.vinfo.yres - 1;
|
||||
@@ -325,7 +325,7 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev)
|
||||
|
||||
/* Then loop forever processing incoming messages */
|
||||
|
||||
for (;;)
|
||||
for (; ; )
|
||||
{
|
||||
/* Receive the next server message */
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ nxterm_renderglyph(FAR struct nxterm_state_s *priv,
|
||||
|
||||
/* Then render the glyph into the allocated memory */
|
||||
|
||||
ret = RENDERER((FAR nxgl_mxpixel_t*)glyph->bitmap,
|
||||
ret = RENDERER((FAR nxgl_mxpixel_t *)glyph->bitmap,
|
||||
glyph->height, glyph->width, glyph->stride,
|
||||
fbm, priv->wndo.fcolor[0]);
|
||||
if (ret < 0)
|
||||
|
||||
@@ -96,7 +96,7 @@ FAR struct nxterm_state_s *
|
||||
priv->ops = ops;
|
||||
priv->handle = handle;
|
||||
priv->minor = minor;
|
||||
memcpy(&priv->wndo, wndo, sizeof( struct nxterm_window_s));
|
||||
memcpy(&priv->wndo, wndo, sizeof(struct nxterm_window_s));
|
||||
|
||||
sem_init(&priv->exclsem, 0, 1);
|
||||
#ifdef CONFIG_DEBUG
|
||||
|
||||
@@ -136,7 +136,7 @@ static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv,
|
||||
/* Finally, clear the vacated part of the display */
|
||||
|
||||
rect.pt1.y = bottom;
|
||||
rect.pt2.y = priv->wndo.wsize.h- 1;
|
||||
rect.pt2.y = priv->wndo.wsize.h - 1;
|
||||
|
||||
ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor);
|
||||
if (ret < 0)
|
||||
|
||||
Reference in New Issue
Block a user