ChangeSet ID: 11686 CVSROOT: /opt/cvs-commit Module name: tools Changes by: jnewman@wine.codeweavers.com 2004/03/25 14:48:45 Modified files: . : winapi_stats.php Log message: Ofir Petruska : Fix the module name cut to 5 chars bug - Get a MODULE_LENGTH constant and pad Total to it Patch: http://cvs.winehq.org/patch.py?id=11686 Old revision New revision Changes Path 1.3 1.4 +20 -8 tools/winapi_stats.php Index: tools/winapi_stats.php diff -u -p tools/winapi_stats.php:1.3 tools/winapi_stats.php:1.4 --- tools/winapi_stats.php:1.3 Sun May 19 08:20:54 2013 +++ tools/winapi_stats.php Sun May 19 08:20:54 2013 @@ -1,5 +1,5 @@ #!/usr/bin/php -q - $line) unset($lines); // perform query on data in temp table -$q = mysql_query('SELECT "Total" "Library", sum(total_func) "API Count", -(sum(total_func) - sum(stubs)) / sum(total_func) *100"% implemented", -sum(stubs) "Total Stubs", sum(real_stub), sum(pseudo_stubs) -FROM winapi UNION ALL SELECT module "Library", total_func "API Count", -(total_func - stubs) / total_func *100 "% implemented", stubs "TotalStubs", -real_stub, pseudo_stubs +// (The str_pad is becouse union seems to define the coulumn length by the first select) +$q = mysql_query(' +SELECT "'.str_pad('Total',MODULE_LENGTH).'" as "Library", + sum(total_func) as "API Count", + (sum(total_func) - sum(stubs)) / sum(total_func) *100 as "% implemented", + sum(stubs) as "Total Stubs", + sum(real_stub) as "Real Stubs", + sum(pseudo_stubs) as "Pseudo_stubs" +FROM winapi +UNION ALL +SELECT module as "Library", + total_func as "API Count", + (total_func - stubs) / total_func *100 as "% implemented", + stubs as "TotalStubs", + real_stub as "Real Stubs", + pseudo_stubs as "Pseudo_stubs" FROM winapi'); // table header