Times are UTC Toggle Colours
01:34:37 *** Supercheese has joined #openttd.dev 01:34:37 *** ChanServ sets mode: +v Supercheese 01:48:59 *** Supercheese has quit IRC 01:49:31 *** Supercheese has joined #openttd.dev 01:49:31 *** ChanServ sets mode: +v Supercheese 02:08:14 *** Supercheese has quit IRC 02:34:04 *** Supercheese has joined #openttd.dev 02:34:04 *** ChanServ sets mode: +v Supercheese 07:39:57 *** Supercheese has quit IRC 15:17:40 *** Alberth has joined #openttd.dev 15:17:40 *** ChanServ sets mode: +v Alberth 16:40:04 *** frosch123 has joined #openttd.dev 16:40:04 *** ChanServ sets mode: +v frosch123 17:30:51 <fonsinchen> planetmaker: no, I want to prefer the cargo with more AvailableCount there. The problem was that it would always load coal, even if only 10t were available, because that has the lowest ID. 19:34:14 <fonsinchen> https://github.com/ulfhermann/openttd/commit/02ec5c9467218b54874c59a44cd6cdc1a987896d 19:34:26 <fonsinchen> No more tile demands. 19:34:34 <fonsinchen> andythenorth convinced me. 19:39:10 <frosch123> looks fancy 19:46:41 *** frosch123 has quit IRC 19:47:37 *** frosch123 has joined #openttd.dev 19:47:37 *** ChanServ sets mode: +v frosch123 19:47:50 <frosch123> what has the stuff in strings.cpp to do with a string class? 19:48:31 <fonsinchen> It does similar things to what other string classes do. 19:48:52 <frosch123> i would compare it to gettext, but not to a string class :) 19:49:08 <frosch123> it does not do string manipulation 19:49:51 <frosch123> string.cpp is the string class stuff 19:49:53 <fonsinchen> It does some sort of printf lookalike. The internationalization is arguably the only application of that, but still. 19:50:07 <frosch123> btw. we should get rid of ttd_strlcpy and ttd_strlcat 19:52:09 <frosch123> i'll take a look at ttd_strl* 19:54:47 <frosch123> hmm, is "<" a meaningful operation for pointers? 19:55:12 <fonsinchen> it's desync-prone 19:55:20 <fonsinchen> where did you find it? 19:55:36 <frosch123> no, i mean to check string/array bound 19:55:47 <frosch123> p < lastof(buffer) 19:56:07 <frosch123> i guess only signedness could mess it up 19:56:46 <fonsinchen> signedness of what? 19:56:54 <fonsinchen> Pointers are unsigned 19:57:26 <fonsinchen> You mean it gets casted to int? That may be ... 19:57:27 <frosch123> oh, is that defined? 19:57:50 <frosch123> so NULL <= any pointer? 19:57:50 <fonsinchen> operator< should be defined on pointers 19:57:55 * fonsinchen looks it up 19:59:20 <frosch123> ah, found the first buffer overrun :) 19:59:40 <frosch123> ttd_strlcpy(r, ".lng", (size_t)(r - pathbuf)); 19:59:51 <frosch123> so, strecpy is already better :) 20:04:53 <fonsinchen> nice 20:06:40 <Alberth> afaik you may only compare pointers that point into the same array 20:07:08 <fonsinchen> http://stackoverflow.com/questions/4607418/how-do-the-operators-and-work-with-pointers has a quote from the standard 20:07:18 <frosch123> Alberth: that definition is not particulary useful for a range check :) 20:07:26 <frosch123> it's like the gcc 4.5 enum optimisation 20:07:42 <frosch123> which optimised away the range check for enum values, since it can never be true 20:07:46 <frosch123> resp. false 20:08:55 <fonsinchen> The quote says you can also compare the one-past-the-end pointer of an array to members of the array 20:09:17 <Alberth> fonsinchen: indeed, one further than the end is explicitly supported 20:09:56 <Alberth> frosch123: it has to do with a - b which does an implicit "/ sizeof(*a)" 20:11:43 *** Alberth has left #openttd.dev 20:13:35 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r26482 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking" 20:21:40 <frosch123> where is stredup? 20:22:18 <Rubidium> it's not there yet ;) 20:22:28 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r26483 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking" 20:22:43 <frosch123> ok, i'll continue to use strndup then :p 20:23:23 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r26484 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking" 20:41:45 <frosch123> http://devs.openttd.org/~frosch/diffs/ttd_strl.diff <- removing ttd_strlcpy and ttd_strlcat 20:41:54 <frosch123> ttd_strnlen remains, since there is no replacement 20:43:25 <Rubidium> looks okay to me 20:43:35 <Rubidium> I'm working on s(n)printf now 20:44:43 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r26485 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking" 20:44:54 <frosch123> i replaced one snprintf 20:45:24 <Rubidium> that's fine ;) 20:45:35 <frosch123> just beware of conflicts :) 20:46:06 <frosch123> most of the Fio functions use buflen instead of last 20:46:20 <frosch123> but most of the underlying os functions do as well 20:48:16 <Rubidium> yeah... that bit is a PITA 20:53:13 <frosch123> hmm, some places look like we may need a strdupcat 20:53:30 <frosch123> to allocate a new copy of a concatenation 20:54:02 <frosch123> hmm, actually, no 20:54:22 <frosch123> those were alloca, not allocm 20:55:52 <frosch123> night 20:55:57 *** frosch123 has quit IRC 21:12:10 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r26486 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking" 21:16:59 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r26487 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking" 21:19:55 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r26488 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking" 21:23:22 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r26489 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking" 21:30:32 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r26490 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking" 21:32:41 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r26491 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking" 21:33:29 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r26492 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking"