From e3a8ed5183ed5a24e391395c9faeae03dc9e4a6a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 30 Jan 2013 08:10:46 +1100 Subject: 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 --- uemis.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'uemis.c') diff --git a/uemis.c b/uemis.c index 9e6d6c23c..026c836df 100644 --- a/uemis.c +++ b/uemis.c @@ -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) { -- cgit v1.2.3-70-g09d2