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
1482006f
Commit
1482006f
authored
Nov 26, 2008
by
Kirill K. Smirnov
Committed by
Alexandre Julliard
Nov 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecfg/audio: Simplify removeDriver() function.
parent
d540cf3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
39 deletions
+20
-39
audio.c
programs/winecfg/audio.c
+20
-39
No files found.
programs/winecfg/audio.c
View file @
1482006f
...
@@ -173,45 +173,26 @@ static void addDriver(const char * driver)
...
@@ -173,45 +173,26 @@ static void addDriver(const char * driver)
/* remove driver from local copy of driver registry string */
/* remove driver from local copy of driver registry string */
static
void
removeDriver
(
const
char
*
driver
)
static
void
removeDriver
(
const
char
*
driver
)
{
{
char
before
[
32
],
after
[
32
],
*
start
;
char
pattern
[
32
],
*
p
;
int
drvlen
,
listlen
;
strcpy
(
before
,
","
);
strcat
(
before
,
driver
);
strcpy
(
pattern
,
","
);
strcpy
(
after
,
driver
);
strcat
(
pattern
,
driver
);
strcat
(
after
,
","
);
strcat
(
pattern
,
","
);
drvlen
=
strlen
(
driver
);
if
((
start
=
strstr
(
curAudioDriver
,
after
)))
listlen
=
strlen
(
curAudioDriver
);
{
int
len
=
strlen
(
after
);
p
=
strstr
(
curAudioDriver
,
pattern
);
char
*
end
=
curAudioDriver
+
strlen
(
curAudioDriver
);
if
(
p
)
/* somewhere in the middle */
int
i
,
count
=
end
-
start
+
len
;
memmove
(
p
,
p
+
drvlen
+
1
,
strlen
(
p
+
drvlen
+
1
)
+
1
);
for
(
i
=
0
;
i
<
count
;
i
++
)
else
if
(
!
strncmp
(
curAudioDriver
,
pattern
+
1
,
drvlen
+
1
))
/* the head */
{
memmove
(
curAudioDriver
,
curAudioDriver
+
drvlen
+
1
,
listlen
-
drvlen
);
if
(
start
+
len
>=
end
)
else
if
(
!
strncmp
(
curAudioDriver
+
listlen
-
drvlen
-
1
,
pattern
,
drvlen
+
1
))
/* the tail */
*
start
=
0
;
curAudioDriver
[
listlen
-
drvlen
-
1
]
=
0
;
else
else
if
(
!
strcmp
(
curAudioDriver
,
driver
))
/* only one entry (head&tail) */
*
start
=
start
[
len
];
curAudioDriver
[
0
]
=
0
;
start
++
;
else
}
WINE_FIXME
(
"driver '%s' is not in the list, please report!
\n
"
,
driver
);
}
else
if
((
start
=
strstr
(
curAudioDriver
,
before
)))
{
int
len
=
strlen
(
before
);
char
*
end
=
curAudioDriver
+
strlen
(
curAudioDriver
);
int
i
,
count
=
end
-
start
+
len
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
start
+
len
>=
end
)
*
start
=
0
;
else
*
start
=
start
[
len
];
start
++
;
}
}
else
if
(
strcmp
(
curAudioDriver
,
driver
)
==
0
)
{
strcpy
(
curAudioDriver
,
""
);
}
}
}
static
void
initAudioDeviceTree
(
HWND
hDlg
)
static
void
initAudioDeviceTree
(
HWND
hDlg
)
...
...
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