Use static linkage for various local names

This commit is contained in:
Paul Cornett
2017-09-24 09:29:26 -07:00
parent 925a1c0734
commit cd1c3fab0c
18 changed files with 38 additions and 7 deletions

View File

@@ -780,6 +780,7 @@ unsigned int wxAuiManager::GetFlags() const
} }
// Convenience function // Convenience function
static
bool wxAuiManager_HasLiveResize(wxAuiManager& manager) bool wxAuiManager_HasLiveResize(wxAuiManager& manager)
{ {
// With Core Graphics on Mac, it's not possible to show sash feedback, // With Core Graphics on Mac, it's not possible to show sash feedback,

View File

@@ -697,11 +697,15 @@ void wxDCImpl::DrawSpline(int n, const wxPoint points[])
// ----------------------------------- spline code ---------------------------------------- // ----------------------------------- spline code ----------------------------------------
static
void wx_quadratic_spline(double a1, double b1, double a2, double b2, void wx_quadratic_spline(double a1, double b1, double a2, double b2,
double a3, double b3, double a4, double b4); double a3, double b3, double a4, double b4);
static
void wx_clear_stack(); void wx_clear_stack();
static
int wx_spline_pop(double *x1, double *y1, double *x2, double *y2, double *x3, int wx_spline_pop(double *x1, double *y1, double *x2, double *y2, double *x3,
double *y3, double *x4, double *y4); double *y3, double *x4, double *y4);
static
void wx_spline_push(double x1, double y1, double x2, double y2, double x3, double y3, void wx_spline_push(double x1, double y1, double x2, double y2, double x3, double y3,
double x4, double y4); double x4, double y4);
static bool wx_spline_add_point(double x, double y); static bool wx_spline_add_point(double x, double y);

View File

@@ -121,6 +121,7 @@ wxString wxBrushString(wxColour c, int style = wxBRUSHSTYLE_SOLID)
return s; return s;
} }
static
wxString wxGetPenPattern(wxPen& pen) wxString wxGetPenPattern(wxPen& pen)
{ {
wxString s; wxString s;

View File

@@ -33,6 +33,7 @@
#include "wx/unix/private/epolldispatcher.h" #include "wx/unix/private/epolldispatcher.h"
#endif #endif
static
wxFDIODispatcher *gs_dispatcher = NULL; wxFDIODispatcher *gs_dispatcher = NULL;
// ============================================================================ // ============================================================================

View File

@@ -41,6 +41,7 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxPCXHandler,wxImageHandler);
// RLE encoding and decoding // RLE encoding and decoding
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static
void RLEencode(unsigned char *p, unsigned int size, wxOutputStream& s) void RLEencode(unsigned char *p, unsigned int size, wxOutputStream& s)
{ {
unsigned int data, last, cont; unsigned int data, last, cont;
@@ -84,6 +85,7 @@ void RLEencode(unsigned char *p, unsigned int size, wxOutputStream& s)
s.PutC((char) last); s.PutC((char) last);
} }
static
void RLEdecode(unsigned char *p, unsigned int size, wxInputStream& s) void RLEdecode(unsigned char *p, unsigned int size, wxInputStream& s)
{ {
// Read 'size' bytes. The PCX official specs say there will be // Read 'size' bytes. The PCX official specs say there will be
@@ -156,6 +158,7 @@ enum {
// Returns wxPCX_OK on success, or an error code otherwise // Returns wxPCX_OK on success, or an error code otherwise
// (see above for error codes) // (see above for error codes)
// //
static
int ReadPCX(wxImage *image, wxInputStream& stream) int ReadPCX(wxImage *image, wxInputStream& stream)
{ {
unsigned char hdr[128]; // PCX header unsigned char hdr[128]; // PCX header
@@ -303,6 +306,7 @@ int ReadPCX(wxImage *image, wxInputStream& stream)
// PCX if possible, and then fall back to 24-bit if there // PCX if possible, and then fall back to 24-bit if there
// are more than 256 different colours. // are more than 256 different colours.
// //
static
int SavePCX(wxImage *image, wxOutputStream& stream) int SavePCX(wxImage *image, wxOutputStream& stream)
{ {
unsigned char hdr[128]; // PCX header unsigned char hdr[128]; // PCX header

View File

@@ -32,6 +32,7 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxPNMHandler,wxImageHandler);
#if wxUSE_STREAMS #if wxUSE_STREAMS
static
void Skip_Comment(wxInputStream &stream) void Skip_Comment(wxInputStream &stream)
{ {
wxTextInputStream text_stream(stream); wxTextInputStream text_stream(stream);

View File

@@ -4461,6 +4461,7 @@ int wxListMainWindow::GetItemWidthWithImage(wxListItem * item)
static wxListCtrlCompare list_ctrl_compare_func_2; static wxListCtrlCompare list_ctrl_compare_func_2;
static wxIntPtr list_ctrl_compare_data; static wxIntPtr list_ctrl_compare_data;
static
int LINKAGEMODE list_ctrl_compare_func_1( wxListLineData **arg1, wxListLineData **arg2 ) int LINKAGEMODE list_ctrl_compare_func_1( wxListLineData **arg1, wxListLineData **arg2 )
{ {
wxListLineData *line1 = *arg1; wxListLineData *line1 = *arg1;

View File

@@ -32,6 +32,8 @@
// implementation // implementation
// ============================================================================ // ============================================================================
extern "C" {
static
void gdk_pixbuf_area_updated(GdkPixbufLoader *loader, void gdk_pixbuf_area_updated(GdkPixbufLoader *loader,
gint WXUNUSED(x), gint WXUNUSED(x),
gint WXUNUSED(y), gint WXUNUSED(y),
@@ -46,7 +48,7 @@ void gdk_pixbuf_area_updated(GdkPixbufLoader *loader,
anim->SetPixbuf(gdk_pixbuf_loader_get_animation(loader)); anim->SetPixbuf(gdk_pixbuf_loader_get_animation(loader));
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxAnimation // wxAnimation

View File

@@ -83,7 +83,8 @@ void wxNativeWindow::DoDisown()
// TODO: we probably need equivalent code for other GDK platforms // TODO: we probably need equivalent code for other GDK platforms
#ifdef GDK_WINDOWING_X11 #ifdef GDK_WINDOWING_X11
extern "C" GdkFilterReturn extern "C" {
static GdkFilterReturn
wxNativeContainerWindowFilter(GdkXEvent *gdkxevent, wxNativeContainerWindowFilter(GdkXEvent *gdkxevent,
GdkEvent *event, GdkEvent *event,
gpointer data) gpointer data)
@@ -101,6 +102,7 @@ wxNativeContainerWindowFilter(GdkXEvent *gdkxevent,
return GDK_FILTER_CONTINUE; return GDK_FILTER_CONTINUE;
} }
}
#endif // GDK_WINDOWING_X11 #endif // GDK_WINDOWING_X11

View File

@@ -63,6 +63,7 @@ static gint gtk_popup_button_press (GtkWidget *widget, GdkEvent *gdk_event, wxPo
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" { extern "C" {
static
bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxPopupWindow *win ) bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxPopupWindow *win )
{ {
if (win->IsEnabled()) if (win->IsEnabled())

View File

@@ -444,7 +444,7 @@ extern "C" {
// Normal version used for detecting IME input and generating appropriate // Normal version used for detecting IME input and generating appropriate
// events for it. // events for it.
void static void
wx_insert_text_callback(GtkTextBuffer* buffer, wx_insert_text_callback(GtkTextBuffer* buffer,
GtkTextIter* WXUNUSED(end), GtkTextIter* WXUNUSED(end),
gchar *text, gchar *text,

View File

@@ -58,8 +58,8 @@ static unsigned int GetEntryTextLength(GtkEntry* entry)
// ============================================================================ // ============================================================================
// "insert_text" handler for GtkEntry // "insert_text" handler for GtkEntry
extern "C" extern "C" {
void static void
wx_gtk_insert_text_callback(GtkEditable *editable, wx_gtk_insert_text_callback(GtkEditable *editable,
const gchar * new_text, const gchar * new_text,
gint new_text_length, gint new_text_length,
@@ -146,6 +146,7 @@ wx_gtk_insert_text_callback(GtkEditable *editable,
g_signal_stop_emission_by_name (editable, "insert_text"); g_signal_stop_emission_by_name (editable, "insert_text");
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// clipboard events: "copy-clipboard", "cut-clipboard", "paste-clipboard" // clipboard events: "copy-clipboard", "cut-clipboard", "paste-clipboard"

View File

@@ -539,7 +539,8 @@ struct wxHtmlEntityInfo
unsigned code; unsigned code;
}; };
extern "C" int LINKAGEMODE wxHtmlEntityCompare(const void *key, const void *item) extern "C" {
static int LINKAGEMODE wxHtmlEntityCompare(const void *key, const void *item)
{ {
#if wxUSE_UNICODE_UTF8 #if wxUSE_UNICODE_UTF8
return strcmp((char*)key, ((wxHtmlEntityInfo*)item)->name); return strcmp((char*)key, ((wxHtmlEntityInfo*)item)->name);
@@ -547,6 +548,7 @@ extern "C" int LINKAGEMODE wxHtmlEntityCompare(const void *key, const void *item
return wxStrcmp((wxChar*)key, ((wxHtmlEntityInfo*)item)->name); return wxStrcmp((wxChar*)key, ((wxHtmlEntityInfo*)item)->name);
#endif #endif
} }
}
wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) const wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) const
{ {

View File

@@ -471,6 +471,7 @@ void wxPGTextCtrlEditor::SetControlStringValue( wxPGProperty* property, wxWindow
} }
static
void wxPGTextCtrlEditor_OnFocus( wxPGProperty* property, void wxPGTextCtrlEditor_OnFocus( wxPGProperty* property,
wxTextCtrl* tc ) wxTextCtrl* tc )
{ {
@@ -957,6 +958,7 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
} }
} }
static
bool wxPGChoiceEditor_SetCustomPaintWidth( wxPropertyGrid* propGrid, wxPGComboBox* cb, int cmnVal ) bool wxPGChoiceEditor_SetCustomPaintWidth( wxPropertyGrid* propGrid, wxPGComboBox* cb, int cmnVal )
{ {
wxPGProperty* property = propGrid->GetSelectedProperty(); wxPGProperty* property = propGrid->GetSelectedProperty();

View File

@@ -348,6 +348,7 @@ bool wxIntProperty::IntToValue( wxVariant& variant, int value, int WXUNUSED(argF
// back to it when mode is wxPG_PROPERTY_VALIDATION_SATURATE or wxPG_PROPERTY_VALIDATION_WRAP. // back to it when mode is wxPG_PROPERTY_VALIDATION_SATURATE or wxPG_PROPERTY_VALIDATION_WRAP.
// For argument 'value' of type 'double' there is a specialized function (below). // For argument 'value' of type 'double' there is a specialized function (below).
// //
namespace {
template<typename T> template<typename T>
bool NumericValidation( const wxPGProperty* property, bool NumericValidation( const wxPGProperty* property,
T& value, T& value,
@@ -549,6 +550,7 @@ bool NumericValidation( const wxPGProperty* property,
} }
return true; return true;
} }
} // namespace
#if wxUSE_LONGLONG #if wxUSE_LONGLONG
bool wxIntProperty::DoValidation( const wxPGProperty* property, bool wxIntProperty::DoValidation( const wxPGProperty* property,

View File

@@ -10105,6 +10105,7 @@ bool wxRichTextTable::Draw(wxDC& dc, wxRichTextDrawingContext& context, const wx
} }
// Helper function for Layout() that clears the space needed by a cell with rowspan > 1 // Helper function for Layout() that clears the space needed by a cell with rowspan > 1
static
int GetRowspanDisplacement(const wxRichTextTable* table, int row, int col, int paddingX, const wxArrayInt& colWidths) int GetRowspanDisplacement(const wxRichTextTable* table, int row, int col, int paddingX, const wxArrayInt& colWidths)
{ {
// If one or more cells above-left of this one has rowspan > 1, the affected cells below it // If one or more cells above-left of this one has rowspan > 1, the affected cells below it
@@ -10146,6 +10147,7 @@ int GetRowspanDisplacement(const wxRichTextTable* table, int row, int col, int p
} }
// Helper function for Layout() that expands any cell with rowspan > 1 // Helper function for Layout() that expands any cell with rowspan > 1
static
void ExpandCellsWithRowspan(const wxRichTextTable* table, int paddingY, int& bottomY, wxDC& dc, wxRichTextDrawingContext& context, const wxRect& availableSpace, int style) void ExpandCellsWithRowspan(const wxRichTextTable* table, int paddingY, int& bottomY, wxDC& dc, wxRichTextDrawingContext& context, const wxRect& availableSpace, int style)
{ {
// This is called when the table's cell layout is otherwise complete. // This is called when the table's cell layout is otherwise complete.

View File

@@ -688,9 +688,11 @@ extern "C"
#ifdef wxHAVE_PTHREAD_CLEANUP #ifdef wxHAVE_PTHREAD_CLEANUP
// thread exit function // thread exit function
static
void wxPthreadCleanup(void *ptr); void wxPthreadCleanup(void *ptr);
#endif // wxHAVE_PTHREAD_CLEANUP #endif // wxHAVE_PTHREAD_CLEANUP
static
void *wxPthreadStart(void *ptr); void *wxPthreadStart(void *ptr);
} // extern "C" } // extern "C"

View File

@@ -1402,7 +1402,8 @@ bool wxUnsetEnv(const wxString& variable)
#include <signal.h> #include <signal.h>
extern "C" void wxFatalSignalHandler(wxTYPE_SA_HANDLER) extern "C" {
static void wxFatalSignalHandler(wxTYPE_SA_HANDLER)
{ {
if ( wxTheApp ) if ( wxTheApp )
{ {
@@ -1412,6 +1413,7 @@ extern "C" void wxFatalSignalHandler(wxTYPE_SA_HANDLER)
abort(); abort();
} }
}
bool wxHandleFatalExceptions(bool doit) bool wxHandleFatalExceptions(bool doit)
{ {