diff --git a/os/include/blit/blit.h b/os/include/blit/blit.h index c22ff2c44..03a111667 100644 --- a/os/include/blit/blit.h +++ b/os/include/blit/blit.h @@ -28,8 +28,7 @@ * If the source and destination overlap, the result * of the copy operation is not defined. */ -extern "C" void blit(void *src, unsigned src_w, - void *dst, unsigned dst_w, - int w, int h); +extern "C" void blit(void const *src, unsigned src_w, + void *dst, unsigned dst_w, int w, int h); #endif /* _INCLUDE__BLIT__BLIT_H_ */ diff --git a/os/src/lib/blit/arm/blit_helper.h b/os/src/lib/blit/arm/blit_helper.h index 4c7cea1d4..33e86d510 100644 --- a/os/src/lib/blit/arm/blit_helper.h +++ b/os/src/lib/blit/arm/blit_helper.h @@ -19,11 +19,11 @@ /** * Copy single 16bit column */ -static inline void copy_16bit_column(char *src, int src_w, +static inline void copy_16bit_column(char const *src, int src_w, char *dst, int dst_w, int h) { for (; h-- > 0; src += src_w, dst += dst_w) - *(short *)dst = *(short *)src; + *(short *)dst = *(short const *)src; } @@ -37,7 +37,7 @@ static inline void copy_16bit_column(char *src, int src_w, * \param src_w width of source buffer in bytes * \param dst_w width of destination buffer in bytes */ -static void copy_block_32bit(char *src, int src_w, +static void copy_block_32bit(char const *src, int src_w, char *dst, int dst_w, int w, int h) { @@ -45,7 +45,7 @@ static void copy_block_32bit(char *src, int src_w, dst_w -= w*4; for (; h--; src += src_w, dst += dst_w) { for (int i = w; i--; src += 4, dst += 4) - *((int *)dst) = *((int *)src); + *((int *)dst) = *((int const *)src); } } @@ -56,7 +56,7 @@ static void copy_block_32bit(char *src, int src_w, * \param w width in 32 byte chunks to copy per line * \param h number of lines of copy */ -static inline void copy_block_32byte(char *src, int src_w, +static inline void copy_block_32byte(char const *src, int src_w, char *dst, int dst_w, int w, int h) { diff --git a/os/src/lib/blit/blit.cc b/os/src/lib/blit/blit.cc index 0736308b7..515b3b3f9 100644 --- a/os/src/lib/blit/blit.cc +++ b/os/src/lib/blit/blit.cc @@ -15,11 +15,12 @@ #include -extern "C" void blit(void *s, unsigned src_w, +extern "C" void blit(void const *s, unsigned src_w, void *d, unsigned dst_w, int w, int h) { - char *src = (char *)s, *dst = (char *)d; + char const *src = (char const *)s; + char *dst = (char *)d; if (w <= 0 || h <= 0) return; diff --git a/os/src/lib/blit/blit_helper.h b/os/src/lib/blit/blit_helper.h index d997f19e6..da34c6678 100644 --- a/os/src/lib/blit/blit_helper.h +++ b/os/src/lib/blit/blit_helper.h @@ -19,7 +19,7 @@ /** * Copy single 16bit column */ -static inline void copy_16bit_column(char *src, int src_w, +static inline void copy_16bit_column(char const *src, int src_w, char *dst, int dst_w, int h) { for (; h-- > 0; src += src_w, dst += dst_w) @@ -37,7 +37,7 @@ static inline void copy_16bit_column(char *src, int src_w, * \param src_w width of source buffer in bytes * \param dst_w width of destination buffer in bytes */ -static void copy_block_32bit(char *src, int src_w, +static void copy_block_32bit(char const *src, int src_w, char *dst, int dst_w, int w, int h) { @@ -46,15 +46,13 @@ static void copy_block_32bit(char *src, int src_w, } - - /** * Copy block with a size of multiple of 32 bytes * * \param w width in 32 byte chunks to copy per line * \param h number of lines of copy */ -static inline void copy_block_32byte(char *src, int src_w, +static inline void copy_block_32byte(char const *src, int src_w, char *dst, int dst_w, int w, int h) { diff --git a/os/src/lib/blit/x86/blit_helper.h b/os/src/lib/blit/x86/blit_helper.h index 33472556c..0cdf9a4f2 100644 --- a/os/src/lib/blit/x86/blit_helper.h +++ b/os/src/lib/blit/x86/blit_helper.h @@ -20,11 +20,11 @@ /** * Copy single 16bit column */ -static inline void copy_16bit_column(char *src, int src_w, +static inline void copy_16bit_column(char const *src, int src_w, char *dst, int dst_w, int h) { for (; h-- > 0; src += src_w, dst += dst_w) - *(short *)dst = *(short *)src; + *(short *)dst = *(short const *)src; } @@ -38,7 +38,7 @@ static inline void copy_16bit_column(char *src, int src_w, * \param src_w width of source buffer in bytes * \param dst_w width of destination buffer in bytes */ -static inline void copy_block_32bit(char *src, int src_w, +static inline void copy_block_32bit(char const *src, int src_w, char *dst, int dst_w, int w, int h) { @@ -58,7 +58,7 @@ static inline void copy_block_32bit(char *src, int src_w, * \param w width in 32 byte chunks to copy per line * \param h number of lines of copy */ -static inline void copy_block_32byte(char *src, int src_w, +static inline void copy_block_32byte(char const *src, int src_w, char *dst, int dst_w, int w, int h) { diff --git a/os/src/lib/blit/x86/x86_32/mmx.h b/os/src/lib/blit/x86/x86_32/mmx.h index afce6e497..50c40f048 100644 --- a/os/src/lib/blit/x86/x86_32/mmx.h +++ b/os/src/lib/blit/x86/x86_32/mmx.h @@ -18,7 +18,7 @@ /** * Copy 32byte chunks via MMX */ -static inline void copy_32byte_chunks(void *src, void *dst, int size) +static inline void copy_32byte_chunks(void const *src, void *dst, int size) { asm volatile ( "emms \n\t" diff --git a/os/src/lib/blit/x86/x86_64/mmx.h b/os/src/lib/blit/x86/x86_64/mmx.h index dc152b394..e1c28eaf2 100644 --- a/os/src/lib/blit/x86/x86_64/mmx.h +++ b/os/src/lib/blit/x86/x86_64/mmx.h @@ -17,7 +17,7 @@ /** * Copy 32byte chunks via MMX */ -static inline void copy_32byte_chunks(void *src, void *dst, int size) +static inline void copy_32byte_chunks(void const *src, void *dst, int size) { asm volatile ( "emms \n\t"