Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
8ef87be4
Commit
8ef87be4
authored
Jan 08, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Queue: use signed integer instead of G_MAXUINT
The check for unsigned underflow is fragile and unreliable.
parent
6c570473
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
Queue.cxx
src/Queue.cxx
+1
-1
No files found.
src/Queue.cxx
View file @
8ef87be4
...
...
@@ -181,7 +181,7 @@ queue::MoveRange(unsigned start, unsigned end, unsigned to)
// If to < start, we need to move start-to items to newend (= end + to - start), starting from to
// This is the same as moving items from start-1 to to (decreasing), with start-1 going to end-1
// We have to iterate in this order to avoid writing over something we haven't yet moved
for
(
unsigned
i
=
start
-
1
;
i
>=
to
&&
i
!=
G_MAXUINT
;
i
--
)
for
(
int
i
=
start
-
1
;
i
>=
int
(
to
)
;
i
--
)
MoveItemTo
(
i
,
i
+
end
-
start
);
// Copy the original block back in, starting at to.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment