[Scummvm-cvs-logs] SF.net SVN: scummvm: [30305] tools/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Jan 6 15:23:09 CET 2008


Revision: 30305
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30305&view=rev
Author:   fingolfin
Date:     2008-01-06 06:23:09 -0800 (Sun, 06 Jan 2008)

Log Message:
-----------
Comply to our code formatting guidelines

Modified Paths:
--------------
    tools/trunk/descumm-common.cpp
    tools/trunk/descumm-tool.cpp
    tools/trunk/descumm.cpp
    tools/trunk/descumm6.cpp

Modified: tools/trunk/descumm-common.cpp
===================================================================
--- tools/trunk/descumm-common.cpp	2008-01-06 14:13:54 UTC (rev 30304)
+++ tools/trunk/descumm-common.cpp	2008-01-06 14:23:09 UTC (rev 30305)
@@ -44,24 +44,20 @@
 
 ///////////////////////////////////////////////////////////////////////////
 
-char *strecpy(char *buf, const char *src)
-{
+char *strecpy(char *buf, const char *src) {
 	strcpy(buf, src);
 	return strchr(buf, 0);
 }
 
-int get_curoffs()
-{
+int get_curoffs() {
 	return g_scriptCurPos - g_scriptStart;
 }
 
-int get_byte()
-{
+int get_byte() {
 	return (byte)(*g_scriptCurPos++);
 }
 
-int get_word()
-{
+int get_word() {
 	int i;
 
 	if (g_options.scriptVersion == 8) {
@@ -74,8 +70,7 @@
 	return i;
 }
 
-int get_dword()
-{
+int get_dword() {
 	int i;
 
 	i = (int32)READ_LE_UINT32(g_scriptCurPos);
@@ -117,8 +112,7 @@
 ///////////////////////////////////////////////////////////////////////////
 
 // Returns 0 or 1 depending if it's ok to add a block
-bool maybeAddIf(uint cur, uint to)
-{
+bool maybeAddIf(uint cur, uint to) {
 	Block p;
 	int i;
 	

Modified: tools/trunk/descumm-tool.cpp
===================================================================
--- tools/trunk/descumm-tool.cpp	2008-01-06 14:13:54 UTC (rev 30304)
+++ tools/trunk/descumm-tool.cpp	2008-01-06 14:23:09 UTC (rev 30305)
@@ -58,8 +58,7 @@
 	exit(0);
 }
 
-int skipVerbHeader_V12(byte *p)
-{
+int skipVerbHeader_V12(byte *p) {
 	byte code;
 	int offset = 15;
 	int minOffset = 255;
@@ -79,8 +78,7 @@
 	return minOffset;
 }
 
-int skipVerbHeader_V34(byte *p)
-{
+int skipVerbHeader_V34(byte *p) {
 	byte code;
 	int offset = g_options.GF_UNBLOCKED ? 17 : 19;
 	int minOffset = 255;
@@ -98,8 +96,7 @@
 	return minOffset;
 }
 
-int skipVerbHeader_V567(byte *p)
-{
+int skipVerbHeader_V567(byte *p) {
 	byte code;
 	int offset = 8;
 	int minOffset = 255;
@@ -117,8 +114,7 @@
 	return minOffset;
 }
 
-int skipVerbHeader_V8(byte *p)
-{
+int skipVerbHeader_V8(byte *p) {
 	uint32 *ptr;
 	uint32 code;
 	int offset;

Modified: tools/trunk/descumm.cpp
===================================================================
--- tools/trunk/descumm.cpp	2008-01-06 14:13:54 UTC (rev 30304)
+++ tools/trunk/descumm.cpp	2008-01-06 14:23:09 UTC (rev 30305)
@@ -436,8 +436,7 @@
 };
 
 
-const char *get_num_string(int i)
-{
+const char *get_num_string(int i) {
 	const char *s;
 
 	if (i & 0x8000) {							/* Bit var */
@@ -468,8 +467,7 @@
 }
 
 
-char *get_var(char *buf)
-{
+char *get_var(char *buf) {
 	int i;
 
 	if (g_options.scriptVersion <= 2)
@@ -521,8 +519,7 @@
 
 }
 
-char *get_var_or_word(char *buf, char condition)
-{
+char *get_var_or_word(char *buf, char condition) {
 	if (condition)
 		get_var(buf);
 	else
@@ -530,8 +527,7 @@
 	return strchr(buf, 0);
 }
 
-char *get_var_or_byte(char *buf, char condition)
-{
+char *get_var_or_byte(char *buf, char condition) {
 	if (condition)
 		get_var(buf);
 	else
@@ -539,8 +535,7 @@
 	return strchr(buf, 0);
 }
 
-char *get_list(char *buf)
-{
+char *get_list(char *buf) {
 	int i;
 	int j = 0;
 	bool first = true;
@@ -566,8 +561,7 @@
 	return strecpy(buf, "]");
 }
 
-char *putascii(char *buf, int i)
-{
+char *putascii(char *buf, int i) {
 	if (i > 31 && i < 128) {
 		buf[0] = i;
 		buf[1] = 0;
@@ -576,8 +570,7 @@
 	return buf + sprintf(buf, "^%d", i);
 }
 
-char *get_ascii(char *buf)
-{
+char *get_ascii(char *buf) {
 	int i;
 
 	buf = strecpy(buf, "\"");
@@ -607,8 +600,7 @@
 
 
 
-char *add_a_tok(char *buf, int type)
-{
+char *add_a_tok(char *buf, int type) {
 	switch (type) {
 	case TOK_BYTE:
 		buf += sprintf(buf, "%d", get_byte());
@@ -633,8 +625,7 @@
 	return buf;
 }
 
-char *do_tok(char *buf, const char *text, int args)
-{
+char *do_tok(char *buf, const char *text, int args) {
 	char *buforg = buf;
 
 
@@ -678,8 +669,7 @@
 	return strchr(buf, 0);
 }
 
-void do_decodeparsestring_v2(char *buf, byte opcode)
-{
+void do_decodeparsestring_v2(char *buf, byte opcode) {
 	byte c;
 	bool flag;
 
@@ -700,8 +690,7 @@
 	*buf = 0;
 }
 
-void do_actorops_v12(char *buf, byte opcode)
-{
+void do_actorops_v12(char *buf, byte opcode) {
 	buf = strecpy(buf, "ActorOps(");
 	buf = get_var_or_byte(buf, opcode & 0x80);
 	buf = strecpy(buf, ",[");
@@ -735,8 +724,7 @@
 	strecpy(buf, "]);");
 }
 
-void do_actorops(char *buf, byte opcode)
-{
+void do_actorops(char *buf, byte opcode) {
 	static const byte convertTable[20] =
 		{ 1, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20 };
 
@@ -868,8 +856,7 @@
 }
 
 
-void do_expr_code(char *buf)
-{
+void do_expr_code(char *buf) {
 	int i;
 	const char *s;
 	char *buf2;
@@ -936,8 +923,7 @@
 }
 
 
-void do_load_code_to_string(char *buf, byte opcode)
-{
+void do_load_code_to_string(char *buf, byte opcode) {
 
 	buf = strchr(strcpy(buf, "PutCodeInString("), 0);
 	buf = get_var_or_byte(buf, opcode & 0x80);
@@ -946,8 +932,7 @@
 	strcpy(buf, ");");
 }
 
-void do_resource_v2(char *buf, byte opcode)
-{
+void do_resource_v2(char *buf, byte opcode) {
 	const char *resTypes[] = {
 			"UnkResType0",
 			"UnkResType1",
@@ -984,8 +969,7 @@
 	}
 }
 
-void do_resource(char *buf, byte opco)
-{
+void do_resource(char *buf, byte opco) {
 	char opcode = get_byte();
 	int subop;
 	if (g_options.scriptVersion != 5)
@@ -1075,8 +1059,7 @@
 
 }
 
-void do_pseudoRoom(char *buf)
-{
+void do_pseudoRoom(char *buf) {
 	int j, i = get_byte();
 
 	buf += sprintf(buf, "PseudoRoom(%d", i);
@@ -1095,8 +1078,7 @@
 	strcpy(buf, ")");
 }
 
-void do_room_ops(char *buf)
-{
+void do_room_ops(char *buf) {
 	int opcode = get_byte();
 
 	//buf+=sprintf(buf, "SubCode33%.2X", opcode);
@@ -1196,8 +1178,7 @@
 	strcat(buf, ")");
 }
 
-void do_room_ops_old(char *buf, byte opcode)
-{
+void do_room_ops_old(char *buf, byte opcode) {
 	char	a[256];
 	char	b[256];
 	
@@ -1266,8 +1247,7 @@
 	}
 }
 
-void do_cursor_command(char *buf)
-{
+void do_cursor_command(char *buf) {
 	int opcode = get_byte();
 
 	switch (opcode & 0x1f) {
@@ -1322,8 +1302,7 @@
 	}
 }
 
-void do_verbops_v2(char *buf, byte opcode)
-{
+void do_verbops_v2(char *buf, byte opcode) {
 	int subop = get_byte();
 
 	buf = do_tok(buf, "VerbOps", ANOLASTPAREN);
@@ -1341,8 +1320,7 @@
 	strecpy(buf, ")");
 }
 
-void do_verbops(char *buf, byte opcode)
-{
+void do_verbops(char *buf, byte opcode) {
 	char first = 1;
 
 	buf = do_tok(buf, "VerbOps", ((opcode & 0x80) ? A1V : A1B) | ANOLASTPAREN);
@@ -1413,8 +1391,7 @@
 	strecpy(buf, "])");
 }
 
-void do_print_ego(char *buf, byte opcode)
-{
+void do_print_ego(char *buf, byte opcode) {
 	char first = 1;
 
 	if (opcode == 0xD8) {
@@ -1478,8 +1455,7 @@
 
 }
 
-void do_unconditional_jump(char *buf)
-{
+void do_unconditional_jump(char *buf) {
 	int offset = get_word();
 	int cur = get_curoffs();
 	int to = cur + offset;
@@ -1503,8 +1479,7 @@
 	}
 }
 
-void emit_if(char *buf, char *condition)
-{
+void emit_if(char *buf, char *condition) {
 	int offset = get_word();
 	int cur = get_curoffs();
 	int to = cur + offset;
@@ -1536,8 +1511,7 @@
 	sprintf(buf, ") goto %.4X;", to);
 }
 
-void do_if_code(char *buf, byte opcode)
-{
+void do_if_code(char *buf, byte opcode) {
 	char var[256];
 	char tmp[256], tmp2[256];
 	int txt;
@@ -1590,8 +1564,7 @@
 	emit_if(buf, tmp);
 }
 
-void do_if_active_object(char *buf, byte opcode)
-{
+void do_if_active_object(char *buf, byte opcode) {
 	char tmp[256];
 
 	int obj = get_byte();
@@ -1600,8 +1573,7 @@
 	emit_if(buf, tmp);
 }
 
-void do_if_state_code(char *buf, byte opcode)
-{
+void do_if_state_code(char *buf, byte opcode) {
 	char var[256];
 	char tmp[256], tmp2[256];
 	byte neg;
@@ -1724,8 +1696,7 @@
 	emit_if(buf, tmp);
 }
 
-void do_varset_code(char *buf, byte opcode)
-{
+void do_varset_code(char *buf, byte opcode) {
 	const char *s;
 
 	if ((g_options.scriptVersion <= 2)
@@ -1790,8 +1761,7 @@
 	strecpy(buf, ";");
 }
 
-void do_matrix_ops(char *buf, byte opcode)
-{
+void do_matrix_ops(char *buf, byte opcode) {
 	opcode = get_byte();
 
 	switch (opcode & 0x1F) {
@@ -1812,8 +1782,7 @@
 	}
 }
 
-void next_line_V12(char *buf)
-{
+void next_line_V12(char *buf) {
 	byte opcode = get_byte();
 
 	switch (opcode) {
@@ -2409,8 +2378,7 @@
 	}
 }
 
-void next_line_V0(char *buf)
-{
+void next_line_V0(char *buf) {
 	byte opcode = get_byte();
 
 	switch (opcode) {
@@ -2936,8 +2904,7 @@
 	}
 }
 
-void next_line_V345(char *buf)
-{
+void next_line_V345(char *buf) {
 	byte opcode = get_byte();
 
 	switch (opcode) {

Modified: tools/trunk/descumm6.cpp
===================================================================
--- tools/trunk/descumm6.cpp	2008-01-06 14:13:54 UTC (rev 30304)
+++ tools/trunk/descumm6.cpp	2008-01-06 14:23:09 UTC (rev 30305)
@@ -1097,8 +1097,7 @@
 	}
 }
 
-void doAssign(char *output, StackEnt * dst, StackEnt * src)
-{
+void doAssign(char *output, StackEnt * dst, StackEnt * src) {
 	if (src->type == seDup && dst->type == seDup) {
 		((DupStackEnt *)dst)->_idx = ((DupStackEnt *)src)->_idx;
 		return;
@@ -1114,8 +1113,7 @@
 	return dse;
 }
 
-void doAdd(char *output, StackEnt * se, int val)
-{
+void doAdd(char *output, StackEnt * se, int val) {
 	char *e = se_astext(se, output);
 	if (val == 1) {
 		sprintf(e, "++");
@@ -1131,36 +1129,31 @@
 	return se->dup(output);
 }
 
-void writeArray(char *output, int i, StackEnt * dim2, StackEnt * dim1, StackEnt * value)
-{
+void writeArray(char *output, int i, StackEnt * dim2, StackEnt * dim1, StackEnt * value) {
 	StackEnt *array = se_array(i, dim2, dim1);
 	doAssign(output, array, value);
 	delete array;
 }
 
-void writeVar(char *output, int i, StackEnt * value)
-{
+void writeVar(char *output, int i, StackEnt * value) {
 	StackEnt *se = se_var(i);
 	doAssign(output, se, value);
 	delete se;
 }
 
-void addArray(char *output, int i, StackEnt * dim1, int val)
-{
+void addArray(char *output, int i, StackEnt * dim1, int val) {
 	StackEnt *array = se_array(i, NULL, dim1);
 	doAdd(output, array, val);
 	delete array;
 }
 
-void addVar(char *output, int i, int val)
-{
+void addVar(char *output, int i, int val) {
 	StackEnt *se = se_var(i);
 	doAdd(output, se, val);
 	delete se;
 }
 
-StackEnt *se_get_string()
-{
+StackEnt *se_get_string() {
 	byte cmd;
 	char buf[1024];
 	char *e = buf;
@@ -1231,8 +1224,7 @@
 int _stringLength;
 byte _stringBuffer[4096];
 
-void getScriptString()
-{
+void getScriptString() {
 	byte chr;
 
 	while ((chr = get_byte()) != 0) {
@@ -1290,8 +1282,7 @@
 	return se_complex(buf);
 }
 
-void ext(char *output, const char *fmt)
-{
+void ext(char *output, const char *fmt) {
 	bool wantresult;
 	byte cmd, extcmd;
 	const char *extstr = NULL;
@@ -1413,8 +1404,7 @@
 	}
 }
 
-void jump(char *output)
-{
+void jump(char *output) {
 	int offset = get_word();
 	int cur = get_curoffs();
 	int to = cur + offset;
@@ -1447,8 +1437,7 @@
 	}
 }
 
-void jumpif(char *output, StackEnt * se, bool negate)
-{
+void jumpif(char *output, StackEnt * se, bool negate) {
 	int offset = get_word();
 	int cur = get_curoffs();
 	int to = cur + offset;
@@ -1500,8 +1489,7 @@
 				);                \
 	} while(0)
 
-void next_line_HE_V72(char *output)
-{
+void next_line_HE_V72(char *output) {
 	byte code = get_byte();
 	StackEnt *se_a, *se_b;
 
@@ -2758,8 +2746,7 @@
 	} while(0)
 
 
-void next_line_V8(char *output)
-{
+void next_line_V8(char *output) {
 	byte code = get_byte();
 	StackEnt *se_a, *se_b;
 
@@ -3406,8 +3393,7 @@
 				);                \
 	} while(0)
 
-void next_line_V67(char *output)
-{
+void next_line_V67(char *output) {
 	byte code = get_byte();
 	StackEnt *se_a, *se_b;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list