my own uncrustify run

This commit is contained in:
Rudolf Polzer
2012-03-27 12:03:21 +02:00
parent 203343b01a
commit e4287c28bb
1056 changed files with 194610 additions and 205971 deletions

View File

@@ -1,25 +1,25 @@
/*
Copyright (C) 2001-2006, William Joseph.
All Rights Reserved.
Copyright (C) 2001-2006, William Joseph.
All Rights Reserved.
This file is part of GtkRadiant.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#if !defined(INCLUDED_VERSIONLIB_H)
#if !defined( INCLUDED_VERSIONLIB_H )
#define INCLUDED_VERSIONLIB_H
#include <cstddef>
@@ -29,63 +29,56 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
class Version
{
public:
int major;
int minor;
int major;
int minor;
};
inline bool operator<(const Version& version, const Version& other)
{
return version.major < other.major || (!(other.major < version.major) && version.minor < other.minor);
inline bool operator<( const Version& version, const Version& other ){
return version.major < other.major || ( !( other.major < version.major ) && version.minor < other.minor );
}
template<typename TextOutputStreamType>
TextOutputStreamType& ostream_write(TextOutputStreamType& outputStream, const Version& version)
{
return outputStream << version.major << '.' << version.minor;
TextOutputStreamType& ostream_write( TextOutputStreamType& outputStream, const Version& version ){
return outputStream << version.major << '.' << version.minor;
}
/// \brief Returns true if \p version (code) is compatible with \p other (data).
inline bool version_compatible(const Version& version, const Version& other)
{
return version.major == other.major // different major-versions are always incompatible
&& !(version.minor < other.minor); // data minor-version is incompatible if greater than code minor-version
inline bool version_compatible( const Version& version, const Version& other ){
return version.major == other.major // different major-versions are always incompatible
&& !( version.minor < other.minor ); // data minor-version is incompatible if greater than code minor-version
}
inline int string_range_parse_unsigned_decimal_integer(const char* first, const char* last)
{
int result = 0;
for(; first != last; ++first)
{
result *= 10;
result += *first - '0';
}
return result;
inline int string_range_parse_unsigned_decimal_integer( const char* first, const char* last ){
int result = 0;
for (; first != last; ++first )
{
result *= 10;
result += *first - '0';
}
return result;
}
inline Version version_parse(const char* versionString)
{
Version version;
const char* endVersion = versionString + strlen(versionString);
inline Version version_parse( const char* versionString ){
Version version;
const char* endVersion = versionString + strlen( versionString );
const char* endMajor = strchr(versionString, '.');
if(endMajor == 0)
{
endMajor = endVersion;
const char* endMajor = strchr( versionString, '.' );
if ( endMajor == 0 ) {
endMajor = endVersion;
version.minor = 0;
}
else
{
const char* endMinor = strchr(endMajor + 1, '.');
if(endMinor == 0)
{
endMinor = endVersion;
}
version.minor = string_range_parse_unsigned_decimal_integer(endMajor + 1, endMinor);
}
version.major = string_range_parse_unsigned_decimal_integer(versionString, endMajor);
version.minor = 0;
}
else
{
const char* endMinor = strchr( endMajor + 1, '.' );
if ( endMinor == 0 ) {
endMinor = endVersion;
}
version.minor = string_range_parse_unsigned_decimal_integer( endMajor + 1, endMinor );
}
version.major = string_range_parse_unsigned_decimal_integer( versionString, endMajor );
return version;
return version;
}
#endif