IRC logs for #openttd on OFTC at 2018-10-14
⏴ go to previous day
00:09:07 <Samu> there's a hurricane here
00:30:08 *** ChanServ sets mode: +v tokai
02:22:27 *** Thedarkb-T60 has joined #openttd
02:25:51 *** tokai|noir has joined #openttd
02:25:51 *** ChanServ sets mode: +v tokai|noir
02:48:48 *** berndj-blackout is now known as berndj
02:56:07 *** Supercheese has joined #openttd
03:29:43 *** ChanServ sets mode: +v tokai
03:30:34 *** Stimrol has joined #openttd
05:11:42 *** haudrauf has joined #openttd
05:27:14 *** triolus has joined #openttd
05:42:49 *** triolus has joined #openttd
06:40:12 *** triolus has joined #openttd
07:11:10 *** sla_ro|master has joined #openttd
07:25:41 *** Wacko1976 has joined #openttd
07:50:37 *** triolus has joined #openttd
07:50:37 *** Gustavo6046 has joined #openttd
07:50:37 *** ToBeFree has joined #openttd
07:50:37 *** quiznilo has joined #openttd
07:50:37 *** Extrems has joined #openttd
07:50:37 *** mikegrb has joined #openttd
07:50:37 *** Tharbakim has joined #openttd
07:50:37 *** HeyCitizen has joined #openttd
07:50:37 *** greeter has joined #openttd
08:46:18 *** techmagus has joined #openttd
08:47:13 *** triolus has joined #openttd
08:47:13 *** Gustavo6046 has joined #openttd
08:47:13 *** ToBeFree has joined #openttd
08:47:13 *** quiznilo has joined #openttd
08:47:13 *** Extrems has joined #openttd
08:47:13 *** mikegrb has joined #openttd
08:47:13 *** Tharbakim has joined #openttd
08:47:13 *** HeyCitizen has joined #openttd
08:47:13 *** greeter has joined #openttd
09:14:37 *** mikegrb has joined #openttd
09:59:13 *** Progman has joined #openttd
10:28:29 *** matt21347 has joined #openttd
10:36:09 *** gelignite has joined #openttd
10:40:34 *** Stimrol_ has joined #openttd
11:00:02 *** HerzogDeXtEr has joined #openttd
12:51:19 *** Thedarkb-T60 has joined #openttd
13:16:16 *** Thedarkb-T60 has joined #openttd
13:29:32 *** Thedarkb-T60 has joined #openttd
13:35:07 *** frosch123 has joined #openttd
13:52:01 *** wodencafe has joined #openttd
13:57:24 <nielsm> what a silent weekend, this one
13:57:32 <Eddi|zuHause> and you broke it
14:23:02 <greeter> oh i thought today was monday, yeah it's broken now
14:36:42 *** sim-al2 has joined #openttd
15:08:30 *** Thedarkb has joined #openttd
15:53:06 *** Mahjong1 has joined #openttd
16:10:34 *** Stimrol has joined #openttd
16:27:47 *** snail_UES_ has joined #openttd
16:41:03 *** Wormnest has joined #openttd
18:51:51 <LordAro> frosch123: newgrf.cpp:3790, is there a missing break, or are the size & copy_from assignments just redundant?
18:51:55 *** Thedarkb has joined #openttd
18:52:31 <LordAro> similar situation at 3475
19:00:24 <frosch123> what a crappy piece of code
19:00:56 <frosch123> anyway, there should be no "break". the assignment of "size" and "copy_from" is pointless
19:01:16 <frosch123> copy_from in a whole seems to pointless
19:01:25 <LordAro> i noticed it was newgrf airport layouts, so wondered if the code was just unused :)
19:01:45 <frosch123> att seems to be some std::vector, which has a preassigned size of "defsize"
19:01:49 <frosch123> but nothing is checked ever
19:02:25 <LordAro> sounds about right :)
19:02:31 <frosch123> no, it's not unused, it's probably even the most used case
19:02:58 <LordAro> (i've gotten scan-build working, am going through some of the reported "issues")
19:03:47 *** gelignite has joined #openttd
19:03:48 *** Wacko1976 has joined #openttd
19:04:18 <frosch123> oh, industries layouts even check def_num_tiles :)
19:04:23 <frosch123> so, that part was not copied to airports
19:16:28 *** Progman has joined #openttd
19:30:29 *** andythenorth has joined #openttd
19:38:46 <andythenorth> I broke bananas :)
19:39:02 <andythenorth> "Unhandled Exception" when trying to update FIRS
19:43:43 <frosch123> if it was on devzone i would guess for disk full
19:43:47 <frosch123> no idea about ottd :)
19:43:59 *** Thedarkb has joined #openttd
19:57:09 *** Gustavo6046 has joined #openttd
20:01:31 *** wodencafe has joined #openttd
20:12:45 *** andythenorth has joined #openttd
20:40:02 *** Thedarkb-T60 has joined #openttd
21:01:27 *** HeyCitizen_ has joined #openttd
21:15:07 *** andythenorth has joined #openttd
21:21:19 *** andythenorth has joined #openttd
21:25:07 <LordAro> frosch123: tree_cmd.cpp:718 calls AddTreeCount with a value of -1... which is then does `-1 << 6`, which is undefined
21:26:16 <nielsm> is it really,undefined?
21:27:10 <nielsm> I'd expect it to shift in 6 zeroes, effectively multiplying by 64
21:28:00 <frosch123> "-1 << 6" is not undefined
21:28:04 <frosch123> but likely not intentional
21:28:28 <frosch123> actually, it is just fine
21:29:49 <frosch123> so, yeah, i see nothing wrong with that
21:30:13 <frosch123> it correctly decrements the treecount by one
21:32:46 <LordAro> bitshifting negative numbers is undefined, last time i checked
21:33:26 <frosch123> the right-hand side must be >= 0
21:33:30 <frosch123> but the left is just fine
21:33:48 <frosch123> << works fine with negative left side
21:34:23 <frosch123> >> is a bit more tricky since ((uint)-1) >> 1 != ((int)-1 >> 1)
21:35:20 <frosch123> right-hand side must be >= 0 and < total number of bits to be well defined in languages which directly translate it to assembler
21:35:40 <frosch123> since most(all?) processors just mask it to 5/6/... bits
21:38:53 <LordAro> "if E1 has a signed type and non-negative value, and E1 × 2E2 is representable in the result type, then that is the resulting value; otherwise, the behavior is undefined."
21:39:22 <LordAro> if it helps, this does seem to have changed between C89/C++03 & C99/C++11
21:42:48 <frosch123> c++98 says nothing about that
21:43:02 <frosch123> but c++ has always been more defined than plain c
21:43:41 <frosch123> c++98 5.8 [expr-shift] makes the restrictions about the rhs as said above
21:44:02 <frosch123> and then defines << in general, and >> for signed and unsigned separately
21:50:58 <frosch123> LordAro: i checked the plain c standard. there they distinguish platforms which do and do not support "negative zero"
21:51:10 <frosch123> and depending on that "<<" is undefined
21:51:17 <frosch123> so, it is a C issue, no C++ issue
21:55:49 <frosch123> funnily in the beginning of the c++ standard they explicitly mention that integer with ones-complement are also an option, but then never follow it up
21:56:18 <frosch123> but eh, i am not aware of any processor not doing twos-complement integers in the past 50 years
21:58:33 <frosch123> so, definitely ttd era :)
22:07:46 <frosch123> they promise a quite big single-thread performance. so, maybe it's an option for ottd
22:14:21 <frosch123> hmm, the single one ebay offer i can find has ordinary xeon cpus
22:18:27 *** wodencafe has joined #openttd
22:58:31 *** sim-al2 has joined #openttd
23:56:24 *** andythenorth has left #openttd
continue to next day ⏵