summaryrefslogtreecommitdiffstats
path: root/uemis.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-30 08:10:46 +1100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-30 08:31:53 +1100
commite3a8ed5183ed5a24e391395c9faeae03dc9e4a6a (patch)
tree6490fa5d2d135dd74b748f0fe31179411144f63f /uemis.c
parent468d3f28f9f1f2795960b8e8b79b9d02024e34ed (diff)
downloadsubsurface-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.c20
1 files changed, 10 insertions, 10 deletions
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) {