summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/gray_drawgraymap.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2004-08-03 20:57:06 +0000
committerJens Arnold <amiconn@rockbox.org>2004-08-03 20:57:06 +0000
commit85890b88df7d4cc315167409e6364418e5348324 (patch)
tree636e2874c66355db15f2ef45231294ed504e039f /apps/plugins/lib/gray_drawgraymap.c
parent0830339e2f5831575879a6194d43d2e958d8cf64 (diff)
downloadrockbox-85890b88df7d4cc315167409e6364418e5348324.tar.gz
rockbox-85890b88df7d4cc315167409e6364418e5348324.zip
Const policed the grayscale lib & plugin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4985 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib/gray_drawgraymap.c')
-rw-r--r--apps/plugins/lib/gray_drawgraymap.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/plugins/lib/gray_drawgraymap.c b/apps/plugins/lib/gray_drawgraymap.c
index dc33446527..c8ee93fef1 100644
--- a/apps/plugins/lib/gray_drawgraymap.c
+++ b/apps/plugins/lib/gray_drawgraymap.c
@@ -30,16 +30,16 @@
30#include "gray.h" 30#include "gray.h"
31 31
32/* Prototypes */ 32/* Prototypes */
33static void _writearray(unsigned char *address, unsigned char *src, int stride, 33static void _writearray(unsigned char *address, const unsigned char *src,
34 unsigned mask); 34 int stride, unsigned mask);
35 35
36/* Write an 8-pixel block, defined by their brightnesses in a graymap. 36/* Write an 8-pixel block, defined by their brightnesses in a graymap.
37 * Address is the byte in the first bitplane, src is the graymap start address, 37 * Address is the byte in the first bitplane, src is the graymap start address,
38 * stride is the increment for the graymap to get to the next pixel, mask 38 * stride is the increment for the graymap to get to the next pixel, mask
39 * determines which pixels of the destination block are changed. For "0" bits, 39 * determines which pixels of the destination block are changed. For "0" bits,
40 * the src address is not incremented! */ 40 * the src address is not incremented! */
41static void _writearray(unsigned char *address, unsigned char *src, int stride, 41static void _writearray(unsigned char *address, const unsigned char *src,
42 unsigned mask) 42 int stride, unsigned mask)
43{ 43{
44 unsigned long pat_stack[8]; 44 unsigned long pat_stack[8];
45 register unsigned char *end_addr; 45 register unsigned char *end_addr;
@@ -217,12 +217,13 @@ asm (
217 217
218 This is the only drawing function NOT using the drawinfo. 218 This is the only drawing function NOT using the drawinfo.
219 */ 219 */
220void gray_drawgraymap(unsigned char *src, int x, int y, int nx, int ny, 220void gray_drawgraymap(const unsigned char *src, int x, int y, int nx, int ny,
221 int stride) 221 int stride)
222{ 222{
223 int shift; 223 int shift;
224 unsigned mask_top, mask_bottom; 224 unsigned mask_top, mask_bottom;
225 unsigned char *src_row, *dst, *dst_row; 225 const unsigned char *src_row;
226 unsigned char *dst, *dst_row;
226 227
227 if ((unsigned) x >= (unsigned) _graybuf->width 228 if ((unsigned) x >= (unsigned) _graybuf->width
228 || (unsigned) y >= (unsigned) _graybuf->height) 229 || (unsigned) y >= (unsigned) _graybuf->height)