Skip to content

Commit

Permalink
Address readability-avoid-const-params-in-decls warnings.
Browse files Browse the repository at this point in the history
The warnings were:

```
/w/dolphin-memory-engine/Source/CheatEngineParser/CheatEngineParser.h:23:60: warning: parameter 'useDolphinPointer' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   23 |   MemWatchTreeNode* parseCTFile(QIODevice* CTFileIODevice, const bool useDolphinPointer);
      |                                                            ^~~~~
/w/dolphin-memory-engine/Source/CheatEngineParser/CheatEngineParser.h:41:65: warning: parameter 'useDolphinPointer' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   41 |   MemWatchTreeNode* parseCheatTable(MemWatchTreeNode* rootNode, const bool useDolphinPointer);
      |                                                                 ^~~~~
/w/dolphin-memory-engine/Source/CheatEngineParser/CheatEngineParser.h:42:63: warning: parameter 'useDolphinPointer' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   42 |   MemWatchTreeNode* parseCheatEntries(MemWatchTreeNode* node, const bool useDolphinPointer);
      |                                                               ^~~~~
/w/dolphin-memory-engine/Source/CheatEngineParser/CheatEngineParser.h:43:48: warning: parameter 'useDolphinPointer' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   43 |   void parseCheatEntry(MemWatchTreeNode* node, const bool useDolphinPointer);
      |                                                ^~~~~
/w/dolphin-memory-engine/Source/CheatEngineParser/CheatEngineParser.h:45:52: warning: parameter 'useDolphinPointer' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   45 |                                      bool isGroup, const bool useDolphinPointer);
      |                                                    ^~~~~
/w/dolphin-memory-engine/Source/Common/MemoryCommon.h:57:23: warning: parameter 'type' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   57 | size_t getSizeForType(const MemType type, const size_t length);
      |                       ^~~~~
/w/dolphin-memory-engine/Source/Common/MemoryCommon.h:57:43: warning: parameter 'length' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   57 | size_t getSizeForType(const MemType type, const size_t length);
      |                                           ^~~~~
/w/dolphin-memory-engine/Source/Common/MemoryCommon.h:58:30: warning: parameter 'type' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   58 | bool shouldBeBSwappedForType(const MemType type);
      |                              ^~~~~
/w/dolphin-memory-engine/Source/Common/MemoryCommon.h:59:33: warning: parameter 'type' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   59 | int getNbrBytesAlignmentForType(const MemType type);
      |                                 ^~~~~
/w/dolphin-memory-engine/Source/Common/MemoryCommon.h:62:54: warning: parameter 'type' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   62 | std::string formatMemoryToString(const char* memory, const MemType type, const size_t length,
      |                                                      ^~~~~
/w/dolphin-memory-engine/Source/Common/MemoryCommon.h:62:74: warning: parameter 'length' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   62 | std::string formatMemoryToString(const char* memory, const MemType type, const size_t length,
      |                                                                          ^~~~~
/w/dolphin-memory-engine/Source/Common/MemoryCommon.h:63:34: warning: parameter 'base' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   63 |                                  const MemBase base, const bool isUnsigned,
      |                                  ^~~~~
/w/dolphin-memory-engine/Source/Common/MemoryCommon.h:63:54: warning: parameter 'isUnsigned' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   63 |                                  const MemBase base, const bool isUnsigned,
      |                                                      ^~~~~
/w/dolphin-memory-engine/Source/Common/MemoryCommon.h:64:34: warning: parameter 'withBSwap' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   64 |                                  const bool withBSwap = false);
      |                                  ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/DolphinAccessor.h:25:27: warning: parameter 'offset' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   25 |   static bool readFromRAM(const u32 offset, char* buffer, const size_t size, const bool withBSwap);
      |                           ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/DolphinAccessor.h:25:59: warning: parameter 'size' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   25 |   static bool readFromRAM(const u32 offset, char* buffer, const size_t size, const bool withBSwap);
      |                                                           ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/DolphinAccessor.h:25:78: warning: parameter 'withBSwap' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   25 |   static bool readFromRAM(const u32 offset, char* buffer, const size_t size, const bool withBSwap);
      |                                                                              ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/DolphinAccessor.h:26:26: warning: parameter 'offset' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   26 |   static bool writeToRAM(const u32 offset, const char* buffer, const size_t size,
      |                          ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/DolphinAccessor.h:26:64: warning: parameter 'size' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   26 |   static bool writeToRAM(const u32 offset, const char* buffer, const size_t size,
      |                                                                ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/DolphinAccessor.h:27:26: warning: parameter 'withBSwap' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   27 |                          const bool withBSwap);
      |                          ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/DolphinAccessor.h:36:50: warning: parameter 'ramIndex' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   36 |   static std::string getFormattedValueFromMemory(const u32 ramIndex, Common::MemType memType,
      |                                                  ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/DolphinAccessor.h:39:37: warning: parameter 'address' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   39 |   static bool isValidConsoleAddress(const u32 address);
      |                                     ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/IDolphinProcess.h:23:28: warning: parameter 'offset' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   23 |   virtual bool readFromRAM(const u32 offset, char* buffer, const size_t size,
      |                            ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/IDolphinProcess.h:23:60: warning: parameter 'size' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   23 |   virtual bool readFromRAM(const u32 offset, char* buffer, const size_t size,
      |                                                            ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/IDolphinProcess.h:24:28: warning: parameter 'withBSwap' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   24 |                            const bool withBSwap) = 0;
      |                            ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/IDolphinProcess.h:25:27: warning: parameter 'offset' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   25 |   virtual bool writeToRAM(const u32 offset, const char* buffer, const size_t size,
      |                           ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/IDolphinProcess.h:25:65: warning: parameter 'size' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   25 |   virtual bool writeToRAM(const u32 offset, const char* buffer, const size_t size,
      |                                                                 ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/IDolphinProcess.h:26:27: warning: parameter 'withBSwap' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   26 |                           const bool withBSwap) = 0;
      |                           ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/Linux/LinuxDolphinProcess.h:19:20: warning: parameter 'offset' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   19 |   bool readFromRAM(const u32 offset, char* buffer, size_t size, const bool withBSwap) override;
      |                    ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/Linux/LinuxDolphinProcess.h:19:65: warning: parameter 'withBSwap' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   19 |   bool readFromRAM(const u32 offset, char* buffer, size_t size, const bool withBSwap) override;
      |                                                                 ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/Linux/LinuxDolphinProcess.h:20:19: warning: parameter 'offset' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   20 |   bool writeToRAM(const u32 offset, const char* buffer, const size_t size,
      |                   ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/Linux/LinuxDolphinProcess.h:20:57: warning: parameter 'size' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   20 |   bool writeToRAM(const u32 offset, const char* buffer, const size_t size,
      |                                                         ^~~~~
/w/dolphin-memory-engine/Source/DolphinProcess/Linux/LinuxDolphinProcess.h:21:19: warning: parameter 'withBSwap' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   21 |                   const bool withBSwap) override;
      |                   ^~~~~
/w/dolphin-memory-engine/Source/GUI/GUICommon.h:14:27: warning: parameter 'type' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   14 | QString getStringFromType(const Common::MemType type, const size_t length = 0);
      |                           ^~~~~
/w/dolphin-memory-engine/Source/GUI/GUICommon.h:14:55: warning: parameter 'length' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   14 | QString getStringFromType(const Common::MemType type, const size_t length = 0);
      |                                                       ^~~~~
/w/dolphin-memory-engine/Source/GUI/GUICommon.h:15:25: warning: parameter 'base' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   15 | QString getNameFromBase(const Common::MemBase base);
      |                         ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemScanner/MemScanWidget.h:38:28: warning: parameter 'errorCode' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   38 |   void handleScannerErrors(const Common::MemOperationReturnCode errorCode);
      |                            ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemScanner/ResultsListModel.h:34:24: warning: parameter 'row' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   34 |   u32 getResultAddress(const int row) const;
      |                        ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemViewer/MemViewer.h:38:22: warning: parameter 'address' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   38 |   void jumpToAddress(const u32 address);
      |                      ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemViewer/MemViewer.h:40:30: warning: parameter 'valid' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   40 |   void memoryValidityChanged(const bool valid);
      |                              ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemViewer/MemViewer.h:77:29: warning: parameter 'key' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   77 |   bool handleNaviguationKey(const int key, bool shiftIsHeld);
      |                             ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemViewer/MemViewer.h:80:27: warning: parameter 'region' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   80 |   void changeMemoryRegion(const MemoryRegion region);
      |                           ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemViewer/MemViewer.h:84:40: warning: parameter 'rowIndex' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   84 |   void renderMemory(QPainter& painter, const int rowIndex, const int columnIndex);
      |                                        ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemViewer/MemViewer.h:84:60: warning: parameter 'columnIndex' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   84 |   void renderMemory(QPainter& painter, const int rowIndex, const int columnIndex);
      |                                                            ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemViewer/MemViewer.h:85:41: warning: parameter 'rowIndex' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   85 |   void renderHexByte(QPainter& painter, const int rowIndex, const int columnIndex, QColor& bgColor,
      |                                         ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemViewer/MemViewer.h:85:61: warning: parameter 'columnIndex' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   85 |   void renderHexByte(QPainter& painter, const int rowIndex, const int columnIndex, QColor& bgColor,
      |                                                             ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemViewer/MemViewer.h:87:43: warning: parameter 'rowIndex' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   87 |   void renderASCIIText(QPainter& painter, const int rowIndex, const int columnIndex,
      |                                           ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemViewer/MemViewer.h:87:63: warning: parameter 'columnIndex' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   87 |   void renderASCIIText(QPainter& painter, const int rowIndex, const int columnIndex,
      |                                                               ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemViewer/MemViewer.h:89:40: warning: parameter 'rowIndex' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   89 |   void renderCarret(QPainter& painter, const int rowIndex, const int columnIndex);
      |                                        ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemViewer/MemViewer.h:89:60: warning: parameter 'columnIndex' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   89 |   void renderCarret(QPainter& painter, const int rowIndex, const int columnIndex);
      |                                                            ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemViewer/MemViewer.h:90:44: warning: parameter 'rowIndex' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   90 |   void determineMemoryTextRenderProperties(const int rowIndex, const int columnIndex,
      |                                            ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemViewer/MemViewer.h:90:64: warning: parameter 'columnIndex' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   90 |   void determineMemoryTextRenderProperties(const int rowIndex, const int columnIndex,
      |                                                                ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemWatcher/Dialogs/DlgChangeType.h:12:34: warning: parameter 'typeIndex' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   12 |   DlgChangeType(QWidget* parent, const int typeIndex, const size_t length);
      |                                  ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemWatcher/Dialogs/DlgChangeType.h:12:55: warning: parameter 'length' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   12 |   DlgChangeType(QWidget* parent, const int typeIndex, const size_t length);
      |                                                       ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemWatcher/MemWatchModel.h:55:45: warning: parameter 'type' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   55 |   void changeType(const QModelIndex& index, const Common::MemType type, const size_t length);
      |                                             ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemWatcher/MemWatchModel.h:55:73: warning: parameter 'length' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   55 |   void changeType(const QModelIndex& index, const Common::MemType type, const size_t length);
      |                                                                         ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemWatcher/MemWatchModel.h:82:33: warning: parameter 'readSucess' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   82 |                                 const bool readSucess = true);
      |                                 ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemWatcher/MemWatchModel.h:84:33: warning: parameter 'writeSucess' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   84 |                                 const bool writeSucess = true);
      |                                 ^~~~~
/w/dolphin-memory-engine/Source/GUI/MemWatcher/MemWatchWidget.h:67:30: warning: parameter 'index' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   67 |   bool isAnyAncestorSelected(const QModelIndex index) const;
      |                              ^~~~~
/w/dolphin-memory-engine/Source/GUI/Settings/SConfig.h:52:17: warning: parameter 'theme' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   52 |   void setTheme(const int theme);
      |                 ^~~~~
/w/dolphin-memory-engine/Source/GUI/Settings/SConfig.h:54:32: warning: parameter 'watcherUpdateTimerMs' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   54 |   void setWatcherUpdateTimerMs(const int watcherUpdateTimerMs);
      |                                ^~~~~
/w/dolphin-memory-engine/Source/GUI/Settings/SConfig.h:55:25: warning: parameter 'freezeTimerMs' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   55 |   void setFreezeTimerMs(const int freezeTimerMs);
      |                         ^~~~~
/w/dolphin-memory-engine/Source/GUI/Settings/SConfig.h:56:32: warning: parameter 'scannerUpdateTimerMs' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   56 |   void setScannerUpdateTimerMs(const int scannerUpdateTimerMs);
      |                                ^~~~~
/w/dolphin-memory-engine/Source/GUI/Settings/SConfig.h:57:31: warning: parameter 'viewerUpdateTimerMs' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   57 |   void setViewerUpdateTimerMs(const int viewerUpdateTimerMs);
      |                               ^~~~~
/w/dolphin-memory-engine/Source/GUI/Settings/SConfig.h:59:20: warning: parameter 'mem1SizeReal' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   59 |   void setMEM1Size(const u32 mem1SizeReal);
      |                    ^~~~~
/w/dolphin-memory-engine/Source/GUI/Settings/SConfig.h:60:20: warning: parameter 'mem2SizeReal' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   60 |   void setMEM2Size(const u32 mem2SizeReal);
      |                    ^~~~~
/w/dolphin-memory-engine/Source/GUI/Settings/SConfig.h:62:35: warning: parameter 'viewerNbrBytesSeparator' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   62 |   void setViewerNbrBytesSeparator(const int viewerNbrBytesSeparator);
      |                                   ^~~~~
/w/dolphin-memory-engine/Source/MemoryScanner/MemoryScanner.h:49:44: warning: parameter 'filter' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   49 |   Common::MemOperationReturnCode firstScan(const ScanFiter filter, const std::string& searchTerm1,
      |                                            ^~~~~
/w/dolphin-memory-engine/Source/MemoryScanner/MemoryScanner.h:51:43: warning: parameter 'filter' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   51 |   Common::MemOperationReturnCode nextScan(const ScanFiter filter, const std::string& searchTerm1,
      |                                           ^~~~~
/w/dolphin-memory-engine/Source/MemoryScanner/MemoryScanner.h:139:16: warning: parameter 'type' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
  139 |   void setType(const Common::MemType type);
      |                ^~~~~
/w/dolphin-memory-engine/Source/MemoryScanner/MemoryScanner.h:140:16: warning: parameter 'base' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
  140 |   void setBase(const Common::MemBase base);
      |                ^~~~~
/w/dolphin-memory-engine/Source/MemoryScanner/MemoryScanner.h:141:31: warning: parameter 'enforceAlignment' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
  141 |   void setEnforceMemAlignment(const bool enforceAlignment);
      |                               ^~~~~
/w/dolphin-memory-engine/Source/MemoryScanner/MemoryScanner.h:142:20: warning: parameter 'isSigned' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
  142 |   void setIsSigned(const bool isSigned);
      |                    ^~~~~
/w/dolphin-memory-engine/Source/MemoryScanner/MemoryScanner.h:157:42: warning: parameter 'index' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
  157 |   std::string getFormattedScannedValueAt(const int index) const;
      |                                          ^~~~~
/w/dolphin-memory-engine/Source/MemoryScanner/MemoryScanner.h:164:29: warning: parameter 'filter' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
  164 |   inline bool isHitNextScan(const ScanFiter filter, const char* memoryToCompare1,
      |                             ^~~~~
/w/dolphin-memory-engine/Source/MemoryScanner/MemoryScanner.h:166:56: warning: parameter 'realSize' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
  166 |                             const char* newerRAMCache, const size_t realSize,
      |                                                        ^~~~~
/w/dolphin-memory-engine/Source/MemoryScanner/MemoryScanner.h:167:29: warning: parameter 'consoleOffset' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
  167 |                             const u32 consoleOffset) const;
      |                             ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchEntry.h:35:24: warning: parameter 'index' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   35 |   int getPointerOffset(const int index) const;
      |                        ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchEntry.h:39:26: warning: parameter 'address' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   39 |   void setConsoleAddress(const u32 address);
      |                          ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchEntry.h:40:25: warning: parameter 'type' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   40 |   void setTypeAndLength(const Common::MemType type, const size_t length = 1);
      |                         ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchEntry.h:40:53: warning: parameter 'length' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   40 |   void setTypeAndLength(const Common::MemType type, const size_t length = 1);
      |                                                     ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchEntry.h:41:16: warning: parameter 'base' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   41 |   void setBase(const Common::MemBase base);
      |                ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchEntry.h:42:16: warning: parameter 'doLock' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   42 |   void setLock(const bool doLock);
      |                ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchEntry.h:43:26: warning: parameter 'isUnsigned' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   43 |   void setSignedUnsigned(const bool isUnsigned);
      |                          ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchEntry.h:44:26: warning: parameter 'boundToPointer' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   44 |   void setBoundToPointer(const bool boundToPointer);
      |                          ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchEntry.h:45:25: warning: parameter 'pointerOffset' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   45 |   void setPointerOffset(const int pointerOffset, const int index);
      |                         ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchEntry.h:45:50: warning: parameter 'index' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   45 |   void setPointerOffset(const int pointerOffset, const int index);
      |                                                  ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchEntry.h:46:18: warning: parameter 'offset' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   46 |   void addOffset(const int offset);
      |                  ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchEntry.h:51:33: warning: parameter 'level' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   51 |   u32 getAddressForPointerLevel(const int level) const;
      |                                 ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchEntry.h:52:47: warning: parameter 'level' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   52 |   std::string getAddressStringForPointerLevel(const int level) const;
      |                                               ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchEntry.h:59:71: warning: parameter 'size' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   59 |   Common::MemOperationReturnCode writeMemoryToRAM(const char* memory, const size_t size);
      |                                                                       ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchTreeNode.h:33:24: warning: parameter 'valueEditing' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   33 |   void setValueEditing(const bool valueEditing);
      |                        ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchTreeNode.h:36:20: warning: parameter 'row' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   36 |   void insertChild(const int row, MemWatchTreeNode* node);
      |                    ^~~~~
/w/dolphin-memory-engine/Source/MemoryWatch/MemWatchTreeNode.h:37:20: warning: parameter 'row' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
   37 |   void removeChild(const int row);
      |                    ^~~~~
```
  • Loading branch information
