diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-01-20 14:49:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-22 12:41:59 +0100 |
commit | 1414bbf06f376cad4409ff23a635b0605b45ead3 (patch) | |
tree | 5ee19b414452609a982fc4b9a948cbbd5b2f7629 /bin | |
parent | 90f2a582a2d5e435012ec38e50022f41b04ae882 (diff) |
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>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/find-can-be-private-symbols.classes.results | 44 | ||||
-rw-r--r-- | bin/find-can-be-private-symbols.functions.results | 38 | ||||
-rwxr-xr-x | bin/find-can-be-private-symbols.py | 24 |
3 files changed, 38 insertions, 68 deletions
diff --git a/bin/find-can-be-private-symbols.classes.results b/bin/find-can-be-private-symbols.classes.results index 0ddaeba94322..6d65d0fc9b3a 100644 --- a/bin/find-can-be-private-symbols.classes.results +++ b/bin/find-can-be-private-symbols.classes.results @@ -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 diff --git a/bin/find-can-be-private-symbols.functions.results b/bin/find-can-be-private-symbols.functions.results index 6b2b4c0e5787..e69de29bb2d1 100644 --- a/bin/find-can-be-private-symbols.functions.results +++ b/bin/find-can-be-private-symbols.functions.results @@ -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 diff --git a/bin/find-can-be-private-symbols.py b/bin/find-can-be-private-symbols.py index d679dd2a24bf..664c6bf4851b 100755 --- a/bin/find-can-be-private-symbols.py +++ b/bin/find-can-be-private-symbols.py @@ -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("(") |