Changeset - r20676:1eee2eea40ab
[Not reviewed]
master
0 6 0
fonsinchen - 11 years ago 2013-08-10 12:47:24
fonsinchen@openttd.org
(svn r25714) -Fix: explicitly cast some things to silence warnings on GCC 4.0
6 files changed with 15 insertions and 15 deletions:
0 comments (0 inline, 0 general)
src/gfx.cpp
Show inline comments
 
@@ -434,15 +434,15 @@ static int DrawLayoutLine(ParagraphLayou
 
		for (int i = 0; i < run->getGlyphCount(); i++) {
 
			GlyphID glyph = run->getGlyphs()[i];
 

	
 
			/* Not a valid glyph (empty) */
 
			if (glyph == 0xFFFF) continue;
 

	
 
			int begin_x = run->getPositions()[i * 2]     + left - offset_x;
 
			int end_x   = run->getPositions()[i * 2 + 2] + left - offset_x  - 1;
 
			int top     = run->getPositions()[i * 2 + 1] + y;
 
			int begin_x = (int)run->getPositions()[i * 2]     + left - offset_x;
 
			int end_x   = (int)run->getPositions()[i * 2 + 2] + left - offset_x  - 1;
 
			int top     = (int)run->getPositions()[i * 2 + 1] + y;
 

	
 
			/* Truncated away. */
 
			if (truncation && (begin_x < min_x || end_x > max_x)) continue;
 

	
 
			const Sprite *sprite = fc->GetGlyph(glyph);
 
			/* Check clipping (the "+ 1" is for the shadow). */
src/gfx_layout.cpp
Show inline comments
 
@@ -259,13 +259,13 @@ int ParagraphLayout::Line::getWidth() co
 
	/*
 
	 * The last X position of a run contains is the end of that run.
 
	 * Since there is no left-to-right support, taking this value of
 
	 * the last run gives us the end of the line and thus the width.
 
	 */
 
	const VisualRun *run = this->getVisualRun(this->countRuns() - 1);
 
	return run->getPositions()[run->getGlyphCount() * 2];
 
	return (int)run->getPositions()[run->getGlyphCount() * 2];
 
}
 

	
 
/**
 
 * Get the number of runs in this line.
 
 * @return The number of runs.
 
 */
 
@@ -590,14 +590,14 @@ const char *Layouter::GetCharAtPosition(
 
		const ParagraphLayout::VisualRun *run = line->getVisualRun(run_index);
 

	
 
		for (int i = 0; i < run->getGlyphCount(); i++) {
 
			/* Not a valid glyph (empty). */
 
			if (run->getGlyphs()[i] == 0xFFFF) continue;
 

	
 
			int begin_x = run->getPositions()[i * 2];
 
			int end_x   = run->getPositions()[i * 2 + 2];
 
			int begin_x = (int)run->getPositions()[i * 2];
 
			int end_x   = (int)run->getPositions()[i * 2 + 2];
 

	
 
			if (IsInsideMM(x, begin_x, end_x)) {
 
				/* Found our glyph, now convert to UTF-8 string index. */
 
				size_t index = run->getGlyphToCharMap()[i];
 

	
 
				size_t cur_idx = 0;
src/industry_gui.cpp
Show inline comments
 
@@ -2580,13 +2580,13 @@ struct IndustryCargoesWindow : public Wi
 
					lst->push_back(new DropDownListStringItem(cs->name, cs->Index(), false));
 
				}
 
				if (lst->size() == 0) {
 
					delete lst;
 
					break;
 
				}
 
				int selected = (this->ind_cargo >= NUM_INDUSTRYTYPES) ? this->ind_cargo - NUM_INDUSTRYTYPES : -1;
 
				int selected = (this->ind_cargo >= NUM_INDUSTRYTYPES) ? (int)(this->ind_cargo - NUM_INDUSTRYTYPES) : -1;
 
				ShowDropDownList(this, lst, selected, WID_IC_CARGO_DROPDOWN, 0, true);
 
				break;
 
			}
 

	
 
			case WID_IC_IND_DROPDOWN: {
 
				DropDownList *lst = new DropDownList;
 
@@ -2597,13 +2597,13 @@ struct IndustryCargoesWindow : public Wi
 
					lst->push_back(new DropDownListStringItem(indsp->name, ind, false));
 
				}
 
				if (lst->size() == 0) {
 
					delete lst;
 
					break;
 
				}
 
				int selected = (this->ind_cargo < NUM_INDUSTRYTYPES) ? this->ind_cargo : -1;
 
				int selected = (this->ind_cargo < NUM_INDUSTRYTYPES) ? (int)this->ind_cargo : -1;
 
				ShowDropDownList(this, lst, selected, WID_IC_IND_DROPDOWN, 0, true);
 
				break;
 
			}
 
		}
 
	}
 

	
src/sound/cocoa_s.cpp
Show inline comments
 
@@ -64,13 +64,13 @@ const char *SoundDriver_Cocoa::Start(con
 
#endif /* TTD_ENDIAN == TTD_BIG_ENDIAN */
 

	
 
	requestedDesc.mFramesPerPacket = 1;
 
	requestedDesc.mBytesPerFrame = requestedDesc.mBitsPerChannel * requestedDesc.mChannelsPerFrame / 8;
 
	requestedDesc.mBytesPerPacket = requestedDesc.mBytesPerFrame * requestedDesc.mFramesPerPacket;
 

	
 
	MxInitialize(requestedDesc.mSampleRate);
 
	MxInitialize((uint)requestedDesc.mSampleRate);
 

	
 
	/* Locate the default output audio unit */
 
	desc.componentType = kAudioUnitType_Output;
 
	desc.componentSubType = kAudioUnitSubType_HALOutput;
 
	desc.componentManufacturer = kAudioUnitManufacturer_Apple;
 
	desc.componentFlags = 0;
src/video/cocoa/cocoa_v.mm
Show inline comments
 
@@ -958,13 +958,13 @@ static const char *Utf8AdvanceByUtf16Uni
 
- (NSUInteger)characterIndexForPoint:(NSPoint)thePoint
 
{
 
	if (!EditBoxInGlobalFocus()) return NSNotFound;
 

	
 
	NSPoint view_pt = [ self convertPoint:[ [ self window ] convertScreenToBase:thePoint ] fromView:nil ];
 

	
 
	Point pt = { view_pt.x, [ self frame ].size.height - view_pt.y };
 
	Point pt = { (int)view_pt.x, (int)[ self frame ].size.height - (int)view_pt.y };
 

	
 
	const char *ch = _focused_window->GetTextCharacterAtPosition(pt);
 
	if (ch == NULL) return NSNotFound;
 

	
 
	return CountUtf16Units(_focused_window->GetFocusedText(), ch);
 
}
src/video/cocoa/wnd_quartz.mm
Show inline comments
 
@@ -148,13 +148,13 @@ static CGColorSpaceRef QZ_GetCorrectColo
 
	/* We need an Image in order to do blitting, but as we don't touch the context between this call and drawing no copying will actually be done here */
 
	CGImageRef fullImage = CGBitmapContextCreateImage(driver->cgcontext);
 

	
 
	/* Calculate total area we are blitting */
 
	uint32 blitArea = 0;
 
	for (int n = 0; n < dirtyRectCount; n++) {
 
		blitArea += dirtyRects[n].size.width * dirtyRects[n].size.height;
 
		blitArea += (uint32)(dirtyRects[n].size.width * dirtyRects[n].size.height);
 
	}
 

	
 
	/*
 
	 * This might be completely stupid, but in my extremely subjective opinion it feels faster
 
	 * The point is, if we're blitting less than 50% of the dirty rect union then it's still a good idea to blit each dirty
 
	 * rect separately but if we blit more than that, it's just cheaper to blit the entire union in one pass.
 
@@ -332,16 +332,16 @@ bool WindowQuartzSubdriver::SetVideoMode
 
		[ this->window setDelegate:[ delegate autorelease ] ];
 
	} else {
 
		/* We already have a window, just change its size */
 
		[ this->window setContentSize:contentRect.size ];
 

	
 
		/* Ensure frame height - title bar height >= view height */
 
		contentRect.size.height = Clamp(height, 0, [ this->window frame ].size.height - 22 /* 22 is the height of title bar of window*/);
 
		contentRect.size.height = Clamp(height, 0, (int)[ this->window frame ].size.height - 22 /* 22 is the height of title bar of window*/);
 

	
 
		if (this->cocoaview != nil) {
 
			height = contentRect.size.height;
 
			height = (int)contentRect.size.height;
 
			[ this->cocoaview setFrameSize:contentRect.size ];
 
		}
 
	}
 

	
 
	this->window_width = width;
 
	this->window_height = height;
 
@@ -566,14 +566,14 @@ void WindowQuartzSubdriver::SetPortAlpha
 
bool WindowQuartzSubdriver::WindowResized()
 
{
 
	if (this->window == nil || this->cocoaview == nil) return true;
 

	
 
	NSRect newframe = [ this->cocoaview frame ];
 

	
 
	this->window_width = newframe.size.width;
 
	this->window_height = newframe.size.height;
 
	this->window_width = (int)newframe.size.width;
 
	this->window_height = (int)newframe.size.height;
 

	
 
	/* Create Core Graphics Context */
 
	free(this->window_buffer);
 
	this->window_buffer = (uint32*)malloc(this->window_width * this->window_height * 4);
 

	
 
	CGContextRelease(this->cgcontext);
0 comments (0 inline, 0 general)