aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2005-05-08 21:49:52 +0000
committerMax Horn2005-05-08 21:49:52 +0000
commitcca744f69a9eb079a314c8f39af1faa4e7b1e5a6 (patch)
tree1eb00deac3941d844ce98abc10eb4339955ef61d /common
parent013e30eb389c40eb579cc8e3f05b8e8da80925ca (diff)
downloadscummvm-rg350-cca744f69a9eb079a314c8f39af1faa4e7b1e5a6.tar.gz
scummvm-rg350-cca744f69a9eb079a314c8f39af1faa4e7b1e5a6.tar.bz2
scummvm-rg350-cca744f69a9eb079a314c8f39af1faa4e7b1e5a6.zip
Comply to our coding conventions
svn-id: r17975
Diffstat (limited to 'common')
-rw-r--r--common/config-manager.cpp2
-rw-r--r--common/list.h2
-rw-r--r--common/md5.cpp32
-rw-r--r--common/savefile.cpp4
-rw-r--r--common/scaler/hq2x.cpp2
-rw-r--r--common/scaler/hq3x.cpp2
6 files changed, 22 insertions, 22 deletions
diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index add32cd00e..8cd2ed3222 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -81,7 +81,7 @@ ConfigManager::ConfigManager() {
void ConfigManager::loadDefaultConfigFile() {
char configFile[MAXPATHLEN];
#if defined(UNIX)
- if(getenv("HOME") != NULL)
+ if (getenv("HOME") != NULL)
sprintf(configFile,"%s/%s", getenv("HOME"), DEFAULT_CONFIG_FILE);
else
strcpy(configFile, DEFAULT_CONFIG_FILE);
diff --git a/common/list.h b/common/list.h
index 06f71297c7..6e9cf83dab 100644
--- a/common/list.h
+++ b/common/list.h
@@ -182,7 +182,7 @@ public:
static_cast<Node<T> *>(i._node)->_data = static_cast<Node<T> *>(j._node)->_data;
}
- if(i == end())
+ if (i == end())
insert(i, j, list.end());
else
erase(i, end());
diff --git a/common/md5.cpp b/common/md5.cpp
index d876072b73..f0e277172c 100644
--- a/common/md5.cpp
+++ b/common/md5.cpp
@@ -171,7 +171,7 @@ void md5_update( md5_context *ctx, const uint8 *input, uint32 length )
{
uint32 left, fill;
- if( ! length ) return;
+ if ( ! length ) return;
left = ctx->total[0] & 0x3F;
fill = 64 - left;
@@ -179,10 +179,10 @@ void md5_update( md5_context *ctx, const uint8 *input, uint32 length )
ctx->total[0] += length;
ctx->total[0] &= 0xFFFFFFFF;
- if( ctx->total[0] < length )
+ if ( ctx->total[0] < length )
ctx->total[1]++;
- if( left && length >= fill )
+ if ( left && length >= fill )
{
memcpy( (void *) (ctx->buffer + left),
(const void *) input, fill );
@@ -192,14 +192,14 @@ void md5_update( md5_context *ctx, const uint8 *input, uint32 length )
left = 0;
}
- while( length >= 64 )
+ while ( length >= 64 )
{
md5_process( ctx, input );
length -= 64;
input += 64;
}
- if( length )
+ if ( length )
{
memcpy( (void *) (ctx->buffer + left),
(const void *) input, length );
@@ -249,28 +249,28 @@ bool md5_file( const char *name, uint8 digest[16], const char *directory, uint32
int readlen;
f.open(name, File::kFileReadMode, directory);
- if( ! f.isOpen() )
+ if ( ! f.isOpen() )
{
warning( "md5_file couldn't open '%s'", name );
return false;
}
- if( ! restricted || sizeof( buf ) <= length )
+ if ( ! restricted || sizeof( buf ) <= length )
readlen = sizeof( buf );
else
readlen = length;
md5_starts( &ctx );
- while( ( i = f.read( buf, readlen ) ) > 0 )
+ while ( ( i = f.read( buf, readlen ) ) > 0 )
{
md5_update( &ctx, buf, i );
length -= i;
- if( restricted && length == 0 )
+ if ( restricted && length == 0 )
break;
- if( restricted && sizeof( buf ) > length )
+ if ( restricted && sizeof( buf ) > length )
readlen = length;
}
@@ -317,11 +317,11 @@ int main( int argc, char *argv[] )
md5_context ctx;
unsigned char md5sum[16];
- if( argc < 2 )
+ if ( argc < 2 )
{
printf( "\n MD5 Validation Tests:\n\n" );
- for( i = 0; i < 7; i++ )
+ for ( i = 0; i < 7; i++ )
{
printf( " Test %d ", i + 1 );
@@ -329,12 +329,12 @@ int main( int argc, char *argv[] )
md5_update( &ctx, (const uint8 *) msg[i], strlen( msg[i] ) );
md5_finish( &ctx, md5sum );
- for( j = 0; j < 16; j++ )
+ for ( j = 0; j < 16; j++ )
{
sprintf( output + j * 2, "%02x", md5sum[j] );
}
- if( memcmp( output, val[i], 32 ) )
+ if ( memcmp( output, val[i], 32 ) )
{
printf( "failed!\n" );
return( 1 );
@@ -347,10 +347,10 @@ int main( int argc, char *argv[] )
}
else
{
- for( i = 1; i < argc; i++ )
+ for ( i = 1; i < argc; i++ )
{
md5_file( argv[i], md5sum );
- for( j = 0; j < 16; j++ )
+ for ( j = 0; j < 16; j++ )
{
printf( "%02x", md5sum[j] );
}
diff --git a/common/savefile.cpp b/common/savefile.cpp
index 8f24db7686..2210f3d05a 100644
--- a/common/savefile.cpp
+++ b/common/savefile.cpp
@@ -69,7 +69,7 @@ public:
fh = ::fopen(filename, (saveOrLoad? "wb" : "rb"));
}
~StdioSaveFile() {
- if(fh)
+ if (fh)
::fclose(fh);
}
@@ -99,7 +99,7 @@ public:
fh = ::gzopen(filename, (saveOrLoad? "wb" : "rb"));
}
~GzipSaveFile() {
- if(fh)
+ if (fh)
::gzclose(fh);
}
diff --git a/common/scaler/hq2x.cpp b/common/scaler/hq2x.cpp
index e0f29e8d85..3599c01b9b 100644
--- a/common/scaler/hq2x.cpp
+++ b/common/scaler/hq2x.cpp
@@ -49,7 +49,7 @@ static bool isAltiVecAvailable() {
int hasVectorUnit = 0;
size_t length = sizeof(hasVectorUnit);
int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0);
- if( 0 == error )
+ if ( 0 == error )
return hasVectorUnit != 0;
return false;
}
diff --git a/common/scaler/hq3x.cpp b/common/scaler/hq3x.cpp
index 8f077e6fe4..f0a92c533c 100644
--- a/common/scaler/hq3x.cpp
+++ b/common/scaler/hq3x.cpp
@@ -49,7 +49,7 @@ static bool isAltiVecAvailable() {
int hasVectorUnit = 0;
size_t length = sizeof(hasVectorUnit);
int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0);
- if( 0 == error )
+ if ( 0 == error )
return hasVectorUnit != 0;
return false;
}