ahh, the joy of deleting large chunks of code that someone else has
authorAndrew Tridgell <tridge@samba.org>
Sat, 5 Sep 1998 05:23:29 +0000 (05:23 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sat, 5 Sep 1998 05:23:29 +0000 (05:23 +0000)
painstakingly put in :)

This gets rid of most of the #ifdef LARGE_SMB_INO_T ifdefs around
DEBUG() statements. We just use %.0f in all cases. Makes the code a
bit easier to read :)

source/client/client.c
source/lib/util.c
source/locking/locking.c
source/locking/shmem.c
source/smbd/trans2.c

index 0d1fe6721cb9bf4c4b708bd267910f1d695ad0e8..e08beeb68531e012d05c89344e3132c8222c9c61 100644 (file)
@@ -466,19 +466,11 @@ static void display_finfo(file_info *finfo)
 {
   if (do_this_one(finfo)) {
     time_t t = finfo->mtime; /* the time is assumed to be passed as GMT */
-#ifdef LARGE_SMB_OFF_T
     DEBUG(0,("  %-30s%7.7s%.0f  %s",
        CNV_LANG(finfo->name),
           attrib_string(finfo->mode),
           (double)finfo->size,
           asctime(LocalTime(&t))));
-#else /* LARGE_SMB_OFF_T */
-    DEBUG(0,("  %-30s%7.7s%10d  %s",
-          CNV_LANG(finfo->name),
-          attrib_string(finfo->mode),
-          (int)finfo->size,
-          asctime(LocalTime(&t))));
-#endif /* LARGE_SMB_OFF_T */
     dir_total += finfo->size;
   }
 }
@@ -1202,17 +1194,10 @@ static void do_get(char *rname,char *lname,file_info *finfo1)
     }
 
 
-#ifdef LARGE_SMB_OFF_T
   DEBUG(2,("getting file %s of size %.0f bytes as %s ",
           CNV_LANG(finfo.name),
           (double)finfo.size,
           lname));
