Changeset - r7321:b5b529587bb8
[Not reviewed]
master
0 9 0
rubidium - 17 years ago 2007-07-25 00:16:30
rubidium@openttd.org
(svn r10684) -Codechange: some more coding style related changes. Primarily moving { to a new line.
9 files changed with 49 insertions and 42 deletions:
0 comments (0 inline, 0 general)
src/bmp.cpp
Show inline comments
 
@@ -9,7 +9,8 @@
 
#include "macros.h"
 
#include "helpers.hpp"
 

	
 
void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file) {
 
void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file)
 
{
 
	buffer->pos      = -1;
 
	buffer->file     = file;
 
	buffer->read     = 0;
src/endian_check.cpp
Show inline comments
 
@@ -12,45 +12,41 @@
 
#include <stdio.h>
 
#include <string.h>
 

	
 
/** Main call of the endian_check program
 
/**
 
 * Main call of the endian_check program
 
 * @param argc argument count
 
 * @param argv arguments themselves
 
 * @return exit code */
 
int main (int argc, char *argv[]) {
 
	unsigned char EndianTest[2] = { 1, 0 };
 
 * @return exit code
 
 */
 
int main (int argc, char *argv[])
 
{
 
	unsigned char endian_test[2] = { 1, 0 };
 
	int force_BE = 0, force_LE = 0, force_PREPROCESSOR = 0;
 

	
 
	if (argc > 1 && strcmp(argv[1], "BE") == 0)
 
		force_BE = 1;
 
	if (argc > 1 && strcmp(argv[1], "LE") == 0)
 
		force_LE = 1;
 
	if (argc > 1 && strcmp(argv[1], "PREPROCESSOR") == 0)
 
		force_PREPROCESSOR = 1;
 
	if (argc > 1 && strcmp(argv[1], "BE") == 0) force_BE = 1;
 
	if (argc > 1 && strcmp(argv[1], "LE") == 0) force_LE = 1;
 
	if (argc > 1 && strcmp(argv[1], "PREPROCESSOR") == 0) force_PREPROCESSOR = 1;
 

	
 
	printf("#ifndef ENDIAN_H\n#define ENDIAN_H\n");
 

	
 
	if (force_LE == 1) {
 
		printf("#define TTD_LITTLE_ENDIAN\n");
 
	} else if (force_BE == 1) {
 
		printf("#define TTD_BIG_ENDIAN\n");
 
	} else if (force_PREPROCESSOR == 1) {
 
		/* Support for universal binaries on OSX
 
		 * Universal binaries supports both PPC and x86
 
		 * If a compiler for OSX gets this setting, it will always pick the correct endian and no test is needed
 
		 */
 
		printf("#ifdef __BIG_ENDIAN__\n");
 
		printf("#define TTD_BIG_ENDIAN\n");
 
		printf("#else\n");
 
		printf("#define TTD_LITTLE_ENDIAN\n");
 
		printf("#endif\n");
 
	} else if (*(short*)endian_test == 1 ) {
 
		printf("#define TTD_LITTLE_ENDIAN\n");
 
	} else {
 
		if (force_BE == 1) {
 
			printf("#define TTD_BIG_ENDIAN\n");
 
		} else {
 
			if (force_PREPROCESSOR == 1) {
 
				/** adding support for universal binaries on OSX
 
				 * Universal binaries supports both PPC and x86
 
				 * If a compiler for OSX gets this setting, it will always pick the correct endian and no test is needed */
 
				printf("#ifdef __BIG_ENDIAN__\n");
 
				printf("#define TTD_BIG_ENDIAN\n");
 
				printf("#else\n");
 
				printf("#define TTD_LITTLE_ENDIAN\n");
 
				printf("#endif\n");
 
			} else {
 
				if ( *(short *) EndianTest == 1 )
 
					printf("#define TTD_LITTLE_ENDIAN\n");
 
				else
 
					printf("#define TTD_BIG_ENDIAN\n");
 
			}
 
		}
 
		printf("#define TTD_BIG_ENDIAN\n");
 
	}
 
	printf("#endif\n");
 

	
src/misc_gui.cpp
Show inline comments
 
@@ -786,7 +786,8 @@ static void DrawStationCoverageText(cons
 
	DrawStringMultiLine(str_x, str_y, STR_SPEC_USERSTRING, 144);
 
}
 

	
 
void DrawStationCoverageAreaText(int sx, int sy, StationCoverageType sct, int rad) {
 
void DrawStationCoverageAreaText(int sx, int sy, StationCoverageType sct, int rad)
 
{
 
	TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y);
 
	AcceptedCargo accepts;
 
	if (tile < MapSize()) {
src/network/network_gui.cpp
Show inline comments
 
@@ -87,7 +87,8 @@ static const StringID _players_dropdown[
 

	
 
static StringID _language_dropdown[NETLANG_COUNT + 1] = {STR_NULL};
 

	
 
void SortNetworkLanguages() {
 
void SortNetworkLanguages()
 
{
 
	/* Init the strings */
 
	if (_language_dropdown[0] == STR_NULL) {
 
		for (int i = 0; i < NETLANG_COUNT; i++) _language_dropdown[i] = STR_NETWORK_LANG_ANY + i;
 
@@ -1133,7 +1134,8 @@ static void ClientList_None(byte client_
 

	
 

	
 
// Help, a action is clicked! What do we do?
 
static void HandleClientListPopupClick(byte index, byte clientno) {
 
static void HandleClientListPopupClick(byte index, byte clientno)
 
{
 
	// A click on the Popup of the ClientList.. handle the command
 
	if (index < MAX_CLIENTLIST_ACTION && _clientlist_proc[index] != NULL) {
 
		_clientlist_proc[index](clientno);
 
@@ -1166,7 +1168,8 @@ static bool CheckClientListHeight(Window
 
}
 

	
 
// Finds the amount of actions in the popup and set the height correct
 
static uint ClientListPopupHeigth() {
 
static uint ClientListPopupHeight()
 
{
 
	int i, num = 0;
 

	
 
	// Find the amount of actions
 
@@ -1236,7 +1239,7 @@ static Window *PopupClientList(Window *w
 
	}
 

	
 
	/* Calculate the height */
 
	h = ClientListPopupHeigth();
 
	h = ClientListPopupHeight();
 

	
 
	// Allocate the popup
 
	w = AllocateWindow(x, y, 150, h + 1, ClientListPopupWndProc, WC_TOOLBAR_MENU, _client_list_popup_widgets);
 
@@ -1486,7 +1489,7 @@ void ShowJoinStatusWindow()
 

	
 
static void SendChat(const char *buf, DestType type, int dest)
 
{
 
	if (buf[0] == '\0') return;
 
	if (StrEmpty(buf)) return;
 
	if (!_network_server) {
 
		SEND_COMMAND(PACKET_CLIENT_CHAT)((NetworkAction)(NETWORK_ACTION_CHAT + type), type, dest, buf);
 
	} else {
src/saveload.cpp
Show inline comments
 
@@ -270,7 +270,8 @@ static void SlWriteSimpleGamma(uint i)
 
}
 

	
 
/** Return how many bytes used to encode a gamma value */
 
static inline uint SlGetGammaLength(uint i) {
 
static inline uint SlGetGammaLength(uint i)
 
{
 
	return 1 + (i >= (1 << 7)) + (i >= (1 << 14)) + (i >= (1 << 21));
 
}
 

	
src/train_gui.cpp
Show inline comments
 
@@ -69,7 +69,8 @@ void CcCloneTrain(bool success, TileInde
 
 * @param len Length measured in 1/8ths of a standard wagon.
 
 * @return Number of pixels across.
 
 */
 
int WagonLengthToPixels(int len) {
 
int WagonLengthToPixels(int len)
 
{
 
	return (len * _traininfo_vehicle_width) / 8;
 
}
 

	
src/vehicle.cpp
Show inline comments
 
@@ -2480,7 +2480,8 @@ CommandCost CmdChangeServiceInt(TileInde
 

	
 
static Rect _old_vehicle_coords;
 

	
 
void BeginVehicleMove(Vehicle *v) {
 
void BeginVehicleMove(Vehicle *v)
 
{
 
	_old_vehicle_coords.left = v->left_coord;
 
	_old_vehicle_coords.top = v->top_coord;
 
	_old_vehicle_coords.right = v->right_coord;
src/viewport.cpp
Show inline comments
 
@@ -134,7 +134,8 @@ static Point MapXYZToViewport(const View
 
	return p;
 
}
 

	
 
void InitViewports() {
 
void InitViewports()
 
{
 
	memset(_viewports, 0, sizeof(_viewports));
 
	_active_viewports = 0;
 
}
src/win32.cpp
Show inline comments
 
@@ -110,7 +110,8 @@ struct DebugFileInfo {
 

	
 
static uint32 *_crc_table;
 

	
 
static void MakeCRCTable(uint32 *table) {
 
static void MakeCRCTable(uint32 *table)
 
{
 
	uint32 crc, poly = 0xEDB88320L;
 
	int i;
 
	int j;
 
@@ -126,7 +127,8 @@ static void MakeCRCTable(uint32 *table) 
 
	}
 
}
 

	
 
static uint32 CalcCRC(byte *data, uint size, uint32 crc) {
 
static uint32 CalcCRC(byte *data, uint size, uint32 crc)
 
{
 
	for (; size > 0; size--) {
 
		crc = ((crc >> 8) & 0x00FFFFFF) ^ _crc_table[(crc ^ *data++) & 0xFF];
 
	}
0 comments (0 inline, 0 general)