From: Brandon Potter Date: Wed, 18 Apr 2018 18:44:10 +0000 (-0400) Subject: syscall_emul: refactor FDEntry and children classes X-Git-Tag: v19.0.0.0~1789 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bed9460aaa6ade07383642e14e5076ce5e456fea;p=gem5.git syscall_emul: refactor FDEntry and children classes Strips off superfluous inline specifiers in header file. Changes return types and parameters that deal with strings to include the const& specifiers. Change-Id: I570b1801abb059b91216f0223458d00963b9ca1c Reviewed-on: https://gem5-review.googlesource.com/12111 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- diff --git a/src/sim/fd_entry.hh b/src/sim/fd_entry.hh index fd3cf72ef..980011984 100644 --- a/src/sim/fd_entry.hh +++ b/src/sim/fd_entry.hh @@ -57,9 +57,9 @@ class FDEntry : public Serializable virtual std::shared_ptr clone() const = 0; - inline bool getCOE() const { return _closeOnExec; } + bool getCOE() const { return _closeOnExec; } - inline void setCOE(bool close_on_exec) { _closeOnExec = close_on_exec; } + void setCOE(bool close_on_exec) { _closeOnExec = close_on_exec; } virtual void serialize(CheckpointOut &cp) const; virtual void unserialize(CheckpointIn &cp); @@ -80,11 +80,11 @@ class HBFDEntry: public FDEntry : FDEntry(close_on_exec), _flags(flags), _simFD(sim_fd) { } - inline int getFlags() const { return _flags; } - inline int getSimFD() const { return _simFD; } + int getFlags() const { return _flags; } + int getSimFD() const { return _simFD; } - inline void setFlags(int flags) { _flags = flags; } - inline void setSimFD(int sim_fd) { _simFD = sim_fd; } + void setFlags(int flags) { _flags = flags; } + void setSimFD(int sim_fd) { _simFD = sim_fd; } protected: int _flags; @@ -113,17 +113,17 @@ class FileFDEntry: public HBFDEntry _fileName(reg._fileName), _fileOffset(reg._fileOffset) { } - inline std::shared_ptr + std::shared_ptr clone() const override { return std::make_shared(*this); } - inline std::string getFileName() const { return _fileName; } - inline uint64_t getFileOffset() const { return _fileOffset; } + std::string const& getFileName() const { return _fileName; } + uint64_t getFileOffset() const { return _fileOffset; } - inline void setFileName(std::string file_name) { _fileName = file_name; } - inline void setFileOffset (uint64_t f_off) { _fileOffset = f_off; } + void setFileName(std::string const& file_name) { _fileName = file_name; } + void setFileOffset(uint64_t f_off) { _fileOffset = f_off; } void serialize(CheckpointOut &cp) const override; void unserialize(CheckpointIn &cp) override; @@ -157,17 +157,17 @@ class PipeFDEntry: public HBFDEntry _pipeEndType(pipe._pipeEndType) { } - inline std::shared_ptr + std::shared_ptr clone() const override { return std::make_shared(*this); } - inline EndType getEndType() const { return _pipeEndType; } - inline int getPipeReadSource() const { return _pipeReadSource; } + EndType getEndType() const { return _pipeEndType; } + int getPipeReadSource() const { return _pipeReadSource; } - inline void setPipeReadSource(int tgt_fd) { _pipeReadSource = tgt_fd; } - inline void setEndType(EndType type) { _pipeEndType = type; } + void setPipeReadSource(int tgt_fd) { _pipeReadSource = tgt_fd; } + void setEndType(EndType type) { _pipeEndType = type; } void serialize(CheckpointOut &cp) const override; void unserialize(CheckpointIn &cp) override; @@ -200,8 +200,8 @@ class DeviceFDEntry : public FDEntry return std::make_shared(*this); } - inline EmulatedDriver *getDriver() const { return _driver; } - inline std::string getFileName() const { return _fileName; } + EmulatedDriver *getDriver() const { return _driver; } + std::string const& getFileName() const { return _fileName; } void serialize(CheckpointOut &cp) const override; void unserialize(CheckpointIn &cp) override;