(svn r17692) -Codechange: minor coding style fixes

This commit is contained in:
smatz
2009-10-04 17:10:57 +00:00
parent cd3f93c8c6
commit 7c74afb1c3
12 changed files with 28 additions and 16 deletions

View File

@@ -178,7 +178,8 @@ public:
return item_current;
}
void End() {
void End()
{
this->bucket_list = NULL;
this->has_no_more_items = true;
this->item_next = 0;
@@ -286,7 +287,8 @@ public:
return item_current;
}
void Remove(int item) {
void Remove(int item)
{
if (!this->HasNext()) return;
/* If we remove the 'next' item, skip to the next */

View File

@@ -267,7 +267,8 @@ public:
* @note Example:
* list.Valuate(AIBridge.GetPrice, 5);
* list.Valuate(AIBridge.GetMaxLength);
* function MyVal(bridge_id, myparam) {
* function MyVal(bridge_id, myparam)
* {
* return myparam * bridge_id; // This is silly
* }
* list.Valuate(MyVal, 12);

View File

@@ -61,6 +61,7 @@ AIError::AIErrorMapString AIError::error_map_string = AIError::AIErrorMapString(
error_map_string[ai_error_msg] = message;
}
/* static */ AIError::ErrorCategories AIError::GetErrorCategory() {
/* static */ AIError::ErrorCategories AIError::GetErrorCategory()
{
return (AIError::ErrorCategories)(GetLastError() >> (uint)ERR_CAT_BIT_SIZE);
}

View File

@@ -28,7 +28,8 @@ void AIList::RemoveItem(int32 item)
AIAbstractList::RemoveItem(item);
}
SQInteger AIList::_set(HSQUIRRELVM vm) {
SQInteger AIList::_set(HSQUIRRELVM vm)
{
if (sq_gettype(vm, 2) != OT_INTEGER) return SQ_ERROR;
if (sq_gettype(vm, 3) != OT_INTEGER || sq_gettype(vm, 3) == OT_NULL) {
return sq_throwerror(vm, _SC("you can only assign integers to this list"));

View File

@@ -13,7 +13,8 @@
#
# Simple insertion sort.
function array_sort(ARRAY, ELEMENTS, temp, i, j) {
function array_sort(ARRAY, ELEMENTS, temp, i, j)
{
for (i = 2; i <= ELEMENTS; i++)
for (j = i; ARRAY[j - 1] > ARRAY[j]; --j) {
temp = ARRAY[j]
@@ -23,7 +24,8 @@ function array_sort(ARRAY, ELEMENTS, temp, i, j) {
return
}
function dump_class_templates(name) {
function dump_class_templates(name)
{
print " template <> " name " *GetParam(ForceType<" name " *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (" name " *)instance; }"
print " template <> " name " &GetParam(ForceType<" name " &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(" name " *)instance; }"
print " template <> const " name " *GetParam(ForceType<const " name " *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (" name " *)instance; }"