Apply zlul's enhacements for html.sh

This commit is contained in:
pancake 2013-01-04 14:51:21 +01:00
parent da837ad4ce
commit aed2fd9aa5
4 changed files with 23 additions and 22 deletions

View File

@ -12,7 +12,8 @@ typedef struct {
int blocklen;
} RCoreVisualAsm;
static int readline_callback(RCoreVisualAsm *a, const char *str) {
static int readline_callback(void *_a, const char *str) {
RCoreVisualAsm *a = _a;
int xlen;
r_cons_clear00 ();
r_cons_printf ("Write your favourite %s-%d opcode...\n\n",

View File

@ -9,7 +9,7 @@ CFLAGS+=-Wall
#CFLAGS+=-O3
#CFLAGS+=-ggdb -g -Wall -O0
HAVE_VALA=$(shell valac --version)
HAVE_VALA=$(shell valac --version 2>/dev/null)
# This is hacky
OS=$(shell uname)
ARCH=$(shell uname -m)

View File

@ -185,7 +185,7 @@ static int cin_get_num(RNum *num, RNumCalc *nc, RNumCalcValue *n) {
}
static RNumCalcToken get_token(RNum *num, RNumCalc *nc) {
char c, ch;
char ch = 0, c = 0;
do { if (!cin_get (num, nc, &ch)) return nc->curr_tok = RNCEND;
} while (ch!='\n' && isspace (ch));

View File

@ -1,23 +1,23 @@
#!/bin/sh
cd `dirname $PWD/$0`
./bins.sh
cd `dirname $PWD/$0` || exit
test -f ./bins.sh && ./bins.sh
# gen htmls
for a in log/*.log ; do
b=$(echo $a|sed -e 's,.log$,.html,')
r=$(echo $a|sed -e 's,.log$,.ret,')
t=$(echo $a|sed -e 's,.log$,.time,')
c=$(echo $a|sed -e 's,.log$,.cpu,')
b=$(sed -e 's,.log$,.html,' $a)
r=$(sed -e 's,.log$,.ret,' $a)
t=$(sed -e 's,.log$,.time,' $a)
c=$(sed -e 's,.log$,.cpu,' $a)
echo "<html><body style=background-color:black;color:white;font-family:Verdana>" > $b
echo "<h1><a href=./>index</a></h1>" >> $b
echo "<h1>$a</h1>" >> $b
allocas=$(cat $a|grep -e "alloca'" |wc -l)
formats=$(cat $a|grep -e "in format" -e "format'" |wc -l)
unused=$(cat $a|grep -e "not used" -e unused |wc -l)
casts=$(cat $a|grep incompatible |wc -l)
warnings=$(cat $a|grep warning: |wc -l)
undefineds=$(cat $a|grep undefined |wc -l)
errors=$(cat $a|grep -e error: -e 'returned 1'|wc -l)
allocas=$(grep -ce "alloca'" $a)
formats=$(grep -c -e "in format" -e "format'" $a)
unused=$(grep -c -e "not used" -e unused $a)
casts=$(grep -ce incompatible $a)
warnings=$(grep "warning:" $a)
undefineds=$(grep undefined $a)
errors=$(grep -c -e error: -e 'returned 1' $a)
if [ -f $t ]; then
echo "<h2>time:</h2>" >> $b
echo "<pre>" >> $b
@ -69,10 +69,10 @@ for a in log/*.log ; do
gsub(/warning\: (.*)$/,"<b style=color:yellow>&</b>");
print}' >> $b
echo "<h2>build:</h2>" >> $b
cat $a | awk '{
awk '{
gsub(/warning\: (.*)$/,"<b style=color:yellow>warning: &</b>");
gsub(/error\: (.*)$/,"<b style=color:red>&</b>");
print}' >> $b
print}' $a >> $b
echo "<pre></body></html>" >> $b
done
@ -97,10 +97,10 @@ for a in `ls -rt log/*.log | tac`; do
f=$(echo $a | sed -e 's,log/,,' -e s,.log,,)
l=log/$f.log
ft=log/$f.time
n=$(echo $f|sed -e 's,-, ,g')
t=$(cat $ft |grep real|awk '{print $2}')
warnings=$(cat $l|grep warning: |wc -l)
errors=$(cat $l|grep error: |wc -l)
n=$(sed -e 's,-, ,g' $f)
t=$(awk '/real/{print $2}' $ft)
warnings=$(grep -c "warning:" $l)
errors=$(grep -c "error:" $l)
echo "<h3><a href=$f.html>$n</a> (<font color=yellow>w:</font>$warnings <font color=red>e:</font>$errors $t)</h3>" >> log/index.html
done