Restrict linkage of local functions

This commit is contained in:
Paul Cornett
2021-03-17 10:26:18 -07:00
parent 5154780bbf
commit e375a68371
2 changed files with 18 additions and 17 deletions

View File

@@ -182,6 +182,9 @@ CPP_METHODDEF(void) wx_ignore_message (j_common_ptr WXUNUSED(cinfo))
{ {
} }
} // extern "C"
static
void wx_jpeg_io_src( j_decompress_ptr cinfo, wxInputStream& infile ) void wx_jpeg_io_src( j_decompress_ptr cinfo, wxInputStream& infile )
{ {
wx_src_ptr src; wx_src_ptr src;
@@ -204,8 +207,6 @@ void wx_jpeg_io_src( j_decompress_ptr cinfo, wxInputStream& infile )
src->pub.term_source = wx_term_source; src->pub.term_source = wx_term_source;
} }
} // extern "C"
static inline void wx_cmyk_to_rgb(unsigned char* rgb, const unsigned char* cmyk) static inline void wx_cmyk_to_rgb(unsigned char* rgb, const unsigned char* cmyk)
{ {
int k = 255 - cmyk[3]; int k = 255 - cmyk[3];
@@ -392,7 +393,9 @@ CPP_METHODDEF(void) wx_term_destination (j_compress_ptr cinfo)
dest->stream->Write(dest->buffer, datacount); dest->stream->Write(dest->buffer, datacount);
} }
GLOBAL(void) wx_jpeg_io_dest (j_compress_ptr cinfo, wxOutputStream& outfile) } // extern "C"
static void wx_jpeg_io_dest(j_compress_ptr cinfo, wxOutputStream& outfile)
{ {
wx_dest_ptr dest; wx_dest_ptr dest;
@@ -409,8 +412,6 @@ GLOBAL(void) wx_jpeg_io_dest (j_compress_ptr cinfo, wxOutputStream& outfile)
dest->stream = &outfile; dest->stream = &outfile;
} }
} // extern "C"
bool wxJPEGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbose ) bool wxJPEGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbose )
{ {
struct jpeg_compress_struct cinfo; struct jpeg_compress_struct cinfo;

View File

@@ -143,7 +143,7 @@ static wxSeekMode wxSeekModeFromTIFF(int whence)
extern "C" extern "C"
{ {
tsize_t TIFFLINKAGEMODE static tsize_t TIFFLINKAGEMODE
wxTIFFNullProc(thandle_t WXUNUSED(handle), wxTIFFNullProc(thandle_t WXUNUSED(handle),
tdata_t WXUNUSED(buf), tdata_t WXUNUSED(buf),
tsize_t WXUNUSED(size)) tsize_t WXUNUSED(size))
@@ -151,7 +151,7 @@ wxTIFFNullProc(thandle_t WXUNUSED(handle),
return (tsize_t) -1; return (tsize_t) -1;
} }
tsize_t TIFFLINKAGEMODE static tsize_t TIFFLINKAGEMODE
wxTIFFReadProc(thandle_t handle, tdata_t buf, tsize_t size) wxTIFFReadProc(thandle_t handle, tdata_t buf, tsize_t size)
{ {
wxInputStream *stream = (wxInputStream*) handle; wxInputStream *stream = (wxInputStream*) handle;
@@ -159,7 +159,7 @@ wxTIFFReadProc(thandle_t handle, tdata_t buf, tsize_t size)
return wx_truncate_cast(tsize_t, stream->LastRead()); return wx_truncate_cast(tsize_t, stream->LastRead());
} }
tsize_t TIFFLINKAGEMODE static tsize_t TIFFLINKAGEMODE
wxTIFFWriteProc(thandle_t handle, tdata_t buf, tsize_t size) wxTIFFWriteProc(thandle_t handle, tdata_t buf, tsize_t size)
{ {
wxOutputStream *stream = (wxOutputStream*) handle; wxOutputStream *stream = (wxOutputStream*) handle;
@@ -167,7 +167,7 @@ wxTIFFWriteProc(thandle_t handle, tdata_t buf, tsize_t size)
return wx_truncate_cast(tsize_t, stream->LastWrite()); return wx_truncate_cast(tsize_t, stream->LastWrite());
} }
toff_t TIFFLINKAGEMODE static toff_t TIFFLINKAGEMODE
wxTIFFSeekIProc(thandle_t handle, toff_t off, int whence) wxTIFFSeekIProc(thandle_t handle, toff_t off, int whence)
{ {
wxInputStream *stream = (wxInputStream*) handle; wxInputStream *stream = (wxInputStream*) handle;
@@ -176,7 +176,7 @@ wxTIFFSeekIProc(thandle_t handle, toff_t off, int whence)
wxSeekModeFromTIFF(whence))); wxSeekModeFromTIFF(whence)));
} }
toff_t TIFFLINKAGEMODE static toff_t TIFFLINKAGEMODE
wxTIFFSeekOProc(thandle_t handle, toff_t off, int whence) wxTIFFSeekOProc(thandle_t handle, toff_t off, int whence)
{ {
wxOutputStream *stream = (wxOutputStream*) handle; wxOutputStream *stream = (wxOutputStream*) handle;
@@ -219,14 +219,14 @@ wxTIFFSeekOProc(thandle_t handle, toff_t off, int whence)
return wxFileOffsetToTIFF( stream->TellO() ); return wxFileOffsetToTIFF( stream->TellO() );
} }
int TIFFLINKAGEMODE static int TIFFLINKAGEMODE
wxTIFFCloseIProc(thandle_t WXUNUSED(handle)) wxTIFFCloseIProc(thandle_t WXUNUSED(handle))
{ {
// there is no need to close the input stream // there is no need to close the input stream
return 0; return 0;
} }
int TIFFLINKAGEMODE static int TIFFLINKAGEMODE
wxTIFFCloseOProc(thandle_t handle) wxTIFFCloseOProc(thandle_t handle)
{ {
wxOutputStream *stream = (wxOutputStream*) handle; wxOutputStream *stream = (wxOutputStream*) handle;
@@ -234,14 +234,14 @@ wxTIFFCloseOProc(thandle_t handle)
return stream->Close() ? 0 : -1; return stream->Close() ? 0 : -1;
} }
toff_t TIFFLINKAGEMODE static toff_t TIFFLINKAGEMODE
wxTIFFSizeProc(thandle_t handle) wxTIFFSizeProc(thandle_t handle)
{ {
wxStreamBase *stream = (wxStreamBase*) handle; wxStreamBase *stream = (wxStreamBase*) handle;
return (toff_t) stream->GetSize(); return (toff_t) stream->GetSize();
} }
int TIFFLINKAGEMODE static int TIFFLINKAGEMODE
wxTIFFMapProc(thandle_t WXUNUSED(handle), wxTIFFMapProc(thandle_t WXUNUSED(handle),
tdata_t* WXUNUSED(pbase), tdata_t* WXUNUSED(pbase),
toff_t* WXUNUSED(psize)) toff_t* WXUNUSED(psize))
@@ -249,7 +249,7 @@ wxTIFFMapProc(thandle_t WXUNUSED(handle),
return 0; return 0;
} }
void TIFFLINKAGEMODE static void TIFFLINKAGEMODE
wxTIFFUnmapProc(thandle_t WXUNUSED(handle), wxTIFFUnmapProc(thandle_t WXUNUSED(handle),
tdata_t WXUNUSED(base), tdata_t WXUNUSED(base),
toff_t WXUNUSED(size)) toff_t WXUNUSED(size))
@@ -258,7 +258,7 @@ wxTIFFUnmapProc(thandle_t WXUNUSED(handle),
} // extern "C" } // extern "C"
TIFF* static TIFF*
TIFFwxOpen(wxInputStream &stream, const char* name, const char* mode) TIFFwxOpen(wxInputStream &stream, const char* name, const char* mode)
{ {
TIFF* tif = TIFFClientOpen(name, mode, TIFF* tif = TIFFClientOpen(name, mode,
@@ -270,7 +270,7 @@ TIFFwxOpen(wxInputStream &stream, const char* name, const char* mode)
return tif; return tif;
} }
TIFF* static TIFF*
TIFFwxOpen(wxOutputStream &stream, const char* name, const char* mode) TIFFwxOpen(wxOutputStream &stream, const char* name, const char* mode)
{ {
TIFF* tif = TIFFClientOpen(name, mode, TIFF* tif = TIFFClientOpen(name, mode,