aboutsummaryrefslogtreecommitdiff
path: root/extmod/modurandom.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-02-27 15:36:53 +1100
committerDamien George <damien.p.george@gmail.com>2020-02-28 10:33:03 +1100
commit69661f3343bedf86e514337cff63d96cc42f8859 (patch)
treeaf5dfb380ffdb75dda84828f63cf9d840d992f0f /extmod/modurandom.c
parent3f39d18c2b884d32f0443e2e8114ff9d7a14d718 (diff)
all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
Diffstat (limited to 'extmod/modurandom.c')
-rw-r--r--extmod/modurandom.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/extmod/modurandom.c b/extmod/modurandom.c
index 725ac46f1..594848dfe 100644
--- a/extmod/modurandom.c
+++ b/extmod/modurandom.c
@@ -41,15 +41,14 @@ STATIC uint32_t yasmarang_pad = 0xeda4baba, yasmarang_n = 69, yasmarang_d = 233;
STATIC uint8_t yasmarang_dat = 0;
#endif
-STATIC uint32_t yasmarang(void)
-{
- yasmarang_pad += yasmarang_dat + yasmarang_d * yasmarang_n;
- yasmarang_pad = (yasmarang_pad<<3) + (yasmarang_pad>>29);
- yasmarang_n = yasmarang_pad | 2;
- yasmarang_d ^= (yasmarang_pad<<31) + (yasmarang_pad>>1);
- yasmarang_dat ^= (char) yasmarang_pad ^ (yasmarang_d>>8) ^ 1;
-
- return (yasmarang_pad^(yasmarang_d<<5)^(yasmarang_pad>>18)^(yasmarang_dat<<1));
+STATIC uint32_t yasmarang(void) {
+ yasmarang_pad += yasmarang_dat + yasmarang_d * yasmarang_n;
+ yasmarang_pad = (yasmarang_pad << 3) + (yasmarang_pad >> 29);
+ yasmarang_n = yasmarang_pad | 2;
+ yasmarang_d ^= (yasmarang_pad << 31) + (yasmarang_pad >> 1);
+ yasmarang_dat ^= (char) yasmarang_pad ^ (yasmarang_d >> 8) ^ 1;
+
+ return yasmarang_pad ^ (yasmarang_d << 5) ^ (yasmarang_pad >> 18) ^ (yasmarang_dat << 1);
} /* yasmarang */
// End of Yasmarang
@@ -221,7 +220,7 @@ STATIC MP_DEFINE_CONST_DICT(mp_module_urandom_globals, mp_module_urandom_globals
const mp_obj_module_t mp_module_urandom = {
.base = { &mp_type_module },
- .globals = (mp_obj_dict_t*)&mp_module_urandom_globals,
+ .globals = (mp_obj_dict_t *)&mp_module_urandom_globals,
};
#endif