commit e9d2f3286b20e807258adabb46469bb27fdb94bb
parent 0aa7f3b4fe19afbf612e76c5eeb10c88051d0eb2
Author: Kris Maglione <jg@suckless.org>
Date: Thu, 31 Jan 2008 16:32:24 -0500
Fix some warnings on 64 bit systems with fr*king gcc-4.
Diffstat:
6 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/cmd/wmii/utf.c b/cmd/wmii/utf.c
@@ -15,7 +15,7 @@ toutf8n(const char *str, size_t nstr) {
if(cd == nil) {
cd = iconv_open("UTF-8", nl_langinfo(CODESET));
- if((int)cd == -1)
+ if((long)cd == -1)
warning("Can't convert from local character encoding to UTF-8");
else
haveiconv = true;
diff --git a/libfmt/fmtfd.c b/libfmt/fmtfd.c
@@ -40,7 +40,7 @@ fmtfdinit(Fmt *f, int fd, char *buf, int size)
f->to = buf;
f->stop = buf + size;
f->flush = __fmtFdFlush;
- f->farg = (void*)fd;
+ f->farg = (void*)(uintptr_t)fd;
f->nfmt = 0;
return 0;
}
diff --git a/libfmt/fmtfdflush.c b/libfmt/fmtfdflush.c
@@ -27,7 +27,7 @@ __fmtFdFlush(Fmt *f)
int n;
n = (char*)f->to - (char*)f->start;
- if(n && write((int)f->farg, f->start, n) != n)
+ if(n && write((uintptr_t)f->farg, f->start, n) != n)
return 0;
f->to = f->start;
return 1;
diff --git a/libfmt/runevsmprint.c b/libfmt/runevsmprint.c
@@ -30,7 +30,7 @@ runeFmtStrFlush(Fmt *f)
if(f->start == nil)
return 0;
- n = (int)f->farg;
+ n = (uintptr_t)f->farg;
n *= 2;
s = (Rune*)f->start;
f->start = realloc(s, sizeof(Rune)*n);
@@ -41,7 +41,7 @@ runeFmtStrFlush(Fmt *f)
free(s);
return 0;
}
- f->farg = (void*)n;
+ f->farg = (void*)(uintptr_t)n;
f->to = (Rune*)f->start + ((Rune*)f->to - s);
f->stop = (Rune*)f->start + n - 1;
return 1;
@@ -61,7 +61,7 @@ runefmtstrinit(Fmt *f)
f->to = f->start;
f->stop = (Rune*)f->start + n - 1;
f->flush = runeFmtStrFlush;
- f->farg = (void*)n;
+ f->farg = (void*)(uintptr_t)n;
f->nfmt = 0;
return 0;
}
diff --git a/libfmt/sprint.c b/libfmt/sprint.c
@@ -28,7 +28,7 @@ sprint(char *buf, const char *fmt, ...)
* we must be sure not to overflow a 32-bit pointer.
*/
if(buf+len < buf)
- len = -(uint)buf-1;
+ len = -(uintptr_t)buf-1;
va_start(args, fmt);
n = vsnprint(buf, len, fmt, args);
diff --git a/libfmt/vsmprint.c b/libfmt/vsmprint.c
@@ -30,7 +30,7 @@ fmtStrFlush(Fmt *f)
if(f->start == nil)
return 0;
- n = (int)f->farg;
+ n = (uintptr_t)f->farg;
n *= 2;
s = (char*)f->start;
f->start = realloc(s, n);
@@ -41,7 +41,7 @@ fmtStrFlush(Fmt *f)
free(s);
return 0;
}
- f->farg = (void*)n;
+ f->farg = (void*)(uintptr_t)n;
f->to = (char*)f->start + ((char*)f->to - s);
f->stop = (char*)f->start + n - 1;
return 1;
@@ -61,7 +61,7 @@ fmtstrinit(Fmt *f)
f->to = f->start;
f->stop = (char*)f->start + n - 1;
f->flush = fmtStrFlush;
- f->farg = (void*)n;
+ f->farg = (void*)(uintptr_t)n;
f->nfmt = 0;
return 0;
}