comparison src/evalfunc.c @ 27752:c1d1639b52dd v8.2.4402

patch 8.2.4402: missing parenthesis may cause unexpected problems Commit: https://github.com/vim/vim/commit/ae6f1d8b14c2f63811ee83ef14e32086fb3e9b83 Author: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Wed Feb 16 19:24:07 2022 +0000 patch 8.2.4402: missing parenthesis may cause unexpected problems Problem: Missing parenthesis may cause unexpected problems. Solution: Add more parenthesis is macros. (closes https://github.com/vim/vim/issues/9788)
author Bram Moolenaar <Bram@vim.org>
date Wed, 16 Feb 2022 20:30:03 +0100
parents 3813036f19cb
children 324d394e314e
comparison
equal deleted inserted replaced
27751:c9330d10419b 27752:c1d1639b52dd
7876 // Reading /dev/urandom doesn't work, fall back to time(). 7876 // Reading /dev/urandom doesn't work, fall back to time().
7877 #endif 7877 #endif
7878 *x = vim_time(); 7878 *x = vim_time();
7879 } 7879 }
7880 7880
7881 #define ROTL(x, k) ((x << k) | (x >> (32 - k))) 7881 #define ROTL(x, k) (((x) << (k)) | ((x) >> (32 - (k))))
7882 #define SPLITMIX32(x, z) ( \ 7882 #define SPLITMIX32(x, z) ( \
7883 z = (x += 0x9e3779b9), \ 7883 (z) = ((x) += 0x9e3779b9), \
7884 z = (z ^ (z >> 16)) * 0x85ebca6b, \ 7884 (z) = ((z) ^ ((z) >> 16)) * 0x85ebca6b, \
7885 z = (z ^ (z >> 13)) * 0xc2b2ae35, \ 7885 (z) = ((z) ^ ((z) >> 13)) * 0xc2b2ae35, \
7886 z ^ (z >> 16) \ 7886 (z) ^ ((z) >> 16) \
7887 ) 7887 )
7888 #define SHUFFLE_XOSHIRO128STARSTAR(x, y, z, w) \ 7888 #define SHUFFLE_XOSHIRO128STARSTAR(x, y, z, w) \
7889 result = ROTL(y * 5, 7) * 9; \ 7889 result = ROTL((y) * 5, 7) * 9; \
7890 t = y << 9; \ 7890 t = (y) << 9; \
7891 z ^= x; \ 7891 (z) ^= (x); \
7892 w ^= y; \ 7892 (w) ^= (y); \
7893 y ^= z, x ^= w; \ 7893 (y) ^= (z), (x) ^= (w); \
7894 z ^= t; \ 7894 (z) ^= t; \
7895 w = ROTL(w, 11); 7895 (w) = ROTL(w, 11);
7896 7896
7897 /* 7897 /*
7898 * "rand()" function 7898 * "rand()" function
7899 */ 7899 */
7900 static void 7900 static void