Update of /cvsroot/linux-decnet/dnprogs/dncopy
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv7789/dncopy
Modified Files:
dncopy.cc dnetfile.cc dnetfile.h dnetfile_dap.cc file.h
unixfile.cc unixfile.h
Log Message:
Add some consts to get rid of compiler warnings.
Index: dncopy.cc
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dncopy.cc,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** dncopy.cc 4 Dec 2006 15:29:18 -0000 1.11
--- dncopy.cc 7 Dec 2007 11:05:02 -0000 1.12
***************
*** 34,38 ****
// Prototypes
static void usage(char *name, int dntype, FILE *f);
! static file *getFile(char *name, int verbosity);
static void get_env_as_args(char **argv[], int &argc, char *env);
static void do_options(int argc, char *argv[],
--- 34,38 ----
// Prototypes
static void usage(char *name, int dntype, FILE *f);
! static file *getFile(const char *name, int verbosity);
static void get_env_as_args(char **argv[], int &argc, char *env);
static void do_options(int argc, char *argv[],
***************
*** 389,393 ****
// Run through the file types and return an object that matches the
// type of the name we were passed.
! static file *getFile(char *name, int verbosity)
{
if (dnetfile::isMine(name))
--- 389,393 ----
// Run through the file types and return an object that matches the
// type of the name we were passed.
! static file *getFile(const char *name, int verbosity)
{
if (dnetfile::isMine(name))
Index: dnetfile.cc
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dnetfile.cc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** dnetfile.cc 4 Dec 2006 15:29:18 -0000 1.8
--- dnetfile.cc 7 Dec 2007 11:05:02 -0000 1.9
***************
*** 31,35 ****
// Assume the file name is a DECnet name if it has two consecutive colons in it
! bool dnetfile::isMine(char *name)
{
if (strstr(name, "::"))
--- 31,35 ----
// Assume the file name is a DECnet name if it has two consecutive colons in it
! bool dnetfile::isMine(const char *name)
{
if (strstr(name, "::"))
***************
*** 40,44 ****
// Constructor.
! dnetfile::dnetfile(char *n, int verbosity):
conn(verbosity)
{
--- 40,44 ----
// Constructor.
! dnetfile::dnetfile(const char *n, int verbosity):
conn(verbosity)
{
***************
*** 113,117 ****
// Open a file for writing
! int dnetfile::open(char *filename,char *mode)
{
// Add the remote end's directory spec to the filename.
--- 113,117 ----
// Open a file for writing
! int dnetfile::open(const char *filename, const char *mode)
{
// Add the remote end's directory spec to the filename.
***************
*** 122,126 ****
// Open a file already named
! int dnetfile::open(char *mode)
{
int real_rfm, real_rat;
--- 122,126 ----
// Open a file already named
! int dnetfile::open(const char *mode)
{
int real_rfm, real_rat;
***************
*** 296,300 ****
}
! void dnetfile::perror(char *msg)
{
if (lasterror)
--- 296,300 ----
}
! void dnetfile::perror(const char *msg)
{
if (lasterror)
***************
*** 397,401 ****
// Return a string telling the user whether we transferred blocks or
// records or what.
! char *dnetfile::get_format_name()
{
switch (transfer_mode)
--- 397,401 ----
// Return a string telling the user whether we transferred blocks or
// records or what.
! const char *dnetfile::get_format_name()
{
switch (transfer_mode)
Index: dnetfile.h
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dnetfile.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** dnetfile.h 10 Mar 2006 08:13:16 -0000 1.5
--- dnetfile.h 7 Dec 2007 11:05:02 -0000 1.6
***************
*** 6,28 ****
// Is this one of my filenames?
! static bool isMine(char *name);
// Constructor and destructor
! dnetfile(char *name, int verbosity);
~dnetfile();
// Stuff overriden from file.
virtual int setup_link(unsigned int bufsize, int rfm, int rat, int xfer_mode, int flags);
! virtual int open(char *mode);
! virtual int open(char *basename, char *mode);
virtual int close();
virtual int read(char *buf, int len);
virtual int write(char *buf, int len);
virtual int next();
! virtual void perror(char *);
virtual char *get_basename(int keep_version);
virtual char *get_printname();
virtual char *get_printname(char *filename);
! virtual char *get_format_name();
virtual int get_umask();
virtual int set_umask(int mask);
--- 6,28 ----
// Is this one of my filenames?
! static bool isMine(const char *name);
// Constructor and destructor
! dnetfile(const char *name, int verbosity);
~dnetfile();
// Stuff overriden from file.
virtual int setup_link(unsigned int bufsize, int rfm, int rat, int xfer_mode, int flags);
! virtual int open(const char *mode);
! virtual int open(const char *basename, const char *mode);
virtual int close();
virtual int read(char *buf, int len);
virtual int write(char *buf, int len);
virtual int next();
! virtual void perror(const char *);
virtual char *get_basename(int keep_version);
virtual char *get_printname();
virtual char *get_printname(char *filename);
! virtual const char *get_format_name();
virtual int get_umask();
virtual int set_umask(int mask);
***************
*** 46,50 ****
bool isOpen; // Set when we have an open connection
bool writing; // if FALSE then we are reading.
! char *lasterror;
char errstring[80];
int verbose;
--- 46,50 ----
bool isOpen; // Set when we have an open connection
bool writing; // if FALSE then we are reading.
! const char *lasterror;
char errstring[80];
int verbose;
Index: dnetfile_dap.cc
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dnetfile_dap.cc,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** dnetfile_dap.cc 4 Dec 2006 15:29:18 -0000 1.13
--- dnetfile_dap.cc 7 Dec 2007 11:05:02 -0000 1.14
***************
*** 402,406 ****
int code = sm->get_code() & 0xFF;
int maccode = sm->get_code() >> 12;
! char *err = sm->get_message();
if (verbose > 1)
--- 402,406 ----
int code = sm->get_code() & 0xFF;
int maccode = sm->get_code() >> 12;
! const char *err = sm->get_message();
if (verbose > 1)
Index: file.h
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/file.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** file.h 10 Mar 2006 08:13:16 -0000 1.4
--- file.h 7 Dec 2007 11:05:02 -0000 1.5
***************
*** 19,33 ****
virtual int setup_link(unsigned int bufsize, int rfm, int rat, int xfer_mode, int flags) = 0;
! virtual int open(char *mode) = 0;
! virtual int open(char *basename, char *mode) = 0;
virtual int close() = 0;
virtual int read(char *buf, int len) = 0;
virtual int write(char *buf, int len) = 0;
virtual int next() = 0;
! virtual void perror(char *) = 0;
virtual char *get_basename(int keep_version) = 0;
virtual char *get_printname() = 0;
virtual char *get_printname(char *filename) = 0;
! virtual char *get_format_name() = 0;
virtual int get_umask() = 0;
virtual int set_umask(int mask) = 0;
--- 19,33 ----
virtual int setup_link(unsigned int bufsize, int rfm, int rat, int xfer_mode, int flags) = 0;
! virtual int open(const char *mode) = 0;
! virtual int open(const char *basename, const char *mode) = 0;
virtual int close() = 0;
virtual int read(char *buf, int len) = 0;
virtual int write(char *buf, int len) = 0;
virtual int next() = 0;
! virtual void perror(const char *) = 0;
virtual char *get_basename(int keep_version) = 0;
virtual char *get_printname() = 0;
virtual char *get_printname(char *filename) = 0;
! virtual const char *get_format_name() = 0;
virtual int get_umask() = 0;
virtual int set_umask(int mask) = 0;
Index: unixfile.cc
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/unixfile.cc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** unixfile.cc 1 Sep 2005 08:34:39 -0000 1.4
--- unixfile.cc 7 Dec 2007 11:05:02 -0000 1.5
***************
*** 25,29 ****
extern "C" char *basename(const char *);
! int unixfile::open(char *mode)
{
--- 25,29 ----
extern "C" char *basename(const char *);
! int unixfile::open(const char *mode)
{
***************
*** 51,55 ****
// This open routine is called when the output file is a directory (ie a
// copy from multiple sources) so we don't need to check for stdin/out.
! int unixfile::open(char *basename, char *mode)
{
strcpy(printname, filename);
--- 51,55 ----
// This open routine is called when the output file is a directory (ie a
// copy from multiple sources) so we don't need to check for stdin/out.
! int unixfile::open(const char *basename, const char *mode)
{
strcpy(printname, filename);
***************
*** 159,163 ****
}
! void unixfile::perror(char *msg)
{
::perror(msg);
--- 159,163 ----
}
! void unixfile::perror(const char *msg)
{
::perror(msg);
***************
*** 229,233 ****
// Return a string telling the user whether we transferred blocks or
// records or what.
! char *unixfile::get_format_name()
{
--- 229,233 ----
// Return a string telling the user whether we transferred blocks or
// records or what.
! const char *unixfile::get_format_name()
{
***************
*** 275,279 ****
}
! unixfile::unixfile(char *name)
{
strcpy(filename, name);
--- 275,279 ----
}
! unixfile::unixfile(const char *name)
{
strcpy(filename, name);
Index: unixfile.h
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/unixfile.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** unixfile.h 1 Sep 2005 08:34:39 -0000 1.2
--- unixfile.h 7 Dec 2007 11:05:03 -0000 1.3
***************
*** 3,7 ****
{
public:
! unixfile(char *name);
unixfile();
~unixfile();
--- 3,7 ----
{
public:
! unixfile(const char *name);
unixfile();
~unixfile();
***************
*** 9,23 ****
virtual int setup_link(unsigned int bufsize, int rfm, int rat, int xfer_mode, int flags);
! virtual int open(char *mode);
! virtual int open(char *basename, char *mode);
virtual int close();
virtual int read(char *buf, int len);
virtual int write(char *buf, int len);
virtual int next();
! virtual void perror(char *);
virtual char *get_basename(int keep_version);
virtual char *get_printname();
virtual char *get_printname(char *filename);
! virtual char *get_format_name();
virtual int get_umask();
virtual int set_umask(int mask);
--- 9,23 ----
virtual int setup_link(unsigned int bufsize, int rfm, int rat, int xfer_mode, int flags);
! virtual int open(const char *mode);
! virtual int open(const char *basename, const char *mode);
virtual int close();
virtual int read(char *buf, int len);
virtual int write(char *buf, int len);
virtual int next();
! virtual void perror(const char *);
virtual char *get_basename(int keep_version);
virtual char *get_printname();
virtual char *get_printname(char *filename);
! virtual const char *get_format_name();
virtual int get_umask();
virtual int set_umask(int mask);
|