Ignore:
Timestamp:
Mar 2, 2008, 12:29:06 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • Fix almost 2,000 warnings by using proper "const" keywords where needed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/nfclient.cpp

    r17 r39  
    2929  int offset;
    3030  public :
    31   nfs_file(char *filename, char *mode);
     31  nfs_file(char const *filename, char const *mode);
    3232  virtual int open_failure();
    3333  virtual int unbuffered_read(void *buf, size_t count);       // returns number of bytes read
    3434  int new_read(void *buf, size_t count);       // returns number of bytes read
    35   virtual int unbuffered_write(void *buf, size_t count);      // returns number of bytes written
     35  virtual int unbuffered_write(void const *buf, size_t count);      // returns number of bytes written
    3636  virtual int unbuffered_seek(long offset, int whence);  // whence=SEEK_SET, SEEK_CUR, SEEK_END, ret=0=success
    3737  virtual int unbuffered_tell();
     
    4040} ;
    4141
    42 bFILE *open_nfs_file(char *filename,char *mode)
     42bFILE *open_nfs_file(char const *filename, char const *mode)
    4343{
    4444  return new nfs_file(filename,mode);
     
    4646
    4747
    48 nfs_file::nfs_file(char *filename, char *mode)
     48nfs_file::nfs_file(char const *filename, char const *mode)
    4949{
    5050  local=NULL;
     
    5252
    5353  int local_only=0;
    54   char *s=mode;
     54  char const *s=mode;
    5555  for (;*s;s++)    // check to see if writeable file, if so don't go through nfs
    5656    if (*s=='w' || *s=='W' || *s=='a' || *s=='A')
    5757      local_only=1;
    5858
    59   char name[256],*c,*f=filename;
    60   c=name;
     59  char name[256], *c;
     60  char const *f = filename;
     61  c = name;
    6162  while (*f) { *c=*(f++); *c=toupper(*c); c++; } *c=0;
    6263  if (strstr(name,"REGISTER"))
     
    6667  {
    6768    int fail1,fail2,fail3=0;
    68     char *local_filename=filename;
     69    char const *local_filename = filename;
    6970    if (filename[0]=='/' && filename[1]=='/')
    7071    { local_filename+=2;
     
    144145}
    145146
    146 int nfs_file::unbuffered_write(void *buf, size_t count)      // returns number of bytes written
     147int nfs_file::unbuffered_write(void const *buf, size_t count)      // returns number of bytes written
    147148{
    148149  if (local)
     
    216217
    217218
    218 int set_file_server(char *name)
     219int set_file_server(char const *name)
    219220{
    220221  if (prot)
Note: See TracChangeset for help on using the changeset viewer.