mirror of
https://github.com/0intro/libtask
synced 2024-11-24 22:59:43 +03:00
fix warnings
print.c:106:10: warning: variable ‘neg’ set but not used tcpproxy.c:55:25: warning: cast to pointer from integer of different size tcpproxy.c:64:7: warning: cast from pointer to integer of different size testdelay.c:15:12: warning: cast from pointer to integer of different size testdelay.c:16:32: warning: cast from pointer to integer of different size testdelay.c:31:25: warning: cast to pointer from integer of different size
This commit is contained in:
parent
b75fdf3424
commit
0609977c6e
4
print.c
4
print.c
@ -103,7 +103,7 @@ vseprint(char *dst, char *edst, char *fmt, va_list arg)
|
||||
{
|
||||
static char digits[] = "0123456789abcdef";
|
||||
char buf[30], *p;
|
||||
int neg, zero;
|
||||
int zero;
|
||||
uvlong luv;
|
||||
|
||||
if(fl&FlagLongLong){
|
||||
@ -126,10 +126,8 @@ vseprint(char *dst, char *edst, char *fmt, va_list arg)
|
||||
}
|
||||
|
||||
p = buf+sizeof buf;
|
||||
neg = 0;
|
||||
zero = 0;
|
||||
if(!(fl&FlagUnsigned) && (vlong)luv < 0){
|
||||
neg = 1;
|
||||
luv = -luv;
|
||||
}
|
||||
if(luv == 0)
|
||||
|
@ -52,7 +52,7 @@ taskmain(int argc, char **argv)
|
||||
fdnoblock(fd);
|
||||
while((cfd = netaccept(fd, remote, &rport)) >= 0){
|
||||
fprintf(stderr, "connection from %s:%d\n", remote, rport);
|
||||
taskcreate(proxytask, (void*)cfd, STACK);
|
||||
taskcreate(proxytask, (void*)(uintptr_t)cfd, STACK);
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ proxytask(void *v)
|
||||
{
|
||||
int fd, remotefd;
|
||||
|
||||
fd = (int)v;
|
||||
fd = (int)(uintptr_t)v;
|
||||
if((remotefd = netdial(TCP, server, port)) < 0){
|
||||
close(fd);
|
||||
return;
|
||||
|
@ -12,8 +12,8 @@ Channel *c;
|
||||
void
|
||||
delaytask(void *v)
|
||||
{
|
||||
taskdelay((int)v);
|
||||
printf("awake after %d ms\n", (int)v);
|
||||
taskdelay((int)(uintptr_t)v);
|
||||
printf("awake after %d ms\n", (int)(uintptr_t)v);
|
||||
chansendul(c, 0);
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ taskmain(int argc, char **argv)
|
||||
for(i=1; i<argc; i++){
|
||||
n++;
|
||||
printf("x");
|
||||
taskcreate(delaytask, (void*)atoi(argv[i]), STACK);
|
||||
taskcreate(delaytask, (void*)(uintptr_t)atoi(argv[i]), STACK);
|
||||
}
|
||||
|
||||
/* wait for n tasks to finish */
|
||||
|
Loading…
Reference in New Issue
Block a user