Commit 1e1261a3 authored by Christophe Monniez's avatar Christophe Monniez

Merging upstream version 3.6.15.

parent 96aaf4dd
2011-12-02 Simson Garfinkel <simsong@alphonse-mucha>
* configure.ac: increased version number to 3.6.15
2011-11-26 Simson Garfinkel <simsong@it151636.ern.nps.edu>
* configure.ac: incorporated Greg Freemyer's patch to address some
ncurses problems.
2011-11-24 Simson Garfinkel <slgarfin@submit-0.local>
* lib/utils.h: created virtual destructore
2011-11-21 Simson Garfinkel <simsong@Alphonse-Mucha.local>
* configure.ac: added AC_PROG_CXX
2011-11-18 Simson Garfinkel <simsong@FC15>
* tools/affxml.cpp (main): removed unused bflag variable
* lib/vnode_afd.cpp: max() is now always defined, even on windows.
2011-11-01 Simson Garfinkel <simsong@it150660.ern.nps.edu>
* lib/aftimer.h (aftimer::eta_time): added std:: before string
* configure.ac: updated version counter to 3.6.14
2011-11-01 Simson Garfinkel <slgarfin@submit-0.local>
* lib/utils.h: added virtual destructor for seginfo
2011-09-28 Simson Garfinkel <simsong@arlington-8-30-77-137.ncr.vt.edu>
* configure.ac: incremented version counter to 3.6.13
* lib/afflib_pages.cpp (af_get_pagesize): having af_page_size() as
a macro was causing problems, so now there is both af_page_size
and af_get_pagesize, both of which do the same. Please use af_get_pagesize.
2011-09-27 Simson Garfinkel <simsong@Alphonse-Mucha.local>
* aftimer.h (timestamp): updated aftimer for higher resolution on win32
2011-09-18 Simson Garfinkel <simsong@imac3.home>
* lib/afflib.cpp (af_get_pagesize): created af_get_pagesize, which
for some reason was missing.
* lib/afflib.h: added int af_get_pagesize(AFFILE *af);
2011-05-04 Simson Garfinkel <simsong@alphonse-mucha.home>
* configure.ac: increased version number to 3.6.11, overcomes recent problems.
......
......@@ -140,6 +140,7 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
......@@ -209,7 +210,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
......@@ -563,7 +563,7 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
-find $(distdir) -type d ! -perm -755 -exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -404,6 +404,9 @@
/* Define to 1 if the system has the type `_Bool'. */
#undef HAVE__BOOL
/* Define to 1 if you have the <_mingw.h> header file. */
#undef HAVE__MINGW_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
......
Name: afflib
Version: 3.6.12
Version: 3.6.15
Release: 1
Summary: Library to support the Advanced Forensic Format
Group: System Environment/Libraries
......
This diff is collapsed.
......@@ -4,8 +4,7 @@
# See http://autotoolset.sourceforge.net/tutorial.html
# and http://www.openismus.com/documents/linux/automake/automake.shtml
AC_INIT([AFFLIB],[3.6.12],[bugs@afflib.org])
AC_INIT([AFFLIB],[3.6.15],[bugs@afflib.org])
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
......@@ -19,6 +18,7 @@ AC_PREFIX_PROGRAM
# Programs that we will be using
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
# Turn off shared libraries during beta-testing, since they
......@@ -81,7 +81,7 @@ AC_STRUCT_ST_RDEV
# Specific headers that I plan to use
AC_CHECK_HEADERS([arpa/inet.h assert.h ctype.h dmalloc.h err.h errno.h fcntl.h getopt.h inttypes.h linux/fs.h malloc.h ncurses/term.h netinet/in.h regex.h signal.h stdint.h stdio.h stdlib.h string.h sys/cdefs.h sys/disk.h sys/file.h sys/ioctl.h sys/ioctl.h sys/param.h sys/param.h sys/socket.h sys/signal.h sys/stat.h sys/time.h sys/types.h sys/vfs.h sysexits.h term.h time.h unistd.h zlib.h])
AC_CHECK_HEADERS([arpa/inet.h assert.h ctype.h dmalloc.h err.h errno.h fcntl.h getopt.h inttypes.h linux/fs.h malloc.h ncurses/term.h netinet/in.h regex.h signal.h stdint.h stdio.h stdlib.h string.h sys/cdefs.h sys/disk.h sys/file.h sys/ioctl.h sys/ioctl.h sys/param.h sys/param.h sys/socket.h sys/signal.h sys/stat.h sys/time.h sys/types.h sys/vfs.h sysexits.h term.h time.h unistd.h zlib.h _mingw.h])
AC_CHECK_LIB([regex],[regcomp]) # see if we need -lregex
......@@ -118,6 +118,7 @@ AC_CHECK_LIB([readline],[readline],, AC_MSG_RESULT([readline not installed]))
AC_CHECK_LIB([ncurses],[initscr],, AC_MSG_RESULT([ncurses not installed]))
AC_CHECK_LIB([z],[uncompress],, AC_MSG_ERROR([zlib not installed; cannot continue. Try adding zlib-dev or zlib1g-dev.]))
AC_CHECK_LIB([rt],[aio_error64])
AC_SEARCH_LIBS(tgetent, termlib termcap tinfo curses ncurses)
AC_CHECK_FUNCS(putp tputs tgoto tgetstr tgetnum gotorc beep endwin setupterm printw)
################################################################
......
......@@ -95,6 +95,7 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
......@@ -164,7 +165,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
......
......@@ -208,6 +208,7 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
......@@ -277,7 +278,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
......
......@@ -174,9 +174,9 @@ int af_set_option(AFFILE *af,int option,int value);
/* navigating within the data segments as if they were a single file */
#ifdef _WIN32
SSIZE_T af_read(AFFILE *af,unsigned char *buf,SSIZE_T count);
SSIZE_T af_read(AFFILE *af,unsigned char *buf,SSIZE_T count);
#else
ssize_t af_read(AFFILE *af,unsigned char *buf,ssize_t count);
ssize_t af_read(AFFILE *af,unsigned char *buf,ssize_t count);
#endif
uint64_t af_seek(AFFILE *af,int64_t pos,int whence); // returns new position
uint64_t af_tell(AFFILE *af);
......@@ -198,9 +198,10 @@ const char *af_filename(AFFILE *af); // returns the filename of an open stream.
int af_identify(AFFILE *af); // returns type of AFFILE pointer
/* Accessor Functions */
int64_t af_get_imagesize(AFFILE *af); // byte # of last mapped byte in image, or size of device;
int64_t af_get_imagesize(AFFILE *af); // byte # of last mapped byte in image, or size of device;
// returns -1 if error
int af_set_acquisition_date(AFFILE *af,time_t t); // sets AF_ACQUISITION_DATE
int af_get_pagesize(AFFILE *af); // returns page size, or -1
int af_set_acquisition_date(AFFILE *af,time_t t); // sets AF_ACQUISITION_DATE
#define af_imagesize(af) af_get_imagesize(af) // backwards compatiability
int af_get_segq(AFFILE *af,const char *name,int64_t *quad);/* Get/set 8-byte values */
......
......@@ -126,7 +126,7 @@ void __cdecl AFDbgPrint (PCSTR Format,...);
#endif
#ifdef WIN32
#if !defined(__MINGW_H)
#if !defined(HAVE__MINGW_H)
#pragma warning(disable: 4996) /* Don't warn on Windows about using POSIX open() instead of _open() */
#endif
#include <malloc.h>
......@@ -154,12 +154,12 @@ typedef unsigned short _mode_t;
#define S_ISDIR(m)(((m) & 0170000) == 0040000)
#endif
#if !defined(__MINGW_H)
#if !defined(HAVE__MINGW_H)
#define ftruncate(fd,size) _chsize_s(fd,size)
#define MAXPATHLEN 1024
#endif
#if defined(__MINGW_H)
#if defined(HAVE__MINGW_H)
#ifndef ftello
#define ftello ftello64
#endif
......@@ -252,7 +252,7 @@ void warnx(const char *fmt, ...);
#endif
#if defined(WIN32) && !defined(__MINGW_H)
#if defined(WIN32) && !defined(HAVE__MINGW_H)
/****************************************************************
*** Windows emulation of opendir()/readdir()
*** From php
......@@ -616,7 +616,7 @@ int af_backspace(AFFILE *af); // back up one segment
* Note: pagename to string translation happens inside afflib.cpp, not inside
* the vnode driver.
*/
#define af_page_size(af) (af_get_pagesize(af)) /* backwards compatability */
int af_page_size(AFFILE *af); // legacy (now is af_get_pagesize)
void af_read_sizes(AFFILE *af); // sets up values if we can get them.
int af_set_pagesize(AFFILE *af,uint32_t pagesize); // sets the pagesize; fails with -1 if imagesize >=0
int af_set_sectorsize(AFFILE *AF,int sectorsize); // fails with -1 if imagesize>=0
......
......@@ -99,6 +99,11 @@ int af_page_size(AFFILE *af)
return af->image_pagesize;
}
int af_get_pagesize(AFFILE *af)
{
return af->image_pagesize;
}
/* af_set_sectorsize:
* Sets the sectorsize.
* Fails with -1 if imagesize >=0 unless these changes permitted
......@@ -198,7 +203,7 @@ int af_get_page(AFFILE *af,int64_t pagenum,unsigned char *data,size_t *bytes)
size_t page_len=0;
if (af_trace){
fprintf(af_trace,"af_get_page(%p,pagenum=%"I64d",buf=%p,bytes=%zu)\n",af,pagenum,data,*bytes);
fprintf(af_trace,"af_get_page(%p,pagenum=%"I64d",buf=%p,bytes=%u)\n",af,pagenum,data,(int)*bytes);
}
/* Find out the size of the segment and if it is compressed or not.
......@@ -293,8 +298,8 @@ int af_get_page(AFFILE *af,int64_t pagenum,unsigned char *data,size_t *bytes)
#ifdef USE_LZMA
case AF_PAGE_COMP_ALG_LZMA:
res = lzma_uncompress(data,bytes,compressed_data,compressed_data_len);
if (af_trace) fprintf(af_trace," LZMA decompressed page %"I64d". %zd bytes => %zd bytes\n",
pagenum,compressed_data_len,*bytes);
if (af_trace) fprintf(af_trace," LZMA decompressed page %"I64d". %d bytes => %u bytes\n",
pagenum,(int)compressed_data_len,(int)*bytes);
switch(res){
case 0:break; // OK
case 1:(*af->error_reporter)("LZMA header error decompressing segment %"I64d"\n",pagenum);
......
......@@ -53,6 +53,13 @@
*** Internal Functions.
****************************************************************/
#ifdef _WIN32
#define ASIZE SSIZE_T
#else
#define ASIZE ssize_t
#endif
/*
* af_set_maxsize
* Sets the maxsize.
......@@ -101,12 +108,12 @@ int af_purge(AFFILE *af)
return ret;
}
ssize_t af_read(AFFILE *af,unsigned char *buf,ssize_t count)
extern "C" ASIZE af_read(AFFILE *af,unsigned char *buf,ASIZE count)
{
int total = 0;
AF_WRLOCK(af); // wrlock because cache may change
if (af_trace) fprintf(af_trace,"af_read(%p,%p,%zd) (pos=%"I64d")\n",af,buf,count,af->pos);
if (af_trace) fprintf(af_trace,"af_read(%p,%p,%d) (pos=%"I64d")\n",af,buf,(int)count,af->pos);
if (af->v->read){ // check for bypass
int r = (af->v->read)(af, buf, af->pos, count);
if(r>0) af->pos += r;
......@@ -200,7 +207,7 @@ int af_write(AFFILE *af,unsigned char *buf,size_t count)
{
AF_WRLOCK(af);
if (af_trace){
fprintf(af_trace,"af_write(af=%p,buf=%p,count=%zd) pos=%"I64d"\n", af,buf,count,af->pos);
fprintf(af_trace,"af_write(af=%p,buf=%p,count=%d) pos=%"I64d"\n", af,buf,(int)count,af->pos);
}
/* Invalidate caches */
af_invalidate_vni_cache(af);
......
......@@ -131,8 +131,6 @@ const char *af_hexbuf(char *dst,int dst_len,const unsigned char *bin,int bytes,i
bytes--;
charcount++; // how many characters
bool add_spaces = false;
if(flag & AF_HEXBUF_SPACE2) add_spaces = true;
if((flag & AF_HEXBUF_SPACE4) && charcount%2==0){
*dst++ = ' ';
*dst = '\000';
......
#ifndef __TIMER_H__
#define __TIMER_H__
#ifndef __AFTIMER_H__
#define __AFTIMER_H__
#ifdef __cplusplus
#ifndef WIN32
......@@ -15,44 +14,58 @@
#include <string>
class aftimer {
bool used; // was this timer used?
struct timeval t0;
bool running;
long total_sec;
long total_usec;
double lap_time_; // time from when we last did a "stop"
public:
aftimer();
time_t tstart();
void start();
void stop();
double elapsed_seconds(); //
double lap_time();
aftimer():t0(),running(false),total_sec(0),total_usec(0),lap_time_(0){}
void start(); // start the timer
void stop(); // stop the timer
time_t tstart() { return t0.tv_sec;} // time we started
double elapsed_seconds(); // how long timer has been running, total
double lap_time(); // how long the timer is running this time
double eta(double fraction_done); // calculate ETA in seconds, given fraction
std::string hms(long t); // turn a number of seconds into h:m:s
std::string elapsed_text(); /* how long we have been running */
std::string eta_text(double fraction_done);
std::string eta_text(double fraction_done); // h:m:s
std::string eta_time(double fraction_done); // the actual time
};
inline aftimer::aftimer()
{
running = false;
total_sec = 0;
total_usec = 0;
lap_time_ = 0;
}
/* This code in part from
* http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/430449b3-f6dd-4e18-84de-eebd26a8d668
*/
inline time_t aftimer::tstart()
{
return t0.tv_sec;
}
#ifdef WIN32
# include <winsock2.h>
# include <windows.h>
# ifndef DELTA_EPOCH_IN_MICROSECS
# if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
# define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
# else
# define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
# endif
# endif
#endif
inline void timestamp(struct timeval *t)
{
#ifdef WIN32
t->tv_sec = time(0);
t->tv_usec = 0; /* need to fix */
FILETIME ft;
GetSystemTimeAsFileTime(&ft);
unsigned __int64 tmpres = 0;
tmpres |= ft.dwHighDateTime;
tmpres <<= 32;
tmpres |= ft.dwLowDateTime;
/*converting file time to unix epoch*/
tmpres -= DELTA_EPOCH_IN_MICROSECS;
tmpres /= 10; /*convert into microseconds*/
t->tv_sec = (long)(tmpres / 1000000UL);
t->tv_usec = (long)(tmpres % 1000000UL);
#else
gettimeofday(t,NULL);
#endif
......@@ -121,14 +134,20 @@ inline std::string aftimer::elapsed_text()
return hms((int)elapsed_seconds());
}
/**
* returns the number of seconds until the job is complete.
*/
inline double aftimer::eta(double fraction_done)
{
double t = elapsed_seconds();
if(t==0) return -1; // can't figure it out
if(fraction_done==0) return -1; // can't figure it out
if(t<=0) return -1; // can't figure it out
if(fraction_done<=0) return -1; // can't figure it out
return (t * 1.0/fraction_done - t);
}
/**
* Retuns the number of hours:minutes:seconds until the job is done.
*/
inline std::string aftimer::eta_text(double fraction_done)
{
double e = eta(fraction_done);
......@@ -136,6 +155,24 @@ inline std::string aftimer::eta_text(double fraction_done)
return hms((long)e);
}
/**
* Returns the time when data is due.
*/
inline std::string aftimer::eta_time(double fraction_done)
{
time_t when = time_t(eta(fraction_done)) + time(0);
struct tm tm;
#ifdef HAVE_LOCALTIME_R
localtime_r(&when,&tm);
#else
tm = *localtime(&when);
#endif
char buf[64];
snprintf(buf,sizeof(buf),"%02d:%02d:%02d",tm.tm_hour,tm.tm_min,tm.tm_sec);
return std::string(buf);
}
#endif
#endif
......@@ -15,7 +15,6 @@ extern "C" {
#include "LzmaRamDecode.h"
}
class CInMemoryStream: public ISequentialInStream, public CMyUnknownImp {
public:
const unsigned char *buf;
......
......@@ -62,6 +62,7 @@ namespace aff {
bool inline operator==(const class seginfo &b) const {
return name == b.name;
}
virtual ~seginfo(){};
};
/* the seglist provides AFF internal functions and tools an easy way to get
......@@ -75,6 +76,7 @@ namespace aff {
bool has_signed_segments();
int get_seglist(AFFILE *af);
seglist(){}
virtual ~seglist(){}
seglist(AFFILE *af){
get_seglist(af);
}
......
......@@ -19,7 +19,7 @@
#endif
#if defined(WIN32) and !defined(__MINGW_H)
#if defined(WIN32) and !defined(HAVE__MINGW_H)
/**********************************************************************
* Implement dirent-style opendir/readdir/rewinddir/closedir on Win32
*
......@@ -418,7 +418,7 @@ static int afd_close(AFFILE *af)
}
#ifndef WIN32
#if !defined(WIN32) || defined(HAVE__MINGW_H)
static uint64_t max(uint64_t a,uint64_t b)
{
return a > b ? a : b;
......
......@@ -45,7 +45,7 @@ static int aff_write_ignore2(AFFILE *af,size_t bytes)
#ifdef KERNEL_LIBRARY
aff_write_seg_no_data(af,AF_IGNORE,0,bytes);
#else
if(af_trace) fprintf(af_trace,"aff_write_ignore2(%p,%zd)\n",af,bytes);
if(af_trace) fprintf(af_trace,"aff_write_ignore2(%p,%d)\n",af,(int)bytes);
unsigned char *invalidate_data = (unsigned char *)calloc(bytes,1);
aff_write_seg(af,AF_IGNORE,0,invalidate_data,bytes); // overwrite with NULLs
free(invalidate_data);
......@@ -58,7 +58,7 @@ static int aff_write_ignore(AFFILE *af,size_t bytes)
int64_t startpos = ftello(af->aseg); // remember start position
int r = 0;
if(af_trace) fprintf(af_trace,"aff_write_ignore(%p,%zd)\n",af,bytes);
if(af_trace) fprintf(af_trace,"aff_write_ignore(%p,%d)\n",af,(int)bytes);
/* First write the ignore */
r = aff_write_ignore2(af,bytes);
......@@ -110,8 +110,8 @@ static int aff_write_ignore(AFFILE *af,size_t bytes)
int aff_write_seg(AFFILE *af, const char *segname,uint32_t arg,const u_char *data,size_t datalen)
{
if(af_trace) fprintf(af_trace,"aff_write_seg(%p,%s,%"PRIu32",%p,len=%zu)\n",
af,segname,arg,data,datalen);
if(af_trace) fprintf(af_trace,"aff_write_seg(%p,%s,%"PRIu32",%p,len=%u)\n",
af,segname,arg,data,(int)datalen);
struct af_segment_head segh;
struct af_segment_tail segt;
......@@ -140,8 +140,8 @@ int aff_write_seg(AFFILE *af, const char *segname,uint32_t arg,const u_char *dat
aff_toc_update(af,segname,ftello(af->aseg),datalen);
if(af_trace) fprintf(af_trace,"aff_write_seg: putting segment %s (datalen=%zd) offset=%"PRId64"\n",
segname,datalen,ftello(af->aseg));
if(af_trace) fprintf(af_trace,"aff_write_seg: putting segment %s (datalen=%d) offset=%"PRId64"\n",
segname,(int)datalen,ftello(af->aseg));
if(fwrite(&segh,sizeof(segh),1,af->aseg)!=1) return -10;
if(fwrite(segname,1,segname_len,af->aseg)!=segname_len) return -11;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -98,6 +98,7 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
......@@ -167,7 +168,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
......
......@@ -100,6 +100,7 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
......@@ -169,7 +170,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
......
......@@ -127,6 +127,7 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
......@@ -196,7 +197,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
......
......@@ -95,6 +95,7 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
......@@ -164,7 +165,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
......
......@@ -196,6 +196,7 @@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
......@@ -265,7 +266,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
......
......@@ -195,7 +195,7 @@ int afcat(AFFILE *af)
}
int count = fwrite(data,1,datalen,stdout);
if(count!=(ssize_t)datalen){
fprintf(stderr,"fwrite(buf,1,%zd,outfile) only wrote %d bytes\n",datalen,count);
fprintf(stderr,"fwrite(buf,1,%d,outfile) only wrote %d bytes\n",(int)datalen,count);
}
free(data);
return 0;
......@@ -331,13 +331,12 @@ int64_t atoi64(const char *buf)
int main(int argc,char **argv)
{
int bflag, ch;
int ch;
#ifdef SIGINFO
signal(SIGINFO,sig_info);
#endif
bflag = 0;
while ((ch = getopt(argc, argv, "s:S:p:lLh?dqnvr:")) != -1) {
switch (ch) {
case 's':
......
......@@ -339,7 +339,7 @@ int compare_aff_data_segments(char *title,AFFILE *af1,AFFILE *af2,int64_t pagen
err(1,"Cannot read page %"I64d" from %s",pagenum,af_filename(af2));
if(data1_len != data2_len){
printf("page %"I64d" size %zd != size %zd\n",pagenum,data1_len,data2_len);
printf("page %"I64d" size %d != size %d\n",pagenum,(int)data1_len,(int)data2_len);
return 1;
}
......@@ -748,14 +748,13 @@ int recurse(const char *dir1,const char *dir2)
int main(int argc,char **argv)
{
int bflag, ch;
int ch;
int opt_recurse=0;
#ifdef SIGINFO
signal(SIGINFO,sig_info);
#endif
bflag = 0;
while ((ch = getopt(argc, argv, "P:Vabcempqrsh?v")) != -1) {
switch (ch) {
case 'P': opt_page = atoi(optarg); break;
......@@ -786,7 +785,7 @@ int main(int argc,char **argv)
recurse(dir1,dir2);
if(errors.size()>0){
fprintf(stderr,"================================\n");
fprintf(stderr,"%zd affcompare errors:\n",errors.size());
fprintf(stderr,"%d affcompare errors:\n",(int)errors.size());
for(vector<string>::const_iterator i=errors.begin();
i!=errors.end();
i++){
......
......@@ -550,11 +550,13 @@ int convert(const char *infile,char *outfile)
}
/* Make a copy of the a_out filename if we can get it */
#ifdef HAVE_UTIMES
char *a_out_fn=0; // output filename, to remember for utimes
const char *a_ = af_filename(a_out); // remember the output filename
if(a_){
a_out_fn = strdup(a_); // make a copy of it
}
#endif
if(af_close(a_out)) err(1,"af_close(a_out)");
if(!opt_quiet){
......
......@@ -291,7 +291,7 @@ void list_openssl_hashes()
int main(int argc,char **argv)
{
int bflag, ch;
int ch;
const char *old_passphrase=0;
const char *new_passphrase=0;
const char *check_passphrase = 0;
......@@ -319,7 +319,6 @@ int main(int argc,char **argv)
#endif
}
bflag = 0;
int opt_change = 0;
const char *home = getenv("HOME");
......
......@@ -445,7 +445,7 @@ void print_info(AFFILE *af,const char *segname)
memset(output_line,0,sizeof(output_line));
/* Now append the arg and the data len */
sprintf(output_line,"%-24s %8"PRIu32" %8zd ",segname,arg,data_len);
sprintf(output_line,"%-24s %8"PRIu32" %8d ",segname,arg,(int)data_len);
if(opt_no_preview){
printf("%s\n",output_line);
......
......@@ -232,12 +232,11 @@ int fix(const char *infile)
int main(int argc,char **argv)
{
int bflag, ch;
int ch;
setvbuf(stdout,0,_IONBF,0); // turn off buffering
/* Figure out how many cols the screen has... */
bflag = 0;
while ((ch = getopt(argc, argv, "yh?v")) != -1) {
switch (ch) {
case 'y':
......
......@@ -4,6 +4,11 @@
* Verify the digital signature on a signed file
*/
#ifdef WIN32
# include <winsock2.h>
# include <windows.h>
#endif
#include "affconfig.h"
#include "afflib.h"
#include "afflib_i.h"
......@@ -509,9 +514,8 @@ int process(const char *fn)
int main(int argc,char **argv)
{
int bflag, ch;
int ch;
bflag = 0;
while ((</