Skip to content

Commit 86b4c84

Browse files
committed
Merge pull request quickfix#2 from Ambal/master
Fix broken vcproj files for VS2005 and VS2008
2 parents 1bcca6a + 02a931f commit 86b4c84

23 files changed

Lines changed: 226 additions & 190 deletions

src/C++/DataDictionary.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ void DataDictionary::validate( const Message& message,
113113
const DataDictionary* const pAppDD )
114114
throw( FIX::Exception )
115115
{
116-
const bool bodyOnly = pSessionDD == 0;
117116
const Header& header = message.getHeader();
118117
const BeginString& beginString = FIELD_GET_REF( header, BeginString );
119118
const MsgType& msgType = FIELD_GET_REF( header, MsgType );
@@ -126,8 +125,8 @@ throw( FIX::Exception )
126125
}
127126

128127
int field = 0;
129-
if( (pSessionDD !=0 && pSessionDD->m_checkFieldsOutOfOrder)
130-
|| (pAppDD != 0 && pAppDD->m_checkFieldsOutOfOrder) )
128+
if( (pSessionDD !=0 && pSessionDD->m_checkFieldsOutOfOrder) ||
129+
(pAppDD != 0 && pAppDD->m_checkFieldsOutOfOrder) )
131130
{
132131
if ( !message.hasValidStructure(field) )
133132
throw TagOutOfOrder(field);
@@ -139,13 +138,16 @@ throw( FIX::Exception )
139138
pAppDD->checkHasRequired( message.getHeader(), message, message.getTrailer(), msgType );
140139
}
141140

142-
if( !bodyOnly )
141+
if( pSessionDD != 0 )
143142
{
144143
pSessionDD->iterate( message.getHeader(), msgType );
145144
pSessionDD->iterate( message.getTrailer(), msgType );
146145
}
147146

148-
pAppDD->iterate( message, msgType );
147+
if( pAppDD != 0 )
148+
{
149+
pAppDD->iterate( message, msgType );
150+
}
149151
}
150152

151153
void DataDictionary::iterate( const FieldMap& map, const MsgType& msgType ) const

src/C++/DataDictionary.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class DataDictionary
110110
return true;
111111
}
112112

113-
bool getFieldTag( std::string name, int& field ) const
113+
bool getFieldTag( const std::string& name, int& field ) const
114114
{
115115
NameToField::const_iterator i = m_names.find( name );
116116
if(i == m_names.end()) return false;

src/C++/DataDictionaryProvider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void DataDictionaryProvider::addTransportDataDictionary
6363
}
6464

6565
void DataDictionaryProvider::addApplicationDataDictionary
66-
(const ApplVerID applVerID, const DataDictionary * pDD)
66+
(const ApplVerID& applVerID, const DataDictionary * pDD)
6767
{
6868
m_applicationDictionaries[applVerID.getValue()] = pDD;
6969
}

src/C++/DataDictionaryProvider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class DataDictionaryProvider
5151
throw( DataDictionaryNotFound );
5252

5353
void addTransportDataDictionary(const BeginString& beginString, const DataDictionary*);
54-
void addApplicationDataDictionary(const ApplVerID applVerID, const DataDictionary*);
54+
void addApplicationDataDictionary(const ApplVerID& applVerID, const DataDictionary*);
5555

5656
private:
5757
std::map<std::string, const DataDictionary*> m_transportDictionaries;

src/C++/Field.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class UtcTimeStampField : public FieldBase
334334
UtcTimeStampField( int field, bool showMilliseconds = false )
335335
: FieldBase( field, UtcTimeStampConvertor::convert( UtcTimeStamp(), showMilliseconds ) ) {}
336336