cristian64 committed May 13, 2024
1 parent c5ff093 commit 71fe1f8
Show file tree
Hide file tree
Showing 19 changed files with 75 additions and 84 deletions.
10 changes: 5 additions & 5 deletions Source/CheatEngineParser/CheatEngineParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CheatEngineParser
QString getErrorMessages() const;
bool hasACriticalErrorOccured() const;
void setTableStartAddress(u32 tableStartAddress);
MemWatchTreeNode* parseCTFile(QIODevice* CTFileIODevice, const bool useDolphinPointer);
MemWatchTreeNode* parseCTFile(QIODevice* CTFileIODevice, bool useDolphinPointer);

private:
struct cheatEntryParsingState
Expand All @@ -38,11 +38,11 @@ class CheatEngineParser
bool validLengthForStr = true;
};

MemWatchTreeNode* parseCheatTable(MemWatchTreeNode* rootNode, const bool useDolphinPointer);
MemWatchTreeNode* parseCheatEntries(MemWatchTreeNode* node, const bool useDolphinPointer);
void parseCheatEntry(MemWatchTreeNode* node, const bool useDolphinPointer);
MemWatchTreeNode* parseCheatTable(MemWatchTreeNode* rootNode, bool useDolphinPointer);
MemWatchTreeNode* parseCheatEntries(MemWatchTreeNode* node, bool useDolphinPointer);
void parseCheatEntry(MemWatchTreeNode* node, bool useDolphinPointer);
void verifyCheatEntryParsingErrors(cheatEntryParsingState state, MemWatchEntry* entry,
bool isGroup, const bool useDolphinPointer);
bool isGroup, bool useDolphinPointer);
static QString formatImportedEntryBasicInfo(const MemWatchEntry* entry);

