#exult@irc.freenode.net logs for 4 Feb 2001 (GMT)

Archive Today Yesterday Tomorrow
Exult homepage

[04:48:14] <-- Kirben has left IRC (Read error to Kirben[co3007967-a.brasd1.vic.optushome.com.au]: Connection reset by peer)
[12:38:16] --> wjp has joined #exult
[16:38:49] --> Fingolfin has joined #exult
[16:39:18] <Fingolfin> lo
[16:39:48] <wjp> hi
[16:40:01] <wjp> well, I committed the keybinder
[16:40:07] <Fingolfin> really?
[16:40:10] <wjp> yup
[16:40:14] <Fingolfin> gotta check it out then ;)
[16:40:26] <wjp> yup :-)
[16:59:18] <-- Fingolfin has left IRC (Read error to Fingolfin[p3EE22560.dip.t-dialin.net]: Connection reset by peer)
[17:07:32] --> Fingolfin has joined #exult
[17:08:38] <wjp> wb
[17:08:55] <wjp> that wasn't a crash I hope?
[17:10:12] <Fingolfin> it was, but not in exult
[17:11:29] <wjp> did you already get keys.cc? if so, could you take a look at line 255?
[17:13:24] <Fingolfin> yes
[17:13:53] <wjp> I'm trying to compare the first 4 characters of u with "ALT-"
[17:14:11] <Fingolfin> I see it
[17:14:18] <wjp> according to stroustrup, this should be "u.compare(0,4,"ALT-")"
[17:14:21] <Fingolfin> wait a moment, I first need to fix keys.cc to compile for me ;)
[17:14:49] <wjp> :-(
[17:15:11] <wjp> I probably missed a few 'using std::...'. anything else?
[17:15:50] <Fingolfin> I don't get even so far
[17:16:08] <Fingolfin> Error : expression syntax error
[17:16:08] <Fingolfin> keys.cc line 45 { ActionQuit, "Quit", true, false, NONE },
[17:16:29] <wjp> hmmm
[17:16:46] <Fingolfin> actually
[17:16:50] <Fingolfin> it does this for every line
[17:17:06] <wjp> maybe #include "keyactions.h" ?
[17:17:39] <Fingolfin> nope
[17:17:42] <wjp> nm, keys.h already does that
[17:17:53] <Fingolfin> yup
[17:18:02] <wjp> although I'm not sure _why_ keys.h already includes it
[17:18:10] <Fingolfin> ah I have an idea
[17:19:50] <Fingolfin> nope
[17:19:51] <Fingolfin> hrm
[17:21:12] <wjp> maybe moving the declaration of 'Action' to right in front of ExultActions will help? (like in exult.cc for the resolutions)
[17:22:40] <Fingolfin> I know the problem now
[17:23:20] <Fingolfin> the string constants like "Quit" cause the problem, the compiler refuses to use them as constructor argument to std::string
[17:23:28] <Fingolfin> so chanign std::string desc to char* makes it compile
[17:23:47] <Fingolfin> well, compile the array at least ;)
[17:23:56] <wjp> I see
[17:24:07] <wjp> ah well, doesn't matter much
[17:28:50] <Fingolfin> next problem
[17:28:50] <Fingolfin> you use | on enums - the result will be an int, not the enum type anymore
[17:28:50] <Fingolfin> this breaks if you use |=
[17:28:50] <wjp> yeah, I noticed the warnings
[17:28:50] <Fingolfin> here I get an error
[17:28:50] <-- exultbot has left IRC (signing off...)
[17:30:06] --> exultbot has joined #exult
[17:30:06] --- Topic for #exult is: Exult, the open source Ultima 7 and U7 part 2 engine
[17:30:06] --- Topic for #exult set by ChanServ at Tue Jan 30 07:24:39 2001
[17:30:14] <Fingolfin> I forgot to remake exult.flx I guess ;)
[17:30:20] <wjp> :-)
[17:30:37] <wjp> that would be a problem, yes :-)
[17:30:39] <Fingolfin> oh BTW
[17:30:55] <Fingolfin> I personally would've preferd if you had the order in the keys file the other way around
[17:31:00] <Fingolfin> show_help H
[17:31:12] <Fingolfin> makes it much easier to read/browse, IMHO
[17:31:14] <Fingolfin> or to sort
[17:31:46] <wjp> hmm... doable I guess. Where would you like the params?
[17:32:37] <Fingolfin> at the end is OK
[17:33:28] <wjp> that's probably just swapping the two blocks
[17:34:05] <wjp> sometime I should probably add support for multiple actions/key
[17:34:27] <wjp> (for doing things like automatically generating a full set of magic armour :-) )
[17:36:23] <wjp> brb
[17:47:34] <wjp> b
[17:50:19] <Fingolfin> wb
[17:50:20] <Fingolfin> hrm
[17:50:38] <Fingolfin> expack does not work properly anymore since dancer/ryan/whomever rewrote it :(
[17:50:45] <Fingolfin> gotta check it, but first I need to eat a bi
[17:50:46] <Fingolfin> t
[17:50:47] <Fingolfin> brb
[17:54:20] <Fingolfin> b
[17:54:27] <Fingolfin> ah, I think I know how to fix expack
[17:55:17] <wjp> good
[17:55:51] <wjp> hmm... I think it'll choke on empty lines in the input file
[17:56:18] <Fingolfin> the problem is that ifstream is used improperly
[17:56:28] <Fingolfin> instead of closing and reopening the file, I put in this:
[17:56:29] <Fingolfin> respfile.clear();
[17:56:29] <Fingolfin> respfile.seekg(0);
[17:57:10] <wjp> I see
[17:57:30] <Fingolfin> reopening is inefficient; but not calling clear() is a bug ;)
[17:57:56] <Fingolfin> ah, question:
[17:58:10] <wjp> btw, in the first pass it ignores empty lines, in the second pass it doesn't
[17:58:18] <Fingolfin> are files on unix terminated by \r or by \n ?
[17:58:21] <Fingolfin> I mix it up all the time ;)
[17:58:36] <wjp> usually \n, but I don't think it's required
[17:58:38] <Fingolfin> why does it do two passes, anyway? hrm
[17:58:51] <Fingolfin> it does so because it want to allocate an array..
[17:58:55] <Fingolfin> why not use a std::list?
[17:59:48] <wjp> better make it a list of strings while you're at it :-)
[17:59:58] <wjp> saves all that memory allocation hassle
[18:00:33] <Fingolfin> yeah
[18:00:36] <Fingolfin> I will redo it ;)
[18:00:40] <wjp> hmm... I should probably use a list instead of a vector for storing the help list
[18:01:31] <wjp> I only need to add items and go through it sequentially
[18:01:33] <Fingolfin> hrm
[18:01:59] <Fingolfin> I will not redo it using std::list, since then I would have to translate argv to a std::list; I will simply fix the empty lines problem
[18:02:35] <wjp> hmm... no equivalent for Perl's 'split' function?
[18:03:24] <wjp> umm, ignore that comment
[18:05:00] <wjp> the "usage" output at the end is outdated too, btw
[18:06:38] <wjp> dinner's ready, bbl
[18:06:42] --- wjp is now known as wjp|dinner
[18:07:25] <Fingolfin> have a nice meal ;)
[18:23:29] <Fingolfin> keybinder works nice!
[18:33:45] --- wjp|dinner is now known as wjp
[18:34:07] <Fingolfin> commited my changes
[18:34:14] <wjp> k, updating...
[18:34:14] <Fingolfin> please try if expack works
[18:34:17] <Fingolfin> ah, and wb ;)
[18:34:27] <wjp> thx :-)
[18:34:56] <wjp> btw, did you get any cvs-logs mails from my update yet?
[18:35:11] <wjp> oops, conflicts in keys.cc and .h
[18:36:57] <Fingolfin> no emails
[18:37:02] <Fingolfin> conflict -> bad :(
[18:37:26] <wjp> I moved the 'Actions' declaration from keys.h to keys.cc, that caused it
[18:37:50] <wjp> (it's only used internally)
[18:39:51] <Fingolfin> ic
[18:40:48] <wjp> ah, you changed the help output for Mac too I see. good
[18:41:31] <wjp> should I change the parser to accept 'cmd' too?
[18:43:14] <wjp> oh, that reminds me... what's the 'proper' way to compare that substring?
[18:43:46] <Fingolfin> about the parser... well, do it maybe
[18:43:51] <Fingolfin> about compare: second please
[18:45:22] <Fingolfin> hm, compare should be fine normally
[18:45:56] <Fingolfin> but you used it wrongly
[18:46:15] <wjp> I was experimenting :-)
[18:46:29] <wjp> the commented version was the last of my experiments :-)
[18:46:34] <Fingolfin> u.compare(0,3,"ALT-")
[18:46:42] <wjp> that failed to compile
[18:46:47] <Fingolfin> if (u.compare(0,3,"ALT-") == 0) {
[18:46:52] <Fingolfin> compiles fine here...
[18:46:59] <Fingolfin> you might have to write this:
[18:47:03] <Fingolfin> if (u.compare(0,3,"ALT-",4) == 0) {
[18:47:11] <Fingolfin> if it still does not compile, something is wrong...
[18:47:24] <Fingolfin> I got this straight from a C++ ref, and it compiles fine here, too
[18:47:24] <wjp> are you sure the 3 shouldn't be a 4?
[18:47:29] <Fingolfin> yes
[18:47:31] <Fingolfin> I am sure
[18:47:31] <Fingolfin> ;)
[18:48:27] <Fingolfin> hrm
[18:48:30] <Fingolfin> but then...
[18:48:38] <Fingolfin> wait a moment, maybe I was wrongly sure ;)
[18:48:39] <wjp> trying again with compare(0,3,"ALT-")..
[18:48:43] * Fingolfin sighs
[18:48:46] <wjp> compile error :-(
[18:48:54] <wjp> trying with compare(0,3,"ALT-",4)
[18:49:11] <Fingolfin> wait
[18:49:12] <wjp> compile error again
[18:49:15] <Fingolfin> 3 should be 4
[18:49:17] <Fingolfin> oh well ;)
[18:49:22] <Fingolfin> compiler error hrm...
[18:49:38] <Fingolfin> can you send me your <string> header? or maybe check it yourself...
[18:49:39] <wjp> trying compare(0,4,"ALT-",0,4)
[18:49:44] <Fingolfin> maybe the gcc libs are old?
[18:50:05] <wjp> it's suggesting tons of alternatives
[18:50:52] <wjp> all of them have a const char* as their first argument
[18:51:05] <wjp> (or a string&)
[18:52:09] <wjp> how weird
[18:54:14] <Fingolfin> hrm
[18:54:18] <Fingolfin> very weird, indeed
[18:54:51] <wjp> I can't get it to work
[18:55:17] <wjp> I've tried "alt-",0,4 "alt-",0,3 "alt-4",4
[18:55:36] * Fingolfin shrugs
[18:55:45] <Fingolfin> I knew libg++ was flawed ;)
[18:56:13] <wjp> I'll check the headers :-)
[18:57:00] <wjp> compare (const charT* s, size_type pos, size_type n) const
[18:57:20] <wjp> that's the only one in basic_string
[18:57:53] <wjp> bastring.cc I mean
[18:58:22] <wjp> I don't like this comment in the .h file: // There is no 'strncmp' equivalent for charT pointers.
[18:59:37] <wjp> there are only 3 compare functions in the header
[19:01:06] <wjp> int compare (const basic_string& str, size_type pos = 0, size_type n = npos) const;
[19:01:09] <wjp> int compare (const charT* s, size_type pos, size_type n) const;
[19:01:12] <wjp> int compare (const charT* s, size_type pos = 0) const
[19:01:18] <wjp> bah
[19:02:11] <wjp> comment at the top of bastring.h: // NOTE : This does NOT conform to the draft standard and is likely to change
[19:03:26] * wjp kicks glibc
[19:04:28] <Fingolfin> ahah
[19:04:31] <Fingolfin> ;)
[19:04:35] <Fingolfin> oh well
[19:04:41] <Fingolfin> we can live with your work-around
[19:05:03] <wjp> yeah, speed isn't really necessary here :-)
[19:05:11] --- Fingolfin is now known as Fingolfin|dinner
[19:05:21] <Fingolfin|dinner> nope ;)
[19:45:24] --- Fingolfin|dinner is now known as Fingolfin
[19:53:43] <wjp> bbl
[20:11:04] <Fingolfin> cya
[20:11:05] <-- Fingolfin has left IRC (42)
[20:34:14] <-- exultbot has left IRC (signing off...)
[20:34:18] --> exultbot has joined #exult
[20:40:41] --> wjp has joined #exult
[20:40:41] --> chimera|work has joined #exult
[20:43:12] <-- chimera|work has left IRC (forward.openprojects.net zsoldos.openprojects.net)
[20:43:12] <-- wjp has left IRC (forward.openprojects.net zsoldos.openprojects.net)
[20:43:17] --> wjp has joined #exult
[20:44:34] --> chimera|work has joined #exult
[22:07:43] --> Fingolfin has joined #exult
[22:08:21] <Fingolfin> lo
[22:09:36] <Fingolfin> brb
[22:09:39] <-- Fingolfin has left IRC (42)
[23:26:36] <-- wjp has left IRC ([x]chat)