amd Report post Posted April 27, 2006 (edited) Hello, Looked into code yesterday and noticed one possible cleanup: only console.c uses list.c which implements doubly-linked lists. I killed the list.c and now use glib-2.0 (yes, it introduces another dependancy, but I have noticed places for other possible cleanups which will use glib). I also tried to clean up the history buffer API and add gtk-doc formatted comments to it. Duh... seems like I tested the wrong thing and accidentaly broke the command functionality. No patch yet. Note: Makefiles for other systems except Linux (which I fixed) need updating. Also, why I would prefer to introduce glib dependency: GLib is a lower-level library that provides many useful definitions and functions available for use when creating applications. These include definitions for basic types and their limits, standard macros, type conversions, byte order, memory allocation, warnings and assertions, message logging, timers, string utilities, hook functions, a lexical scanner, dynamic loading of modules, and automatic string completion. A number of data structures (and their related operations) are also defined, including memory chunks, doubly-linked lists, singly-linked lists, hash tables, strings (which can grow dynamically), string chunks (groups of strings), arrays (which can grow in size as elements are added), balanced binary trees, N-ary trees, quarks (a two-way association of a string and a unique integer identifier), keyed data lists (lists of data elements accessible by a string or integer id), relations and tuples (tables of data which can be indexed on any number of fields), and caches. And I will continue managing my patchset until it gets committed Edited April 28, 2006 by amd Share this post Link to post Share on other sites
Entropy Report post Posted April 27, 2006 Adding a new dependency is, IMHO, the opposite of cleaning. The game is hard to compile as it is, no need for even more libraries. New libraries should be added ONLY in necesary. Share this post Link to post Share on other sites
roswell_r Report post Posted April 28, 2006 Cool, maybe while you're playing around with the console code you can find that bug people have that crashes their client due to something chat related. Ive crashed a few times using #cls. And seem to also when writting or receiving PM. Share this post Link to post Share on other sites
Vegar Report post Posted April 28, 2006 Cool, maybe while you're playing around with the console code you can find that bug people have that crashes their client due to something chat related. Ive crashed a few times using #cls. And seem to also when writting or receiving PM. Does this happen with latest CVS? I have fixed a whole bunch of bugs in the console code the past few months. Share this post Link to post Share on other sites
Learner Report post Posted April 28, 2006 Cool, maybe while you're playing around with the console code you can find that bug people have that crashes their client due to something chat related. Ive crashed a few times using #cls. And seem to also when writting or receiving PM. Does this happen with latest CVS? I have fixed a whole bunch of bugs in the console code the past few months. Steps to reproduce consol bugs: 1. Allow consol text buffer to get very full and it starts removing old lines from the buffer 2. In consol mode, observe that the bottom line is an old line of text from much earlier, when a new line of text appears 3. make sure you have lines that have been wrapping 4. Type #cls 5. Game will either crash, or most (but not all lines) will be removed) This has been verified with the current CVS from this morning. Share this post Link to post Share on other sites
crusadingknight Report post Posted April 28, 2006 (edited) In my opinion, GLIB is a huge library, which is designed for work in such things as enterprise-level applications. Only using the linked lists from it is certainly overkill, not to mention that replacing and maintaining the replacements, complete with their overhead would take extra time. (For example - every ADT in GLib is thread-safe through the use of locks.) One last point - glib-2.8.6.tar.bz2 is 2629 KB. That's larger than a client itself, and would definitely balloon the distibuted archive. EDIT: Just noticed your point about gtk-doc. In fact, the documentation format for the Eternal Lands Client is doxygen. Edited April 28, 2006 by crusadingknight Share this post Link to post Share on other sites