u32 m_tableStartAddress = 0;
Expand Down
11 changes: 5 additions & 6 deletions Source/Common/MemoryCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@ enum class MemOperationReturnCode
OK
};

size_t getSizeForType(const MemType type, const size_t length);
bool shouldBeBSwappedForType(const MemType type);
int getNbrBytesAlignmentForType(const MemType type);
size_t getSizeForType(MemType type, size_t length);
bool shouldBeBSwappedForType(MemType type);
int getNbrBytesAlignmentForType(MemType type);
char* formatStringToMemory(MemOperationReturnCode& returnCode, size_t& actualLength,
std::string_view inputString, MemBase base, MemType type, size_t length);
std::string formatMemoryToString(const char* memory, const MemType type, const size_t length,
const MemBase base, const bool isUnsigned,
const bool withBSwap = false);
std::string formatMemoryToString(const char* memory, MemType type, size_t length, MemBase base,
bool isUnsigned, bool withBSwap = false);
} // namespace Common
9 changes: 4 additions & 5 deletions Source/DolphinProcess/DolphinAccessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ class DolphinAccessor
static void free();
static void hook();
static void unHook();
static bool readFromRAM(const u32 offset, char* buffer, const size_t size, const bool withBSwap);
static bool writeToRAM(const u32 offset, const char* buffer, const size_t size,
const bool withBSwap);
static bool readFromRAM(u32 offset, char* buffer, size_t size, bool withBSwap);
static bool writeToRAM(u32 offset, const char* buffer, size_t size, bool withBSwap);
static int getPID();
static u64 getEmuRAMAddressStart();
static DolphinStatus getStatus();
Expand All @@ -33,10 +32,10 @@ class DolphinAccessor
static bool isMEM2Present();
static size_t getRAMTotalSize();
static Common::MemOperationReturnCode readEntireRAM(char* buffer);
static std::string getFormattedValueFromMemory(const u32 ramIndex, Common::MemType memType,
static std::string getFormattedValueFromMemory(u32 ramIndex, Common::MemType memType,
size_t memSize, Common::MemBase memBase,
bool memIsUnsigned);
static bool isValidConsoleAddress(const u32 address);
static bool isValidConsoleAddress(u32 address);

private:
static IDolphinProcess* m_instance;
Expand Down
6 changes: 2 additions & 4 deletions Source/DolphinProcess/IDolphinProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ class IDolphinProcess

virtual bool findPID() = 0;
virtual bool obtainEmuRAMInformations() = 0;
virtual bool readFromRAM(const u32 offset, char* buffer, const size_t size,
const bool withBSwap) = 0;
virtual bool writeToRAM(const u32 offset, const char* buffer, const size_t size,
const bool withBSwap) = 0;
virtual bool readFromRAM(u32 offset, char* buffer, size_t size, bool withBSwap) = 0;
virtual bool writeToRAM(u32 offset, const char* buffer, size_t size, bool withBSwap) = 0;

int getPID() const { return m_PID; };
u64 getEmuRAMAddressStart() const { return m_emuRAMAddressStart; };
Expand Down
5 changes: 2 additions & 3 deletions Source/DolphinProcess/Linux/LinuxDolphinProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ class LinuxDolphinProcess : public IDolphinProcess
LinuxDolphinProcess() = default;
bool findPID() override;
bool obtainEmuRAMInformations() override;
bool readFromRAM(const u32 offset, char* buffer, size_t size, const bool withBSwap) override;
bool writeToRAM(const u32 offset, const char* buffer, const size_t size,
const bool withBSwap) override;
bool readFromRAM(u32 offset, char* buffer, size_t size, bool withBSwap) override;
bool writeToRAM(u32 offset, const char* buffer, size_t size, bool withBSwap) override;
};
} // namespace DolphinComm
#endif
5 changes: 2 additions & 3 deletions Source/DolphinProcess/Mac/MacDolphinProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ class MacDolphinProcess : public IDolphinProcess
MacDolphinProcess() = default;
bool findPID() override;
bool obtainEmuRAMInformations() override;
bool readFromRAM(const u32 offset, char* buffer, size_t size, const bool withBSwap) override;
bool writeToRAM(const u32 offset, const char* buffer, const size_t size,
const bool withBSwap) override;
bool readFromRAM(u32 offset, char* buffer, size_t size, bool withBSwap) override;
bool writeToRAM(u32 offset, const char* buffer, size_t size, bool withBSwap) override;

