Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-1705

apr_off_t is of an ambiguous size

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Later
    • Affects Version/s: all
    • Fix Version/s: 1.0.0
    • Component/s: src
    • Labels:
      None

      Description

      As discussed in this thread:
      http://marc.theaimsgroup.com/?l=subversion-dev&m=107390224021280&w=2
      
      The attached patch mostly removes the apr_off_t type from our code.
      The exceptions are that it does not remove it in the cases where
      apr_file_seek is being used directly.  All of these cases are using
      it essentially as a constant.  So it's an implementation detail that
      can wait until dionosis gets around to dealing with apr_file_seek
      as he said on IRC yesterday he would be doing post 1.0.
      
      We originally discussed using svn_filesize_t but we can't use it.
      It is an unsigned type.  We depend upon this type being signed,
      particularly in the diff code.  So it adds a svn_offset_t type.
      
      The bounds checking code is as complex as it is to avoid endianess
      issues.  I could calculate the range, but doing so would either require
      the pow function or dependend upon endian specific implementations.
      So the way I did it seemed best.  I was probably being overly
      paranoid in implementing the 2 and 1 byte size variants but
      I think it doesn't hurt anything to have.  (Thus my joke on IRC
      about supporting 8 and 16-bit archs).
      
      Other than the bounds checking in svn_io_file_seek, it's only a
      change of the type.  
      
      Patch has been make check'ed on 32-bit and 64-bit archs.
      

        Attachments

        1. 5_svn-blame.patch
          6 kB
          Ben Reser
        2. 4_svn-diff-pool.patch
          29 kB
          Ben Reser
        3. 3_svn-apr_off_t-exorcise.patch
          41 kB
          Ben Reser
        4. 2_svn-apr_off_t-exorcise.patch
          35 kB
          Ben Reser
        5. 1_svn-apr_off_t-exorcise.patch
          35 kB
          Ben Reser

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              breser Ben Reser
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: