mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 09:50:07 +00:00
[CDMAKE]: Whitespace and tabs fixes only. Next time you open your editor for coding ROS...: PLEASE, OH PLEASE!!! USE: 4-space indentation (NO TABS!!) and NO K&R coding style!!!!! (we *already* have a fixed code style in ROS).
svn path=/trunk/; revision=66049
This commit is contained in:
parent
67619ff9c8
commit
147616c9fc
File diff suppressed because it is too large
Load diff
|
@ -83,17 +83,25 @@ void normalize_dirname(char *filename)
|
|||
int i, tgt;
|
||||
int slash = 1;
|
||||
|
||||
for (i = 0, tgt = 0; filename[i]; i++) {
|
||||
if (slash) {
|
||||
if (filename[i] != '/' && filename[i] != '\\') {
|
||||
for (i = 0, tgt = 0; filename[i]; i++)
|
||||
{
|
||||
if (slash)
|
||||
{
|
||||
if (filename[i] != '/' && filename[i] != '\\')
|
||||
{
|
||||
filename[tgt++] = toupper(filename[i]);
|
||||
slash = 0;
|
||||
}
|
||||
} else {
|
||||
if (filename[i] == '/' || filename[i] == '\\') {
|
||||
}
|
||||
else
|
||||
{
|
||||
if (filename[i] == '/' || filename[i] == '\\')
|
||||
{
|
||||
slash = 1;
|
||||
filename[tgt++] = DIR_SEPARATOR_CHAR;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
filename[tgt++] = toupper(filename[i]);
|
||||
}
|
||||
}
|
||||
|
@ -160,7 +168,7 @@ void dir_hash_add_file(struct target_dir_hash *dh, const char *source, const cha
|
|||
tf->target_name = strdup(filename);
|
||||
}
|
||||
|
||||
struct target_dir_entry *
|
||||
static struct target_dir_entry *
|
||||
dir_hash_next_dir(struct target_dir_hash *dh, struct target_dir_traversal *t)
|
||||
{
|
||||
if (t->i == -1)
|
||||
|
|
|
@ -3,13 +3,15 @@
|
|||
|
||||
#define NUM_DIR_HASH_BUCKETS 1024
|
||||
|
||||
struct target_file {
|
||||
struct target_file
|
||||
{
|
||||
struct target_file *next;
|
||||
char *source_name;
|
||||
char *target_name;
|
||||
};
|
||||
|
||||
struct target_dir_entry {
|
||||
struct target_dir_entry
|
||||
{
|
||||
struct target_dir_entry *next;
|
||||
struct target_dir_entry *parent;
|
||||
struct target_dir_entry *child;
|
||||
|
@ -18,12 +20,14 @@ struct target_dir_entry {
|
|||
char *case_name;
|
||||
};
|
||||
|
||||
struct target_dir_hash {
|
||||
struct target_dir_hash
|
||||
{
|
||||
struct target_dir_entry *buckets[NUM_DIR_HASH_BUCKETS];
|
||||
struct target_dir_entry root;
|
||||
};
|
||||
|
||||
struct target_dir_traversal {
|
||||
struct target_dir_traversal
|
||||
{
|
||||
struct target_dir_entry *it;
|
||||
int i;
|
||||
};
|
||||
|
@ -32,7 +36,6 @@ void normalize_dirname(char *filename);
|
|||
void dir_hash_add_file(struct target_dir_hash *dh, const char *source, const char *target);
|
||||
struct target_dir_entry *
|
||||
dir_hash_create_dir(struct target_dir_hash *dh, const char *casename, const char *targetnorm);
|
||||
struct target_dir_entry *dir_hash_next_dir(struct target_dir_hash *dh, struct target_dir_traversal *t);
|
||||
void dir_hash_destroy(struct target_dir_hash *dh);
|
||||
|
||||
#endif //_REACTOS_TOOLS_CDMAKE_DIRHASH_H_
|
||||
|
|
|
@ -11,95 +11,95 @@
|
|||
|
||||
void *sort_linked_list(void *p, unsigned index, int (*compare)(void *, void *))
|
||||
{
|
||||
unsigned base;
|
||||
unsigned long block_size;
|
||||
unsigned base;
|
||||
unsigned long block_size;
|
||||
|
||||
struct record
|
||||
{
|
||||
struct record *next[1];
|
||||
/* other members not directly accessed by this function */
|
||||
};
|
||||
|
||||
struct tape
|
||||
{
|
||||
struct record *first, *last;
|
||||
unsigned long count;
|
||||
} tape[4];
|
||||
|
||||
/* Distribute the records alternately to tape[0] and tape[1]. */
|
||||
|
||||
tape[0].count = tape[1].count = 0L;
|
||||
tape[0].first = NULL;
|
||||
base = 0;
|
||||
while (p != NULL)
|
||||
{
|
||||
struct record *next = ((struct record *)p)->next[index];
|
||||
((struct record *)p)->next[index] = tape[base].first;
|
||||
tape[base].first = ((struct record *)p);
|
||||
tape[base].count++;
|
||||
p = next;
|
||||
base ^= 1;
|
||||
}
|
||||
|
||||
/* If the list is empty or contains only a single record, then */
|
||||
/* tape[1].count == 0L and this part is vacuous. */
|
||||
|
||||
for (base = 0, block_size = 1L; tape[base+1].count != 0L;
|
||||
base ^= 2, block_size <<= 1)
|
||||
{
|
||||
int dest;
|
||||
struct tape *tape0, *tape1;
|
||||
tape0 = tape + base;
|
||||
tape1 = tape + base + 1;
|
||||
dest = base ^ 2;
|
||||
tape[dest].count = tape[dest+1].count = 0;
|
||||
for (; tape0->count != 0; dest ^= 1)
|
||||
struct record
|
||||
{
|
||||
unsigned long n0, n1;
|
||||
struct tape *output_tape = tape + dest;
|
||||
n0 = n1 = block_size;
|
||||
while (1)
|
||||
{
|
||||
struct record *chosen_record;
|
||||
struct tape *chosen_tape;
|
||||
if (n0 == 0 || tape0->count == 0)
|
||||
{
|
||||
if (n1 == 0 || tape1->count == 0)
|
||||
break;
|
||||
chosen_tape = tape1;
|
||||
n1--;
|
||||
}
|
||||
else if (n1 == 0 || tape1->count == 0)
|
||||
{
|
||||
chosen_tape = tape0;
|
||||
n0--;
|
||||
}
|
||||
else if ((*compare)(tape0->first, tape1->first) > 0)
|
||||
{
|
||||
chosen_tape = tape1;
|
||||
n1--;
|
||||
}
|
||||
else
|
||||
{
|
||||
chosen_tape = tape0;
|
||||
n0--;
|
||||
}
|
||||
chosen_tape->count--;
|
||||
chosen_record = chosen_tape->first;
|
||||
chosen_tape->first = chosen_record->next[index];
|
||||
if (output_tape->count == 0)
|
||||
output_tape->first = chosen_record;
|
||||
else
|
||||
output_tape->last->next[index] = chosen_record;
|
||||
output_tape->last = chosen_record;
|
||||
output_tape->count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
struct record *next[1];
|
||||
/* other members not directly accessed by this function */
|
||||
};
|
||||
|
||||
if (tape[base].count > 1L)
|
||||
tape[base].last->next[index] = NULL;
|
||||
return tape[base].first;
|
||||
struct tape
|
||||
{
|
||||
struct record *first, *last;
|
||||
unsigned long count;
|
||||
} tape[4];
|
||||
|
||||
/* Distribute the records alternately to tape[0] and tape[1]. */
|
||||
|
||||
tape[0].count = tape[1].count = 0L;
|
||||
tape[0].first = NULL;
|
||||
base = 0;
|
||||
while (p != NULL)
|
||||
{
|
||||
struct record *next = ((struct record *)p)->next[index];
|
||||
((struct record *)p)->next[index] = tape[base].first;
|
||||
tape[base].first = ((struct record *)p);
|
||||
tape[base].count++;
|
||||
p = next;
|
||||
base ^= 1;
|
||||
}
|
||||
|
||||
/* If the list is empty or contains only a single record, then */
|
||||
/* tape[1].count == 0L and this part is vacuous. */
|
||||
|
||||
for (base = 0, block_size = 1L; tape[base+1].count != 0L;
|
||||
base ^= 2, block_size <<= 1)
|
||||
{
|
||||
int dest;
|
||||
struct tape *tape0, *tape1;
|
||||
tape0 = tape + base;
|
||||
tape1 = tape + base + 1;
|
||||
dest = base ^ 2;
|
||||
tape[dest].count = tape[dest+1].count = 0;
|
||||
for (; tape0->count != 0; dest ^= 1)
|
||||
{
|
||||
unsigned long n0, n1;
|
||||
struct tape *output_tape = tape + dest;
|
||||
n0 = n1 = block_size;
|
||||
while (1)
|
||||
{
|
||||
struct record *chosen_record;
|
||||
struct tape *chosen_tape;
|
||||
if (n0 == 0 || tape0->count == 0)
|
||||
{
|
||||
if (n1 == 0 || tape1->count == 0)
|
||||
break;
|
||||
chosen_tape = tape1;
|
||||
n1--;
|
||||
}
|
||||
else if (n1 == 0 || tape1->count == 0)
|
||||
{
|
||||
chosen_tape = tape0;
|
||||
n0--;
|
||||
}
|
||||
else if ((*compare)(tape0->first, tape1->first) > 0)
|
||||
{
|
||||
chosen_tape = tape1;
|
||||
n1--;
|
||||
}
|
||||
else
|
||||
{
|
||||
chosen_tape = tape0;
|
||||
n0--;
|
||||
}
|
||||
chosen_tape->count--;
|
||||
chosen_record = chosen_tape->first;
|
||||
chosen_tape->first = chosen_record->next[index];
|
||||
if (output_tape->count == 0)
|
||||
output_tape->first = chosen_record;
|
||||
else
|
||||
output_tape->last->next[index] = chosen_record;
|
||||
output_tape->last = chosen_record;
|
||||
output_tape->count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tape[base].count > 1L)
|
||||
tape[base].last->next[index] = NULL;
|
||||
return tape[base].first;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Reference in a new issue