Fix warnings with -Wmissing-variable-declarations
This commit is contained in:
@@ -475,7 +475,7 @@ if(UNIX)
|
|||||||
check_c_source_runs("
|
check_c_source_runs("
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
int is_shifting_signed (long arg) {
|
static int is_shifting_signed (long arg) {
|
||||||
long res = arg >> 4;
|
long res = arg >> 4;
|
||||||
if (res == -0x7F7E80CL)
|
if (res == -0x7F7E80CL)
|
||||||
return 1; /* right shift is signed */
|
return 1; /* right shift is signed */
|
||||||
@@ -495,7 +495,7 @@ if(UNIX)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT MSVC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
if(NOT MSVC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
check_c_source_compiles("const int __attribute__((visibility(\"hidden\"))) table[1] = { 0 }; int main(void) { return table[0]; }"
|
check_c_source_compiles("extern const int table[1]; const int __attribute__((visibility(\"hidden\"))) table[1] = { 0 }; int main(void) { return table[0]; }"
|
||||||
HIDDEN_WORKS)
|
HIDDEN_WORKS)
|
||||||
if(HIDDEN_WORKS)
|
if(HIDDEN_WORKS)
|
||||||
set(HIDDEN "__attribute__((visibility(\"hidden\")))")
|
set(HIDDEN "__attribute__((visibility(\"hidden\")))")
|
||||||
@@ -536,7 +536,7 @@ if(MSVC)
|
|||||||
else()
|
else()
|
||||||
set(THREAD_LOCAL "__thread")
|
set(THREAD_LOCAL "__thread")
|
||||||
endif()
|
endif()
|
||||||
check_c_source_compiles("${THREAD_LOCAL} int i; int main(void) { i = 0; return i; }"
|
check_c_source_compiles("static ${THREAD_LOCAL} int i; int main(void) { i = 0; return i; }"
|
||||||
HAVE_THREAD_LOCAL)
|
HAVE_THREAD_LOCAL)
|
||||||
if(HAVE_THREAD_LOCAL)
|
if(HAVE_THREAD_LOCAL)
|
||||||
message(STATUS "THREAD_LOCAL = ${THREAD_LOCAL}")
|
message(STATUS "THREAD_LOCAL = ${THREAD_LOCAL}")
|
||||||
|
|||||||
8
cjpeg.c
8
cjpeg.c
@@ -7,7 +7,7 @@
|
|||||||
* Lossless JPEG Modifications:
|
* Lossless JPEG Modifications:
|
||||||
* Copyright (C) 1999, Ken Murchison.
|
* Copyright (C) 1999, Ken Murchison.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2010, 2013-2014, 2017, 2019-2022, D. R. Commander.
|
* Copyright (C) 2010, 2013-2014, 2017, 2019-2022, 2024, D. R. Commander.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
@@ -156,9 +156,9 @@ select_file_type(j_compress_ptr cinfo, FILE *infile)
|
|||||||
static const char *progname; /* program name for error messages */
|
static const char *progname; /* program name for error messages */
|
||||||
static char *icc_filename; /* for -icc switch */
|
static char *icc_filename; /* for -icc switch */
|
||||||
static char *outfilename; /* for -outfile switch */
|
static char *outfilename; /* for -outfile switch */
|
||||||
boolean memdst; /* for -memdst switch */
|
static boolean memdst; /* for -memdst switch */
|
||||||
boolean report; /* for -report switch */
|
static boolean report; /* for -report switch */
|
||||||
boolean strict; /* for -strict switch */
|
static boolean strict; /* for -strict switch */
|
||||||
|
|
||||||
|
|
||||||
#ifdef CJPEG_FUZZER
|
#ifdef CJPEG_FUZZER
|
||||||
|
|||||||
16
djpeg.c
16
djpeg.c
@@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2013-2019 by Guido Vollbeding.
|
* Modified 2013-2019 by Guido Vollbeding.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2010-2011, 2013-2017, 2019-2020, 2022-2023, D. R. Commander.
|
* Copyright (C) 2010-2011, 2013-2017, 2019-2020, 2022-2024, D. R. Commander.
|
||||||
* Copyright (C) 2015, Google, Inc.
|
* Copyright (C) 2015, Google, Inc.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
@@ -84,14 +84,14 @@ static IMAGE_FORMATS requested_fmt;
|
|||||||
|
|
||||||
static const char *progname; /* program name for error messages */
|
static const char *progname; /* program name for error messages */
|
||||||
static char *icc_filename; /* for -icc switch */
|
static char *icc_filename; /* for -icc switch */
|
||||||
JDIMENSION max_scans; /* for -maxscans switch */
|
static JDIMENSION max_scans; /* for -maxscans switch */
|
||||||
static char *outfilename; /* for -outfile switch */
|
static char *outfilename; /* for -outfile switch */
|
||||||
boolean memsrc; /* for -memsrc switch */
|
static boolean memsrc; /* for -memsrc switch */
|
||||||
boolean report; /* for -report switch */
|
static boolean report; /* for -report switch */
|
||||||
boolean skip, crop;
|
static boolean skip, crop;
|
||||||
JDIMENSION skip_start, skip_end;
|
static JDIMENSION skip_start, skip_end;
|
||||||
JDIMENSION crop_x, crop_y, crop_width, crop_height;
|
static JDIMENSION crop_x, crop_y, crop_width, crop_height;
|
||||||
boolean strict; /* for -strict switch */
|
static boolean strict; /* for -strict switch */
|
||||||
#define INPUT_BUF_SIZE 4096
|
#define INPUT_BUF_SIZE 4096
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
4
jerror.c
4
jerror.c
@@ -4,7 +4,7 @@
|
|||||||
* This file was part of the Independent JPEG Group's software:
|
* This file was part of the Independent JPEG Group's software:
|
||||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2022, D. R. Commander.
|
* Copyright (C) 2022, 2024, D. R. Commander.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
#define JMESSAGE(code, string) string,
|
#define JMESSAGE(code, string) string,
|
||||||
|
|
||||||
const char * const jpeg_std_message_table[] = {
|
static const char * const jpeg_std_message_table[] = {
|
||||||
#include "jerror.h"
|
#include "jerror.h"
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* This file was part of the Independent JPEG Group's software:
|
* This file was part of the Independent JPEG Group's software:
|
||||||
* Copyright (C) 1995-2019, Thomas G. Lane, Guido Vollbeding.
|
* Copyright (C) 1995-2019, Thomas G. Lane, Guido Vollbeding.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2010, 2014, 2017, 2019-2022, D. R. Commander.
|
* Copyright (C) 2010, 2014, 2017, 2019-2022, 2024, D. R. Commander.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
@@ -35,11 +35,11 @@
|
|||||||
|
|
||||||
static const char *progname; /* program name for error messages */
|
static const char *progname; /* program name for error messages */
|
||||||
static char *icc_filename; /* for -icc switch */
|
static char *icc_filename; /* for -icc switch */
|
||||||
JDIMENSION max_scans; /* for -maxscans switch */
|
static JDIMENSION max_scans; /* for -maxscans switch */
|
||||||
static char *outfilename; /* for -outfile switch */
|
static char *outfilename; /* for -outfile switch */
|
||||||
static char *dropfilename; /* for -drop switch */
|
static char *dropfilename; /* for -drop switch */
|
||||||
boolean report; /* for -report switch */
|
static boolean report; /* for -report switch */
|
||||||
boolean strict; /* for -strict switch */
|
static boolean strict; /* for -strict switch */
|
||||||
static JCOPY_OPTION copyoption; /* -copy switch */
|
static JCOPY_OPTION copyoption; /* -copy switch */
|
||||||
static jpeg_transform_info transformoption; /* image transformation options */
|
static jpeg_transform_info transformoption; /* image transformation options */
|
||||||
|
|
||||||
|
|||||||
31
tjbench.c
31
tjbench.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C)2009-2019, 2021-2023 D. R. Commander. All Rights Reserved.
|
* Copyright (C)2009-2019, 2021-2024 D. R. Commander. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
@@ -48,8 +48,8 @@
|
|||||||
}
|
}
|
||||||
#define THROW_UNIX(m) THROW(m, strerror(errno))
|
#define THROW_UNIX(m) THROW(m, strerror(errno))
|
||||||
|
|
||||||
char tjErrorStr[JMSG_LENGTH_MAX] = "\0";
|
static char tjErrorStr[JMSG_LENGTH_MAX] = "\0";
|
||||||
int tjErrorLine = -1, tjErrorCode = -1;
|
static int tjErrorLine = -1, tjErrorCode = -1;
|
||||||
|
|
||||||
#define THROW_TJG() { \
|
#define THROW_TJG() { \
|
||||||
printf("ERROR in line %d\n%s\n", __LINE__, tj3GetErrorStr(NULL)); \
|
printf("ERROR in line %d\n%s\n", __LINE__, tj3GetErrorStr(NULL)); \
|
||||||
@@ -88,30 +88,31 @@ int tjErrorLine = -1, tjErrorCode = -1;
|
|||||||
(IS_CROPPED(cr) ? (cr.h != 0 ? cr.h : TJSCALED(height, sf) - cr.y) : \
|
(IS_CROPPED(cr) ? (cr.h != 0 ? cr.h : TJSCALED(height, sf) - cr.y) : \
|
||||||
TJSCALED(height, sf))
|
TJSCALED(height, sf))
|
||||||
|
|
||||||
int stopOnWarning = 0, bottomUp = 0, noRealloc = 1, fastUpsample = 0,
|
static int stopOnWarning = 0, bottomUp = 0, noRealloc = 1, fastUpsample = 0,
|
||||||
fastDCT = 0, optimize = 0, progressive = 0, limitScans = 0, maxMemory = 0,
|
fastDCT = 0, optimize = 0, progressive = 0, limitScans = 0, maxMemory = 0,
|
||||||
maxPixels = 0, arithmetic = 0, lossless = 0, restartIntervalBlocks = 0,
|
maxPixels = 0, arithmetic = 0, lossless = 0, restartIntervalBlocks = 0,
|
||||||
restartIntervalRows = 0;
|
restartIntervalRows = 0;
|
||||||
int precision = 8, sampleSize, compOnly = 0, decompOnly = 0, doYUV = 0,
|
static int precision = 8, sampleSize, compOnly = 0, decompOnly = 0, doYUV = 0,
|
||||||
quiet = 0, doTile = 0, pf = TJPF_BGR, yuvAlign = 1, doWrite = 1;
|
quiet = 0, doTile = 0, pf = TJPF_BGR, yuvAlign = 1, doWrite = 1;
|
||||||
char *ext = "ppm";
|
static char *ext = "ppm";
|
||||||
const char *pixFormatStr[TJ_NUMPF] = {
|
static const char *pixFormatStr[TJ_NUMPF] = {
|
||||||
"RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "GRAY", "", "", "", "", "CMYK"
|
"RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "GRAY", "", "", "", "", "CMYK"
|
||||||
};
|
};
|
||||||
const char *subNameLong[TJ_NUMSAMP] = {
|
static const char *subNameLong[TJ_NUMSAMP] = {
|
||||||
"4:4:4", "4:2:2", "4:2:0", "GRAY", "4:4:0", "4:1:1", "4:4:1"
|
"4:4:4", "4:2:2", "4:2:0", "GRAY", "4:4:0", "4:1:1", "4:4:1"
|
||||||
};
|
};
|
||||||
const char *csName[TJ_NUMCS] = {
|
static const char *csName[TJ_NUMCS] = {
|
||||||
"RGB", "YCbCr", "GRAY", "CMYK", "YCCK"
|
"RGB", "YCbCr", "GRAY", "CMYK", "YCCK"
|
||||||
};
|
};
|
||||||
const char *subName[TJ_NUMSAMP] = {
|
static const char *subName[TJ_NUMSAMP] = {
|
||||||
"444", "422", "420", "GRAY", "440", "411", "441"
|
"444", "422", "420", "GRAY", "440", "411", "441"
|
||||||
};
|
};
|
||||||
tjscalingfactor *scalingFactors = NULL, sf = { 1, 1 };
|
static tjscalingfactor *scalingFactors = NULL, sf = { 1, 1 };
|
||||||
tjregion cr = { 0, 0, 0, 0 };
|
static tjregion cr = { 0, 0, 0, 0 };
|
||||||
int nsf = 0, xformOp = TJXOP_NONE, xformOpt = 0;
|
static int nsf = 0, xformOp = TJXOP_NONE, xformOpt = 0;
|
||||||
int (*customFilter) (short *, tjregion, tjregion, int, int, tjtransform *);
|
static int (*customFilter) (short *, tjregion, tjregion, int, int,
|
||||||
double benchTime = 5.0, warmup = 1.0;
|
tjtransform *);
|
||||||
|
static double benchTime = 5.0, warmup = 1.0;
|
||||||
|
|
||||||
|
|
||||||
static char *formatName(int subsamp, int cs, char *buf)
|
static char *formatName(int subsamp, int cs, char *buf)
|
||||||
|
|||||||
10
tjexample.c
10
tjexample.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C)2011-2012, 2014-2015, 2017, 2019, 2021-2023
|
* Copyright (C)2011-2012, 2014-2015, 2017, 2019, 2021-2024
|
||||||
* D. R. Commander. All Rights Reserved.
|
* D. R. Commander. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -61,16 +61,16 @@
|
|||||||
#define DEFAULT_QUALITY 95
|
#define DEFAULT_QUALITY 95
|
||||||
|
|
||||||
|
|
||||||
const char *subsampName[TJ_NUMSAMP] = {
|
static const char *subsampName[TJ_NUMSAMP] = {
|
||||||
"4:4:4", "4:2:2", "4:2:0", "Grayscale", "4:4:0", "4:1:1", "4:4:1"
|
"4:4:4", "4:2:2", "4:2:0", "Grayscale", "4:4:0", "4:1:1", "4:4:1"
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *colorspaceName[TJ_NUMCS] = {
|
static const char *colorspaceName[TJ_NUMCS] = {
|
||||||
"RGB", "YCbCr", "GRAY", "CMYK", "YCCK"
|
"RGB", "YCbCr", "GRAY", "CMYK", "YCCK"
|
||||||
};
|
};
|
||||||
|
|
||||||
tjscalingfactor *scalingFactors = NULL;
|
static tjscalingfactor *scalingFactors = NULL;
|
||||||
int numScalingFactors = 0;
|
static int numScalingFactors = 0;
|
||||||
|
|
||||||
|
|
||||||
/* DCT filter example. This produces a negative of the image. */
|
/* DCT filter example. This produces a negative of the image. */
|
||||||
|
|||||||
22
tjunittest.c
22
tjunittest.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C)2009-2014, 2017-2019, 2022-2023 D. R. Commander.
|
* Copyright (C)2009-2014, 2017-2019, 2022-2024 D. R. Commander.
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -83,29 +83,29 @@ static void usage(char *progName)
|
|||||||
BAILOUT() \
|
BAILOUT() \
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *subNameLong[TJ_NUMSAMP] = {
|
static const char *subNameLong[TJ_NUMSAMP] = {
|
||||||
"4:4:4", "4:2:2", "4:2:0", "GRAY", "4:4:0", "4:1:1", "4:4:1"
|
"4:4:4", "4:2:2", "4:2:0", "GRAY", "4:4:0", "4:1:1", "4:4:1"
|
||||||
};
|
};
|
||||||
const char *subName[TJ_NUMSAMP] = {
|
static const char *subName[TJ_NUMSAMP] = {
|
||||||
"444", "422", "420", "GRAY", "440", "411", "441"
|
"444", "422", "420", "GRAY", "440", "411", "441"
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *pixFormatStr[TJ_NUMPF] = {
|
static const char *pixFormatStr[TJ_NUMPF] = {
|
||||||
"RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "Grayscale",
|
"RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "Grayscale",
|
||||||
"RGBA", "BGRA", "ABGR", "ARGB", "CMYK"
|
"RGBA", "BGRA", "ABGR", "ARGB", "CMYK"
|
||||||
};
|
};
|
||||||
|
|
||||||
const int _3sampleFormats[] = { TJPF_RGB, TJPF_BGR };
|
static const int _3sampleFormats[] = { TJPF_RGB, TJPF_BGR };
|
||||||
const int _4sampleFormats[] = {
|
static const int _4sampleFormats[] = {
|
||||||
TJPF_RGBX, TJPF_BGRX, TJPF_XBGR, TJPF_XRGB, TJPF_CMYK
|
TJPF_RGBX, TJPF_BGRX, TJPF_XBGR, TJPF_XRGB, TJPF_CMYK
|
||||||
};
|
};
|
||||||
const int _onlyGray[] = { TJPF_GRAY };
|
static const int _onlyGray[] = { TJPF_GRAY };
|
||||||
const int _onlyRGB[] = { TJPF_RGB };
|
static const int _onlyRGB[] = { TJPF_RGB };
|
||||||
|
|
||||||
int doYUV = 0, lossless = 0, psv = 1, alloc = 0, yuvAlign = 4;
|
static int doYUV = 0, lossless = 0, psv = 1, alloc = 0, yuvAlign = 4;
|
||||||
int precision = 8, sampleSize, maxSample, tolerance, redToY, yellowToY;
|
static int precision = 8, sampleSize, maxSample, tolerance, redToY, yellowToY;
|
||||||
|
|
||||||
int exitStatus = 0;
|
static int exitStatus = 0;
|
||||||
#define BAILOUT() { exitStatus = -1; goto bailout; }
|
#define BAILOUT() { exitStatus = -1; goto bailout; }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user