diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-11-16 08:21:13 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-11-16 08:21:13 +0000 |
commit | f907a78441c0540ba16a1bda82c883bb1eca237a (patch) | |
tree | ff0ab67c68b95e0820bbc19419492b01a92e91a7 /src/modules/database/dblists.cpp | |
parent | 58b6deafb08a2213936df9ab71ae69f28f62e41d (diff) |
tabs and spaces cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@2326 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/database/dblists.cpp')
-rw-r--r-- | src/modules/database/dblists.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/modules/database/dblists.cpp b/src/modules/database/dblists.cpp index bd1d352641..91b657eab3 100644 --- a/src/modules/database/dblists.cpp +++ b/src/modules/database/dblists.cpp @@ -52,7 +52,7 @@ void List_Destroy(SortedList* p_list) void* List_Find(SortedList* p_list, void* p_value)
{
int index;
-
+
if ( !List_GetIndex(p_list, p_value, &index))
return(NULL);
@@ -84,11 +84,11 @@ int List_GetIndex(SortedList* p_list, void* p_value, int* p_index) int high = p_list->realCount - 1;
while (low <= high)
- {
+ {
int i = (low + high) / 2;
unsigned __int64 vali = *(unsigned __int64 *)p_list->items[i];
if (vali == val)
- {
+ {
*p_index = i;
return 1;
}
@@ -111,11 +111,11 @@ int List_GetIndex(SortedList* p_list, void* p_value, int* p_index) int high = p_list->realCount - 1;
while (low <= high)
- {
+ {
int i = (low + high) / 2;
unsigned vali = *(unsigned *)p_list->items[i];
if (vali == val)
- {
+ {
*p_index = i;
return 1;
}
@@ -136,11 +136,11 @@ int List_GetIndex(SortedList* p_list, void* p_value, int* p_index) int high = p_list->realCount - 1;
while (low <= high)
- {
+ {
int i = (low + high) / 2;
const void* vali = p_list->items[i];
if (vali == p_value)
- {
+ {
*p_index = i;
return 1;
}
@@ -161,11 +161,11 @@ int List_GetIndex(SortedList* p_list, void* p_value, int* p_index) int high = p_list->realCount - 1;
while (low <= high)
- {
+ {
int i = (low + high) / 2;
int result = p_list->sortFunc(p_list->items[i], p_value);
if (result == 0)
- {
+ {
*p_index = i;
return 1;
}
@@ -206,7 +206,7 @@ int List_Insert(SortedList* p_list, void* p_value, int p_index) if (p_value == NULL || p_index > p_list->realCount)
return 0;
- if (p_list->realCount == p_list->limit)
+ if (p_list->realCount == p_list->limit)
{
p_list->items = (void**)mir_realloc(p_list->items, sizeof(void*)*(p_list->realCount + p_list->increment));
p_list->limit += p_list->increment;
@@ -215,10 +215,10 @@ int List_Insert(SortedList* p_list, void* p_value, int p_index) if (p_index < p_list->realCount)
memmove(p_list->items+p_index+1, p_list->items+p_index, sizeof(void*)*(p_list->realCount-p_index));
- p_list->realCount++;
+ p_list->realCount++;
- p_list->items[ p_index ] = p_value;
- return 1;
+ p_list->items[ p_index ] = p_value;
+ return 1;
}
int List_InsertPtr(SortedList* list, void* p)
@@ -236,14 +236,14 @@ int List_Remove(SortedList* p_list, int index) if (index < 0 || index > p_list->realCount)
return(0);
- p_list->realCount--;
- if (p_list->realCount > index)
+ p_list->realCount--;
+ if (p_list->realCount > index)
{
memmove(p_list->items+index, p_list->items+index+1, sizeof(void*)*(p_list->realCount-index));
- p_list->items[ p_list->realCount ] = NULL;
+ p_list->items[ p_list->realCount ] = NULL;
}
- return 1;
+ return 1;
}
int List_RemovePtr(SortedList* list, void* p)
@@ -275,4 +275,5 @@ void List_ObjCopy(SortedList* s, SortedList* d, size_t itemSize) void* item = new char[ itemSize ];
memcpy(item, s->items[i], itemSize);
List_Insert(d, item, i);
-} }
+ }
+}
|