Commit bd531f6d authored by Andrea Valassi's avatar Andrea Valassi
Browse files

New cleanup using a version of coolCppClean that includes uncrustify.

This version of uncrustify is tuned to result in no large change
(eg no splitting of lines and realignments of if/else and for blocks),
but it already results in a few useful improvements, such as
- Remove spaces: 'void  f()' becomes 'void f()'
- Remove spaces: 'f();  // comment' becomes 'f(); // comment'
- Remove spaces: 'typedef a  b;' becomes 'typedef a b;'
- Remove spaces: 'static A  a;' becomes 'static A a;'
- Add spaces: 'class A: B' becomes 'class A : B'
- Add spaces: 'default: ...' becomes 'default : ...'
- Add spaces: 'if ( ... ){' becomes 'if ( ... ) {'
- Add spaces: 'catch( ... ){' becomes 'catch( ... ) {'
- Add spaces: '{/* noop */ }' becomes '{ /* noop */ }'
- Align all trailing comments to the code rather than to each other
- Force exactly one newline at the end of the file
- Force exactly one whitespace before trailing continuation characters "\"
I tuned the configuration file a few times until I tested that the process
converges to a stable results (a second run does not change the code!).


git-svn-id: file:///git/lcgcool.svndb/cool/trunk@16479 4525493e-7705-40b1-a816-d608a930855b
parent ea5b0370
// $Id: ChannelId.h,v 1.4 2009-12-16 17:41:23 avalassi Exp $
// $Id: ChannelId.h,v 1.5 2009-12-17 18:50:42 avalassi Exp $
#ifndef COOLKERNEL_CHANNELID_H
#define COOLKERNEL_CHANNELID_H
......@@ -20,4 +20,3 @@ namespace cool {
}
#endif
// $Id: CompositeSelection.h,v 1.7 2009-12-16 17:41:23 avalassi Exp $
// $Id: CompositeSelection.h,v 1.8 2009-12-17 18:50:42 avalassi Exp $
#ifndef COOLKERNEL_COMPOSITESELECTION_H
#define COOLKERNEL_COMPOSITESELECTION_H 1
......@@ -26,7 +26,7 @@ namespace cool
public:
/// Logical connectives (logical operations).
enum Connective{ AND, OR };
enum Connective { AND, OR };
/// Describe a logical connective.
static const std::string describe( Connective conn );
......
// $Id: FieldSelection.h,v 1.15 2009-12-16 17:41:24 avalassi Exp $
// $Id: FieldSelection.h,v 1.16 2009-12-17 18:50:42 avalassi Exp $
#ifndef COOLKERNEL_FIELDSELECTION_H
#define COOLKERNEL_FIELDSELECTION_H 1
......@@ -26,10 +26,10 @@ namespace cool
public:
/// Binary relation operator (comparison to a reference value).
enum Relation{ EQ, NE, GT, GE, LT, LE };
enum Relation { EQ, NE, GT, GE, LT, LE };
/// Unary nullness operator (comparison to NULL).
enum Nullness{ IS_NULL, IS_NOT_NULL };
enum Nullness { IS_NULL, IS_NOT_NULL };
/// Describe a binary relation operator.
static const std::string describe( Relation relation );
......
......@@ -92,4 +92,3 @@ namespace cool
}
#endif // COOLKERNEL_FOLDERSPECIFICATION_H
// $Id: IField.h,v 1.51 2009-12-16 17:41:24 avalassi Exp $
// $Id: IField.h,v 1.52 2009-12-17 18:50:42 avalassi Exp $
#ifndef COOLKERNEL_IFIELD_H
#define COOLKERNEL_IFIELD_H 1
......@@ -7,7 +7,7 @@
#include "CoolKernel/RecordException.h"
// Forward declarations
namespace coral{
namespace coral {
class Attribute;
}
......
......@@ -79,4 +79,3 @@ namespace cool
}
#endif // COOLKERNEL_IFOLDERSPECIFICATION_H
// $Id: IRecord.h,v 1.32 2009-12-16 17:41:24 avalassi Exp $
// $Id: IRecord.h,v 1.33 2009-12-17 18:50:42 avalassi Exp $
#ifndef COOLKERNEL_IRECORD_H
#define COOLKERNEL_IRECORD_H 1
......@@ -21,49 +21,49 @@ namespace cool
class IRecord {
/** @class IRecord IRecord.h
*
* Abstract interface to a data record: an ordered collection
* of data fields of user-defined names and storage types.
*
* A field is a transient data value that can be made persistent.
* Its StorageType specification defines constraints on its allowed
* data values (e.g. strings of less than 256 characters), to ensure
* portability across different platforms and persistent backends.
* While each StorageType is associated to a platform-dependent transient
* C++ type and to a backend-dependent persistent (e.g. SQL) data type,
* the StorageType class allows users to write their code to define and
* handles records and fields in a platform- and backend-independent way.
*
* All public methods of the IRecord interface are const: this is in
* practice a read-only interface. The only non-const methods are those
* that allow non-const access to the IField interfaces of its fields:
* these are protected, to be used or implemented in derived classes.
* Implementations of IField and IRecord are responsible for enforcing
* the StorageType constraints on the data values in all of their
* non-const methods, as well as at construction and assignment time.
* The use of const_cast on any const method is highly discouraged
* as it may lead to data corruption inside the IRecord instance.
*
* It is not possible to add, remove, rename or change the types of fields
* via the IRecord interface: if necessary, this is the responsibility
* of the concrete classes implementing IRecord or IRecordSpecification.
*
* Field names are a property of fields and their specifications: record
* specifications only define which fields exist and in which order.
* The IRecord base class manages field names and indexes according
* to its record specification. The implementation of size, index and
* operator[] is inlined and delegated to IRecordSpecification, while
* the concrete derived classes must only implement the field() method.
*
* Implementations of the IRecord interface may or may not be based on
* the coral::AttributeList class. To simplify the port of user code,
* an attributeList() method is provided to retrieve the contents of
* the IRecord as a (read-only) constant AttributeList reference.
* This is DEPRECATED and may be removed in a future COOL release.
*
* @author Andrea Valassi and Marco Clemencic
* @date 2006-09-28
*/
*
* Abstract interface to a data record: an ordered collection
* of data fields of user-defined names and storage types.
*
* A field is a transient data value that can be made persistent.
* Its StorageType specification defines constraints on its allowed
* data values (e.g. strings of less than 256 characters), to ensure
* portability across different platforms and persistent backends.
* While each StorageType is associated to a platform-dependent transient
* C++ type and to a backend-dependent persistent (e.g. SQL) data type,
* the StorageType class allows users to write their code to define and
* handles records and fields in a platform- and backend-independent way.
*
* All public methods of the IRecord interface are const: this is in
* practice a read-only interface. The only non-const methods are those
* that allow non-const access to the IField interfaces of its fields:
* these are protected, to be used or implemented in derived classes.
* Implementations of IField and IRecord are responsible for enforcing
* the StorageType constraints on the data values in all of their
* non-const methods, as well as at construction and assignment time.
* The use of const_cast on any const method is highly discouraged
* as it may lead to data corruption inside the IRecord instance.
*
* It is not possible to add, remove, rename or change the types of fields
* via the IRecord interface: if necessary, this is the responsibility
* of the concrete classes implementing IRecord or IRecordSpecification.
*
* Field names are a property of fields and their specifications: record
* specifications only define which fields exist and in which order.
* The IRecord base class manages field names and indexes according
* to its record specification. The implementation of size, index and
* operator[] is inlined and delegated to IRecordSpecification, while
* the concrete derived classes must only implement the field() method.
*
* Implementations of the IRecord interface may or may not be based on
* the coral::AttributeList class. To simplify the port of user code,
* an attributeList() method is provided to retrieve the contents of
* the IRecord as a (read-only) constant AttributeList reference.
* This is DEPRECATED and may be removed in a future COOL release.
*
* @author Andrea Valassi and Marco Clemencic
* @date 2006-09-28
*/
public:
......
// $Id: ITransaction.h,v 1.5 2009-12-16 17:41:24 avalassi Exp $
// $Id: ITransaction.h,v 1.6 2009-12-17 18:50:42 avalassi Exp $
#ifndef COOLKERNEL_ITRANSACTION_H
#define COOLKERNEL_ITRANSACTION_H
......@@ -37,4 +37,3 @@ namespace cool
}
#endif
// $Id: RecordException.h,v 1.15 2009-12-16 17:41:24 avalassi Exp $
// $Id: RecordException.h,v 1.16 2009-12-17 18:50:42 avalassi Exp $
#ifndef COOLKERNEL_RECORDEXCEPTION_H
#define COOLKERNEL_RECORDEXCEPTION_H 1
......@@ -511,7 +511,7 @@ namespace cool {
explicit StorageTypeBlobTooLong
( const std::string& expectedName,
const StorageType& expectedStorageType,
long actualSize, // coral::Blob::size() returns long
long actualSize, // coral::Blob::size() returns long
const std::string& domain )
: StorageTypeInvalidValue( "", domain )
{
......
// $Id: ValidityKey.h,v 1.10 2007-09-16 10:16:17 sas Exp $
// $Id: ValidityKey.h,v 1.11 2009-12-17 18:50:42 avalassi Exp $
#ifndef COOLKERNEL_VALIDITYKEY_H
#define COOLKERNEL_VALIDITYKEY_H
......@@ -49,4 +49,3 @@ namespace cool {
}
#endif
// $Id: pointers.h,v 1.5 2009-12-16 17:41:24 avalassi Exp $
// $Id: pointers.h,v 1.6 2009-12-17 18:50:42 avalassi Exp $
#ifndef COOLKERNEL_POINTERS_H
#define COOLKERNEL_POINTERS_H
......@@ -45,4 +45,3 @@ namespace cool {
}
#endif
// $Id: types.h,v 1.53 2009-12-16 17:41:24 avalassi Exp $
// $Id: types.h,v 1.54 2009-12-17 18:50:42 avalassi Exp $
#ifndef COOLKERNEL_TYPES_H
#define COOLKERNEL_TYPES_H
......@@ -23,32 +23,32 @@ namespace cool {
/// already supported and those candidate to be supported in the future).
// -------------------------------------------------------------------------
typedef bool Bool;
typedef bool Bool;
typedef signed char SChar;
typedef unsigned char UChar;
typedef signed char SChar;
typedef unsigned char UChar;
typedef short Int16;
typedef unsigned short UInt16;
typedef short Int16;
typedef unsigned short UInt16;
typedef int Int32;
typedef unsigned int UInt32;
typedef int Int32;
typedef unsigned int UInt32;
typedef long long Int64;
typedef unsigned long long UInt64;
typedef long long Int64;
typedef unsigned long long UInt64;
typedef UInt64 UInt63;
typedef UInt64 UInt63;
typedef float Float;
typedef double Double;
typedef float Float;
typedef double Double;
typedef std::string String255;
typedef std::string String4k;
typedef std::string String64k;
typedef std::string String16M;
typedef std::string String255;
typedef std::string String4k;
typedef std::string String64k;
typedef std::string String16M;
typedef coral::Blob Blob64k;
typedef coral::Blob Blob16M;
typedef coral::Blob Blob64k;
typedef coral::Blob Blob16M;
// -------------------------------------------------------------------------
/// Constant definitions for the min/max values of a few supported types.
......@@ -63,13 +63,13 @@ namespace cool {
const UChar UCharMin = 0;
const UChar UCharMax = UCHAR_MAX; // +255
const Int16 Int16Min = SHRT_MIN; // -32768
const Int16 Int16Max = SHRT_MAX; // +32767
const Int16 Int16Min = SHRT_MIN; // -32768
const Int16 Int16Max = SHRT_MAX; // +32767
const UInt16 UInt16Min = 0;
const UInt16 UInt16Max = USHRT_MAX; // +65535
const Int32 Int32Min = INT_MIN; // -2147483648
const Int32 Int32Max = INT_MAX; // +2147483647
const Int32 Int32Min = INT_MIN; // -2147483648
const Int32 Int32Max = INT_MAX; // +2147483647
const UInt32 UInt32Min = 0;
const UInt32 UInt32Max = UINT_MAX; // +4294967295
......@@ -80,24 +80,24 @@ namespace cool {
//const Int64 Int64Max = _I64_MAX; // +9223372036854775807
//const UInt64 UInt64Min = 0;
//const UInt64 UInt64Max = _UI64_MAX; // +18446744073709551615
const Int64 Int64Min = 0x8000000000000000ll; // -9223372036854775808
const Int64 Int64Max = 0x7fffffffffffffffll; // +9223372036854775807
const Int64 Int64Min = 0x8000000000000000ll; // -9223372036854775808
const Int64 Int64Max = 0x7fffffffffffffffll; // +9223372036854775807
const UInt64 UInt64Min = 0;
const UInt64 UInt64Max = 0xffffffffffffffffll; // +18446744073709551615
const UInt64 UInt64Max = 0xffffffffffffffffll; // +18446744073709551615
#else
# if defined LONG_LONG_MAX
// Supported platforms: slc3_ia32, slc4_ia32, slc4_amd64
const Int64 Int64Min = LONG_LONG_MIN; // -9223372036854775808
const Int64 Int64Max = LONG_LONG_MAX; // +9223372036854775807
const Int64 Int64Min = LONG_LONG_MIN; // -9223372036854775808
const Int64 Int64Max = LONG_LONG_MAX; // +9223372036854775807
const UInt64 UInt64Min = 0;
const UInt64 UInt64Max = ULONG_LONG_MAX; // +18446744073709551615
const UInt64 UInt64Max = ULONG_LONG_MAX; // +18446744073709551615
# else
// Supported platforms: osx104_ppc (why is LONG_LONG_MAX not defined?...)
// See /usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include/limits.h
const Int64 Int64Min = -__LONG_LONG_MAX__-1LL; // -9223372036854775808
const Int64 Int64Max = __LONG_LONG_MAX__; // +9223372036854775807
const Int64 Int64Min = -__LONG_LONG_MAX__-1LL; // -9223372036854775808
const Int64 Int64Max = __LONG_LONG_MAX__; // +9223372036854775807
const UInt64 UInt64Min = 0;
const UInt64 UInt64Max = __LONG_LONG_MAX__*2ULL+1ULL;// +18446744073709551615
const UInt64 UInt64Max = __LONG_LONG_MAX__*2ULL+1ULL; // +18446744073709551615
# endif
#endif
......@@ -108,4 +108,3 @@ namespace cool {
}
#endif
// $Id: ChannelSelection.cpp,v 1.6 2009-12-16 17:31:22 avalassi Exp $
// $Id: ChannelSelection.cpp,v 1.7 2009-12-17 18:50:43 avalassi Exp $
// Include files
#include "CoolKernel/ChannelSelection.h"
......@@ -270,4 +270,3 @@ unsigned int ChannelSelection::rangeCount() const
}
//-----------------------------------------------------------------------------
// $Id: CompositeSelection.cpp,v 1.9 2009-12-16 17:31:22 avalassi Exp $
// $Id: CompositeSelection.cpp,v 1.10 2009-12-17 18:50:43 avalassi Exp $
// Include files
#include <sstream>
......@@ -188,4 +188,3 @@ CompositeSelection::operator[] ( unsigned int index ) const
}
//-----------------------------------------------------------------------------
// $Id: ConstFieldAdapter.cpp,v 1.18 2009-12-16 17:31:22 avalassi Exp $
// $Id: ConstFieldAdapter.cpp,v 1.19 2009-12-17 18:50:43 avalassi Exp $
// Include files
#include "CoralBase/Attribute.h"
......@@ -130,4 +130,3 @@ const coral::Attribute& ConstFieldAdapter::attribute() const
}
//-----------------------------------------------------------------------------
// $Id: ConstRecordAdapter.cpp,v 1.19 2009-12-16 17:31:22 avalassi Exp $
// $Id: ConstRecordAdapter.cpp,v 1.20 2009-12-17 18:50:43 avalassi Exp $
// Include files
#include "CoolKernel/ConstRecordAdapter.h"
......@@ -96,4 +96,3 @@ const coral::AttributeList& ConstRecordAdapter::attributeList() const
}
//-----------------------------------------------------------------------------
// $Id: FieldAdapter.cpp,v 1.24 2009-12-16 17:31:22 avalassi Exp $
// $Id: FieldAdapter.cpp,v 1.25 2009-12-17 18:50:43 avalassi Exp $
// Include files
#include "CoralBase/Attribute.h"
......@@ -158,4 +158,3 @@ const coral::Attribute& FieldAdapter::attribute() const
}
//-----------------------------------------------------------------------------
// $Id: FieldSelection.cpp,v 1.17 2009-12-16 17:31:22 avalassi Exp $
// $Id: FieldSelection.cpp,v 1.18 2009-12-17 18:50:43 avalassi Exp $
// Include files
//#include <iostream>
......@@ -16,7 +16,7 @@ const std::string FieldSelection::describe( FieldSelection::Relation relation )
{
switch( relation )
{
case EQ: return "="; // SQL-like '=' rather than C++-like '=='
case EQ: return "="; // SQL-like '=' rather than C++-like '=='
case NE: return "!=";
case GT: return ">";
case GE: return ">=";
......@@ -334,4 +334,3 @@ const IField& FieldSelection::referenceValue() const
}
//-----------------------------------------------------------------------------
// $Id: FolderSpecification.cpp,v 1.6 2009-12-16 17:31:22 avalassi Exp $
// $Id: FolderSpecification.cpp,v 1.7 2009-12-17 18:50:43 avalassi Exp $
// Include files
#include "CoolKernel/FolderSpecification.h"
......@@ -109,4 +109,3 @@ bool& FolderSpecification::hasPayloadTable()
}
//-----------------------------------------------------------------------------
// $Id: Record.cpp,v 1.37 2009-12-16 17:31:22 avalassi Exp $
// $Id: Record.cpp,v 1.38 2009-12-17 18:50:43 avalassi Exp $
// Include files
#include <iostream>
......@@ -230,5 +230,3 @@ void Record::extend( const IRecord& rhs )
}
//-----------------------------------------------------------------------------
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment