Mercurial > hg
comparison mercurial/base85.c @ 27060:4613a89bea42
base85: clean up function definition style
Cleanup performed with clang-format.
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 11 Nov 2015 19:10:45 -0500 |
parents | c1aefe57cf4e |
children | 7948adb53e28 |
comparison
equal
deleted
inserted
replaced
27059:405320cd6198 | 27060:4613a89bea42 |
---|---|
16 | 16 |
17 static const char b85chars[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" | 17 static const char b85chars[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
18 "abcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~"; | 18 "abcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~"; |
19 static char b85dec[256]; | 19 static char b85dec[256]; |
20 | 20 |
21 static void | 21 static void b85prep(void) |
22 b85prep(void) | |
23 { | 22 { |
24 unsigned i; | 23 unsigned i; |
25 | 24 |
26 memset(b85dec, 0, sizeof(b85dec)); | 25 memset(b85dec, 0, sizeof(b85dec)); |
27 for (i = 0; i < sizeof(b85chars); i++) | 26 for (i = 0; i < sizeof(b85chars); i++) |
28 b85dec[(int)(b85chars[i])] = i + 1; | 27 b85dec[(int)(b85chars[i])] = i + 1; |
29 } | 28 } |
30 | 29 |
31 static PyObject * | 30 static PyObject *b85encode(PyObject *self, PyObject *args) |
32 b85encode(PyObject *self, PyObject *args) | |
33 { | 31 { |
34 const unsigned char *text; | 32 const unsigned char *text; |
35 PyObject *out; | 33 PyObject *out; |
36 char *dst; | 34 char *dst; |
37 Py_ssize_t len, olen, i; | 35 Py_ssize_t len, olen, i; |
74 _PyBytes_Resize(&out, olen); | 72 _PyBytes_Resize(&out, olen); |
75 | 73 |
76 return out; | 74 return out; |
77 } | 75 } |
78 | 76 |
79 static PyObject * | 77 static PyObject *b85decode(PyObject *self, PyObject *args) |
80 b85decode(PyObject *self, PyObject *args) | |
81 { | 78 { |
82 PyObject *out; | 79 PyObject *out; |
83 const char *text; | 80 const char *text; |
84 char *dst; | 81 char *dst; |
85 Py_ssize_t len, i, j, olen, cap; | 82 Py_ssize_t len, i, j, olen, cap; |