Hello Reece,
Reece Dunn wrote:
As a result of the "Wine FIXME Report 2009 Aug - Dec" thread, I
thanks for the patch. It is good to see that the FIXME report is useful and generated some Wine commits.
created the following to hunt for DllCanUnloadNow calls that were marked as being FIXME stubs:
cat > DllCanUnloadNow.pl < EOF #!/usr/local/bin/perl # Based on http://www.unix.com/unix-dummies-questions-answers/56703-multiline-grep.html
use strict;
my $filename = shift;
open (FILE, "<", $filename) or die "Failed to read file $filename : $! \n"; my $whole_file; { local $/; $whole_file = <FILE>; } close(FILE);
if ($whole_file =~ m#HRESULT WINAPI DllCanUnloadNow ?( ?(void|VOID) ?)[\n ]{\n\s+FIXME#sg) { print $filename . "\n"; } EOF
and used it with the following:
$ grep -F DllCanUnloadNow -r dlls | grep -F HRESULT | sed -e
's/:.*//' | while read line ; do perl DllCanUnloadNow.pl $line ; done | sort | tee results.log
This gives the following results:
Impressive script. Not sure if you have heard of coccinelle (semantic patcher, http://coccinelle.lip6.fr/); it sees some usage in the Linux Kernel project. As I would like to see it used on Wine too I've have added the corresponding cocci file for this task. This task is a prime example of coccinelle's intended usage.
------Snip DllCanUnloadNow.cocci------ @@ @@ DllCanUnloadNow( ... ) { ... - FIXME( ... ); ... } ------Snip DllCanUnloadNow.cocci------
Run it with: spatch -sp_file DllCanUnloadNow.cocci -patch $winesrcdir $winesrcdir/dlls
And you'll get a patch in git diff file format.
bye michael