commit 0370f0e2d72a6773d8da92b8082f76697ba395ab
parent b32c8893c066d6569992dcd8b36f5104caef959c
Author: Anselm R. Garbe <garbeam@wmii.de>
Date: Mon, 19 Jun 2006 10:50:55 +0200
eliminated a bunch of casting warnings
Diffstat:
5 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/cmd/wm/fs2.c b/cmd/wm/fs2.c
@@ -642,7 +642,7 @@ fs_write(Req *r) {
return respond(r, nil);
case FsFBorder:
data_to_cstring(r);
- i = (unsigned int)strtol(r->ifcall.data, &buf, 10);
+ i = (unsigned int)strtol((char *)r->ifcall.data, &buf, 10);
if(*buf)
return respond(r, Ebadvalue);
def.border = i;
@@ -658,9 +658,9 @@ fs_write(Req *r) {
case FsFCNorm:
/* XXX: This allows for junk after the color string */
data_to_cstring(r);
- buf = r->ifcall.data;
+ buf = (char *)r->ifcall.data;
i = r->ifcall.count;
- if(!parse_colors((char **)&buf, &i, f->col))
+ if(!parse_colors((char **)&buf, (int *)&i, f->col))
return respond(r, Ebadvalue);
draw_clients();
r->ofcall.count = r->ifcall.count - i;
@@ -670,7 +670,7 @@ fs_write(Req *r) {
if(r->ifcall.count == 0)
return respond(r, nil);
- if((errstr = message_view(f->view, r->ifcall.data)))
+ if((errstr = message_view(f->view, (char *)r->ifcall.data)))
return respond(r, errstr);
r->ofcall.count = r->ifcall.count;
return respond(r, nil);
@@ -680,10 +680,10 @@ fs_write(Req *r) {
return respond(r, nil);
/* XXX: This needs to be moved to client_message(char *) */
- if(!strncmp(r->ifcall.data, "quit", 5))
+ if(!strncmp((char *)r->ifcall.data, "quit", 5))
srv.running = 0;
- else if(!strncmp(r->ifcall.data, "view ", 5))
- select_view(&r->ifcall.data[5]);
+ else if(!strncmp((char *)r->ifcall.data, "view ", 5))
+ select_view((char *)&r->ifcall.data[5]);
else
return respond(r, Enocommand);
r->ofcall.count = r->ifcall.count;
@@ -749,7 +749,7 @@ write_event(char *buf) {
for(; pending_event_reads; pending_event_reads=aux) {
aux = pending_event_reads->aux;
/* XXX: It would be nice if strdup wasn't necessary here */
- pending_event_reads->ofcall.data = strdup(buf);
+ pending_event_reads->ofcall.data = (void *)strdup(buf);
pending_event_reads->ofcall.count = len;
respond(pending_event_reads, nil);
}
diff --git a/cmd/wm/view.c b/cmd/wm/view.c
@@ -353,12 +353,12 @@ view_index(View *v) {
for(f=a->frame; f && len > 0; f=f->anext) {
XRectangle *r = &f->rect;
if(a_i == 0)
- n = snprintf(&buf[buf_i], len, "~ %d %d %d %d %d %s\n",
+ n = snprintf((char *)&buf[buf_i], len, "~ %d %d %d %d %d %s\n",
idx_of_client(f->client),
r->x, r->y, r->width, r->height,
f->client->props);
else
- n = snprintf(&buf[buf_i], len, "%d %d %d %s\n",
+ n = snprintf((char *)&buf[buf_i], len, "%d %d %d %s\n",
a_i, idx_of_client(f->client),
r->width, f->client->props);
buf_i += n;
diff --git a/libixp/convert.c b/libixp/convert.c
@@ -126,7 +126,7 @@ ixp_unpack_strings(unsigned char **msg, int *msize, unsigned short n, char **str
memcpy(s, *msg, len);
s[len] = '\0';
- strings[i] = s;
+ strings[i] = (char *)s;
*msg += len;
s += len + 1;
}
diff --git a/libixp/ixp.h b/libixp/ixp.h
@@ -198,7 +198,7 @@ typedef struct Fcall {
Qid wqid[IXP_MAX_WELEM];
};
struct { /* Twrite */
- long long offset; /* +Tread */
+ unsigned long long offset; /* +Tread */
/* +Rread */
unsigned int count; /* +Tread */
unsigned char *data;
diff --git a/libixp/message.c b/libixp/message.c
@@ -139,10 +139,11 @@ ixp_fcall2msg(void *msg, Fcall *fcall, unsigned int msglen)
unsigned int
ixp_msg2fcall(Fcall *fcall, void *msg, unsigned int msglen)
{
- unsigned int i, msize, tsize;
+ int msize;
+ unsigned int i, tsize;
unsigned short len;
unsigned char *p = msg;
- ixp_unpack_prefix(&p, &msize, &fcall->type, &fcall->tag);
+ ixp_unpack_prefix(&p, (unsigned int *)&msize, &fcall->type, &fcall->tag);
tsize = msize;
if(msize > msglen) /* bad message */