#exult@irc.freenode.net logs for 28 Apr 2014 (GMT)

Archive Today Yesterday Tomorrow
Exult homepage

[02:47:26] <-- Rottingbeef has left IRC ()
[06:35:45] --> Dominus has joined #exult
[06:35:46] --- ChanServ gives channel operator status to Dominus
[06:36:28] <Dominus> wjp, can you help me validate a little patch? http://pastie.org/9118841
[06:36:44] <Dominus> especially the string char stuff I did in line 26 and following
[06:37:16] <Dominus> as usual I have problems with how that works :)
[06:59:52] <wjp> hi, have to run to catch a train; please remind me in a bit
[07:00:58] <Dominus> oh, sorry, good luck
[11:20:10] --> Rottingbeef has joined #exult
[11:32:25] <SHODAN> is c++11 allowed?
[11:32:43] <SHODAN> then you have std::stoi
[11:35:47] <wjp> you should do the atoi before comparing with 0 and dests
[11:43:13] <Dominus> and then just reverse the if, I guess. let me try
[11:43:28] <SHODAN> just looking at it without ever having seen any exult code, i wonder if "dests > deviceId" makes sense. dests = number of destinations, and deviceid is (presumably) an arbitrary number
[11:44:08] <Dominus> oh, yes, it makes sense
[11:44:13] <SHODAN> good :)
[11:44:23] <wjp> it's a bit inconsistent with the "<= dests" slightly above
[11:45:21] <wjp> and the form deviceId < dests is probably the more "usual" one
[11:45:52] <Dominus> the above just checks that the DEviceID is in the range of the destinations (DeviceID=6 cannot be when there are only 5 destinations)
[11:46:28] <Dominus> so if you deattach devices it defaults to device 0 which is the first device
[11:46:37] <Dominus> and not just errors
[11:47:49] <wjp> but it's unclear if 5 is valid if dests equals 5
[11:48:09] <Dominus> 5 is not valid because the ids begin with 0
[11:48:10] <SHODAN> sure. i was just not aware that the deviceid's was generated in that manner
[11:48:11] <SHODAN> :)
[11:48:27] <wjp> then the check >0 && <= dests should be >= 0 && < dests, I think
[11:50:16] <Dominus> I made it this way now http://pastie.org/9119577
[11:51:06] <Dominus> so if deviceId < 0 it defaults to 0 and if it is >= dests it defaults to 0
[11:51:33] <wjp> ok
[11:54:46] <Dominus> hmm,t hat works nicely
[11:54:59] <Dominus> thanks for the help
[11:55:25] <wjp> no problem
[11:55:43] <wjp> this is for the same thing that I saw you mention on the scummvm bug tracker I suppose?
[11:55:57] <Dominus> yes
[11:56:26] <Dominus> wjp another question, in coremidi.cpp and coreaudio.cpp we have some asserts which digitall of scummvm changed to returns (in his branch)
[11:56:32] <Dominus> should we do this as well?
[11:56:43] <Dominus> https://github.com/digitall/scummvm/commit/4394e553d4a0a23636a7ddff1edfc285720af4c4
[11:57:13] <Dominus> https://github.com/digitall/scummvm/commit/d3ad3eb16f2b39da93a3e143881138807dd519d2
[11:57:25] <wjp> hm, unsure
[11:57:51] <wjp> arguably the code calling this _should_ have checked the device is open
[12:01:09] <Dominus> yeah, a warning message like this might be better than just killing Exult
[12:06:37] <wjp> I wonder if this will start spamming warnings, though
[12:07:04] <wjp> but I haven't looked
[12:07:56] <Dominus> hmm, can one add an error message to an assertion? so stdout/err gives some hint why it crashed?
[12:08:16] <wjp> usually easier to just do it explicitly
[12:08:33] <Dominus> I haven't had any crashes yet but haven't played extensively with CoreMidi yet
[12:08:36] <wjp> i.e., do a check with an if, print the message, and then assert
[12:08:56] <wjp> you can simulate it by just "forgetting" to open the device in the init code
[12:09:51] <Dominus> so similar to digitalls code but instead of return; assert; ?
[12:10:01] <Dominus> (or assert () ?)
[12:10:21] <Dominus> or assert(isOpen()); ?
[12:10:47] <Dominus> will test this tonight, now I need to wake up my litle boy :)
[12:12:55] <wjp> assert(isOpen()); is probably clearest
[13:54:36] <-- Kirben has left IRC ()
[15:45:39] --> DominusExult has joined #exult
[15:45:39] --- ChanServ gives channel operator status to DominusExult
[15:48:05] <-- Dominus has left IRC (Ping timeout: 252 seconds)
[15:48:05] --- DominusExult is now known as Dominus
[22:07:12] <-- Marzo has left IRC (Ping timeout: 240 seconds)
[22:20:02] <-- nutron has left IRC (Ping timeout: 252 seconds)
[22:39:44] --> nutron has joined #exult
[22:44:00] --> Marzo has joined #exult
[23:09:59] --> Kirben has joined #exult
[23:10:00] --- ChanServ gives channel operator status to Kirben