337-
void setValue( UtcTimeStamp& value )
337+
void setValue( const UtcTimeStamp& value )
338338
{ setString( UtcTimeStampConvertor::convert( value ) ); }
339339
UtcTimeStamp getValue() const throw ( IncorrectDataFormat )
340340
{ try
@@ -361,7 +361,7 @@ class UtcDateField : public FieldBase
361361
UtcDateField( int field )
362362
: FieldBase( field, UtcDateConvertor::convert( UtcDate() ) ) {}
363363

364-
void setValue( UtcDate& value )
364+
void setValue( const UtcDate& value )
365365
{ setString( UtcDateConvertor::convert( value ) ); }
366366
UtcDate getValue() const throw ( IncorrectDataFormat )
367367
{ try
@@ -388,7 +388,7 @@ class UtcTimeOnlyField : public FieldBase
388388
UtcTimeOnlyField( int field, bool showMilliseconds = false )
389389
: FieldBase( field, UtcTimeOnlyConvertor::convert( UtcTimeOnly(), showMilliseconds ) ) {}
390390

391-
void setValue( UtcTimeOnly& value )
391+
void setValue( const UtcTimeOnly& value )
392392
{ setString( UtcTimeOnlyConvertor::convert( value ) ); }
393393
UtcTimeOnly getValue() const throw ( IncorrectDataFormat )
394394
{ try

src/C++/FieldMap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void FieldMap::addGroupPtr( int field, FieldMap * group, bool setCount )
7474
setField( IntField( field, vec.size() ) );
7575
}
7676

77-
void FieldMap::replaceGroup( int num, int field, FieldMap& group )
77+
void FieldMap::replaceGroup( int num, int field, const FieldMap& group )
7878
{
7979
Groups::const_iterator i = m_groups.find( field );
8080
if ( i == m_groups.end() ) return;

src/C++/FieldMap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ class FieldMap
149149
/// Acquire ownership of Group object
150150
void addGroupPtr( int field, FieldMap * group, bool setCount = true );
151151

152-
/// Replace a specific instanct of a group.
153-
void replaceGroup( int num, int field, FieldMap& group );
152+
/// Replace a specific instance of a group.
153+
void replaceGroup( int num, int field, const FieldMap& group );
154154

155155
/// Get a specific instance of a group.
156156
FieldMap& getGroup( int num, int field, FieldMap& group ) const

src/C++/FileStore.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,7 @@ void FileStore::open( bool deleteFile )
125125

126126
void FileStore::populateCache()
127127
{
128-
std::string msg;
129-
Message message;
130-
131-
FILE* headerFile;
132-
headerFile = file_fopen( m_headerFileName.c_str(), "r+" );
128+
FILE* headerFile = file_fopen( m_headerFileName.c_str(), "r+" );
133129
if ( headerFile )
134130
{
135131
int num, offset, size;
@@ -138,8 +134,7 @@ void FileStore::populateCache()
138134
fclose( headerFile );
139135
}
140136

141-
FILE* seqNumsFile;
142-
seqNumsFile = file_fopen( m_seqNumsFileName.c_str(), "r+" );
137+
FILE* seqNumsFile = file_fopen( m_seqNumsFileName.c_str(), "r+" );
143138
if ( seqNumsFile )
144139
{
145140
int sender, target;
@@ -151,8 +146,7 @@ void FileStore::populateCache()
151146
fclose( seqNumsFile );
152147
}
153148

154-
FILE* sessionFile;
155-
sessionFile = file_fopen( m_sessionFileName.c_str(), "r+" );
149+
FILE* sessionFile = file_fopen( m_sessionFileName.c_str(), "r+" );
156150
if ( sessionFile )
157151
{
158152
char time[ 22 ];

src/C++/Group.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727

2828
namespace FIX
2929
{
30-
void Group::addGroup( Group& group )
30+
void Group::addGroup( const Group& group )
3131
{
3232
FieldMap::addGroup( group.field(), group );
3333
}
3434

35-
void Group::replaceGroup( unsigned num, FIX::Group& group )
35+
void Group::replaceGroup( unsigned num, const FIX::Group& group )
3636
{
3737
FieldMap::replaceGroup( num, group.field(), group );
3838
}
@@ -42,17 +42,17 @@ Group& Group::getGroup( unsigned num, Group& group ) const throw( FieldNotFound
4242
return static_cast < Group& > ( FieldMap::getGroup( num, group.field(), group ) );
4343
}
4444

45-
void Group::removeGroup( unsigned num, Group& group )
45+
void Group::removeGroup( unsigned num, const Group& group )
4646
{
4747
FieldMap::removeGroup( num, group.field() );
4848
}
4949

50-
void Group::removeGroup( Group& group )
50+
void Group::removeGroup( const Group& group )
5151
{
5252
FieldMap::removeGroup( group.field() );
5353
}
5454

55-
bool Group::hasGroup( unsigned num, Group& group )
55+
bool Group::hasGroup( unsigned num, const Group& group )
5656
{
5757
return FieldMap::hasGroup( num, group.field() );
5858
}

src/C++/Group.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ class Group : public FieldMap
5656
int field() const { return m_field; }
5757
int delim() const { return m_delim; }
5858

59-
void addGroup( Group& group );
60-
void replaceGroup( unsigned num, Group& group );
59+
void addGroup( const Group& group );
60+
void replaceGroup( unsigned num, const Group& group );
6161
Group& getGroup( unsigned num, Group& group ) const throw( FieldNotFound );
62-
void removeGroup( unsigned num, Group& group );
63-
void removeGroup( Group& group );
62+
void removeGroup( unsigned num, const Group& group );
63+
void removeGroup( const Group& group );
6464
bool hasGroup( const Group& group );
65-
bool hasGroup( unsigned num, Group& group );
65+
bool hasGroup( unsigned num, const Group& group );
6666

6767
private:
6868
int m_field;

0 commit comments

Comments
 (0)