Skip to content

Commit be0dda2

Browse files
committed
display/drm: Mark move ctors on RAII helpers as noexcept
1 parent d274207 commit be0dda2

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/video_display/drm.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ namespace{
8686
Fd_uniq() = default;
8787
Fd_uniq(int fd) : fd(fd) { }
8888
Fd_uniq(const Fd_uniq&) = delete;
89-
Fd_uniq(Fd_uniq&& o){
89+
Fd_uniq(Fd_uniq&& o) noexcept{
9090
std::swap(fd, o.fd);
9191
}
9292

@@ -95,14 +95,14 @@ namespace{
9595
}
9696

9797
Fd_uniq& operator=(const Fd_uniq&) = delete;
98-
Fd_uniq& operator=(Fd_uniq&& o){
98+
Fd_uniq& operator=(Fd_uniq&& o) noexcept{
9999
std::swap(fd, o.fd);
100100
return *this;
101101
}
102102

103103
operator bool() const { return fd > 0; }
104104

105-
int get() { return fd; }
105+
int get() const { return fd; }
106106
void reset(int fd){
107107
destruct();
108108
this->fd = fd;
@@ -171,11 +171,11 @@ namespace{
171171
Uniq_wrapper(const Uniq_wrapper&) = delete;
172172
Uniq_wrapper& operator=(const Uniq_wrapper&) = delete;
173173

174-
Uniq_wrapper(Uniq_wrapper&& o){
174+
Uniq_wrapper(Uniq_wrapper&& o) noexcept{
175175
std::swap(val, o.val);
176176
}
177177

178-
Uniq_wrapper& operator=(Uniq_wrapper&& o){
178+
Uniq_wrapper& operator=(Uniq_wrapper&& o) noexcept{
179179
std::swap(val, o.val);
180180
return *this;
181181
}
@@ -209,7 +209,7 @@ namespace{
209209
};
210210

211211
struct Fb_id_deleter {
212-
void operator()(Fb_id i){
212+
void operator()(Fb_id i) const{
213213
if(i.dri_fd < 0)
214214
return;
215215

@@ -254,11 +254,11 @@ namespace{
254254

255255
Handle(const Handle&) = delete;
256256
Handle& operator=(const Handle&) = delete;
257-
Handle(Handle&& o){
257+
Handle(Handle&& o) noexcept{
258258
std::swap(handle, o.handle);
259259
std::swap(ctx, o.ctx);
260260
}
261-
Handle& operator=(Handle&& o){
261+
Handle& operator=(Handle&& o) noexcept{
262262
std::swap(handle, o.handle);
263263
std::swap(ctx, o.ctx);
264264
return *this;
@@ -283,7 +283,7 @@ namespace{
283283
log_msg(LOG_LEVEL_ERROR, MOD_NAME "Failed to get a GEM handle from prime fd %d\n", fd);
284284
return {};
285285
}
286-
return Handle(handle, this);
286+
return {handle, this};
287287
}
288288

289289
};

0 commit comments

Comments
 (0)