Skip to content

Commit

Permalink
Eliminate warnings and other minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
ruven committed Nov 20, 2024
1 parent 446450c commit 16ff66e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install libtiff-dev libpng-dev libturbojpeg-dev libwebp-dev libavif-dev libmemcached-dev libopenjp2-7-dev
run: sudo apt-get update && sudo apt-get install libfcgi-dev libtiff-dev libpng-dev libturbojpeg-dev libwebp-dev libavif-dev libmemcached-dev libopenjp2-7-dev

- name: Configure
run: |
Expand Down
4 changes: 0 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,6 @@ if test -n "$kakadu_path"; then

AC_SUBST(KAKADU_OBJS)

AC_LANG_PUSH([C++])
AC_CHECK_HEADER([thread], [AC_DEFINE(HAVE_STL_THREAD)])
AC_LANG_POP([C++])

AC_CHECK_FUNC([get_nprocs_conf],[AC_DEFINE(NPROCS)])
fi
else
Expand Down
5 changes: 2 additions & 3 deletions src/JPEGImage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/


#include "JPEGImage.h"
#include "Logger.h"
#include <cstdio>
Expand Down Expand Up @@ -476,8 +475,8 @@ void JPEGImage::process( unsigned int res, int layers, int xoffset, int yoffset,
}
}

// Free any temporary buffer we may have created
if( dst_ptr ) free( dst_ptr );
// Free temporary buffer we created for when factor > 1
if( buffer ) free( buffer );
}

}
7 changes: 1 addition & 6 deletions src/TIFFCompressor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ extern "C" {
tiff_mem *memtif = (tiff_mem *) handle;

// Re-allocate extra memory if we don't have enough space
if( ((tsize_t) memtif->current + length) > memtif->capacity ){
if( (memtif->current + length) > memtif->capacity ){
memtif->capacity = memtif->capacity + length;
memtif->buffer = (unsigned char*) realloc( memtif->buffer, memtif->capacity );
}
Expand Down Expand Up @@ -94,11 +94,6 @@ extern "C" {
static void _unmap( thandle_t handle, tdata_t base, toff_t psize ){
}

// Free function - unimplemented as memory handled manually
static void _free( tiff_mem *memtif ){
return;
}

}


Expand Down
2 changes: 1 addition & 1 deletion src/TIFFCompressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ typedef struct {
unsigned char *buffer; /// Data buffer
toff_t current; /// Current byte position within stream
toff_t end; /// Last written byte
tsize_t capacity; /// Allocated buffer size
toff_t capacity; /// Allocated buffer size
} tiff_mem;

typedef tiff_mem* tiff_mem_ptr;
Expand Down
2 changes: 1 addition & 1 deletion src/Task.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void QLT::run( Session* session, const string& argument ){
transform( arg.begin(), arg.end(), arg.begin(), ::tolower );

// Check whether we have a compression:quality combination
int delimitter = arg.find( ":" );
std::string::size_type delimitter = arg.find( ":" );
if( delimitter != string::npos ){
string comp = arg.substr( 0, delimitter );
int compression = 0;
Expand Down

0 comments on commit 16ff66e

Please sign in to comment.