IRC logs for #openttd on OFTC at 2017-06-21
⏴ go to previous day
00:59:27 *** zetamek has joined #openttd
01:49:37 *** ChanServ sets mode: +v tokai
03:17:56 *** Bhootrk_ has joined #openttd
03:19:23 *** Bhootrk_ has joined #openttd
03:20:52 *** Bhootrk_ has joined #openttd
05:22:42 *** sla_ro|master has joined #openttd
06:31:29 *** gnu_jj_ has joined #openttd
07:33:33 *** cosmobird has joined #openttd
07:59:08 *** andythenorth has joined #openttd
08:26:59 *** andythenorth has joined #openttd
08:31:41 *** cosmobird_ has joined #openttd
09:39:10 *** Cybertinus has joined #openttd
09:48:01 *** FLHerne has joined #openttd
09:50:07 *** JacobD88 has joined #openttd
09:57:42 *** Cybertinus has joined #openttd
09:58:37 *** andythenorth has joined #openttd
10:27:53 *** andythenorth has left #openttd
10:40:58 *** JacobD88 has joined #openttd
10:45:10 <Wolf01> Mmmmh, I think I need to purchase some Blues Saraceno albums
11:00:23 *** Lejving has joined #openttd
11:34:00 *** cosmobird has joined #openttd
11:57:51 *** cosmobird_ has joined #openttd
12:29:02 *** Warrigal has joined #openttd
13:14:56 *** mindlesstux has joined #openttd
13:52:26 *** FLHerne has joined #openttd
14:01:22 *** cosmobird__ has joined #openttd
14:24:11 *** sla_ro|master has joined #openttd
15:19:17 *** cosmobird_ has joined #openttd
16:28:42 *** Alberth has joined #openttd
16:28:42 *** ChanServ sets mode: +o Alberth
16:29:23 *** FLHerne has joined #openttd
16:31:27 *** Wormnest has joined #openttd
17:04:48 *** Coobies has joined #openttd
17:08:46 *** Belugas has joined #openttd
17:08:46 *** ChanServ sets mode: +o Belugas
17:12:56 *** frosch123 has joined #openttd
17:14:41 *** Sheogorath has joined #openttd
17:55:16 *** TheMask96 has joined #openttd
18:08:55 *** FLHerne has joined #openttd
18:16:22 *** Progman has joined #openttd
18:44:54 *** HerzogDeXtEr has joined #openttd
19:14:09 *** gelignite has joined #openttd
19:38:13 <Alberth> LordAro: Please fix the Compare(x, x) -> true first, that should never happen, it does that in all compare functions for the first 600 lines patch-file
19:40:33 <LordAro> Alberth: huh, you mean a<=b instead of a<b ?
19:40:52 <Alberth> I mean _reverse != (a<a)
19:41:22 <Alberth> for one value of {false, true} that gives true
19:43:47 *** JacobD88 has joined #openttd
19:47:58 <frosch123> if the comparator returns true for a<a, it may result in an infinite loop
19:48:42 <frosch123> at least for the implementation that came with g++ 4.1
19:49:04 <frosch123> no idea whether someone made it more robust
19:50:10 *** Smedles has joined #openttd
19:55:27 <Alberth> ha, found alcohol cargo in arctic basic :)
20:08:37 *** andythenorth has joined #openttd
20:22:47 *** Biolunar has joined #openttd
20:25:30 *** FLHerne has joined #openttd
20:39:15 <LordAro> Alberth: i feel like there should be a cleaner way of doing _reverse ? !r : r
20:40:15 <LordAro> which still wouldn't actually fix the issue, would it?
20:41:01 <LordAro> a!=b && _reverse ? !(a<b) : (a<b) then
20:43:25 <Alberth> something like that, but I doubt it counts as cleaner :)
20:44:10 <Alberth> if (r == 0) return false; return _reverse != (r < 0);
20:45:20 <Alberth> you can fold that in a function of course
20:46:08 <Alberth> the subtle change is that -0 == 0, but b != !b
20:50:33 *** Stimrol has joined #openttd
20:58:18 *** cosmobird__ has joined #openttd
21:24:01 *** Stimrol has joined #openttd
21:26:03 <LordAro> for most of the functions if a == b, then they go via a "lower level" sorting function instead
21:26:19 <LordAro> so this issue is moot?
21:39:09 <Alberth> except for the lowest compare, which was the case for at least the compare functions in the first 600 lines of the patch
21:39:28 <Alberth> at that point I stopped reading, so there may be more
21:41:40 <Alberth> my sort of standard approach is if (a.x != b.x) return a.x < b.x; if (a.y != b.y) return a.y < b.y; /* etc *; return false; ie test each field for equality first
21:44:17 <LordAro> hmm, i can't just do a basic a != b check, can i? i have to check that the test the function does is equal
21:44:52 <LordAro> because (e.g.) a != b, but a->foo == b->foo may be the case
21:45:19 * LordAro wonders how a == b could cause an infinite loop
21:45:29 <Alberth> bool operator==(T &x, T& y) { .. }
21:45:46 <Alberth> repeatedly swapping the values
21:47:20 <LordAro> would std::stable_sort avoid this problem all together?
21:47:21 <Alberth> probably depends on some detail in the implementation
21:47:45 <Alberth> no, since (a<a) must return false
21:48:02 <Alberth> it returns true in some cases, so you're in undefined waters
21:48:34 *** FLHerne has joined #openttd
21:49:33 <Alberth> sometimes it's useful to have this special 0 value :)
21:52:08 * LordAro sits in a corner in a huff
21:57:41 <Alberth> stop doing stuff this evening, and tomorrow insert an equality test
22:00:16 <LordAro> hehe, diffs of diffs are always fun
22:01:07 <Alberth> I tried that a few times to save the mq state, but it's too complicated to read :)
22:01:31 <LordAro> i used to do it quite a bit for the 32bpp patches
22:01:32 <Alberth> you have to be really awake for that stuff :p
22:02:55 <Alberth> but it has its uses, like checking that you copied each hunk of a patch (only different line numbers thus)
22:21:05 *** sim-al2 has joined #openttd
22:38:39 *** andythenorth has joined #openttd
23:01:58 *** quiznilo has joined #openttd
23:04:42 *** FLHerne has joined #openttd
23:05:09 *** andythenorth has joined #openttd
23:42:47 *** andythenorth has left #openttd
continue to next day ⏵