Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
512c686b
Commit
512c686b
authored
Mar 29, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
makedep: Sort makefile variables.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
953d6c88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
11 deletions
+24
-11
makedep.c
tools/makedep.c
+24
-11
No files found.
tools/makedep.c
View file @
512c686b
...
...
@@ -413,10 +413,15 @@ static void strarray_add_uniq( struct strarray *array, const char *str )
*/
static
const
char
*
strarray_get_value
(
const
struct
strarray
*
array
,
const
char
*
name
)
{
unsigned
int
i
;
int
pos
,
res
,
min
=
0
,
max
=
array
->
count
/
2
-
1
;
for
(
i
=
0
;
i
<
array
->
count
;
i
+=
2
)
if
(
!
strcmp
(
array
->
str
[
i
],
name
))
return
array
->
str
[
i
+
1
];
while
(
min
<=
max
)
{
pos
=
(
min
+
max
)
/
2
;
if
(
!
(
res
=
strcmp
(
array
->
str
[
pos
*
2
],
name
)))
return
array
->
str
[
pos
*
2
+
1
];
if
(
res
<
0
)
min
=
pos
+
1
;
else
max
=
pos
-
1
;
}
return
NULL
;
}
...
...
@@ -428,17 +433,25 @@ static const char *strarray_get_value( const struct strarray *array, const char
*/
static
void
strarray_set_value
(
struct
strarray
*
array
,
const
char
*
name
,
const
char
*
value
)
{
unsigned
int
i
;
int
i
,
pos
,
res
,
min
=
0
,
max
=
array
->
count
/
2
-
1
;
/* redefining a variable replaces the previous value */
for
(
i
=
0
;
i
<
array
->
count
;
i
+=
2
)
while
(
min
<=
max
)
{
if
(
strcmp
(
array
->
str
[
i
],
name
))
continue
;
array
->
str
[
i
+
1
]
=
value
;
return
;
pos
=
(
min
+
max
)
/
2
;
if
(
!
(
res
=
strcmp
(
array
->
str
[
pos
*
2
],
name
)))
{
/* redefining a variable replaces the previous value */
array
->
str
[
pos
*
2
+
1
]
=
value
;
return
;
}
if
(
res
<
0
)
min
=
pos
+
1
;
else
max
=
pos
-
1
;
}
strarray_add
(
array
,
name
);
strarray_add
(
array
,
value
);
strarray_add
(
array
,
NULL
);
strarray_add
(
array
,
NULL
);
for
(
i
=
array
->
count
-
1
;
i
>
min
*
2
+
1
;
i
--
)
array
->
str
[
i
]
=
array
->
str
[
i
-
2
];
array
->
str
[
min
*
2
]
=
name
;
array
->
str
[
min
*
2
+
1
]
=
value
;
}
...
...
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