diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-01-30 08:10:46 +1100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-01-30 08:31:53 +1100 |
commit | e3a8ed5183ed5a24e391395c9faeae03dc9e4a6a (patch) | |
tree | 6490fa5d2d135dd74b748f0fe31179411144f63f /uemis.c | |
parent | 468d3f28f9f1f2795960b8e8b79b9d02024e34ed (diff) | |
download | subsurface-e3a8ed5183ed5a24e391395c9faeae03dc9e4a6a.tar.gz |
Massive cleanup
Mostly coding style and whitespace changes plus making lots of functions
static that have no need to be extern. This also helped find a bit of code
that is actually no longer used.
This should have absolutely no functional impact - all changes should be
purely cosmetic. But it removes a bunch of lines of code and makes the
rest easier to read.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis.c')
-rw-r--r-- | uemis.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -37,21 +37,21 @@ static const char cd64[]="|$$$}rstuvwxyz{$$$$$$$>?@ABCDEFGHIJKLMNOPQRSTUVW$$$$$$ /* * decodeblock -- decode 4 '6-bit' characters into 3 8-bit binary bytes */ -static void decodeblock( unsigned char in[4], unsigned char out[3] ) { - out[ 0 ] = (unsigned char ) (in[0] << 2 | in[1] >> 4); - out[ 1 ] = (unsigned char ) (in[1] << 4 | in[2] >> 2); - out[ 2 ] = (unsigned char ) (((in[2] << 6) & 0xc0) | in[3]); +static void decodeblock (unsigned char in[4], unsigned char out[3]) { + out[0] = (unsigned char) (in[0] << 2 | in[1] >> 4); + out[1] = (unsigned char) (in[1] << 4 | in[2] >> 2); + out[2] = (unsigned char) (((in[2] << 6) & 0xc0) | in[3]); } /* * decode a base64 encoded stream discarding padding, line breaks and noise */ -static void decode( uint8_t *inbuf, uint8_t *outbuf, int inbuf_len ) { +static void decode(uint8_t *inbuf, uint8_t *outbuf, int inbuf_len) { uint8_t in[4], out[3], v; int i,len,indx_in=0,indx_out=0; while (indx_in < inbuf_len) { - for (len = 0, i = 0; i < 4 && (indx_in < inbuf_len); i++ ) { + for (len = 0, i = 0; i < 4 && (indx_in < inbuf_len); i++) { v = 0; while ((indx_in < inbuf_len) && v == 0) { v = inbuf[indx_in++]; @@ -67,9 +67,9 @@ static void decode( uint8_t *inbuf, uint8_t *outbuf, int inbuf_len ) { else in[i] = 0; } - if( len ) { - decodeblock( in, out ); - for( i = 0; i < len - 1; i++ ) + if (len) { + decodeblock(in, out); + for(i = 0; i < len - 1; i++) outbuf[indx_out++] = out[i]; } } @@ -119,7 +119,7 @@ static struct uemis_helper *uemis_get_helper(int diveid) struct uemis_helper **php = &uemis_helper; struct uemis_helper *hp = *php; - while(hp) { + while (hp) { if (hp->diveid == diveid) return hp; if (hp->next) { |