private:
task_t m_task;
Expand Down
6 changes: 2 additions & 4 deletions Source/DolphinProcess/Windows/WindowsDolphinProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ class WindowsDolphinProcess : public IDolphinProcess
WindowsDolphinProcess() = default;
bool findPID() override;
bool obtainEmuRAMInformations() override;
bool readFromRAM(const u32 offset, char* buffer, const size_t size,
const bool withBSwap) override;
bool writeToRAM(const u32 offset, const char* buffer, const size_t size,
const bool withBSwap) override;
bool readFromRAM(u32 offset, char* buffer, size_t size, bool withBSwap) override;
bool writeToRAM(u32 offset, const char* buffer, size_t size, bool withBSwap) override;

private:
HANDLE m_hDolphin;
Expand Down
4 changes: 2 additions & 2 deletions Source/GUI/GUICommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ extern QStringList g_memTypeNames;
extern QStringList g_memScanFilter;
extern QStringList g_memBaseNames;

QString getStringFromType(const Common::MemType type, const size_t length = 0);
QString getNameFromBase(const Common::MemBase base);
QString getStringFromType(Common::MemType type, size_t length = 0);
QString getNameFromBase(Common::MemBase base);

void changeApplicationStyle(int);

Expand Down
2 changes: 1 addition & 1 deletion Source/GUI/MemScanner/MemScanWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class MemScanWidget : public QWidget
void onScanMemTypeChanged();
void onCurrentValuesUpdateTimer();
void onResultListDoubleClicked(const QModelIndex& index);
void handleScannerErrors(const Common::MemOperationReturnCode errorCode);
void handleScannerErrors(Common::MemOperationReturnCode errorCode);
void onFirstScan();
void onNextScan();
void onUndoScan();
Expand Down
2 changes: 1 addition & 1 deletion Source/GUI/MemScanner/ResultsListModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ResultsListModel : public QAbstractTableModel
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
bool removeRows(int row, int count, const QModelIndex& parent) override;

