dee

Merge lp:~jbicha/dee/fix-misleading-indent into lp:dee

Proposed by Jeremy Bícha
Status: Merged
Approved by: Robert Ancell
Approved revision: 439
Merged at revision: 439
Proposed branch: lp:~jbicha/dee/fix-misleading-indent
Merge into: lp:dee
Diff against target: 16 lines (+4/-2)
1 file modified
src/dee-serializable-model.c (+4/-2)
To merge this branch: bzr merge lp:~jbicha/dee/fix-misleading-indent
Reviewer Review Type Date Requested Status
Robert Ancell Approve
Review via email: mp+325875@code.launchpad.net

Commit message

Fix pos variable being incorrectly incremented due to missing braces.

Found by a compiler warning that noticed the indentation looked suspicious.

Description of the change

This fixes the build.

dee-serializable-model.c: In function ‘dee_serializable_model_get_position’:
dee-serializable-model.c:1329:3: error: this ‘while’ clause does not guard... [-Werror=misleading-indentation]
   while (!dee_model_is_last (self, iter) && iter != _iter)
   ^~~~~
dee-serializable-model.c:1331:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘while’
     pos++;

https://launchpadlibrarian.net/324288486/buildlog_ubuntu-artful-amd64.dee_1.2.7+15.04.20150304-0ubuntu4~ubuntu17.10.1_BUILDING.txt.gz

It's just a warning but these flags are set:
-Werror -Wall -Wno-error=deprecated-declarations

To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) wrote :

I updated the commit message to reflect this is actually a code change and potentially fixes a bug. I don't know if any code currently uses this or relies on the broken behaviour (I suspect not).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/dee-serializable-model.c'
2--- src/dee-serializable-model.c 2013-09-16 18:50:51 +0000
3+++ src/dee-serializable-model.c 2017-06-16 22:19:02 +0000
4@@ -1327,8 +1327,10 @@
5 pos = 0;
6 _iter = dee_model_get_first_iter (self);
7 while (!dee_model_is_last (self, iter) && iter != _iter)
8- _iter = dee_model_next (self, _iter);
9- pos++;
10+ {
11+ _iter = dee_model_next (self, _iter);
12+ pos++;
13+ }
14
15 if (iter == _iter)
16 return pos;

Subscribers

People subscribed via source and target branches

to all changes: