• (patrepl and cleanpatch are my own utilities)
    
    patrepl s/PointerHolder/std::shared_ptr/g {include,libqpdf}/qpdf/*.hh
    patrepl s/PointerHolder/std::shared_ptr/g libqpdf/*.cc
    patrepl s/make_pointer_holder/std::make_shared/g libqpdf/*.cc
    patrepl s/make_array_pointer_holder/QUtil::make_shared_array/g libqpdf/*.cc
    patrepl s,qpdf/std::shared_ptr,qpdf/PointerHolder, **/*.cc **/*.hh
    git restore include/qpdf/PointerHolder.hh
    cleanpatch
    ./format-code
    Jay Berkenbilt authored
     
    Browse File »

  • Add comments to force line breaks, parenthesize function arguments
    that are contatenated strings, etc. -- these kinds of changes improve
    clang-format's results and also cause emacs cc-mode to match
    clang-format. After this type of change, most of the time, when
    clang-format and emacs disagree, clang-format is better.
    Jay Berkenbilt authored
     
    Browse File »






  • Have classes contain only a single private member of type
    PointerHolder<Members>. This makes it safe to change the structure of
    the Members class without breaking binary compatibility. Many of the
    classes already follow this pattern quite successfully. This brings in
    the rest of the class that are part of the public API.
    Jay Berkenbilt authored
     
    Browse File »

  • This makes all integer type conversions that have potential data loss
    explicit with calls that do range checks and raise an exception. After
    this commit, qpdf builds with no warnings when -Wsign-conversion
    -Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
    with MSVC. This significantly reduces the likelihood of potential
    crashes from bogus integer values.
    
    There are some parts of the code that take int when they should take
    size_t or an offset. Such places would make qpdf not support files
    with more than 2^31 of something that usually wouldn't be so large. In
    the event that such a file shows up and is valid, at least qpdf would
    raise an error in the right spot so the issue could be legitimately
    addressed rather than failing in some weird way because of a silent
    overflow condition.
    Jay Berkenbilt authored
     
    Browse File »

  • * [bcc32 Error] QPDF.cc(375): E2268 Call to undefined function 'atof'
      Full parser context
        QPDF.cc(358): parsing: void QPDF::parse(const char *)
    
    * [bcc32 Error] QPDFTokenizer.cc(183): E2268 Call to undefined function 'strtol'
      Full parser context
        QPDFTokenizer.cc(163): parsing: void QPDFTokenizer::resolveLiteral()
    
    * [bcc32 Error] pdf-split-pages.cc(52): E2268 Call to undefined function 'exit'
      Full parser context
        pdf-split-pages.cc(50): parsing: void usage()
    
    * PR #295: Including "cstdlib" should be replaced with "stdlib.h" to be more consistent. At the same time I changed the order of the surrounding includes to reflect alphabetical order, because at some files this already have been the case.
    Thorsten Schöning authored
     
    Browse File »


  • Avoid calling jpeg_mem_src and jpeg_mem_dest. The custom destination
    manager writes to the pipeline in smaller chunks to avoid having the
    whole image in memory at once. The source manager works directly with
    the Buffer object. Using customer managers avoids use of memory source
    and destination managers, which are not present in older versions of
    libjpeg still in use by some Linux distributions.
    Jay Berkenbilt authored
     
    Browse File »