Changeset - r2953:a59e10678800
[Not reviewed]
master
0 5 0
peter1138 - 18 years ago 2006-02-01 09:08:25
peter1138@openttd.org
(svn r3512) Yet more whitespace fixes (mostly by Rubidium)
5 files changed with 26 insertions and 27 deletions:
0 comments (0 inline, 0 general)
os/macosx/splash.c
Show inline comments
 
@@ -84,38 +84,36 @@ void DisplaySplashImage(void)
 

	
 
	width            = png_get_image_width(png_ptr, info_ptr);
 
	height           = png_get_image_height(png_ptr, info_ptr);
 
	bit_depth        = png_get_bit_depth(png_ptr, info_ptr);
 
	color_type       = png_get_color_type(png_ptr, info_ptr);
 

	
 
	if(color_type != PNG_COLOR_TYPE_PALETTE || bit_depth != 8) {
 
	if (color_type != PNG_COLOR_TYPE_PALETTE || bit_depth != 8) {
 
		png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
 
		fclose(f);
 
		return;
 
	}
 

	
 
	if(!png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE)) {
 
	if (!png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE)) {
 
		png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
 
		fclose(f);
 
		return;
 
	}
 

	
 
	png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette);
 

	
 
	row_pointers = png_get_rows(png_ptr, info_ptr);
 

	
 
	memset(_screen.dst_ptr, 0xff, _screen.pitch * _screen.height);
 

	
 
	if(width > (uint) _screen.width)
 
		width = _screen.width;
 
	if(height > (uint) _screen.height)
 
		height = _screen.height;
 
	if (width > (uint) _screen.width) width = _screen.width;
 
	if (height > (uint) _screen.height) height = _screen.height;
 

	
 
	xoff = (_screen.width - width) / 2;
 
	yoff = (_screen.height - height) / 2;
 
	for(y = 0; y < height; y++) {
 
	for (y = 0; y < height; y++) {
 
		src = row_pointers[y];
 
		dst = ((uint8 *) _screen.dst_ptr) + (yoff + y) * _screen.pitch + xoff;
 

	
 
		memcpy(dst, src, width);
 
	}
 

	
queue.c
Show inline comments
 
@@ -179,13 +179,13 @@ static bool InsSort_Push(Queue* q, void*
 
	newnode->priority = priority;
 
	if (q->data.inssort.first == NULL || q->data.inssort.first->priority >= priority) {
 
		newnode->next = q->data.inssort.first;
 
		q->data.inssort.first = newnode;
 
	} else {
 
		InsSortNode* node = q->data.inssort.first;
 
		while( node != NULL ) {
 
		while (node != NULL) {
 
			if (node->next == NULL || node->next->priority >= priority) {
 
				newnode->next = node->next;
 
				node->next = newnode;
 
				break;
 
			}
 
			node = node->next;
roadveh_cmd.c
Show inline comments
 
@@ -941,13 +941,13 @@ static int PickRandomBit(uint bits)
 
	do {
 
		if (b & 1) num++;
 
	} while (b >>= 1);
 

	
 
	num = RandomRange(num);
 

	
 
	for(i=0; !((bits & 1) && ((int)--num) < 0); bits>>=1,i++);
 
	for (i = 0; !((bits & 1) && ((int)--num) < 0); bits >> = 1, i++);
 
	return i;
 
}
 

	
 
typedef struct {
 
	TileIndex dest;
 
	uint maxtracklen;
settings.c
Show inline comments
 
@@ -127,16 +127,17 @@ static IniFile *ini_alloc(void)
 
// allocate an ini group object
 
static IniGroup *ini_group_alloc(IniFile *ini, const char *grpt, int len)
 
{
 
	IniGroup *grp = pool_alloc(&ini->pool, sizeof(IniGroup));
 
	grp->ini = ini;
 
	grp->name = pool_strdup(&ini->pool, grpt, len);
 
	if(!strcmp(grp->name, "newgrf") || !strcmp(grp->name, "servers") || !strcmp(grp->name, "bans") )
 
	if (!strcmp(grp->name, "newgrf") || !strcmp(grp->name, "servers") || !strcmp(grp->name, "bans")) {
 
		grp->type = IGT_LIST;
 
	else
 
	} else {
 
		grp->type = IGT_VARIABLES;
 
	}
 
	grp->next = NULL;
 
	grp->item = NULL;
 
	grp->comment = NULL;
 
	grp->last_item = &grp->item;
 
	*ini->last_group = grp;
 
	ini->last_group = &grp->next;
sound/cocoa_s.c
Show inline comments
 
/* $Id$ */
 

	
 
/******************************************************************************************
 
 *                             Cocoa sound driver                                         *
 
 * Known things left to do:                                                               *
 
 * - Might need to do endian checking for it to work on both ppc and x86                  *
 
 ******************************************************************************************/
 
/*****************************************************************************
 
 *                             Cocoa sound driver                            *
 
 * Known things left to do:                                                  *
 
 * - Might need to do endian checking for it to work on both ppc and x86     *
 
 *****************************************************************************/
 

	
 
#ifdef WITH_COCOA
 

	
 
#include <AudioUnit/AudioUnit.h>
 

	
 
/* Name conflict */
 
#define Rect		OTTDRect
 
#define Point		OTTDPoint
 
#define WindowClass	OTTDWindowClass
 
#define Rect        OTTDRect
 
#define Point       OTTDPoint
 
#define WindowClass OTTDWindowClass
 
/* Defined in stdbool.h */
 
#ifndef __cplusplus
 
# ifndef __BEOS__
 
#  undef bool
 
#  undef false
 
#  undef true
 
@@ -37,13 +37,13 @@
 
#undef Rect
 

	
 

	
 
static AudioUnit _outputAudioUnit;
 

	
 
/* The CoreAudio callback */
 
static OSStatus audioCallback (void *inRefCon,  AudioUnitRenderActionFlags inActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, AudioBuffer *ioData)
 
static OSStatus audioCallback(void *inRefCon, AudioUnitRenderActionFlags inActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, AudioBuffer *ioData)
 
{
 
	MxMixSamples(_mixer, ioData->mData, ioData->mDataByteSize / 4);
 

	
 
	return noErr;
 
}
 

	
 
@@ -84,30 +84,30 @@ static const char *CocoaSoundStart(const
 

	
 
	comp = FindNextComponent (NULL, &desc);
 
	if (comp == NULL)
 
		return "cocoa_s: Failed to start CoreAudio: FindNextComponent returned NULL";
 

	
 
	/* Open & initialize the default output audio unit */
 
	if(OpenAComponent(comp, &_outputAudioUnit) != noErr)
 
	if (OpenAComponent(comp, &_outputAudioUnit) != noErr)
 
		return "cocoa_s: Failed to start CoreAudio: OpenAComponent";
 

	
 
	if(AudioUnitInitialize(_outputAudioUnit) != noErr)
 
	if (AudioUnitInitialize(_outputAudioUnit) != noErr)
 
		return "cocoa_s: Failed to start CoreAudio: AudioUnitInitialize";
 

	
 
	/* Set the input format of the audio unit. */
 
	if(AudioUnitSetProperty(_outputAudioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &requestedDesc, sizeof (requestedDesc)) != noErr)
 
		return "cocoa_s: Failed to start CoreAudio:  AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)";
 
	if (AudioUnitSetProperty(_outputAudioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &requestedDesc, sizeof(requestedDesc)) != noErr)
 
		return "cocoa_s: Failed to start CoreAudio: AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)";
 

	
 
	/* Set the audio callback */
 
	callback.inputProc = audioCallback;
 
	callback.inputProcRefCon = NULL;
 
	if(AudioUnitSetProperty(_outputAudioUnit,  kAudioUnitProperty_SetInputCallback,  kAudioUnitScope_Input,  0, &callback,  sizeof(callback)) != noErr)
 
	if (AudioUnitSetProperty(_outputAudioUnit, kAudioUnitProperty_SetInputCallback, kAudioUnitScope_Input, 0, &callback, sizeof(callback)) != noErr)
 
		return "cocoa_s: Failed to start CoreAudio: AudioUnitSetProperty (kAudioUnitProperty_SetInputCallback)";
 

	
 
	/* Finally, start processing of the audio unit */
 
	if(AudioOutputUnitStart (_outputAudioUnit) != noErr)
 
	if (AudioOutputUnitStart(_outputAudioUnit) != noErr)
 
		return "cocoa_s: Failed to start CoreAudio: AudioOutputUnitStart";
 

	
 
	/* We're running! */
 
	return NULL;
 
}
 

	
 
@@ -124,13 +124,13 @@ static void CocoaSoundStop(void)
 
		return;
 
	}
 

	
 
	/* Remove the input callback */
 
	callback.inputProc = 0;
 
	callback.inputProcRefCon = 0;
 
	if(AudioUnitSetProperty(_outputAudioUnit, kAudioUnitProperty_SetInputCallback, kAudioUnitScope_Input, 0, &callback, sizeof(callback)) != noErr) {
 
	if (AudioUnitSetProperty(_outputAudioUnit, kAudioUnitProperty_SetInputCallback, kAudioUnitScope_Input, 0, &callback, sizeof(callback)) != noErr) {
 
		DEBUG(driver, 1)("cocoa_s: Core_CloseAudio: AudioUnitSetProperty (kAudioUnitProperty_SetInputCallback) failed");
 
		return;
 
	}
 

	
 
	if (CloseComponent(_outputAudioUnit) != noErr) {
 
		DEBUG(driver, 1)("cocoa_s: Core_CloseAudio: CloseComponent failed");
0 comments (0 inline, 0 general)