Changeset 1730 for zzuf


Ignore:
Timestamp:
Feb 1, 2007, 7:19:03 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Fixed a few 64-bit issues reported by MSVC.
  • More Win32 portability fixes.
Location:
zzuf/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/configure.ac

    r1728 r1730  
    2828AC_SUBST(DLL_LDFLAGS)
    2929
    30 AC_CHECK_HEADERS(windows.h winsock2.h io.h unistd.h inttypes.h stdint.h getopt.h libc.h malloc.h dlfcn.h regex.h sys/socket.h sys/uio.h aio.h sys/mman.h sys/wait.h sys/resource.h sys/time.h)
     30AC_CHECK_HEADERS(windows.h winsock2.h io.h process.h unistd.h inttypes.h stdint.h getopt.h libc.h malloc.h dlfcn.h regex.h sys/socket.h sys/uio.h aio.h sys/mman.h sys/wait.h sys/resource.h sys/time.h)
    3131
    3232AC_CHECK_FUNCS(setenv waitpid setrlimit gettimeofday fork kill pipe _pipe)
  • zzuf/trunk/msvc/config.h

    r1729 r1730  
    2222#define HAVE_WINSOCK2_H 1
    2323#define HAVE_IO_H 1
     24#define HAVE_PROCESS_H 1
     25
     26#define HAVE__PIPE
    2427
    2528/* Win32-specific, of course. */
     
    3437
    3538typedef unsigned long int uintptr_t;
    36 typedef long int intptr_t;
    3739typedef int pid_t;
    3840
  • zzuf/trunk/src/debug.c

    r1728 r1730  
    3030#if defined HAVE_UNISTD_H
    3131#   include <unistd.h>
     32#endif
     33#if defined HAVE_IO_H
     34#   include <io.h>
    3235#endif
    3336#include <errno.h>
  • zzuf/trunk/src/fd.c

    r1719 r1730  
    5151{
    5252    int managed, locked;
    53     uint64_t pos;
     53    int64_t pos;
    5454    /* Public stuff */
    5555    struct fuzz fuzz;
     
    312312}
    313313
    314 long int _zz_getpos(int fd)
     314int64_t _zz_getpos(int fd)
    315315{
    316316    if(fd < 0 || fd >= maxfd || fds[fd] == -1)
     
    320320}
    321321
    322 void _zz_setpos(int fd, long int pos)
     322void _zz_setpos(int fd, int64_t pos)
    323323{
    324324    if(fd < 0 || fd >= maxfd || fds[fd] == -1)
     
    328328}
    329329
    330 void _zz_addpos(int fd, long int off)
     330void _zz_addpos(int fd, int64_t off)
    331331{
    332332    if(fd < 0 || fd >= maxfd || fds[fd] == -1)
  • zzuf/trunk/src/fd.h

    r1694 r1730  
    3333extern void _zz_unlock(int);
    3434extern int _zz_islocked(int);
    35 extern long int _zz_getpos(int);
    36 extern void _zz_setpos(int, long int);
    37 extern void _zz_addpos(int, long int);
     35extern int64_t _zz_getpos(int);
     36extern void _zz_setpos(int, int64_t);
     37extern void _zz_addpos(int, int64_t);
    3838extern struct fuzz *_zz_getfuzz(int);
    3939
  • zzuf/trunk/src/fuzz.c

    r1720 r1730  
    112112void _zz_fuzz(int fd, volatile uint8_t *buf, uint64_t len)
    113113{
    114     uint64_t start, stop;
     114    int64_t start, stop;
     115    int64_t pos = _zz_getpos(fd);
    115116    struct fuzz *fuzz;
    116117    volatile uint8_t *aligned_buf;
    117     unsigned long int pos = _zz_getpos(fd);
    118     unsigned int i, j, todo;
     118    int i, j, todo;
    119119
    120120#if 0
    121     debug("fuzz(%i, %lli@%li)", fd, (unsigned long long int)len,
    122           (unsigned long int)pos);
     121    debug("fuzz(%i, %lli@%lli)", fd, (long long int)len,
     122          (long long int)pos);
    123123#endif
    124124
     
    160160        for(j = start; j < stop; j++)
    161161        {
    162             unsigned int *r;
     162            int *r;
    163163            uint8_t byte, fuzzbyte;
    164164
  • zzuf/trunk/src/lib-mem.c

    r1728 r1730  
    101101#define DUMMY_BYTES 655360 /* 640 kB ought to be enough for anybody */
    102102static uint64_t dummy_buffer[DUMMY_BYTES / 8];
    103 static int dummy_offset = 0;
     103static int64_t dummy_offset = 0;
    104104#define DUMMY_START ((uintptr_t)dummy_buffer)
    105105#define DUMMY_STOP ((uintptr_t)dummy_buffer + DUMMY_BYTES)
  • zzuf/trunk/src/lib-stream.c

    r1728 r1730  
    224224size_t NEW(fread)(void *ptr, size_t size, size_t nmemb, FILE *stream)
    225225{
    226     long int pos;
    227 #if defined HAVE___SREFILL /* Don't fuzz or seek if we have __srefill() */
    228 #else
    229     long int newpos;
     226    int64_t pos;
     227#if defined HAVE___SREFILL /* Don't fuzz or seek if we have __srefill() */
     228#else
     229    int64_t newpos;
    230230#endif
    231231    size_t ret;
  • zzuf/trunk/src/libzzuf.c

    r1728 r1730  
    2727#if defined HAVE_WINDOWS_H
    2828#   include <windows.h>
     29#endif
     30#if defined HAVE_PROCESS_H
     31#   include <process.h>
    2932#endif
    3033#include <stdio.h>
Note: See TracChangeset for help on using the changeset viewer.