u32 getResultAddress(const int row) const;
u32 getResultAddress(int row) const;
void updateScanner();
void updateAfterScannerReset();
void setShowThreshold(size_t showThreshold);
Expand Down
22 changes: 11 additions & 11 deletions Source/GUI/MemViewer/MemViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ class MemViewer : public QAbstractScrollArea
void paintEvent(QPaintEvent* event) override;
void scrollContentsBy(int dx, int dy) override;
u32 getCurrentFirstAddress() const;
void jumpToAddress(const u32 address);
void jumpToAddress(u32 address);
void updateViewer();
void memoryValidityChanged(const bool valid);
void memoryValidityChanged(bool valid);

signals:
void memErrorOccured();
Expand Down Expand Up @@ -74,21 +74,21 @@ class MemViewer : public QAbstractScrollArea
void editSelection();
void addSelectionAsArrayOfBytes();
void addByteIndexAsWatch(int index);
bool handleNaviguationKey(const int key, bool shiftIsHeld);
bool handleNaviguationKey(int key, bool shiftIsHeld);
bool writeCharacterToSelectedMemory(char byteToWrite);
void updateMemoryData();
void changeMemoryRegion(const MemoryRegion region);
void changeMemoryRegion(MemoryRegion region);
void renderColumnsHeaderText(QPainter& painter) const;
void renderRowHeaderText(QPainter& painter, int rowIndex) const;
void renderSeparatorLines(QPainter& painter) const;
void renderMemory(QPainter& painter, const int rowIndex, const int columnIndex);
void renderHexByte(QPainter& painter, const int rowIndex, const int columnIndex, QColor& bgColor,
void renderMemory(QPainter& painter, int rowIndex, int columnIndex);
void renderHexByte(QPainter& painter, int rowIndex, int columnIndex, QColor& bgColor,
QColor& fgColor, bool drawCarret);
void renderASCIIText(QPainter& painter, const int rowIndex, const int columnIndex,
QColor& bgColor, QColor& fgColor);
void renderCarret(QPainter& painter, const int rowIndex, const int columnIndex);
void determineMemoryTextRenderProperties(const int rowIndex, const int columnIndex,
bool& drawCarret, QColor& bgColor, QColor& fgColor);
void renderASCIIText(QPainter& painter, int rowIndex, int columnIndex, QColor& bgColor,
QColor& fgColor);
void renderCarret(QPainter& painter, int rowIndex, int columnIndex);
void determineMemoryTextRenderProperties(int rowIndex, int columnIndex, bool& drawCarret,
QColor& bgColor, QColor& fgColor);

const int m_numRows = 16;
const int m_numColumns = 16; // Should be a multiple of 16, or the header doesn't make much sense
Expand Down
2 changes: 1 addition & 1 deletion Source/GUI/MemWatcher/Dialogs/DlgChangeType.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class DlgChangeType : public QDialog
Q_OBJECT

public:
DlgChangeType(QWidget* parent, const int typeIndex, const size_t length);
DlgChangeType(QWidget* parent, int typeIndex, size_t length);
int getTypeIndex() const;
size_t getLength() const;
void accept() override;
Expand Down
6 changes: 3 additions & 3 deletions Source/GUI/MemWatcher/MemWatchModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class MemWatchModel : public QAbstractItemModel
bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column,
const QModelIndex& parent) override;

