find-can-be-private-symbols

update the script to use python3, and run it

Change-Id: I9c2a86e1f7a2eb889dcf214f2a2f6a31ceb1f59e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109710
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel
2021-01-20 14:49:40 +02:00
committed by Noel Grandin
parent 90f2a582a2
commit 1414bbf06f
9 changed files with 46 additions and 76 deletions

View File

@@ -8,6 +8,7 @@ BitmapMosaicFilter
BitmapPalette
BitmapPopArtFilter
BitmapSepiaFilter
BitmapShadowFilter
BitmapSimpleColorQuantizationFilter
BitmapSmoothenFilter
BitmapSobelGreyFilter
@@ -18,21 +19,27 @@ DdeGetPutItem
DdeLink
DdeService
DdeTopic
DevelopmentToolDockingWindow
E3dCompoundObject
EditUndo
FmDesignModeChangedHint
FocusListenerMultiplexer
FontSelectPattern
FontSubsetInfo
GalleryBinaryStorageLocations
GalleryStorageLocations
GrBackendFormat
GrBackendRenderTarget
GrBackendSurfaceMutableState
GrBackendTexture
GrContext
GrContextThreadSafeProxy
GrContext_Base
GrImageContext
GrRecordingContext
GrVkExtensions
GrVkSecondaryCBDrawContext
GrYUVABackendTextureInfo
GrYUVABackendTextures
HelpLinker
Hunspell
Hunzip
@@ -41,17 +48,21 @@ IndexerPreProcessor
KeyListenerMultiplexer
MetaAction
MetaGradientExAction
MorkParser
MouseListenerMultiplexer
MouseMotionListenerMultiplexer
MyThes
NotifyEvent
OpenGLFramebuffer
OpenGLZone
PackedTextureAtlasManager
PaintListenerMultiplexer
PhysicalFontFamily
ProcessData
RenderList
Qt5Data
Qt5FilePicker
Qt5FontFace
Qt5Frame
Qt5Instance
Qt5SvpGraphics
SalData
SalDisplay
SalInfoPrinter
@@ -104,6 +115,7 @@ SfxStyleSheetModifiedHint
SfxViewFrameItem
SfxVisibilityItem
SpinListenerMultiplexer
SvStreamEOFException
SvxPrintItem
SvxRsidItem
SvxShowText
@@ -113,6 +125,7 @@ SwAuthenticator
SwColExample
SwConnectionListener
SwContrastGrf
SwDocShell::LockAllViewsGuard_Impl
SwDrawFrameFormat
SwDrawModeGrf
SwExtraRedline
@@ -162,6 +175,7 @@ XMLCellStyleExport
XMLConstantsPropertyHandler
XMLEnumPropertyHdl
XMLShapeStyleContext
basegfx::B2DTrapezoid
basegfx::BColorModifier
canvas
chart::PopupRequest
@@ -189,6 +203,7 @@ connectivity::odbc::OTools
connectivity::sdbcx::IObjectCollection
connectivity::sdbcx::OGroup
connectivity::sdbcx::OKey
covariant return thunk to ScEditWindow
cppu::BootstrapException
cppu::ClassData
cppu::ClassDataBase
@@ -218,16 +233,6 @@ formula::FormulaMissingToken
formula::FormulaTokenIterator::Item
formula::FormulaTypedDoubleToken
formula::FormulaUnknownToken
framework::AddonMenuManager
framework::ConfigAccess
framework::ConstItemContainer
framework::Converter
framework::HandlerCache
framework::MenuConfiguration
framework::SaxNamespaceFilter
framework::StatusBarConfiguration
framework::ToolBoxConfiguration
framework::TransactionManager
jvmaccess::UnoVirtualMachine::CreationException
jvmaccess::VirtualMachine::AttachGuard::CreationException
linguistic::PropertyChgHelper
@@ -250,8 +255,6 @@ sdr::ViewSelection
sdr::animation::primitiveAnimator
sdr::contact::ObjectContactPainter
sfx2::sidebar::Panel
sfx2::sidebar::SidebarToolBox
svtools::ToolbarPopup
svx::CommonStyleManager
svx::PropertyValueProvider
sw::BroadcastingModify
@@ -264,8 +267,13 @@ ucbhelper::InteractionRetry
ucbhelper::InteractionSupplyAuthentication
utl::OInputStreamHelper
vcl::ExtOutDevData
vcl::test::OutputDeviceTestGradient
void OpenGLTexture
vcl::filter::PDFBooleanElement
vcl::filter::PDFCommentElement
vcl::filter::PDFEndObjectElement
vcl::filter::PDFEndStreamElement
vcl::filter::PDFHexStringElement
vcl::filter::PDFLiteralStringElement
vcl::filter::PDFNullElement
writerperfect::DirectoryStream::Impl
xmloff::OControlBorderHandler
xmloff::OFontWidthHandler

