mothra: enable compiler warnings and type checking, cleanup

This commit is contained in:
cinap_lenrek 2015-08-01 14:55:33 +02:00
parent fe5ede9792
commit 71c57070c6
6 changed files with 13 additions and 13 deletions

View file

@ -3,6 +3,7 @@
#include <draw.h> #include <draw.h>
#include <event.h> #include <event.h>
#include <panel.h> #include <panel.h>
#include "rtext.h"
#include "mothra.h" #include "mothra.h"
#include "html.h" #include "html.h"
@ -357,7 +358,7 @@ char *seloption(Field *f){
} }
void mkfieldpanel(Rtext *t){ void mkfieldpanel(Rtext *t){
Action *a; Action *a;
Panel *win, *scrl, *menu, *pop, *button; Panel *win, *scrl;
Field *f; Field *f;
if((a = t->user) == nil) if((a = t->user) == nil)

View file

@ -23,7 +23,6 @@ char *pixcmd[]={
}; };
void getimage(Rtext *t, Www *w){ void getimage(Rtext *t, Www *w){
int pfd[2];
Action *ap; Action *ap;
Url *url; Url *url;
Image *b; Image *b;
@ -64,6 +63,7 @@ void getimage(Rtext *t, Www *w){
s += sprint(s, " -x %d", ap->width); s += sprint(s, " -x %d", ap->width);
if(ap->height>0) if(ap->height>0)
s += sprint(s, " -y %d", ap->height); s += sprint(s, " -y %d", ap->height);
USED(s);
if((fd = pipeline(fd, buf)) < 0) if((fd = pipeline(fd, buf)) < 0)
goto Err; goto Err;
} }

View file

@ -225,3 +225,7 @@ void endform(Hglob *);
char *pl_getattr(Pair *, char *); char *pl_getattr(Pair *, char *);
int pl_hasattr(Pair *, char *); int pl_hasattr(Pair *, char *);
void pl_htmloutput(Hglob *, int, char *, Field *); void pl_htmloutput(Hglob *, int, char *, Field *);
#pragma incomplete Form
#pragma incomplete Field

View file

@ -16,7 +16,7 @@ HFILES=mothra.h html.h libpanel/panel.h libpanel/rtext.h
BIN=/$objtype/bin BIN=/$objtype/bin
</sys/src/cmd/mkone </sys/src/cmd/mkone
CFLAGS=-Dplan9 -Ilibpanel CFLAGS=-FTVw -Ilibpanel
$LIB:V: $LIB:V:
cd libpanel cd libpanel

View file

@ -297,8 +297,6 @@ void main(int argc, char *argv[]){
Event e; Event e;
enum { Eplumb = 128, Ekick = 256 }; enum { Eplumb = 128, Ekick = 256 };
Plumbmsg *pm; Plumbmsg *pm;
Www *new;
Action *a;
char *url; char *url;
int i; int i;
@ -577,7 +575,7 @@ char *arg(char *s){
} }
void save(int ifd, char *name){ void save(int ifd, char *name){
char buf[NNAME+64]; char buf[NNAME+64];
int cfd, ofd; int ofd;
if(ifd < 0){ if(ifd < 0){
message("save: %s: %r", name); message("save: %s: %r", name);
return; return;
@ -972,7 +970,7 @@ Url* selurl(char *urlname){
* get the file at the given url * get the file at the given url
*/ */
void geturl(char *urlname, int post, int plumb, int map){ void geturl(char *urlname, int post, int plumb, int map){
int i, fd, typ, pfd[2]; int i, fd, typ;
char cmd[NNAME]; char cmd[NNAME];
ulong n; ulong n;
Www *w; Www *w;
@ -1168,7 +1166,6 @@ void paste(Panel *p){
} }
void hit3(int button, int item){ void hit3(int button, int item){
char name[NNAME]; char name[NNAME];
char file[128];
Panel *swap; Panel *swap;
int fd; int fd;
USED(button); USED(button);

View file

@ -317,10 +317,8 @@ char *linkify(char *s){
* This doesn't work if removing an entity reference can lengthen the string! * This doesn't work if removing an entity reference can lengthen the string!
* Fortunately, this doesn't happen. * Fortunately, this doesn't happen.
*/ */
void pl_rmentities(Hglob *g, char *s){ void pl_rmentities(Hglob *, char *s){
char *t, *u, c, svc; char *t, *u, c, svc;
Entity *ep;
Rune r;
t=s; t=s;
do{ do{
c=*s++; c=*s++;
@ -466,7 +464,7 @@ int pl_getcomment(Hglob *g){
; ;
if(c==EOF) if(c==EOF)
break; break;
if((c=pl_nextc(g))=='-'){ if(pl_nextc(g)=='-'){
while((c=pl_nextc(g))=='-') while((c=pl_nextc(g))=='-')
; ;
if(c==ETAG || c==EOF) if(c==ETAG || c==EOF)
@ -693,7 +691,7 @@ void plrdplain(char *name, int fd, Www *dst){
finish(dst); finish(dst);
} }
void plrdhtml(char *name, int fd, Www *dst){ void plrdhtml(char *name, int fd, Www *dst){
int t, tagerr; int tagerr;
Stack *sp; Stack *sp;
char buf[20]; char buf[20];
char *str; char *str;