Changeset - r21556:54687a87c1ce
[Not reviewed]
master
0 2 0
frosch - 10 years ago 2014-07-08 20:07:21
frosch@openttd.org
(svn r26679) -Codechange: VehicleListIdentifier::Pack can be const. (Juanjo)
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/vehiclelist.cpp
Show inline comments
 
@@ -17,13 +17,13 @@
 
#include "safeguards.h"
 

	
 
/**
 
 * Pack a VehicleListIdentifier in a single uint32.
 
 * @return The packed identifier.
 
 */
 
uint32 VehicleListIdentifier::Pack()
 
uint32 VehicleListIdentifier::Pack() const
 
{
 
	byte c = this->company == OWNER_NONE ? 0xF : (byte)this->company;
 
	assert(c             < (1 <<  4));
 
	assert(this->vtype   < (1 <<  2));
 
	assert(this->index   < (1 << 20));
 
	assert(this->type    < VLT_END);
src/vehiclelist.h
Show inline comments
 
@@ -31,13 +31,13 @@ enum VehicleListType {
 
struct VehicleListIdentifier {
 
	VehicleListType type; ///< The type of vehicle list.
 
	VehicleType vtype;    ///< The vehicle type associated with this list.
 
	CompanyID company;    ///< The company associated with this list.
 
	uint32 index;         ///< A vehicle list type specific index.
 

	
 
	uint32 Pack();
 
	uint32 Pack() const;
 
	bool Unpack(uint32 data);
 

	
 
	/**
 
	 * Create a simple vehicle list.
 
	 * @param type    List type.
 
	 * @param vtype   Vehicle type associated with this list.
0 comments (0 inline, 0 general)