void changeType(const QModelIndex& index, const Common::MemType type, const size_t length);
void changeType(const QModelIndex& index, Common::MemType type, size_t length);
static MemWatchEntry* getEntryFromIndex(const QModelIndex& index);
void addGroup(const QString& name);
void addEntry(MemWatchEntry* entry);
Expand All @@ -79,9 +79,9 @@ class MemWatchModel : public QAbstractItemModel

private:
bool updateNodeValueRecursive(MemWatchTreeNode* node, const QModelIndex& parent = QModelIndex(),
const bool readSucess = true);
bool readSucess = true);
bool freezeNodeValueRecursive(MemWatchTreeNode* node, const QModelIndex& parent = QModelIndex(),
const bool writeSucess = true);
bool writeSucess = true);
MemWatchTreeNode* getLeastDeepNodeFromList(const QList<MemWatchTreeNode*>& nodes) const;
int getNodeDeepness(const MemWatchTreeNode* node) const;

Expand Down
2 changes: 1 addition & 1 deletion Source/GUI/MemWatcher/MemWatchWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ QModelIndexList MemWatchWidget::simplifySelection() const
return simplifiedSelection;
}

bool MemWatchWidget::isAnyAncestorSelected(const QModelIndex index) const
bool MemWatchWidget::isAnyAncestorSelected(const QModelIndex& index) const
{
if (m_watchModel->parent(index) == QModelIndex())
return false;
Expand Down
2 changes: 1 addition & 1 deletion Source/GUI/MemWatcher/MemWatchWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ class MemWatchWidget : public QWidget
QString m_watchListFile = "";
bool m_hasUnsavedChanges = false;

bool isAnyAncestorSelected(const QModelIndex index) const;
bool isAnyAncestorSelected(const QModelIndex& index) const;
QModelIndexList simplifySelection() const;
};
16 changes: 8 additions & 8 deletions Source/GUI/Settings/SConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ class SConfig
void setWatchModel(const QString& json);
void setAutoHook(bool enabled);

