summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp2
-rw-r--r--Userland/Applets/ClipboardHistory/ClipboardHistoryModel.h4
-rw-r--r--Userland/Applets/Keymap/KeymapStatusWindow.cpp2
-rw-r--r--Userland/Applets/Network/main.cpp4
-rw-r--r--Userland/Applets/ResourceGraph/main.cpp6
-rw-r--r--Userland/Applications/3DFileViewer/Mesh.cpp2
-rw-r--r--Userland/Applications/Assistant/FuzzyMatch.cpp18
-rw-r--r--Userland/Applications/Assistant/Providers.cpp2
-rw-r--r--Userland/Applications/Assistant/Providers.h2
-rw-r--r--Userland/Applications/Browser/BookmarksBarWidget.cpp12
-rw-r--r--Userland/Applications/Browser/BookmarksBarWidget.h14
-rw-r--r--Userland/Applications/Browser/ConsoleWidget.cpp2
-rw-r--r--Userland/Applications/Browser/ConsoleWidget.h2
-rw-r--r--Userland/Applications/Browser/CookieJar.cpp18
-rw-r--r--Userland/Applications/Browser/CookieJar.h14
-rw-r--r--Userland/Applications/Browser/CookiesModel.cpp2
-rw-r--r--Userland/Applications/Browser/History.cpp8
-rw-r--r--Userland/Applications/Browser/History.h8
-rw-r--r--Userland/Applications/Browser/InspectorWidget.cpp2
-rw-r--r--Userland/Applications/Browser/Tab.cpp8
-rw-r--r--Userland/Applications/Browser/Tab.h18
-rw-r--r--Userland/Applications/Browser/main.cpp2
-rw-r--r--Userland/Applications/Calculator/KeypadValue.cpp2
-rw-r--r--Userland/Applications/CrashReporter/main.cpp2
-rw-r--r--Userland/Applications/Debugger/main.cpp16
-rw-r--r--Userland/Applications/Help/ManualModel.cpp28
-rw-r--r--Userland/Applications/Help/ManualModel.h2
-rw-r--r--Userland/Applications/Help/ManualNode.h2
-rw-r--r--Userland/Applications/Help/ManualPageNode.cpp2
-rw-r--r--Userland/Applications/Help/ManualPageNode.h6
-rw-r--r--Userland/Applications/Help/ManualSectionNode.h4
-rw-r--r--Userland/Applications/HexEditor/HexDocument.h2
-rw-r--r--Userland/Applications/HexEditor/HexEditor.cpp8
-rw-r--r--Userland/Applications/HexEditor/SearchResultsModel.h2
-rw-r--r--Userland/Applications/ImageViewer/ViewWidget.cpp12
-rw-r--r--Userland/Applications/ImageViewer/ViewWidget.h14
-rw-r--r--Userland/Applications/ImageViewer/main.cpp4
-rw-r--r--Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp2
-rw-r--r--Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h2
-rw-r--r--Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp2
-rw-r--r--Userland/Applications/PDFViewer/OutlineModel.cpp4
-rw-r--r--Userland/Applications/PDFViewer/OutlineModel.h4
-rw-r--r--Userland/Applications/PDFViewer/PDFViewer.h2
-rw-r--r--Userland/Applications/PDFViewer/main.cpp2
-rw-r--r--Userland/Applications/Piano/KeysWidget.cpp2
-rw-r--r--Userland/Applications/Piano/KeysWidget.h2
-rw-r--r--Userland/Applications/Piano/Music.h2
-rw-r--r--Userland/Applications/Piano/RollWidget.cpp2
-rw-r--r--Userland/Applications/Piano/RollWidget.h6
-rw-r--r--Userland/Applications/Piano/Track.cpp2
-rw-r--r--Userland/Applications/Piano/Track.h8
-rw-r--r--Userland/Applications/PixelPaint/EditGuideDialog.cpp2
-rw-r--r--Userland/Applications/PixelPaint/FilterModel.cpp8
-rw-r--r--Userland/Applications/PixelPaint/FilterPreviewWidget.cpp2
-rw-r--r--Userland/Applications/PixelPaint/FilterPreviewWidget.h2
-rw-r--r--Userland/Applications/PixelPaint/Image.cpp6
-rw-r--r--Userland/Applications/PixelPaint/ImageEditor.cpp44
-rw-r--r--Userland/Applications/PixelPaint/MainWidget.cpp2
-rw-r--r--Userland/Applications/PixelPaint/Tools/BrushTool.cpp2
-rw-r--r--Userland/Applications/PixelPaint/Tools/GuideTool.cpp2
-rw-r--r--Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp2
-rw-r--r--Userland/Applications/PixelPaint/Tools/SprayTool.cpp8
-rw-r--r--Userland/Applications/PixelPaint/main.cpp2
-rw-r--r--Userland/Applications/Run/RunWindow.cpp8
-rw-r--r--Userland/Applications/Run/RunWindow.h4
-rw-r--r--Userland/Applications/SoundPlayer/M3UParser.cpp8
-rw-r--r--Userland/Applications/SoundPlayer/M3UParser.h2
-rw-r--r--Userland/Applications/SoundPlayer/PlaybackManager.cpp2
-rw-r--r--Userland/Applications/SoundPlayer/PlaybackManager.h2
-rw-r--r--Userland/Applications/SoundPlayer/Playlist.cpp4
-rw-r--r--Userland/Applications/SoundPlayer/PlaylistWidget.cpp4
-rw-r--r--Userland/Applications/SoundPlayer/PlaylistWidget.h2
-rw-r--r--Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp28
-rw-r--r--Userland/Applications/SpaceAnalyzer/TreeMapWidget.h18
-rw-r--r--Userland/Applications/SpaceAnalyzer/main.cpp10
-rw-r--r--Userland/Applications/Spreadsheet/Cell.cpp8
-rw-r--r--Userland/Applications/Spreadsheet/Cell.h22
-rw-r--r--Userland/Applications/Spreadsheet/CellSyntaxHighlighter.cpp2
-rw-r--r--Userland/Applications/Spreadsheet/CellSyntaxHighlighter.h6
-rw-r--r--Userland/Applications/Spreadsheet/CellType/Date.cpp4
-rw-r--r--Userland/Applications/Spreadsheet/CellType/Date.h4
-rw-r--r--Userland/Applications/Spreadsheet/CellType/Format.cpp8
-rw-r--r--Userland/Applications/Spreadsheet/CellType/Format.h2
-rw-r--r--Userland/Applications/Spreadsheet/CellType/Identity.cpp4
-rw-r--r--Userland/Applications/Spreadsheet/CellType/Identity.h4
-rw-r--r--Userland/Applications/Spreadsheet/CellType/Numeric.cpp4
-rw-r--r--Userland/Applications/Spreadsheet/CellType/Numeric.h4
-rw-r--r--Userland/Applications/Spreadsheet/CellType/String.cpp4
-rw-r--r--Userland/Applications/Spreadsheet/CellType/String.h4
-rw-r--r--Userland/Applications/Spreadsheet/CellType/Type.cpp2
-rw-r--r--Userland/Applications/Spreadsheet/CellType/Type.h8
-rw-r--r--Userland/Applications/Spreadsheet/CellTypeDialog.cpp8
-rw-r--r--Userland/Applications/Spreadsheet/CellTypeDialog.h8
-rw-r--r--Userland/Applications/Spreadsheet/ExportDialog.cpp6
-rw-r--r--Userland/Applications/Spreadsheet/ExportDialog.h4
-rw-r--r--Userland/Applications/Spreadsheet/HelpWindow.cpp2
-rw-r--r--Userland/Applications/Spreadsheet/JSIntegration.cpp2
-rw-r--r--Userland/Applications/Spreadsheet/Position.h8
-rw-r--r--Userland/Applications/Spreadsheet/Readers/XSV.cpp2
-rw-r--r--Userland/Applications/Spreadsheet/Readers/XSV.h4
-rw-r--r--Userland/Applications/Spreadsheet/Spreadsheet.cpp16
-rw-r--r--Userland/Applications/Spreadsheet/Spreadsheet.h34
-rw-r--r--Userland/Applications/Spreadsheet/SpreadsheetModel.cpp8
-rw-r--r--Userland/Applications/Spreadsheet/SpreadsheetView.cpp4
-rw-r--r--Userland/Applications/Spreadsheet/SpreadsheetView.h6
-rw-r--r--Userland/Applications/Spreadsheet/SpreadsheetWidget.h4
-rw-r--r--Userland/Applications/Spreadsheet/Workbook.cpp2
-rw-r--r--Userland/Applications/Spreadsheet/Workbook.h6
-rw-r--r--Userland/Applications/Spreadsheet/Writers/CSV.h2
-rw-r--r--Userland/Applications/Spreadsheet/Writers/XSV.h8
-rw-r--r--Userland/Applications/Spreadsheet/main.cpp2
-rw-r--r--Userland/Applications/SystemMonitor/GraphWidget.cpp24
-rw-r--r--Userland/Applications/SystemMonitor/MemoryStatsWidget.cpp2
-rw-r--r--Userland/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp4
-rw-r--r--Userland/Applications/SystemMonitor/main.cpp6
-rw-r--r--Userland/Applications/Terminal/main.cpp6
-rw-r--r--Userland/Applications/ThemeEditor/PreviewWidget.cpp8
-rw-r--r--Userland/Applications/ThemeEditor/PreviewWidget.h6
-rw-r--r--Userland/Applications/ThemeEditor/main.cpp2
-rw-r--r--Userland/Demos/Cube/Cube.cpp8
-rw-r--r--Userland/Demos/LibGfxDemo/main.cpp4
-rw-r--r--Userland/Demos/LibGfxScaleDemo/main.cpp4
-rw-r--r--Userland/Demos/Mandelbrot/Mandelbrot.cpp8
-rw-r--r--Userland/Demos/WidgetGallery/GalleryWidget.cpp10
-rw-r--r--Userland/DevTools/HackStudio/ClassViewWidget.cpp6
-rw-r--r--Userland/DevTools/HackStudio/CodeDocument.cpp4
-rw-r--r--Userland/DevTools/HackStudio/CodeDocument.h10
-rw-r--r--Userland/DevTools/HackStudio/Debugger/BacktraceModel.cpp2
-rw-r--r--Userland/DevTools/HackStudio/Debugger/BacktraceModel.h2
-rw-r--r--Userland/DevTools/HackStudio/Debugger/BreakpointCallback.h2
-rw-r--r--Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp6
-rw-r--r--Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.h2
-rw-r--r--Userland/DevTools/HackStudio/Debugger/Debugger.cpp24
-rw-r--r--Userland/DevTools/HackStudio/Debugger/Debugger.h26
-rw-r--r--Userland/DevTools/HackStudio/Debugger/DebuggerGlobalJSObject.cpp4
-rw-r--r--Userland/DevTools/HackStudio/Debugger/DebuggerGlobalJSObject.h4
-rw-r--r--Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.cpp4
-rw-r--r--Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.h6
-rw-r--r--Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp4
-rw-r--r--Userland/DevTools/HackStudio/Debugger/DisassemblyModel.h4
-rw-r--r--Userland/DevTools/HackStudio/Debugger/DisassemblyWidget.cpp4
-rw-r--r--Userland/DevTools/HackStudio/Debugger/DisassemblyWidget.h10
-rw-r--r--Userland/DevTools/HackStudio/Debugger/EvaluateExpressionDialog.cpp2
-rw-r--r--Userland/DevTools/HackStudio/Debugger/EvaluateExpressionDialog.h2
-rw-r--r--Userland/DevTools/HackStudio/Debugger/RegistersModel.cpp4
-rw-r--r--Userland/DevTools/HackStudio/Debugger/RegistersModel.h10
-rw-r--r--Userland/DevTools/HackStudio/Debugger/VariablesModel.cpp18
-rw-r--r--Userland/DevTools/HackStudio/Debugger/VariablesModel.h2
-rw-r--r--Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp2
-rw-r--r--Userland/DevTools/HackStudio/Editor.cpp28
-rw-r--r--Userland/DevTools/HackStudio/Editor.h16
-rw-r--r--Userland/DevTools/HackStudio/EditorWrapper.cpp2
-rw-r--r--Userland/DevTools/HackStudio/EditorWrapper.h6
-rw-r--r--Userland/DevTools/HackStudio/FindInFilesWidget.cpp2
-rw-r--r--Userland/DevTools/HackStudio/GMLPreviewWidget.cpp2
-rw-r--r--Userland/DevTools/HackStudio/Git/DiffViewer.cpp16
-rw-r--r--Userland/DevTools/HackStudio/Git/DiffViewer.h8
-rw-r--r--Userland/DevTools/HackStudio/Git/GitWidget.cpp4
-rw-r--r--Userland/DevTools/HackStudio/Git/GitWidget.h2
-rw-r--r--Userland/DevTools/HackStudio/HackStudio.h4
-rw-r--r--Userland/DevTools/HackStudio/HackStudioWidget.cpp18
-rw-r--r--Userland/DevTools/HackStudio/HackStudioWidget.h12
-rw-r--r--Userland/DevTools/HackStudio/Language.cpp6
-rw-r--r--Userland/DevTools/HackStudio/Language.h6
-rw-r--r--Userland/DevTools/HackStudio/LanguageClient.cpp34
-rw-r--r--Userland/DevTools/HackStudio/LanguageClient.h44
-rw-r--r--Userland/DevTools/HackStudio/LanguageClients/ConnectionsToServer.h4
-rw-r--r--Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.cpp4
-rw-r--r--Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.h24
-rw-r--r--Userland/DevTools/HackStudio/LanguageServers/Cpp/ConnectionFromClient.h2
-rw-r--r--Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.cpp122
-rw-r--r--Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.h88
-rw-r--r--Userland/DevTools/HackStudio/LanguageServers/Cpp/Tests.cpp2
-rw-r--r--Userland/DevTools/HackStudio/LanguageServers/FileDB.cpp28
-rw-r--r--Userland/DevTools/HackStudio/LanguageServers/FileDB.h28
-rw-r--r--Userland/DevTools/HackStudio/LanguageServers/Shell/ConnectionFromClient.h2
-rw-r--r--Userland/DevTools/HackStudio/LanguageServers/Shell/ShellComprehensionEngine.cpp32
-rw-r--r--Userland/DevTools/HackStudio/LanguageServers/Shell/ShellComprehensionEngine.h24
-rw-r--r--Userland/DevTools/HackStudio/Locator.cpp6
-rw-r--r--Userland/DevTools/HackStudio/Project.cpp8
-rw-r--r--Userland/DevTools/HackStudio/Project.h8
-rw-r--r--Userland/DevTools/HackStudio/ProjectBuilder.cpp6
-rw-r--r--Userland/DevTools/HackStudio/ProjectDeclarations.cpp2
-rw-r--r--Userland/DevTools/HackStudio/ProjectDeclarations.h2
-rw-r--r--Userland/DevTools/HackStudio/ProjectFile.cpp2
-rw-r--r--Userland/DevTools/HackStudio/ProjectFile.h6
-rw-r--r--Userland/DevTools/HackStudio/ProjectTemplate.cpp8
-rw-r--r--Userland/DevTools/HackStudio/ProjectTemplate.h12
-rw-r--r--Userland/DevTools/HackStudio/TerminalWrapper.cpp4
-rw-r--r--Userland/DevTools/HackStudio/TerminalWrapper.h2
-rw-r--r--Userland/DevTools/HackStudio/ToDoEntriesWidget.cpp2
-rw-r--r--Userland/DevTools/HackStudio/main.cpp8
-rw-r--r--Userland/DevTools/Inspector/RemoteObjectPropertyModel.cpp20
-rw-r--r--Userland/DevTools/Inspector/RemoteObjectPropertyModel.h4
-rw-r--r--Userland/DevTools/Inspector/RemoteProcess.cpp6
-rw-r--r--Userland/DevTools/Inspector/RemoteProcess.h12
-rw-r--r--Userland/DevTools/Playground/main.cpp6
-rw-r--r--Userland/DevTools/Profiler/FilesystemEventModel.cpp4
-rw-r--r--Userland/DevTools/Profiler/Profile.cpp2
-rw-r--r--Userland/DevTools/UserspaceEmulator/Emulator.h4
-rw-r--r--Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp24
-rw-r--r--Userland/DevTools/UserspaceEmulator/MallocTracer.cpp4
-rw-r--r--Userland/DevTools/UserspaceEmulator/MallocTracer.h10
-rw-r--r--Userland/DevTools/UserspaceEmulator/MmapRegion.cpp2
-rw-r--r--Userland/DevTools/UserspaceEmulator/MmapRegion.h2
-rw-r--r--Userland/DevTools/UserspaceEmulator/Range.cpp2
-rw-r--r--Userland/DevTools/UserspaceEmulator/Range.h6
-rw-r--r--Userland/DevTools/UserspaceEmulator/RangeAllocator.cpp4
-rw-r--r--Userland/DevTools/UserspaceEmulator/RangeAllocator.h6
-rw-r--r--Userland/DevTools/UserspaceEmulator/Region.h4
-rw-r--r--Userland/DevTools/UserspaceEmulator/SoftCPU.cpp6
-rw-r--r--Userland/DevTools/UserspaceEmulator/SoftCPU.h4
-rw-r--r--Userland/DevTools/UserspaceEmulator/SoftFPU.cpp2
-rw-r--r--Userland/DevTools/UserspaceEmulator/SoftMMU.cpp8
-rw-r--r--Userland/DevTools/UserspaceEmulator/SoftMMU.h2
-rw-r--r--Userland/DevTools/UserspaceEmulator/ValueWithShadow.h6
-rw-r--r--Userland/DynamicLoader/main.cpp4
-rw-r--r--Userland/DynamicLoader/misc.cpp2
-rw-r--r--Userland/DynamicLoader/misc.h2
-rw-r--r--Userland/Games/Breakout/Game.cpp2
-rw-r--r--Userland/Games/Breakout/Game.h2
-rw-r--r--Userland/Games/Chess/ChessWidget.cpp28
-rw-r--r--Userland/Games/Chess/ChessWidget.h14
-rw-r--r--Userland/Games/Chess/Engine.cpp4
-rw-r--r--Userland/Games/Chess/Engine.h8
-rw-r--r--Userland/Games/FlappyBug/Game.h12
-rw-r--r--Userland/Games/GameOfLife/Board.h2
-rw-r--r--Userland/Games/GameOfLife/BoardWidget.h2
-rw-r--r--Userland/Games/GameOfLife/main.cpp2
-rw-r--r--Userland/Games/Hearts/Game.cpp4
-rw-r--r--Userland/Games/Hearts/Player.cpp2
-rw-r--r--Userland/Games/Minesweeper/Field.h2
-rw-r--r--Userland/Games/Snake/SnakeGame.cpp6
-rw-r--r--Userland/Games/Snake/SnakeGame.h8
-rw-r--r--Userland/Games/Solitaire/Game.cpp2
-rw-r--r--Userland/Games/Solitaire/Game.h2
-rw-r--r--Userland/Libraries/LibArchive/Tar.cpp4
-rw-r--r--Userland/Libraries/LibArchive/Tar.h14
-rw-r--r--Userland/Libraries/LibArchive/TarStream.cpp4
-rw-r--r--Userland/Libraries/LibArchive/TarStream.h6
-rw-r--r--Userland/Libraries/LibArchive/Zip.cpp6
-rw-r--r--Userland/Libraries/LibArchive/Zip.h18
-rw-r--r--Userland/Libraries/LibAudio/Buffer.h4
-rw-r--r--Userland/Libraries/LibAudio/FlacLoader.h2
-rw-r--r--Userland/Libraries/LibAudio/Loader.h4
-rw-r--r--Userland/Libraries/LibAudio/MP3HuffmanTables.h2
-rw-r--r--Userland/Libraries/LibAudio/WavLoader.cpp4
-rw-r--r--Userland/Libraries/LibAudio/WavLoader.h4
-rw-r--r--Userland/Libraries/LibAudio/WavWriter.cpp2
-rw-r--r--Userland/Libraries/LibAudio/WavWriter.h4
-rw-r--r--Userland/Libraries/LibC/arpa/inet.cpp12
-rw-r--r--Userland/Libraries/LibC/arpa/inet.h6
-rw-r--r--Userland/Libraries/LibC/assert.cpp2
-rw-r--r--Userland/Libraries/LibC/assert.h2
-rw-r--r--Userland/Libraries/LibC/bits/pthread_forward.h2
-rw-r--r--Userland/Libraries/LibC/bits/pthread_integration.h4
-rw-r--r--Userland/Libraries/LibC/bits/search.h4
-rw-r--r--Userland/Libraries/LibC/bits/stdio_file_implementation.h6
-rw-r--r--Userland/Libraries/LibC/ctype.cpp2
-rw-r--r--Userland/Libraries/LibC/ctype.h2
-rw-r--r--Userland/Libraries/LibC/dirent.cpp8
-rw-r--r--Userland/Libraries/LibC/dirent.h4
-rw-r--r--Userland/Libraries/LibC/elf.h4
-rw-r--r--Userland/Libraries/LibC/errno.h2
-rw-r--r--Userland/Libraries/LibC/fcntl.cpp8
-rw-r--r--Userland/Libraries/LibC/fcntl.h8
-rw-r--r--Userland/Libraries/LibC/fenv.cpp6
-rw-r--r--Userland/Libraries/LibC/fenv.h8
-rw-r--r--Userland/Libraries/LibC/getopt.cpp16
-rw-r--r--Userland/Libraries/LibC/getopt.h4
-rw-r--r--Userland/Libraries/LibC/grp.cpp10
-rw-r--r--Userland/Libraries/LibC/grp.h4
-rw-r--r--Userland/Libraries/LibC/iconv.h2
-rw-r--r--Userland/Libraries/LibC/inttypes.cpp4
-rw-r--r--Userland/Libraries/LibC/inttypes.h4
-rw-r--r--Userland/Libraries/LibC/langinfo.cpp2
-rw-r--r--Userland/Libraries/LibC/link.h2
-rw-r--r--Userland/Libraries/LibC/locale.cpp2
-rw-r--r--Userland/Libraries/LibC/locale.h2
-rw-r--r--Userland/Libraries/LibC/malloc.cpp12
-rw-r--r--Userland/Libraries/LibC/net.cpp2
-rw-r--r--Userland/Libraries/LibC/netdb.cpp34
-rw-r--r--Userland/Libraries/LibC/netdb.h14
-rw-r--r--Userland/Libraries/LibC/poll.cpp2
-rw-r--r--Userland/Libraries/LibC/poll.h2
-rw-r--r--Userland/Libraries/LibC/pthread_forward.cpp2
-rw-r--r--Userland/Libraries/LibC/pthread_integration.cpp4
-rw-r--r--Userland/Libraries/LibC/pthread_tls.cpp4
-rw-r--r--Userland/Libraries/LibC/pwd.cpp12
-rw-r--r--Userland/Libraries/LibC/pwd.h4
-rw-r--r--Userland/Libraries/LibC/qsort.cpp14
-rw-r--r--Userland/Libraries/LibC/regex.cpp18
-rw-r--r--Userland/Libraries/LibC/regex.h6
-rw-r--r--Userland/Libraries/LibC/resolv.h2
-rw-r--r--Userland/Libraries/LibC/scanf.cpp2
-rw-r--r--Userland/Libraries/LibC/search.cpp12
-rw-r--r--Userland/Libraries/LibC/search.h8
-rw-r--r--Userland/Libraries/LibC/serenity.cpp8
-rw-r--r--Userland/Libraries/LibC/serenity.h6
-rw-r--r--Userland/Libraries/LibC/shadow.cpp10
-rw-r--r--Userland/Libraries/LibC/shadow.h6
-rw-r--r--Userland/Libraries/LibC/signal.cpp18
-rw-r--r--Userland/Libraries/LibC/signal.h18
-rw-r--r--Userland/Libraries/LibC/spawn.cpp28
-rw-r--r--Userland/Libraries/LibC/spawn.h24
-rw-r--r--Userland/Libraries/LibC/stat.cpp14
-rw-r--r--Userland/Libraries/LibC/stdio.cpp72
-rw-r--r--Userland/Libraries/LibC/stdio.h58
-rw-r--r--Userland/Libraries/LibC/stdlib.cpp66
-rw-r--r--Userland/Libraries/LibC/stdlib.h52
-rw-r--r--Userland/Libraries/LibC/string.cpp78
-rw-r--r--Userland/Libraries/LibC/string.h60
-rw-r--r--Userland/Libraries/LibC/strings.cpp10
-rw-r--r--Userland/Libraries/LibC/strings.h6
-rw-r--r--Userland/Libraries/LibC/sys/mman.cpp12
-rw-r--r--Userland/Libraries/LibC/sys/mman.h12
-rw-r--r--Userland/Libraries/LibC/sys/select.cpp2
-rw-r--r--Userland/Libraries/LibC/sys/select.h2
-rw-r--r--Userland/Libraries/LibC/sys/socket.cpp10
-rw-r--r--Userland/Libraries/LibC/sys/socket.h6
-rw-r--r--Userland/Libraries/LibC/sys/stat.h12
-rw-r--r--Userland/Libraries/LibC/sys/statvfs.cpp2
-rw-r--r--Userland/Libraries/LibC/sys/time.h2
-rw-r--r--Userland/Libraries/LibC/sys/xattr.cpp16
-rw-r--r--Userland/Libraries/LibC/sys/xattr.h16
-rw-r--r--Userland/Libraries/LibC/syslog.cpp14
-rw-r--r--Userland/Libraries/LibC/syslog.h16
-rw-r--r--Userland/Libraries/LibC/termcap.cpp18
-rw-r--r--Userland/Libraries/LibC/termcap.h12
-rw-r--r--Userland/Libraries/LibC/time.cpp36
-rw-r--r--Userland/Libraries/LibC/time.h14
-rw-r--r--Userland/Libraries/LibC/unistd.cpp70
-rw-r--r--Userland/Libraries/LibC/unistd.h64
-rw-r--r--Userland/Libraries/LibC/utime.cpp2
-rw-r--r--Userland/Libraries/LibC/utime.h2
-rw-r--r--Userland/Libraries/LibC/wchar.h100
-rw-r--r--Userland/Libraries/LibC/wctype.cpp4
-rw-r--r--Userland/Libraries/LibC/wctype.h4
-rw-r--r--Userland/Libraries/LibCards/Card.cpp4
-rw-r--r--Userland/Libraries/LibCards/Card.h6
-rw-r--r--Userland/Libraries/LibCards/CardStack.cpp10
-rw-r--r--Userland/Libraries/LibCards/CardStack.h18
-rw-r--r--Userland/Libraries/LibChess/Chess.cpp26
-rw-r--r--Userland/Libraries/LibChess/Chess.h34
-rw-r--r--Userland/Libraries/LibChess/UCICommand.h14
-rw-r--r--Userland/Libraries/LibChess/UCIEndpoint.cpp16
-rw-r--r--Userland/Libraries/LibChess/UCIEndpoint.h16
-rw-r--r--Userland/Libraries/LibCompress/Deflate.cpp36
-rw-r--r--Userland/Libraries/LibCompress/Deflate.h20
-rw-r--r--Userland/Libraries/LibCompress/Gzip.cpp6
-rw-r--r--Userland/Libraries/LibCompress/Gzip.h2
-rw-r--r--Userland/Libraries/LibConfig/Client.cpp2
-rw-r--r--Userland/Libraries/LibCore/Account.cpp8
-rw-r--r--Userland/Libraries/LibCore/Account.h16
-rw-r--r--Userland/Libraries/LibCore/AnonymousBuffer.h4
-rw-r--r--Userland/Libraries/LibCore/ArgsParser.cpp76
-rw-r--r--Userland/Libraries/LibCore/Command.cpp6
-rw-r--r--Userland/Libraries/LibCore/DateTime.cpp18
-rw-r--r--Userland/Libraries/LibCore/DateTime.h6
-rw-r--r--Userland/Libraries/LibCore/DirIterator.h2
-rw-r--r--Userland/Libraries/LibCore/Event.cpp4
-rw-r--r--Userland/Libraries/LibCore/Event.h4
-rw-r--r--Userland/Libraries/LibCore/EventLoop.cpp14
-rw-r--r--Userland/Libraries/LibCore/File.cpp2
-rw-r--r--Userland/Libraries/LibCore/FileStream.h2
-rw-r--r--Userland/Libraries/LibCore/IODevice.cpp10
-rw-r--r--Userland/Libraries/LibCore/IODevice.h6
-rw-r--r--Userland/Libraries/LibCore/InputBitStream.h4
-rw-r--r--Userland/Libraries/LibCore/LocalServer.cpp4
-rw-r--r--Userland/Libraries/LibCore/LocalServer.h2
-rw-r--r--Userland/Libraries/LibCore/MappedFile.h2
-rw-r--r--Userland/Libraries/LibCore/MemoryStream.h2
-rw-r--r--Userland/Libraries/LibCore/MimeData.cpp4
-rw-r--r--Userland/Libraries/LibCore/MimeData.h14
-rw-r--r--Userland/Libraries/LibCore/NetworkJob.cpp2
-rw-r--r--Userland/Libraries/LibCore/NetworkJob.h6
-rw-r--r--Userland/Libraries/LibCore/Object.cpp10
-rw-r--r--Userland/Libraries/LibCore/Object.h30
-rw-r--r--Userland/Libraries/LibCore/Property.cpp2
-rw-r--r--Userland/Libraries/LibCore/Property.h8
-rw-r--r--Userland/Libraries/LibCore/SecretString.h2
-rw-r--r--Userland/Libraries/LibCore/SocketAddress.h6
-rw-r--r--Userland/Libraries/LibCore/System.cpp2
-rw-r--r--Userland/Libraries/LibCore/SystemServerTakeover.cpp2
-rw-r--r--Userland/Libraries/LibCore/UDPServer.cpp4
-rw-r--r--Userland/Libraries/LibCore/UDPServer.h2
-rw-r--r--Userland/Libraries/LibCoredump/Backtrace.cpp4
-rw-r--r--Userland/Libraries/LibCoredump/Backtrace.h4
-rw-r--r--Userland/Libraries/LibCoredump/Reader.cpp20
-rw-r--r--Userland/Libraries/LibCoredump/Reader.h14
-rw-r--r--Userland/Libraries/LibCpp/AST.cpp20
-rw-r--r--Userland/Libraries/LibCpp/AST.h142
-rw-r--r--Userland/Libraries/LibCpp/Parser.cpp10
-rw-r--r--Userland/Libraries/LibCpp/Parser.h14
-rw-r--r--Userland/Libraries/LibCpp/Preprocessor.cpp2
-rw-r--r--Userland/Libraries/LibCpp/Preprocessor.h2
-rw-r--r--Userland/Libraries/LibCpp/Token.cpp8
-rw-r--r--Userland/Libraries/LibCpp/Token.h20
-rw-r--r--Userland/Libraries/LibCrypt/crypt.cpp8
-rw-r--r--Userland/Libraries/LibCrypt/crypt.h4
-rw-r--r--Userland/Libraries/LibCrypto/Authentication/GHash.cpp4
-rw-r--r--Userland/Libraries/LibCrypto/Authentication/GHash.h4
-rw-r--r--Userland/Libraries/LibCrypto/Authentication/HMAC.h10
-rw-r--r--Userland/Libraries/LibCrypto/BigInt/Algorithms/BitwiseOperations.cpp6
-rw-r--r--Userland/Libraries/LibCrypto/BigInt/Algorithms/SimpleOperations.cpp4
-rw-r--r--Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp42
-rw-r--r--Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h54
-rw-r--r--Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp30
-rw-r--r--Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h34
-rw-r--r--Userland/Libraries/LibCrypto/Cipher/AES.cpp12
-rw-r--r--Userland/Libraries/LibCrypto/Cipher/AES.h14
-rw-r--r--Userland/Libraries/LibCrypto/Cipher/Cipher.h8
-rw-r--r--Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h6
-rw-r--r--Userland/Libraries/LibCrypto/Hash/HashFunction.h8
-rw-r--r--Userland/Libraries/LibCrypto/Hash/HashManager.h30
-rw-r--r--Userland/Libraries/LibCrypto/Hash/MD5.cpp8
-rw-r--r--Userland/Libraries/LibCrypto/Hash/MD5.h14
-rw-r--r--Userland/Libraries/LibCrypto/Hash/SHA1.cpp6
-rw-r--r--Userland/Libraries/LibCrypto/Hash/SHA1.h10
-rw-r--r--Userland/Libraries/LibCrypto/Hash/SHA2.cpp12
-rw-r--r--Userland/Libraries/LibCrypto/Hash/SHA2.h30
-rw-r--r--Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp14
-rw-r--r--Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.h14
-rw-r--r--Userland/Libraries/LibCrypto/PK/Code/Code.h2
-rw-r--r--Userland/Libraries/LibCrypto/PK/RSA.cpp2
-rw-r--r--Userland/Libraries/LibCrypto/PK/RSA.h16
-rw-r--r--Userland/Libraries/LibDebug/DebugInfo.cpp12
-rw-r--r--Userland/Libraries/LibDebug/DebugInfo.h18
-rw-r--r--Userland/Libraries/LibDebug/DebugSession.cpp12
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/AttributeValue.h4
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/DIE.cpp2
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp8
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/DwarfInfo.h4
-rw-r--r--Userland/Libraries/LibDebug/ProcessInspector.cpp6
-rw-r--r--Userland/Libraries/LibDebug/ProcessInspector.h2
-rw-r--r--Userland/Libraries/LibDesktop/AppFile.h2
-rw-r--r--Userland/Libraries/LibDesktop/Launcher.cpp6
-rw-r--r--Userland/Libraries/LibDesktop/Launcher.h6
-rw-r--r--Userland/Libraries/LibDiff/Format.cpp4
-rw-r--r--Userland/Libraries/LibDiff/Format.h2
-rw-r--r--Userland/Libraries/LibDiff/Hunks.cpp12
-rw-r--r--Userland/Libraries/LibDiff/Hunks.h4
-rw-r--r--Userland/Libraries/LibDl/dlfcn.cpp6
-rw-r--r--Userland/Libraries/LibDl/dlfcn.h8
-rw-r--r--Userland/Libraries/LibDl/dlfcn_integration.h4
-rw-r--r--Userland/Libraries/LibEDID/EDID.cpp4
-rw-r--r--Userland/Libraries/LibEDID/EDID.h4
-rw-r--r--Userland/Libraries/LibELF/DynamicLinker.cpp32
-rw-r--r--Userland/Libraries/LibELF/DynamicLoader.cpp10
-rw-r--r--Userland/Libraries/LibELF/DynamicLoader.h6
-rw-r--r--Userland/Libraries/LibELF/DynamicObject.cpp28
-rw-r--r--Userland/Libraries/LibELF/DynamicObject.h44
-rw-r--r--Userland/Libraries/LibELF/Image.cpp16
-rw-r--r--Userland/Libraries/LibELF/Image.h34
-rw-r--r--Userland/Libraries/LibGL/GL/gl.h50
-rw-r--r--Userland/Libraries/LibGL/GLColor.cpp6
-rw-r--r--Userland/Libraries/LibGL/GLContext.cpp41
-rw-r--r--Userland/Libraries/LibGL/GLContext.h16
-rw-r--r--Userland/Libraries/LibGL/GLDraw.cpp2
-rw-r--r--Userland/Libraries/LibGL/GLTexture.cpp10
-rw-r--r--Userland/Libraries/LibGL/GLVert.cpp26
-rw-r--r--Userland/Libraries/LibGL/GLVertexArrays.cpp8
-rw-r--r--Userland/Libraries/LibGUI/AboutDialog.cpp2
-rw-r--r--Userland/Libraries/LibGUI/AboutDialog.h4
-rw-r--r--Userland/Libraries/LibGUI/AbstractButton.cpp2
-rw-r--r--Userland/Libraries/LibGUI/AbstractButton.h4
-rw-r--r--Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp14
-rw-r--r--Userland/Libraries/LibGUI/AbstractScrollableWidget.h24
-rw-r--r--Userland/Libraries/LibGUI/AbstractTableView.cpp14
-rw-r--r--Userland/Libraries/LibGUI/AbstractTableView.h24
-rw-r--r--Userland/Libraries/LibGUI/AbstractZoomPanWidget.cpp2
-rw-r--r--Userland/Libraries/LibGUI/Action.cpp20
-rw-r--r--Userland/Libraries/LibGUI/Action.h28
-rw-r--r--Userland/Libraries/LibGUI/Application.cpp14
-rw-r--r--Userland/Libraries/LibGUI/Application.h22
-rw-r--r--Userland/Libraries/LibGUI/AutocompleteProvider.cpp4
-rw-r--r--Userland/Libraries/LibGUI/AutocompleteProvider.h6
-rw-r--r--Userland/Libraries/LibGUI/Breadcrumbbar.cpp2
-rw-r--r--Userland/Libraries/LibGUI/Button.h2
-rw-r--r--Userland/Libraries/LibGUI/Calendar.cpp18
-rw-r--r--Userland/Libraries/LibGUI/ColumnsView.cpp6
-rw-r--r--Userland/Libraries/LibGUI/ColumnsView.h6
-rw-r--r--Userland/Libraries/LibGUI/ComboBox.cpp8
-rw-r--r--Userland/Libraries/LibGUI/ComboBox.h10
-rw-r--r--Userland/Libraries/LibGUI/CommonActions.cpp2
-rw-r--r--Userland/Libraries/LibGUI/CommonLocationsProvider.cpp4
-rw-r--r--Userland/Libraries/LibGUI/CommonLocationsProvider.h4
-rw-r--r--Userland/Libraries/LibGUI/ConnectionToWindowMangerServer.cpp2
-rw-r--r--Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp2
-rw-r--r--Userland/Libraries/LibGUI/Desktop.cpp2
-rw-r--r--Userland/Libraries/LibGUI/Desktop.h4
-rw-r--r--Userland/Libraries/LibGUI/DragOperation.cpp6
-rw-r--r--Userland/Libraries/LibGUI/DragOperation.h6
-rw-r--r--Userland/Libraries/LibGUI/EditingEngine.cpp14
-rw-r--r--Userland/Libraries/LibGUI/EditingEngine.h6
-rw-r--r--Userland/Libraries/LibGUI/EmojiInputDialog.h2
-rw-r--r--Userland/Libraries/LibGUI/Event.cpp2
-rw-r--r--Userland/Libraries/LibGUI/Event.h64
-rw-r--r--Userland/Libraries/LibGUI/FileIconProvider.cpp12
-rw-r--r--Userland/Libraries/LibGUI/FileIconProvider.h6
-rw-r--r--Userland/Libraries/LibGUI/FilePicker.cpp10
-rw-r--r--Userland/Libraries/LibGUI/FilePicker.h6
-rw-r--r--Userland/Libraries/LibGUI/FileSystemModel.h2
-rw-r--r--Userland/Libraries/LibGUI/FontPicker.cpp4
-rw-r--r--Userland/Libraries/LibGUI/FontPicker.h6
-rw-r--r--Userland/Libraries/LibGUI/Frame.h2
-rw-r--r--Userland/Libraries/LibGUI/GML/SyntaxHighlighter.cpp4
-rw-r--r--Userland/Libraries/LibGUI/GML/SyntaxHighlighter.h2
-rw-r--r--Userland/Libraries/LibGUI/GitCommitSyntaxHighlighter.cpp2
-rw-r--r--Userland/Libraries/LibGUI/HeaderView.cpp2
-rw-r--r--Userland/Libraries/LibGUI/HeaderView.h2
-rw-r--r--Userland/Libraries/LibGUI/Icon.cpp8
-rw-r--r--Userland/Libraries/LibGUI/Icon.h12
-rw-r--r--Userland/Libraries/LibGUI/IconView.cpp30
-rw-r--r--Userland/Libraries/LibGUI/IconView.h36
-rw-r--r--Userland/Libraries/LibGUI/ImageWidget.cpp2
-rw-r--r--Userland/Libraries/LibGUI/ImageWidget.h2
-rw-r--r--Userland/Libraries/LibGUI/JsonArrayModel.cpp6
-rw-r--r--Userland/Libraries/LibGUI/JsonArrayModel.h26
-rw-r--r--Userland/Libraries/LibGUI/Label.cpp2
-rw-r--r--Userland/Libraries/LibGUI/Label.h4
-rw-r--r--Userland/Libraries/LibGUI/Layout.cpp2
-rw-r--r--Userland/Libraries/LibGUI/Layout.h4
-rw-r--r--Userland/Libraries/LibGUI/ListView.cpp8
-rw-r--r--Userland/Libraries/LibGUI/ListView.h8
-rw-r--r--Userland/Libraries/LibGUI/Margins.h2
-rw-r--r--Userland/Libraries/LibGUI/Menu.cpp6
-rw-r--r--Userland/Libraries/LibGUI/Menu.h10
-rw-r--r--Userland/Libraries/LibGUI/MenuItem.h4
-rw-r--r--Userland/Libraries/LibGUI/ModelEditingDelegate.h8
-rw-r--r--Userland/Libraries/LibGUI/ModelIndex.cpp2
-rw-r--r--Userland/Libraries/LibGUI/ModelIndex.h12
-rw-r--r--Userland/Libraries/LibGUI/ModelSelection.cpp10
-rw-r--r--Userland/Libraries/LibGUI/ModelSelection.h12
-rw-r--r--Userland/Libraries/LibGUI/MultiView.h12
-rw-r--r--Userland/Libraries/LibGUI/Notification.h12
-rw-r--r--Userland/Libraries/LibGUI/OpacitySlider.cpp2
-rw-r--r--Userland/Libraries/LibGUI/OpacitySlider.h2
-rw-r--r--Userland/Libraries/LibGUI/ProcessChooser.cpp6
-rw-r--r--Userland/Libraries/LibGUI/ProcessChooser.h4
-rw-r--r--Userland/Libraries/LibGUI/RegularEditingEngine.cpp4
-rw-r--r--Userland/Libraries/LibGUI/RegularEditingEngine.h2
-rw-r--r--Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp2
-rw-r--r--Userland/Libraries/LibGUI/ScrollableContainerWidget.h2
-rw-r--r--Userland/Libraries/LibGUI/Scrollbar.cpp6
-rw-r--r--Userland/Libraries/LibGUI/Scrollbar.h6
-rw-r--r--Userland/Libraries/LibGUI/Shortcut.h2
-rw-r--r--Userland/Libraries/LibGUI/Slider.cpp2
-rw-r--r--Userland/Libraries/LibGUI/StackWidget.h2
-rw-r--r--Userland/Libraries/LibGUI/TabWidget.cpp6
-rw-r--r--Userland/Libraries/LibGUI/TabWidget.h10
-rw-r--r--Userland/Libraries/LibGUI/TextDocument.cpp46
-rw-r--r--Userland/Libraries/LibGUI/TextDocument.h62
-rw-r--r--Userland/Libraries/LibGUI/TextPosition.h10
-rw-r--r--Userland/Libraries/LibGUI/TextRange.h16
-rw-r--r--Userland/Libraries/LibGUI/Toolbar.cpp2
-rw-r--r--Userland/Libraries/LibGUI/TreeView.cpp36
-rw-r--r--Userland/Libraries/LibGUI/TreeView.h18
-rw-r--r--Userland/Libraries/LibGUI/ValueSlider.cpp4
-rw-r--r--Userland/Libraries/LibGUI/ValueSlider.h2
-rw-r--r--Userland/Libraries/LibGUI/Variant.cpp32
-rw-r--r--Userland/Libraries/LibGUI/Variant.h34
-rw-r--r--Userland/Libraries/LibGUI/VimEditingEngine.cpp8
-rw-r--r--Userland/Libraries/LibGUI/VimEditingEngine.h8
-rw-r--r--Userland/Libraries/LibGUI/Widget.cpp28
-rw-r--r--Userland/Libraries/LibGUI/Widget.h52
-rw-r--r--Userland/Libraries/LibGUI/Window.cpp26
-rw-r--r--Userland/Libraries/LibGUI/Window.h40
-rw-r--r--Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp4
-rw-r--r--Userland/Libraries/LibGUI/Wizards/CoverWizardPage.h4
-rw-r--r--Userland/Libraries/LibGUI/Wizards/WizardPage.cpp6
-rw-r--r--Userland/Libraries/LibGUI/Wizards/WizardPage.h6
-rw-r--r--Userland/Libraries/LibGemini/Document.h2
-rw-r--r--Userland/Libraries/LibGemini/GeminiRequest.cpp2
-rw-r--r--Userland/Libraries/LibGemini/GeminiRequest.h2
-rw-r--r--Userland/Libraries/LibGemini/Job.cpp2
-rw-r--r--Userland/Libraries/LibGemini/Job.h4
-rw-r--r--Userland/Libraries/LibGemini/Line.cpp2
-rw-r--r--Userland/Libraries/LibGfx/AffineTransform.cpp22
-rw-r--r--Userland/Libraries/LibGfx/AffineTransform.h16
-rw-r--r--Userland/Libraries/LibGfx/AntiAliasingPainter.cpp6
-rw-r--r--Userland/Libraries/LibGfx/BMPLoader.cpp8
-rw-r--r--Userland/Libraries/LibGfx/BMPLoader.h2
-rw-r--r--Userland/Libraries/LibGfx/BMPWriter.cpp6
-rw-r--r--Userland/Libraries/LibGfx/BMPWriter.h2
-rw-r--r--Userland/Libraries/LibGfx/BitmapFont.cpp2
-rw-r--r--Userland/Libraries/LibGfx/ClassicWindowTheme.cpp22
-rw-r--r--Userland/Libraries/LibGfx/ClassicWindowTheme.h24
-rw-r--r--Userland/Libraries/LibGfx/Color.h2
-rw-r--r--Userland/Libraries/LibGfx/DDSLoader.cpp4
-rw-r--r--Userland/Libraries/LibGfx/DDSLoader.h2
-rw-r--r--Userland/Libraries/LibGfx/DisjointRectSet.cpp16
-rw-r--r--Userland/Libraries/LibGfx/DisjointRectSet.h38
-rw-r--r--Userland/Libraries/LibGfx/Filters/GenericConvolutionFilter.h10
-rw-r--r--Userland/Libraries/LibGfx/Font.h10
-rw-r--r--Userland/Libraries/LibGfx/FontDatabase.cpp8
-rw-r--r--Userland/Libraries/LibGfx/FontDatabase.h8
-rw-r--r--Userland/Libraries/LibGfx/FontStyleMapping.h2
-rw-r--r--Userland/Libraries/LibGfx/GIFLoader.cpp26
-rw-r--r--Userland/Libraries/LibGfx/GIFLoader.h2
-rw-r--r--Userland/Libraries/LibGfx/ICOLoader.cpp14
-rw-r--r--Userland/Libraries/LibGfx/ICOLoader.h2
-rw-r--r--Userland/Libraries/LibGfx/JPGLoader.cpp270
-rw-r--r--Userland/Libraries/LibGfx/JPGLoader.h2
-rw-r--r--Userland/Libraries/LibGfx/Matrix.h6
-rw-r--r--Userland/Libraries/LibGfx/Matrix4x4.h10
-rw-r--r--Userland/Libraries/LibGfx/PGMLoader.cpp2
-rw-r--r--Userland/Libraries/LibGfx/PNGLoader.cpp48
-rw-r--r--Userland/Libraries/LibGfx/PNGLoader.h2
-rw-r--r--Userland/Libraries/LibGfx/Palette.cpp2
-rw-r--r--Userland/Libraries/LibGfx/Palette.h8
-rw-r--r--Userland/Libraries/LibGfx/Path.cpp22
-rw-r--r--Userland/Libraries/LibGfx/Path.h38
-rw-r--r--Userland/Libraries/LibGfx/PortableImageLoaderCommon.h12
-rw-r--r--Userland/Libraries/LibGfx/PortableImageMapLoader.h4
-rw-r--r--Userland/Libraries/LibGfx/Rect.cpp2
-rw-r--r--Userland/Libraries/LibGfx/Rect.h2
-rw-r--r--Userland/Libraries/LibGfx/ShareableBitmap.cpp2
-rw-r--r--Userland/Libraries/LibGfx/ShareableBitmap.h4
-rw-r--r--Userland/Libraries/LibGfx/Streamer.h4
-rw-r--r--Userland/Libraries/LibGfx/StylePainter.cpp16
-rw-r--r--Userland/Libraries/LibGfx/SystemTheme.cpp2
-rw-r--r--Userland/Libraries/LibGfx/SystemTheme.h10
-rw-r--r--Userland/Libraries/LibGfx/TextAlignment.h2
-rw-r--r--Userland/Libraries/LibGfx/TextDirection.h2
-rw-r--r--Userland/Libraries/LibGfx/Typeface.cpp2
-rw-r--r--Userland/Libraries/LibGfx/Typeface.h4
-rw-r--r--Userland/Libraries/LibGfx/VectorN.h16
-rw-r--r--Userland/Libraries/LibGfx/WindowTheme.h22
-rw-r--r--Userland/Libraries/LibHTTP/Job.cpp2
-rw-r--r--Userland/Libraries/LibHTTP/Job.h2
-rw-r--r--Userland/Libraries/LibIMAP/Client.cpp2
-rw-r--r--Userland/Libraries/LibIMAP/Objects.h2
-rw-r--r--Userland/Libraries/LibIPC/Connection.cpp2
-rw-r--r--Userland/Libraries/LibIPC/ConnectionFromClient.h2
-rw-r--r--Userland/Libraries/LibIPC/Dictionary.h4
-rw-r--r--Userland/Libraries/LibIPC/Message.h2
-rw-r--r--Userland/Libraries/LibIPC/Stub.h2
-rw-r--r--Userland/Libraries/LibJS/AST.cpp18
-rw-r--r--Userland/Libraries/LibJS/AST.h4
-rw-r--r--Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp2
-rw-r--r--Userland/Libraries/LibJS/Bytecode/Op.cpp16
-rw-r--r--Userland/Libraries/LibJS/Console.h6
-rw-r--r--Userland/Libraries/LibJS/Heap/Handle.h2
-rw-r--r--Userland/Libraries/LibJS/Heap/Heap.cpp12
-rw-r--r--Userland/Libraries/LibJS/Heap/Heap.h4
-rw-r--r--Userland/Libraries/LibJS/Heap/HeapBlock.h4
-rw-r--r--Userland/Libraries/LibJS/Interpreter.cpp8
-rw-r--r--Userland/Libraries/LibJS/Interpreter.h6
-rw-r--r--Userland/Libraries/LibJS/MarkupGenerator.cpp12
-rw-r--r--Userland/Libraries/LibJS/MarkupGenerator.h10
-rw-r--r--Userland/Libraries/LibJS/Parser.cpp10
-rw-r--r--Userland/Libraries/LibJS/Parser.h20
-rw-r--r--Userland/Libraries/LibJS/Runtime/ArrayBuffer.h4
-rw-r--r--Userland/Libraries/LibJS/Runtime/BigInt.h2
-rw-r--r--Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp4
-rw-r--r--Userland/Libraries/LibJS/Runtime/BoundFunction.h2
-rw-r--r--Userland/Libraries/LibJS/Runtime/DateConstructor.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h4
-rw-r--r--Userland/Libraries/LibJS/Runtime/ErrorTypes.h6
-rw-r--r--Userland/Libraries/LibJS/Runtime/FunctionObject.h2
-rw-r--r--Userland/Libraries/LibJS/Runtime/GlobalObject.cpp4
-rw-r--r--Userland/Libraries/LibJS/Runtime/IndexedProperties.cpp14
-rw-r--r--Userland/Libraries/LibJS/Runtime/IndexedProperties.h12
-rw-r--r--Userland/Libraries/LibJS/Runtime/JSONObject.cpp12
-rw-r--r--Userland/Libraries/LibJS/Runtime/JSONObject.h8
-rw-r--r--Userland/Libraries/LibJS/Runtime/NativeFunction.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/NativeFunction.h4
-rw-r--r--Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp6
-rw-r--r--Userland/Libraries/LibJS/Runtime/Object.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/Object.h4
-rw-r--r--Userland/Libraries/LibJS/Runtime/PromiseReaction.h4
-rw-r--r--Userland/Libraries/LibJS/Runtime/PropertyAttributes.h4
-rw-r--r--Userland/Libraries/LibJS/Runtime/ProxyObject.cpp4
-rw-r--r--Userland/Libraries/LibJS/Runtime/ProxyObject.h6
-rw-r--r--Userland/Libraries/LibJS/Runtime/RegExpObject.h8
-rw-r--r--Userland/Libraries/LibJS/Runtime/Shape.cpp16
-rw-r--r--Userland/Libraries/LibJS/Runtime/Shape.h22
-rw-r--r--Userland/Libraries/LibJS/Runtime/StringConstructor.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/StringPrototype.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/Symbol.h2
-rw-r--r--Userland/Libraries/LibJS/Runtime/SymbolObject.h2
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/Instant.h4
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp4
-rw-r--r--Userland/Libraries/LibJS/Runtime/TypedArray.cpp4
-rw-r--r--Userland/Libraries/LibJS/Runtime/TypedArray.h2
-rw-r--r--Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h2
-rw-r--r--Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp6
-rw-r--r--Userland/Libraries/LibJS/Runtime/VM.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/VM.h6
-rw-r--r--Userland/Libraries/LibJS/Runtime/Value.cpp8
-rw-r--r--Userland/Libraries/LibJS/Runtime/Value.h16
-rw-r--r--Userland/Libraries/LibJS/SyntaxHighlighter.cpp4
-rw-r--r--Userland/Libraries/LibJS/SyntaxHighlighter.h2
-rw-r--r--Userland/Libraries/LibJS/Token.cpp4
-rw-r--r--Userland/Libraries/LibJS/Token.h10
-rw-r--r--Userland/Libraries/LibKeyboard/CharacterMap.cpp6
-rw-r--r--Userland/Libraries/LibKeyboard/CharacterMap.h8
-rw-r--r--Userland/Libraries/LibKeyboard/CharacterMapFile.cpp6
-rw-r--r--Userland/Libraries/LibKeyboard/CharacterMapFile.h4
-rw-r--r--Userland/Libraries/LibLine/Editor.cpp2
-rw-r--r--Userland/Libraries/LibLine/Editor.h2
-rw-r--r--Userland/Libraries/LibLine/InternalFunctions.cpp4
-rw-r--r--Userland/Libraries/LibLine/KeyCallbackMachine.h2
-rw-r--r--Userland/Libraries/LibM/math.cpp6
-rw-r--r--Userland/Libraries/LibM/math.h6
-rw-r--r--Userland/Libraries/LibMarkdown/Document.cpp2
-rw-r--r--Userland/Libraries/LibMarkdown/List.cpp2
-rw-r--r--Userland/Libraries/LibMarkdown/Table.cpp2
-rw-r--r--Userland/Libraries/LibPCIDB/Database.cpp26
-rw-r--r--Userland/Libraries/LibPCIDB/Database.h2
-rw-r--r--Userland/Libraries/LibPDF/Filter.cpp4
-rw-r--r--Userland/Libraries/LibPDF/Object.h4
-rw-r--r--Userland/Libraries/LibPDF/ObjectDerivatives.h12
-rw-r--r--Userland/Libraries/LibPDF/Operator.h4
-rw-r--r--Userland/Libraries/LibPDF/Parser.cpp2
-rw-r--r--Userland/Libraries/LibPDF/Reader.h2
-rw-r--r--Userland/Libraries/LibProtocol/Request.cpp2
-rw-r--r--Userland/Libraries/LibProtocol/Request.h6
-rw-r--r--Userland/Libraries/LibProtocol/WebSocketClient.cpp2
-rw-r--r--Userland/Libraries/LibProtocol/WebSocketClient.h2
-rw-r--r--Userland/Libraries/LibPthread/pthread.cpp36
-rw-r--r--Userland/Libraries/LibPthread/pthread.h24
-rw-r--r--Userland/Libraries/LibPthread/pthread_cond.cpp2
-rw-r--r--Userland/Libraries/LibPthread/semaphore.cpp4
-rw-r--r--Userland/Libraries/LibPthread/semaphore.h4
-rw-r--r--Userland/Libraries/LibRegex/C/Regex.cpp8
-rw-r--r--Userland/Libraries/LibSQL/AST/AST.h168
-rw-r--r--Userland/Libraries/LibSQL/AST/Parser.cpp4
-rw-r--r--Userland/Libraries/LibSQL/AST/Parser.h2
-rw-r--r--Userland/Libraries/LibSQL/Meta.cpp2
-rw-r--r--Userland/Libraries/LibSQL/Tuple.cpp8
-rw-r--r--Userland/Libraries/LibSanitizer/UBSanitizer.cpp14
-rw-r--r--Userland/Libraries/LibSoftGPU/Device.cpp12
-rw-r--r--Userland/Libraries/LibSoftGPU/Device.h8
-rw-r--r--Userland/Libraries/LibSymbolication/Symbolication.cpp2
-rw-r--r--Userland/Libraries/LibSyntax/Highlighter.h6
-rw-r--r--Userland/Libraries/LibSyntax/HighlighterClient.h2
-rw-r--r--Userland/Libraries/LibTLS/Certificate.h2
-rw-r--r--Userland/Libraries/LibTLS/Handshake.cpp6
-rw-r--r--Userland/Libraries/LibTLS/HandshakeClient.cpp6
-rw-r--r--Userland/Libraries/LibTLS/HandshakeServer.cpp8
-rw-r--r--Userland/Libraries/LibTLS/Record.cpp6
-rw-r--r--Userland/Libraries/LibTLS/Socket.cpp4
-rw-r--r--Userland/Libraries/LibTLS/TLSPacketBuilder.h6
-rw-r--r--Userland/Libraries/LibTLS/TLSv12.cpp6
-rw-r--r--Userland/Libraries/LibTLS/TLSv12.h10
-rw-r--r--Userland/Libraries/LibTest/CrashTest.cpp4
-rw-r--r--Userland/Libraries/LibTest/JavaScriptTestRunner.h20
-rw-r--r--Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp4
-rw-r--r--Userland/Libraries/LibTest/Macros.h2
-rw-r--r--Userland/Libraries/LibTest/TestCase.h8
-rw-r--r--Userland/Libraries/LibTest/TestRunner.h8
-rw-r--r--Userland/Libraries/LibTest/TestSuite.cpp22
-rw-r--r--Userland/Libraries/LibTest/TestSuite.h8
-rw-r--r--Userland/Libraries/LibTextCodec/Decoder.cpp2
-rw-r--r--Userland/Libraries/LibUSBDB/Database.cpp26
-rw-r--r--Userland/Libraries/LibUSBDB/Database.h2
-rw-r--r--Userland/Libraries/LibVT/Attribute.h4
-rw-r--r--Userland/Libraries/LibVT/Color.h2
-rw-r--r--Userland/Libraries/LibVT/EscapeSequenceParser.h2
-rw-r--r--Userland/Libraries/LibVT/Line.cpp2
-rw-r--r--Userland/Libraries/LibVT/Line.h8
-rw-r--r--Userland/Libraries/LibVT/Position.h10
-rw-r--r--Userland/Libraries/LibVT/Range.h2
-rw-r--r--Userland/Libraries/LibVT/Terminal.cpp4
-rw-r--r--Userland/Libraries/LibVT/Terminal.h10
-rw-r--r--Userland/Libraries/LibVT/TerminalWidget.cpp10
-rw-r--r--Userland/Libraries/LibVT/TerminalWidget.h14
-rw-r--r--Userland/Libraries/LibVideo/VP9/Decoder.cpp2
-rw-r--r--Userland/Libraries/LibVideo/VP9/TreeParser.cpp4
-rw-r--r--Userland/Libraries/LibWasm/AbstractMachine/Configuration.cpp3
-rw-r--r--Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp4
-rw-r--r--Userland/Libraries/LibWasm/Printer/Printer.cpp14
-rw-r--r--Userland/Libraries/LibWeb/Bindings/WindowObject.h8
-rw-r--r--Userland/Libraries/LibWeb/Bindings/Wrappable.h2
-rw-r--r--Userland/Libraries/LibWeb/CSS/CSSImportRule.h4
-rw-r--r--Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h6
-rw-r--r--Userland/Libraries/LibWeb/CSS/CSSStyleRule.h4
-rw-r--r--Userland/Libraries/LibWeb/CSS/ComputedValues.h12
-rw-r--r--Userland/Libraries/LibWeb/CSS/Length.cpp2
-rw-r--r--Userland/Libraries/LibWeb/CSS/Length.h6
-rw-r--r--Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp2
-rw-r--r--Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp4
-rw-r--r--Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.h2
-rw-r--r--Userland/Libraries/LibWeb/CSS/Ratio.cpp2
-rw-r--r--Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp2
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleComputer.cpp2
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleProperties.cpp4
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleProperties.h8
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleValue.h4
-rw-r--r--Userland/Libraries/LibWeb/Cookie/ParsedCookie.cpp6
-rw-r--r--Userland/Libraries/LibWeb/Cookie/ParsedCookie.h4
-rw-r--r--Userland/Libraries/LibWeb/Crypto/Crypto.cpp24
-rw-r--r--Userland/Libraries/LibWeb/DOM/AbstractRange.h4
-rw-r--r--Userland/Libraries/LibWeb/DOM/CharacterData.cpp2
-rw-r--r--Userland/Libraries/LibWeb/DOM/CharacterData.h4
-rw-r--r--Userland/Libraries/LibWeb/DOM/Comment.cpp2
-rw-r--r--Userland/Libraries/LibWeb/DOM/Comment.h2
-rw-r--r--Userland/Libraries/LibWeb/DOM/CustomEvent.h2
-rw-r--r--Userland/Libraries/LibWeb/DOM/DOMException.h14
-rw-r--r--Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp4
-rw-r--r--Userland/Libraries/LibWeb/DOM/DOMImplementation.h2
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.cpp26
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.h52
-rw-r--r--Userland/Libraries/LibWeb/DOM/DocumentType.h12
-rw-r--r--Userland/Libraries/LibWeb/DOM/Element.cpp12
-rw-r--r--Userland/Libraries/LibWeb/DOM/Element.h34
-rw-r--r--Userland/Libraries/LibWeb/DOM/Event.cpp4
-rw-r--r--Userland/Libraries/LibWeb/DOM/Event.h12
-rw-r--r--Userland/Libraries/LibWeb/DOM/EventTarget.h4
-rw-r--r--Userland/Libraries/LibWeb/DOM/ExceptionOr.h4
-rw-r--r--Userland/Libraries/LibWeb/DOM/Node.cpp10
-rw-r--r--Userland/Libraries/LibWeb/DOM/Node.h22
-rw-r--r--Userland/Libraries/LibWeb/DOM/NonDocumentTypeChildNode.h8
-rw-r--r--Userland/Libraries/LibWeb/DOM/NonElementParentNode.h8
-rw-r--r--Userland/Libraries/LibWeb/DOM/Position.h6
-rw-r--r--Userland/Libraries/LibWeb/DOM/ProcessingInstruction.cpp2
-rw-r--r--Userland/Libraries/LibWeb/DOM/ProcessingInstruction.h4
-rw-r--r--Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp2
-rw-r--r--Userland/Libraries/LibWeb/DOM/ShadowRoot.h2
-rw-r--r--Userland/Libraries/LibWeb/DOM/Text.cpp2
-rw-r--r--Userland/Libraries/LibWeb/DOM/Text.h2
-rw-r--r--Userland/Libraries/LibWeb/DOMTreeModel.h4
-rw-r--r--Userland/Libraries/LibWeb/FontCache.cpp4
-rw-r--r--Userland/Libraries/LibWeb/FontCache.h8
-rw-r--r--Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h2
-rw-r--r--Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp8
-rw-r--r--Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h8
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp4
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.h4
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLElement.cpp6
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLElement.h4
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.h2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp4
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h4
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp4
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLImageElement.h4
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLOutputElement.h2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.h2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.h2
-rw-r--r--Userland/Libraries/LibWeb/HTML/ImageData.h2
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp12
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.h12
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp20
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.h16
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.h4
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp20
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h22
-rw-r--r--Userland/Libraries/LibWeb/InProcessWebView.cpp30
-rw-r--r--Userland/Libraries/LibWeb/InProcessWebView.h32
-rw-r--r--Userland/Libraries/LibWeb/Layout/BlockContainer.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Layout/BlockContainer.h8
-rw-r--r--Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp10
-rw-r--r--Userland/Libraries/LibWeb/Layout/FormattingContext.cpp12
-rw-r--r--Userland/Libraries/LibWeb/Layout/FormattingContext.h4
-rw-r--r--Userland/Libraries/LibWeb/Layout/ImageBox.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Layout/ImageBox.h4
-rw-r--r--Userland/Libraries/LibWeb/Layout/InitialContainingBlock.cpp4
-rw-r--r--Userland/Libraries/LibWeb/Layout/InitialContainingBlock.h6
-rw-r--r--Userland/Libraries/LibWeb/Layout/Label.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Layout/Label.h6
-rw-r--r--Userland/Libraries/LibWeb/Layout/LayoutPosition.h12
-rw-r--r--Userland/Libraries/LibWeb/Layout/LineBoxFragment.cpp6
-rw-r--r--Userland/Libraries/LibWeb/Layout/LineBoxFragment.h8
-rw-r--r--Userland/Libraries/LibWeb/Layout/Node.cpp6
-rw-r--r--Userland/Libraries/LibWeb/Layout/Node.h24
-rw-r--r--Userland/Libraries/LibWeb/Layout/TableCellBox.h2
-rw-r--r--Userland/Libraries/LibWeb/Layout/TextNode.h6
-rw-r--r--Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp6
-rw-r--r--Userland/Libraries/LibWeb/Loader/ContentFilter.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Loader/ContentFilter.h2
-rw-r--r--Userland/Libraries/LibWeb/Loader/FrameLoader.cpp14
-rw-r--r--Userland/Libraries/LibWeb/Loader/FrameLoader.h4
-rw-r--r--Userland/Libraries/LibWeb/Loader/ImageLoader.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Loader/ImageLoader.h2
-rw-r--r--Userland/Libraries/LibWeb/Loader/ImageResource.cpp4
-rw-r--r--Userland/Libraries/LibWeb/Loader/ImageResource.h6
-rw-r--r--Userland/Libraries/LibWeb/Loader/LoadRequest.h20
-rw-r--r--Userland/Libraries/LibWeb/Loader/Resource.cpp12
-rw-r--r--Userland/Libraries/LibWeb/Loader/Resource.h20
-rw-r--r--Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp10
-rw-r--r--Userland/Libraries/LibWeb/Loader/ResourceLoader.h10
-rw-r--r--Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Origin.h6
-rw-r--r--Userland/Libraries/LibWeb/OutOfProcessWebView.cpp40
-rw-r--r--Userland/Libraries/LibWeb/OutOfProcessWebView.h38
-rw-r--r--Userland/Libraries/LibWeb/Page/EventHandler.cpp12
-rw-r--r--Userland/Libraries/LibWeb/Page/EventHandler.h10
-rw-r--r--Userland/Libraries/LibWeb/Page/Page.cpp8
-rw-r--r--Userland/Libraries/LibWeb/Page/Page.h38
-rw-r--r--Userland/Libraries/LibWeb/Painting/BorderPainting.cpp4
-rw-r--r--Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp6
-rw-r--r--Userland/Libraries/LibWeb/Painting/Paintable.h8
-rw-r--r--Userland/Libraries/LibWeb/Painting/PaintableBox.cpp4
-rw-r--r--Userland/Libraries/LibWeb/Painting/PaintableBox.h2
-rw-r--r--Userland/Libraries/LibWeb/Painting/StackingContext.h2
-rw-r--r--Userland/Libraries/LibWeb/Painting/TextPaintable.cpp6
-rw-r--r--Userland/Libraries/LibWeb/Painting/TextPaintable.h6
-rw-r--r--Userland/Libraries/LibWeb/SVG/SVGContext.h6
-rw-r--r--Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp2
-rw-r--r--Userland/Libraries/LibWeb/SVG/SVGPathElement.h2
-rw-r--r--Userland/Libraries/LibWeb/TreeNode.h16
-rw-r--r--Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp2
-rw-r--r--Userland/Libraries/LibWeb/UIEvents/MouseEvent.h4
-rw-r--r--Userland/Libraries/LibWeb/URL/URL.cpp4
-rw-r--r--Userland/Libraries/LibWeb/URL/URL.h2
-rw-r--r--Userland/Libraries/LibWeb/URL/URLSearchParams.cpp4
-rw-r--r--Userland/Libraries/LibWeb/URL/URLSearchParams.h2
-rw-r--r--Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObject.cpp6
-rw-r--r--Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleObject.h2
-rw-r--r--Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp10
-rw-r--r--Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.h2
-rw-r--r--Userland/Libraries/LibWeb/WebContentClient.cpp2
-rw-r--r--Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp4
-rw-r--r--Userland/Libraries/LibWeb/WebSockets/WebSocket.h8
-rw-r--r--Userland/Libraries/LibWeb/WebViewHooks.h20
-rw-r--r--Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp14
-rw-r--r--Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h8
-rw-r--r--Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp10
-rw-r--r--Userland/Libraries/LibX86/Instruction.cpp112
-rw-r--r--Userland/Libraries/LibX86/Instruction.h92
-rw-r--r--Userland/Libraries/LibX86/Interpreter.h1286
-rw-r--r--Userland/Services/ChessEngine/ChessEngine.cpp4
-rw-r--r--Userland/Services/ChessEngine/ChessEngine.h4
-rw-r--r--Userland/Services/ChessEngine/MCTSTree.cpp2
-rw-r--r--Userland/Services/ChessEngine/MCTSTree.h2
-rw-r--r--Userland/Services/Clipboard/Storage.cpp2
-rw-r--r--Userland/Services/Clipboard/Storage.h10
-rw-r--r--Userland/Services/CrashDaemon/main.cpp6
-rw-r--r--Userland/Services/DHCPClient/DHCPv4.cpp2
-rw-r--r--Userland/Services/DHCPClient/DHCPv4.h22
-rw-r--r--Userland/Services/DHCPClient/DHCPv4Client.cpp20
-rw-r--r--Userland/Services/DHCPClient/DHCPv4Client.h12
-rw-r--r--Userland/Services/KeyboardPreferenceLoader/main.cpp2
-rw-r--r--Userland/Services/LaunchServer/Launcher.cpp32
-rw-r--r--Userland/Services/LaunchServer/Launcher.h18
-rw-r--r--Userland/Services/LookupServer/ConnectionFromClient.cpp2
-rw-r--r--Userland/Services/LookupServer/DNSAnswer.cpp2
-rw-r--r--Userland/Services/LookupServer/DNSAnswer.h6
-rw-r--r--Userland/Services/LookupServer/DNSName.cpp12
-rw-r--r--Userland/Services/LookupServer/DNSName.h14
-rw-r--r--Userland/Services/LookupServer/DNSPacket.cpp14
-rw-r--r--Userland/Services/LookupServer/DNSPacket.h10
-rw-r--r--Userland/Services/LookupServer/DNSPacketHeader.h2
-rw-r--r--Userland/Services/LookupServer/DNSQuestion.h4
-rw-r--r--Userland/Services/LookupServer/LookupServer.cpp14
-rw-r--r--Userland/Services/LookupServer/LookupServer.h6
-rw-r--r--Userland/Services/LookupServer/MulticastDNS.cpp8
-rw-r--r--Userland/Services/LookupServer/MulticastDNS.h6
-rw-r--r--Userland/Services/NotificationServer/NotificationWindow.cpp4
-rw-r--r--Userland/Services/NotificationServer/NotificationWindow.h8
-rw-r--r--Userland/Services/RequestServer/GeminiProtocol.cpp2
-rw-r--r--Userland/Services/RequestServer/GeminiProtocol.h2
-rw-r--r--Userland/Services/RequestServer/HttpCommon.h2
-rw-r--r--Userland/Services/RequestServer/HttpProtocol.cpp2
-rw-r--r--Userland/Services/RequestServer/HttpProtocol.h2
-rw-r--r--Userland/Services/RequestServer/HttpsProtocol.cpp2
-rw-r--r--Userland/Services/RequestServer/HttpsProtocol.h2
-rw-r--r--Userland/Services/RequestServer/Protocol.cpp4
-rw-r--r--Userland/Services/RequestServer/Protocol.h8
-rw-r--r--Userland/Services/RequestServer/Request.cpp2
-rw-r--r--Userland/Services/RequestServer/Request.h6
-rw-r--r--Userland/Services/SpiceAgent/SpiceAgent.cpp8
-rw-r--r--Userland/Services/SpiceAgent/SpiceAgent.h6
-rw-r--r--Userland/Services/SystemServer/Service.cpp4
-rw-r--r--Userland/Services/SystemServer/Service.h2
-rw-r--r--Userland/Services/SystemServer/main.cpp4
-rw-r--r--Userland/Services/Taskbar/ClockWidget.cpp10
-rw-r--r--Userland/Services/Taskbar/ShutdownDialog.cpp2
-rw-r--r--Userland/Services/Taskbar/TaskbarButton.cpp4
-rw-r--r--Userland/Services/Taskbar/TaskbarButton.h2
-rw-r--r--Userland/Services/Taskbar/TaskbarWindow.cpp10
-rw-r--r--Userland/Services/Taskbar/TaskbarWindow.h6
-rw-r--r--Userland/Services/Taskbar/WindowIdentifier.h4
-rw-r--r--Userland/Services/Taskbar/WindowList.cpp8
-rw-r--r--Userland/Services/Taskbar/WindowList.h22
-rw-r--r--Userland/Services/Taskbar/main.cpp4
-rw-r--r--Userland/Services/TelnetServer/Client.cpp4
-rw-r--r--Userland/Services/TelnetServer/Parser.h4
-rw-r--r--Userland/Services/WebContent/ConnectionFromClient.cpp26
-rw-r--r--Userland/Services/WebContent/ConnectionFromClient.h2
-rw-r--r--Userland/Services/WebContent/PageHost.cpp32
-rw-r--r--Userland/Services/WebContent/PageHost.h38
-rw-r--r--Userland/Services/WindowServer/AppletManager.cpp6
-rw-r--r--Userland/Services/WindowServer/AppletManager.h8
-rw-r--r--Userland/Services/WindowServer/Button.cpp2
-rw-r--r--Userland/Services/WindowServer/Button.h6
-rw-r--r--Userland/Services/WindowServer/Compositor.cpp24
-rw-r--r--Userland/Services/WindowServer/Compositor.h20
-rw-r--r--Userland/Services/WindowServer/ConnectionFromClient.h2
-rw-r--r--Userland/Services/WindowServer/Cursor.h6
-rw-r--r--Userland/Services/WindowServer/Event.h10
-rw-r--r--Userland/Services/WindowServer/KeymapSwitcher.cpp4
-rw-r--r--Userland/Services/WindowServer/KeymapSwitcher.h2
-rw-r--r--Userland/Services/WindowServer/Menu.cpp22
-rw-r--r--Userland/Services/WindowServer/Menu.h20
-rw-r--r--Userland/Services/WindowServer/MenuItem.cpp6
-rw-r--r--Userland/Services/WindowServer/MenuItem.h10
-rw-r--r--Userland/Services/WindowServer/MenuManager.cpp6
-rw-r--r--Userland/Services/WindowServer/MenuManager.h2
-rw-r--r--Userland/Services/WindowServer/MultiScaleBitmaps.cpp2
-rw-r--r--Userland/Services/WindowServer/Overlays.h8
-rw-r--r--Userland/Services/WindowServer/Screen.cpp8
-rw-r--r--Userland/Services/WindowServer/Screen.h14
-rw-r--r--Userland/Services/WindowServer/ScreenLayout.h12
-rw-r--r--Userland/Services/WindowServer/Window.cpp34
-rw-r--r--Userland/Services/WindowServer/Window.h62
-rw-r--r--Userland/Services/WindowServer/WindowFrame.cpp20
-rw-r--r--Userland/Services/WindowServer/WindowFrame.h16
-rw-r--r--Userland/Services/WindowServer/WindowManager.cpp8
-rw-r--r--Userland/Services/WindowServer/WindowManager.h4
-rw-r--r--Userland/Services/WindowServer/WindowSwitcher.cpp4
-rw-r--r--Userland/Services/WindowServer/WindowSwitcher.h2
-rw-r--r--Userland/Shell/AST.cpp38
-rw-r--r--Userland/Shell/AST.h162
-rw-r--r--Userland/Shell/Builtin.cpp102
-rw-r--r--Userland/Shell/Execution.h2
-rw-r--r--Userland/Shell/ImmediateFunctions.cpp26
-rw-r--r--Userland/Shell/Job.h2
-rw-r--r--Userland/Shell/Parser.h2
-rw-r--r--Userland/Shell/Shell.cpp30
-rw-r--r--Userland/Shell/Shell.h36
-rw-r--r--Userland/Shell/SyntaxHighlighter.cpp6
-rw-r--r--Userland/Shell/SyntaxHighlighter.h2
-rw-r--r--Userland/Shell/main.cpp8
-rw-r--r--Userland/Utilities/aplay.cpp2
-rw-r--r--Userland/Utilities/arp.cpp4
-rw-r--r--Userland/Utilities/base64.cpp2
-rw-r--r--Userland/Utilities/blockdev.cpp2
-rw-r--r--Userland/Utilities/cal.cpp6
-rw-r--r--Userland/Utilities/chgrp.cpp4
-rw-r--r--Userland/Utilities/cksum.cpp4
-rw-r--r--Userland/Utilities/comm.cpp6
-rw-r--r--Userland/Utilities/copy.cpp4
-rw-r--r--Userland/Utilities/cpp-lexer.cpp2
-rw-r--r--Userland/Utilities/cpp-parser.cpp2
-rw-r--r--Userland/Utilities/cpp-preprocessor.cpp2
-rw-r--r--Userland/Utilities/cut.cpp8
-rw-r--r--Userland/Utilities/date.cpp2
-rw-r--r--Userland/Utilities/dd.cpp2
-rw-r--r--Userland/Utilities/ddate.cpp8
-rw-r--r--Userland/Utilities/diff.cpp6
-rw-r--r--Userland/Utilities/disk_benchmark.cpp6
-rw-r--r--Userland/Utilities/du.cpp22
-rw-r--r--Userland/Utilities/echo.cpp2
-rw-r--r--Userland/Utilities/env.cpp8
-rw-r--r--Userland/Utilities/expr.cpp2
-rw-r--r--Userland/Utilities/file.cpp12
-rw-r--r--Userland/Utilities/find.cpp14
-rw-r--r--Userland/Utilities/fortune.cpp20
-rw-r--r--Userland/Utilities/functrace.cpp2
-rw-r--r--Userland/Utilities/gml-format.cpp2
-rw-r--r--Userland/Utilities/grep.cpp4
-rw-r--r--Userland/Utilities/groups.cpp4
-rw-r--r--Userland/Utilities/gunzip.cpp2
-rw-r--r--Userland/Utilities/head.cpp8
-rw-r--r--Userland/Utilities/hexdump.cpp2
-rw-r--r--Userland/Utilities/host.cpp4
-rw-r--r--Userland/Utilities/hostname.cpp2
-rw-r--r--Userland/Utilities/ifconfig.cpp8
-rw-r--r--Userland/Utilities/ini.cpp8
-rw-r--r--Userland/Utilities/jp.cpp4
-rw-r--r--Userland/Utilities/js.cpp4
-rw-r--r--Userland/Utilities/killall.cpp2
-rw-r--r--Userland/Utilities/less.cpp2
-rw-r--r--Userland/Utilities/ln.cpp4
-rw-r--r--Userland/Utilities/ls.cpp24
-rw-r--r--Userland/Utilities/lsof.cpp4
-rw-r--r--Userland/Utilities/man.cpp10
-rw-r--r--Userland/Utilities/md.cpp2
-rw-r--r--Userland/Utilities/mkdir.cpp2
-rw-r--r--Userland/Utilities/mktemp.cpp2
-rw-r--r--Userland/Utilities/mv.cpp4
-rw-r--r--Userland/Utilities/nc.cpp4
-rw-r--r--Userland/Utilities/nl.cpp6
-rw-r--r--Userland/Utilities/notify.cpp6
-rw-r--r--Userland/Utilities/ntpquery.cpp10
-rw-r--r--Userland/Utilities/passwd.cpp2
-rw-r--r--Userland/Utilities/paste.cpp6
-rw-r--r--Userland/Utilities/pathchk.cpp2
-rw-r--r--Userland/Utilities/pidof.cpp6
-rw-r--r--Userland/Utilities/ping.cpp4
-rw-r--r--Userland/Utilities/pmap.cpp2
-rw-r--r--Userland/Utilities/printf.cpp18
-rw-r--r--Userland/Utilities/pro.cpp4
-rw-r--r--Userland/Utilities/profile.cpp6
-rw-r--r--Userland/Utilities/readelf.cpp12
-rw-r--r--Userland/Utilities/realpath.cpp2
-rw-r--r--Userland/Utilities/rmdir.cpp2
-rw-r--r--Userland/Utilities/run-tests.cpp24
-rw-r--r--Userland/Utilities/seq.cpp6
-rw-r--r--Userland/Utilities/sleep.cpp2
-rw-r--r--Userland/Utilities/strace.cpp18
-rw-r--r--Userland/Utilities/stty.cpp8
-rw-r--r--Userland/Utilities/su.cpp2
-rw-r--r--Userland/Utilities/syscall.cpp6
-rw-r--r--Userland/Utilities/tail.cpp6
-rw-r--r--Userland/Utilities/tar.cpp6
-rw-r--r--Userland/Utilities/test-fuzz.cpp2
-rw-r--r--Userland/Utilities/test.cpp2
-rw-r--r--Userland/Utilities/test_env.cpp2
-rw-r--r--Userland/Utilities/top.cpp6
-rw-r--r--Userland/Utilities/touch.cpp4
-rw-r--r--Userland/Utilities/tr.cpp4
-rw-r--r--Userland/Utilities/traceroute.cpp4
-rw-r--r--Userland/Utilities/tree.cpp6
-rw-r--r--Userland/Utilities/truncate.cpp6
-rw-r--r--Userland/Utilities/tt.cpp2
-rw-r--r--Userland/Utilities/uniq.cpp6
-rw-r--r--Userland/Utilities/unzip.cpp2
-rw-r--r--Userland/Utilities/useradd.cpp12
-rw-r--r--Userland/Utilities/userdel.cpp4
-rw-r--r--Userland/Utilities/usermod.cpp8
-rw-r--r--Userland/Utilities/utmpupdate.cpp4
-rw-r--r--Userland/Utilities/watch.cpp2
-rw-r--r--Userland/Utilities/wc.cpp12
-rw-r--r--Userland/Utilities/which.cpp2
-rw-r--r--Userland/Utilities/xargs.cpp16
-rw-r--r--Userland/Utilities/yes.cpp2
-rw-r--r--Userland/Utilities/zip.cpp2
1131 files changed, 6168 insertions, 6170 deletions
diff --git a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp
index 57d2211511..40f90c18b5 100644
--- a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp
+++ b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp
@@ -37,7 +37,7 @@ String ClipboardHistoryModel::column_name(int column) const
}
}
-static const char* bpp_for_format_resilient(String format)
+static char const* bpp_for_format_resilient(String format)
{
unsigned format_uint = format.to_uint().value_or(static_cast<unsigned>(Gfx::BitmapFormat::Invalid));
// Cannot use Gfx::Bitmap::bpp_for_format here, as we have to accept invalid enum values.
diff --git a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.h b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.h
index ec3de5f4d2..64bed85ad2 100644
--- a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.h
+++ b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.h
@@ -35,7 +35,7 @@ public:
virtual ~ClipboardHistoryModel() override = default;
- const ClipboardItem& item_at(int index) const { return m_history_items[index]; }
+ ClipboardItem const& item_at(int index) const { return m_history_items[index]; }
void remove_item(int index);
// ^GUI::Model
@@ -54,7 +54,7 @@ private:
virtual int column_count(const GUI::ModelIndex&) const override { return Column::__Count; }
// ^GUI::Clipboard::ClipboardClient
- virtual void clipboard_content_did_change(const String&) override { add_item(GUI::Clipboard::the().fetch_data_and_type()); }
+ virtual void clipboard_content_did_change(String const&) override { add_item(GUI::Clipboard::the().fetch_data_and_type()); }
Vector<ClipboardItem> m_history_items;
size_t m_history_limit;
diff --git a/Userland/Applets/Keymap/KeymapStatusWindow.cpp b/Userland/Applets/Keymap/KeymapStatusWindow.cpp
index 95428d2a1c..e2b2d9e317 100644
--- a/Userland/Applets/Keymap/KeymapStatusWindow.cpp
+++ b/Userland/Applets/Keymap/KeymapStatusWindow.cpp
@@ -40,7 +40,7 @@ void KeymapStatusWindow::wm_event(GUI::WMEvent& event)
}
}
-void KeymapStatusWindow::set_keymap_text(const String& keymap)
+void KeymapStatusWindow::set_keymap_text(String const& keymap)
{
GUI::Painter painter(*m_status_widget);
painter.clear_rect(m_status_widget->rect(), Color::from_argb(0));
diff --git a/Userland/Applets/Network/main.cpp b/Userland/Applets/Network/main.cpp
index 35fcbf6695..f0e5d77bcd 100644
--- a/Userland/Applets/Network/main.cpp
+++ b/Userland/Applets/Network/main.cpp
@@ -51,7 +51,7 @@ private:
return;
pid_t child_pid;
- const char* argv[] = { "SystemMonitor", "-t", "network", nullptr };
+ char const* argv[] = { "SystemMonitor", "-t", "network", nullptr };
if ((errno = posix_spawn(&child_pid, "/bin/SystemMonitor", nullptr, nullptr, const_cast<char**>(argv), environ))) {
perror("posix_spawn");
@@ -179,7 +179,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::unveil(nullptr, nullptr));
bool display_notifications = false;
- const char* name = nullptr;
+ char const* name = nullptr;
Core::ArgsParser args_parser;
args_parser.add_option(display_notifications, "Display notifications", "display-notifications", 'd');
args_parser.add_option(name, "Applet name used by WindowServer.ini to set the applet order", "name", 'n', "name");
diff --git a/Userland/Applets/ResourceGraph/main.cpp b/Userland/Applets/ResourceGraph/main.cpp
index 3da6bc2841..8a8a13c6e8 100644
--- a/Userland/Applets/ResourceGraph/main.cpp
+++ b/Userland/Applets/ResourceGraph/main.cpp
@@ -110,7 +110,7 @@ private:
if (event.button() != GUI::MouseButton::Primary)
return;
pid_t child_pid;
- const char* argv[] = { "SystemMonitor", "-t", "graphs", nullptr };
+ char const* argv[] = { "SystemMonitor", "-t", "graphs", nullptr };
if ((errno = posix_spawn(&child_pid, "/bin/SystemMonitor", nullptr, nullptr, const_cast<char**>(argv), environ))) {
perror("posix_spawn");
} else {
@@ -197,8 +197,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::pledge("stdio recvfd sendfd proc exec rpath"));
- const char* cpu = nullptr;
- const char* memory = nullptr;
+ char const* cpu = nullptr;
+ char const* memory = nullptr;
Core::ArgsParser args_parser;
args_parser.add_option(cpu, "Create CPU graph", "cpu", 'C', "cpu");
args_parser.add_option(memory, "Create memory graph", "memory", 'M', "memory");
diff --git a/Userland/Applications/3DFileViewer/Mesh.cpp b/Userland/Applications/3DFileViewer/Mesh.cpp
index a3cdbb1824..d4fc13c9b5 100644
--- a/Userland/Applications/3DFileViewer/Mesh.cpp
+++ b/Userland/Applications/3DFileViewer/Mesh.cpp
@@ -34,7 +34,7 @@ Mesh::Mesh(Vector<Vertex> vertices, Vector<TexCoord> tex_coords, Vector<Vertex>
void Mesh::draw(float uv_scale)
{
for (u32 i = 0; i < m_triangle_list.size(); i++) {
- const auto& triangle = m_triangle_list[i];
+ auto const& triangle = m_triangle_list[i];
const FloatVector3 vertex_a(
m_vertex_list.at(triangle.a).x,
diff --git a/Userland/Applications/Assistant/FuzzyMatch.cpp b/Userland/Applications/Assistant/FuzzyMatch.cpp
index f16c767c90..b931537b0b 100644
--- a/Userland/Applications/Assistant/FuzzyMatch.cpp
+++ b/Userland/Applications/Assistant/FuzzyMatch.cpp
@@ -10,17 +10,17 @@
namespace Assistant {
-static constexpr const int RECURSION_LIMIT = 10;
-static constexpr const int MAX_MATCHES = 256;
+static constexpr int const RECURSION_LIMIT = 10;
+static constexpr int const MAX_MATCHES = 256;
// Bonuses and penalties are used to build up a final score for the match.
-static constexpr const int SEQUENTIAL_BONUS = 15; // bonus for adjacent matches (needle: 'ca', haystack: 'cat')
-static constexpr const int SEPARATOR_BONUS = 30; // bonus if match occurs after a separator ('_' or ' ')
-static constexpr const int CAMEL_BONUS = 30; // bonus if match is uppercase and prev is lower (needle: 'myF' haystack: '/path/to/myFile.txt')
-static constexpr const int FIRST_LETTER_BONUS = 20; // bonus if the first letter is matched (needle: 'c' haystack: 'cat')
-static constexpr const int LEADING_LETTER_PENALTY = -5; // penalty applied for every letter in str before the first match
-static constexpr const int MAX_LEADING_LETTER_PENALTY = -15; // maximum penalty for leading letters
-static constexpr const int UNMATCHED_LETTER_PENALTY = -1; // penalty for every letter that doesn't matter
+static constexpr int const SEQUENTIAL_BONUS = 15; // bonus for adjacent matches (needle: 'ca', haystack: 'cat')
+static constexpr int const SEPARATOR_BONUS = 30; // bonus if match occurs after a separator ('_' or ' ')
+static constexpr int const CAMEL_BONUS = 30; // bonus if match is uppercase and prev is lower (needle: 'myF' haystack: '/path/to/myFile.txt')
+static constexpr int const FIRST_LETTER_BONUS = 20; // bonus if the first letter is matched (needle: 'c' haystack: 'cat')
+static constexpr int const LEADING_LETTER_PENALTY = -5; // penalty applied for every letter in str before the first match
+static constexpr int const MAX_LEADING_LETTER_PENALTY = -15; // maximum penalty for leading letters
+static constexpr int const UNMATCHED_LETTER_PENALTY = -1; // penalty for every letter that doesn't matter
static int calculate_score(String const& string, u8* index_points, size_t index_points_size)
{
diff --git a/Userland/Applications/Assistant/Providers.cpp b/Userland/Applications/Assistant/Providers.cpp
index 767432a56a..0a24463638 100644
--- a/Userland/Applications/Assistant/Providers.cpp
+++ b/Userland/Applications/Assistant/Providers.cpp
@@ -123,7 +123,7 @@ FileProvider::FileProvider()
build_filesystem_cache();
}
-void FileProvider::query(const String& query, Function<void(NonnullRefPtrVector<Result>)> on_complete)
+void FileProvider::query(String const& query, Function<void(NonnullRefPtrVector<Result>)> on_complete)
{
build_filesystem_cache();
diff --git a/Userland/Applications/Assistant/Providers.h b/Userland/Applications/Assistant/Providers.h
index 2469e912bc..b240e18e53 100644
--- a/Userland/Applications/Assistant/Providers.h
+++ b/Userland/Applications/Assistant/Providers.h
@@ -132,7 +132,7 @@ class Provider : public RefCounted<Provider> {
public:
virtual ~Provider() = default;
- virtual void query(const String&, Function<void(NonnullRefPtrVector<Result>)> on_complete) = 0;
+ virtual void query(String const&, Function<void(NonnullRefPtrVector<Result>)> on_complete) = 0;
};
class AppProvider final : public Provider {
diff --git a/Userland/Applications/Browser/BookmarksBarWidget.cpp b/Userland/Applications/Browser/BookmarksBarWidget.cpp
index 92a00b70f8..7fb28b5e58 100644
--- a/Userland/Applications/Browser/BookmarksBarWidget.cpp
+++ b/Userland/Applications/Browser/BookmarksBarWidget.cpp
@@ -100,7 +100,7 @@ BookmarksBarWidget& BookmarksBarWidget::the()
return *s_the;
}
-BookmarksBarWidget::BookmarksBarWidget(const String& bookmarks_file, bool enabled)
+BookmarksBarWidget::BookmarksBarWidget(String const& bookmarks_file, bool enabled)
{
s_the = this;
set_layout<GUI::HorizontalBoxLayout>();
@@ -255,7 +255,7 @@ void BookmarksBarWidget::update_content_size()
}
}
-bool BookmarksBarWidget::contains_bookmark(const String& url)
+bool BookmarksBarWidget::contains_bookmark(String const& url)
{
for (int item_index = 0; item_index < model()->row_count(); ++item_index) {
@@ -268,7 +268,7 @@ bool BookmarksBarWidget::contains_bookmark(const String& url)
return false;
}
-bool BookmarksBarWidget::remove_bookmark(const String& url)
+bool BookmarksBarWidget::remove_bookmark(String const& url)
{
for (int item_index = 0; item_index < model()->row_count(); ++item_index) {
@@ -277,7 +277,7 @@ bool BookmarksBarWidget::remove_bookmark(const String& url)
if (item_url == url) {
auto& json_model = *static_cast<GUI::JsonArrayModel*>(model());
- const auto item_removed = json_model.remove(item_index);
+ auto const item_removed = json_model.remove(item_index);
if (item_removed)
json_model.store();
@@ -288,7 +288,7 @@ bool BookmarksBarWidget::remove_bookmark(const String& url)
return false;
}
-bool BookmarksBarWidget::add_bookmark(const String& url, const String& title)
+bool BookmarksBarWidget::add_bookmark(String const& url, String const& title)
{
Vector<JsonValue> values;
values.append(title);
@@ -302,7 +302,7 @@ bool BookmarksBarWidget::add_bookmark(const String& url, const String& title)
return false;
}
-bool BookmarksBarWidget::edit_bookmark(const String& url)
+bool BookmarksBarWidget::edit_bookmark(String const& url)
{
for (int item_index = 0; item_index < model()->row_count(); ++item_index) {
auto item_title = model()->index(item_index, 0).data().to_string();
diff --git a/Userland/Applications/Browser/BookmarksBarWidget.h b/Userland/Applications/Browser/BookmarksBarWidget.h
index dfcef0a7a4..1110c60b30 100644
--- a/Userland/Applications/Browser/BookmarksBarWidget.h
+++ b/Userland/Applications/Browser/BookmarksBarWidget.h
@@ -26,16 +26,16 @@ public:
GUI::Model* model() { return m_model.ptr(); }
const GUI::Model* model() const { return m_model.ptr(); }
- Function<void(const String& url, unsigned modifiers)> on_bookmark_click;
- Function<void(const String&, const String&)> on_bookmark_hover;
+ Function<void(String const& url, unsigned modifiers)> on_bookmark_click;
+ Function<void(String const&, String const&)> on_bookmark_hover;
- bool contains_bookmark(const String& url);
- bool remove_bookmark(const String& url);
- bool add_bookmark(const String& url, const String& title);
- bool edit_bookmark(const String& url);
+ bool contains_bookmark(String const& url);
+ bool remove_bookmark(String const& url);
+ bool add_bookmark(String const& url, String const& title);
+ bool edit_bookmark(String const& url);
private:
- BookmarksBarWidget(const String&, bool enabled);
+ BookmarksBarWidget(String const&, bool enabled);
// ^GUI::ModelClient
virtual void model_did_update(unsigned) override;
diff --git a/Userland/Applications/Browser/ConsoleWidget.cpp b/Userland/Applications/Browser/ConsoleWidget.cpp
index 53e3f1d9fc..33511a38cb 100644
--- a/Userland/Applications/Browser/ConsoleWidget.cpp
+++ b/Userland/Applications/Browser/ConsoleWidget.cpp
@@ -93,7 +93,7 @@ void ConsoleWidget::notify_about_new_console_message(i32 message_index)
request_console_messages();
}
-void ConsoleWidget::handle_console_messages(i32 start_index, const Vector<String>& message_types, const Vector<String>& messages)
+void ConsoleWidget::handle_console_messages(i32 start_index, Vector<String> const& message_types, Vector<String> const& messages)
{
i32 end_index = start_index + message_types.size() - 1;
if (end_index <= m_highest_received_message_index) {
diff --git a/Userland/Applications/Browser/ConsoleWidget.h b/Userland/Applications/Browser/ConsoleWidget.h
index 4683a84e2e..aaa7a5d5c0 100644
--- a/Userland/Applications/Browser/ConsoleWidget.h
+++ b/Userland/Applications/Browser/ConsoleWidget.h
@@ -26,7 +26,7 @@ public:
void print_html(StringView);
void reset();
- Function<void(const String&)> on_js_input;
+ Function<void(String const&)> on_js_input;
Function<void(i32)> on_request_messages;
private:
diff --git a/Userland/Applications/Browser/CookieJar.cpp b/Userland/Applications/Browser/CookieJar.cpp
index 119dc9e1ab..d8be5e30e6 100644
--- a/Userland/Applications/Browser/CookieJar.cpp
+++ b/Userland/Applications/Browser/CookieJar.cpp
@@ -26,7 +26,7 @@ String CookieJar::get_cookie(const URL& url, Web::Cookie::Source source)
auto cookie_list = get_matching_cookies(url, domain.value(), source);
StringBuilder builder;
- for (const auto& cookie : cookie_list) {
+ for (auto const& cookie : cookie_list) {
// If there is an unprocessed cookie in the cookie-list, output the characters %x3B and %x20 ("; ")
if (!builder.is_empty())
builder.append("; ");
@@ -38,7 +38,7 @@ String CookieJar::get_cookie(const URL& url, Web::Cookie::Source source)
return builder.build();
}
-void CookieJar::set_cookie(const URL& url, const Web::Cookie::ParsedCookie& parsed_cookie, Web::Cookie::Source source)
+void CookieJar::set_cookie(const URL& url, Web::Cookie::ParsedCookie const& parsed_cookie, Web::Cookie::Source source)
{
auto domain = canonicalize_domain(url);
if (!domain.has_value())
@@ -57,7 +57,7 @@ void CookieJar::dump_cookies() const
StringBuilder builder;
builder.appendff("{} cookies stored\n", m_cookies.size());
- for (const auto& cookie : m_cookies) {
+ for (auto const& cookie : m_cookies) {
builder.appendff("{}{}{} - ", key_color, cookie.key.name, no_color);
builder.appendff("{}{}{} - ", key_color, cookie.key.domain, no_color);
builder.appendff("{}{}{}\n", key_color, cookie.key.path, no_color);
@@ -96,7 +96,7 @@ Optional<String> CookieJar::canonicalize_domain(const URL& url)
return url.host().to_lowercase();
}
-bool CookieJar::domain_matches(const String& string, const String& domain_string)
+bool CookieJar::domain_matches(String const& string, String const& domain_string)
{
// https://tools.ietf.org/html/rfc6265#section-5.1.3
@@ -120,7 +120,7 @@ bool CookieJar::domain_matches(const String& string, const String& domain_string
return true;
}
-bool CookieJar::path_matches(const String& request_path, const String& cookie_path)
+bool CookieJar::path_matches(String const& request_path, String const& cookie_path)
{
// https://tools.ietf.org/html/rfc6265#section-5.1.4
@@ -165,7 +165,7 @@ String CookieJar::default_path(const URL& url)
return uri_path.substring(0, last_separator);
}
-void CookieJar::store_cookie(const Web::Cookie::ParsedCookie& parsed_cookie, const URL& url, String canonicalized_domain, Web::Cookie::Source source)
+void CookieJar::store_cookie(Web::Cookie::ParsedCookie const& parsed_cookie, const URL& url, String canonicalized_domain, Web::Cookie::Source source)
{
// https://tools.ietf.org/html/rfc6265#section-5.3
@@ -251,7 +251,7 @@ void CookieJar::store_cookie(const Web::Cookie::ParsedCookie& parsed_cookie, con
m_cookies.set(key, move(cookie));
}
-Vector<Web::Cookie::Cookie&> CookieJar::get_matching_cookies(const URL& url, const String& canonicalized_domain, Web::Cookie::Source source)
+Vector<Web::Cookie::Cookie&> CookieJar::get_matching_cookies(const URL& url, String const& canonicalized_domain, Web::Cookie::Source source)
{
// https://tools.ietf.org/html/rfc6265#section-5.4
@@ -305,12 +305,12 @@ void CookieJar::purge_expired_cookies()
time_t now = Core::DateTime::now().timestamp();
Vector<CookieStorageKey> keys_to_evict;
- for (const auto& cookie : m_cookies) {
+ for (auto const& cookie : m_cookies) {
if (cookie.value.expiry_time.timestamp() < now)
keys_to_evict.append(cookie.key);
}
- for (const auto& key : keys_to_evict)
+ for (auto const& key : keys_to_evict)
m_cookies.remove(key);
}
diff --git a/Userland/Applications/Browser/CookieJar.h b/Userland/Applications/Browser/CookieJar.h
index 1fde67f462..3aedeceef4 100644
--- a/Userland/Applications/Browser/CookieJar.h
+++ b/Userland/Applications/Browser/CookieJar.h
@@ -17,7 +17,7 @@
namespace Browser {
struct CookieStorageKey {
- bool operator==(const CookieStorageKey&) const = default;
+ bool operator==(CookieStorageKey const&) const = default;
String name;
String domain;
@@ -27,18 +27,18 @@ struct CookieStorageKey {
class CookieJar {
public:
String get_cookie(const URL& url, Web::Cookie::Source source);
- void set_cookie(const URL& url, const Web::Cookie::ParsedCookie& parsed_cookie, Web::Cookie::Source source);
+ void set_cookie(const URL& url, Web::Cookie::ParsedCookie const& parsed_cookie, Web::Cookie::Source source);
void dump_cookies() const;
Vector<Web::Cookie::Cookie> get_all_cookies() const;
private:
static Optional<String> canonicalize_domain(const URL& url);
- static bool domain_matches(const String& string, const String& domain_string);
- static bool path_matches(const String& request_path, const String& cookie_path);
+ static bool domain_matches(String const& string, String const& domain_string);
+ static bool path_matches(String const& request_path, String const& cookie_path);
static String default_path(const URL& url);
- void store_cookie(const Web::Cookie::ParsedCookie& parsed_cookie, const URL& url, String canonicalized_domain, Web::Cookie::Source source);
- Vector<Web::Cookie::Cookie&> get_matching_cookies(const URL& url, const String& canonicalized_domain, Web::Cookie::Source source);
+ void store_cookie(Web::Cookie::ParsedCookie const& parsed_cookie, const URL& url, String canonicalized_domain, Web::Cookie::Source source);
+ Vector<Web::Cookie::Cookie&> get_matching_cookies(const URL& url, String const& canonicalized_domain, Web::Cookie::Source source);
void purge_expired_cookies();
HashMap<CookieStorageKey, Web::Cookie::Cookie> m_cookies;
@@ -50,7 +50,7 @@ namespace AK {
template<>
struct Traits<Browser::CookieStorageKey> : public GenericTraits<Browser::CookieStorageKey> {
- static unsigned hash(const Browser::CookieStorageKey& key)
+ static unsigned hash(Browser::CookieStorageKey const& key)
{
unsigned hash = 0;
hash = pair_int_hash(hash, string_hash(key.name.characters(), key.name.length()));
diff --git a/Userland/Applications/Browser/CookiesModel.cpp b/Userland/Applications/Browser/CookiesModel.cpp
index aa2b7abf07..6daecfac33 100644
--- a/Userland/Applications/Browser/CookiesModel.cpp
+++ b/Userland/Applications/Browser/CookiesModel.cpp
@@ -58,7 +58,7 @@ GUI::Variant CookiesModel::data(GUI::ModelIndex const& index, GUI::ModelRole rol
if (role != GUI::ModelRole::Display)
return {};
- const auto& cookie = m_cookies[index.row()];
+ auto const& cookie = m_cookies[index.row()];
switch (index.column()) {
case Column::Domain:
diff --git a/Userland/Applications/Browser/History.cpp b/Userland/Applications/Browser/History.cpp
index 20dfd3b117..7732c6f5d7 100644
--- a/Userland/Applications/Browser/History.cpp
+++ b/Userland/Applications/Browser/History.cpp
@@ -18,7 +18,7 @@ void History::dump() const
}
}
-void History::push(const URL& url, const String& title)
+void History::push(const URL& url, String const& title)
{
if (!m_items.is_empty() && m_items[m_current].url == url)
return;
@@ -55,12 +55,12 @@ void History::clear()
m_current = -1;
}
-void History::update_title(const String& title)
+void History::update_title(String const& title)
{
m_items[m_current].title = title;
}
-const Vector<StringView> History::get_back_title_history()
+Vector<StringView> const History::get_back_title_history()
{
Vector<StringView> back_title_history;
for (int i = m_current - 1; i >= 0; i--) {
@@ -69,7 +69,7 @@ const Vector<StringView> History::get_back_title_history()
return back_title_history;
}
-const Vector<StringView> History::get_forward_title_history()
+Vector<StringView> const History::get_forward_title_history()
{
Vector<StringView> forward_title_history;
for (int i = m_current + 1; i < static_cast<int>(m_items.size()); i++) {
diff --git a/Userland/Applications/Browser/History.h b/Userland/Applications/Browser/History.h
index e7891b29a1..05afcd8532 100644
--- a/Userland/Applications/Browser/History.h
+++ b/Userland/Applications/Browser/History.h
@@ -19,12 +19,12 @@ public:
};
void dump() const;
- void push(const URL& url, const String& title);
- void update_title(const String& title);
+ void push(const URL& url, String const& title);
+ void update_title(String const& title);
URLTitlePair current() const;
- const Vector<StringView> get_back_title_history();
- const Vector<StringView> get_forward_title_history();
+ Vector<StringView> const get_back_title_history();
+ Vector<StringView> const get_forward_title_history();
void go_back(int steps = 1);
void go_forward(int steps = 1);
diff --git a/Userland/Applications/Browser/InspectorWidget.cpp b/Userland/Applications/Browser/InspectorWidget.cpp
index d923fe17dd..7b04ca5691 100644
--- a/Userland/Applications/Browser/InspectorWidget.cpp
+++ b/Userland/Applications/Browser/InspectorWidget.cpp
@@ -183,7 +183,7 @@ void InspectorWidget::update_node_box_model(Optional<String> node_box_sizing_jso
return;
}
auto json_value = json_or_error.release_value();
- const auto& json_object = json_value.as_object();
+ auto const& json_object = json_value.as_object();
m_node_box_sizing.margin.top = json_object.get("margin_top").to_float();
m_node_box_sizing.margin.right = json_object.get("margin_right").to_float();
diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp
index e8445e7343..7fa98ec1fb 100644
--- a/Userland/Applications/Browser/Tab.cpp
+++ b/Userland/Applications/Browser/Tab.cpp
@@ -66,7 +66,7 @@ void Tab::start_download(const URL& url)
window->show();
}
-void Tab::view_source(const URL& url, const String& source)
+void Tab::view_source(const URL& url, String const& source)
{
auto window = GUI::Window::construct(&this->window());
auto& editor = window->set_main_widget<GUI::TextEditor>();
@@ -282,7 +282,7 @@ Tab::Tab(BrowserWindow& window)
m_image_context_menu->add_separator();
m_image_context_menu->add_action(window.inspect_dom_node_action());
- hooks().on_image_context_menu_request = [this](auto& image_url, auto& screen_position, const Gfx::ShareableBitmap& shareable_bitmap) {
+ hooks().on_image_context_menu_request = [this](auto& image_url, auto& screen_position, Gfx::ShareableBitmap const& shareable_bitmap) {
m_image_context_menu_url = image_url;
m_image_context_menu_bitmap = shareable_bitmap;
m_image_context_menu->popup(screen_position);
@@ -469,7 +469,7 @@ void Tab::bookmark_current_url()
update_bookmark_button(url);
}
-void Tab::update_bookmark_button(const String& url)
+void Tab::update_bookmark_button(String const& url)
{
if (BookmarksBarWidget::the().contains_bookmark(url)) {
m_bookmark_button->set_icon(g_icon_bag.bookmark_filled);
@@ -503,7 +503,7 @@ void Tab::did_become_active()
update_actions();
}
-void Tab::context_menu_requested(const Gfx::IntPoint& screen_position)
+void Tab::context_menu_requested(Gfx::IntPoint const& screen_position)
{
m_tab_context_menu->popup(screen_position);
}
diff --git a/Userland/Applications/Browser/Tab.h b/Userland/Applications/Browser/Tab.h
index 7e01c61765..3b060ac586 100644
--- a/Userland/Applications/Browser/Tab.h
+++ b/Userland/Applications/Browser/Tab.h
@@ -50,19 +50,19 @@ public:
void go_forward(int steps = 1);
void did_become_active();
- void context_menu_requested(const Gfx::IntPoint& screen_position);
+ void context_menu_requested(Gfx::IntPoint const& screen_position);
void content_filters_changed();
void action_entered(GUI::Action&);
void action_left(GUI::Action&);
- Function<void(const String&)> on_title_change;
+ Function<void(String const&)> on_title_change;
Function<void(const URL&)> on_tab_open_request;
Function<void(Tab&)> on_tab_close_request;
Function<void(Tab&)> on_tab_close_other_request;
- Function<void(const Gfx::Bitmap&)> on_favicon_change;
+ Function<void(Gfx::Bitmap const&)> on_favicon_change;
Function<String(const URL&, Web::Cookie::Source source)> on_get_cookie;
- Function<void(const URL&, const Web::Cookie::ParsedCookie& cookie, Web::Cookie::Source source)> on_set_cookie;
+ Function<void(const URL&, Web::Cookie::ParsedCookie const& cookie, Web::Cookie::Source source)> on_set_cookie;
Function<void()> on_dump_cookies;
Function<Vector<Web::Cookie::Cookie>()> on_want_cookies;
@@ -75,8 +75,8 @@ public:
void show_console_window();
void show_storage_inspector();
- const String& title() const { return m_title; }
- const Gfx::Bitmap* icon() const { return m_icon; }
+ String const& title() const { return m_title; }
+ Gfx::Bitmap const* icon() const { return m_icon; }
GUI::AbstractScrollableWidget& view();
@@ -89,9 +89,9 @@ private:
Web::WebViewHooks& hooks();
void update_actions();
void bookmark_current_url();
- void update_bookmark_button(const String& url);
+ void update_bookmark_button(String const& url);
void start_download(const URL& url);
- void view_source(const URL& url, const String& source);
+ void view_source(const URL& url, String const& source);
void update_status(Optional<String> text_override = {}, i32 count_waiting = 0);
enum class MayAppendTLD {
@@ -134,6 +134,6 @@ private:
bool m_is_history_navigation { false };
};
-URL url_from_user_input(const String& input);
+URL url_from_user_input(String const& input);
}
diff --git a/Userland/Applications/Browser/main.cpp b/Userland/Applications/Browser/main.cpp
index f60edeb295..1842e32f1c 100644
--- a/Userland/Applications/Browser/main.cpp
+++ b/Userland/Applications/Browser/main.cpp
@@ -59,7 +59,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::pledge("stdio recvfd sendfd unix cpath rpath wpath proc exec"));
- const char* specified_url = nullptr;
+ char const* specified_url = nullptr;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(specified_url, "URL to open", "url", Core::ArgsParser::Required::No);
diff --git a/Userland/Applications/Calculator/KeypadValue.cpp b/Userland/Applications/Calculator/KeypadValue.cpp
index 63f38212f4..144e447ff6 100644
--- a/Userland/Applications/Calculator/KeypadValue.cpp
+++ b/Userland/Applications/Calculator/KeypadValue.cpp
@@ -22,7 +22,7 @@ KeypadValue::KeypadValue(i64 value)
KeypadValue::KeypadValue(StringView sv)
{
- String str = sv.to_string(); //TODO: Once we have a StringView equivalent for this C API, we won't need to create a copy for this anymore.
+ String str = sv.to_string(); // TODO: Once we have a StringView equivalent for this C API, we won't need to create a copy for this anymore.
size_t first_index = 0;
char* dot_ptr;
i64 int_part = strtoll(&str[first_index], &dot_ptr, 10);
diff --git a/Userland/Applications/CrashReporter/main.cpp b/Userland/Applications/CrashReporter/main.cpp
index ac3766c5c2..61e0842432 100644
--- a/Userland/Applications/CrashReporter/main.cpp
+++ b/Userland/Applications/CrashReporter/main.cpp
@@ -136,7 +136,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto app = TRY(GUI::Application::try_create(arguments));
- const char* coredump_path = nullptr;
+ char const* coredump_path = nullptr;
bool unlink_on_exit = false;
Core::ArgsParser args_parser;
diff --git a/Userland/Applications/Debugger/main.cpp b/Userland/Applications/Debugger/main.cpp
index d62a39a2df..65e9bdeba3 100644
--- a/Userland/Applications/Debugger/main.cpp
+++ b/Userland/Applications/Debugger/main.cpp
@@ -37,7 +37,7 @@ static void handle_sigint(int)
g_debug_session = nullptr;
}
-static void handle_print_registers(const PtraceRegisters& regs)
+static void handle_print_registers(PtraceRegisters const& regs)
{
#if ARCH(I386)
outln("eax={:p} ebx={:p} ecx={:p} edx={:p}", regs.eax, regs.ebx, regs.ecx, regs.edx);
@@ -52,7 +52,7 @@ static void handle_print_registers(const PtraceRegisters& regs)
#endif
}
-static bool handle_disassemble_command(const String& command, FlatPtr first_instruction)
+static bool handle_disassemble_command(String const& command, FlatPtr first_instruction)
{
auto parts = command.split(' ');
size_t number_of_instructions_to_disassemble = 5;
@@ -90,7 +90,7 @@ static bool handle_disassemble_command(const String& command, FlatPtr first_inst
return true;
}
-static bool handle_backtrace_command(const PtraceRegisters& regs)
+static bool handle_backtrace_command(PtraceRegisters const& regs)
{
#if ARCH(I386)
auto ebp_val = regs.ebp;
@@ -122,7 +122,7 @@ static bool insert_breakpoint_at_address(FlatPtr address)
return g_debug_session->insert_breakpoint(address);
}
-static bool insert_breakpoint_at_source_position(const String& file, size_t line)
+static bool insert_breakpoint_at_source_position(String const& file, size_t line)
{
auto result = g_debug_session->insert_breakpoint(file, line);
if (!result.has_value()) {
@@ -133,7 +133,7 @@ static bool insert_breakpoint_at_source_position(const String& file, size_t line
return true;
}
-static bool insert_breakpoint_at_symbol(const String& symbol)
+static bool insert_breakpoint_at_symbol(String const& symbol)
{
auto result = g_debug_session->insert_breakpoint(symbol);
if (!result.has_value()) {
@@ -144,7 +144,7 @@ static bool insert_breakpoint_at_symbol(const String& symbol)
return true;
}
-static bool handle_breakpoint_command(const String& command)
+static bool handle_breakpoint_command(String const& command)
{
auto parts = command.split(' ');
if (parts.size() != 2)
@@ -171,7 +171,7 @@ static bool handle_breakpoint_command(const String& command)
return insert_breakpoint_at_symbol(argument);
}
-static bool handle_examine_command(const String& command)
+static bool handle_examine_command(String const& command)
{
auto parts = command.split(' ');
if (parts.size() != 2)
@@ -214,7 +214,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::pledge("stdio proc ptrace exec rpath tty sigaction cpath unix", nullptr));
- const char* command = nullptr;
+ char const* command = nullptr;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(command,
"The program to be debugged, along with its arguments",
diff --git a/Userland/Applications/Help/ManualModel.cpp b/Userland/Applications/Help/ManualModel.cpp
index f5a99c702c..7f35f565d5 100644
--- a/Userland/Applications/Help/ManualModel.cpp
+++ b/Userland/Applications/Help/ManualModel.cpp
@@ -34,10 +34,10 @@ Optional<GUI::ModelIndex> ManualModel::index_from_path(StringView path) const
auto parent_index = index(section, 0);
for (int row = 0; row < row_count(parent_index); ++row) {
auto child_index = index(row, 0, parent_index);
- auto* node = static_cast<const ManualNode*>(child_index.internal_data());
+ auto* node = static_cast<ManualNode const*>(child_index.internal_data());
if (!node->is_page())
continue;
- auto* page = static_cast<const ManualPageNode*>(node);
+ auto* page = static_cast<ManualPageNode const*>(node);
if (page->path() != path)
continue;
return child_index;
@@ -50,10 +50,10 @@ String ManualModel::page_name(const GUI::ModelIndex& index) const
{
if (!index.is_valid())
return {};
- auto* node = static_cast<const ManualNode*>(index.internal_data());
+ auto* node = static_cast<ManualNode const*>(index.internal_data());
if (!node->is_page())
return {};
- auto* page = static_cast<const ManualPageNode*>(node);
+ auto* page = static_cast<ManualPageNode const*>(node);
return page->name();
}
@@ -61,10 +61,10 @@ String ManualModel::page_path(const GUI::ModelIndex& index) const
{
if (!index.is_valid())
return {};
- auto* node = static_cast<const ManualNode*>(index.internal_data());
+ auto* node = static_cast<ManualNode const*>(index.internal_data());
if (!node->is_page())
return {};
- auto* page = static_cast<const ManualPageNode*>(node);
+ auto* page = static_cast<ManualPageNode const*>(node);
return page->path();
}
@@ -91,11 +91,11 @@ String ManualModel::page_and_section(const GUI::ModelIndex& index) const
{
if (!index.is_valid())
return {};
- auto* node = static_cast<const ManualNode*>(index.internal_data());
+ auto* node = static_cast<ManualNode const*>(index.internal_data());
if (!node->is_page())
return {};
- auto* page = static_cast<const ManualPageNode*>(node);
- auto* section = static_cast<const ManualSectionNode*>(page->parent());
+ auto* page = static_cast<ManualPageNode const*>(node);
+ auto* section = static_cast<ManualSectionNode const*>(page->parent());
return String::formatted("{}({})", page->name(), section->section_name());
}
@@ -103,7 +103,7 @@ GUI::ModelIndex ManualModel::index(int row, int column, const GUI::ModelIndex& p
{
if (!parent_index.is_valid())
return create_index(row, column, &s_sections[row]);
- auto* parent = static_cast<const ManualNode*>(parent_index.internal_data());
+ auto* parent = static_cast<ManualNode const*>(parent_index.internal_data());
auto* child = &parent->children()[row];
return create_index(row, column, child);
}
@@ -112,7 +112,7 @@ GUI::ModelIndex ManualModel::parent_index(const GUI::ModelIndex& index) const
{
if (!index.is_valid())
return {};
- auto* child = static_cast<const ManualNode*>(index.internal_data());
+ auto* child = static_cast<ManualNode const*>(index.internal_data());
auto* parent = child->parent();
if (parent == nullptr)
return {};
@@ -135,7 +135,7 @@ int ManualModel::row_count(const GUI::ModelIndex& index) const
{
if (!index.is_valid())
return sizeof(s_sections) / sizeof(s_sections[0]);
- auto* node = static_cast<const ManualNode*>(index.internal_data());
+ auto* node = static_cast<ManualNode const*>(index.internal_data());
return node->children().size();
}
@@ -146,7 +146,7 @@ int ManualModel::column_count(const GUI::ModelIndex&) const
GUI::Variant ManualModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const
{
- auto* node = static_cast<const ManualNode*>(index.internal_data());
+ auto* node = static_cast<ManualNode const*>(index.internal_data());
switch (role) {
case GUI::ModelRole::Search:
if (!node->is_page())
@@ -165,7 +165,7 @@ GUI::Variant ManualModel::data(const GUI::ModelIndex& index, GUI::ModelRole role
}
}
-void ManualModel::update_section_node_on_toggle(const GUI::ModelIndex& index, const bool open)
+void ManualModel::update_section_node_on_toggle(const GUI::ModelIndex& index, bool const open)
{
auto* node = static_cast<ManualSectionNode*>(index.internal_data());
node->set_open(open);
diff --git a/Userland/Applications/Help/ManualModel.h b/Userland/Applications/Help/ManualModel.h
index 262464ee8a..9995836636 100644
--- a/Userland/Applications/Help/ManualModel.h
+++ b/Userland/Applications/Help/ManualModel.h
@@ -28,7 +28,7 @@ public:
String page_and_section(const GUI::ModelIndex&) const;
ErrorOr<StringView> page_view(String const& path) const;
- void update_section_node_on_toggle(const GUI::ModelIndex&, const bool);
+ void update_section_node_on_toggle(const GUI::ModelIndex&, bool const);
virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override;
diff --git a/Userland/Applications/Help/ManualNode.h b/Userland/Applications/Help/ManualNode.h
index 34971e234d..6fb5957eda 100644
--- a/Userland/Applications/Help/ManualNode.h
+++ b/Userland/Applications/Help/ManualNode.h
@@ -15,7 +15,7 @@ public:
virtual ~ManualNode() = default;
virtual NonnullOwnPtrVector<ManualNode>& children() const = 0;
- virtual const ManualNode* parent() const = 0;
+ virtual ManualNode const* parent() const = 0;
virtual String name() const = 0;
virtual bool is_page() const { return false; }
virtual bool is_open() const { return false; }
diff --git a/Userland/Applications/Help/ManualPageNode.cpp b/Userland/Applications/Help/ManualPageNode.cpp
index dc28cb4c08..e906e34c37 100644
--- a/Userland/Applications/Help/ManualPageNode.cpp
+++ b/Userland/Applications/Help/ManualPageNode.cpp
@@ -8,7 +8,7 @@
#include "ManualPageNode.h"
#include "ManualSectionNode.h"
-const ManualNode* ManualPageNode::parent() const
+ManualNode const* ManualPageNode::parent() const
{
return &m_section;
}
diff --git a/Userland/Applications/Help/ManualPageNode.h b/Userland/Applications/Help/ManualPageNode.h
index 0f60dd6569..c01349f2de 100644
--- a/Userland/Applications/Help/ManualPageNode.h
+++ b/Userland/Applications/Help/ManualPageNode.h
@@ -14,20 +14,20 @@ class ManualPageNode : public ManualNode {
public:
virtual ~ManualPageNode() override = default;
- ManualPageNode(const ManualSectionNode& section, StringView page)
+ ManualPageNode(ManualSectionNode const& section, StringView page)
: m_section(section)
, m_page(page)
{
}
virtual NonnullOwnPtrVector<ManualNode>& children() const override;
- virtual const ManualNode* parent() const override;
+ virtual ManualNode const* parent() const override;
virtual String name() const override { return m_page; };
virtual bool is_page() const override { return true; }
String path() const;
private:
- const ManualSectionNode& m_section;
+ ManualSectionNode const& m_section;
String m_page;
};
diff --git a/Userland/Applications/Help/ManualSectionNode.h b/Userland/Applications/Help/ManualSectionNode.h
index 468137066c..173e3475bf 100644
--- a/Userland/Applications/Help/ManualSectionNode.h
+++ b/Userland/Applications/Help/ManualSectionNode.h
@@ -25,12 +25,12 @@ public:
return m_children;
}
- virtual const ManualNode* parent() const override { return nullptr; }
+ virtual ManualNode const* parent() const override { return nullptr; }
virtual String name() const override { return m_full_name; }
virtual bool is_open() const override { return m_open; }
void set_open(bool open);
- const String& section_name() const { return m_section; }
+ String const& section_name() const { return m_section; }
String path() const;
private:
diff --git a/Userland/Applications/HexEditor/HexDocument.h b/Userland/Applications/HexEditor/HexDocument.h
index bc943a2aa2..5566fade95 100644
--- a/Userland/Applications/HexEditor/HexDocument.h
+++ b/Userland/Applications/HexEditor/HexDocument.h
@@ -54,7 +54,7 @@ public:
explicit HexDocumentFile(NonnullRefPtr<Core::File> file);
virtual ~HexDocumentFile() = default;
- HexDocumentFile(const HexDocumentFile&) = delete;
+ HexDocumentFile(HexDocumentFile const&) = delete;
void set_file(NonnullRefPtr<Core::File> file);
NonnullRefPtr<Core::File> file() const;
diff --git a/Userland/Applications/HexEditor/HexEditor.cpp b/Userland/Applications/HexEditor/HexEditor.cpp
index fe82bec33a..bb2b2faaee 100644
--- a/Userland/Applications/HexEditor/HexEditor.cpp
+++ b/Userland/Applications/HexEditor/HexEditor.cpp
@@ -570,11 +570,11 @@ void HexEditor::paint_event(GUI::PaintEvent& event)
if (byte_position >= m_document->size())
return;
- const bool edited_flag = m_document->get(byte_position).modified;
+ bool const edited_flag = m_document->get(byte_position).modified;
- const bool selection_inbetween_start_end = byte_position >= m_selection_start && byte_position < m_selection_end;
- const bool selection_inbetween_end_start = byte_position >= m_selection_end && byte_position < m_selection_start;
- const bool highlight_flag = selection_inbetween_start_end || selection_inbetween_end_start;
+ bool const selection_inbetween_start_end = byte_position >= m_selection_start && byte_position < m_selection_end;
+ bool const selection_inbetween_end_start = byte_position >= m_selection_end && byte_position < m_selection_start;
+ bool const highlight_flag = selection_inbetween_start_end || selection_inbetween_end_start;
Gfx::IntRect hex_display_rect {
frame_thickness() + offset_margin_width() + static_cast<int>(j) * cell_width() + 2 * m_padding,
diff --git a/Userland/Applications/HexEditor/SearchResultsModel.h b/Userland/Applications/HexEditor/SearchResultsModel.h
index dff620df99..99ba4329f5 100644
--- a/Userland/Applications/HexEditor/SearchResultsModel.h
+++ b/Userland/Applications/HexEditor/SearchResultsModel.h
@@ -25,7 +25,7 @@ public:
Value
};
- explicit SearchResultsModel(const Vector<Match>&& matches)
+ explicit SearchResultsModel(Vector<Match> const&& matches)
: m_matches(move(matches))
{
}
diff --git a/Userland/Applications/ImageViewer/ViewWidget.cpp b/Userland/Applications/ImageViewer/ViewWidget.cpp
index 0bde797a59..0a1dfc7c4e 100644
--- a/Userland/Applications/ImageViewer/ViewWidget.cpp
+++ b/Userland/Applications/ImageViewer/ViewWidget.cpp
@@ -75,7 +75,7 @@ bool ViewWidget::is_previous_available() const
return false;
}
-Vector<String> ViewWidget::load_files_from_directory(const String& path) const
+Vector<String> ViewWidget::load_files_from_directory(String const& path) const
{
Vector<String> files_in_directory;
@@ -90,7 +90,7 @@ Vector<String> ViewWidget::load_files_from_directory(const String& path) const
return files_in_directory;
}
-void ViewWidget::set_path(const String& path)
+void ViewWidget::set_path(String const& path)
{
m_path = path;
m_files_in_same_dir = load_files_from_directory(path);
@@ -151,7 +151,7 @@ void ViewWidget::mouseup_event(GUI::MouseEvent& event)
GUI::AbstractZoomPanWidget::mouseup_event(event);
}
-void ViewWidget::load_from_file(const String& path)
+void ViewWidget::load_from_file(String const& path)
{
auto show_error = [&] {
GUI::MessageBox::show(window(), String::formatted("Failed to open {}", path), "Cannot open image", GUI::MessageBox::Type::Error);
@@ -186,7 +186,7 @@ void ViewWidget::load_from_file(const String& path)
on_image_change(m_bitmap);
if (m_decoded_image->is_animated && m_decoded_image->frames.size() > 1) {
- const auto& first_frame = m_decoded_image->frames[0];
+ auto const& first_frame = m_decoded_image->frames[0];
m_timer->set_interval(first_frame.duration);
m_timer->on_timeout = [this] { animate(); };
m_timer->start();
@@ -229,7 +229,7 @@ void ViewWidget::resize_window()
window()->resize(new_size);
}
-void ViewWidget::set_bitmap(const Gfx::Bitmap* bitmap)
+void ViewWidget::set_bitmap(Gfx::Bitmap const* bitmap)
{
if (m_bitmap == bitmap)
return;
@@ -246,7 +246,7 @@ void ViewWidget::animate()
m_current_frame_index = (m_current_frame_index + 1) % m_decoded_image->frames.size();
- const auto& current_frame = m_decoded_image->frames[m_current_frame_index];
+ auto const& current_frame = m_decoded_image->frames[m_current_frame_index];
set_bitmap(current_frame.bitmap);
if ((int)current_frame.duration != m_timer->interval()) {
diff --git a/Userland/Applications/ImageViewer/ViewWidget.h b/Userland/Applications/ImageViewer/ViewWidget.h
index b016cd80e7..8aab232c92 100644
--- a/Userland/Applications/ImageViewer/ViewWidget.h
+++ b/Userland/Applications/ImageViewer/ViewWidget.h
@@ -29,13 +29,13 @@ public:
virtual ~ViewWidget() override = default;
- const Gfx::Bitmap* bitmap() const { return m_bitmap.ptr(); }
- const String& path() const { return m_path; }
+ Gfx::Bitmap const* bitmap() const { return m_bitmap.ptr(); }
+ String const& path() const { return m_path; }
void set_toolbar_height(int height) { m_toolbar_height = height; }
int toolbar_height() { return m_toolbar_height; }
bool scaled_for_first_image() { return m_scaled_for_first_image; }
void set_scaled_for_first_image(bool val) { m_scaled_for_first_image = val; }
- void set_path(const String& path);
+ void set_path(String const& path);
void resize_window();
void set_scaling_mode(Gfx::Painter::ScalingMode);
@@ -46,11 +46,11 @@ public:
void flip(Gfx::Orientation);
void rotate(Gfx::RotationDirection);
void navigate(Directions);
- void load_from_file(const String&);
+ void load_from_file(String const&);
Function<void()> on_doubleclick;
Function<void(const GUI::DropEvent&)> on_drop;
- Function<void(const Gfx::Bitmap*)> on_image_change;
+ Function<void(Gfx::Bitmap const*)> on_image_change;
private:
ViewWidget();
@@ -60,9 +60,9 @@ private:
virtual void mouseup_event(GUI::MouseEvent&) override;
virtual void drop_event(GUI::DropEvent&) override;
- void set_bitmap(const Gfx::Bitmap* bitmap);
+ void set_bitmap(Gfx::Bitmap const* bitmap);
void animate();
- Vector<String> load_files_from_directory(const String& path) const;
+ Vector<String> load_files_from_directory(String const& path) const;
String m_path;
RefPtr<Gfx::Bitmap> m_bitmap;
diff --git a/Userland/Applications/ImageViewer/main.cpp b/Userland/Applications/ImageViewer/main.cpp
index 10d73fa6eb..6a5bcf99aa 100644
--- a/Userland/Applications/ImageViewer/main.cpp
+++ b/Userland/Applications/ImageViewer/main.cpp
@@ -45,7 +45,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto app_icon = GUI::Icon::default_icon("filetype-image");
- const char* path = nullptr;
+ char const* path = nullptr;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(path, "The image file to be displayed.", "file", Core::ArgsParser::Required::No);
args_parser.parse(arguments);
@@ -244,7 +244,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
widget->set_scaling_mode(Gfx::Painter::ScalingMode::BilinearBlend);
});
- widget->on_image_change = [&](const Gfx::Bitmap* bitmap) {
+ widget->on_image_change = [&](Gfx::Bitmap const* bitmap) {
bool should_enable_image_actions = (bitmap != nullptr);
bool should_enable_forward_actions = (widget->is_next_available() && should_enable_image_actions);
bool should_enable_backward_actions = (widget->is_previous_available() && should_enable_image_actions);
diff --git a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp
index 4271223d75..62598ff9c7 100644
--- a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp
+++ b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp
@@ -127,7 +127,7 @@ u32* KeyboardMapperWidget::map_from_name(const StringView map_name)
return map;
}
-ErrorOr<void> KeyboardMapperWidget::load_map_from_file(const String& filename)
+ErrorOr<void> KeyboardMapperWidget::load_map_from_file(String const& filename)
{
auto character_map = TRY(Keyboard::CharacterMapFile::load_from_file(filename));
diff --git a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h
index f63c98d389..ca51cd18b2 100644
--- a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h
+++ b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h
@@ -18,7 +18,7 @@ public:
virtual ~KeyboardMapperWidget() override = default;
void create_frame();
- ErrorOr<void> load_map_from_file(const String&);
+ ErrorOr<void> load_map_from_file(String const&);
ErrorOr<void> load_map_from_system();
ErrorOr<void> save();
ErrorOr<void> save_to_file(StringView);
diff --git a/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp b/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp
index 7c482eb0de..36c89f7ca7 100644
--- a/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp
+++ b/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp
@@ -268,7 +268,7 @@ void KeyboardSettingsWidget::set_keymaps(Vector<String> const& keymaps, String c
pid_t child_pid;
auto keymaps_string = String::join(',', keymaps);
- const char* argv[] = { "/bin/keymap", "-s", keymaps_string.characters(), "-m", active_keymap.characters(), nullptr };
+ char const* argv[] = { "/bin/keymap", "-s", keymaps_string.characters(), "-m", active_keymap.characters(), nullptr };
if ((errno = posix_spawn(&child_pid, "/bin/keymap", nullptr, nullptr, const_cast<char**>(argv), environ))) {
perror("posix_spawn");
exit(1);
diff --git a/Userland/Applications/PDFViewer/OutlineModel.cpp b/Userland/Applications/PDFViewer/OutlineModel.cpp
index ad4d770416..65f86f7a68 100644
--- a/Userland/Applications/PDFViewer/OutlineModel.cpp
+++ b/Userland/Applications/PDFViewer/OutlineModel.cpp
@@ -7,12 +7,12 @@
#include "OutlineModel.h"
#include <LibGfx/FontDatabase.h>
-NonnullRefPtr<OutlineModel> OutlineModel::create(const NonnullRefPtr<PDF::OutlineDict>& outline)
+NonnullRefPtr<OutlineModel> OutlineModel::create(NonnullRefPtr<PDF::OutlineDict> const& outline)
{
return adopt_ref(*new OutlineModel(outline));
}
-OutlineModel::OutlineModel(const NonnullRefPtr<PDF::OutlineDict>& outline)
+OutlineModel::OutlineModel(NonnullRefPtr<PDF::OutlineDict> const& outline)
: m_outline(outline)
{
m_closed_item_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/book.png").release_value_but_fixme_should_propagate_errors());
diff --git a/Userland/Applications/PDFViewer/OutlineModel.h b/Userland/Applications/PDFViewer/OutlineModel.h
index e97fcb3574..50cf406966 100644
--- a/Userland/Applications/PDFViewer/OutlineModel.h
+++ b/Userland/Applications/PDFViewer/OutlineModel.h
@@ -12,7 +12,7 @@
class OutlineModel final : public GUI::Model {
public:
- static NonnullRefPtr<OutlineModel> create(const NonnullRefPtr<PDF::OutlineDict>& outline);
+ static NonnullRefPtr<OutlineModel> create(NonnullRefPtr<PDF::OutlineDict> const& outline);
void set_index_open_state(const GUI::ModelIndex& index, bool is_open);
@@ -23,7 +23,7 @@ public:
virtual GUI::ModelIndex index(int row, int column, const GUI::ModelIndex&) const override;
private:
- OutlineModel(const NonnullRefPtr<PDF::OutlineDict>& outline);
+ OutlineModel(NonnullRefPtr<PDF::OutlineDict> const& outline);
GUI::Icon m_closed_item_icon;
GUI::Icon m_open_item_icon;
diff --git a/Userland/Applications/PDFViewer/PDFViewer.h b/Userland/Applications/PDFViewer/PDFViewer.h
index 12f4a17cb2..5f53958087 100644
--- a/Userland/Applications/PDFViewer/PDFViewer.h
+++ b/Userland/Applications/PDFViewer/PDFViewer.h
@@ -23,7 +23,7 @@ public:
ALWAYS_INLINE u32 current_page() const { return m_current_page_index; }
ALWAYS_INLINE void set_current_page(u32 current_page) { m_current_page_index = current_page; }
- ALWAYS_INLINE const RefPtr<PDF::Document>& document() const { return m_document; }
+ ALWAYS_INLINE RefPtr<PDF::Document> const& document() const { return m_document; }
void set_document(RefPtr<PDF::Document>);
Function<void(u32 new_page)> on_page_change;
diff --git a/Userland/Applications/PDFViewer/main.cpp b/Userland/Applications/PDFViewer/main.cpp
index 31be4ed46d..831c5b78b5 100644
--- a/Userland/Applications/PDFViewer/main.cpp
+++ b/Userland/Applications/PDFViewer/main.cpp
@@ -17,7 +17,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- const char* file_path = nullptr;
+ char const* file_path = nullptr;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(file_path, "PDF file to open", "path", Core::ArgsParser::Required::No);
args_parser.parse(arguments);
diff --git a/Userland/Applications/Piano/KeysWidget.cpp b/Userland/Applications/Piano/KeysWidget.cpp
index 5d128b4523..21f7d2a6af 100644
--- a/Userland/Applications/Piano/KeysWidget.cpp
+++ b/Userland/Applications/Piano/KeysWidget.cpp
@@ -235,7 +235,7 @@ static inline int note_from_white_keys(int white_keys)
return note;
}
-int KeysWidget::note_for_event_position(const Gfx::IntPoint& a_point) const
+int KeysWidget::note_for_event_position(Gfx::IntPoint const& a_point) const
{
if (!frame_inner_rect().contains(a_point))
return -1;
diff --git a/Userland/Applications/Piano/KeysWidget.h b/Userland/Applications/Piano/KeysWidget.h
index daf6048837..d21aba7fa0 100644
--- a/Userland/Applications/Piano/KeysWidget.h
+++ b/Userland/Applications/Piano/KeysWidget.h
@@ -32,7 +32,7 @@ private:
virtual void mouseup_event(GUI::MouseEvent&) override;
virtual void mousemove_event(GUI::MouseEvent&) override;
- int note_for_event_position(const Gfx::IntPoint&) const;
+ int note_for_event_position(Gfx::IntPoint const&) const;
TrackManager& m_track_manager;
diff --git a/Userland/Applications/Piano/Music.h b/Userland/Applications/Piano/Music.h
index 5af0825baa..6759142482 100644
--- a/Userland/Applications/Piano/Music.h
+++ b/Userland/Applications/Piano/Music.h
@@ -160,7 +160,7 @@ constexpr int beats_per_bar = 4;
constexpr int notes_per_beat = 4;
constexpr int roll_length = (sample_rate / (beats_per_minute / 60)) * beats_per_bar;
-constexpr const char* note_names[] = {
+constexpr char const* note_names[] = {
"C",
"C#",
"D",
diff --git a/Userland/Applications/Piano/RollWidget.cpp b/Userland/Applications/Piano/RollWidget.cpp
index d2457051cb..84ba9ce64f 100644
--- a/Userland/Applications/Piano/RollWidget.cpp
+++ b/Userland/Applications/Piano/RollWidget.cpp
@@ -152,7 +152,7 @@ void RollWidget::paint_event(GUI::PaintEvent& event)
}
Gfx::IntRect note_name_rect(3, y, 1, note_height);
- const char* note_name = note_names[note % notes_per_octave];
+ char const* note_name = note_names[note % notes_per_octave];
painter.draw_text(note_name_rect, note_name, Gfx::TextAlignment::CenterLeft);
note_name_rect.translate_by(Gfx::FontDatabase::default_font().width(note_name) + 2, 0);
diff --git a/Userland/Applications/Piano/RollWidget.h b/Userland/Applications/Piano/RollWidget.h
index 3e4ca04e9f..76f7599bb0 100644
--- a/Userland/Applications/Piano/RollWidget.h
+++ b/Userland/Applications/Piano/RollWidget.h
@@ -22,8 +22,8 @@ class RollWidget final : public GUI::AbstractScrollableWidget {
public:
virtual ~RollWidget() override = default;
- const KeysWidget* keys_widget() const { return m_keys_widget; }
- void set_keys_widget(const KeysWidget* widget) { m_keys_widget = widget; }
+ KeysWidget const* keys_widget() const { return m_keys_widget; }
+ void set_keys_widget(KeysWidget const* widget) { m_keys_widget = widget; }
private:
explicit RollWidget(TrackManager&);
@@ -36,7 +36,7 @@ private:
bool viewport_changed() const;
TrackManager& m_track_manager;
- const KeysWidget* m_keys_widget;
+ KeysWidget const* m_keys_widget;
int m_roll_width { 0 };
int m_num_notes { 0 };
diff --git a/Userland/Applications/Piano/Track.cpp b/Userland/Applications/Piano/Track.cpp
index 7344a5c0d7..f2cd6494a3 100644
--- a/Userland/Applications/Piano/Track.cpp
+++ b/Userland/Applications/Piano/Track.cpp
@@ -16,7 +16,7 @@
#include <LibDSP/Music.h>
#include <math.h>
-Track::Track(const u32& time)
+Track::Track(u32 const& time)
: m_time(time)
, m_temporary_transport(LibDSP::Transport::construct(120, 4))
, m_delay(make_ref_counted<LibDSP::Effects::Delay>(m_temporary_transport))
diff --git a/Userland/Applications/Piano/Track.h b/Userland/Applications/Piano/Track.h
index 230b052231..bd785586a1 100644
--- a/Userland/Applications/Piano/Track.h
+++ b/Userland/Applications/Piano/Track.h
@@ -26,11 +26,11 @@ class Track {
AK_MAKE_NONMOVABLE(Track);
public:
- explicit Track(const u32& time);
+ explicit Track(u32 const& time);
~Track() = default;
- const Vector<Audio::Sample>& recorded_sample() const { return m_recorded_sample; }
- const SinglyLinkedList<RollNote>& roll_notes(int note) const { return m_roll_notes[note]; }
+ Vector<Audio::Sample> const& recorded_sample() const { return m_recorded_sample; }
+ SinglyLinkedList<RollNote> const& roll_notes(int note) const { return m_roll_notes[note]; }
int volume() const { return m_volume; }
NonnullRefPtr<LibDSP::Synthesizers::Classic> synth() { return m_synth; }
NonnullRefPtr<LibDSP::Effects::Delay> delay() { return m_delay; }
@@ -51,7 +51,7 @@ private:
int m_volume;
- const u32& m_time;
+ u32 const& m_time;
NonnullRefPtr<LibDSP::Transport> m_temporary_transport;
NonnullRefPtr<LibDSP::Effects::Delay> m_delay;
diff --git a/Userland/Applications/PixelPaint/EditGuideDialog.cpp b/Userland/Applications/PixelPaint/EditGuideDialog.cpp
index e509d99d8f..b9c8f79950 100644
--- a/Userland/Applications/PixelPaint/EditGuideDialog.cpp
+++ b/Userland/Applications/PixelPaint/EditGuideDialog.cpp
@@ -76,7 +76,7 @@ EditGuideDialog::EditGuideDialog(GUI::Window* parent_window, String const& offse
};
}
-Optional<float> EditGuideDialog::offset_as_pixel(const ImageEditor& editor)
+Optional<float> EditGuideDialog::offset_as_pixel(ImageEditor const& editor)
{
float offset = 0;
if (m_offset.ends_with('%')) {
diff --git a/Userland/Applications/PixelPaint/FilterModel.cpp b/Userland/Applications/PixelPaint/FilterModel.cpp
index 025be5b23b..eb0fd6d57a 100644
--- a/Userland/Applications/PixelPaint/FilterModel.cpp
+++ b/Userland/Applications/PixelPaint/FilterModel.cpp
@@ -64,7 +64,7 @@ GUI::ModelIndex FilterModel::index(int row, int column, const GUI::ModelIndex& p
return {};
return create_index(row, column, &m_filters[row]);
}
- auto* parent = static_cast<const FilterInfo*>(parent_index.internal_data());
+ auto* parent = static_cast<FilterInfo const*>(parent_index.internal_data());
if (static_cast<size_t>(row) >= parent->children.size())
return {};
auto* child = &parent->children[row];
@@ -76,7 +76,7 @@ GUI::ModelIndex FilterModel::parent_index(const GUI::ModelIndex& index) const
if (!index.is_valid())
return {};
- auto* child = static_cast<const FilterInfo*>(index.internal_data());
+ auto* child = static_cast<FilterInfo const*>(index.internal_data());
auto* parent = child->parent;
if (parent == nullptr)
return {};
@@ -99,13 +99,13 @@ int FilterModel::row_count(const GUI::ModelIndex& index) const
{
if (!index.is_valid())
return m_filters.size();
- auto* node = static_cast<const FilterInfo*>(index.internal_data());
+ auto* node = static_cast<FilterInfo const*>(index.internal_data());
return node->children.size();
}
GUI::Variant FilterModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const
{
- auto* filter = static_cast<const FilterInfo*>(index.internal_data());
+ auto* filter = static_cast<FilterInfo const*>(index.internal_data());
switch (role) {
case GUI::ModelRole::Display:
return filter->text;
diff --git a/Userland/Applications/PixelPaint/FilterPreviewWidget.cpp b/Userland/Applications/PixelPaint/FilterPreviewWidget.cpp
index f86fe42769..aff498e971 100644
--- a/Userland/Applications/PixelPaint/FilterPreviewWidget.cpp
+++ b/Userland/Applications/PixelPaint/FilterPreviewWidget.cpp
@@ -21,7 +21,7 @@ FilterPreviewWidget::~FilterPreviewWidget()
{
}
-void FilterPreviewWidget::set_bitmap(const RefPtr<Gfx::Bitmap>& bitmap)
+void FilterPreviewWidget::set_bitmap(RefPtr<Gfx::Bitmap> const& bitmap)
{
m_bitmap = bitmap;
clear_filter();
diff --git a/Userland/Applications/PixelPaint/FilterPreviewWidget.h b/Userland/Applications/PixelPaint/FilterPreviewWidget.h
index 451ff90569..4753c693ef 100644
--- a/Userland/Applications/PixelPaint/FilterPreviewWidget.h
+++ b/Userland/Applications/PixelPaint/FilterPreviewWidget.h
@@ -19,7 +19,7 @@ class FilterPreviewWidget final : public GUI::Frame {
public:
virtual ~FilterPreviewWidget() override;
- void set_bitmap(const RefPtr<Gfx::Bitmap>& bitmap);
+ void set_bitmap(RefPtr<Gfx::Bitmap> const& bitmap);
void set_filter(Filter* filter);
void clear_filter();
diff --git a/Userland/Applications/PixelPaint/Image.cpp b/Userland/Applications/PixelPaint/Image.cpp
index a14246b08e..f64edc2cad 100644
--- a/Userland/Applications/PixelPaint/Image.cpp
+++ b/Userland/Applications/PixelPaint/Image.cpp
@@ -126,7 +126,7 @@ void Image::serialize_as_json(JsonObjectSerializer<StringBuilder>& json) const
MUST(json.add("height", m_size.height()));
{
auto json_layers = MUST(json.add_array("layers"));
- for (const auto& layer : m_layers) {
+ for (auto const& layer : m_layers) {
Gfx::BMPWriter bmp_writer;
auto json_layer = MUST(json_layers.add_object());
MUST(json_layer.add("width", layer.size().width()));
@@ -147,7 +147,7 @@ void Image::serialize_as_json(JsonObjectSerializer<StringBuilder>& json) const
}
}
-ErrorOr<void> Image::write_to_file(const String& file_path) const
+ErrorOr<void> Image::write_to_file(String const& file_path) const
{
StringBuilder builder;
auto json = MUST(JsonObjectSerializer<>::try_create(builder));
@@ -228,7 +228,7 @@ void Image::add_layer(NonnullRefPtr<Layer> layer)
ErrorOr<NonnullRefPtr<Image>> Image::take_snapshot() const
{
auto snapshot = TRY(try_create_with_size(m_size));
- for (const auto& layer : m_layers) {
+ for (auto const& layer : m_layers) {
auto layer_snapshot = TRY(Layer::try_create_snapshot(*snapshot, layer));
snapshot->add_layer(move(layer_snapshot));
}
diff --git a/Userland/Applications/PixelPaint/ImageEditor.cpp b/Userland/Applications/PixelPaint/ImageEditor.cpp
index 9718bfd3c6..490271105c 100644
--- a/Userland/Applications/PixelPaint/ImageEditor.cpp
+++ b/Userland/Applications/PixelPaint/ImageEditor.cpp
@@ -162,49 +162,49 @@ void ImageEditor::paint_event(GUI::PaintEvent& event)
m_selection.paint(painter);
if (m_show_rulers) {
- const auto ruler_bg_color = palette().color(Gfx::ColorRole::InactiveSelection);
- const auto ruler_fg_color = palette().color(Gfx::ColorRole::Ruler);
- const auto ruler_text_color = palette().color(Gfx::ColorRole::InactiveSelectionText);
- const auto mouse_indicator_color = Color::White;
+ auto const ruler_bg_color = palette().color(Gfx::ColorRole::InactiveSelection);
+ auto const ruler_fg_color = palette().color(Gfx::ColorRole::Ruler);
+ auto const ruler_text_color = palette().color(Gfx::ColorRole::InactiveSelectionText);
+ auto const mouse_indicator_color = Color::White;
// Ruler background
painter.fill_rect({ { 0, 0 }, { m_ruler_thickness, rect().height() } }, ruler_bg_color);
painter.fill_rect({ { 0, 0 }, { rect().width(), m_ruler_thickness } }, ruler_bg_color);
- const auto ruler_step = calculate_ruler_step_size();
- const auto editor_origin_to_image = frame_to_content_position({ 0, 0 });
- const auto editor_max_to_image = frame_to_content_position({ width(), height() });
+ auto const ruler_step = calculate_ruler_step_size();
+ auto const editor_origin_to_image = frame_to_content_position({ 0, 0 });
+ auto const editor_max_to_image = frame_to_content_position({ width(), height() });
// Horizontal ruler
painter.draw_line({ 0, m_ruler_thickness }, { rect().width(), m_ruler_thickness }, ruler_fg_color);
- const auto x_start = floor(editor_origin_to_image.x()) - ((int)floor(editor_origin_to_image.x()) % ruler_step) - ruler_step;
+ auto const x_start = floor(editor_origin_to_image.x()) - ((int)floor(editor_origin_to_image.x()) % ruler_step) - ruler_step;
for (int x = x_start; x < editor_max_to_image.x(); x += ruler_step) {
- const int num_sub_divisions = min(ruler_step, 10);
+ int const num_sub_divisions = min(ruler_step, 10);
for (int x_sub = 0; x_sub < num_sub_divisions; ++x_sub) {
- const int x_pos = x + (int)(ruler_step * x_sub / num_sub_divisions);
- const int editor_x_sub = content_to_frame_position({ x_pos, 0 }).x();
- const int line_length = (x_sub % 2 == 0) ? m_ruler_thickness / 3 : m_ruler_thickness / 6;
+ int const x_pos = x + (int)(ruler_step * x_sub / num_sub_divisions);
+ int const editor_x_sub = content_to_frame_position({ x_pos, 0 }).x();
+ int const line_length = (x_sub % 2 == 0) ? m_ruler_thickness / 3 : m_ruler_thickness / 6;
painter.draw_line({ editor_x_sub, m_ruler_thickness - line_length }, { editor_x_sub, m_ruler_thickness }, ruler_fg_color);
}
- const int editor_x = content_to_frame_position({ x, 0 }).x();
+ int const editor_x = content_to_frame_position({ x, 0 }).x();
painter.draw_line({ editor_x, 0 }, { editor_x, m_ruler_thickness }, ruler_fg_color);
painter.draw_text({ { editor_x + 2, 0 }, { m_ruler_thickness, m_ruler_thickness - 2 } }, String::formatted("{}", x), painter.font(), Gfx::TextAlignment::CenterLeft, ruler_text_color);
}
// Vertical ruler
painter.draw_line({ m_ruler_thickness, 0 }, { m_ruler_thickness, rect().height() }, ruler_fg_color);
- const auto y_start = floor(editor_origin_to_image.y()) - ((int)floor(editor_origin_to_image.y()) % ruler_step) - ruler_step;
+ auto const y_start = floor(editor_origin_to_image.y()) - ((int)floor(editor_origin_to_image.y()) % ruler_step) - ruler_step;
for (int y = y_start; y < editor_max_to_image.y(); y += ruler_step) {
- const int num_sub_divisions = min(ruler_step, 10);
+ int const num_sub_divisions = min(ruler_step, 10);
for (int y_sub = 0; y_sub < num_sub_divisions; ++y_sub) {
- const int y_pos = y + (int)(ruler_step * y_sub / num_sub_divisions);
- const int editor_y_sub = content_to_frame_position({ 0, y_pos }).y();
- const int line_length = (y_sub % 2 == 0) ? m_ruler_thickness / 3 : m_ruler_thickness / 6;
+ int const y_pos = y + (int)(ruler_step * y_sub / num_sub_divisions);
+ int const editor_y_sub = content_to_frame_position({ 0, y_pos }).y();
+ int const line_length = (y_sub % 2 == 0) ? m_ruler_thickness / 3 : m_ruler_thickness / 6;
painter.draw_line({ m_ruler_thickness - line_length, editor_y_sub }, { m_ruler_thickness, editor_y_sub }, ruler_fg_color);
}
- const int editor_y = content_to_frame_position({ 0, y }).y();
+ int const editor_y = content_to_frame_position({ 0, y }).y();
painter.draw_line({ 0, editor_y }, { m_ruler_thickness, editor_y }, ruler_fg_color);
painter.draw_text({ { 0, editor_y - m_ruler_thickness }, { m_ruler_thickness, m_ruler_thickness } }, String::formatted("{}", y), painter.font(), Gfx::TextAlignment::BottomRight, ruler_text_color);
}
@@ -222,8 +222,8 @@ void ImageEditor::paint_event(GUI::PaintEvent& event)
int ImageEditor::calculate_ruler_step_size() const
{
- const auto step_target = 80 / scale();
- const auto max_factor = 5;
+ auto const step_target = 80 / scale();
+ auto const max_factor = 5;
for (int factor = 0; factor < max_factor; ++factor) {
int ten_to_factor = AK::pow<int>(10, factor);
if (step_target <= 1 * ten_to_factor)
@@ -619,7 +619,7 @@ Result<void, String> ImageEditor::save_project_to_file(Core::File& file) const
auto json = MUST(JsonObjectSerializer<>::try_create(builder));
m_image->serialize_as_json(json);
auto json_guides = MUST(json.add_array("guides"));
- for (const auto& guide : m_guides) {
+ for (auto const& guide : m_guides) {
auto json_guide = MUST(json_guides.add_object());
MUST(json_guide.add("offset"sv, (double)guide.offset()));
if (guide.orientation() == Guide::Orientation::Vertical)
diff --git a/Userland/Applications/PixelPaint/MainWidget.cpp b/Userland/Applications/PixelPaint/MainWidget.cpp
index abb28a1377..eb00abeebf 100644
--- a/Userland/Applications/PixelPaint/MainWidget.cpp
+++ b/Userland/Applications/PixelPaint/MainWidget.cpp
@@ -101,7 +101,7 @@ MainWidget::MainWidget()
}
// Note: Update these together! v
-static const Vector<String> s_suggested_zoom_levels { "25%", "50%", "100%", "200%", "300%", "400%", "800%", "1600%", "Fit to width", "Fit to height", "Fit entire image" };
+static Vector<String> const s_suggested_zoom_levels { "25%", "50%", "100%", "200%", "300%", "400%", "800%", "1600%", "Fit to width", "Fit to height", "Fit entire image" };
static constexpr int s_zoom_level_fit_width = 8;
static constexpr int s_zoom_level_fit_height = 9;
static constexpr int s_zoom_level_fit_image = 10;
diff --git a/Userland/Applications/PixelPaint/Tools/BrushTool.cpp b/Userland/Applications/PixelPaint/Tools/BrushTool.cpp
index aa809795d1..866be15713 100644
--- a/Userland/Applications/PixelPaint/Tools/BrushTool.cpp
+++ b/Userland/Applications/PixelPaint/Tools/BrushTool.cpp
@@ -36,7 +36,7 @@ void BrushTool::on_mousedown(Layer* layer, MouseEvent& event)
return;
}
- const int first_draw_opacity = 10;
+ int const first_draw_opacity = 10;
for (int i = 0; i < first_draw_opacity; ++i)
draw_point(layer->currently_edited_bitmap(), color_for(layer_event), layer_event.position());
diff --git a/Userland/Applications/PixelPaint/Tools/GuideTool.cpp b/Userland/Applications/PixelPaint/Tools/GuideTool.cpp
index 1203fe7285..bbe4efeb70 100644
--- a/Userland/Applications/PixelPaint/Tools/GuideTool.cpp
+++ b/Userland/Applications/PixelPaint/Tools/GuideTool.cpp
@@ -16,7 +16,7 @@
namespace PixelPaint {
-RefPtr<Guide> GuideTool::closest_guide(const Gfx::IntPoint& point)
+RefPtr<Guide> GuideTool::closest_guide(Gfx::IntPoint const& point)
{
auto guides = editor()->guides();
Guide* closest_guide = nullptr;
diff --git a/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp b/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp
index 9f7de2d0d8..0d2d7daea1 100644
--- a/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp
+++ b/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp
@@ -157,7 +157,7 @@ GUI::Widget* RectangleSelectTool::get_properties_widget()
feather_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
feather_label.set_fixed_size(80, 20);
- const int feather_slider_max = 100;
+ int const feather_slider_max = 100;
auto& feather_slider = feather_container.add<GUI::ValueSlider>(Orientation::Horizontal, "%");
feather_slider.set_range(0, feather_slider_max);
feather_slider.set_value((int)floorf(m_edge_feathering * (float)feather_slider_max));
diff --git a/Userland/Applications/PixelPaint/Tools/SprayTool.cpp b/Userland/Applications/PixelPaint/Tools/SprayTool.cpp
index 529798cddf..b1b2521ca7 100644
--- a/Userland/Applications/PixelPaint/Tools/SprayTool.cpp
+++ b/Userland/Applications/PixelPaint/Tools/SprayTool.cpp
@@ -43,13 +43,13 @@ void SprayTool::paint_it()
auto& bitmap = layer->currently_edited_bitmap();
GUI::Painter painter(bitmap);
VERIFY(bitmap.bpp() == 32);
- const double minimal_radius = 2;
- const double base_radius = minimal_radius * m_thickness;
+ double const minimal_radius = 2;
+ double const base_radius = minimal_radius * m_thickness;
for (int i = 0; i < M_PI * base_radius * base_radius * (m_density / 100.0); i++) {
double radius = base_radius * nrand();
double angle = 2 * M_PI * nrand();
- const int xpos = m_last_pos.x() + radius * AK::cos(angle);
- const int ypos = m_last_pos.y() - radius * AK::sin(angle);
+ int const xpos = m_last_pos.x() + radius * AK::cos(angle);
+ int const ypos = m_last_pos.y() - radius * AK::sin(angle);
if (xpos < 0 || xpos >= bitmap.width())
continue;
if (ypos < 0 || ypos >= bitmap.height())
diff --git a/Userland/Applications/PixelPaint/main.cpp b/Userland/Applications/PixelPaint/main.cpp
index e2cebb31b9..71ba88cf13 100644
--- a/Userland/Applications/PixelPaint/main.cpp
+++ b/Userland/Applications/PixelPaint/main.cpp
@@ -26,7 +26,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto app = GUI::Application::construct(arguments);
Config::pledge_domain("PixelPaint");
- const char* image_file = nullptr;
+ char const* image_file = nullptr;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(image_file, "Image file to open", "path", Core::ArgsParser::Required::No);
args_parser.parse(arguments);
diff --git a/Userland/Applications/Run/RunWindow.cpp b/Userland/Applications/Run/RunWindow.cpp
index 6e680936c4..6dcc87dd48 100644
--- a/Userland/Applications/Run/RunWindow.cpp
+++ b/Userland/Applications/Run/RunWindow.cpp
@@ -107,11 +107,11 @@ void RunWindow::do_run()
show();
}
-bool RunWindow::run_as_command(const String& run_input)
+bool RunWindow::run_as_command(String const& run_input)
{
pid_t child_pid;
- const char* shell_executable = "/bin/Shell"; // TODO query and use the user's preferred shell.
- const char* argv[] = { shell_executable, "-c", run_input.characters(), nullptr };
+ char const* shell_executable = "/bin/Shell"; // TODO query and use the user's preferred shell.
+ char const* argv[] = { shell_executable, "-c", run_input.characters(), nullptr };
if ((errno = posix_spawn(&child_pid, shell_executable, nullptr, nullptr, const_cast<char**>(argv), environ))) {
perror("posix_spawn");
@@ -136,7 +136,7 @@ bool RunWindow::run_as_command(const String& run_input)
return true;
}
-bool RunWindow::run_via_launch(const String& run_input)
+bool RunWindow::run_via_launch(String const& run_input)
{
auto url = URL::create_with_url_or_path(run_input);
diff --git a/Userland/Applications/Run/RunWindow.h b/Userland/Applications/Run/RunWindow.h
index c05bccf2ef..ca19e41350 100644
--- a/Userland/Applications/Run/RunWindow.h
+++ b/Userland/Applications/Run/RunWindow.h
@@ -24,8 +24,8 @@ private:
RunWindow();
void do_run();
- bool run_as_command(const String& run_input);
- bool run_via_launch(const String& run_input);
+ bool run_as_command(String const& run_input);
+ bool run_via_launch(String const& run_input);
String history_file_path();
void load_history();
diff --git a/Userland/Applications/SoundPlayer/M3UParser.cpp b/Userland/Applications/SoundPlayer/M3UParser.cpp
index 5b32bff491..8454d03781 100644
--- a/Userland/Applications/SoundPlayer/M3UParser.cpp
+++ b/Userland/Applications/SoundPlayer/M3UParser.cpp
@@ -24,7 +24,7 @@ NonnullOwnPtr<M3UParser> M3UParser::from_file(const String path)
return from_memory(String { contents, NoChomp }, use_utf8);
}
-NonnullOwnPtr<M3UParser> M3UParser::from_memory(const String& m3u_contents, bool utf8)
+NonnullOwnPtr<M3UParser> M3UParser::from_memory(String const& m3u_contents, bool utf8)
{
auto parser = make<M3UParser>();
VERIFY(!m3u_contents.is_null() && !m3u_contents.is_empty() && !m3u_contents.is_whitespace());
@@ -38,7 +38,7 @@ NonnullOwnPtr<Vector<M3UEntry>> M3UParser::parse(bool include_extended_info)
auto vec = make<Vector<M3UEntry>>();
if (m_use_utf8) {
- //TODO: Implement M3U8 parsing
+ // TODO: Implement M3U8 parsing
TODO();
return vec;
}
@@ -75,7 +75,7 @@ NonnullOwnPtr<Vector<M3UEntry>> M3UParser::parse(bool include_extended_info)
auto display_name = ext_inf.value().substring_view(seconds.length() + 1);
VERIFY(!display_name.is_empty() && !display_name.is_null() && !display_name.is_empty());
metadata_for_next_file.track_display_title = display_name;
- //TODO: support the alternative, non-standard #EXTINF value of a key=value dictionary
+ // TODO: support the alternative, non-standard #EXTINF value of a key=value dictionary
continue;
}
if (auto playlist = tag("#PLAYLIST:"); playlist.has_value())
@@ -88,7 +88,7 @@ NonnullOwnPtr<Vector<M3UEntry>> M3UParser::parse(bool include_extended_info)
metadata_for_next_file.album_artist = move(ext_art.value());
else if (auto ext_genre = tag("#EXTGENRE:"); ext_genre.has_value())
metadata_for_next_file.album_genre = move(ext_genre.value());
- //TODO: Support M3A files (M3U files with embedded mp3 files)
+ // TODO: Support M3A files (M3U files with embedded mp3 files)
}
return vec;
diff --git a/Userland/Applications/SoundPlayer/M3UParser.h b/Userland/Applications/SoundPlayer/M3UParser.h
index d87b07ed95..31d3a7d71e 100644
--- a/Userland/Applications/SoundPlayer/M3UParser.h
+++ b/Userland/Applications/SoundPlayer/M3UParser.h
@@ -33,7 +33,7 @@ struct M3UEntry {
class M3UParser {
public:
static NonnullOwnPtr<M3UParser> from_file(String path);
- static NonnullOwnPtr<M3UParser> from_memory(const String& m3u_contents, bool utf8);
+ static NonnullOwnPtr<M3UParser> from_memory(String const& m3u_contents, bool utf8);
NonnullOwnPtr<Vector<M3UEntry>> parse(bool include_extended_info);
diff --git a/Userland/Applications/SoundPlayer/PlaybackManager.cpp b/Userland/Applications/SoundPlayer/PlaybackManager.cpp
index bbaf720a34..fad0b1a7b1 100644
--- a/Userland/Applications/SoundPlayer/PlaybackManager.cpp
+++ b/Userland/Applications/SoundPlayer/PlaybackManager.cpp
@@ -66,7 +66,7 @@ void PlaybackManager::loop(bool loop)
m_loop = loop;
}
-void PlaybackManager::seek(const int position)
+void PlaybackManager::seek(int const position)
{
if (!m_loader)
return;
diff --git a/Userland/Applications/SoundPlayer/PlaybackManager.h b/Userland/Applications/SoundPlayer/PlaybackManager.h
index 2959855fa9..e4fa03eef6 100644
--- a/Userland/Applications/SoundPlayer/PlaybackManager.h
+++ b/Userland/Applications/SoundPlayer/PlaybackManager.h
@@ -22,7 +22,7 @@ public:
void play();
void stop();
void pause();
- void seek(const int position);
+ void seek(int const position);
void loop(bool);
bool toggle_pause();
void set_loader(NonnullRefPtr<Audio::Loader>&&);
diff --git a/Userland/Applications/SoundPlayer/Playlist.cpp b/Userland/Applications/SoundPlayer/Playlist.cpp
index 96f09f8001..69db139f07 100644
--- a/Userland/Applications/SoundPlayer/Playlist.cpp
+++ b/Userland/Applications/SoundPlayer/Playlist.cpp
@@ -51,12 +51,12 @@ void Playlist::try_fill_missing_info(Vector<M3UEntry>& entries, StringView path)
entry.extended_info->track_display_title = LexicalPath::title(entry.path);
if (!entry.extended_info->track_length_in_seconds.has_value()) {
- //TODO: Implement embedded metadata extractor for other audio formats
+ // TODO: Implement embedded metadata extractor for other audio formats
if (auto reader = Audio::Loader::create(entry.path); !reader.is_error())
entry.extended_info->track_length_in_seconds = reader.value()->total_samples() / reader.value()->sample_rate();
}
- //TODO: Implement a metadata parser for the uncomfortably numerous popular embedded metadata formats
+ // TODO: Implement a metadata parser for the uncomfortably numerous popular embedded metadata formats
}
for (auto& entry : to_delete)
diff --git a/Userland/Applications/SoundPlayer/PlaylistWidget.cpp b/Userland/Applications/SoundPlayer/PlaylistWidget.cpp
index f954c93489..b5881d7bd7 100644
--- a/Userland/Applications/SoundPlayer/PlaylistWidget.cpp
+++ b/Userland/Applications/SoundPlayer/PlaylistWidget.cpp
@@ -19,7 +19,7 @@ PlaylistWidget::PlaylistWidget()
m_table_view->set_selection_mode(GUI::AbstractView::SelectionMode::SingleSelection);
m_table_view->set_selection_behavior(GUI::AbstractView::SelectionBehavior::SelectRows);
m_table_view->set_highlight_selected_rows(true);
- m_table_view->on_doubleclick = [&](const Gfx::Point<int>& point) {
+ m_table_view->on_doubleclick = [&](Gfx::Point<int> const& point) {
auto player = dynamic_cast<Player*>(window()->main_widget());
auto index = m_table_view->index_at_event_position(point);
if (!index.is_valid())
@@ -50,7 +50,7 @@ GUI::Variant PlaylistModel::data(const GUI::ModelIndex& index, GUI::ModelRole ro
}
if (role == GUI::ModelRole::Sort)
return data(index, GUI::ModelRole::Display);
- if (role == static_cast<GUI::ModelRole>(PlaylistModelCustomRole::FilePath)) //path
+ if (role == static_cast<GUI::ModelRole>(PlaylistModelCustomRole::FilePath)) // path
return m_playlist_items[index.row()].path;
return {};
diff --git a/Userland/Applications/SoundPlayer/PlaylistWidget.h b/Userland/Applications/SoundPlayer/PlaylistWidget.h
index d4c10360ad..e1260fd20e 100644
--- a/Userland/Applications/SoundPlayer/PlaylistWidget.h
+++ b/Userland/Applications/SoundPlayer/PlaylistWidget.h
@@ -39,7 +39,7 @@ class PlaylistTableView : public GUI::TableView {
public:
void doubleclick_event(GUI::MouseEvent& event) override;
- Function<void(const Gfx::Point<int>&)> on_doubleclick;
+ Function<void(Gfx::Point<int> const&)> on_doubleclick;
private:
PlaylistTableView();
diff --git a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp
index d9a8160ed7..8261504313 100644
--- a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp
+++ b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp
@@ -35,17 +35,17 @@ static float get_normalized_aspect_ratio(float a, float b)
}
}
-static bool node_is_leaf(const TreeMapNode& node)
+static bool node_is_leaf(TreeMapNode const& node)
{
return node.num_children() == 0;
}
-bool TreeMapWidget::rect_can_contain_label(const Gfx::IntRect& rect) const
+bool TreeMapWidget::rect_can_contain_label(Gfx::IntRect const& rect) const
{
return rect.height() >= font().presentation_size() && rect.width() > 20;
}
-void TreeMapWidget::paint_cell_frame(GUI::Painter& painter, const TreeMapNode& node, const Gfx::IntRect& cell_rect, const Gfx::IntRect& inner_rect, int depth, HasLabel has_label) const
+void TreeMapWidget::paint_cell_frame(GUI::Painter& painter, TreeMapNode const& node, Gfx::IntRect const& cell_rect, Gfx::IntRect const& inner_rect, int depth, HasLabel has_label) const
{
if (cell_rect.width() <= 2 || cell_rect.height() <= 2) {
painter.fill_rect(cell_rect, Color::Black);
@@ -101,7 +101,7 @@ void TreeMapWidget::paint_cell_frame(GUI::Painter& painter, const TreeMapNode& n
}
template<typename Function>
-void TreeMapWidget::lay_out_children(const TreeMapNode& node, const Gfx::IntRect& rect, int depth, Function callback)
+void TreeMapWidget::lay_out_children(TreeMapNode const& node, Gfx::IntRect const& rect, int depth, Function callback)
{
if (node.num_children() == 0) {
return;
@@ -179,7 +179,7 @@ void TreeMapWidget::lay_out_children(const TreeMapNode& node, const Gfx::IntRect
inner_rect = cell_rect;
inner_rect.shrink(4, 4); // border and shading
if (rect_can_contain_label(inner_rect)) {
- const int margin = 5;
+ int const margin = 5;
has_label = HasLabel::Yes;
inner_rect.set_y(inner_rect.y() + font().presentation_size() + margin);
inner_rect.set_height(inner_rect.height() - (font().presentation_size() + margin * 2));
@@ -214,11 +214,11 @@ void TreeMapWidget::lay_out_children(const TreeMapNode& node, const Gfx::IntRect
}
}
-const TreeMapNode* TreeMapWidget::path_node(size_t n) const
+TreeMapNode const* TreeMapWidget::path_node(size_t n) const
{
if (!m_tree.ptr())
return nullptr;
- const TreeMapNode* iter = &m_tree->root();
+ TreeMapNode const* iter = &m_tree->root();
size_t path_index = 0;
while (iter && path_index < m_path.size() && path_index < n) {
size_t child_index = m_path[path_index];
@@ -238,13 +238,13 @@ void TreeMapWidget::paint_event(GUI::PaintEvent& event)
m_selected_node_cache = path_node(m_path.size());
- const TreeMapNode* node = path_node(m_viewpoint);
+ TreeMapNode const* node = path_node(m_viewpoint);
if (!node) {
painter.fill_rect(frame_inner_rect(), Color::MidGray);
} else if (node_is_leaf(*node)) {
paint_cell_frame(painter, *node, frame_inner_rect(), Gfx::IntRect(), m_viewpoint - 1, HasLabel::Yes);
} else {
- lay_out_children(*node, frame_inner_rect(), m_viewpoint, [&](const TreeMapNode& node, int, const Gfx::IntRect& rect, const Gfx::IntRect& inner_rect, int depth, HasLabel has_label, IsRemainder remainder) {
+ lay_out_children(*node, frame_inner_rect(), m_viewpoint, [&](TreeMapNode const& node, int, Gfx::IntRect const& rect, Gfx::IntRect const& inner_rect, int depth, HasLabel has_label, IsRemainder remainder) {
if (remainder == IsRemainder::No) {
paint_cell_frame(painter, node, rect, inner_rect, depth, has_label);
} else {
@@ -258,14 +258,14 @@ void TreeMapWidget::paint_event(GUI::PaintEvent& event)
}
}
-Vector<int> TreeMapWidget::path_to_position(const Gfx::IntPoint& position)
+Vector<int> TreeMapWidget::path_to_position(Gfx::IntPoint const& position)
{
- const TreeMapNode* node = path_node(m_viewpoint);
+ TreeMapNode const* node = path_node(m_viewpoint);
if (!node) {
return {};
}
Vector<int> path;
- lay_out_children(*node, frame_inner_rect(), m_viewpoint, [&](const TreeMapNode&, int index, const Gfx::IntRect& rect, const Gfx::IntRect&, int, HasLabel, IsRemainder is_remainder) {
+ lay_out_children(*node, frame_inner_rect(), m_viewpoint, [&](TreeMapNode const&, int index, Gfx::IntRect const& rect, Gfx::IntRect const&, int, HasLabel, IsRemainder is_remainder) {
if (is_remainder == IsRemainder::No && rect.contains(position)) {
path.append(index);
}
@@ -275,7 +275,7 @@ Vector<int> TreeMapWidget::path_to_position(const Gfx::IntPoint& position)
void TreeMapWidget::mousedown_event(GUI::MouseEvent& event)
{
- const TreeMapNode* node = path_node(m_viewpoint);
+ TreeMapNode const* node = path_node(m_viewpoint);
if (node && !node_is_leaf(*node)) {
Vector<int> path = path_to_position(event.position());
if (!path.is_empty()) {
@@ -293,7 +293,7 @@ void TreeMapWidget::doubleclick_event(GUI::MouseEvent& event)
{
if (event.button() != GUI::MouseButton::Primary)
return;
- const TreeMapNode* node = path_node(m_viewpoint);
+ TreeMapNode const* node = path_node(m_viewpoint);
if (node && !node_is_leaf(*node)) {
Vector<int> path = path_to_position(event.position());
m_path.shrink(m_viewpoint);
diff --git a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.h b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.h
index 9c0ef8382d..14636e7f90 100644
--- a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.h
+++ b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.h
@@ -15,7 +15,7 @@ struct TreeMapNode {
virtual String name() const = 0;
virtual i64 area() const = 0;
virtual size_t num_children() const = 0;
- virtual const TreeMapNode& child_at(size_t i) const = 0;
+ virtual TreeMapNode const& child_at(size_t i) const = 0;
virtual void sort_children_by_area() const = 0;
protected:
@@ -24,7 +24,7 @@ protected:
struct TreeMap : public RefCounted<TreeMap> {
virtual ~TreeMap() = default;
- virtual const TreeMapNode& root() const = 0;
+ virtual TreeMapNode const& root() const = 0;
};
class TreeMapWidget final : public GUI::Frame {
@@ -35,7 +35,7 @@ public:
Function<void()> on_path_change;
Function<void(GUI::ContextMenuEvent&)> on_context_menu_request;
size_t path_size() const;
- const TreeMapNode* path_node(size_t n) const;
+ TreeMapNode const* path_node(size_t n) const;
size_t viewpoint() const;
void set_viewpoint(size_t);
void set_tree(RefPtr<TreeMap> tree);
@@ -49,8 +49,8 @@ private:
virtual void context_menu_event(GUI::ContextMenuEvent&) override;
virtual void keydown_event(GUI::KeyEvent&) override;
- bool rect_can_contain_children(const Gfx::IntRect& rect) const;
- bool rect_can_contain_label(const Gfx::IntRect& rect) const;
+ bool rect_can_contain_children(Gfx::IntRect const& rect) const;
+ bool rect_can_contain_label(Gfx::IntRect const& rect) const;
enum class HasLabel {
Yes,
@@ -62,14 +62,14 @@ private:
};
template<typename Function>
- void lay_out_children(const TreeMapNode&, const Gfx::IntRect&, int depth, Function);
- void paint_cell_frame(GUI::Painter&, const TreeMapNode&, const Gfx::IntRect&, const Gfx::IntRect&, int depth, HasLabel has_label) const;
- Vector<int> path_to_position(const Gfx::IntPoint&);
+ void lay_out_children(TreeMapNode const&, Gfx::IntRect const&, int depth, Function);
+ void paint_cell_frame(GUI::Painter&, TreeMapNode const&, Gfx::IntRect const&, Gfx::IntRect const&, int depth, HasLabel has_label) const;
+ Vector<int> path_to_position(Gfx::IntPoint const&);
RefPtr<TreeMap> m_tree;
Vector<int> m_path;
size_t m_viewpoint { 0 };
- const void* m_selected_node_cache;
+ void const* m_selected_node_cache;
};
}
diff --git a/Userland/Applications/SpaceAnalyzer/main.cpp b/Userland/Applications/SpaceAnalyzer/main.cpp
index b53b67be15..560c7d9e4e 100644
--- a/Userland/Applications/SpaceAnalyzer/main.cpp
+++ b/Userland/Applications/SpaceAnalyzer/main.cpp
@@ -46,7 +46,7 @@ struct TreeNode : public SpaceAnalyzer::TreeMapNode {
}
return 0;
}
- virtual const TreeNode& child_at(size_t i) const override { return m_children->at(i); }
+ virtual TreeNode const& child_at(size_t i) const override { return m_children->at(i); }
virtual void sort_children_by_area() const override
{
if (m_children) {
@@ -65,7 +65,7 @@ struct Tree : public SpaceAnalyzer::TreeMap {
: m_root(move(root_name)) {};
virtual ~Tree() {};
TreeNode m_root;
- virtual const SpaceAnalyzer::TreeMapNode& root() const override
+ virtual SpaceAnalyzer::TreeMapNode const& root() const override
{
return m_root;
};
@@ -278,7 +278,7 @@ static void analyze(RefPtr<Tree> tree, SpaceAnalyzer::TreeMapWidget& treemapwidg
treemapwidget.set_tree(tree);
}
-static bool is_removable(const String& absolute_path)
+static bool is_removable(String const& absolute_path)
{
VERIFY(!absolute_path.is_empty());
int access_result = access(LexicalPath::dirname(absolute_path).characters(), W_OK);
@@ -287,14 +287,14 @@ static bool is_removable(const String& absolute_path)
return access_result == 0;
}
-static String get_absolute_path_to_selected_node(const SpaceAnalyzer::TreeMapWidget& treemapwidget, bool include_last_node = true)
+static String get_absolute_path_to_selected_node(SpaceAnalyzer::TreeMapWidget const& treemapwidget, bool include_last_node = true)
{
StringBuilder path_builder;
for (size_t k = 0; k < treemapwidget.path_size() - (include_last_node ? 0 : 1); k++) {
if (k != 0) {
path_builder.append('/');
}
- const SpaceAnalyzer::TreeMapNode* node = treemapwidget.path_node(k);
+ SpaceAnalyzer::TreeMapNode const* node = treemapwidget.path_node(k);
path_builder.append(node->name());
}
return path_builder.build();
diff --git a/Userland/Applications/Spreadsheet/Cell.cpp b/Userland/Applications/Spreadsheet/Cell.cpp
index dd111615c1..e9c41fdf61 100644
--- a/Userland/Applications/Spreadsheet/Cell.cpp
+++ b/Userland/Applications/Spreadsheet/Cell.cpp
@@ -47,7 +47,7 @@ void Cell::set_data(JS::Value new_data)
m_evaluated_data = move(new_data);
}
-void Cell::set_type(const CellType* type)
+void Cell::set_type(CellType const* type)
{
m_type = type;
}
@@ -67,7 +67,7 @@ void Cell::set_type_metadata(CellTypeMetadata&& metadata)
m_type_metadata = move(metadata);
}
-const CellType& Cell::type() const
+CellType const& Cell::type() const
{
if (m_type)
return *m_type;
@@ -171,13 +171,13 @@ void Cell::reference_from(Cell* other)
if (!other || other == this)
return;
- if (!m_referencing_cells.find_if([other](const auto& ptr) { return ptr.ptr() == other; }).is_end())
+ if (!m_referencing_cells.find_if([other](auto const& ptr) { return ptr.ptr() == other; }).is_end())
return;
m_referencing_cells.append(other->make_weak_ptr());
}
-void Cell::copy_from(const Cell& other)
+void Cell::copy_from(Cell const& other)
{
m_dirty = true;
m_evaluated_externally = other.m_evaluated_externally;
diff --git a/Userland/Applications/Spreadsheet/Cell.h b/Userland/Applications/Spreadsheet/Cell.h
index f38b0a7092..6159b9ec2d 100644
--- a/Userland/Applications/Spreadsheet/Cell.h
+++ b/Userland/Applications/Spreadsheet/Cell.h
@@ -58,16 +58,16 @@ struct Cell : public Weakable<Cell> {
return m_thrown_value;
}
- const String& data() const { return m_data; }
+ String const& data() const { return m_data; }
const JS::Value& evaluated_data() const { return m_evaluated_data; }
Kind kind() const { return m_kind; }
- const Vector<WeakPtr<Cell>>& referencing_cells() const { return m_referencing_cells; }
+ Vector<WeakPtr<Cell>> const& referencing_cells() const { return m_referencing_cells; }
void set_type(StringView name);
- void set_type(const CellType*);
+ void set_type(CellType const*);
void set_type_metadata(CellTypeMetadata&&);
- const Position& position() const { return m_position; }
+ Position const& position() const { return m_position; }
void set_position(Position position, Badge<Sheet>)
{
if (position != m_position) {
@@ -76,9 +76,9 @@ struct Cell : public Weakable<Cell> {
}
}
- const Format& evaluated_formats() const { return m_evaluated_formats; }
+ Format const& evaluated_formats() const { return m_evaluated_formats; }
Format& evaluated_formats() { return m_evaluated_formats; }
- const Vector<ConditionalFormat>& conditional_formats() const { return m_conditional_formats; }
+ Vector<ConditionalFormat> const& conditional_formats() const { return m_conditional_formats; }
void set_conditional_formats(Vector<ConditionalFormat>&& fmts)
{
m_dirty = true;
@@ -88,8 +88,8 @@ struct Cell : public Weakable<Cell> {
JS::ThrowCompletionOr<String> typed_display() const;
JS::ThrowCompletionOr<JS::Value> typed_js_data() const;
- const CellType& type() const;
- const CellTypeMetadata& type_metadata() const { return m_type_metadata; }
+ CellType const& type() const;
+ CellTypeMetadata const& type_metadata() const { return m_type_metadata; }
CellTypeMetadata& type_metadata() { return m_type_metadata; }
String source() const;
@@ -99,10 +99,10 @@ struct Cell : public Weakable<Cell> {
void update();
void update_data(Badge<Sheet>);
- const Sheet& sheet() const { return *m_sheet; }
+ Sheet const& sheet() const { return *m_sheet; }
Sheet& sheet() { return *m_sheet; }
- void copy_from(const Cell&);
+ void copy_from(Cell const&);
private:
bool m_dirty { false };
@@ -113,7 +113,7 @@ private:
Kind m_kind { LiteralString };
WeakPtr<Sheet> m_sheet;
Vector<WeakPtr<Cell>> m_referencing_cells;
- const CellType* m_type { nullptr };
+ CellType const* m_type { nullptr };
CellTypeMetadata m_type_metadata;
Position m_position;
diff --git a/Userland/Applications/Spreadsheet/CellSyntaxHighlighter.cpp b/Userland/Applications/Spreadsheet/CellSyntaxHighlighter.cpp
index e9c43180f8..4fdc12b110 100644
--- a/Userland/Applications/Spreadsheet/CellSyntaxHighlighter.cpp
+++ b/Userland/Applications/Spreadsheet/CellSyntaxHighlighter.cpp
@@ -11,7 +11,7 @@
namespace Spreadsheet {
-void CellSyntaxHighlighter::rehighlight(const Palette& palette)
+void CellSyntaxHighlighter::rehighlight(Palette const& palette)
{
auto text = m_client->get_text();
m_client->spans().clear();
diff --git a/Userland/Applications/Spreadsheet/CellSyntaxHighlighter.h b/Userland/Applications/Spreadsheet/CellSyntaxHighlighter.h
index 0a19d3f715..265c28efbe 100644
--- a/Userland/Applications/Spreadsheet/CellSyntaxHighlighter.h
+++ b/Userland/Applications/Spreadsheet/CellSyntaxHighlighter.h
@@ -16,11 +16,11 @@ public:
CellSyntaxHighlighter() = default;
virtual ~CellSyntaxHighlighter() override = default;
- virtual void rehighlight(const Palette&) override;
- void set_cell(const Cell* cell) { m_cell = cell; }
+ virtual void rehighlight(Palette const&) override;
+ void set_cell(Cell const* cell) { m_cell = cell; }
private:
- const Cell* m_cell { nullptr };
+ Cell const* m_cell { nullptr };
};
}
diff --git a/Userland/Applications/Spreadsheet/CellType/Date.cpp b/Userland/Applications/Spreadsheet/CellType/Date.cpp
index 3bc12c55af..9810f162d9 100644
--- a/Userland/Applications/Spreadsheet/CellType/Date.cpp
+++ b/Userland/Applications/Spreadsheet/CellType/Date.cpp
@@ -17,7 +17,7 @@ DateCell::DateCell()
{
}
-JS::ThrowCompletionOr<String> DateCell::display(Cell& cell, const CellTypeMetadata& metadata) const
+JS::ThrowCompletionOr<String> DateCell::display(Cell& cell, CellTypeMetadata const& metadata) const
{
return propagate_failure(cell, [&]() -> JS::ThrowCompletionOr<String> {
auto timestamp = TRY(js_value(cell, metadata));
@@ -30,7 +30,7 @@ JS::ThrowCompletionOr<String> DateCell::display(Cell& cell, const CellTypeMetada
});
}
-JS::ThrowCompletionOr<JS::Value> DateCell::js_value(Cell& cell, const CellTypeMetadata&) const
+JS::ThrowCompletionOr<JS::Value> DateCell::js_value(Cell& cell, CellTypeMetadata const&) const
{
auto js_data = cell.js_data();
auto value = TRY(js_data.to_double(cell.sheet().global_object()));
diff --git a/Userland/Applications/Spreadsheet/CellType/Date.h b/Userland/Applications/Spreadsheet/CellType/Date.h
index b8df17a8ff..b1aca31f5b 100644
--- a/Userland/Applications/Spreadsheet/CellType/Date.h
+++ b/Userland/Applications/Spreadsheet/CellType/Date.h
@@ -16,8 +16,8 @@ class DateCell : public CellType {
public:
DateCell();
virtual ~DateCell() override = default;
- virtual JS::ThrowCompletionOr<String> display(Cell&, const CellTypeMetadata&) const override;
- virtual JS::ThrowCompletionOr<JS::Value> js_value(Cell&, const CellTypeMetadata&) const override;
+ virtual JS::ThrowCompletionOr<String> display(Cell&, CellTypeMetadata const&) const override;
+ virtual JS::ThrowCompletionOr<JS::Value> js_value(Cell&, CellTypeMetadata const&) const override;
String metadata_hint(MetadataName) const override;
};
diff --git a/Userland/Applications/Spreadsheet/CellType/Format.cpp b/Userland/Applications/Spreadsheet/CellType/Format.cpp
index f33d11e320..82e7d31d37 100644
--- a/Userland/Applications/Spreadsheet/CellType/Format.cpp
+++ b/Userland/Applications/Spreadsheet/CellType/Format.cpp
@@ -21,23 +21,23 @@ struct SingleEntryListNext {
template<typename PutChFunc, typename ArgumentListRefT, template<typename T, typename U = ArgumentListRefT> typename NextArgument, typename CharType>
struct PrintfImpl : public PrintfImplementation::PrintfImpl<PutChFunc, ArgumentListRefT, NextArgument, CharType> {
- ALWAYS_INLINE PrintfImpl(PutChFunc& putch, char*& bufptr, const int& nwritten)
+ ALWAYS_INLINE PrintfImpl(PutChFunc& putch, char*& bufptr, int const& nwritten)
: PrintfImplementation::PrintfImpl<PutChFunc, ArgumentListRefT, NextArgument>(putch, bufptr, nwritten)
{
}
// Disallow pointer formats.
- ALWAYS_INLINE int format_n(const PrintfImplementation::ModifierState&, ArgumentListRefT&) const
+ ALWAYS_INLINE int format_n(PrintfImplementation::ModifierState const&, ArgumentListRefT&) const
{
return 0;
}
- ALWAYS_INLINE int format_s(const PrintfImplementation::ModifierState&, ArgumentListRefT&) const
+ ALWAYS_INLINE int format_s(PrintfImplementation::ModifierState const&, ArgumentListRefT&) const
{
return 0;
}
};
-String format_double(const char* format, double value)
+String format_double(char const* format, double value)
{
StringBuilder builder;
auto putch = [&](auto, auto ch) { builder.append(ch); };
diff --git a/Userland/Applications/Spreadsheet/CellType/Format.h b/Userland/Applications/Spreadsheet/CellType/Format.h
index adbe79f6d1..f9684aacbc 100644
--- a/Userland/Applications/Spreadsheet/CellType/Format.h
+++ b/Userland/Applications/Spreadsheet/CellType/Format.h
@@ -10,6 +10,6 @@
namespace Spreadsheet {
-String format_double(const char* format, double value);
+String format_double(char const* format, double value);
}
diff --git a/Userland/Applications/Spreadsheet/CellType/Identity.cpp b/Userland/Applications/Spreadsheet/CellType/Identity.cpp
index b73f026210..b44c7c5802 100644
--- a/Userland/Applications/Spreadsheet/CellType/Identity.cpp
+++ b/Userland/Applications/Spreadsheet/CellType/Identity.cpp
@@ -15,7 +15,7 @@ IdentityCell::IdentityCell()
{
}
-JS::ThrowCompletionOr<String> IdentityCell::display(Cell& cell, const CellTypeMetadata& metadata) const
+JS::ThrowCompletionOr<String> IdentityCell::display(Cell& cell, CellTypeMetadata const& metadata) const
{
auto data = cell.js_data();
if (!metadata.format.is_empty())
@@ -24,7 +24,7 @@ JS::ThrowCompletionOr<String> IdentityCell::display(Cell& cell, const CellTypeMe
return data.to_string(cell.sheet().global_object());
}
-JS::ThrowCompletionOr<JS::Value> IdentityCell::js_value(Cell& cell, const CellTypeMetadata&) const
+JS::ThrowCompletionOr<JS::Value> IdentityCell::js_value(Cell& cell, CellTypeMetadata const&) const
{
return cell.js_data();
}
diff --git a/Userland/Applications/Spreadsheet/CellType/Identity.h b/Userland/Applications/Spreadsheet/CellType/Identity.h
index 8e8cc7c701..2f43f6c820 100644
--- a/Userland/Applications/Spreadsheet/CellType/Identity.h
+++ b/Userland/Applications/Spreadsheet/CellType/Identity.h
@@ -15,8 +15,8 @@ class IdentityCell : public CellType {
public:
IdentityCell();
virtual ~IdentityCell() override = default;
- virtual JS::ThrowCompletionOr<String> display(Cell&, const CellTypeMetadata&) const override;
- virtual JS::ThrowCompletionOr<JS::Value> js_value(Cell&, const CellTypeMetadata&) const override;
+ virtual JS::ThrowCompletionOr<String> display(Cell&, CellTypeMetadata const&) const override;
+ virtual JS::ThrowCompletionOr<JS::Value> js_value(Cell&, CellTypeMetadata const&) const override;
String metadata_hint(MetadataName) const override;
};
diff --git a/Userland/Applications/Spreadsheet/CellType/Numeric.cpp b/Userland/Applications/Spreadsheet/CellType/Numeric.cpp
index 72c59d6529..483c55d0b4 100644
--- a/Userland/Applications/Spreadsheet/CellType/Numeric.cpp
+++ b/Userland/Applications/Spreadsheet/CellType/Numeric.cpp
@@ -17,7 +17,7 @@ NumericCell::NumericCell()
{
}
-JS::ThrowCompletionOr<String> NumericCell::display(Cell& cell, const CellTypeMetadata& metadata) const
+JS::ThrowCompletionOr<String> NumericCell::display(Cell& cell, CellTypeMetadata const& metadata) const
{
return propagate_failure(cell, [&]() -> JS::ThrowCompletionOr<String> {
auto value = TRY(js_value(cell, metadata));
@@ -34,7 +34,7 @@ JS::ThrowCompletionOr<String> NumericCell::display(Cell& cell, const CellTypeMet
});
}
-JS::ThrowCompletionOr<JS::Value> NumericCell::js_value(Cell& cell, const CellTypeMetadata&) const
+JS::ThrowCompletionOr<JS::Value> NumericCell::js_value(Cell& cell, CellTypeMetadata const&) const
{
return propagate_failure(cell, [&]() {
return cell.js_data().to_number(cell.sheet().global_object());
diff --git a/Userland/Applications/Spreadsheet/CellType/Numeric.h b/Userland/Applications/Spreadsheet/CellType/Numeric.h
index d0f3b8491b..2bf94e15cc 100644
--- a/Userland/Applications/Spreadsheet/CellType/Numeric.h
+++ b/Userland/Applications/Spreadsheet/CellType/Numeric.h
@@ -26,8 +26,8 @@ class NumericCell : public CellType {
public:
NumericCell();
virtual ~NumericCell() override = default;
- virtual JS::ThrowCompletionOr<String> display(Cell&, const CellTypeMetadata&) const override;
- virtual JS::ThrowCompletionOr<JS::Value> js_value(Cell&, const CellTypeMetadata&) const override;
+ virtual JS::ThrowCompletionOr<String> display(Cell&, CellTypeMetadata const&) const override;
+ virtual JS::ThrowCompletionOr<JS::Value> js_value(Cell&, CellTypeMetadata const&) const override;
String metadata_hint(MetadataName) const override;
};
diff --git a/Userland/Applications/Spreadsheet/CellType/String.cpp b/Userland/Applications/Spreadsheet/CellType/String.cpp
index 310bda6e83..c0707be469 100644
--- a/Userland/Applications/Spreadsheet/CellType/String.cpp
+++ b/Userland/Applications/Spreadsheet/CellType/String.cpp
@@ -15,7 +15,7 @@ StringCell::StringCell()
{
}
-JS::ThrowCompletionOr<String> StringCell::display(Cell& cell, const CellTypeMetadata& metadata) const
+JS::ThrowCompletionOr<String> StringCell::display(Cell& cell, CellTypeMetadata const& metadata) const
{
auto string = TRY(cell.js_data().to_string(cell.sheet().global_object()));
if (metadata.length >= 0)
@@ -24,7 +24,7 @@ JS::ThrowCompletionOr<String> StringCell::display(Cell& cell, const CellTypeMeta
return string;
}
-JS::ThrowCompletionOr<JS::Value> StringCell::js_value(Cell& cell, const CellTypeMetadata& metadata) const
+JS::ThrowCompletionOr<JS::Value> StringCell::js_value(Cell& cell, CellTypeMetadata const& metadata) const
{
auto string = TRY(display(cell, metadata));
return JS::js_string(cell.sheet().interpreter().heap(), string);
diff --git a/Userland/Applications/Spreadsheet/CellType/String.h b/Userland/Applications/Spreadsheet/CellType/String.h
index aecf1a23a6..ed6333af7a 100644
--- a/Userland/Applications/Spreadsheet/CellType/String.h
+++ b/Userland/Applications/Spreadsheet/CellType/String.h
@@ -15,8 +15,8 @@ class StringCell : public CellType {
public:
StringCell();
virtual ~StringCell() override = default;
- virtual JS::ThrowCompletionOr<String> display(Cell&, const CellTypeMetadata&) const override;
- virtual JS::ThrowCompletionOr<JS::Value> js_value(Cell&, const CellTypeMetadata&) const override;
+ virtual JS::ThrowCompletionOr<String> display(Cell&, CellTypeMetadata const&) const override;
+ virtual JS::ThrowCompletionOr<JS::Value> js_value(Cell&, CellTypeMetadata const&) const override;
String metadata_hint(MetadataName) const override;
};
diff --git a/Userland/Applications/Spreadsheet/CellType/Type.cpp b/Userland/Applications/Spreadsheet/CellType/Type.cpp
index 5690d8b64b..e75665fbbc 100644
--- a/Userland/Applications/Spreadsheet/CellType/Type.cpp
+++ b/Userland/Applications/Spreadsheet/CellType/Type.cpp
@@ -20,7 +20,7 @@ static Spreadsheet::DateCell s_date_cell;
namespace Spreadsheet {
-const CellType* CellType::get_by_name(StringView name)
+CellType const* CellType::get_by_name(StringView name)
{
return s_cell_types.get(name).value_or(nullptr);
}
diff --git a/Userland/Applications/Spreadsheet/CellType/Type.h b/Userland/Applications/Spreadsheet/CellType/Type.h
index 10d27027d8..2418c900f3 100644
--- a/Userland/Applications/Spreadsheet/CellType/Type.h
+++ b/Userland/Applications/Spreadsheet/CellType/Type.h
@@ -32,15 +32,15 @@ enum class MetadataName {
class CellType {
public:
- static const CellType* get_by_name(StringView);
+ static CellType const* get_by_name(StringView);
static Vector<StringView> names();
- virtual JS::ThrowCompletionOr<String> display(Cell&, const CellTypeMetadata&) const = 0;
- virtual JS::ThrowCompletionOr<JS::Value> js_value(Cell&, const CellTypeMetadata&) const = 0;
+ virtual JS::ThrowCompletionOr<String> display(Cell&, CellTypeMetadata const&) const = 0;
+ virtual JS::ThrowCompletionOr<JS::Value> js_value(Cell&, CellTypeMetadata const&) const = 0;
virtual String metadata_hint(MetadataName) const { return {}; }
virtual ~CellType() = default;
- const String& name() const { return m_name; }
+ String const& name() const { return m_name; }
protected:
CellType(StringView name);
diff --git a/Userland/Applications/Spreadsheet/CellTypeDialog.cpp b/Userland/Applications/Spreadsheet/CellTypeDialog.cpp
index 5775900eaf..045966650c 100644
--- a/Userland/Applications/Spreadsheet/CellTypeDialog.cpp
+++ b/Userland/Applications/Spreadsheet/CellTypeDialog.cpp
@@ -29,7 +29,7 @@ REGISTER_WIDGET(Spreadsheet, ConditionsView);
namespace Spreadsheet {
-CellTypeDialog::CellTypeDialog(const Vector<Position>& positions, Sheet& sheet, GUI::Window* parent)
+CellTypeDialog::CellTypeDialog(Vector<Position> const& positions, Sheet& sheet, GUI::Window* parent)
: GUI::Dialog(parent)
{
VERIFY(!positions.is_empty());
@@ -62,8 +62,8 @@ CellTypeDialog::CellTypeDialog(const Vector<Position>& positions, Sheet& sheet,
ok_button.on_click = [&](auto) { done(ExecOK); };
}
-const Vector<String> g_horizontal_alignments { "Left", "Center", "Right" };
-const Vector<String> g_vertical_alignments { "Top", "Center", "Bottom" };
+Vector<String> const g_horizontal_alignments { "Left", "Center", "Right" };
+Vector<String> const g_vertical_alignments { "Top", "Center", "Bottom" };
Vector<String> g_types;
constexpr static CellTypeDialog::VerticalAlignment vertical_alignment_from(Gfx::TextAlignment alignment)
@@ -110,7 +110,7 @@ constexpr static CellTypeDialog::HorizontalAlignment horizontal_alignment_from(G
return CellTypeDialog::HorizontalAlignment::Right;
}
-void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, const Vector<Position>& positions, Sheet& sheet)
+void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector<Position> const& positions, Sheet& sheet)
{
g_types.clear();
for (auto& type_name : CellType::names())
diff --git a/Userland/Applications/Spreadsheet/CellTypeDialog.h b/Userland/Applications/Spreadsheet/CellTypeDialog.h
index d9f7955eb6..f260ddf818 100644
--- a/Userland/Applications/Spreadsheet/CellTypeDialog.h
+++ b/Userland/Applications/Spreadsheet/CellTypeDialog.h
@@ -18,7 +18,7 @@ class CellTypeDialog : public GUI::Dialog {
public:
CellTypeMetadata metadata() const;
- const CellType* type() const { return m_type; }
+ CellType const* type() const { return m_type; }
Vector<ConditionalFormat> conditional_formats() { return m_conditional_formats; }
enum class HorizontalAlignment : int {
@@ -33,10 +33,10 @@ public:
};
private:
- CellTypeDialog(const Vector<Position>&, Sheet&, GUI::Window* parent = nullptr);
- void setup_tabs(GUI::TabWidget&, const Vector<Position>&, Sheet&);
+ CellTypeDialog(Vector<Position> const&, Sheet&, GUI::Window* parent = nullptr);
+ void setup_tabs(GUI::TabWidget&, Vector<Position> const&, Sheet&);
- const CellType* m_type { nullptr };
+ CellType const* m_type { nullptr };
int m_length { -1 };
String m_format;
diff --git a/Userland/Applications/Spreadsheet/ExportDialog.cpp b/Userland/Applications/Spreadsheet/ExportDialog.cpp
index d16c1b55dc..31dc703b98 100644
--- a/Userland/Applications/Spreadsheet/ExportDialog.cpp
+++ b/Userland/Applications/Spreadsheet/ExportDialog.cpp
@@ -26,11 +26,11 @@
#include <unistd.h>
// This is defined in ImportDialog.cpp, we can't include it twice, since the generated symbol is exported.
-extern const char select_format_page_gml[];
+extern char const select_format_page_gml[];
namespace Spreadsheet {
-CSVExportDialogPage::CSVExportDialogPage(const Sheet& sheet)
+CSVExportDialogPage::CSVExportDialogPage(Sheet const& sheet)
: m_data(sheet.to_xsv())
{
m_headers.extend(m_data.take_first());
@@ -213,7 +213,7 @@ void CSVExportDialogPage::update_preview()
m_data_preview_text_editor->update();
}
-Result<void, String> CSVExportDialogPage::move_into(const String& target)
+Result<void, String> CSVExportDialogPage::move_into(String const& target)
{
auto& source = m_temp_output_file_path;
diff --git a/Userland/Applications/Spreadsheet/ExportDialog.h b/Userland/Applications/Spreadsheet/ExportDialog.h
index 59439a29a1..3618ac0793 100644
--- a/Userland/Applications/Spreadsheet/ExportDialog.h
+++ b/Userland/Applications/Spreadsheet/ExportDialog.h
@@ -20,11 +20,11 @@ class Workbook;
struct CSVExportDialogPage {
using XSV = Writer::XSV<Vector<Vector<String>>, Vector<String>>;
- explicit CSVExportDialogPage(const Sheet&);
+ explicit CSVExportDialogPage(Sheet const&);
NonnullRefPtr<GUI::WizardPage> page() { return *m_page; }
Optional<XSV>& writer() { return m_previously_made_writer; }
- Result<void, String> move_into(const String& target);
+ Result<void, String> move_into(String const& target);
protected:
void update_preview();
diff --git a/Userland/Applications/Spreadsheet/HelpWindow.cpp b/Userland/Applications/Spreadsheet/HelpWindow.cpp
index 1b24930cc4..f498527712 100644
--- a/Userland/Applications/Spreadsheet/HelpWindow.cpp
+++ b/Userland/Applications/Spreadsheet/HelpWindow.cpp
@@ -39,7 +39,7 @@ public:
String key(const GUI::ModelIndex& index) const { return m_keys[index.row()]; }
- void set_from(const JsonObject& object)
+ void set_from(JsonObject const& object)
{
m_keys.clear();
object.for_each_member([this](auto& name, auto&) {
diff --git a/Userland/Applications/Spreadsheet/JSIntegration.cpp b/Userland/Applications/Spreadsheet/JSIntegration.cpp
index 18314b36a2..a3a047bf27 100644
--- a/Userland/Applications/Spreadsheet/JSIntegration.cpp
+++ b/Userland/Applications/Spreadsheet/JSIntegration.cpp
@@ -186,7 +186,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::get_real_cell_contents)
if (!position.has_value())
return vm.throw_completion<JS::TypeError>(global_object, "Invalid cell name");
- const auto* cell = sheet_object->m_sheet.at(position.value());
+ auto const* cell = sheet_object->m_sheet.at(position.value());
if (!cell)
return JS::js_undefined();
diff --git a/Userland/Applications/Spreadsheet/Position.h b/Userland/Applications/Spreadsheet/Position.h
index 301add499e..a1f43ccd1c 100644
--- a/Userland/Applications/Spreadsheet/Position.h
+++ b/Userland/Applications/Spreadsheet/Position.h
@@ -32,18 +32,18 @@ struct Position {
return m_hash;
}
- bool operator==(const Position& other) const
+ bool operator==(Position const& other) const
{
return row == other.row && column == other.column;
}
- bool operator!=(const Position& other) const
+ bool operator!=(Position const& other) const
{
return !(other == *this);
}
- String to_cell_identifier(const Sheet& sheet) const;
- URL to_url(const Sheet& sheet) const;
+ String to_cell_identifier(Sheet const& sheet) const;
+ URL to_url(Sheet const& sheet) const;
size_t column { 0 };
size_t row { 0 };
diff --git a/Userland/Applications/Spreadsheet/Readers/XSV.cpp b/Userland/Applications/Spreadsheet/Readers/XSV.cpp
index 9039ee0f99..4170743195 100644
--- a/Userland/Applications/Spreadsheet/Readers/XSV.cpp
+++ b/Userland/Applications/Spreadsheet/Readers/XSV.cpp
@@ -274,7 +274,7 @@ XSV::Field XSV::read_one_unquoted_field()
StringView XSV::Row::operator[](StringView name) const
{
VERIFY(!m_xsv.m_names.is_empty());
- auto it = m_xsv.m_names.find_if([&](const auto& entry) { return name == entry; });
+ auto it = m_xsv.m_names.find_if([&](auto const& entry) { return name == entry; });
VERIFY(!it.is_end());
return (*this)[it.index()];
diff --git a/Userland/Applications/Spreadsheet/Readers/XSV.h b/Userland/Applications/Spreadsheet/Readers/XSV.h
index 63e7e3d9ef..9962dedf60 100644
--- a/Userland/Applications/Spreadsheet/Readers/XSV.h
+++ b/Userland/Applications/Spreadsheet/Readers/XSV.h
@@ -146,11 +146,11 @@ public:
}
bool is_end() const { return m_index == m_xsv.m_rows.size(); }
- bool operator==(const RowIterator& other) const
+ bool operator==(RowIterator const& other) const
{
return m_index == other.m_index && &m_xsv == &other.m_xsv;
}
- bool operator==(const RowIterator<!const_>& other) const
+ bool operator==(RowIterator<!const_> const& other) const
{
return m_index == other.m_index && &m_xsv == &other.m_xsv;
}
diff --git a/Userland/Applications/Spreadsheet/Spreadsheet.cpp b/Userland/Applications/Spreadsheet/Spreadsheet.cpp
index 14efb02f59..c8cee6ef0e 100644
--- a/Userland/Applications/Spreadsheet/Spreadsheet.cpp
+++ b/Userland/Applications/Spreadsheet/Spreadsheet.cpp
@@ -182,7 +182,7 @@ Cell* Sheet::at(StringView name)
return nullptr;
}
-Cell* Sheet::at(const Position& position)
+Cell* Sheet::at(Position const& position)
{
auto it = m_cells.find(position);
@@ -271,7 +271,7 @@ Optional<Position> Sheet::position_from_url(const URL& url) const
return parse_cell_name(url.fragment());
}
-Position Sheet::offset_relative_to(const Position& base, const Position& offset, const Position& offset_base) const
+Position Sheet::offset_relative_to(Position const& base, Position const& offset, Position const& offset_base) const
{
if (offset.column >= m_columns.size()) {
dbgln("Column '{}' does not exist!", offset.column);
@@ -361,7 +361,7 @@ void Sheet::copy_cells(Vector<Position> from, Vector<Position> to, Optional<Posi
}
}
-RefPtr<Sheet> Sheet::from_json(const JsonObject& object, Workbook& workbook)
+RefPtr<Sheet> Sheet::from_json(JsonObject const& object, Workbook& workbook)
{
auto sheet = adopt_ref(*new Sheet(workbook));
auto rows = object.get("rows").to_u32(default_row_count);
@@ -391,7 +391,7 @@ RefPtr<Sheet> Sheet::from_json(const JsonObject& object, Workbook& workbook)
auto json = sheet->interpreter().global_object().get_without_side_effects("JSON");
auto& parse_function = json.as_object().get_without_side_effects("parse").as_function();
- auto read_format = [](auto& format, const auto& obj) {
+ auto read_format = [](auto& format, auto const& obj) {
if (auto value = obj.get("foreground_color"); value.is_string())
format.foreground_color = Color::from_string(value.as_string());
if (auto value = obj.get("background_color"); value.is_string())
@@ -519,7 +519,7 @@ JsonObject Sheet::to_json() const
JsonObject object;
object.set("name", m_name);
- auto save_format = [](const auto& format, auto& obj) {
+ auto save_format = [](auto const& format, auto& obj) {
if (format.foreground_color.has_value())
obj.set("foreground_color", format.foreground_color.value().to_string());
if (format.background_color.has_value())
@@ -629,7 +629,7 @@ Vector<Vector<String>> Sheet::to_xsv() const
return data;
}
-RefPtr<Sheet> Sheet::from_xsv(const Reader::XSV& xsv, Workbook& workbook)
+RefPtr<Sheet> Sheet::from_xsv(Reader::XSV const& xsv, Workbook& workbook)
{
auto cols = xsv.headers();
auto rows = xsv.size();
@@ -736,12 +736,12 @@ String Sheet::generate_inline_documentation_for(StringView function, size_t argu
return builder.build();
}
-String Position::to_cell_identifier(const Sheet& sheet) const
+String Position::to_cell_identifier(Sheet const& sheet) const
{
return String::formatted("{}{}", sheet.column(column), row);
}
-URL Position::to_url(const Sheet& sheet) const
+URL Position::to_url(Sheet const& sheet) const
{
URL url;
url.set_protocol("spreadsheet");
diff --git a/Userland/Applications/Spreadsheet/Spreadsheet.h b/Userland/Applications/Spreadsheet/Spreadsheet.h
index a3bf270df2..6aa5b0e3db 100644
--- a/Userland/Applications/Spreadsheet/Spreadsheet.h
+++ b/Userland/Applications/Spreadsheet/Spreadsheet.h
@@ -36,37 +36,37 @@ public:
Optional<String> column_arithmetic(StringView column_name, int offset);
Cell* from_url(const URL&);
- const Cell* from_url(const URL& url) const { return const_cast<Sheet*>(this)->from_url(url); }
+ Cell const* from_url(const URL& url) const { return const_cast<Sheet*>(this)->from_url(url); }
Optional<Position> position_from_url(const URL& url) const;
/// Resolve 'offset' to an absolute position assuming 'base' is at 'offset_base'.
/// Effectively, "Walk the distance between 'offset' and 'offset_base' away from 'base'".
- Position offset_relative_to(const Position& base, const Position& offset, const Position& offset_base) const;
+ Position offset_relative_to(Position const& base, Position const& offset, Position const& offset_base) const;
JsonObject to_json() const;
- static RefPtr<Sheet> from_json(const JsonObject&, Workbook&);
+ static RefPtr<Sheet> from_json(JsonObject const&, Workbook&);
Vector<Vector<String>> to_xsv() const;
- static RefPtr<Sheet> from_xsv(const Reader::XSV&, Workbook&);
+ static RefPtr<Sheet> from_xsv(Reader::XSV const&, Workbook&);
- const String& name() const { return m_name; }
+ String const& name() const { return m_name; }
void set_name(StringView name) { m_name = name; }
JsonObject gather_documentation() const;
- const HashTable<Position>& selected_cells() const { return m_selected_cells; }
+ HashTable<Position> const& selected_cells() const { return m_selected_cells; }
HashTable<Position>& selected_cells() { return m_selected_cells; }
- const HashMap<Position, NonnullOwnPtr<Cell>>& cells() const { return m_cells; }
+ HashMap<Position, NonnullOwnPtr<Cell>> const& cells() const { return m_cells; }
HashMap<Position, NonnullOwnPtr<Cell>>& cells() { return m_cells; }
- Cell* at(const Position& position);
- const Cell* at(const Position& position) const { return const_cast<Sheet*>(this)->at(position); }
+ Cell* at(Position const& position);
+ Cell const* at(Position const& position) const { return const_cast<Sheet*>(this)->at(position); }
- const Cell* at(StringView name) const { return const_cast<Sheet*>(this)->at(name); }
+ Cell const* at(StringView name) const { return const_cast<Sheet*>(this)->at(name); }
Cell* at(StringView);
- const Cell& ensure(const Position& position) const { return const_cast<Sheet*>(this)->ensure(position); }
- Cell& ensure(const Position& position)
+ Cell const& ensure(Position const& position) const { return const_cast<Sheet*>(this)->ensure(position); }
+ Cell& ensure(Position const& position)
{
if (auto cell = at(position))
return *cell;
@@ -80,8 +80,8 @@ public:
size_t row_count() const { return m_rows; }
size_t column_count() const { return m_columns.size(); }
- const Vector<String>& columns() const { return m_columns; }
- const String& column(size_t index)
+ Vector<String> const& columns() const { return m_columns; }
+ String const& column(size_t index)
{
for (size_t i = column_count(); i < index; ++i)
add_column();
@@ -89,7 +89,7 @@ public:
VERIFY(column_count() > index);
return m_columns[index];
}
- const String& column(size_t index) const
+ String const& column(size_t index) const
{
VERIFY(column_count() > index);
return m_columns[index];
@@ -114,7 +114,7 @@ public:
Cell*& current_evaluated_cell() { return m_current_cell_being_evaluated; }
bool has_been_visited(Cell* cell) const { return m_visited_cells_in_update.contains(cell); }
- const Workbook& workbook() const { return m_workbook; }
+ Workbook const& workbook() const { return m_workbook; }
enum class CopyOperation {
Copy,
@@ -160,7 +160,7 @@ namespace AK {
template<>
struct Traits<Spreadsheet::Position> : public GenericTraits<Spreadsheet::Position> {
static constexpr bool is_trivial() { return false; }
- static unsigned hash(const Spreadsheet::Position& p)
+ static unsigned hash(Spreadsheet::Position const& p)
{
return p.hash();
}
diff --git a/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp b/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp
index e7980430f0..b190788b7a 100644
--- a/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp
+++ b/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp
@@ -19,7 +19,7 @@ GUI::Variant SheetModel::data(const GUI::ModelIndex& index, GUI::ModelRole role)
return {};
if (role == GUI::ModelRole::Display) {
- const auto* cell = m_sheet->at({ (size_t)index.column(), (size_t)index.row() });
+ auto const* cell = m_sheet->at({ (size_t)index.column(), (size_t)index.row() });
if (!cell)
return String::empty();
@@ -63,7 +63,7 @@ GUI::Variant SheetModel::data(const GUI::ModelIndex& index, GUI::ModelRole role)
return Position { (size_t)index.column(), (size_t)index.row() }.to_url(m_sheet).to_string();
if (role == GUI::ModelRole::TextAlignment) {
- const auto* cell = m_sheet->at({ (size_t)index.column(), (size_t)index.row() });
+ auto const* cell = m_sheet->at({ (size_t)index.column(), (size_t)index.row() });
if (!cell)
return {};
@@ -71,7 +71,7 @@ GUI::Variant SheetModel::data(const GUI::ModelIndex& index, GUI::ModelRole role)
}
if (role == GUI::ModelRole::ForegroundColor) {
- const auto* cell = m_sheet->at({ (size_t)index.column(), (size_t)index.row() });
+ auto const* cell = m_sheet->at({ (size_t)index.column(), (size_t)index.row() });
if (!cell)
return {};
@@ -90,7 +90,7 @@ GUI::Variant SheetModel::data(const GUI::ModelIndex& index, GUI::ModelRole role)
}
if (role == GUI::ModelRole::BackgroundColor) {
- const auto* cell = m_sheet->at({ (size_t)index.column(), (size_t)index.row() });
+ auto const* cell = m_sheet->at({ (size_t)index.column(), (size_t)index.row() });
if (!cell)
return {};
diff --git a/Userland/Applications/Spreadsheet/SpreadsheetView.cpp b/Userland/Applications/Spreadsheet/SpreadsheetView.cpp
index ce8b46665f..0f2ce5765e 100644
--- a/Userland/Applications/Spreadsheet/SpreadsheetView.cpp
+++ b/Userland/Applications/Spreadsheet/SpreadsheetView.cpp
@@ -32,7 +32,7 @@ void SpreadsheetView::EditingDelegate::set_value(GUI::Variant const& value, GUI:
return StringModelEditingDelegate::set_value(value, selection_behavior);
m_has_set_initial_value = true;
- const auto option = m_sheet.at({ (size_t)index().column(), (size_t)index().row() });
+ auto const option = m_sheet.at({ (size_t)index().column(), (size_t)index().row() });
if (option)
return StringModelEditingDelegate::set_value(option->source(), selection_behavior);
@@ -461,7 +461,7 @@ void SpreadsheetView::move_cursor(GUI::AbstractView::CursorMovement direction)
m_table_view->move_cursor(direction, GUI::AbstractView::SelectionUpdate::Set);
}
-void SpreadsheetView::TableCellPainter::paint(GUI::Painter& painter, const Gfx::IntRect& rect, const Gfx::Palette& palette, const GUI::ModelIndex& index)
+void SpreadsheetView::TableCellPainter::paint(GUI::Painter& painter, Gfx::IntRect const& rect, Gfx::Palette const& palette, const GUI::ModelIndex& index)
{
// Draw a border.
// Undo the horizontal padding done by the table view...
diff --git a/Userland/Applications/Spreadsheet/SpreadsheetView.h b/Userland/Applications/Spreadsheet/SpreadsheetView.h
index aacc0c84cb..2723ed32a7 100644
--- a/Userland/Applications/Spreadsheet/SpreadsheetView.h
+++ b/Userland/Applications/Spreadsheet/SpreadsheetView.h
@@ -121,7 +121,7 @@ private:
class EditingDelegate final : public GUI::StringModelEditingDelegate {
public:
- EditingDelegate(const Sheet& sheet)
+ EditingDelegate(Sheet const& sheet)
: m_sheet(sheet)
{
}
@@ -148,7 +148,7 @@ private:
private:
bool m_has_set_initial_value { false };
- const Sheet& m_sheet;
+ Sheet const& m_sheet;
};
class TableCellPainter final : public GUI::TableCellPaintingDelegate {
@@ -157,7 +157,7 @@ private:
: m_table_view(view)
{
}
- void paint(GUI::Painter&, const Gfx::IntRect&, const Gfx::Palette&, const GUI::ModelIndex&) override;
+ void paint(GUI::Painter&, Gfx::IntRect const&, Gfx::Palette const&, const GUI::ModelIndex&) override;
private:
const GUI::TableView& m_table_view;
diff --git a/Userland/Applications/Spreadsheet/SpreadsheetWidget.h b/Userland/Applications/Spreadsheet/SpreadsheetWidget.h
index b21b103178..ef1c5dcfa0 100644
--- a/Userland/Applications/Spreadsheet/SpreadsheetWidget.h
+++ b/Userland/Applications/Spreadsheet/SpreadsheetWidget.h
@@ -26,13 +26,13 @@ public:
void add_sheet();
void add_sheet(NonnullRefPtr<Sheet>&&);
- const String& current_filename() const { return m_workbook->current_filename(); }
+ String const& current_filename() const { return m_workbook->current_filename(); }
SpreadsheetView* current_view() { return static_cast<SpreadsheetView*>(m_tab_widget->active_widget()); }
Sheet* current_worksheet_if_available() { return current_view() ? current_view()->sheet_if_available() : nullptr; }
void update_window_title();
Workbook& workbook() { return *m_workbook; }
- const Workbook& workbook() const { return *m_workbook; }
+ Workbook const& workbook() const { return *m_workbook; }
const GUI::ModelIndex* current_selection_cursor()
{
diff --git a/Userland/Applications/Spreadsheet/Workbook.cpp b/Userland/Applications/Spreadsheet/Workbook.cpp
index 6756b9eafb..73d4e0fe87 100644
--- a/Userland/Applications/Spreadsheet/Workbook.cpp
+++ b/Userland/Applications/Spreadsheet/Workbook.cpp
@@ -43,7 +43,7 @@ Workbook::Workbook(NonnullRefPtrVector<Sheet>&& sheets, GUI::Window& parent_wind
m_vm->enable_default_host_import_module_dynamically_hook();
}
-bool Workbook::set_filename(const String& filename)
+bool Workbook::set_filename(String const& filename)
{
if (m_current_filename == filename)
return false;
diff --git a/Userland/Applications/Spreadsheet/Workbook.h b/Userland/Applications/Spreadsheet/Workbook.h
index 5c570b21e0..5a035e11ec 100644
--- a/Userland/Applications/Spreadsheet/Workbook.h
+++ b/Userland/Applications/Spreadsheet/Workbook.h
@@ -21,14 +21,14 @@ public:
Result<bool, String> load(StringView filename);
Result<bool, String> open_file(Core::File&);
- const String& current_filename() const { return m_current_filename; }
- bool set_filename(const String& filename);
+ String const& current_filename() const { return m_current_filename; }
+ bool set_filename(String const& filename);
bool dirty() { return m_dirty; }
void set_dirty(bool dirty) { m_dirty = dirty; }
bool has_sheets() const { return !m_sheets.is_empty(); }
- const NonnullRefPtrVector<Sheet>& sheets() const { return m_sheets; }
+ NonnullRefPtrVector<Sheet> const& sheets() const { return m_sheets; }
NonnullRefPtrVector<Sheet> sheets() { return m_sheets; }
Sheet& add_sheet(StringView name)
diff --git a/Userland/Applications/Spreadsheet/Writers/CSV.h b/Userland/Applications/Spreadsheet/Writers/CSV.h
index d7650e760a..92c3adfe06 100644
--- a/Userland/Applications/Spreadsheet/Writers/CSV.h
+++ b/Userland/Applications/Spreadsheet/Writers/CSV.h
@@ -15,7 +15,7 @@ namespace Writer {
template<typename ContainerType>
class CSV : public XSV<ContainerType> {
public:
- CSV(OutputStream& output, const ContainerType& data, const Vector<StringView>& headers = {}, WriterBehavior behaviors = default_behaviors())
+ CSV(OutputStream& output, ContainerType const& data, Vector<StringView> const& headers = {}, WriterBehavior behaviors = default_behaviors())
: XSV<ContainerType>(output, data, { ",", "\"", WriterTraits::Repeat }, headers, behaviors)
{
}
diff --git a/Userland/Applications/Spreadsheet/Writers/XSV.h b/Userland/Applications/Spreadsheet/Writers/XSV.h
index 6e1bd8548f..006bc53ce3 100644
--- a/Userland/Applications/Spreadsheet/Writers/XSV.h
+++ b/Userland/Applications/Spreadsheet/Writers/XSV.h
@@ -62,7 +62,7 @@ constexpr WriterBehavior default_behaviors()
template<typename ContainerType, typename HeaderType = Vector<StringView>>
class XSV {
public:
- XSV(OutputStream& output, const ContainerType& data, const WriterTraits& traits, const HeaderType& headers = {}, WriterBehavior behaviors = default_behaviors())
+ XSV(OutputStream& output, ContainerType const& data, WriterTraits const& traits, HeaderType const& headers = {}, WriterBehavior behaviors = default_behaviors())
: m_data(data)
, m_traits(traits)
, m_behaviors(behaviors)
@@ -188,10 +188,10 @@ private:
set_error(WriteError::InternalError);
}
- const ContainerType& m_data;
- const WriterTraits& m_traits;
+ ContainerType const& m_data;
+ WriterTraits const& m_traits;
WriterBehavior m_behaviors;
- const HeaderType& m_names;
+ HeaderType const& m_names;
WriteError m_error { WriteError::None };
OutputStream& m_output;
};
diff --git a/Userland/Applications/Spreadsheet/main.cpp b/Userland/Applications/Spreadsheet/main.cpp
index 088bdbfba8..210c7da977 100644
--- a/Userland/Applications/Spreadsheet/main.cpp
+++ b/Userland/Applications/Spreadsheet/main.cpp
@@ -30,7 +30,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto app = GUI::Application::construct(arguments);
- const char* filename = nullptr;
+ char const* filename = nullptr;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(filename, "File to read from", "file", Core::ArgsParser::Required::No);
diff --git a/Userland/Applications/SystemMonitor/GraphWidget.cpp b/Userland/Applications/SystemMonitor/GraphWidget.cpp
index 238fbb3372..d32c21a83d 100644
--- a/Userland/Applications/SystemMonitor/GraphWidget.cpp
+++ b/Userland/Applications/SystemMonitor/GraphWidget.cpp
@@ -21,7 +21,7 @@ void GraphWidget::add_value(Vector<u64, 1>&& value)
void GraphWidget::paint_event(GUI::PaintEvent& event)
{
- const auto& system_palette = GUI::Application::the()->palette();
+ auto const& system_palette = GUI::Application::the()->palette();
GUI::Frame::paint_event(event);
GUI::Painter painter(*this);
@@ -35,18 +35,18 @@ void GraphWidget::paint_event(GUI::PaintEvent& event)
if (!m_values.is_empty()) {
// Draw one set of values at a time
for (size_t k = 0; k < m_value_format.size(); k++) {
- const auto& format = m_value_format[k];
+ auto const& format = m_value_format[k];
if (format.graph_color_role == ColorRole::Base) {
continue;
}
- const auto& line_color = system_palette.color(format.graph_color_role);
- const auto& background_color = line_color.with_alpha(0x7f);
+ auto const& line_color = system_palette.color(format.graph_color_role);
+ auto const& background_color = line_color.with_alpha(0x7f);
m_calculated_points.clear_with_capacity();
for (size_t i = 0; i < m_values.size(); i++) {
int x = inner_rect.right() - (i * 2) + 1;
if (x < 0)
break;
- const auto& current_values = m_values.at(m_values.size() - i - 1);
+ auto const& current_values = m_values.at(m_values.size() - i - 1);
if (current_values.size() <= k) {
// Don't have a data point
m_calculated_points.append({ -1, -1 });
@@ -67,8 +67,8 @@ void GraphWidget::paint_event(GUI::PaintEvent& event)
Gfx::Path path;
size_t points_in_path = 0;
bool started_path = false;
- const Gfx::IntPoint* current_point = nullptr;
- const Gfx::IntPoint* first_point = nullptr;
+ Gfx::IntPoint const* current_point = nullptr;
+ Gfx::IntPoint const* first_point = nullptr;
auto check_fill_area = [&]() {
if (!started_path)
return;
@@ -109,9 +109,9 @@ void GraphWidget::paint_event(GUI::PaintEvent& event)
}
if (format.graph_color_role != ColorRole::Base) {
// Draw the line for the data points we have
- const Gfx::IntPoint* previous_point = nullptr;
+ Gfx::IntPoint const* previous_point = nullptr;
for (size_t i = 0; i < m_calculated_points.size(); i++) {
- const auto& current_point = m_calculated_points[i];
+ auto const& current_point = m_calculated_points[i];
if (current_point.x() < 0) {
previous_point = nullptr;
continue;
@@ -125,11 +125,11 @@ void GraphWidget::paint_event(GUI::PaintEvent& event)
}
if (!m_values.is_empty() && !m_value_format.is_empty()) {
- const auto& current_values = m_values.last();
+ auto const& current_values = m_values.last();
int y = 0;
for (size_t i = 0; i < min(m_value_format.size(), current_values.size()); i++) {
- const auto& format = m_value_format[i];
- const auto& graph_color = system_palette.color(format.graph_color_role);
+ auto const& format = m_value_format[i];
+ auto const& graph_color = system_palette.color(format.graph_color_role);
if (!format.text_formatter)
continue;
auto constrain_rect = inner_rect.shrunken(8, 8);
diff --git a/Userland/Applications/SystemMonitor/MemoryStatsWidget.cpp b/Userland/Applications/SystemMonitor/MemoryStatsWidget.cpp
index 398eead9a2..80df7ac14a 100644
--- a/Userland/Applications/SystemMonitor/MemoryStatsWidget.cpp
+++ b/Userland/Applications/SystemMonitor/MemoryStatsWidget.cpp
@@ -36,7 +36,7 @@ MemoryStatsWidget::MemoryStatsWidget(GraphWidget& graph)
layout()->set_margins({ 8, 0, 0 });
layout()->set_spacing(3);
- auto build_widgets_for_label = [this](const String& description) -> RefPtr<GUI::Label> {
+ auto build_widgets_for_label = [this](String const& description) -> RefPtr<GUI::Label> {
auto& container = add<GUI::Widget>();
container.set_layout<GUI::HorizontalBoxLayout>();
container.set_fixed_size(275, 12);
diff --git a/Userland/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp b/Userland/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp
index 3295892092..5216c90a4a 100644
--- a/Userland/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp
+++ b/Userland/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp
@@ -18,7 +18,7 @@ class PagemapPaintingDelegate final : public GUI::TableCellPaintingDelegate {
public:
virtual ~PagemapPaintingDelegate() override = default;
- virtual void paint(GUI::Painter& painter, const Gfx::IntRect& a_rect, const Gfx::Palette&, const GUI::ModelIndex& index) override
+ virtual void paint(GUI::Painter& painter, Gfx::IntRect const& a_rect, Gfx::Palette const&, const GUI::ModelIndex& index) override
{
auto rect = a_rect.shrunken(2, 2);
auto pagemap = index.data(GUI::ModelRole::Custom).to_string();
@@ -93,7 +93,7 @@ ProcessMemoryMapWidget::ProcessMemoryMapWidget()
[](auto&) {
return GUI::Variant(0);
},
- [](const JsonObject& object) {
+ [](JsonObject const& object) {
auto pagemap = object.get("pagemap").as_string_or({});
return pagemap;
});
diff --git a/Userland/Applications/SystemMonitor/main.cpp b/Userland/Applications/SystemMonitor/main.cpp
index e9f8c90a54..e3f96643b1 100644
--- a/Userland/Applications/SystemMonitor/main.cpp
+++ b/Userland/Applications/SystemMonitor/main.cpp
@@ -64,7 +64,7 @@ class UnavailableProcessWidget final : public GUI::Frame {
public:
virtual ~UnavailableProcessWidget() override = default;
- const String& text() const { return m_text; }
+ String const& text() const { return m_text; }
void set_text(String text) { m_text = move(text); }
private:
@@ -390,7 +390,7 @@ class ProgressbarPaintingDelegate final : public GUI::TableCellPaintingDelegate
public:
virtual ~ProgressbarPaintingDelegate() override = default;
- virtual void paint(GUI::Painter& painter, const Gfx::IntRect& a_rect, const Palette& palette, const GUI::ModelIndex& index) override
+ virtual void paint(GUI::Painter& painter, Gfx::IntRect const& a_rect, Palette const& palette, const GUI::ModelIndex& index) override
{
auto rect = a_rect.shrunken(2, 2);
auto percentage = index.data(GUI::ModelRole::Custom).to_i32();
@@ -707,7 +707,7 @@ NonnullRefPtr<GUI::Widget> build_performance_tab()
cpu_graphs.append(cpu_graph);
}
}
- ProcessModel::the().on_cpu_info_change = [cpu_graphs](const NonnullOwnPtrVector<ProcessModel::CpuInfo>& cpus) mutable {
+ ProcessModel::the().on_cpu_info_change = [cpu_graphs](NonnullOwnPtrVector<ProcessModel::CpuInfo> const& cpus) mutable {
float sum_cpu = 0;
for (size_t i = 0; i < cpus.size(); ++i) {
cpu_graphs[i].add_value({ static_cast<size_t>(cpus[i].total_cpu_percent), static_cast<size_t>(cpus[i].total_cpu_percent_kernel) });
diff --git a/Userland/Applications/Terminal/main.cpp b/Userland/Applications/Terminal/main.cpp
index 0d206343e3..75993d391f 100644
--- a/Userland/Applications/Terminal/main.cpp
+++ b/Userland/Applications/Terminal/main.cpp
@@ -141,7 +141,7 @@ static void run_command(String command, bool keep_open)
}
endpwent();
- const char* args[5] = { shell.characters(), nullptr, nullptr, nullptr, nullptr };
+ char const* args[5] = { shell.characters(), nullptr, nullptr, nullptr, nullptr };
if (!command.is_empty()) {
int arg_index = 1;
if (keep_open)
@@ -149,7 +149,7 @@ static void run_command(String command, bool keep_open)
args[arg_index++] = "-c";
args[arg_index++] = command.characters();
}
- const char* envs[] = { "TERM=xterm", "PAGER=more", "PATH=/usr/local/bin:/usr/bin:/bin", nullptr };
+ char const* envs[] = { "TERM=xterm", "PAGER=more", "PATH=/usr/local/bin:/usr/bin:/bin", nullptr };
int rc = execve(shell.characters(), const_cast<char**>(args), const_cast<char**>(envs));
if (rc < 0) {
perror("execve");
@@ -247,7 +247,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
Config::pledge_domain("Terminal");
- const char* command_to_execute = nullptr;
+ char const* command_to_execute = nullptr;
bool keep_open = false;
Core::ArgsParser args_parser;
diff --git a/Userland/Applications/ThemeEditor/PreviewWidget.cpp b/Userland/Applications/ThemeEditor/PreviewWidget.cpp
index 0c23c73ae1..a25cb4add0 100644
--- a/Userland/Applications/ThemeEditor/PreviewWidget.cpp
+++ b/Userland/Applications/ThemeEditor/PreviewWidget.cpp
@@ -30,7 +30,7 @@ class MiniWidgetGallery final : public GUI::Widget {
C_OBJECT(MiniWidgetGallery);
public:
- void set_preview_palette(const Gfx::Palette& palette)
+ void set_preview_palette(Gfx::Palette const& palette)
{
set_palette(palette);
Function<void(GUI::Widget&)> recurse = [&](GUI::Widget& parent_widget) {
@@ -79,7 +79,7 @@ private:
RefPtr<GUI::Statusbar> m_statusbar;
};
-PreviewWidget::PreviewWidget(const Gfx::Palette& preview_palette)
+PreviewWidget::PreviewWidget(Gfx::Palette const& preview_palette)
: m_preview_palette(preview_palette)
{
m_active_window_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/window.png").release_value_but_fixme_should_propagate_errors();
@@ -131,7 +131,7 @@ void PreviewWidget::load_theme_bitmaps()
load_bitmap(m_preview_palette.tooltip_shadow_path(), m_last_tooltip_shadow_path, m_tooltip_shadow);
}
-void PreviewWidget::set_preview_palette(const Gfx::Palette& palette)
+void PreviewWidget::set_preview_palette(Gfx::Palette const& palette)
{
m_preview_palette = palette;
m_gallery->set_preview_palette(palette);
@@ -172,7 +172,7 @@ void PreviewWidget::paint_event(GUI::PaintEvent& event)
RefPtr<Gfx::Bitmap> bitmap;
};
- auto paint_window = [&](auto& title, const Gfx::IntRect& rect, auto state, const Gfx::Bitmap& icon) {
+ auto paint_window = [&](auto& title, Gfx::IntRect const& rect, auto state, Gfx::Bitmap const& icon) {
int window_button_width = m_preview_palette.window_title_button_width();
int window_button_height = m_preview_palette.window_title_button_height();
auto titlebar_text_rect = Gfx::WindowTheme::current().titlebar_text_rect(Gfx::WindowTheme::WindowType::Normal, rect, m_preview_palette);
diff --git a/Userland/Applications/ThemeEditor/PreviewWidget.h b/Userland/Applications/ThemeEditor/PreviewWidget.h
index f096c8cd89..746c5a464a 100644
--- a/Userland/Applications/ThemeEditor/PreviewWidget.h
+++ b/Userland/Applications/ThemeEditor/PreviewWidget.h
@@ -24,8 +24,8 @@ class PreviewWidget final : public GUI::Frame {
public:
virtual ~PreviewWidget() override = default;
- const Gfx::Palette& preview_palette() const { return m_preview_palette; }
- void set_preview_palette(const Gfx::Palette&);
+ Gfx::Palette const& preview_palette() const { return m_preview_palette; }
+ void set_preview_palette(Gfx::Palette const&);
void set_theme_from_file(Core::File&);
void set_color_filter(OwnPtr<Gfx::ColorBlindnessFilter>);
@@ -33,7 +33,7 @@ public:
Function<void(String const&)> on_theme_load_from_file;
private:
- explicit PreviewWidget(const Gfx::Palette&);
+ explicit PreviewWidget(Gfx::Palette const&);
void load_theme_bitmaps();
diff --git a/Userland/Applications/ThemeEditor/main.cpp b/Userland/Applications/ThemeEditor/main.cpp
index fa58efbc2f..ba5006ccde 100644
--- a/Userland/Applications/ThemeEditor/main.cpp
+++ b/Userland/Applications/ThemeEditor/main.cpp
@@ -35,7 +35,7 @@
class ColorRoleModel final : public GUI::ItemListModel<Gfx::ColorRole> {
public:
- explicit ColorRoleModel(const Vector<Gfx::ColorRole>& data)
+ explicit ColorRoleModel(Vector<Gfx::ColorRole> const& data)
: ItemListModel<Gfx::ColorRole>(data)
{
}
diff --git a/Userland/Demos/Cube/Cube.cpp b/Userland/Demos/Cube/Cube.cpp
index 224958d7c4..5fc00d9812 100644
--- a/Userland/Demos/Cube/Cube.cpp
+++ b/Userland/Demos/Cube/Cube.cpp
@@ -24,8 +24,8 @@
#include <stdlib.h>
#include <unistd.h>
-const int WIDTH = 200;
-const int HEIGHT = 200;
+int const WIDTH = 200;
+int const HEIGHT = 200;
static bool flag_hide_window_frame = false;
@@ -97,7 +97,7 @@ void Cube::timer_event(Core::TimerEvent&)
#define QUAD(a, b, c, d) a, b, c, c, d, a
- const int indices[] {
+ int const indices[] {
QUAD(0, 1, 2, 3),
QUAD(7, 6, 5, 4),
QUAD(4, 5, 1, 0),
@@ -141,7 +141,7 @@ void Cube::timer_event(Core::TimerEvent&)
else
painter.clear_rect(m_bitmap->rect(), Gfx::Color::Transparent);
- auto to_point = [](const FloatVector3& v) {
+ auto to_point = [](FloatVector3 const& v) {
return Gfx::IntPoint(v.x(), v.y());
};
diff --git a/Userland/Demos/LibGfxDemo/main.cpp b/Userland/Demos/LibGfxDemo/main.cpp
index 81e23375fe..6baa3afeda 100644
--- a/Userland/Demos/LibGfxDemo/main.cpp
+++ b/Userland/Demos/LibGfxDemo/main.cpp
@@ -21,8 +21,8 @@
#include <LibMain/Main.h>
#include <unistd.h>
-const int WIDTH = 780;
-const int HEIGHT = 600;
+int const WIDTH = 780;
+int const HEIGHT = 600;
class Canvas final : public GUI::Widget {
C_OBJECT(Canvas)
diff --git a/Userland/Demos/LibGfxScaleDemo/main.cpp b/Userland/Demos/LibGfxScaleDemo/main.cpp
index 84a8ba3bf0..68295579df 100644
--- a/Userland/Demos/LibGfxScaleDemo/main.cpp
+++ b/Userland/Demos/LibGfxScaleDemo/main.cpp
@@ -24,8 +24,8 @@
#include <LibMain/Main.h>
#include <unistd.h>
-const int WIDTH = 300;
-const int HEIGHT = 200;
+int const WIDTH = 300;
+int const HEIGHT = 200;
class Canvas final : public GUI::Widget {
C_OBJECT(Canvas)
diff --git a/Userland/Demos/Mandelbrot/Mandelbrot.cpp b/Userland/Demos/Mandelbrot/Mandelbrot.cpp
index 4284a89467..7243314b47 100644
--- a/Userland/Demos/Mandelbrot/Mandelbrot.cpp
+++ b/Userland/Demos/Mandelbrot/Mandelbrot.cpp
@@ -85,8 +85,8 @@ public:
double mandelbrot(double px, double py, i32 max_iterations)
{
// Based on https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Mandelbrot_set
- const double x0 = px * (m_x_end - m_x_start) / m_bitmap->width() + m_x_start;
- const double y0 = py * (m_y_end - m_y_start) / m_bitmap->height() + m_y_start;
+ double const x0 = px * (m_x_end - m_x_start) / m_bitmap->width() + m_x_start;
+ double const y0 = py * (m_y_end - m_y_start) / m_bitmap->height() + m_y_start;
double x = 0;
double y = 0;
i32 iteration = 0;
@@ -215,7 +215,7 @@ class Mandelbrot : public GUI::Frame {
In,
Out,
};
- void zoom(Zoom in_out, const Gfx::IntPoint& center);
+ void zoom(Zoom in_out, Gfx::IntPoint const& center);
void reset();
@@ -239,7 +239,7 @@ private:
MandelbrotSet m_set;
};
-void Mandelbrot::zoom(Zoom in_out, const Gfx::IntPoint& center)
+void Mandelbrot::zoom(Zoom in_out, Gfx::IntPoint const& center)
{
static constexpr double zoom_in_multiplier = 0.8;
static constexpr double zoom_out_multiplier = 1.25;
diff --git a/Userland/Demos/WidgetGallery/GalleryWidget.cpp b/Userland/Demos/WidgetGallery/GalleryWidget.cpp
index 71e03944e6..0c37668bd3 100644
--- a/Userland/Demos/WidgetGallery/GalleryWidget.cpp
+++ b/Userland/Demos/WidgetGallery/GalleryWidget.cpp
@@ -56,7 +56,7 @@ GalleryWidget::GalleryWidget()
m_frame_shape_combobox = basics_tab->find_descendant_of_type_named<GUI::ComboBox>("frame_shape_combobox");
m_frame_shape_combobox->set_model(*GUI::ItemListModel<String>::create(m_frame_shapes));
- m_frame_shape_combobox->on_change = [&](auto&, const auto& index) {
+ m_frame_shape_combobox->on_change = [&](auto&, auto const& index) {
m_label_frame->set_frame_shape(static_cast<Gfx::FrameShape>((index.row() - 1) % 3 + 1));
m_label_frame->set_frame_shadow(static_cast<Gfx::FrameShadow>((index.row() - 1) / 3));
m_label_frame->update();
@@ -153,7 +153,7 @@ GalleryWidget::GalleryWidget()
m_msgbox_icon_combobox->set_model(*GUI::ItemListModel<String>::create(m_msgbox_icons));
m_msgbox_icon_combobox->set_selected_index(0);
- m_msgbox_icon_combobox->on_change = [&](auto&, const auto& index) {
+ m_msgbox_icon_combobox->on_change = [&](auto&, auto const& index) {
m_msgbox_type = static_cast<GUI::MessageBox::Type>(index.row());
};
@@ -161,7 +161,7 @@ GalleryWidget::GalleryWidget()
m_msgbox_buttons_combobox->set_model(*GUI::ItemListModel<String>::create(m_msgbox_buttons));
m_msgbox_buttons_combobox->set_selected_index(0);
- m_msgbox_buttons_combobox->on_change = [&](auto&, const auto& index) {
+ m_msgbox_buttons_combobox->on_change = [&](auto&, auto const& index) {
m_msgbox_input_type = static_cast<GUI::MessageBox::InputType>(index.row());
};
@@ -237,7 +237,7 @@ GalleryWidget::GalleryWidget()
m_wizard_output = wizards_tab->find_descendant_of_type_named<GUI::TextEditor>("wizard_output");
m_wizard_output->set_should_hide_unnecessary_scrollbars(true);
- const char* serenityos_ascii = {
+ char const* serenityos_ascii = {
" ____ _ __ ____ ____\n"
" / __/__ _______ ___ (_) /___ __/ __ \\/ __/\n"
" _\\ \\/ -_) __/ -_) _ \\/ / __/ // / /_/ /\\ \\\n"
@@ -245,7 +245,7 @@ GalleryWidget::GalleryWidget()
" /___/\n"
};
- const char* wizard_ascii = {
+ char const* wizard_ascii = {
" _,-'|\n"
" ,-'._ |\n"
" .||, |####\\ |\n"
diff --git a/Userland/DevTools/HackStudio/ClassViewWidget.cpp b/Userland/DevTools/HackStudio/ClassViewWidget.cpp
index d620897308..ac1d9c1a32 100644
--- a/Userland/DevTools/HackStudio/ClassViewWidget.cpp
+++ b/Userland/DevTools/HackStudio/ClassViewWidget.cpp
@@ -46,7 +46,7 @@ int ClassViewModel::row_count(const GUI::ModelIndex& index) const
GUI::Variant ClassViewModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const
{
- auto* node = static_cast<const ClassViewNode*>(index.internal_data());
+ auto* node = static_cast<ClassViewNode const*>(index.internal_data());
switch (role) {
case GUI::ModelRole::Display: {
return node->name;
@@ -68,7 +68,7 @@ GUI::ModelIndex ClassViewModel::parent_index(const GUI::ModelIndex& index) const
{
if (!index.is_valid())
return {};
- auto* child = static_cast<const ClassViewNode*>(index.internal_data());
+ auto* child = static_cast<ClassViewNode const*>(index.internal_data());
auto* parent = child->parent;
if (parent == nullptr)
return {};
@@ -92,7 +92,7 @@ GUI::ModelIndex ClassViewModel::index(int row, int column, const GUI::ModelIndex
{
if (!parent_index.is_valid())
return create_index(row, column, &m_root_scope[row]);
- auto* parent = static_cast<const ClassViewNode*>(parent_index.internal_data());
+ auto* parent = static_cast<ClassViewNode const*>(parent_index.internal_data());
auto* child = &parent->children[row];
return create_index(row, column, child);
}
diff --git a/Userland/DevTools/HackStudio/CodeDocument.cpp b/Userland/DevTools/HackStudio/CodeDocument.cpp
index a8605c24a0..0ba3f46fd6 100644
--- a/Userland/DevTools/HackStudio/CodeDocument.cpp
+++ b/Userland/DevTools/HackStudio/CodeDocument.cpp
@@ -9,7 +9,7 @@
namespace HackStudio {
-NonnullRefPtr<CodeDocument> CodeDocument::create(const String& file_path, Client* client)
+NonnullRefPtr<CodeDocument> CodeDocument::create(String const& file_path, Client* client)
{
return adopt_ref(*new CodeDocument(file_path, client));
}
@@ -19,7 +19,7 @@ NonnullRefPtr<CodeDocument> CodeDocument::create(Client* client)
return adopt_ref(*new CodeDocument(client));
}
-CodeDocument::CodeDocument(const String& file_path, Client* client)
+CodeDocument::CodeDocument(String const& file_path, Client* client)
: TextDocument(client)
, m_file_path(file_path)
{
diff --git a/Userland/DevTools/HackStudio/CodeDocument.h b/Userland/DevTools/HackStudio/CodeDocument.h
index 70a066f4b4..e496a9fa61 100644
--- a/Userland/DevTools/HackStudio/CodeDocument.h
+++ b/Userland/DevTools/HackStudio/CodeDocument.h
@@ -16,22 +16,22 @@ namespace HackStudio {
class CodeDocument final : public GUI::TextDocument {
public:
virtual ~CodeDocument() override = default;
- static NonnullRefPtr<CodeDocument> create(const String& file_path, Client* client = nullptr);
+ static NonnullRefPtr<CodeDocument> create(String const& file_path, Client* client = nullptr);
static NonnullRefPtr<CodeDocument> create(Client* client = nullptr);
- const Vector<size_t>& breakpoint_lines() const { return m_breakpoint_lines; }
+ Vector<size_t> const& breakpoint_lines() const { return m_breakpoint_lines; }
Vector<size_t>& breakpoint_lines() { return m_breakpoint_lines; }
Optional<size_t> execution_position() const { return m_execution_position; }
void set_execution_position(size_t line) { m_execution_position = line; }
void clear_execution_position() { m_execution_position.clear(); }
- const String& file_path() const { return m_file_path; }
- const String& language_name() const { return m_language_name; };
+ String const& file_path() const { return m_file_path; }
+ String const& language_name() const { return m_language_name; };
Language language() const { return m_language; }
virtual bool is_code_document() const override final { return true; }
private:
- explicit CodeDocument(const String& file_path, Client* client = nullptr);
+ explicit CodeDocument(String const& file_path, Client* client = nullptr);
explicit CodeDocument(Client* client = nullptr);
String m_file_path;
diff --git a/Userland/DevTools/HackStudio/Debugger/BacktraceModel.cpp b/Userland/DevTools/HackStudio/Debugger/BacktraceModel.cpp
index 0ae6152e44..432dfbab1e 100644
--- a/Userland/DevTools/HackStudio/Debugger/BacktraceModel.cpp
+++ b/Userland/DevTools/HackStudio/Debugger/BacktraceModel.cpp
@@ -10,7 +10,7 @@
namespace HackStudio {
-NonnullRefPtr<BacktraceModel> BacktraceModel::create(Debug::ProcessInspector const& inspector, const PtraceRegisters& regs)
+NonnullRefPtr<BacktraceModel> BacktraceModel::create(Debug::ProcessInspector const& inspector, PtraceRegisters const& regs)
{
return adopt_ref(*new BacktraceModel(create_backtrace(inspector, regs)));
}
diff --git a/Userland/DevTools/HackStudio/Debugger/BacktraceModel.h b/Userland/DevTools/HackStudio/Debugger/BacktraceModel.h
index 4eefb54a89..74aedfc412 100644
--- a/Userland/DevTools/HackStudio/Debugger/BacktraceModel.h
+++ b/Userland/DevTools/HackStudio/Debugger/BacktraceModel.h
@@ -43,7 +43,7 @@ public:
Optional<Debug::DebugInfo::SourcePosition> m_source_position;
};
- const Vector<FrameInfo>& frames() const { return m_frames; }
+ Vector<FrameInfo> const& frames() const { return m_frames; }
private:
explicit BacktraceModel(Vector<FrameInfo>&& frames)
diff --git a/Userland/DevTools/HackStudio/Debugger/BreakpointCallback.h b/Userland/DevTools/HackStudio/Debugger/BreakpointCallback.h
index 45a3207c08..98d7b30edc 100644
--- a/Userland/DevTools/HackStudio/Debugger/BreakpointCallback.h
+++ b/Userland/DevTools/HackStudio/Debugger/BreakpointCallback.h
@@ -17,5 +17,5 @@ enum class BreakpointChange {
Removed,
};
-using BreakpointChangeCallback = Function<void(const String& file, size_t line, BreakpointChange)>;
+using BreakpointChangeCallback = Function<void(String const& file, size_t line, BreakpointChange)>;
}
diff --git a/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp b/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp
index 997b8a91b2..4ff7c4148c 100644
--- a/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp
+++ b/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp
@@ -89,7 +89,7 @@ DebugInfoWidget::DebugInfoWidget()
};
}
-bool DebugInfoWidget::does_variable_support_writing(const Debug::DebugInfo::VariableInfo* variable)
+bool DebugInfoWidget::does_variable_support_writing(Debug::DebugInfo::VariableInfo const* variable)
{
if (variable->location_type != Debug::DebugInfo::VariableInfo::LocationType::Address)
return false;
@@ -102,7 +102,7 @@ RefPtr<GUI::Menu> DebugInfoWidget::get_context_menu_for_variable(const GUI::Mode
return nullptr;
auto context_menu = GUI::Menu::construct();
- auto* variable = static_cast<const Debug::DebugInfo::VariableInfo*>(index.internal_data());
+ auto* variable = static_cast<Debug::DebugInfo::VariableInfo const*>(index.internal_data());
if (does_variable_support_writing(variable)) {
context_menu->add_action(GUI::Action::create("Change value", [&](auto&) {
String value;
@@ -155,7 +155,7 @@ NonnullRefPtr<GUI::Widget> DebugInfoWidget::build_registers_tab()
return registers_widget;
}
-void DebugInfoWidget::update_state(Debug::ProcessInspector& inspector, const PtraceRegisters& regs)
+void DebugInfoWidget::update_state(Debug::ProcessInspector& inspector, PtraceRegisters const& regs)
{
m_variables_view->set_model(VariablesModel::create(inspector, regs));
m_backtrace_view->set_model(BacktraceModel::create(inspector, regs));
diff --git a/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.h b/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.h
index 0cf30d5648..2f72f4c285 100644
--- a/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.h
+++ b/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.h
@@ -38,7 +38,7 @@ private:
NonnullRefPtr<GUI::Widget> build_variables_tab();
NonnullRefPtr<GUI::Widget> build_registers_tab();
- bool does_variable_support_writing(const Debug::DebugInfo::VariableInfo*);
+ bool does_variable_support_writing(Debug::DebugInfo::VariableInfo const*);
RefPtr<GUI::Menu> get_context_menu_for_variable(const GUI::ModelIndex&);
RefPtr<GUI::TreeView> m_variables_view;
diff --git a/Userland/DevTools/HackStudio/Debugger/Debugger.cpp b/Userland/DevTools/HackStudio/Debugger/Debugger.cpp
index 9a02d5962a..71d8bf39b7 100644
--- a/Userland/DevTools/HackStudio/Debugger/Debugger.cpp
+++ b/Userland/DevTools/HackStudio/Debugger/Debugger.cpp
@@ -19,7 +19,7 @@ Debugger& Debugger::the()
void Debugger::initialize(
String source_root,
- Function<HasControlPassedToUser(const PtraceRegisters&)> on_stop_callback,
+ Function<HasControlPassedToUser(PtraceRegisters const&)> on_stop_callback,
Function<void()> on_continue_callback,
Function<void()> on_exit_callback)
{
@@ -33,7 +33,7 @@ bool Debugger::is_initialized()
Debugger::Debugger(
String source_root,
- Function<HasControlPassedToUser(const PtraceRegisters&)> on_stop_callback,
+ Function<HasControlPassedToUser(PtraceRegisters const&)> on_stop_callback,
Function<void()> on_continue_callback,
Function<void()> on_exit_callback)
: m_source_root(source_root)
@@ -45,14 +45,14 @@ Debugger::Debugger(
pthread_cond_init(&m_ui_action_cond, nullptr);
}
-void Debugger::on_breakpoint_change(const String& file, size_t line, BreakpointChange change_type)
+void Debugger::on_breakpoint_change(String const& file, size_t line, BreakpointChange change_type)
{
auto position = create_source_position(file, line);
if (change_type == BreakpointChange::Added) {
m_breakpoints.append(position);
} else {
- m_breakpoints.remove_all_matching([&](const Debug::DebugInfo::SourcePosition& val) { return val == position; });
+ m_breakpoints.remove_all_matching([&](Debug::DebugInfo::SourcePosition const& val) { return val == position; });
}
auto session = Debugger::the().session();
@@ -77,7 +77,7 @@ void Debugger::on_breakpoint_change(const String& file, size_t line, BreakpointC
}
}
-bool Debugger::set_execution_position(const String& file, size_t line)
+bool Debugger::set_execution_position(String const& file, size_t line)
{
auto position = create_source_position(file, line);
auto session = Debugger::the().session();
@@ -92,7 +92,7 @@ bool Debugger::set_execution_position(const String& file, size_t line)
return true;
}
-Debug::DebugInfo::SourcePosition Debugger::create_source_position(const String& file, size_t line)
+Debug::DebugInfo::SourcePosition Debugger::create_source_position(String const& file, size_t line)
{
if (file.starts_with("/"))
return { file, line + 1 };
@@ -121,7 +121,7 @@ void Debugger::start()
m_debug_session = Debug::DebugSession::exec_and_attach(m_executable_path, m_source_root, move(child_setup_callback));
VERIFY(!!m_debug_session);
- for (const auto& breakpoint : m_breakpoints) {
+ for (auto const& breakpoint : m_breakpoints) {
dbgln("inserting breakpoint at: {}:{}", breakpoint.file_path, breakpoint.line_number);
auto address = m_debug_session->get_address_from_source_position(breakpoint.file_path, breakpoint.line_number);
if (address.has_value()) {
@@ -218,7 +218,7 @@ void Debugger::DebuggingState::set_single_stepping(Debug::DebugInfo::SourcePosit
m_original_source_position = original_source_position;
}
-bool Debugger::DebuggingState::should_stop_single_stepping(const Debug::DebugInfo::SourcePosition& current_source_position) const
+bool Debugger::DebuggingState::should_stop_single_stepping(Debug::DebugInfo::SourcePosition const& current_source_position) const
{
VERIFY(m_state == State::SingleStepping);
return m_original_source_position.value() != current_source_position;
@@ -243,7 +243,7 @@ void Debugger::DebuggingState::add_temporary_breakpoint(FlatPtr address)
m_addresses_of_temporary_breakpoints.append(address);
}
-void Debugger::do_step_out(const PtraceRegisters& regs)
+void Debugger::do_step_out(PtraceRegisters const& regs)
{
// To step out, we simply insert a temporary breakpoint at the
// instruction the current function returns to, and continue
@@ -251,7 +251,7 @@ void Debugger::do_step_out(const PtraceRegisters& regs)
insert_temporary_breakpoint_at_return_address(regs);
}
-void Debugger::do_step_over(const PtraceRegisters& regs)
+void Debugger::do_step_over(PtraceRegisters const& regs)
{
// To step over, we insert a temporary breakpoint at each line in the current function,
// as well as at the current function's return point, and continue execution.
@@ -265,13 +265,13 @@ void Debugger::do_step_over(const PtraceRegisters& regs)
}
VERIFY(current_function.has_value());
auto lines_in_current_function = lib->debug_info->source_lines_in_scope(current_function.value());
- for (const auto& line : lines_in_current_function) {
+ for (auto const& line : lines_in_current_function) {
insert_temporary_breakpoint(line.address_of_first_statement.value() + lib->base_address);
}
insert_temporary_breakpoint_at_return_address(regs);
}
-void Debugger::insert_temporary_breakpoint_at_return_address(const PtraceRegisters& regs)
+void Debugger::insert_temporary_breakpoint_at_return_address(PtraceRegisters const& regs)
{
auto frame_info = Debug::StackFrameUtils::get_info(*m_debug_session, regs.bp());
VERIFY(frame_info.has_value());
diff --git a/Userland/DevTools/HackStudio/Debugger/Debugger.h b/Userland/DevTools/HackStudio/Debugger/Debugger.h
index eca9d30b76..eaf14e5a5c 100644
--- a/Userland/DevTools/HackStudio/Debugger/Debugger.h
+++ b/Userland/DevTools/HackStudio/Debugger/Debugger.h
@@ -27,17 +27,17 @@ public:
static void initialize(
String source_root,
- Function<HasControlPassedToUser(const PtraceRegisters&)> on_stop_callback,
+ Function<HasControlPassedToUser(PtraceRegisters const&)> on_stop_callback,
Function<void()> on_continue_callback,
Function<void()> on_exit_callback);
static bool is_initialized();
- void on_breakpoint_change(const String& file, size_t line, BreakpointChange change_type);
- bool set_execution_position(const String& file, size_t line);
+ void on_breakpoint_change(String const& file, size_t line, BreakpointChange change_type);
+ bool set_execution_position(String const& file, size_t line);
- void set_executable_path(const String& path) { m_executable_path = path; }
- void set_source_root(const String& source_root) { m_source_root = source_root; }
+ void set_executable_path(String const& path) { m_executable_path = path; }
+ void set_source_root(String const& source_root) { m_source_root = source_root; }
Debug::DebugSession* session() { return m_debug_session.ptr(); }
@@ -78,10 +78,10 @@ private:
void set_stepping_out() { m_state = State::SteppingOut; }
void set_stepping_over() { m_state = State::SteppingOver; }
- bool should_stop_single_stepping(const Debug::DebugInfo::SourcePosition& current_source_position) const;
+ bool should_stop_single_stepping(Debug::DebugInfo::SourcePosition const& current_source_position) const;
void clear_temporary_breakpoints();
void add_temporary_breakpoint(FlatPtr address);
- const Vector<FlatPtr>& temporary_breakpoints() const { return m_addresses_of_temporary_breakpoints; }
+ Vector<FlatPtr> const& temporary_breakpoints() const { return m_addresses_of_temporary_breakpoints; }
private:
State m_state { Normal };
@@ -91,20 +91,20 @@ private:
explicit Debugger(
String source_root,
- Function<HasControlPassedToUser(const PtraceRegisters&)> on_stop_callback,
+ Function<HasControlPassedToUser(PtraceRegisters const&)> on_stop_callback,
Function<void()> on_continue_callback,
Function<void()> on_exit_callback);
- Debug::DebugInfo::SourcePosition create_source_position(const String& file, size_t line);
+ Debug::DebugInfo::SourcePosition create_source_position(String const& file, size_t line);
void start();
int debugger_loop();
void remove_temporary_breakpoints();
- void do_step_out(const PtraceRegisters&);
- void do_step_over(const PtraceRegisters&);
+ void do_step_out(PtraceRegisters const&);
+ void do_step_over(PtraceRegisters const&);
void insert_temporary_breakpoint(FlatPtr address);
- void insert_temporary_breakpoint_at_return_address(const PtraceRegisters&);
+ void insert_temporary_breakpoint_at_return_address(PtraceRegisters const&);
OwnPtr<Debug::DebugSession> m_debug_session;
String m_source_root;
@@ -118,7 +118,7 @@ private:
String m_executable_path;
- Function<HasControlPassedToUser(const PtraceRegisters&)> m_on_stopped_callback;
+ Function<HasControlPassedToUser(PtraceRegisters const&)> m_on_stopped_callback;
Function<void()> m_on_continue_callback;
Function<void()> m_on_exit_callback;
Function<ErrorOr<void>()> m_child_setup_callback;
diff --git a/Userland/DevTools/HackStudio/Debugger/DebuggerGlobalJSObject.cpp b/Userland/DevTools/HackStudio/Debugger/DebuggerGlobalJSObject.cpp
index 90e8abe82e..70822d9299 100644
--- a/Userland/DevTools/HackStudio/Debugger/DebuggerGlobalJSObject.cpp
+++ b/Userland/DevTools/HackStudio/Debugger/DebuggerGlobalJSObject.cpp
@@ -58,7 +58,7 @@ JS::ThrowCompletionOr<bool> DebuggerGlobalJSObject::internal_set(JS::PropertyKey
return vm().throw_completion<JS::TypeError>(const_cast<DebuggerGlobalJSObject&>(*this), move(error_string));
}
-Optional<JS::Value> DebuggerGlobalJSObject::debugger_to_js(const Debug::DebugInfo::VariableInfo& variable) const
+Optional<JS::Value> DebuggerGlobalJSObject::debugger_to_js(Debug::DebugInfo::VariableInfo const& variable) const
{
if (variable.location_type != Debug::DebugInfo::VariableInfo::LocationType::Address)
return {};
@@ -94,7 +94,7 @@ Optional<JS::Value> DebuggerGlobalJSObject::debugger_to_js(const Debug::DebugInf
return JS::Value(object);
}
-Optional<u32> DebuggerGlobalJSObject::js_to_debugger(JS::Value value, const Debug::DebugInfo::VariableInfo& variable) const
+Optional<u32> DebuggerGlobalJSObject::js_to_debugger(JS::Value value, Debug::DebugInfo::VariableInfo const& variable) const
{
if (value.is_string() && variable.type_name == "char") {
auto string = value.as_string().string();
diff --git a/Userland/DevTools/HackStudio/Debugger/DebuggerGlobalJSObject.h b/Userland/DevTools/HackStudio/Debugger/DebuggerGlobalJSObject.h
index cb1560ab28..a1f3b09e01 100644
--- a/Userland/DevTools/HackStudio/Debugger/DebuggerGlobalJSObject.h
+++ b/Userland/DevTools/HackStudio/Debugger/DebuggerGlobalJSObject.h
@@ -24,8 +24,8 @@ public:
virtual JS::ThrowCompletionOr<JS::Value> internal_get(JS::PropertyKey const&, JS::Value receiver) const override;
virtual JS::ThrowCompletionOr<bool> internal_set(JS::PropertyKey const&, JS::Value value, JS::Value receiver) override;
- Optional<JS::Value> debugger_to_js(const Debug::DebugInfo::VariableInfo&) const;
- Optional<u32> js_to_debugger(JS::Value value, const Debug::DebugInfo::VariableInfo&) const;
+ Optional<JS::Value> debugger_to_js(Debug::DebugInfo::VariableInfo const&) const;
+ Optional<u32> js_to_debugger(JS::Value value, Debug::DebugInfo::VariableInfo const&) const;
private:
NonnullOwnPtrVector<Debug::DebugInfo::VariableInfo> m_variables;
diff --git a/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.cpp b/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.cpp
index 063f1fd4cb..97db4eeffe 100644
--- a/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.cpp
+++ b/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.cpp
@@ -15,12 +15,12 @@
namespace HackStudio {
-DebuggerVariableJSObject* DebuggerVariableJSObject::create(DebuggerGlobalJSObject& global_object, const Debug::DebugInfo::VariableInfo& variable_info)
+DebuggerVariableJSObject* DebuggerVariableJSObject::create(DebuggerGlobalJSObject& global_object, Debug::DebugInfo::VariableInfo const& variable_info)
{
return global_object.heap().allocate<DebuggerVariableJSObject>(global_object, variable_info, *global_object.object_prototype());
}
-DebuggerVariableJSObject::DebuggerVariableJSObject(const Debug::DebugInfo::VariableInfo& variable_info, JS::Object& prototype)
+DebuggerVariableJSObject::DebuggerVariableJSObject(Debug::DebugInfo::VariableInfo const& variable_info, JS::Object& prototype)
: JS::Object(prototype)
, m_variable_info(variable_info)
{
diff --git a/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.h b/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.h
index c44c0e907d..195e978225 100644
--- a/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.h
+++ b/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.h
@@ -20,9 +20,9 @@ class DebuggerVariableJSObject final : public JS::Object {
using Base = JS::Object;
public:
- static DebuggerVariableJSObject* create(DebuggerGlobalJSObject&, const Debug::DebugInfo::VariableInfo& variable_info);
+ static DebuggerVariableJSObject* create(DebuggerGlobalJSObject&, Debug::DebugInfo::VariableInfo const& variable_info);
- DebuggerVariableJSObject(const Debug::DebugInfo::VariableInfo& variable_info, JS::Object& prototype);
+ DebuggerVariableJSObject(Debug::DebugInfo::VariableInfo const& variable_info, JS::Object& prototype);
virtual ~DebuggerVariableJSObject() override = default;
virtual StringView class_name() const override { return m_variable_info.type_name; }
@@ -32,7 +32,7 @@ public:
private:
DebuggerGlobalJSObject& debugger_object() const;
- const Debug::DebugInfo::VariableInfo& m_variable_info;
+ Debug::DebugInfo::VariableInfo const& m_variable_info;
};
}
diff --git a/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp b/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp
index 22d99180fd..3861ae7626 100644
--- a/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp
+++ b/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp
@@ -17,7 +17,7 @@
namespace HackStudio {
-DisassemblyModel::DisassemblyModel(const Debug::DebugSession& debug_session, const PtraceRegisters& regs)
+DisassemblyModel::DisassemblyModel(Debug::DebugSession const& debug_session, PtraceRegisters const& regs)
{
auto lib = debug_session.library_at(regs.ip());
if (!lib)
@@ -51,7 +51,7 @@ DisassemblyModel::DisassemblyModel(const Debug::DebugSession& debug_session, con
auto view = symbol.value().raw_data();
X86::ELFSymbolProvider symbol_provider(*elf);
- X86::SimpleInstructionStream stream((const u8*)view.characters_without_null_termination(), view.length());
+ X86::SimpleInstructionStream stream((u8 const*)view.characters_without_null_termination(), view.length());
X86::Disassembler disassembler(stream);
size_t offset_into_symbol = 0;
diff --git a/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.h b/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.h
index 6daaea3cc2..10efc05af4 100644
--- a/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.h
+++ b/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.h
@@ -29,7 +29,7 @@ struct InstructionData {
class DisassemblyModel final : public GUI::Model {
public:
- static NonnullRefPtr<DisassemblyModel> create(const Debug::DebugSession& debug_session, const PtraceRegisters& regs)
+ static NonnullRefPtr<DisassemblyModel> create(Debug::DebugSession const& debug_session, PtraceRegisters const& regs)
{
return adopt_ref(*new DisassemblyModel(debug_session, regs));
}
@@ -49,7 +49,7 @@ public:
virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override;
private:
- DisassemblyModel(const Debug::DebugSession&, const PtraceRegisters&);
+ DisassemblyModel(Debug::DebugSession const&, PtraceRegisters const&);
Vector<InstructionData> m_instructions;
};
diff --git a/Userland/DevTools/HackStudio/Debugger/DisassemblyWidget.cpp b/Userland/DevTools/HackStudio/Debugger/DisassemblyWidget.cpp
index ff49fdf897..f2cfe33ae1 100644
--- a/Userland/DevTools/HackStudio/Debugger/DisassemblyWidget.cpp
+++ b/Userland/DevTools/HackStudio/Debugger/DisassemblyWidget.cpp
@@ -39,7 +39,7 @@ DisassemblyWidget::DisassemblyWidget()
hide_disassembly("Program isn't running");
}
-void DisassemblyWidget::update_state(const Debug::DebugSession& debug_session, const PtraceRegisters& regs)
+void DisassemblyWidget::update_state(Debug::DebugSession const& debug_session, PtraceRegisters const& regs)
{
m_disassembly_view->set_model(DisassemblyModel::create(debug_session, regs));
@@ -73,7 +73,7 @@ void DisassemblyWidget::show_disassembly()
m_unavailable_disassembly_widget->set_visible(false);
}
-void DisassemblyWidget::hide_disassembly(const String& reason)
+void DisassemblyWidget::hide_disassembly(String const& reason)
{
m_top_container->set_visible(false);
m_disassembly_view->set_visible(false);
diff --git a/Userland/DevTools/HackStudio/Debugger/DisassemblyWidget.h b/Userland/DevTools/HackStudio/Debugger/DisassemblyWidget.h
index 09254737f7..5805c722ad 100644
--- a/Userland/DevTools/HackStudio/Debugger/DisassemblyWidget.h
+++ b/Userland/DevTools/HackStudio/Debugger/DisassemblyWidget.h
@@ -21,11 +21,11 @@ class UnavailableDisassemblyWidget final : public GUI::Frame {
public:
virtual ~UnavailableDisassemblyWidget() override { }
- const String& reason() const { return m_reason; }
- void set_reason(const String& text) { m_reason = text; }
+ String const& reason() const { return m_reason; }
+ void set_reason(String const& text) { m_reason = text; }
private:
- UnavailableDisassemblyWidget(const String& reason)
+ UnavailableDisassemblyWidget(String const& reason)
: m_reason(reason)
{
}
@@ -40,14 +40,14 @@ class DisassemblyWidget final : public GUI::Widget {
public:
virtual ~DisassemblyWidget() override { }
- void update_state(const Debug::DebugSession&, const PtraceRegisters&);
+ void update_state(Debug::DebugSession const&, PtraceRegisters const&);
void program_stopped();
private:
DisassemblyWidget();
void show_disassembly();
- void hide_disassembly(const String&);
+ void hide_disassembly(String const&);
RefPtr<GUI::Widget> m_top_container;
RefPtr<GUI::TableView> m_disassembly_view;
diff --git a/Userland/DevTools/HackStudio/Debugger/EvaluateExpressionDialog.cpp b/Userland/DevTools/HackStudio/Debugger/EvaluateExpressionDialog.cpp
index d31f8ae12e..c1fc9a7058 100644
--- a/Userland/DevTools/HackStudio/Debugger/EvaluateExpressionDialog.cpp
+++ b/Userland/DevTools/HackStudio/Debugger/EvaluateExpressionDialog.cpp
@@ -103,7 +103,7 @@ void EvaluateExpressionDialog::build(Window* parent_window)
m_text_editor->set_focus(true);
}
-void EvaluateExpressionDialog::handle_evaluation(const String& expression)
+void EvaluateExpressionDialog::handle_evaluation(String const& expression)
{
m_output_container->remove_all_children();
m_output_view->update();
diff --git a/Userland/DevTools/HackStudio/Debugger/EvaluateExpressionDialog.h b/Userland/DevTools/HackStudio/Debugger/EvaluateExpressionDialog.h
index d33873c3bb..201c3c8190 100644
--- a/Userland/DevTools/HackStudio/Debugger/EvaluateExpressionDialog.h
+++ b/Userland/DevTools/HackStudio/Debugger/EvaluateExpressionDialog.h
@@ -18,7 +18,7 @@ private:
explicit EvaluateExpressionDialog(Window* parent_window);
void build(Window* parent_window);
- void handle_evaluation(const String& expression);
+ void handle_evaluation(String const& expression);
void set_output(StringView html);
NonnullOwnPtr<JS::Interpreter> m_interpreter;
diff --git a/Userland/DevTools/HackStudio/Debugger/RegistersModel.cpp b/Userland/DevTools/HackStudio/Debugger/RegistersModel.cpp
index 3bac9fce93..949b6202e6 100644
--- a/Userland/DevTools/HackStudio/Debugger/RegistersModel.cpp
+++ b/Userland/DevTools/HackStudio/Debugger/RegistersModel.cpp
@@ -9,7 +9,7 @@
namespace HackStudio {
-RegistersModel::RegistersModel(const PtraceRegisters& regs)
+RegistersModel::RegistersModel(PtraceRegisters const& regs)
: m_raw_registers(regs)
{
#if ARCH(I386)
@@ -52,7 +52,7 @@ RegistersModel::RegistersModel(const PtraceRegisters& regs)
m_registers.append({ "gs", regs.gs });
}
-RegistersModel::RegistersModel(const PtraceRegisters& current_regs, const PtraceRegisters& previous_regs)
+RegistersModel::RegistersModel(PtraceRegisters const& current_regs, PtraceRegisters const& previous_regs)
: m_raw_registers(current_regs)
{
#if ARCH(I386)
diff --git a/Userland/DevTools/HackStudio/Debugger/RegistersModel.h b/Userland/DevTools/HackStudio/Debugger/RegistersModel.h
index 91651e798a..a0e86c1915 100644
--- a/Userland/DevTools/HackStudio/Debugger/RegistersModel.h
+++ b/Userland/DevTools/HackStudio/Debugger/RegistersModel.h
@@ -21,12 +21,12 @@ struct RegisterData {
class RegistersModel final : public GUI::Model {
public:
- static RefPtr<RegistersModel> create(const PtraceRegisters& regs)
+ static RefPtr<RegistersModel> create(PtraceRegisters const& regs)
{
return adopt_ref(*new RegistersModel(regs));
}
- static RefPtr<RegistersModel> create(const PtraceRegisters& current_regs, const PtraceRegisters& previous_regs)
+ static RefPtr<RegistersModel> create(PtraceRegisters const& current_regs, PtraceRegisters const& previous_regs)
{
return adopt_ref(*new RegistersModel(current_regs, previous_regs));
}
@@ -44,11 +44,11 @@ public:
virtual String column_name(int) const override;
virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override;
- const PtraceRegisters& raw_registers() const { return m_raw_registers; }
+ PtraceRegisters const& raw_registers() const { return m_raw_registers; }
private:
- explicit RegistersModel(const PtraceRegisters& regs);
- RegistersModel(const PtraceRegisters& current_regs, const PtraceRegisters& previous_regs);
+ explicit RegistersModel(PtraceRegisters const& regs);
+ RegistersModel(PtraceRegisters const& current_regs, PtraceRegisters const& previous_regs);
PtraceRegisters m_raw_registers;
Vector<RegisterData> m_registers;
diff --git a/Userland/DevTools/HackStudio/Debugger/VariablesModel.cpp b/Userland/DevTools/HackStudio/Debugger/VariablesModel.cpp
index 02f57c81d6..5e014b63c1 100644
--- a/Userland/DevTools/HackStudio/Debugger/VariablesModel.cpp
+++ b/Userland/DevTools/HackStudio/Debugger/VariablesModel.cpp
@@ -17,7 +17,7 @@ GUI::ModelIndex VariablesModel::index(int row, int column, const GUI::ModelIndex
return {};
return create_index(row, column, &m_variables[row]);
}
- auto* parent = static_cast<const Debug::DebugInfo::VariableInfo*>(parent_index.internal_data());
+ auto* parent = static_cast<Debug::DebugInfo::VariableInfo const*>(parent_index.internal_data());
if (static_cast<size_t>(row) >= parent->members.size())
return {};
auto* child = &parent->members[row];
@@ -28,7 +28,7 @@ GUI::ModelIndex VariablesModel::parent_index(const GUI::ModelIndex& index) const
{
if (!index.is_valid())
return {};
- auto* child = static_cast<const Debug::DebugInfo::VariableInfo*>(index.internal_data());
+ auto* child = static_cast<Debug::DebugInfo::VariableInfo const*>(index.internal_data());
auto* parent = child->parent;
if (parent == nullptr)
return {};
@@ -51,11 +51,11 @@ int VariablesModel::row_count(const GUI::ModelIndex& index) const
{
if (!index.is_valid())
return m_variables.size();
- auto* node = static_cast<const Debug::DebugInfo::VariableInfo*>(index.internal_data());
+ auto* node = static_cast<Debug::DebugInfo::VariableInfo const*>(index.internal_data());
return node->members.size();
}
-static String variable_value_as_string(const Debug::DebugInfo::VariableInfo& variable)
+static String variable_value_as_string(Debug::DebugInfo::VariableInfo const& variable)
{
if (variable.location_type != Debug::DebugInfo::VariableInfo::LocationType::Address)
return "N/A";
@@ -65,7 +65,7 @@ static String variable_value_as_string(const Debug::DebugInfo::VariableInfo& var
if (variable.is_enum_type()) {
auto value = Debugger::the().session()->peek(variable_address);
VERIFY(value.has_value());
- auto it = variable.type->members.find_if([&enumerator_value = value.value()](const auto& enumerator) {
+ auto it = variable.type->members.find_if([&enumerator_value = value.value()](auto const& enumerator) {
return enumerator->constant_data.as_u32 == enumerator_value;
});
if (it.is_end())
@@ -94,7 +94,7 @@ static String variable_value_as_string(const Debug::DebugInfo::VariableInfo& var
return String::formatted("type: {} @ {:p}, ", variable.type_name, variable_address);
}
-static Optional<u32> string_to_variable_value(StringView string_value, const Debug::DebugInfo::VariableInfo& variable)
+static Optional<u32> string_to_variable_value(StringView string_value, Debug::DebugInfo::VariableInfo const& variable)
{
if (variable.is_enum_type()) {
auto prefix_string = String::formatted("{}::", variable.type_name);
@@ -102,7 +102,7 @@ static Optional<u32> string_to_variable_value(StringView string_value, const Deb
if (string_value.starts_with(prefix_string))
string_to_use = string_value.substring_view(prefix_string.length(), string_value.length() - prefix_string.length());
- auto it = variable.type->members.find_if([string_to_use](const auto& enumerator) {
+ auto it = variable.type->members.find_if([string_to_use](auto const& enumerator) {
return enumerator->name == string_to_use;
});
@@ -131,7 +131,7 @@ static Optional<u32> string_to_variable_value(StringView string_value, const Deb
void VariablesModel::set_variable_value(const GUI::ModelIndex& index, StringView string_value, GUI::Window* parent_window)
{
- auto variable = static_cast<const Debug::DebugInfo::VariableInfo*>(index.internal_data());
+ auto variable = static_cast<Debug::DebugInfo::VariableInfo const*>(index.internal_data());
auto value = string_to_variable_value(string_value, *variable);
@@ -150,7 +150,7 @@ void VariablesModel::set_variable_value(const GUI::ModelIndex& index, StringView
GUI::Variant VariablesModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const
{
- auto* variable = static_cast<const Debug::DebugInfo::VariableInfo*>(index.internal_data());
+ auto* variable = static_cast<Debug::DebugInfo::VariableInfo const*>(index.internal_data());
switch (role) {
case GUI::ModelRole::Display: {
auto value_as_string = variable_value_as_string(*variable);
diff --git a/Userland/DevTools/HackStudio/Debugger/VariablesModel.h b/Userland/DevTools/HackStudio/Debugger/VariablesModel.h
index a46a7641ed..c32019bb31 100644
--- a/Userland/DevTools/HackStudio/Debugger/VariablesModel.h
+++ b/Userland/DevTools/HackStudio/Debugger/VariablesModel.h
@@ -28,7 +28,7 @@ public:
Debug::ProcessInspector& inspector() { return m_inspector; }
private:
- explicit VariablesModel(Debug::ProcessInspector& inspector, NonnullOwnPtrVector<Debug::DebugInfo::VariableInfo>&& variables, const PtraceRegisters& regs)
+ explicit VariablesModel(Debug::ProcessInspector& inspector, NonnullOwnPtrVector<Debug::DebugInfo::VariableInfo>&& variables, PtraceRegisters const& regs)
: m_variables(move(variables))
, m_regs(regs)
, m_inspector(inspector)
diff --git a/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp b/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp
index 36d67f5e8f..e33d7ba9fe 100644
--- a/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp
+++ b/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp
@@ -25,7 +25,7 @@
namespace HackStudio {
-static const Regex<PosixExtended> s_project_name_validity_regex("^([A-Za-z0-9_-])*$");
+static Regex<PosixExtended> const s_project_name_validity_regex("^([A-Za-z0-9_-])*$");
int NewProjectDialog::show(GUI::Window* parent_window)
{
diff --git a/Userland/DevTools/HackStudio/Editor.cpp b/Userland/DevTools/HackStudio/Editor.cpp
index f452428e5b..d50d92247b 100644
--- a/Userland/DevTools/HackStudio/Editor.cpp
+++ b/Userland/DevTools/HackStudio/Editor.cpp
@@ -101,9 +101,9 @@ EditorWrapper& Editor::wrapper()
{
return static_cast<EditorWrapper&>(*parent());
}
-const EditorWrapper& Editor::wrapper() const
+EditorWrapper const& Editor::wrapper() const
{
- return static_cast<const EditorWrapper&>(*parent());
+ return static_cast<EditorWrapper const&>(*parent());
}
void Editor::focusin_event(GUI::FocusEvent& event)
@@ -147,11 +147,11 @@ void Editor::paint_event(GUI::PaintEvent& event)
if (line < first_visible_line || line > last_visible_line) {
continue;
}
- const auto& icon = breakpoint_icon_bitmap();
+ auto const& icon = breakpoint_icon_bitmap();
painter.blit(gutter_icon_rect(line).top_left(), icon, icon.rect());
}
if (execution_position().has_value()) {
- const auto& icon = current_position_icon_bitmap();
+ auto const& icon = current_position_icon_bitmap();
painter.blit(gutter_icon_rect(execution_position().value()).top_left(), icon, icon.rect());
}
@@ -198,7 +198,7 @@ static HashMap<String, String>& man_paths()
return paths;
}
-void Editor::show_documentation_tooltip_if_available(const String& hovered_token, const Gfx::IntPoint& screen_location)
+void Editor::show_documentation_tooltip_if_available(String const& hovered_token, Gfx::IntPoint const& screen_location)
{
auto it = man_paths().find(hovered_token);
if (it == man_paths().end()) {
@@ -438,28 +438,28 @@ void Editor::clear_execution_position()
update(gutter_icon_rect(previous_position));
}
-const Gfx::Bitmap& Editor::breakpoint_icon_bitmap()
+Gfx::Bitmap const& Editor::breakpoint_icon_bitmap()
{
static auto bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/breakpoint.png").release_value_but_fixme_should_propagate_errors();
return *bitmap;
}
-const Gfx::Bitmap& Editor::current_position_icon_bitmap()
+Gfx::Bitmap const& Editor::current_position_icon_bitmap()
{
static auto bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png").release_value_but_fixme_should_propagate_errors();
return *bitmap;
}
-const CodeDocument& Editor::code_document() const
+CodeDocument const& Editor::code_document() const
{
- const auto& doc = document();
+ auto const& doc = document();
VERIFY(doc.is_code_document());
- return static_cast<const CodeDocument&>(doc);
+ return static_cast<CodeDocument const&>(doc);
}
CodeDocument& Editor::code_document()
{
- return const_cast<CodeDocument&>(static_cast<const Editor&>(*this).code_document());
+ return const_cast<CodeDocument&>(static_cast<Editor const&>(*this).code_document());
}
void Editor::set_document(GUI::TextDocument& doc)
@@ -585,7 +585,7 @@ void Editor::on_identifier_click(const GUI::TextDocumentSpan& span)
if (!m_language_client)
return;
- m_language_client->on_declaration_found = [](const String& file, size_t line, size_t column) {
+ m_language_client->on_declaration_found = [](String const& file, size_t line, size_t column) {
HackStudio::open_file(file, line, column);
};
m_language_client->search_declaration(code_document().file_path(), span.range.start().line(), span.range.start().column());
@@ -596,7 +596,7 @@ void Editor::set_cursor(const GUI::TextPosition& a_position)
TextEditor::set_cursor(a_position);
}
-void Editor::set_syntax_highlighter_for(const CodeDocument& document)
+void Editor::set_syntax_highlighter_for(CodeDocument const& document)
{
switch (document.language()) {
case Language::Cpp:
@@ -650,7 +650,7 @@ void Editor::set_autocomplete_provider_for(CodeDocument const& document)
}
}
-void Editor::set_language_client_for(const CodeDocument& document)
+void Editor::set_language_client_for(CodeDocument const& document)
{
if (m_language_client && m_language_client->language() == document.language())
return;
diff --git a/Userland/DevTools/HackStudio/Editor.h b/Userland/DevTools/HackStudio/Editor.h
index 75755e0f8e..e1bc6206d5 100644
--- a/Userland/DevTools/HackStudio/Editor.h
+++ b/Userland/DevTools/HackStudio/Editor.h
@@ -32,9 +32,9 @@ public:
Function<void(String)> on_open;
EditorWrapper& wrapper();
- const EditorWrapper& wrapper() const;
+ EditorWrapper const& wrapper() const;
- const Vector<size_t>& breakpoint_lines() const { return code_document().breakpoint_lines(); }
+ Vector<size_t> const& breakpoint_lines() const { return code_document().breakpoint_lines(); }
Vector<size_t>& breakpoint_lines() { return code_document().breakpoint_lines(); }
Optional<size_t> execution_position() const { return code_document().execution_position(); }
bool is_program_running() const { return execution_position().has_value(); }
@@ -42,7 +42,7 @@ public:
void clear_execution_position();
void set_debug_mode(bool);
- const CodeDocument& code_document() const;
+ CodeDocument const& code_document() const;
CodeDocument& code_document();
virtual void set_document(GUI::TextDocument&) override;
@@ -70,14 +70,14 @@ private:
virtual void leave_event(Core::Event&) override;
virtual void keydown_event(GUI::KeyEvent&) override;
- void show_documentation_tooltip_if_available(const String&, const Gfx::IntPoint& screen_location);
+ void show_documentation_tooltip_if_available(String const&, Gfx::IntPoint const& screen_location);
void navigate_to_include_if_available(String);
void on_navigatable_link_click(const GUI::TextDocumentSpan&);
void on_identifier_click(const GUI::TextDocumentSpan&);
Gfx::IntRect gutter_icon_rect(size_t line_number) const;
- static const Gfx::Bitmap& breakpoint_icon_bitmap();
- static const Gfx::Bitmap& current_position_icon_bitmap();
+ static Gfx::Bitmap const& breakpoint_icon_bitmap();
+ static Gfx::Bitmap const& current_position_icon_bitmap();
struct AutoCompleteRequestData {
GUI::TextPosition position;
@@ -99,8 +99,8 @@ private:
Optional<AutoCompleteRequestData> get_autocomplete_request_data();
void flush_file_content_to_langauge_server();
- void set_syntax_highlighter_for(const CodeDocument&);
- void set_language_client_for(const CodeDocument&);
+ void set_syntax_highlighter_for(CodeDocument const&);
+ void set_language_client_for(CodeDocument const&);
void set_autocomplete_provider_for(CodeDocument const&);
void handle_function_parameters_hint_request();
void on_token_info_timer_tick();
diff --git a/Userland/DevTools/HackStudio/EditorWrapper.cpp b/Userland/DevTools/HackStudio/EditorWrapper.cpp
index b3eda59f42..c532a1f7c6 100644
--- a/Userland/DevTools/HackStudio/EditorWrapper.cpp
+++ b/Userland/DevTools/HackStudio/EditorWrapper.cpp
@@ -62,7 +62,7 @@ void EditorWrapper::set_mode_non_displayable()
editor().document().set_text("The contents of this file could not be displayed. Is it a binary file?");
}
-void EditorWrapper::set_filename(const String& filename)
+void EditorWrapper::set_filename(String const& filename)
{
m_filename = filename;
update_title();
diff --git a/Userland/DevTools/HackStudio/EditorWrapper.h b/Userland/DevTools/HackStudio/EditorWrapper.h
index 62c5121d4d..abbc756738 100644
--- a/Userland/DevTools/HackStudio/EditorWrapper.h
+++ b/Userland/DevTools/HackStudio/EditorWrapper.h
@@ -29,7 +29,7 @@ public:
virtual ~EditorWrapper() override = default;
Editor& editor() { return *m_editor; }
- const Editor& editor() const { return *m_editor; }
+ Editor const& editor() const { return *m_editor; }
void save();
@@ -38,8 +38,8 @@ public:
void set_mode_displayable();
void set_mode_non_displayable();
void set_debug_mode(bool);
- void set_filename(const String&);
- const String& filename() const { return m_filename; }
+ void set_filename(String const&);
+ String const& filename() const { return m_filename; }
String const& filename_title() const { return m_filename_title; }
Optional<String> const& project_root() const { return m_project_root; }
diff --git a/Userland/DevTools/HackStudio/FindInFilesWidget.cpp b/Userland/DevTools/HackStudio/FindInFilesWidget.cpp
index 28e95f5fc7..5b9e99355f 100644
--- a/Userland/DevTools/HackStudio/FindInFilesWidget.cpp
+++ b/Userland/DevTools/HackStudio/FindInFilesWidget.cpp
@@ -31,7 +31,7 @@ public:
__Count
};
- explicit SearchResultsModel(const Vector<Match>&& matches)
+ explicit SearchResultsModel(Vector<Match> const&& matches)
: m_matches(move(matches))
{
}
diff --git a/Userland/DevTools/HackStudio/GMLPreviewWidget.cpp b/Userland/DevTools/HackStudio/GMLPreviewWidget.cpp
index e2f07af251..054d2ddd20 100644
--- a/Userland/DevTools/HackStudio/GMLPreviewWidget.cpp
+++ b/Userland/DevTools/HackStudio/GMLPreviewWidget.cpp
@@ -27,7 +27,7 @@ void GMLPreviewWidget::load_gml(String const& gml)
return;
}
- load_from_gml(gml, [](const String& name) -> RefPtr<Core::Object> {
+ load_from_gml(gml, [](String const& name) -> RefPtr<Core::Object> {
return GUI::Label::construct(String::formatted("{} is not registered as a GML element!", name));
});
diff --git a/Userland/DevTools/HackStudio/Git/DiffViewer.cpp b/Userland/DevTools/HackStudio/Git/DiffViewer.cpp
index 049fbd5978..cf85972dcd 100644
--- a/Userland/DevTools/HackStudio/Git/DiffViewer.cpp
+++ b/Userland/DevTools/HackStudio/Git/DiffViewer.cpp
@@ -35,7 +35,7 @@ void DiffViewer::paint_event(GUI::PaintEvent& event)
size_t y_offset = 10;
size_t current_original_line_index = 0;
- for (const auto& hunk : m_hunks) {
+ for (auto const& hunk : m_hunks) {
for (size_t i = current_original_line_index; i < hunk.original_start_line; ++i) {
draw_line(painter, m_original_lines[i], y_offset, LinePosition::Both, LineType::Normal);
y_offset += line_height();
@@ -43,7 +43,7 @@ void DiffViewer::paint_event(GUI::PaintEvent& event)
current_original_line_index = hunk.original_start_line + hunk.removed_lines.size();
size_t left_y_offset = y_offset;
- for (const auto& removed_line : hunk.removed_lines) {
+ for (auto const& removed_line : hunk.removed_lines) {
draw_line(painter, removed_line, left_y_offset, LinePosition::Left, LineType::Diff);
left_y_offset += line_height();
}
@@ -53,7 +53,7 @@ void DiffViewer::paint_event(GUI::PaintEvent& event)
}
size_t right_y_offset = y_offset;
- for (const auto& added_line : hunk.added_lines) {
+ for (auto const& added_line : hunk.added_lines) {
draw_line(painter, added_line, right_y_offset, LinePosition::Right, LineType::Diff);
right_y_offset += line_height();
}
@@ -71,7 +71,7 @@ void DiffViewer::paint_event(GUI::PaintEvent& event)
}
}
-void DiffViewer::draw_line(GUI::Painter& painter, const String& line, size_t y_offset, LinePosition line_position, LineType line_type)
+void DiffViewer::draw_line(GUI::Painter& painter, String const& line, size_t y_offset, LinePosition line_position, LineType line_type)
{
size_t line_width = font().width(line);
@@ -131,7 +131,7 @@ Gfx::IntRect DiffViewer::separator_rect() const
frame_inner_rect().height() };
}
-void DiffViewer::set_content(const String& original, const String& diff)
+void DiffViewer::set_content(String const& original, String const& diff)
{
m_original_lines = split_to_lines(original);
m_hunks = Diff::parse_hunks(diff);
@@ -147,7 +147,7 @@ DiffViewer::DiffViewer()
setup_properties();
}
-DiffViewer::DiffViewer(const String& original, const String& diff)
+DiffViewer::DiffViewer(String const& original, String const& diff)
: m_original_lines(split_to_lines(original))
, m_hunks(Diff::parse_hunks(diff))
{
@@ -161,7 +161,7 @@ void DiffViewer::setup_properties()
set_foreground_role(ColorRole::BaseText);
}
-Vector<String> DiffViewer::split_to_lines(const String& text)
+Vector<String> DiffViewer::split_to_lines(String const& text)
{
// NOTE: This is slightly different than text.split('\n')
Vector<String> lines;
@@ -204,7 +204,7 @@ void DiffViewer::update_content_size()
size_t num_lines = 0;
size_t current_original_line_index = 0;
- for (const auto& hunk : m_hunks) {
+ for (auto const& hunk : m_hunks) {
num_lines += ((int)hunk.original_start_line - (int)current_original_line_index);
num_lines += hunk.removed_lines.size();
diff --git a/Userland/DevTools/HackStudio/Git/DiffViewer.h b/Userland/DevTools/HackStudio/Git/DiffViewer.h
index 38b27bf0df..a700809a4f 100644
--- a/Userland/DevTools/HackStudio/Git/DiffViewer.h
+++ b/Userland/DevTools/HackStudio/Git/DiffViewer.h
@@ -18,10 +18,10 @@ class DiffViewer final : public GUI::AbstractScrollableWidget {
public:
virtual ~DiffViewer() override = default;
- void set_content(const String& original, const String& diff);
+ void set_content(String const& original, String const& diff);
private:
- DiffViewer(const String& original, const String& diff);
+ DiffViewer(String const& original, String const& diff);
DiffViewer();
void setup_properties();
@@ -43,9 +43,9 @@ private:
Missing,
};
- void draw_line(GUI::Painter&, const String& line, size_t y_offset, LinePosition, LineType);
+ void draw_line(GUI::Painter&, String const& line, size_t y_offset, LinePosition, LineType);
- static Vector<String> split_to_lines(const String& text);
+ static Vector<String> split_to_lines(String const& text);
static Gfx::Color red_background();
static Gfx::Color green_background();
diff --git a/Userland/DevTools/HackStudio/Git/GitWidget.cpp b/Userland/DevTools/HackStudio/Git/GitWidget.cpp
index 92238f7293..a6e6e0465a 100644
--- a/Userland/DevTools/HackStudio/Git/GitWidget.cpp
+++ b/Userland/DevTools/HackStudio/Git/GitWidget.cpp
@@ -167,8 +167,8 @@ void GitWidget::show_diff(String const& file_path)
m_view_diff_callback("", Diff::generate_only_additions(content_string));
return;
}
- const auto& original_content = m_git_repo->original_file_content(file_path);
- const auto& diff = m_git_repo->unstaged_diff(file_path);
+ auto const& original_content = m_git_repo->original_file_content(file_path);
+ auto const& diff = m_git_repo->unstaged_diff(file_path);
VERIFY(original_content.has_value() && diff.has_value());
m_view_diff_callback(original_content.value(), diff.value());
}
diff --git a/Userland/DevTools/HackStudio/Git/GitWidget.h b/Userland/DevTools/HackStudio/Git/GitWidget.h
index 87f7c1bd2f..a0ff4ac209 100644
--- a/Userland/DevTools/HackStudio/Git/GitWidget.h
+++ b/Userland/DevTools/HackStudio/Git/GitWidget.h
@@ -14,7 +14,7 @@
namespace HackStudio {
-using ViewDiffCallback = Function<void(const String& original_content, const String& diff)>;
+using ViewDiffCallback = Function<void(String const& original_content, String const& diff)>;
class GitWidget final : public GUI::Widget {
C_OBJECT(GitWidget)
diff --git a/Userland/DevTools/HackStudio/HackStudio.h b/Userland/DevTools/HackStudio/HackStudio.h
index 68924f5523..3458b7c116 100644
--- a/Userland/DevTools/HackStudio/HackStudio.h
+++ b/Userland/DevTools/HackStudio/HackStudio.h
@@ -15,9 +15,9 @@
namespace HackStudio {
GUI::TextEditor& current_editor();
-void open_file(const String&);
+void open_file(String const&);
RefPtr<EditorWrapper> current_editor_wrapper();
-void open_file(const String&, size_t line, size_t column);
+void open_file(String const&, size_t line, size_t column);
Project& project();
String currently_open_file();
void set_current_editor_wrapper(RefPtr<EditorWrapper>);
diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp
index df1b66220b..b741203914 100644
--- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp
+++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp
@@ -233,7 +233,7 @@ Vector<String> HackStudioWidget::read_recent_projects()
return paths;
}
-void HackStudioWidget::open_project(const String& root_path)
+void HackStudioWidget::open_project(String const& root_path)
{
if (warn_unsaved_changes("There are unsaved changes, do you want to save before closing current project?") == ContinueDecision::No)
return;
@@ -300,7 +300,7 @@ Vector<String> HackStudioWidget::selected_file_paths() const
return files;
}
-bool HackStudioWidget::open_file(const String& full_filename, size_t line, size_t column)
+bool HackStudioWidget::open_file(String const& full_filename, size_t line, size_t column)
{
String filename = full_filename;
if (full_filename.starts_with(project().root_path())) {
@@ -972,7 +972,7 @@ void HackStudioWidget::initialize_debugger()
{
Debugger::initialize(
m_project->root_path(),
- [this](const PtraceRegisters& regs) {
+ [this](PtraceRegisters const& regs) {
VERIFY(Debugger::the().session());
const auto& debug_session = *Debugger::the().session();
auto source_position = debug_session.get_source_position(regs.ip());
@@ -1025,7 +1025,7 @@ void HackStudioWidget::initialize_debugger()
});
}
-String HackStudioWidget::get_full_path_of_serenity_source(const String& file)
+String HackStudioWidget::get_full_path_of_serenity_source(String const& file)
{
auto path_parts = LexicalPath(file).parts();
while (!path_parts.is_empty() && path_parts[0] == "..") {
@@ -1038,7 +1038,7 @@ String HackStudioWidget::get_full_path_of_serenity_source(const String& file)
return String::formatted("{}/{}", serenity_sources_base, relative_path_builder.to_string());
}
-String HackStudioWidget::get_absolute_path(const String& path) const
+String HackStudioWidget::get_absolute_path(String const& path) const
{
// TODO: We can probably do a more specific condition here, something like
// "if (file.starts_with("../Libraries/") || file.starts_with("../AK/"))"
@@ -1048,7 +1048,7 @@ String HackStudioWidget::get_absolute_path(const String& path) const
return m_project->to_absolute_path(path);
}
-RefPtr<EditorWrapper> HackStudioWidget::get_editor_of_file(const String& filename)
+RefPtr<EditorWrapper> HackStudioWidget::get_editor_of_file(String const& filename)
{
String file_path = filename;
@@ -1261,7 +1261,7 @@ void HackStudioWidget::create_action_tab(GUI::Widget& parent)
m_disassembly_widget = m_action_tab_widget->add_tab<DisassemblyWidget>("Disassembly");
m_git_widget = m_action_tab_widget->add_tab<GitWidget>("Git", m_project->root_path());
- m_git_widget->set_view_diff_callback([this](const auto& original_content, const auto& diff) {
+ m_git_widget->set_view_diff_callback([this](auto const& original_content, auto const& diff) {
m_diff_viewer->set_content(original_content, diff);
set_edit_mode(EditMode::Diff);
});
@@ -1497,7 +1497,7 @@ void HackStudioWidget::update_statusbar()
m_statusbar->set_text(2, String::formatted("Ln {}, Col {}", current_editor().cursor().line() + 1, current_editor().cursor().column()));
}
-void HackStudioWidget::handle_external_file_deletion(const String& filepath)
+void HackStudioWidget::handle_external_file_deletion(String const& filepath)
{
close_file_in_all_editors(filepath);
}
@@ -1534,7 +1534,7 @@ HackStudioWidget::~HackStudioWidget()
stop_debugger_if_running();
}
-HackStudioWidget::ContinueDecision HackStudioWidget::warn_unsaved_changes(const String& prompt)
+HackStudioWidget::ContinueDecision HackStudioWidget::warn_unsaved_changes(String const& prompt)
{
if (!any_document_is_dirty())
return ContinueDecision::Yes;
diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.h b/Userland/DevTools/HackStudio/HackStudioWidget.h
index 29f76a148c..b8305e5f75 100644
--- a/Userland/DevTools/HackStudio/HackStudioWidget.h
+++ b/Userland/DevTools/HackStudio/HackStudioWidget.h
@@ -53,7 +53,7 @@ public:
GUI::TabWidget& current_editor_tab_widget();
GUI::TabWidget const& current_editor_tab_widget() const;
- const String& active_file() const { return m_current_editor_wrapper->filename(); }
+ String const& active_file() const { return m_current_editor_wrapper->filename(); }
void initialize_menubar(GUI::Window&);
Locator& locator()
@@ -66,7 +66,7 @@ public:
No,
Yes
};
- ContinueDecision warn_unsaved_changes(const String& prompt);
+ ContinueDecision warn_unsaved_changes(String const& prompt);
enum class Mode {
Code,
@@ -82,12 +82,12 @@ public:
private:
static constexpr size_t recent_projects_history_size = 15;
- static String get_full_path_of_serenity_source(const String& file);
+ static String get_full_path_of_serenity_source(String const& file);
String get_absolute_path(String const&) const;
Vector<String> selected_file_paths() const;
HackStudioWidget(String path_to_project);
- void open_project(const String& root_path);
+ void open_project(String const& root_path);
enum class EditMode {
Text,
@@ -124,7 +124,7 @@ private:
void add_new_editor_tab_widget(GUI::Widget& parent);
void add_new_editor(GUI::TabWidget& parent);
- RefPtr<EditorWrapper> get_editor_of_file(const String& filename);
+ RefPtr<EditorWrapper> get_editor_of_file(String const& filename);
String get_project_executable_path() const;
void on_action_tab_change();
@@ -132,7 +132,7 @@ private:
void initialize_debugger();
void update_statusbar();
- void handle_external_file_deletion(const String& filepath);
+ void handle_external_file_deletion(String const& filepath);
void stop_debugger_if_running();
void close_current_project();
diff --git a/Userland/DevTools/HackStudio/Language.cpp b/Userland/DevTools/HackStudio/Language.cpp
index f00c5bfc27..bc6fc82f34 100644
--- a/Userland/DevTools/HackStudio/Language.cpp
+++ b/Userland/DevTools/HackStudio/Language.cpp
@@ -9,7 +9,7 @@
namespace HackStudio {
-Language language_from_file(const LexicalPath& file)
+Language language_from_file(LexicalPath const& file)
{
if (file.title() == "COMMIT_EDITMSG")
return Language::GitCommit;
@@ -37,7 +37,7 @@ Language language_from_file(const LexicalPath& file)
return Language::Unknown;
}
-Language language_from_name(const String& name)
+Language language_from_name(String const& name)
{
if (name == "Cpp")
return Language::Cpp;
@@ -51,7 +51,7 @@ Language language_from_name(const String& name)
return Language::Unknown;
}
-String language_name_from_file(const LexicalPath& file)
+String language_name_from_file(LexicalPath const& file)
{
if (file.title() == "COMMIT_EDITMSG")
return "GitCommit";
diff --git a/Userland/DevTools/HackStudio/Language.h b/Userland/DevTools/HackStudio/Language.h
index 2ace198813..16a70d1d17 100644
--- a/Userland/DevTools/HackStudio/Language.h
+++ b/Userland/DevTools/HackStudio/Language.h
@@ -23,8 +23,8 @@ enum class Language {
SQL,
};
-Language language_from_file(const LexicalPath&);
-Language language_from_name(const String&);
-String language_name_from_file(const LexicalPath&);
+Language language_from_file(LexicalPath const&);
+Language language_from_name(String const&);
+String language_name_from_file(LexicalPath const&);
}
diff --git a/Userland/DevTools/HackStudio/LanguageClient.cpp b/Userland/DevTools/HackStudio/LanguageClient.cpp
index 75833bbc2d..42aa25e3a9 100644
--- a/Userland/DevTools/HackStudio/LanguageClient.cpp
+++ b/Userland/DevTools/HackStudio/LanguageClient.cpp
@@ -14,7 +14,7 @@
namespace HackStudio {
-void ConnectionToServer::auto_complete_suggestions(const Vector<GUI::AutocompleteProvider::Entry>& suggestions)
+void ConnectionToServer::auto_complete_suggestions(Vector<GUI::AutocompleteProvider::Entry> const& suggestions)
{
if (!m_current_language_client) {
dbgln("Language Server connection has no attached language client");
@@ -60,35 +60,35 @@ void ConnectionToServer::die()
m_wrapper->on_crash();
}
-void LanguageClient::open_file(const String& path, int fd)
+void LanguageClient::open_file(String const& path, int fd)
{
if (!m_connection_wrapper.connection())
return;
m_connection_wrapper.connection()->async_file_opened(path, fd);
}
-void LanguageClient::set_file_content(const String& path, const String& content)
+void LanguageClient::set_file_content(String const& path, String const& content)
{
if (!m_connection_wrapper.connection())
return;
m_connection_wrapper.connection()->async_set_file_content(path, content);
}
-void LanguageClient::insert_text(const String& path, const String& text, size_t line, size_t column)
+void LanguageClient::insert_text(String const& path, String const& text, size_t line, size_t column)
{
if (!m_connection_wrapper.connection())
return;
m_connection_wrapper.connection()->async_file_edit_insert_text(path, text, line, column);
}
-void LanguageClient::remove_text(const String& path, size_t from_line, size_t from_column, size_t to_line, size_t to_column)
+void LanguageClient::remove_text(String const& path, size_t from_line, size_t from_column, size_t to_line, size_t to_column)
{
if (!m_connection_wrapper.connection())
return;
m_connection_wrapper.connection()->async_file_edit_remove_text(path, from_line, from_column, to_line, to_column);
}
-void LanguageClient::request_autocomplete(const String& path, size_t cursor_line, size_t cursor_column)
+void LanguageClient::request_autocomplete(String const& path, size_t cursor_line, size_t cursor_column)
{
if (!m_connection_wrapper.connection())
return;
@@ -96,7 +96,7 @@ void LanguageClient::request_autocomplete(const String& path, size_t cursor_line
m_connection_wrapper.connection()->async_auto_complete_suggestions(GUI::AutocompleteProvider::ProjectLocation { path, cursor_line, cursor_column });
}
-void LanguageClient::provide_autocomplete_suggestions(const Vector<GUI::AutocompleteProvider::Entry>& suggestions) const
+void LanguageClient::provide_autocomplete_suggestions(Vector<GUI::AutocompleteProvider::Entry> const& suggestions) const
{
if (on_autocomplete_suggestions)
on_autocomplete_suggestions(suggestions);
@@ -120,7 +120,7 @@ bool LanguageClient::is_active_client() const
HashMap<String, NonnullOwnPtr<ConnectionToServerWrapper>> ConnectionToServerInstances::s_instance_for_language;
-void ConnectionToServer::declarations_in_document(const String& filename, const Vector<GUI::AutocompleteProvider::Declaration>& declarations)
+void ConnectionToServer::declarations_in_document(String const& filename, Vector<GUI::AutocompleteProvider::Declaration> const& declarations)
{
ProjectDeclarations::the().set_declared_symbols(filename, declarations);
}
@@ -130,7 +130,7 @@ void ConnectionToServer::todo_entries_in_document(String const& filename, Vector
ToDoEntries::the().set_entries(filename, move(todo_entries));
}
-void LanguageClient::search_declaration(const String& path, size_t line, size_t column)
+void LanguageClient::search_declaration(String const& path, size_t line, size_t column)
{
if (!m_connection_wrapper.connection())
return;
@@ -138,7 +138,7 @@ void LanguageClient::search_declaration(const String& path, size_t line, size_t
m_connection_wrapper.connection()->async_find_declaration(GUI::AutocompleteProvider::ProjectLocation { path, line, column });
}
-void LanguageClient::get_parameters_hint(const String& path, size_t line, size_t column)
+void LanguageClient::get_parameters_hint(String const& path, size_t line, size_t column)
{
if (!m_connection_wrapper.connection())
return;
@@ -146,7 +146,7 @@ void LanguageClient::get_parameters_hint(const String& path, size_t line, size_t
m_connection_wrapper.connection()->async_get_parameters_hint(GUI::AutocompleteProvider::ProjectLocation { path, line, column });
}
-void LanguageClient::get_tokens_info(const String& filename)
+void LanguageClient::get_tokens_info(String const& filename)
{
if (!m_connection_wrapper.connection())
return;
@@ -154,7 +154,7 @@ void LanguageClient::get_tokens_info(const String& filename)
m_connection_wrapper.connection()->async_get_tokens_info(filename);
}
-void LanguageClient::declaration_found(const String& file, size_t line, size_t column) const
+void LanguageClient::declaration_found(String const& file, size_t line, size_t column) const
{
if (!on_declaration_found) {
dbgln("on_declaration_found callback is not set");
@@ -172,17 +172,17 @@ void LanguageClient::parameters_hint_result(Vector<String> const& params, size_t
on_function_parameters_hint_result(params, argument_index);
}
-void ConnectionToServerInstances::set_instance_for_language(const String& language_name, NonnullOwnPtr<ConnectionToServerWrapper>&& connection_wrapper)
+void ConnectionToServerInstances::set_instance_for_language(String const& language_name, NonnullOwnPtr<ConnectionToServerWrapper>&& connection_wrapper)
{
s_instance_for_language.set(language_name, move(connection_wrapper));
}
-void ConnectionToServerInstances::remove_instance_for_language(const String& language_name)
+void ConnectionToServerInstances::remove_instance_for_language(String const& language_name)
{
s_instance_for_language.remove(language_name);
}
-ConnectionToServerWrapper* ConnectionToServerInstances::get_instance_wrapper(const String& language_name)
+ConnectionToServerWrapper* ConnectionToServerInstances::get_instance_wrapper(String const& language_name)
{
if (auto instance = s_instance_for_language.get(language_name); instance.has_value()) {
return const_cast<ConnectionToServerWrapper*>(instance.value());
@@ -223,7 +223,7 @@ void ConnectionToServerWrapper::show_crash_notification() const
notification->show();
}
-ConnectionToServerWrapper::ConnectionToServerWrapper(const String& language_name, Function<NonnullRefPtr<ConnectionToServer>()> connection_creator)
+ConnectionToServerWrapper::ConnectionToServerWrapper(String const& language_name, Function<NonnullRefPtr<ConnectionToServer>()> connection_creator)
: m_language(language_from_name(language_name))
, m_connection_creator(move(connection_creator))
{
@@ -267,7 +267,7 @@ void ConnectionToServerWrapper::try_respawn_connection()
// After respawning the language-server, we have to send the content of open project files
// so the server's FileDB will be up-to-date.
- for_each_open_file([this](const ProjectFile& file) {
+ for_each_open_file([this](ProjectFile const& file) {
if (file.code_document().language() != m_language)
return;
m_connection->async_set_file_content(file.code_document().file_path(), file.document().text());
diff --git a/Userland/DevTools/HackStudio/LanguageClient.h b/Userland/DevTools/HackStudio/LanguageClient.h
index e8a6600c73..9c9a6083ad 100644
--- a/Userland/DevTools/HackStudio/LanguageClient.h
+++ b/Userland/DevTools/HackStudio/LanguageClient.h
@@ -31,7 +31,7 @@ class ConnectionToServer
friend class ConnectionToServerWrapper;
public:
- ConnectionToServer(NonnullOwnPtr<Core::Stream::LocalSocket> socket, const String& project_path)
+ ConnectionToServer(NonnullOwnPtr<Core::Stream::LocalSocket> socket, String const& project_path)
: IPC::ConnectionToServer<LanguageClientEndpoint, LanguageServerEndpoint>(*this, move(socket))
{
m_project_path = project_path;
@@ -39,11 +39,11 @@ public:
}
WeakPtr<LanguageClient> language_client() { return m_current_language_client; }
- const String& project_path() const { return m_project_path; }
+ String const& project_path() const { return m_project_path; }
virtual void die() override;
- const LanguageClient* active_client() const { return !m_current_language_client ? nullptr : m_current_language_client.ptr(); }
+ LanguageClient const* active_client() const { return !m_current_language_client ? nullptr : m_current_language_client.ptr(); }
protected:
virtual void auto_complete_suggestions(Vector<GUI::AutocompleteProvider::Entry> const&) override;
@@ -63,11 +63,11 @@ class ConnectionToServerWrapper {
AK_MAKE_NONCOPYABLE(ConnectionToServerWrapper);
public:
- explicit ConnectionToServerWrapper(const String& language_name, Function<NonnullRefPtr<ConnectionToServer>()> connection_creator);
+ explicit ConnectionToServerWrapper(String const& language_name, Function<NonnullRefPtr<ConnectionToServer>()> connection_creator);
~ConnectionToServerWrapper() = default;
template<typename LanguageServerType>
- static ConnectionToServerWrapper& get_or_create(const String& project_path);
+ static ConnectionToServerWrapper& get_or_create(String const& project_path);
Language language() const { return m_language; }
ConnectionToServer* connection();
@@ -93,10 +93,10 @@ private:
class ConnectionToServerInstances {
public:
- static void set_instance_for_language(const String& language_name, NonnullOwnPtr<ConnectionToServerWrapper>&& connection_wrapper);
- static void remove_instance_for_language(const String& language_name);
+ static void set_instance_for_language(String const& language_name, NonnullOwnPtr<ConnectionToServerWrapper>&& connection_wrapper);
+ static void remove_instance_for_language(String const& language_name);
- static ConnectionToServerWrapper* get_instance_wrapper(const String& language_name);
+ static ConnectionToServerWrapper* get_instance_wrapper(String const& language_name);
private:
static HashMap<String, NonnullOwnPtr<ConnectionToServerWrapper>> s_instance_for_language;
@@ -128,22 +128,22 @@ public:
Language language() const { return m_connection_wrapper.language(); }
void set_active_client();
bool is_active_client() const;
- virtual void open_file(const String& path, int fd);
- virtual void set_file_content(const String& path, const String& content);
- virtual void insert_text(const String& path, const String& text, size_t line, size_t column);
- virtual void remove_text(const String& path, size_t from_line, size_t from_column, size_t to_line, size_t to_column);
- virtual void request_autocomplete(const String& path, size_t cursor_line, size_t cursor_column);
- virtual void search_declaration(const String& path, size_t line, size_t column);
- virtual void get_parameters_hint(const String& path, size_t line, size_t column);
- virtual void get_tokens_info(const String& filename);
-
- void provide_autocomplete_suggestions(const Vector<GUI::AutocompleteProvider::Entry>&) const;
- void declaration_found(const String& file, size_t line, size_t column) const;
+ virtual void open_file(String const& path, int fd);
+ virtual void set_file_content(String const& path, String const& content);
+ virtual void insert_text(String const& path, String const& text, size_t line, size_t column);
+ virtual void remove_text(String const& path, size_t from_line, size_t from_column, size_t to_line, size_t to_column);
+ virtual void request_autocomplete(String const& path, size_t cursor_line, size_t cursor_column);
+ virtual void search_declaration(String const& path, size_t line, size_t column);
+ virtual void get_parameters_hint(String const& path, size_t line, size_t column);
+ virtual void get_tokens_info(String const& filename);
+
+ void provide_autocomplete_suggestions(Vector<GUI::AutocompleteProvider::Entry> const&) const;
+ void declaration_found(String const& file, size_t line, size_t column) const;
void parameters_hint_result(Vector<String> const& params, size_t argument_index) const;
// Callbacks that get called when the result of a language server query is ready
Function<void(Vector<GUI::AutocompleteProvider::Entry>)> on_autocomplete_suggestions;
- Function<void(const String&, size_t, size_t)> on_declaration_found;
+ Function<void(String const&, size_t, size_t)> on_declaration_found;
Function<void(Vector<String> const&, size_t)> on_function_parameters_hint_result;
Function<void(Vector<GUI::AutocompleteProvider::TokenInfo> const&)> on_tokens_info_result;
@@ -153,13 +153,13 @@ private:
};
template<typename ConnectionToServerT>
-static inline NonnullOwnPtr<LanguageClient> get_language_client(const String& project_path)
+static inline NonnullOwnPtr<LanguageClient> get_language_client(String const& project_path)
{
return make<LanguageClient>(ConnectionToServerWrapper::get_or_create<ConnectionToServerT>(project_path));
}
template<typename LanguageServerType>
-ConnectionToServerWrapper& ConnectionToServerWrapper::get_or_create(const String& project_path)
+ConnectionToServerWrapper& ConnectionToServerWrapper::get_or_create(String const& project_path)
{
auto* wrapper = ConnectionToServerInstances::get_instance_wrapper(LanguageServerType::language_name());
if (wrapper)
diff --git a/Userland/DevTools/HackStudio/LanguageClients/ConnectionsToServer.h b/Userland/DevTools/HackStudio/LanguageClients/ConnectionsToServer.h
index ad430f6eca..97a642410e 100644
--- a/Userland/DevTools/HackStudio/LanguageClients/ConnectionsToServer.h
+++ b/Userland/DevTools/HackStudio/LanguageClients/ConnectionsToServer.h
@@ -17,10 +17,10 @@
class ConnectionToServer final : public HackStudio::ConnectionToServer { \
IPC_CLIENT_CONNECTION(ConnectionToServer, "/tmp/portal/language/" #socket_name) \
public: \
- static const char* language_name() { return #language_name_; } \
+ static char const* language_name() { return #language_name_; } \
\
private: \
- ConnectionToServer(NonnullOwnPtr<Core::Stream::LocalSocket> socket, const String& project_path) \
+ ConnectionToServer(NonnullOwnPtr<Core::Stream::LocalSocket> socket, String const& project_path) \
: HackStudio::ConnectionToServer(move(socket), project_path) \
{ \
} \
diff --git a/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.cpp b/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.cpp
index 044aae97ab..381a918b59 100644
--- a/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.cpp
+++ b/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.cpp
@@ -9,13 +9,13 @@
namespace LanguageServers {
-CodeComprehensionEngine::CodeComprehensionEngine(const FileDB& filedb, bool should_store_all_declarations)
+CodeComprehensionEngine::CodeComprehensionEngine(FileDB const& filedb, bool should_store_all_declarations)
: m_filedb(filedb)
, m_store_all_declarations(should_store_all_declarations)
{
}
-void CodeComprehensionEngine::set_declarations_of_document(const String& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations)
+void CodeComprehensionEngine::set_declarations_of_document(String const& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations)
{
// Callback may not be configured if we're running tests
if (!set_declarations_of_document_callback)
diff --git a/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.h b/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.h
index 7a9f0db06d..ddca934520 100644
--- a/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.h
+++ b/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.h
@@ -18,38 +18,38 @@ class ConnectionFromClient;
class CodeComprehensionEngine {
public:
- CodeComprehensionEngine(const FileDB& filedb, bool store_all_declarations = false);
+ CodeComprehensionEngine(FileDB const& filedb, bool store_all_declarations = false);
virtual ~CodeComprehensionEngine() = default;
- virtual Vector<GUI::AutocompleteProvider::Entry> get_suggestions(const String& file, const GUI::TextPosition& autocomplete_position) = 0;
+ virtual Vector<GUI::AutocompleteProvider::Entry> get_suggestions(String const& file, const GUI::TextPosition& autocomplete_position) = 0;
// TODO: In the future we can pass the range that was edited and only re-parse what we have to.
- virtual void on_edit([[maybe_unused]] const String& file) {};
- virtual void file_opened([[maybe_unused]] const String& file) {};
+ virtual void on_edit([[maybe_unused]] String const& file) {};
+ virtual void file_opened([[maybe_unused]] String const& file) {};
- virtual Optional<GUI::AutocompleteProvider::ProjectLocation> find_declaration_of(const String&, const GUI::TextPosition&) { return {}; }
+ virtual Optional<GUI::AutocompleteProvider::ProjectLocation> find_declaration_of(String const&, const GUI::TextPosition&) { return {}; }
struct FunctionParamsHint {
Vector<String> params;
size_t current_index { 0 };
};
- virtual Optional<FunctionParamsHint> get_function_params_hint(const String&, const GUI::TextPosition&) { return {}; }
+ virtual Optional<FunctionParamsHint> get_function_params_hint(String const&, const GUI::TextPosition&) { return {}; }
- virtual Vector<GUI::AutocompleteProvider::TokenInfo> get_tokens_info(const String&) { return {}; }
+ virtual Vector<GUI::AutocompleteProvider::TokenInfo> get_tokens_info(String const&) { return {}; }
public:
- Function<void(const String&, Vector<GUI::AutocompleteProvider::Declaration>&&)> set_declarations_of_document_callback;
+ Function<void(String const&, Vector<GUI::AutocompleteProvider::Declaration>&&)> set_declarations_of_document_callback;
Function<void(String const&, Vector<Cpp::Parser::TodoEntry>&&)> set_todo_entries_of_document_callback;
protected:
- const FileDB& filedb() const { return m_filedb; }
- void set_declarations_of_document(const String&, Vector<GUI::AutocompleteProvider::Declaration>&&);
+ FileDB const& filedb() const { return m_filedb; }
+ void set_declarations_of_document(String const&, Vector<GUI::AutocompleteProvider::Declaration>&&);
void set_todo_entries_of_document(String const&, Vector<Cpp::Parser::TodoEntry>&&);
- const HashMap<String, Vector<GUI::AutocompleteProvider::Declaration>>& all_declarations() const { return m_all_declarations; }
+ HashMap<String, Vector<GUI::AutocompleteProvider::Declaration>> const& all_declarations() const { return m_all_declarations; }
private:
HashMap<String, Vector<GUI::AutocompleteProvider::Declaration>> m_all_declarations;
- const FileDB& m_filedb;
+ FileDB const& m_filedb;
bool m_store_all_declarations { false };
};
}
diff --git a/Userland/DevTools/HackStudio/LanguageServers/Cpp/ConnectionFromClient.h b/Userland/DevTools/HackStudio/LanguageServers/Cpp/ConnectionFromClient.h
index 91a34958f2..ff5744c369 100644
--- a/Userland/DevTools/HackStudio/LanguageServers/Cpp/ConnectionFromClient.h
+++ b/Userland/DevTools/HackStudio/LanguageServers/Cpp/ConnectionFromClient.h
@@ -19,7 +19,7 @@ private:
: LanguageServers::ConnectionFromClient(move(socket))
{
m_autocomplete_engine = make<CppComprehensionEngine>(m_filedb);
- m_autocomplete_engine->set_declarations_of_document_callback = [this](const String& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations) {
+ m_autocomplete_engine->set_declarations_of_document_callback = [this](String const& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations) {
async_declarations_in_document(filename, move(declarations));
};
m_autocomplete_engine->set_todo_entries_of_document_callback = [this](String const& filename, Vector<Cpp::Parser::TodoEntry>&& todo_entries) {
diff --git a/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.cpp b/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.cpp
index 4485f2b3c1..4abfdc7861 100644
--- a/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.cpp
+++ b/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.cpp
@@ -20,12 +20,12 @@
namespace LanguageServers::Cpp {
-CppComprehensionEngine::CppComprehensionEngine(const FileDB& filedb)
+CppComprehensionEngine::CppComprehensionEngine(FileDB const& filedb)
: CodeComprehensionEngine(filedb, true)
{
}
-const CppComprehensionEngine::DocumentData* CppComprehensionEngine::get_or_create_document_data(const String& file)
+CppComprehensionEngine::DocumentData const* CppComprehensionEngine::get_or_create_document_data(String const& file)
{
auto absolute_path = filedb().to_absolute_path(file);
if (!m_documents.contains(absolute_path)) {
@@ -34,7 +34,7 @@ const CppComprehensionEngine::DocumentData* CppComprehensionEngine::get_or_creat
return get_document_data(absolute_path);
}
-const CppComprehensionEngine::DocumentData* CppComprehensionEngine::get_document_data(const String& file) const
+CppComprehensionEngine::DocumentData const* CppComprehensionEngine::get_document_data(String const& file) const
{
auto absolute_path = filedb().to_absolute_path(file);
auto document_data = m_documents.get(absolute_path);
@@ -43,7 +43,7 @@ const CppComprehensionEngine::DocumentData* CppComprehensionEngine::get_document
return document_data.value();
}
-OwnPtr<CppComprehensionEngine::DocumentData> CppComprehensionEngine::create_document_data_for(const String& file)
+OwnPtr<CppComprehensionEngine::DocumentData> CppComprehensionEngine::create_document_data_for(String const& file)
{
if (m_unfinished_documents.contains(file)) {
return {};
@@ -56,22 +56,22 @@ OwnPtr<CppComprehensionEngine::DocumentData> CppComprehensionEngine::create_docu
return create_document_data(document->text(), file);
}
-void CppComprehensionEngine::set_document_data(const String& file, OwnPtr<DocumentData>&& data)
+void CppComprehensionEngine::set_document_data(String const& file, OwnPtr<DocumentData>&& data)
{
m_documents.set(filedb().to_absolute_path(file), move(data));
}
-Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::get_suggestions(const String& file, const GUI::TextPosition& autocomplete_position)
+Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::get_suggestions(String const& file, const GUI::TextPosition& autocomplete_position)
{
Cpp::Position position { autocomplete_position.line(), autocomplete_position.column() > 0 ? autocomplete_position.column() - 1 : 0 };
dbgln_if(CPP_LANGUAGE_SERVER_DEBUG, "CppComprehensionEngine position {}:{}", position.line, position.column);
- const auto* document_ptr = get_or_create_document_data(file);
+ auto const* document_ptr = get_or_create_document_data(file);
if (!document_ptr)
return {};
- const auto& document = *document_ptr;
+ auto const& document = *document_ptr;
auto containing_token = document.parser().token_at(position);
if (containing_token.has_value() && containing_token->type() == Token::Type::IncludePath) {
@@ -102,7 +102,7 @@ Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::get_suggestions
return {};
}
-Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_autocomplete_name(const DocumentData& document, const ASTNode& node, Optional<Token> containing_token) const
+Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_autocomplete_name(DocumentData const& document, ASTNode const& node, Optional<Token> containing_token) const
{
auto partial_text = String::empty();
if (containing_token.has_value() && containing_token.value().type() != Token::Type::ColonColon) {
@@ -111,7 +111,7 @@ Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_a
return autocomplete_name(document, node, partial_text);
}
-Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_autocomplete_property(const DocumentData& document, const ASTNode& node, Optional<Token> containing_token) const
+Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_autocomplete_property(DocumentData const& document, ASTNode const& node, Optional<Token> containing_token) const
{
if (!containing_token.has_value())
return {};
@@ -119,7 +119,7 @@ Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_a
if (!node.parent()->is_member_expression())
return {};
- const auto& parent = static_cast<const MemberExpression&>(*node.parent());
+ auto const& parent = static_cast<MemberExpression const&>(*node.parent());
auto partial_text = String::empty();
if (containing_token.value().type() != Token::Type::Dot) {
@@ -131,12 +131,12 @@ Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_a
return autocomplete_property(document, parent, partial_text);
}
-Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::autocomplete_name(const DocumentData& document, const ASTNode& node, const String& partial_text) const
+Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::autocomplete_name(DocumentData const& document, ASTNode const& node, String const& partial_text) const
{
auto reference_scope = scope_of_reference_to_symbol(node);
auto current_scope = scope_of_node(node);
- auto symbol_matches = [&](const Symbol& symbol) {
+ auto symbol_matches = [&](Symbol const& symbol) {
if (!is_symbol_available(symbol, current_scope, reference_scope)) {
return false;
}
@@ -156,7 +156,7 @@ Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::autocomplete_na
Vector<Symbol> matches;
- for_each_available_symbol(document, [&](const Symbol& symbol) {
+ for_each_available_symbol(document, [&](Symbol const& symbol) {
if (symbol_matches(symbol)) {
matches.append(symbol);
}
@@ -179,17 +179,17 @@ Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::autocomplete_na
return suggestions;
}
-Vector<StringView> CppComprehensionEngine::scope_of_reference_to_symbol(const ASTNode& node) const
+Vector<StringView> CppComprehensionEngine::scope_of_reference_to_symbol(ASTNode const& node) const
{
- const Name* name = nullptr;
+ Name const* name = nullptr;
if (node.is_name()) {
// FIXME It looks like this code path is never taken
- name = reinterpret_cast<const Name*>(&node);
+ name = reinterpret_cast<Name const*>(&node);
} else if (node.is_identifier()) {
auto* parent = node.parent();
if (!(parent && parent->is_name()))
return {};
- name = reinterpret_cast<const Name*>(parent);
+ name = reinterpret_cast<Name const*>(parent);
} else {
return {};
}
@@ -206,7 +206,7 @@ Vector<StringView> CppComprehensionEngine::scope_of_reference_to_symbol(const AS
return scope_parts;
}
-Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::autocomplete_property(const DocumentData& document, const MemberExpression& parent, const String partial_text) const
+Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::autocomplete_property(DocumentData const& document, MemberExpression const& parent, const String partial_text) const
{
VERIFY(parent.object());
auto type = type_of(document, *parent.object());
@@ -224,7 +224,7 @@ Vector<GUI::AutocompleteProvider::Entry> CppComprehensionEngine::autocomplete_pr
return suggestions;
}
-bool CppComprehensionEngine::is_property(const ASTNode& node) const
+bool CppComprehensionEngine::is_property(ASTNode const& node) const
{
if (!node.parent()->is_member_expression())
return false;
@@ -233,7 +233,7 @@ bool CppComprehensionEngine::is_property(const ASTNode& node) const
return parent.property() == &node;
}
-String CppComprehensionEngine::type_of_property(const DocumentData& document, const Identifier& identifier) const
+String CppComprehensionEngine::type_of_property(DocumentData const& document, Identifier const& identifier) const
{
auto& parent = verify_cast<MemberExpression>(*identifier.parent());
VERIFY(parent.object());
@@ -241,7 +241,7 @@ String CppComprehensionEngine::type_of_property(const DocumentData& document, co
for (auto& prop : properties) {
if (prop.name.name != identifier.name())
continue;
- const Type* type { nullptr };
+ Type const* type { nullptr };
if (prop.declaration->is_variable_declaration()) {
type = verify_cast<VariableDeclaration>(*prop.declaration).type();
}
@@ -258,9 +258,9 @@ String CppComprehensionEngine::type_of_property(const DocumentData& document, co
return {};
}
-String CppComprehensionEngine::type_of_variable(const Identifier& identifier) const
+String CppComprehensionEngine::type_of_variable(Identifier const& identifier) const
{
- const ASTNode* current = &identifier;
+ ASTNode const* current = &identifier;
while (current) {
for (auto& decl : current->declarations()) {
if (decl.is_variable_or_parameter_declaration()) {
@@ -278,21 +278,21 @@ String CppComprehensionEngine::type_of_variable(const Identifier& identifier) co
return {};
}
-String CppComprehensionEngine::type_of(const DocumentData& document, const Expression& expression) const
+String CppComprehensionEngine::type_of(DocumentData const& document, Expression const& expression) const
{
if (expression.is_member_expression()) {
auto& member_expression = verify_cast<MemberExpression>(expression);
VERIFY(member_expression.property());
if (member_expression.property()->is_identifier())
- return type_of_property(document, static_cast<const Identifier&>(*member_expression.property()));
+ return type_of_property(document, static_cast<Identifier const&>(*member_expression.property()));
return {};
}
- const Identifier* identifier { nullptr };
+ Identifier const* identifier { nullptr };
if (expression.is_name()) {
- identifier = static_cast<const Name&>(expression).name();
+ identifier = static_cast<Name const&>(expression).name();
} else if (expression.is_identifier()) {
- identifier = &static_cast<const Identifier&>(expression);
+ identifier = &static_cast<Identifier const&>(expression);
} else {
dbgln("expected identifier or name, got: {}", expression.class_name());
VERIFY_NOT_REACHED(); // TODO
@@ -304,7 +304,7 @@ String CppComprehensionEngine::type_of(const DocumentData& document, const Expre
return type_of_variable(*identifier);
}
-Vector<CppComprehensionEngine::Symbol> CppComprehensionEngine::properties_of_type(const DocumentData& document, const String& type) const
+Vector<CppComprehensionEngine::Symbol> CppComprehensionEngine::properties_of_type(DocumentData const& document, String const& type) const
{
auto type_symbol = SymbolName::create(type);
auto decl = find_declaration_of(document, type_symbol);
@@ -331,17 +331,17 @@ Vector<CppComprehensionEngine::Symbol> CppComprehensionEngine::properties_of_typ
return properties;
}
-CppComprehensionEngine::Symbol CppComprehensionEngine::Symbol::create(StringView name, const Vector<StringView>& scope, NonnullRefPtr<Declaration> declaration, IsLocal is_local)
+CppComprehensionEngine::Symbol CppComprehensionEngine::Symbol::create(StringView name, Vector<StringView> const& scope, NonnullRefPtr<Declaration> declaration, IsLocal is_local)
{
return { { name, scope }, move(declaration), is_local == IsLocal::Yes };
}
-Vector<CppComprehensionEngine::Symbol> CppComprehensionEngine::get_child_symbols(const ASTNode& node) const
+Vector<CppComprehensionEngine::Symbol> CppComprehensionEngine::get_child_symbols(ASTNode const& node) const
{
return get_child_symbols(node, {}, Symbol::IsLocal::No);
}
-Vector<CppComprehensionEngine::Symbol> CppComprehensionEngine::get_child_symbols(const ASTNode& node, const Vector<StringView>& scope, Symbol::IsLocal is_local) const
+Vector<CppComprehensionEngine::Symbol> CppComprehensionEngine::get_child_symbols(ASTNode const& node, Vector<StringView> const& scope, Symbol::IsLocal is_local) const
{
Vector<Symbol> symbols;
@@ -391,23 +391,23 @@ String CppComprehensionEngine::document_path_from_include_path(StringView includ
return result;
}
-void CppComprehensionEngine::on_edit(const String& file)
+void CppComprehensionEngine::on_edit(String const& file)
{
set_document_data(file, create_document_data_for(file));
}
-void CppComprehensionEngine::file_opened([[maybe_unused]] const String& file)
+void CppComprehensionEngine::file_opened([[maybe_unused]] String const& file)
{
get_or_create_document_data(file);
}
-Optional<GUI::AutocompleteProvider::ProjectLocation> CppComprehensionEngine::find_declaration_of(const String& filename, const GUI::TextPosition& identifier_position)
+Optional<GUI::AutocompleteProvider::ProjectLocation> CppComprehensionEngine::find_declaration_of(String const& filename, const GUI::TextPosition& identifier_position)
{
- const auto* document_ptr = get_or_create_document_data(filename);
+ auto const* document_ptr = get_or_create_document_data(filename);
if (!document_ptr)
return {};
- const auto& document = *document_ptr;
+ auto const& document = *document_ptr;
auto decl = find_declaration_of(document, identifier_position);
if (decl) {
return GUI::AutocompleteProvider::ProjectLocation { decl->filename(), decl->start().line, decl->start().column };
@@ -416,7 +416,7 @@ Optional<GUI::AutocompleteProvider::ProjectLocation> CppComprehensionEngine::fin
return find_preprocessor_definition(document, identifier_position);
}
-RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(const DocumentData& document, const GUI::TextPosition& identifier_position)
+RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(DocumentData const& document, const GUI::TextPosition& identifier_position)
{
auto node = document.parser().node_at(Cpp::Position { identifier_position.line(), identifier_position.column() });
if (!node) {
@@ -426,7 +426,7 @@ RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(const DocumentDa
return find_declaration_of(document, *node);
}
-Optional<GUI::AutocompleteProvider::ProjectLocation> CppComprehensionEngine::find_preprocessor_definition(const DocumentData& document, const GUI::TextPosition& text_position)
+Optional<GUI::AutocompleteProvider::ProjectLocation> CppComprehensionEngine::find_preprocessor_definition(DocumentData const& document, const GUI::TextPosition& text_position)
{
Position cpp_position { text_position.line(), text_position.column() };
auto substitution = find_preprocessor_substitution(document, cpp_position);
@@ -459,11 +459,11 @@ struct TargetDeclaration {
String name;
};
-static Optional<TargetDeclaration> get_target_declaration(const ASTNode& node, String name);
-static Optional<TargetDeclaration> get_target_declaration(const ASTNode& node)
+static Optional<TargetDeclaration> get_target_declaration(ASTNode const& node, String name);
+static Optional<TargetDeclaration> get_target_declaration(ASTNode const& node)
{
if (node.is_identifier()) {
- return get_target_declaration(node, static_cast<const Identifier&>(node).name());
+ return get_target_declaration(node, static_cast<Identifier const&>(node).name());
}
if (node.is_declaration()) {
@@ -478,7 +478,7 @@ static Optional<TargetDeclaration> get_target_declaration(const ASTNode& node)
return {};
}
-static Optional<TargetDeclaration> get_target_declaration(const ASTNode& node, String name)
+static Optional<TargetDeclaration> get_target_declaration(ASTNode const& node, String name)
{
if (node.parent() && node.parent()->is_name()) {
auto& name_node = *verify_cast<Name>(node.parent());
@@ -509,7 +509,7 @@ static Optional<TargetDeclaration> get_target_declaration(const ASTNode& node, S
return TargetDeclaration { TargetDeclaration::Type::Variable, name };
}
-RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(const DocumentData& document_data, const ASTNode& node) const
+RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(DocumentData const& document_data, ASTNode const& node) const
{
dbgln_if(CPP_LANGUAGE_SERVER_DEBUG, "find_declaration_of: {} ({})", document_data.parser().text_of_node(node), node.class_name());
@@ -520,7 +520,7 @@ RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(const DocumentDa
auto reference_scope = scope_of_reference_to_symbol(node);
auto current_scope = scope_of_node(node);
- auto symbol_matches = [&](const Symbol& symbol) {
+ auto symbol_matches = [&](Symbol const& symbol) {
bool match_function = target_decl.value().type == TargetDeclaration::Function && symbol.declaration->is_function();
bool match_variable = target_decl.value().type == TargetDeclaration::Variable && symbol.declaration->is_variable_declaration();
bool match_type = target_decl.value().type == TargetDeclaration::Type && (symbol.declaration->is_struct_or_class() || symbol.declaration->is_enum());
@@ -558,7 +558,7 @@ RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(const DocumentDa
Optional<Symbol> match;
- for_each_available_symbol(document_data, [&](const Symbol& symbol) {
+ for_each_available_symbol(document_data, [&](Symbol const& symbol) {
if (symbol_matches(symbol)) {
match = symbol;
return IterationDecision::Break;
@@ -595,7 +595,7 @@ void CppComprehensionEngine::update_todo_entries(DocumentData& document)
set_todo_entries_of_document(document.filename(), document.parser().get_todo_entries());
}
-GUI::AutocompleteProvider::DeclarationType CppComprehensionEngine::type_of_declaration(const Declaration& decl)
+GUI::AutocompleteProvider::DeclarationType CppComprehensionEngine::type_of_declaration(Declaration const& decl)
{
if (decl.is_struct())
return GUI::AutocompleteProvider::DeclarationType::Struct;
@@ -612,7 +612,7 @@ GUI::AutocompleteProvider::DeclarationType CppComprehensionEngine::type_of_decla
return GUI::AutocompleteProvider::DeclarationType::Variable;
}
-OwnPtr<CppComprehensionEngine::DocumentData> CppComprehensionEngine::create_document_data(String&& text, const String& filename)
+OwnPtr<CppComprehensionEngine::DocumentData> CppComprehensionEngine::create_document_data(String&& text, String const& filename)
{
auto document_data = make<DocumentData>();
document_data->m_filename = filename;
@@ -657,7 +657,7 @@ OwnPtr<CppComprehensionEngine::DocumentData> CppComprehensionEngine::create_docu
return document_data;
}
-Vector<StringView> CppComprehensionEngine::scope_of_node(const ASTNode& node) const
+Vector<StringView> CppComprehensionEngine::scope_of_node(ASTNode const& node) const
{
auto parent = node.parent();
@@ -683,7 +683,7 @@ Vector<StringView> CppComprehensionEngine::scope_of_node(const ASTNode& node) co
return parent_scope;
}
-Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_autocomplete_include(const DocumentData&, Token include_path_token, Cpp::Position const& cursor_position) const
+Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_autocomplete_include(DocumentData const&, Token include_path_token, Cpp::Position const& cursor_position) const
{
VERIFY(include_path_token.type() == Token::Type::IncludePath);
auto partial_include = include_path_token.text().trim_whitespace();
@@ -751,10 +751,10 @@ Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_a
return options;
}
-RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(const CppComprehensionEngine::DocumentData& document, const CppComprehensionEngine::SymbolName& target_symbol_name) const
+RefPtr<Declaration> CppComprehensionEngine::find_declaration_of(CppComprehensionEngine::DocumentData const& document, CppComprehensionEngine::SymbolName const& target_symbol_name) const
{
RefPtr<Declaration> target_declaration;
- for_each_available_symbol(document, [&](const Symbol& symbol) {
+ for_each_available_symbol(document, [&](Symbol const& symbol) {
if (symbol.name == target_symbol_name) {
target_declaration = symbol.declaration;
return IterationDecision::Break;
@@ -797,7 +797,7 @@ String CppComprehensionEngine::SymbolName::to_string() const
return String::formatted("{}::{}", scope_as_string(), name);
}
-bool CppComprehensionEngine::is_symbol_available(const Symbol& symbol, const Vector<StringView>& current_scope, const Vector<StringView>& reference_scope)
+bool CppComprehensionEngine::is_symbol_available(Symbol const& symbol, Vector<StringView> const& current_scope, Vector<StringView> const& reference_scope)
{
if (!reference_scope.is_empty()) {
@@ -818,13 +818,13 @@ bool CppComprehensionEngine::is_symbol_available(const Symbol& symbol, const Vec
return true;
}
-Optional<CodeComprehensionEngine::FunctionParamsHint> CppComprehensionEngine::get_function_params_hint(const String& filename, const GUI::TextPosition& identifier_position)
+Optional<CodeComprehensionEngine::FunctionParamsHint> CppComprehensionEngine::get_function_params_hint(String const& filename, const GUI::TextPosition& identifier_position)
{
- const auto* document_ptr = get_or_create_document_data(filename);
+ auto const* document_ptr = get_or_create_document_data(filename);
if (!document_ptr)
return {};
- const auto& document = *document_ptr;
+ auto const& document = *document_ptr;
Cpp::Position cpp_position { identifier_position.line(), identifier_position.column() };
auto node = document.parser().node_at(cpp_position);
if (!node) {
@@ -883,7 +883,7 @@ Optional<CppComprehensionEngine::FunctionParamsHint> CppComprehensionEngine::get
FunctionCall& call_node,
size_t argument_index)
{
- const Identifier* callee = nullptr;
+ Identifier const* callee = nullptr;
VERIFY(call_node.callee());
if (call_node.callee()->is_identifier()) {
callee = verify_cast<Identifier>(call_node.callee());
@@ -929,15 +929,15 @@ Optional<CppComprehensionEngine::FunctionParamsHint> CppComprehensionEngine::get
return hint;
}
-Vector<GUI::AutocompleteProvider::TokenInfo> CppComprehensionEngine::get_tokens_info(const String& filename)
+Vector<GUI::AutocompleteProvider::TokenInfo> CppComprehensionEngine::get_tokens_info(String const& filename)
{
dbgln_if(CPP_LANGUAGE_SERVER_DEBUG, "CppComprehensionEngine::get_tokens_info: {}", filename);
- const auto* document_ptr = get_or_create_document_data(filename);
+ auto const* document_ptr = get_or_create_document_data(filename);
if (!document_ptr)
return {};
- const auto& document = *document_ptr;
+ auto const& document = *document_ptr;
Vector<GUI::AutocompleteProvider::TokenInfo> tokens_info;
size_t i = 0;
diff --git a/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.h b/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.h
index 91eb1f1b64..0473480d1d 100644
--- a/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.h
+++ b/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.h
@@ -23,14 +23,14 @@ using namespace ::Cpp;
class CppComprehensionEngine : public CodeComprehensionEngine {
public:
- CppComprehensionEngine(const FileDB& filedb);
+ CppComprehensionEngine(FileDB const& filedb);
- virtual Vector<GUI::AutocompleteProvider::Entry> get_suggestions(const String& file, const GUI::TextPosition& autocomplete_position) override;
- virtual void on_edit(const String& file) override;
- virtual void file_opened([[maybe_unused]] const String& file) override;
- virtual Optional<GUI::AutocompleteProvider::ProjectLocation> find_declaration_of(const String& filename, const GUI::TextPosition& identifier_position) override;
- virtual Optional<FunctionParamsHint> get_function_params_hint(const String&, const GUI::TextPosition&) override;
- virtual Vector<GUI::AutocompleteProvider::TokenInfo> get_tokens_info(const String& filename) override;
+ virtual Vector<GUI::AutocompleteProvider::Entry> get_suggestions(String const& file, const GUI::TextPosition& autocomplete_position) override;
+ virtual void on_edit(String const& file) override;
+ virtual void file_opened([[maybe_unused]] String const& file) override;
+ virtual Optional<GUI::AutocompleteProvider::ProjectLocation> find_declaration_of(String const& filename, const GUI::TextPosition& identifier_position) override;
+ virtual Optional<FunctionParamsHint> get_function_params_hint(String const&, const GUI::TextPosition&) override;
+ virtual Vector<GUI::AutocompleteProvider::TokenInfo> get_tokens_info(String const& filename) override;
private:
struct SymbolName {
@@ -42,7 +42,7 @@ private:
String scope_as_string() const;
String to_string() const;
- bool operator==(const SymbolName&) const = default;
+ bool operator==(SymbolName const&) const = default;
};
struct Symbol {
@@ -57,15 +57,15 @@ private:
No,
Yes
};
- static Symbol create(StringView name, const Vector<StringView>& scope, NonnullRefPtr<Declaration>, IsLocal is_local);
+ static Symbol create(StringView name, Vector<StringView> const& scope, NonnullRefPtr<Declaration>, IsLocal is_local);
};
friend Traits<SymbolName>;
struct DocumentData {
- const String& filename() const { return m_filename; }
- const String& text() const { return m_text; }
- const Preprocessor& preprocessor() const
+ String const& filename() const { return m_filename; }
+ String const& text() const { return m_text; }
+ Preprocessor const& preprocessor() const
{
VERIFY(m_preprocessor);
return *m_preprocessor;
@@ -75,7 +75,7 @@ private:
VERIFY(m_preprocessor);
return *m_preprocessor;
}
- const Parser& parser() const
+ Parser const& parser() const
{
VERIFY(m_parser);
return *m_parser;
@@ -95,52 +95,52 @@ private:
HashTable<String> m_available_headers;
};
- Vector<GUI::AutocompleteProvider::Entry> autocomplete_property(const DocumentData&, const MemberExpression&, const String partial_text) const;
- Vector<GUI::AutocompleteProvider::Entry> autocomplete_name(const DocumentData&, const ASTNode&, const String& partial_text) const;
- String type_of(const DocumentData&, const Expression&) const;
- String type_of_property(const DocumentData&, const Identifier&) const;
- String type_of_variable(const Identifier&) const;
- bool is_property(const ASTNode&) const;
- RefPtr<Declaration> find_declaration_of(const DocumentData&, const ASTNode&) const;
- RefPtr<Declaration> find_declaration_of(const DocumentData&, const SymbolName&) const;
- RefPtr<Declaration> find_declaration_of(const DocumentData&, const GUI::TextPosition& identifier_position);
+ Vector<GUI::AutocompleteProvider::Entry> autocomplete_property(DocumentData const&, MemberExpression const&, const String partial_text) const;
+ Vector<GUI::AutocompleteProvider::Entry> autocomplete_name(DocumentData const&, ASTNode const&, String const& partial_text) const;
+ String type_of(DocumentData const&, Expression const&) const;
+ String type_of_property(DocumentData const&, Identifier const&) const;
+ String type_of_variable(Identifier const&) const;
+ bool is_property(ASTNode const&) const;
+ RefPtr<Declaration> find_declaration_of(DocumentData const&, ASTNode const&) const;
+ RefPtr<Declaration> find_declaration_of(DocumentData const&, SymbolName const&) const;
+ RefPtr<Declaration> find_declaration_of(DocumentData const&, const GUI::TextPosition& identifier_position);
enum class RecurseIntoScopes {
No,
Yes
};
- Vector<Symbol> properties_of_type(const DocumentData& document, const String& type) const;
- Vector<Symbol> get_child_symbols(const ASTNode&) const;
- Vector<Symbol> get_child_symbols(const ASTNode&, const Vector<StringView>& scope, Symbol::IsLocal) const;
+ Vector<Symbol> properties_of_type(DocumentData const& document, String const& type) const;
+ Vector<Symbol> get_child_symbols(ASTNode const&) const;
+ Vector<Symbol> get_child_symbols(ASTNode const&, Vector<StringView> const& scope, Symbol::IsLocal) const;
- const DocumentData* get_document_data(const String& file) const;
- const DocumentData* get_or_create_document_data(const String& file);
- void set_document_data(const String& file, OwnPtr<DocumentData>&& data);
+ DocumentData const* get_document_data(String const& file) const;
+ DocumentData const* get_or_create_document_data(String const& file);
+ void set_document_data(String const& file, OwnPtr<DocumentData>&& data);
- OwnPtr<DocumentData> create_document_data_for(const String& file);
+ OwnPtr<DocumentData> create_document_data_for(String const& file);
String document_path_from_include_path(StringView include_path) const;
void update_declared_symbols(DocumentData&);
void update_todo_entries(DocumentData&);
- GUI::AutocompleteProvider::DeclarationType type_of_declaration(const Declaration&);
- Vector<StringView> scope_of_node(const ASTNode&) const;
- Vector<StringView> scope_of_reference_to_symbol(const ASTNode&) const;
+ GUI::AutocompleteProvider::DeclarationType type_of_declaration(Declaration const&);
+ Vector<StringView> scope_of_node(ASTNode const&) const;
+ Vector<StringView> scope_of_reference_to_symbol(ASTNode const&) const;
- Optional<GUI::AutocompleteProvider::ProjectLocation> find_preprocessor_definition(const DocumentData&, const GUI::TextPosition&);
+ Optional<GUI::AutocompleteProvider::ProjectLocation> find_preprocessor_definition(DocumentData const&, const GUI::TextPosition&);
Optional<Cpp::Preprocessor::Substitution> find_preprocessor_substitution(DocumentData const&, Cpp::Position const&);
- OwnPtr<DocumentData> create_document_data(String&& text, const String& filename);
- Optional<Vector<GUI::AutocompleteProvider::Entry>> try_autocomplete_property(const DocumentData&, const ASTNode&, Optional<Token> containing_token) const;
- Optional<Vector<GUI::AutocompleteProvider::Entry>> try_autocomplete_name(const DocumentData&, const ASTNode&, Optional<Token> containing_token) const;
- Optional<Vector<GUI::AutocompleteProvider::Entry>> try_autocomplete_include(const DocumentData&, Token include_path_token, Cpp::Position const& cursor_position) const;
- static bool is_symbol_available(const Symbol&, const Vector<StringView>& current_scope, const Vector<StringView>& reference_scope);
+ OwnPtr<DocumentData> create_document_data(String&& text, String const& filename);
+ Optional<Vector<GUI::AutocompleteProvider::Entry>> try_autocomplete_property(DocumentData const&, ASTNode const&, Optional<Token> containing_token) const;
+ Optional<Vector<GUI::AutocompleteProvider::Entry>> try_autocomplete_name(DocumentData const&, ASTNode const&, Optional<Token> containing_token) const;
+ Optional<Vector<GUI::AutocompleteProvider::Entry>> try_autocomplete_include(DocumentData const&, Token include_path_token, Cpp::Position const& cursor_position) const;
+ static bool is_symbol_available(Symbol const&, Vector<StringView> const& current_scope, Vector<StringView> const& reference_scope);
Optional<FunctionParamsHint> get_function_params_hint(DocumentData const&, FunctionCall&, size_t argument_index);
template<typename Func>
- void for_each_available_symbol(const DocumentData&, Func) const;
+ void for_each_available_symbol(DocumentData const&, Func) const;
template<typename Func>
- void for_each_included_document_recursive(const DocumentData&, Func) const;
+ void for_each_included_document_recursive(DocumentData const&, Func) const;
GUI::AutocompleteProvider::TokenInfo::SemanticType get_token_semantic_type(DocumentData const&, Token const&);
GUI::AutocompleteProvider::TokenInfo::SemanticType get_semantic_type_for_identifier(DocumentData const&, Position);
@@ -154,7 +154,7 @@ private:
};
template<typename Func>
-void CppComprehensionEngine::for_each_available_symbol(const DocumentData& document, Func func) const
+void CppComprehensionEngine::for_each_available_symbol(DocumentData const& document, Func func) const
{
for (auto& item : document.m_symbols) {
auto decision = func(item.value);
@@ -162,7 +162,7 @@ void CppComprehensionEngine::for_each_available_symbol(const DocumentData& docum
return;
}
- for_each_included_document_recursive(document, [&](const DocumentData& document) {
+ for_each_included_document_recursive(document, [&](DocumentData const& document) {
for (auto& item : document.m_symbols) {
auto decision = func(item.value);
if (decision == IterationDecision::Break)
@@ -173,7 +173,7 @@ void CppComprehensionEngine::for_each_available_symbol(const DocumentData& docum
}
template<typename Func>
-void CppComprehensionEngine::for_each_included_document_recursive(const DocumentData& document, Func func) const
+void CppComprehensionEngine::for_each_included_document_recursive(DocumentData const& document, Func func) const
{
for (auto& included_path : document.m_available_headers) {
auto* included_document = get_document_data(included_path);
@@ -190,7 +190,7 @@ namespace AK {
template<>
struct Traits<LanguageServers::Cpp::CppComprehensionEngine::SymbolName> : public GenericTraits<LanguageServers::Cpp::CppComprehensionEngine::SymbolName> {
- static unsigned hash(const LanguageServers::Cpp::CppComprehensionEngine::SymbolName& key)
+ static unsigned hash(LanguageServers::Cpp::CppComprehensionEngine::SymbolName const& key)
{
unsigned hash = 0;
hash = pair_int_hash(hash, string_hash(key.name.characters_without_null_termination(), key.name.length()));
diff --git a/Userland/DevTools/HackStudio/LanguageServers/Cpp/Tests.cpp b/Userland/DevTools/HackStudio/LanguageServers/Cpp/Tests.cpp
index cb2dd30fa9..14dbd87944 100644
--- a/Userland/DevTools/HackStudio/LanguageServers/Cpp/Tests.cpp
+++ b/Userland/DevTools/HackStudio/LanguageServers/Cpp/Tests.cpp
@@ -55,7 +55,7 @@ int run_tests()
return s_some_test_failed ? 1 : 0;
}
-static void add_file(FileDB& filedb, const String& name)
+static void add_file(FileDB& filedb, String const& name)
{
auto file = Core::File::open(LexicalPath::join(TESTS_ROOT_DIR, name).string(), Core::OpenMode::ReadOnly);
VERIFY(!file.is_error());
diff --git a/Userland/DevTools/HackStudio/LanguageServers/FileDB.cpp b/Userland/DevTools/HackStudio/LanguageServers/FileDB.cpp
index e3f91b9124..a45882afbe 100644
--- a/Userland/DevTools/HackStudio/LanguageServers/FileDB.cpp
+++ b/Userland/DevTools/HackStudio/LanguageServers/FileDB.cpp
@@ -12,7 +12,7 @@
namespace LanguageServers {
-RefPtr<const GUI::TextDocument> FileDB::get(const String& filename) const
+RefPtr<const GUI::TextDocument> FileDB::get(String const& filename) const
{
auto absolute_path = to_absolute_path(filename);
auto document_optional = m_open_files.get(absolute_path);
@@ -22,15 +22,15 @@ RefPtr<const GUI::TextDocument> FileDB::get(const String& filename) const
return *document_optional.value();
}
-RefPtr<GUI::TextDocument> FileDB::get(const String& filename)
+RefPtr<GUI::TextDocument> FileDB::get(String const& filename)
{
- auto document = reinterpret_cast<const FileDB*>(this)->get(filename);
+ auto document = reinterpret_cast<FileDB const*>(this)->get(filename);
if (document.is_null())
return nullptr;
return adopt_ref(*const_cast<GUI::TextDocument*>(document.leak_ref()));
}
-RefPtr<const GUI::TextDocument> FileDB::get_or_create_from_filesystem(const String& filename) const
+RefPtr<const GUI::TextDocument> FileDB::get_or_create_from_filesystem(String const& filename) const
{
auto absolute_path = to_absolute_path(filename);
auto document = get(absolute_path);
@@ -39,20 +39,20 @@ RefPtr<const GUI::TextDocument> FileDB::get_or_create_from_filesystem(const Stri
return create_from_filesystem(absolute_path);
}
-RefPtr<GUI::TextDocument> FileDB::get_or_create_from_filesystem(const String& filename)
+RefPtr<GUI::TextDocument> FileDB::get_or_create_from_filesystem(String const& filename)
{
- auto document = reinterpret_cast<const FileDB*>(this)->get_or_create_from_filesystem(filename);
+ auto document = reinterpret_cast<FileDB const*>(this)->get_or_create_from_filesystem(filename);
if (document.is_null())
return nullptr;
return adopt_ref(*const_cast<GUI::TextDocument*>(document.leak_ref()));
}
-bool FileDB::is_open(const String& filename) const
+bool FileDB::is_open(String const& filename) const
{
return m_open_files.contains(to_absolute_path(filename));
}
-bool FileDB::add(const String& filename, int fd)
+bool FileDB::add(String const& filename, int fd)
{
auto document = create_from_fd(fd);
if (!document)
@@ -62,7 +62,7 @@ bool FileDB::add(const String& filename, int fd)
return true;
}
-String FileDB::to_absolute_path(const String& filename) const
+String FileDB::to_absolute_path(String const& filename) const
{
if (LexicalPath { filename }.is_absolute()) {
return filename;
@@ -72,7 +72,7 @@ String FileDB::to_absolute_path(const String& filename) const
return LexicalPath { String::formatted("{}/{}", m_project_root, filename) }.string();
}
-RefPtr<GUI::TextDocument> FileDB::create_from_filesystem(const String& filename) const
+RefPtr<GUI::TextDocument> FileDB::create_from_filesystem(String const& filename) const
{
auto file = Core::File::open(to_absolute_path(filename), Core::OpenMode::ReadOnly);
if (file.is_error()) {
@@ -120,7 +120,7 @@ RefPtr<GUI::TextDocument> FileDB::create_from_file(Core::File& file) const
return document;
}
-void FileDB::on_file_edit_insert_text(const String& filename, const String& inserted_text, size_t start_line, size_t start_column)
+void FileDB::on_file_edit_insert_text(String const& filename, String const& inserted_text, size_t start_line, size_t start_column)
{
VERIFY(is_open(filename));
auto document = get(filename);
@@ -131,7 +131,7 @@ void FileDB::on_file_edit_insert_text(const String& filename, const String& inse
dbgln_if(FILE_CONTENT_DEBUG, "{}", document->text());
}
-void FileDB::on_file_edit_remove_text(const String& filename, size_t start_line, size_t start_column, size_t end_line, size_t end_column)
+void FileDB::on_file_edit_remove_text(String const& filename, size_t start_line, size_t start_column, size_t end_line, size_t end_column)
{
// TODO: If file is not open - need to get its contents
// Otherwise- somehow verify that respawned language server is synced with all file contents
@@ -148,7 +148,7 @@ void FileDB::on_file_edit_remove_text(const String& filename, size_t start_line,
dbgln_if(FILE_CONTENT_DEBUG, "{}", document->text());
}
-RefPtr<GUI::TextDocument> FileDB::create_with_content(const String& content)
+RefPtr<GUI::TextDocument> FileDB::create_with_content(String const& content)
{
StringView content_view(content);
auto document = GUI::TextDocument::create(&s_default_document_client);
@@ -156,7 +156,7 @@ RefPtr<GUI::TextDocument> FileDB::create_with_content(const String& content)
return document;
}
-bool FileDB::add(const String& filename, const String& content)
+bool FileDB::add(String const& filename, String const& content)
{
auto document = create_with_content(content);
if (!document) {
diff --git a/Userland/DevTools/HackStudio/LanguageServers/FileDB.h b/Userland/DevTools/HackStudio/LanguageServers/FileDB.h
index 3e744604fb..c8d64b2182 100644
--- a/Userland/DevTools/HackStudio/LanguageServers/FileDB.h
+++ b/Userland/DevTools/HackStudio/LanguageServers/FileDB.h
@@ -15,26 +15,26 @@ namespace LanguageServers {
class FileDB final {
public:
- RefPtr<const GUI::TextDocument> get(const String& filename) const;
- RefPtr<GUI::TextDocument> get(const String& filename);
- RefPtr<const GUI::TextDocument> get_or_create_from_filesystem(const String& filename) const;
- RefPtr<GUI::TextDocument> get_or_create_from_filesystem(const String& filename);
- bool add(const String& filename, int fd);
- bool add(const String& filename, const String& content);
+ RefPtr<const GUI::TextDocument> get(String const& filename) const;
+ RefPtr<GUI::TextDocument> get(String const& filename);
+ RefPtr<const GUI::TextDocument> get_or_create_from_filesystem(String const& filename) const;
+ RefPtr<GUI::TextDocument> get_or_create_from_filesystem(String const& filename);
+ bool add(String const& filename, int fd);
+ bool add(String const& filename, String const& content);
- void set_project_root(const String& root_path) { m_project_root = root_path; }
- const String& project_root() const { return m_project_root; }
+ void set_project_root(String const& root_path) { m_project_root = root_path; }
+ String const& project_root() const { return m_project_root; }
- void on_file_edit_insert_text(const String& filename, const String& inserted_text, size_t start_line, size_t start_column);
- void on_file_edit_remove_text(const String& filename, size_t start_line, size_t start_column, size_t end_line, size_t end_column);
- String to_absolute_path(const String& filename) const;
- bool is_open(const String& filename) const;
+ void on_file_edit_insert_text(String const& filename, String const& inserted_text, size_t start_line, size_t start_column);
+ void on_file_edit_remove_text(String const& filename, size_t start_line, size_t start_column, size_t end_line, size_t end_column);
+ String to_absolute_path(String const& filename) const;
+ bool is_open(String const& filename) const;
private:
- RefPtr<GUI::TextDocument> create_from_filesystem(const String& filename) const;
+ RefPtr<GUI::TextDocument> create_from_filesystem(String const& filename) const;
RefPtr<GUI::TextDocument> create_from_fd(int fd) const;
RefPtr<GUI::TextDocument> create_from_file(Core::File&) const;
- static RefPtr<GUI::TextDocument> create_with_content(const String&);
+ static RefPtr<GUI::TextDocument> create_with_content(String const&);
private:
HashMap<String, NonnullRefPtr<GUI::TextDocument>> m_open_files;
diff --git a/Userland/DevTools/HackStudio/LanguageServers/Shell/ConnectionFromClient.h b/Userland/DevTools/HackStudio/LanguageServers/Shell/ConnectionFromClient.h
index 20eff7faf0..7e5ab2682d 100644
--- a/Userland/DevTools/HackStudio/LanguageServers/Shell/ConnectionFromClient.h
+++ b/Userland/DevTools/HackStudio/LanguageServers/Shell/ConnectionFromClient.h
@@ -20,7 +20,7 @@ private:
: LanguageServers::ConnectionFromClient(move(socket))
{
m_autocomplete_engine = make<ShellComprehensionEngine>(m_filedb);
- m_autocomplete_engine->set_declarations_of_document_callback = [this](const String& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations) {
+ m_autocomplete_engine->set_declarations_of_document_callback = [this](String const& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations) {
async_declarations_in_document(filename, move(declarations));
};
m_autocomplete_engine->set_todo_entries_of_document_callback = [this](String const& filename, Vector<Cpp::Parser::TodoEntry>&& todo_entries) {
diff --git a/Userland/DevTools/HackStudio/LanguageServers/Shell/ShellComprehensionEngine.cpp b/Userland/DevTools/HackStudio/LanguageServers/Shell/ShellComprehensionEngine.cpp
index 9b3dcd56ee..090ceaaa3d 100644
--- a/Userland/DevTools/HackStudio/LanguageServers/Shell/ShellComprehensionEngine.cpp
+++ b/Userland/DevTools/HackStudio/LanguageServers/Shell/ShellComprehensionEngine.cpp
@@ -14,12 +14,12 @@ namespace LanguageServers::Shell {
RefPtr<::Shell::Shell> ShellComprehensionEngine::s_shell {};
-ShellComprehensionEngine::ShellComprehensionEngine(const FileDB& filedb)
+ShellComprehensionEngine::ShellComprehensionEngine(FileDB const& filedb)
: CodeComprehensionEngine(filedb, true)
{
}
-const ShellComprehensionEngine::DocumentData& ShellComprehensionEngine::get_or_create_document_data(const String& file)
+ShellComprehensionEngine::DocumentData const& ShellComprehensionEngine::get_or_create_document_data(String const& file)
{
auto absolute_path = filedb().to_absolute_path(file);
if (!m_documents.contains(absolute_path)) {
@@ -28,7 +28,7 @@ const ShellComprehensionEngine::DocumentData& ShellComprehensionEngine::get_or_c
return get_document_data(absolute_path);
}
-const ShellComprehensionEngine::DocumentData& ShellComprehensionEngine::get_document_data(const String& file) const
+ShellComprehensionEngine::DocumentData const& ShellComprehensionEngine::get_document_data(String const& file) const
{
auto absolute_path = filedb().to_absolute_path(file);
auto document_data = m_documents.get(absolute_path);
@@ -36,7 +36,7 @@ const ShellComprehensionEngine::DocumentData& ShellComprehensionEngine::get_docu
return *document_data.value();
}
-OwnPtr<ShellComprehensionEngine::DocumentData> ShellComprehensionEngine::create_document_data_for(const String& file)
+OwnPtr<ShellComprehensionEngine::DocumentData> ShellComprehensionEngine::create_document_data_for(String const& file)
{
auto document = filedb().get(file);
if (!document)
@@ -50,7 +50,7 @@ OwnPtr<ShellComprehensionEngine::DocumentData> ShellComprehensionEngine::create_
return document_data;
}
-void ShellComprehensionEngine::set_document_data(const String& file, OwnPtr<DocumentData>&& data)
+void ShellComprehensionEngine::set_document_data(String const& file, OwnPtr<DocumentData>&& data)
{
m_documents.set(filedb().to_absolute_path(file), move(data));
}
@@ -62,7 +62,7 @@ ShellComprehensionEngine::DocumentData::DocumentData(String&& _text, String _fil
{
}
-const Vector<String>& ShellComprehensionEngine::DocumentData::sourced_paths() const
+Vector<String> const& ShellComprehensionEngine::DocumentData::sourced_paths() const
{
if (all_sourced_paths.has_value())
return all_sourced_paths.value();
@@ -110,7 +110,7 @@ NonnullRefPtr<::Shell::AST::Node> ShellComprehensionEngine::DocumentData::parse(
return ::Shell::AST::make_ref_counted<::Shell::AST::SyntaxError>(::Shell::AST::Position {}, "Unable to parse file");
}
-size_t ShellComprehensionEngine::resolve(const ShellComprehensionEngine::DocumentData& document, const GUI::TextPosition& position)
+size_t ShellComprehensionEngine::resolve(ShellComprehensionEngine::DocumentData const& document, const GUI::TextPosition& position)
{
size_t offset = 0;
@@ -133,11 +133,11 @@ size_t ShellComprehensionEngine::resolve(const ShellComprehensionEngine::Documen
return offset;
}
-Vector<GUI::AutocompleteProvider::Entry> ShellComprehensionEngine::get_suggestions(const String& file, const GUI::TextPosition& position)
+Vector<GUI::AutocompleteProvider::Entry> ShellComprehensionEngine::get_suggestions(String const& file, const GUI::TextPosition& position)
{
dbgln_if(SH_LANGUAGE_SERVER_DEBUG, "ShellComprehensionEngine position {}:{}", position.line(), position.column());
- const auto& document = get_or_create_document_data(file);
+ auto const& document = get_or_create_document_data(file);
size_t offset_in_file = resolve(document, position);
::Shell::AST::HitTestResult hit_test = document.node->hit_test_position(offset_in_file);
@@ -154,20 +154,20 @@ Vector<GUI::AutocompleteProvider::Entry> ShellComprehensionEngine::get_suggestio
return entries;
}
-void ShellComprehensionEngine::on_edit(const String& file)
+void ShellComprehensionEngine::on_edit(String const& file)
{
set_document_data(file, create_document_data_for(file));
}
-void ShellComprehensionEngine::file_opened([[maybe_unused]] const String& file)
+void ShellComprehensionEngine::file_opened([[maybe_unused]] String const& file)
{
set_document_data(file, create_document_data_for(file));
}
-Optional<GUI::AutocompleteProvider::ProjectLocation> ShellComprehensionEngine::find_declaration_of(const String& filename, const GUI::TextPosition& identifier_position)
+Optional<GUI::AutocompleteProvider::ProjectLocation> ShellComprehensionEngine::find_declaration_of(String const& filename, const GUI::TextPosition& identifier_position)
{
dbgln_if(SH_LANGUAGE_SERVER_DEBUG, "find_declaration_of({}, {}:{})", filename, identifier_position.line(), identifier_position.column());
- const auto& document = get_or_create_document_data(filename);
+ auto const& document = get_or_create_document_data(filename);
auto position = resolve(document, identifier_position);
auto result = document.node->hit_test_position(position);
if (!result.matching_node) {
@@ -192,10 +192,10 @@ Optional<GUI::AutocompleteProvider::ProjectLocation> ShellComprehensionEngine::f
return {};
}
-void ShellComprehensionEngine::update_declared_symbols(const DocumentData& document)
+void ShellComprehensionEngine::update_declared_symbols(DocumentData const& document)
{
struct Visitor : public ::Shell::AST::NodeVisitor {
- explicit Visitor(const String& filename)
+ explicit Visitor(String const& filename)
: filename(filename)
{
}
@@ -225,7 +225,7 @@ void ShellComprehensionEngine::update_declared_symbols(const DocumentData& docum
declarations.append({ node->name().name, { filename, node->position().start_line.line_number, node->position().start_line.line_column }, GUI::AutocompleteProvider::DeclarationType::Function, {} });
}
- const String& filename;
+ String const& filename;
Vector<GUI::AutocompleteProvider::Declaration> declarations;
} visitor { document.filename };
diff --git a/Userland/DevTools/HackStudio/LanguageServers/Shell/ShellComprehensionEngine.h b/Userland/DevTools/HackStudio/LanguageServers/Shell/ShellComprehensionEngine.h
index eaf4c64bd9..774a7be45a 100644
--- a/Userland/DevTools/HackStudio/LanguageServers/Shell/ShellComprehensionEngine.h
+++ b/Userland/DevTools/HackStudio/LanguageServers/Shell/ShellComprehensionEngine.h
@@ -13,11 +13,11 @@ namespace LanguageServers::Shell {
class ShellComprehensionEngine : public CodeComprehensionEngine {
public:
- ShellComprehensionEngine(const FileDB& filedb);
- virtual Vector<GUI::AutocompleteProvider::Entry> get_suggestions(const String& file, const GUI::TextPosition& position) override;
- virtual void on_edit(const String& file) override;
- virtual void file_opened([[maybe_unused]] const String& file) override;
- virtual Optional<GUI::AutocompleteProvider::ProjectLocation> find_declaration_of(const String& filename, const GUI::TextPosition& identifier_position) override;
+ ShellComprehensionEngine(FileDB const& filedb);
+ virtual Vector<GUI::AutocompleteProvider::Entry> get_suggestions(String const& file, const GUI::TextPosition& position) override;
+ virtual void on_edit(String const& file) override;
+ virtual void file_opened([[maybe_unused]] String const& file) override;
+ virtual Optional<GUI::AutocompleteProvider::ProjectLocation> find_declaration_of(String const& filename, const GUI::TextPosition& identifier_position) override;
private:
struct DocumentData {
@@ -26,7 +26,7 @@ private:
String text;
NonnullRefPtr<::Shell::AST::Node> node;
- const Vector<String>& sourced_paths() const;
+ Vector<String> const& sourced_paths() const;
private:
NonnullRefPtr<::Shell::AST::Node> parse() const;
@@ -34,15 +34,15 @@ private:
mutable Optional<Vector<String>> all_sourced_paths {};
};
- const DocumentData& get_document_data(const String& file) const;
- const DocumentData& get_or_create_document_data(const String& file);
- void set_document_data(const String& file, OwnPtr<DocumentData>&& data);
+ DocumentData const& get_document_data(String const& file) const;
+ DocumentData const& get_or_create_document_data(String const& file);
+ void set_document_data(String const& file, OwnPtr<DocumentData>&& data);
- OwnPtr<DocumentData> create_document_data_for(const String& file);
+ OwnPtr<DocumentData> create_document_data_for(String const& file);
String document_path_from_include_path(StringView include_path) const;
- void update_declared_symbols(const DocumentData&);
+ void update_declared_symbols(DocumentData const&);
- static size_t resolve(const ShellComprehensionEngine::DocumentData& document, const GUI::TextPosition& position);
+ static size_t resolve(ShellComprehensionEngine::DocumentData const& document, const GUI::TextPosition& position);
::Shell::Shell& shell()
{
diff --git a/Userland/DevTools/HackStudio/Locator.cpp b/Userland/DevTools/HackStudio/Locator.cpp
index 0e0a4d1379..5470a1db55 100644
--- a/Userland/DevTools/HackStudio/Locator.cpp
+++ b/Userland/DevTools/HackStudio/Locator.cpp
@@ -21,7 +21,7 @@ namespace HackStudio {
class LocatorSuggestionModel final : public GUI::Model {
public:
struct Suggestion {
- static Suggestion create_filename(const String& filename);
+ static Suggestion create_filename(String const& filename);
static Suggestion create_symbol_declaration(const GUI::AutocompleteProvider::Declaration&);
bool is_filename() const { return as_filename.has_value(); }
@@ -76,13 +76,13 @@ public:
return {};
}
- const Vector<Suggestion>& suggestions() const { return m_suggestions; }
+ Vector<Suggestion> const& suggestions() const { return m_suggestions; }
private:
Vector<Suggestion> m_suggestions;
};
-LocatorSuggestionModel::Suggestion LocatorSuggestionModel::Suggestion::create_filename(const String& filename)
+LocatorSuggestionModel::Suggestion LocatorSuggestionModel::Suggestion::create_filename(String const& filename)
{
LocatorSuggestionModel::Suggestion s;
s.as_filename = filename;
diff --git a/Userland/DevTools/HackStudio/Project.cpp b/Userland/DevTools/HackStudio/Project.cpp
index 561684ec36..ed91439b87 100644
--- a/Userland/DevTools/HackStudio/Project.cpp
+++ b/Userland/DevTools/HackStudio/Project.cpp
@@ -10,13 +10,13 @@
namespace HackStudio {
-Project::Project(const String& root_path)
+Project::Project(String const& root_path)
: m_root_path(root_path)
{
m_model = GUI::FileSystemModel::create(root_path, GUI::FileSystemModel::Mode::FilesAndDirectories);
}
-OwnPtr<Project> Project::open_with_root_path(const String& root_path)
+OwnPtr<Project> Project::open_with_root_path(String const& root_path)
{
if (!Core::File::is_directory(root_path))
return {};
@@ -37,7 +37,7 @@ static void traverse_model(const GUI::FileSystemModel& model, const GUI::ModelIn
}
}
-void Project::for_each_text_file(Function<void(const ProjectFile&)> callback) const
+void Project::for_each_text_file(Function<void(ProjectFile const&)> callback) const
{
traverse_model(model(), {}, [&](auto& index) {
auto file = create_file(model().full_path(index));
@@ -45,7 +45,7 @@ void Project::for_each_text_file(Function<void(const ProjectFile&)> callback) co
});
}
-NonnullRefPtr<ProjectFile> Project::create_file(const String& path) const
+NonnullRefPtr<ProjectFile> Project::create_file(String const& path) const
{
auto full_path = to_absolute_path(path);
return ProjectFile::construct_with_name(full_path);
diff --git a/Userland/DevTools/HackStudio/Project.h b/Userland/DevTools/HackStudio/Project.h
index 573564e02f..7763cfe752 100644
--- a/Userland/DevTools/HackStudio/Project.h
+++ b/Userland/DevTools/HackStudio/Project.h
@@ -19,21 +19,21 @@ class Project {
AK_MAKE_NONMOVABLE(Project);
public:
- static OwnPtr<Project> open_with_root_path(const String& root_path);
+ static OwnPtr<Project> open_with_root_path(String const& root_path);
GUI::FileSystemModel& model() { return *m_model; }
const GUI::FileSystemModel& model() const { return *m_model; }
String name() const { return LexicalPath::basename(m_root_path); }
String root_path() const { return m_root_path; }
- NonnullRefPtr<ProjectFile> create_file(const String& path) const;
+ NonnullRefPtr<ProjectFile> create_file(String const& path) const;
- void for_each_text_file(Function<void(const ProjectFile&)>) const;
+ void for_each_text_file(Function<void(ProjectFile const&)>) const;
String to_absolute_path(String const&) const;
bool project_is_serenity() const;
private:
- explicit Project(const String& root_path);
+ explicit Project(String const& root_path);
RefPtr<GUI::FileSystemModel> m_model;
diff --git a/Userland/DevTools/HackStudio/ProjectBuilder.cpp b/Userland/DevTools/HackStudio/ProjectBuilder.cpp
index 22cfdbdeba..e5d924fbbb 100644
--- a/Userland/DevTools/HackStudio/ProjectBuilder.cpp
+++ b/Userland/DevTools/HackStudio/ProjectBuilder.cpp
@@ -98,7 +98,7 @@ ErrorOr<String> ProjectBuilder::component_name(StringView cmake_file_path)
{
auto content = TRY(Core::File::open(cmake_file_path, Core::OpenMode::ReadOnly))->read_all();
- static const Regex<ECMA262> component_name(R"~~~(serenity_component\([\s]*(\w+)[\s\S]*\))~~~");
+ static Regex<ECMA262> const component_name(R"~~~(serenity_component\([\s]*(\w+)[\s\S]*\))~~~");
RegexResult result;
if (!component_name.search(StringView { content }, result))
return Error::from_string_literal("component not found"sv);
@@ -192,7 +192,7 @@ void ProjectBuilder::for_each_library_definition(Function<void(String, String)>
return;
}
- static const Regex<ECMA262> parse_library_definition(R"~~~(.+:serenity_lib[c]?\((\w+) (\w+)\).*)~~~");
+ static Regex<ECMA262> const parse_library_definition(R"~~~(.+:serenity_lib[c]?\((\w+) (\w+)\).*)~~~");
for (auto& line : res.value().output.split('\n')) {
RegexResult result;
if (!parse_library_definition.search(line, result))
@@ -219,7 +219,7 @@ void ProjectBuilder::for_each_library_dependencies(Function<void(String, Vector<
return;
}
- static const Regex<ECMA262> parse_library_definition(R"~~~(.+:target_link_libraries\((\w+) ([\w\s]+)\).*)~~~");
+ static Regex<ECMA262> const parse_library_definition(R"~~~(.+:target_link_libraries\((\w+) ([\w\s]+)\).*)~~~");
for (auto& line : res.value().output.split('\n')) {
RegexResult result;
diff --git a/Userland/DevTools/HackStudio/ProjectDeclarations.cpp b/Userland/DevTools/HackStudio/ProjectDeclarations.cpp
index 4e75eaa580..8828de0418 100644
--- a/Userland/DevTools/HackStudio/ProjectDeclarations.cpp
+++ b/Userland/DevTools/HackStudio/ProjectDeclarations.cpp
@@ -11,7 +11,7 @@ HackStudio::ProjectDeclarations& HackStudio::ProjectDeclarations::the()
static ProjectDeclarations s_instance;
return s_instance;
}
-void HackStudio::ProjectDeclarations::set_declared_symbols(const String& filename, const Vector<GUI::AutocompleteProvider::Declaration>& declarations)
+void HackStudio::ProjectDeclarations::set_declared_symbols(String const& filename, Vector<GUI::AutocompleteProvider::Declaration> const& declarations)
{
m_document_to_declarations.set(filename, declarations);
if (on_update)
diff --git a/Userland/DevTools/HackStudio/ProjectDeclarations.h b/Userland/DevTools/HackStudio/ProjectDeclarations.h
index e7ffd5b4b0..70c2a15d4a 100644
--- a/Userland/DevTools/HackStudio/ProjectDeclarations.h
+++ b/Userland/DevTools/HackStudio/ProjectDeclarations.h
@@ -23,7 +23,7 @@ public:
template<typename Func>
void for_each_declared_symbol(Func);
- void set_declared_symbols(const String& filename, const Vector<GUI::AutocompleteProvider::Declaration>&);
+ void set_declared_symbols(String const& filename, Vector<GUI::AutocompleteProvider::Declaration> const&);
static Optional<GUI::Icon> get_icon_for(GUI::AutocompleteProvider::DeclarationType);
diff --git a/Userland/DevTools/HackStudio/ProjectFile.cpp b/Userland/DevTools/HackStudio/ProjectFile.cpp
index 90136b2fdd..70e8b9073d 100644
--- a/Userland/DevTools/HackStudio/ProjectFile.cpp
+++ b/Userland/DevTools/HackStudio/ProjectFile.cpp
@@ -9,7 +9,7 @@
namespace HackStudio {
-ProjectFile::ProjectFile(const String& name)
+ProjectFile::ProjectFile(String const& name)
: m_name(name)
{
}
diff --git a/Userland/DevTools/HackStudio/ProjectFile.h b/Userland/DevTools/HackStudio/ProjectFile.h
index 72fc3e7a24..e2b3c96404 100644
--- a/Userland/DevTools/HackStudio/ProjectFile.h
+++ b/Userland/DevTools/HackStudio/ProjectFile.h
@@ -16,12 +16,12 @@ namespace HackStudio {
class ProjectFile : public RefCounted<ProjectFile> {
public:
- static NonnullRefPtr<ProjectFile> construct_with_name(const String& name)
+ static NonnullRefPtr<ProjectFile> construct_with_name(String const& name)
{
return adopt_ref(*new ProjectFile(name));
}
- const String& name() const { return m_name; }
+ String const& name() const { return m_name; }
bool could_render_text() const { return m_could_render_text; }
GUI::TextDocument& document() const;
@@ -33,7 +33,7 @@ public:
void horizontal_scroll_value(int);
private:
- explicit ProjectFile(const String& name);
+ explicit ProjectFile(String const& name);
void create_document_if_needed() const;
String m_name;
diff --git a/Userland/DevTools/HackStudio/ProjectTemplate.cpp b/Userland/DevTools/HackStudio/ProjectTemplate.cpp
index 2f823c9143..ad265b9b72 100644
--- a/Userland/DevTools/HackStudio/ProjectTemplate.cpp
+++ b/Userland/DevTools/HackStudio/ProjectTemplate.cpp
@@ -19,7 +19,7 @@
namespace HackStudio {
-ProjectTemplate::ProjectTemplate(const String& id, const String& name, const String& description, const GUI::Icon& icon, int priority)
+ProjectTemplate::ProjectTemplate(String const& id, String const& name, String const& description, const GUI::Icon& icon, int priority)
: m_id(id)
, m_name(name)
, m_description(description)
@@ -28,7 +28,7 @@ ProjectTemplate::ProjectTemplate(const String& id, const String& name, const Str
{
}
-RefPtr<ProjectTemplate> ProjectTemplate::load_from_manifest(const String& manifest_path)
+RefPtr<ProjectTemplate> ProjectTemplate::load_from_manifest(String const& manifest_path)
{
auto maybe_config = Core::ConfigFile::open(manifest_path);
if (maybe_config.is_error())
@@ -61,7 +61,7 @@ RefPtr<ProjectTemplate> ProjectTemplate::load_from_manifest(const String& manife
return adopt_ref(*new ProjectTemplate(id, name, description, icon, priority));
}
-Result<void, String> ProjectTemplate::create_project(const String& name, const String& path)
+Result<void, String> ProjectTemplate::create_project(String const& name, String const& path)
{
// Check if a file or directory already exists at the project path
if (Core::File::exists(path))
@@ -97,7 +97,7 @@ Result<void, String> ProjectTemplate::create_project(const String& name, const S
auto namespace_safe = name.replace("-", "_", true);
pid_t child_pid;
- const char* argv[] = { postcreate_script_path.characters(), name.characters(), path.characters(), namespace_safe.characters(), nullptr };
+ char const* argv[] = { postcreate_script_path.characters(), name.characters(), path.characters(), namespace_safe.characters(), nullptr };
if ((errno = posix_spawn(&child_pid, postcreate_script_path.characters(), nullptr, nullptr, const_cast<char**>(argv), environ))) {
perror("posix_spawn");
diff --git a/Userland/DevTools/HackStudio/ProjectTemplate.h b/Userland/DevTools/HackStudio/ProjectTemplate.h
index 35f09bd70d..7a42e90d5d 100644
--- a/Userland/DevTools/HackStudio/ProjectTemplate.h
+++ b/Userland/DevTools/HackStudio/ProjectTemplate.h
@@ -20,15 +20,15 @@ class ProjectTemplate : public RefCounted<ProjectTemplate> {
public:
static String templates_path() { return "/res/devel/templates"; }
- static RefPtr<ProjectTemplate> load_from_manifest(const String& manifest_path);
+ static RefPtr<ProjectTemplate> load_from_manifest(String const& manifest_path);
- explicit ProjectTemplate(const String& id, const String& name, const String& description, const GUI::Icon& icon, int priority);
+ explicit ProjectTemplate(String const& id, String const& name, String const& description, const GUI::Icon& icon, int priority);
- Result<void, String> create_project(const String& name, const String& path);
+ Result<void, String> create_project(String const& name, String const& path);
- const String& id() const { return m_id; }
- const String& name() const { return m_name; }
- const String& description() const { return m_description; }
+ String const& id() const { return m_id; }
+ String const& name() const { return m_name; }
+ String const& description() const { return m_description; }
const GUI::Icon& icon() const { return m_icon; }
const String content_path() const
{
diff --git a/Userland/DevTools/HackStudio/TerminalWrapper.cpp b/Userland/DevTools/HackStudio/TerminalWrapper.cpp
index de85ad006d..1c1ee04c0b 100644
--- a/Userland/DevTools/HackStudio/TerminalWrapper.cpp
+++ b/Userland/DevTools/HackStudio/TerminalWrapper.cpp
@@ -24,7 +24,7 @@
namespace HackStudio {
-ErrorOr<void> TerminalWrapper::run_command(const String& command, Optional<String> working_directory, WaitForExit wait_for_exit, Optional<StringView> failure_message)
+ErrorOr<void> TerminalWrapper::run_command(String const& command, Optional<String> working_directory, WaitForExit wait_for_exit, Optional<StringView> failure_message)
{
if (m_pid != -1) {
GUI::MessageBox::show(window(),
@@ -62,7 +62,7 @@ ErrorOr<void> TerminalWrapper::run_command(const String& command, Optional<Strin
auto parts = command.split(' ');
VERIFY(!parts.is_empty());
- const char** args = (const char**)calloc(parts.size() + 1, sizeof(const char*));
+ char const** args = (char const**)calloc(parts.size() + 1, sizeof(char const*));
for (size_t i = 0; i < parts.size(); i++) {
args[i] = parts[i].characters();
}
diff --git a/Userland/DevTools/HackStudio/TerminalWrapper.h b/Userland/DevTools/HackStudio/TerminalWrapper.h
index 128aff05e2..28373a7942 100644
--- a/Userland/DevTools/HackStudio/TerminalWrapper.h
+++ b/Userland/DevTools/HackStudio/TerminalWrapper.h
@@ -21,7 +21,7 @@ public:
No,
Yes
};
- ErrorOr<void> run_command(const String&, Optional<String> working_directory = {}, WaitForExit = WaitForExit::No, Optional<StringView> failure_message = {});
+ ErrorOr<void> run_command(String const&, Optional<String> working_directory = {}, WaitForExit = WaitForExit::No, Optional<StringView> failure_message = {});
ErrorOr<void> kill_running_command();
void clear_including_history();
diff --git a/Userland/DevTools/HackStudio/ToDoEntriesWidget.cpp b/Userland/DevTools/HackStudio/ToDoEntriesWidget.cpp
index f734e45247..1228098553 100644
--- a/Userland/DevTools/HackStudio/ToDoEntriesWidget.cpp
+++ b/Userland/DevTools/HackStudio/ToDoEntriesWidget.cpp
@@ -86,7 +86,7 @@ private:
void ToDoEntriesWidget::refresh()
{
- const auto& entries = ToDoEntries::the().get_entries();
+ auto const& entries = ToDoEntries::the().get_entries();
auto results_model = adopt_ref(*new ToDoEntriesModel(move(entries)));
m_result_view->set_model(results_model);
}
diff --git a/Userland/DevTools/HackStudio/main.cpp b/Userland/DevTools/HackStudio/main.cpp
index 0b1cd19290..9473fcdc4d 100644
--- a/Userland/DevTools/HackStudio/main.cpp
+++ b/Userland/DevTools/HackStudio/main.cpp
@@ -51,7 +51,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
notify_make_not_available();
}
- const char* path_argument = nullptr;
+ char const* path_argument = nullptr;
bool mode_coredump = false;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(path_argument, "Path to a workspace or a file", "path", Core::ArgsParser::Required::No);
@@ -94,7 +94,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
static bool make_is_available()
{
pid_t pid;
- const char* argv[] = { "make", "--version", nullptr };
+ char const* argv[] = { "make", "--version", nullptr };
posix_spawn_file_actions_t action;
posix_spawn_file_actions_init(&action);
posix_spawn_file_actions_addopen(&action, STDOUT_FILENO, "/dev/null", O_WRONLY, 0);
@@ -147,12 +147,12 @@ GUI::TextEditor& current_editor()
return s_hack_studio_widget->current_editor();
}
-void open_file(const String& filename)
+void open_file(String const& filename)
{
s_hack_studio_widget->open_file(filename);
}
-void open_file(const String& filename, size_t line, size_t column)
+void open_file(String const& filename, size_t line, size_t column)
{
s_hack_studio_widget->open_file(filename, line, column);
}
diff --git a/Userland/DevTools/Inspector/RemoteObjectPropertyModel.cpp b/Userland/DevTools/Inspector/RemoteObjectPropertyModel.cpp
index 85f3aa1936..c9f73d000a 100644
--- a/Userland/DevTools/Inspector/RemoteObjectPropertyModel.cpp
+++ b/Userland/DevTools/Inspector/RemoteObjectPropertyModel.cpp
@@ -17,7 +17,7 @@ RemoteObjectPropertyModel::RemoteObjectPropertyModel(RemoteObject& object)
int RemoteObjectPropertyModel::row_count(const GUI::ModelIndex& index) const
{
- Function<int(const JsonValue&)> do_count = [&](const JsonValue& value) {
+ Function<int(JsonValue const&)> do_count = [&](JsonValue const& value) {
if (value.is_array())
return value.as_array().size();
else if (value.is_object())
@@ -26,7 +26,7 @@ int RemoteObjectPropertyModel::row_count(const GUI::ModelIndex& index) const
};
if (index.is_valid()) {
- auto* path = static_cast<const JsonPath*>(index.internal_data());
+ auto* path = static_cast<JsonPath const*>(index.internal_data());
return do_count(path->resolve(m_object.json));
} else {
return do_count(m_object.json);
@@ -46,7 +46,7 @@ String RemoteObjectPropertyModel::column_name(int column) const
GUI::Variant RemoteObjectPropertyModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const
{
- auto* path = static_cast<const JsonPath*>(index.internal_data());
+ auto* path = static_cast<JsonPath const*>(index.internal_data());
if (!path)
return {};
@@ -72,7 +72,7 @@ void RemoteObjectPropertyModel::set_data(const GUI::ModelIndex& index, const GUI
if (!index.is_valid())
return;
- auto* path = static_cast<const JsonPath*>(index.internal_data());
+ auto* path = static_cast<JsonPath const*>(index.internal_data());
if (path->size() != 1)
return;
@@ -83,9 +83,9 @@ void RemoteObjectPropertyModel::set_data(const GUI::ModelIndex& index, const GUI
GUI::ModelIndex RemoteObjectPropertyModel::index(int row, int column, const GUI::ModelIndex& parent) const
{
- const auto& parent_path = parent.is_valid() ? *static_cast<const JsonPath*>(parent.internal_data()) : JsonPath {};
+ auto const& parent_path = parent.is_valid() ? *static_cast<JsonPath const*>(parent.internal_data()) : JsonPath {};
- auto nth_child = [&](int n, const JsonValue& value) -> const JsonPath* {
+ auto nth_child = [&](int n, JsonValue const& value) -> JsonPath const* {
auto path = make<JsonPath>();
path->extend(parent_path);
int row_index = n;
@@ -135,7 +135,7 @@ GUI::ModelIndex RemoteObjectPropertyModel::parent_index(const GUI::ModelIndex& i
if (!index.is_valid())
return index;
- auto path = *static_cast<const JsonPath*>(index.internal_data());
+ auto path = *static_cast<JsonPath const*>(index.internal_data());
if (path.is_empty())
return {};
@@ -168,12 +168,12 @@ GUI::ModelIndex RemoteObjectPropertyModel::parent_index(const GUI::ModelIndex& i
return {};
}
-const JsonPath* RemoteObjectPropertyModel::cached_path_at(int n, const Vector<JsonPathElement>& prefix) const
+JsonPath const* RemoteObjectPropertyModel::cached_path_at(int n, Vector<JsonPathElement> const& prefix) const
{
// FIXME: ModelIndex wants a void*, so we have to keep these
// indices alive, but allocating a new path every time
// we're asked for an index is silly, so we have to look for existing ones first.
- const JsonPath* index_path = nullptr;
+ JsonPath const* index_path = nullptr;
int row_index = n;
for (auto& path : m_paths) {
if (path.size() != prefix.size() + 1)
@@ -195,7 +195,7 @@ const JsonPath* RemoteObjectPropertyModel::cached_path_at(int n, const Vector<Js
return index_path;
};
-const JsonPath* RemoteObjectPropertyModel::find_cached_path(const Vector<JsonPathElement>& path) const
+JsonPath const* RemoteObjectPropertyModel::find_cached_path(Vector<JsonPathElement> const& path) const
{
for (auto& cpath : m_paths) {
if (cpath.size() != path.size())
diff --git a/Userland/DevTools/Inspector/RemoteObjectPropertyModel.h b/Userland/DevTools/Inspector/RemoteObjectPropertyModel.h
index 8dc7a3d134..5b724996e0 100644
--- a/Userland/DevTools/Inspector/RemoteObjectPropertyModel.h
+++ b/Userland/DevTools/Inspector/RemoteObjectPropertyModel.h
@@ -41,8 +41,8 @@ public:
private:
explicit RemoteObjectPropertyModel(RemoteObject&);
- const JsonPath* cached_path_at(int n, const Vector<JsonPathElement>& prefix) const;
- const JsonPath* find_cached_path(const Vector<JsonPathElement>& path) const;
+ JsonPath const* cached_path_at(int n, Vector<JsonPathElement> const& prefix) const;
+ JsonPath const* find_cached_path(Vector<JsonPathElement> const& path) const;
RemoteObject& m_object;
mutable NonnullOwnPtrVector<JsonPath> m_paths;
diff --git a/Userland/DevTools/Inspector/RemoteProcess.cpp b/Userland/DevTools/Inspector/RemoteProcess.cpp
index 20227702f2..5bb52c020b 100644
--- a/Userland/DevTools/Inspector/RemoteProcess.cpp
+++ b/Userland/DevTools/Inspector/RemoteProcess.cpp
@@ -27,7 +27,7 @@ RemoteProcess::RemoteProcess(pid_t pid)
m_client = InspectorServerClient::try_create().release_value_but_fixme_should_propagate_errors();
}
-void RemoteProcess::handle_identify_response(const JsonObject& response)
+void RemoteProcess::handle_identify_response(JsonObject const& response)
{
int pid = response.get("pid").to_int();
VERIFY(pid == m_pid);
@@ -38,7 +38,7 @@ void RemoteProcess::handle_identify_response(const JsonObject& response)
on_update();
}
-void RemoteProcess::handle_get_all_objects_response(const JsonObject& response)
+void RemoteProcess::handle_get_all_objects_response(JsonObject const& response)
{
// FIXME: It would be good if we didn't have to make a local copy of the array value here!
auto objects = response.get("objects");
@@ -82,7 +82,7 @@ void RemoteProcess::set_inspected_object(FlatPtr address)
m_client->async_set_inspected_object(m_pid, address);
}
-void RemoteProcess::set_property(FlatPtr object, StringView name, const JsonValue& value)
+void RemoteProcess::set_property(FlatPtr object, StringView name, JsonValue const& value)
{
m_client->async_set_object_property(m_pid, object, name, value.to_string());
}
diff --git a/Userland/DevTools/Inspector/RemoteProcess.h b/Userland/DevTools/Inspector/RemoteProcess.h
index 6f6fd4bc7d..a012424ef1 100644
--- a/Userland/DevTools/Inspector/RemoteProcess.h
+++ b/Userland/DevTools/Inspector/RemoteProcess.h
@@ -22,24 +22,24 @@ public:
void update();
pid_t pid() const { return m_pid; }
- const String& process_name() const { return m_process_name; }
+ String const& process_name() const { return m_process_name; }
RemoteObjectGraphModel& object_graph_model() { return *m_object_graph_model; }
- const NonnullOwnPtrVector<RemoteObject>& roots() const { return m_roots; }
+ NonnullOwnPtrVector<RemoteObject> const& roots() const { return m_roots; }
void set_inspected_object(FlatPtr);
- void set_property(FlatPtr object, StringView name, const JsonValue& value);
+ void set_property(FlatPtr object, StringView name, JsonValue const& value);
bool is_inspectable();
Function<void()> on_update;
private:
- void handle_get_all_objects_response(const JsonObject&);
- void handle_identify_response(const JsonObject&);
+ void handle_get_all_objects_response(JsonObject const&);
+ void handle_identify_response(JsonObject const&);
- void send_request(const JsonObject&);
+ void send_request(JsonObject const&);
pid_t m_pid { -1 };
String m_process_name;
diff --git a/Userland/DevTools/Playground/main.cpp b/Userland/DevTools/Playground/main.cpp
index d0cfe3e5ea..f7a2781684 100644
--- a/Userland/DevTools/Playground/main.cpp
+++ b/Userland/DevTools/Playground/main.cpp
@@ -37,14 +37,14 @@ class UnregisteredWidget final : public GUI::Widget {
C_OBJECT(UnregisteredWidget);
private:
- UnregisteredWidget(const String& class_name);
+ UnregisteredWidget(String const& class_name);
virtual void paint_event(GUI::PaintEvent& event) override;
String m_text;
};
-UnregisteredWidget::UnregisteredWidget(const String& class_name)
+UnregisteredWidget::UnregisteredWidget(String const& class_name)
{
StringBuilder builder;
builder.append(class_name);
@@ -72,7 +72,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath cpath wpath"));
- const char* path = nullptr;
+ char const* path = nullptr;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(path, "GML file to edit", "file", Core::ArgsParser::Required::No);
args_parser.parse(arguments);
diff --git a/Userland/DevTools/Profiler/FilesystemEventModel.cpp b/Userland/DevTools/Profiler/FilesystemEventModel.cpp
index 96b9835cf1..f673bb0e0e 100644
--- a/Userland/DevTools/Profiler/FilesystemEventModel.cpp
+++ b/Userland/DevTools/Profiler/FilesystemEventModel.cpp
@@ -108,7 +108,7 @@ GUI::ModelIndex FileEventModel::parent_index(GUI::ModelIndex const& index) const
return {};
if (node.parent()->parent()) {
- const auto& children = node.parent()->parent()->children();
+ auto const& children = node.parent()->parent()->children();
for (size_t row = 0; row < children.size(); ++row) {
if (children.at(row).ptr() == node.parent()) {
@@ -117,7 +117,7 @@ GUI::ModelIndex FileEventModel::parent_index(GUI::ModelIndex const& index) const
}
}
- const auto& children = node.parent()->children();
+ auto const& children = node.parent()->children();
for (size_t row = 0; row < children.size(); ++row) {
if (children.at(row).ptr() == &node) {
diff --git a/Userland/DevTools/Profiler/Profile.cpp b/Userland/DevTools/Profiler/Profile.cpp
index c94426fc0d..c8644a38c7 100644
--- a/Userland/DevTools/Profiler/Profile.cpp
+++ b/Userland/DevTools/Profiler/Profile.cpp
@@ -388,7 +388,7 @@ ErrorOr<NonnullOwnPtr<Profile>> Profile::load_from_perfcore_file(StringView path
it->value->handle_thread_exit(event.tid, event.serial);
continue;
} else if (type_string == "read"sv) {
- const auto string_index = perf_event.get("filename_index"sv).to_number<FlatPtr>();
+ auto const string_index = perf_event.get("filename_index"sv).to_number<FlatPtr>();
event.data = Event::ReadData {
.fd = perf_event.get("fd"sv).to_number<int>(),
.size = perf_event.get("size"sv).to_number<size_t>(),
diff --git a/Userland/DevTools/UserspaceEmulator/Emulator.h b/Userland/DevTools/UserspaceEmulator/Emulator.h
index 29b113f8ff..4f53aa50c8 100644
--- a/Userland/DevTools/UserspaceEmulator/Emulator.h
+++ b/Userland/DevTools/UserspaceEmulator/Emulator.h
@@ -125,8 +125,8 @@ public:
private:
const String m_executable_path;
- const Vector<StringView> m_arguments;
- const Vector<String> m_environment;
+ Vector<StringView> const m_arguments;
+ Vector<String> const m_environment;
SoftMMU m_mmu;
NonnullOwnPtr<SoftCPU> m_cpu;
diff --git a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
index e2b2e668e3..7f10a25c6b 100644
--- a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
+++ b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
@@ -371,11 +371,11 @@ int Emulator::virt$symlink(FlatPtr params_addr)
mmu().copy_from_vm(&params, params_addr, sizeof(params));
auto target = mmu().copy_buffer_from_vm((FlatPtr)params.target.characters, params.target.length);
- params.target.characters = (const char*)target.data();
+ params.target.characters = (char const*)target.data();
params.target.length = target.size();
auto link = mmu().copy_buffer_from_vm((FlatPtr)params.linkpath.characters, params.linkpath.length);
- params.linkpath.characters = (const char*)link.data();
+ params.linkpath.characters = (char const*)link.data();
params.linkpath.length = link.size();
return syscall(SC_symlink, &params);
@@ -387,11 +387,11 @@ int Emulator::virt$rename(FlatPtr params_addr)
mmu().copy_from_vm(&params, params_addr, sizeof(params));
auto new_path = mmu().copy_buffer_from_vm((FlatPtr)params.new_path.characters, params.new_path.length);
- params.new_path.characters = (const char*)new_path.data();
+ params.new_path.characters = (char const*)new_path.data();
params.new_path.length = new_path.size();
auto old_path = mmu().copy_buffer_from_vm((FlatPtr)params.old_path.characters, params.old_path.length);
- params.old_path.characters = (const char*)old_path.data();
+ params.old_path.characters = (char const*)old_path.data();
params.old_path.length = old_path.size();
return syscall(SC_rename, &params);
@@ -403,11 +403,11 @@ int Emulator::virt$set_coredump_metadata(FlatPtr params_addr)
mmu().copy_from_vm(&params, params_addr, sizeof(params));
auto key = mmu().copy_buffer_from_vm((FlatPtr)params.key.characters, params.key.length);
- params.key.characters = (const char*)key.data();
+ params.key.characters = (char const*)key.data();
params.key.length = key.size();
auto value = mmu().copy_buffer_from_vm((FlatPtr)params.value.characters, params.value.length);
- params.value.characters = (const char*)value.data();
+ params.value.characters = (char const*)value.data();
params.value.length = value.size();
return syscall(SC_set_coredump_metadata, &params);
@@ -416,7 +416,7 @@ int Emulator::virt$set_coredump_metadata(FlatPtr params_addr)
int Emulator::virt$dbgputstr(FlatPtr characters, int length)
{
auto buffer = mmu().copy_buffer_from_vm(characters, length);
- dbgputstr((const char*)buffer.data(), buffer.size());
+ dbgputstr((char const*)buffer.data(), buffer.size());
return 0;
}
@@ -437,7 +437,7 @@ int Emulator::virt$chown(FlatPtr params_addr)
mmu().copy_from_vm(&params, params_addr, sizeof(params));
auto path = mmu().copy_buffer_from_vm((FlatPtr)params.path.characters, params.path.length);
- params.path.characters = (const char*)path.data();
+ params.path.characters = (char const*)path.data();
params.path.length = path.size();
return syscall(SC_chown, &params);
@@ -635,7 +635,7 @@ int Emulator::virt$recvmsg(int sockfd, FlatPtr msg_addr, int flags)
mmu().copy_from_vm(mmu_iovs.data(), (FlatPtr)mmu_msg.msg_iov, mmu_msg.msg_iovlen * sizeof(iovec));
Vector<ByteBuffer, 1> buffers;
Vector<iovec, 1> iovs;
- for (const auto& iov : mmu_iovs) {
+ for (auto const& iov : mmu_iovs) {
auto buffer_result = ByteBuffer::create_uninitialized(iov.iov_len);
if (buffer_result.is_error())
return -ENOMEM;
@@ -819,7 +819,7 @@ u32 Emulator::virt$open(u32 params_addr)
host_params.dirfd = params.dirfd;
host_params.mode = params.mode;
host_params.options = params.options;
- host_params.path.characters = (const char*)path.data();
+ host_params.path.characters = (char const*)path.data();
host_params.path.length = path.size();
return syscall(SC_open, &host_params);
@@ -1315,7 +1315,7 @@ int Emulator::virt$realpath(FlatPtr params_addr)
auto& host_buffer = buffer_result.value();
Syscall::SC_realpath_params host_params;
- host_params.path = { (const char*)path.data(), path.size() };
+ host_params.path = { (char const*)path.data(), path.size() };
host_params.buffer = { (char*)host_buffer.data(), host_buffer.size() };
int rc = syscall(SC_realpath, &host_params);
if (rc < 0)
@@ -1587,7 +1587,7 @@ int Emulator::virt$readlink(FlatPtr params_addr)
auto& host_buffer = buffer_result.value();
Syscall::SC_readlink_params host_params;
- host_params.path = { (const char*)path.data(), path.size() };
+ host_params.path = { (char const*)path.data(), path.size() };
host_params.buffer = { (char*)host_buffer.data(), host_buffer.size() };
int rc = syscall(SC_readlink, &host_params);
if (rc < 0)
diff --git a/Userland/DevTools/UserspaceEmulator/MallocTracer.cpp b/Userland/DevTools/UserspaceEmulator/MallocTracer.cpp
index 291d8f8d48..2ba544f9af 100644
--- a/Userland/DevTools/UserspaceEmulator/MallocTracer.cpp
+++ b/Userland/DevTools/UserspaceEmulator/MallocTracer.cpp
@@ -208,7 +208,7 @@ Mallocation* MallocTracer::find_mallocation_after(FlatPtr address)
return found_mallocation;
}
-void MallocTracer::audit_read(const Region& region, FlatPtr address, size_t size)
+void MallocTracer::audit_read(Region const& region, FlatPtr address, size_t size)
{
if (!m_auditing_enabled)
return;
@@ -259,7 +259,7 @@ void MallocTracer::audit_read(const Region& region, FlatPtr address, size_t size
}
}
-void MallocTracer::audit_write(const Region& region, FlatPtr address, size_t size)
+void MallocTracer::audit_write(Region const& region, FlatPtr address, size_t size)
{
if (!m_auditing_enabled)
return;
diff --git a/Userland/DevTools/UserspaceEmulator/MallocTracer.h b/Userland/DevTools/UserspaceEmulator/MallocTracer.h
index 8d35d9ed04..fe43d79987 100644
--- a/Userland/DevTools/UserspaceEmulator/MallocTracer.h
+++ b/Userland/DevTools/UserspaceEmulator/MallocTracer.h
@@ -63,8 +63,8 @@ public:
void target_did_realloc(Badge<Emulator>, FlatPtr address, size_t);
void target_did_change_chunk_size(Badge<Emulator>, FlatPtr, size_t);
- void audit_read(const Region&, FlatPtr address, size_t);
- void audit_write(const Region&, FlatPtr address, size_t);
+ void audit_read(Region const&, FlatPtr address, size_t);
+ void audit_write(Region const&, FlatPtr address, size_t);
void dump_leak_report();
@@ -72,7 +72,7 @@ private:
template<typename Callback>
void for_each_mallocation(Callback callback) const;
- Mallocation* find_mallocation(const Region&, FlatPtr);
+ Mallocation* find_mallocation(Region const&, FlatPtr);
Mallocation* find_mallocation(FlatPtr);
Mallocation* find_mallocation_before(FlatPtr);
Mallocation* find_mallocation_after(FlatPtr);
@@ -89,11 +89,11 @@ private:
bool m_auditing_enabled { true };
};
-ALWAYS_INLINE Mallocation* MallocTracer::find_mallocation(const Region& region, FlatPtr address)
+ALWAYS_INLINE Mallocation* MallocTracer::find_mallocation(Region const& region, FlatPtr address)
{
if (!is<MmapRegion>(region))
return nullptr;
- if (!static_cast<const MmapRegion&>(region).is_malloc_block())
+ if (!static_cast<MmapRegion const&>(region).is_malloc_block())
return nullptr;
auto* malloc_data = static_cast<MmapRegion&>(const_cast<Region&>(region)).malloc_metadata();
if (!malloc_data)
diff --git a/Userland/DevTools/UserspaceEmulator/MmapRegion.cpp b/Userland/DevTools/UserspaceEmulator/MmapRegion.cpp
index 7a2d6a78be..9c525c6ec9 100644
--- a/Userland/DevTools/UserspaceEmulator/MmapRegion.cpp
+++ b/Userland/DevTools/UserspaceEmulator/MmapRegion.cpp
@@ -12,7 +12,7 @@
namespace UserspaceEmulator {
-static void* mmap_initialized(size_t bytes, char initial_value, const char* name)
+static void* mmap_initialized(size_t bytes, char initial_value, char const* name)
{
auto* ptr = mmap_with_name(nullptr, bytes, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0, name);
VERIFY(ptr != MAP_FAILED);
diff --git a/Userland/DevTools/UserspaceEmulator/MmapRegion.h b/Userland/DevTools/UserspaceEmulator/MmapRegion.h
index 82ee22a6aa..62d0e50308 100644
--- a/Userland/DevTools/UserspaceEmulator/MmapRegion.h
+++ b/Userland/DevTools/UserspaceEmulator/MmapRegion.h
@@ -51,7 +51,7 @@ public:
MallocRegionMetadata* malloc_metadata() { return m_malloc_metadata; }
void set_malloc_metadata(Badge<MallocTracer>, NonnullOwnPtr<MallocRegionMetadata> metadata) { m_malloc_metadata = move(metadata); }
- const String& name() const { return m_name; }
+ String const& name() const { return m_name; }
String lib_name() const
{
if (m_name.contains("Loader.so"sv))
diff --git a/Userland/DevTools/UserspaceEmulator/Range.cpp b/Userland/DevTools/UserspaceEmulator/Range.cpp
index 59bfcff501..ca1e13b4f8 100644
--- a/Userland/DevTools/UserspaceEmulator/Range.cpp
+++ b/Userland/DevTools/UserspaceEmulator/Range.cpp
@@ -9,7 +9,7 @@
namespace UserspaceEmulator {
-Vector<Range, 2> Range::carve(const Range& taken) const
+Vector<Range, 2> Range::carve(Range const& taken) const
{
VERIFY((taken.size() % PAGE_SIZE) == 0);
Vector<Range, 2> parts;
diff --git a/Userland/DevTools/UserspaceEmulator/Range.h b/Userland/DevTools/UserspaceEmulator/Range.h
index 31a1d9e09d..29750e0530 100644
--- a/Userland/DevTools/UserspaceEmulator/Range.h
+++ b/Userland/DevTools/UserspaceEmulator/Range.h
@@ -30,7 +30,7 @@ public:
VirtualAddress end() const { return m_base.offset(m_size); }
- bool operator==(const Range& other) const
+ bool operator==(Range const& other) const
{
return m_base == other.m_base && m_size == other.m_size;
}
@@ -42,12 +42,12 @@ public:
return base >= m_base && base.offset(size) <= end();
}
- bool contains(const Range& other) const
+ bool contains(Range const& other) const
{
return contains(other.base(), other.size());
}
- Vector<Range, 2> carve(const Range&) const;
+ Vector<Range, 2> carve(Range const&) const;
Range split_at(VirtualAddress address)
{
diff --git a/Userland/DevTools/UserspaceEmulator/RangeAllocator.cpp b/Userland/DevTools/UserspaceEmulator/RangeAllocator.cpp
index 8ed75c51cd..d673d7febd 100644
--- a/Userland/DevTools/UserspaceEmulator/RangeAllocator.cpp
+++ b/Userland/DevTools/UserspaceEmulator/RangeAllocator.cpp
@@ -33,7 +33,7 @@ void RangeAllocator::dump() const
}
}
-void RangeAllocator::carve_at_index(int index, const Range& range)
+void RangeAllocator::carve_at_index(int index, Range const& range)
{
auto remaining_parts = m_available_ranges[index].carve(range);
VERIFY(remaining_parts.size() >= 1);
@@ -142,7 +142,7 @@ Optional<Range> RangeAllocator::allocate_specific(VirtualAddress base, size_t si
return {};
}
-void RangeAllocator::deallocate(const Range& range)
+void RangeAllocator::deallocate(Range const& range)
{
VERIFY(m_total_range.contains(range));
VERIFY(range.size());
diff --git a/Userland/DevTools/UserspaceEmulator/RangeAllocator.h b/Userland/DevTools/UserspaceEmulator/RangeAllocator.h
index c0957d8021..63f9155d1a 100644
--- a/Userland/DevTools/UserspaceEmulator/RangeAllocator.h
+++ b/Userland/DevTools/UserspaceEmulator/RangeAllocator.h
@@ -20,16 +20,16 @@ public:
Optional<Range> allocate_anywhere(size_t, size_t alignment = PAGE_SIZE);
Optional<Range> allocate_specific(VirtualAddress, size_t);
Optional<Range> allocate_randomized(size_t, size_t alignment);
- void deallocate(const Range&);
+ void deallocate(Range const&);
void reserve_user_range(VirtualAddress, size_t);
void dump() const;
- bool contains(const Range& range) const { return m_total_range.contains(range); }
+ bool contains(Range const& range) const { return m_total_range.contains(range); }
private:
- void carve_at_index(int, const Range&);
+ void carve_at_index(int, Range const&);
Vector<Range> m_available_ranges;
Range m_total_range;
diff --git a/Userland/DevTools/UserspaceEmulator/Region.h b/Userland/DevTools/UserspaceEmulator/Region.h
index 3efea3ad1a..9309ae38a5 100644
--- a/Userland/DevTools/UserspaceEmulator/Region.h
+++ b/Userland/DevTools/UserspaceEmulator/Region.h
@@ -21,7 +21,7 @@ class Region {
public:
virtual ~Region() = default;
- const Range& range() const { return m_range; }
+ Range const& range() const { return m_range; }
u32 base() const { return m_range.base().get(); }
u32 size() const { return m_range.size(); }
@@ -63,7 +63,7 @@ public:
virtual u8* shadow_data() = 0;
Emulator& emulator() { return m_emulator; }
- const Emulator& emulator() const { return m_emulator; }
+ Emulator const& emulator() const { return m_emulator; }
template<typename T>
bool fast_is() const = delete;
diff --git a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp
index 5c664d2fdf..50782cd0d9 100644
--- a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp
+++ b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp
@@ -46,7 +46,7 @@
namespace UserspaceEmulator {
template<typename T>
-ALWAYS_INLINE void warn_if_uninitialized(T value_with_shadow, const char* message)
+ALWAYS_INLINE void warn_if_uninitialized(T value_with_shadow, char const* message)
{
if (value_with_shadow.is_uninitialized()) [[unlikely]] {
reportln("\033[31;1mWarning! Use of uninitialized value: {}\033[0m\n", message);
@@ -54,7 +54,7 @@ ALWAYS_INLINE void warn_if_uninitialized(T value_with_shadow, const char* messag
}
}
-ALWAYS_INLINE void SoftCPU::warn_if_flags_tainted(const char* message) const
+ALWAYS_INLINE void SoftCPU::warn_if_flags_tainted(char const* message) const
{
if (m_flags_tainted) [[unlikely]] {
reportln("\n=={}== \033[31;1mConditional depends on uninitialized data\033[0m ({})\n", getpid(), message);
@@ -208,7 +208,7 @@ void SoftCPU::push_string(StringView string)
m_emulator.mmu().write8({ 0x23, esp().value() + string.length() }, shadow_wrap_as_initialized((u8)'\0'));
}
-void SoftCPU::push_buffer(const u8* data, size_t size)
+void SoftCPU::push_buffer(u8 const* data, size_t size)
{
set_esp({ esp().value() - size, esp().shadow() });
warn_if_uninitialized(esp(), "push_buffer");
diff --git a/Userland/DevTools/UserspaceEmulator/SoftCPU.h b/Userland/DevTools/UserspaceEmulator/SoftCPU.h
index e139a3a810..070d451092 100644
--- a/Userland/DevTools/UserspaceEmulator/SoftCPU.h
+++ b/Userland/DevTools/UserspaceEmulator/SoftCPU.h
@@ -81,7 +81,7 @@ public:
ValueWithShadow<u16> pop16();
void push_string(StringView);
- void push_buffer(const u8* data, size_t);
+ void push_buffer(u8 const* data, size_t);
u16 segment(X86::SegmentRegister seg) const { return m_segment[(int)seg]; }
u16& segment(X86::SegmentRegister seg) { return m_segment[(int)seg]; }
@@ -463,7 +463,7 @@ public:
m_flags_tainted = a.is_uninitialized() || b.is_uninitialized() || c.is_uninitialized();
}
- void warn_if_flags_tainted(const char* message) const;
+ void warn_if_flags_tainted(char const* message) const;
// ^X86::InstructionStream
virtual bool can_read() override { return false; }
diff --git a/Userland/DevTools/UserspaceEmulator/SoftFPU.cpp b/Userland/DevTools/UserspaceEmulator/SoftFPU.cpp
index a5146a13e0..67c2bba6a9 100644
--- a/Userland/DevTools/UserspaceEmulator/SoftFPU.cpp
+++ b/Userland/DevTools/UserspaceEmulator/SoftFPU.cpp
@@ -28,7 +28,7 @@
} while (0)
template<typename T>
-ALWAYS_INLINE void warn_if_uninitialized(T value_with_shadow, const char* message)
+ALWAYS_INLINE void warn_if_uninitialized(T value_with_shadow, char const* message)
{
if (value_with_shadow.is_uninitialized()) [[unlikely]] {
reportln("\033[31;1mWarning! Use of uninitialized value: {}\033[0m\n", message);
diff --git a/Userland/DevTools/UserspaceEmulator/SoftMMU.cpp b/Userland/DevTools/UserspaceEmulator/SoftMMU.cpp
index b11e968a15..ab99784cb7 100644
--- a/Userland/DevTools/UserspaceEmulator/SoftMMU.cpp
+++ b/Userland/DevTools/UserspaceEmulator/SoftMMU.cpp
@@ -305,11 +305,11 @@ void SoftMMU::write256(X86::LogicalAddress address, ValueWithShadow<u256> value)
region->write256(address.offset() - region->base(), value);
}
-void SoftMMU::copy_to_vm(FlatPtr destination, const void* source, size_t size)
+void SoftMMU::copy_to_vm(FlatPtr destination, void const* source, size_t size)
{
// FIXME: We should have a way to preserve the shadow data here as well.
for (size_t i = 0; i < size; ++i)
- write8({ 0x23, destination + i }, shadow_wrap_as_initialized(((const u8*)source)[i]));
+ write8({ 0x23, destination + i }, shadow_wrap_as_initialized(((u8 const*)source)[i]));
}
void SoftMMU::copy_from_vm(void* destination, const FlatPtr source, size_t size)
@@ -336,7 +336,7 @@ bool SoftMMU::fast_fill_memory8(X86::LogicalAddress address, size_t size, ValueW
if (!region->contains(address.offset() + size - 1))
return false;
- if (is<MmapRegion>(*region) && static_cast<const MmapRegion&>(*region).is_malloc_block()) {
+ if (is<MmapRegion>(*region) && static_cast<MmapRegion const&>(*region).is_malloc_block()) {
if (auto* tracer = m_emulator.malloc_tracer()) {
// FIXME: Add a way to audit an entire range of memory instead of looping here!
for (size_t i = 0; i < size; ++i) {
@@ -361,7 +361,7 @@ bool SoftMMU::fast_fill_memory32(X86::LogicalAddress address, size_t count, Valu
if (!region->contains(address.offset() + (count * sizeof(u32)) - 1))
return false;
- if (is<MmapRegion>(*region) && static_cast<const MmapRegion&>(*region).is_malloc_block()) {
+ if (is<MmapRegion>(*region) && static_cast<MmapRegion const&>(*region).is_malloc_block()) {
if (auto* tracer = m_emulator.malloc_tracer()) {
// FIXME: Add a way to audit an entire range of memory instead of looping here!
for (size_t i = 0; i < count; ++i) {
diff --git a/Userland/DevTools/UserspaceEmulator/SoftMMU.h b/Userland/DevTools/UserspaceEmulator/SoftMMU.h
index 24f1a27b41..f36bb39bd6 100644
--- a/Userland/DevTools/UserspaceEmulator/SoftMMU.h
+++ b/Userland/DevTools/UserspaceEmulator/SoftMMU.h
@@ -88,7 +88,7 @@ public:
bool fast_fill_memory8(X86::LogicalAddress, size_t size, ValueWithShadow<u8>);
bool fast_fill_memory32(X86::LogicalAddress, size_t size, ValueWithShadow<u32>);
- void copy_to_vm(FlatPtr destination, const void* source, size_t);
+ void copy_to_vm(FlatPtr destination, void const* source, size_t);
void copy_from_vm(void* destination, const FlatPtr source, size_t);
ByteBuffer copy_buffer_from_vm(const FlatPtr source, size_t);
diff --git a/Userland/DevTools/UserspaceEmulator/ValueWithShadow.h b/Userland/DevTools/UserspaceEmulator/ValueWithShadow.h
index e7ad1988a0..6dc10e0653 100644
--- a/Userland/DevTools/UserspaceEmulator/ValueWithShadow.h
+++ b/Userland/DevTools/UserspaceEmulator/ValueWithShadow.h
@@ -116,7 +116,7 @@ public:
return false;
}
- ValueAndShadowReference<T>& operator=(const ValueWithShadow<T>&);
+ ValueAndShadowReference<T>& operator=(ValueWithShadow<T> const&);
T shadow_as_value() const requires(IsTriviallyConstructible<T>)
{
@@ -165,14 +165,14 @@ ALWAYS_INLINE ValueWithShadow<T> shadow_wrap_with_taint_from(T value, U const& t
}
template<typename T>
-inline ValueWithShadow<T>::ValueWithShadow(const ValueAndShadowReference<T>& other)
+inline ValueWithShadow<T>::ValueWithShadow(ValueAndShadowReference<T> const& other)
: m_value(other.value())
, m_shadow(other.shadow())
{
}
template<typename T>
-inline ValueAndShadowReference<T>& ValueAndShadowReference<T>::operator=(const ValueWithShadow<T>& other)
+inline ValueAndShadowReference<T>& ValueAndShadowReference<T>::operator=(ValueWithShadow<T> const& other)
{
m_value = other.value();
m_shadow = other.shadow();
diff --git a/Userland/DynamicLoader/main.cpp b/Userland/DynamicLoader/main.cpp
index b6f792b509..872c260622 100644
--- a/Userland/DynamicLoader/main.cpp
+++ b/Userland/DynamicLoader/main.cpp
@@ -42,7 +42,7 @@ static void perform_self_relocations(auxv_t* auxvp)
static void display_help()
{
- const char message[] =
+ char const message[] =
R"(You have invoked `Loader.so'. This is the helper program for programs that
use shared libraries. Special directives embedded in executables tell the
kernel to load this program.
@@ -85,7 +85,7 @@ void _entry(int argc, char** argv, char** envp)
main_program_fd = auxvp->a_un.a_val;
}
if (auxvp->a_type == ELF::AuxiliaryValue::ExecFilename) {
- main_program_name = (const char*)auxvp->a_un.a_ptr;
+ main_program_name = (char const*)auxvp->a_un.a_ptr;
}
if (auxvp->a_type == ELF::AuxiliaryValue::Secure) {
is_secure = auxvp->a_un.a_val == 1;
diff --git a/Userland/DynamicLoader/misc.cpp b/Userland/DynamicLoader/misc.cpp
index 9f3662e4b8..3bd22e2eec 100644
--- a/Userland/DynamicLoader/misc.cpp
+++ b/Userland/DynamicLoader/misc.cpp
@@ -8,7 +8,7 @@
#include <AK/Format.h>
extern "C" {
-const char* __cxa_demangle(const char*, void*, void*, int*)
+char const* __cxa_demangle(char const*, void*, void*, int*)
{
dbgln("WARNING: __cxa_demangle not supported");
return "";
diff --git a/Userland/DynamicLoader/misc.h b/Userland/DynamicLoader/misc.h
index cfa26ef95e..104ebc0de3 100644
--- a/Userland/DynamicLoader/misc.h
+++ b/Userland/DynamicLoader/misc.h
@@ -7,7 +7,7 @@
#pragma once
extern "C" {
-const char* __cxa_demangle(const char*, void*, void*, int*);
+char const* __cxa_demangle(char const*, void*, void*, int*);
extern void* __dso_handle;
}
diff --git a/Userland/Games/Breakout/Game.cpp b/Userland/Games/Breakout/Game.cpp
index c8720ef22b..bf38388717 100644
--- a/Userland/Games/Breakout/Game.cpp
+++ b/Userland/Games/Breakout/Game.cpp
@@ -139,7 +139,7 @@ void Game::paint_event(GUI::PaintEvent& event)
painter.draw_text(lives_left_rect(), String::formatted("Lives: {}", m_lives), Gfx::TextAlignment::Center, Color::White);
if (m_paused) {
- const char* msg = m_cheater ? "C H E A T E R" : "P A U S E D";
+ char const* msg = m_cheater ? "C H E A T E R" : "P A U S E D";
painter.draw_text(pause_rect(), msg, Gfx::TextAlignment::Center, Color::White);
}
}
diff --git a/Userland/Games/Breakout/Game.h b/Userland/Games/Breakout/Game.h
index 40e68cee0a..998ba51e6a 100644
--- a/Userland/Games/Breakout/Game.h
+++ b/Userland/Games/Breakout/Game.h
@@ -86,7 +86,7 @@ private:
Gfx::IntRect pause_rect() const
{
- const char* msg = m_cheater ? "C H E A T E R" : "P A U S E D";
+ char const* msg = m_cheater ? "C H E A T E R" : "P A U S E D";
int msg_width = font().width(msg);
int msg_height = font().glyph_height();
return { (game_width / 2) - (msg_width / 2), (game_height / 2) - (msg_height / 2), msg_width, msg_height };
diff --git a/Userland/Games/Chess/ChessWidget.cpp b/Userland/Games/Chess/ChessWidget.cpp
index ee2ea37db7..63e7815a94 100644
--- a/Userland/Games/Chess/ChessWidget.cpp
+++ b/Userland/Games/Chess/ChessWidget.cpp
@@ -24,9 +24,9 @@ ChessWidget::ChessWidget()
void ChessWidget::paint_event(GUI::PaintEvent& event)
{
- const int min_size = min(width(), height());
- const int widget_offset_x = (window()->width() - min_size) / 2;
- const int widget_offset_y = (window()->height() - min_size) / 2;
+ int const min_size = min(width(), height());
+ int const widget_offset_x = (window()->width() - min_size) / 2;
+ int const widget_offset_y = (window()->height() - min_size) / 2;
GUI::Frame::paint_event(event);
@@ -144,7 +144,7 @@ void ChessWidget::paint_event(GUI::PaintEvent& event)
Gfx::IntPoint move_point;
Gfx::IntPoint point_offset = { tile_width / 3, tile_height / 3 };
Gfx::IntSize rect_size = { tile_width / 3, tile_height / 3 };
- for (const auto& square : m_available_moves) {
+ for (auto const& square : m_available_moves) {
if (side() == Chess::Color::White) {
move_point = { square.file * tile_width, (7 - square.rank) * tile_height };
} else {
@@ -165,9 +165,9 @@ void ChessWidget::paint_event(GUI::PaintEvent& event)
void ChessWidget::mousedown_event(GUI::MouseEvent& event)
{
- const int min_size = min(width(), height());
- const int widget_offset_x = (window()->width() - min_size) / 2;
- const int widget_offset_y = (window()->height() - min_size) / 2;
+ int const min_size = min(width(), height());
+ int const widget_offset_x = (window()->width() - min_size) / 2;
+ int const widget_offset_y = (window()->height() - min_size) / 2;
if (!frame_inner_rect().contains(event.position()))
return;
@@ -306,9 +306,9 @@ void ChessWidget::mouseup_event(GUI::MouseEvent& event)
void ChessWidget::mousemove_event(GUI::MouseEvent& event)
{
- const int min_size = min(width(), height());
- const int widget_offset_x = (window()->width() - min_size) / 2;
- const int widget_offset_y = (window()->height() - min_size) / 2;
+ int const min_size = min(width(), height());
+ int const widget_offset_x = (window()->width() - min_size) / 2;
+ int const widget_offset_y = (window()->height() - min_size) / 2;
if (!frame_inner_rect().contains(event.position()))
return;
@@ -391,9 +391,9 @@ void ChessWidget::set_piece_set(StringView set)
Chess::Square ChessWidget::mouse_to_square(GUI::MouseEvent& event) const
{
- const int min_size = min(width(), height());
- const int widget_offset_x = (window()->width() - min_size) / 2;
- const int widget_offset_y = (window()->height() - min_size) / 2;
+ int const min_size = min(width(), height());
+ int const widget_offset_x = (window()->width() - min_size) / 2;
+ int const widget_offset_y = (window()->height() - min_size) / 2;
int tile_width = min_size / 8;
int tile_height = min_size / 8;
@@ -405,7 +405,7 @@ Chess::Square ChessWidget::mouse_to_square(GUI::MouseEvent& event) const
}
}
-RefPtr<Gfx::Bitmap> ChessWidget::get_piece_graphic(const Chess::Piece& piece) const
+RefPtr<Gfx::Bitmap> ChessWidget::get_piece_graphic(Chess::Piece const& piece) const
{
return m_pieces.get(piece).value();
}
diff --git a/Userland/Games/Chess/ChessWidget.h b/Userland/Games/Chess/ChessWidget.h
index a62c00d193..ad80b767f5 100644
--- a/Userland/Games/Chess/ChessWidget.h
+++ b/Userland/Games/Chess/ChessWidget.h
@@ -27,22 +27,22 @@ public:
virtual void keydown_event(GUI::KeyEvent&) override;
Chess::Board& board() { return m_board; };
- const Chess::Board& board() const { return m_board; };
+ Chess::Board const& board() const { return m_board; };
Chess::Board& board_playback() { return m_board_playback; };
- const Chess::Board& board_playback() const { return m_board_playback; };
+ Chess::Board const& board_playback() const { return m_board_playback; };
Chess::Color side() const { return m_side; };
void set_side(Chess::Color side) { m_side = side; };
void set_piece_set(StringView set);
- const String& piece_set() const { return m_piece_set; };
+ String const& piece_set() const { return m_piece_set; };
Chess::Square mouse_to_square(GUI::MouseEvent& event) const;
bool drag_enabled() const { return m_drag_enabled; }
void set_drag_enabled(bool e) { m_drag_enabled = e; }
- RefPtr<Gfx::Bitmap> get_piece_graphic(const Chess::Piece& piece) const;
+ RefPtr<Gfx::Bitmap> get_piece_graphic(Chess::Piece const& piece) const;
bool show_available_moves() const { return m_show_available_moves; }
void set_show_available_moves(bool e) { m_show_available_moves = e; }
@@ -61,8 +61,8 @@ public:
Color light_square_color;
};
- const BoardTheme& board_theme() const { return m_board_theme; }
- void set_board_theme(const BoardTheme& theme) { m_board_theme = theme; }
+ BoardTheme const& board_theme() const { return m_board_theme; }
+ void set_board_theme(BoardTheme const& theme) { m_board_theme = theme; }
void set_board_theme(StringView name);
enum class PlaybackDirection {
@@ -101,7 +101,7 @@ public:
return Type::None;
}
- bool operator==(const BoardMarking& other) const { return from == other.from && to == other.to; }
+ bool operator==(BoardMarking const& other) const { return from == other.from && to == other.to; }
};
private:
diff --git a/Userland/Games/Chess/Engine.cpp b/Userland/Games/Chess/Engine.cpp
index 90cb414113..5bc0f7626e 100644
--- a/Userland/Games/Chess/Engine.cpp
+++ b/Userland/Games/Chess/Engine.cpp
@@ -37,7 +37,7 @@ Engine::Engine(StringView command)
posix_spawn_file_actions_adddup2(&file_actions, rpipefds[1], STDOUT_FILENO);
String cstr(command);
- const char* argv[] = { cstr.characters(), nullptr };
+ char const* argv[] = { cstr.characters(), nullptr };
if (posix_spawnp(&m_pid, cstr.characters(), &file_actions, nullptr, const_cast<char**>(argv), environ) < 0) {
perror("posix_spawnp");
VERIFY_NOT_REACHED();
@@ -59,7 +59,7 @@ Engine::Engine(StringView command)
send_command(Chess::UCI::UCICommand());
}
-void Engine::handle_bestmove(const Chess::UCI::BestMoveCommand& command)
+void Engine::handle_bestmove(Chess::UCI::BestMoveCommand const& command)
{
if (m_bestmove_callback)
m_bestmove_callback(command.move());
diff --git a/Userland/Games/Chess/Engine.h b/Userland/Games/Chess/Engine.h
index c41eaec0e9..d91127714b 100644
--- a/Userland/Games/Chess/Engine.h
+++ b/Userland/Games/Chess/Engine.h
@@ -17,13 +17,13 @@ public:
Engine(StringView command);
- Engine(const Engine&) = delete;
- Engine& operator=(const Engine&) = delete;
+ Engine(Engine const&) = delete;
+ Engine& operator=(Engine const&) = delete;
- virtual void handle_bestmove(const Chess::UCI::BestMoveCommand&) override;
+ virtual void handle_bestmove(Chess::UCI::BestMoveCommand const&) override;
template<typename Callback>
- void get_best_move(const Chess::Board& board, int time_limit, Callback&& callback)
+ void get_best_move(Chess::Board const& board, int time_limit, Callback&& callback)
{
send_command(Chess::UCI::PositionCommand({}, board.moves()));
Chess::UCI::GoCommand go_command;
diff --git a/Userland/Games/FlappyBug/Game.h b/Userland/Games/FlappyBug/Game.h
index 58ed680f56..f2d01329e5 100644
--- a/Userland/Games/FlappyBug/Game.h
+++ b/Userland/Games/FlappyBug/Game.h
@@ -41,9 +41,9 @@ private:
public:
struct Bug {
- const float x { 50 };
- const float radius { 16 };
- const float starting_y { 200 };
+ float const x { 50 };
+ float const radius { 16 };
+ float const starting_y { 200 };
NonnullRefPtr<Gfx::Bitmap> falling_bitmap;
NonnullRefPtr<Gfx::Bitmap> flapping_bitmap;
float y {};
@@ -81,13 +81,13 @@ public:
void flap()
{
- const float flap_strength = 10.0f;
+ float const flap_strength = 10.0f;
velocity = -flap_strength;
}
void fall()
{
- const float gravity = 1.0f;
+ float const gravity = 1.0f;
velocity += gravity;
}
@@ -98,7 +98,7 @@ public:
};
struct Obstacle {
- const float width { 20 };
+ float const width { 20 };
Color color { Color::DarkGray };
float x {};
float gap_top_y { 200 };
diff --git a/Userland/Games/GameOfLife/Board.h b/Userland/Games/GameOfLife/Board.h
index 227311c1bb..8f1408858f 100644
--- a/Userland/Games/GameOfLife/Board.h
+++ b/Userland/Games/GameOfLife/Board.h
@@ -23,7 +23,7 @@ public:
void toggle_cell(size_t row, size_t column);
void set_cell(size_t row, size_t column, bool on);
bool cell(size_t row, size_t column) const;
- const Vector<Vector<bool>>& cells() const { return m_cells; }
+ Vector<Vector<bool>> const& cells() const { return m_cells; }
void run_generation();
bool is_stalled() const { return m_stalled; }
diff --git a/Userland/Games/GameOfLife/BoardWidget.h b/Userland/Games/GameOfLife/BoardWidget.h
index 97d1b5df30..ef185cb5b9 100644
--- a/Userland/Games/GameOfLife/BoardWidget.h
+++ b/Userland/Games/GameOfLife/BoardWidget.h
@@ -45,7 +45,7 @@ public:
Optional<Board::RowAndColumn> get_row_and_column_for_point(int x, int y) const;
void resize_board(size_t rows, size_t columns);
- const Board* board() const { return m_board.ptr(); }
+ Board const* board() const { return m_board.ptr(); }
bool is_running() const { return m_running; }
void set_running(bool r);
diff --git a/Userland/Games/GameOfLife/main.cpp b/Userland/Games/GameOfLife/main.cpp
index dabb0caac3..e655265d9f 100644
--- a/Userland/Games/GameOfLife/main.cpp
+++ b/Userland/Games/GameOfLife/main.cpp
@@ -23,7 +23,7 @@
#include <LibGUI/Window.h>
#include <LibMain/Main.h>
-const char* click_tip = "Tip: click the board to toggle individual cells, or click+drag to toggle multiple cells";
+char const* click_tip = "Tip: click the board to toggle individual cells, or click+drag to toggle multiple cells";
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
diff --git a/Userland/Games/Hearts/Game.cpp b/Userland/Games/Hearts/Game.cpp
index 1b377931a5..444b0d89e7 100644
--- a/Userland/Games/Hearts/Game.cpp
+++ b/Userland/Games/Hearts/Game.cpp
@@ -929,13 +929,13 @@ void Game::dump_state() const
auto& player = m_players[i];
dbgln("Player {}", player.name);
dbgln("Hand:");
- for (const auto& card : player.hand)
+ for (auto const& card : player.hand)
if (card.is_null())
dbgln(" <empty>");
else
dbgln(" {}", *card);
dbgln("Taken:");
- for (const auto& card : player.cards_taken)
+ for (auto const& card : player.cards_taken)
dbgln(" {}", card);
}
}
diff --git a/Userland/Games/Hearts/Player.cpp b/Userland/Games/Hearts/Player.cpp
index a30f3ddb5a..9094122d38 100644
--- a/Userland/Games/Hearts/Player.cpp
+++ b/Userland/Games/Hearts/Player.cpp
@@ -158,7 +158,7 @@ bool Player::has_card_of_suit(Card::Suit suit)
return matching_card.has_value();
}
-void Player::remove_cards(const NonnullRefPtrVector<Card>& cards)
+void Player::remove_cards(NonnullRefPtrVector<Card> const& cards)
{
for (auto& card : cards) {
hand.remove_first_matching([&card](auto& other_card) {
diff --git a/Userland/Games/Minesweeper/Field.h b/Userland/Games/Minesweeper/Field.h
index 681e2d364b..b4d986d42f 100644
--- a/Userland/Games/Minesweeper/Field.h
+++ b/Userland/Games/Minesweeper/Field.h
@@ -122,7 +122,7 @@ private:
void set_flag(Square&, bool);
Square& square(size_t row, size_t column) { return *m_squares[row * columns() + column]; }
- const Square& square(size_t row, size_t column) const { return *m_squares[row * columns() + column]; }
+ Square const& square(size_t row, size_t column) const { return *m_squares[row * columns() + column]; }
void flood_fill(Square&);
void on_square_clicked_impl(Square&, bool);
diff --git a/Userland/Games/Snake/SnakeGame.cpp b/Userland/Games/Snake/SnakeGame.cpp
index 059e97125d..c5b3881517 100644
--- a/Userland/Games/Snake/SnakeGame.cpp
+++ b/Userland/Games/Snake/SnakeGame.cpp
@@ -41,7 +41,7 @@ void SnakeGame::reset()
update();
}
-bool SnakeGame::is_available(const Coordinate& coord)
+bool SnakeGame::is_available(Coordinate const& coord)
{
for (size_t i = 0; i < m_tail.size(); ++i) {
if (m_tail[i] == coord)
@@ -171,7 +171,7 @@ void SnakeGame::keydown_event(GUI::KeyEvent& event)
}
}
-Gfx::IntRect SnakeGame::cell_rect(const Coordinate& coord) const
+Gfx::IntRect SnakeGame::cell_rect(Coordinate const& coord) const
{
auto game_rect = frame_inner_rect();
auto cell_size = Gfx::IntSize(game_rect.width() / m_columns, game_rect.height() / m_rows);
@@ -224,7 +224,7 @@ void SnakeGame::queue_velocity(int v, int h)
m_velocity_queue.enqueue({ v, h });
}
-const SnakeGame::Velocity& SnakeGame::last_velocity() const
+SnakeGame::Velocity const& SnakeGame::last_velocity() const
{
if (!m_velocity_queue.is_empty())
return m_velocity_queue.last();
diff --git a/Userland/Games/Snake/SnakeGame.h b/Userland/Games/Snake/SnakeGame.h
index 4b7e36ec4a..063b6c8474 100644
--- a/Userland/Games/Snake/SnakeGame.h
+++ b/Userland/Games/Snake/SnakeGame.h
@@ -29,7 +29,7 @@ private:
int row { 0 };
int column { 0 };
- bool operator==(const Coordinate& other) const
+ bool operator==(Coordinate const& other) const
{
return row == other.row && column == other.column;
}
@@ -42,10 +42,10 @@ private:
void game_over();
void spawn_fruit();
- bool is_available(const Coordinate&);
+ bool is_available(Coordinate const&);
void queue_velocity(int v, int h);
- const Velocity& last_velocity() const;
- Gfx::IntRect cell_rect(const Coordinate&) const;
+ Velocity const& last_velocity() const;
+ Gfx::IntRect cell_rect(Coordinate const&) const;
Gfx::IntRect score_rect() const;
Gfx::IntRect high_score_rect() const;
diff --git a/Userland/Games/Solitaire/Game.cpp b/Userland/Games/Solitaire/Game.cpp
index d7c7055b66..a3fc67f156 100644
--- a/Userland/Games/Solitaire/Game.cpp
+++ b/Userland/Games/Solitaire/Game.cpp
@@ -660,7 +660,7 @@ void Game::dump_layout() const
{
if constexpr (SOLITAIRE_DEBUG) {
dbgln("------------------------------");
- for (const auto& stack : m_stacks)
+ for (auto const& stack : m_stacks)
dbgln("{}", stack);
}
}
diff --git a/Userland/Games/Solitaire/Game.h b/Userland/Games/Solitaire/Game.h
index 06da854500..b3afd1c803 100644
--- a/Userland/Games/Solitaire/Game.h
+++ b/Userland/Games/Solitaire/Game.h
@@ -143,7 +143,7 @@ private:
static constexpr Array piles = { Pile1, Pile2, Pile3, Pile4, Pile5, Pile6, Pile7 };
static constexpr Array foundations = { Foundation1, Foundation2, Foundation3, Foundation4 };
- ALWAYS_INLINE const WasteRecycleRules& recycle_rules()
+ ALWAYS_INLINE WasteRecycleRules const& recycle_rules()
{
static constexpr Array<WasteRecycleRules, 2> rules { {
{ 0, -100 },
diff --git a/Userland/Libraries/LibArchive/Tar.cpp b/Userland/Libraries/LibArchive/Tar.cpp
index 65954ba64f..41b69dab59 100644
--- a/Userland/Libraries/LibArchive/Tar.cpp
+++ b/Userland/Libraries/LibArchive/Tar.cpp
@@ -12,8 +12,8 @@ namespace Archive {
unsigned TarFileHeader::expected_checksum() const
{
auto checksum = 0u;
- const u8* u8_this = reinterpret_cast<const u8*>(this);
- const u8* u8_m_checksum = reinterpret_cast<const u8*>(&m_checksum);
+ u8 const* u8_this = reinterpret_cast<u8 const*>(this);
+ u8 const* u8_m_checksum = reinterpret_cast<u8 const*>(&m_checksum);
for (auto i = 0u; i < sizeof(TarFileHeader); ++i) {
if (u8_this + i >= u8_m_checksum && u8_this + i < u8_m_checksum + sizeof(m_checksum)) {
checksum += ' ';
diff --git a/Userland/Libraries/LibArchive/Tar.h b/Userland/Libraries/LibArchive/Tar.h
index 3310a6140b..f175b3a5e0 100644
--- a/Userland/Libraries/LibArchive/Tar.h
+++ b/Userland/Libraries/LibArchive/Tar.h
@@ -38,7 +38,7 @@ constexpr StringView posix1_tar_magic = ""; // POSIX.1-1988 format magic
constexpr StringView posix1_tar_version = ""; // POSIX.1-1988 format version
template<size_t N>
-static size_t get_field_as_integral(const char (&field)[N])
+static size_t get_field_as_integral(char const (&field)[N])
{
size_t value = 0;
for (size_t i = 0; i < N; ++i) {
@@ -53,7 +53,7 @@ static size_t get_field_as_integral(const char (&field)[N])
}
template<size_t N>
-static StringView get_field_as_string_view(const char (&field)[N])
+static StringView get_field_as_string_view(char const (&field)[N])
{
return { field, min(__builtin_strlen(field), N) };
}
@@ -95,23 +95,23 @@ public:
// FIXME: support ustar filename prefix
StringView prefix() const { return get_field_as_string_view(m_prefix); }
- void set_filename(const String& filename) { set_field(m_filename, filename); }
+ void set_filename(String const& filename) { set_field(m_filename, filename); }
void set_mode(mode_t mode) { set_octal_field(m_mode, mode); }
void set_uid(uid_t uid) { set_octal_field(m_uid, uid); }
void set_gid(gid_t gid) { set_octal_field(m_gid, gid); }
void set_size(size_t size) { set_octal_field(m_size, size); }
void set_timestamp(time_t timestamp) { set_octal_field(m_timestamp, timestamp); }
void set_type_flag(TarFileType type) { m_type_flag = to_underlying(type); }
- void set_link_name(const String& link_name) { set_field(m_link_name, link_name); }
+ void set_link_name(String const& link_name) { set_field(m_link_name, link_name); }
// magic doesn't necessarily include a null byte
void set_magic(StringView magic) { set_field(m_magic, magic); }
// version doesn't necessarily include a null byte
void set_version(StringView version) { set_field(m_version, version); }
- void set_owner_name(const String& owner_name) { set_field(m_owner_name, owner_name); }
- void set_group_name(const String& group_name) { set_field(m_group_name, group_name); }
+ void set_owner_name(String const& owner_name) { set_field(m_owner_name, owner_name); }
+ void set_group_name(String const& group_name) { set_field(m_group_name, group_name); }
void set_major(int major) { set_octal_field(m_major, major); }
void set_minor(int minor) { set_octal_field(m_minor, minor); }
- void set_prefix(const String& prefix) { set_field(m_prefix, prefix); }
+ void set_prefix(String const& prefix) { set_field(m_prefix, prefix); }
unsigned expected_checksum() const;
void calculate_checksum();
diff --git a/Userland/Libraries/LibArchive/TarStream.cpp b/Userland/Libraries/LibArchive/TarStream.cpp
index 2b12eea374..80945af341 100644
--- a/Userland/Libraries/LibArchive/TarStream.cpp
+++ b/Userland/Libraries/LibArchive/TarStream.cpp
@@ -128,7 +128,7 @@ TarOutputStream::TarOutputStream(OutputStream& stream)
{
}
-void TarOutputStream::add_directory(const String& path, mode_t mode)
+void TarOutputStream::add_directory(String const& path, mode_t mode)
{
VERIFY(!m_finished);
TarFileHeader header {};
@@ -144,7 +144,7 @@ void TarOutputStream::add_directory(const String& path, mode_t mode)
VERIFY(m_stream.write_or_error(Bytes { &padding, block_size - sizeof(header) }));
}
-void TarOutputStream::add_file(const String& path, mode_t mode, ReadonlyBytes bytes)
+void TarOutputStream::add_file(String const& path, mode_t mode, ReadonlyBytes bytes)
{
VERIFY(!m_finished);
TarFileHeader header {};
diff --git a/Userland/Libraries/LibArchive/TarStream.h b/Userland/Libraries/LibArchive/TarStream.h
index 5ffa04991e..a27c30c971 100644
--- a/Userland/Libraries/LibArchive/TarStream.h
+++ b/Userland/Libraries/LibArchive/TarStream.h
@@ -37,7 +37,7 @@ public:
void advance();
bool finished() const { return m_finished; }
bool valid() const;
- const TarFileHeader& header() const { return m_header; }
+ TarFileHeader const& header() const { return m_header; }
TarFileStream file_contents();
template<VoidFunction<StringView, StringView> F>
@@ -56,8 +56,8 @@ private:
class TarOutputStream {
public:
TarOutputStream(OutputStream&);
- void add_file(const String& path, mode_t, ReadonlyBytes);
- void add_directory(const String& path, mode_t);
+ void add_file(String const& path, mode_t, ReadonlyBytes);
+ void add_directory(String const& path, mode_t);
void finish();
private:
diff --git a/Userland/Libraries/LibArchive/Zip.cpp b/Userland/Libraries/LibArchive/Zip.cpp
index d5aa5d112f..71d173bab3 100644
--- a/Userland/Libraries/LibArchive/Zip.cpp
+++ b/Userland/Libraries/LibArchive/Zip.cpp
@@ -80,7 +80,7 @@ Optional<Zip> Zip::try_create(ReadonlyBytes buffer)
};
}
-bool Zip::for_each_member(Function<IterationDecision(const ZipMember&)> callback)
+bool Zip::for_each_member(Function<IterationDecision(ZipMember const&)> callback)
{
size_t member_offset = m_members_start_offset;
for (size_t i = 0; i < m_member_count; i++) {
@@ -119,7 +119,7 @@ static u16 minimum_version_needed(ZipCompressionMethod method)
return method == ZipCompressionMethod::Deflate ? 20 : 10;
}
-void ZipOutputStream::add_member(const ZipMember& member)
+void ZipOutputStream::add_member(ZipMember const& member)
{
VERIFY(!m_finished);
VERIFY(member.name.length() <= UINT16_MAX);
@@ -151,7 +151,7 @@ void ZipOutputStream::finish()
auto file_header_offset = 0u;
auto central_directory_size = 0u;
- for (const ZipMember& member : m_members) {
+ for (ZipMember const& member : m_members) {
auto zip_version = minimum_version_needed(member.compression_method);
CentralDirectoryRecord central_directory_record {
.made_by_version = zip_version,
diff --git a/Userland/Libraries/LibArchive/Zip.h b/Userland/Libraries/LibArchive/Zip.h
index 1575743154..95913f7b5c 100644
--- a/Userland/Libraries/LibArchive/Zip.h
+++ b/Userland/Libraries/LibArchive/Zip.h
@@ -42,7 +42,7 @@ struct [[gnu::packed]] EndOfCentralDirectory {
u32 central_directory_size;
u32 central_directory_offset;
u16 comment_length;
- const u8* comment;
+ u8 const* comment;
bool read(ReadonlyBytes buffer)
{
@@ -103,9 +103,9 @@ struct [[gnu::packed]] CentralDirectoryRecord {
u16 internal_attributes;
u32 external_attributes;
u32 local_file_header_offset;
- const u8* name;
- const u8* extra_data;
- const u8* comment;
+ u8 const* name;
+ u8 const* extra_data;
+ u8 const* comment;
bool read(ReadonlyBytes buffer)
{
@@ -167,9 +167,9 @@ struct [[gnu::packed]] LocalFileHeader {
u32 uncompressed_size;
u16 name_length;
u16 extra_data_length;
- const u8* name;
- const u8* extra_data;
- const u8* compressed_data;
+ u8 const* name;
+ u8 const* extra_data;
+ u8 const* compressed_data;
bool read(ReadonlyBytes buffer)
{
@@ -218,7 +218,7 @@ struct ZipMember {
class Zip {
public:
static Optional<Zip> try_create(ReadonlyBytes buffer);
- bool for_each_member(Function<IterationDecision(const ZipMember&)>);
+ bool for_each_member(Function<IterationDecision(ZipMember const&)>);
private:
static bool find_end_of_central_directory_offset(ReadonlyBytes, size_t& offset);
@@ -237,7 +237,7 @@ private:
class ZipOutputStream {
public:
ZipOutputStream(OutputStream&);
- void add_member(const ZipMember&);
+ void add_member(ZipMember const&);
void finish();
private:
diff --git a/Userland/Libraries/LibAudio/Buffer.h b/Userland/Libraries/LibAudio/Buffer.h
index 536d313998..cb05a06219 100644
--- a/Userland/Libraries/LibAudio/Buffer.h
+++ b/Userland/Libraries/LibAudio/Buffer.h
@@ -47,7 +47,7 @@ public:
return MUST(adopt_nonnull_ref_or_enomem(new (nothrow) Buffer));
}
- Sample const* samples() const { return (const Sample*)data(); }
+ Sample const* samples() const { return (Sample const*)data(); }
ErrorOr<FixedArray<Sample>> to_sample_array() const
{
@@ -86,7 +86,7 @@ private:
Core::AnonymousBuffer m_buffer;
const i32 m_id { -1 };
- const int m_sample_count { 0 };
+ int const m_sample_count { 0 };
};
// This only works for double resamplers, and therefore cannot be part of the class
diff --git a/Userland/Libraries/LibAudio/FlacLoader.h b/Userland/Libraries/LibAudio/FlacLoader.h
index fdd19a8182..23f1fba00f 100644
--- a/Userland/Libraries/LibAudio/FlacLoader.h
+++ b/Userland/Libraries/LibAudio/FlacLoader.h
@@ -101,7 +101,7 @@ private:
u16 m_min_block_size { 0 };
u16 m_max_block_size { 0 };
// Frames are units of encoded audio data, both of these are 24-bit
- u32 m_min_frame_size { 0 }; //24 bit
+ u32 m_min_frame_size { 0 }; // 24 bit
u32 m_max_frame_size { 0 }; // 24 bit
u64 m_total_samples { 0 }; // 36 bit
u8 m_md5_checksum[128 / 8]; // 128 bit (!)
diff --git a/Userland/Libraries/LibAudio/Loader.h b/Userland/Libraries/LibAudio/Loader.h
index 0294bba603..bca513c083 100644
--- a/Userland/Libraries/LibAudio/Loader.h
+++ b/Userland/Libraries/LibAudio/Loader.h
@@ -35,7 +35,7 @@ public:
virtual MaybeLoaderError reset() = 0;
- virtual MaybeLoaderError seek(const int sample_index) = 0;
+ virtual MaybeLoaderError seek(int const sample_index) = 0;
// total_samples() and loaded_samples() should be independent
// of the number of channels.
@@ -63,7 +63,7 @@ public:
LoaderSamples get_more_samples(size_t max_bytes_to_read_from_input = 128 * KiB) const { return m_plugin->get_more_samples(max_bytes_to_read_from_input); }
MaybeLoaderError reset() const { return m_plugin->reset(); }
- MaybeLoaderError seek(const int position) const { return m_plugin->seek(position); }
+ MaybeLoaderError seek(int const position) const { return m_plugin->seek(position); }
int loaded_samples() const { return m_plugin->loaded_samples(); }
int total_samples() const { return m_plugin->total_samples(); }
diff --git a/Userland/Libraries/LibAudio/MP3HuffmanTables.h b/Userland/Libraries/LibAudio/MP3HuffmanTables.h
index e07a91eabb..674d8d402b 100644
--- a/Userland/Libraries/LibAudio/MP3HuffmanTables.h
+++ b/Userland/Libraries/LibAudio/MP3HuffmanTables.h
@@ -112,7 +112,7 @@ HuffmanDecodeResult<T> huffman_decode(InputBitStream& bitstream, Span<HuffmanNod
size_t bits_read = 0;
while (!node->is_leaf() && !bitstream.has_any_error() && max_bits_to_read-- > 0) {
- const bool direction = bitstream.read_bit_big_endian();
+ bool const direction = bitstream.read_bit_big_endian();
++bits_read;
if (direction) {
if (node->left == -1)
diff --git a/Userland/Libraries/LibAudio/WavLoader.cpp b/Userland/Libraries/LibAudio/WavLoader.cpp
index 69a556cb6d..6168cf5926 100644
--- a/Userland/Libraries/LibAudio/WavLoader.cpp
+++ b/Userland/Libraries/LibAudio/WavLoader.cpp
@@ -36,7 +36,7 @@ MaybeLoaderError WavLoaderPlugin::initialize()
return {};
}
-WavLoaderPlugin::WavLoaderPlugin(const Bytes& buffer)
+WavLoaderPlugin::WavLoaderPlugin(Bytes const& buffer)
{
m_stream = make<InputMemoryStream>(buffer);
if (!m_stream) {
@@ -91,7 +91,7 @@ LoaderSamples WavLoaderPlugin::get_more_samples(size_t max_bytes_to_read_from_in
return buffer.release_value();
}
-MaybeLoaderError WavLoaderPlugin::seek(const int sample_index)
+MaybeLoaderError WavLoaderPlugin::seek(int const sample_index)
{
dbgln_if(AWAVLOADER_DEBUG, "seek sample_index {}", sample_index);
if (sample_index < 0 || sample_index >= m_total_samples)
diff --git a/Userland/Libraries/LibAudio/WavLoader.h b/Userland/Libraries/LibAudio/WavLoader.h
index bb6cea82df..50e97b5648 100644
--- a/Userland/Libraries/LibAudio/WavLoader.h
+++ b/Userland/Libraries/LibAudio/WavLoader.h
@@ -34,7 +34,7 @@ class Buffer;
class WavLoaderPlugin : public LoaderPlugin {
public:
explicit WavLoaderPlugin(StringView path);
- explicit WavLoaderPlugin(const Bytes& buffer);
+ explicit WavLoaderPlugin(Bytes const& buffer);
virtual MaybeLoaderError initialize() override;
@@ -46,7 +46,7 @@ public:
// sample_index 0 is the start of the raw audio sample data
// within the file/stream.
- virtual MaybeLoaderError seek(const int sample_index) override;
+ virtual MaybeLoaderError seek(int const sample_index) override;
virtual int loaded_samples() override { return m_loaded_samples; }
virtual int total_samples() override { return m_total_samples; }
diff --git a/Userland/Libraries/LibAudio/WavWriter.cpp b/Userland/Libraries/LibAudio/WavWriter.cpp
index 4428a38f9d..4ba2524797 100644
--- a/Userland/Libraries/LibAudio/WavWriter.cpp
+++ b/Userland/Libraries/LibAudio/WavWriter.cpp
@@ -40,7 +40,7 @@ void WavWriter::set_file(StringView path)
m_finalized = false;
}
-void WavWriter::write_samples(const u8* samples, size_t size)
+void WavWriter::write_samples(u8 const* samples, size_t size)
{
m_data_sz += size;
m_file->write(samples, size);
diff --git a/Userland/Libraries/LibAudio/WavWriter.h b/Userland/Libraries/LibAudio/WavWriter.h
index d36059ab12..bfb06caf6f 100644
--- a/Userland/Libraries/LibAudio/WavWriter.h
+++ b/Userland/Libraries/LibAudio/WavWriter.h
@@ -22,9 +22,9 @@ public:
~WavWriter();
bool has_error() const { return !m_error_string.is_null(); }
- const char* error_string() const { return m_error_string.characters(); }
+ char const* error_string() const { return m_error_string.characters(); }
- void write_samples(const u8* samples, size_t size);
+ void write_samples(u8 const* samples, size_t size);
void finalize(); // You can finalize manually or let the destructor do it.
u32 sample_rate() const { return m_sample_rate; }
diff --git a/Userland/Libraries/LibC/arpa/inet.cpp b/Userland/Libraries/LibC/arpa/inet.cpp
index ca669086af..86c6f307a6 100644
--- a/Userland/Libraries/LibC/arpa/inet.cpp
+++ b/Userland/Libraries/LibC/arpa/inet.cpp
@@ -12,16 +12,16 @@
extern "C" {
-const char* inet_ntop(int af, const void* src, char* dst, socklen_t len)
+char const* inet_ntop(int af, void const* src, char* dst, socklen_t len)
{
if (af == AF_INET) {
if (len < INET_ADDRSTRLEN) {
errno = ENOSPC;
return nullptr;
}
- auto* bytes = (const unsigned char*)src;
+ auto* bytes = (unsigned char const*)src;
snprintf(dst, len, "%u.%u.%u.%u", bytes[0], bytes[1], bytes[2], bytes[3]);
- return (const char*)dst;
+ return (char const*)dst;
} else if (af == AF_INET6) {
if (len < INET6_ADDRSTRLEN) {
errno = ENOSPC;
@@ -32,14 +32,14 @@ const char* inet_ntop(int af, const void* src, char* dst, socklen_t len)
errno = ENOSPC;
return nullptr;
}
- return (const char*)dst;
+ return (char const*)dst;
}
errno = EAFNOSUPPORT;
return nullptr;
}
-int inet_pton(int af, const char* src, void* dst)
+int inet_pton(int af, char const* src, void* dst)
{
if (af == AF_INET) {
unsigned a, b, c, d;
@@ -78,7 +78,7 @@ int inet_pton(int af, const char* src, void* dst)
return -1;
}
-in_addr_t inet_addr(const char* str)
+in_addr_t inet_addr(char const* str)
{
in_addr_t tmp {};
int rc = inet_pton(AF_INET, str, &tmp);
diff --git a/Userland/Libraries/LibC/arpa/inet.h b/Userland/Libraries/LibC/arpa/inet.h
index 3ba673731f..b5c4d64a0d 100644
--- a/Userland/Libraries/LibC/arpa/inet.h
+++ b/Userland/Libraries/LibC/arpa/inet.h
@@ -16,10 +16,10 @@ __BEGIN_DECLS
#define INET_ADDRSTRLEN 16
#define INET6_ADDRSTRLEN 46
-const char* inet_ntop(int af, const void* src, char* dst, socklen_t);
-int inet_pton(int af, const char* src, void* dst);
+char const* inet_ntop(int af, void const* src, char* dst, socklen_t);
+int inet_pton(int af, char const* src, void* dst);
-static inline int inet_aton(const char* cp, struct in_addr* inp)
+static inline int inet_aton(char const* cp, struct in_addr* inp)
{
return inet_pton(AF_INET, cp, inp);
}
diff --git a/Userland/Libraries/LibC/assert.cpp b/Userland/Libraries/LibC/assert.cpp
index 20f0f2dc36..31145f26eb 100644
--- a/Userland/Libraries/LibC/assert.cpp
+++ b/Userland/Libraries/LibC/assert.cpp
@@ -17,7 +17,7 @@ extern "C" {
extern bool __stdio_is_initialized;
-void __assertion_failed(const char* msg)
+void __assertion_failed(char const* msg)
{
if (__heap_is_stable) {
dbgln("ASSERTION FAILED: {}", msg);
diff --git a/Userland/Libraries/LibC/assert.h b/Userland/Libraries/LibC/assert.h
index c64b51ecd0..b90b115cf6 100644
--- a/Userland/Libraries/LibC/assert.h
+++ b/Userland/Libraries/LibC/assert.h
@@ -22,7 +22,7 @@
__BEGIN_DECLS
#ifndef NDEBUG
-__attribute__((noreturn)) void __assertion_failed(const char* msg);
+__attribute__((noreturn)) void __assertion_failed(char const* msg);
# define assert(expr) \
(__builtin_expect(!(expr), 0) \
? __assertion_failed(#expr "\n" __FILE__ ":" __stringify(__LINE__)) \
diff --git a/Userland/Libraries/LibC/bits/pthread_forward.h b/Userland/Libraries/LibC/bits/pthread_forward.h
index 21f60072a5..3480383db2 100644
--- a/Userland/Libraries/LibC/bits/pthread_forward.h
+++ b/Userland/Libraries/LibC/bits/pthread_forward.h
@@ -19,7 +19,7 @@ struct PthreadFunctions {
int (*pthread_once)(pthread_once_t*, void (*)(void));
int (*pthread_cond_broadcast)(pthread_cond_t*);
- int (*pthread_cond_init)(pthread_cond_t*, const pthread_condattr_t*);
+ int (*pthread_cond_init)(pthread_cond_t*, pthread_condattr_t const*);
int (*pthread_cond_signal)(pthread_cond_t*);
int (*pthread_cond_wait)(pthread_cond_t*, pthread_mutex_t*);
int (*pthread_cond_destroy)(pthread_cond_t*);
diff --git a/Userland/Libraries/LibC/bits/pthread_integration.h b/Userland/Libraries/LibC/bits/pthread_integration.h
index bbc7e820de..85147c4254 100644
--- a/Userland/Libraries/LibC/bits/pthread_integration.h
+++ b/Userland/Libraries/LibC/bits/pthread_integration.h
@@ -18,7 +18,7 @@ void __pthread_fork_atfork_register_prepare(void (*)(void));
void __pthread_fork_atfork_register_parent(void (*)(void));
void __pthread_fork_atfork_register_child(void (*)(void));
-int __pthread_mutex_init(pthread_mutex_t*, const pthread_mutexattr_t*);
+int __pthread_mutex_init(pthread_mutex_t*, pthread_mutexattr_t const*);
int __pthread_mutex_lock(pthread_mutex_t*);
int __pthread_mutex_trylock(pthread_mutex_t*);
int __pthread_mutex_lock_pessimistic_np(pthread_mutex_t*);
@@ -29,7 +29,7 @@ typedef void (*KeyDestructor)(void*);
int __pthread_key_create(pthread_key_t*, KeyDestructor);
int __pthread_key_delete(pthread_key_t);
void* __pthread_getspecific(pthread_key_t);
-int __pthread_setspecific(pthread_key_t, const void*);
+int __pthread_setspecific(pthread_key_t, void const*);
int __pthread_self(void);
diff --git a/Userland/Libraries/LibC/bits/search.h b/Userland/Libraries/LibC/bits/search.h
index 9c68cd8a93..5807267ad9 100644
--- a/Userland/Libraries/LibC/bits/search.h
+++ b/Userland/Libraries/LibC/bits/search.h
@@ -9,10 +9,10 @@
// This is technically an implementation detail, but we require this for testing.
// The key always has to be the first struct member.
struct search_tree_node {
- const void* key;
+ void const* key;
struct search_tree_node* left;
struct search_tree_node* right;
};
-struct search_tree_node* new_tree_node(const void* key);
+struct search_tree_node* new_tree_node(void const* key);
void delete_node_recursive(struct search_tree_node* node);
diff --git a/Userland/Libraries/LibC/bits/stdio_file_implementation.h b/Userland/Libraries/LibC/bits/stdio_file_implementation.h
index 7181d7e96b..173e88f44d 100644
--- a/Userland/Libraries/LibC/bits/stdio_file_implementation.h
+++ b/Userland/Libraries/LibC/bits/stdio_file_implementation.h
@@ -46,7 +46,7 @@ public:
void clear_err() { m_error = 0; }
size_t read(u8*, size_t);
- size_t write(const u8*, size_t);
+ size_t write(u8 const*, size_t);
template<typename CharType>
bool gets(CharType*, size_t);
@@ -84,7 +84,7 @@ private:
bool is_not_empty() const { return m_ungotten || !m_empty; }
size_t buffered_size() const;
- const u8* begin_dequeue(size_t& available_size) const;
+ u8 const* begin_dequeue(size_t& available_size) const;
void did_dequeue(size_t actual_size);
u8* begin_enqueue(size_t& available_size) const;
@@ -114,7 +114,7 @@ private:
// Read or write using the underlying fd, bypassing the buffer.
ssize_t do_read(u8*, size_t);
- ssize_t do_write(const u8*, size_t);
+ ssize_t do_write(u8 const*, size_t);
// Read some data into the buffer.
bool read_into_buffer();
diff --git a/Userland/Libraries/LibC/ctype.cpp b/Userland/Libraries/LibC/ctype.cpp
index 9ea35ac642..81a69a8bce 100644
--- a/Userland/Libraries/LibC/ctype.cpp
+++ b/Userland/Libraries/LibC/ctype.cpp
@@ -8,7 +8,7 @@
extern "C" {
-const char _ctype_[256] = {
+char const _ctype_[256] = {
_C, _C, _C, _C, _C, _C, _C, _C,
_C, _C | _S, _C | _S, _C | _S, _C | _S, _C | _S, _C, _C,
_C, _C, _C, _C, _C, _C, _C, _C,
diff --git a/Userland/Libraries/LibC/ctype.h b/Userland/Libraries/LibC/ctype.h
index 64faf788e5..b7493b8138 100644
--- a/Userland/Libraries/LibC/ctype.h
+++ b/Userland/Libraries/LibC/ctype.h
@@ -20,7 +20,7 @@ __BEGIN_DECLS
#define _X 0100
#define _B 0200
-extern const char _ctype_[256];
+extern char const _ctype_[256];
static inline int __inline_isalnum(int c)
{
diff --git a/Userland/Libraries/LibC/dirent.cpp b/Userland/Libraries/LibC/dirent.cpp
index 35d6ce394b..a1bd95774f 100644
--- a/Userland/Libraries/LibC/dirent.cpp
+++ b/Userland/Libraries/LibC/dirent.cpp
@@ -22,7 +22,7 @@
extern "C" {
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/opendir.html
-DIR* opendir(const char* name)
+DIR* opendir(char const* name)
{
int fd = open(name, O_RDONLY | O_DIRECTORY);
if (fd == -1)
@@ -229,7 +229,7 @@ int alphasort(const struct dirent** d1, const struct dirent** d2)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/scandir.html
-int scandir(const char* dir_name,
+int scandir(char const* dir_name,
struct dirent*** namelist,
int (*select)(const struct dirent*),
int (*compare)(const struct dirent**, const struct dirent**))
@@ -273,10 +273,10 @@ int scandir(const char* dir_name,
// Sort the entries if the user provided a comparator.
if (compare) {
- qsort(tmp_names.data(), tmp_names.size(), sizeof(struct dirent*), (int (*)(const void*, const void*))compare);
+ qsort(tmp_names.data(), tmp_names.size(), sizeof(struct dirent*), (int (*)(void const*, void const*))compare);
}
- const int size = tmp_names.size();
+ int const size = tmp_names.size();
auto** names = static_cast<struct dirent**>(kmalloc_array(size, sizeof(struct dirent*)));
if (names == nullptr) {
return -1;
diff --git a/Userland/Libraries/LibC/dirent.h b/Userland/Libraries/LibC/dirent.h
index 7d0b1bf2d2..1d132a3db1 100644
--- a/Userland/Libraries/LibC/dirent.h
+++ b/Userland/Libraries/LibC/dirent.h
@@ -28,7 +28,7 @@ struct __DIR {
typedef struct __DIR DIR;
DIR* fdopendir(int fd);
-DIR* opendir(const char* name);
+DIR* opendir(char const* name);
int closedir(DIR*);
void rewinddir(DIR*);
struct dirent* readdir(DIR*);
@@ -36,7 +36,7 @@ int readdir_r(DIR*, struct dirent*, struct dirent**);
int dirfd(DIR*);
int alphasort(const struct dirent** d1, const struct dirent** d2);
-int scandir(const char* dirp, struct dirent*** namelist,
+int scandir(char const* dirp, struct dirent*** namelist,
int (*filter)(const struct dirent*),
int (*compar)(const struct dirent**, const struct dirent**));
diff --git a/Userland/Libraries/LibC/elf.h b/Userland/Libraries/LibC/elf.h
index 01c497259e..d61dc831d2 100644
--- a/Userland/Libraries/LibC/elf.h
+++ b/Userland/Libraries/LibC/elf.h
@@ -145,7 +145,7 @@ typedef struct elfhdr {
Elf32_Half e_shentsize; /* section header entry size */
Elf32_Half e_shnum; /* number of section header entries */
Elf32_Half e_shstrndx; /* section header table's "section
- header string table" entry offset */
+ header string table" entry offset */
} Elf32_Ehdr;
typedef struct {
@@ -223,7 +223,7 @@ typedef struct {
/* Section Header */
typedef struct {
Elf32_Word sh_name; /* name - index into section header
- string table section */
+ string table section */
Elf32_Word sh_type; /* type */
Elf32_Word sh_flags; /* flags */
Elf32_Addr sh_addr; /* address */
diff --git a/Userland/Libraries/LibC/errno.h b/Userland/Libraries/LibC/errno.h
index 75b75ddf63..ad4b251366 100644
--- a/Userland/Libraries/LibC/errno.h
+++ b/Userland/Libraries/LibC/errno.h
@@ -20,7 +20,7 @@
__BEGIN_DECLS
-extern const char* const sys_errlist[];
+extern char const* const sys_errlist[];
extern int sys_nerr;
#ifdef NO_TLS
diff --git a/Userland/Libraries/LibC/fcntl.cpp b/Userland/Libraries/LibC/fcntl.cpp
index 47805d0a44..5c1ed89ded 100644
--- a/Userland/Libraries/LibC/fcntl.cpp
+++ b/Userland/Libraries/LibC/fcntl.cpp
@@ -30,7 +30,7 @@ int create_inode_watcher(unsigned flags)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int inode_watcher_add_watch(int fd, const char* path, size_t path_length, unsigned event_mask)
+int inode_watcher_add_watch(int fd, char const* path, size_t path_length, unsigned event_mask)
{
Syscall::SC_inode_watcher_add_watch_params params { { path, path_length }, fd, event_mask };
int rc = syscall(SC_inode_watcher_add_watch, &params);
@@ -43,12 +43,12 @@ int inode_watcher_remove_watch(int fd, int wd)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int creat(const char* path, mode_t mode)
+int creat(char const* path, mode_t mode)
{
return open(path, O_CREAT | O_WRONLY | O_TRUNC, mode);
}
-int open(const char* path, int options, ...)
+int open(char const* path, int options, ...)
{
if (!path) {
errno = EFAULT;
@@ -68,7 +68,7 @@ int open(const char* path, int options, ...)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int openat(int dirfd, const char* path, int options, ...)
+int openat(int dirfd, char const* path, int options, ...)
{
if (!path) {
errno = EFAULT;
diff --git a/Userland/Libraries/LibC/fcntl.h b/Userland/Libraries/LibC/fcntl.h
index 7056d874a9..ae1e290824 100644
--- a/Userland/Libraries/LibC/fcntl.h
+++ b/Userland/Libraries/LibC/fcntl.h
@@ -11,13 +11,13 @@
__BEGIN_DECLS
-int creat(const char* path, mode_t);
-int open(const char* path, int options, ...);
-int openat(int dirfd, const char* path, int options, ...);
+int creat(char const* path, mode_t);
+int open(char const* path, int options, ...);
+int openat(int dirfd, char const* path, int options, ...);
int fcntl(int fd, int cmd, ...);
int create_inode_watcher(unsigned flags);
-int inode_watcher_add_watch(int fd, const char* path, size_t path_length, unsigned event_mask);
+int inode_watcher_add_watch(int fd, char const* path, size_t path_length, unsigned event_mask);
int inode_watcher_remove_watch(int fd, int wd);
__END_DECLS
diff --git a/Userland/Libraries/LibC/fenv.cpp b/Userland/Libraries/LibC/fenv.cpp
index a9f057f25e..d4dc20d98a 100644
--- a/Userland/Libraries/LibC/fenv.cpp
+++ b/Userland/Libraries/LibC/fenv.cpp
@@ -61,7 +61,7 @@ int fegetenv(fenv_t* env)
return 0;
}
-int fesetenv(const fenv_t* env)
+int fesetenv(fenv_t const* env)
{
if (!env)
return 1;
@@ -96,7 +96,7 @@ int feholdexcept(fenv_t* env)
return 0;
}
-int feupdateenv(const fenv_t* env)
+int feupdateenv(fenv_t const* env)
{
auto currently_raised_exceptions = fetestexcept(FE_ALL_EXCEPT);
@@ -113,7 +113,7 @@ int fegetexceptflag(fexcept_t* except, int exceptions)
*except = (uint16_t)fetestexcept(exceptions);
return 0;
}
-int fesetexceptflag(const fexcept_t* except, int exceptions)
+int fesetexceptflag(fexcept_t const* except, int exceptions)
{
if (!except)
return 1;
diff --git a/Userland/Libraries/LibC/fenv.h b/Userland/Libraries/LibC/fenv.h
index 415223d289..f5f1d8f7e6 100644
--- a/Userland/Libraries/LibC/fenv.h
+++ b/Userland/Libraries/LibC/fenv.h
@@ -32,12 +32,12 @@ typedef struct fenv_t {
uint32_t __mxcsr;
} fenv_t;
-#define FE_DFL_ENV ((const fenv_t*)-1)
+#define FE_DFL_ENV ((fenv_t const*)-1)
int fegetenv(fenv_t*);
-int fesetenv(const fenv_t*);
+int fesetenv(fenv_t const*);
int feholdexcept(fenv_t*);
-int feupdateenv(const fenv_t*);
+int feupdateenv(fenv_t const*);
#define FE_INVALID 1u << 0
#define FE_DIVBYZERO 1u << 2
@@ -48,7 +48,7 @@ int feupdateenv(const fenv_t*);
typedef uint16_t fexcept_t;
int fegetexceptflag(fexcept_t*, int exceptions);
-int fesetexceptflag(const fexcept_t*, int exceptions);
+int fesetexceptflag(fexcept_t const*, int exceptions);
int feclearexcept(int exceptions);
int fetestexcept(int exceptions);
diff --git a/Userland/Libraries/LibC/getopt.cpp b/Userland/Libraries/LibC/getopt.cpp
index addfa3e63e..9c3e97ee84 100644
--- a/Userland/Libraries/LibC/getopt.cpp
+++ b/Userland/Libraries/LibC/getopt.cpp
@@ -22,7 +22,7 @@ char* optarg = nullptr;
// processed". Well, this is how we do it.
static size_t s_index_into_multioption_argument = 0;
-[[gnu::format(printf, 1, 2)]] static inline void report_error(const char* format, ...)
+[[gnu::format(printf, 1, 2)]] static inline void report_error(char const* format, ...)
{
if (!opterr)
return;
@@ -41,14 +41,14 @@ namespace {
class OptionParser {
public:
- OptionParser(int argc, char* const* argv, StringView short_options, const option* long_options, int* out_long_option_index = nullptr);
+ OptionParser(int argc, char* const* argv, StringView short_options, option const* long_options, int* out_long_option_index = nullptr);
int getopt();
private:
bool lookup_short_option(char option, int& needs_value) const;
int handle_short_option();
- const option* lookup_long_option(char* raw) const;
+ option const* lookup_long_option(char* raw) const;
int handle_long_option();
void shift_argv();
@@ -57,7 +57,7 @@ private:
size_t m_argc { 0 };
char* const* m_argv { nullptr };
StringView m_short_options;
- const option* m_long_options { nullptr };
+ option const* m_long_options { nullptr };
int* m_out_long_option_index { nullptr };
bool m_stop_on_first_non_option { false };
@@ -65,7 +65,7 @@ private:
size_t m_consumed_args { 0 };
};
-OptionParser::OptionParser(int argc, char* const* argv, StringView short_options, const option* long_options, int* out_long_option_index)
+OptionParser::OptionParser(int argc, char* const* argv, StringView short_options, option const* long_options, int* out_long_option_index)
: m_argc(argc)
, m_argv(argv)
, m_short_options(short_options)
@@ -204,7 +204,7 @@ int OptionParser::handle_short_option()
return option;
}
-const option* OptionParser::lookup_long_option(char* raw) const
+option const* OptionParser::lookup_long_option(char* raw) const
{
StringView arg = raw;
@@ -336,14 +336,14 @@ bool OptionParser::find_next_option()
}
-int getopt(int argc, char* const* argv, const char* short_options)
+int getopt(int argc, char* const* argv, char const* short_options)
{
option dummy { nullptr, 0, nullptr, 0 };
OptionParser parser { argc, argv, short_options, &dummy };
return parser.getopt();
}
-int getopt_long(int argc, char* const* argv, const char* short_options, const struct option* long_options, int* out_long_option_index)
+int getopt_long(int argc, char* const* argv, char const* short_options, const struct option* long_options, int* out_long_option_index)
{
OptionParser parser { argc, argv, short_options, long_options, out_long_option_index };
return parser.getopt();
diff --git a/Userland/Libraries/LibC/getopt.h b/Userland/Libraries/LibC/getopt.h
index 4649322bce..f5fca0c682 100644
--- a/Userland/Libraries/LibC/getopt.h
+++ b/Userland/Libraries/LibC/getopt.h
@@ -15,7 +15,7 @@ __BEGIN_DECLS
#define optional_argument 2
struct option {
- const char* name;
+ char const* name;
int has_arg;
int* flag;
int val;
@@ -26,6 +26,6 @@ extern int optopt;
extern int optind;
extern int optreset;
extern char* optarg;
-int getopt_long(int argc, char* const* argv, const char* short_options, const struct option* long_options, int* out_long_option_index);
+int getopt_long(int argc, char* const* argv, char const* short_options, const struct option* long_options, int* out_long_option_index);
__END_DECLS
diff --git a/Userland/Libraries/LibC/grp.cpp b/Userland/Libraries/LibC/grp.cpp
index 9a4d55ca05..676be6b1c3 100644
--- a/Userland/Libraries/LibC/grp.cpp
+++ b/Userland/Libraries/LibC/grp.cpp
@@ -24,7 +24,7 @@ static struct group s_group;
static String s_name;
static String s_passwd;
static Vector<String> s_members;
-static Vector<const char*> s_members_ptrs;
+static Vector<char const*> s_members_ptrs;
void setgrent()
{
@@ -65,7 +65,7 @@ struct group* getgrgid(gid_t gid)
return nullptr;
}
-struct group* getgrnam(const char* name)
+struct group* getgrnam(char const* name)
{
setgrent();
while (auto* gr = getgrent()) {
@@ -75,7 +75,7 @@ struct group* getgrnam(const char* name)
return nullptr;
}
-static bool parse_grpdb_entry(const String& line)
+static bool parse_grpdb_entry(String const& line)
{
auto parts = line.split_view(':', true);
if (parts.size() != 4) {
@@ -140,7 +140,7 @@ struct group* getgrent()
}
}
-int initgroups(const char* user, gid_t extra_gid)
+int initgroups(char const* user, gid_t extra_gid)
{
size_t count = 0;
gid_t gids[32];
@@ -169,7 +169,7 @@ int putgrent(const struct group* group, FILE* stream)
return -1;
}
- auto is_valid_field = [](const char* str) {
+ auto is_valid_field = [](char const* str) {
return str && !strpbrk(str, ":\n");
};
diff --git a/Userland/Libraries/LibC/grp.h b/Userland/Libraries/LibC/grp.h
index 20df7747c7..8fefd99811 100644
--- a/Userland/Libraries/LibC/grp.h
+++ b/Userland/Libraries/LibC/grp.h
@@ -23,10 +23,10 @@ struct group {
struct group* getgrent(void);
void setgrent(void);
void endgrent(void);
-struct group* getgrnam(const char* name);
+struct group* getgrnam(char const* name);
struct group* getgrgid(gid_t);
int putgrent(const struct group*, FILE*);
-int initgroups(const char* user, gid_t);
+int initgroups(char const* user, gid_t);
__END_DECLS
diff --git a/Userland/Libraries/LibC/iconv.h b/Userland/Libraries/LibC/iconv.h
index 5f86bfa960..925e045fc5 100644
--- a/Userland/Libraries/LibC/iconv.h
+++ b/Userland/Libraries/LibC/iconv.h
@@ -13,7 +13,7 @@ __BEGIN_DECLS
typedef void* iconv_t;
-extern iconv_t iconv_open(const char* tocode, const char* fromcode);
+extern iconv_t iconv_open(char const* tocode, char const* fromcode);
extern size_t iconv(iconv_t, char** inbuf, size_t* inbytesleft, char** outbuf, size_t* outbytesleft);
extern int iconv_close(iconv_t);
diff --git a/Userland/Libraries/LibC/inttypes.cpp b/Userland/Libraries/LibC/inttypes.cpp
index b55e1aa964..c4160ad4da 100644
--- a/Userland/Libraries/LibC/inttypes.cpp
+++ b/Userland/Libraries/LibC/inttypes.cpp
@@ -25,7 +25,7 @@ imaxdiv_t imaxdiv(intmax_t numerator, intmax_t denominator)
return result;
}
-intmax_t strtoimax(const char* str, char** endptr, int base)
+intmax_t strtoimax(char const* str, char** endptr, int base)
{
long long_value = strtoll(str, endptr, base);
@@ -42,7 +42,7 @@ intmax_t strtoimax(const char* str, char** endptr, int base)
return long_value;
}
-uintmax_t strtoumax(const char* str, char** endptr, int base)
+uintmax_t strtoumax(char const* str, char** endptr, int base)
{
unsigned long ulong_value = strtoull(str, endptr, base);
diff --git a/Userland/Libraries/LibC/inttypes.h b/Userland/Libraries/LibC/inttypes.h
index d4ae75c719..8755cbd62e 100644
--- a/Userland/Libraries/LibC/inttypes.h
+++ b/Userland/Libraries/LibC/inttypes.h
@@ -102,7 +102,7 @@ typedef struct imaxdiv_t {
} imaxdiv_t;
imaxdiv_t imaxdiv(intmax_t, intmax_t);
-intmax_t strtoimax(const char*, char** endptr, int base);
-uintmax_t strtoumax(const char*, char** endptr, int base);
+intmax_t strtoimax(char const*, char** endptr, int base);
+uintmax_t strtoumax(char const*, char** endptr, int base);
__END_DECLS
diff --git a/Userland/Libraries/LibC/langinfo.cpp b/Userland/Libraries/LibC/langinfo.cpp
index 912dce3f4c..a44f70afe1 100644
--- a/Userland/Libraries/LibC/langinfo.cpp
+++ b/Userland/Libraries/LibC/langinfo.cpp
@@ -8,7 +8,7 @@
#include <langinfo.h>
// Values taken from glibc's en_US locale files.
-static const char* __nl_langinfo(nl_item item)
+static char const* __nl_langinfo(nl_item item)
{
switch (item) {
case CODESET:
diff --git a/Userland/Libraries/LibC/link.h b/Userland/Libraries/LibC/link.h
index 73ad8ad07f..eaa28ec4de 100644
--- a/Userland/Libraries/LibC/link.h
+++ b/Userland/Libraries/LibC/link.h
@@ -18,7 +18,7 @@ __BEGIN_DECLS
struct dl_phdr_info {
ElfW(Addr) dlpi_addr;
- const char* dlpi_name;
+ char const* dlpi_name;
const ElfW(Phdr) * dlpi_phdr;
ElfW(Half) dlpi_phnum;
};
diff --git a/Userland/Libraries/LibC/locale.cpp b/Userland/Libraries/LibC/locale.cpp
index 8eca939fb7..06cbcdb6ce 100644
--- a/Userland/Libraries/LibC/locale.cpp
+++ b/Userland/Libraries/LibC/locale.cpp
@@ -45,7 +45,7 @@ static struct lconv default_locale = {
default_empty_value
};
-char* setlocale(int, const char*)
+char* setlocale(int, char const*)
{
static char locale[2];
memcpy(locale, "C", 2);
diff --git a/Userland/Libraries/LibC/locale.h b/Userland/Libraries/LibC/locale.h
index 7d4069ecba..0fe99ba7d8 100644
--- a/Userland/Libraries/LibC/locale.h
+++ b/Userland/Libraries/LibC/locale.h
@@ -55,6 +55,6 @@ struct lconv {
};
struct lconv* localeconv(void);
-char* setlocale(int category, const char* locale);
+char* setlocale(int category, char const* locale);
__END_DECLS
diff --git a/Userland/Libraries/LibC/malloc.cpp b/Userland/Libraries/LibC/malloc.cpp
index f67dc0b4f3..5b3e7add2b 100644
--- a/Userland/Libraries/LibC/malloc.cpp
+++ b/Userland/Libraries/LibC/malloc.cpp
@@ -56,25 +56,25 @@ static bool s_scrub_free = true;
static bool s_profiling = false;
static bool s_in_userspace_emulator = false;
-ALWAYS_INLINE static void ue_notify_malloc(const void* ptr, size_t size)
+ALWAYS_INLINE static void ue_notify_malloc(void const* ptr, size_t size)
{
if (s_in_userspace_emulator)
syscall(SC_emuctl, 1, size, (FlatPtr)ptr);
}
-ALWAYS_INLINE static void ue_notify_free(const void* ptr)
+ALWAYS_INLINE static void ue_notify_free(void const* ptr)
{
if (s_in_userspace_emulator)
syscall(SC_emuctl, 2, (FlatPtr)ptr, 0);
}
-ALWAYS_INLINE static void ue_notify_realloc(const void* ptr, size_t size)
+ALWAYS_INLINE static void ue_notify_realloc(void const* ptr, size_t size)
{
if (s_in_userspace_emulator)
syscall(SC_emuctl, 3, size, (FlatPtr)ptr);
}
-ALWAYS_INLINE static void ue_notify_chunk_size_changed(const void* block, size_t chunk_size)
+ALWAYS_INLINE static void ue_notify_chunk_size_changed(void const* block, size_t chunk_size)
{
if (s_in_userspace_emulator)
syscall(SC_emuctl, 4, chunk_size, (FlatPtr)block);
@@ -176,7 +176,7 @@ static BigAllocator* big_allocator_for_size(size_t size)
extern "C" {
-static void* os_alloc(size_t size, const char* name)
+static void* os_alloc(size_t size, char const* name)
{
int flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_PURGEABLE;
#if ARCH(X86_64)
@@ -525,7 +525,7 @@ size_t malloc_size(void const* ptr)
if (!ptr)
return 0;
void* page_base = (void*)((FlatPtr)ptr & ChunkedBlock::block_mask);
- auto* header = (const CommonHeader*)page_base;
+ auto* header = (CommonHeader const*)page_base;
auto size = header->m_size;
if (header->m_magic == MAGIC_BIGALLOC_HEADER)
size -= sizeof(BigAllocationBlock);
diff --git a/Userland/Libraries/LibC/net.cpp b/Userland/Libraries/LibC/net.cpp
index aa76ec0a6c..9a6b113529 100644
--- a/Userland/Libraries/LibC/net.cpp
+++ b/Userland/Libraries/LibC/net.cpp
@@ -11,7 +11,7 @@
const in6_addr in6addr_any = IN6ADDR_ANY_INIT;
const in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
-unsigned int if_nametoindex([[maybe_unused]] const char* ifname)
+unsigned int if_nametoindex([[maybe_unused]] char const* ifname)
{
errno = ENODEV;
return -1;
diff --git a/Userland/Libraries/LibC/netdb.cpp b/Userland/Libraries/LibC/netdb.cpp
index 6dc38f2ca4..45b13b39e1 100644
--- a/Userland/Libraries/LibC/netdb.cpp
+++ b/Userland/Libraries/LibC/netdb.cpp
@@ -37,9 +37,9 @@ static constexpr u32 lookup_server_endpoint_magic = "LookupServer"sv.hash();
// Get service entry buffers and file information for the getservent() family of functions.
static FILE* services_file = nullptr;
-static const char* services_path = "/etc/services";
+static char const* services_path = "/etc/services";
-static bool fill_getserv_buffers(const char* line, ssize_t read);
+static bool fill_getserv_buffers(char const* line, ssize_t read);
static servent __getserv_buffer;
static String __getserv_name_buffer;
static String __getserv_protocol_buffer;
@@ -51,9 +51,9 @@ static ssize_t service_file_offset = 0;
// Get protocol entry buffers and file information for the getprotent() family of functions.
static FILE* protocols_file = nullptr;
-static const char* protocols_path = "/etc/protocols";
+static char const* protocols_path = "/etc/protocols";
-static bool fill_getproto_buffers(const char* line, ssize_t read);
+static bool fill_getproto_buffers(char const* line, ssize_t read);
static protoent __getproto_buffer;
static String __getproto_name_buffer;
static Vector<ByteBuffer> __getproto_alias_list_buffer;
@@ -75,7 +75,7 @@ static int connect_to_lookup_server()
"/tmp/portal/lookup"
};
- if (connect(fd, (const sockaddr*)&address, sizeof(address)) < 0) {
+ if (connect(fd, (sockaddr const*)&address, sizeof(address)) < 0) {
perror("connect_to_lookup_server");
close(fd);
return -1;
@@ -85,7 +85,7 @@ static int connect_to_lookup_server()
static String gethostbyname_name_buffer;
-hostent* gethostbyname(const char* name)
+hostent* gethostbyname(char const* name)
{
h_errno = 0;
@@ -205,7 +205,7 @@ hostent* gethostbyname(const char* name)
static String gethostbyaddr_name_buffer;
-hostent* gethostbyaddr(const void* addr, socklen_t addr_size, int type)
+hostent* gethostbyaddr(void const* addr, socklen_t addr_size, int type)
{
h_errno = 0;
@@ -229,7 +229,7 @@ hostent* gethostbyaddr(const void* addr, socklen_t addr_size, int type)
close(fd);
});
- const in_addr_t& in_addr = ((const struct in_addr*)addr)->s_addr;
+ in_addr_t const& in_addr = ((const struct in_addr*)addr)->s_addr;
struct [[gnu::packed]] {
u32 message_size;
@@ -367,7 +367,7 @@ struct servent* getservent()
return service_entry;
}
-struct servent* getservbyname(const char* name, const char* protocol)
+struct servent* getservbyname(char const* name, char const* protocol)
{
if (name == nullptr)
return nullptr;
@@ -394,7 +394,7 @@ struct servent* getservbyname(const char* name, const char* protocol)
return current_service;
}
-struct servent* getservbyport(int port, const char* protocol)
+struct servent* getservbyport(int port, char const* protocol)
{
bool previous_file_open_setting = keep_service_file_open;
setservent(1);
@@ -444,7 +444,7 @@ void endservent()
// Fill the service entry buffer with the information contained
// in the currently read line, returns true if successful,
// false if failure occurs.
-static bool fill_getserv_buffers(const char* line, ssize_t read)
+static bool fill_getserv_buffers(char const* line, ssize_t read)
{
// Splitting the line by tab delimiter and filling the servent buffers name, port, and protocol members.
auto split_line = StringView(line, read).replace(" ", "\t", true).split('\t');
@@ -555,7 +555,7 @@ struct protoent* getprotoent()
return protocol_entry;
}
-struct protoent* getprotobyname(const char* name)
+struct protoent* getprotobyname(char const* name)
{
bool previous_file_open_setting = keep_protocols_file_open;
setprotoent(1);
@@ -623,7 +623,7 @@ void endprotoent()
protocols_file = nullptr;
}
-static bool fill_getproto_buffers(const char* line, ssize_t read)
+static bool fill_getproto_buffers(char const* line, ssize_t read)
{
String string_line = String(line, read);
auto split_line = string_line.replace(" ", "\t", true).split('\t');
@@ -660,7 +660,7 @@ static bool fill_getproto_buffers(const char* line, ssize_t read)
return true;
}
-int getaddrinfo(const char* __restrict node, const char* __restrict service, const struct addrinfo* __restrict hints, struct addrinfo** __restrict res)
+int getaddrinfo(char const* __restrict node, char const* __restrict service, const struct addrinfo* __restrict hints, struct addrinfo** __restrict res)
{
*res = nullptr;
@@ -678,7 +678,7 @@ int getaddrinfo(const char* __restrict node, const char* __restrict service, con
if (!host_ent)
return EAI_FAIL;
- const char* proto = nullptr;
+ char const* proto = nullptr;
if (hints && hints->ai_socktype) {
switch (hints->ai_socktype) {
case SOCK_STREAM:
@@ -767,7 +767,7 @@ void freeaddrinfo(struct addrinfo* res)
}
}
-const char* gai_strerror(int errcode)
+char const* gai_strerror(int errcode)
{
switch (errcode) {
case EAI_ADDRFAMILY:
@@ -804,7 +804,7 @@ int getnameinfo(const struct sockaddr* __restrict addr, socklen_t addrlen, char*
if (addr->sa_family != AF_INET || addrlen < sizeof(sockaddr_in))
return EAI_FAMILY;
- const sockaddr_in* sin = reinterpret_cast<const sockaddr_in*>(addr);
+ sockaddr_in const* sin = reinterpret_cast<sockaddr_in const*>(addr);
if (host && hostlen > 0) {
if (flags != 0)
diff --git a/Userland/Libraries/LibC/netdb.h b/Userland/Libraries/LibC/netdb.h
index 409be7d437..72561ebb79 100644
--- a/Userland/Libraries/LibC/netdb.h
+++ b/Userland/Libraries/LibC/netdb.h
@@ -20,8 +20,8 @@ struct hostent {
#define h_addr h_addr_list[0]
};
-struct hostent* gethostbyname(const char*);
-struct hostent* gethostbyaddr(const void* addr, socklen_t len, int type);
+struct hostent* gethostbyname(char const*);
+struct hostent* gethostbyaddr(void const* addr, socklen_t len, int type);
struct servent {
char* s_name;
@@ -31,8 +31,8 @@ struct servent {
};
struct servent* getservent(void);
-struct servent* getservbyname(const char* name, const char* protocol);
-struct servent* getservbyport(int port, const char* protocol);
+struct servent* getservbyname(char const* name, char const* protocol);
+struct servent* getservbyport(int port, char const* protocol);
void setservent(int stay_open);
void endservent(void);
@@ -43,7 +43,7 @@ struct protoent {
};
void endprotoent(void);
-struct protoent* getprotobyname(const char* name);
+struct protoent* getprotobyname(char const* name);
struct protoent* getprotobynumber(int proto);
struct protoent* getprotoent(void);
void setprotoent(int stay_open);
@@ -96,9 +96,9 @@ struct addrinfo {
#define NI_NOFQDN 4
#define NI_DGRAM 5
-int getaddrinfo(const char* __restrict node, const char* __restrict service, const struct addrinfo* __restrict hints, struct addrinfo** __restrict res);
+int getaddrinfo(char const* __restrict node, char const* __restrict service, const struct addrinfo* __restrict hints, struct addrinfo** __restrict res);
void freeaddrinfo(struct addrinfo* res);
-const char* gai_strerror(int errcode);
+char const* gai_strerror(int errcode);
int getnameinfo(const struct sockaddr* __restrict addr, socklen_t addrlen, char* __restrict host, socklen_t hostlen, char* __restrict serv, socklen_t servlen, int flags);
__END_DECLS
diff --git a/Userland/Libraries/LibC/poll.cpp b/Userland/Libraries/LibC/poll.cpp
index 8b5f5605f1..7491346d5b 100644
--- a/Userland/Libraries/LibC/poll.cpp
+++ b/Userland/Libraries/LibC/poll.cpp
@@ -23,7 +23,7 @@ int poll(pollfd* fds, nfds_t nfds, int timeout_ms)
return ppoll(fds, nfds, timeout_ts, nullptr);
}
-int ppoll(pollfd* fds, nfds_t nfds, const timespec* timeout, const sigset_t* sigmask)
+int ppoll(pollfd* fds, nfds_t nfds, timespec const* timeout, sigset_t const* sigmask)
{
Syscall::SC_poll_params params { fds, nfds, timeout, sigmask };
int rc = syscall(SC_poll, &params);
diff --git a/Userland/Libraries/LibC/poll.h b/Userland/Libraries/LibC/poll.h
index cdc838242e..7667468442 100644
--- a/Userland/Libraries/LibC/poll.h
+++ b/Userland/Libraries/LibC/poll.h
@@ -12,6 +12,6 @@
__BEGIN_DECLS
int poll(struct pollfd* fds, nfds_t nfds, int timeout);
-int ppoll(struct pollfd* fds, nfds_t nfds, const struct timespec* timeout, const sigset_t* sigmask);
+int ppoll(struct pollfd* fds, nfds_t nfds, const struct timespec* timeout, sigset_t const* sigmask);
__END_DECLS
diff --git a/Userland/Libraries/LibC/pthread_forward.cpp b/Userland/Libraries/LibC/pthread_forward.cpp
index e610613cbb..32fcd015e7 100644
--- a/Userland/Libraries/LibC/pthread_forward.cpp
+++ b/Userland/Libraries/LibC/pthread_forward.cpp
@@ -56,7 +56,7 @@ int pthread_cond_broadcast(pthread_cond_t* cond)
return s_pthread_functions.pthread_cond_broadcast(cond);
}
-int pthread_cond_init(pthread_cond_t* cond, const pthread_condattr_t* attr)
+int pthread_cond_init(pthread_cond_t* cond, pthread_condattr_t const* attr)
{
VERIFY(s_pthread_functions.pthread_cond_init);
return s_pthread_functions.pthread_cond_init(cond, attr);
diff --git a/Userland/Libraries/LibC/pthread_integration.cpp b/Userland/Libraries/LibC/pthread_integration.cpp
index 64762f5d74..f802cd5247 100644
--- a/Userland/Libraries/LibC/pthread_integration.cpp
+++ b/Userland/Libraries/LibC/pthread_integration.cpp
@@ -97,7 +97,7 @@ static constexpr u32 MUTEX_UNLOCKED = 0;
static constexpr u32 MUTEX_LOCKED_NO_NEED_TO_WAKE = 1;
static constexpr u32 MUTEX_LOCKED_NEED_TO_WAKE = 2;
-int __pthread_mutex_init(pthread_mutex_t* mutex, const pthread_mutexattr_t* attributes)
+int __pthread_mutex_init(pthread_mutex_t* mutex, pthread_mutexattr_t const* attributes)
{
mutex->lock = 0;
mutex->owner = 0;
@@ -106,7 +106,7 @@ int __pthread_mutex_init(pthread_mutex_t* mutex, const pthread_mutexattr_t* attr
return 0;
}
-int pthread_mutex_init(pthread_mutex_t*, const pthread_mutexattr_t*) __attribute__((weak, alias("__pthread_mutex_init")));
+int pthread_mutex_init(pthread_mutex_t*, pthread_mutexattr_t const*) __attribute__((weak, alias("__pthread_mutex_init")));
int __pthread_mutex_trylock(pthread_mutex_t* mutex)
{
diff --git a/Userland/Libraries/LibC/pthread_tls.cpp b/Userland/Libraries/LibC/pthread_tls.cpp
index 6c32260dcd..abae74b75d 100644
--- a/Userland/Libraries/LibC/pthread_tls.cpp
+++ b/Userland/Libraries/LibC/pthread_tls.cpp
@@ -68,7 +68,7 @@ void* __pthread_getspecific(pthread_key_t key)
void* pthread_getspecific(pthread_key_t) __attribute__((weak, alias("__pthread_getspecific")));
-int __pthread_setspecific(pthread_key_t key, const void* value)
+int __pthread_setspecific(pthread_key_t key, void const* value)
{
if (key < 0)
return EINVAL;
@@ -79,7 +79,7 @@ int __pthread_setspecific(pthread_key_t key, const void* value)
return 0;
}
-int pthread_setspecific(pthread_key_t, const void*) __attribute__((weak, alias("__pthread_setspecific")));
+int pthread_setspecific(pthread_key_t, void const*) __attribute__((weak, alias("__pthread_setspecific")));
void __pthread_key_destroy_for_current_thread()
{
diff --git a/Userland/Libraries/LibC/pwd.cpp b/Userland/Libraries/LibC/pwd.cpp
index e55691d592..6b47b3d6f9 100644
--- a/Userland/Libraries/LibC/pwd.cpp
+++ b/Userland/Libraries/LibC/pwd.cpp
@@ -66,7 +66,7 @@ struct passwd* getpwuid(uid_t uid)
return nullptr;
}
-struct passwd* getpwnam(const char* name)
+struct passwd* getpwnam(char const* name)
{
setpwent();
while (auto* pw = getpwent()) {
@@ -76,7 +76,7 @@ struct passwd* getpwnam(const char* name)
return nullptr;
}
-static bool parse_pwddb_entry(const String& line)
+static bool parse_pwddb_entry(String const& line)
{
auto parts = line.split_view(':', true);
if (parts.size() != 7) {
@@ -168,7 +168,7 @@ static void construct_pwd(struct passwd* pwd, char* buf, struct passwd** result)
pwd->pw_shell = buf_shell;
}
-int getpwnam_r(const char* name, struct passwd* pwd, char* buf, size_t buflen, struct passwd** result)
+int getpwnam_r(char const* name, struct passwd* pwd, char* buf, size_t buflen, struct passwd** result)
{
// FIXME: This is a HACK!
TemporaryChange name_change { s_name, {} };
@@ -191,7 +191,7 @@ int getpwnam_r(const char* name, struct passwd* pwd, char* buf, size_t buflen, s
return 0;
}
- const auto total_buffer_length = s_name.length() + s_passwd.length() + s_gecos.length() + s_dir.length() + s_shell.length() + 5;
+ auto const total_buffer_length = s_name.length() + s_passwd.length() + s_gecos.length() + s_dir.length() + s_shell.length() + 5;
if (buflen < total_buffer_length)
return ERANGE;
@@ -222,7 +222,7 @@ int getpwuid_r(uid_t uid, struct passwd* pwd, char* buf, size_t buflen, struct p
return 0;
}
- const auto total_buffer_length = s_name.length() + s_passwd.length() + s_gecos.length() + s_dir.length() + s_shell.length() + 5;
+ auto const total_buffer_length = s_name.length() + s_passwd.length() + s_gecos.length() + s_dir.length() + s_shell.length() + 5;
if (buflen < total_buffer_length)
return ERANGE;
@@ -237,7 +237,7 @@ int putpwent(const struct passwd* p, FILE* stream)
return -1;
}
- auto is_valid_field = [](const char* str) {
+ auto is_valid_field = [](char const* str) {
return str && !strpbrk(str, ":\n");
};
diff --git a/Userland/Libraries/LibC/pwd.h b/Userland/Libraries/LibC/pwd.h
index a7d8acd24c..4554888d3a 100644
--- a/Userland/Libraries/LibC/pwd.h
+++ b/Userland/Libraries/LibC/pwd.h
@@ -25,11 +25,11 @@ struct passwd {
struct passwd* getpwent(void);
void setpwent(void);
void endpwent(void);
-struct passwd* getpwnam(const char* name);
+struct passwd* getpwnam(char const* name);
struct passwd* getpwuid(uid_t);
int putpwent(const struct passwd* p, FILE* stream);
-int getpwnam_r(const char* name, struct passwd* pwd, char* buf, size_t buflen, struct passwd** result);
+int getpwnam_r(char const* name, struct passwd* pwd, char* buf, size_t buflen, struct passwd** result);
int getpwuid_r(uid_t, struct passwd* pwd, char* buf, size_t buflen, struct passwd** result);
__END_DECLS
diff --git a/Userland/Libraries/LibC/qsort.cpp b/Userland/Libraries/LibC/qsort.cpp
index 6425f6bbcb..f628e0e189 100644
--- a/Userland/Libraries/LibC/qsort.cpp
+++ b/Userland/Libraries/LibC/qsort.cpp
@@ -28,12 +28,12 @@ private:
namespace AK {
template<>
-inline void swap(const SizedObject& a, const SizedObject& b)
+inline void swap(SizedObject const& a, SizedObject const& b)
{
VERIFY(a.size() == b.size());
const size_t size = a.size();
- const auto a_data = reinterpret_cast<char*>(a.data());
- const auto b_data = reinterpret_cast<char*>(b.data());
+ auto const a_data = reinterpret_cast<char*>(a.data());
+ auto const b_data = reinterpret_cast<char*>(b.data());
for (auto i = 0u; i < size; ++i) {
swap(a_data[i], b_data[i]);
}
@@ -60,7 +60,7 @@ private:
};
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/qsort.html
-void qsort(void* bot, size_t nmemb, size_t size, int (*compar)(const void*, const void*))
+void qsort(void* bot, size_t nmemb, size_t size, int (*compar)(void const*, void const*))
{
if (nmemb <= 1) {
return;
@@ -68,10 +68,10 @@ void qsort(void* bot, size_t nmemb, size_t size, int (*compar)(const void*, cons
SizedObjectSlice slice { bot, size };
- AK::dual_pivot_quick_sort(slice, 0, nmemb - 1, [=](const SizedObject& a, const SizedObject& b) { return compar(a.data(), b.data()) < 0; });
+ AK::dual_pivot_quick_sort(slice, 0, nmemb - 1, [=](SizedObject const& a, SizedObject const& b) { return compar(a.data(), b.data()) < 0; });
}
-void qsort_r(void* bot, size_t nmemb, size_t size, int (*compar)(const void*, const void*, void*), void* arg)
+void qsort_r(void* bot, size_t nmemb, size_t size, int (*compar)(void const*, void const*, void*), void* arg)
{
if (nmemb <= 1) {
return;
@@ -79,5 +79,5 @@ void qsort_r(void* bot, size_t nmemb, size_t size, int (*compar)(const void*, co
SizedObjectSlice slice { bot, size };
- AK::dual_pivot_quick_sort(slice, 0, nmemb - 1, [=](const SizedObject& a, const SizedObject& b) { return compar(a.data(), b.data(), arg) < 0; });
+ AK::dual_pivot_quick_sort(slice, 0, nmemb - 1, [=](SizedObject const& a, SizedObject const& b) { return compar(a.data(), b.data(), arg) < 0; });
}
diff --git a/Userland/Libraries/LibC/regex.cpp b/Userland/Libraries/LibC/regex.cpp
index dca3624113..394abb708a 100644
--- a/Userland/Libraries/LibC/regex.cpp
+++ b/Userland/Libraries/LibC/regex.cpp
@@ -13,9 +13,9 @@
static void* s_libregex;
static pthread_mutex_t s_libregex_lock;
-static int (*s_regcomp)(regex_t*, const char*, int);
-static int (*s_regexec)(const regex_t*, const char*, size_t, regmatch_t[], int);
-static size_t (*s_regerror)(int, const regex_t*, char*, size_t);
+static int (*s_regcomp)(regex_t*, char const*, int);
+static int (*s_regexec)(regex_t const*, char const*, size_t, regmatch_t[], int);
+static size_t (*s_regerror)(int, regex_t const*, char*, size_t);
static void (*s_regfree)(regex_t*);
static void ensure_libregex()
@@ -24,9 +24,9 @@ static void ensure_libregex()
if (!s_libregex) {
s_libregex = __dlopen("libregex.so", RTLD_NOW).value();
- s_regcomp = reinterpret_cast<int (*)(regex_t*, const char*, int)>(__dlsym(s_libregex, "regcomp").value());
- s_regexec = reinterpret_cast<int (*)(const regex_t*, const char*, size_t, regmatch_t[], int)>(__dlsym(s_libregex, "regexec").value());
- s_regerror = reinterpret_cast<size_t (*)(int, const regex_t*, char*, size_t)>(__dlsym(s_libregex, "regerror").value());
+ s_regcomp = reinterpret_cast<int (*)(regex_t*, char const*, int)>(__dlsym(s_libregex, "regcomp").value());
+ s_regexec = reinterpret_cast<int (*)(regex_t const*, char const*, size_t, regmatch_t[], int)>(__dlsym(s_libregex, "regexec").value());
+ s_regerror = reinterpret_cast<size_t (*)(int, regex_t const*, char*, size_t)>(__dlsym(s_libregex, "regerror").value());
s_regfree = reinterpret_cast<void (*)(regex_t*)>(__dlsym(s_libregex, "regfree").value());
}
pthread_mutex_unlock(&s_libregex_lock);
@@ -34,19 +34,19 @@ static void ensure_libregex()
extern "C" {
-int __attribute__((weak)) regcomp(regex_t* reg, const char* pattern, int cflags)
+int __attribute__((weak)) regcomp(regex_t* reg, char const* pattern, int cflags)
{
ensure_libregex();
return s_regcomp(reg, pattern, cflags);
}
-int __attribute__((weak)) regexec(const regex_t* reg, const char* string, size_t nmatch, regmatch_t pmatch[], int eflags)
+int __attribute__((weak)) regexec(regex_t const* reg, char const* string, size_t nmatch, regmatch_t pmatch[], int eflags)
{
ensure_libregex();
return s_regexec(reg, string, nmatch, pmatch, eflags);
}
-size_t __attribute__((weak)) regerror(int errcode, const regex_t* reg, char* errbuf, size_t errbuf_size)
+size_t __attribute__((weak)) regerror(int errcode, regex_t const* reg, char* errbuf, size_t errbuf_size)
{
ensure_libregex();
return s_regerror(errcode, reg, errbuf, errbuf_size);
diff --git a/Userland/Libraries/LibC/regex.h b/Userland/Libraries/LibC/regex.h
index da11c82d96..d51c138a65 100644
--- a/Userland/Libraries/LibC/regex.h
+++ b/Userland/Libraries/LibC/regex.h
@@ -101,9 +101,9 @@ enum __RegexAllFlags {
#define REG_SEARCH __Regex_Last << 1
-int regcomp(regex_t*, const char*, int);
-int regexec(const regex_t*, const char*, size_t, regmatch_t[], int);
-size_t regerror(int, const regex_t*, char*, size_t);
+int regcomp(regex_t*, char const*, int);
+int regexec(regex_t const*, char const*, size_t, regmatch_t[], int);
+size_t regerror(int, regex_t const*, char*, size_t);
void regfree(regex_t*);
__END_DECLS
diff --git a/Userland/Libraries/LibC/resolv.h b/Userland/Libraries/LibC/resolv.h
index 5b73bd9600..ff0a7f3447 100644
--- a/Userland/Libraries/LibC/resolv.h
+++ b/Userland/Libraries/LibC/resolv.h
@@ -10,6 +10,6 @@
__BEGIN_DECLS
-int res_query(const char* dname, int class_, int type, unsigned char* answer, int anslen);
+int res_query(char const* dname, int class_, int type, unsigned char* answer, int anslen);
__END_DECLS
diff --git a/Userland/Libraries/LibC/scanf.cpp b/Userland/Libraries/LibC/scanf.cpp
index 246e54e48a..27e981427d 100644
--- a/Userland/Libraries/LibC/scanf.cpp
+++ b/Userland/Libraries/LibC/scanf.cpp
@@ -384,7 +384,7 @@ private:
size_t count { 0 };
};
-extern "C" int vsscanf(const char* input, const char* format, va_list ap)
+extern "C" int vsscanf(char const* input, char const* format, va_list ap)
{
GenericLexer format_lexer { format };
GenericLexer input_lexer { input };
diff --git a/Userland/Libraries/LibC/search.cpp b/Userland/Libraries/LibC/search.cpp
index 7059297605..bad67a0b79 100644
--- a/Userland/Libraries/LibC/search.cpp
+++ b/Userland/Libraries/LibC/search.cpp
@@ -9,7 +9,7 @@
#include <bits/search.h>
#include <search.h>
-struct search_tree_node* new_tree_node(const void* key)
+struct search_tree_node* new_tree_node(void const* key)
{
auto* node = static_cast<struct search_tree_node*>(malloc(sizeof(struct search_tree_node)));
@@ -37,7 +37,7 @@ void delete_node_recursive(struct search_tree_node* node)
extern "C" {
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/tsearch.html
-void* tsearch(const void* key, void** rootp, int (*comparator)(const void*, const void*))
+void* tsearch(void const* key, void** rootp, int (*comparator)(void const*, void const*))
{
if (!rootp)
return nullptr;
@@ -71,7 +71,7 @@ void* tsearch(const void* key, void** rootp, int (*comparator)(const void*, cons
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/tfind.html
-void* tfind(const void* key, void* const* rootp, int (*comparator)(const void*, const void*))
+void* tfind(void const* key, void* const* rootp, int (*comparator)(void const*, void const*))
{
if (!rootp)
return nullptr;
@@ -93,13 +93,13 @@ void* tfind(const void* key, void* const* rootp, int (*comparator)(const void*,
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/tdelete.html
-void* tdelete(const void*, void**, int (*)(const void*, const void*))
+void* tdelete(void const*, void**, int (*)(void const*, void const*))
{
dbgln("FIXME: Implement tdelete()");
return nullptr;
}
-static void twalk_internal(const struct search_tree_node* node, void (*action)(const void*, VISIT, int), int depth)
+static void twalk_internal(const struct search_tree_node* node, void (*action)(void const*, VISIT, int), int depth)
{
if (!node)
return;
@@ -117,7 +117,7 @@ static void twalk_internal(const struct search_tree_node* node, void (*action)(c
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/twalk.html
-void twalk(const void* rootp, void (*action)(const void*, VISIT, int))
+void twalk(void const* rootp, void (*action)(void const*, VISIT, int))
{
auto node = static_cast<const struct search_tree_node*>(rootp);
diff --git a/Userland/Libraries/LibC/search.h b/Userland/Libraries/LibC/search.h
index cd02738a5a..1020c34487 100644
--- a/Userland/Libraries/LibC/search.h
+++ b/Userland/Libraries/LibC/search.h
@@ -17,9 +17,9 @@ typedef enum {
leaf,
} VISIT;
-void* tsearch(const void*, void**, int (*)(const void*, const void*));
-void* tfind(const void*, void* const*, int (*)(const void*, const void*));
-void* tdelete(const void*, void**, int (*)(const void*, const void*));
-void twalk(const void*, void (*)(const void*, VISIT, int));
+void* tsearch(void const*, void**, int (*)(void const*, void const*));
+void* tfind(void const*, void* const*, int (*)(void const*, void const*));
+void* tdelete(void const*, void**, int (*)(void const*, void const*));
+void twalk(void const*, void (*)(void const*, VISIT, int));
__END_DECLS
diff --git a/Userland/Libraries/LibC/serenity.cpp b/Userland/Libraries/LibC/serenity.cpp
index e67e98e284..11c9524d4e 100644
--- a/Userland/Libraries/LibC/serenity.cpp
+++ b/Userland/Libraries/LibC/serenity.cpp
@@ -101,7 +101,7 @@ int anon_create(size_t size, int options)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int serenity_readlink(const char* path, size_t path_length, char* buffer, size_t buffer_size)
+int serenity_readlink(char const* path, size_t path_length, char* buffer, size_t buffer_size)
{
Syscall::SC_readlink_params small_params {
{ path, path_length },
@@ -111,7 +111,7 @@ int serenity_readlink(const char* path, size_t path_length, char* buffer, size_t
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int setkeymap(const char* name, const u32* map, u32* const shift_map, const u32* alt_map, const u32* altgr_map, const u32* shift_altgr_map)
+int setkeymap(char const* name, u32 const* map, u32* const shift_map, u32 const* alt_map, u32 const* altgr_map, u32 const* shift_altgr_map)
{
Syscall::SC_setkeymap_params params { map, shift_map, alt_map, altgr_map, shift_altgr_map, { name, strlen(name) } };
return syscall(SC_setkeymap, &params);
@@ -131,10 +131,10 @@ int getkeymap(char* name_buffer, size_t name_buffer_size, u32* map, u32* shift_m
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-u16 internet_checksum(const void* ptr, size_t count)
+u16 internet_checksum(void const* ptr, size_t count)
{
u32 checksum = 0;
- auto* w = (const u16*)ptr;
+ auto* w = (u16 const*)ptr;
while (count > 1) {
checksum += ntohs(*w++);
if (checksum & 0x80000000)
diff --git a/Userland/Libraries/LibC/serenity.h b/Userland/Libraries/LibC/serenity.h
index c60625494b..6ab5538743 100644
--- a/Userland/Libraries/LibC/serenity.h
+++ b/Userland/Libraries/LibC/serenity.h
@@ -60,12 +60,12 @@ int get_stack_bounds(uintptr_t* user_stack_base, size_t* user_stack_size);
int anon_create(size_t size, int options);
-int serenity_readlink(const char* path, size_t path_length, char* buffer, size_t buffer_size);
+int serenity_readlink(char const* path, size_t path_length, char* buffer, size_t buffer_size);
int getkeymap(char* name_buffer, size_t name_buffer_size, uint32_t* map, uint32_t* shift_map, uint32_t* alt_map, uint32_t* altgr_map, uint32_t* shift_altgr_map);
-int setkeymap(const char* name, const uint32_t* map, uint32_t* const shift_map, const uint32_t* alt_map, const uint32_t* altgr_map, const uint32_t* shift_altgr_map);
+int setkeymap(char const* name, uint32_t const* map, uint32_t* const shift_map, uint32_t const* alt_map, uint32_t const* altgr_map, uint32_t const* shift_altgr_map);
-uint16_t internet_checksum(const void* ptr, size_t count);
+uint16_t internet_checksum(void const* ptr, size_t count);
int emuctl(uintptr_t command, uintptr_t arg0, uintptr_t arg1);
diff --git a/Userland/Libraries/LibC/shadow.cpp b/Userland/Libraries/LibC/shadow.cpp
index 628925ea29..a7504ec3d9 100644
--- a/Userland/Libraries/LibC/shadow.cpp
+++ b/Userland/Libraries/LibC/shadow.cpp
@@ -51,7 +51,7 @@ void endspent()
s_pwdp = {};
}
-struct spwd* getspnam(const char* name)
+struct spwd* getspnam(char const* name)
{
setspent();
while (auto* sp = getspent()) {
@@ -62,7 +62,7 @@ struct spwd* getspnam(const char* name)
return nullptr;
}
-static bool parse_shadow_entry(const String& line)
+static bool parse_shadow_entry(String const& line)
{
auto parts = line.split_view(':', true);
if (parts.size() != 9) {
@@ -192,7 +192,7 @@ static void construct_spwd(struct spwd* sp, char* buf, struct spwd** result)
sp->sp_pwdp = buf_pwdp;
}
-int getspnam_r(const char* name, struct spwd* sp, char* buf, size_t buflen, struct spwd** result)
+int getspnam_r(char const* name, struct spwd* sp, char* buf, size_t buflen, struct spwd** result)
{
// FIXME: This is a HACK!
TemporaryChange name_change { s_name, {} };
@@ -212,7 +212,7 @@ int getspnam_r(const char* name, struct spwd* sp, char* buf, size_t buflen, stru
return 0;
}
- const auto total_buffer_length = s_name.length() + s_pwdp.length() + 8;
+ auto const total_buffer_length = s_name.length() + s_pwdp.length() + 8;
if (buflen < total_buffer_length)
return ERANGE;
@@ -227,7 +227,7 @@ int putspent(struct spwd* p, FILE* stream)
return -1;
}
- auto is_valid_field = [](const char* str) {
+ auto is_valid_field = [](char const* str) {
return str && !strpbrk(str, ":\n");
};
diff --git a/Userland/Libraries/LibC/shadow.h b/Userland/Libraries/LibC/shadow.h
index a766451f7e..0d3e463931 100644
--- a/Userland/Libraries/LibC/shadow.h
+++ b/Userland/Libraries/LibC/shadow.h
@@ -27,13 +27,13 @@ struct spwd {
struct spwd* getspent(void);
void setspent(void);
void endspent(void);
-struct spwd* getspnam(const char* name);
+struct spwd* getspnam(char const* name);
int putspent(struct spwd* p, FILE* stream);
int getspent_r(struct spwd* spbuf, char* buf, size_t buflen, struct spwd** spbufp);
-int getspnam_r(const char* name, struct spwd* spbuf, char* buf, size_t buflen, struct spwd** spbufp);
+int getspnam_r(char const* name, struct spwd* spbuf, char* buf, size_t buflen, struct spwd** spbufp);
int fgetspent_r(FILE* fp, struct spwd* spbuf, char* buf, size_t buflen, struct spwd** spbufp);
-int sgetspent_r(const char* s, struct spwd* spbuf, char* buf, size_t buflen, struct spwd** spbufp);
+int sgetspent_r(char const* s, struct spwd* spbuf, char* buf, size_t buflen, struct spwd** spbufp);
__END_DECLS
diff --git a/Userland/Libraries/LibC/signal.cpp b/Userland/Libraries/LibC/signal.cpp
index abbab504a4..37fba25965 100644
--- a/Userland/Libraries/LibC/signal.cpp
+++ b/Userland/Libraries/LibC/signal.cpp
@@ -84,7 +84,7 @@ int sigaddset(sigset_t* set, int sig)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaltstack.html
-int sigaltstack(const stack_t* ss, stack_t* old_ss)
+int sigaltstack(stack_t const* ss, stack_t* old_ss)
{
int rc = syscall(SC_sigaltstack, ss, old_ss);
__RETURN_WITH_ERRNO(rc, rc, -1);
@@ -102,7 +102,7 @@ int sigdelset(sigset_t* set, int sig)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigismember.html
-int sigismember(const sigset_t* set, int sig)
+int sigismember(sigset_t const* set, int sig)
{
if (sig < 1 || sig > 32) {
errno = EINVAL;
@@ -114,7 +114,7 @@ int sigismember(const sigset_t* set, int sig)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigprocmask.html
-int sigprocmask(int how, const sigset_t* set, sigset_t* old_set)
+int sigprocmask(int how, sigset_t const* set, sigset_t* old_set)
{
int rc = syscall(SC_sigprocmask, how, set, old_set);
__RETURN_WITH_ERRNO(rc, rc, -1);
@@ -127,7 +127,7 @@ int sigpending(sigset_t* set)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-const char* sys_siglist[NSIG] = {
+char const* sys_siglist[NSIG] = {
"Invalid signal number",
"Hangup",
"Interrupt",
@@ -173,7 +173,7 @@ void siglongjmp(jmp_buf env, int val)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigsuspend.html
-int sigsuspend(const sigset_t* set)
+int sigsuspend(sigset_t const* set)
{
return pselect(0, nullptr, nullptr, nullptr, nullptr, set);
}
@@ -202,7 +202,7 @@ int sigtimedwait(sigset_t const* set, siginfo_t* info, struct timespec const* ti
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-const char* sys_signame[] = {
+char const* sys_signame[] = {
"INVAL",
"HUP",
"INT",
@@ -237,9 +237,9 @@ const char* sys_signame[] = {
"SYS",
};
-static_assert(sizeof(sys_signame) == sizeof(const char*) * NSIG);
+static_assert(sizeof(sys_signame) == sizeof(char const*) * NSIG);
-int getsignalbyname(const char* name)
+int getsignalbyname(char const* name)
{
VERIFY(name);
StringView name_sv(name);
@@ -252,7 +252,7 @@ int getsignalbyname(const char* name)
return -1;
}
-const char* getsignalname(int signal)
+char const* getsignalname(int signal)
{
if (signal < 0 || signal >= NSIG) {
errno = EINVAL;
diff --git a/Userland/Libraries/LibC/signal.h b/Userland/Libraries/LibC/signal.h
index 3ed14348a0..2431e052db 100644
--- a/Userland/Libraries/LibC/signal.h
+++ b/Userland/Libraries/LibC/signal.h
@@ -17,25 +17,25 @@ __BEGIN_DECLS
int kill(pid_t, int sig);
int killpg(int pgrp, int sig);
sighandler_t signal(int sig, sighandler_t);
-int pthread_sigmask(int how, const sigset_t* set, sigset_t* old_set);
+int pthread_sigmask(int how, sigset_t const* set, sigset_t* old_set);
int sigaction(int sig, const struct sigaction* act, struct sigaction* old_act);
int sigemptyset(sigset_t*);
int sigfillset(sigset_t*);
int sigaddset(sigset_t*, int sig);
-int sigaltstack(const stack_t* ss, stack_t* old_ss);
+int sigaltstack(stack_t const* ss, stack_t* old_ss);
int sigdelset(sigset_t*, int sig);
-int sigismember(const sigset_t*, int sig);
-int sigprocmask(int how, const sigset_t* set, sigset_t* old_set);
+int sigismember(sigset_t const*, int sig);
+int sigprocmask(int how, sigset_t const* set, sigset_t* old_set);
int sigpending(sigset_t*);
-int sigsuspend(const sigset_t*);
+int sigsuspend(sigset_t const*);
int sigtimedwait(sigset_t const*, siginfo_t*, struct timespec const*);
int sigwait(sigset_t const*, int*);
int sigwaitinfo(sigset_t const*, siginfo_t*);
int raise(int sig);
-int getsignalbyname(const char*);
-const char* getsignalname(int);
+int getsignalbyname(char const*);
+char const* getsignalname(int);
-extern const char* sys_siglist[NSIG];
-extern const char* sys_signame[NSIG];
+extern char const* sys_siglist[NSIG];
+extern char const* sys_signame[NSIG];
__END_DECLS
diff --git a/Userland/Libraries/LibC/spawn.cpp b/Userland/Libraries/LibC/spawn.cpp
index c1ac4b5a7b..8cdc1fe0e1 100644
--- a/Userland/Libraries/LibC/spawn.cpp
+++ b/Userland/Libraries/LibC/spawn.cpp
@@ -29,7 +29,7 @@ struct posix_spawn_file_actions_state {
extern "C" {
-[[noreturn]] static void posix_spawn_child(const char* path, const posix_spawn_file_actions_t* file_actions, const posix_spawnattr_t* attr, char* const argv[], char* const envp[], int (*exec)(const char*, char* const[], char* const[]))
+[[noreturn]] static void posix_spawn_child(char const* path, posix_spawn_file_actions_t const* file_actions, posix_spawnattr_t const* attr, char* const argv[], char* const envp[], int (*exec)(char const*, char* const[], char* const[]))
{
if (attr) {
short flags = attr->flags;
@@ -86,7 +86,7 @@ extern "C" {
}
if (file_actions) {
- for (const auto& action : file_actions->state->actions) {
+ for (auto const& action : file_actions->state->actions) {
if (action() < 0) {
perror("posix_spawn file action");
_exit(127);
@@ -100,7 +100,7 @@ extern "C" {
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn.html
-int posix_spawn(pid_t* out_pid, const char* path, const posix_spawn_file_actions_t* file_actions, const posix_spawnattr_t* attr, char* const argv[], char* const envp[])
+int posix_spawn(pid_t* out_pid, char const* path, posix_spawn_file_actions_t const* file_actions, posix_spawnattr_t const* attr, char* const argv[], char* const envp[])
{
pid_t child_pid = fork();
if (child_pid < 0)
@@ -115,7 +115,7 @@ int posix_spawn(pid_t* out_pid, const char* path, const posix_spawn_file_actions
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawnp.html
-int posix_spawnp(pid_t* out_pid, const char* path, const posix_spawn_file_actions_t* file_actions, const posix_spawnattr_t* attr, char* const argv[], char* const envp[])
+int posix_spawnp(pid_t* out_pid, char const* path, posix_spawn_file_actions_t const* file_actions, posix_spawnattr_t const* attr, char* const argv[], char* const envp[])
{
pid_t child_pid = fork();
if (child_pid < 0)
@@ -130,7 +130,7 @@ int posix_spawnp(pid_t* out_pid, const char* path, const posix_spawn_file_action
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn_file_actions_addchdir.html
-int posix_spawn_file_actions_addchdir(posix_spawn_file_actions_t* actions, const char* path)
+int posix_spawn_file_actions_addchdir(posix_spawn_file_actions_t* actions, char const* path)
{
actions->state->actions.append([path]() { return chdir(path); });
return 0;
@@ -157,7 +157,7 @@ int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t* actions, int ol
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn_file_actions_addopen.html
-int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t* actions, int want_fd, const char* path, int flags, mode_t mode)
+int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t* actions, int want_fd, char const* path, int flags, mode_t mode)
{
actions->state->actions.append([want_fd, path, flags, mode]() {
int opened_fd = open(path, flags, mode);
@@ -191,42 +191,42 @@ int posix_spawnattr_destroy(posix_spawnattr_t*)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawnattr_getflags.html
-int posix_spawnattr_getflags(const posix_spawnattr_t* attr, short* out_flags)
+int posix_spawnattr_getflags(posix_spawnattr_t const* attr, short* out_flags)
{
*out_flags = attr->flags;
return 0;
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawnattr_getpgroup.html
-int posix_spawnattr_getpgroup(const posix_spawnattr_t* attr, pid_t* out_pgroup)
+int posix_spawnattr_getpgroup(posix_spawnattr_t const* attr, pid_t* out_pgroup)
{
*out_pgroup = attr->pgroup;
return 0;
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawnattr_getschedparam.html
-int posix_spawnattr_getschedparam(const posix_spawnattr_t* attr, struct sched_param* out_schedparam)
+int posix_spawnattr_getschedparam(posix_spawnattr_t const* attr, struct sched_param* out_schedparam)
{
*out_schedparam = attr->schedparam;
return 0;
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawnattr_getschedpolicy.html
-int posix_spawnattr_getschedpolicy(const posix_spawnattr_t* attr, int* out_schedpolicy)
+int posix_spawnattr_getschedpolicy(posix_spawnattr_t const* attr, int* out_schedpolicy)
{
*out_schedpolicy = attr->schedpolicy;
return 0;
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawnattr_getsigdefault.html
-int posix_spawnattr_getsigdefault(const posix_spawnattr_t* attr, sigset_t* out_sigdefault)
+int posix_spawnattr_getsigdefault(posix_spawnattr_t const* attr, sigset_t* out_sigdefault)
{
*out_sigdefault = attr->sigdefault;
return 0;
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawnattr_getsigmask.html
-int posix_spawnattr_getsigmask(const posix_spawnattr_t* attr, sigset_t* out_sigmask)
+int posix_spawnattr_getsigmask(posix_spawnattr_t const* attr, sigset_t* out_sigmask)
{
*out_sigmask = attr->sigmask;
return 0;
@@ -276,14 +276,14 @@ int posix_spawnattr_setschedpolicy(posix_spawnattr_t* attr, int schedpolicy)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawnattr_setsigdefault.html
-int posix_spawnattr_setsigdefault(posix_spawnattr_t* attr, const sigset_t* sigdefault)
+int posix_spawnattr_setsigdefault(posix_spawnattr_t* attr, sigset_t const* sigdefault)
{
attr->sigdefault = *sigdefault;
return 0;
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawnattr_setsigmask.html
-int posix_spawnattr_setsigmask(posix_spawnattr_t* attr, const sigset_t* sigmask)
+int posix_spawnattr_setsigmask(posix_spawnattr_t* attr, sigset_t const* sigmask)
{
attr->sigmask = *sigmask;
return 0;
diff --git a/Userland/Libraries/LibC/spawn.h b/Userland/Libraries/LibC/spawn.h
index c5f2168b1a..8531e67044 100644
--- a/Userland/Libraries/LibC/spawn.h
+++ b/Userland/Libraries/LibC/spawn.h
@@ -49,30 +49,30 @@ typedef struct {
sigset_t sigmask;
} posix_spawnattr_t;
-int posix_spawn(pid_t*, const char*, const posix_spawn_file_actions_t*, const posix_spawnattr_t*, char* const argv[], char* const envp[]);
-int posix_spawnp(pid_t*, const char*, const posix_spawn_file_actions_t*, const posix_spawnattr_t*, char* const argv[], char* const envp[]);
+int posix_spawn(pid_t*, char const*, posix_spawn_file_actions_t const*, posix_spawnattr_t const*, char* const argv[], char* const envp[]);
+int posix_spawnp(pid_t*, char const*, posix_spawn_file_actions_t const*, posix_spawnattr_t const*, char* const argv[], char* const envp[]);
-int posix_spawn_file_actions_addchdir(posix_spawn_file_actions_t*, const char*);
+int posix_spawn_file_actions_addchdir(posix_spawn_file_actions_t*, char const*);
int posix_spawn_file_actions_addfchdir(posix_spawn_file_actions_t*, int);
int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t*, int);
int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t*, int old_fd, int new_fd);
-int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t*, int fd, const char*, int flags, mode_t);
+int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t*, int fd, char const*, int flags, mode_t);
int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t*);
int posix_spawn_file_actions_init(posix_spawn_file_actions_t*);
int posix_spawnattr_destroy(posix_spawnattr_t*);
-int posix_spawnattr_getflags(const posix_spawnattr_t*, short*);
-int posix_spawnattr_getpgroup(const posix_spawnattr_t*, pid_t*);
-int posix_spawnattr_getschedparam(const posix_spawnattr_t*, struct sched_param*);
-int posix_spawnattr_getschedpolicy(const posix_spawnattr_t*, int*);
-int posix_spawnattr_getsigdefault(const posix_spawnattr_t*, sigset_t*);
-int posix_spawnattr_getsigmask(const posix_spawnattr_t*, sigset_t*);
+int posix_spawnattr_getflags(posix_spawnattr_t const*, short*);
+int posix_spawnattr_getpgroup(posix_spawnattr_t const*, pid_t*);
+int posix_spawnattr_getschedparam(posix_spawnattr_t const*, struct sched_param*);
+int posix_spawnattr_getschedpolicy(posix_spawnattr_t const*, int*);
+int posix_spawnattr_getsigdefault(posix_spawnattr_t const*, sigset_t*);
+int posix_spawnattr_getsigmask(posix_spawnattr_t const*, sigset_t*);
int posix_spawnattr_init(posix_spawnattr_t*);
int posix_spawnattr_setflags(posix_spawnattr_t*, short);
int posix_spawnattr_setpgroup(posix_spawnattr_t*, pid_t);
int posix_spawnattr_setschedparam(posix_spawnattr_t*, const struct sched_param*);
int posix_spawnattr_setschedpolicy(posix_spawnattr_t*, int);
-int posix_spawnattr_setsigdefault(posix_spawnattr_t*, const sigset_t*);
-int posix_spawnattr_setsigmask(posix_spawnattr_t*, const sigset_t*);
+int posix_spawnattr_setsigdefault(posix_spawnattr_t*, sigset_t const*);
+int posix_spawnattr_setsigmask(posix_spawnattr_t*, sigset_t const*);
__END_DECLS
diff --git a/Userland/Libraries/LibC/stat.cpp b/Userland/Libraries/LibC/stat.cpp
index 3516de8df3..bcb52fd898 100644
--- a/Userland/Libraries/LibC/stat.cpp
+++ b/Userland/Libraries/LibC/stat.cpp
@@ -22,7 +22,7 @@ mode_t umask(mode_t mask)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdir.html
-int mkdir(const char* pathname, mode_t mode)
+int mkdir(char const* pathname, mode_t mode)
{
if (!pathname) {
errno = EFAULT;
@@ -33,7 +33,7 @@ int mkdir(const char* pathname, mode_t mode)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/chmod.html
-int chmod(const char* pathname, mode_t mode)
+int chmod(char const* pathname, mode_t mode)
{
return fchmodat(AT_FDCWD, pathname, mode, 0);
}
@@ -69,12 +69,12 @@ int fchmod(int fd, mode_t mode)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkfifo.html
-int mkfifo(const char* pathname, mode_t mode)
+int mkfifo(char const* pathname, mode_t mode)
{
return mknod(pathname, mode | S_IFIFO, 0);
}
-static int do_stat(int dirfd, const char* path, struct stat* statbuf, bool follow_symlinks)
+static int do_stat(int dirfd, char const* path, struct stat* statbuf, bool follow_symlinks)
{
if (!path) {
errno = EFAULT;
@@ -86,13 +86,13 @@ static int do_stat(int dirfd, const char* path, struct stat* statbuf, bool follo
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/lstat.html
-int lstat(const char* path, struct stat* statbuf)
+int lstat(char const* path, struct stat* statbuf)
{
return do_stat(AT_FDCWD, path, statbuf, false);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/stat.html
-int stat(const char* path, struct stat* statbuf)
+int stat(char const* path, struct stat* statbuf)
{
return do_stat(AT_FDCWD, path, statbuf, true);
}
@@ -105,7 +105,7 @@ int fstat(int fd, struct stat* statbuf)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/fstatat.html
-int fstatat(int fd, const char* path, struct stat* statbuf, int flags)
+int fstatat(int fd, char const* path, struct stat* statbuf, int flags)
{
return do_stat(fd, path, statbuf, !(flags & AT_SYMLINK_NOFOLLOW));
}
diff --git a/Userland/Libraries/LibC/stdio.cpp b/Userland/Libraries/LibC/stdio.cpp
index efcab202e5..ee23401c5c 100644
--- a/Userland/Libraries/LibC/stdio.cpp
+++ b/Userland/Libraries/LibC/stdio.cpp
@@ -124,7 +124,7 @@ ssize_t FILE::do_read(u8* data, size_t size)
return nread;
}
-ssize_t FILE::do_write(const u8* data, size_t size)
+ssize_t FILE::do_write(u8 const* data, size_t size)
{
int nwritten = ::write(m_fd, data, size);
@@ -154,7 +154,7 @@ bool FILE::read_into_buffer()
bool FILE::write_from_buffer()
{
size_t size;
- const u8* data = m_buffer.begin_dequeue(size);
+ u8 const* data = m_buffer.begin_dequeue(size);
// If we want to write, the buffer must have something in it!
VERIFY(size);
@@ -180,7 +180,7 @@ size_t FILE::read(u8* data, size_t size)
if (m_buffer.may_use()) {
// Let's see if the buffer has something queued for us.
size_t queued_size;
- const u8* queued_data = m_buffer.begin_dequeue(queued_size);
+ u8 const* queued_data = m_buffer.begin_dequeue(queued_size);
if (queued_size == 0) {
// Nothing buffered; we're going to have to read some.
bool read_some_more = read_into_buffer();
@@ -209,7 +209,7 @@ size_t FILE::read(u8* data, size_t size)
return total_read;
}
-size_t FILE::write(const u8* data, size_t size)
+size_t FILE::write(u8 const* data, size_t size)
{
size_t total_written = 0;
@@ -426,7 +426,7 @@ size_t FILE::Buffer::buffered_size() const
return m_capacity - (m_begin - m_end);
}
-const u8* FILE::Buffer::begin_dequeue(size_t& available_size) const
+u8 const* FILE::Buffer::begin_dequeue(size_t& available_size) const
{
if (m_ungotten != 0u) {
auto available_bytes = count_trailing_zeroes(m_ungotten) + 1;
@@ -743,19 +743,19 @@ int putchar(int ch)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/fputs.html
-int fputs(const char* s, FILE* stream)
+int fputs(char const* s, FILE* stream)
{
VERIFY(stream);
size_t len = strlen(s);
ScopedFileLock lock(stream);
- size_t nwritten = stream->write(reinterpret_cast<const u8*>(s), len);
+ size_t nwritten = stream->write(reinterpret_cast<u8 const*>(s), len);
if (nwritten < len)
return EOF;
return 1;
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/puts.html
-int puts(const char* s)
+int puts(char const* s)
{
int rc = fputs(s, stdout);
if (rc == EOF)
@@ -799,13 +799,13 @@ size_t fread(void* ptr, size_t size, size_t nmemb, FILE* stream)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/fwrite.html
-size_t fwrite(const void* ptr, size_t size, size_t nmemb, FILE* stream)
+size_t fwrite(void const* ptr, size_t size, size_t nmemb, FILE* stream)
{
VERIFY(stream);
VERIFY(!Checked<size_t>::multiplication_would_overflow(size, nmemb));
ScopedFileLock lock(stream);
- size_t nwritten = stream->write(reinterpret_cast<const u8*>(ptr), size * nmemb);
+ size_t nwritten = stream->write(reinterpret_cast<u8 const*>(ptr), size * nmemb);
if (!nwritten)
return 0;
return nwritten / size;
@@ -859,7 +859,7 @@ int fgetpos(FILE* stream, fpos_t* pos)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsetpos.html
-int fsetpos(FILE* stream, const fpos_t* pos)
+int fsetpos(FILE* stream, fpos_t const* pos)
{
VERIFY(stream);
VERIFY(pos);
@@ -881,13 +881,13 @@ ALWAYS_INLINE void stdout_putch(char*&, char ch)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/vfprintf.html
-int vfprintf(FILE* stream, const char* fmt, va_list ap)
+int vfprintf(FILE* stream, char const* fmt, va_list ap)
{
return printf_internal([stream](auto, char ch) { fputc(ch, stream); }, nullptr, fmt, ap);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/fprintf.html
-int fprintf(FILE* stream, const char* fmt, ...)
+int fprintf(FILE* stream, char const* fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@@ -897,13 +897,13 @@ int fprintf(FILE* stream, const char* fmt, ...)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/vprintf.html
-int vprintf(const char* fmt, va_list ap)
+int vprintf(char const* fmt, va_list ap)
{
return printf_internal(stdout_putch, nullptr, fmt, ap);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html
-int printf(const char* fmt, ...)
+int printf(char const* fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@@ -913,7 +913,7 @@ int printf(const char* fmt, ...)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/vasprintf.html
-int vasprintf(char** strp, const char* fmt, va_list ap)
+int vasprintf(char** strp, char const* fmt, va_list ap)
{
StringBuilder builder;
builder.appendvf(fmt, ap);
@@ -924,7 +924,7 @@ int vasprintf(char** strp, const char* fmt, va_list ap)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/asprintf.html
-int asprintf(char** strp, const char* fmt, ...)
+int asprintf(char** strp, char const* fmt, ...)
{
StringBuilder builder;
va_list ap;
@@ -943,7 +943,7 @@ static void buffer_putch(char*& bufptr, char ch)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/vsprintf.html
-int vsprintf(char* buffer, const char* fmt, va_list ap)
+int vsprintf(char* buffer, char const* fmt, va_list ap)
{
int ret = printf_internal(buffer_putch, buffer, fmt, ap);
buffer[ret] = '\0';
@@ -951,7 +951,7 @@ int vsprintf(char* buffer, const char* fmt, va_list ap)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sprintf.html
-int sprintf(char* buffer, const char* fmt, ...)
+int sprintf(char* buffer, char const* fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@@ -961,7 +961,7 @@ int sprintf(char* buffer, const char* fmt, ...)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/vsnprintf.html
-int vsnprintf(char* buffer, size_t size, const char* fmt, va_list ap)
+int vsnprintf(char* buffer, size_t size, char const* fmt, va_list ap)
{
size_t space_remaining = 0;
if (size) {
@@ -985,7 +985,7 @@ int vsnprintf(char* buffer, size_t size, const char* fmt, va_list ap)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/snprintf.html
-int snprintf(char* buffer, size_t size, const char* fmt, ...)
+int snprintf(char* buffer, size_t size, char const* fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@@ -995,14 +995,14 @@ int snprintf(char* buffer, size_t size, const char* fmt, ...)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/perror.html
-void perror(const char* s)
+void perror(char const* s)
{
int saved_errno = errno;
dbgln("perror(): {}: {}", s, strerror(saved_errno));
warnln("{}: {}", s, strerror(saved_errno));
}
-static int parse_mode(const char* mode)
+static int parse_mode(char const* mode)
{
int flags = 0;
@@ -1040,7 +1040,7 @@ static int parse_mode(const char* mode)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/fopen.html
-FILE* fopen(const char* pathname, const char* mode)
+FILE* fopen(char const* pathname, char const* mode)
{
int flags = parse_mode(mode);
int fd = open(pathname, flags, 0666);
@@ -1050,7 +1050,7 @@ FILE* fopen(const char* pathname, const char* mode)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/freopen.html
-FILE* freopen(const char* pathname, const char* mode, FILE* stream)
+FILE* freopen(char const* pathname, char const* mode, FILE* stream)
{
VERIFY(stream);
if (!pathname) {
@@ -1068,7 +1068,7 @@ FILE* freopen(const char* pathname, const char* mode, FILE* stream)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdopen.html
-FILE* fdopen(int fd, const char* mode)
+FILE* fdopen(int fd, char const* mode)
{
int flags = parse_mode(mode);
// FIXME: Verify that the mode matches how fd is already open.
@@ -1078,7 +1078,7 @@ FILE* fdopen(int fd, const char* mode)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html
-FILE* fmemopen(void*, size_t, const char*)
+FILE* fmemopen(void*, size_t, char const*)
{
// FIXME: Implement me :^)
TODO();
@@ -1113,7 +1113,7 @@ int fclose(FILE* stream)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/rename.html
-int rename(const char* oldpath, const char* newpath)
+int rename(char const* oldpath, char const* newpath)
{
if (!oldpath || !newpath) {
errno = EFAULT;
@@ -1124,7 +1124,7 @@ int rename(const char* oldpath, const char* newpath)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-void dbgputstr(const char* characters, size_t length)
+void dbgputstr(char const* characters, size_t length)
{
syscall(SC_dbgputstr, characters, length);
}
@@ -1137,7 +1137,7 @@ char* tmpnam(char*)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/popen.html
-FILE* popen(const char* command, const char* type)
+FILE* popen(char const* command, char const* type)
{
if (!type || (*type != 'r' && *type != 'w')) {
errno = EINVAL;
@@ -1208,7 +1208,7 @@ int pclose(FILE* stream)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/remove.html
-int remove(const char* pathname)
+int remove(char const* pathname)
{
if (unlink(pathname) < 0) {
if (errno == EISDIR)
@@ -1219,7 +1219,7 @@ int remove(const char* pathname)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/scanf.html
-int scanf(const char* fmt, ...)
+int scanf(char const* fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@@ -1229,7 +1229,7 @@ int scanf(const char* fmt, ...)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/fscanf.html
-int fscanf(FILE* stream, const char* fmt, ...)
+int fscanf(FILE* stream, char const* fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@@ -1239,7 +1239,7 @@ int fscanf(FILE* stream, const char* fmt, ...)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sscanf.html
-int sscanf(const char* buffer, const char* fmt, ...)
+int sscanf(char const* buffer, char const* fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@@ -1249,7 +1249,7 @@ int sscanf(const char* buffer, const char* fmt, ...)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/vfscanf.html
-int vfscanf(FILE* stream, const char* fmt, va_list ap)
+int vfscanf(FILE* stream, char const* fmt, va_list ap)
{
char buffer[BUFSIZ];
if (!fgets(buffer, sizeof(buffer) - 1, stream))
@@ -1258,7 +1258,7 @@ int vfscanf(FILE* stream, const char* fmt, va_list ap)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/vscanf.html
-int vscanf(const char* fmt, va_list ap)
+int vscanf(char const* fmt, va_list ap)
{
return vfscanf(stdin, fmt, ap);
}
diff --git a/Userland/Libraries/LibC/stdio.h b/Userland/Libraries/LibC/stdio.h
index 8128beca77..96999ae422 100644
--- a/Userland/Libraries/LibC/stdio.h
+++ b/Userland/Libraries/LibC/stdio.h
@@ -39,7 +39,7 @@ typedef off_t fpos_t;
int fseek(FILE*, long offset, int whence);
int fseeko(FILE*, off_t offset, int whence);
int fgetpos(FILE*, fpos_t*);
-int fsetpos(FILE*, const fpos_t*);
+int fsetpos(FILE*, fpos_t const*);
long ftell(FILE*);
off_t ftello(FILE*);
char* fgets(char* buffer, int size, FILE*);
@@ -53,11 +53,11 @@ int getchar(void);
ssize_t getdelim(char**, size_t*, int, FILE*);
ssize_t getline(char**, size_t*, FILE*);
int ungetc(int c, FILE*);
-int remove(const char* pathname);
-FILE* fdopen(int fd, const char* mode);
-FILE* fopen(const char* pathname, const char* mode);
-FILE* freopen(const char* pathname, const char* mode, FILE*);
-FILE* fmemopen(void* buf, size_t size, const char* mode);
+int remove(char const* pathname);
+FILE* fdopen(int fd, char const* mode);
+FILE* fopen(char const* pathname, char const* mode);
+FILE* freopen(char const* pathname, char const* mode, FILE*);
+FILE* fmemopen(void* buf, size_t size, char const* mode);
void flockfile(FILE* filehandle);
void funlockfile(FILE* filehandle);
int fclose(FILE*);
@@ -68,36 +68,36 @@ int feof(FILE*);
int fflush(FILE*);
size_t fread(void* ptr, size_t size, size_t nmemb, FILE*);
size_t fread_unlocked(void* ptr, size_t size, size_t nmemb, FILE*);
-size_t fwrite(const void* ptr, size_t size, size_t nmemb, FILE*);
-int vprintf(const char* fmt, va_list) __attribute__((format(printf, 1, 0)));
-int vfprintf(FILE*, const char* fmt, va_list) __attribute__((format(printf, 2, 0)));
-int vasprintf(char** strp, const char* fmt, va_list) __attribute__((format(printf, 2, 0)));
-int vsprintf(char* buffer, const char* fmt, va_list) __attribute__((format(printf, 2, 0)));
-int vsnprintf(char* buffer, size_t, const char* fmt, va_list) __attribute__((format(printf, 3, 0)));
-int fprintf(FILE*, const char* fmt, ...) __attribute__((format(printf, 2, 3)));
-int printf(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
-void dbgputstr(const char*, size_t);
-int sprintf(char* buffer, const char* fmt, ...) __attribute__((format(printf, 2, 3)));
-int asprintf(char** strp, const char* fmt, ...) __attribute__((format(printf, 2, 3)));
-int snprintf(char* buffer, size_t, const char* fmt, ...) __attribute__((format(printf, 3, 4)));
+size_t fwrite(void const* ptr, size_t size, size_t nmemb, FILE*);
+int vprintf(char const* fmt, va_list) __attribute__((format(printf, 1, 0)));
+int vfprintf(FILE*, char const* fmt, va_list) __attribute__((format(printf, 2, 0)));
+int vasprintf(char** strp, char const* fmt, va_list) __attribute__((format(printf, 2, 0)));
+int vsprintf(char* buffer, char const* fmt, va_list) __attribute__((format(printf, 2, 0)));
+int vsnprintf(char* buffer, size_t, char const* fmt, va_list) __attribute__((format(printf, 3, 0)));
+int fprintf(FILE*, char const* fmt, ...) __attribute__((format(printf, 2, 3)));
+int printf(char const* fmt, ...) __attribute__((format(printf, 1, 2)));
+void dbgputstr(char const*, size_t);
+int sprintf(char* buffer, char const* fmt, ...) __attribute__((format(printf, 2, 3)));
+int asprintf(char** strp, char const* fmt, ...) __attribute__((format(printf, 2, 3)));
+int snprintf(char* buffer, size_t, char const* fmt, ...) __attribute__((format(printf, 3, 4)));
int putchar(int ch);
int putc(int ch, FILE*);
-int puts(const char*);
-int fputs(const char*, FILE*);
-void perror(const char*);
-int scanf(const char* fmt, ...) __attribute__((format(scanf, 1, 2)));
-int sscanf(const char* str, const char* fmt, ...) __attribute__((format(scanf, 2, 3)));
-int fscanf(FILE*, const char* fmt, ...) __attribute__((format(scanf, 2, 3)));
-int vscanf(const char*, va_list) __attribute__((format(scanf, 1, 0)));
-int vfscanf(FILE*, const char*, va_list) __attribute__((format(scanf, 2, 0)));
-int vsscanf(const char*, const char*, va_list) __attribute__((format(scanf, 2, 0)));
+int puts(char const*);
+int fputs(char const*, FILE*);
+void perror(char const*);
+int scanf(char const* fmt, ...) __attribute__((format(scanf, 1, 2)));
+int sscanf(char const* str, char const* fmt, ...) __attribute__((format(scanf, 2, 3)));
+int fscanf(FILE*, char const* fmt, ...) __attribute__((format(scanf, 2, 3)));
+int vscanf(char const*, va_list) __attribute__((format(scanf, 1, 0)));
+int vfscanf(FILE*, char const*, va_list) __attribute__((format(scanf, 2, 0)));
+int vsscanf(char const*, char const*, va_list) __attribute__((format(scanf, 2, 0)));
int setvbuf(FILE*, char* buf, int mode, size_t);
void setbuf(FILE*, char* buf);
void setlinebuf(FILE*);
-int rename(const char* oldpath, const char* newpath);
+int rename(char const* oldpath, char const* newpath);
FILE* tmpfile(void);
char* tmpnam(char*);
-FILE* popen(const char* command, const char* type);
+FILE* popen(char const* command, char const* type);
int pclose(FILE*);
__END_DECLS
diff --git a/Userland/Libraries/LibC/stdlib.cpp b/Userland/Libraries/LibC/stdlib.cpp
index d9e7d73ead..695c9c35e8 100644
--- a/Userland/Libraries/LibC/stdlib.cpp
+++ b/Userland/Libraries/LibC/stdlib.cpp
@@ -34,7 +34,7 @@
#include <unistd.h>
#include <wchar.h>
-static void strtons(const char* str, char** endptr)
+static void strtons(char const* str, char** endptr)
{
assert(endptr);
char* ptr = const_cast<char*>(str);
@@ -49,7 +49,7 @@ enum Sign {
Positive,
};
-static Sign strtosign(const char* str, char** endptr)
+static Sign strtosign(char const* str, char** endptr)
{
assert(endptr);
if (*str == '+') {
@@ -128,7 +128,7 @@ public:
private:
bool can_append_digit(int digit)
{
- const bool is_below_cutoff = positive() ? (m_num < m_cutoff) : (m_num > m_cutoff);
+ bool const is_below_cutoff = positive() ? (m_num < m_cutoff) : (m_num > m_cutoff);
if (is_below_cutoff) {
return true;
@@ -232,7 +232,7 @@ void abort()
static HashTable<FlatPtr> s_malloced_environment_variables;
-static void free_environment_variable_if_needed(const char* var)
+static void free_environment_variable_if_needed(char const* var)
{
if (!s_malloced_environment_variables.contains((FlatPtr)var))
return;
@@ -240,11 +240,11 @@ static void free_environment_variable_if_needed(const char* var)
s_malloced_environment_variables.remove((FlatPtr)var);
}
-char* getenv(const char* name)
+char* getenv(char const* name)
{
size_t vl = strlen(name);
for (size_t i = 0; environ[i]; ++i) {
- const char* decl = environ[i];
+ char const* decl = environ[i];
char* eq = strchr(decl, '=');
if (!eq)
continue;
@@ -258,7 +258,7 @@ char* getenv(const char* name)
return nullptr;
}
-char* secure_getenv(const char* name)
+char* secure_getenv(char const* name)
{
if (getauxval(AT_SECURE))
return nullptr;
@@ -266,7 +266,7 @@ char* secure_getenv(const char* name)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/unsetenv.html
-int unsetenv(const char* name)
+int unsetenv(char const* name)
{
auto new_var_len = strlen(name);
size_t environ_size = 0;
@@ -307,12 +307,12 @@ int clearenv()
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/setenv.html
-int setenv(const char* name, const char* value, int overwrite)
+int setenv(char const* name, char const* value, int overwrite)
{
return serenity_setenv(name, strlen(name), value, strlen(value), overwrite);
}
-int serenity_setenv(const char* name, ssize_t name_length, const char* value, ssize_t value_length, int overwrite)
+int serenity_setenv(char const* name, ssize_t name_length, char const* value, ssize_t value_length, int overwrite)
{
if (!overwrite && getenv(name))
return 0;
@@ -374,14 +374,14 @@ int putenv(char* new_var)
return 0;
}
-static const char* __progname = NULL;
+static char const* __progname = NULL;
-const char* getprogname()
+char const* getprogname()
{
return __progname;
}
-void setprogname(const char* progname)
+void setprogname(char const* progname)
{
for (int i = strlen(progname) - 1; i >= 0; i--) {
if (progname[i] == '/') {
@@ -394,7 +394,7 @@ void setprogname(const char* progname)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtod.html
-double strtod(const char* str, char** endptr)
+double strtod(char const* str, char** endptr)
{
// Parse spaces, sign, and base
char* parse_ptr = const_cast<char*>(str);
@@ -451,7 +451,7 @@ double strtod(const char* str, char** endptr)
char exponent_upper;
int base = 10;
if (*parse_ptr == '0') {
- const char base_ch = *(parse_ptr + 1);
+ char const base_ch = *(parse_ptr + 1);
if (base_ch == 'x' || base_ch == 'X') {
base = 16;
parse_ptr += 2;
@@ -676,26 +676,26 @@ double strtod(const char* str, char** endptr)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtold.html
-long double strtold(const char* str, char** endptr)
+long double strtold(char const* str, char** endptr)
{
assert(sizeof(double) == sizeof(long double));
return strtod(str, endptr);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtof.html
-float strtof(const char* str, char** endptr)
+float strtof(char const* str, char** endptr)
{
return strtod(str, endptr);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/atof.html
-double atof(const char* str)
+double atof(char const* str)
{
return strtod(str, nullptr);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/atoi.html
-int atoi(const char* str)
+int atoi(char const* str)
{
long value = strtol(str, nullptr, 10);
if (value > INT_MAX) {
@@ -705,13 +705,13 @@ int atoi(const char* str)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/atol.html
-long atol(const char* str)
+long atol(char const* str)
{
return strtol(str, nullptr, 10);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/atoll.html
-long long atoll(const char* str)
+long long atoll(char const* str)
{
return strtoll(str, nullptr, 10);
}
@@ -808,13 +808,13 @@ void srandom(unsigned seed)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/system.html
-int system(const char* command)
+int system(char const* command)
{
if (!command)
return 1;
pid_t child;
- const char* argv[] = { "sh", "-c", command, nullptr };
+ char const* argv[] = { "sh", "-c", command, nullptr };
if ((errno = posix_spawn(&child, "/bin/sh", nullptr, nullptr, const_cast<char**>(argv), environ)))
return -1;
int wstatus;
@@ -872,7 +872,7 @@ char* mkdtemp(char* pattern)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/bsearch.html
-void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, int (*compar)(const void*, const void*))
+void* bsearch(void const* key, void const* base, size_t nmemb, size_t size, int (*compar)(void const*, void const*))
{
char* start = static_cast<char*>(const_cast<void*>(base));
while (nmemb > 0) {
@@ -956,14 +956,14 @@ int mblen(char const* s, size_t n)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/mbstowcs.html
-size_t mbstowcs(wchar_t* pwcs, const char* s, size_t n)
+size_t mbstowcs(wchar_t* pwcs, char const* s, size_t n)
{
static mbstate_t state = {};
return mbsrtowcs(pwcs, &s, n, &state);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/mbtowc.html
-int mbtowc(wchar_t* pwc, const char* s, size_t n)
+int mbtowc(wchar_t* pwc, char const* s, size_t n)
{
static mbstate_t internal_state = {};
@@ -998,11 +998,11 @@ int wctomb(char* s, wchar_t wc)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/wcstombs.html
-size_t wcstombs(char* dest, const wchar_t* src, size_t max)
+size_t wcstombs(char* dest, wchar_t const* src, size_t max)
{
char* original_dest = dest;
while ((size_t)(dest - original_dest) < max) {
- StringView v { (const char*)src, sizeof(wchar_t) };
+ StringView v { (char const*)src, sizeof(wchar_t) };
// FIXME: dependent on locale, for now utf-8 is supported.
Utf8View utf8 { v };
@@ -1021,7 +1021,7 @@ size_t wcstombs(char* dest, const wchar_t* src, size_t max)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtol.html
-long strtol(const char* str, char** endptr, int base)
+long strtol(char const* str, char** endptr, int base)
{
long long value = strtoll(str, endptr, base);
if (value < LONG_MIN) {
@@ -1035,7 +1035,7 @@ long strtol(const char* str, char** endptr, int base)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtoul.html
-unsigned long strtoul(const char* str, char** endptr, int base)
+unsigned long strtoul(char const* str, char** endptr, int base)
{
unsigned long long value = strtoull(str, endptr, base);
if (value > ULONG_MAX) {
@@ -1046,7 +1046,7 @@ unsigned long strtoul(const char* str, char** endptr, int base)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtoll.html
-long long strtoll(const char* str, char** endptr, int base)
+long long strtoll(char const* str, char** endptr, int base)
{
// Parse spaces and sign
char* parse_ptr = const_cast<char*>(str);
@@ -1124,7 +1124,7 @@ long long strtoll(const char* str, char** endptr, int base)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtoull.html
-unsigned long long strtoull(const char* str, char** endptr, int base)
+unsigned long long strtoull(char const* str, char** endptr, int base)
{
// Parse spaces and sign
char* parse_ptr = const_cast<char*>(str);
@@ -1257,7 +1257,7 @@ uint32_t arc4random_uniform(uint32_t max_bounds)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html
-char* realpath(const char* pathname, char* buffer)
+char* realpath(char const* pathname, char* buffer)
{
if (!pathname) {
errno = EFAULT;
diff --git a/Userland/Libraries/LibC/stdlib.h b/Userland/Libraries/LibC/stdlib.h
index 21865cd398..8a76ae78fe 100644
--- a/Userland/Libraries/LibC/stdlib.h
+++ b/Userland/Libraries/LibC/stdlib.h
@@ -27,27 +27,27 @@ void free(void*);
__attribute__((alloc_size(2))) void* realloc(void* ptr, size_t);
__attribute__((malloc, alloc_size(1), alloc_align(2))) void* _aligned_malloc(size_t size, size_t alignment);
void _aligned_free(void* memblock);
-char* getenv(const char* name);
-char* secure_getenv(const char* name);
+char* getenv(char const* name);
+char* secure_getenv(char const* name);
int putenv(char*);
-int unsetenv(const char*);
+int unsetenv(char const*);
int clearenv(void);
-int setenv(const char* name, const char* value, int overwrite);
-int serenity_setenv(const char* name, ssize_t name_length, const char* value, ssize_t value_length, int overwrite);
-const char* getprogname(void);
-void setprogname(const char*);
-int atoi(const char*);
-long atol(const char*);
-long long atoll(const char*);
-double strtod(const char*, char** endptr);
-long double strtold(const char*, char** endptr);
-float strtof(const char*, char** endptr);
-long strtol(const char*, char** endptr, int base);
-long long strtoll(const char*, char** endptr, int base);
-unsigned long long strtoull(const char*, char** endptr, int base);
-unsigned long strtoul(const char*, char** endptr, int base);
-void qsort(void* base, size_t nmemb, size_t size, int (*compar)(const void*, const void*));
-void qsort_r(void* base, size_t nmemb, size_t size, int (*compar)(const void*, const void*, void*), void* arg);
+int setenv(char const* name, char const* value, int overwrite);
+int serenity_setenv(char const* name, ssize_t name_length, char const* value, ssize_t value_length, int overwrite);
+char const* getprogname(void);
+void setprogname(char const*);
+int atoi(char const*);
+long atol(char const*);
+long long atoll(char const*);
+double strtod(char const*, char** endptr);
+long double strtold(char const*, char** endptr);
+float strtof(char const*, char** endptr);
+long strtol(char const*, char** endptr, int base);
+long long strtoll(char const*, char** endptr, int base);
+unsigned long long strtoull(char const*, char** endptr, int base);
+unsigned long strtoul(char const*, char** endptr, int base);
+void qsort(void* base, size_t nmemb, size_t size, int (*compar)(void const*, void const*));
+void qsort_r(void* base, size_t nmemb, size_t size, int (*compar)(void const*, void const*, void*), void* arg);
int atexit(void (*function)(void));
__attribute__((noreturn)) void exit(int status);
__attribute__((noreturn)) void abort(void);
@@ -56,18 +56,18 @@ int ptsname_r(int fd, char* buffer, size_t);
int abs(int);
long labs(long);
long long int llabs(long long int);
-double atof(const char*);
-int system(const char* command);
+double atof(char const*);
+int system(char const* command);
char* mktemp(char*);
int mkstemp(char*);
char* mkdtemp(char*);
-void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, int (*compar)(const void*, const void*));
+void* bsearch(void const* key, void const* base, size_t nmemb, size_t size, int (*compar)(void const*, void const*));
int mblen(char const*, size_t);
-size_t mbstowcs(wchar_t*, const char*, size_t);
-int mbtowc(wchar_t*, const char*, size_t);
+size_t mbstowcs(wchar_t*, char const*, size_t);
+int mbtowc(wchar_t*, char const*, size_t);
int wctomb(char*, wchar_t);
-size_t wcstombs(char*, const wchar_t*, size_t);
-char* realpath(const char* pathname, char* buffer);
+size_t wcstombs(char*, wchar_t const*, size_t);
+char* realpath(char const* pathname, char* buffer);
__attribute__((noreturn)) void _Exit(int status);
#define RAND_MAX 32767
diff --git a/Userland/Libraries/LibC/string.cpp b/Userland/Libraries/LibC/string.cpp
index 093e77c871..90847bf63c 100644
--- a/Userland/Libraries/LibC/string.cpp
+++ b/Userland/Libraries/LibC/string.cpp
@@ -22,13 +22,13 @@
extern "C" {
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strspn.html
-size_t strspn(const char* s, const char* accept)
+size_t strspn(char const* s, char const* accept)
{
- const char* p = s;
+ char const* p = s;
cont:
char ch = *p++;
char ac;
- for (const char* ap = accept; (ac = *ap++) != '\0';) {
+ for (char const* ap = accept; (ac = *ap++) != '\0';) {
if (ac == ch)
goto cont;
}
@@ -36,7 +36,7 @@ cont:
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strcspn.html
-size_t strcspn(const char* s, const char* reject)
+size_t strcspn(char const* s, char const* reject)
{
for (auto* p = s;;) {
char c = *p++;
@@ -50,7 +50,7 @@ size_t strcspn(const char* s, const char* reject)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strlen.html
-size_t strlen(const char* str)
+size_t strlen(char const* str)
{
size_t len = 0;
while (*(str++))
@@ -59,7 +59,7 @@ size_t strlen(const char* str)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strnlen.html
-size_t strnlen(const char* str, size_t maxlen)
+size_t strnlen(char const* str, size_t maxlen)
{
size_t len = 0;
for (; len < maxlen && *str; str++)
@@ -68,7 +68,7 @@ size_t strnlen(const char* str, size_t maxlen)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strdup.html
-char* strdup(const char* str)
+char* strdup(char const* str)
{
size_t len = strlen(str);
char* new_str = (char*)malloc(len + 1);
@@ -78,7 +78,7 @@ char* strdup(const char* str)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strndup.html
-char* strndup(const char* str, size_t maxlen)
+char* strndup(char const* str, size_t maxlen)
{
size_t len = strnlen(str, maxlen);
char* new_str = (char*)malloc(len + 1);
@@ -88,22 +88,22 @@ char* strndup(const char* str, size_t maxlen)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strcmp.html
-int strcmp(const char* s1, const char* s2)
+int strcmp(char const* s1, char const* s2)
{
while (*s1 == *s2++)
if (*s1++ == 0)
return 0;
- return *(const unsigned char*)s1 - *(const unsigned char*)--s2;
+ return *(unsigned char const*)s1 - *(unsigned char const*)--s2;
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strncmp.html
-int strncmp(const char* s1, const char* s2, size_t n)
+int strncmp(char const* s1, char const* s2, size_t n)
{
if (!n)
return 0;
do {
if (*s1 != *s2++)
- return *(const unsigned char*)s1 - *(const unsigned char*)--s2;
+ return *(unsigned char const*)s1 - *(unsigned char const*)--s2;
if (*s1++ == 0)
break;
} while (--n);
@@ -111,10 +111,10 @@ int strncmp(const char* s1, const char* s2, size_t n)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/memcmp.html
-int memcmp(const void* v1, const void* v2, size_t n)
+int memcmp(void const* v1, void const* v2, size_t n)
{
- auto* s1 = (const uint8_t*)v1;
- auto* s2 = (const uint8_t*)v2;
+ auto* s1 = (uint8_t const*)v1;
+ auto* s2 = (uint8_t const*)v2;
while (n-- > 0) {
if (*s1++ != *s2++)
return s1[-1] < s2[-1] ? -1 : 1;
@@ -122,13 +122,13 @@ int memcmp(const void* v1, const void* v2, size_t n)
return 0;
}
-int timingsafe_memcmp(const void* b1, const void* b2, size_t len)
+int timingsafe_memcmp(void const* b1, void const* b2, size_t len)
{
return AK::timing_safe_compare(b1, b2, len) ? 1 : 0;
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/memcpy.html
-void* memcpy(void* dest_ptr, const void* src_ptr, size_t n)
+void* memcpy(void* dest_ptr, void const* src_ptr, size_t n)
{
void* original_dest = dest_ptr;
asm volatile(
@@ -171,25 +171,25 @@ void* memset(void* dest_ptr, int c, size_t n)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/memmove.html
-void* memmove(void* dest, const void* src, size_t n)
+void* memmove(void* dest, void const* src, size_t n)
{
if (((FlatPtr)dest - (FlatPtr)src) >= n)
return memcpy(dest, src, n);
u8* pd = (u8*)dest;
- const u8* ps = (const u8*)src;
+ u8 const* ps = (u8 const*)src;
for (pd += n, ps += n; n--;)
*--pd = *--ps;
return dest;
}
-const void* memmem(const void* haystack, size_t haystack_length, const void* needle, size_t needle_length)
+void const* memmem(void const* haystack, size_t haystack_length, void const* needle, size_t needle_length)
{
return AK::memmem(haystack, haystack_length, needle, needle_length);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strcpy.html
-char* strcpy(char* dest, const char* src)
+char* strcpy(char* dest, char const* src)
{
char* original_dest = dest;
while ((*dest++ = *src++) != '\0')
@@ -198,7 +198,7 @@ char* strcpy(char* dest, const char* src)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strncpy.html
-char* strncpy(char* dest, const char* src, size_t n)
+char* strncpy(char* dest, char const* src, size_t n)
{
size_t i;
for (i = 0; i < n && src[i] != '\0'; ++i)
@@ -208,7 +208,7 @@ char* strncpy(char* dest, const char* src, size_t n)
return dest;
}
-size_t strlcpy(char* dest, const char* src, size_t n)
+size_t strlcpy(char* dest, char const* src, size_t n)
{
size_t i;
// Would like to test i < n - 1 here, but n might be 0.
@@ -222,7 +222,7 @@ size_t strlcpy(char* dest, const char* src, size_t n)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strchr.html
-char* strchr(const char* str, int c)
+char* strchr(char const* str, int c)
{
char ch = c;
for (;; ++str) {
@@ -234,12 +234,12 @@ char* strchr(const char* str, int c)
}
// https://pubs.opengroup.org/onlinepubs/9699959399/functions/index.html
-char* index(const char* str, int c)
+char* index(char const* str, int c)
{
return strchr(str, c);
}
-char* strchrnul(const char* str, int c)
+char* strchrnul(char const* str, int c)
{
char ch = c;
for (;; ++str) {
@@ -249,10 +249,10 @@ char* strchrnul(const char* str, int c)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/memchr.html
-void* memchr(const void* ptr, int c, size_t size)
+void* memchr(void const* ptr, int c, size_t size)
{
char ch = c;
- auto* cptr = (const char*)ptr;
+ auto* cptr = (char const*)ptr;
for (size_t i = 0; i < size; ++i) {
if (cptr[i] == ch)
return const_cast<char*>(cptr + i);
@@ -261,7 +261,7 @@ void* memchr(const void* ptr, int c, size_t size)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strrchr.html
-char* strrchr(const char* str, int ch)
+char* strrchr(char const* str, int ch)
{
char* last = nullptr;
char c;
@@ -273,13 +273,13 @@ char* strrchr(const char* str, int ch)
}
// https://pubs.opengroup.org/onlinepubs/9699959399/functions/rindex.html
-char* rindex(const char* str, int ch)
+char* rindex(char const* str, int ch)
{
return strrchr(str, ch);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strcat.html
-char* strcat(char* dest, const char* src)
+char* strcat(char* dest, char const* src)
{
size_t dest_length = strlen(dest);
size_t i;
@@ -290,7 +290,7 @@ char* strcat(char* dest, const char* src)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strncat.html
-char* strncat(char* dest, const char* src, size_t n)
+char* strncat(char* dest, char const* src, size_t n)
{
size_t dest_length = strlen(dest);
size_t i;
@@ -300,7 +300,7 @@ char* strncat(char* dest, const char* src, size_t n)
return dest;
}
-const char* const sys_errlist[] = {
+char const* const sys_errlist[] = {
#define __ENUMERATE_ERRNO_CODE(c, s) s,
ENUMERATE_ERRNO_CODES(__ENUMERATE_ERRNO_CODE)
#undef __ENUMERATE_ERRNO_CODE
@@ -350,7 +350,7 @@ char* strsignal(int signum)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strstr.html
-char* strstr(const char* haystack, const char* needle)
+char* strstr(char const* haystack, char const* needle)
{
char nch;
char hch;
@@ -369,7 +369,7 @@ char* strstr(const char* haystack, const char* needle)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strpbrk.html
-char* strpbrk(const char* s, const char* accept)
+char* strpbrk(char const* s, char const* accept)
{
while (*s)
if (strchr(accept, *s++))
@@ -378,7 +378,7 @@ char* strpbrk(const char* s, const char* accept)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtok_r.html
-char* strtok_r(char* str, const char* delim, char** saved_str)
+char* strtok_r(char* str, char const* delim, char** saved_str)
{
if (!str) {
if (!saved_str || *saved_str == nullptr)
@@ -433,20 +433,20 @@ char* strtok_r(char* str, const char* delim, char** saved_str)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtok.html
-char* strtok(char* str, const char* delim)
+char* strtok(char* str, char const* delim)
{
static char* saved_str;
return strtok_r(str, delim, &saved_str);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strcoll.html
-int strcoll(const char* s1, const char* s2)
+int strcoll(char const* s1, char const* s2)
{
return strcmp(s1, s2);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strxfrm.html
-size_t strxfrm(char* dest, const char* src, size_t n)
+size_t strxfrm(char* dest, char const* src, size_t n)
{
size_t i;
for (i = 0; i < n && src[i] != '\0'; ++i)
diff --git a/Userland/Libraries/LibC/string.h b/Userland/Libraries/LibC/string.h
index c58ee96836..c3681c89ca 100644
--- a/Userland/Libraries/LibC/string.h
+++ b/Userland/Libraries/LibC/string.h
@@ -17,50 +17,50 @@ __BEGIN_DECLS
// do the same here to maintain compatibility
#include <strings.h>
-size_t strlen(const char*);
-size_t strnlen(const char*, size_t maxlen);
+size_t strlen(char const*);
+size_t strnlen(char const*, size_t maxlen);
-int strcmp(const char*, const char*);
-int strncmp(const char*, const char*, size_t);
+int strcmp(char const*, char const*);
+int strncmp(char const*, char const*, size_t);
-int memcmp(const void*, const void*, size_t);
-int timingsafe_memcmp(const void*, const void*, size_t);
-void* memcpy(void*, const void*, size_t);
-void* memmove(void*, const void*, size_t);
-void* memchr(const void*, int c, size_t);
-const void* memmem(const void* haystack, size_t, const void* needle, size_t);
+int memcmp(void const*, void const*, size_t);
+int timingsafe_memcmp(void const*, void const*, size_t);
+void* memcpy(void*, void const*, size_t);
+void* memmove(void*, void const*, size_t);
+void* memchr(void const*, int c, size_t);
+void const* memmem(void const* haystack, size_t, void const* needle, size_t);
void* memset(void*, int, size_t);
void explicit_bzero(void*, size_t) __attribute__((nonnull(1)));
-__attribute__((malloc)) char* strdup(const char*);
-__attribute__((malloc)) char* strndup(const char*, size_t);
+__attribute__((malloc)) char* strdup(char const*);
+__attribute__((malloc)) char* strndup(char const*, size_t);
-char* strcpy(char* dest, const char* src);
-char* strncpy(char* dest, const char* src, size_t);
-__attribute__((warn_unused_result)) size_t strlcpy(char* dest, const char* src, size_t);
+char* strcpy(char* dest, char const* src);
+char* strncpy(char* dest, char const* src, size_t);
+__attribute__((warn_unused_result)) size_t strlcpy(char* dest, char const* src, size_t);
-char* strchr(const char*, int c);
-char* strchrnul(const char*, int c);
-char* strstr(const char* haystack, const char* needle);
-char* strrchr(const char*, int c);
+char* strchr(char const*, int c);
+char* strchrnul(char const*, int c);
+char* strstr(char const* haystack, char const* needle);
+char* strrchr(char const*, int c);
-char* index(const char* str, int ch);
-char* rindex(const char* str, int ch);
+char* index(char const* str, int ch);
+char* rindex(char const* str, int ch);
-char* strcat(char* dest, const char* src);
-char* strncat(char* dest, const char* src, size_t);
+char* strcat(char* dest, char const* src);
+char* strncat(char* dest, char const* src, size_t);
-size_t strspn(const char*, const char* accept);
-size_t strcspn(const char*, const char* reject);
+size_t strspn(char const*, char const* accept);
+size_t strcspn(char const*, char const* reject);
int strerror_r(int, char*, size_t);
char* strerror(int errnum);
char* strsignal(int signum);
-char* strpbrk(const char*, const char* accept);
-char* strtok_r(char* str, const char* delim, char** saved_str);
-char* strtok(char* str, const char* delim);
-int strcoll(const char* s1, const char* s2);
-size_t strxfrm(char* dest, const char* src, size_t n);
+char* strpbrk(char const*, char const* accept);
+char* strtok_r(char* str, char const* delim, char** saved_str);
+char* strtok(char* str, char const* delim);
+int strcoll(char const* s1, char const* s2);
+size_t strxfrm(char* dest, char const* src, size_t n);
char* strsep(char** str, char const* delim);
__END_DECLS
diff --git a/Userland/Libraries/LibC/strings.cpp b/Userland/Libraries/LibC/strings.cpp
index 4f0d49c92a..0937cc2e1a 100644
--- a/Userland/Libraries/LibC/strings.cpp
+++ b/Userland/Libraries/LibC/strings.cpp
@@ -16,7 +16,7 @@ void bzero(void* dest, size_t n)
memset(dest, 0, n);
}
-void bcopy(const void* src, void* dest, size_t n)
+void bcopy(void const* src, void* dest, size_t n)
{
memmove(dest, src, n);
}
@@ -29,23 +29,23 @@ static char foldcase(char ch)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strcasecmp.html
-int strcasecmp(const char* s1, const char* s2)
+int strcasecmp(char const* s1, char const* s2)
{
for (; foldcase(*s1) == foldcase(*s2); ++s1, ++s2) {
if (*s1 == 0)
return 0;
}
- return foldcase(*(const unsigned char*)s1) < foldcase(*(const unsigned char*)s2) ? -1 : 1;
+ return foldcase(*(unsigned char const*)s1) < foldcase(*(unsigned char const*)s2) ? -1 : 1;
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strncasecmp.html
-int strncasecmp(const char* s1, const char* s2, size_t n)
+int strncasecmp(char const* s1, char const* s2, size_t n)
{
if (!n)
return 0;
do {
if (foldcase(*s1) != foldcase(*s2++))
- return foldcase(*(const unsigned char*)s1) - foldcase(*(const unsigned char*)--s2);
+ return foldcase(*(unsigned char const*)s1) - foldcase(*(unsigned char const*)--s2);
if (*s1++ == 0)
break;
} while (--n);
diff --git a/Userland/Libraries/LibC/strings.h b/Userland/Libraries/LibC/strings.h
index 36e2e3621b..1805bc887c 100644
--- a/Userland/Libraries/LibC/strings.h
+++ b/Userland/Libraries/LibC/strings.h
@@ -11,9 +11,9 @@
__BEGIN_DECLS
-int strcasecmp(const char*, const char*);
-int strncasecmp(const char*, const char*, size_t);
+int strcasecmp(char const*, char const*);
+int strncasecmp(char const*, char const*, size_t);
void bzero(void*, size_t);
-void bcopy(const void*, void*, size_t);
+void bcopy(void const*, void*, size_t);
__END_DECLS
diff --git a/Userland/Libraries/LibC/sys/mman.cpp b/Userland/Libraries/LibC/sys/mman.cpp
index ff40f87e17..9dd9d4ef3a 100644
--- a/Userland/Libraries/LibC/sys/mman.cpp
+++ b/Userland/Libraries/LibC/sys/mman.cpp
@@ -13,7 +13,7 @@
extern "C" {
-void* serenity_mmap(void* addr, size_t size, int prot, int flags, int fd, off_t offset, size_t alignment, const char* name)
+void* serenity_mmap(void* addr, size_t size, int prot, int flags, int fd, off_t offset, size_t alignment, char const* name)
{
Syscall::SC_mmap_params params { addr, size, alignment, prot, flags, fd, offset, { name, name ? strlen(name) : 0 } };
ptrdiff_t rc = syscall(SC_mmap, &params);
@@ -30,7 +30,7 @@ void* mmap(void* addr, size_t size, int prot, int flags, int fd, off_t offset)
return serenity_mmap(addr, size, prot, flags, fd, offset, PAGE_SIZE, nullptr);
}
-void* mmap_with_name(void* addr, size_t size, int prot, int flags, int fd, off_t offset, const char* name)
+void* mmap_with_name(void* addr, size_t size, int prot, int flags, int fd, off_t offset, char const* name)
{
return serenity_mmap(addr, size, prot, flags, fd, offset, PAGE_SIZE, name);
}
@@ -60,7 +60,7 @@ int mprotect(void* addr, size_t size, int prot)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int set_mmap_name(void* addr, size_t size, const char* name)
+int set_mmap_name(void* addr, size_t size, char const* name)
{
if (!name) {
errno = EFAULT;
@@ -83,7 +83,7 @@ int posix_madvise(void* address, size_t len, int advice)
return madvise(address, len, advice);
}
-void* allocate_tls(const char* initial_data, size_t size)
+void* allocate_tls(char const* initial_data, size_t size)
{
ptrdiff_t rc = syscall(SC_allocate_tls, initial_data, size);
if (rc < 0 && rc > -EMAXERRNO) {
@@ -94,14 +94,14 @@ void* allocate_tls(const char* initial_data, size_t size)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/mlock.html
-int mlock(const void*, size_t)
+int mlock(void const*, size_t)
{
dbgln("FIXME: Implement mlock()");
return 0;
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/munlock.html
-int munlock(const void*, size_t)
+int munlock(void const*, size_t)
{
dbgln("FIXME: Implement munlock()");
return 0;
diff --git a/Userland/Libraries/LibC/sys/mman.h b/Userland/Libraries/LibC/sys/mman.h
index d5cd1d80ec..d5d5ed2b44 100644
--- a/Userland/Libraries/LibC/sys/mman.h
+++ b/Userland/Libraries/LibC/sys/mman.h
@@ -11,17 +11,17 @@
__BEGIN_DECLS
void* mmap(void* addr, size_t, int prot, int flags, int fd, off_t);
-void* mmap_with_name(void* addr, size_t, int prot, int flags, int fd, off_t, const char* name);
-void* serenity_mmap(void* addr, size_t, int prot, int flags, int fd, off_t, size_t alignment, const char* name);
+void* mmap_with_name(void* addr, size_t, int prot, int flags, int fd, off_t, char const* name);
+void* serenity_mmap(void* addr, size_t, int prot, int flags, int fd, off_t, size_t alignment, char const* name);
void* mremap(void* old_address, size_t old_size, size_t new_size, int flags);
int munmap(void*, size_t);
int mprotect(void*, size_t, int prot);
-int set_mmap_name(void*, size_t, const char*);
+int set_mmap_name(void*, size_t, char const*);
int madvise(void*, size_t, int advice);
int posix_madvise(void*, size_t, int advice);
-void* allocate_tls(const char* initial_data, size_t);
-int mlock(const void*, size_t);
-int munlock(const void*, size_t);
+void* allocate_tls(char const* initial_data, size_t);
+int mlock(void const*, size_t);
+int munlock(void const*, size_t);
int msync(void*, size_t, int flags);
__END_DECLS
diff --git a/Userland/Libraries/LibC/sys/select.cpp b/Userland/Libraries/LibC/sys/select.cpp
index 30f005c9c7..b3441a4910 100644
--- a/Userland/Libraries/LibC/sys/select.cpp
+++ b/Userland/Libraries/LibC/sys/select.cpp
@@ -28,7 +28,7 @@ int select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, timev
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/pselect.html
-int pselect(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, const timespec* timeout, const sigset_t* sigmask)
+int pselect(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, timespec const* timeout, sigset_t const* sigmask)
{
Vector<pollfd, FD_SETSIZE> fds;
diff --git a/Userland/Libraries/LibC/sys/select.h b/Userland/Libraries/LibC/sys/select.h
index 57a61cc145..02e9f0d6f6 100644
--- a/Userland/Libraries/LibC/sys/select.h
+++ b/Userland/Libraries/LibC/sys/select.h
@@ -16,6 +16,6 @@
__BEGIN_DECLS
int select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, struct timeval* timeout);
-int pselect(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, const struct timespec* timeout, const sigset_t* sigmask);
+int pselect(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, const struct timespec* timeout, sigset_t const* sigmask);
__END_DECLS
diff --git a/Userland/Libraries/LibC/sys/socket.cpp b/Userland/Libraries/LibC/sys/socket.cpp
index 3e78ff1486..6cfedc0c0e 100644
--- a/Userland/Libraries/LibC/sys/socket.cpp
+++ b/Userland/Libraries/LibC/sys/socket.cpp
@@ -22,7 +22,7 @@ int socket(int domain, int type, int protocol)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html
-int bind(int sockfd, const sockaddr* addr, socklen_t addrlen)
+int bind(int sockfd, sockaddr const* addr, socklen_t addrlen)
{
int rc = syscall(SC_bind, sockfd, addr, addrlen);
__RETURN_WITH_ERRNO(rc, rc, -1);
@@ -49,7 +49,7 @@ int accept4(int sockfd, sockaddr* addr, socklen_t* addrlen, int flags)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html
-int connect(int sockfd, const sockaddr* addr, socklen_t addrlen)
+int connect(int sockfd, sockaddr const* addr, socklen_t addrlen)
{
int rc = syscall(SC_connect, sockfd, addr, addrlen);
__RETURN_WITH_ERRNO(rc, rc, -1);
@@ -70,7 +70,7 @@ ssize_t sendmsg(int sockfd, const struct msghdr* msg, int flags)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html
-ssize_t sendto(int sockfd, const void* data, size_t data_length, int flags, const struct sockaddr* addr, socklen_t addr_length)
+ssize_t sendto(int sockfd, void const* data, size_t data_length, int flags, const struct sockaddr* addr, socklen_t addr_length)
{
iovec iov = { const_cast<void*>(data), data_length };
msghdr msg = { const_cast<struct sockaddr*>(addr), addr_length, &iov, 1, nullptr, 0, 0 };
@@ -78,7 +78,7 @@ ssize_t sendto(int sockfd, const void* data, size_t data_length, int flags, cons
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/send.html
-ssize_t send(int sockfd, const void* data, size_t data_length, int flags)
+ssize_t send(int sockfd, void const* data, size_t data_length, int flags)
{
return sendto(sockfd, data, data_length, flags, nullptr, 0);
}
@@ -124,7 +124,7 @@ int getsockopt(int sockfd, int level, int option, void* value, socklen_t* value_
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/setsockopt.html
-int setsockopt(int sockfd, int level, int option, const void* value, socklen_t value_size)
+int setsockopt(int sockfd, int level, int option, void const* value, socklen_t value_size)
{
Syscall::SC_setsockopt_params params { value, sockfd, level, option, value_size };
int rc = syscall(SC_setsockopt, &params);
diff --git a/Userland/Libraries/LibC/sys/socket.h b/Userland/Libraries/LibC/sys/socket.h
index 87b4ecea8d..f37be8e7ae 100644
--- a/Userland/Libraries/LibC/sys/socket.h
+++ b/Userland/Libraries/LibC/sys/socket.h
@@ -18,14 +18,14 @@ int accept(int sockfd, struct sockaddr*, socklen_t*);
int accept4(int sockfd, struct sockaddr*, socklen_t*, int);
int connect(int sockfd, const struct sockaddr*, socklen_t);
int shutdown(int sockfd, int how);
-ssize_t send(int sockfd, const void*, size_t, int flags);
+ssize_t send(int sockfd, void const*, size_t, int flags);
ssize_t sendmsg(int sockfd, const struct msghdr*, int flags);
-ssize_t sendto(int sockfd, const void*, size_t, int flags, const struct sockaddr*, socklen_t);
+ssize_t sendto(int sockfd, void const*, size_t, int flags, const struct sockaddr*, socklen_t);
ssize_t recv(int sockfd, void*, size_t, int flags);
ssize_t recvmsg(int sockfd, struct msghdr*, int flags);
ssize_t recvfrom(int sockfd, void*, size_t, int flags, struct sockaddr*, socklen_t*);
int getsockopt(int sockfd, int level, int option, void*, socklen_t*);
-int setsockopt(int sockfd, int level, int option, const void*, socklen_t);
+int setsockopt(int sockfd, int level, int option, void const*, socklen_t);
int getsockname(int sockfd, struct sockaddr*, socklen_t*);
int getpeername(int sockfd, struct sockaddr*, socklen_t*);
int socketpair(int domain, int type, int protocol, int sv[2]);
diff --git a/Userland/Libraries/LibC/sys/stat.h b/Userland/Libraries/LibC/sys/stat.h
index 9aeb90611f..4ada805708 100644
--- a/Userland/Libraries/LibC/sys/stat.h
+++ b/Userland/Libraries/LibC/sys/stat.h
@@ -14,14 +14,14 @@
__BEGIN_DECLS
mode_t umask(mode_t);
-int chmod(const char* pathname, mode_t);
+int chmod(char const* pathname, mode_t);
int fchmodat(int fd, char const* path, mode_t mode, int flag);
int fchmod(int fd, mode_t);
-int mkdir(const char* pathname, mode_t);
-int mkfifo(const char* pathname, mode_t);
+int mkdir(char const* pathname, mode_t);
+int mkfifo(char const* pathname, mode_t);
int fstat(int fd, struct stat* statbuf);
-int lstat(const char* path, struct stat* statbuf);
-int stat(const char* path, struct stat* statbuf);
-int fstatat(int fd, const char* path, struct stat* statbuf, int flags);
+int lstat(char const* path, struct stat* statbuf);
+int stat(char const* path, struct stat* statbuf);
+int fstatat(int fd, char const* path, struct stat* statbuf, int flags);
__END_DECLS
diff --git a/Userland/Libraries/LibC/sys/statvfs.cpp b/Userland/Libraries/LibC/sys/statvfs.cpp
index d49e38623b..d7b238520b 100644
--- a/Userland/Libraries/LibC/sys/statvfs.cpp
+++ b/Userland/Libraries/LibC/sys/statvfs.cpp
@@ -11,7 +11,7 @@
extern "C" {
-int statvfs(const char* path, struct statvfs* buf)
+int statvfs(char const* path, struct statvfs* buf)
{
Syscall::SC_statvfs_params params { { path, strlen(path) }, buf };
int rc = syscall(SC_statvfs, &params);
diff --git a/Userland/Libraries/LibC/sys/time.h b/Userland/Libraries/LibC/sys/time.h
index 452774f71c..8dc88f672a 100644
--- a/Userland/Libraries/LibC/sys/time.h
+++ b/Userland/Libraries/LibC/sys/time.h
@@ -19,7 +19,7 @@ struct timezone {
int adjtime(const struct timeval* delta, struct timeval* old_delta);
int gettimeofday(struct timeval* __restrict__, void* __restrict__);
int settimeofday(struct timeval* __restrict__, void* __restrict__);
-int utimes(const char* pathname, const struct timeval[2]);
+int utimes(char const* pathname, const struct timeval[2]);
static inline void timeradd(const struct timeval* a, const struct timeval* b, struct timeval* out)
{
diff --git a/Userland/Libraries/LibC/sys/xattr.cpp b/Userland/Libraries/LibC/sys/xattr.cpp
index 61c6f1afaf..cc30458c90 100644
--- a/Userland/Libraries/LibC/sys/xattr.cpp
+++ b/Userland/Libraries/LibC/sys/xattr.cpp
@@ -7,49 +7,49 @@
#include <AK/Format.h>
#include <sys/xattr.h>
-ssize_t getxattr(const char*, const char*, void*, size_t)
+ssize_t getxattr(char const*, char const*, void*, size_t)
{
dbgln("FIXME: Implement getxattr()");
return 0;
}
-ssize_t lgetxattr(const char*, const char*, void*, size_t)
+ssize_t lgetxattr(char const*, char const*, void*, size_t)
{
dbgln("FIXME: Implement lgetxattr()");
return 0;
}
-ssize_t fgetxattr(int, const char*, void*, size_t)
+ssize_t fgetxattr(int, char const*, void*, size_t)
{
dbgln("FIXME: Implement fgetxattr()");
return 0;
}
-int setxattr(const char*, const char*, const void*, size_t, int)
+int setxattr(char const*, char const*, void const*, size_t, int)
{
dbgln("FIXME: Implement setxattr()");
return 0;
}
-int lsetxattr(const char*, const char*, const void*, size_t, int)
+int lsetxattr(char const*, char const*, void const*, size_t, int)
{
dbgln("FIXME: Implement lsetxattr()");
return 0;
}
-int fsetxattr(int, const char*, const void*, size_t, int)
+int fsetxattr(int, char const*, void const*, size_t, int)
{
dbgln("FIXME: Implement fsetxattr()");
return 0;
}
-ssize_t listxattr(const char*, char*, size_t)
+ssize_t listxattr(char const*, char*, size_t)
{
dbgln("FIXME: Implement listxattr()");
return 0;
}
-ssize_t llistxattr(const char*, char*, size_t)
+ssize_t llistxattr(char const*, char*, size_t)
{
dbgln("FIXME: Implement llistxattr()");
return 0;
diff --git a/Userland/Libraries/LibC/sys/xattr.h b/Userland/Libraries/LibC/sys/xattr.h
index 69c0735cab..0da4ead659 100644
--- a/Userland/Libraries/LibC/sys/xattr.h
+++ b/Userland/Libraries/LibC/sys/xattr.h
@@ -10,16 +10,16 @@
__BEGIN_DECLS
-ssize_t getxattr(const char* path, const char* name, void* value, size_t size);
-ssize_t lgetxattr(const char* path, const char* name, void* value, size_t size);
-ssize_t fgetxattr(int fd, const char* name, void* value, size_t size);
+ssize_t getxattr(char const* path, char const* name, void* value, size_t size);
+ssize_t lgetxattr(char const* path, char const* name, void* value, size_t size);
+ssize_t fgetxattr(int fd, char const* name, void* value, size_t size);
-int setxattr(const char* path, const char* name, const void* value, size_t size, int flags);
-int lsetxattr(const char* path, const char* name, const void* value, size_t size, int flags);
-int fsetxattr(int fd, const char* name, const void* value, size_t size, int flags);
+int setxattr(char const* path, char const* name, void const* value, size_t size, int flags);
+int lsetxattr(char const* path, char const* name, void const* value, size_t size, int flags);
+int fsetxattr(int fd, char const* name, void const* value, size_t size, int flags);
-ssize_t listxattr(const char* path, char* list, size_t size);
-ssize_t llistxattr(const char* path, char* list, size_t size);
+ssize_t listxattr(char const* path, char* list, size_t size);
+ssize_t llistxattr(char const* path, char* list, size_t size);
ssize_t flistxattr(int fd, char* list, size_t size);
__END_DECLS
diff --git a/Userland/Libraries/LibC/syslog.cpp b/Userland/Libraries/LibC/syslog.cpp
index 7e17a51498..9c563a22f7 100644
--- a/Userland/Libraries/LibC/syslog.cpp
+++ b/Userland/Libraries/LibC/syslog.cpp
@@ -36,7 +36,7 @@ static bool program_name_set = false;
// Convenience function for initialization and checking what string to use
// for the program name.
-static const char* get_syslog_ident(struct syslog_data* data)
+static char const* get_syslog_ident(struct syslog_data* data)
{
if (!program_name_set && data->ident == nullptr)
program_name_set = get_process_name(program_name_buffer, sizeof(program_name_buffer)) >= 0;
@@ -49,7 +49,7 @@ static const char* get_syslog_ident(struct syslog_data* data)
VERIFY_NOT_REACHED();
}
-void openlog_r(const char* ident, int logopt, int facility, struct syslog_data* data)
+void openlog_r(char const* ident, int logopt, int facility, struct syslog_data* data)
{
data->ident = ident;
data->logopt = logopt;
@@ -59,7 +59,7 @@ void openlog_r(const char* ident, int logopt, int facility, struct syslog_data*
// would be where we connect to a daemon
}
-void openlog(const char* ident, int logopt, int facility)
+void openlog(char const* ident, int logopt, int facility)
{
openlog_r(ident, logopt, facility, &global_log_data);
}
@@ -92,7 +92,7 @@ int setlogmask(int maskpri)
return setlogmask_r(maskpri, &global_log_data);
}
-void syslog_r(int priority, struct syslog_data* data, const char* message, ...)
+void syslog_r(int priority, struct syslog_data* data, char const* message, ...)
{
va_list ap;
va_start(ap, message);
@@ -100,7 +100,7 @@ void syslog_r(int priority, struct syslog_data* data, const char* message, ...)
va_end(ap);
}
-void syslog(int priority, const char* message, ...)
+void syslog(int priority, char const* message, ...)
{
va_list ap;
va_start(ap, message);
@@ -108,7 +108,7 @@ void syslog(int priority, const char* message, ...)
va_end(ap);
}
-void vsyslog_r(int priority, struct syslog_data* data, const char* message, va_list args)
+void vsyslog_r(int priority, struct syslog_data* data, char const* message, va_list args)
{
StringBuilder combined;
@@ -132,7 +132,7 @@ void vsyslog_r(int priority, struct syslog_data* data, const char* message, va_l
fputs(combined_string.characters(), stderr);
}
-void vsyslog(int priority, const char* message, va_list args)
+void vsyslog(int priority, char const* message, va_list args)
{
vsyslog_r(priority, &global_log_data, message, args);
}
diff --git a/Userland/Libraries/LibC/syslog.h b/Userland/Libraries/LibC/syslog.h
index f2186f42f7..92d97aae40 100644
--- a/Userland/Libraries/LibC/syslog.h
+++ b/Userland/Libraries/LibC/syslog.h
@@ -12,7 +12,7 @@
__BEGIN_DECLS
struct syslog_data {
- const char* ident;
+ char const* ident;
int logopt;
int facility;
int maskpri;
@@ -95,7 +95,7 @@ typedef struct _code {
* Most Unices define this as char*, but in C++, we have to define it as a
* const char* if we want to use string constants.
*/
- const char* c_name;
+ char const* c_name;
int c_val;
} CODE;
@@ -146,12 +146,12 @@ CODE facilitynames[] = {
#endif
/* The re-entrant versions are an OpenBSD extension we also implement. */
-void syslog(int, const char*, ...);
-void syslog_r(int, struct syslog_data*, const char*, ...);
-void vsyslog(int, const char* message, va_list);
-void vsyslog_r(int, struct syslog_data* data, const char* message, va_list);
-void openlog(const char*, int, int);
-void openlog_r(const char*, int, int, struct syslog_data*);
+void syslog(int, char const*, ...);
+void syslog_r(int, struct syslog_data*, char const*, ...);
+void vsyslog(int, char const* message, va_list);
+void vsyslog_r(int, struct syslog_data* data, char const* message, va_list);
+void openlog(char const*, int, int);
+void openlog_r(char const*, int, int, struct syslog_data*);
void closelog(void);
void closelog_r(struct syslog_data*);
int setlogmask(int);
diff --git a/Userland/Libraries/LibC/termcap.cpp b/Userland/Libraries/LibC/termcap.cpp
index 24a99c6f69..a62a225be4 100644
--- a/Userland/Libraries/LibC/termcap.cpp
+++ b/Userland/Libraries/LibC/termcap.cpp
@@ -18,7 +18,7 @@ char PC;
char* UP;
char* BC;
-int __attribute__((weak)) tgetent([[maybe_unused]] char* bp, [[maybe_unused]] const char* name)
+int __attribute__((weak)) tgetent([[maybe_unused]] char* bp, [[maybe_unused]] char const* name)
{
warnln_if(TERMCAP_DEBUG, "tgetent: bp={:p}, name='{}'", bp, name);
PC = '\0';
@@ -27,13 +27,13 @@ int __attribute__((weak)) tgetent([[maybe_unused]] char* bp, [[maybe_unused]] co
return 1;
}
-static HashMap<String, const char*>* caps = nullptr;
+static HashMap<String, char const*>* caps = nullptr;
static void ensure_caps()
{
if (caps)
return;
- caps = new HashMap<String, const char*>;
+ caps = new HashMap<String, char const*>;
caps->set("DC", "\033[%p1%dP");
caps->set("IC", "\033[%p1%d@");
caps->set("ce", "\033[K");
@@ -75,14 +75,14 @@ static void ensure_caps()
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-char* __attribute__((weak)) tgetstr(const char* id, char** area)
+char* __attribute__((weak)) tgetstr(char const* id, char** area)
{
ensure_caps();
warnln_if(TERMCAP_DEBUG, "tgetstr: id='{}'", id);
auto it = caps->find(id);
if (it != caps->end()) {
char* ret = *area;
- const char* val = (*it).value;
+ char const* val = (*it).value;
strcpy(*area, val);
*area += strlen(val) + 1;
return ret;
@@ -93,7 +93,7 @@ char* __attribute__((weak)) tgetstr(const char* id, char** area)
#pragma GCC diagnostic pop
-int __attribute__((weak)) tgetflag([[maybe_unused]] const char* id)
+int __attribute__((weak)) tgetflag([[maybe_unused]] char const* id)
{
warnln_if(TERMCAP_DEBUG, "tgetflag: '{}'", id);
auto it = caps->find(id);
@@ -102,7 +102,7 @@ int __attribute__((weak)) tgetflag([[maybe_unused]] const char* id)
return 0;
}
-int __attribute__((weak)) tgetnum(const char* id)
+int __attribute__((weak)) tgetnum(char const* id)
{
warnln_if(TERMCAP_DEBUG, "tgetnum: '{}'", id);
auto it = caps->find(id);
@@ -112,7 +112,7 @@ int __attribute__((weak)) tgetnum(const char* id)
}
static Vector<char> s_tgoto_buffer;
-char* __attribute__((weak)) tgoto([[maybe_unused]] const char* cap, [[maybe_unused]] int col, [[maybe_unused]] int row)
+char* __attribute__((weak)) tgoto([[maybe_unused]] char const* cap, [[maybe_unused]] int col, [[maybe_unused]] int row)
{
auto cap_str = StringView(cap).replace("%p1%d", String::number(col)).replace("%p2%d", String::number(row));
@@ -122,7 +122,7 @@ char* __attribute__((weak)) tgoto([[maybe_unused]] const char* cap, [[maybe_unus
return s_tgoto_buffer.data();
}
-int __attribute__((weak)) tputs(const char* str, [[maybe_unused]] int affcnt, int (*putc)(int))
+int __attribute__((weak)) tputs(char const* str, [[maybe_unused]] int affcnt, int (*putc)(int))
{
size_t len = strlen(str);
for (size_t i = 0; i < len; ++i)
diff --git a/Userland/Libraries/LibC/termcap.h b/Userland/Libraries/LibC/termcap.h
index a6a70c4b2d..451151aa75 100644
--- a/Userland/Libraries/LibC/termcap.h
+++ b/Userland/Libraries/LibC/termcap.h
@@ -14,11 +14,11 @@ extern char PC;
extern char* UP;
extern char* BC;
-int tgetent(char* bp, const char* name);
-int tgetflag(const char* id);
-int tgetnum(const char* id);
-char* tgetstr(const char* id, char** area);
-char* tgoto(const char* cap, int col, int row);
-int tputs(const char* str, int affcnt, int (*putc)(int));
+int tgetent(char* bp, char const* name);
+int tgetflag(char const* id);
+int tgetnum(char const* id);
+char* tgetstr(char const* id, char** area);
+char* tgoto(char const* cap, int col, int row);
+int tputs(char const* str, int affcnt, int (*putc)(int));
__END_DECLS
diff --git a/Userland/Libraries/LibC/time.cpp b/Userland/Libraries/LibC/time.cpp
index 6f6dfa67b1..c28351c97a 100644
--- a/Userland/Libraries/LibC/time.cpp
+++ b/Userland/Libraries/LibC/time.cpp
@@ -68,7 +68,7 @@ int settimeofday(struct timeval* __restrict__ tv, void* __restrict__)
return clock_settime(CLOCK_REALTIME, &ts);
}
-int utimes(const char* pathname, const struct timeval times[2])
+int utimes(char const* pathname, const struct timeval times[2])
{
if (!times) {
return utime(pathname, nullptr);
@@ -78,18 +78,18 @@ int utimes(const char* pathname, const struct timeval times[2])
return utime(pathname, &buf);
}
-char* ctime(const time_t* t)
+char* ctime(time_t const* t)
{
return asctime(localtime(t));
}
-char* ctime_r(const time_t* t, char* buf)
+char* ctime_r(time_t const* t, char* buf)
{
struct tm tm_buf;
return asctime_r(localtime_r(t, &tm_buf), buf);
}
-static const int __seconds_per_day = 60 * 60 * 24;
+static int const __seconds_per_day = 60 * 60 * 24;
static void time_to_tm(struct tm* tm, time_t t)
{
@@ -150,7 +150,7 @@ time_t mktime(struct tm* tm)
return tm_to_time(tm, daylight ? altzone : timezone);
}
-struct tm* localtime(const time_t* t)
+struct tm* localtime(time_t const* t)
{
tzset();
@@ -158,7 +158,7 @@ struct tm* localtime(const time_t* t)
return localtime_r(t, &tm_buf);
}
-struct tm* localtime_r(const time_t* t, struct tm* tm)
+struct tm* localtime_r(time_t const* t, struct tm* tm)
{
if (!t)
return nullptr;
@@ -172,13 +172,13 @@ time_t timegm(struct tm* tm)
return tm_to_time(tm, 0);
}
-struct tm* gmtime(const time_t* t)
+struct tm* gmtime(time_t const* t)
{
static struct tm tm_buf;
return gmtime_r(t, &tm_buf);
}
-struct tm* gmtime_r(const time_t* t, struct tm* tm)
+struct tm* gmtime_r(time_t const* t, struct tm* tm)
{
if (!t)
return nullptr;
@@ -205,13 +205,13 @@ char* asctime_r(const struct tm* tm, char* buffer)
}
// FIXME: Some formats are not supported.
-size_t strftime(char* destination, size_t max_size, const char* format, const struct tm* tm)
+size_t strftime(char* destination, size_t max_size, char const* format, const struct tm* tm)
{
tzset();
StringBuilder builder { max_size };
- const int format_len = strlen(format);
+ int const format_len = strlen(format);
for (int i = 0; i < format_len; ++i) {
if (format[i] != '%') {
builder.append(format[i]);
@@ -287,20 +287,20 @@ size_t strftime(char* destination, size_t max_size, const char* format, const st
builder.appendff("{}", tm->tm_wday ? tm->tm_wday : 7);
break;
case 'U': {
- const int wday_of_year_beginning = (tm->tm_wday + 6 * tm->tm_yday) % 7;
- const int week_number = (tm->tm_yday + wday_of_year_beginning) / 7;
+ int const wday_of_year_beginning = (tm->tm_wday + 6 * tm->tm_yday) % 7;
+ int const week_number = (tm->tm_yday + wday_of_year_beginning) / 7;
builder.appendff("{:02}", week_number);
break;
}
case 'V': {
- const int wday_of_year_beginning = (tm->tm_wday + 6 + 6 * tm->tm_yday) % 7;
+ int const wday_of_year_beginning = (tm->tm_wday + 6 + 6 * tm->tm_yday) % 7;
int week_number = (tm->tm_yday + wday_of_year_beginning) / 7 + 1;
if (wday_of_year_beginning > 3) {
if (tm->tm_yday >= 7 - wday_of_year_beginning)
--week_number;
else {
- const int days_of_last_year = days_in_year(tm->tm_year + 1900 - 1);
- const int wday_of_last_year_beginning = (wday_of_year_beginning + 6 * days_of_last_year) % 7;
+ int const days_of_last_year = days_in_year(tm->tm_year + 1900 - 1);
+ int const wday_of_last_year_beginning = (wday_of_year_beginning + 6 * days_of_last_year) % 7;
week_number = (days_of_last_year + wday_of_last_year_beginning) / 7 + 1;
if (wday_of_last_year_beginning > 3)
--week_number;
@@ -313,8 +313,8 @@ size_t strftime(char* destination, size_t max_size, const char* format, const st
builder.appendff("{}", tm->tm_wday);
break;
case 'W': {
- const int wday_of_year_beginning = (tm->tm_wday + 6 + 6 * tm->tm_yday) % 7;
- const int week_number = (tm->tm_yday + wday_of_year_beginning) / 7;
+ int const wday_of_year_beginning = (tm->tm_wday + 6 + 6 * tm->tm_yday) % 7;
+ int const week_number = (tm->tm_yday + wday_of_year_beginning) / 7;
builder.appendff("{:02}", week_number);
break;
}
@@ -342,7 +342,7 @@ size_t strftime(char* destination, size_t max_size, const char* format, const st
static char __tzname_standard[TZNAME_MAX];
static char __tzname_daylight[TZNAME_MAX];
-constexpr const char* __utc = "UTC";
+constexpr char const* __utc = "UTC";
long timezone = 0;
long altzone = 0;
diff --git a/Userland/Libraries/LibC/time.h b/Userland/Libraries/LibC/time.h
index d5316c4ee4..caf8d9d6e5 100644
--- a/Userland/Libraries/LibC/time.h
+++ b/Userland/Libraries/LibC/time.h
@@ -30,13 +30,13 @@ extern int daylight;
typedef uint32_t clock_t;
typedef int64_t time_t;
-struct tm* localtime(const time_t*);
-struct tm* gmtime(const time_t*);
+struct tm* localtime(time_t const*);
+struct tm* gmtime(time_t const*);
time_t mktime(struct tm*);
time_t timegm(struct tm*);
time_t time(time_t*);
-char* ctime(const time_t*);
-char* ctime_r(const time_t* tm, char* buf);
+char* ctime(time_t const*);
+char* ctime_r(time_t const* tm, char* buf);
void tzset(void);
char* asctime(const struct tm*);
char* asctime_r(const struct tm*, char* buf);
@@ -48,10 +48,10 @@ int clock_settime(clockid_t, struct timespec*);
int clock_nanosleep(clockid_t, int flags, const struct timespec* requested_sleep, struct timespec* remaining_sleep);
int clock_getres(clockid_t, struct timespec* result);
int nanosleep(const struct timespec* requested_sleep, struct timespec* remaining_sleep);
-struct tm* gmtime_r(const time_t* timep, struct tm* result);
-struct tm* localtime_r(const time_t* timep, struct tm* result);
+struct tm* gmtime_r(time_t const* timep, struct tm* result);
+struct tm* localtime_r(time_t const* timep, struct tm* result);
double difftime(time_t, time_t);
-size_t strftime(char* s, size_t max, const char* format, const struct tm*) __attribute__((format(strftime, 3, 0)));
+size_t strftime(char* s, size_t max, char const* format, const struct tm*) __attribute__((format(strftime, 3, 0)));
__END_DECLS
diff --git a/Userland/Libraries/LibC/unistd.cpp b/Userland/Libraries/LibC/unistd.cpp
index 386de58260..f613be7a19 100644
--- a/Userland/Libraries/LibC/unistd.cpp
+++ b/Userland/Libraries/LibC/unistd.cpp
@@ -44,7 +44,7 @@ static __thread int s_cached_tid = 0;
static int s_cached_pid = 0;
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html
-int lchown(const char* pathname, uid_t uid, gid_t gid)
+int lchown(char const* pathname, uid_t uid, gid_t gid)
{
if (!pathname) {
errno = EFAULT;
@@ -56,7 +56,7 @@ int lchown(const char* pathname, uid_t uid, gid_t gid)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html
-int chown(const char* pathname, uid_t uid, gid_t gid)
+int chown(char const* pathname, uid_t uid, gid_t gid)
{
if (!pathname) {
errno = EFAULT;
@@ -74,7 +74,7 @@ int fchown(int fd, uid_t uid, gid_t gid)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int fchownat(int fd, const char* pathname, uid_t uid, gid_t gid, int flags)
+int fchownat(int fd, char const* pathname, uid_t uid, gid_t gid, int flags)
{
if (!pathname) {
errno = EFAULT;
@@ -141,13 +141,13 @@ int daemon(int nochdir, int noclose)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/execv.html
-int execv(const char* path, char* const argv[])
+int execv(char const* path, char* const argv[])
{
return execve(path, argv, environ);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/execve.html
-int execve(const char* filename, char* const argv[], char* const envp[])
+int execve(char const* filename, char* const argv[], char* const envp[])
{
size_t arg_count = 0;
for (size_t i = 0; argv[i]; ++i)
@@ -177,7 +177,7 @@ int execve(const char* filename, char* const argv[], char* const envp[])
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int execvpe(const char* filename, char* const argv[], char* const envp[])
+int execvpe(char const* filename, char* const argv[], char* const envp[])
{
if (strchr(filename, '/'))
return execve(filename, argv, envp);
@@ -202,7 +202,7 @@ int execvpe(const char* filename, char* const argv[], char* const envp[])
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/execvp.html
-int execvp(const char* filename, char* const argv[])
+int execvp(char const* filename, char* const argv[])
{
int rc = execvpe(filename, argv, environ);
int saved_errno = errno;
@@ -212,15 +212,15 @@ int execvp(const char* filename, char* const argv[])
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/execl.html
-int execl(const char* filename, const char* arg0, ...)
+int execl(char const* filename, char const* arg0, ...)
{
- Vector<const char*, 16> args;
+ Vector<char const*, 16> args;
args.append(arg0);
va_list ap;
va_start(ap, arg0);
for (;;) {
- const char* arg = va_arg(ap, const char*);
+ char const* arg = va_arg(ap, char const*);
if (!arg)
break;
args.append(arg);
@@ -252,15 +252,15 @@ int execle(char const* filename, char const* arg0, ...)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/execlp.html
-int execlp(const char* filename, const char* arg0, ...)
+int execlp(char const* filename, char const* arg0, ...)
{
- Vector<const char*, 16> args;
+ Vector<char const*, 16> args;
args.append(arg0);
va_list ap;
va_start(ap, arg0);
for (;;) {
- const char* arg = va_arg(ap, const char*);
+ char const* arg = va_arg(ap, char const*);
if (!arg)
break;
args.append(arg);
@@ -386,14 +386,14 @@ ssize_t pread(int fd, void* buf, size_t count, off_t offset)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html
-ssize_t write(int fd, const void* buf, size_t count)
+ssize_t write(int fd, void const* buf, size_t count)
{
int rc = syscall(SC_write, fd, buf, count);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html
-ssize_t pwrite(int fd, const void* buf, size_t count, off_t offset)
+ssize_t pwrite(int fd, void const* buf, size_t count, off_t offset)
{
// FIXME: This is not thread safe and should be implemented in the kernel instead.
off_t old_offset = lseek(fd, 0, SEEK_CUR);
@@ -404,7 +404,7 @@ ssize_t pwrite(int fd, const void* buf, size_t count, off_t offset)
}
// Note: Be sure to send to directory_name parameter a directory name ended with trailing slash.
-static int ttyname_r_for_directory(const char* directory_name, dev_t device_mode, ino_t inode_number, char* buffer, size_t size)
+static int ttyname_r_for_directory(char const* directory_name, dev_t device_mode, ino_t inode_number, char* buffer, size_t size)
{
DIR* dirstream = opendir(directory_name);
if (!dirstream) {
@@ -489,7 +489,7 @@ int close(int fd)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/chdir.html
-int chdir(const char* path)
+int chdir(char const* path)
{
if (!path) {
errno = EFAULT;
@@ -608,14 +608,14 @@ int gethostname(char* buffer, size_t size)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int sethostname(const char* hostname, ssize_t size)
+int sethostname(char const* hostname, ssize_t size)
{
int rc = syscall(SC_sethostname, hostname, size);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html
-ssize_t readlink(const char* path, char* buffer, size_t size)
+ssize_t readlink(char const* path, char* buffer, size_t size)
{
Syscall::SC_readlink_params params { { path, strlen(path) }, { buffer, size } };
int rc = syscall(SC_readlink, &params);
@@ -630,7 +630,7 @@ off_t lseek(int fd, off_t offset, int whence)
__RETURN_WITH_ERRNO(rc, offset, -1);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html
-int link(const char* old_path, const char* new_path)
+int link(char const* old_path, char const* new_path)
{
if (!old_path || !new_path) {
errno = EFAULT;
@@ -642,14 +642,14 @@ int link(const char* old_path, const char* new_path)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlink.html
-int unlink(const char* pathname)
+int unlink(char const* pathname)
{
int rc = syscall(SC_unlink, pathname, strlen(pathname));
__RETURN_WITH_ERRNO(rc, rc, -1);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/symlink.html
-int symlink(const char* target, const char* linkpath)
+int symlink(char const* target, char const* linkpath)
{
if (!target || !linkpath) {
errno = EFAULT;
@@ -661,7 +661,7 @@ int symlink(const char* target, const char* linkpath)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/rmdir.html
-int rmdir(const char* pathname)
+int rmdir(char const* pathname)
{
if (!pathname) {
errno = EFAULT;
@@ -690,7 +690,7 @@ int dup2(int old_fd, int new_fd)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int setgroups(size_t size, const gid_t* list)
+int setgroups(size_t size, gid_t const* list)
{
int rc = syscall(SC_setgroups, size, list);
__RETURN_WITH_ERRNO(rc, rc, -1);
@@ -763,7 +763,7 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html
-int access(const char* pathname, int mode)
+int access(char const* pathname, int mode)
{
if (!pathname) {
errno = EFAULT;
@@ -774,7 +774,7 @@ int access(const char* pathname, int mode)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/mknod.html
-int mknod(const char* pathname, mode_t mode, dev_t dev)
+int mknod(char const* pathname, mode_t mode, dev_t dev)
{
if (!pathname) {
errno = EFAULT;
@@ -803,7 +803,7 @@ long fpathconf([[maybe_unused]] int fd, int name)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/pathconf.html
-long pathconf([[maybe_unused]] const char* path, int name)
+long pathconf([[maybe_unused]] char const* path, int name)
{
switch (name) {
case _PC_NAME_MAX:
@@ -853,7 +853,7 @@ int ftruncate(int fd, off_t length)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html
-int truncate(const char* path, off_t length)
+int truncate(char const* path, off_t length)
{
int fd = open(path, O_RDWR | O_CREAT, 0666);
if (fd < 0)
@@ -889,7 +889,7 @@ int fsync(int fd)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int mount(int source_fd, const char* target, const char* fs_type, int flags)
+int mount(int source_fd, char const* target, char const* fs_type, int flags)
{
if (!target || !fs_type) {
errno = EFAULT;
@@ -906,7 +906,7 @@ int mount(int source_fd, const char* target, const char* fs_type, int flags)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int umount(const char* mountpoint)
+int umount(char const* mountpoint)
{
int rc = syscall(SC_umount, mountpoint, strlen(mountpoint));
__RETURN_WITH_ERRNO(rc, rc, -1);
@@ -923,13 +923,13 @@ int get_process_name(char* buffer, int buffer_size)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int set_process_name(const char* name, size_t name_length)
+int set_process_name(char const* name, size_t name_length)
{
int rc = syscall(SC_set_process_name, name, name_length);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int pledge(const char* promises, const char* execpromises)
+int pledge(char const* promises, char const* execpromises)
{
Syscall::SC_pledge_params params {
{ promises, promises ? strlen(promises) : 0 },
@@ -939,7 +939,7 @@ int pledge(const char* promises, const char* execpromises)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int unveil(const char* path, const char* permissions)
+int unveil(char const* path, char const* permissions)
{
Syscall::SC_unveil_params params {
{ path, path ? strlen(path) : 0 },
@@ -950,7 +950,7 @@ int unveil(const char* path, const char* permissions)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpass.html
-char* getpass(const char* prompt)
+char* getpass(char const* prompt)
{
dbgln("FIXME: getpass('{}')", prompt);
TODO();
@@ -976,7 +976,7 @@ int pause()
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/chroot.html
-int chroot(const char* path)
+int chroot(char const* path)
{
dbgln("FIXME: chroot(\"{}\")", path);
return -1;
diff --git a/Userland/Libraries/LibC/unistd.h b/Userland/Libraries/LibC/unistd.h
index 3300981169..8ce3ac92e4 100644
--- a/Userland/Libraries/LibC/unistd.h
+++ b/Userland/Libraries/LibC/unistd.h
@@ -31,7 +31,7 @@ __BEGIN_DECLS
extern char** environ;
int get_process_name(char* buffer, int buffer_size);
-int set_process_name(const char* name, size_t name_length);
+int set_process_name(char const* name, size_t name_length);
void dump_backtrace(void);
int fsync(int fd);
int sysbeep(void);
@@ -40,13 +40,13 @@ int getpagesize(void);
pid_t fork(void);
pid_t vfork(void);
int daemon(int nochdir, int noclose);
-int execv(const char* path, char* const argv[]);
-int execve(const char* filename, char* const argv[], char* const envp[]);
-int execvpe(const char* filename, char* const argv[], char* const envp[]);
-int execvp(const char* filename, char* const argv[]);
-int execl(const char* filename, const char* arg, ...);
-int execle(const char* filename, const char* arg, ...);
-int execlp(const char* filename, const char* arg, ...);
+int execv(char const* path, char* const argv[]);
+int execve(char const* filename, char* const argv[], char* const envp[]);
+int execvpe(char const* filename, char* const argv[], char* const envp[]);
+int execvp(char const* filename, char* const argv[]);
+int execl(char const* filename, char const* arg, ...);
+int execle(char const* filename, char const* arg, ...);
+int execlp(char const* filename, char const* arg, ...);
void sync(void);
__attribute__((noreturn)) void _exit(int status);
pid_t getsid(pid_t);
@@ -63,7 +63,7 @@ pid_t getppid(void);
int getresuid(uid_t*, uid_t*, uid_t*);
int getresgid(gid_t*, gid_t*, gid_t*);
int getgroups(int size, gid_t list[]);
-int setgroups(size_t, const gid_t*);
+int setgroups(size_t, gid_t const*);
int seteuid(uid_t);
int setegid(gid_t);
int setuid(uid_t);
@@ -75,49 +75,49 @@ pid_t tcgetpgrp(int fd);
int tcsetpgrp(int fd, pid_t pgid);
ssize_t read(int fd, void* buf, size_t count);
ssize_t pread(int fd, void* buf, size_t count, off_t);
-ssize_t write(int fd, const void* buf, size_t count);
-ssize_t pwrite(int fd, const void* buf, size_t count, off_t);
+ssize_t write(int fd, void const* buf, size_t count);
+ssize_t pwrite(int fd, void const* buf, size_t count, off_t);
int close(int fd);
-int chdir(const char* path);
+int chdir(char const* path);
int fchdir(int fd);
char* getcwd(char* buffer, size_t size);
char* getwd(char* buffer);
unsigned int sleep(unsigned int seconds);
int usleep(useconds_t);
int gethostname(char*, size_t);
-int sethostname(const char*, ssize_t);
-ssize_t readlink(const char* path, char* buffer, size_t);
+int sethostname(char const*, ssize_t);
+ssize_t readlink(char const* path, char* buffer, size_t);
char* ttyname(int fd);
int ttyname_r(int fd, char* buffer, size_t);
off_t lseek(int fd, off_t, int whence);
-int link(const char* oldpath, const char* newpath);
-int unlink(const char* pathname);
-int symlink(const char* target, const char* linkpath);
-int rmdir(const char* pathname);
+int link(char const* oldpath, char const* newpath);
+int unlink(char const* pathname);
+int symlink(char const* target, char const* linkpath);
+int rmdir(char const* pathname);
int dup(int old_fd);
int dup2(int old_fd, int new_fd);
int pipe(int pipefd[2]);
int pipe2(int pipefd[2], int flags);
unsigned int alarm(unsigned int seconds);
-int access(const char* pathname, int mode);
+int access(char const* pathname, int mode);
int isatty(int fd);
-int mknod(const char* pathname, mode_t, dev_t);
+int mknod(char const* pathname, mode_t, dev_t);
long fpathconf(int fd, int name);
-long pathconf(const char* path, int name);
+long pathconf(char const* path, int name);
char* getlogin(void);
-int lchown(const char* pathname, uid_t uid, gid_t gid);
-int chown(const char* pathname, uid_t, gid_t);
+int lchown(char const* pathname, uid_t uid, gid_t gid);
+int chown(char const* pathname, uid_t, gid_t);
int fchown(int fd, uid_t, gid_t);
-int fchownat(int fd, const char* pathname, uid_t uid, gid_t gid, int flags);
+int fchownat(int fd, char const* pathname, uid_t uid, gid_t gid, int flags);
int ftruncate(int fd, off_t length);
-int truncate(const char* path, off_t length);
-int mount(int source_fd, const char* target, const char* fs_type, int flags);
-int umount(const char* mountpoint);
-int pledge(const char* promises, const char* execpromises);
-int unveil(const char* path, const char* permissions);
-char* getpass(const char* prompt);
+int truncate(char const* path, off_t length);
+int mount(int source_fd, char const* target, char const* fs_type, int flags);
+int umount(char const* mountpoint);
+int pledge(char const* promises, char const* execpromises);
+int unveil(char const* path, char const* permissions);
+char* getpass(char const* prompt);
int pause(void);
-int chroot(const char*);
+int chroot(char const*);
int getdtablesize(void);
enum {
@@ -155,6 +155,6 @@ extern int optreset;
// value.
extern char* optarg;
-int getopt(int argc, char* const* argv, const char* short_options);
+int getopt(int argc, char* const* argv, char const* short_options);
__END_DECLS
diff --git a/Userland/Libraries/LibC/utime.cpp b/Userland/Libraries/LibC/utime.cpp
index 4160b28ab9..4fe8147a1a 100644
--- a/Userland/Libraries/LibC/utime.cpp
+++ b/Userland/Libraries/LibC/utime.cpp
@@ -11,7 +11,7 @@
extern "C" {
-int utime(const char* pathname, const struct utimbuf* buf)
+int utime(char const* pathname, const struct utimbuf* buf)
{
if (!pathname) {
errno = EFAULT;
diff --git a/Userland/Libraries/LibC/utime.h b/Userland/Libraries/LibC/utime.h
index 6a86c8b64c..71904ba7e7 100644
--- a/Userland/Libraries/LibC/utime.h
+++ b/Userland/Libraries/LibC/utime.h
@@ -10,6 +10,6 @@
__BEGIN_DECLS
-int utime(const char* pathname, const struct utimbuf*);
+int utime(char const* pathname, const struct utimbuf*);
__END_DECLS
diff --git a/Userland/Libraries/LibC/wchar.h b/Userland/Libraries/LibC/wchar.h
index 33d129bf6e..7f38900b95 100644
--- a/Userland/Libraries/LibC/wchar.h
+++ b/Userland/Libraries/LibC/wchar.h
@@ -29,47 +29,47 @@ typedef struct {
struct tm;
-size_t wcslen(const wchar_t*);
-wchar_t* wcscpy(wchar_t*, const wchar_t*);
-wchar_t* wcsdup(const wchar_t*);
-wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
-__attribute__((warn_unused_result)) size_t wcslcpy(wchar_t*, const wchar_t*, size_t);
-int wcscmp(const wchar_t*, const wchar_t*);
-int wcsncmp(const wchar_t*, const wchar_t*, size_t);
-wchar_t* wcschr(const wchar_t*, int);
-wchar_t* wcsrchr(const wchar_t*, wchar_t);
-wchar_t* wcscat(wchar_t*, const wchar_t*);
-wchar_t* wcsncat(wchar_t*, const wchar_t*, size_t);
-wchar_t* wcstok(wchar_t*, const wchar_t*, wchar_t**);
-long wcstol(const wchar_t*, wchar_t**, int);
-long long wcstoll(const wchar_t*, wchar_t**, int);
+size_t wcslen(wchar_t const*);
+wchar_t* wcscpy(wchar_t*, wchar_t const*);
+wchar_t* wcsdup(wchar_t const*);
+wchar_t* wcsncpy(wchar_t*, wchar_t const*, size_t);
+__attribute__((warn_unused_result)) size_t wcslcpy(wchar_t*, wchar_t const*, size_t);
+int wcscmp(wchar_t const*, wchar_t const*);
+int wcsncmp(wchar_t const*, wchar_t const*, size_t);
+wchar_t* wcschr(wchar_t const*, int);
+wchar_t* wcsrchr(wchar_t const*, wchar_t);
+wchar_t* wcscat(wchar_t*, wchar_t const*);
+wchar_t* wcsncat(wchar_t*, wchar_t const*, size_t);
+wchar_t* wcstok(wchar_t*, wchar_t const*, wchar_t**);
+long wcstol(wchar_t const*, wchar_t**, int);
+long long wcstoll(wchar_t const*, wchar_t**, int);
wint_t btowc(int c);
-size_t mbrtowc(wchar_t*, const char*, size_t, mbstate_t*);
-size_t mbrlen(const char*, size_t, mbstate_t*);
+size_t mbrtowc(wchar_t*, char const*, size_t, mbstate_t*);
+size_t mbrlen(char const*, size_t, mbstate_t*);
size_t wcrtomb(char*, wchar_t, mbstate_t*);
-int wcscoll(const wchar_t*, const wchar_t*);
-size_t wcsxfrm(wchar_t*, const wchar_t*, size_t);
+int wcscoll(wchar_t const*, wchar_t const*);
+size_t wcsxfrm(wchar_t*, wchar_t const*, size_t);
int wctob(wint_t);
-int mbsinit(const mbstate_t*);
-wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
-wchar_t* wcsstr(const wchar_t*, const wchar_t*);
-wchar_t* wmemchr(const wchar_t*, wchar_t, size_t);
-wchar_t* wmemcpy(wchar_t*, const wchar_t*, size_t);
+int mbsinit(mbstate_t const*);
+wchar_t* wcspbrk(wchar_t const*, wchar_t const*);
+wchar_t* wcsstr(wchar_t const*, wchar_t const*);
+wchar_t* wmemchr(wchar_t const*, wchar_t, size_t);
+wchar_t* wmemcpy(wchar_t*, wchar_t const*, size_t);
wchar_t* wmemset(wchar_t*, wchar_t, size_t);
-wchar_t* wmemmove(wchar_t*, const wchar_t*, size_t);
-unsigned long wcstoul(const wchar_t*, wchar_t**, int);
-unsigned long long wcstoull(const wchar_t*, wchar_t**, int);
-float wcstof(const wchar_t*, wchar_t**);
-double wcstod(const wchar_t*, wchar_t**);
-long double wcstold(const wchar_t*, wchar_t**);
+wchar_t* wmemmove(wchar_t*, wchar_t const*, size_t);
+unsigned long wcstoul(wchar_t const*, wchar_t**, int);
+unsigned long long wcstoull(wchar_t const*, wchar_t**, int);
+float wcstof(wchar_t const*, wchar_t**);
+double wcstod(wchar_t const*, wchar_t**);
+long double wcstold(wchar_t const*, wchar_t**);
int wcwidth(wchar_t);
-size_t wcsrtombs(char*, const wchar_t**, size_t, mbstate_t*);
-size_t mbsrtowcs(wchar_t*, const char**, size_t, mbstate_t*);
-int wmemcmp(const wchar_t*, const wchar_t*, size_t);
-size_t wcsnrtombs(char*, const wchar_t**, size_t, size_t, mbstate_t*);
-size_t mbsnrtowcs(wchar_t*, const char**, size_t, size_t, mbstate_t*);
-size_t wcscspn(const wchar_t* wcs, const wchar_t* reject);
-size_t wcsspn(const wchar_t* wcs, const wchar_t* accept);
+size_t wcsrtombs(char*, wchar_t const**, size_t, mbstate_t*);
+size_t mbsrtowcs(wchar_t*, char const**, size_t, mbstate_t*);
+int wmemcmp(wchar_t const*, wchar_t const*, size_t);
+size_t wcsnrtombs(char*, wchar_t const**, size_t, size_t, mbstate_t*);
+size_t mbsnrtowcs(wchar_t*, char const**, size_t, size_t, mbstate_t*);
+size_t wcscspn(wchar_t const* wcs, wchar_t const* reject);
+size_t wcsspn(wchar_t const* wcs, wchar_t const* accept);
wint_t fgetwc(FILE* stream);
wint_t getwc(FILE* stream);
@@ -78,24 +78,24 @@ wint_t fputwc(wchar_t wc, FILE* stream);
wint_t putwc(wchar_t wc, FILE* stream);
wint_t putwchar(wchar_t wc);
wchar_t* fgetws(wchar_t* __restrict ws, int n, FILE* __restrict stream);
-int fputws(const wchar_t* __restrict ws, FILE* __restrict stream);
+int fputws(wchar_t const* __restrict ws, FILE* __restrict stream);
wint_t ungetwc(wint_t wc, FILE* stream);
int fwide(FILE* stream, int mode);
-int wprintf(const wchar_t* __restrict format, ...);
-int fwprintf(FILE* __restrict stream, const wchar_t* __restrict format, ...);
-int swprintf(wchar_t* __restrict wcs, size_t maxlen, const wchar_t* __restrict format, ...);
-int vwprintf(const wchar_t* __restrict format, va_list args);
-int vfwprintf(FILE* __restrict stream, const wchar_t* __restrict format, va_list args);
-int vswprintf(wchar_t* __restrict wcs, size_t maxlen, const wchar_t* __restrict format, va_list args);
+int wprintf(wchar_t const* __restrict format, ...);
+int fwprintf(FILE* __restrict stream, wchar_t const* __restrict format, ...);
+int swprintf(wchar_t* __restrict wcs, size_t maxlen, wchar_t const* __restrict format, ...);
+int vwprintf(wchar_t const* __restrict format, va_list args);
+int vfwprintf(FILE* __restrict stream, wchar_t const* __restrict format, va_list args);
+int vswprintf(wchar_t* __restrict wcs, size_t maxlen, wchar_t const* __restrict format, va_list args);
-int fwscanf(FILE* __restrict stream, const wchar_t* __restrict format, ...);
-int swscanf(const wchar_t* __restrict ws, const wchar_t* __restrict format, ...);
-int wscanf(const wchar_t* __restrict format, ...);
-int vfwscanf(FILE* __restrict stream, const wchar_t* __restrict format, va_list arg);
-int vswscanf(const wchar_t* __restrict ws, const wchar_t* __restrict format, va_list arg);
-int vwscanf(const wchar_t* __restrict format, va_list arg);
+int fwscanf(FILE* __restrict stream, wchar_t const* __restrict format, ...);
+int swscanf(wchar_t const* __restrict ws, wchar_t const* __restrict format, ...);
+int wscanf(wchar_t const* __restrict format, ...);
+int vfwscanf(FILE* __restrict stream, wchar_t const* __restrict format, va_list arg);
+int vswscanf(wchar_t const* __restrict ws, wchar_t const* __restrict format, va_list arg);
+int vwscanf(wchar_t const* __restrict format, va_list arg);
-size_t wcsftime(wchar_t* __restrict wcs, size_t maxsize, const wchar_t* __restrict format, const struct tm* __restrict timeptr);
+size_t wcsftime(wchar_t* __restrict wcs, size_t maxsize, wchar_t const* __restrict format, const struct tm* __restrict timeptr);
__END_DECLS
diff --git a/Userland/Libraries/LibC/wctype.cpp b/Userland/Libraries/LibC/wctype.cpp
index c5dfdcda7a..92f2ca77e9 100644
--- a/Userland/Libraries/LibC/wctype.cpp
+++ b/Userland/Libraries/LibC/wctype.cpp
@@ -136,7 +136,7 @@ int iswctype(wint_t wc, wctype_t charclass)
}
}
-wctype_t wctype(const char* property)
+wctype_t wctype(char const* property)
{
if (strcmp(property, "alnum") == 0)
return WCTYPE_ALNUM;
@@ -201,7 +201,7 @@ wint_t towctrans(wint_t wc, wctrans_t desc)
}
}
-wctrans_t wctrans(const char* charclass)
+wctrans_t wctrans(char const* charclass)
{
if (strcmp(charclass, "tolower") == 0)
return WCTRANS_TOLOWER;
diff --git a/Userland/Libraries/LibC/wctype.h b/Userland/Libraries/LibC/wctype.h
index 3bf6afa65c..6f08a0b04b 100644
--- a/Userland/Libraries/LibC/wctype.h
+++ b/Userland/Libraries/LibC/wctype.h
@@ -27,10 +27,10 @@ int iswlower(wint_t wc);
int iswupper(wint_t wc);
int iswblank(wint_t wc);
int iswctype(wint_t, wctype_t);
-wctype_t wctype(const char*);
+wctype_t wctype(char const*);
wint_t towlower(wint_t wc);
wint_t towupper(wint_t wc);
wint_t towctrans(wint_t, wctrans_t);
-wctrans_t wctrans(const char*);
+wctrans_t wctrans(char const*);
__END_DECLS
diff --git a/Userland/Libraries/LibCards/Card.cpp b/Userland/Libraries/LibCards/Card.cpp
index c38641f7fb..a29d5f77ef 100644
--- a/Userland/Libraries/LibCards/Card.cpp
+++ b/Userland/Libraries/LibCards/Card.cpp
@@ -148,7 +148,7 @@ void Card::draw(GUI::Painter& painter) const
painter.blit(position(), m_upside_down ? *s_background : *m_front, m_front->rect());
}
-void Card::clear(GUI::Painter& painter, const Color& background_color) const
+void Card::clear(GUI::Painter& painter, Color const& background_color) const
{
painter.fill_rect({ old_position(), { width, height } }, background_color);
}
@@ -159,7 +159,7 @@ void Card::save_old_position()
m_old_position_valid = true;
}
-void Card::clear_and_draw(GUI::Painter& painter, const Color& background_color)
+void Card::clear_and_draw(GUI::Painter& painter, Color const& background_color)
{
if (is_old_position_valid())
clear(painter, background_color);
diff --git a/Userland/Libraries/LibCards/Card.h b/Userland/Libraries/LibCards/Card.h
index 31028bf27f..257751f057 100644
--- a/Userland/Libraries/LibCards/Card.h
+++ b/Userland/Libraries/LibCards/Card.h
@@ -41,7 +41,7 @@ public:
Gfx::IntRect& rect() { return m_rect; }
Gfx::IntPoint position() const { return m_rect.location(); }
- const Gfx::IntPoint& old_position() const { return m_old_position; }
+ Gfx::IntPoint const& old_position() const { return m_old_position; }
uint8_t value() const { return m_value; };
Suit suit() const { return m_suit; }
@@ -59,8 +59,8 @@ public:
void save_old_position();
void draw(GUI::Painter&) const;
- void clear(GUI::Painter&, const Color& background_color) const;
- void clear_and_draw(GUI::Painter&, const Color& background_color);
+ void clear(GUI::Painter&, Color const& background_color) const;
+ void clear_and_draw(GUI::Painter&, Color const& background_color);
private:
Card(Suit suit, uint8_t value);
diff --git a/Userland/Libraries/LibCards/CardStack.cpp b/Userland/Libraries/LibCards/CardStack.cpp
index 2d65d124ea..7826a3938c 100644
--- a/Userland/Libraries/LibCards/CardStack.cpp
+++ b/Userland/Libraries/LibCards/CardStack.cpp
@@ -15,7 +15,7 @@ CardStack::CardStack()
{
}
-CardStack::CardStack(const Gfx::IntPoint& position, Type type)
+CardStack::CardStack(Gfx::IntPoint const& position, Type type)
: m_position(position)
, m_type(type)
, m_rules(rules_for_type(type))
@@ -25,7 +25,7 @@ CardStack::CardStack(const Gfx::IntPoint& position, Type type)
calculate_bounding_box();
}
-CardStack::CardStack(const Gfx::IntPoint& position, Type type, NonnullRefPtr<CardStack> associated_stack)
+CardStack::CardStack(Gfx::IntPoint const& position, Type type, NonnullRefPtr<CardStack> associated_stack)
: m_associated_stack(move(associated_stack))
, m_position(position)
, m_type(type)
@@ -42,7 +42,7 @@ void CardStack::clear()
m_stack_positions.clear();
}
-void CardStack::draw(GUI::Painter& painter, const Gfx::Color& background_color)
+void CardStack::draw(GUI::Painter& painter, Gfx::Color const& background_color)
{
auto draw_background_if_empty = [&]() {
size_t number_of_moving_cards = 0;
@@ -108,7 +108,7 @@ void CardStack::rebound_cards()
card.set_position(m_stack_positions.at(card_index++));
}
-void CardStack::add_all_grabbed_cards(const Gfx::IntPoint& click_location, NonnullRefPtrVector<Card>& grabbed, MovementRule movement_rule)
+void CardStack::add_all_grabbed_cards(Gfx::IntPoint const& click_location, NonnullRefPtrVector<Card>& grabbed, MovementRule movement_rule)
{
VERIFY(grabbed.is_empty());
@@ -187,7 +187,7 @@ void CardStack::add_all_grabbed_cards(const Gfx::IntPoint& click_location, Nonnu
}
}
-bool CardStack::is_allowed_to_push(const Card& card, size_t stack_size, MovementRule movement_rule) const
+bool CardStack::is_allowed_to_push(Card const& card, size_t stack_size, MovementRule movement_rule) const
{
if (m_type == Type::Stock || m_type == Type::Waste || m_type == Type::Play)
return false;
diff --git a/Userland/Libraries/LibCards/CardStack.h b/Userland/Libraries/LibCards/CardStack.h
index 82e39f7bf3..7c763daae3 100644
--- a/Userland/Libraries/LibCards/CardStack.h
+++ b/Userland/Libraries/LibCards/CardStack.h
@@ -31,17 +31,17 @@ public:
};
CardStack();
- CardStack(const Gfx::IntPoint& position, Type type);
- CardStack(const Gfx::IntPoint& position, Type type, NonnullRefPtr<CardStack> associated_stack);
+ CardStack(Gfx::IntPoint const& position, Type type);
+ CardStack(Gfx::IntPoint const& position, Type type, NonnullRefPtr<CardStack> associated_stack);
bool is_empty() const { return m_stack.is_empty(); }
bool is_focused() const { return m_focused; }
Type type() const { return m_type; }
- const NonnullRefPtrVector<Card>& stack() const { return m_stack; }
+ NonnullRefPtrVector<Card> const& stack() const { return m_stack; }
size_t count() const { return m_stack.size(); }
- const Card& peek() const { return m_stack.last(); }
+ Card const& peek() const { return m_stack.last(); }
Card& peek() { return m_stack.last(); }
- const Gfx::IntRect& bounding_box() const { return m_bounding_box; }
+ Gfx::IntRect const& bounding_box() const { return m_bounding_box; }
void set_focused(bool focused) { m_focused = focused; }
@@ -50,9 +50,9 @@ public:
void move_to_stack(CardStack&);
void rebound_cards();
- bool is_allowed_to_push(const Card&, size_t stack_size = 1, MovementRule movement_rule = MovementRule::Alternating) const;
- void add_all_grabbed_cards(const Gfx::IntPoint& click_location, NonnullRefPtrVector<Card>& grabbed, MovementRule movement_rule = MovementRule::Alternating);
- void draw(GUI::Painter&, const Gfx::Color& background_color);
+ bool is_allowed_to_push(Card const&, size_t stack_size = 1, MovementRule movement_rule = MovementRule::Alternating) const;
+ void add_all_grabbed_cards(Gfx::IntPoint const& click_location, NonnullRefPtrVector<Card>& grabbed, MovementRule movement_rule = MovementRule::Alternating);
+ void draw(GUI::Painter&, Gfx::Color const& background_color);
void clear();
private:
@@ -125,7 +125,7 @@ struct AK::Formatter<Cards::CardStack> : Formatter<FormatString> {
StringBuilder cards;
bool first_card = true;
- for (const auto& card : stack.stack()) {
+ for (auto const& card : stack.stack()) {
cards.appendff("{}{}", (first_card ? "" : " "), card);
first_card = false;
}
diff --git a/Userland/Libraries/LibChess/Chess.cpp b/Userland/Libraries/LibChess/Chess.cpp
index 6d56ecd1f0..60c1ff4d88 100644
--- a/Userland/Libraries/LibChess/Chess.cpp
+++ b/Userland/Libraries/LibChess/Chess.cpp
@@ -101,7 +101,7 @@ String Move::to_long_algebraic() const
return builder.build();
}
-Move Move::from_algebraic(StringView algebraic, const Color turn, const Board& board)
+Move Move::from_algebraic(StringView algebraic, const Color turn, Board const& board)
{
String move_string = algebraic;
Move move({ 50, 50 }, { 50, 50 });
@@ -143,7 +143,7 @@ Move Move::from_algebraic(StringView algebraic, const Color turn, const Board& b
move_string = move_string.substring(1, move_string.length() - 1);
}
- Square::for_each([&](const Square& square) {
+ Square::for_each([&](Square const& square) {
if (!move_string.is_empty()) {
if (board.get_piece(square).type == move.piece.type && board.is_legal(Move(square, move.to), turn)) {
if (move_string.length() >= 2) {
@@ -326,19 +326,19 @@ String Board::to_fen() const
return builder.to_string();
}
-Piece Board::get_piece(const Square& square) const
+Piece Board::get_piece(Square const& square) const
{
VERIFY(square.in_bounds());
return m_board[square.rank][square.file];
}
-Piece Board::set_piece(const Square& square, const Piece& piece)
+Piece Board::set_piece(Square const& square, Piece const& piece)
{
VERIFY(square.in_bounds());
return m_board[square.rank][square.file] = piece;
}
-bool Board::is_legal_promotion(const Move& move, Color color) const
+bool Board::is_legal_promotion(Move const& move, Color color) const
{
auto piece = get_piece(move.from);
@@ -367,7 +367,7 @@ bool Board::is_legal_promotion(const Move& move, Color color) const
return true;
}
-bool Board::is_legal(const Move& move, Color color) const
+bool Board::is_legal(Move const& move, Color color) const
{
if (color == Color::None)
color = turn();
@@ -409,7 +409,7 @@ bool Board::is_legal(const Move& move, Color color) const
return true;
}
-bool Board::is_legal_no_check(const Move& move, Color color) const
+bool Board::is_legal_no_check(Move const& move, Color color) const
{
auto piece = get_piece(move.from);
@@ -536,7 +536,7 @@ bool Board::is_legal_no_check(const Move& move, Color color) const
bool Board::in_check(Color color) const
{
Square king_square = { 50, 50 };
- Square::for_each([&](const Square& square) {
+ Square::for_each([&](Square const& square) {
if (get_piece(square) == Piece(color, Type::King)) {
king_square = square;
return IterationDecision::Break;
@@ -545,7 +545,7 @@ bool Board::in_check(Color color) const
});
bool check = false;
- Square::for_each([&](const Square& square) {
+ Square::for_each([&](Square const& square) {
if (is_legal_no_check({ square, king_square }, opposing_color(color))) {
check = true;
return IterationDecision::Break;
@@ -556,7 +556,7 @@ bool Board::in_check(Color color) const
return check;
}
-bool Board::apply_move(const Move& move, Color color)
+bool Board::apply_move(Move const& move, Color color)
{
if (color == Color::None)
color = turn();
@@ -569,7 +569,7 @@ bool Board::apply_move(const Move& move, Color color)
return apply_illegal_move(move, color);
}
-bool Board::apply_illegal_move(const Move& move, Color color)
+bool Board::apply_illegal_move(Move const& move, Color color)
{
auto state = Traits<Board>::hash(*this);
auto state_count = 0;
@@ -826,7 +826,7 @@ int Board::material_imbalance() const
return imbalance;
}
-bool Board::is_promotion_move(const Move& move, Color color) const
+bool Board::is_promotion_move(Move const& move, Color color) const
{
if (color == Color::None)
color = turn();
@@ -846,7 +846,7 @@ bool Board::is_promotion_move(const Move& move, Color color) const
return true;
}
-bool Board::operator==(const Board& other) const
+bool Board::operator==(Board const& other) const
{
bool equal_squares = true;
Square::for_each([&](Square sq) {
diff --git a/Userland/Libraries/LibChess/Chess.h b/Userland/Libraries/LibChess/Chess.h
index e20a683cec..c73bdc5cce 100644
--- a/Userland/Libraries/LibChess/Chess.h
+++ b/Userland/Libraries/LibChess/Chess.h
@@ -49,7 +49,7 @@ struct Piece {
}
Color color : 4;
Type type : 4;
- bool operator==(const Piece& other) const { return color == other.color && type == other.type; }
+ bool operator==(Piece const& other) const { return color == other.color && type == other.type; }
};
constexpr Piece EmptyPiece = { Color::None, Type::None };
@@ -58,12 +58,12 @@ struct Square {
i8 rank; // zero indexed;
i8 file;
Square(StringView name);
- Square(const int& rank, const int& file)
+ Square(int const& rank, int const& file)
: rank(rank)
, file(file)
{
}
- bool operator==(const Square& other) const { return rank == other.rank && file == other.file; }
+ bool operator==(Square const& other) const { return rank == other.rank && file == other.file; }
template<typename Callback>
static void for_each(Callback callback)
@@ -94,15 +94,15 @@ struct Move {
bool is_ambiguous : 1 = false;
Square ambiguous { 50, 50 };
Move(StringView long_algebraic);
- Move(const Square& from, const Square& to, const Type& promote_to = Type::None)
+ Move(Square const& from, Square const& to, Type const& promote_to = Type::None)
: from(from)
, to(to)
, promote_to(promote_to)
{
}
- bool operator==(const Move& other) const { return from == other.from && to == other.to && promote_to == other.promote_to; }
+ bool operator==(Move const& other) const { return from == other.from && to == other.to && promote_to == other.promote_to; }
- static Move from_algebraic(StringView algebraic, const Color turn, const Board& board);
+ static Move from_algebraic(StringView algebraic, const Color turn, Board const& board);
String to_long_algebraic() const;
String to_algebraic() const;
};
@@ -111,16 +111,16 @@ class Board {
public:
Board();
- Piece get_piece(const Square&) const;
- Piece set_piece(const Square&, const Piece&);
+ Piece get_piece(Square const&) const;
+ Piece set_piece(Square const&, Piece const&);
- bool is_legal(const Move&, Color color = Color::None) const;
+ bool is_legal(Move const&, Color color = Color::None) const;
bool in_check(Color color) const;
- bool is_promotion_move(const Move&, Color color = Color::None) const;
+ bool is_promotion_move(Move const&, Color color = Color::None) const;
- bool apply_move(const Move&, Color color = Color::None);
- const Optional<Move>& last_move() const { return m_last_move; }
+ bool apply_move(Move const&, Color color = Color::None);
+ Optional<Move> const& last_move() const { return m_last_move; }
String to_fen() const;
@@ -151,14 +151,14 @@ public:
int material_imbalance() const;
Color turn() const { return m_turn; }
- const Vector<Move>& moves() const { return m_moves; }
+ Vector<Move> const& moves() const { return m_moves; }
- bool operator==(const Board& other) const;
+ bool operator==(Board const& other) const;
private:
- bool is_legal_no_check(const Move&, Color color) const;
- bool is_legal_promotion(const Move&, Color color) const;
- bool apply_illegal_move(const Move&, Color color);
+ bool is_legal_no_check(Move const&, Color color) const;
+ bool is_legal_promotion(Move const&, Color color) const;
+ bool apply_illegal_move(Move const&, Color color);
Piece m_board[8][8];
Optional<Move> m_last_move;
diff --git a/Userland/Libraries/LibChess/UCICommand.h b/Userland/Libraries/LibChess/UCICommand.h
index 33415ae8c5..0b5ae607cb 100644
--- a/Userland/Libraries/LibChess/UCICommand.h
+++ b/Userland/Libraries/LibChess/UCICommand.h
@@ -109,8 +109,8 @@ public:
virtual String to_string() const override;
- const String& name() const { return m_name; }
- const Optional<String>& value() const { return m_value; }
+ String const& name() const { return m_name; }
+ Optional<String> const& value() const { return m_value; }
private:
String m_name;
@@ -119,7 +119,7 @@ private:
class PositionCommand : public Command {
public:
- explicit PositionCommand(const Optional<String>& fen, const Vector<Chess::Move>& moves)
+ explicit PositionCommand(Optional<String> const& fen, Vector<Chess::Move> const& moves)
: Command(Command::Type::Position)
, m_fen(fen)
, m_moves(moves)
@@ -130,8 +130,8 @@ public:
virtual String to_string() const override;
- const Optional<String>& fen() const { return m_fen; }
- const Vector<Chess::Move>& moves() const { return m_moves; }
+ Optional<String> const& fen() const { return m_fen; }
+ Vector<Chess::Move> const& moves() const { return m_moves; }
private:
Optional<String> m_fen;
@@ -194,7 +194,7 @@ public:
virtual String to_string() const override;
Type field_type() const { return m_field_type; }
- const String& value() const { return m_value; }
+ String const& value() const { return m_value; }
private:
Type m_field_type;
@@ -227,7 +227,7 @@ public:
class BestMoveCommand : public Command {
public:
- explicit BestMoveCommand(const Chess::Move& move)
+ explicit BestMoveCommand(Chess::Move const& move)
: Command(Command::Type::BestMove)
, m_move(move)
{
diff --git a/Userland/Libraries/LibChess/UCIEndpoint.cpp b/Userland/Libraries/LibChess/UCIEndpoint.cpp
index e1ab9d234b..0c8723b9db 100644
--- a/Userland/Libraries/LibChess/UCIEndpoint.cpp
+++ b/Userland/Libraries/LibChess/UCIEndpoint.cpp
@@ -21,7 +21,7 @@ Endpoint::Endpoint(NonnullRefPtr<Core::IODevice> in, NonnullRefPtr<Core::IODevic
set_in_notifier();
}
-void Endpoint::send_command(const Command& command)
+void Endpoint::send_command(Command const& command)
{
dbgln_if(UCI_DEBUG, "{} Sent UCI Command: {}", class_name(), String(command.to_string().characters(), Chomp));
m_out->write(command.to_string());
@@ -33,27 +33,27 @@ void Endpoint::event(Core::Event& event)
case Command::Type::UCI:
return handle_uci();
case Command::Type::Debug:
- return handle_debug(static_cast<const DebugCommand&>(event));
+ return handle_debug(static_cast<DebugCommand const&>(event));
case Command::Type::IsReady:
return handle_uci();
case Command::Type::SetOption:
- return handle_setoption(static_cast<const SetOptionCommand&>(event));
+ return handle_setoption(static_cast<SetOptionCommand const&>(event));
case Command::Type::Position:
- return handle_position(static_cast<const PositionCommand&>(event));
+ return handle_position(static_cast<PositionCommand const&>(event));
case Command::Type::Go:
- return handle_go(static_cast<const GoCommand&>(event));
+ return handle_go(static_cast<GoCommand const&>(event));
case Command::Type::Stop:
return handle_stop();
case Command::Type::Id:
- return handle_id(static_cast<const IdCommand&>(event));
+ return handle_id(static_cast<IdCommand const&>(event));
case Command::Type::UCIOk:
return handle_uciok();
case Command::Type::ReadyOk:
return handle_readyok();
case Command::Type::BestMove:
- return handle_bestmove(static_cast<const BestMoveCommand&>(event));
+ return handle_bestmove(static_cast<BestMoveCommand const&>(event));
case Command::Type::Info:
- return handle_info(static_cast<const InfoCommand&>(event));
+ return handle_info(static_cast<InfoCommand const&>(event));
default:
break;
}
diff --git a/Userland/Libraries/LibChess/UCIEndpoint.h b/Userland/Libraries/LibChess/UCIEndpoint.h
index f9843ae8cf..8e99ab979d 100644
--- a/Userland/Libraries/LibChess/UCIEndpoint.h
+++ b/Userland/Libraries/LibChess/UCIEndpoint.h
@@ -19,19 +19,19 @@ public:
virtual ~Endpoint() override = default;
virtual void handle_uci() { }
- virtual void handle_debug(const DebugCommand&) { }
+ virtual void handle_debug(DebugCommand const&) { }
virtual void handle_isready() { }
- virtual void handle_setoption(const SetOptionCommand&) { }
- virtual void handle_position(const PositionCommand&) { }
- virtual void handle_go(const GoCommand&) { }
+ virtual void handle_setoption(SetOptionCommand const&) { }
+ virtual void handle_position(PositionCommand const&) { }
+ virtual void handle_go(GoCommand const&) { }
virtual void handle_stop() { }
- virtual void handle_id(const IdCommand&) { }
+ virtual void handle_id(IdCommand const&) { }
virtual void handle_uciok() { }
virtual void handle_readyok() { }
- virtual void handle_bestmove(const BestMoveCommand&) { }
- virtual void handle_info(const InfoCommand&) { }
+ virtual void handle_bestmove(BestMoveCommand const&) { }
+ virtual void handle_info(InfoCommand const&) { }
- void send_command(const Command&);
+ void send_command(Command const&);
virtual void event(Core::Event&) override;
diff --git a/Userland/Libraries/LibCompress/Deflate.cpp b/Userland/Libraries/LibCompress/Deflate.cpp
index a4e0bcedbe..31a2271572 100644
--- a/Userland/Libraries/LibCompress/Deflate.cpp
+++ b/Userland/Libraries/LibCompress/Deflate.cpp
@@ -16,7 +16,7 @@
namespace Compress {
-const CanonicalCode& CanonicalCode::fixed_literal_codes()
+CanonicalCode const& CanonicalCode::fixed_literal_codes()
{
static CanonicalCode code;
static bool initialized = false;
@@ -30,7 +30,7 @@ const CanonicalCode& CanonicalCode::fixed_literal_codes()
return code;
}
-const CanonicalCode& CanonicalCode::fixed_distance_codes()
+CanonicalCode const& CanonicalCode::fixed_distance_codes()
{
static CanonicalCode code;
static bool initialized = false;
@@ -128,7 +128,7 @@ bool DeflateDecompressor::CompressedBlock::try_read_more()
if (m_eof == true)
return false;
- const auto symbol = m_literal_codes.read_symbol(m_decompressor.m_input_stream);
+ auto const symbol = m_literal_codes.read_symbol(m_decompressor.m_input_stream);
if (symbol >= 286) { // invalid deflate literal/length symbol
m_decompressor.set_fatal_error();
@@ -147,13 +147,13 @@ bool DeflateDecompressor::CompressedBlock::try_read_more()
return false;
}
- const auto length = m_decompressor.decode_length(symbol);
- const auto distance_symbol = m_distance_codes.value().read_symbol(m_decompressor.m_input_stream);
+ auto const length = m_decompressor.decode_length(symbol);
+ auto const distance_symbol = m_distance_codes.value().read_symbol(m_decompressor.m_input_stream);
if (distance_symbol >= 30) { // invalid deflate distance symbol
m_decompressor.set_fatal_error();
return false;
}
- const auto distance = m_decompressor.decode_distance(distance_symbol);
+ auto const distance = m_decompressor.decode_distance(distance_symbol);
for (size_t idx = 0; idx < length; ++idx) {
u8 byte = 0;
@@ -180,7 +180,7 @@ bool DeflateDecompressor::UncompressedBlock::try_read_more()
if (m_bytes_remaining == 0)
return false;
- const auto nread = min(m_bytes_remaining, m_decompressor.m_output_stream.remaining_contiguous_space());
+ auto const nread = min(m_bytes_remaining, m_decompressor.m_output_stream.remaining_contiguous_space());
m_bytes_remaining -= nread;
m_decompressor.m_input_stream >> m_decompressor.m_output_stream.reserve_contiguous_space(nread);
@@ -215,7 +215,7 @@ size_t DeflateDecompressor::read(Bytes bytes)
break;
m_read_final_bock = m_input_stream.read_bit();
- const auto block_type = m_input_stream.read_bits(2);
+ auto const block_type = m_input_stream.read_bits(2);
if (m_input_stream.has_any_error()) {
set_fatal_error();
@@ -363,7 +363,7 @@ Optional<ByteBuffer> DeflateDecompressor::decompress_all(ReadonlyBytes bytes)
u8 buffer[4096];
while (!deflate_stream.has_any_error() && !deflate_stream.unreliable_eof()) {
- const auto nread = deflate_stream.read({ buffer, sizeof(buffer) });
+ auto const nread = deflate_stream.read({ buffer, sizeof(buffer) });
output_stream.write_or_error({ buffer, nread });
}
@@ -428,7 +428,7 @@ void DeflateDecompressor::decode_codes(CanonicalCode& literal_code, Optional<Can
set_fatal_error();
return;
}
- const auto code_length_code = code_length_code_result.value();
+ auto const code_length_code = code_length_code_result.value();
// Next we extract the code lengths of the code that was used to encode the block.
@@ -544,7 +544,7 @@ bool DeflateCompressor::write_or_error(ReadonlyBytes bytes)
}
// Knuth's multiplicative hash on 4 bytes
-u16 DeflateCompressor::hash_sequence(const u8* bytes)
+u16 DeflateCompressor::hash_sequence(u8 const* bytes)
{
constexpr const u32 knuth_constant = 2654435761; // shares no common factors with 2^32
return ((bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24) * knuth_constant) >> (32 - hash_bits);
@@ -617,7 +617,7 @@ ALWAYS_INLINE u8 DeflateCompressor::distance_to_base(u16 distance)
}
template<size_t Size>
-void DeflateCompressor::generate_huffman_lengths(Array<u8, Size>& lengths, const Array<u16, Size>& frequencies, size_t max_bit_length, u16 frequency_cap)
+void DeflateCompressor::generate_huffman_lengths(Array<u8, Size>& lengths, Array<u16, Size> const& frequencies, size_t max_bit_length, u16 frequency_cap)
{
VERIFY((1u << max_bit_length) >= Size);
u16 heap_keys[Size]; // Used for O(n) heap construction
@@ -773,7 +773,7 @@ void DeflateCompressor::lz77_compress_block()
}
}
-size_t DeflateCompressor::huffman_block_length(const Array<u8, max_huffman_literals>& literal_bit_lengths, const Array<u8, max_huffman_distances>& distance_bit_lengths)
+size_t DeflateCompressor::huffman_block_length(Array<u8, max_huffman_literals> const& literal_bit_lengths, Array<u8, max_huffman_distances> const& distance_bit_lengths)
{
size_t length = 0;
@@ -807,7 +807,7 @@ size_t DeflateCompressor::fixed_block_length()
return 3 + huffman_block_length(fixed_literal_bit_lengths, fixed_distance_bit_lengths);
}
-size_t DeflateCompressor::dynamic_block_length(const Array<u8, max_huffman_literals>& literal_bit_lengths, const Array<u8, max_huffman_distances>& distance_bit_lengths, const Array<u8, 19>& code_lengths_bit_lengths, const Array<u16, 19>& code_lengths_frequencies, size_t code_lengths_count)
+size_t DeflateCompressor::dynamic_block_length(Array<u8, max_huffman_literals> const& literal_bit_lengths, Array<u8, max_huffman_distances> const& distance_bit_lengths, Array<u8, 19> const& code_lengths_bit_lengths, Array<u16, 19> const& code_lengths_frequencies, size_t code_lengths_count)
{
// block header + literal code count + distance code count + code length count
auto length = 3 + 5 + 5 + 4;
@@ -831,7 +831,7 @@ size_t DeflateCompressor::dynamic_block_length(const Array<u8, max_huffman_liter
return length + huffman_block_length(literal_bit_lengths, distance_bit_lengths);
}
-void DeflateCompressor::write_huffman(const CanonicalCode& literal_code, const Optional<CanonicalCode>& distance_code)
+void DeflateCompressor::write_huffman(CanonicalCode const& literal_code, Optional<CanonicalCode> const& distance_code)
{
auto has_distances = distance_code.has_value();
for (size_t i = 0; i < m_pending_symbol_size; i++) {
@@ -852,7 +852,7 @@ void DeflateCompressor::write_huffman(const CanonicalCode& literal_code, const O
}
}
-size_t DeflateCompressor::encode_huffman_lengths(const Array<u8, max_huffman_literals + max_huffman_distances>& lengths, size_t lengths_count, Array<code_length_symbol, max_huffman_literals + max_huffman_distances>& encoded_lengths)
+size_t DeflateCompressor::encode_huffman_lengths(Array<u8, max_huffman_literals + max_huffman_distances> const& lengths, size_t lengths_count, Array<code_length_symbol, max_huffman_literals + max_huffman_distances>& encoded_lengths)
{
size_t encoded_count = 0;
size_t i = 0;
@@ -895,7 +895,7 @@ size_t DeflateCompressor::encode_huffman_lengths(const Array<u8, max_huffman_lit
return encoded_count;
}
-size_t DeflateCompressor::encode_block_lengths(const Array<u8, max_huffman_literals>& literal_bit_lengths, const Array<u8, max_huffman_distances>& distance_bit_lengths, Array<code_length_symbol, max_huffman_literals + max_huffman_distances>& encoded_lengths, size_t& literal_code_count, size_t& distance_code_count)
+size_t DeflateCompressor::encode_block_lengths(Array<u8, max_huffman_literals> const& literal_bit_lengths, Array<u8, max_huffman_distances> const& distance_bit_lengths, Array<code_length_symbol, max_huffman_literals + max_huffman_distances>& encoded_lengths, size_t& literal_code_count, size_t& distance_code_count)
{
literal_code_count = max_huffman_literals;
distance_code_count = max_huffman_distances;
@@ -920,7 +920,7 @@ size_t DeflateCompressor::encode_block_lengths(const Array<u8, max_huffman_liter
return encode_huffman_lengths(all_lengths, lengths_count, encoded_lengths);
}
-void DeflateCompressor::write_dynamic_huffman(const CanonicalCode& literal_code, size_t literal_code_count, const Optional<CanonicalCode>& distance_code, size_t distance_code_count, const Array<u8, 19>& code_lengths_bit_lengths, size_t code_length_count, const Array<code_length_symbol, max_huffman_literals + max_huffman_distances>& encoded_lengths, size_t encoded_lengths_count)
+void DeflateCompressor::write_dynamic_huffman(CanonicalCode const& literal_code, size_t literal_code_count, Optional<CanonicalCode> const& distance_code, size_t distance_code_count, Array<u8, 19> const& code_lengths_bit_lengths, size_t code_length_count, Array<code_length_symbol, max_huffman_literals + max_huffman_distances> const& encoded_lengths, size_t encoded_lengths_count)
{
m_output_stream.write_bits(literal_code_count - 257, 5);
m_output_stream.write_bits(distance_code_count - 1, 5);
diff --git a/Userland/Libraries/LibCompress/Deflate.h b/Userland/Libraries/LibCompress/Deflate.h
index 9d9b51de8b..85e5a811dd 100644
--- a/Userland/Libraries/LibCompress/Deflate.h
+++ b/Userland/Libraries/LibCompress/Deflate.h
@@ -22,8 +22,8 @@ public:
u32 read_symbol(InputBitStream&) const;
void write_symbol(OutputBitStream&, u32) const;
- static const CanonicalCode& fixed_literal_codes();
- static const CanonicalCode& fixed_distance_codes();
+ static CanonicalCode const& fixed_literal_codes();
+ static CanonicalCode const& fixed_distance_codes();
static Optional<CanonicalCode> from_bytes(ReadonlyBytes);
@@ -157,7 +157,7 @@ private:
Bytes pending_block() { return { m_rolling_window + block_size, block_size }; }
// LZ77 Compression
- static u16 hash_sequence(const u8* bytes);
+ static u16 hash_sequence(u8 const* bytes);
size_t compare_match_candidate(size_t start, size_t candidate, size_t prev_match_length, size_t max_match_length);
size_t find_back_match(size_t start, u16 hash, size_t previous_match_length, size_t max_match_length, size_t& match_position);
void lz77_compress_block();
@@ -169,16 +169,16 @@ private:
};
static u8 distance_to_base(u16 distance);
template<size_t Size>
- static void generate_huffman_lengths(Array<u8, Size>& lengths, const Array<u16, Size>& frequencies, size_t max_bit_length, u16 frequency_cap = UINT16_MAX);
- size_t huffman_block_length(const Array<u8, max_huffman_literals>& literal_bit_lengths, const Array<u8, max_huffman_distances>& distance_bit_lengths);
- void write_huffman(const CanonicalCode& literal_code, const Optional<CanonicalCode>& distance_code);
- static size_t encode_huffman_lengths(const Array<u8, max_huffman_literals + max_huffman_distances>& lengths, size_t lengths_count, Array<code_length_symbol, max_huffman_literals + max_huffman_distances>& encoded_lengths);
- size_t encode_block_lengths(const Array<u8, max_huffman_literals>& literal_bit_lengths, const Array<u8, max_huffman_distances>& distance_bit_lengths, Array<code_length_symbol, max_huffman_literals + max_huffman_distances>& encoded_lengths, size_t& literal_code_count, size_t& distance_code_count);
- void write_dynamic_huffman(const CanonicalCode& literal_code, size_t literal_code_count, const Optional<CanonicalCode>& distance_code, size_t distance_code_count, const Array<u8, 19>& code_lengths_bit_lengths, size_t code_length_count, const Array<code_length_symbol, max_huffman_literals + max_huffman_distances>& encoded_lengths, size_t encoded_lengths_count);
+ static void generate_huffman_lengths(Array<u8, Size>& lengths, Array<u16, Size> const& frequencies, size_t max_bit_length, u16 frequency_cap = UINT16_MAX);
+ size_t huffman_block_length(Array<u8, max_huffman_literals> const& literal_bit_lengths, Array<u8, max_huffman_distances> const& distance_bit_lengths);
+ void write_huffman(CanonicalCode const& literal_code, Optional<CanonicalCode> const& distance_code);
+ static size_t encode_huffman_lengths(Array<u8, max_huffman_literals + max_huffman_distances> const& lengths, size_t lengths_count, Array<code_length_symbol, max_huffman_literals + max_huffman_distances>& encoded_lengths);
+ size_t encode_block_lengths(Array<u8, max_huffman_literals> const& literal_bit_lengths, Array<u8, max_huffman_distances> const& distance_bit_lengths, Array<code_length_symbol, max_huffman_literals + max_huffman_distances>& encoded_lengths, size_t& literal_code_count, size_t& distance_code_count);
+ void write_dynamic_huffman(CanonicalCode const& literal_code, size_t literal_code_count, Optional<CanonicalCode> const& distance_code, size_t distance_code_count, Array<u8, 19> const& code_lengths_bit_lengths, size_t code_length_count, Array<code_length_symbol, max_huffman_literals + max_huffman_distances> const& encoded_lengths, size_t encoded_lengths_count);
size_t uncompressed_block_length();
size_t fixed_block_length();
- size_t dynamic_block_length(const Array<u8, max_huffman_literals>& literal_bit_lengths, const Array<u8, max_huffman_distances>& distance_bit_lengths, const Array<u8, 19>& code_lengths_bit_lengths, const Array<u16, 19>& code_lengths_frequencies, size_t code_lengths_count);
+ size_t dynamic_block_length(Array<u8, max_huffman_literals> const& literal_bit_lengths, Array<u8, max_huffman_distances> const& distance_bit_lengths, Array<u8, 19> const& code_lengths_bit_lengths, Array<u16, 19> const& code_lengths_frequencies, size_t code_lengths_count);
void flush();
bool m_finished { false };
diff --git a/Userland/Libraries/LibCompress/Gzip.cpp b/Userland/Libraries/LibCompress/Gzip.cpp
index f93554d272..924bb7bc9b 100644
--- a/Userland/Libraries/LibCompress/Gzip.cpp
+++ b/Userland/Libraries/LibCompress/Gzip.cpp
@@ -159,11 +159,11 @@ Optional<String> GzipDecompressor::describe_header(ReadonlyBytes bytes)
if (bytes.size() < sizeof(BlockHeader))
return {};
- auto& header = *(reinterpret_cast<const BlockHeader*>(bytes.data()));
+ auto& header = *(reinterpret_cast<BlockHeader const*>(bytes.data()));
if (!header.valid_magic_number() || !header.supported_by_implementation())
return {};
- LittleEndian<u32> original_size = *reinterpret_cast<const u32*>(bytes.offset(bytes.size() - sizeof(u32)));
+ LittleEndian<u32> original_size = *reinterpret_cast<u32 const*>(bytes.offset(bytes.size() - sizeof(u32)));
return String::formatted("last modified: {}, original size {}", Core::DateTime::from_timestamp(header.modification_time).to_string(), (u32)original_size);
}
@@ -202,7 +202,7 @@ Optional<ByteBuffer> GzipDecompressor::decompress_all(ReadonlyBytes bytes)
u8 buffer[4096];
while (!gzip_stream.has_any_error() && !gzip_stream.unreliable_eof()) {
- const auto nread = gzip_stream.read({ buffer, sizeof(buffer) });
+ auto const nread = gzip_stream.read({ buffer, sizeof(buffer) });
output_stream.write_or_error({ buffer, nread });
}
diff --git a/Userland/Libraries/LibCompress/Gzip.h b/Userland/Libraries/LibCompress/Gzip.h
index e25b6b0813..c043bcadc4 100644
--- a/Userland/Libraries/LibCompress/Gzip.h
+++ b/Userland/Libraries/LibCompress/Gzip.h
@@ -68,7 +68,7 @@ private:
size_t m_nread { 0 };
};
- const Member& current_member() const { return m_current_member.value(); }
+ Member const& current_member() const { return m_current_member.value(); }
Member& current_member() { return m_current_member.value(); }
InputStream& m_input_stream;
diff --git a/Userland/Libraries/LibConfig/Client.cpp b/Userland/Libraries/LibConfig/Client.cpp
index 7b821523dc..2ad0afcc1d 100644
--- a/Userland/Libraries/LibConfig/Client.cpp
+++ b/Userland/Libraries/LibConfig/Client.cpp
@@ -96,7 +96,7 @@ void Client::notify_changed_bool_value(String const& domain, String const& group
});
}
-void Client::notify_removed_key(const String& domain, const String& group, const String& key)
+void Client::notify_removed_key(String const& domain, String const& group, String const& key)
{
Listener::for_each([&](auto& listener) {
listener.config_key_was_removed(domain, group, key);
diff --git a/Userland/Libraries/LibCore/Account.cpp b/Userland/Libraries/LibCore/Account.cpp
index 5d935c7b3a..12e22d3b82 100644
--- a/Userland/Libraries/LibCore/Account.cpp
+++ b/Userland/Libraries/LibCore/Account.cpp
@@ -38,7 +38,7 @@ static String get_salt()
return builder.build();
}
-static Vector<gid_t> get_extra_gids(const passwd& pwd)
+static Vector<gid_t> get_extra_gids(passwd const& pwd)
{
StringView username { pwd.pw_name };
Vector<gid_t> extra_gids;
@@ -57,7 +57,7 @@ static Vector<gid_t> get_extra_gids(const passwd& pwd)
return extra_gids;
}
-ErrorOr<Account> Account::from_passwd(const passwd& pwd, const spwd& spwd)
+ErrorOr<Account> Account::from_passwd(passwd const& pwd, spwd const& spwd)
{
Account account(pwd, spwd, get_extra_gids(pwd));
endpwent();
@@ -88,7 +88,7 @@ ErrorOr<Account> Account::self([[maybe_unused]] Read options)
return Account(*pwd, spwd, extra_gids);
}
-ErrorOr<Account> Account::from_name(const char* username, [[maybe_unused]] Read options)
+ErrorOr<Account> Account::from_name(char const* username, [[maybe_unused]] Read options)
{
auto pwd = TRY(Core::System::getpwnam(username));
if (!pwd.has_value())
@@ -175,7 +175,7 @@ void Account::delete_password()
m_password_hash = "";
}
-Account::Account(const passwd& pwd, const spwd& spwd, Vector<gid_t> extra_gids)
+Account::Account(passwd const& pwd, spwd const& spwd, Vector<gid_t> extra_gids)
: m_username(pwd.pw_name)
, m_password_hash(spwd.sp_pwdp)
, m_uid(pwd.pw_uid)
diff --git a/Userland/Libraries/LibCore/Account.h b/Userland/Libraries/LibCore/Account.h
index decf46ede0..5cbd7253ec 100644
--- a/Userland/Libraries/LibCore/Account.h
+++ b/Userland/Libraries/LibCore/Account.h
@@ -46,11 +46,11 @@ public:
// You must call sync to apply changes.
void set_password(SecretString const& password);
void set_password_enabled(bool enabled);
- void set_home_directory(const char* home_directory) { m_home_directory = home_directory; }
+ void set_home_directory(char const* home_directory) { m_home_directory = home_directory; }
void set_uid(uid_t uid) { m_uid = uid; }
void set_gid(gid_t gid) { m_gid = gid; }
- void set_shell(const char* shell) { m_shell = shell; }
- void set_gecos(const char* gecos) { m_gecos = gecos; }
+ void set_shell(char const* shell) { m_shell = shell; }
+ void set_gecos(char const* gecos) { m_gecos = gecos; }
void delete_password();
// A null password means that this account was missing from /etc/shadow.
@@ -59,17 +59,17 @@ public:
uid_t uid() const { return m_uid; }
gid_t gid() const { return m_gid; }
- const String& gecos() const { return m_gecos; }
- const String& home_directory() const { return m_home_directory; }
- const String& shell() const { return m_shell; }
- const Vector<gid_t>& extra_gids() const { return m_extra_gids; }
+ String const& gecos() const { return m_gecos; }
+ String const& home_directory() const { return m_home_directory; }
+ String const& shell() const { return m_shell; }
+ Vector<gid_t> const& extra_gids() const { return m_extra_gids; }
ErrorOr<void> sync();
private:
static ErrorOr<Account> from_passwd(passwd const&, spwd const&);
- Account(const passwd& pwd, const spwd& spwd, Vector<gid_t> extra_gids);
+ Account(passwd const& pwd, spwd const& spwd, Vector<gid_t> extra_gids);
ErrorOr<String> generate_passwd_file() const;
#ifndef AK_OS_BSD_GENERIC
diff --git a/Userland/Libraries/LibCore/AnonymousBuffer.h b/Userland/Libraries/LibCore/AnonymousBuffer.h
index 895bfec464..a0fd5bc76d 100644
--- a/Userland/Libraries/LibCore/AnonymousBuffer.h
+++ b/Userland/Libraries/LibCore/AnonymousBuffer.h
@@ -24,7 +24,7 @@ public:
int fd() const { return m_fd; }
size_t size() const { return m_size; }
void* data() { return m_data; }
- const void* data() const { return m_data; }
+ void const* data() const { return m_data; }
private:
AnonymousBufferImpl(int fd, size_t, void*);
@@ -74,7 +74,7 @@ private:
namespace IPC {
-bool encode(Encoder&, const Core::AnonymousBuffer&);
+bool encode(Encoder&, Core::AnonymousBuffer const&);
ErrorOr<void> decode(Decoder&, Core::AnonymousBuffer&);
}
diff --git a/Userland/Libraries/LibCore/ArgsParser.cpp b/Userland/Libraries/LibCore/ArgsParser.cpp
index a339b8a0bd..ced9d32548 100644
--- a/Userland/Libraries/LibCore/ArgsParser.cpp
+++ b/Userland/Libraries/LibCore/ArgsParser.cpp
@@ -16,7 +16,7 @@
#include <stdio.h>
#include <string.h>
-static Optional<double> convert_to_double(const char* s)
+static Optional<double> convert_to_double(char const* s)
{
char* p;
double v = strtod(s, &p);
@@ -103,7 +103,7 @@ bool ArgsParser::parse(int argc, char* const* argv, FailureBehavior failure_beha
}
VERIFY(found_option);
- const char* arg = found_option->requires_argument ? optarg : nullptr;
+ char const* arg = found_option->requires_argument ? optarg : nullptr;
if (!found_option->accept_value(arg)) {
warnln("\033[31mInvalid value for option \033[1m{}\033[22m\033[0m", found_option->name_for_display());
fail();
@@ -171,7 +171,7 @@ bool ArgsParser::parse(int argc, char* const* argv, FailureBehavior failure_beha
for (size_t i = 0; i < m_positional_args.size(); i++) {
auto& arg = m_positional_args[i];
for (int j = 0; j < num_values_for_arg[i]; j++) {
- const char* value = argv[optind++];
+ char const* value = argv[optind++];
if (!arg.accept_value(value)) {
warnln("Invalid value for argument {}", arg.name);
fail();
@@ -183,7 +183,7 @@ bool ArgsParser::parse(int argc, char* const* argv, FailureBehavior failure_beha
return true;
}
-void ArgsParser::print_usage(FILE* file, const char* argv0)
+void ArgsParser::print_usage(FILE* file, char const* argv0)
{
char const* env_preference = getenv("ARGSPARSER_EMIT_MARKDOWN");
if (env_preference != nullptr && env_preference[0] == '1' && env_preference[1] == 0) {
@@ -193,7 +193,7 @@ void ArgsParser::print_usage(FILE* file, const char* argv0)
}
}
-void ArgsParser::print_usage_terminal(FILE* file, const char* argv0)
+void ArgsParser::print_usage_terminal(FILE* file, char const* argv0)
{
out(file, "Usage:\n\t\033[1m{}\033[0m", argv0);
@@ -264,7 +264,7 @@ void ArgsParser::print_usage_terminal(FILE* file, const char* argv0)
}
}
-void ArgsParser::print_usage_markdown(FILE* file, const char* argv0)
+void ArgsParser::print_usage_markdown(FILE* file, char const* argv0)
{
outln(file, "## Name\n\n{}", argv0);
@@ -347,7 +347,7 @@ void ArgsParser::add_option(Option&& option)
m_options.append(move(option));
}
-void ArgsParser::add_ignored(const char* long_name, char short_name, bool hidden)
+void ArgsParser::add_ignored(char const* long_name, char short_name, bool hidden)
{
Option option {
false,
@@ -355,7 +355,7 @@ void ArgsParser::add_ignored(const char* long_name, char short_name, bool hidden
long_name,
short_name,
nullptr,
- [](const char*) {
+ [](char const*) {
return true;
},
hidden,
@@ -363,7 +363,7 @@ void ArgsParser::add_ignored(const char* long_name, char short_name, bool hidden
add_option(move(option));
}
-void ArgsParser::add_option(bool& value, const char* help_string, const char* long_name, char short_name, bool hidden)
+void ArgsParser::add_option(bool& value, char const* help_string, char const* long_name, char short_name, bool hidden)
{
Option option {
false,
@@ -371,7 +371,7 @@ void ArgsParser::add_option(bool& value, const char* help_string, const char* lo
long_name,
short_name,
nullptr,
- [&value](const char* s) {
+ [&value](char const* s) {
VERIFY(s == nullptr);
value = true;
return true;
@@ -381,7 +381,7 @@ void ArgsParser::add_option(bool& value, const char* help_string, const char* lo
add_option(move(option));
}
-void ArgsParser::add_option(const char*& value, const char* help_string, const char* long_name, char short_name, const char* value_name, bool hidden)
+void ArgsParser::add_option(char const*& value, char const* help_string, char const* long_name, char short_name, char const* value_name, bool hidden)
{
Option option {
true,
@@ -389,7 +389,7 @@ void ArgsParser::add_option(const char*& value, const char* help_string, const c
long_name,
short_name,
value_name,
- [&value](const char* s) {
+ [&value](char const* s) {
value = s;
return true;
},
@@ -398,7 +398,7 @@ void ArgsParser::add_option(const char*& value, const char* help_string, const c
add_option(move(option));
}
-void ArgsParser::add_option(String& value, const char* help_string, const char* long_name, char short_name, const char* value_name, bool hidden)
+void ArgsParser::add_option(String& value, char const* help_string, char const* long_name, char short_name, char const* value_name, bool hidden)
{
Option option {
true,
@@ -406,7 +406,7 @@ void ArgsParser::add_option(String& value, const char* help_string, const char*
long_name,
short_name,
value_name,
- [&value](const char* s) {
+ [&value](char const* s) {
value = s;
return true;
},
@@ -423,7 +423,7 @@ void ArgsParser::add_option(StringView& value, char const* help_string, char con
long_name,
short_name,
value_name,
- [&value](const char* s) {
+ [&value](char const* s) {
value = s;
return true;
},
@@ -432,7 +432,7 @@ void ArgsParser::add_option(StringView& value, char const* help_string, char con
add_option(move(option));
}
-void ArgsParser::add_option(int& value, const char* help_string, const char* long_name, char short_name, const char* value_name, bool hidden)
+void ArgsParser::add_option(int& value, char const* help_string, char const* long_name, char short_name, char const* value_name, bool hidden)
{
Option option {
true,
@@ -440,7 +440,7 @@ void ArgsParser::add_option(int& value, const char* help_string, const char* lon
long_name,
short_name,
value_name,
- [&value](const char* s) {
+ [&value](char const* s) {
auto opt = StringView(s).to_int();
value = opt.value_or(0);
return opt.has_value();
@@ -450,7 +450,7 @@ void ArgsParser::add_option(int& value, const char* help_string, const char* lon
add_option(move(option));
}
-void ArgsParser::add_option(unsigned& value, const char* help_string, const char* long_name, char short_name, const char* value_name, bool hidden)
+void ArgsParser::add_option(unsigned& value, char const* help_string, char const* long_name, char short_name, char const* value_name, bool hidden)
{
Option option {
true,
@@ -458,7 +458,7 @@ void ArgsParser::add_option(unsigned& value, const char* help_string, const char
long_name,
short_name,
value_name,
- [&value](const char* s) {
+ [&value](char const* s) {
auto opt = StringView(s).to_uint();
value = opt.value_or(0);
return opt.has_value();
@@ -468,7 +468,7 @@ void ArgsParser::add_option(unsigned& value, const char* help_string, const char
add_option(move(option));
}
-void ArgsParser::add_option(double& value, const char* help_string, const char* long_name, char short_name, const char* value_name, bool hidden)
+void ArgsParser::add_option(double& value, char const* help_string, char const* long_name, char short_name, char const* value_name, bool hidden)
{
Option option {
true,
@@ -476,7 +476,7 @@ void ArgsParser::add_option(double& value, const char* help_string, const char*
long_name,
short_name,
value_name,
- [&value](const char* s) {
+ [&value](char const* s) {
auto opt = convert_to_double(s);
value = opt.value_or(0.0);
return opt.has_value();
@@ -486,7 +486,7 @@ void ArgsParser::add_option(double& value, const char* help_string, const char*
add_option(move(option));
}
-void ArgsParser::add_option(Optional<double>& value, const char* help_string, const char* long_name, char short_name, const char* value_name, bool hidden)
+void ArgsParser::add_option(Optional<double>& value, char const* help_string, char const* long_name, char short_name, char const* value_name, bool hidden)
{
Option option {
true,
@@ -494,7 +494,7 @@ void ArgsParser::add_option(Optional<double>& value, const char* help_string, co
long_name,
short_name,
value_name,
- [&value](const char* s) {
+ [&value](char const* s) {
value = convert_to_double(s);
return value.has_value();
},
@@ -503,7 +503,7 @@ void ArgsParser::add_option(Optional<double>& value, const char* help_string, co
add_option(move(option));
}
-void ArgsParser::add_option(Optional<size_t>& value, const char* help_string, const char* long_name, char short_name, const char* value_name, bool hidden)
+void ArgsParser::add_option(Optional<size_t>& value, char const* help_string, char const* long_name, char short_name, char const* value_name, bool hidden)
{
Option option {
true,
@@ -511,7 +511,7 @@ void ArgsParser::add_option(Optional<size_t>& value, const char* help_string, co
long_name,
short_name,
value_name,
- [&value](const char* s) {
+ [&value](char const* s) {
value = AK::StringUtils::convert_to_uint<size_t>(s);
return value.has_value();
},
@@ -551,14 +551,14 @@ void ArgsParser::add_positional_argument(Arg&& arg)
m_positional_args.append(move(arg));
}
-void ArgsParser::add_positional_argument(const char*& value, const char* help_string, const char* name, Required required)
+void ArgsParser::add_positional_argument(char const*& value, char const* help_string, char const* name, Required required)
{
Arg arg {
help_string,
name,
required == Required::Yes ? 1 : 0,
1,
- [&value](const char* s) {
+ [&value](char const* s) {
value = s;
return true;
}
@@ -566,14 +566,14 @@ void ArgsParser::add_positional_argument(const char*& value, const char* help_st
add_positional_argument(move(arg));
}
-void ArgsParser::add_positional_argument(String& value, const char* help_string, const char* name, Required required)
+void ArgsParser::add_positional_argument(String& value, char const* help_string, char const* name, Required required)
{
Arg arg {
help_string,
name,
required == Required::Yes ? 1 : 0,
1,
- [&value](const char* s) {
+ [&value](char const* s) {
value = s;
return true;
}
@@ -588,7 +588,7 @@ void ArgsParser::add_positional_argument(StringView& value, char const* help_str
name,
required == Required::Yes ? 1 : 0,
1,
- [&value](const char* s) {
+ [&value](char const* s) {
value = s;
return true;
}
@@ -596,14 +596,14 @@ void ArgsParser::add_positional_argument(StringView& value, char const* help_str
add_positional_argument(move(arg));
}
-void ArgsParser::add_positional_argument(int& value, const char* help_string, const char* name, Required required)
+void ArgsParser::add_positional_argument(int& value, char const* help_string, char const* name, Required required)
{
Arg arg {
help_string,
name,
required == Required::Yes ? 1 : 0,
1,
- [&value](const char* s) {
+ [&value](char const* s) {
auto opt = StringView(s).to_int();
value = opt.value_or(0);
return opt.has_value();
@@ -612,14 +612,14 @@ void ArgsParser::add_positional_argument(int& value, const char* help_string, co
add_positional_argument(move(arg));
}
-void ArgsParser::add_positional_argument(unsigned& value, const char* help_string, const char* name, Required required)
+void ArgsParser::add_positional_argument(unsigned& value, char const* help_string, char const* name, Required required)
{
Arg arg {
help_string,
name,
required == Required::Yes ? 1 : 0,
1,
- [&value](const char* s) {
+ [&value](char const* s) {
auto opt = StringView(s).to_uint();
value = opt.value_or(0);
return opt.has_value();
@@ -628,14 +628,14 @@ void ArgsParser::add_positional_argument(unsigned& value, const char* help_strin
add_positional_argument(move(arg));
}
-void ArgsParser::add_positional_argument(double& value, const char* help_string, const char* name, Required required)
+void ArgsParser::add_positional_argument(double& value, char const* help_string, char const* name, Required required)
{
Arg arg {
help_string,
name,
required == Required::Yes ? 1 : 0,
1,
- [&value](const char* s) {
+ [&value](char const* s) {
auto opt = convert_to_double(s);
value = opt.value_or(0.0);
return opt.has_value();
@@ -644,14 +644,14 @@ void ArgsParser::add_positional_argument(double& value, const char* help_string,
add_positional_argument(move(arg));
}
-void ArgsParser::add_positional_argument(Vector<const char*>& values, const char* help_string, const char* name, Required required)
+void ArgsParser::add_positional_argument(Vector<char const*>& values, char const* help_string, char const* name, Required required)
{
Arg arg {
help_string,
name,
required == Required::Yes ? 1 : 0,
INT_MAX,
- [&values](const char* s) {
+ [&values](char const* s) {
values.append(s);
return true;
}
diff --git a/Userland/Libraries/LibCore/Command.cpp b/Userland/Libraries/LibCore/Command.cpp
index 25e48425a6..ab6ea80bef 100644
--- a/Userland/Libraries/LibCore/Command.cpp
+++ b/Userland/Libraries/LibCore/Command.cpp
@@ -46,13 +46,13 @@ ErrorOr<CommandResult> command(String const& program, Vector<String> const& argu
close(stderr_pipe[0]);
});
- Vector<const char*> parts = { program.characters() };
- for (const auto& part : arguments) {
+ Vector<char const*> parts = { program.characters() };
+ for (auto const& part : arguments) {
parts.append(part.characters());
}
parts.append(nullptr);
- const char** argv = parts.data();
+ char const** argv = parts.data();
posix_spawn_file_actions_t action;
posix_spawn_file_actions_init(&action);
diff --git a/Userland/Libraries/LibCore/DateTime.cpp b/Userland/Libraries/LibCore/DateTime.cpp
index 50d4153c11..41c1b7f78c 100644
--- a/Userland/Libraries/LibCore/DateTime.cpp
+++ b/Userland/Libraries/LibCore/DateTime.cpp
@@ -89,7 +89,7 @@ String DateTime::to_string(StringView format) const
struct tm tm;
localtime_r(&m_timestamp, &tm);
StringBuilder builder;
- const int format_len = format.length();
+ int const format_len = format.length();
auto format_time_zone_offset = [&](bool with_separator) {
#if defined(__serenity__)
@@ -190,20 +190,20 @@ String DateTime::to_string(StringView format) const
builder.appendff("{}", tm.tm_wday ? tm.tm_wday : 7);
break;
case 'U': {
- const int wday_of_year_beginning = (tm.tm_wday + 6 * tm.tm_yday) % 7;
- const int week_number = (tm.tm_yday + wday_of_year_beginning) / 7;
+ int const wday_of_year_beginning = (tm.tm_wday + 6 * tm.tm_yday) % 7;
+ int const week_number = (tm.tm_yday + wday_of_year_beginning) / 7;
builder.appendff("{:02}", week_number);
break;
}
case 'V': {
- const int wday_of_year_beginning = (tm.tm_wday + 6 + 6 * tm.tm_yday) % 7;
+ int const wday_of_year_beginning = (tm.tm_wday + 6 + 6 * tm.tm_yday) % 7;
int week_number = (tm.tm_yday + wday_of_year_beginning) / 7 + 1;
if (wday_of_year_beginning > 3) {
if (tm.tm_yday >= 7 - wday_of_year_beginning)
--week_number;
else {
- const int days_of_last_year = days_in_year(tm.tm_year + 1900 - 1);
- const int wday_of_last_year_beginning = (wday_of_year_beginning + 6 * days_of_last_year) % 7;
+ int const days_of_last_year = days_in_year(tm.tm_year + 1900 - 1);
+ int const wday_of_last_year_beginning = (wday_of_year_beginning + 6 * days_of_last_year) % 7;
week_number = (days_of_last_year + wday_of_last_year_beginning) / 7 + 1;
if (wday_of_last_year_beginning > 3)
--week_number;
@@ -216,8 +216,8 @@ String DateTime::to_string(StringView format) const
builder.appendff("{}", tm.tm_wday);
break;
case 'W': {
- const int wday_of_year_beginning = (tm.tm_wday + 6 + 6 * tm.tm_yday) % 7;
- const int week_number = (tm.tm_yday + wday_of_year_beginning) / 7;
+ int const wday_of_year_beginning = (tm.tm_wday + 6 + 6 * tm.tm_yday) % 7;
+ int const week_number = (tm.tm_yday + wday_of_year_beginning) / 7;
builder.appendff("{:02}", week_number);
break;
}
@@ -253,7 +253,7 @@ String DateTime::to_string(StringView format) const
return builder.build();
}
-Optional<DateTime> DateTime::parse(StringView format, const String& string)
+Optional<DateTime> DateTime::parse(StringView format, String const& string)
{
unsigned format_pos = 0;
unsigned string_pos = 0;
diff --git a/Userland/Libraries/LibCore/DateTime.h b/Userland/Libraries/LibCore/DateTime.h
index 41d8a1ad72..f8c35f133d 100644
--- a/Userland/Libraries/LibCore/DateTime.h
+++ b/Userland/Libraries/LibCore/DateTime.h
@@ -36,9 +36,9 @@ public:
static DateTime create(int year, int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0);
static DateTime now();
static DateTime from_timestamp(time_t);
- static Optional<DateTime> parse(StringView format, const String& string);
+ static Optional<DateTime> parse(StringView format, String const& string);
- bool operator<(const DateTime& other) const { return m_timestamp < other.m_timestamp; }
+ bool operator<(DateTime const& other) const { return m_timestamp < other.m_timestamp; }
private:
time_t m_timestamp { 0 };
@@ -54,7 +54,7 @@ private:
namespace IPC {
-bool encode(IPC::Encoder&, const Core::DateTime&);
+bool encode(IPC::Encoder&, Core::DateTime const&);
ErrorOr<void> decode(IPC::Decoder&, Core::DateTime&);
}
diff --git a/Userland/Libraries/LibCore/DirIterator.h b/Userland/Libraries/LibCore/DirIterator.h
index 6fca1ae502..3fdd3d613c 100644
--- a/Userland/Libraries/LibCore/DirIterator.h
+++ b/Userland/Libraries/LibCore/DirIterator.h
@@ -28,7 +28,7 @@ public:
bool has_error() const { return m_error != 0; }
int error() const { return m_error; }
- const char* error_string() const { return strerror(m_error); }
+ char const* error_string() const { return strerror(m_error); }
bool has_next();
String next_path();
String next_full_path();
diff --git a/Userland/Libraries/LibCore/Event.cpp b/Userland/Libraries/LibCore/Event.cpp
index 37cc05d95c..6faee840f1 100644
--- a/Userland/Libraries/LibCore/Event.cpp
+++ b/Userland/Libraries/LibCore/Event.cpp
@@ -25,7 +25,7 @@ Object* ChildEvent::child()
return nullptr;
}
-const Object* ChildEvent::child() const
+Object const* ChildEvent::child() const
{
if (auto ref = m_child.strong_ref())
return ref.ptr();
@@ -39,7 +39,7 @@ Object* ChildEvent::insertion_before_child()
return nullptr;
}
-const Object* ChildEvent::insertion_before_child() const
+Object const* ChildEvent::insertion_before_child() const
{
if (auto ref = m_insertion_before_child.strong_ref())
return ref.ptr();
diff --git a/Userland/Libraries/LibCore/Event.h b/Userland/Libraries/LibCore/Event.h
index 164580b0c7..fab8095cd9 100644
--- a/Userland/Libraries/LibCore/Event.h
+++ b/Userland/Libraries/LibCore/Event.h
@@ -115,10 +115,10 @@ public:
~ChildEvent() = default;
Object* child();
- const Object* child() const;
+ Object const* child() const;
Object* insertion_before_child();
- const Object* insertion_before_child() const;
+ Object const* insertion_before_child() const;
private:
WeakPtr<Object> m_child;
diff --git a/Userland/Libraries/LibCore/EventLoop.cpp b/Userland/Libraries/LibCore/EventLoop.cpp
index 76ad358f7c..c72784da63 100644
--- a/Userland/Libraries/LibCore/EventLoop.cpp
+++ b/Userland/Libraries/LibCore/EventLoop.cpp
@@ -53,8 +53,8 @@ struct EventLoopTimer {
TimerShouldFireWhenNotVisible fire_when_not_visible { TimerShouldFireWhenNotVisible::No };
WeakPtr<Object> owner;
- void reload(const Time& now);
- bool has_expired(const Time& now) const;
+ void reload(Time const& now);
+ bool has_expired(Time const& now) const;
};
struct EventLoop::Private {
@@ -208,16 +208,16 @@ private:
}
public:
- void send_response(const JsonObject& response)
+ void send_response(JsonObject const& response)
{
auto serialized = response.to_string();
u32 length = serialized.length();
// FIXME: Propagate errors
- MUST(m_socket->write({ (const u8*)&length, sizeof(length) }));
+ MUST(m_socket->write({ (u8 const*)&length, sizeof(length) }));
MUST(m_socket->write(serialized.bytes()));
}
- void handle_request(const JsonObject& request)
+ void handle_request(JsonObject const& request)
{
auto type = request.get("type").as_string_or({});
@@ -792,12 +792,12 @@ try_select_again:
}
}
-bool EventLoopTimer::has_expired(const Time& now) const
+bool EventLoopTimer::has_expired(Time const& now) const
{
return now > fire_time;
}
-void EventLoopTimer::reload(const Time& now)
+void EventLoopTimer::reload(Time const& now)
{
fire_time = now + interval;
}
diff --git a/Userland/Libraries/LibCore/File.cpp b/Userland/Libraries/LibCore/File.cpp
index 811a50dd44..8fcef0e41c 100644
--- a/Userland/Libraries/LibCore/File.cpp
+++ b/Userland/Libraries/LibCore/File.cpp
@@ -152,7 +152,7 @@ bool File::looks_like_shared_library() const
return File::looks_like_shared_library(m_filename);
}
-bool File::looks_like_shared_library(const String& filename)
+bool File::looks_like_shared_library(String const& filename)
{
return filename.ends_with(".so"sv) || filename.contains(".so."sv);
}
diff --git a/Userland/Libraries/LibCore/FileStream.h b/Userland/Libraries/LibCore/FileStream.h
index f8462397d7..13f8a1ffbd 100644
--- a/Userland/Libraries/LibCore/FileStream.h
+++ b/Userland/Libraries/LibCore/FileStream.h
@@ -40,7 +40,7 @@ public:
if (has_any_error())
return 0;
- const auto buffer = m_file->read(bytes.size());
+ auto const buffer = m_file->read(bytes.size());
return buffer.bytes().copy_to(bytes);
}
diff --git a/Userland/Libraries/LibCore/IODevice.cpp b/Userland/Libraries/LibCore/IODevice.cpp
index a0d792e85e..809a6aab58 100644
--- a/Userland/Libraries/LibCore/IODevice.cpp
+++ b/Userland/Libraries/LibCore/IODevice.cpp
@@ -22,7 +22,7 @@ IODevice::IODevice(Object* parent)
{
}
-const char* IODevice::error_string() const
+char const* IODevice::error_string() const
{
return strerror(m_error);
}
@@ -142,7 +142,7 @@ ByteBuffer IODevice::read_all()
set_eof(true);
break;
}
- data.append((const u8*)read_buffer, nread);
+ data.append((u8 const*)read_buffer, nread);
}
auto result = ByteBuffer::copy(data);
@@ -166,7 +166,7 @@ String IODevice::read_line(size_t max_size)
dbgln("IODevice::read_line: At EOF but there's more than max_size({}) buffered", max_size);
return {};
}
- auto line = String((const char*)m_buffered_data.data(), m_buffered_data.size(), Chomp);
+ auto line = String((char const*)m_buffered_data.data(), m_buffered_data.size(), Chomp);
m_buffered_data.clear();
return line;
}
@@ -272,7 +272,7 @@ bool IODevice::truncate(off_t size)
return true;
}
-bool IODevice::write(const u8* data, int size)
+bool IODevice::write(u8 const* data, int size)
{
int rc = ::write(m_fd, data, size);
if (rc < 0) {
@@ -294,7 +294,7 @@ void IODevice::set_fd(int fd)
bool IODevice::write(StringView v)
{
- return write((const u8*)v.characters_without_null_termination(), v.length());
+ return write((u8 const*)v.characters_without_null_termination(), v.length());
}
LineIterator::LineIterator(IODevice& device, bool is_end)
diff --git a/Userland/Libraries/LibCore/IODevice.h b/Userland/Libraries/LibCore/IODevice.h
index 6fb3255155..d98f4ecc42 100644
--- a/Userland/Libraries/LibCore/IODevice.h
+++ b/Userland/Libraries/LibCore/IODevice.h
@@ -23,7 +23,7 @@ class LineIterator {
public:
explicit LineIterator(IODevice&, bool is_end = false);
- bool operator==(const LineIterator& other) const { return &other == this || (at_end() && other.is_end()) || (other.at_end() && is_end()); }
+ bool operator==(LineIterator const& other) const { return &other == this || (at_end() && other.is_end()) || (other.at_end() && is_end()); }
bool is_end() const { return m_is_end; }
bool at_end() const;
@@ -81,7 +81,7 @@ public:
bool eof() const { return m_eof; }
int error() const { return m_error; }
- const char* error_string() const;
+ char const* error_string() const;
bool has_error() const { return m_error != 0; }
@@ -91,7 +91,7 @@ public:
ByteBuffer read_all();
String read_line(size_t max_size = 16384);
- bool write(const u8*, int size);
+ bool write(u8 const*, int size);
bool write(StringView);
bool truncate(off_t);
diff --git a/Userland/Libraries/LibCore/InputBitStream.h b/Userland/Libraries/LibCore/InputBitStream.h
index 573f460dbf..be0c8f9cc7 100644
--- a/Userland/Libraries/LibCore/InputBitStream.h
+++ b/Userland/Libraries/LibCore/InputBitStream.h
@@ -78,7 +78,7 @@ public:
nread += 8;
m_current_byte.clear();
} else {
- const auto bit = (m_current_byte.value() >> (7 - m_bit_offset)) & 1;
+ auto const bit = (m_current_byte.value() >> (7 - m_bit_offset)) & 1;
result <<= 1;
result |= bit;
++nread;
@@ -87,7 +87,7 @@ public:
}
} else {
// Always take this branch for booleans or u8: there's no purpose in reading more than a single bit
- const auto bit = (m_current_byte.value() >> (7 - m_bit_offset)) & 1;
+ auto const bit = (m_current_byte.value() >> (7 - m_bit_offset)) & 1;
if constexpr (IsSame<bool, T>)
result = bit;
else {
diff --git a/Userland/Libraries/LibCore/LocalServer.cpp b/Userland/Libraries/LibCore/LocalServer.cpp
index e1f4ab1a51..9bbd878a83 100644
--- a/Userland/Libraries/LibCore/LocalServer.cpp
+++ b/Userland/Libraries/LibCore/LocalServer.cpp
@@ -61,7 +61,7 @@ void LocalServer::setup_notifier()
};
}
-bool LocalServer::listen(const String& address)
+bool LocalServer::listen(String const& address)
{
if (m_listening)
return false;
@@ -92,7 +92,7 @@ bool LocalServer::listen(const String& address)
return false;
}
auto un = un_optional.value();
- rc = ::bind(m_fd, (const sockaddr*)&un, sizeof(un));
+ rc = ::bind(m_fd, (sockaddr const*)&un, sizeof(un));
if (rc < 0) {
perror("bind");
return false;
diff --git a/Userland/Libraries/LibCore/LocalServer.h b/Userland/Libraries/LibCore/LocalServer.h
index 209fb0547b..8554ec5937 100644
--- a/Userland/Libraries/LibCore/LocalServer.h
+++ b/Userland/Libraries/LibCore/LocalServer.h
@@ -19,7 +19,7 @@ public:
ErrorOr<void> take_over_from_system_server(String const& path = String());
bool is_listening() const { return m_listening; }
- bool listen(const String& address);
+ bool listen(String const& address);
ErrorOr<NonnullOwnPtr<Stream::LocalSocket>> accept();
diff --git a/Userland/Libraries/LibCore/MappedFile.h b/Userland/Libraries/LibCore/MappedFile.h
index 7048caf995..d0fbbbd59c 100644
--- a/Userland/Libraries/LibCore/MappedFile.h
+++ b/Userland/Libraries/LibCore/MappedFile.h
@@ -24,7 +24,7 @@ public:
~MappedFile();
void* data() { return m_data; }
- const void* data() const { return m_data; }
+ void const* data() const { return m_data; }
size_t size() const { return m_size; }
diff --git a/Userland/Libraries/LibCore/MemoryStream.h b/Userland/Libraries/LibCore/MemoryStream.h
index 5eeb066acf..465da44f9f 100644
--- a/Userland/Libraries/LibCore/MemoryStream.h
+++ b/Userland/Libraries/LibCore/MemoryStream.h
@@ -68,7 +68,7 @@ public:
virtual ErrorOr<size_t> write(ReadonlyBytes bytes) override
{
// FIXME: Can this not error?
- const auto nwritten = bytes.copy_trimmed_to(m_bytes.slice(m_offset));
+ auto const nwritten = bytes.copy_trimmed_to(m_bytes.slice(m_offset));
m_offset += nwritten;
return nwritten;
}
diff --git a/Userland/Libraries/LibCore/MimeData.cpp b/Userland/Libraries/LibCore/MimeData.cpp
index 6e57cee162..ae94d041f9 100644
--- a/Userland/Libraries/LibCore/MimeData.cpp
+++ b/Userland/Libraries/LibCore/MimeData.cpp
@@ -31,7 +31,7 @@ Vector<URL> MimeData::urls() const
return urls;
}
-void MimeData::set_urls(const Vector<URL>& urls)
+void MimeData::set_urls(Vector<URL> const& urls)
{
StringBuilder builder;
for (auto& url : urls) {
@@ -46,7 +46,7 @@ String MimeData::text() const
return String::copy(m_data.get("text/plain").value_or({}));
}
-void MimeData::set_text(const String& text)
+void MimeData::set_text(String const& text)
{
set_data("text/plain", text.to_byte_buffer());
}
diff --git a/Userland/Libraries/LibCore/MimeData.h b/Userland/Libraries/LibCore/MimeData.h
index d3f6b05df8..f94d6b61c9 100644
--- a/Userland/Libraries/LibCore/MimeData.h
+++ b/Userland/Libraries/LibCore/MimeData.h
@@ -20,27 +20,27 @@ class MimeData : public Object {
public:
virtual ~MimeData() = default;
- ByteBuffer data(const String& mime_type) const { return m_data.get(mime_type).value_or({}); }
- void set_data(const String& mime_type, ByteBuffer&& data) { m_data.set(mime_type, move(data)); }
+ ByteBuffer data(String const& mime_type) const { return m_data.get(mime_type).value_or({}); }
+ void set_data(String const& mime_type, ByteBuffer&& data) { m_data.set(mime_type, move(data)); }
- bool has_format(const String& mime_type) const { return m_data.contains(mime_type); }
+ bool has_format(String const& mime_type) const { return m_data.contains(mime_type); }
Vector<String> formats() const;
// Convenience helpers for "text/plain"
bool has_text() const { return has_format("text/plain"); }
String text() const;
- void set_text(const String&);
+ void set_text(String const&);
// Convenience helpers for "text/uri-list"
bool has_urls() const { return has_format("text/uri-list"); }
Vector<URL> urls() const;
- void set_urls(const Vector<URL>&);
+ void set_urls(Vector<URL> const&);
- const HashMap<String, ByteBuffer>& all_data() const { return m_data; }
+ HashMap<String, ByteBuffer> const& all_data() const { return m_data; }
private:
MimeData() = default;
- explicit MimeData(const HashMap<String, ByteBuffer>& data)
+ explicit MimeData(HashMap<String, ByteBuffer> const& data)
: m_data(data)
{
}
diff --git a/Userland/Libraries/LibCore/NetworkJob.cpp b/Userland/Libraries/LibCore/NetworkJob.cpp
index 9c031f4f39..8a18f85002 100644
--- a/Userland/Libraries/LibCore/NetworkJob.cpp
+++ b/Userland/Libraries/LibCore/NetworkJob.cpp
@@ -69,7 +69,7 @@ void NetworkJob::did_progress(Optional<u32> total_size, u32 downloaded)
on_progress(total_size, downloaded);
}
-const char* to_string(NetworkJob::Error error)
+char const* to_string(NetworkJob::Error error)
{
switch (error) {
case NetworkJob::Error::ProtocolFailed:
diff --git a/Userland/Libraries/LibCore/NetworkJob.h b/Userland/Libraries/LibCore/NetworkJob.h
index 84bdc2dbc4..878dc33db8 100644
--- a/Userland/Libraries/LibCore/NetworkJob.h
+++ b/Userland/Libraries/LibCore/NetworkJob.h
@@ -28,7 +28,7 @@ public:
virtual ~NetworkJob() override = default;
// Could fire twice, after Headers and after Trailers!
- Function<void(const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> response_code)> on_headers_received;
+ Function<void(HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers, Optional<u32> response_code)> on_headers_received;
Function<void(bool success)> on_finish;
Function<void(Optional<u32>, u32)> on_progress;
@@ -36,7 +36,7 @@ public:
bool has_error() const { return m_error != Error::None; }
Error error() const { return m_error; }
NetworkResponse* response() { return m_response.ptr(); }
- const NetworkResponse* response() const { return m_response.ptr(); }
+ NetworkResponse const* response() const { return m_response.ptr(); }
enum class ShutdownMode {
DetachFromSocket,
@@ -66,7 +66,7 @@ private:
Error m_error { Error::None };
};
-const char* to_string(NetworkJob::Error);
+char const* to_string(NetworkJob::Error);
}
diff --git a/Userland/Libraries/LibCore/Object.cpp b/Userland/Libraries/LibCore/Object.cpp
index 62f9d54939..f0c5dcf1be 100644
--- a/Userland/Libraries/LibCore/Object.cpp
+++ b/Userland/Libraries/LibCore/Object.cpp
@@ -198,7 +198,7 @@ bool Object::set_property(String const& name, JsonValue const& value)
return it->value->set(value);
}
-bool Object::is_ancestor_of(const Object& other) const
+bool Object::is_ancestor_of(Object const& other) const
{
if (&other == this)
return false;
@@ -247,7 +247,7 @@ void Object::decrement_inspector_count(Badge<InspectorServerConnection>)
did_end_inspection();
}
-void Object::register_property(const String& name, Function<JsonValue()> getter, Function<bool(const JsonValue&)> setter)
+void Object::register_property(String const& name, Function<JsonValue()> getter, Function<bool(JsonValue const&)> setter)
{
m_properties.set(name, make<Property>(name, move(getter), move(setter)));
}
@@ -271,7 +271,7 @@ ObjectClassRegistration::ObjectClassRegistration(StringView class_name, Function
object_classes().set(class_name, this);
}
-bool ObjectClassRegistration::is_derived_from(const ObjectClassRegistration& base_class) const
+bool ObjectClassRegistration::is_derived_from(ObjectClassRegistration const& base_class) const
{
if (&base_class == this)
return true;
@@ -280,14 +280,14 @@ bool ObjectClassRegistration::is_derived_from(const ObjectClassRegistration& bas
return m_parent_class->is_derived_from(base_class);
}
-void ObjectClassRegistration::for_each(Function<void(const ObjectClassRegistration&)> callback)
+void ObjectClassRegistration::for_each(Function<void(ObjectClassRegistration const&)> callback)
{
for (auto& it : object_classes()) {
callback(*it.value);
}
}
-const ObjectClassRegistration* ObjectClassRegistration::find(StringView class_name)
+ObjectClassRegistration const* ObjectClassRegistration::find(StringView class_name)
{
return object_classes().get(class_name).value_or(nullptr);
}
diff --git a/Userland/Libraries/LibCore/Object.h b/Userland/Libraries/LibCore/Object.h
index c5511b3b8e..bad2ae50de 100644
--- a/Userland/Libraries/LibCore/Object.h
+++ b/Userland/Libraries/LibCore/Object.h
@@ -45,12 +45,12 @@ public:
~ObjectClassRegistration() = default;
StringView class_name() const { return m_class_name; }
- const ObjectClassRegistration* parent_class() const { return m_parent_class; }
+ ObjectClassRegistration const* parent_class() const { return m_parent_class; }
RefPtr<Object> construct() const { return m_factory(); }
- bool is_derived_from(const ObjectClassRegistration& base_class) const;
+ bool is_derived_from(ObjectClassRegistration const& base_class) const;
- static void for_each(Function<void(const ObjectClassRegistration&)>);
- static const ObjectClassRegistration* find(StringView class_name);
+ static void for_each(Function<void(ObjectClassRegistration const&)>);
+ static ObjectClassRegistration const* find(StringView class_name);
private:
StringView m_class_name;
@@ -98,11 +98,11 @@ public:
virtual StringView class_name() const = 0;
- const String& name() const { return m_name; }
+ String const& name() const { return m_name; }
void set_name(String name) { m_name = move(name); }
NonnullRefPtrVector<Object>& children() { return m_children; }
- const NonnullRefPtrVector<Object>& children() const { return m_children; }
+ NonnullRefPtrVector<Object> const& children() const { return m_children; }
template<typename Callback>
void for_each_child(Callback callback)
@@ -117,15 +117,15 @@ public:
void for_each_child_of_type(Callback callback) requires IsBaseOf<Object, T>;
template<typename T>
- T* find_child_of_type_named(const String&) requires IsBaseOf<Object, T>;
+ T* find_child_of_type_named(String const&) requires IsBaseOf<Object, T>;
template<typename T>
- T* find_descendant_of_type_named(const String&) requires IsBaseOf<Object, T>;
+ T* find_descendant_of_type_named(String const&) requires IsBaseOf<Object, T>;
- bool is_ancestor_of(const Object&) const;
+ bool is_ancestor_of(Object const&) const;
Object* parent() { return m_parent; }
- const Object* parent() const { return m_parent; }
+ Object const* parent() const { return m_parent; }
void start_timer(int ms, TimerShouldFireWhenNotVisible = TimerShouldFireWhenNotVisible::No);
void stop_timer();
@@ -146,9 +146,9 @@ public:
void save_to(JsonObject&);
- bool set_property(String const& name, const JsonValue& value);
+ bool set_property(String const& name, JsonValue const& value);
JsonValue property(String const& name) const;
- const HashMap<String, NonnullOwnPtr<Property>>& properties() const { return m_properties; }
+ HashMap<String, NonnullOwnPtr<Property>> const& properties() const { return m_properties; }
static IntrusiveList<&Object::m_all_objects_list_node>& all_objects();
@@ -186,7 +186,7 @@ public:
protected:
explicit Object(Object* parent = nullptr);
- void register_property(const String& name, Function<JsonValue()> getter, Function<bool(const JsonValue&)> setter = nullptr);
+ void register_property(String const& name, Function<JsonValue()> getter, Function<bool(JsonValue const&)> setter = nullptr);
virtual void event(Core::Event&);
@@ -213,7 +213,7 @@ private:
template<>
struct AK::Formatter<Core::Object> : AK::Formatter<FormatString> {
- ErrorOr<void> format(FormatBuilder& builder, const Core::Object& value)
+ ErrorOr<void> format(FormatBuilder& builder, Core::Object const& value)
{
return AK::Formatter<FormatString>::format(builder, "{}({})", value.class_name(), &value);
}
@@ -231,7 +231,7 @@ inline void Object::for_each_child_of_type(Callback callback) requires IsBaseOf<
}
template<typename T>
-T* Object::find_child_of_type_named(const String& name) requires IsBaseOf<Object, T>
+T* Object::find_child_of_type_named(String const& name) requires IsBaseOf<Object, T>
{
T* found_child = nullptr;
for_each_child_of_type<T>([&](auto& child) {
diff --git a/Userland/Libraries/LibCore/Property.cpp b/Userland/Libraries/LibCore/Property.cpp
index 16443a0171..0d9f66dbab 100644
--- a/Userland/Libraries/LibCore/Property.cpp
+++ b/Userland/Libraries/LibCore/Property.cpp
@@ -9,7 +9,7 @@
namespace Core {
-Property::Property(String name, Function<JsonValue()> getter, Function<bool(const JsonValue&)> setter)
+Property::Property(String name, Function<JsonValue()> getter, Function<bool(JsonValue const&)> setter)
: m_name(move(name))
, m_getter(move(getter))
, m_setter(move(setter))
diff --git a/Userland/Libraries/LibCore/Property.h b/Userland/Libraries/LibCore/Property.h
index 8370bdf5a4..1588379b2c 100644
--- a/Userland/Libraries/LibCore/Property.h
+++ b/Userland/Libraries/LibCore/Property.h
@@ -16,10 +16,10 @@ class Property {
AK_MAKE_NONCOPYABLE(Property);
public:
- Property(String name, Function<JsonValue()> getter, Function<bool(const JsonValue&)> setter = nullptr);
+ Property(String name, Function<JsonValue()> getter, Function<bool(JsonValue const&)> setter = nullptr);
~Property() = default;
- bool set(const JsonValue& value)
+ bool set(JsonValue const& value)
{
if (!m_setter)
return false;
@@ -28,13 +28,13 @@ public:
JsonValue get() const { return m_getter(); }
- const String& name() const { return m_name; }
+ String const& name() const { return m_name; }
bool is_readonly() const { return !m_setter; }
private:
String m_name;
Function<JsonValue()> m_getter;
- Function<bool(const JsonValue&)> m_setter;
+ Function<bool(JsonValue const&)> m_setter;
};
}
diff --git a/Userland/Libraries/LibCore/SecretString.h b/Userland/Libraries/LibCore/SecretString.h
index 865542ff7c..f6440eb285 100644
--- a/Userland/Libraries/LibCore/SecretString.h
+++ b/Userland/Libraries/LibCore/SecretString.h
@@ -21,7 +21,7 @@ public:
[[nodiscard]] bool is_empty() const { return m_secure_buffer.is_empty(); }
[[nodiscard]] size_t length() const { return m_secure_buffer.size(); }
- [[nodiscard]] char const* characters() const { return reinterpret_cast<const char*>(m_secure_buffer.data()); }
+ [[nodiscard]] char const* characters() const { return reinterpret_cast<char const*>(m_secure_buffer.data()); }
[[nodiscard]] StringView view() const { return { characters(), length() }; }
SecretString() = default;
diff --git a/Userland/Libraries/LibCore/SocketAddress.h b/Userland/Libraries/LibCore/SocketAddress.h
index b575ff339d..faf17c36f0 100644
--- a/Userland/Libraries/LibCore/SocketAddress.h
+++ b/Userland/Libraries/LibCore/SocketAddress.h
@@ -25,20 +25,20 @@ public:
};
SocketAddress() = default;
- SocketAddress(const IPv4Address& address)
+ SocketAddress(IPv4Address const& address)
: m_type(Type::IPv4)
, m_ipv4_address(address)
{
}
- SocketAddress(const IPv4Address& address, u16 port)
+ SocketAddress(IPv4Address const& address, u16 port)
: m_type(Type::IPv4)
, m_ipv4_address(address)
, m_port(port)
{
}
- static SocketAddress local(const String& address)
+ static SocketAddress local(String const& address)
{
SocketAddress addr;
addr.m_type = Type::Local;
diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp
index 00fdfb7f6e..b5e6290c30 100644
--- a/Userland/Libraries/LibCore/System.cpp
+++ b/Userland/Libraries/LibCore/System.cpp
@@ -30,7 +30,7 @@
# include <linux/memfd.h>
# include <sys/syscall.h>
-static int memfd_create(const char* name, unsigned int flags)
+static int memfd_create(char const* name, unsigned int flags)
{
return syscall(SYS_memfd_create, name, flags);
}
diff --git a/Userland/Libraries/LibCore/SystemServerTakeover.cpp b/Userland/Libraries/LibCore/SystemServerTakeover.cpp
index 3f134663ca..a1dfe9e401 100644
--- a/Userland/Libraries/LibCore/SystemServerTakeover.cpp
+++ b/Userland/Libraries/LibCore/SystemServerTakeover.cpp
@@ -17,7 +17,7 @@ static void parse_sockets_from_system_server()
VERIFY(!s_overtaken_sockets_parsed);
constexpr auto socket_takeover = "SOCKET_TAKEOVER";
- const char* sockets = getenv(socket_takeover);
+ char const* sockets = getenv(socket_takeover);
if (!sockets) {
s_overtaken_sockets_parsed = true;
return;
diff --git a/Userland/Libraries/LibCore/UDPServer.cpp b/Userland/Libraries/LibCore/UDPServer.cpp
index 47a07fdf07..729b640de6 100644
--- a/Userland/Libraries/LibCore/UDPServer.cpp
+++ b/Userland/Libraries/LibCore/UDPServer.cpp
@@ -38,7 +38,7 @@ UDPServer::~UDPServer()
::close(m_fd);
}
-bool UDPServer::bind(const IPv4Address& address, u16 port)
+bool UDPServer::bind(IPv4Address const& address, u16 port)
{
if (m_bound)
return false;
@@ -46,7 +46,7 @@ bool UDPServer::bind(const IPv4Address& address, u16 port)
auto saddr = SocketAddress(address, port);
auto in = saddr.to_sockaddr_in();
- if (::bind(m_fd, (const sockaddr*)&in, sizeof(in)) != 0) {
+ if (::bind(m_fd, (sockaddr const*)&in, sizeof(in)) != 0) {
perror("UDPServer::bind");
return false;
}
diff --git a/Userland/Libraries/LibCore/UDPServer.h b/Userland/Libraries/LibCore/UDPServer.h
index 453cf43056..50ac61ee31 100644
--- a/Userland/Libraries/LibCore/UDPServer.h
+++ b/Userland/Libraries/LibCore/UDPServer.h
@@ -22,7 +22,7 @@ public:
bool is_bound() const { return m_bound; }
- bool bind(const IPv4Address& address, u16 port);
+ bool bind(IPv4Address const& address, u16 port);
ByteBuffer receive(size_t size, sockaddr_in& from);
ByteBuffer receive(size_t size)
{
diff --git a/Userland/Libraries/LibCoredump/Backtrace.cpp b/Userland/Libraries/LibCoredump/Backtrace.cpp
index fa4515f8f7..f063e30c80 100644
--- a/Userland/Libraries/LibCoredump/Backtrace.cpp
+++ b/Userland/Libraries/LibCoredump/Backtrace.cpp
@@ -41,7 +41,7 @@ ELFObjectInfo const* Backtrace::object_info_for_region(Reader const& coredump, M
return info_ptr;
}
-Backtrace::Backtrace(const Reader& coredump, const ELF::Core::ThreadInfo& thread_info, Function<void(size_t, size_t)> on_progress)
+Backtrace::Backtrace(Reader const& coredump, const ELF::Core::ThreadInfo& thread_info, Function<void(size_t, size_t)> on_progress)
: m_thread_info(move(thread_info))
{
#if ARCH(I386)
@@ -92,7 +92,7 @@ Backtrace::Backtrace(const Reader& coredump, const ELF::Core::ThreadInfo& thread
}
}
-void Backtrace::add_entry(const Reader& coredump, FlatPtr ip)
+void Backtrace::add_entry(Reader const& coredump, FlatPtr ip)
{
auto ip_region = coredump.region_containing(ip);
if (!ip_region.has_value()) {
diff --git a/Userland/Libraries/LibCoredump/Backtrace.h b/Userland/Libraries/LibCoredump/Backtrace.h
index d06bad1167..d112f110c5 100644
--- a/Userland/Libraries/LibCoredump/Backtrace.h
+++ b/Userland/Libraries/LibCoredump/Backtrace.h
@@ -38,14 +38,14 @@ public:
String to_string(bool color = false) const;
};
- Backtrace(const Reader&, const ELF::Core::ThreadInfo&, Function<void(size_t, size_t)> on_progress = {});
+ Backtrace(Reader const&, const ELF::Core::ThreadInfo&, Function<void(size_t, size_t)> on_progress = {});
~Backtrace() = default;
ELF::Core::ThreadInfo const& thread_info() const { return m_thread_info; }
Vector<Entry> const& entries() const { return m_entries; }
private:
- void add_entry(const Reader&, FlatPtr ip);
+ void add_entry(Reader const&, FlatPtr ip);
ELFObjectInfo const* object_info_for_region(Reader const&, MemoryRegionInfo const&);
bool m_skip_loader_so { false };
diff --git a/Userland/Libraries/LibCoredump/Reader.cpp b/Userland/Libraries/LibCoredump/Reader.cpp
index 445acd353c..e010abab58 100644
--- a/Userland/Libraries/LibCoredump/Reader.cpp
+++ b/Userland/Libraries/LibCoredump/Reader.cpp
@@ -77,7 +77,7 @@ Optional<ByteBuffer> Reader::decompress_coredump(ReadonlyBytes raw_coredump)
return bytebuffer.release_value();
}
-Reader::NotesEntryIterator::NotesEntryIterator(const u8* notes_data)
+Reader::NotesEntryIterator::NotesEntryIterator(u8 const* notes_data)
: m_current(bit_cast<const ELF::Core::NotesEntry*>(notes_data))
, start(notes_data)
{
@@ -103,22 +103,22 @@ void Reader::NotesEntryIterator::next()
VERIFY(!at_end());
switch (type()) {
case ELF::Core::NotesEntryHeader::Type::ProcessInfo: {
- const auto* current = bit_cast<const ELF::Core::ProcessInfo*>(m_current);
+ auto const* current = bit_cast<const ELF::Core::ProcessInfo*>(m_current);
m_current = bit_cast<const ELF::Core::NotesEntry*>(current->json_data + strlen(current->json_data) + 1);
break;
}
case ELF::Core::NotesEntryHeader::Type::ThreadInfo: {
- const auto* current = bit_cast<const ELF::Core::ThreadInfo*>(m_current);
+ auto const* current = bit_cast<const ELF::Core::ThreadInfo*>(m_current);
m_current = bit_cast<const ELF::Core::NotesEntry*>(current + 1);
break;
}
case ELF::Core::NotesEntryHeader::Type::MemoryRegionInfo: {
- const auto* current = bit_cast<const ELF::Core::MemoryRegionInfo*>(m_current);
+ auto const* current = bit_cast<const ELF::Core::MemoryRegionInfo*>(m_current);
m_current = bit_cast<const ELF::Core::NotesEntry*>(current->region_name + strlen(current->region_name) + 1);
break;
}
case ELF::Core::NotesEntryHeader::Type::Metadata: {
- const auto* current = bit_cast<const ELF::Core::Metadata*>(m_current);
+ auto const* current = bit_cast<const ELF::Core::Metadata*>(m_current);
m_current = bit_cast<const ELF::Core::NotesEntry*>(current->json_data + strlen(current->json_data) + 1);
break;
}
@@ -139,7 +139,7 @@ Optional<FlatPtr> Reader::peek_memory(FlatPtr address) const
return {};
FlatPtr offset_in_region = address - region->region_start;
- auto* region_data = bit_cast<const u8*>(image().program_header(region->program_header_index).raw_data());
+ auto* region_data = bit_cast<u8 const*>(image().program_header(region->program_header_index).raw_data());
FlatPtr value { 0 };
ByteReader::load(region_data + offset_in_region, value);
return value;
@@ -148,7 +148,7 @@ Optional<FlatPtr> Reader::peek_memory(FlatPtr address) const
const JsonObject Reader::process_info() const
{
const ELF::Core::ProcessInfo* process_info_notes_entry = nullptr;
- NotesEntryIterator it(bit_cast<const u8*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
+ NotesEntryIterator it(bit_cast<u8 const*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
for (; !it.at_end(); it.next()) {
if (it.type() != ELF::Core::NotesEntryHeader::Type::ProcessInfo)
continue;
@@ -182,7 +182,7 @@ Optional<MemoryRegionInfo> Reader::first_region_for_object(StringView object_nam
Optional<MemoryRegionInfo> Reader::region_containing(FlatPtr address) const
{
Optional<MemoryRegionInfo> ret;
- for_each_memory_region_info([&ret, address](const auto& region_info) {
+ for_each_memory_region_info([&ret, address](auto const& region_info) {
if (region_info.region_start <= address && region_info.region_end >= address) {
ret = region_info;
return IterationDecision::Break;
@@ -247,7 +247,7 @@ Vector<String> Reader::process_environment() const
HashMap<String, String> Reader::metadata() const
{
const ELF::Core::Metadata* metadata_notes_entry = nullptr;
- NotesEntryIterator it(bit_cast<const u8*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
+ NotesEntryIterator it(bit_cast<u8 const*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
for (; !it.at_end(); it.next()) {
if (it.type() != ELF::Core::NotesEntryHeader::Type::Metadata)
continue;
@@ -268,7 +268,7 @@ HashMap<String, String> Reader::metadata() const
return metadata;
}
-const Reader::LibraryData* Reader::library_containing(FlatPtr address) const
+Reader::LibraryData const* Reader::library_containing(FlatPtr address) const
{
static HashMap<String, OwnPtr<LibraryData>> cached_libs;
auto region = region_containing(address);
diff --git a/Userland/Libraries/LibCoredump/Reader.h b/Userland/Libraries/LibCoredump/Reader.h
index 536ecfb009..8f13f74f70 100644
--- a/Userland/Libraries/LibCoredump/Reader.h
+++ b/Userland/Libraries/LibCoredump/Reader.h
@@ -69,7 +69,7 @@ public:
NonnullRefPtr<Core::MappedFile> file;
ELF::Image lib_elf;
};
- const LibraryData* library_containing(FlatPtr address) const;
+ LibraryData const* library_containing(FlatPtr address) const;
String resolve_object_path(StringView object_name) const;
@@ -89,7 +89,7 @@ private:
class NotesEntryIterator {
public:
- NotesEntryIterator(const u8* notes_data);
+ NotesEntryIterator(u8 const* notes_data);
ELF::Core::NotesEntryHeader::Type type() const;
const ELF::Core::NotesEntry* current() const;
@@ -99,7 +99,7 @@ private:
private:
const ELF::Core::NotesEntry* m_current { nullptr };
- const u8* start { nullptr };
+ u8 const* start { nullptr };
};
// Private as we don't need anyone poking around in this JsonObject
@@ -122,7 +122,7 @@ private:
template<typename Func>
void Reader::for_each_memory_region_info(Func func) const
{
- NotesEntryIterator it(bit_cast<const u8*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
+ NotesEntryIterator it(bit_cast<u8 const*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
for (; !it.at_end(); it.next()) {
if (it.type() != ELF::Core::NotesEntryHeader::Type::MemoryRegionInfo)
continue;
@@ -138,7 +138,7 @@ void Reader::for_each_memory_region_info(Func func) const
raw_memory_region_info.region_start,
raw_memory_region_info.region_end,
raw_memory_region_info.program_header_index,
- { bit_cast<const char*>(raw_data.offset_pointer(raw_data.size())) },
+ { bit_cast<char const*>(raw_data.offset_pointer(raw_data.size())) },
};
IterationDecision decision = func(memory_region_info);
if (decision == IterationDecision::Break)
@@ -149,12 +149,12 @@ void Reader::for_each_memory_region_info(Func func) const
template<typename Func>
void Reader::for_each_thread_info(Func func) const
{
- NotesEntryIterator it(bit_cast<const u8*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
+ NotesEntryIterator it(bit_cast<u8 const*>(m_coredump_image.program_header(m_notes_segment_index).raw_data()));
for (; !it.at_end(); it.next()) {
if (it.type() != ELF::Core::NotesEntryHeader::Type::ThreadInfo)
continue;
ELF::Core::ThreadInfo thread_info;
- ByteReader::load(bit_cast<const u8*>(it.current()), thread_info);
+ ByteReader::load(bit_cast<u8 const*>(it.current()), thread_info);
IterationDecision decision = func(thread_info);
if (decision == IterationDecision::Break)
diff --git a/Userland/Libraries/LibCpp/AST.cpp b/Userland/Libraries/LibCpp/AST.cpp
index f07e09d252..53ff3cfe2d 100644
--- a/Userland/Libraries/LibCpp/AST.cpp
+++ b/Userland/Libraries/LibCpp/AST.cpp
@@ -23,7 +23,7 @@ void ASTNode::dump(FILE* output, size_t indent) const
void TranslationUnit::dump(FILE* output, size_t indent) const
{
ASTNode::dump(output, indent);
- for (const auto& child : m_declarations) {
+ for (auto const& child : m_declarations) {
child.dump(output, indent + 1);
}
}
@@ -45,7 +45,7 @@ void FunctionDeclaration::dump(FILE* output, size_t indent) const
}
print_indent(output, indent + 1);
outln(output, "(");
- for (const auto& arg : m_parameters) {
+ for (auto const& arg : m_parameters) {
arg.dump(output, indent + 1);
}
print_indent(output, indent + 1);
@@ -155,7 +155,7 @@ void FunctionDefinition::dump(FILE* output, size_t indent) const
ASTNode::dump(output, indent);
print_indent(output, indent);
outln(output, "{{");
- for (const auto& statement : m_statements) {
+ for (auto const& statement : m_statements) {
statement.dump(output, indent + 1);
}
print_indent(output, indent);
@@ -200,7 +200,7 @@ void BinaryExpression::dump(FILE* output, size_t indent) const
{
ASTNode::dump(output, indent);
- const char* op_string = nullptr;
+ char const* op_string = nullptr;
switch (m_op) {
case BinaryOp::Addition:
op_string = "+";
@@ -272,7 +272,7 @@ void AssignmentExpression::dump(FILE* output, size_t indent) const
{
ASTNode::dump(output, indent);
- const char* op_string = nullptr;
+ char const* op_string = nullptr;
switch (m_op) {
case AssignmentOp::Assignment:
op_string = "=";
@@ -296,7 +296,7 @@ void FunctionCall::dump(FILE* output, size_t indent) const
{
ASTNode::dump(output, indent);
m_callee->dump(output, indent + 1);
- for (const auto& arg : m_arguments) {
+ for (auto const& arg : m_arguments) {
arg.dump(output, indent + 1);
}
}
@@ -349,7 +349,7 @@ void UnaryExpression::dump(FILE* output, size_t indent) const
{
ASTNode::dump(output, indent);
- const char* op_string = nullptr;
+ char const* op_string = nullptr;
switch (m_op) {
case UnaryOp::BitwiseNot:
op_string = "~";
@@ -449,7 +449,7 @@ NonnullRefPtrVector<Declaration> Statement::declarations() const
{
if (is_declaration()) {
NonnullRefPtrVector<Declaration> vec;
- const auto& decl = static_cast<const Declaration&>(*this);
+ auto const& decl = static_cast<Declaration const&>(*this);
vec.empend(const_cast<Declaration&>(decl));
return vec;
}
@@ -607,7 +607,7 @@ void Constructor::dump(FILE* output, size_t indent) const
outln(output, "C'tor");
print_indent(output, indent + 1);
outln(output, "(");
- for (const auto& arg : parameters()) {
+ for (auto const& arg : parameters()) {
arg.dump(output, indent + 1);
}
print_indent(output, indent + 1);
@@ -623,7 +623,7 @@ void Destructor::dump(FILE* output, size_t indent) const
outln(output, "D'tor");
print_indent(output, indent + 1);
outln(output, "(");
- for (const auto& arg : parameters()) {
+ for (auto const& arg : parameters()) {
arg.dump(output, indent + 1);
}
print_indent(output, indent + 1);
diff --git a/Userland/Libraries/LibCpp/AST.h b/Userland/Libraries/LibCpp/AST.h
index 259ef63e4e..c2c772aa33 100644
--- a/Userland/Libraries/LibCpp/AST.h
+++ b/Userland/Libraries/LibCpp/AST.h
@@ -47,11 +47,11 @@ public:
VERIFY(m_end.has_value());
return m_end.value();
}
- const FlyString& filename() const
+ FlyString const& filename() const
{
return m_filename;
}
- void set_end(const Position& end) { m_end = end; }
+ void set_end(Position const& end) { m_end = end; }
void set_parent(ASTNode& parent) { m_parent = &parent; }
virtual NonnullRefPtrVector<Declaration> declarations() const { return {}; }
@@ -66,7 +66,7 @@ public:
virtual bool is_dummy_node() const { return false; }
protected:
- ASTNode(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ ASTNode(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: m_parent(parent)
, m_start(start)
, m_end(end)
@@ -89,7 +89,7 @@ public:
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
virtual NonnullRefPtrVector<Declaration> declarations() const override { return m_declarations; }
- TranslationUnit(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ TranslationUnit(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: ASTNode(parent, start, end, filename)
{
}
@@ -108,7 +108,7 @@ public:
virtual NonnullRefPtrVector<Declaration> declarations() const override;
protected:
- Statement(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ Statement(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: ASTNode(parent, start, end, filename)
{
}
@@ -127,12 +127,12 @@ public:
virtual bool is_namespace() const { return false; }
virtual bool is_enum() const { return false; }
bool is_member() const { return parent() != nullptr && parent()->is_declaration() && verify_cast<Declaration>(parent())->is_struct_or_class(); }
- const Name* name() const { return m_name; }
+ Name const* name() const { return m_name; }
StringView full_name() const;
void set_name(RefPtr<Name> name) { m_name = move(name); }
protected:
- Declaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ Declaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Statement(parent, start, end, filename)
{
}
@@ -146,7 +146,7 @@ class InvalidDeclaration : public Declaration {
public:
virtual ~InvalidDeclaration() override = default;
virtual StringView class_name() const override { return "InvalidDeclaration"sv; }
- InvalidDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ InvalidDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Declaration(parent, start, end, filename)
{
}
@@ -162,19 +162,19 @@ public:
virtual bool is_destructor() const { return false; }
RefPtr<FunctionDefinition> definition() { return m_definition; }
- FunctionDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ FunctionDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Declaration(parent, start, end, filename)
{
}
virtual NonnullRefPtrVector<Declaration> declarations() const override;
- const Vector<StringView>& qualifiers() const { return m_qualifiers; }
- void set_qualifiers(const Vector<StringView>& qualifiers) { m_qualifiers = qualifiers; }
- const Type* return_type() const { return m_return_type.ptr(); }
- void set_return_type(const RefPtr<Type>& return_type) { m_return_type = return_type; }
- const NonnullRefPtrVector<Parameter>& parameters() const { return m_parameters; }
- void set_parameters(const NonnullRefPtrVector<Parameter>& parameters) { m_parameters = parameters; }
- const FunctionDefinition* definition() const { return m_definition.ptr(); }
+ Vector<StringView> const& qualifiers() const { return m_qualifiers; }
+ void set_qualifiers(Vector<StringView> const& qualifiers) { m_qualifiers = qualifiers; }
+ Type const* return_type() const { return m_return_type.ptr(); }
+ void set_return_type(RefPtr<Type> const& return_type) { m_return_type = return_type; }
+ NonnullRefPtrVector<Parameter> const& parameters() const { return m_parameters; }
+ void set_parameters(NonnullRefPtrVector<Parameter> const& parameters) { m_parameters = parameters; }
+ FunctionDefinition const* definition() const { return m_definition.ptr(); }
void set_definition(RefPtr<FunctionDefinition>&& definition) { m_definition = move(definition); }
private:
@@ -190,10 +190,10 @@ public:
virtual bool is_variable_or_parameter_declaration() const override { return true; }
void set_type(RefPtr<Type>&& type) { m_type = move(type); }
- const Type* type() const { return m_type.ptr(); }
+ Type const* type() const { return m_type.ptr(); }
protected:
- VariableOrParameterDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ VariableOrParameterDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Declaration(parent, start, end, filename)
{
}
@@ -208,7 +208,7 @@ public:
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
virtual bool is_parameter() const override { return true; }
- Parameter(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename, RefPtr<Name> name)
+ Parameter(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename, RefPtr<Name> name)
: VariableOrParameterDeclaration(parent, start, end, filename)
{
m_name = name;
@@ -237,7 +237,7 @@ public:
void set_qualifiers(Vector<StringView>&& qualifiers) { m_qualifiers = move(qualifiers); }
protected:
- Type(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ Type(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: ASTNode(parent, start, end, filename)
{
}
@@ -254,12 +254,12 @@ public:
virtual String to_string() const override;
virtual bool is_named_type() const override { return true; }
- NamedType(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ NamedType(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Type(parent, start, end, filename)
{
}
- const Name* name() const { return m_name.ptr(); }
+ Name const* name() const { return m_name.ptr(); }
void set_name(RefPtr<Name>&& name) { m_name = move(name); }
private:
@@ -273,12 +273,12 @@ public:
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
virtual String to_string() const override;
- Pointer(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ Pointer(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Type(parent, start, end, filename)
{
}
- const Type* pointee() const { return m_pointee.ptr(); }
+ Type const* pointee() const { return m_pointee.ptr(); }
void set_pointee(RefPtr<Type>&& pointee) { m_pointee = move(pointee); }
private:
@@ -297,13 +297,13 @@ public:
Rvalue,
};
- Reference(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename, Kind kind)
+ Reference(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename, Kind kind)
: Type(parent, start, end, filename)
, m_kind(kind)
{
}
- const Type* referenced_type() const { return m_referenced_type.ptr(); }
+ Type const* referenced_type() const { return m_referenced_type.ptr(); }
void set_referenced_type(RefPtr<Type>&& pointee) { m_referenced_type = move(pointee); }
Kind kind() const { return m_kind; }
@@ -319,7 +319,7 @@ public:
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
virtual String to_string() const override;
- FunctionType(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ FunctionType(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Type(parent, start, end, filename)
{
}
@@ -338,7 +338,7 @@ public:
virtual StringView class_name() const override { return "FunctionDefinition"sv; }
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
- FunctionDefinition(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ FunctionDefinition(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: ASTNode(parent, start, end, filename)
{
}
@@ -355,7 +355,7 @@ class InvalidStatement : public Statement {
public:
virtual ~InvalidStatement() override = default;
virtual StringView class_name() const override { return "InvalidStatement"sv; }
- InvalidStatement(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ InvalidStatement(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Statement(parent, start, end, filename)
{
}
@@ -367,7 +367,7 @@ public:
virtual StringView class_name() const override { return "Expression"sv; }
protected:
- Expression(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ Expression(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Statement(parent, start, end, filename)
{
}
@@ -377,7 +377,7 @@ class InvalidExpression : public Expression {
public:
virtual ~InvalidExpression() override = default;
virtual StringView class_name() const override { return "InvalidExpression"sv; }
- InvalidExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ InvalidExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Expression(parent, start, end, filename)
{
}
@@ -389,14 +389,14 @@ public:
virtual StringView class_name() const override { return "VariableDeclaration"sv; }
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
- VariableDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ VariableDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: VariableOrParameterDeclaration(parent, start, end, filename)
{
}
virtual bool is_variable_declaration() const override { return true; }
- const Expression* initial_value() const { return m_initial_value; }
+ Expression const* initial_value() const { return m_initial_value; }
void set_initial_value(RefPtr<Expression>&& initial_value) { m_initial_value = move(initial_value); }
private:
@@ -409,12 +409,12 @@ public:
virtual StringView class_name() const override { return "Identifier"sv; }
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
- Identifier(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename, StringView name)
+ Identifier(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename, StringView name)
: Expression(parent, start, end, filename)
, m_name(name)
{
}
- Identifier(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ Identifier(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Identifier(parent, start, end, filename, {})
{
}
@@ -436,13 +436,13 @@ public:
virtual bool is_name() const override { return true; }
virtual bool is_templatized() const { return false; }
- Name(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ Name(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Expression(parent, start, end, filename)
{
}
virtual StringView full_name() const;
- const Identifier* name() const { return m_name.ptr(); }
+ Identifier const* name() const { return m_name.ptr(); }
void set_name(RefPtr<Identifier>&& name) { m_name = move(name); }
NonnullRefPtrVector<Identifier> const& scope() const { return m_scope; }
void set_scope(NonnullRefPtrVector<Identifier> scope) { m_scope = move(scope); }
@@ -461,7 +461,7 @@ public:
virtual bool is_templatized() const override { return true; }
virtual StringView full_name() const override;
- TemplatizedName(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ TemplatizedName(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Name(parent, start, end, filename)
{
}
@@ -479,7 +479,7 @@ public:
virtual StringView class_name() const override { return "NumericLiteral"sv; }
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
- NumericLiteral(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename, StringView value)
+ NumericLiteral(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename, StringView value)
: Expression(parent, start, end, filename)
, m_value(value)
{
@@ -495,7 +495,7 @@ public:
virtual StringView class_name() const override { return "NullPointerLiteral"sv; }
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
- NullPointerLiteral(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ NullPointerLiteral(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Expression(parent, start, end, filename)
{
}
@@ -507,7 +507,7 @@ public:
virtual StringView class_name() const override { return "BooleanLiteral"sv; }
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
- BooleanLiteral(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename, bool value)
+ BooleanLiteral(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename, bool value)
: Expression(parent, start, end, filename)
, m_value(value)
{
@@ -541,7 +541,7 @@ enum class BinaryOp {
class BinaryExpression : public Expression {
public:
- BinaryExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ BinaryExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Expression(parent, start, end, filename)
{
}
@@ -571,7 +571,7 @@ enum class AssignmentOp {
class AssignmentExpression : public Expression {
public:
- AssignmentExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ AssignmentExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Expression(parent, start, end, filename)
{
}
@@ -582,9 +582,9 @@ public:
AssignmentOp op() const { return m_op; }
void set_op(AssignmentOp op) { m_op = op; }
- const Expression* lhs() const { return m_lhs; }
+ Expression const* lhs() const { return m_lhs; }
void set_lhs(RefPtr<Expression>&& e) { m_lhs = move(e); }
- const Expression* rhs() const { return m_rhs; }
+ Expression const* rhs() const { return m_rhs; }
void set_rhs(RefPtr<Expression>&& e) { m_rhs = move(e); }
private:
@@ -595,7 +595,7 @@ private:
class FunctionCall : public Expression {
public:
- FunctionCall(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ FunctionCall(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Expression(parent, start, end, filename)
{
}
@@ -605,7 +605,7 @@ public:
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
virtual bool is_function_call() const override { return true; }
- const Expression* callee() const { return m_callee.ptr(); }
+ Expression const* callee() const { return m_callee.ptr(); }
void set_callee(RefPtr<Expression>&& callee) { m_callee = move(callee); }
void add_argument(NonnullRefPtr<Expression>&& arg) { m_arguments.append(move(arg)); }
@@ -618,7 +618,7 @@ private:
class StringLiteral final : public Expression {
public:
- StringLiteral(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ StringLiteral(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Expression(parent, start, end, filename)
{
}
@@ -639,13 +639,13 @@ public:
virtual ~ReturnStatement() override = default;
virtual StringView class_name() const override { return "ReturnStatement"sv; }
- ReturnStatement(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ ReturnStatement(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Statement(parent, start, end, filename)
{
}
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
- const Expression* value() const { return m_value.ptr(); }
+ Expression const* value() const { return m_value.ptr(); }
void set_value(RefPtr<Expression>&& value) { m_value = move(value); }
private:
@@ -659,7 +659,7 @@ public:
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
virtual bool is_enum() const override { return true; }
- EnumDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ EnumDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Declaration(parent, start, end, filename)
{
}
@@ -696,7 +696,7 @@ public:
Class
};
- StructOrClassDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename, StructOrClassDeclaration::Type type)
+ StructOrClassDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename, StructOrClassDeclaration::Type type)
: Declaration(parent, start, end, filename)
, m_type(type)
{
@@ -722,7 +722,7 @@ enum class UnaryOp {
class UnaryExpression : public Expression {
public:
- UnaryExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ UnaryExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Expression(parent, start, end, filename)
{
}
@@ -741,7 +741,7 @@ private:
class MemberExpression : public Expression {
public:
- MemberExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ MemberExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Expression(parent, start, end, filename)
{
}
@@ -751,9 +751,9 @@ public:
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
virtual bool is_member_expression() const override { return true; }
- const Expression* object() const { return m_object.ptr(); }
+ Expression const* object() const { return m_object.ptr(); }
void set_object(RefPtr<Expression>&& object) { m_object = move(object); }
- const Expression* property() const { return m_property.ptr(); }
+ Expression const* property() const { return m_property.ptr(); }
void set_property(RefPtr<Expression>&& property) { m_property = move(property); }
private:
@@ -763,7 +763,7 @@ private:
class ForStatement : public Statement {
public:
- ForStatement(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ ForStatement(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Statement(parent, start, end, filename)
{
}
@@ -778,7 +778,7 @@ public:
void set_test(RefPtr<Expression>&& test) { m_test = move(test); }
void set_update(RefPtr<Expression>&& update) { m_update = move(update); }
void set_body(RefPtr<Statement>&& body) { m_body = move(body); }
- const Statement* body() const { return m_body.ptr(); }
+ Statement const* body() const { return m_body.ptr(); }
private:
RefPtr<VariableDeclaration> m_init;
@@ -789,7 +789,7 @@ private:
class BlockStatement final : public Statement {
public:
- BlockStatement(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ BlockStatement(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Statement(parent, start, end, filename)
{
}
@@ -808,7 +808,7 @@ private:
class Comment final : public Statement {
public:
- Comment(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ Comment(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Statement(parent, start, end, filename)
{
}
@@ -819,7 +819,7 @@ public:
class IfStatement : public Statement {
public:
- IfStatement(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ IfStatement(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Statement(parent, start, end, filename)
{
}
@@ -833,8 +833,8 @@ public:
void set_then_statement(RefPtr<Statement>&& then) { m_then = move(then); }
void set_else_statement(RefPtr<Statement>&& _else) { m_else = move(_else); }
- const Statement* then_statement() const { return m_then.ptr(); }
- const Statement* else_statement() const { return m_else.ptr(); }
+ Statement const* then_statement() const { return m_then.ptr(); }
+ Statement const* else_statement() const { return m_else.ptr(); }
private:
RefPtr<Expression> m_predicate;
@@ -849,7 +849,7 @@ public:
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
virtual bool is_namespace() const override { return true; }
- NamespaceDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ NamespaceDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Declaration(parent, start, end, filename)
{
}
@@ -863,7 +863,7 @@ private:
class CppCastExpression : public Expression {
public:
- CppCastExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ CppCastExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Expression(parent, start, end, filename)
{
}
@@ -884,7 +884,7 @@ private:
class CStyleCastExpression : public Expression {
public:
- CStyleCastExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ CStyleCastExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Expression(parent, start, end, filename)
{
}
@@ -903,7 +903,7 @@ private:
class SizeofExpression : public Expression {
public:
- SizeofExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ SizeofExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Expression(parent, start, end, filename)
{
}
@@ -920,7 +920,7 @@ private:
class BracedInitList : public Expression {
public:
- BracedInitList(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ BracedInitList(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: Expression(parent, start, end, filename)
{
}
@@ -937,7 +937,7 @@ private:
class DummyAstNode : public ASTNode {
public:
- DummyAstNode(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ DummyAstNode(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: ASTNode(parent, start, end, filename)
{
}
@@ -953,7 +953,7 @@ public:
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
virtual bool is_constructor() const override { return true; }
- Constructor(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ Constructor(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: FunctionDeclaration(parent, start, end, filename)
{
}
@@ -966,7 +966,7 @@ public:
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
virtual bool is_destructor() const override { return true; }
- Destructor(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
+ Destructor(ASTNode* parent, Optional<Position> start, Optional<Position> end, String const& filename)
: FunctionDeclaration(parent, start, end, filename)
{
}
diff --git a/Userland/Libraries/LibCpp/Parser.cpp b/Userland/Libraries/LibCpp/Parser.cpp
index 0a0e9bb7e0..9cb3e65de5 100644
--- a/Userland/Libraries/LibCpp/Parser.cpp
+++ b/Userland/Libraries/LibCpp/Parser.cpp
@@ -864,12 +864,12 @@ void Parser::load_state()
m_state = m_saved_states.take_last();
}
-StringView Parser::text_of_token(const Cpp::Token& token) const
+StringView Parser::text_of_token(Cpp::Token const& token) const
{
return token.text();
}
-String Parser::text_of_node(const ASTNode& node) const
+String Parser::text_of_node(ASTNode const& node) const
{
return text_in_range(node.start(), node.end());
}
@@ -969,7 +969,7 @@ Optional<size_t> Parser::index_of_node_at(Position pos) const
VERIFY(m_saved_states.is_empty());
Optional<size_t> match_node_index;
- auto node_span = [](const ASTNode& node) {
+ auto node_span = [](ASTNode const& node) {
VERIFY(node.end().line >= node.start().line);
VERIFY((node.end().line > node.start().line) || (node.end().column >= node.start().column));
return Position { node.end().line - node.start().line, node.start().line != node.end().line ? 0 : node.end().column - node.start().column };
@@ -1106,7 +1106,7 @@ NonnullRefPtr<EnumDeclaration> Parser::parse_enum_declaration(ASTNode& parent)
return enum_decl;
}
-Token Parser::consume_keyword(const String& keyword)
+Token Parser::consume_keyword(String const& keyword)
{
auto token = consume();
if (token.type() != Token::Type::Keyword) {
@@ -1120,7 +1120,7 @@ Token Parser::consume_keyword(const String& keyword)
return token;
}
-bool Parser::match_keyword(const String& keyword)
+bool Parser::match_keyword(String const& keyword)
{
auto token = peek();
if (token.type() != Token::Type::Keyword) {
diff --git a/Userland/Libraries/LibCpp/Parser.h b/Userland/Libraries/LibCpp/Parser.h
index 5ef0f36d08..e9054a376c 100644
--- a/Userland/Libraries/LibCpp/Parser.h
+++ b/Userland/Libraries/LibCpp/Parser.h
@@ -29,11 +29,11 @@ public:
Optional<Token> token_at(Position) const;
Optional<size_t> index_of_token_at(Position) const;
RefPtr<const TranslationUnit> root_node() const { return m_root_node; }
- String text_of_node(const ASTNode&) const;
- StringView text_of_token(const Cpp::Token& token) const;
+ String text_of_node(ASTNode const&) const;
+ StringView text_of_token(Cpp::Token const& token) const;
void print_tokens() const;
Vector<Token> const& tokens() const { return m_tokens; }
- const Vector<String>& errors() const { return m_errors; }
+ Vector<String> const& errors() const { return m_errors; }
struct TodoEntry {
String content;
@@ -71,7 +71,7 @@ private:
bool match_literal();
bool match_unary_expression();
bool match_boolean_literal();
- bool match_keyword(const String&);
+ bool match_keyword(String const&);
bool match_block_statement();
bool match_namespace_declaration();
bool match_template_arguments();
@@ -130,7 +130,7 @@ private:
bool match(Token::Type);
Token consume(Token::Type);
Token consume();
- Token consume_keyword(const String&);
+ Token consume_keyword(String const&);
Token peek(size_t offset = 0) const;
Optional<Token> peek(Token::Type) const;
Position position() const;
@@ -149,7 +149,7 @@ private:
template<class T, class... Args>
NonnullRefPtr<T>
- create_ast_node(ASTNode& parent, const Position& start, Optional<Position> end, Args&&... args)
+ create_ast_node(ASTNode& parent, Position const& start, Optional<Position> end, Args&&... args)
{
auto node = adopt_ref(*new T(&parent, start, end, m_filename, forward<Args>(args)...));
@@ -163,7 +163,7 @@ private:
}
NonnullRefPtr<TranslationUnit>
- create_root_ast_node(const Position& start, Position end)
+ create_root_ast_node(Position const& start, Position end)
{
auto node = adopt_ref(*new TranslationUnit(nullptr, start, end, m_filename));
m_nodes.append(node);
diff --git a/Userland/Libraries/LibCpp/Preprocessor.cpp b/Userland/Libraries/LibCpp/Preprocessor.cpp
index 330bef1e14..0f956f5c96 100644
--- a/Userland/Libraries/LibCpp/Preprocessor.cpp
+++ b/Userland/Libraries/LibCpp/Preprocessor.cpp
@@ -12,7 +12,7 @@
#include <ctype.h>
namespace Cpp {
-Preprocessor::Preprocessor(const String& filename, StringView program)
+Preprocessor::Preprocessor(String const& filename, StringView program)
: m_filename(filename)
, m_program(program)
{
diff --git a/Userland/Libraries/LibCpp/Preprocessor.h b/Userland/Libraries/LibCpp/Preprocessor.h
index 92e5ce5dc4..0452ea3581 100644
--- a/Userland/Libraries/LibCpp/Preprocessor.h
+++ b/Userland/Libraries/LibCpp/Preprocessor.h
@@ -20,7 +20,7 @@ namespace Cpp {
class Preprocessor {
public:
- explicit Preprocessor(const String& filename, StringView program);
+ explicit Preprocessor(String const& filename, StringView program);
Vector<Token> process_and_lex();
Vector<StringView> included_paths() const { return m_included_paths; }
diff --git a/Userland/Libraries/LibCpp/Token.cpp b/Userland/Libraries/LibCpp/Token.cpp
index 481ca0e42e..71f7bc768b 100644
--- a/Userland/Libraries/LibCpp/Token.cpp
+++ b/Userland/Libraries/LibCpp/Token.cpp
@@ -9,19 +9,19 @@
namespace Cpp {
-bool Position::operator<(const Position& other) const
+bool Position::operator<(Position const& other) const
{
return line < other.line || (line == other.line && column < other.column);
}
-bool Position::operator>(const Position& other) const
+bool Position::operator>(Position const& other) const
{
return !(*this < other) && !(*this == other);
}
-bool Position::operator==(const Position& other) const
+bool Position::operator==(Position const& other) const
{
return line == other.line && column == other.column;
}
-bool Position::operator<=(const Position& other) const
+bool Position::operator<=(Position const& other) const
{
return !(*this > other);
}
diff --git a/Userland/Libraries/LibCpp/Token.h b/Userland/Libraries/LibCpp/Token.h
index f4de7fbfcf..c592a924cb 100644
--- a/Userland/Libraries/LibCpp/Token.h
+++ b/Userland/Libraries/LibCpp/Token.h
@@ -83,10 +83,10 @@ struct Position {
size_t line { 0 };
size_t column { 0 };
- bool operator<(const Position&) const;
- bool operator<=(const Position&) const;
- bool operator>(const Position&) const;
- bool operator==(const Position&) const;
+ bool operator<(Position const&) const;
+ bool operator<=(Position const&) const;
+ bool operator>(Position const&) const;
+ bool operator==(Position const&) const;
};
struct Token {
@@ -96,7 +96,7 @@ struct Token {
#undef __TOKEN
};
- Token(Type type, const Position& start, const Position& end, StringView text)
+ Token(Type type, Position const& start, Position const& end, StringView text)
: m_type(type)
, m_start(start)
, m_end(end)
@@ -104,7 +104,7 @@ struct Token {
{
}
- static const char* type_to_string(Type t)
+ static char const* type_to_string(Type t)
{
switch (t) {
#define __TOKEN(x) \
@@ -119,11 +119,11 @@ struct Token {
String to_string() const;
String type_as_string() const;
- const Position& start() const { return m_start; }
- const Position& end() const { return m_end; }
+ Position const& start() const { return m_start; }
+ Position const& end() const { return m_end; }
- void set_start(const Position& other) { m_start = other; }
- void set_end(const Position& other) { m_end = other; }
+ void set_start(Position const& other) { m_start = other; }
+ void set_end(Position const& other) { m_end = other; }
Type type() const { return m_type; }
StringView text() const { return m_text; }
diff --git a/Userland/Libraries/LibCrypt/crypt.cpp b/Userland/Libraries/LibCrypt/crypt.cpp
index c952a74d07..9823ef980e 100644
--- a/Userland/Libraries/LibCrypt/crypt.cpp
+++ b/Userland/Libraries/LibCrypt/crypt.cpp
@@ -15,7 +15,7 @@ extern "C" {
static struct crypt_data crypt_data;
-char* crypt(const char* key, const char* salt)
+char* crypt(char const* key, char const* salt)
{
crypt_data.initialized = true;
return crypt_r(key, salt, &crypt_data);
@@ -24,7 +24,7 @@ char* crypt(const char* key, const char* salt)
static constexpr size_t crypt_salt_max = 16;
static constexpr size_t sha_string_length = 44;
-char* crypt_r(const char* key, const char* salt, struct crypt_data* data)
+char* crypt_r(char const* key, char const* salt, struct crypt_data* data)
{
if (!data->initialized) {
errno = EINVAL;
@@ -33,7 +33,7 @@ char* crypt_r(const char* key, const char* salt, struct crypt_data* data)
if (salt[0] == '$') {
if (salt[1] == '5') {
- const char* salt_value = salt + 3;
+ char const* salt_value = salt + 3;
size_t salt_len = min(strcspn(salt_value, "$"), crypt_salt_max);
size_t header_len = salt_len + 3;
@@ -46,7 +46,7 @@ char* crypt_r(const char* key, const char* salt, struct crypt_data* data)
Crypto::Hash::SHA256 sha;
sha.update(key);
- sha.update((const u8*)salt_value, salt_len);
+ sha.update((u8 const*)salt_value, salt_len);
auto digest = sha.digest();
auto string = encode_base64(ReadonlyBytes(digest.immutable_data(), digest.data_length()));
diff --git a/Userland/Libraries/LibCrypt/crypt.h b/Userland/Libraries/LibCrypt/crypt.h
index c51744a666..0a304ac047 100644
--- a/Userland/Libraries/LibCrypt/crypt.h
+++ b/Userland/Libraries/LibCrypt/crypt.h
@@ -22,7 +22,7 @@ struct crypt_data {
char result[65];
};
-char* crypt(const char* key, const char* salt);
-char* crypt_r(const char* key, const char* salt, struct crypt_data* data);
+char* crypt(char const* key, char const* salt);
+char* crypt_r(char const* key, char const* salt, struct crypt_data* data);
__END_DECLS
diff --git a/Userland/Libraries/LibCrypto/Authentication/GHash.cpp b/Userland/Libraries/LibCrypto/Authentication/GHash.cpp
index de06e63087..396da9b53f 100644
--- a/Userland/Libraries/LibCrypto/Authentication/GHash.cpp
+++ b/Userland/Libraries/LibCrypto/Authentication/GHash.cpp
@@ -12,12 +12,12 @@
namespace {
-static u32 to_u32(const u8* b)
+static u32 to_u32(u8 const* b)
{
return AK::convert_between_host_and_big_endian(ByteReader::load32(b));
}
-static void to_u8s(u8* b, const u32* w)
+static void to_u8s(u8* b, u32 const* w)
{
for (auto i = 0; i < 4; ++i) {
ByteReader::store(b + i * 4, AK::convert_between_host_and_big_endian(w[i]));
diff --git a/Userland/Libraries/LibCrypto/Authentication/GHash.h b/Userland/Libraries/LibCrypto/Authentication/GHash.h
index 0bfc8274cd..21b6039d5d 100644
--- a/Userland/Libraries/LibCrypto/Authentication/GHash.h
+++ b/Userland/Libraries/LibCrypto/Authentication/GHash.h
@@ -24,7 +24,7 @@ struct GHashDigest {
constexpr static size_t Size = 16;
u8 data[Size];
- const u8* immutable_data() const { return data; }
+ u8 const* immutable_data() const { return data; }
size_t data_length() { return Size; }
};
@@ -33,7 +33,7 @@ public:
using TagType = GHashDigest;
template<size_t N>
- explicit GHash(const char (&key)[N])
+ explicit GHash(char const (&key)[N])
: GHash({ key, N })
{
}
diff --git a/Userland/Libraries/LibCrypto/Authentication/HMAC.h b/Userland/Libraries/LibCrypto/Authentication/HMAC.h
index 8c80602dbe..29c9ce1300 100644
--- a/Userland/Libraries/LibCrypto/Authentication/HMAC.h
+++ b/Userland/Libraries/LibCrypto/Authentication/HMAC.h
@@ -39,23 +39,23 @@ public:
reset();
}
- TagType process(const u8* message, size_t length)
+ TagType process(u8 const* message, size_t length)
{
reset();
update(message, length);
return digest();
}
- void update(const u8* message, size_t length)
+ void update(u8 const* message, size_t length)
{
m_inner_hasher.update(message, length);
}
TagType process(ReadonlyBytes span) { return process(span.data(), span.size()); }
- TagType process(StringView string) { return process((const u8*)string.characters_without_null_termination(), string.length()); }
+ TagType process(StringView string) { return process((u8 const*)string.characters_without_null_termination(), string.length()); }
void update(ReadonlyBytes span) { return update(span.data(), span.size()); }
- void update(StringView string) { return update((const u8*)string.characters_without_null_termination(), string.length()); }
+ void update(StringView string) { return update((u8 const*)string.characters_without_null_termination(), string.length()); }
TagType digest()
{
@@ -84,7 +84,7 @@ public:
#endif
private:
- void derive_key(const u8* key, size_t length)
+ void derive_key(u8 const* key, size_t length)
{
auto block_size = m_inner_hasher.block_size();
// Note: The block size of all the current hash functions is 512 bits.
diff --git a/Userland/Libraries/LibCrypto/BigInt/Algorithms/BitwiseOperations.cpp b/Userland/Libraries/LibCrypto/BigInt/Algorithms/BitwiseOperations.cpp
index 55bcbb44e8..2003e4896c 100644
--- a/Userland/Libraries/LibCrypto/BigInt/Algorithms/BitwiseOperations.cpp
+++ b/Userland/Libraries/LibCrypto/BigInt/Algorithms/BitwiseOperations.cpp
@@ -32,7 +32,7 @@ FLATTEN void UnsignedBigIntegerAlgorithms::bitwise_or_without_allocation(
return;
}
- const UnsignedBigInteger *shorter, *longer;
+ UnsignedBigInteger const *shorter, *longer;
if (left.length() < right.length()) {
shorter = &left;
longer = &right;
@@ -71,7 +71,7 @@ FLATTEN void UnsignedBigIntegerAlgorithms::bitwise_and_without_allocation(
return;
}
- const UnsignedBigInteger *shorter, *longer;
+ UnsignedBigInteger const *shorter, *longer;
if (left.length() < right.length()) {
shorter = &left;
longer = &right;
@@ -110,7 +110,7 @@ FLATTEN void UnsignedBigIntegerAlgorithms::bitwise_xor_without_allocation(
return;
}
- const UnsignedBigInteger *shorter, *longer;
+ UnsignedBigInteger const *shorter, *longer;
if (left.length() < right.length()) {
shorter = &left;
longer = &right;
diff --git a/Userland/Libraries/LibCrypto/BigInt/Algorithms/SimpleOperations.cpp b/Userland/Libraries/LibCrypto/BigInt/Algorithms/SimpleOperations.cpp
index bf8e784180..78ac298c61 100644
--- a/Userland/Libraries/LibCrypto/BigInt/Algorithms/SimpleOperations.cpp
+++ b/Userland/Libraries/LibCrypto/BigInt/Algorithms/SimpleOperations.cpp
@@ -17,8 +17,8 @@ void UnsignedBigIntegerAlgorithms::add_without_allocation(
UnsignedBigInteger const& right,
UnsignedBigInteger& output)
{
- const UnsignedBigInteger* const longer = (left.length() > right.length()) ? &left : &right;
- const UnsignedBigInteger* const shorter = (longer == &right) ? &left : &right;
+ UnsignedBigInteger const* const longer = (left.length() > right.length()) ? &left : &right;
+ UnsignedBigInteger const* const shorter = (longer == &right) ? &left : &right;
output.set_to(*longer);
add_into_accumulator_without_allocation(output, *shorter);
diff --git a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp
index e95102cb84..da24f95b31 100644
--- a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp
+++ b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp
@@ -9,7 +9,7 @@
namespace Crypto {
-SignedBigInteger SignedBigInteger::import_data(const u8* ptr, size_t length)
+SignedBigInteger SignedBigInteger::import_data(u8 const* ptr, size_t length)
{
bool sign = *ptr;
auto unsigned_data = UnsignedBigInteger::import_data(ptr + 1, length - 1);
@@ -71,7 +71,7 @@ double SignedBigInteger::to_double() const
return -unsigned_value;
}
-FLATTEN SignedBigInteger SignedBigInteger::plus(const SignedBigInteger& other) const
+FLATTEN SignedBigInteger SignedBigInteger::plus(SignedBigInteger const& other) const
{
// If both are of the same sign, just add the unsigned data and return.
if (m_sign == other.m_sign)
@@ -81,7 +81,7 @@ FLATTEN SignedBigInteger SignedBigInteger::plus(const SignedBigInteger& other) c
return m_sign ? other.minus(this->m_unsigned_data) : minus(other.m_unsigned_data);
}
-FLATTEN SignedBigInteger SignedBigInteger::minus(const SignedBigInteger& other) const
+FLATTEN SignedBigInteger SignedBigInteger::minus(SignedBigInteger const& other) const
{
// If the signs are different, convert the op to an addition.
if (m_sign != other.m_sign) {
@@ -120,7 +120,7 @@ FLATTEN SignedBigInteger SignedBigInteger::minus(const SignedBigInteger& other)
return SignedBigInteger { 0 };
}
-FLATTEN SignedBigInteger SignedBigInteger::plus(const UnsignedBigInteger& other) const
+FLATTEN SignedBigInteger SignedBigInteger::plus(UnsignedBigInteger const& other) const
{
if (m_sign) {
if (other < m_unsigned_data)
@@ -132,7 +132,7 @@ FLATTEN SignedBigInteger SignedBigInteger::plus(const UnsignedBigInteger& other)
return { m_unsigned_data.plus(other), false };
}
-FLATTEN SignedBigInteger SignedBigInteger::minus(const UnsignedBigInteger& other) const
+FLATTEN SignedBigInteger SignedBigInteger::minus(UnsignedBigInteger const& other) const
{
if (m_sign)
return { m_unsigned_data.plus(m_unsigned_data), true };
@@ -167,7 +167,7 @@ FLATTEN SignedDivisionResult SignedBigInteger::divided_by(UnsignedBigInteger con
};
}
-FLATTEN SignedBigInteger SignedBigInteger::bitwise_or(const SignedBigInteger& other) const
+FLATTEN SignedBigInteger SignedBigInteger::bitwise_or(SignedBigInteger const& other) const
{
// See bitwise_and() for derivations.
if (!is_negative() && !other.is_negative())
@@ -191,7 +191,7 @@ FLATTEN SignedBigInteger SignedBigInteger::bitwise_or(const SignedBigInteger& ot
return { unsigned_value().minus(1).bitwise_and(other.unsigned_value().minus(1)).plus(1), true };
}
-FLATTEN SignedBigInteger SignedBigInteger::bitwise_and(const SignedBigInteger& other) const
+FLATTEN SignedBigInteger SignedBigInteger::bitwise_and(SignedBigInteger const& other) const
{
if (!is_negative() && !other.is_negative())
return { unsigned_value().bitwise_and(other.unsigned_value()), false };
@@ -229,33 +229,33 @@ FLATTEN SignedBigInteger SignedBigInteger::bitwise_and(const SignedBigInteger& o
return { unsigned_value().minus(1).bitwise_or(other.unsigned_value().minus(1)).plus(1), true };
}
-FLATTEN SignedBigInteger SignedBigInteger::bitwise_xor(const SignedBigInteger& other) const
+FLATTEN SignedBigInteger SignedBigInteger::bitwise_xor(SignedBigInteger const& other) const
{
return bitwise_or(other).minus(bitwise_and(other));
}
-bool SignedBigInteger::operator==(const UnsignedBigInteger& other) const
+bool SignedBigInteger::operator==(UnsignedBigInteger const& other) const
{
if (m_sign)
return false;
return m_unsigned_data == other;
}
-bool SignedBigInteger::operator!=(const UnsignedBigInteger& other) const
+bool SignedBigInteger::operator!=(UnsignedBigInteger const& other) const
{
if (m_sign)
return true;
return m_unsigned_data != other;
}
-bool SignedBigInteger::operator<(const UnsignedBigInteger& other) const
+bool SignedBigInteger::operator<(UnsignedBigInteger const& other) const
{
if (m_sign)
return true;
return m_unsigned_data < other;
}
-bool SignedBigInteger::operator>(const UnsignedBigInteger& other) const
+bool SignedBigInteger::operator>(UnsignedBigInteger const& other) const
{
return *this != other && !(*this < other);
}
@@ -265,13 +265,13 @@ FLATTEN SignedBigInteger SignedBigInteger::shift_left(size_t num_bits) const
return SignedBigInteger { m_unsigned_data.shift_left(num_bits), m_sign };
}
-FLATTEN SignedBigInteger SignedBigInteger::multiplied_by(const SignedBigInteger& other) const
+FLATTEN SignedBigInteger SignedBigInteger::multiplied_by(SignedBigInteger const& other) const
{
bool result_sign = m_sign ^ other.m_sign;
return { m_unsigned_data.multiplied_by(other.m_unsigned_data), result_sign };
}
-FLATTEN SignedDivisionResult SignedBigInteger::divided_by(const SignedBigInteger& divisor) const
+FLATTEN SignedDivisionResult SignedBigInteger::divided_by(SignedBigInteger const& divisor) const
{
// Aa / Bb -> (A^B)q, Ar
bool result_sign = m_sign ^ divisor.m_sign;
@@ -292,7 +292,7 @@ void SignedBigInteger::set_bit_inplace(size_t bit_index)
m_unsigned_data.set_bit_inplace(bit_index);
}
-bool SignedBigInteger::operator==(const SignedBigInteger& other) const
+bool SignedBigInteger::operator==(SignedBigInteger const& other) const
{
if (is_invalid() != other.is_invalid())
return false;
@@ -303,12 +303,12 @@ bool SignedBigInteger::operator==(const SignedBigInteger& other) const
return m_sign == other.m_sign && m_unsigned_data == other.m_unsigned_data;
}
-bool SignedBigInteger::operator!=(const SignedBigInteger& other) const
+bool SignedBigInteger::operator!=(SignedBigInteger const& other) const
{
return !(*this == other);
}
-bool SignedBigInteger::operator<(const SignedBigInteger& other) const
+bool SignedBigInteger::operator<(SignedBigInteger const& other) const
{
if (m_sign ^ other.m_sign)
return m_sign;
@@ -319,24 +319,24 @@ bool SignedBigInteger::operator<(const SignedBigInteger& other) const
return m_unsigned_data < other.m_unsigned_data;
}
-bool SignedBigInteger::operator<=(const SignedBigInteger& other) const
+bool SignedBigInteger::operator<=(SignedBigInteger const& other) const
{
return *this < other || *this == other;
}
-bool SignedBigInteger::operator>(const SignedBigInteger& other) const
+bool SignedBigInteger::operator>(SignedBigInteger const& other) const
{
return *this != other && !(*this < other);
}
-bool SignedBigInteger::operator>=(const SignedBigInteger& other) const
+bool SignedBigInteger::operator>=(SignedBigInteger const& other) const
{
return !(*this < other);
}
}
-ErrorOr<void> AK::Formatter<Crypto::SignedBigInteger>::format(FormatBuilder& fmtbuilder, const Crypto::SignedBigInteger& value)
+ErrorOr<void> AK::Formatter<Crypto::SignedBigInteger>::format(FormatBuilder& fmtbuilder, Crypto::SignedBigInteger const& value)
{
if (value.is_negative())
TRY(fmtbuilder.put_string("-"));
diff --git a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h
index 5b5468a728..e39e37b038 100644
--- a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h
+++ b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h
@@ -45,8 +45,8 @@ public:
return { UnsignedBigInteger::create_invalid(), false };
}
- static SignedBigInteger import_data(StringView data) { return import_data((const u8*)data.characters_without_null_termination(), data.length()); }
- static SignedBigInteger import_data(const u8* ptr, size_t length);
+ static SignedBigInteger import_data(StringView data) { return import_data((u8 const*)data.characters_without_null_termination(), data.length()); }
+ static SignedBigInteger import_data(u8 const* ptr, size_t length);
static SignedBigInteger create_from(i64 value)
{
@@ -69,8 +69,8 @@ public:
u64 to_u64() const;
double to_double() const;
- const UnsignedBigInteger& unsigned_value() const { return m_unsigned_data; }
- const Vector<u32, STARTING_WORD_SIZE> words() const { return m_unsigned_data.words(); }
+ UnsignedBigInteger const& unsigned_value() const { return m_unsigned_data; }
+ Vector<u32, STARTING_WORD_SIZE> const words() const { return m_unsigned_data.words(); }
bool is_negative() const { return m_sign; }
void negate()
@@ -90,7 +90,7 @@ public:
m_unsigned_data.set_to((u32)other);
m_sign = other < 0;
}
- void set_to(const SignedBigInteger& other)
+ void set_to(SignedBigInteger const& other)
{
m_unsigned_data.set_to(other.m_unsigned_data);
m_sign = other.m_sign;
@@ -107,36 +107,36 @@ public:
size_t length() const { return m_unsigned_data.length() + 1; }
size_t trimmed_length() const { return m_unsigned_data.trimmed_length() + 1; };
- SignedBigInteger plus(const SignedBigInteger& other) const;
- SignedBigInteger minus(const SignedBigInteger& other) const;
- SignedBigInteger bitwise_or(const SignedBigInteger& other) const;
- SignedBigInteger bitwise_and(const SignedBigInteger& other) const;
- SignedBigInteger bitwise_xor(const SignedBigInteger& other) const;
+ SignedBigInteger plus(SignedBigInteger const& other) const;
+ SignedBigInteger minus(SignedBigInteger const& other) const;
+ SignedBigInteger bitwise_or(SignedBigInteger const& other) const;
+ SignedBigInteger bitwise_and(SignedBigInteger const& other) const;
+ SignedBigInteger bitwise_xor(SignedBigInteger const& other) const;
SignedBigInteger bitwise_not() const;
SignedBigInteger shift_left(size_t num_bits) const;
- SignedBigInteger multiplied_by(const SignedBigInteger& other) const;
- SignedDivisionResult divided_by(const SignedBigInteger& divisor) const;
+ SignedBigInteger multiplied_by(SignedBigInteger const& other) const;
+ SignedDivisionResult divided_by(SignedBigInteger const& divisor) const;
- SignedBigInteger plus(const UnsignedBigInteger& other) const;
- SignedBigInteger minus(const UnsignedBigInteger& other) const;
- SignedBigInteger multiplied_by(const UnsignedBigInteger& other) const;
- SignedDivisionResult divided_by(const UnsignedBigInteger& divisor) const;
+ SignedBigInteger plus(UnsignedBigInteger const& other) const;
+ SignedBigInteger minus(UnsignedBigInteger const& other) const;
+ SignedBigInteger multiplied_by(UnsignedBigInteger const& other) const;
+ SignedDivisionResult divided_by(UnsignedBigInteger const& divisor) const;
u32 hash() const;
void set_bit_inplace(size_t bit_index);
- bool operator==(const SignedBigInteger& other) const;
- bool operator!=(const SignedBigInteger& other) const;
- bool operator<(const SignedBigInteger& other) const;
- bool operator<=(const SignedBigInteger& other) const;
- bool operator>(const SignedBigInteger& other) const;
- bool operator>=(const SignedBigInteger& other) const;
+ bool operator==(SignedBigInteger const& other) const;
+ bool operator!=(SignedBigInteger const& other) const;
+ bool operator<(SignedBigInteger const& other) const;
+ bool operator<=(SignedBigInteger const& other) const;
+ bool operator>(SignedBigInteger const& other) const;
+ bool operator>=(SignedBigInteger const& other) const;
- bool operator==(const UnsignedBigInteger& other) const;
- bool operator!=(const UnsignedBigInteger& other) const;
- bool operator<(const UnsignedBigInteger& other) const;
- bool operator>(const UnsignedBigInteger& other) const;
+ bool operator==(UnsignedBigInteger const& other) const;
+ bool operator!=(UnsignedBigInteger const& other) const;
+ bool operator<(UnsignedBigInteger const& other) const;
+ bool operator>(UnsignedBigInteger const& other) const;
private:
void ensure_sign_is_valid()
@@ -162,7 +162,7 @@ struct AK::Formatter<Crypto::SignedBigInteger> : AK::Formatter<Crypto::UnsignedB
};
inline Crypto::SignedBigInteger
-operator""_sbigint(const char* string, size_t length)
+operator""_sbigint(char const* string, size_t length)
{
return Crypto::SignedBigInteger::from_base(10, { string, length });
}
diff --git a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp
index a8082721d1..b47b0f05ec 100644
--- a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp
+++ b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp
@@ -13,7 +13,7 @@
namespace Crypto {
-UnsignedBigInteger::UnsignedBigInteger(const u8* ptr, size_t length)
+UnsignedBigInteger::UnsignedBigInteger(u8 const* ptr, size_t length)
{
m_words.resize_and_keep_capacity((length + sizeof(u32) - 1) / sizeof(u32));
size_t in = length, out = 0;
@@ -136,7 +136,7 @@ void UnsignedBigInteger::set_to(UnsignedBigInteger::Word other)
m_cached_hash = 0;
}
-void UnsignedBigInteger::set_to(const UnsignedBigInteger& other)
+void UnsignedBigInteger::set_to(UnsignedBigInteger const& other)
{
m_is_invalid = other.m_is_invalid;
m_words.resize_and_keep_capacity(other.m_words.size());
@@ -195,7 +195,7 @@ size_t UnsignedBigInteger::one_based_index_of_highest_set_bit() const
return index;
}
-FLATTEN UnsignedBigInteger UnsignedBigInteger::plus(const UnsignedBigInteger& other) const
+FLATTEN UnsignedBigInteger UnsignedBigInteger::plus(UnsignedBigInteger const& other) const
{
UnsignedBigInteger result;
@@ -204,7 +204,7 @@ FLATTEN UnsignedBigInteger UnsignedBigInteger::plus(const UnsignedBigInteger& ot
return result;
}
-FLATTEN UnsignedBigInteger UnsignedBigInteger::minus(const UnsignedBigInteger& other) const
+FLATTEN UnsignedBigInteger UnsignedBigInteger::minus(UnsignedBigInteger const& other) const
{
UnsignedBigInteger result;
@@ -213,7 +213,7 @@ FLATTEN UnsignedBigInteger UnsignedBigInteger::minus(const UnsignedBigInteger& o
return result;
}
-FLATTEN UnsignedBigInteger UnsignedBigInteger::bitwise_or(const UnsignedBigInteger& other) const
+FLATTEN UnsignedBigInteger UnsignedBigInteger::bitwise_or(UnsignedBigInteger const& other) const
{
UnsignedBigInteger result;
@@ -222,7 +222,7 @@ FLATTEN UnsignedBigInteger UnsignedBigInteger::bitwise_or(const UnsignedBigInteg
return result;
}
-FLATTEN UnsignedBigInteger UnsignedBigInteger::bitwise_and(const UnsignedBigInteger& other) const
+FLATTEN UnsignedBigInteger UnsignedBigInteger::bitwise_and(UnsignedBigInteger const& other) const
{
UnsignedBigInteger result;
@@ -231,7 +231,7 @@ FLATTEN UnsignedBigInteger UnsignedBigInteger::bitwise_and(const UnsignedBigInte
return result;
}
-FLATTEN UnsignedBigInteger UnsignedBigInteger::bitwise_xor(const UnsignedBigInteger& other) const
+FLATTEN UnsignedBigInteger UnsignedBigInteger::bitwise_xor(UnsignedBigInteger const& other) const
{
UnsignedBigInteger result;
@@ -260,7 +260,7 @@ FLATTEN UnsignedBigInteger UnsignedBigInteger::shift_left(size_t num_bits) const
return output;
}
-FLATTEN UnsignedBigInteger UnsignedBigInteger::multiplied_by(const UnsignedBigInteger& other) const
+FLATTEN UnsignedBigInteger UnsignedBigInteger::multiplied_by(UnsignedBigInteger const& other) const
{
UnsignedBigInteger result;
UnsignedBigInteger temp_shift_result;
@@ -272,7 +272,7 @@ FLATTEN UnsignedBigInteger UnsignedBigInteger::multiplied_by(const UnsignedBigIn
return result;
}
-FLATTEN UnsignedDivisionResult UnsignedBigInteger::divided_by(const UnsignedBigInteger& divisor) const
+FLATTEN UnsignedDivisionResult UnsignedBigInteger::divided_by(UnsignedBigInteger const& divisor) const
{
UnsignedBigInteger quotient;
UnsignedBigInteger remainder;
@@ -299,7 +299,7 @@ u32 UnsignedBigInteger::hash() const
if (m_cached_hash != 0)
return m_cached_hash;
- return m_cached_hash = string_hash((const char*)m_words.data(), sizeof(Word) * m_words.size());
+ return m_cached_hash = string_hash((char const*)m_words.data(), sizeof(Word) * m_words.size());
}
void UnsignedBigInteger::set_bit_inplace(size_t bit_index)
@@ -318,7 +318,7 @@ void UnsignedBigInteger::set_bit_inplace(size_t bit_index)
m_cached_hash = 0;
}
-bool UnsignedBigInteger::operator==(const UnsignedBigInteger& other) const
+bool UnsignedBigInteger::operator==(UnsignedBigInteger const& other) const
{
if (is_invalid() != other.is_invalid())
return false;
@@ -331,12 +331,12 @@ bool UnsignedBigInteger::operator==(const UnsignedBigInteger& other) const
return !__builtin_memcmp(m_words.data(), other.words().data(), length * (BITS_IN_WORD / 8));
}
-bool UnsignedBigInteger::operator!=(const UnsignedBigInteger& other) const
+bool UnsignedBigInteger::operator!=(UnsignedBigInteger const& other) const
{
return !(*this == other);
}
-bool UnsignedBigInteger::operator<(const UnsignedBigInteger& other) const
+bool UnsignedBigInteger::operator<(UnsignedBigInteger const& other) const
{
auto length = trimmed_length();
auto other_length = other.trimmed_length();
@@ -360,7 +360,7 @@ bool UnsignedBigInteger::operator<(const UnsignedBigInteger& other) const
return false;
}
-bool UnsignedBigInteger::operator>(const UnsignedBigInteger& other) const
+bool UnsignedBigInteger::operator>(UnsignedBigInteger const& other) const
{
return *this != other && !(*this < other);
}
@@ -372,7 +372,7 @@ bool UnsignedBigInteger::operator>=(UnsignedBigInteger const& other) const
}
-ErrorOr<void> AK::Formatter<Crypto::UnsignedBigInteger>::format(FormatBuilder& fmtbuilder, const Crypto::UnsignedBigInteger& value)
+ErrorOr<void> AK::Formatter<Crypto::UnsignedBigInteger>::format(FormatBuilder& fmtbuilder, Crypto::UnsignedBigInteger const& value)
{
if (value.is_invalid())
return Formatter<StringView>::format(fmtbuilder, "invalid");
diff --git a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h
index 36cb4c1707..4a2c4878d5 100644
--- a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h
+++ b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h
@@ -30,14 +30,14 @@ public:
{
}
- explicit UnsignedBigInteger(const u8* ptr, size_t length);
+ explicit UnsignedBigInteger(u8 const* ptr, size_t length);
UnsignedBigInteger() = default;
static UnsignedBigInteger create_invalid();
- static UnsignedBigInteger import_data(StringView data) { return import_data((const u8*)data.characters_without_null_termination(), data.length()); }
- static UnsignedBigInteger import_data(const u8* ptr, size_t length)
+ static UnsignedBigInteger import_data(StringView data) { return import_data((u8 const*)data.characters_without_null_termination(), data.length()); }
+ static UnsignedBigInteger import_data(u8 const* ptr, size_t length)
{
return UnsignedBigInteger(ptr, length);
}
@@ -60,11 +60,11 @@ public:
u64 to_u64() const;
double to_double() const;
- const Vector<Word, STARTING_WORD_SIZE>& words() const { return m_words; }
+ Vector<Word, STARTING_WORD_SIZE> const& words() const { return m_words; }
void set_to_0();
void set_to(Word other);
- void set_to(const UnsignedBigInteger& other);
+ void set_to(UnsignedBigInteger const& other);
void invalidate()
{
@@ -86,24 +86,24 @@ public:
size_t one_based_index_of_highest_set_bit() const;
- UnsignedBigInteger plus(const UnsignedBigInteger& other) const;
- UnsignedBigInteger minus(const UnsignedBigInteger& other) const;
- UnsignedBigInteger bitwise_or(const UnsignedBigInteger& other) const;
- UnsignedBigInteger bitwise_and(const UnsignedBigInteger& other) const;
- UnsignedBigInteger bitwise_xor(const UnsignedBigInteger& other) const;
+ UnsignedBigInteger plus(UnsignedBigInteger const& other) const;
+ UnsignedBigInteger minus(UnsignedBigInteger const& other) const;
+ UnsignedBigInteger bitwise_or(UnsignedBigInteger const& other) const;
+ UnsignedBigInteger bitwise_and(UnsignedBigInteger const& other) const;
+ UnsignedBigInteger bitwise_xor(UnsignedBigInteger const& other) const;
UnsignedBigInteger bitwise_not_fill_to_one_based_index(size_t) const;
UnsignedBigInteger shift_left(size_t num_bits) const;
- UnsignedBigInteger multiplied_by(const UnsignedBigInteger& other) const;
- UnsignedDivisionResult divided_by(const UnsignedBigInteger& divisor) const;
+ UnsignedBigInteger multiplied_by(UnsignedBigInteger const& other) const;
+ UnsignedDivisionResult divided_by(UnsignedBigInteger const& divisor) const;
u32 hash() const;
void set_bit_inplace(size_t bit_index);
- bool operator==(const UnsignedBigInteger& other) const;
- bool operator!=(const UnsignedBigInteger& other) const;
- bool operator<(const UnsignedBigInteger& other) const;
- bool operator>(const UnsignedBigInteger& other) const;
+ bool operator==(UnsignedBigInteger const& other) const;
+ bool operator!=(UnsignedBigInteger const& other) const;
+ bool operator<(UnsignedBigInteger const& other) const;
+ bool operator>(UnsignedBigInteger const& other) const;
bool operator>=(UnsignedBigInteger const& other) const;
private:
@@ -133,7 +133,7 @@ struct AK::Formatter<Crypto::UnsignedBigInteger> : Formatter<StringView> {
};
inline Crypto::UnsignedBigInteger
-operator""_bigint(const char* string, size_t length)
+operator""_bigint(char const* string, size_t length)
{
return Crypto::UnsignedBigInteger::from_base(10, { string, length });
}
diff --git a/Userland/Libraries/LibCrypto/Cipher/AES.cpp b/Userland/Libraries/LibCrypto/Cipher/AES.cpp
index 989134d456..b853599f88 100644
--- a/Userland/Libraries/LibCrypto/Cipher/AES.cpp
+++ b/Userland/Libraries/LibCrypto/Cipher/AES.cpp
@@ -197,13 +197,13 @@ void AESCipherKey::expand_decrypt_key(ReadonlyBytes user_key, size_t bits)
}
}
-void AESCipher::encrypt_block(const AESCipherBlock& in, AESCipherBlock& out)
+void AESCipher::encrypt_block(AESCipherBlock const& in, AESCipherBlock& out)
{
u32 s0, s1, s2, s3, t0, t1, t2, t3;
size_t r { 0 };
- const auto& dec_key = key();
- const auto* round_keys = dec_key.round_keys();
+ auto const& dec_key = key();
+ auto const* round_keys = dec_key.round_keys();
s0 = get_key(in.bytes().offset_pointer(0)) ^ round_keys[0];
s1 = get_key(in.bytes().offset_pointer(4)) ^ round_keys[1];
@@ -289,13 +289,13 @@ void AESCipher::encrypt_block(const AESCipherBlock& in, AESCipherBlock& out)
// clang-format on
}
-void AESCipher::decrypt_block(const AESCipherBlock& in, AESCipherBlock& out)
+void AESCipher::decrypt_block(AESCipherBlock const& in, AESCipherBlock& out)
{
u32 s0, s1, s2, s3, t0, t1, t2, t3;
size_t r { 0 };
- const auto& dec_key = key();
- const auto* round_keys = dec_key.round_keys();
+ auto const& dec_key = key();
+ auto const* round_keys = dec_key.round_keys();
s0 = get_key(in.bytes().offset_pointer(0)) ^ round_keys[0];
s1 = get_key(in.bytes().offset_pointer(4)) ^ round_keys[1];
diff --git a/Userland/Libraries/LibCrypto/Cipher/AES.h b/Userland/Libraries/LibCrypto/Cipher/AES.h
index dd92484d59..4aa94bf6dd 100644
--- a/Userland/Libraries/LibCrypto/Cipher/AES.h
+++ b/Userland/Libraries/LibCrypto/Cipher/AES.h
@@ -28,7 +28,7 @@ public:
: CipherBlock(mode)
{
}
- AESCipherBlock(const u8* data, size_t length, PaddingMode mode = PaddingMode::CMS)
+ AESCipherBlock(u8 const* data, size_t length, PaddingMode mode = PaddingMode::CMS)
: AESCipherBlock(mode)
{
CipherBlock::overwrite(data, length);
@@ -40,7 +40,7 @@ public:
virtual Bytes bytes() override { return Bytes { m_data, sizeof(m_data) }; }
virtual void overwrite(ReadonlyBytes) override;
- virtual void overwrite(const u8* data, size_t size) override { overwrite({ data, size }); }
+ virtual void overwrite(u8 const* data, size_t size) override { overwrite({ data, size }); }
virtual void apply_initialization_vector(ReadonlyBytes ivec) override
{
@@ -68,9 +68,9 @@ struct AESCipherKey : public CipherKey {
String to_string() const;
#endif
- const u32* round_keys() const
+ u32 const* round_keys() const
{
- return (const u32*)m_rd_keys;
+ return (u32 const*)m_rd_keys;
}
AESCipherKey(ReadonlyBytes user_key, size_t key_bits, Intent intent)
@@ -114,11 +114,11 @@ public:
{
}
- virtual const AESCipherKey& key() const override { return m_key; };
+ virtual AESCipherKey const& key() const override { return m_key; };
virtual AESCipherKey& key() override { return m_key; };
- virtual void encrypt_block(const BlockType& in, BlockType& out) override;
- virtual void decrypt_block(const BlockType& in, BlockType& out) override;
+ virtual void encrypt_block(BlockType const& in, BlockType& out) override;
+ virtual void decrypt_block(BlockType const& in, BlockType& out) override;
#ifndef KERNEL
virtual String class_name() const override
diff --git a/Userland/Libraries/LibCrypto/Cipher/Cipher.h b/Userland/Libraries/LibCrypto/Cipher/Cipher.h
index 88178a1f38..644dd1353a 100644
--- a/Userland/Libraries/LibCrypto/Cipher/Cipher.h
+++ b/Userland/Libraries/LibCrypto/Cipher/Cipher.h
@@ -43,7 +43,7 @@ public:
virtual ReadonlyBytes bytes() const = 0;
virtual void overwrite(ReadonlyBytes) = 0;
- virtual void overwrite(const u8* data, size_t size) { overwrite({ data, size }); }
+ virtual void overwrite(u8 const* data, size_t size) { overwrite({ data, size }); }
virtual void apply_initialization_vector(ReadonlyBytes ivec) = 0;
@@ -102,15 +102,15 @@ public:
{
}
- virtual const KeyType& key() const = 0;
+ virtual KeyType const& key() const = 0;
virtual KeyType& key() = 0;
constexpr static size_t block_size() { return BlockType::block_size(); }
PaddingMode padding_mode() const { return m_padding_mode; }
- virtual void encrypt_block(const BlockType& in, BlockType& out) = 0;
- virtual void decrypt_block(const BlockType& in, BlockType& out) = 0;
+ virtual void encrypt_block(BlockType const& in, BlockType& out) = 0;
+ virtual void decrypt_block(BlockType const& in, BlockType& out) = 0;
#ifndef KERNEL
virtual String class_name() const = 0;
diff --git a/Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h b/Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h
index 979ca281ed..3639282bf8 100644
--- a/Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h
+++ b/Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h
@@ -99,7 +99,7 @@ public:
// FIXME: Add back the default intent parameter once clang-11 is the default in GitHub Actions.
// Once added back, remove the parameter where it's constructed in get_random_bytes in Kernel/Random.h.
template<typename KeyType, typename... Args>
- explicit constexpr CTR(const KeyType& user_key, size_t key_bits, Intent, Args... args)
+ explicit constexpr CTR(KeyType const& user_key, size_t key_bits, Intent, Args... args)
: Mode<T>(user_key, key_bits, Intent::Encryption, args...)
{
}
@@ -126,7 +126,7 @@ public:
this->encrypt_or_stream(&in, out, ivec, ivec_out);
}
- void key_stream(Bytes& out, const Bytes& ivec = {}, Bytes* ivec_out = nullptr)
+ void key_stream(Bytes& out, Bytes const& ivec = {}, Bytes* ivec_out = nullptr)
{
this->encrypt_or_stream(nullptr, out, ivec, ivec_out);
}
@@ -144,7 +144,7 @@ private:
protected:
constexpr static IncrementFunctionType increment {};
- void encrypt_or_stream(const ReadonlyBytes* in, Bytes& out, ReadonlyBytes ivec, Bytes* ivec_out = nullptr)
+ void encrypt_or_stream(ReadonlyBytes const* in, Bytes& out, ReadonlyBytes ivec, Bytes* ivec_out = nullptr)
{
size_t length;
if (in) {
diff --git a/Userland/Libraries/LibCrypto/Hash/HashFunction.h b/Userland/Libraries/LibCrypto/Hash/HashFunction.h
index ff73aa6e61..3d875ff5db 100644
--- a/Userland/Libraries/LibCrypto/Hash/HashFunction.h
+++ b/Userland/Libraries/LibCrypto/Hash/HashFunction.h
@@ -19,7 +19,7 @@ struct Digest {
constexpr static size_t Size = DigestS / 8;
u8 data[Size];
- [[nodiscard]] ALWAYS_INLINE const u8* immutable_data() const { return data; }
+ [[nodiscard]] ALWAYS_INLINE u8 const* immutable_data() const { return data; }
[[nodiscard]] ALWAYS_INLINE size_t data_length() const { return Size; }
[[nodiscard]] ALWAYS_INLINE ReadonlyBytes bytes() const { return { immutable_data(), data_length() }; }
@@ -39,12 +39,12 @@ public:
constexpr static size_t block_size() { return BlockSize; }
constexpr static size_t digest_size() { return DigestSize; }
- virtual void update(const u8*, size_t) = 0;
+ virtual void update(u8 const*, size_t) = 0;
void update(Bytes buffer) { update(buffer.data(), buffer.size()); }
void update(ReadonlyBytes buffer) { update(buffer.data(), buffer.size()); }
- void update(const ByteBuffer& buffer) { update(buffer.data(), buffer.size()); }
- void update(StringView string) { update((const u8*)string.characters_without_null_termination(), string.length()); }
+ void update(ByteBuffer const& buffer) { update(buffer.data(), buffer.size()); }
+ void update(StringView string) { update((u8 const*)string.characters_without_null_termination(), string.length()); }
virtual DigestType peek() = 0;
virtual DigestType digest() = 0;
diff --git a/Userland/Libraries/LibCrypto/Hash/HashManager.h b/Userland/Libraries/LibCrypto/Hash/HashManager.h
index 10628bc52c..834823bf5f 100644
--- a/Userland/Libraries/LibCrypto/Hash/HashManager.h
+++ b/Userland/Libraries/LibCrypto/Hash/HashManager.h
@@ -59,25 +59,25 @@ struct MultiHashDigestVariant {
{
}
- [[nodiscard]] const u8* immutable_data() const
+ [[nodiscard]] u8 const* immutable_data() const
{
return m_digest.visit(
- [&](const Empty&) -> const u8* { VERIFY_NOT_REACHED(); },
- [&](const auto& value) { return value.immutable_data(); });
+ [&](Empty const&) -> u8 const* { VERIFY_NOT_REACHED(); },
+ [&](auto const& value) { return value.immutable_data(); });
}
[[nodiscard]] size_t data_length() const
{
return m_digest.visit(
- [&](const Empty&) -> size_t { VERIFY_NOT_REACHED(); },
- [&](const auto& value) { return value.data_length(); });
+ [&](Empty const&) -> size_t { VERIFY_NOT_REACHED(); },
+ [&](auto const& value) { return value.data_length(); });
}
[[nodiscard]] ReadonlyBytes bytes() const
{
return m_digest.visit(
- [&](const Empty&) -> ReadonlyBytes { VERIFY_NOT_REACHED(); },
- [&](const auto& value) { return value.bytes(); });
+ [&](Empty const&) -> ReadonlyBytes { VERIFY_NOT_REACHED(); },
+ [&](auto const& value) { return value.bytes(); });
}
using DigestVariant = Variant<Empty, MD5::DigestType, SHA1::DigestType, SHA256::DigestType, SHA384::DigestType, SHA512::DigestType>;
@@ -93,7 +93,7 @@ public:
m_pre_init_buffer = ByteBuffer();
}
- Manager(const Manager& other) // NOT a copy constructor!
+ Manager(Manager const& other) // NOT a copy constructor!
{
m_pre_init_buffer = ByteBuffer(); // will not be used
initialize(other.m_kind);
@@ -113,15 +113,15 @@ public:
inline size_t digest_size() const
{
return m_algorithm.visit(
- [&](const Empty&) -> size_t { return 0; },
- [&](const auto& hash) { return hash.digest_size(); });
+ [&](Empty const&) -> size_t { return 0; },
+ [&](auto const& hash) { return hash.digest_size(); });
}
inline size_t block_size() const
{
return m_algorithm.visit(
- [&](const Empty&) -> size_t { return 0; },
- [&](const auto& hash) { return hash.block_size(); });
+ [&](Empty const&) -> size_t { return 0; },
+ [&](auto const& hash) { return hash.block_size(); });
}
inline void initialize(HashKind kind)
@@ -154,7 +154,7 @@ public:
}
}
- virtual void update(const u8* data, size_t length) override
+ virtual void update(u8 const* data, size_t length) override
{
auto size = m_pre_init_buffer.size();
if (size) {
@@ -195,8 +195,8 @@ public:
virtual String class_name() const override
{
return m_algorithm.visit(
- [&](const Empty&) -> String { return "UninitializedHashManager"; },
- [&](const auto& hash) { return hash.class_name(); });
+ [&](Empty const&) -> String { return "UninitializedHashManager"; },
+ [&](auto const& hash) { return hash.class_name(); });
}
#endif
diff --git a/Userland/Libraries/LibCrypto/Hash/MD5.cpp b/Userland/Libraries/LibCrypto/Hash/MD5.cpp
index e698021cff..72cb516d0c 100644
--- a/Userland/Libraries/LibCrypto/Hash/MD5.cpp
+++ b/Userland/Libraries/LibCrypto/Hash/MD5.cpp
@@ -48,7 +48,7 @@ static constexpr void round_4(u32& a, u32 b, u32 c, u32 d, u32 x, u32 s, u32 ac)
namespace Crypto {
namespace Hash {
-void MD5::update(const u8* input, size_t length)
+void MD5::update(u8 const* input, size_t length)
{
auto index = (u32)(m_count[0] >> 3) & 0x3f;
size_t offset { 0 };
@@ -101,7 +101,7 @@ MD5::DigestType MD5::peek()
return digest;
}
-void MD5::encode(const u32* from, u8* to, size_t length)
+void MD5::encode(u32 const* from, u8* to, size_t length)
{
for (size_t i = 0, j = 0; j < length; ++i, j += 4) {
to[j] = (u8)(from[i] & 0xff);
@@ -111,13 +111,13 @@ void MD5::encode(const u32* from, u8* to, size_t length)
}
}
-void MD5::decode(const u8* from, u32* to, size_t length)
+void MD5::decode(u8 const* from, u32* to, size_t length)
{
for (size_t i = 0, j = 0; j < length; ++i, j += 4)
to[i] = (((u32)from[j]) | (((u32)from[j + 1]) << 8) | (((u32)from[j + 2]) << 16) | (((u32)from[j + 3]) << 24));
}
-void MD5::transform(const u8* block)
+void MD5::transform(u8 const* block)
{
auto a = m_A;
auto b = m_B;
diff --git a/Userland/Libraries/LibCrypto/Hash/MD5.h b/Userland/Libraries/LibCrypto/Hash/MD5.h
index 9c55b38b86..087ae022bd 100644
--- a/Userland/Libraries/LibCrypto/Hash/MD5.h
+++ b/Userland/Libraries/LibCrypto/Hash/MD5.h
@@ -52,7 +52,7 @@ class MD5 final : public HashFunction<512, 128> {
public:
using HashFunction::update;
- virtual void update(const u8*, size_t) override;
+ virtual void update(u8 const*, size_t) override;
virtual DigestType digest() override;
virtual DigestType peek() override;
@@ -63,15 +63,15 @@ public:
}
#endif
- inline static DigestType hash(const u8* data, size_t length)
+ inline static DigestType hash(u8 const* data, size_t length)
{
MD5 md5;
md5.update(data, length);
return md5.digest();
}
- inline static DigestType hash(const ByteBuffer& buffer) { return hash(buffer.data(), buffer.size()); }
- inline static DigestType hash(StringView buffer) { return hash((const u8*)buffer.characters_without_null_termination(), buffer.length()); }
+ inline static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
+ inline static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
inline virtual void reset() override
{
m_A = MD5Constants::init_A;
@@ -86,10 +86,10 @@ public:
}
private:
- inline void transform(const u8*);
+ inline void transform(u8 const*);
- static void encode(const u32* from, u8* to, size_t length);
- static void decode(const u8* from, u32* to, size_t length);
+ static void encode(u32 const* from, u8* to, size_t length);
+ static void decode(u8 const* from, u32* to, size_t length);
u32 m_A { MD5Constants::init_A }, m_B { MD5Constants::init_B }, m_C { MD5Constants::init_C }, m_D { MD5Constants::init_D };
u32 m_count[2] { 0, 0 };
diff --git a/Userland/Libraries/LibCrypto/Hash/SHA1.cpp b/Userland/Libraries/LibCrypto/Hash/SHA1.cpp
index edb699d708..6202225a8b 100644
--- a/Userland/Libraries/LibCrypto/Hash/SHA1.cpp
+++ b/Userland/Libraries/LibCrypto/Hash/SHA1.cpp
@@ -17,11 +17,11 @@ static constexpr auto ROTATE_LEFT(u32 value, size_t bits)
return (value << bits) | (value >> (32 - bits));
}
-inline void SHA1::transform(const u8* data)
+inline void SHA1::transform(u8 const* data)
{
u32 blocks[80];
for (size_t i = 0; i < 16; ++i)
- blocks[i] = AK::convert_between_host_and_network_endian(((const u32*)data)[i]);
+ blocks[i] = AK::convert_between_host_and_network_endian(((u32 const*)data)[i]);
// w[i] = (w[i-3] xor w[i-8] xor w[i-14] xor w[i-16]) leftrotate 1
for (size_t i = 16; i < Rounds; ++i)
@@ -67,7 +67,7 @@ inline void SHA1::transform(const u8* data)
secure_zero(blocks, 16 * sizeof(u32));
}
-void SHA1::update(const u8* message, size_t length)
+void SHA1::update(u8 const* message, size_t length)
{
for (size_t i = 0; i < length; ++i) {
if (m_data_length == BlockSize) {
diff --git a/Userland/Libraries/LibCrypto/Hash/SHA1.h b/Userland/Libraries/LibCrypto/Hash/SHA1.h
index 8fcbfc7f56..200cc1f509 100644
--- a/Userland/Libraries/LibCrypto/Hash/SHA1.h
+++ b/Userland/Libraries/LibCrypto/Hash/SHA1.h
@@ -37,20 +37,20 @@ public:
reset();
}
- virtual void update(const u8*, size_t) override;
+ virtual void update(u8 const*, size_t) override;
virtual DigestType digest() override;
virtual DigestType peek() override;
- inline static DigestType hash(const u8* data, size_t length)
+ inline static DigestType hash(u8 const* data, size_t length)
{
SHA1 sha;
sha.update(data, length);
return sha.digest();
}
- inline static DigestType hash(const ByteBuffer& buffer) { return hash(buffer.data(), buffer.size()); }
- inline static DigestType hash(StringView buffer) { return hash((const u8*)buffer.characters_without_null_termination(), buffer.length()); }
+ inline static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
+ inline static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
#ifndef KERNEL
virtual String class_name() const override
@@ -68,7 +68,7 @@ public:
}
private:
- inline void transform(const u8*);
+ inline void transform(u8 const*);
u8 m_data_buffer[BlockSize] {};
size_t m_data_length { 0 };
diff --git a/Userland/Libraries/LibCrypto/Hash/SHA2.cpp b/Userland/Libraries/LibCrypto/Hash/SHA2.cpp
index 85a4a0dd87..6876e1e2b5 100644
--- a/Userland/Libraries/LibCrypto/Hash/SHA2.cpp
+++ b/Userland/Libraries/LibCrypto/Hash/SHA2.cpp
@@ -25,7 +25,7 @@ constexpr static auto EP1(u64 x) { return ROTRIGHT(x, 14) ^ ROTRIGHT(x, 18) ^ RO
constexpr static auto SIGN0(u64 x) { return ROTRIGHT(x, 1) ^ ROTRIGHT(x, 8) ^ (x >> 7); }
constexpr static auto SIGN1(u64 x) { return ROTRIGHT(x, 19) ^ ROTRIGHT(x, 61) ^ (x >> 6); }
-inline void SHA256::transform(const u8* data)
+inline void SHA256::transform(u8 const* data)
{
u32 m[64];
@@ -66,7 +66,7 @@ inline void SHA256::transform(const u8* data)
m_state[7] += h;
}
-void SHA256::update(const u8* message, size_t length)
+void SHA256::update(u8 const* message, size_t length)
{
for (size_t i = 0; i < length; ++i) {
if (m_data_length == BlockSize) {
@@ -142,7 +142,7 @@ SHA256::DigestType SHA256::peek()
return digest;
}
-inline void SHA384::transform(const u8* data)
+inline void SHA384::transform(u8 const* data)
{
u64 m[80];
@@ -184,7 +184,7 @@ inline void SHA384::transform(const u8* data)
m_state[7] += h;
}
-void SHA384::update(const u8* message, size_t length)
+void SHA384::update(u8 const* message, size_t length)
{
for (size_t i = 0; i < length; ++i) {
if (m_data_length == BlockSize) {
@@ -267,7 +267,7 @@ SHA384::DigestType SHA384::peek()
return digest;
}
-inline void SHA512::transform(const u8* data)
+inline void SHA512::transform(u8 const* data)
{
u64 m[80];
@@ -308,7 +308,7 @@ inline void SHA512::transform(const u8* data)
m_state[7] += h;
}
-void SHA512::update(const u8* message, size_t length)
+void SHA512::update(u8 const* message, size_t length)
{
for (size_t i = 0; i < length; ++i) {
if (m_data_length == BlockSize) {
diff --git a/Userland/Libraries/LibCrypto/Hash/SHA2.h b/Userland/Libraries/LibCrypto/Hash/SHA2.h
index b9cb3315dd..9cc4433140 100644
--- a/Userland/Libraries/LibCrypto/Hash/SHA2.h
+++ b/Userland/Libraries/LibCrypto/Hash/SHA2.h
@@ -85,20 +85,20 @@ public:
reset();
}
- virtual void update(const u8*, size_t) override;
+ virtual void update(u8 const*, size_t) override;
virtual DigestType digest() override;
virtual DigestType peek() override;
- inline static DigestType hash(const u8* data, size_t length)
+ inline static DigestType hash(u8 const* data, size_t length)
{
SHA256 sha;
sha.update(data, length);
return sha.digest();
}
- inline static DigestType hash(const ByteBuffer& buffer) { return hash(buffer.data(), buffer.size()); }
- inline static DigestType hash(StringView buffer) { return hash((const u8*)buffer.characters_without_null_termination(), buffer.length()); }
+ inline static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
+ inline static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
#ifndef KERNEL
virtual String class_name() const override
@@ -116,7 +116,7 @@ public:
}
private:
- inline void transform(const u8*);
+ inline void transform(u8 const*);
u8 m_data_buffer[BlockSize] {};
size_t m_data_length { 0 };
@@ -137,20 +137,20 @@ public:
reset();
}
- virtual void update(const u8*, size_t) override;
+ virtual void update(u8 const*, size_t) override;
virtual DigestType digest() override;
virtual DigestType peek() override;
- inline static DigestType hash(const u8* data, size_t length)
+ inline static DigestType hash(u8 const* data, size_t length)
{
SHA384 sha;
sha.update(data, length);
return sha.digest();
}
- inline static DigestType hash(const ByteBuffer& buffer) { return hash(buffer.data(), buffer.size()); }
- inline static DigestType hash(StringView buffer) { return hash((const u8*)buffer.characters_without_null_termination(), buffer.length()); }
+ inline static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
+ inline static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
#ifndef KERNEL
virtual String class_name() const override
@@ -168,7 +168,7 @@ public:
}
private:
- inline void transform(const u8*);
+ inline void transform(u8 const*);
u8 m_data_buffer[BlockSize] {};
size_t m_data_length { 0 };
@@ -189,20 +189,20 @@ public:
reset();
}
- virtual void update(const u8*, size_t) override;
+ virtual void update(u8 const*, size_t) override;
virtual DigestType digest() override;
virtual DigestType peek() override;
- inline static DigestType hash(const u8* data, size_t length)
+ inline static DigestType hash(u8 const* data, size_t length)
{
SHA512 sha;
sha.update(data, length);
return sha.digest();
}
- inline static DigestType hash(const ByteBuffer& buffer) { return hash(buffer.data(), buffer.size()); }
- inline static DigestType hash(StringView buffer) { return hash((const u8*)buffer.characters_without_null_termination(), buffer.length()); }
+ inline static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
+ inline static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
#ifndef KERNEL
virtual String class_name() const override
@@ -220,7 +220,7 @@ public:
}
private:
- inline void transform(const u8*);
+ inline void transform(u8 const*);
u8 m_data_buffer[BlockSize] {};
size_t m_data_length { 0 };
diff --git a/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp b/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp
index 4aa33b015d..b44e6cac0c 100644
--- a/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp
+++ b/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp
@@ -11,7 +11,7 @@
namespace Crypto {
namespace NumberTheory {
-UnsignedBigInteger ModularInverse(const UnsignedBigInteger& a_, const UnsignedBigInteger& b)
+UnsignedBigInteger ModularInverse(UnsignedBigInteger const& a_, UnsignedBigInteger const& b)
{
if (b == 1)
return { 1 };
@@ -32,7 +32,7 @@ UnsignedBigInteger ModularInverse(const UnsignedBigInteger& a_, const UnsignedBi
return result;
}
-UnsignedBigInteger ModularPower(const UnsignedBigInteger& b, const UnsignedBigInteger& e, const UnsignedBigInteger& m)
+UnsignedBigInteger ModularPower(UnsignedBigInteger const& b, UnsignedBigInteger const& e, UnsignedBigInteger const& m)
{
if (m == 1)
return 0;
@@ -68,7 +68,7 @@ UnsignedBigInteger ModularPower(const UnsignedBigInteger& b, const UnsignedBigIn
return result;
}
-UnsignedBigInteger GCD(const UnsignedBigInteger& a, const UnsignedBigInteger& b)
+UnsignedBigInteger GCD(UnsignedBigInteger const& a, UnsignedBigInteger const& b)
{
UnsignedBigInteger temp_a { a };
UnsignedBigInteger temp_b { b };
@@ -85,7 +85,7 @@ UnsignedBigInteger GCD(const UnsignedBigInteger& a, const UnsignedBigInteger& b)
return output;
}
-UnsignedBigInteger LCM(const UnsignedBigInteger& a, const UnsignedBigInteger& b)
+UnsignedBigInteger LCM(UnsignedBigInteger const& a, UnsignedBigInteger const& b)
{
UnsignedBigInteger temp_a { a };
UnsignedBigInteger temp_b { b };
@@ -113,7 +113,7 @@ UnsignedBigInteger LCM(const UnsignedBigInteger& a, const UnsignedBigInteger& b)
return output;
}
-static bool MR_primality_test(UnsignedBigInteger n, const Vector<UnsignedBigInteger, 256>& tests)
+static bool MR_primality_test(UnsignedBigInteger n, Vector<UnsignedBigInteger, 256> const& tests)
{
// Written using Wikipedia:
// https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test#Miller%E2%80%93Rabin_test
@@ -158,7 +158,7 @@ static bool MR_primality_test(UnsignedBigInteger n, const Vector<UnsignedBigInte
return true; // "probably prime"
}
-UnsignedBigInteger random_number(const UnsignedBigInteger& min, const UnsignedBigInteger& max_excluded)
+UnsignedBigInteger random_number(UnsignedBigInteger const& min, UnsignedBigInteger const& max_excluded)
{
VERIFY(min < max_excluded);
auto range = max_excluded.minus(min);
@@ -181,7 +181,7 @@ UnsignedBigInteger random_number(const UnsignedBigInteger& min, const UnsignedBi
return divmod.remainder.plus(min);
}
-bool is_probably_prime(const UnsignedBigInteger& p)
+bool is_probably_prime(UnsignedBigInteger const& p)
{
// Is it a small number?
if (p < 49) {
diff --git a/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.h b/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.h
index 3f6f04f0a0..b77d2c0db4 100644
--- a/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.h
+++ b/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.h
@@ -12,14 +12,14 @@
namespace Crypto {
namespace NumberTheory {
-UnsignedBigInteger ModularInverse(const UnsignedBigInteger& a_, const UnsignedBigInteger& b);
-UnsignedBigInteger ModularPower(const UnsignedBigInteger& b, const UnsignedBigInteger& e, const UnsignedBigInteger& m);
+UnsignedBigInteger ModularInverse(UnsignedBigInteger const& a_, UnsignedBigInteger const& b);
+UnsignedBigInteger ModularPower(UnsignedBigInteger const& b, UnsignedBigInteger const& e, UnsignedBigInteger const& m);
// Note: This function _will_ generate extremely huge numbers, and in doing so,
// it will allocate and free a lot of memory!
// Please use |ModularPower| if your use-case is modexp.
template<typename IntegerType>
-static IntegerType Power(const IntegerType& b, const IntegerType& e)
+static IntegerType Power(IntegerType const& b, IntegerType const& e)
{
IntegerType ep { e };
IntegerType base { b };
@@ -39,11 +39,11 @@ static IntegerType Power(const IntegerType& b, const IntegerType& e)
return exp;
}
-UnsignedBigInteger GCD(const UnsignedBigInteger& a, const UnsignedBigInteger& b);
-UnsignedBigInteger LCM(const UnsignedBigInteger& a, const UnsignedBigInteger& b);
+UnsignedBigInteger GCD(UnsignedBigInteger const& a, UnsignedBigInteger const& b);
+UnsignedBigInteger LCM(UnsignedBigInteger const& a, UnsignedBigInteger const& b);
-UnsignedBigInteger random_number(const UnsignedBigInteger& min, const UnsignedBigInteger& max_excluded);
-bool is_probably_prime(const UnsignedBigInteger& p);
+UnsignedBigInteger random_number(UnsignedBigInteger const& min, UnsignedBigInteger const& max_excluded);
+bool is_probably_prime(UnsignedBigInteger const& p);
UnsignedBigInteger random_big_prime(size_t bits);
}
diff --git a/Userland/Libraries/LibCrypto/PK/Code/Code.h b/Userland/Libraries/LibCrypto/PK/Code/Code.h
index 3300129ac7..6835c4d7b5 100644
--- a/Userland/Libraries/LibCrypto/PK/Code/Code.h
+++ b/Userland/Libraries/LibCrypto/PK/Code/Code.h
@@ -24,7 +24,7 @@ public:
virtual void encode(ReadonlyBytes in, ByteBuffer& out, size_t em_bits) = 0;
virtual VerificationConsistency verify(ReadonlyBytes msg, ReadonlyBytes emsg, size_t em_bits) = 0;
- const HashFunction& hasher() const { return m_hasher; }
+ HashFunction const& hasher() const { return m_hasher; }
HashFunction& hasher() { return m_hasher; }
protected:
diff --git a/Userland/Libraries/LibCrypto/PK/RSA.cpp b/Userland/Libraries/LibCrypto/PK/RSA.cpp
index 15f257fc29..bc532d5ffa 100644
--- a/Userland/Libraries/LibCrypto/PK/RSA.cpp
+++ b/Userland/Libraries/LibCrypto/PK/RSA.cpp
@@ -56,7 +56,7 @@ RSA::KeyPairType RSA::parse_rsa_key(ReadonlyBytes der)
bool has_read_error = false;
- const auto check_if_pkcs8_rsa_key = [&] {
+ auto const check_if_pkcs8_rsa_key = [&] {
// see if it's a sequence:
auto tag_result = decoder.peek();
if (tag_result.is_error()) {
diff --git a/Userland/Libraries/LibCrypto/PK/RSA.h b/Userland/Libraries/LibCrypto/PK/RSA.h
index 0134728093..9884ae0610 100644
--- a/Userland/Libraries/LibCrypto/PK/RSA.h
+++ b/Userland/Libraries/LibCrypto/PK/RSA.h
@@ -31,8 +31,8 @@ public:
{
}
- const Integer& modulus() const { return m_modulus; }
- const Integer& public_exponent() const { return m_public_exponent; }
+ Integer const& modulus() const { return m_modulus; }
+ Integer const& public_exponent() const { return m_public_exponent; }
size_t length() const { return m_length; }
void set_length(size_t length) { m_length = length; }
@@ -62,9 +62,9 @@ public:
RSAPrivateKey() = default;
- const Integer& modulus() const { return m_modulus; }
- const Integer& private_exponent() const { return m_private_exponent; }
- const Integer& public_exponent() const { return m_public_exponent; }
+ Integer const& modulus() const { return m_modulus; }
+ Integer const& private_exponent() const { return m_private_exponent; }
+ Integer const& public_exponent() const { return m_public_exponent; }
size_t length() const { return m_length; }
void set_length(size_t length) { m_length = length; }
@@ -135,7 +135,7 @@ public:
{
}
- RSA(const ByteBuffer& publicKeyPEM, const ByteBuffer& privateKeyPEM)
+ RSA(ByteBuffer const& publicKeyPEM, ByteBuffer const& privateKeyPEM)
{
import_public_key(publicKeyPEM);
import_private_key(privateKeyPEM);
@@ -176,8 +176,8 @@ public:
void import_public_key(ReadonlyBytes, bool pem = true);
void import_private_key(ReadonlyBytes, bool pem = true);
- const PrivateKeyType& private_key() const { return m_private_key; }
- const PublicKeyType& public_key() const { return m_public_key; }
+ PrivateKeyType const& private_key() const { return m_private_key; }
+ PublicKeyType const& public_key() const { return m_public_key; }
};
template<typename HashFunction>
diff --git a/Userland/Libraries/LibDebug/DebugInfo.cpp b/Userland/Libraries/LibDebug/DebugInfo.cpp
index c0dc9b1905..6cf6a90cf1 100644
--- a/Userland/Libraries/LibDebug/DebugInfo.cpp
+++ b/Userland/Libraries/LibDebug/DebugInfo.cpp
@@ -142,7 +142,7 @@ Optional<DebugInfo::SourcePositionAndAddress> DebugInfo::get_address_from_source
}
Optional<SourcePositionAndAddress> result;
- for (const auto& line_entry : m_sorted_lines) {
+ for (auto const& line_entry : m_sorted_lines) {
if (!line_entry.file.ends_with(file_path))
continue;
@@ -159,12 +159,12 @@ Optional<DebugInfo::SourcePositionAndAddress> DebugInfo::get_address_from_source
return result;
}
-NonnullOwnPtrVector<DebugInfo::VariableInfo> DebugInfo::get_variables_in_current_scope(const PtraceRegisters& regs) const
+NonnullOwnPtrVector<DebugInfo::VariableInfo> DebugInfo::get_variables_in_current_scope(PtraceRegisters const& regs) const
{
NonnullOwnPtrVector<DebugInfo::VariableInfo> variables;
// TODO: We can store the scopes in a better data structure
- for (const auto& scope : m_scopes) {
+ for (auto const& scope : m_scopes) {
FlatPtr ip;
#if ARCH(I386)
ip = regs.eip;
@@ -174,7 +174,7 @@ NonnullOwnPtrVector<DebugInfo::VariableInfo> DebugInfo::get_variables_in_current
if (ip - m_base_address < scope.address_low || ip - m_base_address >= scope.address_high)
continue;
- for (const auto& die_entry : scope.dies_of_variables) {
+ for (auto const& die_entry : scope.dies_of_variables) {
auto variable_info = create_variable_info(die_entry, regs);
if (!variable_info)
continue;
@@ -357,7 +357,7 @@ String DebugInfo::name_of_containing_function(FlatPtr address) const
Optional<DebugInfo::VariablesScope> DebugInfo::get_containing_function(FlatPtr address) const
{
- for (const auto& scope : m_scopes) {
+ for (auto const& scope : m_scopes) {
if (!scope.is_function || address < scope.address_low || address >= scope.address_high)
continue;
return scope;
@@ -368,7 +368,7 @@ Optional<DebugInfo::VariablesScope> DebugInfo::get_containing_function(FlatPtr a
Vector<DebugInfo::SourcePosition> DebugInfo::source_lines_in_scope(VariablesScope const& scope) const
{
Vector<DebugInfo::SourcePosition> source_lines;
- for (const auto& line : m_sorted_lines) {
+ for (auto const& line : m_sorted_lines) {
if (line.address < scope.address_low)
continue;
diff --git a/Userland/Libraries/LibDebug/DebugInfo.h b/Userland/Libraries/LibDebug/DebugInfo.h
index 6a8d12b20d..43493c3313 100644
--- a/Userland/Libraries/LibDebug/DebugInfo.h
+++ b/Userland/Libraries/LibDebug/DebugInfo.h
@@ -71,7 +71,7 @@ public:
union {
u32 as_u32;
u32 as_i32;
- const char* as_string;
+ char const* as_string;
} constant_data { 0 };
Dwarf::EntryTag type_tag;
@@ -107,22 +107,22 @@ public:
FlatPtr address;
};
- Optional<SourcePositionAndAddress> get_address_from_source_position(const String& file, size_t line) const;
+ Optional<SourcePositionAndAddress> get_address_from_source_position(String const& file, size_t line) const;
String name_of_containing_function(FlatPtr address) const;
- Vector<SourcePosition> source_lines_in_scope(const VariablesScope&) const;
+ Vector<SourcePosition> source_lines_in_scope(VariablesScope const&) const;
Optional<VariablesScope> get_containing_function(FlatPtr address) const;
private:
void prepare_variable_scopes();
void prepare_lines();
- void parse_scopes_impl(const Dwarf::DIE& die);
- OwnPtr<VariableInfo> create_variable_info(const Dwarf::DIE& variable_die, const PtraceRegisters&, u32 address_offset = 0) const;
- static bool is_variable_tag_supported(const Dwarf::EntryTag& tag);
- void add_type_info_to_variable(const Dwarf::DIE& type_die, const PtraceRegisters& regs, DebugInfo::VariableInfo* parent_variable) const;
+ void parse_scopes_impl(Dwarf::DIE const& die);
+ OwnPtr<VariableInfo> create_variable_info(Dwarf::DIE const& variable_die, PtraceRegisters const&, u32 address_offset = 0) const;
+ static bool is_variable_tag_supported(Dwarf::EntryTag const& tag);
+ void add_type_info_to_variable(Dwarf::DIE const& type_die, PtraceRegisters const& regs, DebugInfo::VariableInfo* parent_variable) const;
- Optional<Dwarf::LineProgram::DirectoryAndFile> get_source_path_of_inline(const Dwarf::DIE&) const;
- Optional<uint32_t> get_line_of_inline(const Dwarf::DIE&) const;
+ Optional<Dwarf::LineProgram::DirectoryAndFile> get_source_path_of_inline(Dwarf::DIE const&) const;
+ Optional<uint32_t> get_line_of_inline(Dwarf::DIE const&) const;
ELF::Image const& m_elf;
String m_source_root;
diff --git a/Userland/Libraries/LibDebug/DebugSession.cpp b/Userland/Libraries/LibDebug/DebugSession.cpp
index f9d5515ed4..de990e6220 100644
--- a/Userland/Libraries/LibDebug/DebugSession.cpp
+++ b/Userland/Libraries/LibDebug/DebugSession.cpp
@@ -29,12 +29,12 @@ DebugSession::~DebugSession()
if (m_is_debuggee_dead)
return;
- for (const auto& bp : m_breakpoints) {
+ for (auto const& bp : m_breakpoints) {
disable_breakpoint(bp.key);
}
m_breakpoints.clear();
- for (const auto& wp : m_watchpoints) {
+ for (auto const& wp : m_watchpoints) {
disable_watchpoint(wp.key);
}
m_watchpoints.clear();
@@ -46,8 +46,8 @@ DebugSession::~DebugSession()
void DebugSession::for_each_loaded_library(Function<IterationDecision(LoadedLibrary const&)> func) const
{
- for (const auto& lib_name : m_loaded_libraries.keys()) {
- const auto& lib = *m_loaded_libraries.get(lib_name).value();
+ for (auto const& lib_name : m_loaded_libraries.keys()) {
+ auto const& lib = *m_loaded_libraries.get(lib_name).value();
if (func(lib) == IterationDecision::Break)
break;
}
@@ -80,11 +80,11 @@ OwnPtr<DebugSession> DebugSession::exec_and_attach(String const& command,
auto parts = command.split(' ');
VERIFY(!parts.is_empty());
- const char** args = bit_cast<const char**>(calloc(parts.size() + 1, sizeof(const char*)));
+ char const** args = bit_cast<char const**>(calloc(parts.size() + 1, sizeof(char const*)));
for (size_t i = 0; i < parts.size(); i++) {
args[i] = parts[i].characters();
}
- const char** envp = bit_cast<const char**>(calloc(2, sizeof(const char*)));
+ char const** envp = bit_cast<char const**>(calloc(2, sizeof(char const*)));
// This causes loader to stop on a breakpoint before jumping to the entry point of the program.
envp[0] = "_LOADER_BREAKPOINT=1";
int rc = execvpe(args[0], const_cast<char**>(args), const_cast<char**>(envp));
diff --git a/Userland/Libraries/LibDebug/Dwarf/AttributeValue.h b/Userland/Libraries/LibDebug/Dwarf/AttributeValue.h
index 9343328abf..c46979c877 100644
--- a/Userland/Libraries/LibDebug/Dwarf/AttributeValue.h
+++ b/Userland/Libraries/LibDebug/Dwarf/AttributeValue.h
@@ -36,7 +36,7 @@ public:
FlatPtr as_addr() const;
u64 as_unsigned() const { return m_data.as_unsigned; }
i64 as_signed() const { return m_data.as_signed; }
- const char* as_string() const;
+ char const* as_string() const;
bool as_bool() const { return m_data.as_bool; }
ReadonlyBytes as_raw_bytes() const { return m_data.as_raw_bytes; }
@@ -46,7 +46,7 @@ private:
FlatPtr as_addr;
u64 as_unsigned;
i64 as_signed;
- const char* as_string; // points to bytes in the memory mapped elf image
+ char const* as_string; // points to bytes in the memory mapped elf image
bool as_bool;
ReadonlyBytes as_raw_bytes;
} m_data {};
diff --git a/Userland/Libraries/LibDebug/Dwarf/DIE.cpp b/Userland/Libraries/LibDebug/Dwarf/DIE.cpp
index 4c1c271c5b..1577d98fd7 100644
--- a/Userland/Libraries/LibDebug/Dwarf/DIE.cpp
+++ b/Userland/Libraries/LibDebug/Dwarf/DIE.cpp
@@ -54,7 +54,7 @@ Optional<AttributeValue> DIE::get_attribute(Attribute const& attribute) const
auto abbreviation_info = m_compilation_unit.abbreviations_map().get(m_abbreviation_code);
VERIFY(abbreviation_info);
- for (const auto& attribute_spec : abbreviation_info->attribute_specifications) {
+ for (auto const& attribute_spec : abbreviation_info->attribute_specifications) {
auto value = m_compilation_unit.dwarf_info().get_attribute_value(attribute_spec.form, attribute_spec.value, stream, &m_compilation_unit);
if (attribute_spec.attribute == attribute) {
return value;
diff --git a/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp b/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp
index 57b3991c10..23f7596019 100644
--- a/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp
+++ b/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp
@@ -77,7 +77,7 @@ void DwarfInfo::populate_compilation_units()
}
AttributeValue DwarfInfo::get_attribute_value(AttributeDataForm form, ssize_t implicit_const_value,
- InputMemoryStream& debug_info_stream, const CompilationUnit* unit) const
+ InputMemoryStream& debug_info_stream, CompilationUnit const* unit) const
{
AttributeValue value;
value.m_form = form;
@@ -98,7 +98,7 @@ AttributeValue DwarfInfo::get_attribute_value(AttributeDataForm form, ssize_t im
value.m_type = AttributeValue::Type::String;
auto strings_data = debug_strings_data();
- value.m_data.as_string = bit_cast<const char*>(strings_data.offset_pointer(offset));
+ value.m_data.as_string = bit_cast<char const*>(strings_data.offset_pointer(offset));
break;
}
case AttributeDataForm::Data1: {
@@ -199,7 +199,7 @@ AttributeValue DwarfInfo::get_attribute_value(AttributeDataForm form, ssize_t im
debug_info_stream >> str;
VERIFY(!debug_info_stream.has_any_error());
value.m_type = AttributeValue::Type::String;
- value.m_data.as_string = bit_cast<const char*>(debug_info_data().offset_pointer(str_offset));
+ value.m_data.as_string = bit_cast<char const*>(debug_info_data().offset_pointer(str_offset));
break;
}
case AttributeDataForm::Block1: {
@@ -241,7 +241,7 @@ AttributeValue DwarfInfo::get_attribute_value(AttributeDataForm form, ssize_t im
value.m_type = AttributeValue::Type::String;
auto strings_data = debug_line_strings_data();
- value.m_data.as_string = bit_cast<const char*>(strings_data.offset_pointer(offset));
+ value.m_data.as_string = bit_cast<char const*>(strings_data.offset_pointer(offset));
break;
}
case AttributeDataForm::ImplicitConst: {
diff --git a/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.h b/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.h
index 3e9375801b..ac2ec7e2e5 100644
--- a/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.h
+++ b/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.h
@@ -39,7 +39,7 @@ public:
void for_each_compilation_unit(Callback) const;
AttributeValue get_attribute_value(AttributeDataForm form, ssize_t implicit_const_value,
- InputMemoryStream& debug_info_stream, const CompilationUnit* unit = nullptr) const;
+ InputMemoryStream& debug_info_stream, CompilationUnit const* unit = nullptr) const;
Optional<DIE> get_die_at_address(FlatPtr) const;
@@ -89,7 +89,7 @@ private:
template<typename Callback>
void DwarfInfo::for_each_compilation_unit(Callback callback) const
{
- for (const auto& unit : m_compilation_units) {
+ for (auto const& unit : m_compilation_units) {
callback(unit);
}
}
diff --git a/Userland/Libraries/LibDebug/ProcessInspector.cpp b/Userland/Libraries/LibDebug/ProcessInspector.cpp
index c006b2094f..bf07ff3dab 100644
--- a/Userland/Libraries/LibDebug/ProcessInspector.cpp
+++ b/Userland/Libraries/LibDebug/ProcessInspector.cpp
@@ -9,10 +9,10 @@
namespace Debug {
-const LoadedLibrary* ProcessInspector::library_at(FlatPtr address) const
+LoadedLibrary const* ProcessInspector::library_at(FlatPtr address) const
{
- const LoadedLibrary* result = nullptr;
- for_each_loaded_library([&result, address](const auto& lib) {
+ LoadedLibrary const* result = nullptr;
+ for_each_loaded_library([&result, address](auto const& lib) {
if (address >= lib.base_address && address < lib.base_address + lib.debug_info->elf().size()) {
result = &lib;
return IterationDecision::Break;
diff --git a/Userland/Libraries/LibDebug/ProcessInspector.h b/Userland/Libraries/LibDebug/ProcessInspector.h
index 315d3e520f..00672ae111 100644
--- a/Userland/Libraries/LibDebug/ProcessInspector.h
+++ b/Userland/Libraries/LibDebug/ProcessInspector.h
@@ -22,7 +22,7 @@ public:
virtual void set_registers(PtraceRegisters const&) = 0;
virtual void for_each_loaded_library(Function<IterationDecision(LoadedLibrary const&)>) const = 0;
- const LoadedLibrary* library_at(FlatPtr address) const;
+ LoadedLibrary const* library_at(FlatPtr address) const;
struct SymbolicationResult {
String library_name;
String symbol;
diff --git a/Userland/Libraries/LibDesktop/AppFile.h b/Userland/Libraries/LibDesktop/AppFile.h
index 98f3af6cf0..a9f10da6fa 100644
--- a/Userland/Libraries/LibDesktop/AppFile.h
+++ b/Userland/Libraries/LibDesktop/AppFile.h
@@ -15,7 +15,7 @@ namespace Desktop {
class AppFile : public RefCounted<AppFile> {
public:
- static constexpr const char* APP_FILES_DIRECTORY = "/res/apps";
+ static constexpr char const* APP_FILES_DIRECTORY = "/res/apps";
static NonnullRefPtr<AppFile> get_for_app(StringView app_name);
static NonnullRefPtr<AppFile> open(StringView path);
static void for_each(Function<void(NonnullRefPtr<AppFile>)>, StringView directory = APP_FILES_DIRECTORY);
diff --git a/Userland/Libraries/LibDesktop/Launcher.cpp b/Userland/Libraries/LibDesktop/Launcher.cpp
index 62da78b5ac..fc32bb1951 100644
--- a/Userland/Libraries/LibDesktop/Launcher.cpp
+++ b/Userland/Libraries/LibDesktop/Launcher.cpp
@@ -14,7 +14,7 @@
namespace Desktop {
-auto Launcher::Details::from_details_str(const String& details_str) -> NonnullRefPtr<Details>
+auto Launcher::Details::from_details_str(String const& details_str) -> NonnullRefPtr<Details>
{
auto details = adopt_ref(*new Details);
auto json = JsonValue::from_string(details_str).release_value_but_fixme_should_propagate_errors();
@@ -87,12 +87,12 @@ ErrorOr<void> Launcher::seal_allowlist()
return {};
}
-bool Launcher::open(const URL& url, const String& handler_name)
+bool Launcher::open(const URL& url, String const& handler_name)
{
return connection().open_url(url, handler_name);
}
-bool Launcher::open(const URL& url, const Details& details)
+bool Launcher::open(const URL& url, Details const& details)
{
VERIFY(details.launcher_type != LauncherType::Application); // Launcher should not be used to execute arbitrary applications
return open(url, details.executable);
diff --git a/Userland/Libraries/LibDesktop/Launcher.h b/Userland/Libraries/LibDesktop/Launcher.h
index c62764a011..1a9229e0b1 100644
--- a/Userland/Libraries/LibDesktop/Launcher.h
+++ b/Userland/Libraries/LibDesktop/Launcher.h
@@ -28,7 +28,7 @@ public:
String executable;
LauncherType launcher_type { LauncherType::Default };
- static NonnullRefPtr<Details> from_details_str(const String&);
+ static NonnullRefPtr<Details> from_details_str(String const&);
};
static void ensure_connection();
@@ -36,8 +36,8 @@ public:
static ErrorOr<void> add_allowed_handler_with_any_url(String const& handler);
static ErrorOr<void> add_allowed_handler_with_only_specific_urls(String const& handler, Vector<URL> const&);
static ErrorOr<void> seal_allowlist();
- static bool open(const URL&, const String& handler_name = {});
- static bool open(const URL&, const Details& details);
+ static bool open(const URL&, String const& handler_name = {});
+ static bool open(const URL&, Details const& details);
static Vector<String> get_handlers_for_url(const URL&);
static NonnullRefPtrVector<Details> get_handlers_with_details_for_url(const URL&);
};
diff --git a/Userland/Libraries/LibDiff/Format.cpp b/Userland/Libraries/LibDiff/Format.cpp
index ee28282183..1e1718ada0 100644
--- a/Userland/Libraries/LibDiff/Format.cpp
+++ b/Userland/Libraries/LibDiff/Format.cpp
@@ -10,12 +10,12 @@
#include <AK/Vector.h>
namespace Diff {
-String generate_only_additions(const String& text)
+String generate_only_additions(String const& text)
{
auto lines = text.split('\n', true); // Keep empty
StringBuilder builder;
builder.appendff("@@ -0,0 +1,{} @@\n", lines.size());
- for (const auto& line : lines) {
+ for (auto const& line : lines) {
builder.appendff("+{}\n", line);
}
return builder.to_string();
diff --git a/Userland/Libraries/LibDiff/Format.h b/Userland/Libraries/LibDiff/Format.h
index e0570392ff..888b19555e 100644
--- a/Userland/Libraries/LibDiff/Format.h
+++ b/Userland/Libraries/LibDiff/Format.h
@@ -9,5 +9,5 @@
#include <AK/String.h>
namespace Diff {
-String generate_only_additions(const String&);
+String generate_only_additions(String const&);
};
diff --git a/Userland/Libraries/LibDiff/Hunks.cpp b/Userland/Libraries/LibDiff/Hunks.cpp
index fe526045aa..babe53628c 100644
--- a/Userland/Libraries/LibDiff/Hunks.cpp
+++ b/Userland/Libraries/LibDiff/Hunks.cpp
@@ -8,7 +8,7 @@
#include <AK/Debug.h>
namespace Diff {
-Vector<Hunk> parse_hunks(const String& diff)
+Vector<Hunk> parse_hunks(String const& diff)
{
Vector<String> diff_lines = diff.split('\n');
if (diff_lines.is_empty())
@@ -58,15 +58,15 @@ Vector<Hunk> parse_hunks(const String& diff)
}
if constexpr (HUNKS_DEBUG) {
- for (const auto& hunk : hunks) {
+ for (auto const& hunk : hunks) {
dbgln("Hunk location:");
dbgln(" orig: {}", hunk.original_start_line);
dbgln(" target: {}", hunk.target_start_line);
dbgln(" removed:");
- for (const auto& line : hunk.removed_lines)
+ for (auto const& line : hunk.removed_lines)
dbgln("- {}", line);
dbgln(" added:");
- for (const auto& line : hunk.added_lines)
+ for (auto const& line : hunk.added_lines)
dbgln("+ {}", line);
}
}
@@ -74,14 +74,14 @@ Vector<Hunk> parse_hunks(const String& diff)
return hunks;
}
-HunkLocation parse_hunk_location(const String& location_line)
+HunkLocation parse_hunk_location(String const& location_line)
{
size_t char_index = 0;
struct StartAndLength {
size_t start { 0 };
size_t length { 0 };
};
- auto parse_start_and_length_pair = [](const String& raw) {
+ auto parse_start_and_length_pair = [](String const& raw) {
auto index_of_separator = raw.find(',').value();
auto start = raw.substring(0, index_of_separator).to_uint().value();
auto length = raw.substring(index_of_separator + 1, raw.length() - index_of_separator - 1).to_uint().value();
diff --git a/Userland/Libraries/LibDiff/Hunks.h b/Userland/Libraries/LibDiff/Hunks.h
index dafd61bc1e..63050c12f0 100644
--- a/Userland/Libraries/LibDiff/Hunks.h
+++ b/Userland/Libraries/LibDiff/Hunks.h
@@ -32,6 +32,6 @@ struct Hunk {
Vector<String> added_lines;
};
-Vector<Hunk> parse_hunks(const String& diff);
-HunkLocation parse_hunk_location(const String& location_line);
+Vector<Hunk> parse_hunks(String const& diff);
+HunkLocation parse_hunk_location(String const& location_line);
};
diff --git a/Userland/Libraries/LibDl/dlfcn.cpp b/Userland/Libraries/LibDl/dlfcn.cpp
index 077f62a101..ae1e18fe00 100644
--- a/Userland/Libraries/LibDl/dlfcn.cpp
+++ b/Userland/Libraries/LibDl/dlfcn.cpp
@@ -14,7 +14,7 @@
__thread char* s_dlerror_text = NULL;
__thread bool s_dlerror_retrieved = false;
-static void store_error(const String& error)
+static void store_error(String const& error)
{
free(s_dlerror_text);
s_dlerror_text = strdup(error.characters());
@@ -41,7 +41,7 @@ char* dlerror()
return const_cast<char*>(s_dlerror_text);
}
-void* dlopen(const char* filename, int flags)
+void* dlopen(char const* filename, int flags)
{
auto result = __dlopen(filename, flags);
if (result.is_error()) {
@@ -51,7 +51,7 @@ void* dlopen(const char* filename, int flags)
return result.value();
}
-void* dlsym(void* handle, const char* symbol_name)
+void* dlsym(void* handle, char const* symbol_name)
{
auto result = __dlsym(handle, symbol_name);
if (result.is_error()) {
diff --git a/Userland/Libraries/LibDl/dlfcn.h b/Userland/Libraries/LibDl/dlfcn.h
index b8ab808793..99f2c68e67 100644
--- a/Userland/Libraries/LibDl/dlfcn.h
+++ b/Userland/Libraries/LibDl/dlfcn.h
@@ -17,16 +17,16 @@ __BEGIN_DECLS
#define RTLD_LOCAL 16
typedef struct __Dl_info {
- const char* dli_fname;
+ char const* dli_fname;
void* dli_fbase;
- const char* dli_sname;
+ char const* dli_sname;
void* dli_saddr;
} Dl_info;
int dlclose(void*);
char* dlerror(void);
-void* dlopen(const char*, int);
-void* dlsym(void*, const char*);
+void* dlopen(char const*, int);
+void* dlsym(void*, char const*);
int dladdr(void*, Dl_info*);
__END_DECLS
diff --git a/Userland/Libraries/LibDl/dlfcn_integration.h b/Userland/Libraries/LibDl/dlfcn_integration.h
index aa4642d4f3..bf5a20ae60 100644
--- a/Userland/Libraries/LibDl/dlfcn_integration.h
+++ b/Userland/Libraries/LibDl/dlfcn_integration.h
@@ -28,8 +28,8 @@ struct __Dl_info;
typedef struct __Dl_info Dl_info;
typedef Result<void, DlErrorMessage> (*DlCloseFunction)(void*);
-typedef Result<void*, DlErrorMessage> (*DlOpenFunction)(const char*, int);
-typedef Result<void*, DlErrorMessage> (*DlSymFunction)(void*, const char*);
+typedef Result<void*, DlErrorMessage> (*DlOpenFunction)(char const*, int);
+typedef Result<void*, DlErrorMessage> (*DlSymFunction)(void*, char const*);
typedef Result<void, DlErrorMessage> (*DlAddrFunction)(void*, Dl_info*);
extern "C" {
diff --git a/Userland/Libraries/LibEDID/EDID.cpp b/Userland/Libraries/LibEDID/EDID.cpp
index 599df45a45..1c5a9ca772 100644
--- a/Userland/Libraries/LibEDID/EDID.cpp
+++ b/Userland/Libraries/LibEDID/EDID.cpp
@@ -319,7 +319,7 @@ T Parser::read_host(T const* field) const
template<typename T>
requires(IsIntegral<T> && sizeof(T) > 1) T Parser::read_le(T const* field)
- const
+const
{
static_assert(sizeof(T) > 1);
return AK::convert_between_host_and_little_endian(read_host(field));
@@ -327,7 +327,7 @@ requires(IsIntegral<T> && sizeof(T) > 1) T Parser::read_le(T const* field)
template<typename T>
requires(IsIntegral<T> && sizeof(T) > 1) T Parser::read_be(T const* field)
- const
+const
{
static_assert(sizeof(T) > 1);
return AK::convert_between_host_and_big_endian(read_host(field));
diff --git a/Userland/Libraries/LibEDID/EDID.h b/Userland/Libraries/LibEDID/EDID.h
index 18ac90336f..b70b4b9b9b 100644
--- a/Userland/Libraries/LibEDID/EDID.h
+++ b/Userland/Libraries/LibEDID/EDID.h
@@ -438,11 +438,11 @@ private:
template<typename T>
requires(IsIntegral<T> && sizeof(T) > 1) T read_le(T const*)
- const;
+ const;
template<typename T>
requires(IsIntegral<T> && sizeof(T) > 1) T read_be(T const*)
- const;
+ const;
Definitions::EDID const& raw_edid() const;
ErrorOr<IterationDecision> for_each_display_descriptor(Function<IterationDecision(u8, Definitions::DisplayDescriptor const&)>) const;
diff --git a/Userland/Libraries/LibELF/DynamicLinker.cpp b/Userland/Libraries/LibELF/DynamicLinker.cpp
index 66ce35adf3..b4d5033997 100644
--- a/Userland/Libraries/LibELF/DynamicLinker.cpp
+++ b/Userland/Libraries/LibELF/DynamicLinker.cpp
@@ -56,8 +56,8 @@ static bool s_do_breakpoint_trap_before_entry { false };
static StringView s_ld_library_path;
static Result<void, DlErrorMessage> __dlclose(void* handle);
-static Result<void*, DlErrorMessage> __dlopen(const char* filename, int flags);
-static Result<void*, DlErrorMessage> __dlsym(void* handle, const char* symbol_name);
+static Result<void*, DlErrorMessage> __dlopen(char const* filename, int flags);
+static Result<void*, DlErrorMessage> __dlsym(void* handle, char const* symbol_name);
static Result<void, DlErrorMessage> __dladdr(void* addr, Dl_info* info);
Optional<DynamicObject::SymbolLookupResult> DynamicLinker::lookup_global_symbol(StringView name)
@@ -84,7 +84,7 @@ static String get_library_name(String path)
return LexicalPath::basename(move(path));
}
-static Result<NonnullRefPtr<DynamicLoader>, DlErrorMessage> map_library(const String& filename, int fd)
+static Result<NonnullRefPtr<DynamicLoader>, DlErrorMessage> map_library(String const& filename, int fd)
{
auto result = ELF::DynamicLoader::try_create(fd, filename);
if (result.is_error()) {
@@ -139,7 +139,7 @@ static Result<NonnullRefPtr<DynamicLoader>, DlErrorMessage> map_library(String c
return DlErrorMessage { String::formatted("Could not find required shared library: {}", name) };
}
-static Vector<String> get_dependencies(const String& name)
+static Vector<String> get_dependencies(String const& name)
{
auto lib = s_loaders.get(name).value();
Vector<String> dependencies;
@@ -152,13 +152,13 @@ static Vector<String> get_dependencies(const String& name)
return dependencies;
}
-static Result<void, DlErrorMessage> map_dependencies(const String& name)
+static Result<void, DlErrorMessage> map_dependencies(String const& name)
{
dbgln_if(DYNAMIC_LOAD_DEBUG, "mapping dependencies for: {}", name);
auto const& parent_object = (*s_loaders.get(name))->dynamic_object();
- for (const auto& needed_name : get_dependencies(name)) {
+ for (auto const& needed_name : get_dependencies(name)) {
dbgln_if(DYNAMIC_LOAD_DEBUG, "needed library: {}", needed_name.characters());
String library_name = get_library_name(needed_name);
@@ -180,7 +180,7 @@ static Result<void, DlErrorMessage> map_dependencies(const String& name)
static void allocate_tls()
{
s_total_tls_size = 0;
- for (const auto& data : s_loaders) {
+ for (auto const& data : s_loaders) {
dbgln_if(DYNAMIC_LOAD_DEBUG, "{}: TLS Size: {}", data.key, data.value->tls_size_of_current_object());
s_total_tls_size += data.value->tls_size_of_current_object();
}
@@ -198,7 +198,7 @@ static void allocate_tls()
auto& initial_tls_data = initial_tls_data_result.value();
// Initialize TLS data
- for (const auto& entry : s_loaders) {
+ for (auto const& entry : s_loaders) {
entry.value->copy_initial_tls_data_into(initial_tls_data);
}
@@ -277,7 +277,7 @@ static void initialize_libc(DynamicObject& libc)
}
template<typename Callback>
-static void for_each_unfinished_dependency_of(const String& name, HashTable<String>& seen_names, bool first, bool skip_global_objects, Callback callback)
+static void for_each_unfinished_dependency_of(String const& name, HashTable<String>& seen_names, bool first, bool skip_global_objects, Callback callback)
{
if (!s_loaders.contains(name))
return;
@@ -289,13 +289,13 @@ static void for_each_unfinished_dependency_of(const String& name, HashTable<Stri
return;
seen_names.set(name);
- for (const auto& needed_name : get_dependencies(name))
+ for (auto const& needed_name : get_dependencies(name))
for_each_unfinished_dependency_of(get_library_name(needed_name), seen_names, false, skip_global_objects, callback);
callback(*s_loaders.get(name).value());
}
-static NonnullRefPtrVector<DynamicLoader> collect_loaders_for_library(const String& name, bool skip_global_objects)
+static NonnullRefPtrVector<DynamicLoader> collect_loaders_for_library(String const& name, bool skip_global_objects)
{
HashTable<String> seen_names;
NonnullRefPtrVector<DynamicLoader> loaders;
@@ -305,7 +305,7 @@ static NonnullRefPtrVector<DynamicLoader> collect_loaders_for_library(const Stri
return loaders;
}
-static Result<NonnullRefPtr<DynamicLoader>, DlErrorMessage> load_main_library(const String& name, int flags, bool skip_global_objects)
+static Result<NonnullRefPtr<DynamicLoader>, DlErrorMessage> load_main_library(String const& name, int flags, bool skip_global_objects)
{
auto main_library_loader = *s_loaders.get(name);
auto main_library_object = main_library_loader->map();
@@ -333,7 +333,7 @@ static Result<NonnullRefPtr<DynamicLoader>, DlErrorMessage> load_main_library(co
if (loader.filename() == "libsystem.so"sv) {
VERIFY(!loader.text_segments().is_empty());
- for (const auto& segment : loader.text_segments()) {
+ for (auto const& segment : loader.text_segments()) {
if (syscall(SC_msyscall, segment.address().get())) {
VERIFY_NOT_REACHED();
}
@@ -367,7 +367,7 @@ static Result<void, DlErrorMessage> __dlclose(void* handle)
return {};
}
-static Optional<DlErrorMessage> verify_tls_for_dlopen(const DynamicLoader& loader)
+static Optional<DlErrorMessage> verify_tls_for_dlopen(DynamicLoader const& loader)
{
if (loader.tls_size_of_current_object() == 0)
return {};
@@ -396,7 +396,7 @@ static Optional<DlErrorMessage> verify_tls_for_dlopen(const DynamicLoader& loade
return DlErrorMessage("Using dlopen() with libraries that have non-zeroed TLS is currently not supported");
}
-static Result<void*, DlErrorMessage> __dlopen(const char* filename, int flags)
+static Result<void*, DlErrorMessage> __dlopen(char const* filename, int flags)
{
// FIXME: RTLD_NOW and RTLD_LOCAL are not supported
flags &= ~RTLD_NOW;
@@ -451,7 +451,7 @@ static Result<void*, DlErrorMessage> __dlopen(const char* filename, int flags)
return *object;
}
-static Result<void*, DlErrorMessage> __dlsym(void* handle, const char* symbol_name)
+static Result<void*, DlErrorMessage> __dlsym(void* handle, char const* symbol_name)
{
dbgln_if(DYNAMIC_LOAD_DEBUG, "__dlsym: {}, {}", handle, symbol_name);
diff --git a/Userland/Libraries/LibELF/DynamicLoader.cpp b/Userland/Libraries/LibELF/DynamicLoader.cpp
index 2ea5e16df6..63bad18311 100644
--- a/Userland/Libraries/LibELF/DynamicLoader.cpp
+++ b/Userland/Libraries/LibELF/DynamicLoader.cpp
@@ -26,7 +26,7 @@
#include <unistd.h>
#ifndef __serenity__
-static void* mmap_with_name(void* addr, size_t length, int prot, int flags, int fd, off_t offset, const char*)
+static void* mmap_with_name(void* addr, size_t length, int prot, int flags, int fd, off_t offset, char const*)
{
return mmap(addr, length, prot, flags, fd, offset);
}
@@ -86,7 +86,7 @@ DynamicLoader::~DynamicLoader()
}
}
-const DynamicObject& DynamicLoader::dynamic_object() const
+DynamicObject const& DynamicLoader::dynamic_object() const
{
if (!m_cached_dynamic_object) {
VirtualAddress dynamic_section_address;
@@ -238,7 +238,7 @@ void DynamicLoader::load_stage_4()
void DynamicLoader::do_lazy_relocations()
{
- for (const auto& relocation : m_unresolved_relocations) {
+ for (auto const& relocation : m_unresolved_relocations) {
if (auto res = do_relocation(relocation, ShouldInitializeWeak::Yes); res != RelocationResult::Success) {
dbgln("Loader.so: {} unresolved symbol '{}'", m_filename, relocation.symbol().name());
VERIFY_NOT_REACHED();
@@ -256,7 +256,7 @@ void DynamicLoader::load_program_headers()
VirtualAddress dynamic_region_desired_vaddr;
- m_elf_image.for_each_program_header([&](const Image::ProgramHeader& program_header) {
+ m_elf_image.for_each_program_header([&](Image::ProgramHeader const& program_header) {
ProgramHeaderRegion region {};
region.set_program_header(program_header.raw_header());
if (region.is_tls_template()) {
@@ -555,7 +555,7 @@ ssize_t DynamicLoader::negative_offset_from_tls_block_end(ssize_t tls_offset, si
void DynamicLoader::copy_initial_tls_data_into(ByteBuffer& buffer) const
{
- const u8* tls_data = nullptr;
+ u8 const* tls_data = nullptr;
size_t tls_size_in_image = 0;
m_elf_image.for_each_program_header([this, &tls_data, &tls_size_in_image](ELF::Image::ProgramHeader program_header) {
diff --git a/Userland/Libraries/LibELF/DynamicLoader.h b/Userland/Libraries/LibELF/DynamicLoader.h
index 23ef8ff5c9..db3ab6cfba 100644
--- a/Userland/Libraries/LibELF/DynamicLoader.h
+++ b/Userland/Libraries/LibELF/DynamicLoader.h
@@ -45,7 +45,7 @@ public:
static Result<NonnullRefPtr<DynamicLoader>, DlErrorMessage> try_create(int fd, String filename);
~DynamicLoader();
- const String& filename() const { return m_filename; }
+ String const& filename() const { return m_filename; }
bool is_valid() const { return m_valid; }
@@ -74,7 +74,7 @@ public:
void for_each_needed_library(F) const;
VirtualAddress base_address() const { return m_base_address; }
- const Vector<LoadedSegment> text_segments() const { return m_text_segments; }
+ Vector<LoadedSegment> const text_segments() const { return m_text_segments; }
bool is_dynamic() const { return m_elf_image.is_dynamic(); }
static Optional<DynamicObject::SymbolLookupResult> lookup_symbol(const ELF::DynamicObject::Symbol&);
@@ -129,7 +129,7 @@ private:
Success = 1,
ResolveLater = 2,
};
- RelocationResult do_relocation(const DynamicObject::Relocation&, ShouldInitializeWeak should_initialize_weak);
+ RelocationResult do_relocation(DynamicObject::Relocation const&, ShouldInitializeWeak should_initialize_weak);
void do_relr_relocations();
size_t calculate_tls_size() const;
ssize_t negative_offset_from_tls_block_end(ssize_t tls_offset, size_t value_of_symbol) const;
diff --git a/Userland/Libraries/LibELF/DynamicObject.cpp b/Userland/Libraries/LibELF/DynamicObject.cpp
index 22ec378e7d..ad1e5b1c4f 100644
--- a/Userland/Libraries/LibELF/DynamicObject.cpp
+++ b/Userland/Libraries/LibELF/DynamicObject.cpp
@@ -16,7 +16,7 @@
namespace ELF {
-DynamicObject::DynamicObject(const String& filename, VirtualAddress base_address, VirtualAddress dynamic_section_address)
+DynamicObject::DynamicObject(String const& filename, VirtualAddress base_address, VirtualAddress dynamic_section_address)
: m_filename(filename)
, m_base_address(base_address)
, m_dynamic_address(dynamic_section_address)
@@ -44,7 +44,7 @@ void DynamicObject::dump() const
builder.append("\nd_tag tag_name value\n");
size_t num_dynamic_sections = 0;
- for_each_dynamic_entry([&](const DynamicObject::DynamicEntry& entry) {
+ for_each_dynamic_entry([&](DynamicObject::DynamicEntry const& entry) {
String name_field = String::formatted("({})", name_for_dtag(entry.tag()));
builder.appendff("{:#08x} {:17} {:#08x}\n", entry.tag(), name_field, entry.val());
num_dynamic_sections++;
@@ -64,7 +64,7 @@ void DynamicObject::dump() const
void DynamicObject::parse()
{
- for_each_dynamic_entry([&](const DynamicEntry& entry) {
+ for_each_dynamic_entry([&](DynamicEntry const& entry) {
switch (entry.tag()) {
case DT_INIT:
m_init_offset = entry.ptr() - m_elf_base_address.get();
@@ -294,7 +294,7 @@ auto DynamicObject::HashSection::lookup_gnu_symbol(StringView name, u32 hash_val
using BloomWord = FlatPtr;
constexpr size_t bloom_word_size = sizeof(BloomWord) * 8;
- const u32* hash_table_begin = (u32*)address().as_ptr();
+ u32 const* hash_table_begin = (u32*)address().as_ptr();
const size_t num_buckets = hash_table_begin[0];
const size_t num_omitted_symbols = hash_table_begin[1];
@@ -303,9 +303,9 @@ auto DynamicObject::HashSection::lookup_gnu_symbol(StringView name, u32 hash_val
const u32 num_maskwords_bitmask = num_maskwords - 1;
const u32 shift2 = hash_table_begin[3];
- const BloomWord* bloom_words = (BloomWord const*)&hash_table_begin[4];
- const u32* const buckets = (u32 const*)&bloom_words[num_maskwords];
- const u32* const chains = &buckets[num_buckets];
+ BloomWord const* bloom_words = (BloomWord const*)&hash_table_begin[4];
+ u32 const* const buckets = (u32 const*)&bloom_words[num_maskwords];
+ u32 const* const chains = &buckets[num_buckets];
BloomWord hash1 = hash_value;
BloomWord hash2 = hash1 >> shift2;
@@ -317,7 +317,7 @@ auto DynamicObject::HashSection::lookup_gnu_symbol(StringView name, u32 hash_val
size_t current_sym = buckets[hash1 % num_buckets];
if (current_sym == 0)
return {};
- const u32* current_chain = &chains[current_sym - num_omitted_symbols];
+ u32 const* current_chain = &chains[current_sym - num_omitted_symbols];
for (hash1 &= ~1;; ++current_sym) {
hash2 = *(current_chain++);
@@ -336,12 +336,12 @@ auto DynamicObject::HashSection::lookup_gnu_symbol(StringView name, u32 hash_val
StringView DynamicObject::symbol_string_table_string(ElfW(Word) index) const
{
- return StringView { (const char*)base_address().offset(m_string_table_offset + index).as_ptr() };
+ return StringView { (char const*)base_address().offset(m_string_table_offset + index).as_ptr() };
}
-const char* DynamicObject::raw_symbol_string_table_string(ElfW(Word) index) const
+char const* DynamicObject::raw_symbol_string_table_string(ElfW(Word) index) const
{
- return (const char*)base_address().offset(m_string_table_offset + index).as_ptr();
+ return (char const*)base_address().offset(m_string_table_offset + index).as_ptr();
}
DynamicObject::InitializationFunction DynamicObject::init_section_function() const
@@ -350,7 +350,7 @@ DynamicObject::InitializationFunction DynamicObject::init_section_function() con
return (InitializationFunction)init_section().address().as_ptr();
}
-const char* DynamicObject::name_for_dtag(ElfW(Sword) d_tag)
+char const* DynamicObject::name_for_dtag(ElfW(Sword) d_tag)
{
switch (d_tag) {
case DT_NULL:
@@ -463,7 +463,7 @@ auto DynamicObject::lookup_symbol(StringView name) const -> Optional<SymbolLooku
return lookup_symbol(HashSymbol { name });
}
-auto DynamicObject::lookup_symbol(const HashSymbol& symbol) const -> Optional<SymbolLookupResult>
+auto DynamicObject::lookup_symbol(HashSymbol const& symbol) const -> Optional<SymbolLookupResult>
{
auto result = hash_section().lookup_symbol(symbol);
if (!result.has_value())
@@ -474,7 +474,7 @@ auto DynamicObject::lookup_symbol(const HashSymbol& symbol) const -> Optional<Sy
return SymbolLookupResult { symbol_result.value(), symbol_result.size(), symbol_result.address(), symbol_result.bind(), this };
}
-NonnullRefPtr<DynamicObject> DynamicObject::create(const String& filename, VirtualAddress base_address, VirtualAddress dynamic_section_address)
+NonnullRefPtr<DynamicObject> DynamicObject::create(String const& filename, VirtualAddress base_address, VirtualAddress dynamic_section_address)
{
return adopt_ref(*new DynamicObject(filename, base_address, dynamic_section_address));
}
diff --git a/Userland/Libraries/LibELF/DynamicObject.h b/Userland/Libraries/LibELF/DynamicObject.h
index 19c277977c..6161a6c568 100644
--- a/Userland/Libraries/LibELF/DynamicObject.h
+++ b/Userland/Libraries/LibELF/DynamicObject.h
@@ -20,8 +20,8 @@ namespace ELF {
class DynamicObject : public RefCounted<DynamicObject> {
public:
- static NonnullRefPtr<DynamicObject> create(const String& filename, VirtualAddress base_address, VirtualAddress dynamic_section_address);
- static const char* name_for_dtag(ElfW(Sword) d_tag);
+ static NonnullRefPtr<DynamicObject> create(String const& filename, VirtualAddress base_address, VirtualAddress dynamic_section_address);
+ static char const* name_for_dtag(ElfW(Sword) d_tag);
~DynamicObject();
void dump() const;
@@ -52,7 +52,7 @@ public:
class Symbol {
public:
- Symbol(const DynamicObject& dynamic, unsigned index, const ElfW(Sym) & sym)
+ Symbol(DynamicObject const& dynamic, unsigned index, const ElfW(Sym) & sym)
: m_dynamic(dynamic)
, m_sym(sym)
, m_index(index)
@@ -60,7 +60,7 @@ public:
}
StringView name() const { return m_dynamic.symbol_string_table_string(m_sym.st_name); }
- const char* raw_name() const { return m_dynamic.raw_symbol_string_table_string(m_sym.st_name); }
+ char const* raw_name() const { return m_dynamic.raw_symbol_string_table_string(m_sym.st_name); }
unsigned section_index() const { return m_sym.st_shndx; }
FlatPtr value() const { return m_sym.st_value; }
size_t size() const { return m_sym.st_size; }
@@ -90,17 +90,17 @@ public:
return m_dynamic.base_address().offset(value());
return VirtualAddress { value() };
}
- const DynamicObject& object() const { return m_dynamic; }
+ DynamicObject const& object() const { return m_dynamic; }
private:
- const DynamicObject& m_dynamic;
+ DynamicObject const& m_dynamic;
const ElfW(Sym) & m_sym;
- const unsigned m_index;
+ unsigned const m_index;
};
class Section {
public:
- Section(const DynamicObject& dynamic, unsigned section_offset, unsigned section_size_bytes, unsigned entry_size, StringView name)
+ Section(DynamicObject const& dynamic, unsigned section_offset, unsigned section_size_bytes, unsigned entry_size, StringView name)
: m_dynamic(dynamic)
, m_section_offset(section_offset)
, m_section_size_bytes(section_size_bytes)
@@ -126,7 +126,7 @@ public:
protected:
friend class RelocationSection;
friend class HashSection;
- const DynamicObject& m_dynamic;
+ DynamicObject const& m_dynamic;
unsigned m_section_offset;
unsigned m_section_size_bytes;
unsigned m_entry_size;
@@ -135,7 +135,7 @@ public:
class RelocationSection : public Section {
public:
- explicit RelocationSection(const Section& section, bool addend_used)
+ explicit RelocationSection(Section const& section, bool addend_used)
: Section(section.m_dynamic, section.m_section_offset, section.m_section_size_bytes, section.m_entry_size, section.m_name)
, m_addend_used(addend_used)
{
@@ -150,12 +150,12 @@ public:
void for_each_relocation(F func) const;
private:
- const bool m_addend_used;
+ bool const m_addend_used;
};
class Relocation {
public:
- Relocation(const DynamicObject& dynamic, const ElfW(Rela) & rel, unsigned offset_in_section, bool addend_used)
+ Relocation(DynamicObject const& dynamic, const ElfW(Rela) & rel, unsigned offset_in_section, bool addend_used)
: m_dynamic(dynamic)
, m_rel(rel)
, m_offset_in_section(offset_in_section)
@@ -200,10 +200,10 @@ public:
[[nodiscard]] DynamicObject const& dynamic_object() const { return m_dynamic; }
private:
- const DynamicObject& m_dynamic;
+ DynamicObject const& m_dynamic;
const ElfW(Rela) & m_rel;
- const unsigned m_offset_in_section;
- const bool m_addend_used;
+ unsigned const m_offset_in_section;
+ bool const m_addend_used;
};
enum class HashType {
@@ -230,13 +230,13 @@ public:
class HashSection : public Section {
public:
- HashSection(const Section& section, HashType hash_type)
+ HashSection(Section const& section, HashType hash_type)
: Section(section.m_dynamic, section.m_section_offset, section.m_section_size_bytes, section.m_entry_size, section.m_name)
, m_hash_type(hash_type)
{
}
- Optional<Symbol> lookup_symbol(const HashSymbol& symbol) const
+ Optional<Symbol> lookup_symbol(HashSymbol const& symbol) const
{
if (m_hash_type == HashType::SYSV)
return lookup_sysv_symbol(symbol.name(), symbol.sysv_hash());
@@ -286,7 +286,7 @@ public:
VirtualAddress plt_got_base_address() const { return m_base_address.offset(m_procedure_linkage_table_offset.value()); }
VirtualAddress base_address() const { return m_base_address; }
- const String& filename() const { return m_filename; }
+ String const& filename() const { return m_filename; }
StringView rpath() const { return m_has_rpath ? symbol_string_table_string(m_rpath_index) : StringView {}; }
StringView runpath() const { return m_has_runpath ? symbol_string_table_string(m_runpath_index) : StringView {}; }
@@ -326,7 +326,7 @@ public:
};
Optional<SymbolLookupResult> lookup_symbol(StringView name) const;
- Optional<SymbolLookupResult> lookup_symbol(const HashSymbol& symbol) const;
+ Optional<SymbolLookupResult> lookup_symbol(HashSymbol const& symbol) const;
// Will be called from _fixup_plt_entry, as part of the PLT trampoline
VirtualAddress patch_plt_entry(u32 relocation_offset);
@@ -336,10 +336,10 @@ public:
void* symbol_for_name(StringView name);
private:
- explicit DynamicObject(const String& filename, VirtualAddress base_address, VirtualAddress dynamic_section_address);
+ explicit DynamicObject(String const& filename, VirtualAddress base_address, VirtualAddress dynamic_section_address);
StringView symbol_string_table_string(ElfW(Word)) const;
- const char* raw_symbol_string_table_string(ElfW(Word)) const;
+ char const* raw_symbol_string_table_string(ElfW(Word)) const;
void parse();
String m_filename;
@@ -403,7 +403,7 @@ template<IteratorFunction<DynamicObject::Relocation&> F>
inline void DynamicObject::RelocationSection::for_each_relocation(F func) const
{
for (unsigned i = 0; i < relocation_count(); ++i) {
- const auto reloc = relocation(i);
+ auto const reloc = relocation(i);
if (reloc.type() == 0)
continue;
if (func(reloc) == IterationDecision::Break)
diff --git a/Userland/Libraries/LibELF/Image.cpp b/Userland/Libraries/LibELF/Image.cpp
index e8e9a6f568..694a7721f3 100644
--- a/Userland/Libraries/LibELF/Image.cpp
+++ b/Userland/Libraries/LibELF/Image.cpp
@@ -26,7 +26,7 @@ Image::Image(ReadonlyBytes bytes, bool verbose_logging)
parse();
}
-Image::Image(const u8* buffer, size_t size, bool verbose_logging)
+Image::Image(u8 const* buffer, size_t size, bool verbose_logging)
: Image(ReadonlyBytes { buffer, size }, verbose_logging)
{
}
@@ -69,7 +69,7 @@ void Image::dump() const
dbgln(" phnum: {}", header().e_phnum);
dbgln(" shstrndx: {}", header().e_shstrndx);
- for_each_program_header([&](const ProgramHeader& program_header) {
+ for_each_program_header([&](ProgramHeader const& program_header) {
dbgln(" Program Header {}: {{", program_header.index());
dbgln(" type: {:x}", program_header.type());
dbgln(" offset: {:x}", program_header.offset());
@@ -78,7 +78,7 @@ void Image::dump() const
});
for (unsigned i = 0; i < header().e_shnum; ++i) {
- const auto& section = this->section(i);
+ auto const& section = this->section(i);
dbgln(" Section {}: {{", i);
dbgln(" name: {}", section.name());
dbgln(" type: {:x}", section.type());
@@ -90,7 +90,7 @@ void Image::dump() const
dbgln("Symbol count: {} (table is {})", symbol_count(), m_symbol_table_section_index);
for (unsigned i = 1; i < symbol_count(); ++i) {
- const auto& sym = symbol(i);
+ auto const& sym = symbol(i);
dbgln("Symbol @{}:", i);
dbgln(" Name: {}", sym.name());
dbgln(" In section: {}", section_index_to_string(sym.section_index()));
@@ -187,10 +187,10 @@ StringView Image::table_string(unsigned offset) const
return table_string(m_string_table_section_index, offset);
}
-const char* Image::raw_data(unsigned offset) const
+char const* Image::raw_data(unsigned offset) const
{
VERIFY(offset < m_size); // Callers must check indices into raw_data()'s result are also in bounds.
- return reinterpret_cast<const char*>(m_buffer) + offset;
+ return reinterpret_cast<char const*>(m_buffer) + offset;
}
const ElfW(Ehdr) & Image::header() const
@@ -361,7 +361,7 @@ StringView Image::Symbol::raw_data() const
Optional<Image::Symbol> Image::find_demangled_function(StringView name) const
{
Optional<Image::Symbol> found;
- for_each_symbol([&](const Image::Symbol& symbol) {
+ for_each_symbol([&](Image::Symbol const& symbol) {
if (symbol.type() != STT_FUNC)
return IterationDecision::Continue;
if (symbol.is_undefined())
@@ -416,7 +416,7 @@ Optional<Image::Symbol> Image::find_symbol(FlatPtr address, u32* out_offset) con
NEVER_INLINE void Image::sort_symbols() const
{
m_sorted_symbols.ensure_capacity(symbol_count());
- for_each_symbol([this](const auto& symbol) {
+ for_each_symbol([this](auto const& symbol) {
m_sorted_symbols.append({ symbol.value(), symbol.name(), {}, symbol });
});
quick_sort(m_sorted_symbols, [](auto& a, auto& b) {
diff --git a/Userland/Libraries/LibELF/Image.h b/Userland/Libraries/LibELF/Image.h
index 7811463cc5..7af308a810 100644
--- a/Userland/Libraries/LibELF/Image.h
+++ b/Userland/Libraries/LibELF/Image.h
@@ -21,18 +21,18 @@ namespace ELF {
class Image {
public:
explicit Image(ReadonlyBytes, bool verbose_logging = true);
- explicit Image(const u8*, size_t, bool verbose_logging = true);
+ explicit Image(u8 const*, size_t, bool verbose_logging = true);
~Image() = default;
void dump() const;
bool is_valid() const { return m_valid; }
bool parse();
- bool is_within_image(const void* address, size_t size) const
+ bool is_within_image(void const* address, size_t size) const
{
if (address < m_buffer)
return false;
- if (((const u8*)address + size) > m_buffer + m_size)
+ if (((u8 const*)address + size) > m_buffer + m_size)
return false;
return true;
}
@@ -44,7 +44,7 @@ public:
class Symbol {
public:
- Symbol(const Image& image, unsigned index, const ElfW(Sym) & sym)
+ Symbol(Image const& image, unsigned index, const ElfW(Sym) & sym)
: m_image(image)
, m_sym(sym)
, m_index(index)
@@ -79,14 +79,14 @@ public:
StringView raw_data() const;
private:
- const Image& m_image;
+ Image const& m_image;
const ElfW(Sym) & m_sym;
- const unsigned m_index;
+ unsigned const m_index;
};
class ProgramHeader {
public:
- ProgramHeader(const Image& image, unsigned program_header_index)
+ ProgramHeader(Image const& image, unsigned program_header_index)
: m_image(image)
, m_program_header(image.program_header_internal(program_header_index))
, m_program_header_index(program_header_index)
@@ -105,18 +105,18 @@ public:
bool is_readable() const { return flags() & PF_R; }
bool is_writable() const { return flags() & PF_W; }
bool is_executable() const { return flags() & PF_X; }
- const char* raw_data() const { return m_image.raw_data(m_program_header.p_offset); }
+ char const* raw_data() const { return m_image.raw_data(m_program_header.p_offset); }
ElfW(Phdr) raw_header() const { return m_program_header; }
private:
- const Image& m_image;
+ Image const& m_image;
const ElfW(Phdr) & m_program_header;
unsigned m_program_header_index { 0 };
};
class Section {
public:
- Section(const Image& image, unsigned sectionIndex)
+ Section(Image const& image, unsigned sectionIndex)
: m_image(image)
, m_section_header(image.section_header(sectionIndex))
, m_section_index(sectionIndex)
@@ -131,7 +131,7 @@ public:
size_t entry_size() const { return m_section_header.sh_entsize; }
size_t entry_count() const { return !entry_size() ? 0 : size() / entry_size(); }
FlatPtr address() const { return m_section_header.sh_addr; }
- const char* raw_data() const { return m_image.raw_data(m_section_header.sh_offset); }
+ char const* raw_data() const { return m_image.raw_data(m_section_header.sh_offset); }
ReadonlyBytes bytes() const { return { raw_data(), size() }; }
Optional<RelocationSection> relocations() const;
auto flags() const { return m_section_header.sh_flags; }
@@ -140,14 +140,14 @@ public:
protected:
friend class RelocationSection;
- const Image& m_image;
+ Image const& m_image;
const ElfW(Shdr) & m_section_header;
unsigned m_section_index;
};
class RelocationSection : public Section {
public:
- explicit RelocationSection(const Section& section)
+ explicit RelocationSection(Section const& section)
: Section(section.m_image, section.m_section_index)
{
}
@@ -160,7 +160,7 @@ public:
class Relocation {
public:
- Relocation(const Image& image, const ElfW(Rel) & rel)
+ Relocation(Image const& image, const ElfW(Rel) & rel)
: m_image(image)
, m_rel(rel)
{
@@ -188,7 +188,7 @@ public:
}
private:
- const Image& m_image;
+ Image const& m_image;
const ElfW(Rel) & m_rel;
};
@@ -243,7 +243,7 @@ public:
Optional<Image::Symbol> find_symbol(FlatPtr address, u32* offset = nullptr) const;
private:
- const char* raw_data(unsigned offset) const;
+ char const* raw_data(unsigned offset) const;
const ElfW(Ehdr) & header() const;
const ElfW(Shdr) & section_header(unsigned) const;
const ElfW(Phdr) & program_header_internal(unsigned) const;
@@ -252,7 +252,7 @@ private:
StringView section_index_to_string(unsigned index) const;
StringView table_string(unsigned table_index, unsigned offset) const;
- const u8* m_buffer { nullptr };
+ u8 const* m_buffer { nullptr };
size_t m_size { 0 };
bool m_verbose_logging { true };
bool m_valid { false };
diff --git a/Userland/Libraries/LibGL/GL/gl.h b/Userland/Libraries/LibGL/GL/gl.h
index ce37953258..696ae07cce 100644
--- a/Userland/Libraries/LibGL/GL/gl.h
+++ b/Userland/Libraries/LibGL/GL/gl.h
@@ -484,26 +484,26 @@ GLAPI void glClearStencil(GLint s);
GLAPI void glColor3d(GLdouble r, GLdouble g, GLdouble b);
GLAPI void glColor3dv(GLdouble const* v);
GLAPI void glColor3f(GLfloat r, GLfloat g, GLfloat b);
-GLAPI void glColor3fv(const GLfloat* v);
+GLAPI void glColor3fv(GLfloat const* v);
GLAPI void glColor3ub(GLubyte r, GLubyte g, GLubyte b);
GLAPI void glColor3ubv(GLubyte const* v);
GLAPI void glColor4b(GLbyte r, GLbyte g, GLbyte b, GLbyte a);
GLAPI void glColor4dv(GLdouble const* v);
GLAPI void glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
-GLAPI void glColor4fv(const GLfloat* v);
+GLAPI void glColor4fv(GLfloat const* v);
GLAPI void glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a);
-GLAPI void glColor4ubv(const GLubyte* v);
+GLAPI void glColor4ubv(GLubyte const* v);
GLAPI void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
GLAPI void glColorMaterial(GLenum face, GLenum mode);
-GLAPI void glDeleteTextures(GLsizei n, const GLuint* textures);
+GLAPI void glDeleteTextures(GLsizei n, GLuint const* textures);
GLAPI void glEnd();
GLAPI void glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearVal, GLdouble farVal);
GLAPI void glGenTextures(GLsizei n, GLuint* textures);
GLAPI GLenum glGetError();
GLAPI GLubyte* glGetString(GLenum name);
GLAPI void glLoadIdentity();
-GLAPI void glLoadMatrixd(const GLdouble* matrix);
-GLAPI void glLoadMatrixf(const GLfloat* matrix);
+GLAPI void glLoadMatrixd(GLdouble const* matrix);
+GLAPI void glLoadMatrixf(GLfloat const* matrix);
GLAPI void glMatrixMode(GLenum mode);
GLAPI void glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearVal, GLdouble farVal);
GLAPI void glPushMatrix();
@@ -517,29 +517,29 @@ GLAPI void glScalef(GLfloat x, GLfloat y, GLfloat z);
GLAPI void glTranslated(GLdouble x, GLdouble y, GLdouble z);
GLAPI void glTranslatef(GLfloat x, GLfloat y, GLfloat z);
GLAPI void glVertex2d(GLdouble x, GLdouble y);
-GLAPI void glVertex2dv(const GLdouble* v);
+GLAPI void glVertex2dv(GLdouble const* v);
GLAPI void glVertex2f(GLfloat x, GLfloat y);
-GLAPI void glVertex2fv(const GLfloat* v);
+GLAPI void glVertex2fv(GLfloat const* v);
GLAPI void glVertex2i(GLint x, GLint y);
-GLAPI void glVertex2iv(const GLint* v);
+GLAPI void glVertex2iv(GLint const* v);
GLAPI void glVertex2s(GLshort x, GLshort y);
-GLAPI void glVertex2sv(const GLshort* v);
+GLAPI void glVertex2sv(GLshort const* v);
GLAPI void glVertex3d(GLdouble x, GLdouble y, GLdouble z);
-GLAPI void glVertex3dv(const GLdouble* v);
+GLAPI void glVertex3dv(GLdouble const* v);
GLAPI void glVertex3f(GLfloat x, GLfloat y, GLfloat z);
-GLAPI void glVertex3fv(const GLfloat* v);
+GLAPI void glVertex3fv(GLfloat const* v);
GLAPI void glVertex3i(GLint x, GLint y, GLint z);
-GLAPI void glVertex3iv(const GLint* v);
+GLAPI void glVertex3iv(GLint const* v);
GLAPI void glVertex3s(GLshort x, GLshort y, GLshort z);
-GLAPI void glVertex3sv(const GLshort* v);
+GLAPI void glVertex3sv(GLshort const* v);
GLAPI void glVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void glVertex4dv(const GLdouble* v);
+GLAPI void glVertex4dv(GLdouble const* v);
GLAPI void glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void glVertex4fv(const GLfloat* v);
+GLAPI void glVertex4fv(GLfloat const* v);
GLAPI void glVertex4i(GLint x, GLint y, GLint z, GLint w);
-GLAPI void glVertex4iv(const GLint* v);
+GLAPI void glVertex4iv(GLint const* v);
GLAPI void glVertex4s(GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void glVertex4sv(const GLshort* v);
+GLAPI void glVertex4sv(GLshort const* v);
GLAPI void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
GLAPI void glEnable(GLenum cap);
GLAPI void glDisable(GLenum cap);
@@ -566,7 +566,7 @@ GLAPI void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum
GLAPI void glTexImage1D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, GLvoid const* data);
GLAPI void glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLvoid const* data);
GLAPI void glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLvoid const* data);
-GLAPI void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* data);
+GLAPI void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid const* data);
GLAPI void glTexCoord1f(GLfloat s);
GLAPI void glTexCoord1fv(GLfloat const* v);
GLAPI void glTexCoord2d(GLdouble s, GLdouble t);
@@ -577,7 +577,7 @@ GLAPI void glTexCoord2i(GLint s, GLint t);
GLAPI void glTexCoord3f(GLfloat s, GLfloat t, GLfloat r);
GLAPI void glTexCoord3fv(GLfloat const* v);
GLAPI void glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GLAPI void glTexCoord4fv(const GLfloat* v);
+GLAPI void glTexCoord4fv(GLfloat const* v);
GLAPI void glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);
GLAPI void glMultiTexCoord2f(GLenum target, GLfloat s, GLfloat t);
GLAPI void glTexParameteri(GLenum target, GLenum pname, GLint param);
@@ -602,12 +602,12 @@ GLAPI void glDisableClientState(GLenum cap);
GLAPI void glClientActiveTextureARB(GLenum target);
GLAPI void glClientActiveTexture(GLenum target);
-GLAPI void glVertexPointer(GLint size, GLenum type, GLsizei stride, const void* pointer);
-GLAPI void glColorPointer(GLint size, GLenum type, GLsizei stride, const void* pointer);
-GLAPI void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const void* pointer);
+GLAPI void glVertexPointer(GLint size, GLenum type, GLsizei stride, void const* pointer);
+GLAPI void glColorPointer(GLint size, GLenum type, GLsizei stride, void const* pointer);
+GLAPI void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, void const* pointer);
GLAPI void glDrawArrays(GLenum mode, GLint first, GLsizei count);
-GLAPI void glDrawElements(GLenum mode, GLsizei count, GLenum type, const void* indices);
-GLAPI void glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const void* data);
+GLAPI void glDrawElements(GLenum mode, GLsizei count, GLenum type, void const* indices);
+GLAPI void glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, void const* data);
GLAPI void glDepthRange(GLdouble nearVal, GLdouble farVal);
GLAPI void glDepthFunc(GLenum func);
GLAPI void glPolygonMode(GLenum face, GLenum mode);
diff --git a/Userland/Libraries/LibGL/GLColor.cpp b/Userland/Libraries/LibGL/GLColor.cpp
index a3b50c3fc1..4eb277c919 100644
--- a/Userland/Libraries/LibGL/GLColor.cpp
+++ b/Userland/Libraries/LibGL/GLColor.cpp
@@ -26,7 +26,7 @@ void glColor3f(GLfloat r, GLfloat g, GLfloat b)
g_gl_context->gl_color(r, g, b, 1.0);
}
-void glColor3fv(const GLfloat* v)
+void glColor3fv(GLfloat const* v)
{
g_gl_context->gl_color(v[0], v[1], v[2], 1.0);
}
@@ -60,7 +60,7 @@ void glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
g_gl_context->gl_color(r, g, b, a);
}
-void glColor4fv(const GLfloat* v)
+void glColor4fv(GLfloat const* v)
{
g_gl_context->gl_color(v[0], v[1], v[2], v[3]);
}
@@ -70,7 +70,7 @@ void glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a)
g_gl_context->gl_color(r / 255.0, g / 255.0, b / 255.0, a / 255.0);
}
-void glColor4ubv(const GLubyte* v)
+void glColor4ubv(GLubyte const* v)
{
g_gl_context->gl_color(v[0] / 255.0, v[1] / 255.0, v[2] / 255.0, v[3] / 255.0);
}
diff --git a/Userland/Libraries/LibGL/GLContext.cpp b/Userland/Libraries/LibGL/GLContext.cpp
index 0c0246f25d..f57c6f99b5 100644
--- a/Userland/Libraries/LibGL/GLContext.cpp
+++ b/Userland/Libraries/LibGL/GLContext.cpp
@@ -471,7 +471,7 @@ void GLContext::gl_load_identity()
*m_current_matrix = FloatMatrix4x4::identity();
}
-void GLContext::gl_load_matrix(const FloatMatrix4x4& matrix)
+void GLContext::gl_load_matrix(FloatMatrix4x4 const& matrix)
{
APPEND_TO_CALL_LIST_WITH_ARG_AND_RETURN_IF_NEEDED(gl_load_matrix, matrix);
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
@@ -859,7 +859,7 @@ void GLContext::gl_gen_textures(GLsizei n, GLuint* textures)
}
}
-void GLContext::gl_delete_textures(GLsizei n, const GLuint* textures)
+void GLContext::gl_delete_textures(GLsizei n, GLuint const* textures)
{
RETURN_WITH_ERROR_IF(n < 0, GL_INVALID_VALUE);
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
@@ -1070,8 +1070,7 @@ void GLContext::invoke_list(size_t list_index)
for (auto& entry : listing.entries) {
entry.function.visit([&](auto& function) {
entry.arguments.visit([&](auto& arguments) {
- auto apply = [&]<typename... Args>(Args && ... args)
- {
+ auto apply = [&]<typename... Args>(Args&&... args) {
if constexpr (requires { (this->*function)(forward<Args>(args)...); })
(this->*function)(forward<Args>(args)...);
};
@@ -1987,7 +1986,7 @@ void GLContext::gl_client_active_texture(GLenum target)
m_client_active_texture = target - GL_TEXTURE0;
}
-void GLContext::gl_vertex_pointer(GLint size, GLenum type, GLsizei stride, const void* pointer)
+void GLContext::gl_vertex_pointer(GLint size, GLenum type, GLsizei stride, void const* pointer)
{
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
RETURN_WITH_ERROR_IF(!(size == 2 || size == 3 || size == 4), GL_INVALID_VALUE);
@@ -1997,7 +1996,7 @@ void GLContext::gl_vertex_pointer(GLint size, GLenum type, GLsizei stride, const
m_client_vertex_pointer = { .size = size, .type = type, .stride = stride, .pointer = pointer };
}
-void GLContext::gl_color_pointer(GLint size, GLenum type, GLsizei stride, const void* pointer)
+void GLContext::gl_color_pointer(GLint size, GLenum type, GLsizei stride, void const* pointer)
{
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
RETURN_WITH_ERROR_IF(!(size == 3 || size == 4), GL_INVALID_VALUE);
@@ -2015,7 +2014,7 @@ void GLContext::gl_color_pointer(GLint size, GLenum type, GLsizei stride, const
m_client_color_pointer = { .size = size, .type = type, .stride = stride, .pointer = pointer };
}
-void GLContext::gl_tex_coord_pointer(GLint size, GLenum type, GLsizei stride, const void* pointer)
+void GLContext::gl_tex_coord_pointer(GLint size, GLenum type, GLsizei stride, void const* pointer)
{
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
RETURN_WITH_ERROR_IF(!(size == 1 || size == 2 || size == 3 || size == 4), GL_INVALID_VALUE);
@@ -2117,7 +2116,7 @@ void GLContext::gl_draw_arrays(GLenum mode, GLint first, GLsizei count)
gl_end();
}
-void GLContext::gl_draw_elements(GLenum mode, GLsizei count, GLenum type, const void* indices)
+void GLContext::gl_draw_elements(GLenum mode, GLsizei count, GLenum type, void const* indices)
{
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_draw_elements, mode, count, type, indices);
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
@@ -2147,13 +2146,13 @@ void GLContext::gl_draw_elements(GLenum mode, GLsizei count, GLenum type, const
int i = 0;
switch (type) {
case GL_UNSIGNED_BYTE:
- i = reinterpret_cast<const GLubyte*>(indices)[index];
+ i = reinterpret_cast<GLubyte const*>(indices)[index];
break;
case GL_UNSIGNED_SHORT:
- i = reinterpret_cast<const GLushort*>(indices)[index];
+ i = reinterpret_cast<GLushort const*>(indices)[index];
break;
case GL_UNSIGNED_INT:
- i = reinterpret_cast<const GLuint*>(indices)[index];
+ i = reinterpret_cast<GLuint const*>(indices)[index];
break;
}
@@ -2184,7 +2183,7 @@ void GLContext::gl_draw_elements(GLenum mode, GLsizei count, GLenum type, const
gl_end();
}
-void GLContext::gl_draw_pixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const void* data)
+void GLContext::gl_draw_pixels(GLsizei width, GLsizei height, GLenum format, GLenum type, void const* data)
{
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_draw_pixels, width, height, format, type, data);
@@ -2335,7 +2334,7 @@ void GLContext::gl_depth_func(GLenum func)
// General helper function to read arbitrary vertex attribute data into a float array
void GLContext::read_from_vertex_attribute_pointer(VertexAttribPointer const& attrib, int index, float* elements)
{
- auto byte_ptr = reinterpret_cast<const char*>(attrib.pointer);
+ auto byte_ptr = reinterpret_cast<char const*>(attrib.pointer);
auto normalize = attrib.normalize;
size_t stride = attrib.stride;
@@ -2345,7 +2344,7 @@ void GLContext::read_from_vertex_attribute_pointer(VertexAttribPointer const& at
stride = sizeof(GLbyte) * attrib.size;
for (int i = 0; i < attrib.size; i++) {
- elements[i] = *(reinterpret_cast<const GLbyte*>(byte_ptr + stride * index) + i);
+ elements[i] = *(reinterpret_cast<GLbyte const*>(byte_ptr + stride * index) + i);
if (normalize)
elements[i] /= 0x80;
}
@@ -2356,7 +2355,7 @@ void GLContext::read_from_vertex_attribute_pointer(VertexAttribPointer const& at
stride = sizeof(GLubyte) * attrib.size;
for (int i = 0; i < attrib.size; i++) {
- elements[i] = *(reinterpret_cast<const GLubyte*>(byte_ptr + stride * index) + i);
+ elements[i] = *(reinterpret_cast<GLubyte const*>(byte_ptr + stride * index) + i);
if (normalize)
elements[i] /= 0xff;
}
@@ -2367,7 +2366,7 @@ void GLContext::read_from_vertex_attribute_pointer(VertexAttribPointer const& at
stride = sizeof(GLshort) * attrib.size;
for (int i = 0; i < attrib.size; i++) {
- elements[i] = *(reinterpret_cast<const GLshort*>(byte_ptr + stride * index) + i);
+ elements[i] = *(reinterpret_cast<GLshort const*>(byte_ptr + stride * index) + i);
if (normalize)
elements[i] /= 0x8000;
}
@@ -2378,7 +2377,7 @@ void GLContext::read_from_vertex_attribute_pointer(VertexAttribPointer const& at
stride = sizeof(GLushort) * attrib.size;
for (int i = 0; i < attrib.size; i++) {
- elements[i] = *(reinterpret_cast<const GLushort*>(byte_ptr + stride * index) + i);
+ elements[i] = *(reinterpret_cast<GLushort const*>(byte_ptr + stride * index) + i);
if (normalize)
elements[i] /= 0xffff;
}
@@ -2389,7 +2388,7 @@ void GLContext::read_from_vertex_attribute_pointer(VertexAttribPointer const& at
stride = sizeof(GLint) * attrib.size;
for (int i = 0; i < attrib.size; i++) {
- elements[i] = *(reinterpret_cast<const GLint*>(byte_ptr + stride * index) + i);
+ elements[i] = *(reinterpret_cast<GLint const*>(byte_ptr + stride * index) + i);
if (normalize)
elements[i] /= 0x80000000;
}
@@ -2400,7 +2399,7 @@ void GLContext::read_from_vertex_attribute_pointer(VertexAttribPointer const& at
stride = sizeof(GLuint) * attrib.size;
for (int i = 0; i < attrib.size; i++) {
- elements[i] = *(reinterpret_cast<const GLuint*>(byte_ptr + stride * index) + i);
+ elements[i] = *(reinterpret_cast<GLuint const*>(byte_ptr + stride * index) + i);
if (normalize)
elements[i] /= 0xffffffff;
}
@@ -2411,7 +2410,7 @@ void GLContext::read_from_vertex_attribute_pointer(VertexAttribPointer const& at
stride = sizeof(GLfloat) * attrib.size;
for (int i = 0; i < attrib.size; i++)
- elements[i] = *(reinterpret_cast<const GLfloat*>(byte_ptr + stride * index) + i);
+ elements[i] = *(reinterpret_cast<GLfloat const*>(byte_ptr + stride * index) + i);
break;
}
case GL_DOUBLE: {
@@ -2419,7 +2418,7 @@ void GLContext::read_from_vertex_attribute_pointer(VertexAttribPointer const& at
stride = sizeof(GLdouble) * attrib.size;
for (int i = 0; i < attrib.size; i++)
- elements[i] = static_cast<float>(*(reinterpret_cast<const GLdouble*>(byte_ptr + stride * index) + i));
+ elements[i] = static_cast<float>(*(reinterpret_cast<GLdouble const*>(byte_ptr + stride * index) + i));
break;
}
}
diff --git a/Userland/Libraries/LibGL/GLContext.h b/Userland/Libraries/LibGL/GLContext.h
index c4704973fb..394ee8216e 100644
--- a/Userland/Libraries/LibGL/GLContext.h
+++ b/Userland/Libraries/LibGL/GLContext.h
@@ -57,14 +57,14 @@ public:
void gl_clear_depth(GLdouble depth);
void gl_clear_stencil(GLint s);
void gl_color(GLdouble r, GLdouble g, GLdouble b, GLdouble a);
- void gl_delete_textures(GLsizei n, const GLuint* textures);
+ void gl_delete_textures(GLsizei n, GLuint const* textures);
void gl_end();
void gl_frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
void gl_gen_textures(GLsizei n, GLuint* textures);
GLenum gl_get_error();
GLubyte* gl_get_string(GLenum name);
void gl_load_identity();
- void gl_load_matrix(const FloatMatrix4x4& matrix);
+ void gl_load_matrix(FloatMatrix4x4 const& matrix);
void gl_matrix_mode(GLenum mode);
void gl_ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
void gl_push_matrix();
@@ -110,12 +110,12 @@ public:
void gl_enable_client_state(GLenum cap);
void gl_disable_client_state(GLenum cap);
void gl_client_active_texture(GLenum target);
- void gl_vertex_pointer(GLint size, GLenum type, GLsizei stride, const void* pointer);
- void gl_color_pointer(GLint size, GLenum type, GLsizei stride, const void* pointer);
- void gl_tex_coord_pointer(GLint size, GLenum type, GLsizei stride, const void* pointer);
+ void gl_vertex_pointer(GLint size, GLenum type, GLsizei stride, void const* pointer);
+ void gl_color_pointer(GLint size, GLenum type, GLsizei stride, void const* pointer);
+ void gl_tex_coord_pointer(GLint size, GLenum type, GLsizei stride, void const* pointer);
void gl_draw_arrays(GLenum mode, GLint first, GLsizei count);
- void gl_draw_elements(GLenum mode, GLsizei count, GLenum type, const void* indices);
- void gl_draw_pixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const void* data);
+ void gl_draw_elements(GLenum mode, GLsizei count, GLenum type, void const* indices);
+ void gl_draw_pixels(GLsizei width, GLsizei height, GLenum format, GLenum type, void const* data);
void gl_color_mask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
void gl_get_booleanv(GLenum pname, GLboolean* data);
void gl_get_doublev(GLenum pname, GLdouble* params);
@@ -419,7 +419,7 @@ private:
GLenum type { GL_FLOAT };
bool normalize { true };
GLsizei stride { 0 };
- const void* pointer { 0 };
+ void const* pointer { 0 };
};
static void read_from_vertex_attribute_pointer(VertexAttribPointer const&, int index, float* elements);
diff --git a/Userland/Libraries/LibGL/GLDraw.cpp b/Userland/Libraries/LibGL/GLDraw.cpp
index f484dc49d2..9d16e42f44 100644
--- a/Userland/Libraries/LibGL/GLDraw.cpp
+++ b/Userland/Libraries/LibGL/GLDraw.cpp
@@ -15,7 +15,7 @@ void glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLflo
g_gl_context->gl_bitmap(width, height, xorig, yorig, xmove, ymove, bitmap);
}
-void glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const void* data)
+void glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, void const* data)
{
g_gl_context->gl_draw_pixels(width, height, format, type, data);
}
diff --git a/Userland/Libraries/LibGL/GLTexture.cpp b/Userland/Libraries/LibGL/GLTexture.cpp
index 73c8d1af46..adf43b416f 100644
--- a/Userland/Libraries/LibGL/GLTexture.cpp
+++ b/Userland/Libraries/LibGL/GLTexture.cpp
@@ -15,29 +15,29 @@ void glGenTextures(GLsizei n, GLuint* textures)
g_gl_context->gl_gen_textures(n, textures);
}
-void glDeleteTextures(GLsizei n, const GLuint* textures)
+void glDeleteTextures(GLsizei n, GLuint const* textures)
{
g_gl_context->gl_delete_textures(n, textures);
}
-void glTexImage1D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid* data)
+void glTexImage1D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, GLvoid const* data)
{
dbgln("glTexImage1D({:#x}, {}, {:#x}, {}, {}, {:#x}, {:#x}, {:p}): unimplemented", target, level, internalFormat, width, border, format, type, data);
TODO();
}
-void glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* data)
+void glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLvoid const* data)
{
g_gl_context->gl_tex_image_2d(target, level, internalFormat, width, height, border, format, type, data);
}
-void glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* data)
+void glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLvoid const* data)
{
dbgln("glTexImage3D({:#x}, {}, {:#x}, {}, {}, {}, {}, {:#x}, {:#x}, {:p}): unimplemented", target, level, internalFormat, width, height, depth, border, format, type, data);
TODO();
}
-void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* data)
+void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid const* data)
{
g_gl_context->gl_tex_sub_image_2d(target, level, xoffset, yoffset, width, height, format, type, data);
}
diff --git a/Userland/Libraries/LibGL/GLVert.cpp b/Userland/Libraries/LibGL/GLVert.cpp
index a0a40e9082..1005a7f875 100644
--- a/Userland/Libraries/LibGL/GLVert.cpp
+++ b/Userland/Libraries/LibGL/GLVert.cpp
@@ -25,7 +25,7 @@ void glVertex2d(GLdouble x, GLdouble y)
g_gl_context->gl_vertex(x, y, 0.0, 1.0);
}
-void glVertex2dv(const GLdouble* v)
+void glVertex2dv(GLdouble const* v)
{
g_gl_context->gl_vertex(v[0], v[1], 0.0, 1.0);
}
@@ -35,7 +35,7 @@ void glVertex2f(GLfloat x, GLfloat y)
g_gl_context->gl_vertex(x, y, 0.0, 1.0);
}
-void glVertex2fv(const GLfloat* v)
+void glVertex2fv(GLfloat const* v)
{
g_gl_context->gl_vertex(v[0], v[1], 0.0, 1.0);
}
@@ -45,7 +45,7 @@ void glVertex2i(GLint x, GLint y)
g_gl_context->gl_vertex(x, y, 0.0, 1.0);
}
-void glVertex2iv(const GLint* v)
+void glVertex2iv(GLint const* v)
{
g_gl_context->gl_vertex(v[0], v[1], 0.0, 1.0);
}
@@ -55,7 +55,7 @@ void glVertex2s(GLshort x, GLshort y)
g_gl_context->gl_vertex(x, y, 0.0, 1.0);
}
-void glVertex2sv(const GLshort* v)
+void glVertex2sv(GLshort const* v)
{
g_gl_context->gl_vertex(v[0], v[1], 0.0, 1.0);
}
@@ -65,7 +65,7 @@ void glVertex3d(GLdouble x, GLdouble y, GLdouble z)
g_gl_context->gl_vertex(x, y, z, 1.0);
}
-void glVertex3dv(const GLdouble* v)
+void glVertex3dv(GLdouble const* v)
{
g_gl_context->gl_vertex(v[0], v[1], v[2], 1.0);
}
@@ -75,7 +75,7 @@ void glVertex3f(GLfloat x, GLfloat y, GLfloat z)
g_gl_context->gl_vertex(x, y, z, 1.0);
}
-void glVertex3fv(const GLfloat* v)
+void glVertex3fv(GLfloat const* v)
{
g_gl_context->gl_vertex(v[0], v[1], v[2], 1.0);
}
@@ -85,7 +85,7 @@ void glVertex3i(GLint x, GLint y, GLint z)
g_gl_context->gl_vertex(x, y, z, 1.0);
}
-void glVertex3iv(const GLint* v)
+void glVertex3iv(GLint const* v)
{
g_gl_context->gl_vertex(v[0], v[1], v[2], 1.0);
}
@@ -95,7 +95,7 @@ void glVertex3s(GLshort x, GLshort y, GLshort z)
g_gl_context->gl_vertex(x, y, z, 1.0);
}
-void glVertex3sv(const GLshort* v)
+void glVertex3sv(GLshort const* v)
{
g_gl_context->gl_vertex(v[0], v[1], v[2], 1.0);
}
@@ -105,7 +105,7 @@ void glVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
g_gl_context->gl_vertex(x, y, z, w);
}
-void glVertex4dv(const GLdouble* v)
+void glVertex4dv(GLdouble const* v)
{
g_gl_context->gl_vertex(v[0], v[1], v[2], v[3]);
}
@@ -115,7 +115,7 @@ void glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
g_gl_context->gl_vertex(x, y, z, w);
}
-void glVertex4fv(const GLfloat* v)
+void glVertex4fv(GLfloat const* v)
{
g_gl_context->gl_vertex(v[0], v[1], v[2], v[3]);
}
@@ -125,7 +125,7 @@ void glVertex4i(GLint x, GLint y, GLint z, GLint w)
g_gl_context->gl_vertex(x, y, z, w);
}
-void glVertex4iv(const GLint* v)
+void glVertex4iv(GLint const* v)
{
g_gl_context->gl_vertex(v[0], v[1], v[2], v[3]);
}
@@ -135,7 +135,7 @@ void glVertex4s(GLshort x, GLshort y, GLshort z, GLshort w)
g_gl_context->gl_vertex(x, y, z, w);
}
-void glVertex4sv(const GLshort* v)
+void glVertex4sv(GLshort const* v)
{
g_gl_context->gl_vertex(v[0], v[1], v[2], v[3]);
}
@@ -190,7 +190,7 @@ void glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
g_gl_context->gl_tex_coord(s, t, r, q);
}
-void glTexCoord4fv(const GLfloat* v)
+void glTexCoord4fv(GLfloat const* v)
{
g_gl_context->gl_tex_coord(v[0], v[1], v[2], v[3]);
}
diff --git a/Userland/Libraries/LibGL/GLVertexArrays.cpp b/Userland/Libraries/LibGL/GLVertexArrays.cpp
index 46a3a8d2a9..3dea1ade54 100644
--- a/Userland/Libraries/LibGL/GLVertexArrays.cpp
+++ b/Userland/Libraries/LibGL/GLVertexArrays.cpp
@@ -9,17 +9,17 @@
extern GL::GLContext* g_gl_context;
-void glVertexPointer(GLint size, GLenum type, GLsizei stride, const void* pointer)
+void glVertexPointer(GLint size, GLenum type, GLsizei stride, void const* pointer)
{
g_gl_context->gl_vertex_pointer(size, type, stride, pointer);
}
-void glColorPointer(GLint size, GLenum type, GLsizei stride, const void* pointer)
+void glColorPointer(GLint size, GLenum type, GLsizei stride, void const* pointer)
{
g_gl_context->gl_color_pointer(size, type, stride, pointer);
}
-void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const void* pointer)
+void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, void const* pointer)
{
g_gl_context->gl_tex_coord_pointer(size, type, stride, pointer);
}
@@ -29,7 +29,7 @@ void glDrawArrays(GLenum mode, GLint first, GLsizei count)
g_gl_context->gl_draw_arrays(mode, first, count);
}
-void glDrawElements(GLenum mode, GLsizei count, GLenum type, const void* indices)
+void glDrawElements(GLenum mode, GLsizei count, GLenum type, void const* indices)
{
g_gl_context->gl_draw_elements(mode, count, type, indices);
}
diff --git a/Userland/Libraries/LibGUI/AboutDialog.cpp b/Userland/Libraries/LibGUI/AboutDialog.cpp
index c0ae44b967..a2d1fdb23a 100644
--- a/Userland/Libraries/LibGUI/AboutDialog.cpp
+++ b/Userland/Libraries/LibGUI/AboutDialog.cpp
@@ -17,7 +17,7 @@
namespace GUI {
-AboutDialog::AboutDialog(StringView name, const Gfx::Bitmap* icon, Window* parent_window, StringView version)
+AboutDialog::AboutDialog(StringView name, Gfx::Bitmap const* icon, Window* parent_window, StringView version)
: Dialog(parent_window)
, m_name(name)
, m_icon(icon)
diff --git a/Userland/Libraries/LibGUI/AboutDialog.h b/Userland/Libraries/LibGUI/AboutDialog.h
index 4fb3ac3ee4..a6b5a724e0 100644
--- a/Userland/Libraries/LibGUI/AboutDialog.h
+++ b/Userland/Libraries/LibGUI/AboutDialog.h
@@ -17,7 +17,7 @@ class AboutDialog final : public Dialog {
public:
virtual ~AboutDialog() override = default;
- static void show(StringView name, const Gfx::Bitmap* icon = nullptr, Window* parent_window = nullptr, const Gfx::Bitmap* window_icon = nullptr, StringView version = Core::Version::SERENITY_VERSION)
+ static void show(StringView name, Gfx::Bitmap const* icon = nullptr, Window* parent_window = nullptr, Gfx::Bitmap const* window_icon = nullptr, StringView version = Core::Version::SERENITY_VERSION)
{
auto dialog = AboutDialog::construct(name, icon, parent_window, version);
if (window_icon)
@@ -26,7 +26,7 @@ public:
}
private:
- AboutDialog(StringView name, const Gfx::Bitmap* icon = nullptr, Window* parent_window = nullptr, StringView version = Core::Version::SERENITY_VERSION);
+ AboutDialog(StringView name, Gfx::Bitmap const* icon = nullptr, Window* parent_window = nullptr, StringView version = Core::Version::SERENITY_VERSION);
String m_name;
RefPtr<Gfx::Bitmap> m_icon;
diff --git a/Userland/Libraries/LibGUI/AbstractButton.cpp b/Userland/Libraries/LibGUI/AbstractButton.cpp
index 4697c490b0..be77913634 100644
--- a/Userland/Libraries/LibGUI/AbstractButton.cpp
+++ b/Userland/Libraries/LibGUI/AbstractButton.cpp
@@ -218,7 +218,7 @@ void AbstractButton::keyup_event(KeyEvent& event)
Widget::keyup_event(event);
}
-void AbstractButton::paint_text(Painter& painter, const Gfx::IntRect& rect, const Gfx::Font& font, Gfx::TextAlignment text_alignment, Gfx::TextWrapping text_wrapping)
+void AbstractButton::paint_text(Painter& painter, Gfx::IntRect const& rect, Gfx::Font const& font, Gfx::TextAlignment text_alignment, Gfx::TextWrapping text_wrapping)
{
auto clipped_rect = rect.intersected(this->rect());
diff --git a/Userland/Libraries/LibGUI/AbstractButton.h b/Userland/Libraries/LibGUI/AbstractButton.h
index 40c3b71d56..0a29c8b9fc 100644
--- a/Userland/Libraries/LibGUI/AbstractButton.h
+++ b/Userland/Libraries/LibGUI/AbstractButton.h
@@ -21,7 +21,7 @@ public:
Function<void(bool)> on_checked;
void set_text(String);
- const String& text() const { return m_text; }
+ String const& text() const { return m_text; }
bool is_exclusive() const { return m_exclusive; }
void set_exclusive(bool b) { m_exclusive = b; }
@@ -54,7 +54,7 @@ protected:
virtual void focusout_event(GUI::FocusEvent&) override;
virtual void change_event(Event&) override;
- void paint_text(Painter&, const Gfx::IntRect&, const Gfx::Font&, Gfx::TextAlignment, Gfx::TextWrapping = Gfx::TextWrapping::DontWrap);
+ void paint_text(Painter&, Gfx::IntRect const&, Gfx::Font const&, Gfx::TextAlignment, Gfx::TextWrapping = Gfx::TextWrapping::DontWrap);
private:
String m_text;
diff --git a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp
index b1a022f1a9..30e55ca91b 100644
--- a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp
+++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp
@@ -146,7 +146,7 @@ void AbstractScrollableWidget::update_scrollbar_ranges()
m_vertical_scrollbar->set_page_step(visible_content_rect().height() - m_vertical_scrollbar->step());
}
-void AbstractScrollableWidget::set_content_size(const Gfx::IntSize& size)
+void AbstractScrollableWidget::set_content_size(Gfx::IntSize const& size)
{
if (m_content_size == size)
return;
@@ -154,7 +154,7 @@ void AbstractScrollableWidget::set_content_size(const Gfx::IntSize& size)
update_scrollbar_ranges();
}
-void AbstractScrollableWidget::set_size_occupied_by_fixed_elements(const Gfx::IntSize& size)
+void AbstractScrollableWidget::set_size_occupied_by_fixed_elements(Gfx::IntSize const& size)
{
if (m_size_occupied_by_fixed_elements == size)
return;
@@ -191,14 +191,14 @@ Gfx::IntRect AbstractScrollableWidget::visible_content_rect() const
return rect;
}
-void AbstractScrollableWidget::scroll_into_view(const Gfx::IntRect& rect, Orientation orientation)
+void AbstractScrollableWidget::scroll_into_view(Gfx::IntRect const& rect, Orientation orientation)
{
if (orientation == Orientation::Vertical)
return scroll_into_view(rect, false, true);
return scroll_into_view(rect, true, false);
}
-void AbstractScrollableWidget::scroll_into_view(const Gfx::IntRect& rect, bool scroll_horizontally, bool scroll_vertically)
+void AbstractScrollableWidget::scroll_into_view(Gfx::IntRect const& rect, bool scroll_horizontally, bool scroll_vertically)
{
auto visible_content_rect = this->visible_content_rect();
if (visible_content_rect.contains(rect))
@@ -255,7 +255,7 @@ void AbstractScrollableWidget::set_automatic_scrolling_timer(bool active)
}
}
-Gfx::IntPoint AbstractScrollableWidget::automatic_scroll_delta_from_position(const Gfx::IntPoint& pos) const
+Gfx::IntPoint AbstractScrollableWidget::automatic_scroll_delta_from_position(Gfx::IntPoint const& pos) const
{
Gfx::IntPoint delta { 0, 0 };
@@ -280,7 +280,7 @@ Gfx::IntRect AbstractScrollableWidget::widget_inner_rect() const
return rect;
}
-Gfx::IntPoint AbstractScrollableWidget::to_content_position(const Gfx::IntPoint& widget_position) const
+Gfx::IntPoint AbstractScrollableWidget::to_content_position(Gfx::IntPoint const& widget_position) const
{
auto content_position = widget_position;
content_position.translate_by(horizontal_scrollbar().value(), vertical_scrollbar().value());
@@ -288,7 +288,7 @@ Gfx::IntPoint AbstractScrollableWidget::to_content_position(const Gfx::IntPoint&
return content_position;
}
-Gfx::IntPoint AbstractScrollableWidget::to_widget_position(const Gfx::IntPoint& content_position) const
+Gfx::IntPoint AbstractScrollableWidget::to_widget_position(Gfx::IntPoint const& content_position) const
{
auto widget_position = content_position;
widget_position.translate_by(-horizontal_scrollbar().value(), -vertical_scrollbar().value());
diff --git a/Userland/Libraries/LibGUI/AbstractScrollableWidget.h b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h
index fdc3ff5d12..54a79b7db7 100644
--- a/Userland/Libraries/LibGUI/AbstractScrollableWidget.h
+++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h
@@ -33,8 +33,8 @@ public:
return viewport_rect;
}
- void scroll_into_view(const Gfx::IntRect&, Orientation);
- void scroll_into_view(const Gfx::IntRect&, bool scroll_horizontally, bool scroll_vertically);
+ void scroll_into_view(Gfx::IntRect const&, Orientation);
+ void scroll_into_view(Gfx::IntRect const&, bool scroll_horizontally, bool scroll_vertically);
void set_scrollbars_enabled(bool);
bool is_scrollbars_enabled() const { return m_scrollbars_enabled; }
@@ -43,17 +43,17 @@ public:
Gfx::IntSize excess_size() const;
Scrollbar& vertical_scrollbar() { return *m_vertical_scrollbar; }
- const Scrollbar& vertical_scrollbar() const { return *m_vertical_scrollbar; }
+ Scrollbar const& vertical_scrollbar() const { return *m_vertical_scrollbar; }
Scrollbar& horizontal_scrollbar() { return *m_horizontal_scrollbar; }
- const Scrollbar& horizontal_scrollbar() const { return *m_horizontal_scrollbar; }
+ Scrollbar const& horizontal_scrollbar() const { return *m_horizontal_scrollbar; }
Widget& corner_widget() { return *m_corner_widget; }
- const Widget& corner_widget() const { return *m_corner_widget; }
+ Widget const& corner_widget() const { return *m_corner_widget; }
void scroll_to_top();
void scroll_to_bottom();
void set_automatic_scrolling_timer(bool active);
- virtual Gfx::IntPoint automatic_scroll_delta_from_position(const Gfx::IntPoint&) const;
+ virtual Gfx::IntPoint automatic_scroll_delta_from_position(Gfx::IntPoint const&) const;
int width_occupied_by_vertical_scrollbar() const;
int height_occupied_by_horizontal_scrollbar() const;
@@ -63,11 +63,11 @@ public:
void set_should_hide_unnecessary_scrollbars(bool b) { m_should_hide_unnecessary_scrollbars = b; }
bool should_hide_unnecessary_scrollbars() const { return m_should_hide_unnecessary_scrollbars; }
- Gfx::IntPoint to_content_position(const Gfx::IntPoint& widget_position) const;
- Gfx::IntPoint to_widget_position(const Gfx::IntPoint& content_position) const;
+ Gfx::IntPoint to_content_position(Gfx::IntPoint const& widget_position) const;
+ Gfx::IntPoint to_widget_position(Gfx::IntPoint const& content_position) const;
- Gfx::IntRect to_content_rect(const Gfx::IntRect& widget_rect) const { return { to_content_position(widget_rect.location()), widget_rect.size() }; }
- Gfx::IntRect to_widget_rect(const Gfx::IntRect& content_rect) const { return { to_widget_position(content_rect.location()), content_rect.size() }; }
+ Gfx::IntRect to_content_rect(Gfx::IntRect const& widget_rect) const { return { to_content_position(widget_rect.location()), widget_rect.size() }; }
+ Gfx::IntRect to_widget_rect(Gfx::IntRect const& content_rect) const { return { to_widget_position(content_rect.location()), content_rect.size() }; }
protected:
AbstractScrollableWidget();
@@ -75,8 +75,8 @@ protected:
virtual void resize_event(ResizeEvent&) override;
virtual void mousewheel_event(MouseEvent&) override;
virtual void did_scroll() { }
- void set_content_size(const Gfx::IntSize&);
- void set_size_occupied_by_fixed_elements(const Gfx::IntSize&);
+ void set_content_size(Gfx::IntSize const&);
+ void set_size_occupied_by_fixed_elements(Gfx::IntSize const&);
virtual void on_automatic_scrolling_timer_fired() {};
int autoscroll_threshold() const { return m_autoscroll_threshold; }
diff --git a/Userland/Libraries/LibGUI/AbstractTableView.cpp b/Userland/Libraries/LibGUI/AbstractTableView.cpp
index 68db013f4c..bc29dadf82 100644
--- a/Userland/Libraries/LibGUI/AbstractTableView.cpp
+++ b/Userland/Libraries/LibGUI/AbstractTableView.cpp
@@ -219,7 +219,7 @@ void AbstractTableView::mousedown_event(MouseEvent& event)
AbstractView::mousedown_event(event);
}
-ModelIndex AbstractTableView::index_at_event_position(const Gfx::IntPoint& position, bool& is_toggle) const
+ModelIndex AbstractTableView::index_at_event_position(Gfx::IntPoint const& position, bool& is_toggle) const
{
is_toggle = false;
if (!model())
@@ -239,7 +239,7 @@ ModelIndex AbstractTableView::index_at_event_position(const Gfx::IntPoint& posit
return {};
}
-ModelIndex AbstractTableView::index_at_event_position(const Gfx::IntPoint& position) const
+ModelIndex AbstractTableView::index_at_event_position(Gfx::IntPoint const& position) const
{
bool is_toggle;
auto index = index_at_event_position(position, is_toggle);
@@ -269,7 +269,7 @@ void AbstractTableView::move_cursor_relative(int vertical_steps, int horizontal_
}
}
-void AbstractTableView::scroll_into_view(const ModelIndex& index, bool scroll_horizontally, bool scroll_vertically)
+void AbstractTableView::scroll_into_view(ModelIndex const& index, bool scroll_horizontally, bool scroll_vertically)
{
Gfx::IntRect rect;
switch (selection_behavior()) {
@@ -321,12 +321,12 @@ Gfx::IntRect AbstractTableView::content_rect(int row, int column) const
return { row_rect.x() + x, row_rect.y(), column_width(column) + horizontal_padding() * 2, row_height() };
}
-Gfx::IntRect AbstractTableView::content_rect(const ModelIndex& index) const
+Gfx::IntRect AbstractTableView::content_rect(ModelIndex const& index) const
{
return content_rect(index.row(), index.column());
}
-Gfx::IntRect AbstractTableView::content_rect_minus_scrollbars(const ModelIndex& index) const
+Gfx::IntRect AbstractTableView::content_rect_minus_scrollbars(ModelIndex const& index) const
{
auto naive_content_rect = content_rect(index.row(), index.column());
return { naive_content_rect.x() - horizontal_scrollbar().value(), naive_content_rect.y() - vertical_scrollbar().value(), naive_content_rect.width(), naive_content_rect.height() };
@@ -340,7 +340,7 @@ Gfx::IntRect AbstractTableView::row_rect(int item_index) const
row_height() };
}
-Gfx::IntPoint AbstractTableView::adjusted_position(const Gfx::IntPoint& position) const
+Gfx::IntPoint AbstractTableView::adjusted_position(Gfx::IntPoint const& position) const
{
return position.translated(horizontal_scrollbar().value() - frame_thickness(), vertical_scrollbar().value() - frame_thickness());
}
@@ -469,7 +469,7 @@ bool AbstractTableView::is_navigation(GUI::KeyEvent& event)
}
}
-Gfx::IntPoint AbstractTableView::automatic_scroll_delta_from_position(const Gfx::IntPoint& pos) const
+Gfx::IntPoint AbstractTableView::automatic_scroll_delta_from_position(Gfx::IntPoint const& pos) const
{
if (pos.y() > column_header().height() + autoscroll_threshold())
return AbstractScrollableWidget::automatic_scroll_delta_from_position(pos);
diff --git a/Userland/Libraries/LibGUI/AbstractTableView.h b/Userland/Libraries/LibGUI/AbstractTableView.h
index 74de744560..30afb19a82 100644
--- a/Userland/Libraries/LibGUI/AbstractTableView.h
+++ b/Userland/Libraries/LibGUI/AbstractTableView.h
@@ -19,7 +19,7 @@ public:
virtual ~TableCellPaintingDelegate() = default;
virtual bool should_paint(ModelIndex const&) { return true; }
- virtual void paint(Painter&, const Gfx::IntRect&, const Gfx::Palette&, const ModelIndex&) = 0;
+ virtual void paint(Painter&, Gfx::IntRect const&, Gfx::Palette const&, ModelIndex const&) = 0;
};
class AbstractTableView : public AbstractView {
@@ -52,23 +52,23 @@ public:
void set_column_painting_delegate(int column, OwnPtr<TableCellPaintingDelegate>);
- Gfx::IntPoint adjusted_position(const Gfx::IntPoint&) const;
+ Gfx::IntPoint adjusted_position(Gfx::IntPoint const&) const;
- virtual Gfx::IntRect content_rect(const ModelIndex&) const override;
- Gfx::IntRect content_rect_minus_scrollbars(const ModelIndex&) const;
+ virtual Gfx::IntRect content_rect(ModelIndex const&) const override;
+ Gfx::IntRect content_rect_minus_scrollbars(ModelIndex const&) const;
Gfx::IntRect content_rect(int row, int column) const;
Gfx::IntRect row_rect(int item_index) const;
virtual Gfx::IntRect paint_invalidation_rect(ModelIndex const& index) const override;
- virtual void scroll_into_view(const ModelIndex&, bool scroll_horizontally = true, bool scroll_vertically = true) override;
- void scroll_into_view(const ModelIndex& index, Orientation orientation)
+ virtual void scroll_into_view(ModelIndex const&, bool scroll_horizontally = true, bool scroll_vertically = true) override;
+ void scroll_into_view(ModelIndex const& index, Orientation orientation)
{
scroll_into_view(index, orientation == Gfx::Orientation::Horizontal, orientation == Gfx::Orientation::Vertical);
}
- virtual ModelIndex index_at_event_position(const Gfx::IntPoint&, bool& is_toggle) const;
- virtual ModelIndex index_at_event_position(const Gfx::IntPoint&) const override;
+ virtual ModelIndex index_at_event_position(Gfx::IntPoint const&, bool& is_toggle) const;
+ virtual ModelIndex index_at_event_position(Gfx::IntPoint const&) const override;
virtual void select_all() override;
@@ -78,10 +78,10 @@ public:
virtual void did_scroll() override;
HeaderView& column_header() { return *m_column_header; }
- const HeaderView& column_header() const { return *m_column_header; }
+ HeaderView const& column_header() const { return *m_column_header; }
HeaderView& row_header() { return *m_row_header; }
- const HeaderView& row_header() const { return *m_row_header; }
+ HeaderView const& row_header() const { return *m_row_header; }
virtual void model_did_update(unsigned flags) override;
@@ -94,7 +94,7 @@ protected:
virtual void keydown_event(KeyEvent&) override;
virtual void resize_event(ResizeEvent&) override;
- virtual void toggle_index(const ModelIndex&) { }
+ virtual void toggle_index(ModelIndex const&) { }
void update_content_size();
virtual void auto_resize_column(int column);
@@ -106,7 +106,7 @@ protected:
void move_cursor_relative(int vertical_steps, int horizontal_steps, SelectionUpdate);
- virtual Gfx::IntPoint automatic_scroll_delta_from_position(const Gfx::IntPoint& pos) const override;
+ virtual Gfx::IntPoint automatic_scroll_delta_from_position(Gfx::IntPoint const& pos) const override;
private:
void layout_headers();
diff --git a/Userland/Libraries/LibGUI/AbstractZoomPanWidget.cpp b/Userland/Libraries/LibGUI/AbstractZoomPanWidget.cpp
index 03247bd670..0957ad587d 100644
--- a/Userland/Libraries/LibGUI/AbstractZoomPanWidget.cpp
+++ b/Userland/Libraries/LibGUI/AbstractZoomPanWidget.cpp
@@ -185,7 +185,7 @@ void AbstractZoomPanWidget::set_scale_bounds(float min_scale, float max_scale)
void AbstractZoomPanWidget::fit_content_to_rect(Gfx::IntRect const& viewport_rect, FitType type)
{
- const float border_ratio = 0.95f;
+ float const border_ratio = 0.95f;
auto image_size = m_original_rect.size();
auto height_ratio = floorf(border_ratio * viewport_rect.height()) / image_size.height();
auto width_ratio = floorf(border_ratio * viewport_rect.width()) / image_size.width();
diff --git a/Userland/Libraries/LibGUI/Action.cpp b/Userland/Libraries/LibGUI/Action.cpp
index 8191798993..4eceaa6fbd 100644
--- a/Userland/Libraries/LibGUI/Action.cpp
+++ b/Userland/Libraries/LibGUI/Action.cpp
@@ -23,22 +23,22 @@ NonnullRefPtr<Action> Action::create(String text, RefPtr<Gfx::Bitmap> icon, Func
return adopt_ref(*new Action(move(text), move(icon), move(callback), parent));
}
-NonnullRefPtr<Action> Action::create(String text, const Shortcut& shortcut, Function<void(Action&)> callback, Core::Object* parent)
+NonnullRefPtr<Action> Action::create(String text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent)
{
return adopt_ref(*new Action(move(text), shortcut, move(callback), parent));
}
-NonnullRefPtr<Action> Action::create(String text, const Shortcut& shortcut, const Shortcut& alternate_shortcut, Function<void(Action&)> callback, Core::Object* parent)
+NonnullRefPtr<Action> Action::create(String text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, Function<void(Action&)> callback, Core::Object* parent)
{
return adopt_ref(*new Action(move(text), shortcut, alternate_shortcut, move(callback), parent));
}
-NonnullRefPtr<Action> Action::create(String text, const Shortcut& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
+NonnullRefPtr<Action> Action::create(String text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
{
return adopt_ref(*new Action(move(text), shortcut, Shortcut {}, move(icon), move(callback), parent));
}
-NonnullRefPtr<Action> Action::create(String text, const Shortcut& shortcut, const Shortcut& alternate_shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
+NonnullRefPtr<Action> Action::create(String text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
{
return adopt_ref(*new Action(move(text), shortcut, alternate_shortcut, move(icon), move(callback), parent));
}
@@ -53,12 +53,12 @@ NonnullRefPtr<Action> Action::create_checkable(String text, RefPtr<Gfx::Bitmap>
return adopt_ref(*new Action(move(text), move(icon), move(callback), parent, true));
}
-NonnullRefPtr<Action> Action::create_checkable(String text, const Shortcut& shortcut, Function<void(Action&)> callback, Core::Object* parent)
+NonnullRefPtr<Action> Action::create_checkable(String text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent)
{
return adopt_ref(*new Action(move(text), shortcut, move(callback), parent, true));
}
-NonnullRefPtr<Action> Action::create_checkable(String text, const Shortcut& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
+NonnullRefPtr<Action> Action::create_checkable(String text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
{
return adopt_ref(*new Action(move(text), shortcut, Shortcut {}, move(icon), move(callback), parent, true));
}
@@ -73,17 +73,17 @@ Action::Action(String text, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> on
{
}
-Action::Action(String text, const Shortcut& shortcut, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
+Action::Action(String text, Shortcut const& shortcut, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
: Action(move(text), shortcut, Shortcut {}, nullptr, move(on_activation_callback), parent, checkable)
{
}
-Action::Action(String text, const Shortcut& shortcut, const Shortcut& alternate_shortcut, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
+Action::Action(String text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
: Action(move(text), shortcut, alternate_shortcut, nullptr, move(on_activation_callback), parent, checkable)
{
}
-Action::Action(String text, const Shortcut& shortcut, const Shortcut& alternate_shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
+Action::Action(String text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
: Core::Object(parent)
, on_activation(move(on_activation_callback))
, m_text(move(text))
@@ -217,7 +217,7 @@ void Action::set_group(Badge<ActionGroup>, ActionGroup* group)
m_action_group = AK::make_weak_ptr_if_nonnull(group);
}
-void Action::set_icon(const Gfx::Bitmap* icon)
+void Action::set_icon(Gfx::Bitmap const* icon)
{
m_icon = icon;
}
diff --git a/Userland/Libraries/LibGUI/Action.h b/Userland/Libraries/LibGUI/Action.h
index b1eca83b7a..bf2b5376d4 100644
--- a/Userland/Libraries/LibGUI/Action.h
+++ b/Userland/Libraries/LibGUI/Action.h
@@ -23,7 +23,7 @@
namespace GUI {
namespace CommonActions {
-NonnullRefPtr<Action> make_about_action(const String& app_name, const Icon& app_icon, Window* parent = nullptr);
+NonnullRefPtr<Action> make_about_action(String const& app_name, Icon const& app_icon, Window* parent = nullptr);
NonnullRefPtr<Action> make_open_action(Function<void(Action&)>, Core::Object* parent = nullptr);
NonnullRefPtr<Action> make_save_action(Function<void(Action&)>, Core::Object* parent = nullptr);
NonnullRefPtr<Action> make_save_as_action(Function<void(Action&)>, Core::Object* parent = nullptr);
@@ -65,14 +65,14 @@ public:
};
static NonnullRefPtr<Action> create(String text, Function<void(Action&)> callback, Core::Object* parent = nullptr);
static NonnullRefPtr<Action> create(String text, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
- static NonnullRefPtr<Action> create(String text, const Shortcut& shortcut, Function<void(Action&)> callback, Core::Object* parent = nullptr);
- static NonnullRefPtr<Action> create(String text, const Shortcut& shortcut, const Shortcut& alternate_shortcut, Function<void(Action&)> callback, Core::Object* parent = nullptr);
- static NonnullRefPtr<Action> create(String text, const Shortcut& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
- static NonnullRefPtr<Action> create(String text, const Shortcut& shortcut, const Shortcut& alternate_shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
+ static NonnullRefPtr<Action> create(String text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent = nullptr);
+ static NonnullRefPtr<Action> create(String text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, Function<void(Action&)> callback, Core::Object* parent = nullptr);
+ static NonnullRefPtr<Action> create(String text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
+ static NonnullRefPtr<Action> create(String text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
static NonnullRefPtr<Action> create_checkable(String text, Function<void(Action&)> callback, Core::Object* parent = nullptr);
static NonnullRefPtr<Action> create_checkable(String text, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
- static NonnullRefPtr<Action> create_checkable(String text, const Shortcut& shortcut, Function<void(Action&)> callback, Core::Object* parent = nullptr);
- static NonnullRefPtr<Action> create_checkable(String text, const Shortcut& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
+ static NonnullRefPtr<Action> create_checkable(String text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent = nullptr);
+ static NonnullRefPtr<Action> create_checkable(String text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
virtual ~Action() override;
@@ -84,10 +84,10 @@ public:
Shortcut const& shortcut() const { return m_shortcut; }
Shortcut const& alternate_shortcut() const { return m_alternate_shortcut; }
- const Gfx::Bitmap* icon() const { return m_icon.ptr(); }
- void set_icon(const Gfx::Bitmap*);
+ Gfx::Bitmap const* icon() const { return m_icon.ptr(); }
+ void set_icon(Gfx::Bitmap const*);
- const Core::Object* activator() const { return m_activator.ptr(); }
+ Core::Object const* activator() const { return m_activator.ptr(); }
Core::Object* activator() { return m_activator.ptr(); }
Function<void(Action&)> on_activation;
@@ -116,16 +116,16 @@ public:
void register_menu_item(Badge<MenuItem>, MenuItem&);
void unregister_menu_item(Badge<MenuItem>, MenuItem&);
- const ActionGroup* group() const { return m_action_group.ptr(); }
+ ActionGroup const* group() const { return m_action_group.ptr(); }
void set_group(Badge<ActionGroup>, ActionGroup*);
HashTable<MenuItem*> menu_items() const { return m_menu_items; }
private:
Action(String, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
- Action(String, const Shortcut&, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
- Action(String, const Shortcut&, const Shortcut&, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
- Action(String, const Shortcut&, const Shortcut&, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
+ Action(String, Shortcut const&, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
+ Action(String, Shortcut const&, Shortcut const&, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
+ Action(String, Shortcut const&, Shortcut const&, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
Action(String, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
template<typename Callback>
diff --git a/Userland/Libraries/LibGUI/Application.cpp b/Userland/Libraries/LibGUI/Application.cpp
index 1ab1ad8bec..96427ecc0b 100644
--- a/Userland/Libraries/LibGUI/Application.cpp
+++ b/Userland/Libraries/LibGUI/Application.cpp
@@ -24,7 +24,7 @@ class Application::TooltipWindow final : public Window {
C_OBJECT(TooltipWindow);
public:
- void set_tooltip(const String& tooltip)
+ void set_tooltip(String const& tooltip)
{
m_label->set_text(Gfx::parse_ampersand_string(tooltip));
int tooltip_width = m_label->min_width() + 10;
@@ -136,7 +136,7 @@ void Application::unregister_global_shortcut_action(Badge<Action>, Action& actio
m_global_shortcut_actions.remove(action.alternate_shortcut());
}
-Action* Application::action_for_key_event(const KeyEvent& event)
+Action* Application::action_for_key_event(KeyEvent const& event)
{
auto it = m_global_shortcut_actions.find(Shortcut(event.modifiers(), (KeyCode)event.key()));
if (it == m_global_shortcut_actions.end())
@@ -144,7 +144,7 @@ Action* Application::action_for_key_event(const KeyEvent& event)
return (*it).value;
}
-void Application::show_tooltip(String tooltip, const Widget* tooltip_source_widget)
+void Application::show_tooltip(String tooltip, Widget const* tooltip_source_widget)
{
m_tooltip_source_widget = tooltip_source_widget;
if (!m_tooltip_window) {
@@ -163,7 +163,7 @@ void Application::show_tooltip(String tooltip, const Widget* tooltip_source_widg
}
}
-void Application::show_tooltip_immediately(String tooltip, const Widget* tooltip_source_widget)
+void Application::show_tooltip_immediately(String tooltip, Widget const* tooltip_source_widget)
{
m_tooltip_source_widget = tooltip_source_widget;
if (!m_tooltip_window) {
@@ -206,7 +206,7 @@ void Application::set_system_palette(Core::AnonymousBuffer& buffer)
m_palette = m_system_palette;
}
-void Application::set_palette(const Palette& palette)
+void Application::set_palette(Palette const& palette)
{
m_palette = palette.impl();
}
@@ -221,7 +221,7 @@ void Application::request_tooltip_show()
VERIFY(m_tooltip_window);
Gfx::IntRect desktop_rect = Desktop::the().rect();
- const int margin = 30;
+ int const margin = 30;
Gfx::IntPoint adjusted_pos = ConnectionToWindowServer::the().get_global_cursor_position();
adjusted_pos.translate_by(0, 18);
@@ -271,7 +271,7 @@ void Application::set_pending_drop_widget(Widget* widget)
m_pending_drop_widget->update();
}
-void Application::set_drag_hovered_widget_impl(Widget* widget, const Gfx::IntPoint& position, Vector<String> mime_types)
+void Application::set_drag_hovered_widget_impl(Widget* widget, Gfx::IntPoint const& position, Vector<String> mime_types)
{
if (widget == m_drag_hovered_widget)
return;
diff --git a/Userland/Libraries/LibGUI/Application.h b/Userland/Libraries/LibGUI/Application.h
index f4f594d6fd..68466bb39a 100644
--- a/Userland/Libraries/LibGUI/Application.h
+++ b/Userland/Libraries/LibGUI/Application.h
@@ -33,13 +33,13 @@ public:
int exec();
void quit(int = 0);
- Action* action_for_key_event(const KeyEvent&);
+ Action* action_for_key_event(KeyEvent const&);
void register_global_shortcut_action(Badge<Action>, Action&);
void unregister_global_shortcut_action(Badge<Action>, Action&);
- void show_tooltip(String, const Widget* tooltip_source_widget);
- void show_tooltip_immediately(String, const Widget* tooltip_source_widget);
+ void show_tooltip(String, Widget const* tooltip_source_widget);
+ void show_tooltip_immediately(String, Widget const* tooltip_source_widget);
void hide_tooltip();
Widget* tooltip_source_widget() { return m_tooltip_source_widget; };
@@ -49,11 +49,11 @@ public:
void did_create_window(Badge<Window>);
void did_delete_last_window(Badge<Window>);
- const String& invoked_as() const { return m_invoked_as; }
- const Vector<String>& args() const { return m_args; }
+ String const& invoked_as() const { return m_invoked_as; }
+ Vector<String> const& args() const { return m_args; }
Gfx::Palette palette() const;
- void set_palette(const Gfx::Palette&);
+ void set_palette(Gfx::Palette const&);
void set_system_palette(Core::AnonymousBuffer&);
@@ -64,18 +64,18 @@ public:
Core::EventLoop& event_loop() { return *m_event_loop; }
Window* active_window() { return m_active_window; }
- const Window* active_window() const { return m_active_window; }
+ Window const* active_window() const { return m_active_window; }
void window_did_become_active(Badge<Window>, Window&);
void window_did_become_inactive(Badge<Window>, Window&);
Widget* drag_hovered_widget() { return m_drag_hovered_widget.ptr(); }
- const Widget* drag_hovered_widget() const { return m_drag_hovered_widget.ptr(); }
+ Widget const* drag_hovered_widget() const { return m_drag_hovered_widget.ptr(); }
Widget* pending_drop_widget() { return m_pending_drop_widget.ptr(); }
- const Widget* pending_drop_widget() const { return m_pending_drop_widget.ptr(); }
+ Widget const* pending_drop_widget() const { return m_pending_drop_widget.ptr(); }
- void set_drag_hovered_widget(Badge<Window>, Widget* widget, const Gfx::IntPoint& position = {}, Vector<String> mime_types = {})
+ void set_drag_hovered_widget(Badge<Window>, Widget* widget, Gfx::IntPoint const& position = {}, Vector<String> mime_types = {})
{
set_drag_hovered_widget_impl(widget, position, move(mime_types));
}
@@ -98,7 +98,7 @@ private:
void request_tooltip_show();
void tooltip_hide_timer_did_fire();
- void set_drag_hovered_widget_impl(Widget*, const Gfx::IntPoint& = {}, Vector<String> = {});
+ void set_drag_hovered_widget_impl(Widget*, Gfx::IntPoint const& = {}, Vector<String> = {});
void set_pending_drop_widget(Widget*);
OwnPtr<Core::EventLoop> m_event_loop;
diff --git a/Userland/Libraries/LibGUI/AutocompleteProvider.cpp b/Userland/Libraries/LibGUI/AutocompleteProvider.cpp
index 82a46800f2..400aff8471 100644
--- a/Userland/Libraries/LibGUI/AutocompleteProvider.cpp
+++ b/Userland/Libraries/LibGUI/AutocompleteProvider.cpp
@@ -219,12 +219,12 @@ AutocompleteProvider::Entry::HideAutocompleteAfterApplying AutocompleteBox::appl
return hide_when_done;
}
-bool AutocompleteProvider::Declaration::operator==(const AutocompleteProvider::Declaration& other) const
+bool AutocompleteProvider::Declaration::operator==(AutocompleteProvider::Declaration const& other) const
{
return name == other.name && position == other.position && type == other.type && scope == other.scope;
}
-bool AutocompleteProvider::ProjectLocation::operator==(const ProjectLocation& other) const
+bool AutocompleteProvider::ProjectLocation::operator==(ProjectLocation const& other) const
{
return file == other.file && line == other.line && column == other.column;
}
diff --git a/Userland/Libraries/LibGUI/AutocompleteProvider.h b/Userland/Libraries/LibGUI/AutocompleteProvider.h
index a6acd00ccd..0475436046 100644
--- a/Userland/Libraries/LibGUI/AutocompleteProvider.h
+++ b/Userland/Libraries/LibGUI/AutocompleteProvider.h
@@ -45,7 +45,7 @@ public:
size_t line { 0 };
size_t column { 0 };
- bool operator==(const ProjectLocation&) const;
+ bool operator==(ProjectLocation const&) const;
};
enum class DeclarationType {
@@ -64,7 +64,7 @@ public:
DeclarationType type;
String scope;
- bool operator==(const Declaration&) const;
+ bool operator==(Declaration const&) const;
};
virtual void provide_completions(Function<void(Vector<Entry>)>) = 0;
@@ -102,7 +102,7 @@ public:
size_t end_line { 0 };
size_t end_column { 0 };
- static constexpr const char* type_to_string(SemanticType t)
+ static constexpr char const* type_to_string(SemanticType t)
{
switch (t) {
#define __SEMANTIC(x) \
diff --git a/Userland/Libraries/LibGUI/Breadcrumbbar.cpp b/Userland/Libraries/LibGUI/Breadcrumbbar.cpp
index 3cf593c470..c274935c32 100644
--- a/Userland/Libraries/LibGUI/Breadcrumbbar.cpp
+++ b/Userland/Libraries/LibGUI/Breadcrumbbar.cpp
@@ -101,7 +101,7 @@ void Breadcrumbbar::append_segment(String text, Gfx::Bitmap const* icon, String
auto icon_width = icon ? icon->width() : 0;
auto icon_padding = icon ? 4 : 0;
- const int max_button_width = 100;
+ int const max_button_width = 100;
auto button_width = min(button_text_width + icon_width + icon_padding + 16, max_button_width);
auto shrunken_width = icon_width + icon_padding + (icon ? 4 : 16);
diff --git a/Userland/Libraries/LibGUI/Button.h b/Userland/Libraries/LibGUI/Button.h
index 73c4102a81..5e1cb76a84 100644
--- a/Userland/Libraries/LibGUI/Button.h
+++ b/Userland/Libraries/LibGUI/Button.h
@@ -23,7 +23,7 @@ public:
void set_icon(RefPtr<Gfx::Bitmap>);
void set_icon_from_path(String const&);
- const Gfx::Bitmap* icon() const { return m_icon.ptr(); }
+ Gfx::Bitmap const* icon() const { return m_icon.ptr(); }
Gfx::Bitmap* icon() { return m_icon.ptr(); }
void set_text_alignment(Gfx::TextAlignment text_alignment) { m_text_alignment = text_alignment; }
diff --git a/Userland/Libraries/LibGUI/Calendar.cpp b/Userland/Libraries/LibGUI/Calendar.cpp
index cd3cbbca3b..922e030255 100644
--- a/Userland/Libraries/LibGUI/Calendar.cpp
+++ b/Userland/Libraries/LibGUI/Calendar.cpp
@@ -17,10 +17,10 @@ REGISTER_WIDGET(GUI, Calendar);
namespace GUI {
-static const auto extra_large_font = Gfx::BitmapFont::load_from_file("/res/fonts/MarietaRegular36.font");
-static const auto large_font = Gfx::BitmapFont::load_from_file("/res/fonts/MarietaRegular24.font");
-static const auto medium_font = Gfx::BitmapFont::load_from_file("/res/fonts/PebbletonRegular14.font");
-static const auto small_font = Gfx::BitmapFont::load_from_file("/res/fonts/KaticaRegular10.font");
+static auto const extra_large_font = Gfx::BitmapFont::load_from_file("/res/fonts/MarietaRegular36.font");
+static auto const large_font = Gfx::BitmapFont::load_from_file("/res/fonts/MarietaRegular24.font");
+static auto const medium_font = Gfx::BitmapFont::load_from_file("/res/fonts/PebbletonRegular14.font");
+static auto const small_font = Gfx::BitmapFont::load_from_file("/res/fonts/KaticaRegular10.font");
Calendar::Calendar(Core::DateTime date_time, Mode mode)
: m_selected_date(date_time)
@@ -75,7 +75,7 @@ void Calendar::resize_event(GUI::ResizeEvent& event)
set_show_year(false);
- const int GRID_LINES = 6;
+ int const GRID_LINES = 6;
int tile_width = (m_event_size.width() - GRID_LINES) / 7;
int width_remainder = (m_event_size.width() - GRID_LINES) % 7;
int y_offset = is_showing_days_of_the_week() ? 16 : 0;
@@ -124,10 +124,10 @@ void Calendar::resize_event(GUI::ResizeEvent& event)
set_show_month_and_year(false);
- const int VERT_GRID_LINES = 27;
- const int HORI_GRID_LINES = 15;
- const int THREADING = 3;
- const int MONTH_TITLE = 19;
+ int const VERT_GRID_LINES = 27;
+ int const HORI_GRID_LINES = 15;
+ int const THREADING = 3;
+ int const MONTH_TITLE = 19;
int tile_width = (m_event_size.width() - VERT_GRID_LINES) / 28;
int width_remainder = (m_event_size.width() - VERT_GRID_LINES) % 28;
int y_offset = is_showing_year() ? 22 : 0;
diff --git a/Userland/Libraries/LibGUI/ColumnsView.cpp b/Userland/Libraries/LibGUI/ColumnsView.cpp
index 67ba0bce1b..ce1cbef995 100644
--- a/Userland/Libraries/LibGUI/ColumnsView.cpp
+++ b/Userland/Libraries/LibGUI/ColumnsView.cpp
@@ -156,7 +156,7 @@ void ColumnsView::paint_event(PaintEvent& event)
}
}
-void ColumnsView::push_column(const ModelIndex& parent_index)
+void ColumnsView::push_column(ModelIndex const& parent_index)
{
VERIFY(model());
@@ -206,7 +206,7 @@ void ColumnsView::update_column_sizes()
set_content_size({ total_width, total_height });
}
-ModelIndex ColumnsView::index_at_event_position(const Gfx::IntPoint& a_position) const
+ModelIndex ColumnsView::index_at_event_position(Gfx::IntPoint const& a_position) const
{
if (!model())
return {};
@@ -306,7 +306,7 @@ void ColumnsView::move_cursor(CursorMovement movement, SelectionUpdate selection
set_cursor(new_index, selection_update);
}
-Gfx::IntRect ColumnsView::content_rect(const ModelIndex& index) const
+Gfx::IntRect ColumnsView::content_rect(ModelIndex const& index) const
{
if (!index.is_valid())
return {};
diff --git a/Userland/Libraries/LibGUI/ColumnsView.h b/Userland/Libraries/LibGUI/ColumnsView.h
index 3f37463106..f0d1ffea14 100644
--- a/Userland/Libraries/LibGUI/ColumnsView.h
+++ b/Userland/Libraries/LibGUI/ColumnsView.h
@@ -18,14 +18,14 @@ public:
int model_column() const { return m_model_column; }
void set_model_column(int column) { m_model_column = column; }
- virtual ModelIndex index_at_event_position(const Gfx::IntPoint&) const override;
- virtual Gfx::IntRect content_rect(const ModelIndex&) const override;
+ virtual ModelIndex index_at_event_position(Gfx::IntPoint const&) const override;
+ virtual Gfx::IntRect content_rect(ModelIndex const&) const override;
virtual Gfx::IntRect paint_invalidation_rect(ModelIndex const&) const override;
private:
ColumnsView();
virtual ~ColumnsView() override = default;
- void push_column(const ModelIndex& parent_index);
+ void push_column(ModelIndex const& parent_index);
void update_column_sizes();
int item_height() const { return 18; }
diff --git a/Userland/Libraries/LibGUI/ComboBox.cpp b/Userland/Libraries/LibGUI/ComboBox.cpp
index 294461fc45..4f82b9fea3 100644
--- a/Userland/Libraries/LibGUI/ComboBox.cpp
+++ b/Userland/Libraries/LibGUI/ComboBox.cpp
@@ -145,7 +145,7 @@ void ComboBox::set_editor_placeholder(StringView placeholder)
m_editor->set_placeholder(placeholder);
}
-const String& ComboBox::editor_placeholder() const
+String const& ComboBox::editor_placeholder() const
{
return m_editor->placeholder();
}
@@ -170,7 +170,7 @@ void ComboBox::navigate_relative(int delta)
on_change(m_editor->text(), current_selected);
}
-void ComboBox::selection_updated(const ModelIndex& index)
+void ComboBox::selection_updated(ModelIndex const& index)
{
if (index.is_valid())
m_selected_index = index;
@@ -274,7 +274,7 @@ String ComboBox::text() const
return m_editor->text();
}
-void ComboBox::set_text(const String& text)
+void ComboBox::set_text(String const& text)
{
m_editor->set_text(text);
}
@@ -292,7 +292,7 @@ Model* ComboBox::model()
return m_list_view->model();
}
-const Model* ComboBox::model() const
+Model const* ComboBox::model() const
{
return m_list_view->model();
}
diff --git a/Userland/Libraries/LibGUI/ComboBox.h b/Userland/Libraries/LibGUI/ComboBox.h
index 4db98b30e9..07955c3f7b 100644
--- a/Userland/Libraries/LibGUI/ComboBox.h
+++ b/Userland/Libraries/LibGUI/ComboBox.h
@@ -21,14 +21,14 @@ public:
virtual ~ComboBox() override;
String text() const;
- void set_text(const String&);
+ void set_text(String const&);
void open();
void close();
void select_all();
Model* model();
- const Model* model() const;
+ Model const* model() const;
void set_model(NonnullRefPtr<Model>);
size_t selected_index() const;
@@ -41,9 +41,9 @@ public:
void set_model_column(int);
void set_editor_placeholder(StringView placeholder);
- const String& editor_placeholder() const;
+ String const& editor_placeholder() const;
- Function<void(const String&, const ModelIndex&)> on_change;
+ Function<void(String const&, ModelIndex const&)> on_change;
Function<void()> on_return_pressed;
protected:
@@ -51,7 +51,7 @@ protected:
virtual void resize_event(ResizeEvent&) override;
private:
- void selection_updated(const ModelIndex&);
+ void selection_updated(ModelIndex const&);
void navigate(AbstractView::CursorMovement);
void navigate_relative(int);
diff --git a/Userland/Libraries/LibGUI/CommonActions.cpp b/Userland/Libraries/LibGUI/CommonActions.cpp
index 27c3e8cfb8..4255ca6ad8 100644
--- a/Userland/Libraries/LibGUI/CommonActions.cpp
+++ b/Userland/Libraries/LibGUI/CommonActions.cpp
@@ -15,7 +15,7 @@ namespace GUI {
namespace CommonActions {
-NonnullRefPtr<Action> make_about_action(const String& app_name, const Icon& app_icon, Window* parent)
+NonnullRefPtr<Action> make_about_action(String const& app_name, Icon const& app_icon, Window* parent)
{
auto weak_parent = AK::make_weak_ptr_if_nonnull<Window>(parent);
auto action = Action::create(String::formatted("&About {}", app_name), app_icon.bitmap_for_size(16), [=](auto&) {
diff --git a/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp b/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp
index 29d1f10b7f..a06a32f7b4 100644
--- a/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp
+++ b/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp
@@ -36,7 +36,7 @@ static void initialize_if_needed()
s_initialized = true;
}
-void CommonLocationsProvider::load_from_json(const String& json_path)
+void CommonLocationsProvider::load_from_json(String const& json_path)
{
auto file = Core::File::construct(json_path);
if (!file->open(Core::OpenMode::ReadOnly)) {
@@ -69,7 +69,7 @@ void CommonLocationsProvider::load_from_json(const String& json_path)
s_initialized = true;
}
-const Vector<CommonLocationsProvider::CommonLocation>& CommonLocationsProvider::common_locations()
+Vector<CommonLocationsProvider::CommonLocation> const& CommonLocationsProvider::common_locations()
{
initialize_if_needed();
return s_common_locations;
diff --git a/Userland/Libraries/LibGUI/CommonLocationsProvider.h b/Userland/Libraries/LibGUI/CommonLocationsProvider.h
index 813439195d..0de400a83e 100644
--- a/Userland/Libraries/LibGUI/CommonLocationsProvider.h
+++ b/Userland/Libraries/LibGUI/CommonLocationsProvider.h
@@ -20,8 +20,8 @@ public:
String path;
};
- static void load_from_json(const String& json_path);
- static const Vector<CommonLocation>& common_locations();
+ static void load_from_json(String const& json_path);
+ static Vector<CommonLocation> const& common_locations();
};
}
diff --git a/Userland/Libraries/LibGUI/ConnectionToWindowMangerServer.cpp b/Userland/Libraries/LibGUI/ConnectionToWindowMangerServer.cpp
index 006e41d02b..e5b8e482d9 100644
--- a/Userland/Libraries/LibGUI/ConnectionToWindowMangerServer.cpp
+++ b/Userland/Libraries/LibGUI/ConnectionToWindowMangerServer.cpp
@@ -27,7 +27,7 @@ void ConnectionToWindowMangerServer::window_state_changed(i32 wm_id, i32 client_
Core::EventLoop::current().post_event(*window, make<WMWindowStateChangedEvent>(client_id, window_id, parent_client_id, parent_window_id, title, rect, workspace_row, workspace_column, is_active, is_modal, static_cast<WindowType>(window_type), is_minimized, is_frameless, progress));
}
-void ConnectionToWindowMangerServer::applet_area_size_changed(i32 wm_id, const Gfx::IntSize& size)
+void ConnectionToWindowMangerServer::applet_area_size_changed(i32 wm_id, Gfx::IntSize const& size)
{
if (auto* window = Window::from_window_id(wm_id))
Core::EventLoop::current().post_event(*window, make<WMAppletAreaSizeChangedEvent>(size));
diff --git a/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp b/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp
index d7cb7517e9..93c49ae504 100644
--- a/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp
+++ b/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp
@@ -68,7 +68,7 @@ void ConnectionToWindowServer::update_system_theme(Core::AnonymousBuffer const&
});
}
-void ConnectionToWindowServer::update_system_fonts(const String& default_font_query, const String& fixed_width_font_query)
+void ConnectionToWindowServer::update_system_fonts(String const& default_font_query, String const& fixed_width_font_query)
{
Gfx::FontDatabase::set_default_font_query(default_font_query);
Gfx::FontDatabase::set_fixed_width_font_query(fixed_width_font_query);
diff --git a/Userland/Libraries/LibGUI/Desktop.cpp b/Userland/Libraries/LibGUI/Desktop.cpp
index f962a005c9..74e443557c 100644
--- a/Userland/Libraries/LibGUI/Desktop.cpp
+++ b/Userland/Libraries/LibGUI/Desktop.cpp
@@ -22,7 +22,7 @@ Desktop& Desktop::the()
return s_the;
}
-void Desktop::did_receive_screen_rects(Badge<ConnectionToWindowServer>, const Vector<Gfx::IntRect, 4>& rects, size_t main_screen_index, unsigned workspace_rows, unsigned workspace_columns)
+void Desktop::did_receive_screen_rects(Badge<ConnectionToWindowServer>, Vector<Gfx::IntRect, 4> const& rects, size_t main_screen_index, unsigned workspace_rows, unsigned workspace_columns)
{
m_main_screen_index = main_screen_index;
m_rects = rects;
diff --git a/Userland/Libraries/LibGUI/Desktop.h b/Userland/Libraries/LibGUI/Desktop.h
index 82f5143fb3..952977997f 100644
--- a/Userland/Libraries/LibGUI/Desktop.h
+++ b/Userland/Libraries/LibGUI/Desktop.h
@@ -35,7 +35,7 @@ public:
bool set_wallpaper(RefPtr<Gfx::Bitmap> wallpaper_bitmap, Optional<String> path);
Gfx::IntRect rect() const { return m_bounding_rect; }
- const Vector<Gfx::IntRect, 4>& rects() const { return m_rects; }
+ Vector<Gfx::IntRect, 4> const& rects() const { return m_rects; }
size_t main_screen_index() const { return m_main_screen_index; }
unsigned workspace_rows() const { return m_workspace_rows; }
@@ -43,7 +43,7 @@ public:
int taskbar_height() const { return TaskbarWindow::taskbar_height(); }
- void did_receive_screen_rects(Badge<ConnectionToWindowServer>, const Vector<Gfx::IntRect, 4>&, size_t, unsigned, unsigned);
+ void did_receive_screen_rects(Badge<ConnectionToWindowServer>, Vector<Gfx::IntRect, 4> const&, size_t, unsigned, unsigned);
template<typename F>
void on_receive_screen_rects(F&& callback)
diff --git a/Userland/Libraries/LibGUI/DragOperation.cpp b/Userland/Libraries/LibGUI/DragOperation.cpp
index 839b1f8aef..349c230246 100644
--- a/Userland/Libraries/LibGUI/DragOperation.cpp
+++ b/Userland/Libraries/LibGUI/DragOperation.cpp
@@ -73,20 +73,20 @@ void DragOperation::notify_cancelled(Badge<ConnectionToWindowServer>)
s_current_drag_operation->done(Outcome::Cancelled);
}
-void DragOperation::set_text(const String& text)
+void DragOperation::set_text(String const& text)
{
if (!m_mime_data)
m_mime_data = Core::MimeData::construct();
m_mime_data->set_text(text);
}
-void DragOperation::set_bitmap(const Gfx::Bitmap* bitmap)
+void DragOperation::set_bitmap(Gfx::Bitmap const* bitmap)
{
if (!m_mime_data)
m_mime_data = Core::MimeData::construct();
if (bitmap)
m_mime_data->set_data("image/x-raw-bitmap", bitmap->serialize_to_byte_buffer());
}
-void DragOperation::set_data(const String& data_type, const String& data)
+void DragOperation::set_data(String const& data_type, String const& data)
{
if (!m_mime_data)
m_mime_data = Core::MimeData::construct();
diff --git a/Userland/Libraries/LibGUI/DragOperation.h b/Userland/Libraries/LibGUI/DragOperation.h
index 647e728d7c..b9419af34e 100644
--- a/Userland/Libraries/LibGUI/DragOperation.h
+++ b/Userland/Libraries/LibGUI/DragOperation.h
@@ -27,9 +27,9 @@ public:
virtual ~DragOperation() override = default;
void set_mime_data(RefPtr<Core::MimeData> mime_data) { m_mime_data = move(mime_data); }
- void set_text(const String& text);
- void set_bitmap(const Gfx::Bitmap* bitmap);
- void set_data(const String& data_type, const String& data);
+ void set_text(String const& text);
+ void set_bitmap(Gfx::Bitmap const* bitmap);
+ void set_data(String const& data_type, String const& data);
Outcome exec();
Outcome outcome() const { return m_outcome; }
diff --git a/Userland/Libraries/LibGUI/EditingEngine.cpp b/Userland/Libraries/LibGUI/EditingEngine.cpp
index 0141ffee11..34f6f56e69 100644
--- a/Userland/Libraries/LibGUI/EditingEngine.cpp
+++ b/Userland/Libraries/LibGUI/EditingEngine.cpp
@@ -33,7 +33,7 @@ void EditingEngine::detach()
m_editor = nullptr;
}
-bool EditingEngine::on_key(const KeyEvent& event)
+bool EditingEngine::on_key(KeyEvent const& event)
{
if (event.key() == KeyCode::Key_Left) {
if (!event.shift() && m_editor->selection().is_valid()) {
@@ -268,7 +268,7 @@ void EditingEngine::move_to_logical_line_end()
m_editor->set_cursor({ m_editor->cursor().line(), m_editor->current_line().length() });
}
-void EditingEngine::move_one_up(const KeyEvent& event)
+void EditingEngine::move_one_up(KeyEvent const& event)
{
if (m_editor->cursor().line() > 0 || m_editor->is_wrapping_enabled()) {
if (event.ctrl() && event.shift()) {
@@ -288,7 +288,7 @@ void EditingEngine::move_one_up(const KeyEvent& event)
}
};
-void EditingEngine::move_one_down(const KeyEvent& event)
+void EditingEngine::move_one_down(KeyEvent const& event)
{
if (m_editor->cursor().line() < (m_editor->line_count() - 1) || m_editor->is_wrapping_enabled()) {
if (event.ctrl() && event.shift()) {
@@ -406,7 +406,7 @@ TextPosition EditingEngine::find_beginning_of_next_word()
for (size_t column_index = 0; column_index < lines.at(line_index).length(); column_index++) {
if (line_index == cursor.line() && column_index < cursor.column())
continue;
- const u32* line_chars = line.view().code_points();
+ u32 const* line_chars = line.view().code_points();
const u32 current_char = line_chars[column_index];
if (started_on_punct && is_vim_alphanumeric(current_char)) {
@@ -470,7 +470,7 @@ TextPosition EditingEngine::find_end_of_next_word()
if (line_index == cursor.line() && column_index < cursor.column())
continue;
- const u32* line_chars = line.view().code_points();
+ u32 const* line_chars = line.view().code_points();
const u32 current_char = line_chars[column_index];
if (column_index == lines.at(line_index).length() - 1 && !is_first_iteration && (is_vim_alphanumeric(current_char) || is_vim_punctuation(current_char)))
@@ -526,7 +526,7 @@ TextPosition EditingEngine::find_end_of_previous_word()
if (line_index == cursor.line() && column_index > cursor.column())
continue;
- const u32* line_chars = line.view().code_points();
+ u32 const* line_chars = line.view().code_points();
const u32 current_char = line_chars[column_index];
if (started_on_punct && is_vim_alphanumeric(current_char)) {
@@ -591,7 +591,7 @@ TextPosition EditingEngine::find_beginning_of_previous_word()
continue;
}
- const u32* line_chars = line.view().code_points();
+ u32 const* line_chars = line.view().code_points();
const u32 current_char = line_chars[column_index];
if (column_index == 0 && !is_first_iteration && (is_vim_alphanumeric(current_char) || is_vim_punctuation(current_char))) {
diff --git a/Userland/Libraries/LibGUI/EditingEngine.h b/Userland/Libraries/LibGUI/EditingEngine.h
index 3b0e617cc7..bef68b2200 100644
--- a/Userland/Libraries/LibGUI/EditingEngine.h
+++ b/Userland/Libraries/LibGUI/EditingEngine.h
@@ -40,7 +40,7 @@ public:
return *m_editor.unsafe_ptr();
}
- virtual bool on_key(const KeyEvent& event);
+ virtual bool on_key(KeyEvent const& event);
bool is_regular() const { return engine_type() == EngineType::Regular; }
bool is_vim() const { return engine_type() == EngineType::Vim; }
@@ -52,8 +52,8 @@ protected:
void move_one_left();
void move_one_right();
- void move_one_up(const KeyEvent& event);
- void move_one_down(const KeyEvent& event);
+ void move_one_up(KeyEvent const& event);
+ void move_one_down(KeyEvent const& event);
void move_to_previous_span();
void move_to_next_span();
void move_to_logical_line_beginning();
diff --git a/Userland/Libraries/LibGUI/EmojiInputDialog.h b/Userland/Libraries/LibGUI/EmojiInputDialog.h
index 739c09abb2..e291887ecd 100644
--- a/Userland/Libraries/LibGUI/EmojiInputDialog.h
+++ b/Userland/Libraries/LibGUI/EmojiInputDialog.h
@@ -14,7 +14,7 @@ class EmojiInputDialog final : public Dialog {
C_OBJECT(EmojiInputDialog);
public:
- const String& selected_emoji_text() const { return m_selected_emoji_text; }
+ String const& selected_emoji_text() const { return m_selected_emoji_text; }
private:
virtual void event(Core::Event&) override;
diff --git a/Userland/Libraries/LibGUI/Event.cpp b/Userland/Libraries/LibGUI/Event.cpp
index 414e21576d..88c8089702 100644
--- a/Userland/Libraries/LibGUI/Event.cpp
+++ b/Userland/Libraries/LibGUI/Event.cpp
@@ -12,7 +12,7 @@
namespace GUI {
-DropEvent::DropEvent(const Gfx::IntPoint& position, const String& text, NonnullRefPtr<Core::MimeData> mime_data)
+DropEvent::DropEvent(Gfx::IntPoint const& position, String const& text, NonnullRefPtr<Core::MimeData> mime_data)
: Event(Event::Drop)
, m_position(position)
, m_text(text)
diff --git a/Userland/Libraries/LibGUI/Event.h b/Userland/Libraries/LibGUI/Event.h
index 90cae6e922..a0b013b0c1 100644
--- a/Userland/Libraries/LibGUI/Event.h
+++ b/Userland/Libraries/LibGUI/Event.h
@@ -133,13 +133,13 @@ private:
class WMAppletAreaSizeChangedEvent : public WMEvent {
public:
- explicit WMAppletAreaSizeChangedEvent(const Gfx::IntSize& size)
+ explicit WMAppletAreaSizeChangedEvent(Gfx::IntSize const& size)
: WMEvent(Event::Type::WM_AppletAreaSizeChanged, 0, 0)
, m_size(size)
{
}
- const Gfx::IntSize& size() const { return m_size; }
+ Gfx::IntSize const& size() const { return m_size; }
private:
Gfx::IntSize m_size;
@@ -155,7 +155,7 @@ public:
class WMWindowStateChangedEvent : public WMEvent {
public:
- WMWindowStateChangedEvent(int client_id, int window_id, int parent_client_id, int parent_window_id, StringView title, const Gfx::IntRect& rect, unsigned workspace_row, unsigned workspace_column, bool is_active, bool is_modal, WindowType window_type, bool is_minimized, bool is_frameless, Optional<int> progress)
+ WMWindowStateChangedEvent(int client_id, int window_id, int parent_client_id, int parent_window_id, StringView title, Gfx::IntRect const& rect, unsigned workspace_row, unsigned workspace_column, bool is_active, bool is_modal, WindowType window_type, bool is_minimized, bool is_frameless, Optional<int> progress)
: WMEvent(Event::Type::WM_WindowStateChanged, client_id, window_id)
, m_parent_client_id(parent_client_id)
, m_parent_window_id(parent_window_id)
@@ -174,8 +174,8 @@ public:
int parent_client_id() const { return m_parent_client_id; }
int parent_window_id() const { return m_parent_window_id; }
- const String& title() const { return m_title; }
- const Gfx::IntRect& rect() const { return m_rect; }
+ String const& title() const { return m_title; }
+ Gfx::IntRect const& rect() const { return m_rect; }
bool is_active() const { return m_active; }
bool is_modal() const { return m_modal; }
WindowType window_type() const { return m_window_type; }
@@ -202,13 +202,13 @@ private:
class WMWindowRectChangedEvent : public WMEvent {
public:
- WMWindowRectChangedEvent(int client_id, int window_id, const Gfx::IntRect& rect)
+ WMWindowRectChangedEvent(int client_id, int window_id, Gfx::IntRect const& rect)
: WMEvent(Event::Type::WM_WindowRectChanged, client_id, window_id)
, m_rect(rect)
{
}
- const Gfx::IntRect& rect() const { return m_rect; }
+ Gfx::IntRect const& rect() const { return m_rect; }
private:
Gfx::IntRect m_rect;
@@ -216,13 +216,13 @@ private:
class WMWindowIconBitmapChangedEvent : public WMEvent {
public:
- WMWindowIconBitmapChangedEvent(int client_id, int window_id, const Gfx::Bitmap* bitmap)
+ WMWindowIconBitmapChangedEvent(int client_id, int window_id, Gfx::Bitmap const* bitmap)
: WMEvent(Event::Type::WM_WindowIconBitmapChanged, client_id, window_id)
, m_bitmap(move(bitmap))
{
}
- const Gfx::Bitmap* bitmap() const { return m_bitmap; }
+ Gfx::Bitmap const* bitmap() const { return m_bitmap; }
private:
RefPtr<Gfx::Bitmap> m_bitmap;
@@ -241,8 +241,8 @@ public:
unsigned current_column() const { return m_current_column; }
private:
- const unsigned m_current_row;
- const unsigned m_current_column;
+ unsigned const m_current_row;
+ unsigned const m_current_column;
};
class WMKeymapChangedEvent : public WMEvent {
@@ -268,8 +268,8 @@ public:
{
}
- const Vector<Gfx::IntRect, 32>& rects() const { return m_rects; }
- const Gfx::IntSize& window_size() const { return m_window_size; }
+ Vector<Gfx::IntRect, 32> const& rects() const { return m_rects; }
+ Gfx::IntSize const& window_size() const { return m_window_size; }
private:
Vector<Gfx::IntRect, 32> m_rects;
@@ -278,15 +278,15 @@ private:
class PaintEvent final : public Event {
public:
- explicit PaintEvent(const Gfx::IntRect& rect, const Gfx::IntSize& window_size = {})
+ explicit PaintEvent(Gfx::IntRect const& rect, Gfx::IntSize const& window_size = {})
: Event(Event::Paint)
, m_rect(rect)
, m_window_size(window_size)
{
}
- const Gfx::IntRect& rect() const { return m_rect; }
- const Gfx::IntSize& window_size() const { return m_window_size; }
+ Gfx::IntRect const& rect() const { return m_rect; }
+ Gfx::IntSize const& window_size() const { return m_window_size; }
private:
Gfx::IntRect m_rect;
@@ -295,13 +295,13 @@ private:
class ResizeEvent final : public Event {
public:
- explicit ResizeEvent(const Gfx::IntSize& size)
+ explicit ResizeEvent(Gfx::IntSize const& size)
: Event(Event::Resize)
, m_size(size)
{
}
- const Gfx::IntSize& size() const { return m_size; }
+ Gfx::IntSize const& size() const { return m_size; }
private:
Gfx::IntSize m_size;
@@ -309,15 +309,15 @@ private:
class ContextMenuEvent final : public Event {
public:
- explicit ContextMenuEvent(const Gfx::IntPoint& position, const Gfx::IntPoint& screen_position)
+ explicit ContextMenuEvent(Gfx::IntPoint const& position, Gfx::IntPoint const& screen_position)
: Event(Event::ContextMenu)
, m_position(position)
, m_screen_position(screen_position)
{
}
- const Gfx::IntPoint& position() const { return m_position; }
- const Gfx::IntPoint& screen_position() const { return m_screen_position; }
+ Gfx::IntPoint const& position() const { return m_position; }
+ Gfx::IntPoint const& screen_position() const { return m_screen_position; }
private:
Gfx::IntPoint m_position;
@@ -401,7 +401,7 @@ private:
class MouseEvent final : public Event {
public:
- MouseEvent(Type type, const Gfx::IntPoint& position, unsigned buttons, MouseButton button, unsigned modifiers, int wheel_delta_x, int wheel_delta_y, int wheel_raw_delta_x, int wheel_raw_delta_y)
+ MouseEvent(Type type, Gfx::IntPoint const& position, unsigned buttons, MouseButton button, unsigned modifiers, int wheel_delta_x, int wheel_delta_y, int wheel_raw_delta_x, int wheel_raw_delta_y)
: Event(type)
, m_position(position)
, m_buttons(buttons)
@@ -414,7 +414,7 @@ public:
{
}
- const Gfx::IntPoint& position() const { return m_position; }
+ Gfx::IntPoint const& position() const { return m_position; }
int x() const { return m_position.x(); }
int y() const { return m_position.y(); }
MouseButton button() const { return m_button; }
@@ -442,15 +442,15 @@ private:
class DragEvent final : public Event {
public:
- DragEvent(Type type, const Gfx::IntPoint& position, Vector<String> mime_types)
+ DragEvent(Type type, Gfx::IntPoint const& position, Vector<String> mime_types)
: Event(type)
, m_position(position)
, m_mime_types(move(mime_types))
{
}
- const Gfx::IntPoint& position() const { return m_position; }
- const Vector<String>& mime_types() const { return m_mime_types; }
+ Gfx::IntPoint const& position() const { return m_position; }
+ Vector<String> const& mime_types() const { return m_mime_types; }
private:
Gfx::IntPoint m_position;
@@ -459,13 +459,13 @@ private:
class DropEvent final : public Event {
public:
- DropEvent(const Gfx::IntPoint&, const String& text, NonnullRefPtr<Core::MimeData> mime_data);
+ DropEvent(Gfx::IntPoint const&, String const& text, NonnullRefPtr<Core::MimeData> mime_data);
~DropEvent() = default;
- const Gfx::IntPoint& position() const { return m_position; }
- const String& text() const { return m_text; }
- const Core::MimeData& mime_data() const { return m_mime_data; }
+ Gfx::IntPoint const& position() const { return m_position; }
+ String const& text() const { return m_text; }
+ Core::MimeData const& mime_data() const { return m_mime_data; }
private:
Gfx::IntPoint m_position;
@@ -491,14 +491,14 @@ public:
class ScreenRectsChangeEvent final : public Event {
public:
- explicit ScreenRectsChangeEvent(const Vector<Gfx::IntRect, 4>& rects, size_t main_screen_index)
+ explicit ScreenRectsChangeEvent(Vector<Gfx::IntRect, 4> const& rects, size_t main_screen_index)
: Event(Type::ScreenRectsChange)
, m_rects(rects)
, m_main_screen_index(main_screen_index)
{
}
- const Vector<Gfx::IntRect, 4>& rects() const { return m_rects; }
+ Vector<Gfx::IntRect, 4> const& rects() const { return m_rects; }
size_t main_screen_index() const { return m_main_screen_index; }
private:
diff --git a/Userland/Libraries/LibGUI/FileIconProvider.cpp b/Userland/Libraries/LibGUI/FileIconProvider.cpp
index 821af95491..495cae5b3f 100644
--- a/Userland/Libraries/LibGUI/FileIconProvider.cpp
+++ b/Userland/Libraries/LibGUI/FileIconProvider.cpp
@@ -129,7 +129,7 @@ Icon FileIconProvider::filetype_image_icon()
return s_filetype_image_icon;
}
-Icon FileIconProvider::icon_for_path(const String& path)
+Icon FileIconProvider::icon_for_path(String const& path)
{
struct stat stat;
if (::stat(path.characters(), &stat) < 0)
@@ -137,7 +137,7 @@ Icon FileIconProvider::icon_for_path(const String& path)
return icon_for_path(path, stat.st_mode);
}
-Icon FileIconProvider::icon_for_executable(const String& path)
+Icon FileIconProvider::icon_for_executable(String const& path)
{
static HashMap<String, Icon> app_icon_cache;
@@ -167,7 +167,7 @@ Icon FileIconProvider::icon_for_executable(const String& path)
return s_executable_icon;
}
- auto image = ELF::Image((const u8*)mapped_file->data(), mapped_file->size());
+ auto image = ELF::Image((u8 const*)mapped_file->data(), mapped_file->size());
if (!image.is_valid()) {
app_icon_cache.set(path, s_executable_icon);
return s_executable_icon;
@@ -176,7 +176,7 @@ Icon FileIconProvider::icon_for_executable(const String& path)
// If any of the required sections are missing then use the defaults
Icon icon;
struct IconSection {
- const char* section_name;
+ char const* section_name;
int image_size;
};
@@ -186,7 +186,7 @@ Icon FileIconProvider::icon_for_executable(const String& path)
};
bool had_error = false;
- for (const auto& icon_section : icon_sections) {
+ for (auto const& icon_section : icon_sections) {
auto section = image.lookup_section(icon_section.section_name);
RefPtr<Gfx::Bitmap> bitmap;
@@ -217,7 +217,7 @@ Icon FileIconProvider::icon_for_executable(const String& path)
return icon;
}
-Icon FileIconProvider::icon_for_path(const String& path, mode_t mode)
+Icon FileIconProvider::icon_for_path(String const& path, mode_t mode)
{
initialize_if_needed();
if (path == "/")
diff --git a/Userland/Libraries/LibGUI/FileIconProvider.h b/Userland/Libraries/LibGUI/FileIconProvider.h
index afd3c44202..89aa8a3709 100644
--- a/Userland/Libraries/LibGUI/FileIconProvider.h
+++ b/Userland/Libraries/LibGUI/FileIconProvider.h
@@ -14,9 +14,9 @@ namespace GUI {
class FileIconProvider {
public:
- static Icon icon_for_path(const String&, mode_t);
- static Icon icon_for_path(const String&);
- static Icon icon_for_executable(const String&);
+ static Icon icon_for_path(String const&, mode_t);
+ static Icon icon_for_path(String const&);
+ static Icon icon_for_executable(String const&);
static Icon filetype_image_icon();
static Icon directory_icon();
diff --git a/Userland/Libraries/LibGUI/FilePicker.cpp b/Userland/Libraries/LibGUI/FilePicker.cpp
index 4d7001cab7..20333b91f0 100644
--- a/Userland/Libraries/LibGUI/FilePicker.cpp
+++ b/Userland/Libraries/LibGUI/FilePicker.cpp
@@ -32,7 +32,7 @@
namespace GUI {
-Optional<String> FilePicker::get_open_filepath(Window* parent_window, const String& window_title, StringView path, bool folder, ScreenPosition screen_position)
+Optional<String> FilePicker::get_open_filepath(Window* parent_window, String const& window_title, StringView path, bool folder, ScreenPosition screen_position)
{
auto picker = FilePicker::construct(parent_window, folder ? Mode::OpenFolder : Mode::Open, "", path, screen_position);
@@ -50,7 +50,7 @@ Optional<String> FilePicker::get_open_filepath(Window* parent_window, const Stri
return {};
}
-Optional<String> FilePicker::get_save_filepath(Window* parent_window, const String& title, const String& extension, StringView path, ScreenPosition screen_position)
+Optional<String> FilePicker::get_save_filepath(Window* parent_window, String const& title, String const& extension, StringView path, ScreenPosition screen_position)
{
auto picker = FilePicker::construct(parent_window, Mode::Save, String::formatted("{}.{}", title, extension), path, screen_position);
@@ -115,7 +115,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St
};
auto open_parent_directory_action = Action::create(
- "Open parent directory", { Mod_Alt, Key_Up }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open-parent-directory.png").release_value_but_fixme_should_propagate_errors(), [this](const Action&) {
+ "Open parent directory", { Mod_Alt, Key_Up }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open-parent-directory.png").release_value_but_fixme_should_propagate_errors(), [this](Action const&) {
set_path(String::formatted("{}/..", m_model->root_path()));
},
this);
@@ -129,7 +129,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St
toolbar.add_separator();
auto mkdir_action = Action::create(
- "New directory...", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/mkdir.png").release_value_but_fixme_should_propagate_errors(), [this](const Action&) {
+ "New directory...", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/mkdir.png").release_value_but_fixme_should_propagate_errors(), [this](Action const&) {
String value;
if (InputBox::show(this, value, "Enter name:", "New directory") == InputBox::ExecOK && !value.is_empty()) {
auto new_dir_path = LexicalPath::canonicalized_path(String::formatted("{}/{}", m_model->root_path(), value));
@@ -286,7 +286,7 @@ void FilePicker::on_file_return()
done(ExecOK);
}
-void FilePicker::set_path(const String& path)
+void FilePicker::set_path(String const& path)
{
if (access(path.characters(), R_OK | X_OK) == -1) {
GUI::MessageBox::show(this, String::formatted("Could not open '{}':\n{}", path, strerror(errno)), "Error", GUI::MessageBox::Type::Error);
diff --git a/Userland/Libraries/LibGUI/FilePicker.h b/Userland/Libraries/LibGUI/FilePicker.h
index 1152e95f4a..441cfeaefa 100644
--- a/Userland/Libraries/LibGUI/FilePicker.h
+++ b/Userland/Libraries/LibGUI/FilePicker.h
@@ -28,8 +28,8 @@ public:
Save
};
- static Optional<String> get_open_filepath(Window* parent_window, const String& window_title = {}, StringView path = Core::StandardPaths::home_directory(), bool folder = false, ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
- static Optional<String> get_save_filepath(Window* parent_window, const String& title, const String& extension, StringView path = Core::StandardPaths::home_directory(), ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
+ static Optional<String> get_open_filepath(Window* parent_window, String const& window_title = {}, StringView path = Core::StandardPaths::home_directory(), bool folder = false, ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
+ static Optional<String> get_save_filepath(Window* parent_window, String const& title, String const& extension, StringView path = Core::StandardPaths::home_directory(), ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
virtual ~FilePicker() override;
@@ -38,7 +38,7 @@ public:
private:
void on_file_return();
- void set_path(const String&);
+ void set_path(String const&);
// ^GUI::ModelClient
virtual void model_did_update(unsigned) override;
diff --git a/Userland/Libraries/LibGUI/FileSystemModel.h b/Userland/Libraries/LibGUI/FileSystemModel.h
index 6fd6c9baf4..a796c93a84 100644
--- a/Userland/Libraries/LibGUI/FileSystemModel.h
+++ b/Userland/Libraries/LibGUI/FileSystemModel.h
@@ -110,7 +110,7 @@ public:
String full_path(ModelIndex const&) const;
ModelIndex index(String path, int column) const;
- void update_node_on_selection(ModelIndex const&, const bool);
+ void update_node_on_selection(ModelIndex const&, bool const);
ModelIndex m_previously_selected_index {};
Node const& node(ModelIndex const& index) const;
diff --git a/Userland/Libraries/LibGUI/FontPicker.cpp b/Userland/Libraries/LibGUI/FontPicker.cpp
index 6def60e8f4..bba820f0c9 100644
--- a/Userland/Libraries/LibGUI/FontPicker.cpp
+++ b/Userland/Libraries/LibGUI/FontPicker.cpp
@@ -18,7 +18,7 @@
namespace GUI {
-FontPicker::FontPicker(Window* parent_window, const Gfx::Font* current_font, bool fixed_width_only)
+FontPicker::FontPicker(Window* parent_window, Gfx::Font const* current_font, bool fixed_width_only)
: Dialog(parent_window)
, m_fixed_width_only(fixed_width_only)
{
@@ -170,7 +170,7 @@ FontPicker::FontPicker(Window* parent_window, const Gfx::Font* current_font, boo
set_font(current_font);
}
-void FontPicker::set_font(const Gfx::Font* font)
+void FontPicker::set_font(Gfx::Font const* font)
{
if (m_font == font)
return;
diff --git a/Userland/Libraries/LibGUI/FontPicker.h b/Userland/Libraries/LibGUI/FontPicker.h
index a40a28f168..376bcfa881 100644
--- a/Userland/Libraries/LibGUI/FontPicker.h
+++ b/Userland/Libraries/LibGUI/FontPicker.h
@@ -20,14 +20,14 @@ public:
virtual ~FontPicker() override = default;
RefPtr<Gfx::Font> font() const { return m_font; }
- void set_font(const Gfx::Font*);
+ void set_font(Gfx::Font const*);
private:
- FontPicker(Window* parent_window = nullptr, const Gfx::Font* current_font = nullptr, bool fixed_width_only = false);
+ FontPicker(Window* parent_window = nullptr, Gfx::Font const* current_font = nullptr, bool fixed_width_only = false);
void update_font();
- const bool m_fixed_width_only;
+ bool const m_fixed_width_only;
RefPtr<Gfx::Font> m_font;
diff --git a/Userland/Libraries/LibGUI/Frame.h b/Userland/Libraries/LibGUI/Frame.h
index 5bd7ead299..91c1f42241 100644
--- a/Userland/Libraries/LibGUI/Frame.h
+++ b/Userland/Libraries/LibGUI/Frame.h
@@ -28,7 +28,7 @@ public:
Gfx::FrameShape frame_shape() const { return m_shape; }
void set_frame_shape(Gfx::FrameShape shape) { m_shape = shape; }
- Gfx::IntRect frame_inner_rect_for_size(const Gfx::IntSize& size) const { return { m_thickness, m_thickness, size.width() - m_thickness * 2, size.height() - m_thickness * 2 }; }
+ Gfx::IntRect frame_inner_rect_for_size(Gfx::IntSize const& size) const { return { m_thickness, m_thickness, size.width() - m_thickness * 2, size.height() - m_thickness * 2 }; }
Gfx::IntRect frame_inner_rect() const { return frame_inner_rect_for_size(size()); }
virtual Gfx::IntRect children_clip_rect() const override;
diff --git a/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.cpp b/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.cpp
index 41c9de0446..b6a262f8e5 100644
--- a/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.cpp
+++ b/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.cpp
@@ -11,7 +11,7 @@
namespace GUI::GML {
-static Syntax::TextStyle style_for_token_type(const Gfx::Palette& palette, Token::Type type)
+static Syntax::TextStyle style_for_token_type(Gfx::Palette const& palette, Token::Type type)
{
switch (type) {
case Token::Type::LeftCurly:
@@ -38,7 +38,7 @@ bool SyntaxHighlighter::is_identifier(u64 token) const
return ini_token == Token::Type::Identifier;
}
-void SyntaxHighlighter::rehighlight(const Palette& palette)
+void SyntaxHighlighter::rehighlight(Palette const& palette)
{
auto text = m_client->get_text();
Lexer lexer(text);
diff --git a/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.h b/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.h
index 0c2961e90a..7a660a73c4 100644
--- a/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.h
+++ b/Userland/Libraries/LibGUI/GML/SyntaxHighlighter.h
@@ -19,7 +19,7 @@ public:
virtual bool is_identifier(u64) const override;
virtual Syntax::Language language() const override { return Syntax::Language::GML; }
- virtual void rehighlight(const Palette&) override;
+ virtual void rehighlight(Palette const&) override;
protected:
virtual Vector<MatchingTokenPair> matching_token_pairs_impl() const override;
diff --git a/Userland/Libraries/LibGUI/GitCommitSyntaxHighlighter.cpp b/Userland/Libraries/LibGUI/GitCommitSyntaxHighlighter.cpp
index abc597861c..e531479730 100644
--- a/Userland/Libraries/LibGUI/GitCommitSyntaxHighlighter.cpp
+++ b/Userland/Libraries/LibGUI/GitCommitSyntaxHighlighter.cpp
@@ -10,7 +10,7 @@
#include <LibGfx/Palette.h>
namespace GUI {
-static Syntax::TextStyle style_for_token_type(const Gfx::Palette& palette, GitCommitToken::Type type)
+static Syntax::TextStyle style_for_token_type(Gfx::Palette const& palette, GitCommitToken::Type type)
{
switch (type) {
case GitCommitToken::Type::Comment:
diff --git a/Userland/Libraries/LibGUI/HeaderView.cpp b/Userland/Libraries/LibGUI/HeaderView.cpp
index 0eacc7e284..590035b2f9 100644
--- a/Userland/Libraries/LibGUI/HeaderView.cpp
+++ b/Userland/Libraries/LibGUI/HeaderView.cpp
@@ -433,7 +433,7 @@ Model* HeaderView::model()
return m_table_view.model();
}
-const Model* HeaderView::model() const
+Model const* HeaderView::model() const
{
return m_table_view.model();
}
diff --git a/Userland/Libraries/LibGUI/HeaderView.h b/Userland/Libraries/LibGUI/HeaderView.h
index 89c98ede6d..333761b743 100644
--- a/Userland/Libraries/LibGUI/HeaderView.h
+++ b/Userland/Libraries/LibGUI/HeaderView.h
@@ -21,7 +21,7 @@ public:
Gfx::Orientation orientation() const { return m_orientation; }
Model* model();
- const Model* model() const;
+ Model const* model() const;
void set_section_size(int section, int size);
int section_size(int section) const;
diff --git a/Userland/Libraries/LibGUI/Icon.cpp b/Userland/Libraries/LibGUI/Icon.cpp
index aa592bc624..1a3af61faf 100644
--- a/Userland/Libraries/LibGUI/Icon.cpp
+++ b/Userland/Libraries/LibGUI/Icon.cpp
@@ -16,12 +16,12 @@ Icon::Icon()
{
}
-Icon::Icon(const IconImpl& impl)
+Icon::Icon(IconImpl const& impl)
: m_impl(const_cast<IconImpl&>(impl))
{
}
-Icon::Icon(const Icon& other)
+Icon::Icon(Icon const& other)
: m_impl(other.m_impl)
{
}
@@ -46,14 +46,14 @@ Icon::Icon(RefPtr<Gfx::Bitmap>&& bitmap1, RefPtr<Gfx::Bitmap>&& bitmap2)
}
}
-const Gfx::Bitmap* IconImpl::bitmap_for_size(int size) const
+Gfx::Bitmap const* IconImpl::bitmap_for_size(int size) const
{
auto it = m_bitmaps.find(size);
if (it != m_bitmaps.end())
return it->value.ptr();
int best_diff_so_far = INT32_MAX;
- const Gfx::Bitmap* best_fit = nullptr;
+ Gfx::Bitmap const* best_fit = nullptr;
for (auto& it : m_bitmaps) {
int abs_diff = abs(it.key - size);
if (abs_diff < best_diff_so_far) {
diff --git a/Userland/Libraries/LibGUI/Icon.h b/Userland/Libraries/LibGUI/Icon.h
index a8592082d5..b11cbcf42b 100644
--- a/Userland/Libraries/LibGUI/Icon.h
+++ b/Userland/Libraries/LibGUI/Icon.h
@@ -20,7 +20,7 @@ public:
static NonnullRefPtr<IconImpl> create() { return adopt_ref(*new IconImpl); }
~IconImpl() = default;
- const Gfx::Bitmap* bitmap_for_size(int) const;
+ Gfx::Bitmap const* bitmap_for_size(int) const;
void set_bitmap_for_size(int, RefPtr<Gfx::Bitmap>&&);
Vector<int> sizes() const
@@ -41,24 +41,24 @@ public:
Icon();
explicit Icon(RefPtr<Gfx::Bitmap>&&);
explicit Icon(RefPtr<Gfx::Bitmap>&&, RefPtr<Gfx::Bitmap>&&);
- explicit Icon(const IconImpl&);
- Icon(const Icon&);
+ explicit Icon(IconImpl const&);
+ Icon(Icon const&);
~Icon() = default;
static Icon default_icon(StringView);
static ErrorOr<Icon> try_create_default_icon(StringView);
- Icon& operator=(const Icon& other)
+ Icon& operator=(Icon const& other)
{
if (this != &other)
m_impl = other.m_impl;
return *this;
}
- const Gfx::Bitmap* bitmap_for_size(int size) const { return m_impl->bitmap_for_size(size); }
+ Gfx::Bitmap const* bitmap_for_size(int size) const { return m_impl->bitmap_for_size(size); }
void set_bitmap_for_size(int size, RefPtr<Gfx::Bitmap>&& bitmap) { m_impl->set_bitmap_for_size(size, move(bitmap)); }
- const IconImpl& impl() const { return *m_impl; }
+ IconImpl const& impl() const { return *m_impl; }
Vector<int> sizes() const { return m_impl->sizes(); }
diff --git a/Userland/Libraries/LibGUI/IconView.cpp b/Userland/Libraries/LibGUI/IconView.cpp
index 1d6717d210..991ef68017 100644
--- a/Userland/Libraries/LibGUI/IconView.cpp
+++ b/Userland/Libraries/LibGUI/IconView.cpp
@@ -40,7 +40,7 @@ void IconView::select_all()
}
}
-void IconView::scroll_into_view(const ModelIndex& index, bool scroll_horizontally, bool scroll_vertically)
+void IconView::scroll_into_view(ModelIndex const& index, bool scroll_horizontally, bool scroll_vertically)
{
if (!index.is_valid())
return;
@@ -106,7 +106,7 @@ auto IconView::get_item_data(int item_index) const -> ItemData&
return item_data;
}
-auto IconView::item_data_from_content_position(const Gfx::IntPoint& content_position) const -> ItemData*
+auto IconView::item_data_from_content_position(Gfx::IntPoint const& content_position) const -> ItemData*
{
if (!m_visual_row_count || !m_visual_column_count)
return nullptr;
@@ -195,7 +195,7 @@ Gfx::IntRect IconView::item_rect(int item_index) const
};
}
-ModelIndex IconView::index_at_event_position(const Gfx::IntPoint& position) const
+ModelIndex IconView::index_at_event_position(Gfx::IntPoint const& position) const
{
VERIFY(model());
auto adjusted_position = to_content_position(position);
@@ -244,7 +244,7 @@ void IconView::mouseup_event(MouseEvent& event)
AbstractView::mouseup_event(event);
}
-bool IconView::update_rubber_banding(const Gfx::IntPoint& input_position)
+bool IconView::update_rubber_banding(Gfx::IntPoint const& input_position)
{
auto adjusted_position = to_content_position(input_position.constrained(widget_inner_rect()));
if (m_rubber_band_current != adjusted_position) {
@@ -378,7 +378,7 @@ Gfx::IntRect IconView::editing_rect(ModelIndex const& index) const
return editing_rect;
}
-void IconView::editing_widget_did_change(const ModelIndex& index)
+void IconView::editing_widget_did_change(ModelIndex const& index)
{
if (m_editing_delegate->value().is_string()) {
auto text_width = font_for_index(index)->width(m_editing_delegate->value().as_string());
@@ -389,7 +389,7 @@ void IconView::editing_widget_did_change(const ModelIndex& index)
}
Gfx::IntRect
-IconView::paint_invalidation_rect(const ModelIndex& index) const
+IconView::paint_invalidation_rect(ModelIndex const& index) const
{
if (!index.is_valid())
return {};
@@ -397,7 +397,7 @@ IconView::paint_invalidation_rect(const ModelIndex& index) const
return item_data.rect(true);
}
-void IconView::did_change_hovered_index(const ModelIndex& old_index, const ModelIndex& new_index)
+void IconView::did_change_hovered_index(ModelIndex const& old_index, ModelIndex const& new_index)
{
AbstractView::did_change_hovered_index(old_index, new_index);
if (old_index.is_valid())
@@ -406,7 +406,7 @@ void IconView::did_change_hovered_index(const ModelIndex& old_index, const Model
get_item_rects(new_index.row(), get_item_data(new_index.row()), font_for_index(new_index));
}
-void IconView::did_change_cursor_index(const ModelIndex& old_index, const ModelIndex& new_index)
+void IconView::did_change_cursor_index(ModelIndex const& old_index, ModelIndex const& new_index)
{
AbstractView::did_change_cursor_index(old_index, new_index);
if (old_index.is_valid())
@@ -415,7 +415,7 @@ void IconView::did_change_cursor_index(const ModelIndex& old_index, const ModelI
get_item_rects(new_index.row(), get_item_data(new_index.row()), font_for_index(new_index));
}
-void IconView::get_item_rects(int item_index, ItemData& item_data, const Gfx::Font& font) const
+void IconView::get_item_rects(int item_index, ItemData& item_data, Gfx::Font const& font) const
{
auto item_rect = this->item_rect(item_index);
item_data.icon_rect = Gfx::IntRect(0, 0, 32, 32).centered_within(item_rect);
@@ -589,7 +589,7 @@ void IconView::did_update_selection()
// Selection was modified externally, we need to synchronize our cache
do_clear_selection();
- selection().for_each_index([&](const ModelIndex& index) {
+ selection().for_each_index([&](ModelIndex const& index) {
if (index.is_valid()) {
auto item_index = model_index_to_item_index(index);
if ((size_t)item_index < m_item_data_cache.size())
@@ -639,7 +639,7 @@ void IconView::add_selection(ItemData& item_data)
AbstractView::add_selection(item_data.index);
}
-void IconView::add_selection(const ModelIndex& new_index)
+void IconView::add_selection(ModelIndex const& new_index)
{
TemporaryChange change(m_changing_selection, true);
auto item_index = model_index_to_item_index(new_index);
@@ -654,7 +654,7 @@ void IconView::toggle_selection(ItemData& item_data)
remove_item_selection(item_data);
}
-void IconView::toggle_selection(const ModelIndex& new_index)
+void IconView::toggle_selection(ModelIndex const& new_index)
{
TemporaryChange change(m_changing_selection, true);
auto item_index = model_index_to_item_index(new_index);
@@ -684,7 +684,7 @@ void IconView::remove_item_selection(ItemData& item_data)
AbstractView::remove_selection(item_data.index);
}
-void IconView::set_selection(const ModelIndex& new_index)
+void IconView::set_selection(ModelIndex const& new_index)
{
TemporaryChange change(m_changing_selection, true);
do_clear_selection();
@@ -775,7 +775,7 @@ void IconView::set_flow_direction(FlowDirection flow_direction)
}
template<typename Function>
-inline IterationDecision IconView::for_each_item_intersecting_rect(const Gfx::IntRect& rect, Function f) const
+inline IterationDecision IconView::for_each_item_intersecting_rect(Gfx::IntRect const& rect, Function f) const
{
VERIFY(model());
if (rect.is_empty())
@@ -814,7 +814,7 @@ inline IterationDecision IconView::for_each_item_intersecting_rect(const Gfx::In
}
template<typename Function>
-inline IterationDecision IconView::for_each_item_intersecting_rects(const Vector<Gfx::IntRect>& rects, Function f) const
+inline IterationDecision IconView::for_each_item_intersecting_rects(Vector<Gfx::IntRect> const& rects, Function f) const
{
for (auto& rect : rects) {
auto decision = for_each_item_intersecting_rect(rect, f);
diff --git a/Userland/Libraries/LibGUI/IconView.h b/Userland/Libraries/LibGUI/IconView.h
index 787d21cb1a..e94a994f62 100644
--- a/Userland/Libraries/LibGUI/IconView.h
+++ b/Userland/Libraries/LibGUI/IconView.h
@@ -29,7 +29,7 @@ public:
int horizontal_padding() const { return m_horizontal_padding; }
- virtual void scroll_into_view(const ModelIndex&, bool scroll_horizontally = true, bool scroll_vertically = true) override;
+ virtual void scroll_into_view(ModelIndex const&, bool scroll_horizontally = true, bool scroll_vertically = true) override;
Gfx::IntSize effective_item_size() const { return m_effective_item_size; }
@@ -39,8 +39,8 @@ public:
int model_column() const { return m_model_column; }
void set_model_column(int column) { m_model_column = column; }
- virtual ModelIndex index_at_event_position(const Gfx::IntPoint&) const override;
- virtual Gfx::IntRect content_rect(const ModelIndex&) const override;
+ virtual ModelIndex index_at_event_position(Gfx::IntPoint const&) const override;
+ virtual Gfx::IntRect content_rect(ModelIndex const&) const override;
virtual Gfx::IntRect editing_rect(ModelIndex const&) const override;
virtual Gfx::IntRect paint_invalidation_rect(ModelIndex const&) const override;
@@ -56,9 +56,9 @@ private:
virtual void mousedown_event(MouseEvent&) override;
virtual void mousemove_event(MouseEvent&) override;
virtual void mouseup_event(MouseEvent&) override;
- virtual void did_change_hovered_index(const ModelIndex& old_index, const ModelIndex& new_index) override;
- virtual void did_change_cursor_index(const ModelIndex& old_index, const ModelIndex& new_index) override;
- virtual void editing_widget_did_change(const ModelIndex& index) override;
+ virtual void did_change_hovered_index(ModelIndex const& old_index, ModelIndex const& new_index) override;
+ virtual void did_change_cursor_index(ModelIndex const& old_index, ModelIndex const& new_index) override;
+ virtual void editing_widget_did_change(ModelIndex const& index) override;
virtual void move_cursor(CursorMovement, SelectionUpdate) override;
@@ -87,13 +87,13 @@ private:
Gfx::IntRect hot_icon_rect() const { return icon_rect.inflated(10, 10); }
Gfx::IntRect hot_text_rect() const { return text_rect.inflated(2, 2); }
- bool is_intersecting(const Gfx::IntRect& rect) const
+ bool is_intersecting(Gfx::IntRect const& rect) const
{
VERIFY(valid);
return hot_icon_rect().intersects(rect) || hot_text_rect().intersects(rect);
}
- bool is_containing(const Gfx::IntPoint& point) const
+ bool is_containing(Gfx::IntPoint const& point) const
{
VERIFY(valid);
return hot_icon_rect().contains(point) || hot_text_rect().contains(point);
@@ -108,12 +108,12 @@ private:
};
template<typename Function>
- IterationDecision for_each_item_intersecting_rect(const Gfx::IntRect&, Function) const;
+ IterationDecision for_each_item_intersecting_rect(Gfx::IntRect const&, Function) const;
template<typename Function>
- IterationDecision for_each_item_intersecting_rects(const Vector<Gfx::IntRect>&, Function) const;
+ IterationDecision for_each_item_intersecting_rects(Vector<Gfx::IntRect> const&, Function) const;
- void column_row_from_content_position(const Gfx::IntPoint& content_position, int& row, int& column) const
+ void column_row_from_content_position(Gfx::IntPoint const& content_position, int& row, int& column) const
{
row = max(0, min(m_visual_row_count - 1, content_position.y() / effective_item_size().height()));
column = max(0, min(m_visual_column_count - 1, content_position.x() / effective_item_size().width()));
@@ -123,12 +123,12 @@ private:
Gfx::IntRect item_rect(int item_index) const;
void update_content_size();
void update_item_rects(int item_index, ItemData& item_data) const;
- void get_item_rects(int item_index, ItemData& item_data, const Gfx::Font&) const;
- bool update_rubber_banding(const Gfx::IntPoint&);
+ void get_item_rects(int item_index, ItemData& item_data, Gfx::Font const&) const;
+ bool update_rubber_banding(Gfx::IntPoint const&);
int items_per_page() const;
void rebuild_item_cache() const;
- int model_index_to_item_index(const ModelIndex& model_index) const
+ int model_index_to_item_index(ModelIndex const& model_index) const
{
VERIFY(model_index.row() < item_count());
return model_index.row();
@@ -136,12 +136,12 @@ private:
virtual void did_update_selection() override;
virtual void clear_selection() override;
- virtual void add_selection(const ModelIndex& new_index) override;
- virtual void set_selection(const ModelIndex& new_index) override;
- virtual void toggle_selection(const ModelIndex& new_index) override;
+ virtual void add_selection(ModelIndex const& new_index) override;
+ virtual void set_selection(ModelIndex const& new_index) override;
+ virtual void toggle_selection(ModelIndex const& new_index) override;
ItemData& get_item_data(int) const;
- ItemData* item_data_from_content_position(const Gfx::IntPoint&) const;
+ ItemData* item_data_from_content_position(Gfx::IntPoint const&) const;
void do_clear_selection();
bool do_add_selection(ItemData&);
void add_selection(ItemData&);
diff --git a/Userland/Libraries/LibGUI/ImageWidget.cpp b/Userland/Libraries/LibGUI/ImageWidget.cpp
index c59620db91..27667a21d1 100644
--- a/Userland/Libraries/LibGUI/ImageWidget.cpp
+++ b/Userland/Libraries/LibGUI/ImageWidget.cpp
@@ -28,7 +28,7 @@ ImageWidget::ImageWidget(StringView)
REGISTER_BOOL_PROPERTY("should_stretch", should_stretch, set_should_stretch);
}
-void ImageWidget::set_bitmap(const Gfx::Bitmap* bitmap)
+void ImageWidget::set_bitmap(Gfx::Bitmap const* bitmap)
{
if (m_bitmap == bitmap)
return;
diff --git a/Userland/Libraries/LibGUI/ImageWidget.h b/Userland/Libraries/LibGUI/ImageWidget.h
index e0fb19838d..80669ee51b 100644
--- a/Userland/Libraries/LibGUI/ImageWidget.h
+++ b/Userland/Libraries/LibGUI/ImageWidget.h
@@ -18,7 +18,7 @@ class ImageWidget : public Frame {
public:
virtual ~ImageWidget() override = default;
- void set_bitmap(const Gfx::Bitmap*);
+ void set_bitmap(Gfx::Bitmap const*);
Gfx::Bitmap* bitmap() { return m_bitmap.ptr(); }
Gfx::Bitmap const* bitmap() const { return m_bitmap.ptr(); }
diff --git a/Userland/Libraries/LibGUI/JsonArrayModel.cpp b/Userland/Libraries/LibGUI/JsonArrayModel.cpp
index 51b8ff9632..40435417b7 100644
--- a/Userland/Libraries/LibGUI/JsonArrayModel.cpp
+++ b/Userland/Libraries/LibGUI/JsonArrayModel.cpp
@@ -59,7 +59,7 @@ bool JsonArrayModel::store()
return true;
}
-bool JsonArrayModel::add(const Vector<JsonValue>&& values)
+bool JsonArrayModel::add(Vector<JsonValue> const&& values)
{
VERIFY(values.size() == m_fields.size());
JsonObject obj;
@@ -108,7 +108,7 @@ bool JsonArrayModel::remove(int row)
return true;
}
-Variant JsonArrayModel::data(const ModelIndex& index, ModelRole role) const
+Variant JsonArrayModel::data(ModelIndex const& index, ModelRole role) const
{
auto& field_spec = m_fields[index.column()];
auto& object = m_array.at(index.row()).as_object();
@@ -142,7 +142,7 @@ Variant JsonArrayModel::data(const ModelIndex& index, ModelRole role) const
return {};
}
-void JsonArrayModel::set_json_path(const String& json_path)
+void JsonArrayModel::set_json_path(String const& json_path)
{
if (m_json_path == json_path)
return;
diff --git a/Userland/Libraries/LibGUI/JsonArrayModel.h b/Userland/Libraries/LibGUI/JsonArrayModel.h
index fcdb4ecfd3..62107a02bd 100644
--- a/Userland/Libraries/LibGUI/JsonArrayModel.h
+++ b/Userland/Libraries/LibGUI/JsonArrayModel.h
@@ -16,7 +16,7 @@ namespace GUI {
class JsonArrayModel final : public Model {
public:
struct FieldSpec {
- FieldSpec(const String& a_column_name, Gfx::TextAlignment a_text_alignment, Function<Variant(const JsonObject&)>&& a_massage_for_display, Function<Variant(const JsonObject&)>&& a_massage_for_sort = {}, Function<Variant(const JsonObject&)>&& a_massage_for_custom = {})
+ FieldSpec(String const& a_column_name, Gfx::TextAlignment a_text_alignment, Function<Variant(JsonObject const&)>&& a_massage_for_display, Function<Variant(JsonObject const&)>&& a_massage_for_sort = {}, Function<Variant(JsonObject const&)>&& a_massage_for_custom = {})
: column_name(a_column_name)
, text_alignment(a_text_alignment)
, massage_for_display(move(a_massage_for_display))
@@ -25,7 +25,7 @@ public:
{
}
- FieldSpec(const String& a_json_field_name, const String& a_column_name, Gfx::TextAlignment a_text_alignment)
+ FieldSpec(String const& a_json_field_name, String const& a_column_name, Gfx::TextAlignment a_text_alignment)
: json_field_name(a_json_field_name)
, column_name(a_column_name)
, text_alignment(a_text_alignment)
@@ -35,35 +35,35 @@ public:
String json_field_name;
String column_name;
Gfx::TextAlignment text_alignment;
- Function<Variant(const JsonObject&)> massage_for_display;
- Function<Variant(const JsonObject&)> massage_for_sort;
- Function<Variant(const JsonObject&)> massage_for_custom;
+ Function<Variant(JsonObject const&)> massage_for_display;
+ Function<Variant(JsonObject const&)> massage_for_sort;
+ Function<Variant(JsonObject const&)> massage_for_custom;
};
- static NonnullRefPtr<JsonArrayModel> create(const String& json_path, Vector<FieldSpec>&& fields)
+ static NonnullRefPtr<JsonArrayModel> create(String const& json_path, Vector<FieldSpec>&& fields)
{
return adopt_ref(*new JsonArrayModel(json_path, move(fields)));
}
virtual ~JsonArrayModel() override = default;
- virtual int row_count(const ModelIndex& = ModelIndex()) const override { return m_array.size(); }
- virtual int column_count(const ModelIndex& = ModelIndex()) const override { return m_fields.size(); }
+ virtual int row_count(ModelIndex const& = ModelIndex()) const override { return m_array.size(); }
+ virtual int column_count(ModelIndex const& = ModelIndex()) const override { return m_fields.size(); }
virtual String column_name(int column) const override { return m_fields[column].column_name; }
- virtual Variant data(const ModelIndex&, ModelRole = ModelRole::Display) const override;
+ virtual Variant data(ModelIndex const&, ModelRole = ModelRole::Display) const override;
virtual void invalidate() override;
virtual void update();
- const String& json_path() const { return m_json_path; }
- void set_json_path(const String& json_path);
+ String const& json_path() const { return m_json_path; }
+ void set_json_path(String const& json_path);
- bool add(const Vector<JsonValue>&& fields);
+ bool add(Vector<JsonValue> const&& fields);
bool set(int row, Vector<JsonValue>&& fields);
bool remove(int row);
bool store();
private:
- JsonArrayModel(const String& json_path, Vector<FieldSpec>&& fields)
+ JsonArrayModel(String const& json_path, Vector<FieldSpec>&& fields)
: m_json_path(json_path)
, m_fields(move(fields))
{
diff --git a/Userland/Libraries/LibGUI/Label.cpp b/Userland/Libraries/LibGUI/Label.cpp
index 8745611ed2..d41237803a 100644
--- a/Userland/Libraries/LibGUI/Label.cpp
+++ b/Userland/Libraries/LibGUI/Label.cpp
@@ -43,7 +43,7 @@ void Label::set_autosize(bool autosize)
size_to_fit();
}
-void Label::set_icon(const Gfx::Bitmap* icon)
+void Label::set_icon(Gfx::Bitmap const* icon)
{
if (m_icon == icon)
return;
diff --git a/Userland/Libraries/LibGUI/Label.h b/Userland/Libraries/LibGUI/Label.h
index 97e4493ddc..dac18da10b 100644
--- a/Userland/Libraries/LibGUI/Label.h
+++ b/Userland/Libraries/LibGUI/Label.h
@@ -22,9 +22,9 @@ public:
String text() const { return m_text; }
void set_text(String);
- void set_icon(const Gfx::Bitmap*);
+ void set_icon(Gfx::Bitmap const*);
void set_icon_from_path(String const&);
- const Gfx::Bitmap* icon() const { return m_icon.ptr(); }
+ Gfx::Bitmap const* icon() const { return m_icon.ptr(); }
Gfx::Bitmap* icon() { return m_icon.ptr(); }
Gfx::TextAlignment text_alignment() const { return m_text_alignment; }
diff --git a/Userland/Libraries/LibGUI/Layout.cpp b/Userland/Libraries/LibGUI/Layout.cpp
index 3c54efda78..807b26446a 100644
--- a/Userland/Libraries/LibGUI/Layout.cpp
+++ b/Userland/Libraries/LibGUI/Layout.cpp
@@ -140,7 +140,7 @@ void Layout::set_spacing(int spacing)
m_owner->notify_layout_changed({});
}
-void Layout::set_margins(const Margins& margins)
+void Layout::set_margins(Margins const& margins)
{
if (m_margins == margins)
return;
diff --git a/Userland/Libraries/LibGUI/Layout.h b/Userland/Libraries/LibGUI/Layout.h
index cd2fa5f23b..ef9a01f0cf 100644
--- a/Userland/Libraries/LibGUI/Layout.h
+++ b/Userland/Libraries/LibGUI/Layout.h
@@ -53,8 +53,8 @@ public:
void notify_adopted(Badge<Widget>, Widget&);
void notify_disowned(Badge<Widget>, Widget&);
- const Margins& margins() const { return m_margins; }
- void set_margins(const Margins&);
+ Margins const& margins() const { return m_margins; }
+ void set_margins(Margins const&);
int spacing() const { return m_spacing; }
void set_spacing(int);
diff --git a/Userland/Libraries/LibGUI/ListView.cpp b/Userland/Libraries/LibGUI/ListView.cpp
index fecd4b8d80..ab66cc9a1d 100644
--- a/Userland/Libraries/LibGUI/ListView.cpp
+++ b/Userland/Libraries/LibGUI/ListView.cpp
@@ -69,12 +69,12 @@ Gfx::IntRect ListView::content_rect(int row) const
return { 0, row * item_height(), content_width(), item_height() };
}
-Gfx::IntRect ListView::content_rect(const ModelIndex& index) const
+Gfx::IntRect ListView::content_rect(ModelIndex const& index) const
{
return content_rect(index.row());
}
-ModelIndex ListView::index_at_event_position(const Gfx::IntPoint& point) const
+ModelIndex ListView::index_at_event_position(Gfx::IntPoint const& point) const
{
VERIFY(model());
@@ -87,7 +87,7 @@ ModelIndex ListView::index_at_event_position(const Gfx::IntPoint& point) const
return {};
}
-Gfx::IntPoint ListView::adjusted_position(const Gfx::IntPoint& position) const
+Gfx::IntPoint ListView::adjusted_position(Gfx::IntPoint const& position) const
{
return position.translated(horizontal_scrollbar().value() - frame_thickness(), vertical_scrollbar().value() - frame_thickness());
}
@@ -255,7 +255,7 @@ void ListView::move_cursor(CursorMovement movement, SelectionUpdate selection_up
set_cursor(new_index, selection_update);
}
-void ListView::scroll_into_view(const ModelIndex& index, bool scroll_horizontally, bool scroll_vertically)
+void ListView::scroll_into_view(ModelIndex const& index, bool scroll_horizontally, bool scroll_vertically)
{
if (!model())
return;
diff --git a/Userland/Libraries/LibGUI/ListView.h b/Userland/Libraries/LibGUI/ListView.h
index 3edbfece64..0f471e927f 100644
--- a/Userland/Libraries/LibGUI/ListView.h
+++ b/Userland/Libraries/LibGUI/ListView.h
@@ -26,12 +26,12 @@ public:
int horizontal_padding() const { return m_horizontal_padding; }
int vertical_padding() const { return m_vertical_padding; }
- virtual void scroll_into_view(const ModelIndex& index, bool scroll_horizontally, bool scroll_vertically) override;
+ virtual void scroll_into_view(ModelIndex const& index, bool scroll_horizontally, bool scroll_vertically) override;
- Gfx::IntPoint adjusted_position(const Gfx::IntPoint&) const;
+ Gfx::IntPoint adjusted_position(Gfx::IntPoint const&) const;
- virtual ModelIndex index_at_event_position(const Gfx::IntPoint&) const override;
- virtual Gfx::IntRect content_rect(const ModelIndex&) const override;
+ virtual ModelIndex index_at_event_position(Gfx::IntPoint const&) const override;
+ virtual Gfx::IntRect content_rect(ModelIndex const&) const override;
int model_column() const { return m_model_column; }
void set_model_column(int column) { m_model_column = column; }
diff --git a/Userland/Libraries/LibGUI/Margins.h b/Userland/Libraries/LibGUI/Margins.h
index 71232a0bec..f1a3405cad 100644
--- a/Userland/Libraries/LibGUI/Margins.h
+++ b/Userland/Libraries/LibGUI/Margins.h
@@ -65,7 +65,7 @@ public:
void set_bottom(int value) { m_bottom = value; }
void set_left(int value) { m_left = value; }
- bool operator==(const Margins& other) const
+ bool operator==(Margins const& other) const
{
return m_left == other.m_left
&& m_top == other.m_top
diff --git a/Userland/Libraries/LibGUI/Menu.cpp b/Userland/Libraries/LibGUI/Menu.cpp
index 340c0b211e..7363688f57 100644
--- a/Userland/Libraries/LibGUI/Menu.cpp
+++ b/Userland/Libraries/LibGUI/Menu.cpp
@@ -42,7 +42,7 @@ Menu::~Menu()
unrealize_menu();
}
-void Menu::set_icon(const Gfx::Bitmap* icon)
+void Menu::set_icon(Gfx::Bitmap const* icon)
{
m_icon = icon;
}
@@ -110,13 +110,13 @@ void Menu::add_separator()
MUST(try_add_separator());
}
-void Menu::realize_if_needed(const RefPtr<Action>& default_action)
+void Menu::realize_if_needed(RefPtr<Action> const& default_action)
{
if (m_menu_id == -1 || m_current_default_action.ptr() != default_action)
realize_menu(default_action);
}
-void Menu::popup(const Gfx::IntPoint& screen_position, const RefPtr<Action>& default_action)
+void Menu::popup(Gfx::IntPoint const& screen_position, RefPtr<Action> const& default_action)
{
realize_if_needed(default_action);
ConnectionToWindowServer::the().async_popup_menu(m_menu_id, screen_position);
diff --git a/Userland/Libraries/LibGUI/Menu.h b/Userland/Libraries/LibGUI/Menu.h
index 2d60d51c38..79c7000e35 100644
--- a/Userland/Libraries/LibGUI/Menu.h
+++ b/Userland/Libraries/LibGUI/Menu.h
@@ -26,9 +26,9 @@ public:
static Menu* from_menu_id(int);
int menu_id() const { return m_menu_id; }
- const String& name() const { return m_name; }
- const Gfx::Bitmap* icon() const { return m_icon.ptr(); }
- void set_icon(const Gfx::Bitmap*);
+ String const& name() const { return m_name; }
+ Gfx::Bitmap const* icon() const { return m_icon.ptr(); }
+ void set_icon(Gfx::Bitmap const*);
Action* action_at(size_t);
@@ -41,7 +41,7 @@ public:
Menu& add_submenu(String name);
void remove_all_actions();
- void popup(const Gfx::IntPoint& screen_position, const RefPtr<Action>& default_action = nullptr);
+ void popup(Gfx::IntPoint const& screen_position, RefPtr<Action> const& default_action = nullptr);
void dismiss();
void visibility_did_change(Badge<ConnectionToWindowServer>, bool visible);
@@ -61,7 +61,7 @@ private:
int realize_menu(RefPtr<Action> default_action = nullptr);
void unrealize_menu();
- void realize_if_needed(const RefPtr<Action>& default_action);
+ void realize_if_needed(RefPtr<Action> const& default_action);
void realize_menu_item(MenuItem&, int item_id);
diff --git a/Userland/Libraries/LibGUI/MenuItem.h b/Userland/Libraries/LibGUI/MenuItem.h
index 7e5fd1c8ff..c98cb94abb 100644
--- a/Userland/Libraries/LibGUI/MenuItem.h
+++ b/Userland/Libraries/LibGUI/MenuItem.h
@@ -29,12 +29,12 @@ public:
Type type() const { return m_type; }
- const Action* action() const { return m_action.ptr(); }
+ Action const* action() const { return m_action.ptr(); }
Action* action() { return m_action.ptr(); }
unsigned identifier() const { return m_identifier; }
Menu* submenu() { return m_submenu.ptr(); }
- const Menu* submenu() const { return m_submenu.ptr(); }
+ Menu const* submenu() const { return m_submenu.ptr(); }
bool is_checkable() const { return m_checkable; }
void set_checkable(bool checkable) { m_checkable = checkable; }
diff --git a/Userland/Libraries/LibGUI/ModelEditingDelegate.h b/Userland/Libraries/LibGUI/ModelEditingDelegate.h
index e02a61efaa..56a1ee5307 100644
--- a/Userland/Libraries/LibGUI/ModelEditingDelegate.h
+++ b/Userland/Libraries/LibGUI/ModelEditingDelegate.h
@@ -22,7 +22,7 @@ public:
virtual ~ModelEditingDelegate() = default;
- void bind(Model& model, const ModelIndex& index)
+ void bind(Model& model, ModelIndex const& index)
{
if (m_model.ptr() == &model && m_index == index)
return;
@@ -32,7 +32,7 @@ public:
}
Widget* widget() { return m_widget; }
- const Widget* widget() const { return m_widget; }
+ Widget const* widget() const { return m_widget; }
Function<void()> on_commit;
Function<void()> on_rollback;
@@ -63,7 +63,7 @@ protected:
on_change();
}
- const ModelIndex& index() const { return m_index; }
+ ModelIndex const& index() const { return m_index; }
private:
RefPtr<Model> m_model;
@@ -92,7 +92,7 @@ public:
};
return textbox;
}
- virtual Variant value() const override { return static_cast<const TextBox*>(widget())->text(); }
+ virtual Variant value() const override { return static_cast<TextBox const*>(widget())->text(); }
virtual void set_value(Variant const& value, SelectionBehavior selection_behavior) override
{
auto& textbox = static_cast<TextBox&>(*widget());
diff --git a/Userland/Libraries/LibGUI/ModelIndex.cpp b/Userland/Libraries/LibGUI/ModelIndex.cpp
index e095764d4d..a9d3f82910 100644
--- a/Userland/Libraries/LibGUI/ModelIndex.cpp
+++ b/Userland/Libraries/LibGUI/ModelIndex.cpp
@@ -19,7 +19,7 @@ Variant ModelIndex::data(ModelRole role) const
return model()->data(*this, role);
}
-bool ModelIndex::is_parent_of(const ModelIndex& child) const
+bool ModelIndex::is_parent_of(ModelIndex const& child) const
{
auto current_index = child.parent();
while (current_index.is_valid()) {
diff --git a/Userland/Libraries/LibGUI/ModelIndex.h b/Userland/Libraries/LibGUI/ModelIndex.h
index 07743383a5..c143f49ac1 100644
--- a/Userland/Libraries/LibGUI/ModelIndex.h
+++ b/Userland/Libraries/LibGUI/ModelIndex.h
@@ -26,19 +26,19 @@ public:
void* internal_data() const { return m_internal_data; }
ModelIndex parent() const;
- bool is_parent_of(const ModelIndex&) const;
+ bool is_parent_of(ModelIndex const&) const;
- bool operator==(const ModelIndex& other) const
+ bool operator==(ModelIndex const& other) const
{
return m_model == other.m_model && m_row == other.m_row && m_column == other.m_column && m_internal_data == other.m_internal_data;
}
- bool operator!=(const ModelIndex& other) const
+ bool operator!=(ModelIndex const& other) const
{
return !(*this == other);
}
- const Model* model() const { return m_model; }
+ Model const* model() const { return m_model; }
Variant data(ModelRole = ModelRole::Display) const;
@@ -46,7 +46,7 @@ public:
ModelIndex sibling_at_column(int column) const;
private:
- ModelIndex(const Model& model, int row, int column, void* internal_data)
+ ModelIndex(Model const& model, int row, int column, void* internal_data)
: m_model(&model)
, m_row(row)
, m_column(column)
@@ -54,7 +54,7 @@ private:
{
}
- const Model* m_model { nullptr };
+ Model const* m_model { nullptr };
int m_row { -1 };
int m_column { -1 };
void* m_internal_data { nullptr };
diff --git a/Userland/Libraries/LibGUI/ModelSelection.cpp b/Userland/Libraries/LibGUI/ModelSelection.cpp
index 825384c280..8e11c3f423 100644
--- a/Userland/Libraries/LibGUI/ModelSelection.cpp
+++ b/Userland/Libraries/LibGUI/ModelSelection.cpp
@@ -16,7 +16,7 @@ void ModelSelection::remove_all_matching(Function<bool(ModelIndex const&)> filte
notify_selection_changed();
}
-void ModelSelection::set(const ModelIndex& index)
+void ModelSelection::set(ModelIndex const& index)
{
VERIFY(index.is_valid());
if (m_indices.size() == 1 && m_indices.contains(index))
@@ -26,14 +26,14 @@ void ModelSelection::set(const ModelIndex& index)
notify_selection_changed();
}
-void ModelSelection::add(const ModelIndex& index)
+void ModelSelection::add(ModelIndex const& index)
{
VERIFY(index.is_valid());
if (m_indices.set(index) == AK::HashSetResult::InsertedNewEntry)
notify_selection_changed();
}
-void ModelSelection::add_all(const Vector<ModelIndex>& indices)
+void ModelSelection::add_all(Vector<ModelIndex> const& indices)
{
{
TemporaryChange notify_change { m_disable_notify, true };
@@ -45,7 +45,7 @@ void ModelSelection::add_all(const Vector<ModelIndex>& indices)
notify_selection_changed();
}
-void ModelSelection::toggle(const ModelIndex& index)
+void ModelSelection::toggle(ModelIndex const& index)
{
VERIFY(index.is_valid());
if (m_indices.contains(index))
@@ -55,7 +55,7 @@ void ModelSelection::toggle(const ModelIndex& index)
notify_selection_changed();
}
-bool ModelSelection::remove(const ModelIndex& index)
+bool ModelSelection::remove(ModelIndex const& index)
{
VERIFY(index.is_valid());
if (!m_indices.contains(index))
diff --git a/Userland/Libraries/LibGUI/ModelSelection.h b/Userland/Libraries/LibGUI/ModelSelection.h
index 85305246be..b89d632012 100644
--- a/Userland/Libraries/LibGUI/ModelSelection.h
+++ b/Userland/Libraries/LibGUI/ModelSelection.h
@@ -27,7 +27,7 @@ public:
int size() const { return m_indices.size(); }
bool is_empty() const { return m_indices.is_empty(); }
- bool contains(const ModelIndex& index) const { return m_indices.contains(index); }
+ bool contains(ModelIndex const& index) const { return m_indices.contains(index); }
bool contains_row(int row) const
{
for (auto& index : m_indices) {
@@ -37,11 +37,11 @@ public:
return false;
}
- void set(const ModelIndex&);
- void add(const ModelIndex&);
- void add_all(const Vector<ModelIndex>&);
- void toggle(const ModelIndex&);
- bool remove(const ModelIndex&);
+ void set(ModelIndex const&);
+ void add(ModelIndex const&);
+ void add_all(Vector<ModelIndex> const&);
+ void toggle(ModelIndex const&);
+ bool remove(ModelIndex const&);
void clear();
template<typename Callback>
diff --git a/Userland/Libraries/LibGUI/MultiView.h b/Userland/Libraries/LibGUI/MultiView.h
index a4436fe08d..3bcf52623f 100644
--- a/Userland/Libraries/LibGUI/MultiView.h
+++ b/Userland/Libraries/LibGUI/MultiView.h
@@ -23,10 +23,10 @@ public:
void refresh();
Function<void()> on_selection_change;
- Function<void(const ModelIndex&)> on_activation;
- Function<void(const ModelIndex&)> on_selection;
- Function<void(const ModelIndex&, const ContextMenuEvent&)> on_context_menu_request;
- Function<void(const ModelIndex&, const DropEvent&)> on_drop;
+ Function<void(ModelIndex const&)> on_activation;
+ Function<void(ModelIndex const&)> on_selection;
+ Function<void(ModelIndex const&, ContextMenuEvent const&)> on_context_menu_request;
+ Function<void(ModelIndex const&, DropEvent const&)> on_drop;
enum ViewMode {
Invalid,
@@ -58,7 +58,7 @@ public:
}
}
- const ModelSelection& selection() const { return const_cast<MultiView&>(*this).current_view().selection(); }
+ ModelSelection const& selection() const { return const_cast<MultiView&>(*this).current_view().selection(); }
ModelSelection& selection() { return current_view().selection(); }
template<typename Callback>
@@ -70,7 +70,7 @@ public:
}
Model* model() { return m_model; }
- const Model* model() const { return m_model; }
+ Model const* model() const { return m_model; }
void set_model(RefPtr<Model>);
diff --git a/Userland/Libraries/LibGUI/Notification.h b/Userland/Libraries/LibGUI/Notification.h
index c5d94aaccc..5f695597b6 100644
--- a/Userland/Libraries/LibGUI/Notification.h
+++ b/Userland/Libraries/LibGUI/Notification.h
@@ -21,22 +21,22 @@ class Notification : public Core::Object {
public:
virtual ~Notification() override;
- const String& text() const { return m_text; }
- void set_text(const String& text)
+ String const& text() const { return m_text; }
+ void set_text(String const& text)
{
m_text_dirty = true;
m_text = text;
}
- const String& title() const { return m_title; }
- void set_title(const String& title)
+ String const& title() const { return m_title; }
+ void set_title(String const& title)
{
m_title_dirty = true;
m_title = title;
}
- const Gfx::Bitmap* icon() const { return m_icon; }
- void set_icon(const Gfx::Bitmap* icon)
+ Gfx::Bitmap const* icon() const { return m_icon; }
+ void set_icon(Gfx::Bitmap const* icon)
{
m_icon_dirty = true;
m_icon = icon;
diff --git a/Userland/Libraries/LibGUI/OpacitySlider.cpp b/Userland/Libraries/LibGUI/OpacitySlider.cpp
index 59cb22d2fa..cb8aff8d79 100644
--- a/Userland/Libraries/LibGUI/OpacitySlider.cpp
+++ b/Userland/Libraries/LibGUI/OpacitySlider.cpp
@@ -95,7 +95,7 @@ void OpacitySlider::paint_event(PaintEvent& event)
Gfx::StylePainter::paint_frame(painter, rect(), palette(), Gfx::FrameShape::Container, Gfx::FrameShadow::Sunken, 2);
}
-int OpacitySlider::value_at(const Gfx::IntPoint& position) const
+int OpacitySlider::value_at(Gfx::IntPoint const& position) const
{
auto inner_rect = frame_inner_rect();
if (position.x() < inner_rect.left())
diff --git a/Userland/Libraries/LibGUI/OpacitySlider.h b/Userland/Libraries/LibGUI/OpacitySlider.h
index e4ab0560be..3c09c95c89 100644
--- a/Userland/Libraries/LibGUI/OpacitySlider.h
+++ b/Userland/Libraries/LibGUI/OpacitySlider.h
@@ -29,7 +29,7 @@ private:
Gfx::IntRect frame_inner_rect() const;
- int value_at(const Gfx::IntPoint&) const;
+ int value_at(Gfx::IntPoint const&) const;
bool m_dragging { false };
};
diff --git a/Userland/Libraries/LibGUI/ProcessChooser.cpp b/Userland/Libraries/LibGUI/ProcessChooser.cpp
index 94c3e4781d..2a55fbee53 100644
--- a/Userland/Libraries/LibGUI/ProcessChooser.cpp
+++ b/Userland/Libraries/LibGUI/ProcessChooser.cpp
@@ -15,7 +15,7 @@
namespace GUI {
-ProcessChooser::ProcessChooser(StringView window_title, StringView button_label, const Gfx::Bitmap* window_icon, GUI::Window* parent_window)
+ProcessChooser::ProcessChooser(StringView window_title, StringView button_label, Gfx::Bitmap const* window_icon, GUI::Window* parent_window)
: Dialog(parent_window)
, m_window_title(window_title)
, m_button_label(button_label)
@@ -44,7 +44,7 @@ ProcessChooser::ProcessChooser(StringView window_title, StringView button_label,
m_process_model = process_model;
- m_table_view->on_activation = [this](const ModelIndex& index) { set_pid_from_index_and_close(index); };
+ m_table_view->on_activation = [this](ModelIndex const& index) { set_pid_from_index_and_close(index); };
auto& button_container = widget.add<GUI::Widget>();
button_container.set_fixed_height(30);
@@ -99,7 +99,7 @@ ProcessChooser::ProcessChooser(StringView window_title, StringView button_label,
};
}
-void ProcessChooser::set_pid_from_index_and_close(const ModelIndex& index)
+void ProcessChooser::set_pid_from_index_and_close(ModelIndex const& index)
{
m_pid = index.data(GUI::ModelRole::Custom).as_i32();
done(ExecOK);
diff --git a/Userland/Libraries/LibGUI/ProcessChooser.h b/Userland/Libraries/LibGUI/ProcessChooser.h
index 23e3363a0e..e9467e5e1f 100644
--- a/Userland/Libraries/LibGUI/ProcessChooser.h
+++ b/Userland/Libraries/LibGUI/ProcessChooser.h
@@ -22,9 +22,9 @@ public:
pid_t pid() const { return m_pid; }
private:
- ProcessChooser(StringView window_title = "Process Chooser", StringView button_label = "Select", const Gfx::Bitmap* window_icon = nullptr, GUI::Window* parent_window = nullptr);
+ ProcessChooser(StringView window_title = "Process Chooser", StringView button_label = "Select", Gfx::Bitmap const* window_icon = nullptr, GUI::Window* parent_window = nullptr);
- void set_pid_from_index_and_close(const ModelIndex&);
+ void set_pid_from_index_and_close(ModelIndex const&);
pid_t m_pid { 0 };
diff --git a/Userland/Libraries/LibGUI/RegularEditingEngine.cpp b/Userland/Libraries/LibGUI/RegularEditingEngine.cpp
index ff69f2dd74..347e42007b 100644
--- a/Userland/Libraries/LibGUI/RegularEditingEngine.cpp
+++ b/Userland/Libraries/LibGUI/RegularEditingEngine.cpp
@@ -15,7 +15,7 @@ CursorWidth RegularEditingEngine::cursor_width() const
return CursorWidth::NARROW;
}
-bool RegularEditingEngine::on_key(const KeyEvent& event)
+bool RegularEditingEngine::on_key(KeyEvent const& event)
{
if (EditingEngine::on_key(event))
return true;
@@ -34,7 +34,7 @@ bool RegularEditingEngine::on_key(const KeyEvent& event)
return false;
}
-static int strcmp_utf32(const u32* s1, const u32* s2, size_t n)
+static int strcmp_utf32(u32 const* s1, u32 const* s2, size_t n)
{
while (n-- > 0) {
if (*s1++ != *s2++)
diff --git a/Userland/Libraries/LibGUI/RegularEditingEngine.h b/Userland/Libraries/LibGUI/RegularEditingEngine.h
index 308bb353bc..82f0088b86 100644
--- a/Userland/Libraries/LibGUI/RegularEditingEngine.h
+++ b/Userland/Libraries/LibGUI/RegularEditingEngine.h
@@ -15,7 +15,7 @@ class RegularEditingEngine final : public EditingEngine {
public:
virtual CursorWidth cursor_width() const override;
- virtual bool on_key(const KeyEvent& event) override;
+ virtual bool on_key(KeyEvent const& event) override;
private:
void sort_selected_lines();
diff --git a/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp b/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp
index 214ffe0401..85cc26eb50 100644
--- a/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp
+++ b/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp
@@ -83,7 +83,7 @@ void ScrollableContainerWidget::set_widget(GUI::Widget* widget)
update_widget_position();
}
-bool ScrollableContainerWidget::load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::Object> (*unregistered_child_handler)(const String&))
+bool ScrollableContainerWidget::load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::Object> (*unregistered_child_handler)(String const&))
{
if (is<GUI::GML::GMLFile>(ast.ptr()))
return load_from_gml_ast(static_ptr_cast<GUI::GML::GMLFile>(ast)->main_class(), unregistered_child_handler);
diff --git a/Userland/Libraries/LibGUI/ScrollableContainerWidget.h b/Userland/Libraries/LibGUI/ScrollableContainerWidget.h
index 36c2cd734c..3064af9866 100644
--- a/Userland/Libraries/LibGUI/ScrollableContainerWidget.h
+++ b/Userland/Libraries/LibGUI/ScrollableContainerWidget.h
@@ -28,7 +28,7 @@ protected:
private:
void update_widget_size();
void update_widget_position();
- virtual bool load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::Object> (*unregistered_child_handler)(const String&)) override;
+ virtual bool load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::Object> (*unregistered_child_handler)(String const&)) override;
ScrollableContainerWidget();
diff --git a/Userland/Libraries/LibGUI/Scrollbar.cpp b/Userland/Libraries/LibGUI/Scrollbar.cpp
index ebb0499cb0..5843649dc1 100644
--- a/Userland/Libraries/LibGUI/Scrollbar.cpp
+++ b/Userland/Libraries/LibGUI/Scrollbar.cpp
@@ -352,7 +352,7 @@ void Scrollbar::set_automatic_scrolling_active(bool active, Component pressed_co
}
}
-void Scrollbar::scroll_by_page(const Gfx::IntPoint& click_position)
+void Scrollbar::scroll_by_page(Gfx::IntPoint const& click_position)
{
float range_size = max() - min();
float available = scrubbable_range_in_pixels();
@@ -368,7 +368,7 @@ void Scrollbar::scroll_by_page(const Gfx::IntPoint& click_position)
}
}
-void Scrollbar::scroll_to_position(const Gfx::IntPoint& click_position)
+void Scrollbar::scroll_to_position(Gfx::IntPoint const& click_position)
{
float range_size = max() - min();
float available = scrubbable_range_in_pixels();
@@ -378,7 +378,7 @@ void Scrollbar::scroll_to_position(const Gfx::IntPoint& click_position)
set_target_value(min() + rel_x_or_y * range_size);
}
-Scrollbar::Component Scrollbar::component_at_position(const Gfx::IntPoint& position)
+Scrollbar::Component Scrollbar::component_at_position(Gfx::IntPoint const& position)
{
if (scrubber_rect().contains(position))
return Component::Scrubber;
diff --git a/Userland/Libraries/LibGUI/Scrollbar.h b/Userland/Libraries/LibGUI/Scrollbar.h
index 0f6115055c..51aa86aea2 100644
--- a/Userland/Libraries/LibGUI/Scrollbar.h
+++ b/Userland/Libraries/LibGUI/Scrollbar.h
@@ -79,10 +79,10 @@ private:
void on_automatic_scrolling_timer_fired();
void set_automatic_scrolling_active(bool, Component);
- void scroll_to_position(const Gfx::IntPoint&);
- void scroll_by_page(const Gfx::IntPoint&);
+ void scroll_to_position(Gfx::IntPoint const&);
+ void scroll_by_page(Gfx::IntPoint const&);
- Component component_at_position(const Gfx::IntPoint&);
+ Component component_at_position(Gfx::IntPoint const&);
void update_animated_scroll();
diff --git a/Userland/Libraries/LibGUI/Shortcut.h b/Userland/Libraries/LibGUI/Shortcut.h
index 52d90a6f2d..856260e5d8 100644
--- a/Userland/Libraries/LibGUI/Shortcut.h
+++ b/Userland/Libraries/LibGUI/Shortcut.h
@@ -30,7 +30,7 @@ public:
KeyCode key() const { return m_key; }
String to_string() const;
- bool operator==(const Shortcut& other) const
+ bool operator==(Shortcut const& other) const
{
return m_modifiers == other.m_modifiers
&& m_key == other.m_key;
diff --git a/Userland/Libraries/LibGUI/Slider.cpp b/Userland/Libraries/LibGUI/Slider.cpp
index b090f63c90..6ee7edc879 100644
--- a/Userland/Libraries/LibGUI/Slider.cpp
+++ b/Userland/Libraries/LibGUI/Slider.cpp
@@ -85,7 +85,7 @@ void Slider::mousedown_event(MouseEvent& event)
return;
}
- const auto mouse_offset = event.position().primary_offset_for_orientation(orientation());
+ auto const mouse_offset = event.position().primary_offset_for_orientation(orientation());
if (jump_to_cursor()) {
float normalized_mouse_offset = 0.0f;
diff --git a/Userland/Libraries/LibGUI/StackWidget.h b/Userland/Libraries/LibGUI/StackWidget.h
index 0f9dc7170b..ad57814c2e 100644
--- a/Userland/Libraries/LibGUI/StackWidget.h
+++ b/Userland/Libraries/LibGUI/StackWidget.h
@@ -17,7 +17,7 @@ public:
virtual ~StackWidget() override = default;
Widget* active_widget() { return m_active_widget.ptr(); }
- const Widget* active_widget() const { return m_active_widget.ptr(); }
+ Widget const* active_widget() const { return m_active_widget.ptr(); }
void set_active_widget(Widget*);
Function<void(Widget*)> on_active_widget_change;
diff --git a/Userland/Libraries/LibGUI/TabWidget.cpp b/Userland/Libraries/LibGUI/TabWidget.cpp
index 26e7a9f90e..c855b76d62 100644
--- a/Userland/Libraries/LibGUI/TabWidget.cpp
+++ b/Userland/Libraries/LibGUI/TabWidget.cpp
@@ -141,7 +141,7 @@ void TabWidget::resize_event(ResizeEvent& event)
m_active_widget->set_relative_rect(child_rect_for_size(event.size()));
}
-Gfx::IntRect TabWidget::child_rect_for_size(const Gfx::IntSize& size) const
+Gfx::IntRect TabWidget::child_rect_for_size(Gfx::IntSize const& size) const
{
Gfx::IntRect rect;
switch (m_tab_position) {
@@ -401,7 +401,7 @@ Gfx::IntRect TabWidget::close_button_rect(size_t index) const
return close_button_rect;
}
-int TabWidget::TabData::width(const Gfx::Font& font) const
+int TabWidget::TabData::width(Gfx::Font const& font) const
{
auto width = 16 + font.width(title) + (icon ? (16 + 4) : 0);
// NOTE: This needs to always be an odd number, because the button rect
@@ -553,7 +553,7 @@ void TabWidget::set_tab_title(Widget& tab, StringView title)
}
}
-void TabWidget::set_tab_icon(Widget& tab, const Gfx::Bitmap* icon)
+void TabWidget::set_tab_icon(Widget& tab, Gfx::Bitmap const* icon)
{
for (auto& t : m_tabs) {
if (t.widget == &tab) {
diff --git a/Userland/Libraries/LibGUI/TabWidget.h b/Userland/Libraries/LibGUI/TabWidget.h
index c3a793374d..d723f3417b 100644
--- a/Userland/Libraries/LibGUI/TabWidget.h
+++ b/Userland/Libraries/LibGUI/TabWidget.h
@@ -28,7 +28,7 @@ public:
Optional<size_t> active_tab_index() const;
Widget* active_widget() { return m_active_widget.ptr(); }
- const Widget* active_widget() const { return m_active_widget.ptr(); }
+ Widget const* active_widget() const { return m_active_widget.ptr(); }
void set_active_widget(Widget*);
void set_tab_index(int);
@@ -62,7 +62,7 @@ public:
void remove_all_tabs_except(Widget& tab);
void set_tab_title(Widget& tab, StringView title);
- void set_tab_icon(Widget& tab, const Gfx::Bitmap*);
+ void set_tab_icon(Widget& tab, Gfx::Bitmap const*);
void activate_next_tab();
void activate_previous_tab();
@@ -86,7 +86,7 @@ public:
Function<void(Widget&)> on_change;
Function<void(Widget&)> on_middle_click;
Function<void(Widget&)> on_tab_close_click;
- Function<void(Widget&, const ContextMenuEvent&)> on_context_menu_request;
+ Function<void(Widget&, ContextMenuEvent const&)> on_context_menu_request;
Function<void(Widget&)> on_double_click;
protected:
@@ -104,7 +104,7 @@ protected:
virtual void doubleclick_event(MouseEvent&) override;
private:
- Gfx::IntRect child_rect_for_size(const Gfx::IntSize&) const;
+ Gfx::IntRect child_rect_for_size(Gfx::IntSize const&) const;
Gfx::IntRect button_rect(size_t index) const;
Gfx::IntRect close_button_rect(size_t index) const;
Gfx::IntRect bar_rect() const;
@@ -116,7 +116,7 @@ private:
RefPtr<Widget> m_active_widget;
struct TabData {
- int width(const Gfx::Font&) const;
+ int width(Gfx::Font const&) const;
String title;
RefPtr<Gfx::Bitmap> icon;
Widget* widget { nullptr };
diff --git a/Userland/Libraries/LibGUI/TextDocument.cpp b/Userland/Libraries/LibGUI/TextDocument.cpp
index 8466107f80..6ffe48be38 100644
--- a/Userland/Libraries/LibGUI/TextDocument.cpp
+++ b/Userland/Libraries/LibGUI/TextDocument.cpp
@@ -171,7 +171,7 @@ void TextDocumentLine::clear(TextDocument& document)
document.update_views({});
}
-void TextDocumentLine::set_text(TextDocument& document, const Vector<u32> text)
+void TextDocumentLine::set_text(TextDocument& document, Vector<u32> const text)
{
m_text = move(text);
document.update_views({});
@@ -194,7 +194,7 @@ bool TextDocumentLine::set_text(TextDocument& document, StringView text)
return true;
}
-void TextDocumentLine::append(TextDocument& document, const u32* code_points, size_t length)
+void TextDocumentLine::append(TextDocument& document, u32 const* code_points, size_t length)
{
if (length == 0)
return;
@@ -313,7 +313,7 @@ void TextDocument::notify_did_change()
m_regex_needs_update = true;
}
-void TextDocument::set_all_cursors(const TextPosition& position)
+void TextDocument::set_all_cursors(TextPosition const& position)
{
if (m_client_notifications_enabled) {
for (auto* client : m_clients)
@@ -333,7 +333,7 @@ String TextDocument::text() const
return builder.to_string();
}
-String TextDocument::text_in_range(const TextRange& a_range) const
+String TextDocument::text_in_range(TextRange const& a_range) const
{
auto range = a_range.normalized();
if (is_empty() || line_count() < range.end().line() - range.start().line())
@@ -359,7 +359,7 @@ String TextDocument::text_in_range(const TextRange& a_range) const
return builder.to_string();
}
-u32 TextDocument::code_point_at(const TextPosition& position) const
+u32 TextDocument::code_point_at(TextPosition const& position) const
{
VERIFY(position.line() < line_count());
auto& line = this->line(position.line());
@@ -368,7 +368,7 @@ u32 TextDocument::code_point_at(const TextPosition& position) const
return line.code_points()[position.column()];
}
-TextPosition TextDocument::next_position_after(const TextPosition& position, SearchShouldWrap should_wrap) const
+TextPosition TextDocument::next_position_after(TextPosition const& position, SearchShouldWrap should_wrap) const
{
auto& line = this->line(position.line());
if (position.column() == line.length()) {
@@ -382,7 +382,7 @@ TextPosition TextDocument::next_position_after(const TextPosition& position, Sea
return { position.line(), position.column() + 1 };
}
-TextPosition TextDocument::previous_position_before(const TextPosition& position, SearchShouldWrap should_wrap) const
+TextPosition TextDocument::previous_position_before(TextPosition const& position, SearchShouldWrap should_wrap) const
{
if (position.column() == 0) {
if (position.line() == 0) {
@@ -416,7 +416,7 @@ void TextDocument::update_regex_matches(StringView needle)
}
}
-TextRange TextDocument::find_next(StringView needle, const TextPosition& start, SearchShouldWrap should_wrap, bool regmatch, bool match_case)
+TextRange TextDocument::find_next(StringView needle, TextPosition const& start, SearchShouldWrap should_wrap, bool regmatch, bool match_case)
{
if (needle.is_empty())
return {};
@@ -496,7 +496,7 @@ TextRange TextDocument::find_next(StringView needle, const TextPosition& start,
return {};
}
-TextRange TextDocument::find_previous(StringView needle, const TextPosition& start, SearchShouldWrap should_wrap, bool regmatch, bool match_case)
+TextRange TextDocument::find_previous(StringView needle, TextPosition const& start, SearchShouldWrap should_wrap, bool regmatch, bool match_case)
{
if (needle.is_empty())
return {};
@@ -595,7 +595,7 @@ Vector<TextRange> TextDocument::find_all(StringView needle, bool regmatch, bool
return ranges;
}
-Optional<TextDocumentSpan> TextDocument::first_non_skippable_span_before(const TextPosition& position) const
+Optional<TextDocumentSpan> TextDocument::first_non_skippable_span_before(TextPosition const& position) const
{
for (int i = m_spans.size() - 1; i >= 0; --i) {
if (!m_spans[i].range.contains(position))
@@ -609,7 +609,7 @@ Optional<TextDocumentSpan> TextDocument::first_non_skippable_span_before(const T
return {};
}
-Optional<TextDocumentSpan> TextDocument::first_non_skippable_span_after(const TextPosition& position) const
+Optional<TextDocumentSpan> TextDocument::first_non_skippable_span_after(TextPosition const& position) const
{
size_t i = 0;
// Find the first span containing the cursor
@@ -633,7 +633,7 @@ Optional<TextDocumentSpan> TextDocument::first_non_skippable_span_after(const Te
return {};
}
-TextPosition TextDocument::first_word_break_before(const TextPosition& position, bool start_at_column_before) const
+TextPosition TextDocument::first_word_break_before(TextPosition const& position, bool start_at_column_before) const
{
if (position.column() == 0) {
if (position.line() == 0) {
@@ -663,7 +663,7 @@ TextPosition TextDocument::first_word_break_before(const TextPosition& position,
return target;
}
-TextPosition TextDocument::first_word_break_after(const TextPosition& position) const
+TextPosition TextDocument::first_word_break_after(TextPosition const& position) const
{
auto target = position;
auto line = this->line(target.line());
@@ -689,7 +689,7 @@ TextPosition TextDocument::first_word_break_after(const TextPosition& position)
return target;
}
-TextPosition TextDocument::first_word_before(const TextPosition& position, bool start_at_column_before) const
+TextPosition TextDocument::first_word_before(TextPosition const& position, bool start_at_column_before) const
{
if (position.column() == 0) {
if (position.line() == 0) {
@@ -748,7 +748,7 @@ TextDocumentUndoCommand::TextDocumentUndoCommand(TextDocument& document)
{
}
-InsertTextCommand::InsertTextCommand(TextDocument& document, const String& text, const TextPosition& position)
+InsertTextCommand::InsertTextCommand(TextDocument& document, String const& text, TextPosition const& position)
: TextDocumentUndoCommand(document)
, m_text(text)
, m_range({ position, position })
@@ -777,11 +777,11 @@ bool InsertTextCommand::merge_with(GUI::Command const& other)
return true;
}
-void InsertTextCommand::perform_formatting(const TextDocument::Client& client)
+void InsertTextCommand::perform_formatting(TextDocument::Client const& client)
{
const size_t tab_width = client.soft_tab_width();
- const auto& dest_line = m_document.line(m_range.start().line());
- const bool should_auto_indent = client.is_automatic_indentation_enabled();
+ auto const& dest_line = m_document.line(m_range.start().line());
+ bool const should_auto_indent = client.is_automatic_indentation_enabled();
StringBuilder builder;
size_t column = m_range.start().column();
@@ -842,7 +842,7 @@ void InsertTextCommand::undo()
m_document.set_all_cursors(m_range.start());
}
-RemoveTextCommand::RemoveTextCommand(TextDocument& document, const String& text, const TextRange& range)
+RemoveTextCommand::RemoveTextCommand(TextDocument& document, String const& text, TextRange const& range)
: TextDocumentUndoCommand(document)
, m_text(text)
, m_range(range)
@@ -884,7 +884,7 @@ void RemoveTextCommand::undo()
m_document.set_all_cursors(new_cursor);
}
-TextPosition TextDocument::insert_at(const TextPosition& position, StringView text, const Client* client)
+TextPosition TextDocument::insert_at(TextPosition const& position, StringView text, Client const* client)
{
TextPosition cursor = position;
Utf8View utf8_view(text);
@@ -893,7 +893,7 @@ TextPosition TextDocument::insert_at(const TextPosition& position, StringView te
return cursor;
}
-TextPosition TextDocument::insert_at(const TextPosition& position, u32 code_point, const Client*)
+TextPosition TextDocument::insert_at(TextPosition const& position, u32 code_point, Client const*)
{
if (code_point == '\n') {
auto new_line = make<TextDocumentLine>(*this);
@@ -909,7 +909,7 @@ TextPosition TextDocument::insert_at(const TextPosition& position, u32 code_poin
}
}
-void TextDocument::remove(const TextRange& unnormalized_range)
+void TextDocument::remove(TextRange const& unnormalized_range)
{
if (!unnormalized_range.is_valid())
return;
@@ -970,7 +970,7 @@ TextRange TextDocument::range_for_entire_line(size_t line_index) const
return { { line_index, 0 }, { line_index, line(line_index).length() } };
}
-const TextDocumentSpan* TextDocument::span_at(const TextPosition& position) const
+TextDocumentSpan const* TextDocument::span_at(TextPosition const& position) const
{
for (auto& span : m_spans) {
if (span.range.contains(position))
diff --git a/Userland/Libraries/LibGUI/TextDocument.h b/Userland/Libraries/LibGUI/TextDocument.h
index c574d4b350..afef884465 100644
--- a/Userland/Libraries/LibGUI/TextDocument.h
+++ b/Userland/Libraries/LibGUI/TextDocument.h
@@ -48,7 +48,7 @@ public:
virtual void document_did_remove_all_lines() = 0;
virtual void document_did_change(AllowCallback = AllowCallback::Yes) = 0;
virtual void document_did_set_text(AllowCallback = AllowCallback::Yes) = 0;
- virtual void document_did_set_cursor(const TextPosition&) = 0;
+ virtual void document_did_set_cursor(TextPosition const&) = 0;
virtual void document_did_update_undo_stack() = 0;
virtual bool is_automatic_indentation_enabled() const = 0;
@@ -59,22 +59,22 @@ public:
virtual ~TextDocument() = default;
size_t line_count() const { return m_lines.size(); }
- const TextDocumentLine& line(size_t line_index) const { return m_lines[line_index]; }
+ TextDocumentLine const& line(size_t line_index) const { return m_lines[line_index]; }
TextDocumentLine& line(size_t line_index) { return m_lines[line_index]; }
void set_spans(u32 span_collection_index, Vector<TextDocumentSpan> spans);
bool set_text(StringView, AllowCallback = AllowCallback::Yes);
- const NonnullOwnPtrVector<TextDocumentLine>& lines() const { return m_lines; }
+ NonnullOwnPtrVector<TextDocumentLine> const& lines() const { return m_lines; }
NonnullOwnPtrVector<TextDocumentLine>& lines() { return m_lines; }
bool has_spans() const { return !m_spans.is_empty(); }
Vector<TextDocumentSpan>& spans() { return m_spans; }
- const Vector<TextDocumentSpan>& spans() const { return m_spans; }
+ Vector<TextDocumentSpan> const& spans() const { return m_spans; }
void set_span_at_index(size_t index, TextDocumentSpan span) { m_spans[index] = move(span); }
- const TextDocumentSpan* span_at(const TextPosition&) const;
+ TextDocumentSpan const* span_at(TextPosition const&) const;
void append_line(NonnullOwnPtr<TextDocumentLine>);
void remove_line(size_t line_index);
@@ -87,28 +87,28 @@ public:
void update_views(Badge<TextDocumentLine>);
String text() const;
- String text_in_range(const TextRange&) const;
+ String text_in_range(TextRange const&) const;
Vector<TextRange> find_all(StringView needle, bool regmatch = false, bool match_case = true);
void update_regex_matches(StringView);
- TextRange find_next(StringView, const TextPosition& start = {}, SearchShouldWrap = SearchShouldWrap::Yes, bool regmatch = false, bool match_case = true);
- TextRange find_previous(StringView, const TextPosition& start = {}, SearchShouldWrap = SearchShouldWrap::Yes, bool regmatch = false, bool match_case = true);
+ TextRange find_next(StringView, TextPosition const& start = {}, SearchShouldWrap = SearchShouldWrap::Yes, bool regmatch = false, bool match_case = true);
+ TextRange find_previous(StringView, TextPosition const& start = {}, SearchShouldWrap = SearchShouldWrap::Yes, bool regmatch = false, bool match_case = true);
- TextPosition next_position_after(const TextPosition&, SearchShouldWrap = SearchShouldWrap::Yes) const;
- TextPosition previous_position_before(const TextPosition&, SearchShouldWrap = SearchShouldWrap::Yes) const;
+ TextPosition next_position_after(TextPosition const&, SearchShouldWrap = SearchShouldWrap::Yes) const;
+ TextPosition previous_position_before(TextPosition const&, SearchShouldWrap = SearchShouldWrap::Yes) const;
- u32 code_point_at(const TextPosition&) const;
+ u32 code_point_at(TextPosition const&) const;
TextRange range_for_entire_line(size_t line_index) const;
- Optional<TextDocumentSpan> first_non_skippable_span_before(const TextPosition&) const;
- Optional<TextDocumentSpan> first_non_skippable_span_after(const TextPosition&) const;
+ Optional<TextDocumentSpan> first_non_skippable_span_before(TextPosition const&) const;
+ Optional<TextDocumentSpan> first_non_skippable_span_after(TextPosition const&) const;
- TextPosition first_word_break_before(const TextPosition&, bool start_at_column_before) const;
- TextPosition first_word_break_after(const TextPosition&) const;
+ TextPosition first_word_break_before(TextPosition const&, bool start_at_column_before) const;
+ TextPosition first_word_break_after(TextPosition const&) const;
- TextPosition first_word_before(const TextPosition&, bool start_at_column_before) const;
+ TextPosition first_word_before(TextPosition const&, bool start_at_column_before) const;
void add_to_undo_stack(NonnullOwnPtr<TextDocumentUndoCommand>);
@@ -120,11 +120,11 @@ public:
UndoStack const& undo_stack() const { return m_undo_stack; }
void notify_did_change();
- void set_all_cursors(const TextPosition&);
+ void set_all_cursors(TextPosition const&);
- TextPosition insert_at(const TextPosition&, u32, const Client* = nullptr);
- TextPosition insert_at(const TextPosition&, StringView, const Client* = nullptr);
- void remove(const TextRange&);
+ TextPosition insert_at(TextPosition const&, u32, Client const* = nullptr);
+ TextPosition insert_at(TextPosition const&, StringView, Client const* = nullptr);
+ void remove(TextRange const&);
virtual bool is_code_document() const { return false; }
@@ -163,7 +163,7 @@ public:
String to_utf8() const;
Utf32View view() const { return { code_points(), length() }; }
- const u32* code_points() const { return m_text.data(); }
+ u32 const* code_points() const { return m_text.data(); }
size_t length() const { return m_text.size(); }
bool set_text(TextDocument&, StringView);
void set_text(TextDocument&, Vector<u32>);
@@ -171,7 +171,7 @@ public:
void prepend(TextDocument&, u32);
void insert(TextDocument&, size_t index, u32);
void remove(TextDocument&, size_t index);
- void append(TextDocument&, const u32*, size_t);
+ void append(TextDocument&, u32 const*, size_t);
void truncate(TextDocument&, size_t length);
void clear(TextDocument&);
void remove_range(TextDocument&, size_t start, size_t length);
@@ -192,9 +192,9 @@ class TextDocumentUndoCommand : public Command {
public:
TextDocumentUndoCommand(TextDocument&);
virtual ~TextDocumentUndoCommand() = default;
- virtual void perform_formatting(const TextDocument::Client&) { }
+ virtual void perform_formatting(TextDocument::Client const&) { }
- void execute_from(const TextDocument::Client& client)
+ void execute_from(TextDocument::Client const& client)
{
m_client = &client;
redo();
@@ -203,19 +203,19 @@ public:
protected:
TextDocument& m_document;
- const TextDocument::Client* m_client { nullptr };
+ TextDocument::Client const* m_client { nullptr };
};
class InsertTextCommand : public TextDocumentUndoCommand {
public:
- InsertTextCommand(TextDocument&, const String&, const TextPosition&);
- virtual void perform_formatting(const TextDocument::Client&) override;
+ InsertTextCommand(TextDocument&, String const&, TextPosition const&);
+ virtual void perform_formatting(TextDocument::Client const&) override;
virtual void undo() override;
virtual void redo() override;
virtual bool merge_with(GUI::Command const&) override;
virtual String action_text() const override;
- const String& text() const { return m_text; }
- const TextRange& range() const { return m_range; }
+ String const& text() const { return m_text; }
+ TextRange const& range() const { return m_range; }
private:
String m_text;
@@ -224,10 +224,10 @@ private:
class RemoveTextCommand : public TextDocumentUndoCommand {
public:
- RemoveTextCommand(TextDocument&, const String&, const TextRange&);
+ RemoveTextCommand(TextDocument&, String const&, TextRange const&);
virtual void undo() override;
virtual void redo() override;
- const TextRange& range() const { return m_range; }
+ TextRange const& range() const { return m_range; }
virtual bool merge_with(GUI::Command const&) override;
virtual String action_text() const override;
diff --git a/Userland/Libraries/LibGUI/TextPosition.h b/Userland/Libraries/LibGUI/TextPosition.h
index e779a02432..c6b0bf0225 100644
--- a/Userland/Libraries/LibGUI/TextPosition.h
+++ b/Userland/Libraries/LibGUI/TextPosition.h
@@ -27,11 +27,11 @@ public:
void set_line(size_t line) { m_line = line; }
void set_column(size_t column) { m_column = column; }
- bool operator==(const TextPosition& other) const { return m_line == other.m_line && m_column == other.m_column; }
- bool operator!=(const TextPosition& other) const { return m_line != other.m_line || m_column != other.m_column; }
- bool operator<(const TextPosition& other) const { return m_line < other.m_line || (m_line == other.m_line && m_column < other.m_column); }
- bool operator>(const TextPosition& other) const { return *this != other && !(*this < other); }
- bool operator>=(const TextPosition& other) const { return *this > other || (*this == other); }
+ bool operator==(TextPosition const& other) const { return m_line == other.m_line && m_column == other.m_column; }
+ bool operator!=(TextPosition const& other) const { return m_line != other.m_line || m_column != other.m_column; }
+ bool operator<(TextPosition const& other) const { return m_line < other.m_line || (m_line == other.m_line && m_column < other.m_column); }
+ bool operator>(TextPosition const& other) const { return *this != other && !(*this < other); }
+ bool operator>=(TextPosition const& other) const { return *this > other || (*this == other); }
private:
size_t m_line { 0xffffffff };
diff --git a/Userland/Libraries/LibGUI/TextRange.h b/Userland/Libraries/LibGUI/TextRange.h
index 736e2baa3d..2e0b7332ab 100644
--- a/Userland/Libraries/LibGUI/TextRange.h
+++ b/Userland/Libraries/LibGUI/TextRange.h
@@ -14,7 +14,7 @@ namespace GUI {
class TextRange {
public:
TextRange() = default;
- TextRange(const TextPosition& start, const TextPosition& end)
+ TextRange(TextPosition const& start, TextPosition const& end)
: m_start(start)
, m_end(end)
{
@@ -29,26 +29,26 @@ public:
TextPosition& start() { return m_start; }
TextPosition& end() { return m_end; }
- const TextPosition& start() const { return m_start; }
- const TextPosition& end() const { return m_end; }
+ TextPosition const& start() const { return m_start; }
+ TextPosition const& end() const { return m_end; }
TextRange normalized() const { return TextRange(normalized_start(), normalized_end()); }
- void set_start(const TextPosition& position) { m_start = position; }
- void set_end(const TextPosition& position) { m_end = position; }
+ void set_start(TextPosition const& position) { m_start = position; }
+ void set_end(TextPosition const& position) { m_end = position; }
- void set(const TextPosition& start, const TextPosition& end)
+ void set(TextPosition const& start, TextPosition const& end)
{
m_start = start;
m_end = end;
}
- bool operator==(const TextRange& other) const
+ bool operator==(TextRange const& other) const
{
return m_start == other.m_start && m_end == other.m_end;
}
- bool contains(const TextPosition& position) const
+ bool contains(TextPosition const& position) const
{
if (!(position.line() > m_start.line() || (position.line() == m_start.line() && position.column() >= m_start.column())))
return false;
diff --git a/Userland/Libraries/LibGUI/Toolbar.cpp b/Userland/Libraries/LibGUI/Toolbar.cpp
index f42865341f..fee9db5daa 100644
--- a/Userland/Libraries/LibGUI/Toolbar.cpp
+++ b/Userland/Libraries/LibGUI/Toolbar.cpp
@@ -56,7 +56,7 @@ private:
set_text(action.text());
set_button_style(Gfx::ButtonStyle::Coolbar);
}
- String tooltip(const Action& action) const
+ String tooltip(Action const& action) const
{
StringBuilder builder;
builder.append(action.text());
diff --git a/Userland/Libraries/LibGUI/TreeView.cpp b/Userland/Libraries/LibGUI/TreeView.cpp
index 50a20e9e94..681ab29094 100644
--- a/Userland/Libraries/LibGUI/TreeView.cpp
+++ b/Userland/Libraries/LibGUI/TreeView.cpp
@@ -21,7 +21,7 @@ struct TreeView::MetadataForIndex {
bool open { false };
};
-TreeView::MetadataForIndex& TreeView::ensure_metadata_for_index(const ModelIndex& index) const
+TreeView::MetadataForIndex& TreeView::ensure_metadata_for_index(ModelIndex const& index) const
{
VERIFY(index.is_valid());
auto it = m_view_metadata.find(index.internal_data());
@@ -44,14 +44,14 @@ TreeView::TreeView()
m_collapse_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/serenity/treeview-collapse.png").release_value_but_fixme_should_propagate_errors();
}
-ModelIndex TreeView::index_at_event_position(const Gfx::IntPoint& a_position, bool& is_toggle) const
+ModelIndex TreeView::index_at_event_position(Gfx::IntPoint const& a_position, bool& is_toggle) const
{
auto position = a_position.translated(0, -column_header().height()).translated(horizontal_scrollbar().value() - frame_thickness(), vertical_scrollbar().value() - frame_thickness());
is_toggle = false;
if (!model())
return {};
ModelIndex result;
- traverse_in_paint_order([&](const ModelIndex& index, const Gfx::IntRect& rect, const Gfx::IntRect& toggle_rect, int) {
+ traverse_in_paint_order([&](ModelIndex const& index, Gfx::IntRect const& rect, Gfx::IntRect const& toggle_rect, int) {
if (toggle_rect.contains(position)) {
result = index;
is_toggle = true;
@@ -86,7 +86,7 @@ void TreeView::doubleclick_event(MouseEvent& event)
}
}
-void TreeView::set_open_state_of_all_in_subtree(const ModelIndex& root, bool open)
+void TreeView::set_open_state_of_all_in_subtree(ModelIndex const& root, bool open)
{
if (root.is_valid()) {
ensure_metadata_for_index(root).open = open;
@@ -103,7 +103,7 @@ void TreeView::set_open_state_of_all_in_subtree(const ModelIndex& root, bool ope
}
}
-void TreeView::expand_all_parents_of(const ModelIndex& index)
+void TreeView::expand_all_parents_of(ModelIndex const& index)
{
if (!model())
return;
@@ -120,7 +120,7 @@ void TreeView::expand_all_parents_of(const ModelIndex& index)
update();
}
-void TreeView::expand_tree(const ModelIndex& root)
+void TreeView::expand_tree(ModelIndex const& root)
{
if (!model())
return;
@@ -130,7 +130,7 @@ void TreeView::expand_tree(const ModelIndex& root)
update();
}
-void TreeView::collapse_tree(const ModelIndex& root)
+void TreeView::collapse_tree(ModelIndex const& root)
{
if (!model())
return;
@@ -140,7 +140,7 @@ void TreeView::collapse_tree(const ModelIndex& root)
update();
}
-void TreeView::toggle_index(const ModelIndex& index)
+void TreeView::toggle_index(ModelIndex const& index)
{
VERIFY(model()->row_count(index));
auto& metadata = ensure_metadata_for_index(index);
@@ -166,7 +166,7 @@ void TreeView::traverse_in_paint_order(Callback callback) const
int y_offset = 0;
int tree_column_x_offset = this->tree_column_x_offset();
- Function<IterationDecision(const ModelIndex&)> traverse_index = [&](const ModelIndex& index) {
+ Function<IterationDecision(ModelIndex const&)> traverse_index = [&](ModelIndex const& index) {
int row_count_at_index = model.row_count(index);
if (index.is_valid()) {
auto& metadata = ensure_metadata_for_index(index);
@@ -234,7 +234,7 @@ void TreeView::paint_event(PaintEvent& event)
int painted_row_index = 0;
- traverse_in_paint_order([&](const ModelIndex& index, const Gfx::IntRect& a_rect, const Gfx::IntRect& a_toggle_rect, int indent_level) {
+ traverse_in_paint_order([&](ModelIndex const& index, Gfx::IntRect const& a_rect, Gfx::IntRect const& a_toggle_rect, int indent_level) {
if (!a_rect.intersects_vertically(visible_content_rect))
return IterationDecision::Continue;
@@ -380,12 +380,12 @@ void TreeView::paint_event(PaintEvent& event)
});
}
-void TreeView::scroll_into_view(const ModelIndex& a_index, bool, bool scroll_vertically)
+void TreeView::scroll_into_view(ModelIndex const& a_index, bool, bool scroll_vertically)
{
if (!a_index.is_valid())
return;
Gfx::IntRect found_rect;
- traverse_in_paint_order([&](const ModelIndex& index, const Gfx::IntRect& rect, const Gfx::IntRect&, int) {
+ traverse_in_paint_order([&](ModelIndex const& index, Gfx::IntRect const& rect, Gfx::IntRect const&, int) {
if (index == a_index) {
found_rect = rect;
return IterationDecision::Break;
@@ -582,7 +582,7 @@ void TreeView::move_cursor(CursorMovement movement, SelectionUpdate selection_up
return;
}
case CursorMovement::PageUp: {
- const int items_per_page = visible_content_rect().height() / row_height();
+ int const items_per_page = visible_content_rect().height() / row_height();
auto new_index = cursor_index();
for (int step = 0; step < items_per_page; ++step)
new_index = step_up(new_index);
@@ -591,7 +591,7 @@ void TreeView::move_cursor(CursorMovement movement, SelectionUpdate selection_up
return;
}
case CursorMovement::PageDown: {
- const int items_per_page = visible_content_rect().height() / row_height();
+ int const items_per_page = visible_content_rect().height() / row_height();
auto new_index = cursor_index();
for (int step = 0; step < items_per_page; ++step)
new_index = step_down(new_index);
@@ -609,7 +609,7 @@ void TreeView::move_cursor(CursorMovement movement, SelectionUpdate selection_up
int TreeView::item_count() const
{
int count = 0;
- traverse_in_paint_order([&](const ModelIndex&, const Gfx::IntRect&, const Gfx::IntRect&, int) {
+ traverse_in_paint_order([&](ModelIndex const&, Gfx::IntRect const&, Gfx::IntRect const&, int) {
++count;
return IterationDecision::Continue;
});
@@ -632,7 +632,7 @@ void TreeView::auto_resize_column(int column)
int column_width = header_width;
bool is_empty = true;
- traverse_in_paint_order([&](const ModelIndex& index, const Gfx::IntRect&, const Gfx::IntRect&, int indent_level) {
+ traverse_in_paint_order([&](ModelIndex const& index, Gfx::IntRect const&, Gfx::IntRect const&, int indent_level) {
auto cell_data = model.index(index.row(), column, index.parent()).data();
int cell_width = 0;
if (cell_data.is_icon()) {
@@ -675,7 +675,7 @@ void TreeView::update_column_sizes()
if (column == m_key_column && model.is_column_sortable(column))
header_width += font().width(" \xE2\xAC\x86");
int column_width = header_width;
- traverse_in_paint_order([&](const ModelIndex& index, const Gfx::IntRect&, const Gfx::IntRect&, int) {
+ traverse_in_paint_order([&](ModelIndex const& index, Gfx::IntRect const&, Gfx::IntRect const&, int) {
auto cell_data = model.index(index.row(), column, index.parent()).data();
int cell_width = 0;
if (cell_data.is_icon()) {
@@ -696,7 +696,7 @@ void TreeView::update_column_sizes()
if (tree_column == m_key_column && model.is_column_sortable(tree_column))
tree_column_header_width += font().width(" \xE2\xAC\x86");
int tree_column_width = tree_column_header_width;
- traverse_in_paint_order([&](const ModelIndex& index, const Gfx::IntRect&, const Gfx::IntRect&, int indent_level) {
+ traverse_in_paint_order([&](ModelIndex const& index, Gfx::IntRect const&, Gfx::IntRect const&, int indent_level) {
auto cell_data = model.index(index.row(), tree_column, index.parent()).data();
int cell_width = 0;
if (cell_data.is_valid()) {
diff --git a/Userland/Libraries/LibGUI/TreeView.h b/Userland/Libraries/LibGUI/TreeView.h
index abb9c40436..75ba2abe5d 100644
--- a/Userland/Libraries/LibGUI/TreeView.h
+++ b/Userland/Libraries/LibGUI/TreeView.h
@@ -17,17 +17,17 @@ class TreeView : public AbstractTableView {
public:
virtual ~TreeView() override = default;
- virtual void scroll_into_view(const ModelIndex&, bool scroll_horizontally, bool scroll_vertically) override;
+ virtual void scroll_into_view(ModelIndex const&, bool scroll_horizontally, bool scroll_vertically) override;
virtual int item_count() const override;
- virtual void toggle_index(const ModelIndex&) override;
+ virtual void toggle_index(ModelIndex const&) override;
- void expand_tree(const ModelIndex& root = {});
- void collapse_tree(const ModelIndex& root = {});
+ void expand_tree(ModelIndex const& root = {});
+ void collapse_tree(ModelIndex const& root = {});
- void expand_all_parents_of(const ModelIndex&);
+ void expand_all_parents_of(ModelIndex const&);
- Function<void(const ModelIndex&, const bool)> on_toggle;
+ Function<void(ModelIndex const&, bool const)> on_toggle;
void set_should_fill_selected_rows(bool fill) { m_should_fill_selected_rows = fill; }
bool should_fill_selected_rows() const { return m_should_fill_selected_rows; }
@@ -51,7 +51,7 @@ protected:
virtual void move_cursor(CursorMovement, SelectionUpdate) override;
private:
- virtual ModelIndex index_at_event_position(const Gfx::IntPoint&, bool& is_toggle) const override;
+ virtual ModelIndex index_at_event_position(Gfx::IntPoint const&, bool& is_toggle) const override;
int row_height() const { return 16; }
int max_item_width() const { return frame_inner_rect().width(); }
@@ -69,8 +69,8 @@ private:
struct MetadataForIndex;
- MetadataForIndex& ensure_metadata_for_index(const ModelIndex&) const;
- void set_open_state_of_all_in_subtree(const ModelIndex& root, bool open);
+ MetadataForIndex& ensure_metadata_for_index(ModelIndex const&) const;
+ void set_open_state_of_all_in_subtree(ModelIndex const& root, bool open);
mutable HashMap<void*, NonnullOwnPtr<MetadataForIndex>> m_view_metadata;
diff --git a/Userland/Libraries/LibGUI/ValueSlider.cpp b/Userland/Libraries/LibGUI/ValueSlider.cpp
index 6034361e07..c7bc87aa08 100644
--- a/Userland/Libraries/LibGUI/ValueSlider.cpp
+++ b/Userland/Libraries/LibGUI/ValueSlider.cpp
@@ -21,7 +21,7 @@ ValueSlider::ValueSlider(Gfx::Orientation orientation, String suffix)
: AbstractSlider(orientation)
, m_suffix(move(suffix))
{
- //FIXME: Implement vertical mode
+ // FIXME: Implement vertical mode
VERIFY(orientation == Orientation::Horizontal);
set_fixed_height(20);
@@ -132,7 +132,7 @@ Gfx::IntRect ValueSlider::knob_rect() const
return knob_rect;
}
-int ValueSlider::value_at(const Gfx::IntPoint& position) const
+int ValueSlider::value_at(Gfx::IntPoint const& position) const
{
if (position.x() < bar_rect().left())
return min();
diff --git a/Userland/Libraries/LibGUI/ValueSlider.h b/Userland/Libraries/LibGUI/ValueSlider.h
index 91aba6ab19..8b0291a0ae 100644
--- a/Userland/Libraries/LibGUI/ValueSlider.h
+++ b/Userland/Libraries/LibGUI/ValueSlider.h
@@ -39,7 +39,7 @@ private:
explicit ValueSlider(Gfx::Orientation = Gfx::Orientation::Horizontal, String suffix = "");
String formatted_value() const;
- int value_at(const Gfx::IntPoint& position) const;
+ int value_at(Gfx::IntPoint const& position) const;
Gfx::IntRect bar_rect() const;
Gfx::IntRect knob_rect() const;
diff --git a/Userland/Libraries/LibGUI/Variant.cpp b/Userland/Libraries/LibGUI/Variant.cpp
index a519a92354..8649705b07 100644
--- a/Userland/Libraries/LibGUI/Variant.cpp
+++ b/Userland/Libraries/LibGUI/Variant.cpp
@@ -12,7 +12,7 @@
namespace GUI {
-const char* to_string(Variant::Type type)
+char const* to_string(Variant::Type type)
{
switch (type) {
case Variant::Type::Invalid:
@@ -162,12 +162,12 @@ Variant::Variant(bool value)
m_value.as_bool = value;
}
-Variant::Variant(const char* cstring)
+Variant::Variant(char const* cstring)
: Variant(String(cstring))
{
}
-Variant::Variant(const FlyString& value)
+Variant::Variant(FlyString const& value)
: Variant(String(value.impl()))
{
}
@@ -177,14 +177,14 @@ Variant::Variant(StringView value)
{
}
-Variant::Variant(const String& value)
+Variant::Variant(String const& value)
: m_type(Type::String)
{
m_value.as_string = const_cast<StringImpl*>(value.impl());
AK::ref_if_not_null(m_value.as_string);
}
-Variant::Variant(const JsonValue& value)
+Variant::Variant(JsonValue const& value)
{
if (value.is_null()) {
m_value.as_string = nullptr;
@@ -231,7 +231,7 @@ Variant::Variant(const JsonValue& value)
VERIFY_NOT_REACHED();
}
-Variant::Variant(const Gfx::Bitmap& value)
+Variant::Variant(Gfx::Bitmap const& value)
: m_type(Type::Bitmap)
{
m_value.as_bitmap = const_cast<Gfx::Bitmap*>(&value);
@@ -245,7 +245,7 @@ Variant::Variant(const GUI::Icon& value)
AK::ref_if_not_null(m_value.as_icon);
}
-Variant::Variant(const Gfx::Font& value)
+Variant::Variant(Gfx::Font const& value)
: m_type(Type::Font)
{
m_value.as_font = &const_cast<Gfx::Font&>(value);
@@ -258,25 +258,25 @@ Variant::Variant(Color color)
m_value.as_color = color.value();
}
-Variant::Variant(const Gfx::IntPoint& point)
+Variant::Variant(Gfx::IntPoint const& point)
: m_type(Type::Point)
{
m_value.as_point = { point.x(), point.y() };
}
-Variant::Variant(const Gfx::IntSize& size)
+Variant::Variant(Gfx::IntSize const& size)
: m_type(Type::Size)
{
m_value.as_size = { size.width(), size.height() };
}
-Variant::Variant(const Gfx::IntRect& rect)
+Variant::Variant(Gfx::IntRect const& rect)
: m_type(Type::Rect)
{
- m_value.as_rect = (const RawRect&)rect;
+ m_value.as_rect = (RawRect const&)rect;
}
-Variant& Variant::operator=(const Variant& other)
+Variant& Variant::operator=(Variant const& other)
{
if (&other == this)
return *this;
@@ -294,7 +294,7 @@ Variant& Variant::operator=(Variant&& other)
return *this;
}
-Variant::Variant(const Variant& other)
+Variant::Variant(Variant const& other)
{
copy_from(other);
}
@@ -307,7 +307,7 @@ void Variant::move_from(Variant&& other)
other.m_value.as_string = nullptr;
}
-void Variant::copy_from(const Variant& other)
+void Variant::copy_from(Variant const& other)
{
VERIFY(!is_valid());
m_type = other.m_type;
@@ -381,7 +381,7 @@ void Variant::copy_from(const Variant& other)
}
}
-bool Variant::operator==(const Variant& other) const
+bool Variant::operator==(Variant const& other) const
{
if (m_type != other.m_type)
return to_string() == other.to_string();
@@ -432,7 +432,7 @@ bool Variant::operator==(const Variant& other) const
VERIFY_NOT_REACHED();
}
-bool Variant::operator<(const Variant& other) const
+bool Variant::operator<(Variant const& other) const
{
if (m_type != other.m_type)
return to_string() < other.to_string();
diff --git a/Userland/Libraries/LibGUI/Variant.h b/Userland/Libraries/LibGUI/Variant.h
index 8862bfa27f..1789a8fd1b 100644
--- a/Userland/Libraries/LibGUI/Variant.h
+++ b/Userland/Libraries/LibGUI/Variant.h
@@ -24,27 +24,27 @@ public:
Variant(i64);
Variant(u32);
Variant(u64);
- Variant(const char*);
+ Variant(char const*);
Variant(StringView);
- Variant(const String&);
- Variant(const FlyString&);
- Variant(const Gfx::Bitmap&);
+ Variant(String const&);
+ Variant(FlyString const&);
+ Variant(Gfx::Bitmap const&);
Variant(const GUI::Icon&);
- Variant(const Gfx::IntPoint&);
- Variant(const Gfx::IntSize&);
- Variant(const Gfx::IntRect&);
- Variant(const Gfx::Font&);
+ Variant(Gfx::IntPoint const&);
+ Variant(Gfx::IntSize const&);
+ Variant(Gfx::IntRect const&);
+ Variant(Gfx::Font const&);
Variant(const Gfx::TextAlignment);
Variant(const Gfx::ColorRole);
Variant(const Gfx::AlignmentRole);
Variant(const Gfx::FlagRole);
Variant(const Gfx::MetricRole);
Variant(const Gfx::PathRole);
- Variant(const JsonValue&);
+ Variant(JsonValue const&);
Variant(Color);
- Variant(const Variant&);
- Variant& operator=(const Variant&);
+ Variant(Variant const&);
+ Variant& operator=(Variant const&);
Variant(Variant&&) = delete;
Variant& operator=(Variant&&);
@@ -220,7 +220,7 @@ public:
return m_value.as_string;
}
- const Gfx::Bitmap& as_bitmap() const
+ Gfx::Bitmap const& as_bitmap() const
{
VERIFY(type() == Type::Bitmap);
return *m_value.as_bitmap;
@@ -238,7 +238,7 @@ public:
return Color::from_argb(m_value.as_color);
}
- const Gfx::Font& as_font() const
+ Gfx::Font const& as_font() const
{
VERIFY(type() == Type::Font);
return *m_value.as_font;
@@ -300,11 +300,11 @@ public:
String to_string() const;
- bool operator==(const Variant&) const;
- bool operator<(const Variant&) const;
+ bool operator==(Variant const&) const;
+ bool operator<(Variant const&) const;
private:
- void copy_from(const Variant&);
+ void copy_from(Variant const&);
void move_from(Variant&&);
struct RawPoint {
@@ -348,6 +348,6 @@ private:
Type m_type { Type::Invalid };
};
-const char* to_string(Variant::Type);
+char const* to_string(Variant::Type);
}
diff --git a/Userland/Libraries/LibGUI/VimEditingEngine.cpp b/Userland/Libraries/LibGUI/VimEditingEngine.cpp
index d69c3ed326..a12887a036 100644
--- a/Userland/Libraries/LibGUI/VimEditingEngine.cpp
+++ b/Userland/Libraries/LibGUI/VimEditingEngine.cpp
@@ -773,7 +773,7 @@ CursorWidth VimEditingEngine::cursor_width() const
return m_vim_mode == VimMode::Insert ? CursorWidth::NARROW : CursorWidth::WIDE;
}
-bool VimEditingEngine::on_key(const KeyEvent& event)
+bool VimEditingEngine::on_key(KeyEvent const& event)
{
switch (m_vim_mode) {
case (VimMode::Insert):
@@ -789,7 +789,7 @@ bool VimEditingEngine::on_key(const KeyEvent& event)
return false;
}
-bool VimEditingEngine::on_key_in_insert_mode(const KeyEvent& event)
+bool VimEditingEngine::on_key_in_insert_mode(KeyEvent const& event)
{
if (EditingEngine::on_key(event))
return true;
@@ -819,7 +819,7 @@ bool VimEditingEngine::on_key_in_insert_mode(const KeyEvent& event)
return false;
}
-bool VimEditingEngine::on_key_in_normal_mode(const KeyEvent& event)
+bool VimEditingEngine::on_key_in_normal_mode(KeyEvent const& event)
{
// Ignore auxiliary keypress events.
if (event.key() == KeyCode::Key_LeftShift
@@ -1102,7 +1102,7 @@ bool VimEditingEngine::on_key_in_normal_mode(const KeyEvent& event)
return true;
}
-bool VimEditingEngine::on_key_in_visual_mode(const KeyEvent& event)
+bool VimEditingEngine::on_key_in_visual_mode(KeyEvent const& event)
{
// If the motion state machine requires the next character, feed it.
if (m_motion.should_consume_next_character()) {
diff --git a/Userland/Libraries/LibGUI/VimEditingEngine.h b/Userland/Libraries/LibGUI/VimEditingEngine.h
index 8be34cfbbd..b7216d0892 100644
--- a/Userland/Libraries/LibGUI/VimEditingEngine.h
+++ b/Userland/Libraries/LibGUI/VimEditingEngine.h
@@ -146,7 +146,7 @@ class VimEditingEngine final : public EditingEngine {
public:
virtual CursorWidth cursor_width() const override;
- virtual bool on_key(const KeyEvent& event) override;
+ virtual bool on_key(KeyEvent const& event) override;
private:
enum VimMode {
@@ -184,9 +184,9 @@ private:
void move_to_previous_empty_lines_block();
void move_to_next_empty_lines_block();
- bool on_key_in_insert_mode(const KeyEvent& event);
- bool on_key_in_normal_mode(const KeyEvent& event);
- bool on_key_in_visual_mode(const KeyEvent& event);
+ bool on_key_in_insert_mode(KeyEvent const& event);
+ bool on_key_in_normal_mode(KeyEvent const& event);
+ bool on_key_in_visual_mode(KeyEvent const& event);
virtual EngineType engine_type() const override { return EngineType::Vim; }
};
diff --git a/Userland/Libraries/LibGUI/Widget.cpp b/Userland/Libraries/LibGUI/Widget.cpp
index 7686960b5e..bc1036a145 100644
--- a/Userland/Libraries/LibGUI/Widget.cpp
+++ b/Userland/Libraries/LibGUI/Widget.cpp
@@ -217,7 +217,7 @@ void Widget::child_event(Core::ChildEvent& event)
return Core::Object::child_event(event);
}
-void Widget::set_relative_rect(const Gfx::IntRect& a_rect)
+void Widget::set_relative_rect(Gfx::IntRect const& a_rect)
{
// Get rid of negative width/height values.
Gfx::IntRect rect = {
@@ -596,7 +596,7 @@ void Widget::update()
update(rect());
}
-void Widget::update(const Gfx::IntRect& rect)
+void Widget::update(Gfx::IntRect const& rect)
{
if (!is_visible())
return;
@@ -653,7 +653,7 @@ Gfx::IntRect Widget::screen_relative_rect() const
return window_relative_rect().translated(window_position);
}
-Widget* Widget::child_at(const Gfx::IntPoint& point) const
+Widget* Widget::child_at(Gfx::IntPoint const& point) const
{
for (int i = children().size() - 1; i >= 0; --i) {
if (!is<Widget>(children()[i]))
@@ -667,7 +667,7 @@ Widget* Widget::child_at(const Gfx::IntPoint& point) const
return nullptr;
}
-Widget::HitTestResult Widget::hit_test(const Gfx::IntPoint& position, ShouldRespectGreediness should_respect_greediness)
+Widget::HitTestResult Widget::hit_test(Gfx::IntPoint const& position, ShouldRespectGreediness should_respect_greediness)
{
if (should_respect_greediness == ShouldRespectGreediness::Yes && is_greedy_for_hits())
return { this, position };
@@ -737,7 +737,7 @@ void Widget::set_focus(bool focus, FocusSource source)
}
}
-void Widget::set_font(const Gfx::Font* font)
+void Widget::set_font(Gfx::Font const* font)
{
if (m_font.ptr() == font)
return;
@@ -754,7 +754,7 @@ void Widget::set_font(const Gfx::Font* font)
update();
}
-void Widget::set_font_family(const String& family)
+void Widget::set_font_family(String const& family)
{
set_font(Gfx::FontDatabase::the().get(family, m_font->presentation_size(), m_font->weight(), m_font->slope()));
}
@@ -777,7 +777,7 @@ void Widget::set_font_fixed_width(bool fixed_width)
set_font(Gfx::FontDatabase::the().get(Gfx::FontDatabase::the().default_font().family(), m_font->presentation_size(), m_font->weight(), m_font->slope()));
}
-void Widget::set_min_size(const Gfx::IntSize& size)
+void Widget::set_min_size(Gfx::IntSize const& size)
{
if (m_min_size == size)
return;
@@ -785,7 +785,7 @@ void Widget::set_min_size(const Gfx::IntSize& size)
invalidate_layout();
}
-void Widget::set_max_size(const Gfx::IntSize& size)
+void Widget::set_max_size(Gfx::IntSize const& size)
{
if (m_max_size == size)
return;
@@ -901,7 +901,7 @@ bool Widget::is_backmost() const
return &parent->children().first() == this;
}
-Action* Widget::action_for_key_event(const KeyEvent& event)
+Action* Widget::action_for_key_event(KeyEvent const& event)
{
Shortcut shortcut(event.modifiers(), (KeyCode)event.key());
@@ -970,7 +970,7 @@ Vector<Widget&> Widget::child_widgets() const
return widgets;
}
-void Widget::set_palette(const Palette& palette)
+void Widget::set_palette(Palette const& palette)
{
m_palette = palette.impl();
update();
@@ -1003,7 +1003,7 @@ void Widget::did_end_inspection()
update();
}
-void Widget::set_grabbable_margins(const Margins& margins)
+void Widget::set_grabbable_margins(Margins const& margins)
{
if (m_grabbable_margins == margins)
return;
@@ -1061,13 +1061,13 @@ void Widget::set_override_cursor(AK::Variant<Gfx::StandardCursor, NonnullRefPtr<
bool Widget::load_from_gml(StringView gml_string)
{
- return load_from_gml(gml_string, [](const String& class_name) -> RefPtr<Core::Object> {
+ return load_from_gml(gml_string, [](String const& class_name) -> RefPtr<Core::Object> {
dbgln("Class '{}' not registered", class_name);
return nullptr;
});
}
-bool Widget::load_from_gml(StringView gml_string, RefPtr<Core::Object> (*unregistered_child_handler)(const String&))
+bool Widget::load_from_gml(StringView gml_string, RefPtr<Core::Object> (*unregistered_child_handler)(String const&))
{
auto value = GML::parse_gml(gml_string);
if (value.is_error()) {
@@ -1078,7 +1078,7 @@ bool Widget::load_from_gml(StringView gml_string, RefPtr<Core::Object> (*unregis
return load_from_gml_ast(value.release_value(), unregistered_child_handler);
}
-bool Widget::load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::Object> (*unregistered_child_handler)(const String&))
+bool Widget::load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::Object> (*unregistered_child_handler)(String const&))
{
if (is<GUI::GML::GMLFile>(ast.ptr()))
return load_from_gml_ast(static_ptr_cast<GUI::GML::GMLFile>(ast)->main_class(), unregistered_child_handler);
diff --git a/Userland/Libraries/LibGUI/Widget.h b/Userland/Libraries/LibGUI/Widget.h
index f6fb217c2e..bda60d956d 100644
--- a/Userland/Libraries/LibGUI/Widget.h
+++ b/Userland/Libraries/LibGUI/Widget.h
@@ -61,7 +61,7 @@ public:
virtual ~Widget() override;
Layout* layout() { return m_layout.ptr(); }
- const Layout* layout() const { return m_layout.ptr(); }
+ Layout const* layout() const { return m_layout.ptr(); }
void set_layout(NonnullRefPtr<Layout>);
template<class T, class... Args>
@@ -81,7 +81,7 @@ public:
}
Gfx::IntSize min_size() const { return m_min_size; }
- void set_min_size(const Gfx::IntSize&);
+ void set_min_size(Gfx::IntSize const&);
void set_min_size(int width, int height) { set_min_size({ width, height }); }
int min_width() const { return m_min_size.width(); }
@@ -90,7 +90,7 @@ public:
void set_min_height(int height) { set_min_size(min_width(), height); }
Gfx::IntSize max_size() const { return m_max_size; }
- void set_max_size(const Gfx::IntSize&);
+ void set_max_size(Gfx::IntSize const&);
void set_max_size(int width, int height) { set_max_size({ width, height }); }
int max_width() const { return m_max_size.width(); }
@@ -98,7 +98,7 @@ public:
void set_max_width(int width) { set_max_size(width, max_height()); }
void set_max_height(int height) { set_max_size(max_width(), height); }
- void set_fixed_size(const Gfx::IntSize& size)
+ void set_fixed_size(Gfx::IntSize const& size)
{
set_min_size(size);
set_max_size(size);
@@ -154,7 +154,7 @@ public:
// Invalidate the widget (or an area thereof), causing a repaint to happen soon.
void update();
- void update(const Gfx::IntRect&);
+ void update(Gfx::IntRect const&);
// Repaint the widget (or an area thereof) immediately.
void repaint();
@@ -163,13 +163,13 @@ public:
bool is_focused() const;
void set_focus(bool, FocusSource = FocusSource::Programmatic);
- Function<void(const bool, const FocusSource)> on_focus_change;
+ Function<void(bool const, const FocusSource)> on_focus_change;
// Returns true if this widget or one of its descendants is focused.
bool has_focus_within() const;
Widget* focus_proxy() { return m_focus_proxy; }
- const Widget* focus_proxy() const { return m_focus_proxy; }
+ Widget const* focus_proxy() const { return m_focus_proxy; }
void set_focus_proxy(Widget*);
void set_focus_policy(FocusPolicy policy);
@@ -183,10 +183,10 @@ public:
WeakPtr<Widget> widget;
Gfx::IntPoint local_position;
};
- HitTestResult hit_test(const Gfx::IntPoint&, ShouldRespectGreediness = ShouldRespectGreediness::Yes);
- Widget* child_at(const Gfx::IntPoint&) const;
+ HitTestResult hit_test(Gfx::IntPoint const&, ShouldRespectGreediness = ShouldRespectGreediness::Yes);
+ Widget* child_at(Gfx::IntPoint const&) const;
- void set_relative_rect(const Gfx::IntRect&);
+ void set_relative_rect(Gfx::IntRect const&);
void set_relative_rect(int x, int y, int width, int height) { set_relative_rect({ x, y, width, height }); }
void set_x(int x) { set_relative_rect(x, y(), width(), height()); }
@@ -194,13 +194,13 @@ public:
void set_width(int width) { set_relative_rect(x(), y(), width, height()); }
void set_height(int height) { set_relative_rect(x(), y(), width(), height); }
- void move_to(const Gfx::IntPoint& point) { set_relative_rect({ point, relative_rect().size() }); }
+ void move_to(Gfx::IntPoint const& point) { set_relative_rect({ point, relative_rect().size() }); }
void move_to(int x, int y) { move_to({ x, y }); }
- void resize(const Gfx::IntSize& size) { set_relative_rect({ relative_rect().location(), size }); }
+ void resize(Gfx::IntSize const& size) { set_relative_rect({ relative_rect().location(), size }); }
void resize(int width, int height) { resize({ width, height }); }
void move_by(int x, int y) { move_by({ x, y }); }
- void move_by(const Gfx::IntPoint& delta) { set_relative_rect({ relative_position().translated(delta), size() }); }
+ void move_by(Gfx::IntPoint const& delta) { set_relative_rect({ relative_position().translated(delta), size() }); }
Gfx::ColorRole background_role() const { return m_background_role; }
void set_background_role(Gfx::ColorRole);
@@ -217,7 +217,7 @@ public:
return m_window;
}
- const Window* window() const
+ Window const* window() const
{
if (auto* pw = parent_widget())
return pw->window();
@@ -227,17 +227,17 @@ public:
void set_window(Window*);
Widget* parent_widget();
- const Widget* parent_widget() const;
+ Widget const* parent_widget() const;
void set_fill_with_background_color(bool b) { m_fill_with_background_color = b; }
bool fill_with_background_color() const { return m_fill_with_background_color; }
- const Gfx::Font& font() const { return *m_font; }
+ Gfx::Font const& font() const { return *m_font; }
- void set_font(const Gfx::Font*);
- void set_font(const Gfx::Font& font) { set_font(&font); }
+ void set_font(Gfx::Font const*);
+ void set_font(Gfx::Font const& font) { set_font(&font); }
- void set_font_family(const String&);
+ void set_font_family(String const&);
void set_font_size(unsigned);
void set_font_weight(unsigned);
void set_font_fixed_width(bool);
@@ -259,7 +259,7 @@ public:
bool is_frontmost() const;
bool is_backmost() const;
- Action* action_for_key_event(const KeyEvent&);
+ Action* action_for_key_event(KeyEvent const&);
template<typename Callback>
void for_each_child_widget(Callback callback)
@@ -276,10 +276,10 @@ public:
void do_layout();
Gfx::Palette palette() const;
- void set_palette(const Gfx::Palette&);
+ void set_palette(Gfx::Palette const&);
- const Margins& grabbable_margins() const { return m_grabbable_margins; }
- void set_grabbable_margins(const Margins&);
+ Margins const& grabbable_margins() const { return m_grabbable_margins; }
+ void set_grabbable_margins(Margins const&);
Gfx::IntRect relative_non_grabbable_rect() const;
@@ -295,7 +295,7 @@ public:
void set_override_cursor(AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>>);
bool load_from_gml(StringView);
- bool load_from_gml(StringView, RefPtr<Core::Object> (*unregistered_child_handler)(const String&));
+ bool load_from_gml(StringView, RefPtr<Core::Object> (*unregistered_child_handler)(String const&));
void set_shrink_to_fit(bool);
bool is_shrink_to_fit() const { return m_shrink_to_fit; }
@@ -303,7 +303,7 @@ public:
bool has_pending_drop() const;
// In order for others to be able to call this, it needs to be public.
- virtual bool load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::Object> (*unregistered_child_handler)(const String&));
+ virtual bool load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::Object> (*unregistered_child_handler)(String const&));
protected:
Widget();
@@ -403,7 +403,7 @@ inline Widget* Widget::parent_widget()
return &verify_cast<Widget>(*parent());
return nullptr;
}
-inline const Widget* Widget::parent_widget() const
+inline Widget const* Widget::parent_widget() const
{
if (parent() && is<Widget>(*parent()))
return &verify_cast<const Widget>(*parent());
diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp
index 1a7bf2aa79..7035d39c38 100644
--- a/Userland/Libraries/LibGUI/Window.cpp
+++ b/Userland/Libraries/LibGUI/Window.cpp
@@ -43,7 +43,7 @@ public:
}
Gfx::Bitmap& bitmap() { return *m_bitmap; }
- const Gfx::Bitmap& bitmap() const { return *m_bitmap; }
+ Gfx::Bitmap const& bitmap() const { return *m_bitmap; }
Gfx::IntSize size() const { return m_bitmap->size(); }
@@ -255,7 +255,7 @@ Gfx::IntRect Window::rect() const
return ConnectionToWindowServer::the().get_window_rect(m_window_id);
}
-void Window::set_rect(const Gfx::IntRect& a_rect)
+void Window::set_rect(Gfx::IntRect const& a_rect)
{
if (a_rect.location() != m_rect_when_windowless.location()) {
m_moved_by_client = true;
@@ -284,7 +284,7 @@ Gfx::IntSize Window::minimum_size() const
return ConnectionToWindowServer::the().get_window_minimum_size(m_window_id);
}
-void Window::set_minimum_size(const Gfx::IntSize& size)
+void Window::set_minimum_size(Gfx::IntSize const& size)
{
m_minimum_size_modified = true;
m_minimum_size_when_windowless = size;
@@ -298,7 +298,7 @@ void Window::center_on_screen()
set_rect(rect().centered_within(Desktop::the().rect()));
}
-void Window::center_within(const Window& other)
+void Window::center_within(Window const& other)
{
if (this == &other)
return;
@@ -688,7 +688,7 @@ void Window::force_update()
ConnectionToWindowServer::the().async_invalidate_rect(m_window_id, { { 0, 0, rect.width(), rect.height() } }, true);
}
-void Window::update(const Gfx::IntRect& a_rect)
+void Window::update(Gfx::IntRect const& a_rect)
{
if (!is_visible())
return;
@@ -847,7 +847,7 @@ void Window::set_current_backing_store(WindowBackingStore& backing_store, bool f
ConnectionToWindowServer::the().set_window_backing_store(m_window_id, 32, bitmap.pitch(), bitmap.anonymous_buffer().fd(), backing_store.serial(), bitmap.has_alpha_channel(), bitmap.size(), flush_immediately);
}
-void Window::flip(const Vector<Gfx::IntRect, 32>& dirty_rects)
+void Window::flip(Vector<Gfx::IntRect, 32> const& dirty_rects)
{
swap(m_front_store, m_back_store);
@@ -869,7 +869,7 @@ void Window::flip(const Vector<Gfx::IntRect, 32>& dirty_rects)
m_back_store->bitmap().set_volatile();
}
-OwnPtr<WindowBackingStore> Window::create_backing_store(const Gfx::IntSize& size)
+OwnPtr<WindowBackingStore> Window::create_backing_store(Gfx::IntSize const& size)
{
auto format = m_has_alpha_channel ? Gfx::BitmapFormat::BGRA8888 : Gfx::BitmapFormat::BGRx8888;
@@ -911,7 +911,7 @@ void Window::applet_area_rect_change_event(AppletAreaRectChangeEvent&)
{
}
-void Window::set_icon(const Gfx::Bitmap* icon)
+void Window::set_icon(Gfx::Bitmap const* icon)
{
if (m_icon == icon)
return;
@@ -1096,7 +1096,7 @@ void Window::notify_state_changed(Badge<ConnectionToWindowServer>, bool minimize
}
}
-Action* Window::action_for_key_event(const KeyEvent& event)
+Action* Window::action_for_key_event(KeyEvent const& event)
{
Shortcut shortcut(event.modifiers(), (KeyCode)event.key());
Action* found_action = nullptr;
@@ -1110,7 +1110,7 @@ Action* Window::action_for_key_event(const KeyEvent& event)
return found_action;
}
-void Window::set_base_size(const Gfx::IntSize& base_size)
+void Window::set_base_size(Gfx::IntSize const& base_size)
{
if (m_base_size == base_size)
return;
@@ -1119,7 +1119,7 @@ void Window::set_base_size(const Gfx::IntSize& base_size)
ConnectionToWindowServer::the().async_set_window_base_size_and_size_increment(m_window_id, m_base_size, m_size_increment);
}
-void Window::set_size_increment(const Gfx::IntSize& size_increment)
+void Window::set_size_increment(Gfx::IntSize const& size_increment)
{
if (m_size_increment == size_increment)
return;
@@ -1128,7 +1128,7 @@ void Window::set_size_increment(const Gfx::IntSize& size_increment)
ConnectionToWindowServer::the().async_set_window_base_size_and_size_increment(m_window_id, m_base_size, m_size_increment);
}
-void Window::set_resize_aspect_ratio(const Optional<Gfx::IntSize>& ratio)
+void Window::set_resize_aspect_ratio(Optional<Gfx::IntSize> const& ratio)
{
if (m_resize_aspect_ratio == ratio)
return;
@@ -1219,7 +1219,7 @@ Menu& Window::add_menu(String name)
return *menu;
}
-void Window::flash_menubar_menu_for(const MenuItem& menu_item)
+void Window::flash_menubar_menu_for(MenuItem const& menu_item)
{
auto menu_id = menu_item.menu_id();
if (menu_id < 0)
diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h
index 102d834eb7..d8c10ba877 100644
--- a/Userland/Libraries/LibGUI/Window.h
+++ b/Userland/Libraries/LibGUI/Window.h
@@ -93,23 +93,23 @@ public:
Gfx::IntRect rect() const;
Gfx::IntRect applet_rect_on_screen() const;
Gfx::IntSize size() const { return rect().size(); }
- void set_rect(const Gfx::IntRect&);
+ void set_rect(Gfx::IntRect const&);
void set_rect(int x, int y, int width, int height) { set_rect({ x, y, width, height }); }
Gfx::IntPoint position() const { return rect().location(); }
Gfx::IntSize minimum_size() const;
- void set_minimum_size(const Gfx::IntSize&);
+ void set_minimum_size(Gfx::IntSize const&);
void set_minimum_size(int width, int height) { set_minimum_size({ width, height }); }
void move_to(int x, int y) { move_to({ x, y }); }
- void move_to(const Gfx::IntPoint& point) { set_rect({ point, size() }); }
+ void move_to(Gfx::IntPoint const& point) { set_rect({ point, size() }); }
void resize(int width, int height) { resize({ width, height }); }
- void resize(const Gfx::IntSize& size) { set_rect({ position(), size }); }
+ void resize(Gfx::IntSize const& size) { set_rect({ position(), size }); }
void center_on_screen();
- void center_within(const Window&);
+ void center_within(Window const&);
virtual void event(Core::Event&) override;
@@ -128,7 +128,7 @@ public:
void start_interactive_resize();
Widget* main_widget() { return m_main_widget; }
- const Widget* main_widget() const { return m_main_widget; }
+ Widget const* main_widget() const { return m_main_widget; }
void set_main_widget(Widget*);
template<class T, class... Args>
@@ -152,37 +152,37 @@ public:
void set_default_return_key_widget(Widget*);
Widget* focused_widget() { return m_focused_widget; }
- const Widget* focused_widget() const { return m_focused_widget; }
+ Widget const* focused_widget() const { return m_focused_widget; }
void set_focused_widget(Widget*, FocusSource = FocusSource::Programmatic);
void update();
- void update(const Gfx::IntRect&);
+ void update(Gfx::IntRect const&);
void set_automatic_cursor_tracking_widget(Widget*);
Widget* automatic_cursor_tracking_widget() { return m_automatic_cursor_tracking_widget.ptr(); }
- const Widget* automatic_cursor_tracking_widget() const { return m_automatic_cursor_tracking_widget.ptr(); }
+ Widget const* automatic_cursor_tracking_widget() const { return m_automatic_cursor_tracking_widget.ptr(); }
Widget* hovered_widget() { return m_hovered_widget.ptr(); }
- const Widget* hovered_widget() const { return m_hovered_widget.ptr(); }
+ Widget const* hovered_widget() const { return m_hovered_widget.ptr(); }
void set_hovered_widget(Widget*);
Gfx::Bitmap* back_bitmap();
Gfx::IntSize size_increment() const { return m_size_increment; }
- void set_size_increment(const Gfx::IntSize&);
+ void set_size_increment(Gfx::IntSize const&);
Gfx::IntSize base_size() const { return m_base_size; }
- void set_base_size(const Gfx::IntSize&);
- const Optional<Gfx::IntSize>& resize_aspect_ratio() const { return m_resize_aspect_ratio; }
+ void set_base_size(Gfx::IntSize const&);
+ Optional<Gfx::IntSize> const& resize_aspect_ratio() const { return m_resize_aspect_ratio; }
void set_resize_aspect_ratio(int width, int height) { set_resize_aspect_ratio(Gfx::IntSize(width, height)); }
void set_no_resize_aspect_ratio() { set_resize_aspect_ratio({}); }
- void set_resize_aspect_ratio(const Optional<Gfx::IntSize>& ratio);
+ void set_resize_aspect_ratio(Optional<Gfx::IntSize> const& ratio);
void set_cursor(Gfx::StandardCursor);
void set_cursor(NonnullRefPtr<Gfx::Bitmap>);
- void set_icon(const Gfx::Bitmap*);
+ void set_icon(Gfx::Bitmap const*);
void apply_icon();
- const Gfx::Bitmap* icon() const { return m_icon.ptr(); }
+ Gfx::Bitmap const* icon() const { return m_icon.ptr(); }
Vector<Widget&> focusable_widgets(FocusSource) const;
@@ -196,7 +196,7 @@ public:
virtual bool is_visible_for_timer_purposes() const override { return m_visible_for_timer_purposes; }
- Action* action_for_key_event(const KeyEvent&);
+ Action* action_for_key_event(KeyEvent const&);
void did_add_widget(Badge<Widget>, Widget&);
void did_remove_widget(Badge<Widget>, Widget&);
@@ -211,7 +211,7 @@ public:
Menu& add_menu(String name);
ErrorOr<NonnullRefPtr<Menu>> try_add_menu(String name);
- void flash_menubar_menu_for(const MenuItem&);
+ void flash_menubar_menu_for(MenuItem const&);
void flush_pending_paints_immediately();
@@ -249,9 +249,9 @@ private:
void server_did_destroy();
- OwnPtr<WindowBackingStore> create_backing_store(const Gfx::IntSize&);
+ OwnPtr<WindowBackingStore> create_backing_store(Gfx::IntSize const&);
void set_current_backing_store(WindowBackingStore&, bool flush_immediately = false);
- void flip(const Vector<Gfx::IntRect, 32>& dirty_rects);
+ void flip(Vector<Gfx::IntRect, 32> const& dirty_rects);
void force_update();
bool are_cursors_the_same(AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> const&, AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> const&) const;
diff --git a/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp b/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp
index 72f297c761..967671d951 100644
--- a/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp
+++ b/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp
@@ -36,12 +36,12 @@ CoverWizardPage::CoverWizardPage()
m_body_label->set_text_alignment(Gfx::TextAlignment::TopLeft);
}
-void CoverWizardPage::set_header_text(const String& text)
+void CoverWizardPage::set_header_text(String const& text)
{
m_header_label->set_text(text);
}
-void CoverWizardPage::set_body_text(const String& text)
+void CoverWizardPage::set_body_text(String const& text)
{
m_body_label->set_text(text);
}
diff --git a/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.h b/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.h
index 4c7e7c534e..753dd74723 100644
--- a/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.h
+++ b/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.h
@@ -18,8 +18,8 @@ class CoverWizardPage : public AbstractWizardPage {
ImageWidget& banner_image_widget() { return *m_banner_image_widget; }
- void set_header_text(const String& text);
- void set_body_text(const String& text);
+ void set_header_text(String const& text);
+ void set_body_text(String const& text);
private:
explicit CoverWizardPage();
diff --git a/Userland/Libraries/LibGUI/Wizards/WizardPage.cpp b/Userland/Libraries/LibGUI/Wizards/WizardPage.cpp
index a08f5e879f..d67ed97080 100644
--- a/Userland/Libraries/LibGUI/Wizards/WizardPage.cpp
+++ b/Userland/Libraries/LibGUI/Wizards/WizardPage.cpp
@@ -14,7 +14,7 @@
namespace GUI {
-WizardPage::WizardPage(const String& title_text, const String& subtitle_text)
+WizardPage::WizardPage(String const& title_text, String const& subtitle_text)
: AbstractWizardPage()
{
set_layout<VerticalBoxLayout>();
@@ -44,12 +44,12 @@ WizardPage::WizardPage(const String& title_text, const String& subtitle_text)
m_body_widget->layout()->set_margins(20);
}
-void WizardPage::set_page_title(const String& text)
+void WizardPage::set_page_title(String const& text)
{
m_title_label->set_text(text);
}
-void WizardPage::set_page_subtitle(const String& text)
+void WizardPage::set_page_subtitle(String const& text)
{
m_subtitle_label->set_text(text);
}
diff --git a/Userland/Libraries/LibGUI/Wizards/WizardPage.h b/Userland/Libraries/LibGUI/Wizards/WizardPage.h
index b3c5d8e38e..3dfe2430ac 100644
--- a/Userland/Libraries/LibGUI/Wizards/WizardPage.h
+++ b/Userland/Libraries/LibGUI/Wizards/WizardPage.h
@@ -18,11 +18,11 @@ class WizardPage : public AbstractWizardPage {
Widget& body_widget() { return *m_body_widget; };
- void set_page_title(const String& text);
- void set_page_subtitle(const String& text);
+ void set_page_title(String const& text);
+ void set_page_subtitle(String const& text);
private:
- explicit WizardPage(const String& title_text, const String& subtitle_text);
+ explicit WizardPage(String const& title_text, String const& subtitle_text);
RefPtr<Widget> m_body_widget;
diff --git a/Userland/Libraries/LibGemini/Document.h b/Userland/Libraries/LibGemini/Document.h
index 493dbc73fd..578ad24e3e 100644
--- a/Userland/Libraries/LibGemini/Document.h
+++ b/Userland/Libraries/LibGemini/Document.h
@@ -62,7 +62,7 @@ public:
class Link : public Line {
public:
- Link(String line, const Document&);
+ Link(String line, Document const&);
virtual ~Link() override = default;
virtual String render_to_html() const override;
diff --git a/Userland/Libraries/LibGemini/GeminiRequest.cpp b/Userland/Libraries/LibGemini/GeminiRequest.cpp
index 4059ddec1b..eda8439b1d 100644
--- a/Userland/Libraries/LibGemini/GeminiRequest.cpp
+++ b/Userland/Libraries/LibGemini/GeminiRequest.cpp
@@ -18,7 +18,7 @@ ByteBuffer GeminiRequest::to_raw_request() const
return builder.to_byte_buffer();
}
-Optional<GeminiRequest> GeminiRequest::from_raw_request(const ByteBuffer& raw_request)
+Optional<GeminiRequest> GeminiRequest::from_raw_request(ByteBuffer const& raw_request)
{
URL url = StringView(raw_request);
if (!url.is_valid())
diff --git a/Userland/Libraries/LibGemini/GeminiRequest.h b/Userland/Libraries/LibGemini/GeminiRequest.h
index 206ab2ad79..fdfa99739c 100644
--- a/Userland/Libraries/LibGemini/GeminiRequest.h
+++ b/Userland/Libraries/LibGemini/GeminiRequest.h
@@ -23,7 +23,7 @@ public:
ByteBuffer to_raw_request() const;
- static Optional<GeminiRequest> from_raw_request(const ByteBuffer&);
+ static Optional<GeminiRequest> from_raw_request(ByteBuffer const&);
private:
URL m_url;
diff --git a/Userland/Libraries/LibGemini/Job.cpp b/Userland/Libraries/LibGemini/Job.cpp
index 3051b626eb..5696a47632 100644
--- a/Userland/Libraries/LibGemini/Job.cpp
+++ b/Userland/Libraries/LibGemini/Job.cpp
@@ -12,7 +12,7 @@
namespace Gemini {
-Job::Job(const GeminiRequest& request, Core::Stream::Stream& output_stream)
+Job::Job(GeminiRequest const& request, Core::Stream::Stream& output_stream)
: Core::NetworkJob(output_stream)
, m_request(request)
{
diff --git a/Userland/Libraries/LibGemini/Job.h b/Userland/Libraries/LibGemini/Job.h
index ca9342eb0c..7593f5345e 100644
--- a/Userland/Libraries/LibGemini/Job.h
+++ b/Userland/Libraries/LibGemini/Job.h
@@ -17,14 +17,14 @@ class Job : public Core::NetworkJob {
C_OBJECT(Job);
public:
- explicit Job(const GeminiRequest&, Core::Stream::Stream&);
+ explicit Job(GeminiRequest const&, Core::Stream::Stream&);
virtual ~Job() override = default;
virtual void start(Core::Stream::Socket&) override;
virtual void shutdown(ShutdownMode) override;
GeminiResponse* response() { return static_cast<GeminiResponse*>(Core::NetworkJob::response()); }
- const GeminiResponse* response() const { return static_cast<const GeminiResponse*>(Core::NetworkJob::response()); }
+ GeminiResponse const* response() const { return static_cast<GeminiResponse const*>(Core::NetworkJob::response()); }
const URL& url() const { return m_request.url(); }
Core::Stream::Socket const* socket() const { return m_socket; }
diff --git a/Userland/Libraries/LibGemini/Line.cpp b/Userland/Libraries/LibGemini/Line.cpp
index 8cfbe91344..5e5b2dd810 100644
--- a/Userland/Libraries/LibGemini/Line.cpp
+++ b/Userland/Libraries/LibGemini/Line.cpp
@@ -52,7 +52,7 @@ String Control::render_to_html() const
}
}
-Link::Link(String text, const Document& document)
+Link::Link(String text, Document const& document)
: Line(move(text))
{
size_t index = 2;
diff --git a/Userland/Libraries/LibGfx/AffineTransform.cpp b/Userland/Libraries/LibGfx/AffineTransform.cpp
index 2bd8f15f0c..3872c9be2e 100644
--- a/Userland/Libraries/LibGfx/AffineTransform.cpp
+++ b/Userland/Libraries/LibGfx/AffineTransform.cpp
@@ -60,7 +60,7 @@ AffineTransform& AffineTransform::scale(float sx, float sy)
return *this;
}
-AffineTransform& AffineTransform::scale(const FloatPoint& s)
+AffineTransform& AffineTransform::scale(FloatPoint const& s)
{
return scale(s.x(), s.y());
}
@@ -74,7 +74,7 @@ AffineTransform& AffineTransform::set_scale(float sx, float sy)
return *this;
}
-AffineTransform& AffineTransform::set_scale(const FloatPoint& s)
+AffineTransform& AffineTransform::set_scale(FloatPoint const& s)
{
return set_scale(s.x(), s.y());
}
@@ -86,7 +86,7 @@ AffineTransform& AffineTransform::translate(float tx, float ty)
return *this;
}
-AffineTransform& AffineTransform::translate(const FloatPoint& t)
+AffineTransform& AffineTransform::translate(FloatPoint const& t)
{
return translate(t.x(), t.y());
}
@@ -98,12 +98,12 @@ AffineTransform& AffineTransform::set_translation(float tx, float ty)
return *this;
}
-AffineTransform& AffineTransform::set_translation(const FloatPoint& t)
+AffineTransform& AffineTransform::set_translation(FloatPoint const& t)
{
return set_translation(t.x(), t.y());
}
-AffineTransform& AffineTransform::multiply(const AffineTransform& other)
+AffineTransform& AffineTransform::multiply(AffineTransform const& other)
{
AffineTransform result;
result.m_values[0] = other.a() * a() + other.b() * c();
@@ -147,7 +147,7 @@ void AffineTransform::map(float unmapped_x, float unmapped_y, float& mapped_x, f
}
template<>
-IntPoint AffineTransform::map(const IntPoint& point) const
+IntPoint AffineTransform::map(IntPoint const& point) const
{
float mapped_x;
float mapped_y;
@@ -156,7 +156,7 @@ IntPoint AffineTransform::map(const IntPoint& point) const
}
template<>
-FloatPoint AffineTransform::map(const FloatPoint& point) const
+FloatPoint AffineTransform::map(FloatPoint const& point) const
{
float mapped_x;
float mapped_y;
@@ -165,7 +165,7 @@ FloatPoint AffineTransform::map(const FloatPoint& point) const
}
template<>
-IntSize AffineTransform::map(const IntSize& size) const
+IntSize AffineTransform::map(IntSize const& size) const
{
return {
roundf(static_cast<float>(size.width()) * x_scale()),
@@ -174,7 +174,7 @@ IntSize AffineTransform::map(const IntSize& size) const
}
template<>
-FloatSize AffineTransform::map(const FloatSize& size) const
+FloatSize AffineTransform::map(FloatSize const& size) const
{
return { size.width() * x_scale(), size.height() * y_scale() };
}
@@ -192,7 +192,7 @@ static T largest_of(T p1, T p2, T p3, T p4)
}
template<>
-FloatRect AffineTransform::map(const FloatRect& rect) const
+FloatRect AffineTransform::map(FloatRect const& rect) const
{
FloatPoint p1 = map(rect.top_left());
FloatPoint p2 = map(rect.top_right().translated(1, 0));
@@ -206,7 +206,7 @@ FloatRect AffineTransform::map(const FloatRect& rect) const
}
template<>
-IntRect AffineTransform::map(const IntRect& rect) const
+IntRect AffineTransform::map(IntRect const& rect) const
{
return enclosing_int_rect(map(FloatRect(rect)));
}
diff --git a/Userland/Libraries/LibGfx/AffineTransform.h b/Userland/Libraries/LibGfx/AffineTransform.h
index c2fc79820e..87a8f30b7a 100644
--- a/Userland/Libraries/LibGfx/AffineTransform.h
+++ b/Userland/Libraries/LibGfx/AffineTransform.h
@@ -29,13 +29,13 @@ public:
void map(float unmapped_x, float unmapped_y, float& mapped_x, float& mapped_y) const;
template<typename T>
- Point<T> map(const Point<T>&) const;
+ Point<T> map(Point<T> const&) const;
template<typename T>
- Size<T> map(const Size<T>&) const;
+ Size<T> map(Size<T> const&) const;
template<typename T>
- Rect<T> map(const Rect<T>&) const;
+ Rect<T> map(Rect<T> const&) const;
[[nodiscard]] ALWAYS_INLINE float a() const { return m_values[0]; }
[[nodiscard]] ALWAYS_INLINE float b() const { return m_values[1]; }
@@ -52,15 +52,15 @@ public:
[[nodiscard]] FloatPoint translation() const;
AffineTransform& scale(float sx, float sy);
- AffineTransform& scale(const FloatPoint& s);
+ AffineTransform& scale(FloatPoint const& s);
AffineTransform& set_scale(float sx, float sy);
- AffineTransform& set_scale(const FloatPoint& s);
+ AffineTransform& set_scale(FloatPoint const& s);
AffineTransform& translate(float tx, float ty);
- AffineTransform& translate(const FloatPoint& t);
+ AffineTransform& translate(FloatPoint const& t);
AffineTransform& set_translation(float tx, float ty);
- AffineTransform& set_translation(const FloatPoint& t);
+ AffineTransform& set_translation(FloatPoint const& t);
AffineTransform& rotate_radians(float);
- AffineTransform& multiply(const AffineTransform&);
+ AffineTransform& multiply(AffineTransform const&);
Optional<AffineTransform> inverse() const;
diff --git a/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp b/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp
index 8d6cbe1010..b4a3bcd001 100644
--- a/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp
+++ b/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp
@@ -179,7 +179,7 @@ void Gfx::AntiAliasingPainter::draw_quadratic_bezier_curve(FloatPoint const& con
});
}
-void Gfx::AntiAliasingPainter::draw_cubic_bezier_curve(const FloatPoint& control_point_0, const FloatPoint& control_point_1, const FloatPoint& p1, const FloatPoint& p2, Color color, float thickness, Painter::LineStyle style)
+void Gfx::AntiAliasingPainter::draw_cubic_bezier_curve(FloatPoint const& control_point_0, FloatPoint const& control_point_1, FloatPoint const& p1, FloatPoint const& p2, Color color, float thickness, Painter::LineStyle style)
{
Gfx::Painter::for_each_line_segment_on_cubic_bezier_curve(control_point_0, control_point_1, p1, p2, [&](FloatPoint const& fp1, FloatPoint const& fp2) {
draw_line(fp1, fp2, color, thickness, style);
@@ -200,9 +200,9 @@ void Gfx::AntiAliasingPainter::draw_circle(IntPoint center, int radius, Color co
// These happen to be the same here, but are treated separately in the paper:
// intensity is the fill alpha
- const int intensity = color.alpha();
+ int const intensity = color.alpha();
// 0 to subpixel_resolution is the range of alpha values for the circle edges
- const int subpixel_resolution = intensity;
+ int const subpixel_resolution = intensity;
// Note: Variable names below are based off the paper
diff --git a/Userland/Libraries/LibGfx/BMPLoader.cpp b/Userland/Libraries/LibGfx/BMPLoader.cpp
index 841e50aef6..38f3098a63 100644
--- a/Userland/Libraries/LibGfx/BMPLoader.cpp
+++ b/Userland/Libraries/LibGfx/BMPLoader.cpp
@@ -130,7 +130,7 @@ struct BMPLoadingContext {
};
State state { State::NotDecoded };
- const u8* file_bytes { nullptr };
+ u8 const* file_bytes { nullptr };
size_t file_size { 0 };
u32 data_offset { 0 };
@@ -167,7 +167,7 @@ struct BMPLoadingContext {
class InputStreamer {
public:
- InputStreamer(const u8* data, size_t size)
+ InputStreamer(u8 const* data, size_t size)
: m_data_ptr(data)
, m_size_remaining(size)
{
@@ -217,7 +217,7 @@ public:
size_t remaining() const { return m_size_remaining; }
private:
- const u8* m_data_ptr { nullptr };
+ u8 const* m_data_ptr { nullptr };
size_t m_size_remaining { 0 };
};
@@ -1300,7 +1300,7 @@ static bool decode_bmp_pixel_data(BMPLoadingContext& context)
return true;
}
-BMPImageDecoderPlugin::BMPImageDecoderPlugin(const u8* data, size_t data_size)
+BMPImageDecoderPlugin::BMPImageDecoderPlugin(u8 const* data, size_t data_size)
{
m_context = make<BMPLoadingContext>();
m_context->file_bytes = data;
diff --git a/Userland/Libraries/LibGfx/BMPLoader.h b/Userland/Libraries/LibGfx/BMPLoader.h
index a690f32619..4351d6f4b4 100644
--- a/Userland/Libraries/LibGfx/BMPLoader.h
+++ b/Userland/Libraries/LibGfx/BMPLoader.h
@@ -15,7 +15,7 @@ struct BMPLoadingContext;
class BMPImageDecoderPlugin final : public ImageDecoderPlugin {
public:
virtual ~BMPImageDecoderPlugin() override;
- BMPImageDecoderPlugin(const u8*, size_t);
+ BMPImageDecoderPlugin(u8 const*, size_t);
virtual IntSize size() override;
virtual void set_volatile() override;
diff --git a/Userland/Libraries/LibGfx/BMPWriter.cpp b/Userland/Libraries/LibGfx/BMPWriter.cpp
index 0de6bf3417..9b4a9c08ec 100644
--- a/Userland/Libraries/LibGfx/BMPWriter.cpp
+++ b/Userland/Libraries/LibGfx/BMPWriter.cpp
@@ -42,7 +42,7 @@ private:
u8* m_data;
};
-static ByteBuffer write_pixel_data(const RefPtr<Bitmap> bitmap, int pixel_row_data_size, int bytes_per_pixel, bool include_alpha_channel)
+static ByteBuffer write_pixel_data(RefPtr<Bitmap> const bitmap, int pixel_row_data_size, int bytes_per_pixel, bool include_alpha_channel)
{
int image_size = pixel_row_data_size * bitmap->height();
auto buffer_result = ByteBuffer::create_uninitialized(image_size);
@@ -67,7 +67,7 @@ static ByteBuffer write_pixel_data(const RefPtr<Bitmap> bitmap, int pixel_row_da
return buffer;
}
-static ByteBuffer compress_pixel_data(const ByteBuffer& pixel_data, BMPWriter::Compression compression)
+static ByteBuffer compress_pixel_data(ByteBuffer const& pixel_data, BMPWriter::Compression compression)
{
switch (compression) {
case BMPWriter::Compression::BI_BITFIELDS:
@@ -78,7 +78,7 @@ static ByteBuffer compress_pixel_data(const ByteBuffer& pixel_data, BMPWriter::C
VERIFY_NOT_REACHED();
}
-ByteBuffer BMPWriter::dump(const RefPtr<Bitmap> bitmap, DibHeader dib_header)
+ByteBuffer BMPWriter::dump(RefPtr<Bitmap> const bitmap, DibHeader dib_header)
{
switch (dib_header) {
diff --git a/Userland/Libraries/LibGfx/BMPWriter.h b/Userland/Libraries/LibGfx/BMPWriter.h
index fad1c1820a..0dc3c2c0ba 100644
--- a/Userland/Libraries/LibGfx/BMPWriter.h
+++ b/Userland/Libraries/LibGfx/BMPWriter.h
@@ -27,7 +27,7 @@ public:
V4 = 108,
};
- ByteBuffer dump(const RefPtr<Bitmap>, DibHeader dib_header = DibHeader::V4);
+ ByteBuffer dump(RefPtr<Bitmap> const, DibHeader dib_header = DibHeader::V4);
inline void set_compression(Compression compression) { m_compression = compression; }
diff --git a/Userland/Libraries/LibGfx/BitmapFont.cpp b/Userland/Libraries/LibGfx/BitmapFont.cpp
index 3a4d3b416e..22cb56ff64 100644
--- a/Userland/Libraries/LibGfx/BitmapFont.cpp
+++ b/Userland/Libraries/LibGfx/BitmapFont.cpp
@@ -173,7 +173,7 @@ BitmapFont::~BitmapFont()
RefPtr<BitmapFont> BitmapFont::load_from_memory(u8 const* data)
{
- auto const& header = *reinterpret_cast<const FontFileHeader*>(data);
+ auto const& header = *reinterpret_cast<FontFileHeader const*>(data);
if (memcmp(header.magic, "!Fnt", 4)) {
dbgln("header.magic != '!Fnt', instead it's '{:c}{:c}{:c}{:c}'", header.magic[0], header.magic[1], header.magic[2], header.magic[3]);
return nullptr;
diff --git a/Userland/Libraries/LibGfx/ClassicWindowTheme.cpp b/Userland/Libraries/LibGfx/ClassicWindowTheme.cpp
index 1451e5ba89..77f1bff323 100644
--- a/Userland/Libraries/LibGfx/ClassicWindowTheme.cpp
+++ b/Userland/Libraries/LibGfx/ClassicWindowTheme.cpp
@@ -16,7 +16,7 @@ namespace Gfx {
static constexpr int menubar_height = 20;
-Gfx::IntRect ClassicWindowTheme::titlebar_icon_rect(WindowType window_type, const IntRect& window_rect, const Palette& palette) const
+Gfx::IntRect ClassicWindowTheme::titlebar_icon_rect(WindowType window_type, IntRect const& window_rect, Palette const& palette) const
{
if (window_type == WindowType::ToolWindow)
return {};
@@ -33,7 +33,7 @@ Gfx::IntRect ClassicWindowTheme::titlebar_icon_rect(WindowType window_type, cons
return icon_rect;
}
-Gfx::IntRect ClassicWindowTheme::titlebar_text_rect(WindowType window_type, const IntRect& window_rect, const Palette& palette) const
+Gfx::IntRect ClassicWindowTheme::titlebar_text_rect(WindowType window_type, IntRect const& window_rect, Palette const& palette) const
{
auto titlebar_rect = this->titlebar_rect(window_type, window_rect, palette);
auto titlebar_icon_rect = this->titlebar_icon_rect(window_type, window_rect, palette);
@@ -45,7 +45,7 @@ Gfx::IntRect ClassicWindowTheme::titlebar_text_rect(WindowType window_type, cons
};
}
-void ClassicWindowTheme::paint_normal_frame(Painter& painter, WindowState window_state, const IntRect& window_rect, StringView window_title, const Bitmap& icon, const Palette& palette, const IntRect& leftmost_button_rect, int menu_row_count, [[maybe_unused]] bool window_modified) const
+void ClassicWindowTheme::paint_normal_frame(Painter& painter, WindowState window_state, IntRect const& window_rect, StringView window_title, Bitmap const& icon, Palette const& palette, IntRect const& leftmost_button_rect, int menu_row_count, [[maybe_unused]] bool window_modified) const
{
auto frame_rect = frame_rect_for_window(WindowType::Normal, window_rect, palette, menu_row_count);
frame_rect.set_location({ 0, 0 });
@@ -112,7 +112,7 @@ void ClassicWindowTheme::paint_normal_frame(Painter& painter, WindowState window
painter.draw_scaled_bitmap(titlebar_icon_rect, icon, icon.rect());
}
-void ClassicWindowTheme::paint_tool_window_frame(Painter& painter, WindowState window_state, const IntRect& window_rect, StringView title_text, const Palette& palette, const IntRect& leftmost_button_rect) const
+void ClassicWindowTheme::paint_tool_window_frame(Painter& painter, WindowState window_state, IntRect const& window_rect, StringView title_text, Palette const& palette, IntRect const& leftmost_button_rect) const
{
auto frame_rect = frame_rect_for_window(WindowType::ToolWindow, window_rect, palette, 0);
frame_rect.set_location({ 0, 0 });
@@ -143,14 +143,14 @@ void ClassicWindowTheme::paint_tool_window_frame(Painter& painter, WindowState w
}
}
-IntRect ClassicWindowTheme::menubar_rect(WindowType window_type, const IntRect& window_rect, const Palette& palette, int menu_row_count) const
+IntRect ClassicWindowTheme::menubar_rect(WindowType window_type, IntRect const& window_rect, Palette const& palette, int menu_row_count) const
{
if (window_type != WindowType::Normal)
return {};
return { palette.window_border_thickness(), palette.window_border_thickness() - 1 + titlebar_height(window_type, palette) + 2, window_rect.width(), menubar_height * menu_row_count };
}
-IntRect ClassicWindowTheme::titlebar_rect(WindowType window_type, const IntRect& window_rect, const Palette& palette) const
+IntRect ClassicWindowTheme::titlebar_rect(WindowType window_type, IntRect const& window_rect, Palette const& palette) const
{
auto& title_font = FontDatabase::default_font().bold_variant();
auto window_titlebar_height = titlebar_height(window_type, palette);
@@ -162,7 +162,7 @@ IntRect ClassicWindowTheme::titlebar_rect(WindowType window_type, const IntRect&
return { palette.window_border_thickness(), palette.window_border_thickness(), window_rect.width(), window_titlebar_height };
}
-ClassicWindowTheme::FrameColors ClassicWindowTheme::compute_frame_colors(WindowState state, const Palette& palette) const
+ClassicWindowTheme::FrameColors ClassicWindowTheme::compute_frame_colors(WindowState state, Palette const& palette) const
{
switch (state) {
case WindowState::Highlighted:
@@ -178,7 +178,7 @@ ClassicWindowTheme::FrameColors ClassicWindowTheme::compute_frame_colors(WindowS
}
}
-void ClassicWindowTheme::paint_notification_frame(Painter& painter, const IntRect& window_rect, const Palette& palette, const IntRect& close_button_rect) const
+void ClassicWindowTheme::paint_notification_frame(Painter& painter, IntRect const& window_rect, Palette const& palette, IntRect const& close_button_rect) const
{
auto frame_rect = frame_rect_for_window(WindowType::Notification, window_rect, palette, 0);
frame_rect.set_location({ 0, 0 });
@@ -198,7 +198,7 @@ void ClassicWindowTheme::paint_notification_frame(Painter& painter, const IntRec
}
}
-IntRect ClassicWindowTheme::frame_rect_for_window(WindowType window_type, const IntRect& window_rect, const Gfx::Palette& palette, int menu_row_count) const
+IntRect ClassicWindowTheme::frame_rect_for_window(WindowType window_type, IntRect const& window_rect, Gfx::Palette const& palette, int menu_row_count) const
{
auto window_titlebar_height = titlebar_height(window_type, palette);
auto border_thickness = palette.window_border_thickness();
@@ -224,7 +224,7 @@ IntRect ClassicWindowTheme::frame_rect_for_window(WindowType window_type, const
}
}
-Vector<IntRect> ClassicWindowTheme::layout_buttons(WindowType window_type, const IntRect& window_rect, const Palette& palette, size_t buttons) const
+Vector<IntRect> ClassicWindowTheme::layout_buttons(WindowType window_type, IntRect const& window_rect, Palette const& palette, size_t buttons) const
{
int window_button_width = palette.window_title_button_width();
int window_button_height = palette.window_title_button_height();
@@ -252,7 +252,7 @@ Vector<IntRect> ClassicWindowTheme::layout_buttons(WindowType window_type, const
return button_rects;
}
-int ClassicWindowTheme::titlebar_height(WindowType window_type, const Palette& palette) const
+int ClassicWindowTheme::titlebar_height(WindowType window_type, Palette const& palette) const
{
auto& title_font = FontDatabase::default_font().bold_variant();
switch (window_type) {
diff --git a/Userland/Libraries/LibGfx/ClassicWindowTheme.h b/Userland/Libraries/LibGfx/ClassicWindowTheme.h
index 0aaa7f101e..8e2aff0fb1 100644
--- a/Userland/Libraries/LibGfx/ClassicWindowTheme.h
+++ b/Userland/Libraries/LibGfx/ClassicWindowTheme.h
@@ -16,22 +16,22 @@ public:
ClassicWindowTheme() = default;
virtual ~ClassicWindowTheme() override = default;
- virtual void paint_normal_frame(Painter& painter, WindowState window_state, const IntRect& window_rect, StringView window_title, const Bitmap& icon, const Palette& palette, const IntRect& leftmost_button_rect, int menu_row_count, bool window_modified) const override;
- virtual void paint_tool_window_frame(Painter&, WindowState, const IntRect& window_rect, StringView title, const Palette&, const IntRect& leftmost_button_rect) const override;
- virtual void paint_notification_frame(Painter&, const IntRect& window_rect, const Palette&, const IntRect& close_button_rect) const override;
+ virtual void paint_normal_frame(Painter& painter, WindowState window_state, IntRect const& window_rect, StringView window_title, Bitmap const& icon, Palette const& palette, IntRect const& leftmost_button_rect, int menu_row_count, bool window_modified) const override;
+ virtual void paint_tool_window_frame(Painter&, WindowState, IntRect const& window_rect, StringView title, Palette const&, IntRect const& leftmost_button_rect) const override;
+ virtual void paint_notification_frame(Painter&, IntRect const& window_rect, Palette const&, IntRect const& close_button_rect) const override;
- virtual int titlebar_height(WindowType, const Palette&) const override;
- virtual IntRect titlebar_rect(WindowType, const IntRect& window_rect, const Palette&) const override;
- virtual IntRect titlebar_icon_rect(WindowType, const IntRect& window_rect, const Palette&) const override;
- virtual IntRect titlebar_text_rect(WindowType, const IntRect& window_rect, const Palette&) const override;
+ virtual int titlebar_height(WindowType, Palette const&) const override;
+ virtual IntRect titlebar_rect(WindowType, IntRect const& window_rect, Palette const&) const override;
+ virtual IntRect titlebar_icon_rect(WindowType, IntRect const& window_rect, Palette const&) const override;
+ virtual IntRect titlebar_text_rect(WindowType, IntRect const& window_rect, Palette const&) const override;
- virtual IntRect menubar_rect(WindowType, const IntRect& window_rect, const Palette&, int menu_row_count) const override;
+ virtual IntRect menubar_rect(WindowType, IntRect const& window_rect, Palette const&, int menu_row_count) const override;
- virtual IntRect frame_rect_for_window(WindowType, const IntRect& window_rect, const Palette&, int menu_row_count) const override;
+ virtual IntRect frame_rect_for_window(WindowType, IntRect const& window_rect, Palette const&, int menu_row_count) const override;
- virtual Vector<IntRect> layout_buttons(WindowType, const IntRect& window_rect, const Palette&, size_t buttons) const override;
+ virtual Vector<IntRect> layout_buttons(WindowType, IntRect const& window_rect, Palette const&, size_t buttons) const override;
virtual bool is_simple_rect_frame() const override { return true; }
- virtual bool frame_uses_alpha(WindowState state, const Palette& palette) const override
+ virtual bool frame_uses_alpha(WindowState state, Palette const& palette) const override
{
return compute_frame_colors(state, palette).uses_alpha();
}
@@ -54,7 +54,7 @@ private:
}
};
- FrameColors compute_frame_colors(WindowState, const Palette&) const;
+ FrameColors compute_frame_colors(WindowState, Palette const&) const;
};
}
diff --git a/Userland/Libraries/LibGfx/Color.h b/Userland/Libraries/LibGfx/Color.h
index 1c158dd8d0..900e23f6b9 100644
--- a/Userland/Libraries/LibGfx/Color.h
+++ b/Userland/Libraries/LibGfx/Color.h
@@ -185,7 +185,7 @@ public:
source.blue()
};
- const int d = 255 * (alpha() + source.alpha()) - alpha() * source.alpha();
+ int const d = 255 * (alpha() + source.alpha()) - alpha() * source.alpha();
const i32x4 out = (color * alpha() * (255 - source.alpha()) + 255 * source.alpha() * source_color) / d;
return Color(out[0], out[1], out[2], d / 255);
#else
diff --git a/Userland/Libraries/LibGfx/DDSLoader.cpp b/Userland/Libraries/LibGfx/DDSLoader.cpp
index 64ef66267b..d6a78b4997 100644
--- a/Userland/Libraries/LibGfx/DDSLoader.cpp
+++ b/Userland/Libraries/LibGfx/DDSLoader.cpp
@@ -34,7 +34,7 @@ struct DDSLoadingContext {
State state { State::NotDecoded };
- const u8* data { nullptr };
+ u8 const* data { nullptr };
size_t data_size { 0 };
DDSHeader header;
@@ -937,7 +937,7 @@ void DDSLoadingContext::dump_debug()
dbgln("{}", builder.to_string());
}
-DDSImageDecoderPlugin::DDSImageDecoderPlugin(const u8* data, size_t size)
+DDSImageDecoderPlugin::DDSImageDecoderPlugin(u8 const* data, size_t size)
{
m_context = make<DDSLoadingContext>();
m_context->data = data;
diff --git a/Userland/Libraries/LibGfx/DDSLoader.h b/Userland/Libraries/LibGfx/DDSLoader.h
index a313d7d3e2..87321d79df 100644
--- a/Userland/Libraries/LibGfx/DDSLoader.h
+++ b/Userland/Libraries/LibGfx/DDSLoader.h
@@ -236,7 +236,7 @@ struct DDSLoadingContext;
class DDSImageDecoderPlugin final : public ImageDecoderPlugin {
public:
virtual ~DDSImageDecoderPlugin() override;
- DDSImageDecoderPlugin(const u8*, size_t);
+ DDSImageDecoderPlugin(u8 const*, size_t);
virtual IntSize size() override;
virtual void set_volatile() override;
diff --git a/Userland/Libraries/LibGfx/DisjointRectSet.cpp b/Userland/Libraries/LibGfx/DisjointRectSet.cpp
index e2a4a0b181..20a95bc4c8 100644
--- a/Userland/Libraries/LibGfx/DisjointRectSet.cpp
+++ b/Userland/Libraries/LibGfx/DisjointRectSet.cpp
@@ -8,7 +8,7 @@
namespace Gfx {
-bool DisjointRectSet::add_no_shatter(const IntRect& new_rect)
+bool DisjointRectSet::add_no_shatter(IntRect const& new_rect)
{
if (new_rect.is_empty())
return false;
@@ -59,7 +59,7 @@ void DisjointRectSet::move_by(int dx, int dy)
r.translate_by(dx, dy);
}
-bool DisjointRectSet::contains(const IntRect& rect) const
+bool DisjointRectSet::contains(IntRect const& rect) const
{
if (is_empty() || rect.is_empty())
return false;
@@ -75,7 +75,7 @@ bool DisjointRectSet::contains(const IntRect& rect) const
return false;
}
-bool DisjointRectSet::intersects(const IntRect& rect) const
+bool DisjointRectSet::intersects(IntRect const& rect) const
{
for (auto& r : m_rects) {
if (r.intersects(rect))
@@ -84,7 +84,7 @@ bool DisjointRectSet::intersects(const IntRect& rect) const
return false;
}
-bool DisjointRectSet::intersects(const DisjointRectSet& rects) const
+bool DisjointRectSet::intersects(DisjointRectSet const& rects) const
{
if (this == &rects)
return true;
@@ -98,7 +98,7 @@ bool DisjointRectSet::intersects(const DisjointRectSet& rects) const
return false;
}
-DisjointRectSet DisjointRectSet::intersected(const IntRect& rect) const
+DisjointRectSet DisjointRectSet::intersected(IntRect const& rect) const
{
DisjointRectSet intersected_rects;
intersected_rects.m_rects.ensure_capacity(m_rects.capacity());
@@ -111,7 +111,7 @@ DisjointRectSet DisjointRectSet::intersected(const IntRect& rect) const
return intersected_rects;
}
-DisjointRectSet DisjointRectSet::intersected(const DisjointRectSet& rects) const
+DisjointRectSet DisjointRectSet::intersected(DisjointRectSet const& rects) const
{
if (&rects == this)
return clone();
@@ -131,7 +131,7 @@ DisjointRectSet DisjointRectSet::intersected(const DisjointRectSet& rects) const
return intersected_rects;
}
-DisjointRectSet DisjointRectSet::shatter(const IntRect& hammer) const
+DisjointRectSet DisjointRectSet::shatter(IntRect const& hammer) const
{
if (hammer.is_empty())
return clone();
@@ -145,7 +145,7 @@ DisjointRectSet DisjointRectSet::shatter(const IntRect& hammer) const
return shards;
}
-DisjointRectSet DisjointRectSet::shatter(const DisjointRectSet& hammer) const
+DisjointRectSet DisjointRectSet::shatter(DisjointRectSet const& hammer) const
{
if (this == &hammer)
return {};
diff --git a/Userland/Libraries/LibGfx/DisjointRectSet.h b/Userland/Libraries/LibGfx/DisjointRectSet.h
index 9a256566e8..d6ce6fa074 100644
--- a/Userland/Libraries/LibGfx/DisjointRectSet.h
+++ b/Userland/Libraries/LibGfx/DisjointRectSet.h
@@ -14,13 +14,13 @@ namespace Gfx {
class DisjointRectSet {
public:
- DisjointRectSet(const DisjointRectSet&) = delete;
- DisjointRectSet& operator=(const DisjointRectSet&) = delete;
+ DisjointRectSet(DisjointRectSet const&) = delete;
+ DisjointRectSet& operator=(DisjointRectSet const&) = delete;
DisjointRectSet() = default;
~DisjointRectSet() = default;
- DisjointRectSet(const IntRect& rect)
+ DisjointRectSet(IntRect const& rect)
{
m_rects.append(rect);
}
@@ -36,22 +36,22 @@ public:
}
void move_by(int dx, int dy);
- void move_by(const IntPoint& delta)
+ void move_by(IntPoint const& delta)
{
move_by(delta.x(), delta.y());
}
- void add(const IntRect& rect)
+ void add(IntRect const& rect)
{
if (add_no_shatter(rect) && m_rects.size() > 1)
shatter();
}
template<typename Container>
- void add_many(const Container& rects)
+ void add_many(Container const& rects)
{
bool added = false;
- for (const auto& rect : rects) {
+ for (auto const& rect : rects) {
if (add_no_shatter(rect))
added = true;
}
@@ -59,7 +59,7 @@ public:
shatter();
}
- void add(const DisjointRectSet& rect_set)
+ void add(DisjointRectSet const& rect_set)
{
if (this == &rect_set)
return;
@@ -70,17 +70,17 @@ public:
}
}
- DisjointRectSet shatter(const IntRect&) const;
- DisjointRectSet shatter(const DisjointRectSet& hammer) const;
+ DisjointRectSet shatter(IntRect const&) const;
+ DisjointRectSet shatter(DisjointRectSet const& hammer) const;
- bool contains(const IntRect&) const;
- bool intersects(const IntRect&) const;
- bool intersects(const DisjointRectSet&) const;
- DisjointRectSet intersected(const IntRect&) const;
- DisjointRectSet intersected(const DisjointRectSet&) const;
+ bool contains(IntRect const&) const;
+ bool intersects(IntRect const&) const;
+ bool intersects(DisjointRectSet const&) const;
+ DisjointRectSet intersected(IntRect const&) const;
+ DisjointRectSet intersected(DisjointRectSet const&) const;
template<typename Function>
- IterationDecision for_each_intersected(const IntRect& rect, Function f) const
+ IterationDecision for_each_intersected(IntRect const& rect, Function f) const
{
if (is_empty() || rect.is_empty())
return IterationDecision::Continue;
@@ -96,7 +96,7 @@ public:
}
template<typename Function>
- IterationDecision for_each_intersected(const DisjointRectSet& rects, Function f) const
+ IterationDecision for_each_intersected(DisjointRectSet const& rects, Function f) const
{
if (is_empty() || rects.is_empty())
return IterationDecision::Continue;
@@ -126,7 +126,7 @@ public:
void clear() { m_rects.clear(); }
void clear_with_capacity() { m_rects.clear_with_capacity(); }
- const Vector<IntRect, 32>& rects() const { return m_rects; }
+ Vector<IntRect, 32> const& rects() const { return m_rects; }
Vector<IntRect, 32> take_rects() { return move(m_rects); }
void translate_by(int dx, int dy)
@@ -141,7 +141,7 @@ public:
}
private:
- bool add_no_shatter(const IntRect&);
+ bool add_no_shatter(IntRect const&);
void shatter();
Vector<IntRect, 32> m_rects;
diff --git a/Userland/Libraries/LibGfx/Filters/GenericConvolutionFilter.h b/Userland/Libraries/LibGfx/Filters/GenericConvolutionFilter.h
index f42659fadc..e6c7384cd7 100644
--- a/Userland/Libraries/LibGfx/Filters/GenericConvolutionFilter.h
+++ b/Userland/Libraries/LibGfx/Filters/GenericConvolutionFilter.h
@@ -34,14 +34,14 @@ class GenericConvolutionFilter : public Filter {
public:
class Parameters : public Filter::Parameters {
public:
- Parameters(const Gfx::Matrix<N, float>& kernel, bool should_wrap = false)
+ Parameters(Gfx::Matrix<N, float> const& kernel, bool should_wrap = false)
: m_kernel(kernel)
, m_should_wrap(should_wrap)
{
}
- const Gfx::Matrix<N, float>& kernel() const { return m_kernel; }
+ Gfx::Matrix<N, float> const& kernel() const { return m_kernel; }
Gfx::Matrix<N, float>& kernel() { return m_kernel; }
bool should_wrap() const { return m_should_wrap; }
@@ -64,16 +64,16 @@ public:
virtual StringView class_name() const override { return "GenericConvolutionFilter"sv; }
- virtual void apply(Bitmap& target_bitmap, const IntRect& target_rect, const Bitmap& source_bitmap, const IntRect& source_rect, const Filter::Parameters& parameters) override
+ virtual void apply(Bitmap& target_bitmap, IntRect const& target_rect, Bitmap const& source_bitmap, IntRect const& source_rect, Filter::Parameters const& parameters) override
{
VERIFY(parameters.is_generic_convolution_filter());
- auto& gcf_params = static_cast<const GenericConvolutionFilter::Parameters&>(parameters);
+ auto& gcf_params = static_cast<GenericConvolutionFilter::Parameters const&>(parameters);
ApplyCache apply_cache;
apply_with_cache(target_bitmap, target_rect, source_bitmap, source_rect, gcf_params, apply_cache);
}
- void apply_with_cache(Bitmap& target, IntRect target_rect, const Bitmap& source, const IntRect& source_rect, const GenericConvolutionFilter::Parameters& parameters, ApplyCache& apply_cache)
+ void apply_with_cache(Bitmap& target, IntRect target_rect, Bitmap const& source, IntRect const& source_rect, GenericConvolutionFilter::Parameters const& parameters, ApplyCache& apply_cache)
{
// The target area (where the filter is applied) must be entirely
// contained by the source area. source_rect should be describing
diff --git a/Userland/Libraries/LibGfx/Font.h b/Userland/Libraries/LibGfx/Font.h
index fa0f29bc2b..be60b72546 100644
--- a/Userland/Libraries/LibGfx/Font.h
+++ b/Userland/Libraries/LibGfx/Font.h
@@ -22,7 +22,7 @@ namespace Gfx {
class GlyphBitmap {
public:
GlyphBitmap() = default;
- GlyphBitmap(const u8* rows, size_t start_index, IntSize size)
+ GlyphBitmap(u8 const* rows, size_t start_index, IntSize size)
: m_rows(rows)
, m_start_index(start_index)
, m_size(size)
@@ -48,14 +48,14 @@ private:
return { const_cast<u8*>(m_rows) + bytes_per_row() * (m_start_index + y), bytes_per_row() * 8 };
}
- const u8* m_rows { nullptr };
+ u8 const* m_rows { nullptr };
size_t m_start_index { 0 };
IntSize m_size { 0, 0 };
};
class Glyph {
public:
- Glyph(const GlyphBitmap& glyph_bitmap, int left_bearing, int advance, int ascent)
+ Glyph(GlyphBitmap const& glyph_bitmap, int left_bearing, int advance, int ascent)
: m_glyph_bitmap(glyph_bitmap)
, m_left_bearing(left_bearing)
, m_advance(advance)
@@ -140,8 +140,8 @@ public:
virtual u8 mean_line() const = 0;
virtual int width(StringView) const = 0;
- virtual int width(const Utf8View&) const = 0;
- virtual int width(const Utf32View&) const = 0;
+ virtual int width(Utf8View const&) const = 0;
+ virtual int width(Utf32View const&) const = 0;
virtual String name() const = 0;
diff --git a/Userland/Libraries/LibGfx/FontDatabase.cpp b/Userland/Libraries/LibGfx/FontDatabase.cpp
index e761f5d89b..9a7645a17f 100644
--- a/Userland/Libraries/LibGfx/FontDatabase.cpp
+++ b/Userland/Libraries/LibGfx/FontDatabase.cpp
@@ -119,7 +119,7 @@ FontDatabase::FontDatabase()
}
}
-void FontDatabase::for_each_font(Function<void(const Gfx::Font&)> callback)
+void FontDatabase::for_each_font(Function<void(Gfx::Font const&)> callback)
{
Vector<RefPtr<Gfx::Font>> fonts;
fonts.ensure_capacity(m_private->full_name_to_font_map.size());
@@ -130,7 +130,7 @@ void FontDatabase::for_each_font(Function<void(const Gfx::Font&)> callback)
callback(*font);
}
-void FontDatabase::for_each_fixed_width_font(Function<void(const Gfx::Font&)> callback)
+void FontDatabase::for_each_fixed_width_font(Function<void(Gfx::Font const&)> callback)
{
Vector<RefPtr<Gfx::Font>> fonts;
fonts.ensure_capacity(m_private->full_name_to_font_map.size());
@@ -179,7 +179,7 @@ RefPtr<Gfx::Font> FontDatabase::get(FlyString const& family, FlyString const& va
return nullptr;
}
-RefPtr<Typeface> FontDatabase::get_or_create_typeface(const String& family, const String& variant)
+RefPtr<Typeface> FontDatabase::get_or_create_typeface(String const& family, String const& variant)
{
for (auto typeface : m_private->typefaces) {
if (typeface->family() == family && typeface->variant() == variant)
@@ -190,7 +190,7 @@ RefPtr<Typeface> FontDatabase::get_or_create_typeface(const String& family, cons
return typeface;
}
-void FontDatabase::for_each_typeface(Function<void(const Typeface&)> callback)
+void FontDatabase::for_each_typeface(Function<void(Typeface const&)> callback)
{
for (auto typeface : m_private->typefaces) {
callback(*typeface);
diff --git a/Userland/Libraries/LibGfx/FontDatabase.h b/Userland/Libraries/LibGfx/FontDatabase.h
index effc8259ec..90ba0587d8 100644
--- a/Userland/Libraries/LibGfx/FontDatabase.h
+++ b/Userland/Libraries/LibGfx/FontDatabase.h
@@ -47,16 +47,16 @@ public:
RefPtr<Gfx::Font> get(FlyString const& family, float point_size, unsigned weight, unsigned slope, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No);
RefPtr<Gfx::Font> get(FlyString const& family, FlyString const& variant, float point_size, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No);
RefPtr<Gfx::Font> get_by_name(StringView);
- void for_each_font(Function<void(const Gfx::Font&)>);
- void for_each_fixed_width_font(Function<void(const Gfx::Font&)>);
+ void for_each_font(Function<void(Gfx::Font const&)>);
+ void for_each_fixed_width_font(Function<void(Gfx::Font const&)>);
- void for_each_typeface(Function<void(const Typeface&)>);
+ void for_each_typeface(Function<void(Typeface const&)>);
private:
FontDatabase();
~FontDatabase() = default;
- RefPtr<Typeface> get_or_create_typeface(const String& family, const String& variant);
+ RefPtr<Typeface> get_or_create_typeface(String const& family, String const& variant);
struct Private;
OwnPtr<Private> m_private;
diff --git a/Userland/Libraries/LibGfx/FontStyleMapping.h b/Userland/Libraries/LibGfx/FontStyleMapping.h
index 7c499c35b9..1653dd0e43 100644
--- a/Userland/Libraries/LibGfx/FontStyleMapping.h
+++ b/Userland/Libraries/LibGfx/FontStyleMapping.h
@@ -12,7 +12,7 @@
namespace Gfx {
struct FontStyleMapping {
- constexpr FontStyleMapping(int s, const char* n)
+ constexpr FontStyleMapping(int s, char const* n)
: style(s)
, name(n)
{
diff --git a/Userland/Libraries/LibGfx/GIFLoader.cpp b/Userland/Libraries/LibGfx/GIFLoader.cpp
index 9943eaf719..a51261f037 100644
--- a/Userland/Libraries/LibGfx/GIFLoader.cpp
+++ b/Userland/Libraries/LibGfx/GIFLoader.cpp
@@ -70,7 +70,7 @@ struct GIFLoadingContext {
FailedToLoadFrameDescriptors,
};
ErrorState error_state { NoError };
- const u8* data { nullptr };
+ u8 const* data { nullptr };
size_t data_size { 0 };
LogicalScreen logical_screen {};
u8 background_color_index { 0 };
@@ -110,7 +110,7 @@ private:
static constexpr int max_code_size = 12;
public:
- explicit LZWDecoder(const Vector<u8>& lzw_bytes, u8 min_code_size)
+ explicit LZWDecoder(Vector<u8> const& lzw_bytes, u8 min_code_size)
: m_lzw_bytes(lzw_bytes)
, m_code_size(min_code_size)
, m_original_code_size(min_code_size)
@@ -160,7 +160,7 @@ public:
for (int i = 0; current_byte_index + i < m_lzw_bytes.size(); ++i) {
padded_last_bytes[i] = m_lzw_bytes[current_byte_index + i];
}
- const u32* addr = (const u32*)&padded_last_bytes;
+ u32 const* addr = (u32 const*)&padded_last_bytes;
m_current_code = (*addr & mask) >> current_bit_offset;
} else {
u32 tmp_word;
@@ -213,7 +213,7 @@ private:
m_original_code_table = m_code_table;
}
- void extend_code_table(const Vector<u8>& entry)
+ void extend_code_table(Vector<u8> const& entry)
{
if (entry.size() > 1 && m_code_table.size() < 4096) {
m_code_table.append(entry);
@@ -224,7 +224,7 @@ private:
}
}
- const Vector<u8>& m_lzw_bytes;
+ Vector<u8> const& m_lzw_bytes;
int m_current_bit_index { 0 };
@@ -240,13 +240,13 @@ private:
Vector<u8> m_output {};
};
-static void copy_frame_buffer(Bitmap& dest, const Bitmap& src)
+static void copy_frame_buffer(Bitmap& dest, Bitmap const& src)
{
VERIFY(dest.size_in_bytes() == src.size_in_bytes());
memcpy(dest.scanline(0), src.scanline(0), dest.size_in_bytes());
}
-static void clear_rect(Bitmap& bitmap, const IntRect& rect, Color color)
+static void clear_rect(Bitmap& bitmap, IntRect const& rect, Color color)
{
auto intersection_rect = rect.intersected(bitmap.rect());
if (intersection_rect.is_empty())
@@ -293,7 +293,7 @@ static bool decode_frame(GIFLoadingContext& context, size_t frame_index)
for (size_t i = start_frame; i <= frame_index; ++i) {
auto& image = context.images.at(i);
- const auto previous_image_disposal_method = i > 0 ? context.images.at(i - 1).disposal_method : GIFImageDescriptor::DisposalMethod::None;
+ auto const previous_image_disposal_method = i > 0 ? context.images.at(i - 1).disposal_method : GIFImageDescriptor::DisposalMethod::None;
if (i == 0) {
context.frame_buffer->fill(Color::Transparent);
@@ -324,10 +324,10 @@ static bool decode_frame(GIFLoadingContext& context, size_t frame_index)
LZWDecoder decoder(image.lzw_encoded_bytes, image.lzw_min_code_size);
// Add GIF-specific control codes
- const int clear_code = decoder.add_control_code();
- const int end_of_information_code = decoder.add_control_code();
+ int const clear_code = decoder.add_control_code();
+ int const end_of_information_code = decoder.add_control_code();
- const auto& color_map = image.use_global_color_map ? context.logical_screen.color_map : image.color_map;
+ auto const& color_map = image.use_global_color_map ? context.logical_screen.color_map : image.color_map;
int pixel_index = 0;
int row = 0;
@@ -349,7 +349,7 @@ static bool decode_frame(GIFLoadingContext& context, size_t frame_index)
continue;
auto colors = decoder.get_output();
- for (const auto& color : colors) {
+ for (auto const& color : colors) {
auto c = color_map[color];
int x = pixel_index % image.width + image.x;
@@ -599,7 +599,7 @@ static bool load_gif_frame_descriptors(GIFLoadingContext& context)
return true;
}
-GIFImageDecoderPlugin::GIFImageDecoderPlugin(const u8* data, size_t size)
+GIFImageDecoderPlugin::GIFImageDecoderPlugin(u8 const* data, size_t size)
{
m_context = make<GIFLoadingContext>();
m_context->data = data;
diff --git a/Userland/Libraries/LibGfx/GIFLoader.h b/Userland/Libraries/LibGfx/GIFLoader.h
index e42de30106..dbc6065d2a 100644
--- a/Userland/Libraries/LibGfx/GIFLoader.h
+++ b/Userland/Libraries/LibGfx/GIFLoader.h
@@ -16,7 +16,7 @@ struct GIFLoadingContext;
class GIFImageDecoderPlugin final : public ImageDecoderPlugin {
public:
virtual ~GIFImageDecoderPlugin() override;
- GIFImageDecoderPlugin(const u8*, size_t);
+ GIFImageDecoderPlugin(u8 const*, size_t);
virtual IntSize size() override;
virtual void set_volatile() override;
diff --git a/Userland/Libraries/LibGfx/ICOLoader.cpp b/Userland/Libraries/LibGfx/ICOLoader.cpp
index 245b337189..0bdcb05854 100644
--- a/Userland/Libraries/LibGfx/ICOLoader.cpp
+++ b/Userland/Libraries/LibGfx/ICOLoader.cpp
@@ -83,7 +83,7 @@ struct ICOLoadingContext {
BitmapDecoded
};
State state { NotDecoded };
- const u8* data { nullptr };
+ u8 const* data { nullptr };
size_t data_size { 0 };
Vector<ICOImageDescriptor> images;
size_t largest_index;
@@ -117,12 +117,12 @@ static Optional<ICOImageDescriptor> decode_ico_direntry(InputMemoryStream& strea
return { desc };
}
-static size_t find_largest_image(const ICOLoadingContext& context)
+static size_t find_largest_image(ICOLoadingContext const& context)
{
size_t max_area = 0;
size_t index = 0;
size_t largest_index = 0;
- for (const auto& desc : context.images) {
+ for (auto const& desc : context.images) {
if (desc.width * desc.height > max_area) {
max_area = desc.width * desc.height;
largest_index = index;
@@ -227,11 +227,11 @@ static bool load_ico_bmp(ICOLoadingContext& context, ICOImageDescriptor& desc)
return false;
desc.bitmap = bitmap_or_error.release_value_but_fixme_should_propagate_errors();
Bitmap& bitmap = *desc.bitmap;
- const u8* image_base = context.data + desc.offset + sizeof(info);
+ u8 const* image_base = context.data + desc.offset + sizeof(info);
const BMP_ARGB* data_base = (const BMP_ARGB*)image_base;
- const u8* mask_base = image_base + desc.width * desc.height * sizeof(BMP_ARGB);
+ u8 const* mask_base = image_base + desc.width * desc.height * sizeof(BMP_ARGB);
for (int y = 0; y < desc.height; y++) {
- const u8* row_mask = mask_base + mask_row_len * y;
+ u8 const* row_mask = mask_base + mask_row_len * y;
const BMP_ARGB* row_data = data_base + desc.width * y;
for (int x = 0; x < desc.width; x++) {
u8 mask = !!(row_mask[x / 8] & (0x80 >> (x % 8)));
@@ -279,7 +279,7 @@ static bool load_ico_bitmap(ICOLoadingContext& context, Optional<size_t> index)
}
}
-ICOImageDecoderPlugin::ICOImageDecoderPlugin(const u8* data, size_t size)
+ICOImageDecoderPlugin::ICOImageDecoderPlugin(u8 const* data, size_t size)
{
m_context = make<ICOLoadingContext>();
m_context->data = data;
diff --git a/Userland/Libraries/LibGfx/ICOLoader.h b/Userland/Libraries/LibGfx/ICOLoader.h
index b99afcd662..334e60f09c 100644
--- a/Userland/Libraries/LibGfx/ICOLoader.h
+++ b/Userland/Libraries/LibGfx/ICOLoader.h
@@ -15,7 +15,7 @@ struct ICOLoadingContext;
class ICOImageDecoderPlugin final : public ImageDecoderPlugin {
public:
virtual ~ICOImageDecoderPlugin() override;
- ICOImageDecoderPlugin(const u8*, size_t);
+ ICOImageDecoderPlugin(u8 const*, size_t);
virtual IntSize size() override;
virtual void set_volatile() override;
diff --git a/Userland/Libraries/LibGfx/JPGLoader.cpp b/Userland/Libraries/LibGfx/JPGLoader.cpp
index 2ff7f82aee..63c5a7395b 100644
--- a/Userland/Libraries/LibGfx/JPGLoader.cpp
+++ b/Userland/Libraries/LibGfx/JPGLoader.cpp
@@ -172,7 +172,7 @@ struct JPGLoadingContext {
};
State state { State::NotDecoded };
- const u8* data { nullptr };
+ u8 const* data { nullptr };
size_t data_size { 0 };
u32 luma_table[64] = { 0 };
u32 chroma_table[64] = { 0 };
@@ -224,7 +224,7 @@ static Optional<size_t> read_huffman_bits(HuffmanStreamState& hstream, size_t co
return value;
}
-static Optional<u8> get_next_symbol(HuffmanStreamState& hstream, const HuffmanTableSpec& table)
+static Optional<u8> get_next_symbol(HuffmanStreamState& hstream, HuffmanTableSpec const& table)
{
unsigned code = 0;
size_t code_cursor = 0;
@@ -649,7 +649,7 @@ static bool read_huffman_table(InputMemoryStream& stream, JPGLoadingContext& con
return true;
}
-static inline bool validate_luma_and_modify_context(const ComponentSpec& luma, JPGLoadingContext& context)
+static inline bool validate_luma_and_modify_context(ComponentSpec const& luma, JPGLoadingContext& context)
{
if ((luma.hsample_factor == 1 || luma.hsample_factor == 2) && (luma.vsample_factor == 1 || luma.vsample_factor == 2)) {
context.mblock_meta.hpadded_count += luma.hsample_factor == 1 ? 0 : context.mblock_meta.hcount % 2;
@@ -847,7 +847,7 @@ static void dequantize(JPGLoadingContext& context, Vector<Macroblock>& macrobloc
for (u32 hcursor = 0; hcursor < context.mblock_meta.hcount; hcursor += context.hsample_factor) {
for (u32 i = 0; i < context.component_count; i++) {
auto& component = context.components[i];
- const u32* table = component.qtable_id == 0 ? context.luma_table : context.chroma_table;
+ u32 const* table = component.qtable_id == 0 ? context.luma_table : context.chroma_table;
for (u32 vfactor_i = 0; vfactor_i < component.vsample_factor; vfactor_i++) {
for (u32 hfactor_i = 0; hfactor_i < component.hsample_factor; hfactor_i++) {
u32 mb_index = (vcursor + vfactor_i) * context.mblock_meta.hpadded_count + (hfactor_i + hcursor);
@@ -862,22 +862,22 @@ static void dequantize(JPGLoadingContext& context, Vector<Macroblock>& macrobloc
}
}
-static void inverse_dct(const JPGLoadingContext& context, Vector<Macroblock>& macroblocks)
+static void inverse_dct(JPGLoadingContext const& context, Vector<Macroblock>& macroblocks)
{
- static const float m0 = 2.0 * AK::cos(1.0 / 16.0 * 2.0 * AK::Pi<double>);
- static const float m1 = 2.0 * AK::cos(2.0 / 16.0 * 2.0 * AK::Pi<double>);
- static const float m3 = 2.0 * AK::cos(2.0 / 16.0 * 2.0 * AK::Pi<double>);
- static const float m5 = 2.0 * AK::cos(3.0 / 16.0 * 2.0 * AK::Pi<double>);
- static const float m2 = m0 - m5;
- static const float m4 = m0 + m5;
- static const float s0 = AK::cos(0.0 / 16.0 * AK::Pi<double>) / sqrt(8);
- static const float s1 = AK::cos(1.0 / 16.0 * AK::Pi<double>) / 2.0;
- static const float s2 = AK::cos(2.0 / 16.0 * AK::Pi<double>) / 2.0;
- static const float s3 = AK::cos(3.0 / 16.0 * AK::Pi<double>) / 2.0;
- static const float s4 = AK::cos(4.0 / 16.0 * AK::Pi<double>) / 2.0;
- static const float s5 = AK::cos(5.0 / 16.0 * AK::Pi<double>) / 2.0;
- static const float s6 = AK::cos(6.0 / 16.0 * AK::Pi<double>) / 2.0;
- static const float s7 = AK::cos(7.0 / 16.0 * AK::Pi<double>) / 2.0;
+ static float const m0 = 2.0 * AK::cos(1.0 / 16.0 * 2.0 * AK::Pi<double>);
+ static float const m1 = 2.0 * AK::cos(2.0 / 16.0 * 2.0 * AK::Pi<double>);
+ static float const m3 = 2.0 * AK::cos(2.0 / 16.0 * 2.0 * AK::Pi<double>);
+ static float const m5 = 2.0 * AK::cos(3.0 / 16.0 * 2.0 * AK::Pi<double>);
+ static float const m2 = m0 - m5;
+ static float const m4 = m0 + m5;
+ static float const s0 = AK::cos(0.0 / 16.0 * AK::Pi<double>) / sqrt(8);
+ static float const s1 = AK::cos(1.0 / 16.0 * AK::Pi<double>) / 2.0;
+ static float const s2 = AK::cos(2.0 / 16.0 * AK::Pi<double>) / 2.0;
+ static float const s3 = AK::cos(3.0 / 16.0 * AK::Pi<double>) / 2.0;
+ static float const s4 = AK::cos(4.0 / 16.0 * AK::Pi<double>) / 2.0;
+ static float const s5 = AK::cos(5.0 / 16.0 * AK::Pi<double>) / 2.0;
+ static float const s6 = AK::cos(6.0 / 16.0 * AK::Pi<double>) / 2.0;
+ static float const s7 = AK::cos(7.0 / 16.0 * AK::Pi<double>) / 2.0;
for (u32 vcursor = 0; vcursor < context.mblock_meta.vcount; vcursor += context.vsample_factor) {
for (u32 hcursor = 0; hcursor < context.mblock_meta.hcount; hcursor += context.hsample_factor) {
@@ -889,62 +889,62 @@ static void inverse_dct(const JPGLoadingContext& context, Vector<Macroblock>& ma
Macroblock& block = macroblocks[mb_index];
i32* block_component = get_component(block, component_i);
for (u32 k = 0; k < 8; ++k) {
- const float g0 = block_component[0 * 8 + k] * s0;
- const float g1 = block_component[4 * 8 + k] * s4;
- const float g2 = block_component[2 * 8 + k] * s2;
- const float g3 = block_component[6 * 8 + k] * s6;
- const float g4 = block_component[5 * 8 + k] * s5;
- const float g5 = block_component[1 * 8 + k] * s1;
- const float g6 = block_component[7 * 8 + k] * s7;
- const float g7 = block_component[3 * 8 + k] * s3;
-
- const float f0 = g0;
- const float f1 = g1;
- const float f2 = g2;
- const float f3 = g3;
- const float f4 = g4 - g7;
- const float f5 = g5 + g6;
- const float f6 = g5 - g6;
- const float f7 = g4 + g7;
-
- const float e0 = f0;
- const float e1 = f1;
- const float e2 = f2 - f3;
- const float e3 = f2 + f3;
- const float e4 = f4;
- const float e5 = f5 - f7;
- const float e6 = f6;
- const float e7 = f5 + f7;
- const float e8 = f4 + f6;
-
- const float d0 = e0;
- const float d1 = e1;
- const float d2 = e2 * m1;
- const float d3 = e3;
- const float d4 = e4 * m2;
- const float d5 = e5 * m3;
- const float d6 = e6 * m4;
- const float d7 = e7;
- const float d8 = e8 * m5;
-
- const float c0 = d0 + d1;
- const float c1 = d0 - d1;
- const float c2 = d2 - d3;
- const float c3 = d3;
- const float c4 = d4 + d8;
- const float c5 = d5 + d7;
- const float c6 = d6 - d8;
- const float c7 = d7;
- const float c8 = c5 - c6;
-
- const float b0 = c0 + c3;
- const float b1 = c1 + c2;
- const float b2 = c1 - c2;
- const float b3 = c0 - c3;
- const float b4 = c4 - c8;
- const float b5 = c8;
- const float b6 = c6 - c7;
- const float b7 = c7;
+ float const g0 = block_component[0 * 8 + k] * s0;
+ float const g1 = block_component[4 * 8 + k] * s4;
+ float const g2 = block_component[2 * 8 + k] * s2;
+ float const g3 = block_component[6 * 8 + k] * s6;
+ float const g4 = block_component[5 * 8 + k] * s5;
+ float const g5 = block_component[1 * 8 + k] * s1;
+ float const g6 = block_component[7 * 8 + k] * s7;
+ float const g7 = block_component[3 * 8 + k] * s3;
+
+ float const f0 = g0;
+ float const f1 = g1;
+ float const f2 = g2;
+ float const f3 = g3;
+ float const f4 = g4 - g7;
+ float const f5 = g5 + g6;
+ float const f6 = g5 - g6;
+ float const f7 = g4 + g7;
+
+ float const e0 = f0;
+ float const e1 = f1;
+ float const e2 = f2 - f3;
+ float const e3 = f2 + f3;
+ float const e4 = f4;
+ float const e5 = f5 - f7;
+ float const e6 = f6;
+ float const e7 = f5 + f7;
+ float const e8 = f4 + f6;
+
+ float const d0 = e0;
+ float const d1 = e1;
+ float const d2 = e2 * m1;
+ float const d3 = e3;
+ float const d4 = e4 * m2;
+ float const d5 = e5 * m3;
+ float const d6 = e6 * m4;
+ float const d7 = e7;
+ float const d8 = e8 * m5;
+
+ float const c0 = d0 + d1;
+ float const c1 = d0 - d1;
+ float const c2 = d2 - d3;
+ float const c3 = d3;
+ float const c4 = d4 + d8;
+ float const c5 = d5 + d7;
+ float const c6 = d6 - d8;
+ float const c7 = d7;
+ float const c8 = c5 - c6;
+
+ float const b0 = c0 + c3;
+ float const b1 = c1 + c2;
+ float const b2 = c1 - c2;
+ float const b3 = c0 - c3;
+ float const b4 = c4 - c8;
+ float const b5 = c8;
+ float const b6 = c6 - c7;
+ float const b7 = c7;
block_component[0 * 8 + k] = b0 + b7;
block_component[1 * 8 + k] = b1 + b6;
@@ -956,62 +956,62 @@ static void inverse_dct(const JPGLoadingContext& context, Vector<Macroblock>& ma
block_component[7 * 8 + k] = b0 - b7;
}
for (u32 l = 0; l < 8; ++l) {
- const float g0 = block_component[l * 8 + 0] * s0;
- const float g1 = block_component[l * 8 + 4] * s4;
- const float g2 = block_component[l * 8 + 2] * s2;
- const float g3 = block_component[l * 8 + 6] * s6;
- const float g4 = block_component[l * 8 + 5] * s5;
- const float g5 = block_component[l * 8 + 1] * s1;
- const float g6 = block_component[l * 8 + 7] * s7;
- const float g7 = block_component[l * 8 + 3] * s3;
-
- const float f0 = g0;
- const float f1 = g1;
- const float f2 = g2;
- const float f3 = g3;
- const float f4 = g4 - g7;
- const float f5 = g5 + g6;
- const float f6 = g5 - g6;
- const float f7 = g4 + g7;
-
- const float e0 = f0;
- const float e1 = f1;
- const float e2 = f2 - f3;
- const float e3 = f2 + f3;
- const float e4 = f4;
- const float e5 = f5 - f7;
- const float e6 = f6;
- const float e7 = f5 + f7;
- const float e8 = f4 + f6;
-
- const float d0 = e0;
- const float d1 = e1;
- const float d2 = e2 * m1;
- const float d3 = e3;
- const float d4 = e4 * m2;
- const float d5 = e5 * m3;
- const float d6 = e6 * m4;
- const float d7 = e7;
- const float d8 = e8 * m5;
-
- const float c0 = d0 + d1;
- const float c1 = d0 - d1;
- const float c2 = d2 - d3;
- const float c3 = d3;
- const float c4 = d4 + d8;
- const float c5 = d5 + d7;
- const float c6 = d6 - d8;
- const float c7 = d7;
- const float c8 = c5 - c6;
-
- const float b0 = c0 + c3;
- const float b1 = c1 + c2;
- const float b2 = c1 - c2;
- const float b3 = c0 - c3;
- const float b4 = c4 - c8;
- const float b5 = c8;
- const float b6 = c6 - c7;
- const float b7 = c7;
+ float const g0 = block_component[l * 8 + 0] * s0;
+ float const g1 = block_component[l * 8 + 4] * s4;
+ float const g2 = block_component[l * 8 + 2] * s2;
+ float const g3 = block_component[l * 8 + 6] * s6;
+ float const g4 = block_component[l * 8 + 5] * s5;
+ float const g5 = block_component[l * 8 + 1] * s1;
+ float const g6 = block_component[l * 8 + 7] * s7;
+ float const g7 = block_component[l * 8 + 3] * s3;
+
+ float const f0 = g0;
+ float const f1 = g1;
+ float const f2 = g2;
+ float const f3 = g3;
+ float const f4 = g4 - g7;
+ float const f5 = g5 + g6;
+ float const f6 = g5 - g6;
+ float const f7 = g4 + g7;
+
+ float const e0 = f0;
+ float const e1 = f1;
+ float const e2 = f2 - f3;
+ float const e3 = f2 + f3;
+ float const e4 = f4;
+ float const e5 = f5 - f7;
+ float const e6 = f6;
+ float const e7 = f5 + f7;
+ float const e8 = f4 + f6;
+
+ float const d0 = e0;
+ float const d1 = e1;
+ float const d2 = e2 * m1;
+ float const d3 = e3;
+ float const d4 = e4 * m2;
+ float const d5 = e5 * m3;
+ float const d6 = e6 * m4;
+ float const d7 = e7;
+ float const d8 = e8 * m5;
+
+ float const c0 = d0 + d1;
+ float const c1 = d0 - d1;
+ float const c2 = d2 - d3;
+ float const c3 = d3;
+ float const c4 = d4 + d8;
+ float const c5 = d5 + d7;
+ float const c6 = d6 - d8;
+ float const c7 = d7;
+ float const c8 = c5 - c6;
+
+ float const b0 = c0 + c3;
+ float const b1 = c1 + c2;
+ float const b2 = c1 - c2;
+ float const b3 = c0 - c3;
+ float const b4 = c4 - c8;
+ float const b5 = c8;
+ float const b6 = c6 - c7;
+ float const b7 = c7;
block_component[l * 8 + 0] = b0 + b7;
block_component[l * 8 + 1] = b1 + b6;
@@ -1029,12 +1029,12 @@ static void inverse_dct(const JPGLoadingContext& context, Vector<Macroblock>& ma
}
}
-static void ycbcr_to_rgb(const JPGLoadingContext& context, Vector<Macroblock>& macroblocks)
+static void ycbcr_to_rgb(JPGLoadingContext const& context, Vector<Macroblock>& macroblocks)
{
for (u32 vcursor = 0; vcursor < context.mblock_meta.vcount; vcursor += context.vsample_factor) {
for (u32 hcursor = 0; hcursor < context.mblock_meta.hcount; hcursor += context.hsample_factor) {
const u32 chroma_block_index = vcursor * context.mblock_meta.hpadded_count + hcursor;
- const Macroblock& chroma = macroblocks[chroma_block_index];
+ Macroblock const& chroma = macroblocks[chroma_block_index];
// Overflows are intentional.
for (u8 vfactor_i = context.vsample_factor - 1; vfactor_i < context.vsample_factor; --vfactor_i) {
for (u8 hfactor_i = context.hsample_factor - 1; hfactor_i < context.hsample_factor; --hfactor_i) {
@@ -1062,7 +1062,7 @@ static void ycbcr_to_rgb(const JPGLoadingContext& context, Vector<Macroblock>& m
}
}
-static bool compose_bitmap(JPGLoadingContext& context, const Vector<Macroblock>& macroblocks)
+static bool compose_bitmap(JPGLoadingContext& context, Vector<Macroblock> const& macroblocks)
{
auto bitmap_or_error = Bitmap::try_create(BitmapFormat::BGRx8888, { context.frame.width, context.frame.height });
if (bitmap_or_error.is_error())
@@ -1224,7 +1224,7 @@ static bool decode_jpg(JPGLoadingContext& context)
return true;
}
-JPGImageDecoderPlugin::JPGImageDecoderPlugin(const u8* data, size_t size)
+JPGImageDecoderPlugin::JPGImageDecoderPlugin(u8 const* data, size_t size)
{
m_context = make<JPGLoadingContext>();
m_context->data = data;
diff --git a/Userland/Libraries/LibGfx/JPGLoader.h b/Userland/Libraries/LibGfx/JPGLoader.h
index 0813319177..592f8a93a0 100644
--- a/Userland/Libraries/LibGfx/JPGLoader.h
+++ b/Userland/Libraries/LibGfx/JPGLoader.h
@@ -15,7 +15,7 @@ struct JPGLoadingContext;
class JPGImageDecoderPlugin : public ImageDecoderPlugin {
public:
virtual ~JPGImageDecoderPlugin() override;
- JPGImageDecoderPlugin(const u8*, size_t);
+ JPGImageDecoderPlugin(u8 const*, size_t);
virtual IntSize size() override;
virtual void set_volatile() override;
[[nodiscard]] virtual bool set_nonvolatile(bool& was_purged) override;
diff --git a/Userland/Libraries/LibGfx/Matrix.h b/Userland/Libraries/LibGfx/Matrix.h
index 78be55f48f..cbb81daa3c 100644
--- a/Userland/Libraries/LibGfx/Matrix.h
+++ b/Userland/Libraries/LibGfx/Matrix.h
@@ -36,12 +36,12 @@ public:
{
}
- Matrix(const Matrix& other)
+ Matrix(Matrix const& other)
{
__builtin_memcpy(m_elements, other.elements(), sizeof(T) * N * N);
}
- Matrix& operator=(const Matrix& other)
+ Matrix& operator=(Matrix const& other)
{
__builtin_memcpy(m_elements, other.elements(), sizeof(T) * N * N);
return *this;
@@ -50,7 +50,7 @@ public:
constexpr auto elements() const { return m_elements; }
constexpr auto elements() { return m_elements; }
- constexpr Matrix operator*(const Matrix& other) const
+ constexpr Matrix operator*(Matrix const& other) const
{
Matrix product;
for (size_t i = 0; i < N; ++i) {
diff --git a/Userland/Libraries/LibGfx/Matrix4x4.h b/Userland/Libraries/LibGfx/Matrix4x4.h
index ed767e48c9..7ff3ecad99 100644
--- a/Userland/Libraries/LibGfx/Matrix4x4.h
+++ b/Userland/Libraries/LibGfx/Matrix4x4.h
@@ -17,7 +17,7 @@ template<typename T>
using Matrix4x4 = Matrix<4, T>;
template<typename T>
-constexpr static Vector4<T> operator*(const Matrix4x4<T>& m, const Vector4<T>& v)
+constexpr static Vector4<T> operator*(Matrix4x4<T> const& m, Vector4<T> const& v)
{
auto const& elements = m.elements();
return Vector4<T>(
@@ -30,7 +30,7 @@ constexpr static Vector4<T> operator*(const Matrix4x4<T>& m, const Vector4<T>& v
// FIXME: this is a specific Matrix4x4 * Vector3 interaction that implies W=1; maybe move this out of LibGfx
// or replace a Matrix4x4 * Vector4 operation?
template<typename T>
-constexpr static Vector3<T> transform_point(const Matrix4x4<T>& m, const Vector3<T>& p)
+constexpr static Vector3<T> transform_point(Matrix4x4<T> const& m, Vector3<T> const& p)
{
auto const& elements = m.elements();
return Vector3<T>(
@@ -40,7 +40,7 @@ constexpr static Vector3<T> transform_point(const Matrix4x4<T>& m, const Vector3
}
template<typename T>
-constexpr static Matrix4x4<T> translation_matrix(const Vector3<T>& p)
+constexpr static Matrix4x4<T> translation_matrix(Vector3<T> const& p)
{
return Matrix4x4<T>(
1, 0, 0, p.x(),
@@ -50,7 +50,7 @@ constexpr static Matrix4x4<T> translation_matrix(const Vector3<T>& p)
}
template<typename T>
-constexpr static Matrix4x4<T> scale_matrix(const Vector3<T>& s)
+constexpr static Matrix4x4<T> scale_matrix(Vector3<T> const& s)
{
return Matrix4x4<T>(
s.x(), 0, 0, 0,
@@ -60,7 +60,7 @@ constexpr static Matrix4x4<T> scale_matrix(const Vector3<T>& s)
}
template<typename T>
-constexpr static Matrix4x4<T> rotation_matrix(const Vector3<T>& axis, T angle)
+constexpr static Matrix4x4<T> rotation_matrix(Vector3<T> const& axis, T angle)
{
T c, s;
AK::sincos(angle, s, c);
diff --git a/Userland/Libraries/LibGfx/PGMLoader.cpp b/Userland/Libraries/LibGfx/PGMLoader.cpp
index 6e52ef0815..a211209f83 100644
--- a/Userland/Libraries/LibGfx/PGMLoader.cpp
+++ b/Userland/Libraries/LibGfx/PGMLoader.cpp
@@ -13,7 +13,7 @@
namespace Gfx {
-static void set_adjusted_pixels(PGMLoadingContext& context, const Vector<Gfx::Color>& color_data)
+static void set_adjusted_pixels(PGMLoadingContext& context, Vector<Gfx::Color> const& color_data)
{
size_t index = 0;
for (size_t y = 0; y < context.height; ++y) {
diff --git a/Userland/Libraries/LibGfx/PNGLoader.cpp b/Userland/Libraries/LibGfx/PNGLoader.cpp
index 12237b5793..1a5a5247be 100644
--- a/Userland/Libraries/LibGfx/PNGLoader.cpp
+++ b/Userland/Libraries/LibGfx/PNGLoader.cpp
@@ -83,7 +83,7 @@ struct PNGLoadingContext {
BitmapDecoded,
};
State state { State::NotDecoded };
- const u8* data { nullptr };
+ u8 const* data { nullptr };
size_t data_size { 0 };
int width { -1 };
int height { -1 };
@@ -119,7 +119,7 @@ struct PNGLoadingContext {
class Streamer {
public:
- Streamer(const u8* data, size_t size)
+ Streamer(u8 const* data, size_t size)
: m_data_ptr(data)
, m_size_remaining(size)
{
@@ -130,7 +130,7 @@ public:
{
if (m_size_remaining < sizeof(T))
return false;
- value = *((const NetworkOrdered<T>*)m_data_ptr);
+ value = *((NetworkOrdered<T> const*)m_data_ptr);
m_data_ptr += sizeof(T);
m_size_remaining -= sizeof(T);
return true;
@@ -159,7 +159,7 @@ public:
bool at_end() const { return !m_size_remaining; }
private:
- const u8* m_data_ptr { nullptr };
+ u8 const* m_data_ptr { nullptr };
size_t m_size_remaining { 0 };
};
@@ -191,9 +191,9 @@ union [[gnu::packed]] Pixel {
static_assert(AssertSize<Pixel, 4>());
template<bool has_alpha, u8 filter_type>
-ALWAYS_INLINE static void unfilter_impl(Gfx::Bitmap& bitmap, int y, const void* dummy_scanline_data)
+ALWAYS_INLINE static void unfilter_impl(Gfx::Bitmap& bitmap, int y, void const* dummy_scanline_data)
{
- auto* dummy_scanline = (const Pixel*)dummy_scanline_data;
+ auto* dummy_scanline = (Pixel const*)dummy_scanline_data;
if constexpr (filter_type == 0) {
auto* pixels = (Pixel*)bitmap.scanline(y);
for (int i = 0; i < bitmap.width(); ++i) {
@@ -208,7 +208,7 @@ ALWAYS_INLINE static void unfilter_impl(Gfx::Bitmap& bitmap, int y, const void*
for (int i = 1; i < bitmap.width(); ++i) {
auto& x = pixels[i];
swap(x.r, x.b);
- auto& a = (const Pixel&)pixels[i - 1];
+ auto& a = (Pixel const&)pixels[i - 1];
x.v[0] += a.v[0];
x.v[1] += a.v[1];
x.v[2] += a.v[2];
@@ -219,11 +219,11 @@ ALWAYS_INLINE static void unfilter_impl(Gfx::Bitmap& bitmap, int y, const void*
}
if constexpr (filter_type == 2) {
auto* pixels = (Pixel*)bitmap.scanline(y);
- auto* pixels_y_minus_1 = y == 0 ? dummy_scanline : (const Pixel*)bitmap.scanline(y - 1);
+ auto* pixels_y_minus_1 = y == 0 ? dummy_scanline : (Pixel const*)bitmap.scanline(y - 1);
for (int i = 0; i < bitmap.width(); ++i) {
auto& x = pixels[i];
swap(x.r, x.b);
- const Pixel& b = pixels_y_minus_1[i];
+ Pixel const& b = pixels_y_minus_1[i];
x.v[0] += b.v[0];
x.v[1] += b.v[1];
x.v[2] += b.v[2];
@@ -234,14 +234,14 @@ ALWAYS_INLINE static void unfilter_impl(Gfx::Bitmap& bitmap, int y, const void*
}
if constexpr (filter_type == 3) {
auto* pixels = (Pixel*)bitmap.scanline(y);
- auto* pixels_y_minus_1 = y == 0 ? dummy_scanline : (const Pixel*)bitmap.scanline(y - 1);
+ auto* pixels_y_minus_1 = y == 0 ? dummy_scanline : (Pixel const*)bitmap.scanline(y - 1);
for (int i = 0; i < bitmap.width(); ++i) {
auto& x = pixels[i];
swap(x.r, x.b);
Pixel a;
if (i != 0)
a = pixels[i - 1];
- const Pixel& b = pixels_y_minus_1[i];
+ Pixel const& b = pixels_y_minus_1[i];
x.v[0] = x.v[0] + ((a.v[0] + b.v[0]) / 2);
x.v[1] = x.v[1] + ((a.v[1] + b.v[1]) / 2);
x.v[2] = x.v[2] + ((a.v[2] + b.v[2]) / 2);
@@ -257,7 +257,7 @@ ALWAYS_INLINE static void unfilter_impl(Gfx::Bitmap& bitmap, int y, const void*
auto& x = pixels[i];
swap(x.r, x.b);
Pixel a;
- const Pixel& b = pixels_y_minus_1[i];
+ Pixel const& b = pixels_y_minus_1[i];
Pixel c;
if (i != 0) {
a = pixels[i - 1];
@@ -291,7 +291,7 @@ template<typename T>
ALWAYS_INLINE static void unpack_grayscale_with_alpha(PNGLoadingContext& context)
{
for (int y = 0; y < context.height; ++y) {
- auto* tuples = reinterpret_cast<const Tuple<T>*>(context.scanlines[y].data.data());
+ auto* tuples = reinterpret_cast<Tuple<T> const*>(context.scanlines[y].data.data());
for (int i = 0; i < context.width; ++i) {
auto& pixel = (Pixel&)context.bitmap->scanline(y)[i];
pixel.r = tuples[i].gray;
@@ -306,7 +306,7 @@ template<typename T>
ALWAYS_INLINE static void unpack_triplets_without_alpha(PNGLoadingContext& context)
{
for (int y = 0; y < context.height; ++y) {
- auto* triplets = reinterpret_cast<const Triplet<T>*>(context.scanlines[y].data.data());
+ auto* triplets = reinterpret_cast<Triplet<T> const*>(context.scanlines[y].data.data());
for (int i = 0; i < context.width; ++i) {
auto& pixel = (Pixel&)context.bitmap->scanline(y)[i];
pixel.r = triplets[i].r;
@@ -321,7 +321,7 @@ template<typename T>
ALWAYS_INLINE static void unpack_triplets_with_transparency_value(PNGLoadingContext& context, Triplet<T> transparency_value)
{
for (int y = 0; y < context.height; ++y) {
- auto* triplets = reinterpret_cast<const Triplet<T>*>(context.scanlines[y].data.data());
+ auto* triplets = reinterpret_cast<Triplet<T> const*>(context.scanlines[y].data.data());
for (int i = 0; i < context.width; ++i) {
auto& pixel = (Pixel&)context.bitmap->scanline(y)[i];
pixel.r = triplets[i].r;
@@ -401,7 +401,7 @@ NEVER_INLINE FLATTEN static ErrorOr<void> unfilter(PNGLoadingContext& context)
}
} else if (context.bit_depth == 16) {
for (int y = 0; y < context.height; ++y) {
- auto* triplets = reinterpret_cast<const Quad<u16>*>(context.scanlines[y].data.data());
+ auto* triplets = reinterpret_cast<Quad<u16> const*>(context.scanlines[y].data.data());
for (int i = 0; i < context.width; ++i) {
auto& pixel = (Pixel&)context.bitmap->scanline(y)[i];
pixel.r = triplets[i].r & 0xFF;
@@ -538,7 +538,7 @@ static bool decode_png_size(PNGLoadingContext& context)
return false;
}
- const u8* data_ptr = context.data + sizeof(png_header);
+ u8 const* data_ptr = context.data + sizeof(png_header);
size_t data_remaining = context.data_size - sizeof(png_header);
Streamer streamer(data_ptr, data_remaining);
@@ -566,7 +566,7 @@ static bool decode_png_chunks(PNGLoadingContext& context)
return false;
}
- const u8* data_ptr = context.data + sizeof(png_header);
+ u8 const* data_ptr = context.data + sizeof(png_header);
int data_remaining = context.data_size - sizeof(png_header);
context.compressed_data.ensure_capacity(context.data_size);
@@ -861,7 +861,7 @@ static bool process_IDAT(ReadonlyBytes data, PNGLoadingContext& context)
static bool process_PLTE(ReadonlyBytes data, PNGLoadingContext& context)
{
- context.palette_data.append((const PaletteEntry*)data.data(), data.size() / 3);
+ context.palette_data.append((PaletteEntry const*)data.data(), data.size() / 3);
return true;
}
@@ -902,18 +902,18 @@ static bool process_chunk(Streamer& streamer, PNGLoadingContext& context)
}
dbgln_if(PNG_DEBUG, "Chunk type: '{}', size: {}, crc: {:x}", chunk_type, chunk_size, chunk_crc);
- if (!strcmp((const char*)chunk_type, "IHDR"))
+ if (!strcmp((char const*)chunk_type, "IHDR"))
return process_IHDR(chunk_data, context);
- if (!strcmp((const char*)chunk_type, "IDAT"))
+ if (!strcmp((char const*)chunk_type, "IDAT"))
return process_IDAT(chunk_data, context);
- if (!strcmp((const char*)chunk_type, "PLTE"))
+ if (!strcmp((char const*)chunk_type, "PLTE"))
return process_PLTE(chunk_data, context);
- if (!strcmp((const char*)chunk_type, "tRNS"))
+ if (!strcmp((char const*)chunk_type, "tRNS"))
return process_tRNS(chunk_data, context);
return true;
}
-PNGImageDecoderPlugin::PNGImageDecoderPlugin(const u8* data, size_t size)
+PNGImageDecoderPlugin::PNGImageDecoderPlugin(u8 const* data, size_t size)
{
m_context = make<PNGLoadingContext>();
m_context->data = data;
diff --git a/Userland/Libraries/LibGfx/PNGLoader.h b/Userland/Libraries/LibGfx/PNGLoader.h
index 9f7c0e7b6c..8e11319b5b 100644
--- a/Userland/Libraries/LibGfx/PNGLoader.h
+++ b/Userland/Libraries/LibGfx/PNGLoader.h
@@ -15,7 +15,7 @@ struct PNGLoadingContext;
class PNGImageDecoderPlugin final : public ImageDecoderPlugin {
public:
virtual ~PNGImageDecoderPlugin() override;
- PNGImageDecoderPlugin(const u8*, size_t);
+ PNGImageDecoderPlugin(u8 const*, size_t);
virtual IntSize size() override;
virtual void set_volatile() override;
diff --git a/Userland/Libraries/LibGfx/Palette.cpp b/Userland/Libraries/LibGfx/Palette.cpp
index b6d6711a47..504cdf6b2a 100644
--- a/Userland/Libraries/LibGfx/Palette.cpp
+++ b/Userland/Libraries/LibGfx/Palette.cpp
@@ -22,7 +22,7 @@ PaletteImpl::PaletteImpl(Core::AnonymousBuffer buffer)
{
}
-Palette::Palette(const PaletteImpl& impl)
+Palette::Palette(PaletteImpl const& impl)
: m_impl(impl)
{
}
diff --git a/Userland/Libraries/LibGfx/Palette.h b/Userland/Libraries/LibGfx/Palette.h
index 365e8cc2e0..2d88cddc1b 100644
--- a/Userland/Libraries/LibGfx/Palette.h
+++ b/Userland/Libraries/LibGfx/Palette.h
@@ -46,7 +46,7 @@ public:
int metric(MetricRole) const;
String path(PathRole) const;
- const SystemTheme& theme() const { return *m_theme_buffer.data<SystemTheme>(); }
+ SystemTheme const& theme() const { return *m_theme_buffer.data<SystemTheme>(); }
void replace_internal_buffer(Badge<GUI::Application>, Core::AnonymousBuffer buffer);
@@ -59,7 +59,7 @@ private:
class Palette {
public:
- explicit Palette(const PaletteImpl&);
+ explicit Palette(PaletteImpl const&);
~Palette() = default;
Color accent() const { return color(ColorRole::Accent); }
@@ -169,10 +169,10 @@ public:
void set_metric(MetricRole, int);
void set_path(PathRole, String);
- const SystemTheme& theme() const { return m_impl->theme(); }
+ SystemTheme const& theme() const { return m_impl->theme(); }
PaletteImpl& impl() { return *m_impl; }
- const PaletteImpl& impl() const { return *m_impl; }
+ PaletteImpl const& impl() const { return *m_impl; }
private:
NonnullRefPtr<PaletteImpl> m_impl;
diff --git a/Userland/Libraries/LibGfx/Path.cpp b/Userland/Libraries/LibGfx/Path.cpp
index 7b40796f52..85500700aa 100644
--- a/Userland/Libraries/LibGfx/Path.cpp
+++ b/Userland/Libraries/LibGfx/Path.cpp
@@ -14,7 +14,7 @@
namespace Gfx {
-void Path::elliptical_arc_to(const FloatPoint& point, const FloatPoint& radii, double x_axis_rotation, bool large_arc, bool sweep)
+void Path::elliptical_arc_to(FloatPoint const& point, FloatPoint const& radii, double x_axis_rotation, bool large_arc, bool sweep)
{
auto next_point = point;
@@ -207,16 +207,16 @@ String Path::to_string() const
switch (segment.type()) {
case Segment::Type::QuadraticBezierCurveTo:
builder.append(", ");
- builder.append(static_cast<const QuadraticBezierCurveSegment&>(segment).through().to_string());
+ builder.append(static_cast<QuadraticBezierCurveSegment const&>(segment).through().to_string());
break;
case Segment::Type::CubicBezierCurveTo:
builder.append(", ");
- builder.append(static_cast<const CubicBezierCurveSegment&>(segment).through_0().to_string());
+ builder.append(static_cast<CubicBezierCurveSegment const&>(segment).through_0().to_string());
builder.append(", ");
- builder.append(static_cast<const CubicBezierCurveSegment&>(segment).through_1().to_string());
+ builder.append(static_cast<CubicBezierCurveSegment const&>(segment).through_1().to_string());
break;
case Segment::Type::EllipticalArcTo: {
- auto& arc = static_cast<const EllipticalArcSegment&>(segment);
+ auto& arc = static_cast<EllipticalArcSegment const&>(segment);
builder.appendff(", {}, {}, {}, {}, {}",
arc.radii().to_string().characters(),
arc.center().to_string().characters(),
@@ -243,7 +243,7 @@ void Path::segmentize_path()
float max_x = 0;
float max_y = 0;
- auto add_point_to_bbox = [&](const Gfx::FloatPoint& point) {
+ auto add_point_to_bbox = [&](Gfx::FloatPoint const& point) {
float x = point.x();
float y = point.y();
min_x = min(min_x, x);
@@ -252,7 +252,7 @@ void Path::segmentize_path()
max_y = max(max_y, y);
};
- auto add_line = [&](const auto& p0, const auto& p1) {
+ auto add_line = [&](auto const& p0, auto const& p1) {
float ymax = p0.y(), ymin = p1.y(), x_of_ymin = p1.x(), x_of_ymax = p0.x();
auto slope = p0.x() == p1.x() ? 0 : ((float)(p0.y() - p1.y())) / ((float)(p0.x() - p1.x()));
if (p0.y() < p1.y()) {
@@ -292,7 +292,7 @@ void Path::segmentize_path()
}
case Segment::Type::QuadraticBezierCurveTo: {
auto& control = static_cast<QuadraticBezierCurveSegment&>(segment).through();
- Painter::for_each_line_segment_on_bezier_curve(control, cursor, segment.point(), [&](const FloatPoint& p0, const FloatPoint& p1) {
+ Painter::for_each_line_segment_on_bezier_curve(control, cursor, segment.point(), [&](FloatPoint const& p0, FloatPoint const& p1) {
add_line(p0, p1);
});
cursor = segment.point();
@@ -302,7 +302,7 @@ void Path::segmentize_path()
auto& curve = static_cast<CubicBezierCurveSegment const&>(segment);
auto& control_0 = curve.through_0();
auto& control_1 = curve.through_1();
- Painter::for_each_line_segment_on_cubic_bezier_curve(control_0, control_1, cursor, segment.point(), [&](const FloatPoint& p0, const FloatPoint& p1) {
+ Painter::for_each_line_segment_on_cubic_bezier_curve(control_0, control_1, cursor, segment.point(), [&](FloatPoint const& p0, FloatPoint const& p1) {
add_line(p0, p1);
});
cursor = segment.point();
@@ -310,7 +310,7 @@ void Path::segmentize_path()
}
case Segment::Type::EllipticalArcTo: {
auto& arc = static_cast<EllipticalArcSegment&>(segment);
- Painter::for_each_line_segment_on_elliptical_arc(cursor, arc.point(), arc.center(), arc.radii(), arc.x_axis_rotation(), arc.theta_1(), arc.theta_delta(), [&](const FloatPoint& p0, const FloatPoint& p1) {
+ Painter::for_each_line_segment_on_elliptical_arc(cursor, arc.point(), arc.center(), arc.radii(), arc.x_axis_rotation(), arc.theta_1(), arc.theta_delta(), [&](FloatPoint const& p0, FloatPoint const& p1) {
add_line(p0, p1);
});
cursor = segment.point();
@@ -324,7 +324,7 @@ void Path::segmentize_path()
}
// sort segments by ymax
- quick_sort(segments, [](const auto& line0, const auto& line1) {
+ quick_sort(segments, [](auto const& line0, auto const& line1) {
return line1.maximum_y < line0.maximum_y;
});
diff --git a/Userland/Libraries/LibGfx/Path.h b/Userland/Libraries/LibGfx/Path.h
index cad1c88099..7c0ba83090 100644
--- a/Userland/Libraries/LibGfx/Path.h
+++ b/Userland/Libraries/LibGfx/Path.h
@@ -28,14 +28,14 @@ public:
EllipticalArcTo,
};
- Segment(const FloatPoint& point)
+ Segment(FloatPoint const& point)
: m_point(point)
{
}
virtual ~Segment() = default;
- const FloatPoint& point() const { return m_point; }
+ FloatPoint const& point() const { return m_point; }
virtual Type type() const = 0;
protected:
@@ -44,7 +44,7 @@ protected:
class MoveSegment final : public Segment {
public:
- MoveSegment(const FloatPoint& point)
+ MoveSegment(FloatPoint const& point)
: Segment(point)
{
}
@@ -55,7 +55,7 @@ private:
class LineSegment final : public Segment {
public:
- LineSegment(const FloatPoint& point)
+ LineSegment(FloatPoint const& point)
: Segment(point)
{
}
@@ -68,7 +68,7 @@ private:
class QuadraticBezierCurveSegment final : public Segment {
public:
- QuadraticBezierCurveSegment(const FloatPoint& point, const FloatPoint& through)
+ QuadraticBezierCurveSegment(FloatPoint const& point, FloatPoint const& through)
: Segment(point)
, m_through(through)
{
@@ -76,7 +76,7 @@ public:
virtual ~QuadraticBezierCurveSegment() override = default;
- const FloatPoint& through() const { return m_through; }
+ FloatPoint const& through() const { return m_through; }
private:
virtual Type type() const override { return Segment::Type::QuadraticBezierCurveTo; }
@@ -86,7 +86,7 @@ private:
class CubicBezierCurveSegment final : public Segment {
public:
- CubicBezierCurveSegment(const FloatPoint& point, const FloatPoint& through_0, const FloatPoint& through_1)
+ CubicBezierCurveSegment(FloatPoint const& point, FloatPoint const& through_0, FloatPoint const& through_1)
: Segment(point)
, m_through_0(through_0)
, m_through_1(through_1)
@@ -95,8 +95,8 @@ public:
virtual ~CubicBezierCurveSegment() override = default;
- const FloatPoint& through_0() const { return m_through_0; }
- const FloatPoint& through_1() const { return m_through_1; }
+ FloatPoint const& through_0() const { return m_through_0; }
+ FloatPoint const& through_1() const { return m_through_1; }
private:
virtual Type type() const override { return Segment::Type::CubicBezierCurveTo; }
@@ -107,7 +107,7 @@ private:
class EllipticalArcSegment final : public Segment {
public:
- EllipticalArcSegment(const FloatPoint& point, const FloatPoint& center, const FloatPoint radii, float x_axis_rotation, float theta_1, float theta_delta, bool large_arc, bool sweep)
+ EllipticalArcSegment(FloatPoint const& point, FloatPoint const& center, const FloatPoint radii, float x_axis_rotation, float theta_1, float theta_delta, bool large_arc, bool sweep)
: Segment(point)
, m_center(center)
, m_radii(radii)
@@ -121,8 +121,8 @@ public:
virtual ~EllipticalArcSegment() override = default;
- const FloatPoint& center() const { return m_center; }
- const FloatPoint& radii() const { return m_radii; }
+ FloatPoint const& center() const { return m_center; }
+ FloatPoint const& radii() const { return m_radii; }
float x_axis_rotation() const { return m_x_axis_rotation; }
float theta_1() const { return m_theta_1; }
float theta_delta() const { return m_theta_delta; }
@@ -145,12 +145,12 @@ class Path {
public:
Path() = default;
- void move_to(const FloatPoint& point)
+ void move_to(FloatPoint const& point)
{
append_segment<MoveSegment>(point);
}
- void line_to(const FloatPoint& point)
+ void line_to(FloatPoint const& point)
{
append_segment<LineSegment>(point);
invalidate_split_lines();
@@ -172,7 +172,7 @@ public:
line_to({ previous_x, y });
}
- void quadratic_bezier_curve_to(const FloatPoint& through, const FloatPoint& point)
+ void quadratic_bezier_curve_to(FloatPoint const& through, FloatPoint const& point)
{
append_segment<QuadraticBezierCurveSegment>(point, through);
invalidate_split_lines();
@@ -184,14 +184,14 @@ public:
invalidate_split_lines();
}
- void elliptical_arc_to(const FloatPoint& point, const FloatPoint& radii, double x_axis_rotation, bool large_arc, bool sweep);
- void arc_to(const FloatPoint& point, float radius, bool large_arc, bool sweep)
+ void elliptical_arc_to(FloatPoint const& point, FloatPoint const& radii, double x_axis_rotation, bool large_arc, bool sweep);
+ void arc_to(FloatPoint const& point, float radius, bool large_arc, bool sweep)
{
elliptical_arc_to(point, { radius, radius }, 0, large_arc, sweep);
}
// Note: This does not do any sanity checks!
- void elliptical_arc_to(const FloatPoint& endpoint, const FloatPoint& center, const FloatPoint& radii, double x_axis_rotation, double theta, double theta_delta, bool large_arc, bool sweep)
+ void elliptical_arc_to(FloatPoint const& endpoint, FloatPoint const& center, FloatPoint const& radii, double x_axis_rotation, double theta, double theta_delta, bool large_arc, bool sweep)
{
append_segment<EllipticalArcSegment>(
endpoint,
@@ -218,7 +218,7 @@ public:
float x;
};
- const NonnullRefPtrVector<Segment>& segments() const { return m_segments; }
+ NonnullRefPtrVector<Segment> const& segments() const { return m_segments; }
auto& split_lines() const
{
if (!m_split_lines.has_value()) {
diff --git a/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h b/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h
index c5cb419095..c1a67a3b23 100644
--- a/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h
+++ b/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h
@@ -45,7 +45,7 @@ static bool read_number(Streamer& streamer, TValue* value)
sb.append(byte);
}
- const auto opt_value = sb.to_string().to_uint();
+ auto const opt_value = sb.to_string().to_uint();
if (!opt_value.has_value()) {
*value = 0;
return false;
@@ -133,7 +133,7 @@ static bool read_whitespace(TContext& context, Streamer& streamer)
template<typename TContext>
static bool read_width(TContext& context, Streamer& streamer)
{
- if (const bool result = read_number(streamer, &context.width);
+ if (bool const result = read_number(streamer, &context.width);
!result || context.width == 0) {
return false;
}
@@ -145,7 +145,7 @@ static bool read_width(TContext& context, Streamer& streamer)
template<typename TContext>
static bool read_height(TContext& context, Streamer& streamer)
{
- if (const bool result = read_number(streamer, &context.height);
+ if (bool const result = read_number(streamer, &context.height);
!result || context.height == 0) {
return false;
}
@@ -157,7 +157,7 @@ static bool read_height(TContext& context, Streamer& streamer)
template<typename TContext>
static bool read_max_val(TContext& context, Streamer& streamer)
{
- if (const bool result = read_number(streamer, &context.format_details.max_val);
+ if (bool const result = read_number(streamer, &context.format_details.max_val);
!result || context.format_details.max_val == 0) {
return false;
}
@@ -185,7 +185,7 @@ static bool create_bitmap(TContext& context)
}
template<typename TContext>
-static void set_pixels(TContext& context, const Vector<Gfx::Color>& color_data)
+static void set_pixels(TContext& context, Vector<Gfx::Color> const& color_data)
{
size_t index = 0;
for (size_t y = 0; y < context.height; ++y) {
@@ -248,7 +248,7 @@ static bool decode(TContext& context)
}
template<typename TContext>
-static RefPtr<Gfx::Bitmap> load_impl(const u8* data, size_t data_size)
+static RefPtr<Gfx::Bitmap> load_impl(u8 const* data, size_t data_size)
{
TContext context {};
context.data = data;
diff --git a/Userland/Libraries/LibGfx/PortableImageMapLoader.h b/Userland/Libraries/LibGfx/PortableImageMapLoader.h
index f854cd75eb..994a86961c 100644
--- a/Userland/Libraries/LibGfx/PortableImageMapLoader.h
+++ b/Userland/Libraries/LibGfx/PortableImageMapLoader.h
@@ -49,7 +49,7 @@ struct PortableImageMapLoadingContext {
template<typename TContext>
class PortableImageDecoderPlugin final : public ImageDecoderPlugin {
public:
- PortableImageDecoderPlugin(const u8*, size_t);
+ PortableImageDecoderPlugin(u8 const*, size_t);
virtual ~PortableImageDecoderPlugin() override = default;
virtual IntSize size() override;
@@ -69,7 +69,7 @@ private:
};
template<typename TContext>
-PortableImageDecoderPlugin<TContext>::PortableImageDecoderPlugin(const u8* data, size_t size)
+PortableImageDecoderPlugin<TContext>::PortableImageDecoderPlugin(u8 const* data, size_t size)
{
m_context = make<TContext>();
m_context->data = data;
diff --git a/Userland/Libraries/LibGfx/Rect.cpp b/Userland/Libraries/LibGfx/Rect.cpp
index 3c8714195a..64db8e6270 100644
--- a/Userland/Libraries/LibGfx/Rect.cpp
+++ b/Userland/Libraries/LibGfx/Rect.cpp
@@ -170,7 +170,7 @@ Point<T> Rect<T>::closest_to(Point<T> const& point) const
return {};
Optional<Point<T>> closest_point;
float closest_distance = 0.0;
- auto check_distance = [&](const Line<T>& line) {
+ auto check_distance = [&](Line<T> const& line) {
auto point_on_line = line.closest_to(point);
auto distance = Line { point_on_line, point }.length();
if (!closest_point.has_value() || distance < closest_distance) {
diff --git a/Userland/Libraries/LibGfx/Rect.h b/Userland/Libraries/LibGfx/Rect.h
index 57b7d249c6..82534cae6f 100644
--- a/Userland/Libraries/LibGfx/Rect.h
+++ b/Userland/Libraries/LibGfx/Rect.h
@@ -752,7 +752,7 @@ struct Formatter<Gfx::Rect<T>> : Formatter<StringView> {
namespace IPC {
-bool encode(Encoder&, const Gfx::IntRect&);
+bool encode(Encoder&, Gfx::IntRect const&);
ErrorOr<void> decode(Decoder&, Gfx::IntRect&);
}
diff --git a/Userland/Libraries/LibGfx/ShareableBitmap.cpp b/Userland/Libraries/LibGfx/ShareableBitmap.cpp
index f76be7d897..2be857d4de 100644
--- a/Userland/Libraries/LibGfx/ShareableBitmap.cpp
+++ b/Userland/Libraries/LibGfx/ShareableBitmap.cpp
@@ -22,7 +22,7 @@ ShareableBitmap::ShareableBitmap(NonnullRefPtr<Bitmap> bitmap, Tag)
namespace IPC {
-bool encode(Encoder& encoder, const Gfx::ShareableBitmap& shareable_bitmap)
+bool encode(Encoder& encoder, Gfx::ShareableBitmap const& shareable_bitmap)
{
encoder << shareable_bitmap.is_valid();
if (!shareable_bitmap.is_valid())
diff --git a/Userland/Libraries/LibGfx/ShareableBitmap.h b/Userland/Libraries/LibGfx/ShareableBitmap.h
index 3eefade8ac..04e5985582 100644
--- a/Userland/Libraries/LibGfx/ShareableBitmap.h
+++ b/Userland/Libraries/LibGfx/ShareableBitmap.h
@@ -21,7 +21,7 @@ public:
bool is_valid() const { return m_bitmap; }
- const Bitmap* bitmap() const { return m_bitmap; }
+ Bitmap const* bitmap() const { return m_bitmap; }
Bitmap* bitmap() { return m_bitmap; }
private:
@@ -34,7 +34,7 @@ private:
namespace IPC {
-bool encode(Encoder&, const Gfx::ShareableBitmap&);
+bool encode(Encoder&, Gfx::ShareableBitmap const&);
ErrorOr<void> decode(Decoder&, Gfx::ShareableBitmap&);
}
diff --git a/Userland/Libraries/LibGfx/Streamer.h b/Userland/Libraries/LibGfx/Streamer.h
index 1de269e7fe..15acbd1106 100644
--- a/Userland/Libraries/LibGfx/Streamer.h
+++ b/Userland/Libraries/LibGfx/Streamer.h
@@ -16,7 +16,7 @@ namespace Gfx {
class Streamer {
public:
- constexpr Streamer(const u8* data, size_t size)
+ constexpr Streamer(u8 const* data, size_t size)
: m_data_ptr(data)
, m_size_remaining(size)
{
@@ -52,7 +52,7 @@ public:
}
private:
- const u8* m_data_ptr { nullptr };
+ u8 const* m_data_ptr { nullptr };
size_t m_size_remaining { 0 };
};
diff --git a/Userland/Libraries/LibGfx/StylePainter.cpp b/Userland/Libraries/LibGfx/StylePainter.cpp
index 286fc03684..8fbec27c83 100644
--- a/Userland/Libraries/LibGfx/StylePainter.cpp
+++ b/Userland/Libraries/LibGfx/StylePainter.cpp
@@ -18,42 +18,42 @@ BaseStylePainter& StylePainter::current()
return style;
}
-void StylePainter::paint_tab_button(Painter& painter, const IntRect& rect, const Palette& palette, bool active, bool hovered, bool enabled, bool top, bool in_active_window)
+void StylePainter::paint_tab_button(Painter& painter, IntRect const& rect, Palette const& palette, bool active, bool hovered, bool enabled, bool top, bool in_active_window)
{
current().paint_tab_button(painter, rect, palette, active, hovered, enabled, top, in_active_window);
}
-void StylePainter::paint_button(Painter& painter, const IntRect& rect, const Palette& palette, ButtonStyle button_style, bool pressed, bool hovered, bool checked, bool enabled, bool focused, bool default_button)
+void StylePainter::paint_button(Painter& painter, IntRect const& rect, Palette const& palette, ButtonStyle button_style, bool pressed, bool hovered, bool checked, bool enabled, bool focused, bool default_button)
{
current().paint_button(painter, rect, palette, button_style, pressed, hovered, checked, enabled, focused, default_button);
}
-void StylePainter::paint_frame(Painter& painter, const IntRect& rect, const Palette& palette, FrameShape shape, FrameShadow shadow, int thickness, bool skip_vertical_lines)
+void StylePainter::paint_frame(Painter& painter, IntRect const& rect, Palette const& palette, FrameShape shape, FrameShadow shadow, int thickness, bool skip_vertical_lines)
{
current().paint_frame(painter, rect, palette, shape, shadow, thickness, skip_vertical_lines);
}
-void StylePainter::paint_window_frame(Painter& painter, const IntRect& rect, const Palette& palette)
+void StylePainter::paint_window_frame(Painter& painter, IntRect const& rect, Palette const& palette)
{
current().paint_window_frame(painter, rect, palette);
}
-void StylePainter::paint_progressbar(Painter& painter, const IntRect& rect, const Palette& palette, int min, int max, int value, StringView text, Orientation orientation)
+void StylePainter::paint_progressbar(Painter& painter, IntRect const& rect, Palette const& palette, int min, int max, int value, StringView text, Orientation orientation)
{
current().paint_progressbar(painter, rect, palette, min, max, value, text, orientation);
}
-void StylePainter::paint_radio_button(Painter& painter, const IntRect& rect, const Palette& palette, bool is_checked, bool is_being_pressed)
+void StylePainter::paint_radio_button(Painter& painter, IntRect const& rect, Palette const& palette, bool is_checked, bool is_being_pressed)
{
current().paint_radio_button(painter, rect, palette, is_checked, is_being_pressed);
}
-void StylePainter::paint_check_box(Painter& painter, const IntRect& rect, const Palette& palette, bool is_enabled, bool is_checked, bool is_being_pressed)
+void StylePainter::paint_check_box(Painter& painter, IntRect const& rect, Palette const& palette, bool is_enabled, bool is_checked, bool is_being_pressed)
{
current().paint_check_box(painter, rect, palette, is_enabled, is_checked, is_being_pressed);
}
-void StylePainter::paint_transparency_grid(Painter& painter, const IntRect& rect, const Palette& palette)
+void StylePainter::paint_transparency_grid(Painter& painter, IntRect const& rect, Palette const& palette)
{
current().paint_transparency_grid(painter, rect, palette);
}
diff --git a/Userland/Libraries/LibGfx/SystemTheme.cpp b/Userland/Libraries/LibGfx/SystemTheme.cpp
index ed52299c08..815d0a62cc 100644
--- a/Userland/Libraries/LibGfx/SystemTheme.cpp
+++ b/Userland/Libraries/LibGfx/SystemTheme.cpp
@@ -13,7 +13,7 @@
namespace Gfx {
static SystemTheme dummy_theme;
-static const SystemTheme* theme_page = &dummy_theme;
+static SystemTheme const* theme_page = &dummy_theme;
static Core::AnonymousBuffer theme_buffer;
Core::AnonymousBuffer& current_system_theme_buffer()
diff --git a/Userland/Libraries/LibGfx/SystemTheme.h b/Userland/Libraries/LibGfx/SystemTheme.h
index 769760c6dd..bc712ca7eb 100644
--- a/Userland/Libraries/LibGfx/SystemTheme.h
+++ b/Userland/Libraries/LibGfx/SystemTheme.h
@@ -135,7 +135,7 @@ enum class ColorRole {
DisabledText = ThreedShadow1,
};
-inline const char* to_string(ColorRole role)
+inline char const* to_string(ColorRole role)
{
switch (role) {
case ColorRole::NoRole:
@@ -162,7 +162,7 @@ enum class AlignmentRole {
__Count,
};
-inline const char* to_string(AlignmentRole role)
+inline char const* to_string(AlignmentRole role)
{
switch (role) {
case AlignmentRole::NoRole:
@@ -189,7 +189,7 @@ enum class FlagRole {
__Count,
};
-inline const char* to_string(FlagRole role)
+inline char const* to_string(FlagRole role)
{
switch (role) {
case FlagRole::NoRole:
@@ -216,7 +216,7 @@ enum class MetricRole {
__Count,
};
-inline const char* to_string(MetricRole role)
+inline char const* to_string(MetricRole role)
{
switch (role) {
case MetricRole::NoRole:
@@ -243,7 +243,7 @@ enum class PathRole {
__Count,
};
-inline const char* to_string(PathRole role)
+inline char const* to_string(PathRole role)
{
switch (role) {
case PathRole::NoRole:
diff --git a/Userland/Libraries/LibGfx/TextAlignment.h b/Userland/Libraries/LibGfx/TextAlignment.h
index 9c0f7a38d2..9d869fd3e1 100644
--- a/Userland/Libraries/LibGfx/TextAlignment.h
+++ b/Userland/Libraries/LibGfx/TextAlignment.h
@@ -62,7 +62,7 @@ inline Optional<TextAlignment> text_alignment_from_string(StringView string)
return {};
}
-inline const char* to_string(TextAlignment text_alignment)
+inline char const* to_string(TextAlignment text_alignment)
{
#define __ENUMERATE(x) \
if (text_alignment == TextAlignment::x) \
diff --git a/Userland/Libraries/LibGfx/TextDirection.h b/Userland/Libraries/LibGfx/TextDirection.h
index dc5ef5b184..20ac54d4b2 100644
--- a/Userland/Libraries/LibGfx/TextDirection.h
+++ b/Userland/Libraries/LibGfx/TextDirection.h
@@ -20,7 +20,7 @@ enum class BidirectionalClass {
NEUTRAL,
};
-extern const Array<BidirectionalClass, 0x1F000> char_bidi_class_lookup_table;
+extern Array<BidirectionalClass, 0x1F000> const char_bidi_class_lookup_table;
constexpr BidirectionalClass get_char_bidi_class(u32 ch)
{
diff --git a/Userland/Libraries/LibGfx/Typeface.cpp b/Userland/Libraries/LibGfx/Typeface.cpp
index 87ba7eaf40..4c6f2be4c4 100644
--- a/Userland/Libraries/LibGfx/Typeface.cpp
+++ b/Userland/Libraries/LibGfx/Typeface.cpp
@@ -77,7 +77,7 @@ RefPtr<Font> Typeface::get_font(float point_size, Font::AllowInexactSizeMatch al
return {};
}
-void Typeface::for_each_fixed_size_font(Function<void(const Font&)> callback) const
+void Typeface::for_each_fixed_size_font(Function<void(Font const&)> callback) const
{
for (auto font : m_bitmap_fonts) {
callback(*font);
diff --git a/Userland/Libraries/LibGfx/Typeface.h b/Userland/Libraries/LibGfx/Typeface.h
index 10b865d8bc..fb2600862d 100644
--- a/Userland/Libraries/LibGfx/Typeface.h
+++ b/Userland/Libraries/LibGfx/Typeface.h
@@ -18,7 +18,7 @@ namespace Gfx {
class Typeface : public RefCounted<Typeface> {
public:
- Typeface(const String& family, const String& variant)
+ Typeface(String const& family, String const& variant)
: m_family(family)
, m_variant(variant)
{
@@ -31,7 +31,7 @@ public:
bool is_fixed_width() const;
bool is_fixed_size() const { return !m_bitmap_fonts.is_empty(); }
- void for_each_fixed_size_font(Function<void(const Font&)>) const;
+ void for_each_fixed_size_font(Function<void(Font const&)>) const;
void add_bitmap_font(RefPtr<BitmapFont>);
void set_ttf_font(RefPtr<TTF::Font>);
diff --git a/Userland/Libraries/LibGfx/VectorN.h b/Userland/Libraries/LibGfx/VectorN.h
index a8b64e723d..6e07a3b49d 100644
--- a/Userland/Libraries/LibGfx/VectorN.h
+++ b/Userland/Libraries/LibGfx/VectorN.h
@@ -62,7 +62,7 @@ public:
return m_data[index];
}
- constexpr VectorN& operator+=(const VectorN& other)
+ constexpr VectorN& operator+=(VectorN const& other)
{
UNROLL_LOOP
for (auto i = 0u; i < N; ++i)
@@ -70,7 +70,7 @@ public:
return *this;
}
- constexpr VectorN& operator-=(const VectorN& other)
+ constexpr VectorN& operator-=(VectorN const& other)
{
UNROLL_LOOP
for (auto i = 0u; i < N; ++i)
@@ -86,7 +86,7 @@ public:
return *this;
}
- [[nodiscard]] constexpr VectorN operator+(const VectorN& other) const
+ [[nodiscard]] constexpr VectorN operator+(VectorN const& other) const
{
VectorN result;
UNROLL_LOOP
@@ -95,7 +95,7 @@ public:
return result;
}
- [[nodiscard]] constexpr VectorN operator-(const VectorN& other) const
+ [[nodiscard]] constexpr VectorN operator-(VectorN const& other) const
{
VectorN result;
UNROLL_LOOP
@@ -104,7 +104,7 @@ public:
return result;
}
- [[nodiscard]] constexpr VectorN operator*(const VectorN& other) const
+ [[nodiscard]] constexpr VectorN operator*(VectorN const& other) const
{
VectorN result;
UNROLL_LOOP
@@ -122,7 +122,7 @@ public:
return result;
}
- [[nodiscard]] constexpr VectorN operator/(const VectorN& other) const
+ [[nodiscard]] constexpr VectorN operator/(VectorN const& other) const
{
VectorN result;
UNROLL_LOOP
@@ -151,7 +151,7 @@ public:
return result;
}
- [[nodiscard]] constexpr T dot(const VectorN& other) const
+ [[nodiscard]] constexpr T dot(VectorN const& other) const
{
T result {};
UNROLL_LOOP
@@ -160,7 +160,7 @@ public:
return result;
}
- [[nodiscard]] constexpr VectorN cross(const VectorN& other) const requires(N == 3)
+ [[nodiscard]] constexpr VectorN cross(VectorN const& other) const requires(N == 3)
{
return VectorN(
y() * other.z() - z() * other.y(),
diff --git a/Userland/Libraries/LibGfx/WindowTheme.h b/Userland/Libraries/LibGfx/WindowTheme.h
index d307099983..4d7e07b2ae 100644
--- a/Userland/Libraries/LibGfx/WindowTheme.h
+++ b/Userland/Libraries/LibGfx/WindowTheme.h
@@ -31,22 +31,22 @@ public:
static WindowTheme& current();
- virtual void paint_normal_frame(Painter&, WindowState, const IntRect& window_rect, StringView title, const Bitmap& icon, const Palette&, const IntRect& leftmost_button_rect, int menu_row_count, bool window_modified) const = 0;
- virtual void paint_tool_window_frame(Painter&, WindowState, const IntRect& window_rect, StringView title, const Palette&, const IntRect& leftmost_button_rect) const = 0;
- virtual void paint_notification_frame(Painter&, const IntRect& window_rect, const Palette&, const IntRect& close_button_rect) const = 0;
+ virtual void paint_normal_frame(Painter&, WindowState, IntRect const& window_rect, StringView title, Bitmap const& icon, Palette const&, IntRect const& leftmost_button_rect, int menu_row_count, bool window_modified) const = 0;
+ virtual void paint_tool_window_frame(Painter&, WindowState, IntRect const& window_rect, StringView title, Palette const&, IntRect const& leftmost_button_rect) const = 0;
+ virtual void paint_notification_frame(Painter&, IntRect const& window_rect, Palette const&, IntRect const& close_button_rect) const = 0;
- virtual int titlebar_height(WindowType, const Palette&) const = 0;
- virtual IntRect titlebar_rect(WindowType, const IntRect& window_rect, const Palette&) const = 0;
- virtual IntRect titlebar_icon_rect(WindowType, const IntRect& window_rect, const Palette&) const = 0;
- virtual IntRect titlebar_text_rect(WindowType, const IntRect& window_rect, const Palette&) const = 0;
+ virtual int titlebar_height(WindowType, Palette const&) const = 0;
+ virtual IntRect titlebar_rect(WindowType, IntRect const& window_rect, Palette const&) const = 0;
+ virtual IntRect titlebar_icon_rect(WindowType, IntRect const& window_rect, Palette const&) const = 0;
+ virtual IntRect titlebar_text_rect(WindowType, IntRect const& window_rect, Palette const&) const = 0;
- virtual IntRect menubar_rect(WindowType, const IntRect& window_rect, const Palette&, int menu_row_count) const = 0;
+ virtual IntRect menubar_rect(WindowType, IntRect const& window_rect, Palette const&, int menu_row_count) const = 0;
- virtual IntRect frame_rect_for_window(WindowType, const IntRect& window_rect, const Palette&, int menu_row_count) const = 0;
+ virtual IntRect frame_rect_for_window(WindowType, IntRect const& window_rect, Palette const&, int menu_row_count) const = 0;
- virtual Vector<IntRect> layout_buttons(WindowType, const IntRect& window_rect, const Palette&, size_t buttons) const = 0;
+ virtual Vector<IntRect> layout_buttons(WindowType, IntRect const& window_rect, Palette const&, size_t buttons) const = 0;
virtual bool is_simple_rect_frame() const = 0;
- virtual bool frame_uses_alpha(WindowState, const Palette&) const = 0;
+ virtual bool frame_uses_alpha(WindowState, Palette const&) const = 0;
virtual float frame_alpha_hit_threshold(WindowState) const = 0;
protected:
diff --git a/Userland/Libraries/LibHTTP/Job.cpp b/Userland/Libraries/LibHTTP/Job.cpp
index 8a5ea6cc4a..6ae5ecf281 100644
--- a/Userland/Libraries/LibHTTP/Job.cpp
+++ b/Userland/Libraries/LibHTTP/Job.cpp
@@ -17,7 +17,7 @@
namespace HTTP {
-static Optional<ByteBuffer> handle_content_encoding(const ByteBuffer& buf, const String& content_encoding)
+static Optional<ByteBuffer> handle_content_encoding(ByteBuffer const& buf, String const& content_encoding)
{
dbgln_if(JOB_DEBUG, "Job::handle_content_encoding: buf has content_encoding={}", content_encoding);
diff --git a/Userland/Libraries/LibHTTP/Job.h b/Userland/Libraries/LibHTTP/Job.h
index eef352410d..27736e78ba 100644
--- a/Userland/Libraries/LibHTTP/Job.h
+++ b/Userland/Libraries/LibHTTP/Job.h
@@ -30,7 +30,7 @@ public:
URL url() const { return m_request.url(); }
HttpResponse* response() { return static_cast<HttpResponse*>(Core::NetworkJob::response()); }
- const HttpResponse* response() const { return static_cast<const HttpResponse*>(Core::NetworkJob::response()); }
+ HttpResponse const* response() const { return static_cast<HttpResponse const*>(Core::NetworkJob::response()); }
protected:
void finish_up();
diff --git a/Userland/Libraries/LibIMAP/Client.cpp b/Userland/Libraries/LibIMAP/Client.cpp
index 318239205e..dfb99ec918 100644
--- a/Userland/Libraries/LibIMAP/Client.cpp
+++ b/Userland/Libraries/LibIMAP/Client.cpp
@@ -316,7 +316,7 @@ RefPtr<Promise<Optional<SolidResponse>>> Client::search(Optional<String> charset
args.append("CHARSET ");
args.append(charset.value());
}
- for (const auto& item : keys) {
+ for (auto const& item : keys) {
args.append(item.serialize());
}
auto command = Command { uid ? CommandType::UIDSearch : CommandType::Search, m_current_command, args };
diff --git a/Userland/Libraries/LibIMAP/Objects.h b/Userland/Libraries/LibIMAP/Objects.h
index 4609503613..88aa8426fa 100644
--- a/Userland/Libraries/LibIMAP/Objects.h
+++ b/Userland/Libraries/LibIMAP/Objects.h
@@ -505,7 +505,7 @@ public:
ResponseData(ResponseData&) = delete;
ResponseData(ResponseData&&) = default;
- ResponseData& operator=(const ResponseData&) = delete;
+ ResponseData& operator=(ResponseData const&) = delete;
ResponseData& operator=(ResponseData&&) = default;
[[nodiscard]] bool contains_response_type(ResponseType response_type) const
diff --git a/Userland/Libraries/LibIPC/Connection.cpp b/Userland/Libraries/LibIPC/Connection.cpp
index 111df5686c..5de66aa0f2 100644
--- a/Userland/Libraries/LibIPC/Connection.cpp
+++ b/Userland/Libraries/LibIPC/Connection.cpp
@@ -34,7 +34,7 @@ ErrorOr<void> ConnectionBase::post_message(MessageBuffer buffer)
// Prepend the message size.
uint32_t message_size = buffer.data.size();
- TRY(buffer.data.try_prepend(reinterpret_cast<const u8*>(&message_size), sizeof(message_size)));
+ TRY(buffer.data.try_prepend(reinterpret_cast<u8 const*>(&message_size), sizeof(message_size)));
#ifdef __serenity__
for (auto& fd : buffer.fds) {
diff --git a/Userland/Libraries/LibIPC/ConnectionFromClient.h b/Userland/Libraries/LibIPC/ConnectionFromClient.h
index e18a7bea2e..8710dad444 100644
--- a/Userland/Libraries/LibIPC/ConnectionFromClient.h
+++ b/Userland/Libraries/LibIPC/ConnectionFromClient.h
@@ -46,7 +46,7 @@ public:
this->shutdown();
}
- void did_misbehave(const char* message)
+ void did_misbehave(char const* message)
{
dbgln("{} (id={}) misbehaved ({}), disconnecting.", *this, m_client_id, message);
this->shutdown();
diff --git a/Userland/Libraries/LibIPC/Dictionary.h b/Userland/Libraries/LibIPC/Dictionary.h
index 97a5eed718..42d85452c3 100644
--- a/Userland/Libraries/LibIPC/Dictionary.h
+++ b/Userland/Libraries/LibIPC/Dictionary.h
@@ -16,7 +16,7 @@ class Dictionary {
public:
Dictionary() = default;
- Dictionary(const HashMap<String, String>& initial_entries)
+ Dictionary(HashMap<String, String> const& initial_entries)
: m_entries(initial_entries)
{
}
@@ -37,7 +37,7 @@ public:
}
}
- const HashMap<String, String>& entries() const { return m_entries; }
+ HashMap<String, String> const& entries() const { return m_entries; }
private:
HashMap<String, String> m_entries;
diff --git a/Userland/Libraries/LibIPC/Message.h b/Userland/Libraries/LibIPC/Message.h
index 4dcaef9584..4690b1d505 100644
--- a/Userland/Libraries/LibIPC/Message.h
+++ b/Userland/Libraries/LibIPC/Message.h
@@ -52,7 +52,7 @@ public:
virtual u32 endpoint_magic() const = 0;
virtual int message_id() const = 0;
- virtual const char* message_name() const = 0;
+ virtual char const* message_name() const = 0;
virtual bool valid() const = 0;
virtual MessageBuffer encode() const = 0;
diff --git a/Userland/Libraries/LibIPC/Stub.h b/Userland/Libraries/LibIPC/Stub.h
index 49ec6de666..7c72550df9 100644
--- a/Userland/Libraries/LibIPC/Stub.h
+++ b/Userland/Libraries/LibIPC/Stub.h
@@ -25,7 +25,7 @@ public:
virtual u32 magic() const = 0;
virtual String name() const = 0;
- virtual OwnPtr<MessageBuffer> handle(const Message&) = 0;
+ virtual OwnPtr<MessageBuffer> handle(Message const&) = 0;
protected:
Stub() = default;
diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp
index 141f4ae590..0cce9e4665 100644
--- a/Userland/Libraries/LibJS/AST.cpp
+++ b/Userland/Libraries/LibJS/AST.cpp
@@ -1955,7 +1955,7 @@ void ScopeNode::dump(int indent) const
void BinaryExpression::dump(int indent) const
{
- const char* op_string = nullptr;
+ char const* op_string = nullptr;
switch (m_op) {
case BinaryOp::Addition:
op_string = "+";
@@ -2035,7 +2035,7 @@ void BinaryExpression::dump(int indent) const
void LogicalExpression::dump(int indent) const
{
- const char* op_string = nullptr;
+ char const* op_string = nullptr;
switch (m_op) {
case LogicalOp::And:
op_string = "&&";
@@ -2058,7 +2058,7 @@ void LogicalExpression::dump(int indent) const
void UnaryExpression::dump(int indent) const
{
- const char* op_string = nullptr;
+ char const* op_string = nullptr;
switch (m_op) {
case UnaryOp::BitwiseNot:
op_string = "~";
@@ -2153,7 +2153,7 @@ void ClassMethod::dump(int indent) const
outln("(Key)");
m_key->dump(indent + 1);
- const char* kind_string = nullptr;
+ char const* kind_string = nullptr;
switch (m_kind) {
case Kind::Method:
kind_string = "Method";
@@ -2346,7 +2346,7 @@ void FunctionDeclaration::dump(int indent) const
FunctionNode::dump(indent, class_name());
}
-ThrowCompletionOr<void> FunctionDeclaration::for_each_bound_name(ThrowCompletionOrVoidCallback<const FlyString&>&& callback) const
+ThrowCompletionOr<void> FunctionDeclaration::for_each_bound_name(ThrowCompletionOrVoidCallback<FlyString const&>&& callback) const
{
if (name().is_empty())
return {};
@@ -2757,7 +2757,7 @@ Completion UpdateExpression::execute(Interpreter& interpreter, GlobalObject& glo
void AssignmentExpression::dump(int indent) const
{
- const char* op_string = nullptr;
+ char const* op_string = nullptr;
switch (m_op) {
case AssignmentOp::Assignment:
op_string = "=";
@@ -2818,7 +2818,7 @@ void AssignmentExpression::dump(int indent) const
void UpdateExpression::dump(int indent) const
{
- const char* op_string = nullptr;
+ char const* op_string = nullptr;
switch (m_op) {
case UpdateOp::Increment:
op_string = "++";
@@ -2903,7 +2903,7 @@ ThrowCompletionOr<void> VariableDeclaration::for_each_bound_name(ThrowCompletion
void VariableDeclaration::dump(int indent) const
{
- const char* declaration_kind_string = nullptr;
+ char const* declaration_kind_string = nullptr;
switch (m_declaration_kind) {
case DeclarationKind::Let:
declaration_kind_string = "Let";
@@ -2927,7 +2927,7 @@ void VariableDeclaration::dump(int indent) const
void VariableDeclarator::dump(int indent) const
{
ASTNode::dump(indent);
- m_target.visit([indent](const auto& value) { value->dump(indent + 1); });
+ m_target.visit([indent](auto const& value) { value->dump(indent + 1); });
if (m_init)
m_init->dump(indent + 1);
}
diff --git a/Userland/Libraries/LibJS/AST.h b/Userland/Libraries/LibJS/AST.h
index ea9b283116..87b5a4e2af 100644
--- a/Userland/Libraries/LibJS/AST.h
+++ b/Userland/Libraries/LibJS/AST.h
@@ -190,8 +190,8 @@ concept ThrowCompletionOrVoidFunction = requires(Func func, Args... args)
{
{
func(args...)
- }
- ->SameAs<ThrowCompletionOr<void>>;
+ }
+ -> SameAs<ThrowCompletionOr<void>>;
};
template<typename... Args>
diff --git a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp
index 2ade544fe7..249e53b99d 100644
--- a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp
+++ b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp
@@ -1216,7 +1216,7 @@ Bytecode::CodeGenerationErrorOr<void> CallExpression::generate_bytecode(Bytecode
"Unimplemented callee kind: SuperExpression"sv,
};
} else if (is<MemberExpression>(*m_callee)) {
- auto& member_expression = static_cast<const MemberExpression&>(*m_callee);
+ auto& member_expression = static_cast<MemberExpression const&>(*m_callee);
if (is<SuperExpression>(member_expression.object())) {
return Bytecode::CodeGenerationError {
this,
diff --git a/Userland/Libraries/LibJS/Bytecode/Op.cpp b/Userland/Libraries/LibJS/Bytecode/Op.cpp
index 7886f5f363..1623a31063 100644
--- a/Userland/Libraries/LibJS/Bytecode/Op.cpp
+++ b/Userland/Libraries/LibJS/Bytecode/Op.cpp
@@ -794,7 +794,7 @@ String NewArray::to_string_impl(Bytecode::Executable const&) const
return builder.to_string();
}
-String IteratorToArray::to_string_impl(const Bytecode::Executable&) const
+String IteratorToArray::to_string_impl(Bytecode::Executable const&) const
{
return "IteratorToArray";
}
@@ -814,7 +814,7 @@ String NewRegExp::to_string_impl(Bytecode::Executable const& executable) const
return String::formatted("NewRegExp source:{} (\"{}\") flags:{} (\"{}\")", m_source_index, executable.get_string(m_source_index), m_flags_index, executable.get_string(m_flags_index));
}
-String CopyObjectExcludingProperties::to_string_impl(const Bytecode::Executable&) const
+String CopyObjectExcludingProperties::to_string_impl(Bytecode::Executable const&) const
{
StringBuilder builder;
builder.appendff("CopyObjectExcludingProperties from:{}", m_from_object);
@@ -859,7 +859,7 @@ String CreateVariable::to_string_impl(Bytecode::Executable const& executable) co
return String::formatted("CreateVariable env:{} immutable:{} {} ({})", mode_string, m_is_immutable, m_identifier, executable.identifier_table->get(m_identifier));
}
-String EnterObjectEnvironment::to_string_impl(const Executable&) const
+String EnterObjectEnvironment::to_string_impl(Executable const&) const
{
return String::formatted("EnterObjectEnvironment");
}
@@ -975,7 +975,7 @@ String EnterUnwindContext::to_string_impl(Bytecode::Executable const&) const
return String::formatted("EnterUnwindContext handler:{} finalizer:{} entry:{}", handler_string, finalizer_string, m_entry_point);
}
-String FinishUnwind::to_string_impl(const Bytecode::Executable&) const
+String FinishUnwind::to_string_impl(Bytecode::Executable const&) const
{
return String::formatted("FinishUnwind next:{}", m_next_target);
}
@@ -998,7 +998,7 @@ String ContinuePendingUnwind::to_string_impl(Bytecode::Executable const&) const
return String::formatted("ContinuePendingUnwind resume:{}", m_resume_target);
}
-String PushDeclarativeEnvironment::to_string_impl(const Bytecode::Executable& executable) const
+String PushDeclarativeEnvironment::to_string_impl(Bytecode::Executable const& executable) const
{
StringBuilder builder;
builder.append("PushDeclarativeEnvironment");
@@ -1020,12 +1020,12 @@ String Yield::to_string_impl(Bytecode::Executable const&) const
return String::formatted("Yield return");
}
-String GetByValue::to_string_impl(const Bytecode::Executable&) const
+String GetByValue::to_string_impl(Bytecode::Executable const&) const
{
return String::formatted("GetByValue base:{}", m_base);
}
-String PutByValue::to_string_impl(const Bytecode::Executable&) const
+String PutByValue::to_string_impl(Bytecode::Executable const&) const
{
auto kind = m_kind == PropertyKind::Getter
? "getter"
@@ -1046,7 +1046,7 @@ String GetIterator::to_string_impl(Executable const&) const
return "GetIterator";
}
-String GetObjectPropertyIterator::to_string_impl(const Bytecode::Executable&) const
+String GetObjectPropertyIterator::to_string_impl(Bytecode::Executable const&) const
{
return "GetObjectPropertyIterator";
}
diff --git a/Userland/Libraries/LibJS/Console.h b/Userland/Libraries/LibJS/Console.h
index 30a67364c2..3928882a39 100644
--- a/Userland/Libraries/LibJS/Console.h
+++ b/Userland/Libraries/LibJS/Console.h
@@ -58,13 +58,13 @@ public:
void set_client(ConsoleClient& client) { m_client = &client; }
GlobalObject& global_object() { return m_global_object; }
- const GlobalObject& global_object() const { return m_global_object; }
+ GlobalObject const& global_object() const { return m_global_object; }
VM& vm();
Vector<Value> vm_arguments();
HashMap<String, unsigned>& counters() { return m_counters; }
- const HashMap<String, unsigned>& counters() const { return m_counters; }
+ HashMap<String, unsigned> const& counters() const { return m_counters; }
ThrowCompletionOr<Value> debug();
ThrowCompletionOr<Value> error();
@@ -119,7 +119,7 @@ protected:
VM& vm();
GlobalObject& global_object() { return m_console.global_object(); }
- const GlobalObject& global_object() const { return m_console.global_object(); }
+ GlobalObject const& global_object() const { return m_console.global_object(); }
Console& m_console;
};
diff --git a/Userland/Libraries/LibJS/Heap/Handle.h b/Userland/Libraries/LibJS/Heap/Handle.h
index d353279e5d..3fa2a01c29 100644
--- a/Userland/Libraries/LibJS/Heap/Handle.h
+++ b/Userland/Libraries/LibJS/Heap/Handle.h
@@ -25,7 +25,7 @@ public:
~HandleImpl();
Cell* cell() { return m_cell; }
- const Cell* cell() const { return m_cell; }
+ Cell const* cell() const { return m_cell; }
private:
template<class T>
diff --git a/Userland/Libraries/LibJS/Heap/Heap.cpp b/Userland/Libraries/LibJS/Heap/Heap.cpp
index fcc8575af5..ca50bc28d0 100644
--- a/Userland/Libraries/LibJS/Heap/Heap.cpp
+++ b/Userland/Libraries/LibJS/Heap/Heap.cpp
@@ -156,15 +156,15 @@ __attribute__((no_sanitize("address"))) void Heap::gather_conservative_roots(Has
for (auto possible_pointer : possible_pointers) {
if (!possible_pointer)
continue;
- dbgln_if(HEAP_DEBUG, " ? {}", (const void*)possible_pointer);
- auto* possible_heap_block = HeapBlock::from_cell(reinterpret_cast<const Cell*>(possible_pointer));
+ dbgln_if(HEAP_DEBUG, " ? {}", (void const*)possible_pointer);
+ auto* possible_heap_block = HeapBlock::from_cell(reinterpret_cast<Cell const*>(possible_pointer));
if (all_live_heap_blocks.contains(possible_heap_block)) {
if (auto* cell = possible_heap_block->cell_from_possible_pointer(possible_pointer)) {
if (cell->state() == Cell::State::Live) {
- dbgln_if(HEAP_DEBUG, " ?-> {}", (const void*)cell);
+ dbgln_if(HEAP_DEBUG, " ?-> {}", (void const*)cell);
roots.set(cell);
} else {
- dbgln_if(HEAP_DEBUG, " #-> {}", (const void*)cell);
+ dbgln_if(HEAP_DEBUG, " #-> {}", (void const*)cell);
}
}
}
@@ -186,7 +186,7 @@ public:
}
};
-void Heap::mark_live_cells(const HashTable<Cell*>& roots)
+void Heap::mark_live_cells(HashTable<Cell*> const& roots)
{
dbgln_if(HEAP_DEBUG, "mark_live_cells:");
@@ -200,7 +200,7 @@ void Heap::mark_live_cells(const HashTable<Cell*>& roots)
m_uprooted_cells.clear();
}
-void Heap::sweep_dead_cells(bool print_report, const Core::ElapsedTimer& measurement_timer)
+void Heap::sweep_dead_cells(bool print_report, Core::ElapsedTimer const& measurement_timer)
{
dbgln_if(HEAP_DEBUG, "sweep_dead_cells:");
Vector<HeapBlock*, 32> empty_blocks;
diff --git a/Userland/Libraries/LibJS/Heap/Heap.h b/Userland/Libraries/LibJS/Heap/Heap.h
index 470f11a1af..752a2a97d8 100644
--- a/Userland/Libraries/LibJS/Heap/Heap.h
+++ b/Userland/Libraries/LibJS/Heap/Heap.h
@@ -84,8 +84,8 @@ private:
void gather_roots(HashTable<Cell*>&);
void gather_conservative_roots(HashTable<Cell*>&);
- void mark_live_cells(const HashTable<Cell*>& live_cells);
- void sweep_dead_cells(bool print_report, const Core::ElapsedTimer&);
+ void mark_live_cells(HashTable<Cell*> const& live_cells);
+ void sweep_dead_cells(bool print_report, Core::ElapsedTimer const&);
CellAllocator& allocator_for_size(size_t);
diff --git a/Userland/Libraries/LibJS/Heap/HeapBlock.h b/Userland/Libraries/LibJS/Heap/HeapBlock.h
index 750394862c..891cc89fed 100644
--- a/Userland/Libraries/LibJS/Heap/HeapBlock.h
+++ b/Userland/Libraries/LibJS/Heap/HeapBlock.h
@@ -68,7 +68,7 @@ public:
Heap& heap() { return m_heap; }
- static HeapBlock* from_cell(const Cell* cell)
+ static HeapBlock* from_cell(Cell const* cell)
{
return reinterpret_cast<HeapBlock*>((FlatPtr)cell & ~(block_size - 1));
}
@@ -84,7 +84,7 @@ public:
return cell(cell_index);
}
- bool is_valid_cell_pointer(const Cell* cell)
+ bool is_valid_cell_pointer(Cell const* cell)
{
return cell_from_possible_pointer((FlatPtr)cell);
}
diff --git a/Userland/Libraries/LibJS/Interpreter.cpp b/Userland/Libraries/LibJS/Interpreter.cpp
index 513e5a9f91..6d997698ba 100644
--- a/Userland/Libraries/LibJS/Interpreter.cpp
+++ b/Userland/Libraries/LibJS/Interpreter.cpp
@@ -148,9 +148,9 @@ GlobalObject& Interpreter::global_object()
return static_cast<GlobalObject&>(*m_global_object.cell());
}
-const GlobalObject& Interpreter::global_object() const
+GlobalObject const& Interpreter::global_object() const
{
- return static_cast<const GlobalObject&>(*m_global_object.cell());
+ return static_cast<GlobalObject const&>(*m_global_object.cell());
}
Realm& Interpreter::realm()
@@ -158,9 +158,9 @@ Realm& Interpreter::realm()
return static_cast<Realm&>(*m_realm.cell());
}
-const Realm& Interpreter::realm() const
+Realm const& Interpreter::realm() const
{
- return static_cast<const Realm&>(*m_realm.cell());
+ return static_cast<Realm const&>(*m_realm.cell());
}
}
diff --git a/Userland/Libraries/LibJS/Interpreter.h b/Userland/Libraries/LibJS/Interpreter.h
index 8d31526610..ce3e8dfefd 100644
--- a/Userland/Libraries/LibJS/Interpreter.h
+++ b/Userland/Libraries/LibJS/Interpreter.h
@@ -31,7 +31,7 @@ namespace JS {
struct ExecutingASTNodeChain {
ExecutingASTNodeChain* previous { nullptr };
- const ASTNode& node;
+ ASTNode const& node;
};
class Interpreter : public Weakable<Interpreter> {
@@ -107,7 +107,7 @@ public:
ThrowCompletionOr<Value> run(SourceTextModule&);
GlobalObject& global_object();
- const GlobalObject& global_object() const;
+ GlobalObject const& global_object() const;
Realm& realm();
Realm const& realm() const;
@@ -130,7 +130,7 @@ public:
m_ast_node_chain = m_ast_node_chain->previous;
}
- const ASTNode* current_node() const { return m_ast_node_chain ? &m_ast_node_chain->node : nullptr; }
+ ASTNode const* current_node() const { return m_ast_node_chain ? &m_ast_node_chain->node : nullptr; }
private:
explicit Interpreter(VM&);
diff --git a/Userland/Libraries/LibJS/MarkupGenerator.cpp b/Userland/Libraries/LibJS/MarkupGenerator.cpp
index 6a5d5c776d..4f9d4bdc88 100644
--- a/Userland/Libraries/LibJS/MarkupGenerator.cpp
+++ b/Userland/Libraries/LibJS/MarkupGenerator.cpp
@@ -64,7 +64,7 @@ void MarkupGenerator::value_to_html(Value value, StringBuilder& output_html, Has
if (value.is_object()) {
auto& object = value.as_object();
if (is<Array>(object))
- return array_to_html(static_cast<const Array&>(object), output_html, seen_objects);
+ return array_to_html(static_cast<Array const&>(object), output_html, seen_objects);
output_html.append(wrap_string_in_style(object.class_name(), StyleType::ObjectType));
if (object.is_function())
return function_to_html(object, output_html, seen_objects);
@@ -91,7 +91,7 @@ void MarkupGenerator::value_to_html(Value value, StringBuilder& output_html, Has
output_html.append("</span>");
}
-void MarkupGenerator::array_to_html(const Array& array, StringBuilder& html_output, HashTable<Object*>& seen_objects)
+void MarkupGenerator::array_to_html(Array const& array, StringBuilder& html_output, HashTable<Object*>& seen_objects)
{
html_output.append(wrap_string_in_style("[ ", StyleType::Punctuation));
bool first = true;
@@ -105,7 +105,7 @@ void MarkupGenerator::array_to_html(const Array& array, StringBuilder& html_outp
html_output.append(wrap_string_in_style(" ]", StyleType::Punctuation));
}
-void MarkupGenerator::object_to_html(const Object& object, StringBuilder& html_output, HashTable<Object*>& seen_objects)
+void MarkupGenerator::object_to_html(Object const& object, StringBuilder& html_output, HashTable<Object*>& seen_objects)
{
html_output.append(wrap_string_in_style("{ ", StyleType::Punctuation));
bool first = true;
@@ -135,17 +135,17 @@ void MarkupGenerator::object_to_html(const Object& object, StringBuilder& html_o
html_output.append(wrap_string_in_style(" }", StyleType::Punctuation));
}
-void MarkupGenerator::function_to_html(const Object& function, StringBuilder& html_output, HashTable<Object*>&)
+void MarkupGenerator::function_to_html(Object const& function, StringBuilder& html_output, HashTable<Object*>&)
{
html_output.appendff("[{}]", function.class_name());
}
-void MarkupGenerator::date_to_html(const Object& date, StringBuilder& html_output, HashTable<Object*>&)
+void MarkupGenerator::date_to_html(Object const& date, StringBuilder& html_output, HashTable<Object*>&)
{
html_output.appendff("Date {}", JS::to_date_string(static_cast<JS::Date const&>(date).date_value()));
}
-void MarkupGenerator::error_to_html(const Object& object, StringBuilder& html_output, HashTable<Object*>&)
+void MarkupGenerator::error_to_html(Object const& object, StringBuilder& html_output, HashTable<Object*>&)
{
auto& vm = object.vm();
auto name = object.get_without_side_effects(vm.names.name).value_or(JS::js_undefined());
diff --git a/Userland/Libraries/LibJS/MarkupGenerator.h b/Userland/Libraries/LibJS/MarkupGenerator.h
index 97940d64cb..f8bc16849c 100644
--- a/Userland/Libraries/LibJS/MarkupGenerator.h
+++ b/Userland/Libraries/LibJS/MarkupGenerator.h
@@ -33,11 +33,11 @@ private:
};
static void value_to_html(Value, StringBuilder& output_html, HashTable<Object*> seen_objects = {});
- static void array_to_html(const Array&, StringBuilder& output_html, HashTable<Object*>&);
- static void object_to_html(const Object&, StringBuilder& output_html, HashTable<Object*>&);
- static void function_to_html(const Object&, StringBuilder& output_html, HashTable<Object*>&);
- static void date_to_html(const Object&, StringBuilder& output_html, HashTable<Object*>&);
- static void error_to_html(const Object&, StringBuilder& output_html, HashTable<Object*>&);
+ static void array_to_html(Array const&, StringBuilder& output_html, HashTable<Object*>&);
+ static void object_to_html(Object const&, StringBuilder& output_html, HashTable<Object*>&);
+ static void function_to_html(Object const&, StringBuilder& output_html, HashTable<Object*>&);
+ static void date_to_html(Object const&, StringBuilder& output_html, HashTable<Object*>&);
+ static void error_to_html(Object const&, StringBuilder& output_html, HashTable<Object*>&);
static String style_from_style_type(StyleType);
static StyleType style_type_for_token(Token);
diff --git a/Userland/Libraries/LibJS/Parser.cpp b/Userland/Libraries/LibJS/Parser.cpp
index 3246f1c56b..31e2ce68a4 100644
--- a/Userland/Libraries/LibJS/Parser.cpp
+++ b/Userland/Libraries/LibJS/Parser.cpp
@@ -1798,7 +1798,7 @@ NonnullRefPtr<ArrayExpression> Parser::parse_array_expression()
return create_ast_node<ArrayExpression>({ m_state.current_token.filename(), rule_start.position(), position() }, move(elements));
}
-NonnullRefPtr<StringLiteral> Parser::parse_string_literal(const Token& token, bool in_template_literal)
+NonnullRefPtr<StringLiteral> Parser::parse_string_literal(Token const& token, bool in_template_literal)
{
auto rule_start = push_start();
auto status = Token::StringValueStatus::Ok;
@@ -3919,7 +3919,7 @@ Token Parser::consume_and_validate_numeric_literal()
return token;
}
-void Parser::expected(const char* what)
+void Parser::expected(char const* what)
{
auto message = m_state.current_token.message();
if (message.is_empty())
@@ -3936,7 +3936,7 @@ Position Parser::position() const
};
}
-bool Parser::try_parse_arrow_function_expression_failed_at_position(const Position& position) const
+bool Parser::try_parse_arrow_function_expression_failed_at_position(Position const& position) const
{
auto it = m_token_memoizations.find(position);
if (it == m_token_memoizations.end())
@@ -3945,12 +3945,12 @@ bool Parser::try_parse_arrow_function_expression_failed_at_position(const Positi
return (*it).value.try_parse_arrow_function_expression_failed;
}
-void Parser::set_try_parse_arrow_function_expression_failed_at_position(const Position& position, bool failed)
+void Parser::set_try_parse_arrow_function_expression_failed_at_position(Position const& position, bool failed)
{
m_token_memoizations.set(position, { failed });
}
-void Parser::syntax_error(const String& message, Optional<Position> position)
+void Parser::syntax_error(String const& message, Optional<Position> position)
{
if (!position.has_value())
position = this->position();
diff --git a/Userland/Libraries/LibJS/Parser.h b/Userland/Libraries/LibJS/Parser.h
index 4d1eeb378d..10d708c1ed 100644
--- a/Userland/Libraries/LibJS/Parser.h
+++ b/Userland/Libraries/LibJS/Parser.h
@@ -135,7 +135,7 @@ public:
NonnullRefPtr<RegExpLiteral> parse_regexp_literal();
NonnullRefPtr<ObjectExpression> parse_object_expression();
NonnullRefPtr<ArrayExpression> parse_array_expression();
- NonnullRefPtr<StringLiteral> parse_string_literal(const Token& token, bool in_template_literal = false);
+ NonnullRefPtr<StringLiteral> parse_string_literal(Token const& token, bool in_template_literal = false);
NonnullRefPtr<TemplateLiteral> parse_template_literal(bool is_tagged);
ExpressionResult parse_secondary_expression(NonnullRefPtr<Expression>, int min_precedence, Associativity associate = Associativity::Right, ForbiddenTokens forbidden = {});
NonnullRefPtr<Expression> parse_call_expression(NonnullRefPtr<Expression>);
@@ -169,7 +169,7 @@ public:
return String::formatted("{} (line: {}, column: {})", message, position.value().line, position.value().column);
}
- String source_location_hint(StringView source, const char spacer = ' ', const char indicator = '^') const
+ String source_location_hint(StringView source, char const spacer = ' ', char const indicator = '^') const
{
if (!position.has_value())
return {};
@@ -187,7 +187,7 @@ public:
};
bool has_errors() const { return m_state.errors.size(); }
- const Vector<Error>& errors() const { return m_state.errors; }
+ Vector<Error> const& errors() const { return m_state.errors; }
void print_errors(bool print_hint = true) const
{
for (auto& error : m_state.errors) {
@@ -229,8 +229,8 @@ private:
bool is_private_identifier_valid() const;
bool match(TokenType type) const;
bool done() const;
- void expected(const char* what);
- void syntax_error(const String& message, Optional<Position> = {});
+ void expected(char const* what);
+ void syntax_error(String const& message, Optional<Position> = {});
Token consume();
Token consume_identifier();
Token consume_identifier_reference();
@@ -248,8 +248,8 @@ private:
void check_identifier_name_for_assignment_validity(FlyString const&, bool force_strict = false);
- bool try_parse_arrow_function_expression_failed_at_position(const Position&) const;
- void set_try_parse_arrow_function_expression_failed_at_position(const Position&, bool);
+ bool try_parse_arrow_function_expression_failed_at_position(Position const&) const;
+ void set_try_parse_arrow_function_expression_failed_at_position(Position const&, bool);
bool match_invalid_escaped_keyword() const;
@@ -278,7 +278,7 @@ private:
VERIFY(last.column == m_position.column);
}
- const Position& position() const { return m_position; }
+ Position const& position() const { return m_position; }
private:
Parser& m_parser;
@@ -316,12 +316,12 @@ private:
class PositionKeyTraits {
public:
- static int hash(const Position& position)
+ static int hash(Position const& position)
{
return int_hash(position.line) ^ int_hash(position.column);
}
- static bool equals(const Position& a, const Position& b)
+ static bool equals(Position const& a, Position const& b)
{
return a.column == b.column && a.line == b.line;
}
diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBuffer.h b/Userland/Libraries/LibJS/Runtime/ArrayBuffer.h
index 9e33b5c1a5..7a728a7965 100644
--- a/Userland/Libraries/LibJS/Runtime/ArrayBuffer.h
+++ b/Userland/Libraries/LibJS/Runtime/ArrayBuffer.h
@@ -36,7 +36,7 @@ public:
size_t byte_length() const { return buffer_impl().size(); }
size_t max_byte_length() const { return m_max_byte_length.value(); } // Will VERIFY() that it has value
ByteBuffer& buffer() { return buffer_impl(); }
- const ByteBuffer& buffer() const { return buffer_impl(); }
+ ByteBuffer const& buffer() const { return buffer_impl(); }
// Used by allocate_array_buffer() to attach the data block after construction
void set_buffer(ByteBuffer buffer) { m_buffer = move(buffer); }
@@ -71,7 +71,7 @@ private:
return *ptr;
}
- const ByteBuffer& buffer_impl() const { return const_cast<ArrayBuffer*>(this)->buffer_impl(); }
+ ByteBuffer const& buffer_impl() const { return const_cast<ArrayBuffer*>(this)->buffer_impl(); }
Variant<Empty, ByteBuffer, ByteBuffer*> m_buffer;
// The various detach related members of ArrayBuffer are not used by any ECMA262 functionality,
diff --git a/Userland/Libraries/LibJS/Runtime/BigInt.h b/Userland/Libraries/LibJS/Runtime/BigInt.h
index bdba742c50..9290c554f2 100644
--- a/Userland/Libraries/LibJS/Runtime/BigInt.h
+++ b/Userland/Libraries/LibJS/Runtime/BigInt.h
@@ -17,7 +17,7 @@ public:
explicit BigInt(Crypto::SignedBigInteger);
virtual ~BigInt() override = default;
- const Crypto::SignedBigInteger& big_integer() const { return m_big_integer; }
+ Crypto::SignedBigInteger const& big_integer() const { return m_big_integer; }
const String to_string() const { return String::formatted("{}n", m_big_integer.to_base(10)); }
private:
diff --git a/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp b/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp
index e3f3fcb0d8..cee8afe7b8 100644
--- a/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp
@@ -35,7 +35,7 @@ JS_DEFINE_NATIVE_FUNCTION(BooleanPrototype::to_string)
if (!this_value.is_object() || !is<BooleanObject>(this_value.as_object()))
return vm.throw_completion<TypeError>(global_object, ErrorType::NotAnObjectOfType, "Boolean");
- bool bool_value = static_cast<const BooleanObject&>(this_value.as_object()).boolean();
+ bool bool_value = static_cast<BooleanObject const&>(this_value.as_object()).boolean();
return js_string(vm, bool_value ? "true" : "false");
}
@@ -48,6 +48,6 @@ JS_DEFINE_NATIVE_FUNCTION(BooleanPrototype::value_of)
if (!this_value.is_object() || !is<BooleanObject>(this_value.as_object()))
return vm.throw_completion<TypeError>(global_object, ErrorType::NotAnObjectOfType, "Boolean");
- return Value(static_cast<const BooleanObject&>(this_value.as_object()).boolean());
+ return Value(static_cast<BooleanObject const&>(this_value.as_object()).boolean());
}
}
diff --git a/Userland/Libraries/LibJS/Runtime/BoundFunction.h b/Userland/Libraries/LibJS/Runtime/BoundFunction.h
index 35d5c2a7fc..9993ffcc4a 100644
--- a/Userland/Libraries/LibJS/Runtime/BoundFunction.h
+++ b/Userland/Libraries/LibJS/Runtime/BoundFunction.h
@@ -23,7 +23,7 @@ public:
virtual ThrowCompletionOr<Value> internal_call(Value this_argument, MarkedVector<Value> arguments_list) override;
virtual ThrowCompletionOr<Object*> internal_construct(MarkedVector<Value> arguments_list, FunctionObject& new_target) override;
- virtual const FlyString& name() const override { return m_name; }
+ virtual FlyString const& name() const override { return m_name; }
virtual bool is_strict_mode() const override { return m_bound_target_function->is_strict_mode(); }
virtual bool has_constructor() const override { return m_bound_target_function->has_constructor(); }
diff --git a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp
index 115d928a98..fb48a87a97 100644
--- a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp
@@ -23,7 +23,7 @@
namespace JS {
// 21.4.3.2 Date.parse ( string ), https://tc39.es/ecma262/#sec-date.parse
-static Value parse_simplified_iso8601(GlobalObject& global_object, const String& iso_8601)
+static Value parse_simplified_iso8601(GlobalObject& global_object, String const& iso_8601)
{
// 21.4.1.15 Date Time String Format, https://tc39.es/ecma262/#sec-date-time-string-format
GenericLexer lexer(iso_8601);
diff --git a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp
index f7318c9d17..dcb04428b3 100644
--- a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp
+++ b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp
@@ -875,7 +875,7 @@ Completion ECMAScriptFunctionObject::ordinary_call_evaluate_body()
VERIFY_NOT_REACHED();
}
-void ECMAScriptFunctionObject::set_name(const FlyString& name)
+void ECMAScriptFunctionObject::set_name(FlyString const& name)
{
VERIFY(!name.is_null());
auto& vm = this->vm();
diff --git a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h
index 843a9878ab..2f6377c9b9 100644
--- a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h
+++ b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h
@@ -47,8 +47,8 @@ public:
Statement const& ecmascript_code() const { return m_ecmascript_code; }
Vector<FunctionNode::Parameter> const& formal_parameters() const { return m_formal_parameters; };
- virtual const FlyString& name() const override { return m_name; };
- void set_name(const FlyString& name);
+ virtual FlyString const& name() const override { return m_name; };
+ void set_name(FlyString const& name);
void set_is_class_constructor() { m_is_class_constructor = true; };
diff --git a/Userland/Libraries/LibJS/Runtime/ErrorTypes.h b/Userland/Libraries/LibJS/Runtime/ErrorTypes.h
index 91f4019f41..90b51982ed 100644
--- a/Userland/Libraries/LibJS/Runtime/ErrorTypes.h
+++ b/Userland/Libraries/LibJS/Runtime/ErrorTypes.h
@@ -302,18 +302,18 @@ public:
JS_ENUMERATE_ERROR_TYPES(__ENUMERATE_JS_ERROR)
#undef __ENUMERATE_JS_ERROR
- const char* message() const
+ char const* message() const
{
return m_message;
}
private:
- explicit ErrorType(const char* message)
+ explicit ErrorType(char const* message)
: m_message(message)
{
}
- const char* m_message;
+ char const* m_message;
};
}
diff --git a/Userland/Libraries/LibJS/Runtime/FunctionObject.h b/Userland/Libraries/LibJS/Runtime/FunctionObject.h
index 12ba18359f..38b1b6fe9f 100644
--- a/Userland/Libraries/LibJS/Runtime/FunctionObject.h
+++ b/Userland/Libraries/LibJS/Runtime/FunctionObject.h
@@ -27,7 +27,7 @@ public:
virtual ThrowCompletionOr<Value> internal_call(Value this_argument, MarkedVector<Value> arguments_list) = 0;
virtual ThrowCompletionOr<Object*> internal_construct([[maybe_unused]] MarkedVector<Value> arguments_list, [[maybe_unused]] FunctionObject& new_target) { VERIFY_NOT_REACHED(); }
- virtual const FlyString& name() const = 0;
+ virtual FlyString const& name() const = 0;
void set_function_name(Variant<PropertyKey, PrivateName> const& name_arg, Optional<StringView> const& prefix = {});
void set_function_length(double length);
diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp
index 144e0551df..84f83e394c 100644
--- a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp
+++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp
@@ -488,7 +488,7 @@ JS_DEFINE_NATIVE_FUNCTION(GlobalObject::eval)
}
// 19.2.6.1.1 Encode ( string, unescapedSet ), https://tc39.es/ecma262/#sec-encode
-static ThrowCompletionOr<String> encode([[maybe_unused]] JS::GlobalObject& global_object, const String& string, StringView unescaped_set)
+static ThrowCompletionOr<String> encode([[maybe_unused]] JS::GlobalObject& global_object, String const& string, StringView unescaped_set)
{
auto& vm = global_object.vm();
auto utf16_string = Utf16String(string);
@@ -544,7 +544,7 @@ static ThrowCompletionOr<String> encode([[maybe_unused]] JS::GlobalObject& globa
}
// 19.2.6.1.2 Decode ( string, reservedSet ), https://tc39.es/ecma262/#sec-decode
-static ThrowCompletionOr<String> decode(JS::GlobalObject& global_object, const String& string, StringView reserved_set)
+static ThrowCompletionOr<String> decode(JS::GlobalObject& global_object, String const& string, StringView reserved_set)
{
StringBuilder decoded_builder;
auto code_point_start_offset = 0u;
diff --git a/Userland/Libraries/LibJS/Runtime/IndexedProperties.cpp b/Userland/Libraries/LibJS/Runtime/IndexedProperties.cpp
index aa1274a2c9..e0245cb3f0 100644
--- a/Userland/Libraries/LibJS/Runtime/IndexedProperties.cpp
+++ b/Userland/Libraries/LibJS/Runtime/IndexedProperties.cpp
@@ -177,7 +177,7 @@ bool GenericIndexedPropertyStorage::set_array_like_size(size_t new_size)
return !any_failed;
}
-IndexedPropertyIterator::IndexedPropertyIterator(const IndexedProperties& indexed_properties, u32 staring_index, bool skip_empty)
+IndexedPropertyIterator::IndexedPropertyIterator(IndexedProperties const& indexed_properties, u32 staring_index, bool skip_empty)
: m_indexed_properties(indexed_properties)
, m_index(staring_index)
, m_skip_empty(skip_empty)
@@ -203,7 +203,7 @@ IndexedPropertyIterator& IndexedPropertyIterator::operator*()
return *this;
}
-bool IndexedPropertyIterator::operator!=(const IndexedPropertyIterator& other) const
+bool IndexedPropertyIterator::operator!=(IndexedPropertyIterator const& other) const
{
return m_index != other.m_index;
}
@@ -265,7 +265,7 @@ size_t IndexedProperties::real_size() const
if (!m_storage)
return 0;
if (m_storage->is_simple_storage()) {
- auto& packed_elements = static_cast<const SimpleIndexedPropertyStorage&>(*m_storage).elements();
+ auto& packed_elements = static_cast<SimpleIndexedPropertyStorage const&>(*m_storage).elements();
size_t size = 0;
for (auto& element : packed_elements) {
if (!element.is_empty())
@@ -273,7 +273,7 @@ size_t IndexedProperties::real_size() const
}
return size;
}
- return static_cast<const GenericIndexedPropertyStorage&>(*m_storage).size();
+ return static_cast<GenericIndexedPropertyStorage const&>(*m_storage).size();
}
Vector<u32> IndexedProperties::indices() const
@@ -281,8 +281,8 @@ Vector<u32> IndexedProperties::indices() const
if (!m_storage)
return {};
if (m_storage->is_simple_storage()) {
- const auto& storage = static_cast<const SimpleIndexedPropertyStorage&>(*m_storage);
- const auto& elements = storage.elements();
+ auto const& storage = static_cast<SimpleIndexedPropertyStorage const&>(*m_storage);
+ auto const& elements = storage.elements();
Vector<u32> indices;
indices.ensure_capacity(storage.array_like_size());
for (size_t i = 0; i < elements.size(); ++i) {
@@ -291,7 +291,7 @@ Vector<u32> IndexedProperties::indices() const
}
return indices;
}
- const auto& storage = static_cast<const GenericIndexedPropertyStorage&>(*m_storage);
+ auto const& storage = static_cast<GenericIndexedPropertyStorage const&>(*m_storage);
auto indices = storage.sparse_elements().keys();
quick_sort(indices);
return indices;
diff --git a/Userland/Libraries/LibJS/Runtime/IndexedProperties.h b/Userland/Libraries/LibJS/Runtime/IndexedProperties.h
index 8e4f965dae..b972362952 100644
--- a/Userland/Libraries/LibJS/Runtime/IndexedProperties.h
+++ b/Userland/Libraries/LibJS/Runtime/IndexedProperties.h
@@ -58,7 +58,7 @@ public:
virtual bool set_array_like_size(size_t new_size) override;
virtual bool is_simple_storage() const override { return true; }
- const Vector<Value>& elements() const { return m_packed_elements; }
+ Vector<Value> const& elements() const { return m_packed_elements; }
private:
friend GenericIndexedPropertyStorage;
@@ -86,7 +86,7 @@ public:
virtual size_t array_like_size() const override { return m_array_size; }
virtual bool set_array_like_size(size_t new_size) override;
- const HashMap<u32, ValueAndAttributes>& sparse_elements() const { return m_sparse_elements; }
+ HashMap<u32, ValueAndAttributes> const& sparse_elements() const { return m_sparse_elements; }
private:
size_t m_array_size { 0 };
@@ -95,18 +95,18 @@ private:
class IndexedPropertyIterator {
public:
- IndexedPropertyIterator(const IndexedProperties&, u32 starting_index, bool skip_empty);
+ IndexedPropertyIterator(IndexedProperties const&, u32 starting_index, bool skip_empty);
IndexedPropertyIterator& operator++();
IndexedPropertyIterator& operator*();
- bool operator!=(const IndexedPropertyIterator&) const;
+ bool operator!=(IndexedPropertyIterator const&) const;
u32 index() const { return m_index; };
private:
void skip_empty_indices();
- const IndexedProperties& m_indexed_properties;
+ IndexedProperties const& m_indexed_properties;
Vector<u32> m_cached_indices;
u32 m_index { 0 };
bool m_skip_empty { false };
@@ -149,7 +149,7 @@ public:
for (auto& value : static_cast<SimpleIndexedPropertyStorage&>(*m_storage).elements())
callback(value);
} else {
- for (auto& element : static_cast<const GenericIndexedPropertyStorage&>(*m_storage).sparse_elements())
+ for (auto& element : static_cast<GenericIndexedPropertyStorage const&>(*m_storage).sparse_elements())
callback(element.value.value);
}
}
diff --git a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp
index ac412398a5..60118b8832 100644
--- a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp
+++ b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp
@@ -122,7 +122,7 @@ JS_DEFINE_NATIVE_FUNCTION(JSONObject::stringify)
}
// 25.5.2.1 SerializeJSONProperty ( state, key, holder ), https://tc39.es/ecma262/#sec-serializejsonproperty
-ThrowCompletionOr<String> JSONObject::serialize_json_property(GlobalObject& global_object, StringifyState& state, const PropertyKey& key, Object* holder)
+ThrowCompletionOr<String> JSONObject::serialize_json_property(GlobalObject& global_object, StringifyState& state, PropertyKey const& key, Object* holder)
{
auto& vm = global_object.vm();
@@ -229,7 +229,7 @@ ThrowCompletionOr<String> JSONObject::serialize_json_object(GlobalObject& global
state.indent = String::formatted("{}{}", state.indent, state.gap);
Vector<String> property_strings;
- auto process_property = [&](const PropertyKey& key) -> ThrowCompletionOr<void> {
+ auto process_property = [&](PropertyKey const& key) -> ThrowCompletionOr<void> {
if (key.is_symbol())
return {};
auto serialized_property_string = TRY(serialize_json_property(global_object, state, key, &object));
@@ -408,7 +408,7 @@ JS_DEFINE_NATIVE_FUNCTION(JSONObject::parse)
return unfiltered;
}
-Value JSONObject::parse_json_value(GlobalObject& global_object, const JsonValue& value)
+Value JSONObject::parse_json_value(GlobalObject& global_object, JsonValue const& value)
{
if (value.is_object())
return Value(parse_json_object(global_object, value.as_object()));
@@ -427,7 +427,7 @@ Value JSONObject::parse_json_value(GlobalObject& global_object, const JsonValue&
VERIFY_NOT_REACHED();
}
-Object* JSONObject::parse_json_object(GlobalObject& global_object, const JsonObject& json_object)
+Object* JSONObject::parse_json_object(GlobalObject& global_object, JsonObject const& json_object)
{
auto* object = Object::create(global_object, global_object.object_prototype());
json_object.for_each_member([&](auto& key, auto& value) {
@@ -436,7 +436,7 @@ Object* JSONObject::parse_json_object(GlobalObject& global_object, const JsonObj
return object;
}
-Array* JSONObject::parse_json_array(GlobalObject& global_object, const JsonArray& json_array)
+Array* JSONObject::parse_json_array(GlobalObject& global_object, JsonArray const& json_array)
{
auto* array = MUST(Array::create(global_object, 0));
size_t index = 0;
@@ -455,7 +455,7 @@ ThrowCompletionOr<Value> JSONObject::internalize_json_property(GlobalObject& glo
auto is_array = TRY(value.is_array(global_object));
auto& value_object = value.as_object();
- auto process_property = [&](const PropertyKey& key) -> ThrowCompletionOr<void> {
+ auto process_property = [&](PropertyKey const& key) -> ThrowCompletionOr<void> {
auto element = TRY(internalize_json_property(global_object, &value_object, key, reviver));
if (element.is_undefined())
TRY(value_object.internal_delete(key));
diff --git a/Userland/Libraries/LibJS/Runtime/JSONObject.h b/Userland/Libraries/LibJS/Runtime/JSONObject.h
index 3aa2cd97d8..98c25d9169 100644
--- a/Userland/Libraries/LibJS/Runtime/JSONObject.h
+++ b/Userland/Libraries/LibJS/Runtime/JSONObject.h
@@ -22,7 +22,7 @@ public:
// test-js to communicate between the JS tests and the C++ test runner.
static ThrowCompletionOr<String> stringify_impl(GlobalObject&, Value value, Value replacer, Value space);
- static Value parse_json_value(GlobalObject&, const JsonValue&);
+ static Value parse_json_value(GlobalObject&, JsonValue const&);
private:
struct StringifyState {
@@ -34,14 +34,14 @@ private:
};
// Stringify helpers
- static ThrowCompletionOr<String> serialize_json_property(GlobalObject&, StringifyState&, const PropertyKey& key, Object* holder);
+ static ThrowCompletionOr<String> serialize_json_property(GlobalObject&, StringifyState&, PropertyKey const& key, Object* holder);
static ThrowCompletionOr<String> serialize_json_object(GlobalObject&, StringifyState&, Object&);
static ThrowCompletionOr<String> serialize_json_array(GlobalObject&, StringifyState&, Object&);
static String quote_json_string(String);
// Parse helpers
- static Object* parse_json_object(GlobalObject&, const JsonObject&);
- static Array* parse_json_array(GlobalObject&, const JsonArray&);
+ static Object* parse_json_object(GlobalObject&, JsonObject const&);
+ static Array* parse_json_array(GlobalObject&, JsonArray const&);
static ThrowCompletionOr<Value> internalize_json_property(GlobalObject&, Object* holder, PropertyKey const& name, FunctionObject& reviver);
JS_DECLARE_NATIVE_FUNCTION(stringify);
diff --git a/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp b/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp
index 998c80943b..978095470e 100644
--- a/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp
+++ b/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp
@@ -51,7 +51,7 @@ NativeFunction* NativeFunction::create(GlobalObject& global_object, Function<Thr
return function;
}
-NativeFunction* NativeFunction::create(GlobalObject& global_object, const FlyString& name, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> function)
+NativeFunction* NativeFunction::create(GlobalObject& global_object, FlyString const& name, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> function)
{
return global_object.heap().allocate<NativeFunction>(global_object, name, move(function), *global_object.function_prototype());
}
diff --git a/Userland/Libraries/LibJS/Runtime/NativeFunction.h b/Userland/Libraries/LibJS/Runtime/NativeFunction.h
index 27c85c83d1..cc76a46e2b 100644
--- a/Userland/Libraries/LibJS/Runtime/NativeFunction.h
+++ b/Userland/Libraries/LibJS/Runtime/NativeFunction.h
@@ -21,7 +21,7 @@ class NativeFunction : public FunctionObject {
public:
static NativeFunction* create(GlobalObject&, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> behaviour, i32 length, PropertyKey const& name, Optional<Realm*> = {}, Optional<Object*> prototype = {}, Optional<StringView> const& prefix = {});
- static NativeFunction* create(GlobalObject&, const FlyString& name, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)>);
+ static NativeFunction* create(GlobalObject&, FlyString const& name, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)>);
NativeFunction(GlobalObject&, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)>, Object* prototype, Realm& realm);
NativeFunction(FlyString name, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)>, Object& prototype);
@@ -36,7 +36,7 @@ public:
virtual ThrowCompletionOr<Value> call();
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target);
- virtual const FlyString& name() const override { return m_name; };
+ virtual FlyString const& name() const override { return m_name; };
virtual bool is_strict_mode() const override;
virtual bool has_constructor() const override { return false; }
virtual Realm* realm() const override { return m_realm; }
diff --git a/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp b/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp
index b0ae3e98d4..d1392def42 100644
--- a/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp
@@ -16,9 +16,9 @@
# define MAX_SAFE_INTEGER_VALUE AK::exp2(53.) - 1
# define MIN_SAFE_INTEGER_VALUE -(AK::exp2(53.) - 1)
#else
-constexpr const double EPSILON_VALUE { __builtin_exp2(-52) };
-constexpr const double MAX_SAFE_INTEGER_VALUE { __builtin_exp2(53) - 1 };
-constexpr const double MIN_SAFE_INTEGER_VALUE { -(__builtin_exp2(53) - 1) };
+constexpr double const EPSILON_VALUE { __builtin_exp2(-52) };
+constexpr double const MAX_SAFE_INTEGER_VALUE { __builtin_exp2(53) - 1 };
+constexpr double const MIN_SAFE_INTEGER_VALUE { -(__builtin_exp2(53) - 1) };
#endif
namespace JS {
diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp
index d83d9fc3b0..956921cbcd 100644
--- a/Userland/Libraries/LibJS/Runtime/Object.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Object.cpp
@@ -1083,7 +1083,7 @@ void Object::ensure_shape_is_unique()
}
// Simple side-effect free property lookup, following the prototype chain. Non-standard.
-Value Object::get_without_side_effects(const PropertyKey& property_key) const
+Value Object::get_without_side_effects(PropertyKey const& property_key) const
{
auto* object = this;
while (object) {
diff --git a/Userland/Libraries/LibJS/Runtime/Object.h b/Userland/Libraries/LibJS/Runtime/Object.h
index f7675dced5..1aa7d361ad 100644
--- a/Userland/Libraries/LibJS/Runtime/Object.h
+++ b/Userland/Libraries/LibJS/Runtime/Object.h
@@ -149,7 +149,7 @@ public:
// Non-standard methods
- Value get_without_side_effects(const PropertyKey&) const;
+ Value get_without_side_effects(PropertyKey const&) const;
void define_direct_property(PropertyKey const& property_key, Value value, PropertyAttributes attributes) { storage_set(property_key, { value, attributes }); };
void define_direct_accessor(PropertyKey const&, FunctionObject* getter, FunctionObject* setter, PropertyAttributes attributes);
@@ -176,7 +176,7 @@ public:
Value get_direct(size_t index) const { return m_storage[index]; }
- const IndexedProperties& indexed_properties() const { return m_indexed_properties; }
+ IndexedProperties const& indexed_properties() const { return m_indexed_properties; }
IndexedProperties& indexed_properties() { return m_indexed_properties; }
void set_indexed_property_elements(Vector<Value>&& values) { m_indexed_properties = IndexedProperties(move(values)); }
diff --git a/Userland/Libraries/LibJS/Runtime/PromiseReaction.h b/Userland/Libraries/LibJS/Runtime/PromiseReaction.h
index 71f1905fc6..bafd443ed5 100644
--- a/Userland/Libraries/LibJS/Runtime/PromiseReaction.h
+++ b/Userland/Libraries/LibJS/Runtime/PromiseReaction.h
@@ -74,10 +74,10 @@ public:
virtual ~PromiseReaction() = default;
Type type() const { return m_type; }
- const Optional<PromiseCapability>& capability() const { return m_capability; }
+ Optional<PromiseCapability> const& capability() const { return m_capability; }
Optional<JobCallback>& handler() { return m_handler; }
- const Optional<JobCallback>& handler() const { return m_handler; }
+ Optional<JobCallback> const& handler() const { return m_handler; }
private:
virtual StringView class_name() const override { return "PromiseReaction"sv; }
diff --git a/Userland/Libraries/LibJS/Runtime/PropertyAttributes.h b/Userland/Libraries/LibJS/Runtime/PropertyAttributes.h
index f00020246a..1c558e67ff 100644
--- a/Userland/Libraries/LibJS/Runtime/PropertyAttributes.h
+++ b/Userland/Libraries/LibJS/Runtime/PropertyAttributes.h
@@ -58,8 +58,8 @@ public:
m_bits &= ~Attribute::Configurable;
}
- bool operator==(const PropertyAttributes& other) const { return m_bits == other.m_bits; }
- bool operator!=(const PropertyAttributes& other) const { return m_bits != other.m_bits; }
+ bool operator==(PropertyAttributes const& other) const { return m_bits == other.m_bits; }
+ bool operator!=(PropertyAttributes const& other) const { return m_bits != other.m_bits; }
[[nodiscard]] u8 bits() const { return m_bits; }
diff --git a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp
index e0571d357f..e2e9406a41 100644
--- a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp
+++ b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp
@@ -219,7 +219,7 @@ ThrowCompletionOr<bool> ProxyObject::internal_prevent_extensions()
}
// 10.5.5 [[GetOwnProperty]] ( P ), https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getownproperty-p
-ThrowCompletionOr<Optional<PropertyDescriptor>> ProxyObject::internal_get_own_property(const PropertyKey& property_key) const
+ThrowCompletionOr<Optional<PropertyDescriptor>> ProxyObject::internal_get_own_property(PropertyKey const& property_key) const
{
auto& vm = this->vm();
auto& global_object = this->global_object();
@@ -858,7 +858,7 @@ void ProxyObject::visit_edges(Cell::Visitor& visitor)
visitor.visit(&m_handler);
}
-const FlyString& ProxyObject::name() const
+FlyString const& ProxyObject::name() const
{
VERIFY(is_function());
return static_cast<FunctionObject&>(m_target).name();
diff --git a/Userland/Libraries/LibJS/Runtime/ProxyObject.h b/Userland/Libraries/LibJS/Runtime/ProxyObject.h
index dc31bb9c2a..572bafc64d 100644
--- a/Userland/Libraries/LibJS/Runtime/ProxyObject.h
+++ b/Userland/Libraries/LibJS/Runtime/ProxyObject.h
@@ -21,11 +21,11 @@ public:
ProxyObject(Object& target, Object& handler, Object& prototype);
virtual ~ProxyObject() override = default;
- virtual const FlyString& name() const override;
+ virtual FlyString const& name() const override;
virtual bool has_constructor() const override;
- const Object& target() const { return m_target; }
- const Object& handler() const { return m_handler; }
+ Object const& target() const { return m_target; }
+ Object const& handler() const { return m_handler; }
bool is_revoked() const { return m_is_revoked; }
void revoke() { m_is_revoked = true; }
diff --git a/Userland/Libraries/LibJS/Runtime/RegExpObject.h b/Userland/Libraries/LibJS/Runtime/RegExpObject.h
index 1e76ebf7e6..7ae8f74f4d 100644
--- a/Userland/Libraries/LibJS/Runtime/RegExpObject.h
+++ b/Userland/Libraries/LibJS/Runtime/RegExpObject.h
@@ -44,10 +44,10 @@ public:
virtual void initialize(GlobalObject&) override;
virtual ~RegExpObject() override = default;
- const String& pattern() const { return m_pattern; }
- const String& flags() const { return m_flags; }
- const Regex<ECMA262>& regex() { return *m_regex; }
- const Regex<ECMA262>& regex() const { return *m_regex; }
+ String const& pattern() const { return m_pattern; }
+ String const& flags() const { return m_flags; }
+ Regex<ECMA262> const& regex() { return *m_regex; }
+ Regex<ECMA262> const& regex() const { return *m_regex; }
private:
String m_pattern;
diff --git a/Userland/Libraries/LibJS/Runtime/Shape.cpp b/Userland/Libraries/LibJS/Runtime/Shape.cpp
index 691bc6a35c..b8f820e3c9 100644
--- a/Userland/Libraries/LibJS/Runtime/Shape.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Shape.cpp
@@ -53,7 +53,7 @@ Shape* Shape::get_or_prune_cached_prototype_transition(Object* prototype)
return it->value;
}
-Shape* Shape::create_put_transition(const StringOrSymbol& property_key, PropertyAttributes attributes)
+Shape* Shape::create_put_transition(StringOrSymbol const& property_key, PropertyAttributes attributes)
{
TransitionKey key { property_key, attributes };
if (auto* existing_shape = get_or_prune_cached_forward_transition(key))
@@ -65,7 +65,7 @@ Shape* Shape::create_put_transition(const StringOrSymbol& property_key, Property
return new_shape;
}
-Shape* Shape::create_configure_transition(const StringOrSymbol& property_key, PropertyAttributes attributes)
+Shape* Shape::create_configure_transition(StringOrSymbol const& property_key, PropertyAttributes attributes)
{
TransitionKey key { property_key, attributes };
if (auto* existing_shape = get_or_prune_cached_forward_transition(key))
@@ -93,7 +93,7 @@ Shape::Shape(Object& global_object)
{
}
-Shape::Shape(Shape& previous_shape, const StringOrSymbol& property_key, PropertyAttributes attributes, TransitionType transition_type)
+Shape::Shape(Shape& previous_shape, StringOrSymbol const& property_key, PropertyAttributes attributes, TransitionType transition_type)
: m_global_object(previous_shape.m_global_object)
, m_previous(&previous_shape)
, m_property_key(property_key)
@@ -126,7 +126,7 @@ void Shape::visit_edges(Cell::Visitor& visitor)
}
}
-Optional<PropertyMetadata> Shape::lookup(const StringOrSymbol& property_key) const
+Optional<PropertyMetadata> Shape::lookup(StringOrSymbol const& property_key) const
{
if (m_property_count == 0)
return {};
@@ -162,7 +162,7 @@ void Shape::ensure_property_table() const
u32 next_offset = 0;
- Vector<const Shape*, 64> transition_chain;
+ Vector<Shape const*, 64> transition_chain;
for (auto* shape = m_previous; shape; shape = shape->m_previous) {
if (shape->m_property_table) {
*m_property_table = *shape->m_property_table;
@@ -189,7 +189,7 @@ void Shape::ensure_property_table() const
}
}
-void Shape::add_property_to_unique_shape(const StringOrSymbol& property_key, PropertyAttributes attributes)
+void Shape::add_property_to_unique_shape(StringOrSymbol const& property_key, PropertyAttributes attributes)
{
VERIFY(is_unique());
VERIFY(m_property_table);
@@ -200,7 +200,7 @@ void Shape::add_property_to_unique_shape(const StringOrSymbol& property_key, Pro
++m_property_count;
}
-void Shape::reconfigure_property_in_unique_shape(const StringOrSymbol& property_key, PropertyAttributes attributes)
+void Shape::reconfigure_property_in_unique_shape(StringOrSymbol const& property_key, PropertyAttributes attributes)
{
VERIFY(is_unique());
VERIFY(m_property_table);
@@ -210,7 +210,7 @@ void Shape::reconfigure_property_in_unique_shape(const StringOrSymbol& property_
m_property_table->set(property_key, it->value);
}
-void Shape::remove_property_from_unique_shape(const StringOrSymbol& property_key, size_t offset)
+void Shape::remove_property_from_unique_shape(StringOrSymbol const& property_key, size_t offset)
{
VERIFY(is_unique());
VERIFY(m_property_table);
diff --git a/Userland/Libraries/LibJS/Runtime/Shape.h b/Userland/Libraries/LibJS/Runtime/Shape.h
index a4221c7c49..9ae5166082 100644
--- a/Userland/Libraries/LibJS/Runtime/Shape.h
+++ b/Userland/Libraries/LibJS/Runtime/Shape.h
@@ -28,7 +28,7 @@ struct TransitionKey {
StringOrSymbol property_key;
PropertyAttributes attributes { 0 };
- bool operator==(const TransitionKey& other) const
+ bool operator==(TransitionKey const& other) const
{
return property_key == other.property_key && attributes == other.attributes;
}
@@ -51,14 +51,14 @@ public:
explicit Shape(ShapeWithoutGlobalObjectTag) {};
explicit Shape(Object& global_object);
- Shape(Shape& previous_shape, const StringOrSymbol& property_key, PropertyAttributes attributes, TransitionType);
+ Shape(Shape& previous_shape, StringOrSymbol const& property_key, PropertyAttributes attributes, TransitionType);
Shape(Shape& previous_shape, Object* new_prototype);
- Shape* create_put_transition(const StringOrSymbol&, PropertyAttributes attributes);
- Shape* create_configure_transition(const StringOrSymbol&, PropertyAttributes attributes);
+ Shape* create_put_transition(StringOrSymbol const&, PropertyAttributes attributes);
+ Shape* create_configure_transition(StringOrSymbol const&, PropertyAttributes attributes);
Shape* create_prototype_transition(Object* new_prototype);
- void add_property_without_transition(const StringOrSymbol&, PropertyAttributes);
+ void add_property_without_transition(StringOrSymbol const&, PropertyAttributes);
void add_property_without_transition(PropertyKey const&, PropertyAttributes);
bool is_unique() const { return m_unique; }
@@ -67,10 +67,10 @@ public:
GlobalObject* global_object() const;
Object* prototype() { return m_prototype; }
- const Object* prototype() const { return m_prototype; }
+ Object const* prototype() const { return m_prototype; }
- Optional<PropertyMetadata> lookup(const StringOrSymbol&) const;
- const HashMap<StringOrSymbol, PropertyMetadata>& property_table() const;
+ Optional<PropertyMetadata> lookup(StringOrSymbol const&) const;
+ HashMap<StringOrSymbol, PropertyMetadata> const& property_table() const;
u32 property_count() const { return m_property_count; }
struct Property {
@@ -82,9 +82,9 @@ public:
void set_prototype_without_transition(Object* new_prototype) { m_prototype = new_prototype; }
- void remove_property_from_unique_shape(const StringOrSymbol&, size_t offset);
- void add_property_to_unique_shape(const StringOrSymbol&, PropertyAttributes attributes);
- void reconfigure_property_in_unique_shape(const StringOrSymbol& property_key, PropertyAttributes attributes);
+ void remove_property_from_unique_shape(StringOrSymbol const&, size_t offset);
+ void add_property_to_unique_shape(StringOrSymbol const&, PropertyAttributes attributes);
+ void reconfigure_property_in_unique_shape(StringOrSymbol const& property_key, PropertyAttributes attributes);
private:
virtual StringView class_name() const override { return "Shape"sv; }
diff --git a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp
index bc2deecf54..767161ac96 100644
--- a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp
@@ -73,7 +73,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringConstructor::raw)
if (literal_segments == 0)
return js_string(vm, "");
- const auto number_of_substituions = vm.argument_count() - 1;
+ auto const number_of_substituions = vm.argument_count() - 1;
StringBuilder builder;
for (size_t i = 0; i < literal_segments; ++i) {
diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp
index 2826c9d292..22a8664251 100644
--- a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp
@@ -931,7 +931,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::search)
}
// B.2.2.2.1 CreateHTML ( string, tag, attribute, value ), https://tc39.es/ecma262/#sec-createhtml
-static ThrowCompletionOr<Value> create_html(GlobalObject& global_object, Value string, const String& tag, const String& attribute, Value value)
+static ThrowCompletionOr<Value> create_html(GlobalObject& global_object, Value string, String const& tag, String const& attribute, Value value)
{
auto& vm = global_object.vm();
TRY(require_object_coercible(global_object, string));
diff --git a/Userland/Libraries/LibJS/Runtime/Symbol.h b/Userland/Libraries/LibJS/Runtime/Symbol.h
index 955e3fde56..b4ae8dc148 100644
--- a/Userland/Libraries/LibJS/Runtime/Symbol.h
+++ b/Userland/Libraries/LibJS/Runtime/Symbol.h
@@ -21,7 +21,7 @@ public:
virtual ~Symbol() = default;
String description() const { return m_description.value_or(""); }
- const Optional<String>& raw_description() const { return m_description; }
+ Optional<String> const& raw_description() const { return m_description; }
bool is_global() const { return m_is_global; }
String to_string() const { return String::formatted("Symbol({})", description()); }
diff --git a/Userland/Libraries/LibJS/Runtime/SymbolObject.h b/Userland/Libraries/LibJS/Runtime/SymbolObject.h
index fdb2e626db..8d3ba8607c 100644
--- a/Userland/Libraries/LibJS/Runtime/SymbolObject.h
+++ b/Userland/Libraries/LibJS/Runtime/SymbolObject.h
@@ -21,7 +21,7 @@ public:
virtual ~SymbolObject() override = default;
Symbol& primitive_symbol() { return m_symbol; }
- const Symbol& primitive_symbol() const { return m_symbol; }
+ Symbol const& primitive_symbol() const { return m_symbol; }
String description() const { return m_symbol.description(); }
bool is_global() const { return m_symbol.is_global(); }
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.h b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.h
index ae76fd2a83..2943a16ca7 100644
--- a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.h
+++ b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.h
@@ -32,9 +32,9 @@ private:
};
// -86400 * 10^17
-const auto INSTANT_NANOSECONDS_MIN = "-8640000000000000000000"_sbigint;
+auto const INSTANT_NANOSECONDS_MIN = "-8640000000000000000000"_sbigint;
// +86400 * 10^17
-const auto INSTANT_NANOSECONDS_MAX = "8640000000000000000000"_sbigint;
+auto const INSTANT_NANOSECONDS_MAX = "8640000000000000000000"_sbigint;
bool is_valid_epoch_nanoseconds(BigInt const& epoch_nanoseconds);
ThrowCompletionOr<Instant*> create_temporal_instant(GlobalObject&, BigInt const& nanoseconds, FunctionObject const* new_target = nullptr);
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp
index e290a2157a..6b179621c5 100644
--- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp
@@ -74,9 +74,9 @@ BigInt* get_epoch_from_iso_parts(GlobalObject& global_object, i32 year, u8 month
}
// -864 * 10^19 - 864 * 10^11
-const auto DATETIME_NANOSECONDS_MIN = "-8640000086400000000000"_sbigint;
+auto const DATETIME_NANOSECONDS_MIN = "-8640000086400000000000"_sbigint;
// +864 * 10^19 + 864 * 10^11
-const auto DATETIME_NANOSECONDS_MAX = "8640000086400000000000"_sbigint;
+auto const DATETIME_NANOSECONDS_MAX = "8640000086400000000000"_sbigint;
// 5.5.2 ISODateTimeWithinLimits ( year, month, day, hour, minute, second, millisecond, microsecond, nanosecond ), https://tc39.es/proposal-temporal/#sec-temporal-isodatetimewithinlimits
bool iso_date_time_within_limits(GlobalObject& global_object, i32 year, u8 month, u8 day, u8 hour, u8 minute, u8 second, u16 millisecond, u16 microsecond, u16 nanosecond)
diff --git a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp
index bf6eb8a426..f428f2e2b5 100644
--- a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp
+++ b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp
@@ -230,7 +230,7 @@ static ThrowCompletionOr<void> initialize_typed_array_from_typed_array(GlobalObj
// 23.2.5.1.5 InitializeTypedArrayFromArrayLike, https://tc39.es/ecma262/#sec-initializetypedarrayfromarraylike
template<typename T>
-static ThrowCompletionOr<void> initialize_typed_array_from_array_like(GlobalObject& global_object, TypedArray<T>& typed_array, const Object& array_like)
+static ThrowCompletionOr<void> initialize_typed_array_from_array_like(GlobalObject& global_object, TypedArray<T>& typed_array, Object const& array_like)
{
auto& vm = global_object.vm();
@@ -291,7 +291,7 @@ static ThrowCompletionOr<void> initialize_typed_array_from_array_like(GlobalObje
// 23.2.5.1.4 InitializeTypedArrayFromList, https://tc39.es/ecma262/#sec-initializetypedarrayfromlist
template<typename T>
-static ThrowCompletionOr<void> initialize_typed_array_from_list(GlobalObject& global_object, TypedArray<T>& typed_array, const MarkedVector<Value>& list)
+static ThrowCompletionOr<void> initialize_typed_array_from_list(GlobalObject& global_object, TypedArray<T>& typed_array, MarkedVector<Value> const& list)
{
auto& vm = global_object.vm();
diff --git a/Userland/Libraries/LibJS/Runtime/TypedArray.h b/Userland/Libraries/LibJS/Runtime/TypedArray.h
index 4e81d0eb38..d8f27ac701 100644
--- a/Userland/Libraries/LibJS/Runtime/TypedArray.h
+++ b/Userland/Libraries/LibJS/Runtime/TypedArray.h
@@ -425,7 +425,7 @@ public:
Span<const UnderlyingBufferDataType> data() const
{
- return { reinterpret_cast<const UnderlyingBufferDataType*>(m_viewed_array_buffer->buffer().data() + m_byte_offset), m_array_length };
+ return { reinterpret_cast<UnderlyingBufferDataType const*>(m_viewed_array_buffer->buffer().data() + m_byte_offset), m_array_length };
}
Span<UnderlyingBufferDataType> data()
{
diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp
index 0d9cc8dac5..a6f014319f 100644
--- a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp
@@ -11,7 +11,7 @@
namespace JS {
-TypedArrayConstructor::TypedArrayConstructor(const FlyString& name, Object& prototype)
+TypedArrayConstructor::TypedArrayConstructor(FlyString const& name, Object& prototype)
: NativeFunction(name, prototype)
{
}
diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h
index fa7ed0e9b4..6d53099685 100644
--- a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h
+++ b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h
@@ -14,7 +14,7 @@ class TypedArrayConstructor : public NativeFunction {
JS_OBJECT(TypedArrayConstructor, NativeFunction);
public:
- TypedArrayConstructor(const FlyString& name, Object& prototype);
+ TypedArrayConstructor(FlyString const& name, Object& prototype);
explicit TypedArrayConstructor(GlobalObject&);
virtual void initialize(GlobalObject&) override;
virtual ~TypedArrayConstructor() override = default;
diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp
index 39cb7dfc10..edf9773165 100644
--- a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp
@@ -82,7 +82,7 @@ static ThrowCompletionOr<TypedArrayBase*> validate_typed_array_from_this(GlobalO
return typed_array;
}
-static ThrowCompletionOr<FunctionObject*> callback_from_args(GlobalObject& global_object, const String& name)
+static ThrowCompletionOr<FunctionObject*> callback_from_args(GlobalObject& global_object, String const& name)
{
auto& vm = global_object.vm();
if (vm.argument_count() < 1)
@@ -93,7 +93,7 @@ static ThrowCompletionOr<FunctionObject*> callback_from_args(GlobalObject& globa
return &callback.as_function();
}
-static ThrowCompletionOr<void> for_each_item(VM& vm, GlobalObject& global_object, const String& name, Function<IterationDecision(size_t index, Value value, Value callback_result)> callback)
+static ThrowCompletionOr<void> for_each_item(VM& vm, GlobalObject& global_object, String const& name, Function<IterationDecision(size_t index, Value value, Value callback_result)> callback)
{
auto* typed_array = TRY(validate_typed_array_from_this(global_object));
@@ -115,7 +115,7 @@ static ThrowCompletionOr<void> for_each_item(VM& vm, GlobalObject& global_object
return {};
}
-static ThrowCompletionOr<void> for_each_item_from_last(VM& vm, GlobalObject& global_object, const String& name, Function<IterationDecision(size_t index, Value value, Value callback_result)> callback)
+static ThrowCompletionOr<void> for_each_item_from_last(VM& vm, GlobalObject& global_object, String const& name, Function<IterationDecision(size_t index, Value value, Value callback_result)> callback)
{
auto* typed_array = TRY(validate_typed_array_from_this(global_object));
diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp
index 82f3aa4083..7d66de9f66 100644
--- a/Userland/Libraries/LibJS/Runtime/VM.cpp
+++ b/Userland/Libraries/LibJS/Runtime/VM.cpp
@@ -216,7 +216,7 @@ void VM::gather_roots(HashTable<Cell*>& roots)
roots.set(finalization_registry);
}
-Symbol* VM::get_global_symbol(const String& description)
+Symbol* VM::get_global_symbol(String const& description)
{
auto result = m_global_symbol_map.get(description);
if (result.has_value())
diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h
index 1295c2f01b..94495e1984 100644
--- a/Userland/Libraries/LibJS/Runtime/VM.h
+++ b/Userland/Libraries/LibJS/Runtime/VM.h
@@ -45,7 +45,7 @@ public:
};
Heap& heap() { return m_heap; }
- const Heap& heap() const { return m_heap; }
+ Heap const& heap() const { return m_heap; }
Interpreter& interpreter();
Interpreter* interpreter_if_exists();
@@ -73,7 +73,7 @@ public:
JS_ENUMERATE_WELL_KNOWN_SYMBOLS
#undef __JS_ENUMERATE
- Symbol* get_global_symbol(const String& description);
+ Symbol* get_global_symbol(String const& description);
HashMap<String, PrimitiveString*>& string_cache() { return m_string_cache; }
PrimitiveString& empty_string() { return *m_empty_string; }
@@ -158,7 +158,7 @@ public:
ThrowCompletionOr<Value> resolve_this_binding(GlobalObject&);
- const StackInfo& stack_info() const { return m_stack_info; };
+ StackInfo const& stack_info() const { return m_stack_info; };
u32 execution_generation() const { return m_execution_generation; }
void finish_execution_generation() { ++m_execution_generation; }
diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp
index 06fdd8c0c7..7f5c80a90c 100644
--- a/Userland/Libraries/LibJS/Runtime/Value.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Value.cpp
@@ -39,7 +39,7 @@
namespace JS {
-static inline bool same_type_for_equality(const Value& lhs, const Value& rhs)
+static inline bool same_type_for_equality(Value const& lhs, Value const& rhs)
{
if (lhs.type() == rhs.type())
return true;
@@ -50,12 +50,12 @@ static inline bool same_type_for_equality(const Value& lhs, const Value& rhs)
static const Crypto::SignedBigInteger BIGINT_ZERO { 0 };
-ALWAYS_INLINE bool both_number(const Value& lhs, const Value& rhs)
+ALWAYS_INLINE bool both_number(Value const& lhs, Value const& rhs)
{
return lhs.is_number() && rhs.is_number();
}
-ALWAYS_INLINE bool both_bigint(const Value& lhs, const Value& rhs)
+ALWAYS_INLINE bool both_bigint(Value const& lhs, Value const& rhs)
{
return lhs.is_bigint() && rhs.is_bigint();
}
@@ -1295,7 +1295,7 @@ ThrowCompletionOr<Value> ordinary_has_instance(GlobalObject& global_object, Valu
auto& rhs_function = rhs.as_function();
if (is<BoundFunction>(rhs_function)) {
- auto& bound_target = static_cast<const BoundFunction&>(rhs_function);
+ auto& bound_target = static_cast<BoundFunction const&>(rhs_function);
return instance_of(global_object, lhs, Value(&bound_target.bound_target_function()));
}
diff --git a/Userland/Libraries/LibJS/Runtime/Value.h b/Userland/Libraries/LibJS/Runtime/Value.h
index 364c410c2e..0b1f1aac59 100644
--- a/Userland/Libraries/LibJS/Runtime/Value.h
+++ b/Userland/Libraries/LibJS/Runtime/Value.h
@@ -178,31 +178,31 @@ public:
m_value.as_i32 = value;
}
- Value(const Object* object)
+ Value(Object const* object)
: m_type(object ? Type::Object : Type::Null)
{
m_value.as_object = const_cast<Object*>(object);
}
- Value(const PrimitiveString* string)
+ Value(PrimitiveString const* string)
: m_type(Type::String)
{
m_value.as_string = const_cast<PrimitiveString*>(string);
}
- Value(const Symbol* symbol)
+ Value(Symbol const* symbol)
: m_type(Type::Symbol)
{
m_value.as_symbol = const_cast<Symbol*>(symbol);
}
- Value(const Accessor* accessor)
+ Value(Accessor const* accessor)
: m_type(Type::Accessor)
{
m_value.as_accessor = const_cast<Accessor*>(accessor);
}
- Value(const BigInt* bigint)
+ Value(BigInt const* bigint)
: m_type(Type::BigInt)
{
m_value.as_bigint = const_cast<BigInt*>(bigint);
@@ -235,7 +235,7 @@ public:
return *m_value.as_object;
}
- const Object& as_object() const
+ Object const& as_object() const
{
VERIFY(type() == Type::Object);
return *m_value.as_object;
@@ -247,7 +247,7 @@ public:
return *m_value.as_string;
}
- const PrimitiveString& as_string() const
+ PrimitiveString const& as_string() const
{
VERIFY(is_string());
return *m_value.as_string;
@@ -259,7 +259,7 @@ public:
return *m_value.as_symbol;
}
- const Symbol& as_symbol() const
+ Symbol const& as_symbol() const
{
VERIFY(is_symbol());
return *m_value.as_symbol;
diff --git a/Userland/Libraries/LibJS/SyntaxHighlighter.cpp b/Userland/Libraries/LibJS/SyntaxHighlighter.cpp
index 737f9315b4..c527dc42b3 100644
--- a/Userland/Libraries/LibJS/SyntaxHighlighter.cpp
+++ b/Userland/Libraries/LibJS/SyntaxHighlighter.cpp
@@ -12,7 +12,7 @@
namespace JS {
-static Syntax::TextStyle style_for_token_type(const Gfx::Palette& palette, JS::TokenType type)
+static Syntax::TextStyle style_for_token_type(Gfx::Palette const& palette, JS::TokenType type)
{
switch (JS::Token::category(type)) {
case JS::TokenCategory::Invalid:
@@ -47,7 +47,7 @@ bool SyntaxHighlighter::is_navigatable([[maybe_unused]] u64 token) const
return false;
}
-void SyntaxHighlighter::rehighlight(const Palette& palette)
+void SyntaxHighlighter::rehighlight(Palette const& palette)
{
auto text = m_client->get_text();
diff --git a/Userland/Libraries/LibJS/SyntaxHighlighter.h b/Userland/Libraries/LibJS/SyntaxHighlighter.h
index d3929937f0..e1667cac70 100644
--- a/Userland/Libraries/LibJS/SyntaxHighlighter.h
+++ b/Userland/Libraries/LibJS/SyntaxHighlighter.h
@@ -19,7 +19,7 @@ public:
virtual bool is_navigatable(u64) const override;
virtual Syntax::Language language() const override { return Syntax::Language::JavaScript; }
- virtual void rehighlight(const Palette&) override;
+ virtual void rehighlight(Palette const&) override;
protected:
virtual Vector<MatchingTokenPair> matching_token_pairs_impl() const override;
diff --git a/Userland/Libraries/LibJS/Token.cpp b/Userland/Libraries/LibJS/Token.cpp
index 9a51a15508..1d84a4aeaf 100644
--- a/Userland/Libraries/LibJS/Token.cpp
+++ b/Userland/Libraries/LibJS/Token.cpp
@@ -13,7 +13,7 @@
namespace JS {
-const char* Token::name(TokenType type)
+char const* Token::name(TokenType type)
{
switch (type) {
#define __ENUMERATE_JS_TOKEN(type, category) \
@@ -27,7 +27,7 @@ const char* Token::name(TokenType type)
}
}
-const char* Token::name() const
+char const* Token::name() const
{
return name(m_type);
}
diff --git a/Userland/Libraries/LibJS/Token.h b/Userland/Libraries/LibJS/Token.h
index 0e7d282aa2..086c1df3a3 100644
--- a/Userland/Libraries/LibJS/Token.h
+++ b/Userland/Libraries/LibJS/Token.h
@@ -14,12 +14,12 @@
namespace JS {
// U+2028 LINE SEPARATOR
-constexpr const char line_separator_chars[] { (char)0xe2, (char)0x80, (char)0xa8, 0 };
+constexpr char const line_separator_chars[] { (char)0xe2, (char)0x80, (char)0xa8, 0 };
constexpr const StringView LINE_SEPARATOR_STRING { line_separator_chars };
constexpr const u32 LINE_SEPARATOR { 0x2028 };
// U+2029 PARAGRAPH SEPARATOR
-constexpr const char paragraph_separator_chars[] { (char)0xe2, (char)0x80, (char)0xa9, 0 };
+constexpr char const paragraph_separator_chars[] { (char)0xe2, (char)0x80, (char)0xa9, 0 };
constexpr const StringView PARAGRAPH_SEPARATOR_STRING { paragraph_separator_chars };
constexpr const u32 PARAGRAPH_SEPARATOR { 0x2029 };
@@ -197,10 +197,10 @@ public:
TokenType type() const { return m_type; }
TokenCategory category() const;
static TokenCategory category(TokenType);
- const char* name() const;
- static const char* name(TokenType);
+ char const* name() const;
+ static char const* name(TokenType);
- const String& message() const { return m_message; }
+ String const& message() const { return m_message; }
StringView trivia() const { return m_trivia; }
StringView original_value() const { return m_original_value; }
StringView value() const
diff --git a/Userland/Libraries/LibKeyboard/CharacterMap.cpp b/Userland/Libraries/LibKeyboard/CharacterMap.cpp
index dec8014d0e..85b6df3e8e 100644
--- a/Userland/Libraries/LibKeyboard/CharacterMap.cpp
+++ b/Userland/Libraries/LibKeyboard/CharacterMap.cpp
@@ -12,14 +12,14 @@
namespace Keyboard {
-ErrorOr<CharacterMap> CharacterMap::load_from_file(const String& map_name)
+ErrorOr<CharacterMap> CharacterMap::load_from_file(String const& map_name)
{
auto result = TRY(CharacterMapFile::load_from_file(map_name));
return CharacterMap(map_name, result);
}
-CharacterMap::CharacterMap(const String& map_name, const CharacterMapData& map_data)
+CharacterMap::CharacterMap(String const& map_name, CharacterMapData const& map_data)
: m_character_map_data(map_data)
, m_character_map_name(map_name)
{
@@ -41,7 +41,7 @@ ErrorOr<CharacterMap> CharacterMap::fetch_system_map()
return CharacterMap { keymap_name, map_data };
}
-const String& CharacterMap::character_map_name() const
+String const& CharacterMap::character_map_name() const
{
return m_character_map_name;
}
diff --git a/Userland/Libraries/LibKeyboard/CharacterMap.h b/Userland/Libraries/LibKeyboard/CharacterMap.h
index 7d3e96f176..9990077bb0 100644
--- a/Userland/Libraries/LibKeyboard/CharacterMap.h
+++ b/Userland/Libraries/LibKeyboard/CharacterMap.h
@@ -15,14 +15,14 @@ namespace Keyboard {
class CharacterMap {
public:
- CharacterMap(const String& map_name, const CharacterMapData& map_data);
- static ErrorOr<CharacterMap> load_from_file(const String& filename);
+ CharacterMap(String const& map_name, CharacterMapData const& map_data);
+ static ErrorOr<CharacterMap> load_from_file(String const& filename);
int set_system_map();
static ErrorOr<CharacterMap> fetch_system_map();
- const CharacterMapData& character_map_data() const { return m_character_map_data; };
- const String& character_map_name() const;
+ CharacterMapData const& character_map_data() const { return m_character_map_data; };
+ String const& character_map_name() const;
private:
CharacterMapData m_character_map_data;
diff --git a/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp b/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp
index 233e94e793..838de4e35c 100644
--- a/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp
+++ b/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp
@@ -11,7 +11,7 @@
namespace Keyboard {
-ErrorOr<CharacterMapData> CharacterMapFile::load_from_file(const String& filename)
+ErrorOr<CharacterMapData> CharacterMapFile::load_from_file(String const& filename)
{
auto path = filename;
if (!path.ends_with(".json")) {
@@ -25,7 +25,7 @@ ErrorOr<CharacterMapData> CharacterMapFile::load_from_file(const String& filenam
auto file = TRY(Core::File::open(path, Core::OpenMode::ReadOnly));
auto file_contents = file->read_all();
auto json_result = TRY(JsonValue::from_string(file_contents));
- const auto& json = json_result.as_object();
+ auto const& json = json_result.as_object();
Vector<u32> map = read_map(json, "map");
Vector<u32> shift_map = read_map(json, "shift_map");
@@ -55,7 +55,7 @@ ErrorOr<CharacterMapData> CharacterMapFile::load_from_file(const String& filenam
return character_map;
}
-Vector<u32> CharacterMapFile::read_map(const JsonObject& json, const String& name)
+Vector<u32> CharacterMapFile::read_map(JsonObject const& json, String const& name)
{
if (!json.has(name))
return {};
diff --git a/Userland/Libraries/LibKeyboard/CharacterMapFile.h b/Userland/Libraries/LibKeyboard/CharacterMapFile.h
index 986278f71a..ad79e017f9 100644
--- a/Userland/Libraries/LibKeyboard/CharacterMapFile.h
+++ b/Userland/Libraries/LibKeyboard/CharacterMapFile.h
@@ -14,10 +14,10 @@ namespace Keyboard {
class CharacterMapFile {
public:
- static ErrorOr<CharacterMapData> load_from_file(const String& filename);
+ static ErrorOr<CharacterMapData> load_from_file(String const& filename);
private:
- static Vector<u32> read_map(const JsonObject& json, const String& name);
+ static Vector<u32> read_map(JsonObject const& json, String const& name);
};
}
diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp
index c2bd3c3a5b..0d2baf01b4 100644
--- a/Userland/Libraries/LibLine/Editor.cpp
+++ b/Userland/Libraries/LibLine/Editor.cpp
@@ -2040,7 +2040,7 @@ size_t StringMetrics::offset_with_addition(StringMetrics const& offset, size_t c
bool Editor::Spans::contains_up_to_offset(Spans const& other, size_t offset) const
{
- auto compare = [&]<typename K, typename V>(const HashMap<K, HashMap<K, V>>& left, const HashMap<K, HashMap<K, V>>& right) -> bool {
+ auto compare = [&]<typename K, typename V>(HashMap<K, HashMap<K, V>> const& left, HashMap<K, HashMap<K, V>> const& right) -> bool {
for (auto& entry : right) {
if (entry.key > offset + 1)
continue;
diff --git a/Userland/Libraries/LibLine/Editor.h b/Userland/Libraries/LibLine/Editor.h
index bc835398e3..e6a62dfedf 100644
--- a/Userland/Libraries/LibLine/Editor.h
+++ b/Userland/Libraries/LibLine/Editor.h
@@ -191,7 +191,7 @@ public:
cursor = m_buffer.size();
m_cursor = cursor;
}
- const Vector<u32, 1024>& buffer() const { return m_buffer; }
+ Vector<u32, 1024> const& buffer() const { return m_buffer; }
u32 buffer_at(size_t pos) const { return m_buffer.at(pos); }
String line() const { return line(m_buffer.size()); }
String line(size_t up_to_index) const;
diff --git a/Userland/Libraries/LibLine/InternalFunctions.cpp b/Userland/Libraries/LibLine/InternalFunctions.cpp
index ba57fab492..7bfec19a9c 100644
--- a/Userland/Libraries/LibLine/InternalFunctions.cpp
+++ b/Userland/Libraries/LibLine/InternalFunctions.cpp
@@ -516,7 +516,7 @@ void Editor::uppercase_word()
void Editor::edit_in_external_editor()
{
- const auto* editor_command = getenv("EDITOR");
+ auto const* editor_command = getenv("EDITOR");
if (!editor_command)
editor_command = m_configuration.m_default_text_editor.characters();
@@ -553,7 +553,7 @@ void Editor::edit_in_external_editor()
}
};
- Vector<const char*> args { editor_command, file_path, nullptr };
+ Vector<char const*> args { editor_command, file_path, nullptr };
auto pid = fork();
if (pid == -1) {
diff --git a/Userland/Libraries/LibLine/KeyCallbackMachine.h b/Userland/Libraries/LibLine/KeyCallbackMachine.h
index 82900471b0..4d09ee1012 100644
--- a/Userland/Libraries/LibLine/KeyCallbackMachine.h
+++ b/Userland/Libraries/LibLine/KeyCallbackMachine.h
@@ -80,7 +80,7 @@ struct Traits<Line::Key> : public GenericTraits<Line::Key> {
template<>
struct Traits<Vector<Line::Key>> : public GenericTraits<Vector<Line::Key>> {
static constexpr bool is_trivial() { return false; }
- static unsigned hash(const Vector<Line::Key>& ks)
+ static unsigned hash(Vector<Line::Key> const& ks)
{
unsigned h = 0;
for (auto& k : ks)
diff --git a/Userland/Libraries/LibM/math.cpp b/Userland/Libraries/LibM/math.cpp
index 94d2e350f8..f3760cccd2 100644
--- a/Userland/Libraries/LibM/math.cpp
+++ b/Userland/Libraries/LibM/math.cpp
@@ -340,17 +340,17 @@ static FloatT internal_gamma(FloatT x) NOEXCEPT
extern "C" {
-float nanf(const char* s) NOEXCEPT
+float nanf(char const* s) NOEXCEPT
{
return __builtin_nanf(s);
}
-double nan(const char* s) NOEXCEPT
+double nan(char const* s) NOEXCEPT
{
return __builtin_nan(s);
}
-long double nanl(const char* s) NOEXCEPT
+long double nanl(char const* s) NOEXCEPT
{
return __builtin_nanl(s);
}
diff --git a/Userland/Libraries/LibM/math.h b/Userland/Libraries/LibM/math.h
index a54e81ac63..b5269044b0 100644
--- a/Userland/Libraries/LibM/math.h
+++ b/Userland/Libraries/LibM/math.h
@@ -128,9 +128,9 @@ float fminf(float, float) NOEXCEPT;
long double remainderl(long double, long double) NOEXCEPT;
double remainder(double, double) NOEXCEPT;
float remainderf(float, float) NOEXCEPT;
-long double nanl(const char*) NOEXCEPT;
-double nan(const char*) NOEXCEPT;
-float nanf(const char*) NOEXCEPT;
+long double nanl(char const*) NOEXCEPT;
+double nan(char const*) NOEXCEPT;
+float nanf(char const*) NOEXCEPT;
/* Exponential functions */
long double expl(long double) NOEXCEPT;
diff --git a/Userland/Libraries/LibMarkdown/Document.cpp b/Userland/Libraries/LibMarkdown/Document.cpp
index 2d00188ee2..a4fa2307ae 100644
--- a/Userland/Libraries/LibMarkdown/Document.cpp
+++ b/Userland/Libraries/LibMarkdown/Document.cpp
@@ -53,7 +53,7 @@ RecursionDecision Document::walk(Visitor& visitor) const
OwnPtr<Document> Document::parse(StringView str)
{
- const Vector<StringView> lines_vec = str.lines();
+ Vector<StringView> const lines_vec = str.lines();
LineIterator lines(lines_vec.begin());
return make<Document>(ContainerBlock::parse(lines));
}
diff --git a/Userland/Libraries/LibMarkdown/List.cpp b/Userland/Libraries/LibMarkdown/List.cpp
index 2ecd58401e..d98288f355 100644
--- a/Userland/Libraries/LibMarkdown/List.cpp
+++ b/Userland/Libraries/LibMarkdown/List.cpp
@@ -16,7 +16,7 @@ String List::render_to_html(bool) const
{
StringBuilder builder;
- const char* tag = m_is_ordered ? "ol" : "ul";
+ char const* tag = m_is_ordered ? "ol" : "ul";
builder.appendff("<{}", tag);
if (m_start_number != 1)
diff --git a/Userland/Libraries/LibMarkdown/Table.cpp b/Userland/Libraries/LibMarkdown/Table.cpp
index 445b969ea3..5cf26bd48e 100644
--- a/Userland/Libraries/LibMarkdown/Table.cpp
+++ b/Userland/Libraries/LibMarkdown/Table.cpp
@@ -16,7 +16,7 @@ String Table::render_for_terminal(size_t view_width) const
auto unit_width_length = view_width == 0 ? 4 : ((float)(view_width - m_columns.size()) / (float)m_total_width);
StringBuilder builder;
- auto write_aligned = [&](const auto& text, auto width, auto alignment) {
+ auto write_aligned = [&](auto const& text, auto width, auto alignment) {
size_t original_length = text.terminal_length();
auto string = text.render_for_terminal();
if (alignment == Alignment::Center) {
diff --git a/Userland/Libraries/LibPCIDB/Database.cpp b/Userland/Libraries/LibPCIDB/Database.cpp
index ce23b80994..bffd5b7d07 100644
--- a/Userland/Libraries/LibPCIDB/Database.cpp
+++ b/Userland/Libraries/LibPCIDB/Database.cpp
@@ -12,7 +12,7 @@
namespace PCIDB {
-RefPtr<Database> Database::open(const String& filename)
+RefPtr<Database> Database::open(String const& filename)
{
auto file_or_error = Core::MappedFile::map(filename);
if (file_or_error.is_error())
@@ -25,7 +25,7 @@ RefPtr<Database> Database::open(const String& filename)
const StringView Database::get_vendor(u16 vendor_id) const
{
- const auto& vendor = m_vendors.get(vendor_id);
+ auto const& vendor = m_vendors.get(vendor_id);
if (!vendor.has_value())
return "";
return vendor.value()->name;
@@ -33,10 +33,10 @@ const StringView Database::get_vendor(u16 vendor_id) const
const StringView Database::get_device(u16 vendor_id, u16 device_id) const
{
- const auto& vendor = m_vendors.get(vendor_id);
+ auto const& vendor = m_vendors.get(vendor_id);
if (!vendor.has_value())
return "";
- const auto& device = vendor.value()->devices.get(device_id);
+ auto const& device = vendor.value()->devices.get(device_id);
if (!device.has_value())
return "";
return device.value()->name;
@@ -44,13 +44,13 @@ const StringView Database::get_device(u16 vendor_id, u16 device_id) const
const StringView Database::get_subsystem(u16 vendor_id, u16 device_id, u16 subvendor_id, u16 subdevice_id) const
{
- const auto& vendor = m_vendors.get(vendor_id);
+ auto const& vendor = m_vendors.get(vendor_id);
if (!vendor.has_value())
return "";
- const auto& device = vendor.value()->devices.get(device_id);
+ auto const& device = vendor.value()->devices.get(device_id);
if (!device.has_value())
return "";
- const auto& subsystem = device.value()->subsystems.get((subvendor_id << 16) + subdevice_id);
+ auto const& subsystem = device.value()->subsystems.get((subvendor_id << 16) + subdevice_id);
if (!subsystem.has_value())
return "";
return subsystem.value()->name;
@@ -58,7 +58,7 @@ const StringView Database::get_subsystem(u16 vendor_id, u16 device_id, u16 subve
const StringView Database::get_class(u8 class_id) const
{
- const auto& xclass = m_classes.get(class_id);
+ auto const& xclass = m_classes.get(class_id);
if (!xclass.has_value())
return "";
return xclass.value()->name;
@@ -66,10 +66,10 @@ const StringView Database::get_class(u8 class_id) const
const StringView Database::get_subclass(u8 class_id, u8 subclass_id) const
{
- const auto& xclass = m_classes.get(class_id);
+ auto const& xclass = m_classes.get(class_id);
if (!xclass.has_value())
return "";
- const auto& subclass = xclass.value()->subclasses.get(subclass_id);
+ auto const& subclass = xclass.value()->subclasses.get(subclass_id);
if (!subclass.has_value())
return "";
return subclass.value()->name;
@@ -77,13 +77,13 @@ const StringView Database::get_subclass(u8 class_id, u8 subclass_id) const
const StringView Database::get_programming_interface(u8 class_id, u8 subclass_id, u8 programming_interface_id) const
{
- const auto& xclass = m_classes.get(class_id);
+ auto const& xclass = m_classes.get(class_id);
if (!xclass.has_value())
return "";
- const auto& subclass = xclass.value()->subclasses.get(subclass_id);
+ auto const& subclass = xclass.value()->subclasses.get(subclass_id);
if (!subclass.has_value())
return "";
- const auto& programming_interface = subclass.value()->programming_interfaces.get(programming_interface_id);
+ auto const& programming_interface = subclass.value()->programming_interfaces.get(programming_interface_id);
if (!programming_interface.has_value())
return "";
return programming_interface.value()->name;
diff --git a/Userland/Libraries/LibPCIDB/Database.h b/Userland/Libraries/LibPCIDB/Database.h
index 7577f55898..2145a2dbfa 100644
--- a/Userland/Libraries/LibPCIDB/Database.h
+++ b/Userland/Libraries/LibPCIDB/Database.h
@@ -53,7 +53,7 @@ struct Class {
class Database : public RefCounted<Database> {
public:
- static RefPtr<Database> open(const String& filename);
+ static RefPtr<Database> open(String const& filename);
static RefPtr<Database> open() { return open("/res/pci.ids"); };
const StringView get_vendor(u16 vendor_id) const;
diff --git a/Userland/Libraries/LibPDF/Filter.cpp b/Userland/Libraries/LibPDF/Filter.cpp
index c6c93d781c..5d7da106b4 100644
--- a/Userland/Libraries/LibPDF/Filter.cpp
+++ b/Userland/Libraries/LibPDF/Filter.cpp
@@ -47,11 +47,11 @@ ErrorOr<ByteBuffer> Filter::decode_ascii_hex(ReadonlyBytes bytes)
auto output = TRY(ByteBuffer::create_zeroed(bytes.size() / 2 + 1));
for (size_t i = 0; i < bytes.size() / 2; ++i) {
- const auto c1 = decode_hex_digit(static_cast<char>(bytes[i * 2]));
+ auto const c1 = decode_hex_digit(static_cast<char>(bytes[i * 2]));
if (c1 >= 16)
return Error::from_string_literal("Hex string contains invalid digit");
- const auto c2 = decode_hex_digit(static_cast<char>(bytes[i * 2 + 1]));
+ auto const c2 = decode_hex_digit(static_cast<char>(bytes[i * 2 + 1]));
if (c2 >= 16)
return Error::from_string_literal("Hex string contains invalid digit");
diff --git a/Userland/Libraries/LibPDF/Object.h b/Userland/Libraries/LibPDF/Object.h
index 71b6bb9a4c..b1ff82d0b3 100644
--- a/Userland/Libraries/LibPDF/Object.h
+++ b/Userland/Libraries/LibPDF/Object.h
@@ -19,7 +19,7 @@
namespace {
template<PDF::IsObject T>
-const char* object_name()
+char const* object_name()
{
# define ENUMERATE_TYPE(class_name, snake_name) \
if constexpr (IsSame<PDF::class_name, T>) { \
@@ -73,7 +73,7 @@ public:
return NonnullRefPtr<T>(static_cast<T const&>(*this));
}
- virtual const char* type_name() const = 0;
+ virtual char const* type_name() const = 0;
virtual String to_string(int indent) const = 0;
protected:
diff --git a/Userland/Libraries/LibPDF/ObjectDerivatives.h b/Userland/Libraries/LibPDF/ObjectDerivatives.h
index 769d0c2d40..c719ef2f27 100644
--- a/Userland/Libraries/LibPDF/ObjectDerivatives.h
+++ b/Userland/Libraries/LibPDF/ObjectDerivatives.h
@@ -31,7 +31,7 @@ public:
[[nodiscard]] ALWAYS_INLINE bool is_binary() const { return m_is_binary; }
void set_string(String string) { m_string = move(string); }
- const char* type_name() const override { return "string"; }
+ char const* type_name() const override { return "string"; }
String to_string(int indent) const override;
protected:
@@ -53,7 +53,7 @@ public:
[[nodiscard]] ALWAYS_INLINE FlyString const& name() const { return m_name; }
- const char* type_name() const override { return "name"; }
+ char const* type_name() const override { return "name"; }
String to_string(int indent) const override;
protected:
@@ -86,7 +86,7 @@ public:
ENUMERATE_OBJECT_TYPES(DEFINE_INDEXER)
#undef DEFINE_INDEXER
- const char* type_name() const override
+ char const* type_name() const override
{
return "array";
}
@@ -129,7 +129,7 @@ public:
ENUMERATE_OBJECT_TYPES(DEFINE_GETTER)
#undef DEFINE_GETTER
- const char* type_name() const override
+ char const* type_name() const override
{
return "dict";
}
@@ -156,7 +156,7 @@ public:
[[nodiscard]] ReadonlyBytes bytes() const { return m_buffer.bytes(); };
[[nodiscard]] ByteBuffer& buffer() { return m_buffer; };
- const char* type_name() const override { return "stream"; }
+ char const* type_name() const override { return "stream"; }
String to_string(int indent) const override;
private:
@@ -180,7 +180,7 @@ public:
[[nodiscard]] ALWAYS_INLINE u32 index() const { return m_index; }
[[nodiscard]] ALWAYS_INLINE Value const& value() const { return m_value; }
- const char* type_name() const override { return "indirect_object"; }
+ char const* type_name() const override { return "indirect_object"; }
String to_string(int indent) const override;
protected:
diff --git a/Userland/Libraries/LibPDF/Operator.h b/Userland/Libraries/LibPDF/Operator.h
index 88ee18991c..89e66b8690 100644
--- a/Userland/Libraries/LibPDF/Operator.h
+++ b/Userland/Libraries/LibPDF/Operator.h
@@ -114,7 +114,7 @@ public:
VERIFY_NOT_REACHED();
}
- static const char* operator_name(OperatorType operator_type)
+ static char const* operator_name(OperatorType operator_type)
{
#define V(name, snake_name, symbol) \
if (operator_type == OperatorType::name) \
@@ -130,7 +130,7 @@ public:
VERIFY_NOT_REACHED();
}
- static const char* operator_symbol(OperatorType operator_type)
+ static char const* operator_symbol(OperatorType operator_type)
{
#define V(name, snake_name, symbol) \
if (operator_type == OperatorType::name) \
diff --git a/Userland/Libraries/LibPDF/Parser.cpp b/Userland/Libraries/LibPDF/Parser.cpp
index 00be30bb34..81988d3191 100644
--- a/Userland/Libraries/LibPDF/Parser.cpp
+++ b/Userland/Libraries/LibPDF/Parser.cpp
@@ -49,7 +49,7 @@ PDFErrorOr<void> Parser::initialize()
{
TRY(parse_header());
- const auto linearization_result = TRY(initialize_linearization_dict());
+ auto const linearization_result = TRY(initialize_linearization_dict());
if (linearization_result == LinearizationResult::NotLinearized)
return initialize_non_linearized_xref_table();
diff --git a/Userland/Libraries/LibPDF/Reader.h b/Userland/Libraries/LibPDF/Reader.h
index d9ae301ac8..862decb8e1 100644
--- a/Userland/Libraries/LibPDF/Reader.h
+++ b/Userland/Libraries/LibPDF/Reader.h
@@ -79,7 +79,7 @@ public:
return !done() && peek() == ch;
}
- bool matches(const char* chars) const
+ bool matches(char const* chars) const
{
String string(chars);
if (remaining() < string.length())
diff --git a/Userland/Libraries/LibProtocol/Request.cpp b/Userland/Libraries/LibProtocol/Request.cpp
index ccbb3d6e29..484b5a7142 100644
--- a/Userland/Libraries/LibProtocol/Request.cpp
+++ b/Userland/Libraries/LibProtocol/Request.cpp
@@ -128,7 +128,7 @@ void Request::did_progress(Badge<RequestClient>, Optional<u32> total_size, u32 d
on_progress(total_size, downloaded_size);
}
-void Request::did_receive_headers(Badge<RequestClient>, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> response_code)
+void Request::did_receive_headers(Badge<RequestClient>, HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers, Optional<u32> response_code)
{
if (on_headers_received)
on_headers_received(response_headers, response_code);
diff --git a/Userland/Libraries/LibProtocol/Request.h b/Userland/Libraries/LibProtocol/Request.h
index b649a208ae..f004935175 100644
--- a/Userland/Libraries/LibProtocol/Request.h
+++ b/Userland/Libraries/LibProtocol/Request.h
@@ -46,15 +46,15 @@ public:
void set_should_buffer_all_input(bool);
/// Note: Must be set before `set_should_buffer_all_input(true)`.
- Function<void(bool success, u32 total_size, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> response_code, ReadonlyBytes payload)> on_buffered_request_finish;
+ Function<void(bool success, u32 total_size, HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers, Optional<u32> response_code, ReadonlyBytes payload)> on_buffered_request_finish;
Function<void(bool success, u32 total_size)> on_finish;
Function<void(Optional<u32> total_size, u32 downloaded_size)> on_progress;
- Function<void(const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> response_code)> on_headers_received;
+ Function<void(HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers, Optional<u32> response_code)> on_headers_received;
Function<CertificateAndKey()> on_certificate_requested;
void did_finish(Badge<RequestClient>, bool success, u32 total_size);
void did_progress(Badge<RequestClient>, Optional<u32> total_size, u32 downloaded_size);
- void did_receive_headers(Badge<RequestClient>, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> response_code);
+ void did_receive_headers(Badge<RequestClient>, HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers, Optional<u32> response_code);
void did_request_certificates(Badge<RequestClient>);
RefPtr<Core::Notifier>& write_notifier(Badge<RequestClient>) { return m_write_notifier; }
diff --git a/Userland/Libraries/LibProtocol/WebSocketClient.cpp b/Userland/Libraries/LibProtocol/WebSocketClient.cpp
index 43dccd76c2..5c84919bfc 100644
--- a/Userland/Libraries/LibProtocol/WebSocketClient.cpp
+++ b/Userland/Libraries/LibProtocol/WebSocketClient.cpp
@@ -14,7 +14,7 @@ WebSocketClient::WebSocketClient(NonnullOwnPtr<Core::Stream::LocalSocket> socket
{
}
-RefPtr<WebSocket> WebSocketClient::connect(const URL& url, const String& origin, const Vector<String>& protocols, const Vector<String>& extensions, const HashMap<String, String>& request_headers)
+RefPtr<WebSocket> WebSocketClient::connect(const URL& url, String const& origin, Vector<String> const& protocols, Vector<String> const& extensions, HashMap<String, String> const& request_headers)
{
IPC::Dictionary header_dictionary;
for (auto& it : request_headers)
diff --git a/Userland/Libraries/LibProtocol/WebSocketClient.h b/Userland/Libraries/LibProtocol/WebSocketClient.h
index 37226c4275..f802c73597 100644
--- a/Userland/Libraries/LibProtocol/WebSocketClient.h
+++ b/Userland/Libraries/LibProtocol/WebSocketClient.h
@@ -21,7 +21,7 @@ class WebSocketClient final
IPC_CLIENT_CONNECTION(WebSocketClient, "/tmp/portal/websocket")
public:
- RefPtr<WebSocket> connect(const URL&, const String& origin = {}, const Vector<String>& protocols = {}, const Vector<String>& extensions = {}, const HashMap<String, String>& request_headers = {});
+ RefPtr<WebSocket> connect(const URL&, String const& origin = {}, Vector<String> const& protocols = {}, Vector<String> const& extensions = {}, HashMap<String, String> const& request_headers = {});
u32 ready_state(Badge<WebSocket>, WebSocket&);
void send(Badge<WebSocket>, WebSocket&, ByteBuffer, bool is_text);
diff --git a/Userland/Libraries/LibPthread/pthread.cpp b/Userland/Libraries/LibPthread/pthread.cpp
index 38997a8139..ea1b5b3227 100644
--- a/Userland/Libraries/LibPthread/pthread.cpp
+++ b/Userland/Libraries/LibPthread/pthread.cpp
@@ -176,7 +176,7 @@ int pthread_detach(pthread_t thread)
}
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_sigmask.html
-int pthread_sigmask(int how, const sigset_t* set, sigset_t* old_set)
+int pthread_sigmask(int how, sigset_t const* set, sigset_t* old_set)
{
if (sigprocmask(how, set, old_set))
return errno;
@@ -184,7 +184,7 @@ int pthread_sigmask(int how, const sigset_t* set, sigset_t* old_set)
}
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_mutex_init.html
-int pthread_mutex_init(pthread_mutex_t* mutex, const pthread_mutexattr_t* attributes)
+int pthread_mutex_init(pthread_mutex_t* mutex, pthread_mutexattr_t const* attributes)
{
return __pthread_mutex_init(mutex, attributes);
}
@@ -269,9 +269,9 @@ int pthread_attr_destroy(pthread_attr_t* attributes)
}
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getdetachstate.html
-int pthread_attr_getdetachstate(const pthread_attr_t* attributes, int* p_detach_state)
+int pthread_attr_getdetachstate(pthread_attr_t const* attributes, int* p_detach_state)
{
- auto* attributes_impl = *(reinterpret_cast<const PthreadAttrImpl* const*>(attributes));
+ auto* attributes_impl = *(reinterpret_cast<PthreadAttrImpl const* const*>(attributes));
if (!attributes_impl || !p_detach_state)
return EINVAL;
@@ -305,9 +305,9 @@ int pthread_attr_setdetachstate(pthread_attr_t* attributes, int detach_state)
}
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getguardsize.html
-int pthread_attr_getguardsize(const pthread_attr_t* attributes, size_t* p_guard_size)
+int pthread_attr_getguardsize(pthread_attr_t const* attributes, size_t* p_guard_size)
{
- auto* attributes_impl = *(reinterpret_cast<const PthreadAttrImpl* const*>(attributes));
+ auto* attributes_impl = *(reinterpret_cast<PthreadAttrImpl const* const*>(attributes));
if (!attributes_impl || !p_guard_size)
return EINVAL;
@@ -349,9 +349,9 @@ int pthread_attr_setguardsize(pthread_attr_t* attributes, size_t guard_size)
}
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getschedparam.html
-int pthread_attr_getschedparam(const pthread_attr_t* attributes, struct sched_param* p_sched_param)
+int pthread_attr_getschedparam(pthread_attr_t const* attributes, struct sched_param* p_sched_param)
{
- auto* attributes_impl = *(reinterpret_cast<const PthreadAttrImpl* const*>(attributes));
+ auto* attributes_impl = *(reinterpret_cast<PthreadAttrImpl const* const*>(attributes));
if (!attributes_impl || !p_sched_param)
return EINVAL;
@@ -384,9 +384,9 @@ int pthread_attr_setschedparam(pthread_attr_t* attributes, const struct sched_pa
}
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getstack.html
-int pthread_attr_getstack(const pthread_attr_t* attributes, void** p_stack_ptr, size_t* p_stack_size)
+int pthread_attr_getstack(pthread_attr_t const* attributes, void** p_stack_ptr, size_t* p_stack_size)
{
- auto* attributes_impl = *(reinterpret_cast<const PthreadAttrImpl* const*>(attributes));
+ auto* attributes_impl = *(reinterpret_cast<PthreadAttrImpl const* const*>(attributes));
if (!attributes_impl || !p_stack_ptr || !p_stack_size)
return EINVAL;
@@ -429,9 +429,9 @@ int pthread_attr_setstack(pthread_attr_t* attributes, void* p_stack, size_t stac
}
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getstacksize.html
-int pthread_attr_getstacksize(const pthread_attr_t* attributes, size_t* p_stack_size)
+int pthread_attr_getstacksize(pthread_attr_t const* attributes, size_t* p_stack_size)
{
- auto* attributes_impl = *(reinterpret_cast<const PthreadAttrImpl* const*>(attributes));
+ auto* attributes_impl = *(reinterpret_cast<PthreadAttrImpl const* const*>(attributes));
if (!attributes_impl || !p_stack_size)
return EINVAL;
@@ -465,7 +465,7 @@ int pthread_attr_setstacksize(pthread_attr_t* attributes, size_t stack_size)
}
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getscope.html
-int pthread_attr_getscope([[maybe_unused]] const pthread_attr_t* attributes, [[maybe_unused]] int* contention_scope)
+int pthread_attr_getscope([[maybe_unused]] pthread_attr_t const* attributes, [[maybe_unused]] int* contention_scope)
{
return 0;
}
@@ -514,12 +514,12 @@ void* pthread_getspecific(pthread_key_t key)
}
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_setspecific.html
-int pthread_setspecific(pthread_key_t key, const void* value)
+int pthread_setspecific(pthread_key_t key, void const* value)
{
return __pthread_setspecific(key, value);
}
-int pthread_setname_np(pthread_t thread, const char* name)
+int pthread_setname_np(pthread_t thread, char const* name)
{
if (!name)
return EFAULT;
@@ -577,7 +577,7 @@ int pthread_spin_init(pthread_spinlock_t* lock, [[maybe_unused]] int shared)
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_spin_lock.html
int pthread_spin_lock(pthread_spinlock_t* lock)
{
- const auto desired = gettid();
+ auto const desired = gettid();
while (true) {
auto current = AK::atomic_load(&lock->m_lock);
@@ -647,7 +647,7 @@ constexpr static u32 writer_wake_mask = 1 << 31;
constexpr static u32 writer_locked_mask = 1 << 17;
constexpr static u32 writer_intent_mask = 1 << 16;
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_rwlock_init.html
-int pthread_rwlock_init(pthread_rwlock_t* __restrict lockp, const pthread_rwlockattr_t* __restrict attr)
+int pthread_rwlock_init(pthread_rwlock_t* __restrict lockp, pthread_rwlockattr_t const* __restrict attr)
{
// Just ignore the attributes. use defaults for now.
(void)attr;
@@ -868,7 +868,7 @@ int pthread_rwlockattr_destroy(pthread_rwlockattr_t*)
}
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_rwlockattr_getpshared.html
-int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t* __restrict, int* __restrict)
+int pthread_rwlockattr_getpshared(pthread_rwlockattr_t const* __restrict, int* __restrict)
{
VERIFY_NOT_REACHED();
}
diff --git a/Userland/Libraries/LibPthread/pthread.h b/Userland/Libraries/LibPthread/pthread.h
index 009ca6bd65..6260cd5454 100644
--- a/Userland/Libraries/LibPthread/pthread.h
+++ b/Userland/Libraries/LibPthread/pthread.h
@@ -24,7 +24,7 @@ int pthread_join(pthread_t, void**);
int pthread_mutex_lock(pthread_mutex_t*);
int pthread_mutex_trylock(pthread_mutex_t* mutex);
int pthread_mutex_unlock(pthread_mutex_t*);
-int pthread_mutex_init(pthread_mutex_t*, const pthread_mutexattr_t*);
+int pthread_mutex_init(pthread_mutex_t*, pthread_mutexattr_t const*);
int pthread_mutex_destroy(pthread_mutex_t*);
int pthread_attr_init(pthread_attr_t*);
@@ -35,31 +35,31 @@ int pthread_attr_destroy(pthread_attr_t*);
#define PTHREAD_CANCELED (-1)
-int pthread_attr_getdetachstate(const pthread_attr_t*, int*);
+int pthread_attr_getdetachstate(pthread_attr_t const*, int*);
int pthread_attr_setdetachstate(pthread_attr_t*, int);
-int pthread_attr_getguardsize(const pthread_attr_t*, size_t*);
+int pthread_attr_getguardsize(pthread_attr_t const*, size_t*);
int pthread_attr_setguardsize(pthread_attr_t*, size_t);
-int pthread_attr_getschedparam(const pthread_attr_t*, struct sched_param*);
+int pthread_attr_getschedparam(pthread_attr_t const*, struct sched_param*);
int pthread_attr_setschedparam(pthread_attr_t*, const struct sched_param*);
-int pthread_attr_getstack(const pthread_attr_t*, void**, size_t*);
+int pthread_attr_getstack(pthread_attr_t const*, void**, size_t*);
int pthread_attr_setstack(pthread_attr_t* attr, void*, size_t);
-int pthread_attr_getstacksize(const pthread_attr_t*, size_t*);
+int pthread_attr_getstacksize(pthread_attr_t const*, size_t*);
int pthread_attr_setstacksize(pthread_attr_t*, size_t);
#define PTHREAD_SCOPE_SYSTEM 0
#define PTHREAD_SCOPE_PROCESS 1
-int pthread_attr_getscope(const pthread_attr_t*, int*);
+int pthread_attr_getscope(pthread_attr_t const*, int*);
int pthread_attr_setscope(pthread_attr_t*, int);
int pthread_once(pthread_once_t*, void (*)(void));
#define PTHREAD_ONCE_INIT 0
void* pthread_getspecific(pthread_key_t key);
-int pthread_setspecific(pthread_key_t key, const void* value);
+int pthread_setspecific(pthread_key_t key, void const* value);
int pthread_getschedparam(pthread_t thread, int* policy, struct sched_param* param);
int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param* param);
@@ -88,7 +88,7 @@ int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param
int pthread_key_create(pthread_key_t* key, void (*destructor)(void*));
int pthread_key_delete(pthread_key_t key);
int pthread_cond_broadcast(pthread_cond_t*);
-int pthread_cond_init(pthread_cond_t*, const pthread_condattr_t*);
+int pthread_cond_init(pthread_cond_t*, pthread_condattr_t const*);
int pthread_cond_signal(pthread_cond_t*);
int pthread_cond_wait(pthread_cond_t*, pthread_mutex_t*);
int pthread_condattr_init(pthread_condattr_t*);
@@ -122,13 +122,13 @@ int pthread_mutexattr_settype(pthread_mutexattr_t*, int);
int pthread_mutexattr_gettype(pthread_mutexattr_t*, int*);
int pthread_mutexattr_destroy(pthread_mutexattr_t*);
-int pthread_setname_np(pthread_t, const char*);
+int pthread_setname_np(pthread_t, char const*);
int pthread_getname_np(pthread_t, char*, size_t);
int pthread_equal(pthread_t t1, pthread_t t2);
int pthread_rwlock_destroy(pthread_rwlock_t*);
-int pthread_rwlock_init(pthread_rwlock_t* __restrict, const pthread_rwlockattr_t* __restrict);
+int pthread_rwlock_init(pthread_rwlock_t* __restrict, pthread_rwlockattr_t const* __restrict);
int pthread_rwlock_rdlock(pthread_rwlock_t*);
int pthread_rwlock_timedrdlock(pthread_rwlock_t* __restrict, const struct timespec* __restrict);
int pthread_rwlock_timedwrlock(pthread_rwlock_t* __restrict, const struct timespec* __restrict);
@@ -137,7 +137,7 @@ int pthread_rwlock_trywrlock(pthread_rwlock_t*);
int pthread_rwlock_unlock(pthread_rwlock_t*);
int pthread_rwlock_wrlock(pthread_rwlock_t*);
int pthread_rwlockattr_destroy(pthread_rwlockattr_t*);
-int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t* __restrict, int* __restrict);
+int pthread_rwlockattr_getpshared(pthread_rwlockattr_t const* __restrict, int* __restrict);
int pthread_rwlockattr_init(pthread_rwlockattr_t*);
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t*, int);
diff --git a/Userland/Libraries/LibPthread/pthread_cond.cpp b/Userland/Libraries/LibPthread/pthread_cond.cpp
index f63978c988..5ba15c368e 100644
--- a/Userland/Libraries/LibPthread/pthread_cond.cpp
+++ b/Userland/Libraries/LibPthread/pthread_cond.cpp
@@ -64,7 +64,7 @@ static constexpr u32 NEED_TO_WAKE_ALL = 2;
static constexpr u32 INCREMENT = 4;
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_init.html
-int pthread_cond_init(pthread_cond_t* cond, const pthread_condattr_t* attr)
+int pthread_cond_init(pthread_cond_t* cond, pthread_condattr_t const* attr)
{
cond->mutex = nullptr;
cond->value = 0;
diff --git a/Userland/Libraries/LibPthread/semaphore.cpp b/Userland/Libraries/LibPthread/semaphore.cpp
index 380355fffe..81564b1422 100644
--- a/Userland/Libraries/LibPthread/semaphore.cpp
+++ b/Userland/Libraries/LibPthread/semaphore.cpp
@@ -17,7 +17,7 @@
static constexpr u32 POST_WAKES = 1 << 31;
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_open.html
-sem_t* sem_open(const char*, int, ...)
+sem_t* sem_open(char const*, int, ...)
{
errno = ENOSYS;
return nullptr;
@@ -31,7 +31,7 @@ int sem_close(sem_t*)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_unlink.html
-int sem_unlink(const char*)
+int sem_unlink(char const*)
{
errno = ENOSYS;
return -1;
diff --git a/Userland/Libraries/LibPthread/semaphore.h b/Userland/Libraries/LibPthread/semaphore.h
index afcbe11283..d04c22943e 100644
--- a/Userland/Libraries/LibPthread/semaphore.h
+++ b/Userland/Libraries/LibPthread/semaphore.h
@@ -21,10 +21,10 @@ int sem_close(sem_t*);
int sem_destroy(sem_t*);
int sem_getvalue(sem_t*, int*);
int sem_init(sem_t*, int, unsigned int);
-sem_t* sem_open(const char*, int, ...);
+sem_t* sem_open(char const*, int, ...);
int sem_post(sem_t*);
int sem_trywait(sem_t*);
-int sem_unlink(const char*);
+int sem_unlink(char const*);
int sem_wait(sem_t*);
int sem_timedwait(sem_t*, const struct timespec* abstime);
diff --git a/Userland/Libraries/LibRegex/C/Regex.cpp b/Userland/Libraries/LibRegex/C/Regex.cpp
index 14affd613c..a3b9abcc75 100644
--- a/Userland/Libraries/LibRegex/C/Regex.cpp
+++ b/Userland/Libraries/LibRegex/C/Regex.cpp
@@ -36,14 +36,14 @@ static internal_regex_t* impl_from(regex_t* re)
return reinterpret_cast<internal_regex_t*>(re->__data);
}
-static const internal_regex_t* impl_from(const regex_t* re)
+static internal_regex_t const* impl_from(regex_t const* re)
{
return impl_from(const_cast<regex_t*>(re));
}
extern "C" {
-int regcomp(regex_t* reg, const char* pattern, int cflags)
+int regcomp(regex_t* reg, char const* pattern, int cflags)
{
if (!reg)
return REG_ESPACE;
@@ -80,7 +80,7 @@ int regcomp(regex_t* reg, const char* pattern, int cflags)
return REG_NOERR;
}
-int regexec(const regex_t* reg, const char* string, size_t nmatch, regmatch_t pmatch[], int eflags)
+int regexec(regex_t const* reg, char const* string, size_t nmatch, regmatch_t pmatch[], int eflags)
{
auto const* preg = impl_from(reg);
@@ -210,7 +210,7 @@ inline static String get_error(ReError errcode)
return error;
}
-size_t regerror(int errcode, const regex_t* reg, char* errbuf, size_t errbuf_size)
+size_t regerror(int errcode, regex_t const* reg, char* errbuf, size_t errbuf_size)
{
String error;
auto const* preg = impl_from(reg);
diff --git a/Userland/Libraries/LibSQL/AST/AST.h b/Userland/Libraries/LibSQL/AST/AST.h
index cf58e78f13..d9e242e97c 100644
--- a/Userland/Libraries/LibSQL/AST/AST.h
+++ b/Userland/Libraries/LibSQL/AST/AST.h
@@ -62,8 +62,8 @@ public:
VERIFY(m_signed_numbers.size() <= 2);
}
- const String& name() const { return m_name; }
- const NonnullRefPtrVector<SignedNumber>& signed_numbers() const { return m_signed_numbers; }
+ String const& name() const { return m_name; }
+ NonnullRefPtrVector<SignedNumber> const& signed_numbers() const { return m_signed_numbers; }
private:
String m_name;
@@ -78,8 +78,8 @@ public:
{
}
- const String& name() const { return m_name; }
- const NonnullRefPtr<TypeName>& type_name() const { return m_type_name; }
+ String const& name() const { return m_name; }
+ NonnullRefPtr<TypeName> const& type_name() const { return m_type_name; }
private:
String m_name;
@@ -95,9 +95,9 @@ public:
{
}
- const String& table_name() const { return m_table_name; }
- const Vector<String>& column_names() const { return m_column_names; }
- const NonnullRefPtr<Select>& select_statement() const { return m_select_statement; }
+ String const& table_name() const { return m_table_name; }
+ Vector<String> const& column_names() const { return m_column_names; }
+ NonnullRefPtr<Select> const& select_statement() const { return m_select_statement; }
private:
String m_table_name;
@@ -115,7 +115,7 @@ public:
}
bool recursive() const { return m_recursive; }
- const NonnullRefPtrVector<CommonTableExpression>& common_table_expressions() const { return m_common_table_expressions; }
+ NonnullRefPtrVector<CommonTableExpression> const& common_table_expressions() const { return m_common_table_expressions; }
private:
bool m_recursive;
@@ -131,9 +131,9 @@ public:
{
}
- const String& schema_name() const { return m_schema_name; }
- const String& table_name() const { return m_table_name; }
- const String& alias() const { return m_alias; }
+ String const& schema_name() const { return m_schema_name; }
+ String const& table_name() const { return m_table_name; }
+ String const& alias() const { return m_alias; }
private:
String m_schema_name;
@@ -156,7 +156,7 @@ public:
}
bool return_all_columns() const { return m_columns.is_empty(); };
- const Vector<ColumnClause>& columns() const { return m_columns; }
+ Vector<ColumnClause> const& columns() const { return m_columns; }
private:
Vector<ColumnClause> m_columns;
@@ -188,11 +188,11 @@ public:
ResultType type() const { return m_type; }
bool select_from_table() const { return !m_table_name.is_null(); }
- const String& table_name() const { return m_table_name; }
+ String const& table_name() const { return m_table_name; }
bool select_from_expression() const { return !m_expression.is_null(); }
- const RefPtr<Expression>& expression() const { return m_expression; }
- const String& column_alias() const { return m_column_alias; }
+ RefPtr<Expression> const& expression() const { return m_expression; }
+ String const& column_alias() const { return m_column_alias; }
private:
ResultType m_type { ResultType::All };
@@ -212,8 +212,8 @@ public:
VERIFY(!m_group_by_list.is_empty());
}
- const NonnullRefPtrVector<Expression>& group_by_list() const { return m_group_by_list; }
- const RefPtr<Expression>& having_clause() const { return m_having_clause; }
+ NonnullRefPtrVector<Expression> const& group_by_list() const { return m_group_by_list; }
+ RefPtr<Expression> const& having_clause() const { return m_having_clause; }
private:
NonnullRefPtrVector<Expression> m_group_by_list;
@@ -239,12 +239,12 @@ public:
}
bool is_table() const { return m_is_table; }
- const String& schema_name() const { return m_schema_name; }
- const String& table_name() const { return m_table_name; }
- const String& table_alias() const { return m_table_alias; }
+ String const& schema_name() const { return m_schema_name; }
+ String const& table_name() const { return m_table_name; }
+ String const& table_alias() const { return m_table_alias; }
bool is_subquery() const { return m_is_subquery; }
- const NonnullRefPtrVector<TableOrSubquery>& subqueries() const { return m_subqueries; }
+ NonnullRefPtrVector<TableOrSubquery> const& subqueries() const { return m_subqueries; }
private:
bool m_is_table { false };
@@ -266,8 +266,8 @@ public:
{
}
- const NonnullRefPtr<Expression>& expression() const { return m_expression; }
- const String& collation_name() const { return m_collation_name; }
+ NonnullRefPtr<Expression> const& expression() const { return m_expression; }
+ String const& collation_name() const { return m_collation_name; }
Order order() const { return m_order; }
Nulls nulls() const { return m_nulls; }
@@ -286,8 +286,8 @@ public:
{
}
- const NonnullRefPtr<Expression>& limit_expression() const { return m_limit_expression; }
- const RefPtr<Expression>& offset_expression() const { return m_offset_expression; }
+ NonnullRefPtr<Expression> const& limit_expression() const { return m_limit_expression; }
+ RefPtr<Expression> const& offset_expression() const { return m_offset_expression; }
private:
NonnullRefPtr<Expression> m_limit_expression;
@@ -336,7 +336,7 @@ public:
{
}
- const String& value() const { return m_value; }
+ String const& value() const { return m_value; }
virtual ResultOr<Value> evaluate(ExecutionContext&) const override;
private:
@@ -350,7 +350,7 @@ public:
{
}
- const String& value() const { return m_value; }
+ String const& value() const { return m_value; }
private:
String m_value;
@@ -363,7 +363,7 @@ public:
class NestedExpression : public Expression {
public:
- const NonnullRefPtr<Expression>& expression() const { return m_expression; }
+ NonnullRefPtr<Expression> const& expression() const { return m_expression; }
virtual ResultOr<Value> evaluate(ExecutionContext&) const override;
protected:
@@ -378,8 +378,8 @@ private:
class NestedDoubleExpression : public Expression {
public:
- const NonnullRefPtr<Expression>& lhs() const { return m_lhs; }
- const NonnullRefPtr<Expression>& rhs() const { return m_rhs; }
+ NonnullRefPtr<Expression> const& lhs() const { return m_lhs; }
+ NonnullRefPtr<Expression> const& rhs() const { return m_rhs; }
protected:
NestedDoubleExpression(NonnullRefPtr<Expression> lhs, NonnullRefPtr<Expression> rhs)
@@ -432,9 +432,9 @@ public:
{
}
- const String& schema_name() const { return m_schema_name; }
- const String& table_name() const { return m_table_name; }
- const String& column_name() const { return m_column_name; }
+ String const& schema_name() const { return m_schema_name; }
+ String const& table_name() const { return m_table_name; }
+ String const& column_name() const { return m_column_name; }
virtual ResultOr<Value> evaluate(ExecutionContext&) const override;
private:
@@ -547,7 +547,7 @@ public:
{
}
- const NonnullRefPtrVector<Expression>& expressions() const { return m_expressions; }
+ NonnullRefPtrVector<Expression> const& expressions() const { return m_expressions; }
virtual ResultOr<Value> evaluate(ExecutionContext&) const override;
private:
@@ -562,7 +562,7 @@ public:
{
}
- const NonnullRefPtr<TypeName>& type_name() const { return m_type_name; }
+ NonnullRefPtr<TypeName> const& type_name() const { return m_type_name; }
private:
NonnullRefPtr<TypeName> m_type_name;
@@ -583,9 +583,9 @@ public:
VERIFY(!m_when_then_clauses.is_empty());
}
- const RefPtr<Expression>& case_expression() const { return m_case_expression; }
- const Vector<WhenThenClause>& when_then_clauses() const { return m_when_then_clauses; }
- const RefPtr<Expression>& else_expression() const { return m_else_expression; }
+ RefPtr<Expression> const& case_expression() const { return m_case_expression; }
+ Vector<WhenThenClause> const& when_then_clauses() const { return m_when_then_clauses; }
+ RefPtr<Expression> const& else_expression() const { return m_else_expression; }
private:
RefPtr<Expression> m_case_expression;
@@ -601,7 +601,7 @@ public:
{
}
- const NonnullRefPtr<Select>& select_statement() const { return m_select_statement; }
+ NonnullRefPtr<Select> const& select_statement() const { return m_select_statement; }
bool invert_expression() const { return m_invert_expression; }
private:
@@ -617,7 +617,7 @@ public:
{
}
- const String& collation_name() const { return m_collation_name; }
+ String const& collation_name() const { return m_collation_name; }
private:
String m_collation_name;
@@ -640,7 +640,7 @@ public:
}
MatchOperator type() const { return m_type; }
- const RefPtr<Expression>& escape() const { return m_escape; }
+ RefPtr<Expression> const& escape() const { return m_escape; }
virtual ResultOr<Value> evaluate(ExecutionContext&) const override;
private:
@@ -672,7 +672,7 @@ public:
{
}
- const NonnullRefPtr<Expression>& expression() const { return m_expression; }
+ NonnullRefPtr<Expression> const& expression() const { return m_expression; }
private:
NonnullRefPtr<Expression> m_expression;
@@ -686,7 +686,7 @@ public:
{
}
- const NonnullRefPtr<Select>& select_statement() const { return m_select_statement; }
+ NonnullRefPtr<Select> const& select_statement() const { return m_select_statement; }
private:
NonnullRefPtr<Select> m_select_statement;
@@ -700,7 +700,7 @@ public:
{
}
- const NonnullRefPtr<ChainedExpression>& expression_chain() const { return m_expression_chain; }
+ NonnullRefPtr<ChainedExpression> const& expression_chain() const { return m_expression_chain; }
private:
NonnullRefPtr<ChainedExpression> m_expression_chain;
@@ -715,8 +715,8 @@ public:
{
}
- const String& schema_name() const { return m_schema_name; }
- const String& table_name() const { return m_table_name; }
+ String const& schema_name() const { return m_schema_name; }
+ String const& table_name() const { return m_table_name; }
private:
String m_schema_name;
@@ -748,7 +748,7 @@ public:
{
}
- const String& schema_name() const { return m_schema_name; }
+ String const& schema_name() const { return m_schema_name; }
bool is_error_if_schema_exists() const { return m_is_error_if_schema_exists; }
ResultOr<ResultSet> execute(ExecutionContext&) const override;
@@ -778,14 +778,14 @@ public:
{
}
- const String& schema_name() const { return m_schema_name; }
- const String& table_name() const { return m_table_name; }
+ String const& schema_name() const { return m_schema_name; }
+ String const& table_name() const { return m_table_name; }
bool has_selection() const { return !m_select_statement.is_null(); }
- const RefPtr<Select>& select_statement() const { return m_select_statement; }
+ RefPtr<Select> const& select_statement() const { return m_select_statement; }
bool has_columns() const { return !m_columns.is_empty(); }
- const NonnullRefPtrVector<ColumnDefinition>& columns() const { return m_columns; }
+ NonnullRefPtrVector<ColumnDefinition> const& columns() const { return m_columns; }
bool is_temporary() const { return m_is_temporary; }
bool is_error_if_table_exists() const { return m_is_error_if_table_exists; }
@@ -803,8 +803,8 @@ private:
class AlterTable : public Statement {
public:
- const String& schema_name() const { return m_schema_name; }
- const String& table_name() const { return m_table_name; }
+ String const& schema_name() const { return m_schema_name; }
+ String const& table_name() const { return m_table_name; }
protected:
AlterTable(String schema_name, String table_name)
@@ -826,7 +826,7 @@ public:
{
}
- const String& new_table_name() const { return m_new_table_name; }
+ String const& new_table_name() const { return m_new_table_name; }
private:
String m_new_table_name;
@@ -841,8 +841,8 @@ public:
{
}
- const String& column_name() const { return m_column_name; }
- const String& new_column_name() const { return m_new_column_name; }
+ String const& column_name() const { return m_column_name; }
+ String const& new_column_name() const { return m_new_column_name; }
private:
String m_column_name;
@@ -857,7 +857,7 @@ public:
{
}
- const NonnullRefPtr<ColumnDefinition>& column() const { return m_column; }
+ NonnullRefPtr<ColumnDefinition> const& column() const { return m_column; }
private:
NonnullRefPtr<ColumnDefinition> m_column;
@@ -871,7 +871,7 @@ public:
{
}
- const String& column_name() const { return m_column_name; }
+ String const& column_name() const { return m_column_name; }
private:
String m_column_name;
@@ -886,8 +886,8 @@ public:
{
}
- const String& schema_name() const { return m_schema_name; }
- const String& table_name() const { return m_table_name; }
+ String const& schema_name() const { return m_schema_name; }
+ String const& table_name() const { return m_table_name; }
bool is_error_if_table_does_not_exist() const { return m_is_error_if_table_does_not_exist; }
private:
@@ -938,20 +938,20 @@ public:
{
}
- const RefPtr<CommonTableExpressionList>& common_table_expression_list() const { return m_common_table_expression_list; }
+ RefPtr<CommonTableExpressionList> const& common_table_expression_list() const { return m_common_table_expression_list; }
ConflictResolution conflict_resolution() const { return m_conflict_resolution; }
- const String& schema_name() const { return m_schema_name; }
- const String& table_name() const { return m_table_name; }
- const String& alias() const { return m_alias; }
- const Vector<String>& column_names() const { return m_column_names; }
+ String const& schema_name() const { return m_schema_name; }
+ String const& table_name() const { return m_table_name; }
+ String const& alias() const { return m_alias; }
+ Vector<String> const& column_names() const { return m_column_names; }
bool default_values() const { return !has_expressions() && !has_selection(); };
bool has_expressions() const { return !m_chained_expressions.is_empty(); }
- const NonnullRefPtrVector<ChainedExpression>& chained_expressions() const { return m_chained_expressions; }
+ NonnullRefPtrVector<ChainedExpression> const& chained_expressions() const { return m_chained_expressions; }
bool has_selection() const { return !m_select_statement.is_null(); }
- const RefPtr<Select>& select_statement() const { return m_select_statement; }
+ RefPtr<Select> const& select_statement() const { return m_select_statement; }
virtual ResultOr<ResultSet> execute(ExecutionContext&) const override;
@@ -984,13 +984,13 @@ public:
{
}
- const RefPtr<CommonTableExpressionList>& common_table_expression_list() const { return m_common_table_expression_list; }
+ RefPtr<CommonTableExpressionList> const& common_table_expression_list() const { return m_common_table_expression_list; }
ConflictResolution conflict_resolution() const { return m_conflict_resolution; }
- const NonnullRefPtr<QualifiedTableName>& qualified_table_name() const { return m_qualified_table_name; }
- const Vector<UpdateColumns>& update_columns() const { return m_update_columns; }
- const NonnullRefPtrVector<TableOrSubquery>& table_or_subquery_list() const { return m_table_or_subquery_list; }
- const RefPtr<Expression>& where_clause() const { return m_where_clause; }
- const RefPtr<ReturningClause>& returning_clause() const { return m_returning_clause; }
+ NonnullRefPtr<QualifiedTableName> const& qualified_table_name() const { return m_qualified_table_name; }
+ Vector<UpdateColumns> const& update_columns() const { return m_update_columns; }
+ NonnullRefPtrVector<TableOrSubquery> const& table_or_subquery_list() const { return m_table_or_subquery_list; }
+ RefPtr<Expression> const& where_clause() const { return m_where_clause; }
+ RefPtr<ReturningClause> const& returning_clause() const { return m_returning_clause; }
private:
RefPtr<CommonTableExpressionList> m_common_table_expression_list;
@@ -1012,10 +1012,10 @@ public:
{
}
- const RefPtr<CommonTableExpressionList>& common_table_expression_list() const { return m_common_table_expression_list; }
- const NonnullRefPtr<QualifiedTableName>& qualified_table_name() const { return m_qualified_table_name; }
- const RefPtr<Expression>& where_clause() const { return m_where_clause; }
- const RefPtr<ReturningClause>& returning_clause() const { return m_returning_clause; }
+ RefPtr<CommonTableExpressionList> const& common_table_expression_list() const { return m_common_table_expression_list; }
+ NonnullRefPtr<QualifiedTableName> const& qualified_table_name() const { return m_qualified_table_name; }
+ RefPtr<Expression> const& where_clause() const { return m_where_clause; }
+ RefPtr<ReturningClause> const& returning_clause() const { return m_returning_clause; }
private:
RefPtr<CommonTableExpressionList> m_common_table_expression_list;
@@ -1038,14 +1038,14 @@ public:
{
}
- const RefPtr<CommonTableExpressionList>& common_table_expression_list() const { return m_common_table_expression_list; }
+ RefPtr<CommonTableExpressionList> const& common_table_expression_list() const { return m_common_table_expression_list; }
bool select_all() const { return m_select_all; }
- const NonnullRefPtrVector<ResultColumn>& result_column_list() const { return m_result_column_list; }
- const NonnullRefPtrVector<TableOrSubquery>& table_or_subquery_list() const { return m_table_or_subquery_list; }
- const RefPtr<Expression>& where_clause() const { return m_where_clause; }
- const RefPtr<GroupByClause>& group_by_clause() const { return m_group_by_clause; }
- const NonnullRefPtrVector<OrderingTerm>& ordering_term_list() const { return m_ordering_term_list; }
- const RefPtr<LimitClause>& limit_clause() const { return m_limit_clause; }
+ NonnullRefPtrVector<ResultColumn> const& result_column_list() const { return m_result_column_list; }
+ NonnullRefPtrVector<TableOrSubquery> const& table_or_subquery_list() const { return m_table_or_subquery_list; }
+ RefPtr<Expression> const& where_clause() const { return m_where_clause; }
+ RefPtr<GroupByClause> const& group_by_clause() const { return m_group_by_clause; }
+ NonnullRefPtrVector<OrderingTerm> const& ordering_term_list() const { return m_ordering_term_list; }
+ RefPtr<LimitClause> const& limit_clause() const { return m_limit_clause; }
ResultOr<ResultSet> execute(ExecutionContext&) const override;
private:
diff --git a/Userland/Libraries/LibSQL/AST/Parser.cpp b/Userland/Libraries/LibSQL/AST/Parser.cpp
index b081183729..94ed6f55e3 100644
--- a/Userland/Libraries/LibSQL/AST/Parser.cpp
+++ b/Userland/Libraries/LibSQL/AST/Parser.cpp
@@ -809,7 +809,7 @@ RefPtr<Expression> Parser::parse_between_expression(NonnullRefPtr<Expression> ex
return create_ast_node<ErrorExpression>();
}
- const auto& binary_expression = static_cast<const BinaryOperatorExpression&>(*nested);
+ auto const& binary_expression = static_cast<BinaryOperatorExpression const&>(*nested);
if (binary_expression.type() != BinaryOperator::And) {
expected("AND Expression");
return create_ast_node<ErrorExpression>();
@@ -1030,7 +1030,7 @@ NonnullRefPtr<OrderingTerm> Parser::parse_ordering_term()
String collation_name;
if (is<CollateExpression>(*expression)) {
- const auto& collate = static_cast<const CollateExpression&>(*expression);
+ auto const& collate = static_cast<CollateExpression const&>(*expression);
collation_name = collate.collation_name();
expression = collate.expression();
} else if (consume_if(TokenType::Collate)) {
diff --git a/Userland/Libraries/LibSQL/AST/Parser.h b/Userland/Libraries/LibSQL/AST/Parser.h
index 6a4db5695d..9d35018d3f 100644
--- a/Userland/Libraries/LibSQL/AST/Parser.h
+++ b/Userland/Libraries/LibSQL/AST/Parser.h
@@ -38,7 +38,7 @@ public:
NonnullRefPtr<Statement> next_statement();
bool has_errors() const { return m_parser_state.m_errors.size(); }
- const Vector<Error>& errors() const { return m_parser_state.m_errors; }
+ Vector<Error> const& errors() const { return m_parser_state.m_errors; }
protected:
NonnullRefPtr<Expression> parse_expression(); // Protected for unit testing.
diff --git a/Userland/Libraries/LibSQL/Meta.cpp b/Userland/Libraries/LibSQL/Meta.cpp
index 5dab68e598..8202c9d9be 100644
--- a/Userland/Libraries/LibSQL/Meta.cpp
+++ b/Userland/Libraries/LibSQL/Meta.cpp
@@ -65,7 +65,7 @@ Key ColumnDef::key() const
return key;
}
-void ColumnDef::set_default_value(const Value& default_value)
+void ColumnDef::set_default_value(Value const& default_value)
{
VERIFY(default_value.type() == type());
m_default = default_value;
diff --git a/Userland/Libraries/LibSQL/Tuple.cpp b/Userland/Libraries/LibSQL/Tuple.cpp
index a25a057cbb..58a96fabe8 100644
--- a/Userland/Libraries/LibSQL/Tuple.cpp
+++ b/Userland/Libraries/LibSQL/Tuple.cpp
@@ -117,7 +117,7 @@ Value& Tuple::operator[](String const& name)
return (*this)[index.value()];
}
-void Tuple::append(const Value& value)
+void Tuple::append(Value const& value)
{
VERIFY(descriptor()->size() >= size());
if (descriptor()->size() == size()) {
@@ -198,7 +198,7 @@ Vector<String> Tuple::to_string_vector() const
return ret;
}
-void Tuple::copy_from(const Tuple& other)
+void Tuple::copy_from(Tuple const& other)
{
if (*m_descriptor != *other.m_descriptor) {
m_descriptor->clear();
@@ -213,7 +213,7 @@ void Tuple::copy_from(const Tuple& other)
m_pointer = other.pointer();
}
-int Tuple::compare(const Tuple& other) const
+int Tuple::compare(Tuple const& other) const
{
auto num_values = min(m_data.size(), other.m_data.size());
VERIFY(num_values > 0);
@@ -228,7 +228,7 @@ int Tuple::compare(const Tuple& other) const
return 0;
}
-int Tuple::match(const Tuple& other) const
+int Tuple::match(Tuple const& other) const
{
auto other_index = 0u;
for (auto& part : *other.descriptor()) {
diff --git a/Userland/Libraries/LibSanitizer/UBSanitizer.cpp b/Userland/Libraries/LibSanitizer/UBSanitizer.cpp
index 7411a34ff6..c86a74d9af 100644
--- a/Userland/Libraries/LibSanitizer/UBSanitizer.cpp
+++ b/Userland/Libraries/LibSanitizer/UBSanitizer.cpp
@@ -17,7 +17,7 @@ Atomic<bool> AK::UBSanitizer::g_ubsan_is_deadly;
extern "C" {
-static void print_location(const SourceLocation& location)
+static void print_location(SourceLocation const& location)
{
if (!location.filename()) {
WARNLN_AND_DBGLN("UBSAN: in unknown file");
@@ -76,8 +76,8 @@ void __ubsan_handle_nullability_arg(NonnullArgData& data)
print_location(location);
}
-void __ubsan_handle_nonnull_return_v1(const NonnullReturnData&, SourceLocation&) __attribute__((used));
-void __ubsan_handle_nonnull_return_v1(const NonnullReturnData&, SourceLocation& location)
+void __ubsan_handle_nonnull_return_v1(NonnullReturnData const&, SourceLocation&) __attribute__((used));
+void __ubsan_handle_nonnull_return_v1(NonnullReturnData const&, SourceLocation& location)
{
auto loc = location.permanently_clear();
if (!loc.needs_logging())
@@ -86,8 +86,8 @@ void __ubsan_handle_nonnull_return_v1(const NonnullReturnData&, SourceLocation&
print_location(loc);
}
-void __ubsan_handle_nullability_return_v1(const NonnullReturnData& data, SourceLocation& location) __attribute__((used));
-void __ubsan_handle_nullability_return_v1(const NonnullReturnData&, SourceLocation& location)
+void __ubsan_handle_nullability_return_v1(NonnullReturnData const& data, SourceLocation& location) __attribute__((used));
+void __ubsan_handle_nullability_return_v1(NonnullReturnData const&, SourceLocation& location)
{
auto loc = location.permanently_clear();
if (!loc.needs_logging())
@@ -258,8 +258,8 @@ void __ubsan_handle_implicit_conversion(ImplicitConversionData& data, ValueHandl
auto location = data.location.permanently_clear();
if (!location.needs_logging())
return;
- const char* src_signed = data.from_type.is_signed() ? "" : "un";
- const char* dst_signed = data.to_type.is_signed() ? "" : "un";
+ char const* src_signed = data.from_type.is_signed() ? "" : "un";
+ char const* dst_signed = data.to_type.is_signed() ? "" : "un";
WARNLN_AND_DBGLN("UBSAN: implicit conversion from type {} ({}-bit, {}signed) to type {} ({}-bit, {}signed)",
data.from_type.name(), data.from_type.bit_width(), src_signed, data.to_type.name(), data.to_type.bit_width(), dst_signed);
print_location(location);
diff --git a/Userland/Libraries/LibSoftGPU/Device.cpp b/Userland/Libraries/LibSoftGPU/Device.cpp
index 3db74a188a..20dc857d1b 100644
--- a/Userland/Libraries/LibSoftGPU/Device.cpp
+++ b/Userland/Libraries/LibSoftGPU/Device.cpp
@@ -44,18 +44,18 @@ using AK::SIMD::to_f32x4;
using AK::SIMD::to_u32x4;
using AK::SIMD::u32x4;
-constexpr static float edge_function(const FloatVector2& a, const FloatVector2& b, const FloatVector2& c)
+constexpr static float edge_function(FloatVector2 const& a, FloatVector2 const& b, FloatVector2 const& c)
{
return (c.x() - a.x()) * (b.y() - a.y()) - (c.y() - a.y()) * (b.x() - a.x());
}
-constexpr static f32x4 edge_function4(const FloatVector2& a, const FloatVector2& b, const Vector2<f32x4>& c)
+constexpr static f32x4 edge_function4(FloatVector2 const& a, FloatVector2 const& b, Vector2<f32x4> const& c)
{
return (c.x() - a.x()) * (b.y() - a.y()) - (c.y() - a.y()) * (b.x() - a.x());
}
template<typename T, typename U>
-constexpr static auto interpolate(const T& v0, const T& v1, const T& v2, const Vector3<U>& barycentric_coords)
+constexpr static auto interpolate(const T& v0, const T& v1, const T& v2, Vector3<U> const& barycentric_coords)
{
return v0 * barycentric_coords.x() + v1 * barycentric_coords.y() + v2 * barycentric_coords.z();
}
@@ -175,7 +175,7 @@ void Device::setup_blend_factors()
}
}
-void Device::rasterize_triangle(const Triangle& triangle)
+void Device::rasterize_triangle(Triangle const& triangle)
{
INCREASE_STATISTICS_COUNTER(g_num_rasterized_triangles, 1);
@@ -1190,7 +1190,7 @@ void Device::draw_statistics_overlay(Gfx::Bitmap& target)
painter.draw_text(target.rect().translated(2, 2), debug_string, font, Gfx::TextAlignment::TopLeft, Gfx::Color::White);
}
-void Device::set_options(const RasterizerOptions& options)
+void Device::set_options(RasterizerOptions const& options)
{
m_options = options;
@@ -1198,7 +1198,7 @@ void Device::set_options(const RasterizerOptions& options)
setup_blend_factors();
}
-void Device::set_light_model_params(const LightModelParameters& lighting_model)
+void Device::set_light_model_params(LightModelParameters const& lighting_model)
{
m_lighting_model = lighting_model;
}
diff --git a/Userland/Libraries/LibSoftGPU/Device.h b/Userland/Libraries/LibSoftGPU/Device.h
index aefc01aa96..86568ec57b 100644
--- a/Userland/Libraries/LibSoftGPU/Device.h
+++ b/Userland/Libraries/LibSoftGPU/Device.h
@@ -111,7 +111,7 @@ struct StencilConfiguration {
class Device final {
public:
- Device(const Gfx::IntSize& min_size);
+ Device(Gfx::IntSize const& min_size);
DeviceInfo info() const;
@@ -123,8 +123,8 @@ public:
void blit_color_buffer_to(Gfx::Bitmap& target);
void blit_to_color_buffer_at_raster_position(Gfx::Bitmap const&);
void blit_to_depth_buffer_at_raster_position(Vector<DepthType> const&, int, int);
- void set_options(const RasterizerOptions&);
- void set_light_model_params(const LightModelParameters&);
+ void set_options(RasterizerOptions const&);
+ void set_light_model_params(LightModelParameters const&);
RasterizerOptions options() const { return m_options; }
LightModelParameters light_model() const { return m_lighting_model; }
ColorType get_color_buffer_pixel(int x, int y);
@@ -145,7 +145,7 @@ private:
void draw_statistics_overlay(Gfx::Bitmap&);
Gfx::IntRect get_rasterization_rect_of_size(Gfx::IntSize size);
- void rasterize_triangle(const Triangle& triangle);
+ void rasterize_triangle(Triangle const& triangle);
void setup_blend_factors();
void shade_fragments(PixelQuad&);
bool test_alpha(PixelQuad&);
diff --git a/Userland/Libraries/LibSymbolication/Symbolication.cpp b/Userland/Libraries/LibSymbolication/Symbolication.cpp
index 42852a0fb6..bef6ca0b2c 100644
--- a/Userland/Libraries/LibSymbolication/Symbolication.cpp
+++ b/Userland/Libraries/LibSymbolication/Symbolication.cpp
@@ -211,7 +211,7 @@ Vector<Symbol> symbolicate_thread(pid_t pid, pid_t tid, IncludeSourcePosition in
bool first_frame = true;
for (auto address : stack) {
- const RegionWithSymbols* found_region = nullptr;
+ RegionWithSymbols const* found_region = nullptr;
for (auto& region : regions) {
FlatPtr region_end;
if (Checked<FlatPtr>::addition_would_overflow(region.base, region.size))
diff --git a/Userland/Libraries/LibSyntax/Highlighter.h b/Userland/Libraries/LibSyntax/Highlighter.h
index 984c52857d..e6a2cc487c 100644
--- a/Userland/Libraries/LibSyntax/Highlighter.h
+++ b/Userland/Libraries/LibSyntax/Highlighter.h
@@ -29,7 +29,7 @@ enum class Language {
struct TextStyle {
const Gfx::Color color;
- const bool bold { false };
+ bool const bold { false };
};
class Highlighter {
@@ -41,7 +41,7 @@ public:
virtual Language language() const = 0;
StringView language_string(Language) const;
- virtual void rehighlight(const Palette&) = 0;
+ virtual void rehighlight(Palette const&) = 0;
virtual void highlight_matching_token_pair();
virtual bool is_identifier(u64) const { return false; };
@@ -125,7 +125,7 @@ public:
private:
virtual Vector<GUI::TextDocumentSpan>& spans() override { return m_spans; }
- virtual const Vector<GUI::TextDocumentSpan>& spans() const override { return m_spans; }
+ virtual Vector<GUI::TextDocumentSpan> const& spans() const override { return m_spans; }
virtual void set_span_at_index(size_t index, GUI::TextDocumentSpan span) override { m_spans.at(index) = move(span); }
virtual String highlighter_did_request_text() const override { return m_text; }
diff --git a/Userland/Libraries/LibSyntax/HighlighterClient.h b/Userland/Libraries/LibSyntax/HighlighterClient.h
index 60ee1bb9ab..1edd69fac6 100644
--- a/Userland/Libraries/LibSyntax/HighlighterClient.h
+++ b/Userland/Libraries/LibSyntax/HighlighterClient.h
@@ -18,7 +18,7 @@ public:
virtual ~HighlighterClient() = default;
virtual Vector<GUI::TextDocumentSpan>& spans() = 0;
- virtual const Vector<GUI::TextDocumentSpan>& spans() const = 0;
+ virtual Vector<GUI::TextDocumentSpan> const& spans() const = 0;
virtual void set_span_at_index(size_t index, GUI::TextDocumentSpan span) = 0;
virtual String highlighter_did_request_text() const = 0;
diff --git a/Userland/Libraries/LibTLS/Certificate.h b/Userland/Libraries/LibTLS/Certificate.h
index 15f352d50d..b806e4213e 100644
--- a/Userland/Libraries/LibTLS/Certificate.h
+++ b/Userland/Libraries/LibTLS/Certificate.h
@@ -63,7 +63,7 @@ class DefaultRootCACertificates {
public:
DefaultRootCACertificates();
- const Vector<Certificate>& certificates() const { return m_ca_certificates; }
+ Vector<Certificate> const& certificates() const { return m_ca_certificates; }
static DefaultRootCACertificates& the() { return s_the; }
diff --git a/Userland/Libraries/LibTLS/Handshake.cpp b/Userland/Libraries/LibTLS/Handshake.cpp
index 6a7c160546..5720674be7 100644
--- a/Userland/Libraries/LibTLS/Handshake.cpp
+++ b/Userland/Libraries/LibTLS/Handshake.cpp
@@ -99,7 +99,7 @@ ByteBuffer TLSv12::build_hello()
builder.append((u8)0);
// SNI host length + value
builder.append((u16)sni_length);
- builder.append((const u8*)m_context.extensions.SNI.characters(), sni_length);
+ builder.append((u8 const*)m_context.extensions.SNI.characters(), sni_length);
}
// signature_algorithms extension
@@ -180,7 +180,7 @@ ByteBuffer TLSv12::build_handshake_finished()
auto digest = m_context.handshake_hash.digest();
auto hashbuf = ReadonlyBytes { digest.immutable_data(), m_context.handshake_hash.digest_size() };
- pseudorandom_function(outbuffer, m_context.master_key, (const u8*)"client finished", 15, hashbuf, dummy);
+ pseudorandom_function(outbuffer, m_context.master_key, (u8 const*)"client finished", 15, hashbuf, dummy);
builder.append(outbuffer);
auto packet = builder.build();
@@ -314,7 +314,7 @@ ssize_t TLSv12::handle_handshake_payload(ReadonlyBytes vbuffer)
}
payload_res = handle_certificate(buffer.slice(1, payload_size));
if (m_context.certificates.size()) {
- auto it = m_context.certificates.find_if([](const auto& cert) { return cert.is_valid(); });
+ auto it = m_context.certificates.find_if([](auto const& cert) { return cert.is_valid(); });
if (it.is_end()) {
// no valid certificates
diff --git a/Userland/Libraries/LibTLS/HandshakeClient.cpp b/Userland/Libraries/LibTLS/HandshakeClient.cpp
index 1420e7a1ef..2f2efbccfd 100644
--- a/Userland/Libraries/LibTLS/HandshakeClient.cpp
+++ b/Userland/Libraries/LibTLS/HandshakeClient.cpp
@@ -36,7 +36,7 @@ bool TLSv12::expand_key()
pseudorandom_function(
key_buffer,
m_context.master_key,
- (const u8*)"key expansion", 13,
+ (u8 const*)"key expansion", 13,
ReadonlyBytes { m_context.remote_random, sizeof(m_context.remote_random) },
ReadonlyBytes { m_context.local_random, sizeof(m_context.local_random) });
@@ -129,7 +129,7 @@ bool TLSv12::compute_master_secret_from_pre_master_secret(size_t length)
pseudorandom_function(
m_context.master_key,
m_context.premaster_key,
- (const u8*)"master secret", 13,
+ (u8 const*)"master secret", 13,
ReadonlyBytes { m_context.local_random, sizeof(m_context.local_random) },
ReadonlyBytes { m_context.remote_random, sizeof(m_context.remote_random) });
@@ -211,7 +211,7 @@ void TLSv12::build_rsa_pre_master_secret(PacketBuilder& builder)
}
m_context.premaster_key = premaster_key_result.release_value();
- const auto& certificate_option = verify_chain_and_get_matching_certificate(m_context.extensions.SNI); // if the SNI is empty, we'll make a special case and match *a* leaf certificate.
+ auto const& certificate_option = verify_chain_and_get_matching_certificate(m_context.extensions.SNI); // if the SNI is empty, we'll make a special case and match *a* leaf certificate.
if (!certificate_option.has_value()) {
dbgln("certificate verification failed :(");
alert(AlertLevel::Critical, AlertDescription::BadCertificate);
diff --git a/Userland/Libraries/LibTLS/HandshakeServer.cpp b/Userland/Libraries/LibTLS/HandshakeServer.cpp
index e263d82d4d..92ca783706 100644
--- a/Userland/Libraries/LibTLS/HandshakeServer.cpp
+++ b/Userland/Libraries/LibTLS/HandshakeServer.cpp
@@ -133,7 +133,7 @@ ssize_t TLSv12::handle_server_hello(ReadonlyBytes buffer, WritePacketStage& writ
// Exactly one ServerName should be present
if (buffer.size() - res < 3)
return (i8)Error::NeedMoreData;
- auto sni_name_type = (NameType)(*(const u8*)buffer.offset_pointer(res++));
+ auto sni_name_type = (NameType)(*(u8 const*)buffer.offset_pointer(res++));
auto sni_name_length = AK::convert_between_host_and_network_endian(ByteReader::load16(buffer.offset_pointer(res += 2)));
if (sni_name_type != NameType::HostName)
@@ -145,7 +145,7 @@ ssize_t TLSv12::handle_server_hello(ReadonlyBytes buffer, WritePacketStage& writ
// Read out the host_name
if (buffer.size() - res < sni_name_length)
return (i8)Error::NeedMoreData;
- m_context.extensions.SNI = String { (const char*)buffer.offset_pointer(res), sni_name_length };
+ m_context.extensions.SNI = String { (char const*)buffer.offset_pointer(res), sni_name_length };
res += sni_name_length;
dbgln("SNI host_name: {}", m_context.extensions.SNI);
}
@@ -153,13 +153,13 @@ ssize_t TLSv12::handle_server_hello(ReadonlyBytes buffer, WritePacketStage& writ
if (buffer.size() - res > 2) {
auto alpn_length = AK::convert_between_host_and_network_endian(ByteReader::load16(buffer.offset_pointer(res)));
if (alpn_length && alpn_length <= extension_length - 2) {
- const u8* alpn = buffer.offset_pointer(res + 2);
+ u8 const* alpn = buffer.offset_pointer(res + 2);
size_t alpn_position = 0;
while (alpn_position < alpn_length) {
u8 alpn_size = alpn[alpn_position++];
if (alpn_size + alpn_position >= extension_length)
break;
- String alpn_str { (const char*)alpn + alpn_position, alpn_length };
+ String alpn_str { (char const*)alpn + alpn_position, alpn_length };
if (alpn_size && m_context.alpn.contains_slow(alpn_str)) {
m_context.negotiated_alpn = alpn_str;
dbgln("negotiated alpn: {}", alpn_str);
diff --git a/Userland/Libraries/LibTLS/Record.cpp b/Userland/Libraries/LibTLS/Record.cpp
index 2063e168d9..00c63b38e9 100644
--- a/Userland/Libraries/LibTLS/Record.cpp
+++ b/Userland/Libraries/LibTLS/Record.cpp
@@ -274,20 +274,20 @@ void TLSv12::ensure_hmac(size_t digest_size, bool local)
m_hmac_remote = move(hmac);
}
-ByteBuffer TLSv12::hmac_message(ReadonlyBytes buf, const Optional<ReadonlyBytes> buf2, size_t mac_length, bool local)
+ByteBuffer TLSv12::hmac_message(ReadonlyBytes buf, Optional<ReadonlyBytes> const buf2, size_t mac_length, bool local)
{
u64 sequence_number = AK::convert_between_host_and_network_endian(local ? m_context.local_sequence_number : m_context.remote_sequence_number);
ensure_hmac(mac_length, local);
auto& hmac = local ? *m_hmac_local : *m_hmac_remote;
if constexpr (TLS_DEBUG) {
dbgln("========================= PACKET DATA ==========================");
- print_buffer((const u8*)&sequence_number, sizeof(u64));
+ print_buffer((u8 const*)&sequence_number, sizeof(u64));
print_buffer(buf.data(), buf.size());
if (buf2.has_value())
print_buffer(buf2.value().data(), buf2.value().size());
dbgln("========================= PACKET DATA ==========================");
}
- hmac.update((const u8*)&sequence_number, sizeof(u64));
+ hmac.update((u8 const*)&sequence_number, sizeof(u64));
hmac.update(buf);
if (buf2.has_value() && buf2.value().size()) {
hmac.update(buf2.value());
diff --git a/Userland/Libraries/LibTLS/Socket.cpp b/Userland/Libraries/LibTLS/Socket.cpp
index f63900d790..79ba5d08a7 100644
--- a/Userland/Libraries/LibTLS/Socket.cpp
+++ b/Userland/Libraries/LibTLS/Socket.cpp
@@ -71,7 +71,7 @@ ErrorOr<size_t> TLSv12::write(ReadonlyBytes bytes)
return bytes.size();
}
-ErrorOr<NonnullOwnPtr<TLSv12>> TLSv12::connect(const String& host, u16 port, Options options)
+ErrorOr<NonnullOwnPtr<TLSv12>> TLSv12::connect(String const& host, u16 port, Options options)
{
Core::EventLoop loop;
OwnPtr<Core::Stream::Socket> tcp_socket = TRY(Core::Stream::TCPSocket::connect(host, port));
@@ -93,7 +93,7 @@ ErrorOr<NonnullOwnPtr<TLSv12>> TLSv12::connect(const String& host, u16 port, Opt
return AK::Error::from_string_literal(alert_name(static_cast<AlertDescription>(256 - result)));
}
-ErrorOr<NonnullOwnPtr<TLSv12>> TLSv12::connect(const String& host, Core::Stream::Socket& underlying_stream, Options options)
+ErrorOr<NonnullOwnPtr<TLSv12>> TLSv12::connect(String const& host, Core::Stream::Socket& underlying_stream, Options options)
{
StreamVariantType socket { &underlying_stream };
auto tls_socket = make<TLSv12>(&underlying_stream, move(options));
diff --git a/Userland/Libraries/LibTLS/TLSPacketBuilder.h b/Userland/Libraries/LibTLS/TLSPacketBuilder.h
index fa43b2a40a..6c864a3700 100644
--- a/Userland/Libraries/LibTLS/TLSPacketBuilder.h
+++ b/Userland/Libraries/LibTLS/TLSPacketBuilder.h
@@ -46,11 +46,11 @@ public:
inline void append(u16 value)
{
value = AK::convert_between_host_and_network_endian(value);
- append((const u8*)&value, sizeof(value));
+ append((u8 const*)&value, sizeof(value));
}
inline void append(u8 value)
{
- append((const u8*)&value, sizeof(value));
+ append((u8 const*)&value, sizeof(value));
}
inline void append(ReadonlyBytes data)
{
@@ -67,7 +67,7 @@ public:
append(buf, 3);
}
- inline void append(const u8* data, size_t bytes)
+ inline void append(u8 const* data, size_t bytes)
{
if (bytes == 0)
return;
diff --git a/Userland/Libraries/LibTLS/TLSv12.cpp b/Userland/Libraries/LibTLS/TLSv12.cpp
index bd9a2a4280..240cfd9399 100644
--- a/Userland/Libraries/LibTLS/TLSv12.cpp
+++ b/Userland/Libraries/LibTLS/TLSv12.cpp
@@ -191,7 +191,7 @@ bool Context::verify_chain() const
if (!options.validate_certificates)
return true;
- const Vector<Certificate>* local_chain = nullptr;
+ Vector<Certificate> const* local_chain = nullptr;
if (is_server) {
dbgln("Unsupported: Server mode");
TODO();
@@ -236,7 +236,7 @@ bool Context::verify_chain() const
}
template<typename HMACType>
-static void hmac_pseudorandom_function(Bytes output, ReadonlyBytes secret, const u8* label, size_t label_length, ReadonlyBytes seed, ReadonlyBytes seed_b)
+static void hmac_pseudorandom_function(Bytes output, ReadonlyBytes secret, u8 const* label, size_t label_length, ReadonlyBytes seed, ReadonlyBytes seed_b)
{
if (!secret.size()) {
dbgln("null secret");
@@ -274,7 +274,7 @@ static void hmac_pseudorandom_function(Bytes output, ReadonlyBytes secret, const
}
}
-void TLSv12::pseudorandom_function(Bytes output, ReadonlyBytes secret, const u8* label, size_t label_length, ReadonlyBytes seed, ReadonlyBytes seed_b)
+void TLSv12::pseudorandom_function(Bytes output, ReadonlyBytes secret, u8 const* label, size_t label_length, ReadonlyBytes seed, ReadonlyBytes seed_b)
{
// Simplification: We only support the HMAC PRF with the hash function SHA-256 or stronger.
diff --git a/Userland/Libraries/LibTLS/TLSv12.h b/Userland/Libraries/LibTLS/TLSv12.h
index cad8f945ba..d04d4ec830 100644
--- a/Userland/Libraries/LibTLS/TLSv12.h
+++ b/Userland/Libraries/LibTLS/TLSv12.h
@@ -28,12 +28,12 @@ inline void print_buffer(ReadonlyBytes buffer)
dbgln("{:hex-dump}", buffer);
}
-inline void print_buffer(const ByteBuffer& buffer)
+inline void print_buffer(ByteBuffer const& buffer)
{
print_buffer(buffer.bytes());
}
-inline void print_buffer(const u8* buffer, size_t size)
+inline void print_buffer(u8 const* buffer, size_t size)
{
print_buffer(ReadonlyBytes { buffer, size });
}
@@ -75,7 +75,7 @@ enum class AlertDescription : u8 {
#undef ENUMERATE_ALERT_DESCRIPTION
};
-constexpr static const char* alert_name(AlertDescription descriptor)
+constexpr static char const* alert_name(AlertDescription descriptor)
{
#define ENUMERATE_ALERT_DESCRIPTION(name, value) \
case AlertDescription::name: \
@@ -445,7 +445,7 @@ private:
void consume(ReadonlyBytes record);
- ByteBuffer hmac_message(ReadonlyBytes buf, const Optional<ReadonlyBytes> buf2, size_t mac_length, bool local = false);
+ ByteBuffer hmac_message(ReadonlyBytes buf, Optional<ReadonlyBytes> const buf2, size_t mac_length, bool local = false);
void ensure_hmac(size_t digest_size, bool local);
void update_packet(ByteBuffer& packet);
@@ -486,7 +486,7 @@ private:
ssize_t handle_message(ReadonlyBytes);
ssize_t handle_random(ReadonlyBytes);
- void pseudorandom_function(Bytes output, ReadonlyBytes secret, const u8* label, size_t label_length, ReadonlyBytes seed, ReadonlyBytes seed_b);
+ void pseudorandom_function(Bytes output, ReadonlyBytes secret, u8 const* label, size_t label_length, ReadonlyBytes seed, ReadonlyBytes seed_b);
ssize_t verify_rsa_server_key_exchange(ReadonlyBytes server_key_info_buffer, ReadonlyBytes signature_buffer);
diff --git a/Userland/Libraries/LibTest/CrashTest.cpp b/Userland/Libraries/LibTest/CrashTest.cpp
index 419867342a..f77a1de069 100644
--- a/Userland/Libraries/LibTest/CrashTest.cpp
+++ b/Userland/Libraries/LibTest/CrashTest.cpp
@@ -78,7 +78,7 @@ bool Crash::do_report(Report report)
out("\x1B[31mFAIL\x1B[0m: ");
report.visit(
- [&](const Failure& failure) {
+ [&](Failure const& failure) {
switch (failure) {
case Failure::DidNotCrash:
out("Did not crash");
@@ -90,7 +90,7 @@ bool Crash::do_report(Report report)
VERIFY_NOT_REACHED();
}
},
- [&](const int& signal) {
+ [&](int const& signal) {
out("Terminated with signal {}", signal);
});
diff --git a/Userland/Libraries/LibTest/JavaScriptTestRunner.h b/Userland/Libraries/LibTest/JavaScriptTestRunner.h
index 7c0cb92d7c..b9ab53af2d 100644
--- a/Userland/Libraries/LibTest/JavaScriptTestRunner.h
+++ b/Userland/Libraries/LibTest/JavaScriptTestRunner.h
@@ -96,7 +96,7 @@
{ \
::Test::JS::g_run_file = hook; \
} \
- static ::Test::JS::IntermediateRunFileResult hook(const String&, JS::Interpreter&, JS::ExecutionContext&); \
+ static ::Test::JS::IntermediateRunFileResult hook(String const&, JS::Interpreter&, JS::ExecutionContext&); \
} __testjs_common_run_file {}; \
::Test::JS::IntermediateRunFileResult __TestJS_run_file::hook(__VA_ARGS__)
@@ -164,7 +164,7 @@ enum class RunFileHookResult {
};
using IntermediateRunFileResult = AK::Result<JSFileResult, RunFileHookResult>;
-extern IntermediateRunFileResult (*g_run_file)(const String&, JS::Interpreter&, JS::ExecutionContext&);
+extern IntermediateRunFileResult (*g_run_file)(String const&, JS::Interpreter&, JS::ExecutionContext&);
class TestRunner : public ::Test::TestRunner {
public:
@@ -178,10 +178,10 @@ public:
virtual ~TestRunner() = default;
protected:
- virtual void do_run_single_test(const String& test_path, size_t, size_t) override;
+ virtual void do_run_single_test(String const& test_path, size_t, size_t) override;
virtual Vector<String> get_test_paths() const override;
- virtual JSFileResult run_file_test(const String& test_path);
- void print_file_result(const JSFileResult& file_result) const;
+ virtual JSFileResult run_file_test(String const& test_path);
+ void print_file_result(JSFileResult const& file_result) const;
String m_common_path;
};
@@ -261,7 +261,7 @@ inline ErrorOr<JsonValue> get_test_results(JS::Interpreter& interpreter)
return JsonValue::from_string(json_string);
}
-inline void TestRunner::do_run_single_test(const String& test_path, size_t, size_t)
+inline void TestRunner::do_run_single_test(String const& test_path, size_t, size_t)
{
auto file_result = run_file_test(test_path);
if (!m_print_json)
@@ -274,7 +274,7 @@ inline void TestRunner::do_run_single_test(const String& test_path, size_t, size
inline Vector<String> TestRunner::get_test_paths() const
{
Vector<String> paths;
- iterate_directory_recursively(m_test_root, [&](const String& file_path) {
+ iterate_directory_recursively(m_test_root, [&](String const& file_path) {
if (!file_path.ends_with(".js"))
return;
if (!file_path.ends_with("test-common.js"))
@@ -284,7 +284,7 @@ inline Vector<String> TestRunner::get_test_paths() const
return paths;
}
-inline JSFileResult TestRunner::run_file_test(const String& test_path)
+inline JSFileResult TestRunner::run_file_test(String const& test_path)
{
g_currently_running_test = test_path;
@@ -404,7 +404,7 @@ inline JSFileResult TestRunner::run_file_test(const String& test_path)
file_result.logged_messages.append(message.to_string_without_side_effects());
}
- test_json.value().as_object().for_each_member([&](const String& suite_name, const JsonValue& suite_value) {
+ test_json.value().as_object().for_each_member([&](String const& suite_name, JsonValue const& suite_value) {
Test::Suite suite { test_path, suite_name };
VERIFY(suite_value.is_object());
@@ -461,7 +461,7 @@ inline JSFileResult TestRunner::run_file_test(const String& test_path)
return file_result;
}
-inline void TestRunner::print_file_result(const JSFileResult& file_result) const
+inline void TestRunner::print_file_result(JSFileResult const& file_result) const
{
if (file_result.most_severe_test_result == Test::Result::Fail || file_result.error.has_value()) {
print_modifiers({ BG_RED, FG_BLACK, FG_BOLD });
diff --git a/Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp b/Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp
index 7b5bc0df75..a4a6e41bd2 100644
--- a/Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp
+++ b/Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp
@@ -25,7 +25,7 @@ HashMap<String, FunctionWithLength> s_exposed_global_functions;
Function<void()> g_main_hook;
Function<NonnullOwnPtr<JS::Interpreter>()> g_create_interpreter_hook;
HashMap<bool*, Tuple<String, String, char>> g_extra_args;
-IntermediateRunFileResult (*g_run_file)(const String&, JS::Interpreter&, JS::ExecutionContext&) = nullptr;
+IntermediateRunFileResult (*g_run_file)(String const&, JS::Interpreter&, JS::ExecutionContext&) = nullptr;
String g_test_root;
int g_test_argc;
char** g_test_argv;
@@ -88,7 +88,7 @@ int main(int argc, char** argv)
#endif
bool print_json = false;
bool per_file = false;
- const char* specified_test_root = nullptr;
+ char const* specified_test_root = nullptr;
String common_path;
String test_glob;
diff --git a/Userland/Libraries/LibTest/Macros.h b/Userland/Libraries/LibTest/Macros.h
index 6f32e0ae13..7fd1912c3e 100644
--- a/Userland/Libraries/LibTest/Macros.h
+++ b/Userland/Libraries/LibTest/Macros.h
@@ -14,7 +14,7 @@
namespace AK {
template<typename... Parameters>
-void warnln(CheckedFormatString<Parameters...>&& fmtstr, const Parameters&...);
+void warnln(CheckedFormatString<Parameters...>&& fmtstr, Parameters const&...);
}
namespace Test {
diff --git a/Userland/Libraries/LibTest/TestCase.h b/Userland/Libraries/LibTest/TestCase.h
index 866bba5d2e..18efcccf90 100644
--- a/Userland/Libraries/LibTest/TestCase.h
+++ b/Userland/Libraries/LibTest/TestCase.h
@@ -20,7 +20,7 @@ using TestFunction = Function<void()>;
class TestCase : public RefCounted<TestCase> {
public:
- TestCase(const String& name, TestFunction&& fn, bool is_benchmark)
+ TestCase(String const& name, TestFunction&& fn, bool is_benchmark)
: m_name(name)
, m_function(move(fn))
, m_is_benchmark(is_benchmark)
@@ -28,8 +28,8 @@ public:
}
bool is_benchmark() const { return m_is_benchmark; }
- const String& name() const { return m_name; }
- const TestFunction& func() const { return m_function; }
+ String const& name() const { return m_name; }
+ TestFunction const& func() const { return m_function; }
private:
String m_name;
@@ -38,7 +38,7 @@ private:
};
// Helper to hide implementation of TestSuite from users
-void add_test_case_to_suite(const NonnullRefPtr<TestCase>& test_case);
+void add_test_case_to_suite(NonnullRefPtr<TestCase> const& test_case);
void set_suite_setup_function(Function<void()> setup);
}
diff --git a/Userland/Libraries/LibTest/TestRunner.h b/Userland/Libraries/LibTest/TestRunner.h
index 4e8bad2a40..bde37c12bf 100644
--- a/Userland/Libraries/LibTest/TestRunner.h
+++ b/Userland/Libraries/LibTest/TestRunner.h
@@ -44,7 +44,7 @@ public:
virtual void run(String test_glob);
- const Test::Counts& counts() const { return m_counts; }
+ Test::Counts const& counts() const { return m_counts; }
bool is_printing_progress() const { return m_print_progress; }
@@ -65,8 +65,8 @@ protected:
void print_test_results_as_json() const;
virtual Vector<String> get_test_paths() const = 0;
- virtual void do_run_single_test(const String&, size_t current_test_index, size_t num_tests) = 0;
- virtual const Vector<String>* get_failed_test_names() const { return nullptr; }
+ virtual void do_run_single_test(String const&, size_t current_test_index, size_t num_tests) = 0;
+ virtual Vector<String> const* get_failed_test_names() const { return nullptr; }
String m_test_root;
bool m_print_times;
@@ -101,7 +101,7 @@ inline double get_time_in_ms()
}
template<typename Callback>
-inline void iterate_directory_recursively(const String& directory_path, Callback callback)
+inline void iterate_directory_recursively(String const& directory_path, Callback callback)
{
Core::DirIterator directory_iterator(directory_path, Core::DirIterator::Flags::SkipDots);
diff --git a/Userland/Libraries/LibTest/TestSuite.cpp b/Userland/Libraries/LibTest/TestSuite.cpp
index e6923040ea..1eca37492d 100644
--- a/Userland/Libraries/LibTest/TestSuite.cpp
+++ b/Userland/Libraries/LibTest/TestSuite.cpp
@@ -45,7 +45,7 @@ void current_test_case_did_fail()
}
// Declared in TestCase.h
-void add_test_case_to_suite(const NonnullRefPtr<TestCase>& test_case)
+void add_test_case_to_suite(NonnullRefPtr<TestCase> const& test_case)
{
TestSuite::the().add_case(test_case);
}
@@ -56,7 +56,7 @@ void set_suite_setup_function(Function<void()> setup)
TestSuite::the().set_suite_setup(move(setup));
}
-int TestSuite::main(const String& suite_name, int argc, char** argv)
+int TestSuite::main(String const& suite_name, int argc, char** argv)
{
m_suite_name = suite_name;
@@ -65,7 +65,7 @@ int TestSuite::main(const String& suite_name, int argc, char** argv)
bool do_tests_only = getenv("TESTS_ONLY") != nullptr;
bool do_benchmarks_only = false;
bool do_list_cases = false;
- const char* search_string = "*";
+ char const* search_string = "*";
args_parser.add_option(do_tests_only, "Only run tests.", "tests", 0);
args_parser.add_option(do_benchmarks_only, "Only run benchmarks.", "bench", 0);
@@ -76,11 +76,11 @@ int TestSuite::main(const String& suite_name, int argc, char** argv)
if (m_setup)
m_setup();
- const auto& matching_tests = find_cases(search_string, !do_benchmarks_only, !do_tests_only);
+ auto const& matching_tests = find_cases(search_string, !do_benchmarks_only, !do_tests_only);
if (do_list_cases) {
outln("Available cases for {}:", suite_name);
- for (const auto& test : matching_tests) {
+ for (auto const& test : matching_tests) {
outln(" {}", test.name());
}
return 0;
@@ -91,10 +91,10 @@ int TestSuite::main(const String& suite_name, int argc, char** argv)
return run(matching_tests);
}
-NonnullRefPtrVector<TestCase> TestSuite::find_cases(const String& search, bool find_tests, bool find_benchmarks)
+NonnullRefPtrVector<TestCase> TestSuite::find_cases(String const& search, bool find_tests, bool find_benchmarks)
{
NonnullRefPtrVector<TestCase> matches;
- for (const auto& t : m_cases) {
+ for (auto const& t : m_cases) {
if (!search.is_empty() && !t.name().matches(search, CaseSensitivity::CaseInsensitive)) {
continue;
}
@@ -111,22 +111,22 @@ NonnullRefPtrVector<TestCase> TestSuite::find_cases(const String& search, bool f
return matches;
}
-int TestSuite::run(const NonnullRefPtrVector<TestCase>& tests)
+int TestSuite::run(NonnullRefPtrVector<TestCase> const& tests)
{
size_t test_count = 0;
size_t test_failed_count = 0;
size_t benchmark_count = 0;
TestElapsedTimer global_timer;
- for (const auto& t : tests) {
- const auto test_type = t.is_benchmark() ? "benchmark" : "test";
+ for (auto const& t : tests) {
+ auto const test_type = t.is_benchmark() ? "benchmark" : "test";
warnln("Running {} '{}'.", test_type, t.name());
m_current_test_case_passed = true;
TestElapsedTimer timer;
t.func()();
- const auto time = timer.elapsed_milliseconds();
+ auto const time = timer.elapsed_milliseconds();
dbgln("{} {} '{}' in {}ms", m_current_test_case_passed ? "Completed" : "Failed", test_type, t.name(), time);
diff --git a/Userland/Libraries/LibTest/TestSuite.h b/Userland/Libraries/LibTest/TestSuite.h
index 4cc1142514..4863329b63 100644
--- a/Userland/Libraries/LibTest/TestSuite.h
+++ b/Userland/Libraries/LibTest/TestSuite.h
@@ -33,10 +33,10 @@ public:
s_global = nullptr;
}
- int run(const NonnullRefPtrVector<TestCase>&);
- int main(const String& suite_name, int argc, char** argv);
- NonnullRefPtrVector<TestCase> find_cases(const String& search, bool find_tests, bool find_benchmarks);
- void add_case(const NonnullRefPtr<TestCase>& test_case)
+ int run(NonnullRefPtrVector<TestCase> const&);
+ int main(String const& suite_name, int argc, char** argv);
+ NonnullRefPtrVector<TestCase> find_cases(String const& search, bool find_tests, bool find_benchmarks);
+ void add_case(NonnullRefPtr<TestCase> const& test_case)
{
m_cases.append(test_case);
}
diff --git a/Userland/Libraries/LibTextCodec/Decoder.cpp b/Userland/Libraries/LibTextCodec/Decoder.cpp
index 57695ec847..e312107f9e 100644
--- a/Userland/Libraries/LibTextCodec/Decoder.cpp
+++ b/Userland/Libraries/LibTextCodec/Decoder.cpp
@@ -26,7 +26,7 @@ TurkishDecoder s_turkish_decoder;
XUserDefinedDecoder s_x_user_defined_decoder;
}
-Decoder* decoder_for(const String& a_encoding)
+Decoder* decoder_for(String const& a_encoding)
{
auto encoding = get_standardized_encoding(a_encoding);
if (encoding.has_value()) {
diff --git a/Userland/Libraries/LibUSBDB/Database.cpp b/Userland/Libraries/LibUSBDB/Database.cpp
index 140ca5bb65..2be7c04ad2 100644
--- a/Userland/Libraries/LibUSBDB/Database.cpp
+++ b/Userland/Libraries/LibUSBDB/Database.cpp
@@ -12,7 +12,7 @@
namespace USBDB {
-RefPtr<Database> Database::open(const String& filename)
+RefPtr<Database> Database::open(String const& filename)
{
auto file_or_error = Core::MappedFile::map(filename);
if (file_or_error.is_error())
@@ -25,7 +25,7 @@ RefPtr<Database> Database::open(const String& filename)
const StringView Database::get_vendor(u16 vendor_id) const
{
- const auto& vendor = m_vendors.get(vendor_id);
+ auto const& vendor = m_vendors.get(vendor_id);
if (!vendor.has_value())
return "";
return vendor.value()->name;
@@ -33,11 +33,11 @@ const StringView Database::get_vendor(u16 vendor_id) const
const StringView Database::get_device(u16 vendor_id, u16 device_id) const
{
- const auto& vendor = m_vendors.get(vendor_id);
+ auto const& vendor = m_vendors.get(vendor_id);
if (!vendor.has_value()) {
return "";
}
- const auto& device = vendor.value()->devices.get(device_id);
+ auto const& device = vendor.value()->devices.get(device_id);
if (!device.has_value())
return "";
return device.value()->name;
@@ -45,13 +45,13 @@ const StringView Database::get_device(u16 vendor_id, u16 device_id) const
const StringView Database::get_interface(u16 vendor_id, u16 device_id, u16 interface_id) const
{
- const auto& vendor = m_vendors.get(vendor_id);
+ auto const& vendor = m_vendors.get(vendor_id);
if (!vendor.has_value())
return "";
- const auto& device = vendor.value()->devices.get(device_id);
+ auto const& device = vendor.value()->devices.get(device_id);
if (!device.has_value())
return "";
- const auto& interface = device.value()->interfaces.get(interface_id);
+ auto const& interface = device.value()->interfaces.get(interface_id);
if (!interface.has_value())
return "";
return interface.value()->name;
@@ -59,7 +59,7 @@ const StringView Database::get_interface(u16 vendor_id, u16 device_id, u16 inter
const StringView Database::get_class(u8 class_id) const
{
- const auto& xclass = m_classes.get(class_id);
+ auto const& xclass = m_classes.get(class_id);
if (!xclass.has_value())
return "";
return xclass.value()->name;
@@ -67,10 +67,10 @@ const StringView Database::get_class(u8 class_id) const
const StringView Database::get_subclass(u8 class_id, u8 subclass_id) const
{
- const auto& xclass = m_classes.get(class_id);
+ auto const& xclass = m_classes.get(class_id);
if (!xclass.has_value())
return "";
- const auto& subclass = xclass.value()->subclasses.get(subclass_id);
+ auto const& subclass = xclass.value()->subclasses.get(subclass_id);
if (!subclass.has_value())
return "";
return subclass.value()->name;
@@ -78,13 +78,13 @@ const StringView Database::get_subclass(u8 class_id, u8 subclass_id) const
const StringView Database::get_protocol(u8 class_id, u8 subclass_id, u8 protocol_id) const
{
- const auto& xclass = m_classes.get(class_id);
+ auto const& xclass = m_classes.get(class_id);
if (!xclass.has_value())
return "";
- const auto& subclass = xclass.value()->subclasses.get(subclass_id);
+ auto const& subclass = xclass.value()->subclasses.get(subclass_id);
if (!subclass.has_value())
return "";
- const auto& protocol = subclass.value()->protocols.get(protocol_id);
+ auto const& protocol = subclass.value()->protocols.get(protocol_id);
if (!protocol.has_value())
return "";
return protocol.value()->name;
diff --git a/Userland/Libraries/LibUSBDB/Database.h b/Userland/Libraries/LibUSBDB/Database.h
index 207fedcc1e..d9f77e284c 100644
--- a/Userland/Libraries/LibUSBDB/Database.h
+++ b/Userland/Libraries/LibUSBDB/Database.h
@@ -52,7 +52,7 @@ struct Class {
class Database : public RefCounted<Database> {
public:
- static RefPtr<Database> open(const String& filename);
+ static RefPtr<Database> open(String const& filename);
static RefPtr<Database> open() { return open("/res/usb.ids"); };
const StringView get_vendor(u16 vendor_id) const;
diff --git a/Userland/Libraries/LibVT/Attribute.h b/Userland/Libraries/LibVT/Attribute.h
index 9b6a9ea897..a9c60ee80d 100644
--- a/Userland/Libraries/LibVT/Attribute.h
+++ b/Userland/Libraries/LibVT/Attribute.h
@@ -59,11 +59,11 @@ struct Attribute {
Flags flags { Flags::NoAttributes };
- constexpr bool operator==(const Attribute& other) const
+ constexpr bool operator==(Attribute const& other) const
{
return foreground_color == other.foreground_color && background_color == other.background_color && flags == other.flags;
}
- constexpr bool operator!=(const Attribute& other) const
+ constexpr bool operator!=(Attribute const& other) const
{
return !(*this == other);
}
diff --git a/Userland/Libraries/LibVT/Color.h b/Userland/Libraries/LibVT/Color.h
index 5e8a6b4b94..0144f55ea7 100644
--- a/Userland/Libraries/LibVT/Color.h
+++ b/Userland/Libraries/LibVT/Color.h
@@ -95,7 +95,7 @@ public:
}
}
- constexpr bool operator==(const Color& other) const
+ constexpr bool operator==(Color const& other) const
{
if (m_kind != other.kind())
return false;
diff --git a/Userland/Libraries/LibVT/EscapeSequenceParser.h b/Userland/Libraries/LibVT/EscapeSequenceParser.h
index 5f4b5ad87d..6fec1ce6a9 100644
--- a/Userland/Libraries/LibVT/EscapeSequenceParser.h
+++ b/Userland/Libraries/LibVT/EscapeSequenceParser.h
@@ -19,7 +19,7 @@ class EscapeSequenceExecutor {
public:
virtual ~EscapeSequenceExecutor() = default;
- using Parameters = Span<const unsigned>;
+ using Parameters = Span<unsigned const>;
using Intermediates = Span<const u8>;
using OscParameter = Span<const u8>;
using OscParameters = Span<const OscParameter>;
diff --git a/Userland/Libraries/LibVT/Line.cpp b/Userland/Libraries/LibVT/Line.cpp
index bf348d4371..6c09c0056b 100644
--- a/Userland/Libraries/LibVT/Line.cpp
+++ b/Userland/Libraries/LibVT/Line.cpp
@@ -117,7 +117,7 @@ void Line::take_cells_from_next_line(size_t new_length, Line* next_line, bool cu
next_line->m_cells.clear();
}
-void Line::clear_range(size_t first_column, size_t last_column, const Attribute& attribute)
+void Line::clear_range(size_t first_column, size_t last_column, Attribute const& attribute)
{
VERIFY(first_column <= last_column);
VERIFY(last_column < m_cells.size());
diff --git a/Userland/Libraries/LibVT/Line.h b/Userland/Libraries/LibVT/Line.h
index 09f9989868..fd920b593c 100644
--- a/Userland/Libraries/LibVT/Line.h
+++ b/Userland/Libraries/LibVT/Line.h
@@ -31,18 +31,18 @@ public:
bool operator!=(Cell const& other) const { return code_point != other.code_point || attribute != other.attribute; }
};
- const Attribute& attribute_at(size_t index) const { return m_cells[index].attribute; }
+ Attribute const& attribute_at(size_t index) const { return m_cells[index].attribute; }
Attribute& attribute_at(size_t index) { return m_cells[index].attribute; }
Cell& cell_at(size_t index) { return m_cells[index]; }
- const Cell& cell_at(size_t index) const { return m_cells[index]; }
+ Cell const& cell_at(size_t index) const { return m_cells[index]; }
- void clear(const Attribute& attribute = Attribute())
+ void clear(Attribute const& attribute = Attribute())
{
m_terminated_at.clear();
clear_range(0, m_cells.size() - 1, attribute);
}
- void clear_range(size_t first_column, size_t last_column, const Attribute& attribute = Attribute());
+ void clear_range(size_t first_column, size_t last_column, Attribute const& attribute = Attribute());
bool has_only_one_background_color() const;
bool is_empty() const
diff --git a/Userland/Libraries/LibVT/Position.h b/Userland/Libraries/LibVT/Position.h
index c880a4c005..b24e6e6a8f 100644
--- a/Userland/Libraries/LibVT/Position.h
+++ b/Userland/Libraries/LibVT/Position.h
@@ -23,27 +23,27 @@ public:
int row() const { return m_row; }
int column() const { return m_column; }
- bool operator<(const Position& other) const
+ bool operator<(Position const& other) const
{
return m_row < other.m_row || (m_row == other.m_row && m_column < other.m_column);
}
- bool operator<=(const Position& other) const
+ bool operator<=(Position const& other) const
{
return *this < other || *this == other;
}
- bool operator>=(const Position& other) const
+ bool operator>=(Position const& other) const
{
return !(*this < other);
}
- bool operator==(const Position& other) const
+ bool operator==(Position const& other) const
{
return m_row == other.m_row && m_column == other.m_column;
}
- bool operator!=(const Position& other) const
+ bool operator!=(Position const& other) const
{
return !(*this == other);
}
diff --git a/Userland/Libraries/LibVT/Range.h b/Userland/Libraries/LibVT/Range.h
index db3cb9015c..bc7566d923 100644
--- a/Userland/Libraries/LibVT/Range.h
+++ b/Userland/Libraries/LibVT/Range.h
@@ -48,7 +48,7 @@ public:
m_end = Position(m_end.row() + delta, m_end.column());
}
- bool operator==(const Range& other) const
+ bool operator==(Range const& other) const
{
return m_start == other.m_start && m_end == other.m_end;
}
diff --git a/Userland/Libraries/LibVT/Terminal.cpp b/Userland/Libraries/LibVT/Terminal.cpp
index 7e669a5f40..5eaacb682e 100644
--- a/Userland/Libraries/LibVT/Terminal.cpp
+++ b/Userland/Libraries/LibVT/Terminal.cpp
@@ -1347,7 +1347,7 @@ void Terminal::inject_string(StringView str)
void Terminal::emit_string(StringView string)
{
- m_client.emit((const u8*)string.characters_without_null_termination(), string.length());
+ m_client.emit((u8 const*)string.characters_without_null_termination(), string.length());
}
void Terminal::handle_key_press(KeyCode key, u32 code_point, u8 flags)
@@ -1657,7 +1657,7 @@ void Terminal::invalidate_cursor()
active_buffer()[cursor_row()].set_dirty(true);
}
-Attribute Terminal::attribute_at(const Position& position) const
+Attribute Terminal::attribute_at(Position const& position) const
{
if (!position.is_valid())
return {};
diff --git a/Userland/Libraries/LibVT/Terminal.h b/Userland/Libraries/LibVT/Terminal.h
index 6e8828f717..b3760b0106 100644
--- a/Userland/Libraries/LibVT/Terminal.h
+++ b/Userland/Libraries/LibVT/Terminal.h
@@ -53,7 +53,7 @@ public:
virtual void set_window_progress(int value, int max) = 0;
virtual void terminal_did_resize(u16 columns, u16 rows) = 0;
virtual void terminal_history_changed(int delta) = 0;
- virtual void emit(const u8*, size_t) = 0;
+ virtual void emit(u8 const*, size_t) = 0;
virtual void set_cursor_style(CursorStyle) = 0;
};
@@ -129,7 +129,7 @@ public:
return m_normal_screen_buffer[index - m_history.size()];
}
}
- const Line& line(size_t index) const
+ Line const& line(size_t index) const
{
return const_cast<Terminal*>(this)->line(index);
}
@@ -139,7 +139,7 @@ public:
return active_buffer()[index];
}
- const Line& visible_line(size_t index) const
+ Line const& visible_line(size_t index) const
{
return active_buffer()[index];
}
@@ -177,7 +177,7 @@ public:
void handle_key_press(KeyCode, u32, u8 flags);
#ifndef KERNEL
- Attribute attribute_at(const Position&) const;
+ Attribute attribute_at(Position const&) const;
#endif
bool needs_bracketed_paste() const
@@ -404,7 +404,7 @@ protected:
}
NonnullOwnPtrVector<Line>& active_buffer() { return m_use_alternate_screen_buffer ? m_alternate_screen_buffer : m_normal_screen_buffer; };
- const NonnullOwnPtrVector<Line>& active_buffer() const { return m_use_alternate_screen_buffer ? m_alternate_screen_buffer : m_normal_screen_buffer; };
+ NonnullOwnPtrVector<Line> const& active_buffer() const { return m_use_alternate_screen_buffer ? m_alternate_screen_buffer : m_normal_screen_buffer; };
NonnullOwnPtrVector<Line> m_normal_screen_buffer;
NonnullOwnPtrVector<Line> m_alternate_screen_buffer;
#endif
diff --git a/Userland/Libraries/LibVT/TerminalWidget.cpp b/Userland/Libraries/LibVT/TerminalWidget.cpp
index 5c9b70121c..c1d0d59344 100644
--- a/Userland/Libraries/LibVT/TerminalWidget.cpp
+++ b/Userland/Libraries/LibVT/TerminalWidget.cpp
@@ -492,7 +492,7 @@ void TerminalWidget::resize_event(GUI::ResizeEvent& event)
relayout(event.size());
}
-void TerminalWidget::relayout(const Gfx::IntSize& size)
+void TerminalWidget::relayout(Gfx::IntSize const& size)
{
if (!m_scrollbar)
return;
@@ -580,7 +580,7 @@ bool TerminalWidget::selection_contains(const VT::Position& position) const
return position >= normalized_selection.start() && position <= normalized_selection.end();
}
-VT::Position TerminalWidget::buffer_position_at(const Gfx::IntPoint& position) const
+VT::Position TerminalWidget::buffer_position_at(Gfx::IntPoint const& position) const
{
auto adjusted_position = position.translated(-(frame_thickness() + m_inset), -(frame_thickness() + m_inset));
int row = adjusted_position.y() / m_line_height;
@@ -1030,7 +1030,7 @@ void TerminalWidget::beep()
update();
}
-void TerminalWidget::emit(const u8* data, size_t size)
+void TerminalWidget::emit(u8 const* data, size_t size)
{
if (write(m_ptm_fd, data, size) < 0) {
perror("TerminalWidget::emit: write");
@@ -1229,7 +1229,7 @@ void TerminalWidget::set_color_scheme(StringView name)
update();
}
-Gfx::IntSize TerminalWidget::widget_size_for_font(const Gfx::Font& font) const
+Gfx::IntSize TerminalWidget::widget_size_for_font(Gfx::Font const& font) const
{
return {
(frame_thickness() * 2) + (m_inset * 2) + (m_terminal.columns() * font.glyph_width('x')) + m_scrollbar->width(),
@@ -1260,7 +1260,7 @@ constexpr Gfx::Color TerminalWidget::terminal_color_to_rgb(VT::Color color) cons
}
};
-void TerminalWidget::set_font_and_resize_to_fit(const Gfx::Font& font)
+void TerminalWidget::set_font_and_resize_to_fit(Gfx::Font const& font)
{
set_font(font);
resize(widget_size_for_font(font));
diff --git a/Userland/Libraries/LibVT/TerminalWidget.h b/Userland/Libraries/LibVT/TerminalWidget.h
index aeadd8b00c..99f3a85226 100644
--- a/Userland/Libraries/LibVT/TerminalWidget.h
+++ b/Userland/Libraries/LibVT/TerminalWidget.h
@@ -60,7 +60,7 @@ public:
String selected_text() const;
VT::Range normalized_selection() const { return m_selection.normalized(); }
void set_selection(const VT::Range& selection);
- VT::Position buffer_position_at(const Gfx::IntPoint&) const;
+ VT::Position buffer_position_at(Gfx::IntPoint const&) const;
VT::Range find_next(StringView, const VT::Position& start = {}, bool case_sensitivity = false, bool should_wrap = false);
VT::Range find_previous(StringView, const VT::Position& start = {}, bool case_sensitivity = false, bool should_wrap = false);
@@ -85,14 +85,14 @@ public:
const StringView color_scheme_name() const { return m_color_scheme_name; }
Function<void(StringView)> on_title_change;
- Function<void(const Gfx::IntSize&)> on_terminal_size_change;
+ Function<void(Gfx::IntSize const&)> on_terminal_size_change;
Function<void()> on_command_exit;
GUI::Menu& context_menu() { return *m_context_menu; }
constexpr Gfx::Color terminal_color_to_rgb(VT::Color) const;
- void set_font_and_resize_to_fit(const Gfx::Font&);
+ void set_font_and_resize_to_fit(Gfx::Font const&);
void set_color_scheme(StringView);
@@ -123,11 +123,11 @@ private:
virtual void set_window_progress(int value, int max) override;
virtual void terminal_did_resize(u16 columns, u16 rows) override;
virtual void terminal_history_changed(int delta) override;
- virtual void emit(const u8*, size_t) override;
+ virtual void emit(u8 const*, size_t) override;
virtual void set_cursor_style(CursorStyle) override;
// ^GUI::Clipboard::ClipboardClient
- virtual void clipboard_content_did_change(const String&) override { update_paste_action(); }
+ virtual void clipboard_content_did_change(String const&) override { update_paste_action(); }
void set_logical_focus(bool);
@@ -136,12 +136,12 @@ private:
Gfx::IntRect glyph_rect(u16 row, u16 column);
Gfx::IntRect row_rect(u16 row);
- Gfx::IntSize widget_size_for_font(const Gfx::Font&) const;
+ Gfx::IntSize widget_size_for_font(Gfx::Font const&) const;
void update_cursor();
void invalidate_cursor();
- void relayout(const Gfx::IntSize&);
+ void relayout(Gfx::IntSize const&);
void update_copy_action();
void update_paste_action();
diff --git a/Userland/Libraries/LibVideo/VP9/Decoder.cpp b/Userland/Libraries/LibVideo/VP9/Decoder.cpp
index 725d9ac29b..9d9e739dc9 100644
--- a/Userland/Libraries/LibVideo/VP9/Decoder.cpp
+++ b/Userland/Libraries/LibVideo/VP9/Decoder.cpp
@@ -39,7 +39,7 @@ u8 Decoder::merge_prob(u8 pre_prob, u8 count_0, u8 count_1, u8 count_sat, u8 max
return round_2(pre_prob * (256 - factor) + (prob * factor), 8);
}
-u8 Decoder::merge_probs(const int* tree, int index, u8* probs, u8* counts, u8 count_sat, u8 max_update_factor)
+u8 Decoder::merge_probs(int const* tree, int index, u8* probs, u8* counts, u8 count_sat, u8 max_update_factor)
{
auto s = tree[index];
auto left_count = (s <= 0) ? counts[-s] : merge_probs(tree, s, probs, counts, count_sat, max_update_factor);
diff --git a/Userland/Libraries/LibVideo/VP9/TreeParser.cpp b/Userland/Libraries/LibVideo/VP9/TreeParser.cpp
index bd702c251c..1a218044d4 100644
--- a/Userland/Libraries/LibVideo/VP9/TreeParser.cpp
+++ b/Userland/Libraries/LibVideo/VP9/TreeParser.cpp
@@ -560,8 +560,8 @@ u8 TreeParser::calculate_tx_size_probability(u8 node)
u8 TreeParser::calculate_inter_mode_probability(u8 node)
{
- //FIXME: Implement when ModeContext is implemented
- // m_ctx = m_decoder.m_mode_context[m_decoder.m_ref_frame[0]]
+ // FIXME: Implement when ModeContext is implemented
+ // m_ctx = m_decoder.m_mode_context[m_decoder.m_ref_frame[0]]
return m_decoder.m_probability_tables->inter_mode_probs()[m_ctx][node];
}
diff --git a/Userland/Libraries/LibWasm/AbstractMachine/Configuration.cpp b/Userland/Libraries/LibWasm/AbstractMachine/Configuration.cpp
index f3dee8492d..0bb260ee5b 100644
--- a/Userland/Libraries/LibWasm/AbstractMachine/Configuration.cpp
+++ b/Userland/Libraries/LibWasm/AbstractMachine/Configuration.cpp
@@ -84,8 +84,7 @@ Result Configuration::execute(Interpreter& interpreter)
void Configuration::dump_stack()
{
- auto print_value = []<typename... Ts>(CheckedFormatString<Ts...> format, Ts... vs)
- {
+ auto print_value = []<typename... Ts>(CheckedFormatString<Ts...> format, Ts... vs) {
DuplexMemoryStream memory_stream;
Printer { memory_stream }.print(vs...);
ByteBuffer buffer = memory_stream.copy_into_contiguous_buffer();
diff --git a/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp b/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp
index c5ba30fcb7..18e8eb95c1 100644
--- a/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp
+++ b/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp
@@ -2155,7 +2155,7 @@ VALIDATE_INSTRUCTION(call_indirect)
return {};
}
-ErrorOr<void, ValidationError> Validator::validate(const Instruction& instruction, Stack& stack, bool& is_constant)
+ErrorOr<void, ValidationError> Validator::validate(Instruction const& instruction, Stack& stack, bool& is_constant)
{
switch (instruction.opcode().value()) {
#define M(name, integer_value) \
@@ -2194,7 +2194,7 @@ ErrorOr<Validator::ExpressionTypeResult, ValidationError> Validator::validate(Ex
return ExpressionTypeResult { stack.release_vector(), is_constant_expression };
}
-bool Validator::Stack::operator==(const Stack& other) const
+bool Validator::Stack::operator==(Stack const& other) const
{
if (!m_did_insert_unknown_entry && !other.m_did_insert_unknown_entry)
return static_cast<Vector<StackEntry> const&>(*this) == static_cast<Vector<StackEntry> const&>(other);
diff --git a/Userland/Libraries/LibWasm/Printer/Printer.cpp b/Userland/Libraries/LibWasm/Printer/Printer.cpp
index ed310f3629..7650720047 100644
--- a/Userland/Libraries/LibWasm/Printer/Printer.cpp
+++ b/Userland/Libraries/LibWasm/Printer/Printer.cpp
@@ -416,14 +416,15 @@ void Printer::print(Wasm::ImportSection::Import const& import)
{
TemporaryChange change { m_indent, m_indent + 1 };
import.description().visit(
- [this](auto const& type) { print(type); },
+ [this](auto const& type) { print(type);
+ },
[this](TypeIndex const& index) {
- print_indent();
- print("(type index {})\n", index.value());
+ print_indent();
+ print("(type index {})\n", index.value());
});
- }
- print_indent();
- print(")\n");
+}
+print_indent();
+print(")\n");
}
void Printer::print(Wasm::Instruction const& instruction)
@@ -671,7 +672,6 @@ void Printer::print(Wasm::Reference const& value)
[](Wasm::Reference::Null const&) { return String("null"); },
[](auto const& ref) { return String::number(ref.address.value()); }));
}
-
}
HashMap<Wasm::OpCode, String> Wasm::Names::instruction_names {
diff --git a/Userland/Libraries/LibWeb/Bindings/WindowObject.h b/Userland/Libraries/LibWeb/Bindings/WindowObject.h
index 7b579f2805..04a662b5b0 100644
--- a/Userland/Libraries/LibWeb/Bindings/WindowObject.h
+++ b/Userland/Libraries/LibWeb/Bindings/WindowObject.h
@@ -42,11 +42,11 @@ public:
LocationObject* location_object() { return m_location_object; }
LocationObject const* location_object() const { return m_location_object; }
- JS::Object* web_prototype(const String& class_name) { return m_prototypes.get(class_name).value_or(nullptr); }
- JS::NativeFunction* web_constructor(const String& class_name) { return m_constructors.get(class_name).value_or(nullptr); }
+ JS::Object* web_prototype(String const& class_name) { return m_prototypes.get(class_name).value_or(nullptr); }
+ JS::NativeFunction* web_constructor(String const& class_name) { return m_constructors.get(class_name).value_or(nullptr); }
template<typename T>
- JS::Object& ensure_web_prototype(const String& class_name)
+ JS::Object& ensure_web_prototype(String const& class_name)
{
auto it = m_prototypes.find(class_name);
if (it != m_prototypes.end())
@@ -57,7 +57,7 @@ public:
}
template<typename T>
- JS::NativeFunction& ensure_web_constructor(const String& class_name)
+ JS::NativeFunction& ensure_web_constructor(String const& class_name)
{
auto it = m_constructors.find(class_name);
if (it != m_constructors.end())
diff --git a/Userland/Libraries/LibWeb/Bindings/Wrappable.h b/Userland/Libraries/LibWeb/Bindings/Wrappable.h
index 36a581f399..26d2fbcc1d 100644
--- a/Userland/Libraries/LibWeb/Bindings/Wrappable.h
+++ b/Userland/Libraries/LibWeb/Bindings/Wrappable.h
@@ -19,7 +19,7 @@ public:
void set_wrapper(Wrapper&);
Wrapper* wrapper() { return m_wrapper; }
- const Wrapper* wrapper() const { return m_wrapper; }
+ Wrapper const* wrapper() const { return m_wrapper; }
private:
WeakPtr<Wrapper> m_wrapper;
diff --git a/Userland/Libraries/LibWeb/CSS/CSSImportRule.h b/Userland/Libraries/LibWeb/CSS/CSSImportRule.h
index 37c219005e..667887d697 100644
--- a/Userland/Libraries/LibWeb/CSS/CSSImportRule.h
+++ b/Userland/Libraries/LibWeb/CSS/CSSImportRule.h
@@ -32,8 +32,8 @@ public:
bool has_import_result() const { return !m_style_sheet.is_null(); }
RefPtr<CSSStyleSheet> loaded_style_sheet() { return m_style_sheet; }
- const RefPtr<CSSStyleSheet> loaded_style_sheet() const { return m_style_sheet; }
- void set_style_sheet(const RefPtr<CSSStyleSheet>& style_sheet) { m_style_sheet = style_sheet; }
+ RefPtr<CSSStyleSheet> const loaded_style_sheet() const { return m_style_sheet; }
+ void set_style_sheet(RefPtr<CSSStyleSheet> const& style_sheet) { m_style_sheet = style_sheet; }
virtual StringView class_name() const override { return "CSSImportRule"; };
virtual Type type() const override { return Type::Import; };
diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h
index fcf5ff116a..31897d477d 100644
--- a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h
+++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h
@@ -69,9 +69,9 @@ public:
virtual Optional<StyleProperty> property(PropertyID) const override;
virtual bool set_property(PropertyID, StringView css_text) override;
- const Vector<StyleProperty>& properties() const { return m_properties; }
- const HashMap<String, StyleProperty>& custom_properties() const { return m_custom_properties; }
- Optional<StyleProperty> custom_property(const String& custom_property_name) const { return m_custom_properties.get(custom_property_name); }
+ Vector<StyleProperty> const& properties() const { return m_properties; }
+ HashMap<String, StyleProperty> const& custom_properties() const { return m_custom_properties; }
+ Optional<StyleProperty> custom_property(String const& custom_property_name) const { return m_custom_properties.get(custom_property_name); }
size_t custom_property_count() const { return m_custom_properties.size(); }
virtual String serialized() const final override;
diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h
index 23f8c1564c..5f61504a57 100644
--- a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h
+++ b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h
@@ -29,8 +29,8 @@ public:
virtual ~CSSStyleRule() override = default;
- const NonnullRefPtrVector<Selector>& selectors() const { return m_selectors; }
- const CSSStyleDeclaration& declaration() const { return m_declaration; }
+ NonnullRefPtrVector<Selector> const& selectors() const { return m_selectors; }
+ CSSStyleDeclaration const& declaration() const { return m_declaration; }
virtual StringView class_name() const override { return "CSSStyleRule"; };
virtual Type type() const override { return Type::Style; };
diff --git a/Userland/Libraries/LibWeb/CSS/ComputedValues.h b/Userland/Libraries/LibWeb/CSS/ComputedValues.h
index 88779b1626..3462c152bd 100644
--- a/Userland/Libraries/LibWeb/CSS/ComputedValues.h
+++ b/Userland/Libraries/LibWeb/CSS/ComputedValues.h
@@ -152,10 +152,10 @@ public:
const CSS::LengthBox& margin() const { return m_noninherited.margin; }
const CSS::LengthBox& padding() const { return m_noninherited.padding; }
- const BorderData& border_left() const { return m_noninherited.border_left; }
- const BorderData& border_top() const { return m_noninherited.border_top; }
- const BorderData& border_right() const { return m_noninherited.border_right; }
- const BorderData& border_bottom() const { return m_noninherited.border_bottom; }
+ BorderData const& border_left() const { return m_noninherited.border_left; }
+ BorderData const& border_top() const { return m_noninherited.border_top; }
+ BorderData const& border_right() const { return m_noninherited.border_right; }
+ BorderData const& border_bottom() const { return m_noninherited.border_bottom; }
const CSS::LengthPercentage& border_bottom_left_radius() const { return m_noninherited.border_bottom_left_radius; }
const CSS::LengthPercentage& border_bottom_right_radius() const { return m_noninherited.border_bottom_right_radius; }
@@ -267,12 +267,12 @@ public:
void set_font_size(float font_size) { m_inherited.font_size = font_size; }
void set_font_weight(int font_weight) { m_inherited.font_weight = font_weight; }
void set_font_variant(CSS::FontVariant font_variant) { m_inherited.font_variant = font_variant; }
- void set_color(const Color& color) { m_inherited.color = color; }
+ void set_color(Color const& color) { m_inherited.color = color; }
void set_content(ContentData const& content) { m_noninherited.content = content; }
void set_cursor(CSS::Cursor cursor) { m_inherited.cursor = cursor; }
void set_image_rendering(CSS::ImageRendering value) { m_inherited.image_rendering = value; }
void set_pointer_events(CSS::PointerEvents value) { m_inherited.pointer_events = value; }
- void set_background_color(const Color& color) { m_noninherited.background_color = color; }
+ void set_background_color(Color const& color) { m_noninherited.background_color = color; }
void set_background_layers(Vector<BackgroundLayerData>&& layers) { m_noninherited.background_layers = move(layers); }
void set_float(CSS::Float value) { m_noninherited.float_ = value; }
void set_clear(CSS::Clear value) { m_noninherited.clear = value; }
diff --git a/Userland/Libraries/LibWeb/CSS/Length.cpp b/Userland/Libraries/LibWeb/CSS/Length.cpp
index 237fd4d4d9..724315c55e 100644
--- a/Userland/Libraries/LibWeb/CSS/Length.cpp
+++ b/Userland/Libraries/LibWeb/CSS/Length.cpp
@@ -118,7 +118,7 @@ String Length::to_string() const
return String::formatted("{}{}", m_value, unit_name());
}
-const char* Length::unit_name() const
+char const* Length::unit_name() const
{
switch (m_type) {
case Type::Cm:
diff --git a/Userland/Libraries/LibWeb/CSS/Length.h b/Userland/Libraries/LibWeb/CSS/Length.h
index 57ae881f76..97663b95fd 100644
--- a/Userland/Libraries/LibWeb/CSS/Length.h
+++ b/Userland/Libraries/LibWeb/CSS/Length.h
@@ -116,14 +116,14 @@ public:
String to_string() const;
- bool operator==(const Length& other) const
+ bool operator==(Length const& other) const
{
if (is_calculated())
return m_calculated_style == other.m_calculated_style;
return m_type == other.m_type && m_value == other.m_value;
}
- bool operator!=(const Length& other) const
+ bool operator!=(Length const& other) const
{
return !(*this == other);
}
@@ -131,7 +131,7 @@ public:
float relative_length_to_px(Gfx::IntRect const& viewport_rect, Gfx::FontPixelMetrics const& font_metrics, float font_size, float root_font_size) const;
private:
- const char* unit_name() const;
+ char const* unit_name() const;
Type m_type;
float m_value { 0 };
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
index 5e2a33d63b..0ae1e192b6 100644
--- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
+++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
@@ -28,7 +28,7 @@
#include <LibWeb/DOM/Document.h>
#include <LibWeb/Dump.h>
-static void log_parse_error(const SourceLocation& location = SourceLocation::current())
+static void log_parse_error(SourceLocation const& location = SourceLocation::current())
{
dbgln_if(CSS_PARSER_DEBUG, "Parse error (CSS) {}", location);
}
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp
index b4d1d3d6ca..45cfb6f077 100644
--- a/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp
+++ b/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp
@@ -17,7 +17,7 @@
#define REPLACEMENT_CHARACTER 0xFFFD
static constexpr u32 TOKENIZER_EOF = 0xFFFFFFFF;
-static inline void log_parse_error(const SourceLocation& location = SourceLocation::current())
+static inline void log_parse_error(SourceLocation const& location = SourceLocation::current())
{
dbgln_if(CSS_TOKENIZER_DEBUG, "Parse error (css tokenization) {} ", location);
}
@@ -192,7 +192,7 @@ static inline bool is_E(u32 code_point)
namespace Web::CSS {
-Tokenizer::Tokenizer(StringView input, const String& encoding)
+Tokenizer::Tokenizer(StringView input, String const& encoding)
{
auto* decoder = TextCodec::decoder_for(encoding);
VERIFY(decoder);
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.h b/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.h
index 6521e74eb2..39eb09d923 100644
--- a/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.h
+++ b/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.h
@@ -60,7 +60,7 @@ public:
class Tokenizer {
public:
- explicit Tokenizer(StringView input, const String& encoding);
+ explicit Tokenizer(StringView input, String const& encoding);
[[nodiscard]] Vector<Token> parse();
diff --git a/Userland/Libraries/LibWeb/CSS/Ratio.cpp b/Userland/Libraries/LibWeb/CSS/Ratio.cpp
index f6285dfa45..b2a46b766a 100644
--- a/Userland/Libraries/LibWeb/CSS/Ratio.cpp
+++ b/Userland/Libraries/LibWeb/CSS/Ratio.cpp
@@ -27,7 +27,7 @@ String Ratio::to_string() const
return String::formatted("{} / {}", m_first_value, m_second_value);
}
-auto Ratio::operator<=>(const Ratio& other) const
+auto Ratio::operator<=>(Ratio const& other) const
{
return value() - other.value();
}
diff --git a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp
index 4bfc3562d3..43794e2f6b 100644
--- a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp
+++ b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp
@@ -114,7 +114,7 @@ static inline bool matches_attribute(CSS::Selector::SimpleSelector::Attribute co
return !attribute.value.is_empty()
&& element.attribute(attribute.name).contains(attribute.value, case_sensitivity);
case CSS::Selector::SimpleSelector::Attribute::MatchType::StartsWithSegment: {
- const auto element_attr_value = element.attribute(attribute.name);
+ auto const element_attr_value = element.attribute(attribute.name);
if (element_attr_value.is_empty()) {
// If the attribute value on element is empty, the selector is true
// if the match value is also empty and false otherwise.
diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
index bf1a4cbb4d..4ae796ec1a 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
+++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
@@ -862,7 +862,7 @@ void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* ele
float font_size_in_px = 10;
if (font_size->is_identifier()) {
- switch (static_cast<const IdentifierStyleValue&>(*font_size).id()) {
+ switch (static_cast<IdentifierStyleValue const&>(*font_size).id()) {
case CSS::ValueID::XxSmall:
case CSS::ValueID::XSmall:
case CSS::ValueID::Small:
diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
index b320bc1dfe..9856396e74 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
+++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
@@ -15,7 +15,7 @@
namespace Web::CSS {
-StyleProperties::StyleProperties(const StyleProperties& other)
+StyleProperties::StyleProperties(StyleProperties const& other)
: m_property_values(other.m_property_values)
{
if (other.m_font) {
@@ -412,7 +412,7 @@ Optional<CSS::Position> StyleProperties::position() const
}
}
-bool StyleProperties::operator==(const StyleProperties& other) const
+bool StyleProperties::operator==(StyleProperties const& other) const
{
if (m_property_values.size() != other.m_property_values.size())
return false;
diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.h b/Userland/Libraries/LibWeb/CSS/StyleProperties.h
index 82c0f1f932..ef34a95e1b 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleProperties.h
+++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.h
@@ -20,7 +20,7 @@ class StyleProperties : public RefCounted<StyleProperties> {
public:
StyleProperties() = default;
- explicit StyleProperties(const StyleProperties&);
+ explicit StyleProperties(StyleProperties const&);
static NonnullRefPtr<StyleProperties> create() { return adopt_ref(*new StyleProperties); }
@@ -92,10 +92,10 @@ public:
m_font = move(font);
}
- float line_height(const Layout::Node&) const;
+ float line_height(Layout::Node const&) const;
- bool operator==(const StyleProperties&) const;
- bool operator!=(const StyleProperties& other) const { return !(*this == other); }
+ bool operator==(StyleProperties const&) const;
+ bool operator!=(StyleProperties const& other) const { return !(*this == other); }
Optional<CSS::Position> position() const;
Optional<int> z_index() const;
diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValue.h
index b90fe67ba0..970c9b74a3 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleValue.h
+++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h
@@ -941,7 +941,7 @@ public:
{
if (type() != other.type())
return false;
- return m_color == static_cast<const ColorStyleValue&>(other).m_color;
+ return m_color == static_cast<ColorStyleValue const&>(other).m_color;
}
private:
@@ -1151,7 +1151,7 @@ public:
{
if (type() != other.type())
return false;
- return m_id == static_cast<const IdentifierStyleValue&>(other).m_id;
+ return m_id == static_cast<IdentifierStyleValue const&>(other).m_id;
}
private:
diff --git a/Userland/Libraries/LibWeb/Cookie/ParsedCookie.cpp b/Userland/Libraries/LibWeb/Cookie/ParsedCookie.cpp
index 7044d67d6d..fd06e2949b 100644
--- a/Userland/Libraries/LibWeb/Cookie/ParsedCookie.cpp
+++ b/Userland/Libraries/LibWeb/Cookie/ParsedCookie.cpp
@@ -27,7 +27,7 @@ static void on_secure_attribute(ParsedCookie& parsed_cookie);
static void on_http_only_attribute(ParsedCookie& parsed_cookie);
static Optional<Core::DateTime> parse_date_time(StringView date_string);
-Optional<ParsedCookie> parse_cookie(const String& cookie_string)
+Optional<ParsedCookie> parse_cookie(String const& cookie_string)
{
// https://tools.ietf.org/html/rfc6265#section-5.2
@@ -293,7 +293,7 @@ Optional<Core::DateTime> parse_date_time(StringView date_string)
bool found_month = false;
bool found_year = false;
- for (const auto& date_token : date_tokens) {
+ for (auto const& date_token : date_tokens) {
if (!found_time && parse_time(date_token)) {
found_time = true;
} else if (!found_day_of_month && parse_day_of_month(date_token)) {
@@ -333,7 +333,7 @@ Optional<Core::DateTime> parse_date_time(StringView date_string)
}
-bool IPC::encode(IPC::Encoder& encoder, const Web::Cookie::ParsedCookie& cookie)
+bool IPC::encode(IPC::Encoder& encoder, Web::Cookie::ParsedCookie const& cookie)
{
encoder << cookie.name;
encoder << cookie.value;
diff --git a/Userland/Libraries/LibWeb/Cookie/ParsedCookie.h b/Userland/Libraries/LibWeb/Cookie/ParsedCookie.h
index 6a8bb72551..2d293c3fa2 100644
--- a/Userland/Libraries/LibWeb/Cookie/ParsedCookie.h
+++ b/Userland/Libraries/LibWeb/Cookie/ParsedCookie.h
@@ -24,13 +24,13 @@ struct ParsedCookie {
bool http_only_attribute_present { false };
};
-Optional<ParsedCookie> parse_cookie(const String& cookie_string);
+Optional<ParsedCookie> parse_cookie(String const& cookie_string);
}
namespace IPC {
-bool encode(IPC::Encoder&, const Web::Cookie::ParsedCookie&);
+bool encode(IPC::Encoder&, Web::Cookie::ParsedCookie const&);
ErrorOr<void> decode(IPC::Decoder&, Web::Cookie::ParsedCookie&);
}
diff --git a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp
index 277fec25b5..b6008f9aca 100644
--- a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp
+++ b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp
@@ -62,27 +62,27 @@ String Crypto::random_uuid() const
bytes[8] |= 1 << 7;
bytes[8] &= ~(1 << 6);
- /* 5. Return the string concatenation of
- «
+ /* 5. Return the string concatenation of
+ «
hexadecimal representation of bytes[0],
- hexadecimal representation of bytes[1],
+ hexadecimal representation of bytes[1],
hexadecimal representation of bytes[2],
hexadecimal representation of bytes[3],
- "-",
- hexadecimal representation of bytes[4],
+ "-",
+ hexadecimal representation of bytes[4],
hexadecimal representation of bytes[5],
"-",
- hexadecimal representation of bytes[6],
+ hexadecimal representation of bytes[6],
hexadecimal representation of bytes[7],
"-",
- hexadecimal representation of bytes[8],
+ hexadecimal representation of bytes[8],
hexadecimal representation of bytes[9],
"-",
- hexadecimal representation of bytes[10],
- hexadecimal representation of bytes[11],
- hexadecimal representation of bytes[12],
- hexadecimal representation of bytes[13],
- hexadecimal representation of bytes[14],
+ hexadecimal representation of bytes[10],
+ hexadecimal representation of bytes[11],
+ hexadecimal representation of bytes[12],
+ hexadecimal representation of bytes[13],
+ hexadecimal representation of bytes[14],
hexadecimal representation of bytes[15]
».
*/
diff --git a/Userland/Libraries/LibWeb/DOM/AbstractRange.h b/Userland/Libraries/LibWeb/DOM/AbstractRange.h
index 0547879aa8..0407de68f2 100644
--- a/Userland/Libraries/LibWeb/DOM/AbstractRange.h
+++ b/Userland/Libraries/LibWeb/DOM/AbstractRange.h
@@ -20,11 +20,11 @@ public:
virtual ~AbstractRange() override = default;
Node* start_container() { return m_start_container; }
- const Node* start_container() const { return m_start_container; }
+ Node const* start_container() const { return m_start_container; }
unsigned start_offset() const { return m_start_offset; }
Node* end_container() { return m_end_container; }
- const Node* end_container() const { return m_end_container; }
+ Node const* end_container() const { return m_end_container; }
unsigned end_offset() const { return m_end_offset; }
// https://dom.spec.whatwg.org/#range-collapsed
diff --git a/Userland/Libraries/LibWeb/DOM/CharacterData.cpp b/Userland/Libraries/LibWeb/DOM/CharacterData.cpp
index dec8901baf..2b17e0955e 100644
--- a/Userland/Libraries/LibWeb/DOM/CharacterData.cpp
+++ b/Userland/Libraries/LibWeb/DOM/CharacterData.cpp
@@ -10,7 +10,7 @@
namespace Web::DOM {
-CharacterData::CharacterData(Document& document, NodeType type, const String& data)
+CharacterData::CharacterData(Document& document, NodeType type, String const& data)
: Node(document, type)
, m_data(data)
{
diff --git a/Userland/Libraries/LibWeb/DOM/CharacterData.h b/Userland/Libraries/LibWeb/DOM/CharacterData.h
index 0b38ec92a0..d72d5bdfc4 100644
--- a/Userland/Libraries/LibWeb/DOM/CharacterData.h
+++ b/Userland/Libraries/LibWeb/DOM/CharacterData.h
@@ -22,7 +22,7 @@ public:
virtual ~CharacterData() override = default;
- const String& data() const { return m_data; }
+ String const& data() const { return m_data; }
void set_data(String);
unsigned length() const { return m_data.length(); }
@@ -31,7 +31,7 @@ public:
ExceptionOr<void> replace_data(size_t offset, size_t count, String const&);
protected:
- explicit CharacterData(Document&, NodeType, const String&);
+ explicit CharacterData(Document&, NodeType, String const&);
private:
String m_data;
diff --git a/Userland/Libraries/LibWeb/DOM/Comment.cpp b/Userland/Libraries/LibWeb/DOM/Comment.cpp
index 8b70cf501b..9e79dd5869 100644
--- a/Userland/Libraries/LibWeb/DOM/Comment.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Comment.cpp
@@ -10,7 +10,7 @@
namespace Web::DOM {
-Comment::Comment(Document& document, const String& data)
+Comment::Comment(Document& document, String const& data)
: CharacterData(document, NodeType::COMMENT_NODE, data)
{
}
diff --git a/Userland/Libraries/LibWeb/DOM/Comment.h b/Userland/Libraries/LibWeb/DOM/Comment.h
index 7f34f43a13..9696a31137 100644
--- a/Userland/Libraries/LibWeb/DOM/Comment.h
+++ b/Userland/Libraries/LibWeb/DOM/Comment.h
@@ -15,7 +15,7 @@ class Comment final : public CharacterData {
public:
using WrapperType = Bindings::CommentWrapper;
- explicit Comment(Document&, const String&);
+ explicit Comment(Document&, String const&);
virtual ~Comment() override = default;
virtual FlyString node_name() const override { return "#comment"; }
diff --git a/Userland/Libraries/LibWeb/DOM/CustomEvent.h b/Userland/Libraries/LibWeb/DOM/CustomEvent.h
index ed549d87d7..6ecbd83950 100644
--- a/Userland/Libraries/LibWeb/DOM/CustomEvent.h
+++ b/Userland/Libraries/LibWeb/DOM/CustomEvent.h
@@ -23,7 +23,7 @@ public:
{
return adopt_ref(*new CustomEvent(event_name, event_init));
}
- static NonnullRefPtr<CustomEvent> create_with_global_object(Bindings::WindowObject&, const FlyString& event_name, CustomEventInit const& event_init)
+ static NonnullRefPtr<CustomEvent> create_with_global_object(Bindings::WindowObject&, FlyString const& event_name, CustomEventInit const& event_init)
{
return CustomEvent::create(event_name, event_init);
}
diff --git a/Userland/Libraries/LibWeb/DOM/DOMException.h b/Userland/Libraries/LibWeb/DOM/DOMException.h
index 6e555536bf..95475e2829 100644
--- a/Userland/Libraries/LibWeb/DOM/DOMException.h
+++ b/Userland/Libraries/LibWeb/DOM/DOMException.h
@@ -78,7 +78,7 @@ namespace Web::DOM {
__ENUMERATE(OperationError) \
__ENUMERATE(NotAllowedError)
-static u16 get_legacy_code_for_name(const FlyString& name)
+static u16 get_legacy_code_for_name(FlyString const& name)
{
#define __ENUMERATE(ErrorName, code) \
if (name == #ErrorName) \
@@ -95,23 +95,23 @@ class DOMException final
public:
using WrapperType = Bindings::DOMExceptionWrapper;
- static NonnullRefPtr<DOMException> create(const FlyString& name, const FlyString& message)
+ static NonnullRefPtr<DOMException> create(FlyString const& name, FlyString const& message)
{
return adopt_ref(*new DOMException(name, message));
}
// JS constructor has message first, name second
- static NonnullRefPtr<DOMException> create_with_global_object(Bindings::WindowObject&, const FlyString& message, const FlyString& name)
+ static NonnullRefPtr<DOMException> create_with_global_object(Bindings::WindowObject&, FlyString const& message, FlyString const& name)
{
return adopt_ref(*new DOMException(name, message));
}
- const FlyString& name() const { return m_name; }
- const FlyString& message() const { return m_message; }
+ FlyString const& name() const { return m_name; }
+ FlyString const& message() const { return m_message; }
u16 code() const { return get_legacy_code_for_name(m_name); }
protected:
- DOMException(const FlyString& name, const FlyString& message)
+ DOMException(FlyString const& name, FlyString const& message)
: m_name(name)
, m_message(message)
{
@@ -125,7 +125,7 @@ private:
#define __ENUMERATE(ErrorName) \
class ErrorName final { \
public: \
- static NonnullRefPtr<DOMException> create(const FlyString& message) \
+ static NonnullRefPtr<DOMException> create(FlyString const& message) \
{ \
return DOMException::create(#ErrorName, message); \
} \
diff --git a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp
index 08ae8d5de2..3da0c63c1a 100644
--- a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp
+++ b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp
@@ -20,7 +20,7 @@ DOMImplementation::DOMImplementation(Document& document)
}
// https://dom.spec.whatwg.org/#dom-domimplementation-createdocument
-ExceptionOr<NonnullRefPtr<Document>> DOMImplementation::create_document(const String& namespace_, const String& qualified_name, RefPtr<DocumentType> doctype) const
+ExceptionOr<NonnullRefPtr<Document>> DOMImplementation::create_document(String const& namespace_, String const& qualified_name, RefPtr<DocumentType> doctype) const
{
// FIXME: This should specifically be an XML document.
auto xml_document = Document::create();
@@ -51,7 +51,7 @@ ExceptionOr<NonnullRefPtr<Document>> DOMImplementation::create_document(const St
}
// https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument
-NonnullRefPtr<Document> DOMImplementation::create_html_document(const String& title) const
+NonnullRefPtr<Document> DOMImplementation::create_html_document(String const& title) const
{
// FIXME: This should specifically be a HTML document.
auto html_document = Document::create();
diff --git a/Userland/Libraries/LibWeb/DOM/DOMImplementation.h b/Userland/Libraries/LibWeb/DOM/DOMImplementation.h
index 74948243be..1c8d828696 100644
--- a/Userland/Libraries/LibWeb/DOM/DOMImplementation.h
+++ b/Userland/Libraries/LibWeb/DOM/DOMImplementation.h
@@ -28,7 +28,7 @@ public:
}
ExceptionOr<NonnullRefPtr<Document>> create_document(String const&, String const&, RefPtr<DocumentType>) const;
- NonnullRefPtr<Document> create_html_document(const String& title) const;
+ NonnullRefPtr<Document> create_html_document(String const& title) const;
ExceptionOr<NonnullRefPtr<DocumentType>> create_document_type(String const& qualified_name, String const& public_id, String const& system_id);
// https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp
index 929042dc74..d91d6c1e44 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Document.cpp
@@ -307,7 +307,7 @@ Origin Document::origin() const
return { m_url.protocol(), m_url.host(), m_url.port_or_default() };
}
-void Document::set_origin(const Origin& origin)
+void Document::set_origin(Origin const& origin)
{
m_url.set_protocol(origin.protocol());
m_url.set_host(origin.host());
@@ -328,7 +328,7 @@ void Document::schedule_layout_update()
m_layout_update_timer->start();
}
-bool Document::is_child_allowed(const Node& node) const
+bool Document::is_child_allowed(Node const& node) const
{
switch (node.type()) {
case NodeType::DOCUMENT_NODE:
@@ -350,7 +350,7 @@ Element* Document::document_element()
return first_child_of_type<Element>();
}
-const Element* Document::document_element() const
+Element const* Document::document_element() const
{
return first_child_of_type<Element>();
}
@@ -432,7 +432,7 @@ String Document::title() const
return builder.to_string();
}
-void Document::set_title(const String& title)
+void Document::set_title(String const& title)
{
auto* head_element = const_cast<HTML::HTMLHeadElement*>(head());
if (!head_element)
@@ -651,9 +651,9 @@ void Document::set_visited_link_color(Color color)
m_visited_link_color = color;
}
-const Layout::InitialContainingBlock* Document::layout_node() const
+Layout::InitialContainingBlock const* Document::layout_node() const
{
- return static_cast<const Layout::InitialContainingBlock*>(Node::layout_node());
+ return static_cast<Layout::InitialContainingBlock const*>(Node::layout_node());
}
Layout::InitialContainingBlock* Document::layout_node()
@@ -935,12 +935,12 @@ NonnullRefPtr<DocumentFragment> Document::create_document_fragment()
return adopt_ref(*new DocumentFragment(*this));
}
-NonnullRefPtr<Text> Document::create_text_node(const String& data)
+NonnullRefPtr<Text> Document::create_text_node(String const& data)
{
return adopt_ref(*new Text(*this, data));
}
-NonnullRefPtr<Comment> Document::create_comment(const String& data)
+NonnullRefPtr<Comment> Document::create_comment(String const& data)
{
return adopt_ref(*new Comment(*this, data));
}
@@ -951,7 +951,7 @@ NonnullRefPtr<Range> Document::create_range()
}
// https://dom.spec.whatwg.org/#dom-document-createevent
-NonnullRefPtr<Event> Document::create_event(const String& interface)
+NonnullRefPtr<Event> Document::create_event(String const& interface)
{
auto interface_lowercase = interface.to_lowercase();
RefPtr<Event> event;
@@ -1101,12 +1101,12 @@ ExceptionOr<NonnullRefPtr<Node>> Document::adopt_node_binding(NonnullRefPtr<Node
return node;
}
-const DocumentType* Document::doctype() const
+DocumentType const* Document::doctype() const
{
return first_child_of_type<DocumentType>();
}
-const String& Document::compat_mode() const
+String const& Document::compat_mode() const
{
static String back_compat = "BackCompat";
static String css1_compat = "CSS1Compat";
@@ -1192,12 +1192,12 @@ Page* Document::page()
return m_browsing_context ? m_browsing_context->page() : nullptr;
}
-const Page* Document::page() const
+Page const* Document::page() const
{
return m_browsing_context ? m_browsing_context->page() : nullptr;
}
-EventTarget* Document::get_parent(const Event& event)
+EventTarget* Document::get_parent(Event const& event)
{
if (event.type() == HTML::EventNames::load)
return nullptr;
diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h
index 7b1ca335c7..4412efd5e9 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.h
+++ b/Userland/Libraries/LibWeb/DOM/Document.h
@@ -68,7 +68,7 @@ public:
AK::URL url() const { return m_url; }
Origin origin() const;
- void set_origin(const Origin& origin);
+ void set_origin(Origin const& origin);
AK::URL parse_url(String const&) const;
@@ -84,14 +84,14 @@ public:
void set_hovered_node(Node*);
Node* hovered_node() { return m_hovered_node; }
- const Node* hovered_node() const { return m_hovered_node; }
+ Node const* hovered_node() const { return m_hovered_node; }
void set_inspected_node(Node*);
Node* inspected_node() { return m_inspected_node; }
- const Node* inspected_node() const { return m_inspected_node; }
+ Node const* inspected_node() const { return m_inspected_node; }
Element* document_element();
- const Element* document_element() const;
+ Element const* document_element() const;
HTML::HTMLHtmlElement* html_element();
HTML::HTMLHeadElement* head();
@@ -115,7 +115,7 @@ public:
ExceptionOr<void> set_body(HTML::HTMLElement* new_body);
String title() const;
- void set_title(const String&);
+ void set_title(String const&);
void attach_to_browsing_context(Badge<HTML::BrowsingContext>, HTML::BrowsingContext&);
void detach_from_browsing_context(Badge<HTML::BrowsingContext>, HTML::BrowsingContext&);
@@ -124,9 +124,9 @@ public:
HTML::BrowsingContext const* browsing_context() const { return m_browsing_context.ptr(); }
Page* page();
- const Page* page() const;
+ Page const* page() const;
- Color background_color(const Gfx::Palette&) const;
+ Color background_color(Gfx::Palette const&) const;
Vector<CSS::BackgroundLayerData> const* background_layers() const;
Color link_color() const;
@@ -148,9 +148,9 @@ public:
void invalidate_layout();
void invalidate_stacking_context_tree();
- virtual bool is_child_allowed(const Node&) const override;
+ virtual bool is_child_allowed(Node const&) const override;
- const Layout::InitialContainingBlock* layout_node() const;
+ Layout::InitialContainingBlock const* layout_node() const;
Layout::InitialContainingBlock* layout_node();
void schedule_style_update();
@@ -168,8 +168,8 @@ public:
NonnullRefPtr<HTMLCollection> forms();
NonnullRefPtr<HTMLCollection> scripts();
- const String& source() const { return m_source; }
- void set_source(const String& source) { m_source = source; }
+ String const& source() const { return m_source; }
+ void set_source(String const& source) { m_source = source; }
HTML::EnvironmentSettingsObject& relevant_settings_object();
JS::Realm& realm();
@@ -177,13 +177,13 @@ public:
JS::Value run_javascript(StringView source, StringView filename = "(unknown)");
- ExceptionOr<NonnullRefPtr<Element>> create_element(const String& tag_name);
- ExceptionOr<NonnullRefPtr<Element>> create_element_ns(const String& namespace_, const String& qualified_name);
+ ExceptionOr<NonnullRefPtr<Element>> create_element(String const& tag_name);
+ ExceptionOr<NonnullRefPtr<Element>> create_element_ns(String const& namespace_, String const& qualified_name);
NonnullRefPtr<DocumentFragment> create_document_fragment();
- NonnullRefPtr<Text> create_text_node(const String& data);
- NonnullRefPtr<Comment> create_comment(const String& data);
+ NonnullRefPtr<Text> create_text_node(String const& data);
+ NonnullRefPtr<Comment> create_comment(String const& data);
NonnullRefPtr<Range> create_range();
- NonnullRefPtr<Event> create_event(const String& interface);
+ NonnullRefPtr<Event> create_event(String const& interface);
void set_pending_parsing_blocking_script(Badge<HTML::HTMLScriptElement>, HTML::HTMLScriptElement*);
HTML::HTMLScriptElement* pending_parsing_blocking_script() { return m_pending_parsing_blocking_script; }
@@ -205,18 +205,18 @@ public:
void adopt_node(Node&);
ExceptionOr<NonnullRefPtr<Node>> adopt_node_binding(NonnullRefPtr<Node>);
- const DocumentType* doctype() const;
- const String& compat_mode() const;
+ DocumentType const* doctype() const;
+ String const& compat_mode() const;
void set_editable(bool editable) { m_editable = editable; }
virtual bool is_editable() const final;
Element* focused_element() { return m_focused_element; }
- const Element* focused_element() const { return m_focused_element; }
+ Element const* focused_element() const { return m_focused_element; }
void set_focused_element(Element*);
- const Element* active_element() const { return m_active_element; }
+ Element const* active_element() const { return m_active_element; }
void set_active_element(Element*);
@@ -224,7 +224,7 @@ public:
void set_created_for_appropriate_template_contents(bool value) { m_created_for_appropriate_template_contents = value; }
Document* associated_inert_template_document() { return m_associated_inert_template_document; }
- const Document* associated_inert_template_document() const { return m_associated_inert_template_document; }
+ Document const* associated_inert_template_document() const { return m_associated_inert_template_document; }
void set_associated_inert_template_document(Document& document) { m_associated_inert_template_document = document; }
String ready_state() const;
@@ -253,13 +253,13 @@ public:
HTML::Window* default_view() { return m_window; }
- const String& content_type() const { return m_content_type; }
- void set_content_type(const String& content_type) { m_content_type = content_type; }
+ String const& content_type() const { return m_content_type; }
+ void set_content_type(String const& content_type) { m_content_type = content_type; }
bool has_encoding() const { return m_encoding.has_value(); }
- const Optional<String>& encoding() const { return m_encoding; }
+ Optional<String> const& encoding() const { return m_encoding; }
String encoding_or_default() const { return m_encoding.value_or("UTF-8"); }
- void set_encoding(const Optional<String>& encoding) { m_encoding = encoding; }
+ void set_encoding(Optional<String> const& encoding) { m_encoding = encoding; }
// NOTE: These are intended for the JS bindings
String character_set() const { return encoding_or_default(); }
@@ -280,7 +280,7 @@ public:
void increment_ignore_destructive_writes_counter() { m_ignore_destructive_writes_counter++; }
void decrement_ignore_destructive_writes_counter() { m_ignore_destructive_writes_counter--; }
- virtual EventTarget* get_parent(const Event&) override;
+ virtual EventTarget* get_parent(Event const&) override;
String dump_dom_tree_as_json() const;
diff --git a/Userland/Libraries/LibWeb/DOM/DocumentType.h b/Userland/Libraries/LibWeb/DOM/DocumentType.h
index 0e8a9eedd0..89816ef0ea 100644
--- a/Userland/Libraries/LibWeb/DOM/DocumentType.h
+++ b/Userland/Libraries/LibWeb/DOM/DocumentType.h
@@ -28,14 +28,14 @@ public:
virtual FlyString node_name() const override { return "#doctype"; }
- const String& name() const { return m_name; }
- void set_name(const String& name) { m_name = name; }
+ String const& name() const { return m_name; }
+ void set_name(String const& name) { m_name = name; }
- const String& public_id() const { return m_public_id; }
- void set_public_id(const String& public_id) { m_public_id = public_id; }
+ String const& public_id() const { return m_public_id; }
+ void set_public_id(String const& public_id) { m_public_id = public_id; }
- const String& system_id() const { return m_system_id; }
- void set_system_id(const String& system_id) { m_system_id = system_id; }
+ String const& system_id() const { return m_system_id; }
+ void set_system_id(String const& system_id) { m_system_id = system_id; }
private:
String m_name;
diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp
index 4068fa5160..6bce81f358 100644
--- a/Userland/Libraries/LibWeb/DOM/Element.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Element.cpp
@@ -51,7 +51,7 @@ Element::Element(Document& document, DOM::QualifiedName qualified_name)
Element::~Element() = default;
// https://dom.spec.whatwg.org/#dom-element-getattribute
-String Element::get_attribute(const FlyString& name) const
+String Element::get_attribute(FlyString const& name) const
{
// 1. Let attr be the result of getting an attribute given qualifiedName and this.
auto const* attribute = m_attributes->get_attribute(name);
@@ -65,7 +65,7 @@ String Element::get_attribute(const FlyString& name) const
}
// https://dom.spec.whatwg.org/#dom-element-setattribute
-ExceptionOr<void> Element::set_attribute(const FlyString& name, const String& value)
+ExceptionOr<void> Element::set_attribute(FlyString const& name, String const& value)
{
// 1. If qualifiedName does not match the Name production in XML, then throw an "InvalidCharacterError" DOMException.
// FIXME: Proper name validation
@@ -156,7 +156,7 @@ ExceptionOr<void> Element::set_attribute_ns(FlyString const& namespace_, FlyStri
}
// https://dom.spec.whatwg.org/#dom-element-removeattribute
-void Element::remove_attribute(const FlyString& name)
+void Element::remove_attribute(FlyString const& name)
{
m_attributes->remove_attribute(name);
@@ -167,7 +167,7 @@ void Element::remove_attribute(const FlyString& name)
}
// https://dom.spec.whatwg.org/#dom-element-hasattribute
-bool Element::has_attribute(const FlyString& name) const
+bool Element::has_attribute(FlyString const& name) const
{
return m_attributes->get_attribute(name) != nullptr;
}
@@ -232,7 +232,7 @@ Vector<String> Element::get_attribute_names() const
return names;
}
-bool Element::has_class(const FlyString& class_name, CaseSensitivity case_sensitivity) const
+bool Element::has_class(FlyString const& class_name, CaseSensitivity case_sensitivity) const
{
return any_of(m_classes, [&](auto& it) {
return case_sensitivity == CaseSensitivity::CaseSensitive
@@ -291,7 +291,7 @@ RefPtr<Layout::Node> Element::create_layout_node_for_display_type(DOM::Document&
TODO();
}
-void Element::parse_attribute(const FlyString& name, const String& value)
+void Element::parse_attribute(FlyString const& name, String const& value)
{
if (name == HTML::AttributeNames::class_) {
auto new_classes = value.split_view(is_ascii_space);
diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h
index 8746a69f6f..5608534806 100644
--- a/Userland/Libraries/LibWeb/DOM/Element.h
+++ b/Userland/Libraries/LibWeb/DOM/Element.h
@@ -36,27 +36,27 @@ public:
Element(Document&, DOM::QualifiedName);
virtual ~Element() override;
- const String& qualified_name() const { return m_qualified_name.as_string(); }
- const String& html_uppercased_qualified_name() const { return m_html_uppercased_qualified_name; }
+ String const& qualified_name() const { return m_qualified_name.as_string(); }
+ String const& html_uppercased_qualified_name() const { return m_html_uppercased_qualified_name; }
virtual FlyString node_name() const final { return html_uppercased_qualified_name(); }
- const FlyString& local_name() const { return m_qualified_name.local_name(); }
+ FlyString const& local_name() const { return m_qualified_name.local_name(); }
// NOTE: This is for the JS bindings
- const String& tag_name() const { return html_uppercased_qualified_name(); }
+ String const& tag_name() const { return html_uppercased_qualified_name(); }
- const FlyString& prefix() const { return m_qualified_name.prefix(); }
- const FlyString& namespace_() const { return m_qualified_name.namespace_(); }
+ FlyString const& prefix() const { return m_qualified_name.prefix(); }
+ FlyString const& namespace_() const { return m_qualified_name.namespace_(); }
// NOTE: This is for the JS bindings
- const FlyString& namespace_uri() const { return namespace_(); }
+ FlyString const& namespace_uri() const { return namespace_(); }
- bool has_attribute(const FlyString& name) const;
+ bool has_attribute(FlyString const& name) const;
bool has_attributes() const { return !m_attributes->is_empty(); }
- String attribute(const FlyString& name) const { return get_attribute(name); }
- String get_attribute(const FlyString& name) const;
- ExceptionOr<void> set_attribute(const FlyString& name, const String& value);
+ String attribute(FlyString const& name) const { return get_attribute(name); }
+ String get_attribute(FlyString const& name) const;
+ ExceptionOr<void> set_attribute(FlyString const& name, String const& value);
ExceptionOr<void> set_attribute_ns(FlyString const& namespace_, FlyString const& qualified_name, String const& value);
- void remove_attribute(const FlyString& name);
+ void remove_attribute(FlyString const& name);
DOM::ExceptionOr<bool> toggle_attribute(FlyString const& name, Optional<bool> force);
size_t attribute_list_size() const { return m_attributes->length(); }
NonnullRefPtr<NamedNodeMap> const& attributes() const { return m_attributes; }
@@ -81,11 +81,11 @@ public:
}
}
- bool has_class(const FlyString&, CaseSensitivity = CaseSensitivity::CaseSensitive) const;
- const Vector<FlyString>& class_names() const { return m_classes; }
+ bool has_class(FlyString const&, CaseSensitivity = CaseSensitivity::CaseSensitive) const;
+ Vector<FlyString> const& class_names() const { return m_classes; }
virtual void apply_presentational_hints(CSS::StyleProperties&) const { }
- virtual void parse_attribute(const FlyString& name, const String& value);
+ virtual void parse_attribute(FlyString const& name, String const& value);
virtual void did_remove_attribute(FlyString const&);
enum class NeedsRelayout {
@@ -95,7 +95,7 @@ public:
NeedsRelayout recompute_style();
Layout::NodeWithStyle* layout_node() { return static_cast<Layout::NodeWithStyle*>(Node::layout_node()); }
- const Layout::NodeWithStyle* layout_node() const { return static_cast<const Layout::NodeWithStyle*>(Node::layout_node()); }
+ Layout::NodeWithStyle const* layout_node() const { return static_cast<Layout::NodeWithStyle const*>(Node::layout_node()); }
String name() const { return attribute(HTML::AttributeNames::name); }
@@ -116,7 +116,7 @@ public:
NonnullRefPtr<HTMLCollection> get_elements_by_class_name(FlyString const&);
ShadowRoot* shadow_root() { return m_shadow_root; }
- const ShadowRoot* shadow_root() const { return m_shadow_root; }
+ ShadowRoot const* shadow_root() const { return m_shadow_root; }
void set_shadow_root(RefPtr<ShadowRoot>);
void set_custom_properties(HashMap<FlyString, CSS::StyleProperty> custom_properties) { m_custom_properties = move(custom_properties); }
diff --git a/Userland/Libraries/LibWeb/DOM/Event.cpp b/Userland/Libraries/LibWeb/DOM/Event.cpp
index 16ef6055f3..dc16bad15b 100644
--- a/Userland/Libraries/LibWeb/DOM/Event.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Event.cpp
@@ -37,7 +37,7 @@ void Event::set_cancelled_flag()
}
// https://dom.spec.whatwg.org/#concept-event-initialize
-void Event::initialize(const String& type, bool bubbles, bool cancelable)
+void Event::initialize(String const& type, bool bubbles, bool cancelable)
{
m_initialized = true;
m_stop_propagation = false;
@@ -51,7 +51,7 @@ void Event::initialize(const String& type, bool bubbles, bool cancelable)
}
// https://dom.spec.whatwg.org/#dom-event-initevent
-void Event::init_event(const String& type, bool bubbles, bool cancelable)
+void Event::init_event(String const& type, bool bubbles, bool cancelable)
{
if (m_dispatch)
return;
diff --git a/Userland/Libraries/LibWeb/DOM/Event.h b/Userland/Libraries/LibWeb/DOM/Event.h
index 23d25f040e..698b65250b 100644
--- a/Userland/Libraries/LibWeb/DOM/Event.h
+++ b/Userland/Libraries/LibWeb/DOM/Event.h
@@ -47,11 +47,11 @@ public:
using Path = Vector<PathEntry>;
- static NonnullRefPtr<Event> create(const FlyString& event_name, EventInit const& event_init = {})
+ static NonnullRefPtr<Event> create(FlyString const& event_name, EventInit const& event_init = {})
{
return adopt_ref(*new Event(event_name, event_init));
}
- static NonnullRefPtr<Event> create_with_global_object(Bindings::WindowObject&, const FlyString& event_name, EventInit const& event_init)
+ static NonnullRefPtr<Event> create_with_global_object(Bindings::WindowObject&, FlyString const& event_name, EventInit const& event_init)
{
return Event::create(event_name, event_init);
}
@@ -60,7 +60,7 @@ public:
double time_stamp() const;
- const FlyString& type() const { return m_type; }
+ FlyString const& type() const { return m_type; }
void set_type(StringView type) { m_type = type; }
RefPtr<EventTarget> target() const { return m_target; }
@@ -111,7 +111,7 @@ public:
void append_to_path(EventTarget&, RefPtr<EventTarget>, RefPtr<EventTarget>, TouchTargetList&, bool);
Path& path() { return m_path; }
- const Path& path() const { return m_path; }
+ Path const& path() const { return m_path; }
void clear_path() { m_path.clear(); }
void set_touch_target_list(TouchTargetList& touch_target_list) { m_touch_target_list = touch_target_list; }
@@ -142,7 +142,7 @@ public:
m_stop_immediate_propagation = true;
}
- void init_event(const String&, bool, bool);
+ void init_event(String const&, bool, bool);
void set_time_stamp(double time_stamp) { m_time_stamp = time_stamp; }
@@ -163,7 +163,7 @@ protected:
{
}
- void initialize(const String&, bool, bool);
+ void initialize(String const&, bool, bool);
private:
FlyString m_type;
diff --git a/Userland/Libraries/LibWeb/DOM/EventTarget.h b/Userland/Libraries/LibWeb/DOM/EventTarget.h
index 75586c3d36..c0098efc47 100644
--- a/Userland/Libraries/LibWeb/DOM/EventTarget.h
+++ b/Userland/Libraries/LibWeb/DOM/EventTarget.h
@@ -41,7 +41,7 @@ public:
virtual JS::Object* create_wrapper(JS::GlobalObject&) = 0;
- virtual EventTarget* get_parent(const Event&) { return nullptr; }
+ virtual EventTarget* get_parent(Event const&) { return nullptr; }
void add_an_event_listener(NonnullRefPtr<DOMEventListener>);
void remove_an_event_listener(DOMEventListener&);
@@ -50,7 +50,7 @@ public:
auto& event_listener_list() { return m_event_listener_list; }
auto const& event_listener_list() const { return m_event_listener_list; }
- Function<void(const Event&)> activation_behavior;
+ Function<void(Event const&)> activation_behavior;
// NOTE: These only exist for checkbox and radio input elements.
virtual void legacy_pre_activation_behavior() { }
diff --git a/Userland/Libraries/LibWeb/DOM/ExceptionOr.h b/Userland/Libraries/LibWeb/DOM/ExceptionOr.h
index e741cbceba..bef730ff68 100644
--- a/Userland/Libraries/LibWeb/DOM/ExceptionOr.h
+++ b/Userland/Libraries/LibWeb/DOM/ExceptionOr.h
@@ -39,7 +39,7 @@ public:
{
}
- ExceptionOr(const ValueType& result)
+ ExceptionOr(ValueType const& result)
: m_result(result)
{
}
@@ -65,7 +65,7 @@ public:
}
ExceptionOr(ExceptionOr&& other) = default;
- ExceptionOr(const ExceptionOr& other) = default;
+ ExceptionOr(ExceptionOr const& other) = default;
~ExceptionOr() = default;
ValueType& value() requires(!IsSame<ValueType, Empty>)
diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp
index ad6773e4e3..c12ed76f78 100644
--- a/Userland/Libraries/LibWeb/DOM/Node.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Node.cpp
@@ -95,7 +95,7 @@ const HTML::HTMLElement* Node::enclosing_html_element() const
return first_ancestor_of_type<HTML::HTMLElement>();
}
-const HTML::HTMLElement* Node::enclosing_html_element_with_attribute(const FlyString& attribute) const
+const HTML::HTMLElement* Node::enclosing_html_element_with_attribute(FlyString const& attribute) const
{
for (auto* node = this; node; node = node->parent()) {
if (is<HTML::HTMLElement>(*node) && verify_cast<HTML::HTMLElement>(*node).has_attribute(attribute))
@@ -162,7 +162,7 @@ String Node::node_value() const
}
// https://dom.spec.whatwg.org/#ref-for-dom-node-nodevalue%E2%91%A0
-void Node::set_node_value(const String& value)
+void Node::set_node_value(String const& value)
{
if (is<Attribute>(this)) {
@@ -249,7 +249,7 @@ Element* Node::parent_element()
return verify_cast<Element>(parent());
}
-const Element* Node::parent_element() const
+Element const* Node::parent_element() const
{
if (!parent() || !is<Element>(parent()))
return nullptr;
@@ -650,7 +650,7 @@ void Node::set_layout_node(Badge<Layout::Node>, Layout::Node* layout_node) const
m_layout_node = nullptr;
}
-EventTarget* Node::get_parent(const Event&)
+EventTarget* Node::get_parent(Event const&)
{
// FIXME: returns the node’s assigned slot, if node is assigned, and node’s parent otherwise.
return parent();
@@ -746,7 +746,7 @@ u16 Node::compare_document_position(RefPtr<Node> other)
}
// https://dom.spec.whatwg.org/#concept-tree-host-including-inclusive-ancestor
-bool Node::is_host_including_inclusive_ancestor_of(const Node& other) const
+bool Node::is_host_including_inclusive_ancestor_of(Node const& other) const
{
if (is_inclusive_ancestor_of(other))
return true;
diff --git a/Userland/Libraries/LibWeb/DOM/Node.h b/Userland/Libraries/LibWeb/DOM/Node.h
index 44d63efb96..ffc513642b 100644
--- a/Userland/Libraries/LibWeb/DOM/Node.h
+++ b/Userland/Libraries/LibWeb/DOM/Node.h
@@ -50,7 +50,7 @@ public:
using TreeNode<Node>::unref;
ParentNode* parent_or_shadow_host();
- const ParentNode* parent_or_shadow_host() const { return const_cast<Node*>(this)->parent_or_shadow_host(); }
+ ParentNode const* parent_or_shadow_host() const { return const_cast<Node*>(this)->parent_or_shadow_host(); }
// ^EventTarget
virtual void ref_event_target() final { ref(); }
@@ -121,24 +121,24 @@ public:
void set_node_value(String const&);
Document& document() { return *m_document; }
- const Document& document() const { return *m_document; }
+ Document const& document() const { return *m_document; }
RefPtr<Document> owner_document() const;
const HTML::HTMLAnchorElement* enclosing_link_element() const;
const HTML::HTMLElement* enclosing_html_element() const;
- const HTML::HTMLElement* enclosing_html_element_with_attribute(const FlyString&) const;
+ const HTML::HTMLElement* enclosing_html_element_with_attribute(FlyString const&) const;
String child_text_content() const;
Node& root();
- const Node& root() const
+ Node const& root() const
{
return const_cast<Node*>(this)->root();
}
Node& shadow_including_root();
- const Node& shadow_including_root() const
+ Node const& shadow_including_root() const
{
return const_cast<Node*>(this)->shadow_including_root();
}
@@ -146,10 +146,10 @@ public:
bool is_connected() const;
Node* parent_node() { return parent(); }
- const Node* parent_node() const { return parent(); }
+ Node const* parent_node() const { return parent(); }
Element* parent_element();
- const Element* parent_element() const;
+ Element const* parent_element() const;
virtual void inserted();
virtual void removed_from(Node*) { }
@@ -157,7 +157,7 @@ public:
virtual void adopted_from(Document&) { }
virtual void cloned(Node&, bool) {};
- const Layout::Node* layout_node() const { return m_layout_node; }
+ Layout::Node const* layout_node() const { return m_layout_node; }
Layout::Node* layout_node() { return m_layout_node; }
Painting::PaintableBox const* paint_box() const;
@@ -165,7 +165,7 @@ public:
void set_layout_node(Badge<Layout::Node>, Layout::Node*) const;
- virtual bool is_child_allowed(const Node&) const { return true; }
+ virtual bool is_child_allowed(Node const&) const { return true; }
bool needs_style_update() const { return m_needs_style_update; }
void set_needs_style_update(bool);
@@ -179,14 +179,14 @@ public:
void set_document(Badge<Document>, Document&);
- virtual EventTarget* get_parent(const Event&) override;
+ virtual EventTarget* get_parent(Event const&) override;
template<typename T>
bool fast_is() const = delete;
ExceptionOr<void> ensure_pre_insertion_validity(NonnullRefPtr<Node> node, RefPtr<Node> child) const;
- bool is_host_including_inclusive_ancestor_of(const Node&) const;
+ bool is_host_including_inclusive_ancestor_of(Node const&) const;
bool is_scripting_enabled() const;
bool is_scripting_disabled() const;
diff --git a/Userland/Libraries/LibWeb/DOM/NonDocumentTypeChildNode.h b/Userland/Libraries/LibWeb/DOM/NonDocumentTypeChildNode.h
index 3929382b7c..37a4fde5bd 100644
--- a/Userland/Libraries/LibWeb/DOM/NonDocumentTypeChildNode.h
+++ b/Userland/Libraries/LibWeb/DOM/NonDocumentTypeChildNode.h
@@ -51,10 +51,10 @@ public:
return nullptr;
}
- const Element* previous_element_sibling() const { return const_cast<NonDocumentTypeChildNode*>(this)->previous_element_sibling(); }
- const Element* previous_element_in_pre_order() const { return const_cast<NonDocumentTypeChildNode*>(this)->previous_element_in_pre_order(); }
- const Element* next_element_sibling() const { return const_cast<NonDocumentTypeChildNode*>(this)->next_element_sibling(); }
- const Element* next_element_in_pre_order() const { return const_cast<NonDocumentTypeChildNode*>(this)->next_element_in_pre_order(); }
+ Element const* previous_element_sibling() const { return const_cast<NonDocumentTypeChildNode*>(this)->previous_element_sibling(); }
+ Element const* previous_element_in_pre_order() const { return const_cast<NonDocumentTypeChildNode*>(this)->previous_element_in_pre_order(); }
+ Element const* next_element_sibling() const { return const_cast<NonDocumentTypeChildNode*>(this)->next_element_sibling(); }
+ Element const* next_element_in_pre_order() const { return const_cast<NonDocumentTypeChildNode*>(this)->next_element_in_pre_order(); }
protected:
NonDocumentTypeChildNode() = default;
diff --git a/Userland/Libraries/LibWeb/DOM/NonElementParentNode.h b/Userland/Libraries/LibWeb/DOM/NonElementParentNode.h
index 4b8605d4bd..59c1ef65cb 100644
--- a/Userland/Libraries/LibWeb/DOM/NonElementParentNode.h
+++ b/Userland/Libraries/LibWeb/DOM/NonElementParentNode.h
@@ -16,10 +16,10 @@ namespace Web::DOM {
template<typename NodeType>
class NonElementParentNode {
public:
- RefPtr<Element> get_element_by_id(const FlyString& id) const
+ RefPtr<Element> get_element_by_id(FlyString const& id) const
{
RefPtr<Element> found_element;
- static_cast<const NodeType*>(this)->template for_each_in_inclusive_subtree_of_type<Element>([&](auto& element) {
+ static_cast<NodeType const*>(this)->template for_each_in_inclusive_subtree_of_type<Element>([&](auto& element) {
if (element.attribute(HTML::AttributeNames::id) == id) {
found_element = &element;
return IterationDecision::Break;
@@ -28,9 +28,9 @@ public:
});
return found_element;
}
- RefPtr<Element> get_element_by_id(const FlyString& id)
+ RefPtr<Element> get_element_by_id(FlyString const& id)
{
- return const_cast<const NonElementParentNode*>(this)->get_element_by_id(id);
+ return const_cast<NonElementParentNode const*>(this)->get_element_by_id(id);
}
protected:
diff --git a/Userland/Libraries/LibWeb/DOM/Position.h b/Userland/Libraries/LibWeb/DOM/Position.h
index a4fe55a57e..45ef6768a7 100644
--- a/Userland/Libraries/LibWeb/DOM/Position.h
+++ b/Userland/Libraries/LibWeb/DOM/Position.h
@@ -21,7 +21,7 @@ public:
bool is_valid() const { return m_node; }
Node* node() { return m_node; }
- const Node* node() const { return m_node; }
+ Node const* node() const { return m_node; }
unsigned offset() const { return m_offset; }
bool offset_is_at_end_of_node() const;
@@ -29,12 +29,12 @@ public:
bool increment_offset();
bool decrement_offset();
- bool operator==(const Position& other) const
+ bool operator==(Position const& other) const
{
return m_node == other.m_node && m_offset == other.m_offset;
}
- bool operator!=(const Position& other) const
+ bool operator!=(Position const& other) const
{
return !(*this == other);
}
diff --git a/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.cpp b/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.cpp
index c1cc2f2dce..66cb7a56bc 100644
--- a/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.cpp
+++ b/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.cpp
@@ -9,7 +9,7 @@
namespace Web::DOM {
-ProcessingInstruction::ProcessingInstruction(Document& document, const String& data, const String& target)
+ProcessingInstruction::ProcessingInstruction(Document& document, String const& data, String const& target)
: CharacterData(document, NodeType::PROCESSING_INSTRUCTION_NODE, data)
, m_target(target)
{
diff --git a/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.h b/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.h
index 087960ca3c..5bc6706daf 100644
--- a/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.h
+++ b/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.h
@@ -15,12 +15,12 @@ class ProcessingInstruction final : public CharacterData {
public:
using WrapperType = Bindings::ProcessingInstructionWrapper;
- ProcessingInstruction(Document&, const String& data, const String& target);
+ ProcessingInstruction(Document&, String const& data, String const& target);
virtual ~ProcessingInstruction() override = default;
virtual FlyString node_name() const override { return m_target; }
- const String& target() const { return m_target; }
+ String const& target() const { return m_target; }
private:
String m_target;
diff --git a/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp b/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp
index 98965b475d..01a312ee65 100644
--- a/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp
+++ b/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp
@@ -19,7 +19,7 @@ ShadowRoot::ShadowRoot(Document& document, Element& host)
}
// https://dom.spec.whatwg.org/#ref-for-get-the-parent%E2%91%A6
-EventTarget* ShadowRoot::get_parent(const Event& event)
+EventTarget* ShadowRoot::get_parent(Event const& event)
{
if (!event.composed()) {
auto& events_first_invocation_target = verify_cast<Node>(*event.path().first().invocation_target);
diff --git a/Userland/Libraries/LibWeb/DOM/ShadowRoot.h b/Userland/Libraries/LibWeb/DOM/ShadowRoot.h
index f550c0e5cb..b4306c4461 100644
--- a/Userland/Libraries/LibWeb/DOM/ShadowRoot.h
+++ b/Userland/Libraries/LibWeb/DOM/ShadowRoot.h
@@ -23,7 +23,7 @@ public:
void set_available_to_element_internals(bool available_to_element_internals) { m_available_to_element_internals = available_to_element_internals; }
// ^EventTarget
- virtual EventTarget* get_parent(const Event&) override;
+ virtual EventTarget* get_parent(Event const&) override;
// NOTE: This is intended for the JS bindings.
String mode() const { return m_closed ? "closed" : "open"; }
diff --git a/Userland/Libraries/LibWeb/DOM/Text.cpp b/Userland/Libraries/LibWeb/DOM/Text.cpp
index 83b21fcdd7..d2ea61a2bb 100644
--- a/Userland/Libraries/LibWeb/DOM/Text.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Text.cpp
@@ -12,7 +12,7 @@
namespace Web::DOM {
-Text::Text(Document& document, const String& data)
+Text::Text(Document& document, String const& data)
: CharacterData(document, NodeType::TEXT_NODE, data)
{
}
diff --git a/Userland/Libraries/LibWeb/DOM/Text.h b/Userland/Libraries/LibWeb/DOM/Text.h
index 2d839cb63a..bccfc2024e 100644
--- a/Userland/Libraries/LibWeb/DOM/Text.h
+++ b/Userland/Libraries/LibWeb/DOM/Text.h
@@ -16,7 +16,7 @@ class Text final : public CharacterData {
public:
using WrapperType = Bindings::TextWrapper;
- explicit Text(Document&, const String&);
+ explicit Text(Document&, String const&);
virtual ~Text() override = default;
static NonnullRefPtr<Text> create_with_global_object(Bindings::WindowObject& window, String const& data);
diff --git a/Userland/Libraries/LibWeb/DOMTreeModel.h b/Userland/Libraries/LibWeb/DOMTreeModel.h
index 94b7606a62..2d971a1384 100644
--- a/Userland/Libraries/LibWeb/DOMTreeModel.h
+++ b/Userland/Libraries/LibWeb/DOMTreeModel.h
@@ -36,14 +36,14 @@ public:
private:
DOMTreeModel(JsonObject, GUI::TreeView&);
- ALWAYS_INLINE JsonObject const* get_parent(const JsonObject& o) const
+ ALWAYS_INLINE JsonObject const* get_parent(JsonObject const& o) const
{
auto parent_node = m_dom_node_to_parent_map.get(&o);
VERIFY(parent_node.has_value());
return *parent_node;
}
- ALWAYS_INLINE static JsonArray const* get_children(const JsonObject& o)
+ ALWAYS_INLINE static JsonArray const* get_children(JsonObject const& o)
{
if (auto const* maybe_children = o.get_ptr("children"); maybe_children)
return &maybe_children->as_array();
diff --git a/Userland/Libraries/LibWeb/FontCache.cpp b/Userland/Libraries/LibWeb/FontCache.cpp
index 12edddc2d4..7350049dd3 100644
--- a/Userland/Libraries/LibWeb/FontCache.cpp
+++ b/Userland/Libraries/LibWeb/FontCache.cpp
@@ -13,7 +13,7 @@ FontCache& FontCache::the()
return cache;
}
-RefPtr<Gfx::Font> FontCache::get(const FontSelector& font_selector) const
+RefPtr<Gfx::Font> FontCache::get(FontSelector const& font_selector) const
{
auto cached_font = m_fonts.get(font_selector);
if (cached_font.has_value())
@@ -21,7 +21,7 @@ RefPtr<Gfx::Font> FontCache::get(const FontSelector& font_selector) const
return nullptr;
}
-void FontCache::set(const FontSelector& font_selector, NonnullRefPtr<Gfx::Font> font)
+void FontCache::set(FontSelector const& font_selector, NonnullRefPtr<Gfx::Font> font)
{
m_fonts.set(font_selector, move(font));
}
diff --git a/Userland/Libraries/LibWeb/FontCache.h b/Userland/Libraries/LibWeb/FontCache.h
index f36411570f..647e6b6813 100644
--- a/Userland/Libraries/LibWeb/FontCache.h
+++ b/Userland/Libraries/LibWeb/FontCache.h
@@ -18,7 +18,7 @@ struct FontSelector {
int weight { 0 };
int slope { 0 };
- bool operator==(const FontSelector& other) const
+ bool operator==(FontSelector const& other) const
{
return family == other.family && point_size == other.point_size && weight == other.weight && slope == other.slope;
}
@@ -27,15 +27,15 @@ struct FontSelector {
namespace AK {
template<>
struct Traits<FontSelector> : public GenericTraits<FontSelector> {
- static unsigned hash(const FontSelector& key) { return pair_int_hash(pair_int_hash(key.family.hash(), key.weight), key.point_size); }
+ static unsigned hash(FontSelector const& key) { return pair_int_hash(pair_int_hash(key.family.hash(), key.weight), key.point_size); }
};
}
class FontCache {
public:
static FontCache& the();
- RefPtr<Gfx::Font> get(const FontSelector&) const;
- void set(const FontSelector&, NonnullRefPtr<Gfx::Font>);
+ RefPtr<Gfx::Font> get(FontSelector const&) const;
+ void set(FontSelector const&, NonnullRefPtr<Gfx::Font>);
private:
FontCache() = default;
diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h
index 8d44b124c6..78b6071d9c 100644
--- a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h
+++ b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h
@@ -16,7 +16,7 @@ public:
virtual ~BrowsingContextContainer() override;
BrowsingContext* nested_browsing_context() { return m_nested_browsing_context; }
- const BrowsingContext* nested_browsing_context() const { return m_nested_browsing_context; }
+ BrowsingContext const* nested_browsing_context() const { return m_nested_browsing_context; }
const DOM::Document* content_document() const;
DOM::Document const* content_document_without_origin_check() const;
diff --git a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
index 806cae33cc..d3994da800 100644
--- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
+++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
@@ -207,7 +207,7 @@ void CanvasRenderingContext2D::rotate(float radians)
m_drawing_state.transform.rotate_radians(radians);
}
-void CanvasRenderingContext2D::did_draw(const Gfx::FloatRect&)
+void CanvasRenderingContext2D::did_draw(Gfx::FloatRect const&)
{
// FIXME: Make use of the rect to reduce the invalidated area when possible.
if (!m_element)
@@ -230,7 +230,7 @@ OwnPtr<Gfx::Painter> CanvasRenderingContext2D::painter()
return make<Gfx::Painter>(*m_element->bitmap());
}
-void CanvasRenderingContext2D::fill_text(const String& text, float x, float y, Optional<double> max_width)
+void CanvasRenderingContext2D::fill_text(String const& text, float x, float y, Optional<double> max_width)
{
if (max_width.has_value() && max_width.value() <= 0)
return;
@@ -383,7 +383,7 @@ void CanvasRenderingContext2D::fill(Gfx::Painter::WindingRule winding)
did_draw(m_path.bounding_box());
}
-void CanvasRenderingContext2D::fill(const String& fill_rule)
+void CanvasRenderingContext2D::fill(String const& fill_rule)
{
if (fill_rule == "evenodd")
return fill(Gfx::Painter::WindingRule::EvenOdd);
@@ -439,7 +439,7 @@ DOM::ExceptionOr<RefPtr<ImageData>> CanvasRenderingContext2D::get_image_data(int
return image_data;
}
-void CanvasRenderingContext2D::put_image_data(const ImageData& image_data, float x, float y)
+void CanvasRenderingContext2D::put_image_data(ImageData const& image_data, float x, float y)
{
auto painter = this->painter();
if (!painter)
diff --git a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h
index ceacd1b5c8..f7465670b0 100644
--- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h
+++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h
@@ -72,16 +72,16 @@ public:
void rect(float x, float y, float width, float height);
void stroke();
- void fill_text(const String&, float x, float y, Optional<double> max_width);
+ void fill_text(String const&, float x, float y, Optional<double> max_width);
void stroke_text(String const&, float x, float y, Optional<double> max_width);
// FIXME: We should only have one fill(), really. Fix the wrapper generator!
void fill(Gfx::Painter::WindingRule);
- void fill(const String& fill_rule);
+ void fill(String const& fill_rule);
RefPtr<ImageData> create_image_data(int width, int height) const;
DOM::ExceptionOr<RefPtr<ImageData>> get_image_data(int x, int y, int width, int height) const;
- void put_image_data(const ImageData&, float x, float y);
+ void put_image_data(ImageData const&, float x, float y);
void save();
void restore();
@@ -112,7 +112,7 @@ private:
Gfx::IntRect bounding_box;
};
- void did_draw(const Gfx::FloatRect&);
+ void did_draw(Gfx::FloatRect const&);
PreparedText prepare_text(String const& text, float max_width = INFINITY);
OwnPtr<Gfx::Painter> painter();
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp
index 5d75290daa..ad0d688c6f 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp
@@ -37,7 +37,7 @@ void HTMLBodyElement::apply_presentational_hints(CSS::StyleProperties& style) co
});
}
-void HTMLBodyElement::parse_attribute(const FlyString& name, const String& value)
+void HTMLBodyElement::parse_attribute(FlyString const& name, String const& value)
{
HTMLElement::parse_attribute(name, value);
if (name.equals_ignoring_case("link")) {
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h
index 9bbb48ec2f..2aef6df4d5 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h
@@ -17,7 +17,7 @@ public:
HTMLBodyElement(DOM::Document&, DOM::QualifiedName);
virtual ~HTMLBodyElement() override;
- virtual void parse_attribute(const FlyString&, const String&) override;
+ virtual void parse_attribute(FlyString const&, String const&) override;
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
private:
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp
index 2f132faff9..1244c3dfc0 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp
@@ -59,7 +59,7 @@ CanvasRenderingContext2D* HTMLCanvasElement::get_context(String type)
return m_context;
}
-static Gfx::IntSize bitmap_size_for_canvas(const HTMLCanvasElement& canvas)
+static Gfx::IntSize bitmap_size_for_canvas(HTMLCanvasElement const& canvas)
{
auto width = canvas.width();
auto height = canvas.height();
@@ -94,7 +94,7 @@ bool HTMLCanvasElement::create_bitmap()
return m_bitmap;
}
-String HTMLCanvasElement::to_data_url(const String& type, [[maybe_unused]] Optional<double> quality) const
+String HTMLCanvasElement::to_data_url(String const& type, [[maybe_unused]] Optional<double> quality) const
{
if (!m_bitmap)
return {};
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.h b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.h
index d242c12adf..b6bda5884c 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.h
@@ -19,7 +19,7 @@ public:
HTMLCanvasElement(DOM::Document&, DOM::QualifiedName);
virtual ~HTMLCanvasElement() override;
- const Gfx::Bitmap* bitmap() const { return m_bitmap; }
+ Gfx::Bitmap const* bitmap() const { return m_bitmap; }
Gfx::Bitmap* bitmap() { return m_bitmap; }
bool create_bitmap();
@@ -31,7 +31,7 @@ public:
void set_width(unsigned);
void set_height(unsigned);
- String to_data_url(const String& type, Optional<double> quality) const;
+ String to_data_url(String const& type, Optional<double> quality) const;
private:
virtual RefPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
index b9523d51cf..748d85fc5e 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
@@ -78,7 +78,7 @@ String HTMLElement::content_editable() const
}
// https://html.spec.whatwg.org/multipage/interaction.html#contenteditable
-DOM::ExceptionOr<void> HTMLElement::set_content_editable(const String& content_editable)
+DOM::ExceptionOr<void> HTMLElement::set_content_editable(String const& content_editable)
{
if (content_editable.equals_ignoring_case("inherit")) {
remove_attribute(HTML::AttributeNames::contenteditable);
@@ -112,7 +112,7 @@ String HTMLElement::inner_text()
if (!layout_node())
return text_content();
- Function<void(const Layout::Node&)> recurse = [&](auto& node) {
+ Function<void(Layout::Node const&)> recurse = [&](auto& node) {
for (auto* child = node.first_child(); child; child = child->next_sibling()) {
if (is<Layout::TextNode>(child))
builder.append(verify_cast<Layout::TextNode>(*child).text_for_rendering());
@@ -168,7 +168,7 @@ bool HTMLElement::cannot_navigate() const
return !is<HTML::HTMLAnchorElement>(this) && !is_connected();
}
-void HTMLElement::parse_attribute(const FlyString& name, const String& value)
+void HTMLElement::parse_attribute(FlyString const& name, String const& value)
{
Element::parse_attribute(name, value);
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.h b/Userland/Libraries/LibWeb/HTML/HTMLElement.h
index 6e6239c56e..c4f0ba8bfc 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.h
@@ -26,7 +26,7 @@ public:
virtual bool is_editable() const final;
String content_editable() const;
- DOM::ExceptionOr<void> set_content_editable(const String&);
+ DOM::ExceptionOr<void> set_content_editable(String const&);
String inner_text();
void set_inner_text(StringView);
@@ -50,7 +50,7 @@ public:
virtual bool is_labelable() const { return false; }
protected:
- virtual void parse_attribute(const FlyString& name, const String& value) override;
+ virtual void parse_attribute(FlyString const& name, String const& value) override;
private:
// ^HTML::GlobalEventHandlers
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.h b/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.h
index cb3427e697..1cb3a6c06c 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.h
@@ -22,7 +22,7 @@ public:
HTMLFieldSetElement(DOM::Document&, DOM::QualifiedName);
virtual ~HTMLFieldSetElement() override;
- const String& type() const
+ String const& type() const
{
static String fieldset = "fieldset";
return fieldset;
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp
index 5879b7b4cf..163a457553 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp
@@ -25,7 +25,7 @@ RefPtr<Layout::Node> HTMLIFrameElement::create_layout_node(NonnullRefPtr<CSS::St
return adopt_ref(*new Layout::FrameBox(document(), *this, move(style)));
}
-void HTMLIFrameElement::parse_attribute(const FlyString& name, const String& value)
+void HTMLIFrameElement::parse_attribute(FlyString const& name, String const& value)
{
HTMLElement::parse_attribute(name, value);
if (name == HTML::AttributeNames::src)
@@ -56,7 +56,7 @@ void HTMLIFrameElement::removed_from(DOM::Node* node)
discard_nested_browsing_context();
}
-void HTMLIFrameElement::load_src(const String& value)
+void HTMLIFrameElement::load_src(String const& value)
{
if (!m_nested_browsing_context)
return;
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h
index 1276480fc9..34149e50ed 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h
@@ -22,9 +22,9 @@ public:
private:
virtual void inserted() override;
virtual void removed_from(Node*) override;
- virtual void parse_attribute(const FlyString& name, const String& value) override;
+ virtual void parse_attribute(FlyString const& name, String const& value) override;
- void load_src(const String&);
+ void load_src(String const&);
};
void run_iframe_load_event_steps(HTML::HTMLIFrameElement&);
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp
index bf05d8983e..17fdca1b91 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp
@@ -70,7 +70,7 @@ void HTMLImageElement::apply_presentational_hints(CSS::StyleProperties& style) c
});
}
-void HTMLImageElement::parse_attribute(const FlyString& name, const String& value)
+void HTMLImageElement::parse_attribute(FlyString const& name, String const& value)
{
HTMLElement::parse_attribute(name, value);
@@ -83,7 +83,7 @@ RefPtr<Layout::Node> HTMLImageElement::create_layout_node(NonnullRefPtr<CSS::Sty
return adopt_ref(*new Layout::ImageBox(document(), *this, move(style), m_image_loader));
}
-const Gfx::Bitmap* HTMLImageElement::bitmap() const
+Gfx::Bitmap const* HTMLImageElement::bitmap() const
{
return m_image_loader.bitmap(m_image_loader.current_frame_index());
}
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h
index e488e96f58..c7b46db958 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h
@@ -26,12 +26,12 @@ public:
HTMLImageElement(DOM::Document&, DOM::QualifiedName);
virtual ~HTMLImageElement() override;
- virtual void parse_attribute(const FlyString& name, const String& value) override;
+ virtual void parse_attribute(FlyString const& name, String const& value) override;
String alt() const { return attribute(HTML::AttributeNames::alt); }
String src() const { return attribute(HTML::AttributeNames::src); }
- const Gfx::Bitmap* bitmap() const;
+ Gfx::Bitmap const* bitmap() const;
unsigned width() const;
void set_width(unsigned);
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp
index b1f835e43b..acebc098f8 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp
@@ -53,7 +53,7 @@ void HTMLLinkElement::inserted()
}
}
-void HTMLLinkElement::parse_attribute(const FlyString& name, const String& value)
+void HTMLLinkElement::parse_attribute(FlyString const& name, String const& value)
{
if (name == HTML::AttributeNames::rel) {
m_relationship = 0;
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h
index 9a5153f9db..f033b27d0a 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h
@@ -29,7 +29,7 @@ public:
String href() const { return attribute(HTML::AttributeNames::href); }
private:
- void parse_attribute(const FlyString&, const String&) override;
+ void parse_attribute(FlyString const&, String const&) override;
// ^ResourceClient
virtual void resource_did_fail() override;
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp
index 0b324c3f05..8c59e43d23 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp
@@ -23,7 +23,7 @@ HTMLObjectElement::HTMLObjectElement(DOM::Document& document, DOM::QualifiedName
HTMLObjectElement::~HTMLObjectElement() = default;
-void HTMLObjectElement::parse_attribute(const FlyString& name, const String& value)
+void HTMLObjectElement::parse_attribute(FlyString const& name, String const& value)
{
BrowsingContextContainer::parse_attribute(name, value);
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h
index 34cb9c4a3a..9b8b7aa558 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h
@@ -34,7 +34,7 @@ public:
HTMLObjectElement(DOM::Document&, DOM::QualifiedName);
virtual ~HTMLObjectElement() override;
- virtual void parse_attribute(const FlyString& name, const String& value) override;
+ virtual void parse_attribute(FlyString const& name, String const& value) override;
String data() const;
void set_data(String const& data) { set_attribute(HTML::AttributeNames::data, data); }
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.h b/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.h
index 3e38612e8e..fb3ad802d0 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.h
@@ -23,7 +23,7 @@ public:
HTMLOutputElement(DOM::Document&, DOM::QualifiedName);
virtual ~HTMLOutputElement() override;
- const String& type() const
+ String const& type() const
{
static String output = "output";
return output;
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
index 71ab5b1eb9..32fa015405 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
@@ -99,7 +99,7 @@ void HTMLScriptElement::execute_script()
}
// https://mimesniff.spec.whatwg.org/#javascript-mime-type-essence-match
-static bool is_javascript_mime_type_essence_match(const String& string)
+static bool is_javascript_mime_type_essence_match(String const& string)
{
auto lowercase_string = string.to_lowercase();
return lowercase_string.is_one_of("application/ecmascript", "application/javascript", "application/x-ecmascript", "application/x-javascript", "text/ecmascript", "text/javascript", "text/javascript1.0", "text/javascript1.1", "text/javascript1.2", "text/javascript1.3", "text/javascript1.4", "text/javascript1.5", "text/jscript", "text/livescript", "text/x-ecmascript", "text/x-javascript");
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.h
index d2eb8509cd..b00dc90bf7 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.h
@@ -19,7 +19,7 @@ public:
virtual ~HTMLTemplateElement() override;
NonnullRefPtr<DOM::DocumentFragment> content() { return *m_content; }
- const NonnullRefPtr<DOM::DocumentFragment> content() const { return *m_content; }
+ NonnullRefPtr<DOM::DocumentFragment> const content() const { return *m_content; }
virtual void adopted_from(DOM::Document&) override;
virtual void cloned(Node& copy, bool clone_children) override;
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.h
index 23c3148b7e..f8705b2551 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.h
@@ -23,7 +23,7 @@ public:
HTMLTextAreaElement(DOM::Document&, DOM::QualifiedName);
virtual ~HTMLTextAreaElement() override;
- const String& type() const
+ String const& type() const
{
static String textarea = "textarea";
return textarea;
diff --git a/Userland/Libraries/LibWeb/HTML/ImageData.h b/Userland/Libraries/LibWeb/HTML/ImageData.h
index ed14a5852e..9f5c14d7c0 100644
--- a/Userland/Libraries/LibWeb/HTML/ImageData.h
+++ b/Userland/Libraries/LibWeb/HTML/ImageData.h
@@ -26,7 +26,7 @@ public:
unsigned height() const;
Gfx::Bitmap& bitmap() { return m_bitmap; }
- const Gfx::Bitmap& bitmap() const { return m_bitmap; }
+ Gfx::Bitmap const& bitmap() const { return m_bitmap; }
JS::Uint8ClampedArray* data();
const JS::Uint8ClampedArray* data() const;
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp
index 2a9b622df5..f492a4170f 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp
@@ -16,17 +16,17 @@
namespace Web::HTML {
-bool prescan_should_abort(const ByteBuffer& input, const size_t& position)
+bool prescan_should_abort(ByteBuffer const& input, size_t const& position)
{
return position >= input.size() || position >= 1024;
}
-bool prescan_is_whitespace_or_slash(const u8& byte)
+bool prescan_is_whitespace_or_slash(u8 const& byte)
{
return byte == '\t' || byte == '\n' || byte == '\f' || byte == '\r' || byte == ' ' || byte == '/';
}
-bool prescan_skip_whitespace_and_slashes(const ByteBuffer& input, size_t& position)
+bool prescan_skip_whitespace_and_slashes(ByteBuffer const& input, size_t& position)
{
while (!prescan_should_abort(input, position) && (input[position] == '\t' || input[position] == '\n' || input[position] == '\f' || input[position] == '\r' || input[position] == ' ' || input[position] == '/'))
++position;
@@ -96,7 +96,7 @@ Optional<StringView> extract_character_encoding_from_meta_element(String const&
return TextCodec::get_standardized_encoding(encoding);
}
-RefPtr<DOM::Attribute> prescan_get_attribute(DOM::Document& document, const ByteBuffer& input, size_t& position)
+RefPtr<DOM::Attribute> prescan_get_attribute(DOM::Document& document, ByteBuffer const& input, size_t& position)
{
if (!prescan_skip_whitespace_and_slashes(input, position))
return {};
@@ -160,7 +160,7 @@ value:
}
// https://html.spec.whatwg.org/multipage/parsing.html#prescan-a-byte-stream-to-determine-its-encoding
-Optional<String> run_prescan_byte_stream_algorithm(DOM::Document& document, const ByteBuffer& input)
+Optional<String> run_prescan_byte_stream_algorithm(DOM::Document& document, ByteBuffer const& input)
{
// https://html.spec.whatwg.org/multipage/parsing.html#prescan-a-byte-stream-to-determine-its-encoding
@@ -249,7 +249,7 @@ Optional<String> run_prescan_byte_stream_algorithm(DOM::Document& document, cons
}
// https://html.spec.whatwg.org/multipage/parsing.html#determining-the-character-encoding
-String run_encoding_sniffing_algorithm(DOM::Document& document, const ByteBuffer& input)
+String run_encoding_sniffing_algorithm(DOM::Document& document, ByteBuffer const& input)
{
if (input.size() >= 2) {
if (input[0] == 0xFE && input[1] == 0xFF) {
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.h b/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.h
index e388b68d99..6cb9fc7e31 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.h
+++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.h
@@ -12,12 +12,12 @@
namespace Web::HTML {
-bool prescan_should_abort(const ByteBuffer& input, const size_t& position);
-bool prescan_is_whitespace_or_slash(const u8& byte);
-bool prescan_skip_whitespace_and_slashes(const ByteBuffer& input, size_t& position);
+bool prescan_should_abort(ByteBuffer const& input, size_t const& position);
+bool prescan_is_whitespace_or_slash(u8 const& byte);
+bool prescan_skip_whitespace_and_slashes(ByteBuffer const& input, size_t& position);
Optional<StringView> extract_character_encoding_from_meta_element(String const&);
-RefPtr<DOM::Attribute> prescan_get_attribute(DOM::Document&, const ByteBuffer& input, size_t& position);
-Optional<String> run_prescan_byte_stream_algorithm(DOM::Document&, const ByteBuffer& input);
-String run_encoding_sniffing_algorithm(DOM::Document&, const ByteBuffer& input);
+RefPtr<DOM::Attribute> prescan_get_attribute(DOM::Document&, ByteBuffer const& input, size_t& position);
+Optional<String> run_prescan_byte_stream_algorithm(DOM::Document&, ByteBuffer const& input);
+String run_encoding_sniffing_algorithm(DOM::Document&, ByteBuffer const& input);
}
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp
index ba5e00dc13..7e59679b08 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp
@@ -32,7 +32,7 @@
namespace Web::HTML {
-static inline void log_parse_error(const SourceLocation& location = SourceLocation::current())
+static inline void log_parse_error(SourceLocation const& location = SourceLocation::current())
{
dbgln("Parse error! {}", location);
}
@@ -118,7 +118,7 @@ static bool is_html_integration_point(DOM::Element const& element)
return false;
}
-RefPtr<DOM::Document> parse_html_document(StringView data, const AK::URL& url, const String& encoding)
+RefPtr<DOM::Document> parse_html_document(StringView data, const AK::URL& url, String const& encoding)
{
auto document = DOM::Document::create(url);
auto parser = HTMLParser::create(document, data, encoding);
@@ -126,7 +126,7 @@ RefPtr<DOM::Document> parse_html_document(StringView data, const AK::URL& url, c
return document;
}
-HTMLParser::HTMLParser(DOM::Document& document, StringView input, const String& encoding)
+HTMLParser::HTMLParser(DOM::Document& document, StringView input, String const& encoding)
: m_tokenizer(input, encoding)
, m_document(document)
{
@@ -389,7 +389,7 @@ void HTMLParser::process_using_the_rules_for(InsertionMode mode, HTMLToken& toke
}
}
-DOM::QuirksMode HTMLParser::which_quirks_mode(const HTMLToken& doctype_token) const
+DOM::QuirksMode HTMLParser::which_quirks_mode(HTMLToken const& doctype_token) const
{
if (doctype_token.doctype_data().force_quirks)
return DOM::QuirksMode::Yes;
@@ -651,7 +651,7 @@ NonnullRefPtr<DOM::Element> HTMLParser::create_element_for(HTMLToken const& toke
}
// https://html.spec.whatwg.org/multipage/parsing.html#insert-a-foreign-element
-NonnullRefPtr<DOM::Element> HTMLParser::insert_foreign_element(const HTMLToken& token, const FlyString& namespace_)
+NonnullRefPtr<DOM::Element> HTMLParser::insert_foreign_element(HTMLToken const& token, FlyString const& namespace_)
{
auto adjusted_insertion_location = find_appropriate_place_for_inserting_node();
@@ -677,7 +677,7 @@ NonnullRefPtr<DOM::Element> HTMLParser::insert_foreign_element(const HTMLToken&
return element;
}
-NonnullRefPtr<DOM::Element> HTMLParser::insert_html_element(const HTMLToken& token)
+NonnullRefPtr<DOM::Element> HTMLParser::insert_html_element(HTMLToken const& token)
{
return insert_foreign_element(token, Namespace::HTML);
}
@@ -1011,7 +1011,7 @@ AnythingElse:
process_using_the_rules_for(m_insertion_mode, token);
}
-void HTMLParser::generate_implied_end_tags(const FlyString& exception)
+void HTMLParser::generate_implied_end_tags(FlyString const& exception)
{
while (current_node().local_name() != exception && current_node().local_name().is_one_of(HTML::TagNames::dd, HTML::TagNames::dt, HTML::TagNames::li, HTML::TagNames::optgroup, HTML::TagNames::option, HTML::TagNames::p, HTML::TagNames::rb, HTML::TagNames::rp, HTML::TagNames::rt, HTML::TagNames::rtc))
(void)m_stack_of_open_elements.pop();
@@ -1335,7 +1335,7 @@ HTMLParser::AdoptionAgencyAlgorithmOutcome HTMLParser::run_the_adoption_agency_a
}
}
-bool HTMLParser::is_special_tag(const FlyString& tag_name, const FlyString& namespace_)
+bool HTMLParser::is_special_tag(FlyString const& tag_name, FlyString const& namespace_)
{
if (namespace_ == Namespace::HTML) {
return tag_name.is_one_of(
@@ -3357,7 +3357,7 @@ void HTMLParser::reset_the_insertion_mode_appropriately()
m_insertion_mode = InsertionMode::InBody;
}
-const char* HTMLParser::insertion_mode_name() const
+char const* HTMLParser::insertion_mode_name() const
{
switch (m_insertion_mode) {
#define __ENUMERATE_INSERTION_MODE(mode) \
@@ -3430,7 +3430,7 @@ NonnullRefPtr<HTMLParser> HTMLParser::create_for_scripting(DOM::Document& docume
return adopt_ref(*new HTMLParser(document));
}
-NonnullRefPtr<HTMLParser> HTMLParser::create_with_uncertain_encoding(DOM::Document& document, const ByteBuffer& input)
+NonnullRefPtr<HTMLParser> HTMLParser::create_with_uncertain_encoding(DOM::Document& document, ByteBuffer const& input)
{
if (document.has_encoding())
return adopt_ref(*new HTMLParser(document, input, document.encoding().value()));
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.h b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.h
index 7fbfb363d6..81d0e46dd3 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.h
+++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.h
@@ -39,7 +39,7 @@ namespace Web::HTML {
__ENUMERATE_INSERTION_MODE(AfterAfterBody) \
__ENUMERATE_INSERTION_MODE(AfterAfterFrameset)
-RefPtr<DOM::Document> parse_html_document(StringView, const AK::URL&, const String& encoding);
+RefPtr<DOM::Document> parse_html_document(StringView, const AK::URL&, String const& encoding);
class HTMLParser : public RefCounted<HTMLParser> {
friend class HTMLTokenizer;
@@ -67,7 +67,7 @@ public:
InsertionMode insertion_mode() const { return m_insertion_mode; }
- static bool is_special_tag(const FlyString& tag_name, const FlyString& namespace_);
+ static bool is_special_tag(FlyString const& tag_name, FlyString const& namespace_);
HTMLTokenizer& tokenizer() { return m_tokenizer; }
@@ -76,12 +76,12 @@ public:
size_t script_nesting_level() const { return m_script_nesting_level; }
private:
- HTMLParser(DOM::Document&, StringView input, const String& encoding);
+ HTMLParser(DOM::Document&, StringView input, String const& encoding);
HTMLParser(DOM::Document&);
- const char* insertion_mode_name() const;
+ char const* insertion_mode_name() const;
- DOM::QuirksMode which_quirks_mode(const HTMLToken&) const;
+ DOM::QuirksMode which_quirks_mode(HTMLToken const&) const;
void handle_initial(HTMLToken&);
void handle_before_html(HTMLToken&);
@@ -111,7 +111,7 @@ private:
void stop_parsing() { m_stop_parsing = true; }
- void generate_implied_end_tags(const FlyString& exception = {});
+ void generate_implied_end_tags(FlyString const& exception = {});
void generate_all_implied_end_tags_thoroughly();
NonnullRefPtr<DOM::Element> create_element_for(HTMLToken const&, FlyString const& namespace_, DOM::Node const& intended_parent);
@@ -124,8 +124,8 @@ private:
DOM::Text* find_character_insertion_node();
void flush_character_insertions();
- NonnullRefPtr<DOM::Element> insert_foreign_element(const HTMLToken&, const FlyString&);
- NonnullRefPtr<DOM::Element> insert_html_element(const HTMLToken&);
+ NonnullRefPtr<DOM::Element> insert_foreign_element(HTMLToken const&, FlyString const&);
+ NonnullRefPtr<DOM::Element> insert_html_element(HTMLToken const&);
DOM::Element& current_node();
DOM::Element& adjusted_current_node();
DOM::Element& node_before_current_node();
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.cpp b/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.cpp
index 838f147df6..1d2453aad6 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.cpp
@@ -31,7 +31,7 @@ bool ListOfActiveFormattingElements::contains(const DOM::Element& element) const
return false;
}
-DOM::Element* ListOfActiveFormattingElements::last_element_with_tag_name_before_marker(const FlyString& tag_name)
+DOM::Element* ListOfActiveFormattingElements::last_element_with_tag_name_before_marker(FlyString const& tag_name)
{
for (ssize_t i = m_entries.size() - 1; i >= 0; --i) {
auto& entry = m_entries[i];
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.h b/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.h
index 9476e28497..bf8293d1f5 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.h
+++ b/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.h
@@ -34,10 +34,10 @@ public:
void remove(DOM::Element&);
- const Vector<Entry>& entries() const { return m_entries; }
+ Vector<Entry> const& entries() const { return m_entries; }
Vector<Entry>& entries() { return m_entries; }
- DOM::Element* last_element_with_tag_name_before_marker(const FlyString& tag_name);
+ DOM::Element* last_element_with_tag_name_before_marker(FlyString const& tag_name);
void clear_up_to_the_last_marker();
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp b/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp
index f71b35cdaf..f67c64305d 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp
@@ -14,7 +14,7 @@ static Vector<FlyString> s_base_list { "applet", "caption", "html", "table", "td
StackOfOpenElements::~StackOfOpenElements() = default;
-bool StackOfOpenElements::has_in_scope_impl(const FlyString& tag_name, const Vector<FlyString>& list) const
+bool StackOfOpenElements::has_in_scope_impl(FlyString const& tag_name, Vector<FlyString> const& list) const
{
for (ssize_t i = m_elements.size() - 1; i >= 0; --i) {
auto& node = m_elements.at(i);
@@ -26,12 +26,12 @@ bool StackOfOpenElements::has_in_scope_impl(const FlyString& tag_name, const Vec
VERIFY_NOT_REACHED();
}
-bool StackOfOpenElements::has_in_scope(const FlyString& tag_name) const
+bool StackOfOpenElements::has_in_scope(FlyString const& tag_name) const
{
return has_in_scope_impl(tag_name, s_base_list);
}
-bool StackOfOpenElements::has_in_scope_impl(const DOM::Element& target_node, const Vector<FlyString>& list) const
+bool StackOfOpenElements::has_in_scope_impl(const DOM::Element& target_node, Vector<FlyString> const& list) const
{
for (ssize_t i = m_elements.size() - 1; i >= 0; --i) {
auto& node = m_elements.at(i);
@@ -48,19 +48,19 @@ bool StackOfOpenElements::has_in_scope(const DOM::Element& target_node) const
return has_in_scope_impl(target_node, s_base_list);
}
-bool StackOfOpenElements::has_in_button_scope(const FlyString& tag_name) const
+bool StackOfOpenElements::has_in_button_scope(FlyString const& tag_name) const
{
auto list = s_base_list;
list.append("button");
return has_in_scope_impl(tag_name, list);
}
-bool StackOfOpenElements::has_in_table_scope(const FlyString& tag_name) const
+bool StackOfOpenElements::has_in_table_scope(FlyString const& tag_name) const
{
return has_in_scope_impl(tag_name, { "html", "table", "template" });
}
-bool StackOfOpenElements::has_in_list_item_scope(const FlyString& tag_name) const
+bool StackOfOpenElements::has_in_list_item_scope(FlyString const& tag_name) const
{
auto list = s_base_list;
list.append("ol");
@@ -74,7 +74,7 @@ bool StackOfOpenElements::has_in_list_item_scope(const FlyString& tag_name) cons
// - optgroup in the HTML namespace
// - option in the HTML namespace
// NOTE: In this case it's "all element types _except_"
-bool StackOfOpenElements::has_in_select_scope(const FlyString& tag_name) const
+bool StackOfOpenElements::has_in_select_scope(FlyString const& tag_name) const
{
// https://html.spec.whatwg.org/multipage/parsing.html#has-an-element-in-the-specific-scope
for (ssize_t i = m_elements.size() - 1; i >= 0; --i) {
@@ -103,7 +103,7 @@ bool StackOfOpenElements::contains(const DOM::Element& element) const
return false;
}
-bool StackOfOpenElements::contains(const FlyString& tag_name) const
+bool StackOfOpenElements::contains(FlyString const& tag_name) const
{
for (auto& element_on_stack : m_elements) {
if (element_on_stack.local_name() == tag_name)
@@ -112,7 +112,7 @@ bool StackOfOpenElements::contains(const FlyString& tag_name) const
return false;
}
-void StackOfOpenElements::pop_until_an_element_with_tag_name_has_been_popped(const FlyString& tag_name)
+void StackOfOpenElements::pop_until_an_element_with_tag_name_has_been_popped(FlyString const& tag_name)
{
while (m_elements.last().local_name() != tag_name)
(void)pop();
@@ -132,7 +132,7 @@ DOM::Element* StackOfOpenElements::topmost_special_node_below(const DOM::Element
return found_element;
}
-StackOfOpenElements::LastElementResult StackOfOpenElements::last_element_with_tag_name(const FlyString& tag_name)
+StackOfOpenElements::LastElementResult StackOfOpenElements::last_element_with_tag_name(FlyString const& tag_name)
{
for (ssize_t i = m_elements.size() - 1; i >= 0; --i) {
auto& element = m_elements[i];
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h b/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h
index 8c6baae04a..726d7018de 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h
+++ b/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h
@@ -36,21 +36,21 @@ public:
const DOM::Element& current_node() const { return m_elements.last(); }
DOM::Element& current_node() { return m_elements.last(); }
- bool has_in_scope(const FlyString& tag_name) const;
- bool has_in_button_scope(const FlyString& tag_name) const;
- bool has_in_table_scope(const FlyString& tag_name) const;
- bool has_in_list_item_scope(const FlyString& tag_name) const;
- bool has_in_select_scope(const FlyString& tag_name) const;
+ bool has_in_scope(FlyString const& tag_name) const;
+ bool has_in_button_scope(FlyString const& tag_name) const;
+ bool has_in_table_scope(FlyString const& tag_name) const;
+ bool has_in_list_item_scope(FlyString const& tag_name) const;
+ bool has_in_select_scope(FlyString const& tag_name) const;
bool has_in_scope(const DOM::Element&) const;
bool contains(const DOM::Element&) const;
- bool contains(const FlyString& tag_name) const;
+ bool contains(FlyString const& tag_name) const;
- const NonnullRefPtrVector<DOM::Element>& elements() const { return m_elements; }
+ NonnullRefPtrVector<DOM::Element> const& elements() const { return m_elements; }
NonnullRefPtrVector<DOM::Element>& elements() { return m_elements; }
- void pop_until_an_element_with_tag_name_has_been_popped(const FlyString&);
+ void pop_until_an_element_with_tag_name_has_been_popped(FlyString const&);
DOM::Element* topmost_special_node_below(const DOM::Element&);
@@ -58,12 +58,12 @@ public:
DOM::Element* element;
ssize_t index;
};
- LastElementResult last_element_with_tag_name(const FlyString&);
+ LastElementResult last_element_with_tag_name(FlyString const&);
DOM::Element* element_immediately_above(DOM::Element const&);
private:
- bool has_in_scope_impl(const FlyString& tag_name, const Vector<FlyString>&) const;
- bool has_in_scope_impl(const DOM::Element& target_node, const Vector<FlyString>&) const;
+ bool has_in_scope_impl(FlyString const& tag_name, Vector<FlyString> const&) const;
+ bool has_in_scope_impl(const DOM::Element& target_node, Vector<FlyString> const&) const;
NonnullRefPtrVector<DOM::Element> m_elements;
};
diff --git a/Userland/Libraries/LibWeb/InProcessWebView.cpp b/Userland/Libraries/LibWeb/InProcessWebView.cpp
index 688b0994cb..3ecd087454 100644
--- a/Userland/Libraries/LibWeb/InProcessWebView.cpp
+++ b/Userland/Libraries/LibWeb/InProcessWebView.cpp
@@ -64,7 +64,7 @@ void InProcessWebView::page_did_layout()
set_content_size(layout_root()->paint_box()->content_size().to_type<int>());
}
-void InProcessWebView::page_did_change_title(const String& title)
+void InProcessWebView::page_did_change_title(String const& title)
{
if (on_title_change)
on_title_change(title);
@@ -101,19 +101,19 @@ void InProcessWebView::page_did_request_cursor_change(Gfx::StandardCursor cursor
set_override_cursor(cursor);
}
-void InProcessWebView::page_did_request_context_menu(const Gfx::IntPoint& content_position)
+void InProcessWebView::page_did_request_context_menu(Gfx::IntPoint const& content_position)
{
if (on_context_menu_request)
on_context_menu_request(screen_relative_rect().location().translated(to_widget_position(content_position)));
}
-void InProcessWebView::page_did_request_link_context_menu(const Gfx::IntPoint& content_position, const AK::URL& url, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers)
+void InProcessWebView::page_did_request_link_context_menu(Gfx::IntPoint const& content_position, const AK::URL& url, [[maybe_unused]] String const& target, [[maybe_unused]] unsigned modifiers)
{
if (on_link_context_menu_request)
on_link_context_menu_request(url, screen_relative_rect().location().translated(to_widget_position(content_position)));
}
-void InProcessWebView::page_did_request_image_context_menu(const Gfx::IntPoint& content_position, const AK::URL& url, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers, const Gfx::Bitmap* bitmap)
+void InProcessWebView::page_did_request_image_context_menu(Gfx::IntPoint const& content_position, const AK::URL& url, [[maybe_unused]] String const& target, [[maybe_unused]] unsigned modifiers, Gfx::Bitmap const* bitmap)
{
if (!on_image_context_menu_request)
return;
@@ -123,19 +123,19 @@ void InProcessWebView::page_did_request_image_context_menu(const Gfx::IntPoint&
on_image_context_menu_request(url, screen_relative_rect().location().translated(to_widget_position(content_position)), move(shareable_bitmap));
}
-void InProcessWebView::page_did_click_link(const AK::URL& url, const String& target, unsigned modifiers)
+void InProcessWebView::page_did_click_link(const AK::URL& url, String const& target, unsigned modifiers)
{
if (on_link_click)
on_link_click(url, target, modifiers);
}
-void InProcessWebView::page_did_middle_click_link(const AK::URL& url, const String& target, unsigned modifiers)
+void InProcessWebView::page_did_middle_click_link(const AK::URL& url, String const& target, unsigned modifiers)
{
if (on_link_middle_click)
on_link_middle_click(url, target, modifiers);
}
-void InProcessWebView::page_did_enter_tooltip_area([[maybe_unused]] const Gfx::IntPoint& content_position, const String& title)
+void InProcessWebView::page_did_enter_tooltip_area([[maybe_unused]] Gfx::IntPoint const& content_position, String const& title)
{
GUI::Application::the()->show_tooltip(title, nullptr);
}
@@ -157,12 +157,12 @@ void InProcessWebView::page_did_unhover_link()
on_link_hover({});
}
-void InProcessWebView::page_did_invalidate(const Gfx::IntRect&)
+void InProcessWebView::page_did_invalidate(Gfx::IntRect const&)
{
update();
}
-void InProcessWebView::page_did_change_favicon(const Gfx::Bitmap& bitmap)
+void InProcessWebView::page_did_change_favicon(Gfx::Bitmap const& bitmap)
{
if (on_favicon_change)
on_favicon_change(bitmap);
@@ -306,7 +306,7 @@ bool InProcessWebView::load(const AK::URL& url)
return page().top_level_browsing_context().loader().load(url, FrameLoader::Type::Navigation);
}
-const Layout::InitialContainingBlock* InProcessWebView::layout_root() const
+Layout::InitialContainingBlock const* InProcessWebView::layout_root() const
{
return document() ? document()->layout_node() : nullptr;
}
@@ -318,7 +318,7 @@ Layout::InitialContainingBlock* InProcessWebView::layout_root()
return const_cast<Layout::InitialContainingBlock*>(document()->layout_node());
}
-void InProcessWebView::page_did_request_scroll_into_view(const Gfx::IntRect& rect)
+void InProcessWebView::page_did_request_scroll_into_view(Gfx::IntRect const& rect)
{
scroll_into_view(rect, true, true);
set_override_cursor(Gfx::StandardCursor::None);
@@ -360,18 +360,18 @@ void InProcessWebView::drop_event(GUI::DropEvent& event)
AbstractScrollableWidget::drop_event(event);
}
-void InProcessWebView::page_did_request_alert(const String& message)
+void InProcessWebView::page_did_request_alert(String const& message)
{
GUI::MessageBox::show(window(), message, "Alert", GUI::MessageBox::Type::Information);
}
-bool InProcessWebView::page_did_request_confirm(const String& message)
+bool InProcessWebView::page_did_request_confirm(String const& message)
{
auto confirm_result = GUI::MessageBox::show(window(), message, "Confirm", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel);
return confirm_result == GUI::Dialog::ExecResult::ExecOK;
}
-String InProcessWebView::page_did_request_prompt(const String& message, const String& default_)
+String InProcessWebView::page_did_request_prompt(String const& message, String const& default_)
{
String value { default_ };
if (GUI::InputBox::show(window(), value, message, "Prompt") == GUI::InputBox::ExecOK)
@@ -386,7 +386,7 @@ String InProcessWebView::page_did_request_cookie(const AK::URL& url, Cookie::Sou
return {};
}
-void InProcessWebView::page_did_set_cookie(const AK::URL& url, const Cookie::ParsedCookie& cookie, Cookie::Source source)
+void InProcessWebView::page_did_set_cookie(const AK::URL& url, Cookie::ParsedCookie const& cookie, Cookie::Source source)
{
if (on_set_cookie)
on_set_cookie(url, cookie, source);
diff --git a/Userland/Libraries/LibWeb/InProcessWebView.h b/Userland/Libraries/LibWeb/InProcessWebView.h
index b51a384e2c..c62cd6fbdc 100644
--- a/Userland/Libraries/LibWeb/InProcessWebView.h
+++ b/Userland/Libraries/LibWeb/InProcessWebView.h
@@ -32,7 +32,7 @@ public:
void set_document(DOM::Document*);
- const Layout::InitialContainingBlock* layout_root() const;
+ Layout::InitialContainingBlock const* layout_root() const;
Layout::InitialContainingBlock* layout_root();
void reload();
@@ -50,7 +50,7 @@ private:
InProcessWebView();
Page& page() { return *m_page; }
- const Page& page() const { return *m_page; }
+ Page const& page() const { return *m_page; }
virtual void resize_event(GUI::ResizeEvent&) override;
virtual void paint_event(GUI::PaintEvent&) override;
@@ -67,30 +67,30 @@ private:
virtual Gfx::Palette palette() const override { return GUI::AbstractScrollableWidget::palette(); }
virtual Gfx::IntRect screen_rect() const override { return GUI::Desktop::the().rect(); }
virtual CSS::PreferredColorScheme preferred_color_scheme() const override { return m_preferred_color_scheme; }
- virtual void page_did_change_title(const String&) override;
+ virtual void page_did_change_title(String const&) override;
virtual void page_did_set_document_in_top_level_browsing_context(DOM::Document*) override;
virtual void page_did_start_loading(const AK::URL&) override;
virtual void page_did_finish_loading(const AK::URL&) override;
virtual void page_did_change_selection() override;
virtual void page_did_request_cursor_change(Gfx::StandardCursor) override;
- virtual void page_did_request_context_menu(const Gfx::IntPoint&) override;
- virtual void page_did_request_link_context_menu(const Gfx::IntPoint&, const AK::URL&, const String& target, unsigned modifiers) override;
- virtual void page_did_request_image_context_menu(const Gfx::IntPoint&, const AK::URL&, const String& target, unsigned modifiers, const Gfx::Bitmap*) override;
- virtual void page_did_click_link(const AK::URL&, const String& target, unsigned modifiers) override;
- virtual void page_did_middle_click_link(const AK::URL&, const String& target, unsigned modifiers) override;
- virtual void page_did_enter_tooltip_area(const Gfx::IntPoint&, const String&) override;
+ virtual void page_did_request_context_menu(Gfx::IntPoint const&) override;
+ virtual void page_did_request_link_context_menu(Gfx::IntPoint const&, const AK::URL&, String const& target, unsigned modifiers) override;
+ virtual void page_did_request_image_context_menu(Gfx::IntPoint const&, const AK::URL&, String const& target, unsigned modifiers, Gfx::Bitmap const*) override;
+ virtual void page_did_click_link(const AK::URL&, String const& target, unsigned modifiers) override;
+ virtual void page_did_middle_click_link(const AK::URL&, String const& target, unsigned modifiers) override;
+ virtual void page_did_enter_tooltip_area(Gfx::IntPoint const&, String const&) override;
virtual void page_did_leave_tooltip_area() override;
virtual void page_did_hover_link(const AK::URL&) override;
virtual void page_did_unhover_link() override;
- virtual void page_did_invalidate(const Gfx::IntRect&) override;
- virtual void page_did_change_favicon(const Gfx::Bitmap&) override;
+ virtual void page_did_invalidate(Gfx::IntRect const&) override;
+ virtual void page_did_change_favicon(Gfx::Bitmap const&) override;
virtual void page_did_layout() override;
- virtual void page_did_request_scroll_into_view(const Gfx::IntRect&) override;
- virtual void page_did_request_alert(const String&) override;
- virtual bool page_did_request_confirm(const String&) override;
- virtual String page_did_request_prompt(const String&, const String&) override;
+ virtual void page_did_request_scroll_into_view(Gfx::IntRect const&) override;
+ virtual void page_did_request_alert(String const&) override;
+ virtual bool page_did_request_confirm(String const&) override;
+ virtual String page_did_request_prompt(String const&, String const&) override;
virtual String page_did_request_cookie(const AK::URL&, Cookie::Source) override;
- virtual void page_did_set_cookie(const AK::URL&, const Cookie::ParsedCookie&, Cookie::Source) override;
+ virtual void page_did_set_cookie(const AK::URL&, Cookie::ParsedCookie const&, Cookie::Source) override;
void layout_and_sync_size();
diff --git a/Userland/Libraries/LibWeb/Layout/BlockContainer.cpp b/Userland/Libraries/LibWeb/Layout/BlockContainer.cpp
index d958c55d3b..e46bbda70d 100644
--- a/Userland/Libraries/LibWeb/Layout/BlockContainer.cpp
+++ b/Userland/Libraries/LibWeb/Layout/BlockContainer.cpp
@@ -27,7 +27,7 @@ bool BlockContainer::is_scrollable() const
return computed_values().overflow_y() == CSS::Overflow::Scroll;
}
-void BlockContainer::set_scroll_offset(const Gfx::FloatPoint& offset)
+void BlockContainer::set_scroll_offset(Gfx::FloatPoint const& offset)
{
// FIXME: If there is horizontal and vertical scroll ignore only part of the new offset
if (offset.y() < 0 || m_scroll_offset == offset)
diff --git a/Userland/Libraries/LibWeb/Layout/BlockContainer.h b/Userland/Libraries/LibWeb/Layout/BlockContainer.h
index fbff185595..0735a45553 100644
--- a/Userland/Libraries/LibWeb/Layout/BlockContainer.h
+++ b/Userland/Libraries/LibWeb/Layout/BlockContainer.h
@@ -19,13 +19,13 @@ public:
virtual ~BlockContainer() override;
BlockContainer* previous_sibling() { return verify_cast<BlockContainer>(Node::previous_sibling()); }
- const BlockContainer* previous_sibling() const { return verify_cast<BlockContainer>(Node::previous_sibling()); }
+ BlockContainer const* previous_sibling() const { return verify_cast<BlockContainer>(Node::previous_sibling()); }
BlockContainer* next_sibling() { return verify_cast<BlockContainer>(Node::next_sibling()); }
- const BlockContainer* next_sibling() const { return verify_cast<BlockContainer>(Node::next_sibling()); }
+ BlockContainer const* next_sibling() const { return verify_cast<BlockContainer>(Node::next_sibling()); }
bool is_scrollable() const;
- const Gfx::FloatPoint& scroll_offset() const { return m_scroll_offset; }
- void set_scroll_offset(const Gfx::FloatPoint&);
+ Gfx::FloatPoint const& scroll_offset() const { return m_scroll_offset; }
+ void set_scroll_offset(Gfx::FloatPoint const&);
Painting::PaintableWithLines const* paint_box() const;
diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
index e8e4cc63eb..995af034dc 100644
--- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
@@ -115,10 +115,10 @@ void BlockFormattingContext::compute_width(Box const& box, LayoutMode layout_mod
auto margin_left = CSS::Length::make_auto();
auto margin_right = CSS::Length::make_auto();
- const auto padding_left = computed_values.padding().left.resolved(box, width_of_containing_block_as_length).resolved(box);
- const auto padding_right = computed_values.padding().right.resolved(box, width_of_containing_block_as_length).resolved(box);
+ auto const padding_left = computed_values.padding().left.resolved(box, width_of_containing_block_as_length).resolved(box);
+ auto const padding_right = computed_values.padding().right.resolved(box, width_of_containing_block_as_length).resolved(box);
- auto try_compute_width = [&](const auto& a_width) {
+ auto try_compute_width = [&](auto const& a_width) {
CSS::Length width = a_width;
margin_left = computed_values.margin().left.resolved(box, width_of_containing_block_as_length).resolved(box);
margin_right = computed_values.margin().right.resolved(box, width_of_containing_block_as_length).resolved(box);
@@ -253,8 +253,8 @@ void BlockFormattingContext::compute_width_for_floating_box(Box const& box, Layo
auto margin_left = computed_values.margin().left.resolved(box, width_of_containing_block_as_length).resolved(box);
auto margin_right = computed_values.margin().right.resolved(box, width_of_containing_block_as_length).resolved(box);
- const auto padding_left = computed_values.padding().left.resolved(box, width_of_containing_block_as_length).resolved(box);
- const auto padding_right = computed_values.padding().right.resolved(box, width_of_containing_block_as_length).resolved(box);
+ auto const padding_left = computed_values.padding().left.resolved(box, width_of_containing_block_as_length).resolved(box);
+ auto const padding_right = computed_values.padding().right.resolved(box, width_of_containing_block_as_length).resolved(box);
// If 'margin-left', or 'margin-right' are computed as 'auto', their used value is '0'.
if (margin_left.is_auto())
diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp
index 5dcd1dcfde..603aa176eb 100644
--- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp
@@ -29,7 +29,7 @@ FormattingContext::FormattingContext(Type type, FormattingState& state, Box cons
FormattingContext::~FormattingContext() = default;
-bool FormattingContext::creates_block_formatting_context(const Box& box)
+bool FormattingContext::creates_block_formatting_context(Box const& box)
{
if (box.is_root_element())
return true;
@@ -472,12 +472,12 @@ void FormattingContext::compute_width_for_absolutely_positioned_non_replaced_ele
auto margin_left = CSS::Length::make_auto();
auto margin_right = CSS::Length::make_auto();
- const auto border_left = computed_values.border_left().width;
- const auto border_right = computed_values.border_right().width;
- const auto padding_left = computed_values.padding().left.resolved(box, width_of_containing_block).to_px(box);
- const auto padding_right = computed_values.padding().right.resolved(box, width_of_containing_block).to_px(box);
+ auto const border_left = computed_values.border_left().width;
+ auto const border_right = computed_values.border_right().width;
+ auto const padding_left = computed_values.padding().left.resolved(box, width_of_containing_block).to_px(box);
+ auto const padding_right = computed_values.padding().right.resolved(box, width_of_containing_block).to_px(box);
- auto try_compute_width = [&](const auto& a_width) {
+ auto try_compute_width = [&](auto const& a_width) {
margin_left = computed_values.margin().left.resolved(box, width_of_containing_block).resolved(box);
margin_right = computed_values.margin().right.resolved(box, width_of_containing_block).resolved(box);
diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.h b/Userland/Libraries/LibWeb/Layout/FormattingContext.h
index da0a787241..fff8e18f28 100644
--- a/Userland/Libraries/LibWeb/Layout/FormattingContext.h
+++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.h
@@ -29,14 +29,14 @@ public:
Box const& context_box() const { return m_context_box; }
FormattingContext* parent() { return m_parent; }
- const FormattingContext* parent() const { return m_parent; }
+ FormattingContext const* parent() const { return m_parent; }
Type type() const { return m_type; }
bool is_block_formatting_context() const { return type() == Type::Block; }
virtual bool inhibits_floating() const { return false; }
- static bool creates_block_formatting_context(const Box&);
+ static bool creates_block_formatting_context(Box const&);
static float compute_width_for_replaced_element(FormattingState const&, ReplacedBox const&);
static float compute_height_for_replaced_element(FormattingState const&, ReplacedBox const&);
diff --git a/Userland/Libraries/LibWeb/Layout/ImageBox.cpp b/Userland/Libraries/LibWeb/Layout/ImageBox.cpp
index ebf27336a7..6063949272 100644
--- a/Userland/Libraries/LibWeb/Layout/ImageBox.cpp
+++ b/Userland/Libraries/LibWeb/Layout/ImageBox.cpp
@@ -12,7 +12,7 @@
namespace Web::Layout {
-ImageBox::ImageBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style, const ImageLoader& image_loader)
+ImageBox::ImageBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style, ImageLoader const& image_loader)
: ReplacedBox(document, element, move(style))
, m_image_loader(image_loader)
{
diff --git a/Userland/Libraries/LibWeb/Layout/ImageBox.h b/Userland/Libraries/LibWeb/Layout/ImageBox.h
index 44a493da48..f03ea9c723 100644
--- a/Userland/Libraries/LibWeb/Layout/ImageBox.h
+++ b/Userland/Libraries/LibWeb/Layout/ImageBox.h
@@ -16,7 +16,7 @@ class ImageBox
: public ReplacedBox
, public HTML::BrowsingContext::ViewportClient {
public:
- ImageBox(DOM::Document&, DOM::Element&, NonnullRefPtr<CSS::StyleProperties>, const ImageLoader&);
+ ImageBox(DOM::Document&, DOM::Element&, NonnullRefPtr<CSS::StyleProperties>, ImageLoader const&);
virtual ~ImageBox() override;
virtual void prepare_for_replaced_layout() override;
@@ -36,7 +36,7 @@ private:
int preferred_width() const;
int preferred_height() const;
- const ImageLoader& m_image_loader;
+ ImageLoader const& m_image_loader;
};
}
diff --git a/Userland/Libraries/LibWeb/Layout/InitialContainingBlock.cpp b/Userland/Libraries/LibWeb/Layout/InitialContainingBlock.cpp
index 8bb8b3582f..c76424dffe 100644
--- a/Userland/Libraries/LibWeb/Layout/InitialContainingBlock.cpp
+++ b/Userland/Libraries/LibWeb/Layout/InitialContainingBlock.cpp
@@ -78,13 +78,13 @@ void InitialContainingBlock::recompute_selection_states()
});
}
-void InitialContainingBlock::set_selection(const LayoutRange& selection)
+void InitialContainingBlock::set_selection(LayoutRange const& selection)
{
m_selection = selection;
recompute_selection_states();
}
-void InitialContainingBlock::set_selection_end(const LayoutPosition& position)
+void InitialContainingBlock::set_selection_end(LayoutPosition const& position)
{
m_selection.set_end(position);
recompute_selection_states();
diff --git a/Userland/Libraries/LibWeb/Layout/InitialContainingBlock.h b/Userland/Libraries/LibWeb/Layout/InitialContainingBlock.h
index 2c35b82f1c..5d54ada9c0 100644
--- a/Userland/Libraries/LibWeb/Layout/InitialContainingBlock.h
+++ b/Userland/Libraries/LibWeb/Layout/InitialContainingBlock.h
@@ -20,9 +20,9 @@ public:
void paint_all_phases(PaintContext&);
- const LayoutRange& selection() const { return m_selection; }
- void set_selection(const LayoutRange&);
- void set_selection_end(const LayoutPosition&);
+ LayoutRange const& selection() const { return m_selection; }
+ void set_selection(LayoutRange const&);
+ void set_selection_end(LayoutPosition const&);
void build_stacking_context_tree_if_needed();
void recompute_selection_states();
diff --git a/Userland/Libraries/LibWeb/Layout/Label.cpp b/Userland/Libraries/LibWeb/Layout/Label.cpp
index ece03ad1a1..fc8ef56649 100644
--- a/Userland/Libraries/LibWeb/Layout/Label.cpp
+++ b/Userland/Libraries/LibWeb/Layout/Label.cpp
@@ -65,7 +65,7 @@ void Label::handle_mousemove_on_label(Badge<Painting::TextPaintable>, Gfx::IntPo
}
}
-bool Label::is_inside_associated_label(LabelableNode const& control, const Gfx::IntPoint& position)
+bool Label::is_inside_associated_label(LabelableNode const& control, Gfx::IntPoint const& position)
{
if (auto* label = label_for_control_node(control); label)
return enclosing_int_rect(label->paint_box()->absolute_rect()).contains(position);
diff --git a/Userland/Libraries/LibWeb/Layout/Label.h b/Userland/Libraries/LibWeb/Layout/Label.h
index 1cd942306a..5cee1a986c 100644
--- a/Userland/Libraries/LibWeb/Layout/Label.h
+++ b/Userland/Libraries/LibWeb/Layout/Label.h
@@ -22,9 +22,9 @@ public:
const HTML::HTMLLabelElement& dom_node() const { return static_cast<const HTML::HTMLLabelElement&>(*BlockContainer::dom_node()); }
HTML::HTMLLabelElement& dom_node() { return static_cast<HTML::HTMLLabelElement&>(*BlockContainer::dom_node()); }
- void handle_mousedown_on_label(Badge<Painting::TextPaintable>, const Gfx::IntPoint&, unsigned button);
- void handle_mouseup_on_label(Badge<Painting::TextPaintable>, const Gfx::IntPoint&, unsigned button);
- void handle_mousemove_on_label(Badge<Painting::TextPaintable>, const Gfx::IntPoint&, unsigned button);
+ void handle_mousedown_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint const&, unsigned button);
+ void handle_mouseup_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint const&, unsigned button);
+ void handle_mousemove_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint const&, unsigned button);
LabelableNode* labeled_control();
diff --git a/Userland/Libraries/LibWeb/Layout/LayoutPosition.h b/Userland/Libraries/LibWeb/Layout/LayoutPosition.h
index 7f5d221139..f924e75ebb 100644
--- a/Userland/Libraries/LibWeb/Layout/LayoutPosition.h
+++ b/Userland/Libraries/LibWeb/Layout/LayoutPosition.h
@@ -24,7 +24,7 @@ struct LayoutPosition {
class LayoutRange {
public:
LayoutRange() = default;
- LayoutRange(const LayoutPosition& start, const LayoutPosition& end)
+ LayoutRange(LayoutPosition const& start, LayoutPosition const& end)
: m_start(start)
, m_end(end)
{
@@ -32,18 +32,18 @@ public:
bool is_valid() const { return m_start.layout_node && m_end.layout_node; }
- void set(const LayoutPosition& start, const LayoutPosition& end)
+ void set(LayoutPosition const& start, LayoutPosition const& end)
{
m_start = start;
m_end = end;
}
- void set_start(const LayoutPosition& start) { m_start = start; }
- void set_end(const LayoutPosition& end) { m_end = end; }
+ void set_start(LayoutPosition const& start) { m_start = start; }
+ void set_end(LayoutPosition const& end) { m_end = end; }
- const LayoutPosition& start() const { return m_start; }
+ LayoutPosition const& start() const { return m_start; }
LayoutPosition& start() { return m_start; }
- const LayoutPosition& end() const { return m_end; }
+ LayoutPosition const& end() const { return m_end; }
LayoutPosition& end() { return m_end; }
LayoutRange normalized() const;
diff --git a/Userland/Libraries/LibWeb/Layout/LineBoxFragment.cpp b/Userland/Libraries/LibWeb/Layout/LineBoxFragment.cpp
index 795c4dad41..6945417dc3 100644
--- a/Userland/Libraries/LibWeb/Layout/LineBoxFragment.cpp
+++ b/Userland/Libraries/LibWeb/Layout/LineBoxFragment.cpp
@@ -65,7 +65,7 @@ int LineBoxFragment::text_index_at(float x) const
return m_start + m_length;
}
-Gfx::FloatRect LineBoxFragment::selection_rect(const Gfx::Font& font) const
+Gfx::FloatRect LineBoxFragment::selection_rect(Gfx::Font const& font) const
{
if (layout_node().selection_state() == Node::SelectionState::None)
return {};
@@ -79,8 +79,8 @@ Gfx::FloatRect LineBoxFragment::selection_rect(const Gfx::Font& font) const
if (!is<TextNode>(layout_node()))
return {};
- const auto start_index = m_start;
- const auto end_index = m_start + m_length;
+ auto const start_index = m_start;
+ auto const end_index = m_start + m_length;
auto text = this->text();
if (layout_node().selection_state() == Node::SelectionState::StartAndEnd) {
diff --git a/Userland/Libraries/LibWeb/Layout/LineBoxFragment.h b/Userland/Libraries/LibWeb/Layout/LineBoxFragment.h
index 5338b36bee..2a34112309 100644
--- a/Userland/Libraries/LibWeb/Layout/LineBoxFragment.h
+++ b/Userland/Libraries/LibWeb/Layout/LineBoxFragment.h
@@ -40,14 +40,14 @@ public:
const Gfx::FloatRect absolute_rect() const;
Type type() const { return m_type; }
- const Gfx::FloatPoint& offset() const { return m_offset; }
- void set_offset(const Gfx::FloatPoint& offset) { m_offset = offset; }
+ Gfx::FloatPoint const& offset() const { return m_offset; }
+ void set_offset(Gfx::FloatPoint const& offset) { m_offset = offset; }
// The baseline of a fragment is the number of pixels from the top to the text baseline.
void set_baseline(float y) { m_baseline = y; }
float baseline() const { return m_baseline; }
- const Gfx::FloatSize& size() const { return m_size; }
+ Gfx::FloatSize const& size() const { return m_size; }
void set_width(float width) { m_size.set_width(width); }
void set_height(float height) { m_size.set_height(height); }
float width() const { return m_size.width(); }
@@ -65,7 +65,7 @@ public:
int text_index_at(float x) const;
- Gfx::FloatRect selection_rect(const Gfx::Font&) const;
+ Gfx::FloatRect selection_rect(Gfx::Font const&) const;
float height_of_inline_level_box(FormattingState const&) const;
float top_of_inline_level_box(FormattingState const&) const;
diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp
index 242275d5df..99803a25b0 100644
--- a/Userland/Libraries/LibWeb/Layout/Node.cpp
+++ b/Userland/Libraries/LibWeb/Layout/Node.cpp
@@ -54,7 +54,7 @@ bool Node::can_contain_boxes_with_position_absolute() const
return computed_values().position() != CSS::Position::Static || is<InitialContainingBlock>(*this);
}
-const BlockContainer* Node::containing_block() const
+BlockContainer const* Node::containing_block() const
{
if (is<TextNode>(*this))
return first_ancestor_of_type<BlockContainer>();
@@ -67,7 +67,7 @@ const BlockContainer* Node::containing_block() const
ancestor = ancestor->parent();
while (ancestor && (!is<BlockContainer>(*ancestor) || ancestor->is_anonymous()))
ancestor = ancestor->containing_block();
- return static_cast<const BlockContainer*>(ancestor);
+ return static_cast<BlockContainer const*>(ancestor);
}
if (position == CSS::Position::Fixed)
@@ -102,7 +102,7 @@ HTML::BrowsingContext& Node::browsing_context()
return *document().browsing_context();
}
-const InitialContainingBlock& Node::root() const
+InitialContainingBlock const& Node::root() const
{
VERIFY(document().layout_node());
return *document().layout_node();
diff --git a/Userland/Libraries/LibWeb/Layout/Node.h b/Userland/Libraries/LibWeb/Layout/Node.h
index 0c7bccfbab..e562348cfd 100644
--- a/Userland/Libraries/LibWeb/Layout/Node.h
+++ b/Userland/Libraries/LibWeb/Layout/Node.h
@@ -57,7 +57,7 @@ public:
HTML::BrowsingContext const& browsing_context() const;
HTML::BrowsingContext& browsing_context();
- const InitialContainingBlock& root() const;
+ InitialContainingBlock const& root() const;
InitialContainingBlock& root();
bool is_root_element() const;
@@ -99,19 +99,19 @@ public:
bool is_flex_item() const { return m_is_flex_item; }
void set_flex_item(bool b) { m_is_flex_item = b; }
- const BlockContainer* containing_block() const;
- BlockContainer* containing_block() { return const_cast<BlockContainer*>(const_cast<const Node*>(this)->containing_block()); }
+ BlockContainer const* containing_block() const;
+ BlockContainer* containing_block() { return const_cast<BlockContainer*>(const_cast<Node const*>(this)->containing_block()); }
bool establishes_stacking_context() const;
bool can_contain_boxes_with_position_absolute() const;
- const Gfx::Font& font() const;
+ Gfx::Font const& font() const;
const CSS::ImmutableComputedValues& computed_values() const;
float line_height() const;
NodeWithStyle* parent();
- const NodeWithStyle* parent() const;
+ NodeWithStyle const* parent() const;
void inserted_into(Node&) { }
void removed_from(Node&) { }
@@ -165,7 +165,7 @@ public:
void apply_style(const CSS::StyleProperties&);
- const Gfx::Font& font() const { return *m_font; }
+ Gfx::Font const& font() const { return *m_font; }
float line_height() const { return m_line_height; }
Vector<CSS::BackgroundLayerData> const& background_layers() const { return computed_values().background_layers(); }
const CSS::ImageStyleValue* list_style_image() const { return m_list_style_image; }
@@ -197,7 +197,7 @@ private:
class NodeWithStyleAndBoxModelMetrics : public NodeWithStyle {
public:
BoxModelMetrics& box_model() { return m_box_model; }
- const BoxModelMetrics& box_model() const { return m_box_model; }
+ BoxModelMetrics const& box_model() const { return m_box_model; }
protected:
NodeWithStyleAndBoxModelMetrics(DOM::Document& document, DOM::Node* node, NonnullRefPtr<CSS::StyleProperties> style)
@@ -214,17 +214,17 @@ private:
BoxModelMetrics m_box_model;
};
-inline const Gfx::Font& Node::font() const
+inline Gfx::Font const& Node::font() const
{
if (m_has_style)
- return static_cast<const NodeWithStyle*>(this)->font();
+ return static_cast<NodeWithStyle const*>(this)->font();
return parent()->font();
}
inline const CSS::ImmutableComputedValues& Node::computed_values() const
{
if (m_has_style)
- return static_cast<const NodeWithStyle*>(this)->computed_values();
+ return static_cast<NodeWithStyle const*>(this)->computed_values();
return parent()->computed_values();
}
@@ -235,9 +235,9 @@ inline float Node::line_height() const
return parent()->line_height();
}
-inline const NodeWithStyle* Node::parent() const
+inline NodeWithStyle const* Node::parent() const
{
- return static_cast<const NodeWithStyle*>(TreeNode<Node>::parent());
+ return static_cast<NodeWithStyle const*>(TreeNode<Node>::parent());
}
inline NodeWithStyle* Node::parent()
diff --git a/Userland/Libraries/LibWeb/Layout/TableCellBox.h b/Userland/Libraries/LibWeb/Layout/TableCellBox.h
index ab78c133f4..3662c62fa0 100644
--- a/Userland/Libraries/LibWeb/Layout/TableCellBox.h
+++ b/Userland/Libraries/LibWeb/Layout/TableCellBox.h
@@ -17,7 +17,7 @@ public:
virtual ~TableCellBox() override;
TableCellBox* next_cell() { return next_sibling_of_type<TableCellBox>(); }
- const TableCellBox* next_cell() const { return next_sibling_of_type<TableCellBox>(); }
+ TableCellBox const* next_cell() const { return next_sibling_of_type<TableCellBox>(); }
size_t colspan() const;
diff --git a/Userland/Libraries/LibWeb/Layout/TextNode.h b/Userland/Libraries/LibWeb/Layout/TextNode.h
index f468b87089..18e604edb4 100644
--- a/Userland/Libraries/LibWeb/Layout/TextNode.h
+++ b/Userland/Libraries/LibWeb/Layout/TextNode.h
@@ -21,7 +21,7 @@ public:
const DOM::Text& dom_node() const { return static_cast<const DOM::Text&>(*Node::dom_node()); }
- const String& text_for_rendering() const { return m_text_for_rendering; }
+ String const& text_for_rendering() const { return m_text_for_rendering; }
struct Chunk {
Utf8View view;
@@ -40,8 +40,8 @@ public:
Optional<Chunk> try_commit_chunk(Utf8View::Iterator const& start, Utf8View::Iterator const& end, bool has_breaking_newline, bool must_commit = false) const;
const LayoutMode m_layout_mode;
- const bool m_wrap_lines;
- const bool m_respect_linebreaks;
+ bool const m_wrap_lines;
+ bool const m_respect_linebreaks;
Utf8View m_utf8_view;
Utf8View::Iterator m_iterator;
};
diff --git a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp
index 38c60284f2..6795a1e3af 100644
--- a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp
+++ b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp
@@ -343,7 +343,7 @@ static bool is_table_track_group(CSS::Display display)
|| display.is_table_column_group();
}
-static bool is_not_proper_table_child(const Node& node)
+static bool is_not_proper_table_child(Node const& node)
{
if (!node.has_style())
return true;
@@ -351,7 +351,7 @@ static bool is_not_proper_table_child(const Node& node)
return !is_table_track_group(display) && !is_table_track(display) && !display.is_table_caption();
}
-static bool is_not_table_row(const Node& node)
+static bool is_not_table_row(Node const& node)
{
if (!node.has_style())
return true;
@@ -359,7 +359,7 @@ static bool is_not_table_row(const Node& node)
return !display.is_table_row();
}
-static bool is_not_table_cell(const Node& node)
+static bool is_not_table_cell(Node const& node)
{
if (!node.has_style())
return true;
diff --git a/Userland/Libraries/LibWeb/Loader/ContentFilter.cpp b/Userland/Libraries/LibWeb/Loader/ContentFilter.cpp
index 8c3941d4e9..adce6815a4 100644
--- a/Userland/Libraries/LibWeb/Loader/ContentFilter.cpp
+++ b/Userland/Libraries/LibWeb/Loader/ContentFilter.cpp
@@ -33,7 +33,7 @@ bool ContentFilter::is_filtered(const AK::URL& url) const
return false;
}
-void ContentFilter::add_pattern(const String& pattern)
+void ContentFilter::add_pattern(String const& pattern)
{
StringBuilder builder;
if (!pattern.starts_with('*'))
diff --git a/Userland/Libraries/LibWeb/Loader/ContentFilter.h b/Userland/Libraries/LibWeb/Loader/ContentFilter.h
index ac7c45d66b..6295364e31 100644
--- a/Userland/Libraries/LibWeb/Loader/ContentFilter.h
+++ b/Userland/Libraries/LibWeb/Loader/ContentFilter.h
@@ -16,7 +16,7 @@ public:
static ContentFilter& the();
bool is_filtered(const AK::URL&) const;
- void add_pattern(const String&);
+ void add_pattern(String const&);
private:
ContentFilter();
diff --git a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp
index 648fbb179a..e690c83155 100644
--- a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp
+++ b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp
@@ -39,7 +39,7 @@ FrameLoader::FrameLoader(HTML::BrowsingContext& browsing_context)
FrameLoader::~FrameLoader() = default;
-static bool build_markdown_document(DOM::Document& document, const ByteBuffer& data)
+static bool build_markdown_document(DOM::Document& document, ByteBuffer const& data)
{
auto markdown_document = Markdown::Document::parse(data);
if (!markdown_document)
@@ -50,7 +50,7 @@ static bool build_markdown_document(DOM::Document& document, const ByteBuffer& d
return true;
}
-static bool build_text_document(DOM::Document& document, const ByteBuffer& data)
+static bool build_text_document(DOM::Document& document, ByteBuffer const& data)
{
auto html_element = document.create_element("html").release_value();
document.append_child(html_element);
@@ -106,7 +106,7 @@ static bool build_image_document(DOM::Document& document, ByteBuffer const& data
return true;
}
-static bool build_gemini_document(DOM::Document& document, const ByteBuffer& data)
+static bool build_gemini_document(DOM::Document& document, ByteBuffer const& data)
{
StringView gemini_data { data };
auto gemini_document = Gemini::Document::parse(gemini_data, document.url());
@@ -120,7 +120,7 @@ static bool build_gemini_document(DOM::Document& document, const ByteBuffer& dat
return true;
}
-static bool build_xml_document(DOM::Document& document, const ByteBuffer& data)
+static bool build_xml_document(DOM::Document& document, ByteBuffer const& data)
{
XML::Parser parser(data, { .resolve_external_resource = resolve_xml_resource });
@@ -129,7 +129,7 @@ static bool build_xml_document(DOM::Document& document, const ByteBuffer& data)
return !result.is_error() && !builder.has_error();
}
-bool FrameLoader::parse_document(DOM::Document& document, const ByteBuffer& data)
+bool FrameLoader::parse_document(DOM::Document& document, ByteBuffer const& data)
{
auto& mime_type = document.content_type();
if (mime_type == "text/html" || mime_type == "image/svg+xml") {
@@ -244,7 +244,7 @@ void FrameLoader::load_html(StringView html, const AK::URL& url)
// FIXME: Use an actual templating engine (our own one when it's built, preferably
// with a way to check these usages at compile time)
-void FrameLoader::load_error_page(const AK::URL& failed_url, const String& error)
+void FrameLoader::load_error_page(const AK::URL& failed_url, String const& error)
{
auto error_page_url = "file:///res/html/error.html";
ResourceLoader::the().load(
@@ -285,7 +285,7 @@ void FrameLoader::store_response_cookies(AK::URL const& url, String const& cooki
auto set_cookie_json_value = MUST(JsonValue::from_string(cookies));
VERIFY(set_cookie_json_value.type() == JsonValue::Type::Array);
- for (const auto& set_cookie_entry : set_cookie_json_value.as_array().values()) {
+ for (auto const& set_cookie_entry : set_cookie_json_value.as_array().values()) {
VERIFY(set_cookie_entry.type() == JsonValue::Type::String);
auto cookie = Cookie::parse_cookie(set_cookie_entry.as_string());
diff --git a/Userland/Libraries/LibWeb/Loader/FrameLoader.h b/Userland/Libraries/LibWeb/Loader/FrameLoader.h
index 5fecbce26c..5a0eece55c 100644
--- a/Userland/Libraries/LibWeb/Loader/FrameLoader.h
+++ b/Userland/Libraries/LibWeb/Loader/FrameLoader.h
@@ -39,9 +39,9 @@ private:
virtual void resource_did_load() override;
virtual void resource_did_fail() override;
- void load_error_page(const AK::URL& failed_url, const String& error_message);
+ void load_error_page(const AK::URL& failed_url, String const& error_message);
void load_favicon(RefPtr<Gfx::Bitmap> bitmap = nullptr);
- bool parse_document(DOM::Document&, const ByteBuffer& data);
+ bool parse_document(DOM::Document&, ByteBuffer const& data);
void store_response_cookies(AK::URL const& url, String const& cookies);
diff --git a/Userland/Libraries/LibWeb/Loader/ImageLoader.cpp b/Userland/Libraries/LibWeb/Loader/ImageLoader.cpp
index 3b1cd1d48f..b6d00ef408 100644
--- a/Userland/Libraries/LibWeb/Loader/ImageLoader.cpp
+++ b/Userland/Libraries/LibWeb/Loader/ImageLoader.cpp
@@ -155,7 +155,7 @@ unsigned ImageLoader::height() const
return bitmap(0) ? bitmap(0)->height() : 0;
}
-const Gfx::Bitmap* ImageLoader::bitmap(size_t frame_index) const
+Gfx::Bitmap const* ImageLoader::bitmap(size_t frame_index) const
{
if (!resource())
return nullptr;
diff --git a/Userland/Libraries/LibWeb/Loader/ImageLoader.h b/Userland/Libraries/LibWeb/Loader/ImageLoader.h
index ad6ece9c71..23c5344b1f 100644
--- a/Userland/Libraries/LibWeb/Loader/ImageLoader.h
+++ b/Userland/Libraries/LibWeb/Loader/ImageLoader.h
@@ -20,7 +20,7 @@ public:
void load(const AK::URL&);
- const Gfx::Bitmap* bitmap(size_t index) const;
+ Gfx::Bitmap const* bitmap(size_t index) const;
size_t current_frame_index() const { return m_current_frame_index; }
bool has_image() const;
diff --git a/Userland/Libraries/LibWeb/Loader/ImageResource.cpp b/Userland/Libraries/LibWeb/Loader/ImageResource.cpp
index 76769c7828..874f4d4ee4 100644
--- a/Userland/Libraries/LibWeb/Loader/ImageResource.cpp
+++ b/Userland/Libraries/LibWeb/Loader/ImageResource.cpp
@@ -15,7 +15,7 @@ NonnullRefPtr<ImageResource> ImageResource::convert_from_resource(Resource& reso
return adopt_ref(*new ImageResource(resource));
}
-ImageResource::ImageResource(const LoadRequest& request)
+ImageResource::ImageResource(LoadRequest const& request)
: Resource(Type::Image, request)
{
}
@@ -63,7 +63,7 @@ void ImageResource::decode_if_needed() const
m_has_attempted_decode = true;
}
-const Gfx::Bitmap* ImageResource::bitmap(size_t frame_index) const
+Gfx::Bitmap const* ImageResource::bitmap(size_t frame_index) const
{
decode_if_needed();
if (frame_index >= m_decoded_frames.size())
diff --git a/Userland/Libraries/LibWeb/Loader/ImageResource.h b/Userland/Libraries/LibWeb/Loader/ImageResource.h
index c740010a87..0823a19a74 100644
--- a/Userland/Libraries/LibWeb/Loader/ImageResource.h
+++ b/Userland/Libraries/LibWeb/Loader/ImageResource.h
@@ -23,7 +23,7 @@ public:
size_t duration { 0 };
};
- const Gfx::Bitmap* bitmap(size_t frame_index = 0) const;
+ Gfx::Bitmap const* bitmap(size_t frame_index = 0) const;
int frame_duration(size_t frame_index) const;
size_t frame_count() const
{
@@ -44,7 +44,7 @@ public:
void update_volatility();
private:
- explicit ImageResource(const LoadRequest&);
+ explicit ImageResource(LoadRequest const&);
explicit ImageResource(Resource&);
void decode_if_needed() const;
@@ -63,7 +63,7 @@ public:
protected:
ImageResource* resource() { return static_cast<ImageResource*>(ResourceClient::resource()); }
- const ImageResource* resource() const { return static_cast<const ImageResource*>(ResourceClient::resource()); }
+ ImageResource const* resource() const { return static_cast<ImageResource const*>(ResourceClient::resource()); }
private:
virtual Resource::Type client_type() const override { return Resource::Type::Image; }
diff --git a/Userland/Libraries/LibWeb/Loader/LoadRequest.h b/Userland/Libraries/LibWeb/Loader/LoadRequest.h
index d220fddac9..43e9bd3db7 100644
--- a/Userland/Libraries/LibWeb/Loader/LoadRequest.h
+++ b/Userland/Libraries/LibWeb/Loader/LoadRequest.h
@@ -28,24 +28,24 @@ public:
const AK::URL& url() const { return m_url; }
void set_url(const AK::URL& url) { m_url = url; }
- const String& method() const { return m_method; }
- void set_method(const String& method) { m_method = method; }
+ String const& method() const { return m_method; }
+ void set_method(String const& method) { m_method = method; }
- const ByteBuffer& body() const { return m_body; }
- void set_body(const ByteBuffer& body) { m_body = body; }
+ ByteBuffer const& body() const { return m_body; }
+ void set_body(ByteBuffer const& body) { m_body = body; }
void start_timer() { m_load_timer.start(); };
Time load_time() const { return m_load_timer.elapsed_time(); }
unsigned hash() const
{
- auto body_hash = string_hash((const char*)m_body.data(), m_body.size());
+ auto body_hash = string_hash((char const*)m_body.data(), m_body.size());
auto body_and_headers_hash = pair_int_hash(body_hash, m_headers.hash());
auto url_and_method_hash = pair_int_hash(m_url.to_string().hash(), m_method.hash());
return pair_int_hash(body_and_headers_hash, url_and_method_hash);
}
- bool operator==(const LoadRequest& other) const
+ bool operator==(LoadRequest const& other) const
{
if (m_headers.size() != other.m_headers.size())
return false;
@@ -59,10 +59,10 @@ public:
return m_url == other.m_url && m_method == other.m_method && m_body == other.m_body;
}
- void set_header(const String& name, const String& value) { m_headers.set(name, value); }
- String header(const String& name) const { return m_headers.get(name).value_or({}); }
+ void set_header(String const& name, String const& value) { m_headers.set(name, value); }
+ String header(String const& name) const { return m_headers.get(name).value_or({}); }
- const HashMap<String, String>& headers() const { return m_headers; }
+ HashMap<String, String> const& headers() const { return m_headers; }
private:
AK::URL m_url;
@@ -78,7 +78,7 @@ namespace AK {
template<>
struct Traits<Web::LoadRequest> : public GenericTraits<Web::LoadRequest> {
- static unsigned hash(const Web::LoadRequest& request) { return request.hash(); }
+ static unsigned hash(Web::LoadRequest const& request) { return request.hash(); }
};
}
diff --git a/Userland/Libraries/LibWeb/Loader/Resource.cpp b/Userland/Libraries/LibWeb/Loader/Resource.cpp
index 6682756480..525992697a 100644
--- a/Userland/Libraries/LibWeb/Loader/Resource.cpp
+++ b/Userland/Libraries/LibWeb/Loader/Resource.cpp
@@ -15,14 +15,14 @@
namespace Web {
-NonnullRefPtr<Resource> Resource::create(Badge<ResourceLoader>, Type type, const LoadRequest& request)
+NonnullRefPtr<Resource> Resource::create(Badge<ResourceLoader>, Type type, LoadRequest const& request)
{
if (type == Type::Image)
return adopt_ref(*new ImageResource(request));
return adopt_ref(*new Resource(type, request));
}
-Resource::Resource(Type type, const LoadRequest& request)
+Resource::Resource(Type type, LoadRequest const& request)
: m_request(request)
, m_type(type)
{
@@ -57,7 +57,7 @@ void Resource::for_each_client(Function<void(ResourceClient&)> callback)
}
}
-static Optional<String> encoding_from_content_type(const String& content_type)
+static Optional<String> encoding_from_content_type(String const& content_type)
{
auto offset = content_type.find("charset="sv);
if (offset.has_value()) {
@@ -72,7 +72,7 @@ static Optional<String> encoding_from_content_type(const String& content_type)
return {};
}
-static String mime_type_from_content_type(const String& content_type)
+static String mime_type_from_content_type(String const& content_type)
{
auto offset = content_type.find(';');
if (offset.has_value())
@@ -86,7 +86,7 @@ static bool is_valid_encoding(String const& encoding)
return TextCodec::decoder_for(encoding);
}
-void Resource::did_load(Badge<ResourceLoader>, ReadonlyBytes data, const HashMap<String, String, CaseInsensitiveStringTraits>& headers, Optional<u32> status_code)
+void Resource::did_load(Badge<ResourceLoader>, ReadonlyBytes data, HashMap<String, String, CaseInsensitiveStringTraits> const& headers, Optional<u32> status_code)
{
VERIFY(!m_loaded);
// FIXME: Handle OOM failure.
@@ -131,7 +131,7 @@ void Resource::did_load(Badge<ResourceLoader>, ReadonlyBytes data, const HashMap
});
}
-void Resource::did_fail(Badge<ResourceLoader>, const String& error, Optional<u32> status_code)
+void Resource::did_fail(Badge<ResourceLoader>, String const& error, Optional<u32> status_code)
{
m_error = error;
m_status_code = move(status_code);
diff --git a/Userland/Libraries/LibWeb/Loader/Resource.h b/Userland/Libraries/LibWeb/Loader/Resource.h
index ad77e9e611..40edf5e41a 100644
--- a/Userland/Libraries/LibWeb/Loader/Resource.h
+++ b/Userland/Libraries/LibWeb/Loader/Resource.h
@@ -32,7 +32,7 @@ public:
Image,
};
- static NonnullRefPtr<Resource> create(Badge<ResourceLoader>, Type, const LoadRequest&);
+ static NonnullRefPtr<Resource> create(Badge<ResourceLoader>, Type, LoadRequest const&);
virtual ~Resource();
Type type() const { return m_type; }
@@ -40,14 +40,14 @@ public:
bool is_loaded() const { return m_loaded; }
bool is_failed() const { return m_failed; }
- const String& error() const { return m_error; }
+ String const& error() const { return m_error; }
bool has_encoded_data() const { return !m_encoded_data.is_empty(); }
const AK::URL& url() const { return m_request.url(); }
- const ByteBuffer& encoded_data() const { return m_encoded_data; }
+ ByteBuffer const& encoded_data() const { return m_encoded_data; }
- const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers() const { return m_response_headers; }
+ HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers() const { return m_response_headers; }
[[nodiscard]] Optional<u32> status_code() const { return m_status_code; }
@@ -55,16 +55,16 @@ public:
void unregister_client(Badge<ResourceClient>, ResourceClient&);
bool has_encoding() const { return m_encoding.has_value(); }
- const Optional<String>& encoding() const { return m_encoding; }
- const String& mime_type() const { return m_mime_type; }
+ Optional<String> const& encoding() const { return m_encoding; }
+ String const& mime_type() const { return m_mime_type; }
void for_each_client(Function<void(ResourceClient&)>);
- void did_load(Badge<ResourceLoader>, ReadonlyBytes data, const HashMap<String, String, CaseInsensitiveStringTraits>& headers, Optional<u32> status_code);
- void did_fail(Badge<ResourceLoader>, const String& error, Optional<u32> status_code);
+ void did_load(Badge<ResourceLoader>, ReadonlyBytes data, HashMap<String, String, CaseInsensitiveStringTraits> const& headers, Optional<u32> status_code);
+ void did_fail(Badge<ResourceLoader>, String const& error, Optional<u32> status_code);
protected:
- explicit Resource(Type, const LoadRequest&);
+ explicit Resource(Type, LoadRequest const&);
Resource(Type, Resource&);
private:
@@ -93,7 +93,7 @@ protected:
virtual Resource::Type client_type() const { return Resource::Type::Generic; }
Resource* resource() { return m_resource; }
- const Resource* resource() const { return m_resource; }
+ Resource const* resource() const { return m_resource; }
void set_resource(Resource*);
private:
diff --git a/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp b/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp
index 327eed13a4..737598cc3d 100644
--- a/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp
+++ b/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp
@@ -41,7 +41,7 @@ ResourceLoader::ResourceLoader(NonnullRefPtr<Protocol::RequestClient> protocol_c
{
}
-void ResourceLoader::load_sync(LoadRequest& request, Function<void(ReadonlyBytes, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> status_code)> success_callback, Function<void(const String&, Optional<u32> status_code)> error_callback)
+void ResourceLoader::load_sync(LoadRequest& request, Function<void(ReadonlyBytes, HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers, Optional<u32> status_code)> success_callback, Function<void(String const&, Optional<u32> status_code)> error_callback)
{
Core::EventLoop loop;
@@ -123,7 +123,7 @@ static void emit_signpost(String const& message, int id)
static size_t resource_id = 0;
-void ResourceLoader::load(LoadRequest& request, Function<void(ReadonlyBytes, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> status_code)> success_callback, Function<void(const String&, Optional<u32> status_code)> error_callback)
+void ResourceLoader::load(LoadRequest& request, Function<void(ReadonlyBytes, HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers, Optional<u32> status_code)> success_callback, Function<void(String const&, Optional<u32> status_code)> error_callback)
{
auto& url = request.url();
request.start_timer();
@@ -133,13 +133,13 @@ void ResourceLoader::load(LoadRequest& request, Function<void(ReadonlyBytes, con
emit_signpost(String::formatted("Starting load: {}", url_for_logging), id);
dbgln("ResourceLoader: Starting load of: \"{}\"", url_for_logging);
- const auto log_success = [url_for_logging, id](const auto& request) {
+ auto const log_success = [url_for_logging, id](auto const& request) {
auto load_time_ms = request.load_time().to_milliseconds();
emit_signpost(String::formatted("Finished load: {}", url_for_logging), id);
dbgln("ResourceLoader: Finished load of: \"{}\", Duration: {}ms", url_for_logging, load_time_ms);
};
- const auto log_failure = [url_for_logging, id](const auto& request, const auto error_message) {
+ auto const log_failure = [url_for_logging, id](auto const& request, auto const error_message) {
auto load_time_ms = request.load_time().to_milliseconds();
emit_signpost(String::formatted("Failed load: {}", url_for_logging), id);
dbgln("ResourceLoader: Failed load of: \"{}\", \033[31;1mError: {}\033[0m, Duration: {}ms", url_for_logging, error_message, load_time_ms);
@@ -267,7 +267,7 @@ void ResourceLoader::load(LoadRequest& request, Function<void(ReadonlyBytes, con
error_callback(not_implemented_error, {});
}
-void ResourceLoader::load(const AK::URL& url, Function<void(ReadonlyBytes, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> status_code)> success_callback, Function<void(const String&, Optional<u32> status_code)> error_callback)
+void ResourceLoader::load(const AK::URL& url, Function<void(ReadonlyBytes, HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers, Optional<u32> status_code)> success_callback, Function<void(String const&, Optional<u32> status_code)> error_callback)
{
LoadRequest request;
request.set_url(url);
diff --git a/Userland/Libraries/LibWeb/Loader/ResourceLoader.h b/Userland/Libraries/LibWeb/Loader/ResourceLoader.h
index 4d31d9f9f3..0f3f7f592c 100644
--- a/Userland/Libraries/LibWeb/Loader/ResourceLoader.h
+++ b/Userland/Libraries/LibWeb/Loader/ResourceLoader.h
@@ -33,9 +33,9 @@ public:
RefPtr<Resource> load_resource(Resource::Type, LoadRequest&);
- void load(LoadRequest&, Function<void(ReadonlyBytes, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> status_code)> success_callback, Function<void(const String&, Optional<u32> status_code)> error_callback = nullptr);
- void load(const AK::URL&, Function<void(ReadonlyBytes, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> status_code)> success_callback, Function<void(const String&, Optional<u32> status_code)> error_callback = nullptr);
- void load_sync(LoadRequest&, Function<void(ReadonlyBytes, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> status_code)> success_callback, Function<void(const String&, Optional<u32> status_code)> error_callback = nullptr);
+ void load(LoadRequest&, Function<void(ReadonlyBytes, HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers, Optional<u32> status_code)> success_callback, Function<void(String const&, Optional<u32> status_code)> error_callback = nullptr);
+ void load(const AK::URL&, Function<void(ReadonlyBytes, HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers, Optional<u32> status_code)> success_callback, Function<void(String const&, Optional<u32> status_code)> error_callback = nullptr);
+ void load_sync(LoadRequest&, Function<void(ReadonlyBytes, HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers, Optional<u32> status_code)> success_callback, Function<void(String const&, Optional<u32> status_code)> error_callback = nullptr);
void prefetch_dns(AK::URL const&);
void preconnect(AK::URL const&);
@@ -46,8 +46,8 @@ public:
Protocol::RequestClient& protocol_client() { return *m_protocol_client; }
- const String& user_agent() const { return m_user_agent; }
- void set_user_agent(const String& user_agent) { m_user_agent = user_agent; }
+ String const& user_agent() const { return m_user_agent; }
+ void set_user_agent(String const& user_agent) { m_user_agent = user_agent; }
void clear_cache();
void evict_from_cache(LoadRequest const&);
diff --git a/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp b/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp
index ae13e676de..7d36522b53 100644
--- a/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp
+++ b/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp
@@ -56,7 +56,7 @@ Optional<MimeType> MimeType::from_string(StringView string)
// https://fetch.spec.whatwg.org/#http-whitespace
// HTTP whitespace is U+000A LF, U+000D CR, or an HTTP tab or space.
// An HTTP tab or space is U+0009 TAB or U+0020 SPACE.
- constexpr const char* http_whitespace = "\n\r\t ";
+ constexpr char const* http_whitespace = "\n\r\t ";
// 1. Remove any leading and trailing HTTP whitespace from input.
auto trimmed_string = string.trim(http_whitespace, TrimMode::Both);
diff --git a/Userland/Libraries/LibWeb/Origin.h b/Userland/Libraries/LibWeb/Origin.h
index e89be3f9a2..115203ebff 100644
--- a/Userland/Libraries/LibWeb/Origin.h
+++ b/Userland/Libraries/LibWeb/Origin.h
@@ -14,7 +14,7 @@ namespace Web {
class Origin {
public:
Origin() = default;
- Origin(const String& protocol, const String& host, u16 port)
+ Origin(String const& protocol, String const& host, u16 port)
: m_protocol(protocol)
, m_host(host)
, m_port(port)
@@ -24,8 +24,8 @@ public:
// https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque
bool is_opaque() const { return m_protocol.is_null() && m_host.is_null() && m_port == 0; }
- const String& protocol() const { return m_protocol; }
- const String& host() const { return m_host; }
+ String const& protocol() const { return m_protocol; }
+ String const& host() const { return m_host; }
u16 port() const { return m_port; }
// https://html.spec.whatwg.org/multipage/origin.html#same-origin
diff --git a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp
index 1b838b3691..e3dd13ac99 100644
--- a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp
+++ b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp
@@ -213,7 +213,7 @@ void OutOfProcessWebView::notify_server_did_paint(Badge<WebContentClient>, i32 b
}
}
-void OutOfProcessWebView::notify_server_did_invalidate_content_rect(Badge<WebContentClient>, [[maybe_unused]] const Gfx::IntRect& content_rect)
+void OutOfProcessWebView::notify_server_did_invalidate_content_rect(Badge<WebContentClient>, [[maybe_unused]] Gfx::IntRect const& content_rect)
{
request_repaint();
}
@@ -228,12 +228,12 @@ void OutOfProcessWebView::notify_server_did_request_cursor_change(Badge<WebConte
set_override_cursor(cursor);
}
-void OutOfProcessWebView::notify_server_did_layout(Badge<WebContentClient>, const Gfx::IntSize& content_size)
+void OutOfProcessWebView::notify_server_did_layout(Badge<WebContentClient>, Gfx::IntSize const& content_size)
{
set_content_size(content_size);
}
-void OutOfProcessWebView::notify_server_did_change_title(Badge<WebContentClient>, const String& title)
+void OutOfProcessWebView::notify_server_did_change_title(Badge<WebContentClient>, String const& title)
{
if (on_title_change)
on_title_change(title);
@@ -251,12 +251,12 @@ void OutOfProcessWebView::notify_server_did_request_scroll_to(Badge<WebContentCl
vertical_scrollbar().set_value(scroll_position.y());
}
-void OutOfProcessWebView::notify_server_did_request_scroll_into_view(Badge<WebContentClient>, const Gfx::IntRect& rect)
+void OutOfProcessWebView::notify_server_did_request_scroll_into_view(Badge<WebContentClient>, Gfx::IntRect const& rect)
{
scroll_into_view(rect, true, true);
}
-void OutOfProcessWebView::notify_server_did_enter_tooltip_area(Badge<WebContentClient>, const Gfx::IntPoint&, const String& title)
+void OutOfProcessWebView::notify_server_did_enter_tooltip_area(Badge<WebContentClient>, Gfx::IntPoint const&, String const& title)
{
GUI::Application::the()->show_tooltip(title, nullptr);
}
@@ -279,13 +279,13 @@ void OutOfProcessWebView::notify_server_did_unhover_link(Badge<WebContentClient>
on_link_hover({});
}
-void OutOfProcessWebView::notify_server_did_click_link(Badge<WebContentClient>, const AK::URL& url, const String& target, unsigned int modifiers)
+void OutOfProcessWebView::notify_server_did_click_link(Badge<WebContentClient>, const AK::URL& url, String const& target, unsigned int modifiers)
{
if (on_link_click)
on_link_click(url, target, modifiers);
}
-void OutOfProcessWebView::notify_server_did_middle_click_link(Badge<WebContentClient>, const AK::URL& url, const String& target, unsigned int modifiers)
+void OutOfProcessWebView::notify_server_did_middle_click_link(Badge<WebContentClient>, const AK::URL& url, String const& target, unsigned int modifiers)
{
if (on_link_middle_click)
on_link_middle_click(url, target, modifiers);
@@ -303,36 +303,36 @@ void OutOfProcessWebView::notify_server_did_finish_loading(Badge<WebContentClien
on_load_finish(url);
}
-void OutOfProcessWebView::notify_server_did_request_context_menu(Badge<WebContentClient>, const Gfx::IntPoint& content_position)
+void OutOfProcessWebView::notify_server_did_request_context_menu(Badge<WebContentClient>, Gfx::IntPoint const& content_position)
{
if (on_context_menu_request)
on_context_menu_request(screen_relative_rect().location().translated(to_widget_position(content_position)));
}
-void OutOfProcessWebView::notify_server_did_request_link_context_menu(Badge<WebContentClient>, const Gfx::IntPoint& content_position, const AK::URL& url, const String&, unsigned)
+void OutOfProcessWebView::notify_server_did_request_link_context_menu(Badge<WebContentClient>, Gfx::IntPoint const& content_position, const AK::URL& url, String const&, unsigned)
{
if (on_link_context_menu_request)
on_link_context_menu_request(url, screen_relative_rect().location().translated(to_widget_position(content_position)));
}
-void OutOfProcessWebView::notify_server_did_request_image_context_menu(Badge<WebContentClient>, const Gfx::IntPoint& content_position, const AK::URL& url, const String&, unsigned, const Gfx::ShareableBitmap& bitmap)
+void OutOfProcessWebView::notify_server_did_request_image_context_menu(Badge<WebContentClient>, Gfx::IntPoint const& content_position, const AK::URL& url, String const&, unsigned, Gfx::ShareableBitmap const& bitmap)
{
if (on_image_context_menu_request)
on_image_context_menu_request(url, screen_relative_rect().location().translated(to_widget_position(content_position)), bitmap);
}
-void OutOfProcessWebView::notify_server_did_request_alert(Badge<WebContentClient>, const String& message)
+void OutOfProcessWebView::notify_server_did_request_alert(Badge<WebContentClient>, String const& message)
{
GUI::MessageBox::show(window(), message, "Alert", GUI::MessageBox::Type::Information);
}
-bool OutOfProcessWebView::notify_server_did_request_confirm(Badge<WebContentClient>, const String& message)
+bool OutOfProcessWebView::notify_server_did_request_confirm(Badge<WebContentClient>, String const& message)
{
auto confirm_result = GUI::MessageBox::show(window(), message, "Confirm", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel);
return confirm_result == GUI::Dialog::ExecResult::ExecOK;
}
-String OutOfProcessWebView::notify_server_did_request_prompt(Badge<WebContentClient>, const String& message, const String& default_)
+String OutOfProcessWebView::notify_server_did_request_prompt(Badge<WebContentClient>, String const& message, String const& default_)
{
String response { default_ };
if (GUI::InputBox::show(window(), response, message, "Prompt") == GUI::InputBox::ExecOK)
@@ -340,13 +340,13 @@ String OutOfProcessWebView::notify_server_did_request_prompt(Badge<WebContentCli
return {};
}
-void OutOfProcessWebView::notify_server_did_get_source(const AK::URL& url, const String& source)
+void OutOfProcessWebView::notify_server_did_get_source(const AK::URL& url, String const& source)
{
if (on_get_source)
on_get_source(url, source);
}
-void OutOfProcessWebView::notify_server_did_get_dom_tree(const String& dom_tree)
+void OutOfProcessWebView::notify_server_did_get_dom_tree(String const& dom_tree)
{
if (on_get_dom_tree)
on_get_dom_tree(dom_tree);
@@ -364,13 +364,13 @@ void OutOfProcessWebView::notify_server_did_output_js_console_message(i32 messag
on_js_console_new_message(message_index);
}
-void OutOfProcessWebView::notify_server_did_get_js_console_messages(i32 start_index, const Vector<String>& message_types, const Vector<String>& messages)
+void OutOfProcessWebView::notify_server_did_get_js_console_messages(i32 start_index, Vector<String> const& message_types, Vector<String> const& messages)
{
if (on_get_js_console_messages)
on_get_js_console_messages(start_index, message_types, messages);
}
-void OutOfProcessWebView::notify_server_did_change_favicon(const Gfx::Bitmap& favicon)
+void OutOfProcessWebView::notify_server_did_change_favicon(Gfx::Bitmap const& favicon)
{
if (on_favicon_change)
on_favicon_change(favicon);
@@ -383,7 +383,7 @@ String OutOfProcessWebView::notify_server_did_request_cookie(Badge<WebContentCli
return {};
}
-void OutOfProcessWebView::notify_server_did_set_cookie(Badge<WebContentClient>, const AK::URL& url, const Cookie::ParsedCookie& cookie, Cookie::Source source)
+void OutOfProcessWebView::notify_server_did_set_cookie(Badge<WebContentClient>, const AK::URL& url, Cookie::ParsedCookie const& cookie, Cookie::Source source)
{
if (on_set_cookie)
on_set_cookie(url, cookie, source);
@@ -422,7 +422,7 @@ WebContentClient& OutOfProcessWebView::client()
return *m_client_state.client;
}
-void OutOfProcessWebView::debug_request(const String& request, const String& argument)
+void OutOfProcessWebView::debug_request(String const& request, String const& argument)
{
client().async_debug_request(request, argument);
}
@@ -460,7 +460,7 @@ i32 OutOfProcessWebView::get_hovered_node_id()
return client().get_hovered_node_id();
}
-void OutOfProcessWebView::js_console_input(const String& js_source)
+void OutOfProcessWebView::js_console_input(String const& js_source)
{
client().async_js_console_input(js_source);
}
diff --git a/Userland/Libraries/LibWeb/OutOfProcessWebView.h b/Userland/Libraries/LibWeb/OutOfProcessWebView.h
index a80c757e3c..f996ae2116 100644
--- a/Userland/Libraries/LibWeb/OutOfProcessWebView.h
+++ b/Userland/Libraries/LibWeb/OutOfProcessWebView.h
@@ -31,7 +31,7 @@ public:
void load_html(StringView, const AK::URL&);
void load_empty_document();
- void debug_request(const String& request, const String& argument = {});
+ void debug_request(String const& request, String const& argument = {});
void get_source();
void inspect_dom_tree();
@@ -45,7 +45,7 @@ public:
void clear_inspected_dom_node();
i32 get_hovered_node_id();
- void js_console_input(const String& js_source);
+ void js_console_input(String const& js_source);
void js_console_request_messages(i32 start_index);
void run_javascript(StringView);
@@ -58,37 +58,37 @@ public:
void set_content_filters(Vector<String>);
void set_preferred_color_scheme(Web::CSS::PreferredColorScheme);
- void notify_server_did_layout(Badge<WebContentClient>, const Gfx::IntSize& content_size);
+ void notify_server_did_layout(Badge<WebContentClient>, Gfx::IntSize const& content_size);
void notify_server_did_paint(Badge<WebContentClient>, i32 bitmap_id);
- void notify_server_did_invalidate_content_rect(Badge<WebContentClient>, const Gfx::IntRect&);
+ void notify_server_did_invalidate_content_rect(Badge<WebContentClient>, Gfx::IntRect const&);
void notify_server_did_change_selection(Badge<WebContentClient>);
void notify_server_did_request_cursor_change(Badge<WebContentClient>, Gfx::StandardCursor cursor);
- void notify_server_did_change_title(Badge<WebContentClient>, const String&);
+ void notify_server_did_change_title(Badge<WebContentClient>, String const&);
void notify_server_did_request_scroll(Badge<WebContentClient>, i32, i32);
void notify_server_did_request_scroll_to(Badge<WebContentClient>, Gfx::IntPoint const&);
- void notify_server_did_request_scroll_into_view(Badge<WebContentClient>, const Gfx::IntRect&);
- void notify_server_did_enter_tooltip_area(Badge<WebContentClient>, const Gfx::IntPoint&, const String&);
+ void notify_server_did_request_scroll_into_view(Badge<WebContentClient>, Gfx::IntRect const&);
+ void notify_server_did_enter_tooltip_area(Badge<WebContentClient>, Gfx::IntPoint const&, String const&);
void notify_server_did_leave_tooltip_area(Badge<WebContentClient>);
void notify_server_did_hover_link(Badge<WebContentClient>, const AK::URL&);
void notify_server_did_unhover_link(Badge<WebContentClient>);
- void notify_server_did_click_link(Badge<WebContentClient>, const AK::URL&, const String& target, unsigned modifiers);
- void notify_server_did_middle_click_link(Badge<WebContentClient>, const AK::URL&, const String& target, unsigned modifiers);
+ void notify_server_did_click_link(Badge<WebContentClient>, const AK::URL&, String const& target, unsigned modifiers);
+ void notify_server_did_middle_click_link(Badge<WebContentClient>, const AK::URL&, String const& target, unsigned modifiers);
void notify_server_did_start_loading(Badge<WebContentClient>, const AK::URL&);
void notify_server_did_finish_loading(Badge<WebContentClient>, const AK::URL&);
- void notify_server_did_request_context_menu(Badge<WebContentClient>, const Gfx::IntPoint&);
- void notify_server_did_request_link_context_menu(Badge<WebContentClient>, const Gfx::IntPoint&, const AK::URL&, const String& target, unsigned modifiers);
- void notify_server_did_request_image_context_menu(Badge<WebContentClient>, const Gfx::IntPoint&, const AK::URL&, const String& target, unsigned modifiers, const Gfx::ShareableBitmap&);
- void notify_server_did_request_alert(Badge<WebContentClient>, const String& message);
- bool notify_server_did_request_confirm(Badge<WebContentClient>, const String& message);
- String notify_server_did_request_prompt(Badge<WebContentClient>, const String& message, const String& default_);
- void notify_server_did_get_source(const AK::URL& url, const String& source);
- void notify_server_did_get_dom_tree(const String& dom_tree);
+ void notify_server_did_request_context_menu(Badge<WebContentClient>, Gfx::IntPoint const&);
+ void notify_server_did_request_link_context_menu(Badge<WebContentClient>, Gfx::IntPoint const&, const AK::URL&, String const& target, unsigned modifiers);
+ void notify_server_did_request_image_context_menu(Badge<WebContentClient>, Gfx::IntPoint const&, const AK::URL&, String const& target, unsigned modifiers, Gfx::ShareableBitmap const&);
+ void notify_server_did_request_alert(Badge<WebContentClient>, String const& message);
+ bool notify_server_did_request_confirm(Badge<WebContentClient>, String const& message);
+ String notify_server_did_request_prompt(Badge<WebContentClient>, String const& message, String const& default_);
+ void notify_server_did_get_source(const AK::URL& url, String const& source);
+ void notify_server_did_get_dom_tree(String const& dom_tree);
void notify_server_did_get_dom_node_properties(i32 node_id, String const& specified_style, String const& computed_style, String const& custom_properties, String const& node_box_sizing);
void notify_server_did_output_js_console_message(i32 message_index);
void notify_server_did_get_js_console_messages(i32 start_index, Vector<String> const& message_types, Vector<String> const& messages);
- void notify_server_did_change_favicon(const Gfx::Bitmap& favicon);
+ void notify_server_did_change_favicon(Gfx::Bitmap const& favicon);
String notify_server_did_request_cookie(Badge<WebContentClient>, const AK::URL& url, Cookie::Source source);
- void notify_server_did_set_cookie(Badge<WebContentClient>, const AK::URL& url, const Cookie::ParsedCookie& cookie, Cookie::Source source);
+ void notify_server_did_set_cookie(Badge<WebContentClient>, const AK::URL& url, Cookie::ParsedCookie const& cookie, Cookie::Source source);
void notify_server_did_update_resource_count(i32 count_waiting);
private:
diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp
index 8ac8a32fed..4f92731e6e 100644
--- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp
+++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp
@@ -80,7 +80,7 @@ static Gfx::StandardCursor cursor_css_to_gfx(Optional<CSS::Cursor> cursor)
}
}
-static Gfx::IntPoint compute_mouse_event_offset(const Gfx::IntPoint& position, const Layout::Node& layout_node)
+static Gfx::IntPoint compute_mouse_event_offset(Gfx::IntPoint const& position, Layout::Node const& layout_node)
{
auto top_left_of_layout_node = layout_node.box_type_agnostic_position();
return {
@@ -97,7 +97,7 @@ EventHandler::EventHandler(Badge<HTML::BrowsingContext>, HTML::BrowsingContext&
EventHandler::~EventHandler() = default;
-const Layout::InitialContainingBlock* EventHandler::layout_root() const
+Layout::InitialContainingBlock const* EventHandler::layout_root() const
{
if (!m_browsing_context.active_document())
return nullptr;
@@ -125,7 +125,7 @@ Painting::PaintableBox const* EventHandler::paint_root() const
return const_cast<Painting::PaintableBox*>(m_browsing_context.active_document()->paint_box());
}
-bool EventHandler::handle_mousewheel(const Gfx::IntPoint& position, unsigned int buttons, unsigned int modifiers, int wheel_delta_x, int wheel_delta_y)
+bool EventHandler::handle_mousewheel(Gfx::IntPoint const& position, unsigned int buttons, unsigned int modifiers, int wheel_delta_x, int wheel_delta_y)
{
if (m_browsing_context.active_document())
m_browsing_context.active_document()->update_layout();
@@ -150,7 +150,7 @@ bool EventHandler::handle_mousewheel(const Gfx::IntPoint& position, unsigned int
return false;
}
-bool EventHandler::handle_mouseup(const Gfx::IntPoint& position, unsigned button, unsigned modifiers)
+bool EventHandler::handle_mouseup(Gfx::IntPoint const& position, unsigned button, unsigned modifiers)
{
if (m_browsing_context.active_document())
m_browsing_context.active_document()->update_layout();
@@ -247,7 +247,7 @@ bool EventHandler::handle_mouseup(const Gfx::IntPoint& position, unsigned button
return handled_event;
}
-bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned button, unsigned modifiers)
+bool EventHandler::handle_mousedown(Gfx::IntPoint const& position, unsigned button, unsigned modifiers)
{
if (m_browsing_context.active_document())
m_browsing_context.active_document()->update_layout();
@@ -341,7 +341,7 @@ bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned butt
return true;
}
-bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned buttons, unsigned modifiers)
+bool EventHandler::handle_mousemove(Gfx::IntPoint const& position, unsigned buttons, unsigned modifiers)
{
if (m_browsing_context.active_document())
m_browsing_context.active_document()->update_layout();
diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.h b/Userland/Libraries/LibWeb/Page/EventHandler.h
index c2244f9b46..255d2503ae 100644
--- a/Userland/Libraries/LibWeb/Page/EventHandler.h
+++ b/Userland/Libraries/LibWeb/Page/EventHandler.h
@@ -22,10 +22,10 @@ public:
explicit EventHandler(Badge<HTML::BrowsingContext>, HTML::BrowsingContext&);
~EventHandler();
- bool handle_mouseup(const Gfx::IntPoint&, unsigned button, unsigned modifiers);
- bool handle_mousedown(const Gfx::IntPoint&, unsigned button, unsigned modifiers);
- bool handle_mousemove(const Gfx::IntPoint&, unsigned buttons, unsigned modifiers);
- bool handle_mousewheel(const Gfx::IntPoint&, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y);
+ bool handle_mouseup(Gfx::IntPoint const&, unsigned button, unsigned modifiers);
+ bool handle_mousedown(Gfx::IntPoint const&, unsigned button, unsigned modifiers);
+ bool handle_mousemove(Gfx::IntPoint const&, unsigned buttons, unsigned modifiers);
+ bool handle_mousewheel(Gfx::IntPoint const&, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y);
bool handle_keydown(KeyCode, unsigned modifiers, u32 code_point);
bool handle_keyup(KeyCode, unsigned modifiers, u32 code_point);
@@ -39,7 +39,7 @@ private:
bool focus_previous_element();
Layout::InitialContainingBlock* layout_root();
- const Layout::InitialContainingBlock* layout_root() const;
+ Layout::InitialContainingBlock const* layout_root() const;
Painting::PaintableBox* paint_root();
Painting::PaintableBox const* paint_root() const;
diff --git a/Userland/Libraries/LibWeb/Page/Page.cpp b/Userland/Libraries/LibWeb/Page/Page.cpp
index 70e8f90c6c..98f748d40a 100644
--- a/Userland/Libraries/LibWeb/Page/Page.cpp
+++ b/Userland/Libraries/LibWeb/Page/Page.cpp
@@ -59,22 +59,22 @@ CSS::PreferredColorScheme Page::preferred_color_scheme() const
return m_client.preferred_color_scheme();
}
-bool Page::handle_mousewheel(const Gfx::IntPoint& position, unsigned button, unsigned modifiers, int wheel_delta_x, int wheel_delta_y)
+bool Page::handle_mousewheel(Gfx::IntPoint const& position, unsigned button, unsigned modifiers, int wheel_delta_x, int wheel_delta_y)
{
return top_level_browsing_context().event_handler().handle_mousewheel(position, button, modifiers, wheel_delta_x, wheel_delta_y);
}
-bool Page::handle_mouseup(const Gfx::IntPoint& position, unsigned button, unsigned modifiers)
+bool Page::handle_mouseup(Gfx::IntPoint const& position, unsigned button, unsigned modifiers)
{
return top_level_browsing_context().event_handler().handle_mouseup(position, button, modifiers);
}
-bool Page::handle_mousedown(const Gfx::IntPoint& position, unsigned button, unsigned modifiers)
+bool Page::handle_mousedown(Gfx::IntPoint const& position, unsigned button, unsigned modifiers)
{
return top_level_browsing_context().event_handler().handle_mousedown(position, button, modifiers);
}
-bool Page::handle_mousemove(const Gfx::IntPoint& position, unsigned buttons, unsigned modifiers)
+bool Page::handle_mousemove(Gfx::IntPoint const& position, unsigned buttons, unsigned modifiers)
{
return top_level_browsing_context().event_handler().handle_mousemove(position, buttons, modifiers);
}
diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h
index 3bfe12b0b7..cbf6b1e35b 100644
--- a/Userland/Libraries/LibWeb/Page/Page.h
+++ b/Userland/Libraries/LibWeb/Page/Page.h
@@ -32,7 +32,7 @@ public:
~Page();
PageClient& client() { return m_client; }
- const PageClient& client() const { return m_client; }
+ PageClient const& client() const { return m_client; }
HTML::BrowsingContext& top_level_browsing_context() { return *m_top_level_browsing_context; }
HTML::BrowsingContext const& top_level_browsing_context() const { return *m_top_level_browsing_context; }
@@ -47,10 +47,10 @@ public:
void load_html(StringView, const AK::URL&);
- bool handle_mouseup(const Gfx::IntPoint&, unsigned button, unsigned modifiers);
- bool handle_mousedown(const Gfx::IntPoint&, unsigned button, unsigned modifiers);
- bool handle_mousemove(const Gfx::IntPoint&, unsigned buttons, unsigned modifiers);
- bool handle_mousewheel(const Gfx::IntPoint&, unsigned button, unsigned modifiers, int wheel_delta_x, int wheel_delta_y);
+ bool handle_mouseup(Gfx::IntPoint const&, unsigned button, unsigned modifiers);
+ bool handle_mousedown(Gfx::IntPoint const&, unsigned button, unsigned modifiers);
+ bool handle_mousemove(Gfx::IntPoint const&, unsigned buttons, unsigned modifiers);
+ bool handle_mousewheel(Gfx::IntPoint const&, unsigned button, unsigned modifiers, int wheel_delta_x, int wheel_delta_y);
bool handle_keydown(KeyCode, unsigned modifiers, u32 code_point);
bool handle_keyup(KeyCode, unsigned modifiers, u32 code_point);
@@ -83,31 +83,31 @@ public:
virtual Gfx::IntRect screen_rect() const = 0;
virtual CSS::PreferredColorScheme preferred_color_scheme() const = 0;
virtual void page_did_set_document_in_top_level_browsing_context(DOM::Document*) { }
- virtual void page_did_change_title(const String&) { }
+ virtual void page_did_change_title(String const&) { }
virtual void page_did_start_loading(const AK::URL&) { }
virtual void page_did_finish_loading(const AK::URL&) { }
virtual void page_did_change_selection() { }
virtual void page_did_request_cursor_change(Gfx::StandardCursor) { }
- virtual void page_did_request_context_menu(const Gfx::IntPoint&) { }
- virtual void page_did_request_link_context_menu(const Gfx::IntPoint&, const AK::URL&, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers) { }
- virtual void page_did_request_image_context_menu(const Gfx::IntPoint&, const AK::URL&, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers, const Gfx::Bitmap*) { }
- virtual void page_did_click_link(const AK::URL&, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers) { }
- virtual void page_did_middle_click_link(const AK::URL&, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers) { }
- virtual void page_did_enter_tooltip_area(const Gfx::IntPoint&, const String&) { }
+ virtual void page_did_request_context_menu(Gfx::IntPoint const&) { }
+ virtual void page_did_request_link_context_menu(Gfx::IntPoint const&, const AK::URL&, [[maybe_unused]] String const& target, [[maybe_unused]] unsigned modifiers) { }
+ virtual void page_did_request_image_context_menu(Gfx::IntPoint const&, const AK::URL&, [[maybe_unused]] String const& target, [[maybe_unused]] unsigned modifiers, Gfx::Bitmap const*) { }
+ virtual void page_did_click_link(const AK::URL&, [[maybe_unused]] String const& target, [[maybe_unused]] unsigned modifiers) { }
+ virtual void page_did_middle_click_link(const AK::URL&, [[maybe_unused]] String const& target, [[maybe_unused]] unsigned modifiers) { }
+ virtual void page_did_enter_tooltip_area(Gfx::IntPoint const&, String const&) { }
virtual void page_did_leave_tooltip_area() { }
virtual void page_did_hover_link(const AK::URL&) { }
virtual void page_did_unhover_link() { }
- virtual void page_did_invalidate(const Gfx::IntRect&) { }
- virtual void page_did_change_favicon(const Gfx::Bitmap&) { }
+ virtual void page_did_invalidate(Gfx::IntRect const&) { }
+ virtual void page_did_change_favicon(Gfx::Bitmap const&) { }
virtual void page_did_layout() { }
virtual void page_did_request_scroll(i32, i32) { }
virtual void page_did_request_scroll_to(Gfx::IntPoint const&) { }
- virtual void page_did_request_scroll_into_view(const Gfx::IntRect&) { }
- virtual void page_did_request_alert(const String&) { }
- virtual bool page_did_request_confirm(const String&) { return false; }
- virtual String page_did_request_prompt(const String&, const String&) { return {}; }
+ virtual void page_did_request_scroll_into_view(Gfx::IntRect const&) { }
+ virtual void page_did_request_alert(String const&) { }
+ virtual bool page_did_request_confirm(String const&) { return false; }
+ virtual String page_did_request_prompt(String const&, String const&) { return {}; }
virtual String page_did_request_cookie(const AK::URL&, Cookie::Source) { return {}; }
- virtual void page_did_set_cookie(const AK::URL&, const Cookie::ParsedCookie&, Cookie::Source) { }
+ virtual void page_did_set_cookie(const AK::URL&, Cookie::ParsedCookie const&, Cookie::Source) { }
virtual void page_did_update_resource_count(i32) { }
protected:
diff --git a/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp b/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp
index b8397438f2..91dabcc73f 100644
--- a/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp
+++ b/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp
@@ -45,7 +45,7 @@ void paint_border(PaintContext& context, BorderEdge edge, Gfx::FloatRect const&
{
auto rect = a_rect.to_rounded<float>();
- const auto& border_data = [&] {
+ auto const& border_data = [&] {
switch (edge) {
case BorderEdge::Top:
return borders_data.top;
@@ -71,7 +71,7 @@ void paint_border(PaintContext& context, BorderEdge edge, Gfx::FloatRect const&
Gfx::FloatPoint p2;
};
- auto points_for_edge = [](BorderEdge edge, const Gfx::FloatRect& rect) -> Points {
+ auto points_for_edge = [](BorderEdge edge, Gfx::FloatRect const& rect) -> Points {
switch (edge) {
case BorderEdge::Top:
return { rect.top_left(), rect.top_right() };
diff --git a/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp b/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp
index 9afcff46da..74ce00c66d 100644
--- a/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp
+++ b/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp
@@ -35,7 +35,7 @@ Layout::FormAssociatedLabelableNode& LabelablePaintable::layout_box()
return static_cast<Layout::FormAssociatedLabelableNode&>(PaintableBox::layout_box());
}
-LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousedown(Badge<EventHandler>, const Gfx::IntPoint&, unsigned button, unsigned)
+LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned)
{
if (button != GUI::MouseButton::Primary || !layout_box().dom_node().enabled())
return DispatchEventOfSameName::No;
@@ -46,7 +46,7 @@ LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousedown
return DispatchEventOfSameName::Yes;
}
-LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mouseup(Badge<EventHandler>, const Gfx::IntPoint& position, unsigned button, unsigned)
+LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const& position, unsigned button, unsigned)
{
if (!m_tracking_mouse || button != GUI::MouseButton::Primary || !layout_box().dom_node().enabled())
return DispatchEventOfSameName::No;
@@ -61,7 +61,7 @@ LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mouseup(B
return DispatchEventOfSameName::Yes;
}
-LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousemove(Badge<EventHandler>, const Gfx::IntPoint& position, unsigned, unsigned)
+LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const& position, unsigned, unsigned)
{
if (!m_tracking_mouse || !layout_box().dom_node().enabled())
return DispatchEventOfSameName::No;
diff --git a/Userland/Libraries/LibWeb/Painting/Paintable.h b/Userland/Libraries/LibWeb/Painting/Paintable.h
index d272fa185d..2a8b13866a 100644
--- a/Userland/Libraries/LibWeb/Painting/Paintable.h
+++ b/Userland/Libraries/LibWeb/Painting/Paintable.h
@@ -64,12 +64,12 @@ public:
// When these methods return true, the DOM event with the same name will be
// dispatch at the mouse_event_target if it returns a valid DOM::Node, or
// the layout node's associated DOM node if it doesn't.
- virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, const Gfx::IntPoint&, unsigned button, unsigned modifiers);
- virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, const Gfx::IntPoint&, unsigned button, unsigned modifiers);
- virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, const Gfx::IntPoint&, unsigned buttons, unsigned modifiers);
+ virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers);
+ virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers);
+ virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const&, unsigned buttons, unsigned modifiers);
virtual DOM::Node* mouse_event_target() const { return nullptr; }
- virtual bool handle_mousewheel(Badge<EventHandler>, const Gfx::IntPoint&, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y);
+ virtual bool handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint const&, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y);
Layout::Node const& layout_node() const { return m_layout_node; }
Layout::Node& layout_node() { return const_cast<Layout::Node&>(m_layout_node); }
diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp
index 12bfabb273..86f8f5bee4 100644
--- a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp
+++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp
@@ -43,7 +43,7 @@ PaintableWithLines::~PaintableWithLines()
{
}
-void PaintableBox::set_offset(const Gfx::FloatPoint& offset)
+void PaintableBox::set_offset(Gfx::FloatPoint const& offset)
{
m_offset = offset;
// FIXME: This const_cast is gross.
@@ -527,7 +527,7 @@ Optional<HitTestResult> PaintableBox::hit_test(Gfx::FloatPoint const& position,
return {};
}
-Optional<HitTestResult> PaintableWithLines::hit_test(const Gfx::FloatPoint& position, HitTestType type) const
+Optional<HitTestResult> PaintableWithLines::hit_test(Gfx::FloatPoint const& position, HitTestType type) const
{
if (!layout_box().children_are_inline())
return PaintableBox::hit_test(position, type);
diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.h b/Userland/Libraries/LibWeb/Painting/PaintableBox.h
index 028a619fec..7077e814e2 100644
--- a/Userland/Libraries/LibWeb/Painting/PaintableBox.h
+++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.h
@@ -163,7 +163,7 @@ public:
virtual void paint(PaintContext&, PaintPhase) const override;
virtual bool wants_mouse_events() const override { return false; }
- virtual bool handle_mousewheel(Badge<EventHandler>, const Gfx::IntPoint&, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y) override;
+ virtual bool handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint const&, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y) override;
virtual Optional<HitTestResult> hit_test(Gfx::FloatPoint const&, HitTestType) const override;
diff --git a/Userland/Libraries/LibWeb/Painting/StackingContext.h b/Userland/Libraries/LibWeb/Painting/StackingContext.h
index 9ea3e8ca71..3d0a9df1bc 100644
--- a/Userland/Libraries/LibWeb/Painting/StackingContext.h
+++ b/Userland/Libraries/LibWeb/Painting/StackingContext.h
@@ -18,7 +18,7 @@ public:
StackingContext(Layout::Box&, StackingContext* parent);
StackingContext* parent() { return m_parent; }
- const StackingContext* parent() const { return m_parent; }
+ StackingContext const* parent() const { return m_parent; }
enum class StackingContextPaintPhase {
BackgroundAndBorders,
diff --git a/Userland/Libraries/LibWeb/Painting/TextPaintable.cpp b/Userland/Libraries/LibWeb/Painting/TextPaintable.cpp
index 37c02f842a..a209e8e481 100644
--- a/Userland/Libraries/LibWeb/Painting/TextPaintable.cpp
+++ b/Userland/Libraries/LibWeb/Painting/TextPaintable.cpp
@@ -36,7 +36,7 @@ DOM::Node* TextPaintable::mouse_event_target() const
return nullptr;
}
-TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousedown(Badge<EventHandler>, const Gfx::IntPoint& position, unsigned button, unsigned)
+TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const& position, unsigned button, unsigned)
{
auto* label = layout_node().first_ancestor_of_type<Layout::Label>();
if (!label)
@@ -46,7 +46,7 @@ TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousedown(Badge<Eve
return DispatchEventOfSameName::Yes;
}
-TextPaintable::DispatchEventOfSameName TextPaintable::handle_mouseup(Badge<EventHandler>, const Gfx::IntPoint& position, unsigned button, unsigned)
+TextPaintable::DispatchEventOfSameName TextPaintable::handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const& position, unsigned button, unsigned)
{
auto* label = layout_node().first_ancestor_of_type<Layout::Label>();
if (!label)
@@ -57,7 +57,7 @@ TextPaintable::DispatchEventOfSameName TextPaintable::handle_mouseup(Badge<Event
return DispatchEventOfSameName::Yes;
}
-TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousemove(Badge<EventHandler>, const Gfx::IntPoint& position, unsigned button, unsigned)
+TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const& position, unsigned button, unsigned)
{
auto* label = layout_node().first_ancestor_of_type<Layout::Label>();
if (!label)
diff --git a/Userland/Libraries/LibWeb/Painting/TextPaintable.h b/Userland/Libraries/LibWeb/Painting/TextPaintable.h
index 2b61032a1f..5c029062bb 100644
--- a/Userland/Libraries/LibWeb/Painting/TextPaintable.h
+++ b/Userland/Libraries/LibWeb/Painting/TextPaintable.h
@@ -18,9 +18,9 @@ public:
virtual bool wants_mouse_events() const override;
virtual DOM::Node* mouse_event_target() const override;
- virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, const Gfx::IntPoint&, unsigned button, unsigned modifiers) override;
- virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, const Gfx::IntPoint&, unsigned button, unsigned modifiers) override;
- virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, const Gfx::IntPoint&, unsigned button, unsigned modifiers) override;
+ virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override;
+ virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override;
+ virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override;
private:
explicit TextPaintable(Layout::TextNode const&);
diff --git a/Userland/Libraries/LibWeb/SVG/SVGContext.h b/Userland/Libraries/LibWeb/SVG/SVGContext.h
index 2e073a5cce..1073620137 100644
--- a/Userland/Libraries/LibWeb/SVG/SVGContext.h
+++ b/Userland/Libraries/LibWeb/SVG/SVGContext.h
@@ -20,8 +20,8 @@ public:
m_states.append(State());
}
- const Gfx::Color& fill_color() const { return state().fill_color; }
- const Gfx::Color& stroke_color() const { return state().stroke_color; }
+ Gfx::Color const& fill_color() const { return state().fill_color; }
+ Gfx::Color const& stroke_color() const { return state().stroke_color; }
float stroke_width() const { return state().stroke_width; }
void set_fill_color(Gfx::Color color) { state().fill_color = color; }
@@ -40,7 +40,7 @@ private:
float stroke_width { 1.0 };
};
- const State& state() const { return m_states.last(); }
+ State const& state() const { return m_states.last(); }
State& state() { return m_states.last(); }
Gfx::FloatRect m_svg_element_bounds;
diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp
index b7a8effc18..0419dbf527 100644
--- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp
+++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp
@@ -15,7 +15,7 @@
namespace Web::SVG {
-[[maybe_unused]] static void print_instruction(const PathInstruction& instruction)
+[[maybe_unused]] static void print_instruction(PathInstruction const& instruction)
{
VERIFY(PATH_DEBUG);
diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.h b/Userland/Libraries/LibWeb/SVG/SVGPathElement.h
index 1f1dbfa060..1b3ff0a2aa 100644
--- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.h
+++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.h
@@ -20,7 +20,7 @@ public:
SVGPathElement(DOM::Document&, DOM::QualifiedName);
virtual ~SVGPathElement() override = default;
- virtual void parse_attribute(const FlyString& name, const String& value) override;
+ virtual void parse_attribute(FlyString const& name, String const& value) override;
virtual Gfx::Path& get_path() override;
diff --git a/Userland/Libraries/LibWeb/TreeNode.h b/Userland/Libraries/LibWeb/TreeNode.h
index 8b5adb9557..1972c4fd05 100644
--- a/Userland/Libraries/LibWeb/TreeNode.h
+++ b/Userland/Libraries/LibWeb/TreeNode.h
@@ -123,10 +123,10 @@ public:
return {};
}
- bool is_ancestor_of(const TreeNode&) const;
- bool is_inclusive_ancestor_of(const TreeNode&) const;
- bool is_descendant_of(const TreeNode&) const;
- bool is_inclusive_descendant_of(const TreeNode&) const;
+ bool is_ancestor_of(TreeNode const&) const;
+ bool is_inclusive_ancestor_of(TreeNode const&) const;
+ bool is_descendant_of(TreeNode const&) const;
+ bool is_inclusive_descendant_of(TreeNode const&) const;
bool is_following(TreeNode const&) const;
@@ -556,7 +556,7 @@ inline void TreeNode<T>::prepend_child(NonnullRefPtr<T> node)
}
template<typename T>
-inline bool TreeNode<T>::is_ancestor_of(const TreeNode<T>& other) const
+inline bool TreeNode<T>::is_ancestor_of(TreeNode<T> const& other) const
{
for (auto* ancestor = other.parent(); ancestor; ancestor = ancestor->parent()) {
if (ancestor == this)
@@ -566,19 +566,19 @@ inline bool TreeNode<T>::is_ancestor_of(const TreeNode<T>& other) const
}
template<typename T>
-inline bool TreeNode<T>::is_inclusive_ancestor_of(const TreeNode<T>& other) const
+inline bool TreeNode<T>::is_inclusive_ancestor_of(TreeNode<T> const& other) const
{
return &other == this || is_ancestor_of(other);
}
template<typename T>
-inline bool TreeNode<T>::is_descendant_of(const TreeNode<T>& other) const
+inline bool TreeNode<T>::is_descendant_of(TreeNode<T> const& other) const
{
return other.is_ancestor_of(*this);
}
template<typename T>
-inline bool TreeNode<T>::is_inclusive_descendant_of(const TreeNode<T>& other) const
+inline bool TreeNode<T>::is_inclusive_descendant_of(TreeNode<T> const& other) const
{
return other.is_inclusive_ancestor_of(*this);
}
diff --git a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp
index 8355e9811e..96bad7de8f 100644
--- a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp
+++ b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp
@@ -10,7 +10,7 @@
namespace Web::UIEvents {
-MouseEvent::MouseEvent(const FlyString& event_name, double offset_x, double offset_y, double client_x, double client_y)
+MouseEvent::MouseEvent(FlyString const& event_name, double offset_x, double offset_y, double client_x, double client_y)
: UIEvent(event_name)
, m_offset_x(offset_x)
, m_offset_y(offset_y)
diff --git a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h
index 2f3cd652fb..99c2df94f2 100644
--- a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h
+++ b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h
@@ -16,7 +16,7 @@ class MouseEvent final : public UIEvent {
public:
using WrapperType = Bindings::MouseEventWrapper;
- static NonnullRefPtr<MouseEvent> create(const FlyString& event_name, double offset_x, double offset_y, double client_x, double client_y)
+ static NonnullRefPtr<MouseEvent> create(FlyString const& event_name, double offset_x, double offset_y, double client_x, double client_y)
{
return adopt_ref(*new MouseEvent(event_name, offset_x, offset_y, client_x, client_y));
}
@@ -33,7 +33,7 @@ public:
double y() const { return client_y(); }
protected:
- MouseEvent(const FlyString& event_name, double offset_x, double offset_y, double client_x, double client_y);
+ MouseEvent(FlyString const& event_name, double offset_x, double offset_y, double client_x, double client_y);
private:
void set_event_characteristics();
diff --git a/Userland/Libraries/LibWeb/URL/URL.cpp b/Userland/Libraries/LibWeb/URL/URL.cpp
index 61ba8c3d06..0470e86f1c 100644
--- a/Userland/Libraries/LibWeb/URL/URL.cpp
+++ b/Userland/Libraries/LibWeb/URL/URL.cpp
@@ -101,7 +101,7 @@ String URL::username() const
return m_url.username();
}
-void URL::set_username(const String& username)
+void URL::set_username(String const& username)
{
// 1. If this’s URL cannot have a username/password/port, then return.
if (m_url.cannot_have_a_username_or_password_or_port())
@@ -139,7 +139,7 @@ String URL::host() const
return String::formatted("{}:{}", url.host(), *url.port());
}
-void URL::set_host(const String& host)
+void URL::set_host(String const& host)
{
// 1. If this’s URL’s cannot-be-a-base-URL is true, then return.
if (m_url.cannot_be_a_base_url())
diff --git a/Userland/Libraries/LibWeb/URL/URL.h b/Userland/Libraries/LibWeb/URL/URL.h
index 0f17dc1c62..15bea032cb 100644
--- a/Userland/Libraries/LibWeb/URL/URL.h
+++ b/Userland/Libraries/LibWeb/URL/URL.h
@@ -26,7 +26,7 @@ public:
return adopt_ref(*new URL(move(url), move(query)));
}
- static DOM::ExceptionOr<NonnullRefPtr<URL>> create_with_global_object(Bindings::WindowObject&, const String& url, const String& base);
+ static DOM::ExceptionOr<NonnullRefPtr<URL>> create_with_global_object(Bindings::WindowObject&, String const& url, String const& base);
String href() const;
DOM::ExceptionOr<void> set_href(String const&);
diff --git a/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp b/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp
index 34ca58a0e9..b4ff650856 100644
--- a/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp
+++ b/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp
@@ -12,7 +12,7 @@
namespace Web::URL {
-String url_encode(const Vector<QueryParam>& pairs, AK::URL::PercentEncodeSet percent_encode_set)
+String url_encode(Vector<QueryParam> const& pairs, AK::URL::PercentEncodeSet percent_encode_set)
{
StringBuilder builder;
for (size_t i = 0; i < pairs.size(); ++i) {
@@ -185,7 +185,7 @@ bool URLSearchParams::has(String const& name)
.is_end();
}
-void URLSearchParams::set(const String& name, const String& value)
+void URLSearchParams::set(String const& name, String const& value)
{
// 1. If this’s list contains any name-value pairs whose name is name, then set the value of the first such name-value pair to value and remove the others.
auto existing = m_list.find_if([&name](auto& entry) {
diff --git a/Userland/Libraries/LibWeb/URL/URLSearchParams.h b/Userland/Libraries/LibWeb/URL/URLSearchParams.h
index 7fe3ea8114..a2cfe8c7e5 100644
--- a/Userland/Libraries/LibWeb/URL/URLSearchParams.h
+++ b/Userland/Libraries/LibWeb/URL/URLSearchParams.h
@@ -17,7 +17,7 @@ struct QueryParam {
String name;
String value;
};
-String url_encode(const Vector<QueryParam>&, AK::URL::PercentEncodeSet);
+String url_encode(Vector<QueryParam> const&, AK::URL::PercentEncodeSet);
Vector<QueryParam> url_decode(StringView);
class URLSearchParams : public Bindings::Wrappable
diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObject.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObject.cpp
index a6e083f6f9..d90c092eec 100644
--- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObject.cpp
+++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObject.cpp
@@ -33,7 +33,7 @@ void WebAssemblyInstanceObject::initialize(JS::GlobalObject& global_object)
auto& cache = this->cache();
for (auto& export_ : instance.exports()) {
export_.value().visit(
- [&](const Wasm::FunctionAddress& address) {
+ [&](Wasm::FunctionAddress const& address) {
auto object = cache.function_instances.get(address);
if (!object.has_value()) {
object = create_native_function(global_object, address, export_.name());
@@ -41,7 +41,7 @@ void WebAssemblyInstanceObject::initialize(JS::GlobalObject& global_object)
}
m_exports_object->define_direct_property(export_.name(), *object, JS::default_attributes);
},
- [&](const Wasm::MemoryAddress& address) {
+ [&](Wasm::MemoryAddress const& address) {
auto object = cache.memory_instances.get(address);
if (!object.has_value()) {
object = heap().allocate<Web::Bindings::WebAssemblyMemoryObject>(global_object, global_object, address);
@@ -49,7 +49,7 @@ void WebAssemblyInstanceObject::initialize(JS::GlobalObject& global_object)
}
m_exports_object->define_direct_property(export_.name(), *object, JS::default_attributes);
},
- [&](const auto&) {
+ [&](auto const&) {
// FIXME: Implement other exports!
});
}
diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleObject.h b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleObject.h
index b865fab521..38911c36bf 100644
--- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleObject.h
+++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleObject.h
@@ -22,7 +22,7 @@ public:
virtual ~WebAssemblyModuleObject() override = default;
size_t index() const { return m_index; }
- const Wasm::Module& module() const { return WebAssemblyObject::s_compiled_modules.at(m_index).module; }
+ Wasm::Module const& module() const { return WebAssemblyObject::s_compiled_modules.at(m_index).module; }
private:
size_t m_index { 0 };
diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp
index de27ae907c..b0f6e6e330 100644
--- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp
+++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp
@@ -184,7 +184,7 @@ JS::ThrowCompletionOr<size_t> WebAssemblyObject::instantiate_module(Wasm::Module
if (!import_argument.is_undefined()) {
auto* import_object = TRY(import_argument.to_object(global_object));
dbgln("Trying to resolve stuff because import object was specified");
- for (const Wasm::Linker::Name& import_name : linker.unresolved_imports()) {
+ for (Wasm::Linker::Name const& import_name : linker.unresolved_imports()) {
dbgln("Trying to resolve {}::{}", import_name.module, import_name.name);
auto value_or_error = import_object->get(import_name.module);
if (value_or_error.is_error())
@@ -286,7 +286,7 @@ JS::ThrowCompletionOr<size_t> WebAssemblyObject::instantiate_module(Wasm::Module
resolved_imports.set(import_name, Wasm::ExternValue { address });
return {};
},
- [&](const auto&) -> JS::ThrowCompletionOr<void> {
+ [&](auto const&) -> JS::ThrowCompletionOr<void> {
// FIXME: Implement these.
dbgln("Unimplemented import of non-function attempted");
return vm.throw_completion<JS::TypeError>(global_object, "LinkError: Not Implemented");
@@ -328,7 +328,7 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyObject::instantiate)
}
auto* buffer = buffer_or_error.release_value();
- const Wasm::Module* module { nullptr };
+ Wasm::Module const* module { nullptr };
if (is<JS::ArrayBuffer>(buffer) || is<JS::TypedArrayBase>(buffer)) {
auto result = parse_module(global_object, buffer);
if (result.is_error()) {
@@ -386,7 +386,7 @@ JS::Value to_js_value(JS::GlobalObject& global_object, Wasm::Value& wasm_value)
VERIFY_NOT_REACHED();
}
-JS::ThrowCompletionOr<Wasm::Value> to_webassembly_value(JS::GlobalObject& global_object, JS::Value value, const Wasm::ValueType& type)
+JS::ThrowCompletionOr<Wasm::Value> to_webassembly_value(JS::GlobalObject& global_object, JS::Value value, Wasm::ValueType const& type)
{
static ::Crypto::SignedBigInteger two_64 = "1"_sbigint.shift_left(64);
auto& vm = global_object.vm();
@@ -439,7 +439,7 @@ JS::ThrowCompletionOr<Wasm::Value> to_webassembly_value(JS::GlobalObject& global
JS::NativeFunction* create_native_function(JS::GlobalObject& global_object, Wasm::FunctionAddress address, String const& name)
{
Optional<Wasm::FunctionType> type;
- WebAssemblyObject::s_abstract_machine.store().get(address)->visit([&](const auto& value) { type = value.type(); });
+ WebAssemblyObject::s_abstract_machine.store().get(address)->visit([&](auto const& value) { type = value.type(); });
if (auto entry = WebAssemblyObject::s_global_cache.function_instances.get(address); entry.has_value())
return *entry;
diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.h b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.h
index 834c2cc826..481138dd22 100644
--- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.h
+++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.h
@@ -17,7 +17,7 @@ class WebAssemblyMemoryObject;
JS::ThrowCompletionOr<size_t> parse_module(JS::GlobalObject& global_object, JS::Object* buffer);
JS::NativeFunction* create_native_function(JS::GlobalObject& global_object, Wasm::FunctionAddress address, String const& name);
JS::Value to_js_value(JS::GlobalObject& global_object, Wasm::Value& wasm_value);
-JS::ThrowCompletionOr<Wasm::Value> to_webassembly_value(JS::GlobalObject& global_object, JS::Value value, const Wasm::ValueType& type);
+JS::ThrowCompletionOr<Wasm::Value> to_webassembly_value(JS::GlobalObject& global_object, JS::Value value, Wasm::ValueType const& type);
class WebAssemblyObject final : public JS::Object {
JS_OBJECT(WebAssemblyObject, JS::Object);
diff --git a/Userland/Libraries/LibWeb/WebContentClient.cpp b/Userland/Libraries/LibWeb/WebContentClient.cpp
index 531cf0cda3..ae75861d6c 100644
--- a/Userland/Libraries/LibWeb/WebContentClient.cpp
+++ b/Userland/Libraries/LibWeb/WebContentClient.cpp
@@ -23,7 +23,7 @@ void WebContentClient::die()
on_web_content_process_crash();
}
-void WebContentClient::did_paint(const Gfx::IntRect&, i32 bitmap_id)
+void WebContentClient::did_paint(Gfx::IntRect const&, i32 bitmap_id)
{
m_view.notify_server_did_paint({}, bitmap_id);
}
diff --git a/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp b/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp
index ff3bdeba68..c351b95501 100644
--- a/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp
+++ b/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp
@@ -53,7 +53,7 @@ RefPtr<Protocol::WebSocket> WebSocketClientManager::connect(const AK::URL& url,
}
// https://websockets.spec.whatwg.org/#dom-websocket-websocket
-DOM::ExceptionOr<NonnullRefPtr<WebSocket>> WebSocket::create_with_global_object(Bindings::WindowObject& window, const String& url)
+DOM::ExceptionOr<NonnullRefPtr<WebSocket>> WebSocket::create_with_global_object(Bindings::WindowObject& window, String const& url)
{
AK::URL url_record(url);
if (!url_record.is_valid())
@@ -169,7 +169,7 @@ DOM::ExceptionOr<void> WebSocket::close(Optional<u16> code, Optional<String> rea
}
// https://websockets.spec.whatwg.org/#dom-websocket-send
-DOM::ExceptionOr<void> WebSocket::send(const String& data)
+DOM::ExceptionOr<void> WebSocket::send(String const& data)
{
auto state = ready_state();
if (state == WebSocket::ReadyState::Connecting)
diff --git a/Userland/Libraries/LibWeb/WebSockets/WebSocket.h b/Userland/Libraries/LibWeb/WebSockets/WebSocket.h
index cf9c02795c..7d2b292592 100644
--- a/Userland/Libraries/LibWeb/WebSockets/WebSocket.h
+++ b/Userland/Libraries/LibWeb/WebSockets/WebSocket.h
@@ -64,7 +64,7 @@ public:
return adopt_ref(*new WebSocket(window, url));
}
- static DOM::ExceptionOr<NonnullRefPtr<WebSocket>> create_with_global_object(Bindings::WindowObject& window, const String& url);
+ static DOM::ExceptionOr<NonnullRefPtr<WebSocket>> create_with_global_object(Bindings::WindowObject& window, String const& url);
virtual ~WebSocket() override;
@@ -84,11 +84,11 @@ public:
String extensions() const;
String protocol() const;
- const String& binary_type() { return m_binary_type; };
- void set_binary_type(const String& type) { m_binary_type = type; };
+ String const& binary_type() { return m_binary_type; };
+ void set_binary_type(String const& type) { m_binary_type = type; };
DOM::ExceptionOr<void> close(Optional<u16> code, Optional<String> reason);
- DOM::ExceptionOr<void> send(const String& data);
+ DOM::ExceptionOr<void> send(String const& data);
private:
virtual void ref_event_target() override { ref(); }
diff --git a/Userland/Libraries/LibWeb/WebViewHooks.h b/Userland/Libraries/LibWeb/WebViewHooks.h
index 88f728695f..483255748b 100644
--- a/Userland/Libraries/LibWeb/WebViewHooks.h
+++ b/Userland/Libraries/LibWeb/WebViewHooks.h
@@ -15,25 +15,25 @@ namespace Web {
class WebViewHooks {
public:
- Function<void(const Gfx::IntPoint& screen_position)> on_context_menu_request;
- Function<void(const AK::URL&, const String& target, unsigned modifiers)> on_link_click;
- Function<void(const AK::URL&, const Gfx::IntPoint& screen_position)> on_link_context_menu_request;
- Function<void(const AK::URL&, const Gfx::IntPoint& screen_position, const Gfx::ShareableBitmap&)> on_image_context_menu_request;
- Function<void(const AK::URL&, const String& target, unsigned modifiers)> on_link_middle_click;
+ Function<void(Gfx::IntPoint const& screen_position)> on_context_menu_request;
+ Function<void(const AK::URL&, String const& target, unsigned modifiers)> on_link_click;
+ Function<void(const AK::URL&, Gfx::IntPoint const& screen_position)> on_link_context_menu_request;
+ Function<void(const AK::URL&, Gfx::IntPoint const& screen_position, Gfx::ShareableBitmap const&)> on_image_context_menu_request;
+ Function<void(const AK::URL&, String const& target, unsigned modifiers)> on_link_middle_click;
Function<void(const AK::URL&)> on_link_hover;
- Function<void(const String&)> on_title_change;
+ Function<void(String const&)> on_title_change;
Function<void(const AK::URL&)> on_load_start;
Function<void(const AK::URL&)> on_load_finish;
- Function<void(const Gfx::Bitmap&)> on_favicon_change;
+ Function<void(Gfx::Bitmap const&)> on_favicon_change;
Function<void(const AK::URL&)> on_url_drop;
Function<void(DOM::Document*)> on_set_document;
- Function<void(const AK::URL&, const String&)> on_get_source;
- Function<void(const String&)> on_get_dom_tree;
+ Function<void(const AK::URL&, String const&)> on_get_source;
+ Function<void(String const&)> on_get_dom_tree;
Function<void(i32 node_id, String const& specified_style, String const& computed_style, String const& custom_properties, String const& node_box_sizing)> on_get_dom_node_properties;
Function<void(i32 message_id)> on_js_console_new_message;
Function<void(i32 start_index, Vector<String> const& message_types, Vector<String> const& messages)> on_get_js_console_messages;
Function<String(const AK::URL& url, Cookie::Source source)> on_get_cookie;
- Function<void(const AK::URL& url, const Cookie::ParsedCookie& cookie, Cookie::Source source)> on_set_cookie;
+ Function<void(const AK::URL& url, Cookie::ParsedCookie const& cookie, Cookie::Source source)> on_set_cookie;
Function<void(i32 count_waiting)> on_resource_status_change;
};
diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
index 3a3acad6ae..3b7a42204c 100644
--- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
+++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
@@ -50,7 +50,7 @@ void XMLHttpRequest::set_ready_state(ReadyState ready_state)
dispatch_event(DOM::Event::create(EventNames::readystatechange));
}
-void XMLHttpRequest::fire_progress_event(const String& event_name, u64 transmitted, u64 length)
+void XMLHttpRequest::fire_progress_event(String const& event_name, u64 transmitted, u64 length)
{
ProgressEventInit event_init {};
event_init.length_computable = true;
@@ -371,7 +371,7 @@ Optional<MimeSniff::MimeType> XMLHttpRequest::extract_mime_type(HashMap<String,
}
// https://fetch.spec.whatwg.org/#forbidden-header-name
-static bool is_forbidden_header_name(const String& header_name)
+static bool is_forbidden_header_name(String const& header_name)
{
if (header_name.starts_with("Proxy-", CaseSensitivity::CaseInsensitive) || header_name.starts_with("Sec-", CaseSensitivity::CaseInsensitive))
return true;
@@ -381,14 +381,14 @@ static bool is_forbidden_header_name(const String& header_name)
}
// https://fetch.spec.whatwg.org/#forbidden-method
-static bool is_forbidden_method(const String& method)
+static bool is_forbidden_method(String const& method)
{
auto lowercase_method = method.to_lowercase();
return lowercase_method.is_one_of("connect", "trace", "track");
}
// https://fetch.spec.whatwg.org/#concept-method-normalize
-static String normalize_method(const String& method)
+static String normalize_method(String const& method)
{
auto lowercase_method = method.to_lowercase();
if (lowercase_method.is_one_of("delete", "get", "head", "options", "post", "put"))
@@ -397,14 +397,14 @@ static String normalize_method(const String& method)
}
// https://fetch.spec.whatwg.org/#concept-header-value-normalize
-static String normalize_header_value(const String& header_value)
+static String normalize_header_value(String const& header_value)
{
// FIXME: I'm not sure if this is the right trim, it should only be HTML whitespace bytes.
return header_value.trim_whitespace();
}
// https://xhr.spec.whatwg.org/#dom-xmlhttprequest-setrequestheader
-DOM::ExceptionOr<void> XMLHttpRequest::set_request_header(const String& header, const String& value)
+DOM::ExceptionOr<void> XMLHttpRequest::set_request_header(String const& header, String const& value)
{
if (m_ready_state != ReadyState::Opened)
return DOM::InvalidStateError::create("XHR readyState is not OPENED");
@@ -424,7 +424,7 @@ DOM::ExceptionOr<void> XMLHttpRequest::set_request_header(const String& header,
}
// https://xhr.spec.whatwg.org/#dom-xmlhttprequest-open
-DOM::ExceptionOr<void> XMLHttpRequest::open(const String& method, const String& url)
+DOM::ExceptionOr<void> XMLHttpRequest::open(String const& method, String const& url)
{
// FIXME: Let settingsObject be this’s relevant settings object.
diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h
index 543b35e81f..268a5d8639 100644
--- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h
+++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h
@@ -54,13 +54,13 @@ public:
DOM::ExceptionOr<JS::Value> response();
Bindings::XMLHttpRequestResponseType response_type() const { return m_response_type; }
- DOM::ExceptionOr<void> open(const String& method, const String& url);
+ DOM::ExceptionOr<void> open(String const& method, String const& url);
DOM::ExceptionOr<void> send(String body);
- DOM::ExceptionOr<void> set_request_header(const String& header, const String& value);
+ DOM::ExceptionOr<void> set_request_header(String const& header, String const& value);
void set_response_type(Bindings::XMLHttpRequestResponseType type) { m_response_type = type; }
- String get_response_header(const String& name) { return m_response_headers.get(name).value_or({}); }
+ String get_response_header(String const& name) { return m_response_headers.get(name).value_or({}); }
String get_all_response_headers() const;
Bindings::CallbackType* onreadystatechange();
@@ -75,7 +75,7 @@ private:
void set_ready_state(ReadyState);
void set_status(unsigned status) { m_status = status; }
- void fire_progress_event(const String&, u64, u64);
+ void fire_progress_event(String const&, u64, u64);
MimeSniff::MimeType get_response_mime_type() const;
Optional<StringView> get_final_encoding() const;
diff --git a/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp b/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp
index 532d0f695f..7f594c2719 100644
--- a/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp
+++ b/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp
@@ -9,7 +9,7 @@
#include <LibWeb/XML/XMLDocumentBuilder.h>
inline namespace {
-extern const char* s_xhtml_unified_dtd;
+extern char const* s_xhtml_unified_dtd;
}
static FlyString s_html_namespace = "http://www.w3.org/1999/xhtml";
@@ -44,7 +44,7 @@ XMLDocumentBuilder::XMLDocumentBuilder(DOM::Document& document, XMLScriptingSupp
{
}
-void XMLDocumentBuilder::element_start(const XML::Name& name, const HashMap<XML::Name, String>& attributes)
+void XMLDocumentBuilder::element_start(const XML::Name& name, HashMap<XML::Name, String> const& attributes)
{
if (m_has_error)
return;
@@ -116,7 +116,7 @@ void XMLDocumentBuilder::element_end(const XML::Name& name)
m_current_node = m_current_node->parent_node();
}
-void XMLDocumentBuilder::text(const String& data)
+void XMLDocumentBuilder::text(String const& data)
{
if (m_has_error)
return;
@@ -133,7 +133,7 @@ void XMLDocumentBuilder::text(const String& data)
}
}
-void XMLDocumentBuilder::comment(const String& data)
+void XMLDocumentBuilder::comment(String const& data)
{
if (m_has_error)
return;
@@ -244,7 +244,7 @@ void XMLDocumentBuilder::document_end()
}
inline namespace {
-const char* s_xhtml_unified_dtd = R"xmlxmlxml(
+char const* s_xhtml_unified_dtd = R"xmlxmlxml(
<!ENTITY Tab "&#x9;"><!ENTITY NewLine "&#xA;"><!ENTITY excl "&#x21;"><!ENTITY quot "&#x22;"><!ENTITY QUOT "&#x22;"><!ENTITY num "&#x23;"><!ENTITY dollar "&#x24;"><!ENTITY percnt "&#x25;"><!ENTITY amp "&#x26;#x26;"><!ENTITY AMP "&#x26;#x26;"><!ENTITY apos "&#x27;"><!ENTITY lpar "&#x28;"><!ENTITY rpar "&#x29;"><!ENTITY ast "&#x2A;"><!ENTITY midast "&#x2A;"><!ENTITY plus "&#x2B;"><!ENTITY comma "&#x2C;"><!ENTITY period "&#x2E;"><!ENTITY sol "&#x2F;"><!ENTITY colon "&#x3A;"><!ENTITY semi "&#x3B;"><!ENTITY lt "&#x26;#x3C;"><!ENTITY LT "&#x26;#x3C;"><!ENTITY nvlt "&#x26;#x3C;&#x20D2;"><!ENTITY equals "&#x3D;"><!ENTITY bne "&#x3D;&#x20E5;"><!ENTITY gt "&#x3E;"><!ENTITY GT "&#x3E;"><!ENTITY nvgt "&#x3E;&#x20D2;"><!ENTITY quest "&#x3F;"><!ENTITY commat "&#x40;"><!ENTITY lsqb "&#x5B;"><!ENTITY lbrack "&#x5B;"><!ENTITY bsol "&#x5C;"><!ENTITY rsqb "&#x5D;"><!ENTITY rbrack "&#x5D;"><!ENTITY Hat "&#x5E;"><!ENTITY lowbar "&#x5F;"><!ENTITY UnderBar "&#x5F;"><!ENTITY grave "&#x60;"><!ENTITY DiacriticalGrave "&#x60;"><!ENTITY fjlig "&#x66;&#x6A;"><!ENTITY lcub "&#x7B;"><!ENTITY lbrace "&#x7B;"><!ENTITY verbar "&#x7C;"><!ENTITY vert "&#x7C;"><!ENTITY VerticalLine "&#x7C;"><!ENTITY rcub "&#x7D;"><!ENTITY rbrace "&#x7D;"><!ENTITY nbsp "&#xA0;"><!ENTITY NonBreakingSpace "&#xA0;"><!ENTITY iexcl "&#xA1;"><!ENTITY cent "&#xA2;"><!ENTITY pound "&#xA3;"><!ENTITY curren "&#xA4;"><!ENTITY yen "&#xA5;"><!ENTITY brvbar "&#xA6;"><!ENTITY sect "&#xA7;"><!ENTITY Dot "&#xA8;"><!ENTITY die "&#xA8;"><!ENTITY DoubleDot "&#xA8;"><!ENTITY uml "&#xA8;"><!ENTITY copy "&#xA9;"><!ENTITY COPY "&#xA9;"><!ENTITY ordf "&#xAA;"><!ENTITY laquo "&#xAB;"><!ENTITY not "&#xAC;"><!ENTITY shy "&#xAD;"><!ENTITY reg "&#xAE;"><!ENTITY circledR "&#xAE;"><!ENTITY REG "&#xAE;"><!ENTITY macr "&#xAF;"><!ENTITY strns "&#xAF;"><!ENTITY deg "&#xB0;"><!ENTITY plusmn "&#xB1;"><!ENTITY pm "&#xB1;"><!ENTITY PlusMinus "&#xB1;"><!ENTITY sup2 "&#xB2;"><!ENTITY sup3 "&#xB3;"><!ENTITY acute "&#xB4;"><!ENTITY DiacriticalAcute "&#xB4;"><!ENTITY micro "&#xB5;"><!ENTITY para "&#xB6;"><!ENTITY middot "&#xB7;"><!ENTITY centerdot "&#xB7;"><!ENTITY CenterDot "&#xB7;"><!ENTITY cedil "&#xB8;"><!ENTITY Cedilla "&#xB8;"><!ENTITY sup1 "&#xB9;"><!ENTITY ordm "&#xBA;"><!ENTITY raquo "&#xBB;"><!ENTITY frac14 "&#xBC;"><!ENTITY frac12 "&#xBD;"><!ENTITY half "&#xBD;"><!ENTITY frac34 "&#xBE;"><!ENTITY iquest "&#xBF;"><!ENTITY Agrave "&#xC0;"><!ENTITY Aacute "&#xC1;"><!ENTITY Acirc "&#xC2;"><!ENTITY Atilde "&#xC3;"><!ENTITY Auml "&#xC4;"><!ENTITY Aring "&#xC5;"><!ENTITY angst "&#xC5;"><!ENTITY AElig "&#xC6;"><!ENTITY Ccedil "&#xC7;"><!ENTITY Egrave "&#xC8;"><!ENTITY Eacute "&#xC9;"><!ENTITY Ecirc "&#xCA;"><!ENTITY Euml "&#xCB;"><!ENTITY Igrave "&#xCC;"><!ENTITY Iacute "&#xCD;"><!ENTITY Icirc "&#xCE;"><!ENTITY Iuml "&#xCF;"><!ENTITY ETH "&#xD0;"><!ENTITY Ntilde "&#xD1;"><!ENTITY Ograve "&#xD2;"><!ENTITY Oacute "&#xD3;"><!ENTITY Ocirc "&#xD4;"><!ENTITY Otilde "&#xD5;"><!ENTITY Ouml "&#xD6;"><!ENTITY times "&#xD7;"><!ENTITY Oslash "&#xD8;"><!ENTITY Ugrave "&#xD9;"><!ENTITY Uacute "&#xDA;"><!ENTITY Ucirc "&#xDB;"><!ENTITY Uuml "&#xDC;"><!ENTITY Yacute "&#xDD;"><!ENTITY THORN "&#xDE;"><!ENTITY szlig "&#xDF;"><!ENTITY agrave "&#xE0;"><!ENTITY aacute "&#xE1;"><!ENTITY acirc "&#xE2;"><!ENTITY atilde "&#xE3;"><!ENTITY auml "&#xE4;"><!ENTITY aring "&#xE5;"><!ENTITY aelig "&#xE6;"><!ENTITY ccedil "&#xE7;"><!ENTITY egrave "&#xE8;"><!ENTITY eacute "&#xE9;"><!ENTITY ecirc "&#xEA;"><!ENTITY euml "&#xEB;"><!ENTITY igrave "&#xEC;"><!ENTITY iacute "&#xED;"><!ENTITY icirc "&#xEE;"><!ENTITY iuml "&#xEF;"><!ENTITY eth "&#xF0;"><!ENTITY ntilde "&#xF1;"><!ENTITY ograve "&#xF2;"><!ENTITY oacute "&#xF3;"><!ENTITY ocirc "&#xF4;"><!ENTITY otilde "&#xF5;"><!ENTITY ouml "&#xF6;"><!ENTITY divide "&#xF7;"><!ENTITY div "&#xF7;"><!ENTITY oslash "&#xF8;"><!ENTITY ugrave "&#xF9;"><!ENTITY uacute "&#xFA;"><!ENTITY ucirc "&#xFB;"><!ENTITY uuml "&#xFC;"><!ENTITY yacute "&#xFD;"><!ENTITY thorn "&#xFE;"><!ENTITY yuml "&#xFF;"><!ENTITY Amacr "&#x100;"><!ENTITY amacr "&#x101;"><!ENTITY Abreve "&#x102;"><!ENTITY abreve "&#x103;"><!ENTITY Aogon "&#x104;"><!ENTITY aogon "&#x105;"><!ENTITY Cacute "&#x106;"><!ENTITY cacute "&#x107;"><!ENTITY Ccirc "&#x108;"><!ENTITY ccirc "&#x109;"><!ENTITY Cdot "&#x10A;"><!ENTITY cdot "&#x10B;"><!ENTITY Ccaron "&#x10C;"><!ENTITY ccaron "&#x10D;"><!ENTITY Dcaron "&#x10E;"><!ENTITY dcaron "&#x10F;"><!ENTITY Dstrok "&#x110;"><!ENTITY dstrok "&#x111;"><!ENTITY Emacr "&#x112;"><!ENTITY emacr "&#x113;"><!ENTITY Edot "&#x116;"><!ENTITY edot "&#x117;"><!ENTITY Eogon "&#x118;"><!ENTITY eogon "&#x119;"><!ENTITY Ecaron "&#x11A;"><!ENTITY ecaron "&#x11B;"><!ENTITY Gcirc "&#x11C;"><!ENTITY gcirc "&#x11D;"><!ENTITY Gbreve "&#x11E;"><!ENTITY gbreve "&#x11F;"><!ENTITY Gdot "&#x120;"><!ENTITY gdot "&#x121;"><!ENTITY Gcedil "&#x122;"><!ENTITY Hcirc "&#x124;"><!ENTITY hcirc "&#x125;"><!ENTITY Hstrok "&#x126;"><!ENTITY hstrok "&#x127;"><!ENTITY Itilde "&#x128;"><!ENTITY itilde "&#x129;"><!ENTITY Imacr "&#x12A;"><!ENTITY imacr "&#x12B;"><!ENTITY Iogon "&#x12E;"><!ENTITY iogon "&#x12F;"><!ENTITY Idot "&#x130;"><!ENTITY imath "&#x131;"><!ENTITY inodot "&#x131;"><!ENTITY IJlig "&#x132;"><!ENTITY ijlig "&#x133;"><!ENTITY Jcirc "&#x134;"><!ENTITY jcirc "&#x135;"><!ENTITY Kcedil "&#x136;"><!ENTITY kcedil "&#x137;"><!ENTITY kgreen "&#x138;"><!ENTITY Lacute "&#x139;"><!ENTITY lacute "&#x13A;"><!ENTITY Lcedil "&#x13B;"><!ENTITY lcedil "&#x13C;"><!ENTITY Lcaron "&#x13D;"><!ENTITY lcaron "&#x13E;"><!ENTITY Lmidot "&#x13F;"><!ENTITY lmidot "&#x140;"><!ENTITY Lstrok "&#x141;"><!ENTITY lstrok "&#x142;"><!ENTITY Nacute "&#x143;"><!ENTITY nacute "&#x144;"><!ENTITY Ncedil "&#x145;"><!ENTITY ncedil "&#x146;"><!ENTITY Ncaron "&#x147;"><!ENTITY ncaron "&#x148;"><!ENTITY napos "&#x149;"><!ENTITY ENG "&#x14A;"><!ENTITY eng "&#x14B;"><!ENTITY Omacr "&#x14C;"><!ENTITY omacr "&#x14D;"><!ENTITY Odblac "&#x150;"><!ENTITY odblac "&#x151;"><!ENTITY OElig "&#x152;"><!ENTITY oelig "&#x153;"><!ENTITY Racute "&#x154;"><!ENTITY racute "&#x155;"><!ENTITY Rcedil "&#x156;"><!ENTITY rcedil "&#x157;"><!ENTITY Rcaron "&#x158;"><!ENTITY rcaron "&#x159;"><!ENTITY Sacute "&#x15A;"><!ENTITY sacute "&#x15B;"><!ENTITY Scirc "&#x15C;"><!ENTITY scirc "&#x15D;"><!ENTITY Scedil "&#x15E;"><!ENTITY scedil "&#x15F;"><!ENTITY Scaron "&#x160;"><!ENTITY scaron "&#x161;"><!ENTITY Tcedil "&#x162;"><!ENTITY tcedil "&#x163;"><!ENTITY Tcaron "&#x164;"><!ENTITY tcaron "&#x165;"><!ENTITY Tstrok "&#x166;"><!ENTITY tstrok "&#x167;"><!ENTITY Utilde "&#x168;"><!ENTITY utilde "&#x169;"><!ENTITY Umacr "&#x16A;"><!ENTITY umacr "&#x16B;"><!ENTITY Ubreve "&#x16C;"><!ENTITY ubreve "&#x16D;"><!ENTITY Uring "&#x16E;"><!ENTITY uring "&#x16F;"><!ENTITY Udblac "&#x170;"><!ENTITY udblac "&#x171;"><!ENTITY Uogon "&#x172;"><!ENTITY uogon "&#x173;"><!ENTITY Wcirc "&#x174;"><!ENTITY wcirc "&#x175;"><!ENTITY Ycirc "&#x176;"><!ENTITY ycirc "&#x177;"><!ENTITY Yuml "&#x178;"><!ENTITY Zacute "&#x179;"><!ENTITY zacute "&#x17A;"><!ENTITY Zdot "&#x17B;"><!ENTITY zdot "&#x17C;"><!ENTITY Zcaron "&#x17D;"><!ENTITY zcaron "&#x17E;"><!ENTITY fnof "&#x192;"><!ENTITY imped "&#x1B5;"><!ENTITY gacute "&#x1F5;"><!ENTITY jmath "&#x237;"><!ENTITY circ "&#x2C6;"><!ENTITY caron "&#x2C7;"><!ENTITY Hacek "&#x2C7;"><!ENTITY breve "&#x2D8;"><!ENTITY Breve "&#x2D8;"><!ENTITY dot "&#x2D9;"><!ENTITY DiacriticalDot "&#x2D9;"><!ENTITY ring "&#x2DA;"><!ENTITY ogon "&#x2DB;"><!ENTITY tilde "&#x2DC;"><!ENTITY DiacriticalTilde "&#x2DC;"><!ENTITY dblac "&#x2DD;"><!ENTITY DiacriticalDoubleAcute "&#x2DD;"><!ENTITY DownBreve "&#x311;"><!ENTITY Alpha "&#x391;"><!ENTITY Beta "&#x392;"><!ENTITY Gamma "&#x393;"><!ENTITY Delta "&#x394;"><!ENTITY Epsilon "&#x395;"><!ENTITY Zeta "&#x396;"><!ENTITY Eta "&#x397;"><!ENTITY Theta "&#x398;"><!ENTITY Iota "&#x399;"><!ENTITY Kappa "&#x39A;"><!ENTITY Lambda "&#x39B;"><!ENTITY Mu "&#x39C;"><!ENTITY Nu "&#x39D;"><!ENTITY Xi "&#x39E;"><!ENTITY Omicron "&#x39F;"><!ENTITY Pi "&#x3A0;"><!ENTITY Rho "&#x3A1;"><!ENTITY Sigma "&#x3A3;"><!ENTITY Tau "&#x3A4;"><!ENTITY Upsilon "&#x3A5;"><!ENTITY Phi "&#x3A6;"><!ENTITY Chi "&#x3A7;"><!ENTITY Psi "&#x3A8;"><!ENTITY Omega "&#x3A9;"><!ENTITY ohm "&#x3A9;"><!ENTITY alpha "&#x3B1;"><!ENTITY beta "&#x3B2;"><!ENTITY gamma "&#x3B3;"><!ENTITY delta "&#x3B4;"><!ENTITY epsi "&#x3B5;"><!ENTITY epsilon "&#x3B5;"><!ENTITY zeta "&#x3B6;"><!ENTITY eta "&#x3B7;"><!ENTITY theta "&#x3B8;"><!ENTITY iota "&#x3B9;"><!ENTITY kappa "&#x3BA;"><!ENTITY lambda "&#x3BB;"><!ENTITY mu "&#x3BC;"><!ENTITY nu "&#x3BD;"><!ENTITY xi "&#x3BE;"><!ENTITY omicron "&#x3BF;"><!ENTITY pi "&#x3C0;"><!ENTITY rho "&#x3C1;"><!ENTITY sigmav "&#x3C2;"><!ENTITY varsigma "&#x3C2;"><!ENTITY sigmaf "&#x3C2;"><!ENTITY sigma "&#x3C3;"><!ENTITY tau "&#x3C4;"><!ENTITY upsi "&#x3C5;"><!ENTITY upsilon "&#x3C5;"><!ENTITY phi "&#x3C6;"><!ENTITY chi "&#x3C7;"><!ENTITY psi "&#x3C8;"><!ENTITY omega "&#x3C9;"><!ENTITY thetav "&#x3D1;"><!ENTITY vartheta "&#x3D1;"><!ENTITY thetasym "&#x3D1;"><!ENTITY Upsi "&#x3D2;"><!ENTITY upsih "&#x3D2;"><!ENTITY straightphi "&#x3D5;"><!ENTITY phiv "&#x3D5;"><!ENTITY varphi "&#x3D5;"><!ENTITY piv "&#x3D6;"><!ENTITY varpi "&#x3D6;"><!ENTITY Gammad "&#x3DC;"><!ENTITY gammad "&#x3DD;"><!ENTITY digamma "&#x3DD;"><!ENTITY kappav "&#x3F0;"><!ENTITY varkappa "&#x3F0;"><!ENTITY rhov "&#x3F1;"><!ENTITY varrho "&#x3F1;"><!ENTITY epsiv "&#x3F5;"><!ENTITY straightepsilon "&#x3F5;"><!ENTITY varepsilon "&#x3F5;"><!ENTITY bepsi "&#x3F6;"><!ENTITY backepsilon "&#x3F6;"><!ENTITY IOcy "&#x401;"><!ENTITY DJcy "&#x402;"><!ENTITY GJcy "&#x403;"><!ENTITY Jukcy "&#x404;"><!ENTITY DScy "&#x405;"><!ENTITY Iukcy "&#x406;"><!ENTITY YIcy "&#x407;"><!ENTITY Jsercy "&#x408;"><!ENTITY LJcy "&#x409;"><!ENTITY NJcy "&#x40A;"><!ENTITY TSHcy "&#x40B;"><!ENTITY KJcy "&#x40C;"><!ENTITY Ubrcy "&#x40E;"><!ENTITY DZcy "&#x40F;"><!ENTITY Acy "&#x410;"><!ENTITY Bcy "&#x411;"><!ENTITY Vcy "&#x412;"><!ENTITY Gcy "&#x413;"><!ENTITY Dcy "&#x414;"><!ENTITY IEcy "&#x415;"><!ENTITY ZHcy "&#x416;"><!ENTITY Zcy "&#x417;"><!ENTITY Icy "&#x418;"><!ENTITY Jcy "&#x419;"><!ENTITY Kcy "&#x41A;"><!ENTITY Lcy "&#x41B;"><!ENTITY Mcy "&#x41C;"><!ENTITY Ncy "&#x41D;"><!ENTITY Ocy "&#x41E;"><!ENTITY Pcy "&#x41F;"><!ENTITY Rcy "&#x420;"><!ENTITY Scy "&#x421;"><!ENTITY Tcy "&#x422;"><!ENTITY Ucy "&#x423;"><!ENTITY Fcy "&#x424;"><!ENTITY KHcy "&#x425;"><!ENTITY TScy "&#x426;"><!ENTITY CHcy "&#x427;"><!ENTITY SHcy "&#x428;"><!ENTITY SHCHcy "&#x429;"><!ENTITY HARDcy "&#x42A;"><!ENTITY Ycy "&#x42B;"><!ENTITY SOFTcy "&#x42C;"><!ENTITY Ecy "&#x42D;"><!ENTITY YUcy "&#x42E;"><!ENTITY YAcy "&#x42F;"><!ENTITY acy "&#x430;"><!ENTITY bcy "&#x431;"><!ENTITY vcy "&#x432;"><!ENTITY gcy "&#x433;"><!ENTITY dcy "&#x434;"><!ENTITY iecy "&#x435;"><!ENTITY zhcy "&#x436;"><!ENTITY zcy "&#x437;"><!ENTITY icy "&#x438;"><!ENTITY jcy "&#x439;"><!ENTITY kcy "&#x43A;"><!ENTITY lcy "&#x43B;"><!ENTITY mcy "&#x43C;"><!ENTITY ncy "&#x43D;"><!ENTITY ocy "&#x43E;"><!ENTITY pcy "&#x43F;"><!ENTITY rcy "&#x440;"><!ENTITY scy "&#x441;"><!ENTITY tcy "&#x442;"><!ENTITY ucy "&#x443;"><!ENTITY fcy "&#x444;"><!ENTITY khcy "&#x445;"><!ENTITY tscy "&#x446;"><!ENTITY chcy "&#x447;"><!ENTITY shcy "&#x448;"><!ENTITY shchcy "&#x449;"><!ENTITY hardcy "&#x44A;"><!ENTITY ycy "&#x44B;"><!ENTITY softcy "&#x44C;"><!ENTITY ecy "&#x44D;"><!ENTITY yucy "&#x44E;"><!ENTITY yacy "&#x44F;"><!ENTITY iocy "&#x451;"><!ENTITY djcy "&#x452;"><!ENTITY gjcy "&#x453;"><!ENTITY jukcy "&#x454;"><!ENTITY dscy "&#x455;"><!ENTITY iukcy "&#x456;"><!ENTITY yicy "&#x457;"><!ENTITY jsercy "&#x458;"><!ENTITY ljcy "&#x459;"><!ENTITY njcy "&#x45A;"><!ENTITY tshcy "&#x45B;"><!ENTITY kjcy "&#x45C;"><!ENTITY ubrcy "&#x45E;"><!ENTITY dzcy "&#x45F;"><!ENTITY ensp "&#x2002;"><!ENTITY emsp "&#x2003;"><!ENTITY emsp13 "&#x2004;"><!ENTITY emsp14 "&#x2005;"><!ENTITY numsp "&#x2007;"><!ENTITY puncsp "&#x2008;"><!ENTITY thinsp "&#x2009;"><!ENTITY ThinSpace "&#x2009;"><!ENTITY hairsp "&#x200A;"><!ENTITY VeryThinSpace "&#x200A;"><!ENTITY ZeroWidthSpace "&#x200B;"><!ENTITY NegativeVeryThinSpace "&#x200B;"><!ENTITY NegativeThinSpace "&#x200B;"><!ENTITY NegativeMediumSpace "&#x200B;"><!ENTITY NegativeThickSpace "&#x200B;"><!ENTITY zwnj "&#x200C;"><!ENTITY zwj "&#x200D;"><!ENTITY lrm "&#x200E;"><!ENTITY rlm "&#x200F;"><!ENTITY hyphen "&#x2010;"><!ENTITY dash "&#x2010;"><!ENTITY ndash "&#x2013;"><!ENTITY mdash "&#x2014;"><!ENTITY horbar "&#x2015;"><!ENTITY Verbar "&#x2016;"><!ENTITY Vert "&#x2016;"><!ENTITY lsquo "&#x2018;"><!ENTITY OpenCurlyQuote "&#x2018;"><!ENTITY rsquo "&#x2019;"><!ENTITY rsquor "&#x2019;"><!ENTITY CloseCurlyQuote "&#x2019;"><!ENTITY lsquor "&#x201A;"><!ENTITY sbquo "&#x201A;"><!ENTITY ldquo "&#x201C;"><!ENTITY OpenCurlyDoubleQuote "&#x201C;"><!ENTITY rdquo "&#x201D;"><!ENTITY rdquor "&#x201D;"><!ENTITY CloseCurlyDoubleQuote "&#x201D;"><!ENTITY ldquor "&#x201E;"><!ENTITY bdquo "&#x201E;"><!ENTITY dagger "&#x2020;"><!ENTITY Dagger "&#x2021;"><!ENTITY ddagger "&#x2021;"><!ENTITY bull "&#x2022;"><!ENTITY bullet "&#x2022;"><!ENTITY nldr "&#x2025;"><!ENTITY hellip "&#x2026;"><!ENTITY mldr "&#x2026;"><!ENTITY permil "&#x2030;"><!ENTITY pertenk "&#x2031;"><!ENTITY prime "&#x2032;"><!ENTITY Prime "&#x2033;"><!ENTITY tprime "&#x2034;"><!ENTITY bprime "&#x2035;"><!ENTITY backprime "&#x2035;"><!ENTITY lsaquo "&#x2039;"><!ENTITY rsaquo "&#x203A;"><!ENTITY oline "&#x203E;"><!ENTITY OverBar "&#x203E;"><!ENTITY caret "&#x2041;"><!ENTITY hybull "&#x2043;"><!ENTITY frasl "&#x2044;"><!ENTITY bsemi "&#x204F;"><!ENTITY qprime "&#x2057;"><!ENTITY MediumSpace "&#x205F;"><!ENTITY ThickSpace "&#x205F;&#x200A;"><!ENTITY NoBreak "&#x2060;"><!ENTITY ApplyFunction "&#x2061;"><!ENTITY af "&#x2061;"><!ENTITY InvisibleTimes "&#x2062;"><!ENTITY it "&#x2062;"><!ENTITY InvisibleComma "&#x2063;"><!ENTITY ic "&#x2063;"><!ENTITY euro "&#x20AC;"><!ENTITY tdot "&#x20DB;"><!ENTITY TripleDot "&#x20DB;"><!ENTITY DotDot "&#x20DC;"><!ENTITY Copf "&#x2102;"><!ENTITY complexes "&#x2102;"><!ENTITY incare "&#x2105;"><!ENTITY gscr "&#x210A;"><!ENTITY hamilt "&#x210B;"><!ENTITY HilbertSpace "&#x210B;"><!ENTITY Hscr "&#x210B;"><!ENTITY Hfr "&#x210C;"><!ENTITY Poincareplane "&#x210C;"><!ENTITY quaternions "&#x210D;"><!ENTITY Hopf "&#x210D;"><!ENTITY planckh "&#x210E;"><!ENTITY planck "&#x210F;"><!ENTITY hbar "&#x210F;"><!ENTITY plankv "&#x210F;"><!ENTITY hslash "&#x210F;"><!ENTITY Iscr "&#x2110;"><!ENTITY imagline "&#x2110;"><!ENTITY image "&#x2111;"><!ENTITY Im "&#x2111;"><!ENTITY imagpart "&#x2111;"><!ENTITY Ifr "&#x2111;"><!ENTITY Lscr "&#x2112;"><!ENTITY lagran "&#x2112;"><!ENTITY Laplacetrf "&#x2112;"><!ENTITY ell "&#x2113;"><!ENTITY Nopf "&#x2115;"><!ENTITY naturals "&#x2115;"><!ENTITY numero "&#x2116;"><!ENTITY copysr "&#x2117;"><!ENTITY weierp "&#x2118;"><!ENTITY wp "&#x2118;"><!ENTITY Popf "&#x2119;"><!ENTITY primes "&#x2119;"><!ENTITY rationals "&#x211A;"><!ENTITY Qopf "&#x211A;"><!ENTITY Rscr "&#x211B;"><!ENTITY realine "&#x211B;"><!ENTITY real "&#x211C;"><!ENTITY Re "&#x211C;"><!ENTITY realpart "&#x211C;"><!ENTITY Rfr "&#x211C;"><!ENTITY reals "&#x211D;"><!ENTITY Ropf "&#x211D;"><!ENTITY rx "&#x211E;"><!ENTITY trade "&#x2122;"><!ENTITY TRADE "&#x2122;"><!ENTITY integers "&#x2124;"><!ENTITY Zopf "&#x2124;"><!ENTITY mho "&#x2127;"><!ENTITY Zfr "&#x2128;"><!ENTITY zeetrf "&#x2128;"><!ENTITY iiota "&#x2129;"><!ENTITY bernou "&#x212C;"><!ENTITY Bernoullis "&#x212C;"><!ENTITY Bscr "&#x212C;"><!ENTITY Cfr "&#x212D;"><!ENTITY Cayleys "&#x212D;"><!ENTITY escr "&#x212F;"><!ENTITY Escr "&#x2130;"><!ENTITY expectation "&#x2130;"><!ENTITY Fscr "&#x2131;"><!ENTITY Fouriertrf "&#x2131;"><!ENTITY phmmat "&#x2133;"><!ENTITY Mellintrf "&#x2133;"><!ENTITY Mscr "&#x2133;"><!ENTITY order "&#x2134;"><!ENTITY orderof "&#x2134;"><!ENTITY oscr "&#x2134;"><!ENTITY alefsym "&#x2135;"><!ENTITY aleph "&#x2135;"><!ENTITY beth "&#x2136;"><!ENTITY gimel "&#x2137;"><!ENTITY daleth "&#x2138;"><!ENTITY CapitalDifferentialD "&#x2145;"><!ENTITY DD "&#x2145;"><!ENTITY DifferentialD "&#x2146;"><!ENTITY dd "&#x2146;"><!ENTITY ExponentialE "&#x2147;"><!ENTITY exponentiale "&#x2147;"><!ENTITY ee "&#x2147;"><!ENTITY ImaginaryI "&#x2148;"><!ENTITY ii "&#x2148;"><!ENTITY frac13 "&#x2153;"><!ENTITY frac23 "&#x2154;"><!ENTITY frac15 "&#x2155;"><!ENTITY frac25 "&#x2156;"><!ENTITY frac35 "&#x2157;"><!ENTITY frac45 "&#x2158;"><!ENTITY frac16 "&#x2159;"><!ENTITY frac56 "&#x215A;"><!ENTITY frac18 "&#x215B;"><!ENTITY frac38 "&#x215C;"><!ENTITY frac58 "&#x215D;"><!ENTITY frac78 "&#x215E;"><!ENTITY larr "&#x2190;"><!ENTITY leftarrow "&#x2190;"><!ENTITY LeftArrow "&#x2190;"><!ENTITY slarr "&#x2190;"><!ENTITY ShortLeftArrow "&#x2190;"><!ENTITY uarr "&#x2191;"><!ENTITY uparrow "&#x2191;"><!ENTITY UpArrow "&#x2191;"><!ENTITY ShortUpArrow "&#x2191;"><!ENTITY rarr "&#x2192;"><!ENTITY rightarrow "&#x2192;"><!ENTITY RightArrow "&#x2192;"><!ENTITY srarr "&#x2192;"><!ENTITY ShortRightArrow "&#x2192;"><!ENTITY darr "&#x2193;"><!ENTITY downarrow "&#x2193;"><!ENTITY DownArrow "&#x2193;"><!ENTITY ShortDownArrow "&#x2193;"><!ENTITY harr "&#x2194;"><!ENTITY leftrightarrow "&#x2194;"><!ENTITY LeftRightArrow "&#x2194;"><!ENTITY varr "&#x2195;"><!ENTITY updownarrow "&#x2195;"><!ENTITY UpDownArrow "&#x2195;"><!ENTITY nwarr "&#x2196;"><!ENTITY UpperLeftArrow "&#x2196;"><!ENTITY nwarrow "&#x2196;"><!ENTITY nearr "&#x2197;"><!ENTITY UpperRightArrow "&#x2197;"><!ENTITY nearrow "&#x2197;"><!ENTITY searr "&#x2198;"><!ENTITY searrow "&#x2198;"><!ENTITY LowerRightArrow "&#x2198;"><!ENTITY swarr "&#x2199;"><!ENTITY swarrow "&#x2199;"><!ENTITY LowerLeftArrow "&#x2199;"><!ENTITY nlarr "&#x219A;"><!ENTITY nleftarrow "&#x219A;"><!ENTITY nrarr "&#x219B;"><!ENTITY nrightarrow "&#x219B;"><!ENTITY rarrw "&#x219D;"><!ENTITY rightsquigarrow "&#x219D;"><!ENTITY nrarrw "&#x219D;&#x338;"><!ENTITY Larr "&#x219E;"><!ENTITY twoheadleftarrow "&#x219E;"><!ENTITY Uarr "&#x219F;"><!ENTITY Rarr "&#x21A0;"><!ENTITY twoheadrightarrow "&#x21A0;"><!ENTITY Darr "&#x21A1;"><!ENTITY larrtl "&#x21A2;"><!ENTITY leftarrowtail "&#x21A2;"><!ENTITY rarrtl "&#x21A3;"><!ENTITY rightarrowtail "&#x21A3;"><!ENTITY LeftTeeArrow "&#x21A4;"><!ENTITY mapstoleft "&#x21A4;"><!ENTITY UpTeeArrow "&#x21A5;"><!ENTITY mapstoup "&#x21A5;"><!ENTITY map "&#x21A6;"><!ENTITY RightTeeArrow "&#x21A6;"><!ENTITY mapsto "&#x21A6;"><!ENTITY DownTeeArrow "&#x21A7;"><!ENTITY mapstodown "&#x21A7;"><!ENTITY larrhk "&#x21A9;"><!ENTITY hookleftarrow "&#x21A9;"><!ENTITY rarrhk "&#x21AA;"><!ENTITY hookrightarrow "&#x21AA;"><!ENTITY larrlp "&#x21AB;"><!ENTITY looparrowleft "&#x21AB;"><!ENTITY rarrlp "&#x21AC;"><!ENTITY looparrowright "&#x21AC;"><!ENTITY harrw "&#x21AD;"><!ENTITY leftrightsquigarrow "&#x21AD;"><!ENTITY nharr "&#x21AE;"><!ENTITY nleftrightarrow "&#x21AE;"><!ENTITY lsh "&#x21B0;"><!ENTITY Lsh "&#x21B0;"><!ENTITY rsh "&#x21B1;"><!ENTITY Rsh "&#x21B1;"><!ENTITY ldsh "&#x21B2;"><!ENTITY rdsh "&#x21B3;"><!ENTITY crarr "&#x21B5;"><!ENTITY cularr "&#x21B6;"><!ENTITY curvearrowleft "&#x21B6;"><!ENTITY curarr "&#x21B7;"><!ENTITY curvearrowright "&#x21B7;"><!ENTITY olarr "&#x21BA;"><!ENTITY circlearrowleft "&#x21BA;"><!ENTITY orarr "&#x21BB;"><!ENTITY circlearrowright "&#x21BB;"><!ENTITY lharu "&#x21BC;"><!ENTITY LeftVector "&#x21BC;"><!ENTITY leftharpoonup "&#x21BC;"><!ENTITY lhard "&#x21BD;"><!ENTITY leftharpoondown "&#x21BD;"><!ENTITY DownLeftVector "&#x21BD;"><!ENTITY uharr "&#x21BE;"><!ENTITY upharpoonright "&#x21BE;"><!ENTITY RightUpVector "&#x21BE;"><!ENTITY uharl "&#x21BF;"><!ENTITY upharpoonleft "&#x21BF;"><!ENTITY LeftUpVector "&#x21BF;"><!ENTITY rharu "&#x21C0;"><!ENTITY RightVector "&#x21C0;"><!ENTITY rightharpoonup "&#x21C0;"><!ENTITY rhard "&#x21C1;"><!ENTITY rightharpoondown "&#x21C1;"><!ENTITY DownRightVector "&#x21C1;"><!ENTITY dharr "&#x21C2;"><!ENTITY RightDownVector "&#x21C2;"><!ENTITY downharpoonright "&#x21C2;"><!ENTITY dharl "&#x21C3;"><!ENTITY LeftDownVector "&#x21C3;"><!ENTITY downharpoonleft "&#x21C3;"><!ENTITY rlarr "&#x21C4;"><!ENTITY rightleftarrows "&#x21C4;"><!ENTITY RightArrowLeftArrow "&#x21C4;"><!ENTITY udarr "&#x21C5;"><!ENTITY UpArrowDownArrow "&#x21C5;"><!ENTITY lrarr "&#x21C6;"><!ENTITY leftrightarrows "&#x21C6;"><!ENTITY LeftArrowRightArrow "&#x21C6;"><!ENTITY llarr "&#x21C7;"><!ENTITY leftleftarrows "&#x21C7;"><!ENTITY uuarr "&#x21C8;"><!ENTITY upuparrows "&#x21C8;"><!ENTITY rrarr "&#x21C9;"><!ENTITY rightrightarrows "&#x21C9;"><!ENTITY ddarr "&#x21CA;"><!ENTITY downdownarrows "&#x21CA;"><!ENTITY lrhar "&#x21CB;"><!ENTITY ReverseEquilibrium "&#x21CB;"><!ENTITY leftrightharpoons "&#x21CB;"><!ENTITY rlhar "&#x21CC;"><!ENTITY rightleftharpoons "&#x21CC;"><!ENTITY Equilibrium "&#x21CC;"><!ENTITY nlArr "&#x21CD;"><!ENTITY nLeftarrow "&#x21CD;"><!ENTITY nhArr "&#x21CE;"><!ENTITY nLeftrightarrow "&#x21CE;"><!ENTITY nrArr "&#x21CF;"><!ENTITY nRightarrow "&#x21CF;"><!ENTITY lArr "&#x21D0;"><!ENTITY Leftarrow "&#x21D0;"><!ENTITY DoubleLeftArrow "&#x21D0;"><!ENTITY uArr "&#x21D1;"><!ENTITY Uparrow "&#x21D1;"><!ENTITY DoubleUpArrow "&#x21D1;"><!ENTITY rArr "&#x21D2;"><!ENTITY Rightarrow "&#x21D2;"><!ENTITY Implies "&#x21D2;"><!ENTITY DoubleRightArrow "&#x21D2;"><!ENTITY dArr "&#x21D3;"><!ENTITY Downarrow "&#x21D3;"><!ENTITY DoubleDownArrow "&#x21D3;"><!ENTITY hArr "&#x21D4;"><!ENTITY Leftrightarrow "&#x21D4;"><!ENTITY DoubleLeftRightArrow "&#x21D4;"><!ENTITY iff "&#x21D4;"><!ENTITY vArr "&#x21D5;"><!ENTITY Updownarrow "&#x21D5;"><!ENTITY DoubleUpDownArrow "&#x21D5;"><!ENTITY nwArr "&#x21D6;"><!ENTITY neArr "&#x21D7;"><!ENTITY seArr "&#x21D8;"><!ENTITY swArr "&#x21D9;"><!ENTITY lAarr "&#x21DA;"><!ENTITY Lleftarrow "&#x21DA;"><!ENTITY rAarr "&#x21DB;"><!ENTITY Rrightarrow "&#x21DB;"><!ENTITY zigrarr "&#x21DD;"><!ENTITY larrb "&#x21E4;"><!ENTITY LeftArrowBar "&#x21E4;"><!ENTITY rarrb "&#x21E5;"><!ENTITY RightArrowBar "&#x21E5;"><!ENTITY duarr "&#x21F5;"><!ENTITY DownArrowUpArrow "&#x21F5;"><!ENTITY loarr "&#x21FD;"><!ENTITY roarr "&#x21FE;"><!ENTITY hoarr "&#x21FF;"><!ENTITY forall "&#x2200;"><!ENTITY ForAll "&#x2200;"><!ENTITY comp "&#x2201;"><!ENTITY complement "&#x2201;"><!ENTITY part "&#x2202;"><!ENTITY PartialD "&#x2202;"><!ENTITY npart "&#x2202;&#x338;"><!ENTITY exist "&#x2203;"><!ENTITY Exists "&#x2203;"><!ENTITY nexist "&#x2204;"><!ENTITY NotExists "&#x2204;"><!ENTITY nexists "&#x2204;"><!ENTITY empty "&#x2205;"><!ENTITY emptyset "&#x2205;"><!ENTITY emptyv "&#x2205;"><!ENTITY varnothing "&#x2205;"><!ENTITY nabla "&#x2207;"><!ENTITY Del "&#x2207;"><!ENTITY isin "&#x2208;"><!ENTITY isinv "&#x2208;"><!ENTITY Element "&#x2208;"><!ENTITY in "&#x2208;"><!ENTITY notin "&#x2209;"><!ENTITY NotElement "&#x2209;"><!ENTITY notinva "&#x2209;"><!ENTITY niv "&#x220B;"><!ENTITY ReverseElement "&#x220B;"><!ENTITY ni "&#x220B;"><!ENTITY SuchThat "&#x220B;"><!ENTITY notni "&#x220C;"><!ENTITY notniva "&#x220C;"><!ENTITY NotReverseElement "&#x220C;"><!ENTITY prod "&#x220F;"><!ENTITY Product "&#x220F;"><!ENTITY coprod "&#x2210;"><!ENTITY Coproduct "&#x2210;"><!ENTITY sum "&#x2211;"><!ENTITY Sum "&#x2211;"><!ENTITY minus "&#x2212;"><!ENTITY mnplus "&#x2213;"><!ENTITY mp "&#x2213;"><!ENTITY MinusPlus "&#x2213;"><!ENTITY plusdo "&#x2214;"><!ENTITY dotplus "&#x2214;"><!ENTITY setmn "&#x2216;"><!ENTITY setminus "&#x2216;"><!ENTITY Backslash "&#x2216;"><!ENTITY ssetmn "&#x2216;"><!ENTITY smallsetminus "&#x2216;"><!ENTITY lowast "&#x2217;"><!ENTITY compfn "&#x2218;"><!ENTITY SmallCircle "&#x2218;"><!ENTITY radic "&#x221A;"><!ENTITY Sqrt "&#x221A;"><!ENTITY prop "&#x221D;"><!ENTITY propto "&#x221D;"><!ENTITY Proportional "&#x221D;"><!ENTITY vprop "&#x221D;"><!ENTITY varpropto "&#x221D;"><!ENTITY infin "&#x221E;"><!ENTITY angrt "&#x221F;"><!ENTITY ang "&#x2220;"><!ENTITY angle "&#x2220;"><!ENTITY nang "&#x2220;&#x20D2;"><!ENTITY angmsd "&#x2221;"><!ENTITY measuredangle "&#x2221;"><!ENTITY angsph "&#x2222;"><!ENTITY mid "&#x2223;"><!ENTITY VerticalBar "&#x2223;"><!ENTITY smid "&#x2223;"><!ENTITY shortmid "&#x2223;"><!ENTITY nmid "&#x2224;"><!ENTITY NotVerticalBar "&#x2224;"><!ENTITY nsmid "&#x2224;"><!ENTITY nshortmid "&#x2224;"><!ENTITY par "&#x2225;"><!ENTITY parallel "&#x2225;"><!ENTITY DoubleVerticalBar "&#x2225;"><!ENTITY spar "&#x2225;"><!ENTITY shortparallel "&#x2225;"><!ENTITY npar "&#x2226;"><!ENTITY nparallel "&#x2226;"><!ENTITY NotDoubleVerticalBar "&#x2226;"><!ENTITY nspar "&#x2226;"><!ENTITY nshortparallel "&#x2226;"><!ENTITY and "&#x2227;"><!ENTITY wedge "&#x2227;"><!ENTITY or "&#x2228;"><!ENTITY vee "&#x2228;"><!ENTITY cap "&#x2229;"><!ENTITY caps "&#x2229;&#xFE00;"><!ENTITY cup "&#x222A;"><!ENTITY cups "&#x222A;&#xFE00;"><!ENTITY int "&#x222B;"><!ENTITY Integral "&#x222B;"><!ENTITY Int "&#x222C;"><!ENTITY tint "&#x222D;"><!ENTITY iiint "&#x222D;"><!ENTITY conint "&#x222E;"><!ENTITY oint "&#x222E;"><!ENTITY ContourIntegral "&#x222E;"><!ENTITY Conint "&#x222F;"><!ENTITY DoubleContourIntegral "&#x222F;"><!ENTITY Cconint "&#x2230;"><!ENTITY cwint "&#x2231;"><!ENTITY cwconint "&#x2232;"><!ENTITY ClockwiseContourIntegral "&#x2232;"><!ENTITY awconint "&#x2233;"><!ENTITY CounterClockwiseContourIntegral "&#x2233;"><!ENTITY there4 "&#x2234;"><!ENTITY therefore "&#x2234;"><!ENTITY Therefore "&#x2234;"><!ENTITY becaus "&#x2235;"><!ENTITY because "&#x2235;"><!ENTITY Because "&#x2235;"><!ENTITY ratio "&#x2236;"><!ENTITY Colon "&#x2237;"><!ENTITY Proportion "&#x2237;"><!ENTITY minusd "&#x2238;"><!ENTITY dotminus "&#x2238;"><!ENTITY mDDot "&#x223A;"><!ENTITY homtht "&#x223B;"><!ENTITY sim "&#x223C;"><!ENTITY Tilde "&#x223C;"><!ENTITY thksim "&#x223C;"><!ENTITY thicksim "&#x223C;"><!ENTITY nvsim "&#x223C;&#x20D2;"><!ENTITY bsim "&#x223D;"><!ENTITY backsim "&#x223D;"><!ENTITY race "&#x223D;&#x331;"><!ENTITY ac "&#x223E;"><!ENTITY mstpos "&#x223E;"><!ENTITY acE "&#x223E;&#x333;"><!ENTITY acd "&#x223F;"><!ENTITY wreath "&#x2240;"><!ENTITY VerticalTilde "&#x2240;"><!ENTITY wr "&#x2240;"><!ENTITY nsim "&#x2241;"><!ENTITY NotTilde "&#x2241;"><!ENTITY esim "&#x2242;"><!ENTITY EqualTilde "&#x2242;"><!ENTITY eqsim "&#x2242;"><!ENTITY NotEqualTilde "&#x2242;&#x338;"><!ENTITY nesim "&#x2242;&#x338;"><!ENTITY sime "&#x2243;"><!ENTITY TildeEqual "&#x2243;"><!ENTITY simeq "&#x2243;"><!ENTITY nsime "&#x2244;"><!ENTITY nsimeq "&#x2244;"><!ENTITY NotTildeEqual "&#x2244;"><!ENTITY cong "&#x2245;"><!ENTITY TildeFullEqual "&#x2245;"><!ENTITY simne "&#x2246;"><!ENTITY ncong "&#x2247;"><!ENTITY NotTildeFullEqual "&#x2247;"><!ENTITY asymp "&#x2248;"><!ENTITY ap "&#x2248;"><!ENTITY TildeTilde "&#x2248;"><!ENTITY approx "&#x2248;"><!ENTITY thkap "&#x2248;"><!ENTITY thickapprox "&#x2248;"><!ENTITY nap "&#x2249;"><!ENTITY NotTildeTilde "&#x2249;"><!ENTITY napprox "&#x2249;"><!ENTITY ape "&#x224A;"><!ENTITY approxeq "&#x224A;"><!ENTITY apid "&#x224B;"><!ENTITY napid "&#x224B;&#x338;"><!ENTITY bcong "&#x224C;"><!ENTITY backcong "&#x224C;"><!ENTITY asympeq "&#x224D;"><!ENTITY CupCap "&#x224D;"><!ENTITY nvap "&#x224D;&#x20D2;"><!ENTITY bump "&#x224E;"><!ENTITY HumpDownHump "&#x224E;"><!ENTITY Bumpeq "&#x224E;"><!ENTITY NotHumpDownHump "&#x224E;&#x338;"><!ENTITY nbump "&#x224E;&#x338;"><!ENTITY bumpe "&#x224F;"><!ENTITY HumpEqual "&#x224F;"><!ENTITY bumpeq "&#x224F;"><!ENTITY nbumpe "&#x224F;&#x338;"><!ENTITY NotHumpEqual "&#x224F;&#x338;"><!ENTITY esdot "&#x2250;"><!ENTITY DotEqual "&#x2250;"><!ENTITY doteq "&#x2250;"><!ENTITY nedot "&#x2250;&#x338;"><!ENTITY eDot "&#x2251;"><!ENTITY doteqdot "&#x2251;"><!ENTITY efDot "&#x2252;"><!ENTITY fallingdotseq "&#x2252;"><!ENTITY erDot "&#x2253;"><!ENTITY risingdotseq "&#x2253;"><!ENTITY colone "&#x2254;"><!ENTITY coloneq "&#x2254;"><!ENTITY Assign "&#x2254;"><!ENTITY ecolon "&#x2255;"><!ENTITY eqcolon "&#x2255;"><!ENTITY ecir "&#x2256;"><!ENTITY eqcirc "&#x2256;"><!ENTITY cire "&#x2257;"><!ENTITY circeq "&#x2257;"><!ENTITY wedgeq "&#x2259;"><!ENTITY veeeq "&#x225A;"><!ENTITY trie "&#x225C;"><!ENTITY triangleq "&#x225C;"><!ENTITY equest "&#x225F;"><!ENTITY questeq "&#x225F;"><!ENTITY ne "&#x2260;"><!ENTITY NotEqual "&#x2260;"><!ENTITY equiv "&#x2261;"><!ENTITY Congruent "&#x2261;"><!ENTITY bnequiv "&#x2261;&#x20E5;"><!ENTITY nequiv "&#x2262;"><!ENTITY NotCongruent "&#x2262;"><!ENTITY le "&#x2264;"><!ENTITY leq "&#x2264;"><!ENTITY nvle "&#x2264;&#x20D2;"><!ENTITY ge "&#x2265;"><!ENTITY GreaterEqual "&#x2265;"><!ENTITY geq "&#x2265;"><!ENTITY nvge "&#x2265;&#x20D2;"><!ENTITY lE "&#x2266;"><!ENTITY LessFullEqual "&#x2266;"><!ENTITY leqq "&#x2266;"><!ENTITY nlE "&#x2266;&#x338;"><!ENTITY nleqq "&#x2266;&#x338;"><!ENTITY gE "&#x2267;"><!ENTITY GreaterFullEqual "&#x2267;"><!ENTITY geqq "&#x2267;"><!ENTITY ngE "&#x2267;&#x338;"><!ENTITY ngeqq "&#x2267;&#x338;"><!ENTITY NotGreaterFullEqual "&#x2267;&#x338;"><!ENTITY lnE "&#x2268;"><!ENTITY lneqq "&#x2268;"><!ENTITY lvnE "&#x2268;&#xFE00;"><!ENTITY lvertneqq "&#x2268;&#xFE00;"><!ENTITY gnE "&#x2269;"><!ENTITY gneqq "&#x2269;"><!ENTITY gvnE "&#x2269;&#xFE00;"><!ENTITY gvertneqq "&#x2269;&#xFE00;"><!ENTITY Lt "&#x226A;"><!ENTITY NestedLessLess "&#x226A;"><!ENTITY ll "&#x226A;"><!ENTITY nLtv "&#x226A;&#x338;"><!ENTITY NotLessLess "&#x226A;&#x338;"><!ENTITY nLt "&#x226A;&#x20D2;"><!ENTITY Gt "&#x226B;"><!ENTITY NestedGreaterGreater "&#x226B;"><!ENTITY gg "&#x226B;"><!ENTITY nGtv "&#x226B;&#x338;"><!ENTITY NotGreaterGreater "&#x226B;&#x338;"><!ENTITY nGt "&#x226B;&#x20D2;"><!ENTITY twixt "&#x226C;"><!ENTITY between "&#x226C;"><!ENTITY NotCupCap "&#x226D;"><!ENTITY nlt "&#x226E;"><!ENTITY NotLess "&#x226E;"><!ENTITY nless "&#x226E;"><!ENTITY ngt "&#x226F;"><!ENTITY NotGreater "&#x226F;"><!ENTITY ngtr "&#x226F;"><!ENTITY nle "&#x2270;"><!ENTITY NotLessEqual "&#x2270;"><!ENTITY nleq "&#x2270;"><!ENTITY nge "&#x2271;"><!ENTITY NotGreaterEqual "&#x2271;"><!ENTITY ngeq "&#x2271;"><!ENTITY lsim "&#x2272;"><!ENTITY LessTilde "&#x2272;"><!ENTITY lesssim "&#x2272;"><!ENTITY gsim "&#x2273;"><!ENTITY gtrsim "&#x2273;"><!ENTITY GreaterTilde "&#x2273;"><!ENTITY nlsim "&#x2274;"><!ENTITY NotLessTilde "&#x2274;"><!ENTITY ngsim "&#x2275;"><!ENTITY NotGreaterTilde "&#x2275;"><!ENTITY lg "&#x2276;"><!ENTITY lessgtr "&#x2276;"><!ENTITY LessGreater "&#x2276;"><!ENTITY gl "&#x2277;"><!ENTITY gtrless "&#x2277;"><!ENTITY GreaterLess "&#x2277;"><!ENTITY ntlg "&#x2278;"><!ENTITY NotLessGreater "&#x2278;"><!ENTITY ntgl "&#x2279;"><!ENTITY NotGreaterLess "&#x2279;"><!ENTITY pr "&#x227A;"><!ENTITY Precedes "&#x227A;"><!ENTITY prec "&#x227A;"><!ENTITY sc "&#x227B;"><!ENTITY Succeeds "&#x227B;"><!ENTITY succ "&#x227B;"><!ENTITY prcue "&#x227C;"><!ENTITY PrecedesSlantEqual "&#x227C;"><!ENTITY preccurlyeq "&#x227C;"><!ENTITY sccue "&#x227D;"><!ENTITY SucceedsSlantEqual "&#x227D;"><!ENTITY succcurlyeq "&#x227D;"><!ENTITY prsim "&#x227E;"><!ENTITY precsim "&#x227E;"><!ENTITY PrecedesTilde "&#x227E;"><!ENTITY scsim "&#x227F;"><!ENTITY succsim "&#x227F;"><!ENTITY SucceedsTilde "&#x227F;"><!ENTITY NotSucceedsTilde "&#x227F;&#x338;"><!ENTITY npr "&#x2280;"><!ENTITY nprec "&#x2280;"><!ENTITY NotPrecedes "&#x2280;"><!ENTITY nsc "&#x2281;"><!ENTITY nsucc "&#x2281;"><!ENTITY NotSucceeds "&#x2281;"><!ENTITY sub "&#x2282;"><!ENTITY subset "&#x2282;"><!ENTITY vnsub "&#x2282;&#x20D2;"><!ENTITY nsubset "&#x2282;&#x20D2;"><!ENTITY NotSubset "&#x2282;&#x20D2;"><!ENTITY sup "&#x2283;"><!ENTITY supset "&#x2283;"><!ENTITY Superset "&#x2283;"><!ENTITY vnsup "&#x2283;&#x20D2;"><!ENTITY nsupset "&#x2283;&#x20D2;"><!ENTITY NotSuperset "&#x2283;&#x20D2;"><!ENTITY nsub "&#x2284;"><!ENTITY nsup "&#x2285;"><!ENTITY sube "&#x2286;"><!ENTITY SubsetEqual "&#x2286;"><!ENTITY subseteq "&#x2286;"><!ENTITY supe "&#x2287;"><!ENTITY supseteq "&#x2287;"><!ENTITY SupersetEqual "&#x2287;"><!ENTITY nsube "&#x2288;"><!ENTITY nsubseteq "&#x2288;"><!ENTITY NotSubsetEqual "&#x2288;"><!ENTITY nsupe "&#x2289;"><!ENTITY nsupseteq "&#x2289;"><!ENTITY NotSupersetEqual "&#x2289;"><!ENTITY subne "&#x228A;"><!ENTITY subsetneq "&#x228A;"><!ENTITY vsubne "&#x228A;&#xFE00;"><!ENTITY varsubsetneq "&#x228A;&#xFE00;"><!ENTITY supne "&#x228B;"><!ENTITY supsetneq "&#x228B;"><!ENTITY vsupne "&#x228B;&#xFE00;"><!ENTITY varsupsetneq "&#x228B;&#xFE00;"><!ENTITY cupdot "&#x228D;"><!ENTITY uplus "&#x228E;"><!ENTITY UnionPlus "&#x228E;"><!ENTITY sqsub "&#x228F;"><!ENTITY SquareSubset "&#x228F;"><!ENTITY sqsubset "&#x228F;"><!ENTITY NotSquareSubset "&#x228F;&#x338;"><!ENTITY sqsup "&#x2290;"><!ENTITY SquareSuperset "&#x2290;"><!ENTITY sqsupset "&#x2290;"><!ENTITY NotSquareSuperset "&#x2290;&#x338;"><!ENTITY sqsube "&#x2291;"><!ENTITY SquareSubsetEqual "&#x2291;"><!ENTITY sqsubseteq "&#x2291;"><!ENTITY sqsupe "&#x2292;"><!ENTITY SquareSupersetEqual "&#x2292;"><!ENTITY sqsupseteq "&#x2292;"><!ENTITY sqcap "&#x2293;"><!ENTITY SquareIntersection "&#x2293;"><!ENTITY sqcaps "&#x2293;&#xFE00;"><!ENTITY sqcup "&#x2294;"><!ENTITY SquareUnion "&#x2294;"><!ENTITY sqcups "&#x2294;&#xFE00;"><!ENTITY oplus "&#x2295;"><!ENTITY CirclePlus "&#x2295;"><!ENTITY ominus "&#x2296;"><!ENTITY CircleMinus "&#x2296;"><!ENTITY otimes "&#x2297;"><!ENTITY CircleTimes "&#x2297;"><!ENTITY osol "&#x2298;"><!ENTITY odot "&#x2299;"><!ENTITY CircleDot "&#x2299;"><!ENTITY ocir "&#x229A;"><!ENTITY circledcirc "&#x229A;"><!ENTITY oast "&#x229B;"><!ENTITY circledast "&#x229B;"><!ENTITY odash "&#x229D;"><!ENTITY circleddash "&#x229D;"><!ENTITY plusb "&#x229E;"><!ENTITY boxplus "&#x229E;"><!ENTITY minusb "&#x229F;"><!ENTITY boxminus "&#x229F;"><!ENTITY timesb "&#x22A0;"><!ENTITY boxtimes "&#x22A0;"><!ENTITY sdotb "&#x22A1;"><!ENTITY dotsquare "&#x22A1;"><!ENTITY vdash "&#x22A2;"><!ENTITY RightTee "&#x22A2;"><!ENTITY dashv "&#x22A3;"><!ENTITY LeftTee "&#x22A3;"><!ENTITY top "&#x22A4;"><!ENTITY DownTee "&#x22A4;"><!ENTITY bottom "&#x22A5;"><!ENTITY bot "&#x22A5;"><!ENTITY perp "&#x22A5;"><!ENTITY UpTee "&#x22A5;"><!ENTITY models "&#x22A7;"><!ENTITY vDash "&#x22A8;"><!ENTITY DoubleRightTee "&#x22A8;"><!ENTITY Vdash "&#x22A9;"><!ENTITY Vvdash "&#x22AA;"><!ENTITY VDash "&#x22AB;"><!ENTITY nvdash "&#x22AC;"><!ENTITY nvDash "&#x22AD;"><!ENTITY nVdash "&#x22AE;"><!ENTITY nVDash "&#x22AF;"><!ENTITY prurel "&#x22B0;"><!ENTITY vltri "&#x22B2;"><!ENTITY vartriangleleft "&#x22B2;"><!ENTITY LeftTriangle "&#x22B2;"><!ENTITY vrtri "&#x22B3;"><!ENTITY vartriangleright "&#x22B3;"><!ENTITY RightTriangle "&#x22B3;"><!ENTITY ltrie "&#x22B4;"><!ENTITY trianglelefteq "&#x22B4;"><!ENTITY LeftTriangleEqual "&#x22B4;"><!ENTITY nvltrie "&#x22B4;&#x20D2;"><!ENTITY rtrie "&#x22B5;"><!ENTITY trianglerighteq "&#x22B5;"><!ENTITY RightTriangleEqual "&#x22B5;"><!ENTITY nvrtrie "&#x22B5;&#x20D2;"><!ENTITY origof "&#x22B6;"><!ENTITY imof "&#x22B7;"><!ENTITY mumap "&#x22B8;"><!ENTITY multimap "&#x22B8;"><!ENTITY hercon "&#x22B9;"><!ENTITY intcal "&#x22BA;"><!ENTITY intercal "&#x22BA;"><!ENTITY veebar "&#x22BB;"><!ENTITY barvee "&#x22BD;"><!ENTITY angrtvb "&#x22BE;"><!ENTITY lrtri "&#x22BF;"><!ENTITY xwedge "&#x22C0;"><!ENTITY Wedge "&#x22C0;"><!ENTITY bigwedge "&#x22C0;"><!ENTITY xvee "&#x22C1;"><!ENTITY Vee "&#x22C1;"><!ENTITY bigvee "&#x22C1;"><!ENTITY xcap "&#x22C2;"><!ENTITY Intersection "&#x22C2;"><!ENTITY bigcap "&#x22C2;"><!ENTITY xcup "&#x22C3;"><!ENTITY Union "&#x22C3;"><!ENTITY bigcup "&#x22C3;"><!ENTITY diam "&#x22C4;"><!ENTITY diamond "&#x22C4;"><!ENTITY Diamond "&#x22C4;"><!ENTITY sdot "&#x22C5;"><!ENTITY sstarf "&#x22C6;"><!ENTITY Star "&#x22C6;"><!ENTITY divonx "&#x22C7;"><!ENTITY divideontimes "&#x22C7;"><!ENTITY bowtie "&#x22C8;"><!ENTITY ltimes "&#x22C9;"><!ENTITY rtimes "&#x22CA;"><!ENTITY lthree "&#x22CB;"><!ENTITY leftthreetimes "&#x22CB;"><!ENTITY rthree "&#x22CC;"><!ENTITY rightthreetimes "&#x22CC;"><!ENTITY bsime "&#x22CD;"><!ENTITY backsimeq "&#x22CD;"><!ENTITY cuvee "&#x22CE;"><!ENTITY curlyvee "&#x22CE;"><!ENTITY cuwed "&#x22CF;"><!ENTITY curlywedge "&#x22CF;"><!ENTITY Sub "&#x22D0;"><!ENTITY Subset "&#x22D0;"><!ENTITY Sup "&#x22D1;"><!ENTITY Supset "&#x22D1;"><!ENTITY Cap "&#x22D2;"><!ENTITY Cup "&#x22D3;"><!ENTITY fork "&#x22D4;"><!ENTITY pitchfork "&#x22D4;"><!ENTITY epar "&#x22D5;"><!ENTITY ltdot "&#x22D6;"><!ENTITY lessdot "&#x22D6;"><!ENTITY gtdot "&#x22D7;"><!ENTITY gtrdot "&#x22D7;"><!ENTITY Ll "&#x22D8;"><!ENTITY nLl "&#x22D8;&#x338;"><!ENTITY Gg "&#x22D9;"><!ENTITY ggg "&#x22D9;"><!ENTITY nGg "&#x22D9;&#x338;"><!ENTITY leg "&#x22DA;"><!ENTITY LessEqualGreater "&#x22DA;"><!ENTITY lesseqgtr "&#x22DA;"><!ENTITY lesg "&#x22DA;&#xFE00;"><!ENTITY gel "&#x22DB;"><!ENTITY gtreqless "&#x22DB;"><!ENTITY GreaterEqualLess "&#x22DB;"><!ENTITY gesl "&#x22DB;&#xFE00;"><!ENTITY cuepr "&#x22DE;"><!ENTITY curlyeqprec "&#x22DE;"><!ENTITY cuesc "&#x22DF;"><!ENTITY curlyeqsucc "&#x22DF;"><!ENTITY nprcue "&#x22E0;"><!ENTITY NotPrecedesSlantEqual "&#x22E0;"><!ENTITY nsccue "&#x22E1;"><!ENTITY NotSucceedsSlantEqual "&#x22E1;"><!ENTITY nsqsube "&#x22E2;"><!ENTITY NotSquareSubsetEqual "&#x22E2;"><!ENTITY nsqsupe "&#x22E3;"><!ENTITY NotSquareSupersetEqual "&#x22E3;"><!ENTITY lnsim "&#x22E6;"><!ENTITY gnsim "&#x22E7;"><!ENTITY prnsim "&#x22E8;"><!ENTITY precnsim "&#x22E8;"><!ENTITY scnsim "&#x22E9;"><!ENTITY succnsim "&#x22E9;"><!ENTITY nltri "&#x22EA;"><!ENTITY ntriangleleft "&#x22EA;"><!ENTITY NotLeftTriangle "&#x22EA;"><!ENTITY nrtri "&#x22EB;"><!ENTITY ntriangleright "&#x22EB;"><!ENTITY NotRightTriangle "&#x22EB;"><!ENTITY nltrie "&#x22EC;"><!ENTITY ntrianglelefteq "&#x22EC;"><!ENTITY NotLeftTriangleEqual "&#x22EC;"><!ENTITY nrtrie "&#x22ED;"><!ENTITY ntrianglerighteq "&#x22ED;"><!ENTITY NotRightTriangleEqual "&#x22ED;"><!ENTITY vellip "&#x22EE;"><!ENTITY ctdot "&#x22EF;"><!ENTITY utdot "&#x22F0;"><!ENTITY dtdot "&#x22F1;"><!ENTITY disin "&#x22F2;"><!ENTITY isinsv "&#x22F3;"><!ENTITY isins "&#x22F4;"><!ENTITY isindot "&#x22F5;"><!ENTITY notindot "&#x22F5;&#x338;"><!ENTITY notinvc "&#x22F6;"><!ENTITY notinvb "&#x22F7;"><!ENTITY isinE "&#x22F9;"><!ENTITY notinE "&#x22F9;&#x338;"><!ENTITY nisd "&#x22FA;"><!ENTITY xnis "&#x22FB;"><!ENTITY nis "&#x22FC;"><!ENTITY notnivc "&#x22FD;"><!ENTITY notnivb "&#x22FE;"><!ENTITY barwed "&#x2305;"><!ENTITY barwedge "&#x2305;"><!ENTITY Barwed "&#x2306;"><!ENTITY doublebarwedge "&#x2306;"><!ENTITY lceil "&#x2308;"><!ENTITY LeftCeiling "&#x2308;"><!ENTITY rceil "&#x2309;"><!ENTITY RightCeiling "&#x2309;"><!ENTITY lfloor "&#x230A;"><!ENTITY LeftFloor "&#x230A;"><!ENTITY rfloor "&#x230B;"><!ENTITY RightFloor "&#x230B;"><!ENTITY drcrop "&#x230C;"><!ENTITY dlcrop "&#x230D;"><!ENTITY urcrop "&#x230E;"><!ENTITY ulcrop "&#x230F;"><!ENTITY bnot "&#x2310;"><!ENTITY profline "&#x2312;"><!ENTITY profsurf "&#x2313;"><!ENTITY telrec "&#x2315;"><!ENTITY target "&#x2316;"><!ENTITY ulcorn "&#x231C;"><!ENTITY ulcorner "&#x231C;"><!ENTITY urcorn "&#x231D;"><!ENTITY urcorner "&#x231D;"><!ENTITY dlcorn "&#x231E;"><!ENTITY llcorner "&#x231E;"><!ENTITY drcorn "&#x231F;"><!ENTITY lrcorner "&#x231F;"><!ENTITY frown "&#x2322;"><!ENTITY sfrown "&#x2322;"><!ENTITY smile "&#x2323;"><!ENTITY ssmile "&#x2323;"><!ENTITY cylcty "&#x232D;"><!ENTITY profalar "&#x232E;"><!ENTITY topbot "&#x2336;"><!ENTITY ovbar "&#x233D;"><!ENTITY solbar "&#x233F;"><!ENTITY angzarr "&#x237C;"><!ENTITY lmoust "&#x23B0;"><!ENTITY lmoustache "&#x23B0;"><!ENTITY rmoust "&#x23B1;"><!ENTITY rmoustache "&#x23B1;"><!ENTITY tbrk "&#x23B4;"><!ENTITY OverBracket "&#x23B4;"><!ENTITY bbrk "&#x23B5;"><!ENTITY UnderBracket "&#x23B5;"><!ENTITY bbrktbrk "&#x23B6;"><!ENTITY OverParenthesis "&#x23DC;"><!ENTITY UnderParenthesis "&#x23DD;"><!ENTITY OverBrace "&#x23DE;"><!ENTITY UnderBrace "&#x23DF;"><!ENTITY trpezium "&#x23E2;"><!ENTITY elinters "&#x23E7;"><!ENTITY blank "&#x2423;"><!ENTITY oS "&#x24C8;"><!ENTITY circledS "&#x24C8;"><!ENTITY boxh "&#x2500;"><!ENTITY HorizontalLine "&#x2500;"><!ENTITY boxv "&#x2502;"><!ENTITY boxdr "&#x250C;"><!ENTITY boxdl "&#x2510;"><!ENTITY boxur "&#x2514;"><!ENTITY boxul "&#x2518;"><!ENTITY boxvr "&#x251C;"><!ENTITY boxvl "&#x2524;"><!ENTITY boxhd "&#x252C;"><!ENTITY boxhu "&#x2534;"><!ENTITY boxvh "&#x253C;"><!ENTITY boxH "&#x2550;"><!ENTITY boxV "&#x2551;"><!ENTITY boxdR "&#x2552;"><!ENTITY boxDr "&#x2553;"><!ENTITY boxDR "&#x2554;"><!ENTITY boxdL "&#x2555;"><!ENTITY boxDl "&#x2556;"><!ENTITY boxDL "&#x2557;"><!ENTITY boxuR "&#x2558;"><!ENTITY boxUr "&#x2559;"><!ENTITY boxUR "&#x255A;"><!ENTITY boxuL "&#x255B;"><!ENTITY boxUl "&#x255C;"><!ENTITY boxUL "&#x255D;"><!ENTITY boxvR "&#x255E;"><!ENTITY boxVr "&#x255F;"><!ENTITY boxVR "&#x2560;"><!ENTITY boxvL "&#x2561;"><!ENTITY boxVl "&#x2562;"><!ENTITY boxVL "&#x2563;"><!ENTITY boxHd "&#x2564;"><!ENTITY boxhD "&#x2565;"><!ENTITY boxHD "&#x2566;"><!ENTITY boxHu "&#x2567;"><!ENTITY boxhU "&#x2568;"><!ENTITY boxHU "&#x2569;"><!ENTITY boxvH "&#x256A;"><!ENTITY boxVh "&#x256B;"><!ENTITY boxVH "&#x256C;"><!ENTITY uhblk "&#x2580;"><!ENTITY lhblk "&#x2584;"><!ENTITY block "&#x2588;"><!ENTITY blk14 "&#x2591;"><!ENTITY blk12 "&#x2592;"><!ENTITY blk34 "&#x2593;"><!ENTITY squ "&#x25A1;"><!ENTITY square "&#x25A1;"><!ENTITY Square "&#x25A1;"><!ENTITY squf "&#x25AA;"><!ENTITY squarf "&#x25AA;"><!ENTITY blacksquare "&#x25AA;"><!ENTITY FilledVerySmallSquare "&#x25AA;"><!ENTITY EmptyVerySmallSquare "&#x25AB;"><!ENTITY rect "&#x25AD;"><!ENTITY marker "&#x25AE;"><!ENTITY fltns "&#x25B1;"><!ENTITY xutri "&#x25B3;"><!ENTITY bigtriangleup "&#x25B3;"><!ENTITY utrif "&#x25B4;"><!ENTITY blacktriangle "&#x25B4;"><!ENTITY utri "&#x25B5;"><!ENTITY triangle "&#x25B5;"><!ENTITY rtrif "&#x25B8;"><!ENTITY blacktriangleright "&#x25B8;"><!ENTITY rtri "&#x25B9;"><!ENTITY triangleright "&#x25B9;"><!ENTITY xdtri "&#x25BD;"><!ENTITY bigtriangledown "&#x25BD;"><!ENTITY dtrif "&#x25BE;"><!ENTITY blacktriangledown "&#x25BE;"><!ENTITY dtri "&#x25BF;"><!ENTITY triangledown "&#x25BF;"><!ENTITY ltrif "&#x25C2;"><!ENTITY blacktriangleleft "&#x25C2;"><!ENTITY ltri "&#x25C3;"><!ENTITY triangleleft "&#x25C3;"><!ENTITY loz "&#x25CA;"><!ENTITY lozenge "&#x25CA;"><!ENTITY cir "&#x25CB;"><!ENTITY tridot "&#x25EC;"><!ENTITY xcirc "&#x25EF;"><!ENTITY bigcirc "&#x25EF;"><!ENTITY ultri "&#x25F8;"><!ENTITY urtri "&#x25F9;"><!ENTITY lltri "&#x25FA;"><!ENTITY EmptySmallSquare "&#x25FB;"><!ENTITY FilledSmallSquare "&#x25FC;"><!ENTITY starf "&#x2605;"><!ENTITY bigstar "&#x2605;"><!ENTITY star "&#x2606;"><!ENTITY phone "&#x260E;"><!ENTITY female "&#x2640;"><!ENTITY male "&#x2642;"><!ENTITY spades "&#x2660;"><!ENTITY spadesuit "&#x2660;"><!ENTITY clubs "&#x2663;"><!ENTITY clubsuit "&#x2663;"><!ENTITY hearts "&#x2665;"><!ENTITY heartsuit "&#x2665;"><!ENTITY diams "&#x2666;"><!ENTITY diamondsuit "&#x2666;"><!ENTITY sung "&#x266A;"><!ENTITY flat "&#x266D;"><!ENTITY natur "&#x266E;"><!ENTITY natural "&#x266E;"><!ENTITY sharp "&#x266F;"><!ENTITY check "&#x2713;"><!ENTITY checkmark "&#x2713;"><!ENTITY cross "&#x2717;"><!ENTITY malt "&#x2720;"><!ENTITY maltese "&#x2720;"><!ENTITY sext "&#x2736;"><!ENTITY VerticalSeparator "&#x2758;"><!ENTITY lbbrk "&#x2772;"><!ENTITY rbbrk "&#x2773;"><!ENTITY bsolhsub "&#x27C8;"><!ENTITY suphsol "&#x27C9;"><!ENTITY lobrk "&#x27E6;"><!ENTITY LeftDoubleBracket "&#x27E6;"><!ENTITY robrk "&#x27E7;"><!ENTITY RightDoubleBracket "&#x27E7;"><!ENTITY lang "&#x27E8;"><!ENTITY LeftAngleBracket "&#x27E8;"><!ENTITY langle "&#x27E8;"><!ENTITY rang "&#x27E9;"><!ENTITY RightAngleBracket "&#x27E9;"><!ENTITY rangle "&#x27E9;"><!ENTITY Lang "&#x27EA;"><!ENTITY Rang "&#x27EB;"><!ENTITY loang "&#x27EC;"><!ENTITY roang "&#x27ED;"><!ENTITY xlarr "&#x27F5;"><!ENTITY longleftarrow "&#x27F5;"><!ENTITY LongLeftArrow "&#x27F5;"><!ENTITY xrarr "&#x27F6;"><!ENTITY longrightarrow "&#x27F6;"><!ENTITY LongRightArrow "&#x27F6;"><!ENTITY xharr "&#x27F7;"><!ENTITY longleftrightarrow "&#x27F7;"><!ENTITY LongLeftRightArrow "&#x27F7;"><!ENTITY xlArr "&#x27F8;"><!ENTITY Longleftarrow "&#x27F8;"><!ENTITY DoubleLongLeftArrow "&#x27F8;"><!ENTITY xrArr "&#x27F9;"><!ENTITY Longrightarrow "&#x27F9;"><!ENTITY DoubleLongRightArrow "&#x27F9;"><!ENTITY xhArr "&#x27FA;"><!ENTITY Longleftrightarrow "&#x27FA;"><!ENTITY DoubleLongLeftRightArrow "&#x27FA;"><!ENTITY xmap "&#x27FC;"><!ENTITY longmapsto "&#x27FC;"><!ENTITY dzigrarr "&#x27FF;"><!ENTITY nvlArr "&#x2902;"><!ENTITY nvrArr "&#x2903;"><!ENTITY nvHarr "&#x2904;"><!ENTITY Map "&#x2905;"><!ENTITY lbarr "&#x290C;"><!ENTITY rbarr "&#x290D;"><!ENTITY bkarow "&#x290D;"><!ENTITY lBarr "&#x290E;"><!ENTITY rBarr "&#x290F;"><!ENTITY dbkarow "&#x290F;"><!ENTITY RBarr "&#x2910;"><!ENTITY drbkarow "&#x2910;"><!ENTITY DDotrahd "&#x2911;"><!ENTITY UpArrowBar "&#x2912;"><!ENTITY DownArrowBar "&#x2913;"><!ENTITY Rarrtl "&#x2916;"><!ENTITY latail "&#x2919;"><!ENTITY ratail "&#x291A;"><!ENTITY lAtail "&#x291B;"><!ENTITY rAtail "&#x291C;"><!ENTITY larrfs "&#x291D;"><!ENTITY rarrfs "&#x291E;"><!ENTITY larrbfs "&#x291F;"><!ENTITY rarrbfs "&#x2920;"><!ENTITY nwarhk "&#x2923;"><!ENTITY nearhk "&#x2924;"><!ENTITY searhk "&#x2925;"><!ENTITY hksearow "&#x2925;"><!ENTITY swarhk "&#x2926;"><!ENTITY hkswarow "&#x2926;"><!ENTITY nwnear "&#x2927;"><!ENTITY nesear "&#x2928;"><!ENTITY toea "&#x2928;"><!ENTITY seswar "&#x2929;"><!ENTITY tosa "&#x2929;"><!ENTITY swnwar "&#x292A;"><!ENTITY rarrc "&#x2933;"><!ENTITY nrarrc "&#x2933;&#x338;"><!ENTITY cudarrr "&#x2935;"><!ENTITY ldca "&#x2936;"><!ENTITY rdca "&#x2937;"><!ENTITY cudarrl "&#x2938;"><!ENTITY larrpl "&#x2939;"><!ENTITY curarrm "&#x293C;"><!ENTITY cularrp "&#x293D;"><!ENTITY rarrpl "&#x2945;"><!ENTITY harrcir "&#x2948;"><!ENTITY Uarrocir "&#x2949;"><!ENTITY lurdshar "&#x294A;"><!ENTITY ldrushar "&#x294B;"><!ENTITY LeftRightVector "&#x294E;"><!ENTITY RightUpDownVector "&#x294F;"><!ENTITY DownLeftRightVector "&#x2950;"><!ENTITY LeftUpDownVector "&#x2951;"><!ENTITY LeftVectorBar "&#x2952;"><!ENTITY RightVectorBar "&#x2953;"><!ENTITY RightUpVectorBar "&#x2954;"><!ENTITY RightDownVectorBar "&#x2955;"><!ENTITY DownLeftVectorBar "&#x2956;"><!ENTITY DownRightVectorBar "&#x2957;"><!ENTITY LeftUpVectorBar "&#x2958;"><!ENTITY LeftDownVectorBar "&#x2959;"><!ENTITY LeftTeeVector "&#x295A;"><!ENTITY RightTeeVector "&#x295B;"><!ENTITY RightUpTeeVector "&#x295C;"><!ENTITY RightDownTeeVector "&#x295D;"><!ENTITY DownLeftTeeVector "&#x295E;"><!ENTITY DownRightTeeVector "&#x295F;"><!ENTITY LeftUpTeeVector "&#x2960;"><!ENTITY LeftDownTeeVector "&#x2961;"><!ENTITY lHar "&#x2962;"><!ENTITY uHar "&#x2963;"><!ENTITY rHar "&#x2964;"><!ENTITY dHar "&#x2965;"><!ENTITY luruhar "&#x2966;"><!ENTITY ldrdhar "&#x2967;"><!ENTITY ruluhar "&#x2968;"><!ENTITY rdldhar "&#x2969;"><!ENTITY lharul "&#x296A;"><!ENTITY llhard "&#x296B;"><!ENTITY rharul "&#x296C;"><!ENTITY lrhard "&#x296D;"><!ENTITY udhar "&#x296E;"><!ENTITY UpEquilibrium "&#x296E;"><!ENTITY duhar "&#x296F;"><!ENTITY ReverseUpEquilibrium "&#x296F;"><!ENTITY RoundImplies "&#x2970;"><!ENTITY erarr "&#x2971;"><!ENTITY simrarr "&#x2972;"><!ENTITY larrsim "&#x2973;"><!ENTITY rarrsim "&#x2974;"><!ENTITY rarrap "&#x2975;"><!ENTITY ltlarr "&#x2976;"><!ENTITY gtrarr "&#x2978;"><!ENTITY subrarr "&#x2979;"><!ENTITY suplarr "&#x297B;"><!ENTITY lfisht "&#x297C;"><!ENTITY rfisht "&#x297D;"><!ENTITY ufisht "&#x297E;"><!ENTITY dfisht "&#x297F;"><!ENTITY lopar "&#x2985;"><!ENTITY ropar "&#x2986;"><!ENTITY lbrke "&#x298B;"><!ENTITY rbrke "&#x298C;"><!ENTITY lbrkslu "&#x298D;"><!ENTITY rbrksld "&#x298E;"><!ENTITY lbrksld "&#x298F;"><!ENTITY rbrkslu "&#x2990;"><!ENTITY langd "&#x2991;"><!ENTITY rangd "&#x2992;"><!ENTITY lparlt "&#x2993;"><!ENTITY rpargt "&#x2994;"><!ENTITY gtlPar "&#x2995;"><!ENTITY ltrPar "&#x2996;"><!ENTITY vzigzag "&#x299A;"><!ENTITY vangrt "&#x299C;"><!ENTITY angrtvbd "&#x299D;"><!ENTITY ange "&#x29A4;"><!ENTITY range "&#x29A5;"><!ENTITY dwangle "&#x29A6;"><!ENTITY uwangle "&#x29A7;"><!ENTITY angmsdaa "&#x29A8;"><!ENTITY angmsdab "&#x29A9;"><!ENTITY angmsdac "&#x29AA;"><!ENTITY angmsdad "&#x29AB;"><!ENTITY angmsdae "&#x29AC;"><!ENTITY angmsdaf "&#x29AD;"><!ENTITY angmsdag "&#x29AE;"><!ENTITY angmsdah "&#x29AF;"><!ENTITY bemptyv "&#x29B0;"><!ENTITY demptyv "&#x29B1;"><!ENTITY cemptyv "&#x29B2;"><!ENTITY raemptyv "&#x29B3;"><!ENTITY laemptyv "&#x29B4;"><!ENTITY ohbar "&#x29B5;"><!ENTITY omid "&#x29B6;"><!ENTITY opar "&#x29B7;"><!ENTITY operp "&#x29B9;"><!ENTITY olcross "&#x29BB;"><!ENTITY odsold "&#x29BC;"><!ENTITY olcir "&#x29BE;"><!ENTITY ofcir "&#x29BF;"><!ENTITY olt "&#x29C0;"><!ENTITY ogt "&#x29C1;"><!ENTITY cirscir "&#x29C2;"><!ENTITY cirE "&#x29C3;"><!ENTITY solb "&#x29C4;"><!ENTITY bsolb "&#x29C5;"><!ENTITY boxbox "&#x29C9;"><!ENTITY trisb "&#x29CD;"><!ENTITY rtriltri "&#x29CE;"><!ENTITY LeftTriangleBar "&#x29CF;"><!ENTITY NotLeftTriangleBar "&#x29CF;&#x338;"><!ENTITY RightTriangleBar "&#x29D0;"><!ENTITY NotRightTriangleBar "&#x29D0;&#x338;"><!ENTITY iinfin "&#x29DC;"><!ENTITY infintie "&#x29DD;"><!ENTITY nvinfin "&#x29DE;"><!ENTITY eparsl "&#x29E3;"><!ENTITY smeparsl "&#x29E4;"><!ENTITY eqvparsl "&#x29E5;"><!ENTITY lozf "&#x29EB;"><!ENTITY blacklozenge "&#x29EB;"><!ENTITY RuleDelayed "&#x29F4;"><!ENTITY dsol "&#x29F6;"><!ENTITY xodot "&#x2A00;"><!ENTITY bigodot "&#x2A00;"><!ENTITY xoplus "&#x2A01;"><!ENTITY bigoplus "&#x2A01;"><!ENTITY xotime "&#x2A02;"><!ENTITY bigotimes "&#x2A02;"><!ENTITY xuplus "&#x2A04;"><!ENTITY biguplus "&#x2A04;"><!ENTITY xsqcup "&#x2A06;"><!ENTITY bigsqcup "&#x2A06;"><!ENTITY qint "&#x2A0C;"><!ENTITY iiiint "&#x2A0C;"><!ENTITY fpartint "&#x2A0D;"><!ENTITY cirfnint "&#x2A10;"><!ENTITY awint "&#x2A11;"><!ENTITY rppolint "&#x2A12;"><!ENTITY scpolint "&#x2A13;"><!ENTITY npolint "&#x2A14;"><!ENTITY pointint "&#x2A15;"><!ENTITY quatint "&#x2A16;"><!ENTITY intlarhk "&#x2A17;"><!ENTITY pluscir "&#x2A22;"><!ENTITY plusacir "&#x2A23;"><!ENTITY simplus "&#x2A24;"><!ENTITY plusdu "&#x2A25;"><!ENTITY plussim "&#x2A26;"><!ENTITY plustwo "&#x2A27;"><!ENTITY mcomma "&#x2A29;"><!ENTITY minusdu "&#x2A2A;"><!ENTITY loplus "&#x2A2D;"><!ENTITY roplus "&#x2A2E;"><!ENTITY Cross "&#x2A2F;"><!ENTITY timesd "&#x2A30;"><!ENTITY timesbar "&#x2A31;"><!ENTITY smashp "&#x2A33;"><!ENTITY lotimes "&#x2A34;"><!ENTITY rotimes "&#x2A35;"><!ENTITY otimesas "&#x2A36;"><!ENTITY Otimes "&#x2A37;"><!ENTITY odiv "&#x2A38;"><!ENTITY triplus "&#x2A39;"><!ENTITY triminus "&#x2A3A;"><!ENTITY tritime "&#x2A3B;"><!ENTITY iprod "&#x2A3C;"><!ENTITY intprod "&#x2A3C;"><!ENTITY amalg "&#x2A3F;"><!ENTITY capdot "&#x2A40;"><!ENTITY ncup "&#x2A42;"><!ENTITY ncap "&#x2A43;"><!ENTITY capand "&#x2A44;"><!ENTITY cupor "&#x2A45;"><!ENTITY cupcap "&#x2A46;"><!ENTITY capcup "&#x2A47;"><!ENTITY cupbrcap "&#x2A48;"><!ENTITY capbrcup "&#x2A49;"><!ENTITY cupcup "&#x2A4A;"><!ENTITY capcap "&#x2A4B;"><!ENTITY ccups "&#x2A4C;"><!ENTITY ccaps "&#x2A4D;"><!ENTITY ccupssm "&#x2A50;"><!ENTITY And "&#x2A53;"><!ENTITY Or "&#x2A54;"><!ENTITY andand "&#x2A55;"><!ENTITY oror "&#x2A56;"><!ENTITY orslope "&#x2A57;"><!ENTITY andslope "&#x2A58;"><!ENTITY andv "&#x2A5A;"><!ENTITY orv "&#x2A5B;"><!ENTITY andd "&#x2A5C;"><!ENTITY ord "&#x2A5D;"><!ENTITY wedbar "&#x2A5F;"><!ENTITY sdote "&#x2A66;"><!ENTITY simdot "&#x2A6A;"><!ENTITY congdot "&#x2A6D;"><!ENTITY ncongdot "&#x2A6D;&#x338;"><!ENTITY easter "&#x2A6E;"><!ENTITY apacir "&#x2A6F;"><!ENTITY apE "&#x2A70;"><!ENTITY napE "&#x2A70;&#x338;"><!ENTITY eplus "&#x2A71;"><!ENTITY pluse "&#x2A72;"><!ENTITY Esim "&#x2A73;"><!ENTITY Colone "&#x2A74;"><!ENTITY Equal "&#x2A75;"><!ENTITY eDDot "&#x2A77;"><!ENTITY ddotseq "&#x2A77;"><!ENTITY equivDD "&#x2A78;"><!ENTITY ltcir "&#x2A79;"><!ENTITY gtcir "&#x2A7A;"><!ENTITY ltquest "&#x2A7B;"><!ENTITY gtquest "&#x2A7C;"><!ENTITY les "&#x2A7D;"><!ENTITY LessSlantEqual "&#x2A7D;"><!ENTITY leqslant "&#x2A7D;"><!ENTITY nles "&#x2A7D;&#x338;"><!ENTITY NotLessSlantEqual "&#x2A7D;&#x338;"><!ENTITY nleqslant "&#x2A7D;&#x338;"><!ENTITY ges "&#x2A7E;"><!ENTITY GreaterSlantEqual "&#x2A7E;"><!ENTITY geqslant "&#x2A7E;"><!ENTITY nges "&#x2A7E;&#x338;"><!ENTITY NotGreaterSlantEqual "&#x2A7E;&#x338;"><!ENTITY ngeqslant "&#x2A7E;&#x338;"><!ENTITY lesdot "&#x2A7F;"><!ENTITY gesdot "&#x2A80;"><!ENTITY lesdoto "&#x2A81;"><!ENTITY gesdoto "&#x2A82;"><!ENTITY lesdotor "&#x2A83;"><!ENTITY gesdotol "&#x2A84;"><!ENTITY lap "&#x2A85;"><!ENTITY lessapprox "&#x2A85;"><!ENTITY gap "&#x2A86;"><!ENTITY gtrapprox "&#x2A86;"><!ENTITY lne "&#x2A87;"><!ENTITY lneq "&#x2A87;"><!ENTITY gne "&#x2A88;"><!ENTITY gneq "&#x2A88;"><!ENTITY lnap "&#x2A89;"><!ENTITY lnapprox "&#x2A89;"><!ENTITY gnap "&#x2A8A;"><!ENTITY gnapprox "&#x2A8A;"><!ENTITY lEg "&#x2A8B;"><!ENTITY lesseqqgtr "&#x2A8B;"><!ENTITY gEl "&#x2A8C;"><!ENTITY gtreqqless "&#x2A8C;"><!ENTITY lsime "&#x2A8D;"><!ENTITY gsime "&#x2A8E;"><!ENTITY lsimg "&#x2A8F;"><!ENTITY gsiml "&#x2A90;"><!ENTITY lgE "&#x2A91;"><!ENTITY glE "&#x2A92;"><!ENTITY lesges "&#x2A93;"><!ENTITY gesles "&#x2A94;"><!ENTITY els "&#x2A95;"><!ENTITY eqslantless "&#x2A95;"><!ENTITY egs "&#x2A96;"><!ENTITY eqslantgtr "&#x2A96;"><!ENTITY elsdot "&#x2A97;"><!ENTITY egsdot "&#x2A98;"><!ENTITY el "&#x2A99;"><!ENTITY eg "&#x2A9A;"><!ENTITY siml "&#x2A9D;"><!ENTITY simg "&#x2A9E;"><!ENTITY simlE "&#x2A9F;"><!ENTITY simgE "&#x2AA0;"><!ENTITY LessLess "&#x2AA1;"><!ENTITY NotNestedLessLess "&#x2AA1;&#x338;"><!ENTITY GreaterGreater "&#x2AA2;"><!ENTITY NotNestedGreaterGreater "&#x2AA2;&#x338;"><!ENTITY glj "&#x2AA4;"><!ENTITY gla "&#x2AA5;"><!ENTITY ltcc "&#x2AA6;"><!ENTITY gtcc "&#x2AA7;"><!ENTITY lescc "&#x2AA8;"><!ENTITY gescc "&#x2AA9;"><!ENTITY smt "&#x2AAA;"><!ENTITY lat "&#x2AAB;"><!ENTITY smte "&#x2AAC;"><!ENTITY smtes "&#x2AAC;&#xFE00;"><!ENTITY late "&#x2AAD;"><!ENTITY lates "&#x2AAD;&#xFE00;"><!ENTITY bumpE "&#x2AAE;"><!ENTITY pre "&#x2AAF;"><!ENTITY preceq "&#x2AAF;"><!ENTITY PrecedesEqual "&#x2AAF;"><!ENTITY npre "&#x2AAF;&#x338;"><!ENTITY npreceq "&#x2AAF;&#x338;"><!ENTITY NotPrecedesEqual "&#x2AAF;&#x338;"><!ENTITY sce "&#x2AB0;"><!ENTITY succeq "&#x2AB0;"><!ENTITY SucceedsEqual "&#x2AB0;"><!ENTITY nsce "&#x2AB0;&#x338;"><!ENTITY nsucceq "&#x2AB0;&#x338;"><!ENTITY NotSucceedsEqual "&#x2AB0;&#x338;"><!ENTITY prE "&#x2AB3;"><!ENTITY scE "&#x2AB4;"><!ENTITY prnE "&#x2AB5;"><!ENTITY precneqq "&#x2AB5;"><!ENTITY scnE "&#x2AB6;"><!ENTITY succneqq "&#x2AB6;"><!ENTITY prap "&#x2AB7;"><!ENTITY precapprox "&#x2AB7;"><!ENTITY scap "&#x2AB8;"><!ENTITY succapprox "&#x2AB8;"><!ENTITY prnap "&#x2AB9;"><!ENTITY precnapprox "&#x2AB9;"><!ENTITY scnap "&#x2ABA;"><!ENTITY succnapprox "&#x2ABA;"><!ENTITY Pr "&#x2ABB;"><!ENTITY Sc "&#x2ABC;"><!ENTITY subdot "&#x2ABD;"><!ENTITY supdot "&#x2ABE;"><!ENTITY subplus "&#x2ABF;"><!ENTITY supplus "&#x2AC0;"><!ENTITY submult "&#x2AC1;"><!ENTITY supmult "&#x2AC2;"><!ENTITY subedot "&#x2AC3;"><!ENTITY supedot "&#x2AC4;"><!ENTITY subE "&#x2AC5;"><!ENTITY subseteqq "&#x2AC5;"><!ENTITY nsubE "&#x2AC5;&#x338;"><!ENTITY nsubseteqq "&#x2AC5;&#x338;"><!ENTITY supE "&#x2AC6;"><!ENTITY supseteqq "&#x2AC6;"><!ENTITY nsupE "&#x2AC6;&#x338;"><!ENTITY nsupseteqq "&#x2AC6;&#x338;"><!ENTITY subsim "&#x2AC7;"><!ENTITY supsim "&#x2AC8;"><!ENTITY subnE "&#x2ACB;"><!ENTITY subsetneqq "&#x2ACB;"><!ENTITY vsubnE "&#x2ACB;&#xFE00;"><!ENTITY varsubsetneqq "&#x2ACB;&#xFE00;"><!ENTITY supnE "&#x2ACC;"><!ENTITY supsetneqq "&#x2ACC;"><!ENTITY vsupnE "&#x2ACC;&#xFE00;"><!ENTITY varsupsetneqq "&#x2ACC;&#xFE00;"><!ENTITY csub "&#x2ACF;"><!ENTITY csup "&#x2AD0;"><!ENTITY csube "&#x2AD1;"><!ENTITY csupe "&#x2AD2;"><!ENTITY subsup "&#x2AD3;"><!ENTITY supsub "&#x2AD4;"><!ENTITY subsub "&#x2AD5;"><!ENTITY supsup "&#x2AD6;"><!ENTITY suphsub "&#x2AD7;"><!ENTITY supdsub "&#x2AD8;"><!ENTITY forkv "&#x2AD9;"><!ENTITY topfork "&#x2ADA;"><!ENTITY mlcp "&#x2ADB;"><!ENTITY Dashv "&#x2AE4;"><!ENTITY DoubleLeftTee "&#x2AE4;"><!ENTITY Vdashl "&#x2AE6;"><!ENTITY Barv "&#x2AE7;"><!ENTITY vBar "&#x2AE8;"><!ENTITY vBarv "&#x2AE9;"><!ENTITY Vbar "&#x2AEB;"><!ENTITY Not "&#x2AEC;"><!ENTITY bNot "&#x2AED;"><!ENTITY rnmid "&#x2AEE;"><!ENTITY cirmid "&#x2AEF;"><!ENTITY midcir "&#x2AF0;"><!ENTITY topcir "&#x2AF1;"><!ENTITY nhpar "&#x2AF2;"><!ENTITY parsim "&#x2AF3;"><!ENTITY parsl "&#x2AFD;"><!ENTITY nparsl "&#x2AFD;&#x20E5;"><!ENTITY fflig "&#xFB00;"><!ENTITY filig "&#xFB01;"><!ENTITY fllig "&#xFB02;"><!ENTITY ffilig "&#xFB03;"><!ENTITY ffllig "&#xFB04;"><!ENTITY Ascr "&#x1D49C;"><!ENTITY Cscr "&#x1D49E;"><!ENTITY Dscr "&#x1D49F;"><!ENTITY Gscr "&#x1D4A2;"><!ENTITY Jscr "&#x1D4A5;"><!ENTITY Kscr "&#x1D4A6;"><!ENTITY Nscr "&#x1D4A9;"><!ENTITY Oscr "&#x1D4AA;"><!ENTITY Pscr "&#x1D4AB;"><!ENTITY Qscr "&#x1D4AC;"><!ENTITY Sscr "&#x1D4AE;"><!ENTITY Tscr "&#x1D4AF;"><!ENTITY Uscr "&#x1D4B0;"><!ENTITY Vscr "&#x1D4B1;"><!ENTITY Wscr "&#x1D4B2;"><!ENTITY Xscr "&#x1D4B3;"><!ENTITY Yscr "&#x1D4B4;"><!ENTITY Zscr "&#x1D4B5;"><!ENTITY ascr "&#x1D4B6;"><!ENTITY bscr "&#x1D4B7;"><!ENTITY cscr "&#x1D4B8;"><!ENTITY dscr "&#x1D4B9;"><!ENTITY fscr "&#x1D4BB;"><!ENTITY hscr "&#x1D4BD;"><!ENTITY iscr "&#x1D4BE;"><!ENTITY jscr "&#x1D4BF;"><!ENTITY kscr "&#x1D4C0;"><!ENTITY lscr "&#x1D4C1;"><!ENTITY mscr "&#x1D4C2;"><!ENTITY nscr "&#x1D4C3;"><!ENTITY pscr "&#x1D4C5;"><!ENTITY qscr "&#x1D4C6;"><!ENTITY rscr "&#x1D4C7;"><!ENTITY sscr "&#x1D4C8;"><!ENTITY tscr "&#x1D4C9;"><!ENTITY uscr "&#x1D4CA;"><!ENTITY vscr "&#x1D4CB;"><!ENTITY wscr "&#x1D4CC;"><!ENTITY xscr "&#x1D4CD;"><!ENTITY yscr "&#x1D4CE;"><!ENTITY zscr "&#x1D4CF;"><!ENTITY Afr "&#x1D504;"><!ENTITY Bfr "&#x1D505;"><!ENTITY Dfr "&#x1D507;"><!ENTITY Efr "&#x1D508;"><!ENTITY Ffr "&#x1D509;"><!ENTITY Gfr "&#x1D50A;"><!ENTITY Jfr "&#x1D50D;"><!ENTITY Kfr "&#x1D50E;"><!ENTITY Lfr "&#x1D50F;"><!ENTITY Mfr "&#x1D510;"><!ENTITY Nfr "&#x1D511;"><!ENTITY Ofr "&#x1D512;"><!ENTITY Pfr "&#x1D513;"><!ENTITY Qfr "&#x1D514;"><!ENTITY Sfr "&#x1D516;"><!ENTITY Tfr "&#x1D517;"><!ENTITY Ufr "&#x1D518;"><!ENTITY Vfr "&#x1D519;"><!ENTITY Wfr "&#x1D51A;"><!ENTITY Xfr "&#x1D51B;"><!ENTITY Yfr "&#x1D51C;"><!ENTITY afr "&#x1D51E;"><!ENTITY bfr "&#x1D51F;"><!ENTITY cfr "&#x1D520;"><!ENTITY dfr "&#x1D521;"><!ENTITY efr "&#x1D522;"><!ENTITY ffr "&#x1D523;"><!ENTITY gfr "&#x1D524;"><!ENTITY hfr "&#x1D525;"><!ENTITY ifr "&#x1D526;"><!ENTITY jfr "&#x1D527;"><!ENTITY kfr "&#x1D528;"><!ENTITY lfr "&#x1D529;"><!ENTITY mfr "&#x1D52A;"><!ENTITY nfr "&#x1D52B;"><!ENTITY ofr "&#x1D52C;"><!ENTITY pfr "&#x1D52D;"><!ENTITY qfr "&#x1D52E;"><!ENTITY rfr "&#x1D52F;"><!ENTITY sfr "&#x1D530;"><!ENTITY tfr "&#x1D531;"><!ENTITY ufr "&#x1D532;"><!ENTITY vfr "&#x1D533;"><!ENTITY wfr "&#x1D534;"><!ENTITY xfr "&#x1D535;"><!ENTITY yfr "&#x1D536;"><!ENTITY zfr "&#x1D537;"><!ENTITY Aopf "&#x1D538;"><!ENTITY Bopf "&#x1D539;"><!ENTITY Dopf "&#x1D53B;"><!ENTITY Eopf "&#x1D53C;"><!ENTITY Fopf "&#x1D53D;"><!ENTITY Gopf "&#x1D53E;"><!ENTITY Iopf "&#x1D540;"><!ENTITY Jopf "&#x1D541;"><!ENTITY Kopf "&#x1D542;"><!ENTITY Lopf "&#x1D543;"><!ENTITY Mopf "&#x1D544;"><!ENTITY Oopf "&#x1D546;"><!ENTITY Sopf "&#x1D54A;"><!ENTITY Topf "&#x1D54B;"><!ENTITY Uopf "&#x1D54C;"><!ENTITY Vopf "&#x1D54D;"><!ENTITY Wopf "&#x1D54E;"><!ENTITY Xopf "&#x1D54F;"><!ENTITY Yopf "&#x1D550;"><!ENTITY aopf "&#x1D552;"><!ENTITY bopf "&#x1D553;"><!ENTITY copf "&#x1D554;"><!ENTITY dopf "&#x1D555;"><!ENTITY eopf "&#x1D556;"><!ENTITY fopf "&#x1D557;"><!ENTITY gopf "&#x1D558;"><!ENTITY hopf "&#x1D559;"><!ENTITY iopf "&#x1D55A;"><!ENTITY jopf "&#x1D55B;"><!ENTITY kopf "&#x1D55C;"><!ENTITY lopf "&#x1D55D;"><!ENTITY mopf "&#x1D55E;"><!ENTITY nopf "&#x1D55F;"><!ENTITY oopf "&#x1D560;"><!ENTITY popf "&#x1D561;"><!ENTITY qopf "&#x1D562;"><!ENTITY ropf "&#x1D563;"><!ENTITY sopf "&#x1D564;"><!ENTITY topf "&#x1D565;"><!ENTITY uopf "&#x1D566;"><!ENTITY vopf "&#x1D567;"><!ENTITY wopf "&#x1D568;"><!ENTITY xopf "&#x1D569;"><!ENTITY yopf "&#x1D56A;"><!ENTITY zopf "&#x1D56B;">
)xmlxmlxml";
}
diff --git a/Userland/Libraries/LibX86/Instruction.cpp b/Userland/Libraries/LibX86/Instruction.cpp
index 4907fd72a0..acc82b06c1 100644
--- a/Userland/Libraries/LibX86/Instruction.cpp
+++ b/Userland/Libraries/LibX86/Instruction.cpp
@@ -33,7 +33,7 @@ static bool opcode_has_register_index(u8 op)
return false;
}
-static void build(InstructionDescriptor* table, u8 op, const char* mnemonic, InstructionFormat format, InstructionHandler handler, IsLockPrefixAllowed lock_prefix_allowed)
+static void build(InstructionDescriptor* table, u8 op, char const* mnemonic, InstructionFormat format, InstructionHandler handler, IsLockPrefixAllowed lock_prefix_allowed)
{
InstructionDescriptor& d = table[op];
@@ -111,7 +111,7 @@ static void build(InstructionDescriptor* table, u8 op, const char* mnemonic, Ins
case OP_NEAR_imm:
d.imm1_bytes = CurrentAddressSize;
break;
- //default:
+ // default:
case InvalidFormat:
case MultibyteWithSlash:
case InstructionPrefix:
@@ -202,7 +202,7 @@ static void build(InstructionDescriptor* table, u8 op, const char* mnemonic, Ins
}
}
-static void build_slash(InstructionDescriptor* table, u8 op, u8 slash, const char* mnemonic, InstructionFormat format, InstructionHandler handler, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
+static void build_slash(InstructionDescriptor* table, u8 op, u8 slash, char const* mnemonic, InstructionFormat format, InstructionHandler handler, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
{
InstructionDescriptor& d = table[op];
VERIFY(d.handler == nullptr);
@@ -214,7 +214,7 @@ static void build_slash(InstructionDescriptor* table, u8 op, u8 slash, const cha
build(d.slashes, slash, mnemonic, format, handler, lock_prefix_allowed);
}
-static void build_slash_rm(InstructionDescriptor* table, u8 op, u8 slash, u8 rm, const char* mnemonic, InstructionFormat format, InstructionHandler handler)
+static void build_slash_rm(InstructionDescriptor* table, u8 op, u8 slash, u8 rm, char const* mnemonic, InstructionFormat format, InstructionHandler handler)
{
VERIFY((rm & 0xc0) == 0xc0);
VERIFY(((rm >> 3) & 7) == slash);
@@ -235,79 +235,79 @@ static void build_slash_rm(InstructionDescriptor* table, u8 op, u8 slash, u8 rm,
build(d.slashes, rm & 7, mnemonic, format, handler, LockPrefixNotAllowed);
}
-static void build_0f(u8 op, const char* mnemonic, InstructionFormat format, InstructionHandler impl, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
+static void build_0f(u8 op, char const* mnemonic, InstructionFormat format, InstructionHandler impl, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
{
build(s_0f_table16, op, mnemonic, format, impl, lock_prefix_allowed);
build(s_0f_table32, op, mnemonic, format, impl, lock_prefix_allowed);
}
-static void build(u8 op, const char* mnemonic, InstructionFormat format, InstructionHandler impl, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
+static void build(u8 op, char const* mnemonic, InstructionFormat format, InstructionHandler impl, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
{
build(s_table16, op, mnemonic, format, impl, lock_prefix_allowed);
build(s_table32, op, mnemonic, format, impl, lock_prefix_allowed);
}
-static void build(u8 op, const char* mnemonic, InstructionFormat format16, InstructionHandler impl16, InstructionFormat format32, InstructionHandler impl32, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
+static void build(u8 op, char const* mnemonic, InstructionFormat format16, InstructionHandler impl16, InstructionFormat format32, InstructionHandler impl32, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
{
build(s_table16, op, mnemonic, format16, impl16, lock_prefix_allowed);
build(s_table32, op, mnemonic, format32, impl32, lock_prefix_allowed);
}
-static void build_0f(u8 op, const char* mnemonic, InstructionFormat format16, InstructionHandler impl16, InstructionFormat format32, InstructionHandler impl32, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
+static void build_0f(u8 op, char const* mnemonic, InstructionFormat format16, InstructionHandler impl16, InstructionFormat format32, InstructionHandler impl32, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
{
build(s_0f_table16, op, mnemonic, format16, impl16, lock_prefix_allowed);
build(s_0f_table32, op, mnemonic, format32, impl32, lock_prefix_allowed);
}
-static void build(u8 op, const char* mnemonic16, InstructionFormat format16, InstructionHandler impl16, const char* mnemonic32, InstructionFormat format32, InstructionHandler impl32, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
+static void build(u8 op, char const* mnemonic16, InstructionFormat format16, InstructionHandler impl16, char const* mnemonic32, InstructionFormat format32, InstructionHandler impl32, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
{
build(s_table16, op, mnemonic16, format16, impl16, lock_prefix_allowed);
build(s_table32, op, mnemonic32, format32, impl32, lock_prefix_allowed);
}
-static void build_0f(u8 op, const char* mnemonic16, InstructionFormat format16, InstructionHandler impl16, const char* mnemonic32, InstructionFormat format32, InstructionHandler impl32, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
+static void build_0f(u8 op, char const* mnemonic16, InstructionFormat format16, InstructionHandler impl16, char const* mnemonic32, InstructionFormat format32, InstructionHandler impl32, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
{
build(s_0f_table16, op, mnemonic16, format16, impl16, lock_prefix_allowed);
build(s_0f_table32, op, mnemonic32, format32, impl32, lock_prefix_allowed);
}
-static void build_slash(u8 op, u8 slash, const char* mnemonic, InstructionFormat format, InstructionHandler impl, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
+static void build_slash(u8 op, u8 slash, char const* mnemonic, InstructionFormat format, InstructionHandler impl, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
{
build_slash(s_table16, op, slash, mnemonic, format, impl, lock_prefix_allowed);
build_slash(s_table32, op, slash, mnemonic, format, impl, lock_prefix_allowed);
}
-static void build_slash(u8 op, u8 slash, const char* mnemonic, InstructionFormat format16, InstructionHandler impl16, InstructionFormat format32, InstructionHandler impl32, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
+static void build_slash(u8 op, u8 slash, char const* mnemonic, InstructionFormat format16, InstructionHandler impl16, InstructionFormat format32, InstructionHandler impl32, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
{
build_slash(s_table16, op, slash, mnemonic, format16, impl16, lock_prefix_allowed);
build_slash(s_table32, op, slash, mnemonic, format32, impl32, lock_prefix_allowed);
}
-static void build_0f_slash(u8 op, u8 slash, const char* mnemonic, InstructionFormat format16, InstructionHandler impl16, InstructionFormat format32, InstructionHandler impl32, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
+static void build_0f_slash(u8 op, u8 slash, char const* mnemonic, InstructionFormat format16, InstructionHandler impl16, InstructionFormat format32, InstructionHandler impl32, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
{
build_slash(s_0f_table16, op, slash, mnemonic, format16, impl16, lock_prefix_allowed);
build_slash(s_0f_table32, op, slash, mnemonic, format32, impl32, lock_prefix_allowed);
}
-static void build_0f_slash(u8 op, u8 slash, const char* mnemonic, InstructionFormat format, InstructionHandler impl, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
+static void build_0f_slash(u8 op, u8 slash, char const* mnemonic, InstructionFormat format, InstructionHandler impl, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
{
build_slash(s_0f_table16, op, slash, mnemonic, format, impl, lock_prefix_allowed);
build_slash(s_0f_table32, op, slash, mnemonic, format, impl, lock_prefix_allowed);
}
-static void build_slash_rm(u8 op, u8 slash, u8 rm, const char* mnemonic, InstructionFormat format, InstructionHandler impl)
+static void build_slash_rm(u8 op, u8 slash, u8 rm, char const* mnemonic, InstructionFormat format, InstructionHandler impl)
{
build_slash_rm(s_table16, op, slash, rm, mnemonic, format, impl);
build_slash_rm(s_table32, op, slash, rm, mnemonic, format, impl);
}
-static void build_slash_reg(u8 op, u8 slash, const char* mnemonic, InstructionFormat format, InstructionHandler impl)
+static void build_slash_reg(u8 op, u8 slash, char const* mnemonic, InstructionFormat format, InstructionHandler impl)
{
for (int i = 0; i < 8; ++i)
build_slash_rm(op, slash, 0xc0 | (slash << 3) | i, mnemonic, format, impl);
}
-static void build_sse_np(u8 op, const char* mnemonic, InstructionFormat format, InstructionHandler impl, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
+static void build_sse_np(u8 op, char const* mnemonic, InstructionFormat format, InstructionHandler impl, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
{
if (s_0f_table32[op].format == InvalidFormat) {
build_0f(op, mnemonic, format, impl, lock_prefix_allowed);
@@ -321,7 +321,7 @@ static void build_sse_np(u8 op, const char* mnemonic, InstructionFormat format,
build(s_sse_table_np, op, mnemonic, format, impl, lock_prefix_allowed);
}
-static void build_sse_66(u8 op, const char* mnemonic, InstructionFormat format, InstructionHandler impl, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
+static void build_sse_66(u8 op, char const* mnemonic, InstructionFormat format, InstructionHandler impl, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
{
if (s_0f_table32[op].format != __SSE)
build_0f(op, "__SSE_temp", __SSE, nullptr, lock_prefix_allowed);
@@ -329,7 +329,7 @@ static void build_sse_66(u8 op, const char* mnemonic, InstructionFormat format,
build(s_sse_table_66, op, mnemonic, format, impl, lock_prefix_allowed);
}
-static void build_sse_f3(u8 op, const char* mnemonic, InstructionFormat format, InstructionHandler impl, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
+static void build_sse_f3(u8 op, char const* mnemonic, InstructionFormat format, InstructionHandler impl, IsLockPrefixAllowed lock_prefix_allowed = LockPrefixNotAllowed)
{
if (s_0f_table32[op].format != __SSE)
build_0f(op, "__SSE_temp", __SSE, nullptr, lock_prefix_allowed);
@@ -1086,44 +1086,44 @@ static void build_sse_f3(u8 op, const char* mnemonic, InstructionFormat format,
build_0f(0xFF, "UD0", OP, &Interpreter::UD0);
}
-static const char* register_name(RegisterIndex8);
-static const char* register_name(RegisterIndex16);
-static const char* register_name(RegisterIndex32);
-static const char* register_name(FpuRegisterIndex);
-static const char* register_name(SegmentRegister);
-static const char* register_name(MMXRegisterIndex);
-static const char* register_name(XMMRegisterIndex);
+static char const* register_name(RegisterIndex8);
+static char const* register_name(RegisterIndex16);
+static char const* register_name(RegisterIndex32);
+static char const* register_name(FpuRegisterIndex);
+static char const* register_name(SegmentRegister);
+static char const* register_name(MMXRegisterIndex);
+static char const* register_name(XMMRegisterIndex);
-const char* Instruction::reg8_name() const
+char const* Instruction::reg8_name() const
{
return register_name(static_cast<RegisterIndex8>(register_index()));
}
-const char* Instruction::reg16_name() const
+char const* Instruction::reg16_name() const
{
return register_name(static_cast<RegisterIndex16>(register_index()));
}
-const char* Instruction::reg32_name() const
+char const* Instruction::reg32_name() const
{
return register_name(static_cast<RegisterIndex32>(register_index()));
}
-String MemoryOrRegisterReference::to_string_o8(const Instruction& insn) const
+String MemoryOrRegisterReference::to_string_o8(Instruction const& insn) const
{
if (is_register())
return register_name(reg8());
return String::formatted("[{}]", to_string(insn));
}
-String MemoryOrRegisterReference::to_string_o16(const Instruction& insn) const
+String MemoryOrRegisterReference::to_string_o16(Instruction const& insn) const
{
if (is_register())
return register_name(reg16());
return String::formatted("[{}]", to_string(insn));
}
-String MemoryOrRegisterReference::to_string_o32(const Instruction& insn) const
+String MemoryOrRegisterReference::to_string_o32(Instruction const& insn) const
{
if (is_register())
return register_name(reg32());
@@ -1136,7 +1136,7 @@ String MemoryOrRegisterReference::to_string_fpu_reg() const
return register_name(reg_fpu());
}
-String MemoryOrRegisterReference::to_string_fpu_mem(const Instruction& insn) const
+String MemoryOrRegisterReference::to_string_fpu_mem(Instruction const& insn) const
{
VERIFY(!is_register());
return String::formatted("[{}]", to_string(insn));
@@ -1148,46 +1148,46 @@ String MemoryOrRegisterReference::to_string_fpu_ax16() const
return register_name(reg16());
}
-String MemoryOrRegisterReference::to_string_fpu16(const Instruction& insn) const
+String MemoryOrRegisterReference::to_string_fpu16(Instruction const& insn) const
{
if (is_register())
return register_name(reg_fpu());
return String::formatted("word ptr [{}]", to_string(insn));
}
-String MemoryOrRegisterReference::to_string_fpu32(const Instruction& insn) const
+String MemoryOrRegisterReference::to_string_fpu32(Instruction const& insn) const
{
if (is_register())
return register_name(reg_fpu());
return String::formatted("dword ptr [{}]", to_string(insn));
}
-String MemoryOrRegisterReference::to_string_fpu64(const Instruction& insn) const
+String MemoryOrRegisterReference::to_string_fpu64(Instruction const& insn) const
{
if (is_register())
return register_name(reg_fpu());
return String::formatted("qword ptr [{}]", to_string(insn));
}
-String MemoryOrRegisterReference::to_string_fpu80(const Instruction& insn) const
+String MemoryOrRegisterReference::to_string_fpu80(Instruction const& insn) const
{
VERIFY(!is_register());
return String::formatted("tbyte ptr [{}]", to_string(insn));
}
-String MemoryOrRegisterReference::to_string_mm(const Instruction& insn) const
+String MemoryOrRegisterReference::to_string_mm(Instruction const& insn) const
{
if (is_register())
return register_name(static_cast<MMXRegisterIndex>(m_register_index));
return String::formatted("[{}]", to_string(insn));
}
-String MemoryOrRegisterReference::to_string_xmm(const Instruction& insn) const
+String MemoryOrRegisterReference::to_string_xmm(Instruction const& insn) const
{
if (is_register())
return register_name(static_cast<XMMRegisterIndex>(m_register_index));
return String::formatted("[{}]", to_string(insn));
}
-String MemoryOrRegisterReference::to_string(const Instruction& insn) const
+String MemoryOrRegisterReference::to_string(Instruction const& insn) const
{
if (insn.a32())
return to_string_a32();
@@ -1407,7 +1407,7 @@ static String relative_address(u32 origin, bool x32, i32 imm)
return String::formatted("{:#04x}", w + si);
}
-String Instruction::to_string(u32 origin, const SymbolProvider* symbol_provider, bool x32) const
+String Instruction::to_string(u32 origin, SymbolProvider const* symbol_provider, bool x32) const
{
StringBuilder builder;
if (has_segment_prefix())
@@ -1424,7 +1424,7 @@ String Instruction::to_string(u32 origin, const SymbolProvider* symbol_provider,
return builder.to_string();
}
-void Instruction::to_string_internal(StringBuilder& builder, u32 origin, const SymbolProvider* symbol_provider, bool x32) const
+void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolProvider const* symbol_provider, bool x32) const
{
if (!m_descriptor) {
builder.appendff("db {:02x}", m_op);
@@ -2215,45 +2215,45 @@ String Instruction::mnemonic() const
return m_descriptor->mnemonic;
}
-const char* register_name(SegmentRegister index)
+char const* register_name(SegmentRegister index)
{
- static constexpr const char* names[] = { "es", "cs", "ss", "ds", "fs", "gs", "segr6", "segr7" };
+ static constexpr char const* names[] = { "es", "cs", "ss", "ds", "fs", "gs", "segr6", "segr7" };
return names[(int)index & 7];
}
-const char* register_name(RegisterIndex8 register_index)
+char const* register_name(RegisterIndex8 register_index)
{
- static constexpr const char* names[] = { "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh" };
+ static constexpr char const* names[] = { "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh" };
return names[register_index & 7];
}
-const char* register_name(RegisterIndex16 register_index)
+char const* register_name(RegisterIndex16 register_index)
{
- static constexpr const char* names[] = { "ax", "cx", "dx", "bx", "sp", "bp", "si", "di" };
+ static constexpr char const* names[] = { "ax", "cx", "dx", "bx", "sp", "bp", "si", "di" };
return names[register_index & 7];
}
-const char* register_name(RegisterIndex32 register_index)
+char const* register_name(RegisterIndex32 register_index)
{
- static constexpr const char* names[] = { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi" };
+ static constexpr char const* names[] = { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi" };
return names[register_index & 7];
}
-const char* register_name(FpuRegisterIndex register_index)
+char const* register_name(FpuRegisterIndex register_index)
{
- static constexpr const char* names[] = { "st0", "st1", "st2", "st3", "st4", "st5", "st6", "st7" };
+ static constexpr char const* names[] = { "st0", "st1", "st2", "st3", "st4", "st5", "st6", "st7" };
return names[register_index & 7];
}
-const char* register_name(MMXRegisterIndex register_index)
+char const* register_name(MMXRegisterIndex register_index)
{
- static constexpr const char* names[] = { "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7" };
+ static constexpr char const* names[] = { "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7" };
return names[register_index & 7];
}
-const char* register_name(XMMRegisterIndex register_index)
+char const* register_name(XMMRegisterIndex register_index)
{
- static constexpr const char* names[] = { "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7" };
+ static constexpr char const* names[] = { "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7" };
return names[register_index & 7];
}
diff --git a/Userland/Libraries/LibX86/Instruction.h b/Userland/Libraries/LibX86/Instruction.h
index 60a797091e..b70287d925 100644
--- a/Userland/Libraries/LibX86/Instruction.h
+++ b/Userland/Libraries/LibX86/Instruction.h
@@ -17,7 +17,7 @@ namespace X86 {
class Instruction;
class Interpreter;
-typedef void (Interpreter::*InstructionHandler)(const Instruction&);
+typedef void (Interpreter::*InstructionHandler)(Instruction const&);
class SymbolProvider {
public:
@@ -194,7 +194,7 @@ static constexpr unsigned CurrentAddressSize = 0xB33FBABE;
struct InstructionDescriptor {
InstructionHandler handler { nullptr };
bool opcode_has_register_index { false };
- const char* mnemonic { nullptr };
+ char const* mnemonic { nullptr };
InstructionFormat format { InvalidFormat };
bool has_rm { false };
unsigned imm1_bytes { 0 };
@@ -352,7 +352,7 @@ protected:
class SimpleInstructionStream final : public InstructionStream {
public:
- SimpleInstructionStream(const u8* data, size_t size)
+ SimpleInstructionStream(u8 const* data, size_t size)
: m_data(data)
, m_size(size)
{
@@ -389,7 +389,7 @@ public:
size_t offset() const { return m_offset; }
private:
- const u8* m_data { nullptr };
+ u8 const* m_data { nullptr };
size_t m_offset { 0 };
size_t m_size { 0 };
};
@@ -398,18 +398,18 @@ class MemoryOrRegisterReference {
friend class Instruction;
public:
- String to_string_o8(const Instruction&) const;
- String to_string_o16(const Instruction&) const;
- String to_string_o32(const Instruction&) const;
+ String to_string_o8(Instruction const&) const;
+ String to_string_o16(Instruction const&) const;
+ String to_string_o32(Instruction const&) const;
String to_string_fpu_reg() const;
- String to_string_fpu_mem(const Instruction&) const;
+ String to_string_fpu_mem(Instruction const&) const;
String to_string_fpu_ax16() const;
- String to_string_fpu16(const Instruction&) const;
- String to_string_fpu32(const Instruction&) const;
- String to_string_fpu64(const Instruction&) const;
- String to_string_fpu80(const Instruction&) const;
- String to_string_mm(const Instruction&) const;
- String to_string_xmm(const Instruction&) const;
+ String to_string_fpu16(Instruction const&) const;
+ String to_string_fpu32(Instruction const&) const;
+ String to_string_fpu64(Instruction const&) const;
+ String to_string_fpu80(Instruction const&) const;
+ String to_string_mm(Instruction const&) const;
+ String to_string_xmm(Instruction const&) const;
bool is_register() const { return m_register_index != 0x7f; }
@@ -425,38 +425,38 @@ public:
u8 rm() const { return m_rm_byte & 0b111; }
template<typename CPU, typename T>
- void write8(CPU&, const Instruction&, T);
+ void write8(CPU&, Instruction const&, T);
template<typename CPU, typename T>
- void write16(CPU&, const Instruction&, T);
+ void write16(CPU&, Instruction const&, T);
template<typename CPU, typename T>
- void write32(CPU&, const Instruction&, T);
+ void write32(CPU&, Instruction const&, T);
template<typename CPU, typename T>
- void write64(CPU&, const Instruction&, T);
+ void write64(CPU&, Instruction const&, T);
template<typename CPU, typename T>
- void write128(CPU&, const Instruction&, T);
+ void write128(CPU&, Instruction const&, T);
template<typename CPU, typename T>
- void write256(CPU&, const Instruction&, T);
+ void write256(CPU&, Instruction const&, T);
template<typename CPU>
- typename CPU::ValueWithShadowType8 read8(CPU&, const Instruction&);
+ typename CPU::ValueWithShadowType8 read8(CPU&, Instruction const&);
template<typename CPU>
- typename CPU::ValueWithShadowType16 read16(CPU&, const Instruction&);
+ typename CPU::ValueWithShadowType16 read16(CPU&, Instruction const&);
template<typename CPU>
- typename CPU::ValueWithShadowType32 read32(CPU&, const Instruction&);
+ typename CPU::ValueWithShadowType32 read32(CPU&, Instruction const&);
template<typename CPU>
- typename CPU::ValueWithShadowType64 read64(CPU&, const Instruction&);
+ typename CPU::ValueWithShadowType64 read64(CPU&, Instruction const&);
template<typename CPU>
- typename CPU::ValueWithShadowType128 read128(CPU&, const Instruction&);
+ typename CPU::ValueWithShadowType128 read128(CPU&, Instruction const&);
template<typename CPU>
- typename CPU::ValueWithShadowType256 read256(CPU&, const Instruction&);
+ typename CPU::ValueWithShadowType256 read256(CPU&, Instruction const&);
template<typename CPU>
- LogicalAddress resolve(const CPU&, const Instruction&);
+ LogicalAddress resolve(const CPU&, Instruction const&);
private:
MemoryOrRegisterReference() = default;
- String to_string(const Instruction&) const;
+ String to_string(Instruction const&) const;
String to_string_a16() const;
String to_string_a32() const;
@@ -550,17 +550,17 @@ public:
bool a32() const { return m_a32; }
- String to_string(u32 origin, const SymbolProvider* = nullptr, bool x32 = true) const;
+ String to_string(u32 origin, SymbolProvider const* = nullptr, bool x32 = true) const;
private:
template<typename InstructionStreamType>
Instruction(InstructionStreamType&, bool o32, bool a32);
- void to_string_internal(StringBuilder&, u32 origin, const SymbolProvider*, bool x32) const;
+ void to_string_internal(StringBuilder&, u32 origin, SymbolProvider const*, bool x32) const;
- const char* reg8_name() const;
- const char* reg16_name() const;
- const char* reg32_name() const;
+ char const* reg8_name() const;
+ char const* reg16_name() const;
+ char const* reg32_name() const;
InstructionDescriptor* m_descriptor { nullptr };
mutable MemoryOrRegisterReference m_modrm;
@@ -697,7 +697,7 @@ ALWAYS_INLINE u32 MemoryOrRegisterReference::evaluate_sib(const CPU& cpu, Segmen
}
template<typename CPU, typename T>
-ALWAYS_INLINE void MemoryOrRegisterReference::write8(CPU& cpu, const Instruction& insn, T value)
+ALWAYS_INLINE void MemoryOrRegisterReference::write8(CPU& cpu, Instruction const& insn, T value)
{
if (is_register()) {
cpu.gpr8(reg8()) = value;
@@ -709,7 +709,7 @@ ALWAYS_INLINE void MemoryOrRegisterReference::write8(CPU& cpu, const Instruction
}
template<typename CPU, typename T>
-ALWAYS_INLINE void MemoryOrRegisterReference::write16(CPU& cpu, const Instruction& insn, T value)
+ALWAYS_INLINE void MemoryOrRegisterReference::write16(CPU& cpu, Instruction const& insn, T value)
{
if (is_register()) {
cpu.gpr16(reg16()) = value;
@@ -721,7 +721,7 @@ ALWAYS_INLINE void MemoryOrRegisterReference::write16(CPU& cpu, const Instructio
}
template<typename CPU, typename T>
-ALWAYS_INLINE void MemoryOrRegisterReference::write32(CPU& cpu, const Instruction& insn, T value)
+ALWAYS_INLINE void MemoryOrRegisterReference::write32(CPU& cpu, Instruction const& insn, T value)
{
if (is_register()) {
cpu.gpr32(reg32()) = value;
@@ -733,7 +733,7 @@ ALWAYS_INLINE void MemoryOrRegisterReference::write32(CPU& cpu, const Instructio
}
template<typename CPU, typename T>
-ALWAYS_INLINE void MemoryOrRegisterReference::write64(CPU& cpu, const Instruction& insn, T value)
+ALWAYS_INLINE void MemoryOrRegisterReference::write64(CPU& cpu, Instruction const& insn, T value)
{
VERIFY(!is_register());
auto address = resolve(cpu, insn);
@@ -741,7 +741,7 @@ ALWAYS_INLINE void MemoryOrRegisterReference::write64(CPU& cpu, const Instructio
}
template<typename CPU, typename T>
-ALWAYS_INLINE void MemoryOrRegisterReference::write128(CPU& cpu, const Instruction& insn, T value)
+ALWAYS_INLINE void MemoryOrRegisterReference::write128(CPU& cpu, Instruction const& insn, T value)
{
VERIFY(!is_register());
auto address = resolve(cpu, insn);
@@ -749,7 +749,7 @@ ALWAYS_INLINE void MemoryOrRegisterReference::write128(CPU& cpu, const Instructi
}
template<typename CPU, typename T>
-ALWAYS_INLINE void MemoryOrRegisterReference::write256(CPU& cpu, const Instruction& insn, T value)
+ALWAYS_INLINE void MemoryOrRegisterReference::write256(CPU& cpu, Instruction const& insn, T value)
{
VERIFY(!is_register());
auto address = resolve(cpu, insn);
@@ -757,7 +757,7 @@ ALWAYS_INLINE void MemoryOrRegisterReference::write256(CPU& cpu, const Instructi
}
template<typename CPU>
-ALWAYS_INLINE typename CPU::ValueWithShadowType8 MemoryOrRegisterReference::read8(CPU& cpu, const Instruction& insn)
+ALWAYS_INLINE typename CPU::ValueWithShadowType8 MemoryOrRegisterReference::read8(CPU& cpu, Instruction const& insn)
{
if (is_register())
return cpu.const_gpr8(reg8());
@@ -767,7 +767,7 @@ ALWAYS_INLINE typename CPU::ValueWithShadowType8 MemoryOrRegisterReference::read
}
template<typename CPU>
-ALWAYS_INLINE typename CPU::ValueWithShadowType16 MemoryOrRegisterReference::read16(CPU& cpu, const Instruction& insn)
+ALWAYS_INLINE typename CPU::ValueWithShadowType16 MemoryOrRegisterReference::read16(CPU& cpu, Instruction const& insn)
{
if (is_register())
return cpu.const_gpr16(reg16());
@@ -777,7 +777,7 @@ ALWAYS_INLINE typename CPU::ValueWithShadowType16 MemoryOrRegisterReference::rea
}
template<typename CPU>
-ALWAYS_INLINE typename CPU::ValueWithShadowType32 MemoryOrRegisterReference::read32(CPU& cpu, const Instruction& insn)
+ALWAYS_INLINE typename CPU::ValueWithShadowType32 MemoryOrRegisterReference::read32(CPU& cpu, Instruction const& insn)
{
if (is_register())
return cpu.const_gpr32(reg32());
@@ -787,7 +787,7 @@ ALWAYS_INLINE typename CPU::ValueWithShadowType32 MemoryOrRegisterReference::rea
}
template<typename CPU>
-ALWAYS_INLINE typename CPU::ValueWithShadowType64 MemoryOrRegisterReference::read64(CPU& cpu, const Instruction& insn)
+ALWAYS_INLINE typename CPU::ValueWithShadowType64 MemoryOrRegisterReference::read64(CPU& cpu, Instruction const& insn)
{
VERIFY(!is_register());
auto address = resolve(cpu, insn);
@@ -795,7 +795,7 @@ ALWAYS_INLINE typename CPU::ValueWithShadowType64 MemoryOrRegisterReference::rea
}
template<typename CPU>
-ALWAYS_INLINE typename CPU::ValueWithShadowType128 MemoryOrRegisterReference::read128(CPU& cpu, const Instruction& insn)
+ALWAYS_INLINE typename CPU::ValueWithShadowType128 MemoryOrRegisterReference::read128(CPU& cpu, Instruction const& insn)
{
VERIFY(!is_register());
auto address = resolve(cpu, insn);
@@ -803,7 +803,7 @@ ALWAYS_INLINE typename CPU::ValueWithShadowType128 MemoryOrRegisterReference::re
}
template<typename CPU>
-ALWAYS_INLINE typename CPU::ValueWithShadowType256 MemoryOrRegisterReference::read256(CPU& cpu, const Instruction& insn)
+ALWAYS_INLINE typename CPU::ValueWithShadowType256 MemoryOrRegisterReference::read256(CPU& cpu, Instruction const& insn)
{
VERIFY(!is_register());
auto address = resolve(cpu, insn);
@@ -1085,7 +1085,7 @@ ALWAYS_INLINE void MemoryOrRegisterReference::decode32(InstructionStreamType& st
}
template<typename CPU>
-ALWAYS_INLINE LogicalAddress MemoryOrRegisterReference::resolve(const CPU& cpu, const Instruction& insn)
+ALWAYS_INLINE LogicalAddress MemoryOrRegisterReference::resolve(const CPU& cpu, Instruction const& insn)
{
if (insn.a32())
return resolve32(cpu, insn.segment_prefix());
diff --git a/Userland/Libraries/LibX86/Interpreter.h b/Userland/Libraries/LibX86/Interpreter.h
index aee9093500..d8fa0623a2 100644
--- a/Userland/Libraries/LibX86/Interpreter.h
+++ b/Userland/Libraries/LibX86/Interpreter.h
@@ -14,648 +14,648 @@ class Instruction;
class Interpreter {
public:
- virtual void AAA(const Instruction&) = 0;
- virtual void AAD(const Instruction&) = 0;
- virtual void AAM(const Instruction&) = 0;
- virtual void AAS(const Instruction&) = 0;
- virtual void ADC_AL_imm8(const Instruction&) = 0;
- virtual void ADC_AX_imm16(const Instruction&) = 0;
- virtual void ADC_EAX_imm32(const Instruction&) = 0;
- virtual void ADC_RM16_imm16(const Instruction&) = 0;
- virtual void ADC_RM16_imm8(const Instruction&) = 0;
- virtual void ADC_RM16_reg16(const Instruction&) = 0;
- virtual void ADC_RM32_imm32(const Instruction&) = 0;
- virtual void ADC_RM32_imm8(const Instruction&) = 0;
- virtual void ADC_RM32_reg32(const Instruction&) = 0;
- virtual void ADC_RM8_imm8(const Instruction&) = 0;
- virtual void ADC_RM8_reg8(const Instruction&) = 0;
- virtual void ADC_reg16_RM16(const Instruction&) = 0;
- virtual void ADC_reg32_RM32(const Instruction&) = 0;
- virtual void ADC_reg8_RM8(const Instruction&) = 0;
- virtual void ADD_AL_imm8(const Instruction&) = 0;
- virtual void ADD_AX_imm16(const Instruction&) = 0;
- virtual void ADD_EAX_imm32(const Instruction&) = 0;
- virtual void ADD_RM16_imm16(const Instruction&) = 0;
- virtual void ADD_RM16_imm8(const Instruction&) = 0;
- virtual void ADD_RM16_reg16(const Instruction&) = 0;
- virtual void ADD_RM32_imm32(const Instruction&) = 0;
- virtual void ADD_RM32_imm8(const Instruction&) = 0;
- virtual void ADD_RM32_reg32(const Instruction&) = 0;
- virtual void ADD_RM8_imm8(const Instruction&) = 0;
- virtual void ADD_RM8_reg8(const Instruction&) = 0;
- virtual void ADD_reg16_RM16(const Instruction&) = 0;
- virtual void ADD_reg32_RM32(const Instruction&) = 0;
- virtual void ADD_reg8_RM8(const Instruction&) = 0;
- virtual void AND_AL_imm8(const Instruction&) = 0;
- virtual void AND_AX_imm16(const Instruction&) = 0;
- virtual void AND_EAX_imm32(const Instruction&) = 0;
- virtual void AND_RM16_imm16(const Instruction&) = 0;
- virtual void AND_RM16_imm8(const Instruction&) = 0;
- virtual void AND_RM16_reg16(const Instruction&) = 0;
- virtual void AND_RM32_imm32(const Instruction&) = 0;
- virtual void AND_RM32_imm8(const Instruction&) = 0;
- virtual void AND_RM32_reg32(const Instruction&) = 0;
- virtual void AND_RM8_imm8(const Instruction&) = 0;
- virtual void AND_RM8_reg8(const Instruction&) = 0;
- virtual void AND_reg16_RM16(const Instruction&) = 0;
- virtual void AND_reg32_RM32(const Instruction&) = 0;
- virtual void AND_reg8_RM8(const Instruction&) = 0;
- virtual void ARPL(const Instruction&) = 0;
- virtual void BOUND(const Instruction&) = 0;
- virtual void BSF_reg16_RM16(const Instruction&) = 0;
- virtual void BSF_reg32_RM32(const Instruction&) = 0;
- virtual void BSR_reg16_RM16(const Instruction&) = 0;
- virtual void BSR_reg32_RM32(const Instruction&) = 0;
- virtual void BSWAP_reg32(const Instruction&) = 0;
- virtual void BTC_RM16_imm8(const Instruction&) = 0;
- virtual void BTC_RM16_reg16(const Instruction&) = 0;
- virtual void BTC_RM32_imm8(const Instruction&) = 0;
- virtual void BTC_RM32_reg32(const Instruction&) = 0;
- virtual void BTR_RM16_imm8(const Instruction&) = 0;
- virtual void BTR_RM16_reg16(const Instruction&) = 0;
- virtual void BTR_RM32_imm8(const Instruction&) = 0;
- virtual void BTR_RM32_reg32(const Instruction&) = 0;
- virtual void BTS_RM16_imm8(const Instruction&) = 0;
- virtual void BTS_RM16_reg16(const Instruction&) = 0;
- virtual void BTS_RM32_imm8(const Instruction&) = 0;
- virtual void BTS_RM32_reg32(const Instruction&) = 0;
- virtual void BT_RM16_imm8(const Instruction&) = 0;
- virtual void BT_RM16_reg16(const Instruction&) = 0;
- virtual void BT_RM32_imm8(const Instruction&) = 0;
- virtual void BT_RM32_reg32(const Instruction&) = 0;
- virtual void CALL_FAR_mem16(const Instruction&) = 0;
- virtual void CALL_FAR_mem32(const Instruction&) = 0;
- virtual void CALL_RM16(const Instruction&) = 0;
- virtual void CALL_RM32(const Instruction&) = 0;
- virtual void CALL_imm16(const Instruction&) = 0;
- virtual void CALL_imm16_imm16(const Instruction&) = 0;
- virtual void CALL_imm16_imm32(const Instruction&) = 0;
- virtual void CALL_imm32(const Instruction&) = 0;
- virtual void CBW(const Instruction&) = 0;
- virtual void CDQ(const Instruction&) = 0;
- virtual void CLC(const Instruction&) = 0;
- virtual void CLD(const Instruction&) = 0;
- virtual void CLI(const Instruction&) = 0;
- virtual void CLTS(const Instruction&) = 0;
- virtual void CMC(const Instruction&) = 0;
- virtual void CMOVcc_reg16_RM16(const Instruction&) = 0;
- virtual void CMOVcc_reg32_RM32(const Instruction&) = 0;
- virtual void CMPSB(const Instruction&) = 0;
- virtual void CMPSD(const Instruction&) = 0;
- virtual void CMPSW(const Instruction&) = 0;
- virtual void CMPXCHG_RM16_reg16(const Instruction&) = 0;
- virtual void CMPXCHG_RM32_reg32(const Instruction&) = 0;
- virtual void CMPXCHG_RM8_reg8(const Instruction&) = 0;
- virtual void CMP_AL_imm8(const Instruction&) = 0;
- virtual void CMP_AX_imm16(const Instruction&) = 0;
- virtual void CMP_EAX_imm32(const Instruction&) = 0;
- virtual void CMP_RM16_imm16(const Instruction&) = 0;
- virtual void CMP_RM16_imm8(const Instruction&) = 0;
- virtual void CMP_RM16_reg16(const Instruction&) = 0;
- virtual void CMP_RM32_imm32(const Instruction&) = 0;
- virtual void CMP_RM32_imm8(const Instruction&) = 0;
- virtual void CMP_RM32_reg32(const Instruction&) = 0;
- virtual void CMP_RM8_imm8(const Instruction&) = 0;
- virtual void CMP_RM8_reg8(const Instruction&) = 0;
- virtual void CMP_reg16_RM16(const Instruction&) = 0;
- virtual void CMP_reg32_RM32(const Instruction&) = 0;
- virtual void CMP_reg8_RM8(const Instruction&) = 0;
- virtual void CPUID(const Instruction&) = 0;
- virtual void CWD(const Instruction&) = 0;
- virtual void CWDE(const Instruction&) = 0;
- virtual void DAA(const Instruction&) = 0;
- virtual void DAS(const Instruction&) = 0;
- virtual void DEC_RM16(const Instruction&) = 0;
- virtual void DEC_RM32(const Instruction&) = 0;
- virtual void DEC_RM8(const Instruction&) = 0;
- virtual void DEC_reg16(const Instruction&) = 0;
- virtual void DEC_reg32(const Instruction&) = 0;
- virtual void DIV_RM16(const Instruction&) = 0;
- virtual void DIV_RM32(const Instruction&) = 0;
- virtual void DIV_RM8(const Instruction&) = 0;
- virtual void ENTER16(const Instruction&) = 0;
- virtual void ENTER32(const Instruction&) = 0;
- virtual void ESCAPE(const Instruction&) = 0;
- virtual void FADD_RM32(const Instruction&) = 0;
- virtual void FMUL_RM32(const Instruction&) = 0;
- virtual void FCOM_RM32(const Instruction&) = 0;
- virtual void FCOMP_RM32(const Instruction&) = 0;
- virtual void FSUB_RM32(const Instruction&) = 0;
- virtual void FSUBR_RM32(const Instruction&) = 0;
- virtual void FDIV_RM32(const Instruction&) = 0;
- virtual void FDIVR_RM32(const Instruction&) = 0;
- virtual void FLD_RM32(const Instruction&) = 0;
- virtual void FXCH(const Instruction&) = 0;
- virtual void FST_RM32(const Instruction&) = 0;
- virtual void FNOP(const Instruction&) = 0;
- virtual void FSTP_RM32(const Instruction&) = 0;
- virtual void FLDENV(const Instruction&) = 0;
- virtual void FCHS(const Instruction&) = 0;
- virtual void FABS(const Instruction&) = 0;
- virtual void FTST(const Instruction&) = 0;
- virtual void FXAM(const Instruction&) = 0;
- virtual void FLDCW(const Instruction&) = 0;
- virtual void FLD1(const Instruction&) = 0;
- virtual void FLDL2T(const Instruction&) = 0;
- virtual void FLDL2E(const Instruction&) = 0;
- virtual void FLDPI(const Instruction&) = 0;
- virtual void FLDLG2(const Instruction&) = 0;
- virtual void FLDLN2(const Instruction&) = 0;
- virtual void FLDZ(const Instruction&) = 0;
- virtual void FNSTENV(const Instruction&) = 0;
- virtual void F2XM1(const Instruction&) = 0;
- virtual void FYL2X(const Instruction&) = 0;
- virtual void FPTAN(const Instruction&) = 0;
- virtual void FPATAN(const Instruction&) = 0;
- virtual void FXTRACT(const Instruction&) = 0;
- virtual void FPREM1(const Instruction&) = 0;
- virtual void FDECSTP(const Instruction&) = 0;
- virtual void FINCSTP(const Instruction&) = 0;
- virtual void FNSTCW(const Instruction&) = 0;
- virtual void FPREM(const Instruction&) = 0;
- virtual void FYL2XP1(const Instruction&) = 0;
- virtual void FSQRT(const Instruction&) = 0;
- virtual void FSINCOS(const Instruction&) = 0;
- virtual void FRNDINT(const Instruction&) = 0;
- virtual void FSCALE(const Instruction&) = 0;
- virtual void FSIN(const Instruction&) = 0;
- virtual void FCOS(const Instruction&) = 0;
- virtual void FIADD_RM32(const Instruction&) = 0;
- virtual void FADDP(const Instruction&) = 0;
- virtual void FIMUL_RM32(const Instruction&) = 0;
- virtual void FCMOVE(const Instruction&) = 0;
- virtual void FICOM_RM32(const Instruction&) = 0;
- virtual void FCMOVBE(const Instruction&) = 0;
- virtual void FICOMP_RM32(const Instruction&) = 0;
- virtual void FCMOVU(const Instruction&) = 0;
- virtual void FISUB_RM32(const Instruction&) = 0;
- virtual void FISUBR_RM32(const Instruction&) = 0;
- virtual void FUCOMPP(const Instruction&) = 0;
- virtual void FIDIV_RM32(const Instruction&) = 0;
- virtual void FIDIVR_RM32(const Instruction&) = 0;
- virtual void FILD_RM32(const Instruction&) = 0;
- virtual void FCMOVNB(const Instruction&) = 0;
- virtual void FISTTP_RM32(const Instruction&) = 0;
- virtual void FCMOVNE(const Instruction&) = 0;
- virtual void FIST_RM32(const Instruction&) = 0;
- virtual void FCMOVNBE(const Instruction&) = 0;
- virtual void FISTP_RM32(const Instruction&) = 0;
- virtual void FCMOVNU(const Instruction&) = 0;
- virtual void FNENI(const Instruction&) = 0;
- virtual void FNDISI(const Instruction&) = 0;
- virtual void FNCLEX(const Instruction&) = 0;
- virtual void FNINIT(const Instruction&) = 0;
- virtual void FNSETPM(const Instruction&) = 0;
- virtual void FLD_RM80(const Instruction&) = 0;
- virtual void FUCOMI(const Instruction&) = 0;
- virtual void FCOMI(const Instruction&) = 0;
- virtual void FSTP_RM80(const Instruction&) = 0;
- virtual void FADD_RM64(const Instruction&) = 0;
- virtual void FMUL_RM64(const Instruction&) = 0;
- virtual void FCOM_RM64(const Instruction&) = 0;
- virtual void FCOMP_RM64(const Instruction&) = 0;
- virtual void FSUB_RM64(const Instruction&) = 0;
- virtual void FSUBR_RM64(const Instruction&) = 0;
- virtual void FDIV_RM64(const Instruction&) = 0;
- virtual void FDIVR_RM64(const Instruction&) = 0;
- virtual void FLD_RM64(const Instruction&) = 0;
- virtual void FFREE(const Instruction&) = 0;
- virtual void FISTTP_RM64(const Instruction&) = 0;
- virtual void FST_RM64(const Instruction&) = 0;
- virtual void FSTP_RM64(const Instruction&) = 0;
- virtual void FRSTOR(const Instruction&) = 0;
- virtual void FUCOM(const Instruction&) = 0;
- virtual void FUCOMP(const Instruction&) = 0;
- virtual void FNSAVE(const Instruction&) = 0;
- virtual void FNSTSW(const Instruction&) = 0;
- virtual void FIADD_RM16(const Instruction&) = 0;
- virtual void FCMOVB(const Instruction&) = 0;
- virtual void FIMUL_RM16(const Instruction&) = 0;
- virtual void FMULP(const Instruction&) = 0;
- virtual void FICOM_RM16(const Instruction&) = 0;
- virtual void FICOMP_RM16(const Instruction&) = 0;
- virtual void FCOMPP(const Instruction&) = 0;
- virtual void FISUB_RM16(const Instruction&) = 0;
- virtual void FSUBRP(const Instruction&) = 0;
- virtual void FISUBR_RM16(const Instruction&) = 0;
- virtual void FSUBP(const Instruction&) = 0;
- virtual void FIDIV_RM16(const Instruction&) = 0;
- virtual void FDIVRP(const Instruction&) = 0;
- virtual void FIDIVR_RM16(const Instruction&) = 0;
- virtual void FDIVP(const Instruction&) = 0;
- virtual void FILD_RM16(const Instruction&) = 0;
- virtual void FFREEP(const Instruction&) = 0;
- virtual void FISTTP_RM16(const Instruction&) = 0;
- virtual void FIST_RM16(const Instruction&) = 0;
- virtual void FISTP_RM16(const Instruction&) = 0;
- virtual void FBLD_M80(const Instruction&) = 0;
- virtual void FNSTSW_AX(const Instruction&) = 0;
- virtual void FILD_RM64(const Instruction&) = 0;
- virtual void FUCOMIP(const Instruction&) = 0;
- virtual void FBSTP_M80(const Instruction&) = 0;
- virtual void FCOMIP(const Instruction&) = 0;
- virtual void FISTP_RM64(const Instruction&) = 0;
- virtual void HLT(const Instruction&) = 0;
- virtual void IDIV_RM16(const Instruction&) = 0;
- virtual void IDIV_RM32(const Instruction&) = 0;
- virtual void IDIV_RM8(const Instruction&) = 0;
- virtual void IMUL_RM16(const Instruction&) = 0;
- virtual void IMUL_RM32(const Instruction&) = 0;
- virtual void IMUL_RM8(const Instruction&) = 0;
- virtual void IMUL_reg16_RM16(const Instruction&) = 0;
- virtual void IMUL_reg16_RM16_imm16(const Instruction&) = 0;
- virtual void IMUL_reg16_RM16_imm8(const Instruction&) = 0;
- virtual void IMUL_reg32_RM32(const Instruction&) = 0;
- virtual void IMUL_reg32_RM32_imm32(const Instruction&) = 0;
- virtual void IMUL_reg32_RM32_imm8(const Instruction&) = 0;
- virtual void INC_RM16(const Instruction&) = 0;
- virtual void INC_RM32(const Instruction&) = 0;
- virtual void INC_RM8(const Instruction&) = 0;
- virtual void INC_reg16(const Instruction&) = 0;
- virtual void INC_reg32(const Instruction&) = 0;
- virtual void INSB(const Instruction&) = 0;
- virtual void INSD(const Instruction&) = 0;
- virtual void INSW(const Instruction&) = 0;
- virtual void INT1(const Instruction&) = 0;
- virtual void INT3(const Instruction&) = 0;
- virtual void INTO(const Instruction&) = 0;
- virtual void INT_imm8(const Instruction&) = 0;
- virtual void INVLPG(const Instruction&) = 0;
- virtual void IN_AL_DX(const Instruction&) = 0;
- virtual void IN_AL_imm8(const Instruction&) = 0;
- virtual void IN_AX_DX(const Instruction&) = 0;
- virtual void IN_AX_imm8(const Instruction&) = 0;
- virtual void IN_EAX_DX(const Instruction&) = 0;
- virtual void IN_EAX_imm8(const Instruction&) = 0;
- virtual void IRET(const Instruction&) = 0;
- virtual void JCXZ_imm8(const Instruction&) = 0;
- virtual void JMP_FAR_mem16(const Instruction&) = 0;
- virtual void JMP_FAR_mem32(const Instruction&) = 0;
- virtual void JMP_RM16(const Instruction&) = 0;
- virtual void JMP_RM32(const Instruction&) = 0;
- virtual void JMP_imm16(const Instruction&) = 0;
- virtual void JMP_imm16_imm16(const Instruction&) = 0;
- virtual void JMP_imm16_imm32(const Instruction&) = 0;
- virtual void JMP_imm32(const Instruction&) = 0;
- virtual void JMP_short_imm8(const Instruction&) = 0;
- virtual void Jcc_NEAR_imm(const Instruction&) = 0;
- virtual void Jcc_imm8(const Instruction&) = 0;
- virtual void LAHF(const Instruction&) = 0;
- virtual void LAR_reg16_RM16(const Instruction&) = 0;
- virtual void LAR_reg32_RM32(const Instruction&) = 0;
- virtual void LDS_reg16_mem16(const Instruction&) = 0;
- virtual void LDS_reg32_mem32(const Instruction&) = 0;
- virtual void LEAVE16(const Instruction&) = 0;
- virtual void LEAVE32(const Instruction&) = 0;
- virtual void LEA_reg16_mem16(const Instruction&) = 0;
- virtual void LEA_reg32_mem32(const Instruction&) = 0;
- virtual void LES_reg16_mem16(const Instruction&) = 0;
- virtual void LES_reg32_mem32(const Instruction&) = 0;
- virtual void LFS_reg16_mem16(const Instruction&) = 0;
- virtual void LFS_reg32_mem32(const Instruction&) = 0;
- virtual void LGDT(const Instruction&) = 0;
- virtual void LGS_reg16_mem16(const Instruction&) = 0;
- virtual void LGS_reg32_mem32(const Instruction&) = 0;
- virtual void LIDT(const Instruction&) = 0;
- virtual void LLDT_RM16(const Instruction&) = 0;
- virtual void LMSW_RM16(const Instruction&) = 0;
- virtual void LODSB(const Instruction&) = 0;
- virtual void LODSD(const Instruction&) = 0;
- virtual void LODSW(const Instruction&) = 0;
- virtual void LOOPNZ_imm8(const Instruction&) = 0;
- virtual void LOOPZ_imm8(const Instruction&) = 0;
- virtual void LOOP_imm8(const Instruction&) = 0;
- virtual void LSL_reg16_RM16(const Instruction&) = 0;
- virtual void LSL_reg32_RM32(const Instruction&) = 0;
- virtual void LSS_reg16_mem16(const Instruction&) = 0;
- virtual void LSS_reg32_mem32(const Instruction&) = 0;
- virtual void LTR_RM16(const Instruction&) = 0;
- virtual void MOVSB(const Instruction&) = 0;
- virtual void MOVSD(const Instruction&) = 0;
- virtual void MOVSW(const Instruction&) = 0;
- virtual void MOVSX_reg16_RM8(const Instruction&) = 0;
- virtual void MOVSX_reg32_RM16(const Instruction&) = 0;
- virtual void MOVSX_reg32_RM8(const Instruction&) = 0;
- virtual void MOVZX_reg16_RM8(const Instruction&) = 0;
- virtual void MOVZX_reg32_RM16(const Instruction&) = 0;
- virtual void MOVZX_reg32_RM8(const Instruction&) = 0;
- virtual void MOV_AL_moff8(const Instruction&) = 0;
- virtual void MOV_AX_moff16(const Instruction&) = 0;
- virtual void MOV_CR_reg32(const Instruction&) = 0;
- virtual void MOV_DR_reg32(const Instruction&) = 0;
- virtual void MOV_EAX_moff32(const Instruction&) = 0;
- virtual void MOV_RM16_imm16(const Instruction&) = 0;
- virtual void MOV_RM16_reg16(const Instruction&) = 0;
- virtual void MOV_RM16_seg(const Instruction&) = 0;
- virtual void MOV_RM32_imm32(const Instruction&) = 0;
- virtual void MOV_RM32_reg32(const Instruction&) = 0;
- virtual void MOV_RM8_imm8(const Instruction&) = 0;
- virtual void MOV_RM8_reg8(const Instruction&) = 0;
- virtual void MOV_moff16_AX(const Instruction&) = 0;
- virtual void MOV_moff32_EAX(const Instruction&) = 0;
- virtual void MOV_moff8_AL(const Instruction&) = 0;
- virtual void MOV_reg16_RM16(const Instruction&) = 0;
- virtual void MOV_reg16_imm16(const Instruction&) = 0;
- virtual void MOV_reg32_CR(const Instruction&) = 0;
- virtual void MOV_reg32_DR(const Instruction&) = 0;
- virtual void MOV_reg32_RM32(const Instruction&) = 0;
- virtual void MOV_reg32_imm32(const Instruction&) = 0;
- virtual void MOV_reg8_RM8(const Instruction&) = 0;
- virtual void MOV_reg8_imm8(const Instruction&) = 0;
- virtual void MOV_seg_RM16(const Instruction&) = 0;
- virtual void MOV_seg_RM32(const Instruction&) = 0;
- virtual void MUL_RM16(const Instruction&) = 0;
- virtual void MUL_RM32(const Instruction&) = 0;
- virtual void MUL_RM8(const Instruction&) = 0;
- virtual void NEG_RM16(const Instruction&) = 0;
- virtual void NEG_RM32(const Instruction&) = 0;
- virtual void NEG_RM8(const Instruction&) = 0;
- virtual void NOP(const Instruction&) = 0;
- virtual void NOT_RM16(const Instruction&) = 0;
- virtual void NOT_RM32(const Instruction&) = 0;
- virtual void NOT_RM8(const Instruction&) = 0;
- virtual void OR_AL_imm8(const Instruction&) = 0;
- virtual void OR_AX_imm16(const Instruction&) = 0;
- virtual void OR_EAX_imm32(const Instruction&) = 0;
- virtual void OR_RM16_imm16(const Instruction&) = 0;
- virtual void OR_RM16_imm8(const Instruction&) = 0;
- virtual void OR_RM16_reg16(const Instruction&) = 0;
- virtual void OR_RM32_imm32(const Instruction&) = 0;
- virtual void OR_RM32_imm8(const Instruction&) = 0;
- virtual void OR_RM32_reg32(const Instruction&) = 0;
- virtual void OR_RM8_imm8(const Instruction&) = 0;
- virtual void OR_RM8_reg8(const Instruction&) = 0;
- virtual void OR_reg16_RM16(const Instruction&) = 0;
- virtual void OR_reg32_RM32(const Instruction&) = 0;
- virtual void OR_reg8_RM8(const Instruction&) = 0;
- virtual void OUTSB(const Instruction&) = 0;
- virtual void OUTSD(const Instruction&) = 0;
- virtual void OUTSW(const Instruction&) = 0;
- virtual void OUT_DX_AL(const Instruction&) = 0;
- virtual void OUT_DX_AX(const Instruction&) = 0;
- virtual void OUT_DX_EAX(const Instruction&) = 0;
- virtual void OUT_imm8_AL(const Instruction&) = 0;
- virtual void OUT_imm8_AX(const Instruction&) = 0;
- virtual void OUT_imm8_EAX(const Instruction&) = 0;
- virtual void PACKSSDW_mm1_mm2m64(const Instruction&) = 0;
- virtual void PACKSSWB_mm1_mm2m64(const Instruction&) = 0;
- virtual void PACKUSWB_mm1_mm2m64(const Instruction&) = 0;
- virtual void PADDB_mm1_mm2m64(const Instruction&) = 0;
- virtual void PADDW_mm1_mm2m64(const Instruction&) = 0;
- virtual void PADDD_mm1_mm2m64(const Instruction&) = 0;
- virtual void PADDSB_mm1_mm2m64(const Instruction&) = 0;
- virtual void PADDSW_mm1_mm2m64(const Instruction&) = 0;
- virtual void PADDUSB_mm1_mm2m64(const Instruction&) = 0;
- virtual void PADDUSW_mm1_mm2m64(const Instruction&) = 0;
- virtual void PAND_mm1_mm2m64(const Instruction&) = 0;
- virtual void PANDN_mm1_mm2m64(const Instruction&) = 0;
- virtual void PCMPEQB_mm1_mm2m64(const Instruction&) = 0;
- virtual void PCMPEQW_mm1_mm2m64(const Instruction&) = 0;
- virtual void PCMPEQD_mm1_mm2m64(const Instruction&) = 0;
- virtual void PCMPGTB_mm1_mm2m64(const Instruction&) = 0;
- virtual void PCMPGTW_mm1_mm2m64(const Instruction&) = 0;
- virtual void PCMPGTD_mm1_mm2m64(const Instruction&) = 0;
- virtual void PMADDWD_mm1_mm2m64(const Instruction&) = 0;
- virtual void PMULHW_mm1_mm2m64(const Instruction&) = 0;
- virtual void PMULLW_mm1_mm2m64(const Instruction&) = 0;
- virtual void POPA(const Instruction&) = 0;
- virtual void POPAD(const Instruction&) = 0;
- virtual void POPF(const Instruction&) = 0;
- virtual void POPFD(const Instruction&) = 0;
- virtual void POP_DS(const Instruction&) = 0;
- virtual void POP_ES(const Instruction&) = 0;
- virtual void POP_FS(const Instruction&) = 0;
- virtual void POP_GS(const Instruction&) = 0;
- virtual void POP_RM16(const Instruction&) = 0;
- virtual void POP_RM32(const Instruction&) = 0;
- virtual void POP_SS(const Instruction&) = 0;
- virtual void POP_reg16(const Instruction&) = 0;
- virtual void POP_reg32(const Instruction&) = 0;
- virtual void POR_mm1_mm2m64(const Instruction&) = 0;
- virtual void PSLLW_mm1_mm2m64(const Instruction&) = 0;
- virtual void PSLLW_mm1_imm8(const Instruction&) = 0;
- virtual void PSLLD_mm1_mm2m64(const Instruction&) = 0;
- virtual void PSLLD_mm1_imm8(const Instruction&) = 0;
- virtual void PSLLQ_mm1_mm2m64(const Instruction&) = 0;
- virtual void PSLLQ_mm1_imm8(const Instruction&) = 0;
- virtual void PSRAW_mm1_mm2m64(const Instruction&) = 0;
- virtual void PSRAW_mm1_imm8(const Instruction&) = 0;
- virtual void PSRAD_mm1_mm2m64(const Instruction&) = 0;
- virtual void PSRAD_mm1_imm8(const Instruction&) = 0;
- virtual void PSRLW_mm1_mm2m64(const Instruction&) = 0;
- virtual void PSRLW_mm1_imm8(const Instruction&) = 0;
- virtual void PSRLD_mm1_mm2m64(const Instruction&) = 0;
- virtual void PSRLD_mm1_imm8(const Instruction&) = 0;
- virtual void PSRLQ_mm1_mm2m64(const Instruction&) = 0;
- virtual void PSRLQ_mm1_imm8(const Instruction&) = 0;
- virtual void PSUBB_mm1_mm2m64(const Instruction&) = 0;
- virtual void PSUBW_mm1_mm2m64(const Instruction&) = 0;
- virtual void PSUBD_mm1_mm2m64(const Instruction&) = 0;
- virtual void PSUBSB_mm1_mm2m64(const Instruction&) = 0;
- virtual void PSUBSW_mm1_mm2m64(const Instruction&) = 0;
- virtual void PSUBUSB_mm1_mm2m64(const Instruction&) = 0;
- virtual void PSUBUSW_mm1_mm2m64(const Instruction&) = 0;
- virtual void PUNPCKHBW_mm1_mm2m64(const Instruction&) = 0;
- virtual void PUNPCKHWD_mm1_mm2m64(const Instruction&) = 0;
- virtual void PUNPCKHDQ_mm1_mm2m64(const Instruction&) = 0;
- virtual void PUNPCKLBW_mm1_mm2m32(const Instruction&) = 0;
- virtual void PUNPCKLWD_mm1_mm2m32(const Instruction&) = 0;
- virtual void PUNPCKLDQ_mm1_mm2m32(const Instruction&) = 0;
- virtual void PUSHA(const Instruction&) = 0;
- virtual void PUSHAD(const Instruction&) = 0;
- virtual void PUSHF(const Instruction&) = 0;
- virtual void PUSHFD(const Instruction&) = 0;
- virtual void PUSH_CS(const Instruction&) = 0;
- virtual void PUSH_DS(const Instruction&) = 0;
- virtual void PUSH_ES(const Instruction&) = 0;
- virtual void PUSH_FS(const Instruction&) = 0;
- virtual void PUSH_GS(const Instruction&) = 0;
- virtual void PUSH_RM16(const Instruction&) = 0;
- virtual void PUSH_RM32(const Instruction&) = 0;
- virtual void PUSH_SP_8086_80186(const Instruction&) = 0;
- virtual void PUSH_SS(const Instruction&) = 0;
- virtual void PUSH_imm16(const Instruction&) = 0;
- virtual void PUSH_imm32(const Instruction&) = 0;
- virtual void PUSH_imm8(const Instruction&) = 0;
- virtual void PUSH_reg16(const Instruction&) = 0;
- virtual void PUSH_reg32(const Instruction&) = 0;
- virtual void PXOR_mm1_mm2m64(const Instruction&) = 0;
- virtual void RCL_RM16_1(const Instruction&) = 0;
- virtual void RCL_RM16_CL(const Instruction&) = 0;
- virtual void RCL_RM16_imm8(const Instruction&) = 0;
- virtual void RCL_RM32_1(const Instruction&) = 0;
- virtual void RCL_RM32_CL(const Instruction&) = 0;
- virtual void RCL_RM32_imm8(const Instruction&) = 0;
- virtual void RCL_RM8_1(const Instruction&) = 0;
- virtual void RCL_RM8_CL(const Instruction&) = 0;
- virtual void RCL_RM8_imm8(const Instruction&) = 0;
- virtual void RCR_RM16_1(const Instruction&) = 0;
- virtual void RCR_RM16_CL(const Instruction&) = 0;
- virtual void RCR_RM16_imm8(const Instruction&) = 0;
- virtual void RCR_RM32_1(const Instruction&) = 0;
- virtual void RCR_RM32_CL(const Instruction&) = 0;
- virtual void RCR_RM32_imm8(const Instruction&) = 0;
- virtual void RCR_RM8_1(const Instruction&) = 0;
- virtual void RCR_RM8_CL(const Instruction&) = 0;
- virtual void RCR_RM8_imm8(const Instruction&) = 0;
- virtual void RDTSC(const Instruction&) = 0;
- virtual void RET(const Instruction&) = 0;
- virtual void RETF(const Instruction&) = 0;
- virtual void RETF_imm16(const Instruction&) = 0;
- virtual void RET_imm16(const Instruction&) = 0;
- virtual void ROL_RM16_1(const Instruction&) = 0;
- virtual void ROL_RM16_CL(const Instruction&) = 0;
- virtual void ROL_RM16_imm8(const Instruction&) = 0;
- virtual void ROL_RM32_1(const Instruction&) = 0;
- virtual void ROL_RM32_CL(const Instruction&) = 0;
- virtual void ROL_RM32_imm8(const Instruction&) = 0;
- virtual void ROL_RM8_1(const Instruction&) = 0;
- virtual void ROL_RM8_CL(const Instruction&) = 0;
- virtual void ROL_RM8_imm8(const Instruction&) = 0;
- virtual void ROR_RM16_1(const Instruction&) = 0;
- virtual void ROR_RM16_CL(const Instruction&) = 0;
- virtual void ROR_RM16_imm8(const Instruction&) = 0;
- virtual void ROR_RM32_1(const Instruction&) = 0;
- virtual void ROR_RM32_CL(const Instruction&) = 0;
- virtual void ROR_RM32_imm8(const Instruction&) = 0;
- virtual void ROR_RM8_1(const Instruction&) = 0;
- virtual void ROR_RM8_CL(const Instruction&) = 0;
- virtual void ROR_RM8_imm8(const Instruction&) = 0;
- virtual void SAHF(const Instruction&) = 0;
- virtual void SALC(const Instruction&) = 0;
- virtual void SAR_RM16_1(const Instruction&) = 0;
- virtual void SAR_RM16_CL(const Instruction&) = 0;
- virtual void SAR_RM16_imm8(const Instruction&) = 0;
- virtual void SAR_RM32_1(const Instruction&) = 0;
- virtual void SAR_RM32_CL(const Instruction&) = 0;
- virtual void SAR_RM32_imm8(const Instruction&) = 0;
- virtual void SAR_RM8_1(const Instruction&) = 0;
- virtual void SAR_RM8_CL(const Instruction&) = 0;
- virtual void SAR_RM8_imm8(const Instruction&) = 0;
- virtual void SBB_AL_imm8(const Instruction&) = 0;
- virtual void SBB_AX_imm16(const Instruction&) = 0;
- virtual void SBB_EAX_imm32(const Instruction&) = 0;
- virtual void SBB_RM16_imm16(const Instruction&) = 0;
- virtual void SBB_RM16_imm8(const Instruction&) = 0;
- virtual void SBB_RM16_reg16(const Instruction&) = 0;
- virtual void SBB_RM32_imm32(const Instruction&) = 0;
- virtual void SBB_RM32_imm8(const Instruction&) = 0;
- virtual void SBB_RM32_reg32(const Instruction&) = 0;
- virtual void SBB_RM8_imm8(const Instruction&) = 0;
- virtual void SBB_RM8_reg8(const Instruction&) = 0;
- virtual void SBB_reg16_RM16(const Instruction&) = 0;
- virtual void SBB_reg32_RM32(const Instruction&) = 0;
- virtual void SBB_reg8_RM8(const Instruction&) = 0;
- virtual void SCASB(const Instruction&) = 0;
- virtual void SCASD(const Instruction&) = 0;
- virtual void SCASW(const Instruction&) = 0;
- virtual void SETcc_RM8(const Instruction&) = 0;
- virtual void SGDT(const Instruction&) = 0;
- virtual void SHLD_RM16_reg16_CL(const Instruction&) = 0;
- virtual void SHLD_RM16_reg16_imm8(const Instruction&) = 0;
- virtual void SHLD_RM32_reg32_CL(const Instruction&) = 0;
- virtual void SHLD_RM32_reg32_imm8(const Instruction&) = 0;
- virtual void SHL_RM16_1(const Instruction&) = 0;
- virtual void SHL_RM16_CL(const Instruction&) = 0;
- virtual void SHL_RM16_imm8(const Instruction&) = 0;
- virtual void SHL_RM32_1(const Instruction&) = 0;
- virtual void SHL_RM32_CL(const Instruction&) = 0;
- virtual void SHL_RM32_imm8(const Instruction&) = 0;
- virtual void SHL_RM8_1(const Instruction&) = 0;
- virtual void SHL_RM8_CL(const Instruction&) = 0;
- virtual void SHL_RM8_imm8(const Instruction&) = 0;
- virtual void SHRD_RM16_reg16_CL(const Instruction&) = 0;
- virtual void SHRD_RM16_reg16_imm8(const Instruction&) = 0;
- virtual void SHRD_RM32_reg32_CL(const Instruction&) = 0;
- virtual void SHRD_RM32_reg32_imm8(const Instruction&) = 0;
- virtual void SHR_RM16_1(const Instruction&) = 0;
- virtual void SHR_RM16_CL(const Instruction&) = 0;
- virtual void SHR_RM16_imm8(const Instruction&) = 0;
- virtual void SHR_RM32_1(const Instruction&) = 0;
- virtual void SHR_RM32_CL(const Instruction&) = 0;
- virtual void SHR_RM32_imm8(const Instruction&) = 0;
- virtual void SHR_RM8_1(const Instruction&) = 0;
- virtual void SHR_RM8_CL(const Instruction&) = 0;
- virtual void SHR_RM8_imm8(const Instruction&) = 0;
- virtual void SIDT(const Instruction&) = 0;
- virtual void SLDT_RM16(const Instruction&) = 0;
- virtual void SMSW_RM16(const Instruction&) = 0;
- virtual void STC(const Instruction&) = 0;
- virtual void STD(const Instruction&) = 0;
- virtual void STI(const Instruction&) = 0;
- virtual void STOSB(const Instruction&) = 0;
- virtual void STOSD(const Instruction&) = 0;
- virtual void STOSW(const Instruction&) = 0;
- virtual void STR_RM16(const Instruction&) = 0;
- virtual void SUB_AL_imm8(const Instruction&) = 0;
- virtual void SUB_AX_imm16(const Instruction&) = 0;
- virtual void SUB_EAX_imm32(const Instruction&) = 0;
- virtual void SUB_RM16_imm16(const Instruction&) = 0;
- virtual void SUB_RM16_imm8(const Instruction&) = 0;
- virtual void SUB_RM16_reg16(const Instruction&) = 0;
- virtual void SUB_RM32_imm32(const Instruction&) = 0;
- virtual void SUB_RM32_imm8(const Instruction&) = 0;
- virtual void SUB_RM32_reg32(const Instruction&) = 0;
- virtual void SUB_RM8_imm8(const Instruction&) = 0;
- virtual void SUB_RM8_reg8(const Instruction&) = 0;
- virtual void SUB_reg16_RM16(const Instruction&) = 0;
- virtual void SUB_reg32_RM32(const Instruction&) = 0;
- virtual void SUB_reg8_RM8(const Instruction&) = 0;
- virtual void TEST_AL_imm8(const Instruction&) = 0;
- virtual void TEST_AX_imm16(const Instruction&) = 0;
- virtual void TEST_EAX_imm32(const Instruction&) = 0;
- virtual void TEST_RM16_imm16(const Instruction&) = 0;
- virtual void TEST_RM16_reg16(const Instruction&) = 0;
- virtual void TEST_RM32_imm32(const Instruction&) = 0;
- virtual void TEST_RM32_reg32(const Instruction&) = 0;
- virtual void TEST_RM8_imm8(const Instruction&) = 0;
- virtual void TEST_RM8_reg8(const Instruction&) = 0;
- virtual void UD0(const Instruction&) = 0;
- virtual void UD1(const Instruction&) = 0;
- virtual void UD2(const Instruction&) = 0;
- virtual void VERR_RM16(const Instruction&) = 0;
- virtual void VERW_RM16(const Instruction&) = 0;
- virtual void WAIT(const Instruction&) = 0;
- virtual void WBINVD(const Instruction&) = 0;
- virtual void XADD_RM16_reg16(const Instruction&) = 0;
- virtual void XADD_RM32_reg32(const Instruction&) = 0;
- virtual void XADD_RM8_reg8(const Instruction&) = 0;
- virtual void XCHG_AX_reg16(const Instruction&) = 0;
- virtual void XCHG_EAX_reg32(const Instruction&) = 0;
- virtual void XCHG_reg16_RM16(const Instruction&) = 0;
- virtual void XCHG_reg32_RM32(const Instruction&) = 0;
- virtual void XCHG_reg8_RM8(const Instruction&) = 0;
- virtual void XLAT(const Instruction&) = 0;
- virtual void XOR_AL_imm8(const Instruction&) = 0;
- virtual void XOR_AX_imm16(const Instruction&) = 0;
- virtual void XOR_EAX_imm32(const Instruction&) = 0;
- virtual void XOR_RM16_imm16(const Instruction&) = 0;
- virtual void XOR_RM16_imm8(const Instruction&) = 0;
- virtual void XOR_RM16_reg16(const Instruction&) = 0;
- virtual void XOR_RM32_imm32(const Instruction&) = 0;
- virtual void XOR_RM32_imm8(const Instruction&) = 0;
- virtual void XOR_RM32_reg32(const Instruction&) = 0;
- virtual void XOR_RM8_imm8(const Instruction&) = 0;
- virtual void XOR_RM8_reg8(const Instruction&) = 0;
- virtual void XOR_reg16_RM16(const Instruction&) = 0;
- virtual void XOR_reg32_RM32(const Instruction&) = 0;
- virtual void XOR_reg8_RM8(const Instruction&) = 0;
- virtual void MOVQ_mm1_mm2m64(const Instruction&) = 0;
- virtual void MOVQ_mm1m64_mm2(const Instruction&) = 0;
- virtual void MOVD_mm1_rm32(const Instruction&) = 0;
- virtual void MOVQ_mm1_rm64(const Instruction&) = 0; // long mode
- virtual void MOVD_rm32_mm2(const Instruction&) = 0;
- virtual void MOVQ_rm64_mm2(const Instruction&) = 0; // long mode
- virtual void EMMS(const Instruction&) = 0;
- virtual void wrap_0xC0(const Instruction&) = 0;
- virtual void wrap_0xC1_16(const Instruction&) = 0;
- virtual void wrap_0xC1_32(const Instruction&) = 0;
- virtual void wrap_0xD0(const Instruction&) = 0;
- virtual void wrap_0xD1_16(const Instruction&) = 0;
- virtual void wrap_0xD1_32(const Instruction&) = 0;
- virtual void wrap_0xD2(const Instruction&) = 0;
- virtual void wrap_0xD3_16(const Instruction&) = 0;
- virtual void wrap_0xD3_32(const Instruction&) = 0;
+ virtual void AAA(Instruction const&) = 0;
+ virtual void AAD(Instruction const&) = 0;
+ virtual void AAM(Instruction const&) = 0;
+ virtual void AAS(Instruction const&) = 0;
+ virtual void ADC_AL_imm8(Instruction const&) = 0;
+ virtual void ADC_AX_imm16(Instruction const&) = 0;
+ virtual void ADC_EAX_imm32(Instruction const&) = 0;
+ virtual void ADC_RM16_imm16(Instruction const&) = 0;
+ virtual void ADC_RM16_imm8(Instruction const&) = 0;
+ virtual void ADC_RM16_reg16(Instruction const&) = 0;
+ virtual void ADC_RM32_imm32(Instruction const&) = 0;
+ virtual void ADC_RM32_imm8(Instruction const&) = 0;
+ virtual void ADC_RM32_reg32(Instruction const&) = 0;
+ virtual void ADC_RM8_imm8(Instruction const&) = 0;
+ virtual void ADC_RM8_reg8(Instruction const&) = 0;
+ virtual void ADC_reg16_RM16(Instruction const&) = 0;
+ virtual void ADC_reg32_RM32(Instruction const&) = 0;
+ virtual void ADC_reg8_RM8(Instruction const&) = 0;
+ virtual void ADD_AL_imm8(Instruction const&) = 0;
+ virtual void ADD_AX_imm16(Instruction const&) = 0;
+ virtual void ADD_EAX_imm32(Instruction const&) = 0;
+ virtual void ADD_RM16_imm16(Instruction const&) = 0;
+ virtual void ADD_RM16_imm8(Instruction const&) = 0;
+ virtual void ADD_RM16_reg16(Instruction const&) = 0;
+ virtual void ADD_RM32_imm32(Instruction const&) = 0;
+ virtual void ADD_RM32_imm8(Instruction const&) = 0;
+ virtual void ADD_RM32_reg32(Instruction const&) = 0;
+ virtual void ADD_RM8_imm8(Instruction const&) = 0;
+ virtual void ADD_RM8_reg8(Instruction const&) = 0;
+ virtual void ADD_reg16_RM16(Instruction const&) = 0;
+ virtual void ADD_reg32_RM32(Instruction const&) = 0;
+ virtual void ADD_reg8_RM8(Instruction const&) = 0;
+ virtual void AND_AL_imm8(Instruction const&) = 0;
+ virtual void AND_AX_imm16(Instruction const&) = 0;
+ virtual void AND_EAX_imm32(Instruction const&) = 0;
+ virtual void AND_RM16_imm16(Instruction const&) = 0;
+ virtual void AND_RM16_imm8(Instruction const&) = 0;
+ virtual void AND_RM16_reg16(Instruction const&) = 0;
+ virtual void AND_RM32_imm32(Instruction const&) = 0;
+ virtual void AND_RM32_imm8(Instruction const&) = 0;
+ virtual void AND_RM32_reg32(Instruction const&) = 0;
+ virtual void AND_RM8_imm8(Instruction const&) = 0;
+ virtual void AND_RM8_reg8(Instruction const&) = 0;
+ virtual void AND_reg16_RM16(Instruction const&) = 0;
+ virtual void AND_reg32_RM32(Instruction const&) = 0;
+ virtual void AND_reg8_RM8(Instruction const&) = 0;
+ virtual void ARPL(Instruction const&) = 0;
+ virtual void BOUND(Instruction const&) = 0;
+ virtual void BSF_reg16_RM16(Instruction const&) = 0;
+ virtual void BSF_reg32_RM32(Instruction const&) = 0;
+ virtual void BSR_reg16_RM16(Instruction const&) = 0;
+ virtual void BSR_reg32_RM32(Instruction const&) = 0;
+ virtual void BSWAP_reg32(Instruction const&) = 0;
+ virtual void BTC_RM16_imm8(Instruction const&) = 0;
+ virtual void BTC_RM16_reg16(Instruction const&) = 0;
+ virtual void BTC_RM32_imm8(Instruction const&) = 0;
+ virtual void BTC_RM32_reg32(Instruction const&) = 0;
+ virtual void BTR_RM16_imm8(Instruction const&) = 0;
+ virtual void BTR_RM16_reg16(Instruction const&) = 0;
+ virtual void BTR_RM32_imm8(Instruction const&) = 0;
+ virtual void BTR_RM32_reg32(Instruction const&) = 0;
+ virtual void BTS_RM16_imm8(Instruction const&) = 0;
+ virtual void BTS_RM16_reg16(Instruction const&) = 0;
+ virtual void BTS_RM32_imm8(Instruction const&) = 0;
+ virtual void BTS_RM32_reg32(Instruction const&) = 0;
+ virtual void BT_RM16_imm8(Instruction const&) = 0;
+ virtual void BT_RM16_reg16(Instruction const&) = 0;
+ virtual void BT_RM32_imm8(Instruction const&) = 0;
+ virtual void BT_RM32_reg32(Instruction const&) = 0;
+ virtual void CALL_FAR_mem16(Instruction const&) = 0;
+ virtual void CALL_FAR_mem32(Instruction const&) = 0;
+ virtual void CALL_RM16(Instruction const&) = 0;
+ virtual void CALL_RM32(Instruction const&) = 0;
+ virtual void CALL_imm16(Instruction const&) = 0;
+ virtual void CALL_imm16_imm16(Instruction const&) = 0;
+ virtual void CALL_imm16_imm32(Instruction const&) = 0;
+ virtual void CALL_imm32(Instruction const&) = 0;
+ virtual void CBW(Instruction const&) = 0;
+ virtual void CDQ(Instruction const&) = 0;
+ virtual void CLC(Instruction const&) = 0;
+ virtual void CLD(Instruction const&) = 0;
+ virtual void CLI(Instruction const&) = 0;
+ virtual void CLTS(Instruction const&) = 0;
+ virtual void CMC(Instruction const&) = 0;
+ virtual void CMOVcc_reg16_RM16(Instruction const&) = 0;
+ virtual void CMOVcc_reg32_RM32(Instruction const&) = 0;
+ virtual void CMPSB(Instruction const&) = 0;
+ virtual void CMPSD(Instruction const&) = 0;
+ virtual void CMPSW(Instruction const&) = 0;
+ virtual void CMPXCHG_RM16_reg16(Instruction const&) = 0;
+ virtual void CMPXCHG_RM32_reg32(Instruction const&) = 0;
+ virtual void CMPXCHG_RM8_reg8(Instruction const&) = 0;
+ virtual void CMP_AL_imm8(Instruction const&) = 0;
+ virtual void CMP_AX_imm16(Instruction const&) = 0;
+ virtual void CMP_EAX_imm32(Instruction const&) = 0;
+ virtual void CMP_RM16_imm16(Instruction const&) = 0;
+ virtual void CMP_RM16_imm8(Instruction const&) = 0;
+ virtual void CMP_RM16_reg16(Instruction const&) = 0;
+ virtual void CMP_RM32_imm32(Instruction const&) = 0;
+ virtual void CMP_RM32_imm8(Instruction const&) = 0;
+ virtual void CMP_RM32_reg32(Instruction const&) = 0;
+ virtual void CMP_RM8_imm8(Instruction const&) = 0;
+ virtual void CMP_RM8_reg8(Instruction const&) = 0;
+ virtual void CMP_reg16_RM16(Instruction const&) = 0;
+ virtual void CMP_reg32_RM32(Instruction const&) = 0;
+ virtual void CMP_reg8_RM8(Instruction const&) = 0;
+ virtual void CPUID(Instruction const&) = 0;
+ virtual void CWD(Instruction const&) = 0;
+ virtual void CWDE(Instruction const&) = 0;
+ virtual void DAA(Instruction const&) = 0;
+ virtual void DAS(Instruction const&) = 0;
+ virtual void DEC_RM16(Instruction const&) = 0;
+ virtual void DEC_RM32(Instruction const&) = 0;
+ virtual void DEC_RM8(Instruction const&) = 0;
+ virtual void DEC_reg16(Instruction const&) = 0;
+ virtual void DEC_reg32(Instruction const&) = 0;
+ virtual void DIV_RM16(Instruction const&) = 0;
+ virtual void DIV_RM32(Instruction const&) = 0;
+ virtual void DIV_RM8(Instruction const&) = 0;
+ virtual void ENTER16(Instruction const&) = 0;
+ virtual void ENTER32(Instruction const&) = 0;
+ virtual void ESCAPE(Instruction const&) = 0;
+ virtual void FADD_RM32(Instruction const&) = 0;
+ virtual void FMUL_RM32(Instruction const&) = 0;
+ virtual void FCOM_RM32(Instruction const&) = 0;
+ virtual void FCOMP_RM32(Instruction const&) = 0;
+ virtual void FSUB_RM32(Instruction const&) = 0;
+ virtual void FSUBR_RM32(Instruction const&) = 0;
+ virtual void FDIV_RM32(Instruction const&) = 0;
+ virtual void FDIVR_RM32(Instruction const&) = 0;
+ virtual void FLD_RM32(Instruction const&) = 0;
+ virtual void FXCH(Instruction const&) = 0;
+ virtual void FST_RM32(Instruction const&) = 0;
+ virtual void FNOP(Instruction const&) = 0;
+ virtual void FSTP_RM32(Instruction const&) = 0;
+ virtual void FLDENV(Instruction const&) = 0;
+ virtual void FCHS(Instruction const&) = 0;
+ virtual void FABS(Instruction const&) = 0;
+ virtual void FTST(Instruction const&) = 0;
+ virtual void FXAM(Instruction const&) = 0;
+ virtual void FLDCW(Instruction const&) = 0;
+ virtual void FLD1(Instruction const&) = 0;
+ virtual void FLDL2T(Instruction const&) = 0;
+ virtual void FLDL2E(Instruction const&) = 0;
+ virtual void FLDPI(Instruction const&) = 0;
+ virtual void FLDLG2(Instruction const&) = 0;
+ virtual void FLDLN2(Instruction const&) = 0;
+ virtual void FLDZ(Instruction const&) = 0;
+ virtual void FNSTENV(Instruction const&) = 0;
+ virtual void F2XM1(Instruction const&) = 0;
+ virtual void FYL2X(Instruction const&) = 0;
+ virtual void FPTAN(Instruction const&) = 0;
+ virtual void FPATAN(Instruction const&) = 0;
+ virtual void FXTRACT(Instruction const&) = 0;
+ virtual void FPREM1(Instruction const&) = 0;
+ virtual void FDECSTP(Instruction const&) = 0;
+ virtual void FINCSTP(Instruction const&) = 0;
+ virtual void FNSTCW(Instruction const&) = 0;
+ virtual void FPREM(Instruction const&) = 0;
+ virtual void FYL2XP1(Instruction const&) = 0;
+ virtual void FSQRT(Instruction const&) = 0;
+ virtual void FSINCOS(Instruction const&) = 0;
+ virtual void FRNDINT(Instruction const&) = 0;
+ virtual void FSCALE(Instruction const&) = 0;
+ virtual void FSIN(Instruction const&) = 0;
+ virtual void FCOS(Instruction const&) = 0;
+ virtual void FIADD_RM32(Instruction const&) = 0;
+ virtual void FADDP(Instruction const&) = 0;
+ virtual void FIMUL_RM32(Instruction const&) = 0;
+ virtual void FCMOVE(Instruction const&) = 0;
+ virtual void FICOM_RM32(Instruction const&) = 0;
+ virtual void FCMOVBE(Instruction const&) = 0;
+ virtual void FICOMP_RM32(Instruction const&) = 0;
+ virtual void FCMOVU(Instruction const&) = 0;
+ virtual void FISUB_RM32(Instruction const&) = 0;
+ virtual void FISUBR_RM32(Instruction const&) = 0;
+ virtual void FUCOMPP(Instruction const&) = 0;
+ virtual void FIDIV_RM32(Instruction const&) = 0;
+ virtual void FIDIVR_RM32(Instruction const&) = 0;
+ virtual void FILD_RM32(Instruction const&) = 0;
+ virtual void FCMOVNB(Instruction const&) = 0;
+ virtual void FISTTP_RM32(Instruction const&) = 0;
+ virtual void FCMOVNE(Instruction const&) = 0;
+ virtual void FIST_RM32(Instruction const&) = 0;
+ virtual void FCMOVNBE(Instruction const&) = 0;
+ virtual void FISTP_RM32(Instruction const&) = 0;
+ virtual void FCMOVNU(Instruction const&) = 0;
+ virtual void FNENI(Instruction const&) = 0;
+ virtual void FNDISI(Instruction const&) = 0;
+ virtual void FNCLEX(Instruction const&) = 0;
+ virtual void FNINIT(Instruction const&) = 0;
+ virtual void FNSETPM(Instruction const&) = 0;
+ virtual void FLD_RM80(Instruction const&) = 0;
+ virtual void FUCOMI(Instruction const&) = 0;
+ virtual void FCOMI(Instruction const&) = 0;
+ virtual void FSTP_RM80(Instruction const&) = 0;
+ virtual void FADD_RM64(Instruction const&) = 0;
+ virtual void FMUL_RM64(Instruction const&) = 0;
+ virtual void FCOM_RM64(Instruction const&) = 0;
+ virtual void FCOMP_RM64(Instruction const&) = 0;
+ virtual void FSUB_RM64(Instruction const&) = 0;
+ virtual void FSUBR_RM64(Instruction const&) = 0;
+ virtual void FDIV_RM64(Instruction const&) = 0;
+ virtual void FDIVR_RM64(Instruction const&) = 0;
+ virtual void FLD_RM64(Instruction const&) = 0;
+ virtual void FFREE(Instruction const&) = 0;
+ virtual void FISTTP_RM64(Instruction const&) = 0;
+ virtual void FST_RM64(Instruction const&) = 0;
+ virtual void FSTP_RM64(Instruction const&) = 0;
+ virtual void FRSTOR(Instruction const&) = 0;
+ virtual void FUCOM(Instruction const&) = 0;
+ virtual void FUCOMP(Instruction const&) = 0;
+ virtual void FNSAVE(Instruction const&) = 0;
+ virtual void FNSTSW(Instruction const&) = 0;
+ virtual void FIADD_RM16(Instruction const&) = 0;
+ virtual void FCMOVB(Instruction const&) = 0;
+ virtual void FIMUL_RM16(Instruction const&) = 0;
+ virtual void FMULP(Instruction const&) = 0;
+ virtual void FICOM_RM16(Instruction const&) = 0;
+ virtual void FICOMP_RM16(Instruction const&) = 0;
+ virtual void FCOMPP(Instruction const&) = 0;
+ virtual void FISUB_RM16(Instruction const&) = 0;
+ virtual void FSUBRP(Instruction const&) = 0;
+ virtual void FISUBR_RM16(Instruction const&) = 0;
+ virtual void FSUBP(Instruction const&) = 0;
+ virtual void FIDIV_RM16(Instruction const&) = 0;
+ virtual void FDIVRP(Instruction const&) = 0;
+ virtual void FIDIVR_RM16(Instruction const&) = 0;
+ virtual void FDIVP(Instruction const&) = 0;
+ virtual void FILD_RM16(Instruction const&) = 0;
+ virtual void FFREEP(Instruction const&) = 0;
+ virtual void FISTTP_RM16(Instruction const&) = 0;
+ virtual void FIST_RM16(Instruction const&) = 0;
+ virtual void FISTP_RM16(Instruction const&) = 0;
+ virtual void FBLD_M80(Instruction const&) = 0;
+ virtual void FNSTSW_AX(Instruction const&) = 0;
+ virtual void FILD_RM64(Instruction const&) = 0;
+ virtual void FUCOMIP(Instruction const&) = 0;
+ virtual void FBSTP_M80(Instruction const&) = 0;
+ virtual void FCOMIP(Instruction const&) = 0;
+ virtual void FISTP_RM64(Instruction const&) = 0;
+ virtual void HLT(Instruction const&) = 0;
+ virtual void IDIV_RM16(Instruction const&) = 0;
+ virtual void IDIV_RM32(Instruction const&) = 0;
+ virtual void IDIV_RM8(Instruction const&) = 0;
+ virtual void IMUL_RM16(Instruction const&) = 0;
+ virtual void IMUL_RM32(Instruction const&) = 0;
+ virtual void IMUL_RM8(Instruction const&) = 0;
+ virtual void IMUL_reg16_RM16(Instruction const&) = 0;
+ virtual void IMUL_reg16_RM16_imm16(Instruction const&) = 0;
+ virtual void IMUL_reg16_RM16_imm8(Instruction const&) = 0;
+ virtual void IMUL_reg32_RM32(Instruction const&) = 0;
+ virtual void IMUL_reg32_RM32_imm32(Instruction const&) = 0;
+ virtual void IMUL_reg32_RM32_imm8(Instruction const&) = 0;
+ virtual void INC_RM16(Instruction const&) = 0;
+ virtual void INC_RM32(Instruction const&) = 0;
+ virtual void INC_RM8(Instruction const&) = 0;
+ virtual void INC_reg16(Instruction const&) = 0;
+ virtual void INC_reg32(Instruction const&) = 0;
+ virtual void INSB(Instruction const&) = 0;
+ virtual void INSD(Instruction const&) = 0;
+ virtual void INSW(Instruction const&) = 0;
+ virtual void INT1(Instruction const&) = 0;
+ virtual void INT3(Instruction const&) = 0;
+ virtual void INTO(Instruction const&) = 0;
+ virtual void INT_imm8(Instruction const&) = 0;
+ virtual void INVLPG(Instruction const&) = 0;
+ virtual void IN_AL_DX(Instruction const&) = 0;
+ virtual void IN_AL_imm8(Instruction const&) = 0;
+ virtual void IN_AX_DX(Instruction const&) = 0;
+ virtual void IN_AX_imm8(Instruction const&) = 0;
+ virtual void IN_EAX_DX(Instruction const&) = 0;
+ virtual void IN_EAX_imm8(Instruction const&) = 0;
+ virtual void IRET(Instruction const&) = 0;
+ virtual void JCXZ_imm8(Instruction const&) = 0;
+ virtual void JMP_FAR_mem16(Instruction const&) = 0;
+ virtual void JMP_FAR_mem32(Instruction const&) = 0;
+ virtual void JMP_RM16(Instruction const&) = 0;
+ virtual void JMP_RM32(Instruction const&) = 0;
+ virtual void JMP_imm16(Instruction const&) = 0;
+ virtual void JMP_imm16_imm16(Instruction const&) = 0;
+ virtual void JMP_imm16_imm32(Instruction const&) = 0;
+ virtual void JMP_imm32(Instruction const&) = 0;
+ virtual void JMP_short_imm8(Instruction const&) = 0;
+ virtual void Jcc_NEAR_imm(Instruction const&) = 0;
+ virtual void Jcc_imm8(Instruction const&) = 0;
+ virtual void LAHF(Instruction const&) = 0;
+ virtual void LAR_reg16_RM16(Instruction const&) = 0;
+ virtual void LAR_reg32_RM32(Instruction const&) = 0;
+ virtual void LDS_reg16_mem16(Instruction const&) = 0;
+ virtual void LDS_reg32_mem32(Instruction const&) = 0;
+ virtual void LEAVE16(Instruction const&) = 0;
+ virtual void LEAVE32(Instruction const&) = 0;
+ virtual void LEA_reg16_mem16(Instruction const&) = 0;
+ virtual void LEA_reg32_mem32(Instruction const&) = 0;
+ virtual void LES_reg16_mem16(Instruction const&) = 0;
+ virtual void LES_reg32_mem32(Instruction const&) = 0;
+ virtual void LFS_reg16_mem16(Instruction const&) = 0;
+ virtual void LFS_reg32_mem32(Instruction const&) = 0;
+ virtual void LGDT(Instruction const&) = 0;
+ virtual void LGS_reg16_mem16(Instruction const&) = 0;
+ virtual void LGS_reg32_mem32(Instruction const&) = 0;
+ virtual void LIDT(Instruction const&) = 0;
+ virtual void LLDT_RM16(Instruction const&) = 0;
+ virtual void LMSW_RM16(Instruction const&) = 0;
+ virtual void LODSB(Instruction const&) = 0;
+ virtual void LODSD(Instruction const&) = 0;
+ virtual void LODSW(Instruction const&) = 0;
+ virtual void LOOPNZ_imm8(Instruction const&) = 0;
+ virtual void LOOPZ_imm8(Instruction const&) = 0;
+ virtual void LOOP_imm8(Instruction const&) = 0;
+ virtual void LSL_reg16_RM16(Instruction const&) = 0;
+ virtual void LSL_reg32_RM32(Instruction const&) = 0;
+ virtual void LSS_reg16_mem16(Instruction const&) = 0;
+ virtual void LSS_reg32_mem32(Instruction const&) = 0;
+ virtual void LTR_RM16(Instruction const&) = 0;
+ virtual void MOVSB(Instruction const&) = 0;
+ virtual void MOVSD(Instruction const&) = 0;
+ virtual void MOVSW(Instruction const&) = 0;
+ virtual void MOVSX_reg16_RM8(Instruction const&) = 0;
+ virtual void MOVSX_reg32_RM16(Instruction const&) = 0;
+ virtual void MOVSX_reg32_RM8(Instruction const&) = 0;
+ virtual void MOVZX_reg16_RM8(Instruction const&) = 0;
+ virtual void MOVZX_reg32_RM16(Instruction const&) = 0;
+ virtual void MOVZX_reg32_RM8(Instruction const&) = 0;
+ virtual void MOV_AL_moff8(Instruction const&) = 0;
+ virtual void MOV_AX_moff16(Instruction const&) = 0;
+ virtual void MOV_CR_reg32(Instruction const&) = 0;
+ virtual void MOV_DR_reg32(Instruction const&) = 0;
+ virtual void MOV_EAX_moff32(Instruction const&) = 0;
+ virtual void MOV_RM16_imm16(Instruction const&) = 0;
+ virtual void MOV_RM16_reg16(Instruction const&) = 0;
+ virtual void MOV_RM16_seg(Instruction const&) = 0;
+ virtual void MOV_RM32_imm32(Instruction const&) = 0;
+ virtual void MOV_RM32_reg32(Instruction const&) = 0;
+ virtual void MOV_RM8_imm8(Instruction const&) = 0;
+ virtual void MOV_RM8_reg8(Instruction const&) = 0;
+ virtual void MOV_moff16_AX(Instruction const&) = 0;
+ virtual void MOV_moff32_EAX(Instruction const&) = 0;
+ virtual void MOV_moff8_AL(Instruction const&) = 0;
+ virtual void MOV_reg16_RM16(Instruction const&) = 0;
+ virtual void MOV_reg16_imm16(Instruction const&) = 0;
+ virtual void MOV_reg32_CR(Instruction const&) = 0;
+ virtual void MOV_reg32_DR(Instruction const&) = 0;
+ virtual void MOV_reg32_RM32(Instruction const&) = 0;
+ virtual void MOV_reg32_imm32(Instruction const&) = 0;
+ virtual void MOV_reg8_RM8(Instruction const&) = 0;
+ virtual void MOV_reg8_imm8(Instruction const&) = 0;
+ virtual void MOV_seg_RM16(Instruction const&) = 0;
+ virtual void MOV_seg_RM32(Instruction const&) = 0;
+ virtual void MUL_RM16(Instruction const&) = 0;
+ virtual void MUL_RM32(Instruction const&) = 0;
+ virtual void MUL_RM8(Instruction const&) = 0;
+ virtual void NEG_RM16(Instruction const&) = 0;
+ virtual void NEG_RM32(Instruction const&) = 0;
+ virtual void NEG_RM8(Instruction const&) = 0;
+ virtual void NOP(Instruction const&) = 0;
+ virtual void NOT_RM16(Instruction const&) = 0;
+ virtual void NOT_RM32(Instruction const&) = 0;
+ virtual void NOT_RM8(Instruction const&) = 0;
+ virtual void OR_AL_imm8(Instruction const&) = 0;
+ virtual void OR_AX_imm16(Instruction const&) = 0;
+ virtual void OR_EAX_imm32(Instruction const&) = 0;
+ virtual void OR_RM16_imm16(Instruction const&) = 0;
+ virtual void OR_RM16_imm8(Instruction const&) = 0;
+ virtual void OR_RM16_reg16(Instruction const&) = 0;
+ virtual void OR_RM32_imm32(Instruction const&) = 0;
+ virtual void OR_RM32_imm8(Instruction const&) = 0;
+ virtual void OR_RM32_reg32(Instruction const&) = 0;
+ virtual void OR_RM8_imm8(Instruction const&) = 0;
+ virtual void OR_RM8_reg8(Instruction const&) = 0;
+ virtual void OR_reg16_RM16(Instruction const&) = 0;
+ virtual void OR_reg32_RM32(Instruction const&) = 0;
+ virtual void OR_reg8_RM8(Instruction const&) = 0;
+ virtual void OUTSB(Instruction const&) = 0;
+ virtual void OUTSD(Instruction const&) = 0;
+ virtual void OUTSW(Instruction const&) = 0;
+ virtual void OUT_DX_AL(Instruction const&) = 0;
+ virtual void OUT_DX_AX(Instruction const&) = 0;
+ virtual void OUT_DX_EAX(Instruction const&) = 0;
+ virtual void OUT_imm8_AL(Instruction const&) = 0;
+ virtual void OUT_imm8_AX(Instruction const&) = 0;
+ virtual void OUT_imm8_EAX(Instruction const&) = 0;
+ virtual void PACKSSDW_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PACKSSWB_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PACKUSWB_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PADDB_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PADDW_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PADDD_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PADDSB_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PADDSW_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PADDUSB_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PADDUSW_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PAND_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PANDN_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PCMPEQB_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PCMPEQW_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PCMPEQD_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PCMPGTB_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PCMPGTW_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PCMPGTD_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PMADDWD_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PMULHW_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PMULLW_mm1_mm2m64(Instruction const&) = 0;
+ virtual void POPA(Instruction const&) = 0;
+ virtual void POPAD(Instruction const&) = 0;
+ virtual void POPF(Instruction const&) = 0;
+ virtual void POPFD(Instruction const&) = 0;
+ virtual void POP_DS(Instruction const&) = 0;
+ virtual void POP_ES(Instruction const&) = 0;
+ virtual void POP_FS(Instruction const&) = 0;
+ virtual void POP_GS(Instruction const&) = 0;
+ virtual void POP_RM16(Instruction const&) = 0;
+ virtual void POP_RM32(Instruction const&) = 0;
+ virtual void POP_SS(Instruction const&) = 0;
+ virtual void POP_reg16(Instruction const&) = 0;
+ virtual void POP_reg32(Instruction const&) = 0;
+ virtual void POR_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PSLLW_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PSLLW_mm1_imm8(Instruction const&) = 0;
+ virtual void PSLLD_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PSLLD_mm1_imm8(Instruction const&) = 0;
+ virtual void PSLLQ_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PSLLQ_mm1_imm8(Instruction const&) = 0;
+ virtual void PSRAW_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PSRAW_mm1_imm8(Instruction const&) = 0;
+ virtual void PSRAD_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PSRAD_mm1_imm8(Instruction const&) = 0;
+ virtual void PSRLW_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PSRLW_mm1_imm8(Instruction const&) = 0;
+ virtual void PSRLD_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PSRLD_mm1_imm8(Instruction const&) = 0;
+ virtual void PSRLQ_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PSRLQ_mm1_imm8(Instruction const&) = 0;
+ virtual void PSUBB_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PSUBW_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PSUBD_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PSUBSB_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PSUBSW_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PSUBUSB_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PSUBUSW_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PUNPCKHBW_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PUNPCKHWD_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PUNPCKHDQ_mm1_mm2m64(Instruction const&) = 0;
+ virtual void PUNPCKLBW_mm1_mm2m32(Instruction const&) = 0;
+ virtual void PUNPCKLWD_mm1_mm2m32(Instruction const&) = 0;
+ virtual void PUNPCKLDQ_mm1_mm2m32(Instruction const&) = 0;
+ virtual void PUSHA(Instruction const&) = 0;
+ virtual void PUSHAD(Instruction const&) = 0;
+ virtual void PUSHF(Instruction const&) = 0;
+ virtual void PUSHFD(Instruction const&) = 0;
+ virtual void PUSH_CS(Instruction const&) = 0;
+ virtual void PUSH_DS(Instruction const&) = 0;
+ virtual void PUSH_ES(Instruction const&) = 0;
+ virtual void PUSH_FS(Instruction const&) = 0;
+ virtual void PUSH_GS(Instruction const&) = 0;
+ virtual void PUSH_RM16(Instruction const&) = 0;
+ virtual void PUSH_RM32(Instruction const&) = 0;
+ virtual void PUSH_SP_8086_80186(Instruction const&) = 0;
+ virtual void PUSH_SS(Instruction const&) = 0;
+ virtual void PUSH_imm16(Instruction const&) = 0;
+ virtual void PUSH_imm32(Instruction const&) = 0;
+ virtual void PUSH_imm8(Instruction const&) = 0;
+ virtual void PUSH_reg16(Instruction const&) = 0;
+ virtual void PUSH_reg32(Instruction const&) = 0;
+ virtual void PXOR_mm1_mm2m64(Instruction const&) = 0;
+ virtual void RCL_RM16_1(Instruction const&) = 0;
+ virtual void RCL_RM16_CL(Instruction const&) = 0;
+ virtual void RCL_RM16_imm8(Instruction const&) = 0;
+ virtual void RCL_RM32_1(Instruction const&) = 0;
+ virtual void RCL_RM32_CL(Instruction const&) = 0;
+ virtual void RCL_RM32_imm8(Instruction const&) = 0;
+ virtual void RCL_RM8_1(Instruction const&) = 0;
+ virtual void RCL_RM8_CL(Instruction const&) = 0;
+ virtual void RCL_RM8_imm8(Instruction const&) = 0;
+ virtual void RCR_RM16_1(Instruction const&) = 0;
+ virtual void RCR_RM16_CL(Instruction const&) = 0;
+ virtual void RCR_RM16_imm8(Instruction const&) = 0;
+ virtual void RCR_RM32_1(Instruction const&) = 0;
+ virtual void RCR_RM32_CL(Instruction const&) = 0;
+ virtual void RCR_RM32_imm8(Instruction const&) = 0;
+ virtual void RCR_RM8_1(Instruction const&) = 0;
+ virtual void RCR_RM8_CL(Instruction const&) = 0;
+ virtual void RCR_RM8_imm8(Instruction const&) = 0;
+ virtual void RDTSC(Instruction const&) = 0;
+ virtual void RET(Instruction const&) = 0;
+ virtual void RETF(Instruction const&) = 0;
+ virtual void RETF_imm16(Instruction const&) = 0;
+ virtual void RET_imm16(Instruction const&) = 0;
+ virtual void ROL_RM16_1(Instruction const&) = 0;
+ virtual void ROL_RM16_CL(Instruction const&) = 0;
+ virtual void ROL_RM16_imm8(Instruction const&) = 0;
+ virtual void ROL_RM32_1(Instruction const&) = 0;
+ virtual void ROL_RM32_CL(Instruction const&) = 0;
+ virtual void ROL_RM32_imm8(Instruction const&) = 0;
+ virtual void ROL_RM8_1(Instruction const&) = 0;
+ virtual void ROL_RM8_CL(Instruction const&) = 0;
+ virtual void ROL_RM8_imm8(Instruction const&) = 0;
+ virtual void ROR_RM16_1(Instruction const&) = 0;
+ virtual void ROR_RM16_CL(Instruction const&) = 0;
+ virtual void ROR_RM16_imm8(Instruction const&) = 0;
+ virtual void ROR_RM32_1(Instruction const&) = 0;
+ virtual void ROR_RM32_CL(Instruction const&) = 0;
+ virtual void ROR_RM32_imm8(Instruction const&) = 0;
+ virtual void ROR_RM8_1(Instruction const&) = 0;
+ virtual void ROR_RM8_CL(Instruction const&) = 0;
+ virtual void ROR_RM8_imm8(Instruction const&) = 0;
+ virtual void SAHF(Instruction const&) = 0;
+ virtual void SALC(Instruction const&) = 0;
+ virtual void SAR_RM16_1(Instruction const&) = 0;
+ virtual void SAR_RM16_CL(Instruction const&) = 0;
+ virtual void SAR_RM16_imm8(Instruction const&) = 0;
+ virtual void SAR_RM32_1(Instruction const&) = 0;
+ virtual void SAR_RM32_CL(Instruction const&) = 0;
+ virtual void SAR_RM32_imm8(Instruction const&) = 0;
+ virtual void SAR_RM8_1(Instruction const&) = 0;
+ virtual void SAR_RM8_CL(Instruction const&) = 0;
+ virtual void SAR_RM8_imm8(Instruction const&) = 0;
+ virtual void SBB_AL_imm8(Instruction const&) = 0;
+ virtual void SBB_AX_imm16(Instruction const&) = 0;
+ virtual void SBB_EAX_imm32(Instruction const&) = 0;
+ virtual void SBB_RM16_imm16(Instruction const&) = 0;
+ virtual void SBB_RM16_imm8(Instruction const&) = 0;
+ virtual void SBB_RM16_reg16(Instruction const&) = 0;
+ virtual void SBB_RM32_imm32(Instruction const&) = 0;
+ virtual void SBB_RM32_imm8(Instruction const&) = 0;
+ virtual void SBB_RM32_reg32(Instruction const&) = 0;
+ virtual void SBB_RM8_imm8(Instruction const&) = 0;
+ virtual void SBB_RM8_reg8(Instruction const&) = 0;
+ virtual void SBB_reg16_RM16(Instruction const&) = 0;
+ virtual void SBB_reg32_RM32(Instruction const&) = 0;
+ virtual void SBB_reg8_RM8(Instruction const&) = 0;
+ virtual void SCASB(Instruction const&) = 0;
+ virtual void SCASD(Instruction const&) = 0;
+ virtual void SCASW(Instruction const&) = 0;
+ virtual void SETcc_RM8(Instruction const&) = 0;
+ virtual void SGDT(Instruction const&) = 0;
+ virtual void SHLD_RM16_reg16_CL(Instruction const&) = 0;
+ virtual void SHLD_RM16_reg16_imm8(Instruction const&) = 0;
+ virtual void SHLD_RM32_reg32_CL(Instruction const&) = 0;
+ virtual void SHLD_RM32_reg32_imm8(Instruction const&) = 0;
+ virtual void SHL_RM16_1(Instruction const&) = 0;
+ virtual void SHL_RM16_CL(Instruction const&) = 0;
+ virtual void SHL_RM16_imm8(Instruction const&) = 0;
+ virtual void SHL_RM32_1(Instruction const&) = 0;
+ virtual void SHL_RM32_CL(Instruction const&) = 0;
+ virtual void SHL_RM32_imm8(Instruction const&) = 0;
+ virtual void SHL_RM8_1(Instruction const&) = 0;
+ virtual void SHL_RM8_CL(Instruction const&) = 0;
+ virtual void SHL_RM8_imm8(Instruction const&) = 0;
+ virtual void SHRD_RM16_reg16_CL(Instruction const&) = 0;
+ virtual void SHRD_RM16_reg16_imm8(Instruction const&) = 0;
+ virtual void SHRD_RM32_reg32_CL(Instruction const&) = 0;
+ virtual void SHRD_RM32_reg32_imm8(Instruction const&) = 0;
+ virtual void SHR_RM16_1(Instruction const&) = 0;
+ virtual void SHR_RM16_CL(Instruction const&) = 0;
+ virtual void SHR_RM16_imm8(Instruction const&) = 0;
+ virtual void SHR_RM32_1(Instruction const&) = 0;
+ virtual void SHR_RM32_CL(Instruction const&) = 0;
+ virtual void SHR_RM32_imm8(Instruction const&) = 0;
+ virtual void SHR_RM8_1(Instruction const&) = 0;
+ virtual void SHR_RM8_CL(Instruction const&) = 0;
+ virtual void SHR_RM8_imm8(Instruction const&) = 0;
+ virtual void SIDT(Instruction const&) = 0;
+ virtual void SLDT_RM16(Instruction const&) = 0;
+ virtual void SMSW_RM16(Instruction const&) = 0;
+ virtual void STC(Instruction const&) = 0;
+ virtual void STD(Instruction const&) = 0;
+ virtual void STI(Instruction const&) = 0;
+ virtual void STOSB(Instruction const&) = 0;
+ virtual void STOSD(Instruction const&) = 0;
+ virtual void STOSW(Instruction const&) = 0;
+ virtual void STR_RM16(Instruction const&) = 0;
+ virtual void SUB_AL_imm8(Instruction const&) = 0;
+ virtual void SUB_AX_imm16(Instruction const&) = 0;
+ virtual void SUB_EAX_imm32(Instruction const&) = 0;
+ virtual void SUB_RM16_imm16(Instruction const&) = 0;
+ virtual void SUB_RM16_imm8(Instruction const&) = 0;
+ virtual void SUB_RM16_reg16(Instruction const&) = 0;
+ virtual void SUB_RM32_imm32(Instruction const&) = 0;
+ virtual void SUB_RM32_imm8(Instruction const&) = 0;
+ virtual void SUB_RM32_reg32(Instruction const&) = 0;
+ virtual void SUB_RM8_imm8(Instruction const&) = 0;
+ virtual void SUB_RM8_reg8(Instruction const&) = 0;
+ virtual void SUB_reg16_RM16(Instruction const&) = 0;
+ virtual void SUB_reg32_RM32(Instruction const&) = 0;
+ virtual void SUB_reg8_RM8(Instruction const&) = 0;
+ virtual void TEST_AL_imm8(Instruction const&) = 0;
+ virtual void TEST_AX_imm16(Instruction const&) = 0;
+ virtual void TEST_EAX_imm32(Instruction const&) = 0;
+ virtual void TEST_RM16_imm16(Instruction const&) = 0;
+ virtual void TEST_RM16_reg16(Instruction const&) = 0;
+ virtual void TEST_RM32_imm32(Instruction const&) = 0;
+ virtual void TEST_RM32_reg32(Instruction const&) = 0;
+ virtual void TEST_RM8_imm8(Instruction const&) = 0;
+ virtual void TEST_RM8_reg8(Instruction const&) = 0;
+ virtual void UD0(Instruction const&) = 0;
+ virtual void UD1(Instruction const&) = 0;
+ virtual void UD2(Instruction const&) = 0;
+ virtual void VERR_RM16(Instruction const&) = 0;
+ virtual void VERW_RM16(Instruction const&) = 0;
+ virtual void WAIT(Instruction const&) = 0;
+ virtual void WBINVD(Instruction const&) = 0;
+ virtual void XADD_RM16_reg16(Instruction const&) = 0;
+ virtual void XADD_RM32_reg32(Instruction const&) = 0;
+ virtual void XADD_RM8_reg8(Instruction const&) = 0;
+ virtual void XCHG_AX_reg16(Instruction const&) = 0;
+ virtual void XCHG_EAX_reg32(Instruction const&) = 0;
+ virtual void XCHG_reg16_RM16(Instruction const&) = 0;
+ virtual void XCHG_reg32_RM32(Instruction const&) = 0;
+ virtual void XCHG_reg8_RM8(Instruction const&) = 0;
+ virtual void XLAT(Instruction const&) = 0;
+ virtual void XOR_AL_imm8(Instruction const&) = 0;
+ virtual void XOR_AX_imm16(Instruction const&) = 0;
+ virtual void XOR_EAX_imm32(Instruction const&) = 0;
+ virtual void XOR_RM16_imm16(Instruction const&) = 0;
+ virtual void XOR_RM16_imm8(Instruction const&) = 0;
+ virtual void XOR_RM16_reg16(Instruction const&) = 0;
+ virtual void XOR_RM32_imm32(Instruction const&) = 0;
+ virtual void XOR_RM32_imm8(Instruction const&) = 0;
+ virtual void XOR_RM32_reg32(Instruction const&) = 0;
+ virtual void XOR_RM8_imm8(Instruction const&) = 0;
+ virtual void XOR_RM8_reg8(Instruction const&) = 0;
+ virtual void XOR_reg16_RM16(Instruction const&) = 0;
+ virtual void XOR_reg32_RM32(Instruction const&) = 0;
+ virtual void XOR_reg8_RM8(Instruction const&) = 0;
+ virtual void MOVQ_mm1_mm2m64(Instruction const&) = 0;
+ virtual void MOVQ_mm1m64_mm2(Instruction const&) = 0;
+ virtual void MOVD_mm1_rm32(Instruction const&) = 0;
+ virtual void MOVQ_mm1_rm64(Instruction const&) = 0; // long mode
+ virtual void MOVD_rm32_mm2(Instruction const&) = 0;
+ virtual void MOVQ_rm64_mm2(Instruction const&) = 0; // long mode
+ virtual void EMMS(Instruction const&) = 0;
+ virtual void wrap_0xC0(Instruction const&) = 0;
+ virtual void wrap_0xC1_16(Instruction const&) = 0;
+ virtual void wrap_0xC1_32(Instruction const&) = 0;
+ virtual void wrap_0xD0(Instruction const&) = 0;
+ virtual void wrap_0xD1_16(Instruction const&) = 0;
+ virtual void wrap_0xD1_32(Instruction const&) = 0;
+ virtual void wrap_0xD2(Instruction const&) = 0;
+ virtual void wrap_0xD3_16(Instruction const&) = 0;
+ virtual void wrap_0xD3_32(Instruction const&) = 0;
virtual void PREFETCHTNTA(Instruction const&) = 0;
virtual void PREFETCHT0(Instruction const&) = 0;
@@ -740,6 +740,6 @@ protected:
virtual ~Interpreter() = default;
};
-typedef void (Interpreter::*InstructionHandler)(const Instruction&);
+typedef void (Interpreter::*InstructionHandler)(Instruction const&);
}
diff --git a/Userland/Services/ChessEngine/ChessEngine.cpp b/Userland/Services/ChessEngine/ChessEngine.cpp
index 7183aa6b2d..66a1fae8f1 100644
--- a/Userland/Services/ChessEngine/ChessEngine.cpp
+++ b/Userland/Services/ChessEngine/ChessEngine.cpp
@@ -18,7 +18,7 @@ void ChessEngine::handle_uci()
send_command(UCIOkCommand());
}
-void ChessEngine::handle_position(const PositionCommand& command)
+void ChessEngine::handle_position(PositionCommand const& command)
{
// FIXME: Implement fen board position.
VERIFY(!command.fen().has_value());
@@ -28,7 +28,7 @@ void ChessEngine::handle_position(const PositionCommand& command)
}
}
-void ChessEngine::handle_go(const GoCommand& command)
+void ChessEngine::handle_go(GoCommand const& command)
{
// FIXME: A better algorithm than naive mcts.
// FIXME: Add different ways to terminate search.
diff --git a/Userland/Services/ChessEngine/ChessEngine.h b/Userland/Services/ChessEngine/ChessEngine.h
index 766a39aa3b..94c61a86ae 100644
--- a/Userland/Services/ChessEngine/ChessEngine.h
+++ b/Userland/Services/ChessEngine/ChessEngine.h
@@ -15,8 +15,8 @@ public:
virtual ~ChessEngine() override = default;
virtual void handle_uci() override;
- virtual void handle_position(const Chess::UCI::PositionCommand&) override;
- virtual void handle_go(const Chess::UCI::GoCommand&) override;
+ virtual void handle_position(Chess::UCI::PositionCommand const&) override;
+ virtual void handle_go(Chess::UCI::GoCommand const&) override;
private:
ChessEngine() = default;
diff --git a/Userland/Services/ChessEngine/MCTSTree.cpp b/Userland/Services/ChessEngine/MCTSTree.cpp
index e331784a9d..a06fa62d41 100644
--- a/Userland/Services/ChessEngine/MCTSTree.cpp
+++ b/Userland/Services/ChessEngine/MCTSTree.cpp
@@ -8,7 +8,7 @@
#include <AK/String.h>
#include <stdlib.h>
-MCTSTree::MCTSTree(const Chess::Board& board, MCTSTree* parent)
+MCTSTree::MCTSTree(Chess::Board const& board, MCTSTree* parent)
: m_parent(parent)
, m_board(make<Chess::Board>(board))
, m_last_move(board.last_move())
diff --git a/Userland/Services/ChessEngine/MCTSTree.h b/Userland/Services/ChessEngine/MCTSTree.h
index 6d522ccaf4..8c7c0dd776 100644
--- a/Userland/Services/ChessEngine/MCTSTree.h
+++ b/Userland/Services/ChessEngine/MCTSTree.h
@@ -19,7 +19,7 @@ public:
Heuristic,
};
- MCTSTree(const Chess::Board& board, MCTSTree* parent = nullptr);
+ MCTSTree(Chess::Board const& board, MCTSTree* parent = nullptr);
MCTSTree& select_leaf();
MCTSTree& expand();
diff --git a/Userland/Services/Clipboard/Storage.cpp b/Userland/Services/Clipboard/Storage.cpp
index 9740d03b12..29c027fa82 100644
--- a/Userland/Services/Clipboard/Storage.cpp
+++ b/Userland/Services/Clipboard/Storage.cpp
@@ -14,7 +14,7 @@ Storage& Storage::the()
return s_the;
}
-void Storage::set_data(Core::AnonymousBuffer data, const String& mime_type, const HashMap<String, String>& metadata)
+void Storage::set_data(Core::AnonymousBuffer data, String const& mime_type, HashMap<String, String> const& metadata)
{
m_buffer = move(data);
m_data_size = data.size();
diff --git a/Userland/Services/Clipboard/Storage.h b/Userland/Services/Clipboard/Storage.h
index 07cfb46bf4..ecd4f510c4 100644
--- a/Userland/Services/Clipboard/Storage.h
+++ b/Userland/Services/Clipboard/Storage.h
@@ -20,10 +20,10 @@ public:
bool has_data() const { return m_buffer.is_valid(); }
- const String& mime_type() const { return m_mime_type; }
- const HashMap<String, String>& metadata() const { return m_metadata; }
+ String const& mime_type() const { return m_mime_type; }
+ HashMap<String, String> const& metadata() const { return m_metadata; }
- const u8* data() const
+ u8 const* data() const
{
if (!has_data())
return nullptr;
@@ -37,11 +37,11 @@ public:
return 0;
}
- void set_data(Core::AnonymousBuffer, const String& mime_type, const HashMap<String, String>& metadata);
+ void set_data(Core::AnonymousBuffer, String const& mime_type, HashMap<String, String> const& metadata);
Function<void()> on_content_change;
- const Core::AnonymousBuffer& buffer() const { return m_buffer; }
+ Core::AnonymousBuffer const& buffer() const { return m_buffer; }
private:
Storage() = default;
diff --git a/Userland/Services/CrashDaemon/main.cpp b/Userland/Services/CrashDaemon/main.cpp
index 927157ac59..d14c33497d 100644
--- a/Userland/Services/CrashDaemon/main.cpp
+++ b/Userland/Services/CrashDaemon/main.cpp
@@ -16,7 +16,7 @@
#include <time.h>
#include <unistd.h>
-static void wait_until_coredump_is_ready(const String& coredump_path)
+static void wait_until_coredump_is_ready(String const& coredump_path)
{
while (true) {
struct stat statbuf;
@@ -31,10 +31,10 @@ static void wait_until_coredump_is_ready(const String& coredump_path)
}
}
-static void launch_crash_reporter(const String& coredump_path, bool unlink_on_exit)
+static void launch_crash_reporter(String const& coredump_path, bool unlink_on_exit)
{
pid_t child;
- const char* argv[4] = { "CrashReporter" };
+ char const* argv[4] = { "CrashReporter" };
if (unlink_on_exit) {
argv[1] = "--unlink";
argv[2] = coredump_path.characters();
diff --git a/Userland/Services/DHCPClient/DHCPv4.cpp b/Userland/Services/DHCPClient/DHCPv4.cpp
index 2806cf5bed..9abf5ed9a3 100644
--- a/Userland/Services/DHCPClient/DHCPv4.cpp
+++ b/Userland/Services/DHCPClient/DHCPv4.cpp
@@ -11,7 +11,7 @@ ParsedDHCPv4Options DHCPv4Packet::parse_options() const
{
ParsedDHCPv4Options options;
for (size_t index = 4; index < DHCPV4_OPTION_FIELD_MAX_LENGTH; ++index) {
- auto opt_name = *(const DHCPOption*)&m_options[index];
+ auto opt_name = *(DHCPOption const*)&m_options[index];
switch (opt_name) {
case DHCPOption::Pad:
continue;
diff --git a/Userland/Services/DHCPClient/DHCPv4.h b/Userland/Services/DHCPClient/DHCPv4.h
index b6cdc1bda3..de00f46c6d 100644
--- a/Userland/Services/DHCPClient/DHCPv4.h
+++ b/Userland/Services/DHCPClient/DHCPv4.h
@@ -159,7 +159,7 @@ struct ParsedDHCPv4Options {
for (auto& opt : options) {
builder.appendff("\toption {} ({} bytes):", (u8)opt.key, (u8)opt.value.length);
for (auto i = 0; i < opt.value.length; ++i)
- builder.appendff(" {} ", ((const u8*)opt.value.value)[i]);
+ builder.appendff(" {} ", ((u8 const*)opt.value.value)[i]);
builder.append('\n');
}
return builder.build();
@@ -167,7 +167,7 @@ struct ParsedDHCPv4Options {
struct DHCPOptionValue {
u8 length;
- const void* value;
+ void const* value;
};
HashMap<DHCPOption, DHCPOptionValue> options;
@@ -198,10 +198,10 @@ public:
u16 flags() const { return m_flags; }
void set_flags(DHCPv4Flags flags) { m_flags = (u16)flags; }
- const IPv4Address& ciaddr() const { return m_ciaddr; }
- const IPv4Address& yiaddr() const { return m_yiaddr; }
- const IPv4Address& siaddr() const { return m_siaddr; }
- const IPv4Address& giaddr() const { return m_giaddr; }
+ IPv4Address const& ciaddr() const { return m_ciaddr; }
+ IPv4Address const& yiaddr() const { return m_yiaddr; }
+ IPv4Address const& siaddr() const { return m_siaddr; }
+ IPv4Address const& giaddr() const { return m_giaddr; }
IPv4Address& ciaddr() { return m_ciaddr; }
IPv4Address& yiaddr() { return m_yiaddr; }
@@ -211,11 +211,11 @@ public:
u8* options() { return m_options; }
ParsedDHCPv4Options parse_options() const;
- const MACAddress& chaddr() const { return *(const MACAddress*)&m_chaddr[0]; }
- void set_chaddr(const MACAddress& mac) { *(MACAddress*)&m_chaddr[0] = mac; }
+ MACAddress const& chaddr() const { return *(MACAddress const*)&m_chaddr[0]; }
+ void set_chaddr(MACAddress const& mac) { *(MACAddress*)&m_chaddr[0] = mac; }
- StringView sname() const { return { (const char*)&m_sname[0] }; }
- StringView file() const { return { (const char*)&m_file[0] }; }
+ StringView sname() const { return { (char const*)&m_sname[0] }; }
+ StringView file() const { return { (char const*)&m_file[0] }; }
private:
NetworkOrdered<u8> m_op;
@@ -247,7 +247,7 @@ public:
options[3] = 99;
}
- void add_option(DHCPOption option, u8 length, const void* data)
+ void add_option(DHCPOption option, u8 length, void const* data)
{
VERIFY(m_can_add);
// we need enough space to fit the option value, its length, and its data
diff --git a/Userland/Services/DHCPClient/DHCPv4Client.cpp b/Userland/Services/DHCPClient/DHCPv4Client.cpp
index b9a4a0a2f8..35b8ea2028 100644
--- a/Userland/Services/DHCPClient/DHCPv4Client.cpp
+++ b/Userland/Services/DHCPClient/DHCPv4Client.cpp
@@ -15,14 +15,14 @@
#include <LibCore/Timer.h>
#include <stdio.h>
-static u8 mac_part(const Vector<String>& parts, size_t index)
+static u8 mac_part(Vector<String> const& parts, size_t index)
{
auto result = AK::StringUtils::convert_to_uint_from_hex(parts.at(index));
VERIFY(result.has_value());
return result.value();
}
-static MACAddress mac_from_string(const String& str)
+static MACAddress mac_from_string(String const& str)
{
auto chunks = str.split(':');
VERIFY(chunks.size() == 6); // should we...worry about this?
@@ -32,7 +32,7 @@ static MACAddress mac_from_string(const String& str)
};
}
-static bool send(const InterfaceDescriptor& iface, const DHCPv4Packet& packet, Core::Object*)
+static bool send(InterfaceDescriptor const& iface, DHCPv4Packet const& packet, Core::Object*)
{
int fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (fd < 0) {
@@ -63,7 +63,7 @@ static bool send(const InterfaceDescriptor& iface, const DHCPv4Packet& packet, C
return true;
}
-static void set_params(const InterfaceDescriptor& iface, const IPv4Address& ipv4_addr, const IPv4Address& netmask, const IPv4Address& gateway)
+static void set_params(InterfaceDescriptor const& iface, IPv4Address const& ipv4_addr, IPv4Address const& netmask, IPv4Address const& gateway)
{
int fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP);
if (fd < 0) {
@@ -201,7 +201,7 @@ ErrorOr<DHCPv4Client::Interfaces> DHCPv4Client::get_discoverable_interfaces()
};
}
-void DHCPv4Client::handle_offer(const DHCPv4Packet& packet, const ParsedDHCPv4Options& options)
+void DHCPv4Client::handle_offer(DHCPv4Packet const& packet, ParsedDHCPv4Options const& options)
{
dbgln("We were offered {} for {}", packet.yiaddr().to_string(), options.get<u32>(DHCPOption::IPAddressLeaseTime).value_or(0));
auto* transaction = const_cast<DHCPv4Transaction*>(m_ongoing_transactions.get(packet.xid()).value_or(nullptr));
@@ -221,7 +221,7 @@ void DHCPv4Client::handle_offer(const DHCPv4Packet& packet, const ParsedDHCPv4Op
dhcp_request(*transaction, packet);
}
-void DHCPv4Client::handle_ack(const DHCPv4Packet& packet, const ParsedDHCPv4Options& options)
+void DHCPv4Client::handle_ack(DHCPv4Packet const& packet, ParsedDHCPv4Options const& options)
{
if constexpr (DHCPV4CLIENT_DEBUG) {
dbgln("The DHCP server handed us {}", packet.yiaddr().to_string());
@@ -250,7 +250,7 @@ void DHCPv4Client::handle_ack(const DHCPv4Packet& packet, const ParsedDHCPv4Opti
set_params(transaction->interface, new_ip, options.get<IPv4Address>(DHCPOption::SubnetMask).value(), options.get_many<IPv4Address>(DHCPOption::Router, 1).first());
}
-void DHCPv4Client::handle_nak(const DHCPv4Packet& packet, const ParsedDHCPv4Options& options)
+void DHCPv4Client::handle_nak(DHCPv4Packet const& packet, ParsedDHCPv4Options const& options)
{
dbgln("The DHCP server told us to go chase our own tail about {}", packet.yiaddr().to_string());
dbgln("Here are the options: {}", options.to_string());
@@ -271,7 +271,7 @@ void DHCPv4Client::handle_nak(const DHCPv4Packet& packet, const ParsedDHCPv4Opti
this);
}
-void DHCPv4Client::process_incoming(const DHCPv4Packet& packet)
+void DHCPv4Client::process_incoming(DHCPv4Packet const& packet)
{
auto options = packet.parse_options();
@@ -307,7 +307,7 @@ void DHCPv4Client::process_incoming(const DHCPv4Packet& packet)
}
}
-void DHCPv4Client::dhcp_discover(const InterfaceDescriptor& iface)
+void DHCPv4Client::dhcp_discover(InterfaceDescriptor const& iface)
{
auto transaction_id = get_random<u32>();
@@ -339,7 +339,7 @@ void DHCPv4Client::dhcp_discover(const InterfaceDescriptor& iface)
m_ongoing_transactions.set(transaction_id, make<DHCPv4Transaction>(iface));
}
-void DHCPv4Client::dhcp_request(DHCPv4Transaction& transaction, const DHCPv4Packet& offer)
+void DHCPv4Client::dhcp_request(DHCPv4Transaction& transaction, DHCPv4Packet const& offer)
{
auto& iface = transaction.interface;
dbgln("Leasing the IP {} for adapter {}", offer.yiaddr().to_string(), iface.ifname);
diff --git a/Userland/Services/DHCPClient/DHCPv4Client.h b/Userland/Services/DHCPClient/DHCPv4Client.h
index ba2498e483..d14deebd16 100644
--- a/Userland/Services/DHCPClient/DHCPv4Client.h
+++ b/Userland/Services/DHCPClient/DHCPv4Client.h
@@ -42,10 +42,10 @@ class DHCPv4Client final : public Core::Object {
public:
virtual ~DHCPv4Client() override = default;
- void dhcp_discover(const InterfaceDescriptor& ifname);
- void dhcp_request(DHCPv4Transaction& transaction, const DHCPv4Packet& packet);
+ void dhcp_discover(InterfaceDescriptor const& ifname);
+ void dhcp_request(DHCPv4Transaction& transaction, DHCPv4Packet const& packet);
- void process_incoming(const DHCPv4Packet& packet);
+ void process_incoming(DHCPv4Packet const& packet);
bool id_is_registered(u32 id) { return m_ongoing_transactions.contains(id); }
@@ -65,7 +65,7 @@ private:
RefPtr<Core::Timer> m_check_timer;
int m_max_timer_backoff_interval { 600000 }; // 10 minutes
- void handle_offer(const DHCPv4Packet&, const ParsedDHCPv4Options&);
- void handle_ack(const DHCPv4Packet&, const ParsedDHCPv4Options&);
- void handle_nak(const DHCPv4Packet&, const ParsedDHCPv4Options&);
+ void handle_offer(DHCPv4Packet const&, ParsedDHCPv4Options const&);
+ void handle_ack(DHCPv4Packet const&, ParsedDHCPv4Options const&);
+ void handle_nak(DHCPv4Packet const&, ParsedDHCPv4Options const&);
};
diff --git a/Userland/Services/KeyboardPreferenceLoader/main.cpp b/Userland/Services/KeyboardPreferenceLoader/main.cpp
index cfd231d13c..247421e782 100644
--- a/Userland/Services/KeyboardPreferenceLoader/main.cpp
+++ b/Userland/Services/KeyboardPreferenceLoader/main.cpp
@@ -31,7 +31,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
exit(1);
pid_t child_pid;
- const char* argv[] = { "/bin/keymap", "-m", keymaps_vector.first().characters(), nullptr };
+ char const* argv[] = { "/bin/keymap", "-m", keymaps_vector.first().characters(), nullptr };
if ((errno = posix_spawn(&child_pid, "/bin/keymap", nullptr, nullptr, const_cast<char**>(argv), environ))) {
perror("posix_spawn");
exit(1);
diff --git a/Userland/Services/LaunchServer/Launcher.cpp b/Userland/Services/LaunchServer/Launcher.cpp
index a7bedbb473..5eadeb180f 100644
--- a/Userland/Services/LaunchServer/Launcher.cpp
+++ b/Userland/Services/LaunchServer/Launcher.cpp
@@ -23,7 +23,7 @@
namespace LaunchServer {
static Launcher* s_the;
-static bool spawn(String executable, const Vector<String>& arguments);
+static bool spawn(String executable, Vector<String> const& arguments);
String Handler::name_from_executable(StringView executable)
{
@@ -35,7 +35,7 @@ String Handler::name_from_executable(StringView executable)
return executable;
}
-void Handler::from_executable(Type handler_type, const String& executable)
+void Handler::from_executable(Type handler_type, String const& executable)
{
this->handler_type = handler_type;
this->name = name_from_executable(executable);
@@ -77,7 +77,7 @@ Launcher& Launcher::the()
return *s_the;
}
-void Launcher::load_handlers(const String& af_dir)
+void Launcher::load_handlers(String const& af_dir)
{
Desktop::AppFile::for_each([&](auto af) {
auto app_name = af->name();
@@ -94,7 +94,7 @@ void Launcher::load_handlers(const String& af_dir)
af_dir);
}
-void Launcher::load_config(const Core::ConfigFile& cfg)
+void Launcher::load_config(Core::ConfigFile const& cfg)
{
for (auto key : cfg.keys("FileType")) {
auto handler = cfg.read_entry("FileType", key).trim_whitespace();
@@ -124,7 +124,7 @@ Vector<String> Launcher::handlers_for_url(const URL& url)
return true;
});
} else {
- for_each_handler(url.protocol(), m_protocol_handlers, [&](const auto& handler) -> bool {
+ for_each_handler(url.protocol(), m_protocol_handlers, [&](auto const& handler) -> bool {
if (handler.handler_type != Handler::Type::Default || handler.protocols.contains(url.protocol())) {
handlers.append(handler.executable);
return true;
@@ -144,7 +144,7 @@ Vector<String> Launcher::handlers_with_details_for_url(const URL& url)
return true;
});
} else {
- for_each_handler(url.protocol(), m_protocol_handlers, [&](const auto& handler) -> bool {
+ for_each_handler(url.protocol(), m_protocol_handlers, [&](auto const& handler) -> bool {
if (handler.handler_type != Handler::Type::Default || handler.protocols.contains(url.protocol())) {
handlers.append(handler.to_details_str());
return true;
@@ -155,7 +155,7 @@ Vector<String> Launcher::handlers_with_details_for_url(const URL& url)
return handlers;
}
-bool Launcher::open_url(const URL& url, const String& handler_name)
+bool Launcher::open_url(const URL& url, String const& handler_name)
{
if (!handler_name.is_null())
return open_with_handler_name(url, handler_name);
@@ -166,7 +166,7 @@ bool Launcher::open_url(const URL& url, const String& handler_name)
return open_with_user_preferences(m_protocol_handlers, url.protocol(), { url.to_string() });
}
-bool Launcher::open_with_handler_name(const URL& url, const String& handler_name)
+bool Launcher::open_with_handler_name(const URL& url, String const& handler_name)
{
auto handler_optional = m_handlers.get(handler_name);
if (!handler_optional.has_value())
@@ -181,9 +181,9 @@ bool Launcher::open_with_handler_name(const URL& url, const String& handler_name
return spawn(handler.executable, { argument });
}
-bool spawn(String executable, const Vector<String>& arguments)
+bool spawn(String executable, Vector<String> const& arguments)
{
- Vector<const char*> argv { executable.characters() };
+ Vector<char const*> argv { executable.characters() };
for (auto& arg : arguments)
argv.append(arg.characters());
argv.append(nullptr);
@@ -199,7 +199,7 @@ bool spawn(String executable, const Vector<String>& arguments)
return true;
}
-Handler Launcher::get_handler_for_executable(Handler::Type handler_type, const String& executable) const
+Handler Launcher::get_handler_for_executable(Handler::Type handler_type, String const& executable) const
{
Handler handler;
auto existing_handler = m_handlers.get(executable);
@@ -212,7 +212,7 @@ Handler Launcher::get_handler_for_executable(Handler::Type handler_type, const S
return handler;
}
-bool Launcher::open_with_user_preferences(const HashMap<String, String>& user_preferences, const String& key, const Vector<String>& arguments, const String& default_program)
+bool Launcher::open_with_user_preferences(HashMap<String, String> const& user_preferences, String const& key, Vector<String> const& arguments, String const& default_program)
{
auto program_path = user_preferences.get(key);
if (program_path.has_value())
@@ -230,7 +230,7 @@ bool Launcher::open_with_user_preferences(const HashMap<String, String>& user_pr
return false;
}
-void Launcher::for_each_handler(const String& key, HashMap<String, String>& user_preference, Function<bool(const Handler&)> f)
+void Launcher::for_each_handler(String const& key, HashMap<String, String>& user_preference, Function<bool(Handler const&)> f)
{
auto user_preferred = user_preference.get(key);
if (user_preferred.has_value())
@@ -250,7 +250,7 @@ void Launcher::for_each_handler(const String& key, HashMap<String, String>& user
f(get_handler_for_executable(Handler::Type::UserDefault, user_default.value()));
}
-void Launcher::for_each_handler_for_path(const String& path, Function<bool(const Handler&)> f)
+void Launcher::for_each_handler_for_path(String const& path, Function<bool(Handler const&)> f)
{
struct stat st;
if (lstat(path.characters(), &st) < 0) {
@@ -278,7 +278,7 @@ void Launcher::for_each_handler_for_path(const String& path, Function<bool(const
auto link_target = LexicalPath { link_target_or_error.release_value() };
LexicalPath absolute_link_target = link_target.is_absolute() ? link_target : LexicalPath::join(LexicalPath::dirname(path), link_target.string());
auto real_path = Core::File::real_path_for(absolute_link_target.string());
- return for_each_handler_for_path(real_path, [&](const auto& handler) -> bool {
+ return for_each_handler_for_path(real_path, [&](auto const& handler) -> bool {
return f(handler);
});
}
@@ -288,7 +288,7 @@ void Launcher::for_each_handler_for_path(const String& path, Function<bool(const
auto extension = LexicalPath::extension(path).to_lowercase();
- for_each_handler(extension, m_file_handlers, [&](const auto& handler) -> bool {
+ for_each_handler(extension, m_file_handlers, [&](auto const& handler) -> bool {
if (handler.handler_type != Handler::Type::Default || handler.file_types.contains(extension))
return f(handler);
return false;
diff --git a/Userland/Services/LaunchServer/Launcher.h b/Userland/Services/LaunchServer/Launcher.h
index bc1dacdb57..e9f918775e 100644
--- a/Userland/Services/LaunchServer/Launcher.h
+++ b/Userland/Services/LaunchServer/Launcher.h
@@ -28,7 +28,7 @@ struct Handler {
HashTable<String> protocols {};
static String name_from_executable(StringView);
- void from_executable(Type, const String&);
+ void from_executable(Type, String const&);
String to_details_str() const;
};
@@ -37,9 +37,9 @@ public:
Launcher();
static Launcher& the();
- void load_handlers(const String& af_dir = Desktop::AppFile::APP_FILES_DIRECTORY);
- void load_config(const Core::ConfigFile&);
- bool open_url(const URL&, const String& handler_name);
+ void load_handlers(String const& af_dir = Desktop::AppFile::APP_FILES_DIRECTORY);
+ void load_config(Core::ConfigFile const&);
+ bool open_url(const URL&, String const& handler_name);
Vector<String> handlers_for_url(const URL&);
Vector<String> handlers_with_details_for_url(const URL&);
@@ -48,11 +48,11 @@ private:
HashMap<String, String> m_protocol_handlers;
HashMap<String, String> m_file_handlers;
- Handler get_handler_for_executable(Handler::Type, const String&) const;
- void for_each_handler(const String& key, HashMap<String, String>& user_preferences, Function<bool(const Handler&)> f);
- void for_each_handler_for_path(const String&, Function<bool(const Handler&)> f);
+ Handler get_handler_for_executable(Handler::Type, String const&) const;
+ void for_each_handler(String const& key, HashMap<String, String>& user_preferences, Function<bool(Handler const&)> f);
+ void for_each_handler_for_path(String const&, Function<bool(Handler const&)> f);
bool open_file_url(const URL&);
- bool open_with_user_preferences(const HashMap<String, String>& user_preferences, const String& key, const Vector<String>& arguments, const String& default_program = {});
- bool open_with_handler_name(const URL&, const String& handler_name);
+ bool open_with_user_preferences(HashMap<String, String> const& user_preferences, String const& key, Vector<String> const& arguments, String const& default_program = {});
+ bool open_with_handler_name(const URL&, String const& handler_name);
};
}
diff --git a/Userland/Services/LookupServer/ConnectionFromClient.cpp b/Userland/Services/LookupServer/ConnectionFromClient.cpp
index 2b3f68e8a5..6212e9af9e 100644
--- a/Userland/Services/LookupServer/ConnectionFromClient.cpp
+++ b/Userland/Services/LookupServer/ConnectionFromClient.cpp
@@ -44,7 +44,7 @@ Messages::LookupServer::LookupAddressResponse ConnectionFromClient::lookup_addre
{
if (address.length() != 4)
return { 1, String() };
- IPv4Address ip_address { (const u8*)address.characters() };
+ IPv4Address ip_address { (u8 const*)address.characters() };
auto name = String::formatted("{}.{}.{}.{}.in-addr.arpa",
ip_address[3],
ip_address[2],
diff --git a/Userland/Services/LookupServer/DNSAnswer.cpp b/Userland/Services/LookupServer/DNSAnswer.cpp
index 5479117581..06f8b516c0 100644
--- a/Userland/Services/LookupServer/DNSAnswer.cpp
+++ b/Userland/Services/LookupServer/DNSAnswer.cpp
@@ -10,7 +10,7 @@
namespace LookupServer {
-DNSAnswer::DNSAnswer(const DNSName& name, DNSRecordType type, DNSRecordClass class_code, u32 ttl, const String& record_data, bool mdns_cache_flush)
+DNSAnswer::DNSAnswer(DNSName const& name, DNSRecordType type, DNSRecordClass class_code, u32 ttl, String const& record_data, bool mdns_cache_flush)
: m_name(name)
, m_type(type)
, m_class_code(class_code)
diff --git a/Userland/Services/LookupServer/DNSAnswer.h b/Userland/Services/LookupServer/DNSAnswer.h
index 4cf3db4df6..4a65dad0db 100644
--- a/Userland/Services/LookupServer/DNSAnswer.h
+++ b/Userland/Services/LookupServer/DNSAnswer.h
@@ -33,15 +33,15 @@ enum class DNSRecordClass : u16 {
class DNSAnswer {
public:
- DNSAnswer(const DNSName& name, DNSRecordType type, DNSRecordClass class_code, u32 ttl, const String& record_data, bool mdns_cache_flush);
+ DNSAnswer(DNSName const& name, DNSRecordType type, DNSRecordClass class_code, u32 ttl, String const& record_data, bool mdns_cache_flush);
- const DNSName& name() const { return m_name; }
+ DNSName const& name() const { return m_name; }
DNSRecordType type() const { return m_type; }
DNSRecordClass class_code() const { return m_class_code; }
u16 raw_class_code() const { return (u16)m_class_code | (m_mdns_cache_flush ? MDNS_CACHE_FLUSH : 0); }
u32 ttl() const { return m_ttl; }
time_t received_time() const { return m_received_time; }
- const String& record_data() const { return m_record_data; }
+ String const& record_data() const { return m_record_data; }
bool mdns_cache_flush() const { return m_mdns_cache_flush; }
bool has_expired() const;
diff --git a/Userland/Services/LookupServer/DNSName.cpp b/Userland/Services/LookupServer/DNSName.cpp
index fde5575bca..a29cbec521 100644
--- a/Userland/Services/LookupServer/DNSName.cpp
+++ b/Userland/Services/LookupServer/DNSName.cpp
@@ -12,7 +12,7 @@
namespace LookupServer {
-DNSName::DNSName(const String& name)
+DNSName::DNSName(String const& name)
{
if (name.ends_with('.'))
m_name = name.substring(0, name.length() - 1);
@@ -20,7 +20,7 @@ DNSName::DNSName(const String& name)
m_name = name;
}
-DNSName DNSName::parse(const u8* data, size_t& offset, size_t max_offset, size_t recursion_level)
+DNSName DNSName::parse(u8 const* data, size_t& offset, size_t max_offset, size_t recursion_level)
{
if (recursion_level > 4)
return DNSName({});
@@ -45,7 +45,7 @@ DNSName DNSName::parse(const u8* data, size_t& offset, size_t max_offset, size_t
// This is the length of a part.
if (offset + b >= max_offset)
return DNSName({});
- builder.append((const char*)&data[offset], (size_t)b);
+ builder.append((char const*)&data[offset], (size_t)b);
builder.append('.');
offset += b;
}
@@ -75,7 +75,7 @@ void DNSName::randomize_case()
m_name = builder.to_string();
}
-OutputStream& operator<<(OutputStream& stream, const DNSName& name)
+OutputStream& operator<<(OutputStream& stream, DNSName const& name)
{
auto parts = name.as_string().split_view('.');
for (auto& part : parts) {
@@ -86,12 +86,12 @@ OutputStream& operator<<(OutputStream& stream, const DNSName& name)
return stream;
}
-unsigned DNSName::Traits::hash(const DNSName& name)
+unsigned DNSName::Traits::hash(DNSName const& name)
{
return CaseInsensitiveStringTraits::hash(name.as_string());
}
-bool DNSName::Traits::equals(const DNSName& a, const DNSName& b)
+bool DNSName::Traits::equals(DNSName const& a, DNSName const& b)
{
return CaseInsensitiveStringTraits::equals(a.as_string(), b.as_string());
}
diff --git a/Userland/Services/LookupServer/DNSName.h b/Userland/Services/LookupServer/DNSName.h
index 3a2cb4ba1d..375f61c1b7 100644
--- a/Userland/Services/LookupServer/DNSName.h
+++ b/Userland/Services/LookupServer/DNSName.h
@@ -14,28 +14,28 @@ namespace LookupServer {
class DNSName {
public:
- DNSName(const String&);
+ DNSName(String const&);
- static DNSName parse(const u8* data, size_t& offset, size_t max_offset, size_t recursion_level = 0);
+ static DNSName parse(u8 const* data, size_t& offset, size_t max_offset, size_t recursion_level = 0);
size_t serialized_size() const;
- const String& as_string() const { return m_name; }
+ String const& as_string() const { return m_name; }
void randomize_case();
- bool operator==(const DNSName& other) const { return Traits::equals(*this, other); }
+ bool operator==(DNSName const& other) const { return Traits::equals(*this, other); }
class Traits : public AK::Traits<DNSName> {
public:
- static unsigned hash(const DNSName& name);
- static bool equals(const DNSName&, const DNSName&);
+ static unsigned hash(DNSName const& name);
+ static bool equals(DNSName const&, DNSName const&);
};
private:
String m_name;
};
-OutputStream& operator<<(OutputStream& stream, const DNSName&);
+OutputStream& operator<<(OutputStream& stream, DNSName const&);
}
diff --git a/Userland/Services/LookupServer/DNSPacket.cpp b/Userland/Services/LookupServer/DNSPacket.cpp
index 47d89929d8..90753cde26 100644
--- a/Userland/Services/LookupServer/DNSPacket.cpp
+++ b/Userland/Services/LookupServer/DNSPacket.cpp
@@ -16,14 +16,14 @@
namespace LookupServer {
-void DNSPacket::add_question(const DNSQuestion& question)
+void DNSPacket::add_question(DNSQuestion const& question)
{
m_questions.empend(question);
VERIFY(m_questions.size() <= UINT16_MAX);
}
-void DNSPacket::add_answer(const DNSAnswer& answer)
+void DNSPacket::add_answer(DNSAnswer const& answer)
{
m_answers.empend(answer);
@@ -85,7 +85,7 @@ public:
u16 data_length() const { return m_data_length; }
void* data() { return this + 1; }
- const void* data() const { return this + 1; }
+ void const* data() const { return this + 1; }
private:
NetworkOrdered<u16> m_type;
@@ -96,14 +96,14 @@ private:
static_assert(sizeof(DNSRecordWithoutName) == 10);
-Optional<DNSPacket> DNSPacket::from_raw_packet(const u8* raw_data, size_t raw_size)
+Optional<DNSPacket> DNSPacket::from_raw_packet(u8 const* raw_data, size_t raw_size)
{
if (raw_size < sizeof(DNSPacketHeader)) {
dbgln("DNS response not large enough ({} out of {}) to be a DNS packet.", raw_size, sizeof(DNSPacketHeader));
return {};
}
- auto& header = *(const DNSPacketHeader*)(raw_data);
+ auto& header = *(DNSPacketHeader const*)(raw_data);
dbgln_if(LOOKUPSERVER_DEBUG, "Got packet (ID: {})", header.id());
dbgln_if(LOOKUPSERVER_DEBUG, " Question count: {}", header.question_count());
dbgln_if(LOOKUPSERVER_DEBUG, " Answer count: {}", header.answer_count());
@@ -127,7 +127,7 @@ Optional<DNSPacket> DNSPacket::from_raw_packet(const u8* raw_data, size_t raw_si
NetworkOrdered<u16> record_type;
NetworkOrdered<u16> class_code;
};
- auto& record_and_class = *(const RawDNSAnswerQuestion*)&raw_data[offset];
+ auto& record_and_class = *(RawDNSAnswerQuestion const*)&raw_data[offset];
u16 class_code = record_and_class.class_code & ~MDNS_WANTS_UNICAST_RESPONSE;
bool mdns_wants_unicast_response = record_and_class.class_code & MDNS_WANTS_UNICAST_RESPONSE;
packet.m_questions.empend(name, (DNSRecordType)(u16)record_and_class.record_type, (DNSRecordClass)class_code, mdns_wants_unicast_response);
@@ -139,7 +139,7 @@ Optional<DNSPacket> DNSPacket::from_raw_packet(const u8* raw_data, size_t raw_si
for (u16 i = 0; i < header.answer_count(); ++i) {
auto name = DNSName::parse(raw_data, offset, raw_size);
- auto& record = *(const DNSRecordWithoutName*)(&raw_data[offset]);
+ auto& record = *(DNSRecordWithoutName const*)(&raw_data[offset]);
String data;
diff --git a/Userland/Services/LookupServer/DNSPacket.h b/Userland/Services/LookupServer/DNSPacket.h
index 2d665ac10a..60225cec0c 100644
--- a/Userland/Services/LookupServer/DNSPacket.h
+++ b/Userland/Services/LookupServer/DNSPacket.h
@@ -24,7 +24,7 @@ class DNSPacket {
public:
DNSPacket() = default;
- static Optional<DNSPacket> from_raw_packet(const u8*, size_t);
+ static Optional<DNSPacket> from_raw_packet(u8 const*, size_t);
ByteBuffer to_byte_buffer() const;
bool is_query() const { return !m_query_or_response; }
@@ -41,8 +41,8 @@ public:
u16 id() const { return m_id; }
void set_id(u16 id) { m_id = id; }
- const Vector<DNSQuestion>& questions() const { return m_questions; }
- const Vector<DNSAnswer>& answers() const { return m_answers; }
+ Vector<DNSQuestion> const& questions() const { return m_questions; }
+ Vector<DNSAnswer> const& answers() const { return m_answers; }
u16 question_count() const
{
@@ -56,8 +56,8 @@ public:
return m_answers.size();
}
- void add_question(const DNSQuestion&);
- void add_answer(const DNSAnswer&);
+ void add_question(DNSQuestion const&);
+ void add_answer(DNSAnswer const&);
enum class Code : u8 {
NOERROR = 0,
diff --git a/Userland/Services/LookupServer/DNSPacketHeader.h b/Userland/Services/LookupServer/DNSPacketHeader.h
index a45602aa66..9b3f627122 100644
--- a/Userland/Services/LookupServer/DNSPacketHeader.h
+++ b/Userland/Services/LookupServer/DNSPacketHeader.h
@@ -72,7 +72,7 @@ public:
void set_additional_count(u16 w) { m_additional_count = w; }
void* payload() { return this + 1; }
- const void* payload() const { return this + 1; }
+ void const* payload() const { return this + 1; }
private:
NetworkOrdered<u16> m_id;
diff --git a/Userland/Services/LookupServer/DNSQuestion.h b/Userland/Services/LookupServer/DNSQuestion.h
index 89d5c76ff8..eaa83bb566 100644
--- a/Userland/Services/LookupServer/DNSQuestion.h
+++ b/Userland/Services/LookupServer/DNSQuestion.h
@@ -15,7 +15,7 @@ namespace LookupServer {
class DNSQuestion {
public:
- DNSQuestion(const DNSName& name, DNSRecordType record_type, DNSRecordClass class_code, bool mdns_wants_unicast_response)
+ DNSQuestion(DNSName const& name, DNSRecordType record_type, DNSRecordClass class_code, bool mdns_wants_unicast_response)
: m_name(name)
, m_record_type(record_type)
, m_class_code(class_code)
@@ -26,7 +26,7 @@ public:
DNSRecordType record_type() const { return m_record_type; }
DNSRecordClass class_code() const { return m_class_code; }
u16 raw_class_code() const { return (u16)m_class_code | (m_mdns_wants_unicast_response ? MDNS_WANTS_UNICAST_RESPONSE : 0); }
- const DNSName& name() const { return m_name; }
+ DNSName const& name() const { return m_name; }
bool mdns_wants_unicast_response() const { return m_mdns_wants_unicast_response; }
private:
diff --git a/Userland/Services/LookupServer/LookupServer.cpp b/Userland/Services/LookupServer/LookupServer.cpp
index 463f1b2782..e45bd6e697 100644
--- a/Userland/Services/LookupServer/LookupServer.cpp
+++ b/Userland/Services/LookupServer/LookupServer.cpp
@@ -78,7 +78,7 @@ LookupServer::LookupServer()
void LookupServer::load_etc_hosts()
{
m_etc_hosts.clear();
- auto add_answer = [this](const DNSName& name, DNSRecordType record_type, String data) {
+ auto add_answer = [this](DNSName const& name, DNSRecordType record_type, String data) {
m_etc_hosts.ensure(name).empend(name, record_type, DNSRecordClass::IN, s_static_ttl, move(data), false);
};
@@ -115,7 +115,7 @@ void LookupServer::load_etc_hosts()
auto raw_addr = maybe_address->to_in_addr_t();
DNSName name { fields[1] };
- add_answer(name, DNSRecordType::A, String { (const char*)&raw_addr, sizeof(raw_addr) });
+ add_answer(name, DNSRecordType::A, String { (char const*)&raw_addr, sizeof(raw_addr) });
StringBuilder builder;
builder.append(maybe_address->to_string_reversed());
@@ -131,12 +131,12 @@ static String get_hostname()
return buffer;
}
-ErrorOr<Vector<DNSAnswer>> LookupServer::lookup(const DNSName& name, DNSRecordType record_type)
+ErrorOr<Vector<DNSAnswer>> LookupServer::lookup(DNSName const& name, DNSRecordType record_type)
{
dbgln_if(LOOKUPSERVER_DEBUG, "Got request for '{}'", name.as_string());
Vector<DNSAnswer> answers;
- auto add_answer = [&](const DNSAnswer& answer) {
+ auto add_answer = [&](DNSAnswer const& answer) {
DNSAnswer answer_with_original_case {
name,
answer.type(),
@@ -163,7 +163,7 @@ ErrorOr<Vector<DNSAnswer>> LookupServer::lookup(const DNSName& name, DNSRecordTy
if (record_type == DNSRecordType::A && get_hostname() == name) {
IPv4Address address = { 127, 0, 0, 1 };
auto raw_address = address.to_in_addr_t();
- DNSAnswer answer { name, DNSRecordType::A, DNSRecordClass::IN, s_static_ttl, String { (const char*)&raw_address, sizeof(raw_address) }, false };
+ DNSAnswer answer { name, DNSRecordType::A, DNSRecordClass::IN, s_static_ttl, String { (char const*)&raw_address, sizeof(raw_address) }, false };
answers.append(move(answer));
return answers;
}
@@ -221,7 +221,7 @@ ErrorOr<Vector<DNSAnswer>> LookupServer::lookup(const DNSName& name, DNSRecordTy
return answers;
}
-ErrorOr<Vector<DNSAnswer>> LookupServer::lookup(const DNSName& name, const String& nameserver, bool& did_get_response, DNSRecordType record_type, ShouldRandomizeCase should_randomize_case)
+ErrorOr<Vector<DNSAnswer>> LookupServer::lookup(DNSName const& name, String const& nameserver, bool& did_get_response, DNSRecordType record_type, ShouldRandomizeCase should_randomize_case)
{
DNSPacket request;
request.set_is_query();
@@ -300,7 +300,7 @@ ErrorOr<Vector<DNSAnswer>> LookupServer::lookup(const DNSName& name, const Strin
return answers;
}
-void LookupServer::put_in_cache(const DNSAnswer& answer)
+void LookupServer::put_in_cache(DNSAnswer const& answer)
{
if (answer.has_expired())
return;
diff --git a/Userland/Services/LookupServer/LookupServer.h b/Userland/Services/LookupServer/LookupServer.h
index 88c7fcc740..6f5a90d904 100644
--- a/Userland/Services/LookupServer/LookupServer.h
+++ b/Userland/Services/LookupServer/LookupServer.h
@@ -24,15 +24,15 @@ class LookupServer final : public Core::Object {
public:
static LookupServer& the();
- ErrorOr<Vector<DNSAnswer>> lookup(const DNSName& name, DNSRecordType record_type);
+ ErrorOr<Vector<DNSAnswer>> lookup(DNSName const& name, DNSRecordType record_type);
private:
LookupServer();
void load_etc_hosts();
- void put_in_cache(const DNSAnswer&);
+ void put_in_cache(DNSAnswer const&);
- ErrorOr<Vector<DNSAnswer>> lookup(const DNSName& hostname, const String& nameserver, bool& did_get_response, DNSRecordType record_type, ShouldRandomizeCase = ShouldRandomizeCase::Yes);
+ ErrorOr<Vector<DNSAnswer>> lookup(DNSName const& hostname, String const& nameserver, bool& did_get_response, DNSRecordType record_type, ShouldRandomizeCase = ShouldRandomizeCase::Yes);
OwnPtr<IPC::MultiServer<ConnectionFromClient>> m_server;
RefPtr<DNSServer> m_dns_server;
diff --git a/Userland/Services/LookupServer/MulticastDNS.cpp b/Userland/Services/LookupServer/MulticastDNS.cpp
index 6f01c7acaf..b7b4a4490e 100644
--- a/Userland/Services/LookupServer/MulticastDNS.cpp
+++ b/Userland/Services/LookupServer/MulticastDNS.cpp
@@ -64,7 +64,7 @@ void MulticastDNS::handle_packet()
handle_query(packet);
}
-void MulticastDNS::handle_query(const DNSPacket& packet)
+void MulticastDNS::handle_query(DNSPacket const& packet)
{
bool should_reply = false;
@@ -94,7 +94,7 @@ void MulticastDNS::announce()
DNSRecordType::A,
DNSRecordClass::IN,
120,
- String { (const char*)&raw_addr, sizeof(raw_addr) },
+ String { (char const*)&raw_addr, sizeof(raw_addr) },
true,
};
response.add_answer(answer);
@@ -104,7 +104,7 @@ void MulticastDNS::announce()
perror("Failed to emit response packet");
}
-ErrorOr<size_t> MulticastDNS::emit_packet(const DNSPacket& packet, const sockaddr_in* destination)
+ErrorOr<size_t> MulticastDNS::emit_packet(DNSPacket const& packet, sockaddr_in const* destination)
{
auto buffer = packet.to_byte_buffer();
if (!destination)
@@ -142,7 +142,7 @@ Vector<IPv4Address> MulticastDNS::local_addresses() const
return addresses;
}
-Vector<DNSAnswer> MulticastDNS::lookup(const DNSName& name, DNSRecordType record_type)
+Vector<DNSAnswer> MulticastDNS::lookup(DNSName const& name, DNSRecordType record_type)
{
DNSPacket request;
request.set_is_query();
diff --git a/Userland/Services/LookupServer/MulticastDNS.h b/Userland/Services/LookupServer/MulticastDNS.h
index 37b98db9bd..23fc71d430 100644
--- a/Userland/Services/LookupServer/MulticastDNS.h
+++ b/Userland/Services/LookupServer/MulticastDNS.h
@@ -18,16 +18,16 @@ namespace LookupServer {
class MulticastDNS : public Core::UDPServer {
C_OBJECT(MulticastDNS)
public:
- Vector<DNSAnswer> lookup(const DNSName&, DNSRecordType record_type);
+ Vector<DNSAnswer> lookup(DNSName const&, DNSRecordType record_type);
private:
explicit MulticastDNS(Object* parent = nullptr);
void announce();
- ErrorOr<size_t> emit_packet(const DNSPacket&, const sockaddr_in* destination = nullptr);
+ ErrorOr<size_t> emit_packet(DNSPacket const&, sockaddr_in const* destination = nullptr);
void handle_packet();
- void handle_query(const DNSPacket&);
+ void handle_query(DNSPacket const&);
Vector<IPv4Address> local_addresses() const;
diff --git a/Userland/Services/NotificationServer/NotificationWindow.cpp b/Userland/Services/NotificationServer/NotificationWindow.cpp
index 0c87849ce8..7ab7847c97 100644
--- a/Userland/Services/NotificationServer/NotificationWindow.cpp
+++ b/Userland/Services/NotificationServer/NotificationWindow.cpp
@@ -19,7 +19,7 @@ namespace NotificationServer {
static HashMap<u32, RefPtr<NotificationWindow>> s_windows;
-static void update_notification_window_locations(const Gfx::IntRect& screen_rect)
+static void update_notification_window_locations(Gfx::IntRect const& screen_rect)
{
Gfx::IntRect last_window_rect;
for (auto& window_entry : s_windows) {
@@ -37,7 +37,7 @@ static void update_notification_window_locations(const Gfx::IntRect& screen_rect
}
}
-NotificationWindow::NotificationWindow(i32 client_id, const String& text, const String& title, const Gfx::ShareableBitmap& icon)
+NotificationWindow::NotificationWindow(i32 client_id, String const& text, String const& title, Gfx::ShareableBitmap const& icon)
{
m_id = client_id;
s_windows.set(m_id, this);
diff --git a/Userland/Services/NotificationServer/NotificationWindow.h b/Userland/Services/NotificationServer/NotificationWindow.h
index a6ca12686b..cae0bd505a 100644
--- a/Userland/Services/NotificationServer/NotificationWindow.h
+++ b/Userland/Services/NotificationServer/NotificationWindow.h
@@ -18,9 +18,9 @@ public:
virtual ~NotificationWindow() override = default;
void set_original_rect(Gfx::IntRect original_rect) { m_original_rect = original_rect; };
- void set_text(const String&);
- void set_title(const String&);
- void set_image(const Gfx::ShareableBitmap&);
+ void set_text(String const&);
+ void set_title(String const&);
+ void set_image(Gfx::ShareableBitmap const&);
static RefPtr<NotificationWindow> get_window_by_id(i32 id);
@@ -29,7 +29,7 @@ protected:
virtual void leave_event(Core::Event&) override;
private:
- NotificationWindow(i32 client_id, const String& text, const String& title, const Gfx::ShareableBitmap&);
+ NotificationWindow(i32 client_id, String const& text, String const& title, Gfx::ShareableBitmap const&);
virtual void screen_rects_change_event(GUI::ScreenRectsChangeEvent&) override;
diff --git a/Userland/Services/RequestServer/GeminiProtocol.cpp b/Userland/Services/RequestServer/GeminiProtocol.cpp
index 2232e67635..befe40903d 100644
--- a/Userland/Services/RequestServer/GeminiProtocol.cpp
+++ b/Userland/Services/RequestServer/GeminiProtocol.cpp
@@ -17,7 +17,7 @@ GeminiProtocol::GeminiProtocol()
{
}
-OwnPtr<Request> GeminiProtocol::start_request(ConnectionFromClient& client, const String&, const URL& url, const HashMap<String, String>&, ReadonlyBytes)
+OwnPtr<Request> GeminiProtocol::start_request(ConnectionFromClient& client, String const&, const URL& url, HashMap<String, String> const&, ReadonlyBytes)
{
Gemini::GeminiRequest request;
request.set_url(url);
diff --git a/Userland/Services/RequestServer/GeminiProtocol.h b/Userland/Services/RequestServer/GeminiProtocol.h
index 37d0e35091..4ecf29a070 100644
--- a/Userland/Services/RequestServer/GeminiProtocol.h
+++ b/Userland/Services/RequestServer/GeminiProtocol.h
@@ -15,7 +15,7 @@ public:
GeminiProtocol();
virtual ~GeminiProtocol() override = default;
- virtual OwnPtr<Request> start_request(ConnectionFromClient&, const String& method, const URL&, const HashMap<String, String>&, ReadonlyBytes body) override;
+ virtual OwnPtr<Request> start_request(ConnectionFromClient&, String const& method, const URL&, HashMap<String, String> const&, ReadonlyBytes body) override;
};
}
diff --git a/Userland/Services/RequestServer/HttpCommon.h b/Userland/Services/RequestServer/HttpCommon.h
index f7bd86b9d5..7ea0a18573 100644
--- a/Userland/Services/RequestServer/HttpCommon.h
+++ b/Userland/Services/RequestServer/HttpCommon.h
@@ -61,7 +61,7 @@ void init(TSelf* self, TJob job)
}
template<typename TBadgedProtocol, typename TPipeResult>
-OwnPtr<Request> start_request(TBadgedProtocol&& protocol, ConnectionFromClient& client, const String& method, const URL& url, const HashMap<String, String>& headers, ReadonlyBytes body, TPipeResult&& pipe_result)
+OwnPtr<Request> start_request(TBadgedProtocol&& protocol, ConnectionFromClient& client, String const& method, const URL& url, HashMap<String, String> const& headers, ReadonlyBytes body, TPipeResult&& pipe_result)
{
using TJob = typename TBadgedProtocol::Type::JobType;
using TRequest = typename TBadgedProtocol::Type::RequestType;
diff --git a/Userland/Services/RequestServer/HttpProtocol.cpp b/Userland/Services/RequestServer/HttpProtocol.cpp
index 4778547a97..fdfc4971d5 100644
--- a/Userland/Services/RequestServer/HttpProtocol.cpp
+++ b/Userland/Services/RequestServer/HttpProtocol.cpp
@@ -22,7 +22,7 @@ HttpProtocol::HttpProtocol()
{
}
-OwnPtr<Request> HttpProtocol::start_request(ConnectionFromClient& client, const String& method, const URL& url, const HashMap<String, String>& headers, ReadonlyBytes body)
+OwnPtr<Request> HttpProtocol::start_request(ConnectionFromClient& client, String const& method, const URL& url, HashMap<String, String> const& headers, ReadonlyBytes body)
{
return Detail::start_request(Badge<HttpProtocol> {}, client, method, url, headers, body, get_pipe_for_request());
}
diff --git a/Userland/Services/RequestServer/HttpProtocol.h b/Userland/Services/RequestServer/HttpProtocol.h
index cfedf92cfe..012e6bc033 100644
--- a/Userland/Services/RequestServer/HttpProtocol.h
+++ b/Userland/Services/RequestServer/HttpProtocol.h
@@ -27,7 +27,7 @@ public:
HttpProtocol();
~HttpProtocol() override = default;
- virtual OwnPtr<Request> start_request(ConnectionFromClient&, const String& method, const URL&, const HashMap<String, String>& headers, ReadonlyBytes body) override;
+ virtual OwnPtr<Request> start_request(ConnectionFromClient&, String const& method, const URL&, HashMap<String, String> const& headers, ReadonlyBytes body) override;
};
}
diff --git a/Userland/Services/RequestServer/HttpsProtocol.cpp b/Userland/Services/RequestServer/HttpsProtocol.cpp
index 5cd18ca74a..0580bff44b 100644
--- a/Userland/Services/RequestServer/HttpsProtocol.cpp
+++ b/Userland/Services/RequestServer/HttpsProtocol.cpp
@@ -22,7 +22,7 @@ HttpsProtocol::HttpsProtocol()
{
}
-OwnPtr<Request> HttpsProtocol::start_request(ConnectionFromClient& client, const String& method, const URL& url, const HashMap<String, String>& headers, ReadonlyBytes body)
+OwnPtr<Request> HttpsProtocol::start_request(ConnectionFromClient& client, String const& method, const URL& url, HashMap<String, String> const& headers, ReadonlyBytes body)
{
return Detail::start_request(Badge<HttpsProtocol> {}, client, method, url, headers, body, get_pipe_for_request());
}
diff --git a/Userland/Services/RequestServer/HttpsProtocol.h b/Userland/Services/RequestServer/HttpsProtocol.h
index 6c13cd76f2..c1083b684a 100644
--- a/Userland/Services/RequestServer/HttpsProtocol.h
+++ b/Userland/Services/RequestServer/HttpsProtocol.h
@@ -27,7 +27,7 @@ public:
HttpsProtocol();
~HttpsProtocol() override = default;
- virtual OwnPtr<Request> start_request(ConnectionFromClient&, const String& method, const URL&, const HashMap<String, String>& headers, ReadonlyBytes body) override;
+ virtual OwnPtr<Request> start_request(ConnectionFromClient&, String const& method, const URL&, HashMap<String, String> const& headers, ReadonlyBytes body) override;
};
}
diff --git a/Userland/Services/RequestServer/Protocol.cpp b/Userland/Services/RequestServer/Protocol.cpp
index c7b385b22d..f9f2fe1692 100644
--- a/Userland/Services/RequestServer/Protocol.cpp
+++ b/Userland/Services/RequestServer/Protocol.cpp
@@ -19,12 +19,12 @@ static HashMap<String, Protocol*>& all_protocols()
return map;
}
-Protocol* Protocol::find_by_name(const String& name)
+Protocol* Protocol::find_by_name(String const& name)
{
return all_protocols().get(name).value_or(nullptr);
}
-Protocol::Protocol(const String& name)
+Protocol::Protocol(String const& name)
{
all_protocols().set(name, this);
}
diff --git a/Userland/Services/RequestServer/Protocol.h b/Userland/Services/RequestServer/Protocol.h
index cd8a969c32..e0ab1493fc 100644
--- a/Userland/Services/RequestServer/Protocol.h
+++ b/Userland/Services/RequestServer/Protocol.h
@@ -16,13 +16,13 @@ class Protocol {
public:
virtual ~Protocol();
- const String& name() const { return m_name; }
- virtual OwnPtr<Request> start_request(ConnectionFromClient&, const String& method, const URL&, const HashMap<String, String>& headers, ReadonlyBytes body) = 0;
+ String const& name() const { return m_name; }
+ virtual OwnPtr<Request> start_request(ConnectionFromClient&, String const& method, const URL&, HashMap<String, String> const& headers, ReadonlyBytes body) = 0;
- static Protocol* find_by_name(const String&);
+ static Protocol* find_by_name(String const&);
protected:
- explicit Protocol(const String& name);
+ explicit Protocol(String const& name);
struct Pipe {
int read_fd { -1 };
int write_fd { -1 };
diff --git a/Userland/Services/RequestServer/Request.cpp b/Userland/Services/RequestServer/Request.cpp
index f733115ee1..752a3c2b9a 100644
--- a/Userland/Services/RequestServer/Request.cpp
+++ b/Userland/Services/RequestServer/Request.cpp
@@ -24,7 +24,7 @@ void Request::stop()
m_client.did_finish_request({}, *this, false);
}
-void Request::set_response_headers(const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers)
+void Request::set_response_headers(HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers)
{
m_response_headers = response_headers;
m_client.did_receive_headers({}, *this);
diff --git a/Userland/Services/RequestServer/Request.h b/Userland/Services/RequestServer/Request.h
index 8c16399463..562e8254c9 100644
--- a/Userland/Services/RequestServer/Request.h
+++ b/Userland/Services/RequestServer/Request.h
@@ -26,7 +26,7 @@ public:
Optional<u32> status_code() const { return m_status_code; }
Optional<u32> total_size() const { return m_total_size; }
size_t downloaded_size() const { return m_downloaded_size; }
- const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers() const { return m_response_headers; }
+ HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers() const { return m_response_headers; }
void stop();
virtual void set_certificate(String, String);
@@ -39,9 +39,9 @@ public:
void did_progress(Optional<u32> total_size, u32 downloaded_size);
void set_status_code(u32 status_code) { m_status_code = status_code; }
void did_request_certificates();
- void set_response_headers(const HashMap<String, String, CaseInsensitiveStringTraits>&);
+ void set_response_headers(HashMap<String, String, CaseInsensitiveStringTraits> const&);
void set_downloaded_size(size_t size) { m_downloaded_size = size; }
- const Core::Stream::File& output_stream() const { return *m_output_stream; }
+ Core::Stream::File const& output_stream() const { return *m_output_stream; }
protected:
explicit Request(ConnectionFromClient&, NonnullOwnPtr<Core::Stream::File>&&);
diff --git a/Userland/Services/SpiceAgent/SpiceAgent.cpp b/Userland/Services/SpiceAgent/SpiceAgent.cpp
index 38919ed138..2e39f330f8 100644
--- a/Userland/Services/SpiceAgent/SpiceAgent.cpp
+++ b/Userland/Services/SpiceAgent/SpiceAgent.cpp
@@ -41,7 +41,7 @@ SpiceAgent::SpiceAgent(int fd, ConnectionToClipboardServer& connection)
send_message(buffer);
}
-Optional<SpiceAgent::ClipboardType> SpiceAgent::mime_type_to_clipboard_type(const String& mime)
+Optional<SpiceAgent::ClipboardType> SpiceAgent::mime_type_to_clipboard_type(String const& mime)
{
if (mime == "text/plain")
return ClipboardType::Text;
@@ -120,7 +120,7 @@ void SpiceAgent::on_message_received()
auto type = (ClipboardType)clipboard_message->type;
auto data_buffer = ByteBuffer::create_uninitialized(message->size - sizeof(u32)).release_value_but_fixme_should_propagate_errors(); // FIXME: Handle possible OOM situation.
- const auto total_bytes = message->size - sizeof(Clipboard);
+ auto const total_bytes = message->size - sizeof(Clipboard);
auto bytes_copied = header.size - sizeof(Message) - sizeof(Clipboard);
memcpy(data_buffer.data(), clipboard_message->data, bytes_copied);
@@ -206,7 +206,7 @@ SpiceAgent::Message* SpiceAgent::initialize_headers(u8* data, size_t additional_
return message;
}
-ByteBuffer SpiceAgent::AnnounceCapabilities::make_buffer(bool request, const Vector<Capability>& capabilities)
+ByteBuffer SpiceAgent::AnnounceCapabilities::make_buffer(bool request, Vector<Capability> const& capabilities)
{
size_t required_size = sizeof(ChunkHeader) + sizeof(Message) + sizeof(AnnounceCapabilities);
auto buffer = ByteBuffer::create_uninitialized(required_size).release_value_but_fixme_should_propagate_errors(); // FIXME: Handle possible OOM situation.
@@ -226,7 +226,7 @@ ByteBuffer SpiceAgent::AnnounceCapabilities::make_buffer(bool request, const Vec
return buffer;
}
-ByteBuffer SpiceAgent::ClipboardGrab::make_buffer(const Vector<ClipboardType>& types)
+ByteBuffer SpiceAgent::ClipboardGrab::make_buffer(Vector<ClipboardType> const& types)
{
VERIFY(types.size() > 0);
size_t variable_data_size = sizeof(u32) * types.size();
diff --git a/Userland/Services/SpiceAgent/SpiceAgent.h b/Userland/Services/SpiceAgent/SpiceAgent.h
index 44c5474395..9ef81d7ed1 100644
--- a/Userland/Services/SpiceAgent/SpiceAgent.h
+++ b/Userland/Services/SpiceAgent/SpiceAgent.h
@@ -92,7 +92,7 @@ public:
u32 request;
u32 caps[CAPABILITIES_SIZE];
- static ByteBuffer make_buffer(bool request, const Vector<Capability>& capabilities);
+ static ByteBuffer make_buffer(bool request, Vector<Capability> const& capabilities);
};
struct [[gnu::packed]] ClipboardGrab {
@@ -120,9 +120,9 @@ private:
ConnectionToClipboardServer& m_clipboard_connection;
void on_message_received();
- void send_message(const ByteBuffer& buffer);
+ void send_message(ByteBuffer const& buffer);
bool m_just_set_clip { false };
void read_n(void* dest, size_t n);
static Message* initialize_headers(u8* data, size_t additional_data_size, MessageType type);
- static Optional<ClipboardType> mime_type_to_clipboard_type(const String& mime);
+ static Optional<ClipboardType> mime_type_to_clipboard_type(String const& mime);
};
diff --git a/Userland/Services/SystemServer/Service.cpp b/Userland/Services/SystemServer/Service.cpp
index df8b50b3e1..4147595966 100644
--- a/Userland/Services/SystemServer/Service.cpp
+++ b/Userland/Services/SystemServer/Service.cpp
@@ -61,7 +61,7 @@ void Service::setup_socket(SocketDescriptor& socket)
auto un = un_optional.value();
// FIXME: Propagate errors
- MUST(Core::System::bind(socket_fd, (const sockaddr*)&un, sizeof(un)));
+ MUST(Core::System::bind(socket_fd, (sockaddr const*)&un, sizeof(un)));
// FIXME: Propagate errors
MUST(Core::System::listen(socket_fd, 16));
}
@@ -270,7 +270,7 @@ void Service::did_exit(int exit_code)
activate();
}
-Service::Service(const Core::ConfigFile& config, StringView name)
+Service::Service(Core::ConfigFile const& config, StringView name)
: Core::Object(nullptr)
{
VERIFY(config.has_group(name));
diff --git a/Userland/Services/SystemServer/Service.h b/Userland/Services/SystemServer/Service.h
index dcc22a7244..cccd691efe 100644
--- a/Userland/Services/SystemServer/Service.h
+++ b/Userland/Services/SystemServer/Service.h
@@ -27,7 +27,7 @@ public:
void save_to(JsonObject&);
private:
- Service(const Core::ConfigFile&, StringView name);
+ Service(Core::ConfigFile const&, StringView name);
void spawn(int socket_fd = -1);
diff --git a/Userland/Services/SystemServer/main.cpp b/Userland/Services/SystemServer/main.cpp
index 97c07259f0..a593b6d8d3 100644
--- a/Userland/Services/SystemServer/main.cpp
+++ b/Userland/Services/SystemServer/main.cpp
@@ -85,14 +85,14 @@ static ErrorOr<void> determine_system_mode()
return {};
}
-static void chown_wrapper(const char* path, uid_t uid, gid_t gid)
+static void chown_wrapper(char const* path, uid_t uid, gid_t gid)
{
int rc = chown(path, uid, gid);
if (rc < 0 && errno != ENOENT) {
VERIFY_NOT_REACHED();
}
}
-static void chmod_wrapper(const char* path, mode_t mode)
+static void chmod_wrapper(char const* path, mode_t mode)
{
int rc = chmod(path, mode);
if (rc < 0 && errno != ENOENT) {
diff --git a/Userland/Services/Taskbar/ClockWidget.cpp b/Userland/Services/Taskbar/ClockWidget.cpp
index 97708de897..87a0282530 100644
--- a/Userland/Services/Taskbar/ClockWidget.cpp
+++ b/Userland/Services/Taskbar/ClockWidget.cpp
@@ -169,11 +169,11 @@ void ClockWidget::paint_event(GUI::PaintEvent& event)
// Render string center-left aligned, but attempt to center the string based on a constant
// "ideal" time string (i.e., the same one used to size this widget in the initializer).
// This prevents the rest of the string from shifting around while seconds tick.
- const Gfx::Font& font = Gfx::FontDatabase::default_font();
- const int frame_width = frame_thickness();
- const int ideal_width = m_time_width;
- const int widget_width = max_width();
- const int translation_x = (widget_width - ideal_width) / 2 - frame_width;
+ Gfx::Font const& font = Gfx::FontDatabase::default_font();
+ int const frame_width = frame_thickness();
+ int const ideal_width = m_time_width;
+ int const widget_width = max_width();
+ int const translation_x = (widget_width - ideal_width) / 2 - frame_width;
painter.draw_text(frame_inner_rect().translated(translation_x, frame_width), time_text, font, Gfx::TextAlignment::CenterLeft, palette().window_text());
}
diff --git a/Userland/Services/Taskbar/ShutdownDialog.cpp b/Userland/Services/Taskbar/ShutdownDialog.cpp
index 1a11985198..45af703058 100644
--- a/Userland/Services/Taskbar/ShutdownDialog.cpp
+++ b/Userland/Services/Taskbar/ShutdownDialog.cpp
@@ -23,7 +23,7 @@ struct Option {
bool default_action;
};
-static const Vector<Option> options = {
+static Vector<Option> const options = {
{ "Power off computer", { "/bin/shutdown", "--now", nullptr }, true, true },
{ "Reboot", { "/bin/reboot", nullptr }, true, false },
{ "Log out", { "/bin/logout", nullptr }, true, false },
diff --git a/Userland/Services/Taskbar/TaskbarButton.cpp b/Userland/Services/Taskbar/TaskbarButton.cpp
index 94a01ed82a..00f4c0a6af 100644
--- a/Userland/Services/Taskbar/TaskbarButton.cpp
+++ b/Userland/Services/Taskbar/TaskbarButton.cpp
@@ -14,7 +14,7 @@
#include <LibGfx/Palette.h>
#include <LibGfx/StylePainter.h>
-TaskbarButton::TaskbarButton(const WindowIdentifier& identifier)
+TaskbarButton::TaskbarButton(WindowIdentifier const& identifier)
: m_identifier(identifier)
{
}
@@ -49,7 +49,7 @@ void TaskbarButton::resize_event(GUI::ResizeEvent& event)
return GUI::Button::resize_event(event);
}
-static void paint_custom_progressbar(GUI::Painter& painter, const Gfx::IntRect& rect, const Gfx::IntRect& text_rect, const Palette& palette, int min, int max, int value, StringView text, const Gfx::Font& font, Gfx::TextAlignment text_alignment)
+static void paint_custom_progressbar(GUI::Painter& painter, Gfx::IntRect const& rect, Gfx::IntRect const& text_rect, Palette const& palette, int min, int max, int value, StringView text, Gfx::Font const& font, Gfx::TextAlignment text_alignment)
{
float range_size = max - min;
float progress = (value - min) / range_size;
diff --git a/Userland/Services/Taskbar/TaskbarButton.h b/Userland/Services/Taskbar/TaskbarButton.h
index 1947a92bd8..e766803dc8 100644
--- a/Userland/Services/Taskbar/TaskbarButton.h
+++ b/Userland/Services/Taskbar/TaskbarButton.h
@@ -18,7 +18,7 @@ public:
void clear_taskbar_rect();
private:
- explicit TaskbarButton(const WindowIdentifier&);
+ explicit TaskbarButton(WindowIdentifier const&);
virtual void context_menu_event(GUI::ContextMenuEvent&) override;
virtual void resize_event(GUI::ResizeEvent&) override;
diff --git a/Userland/Services/Taskbar/TaskbarWindow.cpp b/Userland/Services/Taskbar/TaskbarWindow.cpp
index dbae8ac3c8..e3cf43dcf8 100644
--- a/Userland/Services/Taskbar/TaskbarWindow.cpp
+++ b/Userland/Services/Taskbar/TaskbarWindow.cpp
@@ -104,9 +104,9 @@ void TaskbarWindow::show_desktop_button_clicked(unsigned)
GUI::ConnectionToWindowMangerServer::the().async_toggle_show_desktop();
}
-void TaskbarWindow::on_screen_rects_change(const Vector<Gfx::IntRect, 4>& rects, size_t main_screen_index)
+void TaskbarWindow::on_screen_rects_change(Vector<Gfx::IntRect, 4> const& rects, size_t main_screen_index)
{
- const auto& rect = rects[main_screen_index];
+ auto const& rect = rects[main_screen_index];
Gfx::IntRect new_rect { rect.x(), rect.bottom() - taskbar_height() + 1, rect.width(), taskbar_height() };
set_rect(new_rect);
update_applet_area();
@@ -123,7 +123,7 @@ void TaskbarWindow::update_applet_area()
GUI::ConnectionToWindowMangerServer::the().async_set_applet_area_position(new_rect.location());
}
-NonnullRefPtr<GUI::Button> TaskbarWindow::create_button(const WindowIdentifier& identifier)
+NonnullRefPtr<GUI::Button> TaskbarWindow::create_button(WindowIdentifier const& identifier)
{
auto& button = m_task_button_container->add<TaskbarButton>(identifier);
button.set_min_size(20, 21);
@@ -133,7 +133,7 @@ NonnullRefPtr<GUI::Button> TaskbarWindow::create_button(const WindowIdentifier&
return button;
}
-void TaskbarWindow::add_window_button(::Window& window, const WindowIdentifier& identifier)
+void TaskbarWindow::add_window_button(::Window& window, WindowIdentifier const& identifier)
{
if (window.button())
return;
@@ -200,7 +200,7 @@ void TaskbarWindow::event(Core::Event& event)
// we adjust it so that the nearest button ends up being clicked anyways.
auto& mouse_event = static_cast<GUI::MouseEvent&>(event);
- const int ADJUSTMENT = 4;
+ int const ADJUSTMENT = 4;
auto adjusted_x = AK::clamp(mouse_event.x(), ADJUSTMENT, width() - ADJUSTMENT);
auto adjusted_y = AK::min(mouse_event.y(), height() - ADJUSTMENT);
Gfx::IntPoint adjusted_point = { adjusted_x, adjusted_y };
diff --git a/Userland/Services/Taskbar/TaskbarWindow.h b/Userland/Services/Taskbar/TaskbarWindow.h
index 813a0c61e4..bfc0ceb6fa 100644
--- a/Userland/Services/Taskbar/TaskbarWindow.h
+++ b/Userland/Services/Taskbar/TaskbarWindow.h
@@ -27,9 +27,9 @@ private:
explicit TaskbarWindow(NonnullRefPtr<GUI::Menu> start_menu);
static void show_desktop_button_clicked(unsigned);
void set_quick_launch_button_data(GUI::Button&, String const&, NonnullRefPtr<Desktop::AppFile>);
- void on_screen_rects_change(const Vector<Gfx::IntRect, 4>&, size_t);
- NonnullRefPtr<GUI::Button> create_button(const WindowIdentifier&);
- void add_window_button(::Window&, const WindowIdentifier&);
+ void on_screen_rects_change(Vector<Gfx::IntRect, 4> const&, size_t);
+ NonnullRefPtr<GUI::Button> create_button(WindowIdentifier const&);
+ void add_window_button(::Window&, WindowIdentifier const&);
void remove_window_button(::Window&, bool);
void update_window_button(::Window&, bool);
::Window* find_window_owner(::Window&) const;
diff --git a/Userland/Services/Taskbar/WindowIdentifier.h b/Userland/Services/Taskbar/WindowIdentifier.h
index 5313421419..98a5212240 100644
--- a/Userland/Services/Taskbar/WindowIdentifier.h
+++ b/Userland/Services/Taskbar/WindowIdentifier.h
@@ -20,7 +20,7 @@ public:
int client_id() const { return m_client_id; }
int window_id() const { return m_window_id; }
- bool operator==(const WindowIdentifier& other) const
+ bool operator==(WindowIdentifier const& other) const
{
return m_client_id == other.m_client_id && m_window_id == other.m_window_id;
}
@@ -38,6 +38,6 @@ private:
namespace AK {
template<>
struct Traits<WindowIdentifier> : public GenericTraits<WindowIdentifier> {
- static unsigned hash(const WindowIdentifier& w) { return pair_int_hash(w.client_id(), w.window_id()); }
+ static unsigned hash(WindowIdentifier const& w) { return pair_int_hash(w.client_id(), w.window_id()); }
};
}
diff --git a/Userland/Services/Taskbar/WindowList.cpp b/Userland/Services/Taskbar/WindowList.cpp
index 0af99bf5b0..e033aa9090 100644
--- a/Userland/Services/Taskbar/WindowList.cpp
+++ b/Userland/Services/Taskbar/WindowList.cpp
@@ -12,7 +12,7 @@ WindowList& WindowList::the()
return s_the;
}
-Window* WindowList::find_parent(const Window& window)
+Window* WindowList::find_parent(Window const& window)
{
if (!window.parent_identifier().is_valid())
return nullptr;
@@ -24,7 +24,7 @@ Window* WindowList::find_parent(const Window& window)
return nullptr;
}
-Window* WindowList::window(const WindowIdentifier& identifier)
+Window* WindowList::window(WindowIdentifier const& identifier)
{
auto it = m_windows.find(identifier);
if (it != m_windows.end())
@@ -32,7 +32,7 @@ Window* WindowList::window(const WindowIdentifier& identifier)
return nullptr;
}
-Window& WindowList::ensure_window(const WindowIdentifier& identifier)
+Window& WindowList::ensure_window(WindowIdentifier const& identifier)
{
auto it = m_windows.find(identifier);
if (it != m_windows.end())
@@ -43,7 +43,7 @@ Window& WindowList::ensure_window(const WindowIdentifier& identifier)
return window_ref;
}
-void WindowList::remove_window(const WindowIdentifier& identifier)
+void WindowList::remove_window(WindowIdentifier const& identifier)
{
m_windows.remove(identifier);
}
diff --git a/Userland/Services/Taskbar/WindowList.h b/Userland/Services/Taskbar/WindowList.h
index a297db1939..62065ca752 100644
--- a/Userland/Services/Taskbar/WindowList.h
+++ b/Userland/Services/Taskbar/WindowList.h
@@ -14,7 +14,7 @@
class Window {
public:
- explicit Window(const WindowIdentifier& identifier)
+ explicit Window(WindowIdentifier const& identifier)
: m_identifier(identifier)
{
}
@@ -25,16 +25,16 @@ public:
m_button->remove_from_parent();
}
- const WindowIdentifier& identifier() const { return m_identifier; }
+ WindowIdentifier const& identifier() const { return m_identifier; }
- void set_parent_identifier(const WindowIdentifier& parent_identifier) { m_parent_identifier = parent_identifier; }
- const WindowIdentifier& parent_identifier() const { return m_parent_identifier; }
+ void set_parent_identifier(WindowIdentifier const& parent_identifier) { m_parent_identifier = parent_identifier; }
+ WindowIdentifier const& parent_identifier() const { return m_parent_identifier; }
String title() const { return m_title; }
- void set_title(const String& title) { m_title = title; }
+ void set_title(String const& title) { m_title = title; }
Gfx::IntRect rect() const { return m_rect; }
- void set_rect(const Gfx::IntRect& rect) { m_rect = rect; }
+ void set_rect(Gfx::IntRect const& rect) { m_rect = rect; }
GUI::Button* button() { return m_button; }
void set_button(GUI::Button* button) { m_button = button; }
@@ -67,7 +67,7 @@ public:
Optional<int> progress() const { return m_progress; }
- const Gfx::Bitmap* icon() const { return m_icon.ptr(); }
+ Gfx::Bitmap const* icon() const { return m_icon.ptr(); }
private:
WindowIdentifier m_identifier;
@@ -95,10 +95,10 @@ public:
callback(*it.value);
}
- Window* find_parent(const Window&);
- Window* window(const WindowIdentifier&);
- Window& ensure_window(const WindowIdentifier&);
- void remove_window(const WindowIdentifier&);
+ Window* find_parent(Window const&);
+ Window* window(WindowIdentifier const&);
+ Window& ensure_window(WindowIdentifier const&);
+ void remove_window(WindowIdentifier const&);
private:
HashMap<WindowIdentifier, NonnullOwnPtr<Window>> m_windows;
diff --git a/Userland/Services/Taskbar/main.cpp b/Userland/Services/Taskbar/main.cpp
index aa62e6b38f..29b3eb5453 100644
--- a/Userland/Services/Taskbar/main.cpp
+++ b/Userland/Services/Taskbar/main.cpp
@@ -156,14 +156,14 @@ ErrorOr<NonnullRefPtr<GUI::Menu>> build_system_menu()
app_category_menus.set(category, category_menu);
};
- for (const auto& category : sorted_app_categories) {
+ for (auto const& category : sorted_app_categories) {
if (category != "Settings"sv)
create_category_menu(category);
}
// Then we create and insert all the app menu items into the right place.
int app_identifier = 0;
- for (const auto& app : g_apps) {
+ for (auto const& app : g_apps) {
if (app.category == "Settings"sv) {
++app_identifier;
continue;
diff --git a/Userland/Services/TelnetServer/Client.cpp b/Userland/Services/TelnetServer/Client.cpp
index aab4b4f7d0..d45800975c 100644
--- a/Userland/Services/TelnetServer/Client.cpp
+++ b/Userland/Services/TelnetServer/Client.cpp
@@ -39,7 +39,7 @@ Client::Client(int id, NonnullOwnPtr<Core::Stream::TCPSocket> socket, int ptm_fd
}
};
- m_parser.on_command = [this](const Command& command) {
+ m_parser.on_command = [this](Command const& command) {
auto result = handle_command(command);
if (result.is_error()) {
dbgln("Failed to handle the command: {}", result.error());
@@ -110,7 +110,7 @@ void Client::handle_data(StringView data)
write(m_ptm_fd, data.characters_without_null_termination(), data.length());
}
-ErrorOr<void> Client::handle_command(const Command& command)
+ErrorOr<void> Client::handle_command(Command const& command)
{
switch (command.command) {
case CMD_DO:
diff --git a/Userland/Services/TelnetServer/Parser.h b/Userland/Services/TelnetServer/Parser.h
index fdc416b336..de0990aed1 100644
--- a/Userland/Services/TelnetServer/Parser.h
+++ b/Userland/Services/TelnetServer/Parser.h
@@ -17,7 +17,7 @@
class Parser {
public:
- Function<void(const Command&)> on_command;
+ Function<void(Command const&)> on_command;
Function<void(StringView)> on_data;
Function<void()> on_error;
@@ -31,7 +31,7 @@ protected:
Error,
};
- void write(const String& str);
+ void write(String const& str);
private:
State m_state { State::Free };
diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp
index 6bd2887e70..a2c5891cae 100644
--- a/Userland/Services/WebContent/ConnectionFromClient.cpp
+++ b/Userland/Services/WebContent/ConnectionFromClient.cpp
@@ -51,12 +51,12 @@ Web::Page& ConnectionFromClient::page()
return m_page_host->page();
}
-const Web::Page& ConnectionFromClient::page() const
+Web::Page const& ConnectionFromClient::page() const
{
return m_page_host->page();
}
-void ConnectionFromClient::update_system_theme(const Core::AnonymousBuffer& theme_buffer)
+void ConnectionFromClient::update_system_theme(Core::AnonymousBuffer const& theme_buffer)
{
Gfx::set_system_theme(theme_buffer);
auto impl = Gfx::PaletteImpl::create_with_anonymous_buffer(theme_buffer);
@@ -69,7 +69,7 @@ void ConnectionFromClient::update_system_fonts(String const& default_font_query,
Gfx::FontDatabase::set_fixed_width_font_query(fixed_width_font_query);
}
-void ConnectionFromClient::update_screen_rects(const Vector<Gfx::IntRect>& rects, u32 main_screen)
+void ConnectionFromClient::update_screen_rects(Vector<Gfx::IntRect> const& rects, u32 main_screen)
{
m_page_host->set_screen_rects(rects, main_screen);
}
@@ -89,19 +89,19 @@ void ConnectionFromClient::load_url(const URL& url)
page().load(url);
}
-void ConnectionFromClient::load_html(const String& html, const URL& url)
+void ConnectionFromClient::load_html(String const& html, const URL& url)
{
dbgln_if(SPAM_DEBUG, "handle: WebContentServer::LoadHTML: html={}, url={}", html, url);
page().load_html(html, url);
}
-void ConnectionFromClient::set_viewport_rect(const Gfx::IntRect& rect)
+void ConnectionFromClient::set_viewport_rect(Gfx::IntRect const& rect)
{
dbgln_if(SPAM_DEBUG, "handle: WebContentServer::SetViewportRect: rect={}", rect);
m_page_host->set_viewport_rect(rect);
}
-void ConnectionFromClient::add_backing_store(i32 backing_store_id, const Gfx::ShareableBitmap& bitmap)
+void ConnectionFromClient::add_backing_store(i32 backing_store_id, Gfx::ShareableBitmap const& bitmap)
{
m_backing_stores.set(backing_store_id, *bitmap.bitmap());
}
@@ -111,7 +111,7 @@ void ConnectionFromClient::remove_backing_store(i32 backing_store_id)
m_backing_stores.remove(backing_store_id);
}
-void ConnectionFromClient::paint(const Gfx::IntRect& content_rect, i32 backing_store_id)
+void ConnectionFromClient::paint(Gfx::IntRect const& content_rect, i32 backing_store_id)
{
for (auto& pending_paint : m_pending_paint_requests) {
if (pending_paint.bitmap_id == backing_store_id) {
@@ -140,22 +140,22 @@ void ConnectionFromClient::flush_pending_paint_requests()
m_pending_paint_requests.clear();
}
-void ConnectionFromClient::mouse_down(const Gfx::IntPoint& position, unsigned int button, [[maybe_unused]] unsigned int buttons, unsigned int modifiers)
+void ConnectionFromClient::mouse_down(Gfx::IntPoint const& position, unsigned int button, [[maybe_unused]] unsigned int buttons, unsigned int modifiers)
{
page().handle_mousedown(position, button, modifiers);
}
-void ConnectionFromClient::mouse_move(const Gfx::IntPoint& position, [[maybe_unused]] unsigned int button, unsigned int buttons, unsigned int modifiers)
+void ConnectionFromClient::mouse_move(Gfx::IntPoint const& position, [[maybe_unused]] unsigned int button, unsigned int buttons, unsigned int modifiers)
{
page().handle_mousemove(position, buttons, modifiers);
}
-void ConnectionFromClient::mouse_up(const Gfx::IntPoint& position, unsigned int button, [[maybe_unused]] unsigned int buttons, unsigned int modifiers)
+void ConnectionFromClient::mouse_up(Gfx::IntPoint const& position, unsigned int button, [[maybe_unused]] unsigned int buttons, unsigned int modifiers)
{
page().handle_mouseup(position, button, modifiers);
}
-void ConnectionFromClient::mouse_wheel(const Gfx::IntPoint& position, unsigned int button, [[maybe_unused]] unsigned int buttons, unsigned int modifiers, i32 wheel_delta_x, i32 wheel_delta_y)
+void ConnectionFromClient::mouse_wheel(Gfx::IntPoint const& position, unsigned int button, [[maybe_unused]] unsigned int buttons, unsigned int modifiers, i32 wheel_delta_x, i32 wheel_delta_y)
{
page().handle_mousewheel(position, button, modifiers, wheel_delta_x, wheel_delta_y);
}
@@ -170,7 +170,7 @@ void ConnectionFromClient::key_up(i32 key, unsigned int modifiers, u32 code_poin
page().handle_keyup((KeyCode)key, modifiers, code_point);
}
-void ConnectionFromClient::debug_request(const String& request, const String& argument)
+void ConnectionFromClient::debug_request(String const& request, String const& argument)
{
if (request == "dump-dom-tree") {
if (auto* doc = page().top_level_browsing_context().active_document())
@@ -384,7 +384,7 @@ void ConnectionFromClient::initialize_js_console(Badge<PageHost>)
interpreter->global_object().console().set_client(*m_console_client.ptr());
}
-void ConnectionFromClient::js_console_input(const String& js_source)
+void ConnectionFromClient::js_console_input(String const& js_source)
{
if (m_console_client)
m_console_client->handle_input(js_source);
diff --git a/Userland/Services/WebContent/ConnectionFromClient.h b/Userland/Services/WebContent/ConnectionFromClient.h
index f0a4a3f34b..00063a939b 100644
--- a/Userland/Services/WebContent/ConnectionFromClient.h
+++ b/Userland/Services/WebContent/ConnectionFromClient.h
@@ -35,7 +35,7 @@ private:
explicit ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket>);
Web::Page& page();
- const Web::Page& page() const;
+ Web::Page const& page() const;
virtual void update_system_theme(Core::AnonymousBuffer const&) override;
virtual void update_system_fonts(String const&, String const&) override;
diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp
index de45226257..e7cd81d63b 100644
--- a/Userland/Services/WebContent/PageHost.cpp
+++ b/Userland/Services/WebContent/PageHost.cpp
@@ -50,7 +50,7 @@ Gfx::Palette PageHost::palette() const
return Gfx::Palette(*m_palette_impl);
}
-void PageHost::set_palette_impl(const Gfx::PaletteImpl& impl)
+void PageHost::set_palette_impl(Gfx::PaletteImpl const& impl)
{
m_palette_impl = impl;
}
@@ -75,7 +75,7 @@ Web::Layout::InitialContainingBlock* PageHost::layout_root()
return document->layout_node();
}
-void PageHost::paint(const Gfx::IntRect& content_rect, Gfx::Bitmap& target)
+void PageHost::paint(Gfx::IntRect const& content_rect, Gfx::Bitmap& target)
{
Gfx::Painter painter(target);
Gfx::IntRect bitmap_rect { {}, content_rect.size() };
@@ -96,7 +96,7 @@ void PageHost::paint(const Gfx::IntRect& content_rect, Gfx::Bitmap& target)
layout_root->paint_all_phases(context);
}
-void PageHost::set_viewport_rect(const Gfx::IntRect& rect)
+void PageHost::set_viewport_rect(Gfx::IntRect const& rect)
{
page().top_level_browsing_context().set_viewport_rect(rect);
}
@@ -130,7 +130,7 @@ void PageHost::page_did_layout()
m_client.async_did_layout(content_size);
}
-void PageHost::page_did_change_title(const String& title)
+void PageHost::page_did_change_title(String const& title)
{
m_client.async_did_change_title(title);
}
@@ -145,12 +145,12 @@ void PageHost::page_did_request_scroll_to(Gfx::IntPoint const& scroll_position)
m_client.async_did_request_scroll_to(scroll_position);
}
-void PageHost::page_did_request_scroll_into_view(const Gfx::IntRect& rect)
+void PageHost::page_did_request_scroll_into_view(Gfx::IntRect const& rect)
{
m_client.async_did_request_scroll_into_view(rect);
}
-void PageHost::page_did_enter_tooltip_area(const Gfx::IntPoint& content_position, const String& title)
+void PageHost::page_did_enter_tooltip_area(Gfx::IntPoint const& content_position, String const& title)
{
m_client.async_did_enter_tooltip_area(content_position, title);
}
@@ -170,12 +170,12 @@ void PageHost::page_did_unhover_link()
m_client.async_did_unhover_link();
}
-void PageHost::page_did_click_link(const URL& url, const String& target, unsigned modifiers)
+void PageHost::page_did_click_link(const URL& url, String const& target, unsigned modifiers)
{
m_client.async_did_click_link(url, target, modifiers);
}
-void PageHost::page_did_middle_click_link(const URL& url, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers)
+void PageHost::page_did_middle_click_link(const URL& url, [[maybe_unused]] String const& target, [[maybe_unused]] unsigned modifiers)
{
m_client.async_did_middle_click_link(url, target, modifiers);
}
@@ -193,17 +193,17 @@ void PageHost::page_did_finish_loading(const URL& url)
m_client.async_did_finish_loading(url);
}
-void PageHost::page_did_request_context_menu(const Gfx::IntPoint& content_position)
+void PageHost::page_did_request_context_menu(Gfx::IntPoint const& content_position)
{
m_client.async_did_request_context_menu(content_position);
}
-void PageHost::page_did_request_link_context_menu(const Gfx::IntPoint& content_position, const URL& url, const String& target, unsigned modifiers)
+void PageHost::page_did_request_link_context_menu(Gfx::IntPoint const& content_position, const URL& url, String const& target, unsigned modifiers)
{
m_client.async_did_request_link_context_menu(content_position, url, target, modifiers);
}
-void PageHost::page_did_request_alert(const String& message)
+void PageHost::page_did_request_alert(String const& message)
{
auto response = m_client.send_sync_but_allow_failure<Messages::WebContentClient::DidRequestAlert>(message);
if (!response) {
@@ -212,7 +212,7 @@ void PageHost::page_did_request_alert(const String& message)
}
}
-bool PageHost::page_did_request_confirm(const String& message)
+bool PageHost::page_did_request_confirm(String const& message)
{
auto response = m_client.send_sync_but_allow_failure<Messages::WebContentClient::DidRequestConfirm>(message);
if (!response) {
@@ -222,7 +222,7 @@ bool PageHost::page_did_request_confirm(const String& message)
return response->take_result();
}
-String PageHost::page_did_request_prompt(const String& message, const String& default_)
+String PageHost::page_did_request_prompt(String const& message, String const& default_)
{
auto response = m_client.send_sync_but_allow_failure<Messages::WebContentClient::DidRequestPrompt>(message, default_);
if (!response) {
@@ -232,12 +232,12 @@ String PageHost::page_did_request_prompt(const String& message, const String& de
return response->take_response();
}
-void PageHost::page_did_change_favicon(const Gfx::Bitmap& favicon)
+void PageHost::page_did_change_favicon(Gfx::Bitmap const& favicon)
{
m_client.async_did_change_favicon(favicon.to_shareable_bitmap());
}
-void PageHost::page_did_request_image_context_menu(const Gfx::IntPoint& content_position, const URL& url, const String& target, unsigned modifiers, const Gfx::Bitmap* bitmap_pointer)
+void PageHost::page_did_request_image_context_menu(Gfx::IntPoint const& content_position, const URL& url, String const& target, unsigned modifiers, Gfx::Bitmap const* bitmap_pointer)
{
auto bitmap = bitmap_pointer ? bitmap_pointer->to_shareable_bitmap() : Gfx::ShareableBitmap();
m_client.async_did_request_image_context_menu(content_position, url, target, modifiers, bitmap);
@@ -253,7 +253,7 @@ String PageHost::page_did_request_cookie(const URL& url, Web::Cookie::Source sou
return response->take_cookie();
}
-void PageHost::page_did_set_cookie(const URL& url, const Web::Cookie::ParsedCookie& cookie, Web::Cookie::Source source)
+void PageHost::page_did_set_cookie(const URL& url, Web::Cookie::ParsedCookie const& cookie, Web::Cookie::Source source)
{
m_client.async_did_set_cookie(url, cookie, static_cast<u8>(source));
}
diff --git a/Userland/Services/WebContent/PageHost.h b/Userland/Services/WebContent/PageHost.h
index 6ccc38d04c..a9815f2fec 100644
--- a/Userland/Services/WebContent/PageHost.h
+++ b/Userland/Services/WebContent/PageHost.h
@@ -22,13 +22,13 @@ public:
virtual ~PageHost() = default;
Web::Page& page() { return *m_page; }
- const Web::Page& page() const { return *m_page; }
+ Web::Page const& page() const { return *m_page; }
- void paint(const Gfx::IntRect& content_rect, Gfx::Bitmap&);
+ void paint(Gfx::IntRect const& content_rect, Gfx::Bitmap&);
- void set_palette_impl(const Gfx::PaletteImpl&);
- void set_viewport_rect(const Gfx::IntRect&);
- void set_screen_rects(const Vector<Gfx::IntRect, 4>& rects, size_t main_screen_index) { m_screen_rect = rects[main_screen_index]; };
+ void set_palette_impl(Gfx::PaletteImpl const&);
+ void set_viewport_rect(Gfx::IntRect const&);
+ void set_screen_rects(Vector<Gfx::IntRect, 4> const& rects, size_t main_screen_index) { m_screen_rect = rects[main_screen_index]; };
void set_preferred_color_scheme(Web::CSS::PreferredColorScheme);
void set_should_show_line_box_borders(bool b) { m_should_show_line_box_borders = b; }
@@ -40,31 +40,31 @@ private:
virtual Gfx::Palette palette() const override;
virtual Gfx::IntRect screen_rect() const override { return m_screen_rect; }
virtual Web::CSS::PreferredColorScheme preferred_color_scheme() const override { return m_preferred_color_scheme; }
- virtual void page_did_invalidate(const Gfx::IntRect&) override;
+ virtual void page_did_invalidate(Gfx::IntRect const&) override;
virtual void page_did_change_selection() override;
virtual void page_did_request_cursor_change(Gfx::StandardCursor) override;
virtual void page_did_layout() override;
- virtual void page_did_change_title(const String&) override;
+ virtual void page_did_change_title(String const&) override;
virtual void page_did_request_scroll(i32, i32) override;
virtual void page_did_request_scroll_to(Gfx::IntPoint const&) override;
- virtual void page_did_request_scroll_into_view(const Gfx::IntRect&) override;
- virtual void page_did_enter_tooltip_area(const Gfx::IntPoint&, const String&) override;
+ virtual void page_did_request_scroll_into_view(Gfx::IntRect const&) override;
+ virtual void page_did_enter_tooltip_area(Gfx::IntPoint const&, String const&) override;
virtual void page_did_leave_tooltip_area() override;
virtual void page_did_hover_link(const URL&) override;
virtual void page_did_unhover_link() override;
- virtual void page_did_click_link(const URL&, const String& target, unsigned modifiers) override;
- virtual void page_did_middle_click_link(const URL&, const String& target, unsigned modifiers) override;
- virtual void page_did_request_context_menu(const Gfx::IntPoint&) override;
- virtual void page_did_request_link_context_menu(const Gfx::IntPoint&, const URL&, const String& target, unsigned modifiers) override;
+ virtual void page_did_click_link(const URL&, String const& target, unsigned modifiers) override;
+ virtual void page_did_middle_click_link(const URL&, String const& target, unsigned modifiers) override;
+ virtual void page_did_request_context_menu(Gfx::IntPoint const&) override;
+ virtual void page_did_request_link_context_menu(Gfx::IntPoint const&, const URL&, String const& target, unsigned modifiers) override;
virtual void page_did_start_loading(const URL&) override;
virtual void page_did_finish_loading(const URL&) override;
- virtual void page_did_request_alert(const String&) override;
- virtual bool page_did_request_confirm(const String&) override;
- virtual String page_did_request_prompt(const String&, const String&) override;
- virtual void page_did_change_favicon(const Gfx::Bitmap&) override;
- virtual void page_did_request_image_context_menu(const Gfx::IntPoint&, const URL&, const String& target, unsigned modifiers, const Gfx::Bitmap*) override;
+ virtual void page_did_request_alert(String const&) override;
+ virtual bool page_did_request_confirm(String const&) override;
+ virtual String page_did_request_prompt(String const&, String const&) override;
+ virtual void page_did_change_favicon(Gfx::Bitmap const&) override;
+ virtual void page_did_request_image_context_menu(Gfx::IntPoint const&, const URL&, String const& target, unsigned modifiers, Gfx::Bitmap const*) override;
virtual String page_did_request_cookie(const URL&, Web::Cookie::Source) override;
- virtual void page_did_set_cookie(const URL&, const Web::Cookie::ParsedCookie&, Web::Cookie::Source) override;
+ virtual void page_did_set_cookie(const URL&, Web::Cookie::ParsedCookie const&, Web::Cookie::Source) override;
virtual void page_did_update_resource_count(i32) override;
explicit PageHost(ConnectionFromClient&);
diff --git a/Userland/Services/WindowServer/AppletManager.cpp b/Userland/Services/WindowServer/AppletManager.cpp
index c4a6c74e56..b3dc601af1 100644
--- a/Userland/Services/WindowServer/AppletManager.cpp
+++ b/Userland/Services/WindowServer/AppletManager.cpp
@@ -31,7 +31,7 @@ AppletManager& AppletManager::the()
return *s_the;
}
-void AppletManager::set_position(const Gfx::IntPoint& position)
+void AppletManager::set_position(Gfx::IntPoint const& position)
{
m_window->move_to(position);
m_window->set_visible(true);
@@ -169,7 +169,7 @@ void AppletManager::draw()
}
}
-void AppletManager::draw_applet(const Window& applet)
+void AppletManager::draw_applet(Window const& applet)
{
if (!applet.backing_store())
return;
@@ -181,7 +181,7 @@ void AppletManager::draw_applet(const Window& applet)
painter.blit(applet.rect_in_applet_area().location(), *applet.backing_store(), applet.backing_store()->rect());
}
-void AppletManager::invalidate_applet(const Window& applet, const Gfx::IntRect&)
+void AppletManager::invalidate_applet(Window const& applet, Gfx::IntRect const&)
{
draw_applet(applet);
draw();
diff --git a/Userland/Services/WindowServer/AppletManager.h b/Userland/Services/WindowServer/AppletManager.h
index 3fabbd4506..6bdfb6eadd 100644
--- a/Userland/Services/WindowServer/AppletManager.h
+++ b/Userland/Services/WindowServer/AppletManager.h
@@ -23,13 +23,13 @@ public:
void add_applet(Window& applet);
void remove_applet(Window& applet);
void draw();
- void invalidate_applet(const Window& applet, const Gfx::IntRect& rect);
+ void invalidate_applet(Window const& applet, Gfx::IntRect const& rect);
void relayout();
- void set_position(const Gfx::IntPoint&);
+ void set_position(Gfx::IntPoint const&);
Window* window() { return m_window; }
- const Window* window() const { return m_window; }
+ Window const* window() const { return m_window; }
void did_change_theme();
@@ -37,7 +37,7 @@ private:
AppletManager();
void repaint();
- void draw_applet(const Window& applet);
+ void draw_applet(Window const& applet);
void set_hovered_applet(Window*);
Vector<WeakPtr<Window>> m_applets;
diff --git a/Userland/Services/WindowServer/Button.cpp b/Userland/Services/WindowServer/Button.cpp
index 128d72aefc..ea05391042 100644
--- a/Userland/Services/WindowServer/Button.cpp
+++ b/Userland/Services/WindowServer/Button.cpp
@@ -38,7 +38,7 @@ void Button::paint(Screen& screen, Gfx::Painter& painter)
}
}
-void Button::on_mouse_event(const MouseEvent& event)
+void Button::on_mouse_event(MouseEvent const& event)
{
auto interesting_button = false;
diff --git a/Userland/Services/WindowServer/Button.h b/Userland/Services/WindowServer/Button.h
index 0b54211e6d..eed6bd290d 100644
--- a/Userland/Services/WindowServer/Button.h
+++ b/Userland/Services/WindowServer/Button.h
@@ -25,14 +25,14 @@ public:
~Button();
Gfx::IntRect relative_rect() const { return m_relative_rect; }
- void set_relative_rect(const Gfx::IntRect& rect) { m_relative_rect = rect; }
+ void set_relative_rect(Gfx::IntRect const& rect) { m_relative_rect = rect; }
Gfx::IntRect rect() const { return { {}, m_relative_rect.size() }; }
Gfx::IntRect screen_rect() const;
void paint(Screen&, Gfx::Painter&);
- void on_mouse_event(const MouseEvent&);
+ void on_mouse_event(MouseEvent const&);
Function<void(Button&)> on_click;
Function<void(Button&)> on_secondary_click;
@@ -40,7 +40,7 @@ public:
bool is_visible() const { return m_visible; }
- void set_icon(const RefPtr<MultiScaleBitmaps>& icon) { m_icon = icon; }
+ void set_icon(RefPtr<MultiScaleBitmaps> const& icon) { m_icon = icon; }
private:
WindowFrame& m_frame;
diff --git a/Userland/Services/WindowServer/Compositor.cpp b/Userland/Services/WindowServer/Compositor.cpp
index 2ca7f3ef52..d8abc2dd07 100644
--- a/Userland/Services/WindowServer/Compositor.cpp
+++ b/Userland/Services/WindowServer/Compositor.cpp
@@ -30,7 +30,7 @@ Compositor& Compositor::the()
return s_the;
}
-static WallpaperMode mode_to_enum(const String& name)
+static WallpaperMode mode_to_enum(String const& name)
{
if (name == "tile")
return WallpaperMode::Tile;
@@ -66,14 +66,14 @@ Compositor::Compositor()
init_bitmaps();
}
-const Gfx::Bitmap* Compositor::cursor_bitmap_for_screenshot(Badge<ConnectionFromClient>, Screen& screen) const
+Gfx::Bitmap const* Compositor::cursor_bitmap_for_screenshot(Badge<ConnectionFromClient>, Screen& screen) const
{
if (!m_current_cursor)
return nullptr;
return &m_current_cursor->bitmap(screen.scale_factor());
}
-const Gfx::Bitmap& Compositor::front_bitmap_for_screenshot(Badge<ConnectionFromClient>, Screen& screen) const
+Gfx::Bitmap const& Compositor::front_bitmap_for_screenshot(Badge<ConnectionFromClient>, Screen& screen) const
{
return *screen.compositor_screen_data().m_front_bitmap;
}
@@ -255,7 +255,7 @@ void Compositor::compose()
bool need_to_draw_cursor = false;
Gfx::IntRect previous_cursor_rect;
Screen* previous_cursor_screen = nullptr;
- auto check_restore_cursor_back = [&](Screen& screen, const Gfx::IntRect& rect) {
+ auto check_restore_cursor_back = [&](Screen& screen, Gfx::IntRect const& rect) {
if (&screen == &cursor_screen && !previous_cursor_screen && !need_to_draw_cursor && rect.intersects(cursor_rect)) {
// Restore what's behind the cursor if anything touches the area of the cursor
need_to_draw_cursor = true;
@@ -274,7 +274,7 @@ void Compositor::compose()
m_current_cursor_screen = &cursor_screen;
}
- auto prepare_rect = [&](Screen& screen, const Gfx::IntRect& rect) {
+ auto prepare_rect = [&](Screen& screen, Gfx::IntRect const& rect) {
auto& screen_data = screen.compositor_screen_data();
dbgln_if(COMPOSE_DEBUG, " -> flush opaque: {}", rect);
VERIFY(!screen_data.m_flush_rects.intersects(rect));
@@ -284,7 +284,7 @@ void Compositor::compose()
check_restore_cursor_back(screen, rect);
};
- auto prepare_transparency_rect = [&](Screen& screen, const Gfx::IntRect& rect) {
+ auto prepare_transparency_rect = [&](Screen& screen, Gfx::IntRect const& rect) {
auto& screen_data = screen.compositor_screen_data();
dbgln_if(COMPOSE_DEBUG, " -> flush transparent: {}", rect);
VERIFY(!screen_data.m_flush_rects.intersects(rect));
@@ -301,7 +301,7 @@ void Compositor::compose()
if (!cursor_screen.compositor_screen_data().m_cursor_back_bitmap || m_invalidated_cursor)
check_restore_cursor_back(cursor_screen, cursor_rect);
- auto paint_wallpaper = [&](Screen& screen, Gfx::Painter& painter, const Gfx::IntRect& rect, const Gfx::IntRect& screen_rect) {
+ auto paint_wallpaper = [&](Screen& screen, Gfx::Painter& painter, Gfx::IntRect const& rect, Gfx::IntRect const& screen_rect) {
// FIXME: If the wallpaper is opaque and covers the whole rect, no need to fill with color!
painter.fill_rect(rect, background_color);
if (m_wallpaper) {
@@ -728,7 +728,7 @@ void Compositor::invalidate_screen()
invalidate_screen(Screen::bounding_rect());
}
-void Compositor::invalidate_screen(const Gfx::IntRect& screen_rect)
+void Compositor::invalidate_screen(Gfx::IntRect const& screen_rect)
{
m_dirty_screen_rects.add(screen_rect.intersected(Screen::bounding_rect()));
@@ -773,7 +773,7 @@ void Compositor::start_compose_async_timer()
}
}
-bool Compositor::set_background_color(const String& background_color)
+bool Compositor::set_background_color(String const& background_color)
{
auto color = Color::from_string(background_color);
if (!color.has_value())
@@ -791,7 +791,7 @@ bool Compositor::set_background_color(const String& background_color)
return succeeded;
}
-bool Compositor::set_wallpaper_mode(const String& mode)
+bool Compositor::set_wallpaper_mode(String const& mode)
{
auto& wm = WindowManager::the();
wm.config()->write_entry("Background", "Mode", mode);
@@ -856,7 +856,7 @@ void Compositor::invalidate_cursor(bool compose_immediately)
start_compose_async_timer();
}
-void Compositor::change_cursor(const Cursor* cursor)
+void Compositor::change_cursor(Cursor const* cursor)
{
if (m_current_cursor == cursor)
return;
@@ -935,7 +935,7 @@ void Compositor::remove_overlay(Overlay& overlay)
overlay_rects_changed();
}
-void CompositorScreenData::draw_cursor(Screen& screen, const Gfx::IntRect& cursor_rect)
+void CompositorScreenData::draw_cursor(Screen& screen, Gfx::IntRect const& cursor_rect)
{
auto& wm = WindowManager::the();
diff --git a/Userland/Services/WindowServer/Compositor.h b/Userland/Services/WindowServer/Compositor.h
index 187e9ab272..8a9b238fd2 100644
--- a/Userland/Services/WindowServer/Compositor.h
+++ b/Userland/Services/WindowServer/Compositor.h
@@ -58,7 +58,7 @@ struct CompositorScreenData {
void init_bitmaps(Compositor&, Screen&);
void flip_buffers(Screen&);
- void draw_cursor(Screen&, const Gfx::IntRect&);
+ void draw_cursor(Screen&, Gfx::IntRect const&);
bool restore_cursor_back(Screen&, Gfx::IntRect&);
template<typename F>
@@ -96,22 +96,22 @@ public:
void compose();
void invalidate_window();
void invalidate_screen();
- void invalidate_screen(const Gfx::IntRect&);
+ void invalidate_screen(Gfx::IntRect const&);
void invalidate_screen(Gfx::DisjointRectSet const&);
void screen_resolution_changed();
- bool set_background_color(const String& background_color);
+ bool set_background_color(String const& background_color);
- bool set_wallpaper_mode(const String& mode);
+ bool set_wallpaper_mode(String const& mode);
bool set_wallpaper(RefPtr<Gfx::Bitmap>);
RefPtr<Gfx::Bitmap> wallpaper_bitmap() const { return m_wallpaper; }
void invalidate_cursor(bool = false);
Gfx::IntRect current_cursor_rect() const;
- const Cursor* current_cursor() const { return m_current_cursor; }
- void current_cursor_was_reloaded(const Cursor* new_cursor) { m_current_cursor = new_cursor; }
+ Cursor const* current_cursor() const { return m_current_cursor; }
+ void current_cursor_was_reloaded(Cursor const* new_cursor) { m_current_cursor = new_cursor; }
void increment_display_link_count(Badge<ConnectionFromClient>);
void decrement_display_link_count(Badge<ConnectionFromClient>);
@@ -174,8 +174,8 @@ public:
void did_construct_window_manager(Badge<WindowManager>);
- const Gfx::Bitmap* cursor_bitmap_for_screenshot(Badge<ConnectionFromClient>, Screen&) const;
- const Gfx::Bitmap& front_bitmap_for_screenshot(Badge<ConnectionFromClient>, Screen&) const;
+ Gfx::Bitmap const* cursor_bitmap_for_screenshot(Badge<ConnectionFromClient>, Screen&) const;
+ Gfx::Bitmap const& front_bitmap_for_screenshot(Badge<ConnectionFromClient>, Screen&) const;
Gfx::Color color_at_position(Badge<ConnectionFromClient>, Screen&, Gfx::IntPoint const&) const;
void register_animation(Badge<Animation>, Animation&);
@@ -202,7 +202,7 @@ private:
void start_compose_async_timer();
void recompute_overlay_rects();
void recompute_occlusions();
- void change_cursor(const Cursor*);
+ void change_cursor(Cursor const*);
void flush(Screen&);
Gfx::IntPoint window_transition_offset(Window&);
void update_animations(Screen&, Gfx::DisjointRectSet& flush_rects);
@@ -230,7 +230,7 @@ private:
WallpaperMode m_wallpaper_mode { WallpaperMode::Unchecked };
RefPtr<Gfx::Bitmap> m_wallpaper;
- const Cursor* m_current_cursor { nullptr };
+ Cursor const* m_current_cursor { nullptr };
Screen* m_current_cursor_screen { nullptr };
unsigned m_current_cursor_frame { 0 };
RefPtr<Core::Timer> m_cursor_timer;
diff --git a/Userland/Services/WindowServer/ConnectionFromClient.h b/Userland/Services/WindowServer/ConnectionFromClient.h
index ce9e587701..6b12169355 100644
--- a/Userland/Services/WindowServer/ConnectionFromClient.h
+++ b/Userland/Services/WindowServer/ConnectionFromClient.h
@@ -53,7 +53,7 @@ public:
return nullptr;
return menu.value();
}
- const Menu* find_menu_by_id(int menu_id) const
+ Menu const* find_menu_by_id(int menu_id) const
{
auto menu = m_menus.get(menu_id);
if (!menu.has_value())
diff --git a/Userland/Services/WindowServer/Cursor.h b/Userland/Services/WindowServer/Cursor.h
index 8991432dce..83e769a5ba 100644
--- a/Userland/Services/WindowServer/Cursor.h
+++ b/Userland/Services/WindowServer/Cursor.h
@@ -20,8 +20,8 @@ public:
static RefPtr<Cursor> create(Gfx::StandardCursor);
~Cursor() = default;
- const Gfx::CursorParams& params() const { return m_params; }
- const Gfx::Bitmap& bitmap(int scale_factor) const
+ Gfx::CursorParams const& params() const { return m_params; }
+ Gfx::Bitmap const& bitmap(int scale_factor) const
{
auto it = m_bitmaps.find(scale_factor);
if (it == m_bitmaps.end()) {
@@ -47,7 +47,7 @@ public:
private:
Cursor() = default;
- Cursor(NonnullRefPtr<Gfx::Bitmap>&&, int, const Gfx::CursorParams&);
+ Cursor(NonnullRefPtr<Gfx::Bitmap>&&, int, Gfx::CursorParams const&);
bool load(StringView, StringView);
void update_rect_if_animated();
diff --git a/Userland/Services/WindowServer/Event.h b/Userland/Services/WindowServer/Event.h
index d5a72f3643..6ab2bc59b4 100644
--- a/Userland/Services/WindowServer/Event.h
+++ b/Userland/Services/WindowServer/Event.h
@@ -88,7 +88,7 @@ private:
class MouseEvent final : public Event {
public:
- MouseEvent(Type type, const Gfx::IntPoint& position, unsigned buttons, MouseButton button, unsigned modifiers, int wheel_delta_x = 0, int wheel_delta_y = 0, int wheel_raw_delta_x = 0, int wheel_raw_delta_y = 0)
+ MouseEvent(Type type, Gfx::IntPoint const& position, unsigned buttons, MouseButton button, unsigned modifiers, int wheel_delta_x = 0, int wheel_delta_y = 0, int wheel_raw_delta_x = 0, int wheel_raw_delta_y = 0)
: Event(type)
, m_position(position)
, m_buttons(buttons)
@@ -101,7 +101,7 @@ public:
{
}
- const Gfx::IntPoint& position() const { return m_position; }
+ Gfx::IntPoint const& position() const { return m_position; }
int x() const { return m_position.x(); }
int y() const { return m_position.y(); }
MouseButton button() const { return m_button; }
@@ -121,7 +121,7 @@ public:
}
void set_drag(bool b) { m_drag = b; }
- void set_mime_data(const Core::MimeData& mime_data) { m_mime_data = mime_data; }
+ void set_mime_data(Core::MimeData const& mime_data) { m_mime_data = mime_data; }
MouseEvent translated(Gfx::IntPoint const& delta) const
{
@@ -145,13 +145,13 @@ private:
class ResizeEvent final : public Event {
public:
- ResizeEvent(const Gfx::IntRect& rect)
+ ResizeEvent(Gfx::IntRect const& rect)
: Event(Event::WindowResized)
, m_rect(rect)
{
}
- const Gfx::IntRect& rect() const { return m_rect; }
+ Gfx::IntRect const& rect() const { return m_rect; }
private:
Gfx::IntRect m_rect;
diff --git a/Userland/Services/WindowServer/KeymapSwitcher.cpp b/Userland/Services/WindowServer/KeymapSwitcher.cpp
index 2781dd7145..f329c15bfa 100644
--- a/Userland/Services/WindowServer/KeymapSwitcher.cpp
+++ b/Userland/Services/WindowServer/KeymapSwitcher.cpp
@@ -67,7 +67,7 @@ void KeymapSwitcher::next_keymap()
dbgln("Current system keymap: {}", current_keymap_name);
- auto it = m_keymaps.find_if([&](const auto& enumerator) {
+ auto it = m_keymaps.find_if([&](auto const& enumerator) {
return enumerator == current_keymap_name;
});
@@ -102,7 +102,7 @@ String KeymapSwitcher::get_current_keymap() const
void KeymapSwitcher::setkeymap(const AK::String& keymap)
{
pid_t child_pid;
- const char* argv[] = { "/bin/keymap", "-m", keymap.characters(), nullptr };
+ char const* argv[] = { "/bin/keymap", "-m", keymap.characters(), nullptr };
if ((errno = posix_spawn(&child_pid, "/bin/keymap", nullptr, nullptr, const_cast<char**>(argv), environ))) {
perror("posix_spawn");
dbgln("Failed to call /bin/keymap, error: {} ({})", errno, strerror(errno));
diff --git a/Userland/Services/WindowServer/KeymapSwitcher.h b/Userland/Services/WindowServer/KeymapSwitcher.h
index bbae14c1a3..fde86465c9 100644
--- a/Userland/Services/WindowServer/KeymapSwitcher.h
+++ b/Userland/Services/WindowServer/KeymapSwitcher.h
@@ -38,7 +38,7 @@ private:
RefPtr<Core::FileWatcher> m_file_watcher;
- const char* m_keyboard_config = "/etc/Keyboard.ini";
+ char const* m_keyboard_config = "/etc/Keyboard.ini";
};
}
diff --git a/Userland/Services/WindowServer/Menu.cpp b/Userland/Services/WindowServer/Menu.cpp
index 98e77aaa8e..9529baab06 100644
--- a/Userland/Services/WindowServer/Menu.cpp
+++ b/Userland/Services/WindowServer/Menu.cpp
@@ -47,7 +47,7 @@ Menu::Menu(ConnectionFromClient* client, int menu_id, String name)
m_alt_shortcut_character = find_ampersand_shortcut_character(m_name);
}
-const Gfx::Font& Menu::font() const
+Gfx::Font const& Menu::font() const
{
return Gfx::FontDatabase::default_font();
}
@@ -332,7 +332,7 @@ void Menu::descend_into_submenu_at_hovered_item()
VERIFY(submenu->hovered_item()->type() != MenuItem::Separator);
}
-void Menu::handle_mouse_move_event(const MouseEvent& mouse_event)
+void Menu::handle_mouse_move_event(MouseEvent const& mouse_event)
{
VERIFY(menu_window());
MenuManager::the().set_current_menu(this);
@@ -357,7 +357,7 @@ void Menu::handle_mouse_move_event(const MouseEvent& mouse_event)
void Menu::event(Core::Event& event)
{
if (event.type() == Event::MouseMove) {
- handle_mouse_move_event(static_cast<const MouseEvent&>(event));
+ handle_mouse_move_event(static_cast<MouseEvent const&>(event));
return;
}
@@ -368,7 +368,7 @@ void Menu::event(Core::Event& event)
if (event.type() == Event::MouseWheel && is_scrollable()) {
VERIFY(menu_window());
- auto& mouse_event = static_cast<const MouseEvent&>(event);
+ auto& mouse_event = static_cast<MouseEvent const&>(event);
auto previous_scroll_offset = m_scroll_offset;
m_scroll_offset += mouse_event.wheel_delta_y();
m_scroll_offset = clamp(m_scroll_offset, 0, m_max_scroll_offset);
@@ -402,7 +402,7 @@ void Menu::event(Core::Event& event)
} else {
// Default to the first enabled, non-separator item on key press if one has not been selected yet
int counter = 0;
- for (const auto& item : m_items) {
+ for (auto const& item : m_items) {
if (item.type() != MenuItem::Separator && item.is_enabled()) {
set_hovered_index(counter, key == Key_Right);
break;
@@ -567,7 +567,7 @@ bool Menu::remove_item_with_identifier(unsigned identifier)
return m_items.remove_first_matching([&](auto& item) { return item->identifier() == identifier; });
}
-int Menu::item_index_at(const Gfx::IntPoint& position)
+int Menu::item_index_at(Gfx::IntPoint const& position)
{
int i = 0;
for (auto& item : m_items) {
@@ -589,12 +589,12 @@ void Menu::redraw_if_theme_changed()
redraw();
}
-void Menu::popup(const Gfx::IntPoint& position)
+void Menu::popup(Gfx::IntPoint const& position)
{
do_popup(position, true);
}
-void Menu::do_popup(const Gfx::IntPoint& position, bool make_input, bool as_submenu)
+void Menu::do_popup(Gfx::IntPoint const& position, bool make_input, bool as_submenu)
{
if (is_empty()) {
dbgln("Menu: Empty menu popup");
@@ -605,7 +605,7 @@ void Menu::do_popup(const Gfx::IntPoint& position, bool make_input, bool as_subm
auto& window = ensure_menu_window(position);
redraw_if_theme_changed();
- const int margin = 30;
+ int const margin = 30;
Gfx::IntPoint adjusted_pos = position;
if (adjusted_pos.x() + window.width() > screen.rect().right() - margin) {
@@ -624,7 +624,7 @@ void Menu::do_popup(const Gfx::IntPoint& position, bool make_input, bool as_subm
WindowManager::the().did_popup_a_menu({});
}
-bool Menu::is_menu_ancestor_of(const Menu& other) const
+bool Menu::is_menu_ancestor_of(Menu const& other) const
{
for (auto& item : m_items) {
if (!item.is_submenu())
@@ -657,7 +657,7 @@ void Menu::add_item(NonnullOwnPtr<MenuItem> item)
m_items.append(move(item));
}
-const Vector<size_t>* Menu::items_with_alt_shortcut(u32 alt_shortcut) const
+Vector<size_t> const* Menu::items_with_alt_shortcut(u32 alt_shortcut) const
{
auto it = m_alt_shortcut_character_to_item_indices.find(to_ascii_lowercase(alt_shortcut));
if (it == m_alt_shortcut_character_to_item_indices.end())
diff --git a/Userland/Services/WindowServer/Menu.h b/Userland/Services/WindowServer/Menu.h
index 8b1b40abf6..4052bfee2e 100644
--- a/Userland/Services/WindowServer/Menu.h
+++ b/Userland/Services/WindowServer/Menu.h
@@ -31,7 +31,7 @@ public:
virtual ~Menu() override = default;
ConnectionFromClient* client() { return m_client; }
- const ConnectionFromClient* client() const { return m_client; }
+ ConnectionFromClient const* client() const { return m_client; }
int menu_id() const { return m_menu_id; }
bool is_open() const;
@@ -40,7 +40,7 @@ public:
bool is_empty() const { return m_items.is_empty(); }
size_t item_count() const { return m_items.size(); }
- const MenuItem& item(size_t index) const { return m_items.at(index); }
+ MenuItem const& item(size_t index) const { return m_items.at(index); }
MenuItem& item(size_t index) { return m_items.at(index); }
MenuItem* item_by_identifier(unsigned identifier)
@@ -72,7 +72,7 @@ public:
}
Gfx::IntRect rect_in_window_menubar() const { return m_rect_in_window_menubar; }
- void set_rect_in_window_menubar(const Gfx::IntRect& rect) { m_rect_in_window_menubar = rect; }
+ void set_rect_in_window_menubar(Gfx::IntRect const& rect) { m_rect_in_window_menubar = rect; }
Window* menu_window() { return m_menu_window.ptr(); }
Window& ensure_menu_window(Gfx::IntPoint const&);
@@ -94,7 +94,7 @@ public:
void draw();
void draw(MenuItem const&, bool = false);
- const Gfx::Font& font() const;
+ Gfx::Font const& font() const;
MenuItem* item_with_identifier(unsigned);
bool remove_item_with_identifier(unsigned);
@@ -113,10 +113,10 @@ public:
void set_visible(bool);
- void popup(const Gfx::IntPoint&);
- void do_popup(const Gfx::IntPoint&, bool make_input, bool as_submenu = false);
+ void popup(Gfx::IntPoint const&);
+ void do_popup(Gfx::IntPoint const&, bool make_input, bool as_submenu = false);
- bool is_menu_ancestor_of(const Menu&) const;
+ bool is_menu_ancestor_of(Menu const&) const;
void redraw_if_theme_changed();
@@ -126,18 +126,18 @@ public:
void descend_into_submenu_at_hovered_item();
void open_hovered_item(bool leave_menu_open);
- const Vector<size_t>* items_with_alt_shortcut(u32 alt_shortcut) const;
+ Vector<size_t> const* items_with_alt_shortcut(u32 alt_shortcut) const;
private:
Menu(ConnectionFromClient*, int menu_id, String name);
virtual void event(Core::Event&) override;
- void handle_mouse_move_event(const MouseEvent&);
+ void handle_mouse_move_event(MouseEvent const&);
size_t visible_item_count() const;
Gfx::IntRect stripe_rect();
- int item_index_at(const Gfx::IntPoint&);
+ int item_index_at(Gfx::IntPoint const&);
static constexpr int padding_between_text_and_shortcut() { return 50; }
void did_activate(MenuItem&, bool leave_menu_open);
void update_for_new_hovered_item(bool make_input = false);
diff --git a/Userland/Services/WindowServer/MenuItem.cpp b/Userland/Services/WindowServer/MenuItem.cpp
index 707a365327..2d79f818b8 100644
--- a/Userland/Services/WindowServer/MenuItem.cpp
+++ b/Userland/Services/WindowServer/MenuItem.cpp
@@ -12,7 +12,7 @@
namespace WindowServer {
-MenuItem::MenuItem(Menu& menu, unsigned identifier, const String& text, const String& shortcut_text, bool enabled, bool checkable, bool checked, const Gfx::Bitmap* icon)
+MenuItem::MenuItem(Menu& menu, unsigned identifier, String const& text, String const& shortcut_text, bool enabled, bool checkable, bool checked, Gfx::Bitmap const* icon)
: m_menu(menu)
, m_type(Text)
, m_enabled(enabled)
@@ -62,7 +62,7 @@ Menu* MenuItem::submenu()
return m_menu.client()->find_menu_by_id(m_submenu_id);
}
-const Menu* MenuItem::submenu() const
+Menu const* MenuItem::submenu() const
{
VERIFY(is_submenu());
VERIFY(m_menu.client());
@@ -76,7 +76,7 @@ Gfx::IntRect MenuItem::rect() const
return m_rect.translated(0, m_menu.item_height() - (m_menu.scroll_offset() * m_menu.item_height()));
}
-void MenuItem::set_icon(const Gfx::Bitmap* icon)
+void MenuItem::set_icon(Gfx::Bitmap const* icon)
{
if (m_icon == icon)
return;
diff --git a/Userland/Services/WindowServer/MenuItem.h b/Userland/Services/WindowServer/MenuItem.h
index cb9d640dff..f5d3d74b72 100644
--- a/Userland/Services/WindowServer/MenuItem.h
+++ b/Userland/Services/WindowServer/MenuItem.h
@@ -23,7 +23,7 @@ public:
Separator,
};
- MenuItem(Menu&, unsigned identifier, const String& text, const String& shortcut_text = {}, bool enabled = true, bool checkable = false, bool checked = false, const Gfx::Bitmap* icon = nullptr);
+ MenuItem(Menu&, unsigned identifier, String const& text, String const& shortcut_text = {}, bool enabled = true, bool checkable = false, bool checked = false, Gfx::Bitmap const* icon = nullptr);
MenuItem(Menu&, Type);
~MenuItem() = default;
@@ -47,20 +47,20 @@ public:
String shortcut_text() const { return m_shortcut_text; }
void set_shortcut_text(String text) { m_shortcut_text = move(text); }
- void set_rect(const Gfx::IntRect& rect) { m_rect = rect; }
+ void set_rect(Gfx::IntRect const& rect) { m_rect = rect; }
Gfx::IntRect rect() const;
unsigned identifier() const { return m_identifier; }
- const Gfx::Bitmap* icon() const { return m_icon; }
- void set_icon(const Gfx::Bitmap*);
+ Gfx::Bitmap const* icon() const { return m_icon; }
+ void set_icon(Gfx::Bitmap const*);
bool is_submenu() const { return m_submenu_id != -1; }
int submenu_id() const { return m_submenu_id; }
void set_submenu_id(int submenu_id) { m_submenu_id = submenu_id; }
Menu* submenu();
- const Menu* submenu() const;
+ Menu const* submenu() const;
bool is_exclusive() const { return m_exclusive; }
void set_exclusive(bool exclusive) { m_exclusive = exclusive; }
diff --git a/Userland/Services/WindowServer/MenuManager.cpp b/Userland/Services/WindowServer/MenuManager.cpp
index e511befaf4..3a882c7b46 100644
--- a/Userland/Services/WindowServer/MenuManager.cpp
+++ b/Userland/Services/WindowServer/MenuManager.cpp
@@ -26,7 +26,7 @@ MenuManager::MenuManager()
s_the = this;
}
-bool MenuManager::is_open(const Menu& menu) const
+bool MenuManager::is_open(Menu const& menu) const
{
for (size_t i = 0; i < m_open_menu_stack.size(); ++i) {
if (&menu == m_open_menu_stack[i].ptr())
@@ -55,7 +55,7 @@ void MenuManager::event(Core::Event& event)
}
if (static_cast<Event&>(event).is_key_event()) {
- auto& key_event = static_cast<const KeyEvent&>(event);
+ auto& key_event = static_cast<KeyEvent const&>(event);
if (key_event.type() == Event::KeyUp && key_event.key() == Key_Escape) {
close_everyone();
@@ -85,7 +85,7 @@ void MenuManager::event(Core::Event& event)
if (event.type() == Event::KeyDown) {
if (key_event.key() == Key_Left) {
- auto it = m_open_menu_stack.find_if([&](const auto& other) { return m_current_menu == other.ptr(); });
+ auto it = m_open_menu_stack.find_if([&](auto const& other) { return m_current_menu == other.ptr(); });
VERIFY(!it.is_end());
// Going "back" a menu should be the previous menu in the stack
diff --git a/Userland/Services/WindowServer/MenuManager.h b/Userland/Services/WindowServer/MenuManager.h
index c5177073f7..90312238e5 100644
--- a/Userland/Services/WindowServer/MenuManager.h
+++ b/Userland/Services/WindowServer/MenuManager.h
@@ -22,7 +22,7 @@ public:
virtual ~MenuManager() override = default;
- bool is_open(const Menu&) const;
+ bool is_open(Menu const&) const;
bool has_open_menu() const { return !m_open_menu_stack.is_empty(); }
Menu* current_menu() { return m_current_menu.ptr(); }
diff --git a/Userland/Services/WindowServer/MultiScaleBitmaps.cpp b/Userland/Services/WindowServer/MultiScaleBitmaps.cpp
index 937f1bf028..c0d33509d7 100644
--- a/Userland/Services/WindowServer/MultiScaleBitmaps.cpp
+++ b/Userland/Services/WindowServer/MultiScaleBitmaps.cpp
@@ -9,7 +9,7 @@
namespace WindowServer {
-const Gfx::Bitmap& MultiScaleBitmaps::bitmap(int scale_factor) const
+Gfx::Bitmap const& MultiScaleBitmaps::bitmap(int scale_factor) const
{
auto it = m_bitmaps.find(scale_factor);
if (it == m_bitmaps.end()) {
diff --git a/Userland/Services/WindowServer/Overlays.h b/Userland/Services/WindowServer/Overlays.h
index f94a870bd0..a0c171c2ac 100644
--- a/Userland/Services/WindowServer/Overlays.h
+++ b/Userland/Services/WindowServer/Overlays.h
@@ -184,10 +184,10 @@ public:
private:
Gfx::IntSize m_content_size;
- const int m_rows;
- const int m_columns;
- const int m_target_row;
- const int m_target_column;
+ int const m_rows;
+ int const m_columns;
+ int const m_target_row;
+ int const m_target_column;
};
}
diff --git a/Userland/Services/WindowServer/Screen.cpp b/Userland/Services/WindowServer/Screen.cpp
index faa44d96c1..62d20ca56b 100644
--- a/Userland/Services/WindowServer/Screen.cpp
+++ b/Userland/Services/WindowServer/Screen.cpp
@@ -43,7 +43,7 @@ Screen& ScreenInput::cursor_location_screen()
return *screen;
}
-const Screen& ScreenInput::cursor_location_screen() const
+Screen const& ScreenInput::cursor_location_screen() const
{
auto* screen = Screen::find_by_location(m_cursor_location);
VERIFY(screen);
@@ -271,7 +271,7 @@ void Screen::scale_factor_changed()
constrain_pending_flush_rects();
}
-Screen& Screen::closest_to_rect(const Gfx::IntRect& rect)
+Screen& Screen::closest_to_rect(Gfx::IntRect const& rect)
{
Screen* best_screen = nullptr;
int best_area = 0;
@@ -290,7 +290,7 @@ Screen& Screen::closest_to_rect(const Gfx::IntRect& rect)
return *best_screen;
}
-Screen& Screen::closest_to_location(const Gfx::IntPoint& point)
+Screen& Screen::closest_to_location(Gfx::IntPoint const& point)
{
for (auto& screen : s_screens) {
if (screen.rect().contains(point))
@@ -421,7 +421,7 @@ void ScreenInput::set_scroll_step_size(unsigned step_size)
m_scroll_step_size = step_size;
}
-void ScreenInput::on_receive_mouse_data(const MousePacket& packet)
+void ScreenInput::on_receive_mouse_data(MousePacket const& packet)
{
auto& current_screen = cursor_location_screen();
auto prev_location = m_cursor_location;
diff --git a/Userland/Services/WindowServer/Screen.h b/Userland/Services/WindowServer/Screen.h
index f8e41caeb2..ddfa225142 100644
--- a/Userland/Services/WindowServer/Screen.h
+++ b/Userland/Services/WindowServer/Screen.h
@@ -35,7 +35,7 @@ public:
static ScreenInput& the();
Screen& cursor_location_screen();
- const Screen& cursor_location_screen() const;
+ Screen const& cursor_location_screen() const;
unsigned mouse_button_state() const { return m_mouse_button_state; }
double acceleration_factor() const { return m_acceleration_factor; }
@@ -44,7 +44,7 @@ public:
unsigned scroll_step_size() const { return m_scroll_step_size; }
void set_scroll_step_size(unsigned);
- void on_receive_mouse_data(const MousePacket&);
+ void on_receive_mouse_data(MousePacket const&);
void on_receive_keyboard_data(::KeyEvent);
Gfx::IntPoint cursor_location() const { return m_cursor_location; }
@@ -80,7 +80,7 @@ public:
~Screen();
static bool apply_layout(ScreenLayout&&, String&);
- static const ScreenLayout& layout() { return s_layout; }
+ static ScreenLayout const& layout() { return s_layout; }
static Screen& main()
{
@@ -88,8 +88,8 @@ public:
return *s_main_screen;
}
- static Screen& closest_to_rect(const Gfx::IntRect&);
- static Screen& closest_to_location(const Gfx::IntPoint&);
+ static Screen& closest_to_rect(Gfx::IntRect const&);
+ static Screen& closest_to_location(Gfx::IntPoint const&);
static Screen* find_by_index(size_t index)
{
@@ -106,7 +106,7 @@ public:
return rects;
}
- static Screen* find_by_location(const Gfx::IntPoint& point)
+ static Screen* find_by_location(Gfx::IntPoint const& point)
{
for (auto& screen : s_screens) {
if (screen.rect().contains(point))
@@ -115,7 +115,7 @@ public:
return nullptr;
}
- static const Gfx::IntRect& bounding_rect() { return s_bounding_screens_rect; }
+ static Gfx::IntRect const& bounding_rect() { return s_bounding_screens_rect; }
static size_t count() { return s_screens.size(); }
size_t index() const { return m_index; }
diff --git a/Userland/Services/WindowServer/ScreenLayout.h b/Userland/Services/WindowServer/ScreenLayout.h
index a1983b2842..4e4becc7bf 100644
--- a/Userland/Services/WindowServer/ScreenLayout.h
+++ b/Userland/Services/WindowServer/ScreenLayout.h
@@ -28,7 +28,7 @@ public:
return { location, { resolution.width() / scale_factor, resolution.height() / scale_factor } };
}
- bool operator==(const Screen&) const = default;
+ bool operator==(Screen const&) const = default;
};
Vector<Screen> screens;
@@ -36,13 +36,13 @@ public:
bool is_valid(String* error_msg = nullptr) const;
bool normalize();
- bool load_config(const Core::ConfigFile& config_file, String* error_msg = nullptr);
+ bool load_config(Core::ConfigFile const& config_file, String* error_msg = nullptr);
bool save_config(Core::ConfigFile& config_file, bool sync = true) const;
bool try_auto_add_framebuffer(String const&);
// TODO: spaceship operator
- bool operator!=(const ScreenLayout& other) const;
- bool operator==(const ScreenLayout& other) const
+ bool operator!=(ScreenLayout const& other) const;
+ bool operator==(ScreenLayout const& other) const
{
return !(*this != other);
}
@@ -52,9 +52,9 @@ public:
namespace IPC {
-bool encode(Encoder&, const WindowServer::ScreenLayout::Screen&);
+bool encode(Encoder&, WindowServer::ScreenLayout::Screen const&);
ErrorOr<void> decode(Decoder&, WindowServer::ScreenLayout::Screen&);
-bool encode(Encoder&, const WindowServer::ScreenLayout&);
+bool encode(Encoder&, WindowServer::ScreenLayout const&);
ErrorOr<void> decode(Decoder&, WindowServer::ScreenLayout&);
}
diff --git a/Userland/Services/WindowServer/Window.cpp b/Userland/Services/WindowServer/Window.cpp
index 7317a37c0c..f372aff82c 100644
--- a/Userland/Services/WindowServer/Window.cpp
+++ b/Userland/Services/WindowServer/Window.cpp
@@ -137,7 +137,7 @@ void Window::destroy()
set_visible(false);
}
-void Window::set_title(const String& title)
+void Window::set_title(String const& title)
{
if (m_title == title)
return;
@@ -146,7 +146,7 @@ void Window::set_title(const String& title)
WindowManager::the().notify_title_changed(*this);
}
-void Window::set_rect(const Gfx::IntRect& rect)
+void Window::set_rect(Gfx::IntRect const& rect)
{
if (m_rect == rect)
return;
@@ -167,7 +167,7 @@ void Window::set_rect(const Gfx::IntRect& rect)
invalidate_last_rendered_screen_rects();
}
-void Window::set_rect_without_repaint(const Gfx::IntRect& rect)
+void Window::set_rect_without_repaint(Gfx::IntRect const& rect)
{
VERIFY(!rect.is_empty());
if (m_rect == rect)
@@ -246,7 +246,7 @@ void Window::nudge_into_desktop(Screen* target_screen, bool force_titlebar_visib
set_rect(new_window_rect);
}
-void Window::set_minimum_size(const Gfx::IntSize& size)
+void Window::set_minimum_size(Gfx::IntSize const& size)
{
if (size.is_null())
return;
@@ -261,7 +261,7 @@ void Window::set_minimum_size(const Gfx::IntSize& size)
m_minimum_size = size;
}
-void Window::handle_mouse_event(const MouseEvent& event)
+void Window::handle_mouse_event(MouseEvent const& event)
{
set_automatic_cursor_tracking_enabled(event.buttons() != 0);
@@ -357,7 +357,7 @@ void Window::set_closeable(bool closeable)
update_window_menu_items();
}
-void Window::set_taskbar_rect(const Gfx::IntRect& rect)
+void Window::set_taskbar_rect(Gfx::IntRect const& rect)
{
m_taskbar_rect = rect;
m_have_taskbar_rect = !m_taskbar_rect.is_empty();
@@ -536,7 +536,7 @@ void Window::event(Core::Event& event)
}
if (static_cast<Event&>(event).is_mouse_event())
- return handle_mouse_event(static_cast<const MouseEvent&>(event));
+ return handle_mouse_event(static_cast<MouseEvent const&>(event));
switch (event.type()) {
case Event::WindowEntered:
@@ -546,14 +546,14 @@ void Window::event(Core::Event& event)
m_client->async_window_left(m_window_id);
break;
case Event::KeyDown:
- handle_keydown_event(static_cast<const KeyEvent&>(event));
+ handle_keydown_event(static_cast<KeyEvent const&>(event));
break;
case Event::KeyUp:
m_client->async_key_up(m_window_id,
- (u32) static_cast<const KeyEvent&>(event).code_point(),
- (u32) static_cast<const KeyEvent&>(event).key(),
- static_cast<const KeyEvent&>(event).modifiers(),
- (u32) static_cast<const KeyEvent&>(event).scancode());
+ (u32) static_cast<KeyEvent const&>(event).code_point(),
+ (u32) static_cast<KeyEvent const&>(event).key(),
+ static_cast<KeyEvent const&>(event).modifiers(),
+ (u32) static_cast<KeyEvent const&>(event).scancode());
break;
case Event::WindowActivated:
m_client->async_window_activated(m_window_id);
@@ -571,14 +571,14 @@ void Window::event(Core::Event& event)
m_client->async_window_close_request(m_window_id);
break;
case Event::WindowResized:
- m_client->async_window_resized(m_window_id, static_cast<const ResizeEvent&>(event).rect());
+ m_client->async_window_resized(m_window_id, static_cast<ResizeEvent const&>(event).rect());
break;
default:
break;
}
}
-void Window::handle_keydown_event(const KeyEvent& event)
+void Window::handle_keydown_event(KeyEvent const& event)
{
if (event.modifiers() == Mod_Alt && event.key() == Key_Space && type() == WindowType::Normal && !is_frameless()) {
auto position = frame().titlebar_rect().bottom_left().translated(frame().rect().location());
@@ -661,7 +661,7 @@ void Window::invalidate(Gfx::IntRect const& rect, bool invalidate_frame)
Compositor::the().invalidate_window();
}
-bool Window::invalidate_no_notify(const Gfx::IntRect& rect, bool invalidate_frame)
+bool Window::invalidate_no_notify(Gfx::IntRect const& rect, bool invalidate_frame)
{
if (rect.is_empty())
return false;
@@ -764,7 +764,7 @@ void Window::set_default_icon()
m_icon = default_window_icon();
}
-void Window::request_update(const Gfx::IntRect& rect, bool ignore_occlusion)
+void Window::request_update(Gfx::IntRect const& rect, bool ignore_occlusion)
{
if (rect.is_empty())
return;
@@ -865,7 +865,7 @@ void Window::handle_window_menu_action(WindowMenuAction action)
}
}
-void Window::popup_window_menu(const Gfx::IntPoint& position, WindowMenuDefaultAction default_action)
+void Window::popup_window_menu(Gfx::IntPoint const& position, WindowMenuDefaultAction default_action)
{
ensure_window_menu();
if (default_action == WindowMenuDefaultAction::BasedOnWindowState) {
diff --git a/Userland/Services/WindowServer/Window.h b/Userland/Services/WindowServer/Window.h
index a6a43a7c0f..79ec348edc 100644
--- a/Userland/Services/WindowServer/Window.h
+++ b/Userland/Services/WindowServer/Window.h
@@ -88,7 +88,7 @@ public:
bool is_modified() const { return m_modified; }
void set_modified(bool);
- void popup_window_menu(const Gfx::IntPoint&, WindowMenuDefaultAction);
+ void popup_window_menu(Gfx::IntPoint const&, WindowMenuDefaultAction);
void handle_window_menu_action(WindowMenuAction);
void window_menu_activate_default();
void request_close();
@@ -139,12 +139,12 @@ public:
}
WindowFrame& frame() { return m_frame; }
- const WindowFrame& frame() const { return m_frame; }
+ WindowFrame const& frame() const { return m_frame; }
Window* blocking_modal_window();
ConnectionFromClient* client() { return m_client; }
- const ConnectionFromClient* client() const { return m_client; }
+ ConnectionFromClient const* client() const { return m_client; }
WindowType type() const { return m_type; }
int window_id() const { return m_window_id; }
@@ -153,7 +153,7 @@ public:
i32 client_id() const { return m_client_id; }
String title() const { return m_title; }
- void set_title(const String&);
+ void set_title(String const&);
String computed_title() const;
@@ -170,7 +170,7 @@ public:
m_alpha_hit_threshold = threshold;
}
- Optional<HitTestResult> hit_test(const Gfx::IntPoint&, bool include_frame = true);
+ Optional<HitTestResult> hit_test(Gfx::IntPoint const&, bool include_frame = true);
int x() const { return m_rect.x(); }
int y() const { return m_rect.y(); }
@@ -186,34 +186,34 @@ public:
bool is_modal_dont_unparent() const { return m_modal && m_parent_window; }
Gfx::IntRect rect() const { return m_rect; }
- void set_rect(const Gfx::IntRect&);
+ void set_rect(Gfx::IntRect const&);
void set_rect(int x, int y, int width, int height) { set_rect({ x, y, width, height }); }
- void set_rect_without_repaint(const Gfx::IntRect&);
+ void set_rect_without_repaint(Gfx::IntRect const&);
bool apply_minimum_size(Gfx::IntRect&);
void nudge_into_desktop(Screen*, bool force_titlebar_visible = true);
Gfx::IntSize minimum_size() const { return m_minimum_size; }
- void set_minimum_size(const Gfx::IntSize&);
+ void set_minimum_size(Gfx::IntSize const&);
void set_minimum_size(int width, int height) { set_minimum_size({ width, height }); }
- void set_taskbar_rect(const Gfx::IntRect&);
- const Gfx::IntRect& taskbar_rect() const { return m_taskbar_rect; }
+ void set_taskbar_rect(Gfx::IntRect const&);
+ Gfx::IntRect const& taskbar_rect() const { return m_taskbar_rect; }
- void move_to(const Gfx::IntPoint& position) { set_rect({ position, size() }); }
+ void move_to(Gfx::IntPoint const& position) { set_rect({ position, size() }); }
void move_to(int x, int y) { move_to({ x, y }); }
- void move_by(const Gfx::IntPoint& delta) { set_position_without_repaint(position().translated(delta)); }
+ void move_by(Gfx::IntPoint const& delta) { set_position_without_repaint(position().translated(delta)); }
Gfx::IntPoint position() const { return m_rect.location(); }
- void set_position(const Gfx::IntPoint& position) { set_rect({ position.x(), position.y(), width(), height() }); }
- void set_position_without_repaint(const Gfx::IntPoint& position) { set_rect_without_repaint({ position.x(), position.y(), width(), height() }); }
+ void set_position(Gfx::IntPoint const& position) { set_rect({ position.x(), position.y(), width(), height() }); }
+ void set_position_without_repaint(Gfx::IntPoint const& position) { set_rect_without_repaint({ position.x(), position.y(), width(), height() }); }
Gfx::IntSize size() const { return m_rect.size(); }
void invalidate(bool with_frame = true, bool re_render_frame = false);
void invalidate(Gfx::IntRect const&, bool invalidate_frame = false);
void invalidate_menubar();
- bool invalidate_no_notify(const Gfx::IntRect& rect, bool invalidate_frame = false);
+ bool invalidate_no_notify(Gfx::IntRect const& rect, bool invalidate_frame = false);
void invalidate_last_rendered_screen_rects();
void invalidate_last_rendered_screen_rects_now();
[[nodiscard]] bool should_invalidate_last_rendered_screen_rects() { return exchange(m_invalidate_last_render_rects, false); }
@@ -225,10 +225,10 @@ public:
Gfx::DisjointRectSet& dirty_rects() { return m_dirty_rects; }
// Only used by WindowType::Applet. Perhaps it could be a Window subclass? I don't know.
- void set_rect_in_applet_area(const Gfx::IntRect& rect) { m_rect_in_applet_area = rect; }
- const Gfx::IntRect& rect_in_applet_area() const { return m_rect_in_applet_area; }
+ void set_rect_in_applet_area(Gfx::IntRect const& rect) { m_rect_in_applet_area = rect; }
+ Gfx::IntRect const& rect_in_applet_area() const { return m_rect_in_applet_area; }
- const Gfx::Bitmap* backing_store() const { return m_backing_store.ptr(); }
+ Gfx::Bitmap const* backing_store() const { return m_backing_store.ptr(); }
Gfx::Bitmap* backing_store() { return m_backing_store.ptr(); }
void set_backing_store(RefPtr<Gfx::Bitmap> backing_store, i32 serial)
@@ -257,10 +257,10 @@ public:
void set_has_alpha_channel(bool value);
Gfx::IntSize size_increment() const { return m_size_increment; }
- void set_size_increment(const Gfx::IntSize& increment) { m_size_increment = increment; }
+ void set_size_increment(Gfx::IntSize const& increment) { m_size_increment = increment; }
- const Optional<Gfx::IntSize>& resize_aspect_ratio() const { return m_resize_aspect_ratio; }
- void set_resize_aspect_ratio(const Optional<Gfx::IntSize>& ratio)
+ Optional<Gfx::IntSize> const& resize_aspect_ratio() const { return m_resize_aspect_ratio; }
+ void set_resize_aspect_ratio(Optional<Gfx::IntSize> const& ratio)
{
// "Tiled" means that we take up a chunk of space relative to the screen.
// The screen can change, so "tiled" and "fixed aspect ratio" are mutually exclusive.
@@ -272,19 +272,19 @@ public:
}
Gfx::IntSize base_size() const { return m_base_size; }
- void set_base_size(const Gfx::IntSize& size) { m_base_size = size; }
+ void set_base_size(Gfx::IntSize const& size) { m_base_size = size; }
- const Gfx::Bitmap& icon() const { return *m_icon; }
+ Gfx::Bitmap const& icon() const { return *m_icon; }
void set_icon(NonnullRefPtr<Gfx::Bitmap>&& icon) { m_icon = move(icon); }
void set_default_icon();
- const Cursor* cursor() const { return (m_cursor_override ? m_cursor_override : m_cursor).ptr(); }
+ Cursor const* cursor() const { return (m_cursor_override ? m_cursor_override : m_cursor).ptr(); }
void set_cursor(RefPtr<Cursor> cursor) { m_cursor = move(cursor); }
void set_cursor_override(RefPtr<Cursor> cursor) { m_cursor_override = move(cursor); }
void remove_cursor_override() { m_cursor_override = nullptr; }
- void request_update(const Gfx::IntRect&, bool ignore_occlusion = false);
+ void request_update(Gfx::IntRect const&, bool ignore_occlusion = false);
Gfx::DisjointRectSet take_pending_paint_rects() { return move(m_pending_paint_rects); }
bool has_taskbar_rect() const { return m_have_taskbar_rect; };
@@ -299,15 +299,15 @@ public:
void detach_client(Badge<ConnectionFromClient>);
Window* parent_window() { return m_parent_window; }
- const Window* parent_window() const { return m_parent_window; }
+ Window const* parent_window() const { return m_parent_window; }
void set_parent_window(Window&);
Vector<WeakPtr<Window>>& child_windows() { return m_child_windows; }
- const Vector<WeakPtr<Window>>& child_windows() const { return m_child_windows; }
+ Vector<WeakPtr<Window>> const& child_windows() const { return m_child_windows; }
Vector<WeakPtr<Window>>& accessory_windows() { return m_accessory_windows; }
- const Vector<WeakPtr<Window>>& accessory_windows() const { return m_accessory_windows; }
+ Vector<WeakPtr<Window>> const& accessory_windows() const { return m_accessory_windows; }
bool is_descendant_of(Window&) const;
@@ -364,7 +364,7 @@ public:
bool is_on_any_window_stack(Badge<WindowStack>) const { return m_window_stack != nullptr; }
void set_window_stack(Badge<WindowStack>, WindowStack* stack) { m_window_stack = stack; }
- const Vector<Screen*, default_screen_count>& screens() const { return m_screens; }
+ Vector<Screen*, default_screen_count> const& screens() const { return m_screens; }
Vector<Screen*, default_screen_count>& screens() { return m_screens; }
void set_moving_to_another_stack(bool value) { m_moving_to_another_stack = value; }
@@ -385,8 +385,8 @@ private:
Window(Core::Object&, WindowType);
virtual void event(Core::Event&) override;
- void handle_mouse_event(const MouseEvent&);
- void handle_keydown_event(const KeyEvent&);
+ void handle_mouse_event(MouseEvent const&);
+ void handle_keydown_event(KeyEvent const&);
void add_child_window(Window&);
void add_accessory_window(Window&);
void ensure_window_menu();
diff --git a/Userland/Services/WindowServer/WindowFrame.cpp b/Userland/Services/WindowServer/WindowFrame.cpp
index 7c44578d27..8a66dc84c9 100644
--- a/Userland/Services/WindowServer/WindowFrame.cpp
+++ b/Userland/Services/WindowServer/WindowFrame.cpp
@@ -52,7 +52,7 @@ static String s_last_menu_shadow_path;
static String s_last_taskbar_shadow_path;
static String s_last_tooltip_shadow_path;
-static Gfx::IntRect frame_rect_for_window(Window& window, const Gfx::IntRect& rect)
+static Gfx::IntRect frame_rect_for_window(Window& window, Gfx::IntRect const& rect)
{
if (window.is_frameless())
return rect;
@@ -148,7 +148,7 @@ void WindowFrame::reload_config()
reload_icon(s_close_icon, "window-close.png", "/res/icons/16x16/window-close.png");
reload_icon(s_close_modified_icon, "window-close-modified.png", "/res/icons/16x16/window-close-modified.png");
- auto load_shadow = [](const String& path, String& last_path, RefPtr<MultiScaleBitmaps>& shadow_bitmap) {
+ auto load_shadow = [](String const& path, String& last_path, RefPtr<MultiScaleBitmaps>& shadow_bitmap) {
if (path.is_empty()) {
last_path = String::empty();
shadow_bitmap = nullptr;
@@ -305,13 +305,13 @@ void WindowFrame::paint_normal_frame(Gfx::Painter& painter)
paint_menubar(painter);
}
-void WindowFrame::paint(Screen& screen, Gfx::Painter& painter, const Gfx::IntRect& rect)
+void WindowFrame::paint(Screen& screen, Gfx::Painter& painter, Gfx::IntRect const& rect)
{
if (auto* cached = render_to_cache(screen))
cached->paint(*this, painter, rect);
}
-void WindowFrame::PerScaleRenderedCache::paint(WindowFrame& frame, Gfx::Painter& painter, const Gfx::IntRect& rect)
+void WindowFrame::PerScaleRenderedCache::paint(WindowFrame& frame, Gfx::Painter& painter, Gfx::IntRect const& rect)
{
auto frame_rect = frame.unconstrained_render_rect();
auto window_rect = frame.window().rect();
@@ -526,7 +526,7 @@ void WindowFrame::set_opacity(float opacity)
WindowManager::the().notify_opacity_changed(m_window);
}
-Gfx::IntRect WindowFrame::inflated_for_shadow(const Gfx::IntRect& frame_rect) const
+Gfx::IntRect WindowFrame::inflated_for_shadow(Gfx::IntRect const& frame_rect) const
{
if (auto* shadow = shadow_bitmap()) {
auto total_shadow_size = shadow->default_bitmap().height();
@@ -540,7 +540,7 @@ Gfx::IntRect WindowFrame::rect() const
return frame_rect_for_window(m_window, m_window.rect());
}
-Gfx::IntRect WindowFrame::constrained_render_rect_to_screen(const Gfx::IntRect& render_rect) const
+Gfx::IntRect WindowFrame::constrained_render_rect_to_screen(Gfx::IntRect const& render_rect) const
{
if (m_window.is_tiled())
return render_rect.intersected(Screen::closest_to_rect(rect()).rect());
@@ -630,7 +630,7 @@ void WindowFrame::invalidate(Gfx::IntRect relative_rect)
m_window.invalidate(relative_rect, true);
}
-void WindowFrame::window_rect_changed(const Gfx::IntRect& old_rect, const Gfx::IntRect& new_rect)
+void WindowFrame::window_rect_changed(Gfx::IntRect const& old_rect, Gfx::IntRect const& new_rect)
{
layout_buttons();
@@ -810,7 +810,7 @@ void WindowFrame::handle_mouse_event(MouseEvent const& event)
handle_border_mouse_event(event);
}
-void WindowFrame::handle_border_mouse_event(const MouseEvent& event)
+void WindowFrame::handle_border_mouse_event(MouseEvent const& event)
{
if (!m_window.is_resizable())
return;
@@ -838,7 +838,7 @@ void WindowFrame::handle_border_mouse_event(const MouseEvent& event)
wm.start_window_resize(m_window, event.translated(rect().location()));
}
-void WindowFrame::handle_menubar_mouse_event(const MouseEvent& event)
+void WindowFrame::handle_menubar_mouse_event(MouseEvent const& event)
{
Menu* hovered_menu = nullptr;
auto menubar_rect = this->menubar_rect();
@@ -869,7 +869,7 @@ void WindowFrame::open_menubar_menu(Menu& menu)
invalidate(menubar_rect);
}
-void WindowFrame::handle_menu_mouse_event(Menu& menu, const MouseEvent& event)
+void WindowFrame::handle_menu_mouse_event(Menu& menu, MouseEvent const& event)
{
auto menubar_rect = this->menubar_rect();
bool is_hover_with_any_menu_open = event.type() == MouseEvent::MouseMove && &m_window == WindowManager::the().window_with_active_menu();
diff --git a/Userland/Services/WindowServer/WindowFrame.h b/Userland/Services/WindowServer/WindowFrame.h
index 9e37b8b34f..30483af6cd 100644
--- a/Userland/Services/WindowServer/WindowFrame.h
+++ b/Userland/Services/WindowServer/WindowFrame.h
@@ -29,7 +29,7 @@ public:
friend class WindowFrame;
public:
- void paint(WindowFrame&, Gfx::Painter&, const Gfx::IntRect&);
+ void paint(WindowFrame&, Gfx::Painter&, Gfx::IntRect const&);
void render(WindowFrame&, Screen&);
Optional<HitTestResult> hit_test(WindowFrame&, Gfx::IntPoint const&, Gfx::IntPoint const&);
@@ -51,7 +51,7 @@ public:
void window_was_constructed(Badge<Window>);
Window& window() { return m_window; }
- const Window& window() const { return m_window; }
+ Window const& window() const { return m_window; }
Gfx::IntRect rect() const;
Gfx::IntRect render_rect() const;
@@ -59,7 +59,7 @@ public:
Gfx::DisjointRectSet opaque_render_rects() const;
Gfx::DisjointRectSet transparent_render_rects() const;
- void paint(Screen&, Gfx::Painter&, const Gfx::IntRect&);
+ void paint(Screen&, Gfx::Painter&, Gfx::IntRect const&);
void render(Screen&, Gfx::Painter&);
PerScaleRenderedCache* render_to_cache(Screen&);
@@ -68,7 +68,7 @@ public:
bool handle_titlebar_icon_mouse_event(MouseEvent const&);
void handle_border_mouse_event(MouseEvent const&);
- void window_rect_changed(const Gfx::IntRect& old_rect, const Gfx::IntRect& new_rect);
+ void window_rect_changed(Gfx::IntRect const& old_rect, Gfx::IntRect const& new_rect);
void invalidate_titlebar();
void invalidate_menubar();
void invalidate(Gfx::IntRect relative_rect);
@@ -125,15 +125,15 @@ private:
void paint_tool_window_frame(Gfx::Painter&);
void paint_menubar(Gfx::Painter&);
MultiScaleBitmaps const* shadow_bitmap() const;
- Gfx::IntRect inflated_for_shadow(const Gfx::IntRect&) const;
+ Gfx::IntRect inflated_for_shadow(Gfx::IntRect const&) const;
- void handle_menubar_mouse_event(const MouseEvent&);
- void handle_menu_mouse_event(Menu&, const MouseEvent&);
+ void handle_menubar_mouse_event(MouseEvent const&);
+ void handle_menu_mouse_event(Menu&, MouseEvent const&);
Gfx::WindowTheme::WindowState window_state_for_theme() const;
String computed_title() const;
- Gfx::IntRect constrained_render_rect_to_screen(const Gfx::IntRect&) const;
+ Gfx::IntRect constrained_render_rect_to_screen(Gfx::IntRect const&) const;
Gfx::IntRect leftmost_titlebar_button_rect() const;
Window& m_window;
diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp
index 31dc9d56d2..bf57e84207 100644
--- a/Userland/Services/WindowServer/WindowManager.cpp
+++ b/Userland/Services/WindowServer/WindowManager.cpp
@@ -774,8 +774,8 @@ bool WindowManager::process_ongoing_window_move(MouseEvent& event)
dbgln(" [!] The window is still maximized. Not moving yet.");
}
- const int tiling_deadzone = 10;
- const int secondary_deadzone = 2;
+ int const tiling_deadzone = 10;
+ int const secondary_deadzone = 2;
auto& cursor_screen = Screen::closest_to_location(event.position());
auto desktop = desktop_rect(cursor_screen);
auto desktop_relative_to_screen = desktop.translated(-cursor_screen.rect().location());
@@ -869,7 +869,7 @@ bool WindowManager::process_ongoing_window_resize(MouseEvent const& event)
return false;
if (event.type() == Event::MouseMove) {
- const int vertical_maximize_deadzone = 5;
+ int const vertical_maximize_deadzone = 5;
auto& cursor_screen = ScreenInput::the().cursor_location_screen();
if (&cursor_screen == &Screen::closest_to_rect(m_resize_window->rect())) {
auto desktop_rect = this->desktop_rect(cursor_screen);
@@ -2225,7 +2225,7 @@ void WindowManager::apply_cursor_theme(String const& theme_name)
auto cursor_theme_config = cursor_theme_config_or_error.release_value();
auto* current_cursor = Compositor::the().current_cursor();
- auto reload_cursor = [&](RefPtr<Cursor>& cursor, const String& name) {
+ auto reload_cursor = [&](RefPtr<Cursor>& cursor, String const& name) {
bool is_current_cursor = current_cursor && current_cursor == cursor.ptr();
static auto const s_default_cursor_path = "/res/cursor-themes/Default/arrow.x2y2.png";
diff --git a/Userland/Services/WindowServer/WindowManager.h b/Userland/Services/WindowServer/WindowManager.h
index ece88429df..047d6f3866 100644
--- a/Userland/Services/WindowServer/WindowManager.h
+++ b/Userland/Services/WindowServer/WindowManager.h
@@ -28,8 +28,8 @@
namespace WindowServer {
-const int double_click_speed_max = 900;
-const int double_click_speed_min = 100;
+int const double_click_speed_max = 900;
+int const double_click_speed_min = 100;
class Screen;
class MouseEvent;
diff --git a/Userland/Services/WindowServer/WindowSwitcher.cpp b/Userland/Services/WindowServer/WindowSwitcher.cpp
index f359ffb998..0243366838 100644
--- a/Userland/Services/WindowServer/WindowSwitcher.cpp
+++ b/Userland/Services/WindowServer/WindowSwitcher.cpp
@@ -85,7 +85,7 @@ void WindowSwitcher::event(Core::Event& event)
event.accept();
}
-void WindowSwitcher::on_key_event(const KeyEvent& event)
+void WindowSwitcher::on_key_event(KeyEvent const& event)
{
if (event.type() == Event::KeyUp) {
if (event.key() == (m_mode == Mode::ShowAllWindows ? Key_Super : Key_Alt)) {
@@ -212,7 +212,7 @@ void WindowSwitcher::draw()
void WindowSwitcher::refresh()
{
auto& wm = WindowManager::the();
- const Window* selected_window = nullptr;
+ Window const* selected_window = nullptr;
if (m_selected_index > 0 && m_windows[m_selected_index])
selected_window = m_windows[m_selected_index].ptr();
if (!selected_window)
diff --git a/Userland/Services/WindowServer/WindowSwitcher.h b/Userland/Services/WindowServer/WindowSwitcher.h
index 40ee72af9f..52ae22f825 100644
--- a/Userland/Services/WindowServer/WindowSwitcher.h
+++ b/Userland/Services/WindowServer/WindowSwitcher.h
@@ -38,7 +38,7 @@ public:
}
void hide() { set_visible(false); }
- void on_key_event(const KeyEvent&);
+ void on_key_event(KeyEvent const&);
void refresh();
void refresh_if_needed();
diff --git a/Userland/Shell/AST.cpp b/Userland/Shell/AST.cpp
index f2e692533b..224b7a0973 100644
--- a/Userland/Shell/AST.cpp
+++ b/Userland/Shell/AST.cpp
@@ -49,7 +49,7 @@ ErrorOr<void> AK::Formatter<Shell::AST::Command>::format(FormatBuilder& builder,
for (auto& redir : value.redirections) {
TRY(builder.put_padding(' ', 1));
if (redir.is_path_redirection()) {
- auto path_redir = (const Shell::AST::PathRedirection*)&redir;
+ auto path_redir = (Shell::AST::PathRedirection const*)&redir;
TRY(builder.put_i64(path_redir->fd));
switch (path_redir->direction) {
case Shell::AST::PathRedirection::Read:
@@ -67,12 +67,12 @@ ErrorOr<void> AK::Formatter<Shell::AST::Command>::format(FormatBuilder& builder,
}
TRY(builder.put_literal(path_redir->path));
} else if (redir.is_fd_redirection()) {
- auto* fdredir = (const Shell::AST::FdRedirection*)&redir;
+ auto* fdredir = (Shell::AST::FdRedirection const*)&redir;
TRY(builder.put_i64(fdredir->new_fd));
TRY(builder.put_literal(">"));
TRY(builder.put_i64(fdredir->old_fd));
} else if (redir.is_close_redirection()) {
- auto close_redir = (const Shell::AST::CloseRedirection*)&redir;
+ auto close_redir = (Shell::AST::CloseRedirection const*)&redir;
TRY(builder.put_i64(close_redir->fd));
TRY(builder.put_literal(">&-"));
} else {
@@ -111,7 +111,7 @@ static inline void print_indented(StringView str, int indent)
dbgln("{}{}", String::repeated(' ', indent * 2), str);
}
-static inline Optional<Position> merge_positions(const Optional<Position>& left, const Optional<Position>& right)
+static inline Optional<Position> merge_positions(Optional<Position> const& left, Optional<Position> const& right)
{
if (!left.has_value())
return right;
@@ -260,7 +260,7 @@ void Node::clear_syntax_error()
m_syntax_error_node->clear_syntax_error();
}
-void Node::set_is_syntax_error(const SyntaxError& error_node)
+void Node::set_is_syntax_error(SyntaxError const& error_node)
{
if (!m_syntax_error_node) {
m_syntax_error_node = error_node;
@@ -331,7 +331,7 @@ Node::Node(Position position)
{
}
-Vector<Line::CompletionSuggestion> Node::complete_for_editor(Shell& shell, size_t offset, const HitTestResult& hit_test_result)
+Vector<Line::CompletionSuggestion> Node::complete_for_editor(Shell& shell, size_t offset, HitTestResult const& hit_test_result)
{
auto matching_node = hit_test_result.matching_node;
if (matching_node) {
@@ -747,7 +747,7 @@ HitTestResult CastToCommand::hit_test_position(size_t offset) const
return result;
}
-Vector<Line::CompletionSuggestion> CastToCommand::complete_for_editor(Shell& shell, size_t offset, const HitTestResult& hit_test_result)
+Vector<Line::CompletionSuggestion> CastToCommand::complete_for_editor(Shell& shell, size_t offset, HitTestResult const& hit_test_result)
{
auto matching_node = hit_test_result.matching_node;
if (!matching_node || !matching_node->is_bareword())
@@ -1107,7 +1107,7 @@ HitTestResult FunctionDeclaration::hit_test_position(size_t offset) const
return result;
}
-Vector<Line::CompletionSuggestion> FunctionDeclaration::complete_for_editor(Shell& shell, size_t offset, const HitTestResult& hit_test_result)
+Vector<Line::CompletionSuggestion> FunctionDeclaration::complete_for_editor(Shell& shell, size_t offset, HitTestResult const& hit_test_result)
{
auto matching_node = hit_test_result.matching_node;
if (!matching_node)
@@ -1438,7 +1438,7 @@ void HistoryEvent::dump(int level) const
print_indented(String::formatted("{}({})", m_selector.event.index, m_selector.event.text), level + 3);
print_indented("Word Selector", level + 1);
- auto print_word_selector = [&](const HistorySelector::WordSelector& selector) {
+ auto print_word_selector = [&](HistorySelector::WordSelector const& selector) {
switch (selector.kind) {
case HistorySelector::WordSelectorKind::Index:
print_indented(String::formatted("Index {}", selector.selector), level + 3);
@@ -1798,7 +1798,7 @@ HitTestResult Execute::hit_test_position(size_t offset) const
return result;
}
-Vector<Line::CompletionSuggestion> Execute::complete_for_editor(Shell& shell, size_t offset, const HitTestResult& hit_test_result)
+Vector<Line::CompletionSuggestion> Execute::complete_for_editor(Shell& shell, size_t offset, HitTestResult const& hit_test_result)
{
auto matching_node = hit_test_result.matching_node;
if (!matching_node || !matching_node->is_bareword())
@@ -1851,7 +1851,7 @@ RefPtr<Value> IfCond::run(RefPtr<Shell> shell)
// The condition could be a builtin, in which case it has already run and exited.
if (cond->is_job()) {
- auto cond_job_value = static_cast<const JobValue*>(cond.ptr());
+ auto cond_job_value = static_cast<JobValue const*>(cond.ptr());
auto cond_job = cond_job_value->job();
shell->block_on_job(cond_job);
@@ -1978,7 +1978,7 @@ void ImmediateExpression::highlight_in_editor(Line::Editor& editor, Shell& shell
editor.stylize({ m_closing_brace_position->start_offset, m_closing_brace_position->end_offset }, { Line::Style::Foreground(Line::Style::XtermColor::Green) });
}
-Vector<Line::CompletionSuggestion> ImmediateExpression::complete_for_editor(Shell& shell, size_t offset, const HitTestResult& hit_test_result)
+Vector<Line::CompletionSuggestion> ImmediateExpression::complete_for_editor(Shell& shell, size_t offset, HitTestResult const& hit_test_result)
{
auto matching_node = hit_test_result.matching_node;
if (!matching_node || matching_node != this)
@@ -2455,7 +2455,7 @@ HitTestResult PathRedirectionNode::hit_test_position(size_t offset) const
return result;
}
-Vector<Line::CompletionSuggestion> PathRedirectionNode::complete_for_editor(Shell& shell, size_t offset, const HitTestResult& hit_test_result)
+Vector<Line::CompletionSuggestion> PathRedirectionNode::complete_for_editor(Shell& shell, size_t offset, HitTestResult const& hit_test_result)
{
auto matching_node = hit_test_result.matching_node;
if (!matching_node || !matching_node->is_bareword())
@@ -2796,7 +2796,7 @@ HitTestResult Slice::hit_test_position(size_t offset) const
return m_selector->hit_test_position(offset);
}
-Vector<Line::CompletionSuggestion> Slice::complete_for_editor(Shell& shell, size_t offset, const HitTestResult& hit_test_result)
+Vector<Line::CompletionSuggestion> Slice::complete_for_editor(Shell& shell, size_t offset, HitTestResult const& hit_test_result)
{
// TODO: Maybe intercept this, and suggest values in range?
return m_selector->complete_for_editor(shell, offset, hit_test_result);
@@ -2855,7 +2855,7 @@ HitTestResult SimpleVariable::hit_test_position(size_t offset) const
return { this, this, nullptr };
}
-Vector<Line::CompletionSuggestion> SimpleVariable::complete_for_editor(Shell& shell, size_t offset, const HitTestResult& hit_test_result)
+Vector<Line::CompletionSuggestion> SimpleVariable::complete_for_editor(Shell& shell, size_t offset, HitTestResult const& hit_test_result)
{
auto matching_node = hit_test_result.matching_node;
if (!matching_node)
@@ -2909,7 +2909,7 @@ void SpecialVariable::highlight_in_editor(Line::Editor& editor, Shell& shell, Hi
m_slice->highlight_in_editor(editor, shell, metadata);
}
-Vector<Line::CompletionSuggestion> SpecialVariable::complete_for_editor(Shell&, size_t, const HitTestResult&)
+Vector<Line::CompletionSuggestion> SpecialVariable::complete_for_editor(Shell&, size_t, HitTestResult const&)
{
return {};
}
@@ -3013,7 +3013,7 @@ void Juxtaposition::highlight_in_editor(Line::Editor& editor, Shell& shell, High
}
}
-Vector<Line::CompletionSuggestion> Juxtaposition::complete_for_editor(Shell& shell, size_t offset, const HitTestResult& hit_test_result)
+Vector<Line::CompletionSuggestion> Juxtaposition::complete_for_editor(Shell& shell, size_t offset, HitTestResult const& hit_test_result)
{
auto matching_node = hit_test_result.matching_node;
if (m_left->would_execute() || m_right->would_execute()) {
@@ -3190,7 +3190,7 @@ SyntaxError::SyntaxError(Position position, String error, bool is_continuable)
{
}
-const SyntaxError& SyntaxError::syntax_error_node() const
+SyntaxError const& SyntaxError::syntax_error_node() const
{
return *this;
}
@@ -3242,7 +3242,7 @@ HitTestResult Tilde::hit_test_position(size_t offset) const
return { this, this, nullptr };
}
-Vector<Line::CompletionSuggestion> Tilde::complete_for_editor(Shell& shell, size_t offset, const HitTestResult& hit_test_result)
+Vector<Line::CompletionSuggestion> Tilde::complete_for_editor(Shell& shell, size_t offset, HitTestResult const& hit_test_result)
{
auto matching_node = hit_test_result.matching_node;
if (!matching_node)
diff --git a/Userland/Shell/AST.h b/Userland/Shell/AST.h
index 85ab950896..c3290c080d 100644
--- a/Userland/Shell/AST.h
+++ b/Userland/Shell/AST.h
@@ -39,7 +39,7 @@ struct Position {
size_t line_number { 0 };
size_t line_column { 0 };
- bool operator==(const Line& other) const
+ bool operator==(Line const& other) const
{
return line_number == other.line_number && line_column == other.line_column;
}
@@ -290,7 +290,7 @@ public:
{
}
- const RefPtr<Job> job() const { return m_job; }
+ RefPtr<Job> const job() const { return m_job; }
private:
RefPtr<Job> m_job;
@@ -314,7 +314,7 @@ public:
{
}
- const NonnullRefPtrVector<Value>& values() const { return m_contained_values; }
+ NonnullRefPtrVector<Value> const& values() const { return m_contained_values; }
NonnullRefPtrVector<Value>& values() { return m_contained_values; }
private:
@@ -416,7 +416,7 @@ public:
virtual void for_each_entry(RefPtr<Shell> shell, Function<IterationDecision(NonnullRefPtr<Value>)> callback);
virtual RefPtr<Value> run(RefPtr<Shell>) = 0;
virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) = 0;
- virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, const HitTestResult&);
+ virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&);
Vector<Line::CompletionSuggestion> complete_for_editor(Shell& shell, size_t offset);
virtual HitTestResult hit_test_position(size_t offset) const
{
@@ -441,10 +441,10 @@ public:
virtual bool would_execute() const { return false; }
virtual bool should_override_execution_in_current_process() const { return false; }
- const Position& position() const { return m_position; }
+ Position const& position() const { return m_position; }
virtual void clear_syntax_error();
- virtual void set_is_syntax_error(const SyntaxError& error_node);
- virtual const SyntaxError& syntax_error_node() const
+ virtual void set_is_syntax_error(SyntaxError const& error_node);
+ virtual SyntaxError const& syntax_error_node() const
{
VERIFY(is_syntax_error());
return *m_syntax_error_node;
@@ -520,13 +520,13 @@ public:
PathRedirectionNode(Position, int, NonnullRefPtr<Node>);
virtual ~PathRedirectionNode();
virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
- virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, const HitTestResult&) override;
+ virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) override;
virtual HitTestResult hit_test_position(size_t offset) const override;
virtual bool is_command() const override { return true; }
virtual bool is_list() const override { return true; }
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtr<Node>& path() const { return m_path; }
+ NonnullRefPtr<Node> const& path() const { return m_path; }
int fd() const { return m_fd; }
protected:
@@ -540,9 +540,9 @@ public:
virtual ~And() = default;
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtr<Node>& left() const { return m_left; }
- const NonnullRefPtr<Node>& right() const { return m_right; }
- const Position& and_position() const { return m_and_position; }
+ NonnullRefPtr<Node> const& left() const { return m_left; }
+ NonnullRefPtr<Node> const& right() const { return m_right; }
+ Position const& and_position() const { return m_and_position; }
private:
NODE(And);
@@ -561,7 +561,7 @@ public:
ListConcatenate(Position, Vector<NonnullRefPtr<Node>>);
virtual ~ListConcatenate() = default;
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const Vector<NonnullRefPtr<Node>> list() const { return m_list; }
+ Vector<NonnullRefPtr<Node>> const list() const { return m_list; }
private:
NODE(ListConcatenate);
@@ -582,7 +582,7 @@ public:
virtual ~Background() = default;
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtr<Node>& command() const { return m_command; }
+ NonnullRefPtr<Node> const& command() const { return m_command; }
private:
NODE(Background);
@@ -600,7 +600,7 @@ public:
virtual ~BarewordLiteral() = default;
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const String& text() const { return m_text; }
+ String const& text() const { return m_text; }
private:
NODE(BarewordLiteral);
@@ -619,7 +619,7 @@ public:
virtual ~BraceExpansion() = default;
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtrVector<Node>& entries() const { return m_entries; }
+ NonnullRefPtrVector<Node> const& entries() const { return m_entries; }
private:
NODE(BraceExpansion);
@@ -637,7 +637,7 @@ public:
virtual ~CastToCommand() = default;
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtr<Node>& inner() const { return m_inner; }
+ NonnullRefPtr<Node> const& inner() const { return m_inner; }
private:
NODE(CastToCommand);
@@ -645,7 +645,7 @@ private:
virtual RefPtr<Value> run(RefPtr<Shell>) override;
virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
virtual HitTestResult hit_test_position(size_t) const override;
- virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, const HitTestResult&) override;
+ virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) override;
virtual bool is_command() const override { return true; }
virtual bool is_list() const override { return true; }
virtual RefPtr<Node> leftmost_trivial_literal() const override;
@@ -659,7 +659,7 @@ public:
virtual ~CastToList() = default;
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const RefPtr<Node>& inner() const { return m_inner; }
+ RefPtr<Node> const& inner() const { return m_inner; }
private:
NODE(CastToList);
@@ -698,7 +698,7 @@ public:
virtual ~CommandLiteral();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const Command& command() const { return m_command; }
+ Command const& command() const { return m_command; }
private:
NODE(CommandLiteral);
@@ -717,7 +717,7 @@ public:
virtual ~Comment();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const String& text() const { return m_text; }
+ String const& text() const { return m_text; }
private:
NODE(Comment);
@@ -760,7 +760,7 @@ public:
virtual ~DynamicEvaluate();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtr<Node>& inner() const { return m_inner; }
+ NonnullRefPtr<Node> const& inner() const { return m_inner; }
private:
NODE(DynamicEvaluate);
@@ -787,7 +787,7 @@ public:
virtual ~DoubleQuotedString();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const RefPtr<Node>& inner() const { return m_inner; }
+ RefPtr<Node> const& inner() const { return m_inner; }
private:
NODE(DoubleQuotedString);
@@ -825,9 +825,9 @@ public:
virtual ~FunctionDeclaration();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NameWithPosition& name() const { return m_name; }
- const Vector<NameWithPosition> arguments() const { return m_arguments; }
- const RefPtr<Node>& block() const { return m_block; }
+ NameWithPosition const& name() const { return m_name; }
+ Vector<NameWithPosition> const arguments() const { return m_arguments; }
+ RefPtr<Node> const& block() const { return m_block; }
private:
NODE(FunctionDeclaration);
@@ -835,7 +835,7 @@ private:
virtual RefPtr<Value> run(RefPtr<Shell>) override;
virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
virtual HitTestResult hit_test_position(size_t) const override;
- virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, const HitTestResult&) override;
+ virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) override;
virtual bool would_execute() const override { return true; }
virtual bool should_override_execution_in_current_process() const override { return true; }
@@ -850,12 +850,12 @@ public:
virtual ~ForLoop();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const Optional<NameWithPosition>& variable() const { return m_variable; }
- const Optional<NameWithPosition>& index_variable() const { return m_index_variable; }
- const RefPtr<Node>& iterated_expression() const { return m_iterated_expression; }
- const RefPtr<Node>& block() const { return m_block; }
- const Optional<Position> index_keyword_position() const { return m_index_kw_position; }
- const Optional<Position> in_keyword_position() const { return m_in_kw_position; }
+ Optional<NameWithPosition> const& variable() const { return m_variable; }
+ Optional<NameWithPosition> const& index_variable() const { return m_index_variable; }
+ RefPtr<Node> const& iterated_expression() const { return m_iterated_expression; }
+ RefPtr<Node> const& block() const { return m_block; }
+ Optional<Position> const index_keyword_position() const { return m_index_kw_position; }
+ Optional<Position> const in_keyword_position() const { return m_in_kw_position; }
private:
NODE(ForLoop);
@@ -880,7 +880,7 @@ public:
virtual ~Glob();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const String& text() const { return m_text; }
+ String const& text() const { return m_text; }
private:
NODE(Glob);
@@ -939,7 +939,7 @@ public:
virtual ~HistoryEvent();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const HistorySelector& selector() const { return m_selector; }
+ HistorySelector const& selector() const { return m_selector; }
private:
NODE(HistoryEvent);
@@ -959,7 +959,7 @@ public:
virtual void for_each_entry(RefPtr<Shell> shell, Function<IterationDecision(NonnullRefPtr<Value>)> callback) override;
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtr<Node>& command() const { return m_command; }
+ NonnullRefPtr<Node> const& command() const { return m_command; }
bool does_capture_stdout() const { return m_capture_stdout; }
private:
@@ -968,7 +968,7 @@ private:
virtual RefPtr<Value> run(RefPtr<Shell>) override;
virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
virtual HitTestResult hit_test_position(size_t) const override;
- virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, const HitTestResult&) override;
+ virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) override;
virtual bool is_execute() const override { return true; }
virtual bool would_execute() const override { return true; }
@@ -982,10 +982,10 @@ public:
virtual ~IfCond();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtr<Node>& condition() const { return m_condition; }
- const RefPtr<Node>& true_branch() const { return m_true_branch; }
- const RefPtr<Node>& false_branch() const { return m_false_branch; }
- const Optional<Position> else_position() const { return m_else_position; }
+ NonnullRefPtr<Node> const& condition() const { return m_condition; }
+ RefPtr<Node> const& true_branch() const { return m_true_branch; }
+ RefPtr<Node> const& false_branch() const { return m_false_branch; }
+ Optional<Position> const else_position() const { return m_else_position; }
private:
NODE(IfCond);
@@ -1008,10 +1008,10 @@ public:
virtual ~ImmediateExpression();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtrVector<Node>& arguments() const { return m_arguments; }
- const auto& function() const { return m_function; }
- const String& function_name() const { return m_function.name; }
- const Position& function_position() const { return m_function.position; }
+ NonnullRefPtrVector<Node> const& arguments() const { return m_arguments; }
+ auto const& function() const { return m_function; }
+ String const& function_name() const { return m_function.name; }
+ Position const& function_position() const { return m_function.position; }
bool has_closing_brace() const { return m_closing_brace_position.has_value(); }
private:
@@ -1019,7 +1019,7 @@ private:
virtual void dump(int level) const override;
virtual RefPtr<Value> run(RefPtr<Shell>) override;
virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
- Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, const HitTestResult&) override;
+ Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) override;
virtual HitTestResult hit_test_position(size_t) const override;
NonnullRefPtrVector<AST::Node> m_arguments;
@@ -1033,8 +1033,8 @@ public:
virtual ~Join();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtr<Node>& left() const { return m_left; }
- const NonnullRefPtr<Node>& right() const { return m_right; }
+ NonnullRefPtr<Node> const& left() const { return m_left; }
+ NonnullRefPtr<Node> const& right() const { return m_right; }
private:
NODE(Join);
@@ -1064,10 +1064,10 @@ public:
virtual ~MatchExpr();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtr<Node>& matched_expr() const { return m_matched_expr; }
- const String& expr_name() const { return m_expr_name; }
- const Vector<MatchEntry>& entries() const { return m_entries; }
- const Optional<Position>& as_position() const { return m_as_position; }
+ NonnullRefPtr<Node> const& matched_expr() const { return m_matched_expr; }
+ String const& expr_name() const { return m_expr_name; }
+ Vector<MatchEntry> const& entries() const { return m_entries; }
+ Optional<Position> const& as_position() const { return m_as_position; }
private:
NODE(MatchExpr);
@@ -1090,9 +1090,9 @@ public:
virtual ~Or();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtr<Node>& left() const { return m_left; }
- const NonnullRefPtr<Node>& right() const { return m_right; }
- const Position& or_position() const { return m_or_position; }
+ NonnullRefPtr<Node> const& left() const { return m_left; }
+ NonnullRefPtr<Node> const& right() const { return m_right; }
+ Position const& or_position() const { return m_or_position; }
private:
NODE(Or);
@@ -1112,8 +1112,8 @@ public:
virtual ~Pipe();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtr<Node>& left() const { return m_left; }
- const NonnullRefPtr<Node>& right() const { return m_right; }
+ NonnullRefPtr<Node> const& left() const { return m_left; }
+ NonnullRefPtr<Node> const& right() const { return m_right; }
private:
NODE(Pipe);
@@ -1133,8 +1133,8 @@ public:
virtual ~Range();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtr<Node>& start() const { return m_start; }
- const NonnullRefPtr<Node>& end() const { return m_end; }
+ NonnullRefPtr<Node> const& start() const { return m_start; }
+ NonnullRefPtr<Node> const& end() const { return m_end; }
private:
NODE(Range);
@@ -1177,9 +1177,9 @@ public:
virtual ~Sequence();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtrVector<Node>& entries() const { return m_entries; }
+ NonnullRefPtrVector<Node> const& entries() const { return m_entries; }
- const Vector<Position>& separator_positions() const { return m_separator_positions; }
+ Vector<Position> const& separator_positions() const { return m_separator_positions; }
private:
NODE(Sequence);
@@ -1201,7 +1201,7 @@ public:
virtual ~Subshell();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const RefPtr<Node>& block() const { return m_block; }
+ RefPtr<Node> const& block() const { return m_block; }
private:
NODE(Subshell);
@@ -1227,7 +1227,7 @@ public:
virtual void dump(int level) const override;
virtual RefPtr<Value> run(RefPtr<Shell>) override;
virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
- virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, const HitTestResult&) override;
+ virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) override;
virtual HitTestResult hit_test_position(size_t) const override;
protected:
@@ -1250,7 +1250,7 @@ public:
set_is_syntax_error(m_slice->syntax_error_node());
}
- const Slice* slice() const { return m_slice.ptr(); }
+ Slice const* slice() const { return m_slice.ptr(); }
protected:
RefPtr<Slice> m_slice;
@@ -1262,14 +1262,14 @@ public:
virtual ~SimpleVariable();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const String& name() const { return m_name; }
+ String const& name() const { return m_name; }
private:
NODE(SimpleVariable);
virtual void dump(int level) const override;
virtual RefPtr<Value> run(RefPtr<Shell>) override;
virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
- virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, const HitTestResult&) override;
+ virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) override;
virtual HitTestResult hit_test_position(size_t) const override;
virtual bool is_simple_variable() const override { return true; }
@@ -1289,7 +1289,7 @@ private:
virtual void dump(int level) const override;
virtual RefPtr<Value> run(RefPtr<Shell>) override;
virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
- virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, const HitTestResult&) override;
+ virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) override;
virtual HitTestResult hit_test_position(size_t) const override;
char m_name { 0 };
@@ -1301,8 +1301,8 @@ public:
virtual ~Juxtaposition();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtr<Node>& left() const { return m_left; }
- const NonnullRefPtr<Node>& right() const { return m_right; }
+ NonnullRefPtr<Node> const& left() const { return m_left; }
+ NonnullRefPtr<Node> const& right() const { return m_right; }
private:
NODE(Juxtaposition);
@@ -1310,7 +1310,7 @@ private:
virtual RefPtr<Value> run(RefPtr<Shell>) override;
virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
virtual HitTestResult hit_test_position(size_t) const override;
- virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, const HitTestResult&) override;
+ virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) override;
NonnullRefPtr<Node> m_left;
NonnullRefPtr<Node> m_right;
@@ -1322,10 +1322,10 @@ public:
virtual ~Heredoc();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const String& end() const { return m_end; }
+ String const& end() const { return m_end; }
bool allow_interpolation() const { return m_allows_interpolation; }
bool deindent() const { return m_deindent; }
- const RefPtr<AST::Node>& contents() const { return m_contents; }
+ RefPtr<AST::Node> const& contents() const { return m_contents; }
void set_contents(RefPtr<AST::Node> contents)
{
m_contents = move(contents);
@@ -1361,7 +1361,7 @@ public:
virtual ~StringLiteral();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const String& text() const { return m_text; }
+ String const& text() const { return m_text; }
EnclosureType enclosure_type() const { return m_enclosure_type; }
private:
@@ -1381,8 +1381,8 @@ public:
virtual ~StringPartCompose();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const NonnullRefPtr<Node>& left() const { return m_left; }
- const NonnullRefPtr<Node>& right() const { return m_right; }
+ NonnullRefPtr<Node> const& left() const { return m_left; }
+ NonnullRefPtr<Node> const& right() const { return m_right; }
private:
NODE(StringPartCompose);
@@ -1401,14 +1401,14 @@ public:
virtual ~SyntaxError();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const String& error_text() const { return m_syntax_error_text; }
+ String const& error_text() const { return m_syntax_error_text; }
bool is_continuable() const { return m_is_continuable; }
virtual void clear_syntax_error() override
{
m_is_cleared = true;
}
- virtual void set_is_syntax_error(const SyntaxError& error) override
+ virtual void set_is_syntax_error(SyntaxError const& error) override
{
m_position = error.position();
m_is_cleared = error.m_is_cleared;
@@ -1424,7 +1424,7 @@ private:
virtual RefPtr<Value> run(RefPtr<Shell>) override;
virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
virtual HitTestResult hit_test_position(size_t) const override { return { nullptr, nullptr, nullptr }; }
- virtual const SyntaxError& syntax_error_node() const override;
+ virtual SyntaxError const& syntax_error_node() const override;
String m_syntax_error_text;
bool m_is_continuable { false };
@@ -1437,7 +1437,7 @@ public:
virtual ~SyntheticNode() = default;
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const Value& value() const { return m_value; }
+ Value const& value() const { return m_value; }
private:
NODE(SyntheticValue);
@@ -1461,7 +1461,7 @@ private:
virtual void dump(int level) const override;
virtual RefPtr<Value> run(RefPtr<Shell>) override;
virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
- virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, const HitTestResult&) override;
+ virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) override;
virtual HitTestResult hit_test_position(size_t) const override;
virtual bool is_tilde() const override { return true; }
@@ -1478,7 +1478,7 @@ public:
virtual ~VariableDeclarations();
virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
- const Vector<Variable>& variables() const { return m_variables; }
+ Vector<Variable> const& variables() const { return m_variables; }
private:
NODE(VariableDeclarations);
diff --git a/Userland/Shell/Builtin.cpp b/Userland/Shell/Builtin.cpp
index 31a9f36bce..738e44926e 100644
--- a/Userland/Shell/Builtin.cpp
+++ b/Userland/Shell/Builtin.cpp
@@ -25,12 +25,12 @@ extern char** environ;
namespace Shell {
-int Shell::builtin_noop(int, const char**)
+int Shell::builtin_noop(int, char const**)
{
return 0;
}
-int Shell::builtin_dump(int argc, const char** argv)
+int Shell::builtin_dump(int argc, char const** argv)
{
if (argc != 2)
return 1;
@@ -39,9 +39,9 @@ int Shell::builtin_dump(int argc, const char** argv)
return 0;
}
-int Shell::builtin_alias(int argc, const char** argv)
+int Shell::builtin_alias(int argc, char const** argv)
{
- Vector<const char*> arguments;
+ Vector<char const*> arguments;
Core::ArgsParser parser;
parser.add_positional_argument(arguments, "List of name[=values]'s", "name[=value]", Core::ArgsParser::Required::No);
@@ -74,10 +74,10 @@ int Shell::builtin_alias(int argc, const char** argv)
return fail ? 1 : 0;
}
-int Shell::builtin_unalias(int argc, const char** argv)
+int Shell::builtin_unalias(int argc, char const** argv)
{
bool remove_all { false };
- Vector<const char*> arguments;
+ Vector<char const*> arguments;
Core::ArgsParser parser;
parser.set_general_help("Remove alias from the list of aliases");
@@ -113,7 +113,7 @@ int Shell::builtin_unalias(int argc, const char** argv)
return failed ? 1 : 0;
}
-int Shell::builtin_bg(int argc, const char** argv)
+int Shell::builtin_bg(int argc, char const** argv)
{
int job_id = -1;
bool is_pid = false;
@@ -177,9 +177,9 @@ int Shell::builtin_bg(int argc, const char** argv)
return 0;
}
-int Shell::builtin_type(int argc, const char** argv)
+int Shell::builtin_type(int argc, char const** argv)
{
- Vector<const char*> commands;
+ Vector<char const*> commands;
bool dont_show_function_source = false;
Core::ArgsParser parser;
@@ -246,9 +246,9 @@ int Shell::builtin_type(int argc, const char** argv)
return 0;
}
-int Shell::builtin_cd(int argc, const char** argv)
+int Shell::builtin_cd(int argc, char const** argv)
{
- const char* arg_path = nullptr;
+ char const* arg_path = nullptr;
Core::ArgsParser parser;
parser.add_positional_argument(arg_path, "Path to change to", "path", Core::ArgsParser::Required::No);
@@ -283,7 +283,7 @@ int Shell::builtin_cd(int argc, const char** argv)
auto path_relative_to_current_directory = LexicalPath::relative_path(real_path, cwd);
if (path_relative_to_current_directory.is_empty())
path_relative_to_current_directory = real_path;
- const char* path = path_relative_to_current_directory.characters();
+ char const* path = path_relative_to_current_directory.characters();
int rc = chdir(path);
if (rc < 0) {
@@ -300,7 +300,7 @@ int Shell::builtin_cd(int argc, const char** argv)
return 0;
}
-int Shell::builtin_cdh(int argc, const char** argv)
+int Shell::builtin_cdh(int argc, char const** argv)
{
int index = -1;
@@ -326,12 +326,12 @@ int Shell::builtin_cdh(int argc, const char** argv)
return 1;
}
- const char* path = cd_history.at(cd_history.size() - index).characters();
- const char* cd_args[] = { "cd", path, nullptr };
+ char const* path = cd_history.at(cd_history.size() - index).characters();
+ char const* cd_args[] = { "cd", path, nullptr };
return Shell::builtin_cd(2, cd_args);
}
-int Shell::builtin_dirs(int argc, const char** argv)
+int Shell::builtin_dirs(int argc, char const** argv)
{
// The first directory in the stack is ALWAYS the current directory
directory_stack.at(0) = cwd.characters();
@@ -341,7 +341,7 @@ int Shell::builtin_dirs(int argc, const char** argv)
bool number_when_printing = false;
char separator = ' ';
- Vector<const char*> paths;
+ Vector<char const*> paths;
Core::ArgsParser parser;
parser.add_option(clear, "Clear the directory stack", "clear", 'c');
@@ -384,21 +384,21 @@ int Shell::builtin_dirs(int argc, const char** argv)
return 0;
}
-int Shell::builtin_exec(int argc, const char** argv)
+int Shell::builtin_exec(int argc, char const** argv)
{
if (argc < 2) {
warnln("Shell: No command given to exec");
return 1;
}
- Vector<const char*> argv_vector;
+ Vector<char const*> argv_vector;
argv_vector.append(argv + 1, argc - 1);
argv_vector.append(nullptr);
execute_process(move(argv_vector));
}
-int Shell::builtin_exit(int argc, const char** argv)
+int Shell::builtin_exit(int argc, char const** argv)
{
int exit_code = 0;
Core::ArgsParser parser;
@@ -423,9 +423,9 @@ int Shell::builtin_exit(int argc, const char** argv)
exit(exit_code);
}
-int Shell::builtin_export(int argc, const char** argv)
+int Shell::builtin_export(int argc, char const** argv)
{
- Vector<const char*> vars;
+ Vector<char const*> vars;
Core::ArgsParser parser;
parser.add_positional_argument(vars, "List of variable[=value]'s", "values", Core::ArgsParser::Required::No);
@@ -469,9 +469,9 @@ int Shell::builtin_export(int argc, const char** argv)
return 0;
}
-int Shell::builtin_glob(int argc, const char** argv)
+int Shell::builtin_glob(int argc, char const** argv)
{
- Vector<const char*> globs;
+ Vector<char const*> globs;
Core::ArgsParser parser;
parser.add_positional_argument(globs, "Globs to resolve", "glob");
@@ -486,7 +486,7 @@ int Shell::builtin_glob(int argc, const char** argv)
return 0;
}
-int Shell::builtin_fg(int argc, const char** argv)
+int Shell::builtin_fg(int argc, char const** argv)
{
int job_id = -1;
bool is_pid = false;
@@ -557,7 +557,7 @@ int Shell::builtin_fg(int argc, const char** argv)
return 0;
}
-int Shell::builtin_disown(int argc, const char** argv)
+int Shell::builtin_disown(int argc, char const** argv)
{
Vector<int> job_ids;
Vector<bool> id_is_pid;
@@ -594,7 +594,7 @@ int Shell::builtin_disown(int argc, const char** argv)
id_is_pid.append(false);
}
- Vector<const Job*> jobs_to_disown;
+ Vector<Job const*> jobs_to_disown;
for (size_t i = 0; i < job_ids.size(); ++i) {
auto id = job_ids[i];
@@ -625,7 +625,7 @@ int Shell::builtin_disown(int argc, const char** argv)
return 0;
}
-int Shell::builtin_history(int, const char**)
+int Shell::builtin_history(int, char const**)
{
for (size_t i = 0; i < m_editor->history().size(); ++i) {
printf("%6zu %s\n", i + 1, m_editor->history()[i].entry.characters());
@@ -633,7 +633,7 @@ int Shell::builtin_history(int, const char**)
return 0;
}
-int Shell::builtin_jobs(int argc, const char** argv)
+int Shell::builtin_jobs(int argc, char const** argv)
{
bool list = false, show_pid = false;
@@ -660,7 +660,7 @@ int Shell::builtin_jobs(int argc, const char** argv)
return 0;
}
-int Shell::builtin_popd(int argc, const char** argv)
+int Shell::builtin_popd(int argc, char const** argv)
{
if (directory_stack.size() <= 1) {
warnln("Shell: popd: directory stack empty");
@@ -688,7 +688,7 @@ int Shell::builtin_popd(int argc, const char** argv)
return 0;
}
-int Shell::builtin_pushd(int argc, const char** argv)
+int Shell::builtin_pushd(int argc, char const** argv)
{
StringBuilder path_builder;
bool should_switch = true;
@@ -728,7 +728,7 @@ int Shell::builtin_pushd(int argc, const char** argv)
} else if (argc == 3) {
directory_stack.append(cwd.characters());
for (int i = 1; i < argc; i++) {
- const char* arg = argv[i];
+ char const* arg = argv[i];
if (arg[0] != '-') {
if (arg[0] == '/') {
@@ -769,14 +769,14 @@ int Shell::builtin_pushd(int argc, const char** argv)
return 0;
}
-int Shell::builtin_pwd(int, const char**)
+int Shell::builtin_pwd(int, char const**)
{
print_path(cwd);
fputc('\n', stdout);
return 0;
}
-int Shell::builtin_setopt(int argc, const char** argv)
+int Shell::builtin_setopt(int argc, char const** argv)
{
if (argc == 1) {
#define __ENUMERATE_SHELL_OPTION(name, default_, description) \
@@ -815,7 +815,7 @@ int Shell::builtin_setopt(int argc, const char** argv)
return 0;
}
-int Shell::builtin_shift(int argc, const char** argv)
+int Shell::builtin_shift(int argc, char const** argv)
{
int count = 1;
@@ -849,10 +849,10 @@ int Shell::builtin_shift(int argc, const char** argv)
return 0;
}
-int Shell::builtin_source(int argc, const char** argv)
+int Shell::builtin_source(int argc, char const** argv)
{
- const char* file_to_source = nullptr;
- Vector<const char*> args;
+ char const* file_to_source = nullptr;
+ Vector<char const*> args;
Core::ArgsParser parser;
parser.add_positional_argument(file_to_source, "File to read commands from", "path");
@@ -880,9 +880,9 @@ int Shell::builtin_source(int argc, const char** argv)
return 0;
}
-int Shell::builtin_time(int argc, const char** argv)
+int Shell::builtin_time(int argc, char const** argv)
{
- Vector<const char*> args;
+ Vector<char const*> args;
int number_of_iterations = 1;
@@ -938,9 +938,9 @@ int Shell::builtin_time(int argc, const char** argv)
return exit_code;
}
-int Shell::builtin_umask(int argc, const char** argv)
+int Shell::builtin_umask(int argc, char const** argv)
{
- const char* mask_text = nullptr;
+ char const* mask_text = nullptr;
Core::ArgsParser parser;
parser.add_positional_argument(mask_text, "New mask (omit to get current mask)", "octal-mask", Core::ArgsParser::Required::No);
@@ -966,7 +966,7 @@ int Shell::builtin_umask(int argc, const char** argv)
return 1;
}
-int Shell::builtin_wait(int argc, const char** argv)
+int Shell::builtin_wait(int argc, char const** argv)
{
Vector<int> job_ids;
Vector<bool> id_is_pid;
@@ -1011,7 +1011,7 @@ int Shell::builtin_wait(int argc, const char** argv)
}
if (job_ids.is_empty()) {
- for (const auto& it : jobs)
+ for (auto const& it : jobs)
jobs_to_wait_for.append(it.value);
}
@@ -1023,9 +1023,9 @@ int Shell::builtin_wait(int argc, const char** argv)
return 0;
}
-int Shell::builtin_unset(int argc, const char** argv)
+int Shell::builtin_unset(int argc, char const** argv)
{
- Vector<const char*> vars;
+ Vector<char const*> vars;
Core::ArgsParser parser;
parser.add_positional_argument(vars, "List of variables", "variables", Core::ArgsParser::Required::Yes);
@@ -1051,7 +1051,7 @@ int Shell::builtin_unset(int argc, const char** argv)
return 0;
}
-int Shell::builtin_not(int argc, const char** argv)
+int Shell::builtin_not(int argc, char const** argv)
{
// FIXME: Use ArgsParser when it can collect unrelated -arguments too.
if (argc == 1)
@@ -1075,7 +1075,7 @@ int Shell::builtin_not(int argc, const char** argv)
return exit_code == 0 ? 1 : 0;
}
-int Shell::builtin_kill(int argc, const char** argv)
+int Shell::builtin_kill(int argc, char const** argv)
{
// Simply translate the arguments and pass them to `kill'
Vector<String> replaced_values;
@@ -1118,7 +1118,7 @@ int Shell::builtin_kill(int argc, const char** argv)
return exit_code;
}
-bool Shell::run_builtin(const AST::Command& command, const NonnullRefPtrVector<AST::Rewiring>& rewirings, int& retval)
+bool Shell::run_builtin(const AST::Command& command, NonnullRefPtrVector<AST::Rewiring> const& rewirings, int& retval)
{
if (command.argv.is_empty())
return false;
@@ -1126,7 +1126,7 @@ bool Shell::run_builtin(const AST::Command& command, const NonnullRefPtrVector<A
if (!has_builtin(command.argv.first()))
return false;
- Vector<const char*> argv;
+ Vector<char const*> argv;
for (auto& arg : command.argv)
argv.append(arg.characters());
@@ -1166,7 +1166,7 @@ bool Shell::run_builtin(const AST::Command& command, const NonnullRefPtrVector<A
return false;
}
-int Shell::builtin_argsparser_parse(int argc, const char** argv)
+int Shell::builtin_argsparser_parse(int argc, char const** argv)
{
// argsparser_parse
// --add-option variable [--type (bool | string | i32 | u32 | double | size)] --help-string "" --long-name "" --short-name "" [--value-name "" <if not --type bool>] --list
diff --git a/Userland/Shell/Execution.h b/Userland/Shell/Execution.h
index 0437700a30..02af16738c 100644
--- a/Userland/Shell/Execution.h
+++ b/Userland/Shell/Execution.h
@@ -29,7 +29,7 @@ private:
class SavedFileDescriptors {
public:
- SavedFileDescriptors(const NonnullRefPtrVector<AST::Rewiring>&);
+ SavedFileDescriptors(NonnullRefPtrVector<AST::Rewiring> const&);
~SavedFileDescriptors();
private:
diff --git a/Userland/Shell/ImmediateFunctions.cpp b/Userland/Shell/ImmediateFunctions.cpp
index e67d8d0383..2791d7b185 100644
--- a/Userland/Shell/ImmediateFunctions.cpp
+++ b/Userland/Shell/ImmediateFunctions.cpp
@@ -10,7 +10,7 @@
namespace Shell {
-RefPtr<AST::Node> Shell::immediate_length_impl(AST::ImmediateExpression& invoking_node, const NonnullRefPtrVector<AST::Node>& arguments, bool across)
+RefPtr<AST::Node> Shell::immediate_length_impl(AST::ImmediateExpression& invoking_node, NonnullRefPtrVector<AST::Node> const& arguments, bool across)
{
auto name = across ? "length_across" : "length";
if (arguments.size() < 1 || arguments.size() > 2) {
@@ -37,7 +37,7 @@ RefPtr<AST::Node> Shell::immediate_length_impl(AST::ImmediateExpression& invokin
return nullptr;
}
- const auto& mode_name = static_cast<const AST::BarewordLiteral&>(mode_arg).text();
+ auto const& mode_name = static_cast<const AST::BarewordLiteral&>(mode_arg).text();
if (mode_name == "list") {
mode = List;
} else if (mode_name == "string") {
@@ -189,17 +189,17 @@ RefPtr<AST::Node> Shell::immediate_length_impl(AST::ImmediateExpression& invokin
}
}
-RefPtr<AST::Node> Shell::immediate_length(AST::ImmediateExpression& invoking_node, const NonnullRefPtrVector<AST::Node>& arguments)
+RefPtr<AST::Node> Shell::immediate_length(AST::ImmediateExpression& invoking_node, NonnullRefPtrVector<AST::Node> const& arguments)
{
return immediate_length_impl(invoking_node, arguments, false);
}
-RefPtr<AST::Node> Shell::immediate_length_across(AST::ImmediateExpression& invoking_node, const NonnullRefPtrVector<AST::Node>& arguments)
+RefPtr<AST::Node> Shell::immediate_length_across(AST::ImmediateExpression& invoking_node, NonnullRefPtrVector<AST::Node> const& arguments)
{
return immediate_length_impl(invoking_node, arguments, true);
}
-RefPtr<AST::Node> Shell::immediate_regex_replace(AST::ImmediateExpression& invoking_node, const NonnullRefPtrVector<AST::Node>& arguments)
+RefPtr<AST::Node> Shell::immediate_regex_replace(AST::ImmediateExpression& invoking_node, NonnullRefPtrVector<AST::Node> const& arguments)
{
if (arguments.size() != 3) {
raise_error(ShellError::EvaluatedSyntaxError, "Expected exactly 3 arguments to regex_replace", invoking_node.position());
@@ -231,7 +231,7 @@ RefPtr<AST::Node> Shell::immediate_regex_replace(AST::ImmediateExpression& invok
return AST::make_ref_counted<AST::StringLiteral>(invoking_node.position(), move(result), AST::StringLiteral::EnclosureType::None);
}
-RefPtr<AST::Node> Shell::immediate_remove_suffix(AST::ImmediateExpression& invoking_node, const NonnullRefPtrVector<AST::Node>& arguments)
+RefPtr<AST::Node> Shell::immediate_remove_suffix(AST::ImmediateExpression& invoking_node, NonnullRefPtrVector<AST::Node> const& arguments)
{
if (arguments.size() != 2) {
raise_error(ShellError::EvaluatedSyntaxError, "Expected exactly 2 arguments to remove_suffix", invoking_node.position());
@@ -262,7 +262,7 @@ RefPtr<AST::Node> Shell::immediate_remove_suffix(AST::ImmediateExpression& invok
return AST::make_ref_counted<AST::ListConcatenate>(invoking_node.position(), move(nodes));
}
-RefPtr<AST::Node> Shell::immediate_remove_prefix(AST::ImmediateExpression& invoking_node, const NonnullRefPtrVector<AST::Node>& arguments)
+RefPtr<AST::Node> Shell::immediate_remove_prefix(AST::ImmediateExpression& invoking_node, NonnullRefPtrVector<AST::Node> const& arguments)
{
if (arguments.size() != 2) {
raise_error(ShellError::EvaluatedSyntaxError, "Expected exactly 2 arguments to remove_prefix", invoking_node.position());
@@ -293,7 +293,7 @@ RefPtr<AST::Node> Shell::immediate_remove_prefix(AST::ImmediateExpression& invok
return AST::make_ref_counted<AST::ListConcatenate>(invoking_node.position(), move(nodes));
}
-RefPtr<AST::Node> Shell::immediate_split(AST::ImmediateExpression& invoking_node, const NonnullRefPtrVector<AST::Node>& arguments)
+RefPtr<AST::Node> Shell::immediate_split(AST::ImmediateExpression& invoking_node, NonnullRefPtrVector<AST::Node> const& arguments)
{
if (arguments.size() != 2) {
raise_error(ShellError::EvaluatedSyntaxError, "Expected exactly 2 arguments to split", invoking_node.position());
@@ -310,7 +310,7 @@ RefPtr<AST::Node> Shell::immediate_split(AST::ImmediateExpression& invoking_node
auto delimiter_str = delimiter->resolve_as_list(this)[0];
- auto transform = [&](const auto& values) {
+ auto transform = [&](auto const& values) {
// Translate to a list of applications of `split <delimiter>`
Vector<NonnullRefPtr<AST::Node>> resulting_nodes;
resulting_nodes.ensure_capacity(values.size());
@@ -360,7 +360,7 @@ RefPtr<AST::Node> Shell::immediate_split(AST::ImmediateExpression& invoking_node
return transform(AST::make_ref_counted<AST::ListValue>(list)->values());
}
-RefPtr<AST::Node> Shell::immediate_concat_lists(AST::ImmediateExpression& invoking_node, const NonnullRefPtrVector<AST::Node>& arguments)
+RefPtr<AST::Node> Shell::immediate_concat_lists(AST::ImmediateExpression& invoking_node, NonnullRefPtrVector<AST::Node> const& arguments)
{
NonnullRefPtrVector<AST::Node> result;
@@ -383,7 +383,7 @@ RefPtr<AST::Node> Shell::immediate_concat_lists(AST::ImmediateExpression& invoki
return AST::make_ref_counted<AST::ListConcatenate>(invoking_node.position(), move(result));
}
-RefPtr<AST::Node> Shell::immediate_filter_glob(AST::ImmediateExpression& invoking_node, const NonnullRefPtrVector<AST::Node>& arguments)
+RefPtr<AST::Node> Shell::immediate_filter_glob(AST::ImmediateExpression& invoking_node, NonnullRefPtrVector<AST::Node> const& arguments)
{
// filter_glob string list
if (arguments.size() != 2) {
@@ -427,7 +427,7 @@ RefPtr<AST::Node> Shell::immediate_filter_glob(AST::ImmediateExpression& invokin
return AST::make_ref_counted<AST::ListConcatenate>(invoking_node.position(), move(result));
}
-RefPtr<AST::Node> Shell::immediate_join(AST::ImmediateExpression& invoking_node, const NonnullRefPtrVector<AST::Node>& arguments)
+RefPtr<AST::Node> Shell::immediate_join(AST::ImmediateExpression& invoking_node, NonnullRefPtrVector<AST::Node> const& arguments)
{
if (arguments.size() != 2) {
raise_error(ShellError::EvaluatedSyntaxError, "Expected exactly 2 arguments to join", invoking_node.position());
@@ -453,7 +453,7 @@ RefPtr<AST::Node> Shell::immediate_join(AST::ImmediateExpression& invoking_node,
return AST::make_ref_counted<AST::StringLiteral>(invoking_node.position(), builder.to_string(), AST::StringLiteral::EnclosureType::None);
}
-RefPtr<AST::Node> Shell::run_immediate_function(StringView str, AST::ImmediateExpression& invoking_node, const NonnullRefPtrVector<AST::Node>& arguments)
+RefPtr<AST::Node> Shell::run_immediate_function(StringView str, AST::ImmediateExpression& invoking_node, NonnullRefPtrVector<AST::Node> const& arguments)
{
#define __ENUMERATE_SHELL_IMMEDIATE_FUNCTION(name) \
if (str == #name) \
diff --git a/Userland/Shell/Job.h b/Userland/Shell/Job.h
index f2a579fbf6..a92c9577dc 100644
--- a/Userland/Shell/Job.h
+++ b/Userland/Shell/Job.h
@@ -40,7 +40,7 @@ public:
pid_t pgid() const { return m_pgid; }
pid_t pid() const { return m_pid; }
- const String& cmd() const { return m_cmd; }
+ String const& cmd() const { return m_cmd; }
const AST::Command& command() const { return *m_command; }
AST::Command* command_ptr() { return m_command; }
u64 job_id() const { return m_job_id; }
diff --git a/Userland/Shell/Parser.h b/Userland/Shell/Parser.h
index 212c52c8a6..ec8ebfc919 100644
--- a/Userland/Shell/Parser.h
+++ b/Userland/Shell/Parser.h
@@ -152,7 +152,7 @@ private:
AST::Position::Line line;
};
- void restore_to(const ScopedOffset& offset) { restore_to(offset.offset, offset.line); }
+ void restore_to(ScopedOffset const& offset) { restore_to(offset.offset, offset.line); }
OwnPtr<ScopedOffset> push_start();
Offset current_position();
diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp
index 29a0540cff..33f7983011 100644
--- a/Userland/Shell/Shell.cpp
+++ b/Userland/Shell/Shell.cpp
@@ -155,7 +155,7 @@ String Shell::expand_tilde(StringView expression)
path.append(expression[i]);
if (login_name.is_empty()) {
- const char* home = getenv("HOME");
+ char const* home = getenv("HOME");
if (!home) {
auto passwd = getpwuid(getuid());
VERIFY(passwd && passwd->pw_dir);
@@ -385,7 +385,7 @@ RefPtr<AST::Value> Shell::get_argument(size_t index) const
return nullptr;
}
-String Shell::local_variable_or(StringView name, const String& replacement) const
+String Shell::local_variable_or(StringView name, String const& replacement) const
{
auto value = lookup_local_variable(name);
if (value) {
@@ -396,7 +396,7 @@ String Shell::local_variable_or(StringView name, const String& replacement) cons
return replacement;
}
-void Shell::set_local_variable(const String& name, RefPtr<AST::Value> value, bool only_in_current_frame)
+void Shell::set_local_variable(String const& name, RefPtr<AST::Value> value, bool only_in_current_frame)
{
if (!only_in_current_frame) {
if (auto* frame = find_frame_containing_local_variable(name)) {
@@ -700,7 +700,7 @@ ErrorOr<RefPtr<Job>> Shell::run_command(const AST::Command& command)
return nullptr;
}
- Vector<const char*> argv;
+ Vector<char const*> argv;
Vector<String> copy_argv = command.argv;
argv.ensure_capacity(command.argv.size() + 1);
@@ -842,7 +842,7 @@ ErrorOr<RefPtr<Job>> Shell::run_command(const AST::Command& command)
return *job;
}
-void Shell::execute_process(Vector<const char*>&& argv)
+void Shell::execute_process(Vector<char const*>&& argv)
{
#ifdef __serenity__
for (auto& promise : m_active_promises) {
@@ -1008,7 +1008,7 @@ NonnullRefPtrVector<Job> Shell::run_commands(Vector<AST::Command>& commands)
return spawned_jobs;
}
-bool Shell::run_file(const String& filename, bool explicitly_invoked)
+bool Shell::run_file(String const& filename, bool explicitly_invoked)
{
TemporaryChange script_change { current_script, filename };
TemporaryChange interactive_change { m_is_interactive, false };
@@ -1062,7 +1062,7 @@ void Shell::block_on_pipeline(RefPtr<AST::Pipeline> pipeline)
void Shell::block_on_job(RefPtr<Job> job)
{
- TemporaryChange<const Job*> current_job { m_current_job, job.ptr() };
+ TemporaryChange<Job const*> current_job { m_current_job, job.ptr() };
if (!job)
return;
@@ -1310,7 +1310,7 @@ String Shell::find_in_path(StringView program_name)
String path = getenv("PATH");
if (!path.is_empty()) {
auto directories = path.split(':');
- for (const auto& directory : directories) {
+ for (auto const& directory : directories) {
Core::DirIterator programs(directory.characters(), Core::DirIterator::SkipDots);
while (programs.has_next()) {
auto program = programs.next_path();
@@ -1335,7 +1335,7 @@ void Shell::cache_path()
cached_path.clear_with_capacity();
// Add shell builtins to the cache.
- for (const auto& builtin_name : builtin_names)
+ for (auto const& builtin_name : builtin_names)
cached_path.append(escape_token(builtin_name));
// Add functions to the cache.
@@ -1347,7 +1347,7 @@ void Shell::cache_path()
}
// Add aliases to the cache.
- for (const auto& alias : m_aliases) {
+ for (auto const& alias : m_aliases) {
auto name = escape_token(alias.key);
if (cached_path.contains_slow(name))
continue;
@@ -1357,7 +1357,7 @@ void Shell::cache_path()
String path = getenv("PATH");
if (!path.is_empty()) {
auto directories = path.split(':');
- for (const auto& directory : directories) {
+ for (auto const& directory : directories) {
Core::DirIterator programs(directory.characters(), Core::DirIterator::SkipDots);
while (programs.has_next()) {
auto program = programs.next_path();
@@ -1374,7 +1374,7 @@ void Shell::cache_path()
quick_sort(cached_path);
}
-void Shell::add_entry_to_cache(const String& entry)
+void Shell::add_entry_to_cache(String const& entry)
{
size_t index = 0;
auto match = binary_search(cached_path.span(), entry, &index);
@@ -2223,7 +2223,7 @@ u64 Shell::find_last_job_id() const
return job_id;
}
-const Job* Shell::find_job(u64 id, bool is_pid)
+Job const* Shell::find_job(u64 id, bool is_pid)
{
for (auto& entry : jobs) {
if (is_pid) {
@@ -2237,7 +2237,7 @@ const Job* Shell::find_job(u64 id, bool is_pid)
return nullptr;
}
-void Shell::kill_job(const Job* job, int sig)
+void Shell::kill_job(Job const* job, int sig)
{
if (!job)
return;
@@ -2441,7 +2441,7 @@ void FileDescriptionCollector::add(int fd)
m_fds.append(fd);
}
-SavedFileDescriptors::SavedFileDescriptors(const NonnullRefPtrVector<AST::Rewiring>& intended_rewirings)
+SavedFileDescriptors::SavedFileDescriptors(NonnullRefPtrVector<AST::Rewiring> const& intended_rewirings)
{
for (auto& rewiring : intended_rewirings) {
int new_fd = dup(rewiring.new_fd);
diff --git a/Userland/Shell/Shell.h b/Userland/Shell/Shell.h
index 79bf8c327d..31d3066c10 100644
--- a/Userland/Shell/Shell.h
+++ b/Userland/Shell/Shell.h
@@ -96,10 +96,10 @@ public:
bool is_runnable(StringView);
ErrorOr<RefPtr<Job>> run_command(const AST::Command&);
NonnullRefPtrVector<Job> run_commands(Vector<AST::Command>&);
- bool run_file(const String&, bool explicitly_invoked = true);
- bool run_builtin(const AST::Command&, const NonnullRefPtrVector<AST::Rewiring>&, int& retval);
+ bool run_file(String const&, bool explicitly_invoked = true);
+ bool run_builtin(const AST::Command&, NonnullRefPtrVector<AST::Rewiring> const&, int& retval);
bool has_builtin(StringView) const;
- RefPtr<AST::Node> run_immediate_function(StringView name, AST::ImmediateExpression& invoking_node, const NonnullRefPtrVector<AST::Node>&);
+ RefPtr<AST::Node> run_immediate_function(StringView name, AST::ImmediateExpression& invoking_node, NonnullRefPtrVector<AST::Node> const&);
static bool has_immediate_function(StringView);
void block_on_job(RefPtr<Job>);
void block_on_pipeline(RefPtr<AST::Pipeline>);
@@ -118,8 +118,8 @@ public:
RefPtr<AST::Value> get_argument(size_t) const;
RefPtr<AST::Value> lookup_local_variable(StringView) const;
- String local_variable_or(StringView, const String&) const;
- void set_local_variable(const String&, RefPtr<AST::Value>, bool only_in_current_frame = false);
+ String local_variable_or(StringView, String const&) const;
+ void set_local_variable(String const&, RefPtr<AST::Value>, bool only_in_current_frame = false);
void unset_local_variable(StringView, bool only_in_current_frame = false);
void define_function(String name, Vector<String> argnames, RefPtr<AST::Node> body);
@@ -142,7 +142,7 @@ public:
};
struct Frame {
- Frame(NonnullOwnPtrVector<LocalFrame>& frames, const LocalFrame& frame)
+ Frame(NonnullOwnPtrVector<LocalFrame>& frames, LocalFrame const& frame)
: frames(frames)
, frame(frame)
{
@@ -153,7 +153,7 @@ public:
private:
NonnullOwnPtrVector<LocalFrame>& frames;
- const LocalFrame& frame;
+ LocalFrame const& frame;
bool should_destroy_frame { true };
};
@@ -235,9 +235,9 @@ public:
void restore_ios();
u64 find_last_job_id() const;
- const Job* find_job(u64 id, bool is_pid = false);
- const Job* current_job() const { return m_current_job; }
- void kill_job(const Job*, int sig);
+ Job const* find_job(u64 id, bool is_pid = false);
+ Job const* current_job() const { return m_current_job; }
+ void kill_job(Job const*, int sig);
String get_history_path();
void print_path(StringView path);
@@ -298,7 +298,7 @@ public:
}
bool has_error(ShellError err) const { return m_error == err; }
bool has_any_error() const { return !has_error(ShellError::None); }
- const String& error_description() const { return m_error_description; }
+ String const& error_description() const { return m_error_description; }
ShellError take_error()
{
auto err = m_error;
@@ -344,12 +344,12 @@ private:
Optional<int> resolve_job_spec(StringView);
void cache_path();
- void add_entry_to_cache(const String&);
+ void add_entry_to_cache(String const&);
void remove_entry_from_cache(StringView);
void stop_all_jobs();
- const Job* m_current_job { nullptr };
+ Job const* m_current_job { nullptr };
LocalFrame* find_frame_containing_local_variable(StringView name);
- const LocalFrame* find_frame_containing_local_variable(StringView name) const
+ LocalFrame const* find_frame_containing_local_variable(StringView name) const
{
return const_cast<Shell*>(this)->find_frame_containing_local_variable(name);
}
@@ -357,21 +357,21 @@ private:
void run_tail(RefPtr<Job>);
void run_tail(const AST::Command&, const AST::NodeWithAction&, int head_exit_code);
- [[noreturn]] void execute_process(Vector<const char*>&& argv);
+ [[noreturn]] void execute_process(Vector<char const*>&& argv);
virtual void custom_event(Core::CustomEvent&) override;
#define __ENUMERATE_SHELL_IMMEDIATE_FUNCTION(name) \
- RefPtr<AST::Node> immediate_##name(AST::ImmediateExpression& invoking_node, const NonnullRefPtrVector<AST::Node>&);
+ RefPtr<AST::Node> immediate_##name(AST::ImmediateExpression& invoking_node, NonnullRefPtrVector<AST::Node> const&);
ENUMERATE_SHELL_IMMEDIATE_FUNCTIONS();
#undef __ENUMERATE_SHELL_IMMEDIATE_FUNCTION
- RefPtr<AST::Node> immediate_length_impl(AST::ImmediateExpression& invoking_node, const NonnullRefPtrVector<AST::Node>&, bool across);
+ RefPtr<AST::Node> immediate_length_impl(AST::ImmediateExpression& invoking_node, NonnullRefPtrVector<AST::Node> const&, bool across);
#define __ENUMERATE_SHELL_BUILTIN(builtin) \
- int builtin_##builtin(int argc, const char** argv);
+ int builtin_##builtin(int argc, char const** argv);
ENUMERATE_SHELL_BUILTINS();
diff --git a/Userland/Shell/SyntaxHighlighter.cpp b/Userland/Shell/SyntaxHighlighter.cpp
index 619fe2429b..c469be4560 100644
--- a/Userland/Shell/SyntaxHighlighter.cpp
+++ b/Userland/Shell/SyntaxHighlighter.cpp
@@ -24,7 +24,7 @@ enum class AugmentedTokenKind : u32 {
class HighlightVisitor : public AST::NodeVisitor {
public:
- HighlightVisitor(Vector<GUI::TextDocumentSpan>& spans, const Gfx::Palette& palette, const GUI::TextDocument& document)
+ HighlightVisitor(Vector<GUI::TextDocumentSpan>& spans, Gfx::Palette const& palette, const GUI::TextDocument& document)
: m_spans(spans)
, m_palette(palette)
, m_document(document)
@@ -516,7 +516,7 @@ private:
}
Vector<GUI::TextDocumentSpan>& m_spans;
- const Gfx::Palette& m_palette;
+ Gfx::Palette const& m_palette;
const GUI::TextDocument& m_document;
bool m_is_first_in_command { false };
};
@@ -537,7 +537,7 @@ bool SyntaxHighlighter::is_navigatable(u64) const
return false;
}
-void SyntaxHighlighter::rehighlight(const Palette& palette)
+void SyntaxHighlighter::rehighlight(Palette const& palette)
{
auto text = m_client->get_text();
diff --git a/Userland/Shell/SyntaxHighlighter.h b/Userland/Shell/SyntaxHighlighter.h
index b2c7e22510..5f142c0b4e 100644
--- a/Userland/Shell/SyntaxHighlighter.h
+++ b/Userland/Shell/SyntaxHighlighter.h
@@ -19,7 +19,7 @@ public:
virtual bool is_navigatable(u64) const override;
virtual Syntax::Language language() const override { return Syntax::Language::Shell; }
- virtual void rehighlight(const Palette&) override;
+ virtual void rehighlight(Palette const&) override;
protected:
virtual Vector<MatchingTokenPair> matching_token_pairs_impl() const override;
diff --git a/Userland/Shell/main.cpp b/Userland/Shell/main.cpp
index 42d1ad2a5a..ae02376d81 100644
--- a/Userland/Shell/main.cpp
+++ b/Userland/Shell/main.cpp
@@ -157,11 +157,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
};
};
- const char* command_to_run = nullptr;
- const char* file_to_read_from = nullptr;
- Vector<const char*> script_args;
+ char const* command_to_run = nullptr;
+ char const* file_to_read_from = nullptr;
+ Vector<char const*> script_args;
bool skip_rc_files = false;
- const char* format = nullptr;
+ char const* format = nullptr;
bool should_format_live = false;
bool keep_open = false;
diff --git a/Userland/Utilities/aplay.cpp b/Userland/Utilities/aplay.cpp
index 3138a64934..97bc1ce7f6 100644
--- a/Userland/Utilities/aplay.cpp
+++ b/Userland/Utilities/aplay.cpp
@@ -23,7 +23,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath sendfd unix"));
- const char* path = nullptr;
+ char const* path = nullptr;
bool should_loop = false;
bool show_sample_progress = false;
diff --git a/Userland/Utilities/arp.cpp b/Userland/Utilities/arp.cpp
index 6b51cad357..616127ff9e 100644
--- a/Userland/Utilities/arp.cpp
+++ b/Userland/Utilities/arp.cpp
@@ -31,8 +31,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
static bool flag_set;
static bool flag_delete;
- const char* value_ipv4_address = nullptr;
- const char* value_hw_address = nullptr;
+ char const* value_ipv4_address = nullptr;
+ char const* value_hw_address = nullptr;
Core::ArgsParser args_parser;
args_parser.set_general_help("Display or modify the system ARP cache");
diff --git a/Userland/Utilities/base64.cpp b/Userland/Utilities/base64.cpp
index c612e39cea..8d65d39d70 100644
--- a/Userland/Utilities/base64.cpp
+++ b/Userland/Utilities/base64.cpp
@@ -20,7 +20,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::pledge("stdio rpath"));
bool decode = false;
- const char* filepath = nullptr;
+ char const* filepath = nullptr;
Core::ArgsParser args_parser;
args_parser.add_option(decode, "Decode data", "decode", 'd');
diff --git a/Userland/Utilities/blockdev.cpp b/Userland/Utilities/blockdev.cpp
index 14e87250ed..3c4a9ad737 100644
--- a/Userland/Utilities/blockdev.cpp
+++ b/Userland/Utilities/blockdev.cpp
@@ -27,7 +27,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::unveil(nullptr, nullptr));
TRY(Core::System::pledge("stdio rpath"));
- const char* device = nullptr;
+ char const* device = nullptr;
bool flag_get_disk_size = false;
bool flag_get_block_size = false;
diff --git a/Userland/Utilities/cal.cpp b/Userland/Utilities/cal.cpp
index 28ce938d5b..cc0a3d6176 100644
--- a/Userland/Utilities/cal.cpp
+++ b/Userland/Utilities/cal.cpp
@@ -12,9 +12,9 @@
#include <string.h>
#include <time.h>
-const int line_width = 70;
-const int line_count = 8;
-const int column_width = 22;
+int const line_width = 70;
+int const line_count = 8;
+int const column_width = 22;
char print_buffer[line_width * line_count];
char temp_buffer[line_width * 8];
diff --git a/Userland/Utilities/chgrp.cpp b/Userland/Utilities/chgrp.cpp
index 269b3a8592..6ebe9e548f 100644
--- a/Userland/Utilities/chgrp.cpp
+++ b/Userland/Utilities/chgrp.cpp
@@ -15,8 +15,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath chown", nullptr));
- const char* gid_arg = nullptr;
- const char* path = nullptr;
+ char const* gid_arg = nullptr;
+ char const* path = nullptr;
bool dont_follow_symlinks = false;
Core::ArgsParser args_parser;
diff --git a/Userland/Utilities/cksum.cpp b/Userland/Utilities/cksum.cpp
index 87807a94a7..d94f96c4f2 100644
--- a/Userland/Utilities/cksum.cpp
+++ b/Userland/Utilities/cksum.cpp
@@ -13,8 +13,8 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- Vector<const char*> paths;
- const char* opt_algorithm = nullptr;
+ Vector<char const*> paths;
+ char const* opt_algorithm = nullptr;
Core::ArgsParser args_parser;
args_parser.add_option(opt_algorithm, "Checksum algorithm (default 'crc32', use 'list' to list available algorithms)", "algorithm", '\0', nullptr);
diff --git a/Userland/Utilities/comm.cpp b/Userland/Utilities/comm.cpp
index 346bbd2e6a..6abe5eedd6 100644
--- a/Userland/Utilities/comm.cpp
+++ b/Userland/Utilities/comm.cpp
@@ -58,7 +58,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return 1;
}
- auto process_file = [](const String& path, auto& file, int file_number) {
+ auto process_file = [](String const& path, auto& file, int file_number) {
if (path == "-") {
file = Core::File::standard_input();
} else {
@@ -90,14 +90,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (!suppress_col3)
col3_fmt = String::formatted("{}{}", String::repeated(tab, tab_count++), print_color ? COL3_COLOR : "{}");
- auto cmp = [&](const String& str1, const String& str2) {
+ auto cmp = [&](String const& str1, String const& str2) {
if (case_insensitive)
return strcasecmp(str1.characters(), str2.characters());
else
return strcmp(str1.characters(), str2.characters());
};
- auto process_remaining = [](const String& fmt, auto& file, int& count, bool print) {
+ auto process_remaining = [](String const& fmt, auto& file, int& count, bool print) {
while (file->can_read_line()) {
++count;
auto line = file->read_line();
diff --git a/Userland/Utilities/copy.cpp b/Userland/Utilities/copy.cpp
index dcac098a7d..f5f21cb858 100644
--- a/Userland/Utilities/copy.cpp
+++ b/Userland/Utilities/copy.cpp
@@ -24,8 +24,8 @@ struct Options {
static Options parse_options(Main::Arguments arguments)
{
- const char* type = "text/plain";
- Vector<const char*> text;
+ char const* type = "text/plain";
+ Vector<char const*> text;
bool clear = false;
Core::ArgsParser args_parser;
diff --git a/Userland/Utilities/cpp-lexer.cpp b/Userland/Utilities/cpp-lexer.cpp
index 991214bab1..fbc2f49c38 100644
--- a/Userland/Utilities/cpp-lexer.cpp
+++ b/Userland/Utilities/cpp-lexer.cpp
@@ -12,7 +12,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
Core::ArgsParser args_parser;
- const char* path = nullptr;
+ char const* path = nullptr;
args_parser.add_positional_argument(path, "Cpp File", "cpp-file", Core::ArgsParser::Required::Yes);
args_parser.parse(arguments);
diff --git a/Userland/Utilities/cpp-parser.cpp b/Userland/Utilities/cpp-parser.cpp
index 65f52242ed..f1aee959c7 100644
--- a/Userland/Utilities/cpp-parser.cpp
+++ b/Userland/Utilities/cpp-parser.cpp
@@ -12,7 +12,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
Core::ArgsParser args_parser;
- const char* path = nullptr;
+ char const* path = nullptr;
bool tokens_mode = false;
args_parser.add_option(tokens_mode, "Print Tokens", "tokens", 'T');
args_parser.add_positional_argument(path, "Cpp File", "cpp-file", Core::ArgsParser::Required::No);
diff --git a/Userland/Utilities/cpp-preprocessor.cpp b/Userland/Utilities/cpp-preprocessor.cpp
index 834e80db8c..045aa8c3c7 100644
--- a/Userland/Utilities/cpp-preprocessor.cpp
+++ b/Userland/Utilities/cpp-preprocessor.cpp
@@ -13,7 +13,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
Core::ArgsParser args_parser;
- const char* path = nullptr;
+ char const* path = nullptr;
bool print_definitions = false;
args_parser.add_positional_argument(path, "File", "file", Core::ArgsParser::Required::Yes);
args_parser.add_option(print_definitions, "Print preprocessor definitions", "definitions", 'D');
diff --git a/Userland/Utilities/cut.cpp b/Userland/Utilities/cut.cpp
index 792ae3be20..6d19c9b64c 100644
--- a/Userland/Utilities/cut.cpp
+++ b/Userland/Utilities/cut.cpp
@@ -17,12 +17,12 @@ struct Range {
size_t m_from { 1 };
size_t m_to { SIZE_MAX };
- [[nodiscard]] bool intersects(const Range& other) const
+ [[nodiscard]] bool intersects(Range const& other) const
{
return !(other.m_from > m_to || other.m_to < m_from);
}
- void merge(const Range& other)
+ void merge(Range const& other)
{
// Can't merge two ranges that are disjoint.
VERIFY(intersects(other));
@@ -120,7 +120,7 @@ static bool expand_list(String& list, Vector<Range>& ranges)
return true;
}
-static void process_line_bytes(char* line, size_t length, const Vector<Range>& ranges)
+static void process_line_bytes(char* line, size_t length, Vector<Range> const& ranges)
{
for (auto& i : ranges) {
if (i.m_from >= length)
@@ -133,7 +133,7 @@ static void process_line_bytes(char* line, size_t length, const Vector<Range>& r
outln();
}
-static void process_line_fields(char* line, size_t length, const Vector<Range>& ranges, char delimiter)
+static void process_line_fields(char* line, size_t length, Vector<Range> const& ranges, char delimiter)
{
auto string_split = String(line, length).split(delimiter);
Vector<String> output_fields;
diff --git a/Userland/Utilities/date.cpp b/Userland/Utilities/date.cpp
index a7fdcb8a0d..1573fb1c4e 100644
--- a/Userland/Utilities/date.cpp
+++ b/Userland/Utilities/date.cpp
@@ -19,7 +19,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
bool print_iso_8601 = false;
bool print_rfc_3339 = false;
bool print_rfc_5322 = false;
- const char* set_date = nullptr;
+ char const* set_date = nullptr;
StringView format_string;
Core::ArgsParser args_parser;
diff --git a/Userland/Utilities/dd.cpp b/Userland/Utilities/dd.cpp
index 78b1cc4680..8537027468 100644
--- a/Userland/Utilities/dd.cpp
+++ b/Userland/Utilities/dd.cpp
@@ -15,7 +15,7 @@
#include <sys/types.h>
#include <unistd.h>
-const char* usage = "usage:\n"
+char const* usage = "usage:\n"
"\tdd <options>\n"
"options:\n"
"\tif=<file>\tinput file (default: stdin)\n"
diff --git a/Userland/Utilities/ddate.cpp b/Userland/Utilities/ddate.cpp
index c98f8d9019..212285526f 100644
--- a/Userland/Utilities/ddate.cpp
+++ b/Userland/Utilities/ddate.cpp
@@ -26,8 +26,8 @@ public:
m_date = date_from_day_of_yold(day);
}
- const char* day_of_week() { return m_day_of_week.characters(); };
- const char* season() { return m_season.characters(); };
+ char const* day_of_week() { return m_day_of_week.characters(); };
+ char const* season() { return m_season.characters(); };
uint16_t year() { return yold(); };
uint16_t yold() { return m_yold; };
uint16_t day_of_year() { return day_of_yold(); };
@@ -57,7 +57,7 @@ private:
return (day % m_days_in_season == 0 ? m_days_in_season : day % m_days_in_season);
}
- const char* day_of_week_from_day_of_yold(uint16_t day)
+ char const* day_of_week_from_day_of_yold(uint16_t day)
{
if (is_st_tibs_day())
return nullptr;
@@ -78,7 +78,7 @@ private:
}
}
- const char* season_from_day_of_yold(uint16_t day)
+ char const* season_from_day_of_yold(uint16_t day)
{
if (is_st_tibs_day())
return nullptr;
diff --git a/Userland/Utilities/diff.cpp b/Userland/Utilities/diff.cpp
index 51b785fa49..2f4ae8610a 100644
--- a/Userland/Utilities/diff.cpp
+++ b/Userland/Utilities/diff.cpp
@@ -27,7 +27,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto file2 = TRY(Core::File::open(filename2, Core::OpenMode::ReadOnly));
auto hunks = Diff::from_text(file1->read_all(), file2->read_all());
- for (const auto& hunk : hunks) {
+ for (auto const& hunk : hunks) {
auto original_start = hunk.original_start_line;
auto target_start = hunk.target_start_line;
auto num_added = hunk.added_lines.size();
@@ -55,7 +55,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
bool color_output = isatty(STDOUT_FILENO);
outln("Hunk: {}", sb.build());
- for (const auto& line : hunk.removed_lines) {
+ for (auto const& line : hunk.removed_lines) {
if (color_output)
outln("\033[31;1m< {}\033[0m", line);
else
@@ -63,7 +63,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
}
if (num_added > 0 && num_removed > 0)
outln("---");
- for (const auto& line : hunk.added_lines) {
+ for (auto const& line : hunk.added_lines) {
if (color_output)
outln("\033[32;1m> {}\033[0m", line);
else
diff --git a/Userland/Utilities/disk_benchmark.cpp b/Userland/Utilities/disk_benchmark.cpp
index d3dd9f9628..b5e1765fb7 100644
--- a/Userland/Utilities/disk_benchmark.cpp
+++ b/Userland/Utilities/disk_benchmark.cpp
@@ -24,7 +24,7 @@ struct Result {
u64 read_bps {};
};
-static Result average_result(const Vector<Result>& results)
+static Result average_result(Vector<Result> const& results)
{
Result average;
@@ -39,7 +39,7 @@ static Result average_result(const Vector<Result>& results)
return average;
}
-static ErrorOr<Result> benchmark(const String& filename, int file_size, ByteBuffer& buffer, bool allow_cache);
+static ErrorOr<Result> benchmark(String const& filename, int file_size, ByteBuffer& buffer, bool allow_cache);
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
@@ -99,7 +99,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return 0;
}
-ErrorOr<Result> benchmark(const String& filename, int file_size, ByteBuffer& buffer, bool allow_cache)
+ErrorOr<Result> benchmark(String const& filename, int file_size, ByteBuffer& buffer, bool allow_cache)
{
int flags = O_CREAT | O_TRUNC | O_RDWR;
if (!allow_cache)
diff --git a/Userland/Utilities/du.cpp b/Userland/Utilities/du.cpp
index 34771db5a8..00c039b63d 100644
--- a/Userland/Utilities/du.cpp
+++ b/Userland/Utilities/du.cpp
@@ -35,7 +35,7 @@ struct DuOption {
};
static ErrorOr<void> parse_args(Main::Arguments arguments, Vector<String>& files, DuOption& du_option, int& max_depth);
-static ErrorOr<off_t> print_space_usage(const String& path, const DuOption& du_option, int max_depth, bool inside_dir = false);
+static ErrorOr<off_t> print_space_usage(String const& path, DuOption const& du_option, int max_depth, bool inside_dir = false);
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
@@ -45,7 +45,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(parse_args(arguments, files, du_option, max_depth));
- for (const auto& file : files)
+ for (auto const& file : files)
TRY(print_space_usage(file, du_option, max_depth));
return 0;
@@ -54,8 +54,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
ErrorOr<void> parse_args(Main::Arguments arguments, Vector<String>& files, DuOption& du_option, int& max_depth)
{
bool summarize = false;
- const char* pattern = nullptr;
- const char* exclude_from = nullptr;
+ char const* pattern = nullptr;
+ char const* exclude_from = nullptr;
Vector<StringView> files_to_process;
Core::ArgsParser::Option time_option {
@@ -100,7 +100,7 @@ ErrorOr<void> parse_args(Main::Arguments arguments, Vector<String>& files, DuOpt
du_option.excluded_patterns.append(pattern);
if (exclude_from) {
auto file = TRY(Core::File::open(exclude_from, Core::OpenMode::ReadOnly));
- const auto buff = file->read_all();
+ auto const buff = file->read_all();
if (!buff.is_empty()) {
String patterns = String::copy(buff, Chomp);
du_option.excluded_patterns.extend(patterns.split('\n'));
@@ -118,11 +118,11 @@ ErrorOr<void> parse_args(Main::Arguments arguments, Vector<String>& files, DuOpt
return {};
}
-ErrorOr<off_t> print_space_usage(const String& path, const DuOption& du_option, int max_depth, bool inside_dir)
+ErrorOr<off_t> print_space_usage(String const& path, DuOption const& du_option, int max_depth, bool inside_dir)
{
struct stat path_stat = TRY(Core::System::lstat(path.characters()));
off_t directory_size = 0;
- const bool is_directory = S_ISDIR(path_stat.st_mode);
+ bool const is_directory = S_ISDIR(path_stat.st_mode);
if (--max_depth >= 0 && is_directory) {
auto di = Core::DirIterator(path, Core::DirIterator::SkipParentAndBaseDir);
if (di.has_error()) {
@@ -131,13 +131,13 @@ ErrorOr<off_t> print_space_usage(const String& path, const DuOption& du_option,
}
while (di.has_next()) {
- const auto child_path = di.next_full_path();
+ auto const child_path = di.next_full_path();
directory_size += TRY(print_space_usage(child_path, du_option, max_depth, true));
}
}
- const auto basename = LexicalPath::basename(path);
- for (const auto& pattern : du_option.excluded_patterns) {
+ auto const basename = LexicalPath::basename(path);
+ for (auto const& pattern : du_option.excluded_patterns) {
if (basename.matches(pattern, CaseSensitivity::CaseSensitive))
return { 0 };
}
@@ -180,7 +180,7 @@ ErrorOr<off_t> print_space_usage(const String& path, const DuOption& du_option,
break;
}
- const auto formatted_time = Core::DateTime::from_timestamp(time).to_string();
+ auto const formatted_time = Core::DateTime::from_timestamp(time).to_string();
outln("\t{}\t{}", formatted_time, path);
}
diff --git a/Userland/Utilities/echo.cpp b/Userland/Utilities/echo.cpp
index 6e8850ba40..b5f37189ba 100644
--- a/Userland/Utilities/echo.cpp
+++ b/Userland/Utilities/echo.cpp
@@ -101,7 +101,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio"));
- Vector<const char*> text;
+ Vector<char const*> text;
bool no_trailing_newline = false;
bool should_interpret_backslash_escapes = false;
diff --git a/Userland/Utilities/env.cpp b/Userland/Utilities/env.cpp
index f73ef75809..95a17888e4 100644
--- a/Userland/Utilities/env.cpp
+++ b/Userland/Utilities/env.cpp
@@ -17,8 +17,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::pledge("stdio rpath exec"));
bool ignore_env = false;
- const char* split_string = nullptr;
- Vector<const char*> values;
+ char const* split_string = nullptr;
+ Vector<char const*> values;
Core::ArgsParser args_parser;
args_parser.set_stop_on_first_non_option(true);
@@ -42,7 +42,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
}
Vector<String> split_string_storage;
- Vector<const char*> new_argv;
+ Vector<char const*> new_argv;
if (split_string) {
for (auto view : StringView(split_string).split_view(' ')) {
split_string_storage.append(view);
@@ -65,7 +65,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
new_argv.append(nullptr);
- const char* executable = new_argv[0];
+ char const* executable = new_argv[0];
char* const* new_argv_ptr = const_cast<char* const*>(&new_argv[0]);
execvp(executable, new_argv_ptr);
diff --git a/Userland/Utilities/expr.cpp b/Userland/Utilities/expr.cpp
index a16d552f49..2ef9e4e2ba 100644
--- a/Userland/Utilities/expr.cpp
+++ b/Userland/Utilities/expr.cpp
@@ -388,7 +388,7 @@ private:
VERIFY_NOT_REACHED();
}
- static auto safe_substring(const String& str, int start, int length)
+ static auto safe_substring(String const& str, int start, int length)
{
if (start < 1 || (size_t)start > str.length())
fail("Index out of range");
diff --git a/Userland/Utilities/file.cpp b/Userland/Utilities/file.cpp
index b529434ab0..09ebb1a742 100644
--- a/Userland/Utilities/file.cpp
+++ b/Userland/Utilities/file.cpp
@@ -19,13 +19,13 @@
#include <sys/stat.h>
#include <unistd.h>
-static Optional<String> description_only(String description, [[maybe_unused]] const String& path)
+static Optional<String> description_only(String description, [[maybe_unused]] String const& path)
{
return description;
}
// FIXME: Ideally Gfx::ImageDecoder could tell us the image type directly.
-static Optional<String> image_details(const String& description, const String& path)
+static Optional<String> image_details(String const& description, String const& path)
{
auto file_or_error = Core::MappedFile::map(path);
if (file_or_error.is_error())
@@ -39,7 +39,7 @@ static Optional<String> image_details(const String& description, const String& p
return String::formatted("{}, {} x {}", description, image_decoder->width(), image_decoder->height());
}
-static Optional<String> gzip_details(String description, const String& path)
+static Optional<String> gzip_details(String description, String const& path)
{
auto file_or_error = Core::MappedFile::map(path);
if (file_or_error.is_error())
@@ -56,7 +56,7 @@ static Optional<String> gzip_details(String description, const String& path)
return String::formatted("{}, {}", description, gzip_details.value());
}
-static Optional<String> elf_details(String description, const String& path)
+static Optional<String> elf_details(String description, String const& path)
{
auto file_or_error = Core::MappedFile::map(path);
if (file_or_error.is_error())
@@ -127,7 +127,7 @@ static Optional<String> elf_details(String description, const String& path)
__ENUMERATE_MIME_TYPE_DESCRIPTION("text/markdown", "Markdown document", description_only) \
__ENUMERATE_MIME_TYPE_DESCRIPTION("text/x-shellscript", "POSIX shell script text executable", description_only)
-static Optional<String> get_description_from_mime_type(const String& mime, const String& path)
+static Optional<String> get_description_from_mime_type(String const& mime, String const& path)
{
#define __ENUMERATE_MIME_TYPE_DESCRIPTION(mime_type, description, details) \
if (String(mime_type) == mime) \
@@ -141,7 +141,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath"));
- Vector<const char*> paths;
+ Vector<char const*> paths;
bool flag_mime_only = false;
Core::ArgsParser args_parser;
diff --git a/Userland/Utilities/find.cpp b/Userland/Utilities/find.cpp
index aee5d9544c..5e45359228 100644
--- a/Userland/Utilities/find.cpp
+++ b/Userland/Utilities/find.cpp
@@ -44,7 +44,7 @@ struct FileData {
// The parent directory of the file.
int dirfd { -1 };
// The file's basename, relative to the directory.
- const char* basename { nullptr };
+ char const* basename { nullptr };
// Optionally, cached information as returned by stat/lstat/fstatat.
struct stat stat {
};
@@ -110,7 +110,7 @@ private:
class TypeCommand final : public Command {
public:
- TypeCommand(const char* arg)
+ TypeCommand(char const* arg)
{
StringView type = arg;
if (type.length() != 1 || !StringView("bcdlpfs").contains(type[0]))
@@ -155,7 +155,7 @@ private:
class LinksCommand final : public StatCommand {
public:
- LinksCommand(const char* arg)
+ LinksCommand(char const* arg)
{
auto number = StringView(arg).to_uint();
if (!number.has_value())
@@ -174,7 +174,7 @@ private:
class UserCommand final : public StatCommand {
public:
- UserCommand(const char* arg)
+ UserCommand(char const* arg)
{
if (struct passwd* passwd = getpwnam(arg)) {
m_uid = passwd->pw_uid;
@@ -198,7 +198,7 @@ private:
class GroupCommand final : public StatCommand {
public:
- GroupCommand(const char* arg)
+ GroupCommand(char const* arg)
{
if (struct group* gr = getgrnam(arg)) {
m_gid = gr->gr_gid;
@@ -222,7 +222,7 @@ private:
class SizeCommand final : public StatCommand {
public:
- SizeCommand(const char* arg)
+ SizeCommand(char const* arg)
{
StringView view = arg;
if (view.ends_with('c')) {
@@ -251,7 +251,7 @@ private:
class NameCommand : public Command {
public:
- NameCommand(const char* pattern, CaseSensitivity case_sensitivity)
+ NameCommand(char const* pattern, CaseSensitivity case_sensitivity)
: m_pattern(pattern)
, m_case_sensitivity(case_sensitivity)
{
diff --git a/Userland/Utilities/fortune.cpp b/Userland/Utilities/fortune.cpp
index 324ec17874..9f5f413f9a 100644
--- a/Userland/Utilities/fortune.cpp
+++ b/Userland/Utilities/fortune.cpp
@@ -21,7 +21,7 @@
class Quote {
public:
- static Optional<Quote> try_parse(const JsonValue& value)
+ static Optional<Quote> try_parse(JsonValue const& value)
{
if (!value.is_object())
return {};
@@ -41,11 +41,11 @@ public:
return q;
}
- const String& quote() const { return m_quote; }
- const String& author() const { return m_author; }
- const u64& utc_time() const { return m_utc_time; }
- const String& url() const { return m_url; }
- const Optional<String>& context() const { return m_context; }
+ String const& quote() const { return m_quote; }
+ String const& author() const { return m_author; }
+ u64 const& utc_time() const { return m_utc_time; }
+ String const& url() const { return m_url; }
+ Optional<String> const& context() const { return m_context; }
private:
Quote() = default;
@@ -57,7 +57,7 @@ private:
Optional<String> m_context;
};
-static Vector<Quote> parse_all(const JsonArray& array)
+static Vector<Quote> parse_all(JsonArray const& array)
{
Vector<Quote> quotes;
for (size_t i = 0; i < array.size(); ++i) {
@@ -75,7 +75,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath"));
- const char* path = "/res/fortunes.json";
+ char const* path = "/res/fortunes.json";
Core::ArgsParser args_parser;
args_parser.set_general_help("Open a fortune cookie, receive a free quote for the day!");
@@ -94,14 +94,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return 1;
}
- const auto quotes = parse_all(json.as_array());
+ auto const quotes = parse_all(json.as_array());
if (quotes.is_empty()) {
warnln("{} does not contain any valid quotes", path);
return 1;
}
u32 i = get_random_uniform(quotes.size());
- const auto& chosen_quote = quotes[i];
+ auto const& chosen_quote = quotes[i];
auto datetime = Core::DateTime::from_timestamp(chosen_quote.utc_time());
outln(); // Tasteful spacing
diff --git a/Userland/Utilities/functrace.cpp b/Userland/Utilities/functrace.cpp
index f082b866ad..6bfc19d081 100644
--- a/Userland/Utilities/functrace.cpp
+++ b/Userland/Utilities/functrace.cpp
@@ -71,7 +71,7 @@ static void print_syscall(PtraceRegisters& regs, size_t depth)
static NonnullOwnPtr<HashMap<FlatPtr, X86::Instruction>> instrument_code()
{
auto instrumented = make<HashMap<FlatPtr, X86::Instruction>>();
- g_debug_session->for_each_loaded_library([&](const Debug::LoadedLibrary& lib) {
+ g_debug_session->for_each_loaded_library([&](Debug::LoadedLibrary const& lib) {
lib.debug_info->elf().for_each_section_of_type(SHT_PROGBITS, [&](const ELF::Image::Section& section) {
if (section.name() != ".text")
return IterationDecision::Continue;
diff --git a/Userland/Utilities/gml-format.cpp b/Userland/Utilities/gml-format.cpp
index f278f290a1..d764d823cb 100644
--- a/Userland/Utilities/gml-format.cpp
+++ b/Userland/Utilities/gml-format.cpp
@@ -53,7 +53,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
#endif
bool inplace = false;
- Vector<const char*> files;
+ Vector<char const*> files;
Core::ArgsParser args_parser;
args_parser.set_general_help("Format GML files.");
diff --git a/Userland/Utilities/grep.cpp b/Userland/Utilities/grep.cpp
index dc8d971c7b..e0ae1fcb46 100644
--- a/Userland/Utilities/grep.cpp
+++ b/Userland/Utilities/grep.cpp
@@ -39,11 +39,11 @@ ErrorOr<int> serenity_main(Main::Arguments args)
String program_name = AK::LexicalPath::basename(args.strings[0]);
- Vector<const char*> files;
+ Vector<char const*> files;
bool recursive = (program_name == "rgrep"sv);
bool use_ere = (program_name == "egrep"sv);
- Vector<const char*> patterns;
+ Vector<char const*> patterns;
BinaryFileMode binary_mode { BinaryFileMode::Binary };
bool case_insensitive = false;
bool line_numbers = false;
diff --git a/Userland/Utilities/groups.cpp b/Userland/Utilities/groups.cpp
index b995726793..f67041a694 100644
--- a/Userland/Utilities/groups.cpp
+++ b/Userland/Utilities/groups.cpp
@@ -12,7 +12,7 @@
#include <grp.h>
#include <unistd.h>
-static void print_account_gids(const Core::Account& account)
+static void print_account_gids(Core::Account const& account)
{
auto* gr = getgrgid(account.gid());
if (!gr) {
@@ -35,7 +35,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::unveil(nullptr, nullptr));
TRY(Core::System::pledge("stdio rpath", nullptr));
- Vector<const char*> usernames;
+ Vector<char const*> usernames;
Core::ArgsParser args_parser;
args_parser.set_general_help("Print group memberships for each username or, if no username is specified, for the current process.");
diff --git a/Userland/Utilities/gunzip.cpp b/Userland/Utilities/gunzip.cpp
index cd8879577a..4026c74bcf 100644
--- a/Userland/Utilities/gunzip.cpp
+++ b/Userland/Utilities/gunzip.cpp
@@ -18,7 +18,7 @@ static bool decompress_file(Buffered<Core::InputFileStream>& input_stream, Buffe
u8 buffer[4096];
while (!gzip_stream.has_any_error() && !gzip_stream.unreliable_eof()) {
- const auto nread = gzip_stream.read({ buffer, sizeof(buffer) });
+ auto const nread = gzip_stream.read({ buffer, sizeof(buffer) });
output_stream.write_or_error({ buffer, nread });
}
diff --git a/Userland/Utilities/head.cpp b/Userland/Utilities/head.cpp
index a230652398..35163e202b 100644
--- a/Userland/Utilities/head.cpp
+++ b/Userland/Utilities/head.cpp
@@ -14,7 +14,7 @@
#include <string.h>
#include <unistd.h>
-int head(const String& filename, bool print_filename, ssize_t line_count, ssize_t byte_count);
+int head(String const& filename, bool print_filename, ssize_t line_count, ssize_t byte_count);
ErrorOr<int> serenity_main(Main::Arguments args)
{
@@ -24,7 +24,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
int byte_count = -1;
bool never_print_filenames = false;
bool always_print_filenames = false;
- Vector<const char*> files;
+ Vector<char const*> files;
Core::ArgsParser args_parser;
args_parser.set_general_help("Print the beginning ('head') of a file.");
@@ -60,7 +60,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
return rc;
}
-int head(const String& filename, bool print_filename, ssize_t line_count, ssize_t byte_count)
+int head(String const& filename, bool print_filename, ssize_t line_count, ssize_t byte_count)
{
bool is_stdin = false;
int fd = -1;
@@ -114,7 +114,7 @@ int head(const String& filename, bool print_filename, ssize_t line_count, ssize_
// Count line breaks.
ntowrite = 0;
while (line_count) {
- const char* newline = strchr(buffer + ntowrite, '\n');
+ char const* newline = strchr(buffer + ntowrite, '\n');
if (newline) {
// Found another line break, include this line.
ntowrite = newline - buffer + 1;
diff --git a/Userland/Utilities/hexdump.cpp b/Userland/Utilities/hexdump.cpp
index 8e53001bea..89cf83fc79 100644
--- a/Userland/Utilities/hexdump.cpp
+++ b/Userland/Utilities/hexdump.cpp
@@ -22,7 +22,7 @@ enum class State {
ErrorOr<int> serenity_main(Main::Arguments args)
{
Core::ArgsParser args_parser;
- const char* path = nullptr;
+ char const* path = nullptr;
bool verbose = false;
args_parser.add_positional_argument(path, "Input", "input", Core::ArgsParser::Required::No);
args_parser.add_option(verbose, "Display all input data", "verbose", 'v');
diff --git a/Userland/Utilities/host.cpp b/Userland/Utilities/host.cpp
index 8ff389d103..959dee48dc 100644
--- a/Userland/Utilities/host.cpp
+++ b/Userland/Utilities/host.cpp
@@ -16,7 +16,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
{
TRY(Core::System::pledge("stdio unix", nullptr));
- const char* name_or_ip = nullptr;
+ char const* name_or_ip = nullptr;
Core::ArgsParser args_parser;
args_parser.set_general_help("Convert between domain name and IPv4 address.");
args_parser.add_positional_argument(name_or_ip, "Domain name or IPv4 address", "name");
@@ -46,7 +46,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
}
char buffer[INET_ADDRSTRLEN];
- const char* ip_str = inet_ntop(AF_INET, hostent->h_addr_list[0], buffer, sizeof(buffer));
+ char const* ip_str = inet_ntop(AF_INET, hostent->h_addr_list[0], buffer, sizeof(buffer));
outln("{} is {}", name_or_ip, ip_str);
return 0;
diff --git a/Userland/Utilities/hostname.cpp b/Userland/Utilities/hostname.cpp
index b99713638f..3275604115 100644
--- a/Userland/Utilities/hostname.cpp
+++ b/Userland/Utilities/hostname.cpp
@@ -14,7 +14,7 @@
ErrorOr<int> serenity_main(Main::Arguments args)
{
- const char* hostname = nullptr;
+ char const* hostname = nullptr;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(hostname, "Hostname to set", "hostname", Core::ArgsParser::Required::No);
diff --git a/Userland/Utilities/ifconfig.cpp b/Userland/Utilities/ifconfig.cpp
index 64bfaad74e..6fb108460a 100644
--- a/Userland/Utilities/ifconfig.cpp
+++ b/Userland/Utilities/ifconfig.cpp
@@ -25,10 +25,10 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- const char* value_ipv4 = nullptr;
- const char* value_adapter = nullptr;
- const char* value_gateway = nullptr;
- const char* value_mask = nullptr;
+ char const* value_ipv4 = nullptr;
+ char const* value_adapter = nullptr;
+ char const* value_gateway = nullptr;
+ char const* value_mask = nullptr;
Core::ArgsParser args_parser;
args_parser.set_general_help("Display or modify the configuration of each network interface.");
diff --git a/Userland/Utilities/ini.cpp b/Userland/Utilities/ini.cpp
index 6c47f258fe..ae152a83fc 100644
--- a/Userland/Utilities/ini.cpp
+++ b/Userland/Utilities/ini.cpp
@@ -14,10 +14,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath wpath cpath"));
- const char* path = nullptr;
- const char* group = nullptr;
- const char* key = nullptr;
- const char* value_to_write = nullptr;
+ char const* path = nullptr;
+ char const* group = nullptr;
+ char const* key = nullptr;
+ char const* value_to_write = nullptr;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(path, "Path to INI file", "path");
diff --git a/Userland/Utilities/jp.cpp b/Userland/Utilities/jp.cpp
index 1523e01254..43584e8a03 100644
--- a/Userland/Utilities/jp.cpp
+++ b/Userland/Utilities/jp.cpp
@@ -15,7 +15,7 @@
#include <LibMain/Main.h>
#include <unistd.h>
-static void print(const JsonValue& value, int spaces_per_indent, int indent = 0, bool use_color = true);
+static void print(JsonValue const& value, int spaces_per_indent, int indent = 0, bool use_color = true);
static void print_indent(int indent, int spaces_per_indent)
{
for (int i = 0; i < indent * spaces_per_indent; ++i)
@@ -53,7 +53,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return 0;
}
-void print(const JsonValue& value, int spaces_per_indent, int indent, bool use_color)
+void print(JsonValue const& value, int spaces_per_indent, int indent, bool use_color)
{
if (value.is_object()) {
size_t printed_members = 0;
diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp
index 25423b4641..961b6e5449 100644
--- a/Userland/Utilities/js.cpp
+++ b/Userland/Utilities/js.cpp
@@ -229,7 +229,7 @@ static String strip_ansi(StringView format_string)
}
template<typename... Parameters>
-static void js_out(CheckedFormatString<Parameters...>&& fmtstr, const Parameters&... parameters)
+static void js_out(CheckedFormatString<Parameters...>&& fmtstr, Parameters const&... parameters)
{
if (!s_strip_ansi)
return out(move(fmtstr), parameters...);
@@ -238,7 +238,7 @@ static void js_out(CheckedFormatString<Parameters...>&& fmtstr, const Parameters
}
template<typename... Parameters>
-static void js_outln(CheckedFormatString<Parameters...>&& fmtstr, const Parameters&... parameters)
+static void js_outln(CheckedFormatString<Parameters...>&& fmtstr, Parameters const&... parameters)
{
if (!s_strip_ansi)
return outln(move(fmtstr), parameters...);
diff --git a/Userland/Utilities/killall.cpp b/Userland/Utilities/killall.cpp
index af9b5209b0..fe1628ce1d 100644
--- a/Userland/Utilities/killall.cpp
+++ b/Userland/Utilities/killall.cpp
@@ -19,7 +19,7 @@ static void print_usage_and_exit()
exit(1);
}
-static ErrorOr<int> kill_all(const String& process_name, const unsigned signum)
+static ErrorOr<int> kill_all(String const& process_name, unsigned const signum)
{
auto all_processes = Core::ProcessStatisticsReader::get_all();
if (!all_processes.has_value())
diff --git a/Userland/Utilities/less.cpp b/Userland/Utilities/less.cpp
index b526116eca..de7fef050b 100644
--- a/Userland/Utilities/less.cpp
+++ b/Userland/Utilities/less.cpp
@@ -587,7 +587,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
continue;
}
- const auto& sequence = sequence_value.value();
+ auto const& sequence = sequence_value.value();
if (sequence.to_uint().has_value()) {
modifier_buffer.append(sequence);
diff --git a/Userland/Utilities/ln.cpp b/Userland/Utilities/ln.cpp
index 6fa20fdace..b79cf44692 100644
--- a/Userland/Utilities/ln.cpp
+++ b/Userland/Utilities/ln.cpp
@@ -16,8 +16,8 @@ ErrorOr<int> serenity_main(Main::Arguments argmuments)
bool force = false;
bool symbolic = false;
- const char* target = nullptr;
- const char* path = nullptr;
+ char const* target = nullptr;
+ char const* path = nullptr;
Core::ArgsParser args_parser;
args_parser.add_option(force, "Force the creation", "force", 'f');
diff --git a/Userland/Utilities/ls.cpp b/Userland/Utilities/ls.cpp
index 99fa387479..793414cb71 100644
--- a/Userland/Utilities/ls.cpp
+++ b/Userland/Utilities/ls.cpp
@@ -42,10 +42,10 @@ struct FileMetadata {
};
};
-static int do_file_system_object_long(const char* path);
-static int do_file_system_object_short(const char* path);
+static int do_file_system_object_long(char const* path);
+static int do_file_system_object_short(char const* path);
-static bool print_names(const char* path, size_t longest_name, const Vector<FileMetadata>& files);
+static bool print_names(char const* path, size_t longest_name, Vector<FileMetadata> const& files);
static bool filemetadata_comparator(FileMetadata& a, FileMetadata& b);
@@ -136,7 +136,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
endgrent();
}
- auto do_file_system_object = [&](const char* path) {
+ auto do_file_system_object = [&](char const* path) {
if (flag_long)
return do_file_system_object_long(path);
return do_file_system_object_short(path);
@@ -235,7 +235,7 @@ static String& hostname()
return s_hostname;
}
-static size_t print_name(const struct stat& st, const String& name, const char* path_for_link_resolution, const char* path_for_hyperlink)
+static size_t print_name(const struct stat& st, String const& name, char const* path_for_link_resolution, char const* path_for_hyperlink)
{
if (!flag_disable_hyperlinks) {
auto full_path = Core::File::real_path_for(path_for_hyperlink);
@@ -250,8 +250,8 @@ static size_t print_name(const struct stat& st, const String& name, const char*
if (!flag_colorize || !output_is_terminal) {
nprinted = printf("%s", name.characters());
} else {
- const char* begin_color = "";
- const char* end_color = "\033[0m";
+ char const* begin_color = "";
+ char const* end_color = "\033[0m";
if (st.st_mode & S_ISVTX)
begin_color = "\033[42;30;1m";
@@ -300,7 +300,7 @@ static size_t print_name(const struct stat& st, const String& name, const char*
return nprinted;
}
-static bool print_filesystem_object(const String& path, const String& name, const struct stat& st)
+static bool print_filesystem_object(String const& path, String const& name, const struct stat& st)
{
if (flag_show_inode)
printf("%s ", String::formatted("{}", st.st_ino).characters());
@@ -373,7 +373,7 @@ static bool print_filesystem_object(const String& path, const String& name, cons
return true;
}
-static int do_file_system_object_long(const char* path)
+static int do_file_system_object_long(char const* path)
{
if (flag_list_directories_only) {
struct stat stat {
@@ -440,7 +440,7 @@ static int do_file_system_object_long(const char* path)
return 0;
}
-static bool print_filesystem_object_short(const char* path, const char* name, size_t* nprinted)
+static bool print_filesystem_object_short(char const* path, char const* name, size_t* nprinted)
{
struct stat st;
int rc = lstat(path, &st);
@@ -456,7 +456,7 @@ static bool print_filesystem_object_short(const char* path, const char* name, si
return true;
}
-static bool print_names(const char* path, size_t longest_name, const Vector<FileMetadata>& files)
+static bool print_names(char const* path, size_t longest_name, Vector<FileMetadata> const& files)
{
size_t printed_on_row = 0;
size_t nprinted = 0;
@@ -490,7 +490,7 @@ static bool print_names(const char* path, size_t longest_name, const Vector<File
return printed_on_row;
}
-int do_file_system_object_short(const char* path)
+int do_file_system_object_short(char const* path)
{
if (flag_list_directories_only) {
size_t nprinted = 0;
diff --git a/Userland/Utilities/lsof.cpp b/Userland/Utilities/lsof.cpp
index 1d093c66f5..396ea9eeea 100644
--- a/Userland/Utilities/lsof.cpp
+++ b/Userland/Utilities/lsof.cpp
@@ -80,7 +80,7 @@ static Vector<OpenFile> get_open_files_by_pid(pid_t pid)
auto json = json_or_error.release_value();
Vector<OpenFile> files;
- json.as_array().for_each([pid, &files](const JsonValue& object) {
+ json.as_array().for_each([pid, &files](JsonValue const& object) {
OpenFile open_file;
open_file.pid = pid;
open_file.fd = object.as_object().get("fd").to_int();
@@ -94,7 +94,7 @@ static Vector<OpenFile> get_open_files_by_pid(pid_t pid)
return files;
}
-static void display_entry(const OpenFile& file, const Core::ProcessStatistics& statistics)
+static void display_entry(OpenFile const& file, Core::ProcessStatistics const& statistics)
{
outln("{:28} {:>4} {:>4} {:10} {:>4} {}", statistics.name, file.pid, statistics.pgid, statistics.username, file.fd, file.full_name);
}
diff --git a/Userland/Utilities/man.cpp b/Userland/Utilities/man.cpp
index c56ff45c11..547314f906 100644
--- a/Userland/Utilities/man.cpp
+++ b/Userland/Utilities/man.cpp
@@ -59,9 +59,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::unveil("/bin", "x"));
TRY(Core::System::unveil(nullptr, nullptr));
- const char* section = nullptr;
- const char* name = nullptr;
- const char* pager = nullptr;
+ char const* section = nullptr;
+ char const* name = nullptr;
+ char const* pager = nullptr;
Core::ArgsParser args_parser;
args_parser.set_general_help("Read manual pages. Try 'man man' to get started.");
@@ -70,11 +70,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_option(pager, "Pager to pipe the man page to", "pager", 'P', "pager");
args_parser.parse(arguments);
- auto make_path = [name](const char* section) {
+ auto make_path = [name](char const* section) {
return String::formatted("/usr/share/man/man{}/{}.md", section, name);
};
if (!section) {
- const char* sections[] = {
+ char const* sections[] = {
"1",
"2",
"3",
diff --git a/Userland/Utilities/md.cpp b/Userland/Utilities/md.cpp
index b40c6d88f8..87dd3cb887 100644
--- a/Userland/Utilities/md.cpp
+++ b/Userland/Utilities/md.cpp
@@ -17,7 +17,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath tty"));
- const char* filename = nullptr;
+ char const* filename = nullptr;
bool html = false;
int view_width = 0;
diff --git a/Userland/Utilities/mkdir.cpp b/Userland/Utilities/mkdir.cpp
index 156fd1b2ca..5ba85d498c 100644
--- a/Userland/Utilities/mkdir.cpp
+++ b/Userland/Utilities/mkdir.cpp
@@ -22,7 +22,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
bool create_parents = false;
String mode_string;
- Vector<const char*> directories;
+ Vector<char const*> directories;
Core::ArgsParser args_parser;
args_parser.add_option(create_parents, "Create parent directories if they don't exist", "parents", 'p');
diff --git a/Userland/Utilities/mktemp.cpp b/Userland/Utilities/mktemp.cpp
index 2ff833f8d3..f79d68131b 100644
--- a/Userland/Utilities/mktemp.cpp
+++ b/Userland/Utilities/mktemp.cpp
@@ -76,7 +76,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
target_directory = getcwd(nullptr, 0);
} else {
LexicalPath template_path(file_template);
- const char* env_directory = getenv("TMPDIR");
+ char const* env_directory = getenv("TMPDIR");
target_directory = env_directory && *env_directory ? env_directory : "/tmp";
}
}
diff --git a/Userland/Utilities/mv.cpp b/Userland/Utilities/mv.cpp
index ba103665c8..23e374fa85 100644
--- a/Userland/Utilities/mv.cpp
+++ b/Userland/Utilities/mv.cpp
@@ -24,7 +24,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
bool force = false;
bool verbose = false;
- Vector<const char*> paths;
+ Vector<char const*> paths;
Core::ArgsParser args_parser;
args_parser.add_option(force, "Force", "force", 'f');
@@ -57,7 +57,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
for (auto& old_path : paths) {
String combined_new_path;
- const char* new_path = original_new_path;
+ char const* new_path = original_new_path;
if (S_ISDIR(st.st_mode)) {
auto old_basename = LexicalPath::basename(old_path);
combined_new_path = String::formatted("{}/{}", original_new_path, old_basename);
diff --git a/Userland/Utilities/nc.cpp b/Userland/Utilities/nc.cpp
index 09efa7f4cc..8d11fd61e7 100644
--- a/Userland/Utilities/nc.cpp
+++ b/Userland/Utilities/nc.cpp
@@ -50,7 +50,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
bool verbose = false;
bool should_close = false;
bool udp_mode = false;
- const char* target = nullptr;
+ char const* target = nullptr;
int port = 0;
int maximum_tcp_receive_buffer_size_input = -1;
@@ -135,7 +135,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
sockaddr_in dst_addr {};
dst_addr.sin_family = AF_INET;
dst_addr.sin_port = htons(port);
- dst_addr.sin_addr.s_addr = *(const in_addr_t*)hostent->h_addr_list[0];
+ dst_addr.sin_addr.s_addr = *(in_addr_t const*)hostent->h_addr_list[0];
if (verbose) {
char addr_str[INET_ADDRSTRLEN];
diff --git a/Userland/Utilities/nl.cpp b/Userland/Utilities/nl.cpp
index 28d080fdac..63787c8511 100644
--- a/Userland/Utilities/nl.cpp
+++ b/Userland/Utilities/nl.cpp
@@ -22,10 +22,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
NumberStyle number_style = NumberNonEmptyLines;
int increment = 1;
- const char* separator = " ";
+ char const* separator = " ";
int start_number = 1;
int number_width = 6;
- Vector<const char*> files;
+ Vector<char const*> files;
Core::ArgsParser args_parser;
@@ -35,7 +35,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
"body-numbering",
'b',
"style",
- [&number_style](const char* s) {
+ [&number_style](char const* s) {
if (!strcmp(s, "t"))
number_style = NumberNonEmptyLines;
else if (!strcmp(s, "a"))
diff --git a/Userland/Utilities/notify.cpp b/Userland/Utilities/notify.cpp
index 62b7845882..f889c67990 100644
--- a/Userland/Utilities/notify.cpp
+++ b/Userland/Utilities/notify.cpp
@@ -15,9 +15,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto app = TRY(GUI::Application::try_create(arguments));
Core::ArgsParser args_parser;
- const char* title = nullptr;
- const char* message = nullptr;
- const char* icon_path = nullptr;
+ char const* title = nullptr;
+ char const* message = nullptr;
+ char const* icon_path = nullptr;
args_parser.add_positional_argument(title, "Title of the notification", "title");
args_parser.add_positional_argument(message, "Message to display in the notification", "message");
args_parser.add_positional_argument(icon_path, "Path of icon to display in the notification", "icon-path", Core::ArgsParser::Required::No);
diff --git a/Userland/Utilities/ntpquery.cpp b/Userland/Utilities/ntpquery.cpp
index 26dce2a1a2..c02e0187f6 100644
--- a/Userland/Utilities/ntpquery.cpp
+++ b/Userland/Utilities/ntpquery.cpp
@@ -53,9 +53,9 @@ static_assert(AssertSize<NtpPacket, 48>());
// NTP measures time in seconds since 1900-01-01, POSIX in seconds since 1970-01-01.
// 1900 wasn't a leap year, so there are 70/4 leap years between 1900 and 1970.
// Overflows a 32-bit signed int, but not a 32-bit unsigned int.
-const unsigned SecondsFrom1900To1970 = (70u * 365u + 70u / 4u) * 24u * 60u * 60u;
+unsigned const SecondsFrom1900To1970 = (70u * 365u + 70u / 4u) * 24u * 60u * 60u;
-static NtpTimestamp ntp_timestamp_from_timeval(const timeval& t)
+static NtpTimestamp ntp_timestamp_from_timeval(timeval const& t)
{
VERIFY(t.tv_usec >= 0 && t.tv_usec < 1'000'000); // Fits in 20 bits when normalized.
@@ -68,7 +68,7 @@ static NtpTimestamp ntp_timestamp_from_timeval(const timeval& t)
return (static_cast<NtpTimestamp>(seconds) << 32) | fractional_bits;
}
-static timeval timeval_from_ntp_timestamp(const NtpTimestamp& ntp_timestamp)
+static timeval timeval_from_ntp_timestamp(NtpTimestamp const& ntp_timestamp)
{
timeval t;
t.tv_sec = static_cast<time_t>(ntp_timestamp >> 32) - SecondsFrom1900To1970;
@@ -113,7 +113,7 @@ int main(int argc, char** argv)
// Leap seconds smearing NTP servers:
// - time.facebook.com , https://engineering.fb.com/production-engineering/ntp-service/ , sine-smears over 18 hours
// - time.google.com , https://developers.google.com/time/smear , linear-smears over 24 hours
- const char* host = "time.google.com";
+ char const* host = "time.google.com";
Core::ArgsParser args_parser;
args_parser.add_option(adjust_time, "Gradually adjust system time (requires root)", "adjust", 'a');
args_parser.add_option(set_time, "Immediately set system time (requires root)", "set", 's');
@@ -171,7 +171,7 @@ int main(int argc, char** argv)
memset(&peer_address, 0, sizeof(peer_address));
peer_address.sin_family = AF_INET;
peer_address.sin_port = htons(123);
- peer_address.sin_addr.s_addr = *(const in_addr_t*)hostent->h_addr_list[0];
+ peer_address.sin_addr.s_addr = *(in_addr_t const*)hostent->h_addr_list[0];
NtpPacket packet;
memset(&packet, 0, sizeof(packet));
diff --git a/Userland/Utilities/passwd.cpp b/Userland/Utilities/passwd.cpp
index f186982069..339d489af1 100644
--- a/Userland/Utilities/passwd.cpp
+++ b/Userland/Utilities/passwd.cpp
@@ -30,7 +30,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
bool del = false;
bool lock = false;
bool unlock = false;
- const char* username = nullptr;
+ char const* username = nullptr;
auto args_parser = Core::ArgsParser();
args_parser.set_general_help("Modify an account password.");
diff --git a/Userland/Utilities/paste.cpp b/Userland/Utilities/paste.cpp
index 28e03453a2..910dc34a52 100644
--- a/Userland/Utilities/paste.cpp
+++ b/Userland/Utilities/paste.cpp
@@ -18,7 +18,7 @@
#include <sys/wait.h>
#include <unistd.h>
-static void spawn_command(const Vector<const char*>& command, const ByteBuffer& data, const char* state)
+static void spawn_command(Vector<char const*> const& command, ByteBuffer const& data, char const* state)
{
auto pipefd = MUST(Core::System::pipe2(0));
pid_t pid = MUST(Core::System::fork());
@@ -53,7 +53,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
bool print_type = false;
bool no_newline = false;
bool watch = false;
- Vector<const char*> watch_command;
+ Vector<char const*> watch_command;
Core::ArgsParser args_parser;
args_parser.set_general_help("Paste from the clipboard to stdout.");
@@ -70,7 +70,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (watch) {
watch_command.append(nullptr);
- clipboard.on_change = [&](const String&) {
+ clipboard.on_change = [&](String const&) {
// Technically there's a race here...
auto data_and_type = clipboard.fetch_data_and_type();
if (data_and_type.mime_type.is_null()) {
diff --git a/Userland/Utilities/pathchk.cpp b/Userland/Utilities/pathchk.cpp
index b3d37227ed..aeb1594dc1 100644
--- a/Userland/Utilities/pathchk.cpp
+++ b/Userland/Utilities/pathchk.cpp
@@ -19,7 +19,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
static bool flag_most_posix = false;
static bool flag_portability = false;
static bool flag_empty_name_and_leading_dash = false;
- Vector<const char*> paths;
+ Vector<char const*> paths;
Core::ArgsParser args_parser;
args_parser.add_option(flag_most_posix, "Check for most POSIX systems", nullptr, 'p');
diff --git a/Userland/Utilities/pidof.cpp b/Userland/Utilities/pidof.cpp
index 357eede7ff..b4c83d39e9 100644
--- a/Userland/Utilities/pidof.cpp
+++ b/Userland/Utilities/pidof.cpp
@@ -14,7 +14,7 @@
#include <string.h>
#include <unistd.h>
-static ErrorOr<int> pid_of(const String& process_name, bool single_shot, bool omit_pid, pid_t pid)
+static ErrorOr<int> pid_of(String const& process_name, bool single_shot, bool omit_pid, pid_t pid)
{
bool displayed_at_least_one = false;
@@ -48,8 +48,8 @@ ErrorOr<int> serenity_main(Main::Arguments args)
TRY(Core::System::unveil(nullptr, nullptr));
bool single_shot = false;
- const char* omit_pid_value = nullptr;
- const char* process_name = nullptr;
+ char const* omit_pid_value = nullptr;
+ char const* process_name = nullptr;
Core::ArgsParser args_parser;
args_parser.add_option(single_shot, "Only return one pid", nullptr, 's');
diff --git a/Userland/Utilities/ping.cpp b/Userland/Utilities/ping.cpp
index 9d2ad1ea6b..cb5796d788 100644
--- a/Userland/Utilities/ping.cpp
+++ b/Userland/Utilities/ping.cpp
@@ -30,7 +30,7 @@ static Optional<size_t> count;
static uint32_t total_ms;
static int min_ms;
static int max_ms;
-static const char* host;
+static char const* host;
static int payload_size = -1;
// variable part of header can be 0 to 40 bytes
// https://datatracker.ietf.org/doc/html/rfc791#section-3.1
@@ -101,7 +101,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
sockaddr_in peer_address {};
peer_address.sin_family = AF_INET;
peer_address.sin_port = 0;
- peer_address.sin_addr.s_addr = *(const in_addr_t*)hostent->h_addr_list[0];
+ peer_address.sin_addr.s_addr = *(in_addr_t const*)hostent->h_addr_list[0];
uint16_t seq = 1;
diff --git a/Userland/Utilities/pmap.cpp b/Userland/Utilities/pmap.cpp
index 7d465d0fd9..f2ec9cb47e 100644
--- a/Userland/Utilities/pmap.cpp
+++ b/Userland/Utilities/pmap.cpp
@@ -18,7 +18,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::unveil("/proc", "r"));
TRY(Core::System::unveil(nullptr, nullptr));
- const char* pid;
+ char const* pid;
static bool extended = false;
Core::ArgsParser args_parser;
diff --git a/Userland/Utilities/printf.cpp b/Userland/Utilities/printf.cpp
index fe7a9b7f27..ec1bbf9098 100644
--- a/Userland/Utilities/printf.cpp
+++ b/Userland/Utilities/printf.cpp
@@ -13,7 +13,7 @@
#include <stdio.h>
#include <unistd.h>
-[[gnu::noreturn]] static void fail(const char* message)
+[[gnu::noreturn]] static void fail(char const* message)
{
fputs("\e[31m", stderr);
fputs(message, stderr);
@@ -23,15 +23,15 @@
template<typename PutChFunc, typename ArgumentListRefT, template<typename T, typename U = ArgumentListRefT> typename NextArgument, typename CharType>
requires(IsSame<CharType, char>) struct PrintfImpl : public PrintfImplementation::PrintfImpl<PutChFunc, ArgumentListRefT, NextArgument, CharType> {
- ALWAYS_INLINE PrintfImpl(PutChFunc& putch, char*& bufptr, const int& nwritten)
+ ALWAYS_INLINE PrintfImpl(PutChFunc& putch, char*& bufptr, int const& nwritten)
: PrintfImplementation::PrintfImpl<PutChFunc, ArgumentListRefT, NextArgument>(putch, bufptr, nwritten)
{
}
- ALWAYS_INLINE int format_q(const PrintfImplementation::ModifierState& state, ArgumentListRefT& ap) const
+ ALWAYS_INLINE int format_q(PrintfImplementation::ModifierState const& state, ArgumentListRefT& ap) const
{
auto state_copy = state;
- auto str = NextArgument<const char*>()(ap);
+ auto str = NextArgument<char const*>()(ap);
if (!str)
str = "(null)";
@@ -106,8 +106,8 @@ struct ArgvNextArgument<char*, V> {
};
template<typename V>
-struct ArgvNextArgument<const char*, V> {
- ALWAYS_INLINE const char* operator()(V arg) const
+struct ArgvNextArgument<char const*, V> {
+ ALWAYS_INLINE char const* operator()(V arg) const
{
if (arg.argc == 0)
return "";
@@ -119,8 +119,8 @@ struct ArgvNextArgument<const char*, V> {
};
template<typename V>
-struct ArgvNextArgument<const wchar_t*, V> {
- ALWAYS_INLINE const wchar_t* operator()(V arg) const
+struct ArgvNextArgument<wchar_t const*, V> {
+ ALWAYS_INLINE wchar_t const* operator()(V arg) const
{
if (arg.argc == 0)
return L"";
@@ -208,7 +208,7 @@ struct ArgvWithCount {
int& argc;
};
-static String handle_escapes(const char* string)
+static String handle_escapes(char const* string)
{
StringBuilder builder;
for (auto c = *string; c; c = *++string) {
diff --git a/Userland/Utilities/pro.cpp b/Userland/Utilities/pro.cpp
index 0463ad26f2..d68a8ba950 100644
--- a/Userland/Utilities/pro.cpp
+++ b/Userland/Utilities/pro.cpp
@@ -147,10 +147,10 @@ private:
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- const char* url_str = nullptr;
+ char const* url_str = nullptr;
bool save_at_provided_name = false;
bool should_follow_url = false;
- const char* data = nullptr;
+ char const* data = nullptr;
String method = "GET";
HashMap<String, String, CaseInsensitiveStringTraits> request_headers;
diff --git a/Userland/Utilities/profile.cpp b/Userland/Utilities/profile.cpp
index 5756d78cd2..35fafcbcca 100644
--- a/Userland/Utilities/profile.cpp
+++ b/Userland/Utilities/profile.cpp
@@ -15,8 +15,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
Core::ArgsParser args_parser;
- const char* pid_argument = nullptr;
- const char* cmd_argument = nullptr;
+ char const* pid_argument = nullptr;
+ char const* cmd_argument = nullptr;
bool wait = false;
bool free = false;
bool enable = false;
@@ -108,7 +108,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
}
auto cmd_parts = String(cmd_argument).split(' ');
- Vector<const char*> cmd_argv;
+ Vector<char const*> cmd_argv;
for (auto& part : cmd_parts)
cmd_argv.append(part.characters());
diff --git a/Userland/Utilities/readelf.cpp b/Userland/Utilities/readelf.cpp
index dc459b564e..09e2bab33f 100644
--- a/Userland/Utilities/readelf.cpp
+++ b/Userland/Utilities/readelf.cpp
@@ -21,7 +21,7 @@
#include <stdio.h>
#include <unistd.h>
-static const char* object_program_header_type_to_string(ElfW(Word) type)
+static char const* object_program_header_type_to_string(ElfW(Word) type)
{
switch (type) {
case PT_NULL:
@@ -65,7 +65,7 @@ static const char* object_program_header_type_to_string(ElfW(Word) type)
}
}
-static const char* object_section_header_type_to_string(ElfW(Word) type)
+static char const* object_section_header_type_to_string(ElfW(Word) type)
{
switch (type) {
case SHT_NULL:
@@ -137,7 +137,7 @@ static const char* object_section_header_type_to_string(ElfW(Word) type)
}
}
-static const char* object_symbol_type_to_string(ElfW(Word) type)
+static char const* object_symbol_type_to_string(ElfW(Word) type)
{
switch (type) {
case STT_NOTYPE:
@@ -161,7 +161,7 @@ static const char* object_symbol_type_to_string(ElfW(Word) type)
}
}
-static const char* object_symbol_binding_to_string(ElfW(Word) type)
+static char const* object_symbol_binding_to_string(ElfW(Word) type)
{
switch (type) {
case STB_LOCAL:
@@ -181,7 +181,7 @@ static const char* object_symbol_binding_to_string(ElfW(Word) type)
}
}
-static const char* object_relocation_type_to_string(ElfW(Word) type)
+static char const* object_relocation_type_to_string(ElfW(Word) type)
{
switch (type) {
#if ARCH(I386)
@@ -230,7 +230,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath"));
- const char* path;
+ char const* path;
static bool display_all = false;
static bool display_elf_header = false;
static bool display_program_headers = false;
diff --git a/Userland/Utilities/realpath.cpp b/Userland/Utilities/realpath.cpp
index bd5bbb54d7..69aa968f15 100644
--- a/Userland/Utilities/realpath.cpp
+++ b/Userland/Utilities/realpath.cpp
@@ -14,7 +14,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath"));
- const char* path;
+ char const* path;
Core::ArgsParser args_parser;
args_parser.set_general_help(
diff --git a/Userland/Utilities/rmdir.cpp b/Userland/Utilities/rmdir.cpp
index bafad35fd9..fbdd929889 100644
--- a/Userland/Utilities/rmdir.cpp
+++ b/Userland/Utilities/rmdir.cpp
@@ -15,7 +15,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio cpath"));
- Vector<const char*> paths;
+ Vector<char const*> paths;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(paths, "Directories to remove", "paths");
diff --git a/Userland/Utilities/run-tests.cpp b/Userland/Utilities/run-tests.cpp
index cb05648839..b874f38235 100644
--- a/Userland/Utilities/run-tests.cpp
+++ b/Userland/Utilities/run-tests.cpp
@@ -54,13 +54,13 @@ public:
virtual ~TestRunner() = default;
protected:
- virtual void do_run_single_test(const String& test_path, size_t current_text_index, size_t num_tests) override;
+ virtual void do_run_single_test(String const& test_path, size_t current_text_index, size_t num_tests) override;
virtual Vector<String> get_test_paths() const override;
- virtual const Vector<String>* get_failed_test_names() const override { return &m_failed_test_names; }
+ virtual Vector<String> const* get_failed_test_names() const override { return &m_failed_test_names; }
- virtual FileResult run_test_file(const String& test_path);
+ virtual FileResult run_test_file(String const& test_path);
- bool should_skip_test(const LexicalPath& test_path);
+ bool should_skip_test(LexicalPath const& test_path);
Regex<PosixExtended> m_exclude_regex;
NonnullRefPtr<Core::ConfigFile> m_config;
@@ -75,7 +75,7 @@ protected:
Vector<String> TestRunner::get_test_paths() const
{
Vector<String> paths;
- Test::iterate_directory_recursively(m_test_root, [&](const String& file_path) {
+ Test::iterate_directory_recursively(m_test_root, [&](String const& file_path) {
if (access(file_path.characters(), R_OK | X_OK) != 0)
return;
auto result = m_exclude_regex.match(file_path, PosixFlags::Global);
@@ -86,16 +86,16 @@ Vector<String> TestRunner::get_test_paths() const
return paths;
}
-bool TestRunner::should_skip_test(const LexicalPath& test_path)
+bool TestRunner::should_skip_test(LexicalPath const& test_path)
{
if (m_run_skipped_tests)
return false;
- for (const String& dir : m_skip_directories) {
+ for (String const& dir : m_skip_directories) {
if (test_path.dirname().contains(dir))
return true;
}
- for (const String& file : m_skip_files) {
+ for (String const& file : m_skip_files) {
if (test_path.basename().contains(file))
return true;
}
@@ -106,7 +106,7 @@ bool TestRunner::should_skip_test(const LexicalPath& test_path)
return false;
}
-void TestRunner::do_run_single_test(const String& test_path, size_t current_test_index, size_t num_tests)
+void TestRunner::do_run_single_test(String const& test_path, size_t current_test_index, size_t num_tests)
{
g_currently_running_test = test_path;
auto test_relative_path = LexicalPath::relative_path(test_path, m_test_root);
@@ -225,7 +225,7 @@ void TestRunner::do_run_single_test(const String& test_path, size_t current_test
close(test_result.stdout_err_fd);
}
-FileResult TestRunner::run_test_file(const String& test_path)
+FileResult TestRunner::run_test_file(String const& test_path)
{
double start_time = get_time_in_ms();
@@ -248,7 +248,7 @@ FileResult TestRunner::run_test_file(const String& test_path)
(void)posix_spawn_file_actions_adddup2(&file_actions, child_out_err_file, STDERR_FILENO);
(void)posix_spawn_file_actions_addchdir(&file_actions, dirname.characters());
- Vector<const char*, 4> argv;
+ Vector<char const*, 4> argv;
argv.append(basename.characters());
auto extra_args = m_config->read_entry(path_for_test.basename(), "Arguments", "").split(' ');
for (auto& arg : extra_args)
@@ -315,7 +315,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
bool print_all_output = false;
bool run_benchmarks = false;
bool run_skipped_tests = false;
- const char* specified_test_root = nullptr;
+ char const* specified_test_root = nullptr;
String test_glob;
String exclude_pattern;
String config_file;
diff --git a/Userland/Utilities/seq.cpp b/Userland/Utilities/seq.cpp
index 72367a9d3c..7bf07c2406 100644
--- a/Userland/Utilities/seq.cpp
+++ b/Userland/Utilities/seq.cpp
@@ -12,7 +12,7 @@
#include <stdlib.h>
#include <string.h>
-const char* const g_usage = R"(Usage:
+char const* const g_usage = R"(Usage:
seq [-h|--help]
seq LAST
seq FIRST LAST
@@ -25,7 +25,7 @@ static void print_usage(FILE* stream)
return;
}
-static double get_double(const char* name, const char* d_string, int* number_of_decimals)
+static double get_double(char const* name, char const* d_string, int* number_of_decimals)
{
char* end;
double d = strtod(d_string, &end);
@@ -34,7 +34,7 @@ static double get_double(const char* name, const char* d_string, int* number_of_
print_usage(stderr);
exit(1);
}
- if (const char* dot = strchr(d_string, '.'))
+ if (char const* dot = strchr(d_string, '.'))
*number_of_decimals = strlen(dot + 1);
else
*number_of_decimals = 0;
diff --git a/Userland/Utilities/sleep.cpp b/Userland/Utilities/sleep.cpp
index 16c6c11001..b80dd37c7b 100644
--- a/Userland/Utilities/sleep.cpp
+++ b/Userland/Utilities/sleep.cpp
@@ -15,7 +15,7 @@
#include <time.h>
#include <unistd.h>
-static volatile bool g_interrupted;
+static bool volatile g_interrupted;
static void handle_sigint(int)
{
g_interrupted = true;
diff --git a/Userland/Utilities/strace.cpp b/Userland/Utilities/strace.cpp
index 10d13ef6a8..21983d3116 100644
--- a/Userland/Utilities/strace.cpp
+++ b/Userland/Utilities/strace.cpp
@@ -225,12 +225,12 @@ static void handle_sigint(int)
}
}
-static ErrorOr<void> copy_from_process(const void* source, Bytes target)
+static ErrorOr<void> copy_from_process(void const* source, Bytes target)
{
return Core::System::ptrace_peekbuf(g_pid, const_cast<void*>(source), target);
}
-static ErrorOr<ByteBuffer> copy_from_process(const void* source, size_t length)
+static ErrorOr<ByteBuffer> copy_from_process(void const* source, size_t length)
{
auto buffer = TRY(ByteBuffer::create_uninitialized(length));
TRY(copy_from_process(source, buffer.bytes()));
@@ -261,7 +261,7 @@ struct BitflagBase {
namespace AK {
template<typename BitflagDerivative>
- requires(IsBaseOf<BitflagBase, BitflagDerivative>) && requires { BitflagDerivative::options; }
+requires(IsBaseOf<BitflagBase, BitflagDerivative>) && requires { BitflagDerivative::options; }
struct Formatter<BitflagDerivative> : StandardFormatter {
Formatter() = default;
explicit Formatter(StandardFormatter formatter)
@@ -305,7 +305,7 @@ struct Formatter<BitflagDerivative> : StandardFormatter {
}
struct PointerArgument {
- const void* value;
+ void const* value;
};
namespace AK {
@@ -809,11 +809,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio wpath cpath proc exec ptrace sigaction"));
- Vector<const char*> child_argv;
+ Vector<char const*> child_argv;
- const char* output_filename = nullptr;
- const char* exclude_syscalls_option = nullptr;
- const char* include_syscalls_option = nullptr;
+ char const* output_filename = nullptr;
+ char const* exclude_syscalls_option = nullptr;
+ char const* include_syscalls_option = nullptr;
HashTable<StringView> exclude_syscalls;
HashTable<StringView> include_syscalls;
auto trace_file = Core::File::standard_error();
@@ -833,7 +833,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (output_filename != nullptr)
trace_file = TRY(Core::File::open(output_filename, Core::OpenMode::WriteOnly));
- auto parse_syscalls = [](const char* option, auto& hash_table) {
+ auto parse_syscalls = [](char const* option, auto& hash_table) {
if (option != nullptr) {
for (auto syscall : StringView(option).split_view(','))
hash_table.set(syscall);
diff --git a/Userland/Utilities/stty.cpp b/Userland/Utilities/stty.cpp
index 905916f136..a88a84b8c2 100644
--- a/Userland/Utilities/stty.cpp
+++ b/Userland/Utilities/stty.cpp
@@ -156,8 +156,8 @@ constexpr ControlCharacter control_characters[] = {
Optional<speed_t> numeric_value_to_speed(unsigned long);
Optional<unsigned long> speed_to_numeric_value(speed_t);
-void print_stty_readable(const termios&);
-void print_human_readable(const termios&, const winsize&, bool);
+void print_stty_readable(termios const&);
+void print_human_readable(termios const&, winsize const&, bool);
Result<void, int> apply_stty_readable_modes(StringView, termios&);
Result<void, int> apply_modes(size_t, char**, termios&, winsize&);
@@ -179,7 +179,7 @@ Optional<unsigned long> speed_to_numeric_value(speed_t speed)
return {};
}
-void print_stty_readable(const termios& modes)
+void print_stty_readable(termios const& modes)
{
out("{:x}:{:x}:{:x}:{:x}", modes.c_iflag, modes.c_oflag, modes.c_cflag, modes.c_lflag);
for (size_t i = 0; i < NCCS; ++i)
@@ -187,7 +187,7 @@ void print_stty_readable(const termios& modes)
out(":{:x}:{:x}\n", modes.c_ispeed, modes.c_ospeed);
}
-void print_human_readable(const termios& modes, const winsize& ws, bool verbose_mode)
+void print_human_readable(termios const& modes, winsize const& ws, bool verbose_mode)
{
auto print_speed = [&] {
if (verbose_mode && modes.c_ispeed != modes.c_ospeed) {
diff --git a/Userland/Utilities/su.cpp b/Userland/Utilities/su.cpp
index 382ae1e6b5..ad53516b66 100644
--- a/Userland/Utilities/su.cpp
+++ b/Userland/Utilities/su.cpp
@@ -20,7 +20,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (!TRY(Core::System::isatty(STDIN_FILENO)))
return Error::from_string_literal("Standard input is not a terminal");
- const char* user = nullptr;
+ char const* user = nullptr;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(user, "User to switch to (defaults to user with UID 0)", "user", Core::ArgsParser::Required::No);
diff --git a/Userland/Utilities/syscall.cpp b/Userland/Utilities/syscall.cpp
index ab6ba4fd7e..7aab8b32a6 100644
--- a/Userland/Utilities/syscall.cpp
+++ b/Userland/Utilities/syscall.cpp
@@ -23,7 +23,7 @@
FlatPtr arg[SC_NARG];
char outbuf[BUFSIZ];
-using Arguments = Vector<const char*>;
+using Arguments = Vector<char const*>;
using ArgIter = Arguments::Iterator;
static FlatPtr parse_from(ArgIter&);
@@ -40,7 +40,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
bool output_buffer = false;
bool list_syscalls = false;
- Vector<const char*> syscall_arguments;
+ Vector<char const*> syscall_arguments;
Core::ArgsParser args_parser;
args_parser.set_general_help(
@@ -154,7 +154,7 @@ static FlatPtr parse_parameter_buffer(ArgIter& iter)
static FlatPtr parse_from(ArgIter& iter)
{
- const char* this_arg = *iter;
+ char const* this_arg = *iter;
++iter;
// Is it a forced literal?
diff --git a/Userland/Utilities/tail.cpp b/Userland/Utilities/tail.cpp
index 5e0d7ae458..5454ec1161 100644
--- a/Userland/Utilities/tail.cpp
+++ b/Userland/Utilities/tail.cpp
@@ -19,7 +19,7 @@ static int tail_from_pos(Core::File& file, off_t startline, bool want_follow)
return 1;
while (true) {
- const auto& b = file.read(4096);
+ auto const& b = file.read(4096);
if (b.is_empty()) {
if (!want_follow) {
break;
@@ -56,7 +56,7 @@ static off_t find_seek_pos(Core::File& file, int wanted_lines)
// is smart enough to not read char-by-char. Fix it there, or fix it here :)
for (; pos >= 0; pos--) {
file.seek(pos);
- const auto& ch = file.read(1);
+ auto const& ch = file.read(1);
if (ch.is_empty()) {
// Presumably the file got truncated?
// Keep trying to read backwards...
@@ -78,7 +78,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
bool follow = false;
int line_count = DEFAULT_LINE_COUNT;
- const char* file = nullptr;
+ char const* file = nullptr;
Core::ArgsParser args_parser;
args_parser.set_general_help("Print the end ('tail') of a file.");
diff --git a/Userland/Utilities/tar.cpp b/Userland/Utilities/tar.cpp
index e2d02c8933..bb23a3a1a5 100644
--- a/Userland/Utilities/tar.cpp
+++ b/Userland/Utilities/tar.cpp
@@ -32,8 +32,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
bool gzip = false;
bool no_auto_compress = false;
StringView archive_file;
- const char* directory = nullptr;
- Vector<const char*> paths;
+ char const* directory = nullptr;
+ Vector<char const*> paths;
Core::ArgsParser args_parser;
args_parser.add_option(create, "Create archive", "create", 'c');
@@ -96,7 +96,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
};
for (; !tar_stream.finished(); tar_stream.advance()) {
- const Archive::TarFileHeader& header = tar_stream.header();
+ Archive::TarFileHeader const& header = tar_stream.header();
// Handle meta-entries earlier to avoid consuming the file content stream.
if (header.content_is_like_extended_header()) {
diff --git a/Userland/Utilities/test-fuzz.cpp b/Userland/Utilities/test-fuzz.cpp
index 92f1e8f31c..8a4f96e722 100644
--- a/Userland/Utilities/test-fuzz.cpp
+++ b/Userland/Utilities/test-fuzz.cpp
@@ -32,7 +32,7 @@
T(URL)
#undef __ENUMERATE_TARGET
-#define __ENUMERATE_TARGET(x) extern "C" int Test##x(const uint8_t*, size_t);
+#define __ENUMERATE_TARGET(x) extern "C" int Test##x(uint8_t const*, size_t);
ENUMERATE_TARGETS(__ENUMERATE_TARGET)
#undef __ENUMERATE_TARGET
diff --git a/Userland/Utilities/test.cpp b/Userland/Utilities/test.cpp
index 553656fd0e..399d19027b 100644
--- a/Userland/Utilities/test.cpp
+++ b/Userland/Utilities/test.cpp
@@ -16,7 +16,7 @@
bool g_there_was_an_error = false;
-[[noreturn, gnu::format(printf, 1, 2)]] static void fatal_error(const char* format, ...)
+[[noreturn, gnu::format(printf, 1, 2)]] static void fatal_error(char const* format, ...)
{
fputs("\033[31m", stderr);
diff --git a/Userland/Utilities/test_env.cpp b/Userland/Utilities/test_env.cpp
index 86bdc36f3f..3c9e281434 100644
--- a/Userland/Utilities/test_env.cpp
+++ b/Userland/Utilities/test_env.cpp
@@ -11,7 +11,7 @@
#include <stdlib.h>
#include <string.h>
-static void assert_env(const char* name, const char* value)
+static void assert_env(char const* name, char const* value)
{
char* result = getenv(name);
if (!result) {
diff --git a/Userland/Utilities/top.cpp b/Userland/Utilities/top.cpp
index 6c068f743b..d8813c0468 100644
--- a/Userland/Utilities/top.cpp
+++ b/Userland/Utilities/top.cpp
@@ -68,7 +68,7 @@ struct ThreadData {
};
struct PidAndTid {
- bool operator==(const PidAndTid& other) const
+ bool operator==(PidAndTid const& other) const
{
return pid == other.pid && tid == other.tid;
}
@@ -79,7 +79,7 @@ struct PidAndTid {
namespace AK {
template<>
struct Traits<PidAndTid> : public GenericTraits<PidAndTid> {
- static unsigned hash(const PidAndTid& value) { return pair_int_hash(value.pid, value.tid); }
+ static unsigned hash(PidAndTid const& value) { return pair_int_hash(value.pid, value.tid); }
};
}
@@ -143,7 +143,7 @@ static void parse_args(Main::Arguments arguments, TopOption& top_option)
"sort-by",
's',
nullptr,
- [&top_option](const char* s) {
+ [&top_option](char const* s) {
StringView sort_by_option { s };
if (sort_by_option == "pid"sv)
top_option.sort_by = TopOption::SortBy::Pid;
diff --git a/Userland/Utilities/touch.cpp b/Userland/Utilities/touch.cpp
index 6ad681136f..d745eabdcf 100644
--- a/Userland/Utilities/touch.cpp
+++ b/Userland/Utilities/touch.cpp
@@ -15,7 +15,7 @@
#include <unistd.h>
#include <utime.h>
-static bool file_exists(const char* path)
+static bool file_exists(char const* path)
{
struct stat st;
int rc = stat(path, &st);
@@ -34,7 +34,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath cpath fattr"));
- Vector<const char*> paths;
+ Vector<char const*> paths;
Core::ArgsParser args_parser;
args_parser.set_general_help("Create a file, or update its mtime (time of last modification).");
diff --git a/Userland/Utilities/tr.cpp b/Userland/Utilities/tr.cpp
index bcb8e9b7ac..2e932f3d80 100644
--- a/Userland/Utilities/tr.cpp
+++ b/Userland/Utilities/tr.cpp
@@ -96,8 +96,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
bool complement_flag = false;
bool delete_flag = false;
bool squeeze_flag = false;
- const char* from_chars = nullptr;
- const char* to_chars = nullptr;
+ char const* from_chars = nullptr;
+ char const* to_chars = nullptr;
Core::ArgsParser args_parser;
args_parser.add_option(complement_flag, "Take the complement of the first set", "complement", 'c');
diff --git a/Userland/Utilities/traceroute.cpp b/Userland/Utilities/traceroute.cpp
index 9e288b4235..1e04cb521e 100644
--- a/Userland/Utilities/traceroute.cpp
+++ b/Userland/Utilities/traceroute.cpp
@@ -25,7 +25,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio id inet unix"));
- const char* host_name;
+ char const* host_name;
int max_hops = 30;
int max_retries = 3;
int echo_timeout = 5;
@@ -53,7 +53,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
sockaddr_in host_address {};
host_address.sin_family = AF_INET;
host_address.sin_port = 44444;
- host_address.sin_addr.s_addr = *(const in_addr_t*)hostent->h_addr_list[0];
+ host_address.sin_addr.s_addr = *(in_addr_t const*)hostent->h_addr_list[0];
int fd = TRY(Core::System::socket(AF_INET, SOCK_RAW, IPPROTO_ICMP));
diff --git a/Userland/Utilities/tree.cpp b/Userland/Utilities/tree.cpp
index 12f4ea8744..f90c10e669 100644
--- a/Userland/Utilities/tree.cpp
+++ b/Userland/Utilities/tree.cpp
@@ -27,7 +27,7 @@ static int max_depth = INT_MAX;
static int g_directories_seen = 0;
static int g_files_seen = 0;
-static void print_directory_tree(const String& root_path, int depth, const String& indent_string)
+static void print_directory_tree(String const& root_path, int depth, String const& indent_string)
{
if (depth > 0) {
String root_indent_string;
@@ -106,7 +106,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath tty"));
- Vector<const char*> directories;
+ Vector<char const*> directories;
Core::ArgsParser args_parser;
args_parser.add_option(flag_show_hidden_files, "Show hidden files", "all", 'a');
@@ -124,7 +124,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
print_directory_tree(".", 0, "");
puts("");
} else {
- for (const char* directory : directories) {
+ for (char const* directory : directories) {
print_directory_tree(directory, 0, "");
puts("");
}
diff --git a/Userland/Utilities/truncate.cpp b/Userland/Utilities/truncate.cpp
index 4f7b1442ad..25ef85974a 100644
--- a/Userland/Utilities/truncate.cpp
+++ b/Userland/Utilities/truncate.cpp
@@ -22,9 +22,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath wpath cpath"));
- const char* resize = nullptr;
- const char* reference = nullptr;
- const char* file = nullptr;
+ char const* resize = nullptr;
+ char const* reference = nullptr;
+ char const* file = nullptr;
Core::ArgsParser args_parser;
args_parser.add_option(resize, "Resize the target file to (or by) this size. Prefix with + or - to expand or shrink the file, or a bare number to set the size exactly", "size", 's', "size");
diff --git a/Userland/Utilities/tt.cpp b/Userland/Utilities/tt.cpp
index 5c0929d2bd..e645b4da85 100644
--- a/Userland/Utilities/tt.cpp
+++ b/Userland/Utilities/tt.cpp
@@ -24,7 +24,7 @@ static int kill_test();
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- const char* test_name = "n";
+ char const* test_name = "n";
Core::ArgsParser args_parser;
args_parser.set_general_help(
diff --git a/Userland/Utilities/uniq.cpp b/Userland/Utilities/uniq.cpp
index 42f75e43cf..54fb89ba0a 100644
--- a/Userland/Utilities/uniq.cpp
+++ b/Userland/Utilities/uniq.cpp
@@ -18,7 +18,7 @@ struct linebuf {
size_t len = 0;
};
-static FILE* get_stream(const char* filepath, const char* perms)
+static FILE* get_stream(char const* filepath, char const* perms)
{
FILE* ret;
@@ -41,8 +41,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath wpath cpath"));
- const char* inpath = nullptr;
- const char* outpath = nullptr;
+ char const* inpath = nullptr;
+ char const* outpath = nullptr;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(inpath, "Input file", "input", Core::ArgsParser::Required::No);
args_parser.add_positional_argument(outpath, "Output file", "output", Core::ArgsParser::Required::No);
diff --git a/Userland/Utilities/unzip.cpp b/Userland/Utilities/unzip.cpp
index 3713c1151a..d8b69c7acc 100644
--- a/Userland/Utilities/unzip.cpp
+++ b/Userland/Utilities/unzip.cpp
@@ -75,7 +75,7 @@ static bool unpack_zip_member(Archive::ZipMember zip_member, bool quiet)
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- const char* path;
+ char const* path;
int map_size_limit = 32 * MiB;
bool quiet { false };
String output_directory_path;
diff --git a/Userland/Utilities/useradd.cpp b/Userland/Utilities/useradd.cpp
index 3d31d9376e..f5886e2a6d 100644
--- a/Userland/Utilities/useradd.cpp
+++ b/Userland/Utilities/useradd.cpp
@@ -25,20 +25,20 @@
constexpr uid_t BASE_UID = 1000;
constexpr gid_t USERS_GID = 100;
-constexpr const char* DEFAULT_SHELL = "/bin/sh";
+constexpr char const* DEFAULT_SHELL = "/bin/sh";
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio wpath rpath cpath chown"));
- const char* home_path = nullptr;
+ char const* home_path = nullptr;
int uid = 0;
int gid = USERS_GID;
bool create_home_dir = false;
- const char* password = "";
- const char* shell = DEFAULT_SHELL;
- const char* gecos = "";
- const char* username = nullptr;
+ char const* password = "";
+ char const* shell = DEFAULT_SHELL;
+ char const* gecos = "";
+ char const* username = nullptr;
Core::ArgsParser args_parser;
args_parser.add_option(home_path, "Home directory for the new user", "home-dir", 'd', "path");
diff --git a/Userland/Utilities/userdel.cpp b/Userland/Utilities/userdel.cpp
index 74d939a5f3..42d604bd6c 100644
--- a/Userland/Utilities/userdel.cpp
+++ b/Userland/Utilities/userdel.cpp
@@ -33,7 +33,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::unveil("/etc/", "rwc"));
TRY(Core::System::unveil("/bin/rm", "x"));
- const char* username = nullptr;
+ char const* username = nullptr;
bool remove_home = false;
Core::ArgsParser args_parser;
@@ -161,7 +161,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
}
pid_t child;
- const char* argv[] = { "rm", "-r", target_account.home_directory().characters(), nullptr };
+ char const* argv[] = { "rm", "-r", target_account.home_directory().characters(), nullptr };
if ((errno = posix_spawn(&child, "/bin/rm", nullptr, nullptr, const_cast<char**>(argv), environ))) {
perror("posix_spawn");
return 12;
diff --git a/Userland/Utilities/usermod.cpp b/Userland/Utilities/usermod.cpp
index eb6122fabd..17cc041c73 100644
--- a/Userland/Utilities/usermod.cpp
+++ b/Userland/Utilities/usermod.cpp
@@ -30,11 +30,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
int gid = 0;
bool lock = false;
bool unlock = false;
- const char* new_home_directory = nullptr;
+ char const* new_home_directory = nullptr;
bool move_home = false;
- const char* shell = nullptr;
- const char* gecos = nullptr;
- const char* username = nullptr;
+ char const* shell = nullptr;
+ char const* gecos = nullptr;
+ char const* username = nullptr;
auto args_parser = Core::ArgsParser();
args_parser.set_general_help("Modify a user account");
diff --git a/Userland/Utilities/utmpupdate.cpp b/Userland/Utilities/utmpupdate.cpp
index 3882b4d788..0922f79660 100644
--- a/Userland/Utilities/utmpupdate.cpp
+++ b/Userland/Utilities/utmpupdate.cpp
@@ -24,8 +24,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
pid_t pid = 0;
bool flag_create = false;
bool flag_delete = false;
- const char* tty_name = nullptr;
- const char* from = nullptr;
+ char const* tty_name = nullptr;
+ char const* from = nullptr;
Core::ArgsParser args_parser;
args_parser.add_option(flag_create, "Create entry", "create", 'c');
diff --git a/Userland/Utilities/watch.cpp b/Userland/Utilities/watch.cpp
index 7c3788a192..c749ed16c6 100644
--- a/Userland/Utilities/watch.cpp
+++ b/Userland/Utilities/watch.cpp
@@ -25,7 +25,7 @@
static int opt_interval = 2;
static bool flag_noheader = false;
static bool flag_beep_on_fail = false;
-static volatile int exit_code = 0;
+static int volatile exit_code = 0;
static volatile pid_t child_pid = -1;
static String build_header_string(Vector<char const*> const& command, struct timeval const& interval)
diff --git a/Userland/Utilities/wc.cpp b/Userland/Utilities/wc.cpp
index c0270d21f9..b37383175f 100644
--- a/Userland/Utilities/wc.cpp
+++ b/Userland/Utilities/wc.cpp
@@ -27,7 +27,7 @@ bool g_output_line = false;
bool g_output_byte = false;
bool g_output_word = false;
-static void wc_out(const Count& count)
+static void wc_out(Count const& count)
{
if (g_output_line)
out("{:7} ", count.lines);
@@ -39,7 +39,7 @@ static void wc_out(const Count& count)
outln("{:>14}", count.name);
}
-static Count get_count(const String& file_specifier)
+static Count get_count(String const& file_specifier)
{
Count count;
FILE* file_pointer = nullptr;
@@ -74,7 +74,7 @@ static Count get_count(const String& file_specifier)
return count;
}
-static Count get_total_count(const Vector<Count>& counts)
+static Count get_total_count(Vector<Count> const& counts)
{
Count total_count { "total" };
for (auto& count : counts) {
@@ -90,7 +90,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath"));
- Vector<const char*> file_specifiers;
+ Vector<char const*> file_specifiers;
Core::ArgsParser args_parser;
args_parser.add_option(g_output_line, "Output line count", "lines", 'l');
@@ -103,7 +103,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
g_output_line = g_output_byte = g_output_word = true;
Vector<Count> counts;
- for (const auto& file_specifier : file_specifiers)
+ for (auto const& file_specifier : file_specifiers)
counts.append(get_count(file_specifier));
TRY(Core::System::pledge("stdio"));
@@ -113,7 +113,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
else if (file_specifiers.size() > 1)
counts.append(get_total_count(counts));
- for (const auto& count : counts) {
+ for (auto const& count : counts) {
if (count.exists)
wc_out(count);
}
diff --git a/Userland/Utilities/which.cpp b/Userland/Utilities/which.cpp
index f0abc156c3..aace9ea20b 100644
--- a/Userland/Utilities/which.cpp
+++ b/Userland/Utilities/which.cpp
@@ -14,7 +14,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath"));
- const char* filename = nullptr;
+ char const* filename = nullptr;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(filename, "Name of executable", "executable");
diff --git a/Userland/Utilities/xargs.cpp b/Userland/Utilities/xargs.cpp
index d59a52a5b5..de9644e310 100644
--- a/Userland/Utilities/xargs.cpp
+++ b/Userland/Utilities/xargs.cpp
@@ -28,9 +28,9 @@ bool read_items(FILE* fp, char entry_separator, Function<Decision(StringView)>);
class ParsedInitialArguments {
public:
- ParsedInitialArguments(Vector<const char*>&, StringView placeholder);
+ ParsedInitialArguments(Vector<char const*>&, StringView placeholder);
- void for_each_joined_argument(StringView, Function<void(const String&)>) const;
+ void for_each_joined_argument(StringView, Function<void(String const&)>) const;
size_t size() const { return m_all_parts.size(); }
@@ -42,12 +42,12 @@ ErrorOr<int> serenity_main(Main::Arguments main_arguments)
{
TRY(Core::System::pledge("stdio rpath proc exec", nullptr));
- const char* placeholder = nullptr;
+ char const* placeholder = nullptr;
bool split_with_nulls = false;
- const char* specified_delimiter = "\n";
- Vector<const char*> arguments;
+ char const* specified_delimiter = "\n";
+ Vector<char const*> arguments;
bool verbose = false;
- const char* file_to_read = "-";
+ char const* file_to_read = "-";
int max_lines_for_one_command = 0;
int max_bytes_for_one_command = ARG_MAX;
@@ -238,7 +238,7 @@ bool run_command(Vector<char*>&& child_argv, bool verbose, bool is_stdin, int de
return true;
}
-ParsedInitialArguments::ParsedInitialArguments(Vector<const char*>& arguments, StringView placeholder)
+ParsedInitialArguments::ParsedInitialArguments(Vector<char const*>& arguments, StringView placeholder)
{
m_all_parts.ensure_capacity(arguments.size());
bool some_argument_has_placeholder = false;
@@ -264,7 +264,7 @@ ParsedInitialArguments::ParsedInitialArguments(Vector<const char*>& arguments, S
}
}
-void ParsedInitialArguments::for_each_joined_argument(StringView separator, Function<void(const String&)> callback) const
+void ParsedInitialArguments::for_each_joined_argument(StringView separator, Function<void(String const&)> callback) const
{
StringBuilder builder;
for (auto& parts : m_all_parts) {
diff --git a/Userland/Utilities/yes.cpp b/Userland/Utilities/yes.cpp
index 8e731f8b4d..97398e78bb 100644
--- a/Userland/Utilities/yes.cpp
+++ b/Userland/Utilities/yes.cpp
@@ -13,7 +13,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio"));
- const char* string = "yes";
+ char const* string = "yes";
Core::ArgsParser args_parser;
args_parser.add_positional_argument(string, "String to output (defaults to 'yes')", "string", Core::ArgsParser::Required::No);
diff --git a/Userland/Utilities/zip.cpp b/Userland/Utilities/zip.cpp
index dca40dcca9..af62a5bf65 100644
--- a/Userland/Utilities/zip.cpp
+++ b/Userland/Utilities/zip.cpp
@@ -16,7 +16,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- const char* zip_path;
+ char const* zip_path;
Vector<StringView> source_paths;
bool recurse = false;
bool force = false;