Changeset - r14083:338691e8f2d4
[Not reviewed]
master
0 2 0
smatz - 14 years ago 2009-12-26 13:49:14
smatz@openttd.org
(svn r18640) -Fix (r18633): don't assert when accessing first invalid item, it's used quite often in the code
-Revert (r18637): it's not needed any more
2 files changed with 4 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/core/smallvec_type.hpp
Show inline comments
 
@@ -222,25 +222,27 @@ public:
 
	 *
 
	 * @param index the position of the item
 
	 * @return the pointer to the item
 
	 */
 
	FORCEINLINE const T *Get(uint index) const
 
	{
 
		assert(index < this->items);
 
		/* Allow access to the 'first invalid' item */
 
		assert(index <= this->items);
 
		return &this->data[index];
 
	}
 

	
 
	/**
 
	 * Get the pointer to item "number"
 
	 *
 
	 * @param index the position of the item
 
	 * @return the pointer to the item
 
	 */
 
	FORCEINLINE T *Get(uint index)
 
	{
 
		assert(index < this->items);
 
		/* Allow access to the 'first invalid' item */
 
		assert(index <= this->items);
 
		return &this->data[index];
 
	}
 

	
 
	/**
 
	 * Get item "number" (const)
 
	 *
src/network/network_content_gui.cpp
Show inline comments
 
@@ -432,15 +432,12 @@ public:
 
			case NCLWW_NAME     - NCLWW_CHECKBOX: this->DrawSortButtonState(NCLWW_NAME,     arrow); break;
 
		}
 
	}
 

	
 
	void DrawMatrix(const Rect &r) const
 
	{
 
		/* Is there something to do? */
 
		if (this->content.Length() == 0) return;
 

	
 
		const NWidgetBase *nwi_checkbox = this->GetWidget<NWidgetBase>(NCLWW_CHECKBOX);
 
		const NWidgetBase *nwi_name = this->GetWidget<NWidgetBase>(NCLWW_NAME);
 
		const NWidgetBase *nwi_type = this->GetWidget<NWidgetBase>(NCLWW_TYPE);
 

	
 

	
 
		/* Fill the matrix with the information */
0 comments (0 inline, 0 general)