Fix wait loop and void cast (#24)

* Simplify EINTR/ECANCEL error handling

1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx

* Unify the void cast usage

1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
This commit is contained in:
Xiang Xiao
2020-01-02 10:49:34 -06:00
committed by Gregory Nutt
parent 316675f4db
commit 6a3c2aded6
1602 changed files with 6311 additions and 10874 deletions
+2 -2
View File
@@ -100,7 +100,7 @@ void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX)
if (remainder != 0)
{
NXGL_FUNCNAME(nxgl_copyrun, NXGLIB_SUFFIX)(sline, pinfo->buffer, remainder, ncols);
(void)pinfo->putrun(row, dest->pt1.x, pinfo->buffer, ncols);
pinfo->putrun(row, dest->pt1.x, pinfo->buffer, ncols);
}
else
#endif
@@ -109,7 +109,7 @@ void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX)
* the image memory.
*/
(void)pinfo->putrun(row, dest->pt1.x, sline, ncols);
pinfo->putrun(row, dest->pt1.x, sline, ncols);
}
/* Then adjust the source pointer to refer to the next line in the source
+1 -1
View File
@@ -90,6 +90,6 @@ void NXGL_FUNCNAME(nxgl_fillrectangle, NXGLIB_SUFFIX)
{
/* Draw the raster line at this row */
(void)pinfo->putrun(row, rect->pt1.x, pinfo->buffer, ncols);
pinfo->putrun(row, rect->pt1.x, pinfo->buffer, ncols);
}
}
+1 -1
View File
@@ -232,7 +232,7 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid, NXGLIB_SUFFIX)
/* Then draw the run from ix1 to ix2 at row */
ncols = ix2 - ix1 + 1;
(void)pinfo->putrun(row, ix1, pinfo->buffer, ncols);
pinfo->putrun(row, ix1, pinfo->buffer, ncols);
}
/* Add the dx/dy value to get the run positions on the next row */
+1 -1
View File
@@ -79,7 +79,7 @@ void NXGL_FUNCNAME(nxgl_getrectangle, NXGLIB_SUFFIX)
for (srcrow = rect->pt1.y; srcrow <= rect->pt2.y; srcrow++)
{
(void)pinfo->getrun(srcrow, rect->pt1.x, dline, ncols);
pinfo->getrun(srcrow, rect->pt1.x, dline, ncols);
dline += deststride;
}
}
+4 -4
View File
@@ -85,8 +85,8 @@ void NXGL_FUNCNAME(nxgl_moverectangle, NXGLIB_SUFFIX)
srcrow <= rect->pt2.y;
srcrow++, destrow++)
{
(void)pinfo->getrun(srcrow, rect->pt1.x, pinfo->buffer, ncols);
(void)pinfo->putrun(destrow, offset->x, pinfo->buffer, ncols);
pinfo->getrun(srcrow, rect->pt1.x, pinfo->buffer, ncols);
pinfo->putrun(destrow, offset->x, pinfo->buffer, ncols);
}
}
@@ -104,8 +104,8 @@ void NXGL_FUNCNAME(nxgl_moverectangle, NXGLIB_SUFFIX)
srcrow >= rect->pt1.y;
srcrow--, destrow--)
{
(void)pinfo->getrun(srcrow, rect->pt1.x, pinfo->buffer, ncols);
(void)pinfo->putrun(destrow, offset->x, pinfo->buffer, ncols);
pinfo->getrun(srcrow, rect->pt1.x, pinfo->buffer, ncols);
pinfo->putrun(destrow, offset->x, pinfo->buffer, ncols);
}
}
}
+3 -3
View File
@@ -81,7 +81,7 @@ void NXGL_FUNCNAME(nxgl_setpixel, NXGLIB_SUFFIX)
/* Read the byte that contains the pixel to be changed */
(void)pinfo->getrun(pos->y, pos->x, &pixel, 8 / NXGLIB_BITSPERPIXEL);
pinfo->getrun(pos->y, pos->x, &pixel, 8 / NXGLIB_BITSPERPIXEL);
/* Shift the color into the proper position */
@@ -128,10 +128,10 @@ void NXGL_FUNCNAME(nxgl_setpixel, NXGLIB_SUFFIX)
/* Write the modified byte back to graphics memory */
(void)pinfo->putrun(pos->y, pos->x, (FAR uint8_t *)&pixel, 8 / NXGLIB_BITSPERPIXEL);
pinfo->putrun(pos->y, pos->x, (FAR uint8_t *)&pixel, 8 / NXGLIB_BITSPERPIXEL);
#else
/* Draw a single pixel at this position raster line at this row */
(void)pinfo->putrun(pos->y, pos->x, (FAR uint8_t *)&color, 1);
pinfo->putrun(pos->y, pos->x, (FAR uint8_t *)&color, 1);
#endif
}