void setTheme(const int theme);
void setTheme(int theme);

void setWatcherUpdateTimerMs(const int watcherUpdateTimerMs);
void setFreezeTimerMs(const int freezeTimerMs);
void setScannerUpdateTimerMs(const int scannerUpdateTimerMs);
void setViewerUpdateTimerMs(const int viewerUpdateTimerMs);
void setWatcherUpdateTimerMs(int watcherUpdateTimerMs);
void setFreezeTimerMs(int freezeTimerMs);
void setScannerUpdateTimerMs(int scannerUpdateTimerMs);
void setViewerUpdateTimerMs(int viewerUpdateTimerMs);
void setScannerShowThreshold(int scannerShowThreshold);
void setMEM1Size(const u32 mem1SizeReal);
void setMEM2Size(const u32 mem2SizeReal);
void setMEM1Size(u32 mem1SizeReal);
void setMEM2Size(u32 mem2SizeReal);

void setViewerNbrBytesSeparator(const int viewerNbrBytesSeparator);
void setViewerNbrBytesSeparator(int viewerNbrBytesSeparator);

bool ownsSettingsFile() const;

Expand Down
19 changes: 9 additions & 10 deletions Source/MemoryScanner/MemoryScanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class MemScanner
MemScanner& operator=(const MemScanner&) = delete;
MemScanner& operator=(MemScanner&&) = delete;

