[Libsysio-commit] HEAD: libsysio/tests sysio_stubs.c sysio_tests.c test_driver.c
Brought to you by:
lward
|
From: Sonja T. <so...@us...> - 2004-02-24 16:01:04
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10559 Modified Files: sysio_stubs.c sysio_tests.c test_driver.c Log Message: Code cleanup. Making it C99 compliant Index: sysio_stubs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/sysio_stubs.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- sysio_stubs.c 14 Feb 2004 19:42:59 -0000 1.9 +++ sysio_stubs.c 24 Feb 2004 15:46:33 -0000 1.10 @@ -116,7 +116,7 @@ int test_do_fillbuff(int argc, char **ar } buf = (char *)(buflist[index]->buf)+offset; - DBG(4, fprintf(outfp, "Buffer start is at %p\n", buflist[index])); + DBG(4, fprintf(outfp, "Buffer start is at %p\n", (void *)buflist[index])); typestr = argv[1]; size = get_obj(argv[2]); @@ -242,7 +242,7 @@ int test_do_printbuf(int argc, char **ar index = mobj->obj; buf_st = buflist[index]; - DBG(2, fprintf(outfp, "buf_st is %p:\n", buf_st)); + DBG(2, fprintf(outfp, "buf_st is %p:\n", (void *)buf_st)); buf = buf_st->buf; DBG(2, fprintf(outfp, "buf %s:\n", argv[0])); if (mobj->type == STR) { @@ -337,7 +337,7 @@ int test_do_list(int argc, char **argv) return INVALID_ARGS; } - DBG(5,fprintf(outfp, "In test_do_list with args %p\n", argv)); + DBG(5,fprintf(outfp, "In test_do_list with args %p\n", (void *)argv)); if (!argv) { buf = getcwd(NULL, 0); DBG(4, fprintf(outfp, "Calling list with dir of %s\n", buf)); @@ -552,7 +552,7 @@ int get_buffer(int argc, char **argv) buf->len = size; buflist[next] = buf; DBG(3, fprintf(outfp, "Your buffer (%p) (%p) is at index %d\n", - buf, buf->buf, next)); + (void *)buf, buf->buf, next)); next++; last_type = PTR; @@ -2418,7 +2418,7 @@ int test_do_writex(int argc, char **argv } DBG(3, fprintf(outfp, "writex(fd: %d, iov: %p iov_cnt: %d, xtv: %p, xtv_cnt: %d\n", - fd, iov, iov_count, xtv, xtv_count)); + fd, (void *)iov, iov_count, (void *)xtv, xtv_count)); last_ret_val = writex(fd, iov, iov_count, xtv, xtv_count); if (last_ret_val < 0) @@ -2484,7 +2484,7 @@ int test_do_iwritex(int argc, char **arg } DBG(3, fprintf(outfp, "iwritex(fd: %d, iov: %p iov_cnt: %d, xtv: %p, xtv_cnt: %d\n", - fd, iov, iov_count, xtv, xtv_count)); + fd, (void *)iov, iov_count, (void *)xtv, xtv_count)); last_ret_val = (int) iwritex(fd, iov, iov_count, xtv, xtv_count); if (last_ret_val < 0) @@ -2550,7 +2550,7 @@ int test_do_readx(int argc, char **argv) } DBG(3, fprintf(outfp, "readx(fd: %d, iov: %p iov_cnt: %d, xtv: %p, xtv_cnt: %d\n", - fd, iov, iov_count, xtv, xtv_count)); + fd, (void *)iov, iov_count, (void *)xtv, xtv_count)); last_ret_val = readx(fd, iov, iov_count, xtv, xtv_count); if (last_ret_val < 0) @@ -2616,7 +2616,7 @@ int test_do_ireadx(int argc, char **argv } DBG(3, fprintf(outfp, "ireadx(fd: %d, iov: %p iov_cnt: %d, xtv: %p, xtv_cnt: %d\n", - fd, iov, iov_count, xtv, xtv_count)); + fd, (void *)iov, iov_count, (void *)xtv, xtv_count)); last_ret_val = (int) ireadx(fd, iov, iov_count, xtv, xtv_count); if (last_ret_val < 0) @@ -2665,7 +2665,7 @@ int do_checkbuf(int argc, char **argv) memset((void *)ref_buf, val, size); last_ret_val =0; - for (i=0; i < size/sizeof(int); i++) { + for (i=0; (unsigned)i < size/sizeof(int); i++) { if (buf[i] != ref_buf[i]) { DBG(2, fprintf(stderr, "At pos %d I found a 0x%08x instead of 0x%08x\n", i, buf[i], ref_buf[i])); Index: sysio_tests.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/sysio_tests.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- sysio_tests.c 14 Feb 2004 19:43:00 -0000 1.5 +++ sysio_tests.c 24 Feb 2004 15:46:33 -0000 1.6 @@ -108,7 +108,7 @@ int sysio_list(char *path) sprintf(output, "%s\n", dp->d_name); cc -= dp->d_reclen; - dp = (void *)dp + dp->d_reclen; + dp = (struct dirent *)((char *)dp + dp->d_reclen); numfiles++; } printf("Out of inner loop\n"); @@ -730,7 +730,7 @@ int sysio_getdirentries(int fd, char *bu dp->d_reclen, (char )dp->d_type)); err -= dp->d_reclen; - dp = (void *)dp + dp->d_reclen; + dp = (struct dirent *)((char *)dp + dp->d_reclen); } my_errno = errno; Index: test_driver.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_driver.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- test_driver.c 14 Feb 2004 19:43:00 -0000 1.7 +++ test_driver.c 24 Feb 2004 15:46:34 -0000 1.8 @@ -904,7 +904,7 @@ int get_constant_val(char **str_ptr, int buf_ptr[j] = '\0'; DBG(3, fprintf(outfp, "Your buffer (%p) (%p) is at index %d\n", - buf, buf->buf, next)); + (void *)buf, buf->buf, next)); next++; last_type = PTR; |