-#else /* LARGE_SMB_OFF_T */
-  DEBUG(2,("getting file %s of size %d bytes as %s ",
-          CNV_LANG(finfo.name),
-          (int)finfo.size,
-          lname));
-#endif /* LARGE_SMB_OFF_T */
 
   while (nread < finfo.size && !close_done)
     {
@@ -1221,12 +1206,7 @@ static void do_get(char *rname,char *lname,file_info *finfo1)
 
       p=NULL;
       
-#ifdef LARGE_SMB_OFF_T
       DEBUG(3,("nread=%d max_xmit=%d fsize=%.0f\n",nread,max_xmit,(double)finfo.size));
-#else /* LARGE_SMB_OFF_T */
-      DEBUG(3,("nread=%d max_xmit=%d fsize=%d\n",nread,max_xmit,
-              (int)finfo.size));
-#endif /* LARGE_SMB_OFF_T */
 
       /* 3 possible read types. readbraw if a large block is required.
         readX + close if not much left and read if neither is supported */
@@ -1904,12 +1884,7 @@ static void do_put(char *rname,char *lname,file_info *finfo)
   if (finfo->size < 0)
     finfo->size = file_size(lname);
   
-#ifdef LARGE_SMB_OFF_T
   DEBUG(1,("putting file %s of size %.0f bytes as %s ",lname,(double)finfo->size,CNV_LANG(rname)));
-#else /* LARGE_SMB_OFF_T */
-  DEBUG(1,("putting file %s of size %d bytes as %s ",lname,
-          (int)finfo->size,CNV_LANG(rname)));
-#endif /* LARGE_SMB_OFF_T */
   
   if (!maxwrite)
     maxwrite = writebraw_supported?MAX(max_xmit,BUFFER_SIZE):(max_xmit-200);
index ad84b17943b9d51957baa421607f275c35f4cbe6..56d2aec9cbddaca269e6df9ec6b166b940fe3a18 100644 (file)
@@ -2039,11 +2039,7 @@ SMB_OFF_T transfer_file(int infd,int outfd,SMB_OFF_T n,char *header,int headlen,
   char *buf1,*abuf;
   SMB_OFF_T total = 0;
 
-#ifdef LARGE_SMB_OFF_T
   DEBUG(4,("transfer_file n=%.0f  (head=%d) called\n",(double)n,headlen));
-#else /* LARGE_SMB_OFF_T */
-  DEBUG(4,("transfer_file n=%d  (head=%d) called\n",(int)n,headlen));
-#endif /* LARGE_SMB_OFF_T */
 
   if (size == 0) {
     size = lp_readsize();
@@ -4508,11 +4504,7 @@ BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
     }
   }
 
-#ifdef LARGE_SMB_OFF_T
   DEBUG(8,("fcntl_lock %d %d %.0f %.0f %d\n",fd,op,(double)offset,(double)count,type));
-#else
-  DEBUG(8,("fcntl_lock %d %d %d %d %d\n",fd,op,(int)offset,(int)count,type));
-#endif
 
   lock.l_type = type;
   lock.l_whence = SEEK_SET;
@@ -4546,13 +4538,8 @@ BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
   /* a lock set or unset */
   if (ret == -1)
   {
-#ifdef LARGE_SMB_OFF_T
     DEBUG(3,("lock failed at offset %.0f count %.0f op %d type %d (%s)\n",
           (double)offset,(double)count,op,type,strerror(errno)));
-#else
-    DEBUG(3,("lock failed at offset %d count %d op %d type %d (%s)\n",
-            (int)offset,(int)count,op,type,strerror(errno)));
-#endif
 
     /* perhaps it doesn't support this sort of locking?? */
     if (errno == EINVAL)
index bd484a18b664b204a60c419e142f9b3922e47b72..f088720e0a08e46c5238273c110345081cf52f3d 100644 (file)
@@ -109,13 +109,8 @@ BOOL do_lock(files_struct *fsp,connection_struct *conn,
     return False;
   }
 
-#ifdef LARGE_SMB_OFF_T
   DEBUG(10,("do_lock: lock type %d start=%.0f len=%.0f requested for file %s\n",
         lock_type, (double)offset, (double)count, fsp->fsp_name ));
-#else /* LARGE_SMB_OFF_T */
-  DEBUG(10,("do_lock: lock type %d start=%d len=%d requested for file %s\n",
-        lock_type, (int)offset, (int)count, fsp->fsp_name ));
-#endif /* LARGE_SMB_OFF_T */
 
   if (OPEN_FSP(fsp) && fsp->can_lock && (fsp->conn == conn))
     ok = fcntl_lock(fsp->fd_ptr->fd,SMB_F_SETLK,offset,count,
@@ -141,13 +136,8 @@ BOOL do_unlock(files_struct *fsp,connection_struct *conn,
   if (!lp_locking(SNUM(conn)))
     return(True);
 
-#ifdef LARGE_SMB_OFF_T
   DEBUG(10,("do_unlock: unlock start=%.0f len=%.0f requested for file %s\n",
         (double)offset, (double)count, fsp->fsp_name ));
-#else
-  DEBUG(10,("do_unlock: unlock start=%d len=%d requested for file %s\n",
-        (int)offset, (int)count, fsp->fsp_name ));
-#endif
 
   if (OPEN_FSP(fsp) && fsp->can_lock && (fsp->conn == conn))
     ok = fcntl_lock(fsp->fd_ptr->fd,SMB_F_SETLK,offset,count,F_UNLCK);
index d8ef1d2c53a6427ef5baa2d3348af097eec012eb..f1c985881b5d8ecfee7036adfdd91ac75c85dc1b 100644 (file)
@@ -339,13 +339,8 @@ static BOOL smb_shm_register_process(char *processreg_file, pid_t pid, BOOL *oth
         else
         {
            /* erase old pid */
-#ifdef LARGE_SMB_OFF_T
             DEBUG(5,("smb_shm_register_process : erasing stale record for pid %d (seek_back = %.0f)\n",
                       (int)other_pid, (double)seek_back));
-#else
-            DEBUG(5,("smb_shm_register_process : erasing stale record for pid %d (seek_back = %d)\n",
-                      (int)other_pid, (int)seek_back));
-#endif
            other_pid = (pid_t)0;
            erased_slot = sys_lseek(smb_shm_processes_fd, seek_back, SEEK_CUR);
            write(smb_shm_processes_fd, &other_pid, sizeof(other_pid));
@@ -367,13 +362,8 @@ static BOOL smb_shm_register_process(char *processreg_file, pid_t pid, BOOL *oth
    if(free_slot < 0)
       free_slot = sys_lseek(smb_shm_processes_fd, 0, SEEK_END);
 
-#ifdef LARGE_SMB_OFF_T
    DEBUG(5,("smb_shm_register_process : writing record for pid %d at offset %.0f\n",
          (int)pid, (double)free_slot));
-#else /* LARGE_SMB_OFF_T */
-   DEBUG(5,("smb_shm_register_process : writing record for pid %d at offset %d\n",
-         (int)pid,(int)free_slot));
-#endif /* LARGE_SMB_OFF_T */
 
    sys_lseek(smb_shm_processes_fd, free_slot, SEEK_SET);
    if(write(smb_shm_processes_fd, &pid, sizeof(pid)) < 0)
@@ -411,13 +401,8 @@ static BOOL smb_shm_unregister_process(char *processreg_file, pid_t pid)
       if(other_pid == pid)
       {
         /* erase pid */
-#ifdef LARGE_SMB_OFF_T
         DEBUG(5,("smb_shm_unregister_process : erasing record for pid %d (seek_val = %.0f)\n",
                      (int)other_pid, (double)seek_back));
-#else /* LARGE_SMB_OFF_T */
-        DEBUG(5,("smb_shm_unregister_process : erasing record for pid %d (seek_val = %d)\n",
-                     (int)other_pid, (int)seek_back));
-#endif /* LARGE_SMB_OFF_T */
         other_pid = (pid_t)0;
         erased_slot = sys_lseek(smb_shm_processes_fd, seek_back, SEEK_CUR);
         if(write(smb_shm_processes_fd, &other_pid, sizeof(other_pid)) < 0)
@@ -782,12 +767,7 @@ struct shmem_ops *smb_shm_open(int ronly)
        if (!*file_name) return(False);
        pstrcat(file_name, "/SHARE_MEM_FILE");
    
-#ifdef LARGE_SMB_OFF_T
    DEBUG(5,("smb_shm_open : using shmem file %s to be of size %.0f\n",file_name,(double)size));
-#else /* LARGE_SMB_OFF_T */
-   DEBUG(5,("smb_shm_open : using shmem file %s to be of size %d\n",
-           file_name,(int)size));
-#endif /* LARGE_SMB_OFF_T */
 
    smb_shm_fd = open(file_name, read_only?O_RDONLY:(O_RDWR|O_CREAT),
                     SHM_FILE_MODE);
@@ -859,13 +839,8 @@ struct shmem_ops *smb_shm_open(int ronly)
    {
       /* the existing file has a different size and we are not the first opener.
         Since another process is still using it, we will use the file size */
-#ifdef LARGE_SMB_OFF_T
       DEBUG(0,("WARNING smb_shm_open : filesize (%.0f) != expected size (%.0f), using filesize\n",
             (double)filesize, (double)size));
-#else /* LARGE_SMB_OFF_T */
-      DEBUG(0,("WARNING smb_shm_open : filesize (%d) != expected size (%d), using filesize\n",
-            (int)filesize,(int)size));
-#endif /* LARGE_SMB_OFF_T */
 
       size = filesize;
    }
index f0ed77bd97b202b1dc577d940309da2e74be5d3b..709b8daecd683bd568ebb04e629852f3d3633d3e 100644 (file)
@@ -1584,11 +1584,7 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
 
   DEBUG(6,("actime: %s " , ctime(&tvs.actime)));
   DEBUG(6,("modtime: %s ", ctime(&tvs.modtime)));
-#ifdef LARGE_SMB_OFF_T
   DEBUG(6,("size: %.0f ", (double)size));
-#else /* LARGE_SMB_OFF_T */
-  DEBUG(6,("size: %x "   , (int)size));
-#endif /* LARGE_SMB_OFF_T */
   DEBUG(6,("mode: %x\n"  , mode));
 
   /* get some defaults (no modifications) if any info is zero. */