Common::MemOperationReturnCode firstScan(const ScanFiter filter, const std::string& searchTerm1,
Common::MemOperationReturnCode firstScan(ScanFiter filter, const std::string& searchTerm1,
const std::string& searchTerm2);
Common::MemOperationReturnCode nextScan(const ScanFiter filter, const std::string& searchTerm1,
Common::MemOperationReturnCode nextScan(ScanFiter filter, const std::string& searchTerm1,
const std::string& searchTerm2);
bool undoScan();
void reset();
Expand Down Expand Up @@ -136,10 +136,10 @@ class MemScanner
return CompareResult::equal;
}

void setType(const Common::MemType type);
void setBase(const Common::MemBase base);
void setEnforceMemAlignment(const bool enforceAlignment);
void setIsSigned(const bool isSigned);
void setType(Common::MemType type);
void setBase(Common::MemBase base);
void setEnforceMemAlignment(bool enforceAlignment);
void setIsSigned(bool isSigned);
void resetSearchRange();
bool setSearchRangeBegin(u32 beginRange);
bool setSearchRangeEnd(u32 endRange);
Expand All @@ -154,17 +154,16 @@ class MemScanner
Common::MemBase getBase() const;
size_t getLength() const;
bool getIsUnsigned() const;
std::string getFormattedScannedValueAt(const int index) const;
std::string getFormattedScannedValueAt(int index) const;
std::string getFormattedCurrentValueAt(int index) const;
void removeResultAt(int index);
static bool typeSupportsAdditionalOptions(Common::MemType type);
bool hasScanStarted() const;

private:
inline bool isHitNextScan(const ScanFiter filter, const char* memoryToCompare1,
inline bool isHitNextScan(ScanFiter filter, const char* memoryToCompare1,
const char* memoryToCompare2, const char* noOffset,
const char* newerRAMCache, const size_t realSize,
const u32 consoleOffset) const;
const char* newerRAMCache, size_t realSize, u32 consoleOffset) const;

bool m_searchInRangeBegin = false;
bool m_searchInRangeEnd = false;
Expand Down
24 changes: 12 additions & 12 deletions Source/MemoryWatch/MemWatchEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,31 @@ class MemWatchEntry
size_t getLength() const;
char* getMemory() const;
bool isUnsigned() const;
int getPointerOffset(const int index) const;
int getPointerOffset(int index) const;
std::vector<int> getPointerOffsets() const;
size_t getPointerLevel() const;
void setLabel(const QString& label);
void setConsoleAddress(const u32 address);
void setTypeAndLength(const Common::MemType type, const size_t length = 1);
void setBase(const Common::MemBase base);
void setLock(const bool doLock);
void setSignedUnsigned(const bool isUnsigned);
void setBoundToPointer(const bool boundToPointer);
void setPointerOffset(const int pointerOffset, const int index);
void addOffset(const int offset);
void setConsoleAddress(u32 address);
void setTypeAndLength(Common::MemType type, size_t length = 1);
void setBase(Common::MemBase base);
void setLock(bool doLock);
void setSignedUnsigned(bool isUnsigned);
void setBoundToPointer(bool boundToPointer);
void setPointerOffset(int pointerOffset, int index);
void addOffset(int offset);
void removeOffset();

Common::MemOperationReturnCode freeze();

u32 getAddressForPointerLevel(const int level) const;
std::string getAddressStringForPointerLevel(const int level) const;
u32 getAddressForPointerLevel(int level) const;
std::string getAddressStringForPointerLevel(int level) const;
Common::MemOperationReturnCode readMemoryFromRAM();

std::string getStringFromMemory() const;
Common::MemOperationReturnCode writeMemoryFromString(const std::string& inputString);

private:
Common::MemOperationReturnCode writeMemoryToRAM(const char* memory, const size_t size);
Common::MemOperationReturnCode writeMemoryToRAM(const char* memory, size_t size);

QString m_label;
u32 m_consoleAddress;
Expand Down
6 changes: 3 additions & 3 deletions Source/MemoryWatch/MemWatchTreeNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class MemWatchTreeNode
bool isValueEditing() const;
bool hasChildren() const;
int childrenCount() const;
void setValueEditing(const bool valueEditing);
void setValueEditing(bool valueEditing);

void appendChild(MemWatchTreeNode* node);
void insertChild(const int row, MemWatchTreeNode* node);
void removeChild(const int row);
void insertChild(int row, MemWatchTreeNode* node);
void removeChild(int row);
void clearAllChild();

void readFromJson(const QJsonObject& json, MemWatchTreeNode* parent = nullptr);
Expand Down

0 comments on commit 71fe1f8

Please sign in to comment.