Changeset - r18348:3c70046385fe
[Not reviewed]
master
0 11 0
rubidium - 13 years ago 2011-11-12 08:26:30
rubidium@openttd.org
(svn r23194) -Codechange: don't cast away const needlessly
11 files changed with 25 insertions and 25 deletions:
0 comments (0 inline, 0 general)
src/3rdparty/squirrel/squirrel/sqdebug.cpp
Show inline comments
 
@@ -91,7 +91,7 @@ SQString *SQVM::PrintObjVal(const SQObje
 
	}
 
}
 

	
 
void SQVM::Raise_IdxError(SQObject &o)
 
void SQVM::Raise_IdxError(const SQObject &o)
 
{
 
	SQObjectPtr oval = PrintObjVal(o);
 
	Raise_Error(_SC("the index '%.50s' does not exist"), _stringval(oval));
src/3rdparty/squirrel/squirrel/sqvm.cpp
Show inline comments
 
@@ -459,7 +459,7 @@ bool SQVM::DerefInc(SQInteger op,SQObjec
 
#define sarg1 (*(const_cast<SQInt32 *>(&_i_._arg1)))
 
#define arg2 (_i_._arg2)
 
#define arg3 (_i_._arg3)
 
#define sarg3 ((SQInteger)*((signed char *)&_i_._arg3))
 
#define sarg3 ((SQInteger)*((const signed char *)&_i_._arg3))
 

	
 
SQRESULT SQVM::Suspend()
 
{
 
@@ -742,7 +742,7 @@ exception_restore:
 
				continue;
 
			case _OP_LOAD: TARGET = ci->_literals[arg1]; continue;
 
			case _OP_LOADINT: TARGET = (SQInteger)arg1; continue;
 
			case _OP_LOADFLOAT: TARGET = *((SQFloat *)&arg1); continue;
 
			case _OP_LOADFLOAT: TARGET = *((const SQFloat *)&arg1); continue;
 
			case _OP_DLOAD: TARGET = ci->_literals[arg1]; STK(arg2) = ci->_literals[arg3];continue;
 
			case _OP_TAILCALL:
 
				temp_reg = STK(arg1);
 
@@ -1434,7 +1434,7 @@ bool SQVM::DeleteSlot(const SQObjectPtr 
 
					_table(self)->Remove(key);
 
				}
 
				else {
 
					Raise_IdxError((SQObject &)key);
 
					Raise_IdxError((const SQObject &)key);
 
					return false;
 
				}
 
			}
src/3rdparty/squirrel/squirrel/sqvm.h
Show inline comments
 
@@ -84,7 +84,7 @@ public:
 

	
 
	void Raise_Error(const SQChar *s, ...);
 
	void Raise_Error(SQObjectPtr &desc);
 
	void Raise_IdxError(SQObject &o);
 
	void Raise_IdxError(const SQObject &o);
 
	void Raise_CompareError(const SQObject &o1, const SQObject &o2);
 
	void Raise_ParamTypeError(SQInteger nparam,SQInteger typemask,SQInteger type);
 

	
src/blitter/32bpp_anim.cpp
Show inline comments
 
@@ -44,7 +44,7 @@ inline void Blitter_32bppAnim::Draw(cons
 
		const Colour *src_px_ln = (const Colour *)((const byte *)src_px + *(const uint32 *)src_px);
 
		src_px++;
 

	
 
		const uint8 *src_n_ln = src_n + *(uint32 *)src_n;
 
		const uint8 *src_n_ln = src_n + *(const uint32 *)src_n;
 
		src_n += 4;
 

	
 
		uint32 *dst_end = dst + bp->skip_left;
 
@@ -296,7 +296,7 @@ void Blitter_32bppAnim::CopyFromBuffer(v
 
	assert(!_screen_disable_anim);
 
	assert(video >= _screen.dst_ptr && video <= (uint32 *)_screen.dst_ptr + _screen.width + _screen.height * _screen.pitch);
 
	uint32 *dst = (uint32 *)video;
 
	uint32 *usrc = (uint32 *)src;
 
	const uint32 *usrc = (const uint32 *)src;
 
	uint8 *anim_line = ((uint32 *)video - (uint32 *)_screen.dst_ptr) + this->anim_buf;
 

	
 
	for (; height > 0; height--) {
 
@@ -309,7 +309,7 @@ void Blitter_32bppAnim::CopyFromBuffer(v
 
		dst += _screen.pitch;
 
		/* Copy back the anim-buffer */
 
		memcpy(anim_line, usrc, width * sizeof(uint8));
 
		usrc = (uint32 *)((uint8 *)usrc + width);
 
		usrc = (const uint32 *)((const uint8 *)usrc + width);
 
		anim_line += this->anim_buf_width;
 

	
 
		/* Okay, it is *very* likely that the image we stored is using
 
@@ -336,12 +336,12 @@ void Blitter_32bppAnim::CopyToBuffer(con
 
	assert(!_screen_disable_anim);
 
	assert(video >= _screen.dst_ptr && video <= (uint32 *)_screen.dst_ptr + _screen.width + _screen.height * _screen.pitch);
 
	uint32 *udst = (uint32 *)dst;
 
	uint32 *src = (uint32 *)video;
 
	uint8 *anim_line;
 
	const uint32 *src = (const uint32 *)video;
 
	const uint8 *anim_line;
 

	
 
	if (this->anim_buf == NULL) return;
 

	
 
	anim_line = ((uint32 *)video - (uint32 *)_screen.dst_ptr) + this->anim_buf;
 
	anim_line = ((const uint32 *)video - (uint32 *)_screen.dst_ptr) + this->anim_buf;
 

	
 
	for (; height > 0; height--) {
 
		memcpy(udst, src, width * sizeof(uint32));
src/blitter/32bpp_base.cpp
Show inline comments
 
@@ -12,7 +12,7 @@
 
#include "../stdafx.h"
 
#include "32bpp_base.hpp"
 

	
 
void *Blitter_32bppBase::MoveTo(const void *video, int x, int y)
 
void *Blitter_32bppBase::MoveTo(void *video, int x, int y)
 
{
 
	return (uint32 *)video + x + y * _screen.pitch;
 
}
 
@@ -39,7 +39,7 @@ void Blitter_32bppBase::DrawRect(void *v
 
void Blitter_32bppBase::CopyFromBuffer(void *video, const void *src, int width, int height)
 
{
 
	uint32 *dst = (uint32 *)video;
 
	uint32 *usrc = (uint32 *)src;
 
	const uint32 *usrc = (const uint32 *)src;
 

	
 
	for (; height > 0; height--) {
 
		memcpy(dst, usrc, width * sizeof(uint32));
 
@@ -51,7 +51,7 @@ void Blitter_32bppBase::CopyFromBuffer(v
 
void Blitter_32bppBase::CopyToBuffer(const void *video, void *dst, int width, int height)
 
{
 
	uint32 *udst = (uint32 *)dst;
 
	uint32 *src = (uint32 *)video;
 
	const uint32 *src = (const uint32 *)video;
 

	
 
	for (; height > 0; height--) {
 
		memcpy(udst, src, width * sizeof(uint32));
 
@@ -63,7 +63,7 @@ void Blitter_32bppBase::CopyToBuffer(con
 
void Blitter_32bppBase::CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch)
 
{
 
	uint32 *udst = (uint32 *)dst;
 
	uint32 *src = (uint32 *)video;
 
	const uint32 *src = (const uint32 *)video;
 

	
 
	for (; height > 0; height--) {
 
		memcpy(udst, src, width * sizeof(uint32));
src/blitter/32bpp_base.hpp
Show inline comments
 
@@ -20,7 +20,7 @@
 
class Blitter_32bppBase : public Blitter {
 
public:
 
	/* virtual */ uint8 GetScreenDepth() { return 32; }
 
	/* virtual */ void *MoveTo(const void *video, int x, int y);
 
	/* virtual */ void *MoveTo(void *video, int x, int y);
 
	/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
 
	/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
 
	/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
src/blitter/32bpp_optimized.cpp
Show inline comments
 
@@ -40,7 +40,7 @@ inline void Blitter_32bppOptimized::Draw
 
	/* skip upper lines in src_px and src_n */
 
	for (uint i = bp->skip_top; i != 0; i--) {
 
		src_px = (const Colour *)((const byte *)src_px + *(const uint32 *)src_px);
 
		src_n += *(uint32 *)src_n;
 
		src_n += *(const uint32 *)src_n;
 
	}
 

	
 
	/* skip lines in dst */
 
@@ -58,7 +58,7 @@ inline void Blitter_32bppOptimized::Draw
 
		src_px++;
 

	
 
		/* next src_n line begins here */
 
		const uint8 *src_n_ln = src_n + *(uint32 *)src_n;
 
		const uint8 *src_n_ln = src_n + *(const uint32 *)src_n;
 
		src_n += 4;
 

	
 
		/* we will end this line when we reach this point */
src/blitter/8bpp_base.cpp
Show inline comments
 
@@ -23,7 +23,7 @@ void Blitter_8bppBase::DrawColourMapping
 
	} while (--height);
 
}
 

	
 
void *Blitter_8bppBase::MoveTo(const void *video, int x, int y)
 
void *Blitter_8bppBase::MoveTo(void *video, int x, int y)
 
{
 
	return (uint8 *)video + x + y * _screen.pitch;
 
}
 
@@ -44,7 +44,7 @@ void Blitter_8bppBase::DrawRect(void *vi
 
void Blitter_8bppBase::CopyFromBuffer(void *video, const void *src, int width, int height)
 
{
 
	uint8 *dst = (uint8 *)video;
 
	uint8 *usrc = (uint8 *)src;
 
	const uint8 *usrc = (const uint8 *)src;
 

	
 
	for (; height > 0; height--) {
 
		memcpy(dst, usrc, width * sizeof(uint8));
 
@@ -56,7 +56,7 @@ void Blitter_8bppBase::CopyFromBuffer(vo
 
void Blitter_8bppBase::CopyToBuffer(const void *video, void *dst, int width, int height)
 
{
 
	uint8 *udst = (uint8 *)dst;
 
	uint8 *src = (uint8 *)video;
 
	const uint8 *src = (const uint8 *)video;
 

	
 
	for (; height > 0; height--) {
 
		memcpy(udst, src, width * sizeof(uint8));
 
@@ -68,7 +68,7 @@ void Blitter_8bppBase::CopyToBuffer(cons
 
void Blitter_8bppBase::CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch)
 
{
 
	uint8 *udst = (uint8 *)dst;
 
	uint8 *src = (uint8 *)video;
 
	const uint8 *src = (const uint8 *)video;
 

	
 
	for (; height > 0; height--) {
 
		memcpy(udst, src, width * sizeof(uint8));
src/blitter/8bpp_base.hpp
Show inline comments
 
@@ -19,7 +19,7 @@ class Blitter_8bppBase : public Blitter 
 
public:
 
	/* virtual */ uint8 GetScreenDepth() { return 8; }
 
	/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
 
	/* virtual */ void *MoveTo(const void *video, int x, int y);
 
	/* virtual */ void *MoveTo(void *video, int x, int y);
 
	/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
 
	/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
 
	/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
src/blitter/base.hpp
Show inline comments
 
@@ -87,7 +87,7 @@ public:
 
	 * @param y How much you want to scroll to the bottom.
 
	 * @return A new destination pointer moved the the requested place.
 
	 */
 
	virtual void *MoveTo(const void *video, int x, int y) = 0;
 
	virtual void *MoveTo(void *video, int x, int y) = 0;
 

	
 
	/**
 
	 * Draw a pixel with a given colour on the video-buffer.
src/blitter/null.hpp
Show inline comments
 
@@ -21,7 +21,7 @@ public:
 
	/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) {};
 
	/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) {};
 
	/* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
 
	/* virtual */ void *MoveTo(const void *video, int x, int y) { return NULL; };
 
	/* virtual */ void *MoveTo(void *video, int x, int y) { return NULL; };
 
	/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour) {};
 
	/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour) {};
 
	/* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width) {};
0 comments (0 inline, 0 general)