View File

@@ -1,38 +0,0 @@
ImplCallPreNotify(NotifyEvent&)
ImplDestroyHelpWindow(bool)
ImplFastBitmapConversion(BitmapBuffer&, BitmapBuffer const&, SalTwoRect const&)
ImplGetSalSystem()
ImplHideSplash()
ImplSVMain()
ScFilterCreate
SdResId(char const*, int)
Simplify(SkPath const&, SkPath*)
clewErrorString
component_getImplementationEnvironment
createLink
ddot
dl_cairo_surface_set_device_scale(_cairo_surface*, double, double)
endlu(SvStream&)
explain
fieldlen(char const*)
getDataArea
heuristics
invert
libreofficekit_hook
libreofficekit_hook_2
main
mod
privateSnippetExecutor
reg_closeKey(void*)
reg_closeRegistry(void*)
reg_dumpRegistry(void*)
reg_openKey(void*, _rtl_uString*, void**)
reg_openRegistry(_rtl_uString*, void**)
reg_openRootKey(void*, void**)
report
scale
setLink
set_column
set_title
spaces
vcl_crc64

View File

@@ -1,4 +1,4 @@
#!/usr/bin/python2
#!/usr/bin/python3
#
# Find exported symbols that can be made non-exported.
#
@@ -43,18 +43,18 @@ with subprocess_find.stdout as txt:
for line in txt:
sharedlib = line.strip()
# look for exported symbols
subprocess_nm = subprocess.Popen("nm -D " + sharedlib, stdout=subprocess.PIPE, shell=True)
subprocess_nm = subprocess.Popen(b"nm -D " + sharedlib, stdout=subprocess.PIPE, shell=True)
with subprocess_nm.stdout as txt2:
# We are looking for lines something like:
# 0000000000036ed0 T flash_component_getFactory
line_regex = re.compile(r'^[0-9a-fA-F]+ T ')
for line2 in txt2:
line2 = line2.strip()
for line2_bytes in txt2:
line2 = line2_bytes.strip().decode("utf-8")
if line_regex.match(line2):
sym = line2.split(" ")[2]
exported_symbols.add(sym)
# look for imported symbols
subprocess_objdump = subprocess.Popen("objdump -T " + sharedlib, stdout=subprocess.PIPE, shell=True)
subprocess_objdump = subprocess.Popen(b"objdump -T " + sharedlib, stdout=subprocess.PIPE, shell=True)
with subprocess_objdump.stdout as txt2:
# ignore some header bumpf
txt2.readline()
@@ -63,8 +63,8 @@ with subprocess_find.stdout as txt:
txt2.readline()
# We are looking for lines something like:
# 0000000000000000 DF *UND* 0000000000000000 _ZN16FilterConfigItem10WriteInt32ERKN3rtl8OUStringEi
for line2 in txt2:
line2 = line2.strip()
for line2_bytes in txt2:
line2 = line2_bytes.strip().decode("utf-8")
tokens = line2.split(" ")
if len(tokens) < 7 or not(tokens[7].startswith("*UND*")): continue
sym = tokens[len(tokens)-1]
@@ -77,12 +77,12 @@ with subprocess_find.stdout as txt:
for line in txt:
executable = line.strip()
# look for exported symbols
subprocess_nm = subprocess.Popen("nm -D " + executable + " | grep -w U", stdout=subprocess.PIPE, shell=True)
subprocess_nm = subprocess.Popen(b"nm -D " + executable + b" | grep -w U", stdout=subprocess.PIPE, shell=True)
with subprocess_nm.stdout as txt2:
# We are looking for lines something like:
# U sal_detail_deinitialize
for line2 in txt2:
line2 = line2.strip()
for line2_bytes in txt2:
line2 = line2_bytes.strip().decode("utf-8")
sym = line2.split(" ")[1]
imported_symbols.add(sym)
subprocess_find.terminate()
@@ -93,7 +93,7 @@ print("imported = " + str(len(imported_symbols)))
print("diff = " + str(len(diff)))
for sym in exported_symbols:
filtered_sym = subprocess.check_output(["c++filt", sym]).strip()
filtered_sym = subprocess.check_output(["c++filt", sym]).strip().decode("utf-8")
if filtered_sym.startswith("non-virtual thunk to "): filtered_sym = filtered_sym[21:]
elif filtered_sym.startswith("virtual thunk to "): filtered_sym = filtered_sym[17:]
i = filtered_sym.find("(")
@@ -108,7 +108,7 @@ for sym in exported_symbols:
if not(sym in imported_symbols): unused_function_exports.add(func)
for sym in imported_symbols:
filtered_sym = subprocess.check_output(["c++filt", sym]).strip()
filtered_sym = subprocess.check_output(["c++filt", sym]).strip().decode("utf-8")
if filtered_sym.startswith("non-virtual thunk to "): filtered_sym = filtered_sym[21:]
elif filtered_sym.startswith("virtual thunk to "): filtered_sym = filtered_sym[17:]
i = filtered_sym.find("(")

