Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
bf6db74f
Commit
bf6db74f
authored
Mar 01, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
makedep: Make the filename hashing more efficient.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
850df9d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
makedep.c
tools/makedep.c
+5
-4
No files found.
tools/makedep.c
View file @
bf6db74f
...
@@ -109,7 +109,7 @@ static const struct
...
@@ -109,7 +109,7 @@ static const struct
{
FLAG_IDL_HEADER
,
".h"
}
{
FLAG_IDL_HEADER
,
".h"
}
};
};
#define HASH_SIZE
13
7
#define HASH_SIZE
99
7
static
struct
list
files
[
HASH_SIZE
];
static
struct
list
files
[
HASH_SIZE
];
...
@@ -728,8 +728,9 @@ static char *get_line( FILE *file )
...
@@ -728,8 +728,9 @@ static char *get_line( FILE *file )
*/
*/
static
unsigned
int
hash_filename
(
const
char
*
name
)
static
unsigned
int
hash_filename
(
const
char
*
name
)
{
{
unsigned
int
ret
=
0
;
/* FNV-1 hash */
while
(
*
name
)
ret
=
(
ret
<<
7
)
+
(
ret
<<
3
)
+
*
name
++
;
unsigned
int
ret
=
2166136261
;
while
(
*
name
)
ret
=
(
ret
*
16777619
)
^
*
name
++
;
return
ret
%
HASH_SIZE
;
return
ret
%
HASH_SIZE
;
}
}
...
@@ -742,7 +743,6 @@ static struct file *add_file( const char *name )
...
@@ -742,7 +743,6 @@ static struct file *add_file( const char *name )
struct
file
*
file
=
xmalloc
(
sizeof
(
*
file
)
);
struct
file
*
file
=
xmalloc
(
sizeof
(
*
file
)
);
memset
(
file
,
0
,
sizeof
(
*
file
)
);
memset
(
file
,
0
,
sizeof
(
*
file
)
);
file
->
name
=
xstrdup
(
name
);
file
->
name
=
xstrdup
(
name
);
list_add_tail
(
&
files
[
hash_filename
(
name
)],
&
file
->
entry
);
return
file
;
return
file
;
}
}
...
@@ -1198,6 +1198,7 @@ static struct file *load_file( const char *name )
...
@@ -1198,6 +1198,7 @@ static struct file *load_file( const char *name )
if
(
!
(
f
=
fopen
(
name
,
"r"
)))
return
NULL
;
if
(
!
(
f
=
fopen
(
name
,
"r"
)))
return
NULL
;
file
=
add_file
(
name
);
file
=
add_file
(
name
);
list_add_tail
(
&
files
[
hash
],
&
file
->
entry
);
input_file_name
=
file
->
name
;
input_file_name
=
file
->
name
;
input_line
=
0
;
input_line
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment