From d4a67e2541cdbffca3c5f73e288d62e259672392 Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Wed, 30 Oct 2019 16:06:51 +0100 Subject: [PATCH] Readability: change some pointer parameter to be pointer to const --- src/libm/k_rem_pio2.c | 2 +- src/libm/math_private.h | 2 +- src/test/SDL_test_md5.c | 4 ++-- src/video/SDL_RLEaccel.c | 6 +++--- src/video/x11/SDL_x11messagebox.c | 2 +- src/video/x11/SDL_x11xinput2.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libm/k_rem_pio2.c b/src/libm/k_rem_pio2.c index 393db541d..3a4a588ff 100644 --- a/src/libm/k_rem_pio2.c +++ b/src/libm/k_rem_pio2.c @@ -149,7 +149,7 @@ one = 1.0, two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */ twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */ -int32_t attribute_hidden __kernel_rem_pio2(double *x, double *y, int e0, int nx, const unsigned int prec, const int32_t *ipio2) +int32_t attribute_hidden __kernel_rem_pio2(const double *x, double *y, int e0, int nx, const unsigned int prec, const int32_t *ipio2) { int32_t jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih; double z,fw,f[20],fq[20],q[20]; diff --git a/src/libm/math_private.h b/src/libm/math_private.h index d0ef66a6d..02535559a 100644 --- a/src/libm/math_private.h +++ b/src/libm/math_private.h @@ -221,7 +221,7 @@ __ieee754_sqrt(double) extern double __kernel_sin(double, double, int) attribute_hidden; extern double __kernel_cos(double, double) attribute_hidden; extern double __kernel_tan(double, double, int) attribute_hidden; - extern int32_t __kernel_rem_pio2(double *, double *, int, int, const unsigned int, + extern int32_t __kernel_rem_pio2(const double *, double *, int, int, const unsigned int, const int32_t *) attribute_hidden; #endif /* _MATH_PRIVATE_H_ */ diff --git a/src/test/SDL_test_md5.c b/src/test/SDL_test_md5.c index 3e65ce925..f59cc0227 100644 --- a/src/test/SDL_test_md5.c +++ b/src/test/SDL_test_md5.c @@ -56,7 +56,7 @@ #include "SDL_test.h" /* Forward declaration of static helper function */ -static void SDLTest_Md5Transform(MD5UINT4 * buf, MD5UINT4 * in); +static void SDLTest_Md5Transform(MD5UINT4 * buf, const MD5UINT4 * in); static unsigned char MD5PADDING[64] = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -229,7 +229,7 @@ void SDLTest_Md5Final(SDLTest_Md5Context * mdContext) /* Basic MD5 step. Transforms buf based on in. */ -static void SDLTest_Md5Transform(MD5UINT4 * buf, MD5UINT4 * in) +static void SDLTest_Md5Transform(MD5UINT4 * buf, const MD5UINT4 * in) { MD5UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c index bcb33f4c9..ce694bc3e 100644 --- a/src/video/SDL_RLEaccel.c +++ b/src/video/SDL_RLEaccel.c @@ -1237,19 +1237,19 @@ RLEAlphaSurface(SDL_Surface * surface) } static Uint32 -getpix_8(Uint8 * srcbuf) +getpix_8(const Uint8 * srcbuf) { return *srcbuf; } static Uint32 -getpix_16(Uint8 * srcbuf) +getpix_16(const Uint8 * srcbuf) { return *(Uint16 *) srcbuf; } static Uint32 -getpix_24(Uint8 * srcbuf) +getpix_24(const Uint8 * srcbuf) { #if SDL_BYTEORDER == SDL_LIL_ENDIAN return srcbuf[0] + (srcbuf[1] << 8) + (srcbuf[2] << 16); diff --git a/src/video/x11/SDL_x11messagebox.c b/src/video/x11/SDL_x11messagebox.c index dd234e63e..fb66eb2c9 100644 --- a/src/video/x11/SDL_x11messagebox.c +++ b/src/video/x11/SDL_x11messagebox.c @@ -625,7 +625,7 @@ X11_MessageBoxDraw( SDL_MessageBoxDataX11 *data, GC ctx ) } static Bool -X11_MessageBoxEventTest(Display *display, XEvent *event, XPointer arg) +X11_MessageBoxEventTest(Display *display, XEvent *event, const XPointer arg) { const SDL_MessageBoxDataX11 *data = (const SDL_MessageBoxDataX11 *) arg; return ((event->xany.display == data->display) && (event->xany.window == data->window)) ? True : False; diff --git a/src/video/x11/SDL_x11xinput2.c b/src/video/x11/SDL_x11xinput2.c index 1bd5b1837..94da667be 100644 --- a/src/video/x11/SDL_x11xinput2.c +++ b/src/video/x11/SDL_x11xinput2.c @@ -42,7 +42,7 @@ static int xinput2_multitouch_supported = 0; * this extension */ static int xinput2_opcode; -static void parse_valuators(const double *input_values,unsigned char *mask,int mask_len, +static void parse_valuators(const double *input_values, const unsigned char *mask,int mask_len, double *output_values,int output_values_len) { int i = 0,z = 0; int top = mask_len * 8;