View File

@@ -36,7 +36,7 @@
namespace oox {
class OOX_DLLPUBLIC TokenMap
class TokenMap
{
public:
explicit TokenMap();

View File

@@ -28,7 +28,7 @@
* and after close moved to the original parent
*/
class VCL_DLLPUBLIC NotebookbarPopup : public FloatingWindow
class NotebookbarPopup : public FloatingWindow
{
private:
VclPtr<VclHBox> m_pBox;

View File

@@ -59,7 +59,7 @@ namespace o3tl
struct SvLBoxButtonData_Impl;
class VCL_DLLPUBLIC SvLBoxButtonData
class SvLBoxButtonData
{
private:
Link<SvLBoxButtonData*,void> aLink;
@@ -69,8 +69,8 @@ private:
bool bDataOk;
std::vector<Image> aBmps; // indices s. constants BMP_...
VCL_DLLPRIVATE void SetWidthAndHeight();
VCL_DLLPRIVATE void InitData( bool _bRadioBtn, const Control* pControlForSettings );
void SetWidthAndHeight();
void InitData( bool _bRadioBtn, const Control* pControlForSettings );
public:
// include creating default images (CheckBox or RadioButton)
SvLBoxButtonData( const Control* pControlForSettings, bool _bRadioBtn );

View File

@@ -464,7 +464,7 @@ namespace o3tl {
namespace vcl {
class VCL_DLLPUBLIC RenderTools
class RenderTools
{
public:
// transparent background for selected or checked items in toolboxes etc.

View File

@@ -73,7 +73,7 @@ struct SD_DLLPUBLIC CustomAnnotationMarker
std::vector<basegfx::B2DPolygon> maPolygons;
};
class SD_DLLPUBLIC Annotation : private ::cppu::BaseMutex,
class Annotation : private ::cppu::BaseMutex,
public ::cppu::WeakComponentImplHelper<css::office::XAnnotation>,
public ::cppu::PropertySetMixin<css::office::XAnnotation>
{

View File

@@ -53,7 +53,7 @@ struct VCL_DLLPUBLIC ExternalPDFStream
};
// Class to manage external PDF streams, for the de-duplication purpose.
class VCL_DLLPUBLIC ExternalPDFStreams
class ExternalPDFStreams
{
private:
std::map<std::vector<sal_uInt8>, sal_Int32> maStreamIndexMap;